@dsh-electron/dsh-plugin-multi-root-workspace 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["F","_a","util.jsonStringifyReplacer","initializer","core.$ZodAsyncError","util.finalizeIssue","core.config","validateAsync","_emoji","number","boolean","util.nullish","util.floatSafeRemainder","util.NUMBER_FORMAT_RANGES","util.codePointLength","util.getLengthableOrigin","regexes.lowercase","regexes.uppercase","util.escapeRegex","content","util.aborted","util.explicitlyAborted","core.$ZodAsyncError","util.hide","util.finalizeIssue","core.config","regexes.anyString","regexes.guid","regexes.uuid","regexes.email","regexes.emoji","regexes.nanoid","regexes.nanoidOfLength","regexes.cuid","regexes.cuid2","regexes.ulid","regexes.xid","regexes.ksuid","regexes.datetime","regexes.date","regexes.time","regexes.duration","regexes.ipv4","regexes.ipv6","regexes.cidrv4","regexes.cidrv6","regexes.e164","regexes.number","regexes.boolean","util.sizeCaps","util.prefixIssues","util.optionalKeys","util.cached","isObject","util.isObject","util.esc","allowsEval","util.allowsEval","util.cleanRegex","util.isPlainObject","util.getEnumValues","util.escapeRegex","core.$ZodEncodeError","util.issue","util.rawShape","util.parsedType","util.stringifyPrimitive","util.joinValues","util.normalizeParams","checks.$ZodCheckLessThan","checks.$ZodCheckGreaterThan","checks.$ZodCheckMultipleOf","checks.$ZodCheckMaxLength","checks.$ZodCheckMinLength","checks.$ZodCheckLengthEquals","checks.$ZodCheckRegex","checks.$ZodCheckLowerCase","checks.$ZodCheckUpperCase","checks.$ZodCheckIncludes","checks.$ZodCheckStartsWith","checks.$ZodCheckEndsWith","checks.$ZodCheckOverwrite","util.slugify","issue","util.issue","checks.$ZodCheck","regexes.base64","regexes.base64url","core.formatError","core.flattenError","util.jsonStringifyReplacer","en","core.memoizer","util.mergeDefs","core.clone","checks.overwrite","util.hide","core.standardProps","parse.parse","parse.parseAsync","parse.safeParse","parse.safeParseAsync","parse.validate","parse.validateAsync","parse.encode","parse.decode","parse.encodeAsync","parse.decodeAsync","parse.safeEncode","parse.safeDecode","parse.safeEncodeAsync","parse.safeDecodeAsync","processors.stringProcessor","processors.aggregateChecks","checks.regex","checks.includes","checks.startsWith","checks.endsWith","checks.minLength","checks.maxLength","checks.length","checks.lowercase","checks.uppercase","checks.trim","checks.normalize","checks.toLowerCase","checks.toUpperCase","checks.slugify","core._email","core._url","core._jwt","core._emoji","core._guid","core._uuid","core._uuidv4","core._uuidv6","core._uuidv7","core._nanoid","core._cuid","core._cuid2","core._ulid","core._base64","core._base64url","core._xid","core._ksuid","core._ipv4","core._ipv6","core._cidrv4","core._cidrv6","core._e164","core._isoDateTime","core._isoDate","core._isoTime","core._isoDuration","core._string","processors.numberProcessor","checks.gt","checks.gte","checks.lt","checks.lte","checks.multipleOf","core._number","core._int","processors.booleanProcessor","core._boolean","processors.unknownProcessor","core._unknown","processors.neverProcessor","core._never","processors.arrayProcessor","core._array","processors.objectProcessor","util.extend","util.safeExtend","util.merge","util.pick","util.omit","util.partial","util.required","util.normalizeParams","processors.unionProcessor","processors.intersectionProcessor","processors.enumProcessor","processors.transformProcessor","core.$ZodEncodeError","issue","util.issue","processors.optionalProcessor","processors.nullableProcessor","processors.defaultProcessor","util.shallowClone","processors.prefaultProcessor","processors.nonoptionalProcessor","processors.catchProcessor","core.util.constantCatch","processors.pipeProcessor","processors.readonlyProcessor","processors.customProcessor","core._refine","core._superRefine","z.string","z.object","z.number","z.boolean","z.array","z.object","z.string","z.number","z.boolean","z.enum","z.array","z.unknown","NS","useSyncExternalStore","useState","useRef","Switch","installed","primitives","defineStore","NS","css","css","useRef","installed","shared","createSnapshotStore","useState","useRef","IconRightUpOutlineRegular","IconFolderOpenOutlineRegular","Menu","Tooltip","IconChevronDownOutlineRegular","primitives","createSnapshotStore","Toast","IconWarningOutlineRegular","useSyncExternalStore","useState","useRef","useCallback","Menu","Modal","useState","useRef","useCallback","useMemo","Menu","createPortal","NS","OPEN_IN_APP_NS","FILES_TREE_NS","createElement","reader"],"sources":["../src/compat/client-session.ts","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.js","../src/skills-contract.ts","../src/contract.ts","../src/client/locales.ts","../src/client/panel-client.ts","../src/client/styles.ts","../src/compat/skills-client.ts","../src/client/skills-client.ts","../src/client/skills.tsx","../src/client/skills-settings.tsx","../src/compat/client-icons.ts","../node_modules/.pnpm/@deepseek-ai+dsh-typert-protocol@0.2.2-alpha.2_@deepseek-ai+cordis@4.0.6-alpha.1/node_modules/@deepseek-ai/dsh-typert-protocol/lib/index.js","../src/client/files-tree/directory-node.ts","../src/client/files-tree/face.ts","../src/client/files-tree/store.ts","../src/client/files-tree/primitives.ts","../src/client/files-tree/locales.ts","../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../node_modules/.pnpm/@deepseek-ai+dsh-util-workspace-path@0.2.2-alpha.2_@deepseek-ai+cordis@4.0.6-alpha.1/node_modules/@deepseek-ai/dsh-util-workspace-path/lib/index.js","../src/client/files-tree/FilesBody.module.css.ts","../src/client/files-tree/FilesTree.tsx","../src/client/files-tree/adapter.tsx","../node_modules/.pnpm/@deepseek-ai+dsh-host-open-in-app@0.2.2-alpha.2_@deepseek-ai+cordis@4.0.6-alpha.1_@deep_d76f08f4e35ff3a756a48d7d013379f6/node_modules/@deepseek-ai/dsh-host-open-in-app/lib/types/shared.js","../src/compat/open-in-app-routes.ts","../src/client/open-in-app/applications.ts","../src/client/open-in-app/controller.ts","../src/client/open-in-app/locales.ts","../src/client/open-in-app/OpenTargetButton.module.css.ts","../src/client/open-in-app/OpenTargetButton.tsx","../src/client/open-in-app/OpenInAppAction.tsx","../src/compat/open-in-app-device.ts","../src/client/open-in-app/open-toast.tsx","../src/client/open-in-app/adapter.tsx","../src/client/WorkspaceFoldersAction.tsx","../src/client/RootSwitcher.tsx","../src/client/index.ts"],"sourcesContent":["/**\n * Compatibility adapter for \"which session is the client looking at\".\n *\n * The browser panel has to name that session before it may call the host\n * (ADR-0008). Upstream moved the fact between two releases this plugin\n * supports, without renaming the `sessions` service:\n *\n * ```text\n * 0.1.5-rc.2, 0.1.6-alpha.1\n * sessions.list.getSnapshot().current SessionId | undefined\n * 0.1.6-alpha.2, 0.1.7-alpha.1, 0.1.7-alpha.2, 0.1.7-rc.1, 0.1.7-rc.2\n * the catalog has no `current`. The main view retains its session with\n * source `mainView`, and that count is projected onto the list row:\n * sessions.list.getSnapshot().byId[id].retainedBy.mainView > 0\n * ```\n *\n * Reading only `current` makes 0.1.6-alpha.2 report \"no active session\"\n * while a conversation is on screen. Reading the first catalog id would\n * name a session the operator is not looking at. This probe prefers the\n * explicit selection when that field is a non-empty string, and otherwise\n * the first row the main view actually retains — the same predicate\n * `ui-session` uses to publish the main binding.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/compat/client-session\n */\n\n/** The list snapshot, when the service actually exposes one. */\ninterface ListSnapshot {\n readonly current?: unknown\n readonly byId?: unknown\n}\n\n/**\n * The session the composed client is showing, when it can name one.\n * @param sessions - the client `sessions` service, or whatever this\n * composition provided under that name. Absence is a supported state.\n * @returns the session id, or `undefined` when no main view holds one.\n */\nexport function currentSessionIdOf(sessions: unknown): string | undefined {\n const snapshot = listSnapshotOf(sessions)\n if (snapshot === undefined) return undefined\n const current = snapshot.current\n if (typeof current === 'string' && current !== '') return current\n return mainViewSessionId(snapshot.byId)\n}\n\n/** Observe native catalog changes when this surface provides a subscribable store. */\nexport function subscribeSessions(sessions: unknown, listener: () => void): () => void {\n if (sessions === null || typeof sessions !== 'object') return () => {}\n const list = (sessions as { list?: { subscribe?: (listener: () => void) => () => void } }).list\n return typeof list?.subscribe === 'function' ? list.subscribe(listener) : () => {}\n}\n\n/** Selection changes only: activity/title updates must not close a Skill preview. */\nexport function subscribeCurrentSession(sessions: unknown, listener: () => void): () => void {\n let previous = currentSessionIdOf(sessions)\n return subscribeSessions(sessions, () => {\n const current = currentSessionIdOf(sessions)\n if (current !== previous) { previous = current; listener() }\n })\n}\n\n/**\n * The list snapshot, when the service actually exposes one.\n *\n * `getSnapshot` is invoked as a method so a real store can read `this`.\n * Extracting the function and calling it unbound drops that binding and\n * yields `undefined` even when a session is selected.\n */\nfunction listSnapshotOf(sessions: unknown): ListSnapshot | undefined {\n if (sessions === null || typeof sessions !== 'object') return undefined\n const list = (sessions as { list?: unknown }).list\n if (list === null || typeof list !== 'object') return undefined\n const holder = list as { getSnapshot?: unknown }\n if (typeof holder.getSnapshot !== 'function') return undefined\n let snapshot: unknown\n try {\n snapshot = holder.getSnapshot()\n } catch {\n return undefined\n }\n if (snapshot === null || typeof snapshot !== 'object') return undefined\n return snapshot as ListSnapshot\n}\n\n/**\n * The first catalog row retained by the main view.\n *\n * Enumeration order is the catalog's insertion order, which is the order\n * upstream's own main-binding projection scans. A row counts only while\n * `retainedBy.mainView` is a positive number: zero, a missing source, and a\n * non-numeric value are not a selection.\n * @param byId - the catalog map, or anything else the snapshot happened to carry.\n * @returns that row's session id.\n */\nfunction mainViewSessionId(byId: unknown): string | undefined {\n if (byId === null || typeof byId !== 'object') return undefined\n for (const [key, row] of Object.entries(byId)) {\n if (!isMainViewRow(row)) continue\n const id = (row as { id?: unknown }).id\n if (typeof id === 'string' && id !== '') return id\n if (key !== '') return key\n }\n return undefined\n}\n\n/** Whether one catalog value is a row the main view currently retains. */\nfunction isMainViewRow(row: unknown): boolean {\n if (row === null || typeof row !== 'object') return false\n const retainedBy = (row as { retainedBy?: unknown }).retainedBy\n if (retainedBy === null || typeof retainedBy !== 'object') return false\n const count = (retainedBy as { mainView?: unknown }).mainView\n return typeof count === 'number' && count > 0\n}\n","import { globalConfig } from \"./core.js\";\n// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function toZod() {\n return (schema) => schema;\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}\n// the accessor lives on a shared prototype: an own accessor makes every box a dictionary-mode object (~360 B and a slow load per read against ~100 B and an inlined getter here)\nclass Cached {\n constructor(getter) {\n this._getter = getter;\n this._value = undefined;\n }\n get value() {\n const getter = this._getter;\n if (getter !== undefined) {\n this._value = getter();\n this._getter = undefined;\n }\n return this._value;\n }\n}\nexport function cached(getter) {\n return new Cached(getter);\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 ratio = val / step;\n const roundedRatio = Math.round(ratio);\n // `val` and `step` each round to a double before the division rounds again, so a true decimal multiple's quotient can sit up to 1.5 of these scaled epsilons from the integer. A 1x tolerance therefore rejected 2.03 as a multiple of 0.07; 4x covers the worst case with margin.\n const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);\n if (Math.abs(ratio - roundedRatio) < tolerance)\n return 0;\n return ratio - roundedRatio;\n}\nconst EVALUATING = /* @__PURE__*/ 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}\n/**\n * Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.\n *\n * Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.\n */\nexport function rawShape(def) {\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n return desc?.get ? desc.get.raw : desc?.value;\n}\n// where a builder reads its source's keys and descriptors, resolving only a shape a def answers for itself. A shape resolves by object spread, so only its enumerable keys are ever part of it.\nfunction sourceShape(schema) {\n return rawShape(schema._zod.def) ?? schema._zod.def.shape;\n}\n// a key whose value is not settled yet, self-caching so every read after the first gets the same one\nfunction deferProp(target, key, getter) {\n Object.defineProperty(target, key, {\n get() {\n const value = getter();\n assignProp(this, key, value);\n return value;\n },\n enumerable: true,\n configurable: true,\n });\n}\n// Writes a settled key. A plain assignment is much cheaper than `defineProperty` and produces the same descriptor, but it runs whatever setter already answers to the key — an accessor this shape deferred, or an inherited one, which `__proto__` has on every object and prototype pollution can add for any name.\nfunction putProp(target, key, value) {\n if (key in target)\n assignProp(target, key, value);\n else\n target[key] = value;\n}\n/**\n * Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.\n *\n * A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.\n */\nfunction mirrorShape(target, source, keys, wrap) {\n const raw = sourceShape(source);\n for (const key of keys) {\n const desc = Object.getOwnPropertyDescriptor(raw, key);\n if (!desc.enumerable)\n continue;\n if (desc.get) {\n deferProp(target, key, () => {\n const value = source._zod.def.shape[key];\n return wrap ? wrap(value, key) : value;\n });\n }\n else\n putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);\n }\n}\n// same, for a plain shape a caller passed rather than a schema's\nfunction mirrorProps(target, source) {\n for (const key of Reflect.ownKeys(source)) {\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!desc.enumerable)\n continue;\n if (desc.get)\n deferProp(target, key, () => source[key]);\n else\n putProp(target, key, desc.value);\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 = /* @__PURE__*/ cached(() => {\n // Skip the probe under `jitless`: strict CSPs report the caught `new Function` as a `securitypolicyviolation` even though the throw is swallowed.\n if (globalConfig.jitless) {\n return false;\n }\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 if (o instanceof Map)\n return new Map(o);\n if (o instanceof Set)\n return new Set(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 = /* @__PURE__*/ new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = /* @__PURE__*/ new Set([\n \"string\",\n \"number\",\n \"bigint\",\n \"boolean\",\n \"symbol\",\n \"undefined\",\n]);\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 !== undefined && shape[k]._zod.optout === \"optional\";\n });\n}\n// Wrapped in a `@__PURE__` IIFE: esbuild never tree-shakes a top-level initializer that contains a member access on `Number`, so the bare object literal survived into every bundle.\nexport const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({\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 newShape = {};\n mirrorShape(newShape, schema, maskedKeys(schema, mask));\n return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));\n}\n// the mask keys that select something, checked against the source's shape without resolving it\nfunction maskedKeys(schema, mask) {\n const raw = sourceShape(schema);\n const keys = [];\n // `for...in` skips symbols, so a symbol in the mask would select nothing\n for (const key of Reflect.ownKeys(mask)) {\n if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {\n throw new Error(`Unrecognized key: \"${String(key)}\"`);\n }\n if (mask[key])\n keys.push(key);\n }\n return keys;\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 omitted = new Set(maskedKeys(schema, mask));\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));\n return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));\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. Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = sourceShape(schema);\n for (const key of Reflect.ownKeys(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 return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));\n}\n// the source's keys, then the caller's overlaid on top\nfunction extended(schema, shape) {\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));\n mirrorProps(newShape, shape);\n return newShape;\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));\n}\nexport function merge(a, b) {\n if (!b?._zod?.def) {\n throw new Error(\"Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.\");\n }\n if (a._zod.def.checks?.length) {\n throw new Error(\".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.\");\n }\n const newShape = {};\n mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));\n mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));\n const def = mergeDefs(a._zod.def, {\n shape: newShape,\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: b._zod.def.checks ?? [],\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask, name = \"partial\") {\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(`.${name}() cannot be used on object schemas containing refinements`);\n }\n const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class &&\n ((value, key) => (selected && !selected.has(key) ? value : new Class({ type: \"optional\", innerType: value }))));\n return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));\n}\nexport function required(Class, schema, mask) {\n const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => \n // overwrite with non-optional\n selected && !selected.has(key) ? value : new Class({ type: \"nonoptional\", innerType: value }));\n return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));\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}\n// Checks for explicit abort (continue === false), as opposed to implicit abort (continue === undefined). Used to respect `abort: true` in .refine() even for checks that have a `when` function.\nexport function explicitlyAborted(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 === false) {\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}\n/* A check holds no link back to the schema it is attached to — the same check instance is shared by every clone of that schema — so the owner is stamped onto the issues a check just raised, at the only point where both are in scope. Runs on the failure path only; `start` is the issue count from before the check ran. */\n/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */\nexport function sizeCaps(defChecks) {\n const caps = [];\n for (const ch of defChecks ?? []) {\n const d = ch._zod.def;\n // a later check may rewrite the value\n if (!/_(length|size)$|_equals$/.test(d.check))\n break;\n const max = d.maximum ?? d.length ?? d.size;\n if (max >= 0)\n caps.push([max, ch]);\n }\n return caps;\n}\nexport function attachSchema(issues, start, inst) {\n var _a;\n for (let i = start; i < issues.length; i++) {\n (_a = issues[i]).schema ?? (_a.schema = inst);\n }\n}\nexport function finalizeIssue(iss, ctx, config) {\n var _a;\n // A schema that raised an issue itself owns it outright, and outranks any stamp an enclosing check left in `attachSchema`. String formats and z.custom() are schema and check at once, so when they act as a check they defer to that stamp instead.\n const traits = iss.inst?._zod?.traits;\n if (traits?.has(\"$ZodType\")) {\n if (traits.has(\"$ZodCheck\"))\n (_a = iss).schema ?? (_a.schema = iss.inst);\n else\n iss.schema = iss.inst;\n }\n // Decreasing specificity, first map to return a message wins. `inst` is whatever raised the issue, so a check's own map outranks the owning schema's.\n const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;\n const message = iss.message\n ? iss.message\n : (unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(schemaError?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\");\n // an explicit own-key copy beats object rest with excluded keys, which v8 routes through a generic runtime call; Object.keys rather than for-in so an issue pushed with a prototype does not leak inherited keys, and an own __proto__ key is dropped rather than assigned through the setter\n const full = {};\n for (const k of Object.keys(iss)) {\n if (k === \"inst\" || k === \"schema\" || k === \"continue\" || k === \"input\" || k === \"__proto__\")\n continue;\n full[k] = iss[k];\n }\n full.path ?? (full.path = []);\n full.message = message;\n if (ctx?.reportInput) {\n full.input = iss.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}\nconst highSurrogate = /[\\uD800-\\uDBFF]/;\n// Code points in `str`: a surrogate pair counts once, a lone surrogate as itself. Hand-rolled because the string iterator allocates and runs ~250x slower on this path; the regex probe exits ~50x quicker for a string with no astral characters.\nexport function codePointLength(str) {\n const units = str.length;\n if (!highSurrogate.test(str))\n return units;\n let count = units;\n for (let i = 0; i < units - 1; i++) {\n if ((str.charCodeAt(i) & 0xfc00) === 0xd800 && (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n count--;\n i++;\n }\n }\n return count;\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////////// PROTOTYPE INSTALLERS //////////\n//\n// Members live on the prototype and materialize per instance on first read, which keeps own-property count under the step where V8 stops using inline slots. Changing anything here means re-measuring runtime, memory and bundle size together — see \"The three axes\" in AGENTS.md.\n/**\n * Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.\n *\n * Call this from a `proto` initializer, which runs once per prototype — never per instance.\n */\nexport function members(proto, table) {\n for (const key in table) {\n const desc = Object.getOwnPropertyDescriptor(table, key);\n // a getter installs as written, so it stays live: `description` reads through to the registry on every access. not enumerable: an object literal's is, and a prototype member never was\n if (desc.get)\n Object.defineProperty(proto, key, { ...desc, enumerable: false });\n // a method materializes bound on first read, which is what keeps a detached member working: `const opt = schema.optional; opt()`\n else\n defineBound(proto, key, desc.value);\n }\n}\n/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */\nexport function own(inst, key, value, enumerable = true) {\n Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });\n return value;\n}\n/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */\nexport function hide(inst, key, value) {\n return own(inst, key, value, false);\n}\n/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */\nexport /*@__NO_SIDE_EFFECTS__*/ function derived(computes, table) {\n for (const key in computes) {\n const compute = computes[key];\n // an object literal's accessor is configurable and enumerable, and `members` copies the descriptor as written\n Object.defineProperty(table, key, {\n configurable: true,\n enumerable: true,\n get() {\n return own(this, key, compute(this));\n },\n set(value) {\n own(this, key, value);\n },\n });\n }\n return table;\n}\nfunction defineBound(proto, key, fn) {\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n // vitest's spyOn calls a prototype getter bare to find the function it wraps, so a nullish receiver answers the raw method\n return this == null ? fn : own(this, key, fn.bind(this));\n },\n set(value) {\n own(this, key, value);\n },\n });\n}\n/** Returns the prototype to install on, or `undefined` if this group is already installed on it. */\nfunction claim(inst, sentinel) {\n const proto = Object.getPrototypeOf(inst);\n // Runs on every construction, so `in` rather than the costlier `hasOwnProperty.call`. Sentinels are keys the group itself defines.\n return sentinel in proto ? undefined : proto;\n}\n// The internals whose init chain is installing. A second call for the same one is a derived constructor overriding its base, so it must not construct another schema in between or the override is dropped.\nlet installing;\n// Set while a getter is running, so a value that resolved through a recursion break is not memoized. One shared descriptor shadows the key for the duration, which costs no per-key allocation.\nlet broke = false;\nconst breaker = {\n configurable: true,\n get() {\n broke = true;\n return undefined;\n },\n};\n/**\n * Installs a lazily-derived internal on the `_zod` prototype of `inst`'s\n * constructor, computed from the internals object itself and cached there on\n * first read. One accessor per constructor rather than one per instance.\n */\nexport function defineLazyInternal(inst, key, compute) {\n const proto = Object.getPrototypeOf(inst._zod);\n if (key in proto && installing !== inst._zod) {\n // A repeat construction: everything is installed already. Cleared here so the reference is not held past the first construction of every type.\n installing = undefined;\n return;\n }\n installing = inst._zod;\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n // Shadowed before computing so a re-entrant read from a recursive schema resolves to undefined instead of running the getter again.\n Object.defineProperty(this, key, breaker);\n const outer = broke;\n broke = false;\n try {\n const value = compute(this);\n // A result that resolved through a recursion break is recomputed once the graph is complete; everything else memoizes, undefined included.\n if (broke)\n delete this[key];\n else\n Object.defineProperty(this, key, { configurable: true, writable: true, value });\n broke = broke || outer;\n return value;\n }\n catch (err) {\n // A compute that threw memoizes nothing, so a later read runs it again and fails the same way. The shadow goes with it, since leaving it installed would answer undefined for every later read.\n delete this[key];\n broke = broke || outer;\n throw err;\n }\n },\n set(value) {\n Object.defineProperty(this, key, { configurable: true, writable: true, value });\n },\n });\n}\n/**\n * Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own\n * data property. One accessor per constructor rather than one per instance, because an own accessor\n * puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.\n */\nexport function installLazyProp(inst, key, make, enumerable) {\n const proto = claim(inst, key);\n if (!proto)\n return;\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n // Shadowed before computing, so a re-entrant read from a self-referential shape resolves to undefined instead of running the getter again. A data property rather than an accessor: an own accessor is the dictionary-mode transition this exists to avoid.\n const desc = { configurable: true, writable: true, enumerable, value: undefined };\n Object.defineProperty(this, key, desc);\n // a compute that throws leaves the shadow behind, so later reads answer undefined instead of re-throwing; `defineLazy` did the same, and `defineLazyInternal`'s delete-on-catch would cost bytes in every bundle for a case only a throwing user getter reaches\n desc.value = make(this);\n Object.defineProperty(this, key, desc);\n return desc.value;\n },\n set(value) {\n Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });\n },\n });\n}\n/** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */\nexport const CONSTANT_CATCH = \"~constantCatch\";\n/** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */\nexport function constantCatch(value) {\n const fn = () => value;\n fn[CONSTANT_CATCH] = true;\n return fn;\n}\n","var _a;\nimport { members as installMembers } from \"./util.js\";\n/** A special constant with type `never` */\nexport const NEVER = /*@__PURE__*/ Object.freeze({\n status: \"aborted\",\n});\n/* Shared descriptor for installing `_zod`; defineProperty reads it\n * synchronously, so reusing one object avoids a per-instance allocation. */\nconst _zodDesc = { value: undefined, enumerable: false };\n// null where suppressing the capture would be unrecoverable: `parse()` puts the frames back with `captureStackTrace`, so without it the throw would lose its stack. also latched to null once `stackTraceLimit` proves unassignable, which a realm can do at any point by hardening Error\nlet _E = \"captureStackTrace\" in Error ? Error : null;\n// v8 captures a stack trace inside the Error constructor, which dominates a failed parse; costs only the frames, and parse() restores those. the constructor must RUN: Object.create is cheaper and passes instanceof, but Error.isError and util.types.isNativeError check an internal slot\nfunction newError(Definition) {\n const E = _E;\n if (E) {\n const saved = E.stackTraceLimit;\n if (typeof saved === \"number\") {\n try {\n E.stackTraceLimit = 0;\n }\n catch {\n _E = null;\n return new Definition();\n }\n try {\n return new Definition();\n }\n finally {\n E.stackTraceLimit = saved;\n }\n }\n }\n return new Definition();\n}\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, \n/** This trait's members, installed once on every prototype that composes it. They cannot be declared in the initializer above: that runs per instance, and the prototype is shared. */\nproto, params) {\n // Prototype for this constructor's `_zod` internals. Lazily-derived fields (`values`, `pattern`, `optin`, …) install here once rather than as an accessor on every instance.\n const zodProto = {};\n // Assigning the fields in the constructor body is what gives instances in-object slots; building the object literally and reparenting it costs a second allocation and a generic property copy.\n function Internals(def) {\n this.def = def;\n this.constr = _;\n this.traits = new Set();\n }\n Internals.prototype = zodProto;\n const protoMembers = proto;\n // One trait's members land on every prototype whose chain composes it, so the answer is per prototype rather than per trait.\n const initialized = protoMembers && new WeakSet();\n function init(inst, def) {\n if (!inst._zod) {\n _zodDesc.value = new Internals(def);\n try {\n Object.defineProperty(inst, \"_zod\", _zodDesc);\n }\n finally {\n // Cleared even on throw, so the shared descriptor never leaks one instance's internals into the next.\n _zodDesc.value = undefined;\n }\n }\n else if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n if (initialized) {\n // `super(def)` from a user subclass gives `this` a prototype the subclass owns, and installing there would overwrite whatever the subclass declared. `constr` built the instance, so its prototype is the one below the subclass's that should carry the members. A receiver whose chain never reaches that prototype installs on its own, which for a plain object handed straight to `init` means `Object.prototype` — unchanged from before.\n const own = Object.getPrototypeOf(inst);\n const ctorProto = inst._zod.constr.prototype;\n let up = own;\n while (up && up !== ctorProto)\n up = Object.getPrototypeOf(up);\n const target = up ?? own;\n if (!initialized.has(target)) {\n initialized.add(target);\n installMembers(target, protoMembers);\n }\n }\n // support prototype modifications; for-in avoids the array allocation of Object.keys on the (usually empty) prototype\n const proto = _.prototype;\n for (const k in proto) {\n if (!Object.prototype.hasOwnProperty.call(proto, k))\n continue;\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 const inst = params?.Parent ? newError(Definition) : this;\n init(inst, def);\n const deferred = inst._zod.deferred;\n if (deferred) {\n for (const fn of deferred) {\n fn();\n }\n // Released: initializers run once, and the list would otherwise be retained for the schema's lifetime.\n inst._zod.deferred = undefined;\n }\n // Global post-processor hook. Internal: installed by `import \"zod/compile\"` to enable AOT compilation for every constructed schema. Runs last, once the instance is fully built, because it hands the instance to compile(). The post-processor is expected to be reentrancy-guarded by its own implementation.\n const pp = globalThis.__zod_globalConfig?.postProcessor;\n if (pp)\n pp(inst);\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 = /*@__PURE__*/ 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}\n(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});\nexport const globalConfig = globalThis.__zod_globalConfig;\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\n/* Computing the message eagerly is expensive (pretty-printed JSON of all\n * issues), so defer it until first read. The accessor functions and\n * descriptors are shared across instances to keep error construction\n * cheap; the computed message is cached on the internals object. The\n * setter preserves plain assignment semantics for consumers that\n * overwrite `message`. */\nfunction _getMessage() {\n const internals = this._zod;\n internals.message ?? (internals.message = JSON.stringify(internals.def, util.jsonStringifyReplacer, 2));\n return internals.message;\n}\nfunction _setMessage(value) {\n this._zod.message = value;\n}\nconst _messageDesc = {\n get: _getMessage,\n set: _setMessage,\n enumerable: true,\n configurable: true,\n};\nconst _issuesDesc = { value: undefined, enumerable: false };\n/* Prototypes that already carry the lazy `toString`. Seeded with the\n * intrinsics so that `init` on a foreign object — it accepts any object —\n * can never install an accessor onto a prototype we do not own. */\nconst _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n // `_zod` is already non-enumerable: $constructor's init defined it with this same descriptor\n _issuesDesc.value = def;\n Object.defineProperty(inst, \"issues\", _issuesDesc);\n // Clear the shared slot; a retained `value` pins the last error's issues.\n _issuesDesc.value = undefined;\n Object.defineProperty(inst, \"message\", _messageDesc);\n /* `toString` lives as a non-enumerable lazy getter on the shared\n * prototype; on first access it caches a per-instance closure so\n * detached usage still works. */\n const proto = Object.getPrototypeOf(inst);\n if (!_installedToString.has(proto)) {\n _installedToString.add(proto);\n Object.defineProperty(proto, \"toString\", {\n configurable: true,\n enumerable: false,\n get() {\n const value = () => this.message;\n Object.defineProperty(this, \"toString\", { value, configurable: true, writable: true });\n return value;\n },\n set(value) {\n Object.defineProperty(this, \"toString\", { value, configurable: true, writable: true });\n },\n });\n }\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, undefined, {\n Parent: Error,\n});\n/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member\n * (\"toString\", \"constructor\") would otherwise read through to the prototype, and assigning\n * \"__proto__\" would hit the setter instead of creating a key. */\nfunction node(obj, key, make) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) {\n if (key === \"__proto__\") {\n Object.defineProperty(obj, key, { value: make(), writable: true, enumerable: true, configurable: true });\n }\n else {\n obj[key] = make();\n }\n }\n return obj[key];\n}\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 node(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, path = []) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n // `_errors` is reserved by this legacy format, so merge a matching path segment into the current node instead of treating its array as a child.\n if (el === \"_errors\") {\n if (terminal)\n curr._errors.push(mapper(issue));\n i++;\n continue;\n }\n // A path element may collide with an inherited property name such as\n // \"__proto__\" or \"constructor\". Truthiness checks read the prototype\n // (so no node is created, then ._errors.push throws), and bracket\n // assignment of \"__proto__\" hits the setter instead of creating an\n // own key. Guard the read with hasOwnProperty and create the node\n // with defineProperty so any path element becomes a real own key.\n if (!Object.prototype.hasOwnProperty.call(curr, el)) {\n Object.defineProperty(curr, el, {\n value: { _errors: [] },\n enumerable: true,\n writable: true,\n configurable: true,\n });\n }\n const node = curr[el];\n if (terminal) {\n node._errors.push(mapper(issue));\n }\n curr = node;\n i++;\n }\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;\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 }, [...path, ...issue.path]));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, [...path, ...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 // el may collide with an inherited property name (\"__proto__\",\n // \"constructor\", ...); ??= reads the prototype so the node is never\n // created and curr.errors.push throws. Guard with hasOwnProperty and\n // create the node with defineProperty so \"__proto__\" becomes a real\n // own key rather than invoking the prototype setter.\n if (!Object.prototype.hasOwnProperty.call(curr.properties, el)) {\n Object.defineProperty(curr.properties, el, {\n value: { errors: [] },\n enumerable: true,\n writable: true,\n configurable: true,\n });\n }\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_a = curr.items)[el] ?? (_a[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\";\n// Always both keys, so the `_params` read site in `_parse` sees one object shape rather than two.\nfunction finalizeParams(callee, params) {\n return { callee: params?.callee ?? callee, Err: params?.Err };\n}\nexport const _parse = (_Err) => {\n const fn = (schema, value, _ctx, _params) => {\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 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 ?? fn);\n throw e;\n }\n return result.value;\n };\n return fn;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => {\n const fn = async (schema, value, _ctx, params) => {\n const ctx = _ctx ? { ..._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 ?? fn);\n throw e;\n }\n return result.value;\n };\n return fn;\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 ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\n// the error is built on the first read of `error`: finalizing the issues and constructing the instance is most of a failing parse, and a caller that only branches on `success` never pays it. a getter in the literal keeps this small; the alternative, one shared accessor descriptor plus a hidden state slot, reads ~15% faster but costs ~75 B gzipped in every bundle\nfunction failure(Err, issues, ctx) {\n let error;\n return {\n success: false,\n get error() {\n if (!error) {\n error = new Err(issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n // finalizeIssue drops `input`, so the built error holds nothing; keeping the raw issues past this point pins the parsed value for the life of the result\n issues = undefined;\n ctx = undefined;\n }\n return error;\n },\n set error(e) {\n error = e;\n // a replacement makes the getter's branch unreachable, so the captures have to go here too\n issues = undefined;\n ctx = undefined;\n },\n };\n}\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._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 ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\n// registry mirrors of the compiler's sentinels, so this module never imports the compiler\nconst COMPILE_INVALID = /* @__PURE__ */ Symbol.for(\"zod.compile.invalid\");\nconst COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for(\"zod.compile.fallback\");\n// Deliberately tiny, because v8 will not inline a body carrying the fallback's object literals and throw. Everything that is not the compiled happy path lives in validateFallback, and that split is worth ~35% on a compiled schema.\nexport const validate = ((schema, value, _ctx) => {\n const validator = schema._zod.bag.validator;\n if (validator !== undefined) {\n if (validator(value) !== COMPILE_INVALID)\n return true;\n // a definite sentinel means the runtime would reject, so skip the re-parse; a ctx can still change the answer\n if (validator.definite === true && _ctx === undefined)\n return false;\n }\n return validateFallback(schema, value, _ctx);\n});\nfunction validateFallback(schema, value, _ctx) {\n const ctx = _ctx\n ? { ..._ctx, async: false, abortEarly: true }\n : { async: false, abortEarly: true };\n const fallbackRun = schema._zod.bag.fallbackRun;\n let result;\n if (fallbackRun) {\n // skip nested fast paths on the fallback, so user callbacks keep the at-most-twice bound\n ctx[COMPILE_FALLBACK] = true;\n result = fallbackRun({ value, issues: [] }, ctx);\n }\n else {\n result = schema._zod.run({ value, issues: [] }, ctx);\n }\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length === 0;\n}\n// no fast path: the compiler keeps async parses on the runtime, because a promise-returning callback that is not declared async compiles to a throw\nexport const validateAsync = async (schema, value, _ctx) => {\n const ctx = _ctx\n ? { ..._ctx, async: true, abortEarly: true }\n : { async: true, abortEarly: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length === 0;\n};\nexport const _encode = (_Err) => {\n const parse = _parse(_Err);\n const fn = (schema, value, _ctx, _params) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return parse(schema, value, ctx, finalizeParams(fn, _params));\n };\n return fn;\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => {\n const parse = _parse(_Err);\n const fn = (schema, value, _ctx, _params) => {\n return parse(schema, value, _ctx, finalizeParams(fn, _params));\n };\n return fn;\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => {\n const parseAsync = _parseAsync(_Err);\n const fn = async (schema, value, _ctx, _params) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return (await parseAsync(schema, value, ctx, finalizeParams(fn, _params)));\n };\n return fn;\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => {\n const parseAsync = _parseAsync(_Err);\n const fn = async (schema, value, _ctx, _params) => {\n return await parseAsync(schema, value, _ctx, finalizeParams(fn, _params));\n };\n return fn;\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._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 ? { ..._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\";\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const cuid = /^[cC][0-9a-z]{6,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\nexport function nanoidOfLength(length) {\n return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);\n}\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-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\n// Single character class, not an alternation: the two properties overlap (U+1F9B0-U+1F9B3), so `(A|B)+` backtracks exponentially on a failed match. The leading lookahead then demands one anchor — a pictograph, a regional indicator, or the enclosing keycap — because `\\p{Emoji_Component}` on its own covers ASCII digits, `#`, `*`, ZWJ, variation selectors and skin tone modifiers, none of which is an emoji without a base.\nconst _emoji = `^(?=[\\\\s\\\\S]*[\\\\p{Extended_Pictographic}\\\\p{Regional_Indicator}\\\\u20E3])[\\\\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}:){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}|:))\\/(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_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;\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 = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,63}$/;\nexport const httpProtocol = /^https?$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces) E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15\nexport const e164 = /^\\+[1-9]\\d{6,14}$/;\n// Credit card shape: 12–19 digits, optionally separated by single spaces or single hyphens. ISO/IEC 7812 caps the PAN at 19 digits; 12 is the shortest issued length (Maestro).\nexport const creditCard = /^\\d(?:[ -]?\\d){11,18}$/;\n// ISO 4217 alpha codes from the SIX list, regenerated by scripts/update-iso-4217.ts\nexport const currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;\n// iban electronic format: 2-letter country, check digits 02-98 (the only values `98 - remainder` can produce), 11-30 bban characters\nexport const iban = /^[A-Z]{2}(?!00|01|99)\\d{2}[A-Z0-9]{11,30}$/;\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])))`;\n/** Anchors a pattern source. The interpolation lives here rather than at the call site because\n * esbuild will not drop a `@__PURE__` call whose own argument interpolates a variable, but it\n * will drop `anchor(dateSource)`. Keeping it inline pinned `date` into every bundle. */\nfunction anchor(source) {\n return new RegExp(`^${source}$`);\n}\nexport const date = /*@__PURE__*/ anchor(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 : args.seconds\n ? `${hhmm}:[0-5]\\\\d(?:\\\\.\\\\d+)?`\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 opts = [\"Z\"];\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 // RFC 3339 mandates seconds wherever the time carries a `Z` or an offset, so only the unqualified form `local` adds may omit them\n const qualified = `${timeSource({ precision: args.precision, seconds: true })}(?:${opts.join(\"|\")})`;\n const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\n// the unbounded form of `string()` as a literal, so every plain string shares one instance instead of building its own\nexport const anyString = /^[\\s\\S]{0,}$/;\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","// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n var _a;\n inst._zod ?? (inst._zod = {});\n inst._zod.def = def;\n (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\n/** Default `when` for size-based checks: run only on non-nullish values with a `size`. */\nconst _whenHasSize = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n};\n/** Default `when` for length-based checks: run only on non-nullish values with a `length`. */\nconst _whenHasLength = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n};\nconst numericOriginMap = {\n number: \"number\",\n bigint: \"bigint\",\n object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n return;\n }\n payload.issues.push({\n origin: numericOriginMap[typeof payload.value] ?? origin,\n code: \"too_big\",\n maximum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n return;\n }\n payload.issues.push({\n origin: numericOriginMap[typeof payload.value] ?? origin,\n code: \"too_small\",\n minimum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n if (typeof payload.value !== typeof def.value)\n throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n const isMultiple = typeof payload.value === \"bigint\"\n ? // `value % 0n` throws, and nothing is a multiple of zero — the number branch already fails this way via NaN\n def.value !== BigInt(0) && payload.value % def.value === BigInt(0)\n : util.floatSafeRemainder(payload.value, def.value) === 0;\n if (isMultiple)\n return;\n payload.issues.push({\n origin: typeof payload.value,\n code: \"not_multiple_of\",\n divisor: def.value,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n def.format = def.format || \"float64\";\n const isInt = def.format?.includes(\"int\");\n const origin = isInt ? \"int\" : \"number\";\n const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (isInt) {\n if (!Number.isInteger(input)) {\n // invalid_format issue\n // payload.issues.push({\n // expected: def.format,\n // format: def.format,\n // code: \"invalid_format\",\n // input,\n // inst,\n // });\n // invalid_type issue\n payload.issues.push({\n expected: origin,\n format: def.format,\n code: \"invalid_type\",\n continue: false,\n input,\n inst,\n });\n return;\n // not_multiple_of issue\n // payload.issues.push({\n // code: \"not_multiple_of\",\n // origin: \"number\",\n // input,\n // inst,\n // divisor: 1,\n // });\n }\n if (!Number.isSafeInteger(input)) {\n if (input > 0) {\n // too_big\n payload.issues.push({\n input,\n code: \"too_big\",\n maximum: Number.MAX_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n else {\n // too_small\n payload.issues.push({\n input,\n code: \"too_small\",\n minimum: Number.MIN_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n return;\n }\n }\n if (input < minimum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_small\",\n minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (input < minimum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size <= def.maximum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size >= def.minimum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size === def.size)\n return;\n const tooBig = size > def.size;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // Strings are measured in Unicode code points, not UTF-16 units. A code point is at most two units, so a string that already fits in units fits in code points; only an overflow has to be counted.\n const length = typeof input === \"string\" && units > def.maximum ? util.codePointLength(input) : units;\n if (length <= def.maximum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // A code point is one or two UTF-16 units, so fewer units than the floor can never reach it and twice the floor always clears it. Only in between is the exact count in doubt.\n const length = typeof input === \"string\" && units >= def.minimum && units < def.minimum * 2\n ? util.codePointLength(input)\n : units;\n if (length >= def.minimum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // A code point is one or two UTF-16 units, so outside `[length, length * 2]` units the target is missed either way — and missed in the same direction in both measures.\n const length = typeof input === \"string\" && units >= def.length && units <= def.length * 2\n ? util.codePointLength(input)\n : units;\n if (length === def.length)\n return;\n const origin = util.getLengthableOrigin(input);\n const tooBig = length > def.length;\n payload.issues.push({\n origin,\n ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n var _a, _b;\n $ZodCheck.init(inst, def);\n if (def.pattern)\n (_a = inst._zod).check ?? (_a.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n inst,\n continue: !def.abort,\n });\n });\n else\n (_b = inst._zod).check ?? (_b.check = () => { });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n $ZodCheckStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"regex\",\n input: payload.value,\n pattern: def.pattern.toString(),\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.lowercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.uppercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const escapedRegex = util.escapeRegex(def.includes);\n // `String.prototype.includes(sub, position)` matches `sub` at `position`\n // OR LATER, so the pattern must allow at least `position` leading chars\n // (`{N,}`), not exactly `position` chars (`{N}`).\n const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);\n def.pattern = pattern;\n inst._zod.check = (payload) => {\n if (payload.value.includes(def.includes, def.position))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"includes\",\n includes: def.includes,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.check = (payload) => {\n if (payload.value.startsWith(def.prefix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"starts_with\",\n prefix: def.prefix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.check = (payload) => {\n if (payload.value.endsWith(def.suffix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"ends_with\",\n suffix: def.suffix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n///////////////////////////////////\n///// $ZodCheckProperty /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(property, result.issues));\n }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n const result = def.schema._zod.run({\n value: payload.value[def.property],\n issues: [],\n }, {});\n if (result instanceof Promise) {\n return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n }\n handleCheckPropertyResult(result, payload, def.property);\n return;\n };\n});\nexport const $ZodCheckProperties = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperties\", (inst, def) => {\n $ZodCheck.init(inst, def);\n util.hide(inst, Symbol.iterator, function* () {\n yield inst;\n });\n // key and schema snapshotted together: reading one live and the other cached lets a later mutation of the caller's shape object pair a stale key with a missing schema\n let entries;\n inst._zod.check = (payload) => {\n // the base schema already typed the value, so only a nullish one is rejected here: the properties read on a primitive too, matching z.property() on a string's length\n if (payload.value == null) {\n payload.issues.push({ expected: \"object\", code: \"invalid_type\", input: payload.value, inst });\n return undefined;\n }\n entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));\n const input = payload.value;\n let proms;\n for (const [key, schema] of entries) {\n const result = schema._zod.run({ value: input[key], issues: [] }, {});\n if (result instanceof Promise) {\n proms ?? (proms = []);\n proms.push(result.then((result) => handleCheckPropertyResult(result, payload, key)));\n }\n else {\n handleCheckPropertyResult(result, payload, key);\n }\n }\n if (proms)\n return Promise.all(proms).then(() => undefined);\n return undefined;\n };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const mimeSet = new Set(def.mime);\n inst._zod.check = (payload) => {\n if (mimeSet.has(payload.value.type))\n return;\n payload.issues.push({\n code: \"invalid_value\",\n values: def.mime,\n input: payload.value.type,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n payload.value = def.tx(payload.value);\n };\n});\n","export class Doc {\n constructor(args = [], closed = {}) {\n this.content = [];\n this.indent = 0;\n this.args = args;\n this.closed = closed;\n }\n // the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it\n indented(fn) {\n this.indent += 1;\n try {\n fn(this);\n }\n finally {\n this.indent -= 1;\n }\n }\n write(arg) {\n if (typeof arg === \"function\") {\n arg(this, { execution: \"sync\" });\n arg(this, { execution: \"async\" });\n return;\n }\n const content = arg;\n const lines = content.split(\"\\n\").filter((x) => x);\n const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));\n const dedented = lines.map((x) => x.slice(minIndent)).map((x) => \" \".repeat(this.indent * 2) + x);\n for (const line of dedented) {\n this.content.push(line);\n }\n }\n compile() {\n const F = Function;\n const content = this?.content ?? [``];\n const factory = new F(...Object.keys(this.closed), `return function (${this.args.join(\", \")}) {\\n${content.join(\"\\n\")}\\n};`);\n return factory(...Object.values(this.closed));\n }\n}\n","export const version = {\n major: 4,\n minor: 6,\n patch: 7,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync } 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 defChecks = inst._zod.def.checks;\n // if inst is itself a checks.$ZodCheck, run it as a check\n const checks = inst._zod.traits.has(\"$ZodCheck\")\n ? [inst, ...(defChecks ?? [])]\n : defChecks?.length\n ? [...defChecks]\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 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 if (payload.memo)\n return payload;\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.def.when) {\n if (util.explicitlyAborted(payload))\n continue;\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 util.attachSchema(payload.issues, currLen, inst);\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 util.attachSchema(payload.issues, currLen, inst);\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 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}, {\n // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.\n get \"~standard\"() {\n return util.hide(this, \"~standard\", standardProps(this));\n },\n set \"~standard\"(value) {\n util.own(this, \"~standard\", value);\n },\n});\n/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */\n// a Standard Schema result only reports issues, so a failure finalizes them straight off the raw payload: no ZodError, and no lazy result to read through\nconst toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())) } : { value: r.value };\nasync function validateAsync(inst, value) {\n const ctx = { async: true };\n return toStandardResult((await inst._zod.run({ value, issues: [] }, ctx)), ctx);\n}\nexport function standardProps(inst) {\n return {\n validate: (value) => {\n const ctx = { async: false };\n try {\n const r = inst._zod.run({ value, issues: [] }, ctx);\n if (!(r instanceof Promise))\n return toStandardResult(r, ctx);\n }\n catch (_) { }\n // async function so a synchronously throwing check rejects instead of escaping validate\n return validateAsync(inst, value);\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 // a format's own pattern, else unbounded; a template literal derives the check-aware form itself\n inst._zod.pattern = def.pattern ?? regexes.anyString;\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});\n/** The `://` guard rejected the input before the URL constructor saw it. */\nexport const URL_BAD_FORMAT = 1;\n/** The URL parser rejected the input. */\nexport const URL_UNPARSEABLE = 2;\nexport function canParseURL(input) {\n try {\n if (typeof URL !== \"undefined\" && typeof URL.canParse === \"function\")\n return URL.canParse(input);\n new URL(input);\n return true;\n }\n catch {\n return false;\n }\n}\nexport function validateURL(trimmed, def) {\n if (!(\"normalize\" in def) && !(\"hostname\" in def) && !(\"protocol\" in def)) {\n return canParseURL(trimmed) || URL_UNPARSEABLE;\n }\n return parseURLObject(trimmed, def);\n}\n/** Parses a URL while preserving the non-normalizing HTTP guard. */\nexport function parseURLObject(trimmed, def) {\n // When normalize is off, require :// for http/https URLs. This prevents strings like \"http:example.com\" or \"https:/path\" from being silently accepted\n if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source && !/^https?:\\/\\//i.test(trimmed)) {\n return URL_BAD_FORMAT;\n }\n try {\n if (typeof URL !== \"undefined\") {\n const URLStatic = URL;\n if (typeof URLStatic.parse === \"function\")\n return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;\n }\n // @ts-ignore\n return new URL(trimmed);\n }\n catch {\n return URL_UNPARSEABLE;\n }\n}\nconst asciiTabOrNewline = /[\\t\\n\\r]/g;\n/** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL(\"https://exa\\nmple.com\")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */\nexport function stripTabAndNewline(value) {\n return value.replace(asciiTabOrNewline, \"\");\n}\nexport function urlHostnameOk(url, hostname) {\n hostname.lastIndex = 0;\n return hostname.test(url.hostname);\n}\nexport function urlProtocolOk(url, protocol) {\n protocol.lastIndex = 0;\n return protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol);\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 const url = validateURL(trimmed, def);\n if (url === URL_BAD_FORMAT) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid URL format\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n return;\n }\n if (url === URL_UNPARSEABLE) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n return;\n }\n if (url === true) {\n payload.value = stripTabAndNewline(trimmed);\n return;\n }\n if (def.hostname && !urlHostnameOk(url, def.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 if (def.protocol && !urlProtocolOk(url, def.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 // Set the output value based on normalize flag\n payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);\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 if (def.length !== undefined && (!Number.isInteger(def.length) || def.length < 1))\n throw new Error(`Invalid nanoid length: ${def.length}`);\n def.pattern ?? (def.pattern = def.length === undefined ? regexes.nanoid : regexes.nanoidOfLength(def.length));\n $ZodStringFormat.init(inst, def);\n});\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\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});\n/** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL(\"http://[...]\")` parses an authority, not an address, so `@` and `\\` re-delimit it and `\"::@1\\\\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `\"::1\\n\"` validated as `::1`. */\nconst ipv6Alphabet = /^[0-9a-fA-F:.]+$/;\nexport function isValidIPv6(value) {\n if (!ipv6Alphabet.test(value))\n return false;\n return canParseURL(`http://[${value}]`);\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.check = (payload) => {\n if (!isValidIPv6(payload.value)) {\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});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport function isValidCIDRv6(value) {\n const parts = value.split(\"/\");\n if (parts.length !== 2)\n return false;\n const [address, prefix] = parts;\n if (!prefix)\n return false;\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n return false;\n if (prefixNum < 0 || prefixNum > 128)\n return false;\n return isValidIPv6(address);\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 if (!isValidCIDRv6(payload.value)) {\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 // atob ignores whitespace, so reject it up front.\n if (/\\s/.test(data))\n return false;\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}\n// lax on purpose: the quantified regexes.base64 overflows the regex stack on multi-MB input and its leading ^$| alternation leaks through template-literal composition; isValidBase64 enforces length and padding\nexport const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = base64Charset);\n $ZodStringFormat.init(inst, def);\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////////////////////////////// ZodBase64URL //////////////////////////////\n// lax on purpose: the quantified regexes.base64url overflows the regex stack on multi-MB input; isValidBase64 enforces length on the padded string\nexport const base64urlCharset = /^[A-Za-z0-9_-]*$/;\nexport function isValidBase64URL(data) {\n if (!base64urlCharset.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 = base64urlCharset);\n $ZodStringFormat.init(inst, def);\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////////////////////////////// ZodCreditCard //////////////////////////////\nconst CC_SANITIZE = /[- ]/g;\n/** Luhn checksum on a digit-only string. Adapted from valibot (MIT). */\nfunction isLuhnAlgo(digits) {\n let length = digits.length;\n let bit = 1;\n let sum = 0;\n while (length) {\n const value = digits.charCodeAt(--length) - 48;\n bit ^= 1;\n sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;\n }\n return sum % 10 === 0;\n}\nexport function isValidCreditCard(input) {\n if (!regexes.creditCard.test(input))\n return false;\n return isLuhnAlgo(input.replace(CC_SANITIZE, \"\"));\n}\nexport const $ZodCreditCard = /*@__PURE__*/ core.$constructor(\"$ZodCreditCard\", (inst, def) => {\n // Shape only — the Luhn check below is not expressible as a pattern, so consumers of `pattern` (JSON Schema, template literals) get the length and separator rules alone.\n def.pattern ?? (def.pattern = regexes.creditCard);\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidCreditCard(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"credit_card\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodIBAN //////////////////////////////\n// iso 7064 mod 97-10 checksum without BigInt\nfunction isIso7064Mod97(iban) {\n let remainder = 0;\n const len = iban.length;\n for (let i = 4; i < len; i++) {\n const code = iban.charCodeAt(i);\n remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;\n }\n for (let i = 0; i < 4; i++) {\n const code = iban.charCodeAt(i);\n remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;\n }\n return remainder === 1;\n}\nexport function isValidIBAN(input) {\n if (!regexes.iban.test(input))\n return false;\n return isIso7064Mod97(input);\n}\nexport const $ZodIBAN = /*@__PURE__*/ core.$constructor(\"$ZodIBAN\", (inst, def) => {\n // shape only — checksum is not expressible as a pattern\n def.pattern ?? (def.pattern = regexes.iban);\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidIBAN(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"iban\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\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 = 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 ? String(input)\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.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});\n// an oversized container fails its leading size checks before any element is parsed\nfunction capSize(inst, size) {\n const caps = util.sizeCaps(inst._zod.def.checks);\n if (!caps.length)\n return;\n const cap = Math.min(...caps.map((c) => c[0]));\n const parse = inst._zod.parse;\n inst._zod.parse = (payload, ctx) => {\n const n = size(payload.value);\n if (n > cap && !ctx?.skipChecks && ctx?.direction !== \"backward\") {\n for (const [max, ch] of util.sizeCaps(inst._zod.def.checks)) {\n if (n > max && ch._zod.def.when(payload)) {\n const start = payload.issues.length;\n ch._zod.check(payload);\n // the value is still the raw input, so no later check may read it\n payload.issues[start].continue = false;\n util.attachSchema(payload.issues, start, inst);\n return payload;\n }\n }\n }\n return parse(payload, ctx);\n };\n}\nconst arraySize = (input) => (Array.isArray(input) ? input.length : -1);\nconst mapSize = (input) => (input instanceof Map ? input.size : -1);\nconst setSize = (input) => (input instanceof Set ? input.size : -1);\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 const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);\n const proms = [];\n const abortEarly = ctx?.abortEarly;\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 // the element's payload is authoritative here, since handleArrayResult forwards every issue; an object's is not, because it drops a failed absent optional\n if (abortEarly && result.issues.length !== 0 && util.aborted(result))\n break;\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n capSize(inst, arraySize);\n});\nfunction handlePropertyResult(result, final, key, input, optin, optout) {\n const isPresent = key in input;\n const isOptionalOut = optout === \"optional\";\n // The middle rung means \"absence permitted, nothing supplied in its place\", so an absent key contributes nothing — whatever the schema made of `undefined` is invented, not substituted. Only `optional` reaches this with a value: `defaulted` substitutes, and a schema that isn't optional-out has to keep the key.\n if (!isPresent && isOptionalOut && optin === \"optional\") {\n return;\n }\n if (result.issues.length) {\n // For optional-in/out schemas, ignore errors on absent keys.\n if (optin !== undefined && isOptionalOut && !isPresent) {\n return;\n }\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n if (!isPresent && optin === undefined) {\n if (!result.issues.length) {\n final.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: undefined,\n path: [key],\n });\n }\n return;\n }\n if (result.value === undefined) {\n if (isPresent || (optin === \"defaulted\" && !isOptionalOut)) {\n final.value[key] = undefined;\n }\n }\n else {\n final.value[key] = result.value;\n }\n}\n// one shared instance; a fresh [] per schema cost 56 bytes retained\nconst NO_SYMBOL_KEYS = [];\nfunction normalizeDef(def) {\n const keys = Object.keys(def.shape);\n const ownSymbols = Object.getOwnPropertySymbols(def.shape);\n const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;\n // aliases `keys` when there are no symbols, so a string-only shape keeps one array\n const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;\n for (const k of allKeys) {\n if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n throw new Error(`Invalid element at key \"${String(k)}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n ...def,\n allKeys,\n symbolKeys,\n // string-only: handleCatchall matches it against `for...in`, which never yields a symbol\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {\n const unrecognized = [];\n const keySet = def.keySet;\n const _catchall = def.catchall._zod;\n const t = _catchall.def.type;\n const optin = _catchall.optin;\n const optout = _catchall.optout;\n // starts at 0, not the current length: the shape phase already ran and may have aborted\n let seen = 0;\n for (const key in input) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n // Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.\n if (keySet.has(key))\n continue;\n // Don't copy an undeclared __proto__ into the result; assignment to a plain {} would replace the result prototype. But in strict mode it is still an unknown key, so report it before skipping.\n if (key === \"__proto__\") {\n if (t === \"never\")\n unrecognized.push(key);\n continue;\n }\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, optin, optout)));\n }\n else {\n handlePropertyResult(r, payload, key, input, optin, optout);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n // Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.\n continue: true,\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 desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n // a cloned def carries its source's accessor, which knows the shape it answers from; adopting that keeps the clone's keys readable without running it\n const sh = desc?.get ? desc.get.raw : (def.shape ?? {});\n if (sh) {\n // Freezes the shape on first read, so its getters resolve once and every later read sees the same schemas.\n const get = () => {\n const newSh = { ...sh };\n Object.defineProperty(def, \"shape\", { value: newSh });\n get.raw = newSh;\n return newSh;\n };\n get.raw = sh;\n Object.defineProperty(def, \"shape\", { get });\n }\n const _normalized = util.cached(() => normalizeDef(def));\n util.defineLazyInternal(inst, \"propValues\", (zod) => {\n const shape = zod.def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n if (!Object.prototype.hasOwnProperty.call(propValues, key)) {\n util.assignProp(propValues, key, new Set());\n }\n for (const v of field.values)\n propValues[key].add(v);\n // An omittable slot reads back as undefined at a discriminator lookup, so it has to claim undefined: two options that can both omit the key are not discriminable on it.\n if (field.optin !== undefined)\n propValues[key].add(undefined);\n }\n }\n return propValues;\n });\n const isObject = util.isObject;\n const catchall = def.catchall;\n let value;\n const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 = memo ? memo.alloc(inst, payload, {}, ctx) : {};\n const proms = [];\n const shape = value.shape;\n const abortEarly = ctx?.abortEarly;\n let seen = payload.issues.length;\n for (const key of value.allKeys) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n if (key === \"__proto__\")\n continue;\n const el = shape[key];\n const optin = el._zod.optin;\n const optout = el._zod.optout;\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, optin, optout)));\n }\n else {\n handlePropertyResult(r, payload, key, input, optin, optout);\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, abortEarly === true);\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 memo = core.globalConfig.memoizer;\n const generateFastpass = (shape) => {\n const normalized = _normalized.value;\n const syms = normalized.symbolKeys;\n // a symbol has no source literal, so it is read as `syms[i]` off the closed-over scope\n const doc = new Doc([\"payload\", \"ctx\"], { shape, inst, memo, syms });\n const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n // prefixes in place, like util.prefixIssues. newResult must land before the early return: a catchall runs after this and would otherwise write onto the caller's input\n const prefixStr = (id, k) => `\n let ${id}_ab = false;\n for (let i = 0; i < ${id}.issues.length; i++) {\n const iss = ${id}.issues[i];\n iss.path = iss.path ? [${k}, ...iss.path] : [${k}];\n payload.issues.push(iss);\n if (iss.continue !== true) ${id}_ab = true;\n }\n if (${id}_ab && ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }`;\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n let counter = 0;\n for (const key of normalized.allKeys) {\n ids[key] = `key_${counter++}`;\n }\n // A: preserve key order {\n doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);\n for (const key of normalized.allKeys) {\n if (key === \"__proto__\")\n continue;\n const id = ids[key];\n const k = typeof key === \"symbol\" ? `syms[${syms.indexOf(key)}]` : util.esc(key);\n const isPresent = `${k} in input`;\n const schema = shape[key];\n const optin = schema?._zod?.optin;\n const isOptionalIn = optin !== undefined;\n const isOptionalOut = schema?._zod?.optout === \"optional\";\n doc.write(`const ${id} = ${parseStr(k)};`);\n if (isOptionalIn && isOptionalOut) {\n // For optional-in/out schemas, ignore errors on absent keys — and, like the interpreted path, drop the value produced alongside them. The middle rung goes further: it permits absence without supplying anything in its place, so an absent key contributes nothing at all.\n const assign = optin === \"optional\" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;\n doc.write(`\n const ${id}_present = ${isPresent};\n if (!${id}.issues.length || ${id}_present) {\n if (${id}.issues.length) {${prefixStr(id, k)}\n }\n\n if (${assign}) {\n newResult[${k}] = ${id}.value;\n }\n }\n\n `);\n }\n else if (!isOptionalIn) {\n doc.write(`\n const ${id}_present = ${isPresent};\n if (${id}.issues.length) {${prefixStr(id, k)}\n }\n if (!${id}_present && !${id}.issues.length) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: undefined,\n path: [${k}]\n });\n if (ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }\n }\n\n if (${id}_present) {\n newResult[${k}] = ${id}.value;\n }\n\n `);\n }\n else {\n doc.write(`\n if (${id}.issues.length) {${prefixStr(id, k)}\n }\n `);\n if (optin === \"defaulted\") {\n doc.write(`newResult[${k}] = ${id}.value;`);\n }\n else {\n doc.write(`\n if (${id}.value !== undefined || ${isPresent}) {\n newResult[${k}] = ${id}.value;\n }\n `);\n }\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n // closing `shape` in is what pays: turbofan specializes the parser against that one shape object, so every `shape[k]._zod.run` folds to a known callee. as a parameter it stays a generic load and measures 13% slower even with the forwarding frame gone\n return doc.compile();\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, ctx?.abortEarly === true);\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.defineLazyInternal(inst, \"optin\", (zod) => zod.def.options.some((o) => o._zod.optin === \"defaulted\")\n ? \"defaulted\"\n : zod.def.options.some((o) => o._zod.optin !== undefined)\n ? \"optional\"\n : undefined);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n util.defineLazyInternal(inst, \"values\", (zod) => {\n if (zod.def.options.every((o) => o._zod.values)) {\n return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n if (zod.def.options.every((o) => o._zod.pattern)) {\n const patterns = zod.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 first = def.options.length === 1 ? def.options[0]._zod.run : null;\n inst._zod.parse = (payload, ctx) => {\n if (first) {\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 matches = [];\n for (let i = 0; i < results.length; i++) {\n if (results[i].issues.length === 0)\n matches.push(i);\n }\n if (matches.length === 1) {\n final.value = results[matches[0]].value;\n return final;\n }\n if (matches.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 matches,\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 first = def.options.length === 1 ? def.options[0]._zod.run : null;\n inst._zod.parse = (payload, ctx) => {\n if (first) {\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});\n/** Returns the option whose discriminator claims `value`, or throws if ambiguous. */\nexport function getDiscriminatedOption(union, value) {\n const internals = union._zod;\n let map = internals.bag.optionsMap;\n if (!map) {\n map = discriminatorMap(internals.def);\n internals.bag.optionsMap = map;\n }\n const option = map.get(value);\n if (option === null)\n throw new Error(`Ambiguous discriminator value \"${String(value)}\"`);\n return option;\n}\nfunction discriminatorMap(def) {\n const map = new Map();\n for (const option of def.options) {\n const values = option._zod.propValues?.[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const value of values) {\n if (map.has(value)) {\n if (value !== undefined)\n throw new Error(`Duplicate discriminator value \"${String(value)}\"`);\n // keep the collision marked so a later member cannot reclaim it\n map.set(value, null);\n }\n else {\n map.set(value, option);\n }\n }\n }\n return map;\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.defineLazyInternal(inst, \"propValues\", (zod) => {\n const propValues = {};\n let undefinedCount = 0;\n for (const option of zod.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 \"${zod.def.options.indexOf(option)}\"`);\n if (pv[zod.def.discriminator]?.has(undefined))\n undefinedCount++;\n for (const [k, v] of Object.entries(pv)) {\n if (!Object.prototype.hasOwnProperty.call(propValues, k)) {\n util.assignProp(propValues, k, new Set());\n }\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n if (!zod.def.unionFallback && undefinedCount > 1)\n propValues[zod.def.discriminator]?.delete(undefined);\n return propValues;\n });\n // Checked now rather than in the lookup map below, so an option that lacks the discriminator fails at the `discriminatedUnion` call instead of on the first object parsed. Options whose shape cannot be enumerated without resolving it — pipes and lazies — are left to the map.\n def.options.forEach((option, i) => {\n const propShape = util.rawShape(option._zod.def);\n if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {\n throw new Error(`Invalid discriminated union option at index \"${i}\"`);\n }\n });\n const disc = util.cached(() => discriminatorMap(def));\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 value = input?.[def.discriminator];\n const opt = disc.value.get(value);\n // forward metadata cannot choose an encoder for an absent tag\n if (opt && (value !== undefined || ctx.direction !== \"backward\")) {\n return opt._zod.run(payload, ctx);\n }\n // Fall back to union matching when the fast discriminator path fails:\n // - explicitly enabled via unionFallback, or\n // - during backward direction (encode), since codec-based discriminators have different values in forward vs backward directions\n if (def.unionFallback || ctx.direction === \"backward\") {\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 options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),\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});\nexport function 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 if (Object.prototype.hasOwnProperty.call(newObj, \"__proto__\"))\n delete newObj.__proto__;\n for (const key of sharedKeys) {\n if (key === \"__proto__\")\n continue;\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) reject each key. A key rejection is reported only when BOTH sides reject it, so a key owned by one branch survives the other's key schema. strictObject reports these as unrecognized_keys; a record with an open key schema reports one invalid_key per key.\n const unrecKeys = new Map();\n let unrecIssue;\n const keyIssues = new Map();\n const collect = (iss, side) => {\n let keys;\n if (iss.code === \"unrecognized_keys\" && !iss.path?.length) {\n unrecIssue ?? (unrecIssue = iss);\n keys = iss.keys;\n }\n else if (iss.code === \"invalid_key\" && iss.origin === \"record\" && iss.path?.length === 1) {\n const k = String(iss.path[0]);\n if (!keyIssues.has(k))\n keyIssues.set(k, iss);\n keys = [k];\n }\n else {\n return false;\n }\n for (const k of keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k)[side] = true;\n }\n return true;\n };\n for (const iss of left.issues) {\n if (!collect(iss, \"l\"))\n result.issues.push(iss);\n }\n for (const iss of right.issues) {\n if (!collect(iss, \"r\"))\n result.issues.push(iss);\n }\n // Report only keys rejected by BOTH sides\n const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);\n if (bothKeys.length) {\n const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];\n if (aggregated.length)\n result.issues.push({ ...unrecIssue, keys: aggregated });\n for (const k of bothKeys) {\n if (!aggregated.includes(k) && keyIssues.has(k))\n result.issues.push(keyIssues.get(k));\n }\n }\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n if (util.aborted(result))\n return result;\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 const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 = memo ? memo.alloc(inst, payload, [], ctx) : [];\n const proms = [];\n const optinStart = getTupleOptStart(items, \"optin\");\n const optoutStart = getTupleOptStart(items, \"optout\");\n if (!def.rest) {\n if (input.length < optinStart) {\n payload.issues.push({\n code: \"too_small\",\n minimum: optinStart,\n inclusive: true,\n input,\n inst,\n origin: \"array\",\n });\n return payload;\n }\n if (input.length > items.length) {\n payload.issues.push({\n code: \"too_big\",\n maximum: items.length,\n inclusive: true,\n input,\n inst,\n origin: \"array\",\n });\n }\n }\n // Run every item in parallel, collecting results into an indexed array. The post-processing in `handleTupleResults` walks them in order so it can decide whether an absent optional-output error can truncate the tail or must be reported to preserve required output.\n const itemResults = new Array(items.length);\n // only tracked when there is a rest loop to skip\n const abortEarly = def.rest ? ctx?.abortEarly : undefined;\n let itemAborted = false;\n for (let i = 0; i < items.length; i++) {\n const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((rr) => {\n itemResults[i] = rr;\n }));\n }\n else {\n itemResults[i] = r;\n if (abortEarly && !itemAborted && r.issues.length)\n itemAborted = util.aborted(r);\n }\n }\n // sound because rest is non-empty exactly when every fixed index is present, the one case handleTupleResults cannot discard an item's issues\n if (def.rest && !itemAborted) {\n let i = items.length - 1;\n const rest = input.slice(items.length);\n let seen = payload.issues.length;\n for (const el of rest) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n i++;\n const result = def.rest._zod.run({ value: el, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((r) => handleTupleResult(r, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));\n }\n return handleTupleResults(itemResults, payload, items, input, optoutStart);\n };\n});\nfunction getTupleOptStart(items, key) {\n for (let i = items.length - 1; i >= 0; i--) {\n // optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.\n const omittable = key === \"optin\" ? items[i]._zod.optin !== undefined : items[i]._zod.optout === \"optional\";\n if (!omittable)\n return i + 1;\n }\n return 0;\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}\nfunction handleTupleResults(itemResults, final, items, input, optoutStart) {\n // Walk results in order. Mirror $ZodObject's swallow-on-absent-optional rule, but only after `optoutStart`: the first index where the output tuple tail can be absent.\n for (let i = 0; i < items.length; i++) {\n const r = itemResults[i];\n const isPresent = i < input.length;\n // The array analog of `handlePropertyResult`'s absent-key early return: the middle rung permits absence without supplying anything in its place, so the tail truncates here instead of materializing whatever the item made of `undefined`.\n if (!isPresent && i >= optoutStart && items[i]._zod.optin === \"optional\") {\n final.value.length = i;\n break;\n }\n if (r.issues.length) {\n if (!isPresent && i >= optoutStart) {\n final.value.length = i;\n break;\n }\n final.issues.push(...util.prefixIssues(i, r.issues));\n }\n final.value[i] = r.value;\n }\n // Drop trailing slots that produced `undefined` for absent input\n // (the array analog of an absent optional key on an object). The\n // `i >= input.length` floor is critical: an explicit `undefined`\n // *inside* the input must be preserved even when the schema is\n // optional-out (e.g. `z.string().or(z.undefined())` accepting an\n // explicit undefined value).\n for (let i = final.value.length - 1; i >= input.length; i--) {\n if (items[i]._zod.optout === \"optional\" && final.value[i] === undefined) {\n final.value.length = i;\n }\n else {\n break;\n }\n }\n return final;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 // no guard in either loop below: a record's invalid_key aborts but an enclosing intersection can reconcile it, so a stopped loop hides keys the sibling does not own and the intersection then rejects nothing\n const proms = [];\n const values = def.keyType._zod.values;\n if (values && !def.partial) {\n payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};\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 // A declared __proto__ is stripped but is not an unrecognized key.\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 continue;\n }\n const outKey = keyResult.value;\n if (outKey === \"__proto__\")\n continue;\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[outKey] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[outKey] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!recordKeys.has(key)) {\n if (def.mode === \"loose\") {\n // skip __proto__ so it can't replace the result prototype via the assignment setter on the plain {} we build into\n if (key === \"__proto__\")\n continue;\n payload.value[key] = input[key];\n }\n else {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n continue: true,\n });\n }\n }\n else {\n payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};\n // An enumerable key schema declares which keys the record owns, so a key outside the set is unrecognized. A non-enumerable one (regex, refine) is a constraint every key must satisfy, so a failing key is invalid. Only the former is reconcilable against the other side of an intersection.\n let unrecognized;\n // Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n if (!Object.prototype.propertyIsEnumerable.call(input, key))\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 is a numeric string and failed, retry with Number(key). This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals\n const checkNumericKey = typeof key === \"string\" && regexes.number.test(key) && keyResult.issues.length;\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 if (values) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(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 // the guard above tests the raw input key, but the key schema can normalize an ordinary key into __proto__; re-check the key we actually write under\n const outKey = keyResult.value;\n if (outKey === \"__proto__\")\n continue;\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[outKey] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[outKey] = result.value;\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n continue: true,\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 const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();\n const abortEarly = ctx?.abortEarly;\n let seen = payload.issues.length;\n for (const [key, value] of input) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\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 capSize(inst, mapSize);\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 const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();\n const abortEarly = ctx?.abortEarly;\n let seen = payload.issues.length;\n for (const item of input) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\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 capSize(inst, setSize);\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 util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const patternValues = util.getEnumValues(zod.def.entries).filter((k) => util.propertyKeyTypes.has(typeof k));\n // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches \"\"\n return new RegExp(patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join(\"|\")})$` : \"^[^\\\\s\\\\S]$\");\n });\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 const values = new Set(def.values);\n inst._zod.values = values;\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const vals = zod.def.values;\n // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches \"\"\n return new RegExp(vals.length\n ? `^(${vals\n .map((o) => typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o))\n .join(\"|\")})$`\n : \"^[^\\\\s\\\\S]$\");\n });\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.optin = \"optional\";\n core.globalConfig.memoizer?.guard(inst);\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(payload, result) {\n // A substituting schema that still failed has no usable answer; yield undefined. Its issues are simply dropped: it ran on a payload of its own, so there is no shared array to truncate and nothing of the caller's to lose with it.\n payload.value = result.issues.length ? undefined : result.value;\n return payload;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n // .optional() propagates absence rather than substituting for it, so a defaulted inner keeps its rung.\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin === \"defaulted\" ? \"defaulted\" : \"optional\");\n inst._zod.optout = \"optional\";\n util.defineLazyInternal(inst, \"values\", (zod) => {\n const values = zod.def.innerType._zod.values;\n return values ? new Set([...values, undefined]) : undefined;\n });\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const pattern = zod.def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === undefined) {\n // Only the top rung substitutes a value for absence; everything else leaves it intact, which is what .optional() means.\n if (def.innerType._zod.optin !== \"defaulted\")\n return payload;\n // Its own payload, for the same reason $ZodCatch gets one: a pipe forwards an unrecognized key through the caller's issues array, and this must not read that as the substituting schema failing and drop it.\n const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);\n if (result instanceof Promise)\n return result.then((result) => handleOptionalResult(payload, result));\n return handleOptionalResult(payload, result);\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.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n util.defineLazyInternal(inst, \"pattern\", (zod) => zod.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.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.innerType._zod.optout);\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const pattern = zod.def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazyInternal(inst, \"values\", (zod) => {\n return zod.def.innerType._zod.values ? new Set([...zod.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 = \"defaulted\";\n util.defineLazyInternal(inst, \"values\", (zod) => zod.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 = \"defaulted\";\n util.defineLazyInternal(inst, \"values\", (zod) => zod.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.defineLazyInternal(inst, \"values\", (zod) => {\n const v = zod.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});\nfunction handleCatchResult(payload, result, def, ctx) {\n if (!result.issues.length) {\n payload.value = result.value;\n // The value carries up, so the flag describing it has to carry with it: a back-edge into a node still being parsed must not be frozen by an enclosing readonly, and its checks belong to the node itself. Guarded so the ordinary case adds no own property.\n if (result.memo)\n payload.memo = true;\n return payload;\n }\n // Spread the inner's own payload, not ours: `value` has to stay the input the catch was handed, and the inner ran on a payload of its own so its issues are already private to this call.\n payload.value = def.catchValue({\n ...result,\n value: payload.value,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n return payload;\n}\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin === \"defaulted\" ? \"defaulted\" : \"optional\");\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.innerType._zod.optout);\n util.defineLazyInternal(inst, \"values\", (zod) => zod.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({ value: payload.value, issues: [] }, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleCatchResult(payload, result, def, ctx));\n }\n return handleCatchResult(payload, result, def, ctx);\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.defineLazyInternal(inst, \"values\", (zod) => zod.def.in._zod.values);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.in._zod.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.out._zod.optout);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.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 // Any issue stops the pipe, so a failing refinement never feeds its transform. An unrecognized key is the exception: it describes the input's extra properties, not the value being piped, and an enclosing intersection may yet reconcile it.\n if (left.issues.some((iss) => iss.code !== \"unrecognized_keys\")) {\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.defineLazyInternal(inst, \"values\", (zod) => zod.def.in._zod.values);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.in._zod.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.out._zod.optout);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.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 $ZodPreprocess = /*@__PURE__*/ core.$constructor(\"$ZodPreprocess\", (inst, def) => {\n $ZodPipe.init(inst, def);\n});\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.def.innerType._zod.propValues);\n util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType?._zod?.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.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 // A repeat visit hands back a node that is still being built; freezing it here would make the rest of its keys fail to assign.\n if (!payload.memo)\n payload.value = Object.freeze(payload.value);\n return payload;\n}\n// a leaf's pattern source with its own checks folded in: the last pattern-carrying check wins, else length bounds narrow the catch-all, else an integer format narrows the number form. the fold lives here instead of on `_zod.pattern` so a bundle without template literals never pays for it\nfunction leafPattern(schema) {\n const def = schema._zod.def;\n let pattern = def.pattern;\n let isInt = !!def.format?.includes(\"int\");\n let minimum;\n let maximum;\n for (const ch of def.checks ?? []) {\n const d = ch._zod.def;\n if (d.pattern)\n pattern = d.pattern;\n isInt || (isInt = !!d.format?.includes(\"int\"));\n const lo = d.minimum ?? d.length;\n const hi = d.maximum ?? d.length;\n if (lo !== undefined && (minimum === undefined || lo > minimum))\n minimum = lo;\n if (hi !== undefined && (maximum === undefined || hi < maximum))\n maximum = hi;\n }\n if (pattern)\n return pattern.source;\n // an empty range matches nothing at runtime, and `{8,5}` is not a legal quantifier\n if (minimum !== undefined && maximum !== undefined && minimum > maximum)\n return \"(?!)\";\n if (minimum !== undefined || maximum !== undefined)\n return regexes.string({ minimum, maximum }).source;\n const own = schema._zod.pattern;\n return (isInt && own === regexes.number ? regexes.integer : own)?.source;\n}\n// a part's pattern source. a wrapper's pattern embeds its inner pattern's source verbatim, so the folded form is substituted in place without knowing the wrapper's own composition; a union's options are joined the way the union builds its own pattern\nfunction partPattern(schema) {\n const def = schema._zod.def;\n const own = schema._zod.pattern?.source;\n // lazy resolves its inner on the internals, not the def\n const inner = def.innerType ?? schema._zod.innerType;\n if (inner) {\n const before = inner._zod.pattern?.source;\n const after = partPattern(inner);\n if (own && before && after && after !== before) {\n return own.replace(util.cleanRegex(before), () => util.cleanRegex(after));\n }\n return own;\n }\n if (def.options) {\n const sources = def.options.map(partPattern);\n if (sources.every(Boolean))\n return `^(${sources.map((s) => util.cleanRegex(s)).join(\"|\")})$`;\n }\n return leafPattern(schema);\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 const source = partPattern(part);\n if (!source) {\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n regexParts.push(util.cleanRegex(source));\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 // Defined, not assigned: the classic prototype exposes `_def` as a getter with no setter.\n Object.defineProperty(inst, \"_def\", { value: 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 // Defined inline so the closure stays anonymous: binding it to a `const` first names it, which costs 256 bytes per implemented function.\n return Object.defineProperty(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 }, \"_zod\", { value: inst._zod, enumerable: false });\n };\n inst.implementAsync = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implementAsync() must be called with a function\");\n }\n return Object.defineProperty(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 }, \"_zod\", { value: inst._zod, enumerable: false });\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 // Cache the resolved inner type on the shared `def` so all clones of this lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance, preserving identity for cycle detection on recursive schemas.\n util.defineLazy(inst._zod, \"innerType\", () => {\n const d = def;\n if (!d._cachedInner)\n d._cachedInner = def.getter();\n return d._cachedInner;\n });\n util.defineLazyInternal(inst, \"pattern\", (zod) => zod.innerType?._zod?.pattern);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.innerType?._zod?.propValues);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.innerType?._zod?.optin ?? undefined);\n util.defineLazyInternal(inst, \"optout\", (zod) => 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","import * as util from \"./util.js\";\nexport class $ZodCyclicError extends Error {\n constructor() {\n super(`Cannot parse a reference cycle that closes through a transform`);\n this.name = \"ZodCyclicError\";\n }\n}\n/** Keyed off the context object every schema in one parse call already shares. */\nconst STATE = \"~memo\";\nconst NO_ISSUES = [];\n// a value a cycle can close through\nfunction isRef(value) {\n return value !== null && typeof value === \"object\";\n}\n// Receivers prefix paths in place, so the cache and every hand-out need their own copies.\nfunction cloneIssues(issues) {\n return issues.map((iss) => (iss.path ? { ...iss, path: iss.path.slice() } : { ...iss }));\n}\nconst recursive = /*@__PURE__*/ new WeakMap();\n/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */\nconst NONE = 0;\nconst ASSUMED = 1;\nconst PROVEN = 2;\n/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */\nfunction isRecursive(inst, stack, resolve) {\n const cached = recursive.get(inst);\n if (cached !== undefined)\n return cached ? PROVEN : NONE;\n // Relative to the walk in progress, so not cached.\n if (stack.has(inst))\n return PROVEN;\n stack.add(inst);\n let result = NONE;\n const check = (child) => {\n if (result !== PROVEN && child?._zod) {\n const answer = isRecursive(child, stack, resolve);\n if (answer > result)\n result = answer;\n }\n };\n // `Reflect.ownKeys` rather than `Object.keys`, so a cycle through a declared symbol key is still seen\n const shape = (sh, spread) => {\n let answer = NONE;\n for (const key of Reflect.ownKeys(sh)) {\n const desc = Object.getOwnPropertyDescriptor(sh, key);\n // an object resolves its shape by spread, so a key it does not enumerate is never parsed; `z.properties` reads every own key and so keeps them all\n if (spread && !desc.enumerable)\n continue;\n // resolving runs user code, and a factory mints a fresh subtree per read, so an edge the walk can't follow counts as a cycle\n const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;\n if (child > answer)\n answer = child;\n }\n return answer;\n };\n const merge = (answer) => {\n if (answer > result)\n result = answer;\n };\n const def = inst._zod.def;\n const kind = def.type;\n switch (kind) {\n case \"object\": {\n const raw = util.rawShape(def);\n // a def with no raw shape answers `shape` from an accessor of its own, and running that can mint a whole fresh subtree\n merge(raw ? shape(raw, true) : ASSUMED);\n check(def.catchall);\n break;\n }\n case \"array\":\n check(def.element);\n break;\n case \"tuple\":\n for (const el of def.items)\n check(el);\n check(def.rest);\n break;\n case \"record\":\n case \"map\":\n check(def.keyType);\n check(def.valueType);\n break;\n case \"set\":\n check(def.valueType);\n break;\n case \"union\":\n for (const el of def.options)\n check(el);\n break;\n case \"intersection\":\n check(def.left);\n check(def.right);\n break;\n case \"optional\":\n case \"nullable\":\n case \"default\":\n case \"prefault\":\n case \"catch\":\n case \"readonly\":\n case \"nonoptional\":\n case \"promise\":\n case \"success\":\n check(def.innerType);\n break;\n case \"pipe\":\n check(def.in);\n check(def.out);\n break;\n case \"function\":\n check(def.input);\n check(def.output);\n break;\n // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly\n case \"lazy\": {\n const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);\n // walked with resolution off: one hop sees past the deferral, and a lazy that yields only another unresolved lazy is generative, so it stops there\n merge(inner ? isRecursive(inner, stack, false) : ASSUMED);\n break;\n }\n // a leaf by choice: `parts` are regex fragments, not data positions\n case \"template_literal\":\n // leaves\n case \"string\":\n case \"number\":\n case \"int\":\n case \"boolean\":\n case \"bigint\":\n case \"symbol\":\n case \"undefined\":\n case \"null\":\n case \"void\":\n case \"never\":\n case \"any\":\n case \"unknown\":\n case \"date\":\n case \"nan\":\n case \"enum\":\n case \"literal\":\n case \"file\":\n case \"transform\":\n case \"custom\":\n break;\n default: {\n // a new built-in kind becomes a compile error here\n kind;\n // a user-defined kind can still hold children, and only its author knows where, so fall back to scanning the def — skipping accessors, since reading one can run user code\n for (const key in def) {\n const desc = Object.getOwnPropertyDescriptor(def, key);\n if (!desc || desc.get)\n continue;\n const value = desc.value;\n if (!value || typeof value !== \"object\")\n continue;\n if (value._zod)\n check(value);\n else if (Array.isArray(value))\n for (const el of value)\n check(el);\n }\n }\n }\n stack.delete(inst);\n return settle(inst, result);\n}\n/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */\nfunction settle(inst, answer) {\n if (answer !== ASSUMED)\n recursive.set(inst, answer === PROVEN);\n return answer;\n}\n/**\n * Whether one parse can re-enter this schema, i.e. its subtree contains a cycle.\n * Exported for `z.compile`, which refuses to compile such a schema: cycle\n * breaking is driven from here off state keyed on the parse context, and a\n * generated fast path has no context to key on.\n */\nexport function isRecursiveSchema(inst) {\n // z.compile never parses, so nothing would ever resolve a lazy for it; it runs once and already treats a throw here as recursive\n return isRecursive(inst, new Set(), true) !== NONE;\n}\nfunction bucketFor(state, inst) {\n let bucket = state.buckets.get(inst);\n if (!bucket) {\n bucket = new WeakMap();\n state.buckets.set(inst, bucket);\n }\n return bucket;\n}\n// Set immediately before delegating to core and cleared immediately after, so `alloc` registers only for a visit this module is driving.\nlet handoff;\n// Allocated but unfinished entries. `alloc` and the matching pop both happen in the synchronous part of a parse, so they nest even when children are async, and one stack serves every schema.\nconst open = [];\nconst memo = {\n alloc(_inst, payload, empty) {\n const bucket = handoff;\n if (!bucket)\n return empty;\n handoff = undefined;\n const entry = { value: empty, issues: null };\n bucket.set(payload.value, entry);\n open.push(entry);\n return empty;\n },\n guard(inst) {\n var _a;\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred.push(() => {\n const base = inst._zod.parse;\n const wrapped = (payload, ctx) => {\n // The value is a placeholder a back-edge is still waiting on, so the cycle closes through this transform. Its output can't exist in time to bind.\n if (ctx.direction !== \"backward\" && isBackEdge(ctx, payload.value))\n throw new $ZodCyclicError();\n return base(payload, ctx);\n };\n inst._zod.parse = wrapped;\n if (inst._zod.run === base)\n inst._zod.run = wrapped;\n });\n },\n attach(inst) {\n var _a;\n let isRecursiveInst;\n let rechecked = false;\n // a recursive schema is re-entered many times per parse and its bucket never changes\n let lastCtx;\n let lastBucket;\n // Wraps `parse` in a deferred so it sees the container's final parse. Core's own deferred copies `parse` into `run` when there are no checks, and it ran first, so `run` is patched to match; with checks, `run` reads `parse` dynamically.\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred.push(() => {\n const base = inst._zod.parse;\n const wrapped = (payload, ctx) => {\n if (isRecursiveInst === undefined) {\n const walked = isRecursive(inst, new Set(), false);\n if (walked === NONE) {\n // Nothing here can ever fire, so take it back out.\n inst._zod.parse = base;\n if (inst._zod.run === wrapped)\n inst._zod.run = base;\n return base(payload, ctx);\n }\n // this parse resolves the deferred edges on its own path, so ask once more before latching\n if (walked === PROVEN || rechecked)\n isRecursiveInst = true;\n else\n rechecked = true;\n }\n const input = payload.value;\n if (!isRef(input))\n return base(payload, ctx);\n let state = ctx[STATE];\n if (!state) {\n state = { buckets: new WeakMap(), backEdges: undefined };\n ctx[STATE] = state;\n }\n let bucket;\n if (lastCtx === ctx) {\n bucket = lastBucket;\n }\n else {\n bucket = bucketFor(state, inst);\n lastCtx = ctx;\n lastBucket = bucket;\n }\n const hit = bucket.get(input);\n if (hit) {\n payload.value = hit.value;\n if (hit.issues) {\n if (hit.issues.length)\n payload.issues.push(...cloneIssues(hit.issues));\n }\n else {\n // Still being parsed: its own checks cover it, so skip them here.\n payload.memo = true;\n state.backEdges ?? (state.backEdges = new WeakSet());\n state.backEdges.add(hit.value);\n }\n return payload;\n }\n handoff = bucket;\n const depth = open.length;\n const result = base(payload, ctx);\n handoff = undefined;\n // A container that rejected its input outright allocated nothing.\n const entry = open.length > depth ? open.pop() : undefined;\n // Both paths written out so the sync one allocates no closure. It runs once per node, and capturing here cost more than everything else combined.\n if (result instanceof Promise) {\n return result.then((r) => {\n if (entry)\n entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;\n return r;\n });\n }\n if (entry)\n entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;\n return result;\n };\n inst._zod.parse = wrapped;\n if (inst._zod.run === base)\n inst._zod.run = wrapped;\n });\n },\n};\n/** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */\nexport function memoizer() {\n return memo;\n}\n/** Whether this value is a node a back-edge resolved to before it finished. */\nexport function isBackEdge(ctx, value) {\n const backEdges = ctx[STATE]?.backEdges;\n return backEdges !== undefined && isRef(value) && backEdges.has(value);\n}\n","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 currency_code: \"currency code\",\n credit_card: \"credit card number\",\n iban: \"IBAN\",\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 function getTypeName(type, input) {\n if (type === \"number\" && typeof input === \"number\" && !Number.isFinite(input)) {\n return String(input);\n }\n return TypeDictionary[type] ?? type;\n }\n return (issue) => {\n switch (issue.code) {\n case \"invalid_type\": {\n const expected = getTypeName(issue.expected);\n const receivedType = util.parsedType(issue.input);\n const received = getTypeName(receivedType, issue.input);\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.exact ? \"exactly \" : 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.exact ? \"exactly \" : 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 if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) {\n const opts = issue.options.map((o) => `'${o}'`).join(\" | \");\n return `Invalid discriminator value. Expected ${opts}`;\n }\n if (issue.inclusive === false) {\n return \"Invalid input: more than one option matched\";\n }\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","var _a;\nexport const $output = /*@__PURE__*/ Symbol(\"ZodOutput\");\nexport const $input = /*@__PURE__*/ 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 checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\nfunction snapshotChecks(def) {\n if (def.checks)\n def.checks = [...def.checks];\n return def;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class(snapshotChecks({ type: \"string\", ...util.normalizeParams(params) }));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class(snapshotChecks({ type: \"string\", coerce: true, ...util.normalizeParams(params) }));\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/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link _cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\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 _creditCard(Class, params) {\n return new Class({\n type: \"string\",\n format: \"credit_card\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _iban(Class, params) {\n return new Class({\n type: \"string\",\n format: \"iban\",\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(snapshotChecks({ type: \"number\", checks: [], ...util.normalizeParams(params) }));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class(snapshotChecks({ type: \"number\", coerce: true, checks: [], ...util.normalizeParams(params) }));\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 _properties(shape, params) {\n return new checks.$ZodCheckProperties({\n check: \"properties\",\n shape,\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: 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 : util.constantCatch(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, params) {\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 if (!(\"input\" in _issue))\n _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 }, params);\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 codec._zod.bag.truthy = truthyArray;\n codec._zod.bag.falsy = falsyArray;\n codec._zod.bag.case = params.case ?? \"insensitive\";\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 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","import { globalRegistry } from \"./registries.js\";\nimport { assignProp } from \"./util.js\";\nfunction assignProps(target, ...sources) {\n for (const source of sources) {\n for (const key of Reflect.ownKeys(source)) {\n if (Object.prototype.propertyIsEnumerable.call(source, key)) {\n assignProp(target, key, source[key]);\n }\n }\n }\n return target;\n}\n// function initializeContext<T extends schemas.$ZodType>(inputs: JSONSchemaGeneratorParams<T>): ToJSONSchemaContext<T> {\n// return {\n// processor: inputs.processor,\n// metadataRegistry: inputs.metadata ?? globalRegistry,\n// target: inputs.target ?? \"draft-2020-12\",\n// unrepresentable: inputs.unrepresentable ?? \"throw\",\n// };\n// }\nexport function initializeContext(params) {\n // Normalize target: convert old non-hyphenated versions to hyphenated versions\n let target = params?.target ?? \"draft-2020-12\";\n if (target === \"draft-4\")\n target = \"draft-04\";\n if (target === \"draft-7\")\n target = \"draft-07\";\n return {\n processors: params.processors ?? {},\n metadataRegistry: params?.metadata ?? globalRegistry,\n target,\n unrepresentable: params?.unrepresentable ?? \"throw\",\n override: params?.override ?? (() => { }),\n io: params?.io ?? \"output\",\n counter: 0,\n seen: new Map(),\n sharedDefsExtractedFor: undefined,\n sharedEmitDoneFor: undefined,\n cycles: params?.cycles ?? \"ref\",\n reused: params?.reused ?? \"inline\",\n intersections: [],\n deferred: [],\n external: params?.external ?? undefined,\n };\n}\n/**\n * Applies the `unrepresentable` setting at a site that has no JSON Schema equivalent. Throws\n * `message` unless the setting (or the handler's return value) says otherwise. Returns `true` if a\n * custom JSON Schema was written into `json`, in which case the caller must not write its own.\n */\nexport function handleUnrepresentable(schema, ctx, json, params, message) {\n const result = typeof ctx.unrepresentable === \"function\"\n ? ctx.unrepresentable({ zodSchema: schema, path: params.path, message })\n : ctx.unrepresentable;\n if (result === \"any\")\n return false;\n if (result === undefined || result === \"throw\")\n throw new Error(message);\n Object.assign(json, result);\n return true;\n}\n// never rename this back to `process`: bundler polyfills inject a top-level `const process` that a lexical declaration of the same name collides with (#6397)\nexport function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {\n var _a;\n const def = schema._zod.def;\n // check for schema in seens\n const seen = ctx.seen.get(schema);\n if (seen) {\n seen.count++;\n // check if cycle\n const isCycle = _params.schemaPath.includes(schema);\n if (isCycle) {\n seen.cycle = _params.path;\n }\n return seen.schema;\n }\n // initialize\n const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };\n ctx.seen.set(schema, result);\n ctx.sharedDefsExtractedFor = undefined;\n ctx.sharedEmitDoneFor = undefined;\n // custom method overrides default behavior\n const overrideSchema = schema._zod.toJSONSchema?.();\n if (overrideSchema) {\n result.schema = overrideSchema;\n }\n else {\n const params = {\n ..._params,\n schemaPath: [..._params.schemaPath, schema],\n path: _params.path,\n };\n if (schema._zod.processJSONSchema) {\n schema._zod.processJSONSchema(ctx, result.schema, params);\n }\n else {\n const _json = result.schema;\n const processor = ctx.processors[def.type];\n if (!processor) {\n throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);\n }\n processor(schema, ctx, _json, params);\n }\n const parent = schema._zod.parent;\n if (parent) {\n // Also set ref if processor didn't (for inheritance)\n if (!result.ref)\n result.ref = parent;\n processSchema(parent, ctx, params);\n ctx.seen.get(parent).isParent = true;\n }\n }\n // metadata\n const meta = ctx.metadataRegistry.get(schema);\n if (meta)\n assignProps(result.schema, meta);\n if (ctx.io === \"input\" && isTransforming(schema)) {\n // examples/defaults only apply to output type of pipe\n delete result.schema.examples;\n delete result.schema.default;\n }\n // set prefault as default\n if (ctx.io === \"input\" && \"_prefault\" in result.schema)\n (_a = result.schema).default ?? (_a.default = result.schema._prefault);\n delete result.schema._prefault;\n // pulling fresh from ctx.seen in case it was overwritten\n const _result = ctx.seen.get(schema);\n return _result.schema;\n}\n/** @deprecated Renamed to `processSchema`. An export alias declares no binding, so it is safe to keep. */\nexport { processSchema as process };\n// Escape a reference token for use in a JSON Pointer fragment (RFC 6901): `~` becomes `~0` and `/` becomes `~1`. The `~` replacement must run first.\nfunction encodeJSONPointerSegment(segment) {\n return segment.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nexport function extractDefs(ctx, schema\n// params: EmitParams\n) {\n // iterate over seen map;\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // With `external` set, every registered schema resolves through the external branch of `makeURI`, so the root branch below produces the same ref the external branch would — this pass is identical whichever schema it is called with, and only needs to run once.\n if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external)\n return;\n // Track ids to detect duplicates across different schemas\n const idToSchema = new Map();\n for (const entry of ctx.seen.entries()) {\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n const existing = idToSchema.get(id);\n if (existing && existing !== entry[0]) {\n throw new Error(`Duplicate schema id \"${id}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);\n }\n idToSchema.set(id, entry[0]);\n }\n }\n // returns a ref to the schema defId will be empty if the ref points to an external schema (or #)\n const makeURI = (entry) => {\n // comparing the seen objects because sometimes multiple schemas map to the same seen object. e.g. lazy\n // external is configured\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n if (ctx.external) {\n const externalId = ctx.external.registry.get(entry[0])?.id; // ?? \"__shared\";// `__schema${ctx.counter++}`;\n // check if schema is in the external registry\n const uriGenerator = ctx.external.uri ?? ((id) => id);\n if (externalId) {\n return { ref: uriGenerator(externalId) };\n }\n // otherwise, add to __shared\n const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;\n entry[1].defId = id; // set defId so it will be reused if needed\n return { defId: id, ref: `${uriGenerator(\"__shared\")}#/${defsSegment}/${encodeJSONPointerSegment(id)}` };\n }\n const uriPrefix = `#`;\n const defUriPrefix = `${uriPrefix}/${defsSegment}/`;\n // an id-less root has nowhere to be extracted to, so it stays inline and self-references as `#`\n if (entry[1] === root && !entry[1].schema.id) {\n return { ref: uriPrefix };\n }\n // self-contained schema\n const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;\n return { defId, ref: defUriPrefix + encodeJSONPointerSegment(defId) };\n };\n // stored cached version in `def` property remove all properties, set $ref\n const extractToDef = (entry) => {\n // if the schema is already a reference, do not extract it\n if (entry[1].schema.$ref) {\n return;\n }\n const seen = entry[1];\n const { ref, defId } = makeURI(entry);\n seen.def = { ...seen.schema };\n // defId won't be set if the schema is a reference to an external schema or if the schema is the root schema\n if (defId)\n seen.defId = defId;\n // wipe away all properties except $ref\n const schema = seen.schema;\n for (const key in schema) {\n delete schema[key];\n }\n schema.$ref = ref;\n };\n // throw on cycles\n // break cycles\n if (ctx.cycles === \"throw\") {\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.cycle) {\n throw new Error(\"Cycle detected: \" +\n `#/${seen.cycle?.join(\"/\")}/<root>` +\n '\\n\\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.');\n }\n }\n }\n // extract schemas into $defs\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n // convert root schema to # $ref\n if (schema === entry[0]) {\n extractToDef(entry); // this has special handling for the root schema\n continue;\n }\n // extract schemas that are in the external registry\n if (ctx.external) {\n const ext = ctx.external.registry.get(entry[0])?.id;\n if (schema !== entry[0] && ext) {\n extractToDef(entry);\n continue;\n }\n }\n // extract schemas with `id` meta\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n extractToDef(entry);\n continue;\n }\n // break cycles\n if (seen.cycle) {\n // any\n extractToDef(entry);\n continue;\n }\n // extract reused schemas\n if (seen.count > 1) {\n if (ctx.reused === \"ref\") {\n extractToDef(entry);\n }\n }\n }\n if (ctx.external)\n ctx.sharedDefsExtractedFor = ctx.external;\n}\n/** Rewrites `anyOf: [{type: \"a\"}, {type: \"b\"}]` to `type: [\"a\", \"b\"]`, which every JSON Schema draft treats as equivalent and most consumers render far better for the nullable case. Only branches that are a bare type assertion qualify — anything carrying a constraint, `$ref`, `const` or metadata is left alone. Runs after `flattenRef`, so a branch an override decorated or `$defs` extraction turned into a `$ref` is no longer bare and correctly stays in `anyOf`. `oneOf` is excluded: `integer` and `number` overlap, so \"exactly one\" and \"at least one\" are not the same there. OpenAPI 3.0 is excluded: its `type` must be a single string. */\nfunction compactTypeUnion(schema) {\n const options = schema.anyOf;\n if (!Array.isArray(options) || options.length === 0 || schema.type !== undefined)\n return;\n const types = [];\n for (const option of options) {\n if (!option || typeof option !== \"object\")\n return;\n // A branch that is itself a compactible union folds into this one — nested `anyOf` and a flat `type` array say the same thing. Compacting it first also makes the result independent of the order this pass walks the seen map in.\n compactTypeUnion(option);\n const keys = Object.keys(option);\n if (keys.length !== 1 || keys[0] !== \"type\")\n return;\n const type = option.type;\n for (const member of Array.isArray(type) ? type : [type]) {\n if (typeof member !== \"string\")\n return;\n if (!types.includes(member))\n types.push(member);\n }\n }\n delete schema.anyOf;\n // A `type` array must be non-empty and unique (metaschema); a single member is spelled as a bare string.\n schema.type = types.length === 1 ? types[0] : types;\n}\n/** Keywords `foldIntersection` knows how to combine. Anything else — `$ref`, `patternProperties`,\n * an annotation like `description` — makes a member unfoldable, so a constraint this does not\n * understand leaves the `allOf` alone instead of being silently dropped or misattributed. */\nconst FOLDABLE_KEYS = new Set([\"type\", \"properties\", \"required\", \"additionalProperties\"]);\nconst UNION_KEYS = [\"oneOf\", \"anyOf\"];\n/** A member's constraint on a key it does not declare itself. A `catchall` states one; `false`, an absent `additionalProperties`, and the empty schema a loose object emits state nothing. */\nfunction undeclaredConstraint(member) {\n const extra = member.additionalProperties;\n if (extra === undefined || extra === false || typeof extra !== \"object\" || extra === null)\n return null;\n return Object.keys(extra).length ? extra : null;\n}\n/** Combines object members into the single object they describe together, or returns `null` if any of them carries a keyword outside {@link FOLDABLE_KEYS}. */\nfunction foldObjects(members) {\n const objects = [];\n for (const member of members) {\n // A boolean subschema is legal JSON Schema and carries no keywords to fold.\n if (typeof member !== \"object\" || member.type !== \"object\")\n return null;\n for (const key in member) {\n if (!FOLDABLE_KEYS.has(key))\n return null;\n }\n objects.push(member);\n }\n const properties = {};\n const required = new Set();\n for (const object of objects) {\n for (const key in object.properties) {\n // `in` would report a `__proto__` key as already present via the prototype chain and skip it.\n if (Object.prototype.hasOwnProperty.call(properties, key))\n continue;\n // Every member constrains this key: the ones that declare it say how, and a `catchall` member constrains it too even though it does not name it. The key has to satisfy all of them, which is the same intersection one level down.\n const parts = [];\n for (const other of objects) {\n const part = other.properties?.[key] ?? undeclaredConstraint(other);\n if (part === null || part === undefined)\n continue;\n if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part)))\n parts.push(part);\n }\n const merged = parts.length === 1\n ? parts[0]\n : (foldObjects(parts) ?? { allOf: parts });\n assignProp(properties, key, merged);\n }\n for (const key of object.required ?? [])\n required.add(key);\n }\n const folded = { type: \"object\", properties };\n if (required.size)\n folded.required = [...required];\n // A key no member declares is rejected only when every member rejects it, so the fold is closed only when every member is. Otherwise it carries whatever the `catchall` members demand of such a key.\n if (objects.every((object) => object.additionalProperties === false)) {\n folded.additionalProperties = false;\n }\n else {\n const constraints = [];\n for (const object of objects) {\n const constraint = undeclaredConstraint(object);\n if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint)))\n constraints.push(constraint);\n }\n if (constraints.length === 1)\n folded.additionalProperties = constraints[0];\n else if (constraints.length > 1)\n folded.additionalProperties = { allOf: constraints };\n }\n return folded;\n}\n/** `additionalProperties` in an `allOf` member sees only that member's own `properties`, so two\n * closed object members reject each other's keys and the schema validates nothing. Zod's parser\n * pools the key sets instead — `handleIntersectionResults` reports a key as unrecognized only when\n * *every* side rejects it — so the emitted schema has to pool them too, and folding the members\n * into one object is the encoding that says so on every target.\n *\n * This runs from `finalize`, after `extractDefs`, which is what keeps it clear of the `$ref`\n * machinery: a member extracted into `$defs` is already a `$ref` by now and declines to fold, so it\n * keeps its reference and its own closedness rather than being inlined as a stale copy. */\nfunction foldIntersection(json) {\n const allOf = json.allOf;\n if (!Array.isArray(allOf) || allOf.length < 2)\n return;\n // An `override` runs before this pass and may have written object keywords onto the intersection itself. Those are deliberate, so decline rather than overwrite them.\n for (const key of FOLDABLE_KEYS)\n if (key in json)\n return;\n // An intersection distributes over a union: `A & (X | Y)` is `(A & X) | (A & Y)`. Only the first union is distributed over; a second one stays among the members every branch folds against, where it fails the object check and declines the whole intersection rather than multiplying out.\n const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));\n let folded = null;\n if (!unions.length) {\n folded = foldObjects(allOf);\n }\n else {\n const union = unions[0];\n const keyword = UNION_KEYS.find((k) => Array.isArray(union[k]));\n if (Object.keys(union).length !== 1)\n return;\n const rest = allOf.filter((m) => m !== union);\n const branches = union[keyword].map((branch) => foldObjects([...rest, branch]));\n if (branches.some((b) => !b))\n return;\n folded = { [keyword]: branches };\n }\n if (!folded)\n return;\n delete json.allOf;\n assignProps(json, folded);\n}\nexport function finalize(ctx, schema) {\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // flatten refs - inherit properties from parent schemas\n const flattenRef = (zodSchema) => {\n const seen = ctx.seen.get(zodSchema);\n // already processed\n if (seen.ref === null)\n return;\n const schema = seen.def ?? seen.schema;\n const _cached = { ...schema };\n const ref = seen.ref;\n seen.ref = null; // prevent infinite recursion\n if (ref) {\n flattenRef(ref);\n const refSeen = ctx.seen.get(ref);\n const refSchema = refSeen.schema;\n // merge referenced schema into current\n if (refSchema.$ref && (ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\")) {\n // older drafts can't combine $ref with other properties\n schema.allOf = schema.allOf ?? [];\n schema.allOf.push(refSchema);\n }\n else {\n assignProps(schema, refSchema);\n }\n // restore child's own properties (child wins)\n assignProps(schema, _cached);\n const isParentRef = zodSchema._zod.parent === ref;\n // For parent chain, child is a refinement - remove parent-only properties\n if (isParentRef) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (!(key in _cached)) {\n delete schema[key];\n }\n }\n }\n // When ref was extracted to $defs, remove properties that match the definition\n if (refSchema.$ref && refSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n // If parent was extracted (has $ref), propagate $ref to this schema. This handles cases like: readonly().meta({id}).describe() where processor sets ref to innerType but parent should be referenced\n const parent = zodSchema._zod.parent;\n if (parent && parent !== ref) {\n // Ensure parent is processed first so its def has inherited properties\n flattenRef(parent);\n const parentSeen = ctx.seen.get(parent);\n if (parentSeen?.schema.$ref) {\n schema.$ref = parentSeen.schema.$ref;\n // De-duplicate with parent's definition\n if (parentSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n }\n // execute overrides\n ctx.override({\n zodSchema: zodSchema,\n jsonSchema: schema,\n path: seen.path ?? [],\n });\n };\n // Flattening walks the whole map and clears each `ref` as it goes, so a second call over the same map is a no-op scan. Skip it outright once it has run for a registry conversion.\n if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {\n for (const entry of [...ctx.seen.entries()].reverse()) {\n flattenRef(entry[0]);\n }\n if (ctx.target !== \"openapi-3.0\") {\n for (const entry of ctx.seen.entries()) {\n compactTypeUnion(entry[1].def ?? entry[1].schema);\n }\n }\n for (const rewrite of ctx.deferred)\n rewrite();\n // After flattening, every member that was extracted is a `$ref`, so the fold sees the final shape. A schema that inherits an intersection — through `z.lazy`, or any `ref` chain — holds the same `allOf` array, so fold by array identity to catch every copy.\n if (ctx.intersections.length) {\n const carriers = new Map();\n for (const seen of ctx.seen.values()) {\n for (const json of [seen.schema, seen.def]) {\n const allOf = json?.allOf;\n if (!Array.isArray(allOf))\n continue;\n const existing = carriers.get(allOf);\n if (existing)\n existing.push(json);\n else\n carriers.set(allOf, [json]);\n }\n }\n for (const allOf of ctx.intersections) {\n for (const json of carriers.get(allOf) ?? [])\n foldIntersection(json);\n }\n }\n }\n const result = {};\n if (ctx.target === \"draft-2020-12\") {\n result.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n }\n else if (ctx.target === \"draft-07\") {\n result.$schema = \"http://json-schema.org/draft-07/schema#\";\n }\n else if (ctx.target === \"draft-04\") {\n result.$schema = \"http://json-schema.org/draft-04/schema#\";\n }\n else if (ctx.target === \"openapi-3.0\") {\n // OpenAPI 3.0 schema objects should not include a $schema property\n }\n else {\n // Arbitrary string values are allowed but won't have a $schema property set\n }\n if (ctx.external?.uri) {\n const id = ctx.external.registry.get(schema)?.id;\n if (!id)\n throw new Error(\"Schema is missing an `id` property\");\n result.$id = ctx.external.uri(id);\n }\n // when the root was extracted into $defs, `root.schema` is the `$ref` wrapper and `root.def` is the body that now lives under $defs\n assignProps(result, root.defId ? root.schema : (root.def ?? root.schema));\n // The `id` in `.meta()` is a Zod-specific registration tag used to extract schemas into $defs — it is not user-facing JSON Schema metadata. Strip it from the output body where it would otherwise leak. The id is preserved implicitly via the $defs key (and via $ref paths).\n const rootMetaId = ctx.metadataRegistry.get(schema)?.id;\n if (rootMetaId !== undefined && result.id === rootMetaId)\n delete result.id;\n // build defs object. With `external`, `defs` is the shared object every schema writes into, so the same entries are reassigned on every call. Without it, `defs` is fresh per call and must be rebuilt.\n const defs = ctx.external?.defs ?? {};\n if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.def && seen.defId) {\n if (seen.def.id === seen.defId)\n delete seen.def.id;\n assignProp(defs, seen.defId, seen.def);\n }\n }\n }\n if (ctx.external)\n ctx.sharedEmitDoneFor = ctx.external;\n // set definitions in result\n if (ctx.external) {\n }\n else {\n if (Object.keys(defs).length > 0) {\n if (ctx.target === \"draft-2020-12\") {\n result.$defs = defs;\n }\n else {\n result.definitions = defs;\n }\n }\n }\n try {\n // this \"finalizes\" this schema and ensures all cycles are removed each call to finalize() is functionally independent though the seen map is shared\n const finalized = JSON.parse(JSON.stringify(result));\n Object.defineProperty(finalized, \"~standard\", {\n value: {\n ...schema[\"~standard\"],\n jsonSchema: {\n input: createStandardJSONSchemaMethod(schema, \"input\", ctx.processors),\n output: createStandardJSONSchemaMethod(schema, \"output\", ctx.processors),\n },\n },\n enumerable: false,\n writable: false,\n });\n return finalized;\n }\n catch (_err) {\n throw new Error(\"Error converting schema to JSON.\");\n }\n}\nfunction isTransforming(_schema, _ctx) {\n const ctx = _ctx ?? { seen: new Set() };\n if (ctx.seen.has(_schema))\n return false;\n ctx.seen.add(_schema);\n const def = _schema._zod.def;\n if (def.type === \"transform\")\n return true;\n if (def.type === \"array\")\n return isTransforming(def.element, ctx);\n if (def.type === \"set\")\n return isTransforming(def.valueType, ctx);\n if (def.type === \"lazy\")\n return isTransforming(def.getter(), ctx);\n if (def.type === \"promise\" ||\n def.type === \"optional\" ||\n def.type === \"nonoptional\" ||\n def.type === \"nullable\" ||\n def.type === \"readonly\" ||\n def.type === \"default\" ||\n def.type === \"prefault\" ||\n def.type === \"catch\") {\n return isTransforming(def.innerType, ctx);\n }\n if (def.type === \"intersection\") {\n return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);\n }\n if (def.type === \"record\" || def.type === \"map\") {\n return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);\n }\n if (def.type === \"pipe\") {\n if (_schema._zod.traits.has(\"$ZodCodec\"))\n return true;\n return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);\n }\n if (def.type === \"object\") {\n for (const key in def.shape) {\n if (isTransforming(def.shape[key], ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"union\") {\n for (const option of def.options) {\n if (isTransforming(option, ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"tuple\") {\n for (const item of def.items) {\n if (isTransforming(item, ctx))\n return true;\n }\n if (def.rest && isTransforming(def.rest, ctx))\n return true;\n return false;\n }\n return false;\n}\n/**\n * Creates a toJSONSchema method for a schema instance.\n * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.\n */\nexport const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {\n const ctx = initializeContext({ ...params, processors });\n processSchema(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\nexport const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {\n const { libraryOptions, target } = params ?? {};\n const ctx = initializeContext({ ...(libraryOptions ?? {}), target, io, processors });\n processSchema(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\n","import * as regexes from \"./regexes.js\";\nimport { base64Charset, base64urlCharset } from \"./schemas.js\";\nimport { extractDefs, finalize, handleUnrepresentable, initializeContext, processSchema, } from \"./to-json-schema.js\";\nimport { BIGINT_FORMAT_RANGES, NUMBER_FORMAT_RANGES, assignProp, getEnumValues } from \"./util.js\";\nconst narrowMin = (agg, key, value) => {\n if (agg[key] === undefined || value > agg[key])\n agg[key] = value;\n};\nconst narrowMax = (agg, key, value) => {\n if (agg[key] === undefined || value < agg[key])\n agg[key] = value;\n};\nconst narrowBoth = (agg, value) => {\n narrowMin(agg, \"minimum\", value);\n narrowMax(agg, \"maximum\", value);\n};\nconst addDivisor = (agg, value) => {\n agg.multipleOf ?? (agg.multipleOf = []);\n if (!agg.multipleOf.includes(value))\n agg.multipleOf.push(value);\n};\nconst addPattern = (agg, pattern) => {\n agg.patterns ?? (agg.patterns = new Set());\n agg.patterns.add(pattern);\n};\nconst intersectMime = (agg, mime) => {\n agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];\n};\n// last-wins, matching the bag's historical write order; the flag keeps an integer format from being lost to a later float one\nconst setFormat = (agg, format) => {\n agg.format = format;\n if (format.includes(\"int\"))\n agg.isInt = true;\n};\nconst minContributor = (agg, def) => narrowMin(agg, \"minimum\", def.minimum);\nconst maxContributor = (agg, def) => narrowMax(agg, \"maximum\", def.maximum);\nconst formatContributor = (ranges) => (agg, def) => {\n setFormat(agg, def.format);\n const [minimum, maximum] = ranges[def.format];\n narrowMin(agg, \"minimum\", minimum);\n narrowMax(agg, \"maximum\", maximum);\n};\nconst contributors = {\n greater_than: (agg, def) => narrowMin(agg, def.inclusive ? \"minimum\" : \"exclusiveMinimum\", def.value),\n less_than: (agg, def) => narrowMax(agg, def.inclusive ? \"maximum\" : \"exclusiveMaximum\", def.value),\n multiple_of: (agg, def) => addDivisor(agg, def.value),\n number_format: formatContributor(NUMBER_FORMAT_RANGES),\n bigint_format: formatContributor(BIGINT_FORMAT_RANGES),\n min_length: minContributor,\n max_length: maxContributor,\n length_equals: (agg, def) => narrowBoth(agg, def.length),\n min_size: minContributor,\n max_size: maxContributor,\n size_equals: (agg, def) => narrowBoth(agg, def.size),\n string_format: (agg, def) => {\n setFormat(agg, def.format);\n if (def.pattern)\n addPattern(agg, def.pattern);\n if (def.format === \"base64\" || def.format === \"base64url\")\n agg.contentEncoding = def.format;\n if (def.local || def.precision === -1)\n agg.laxFormat = true;\n },\n mime_type: (agg, def) => intersectMime(agg, def.mime),\n};\nexport function aggregateChecks(schema) {\n const agg = {};\n const def = schema._zod.def;\n // a format schema is its own first check, same rule as $ZodType init\n const list = schema._zod.traits.has(\"$ZodCheck\")\n ? [schema, ...(def.checks ?? [])]\n : (def.checks ?? []);\n for (const ch of list)\n contributors[ch._zod.def.check]?.(agg, ch._zod.def);\n // reconcile with the bag so third-party onattach contributions still land; first-party residue is never tighter than the fold, so merging it back is idempotent for one and additive for the other\n const bag = schema._zod.bag;\n if (bag.minimum !== undefined)\n narrowMin(agg, \"minimum\", bag.minimum);\n if (bag.exclusiveMinimum !== undefined)\n narrowMin(agg, \"exclusiveMinimum\", bag.exclusiveMinimum);\n if (bag.maximum !== undefined)\n narrowMax(agg, \"maximum\", bag.maximum);\n if (bag.exclusiveMaximum !== undefined)\n narrowMax(agg, \"exclusiveMaximum\", bag.exclusiveMaximum);\n if (bag.multipleOf !== undefined)\n addDivisor(agg, bag.multipleOf);\n if (bag.format !== undefined) {\n agg.format ?? (agg.format = bag.format);\n if (bag.format.includes(\"int\"))\n agg.isInt = true;\n }\n if (bag.mime)\n intersectMime(agg, bag.mime);\n for (const pattern of bag.patterns ?? [])\n addPattern(agg, pattern);\n return agg;\n}\nconst formatMap = {\n guid: \"uuid\",\n url: \"uri\",\n datetime: \"date-time\",\n json_string: \"json-string\",\n regex: \"\", // do not set\n};\n// ==================== SIMPLE TYPE PROCESSORS ====================\n// the runtime patterns are lax so parse paths never overflow the regex stack; the emitted schema swaps in the exact block forms, which zod itself never executes\nconst exactPatterns = new Map([\n [base64Charset, regexes.base64],\n [base64urlCharset, regexes.base64url],\n]);\nconst exactPattern = (p) => exactPatterns.get(p) ?? p;\nexport const stringProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n json.type = \"string\";\n const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);\n if (typeof minimum === \"number\")\n json.minLength = minimum;\n if (typeof maximum === \"number\")\n json.maxLength = maximum;\n // custom pattern overrides format\n if (format) {\n json.format = formatMap[format] ?? format;\n if (json.format === \"\")\n delete json.format; // empty format is not valid\n // `z.iso.time()` is never full-time, and `laxFormat` carries the datetime shapes that also accept what their keyword forbids\n if (format === \"time\" || laxFormat) {\n delete json.format;\n }\n }\n if (contentEncoding)\n json.contentEncoding = contentEncoding;\n if (patterns && patterns.size > 0) {\n const patternList = [...patterns].map(exactPattern);\n if (patternList.length === 1)\n json.pattern = patternList[0].source;\n else if (patternList.length > 1) {\n json.allOf = [\n ...patternList.map((regex) => ({\n ...(ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\"\n ? { type: \"string\" }\n : {}),\n pattern: regex.source,\n })),\n ];\n }\n }\n};\nexport const numberProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);\n json.type = isInt ? \"integer\" : \"number\";\n // when both minimum and exclusiveMinimum exist, pick the more restrictive one\n const exMin = typeof exclusiveMinimum === \"number\" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);\n const exMax = typeof exclusiveMaximum === \"number\" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);\n const legacy = ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\";\n if (exMin) {\n if (legacy) {\n json.minimum = exclusiveMinimum;\n json.exclusiveMinimum = true;\n }\n else {\n json.exclusiveMinimum = exclusiveMinimum;\n }\n }\n else if (typeof minimum === \"number\") {\n json.minimum = minimum;\n }\n if (exMax) {\n if (legacy) {\n json.maximum = exclusiveMaximum;\n json.exclusiveMaximum = true;\n }\n else {\n json.exclusiveMaximum = exclusiveMaximum;\n }\n }\n else if (typeof maximum === \"number\") {\n json.maximum = maximum;\n }\n if (multipleOf) {\n // JSON Schema requires a divisor strictly greater than zero, and a non-finite one does not survive JSON at all. A negative divisor accepts exactly what its absolute value accepts, so it still maps; zero, NaN and Infinity have no keyword form.\n const divisors = new Set();\n for (const divisor of multipleOf) {\n if (Number.isFinite(divisor) && divisor !== 0)\n divisors.add(Math.abs(divisor));\n else\n handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);\n }\n // chained divisors are a conjunction the keyword cannot carry alone, so extras ride an allOf, same as stacked patterns\n const [first, ...rest] = divisors;\n if (first !== undefined)\n json.multipleOf = first;\n if (rest.length)\n json.allOf = [...(json.allOf ?? []), ...rest.map((m) => ({ multipleOf: m }))];\n }\n};\nexport const booleanProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const bigintProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"BigInt cannot be represented in JSON Schema\");\n};\nexport const symbolProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Symbols cannot be represented in JSON Schema\");\n};\nexport const nullProcessor = (_schema, ctx, json, _params) => {\n if (ctx.target === \"openapi-3.0\") {\n json.type = \"string\";\n json.nullable = true;\n json.enum = [null];\n }\n else {\n json.type = \"null\";\n }\n};\nexport const undefinedProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Undefined cannot be represented in JSON Schema\");\n};\nexport const voidProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Void cannot be represented in JSON Schema\");\n};\nexport const neverProcessor = (_schema, _ctx, json, _params) => {\n json.not = {};\n};\nexport const anyProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const unknownProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const dateProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Date cannot be represented in JSON Schema\");\n};\nexport const enumProcessor = (schema, _ctx, json, _params) => {\n const def = schema._zod.def;\n const values = getEnumValues(def.entries);\n // an empty enum accepts nothing, same as z.never()\n if (values.length === 0) {\n json.not = {};\n return;\n }\n // Number enums can have both string and number values\n if (values.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (values.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n json.enum = values;\n};\nexport const literalProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n // a literal with no values accepts nothing, same as z.never()\n if (def.values.length === 0) {\n json.not = {};\n return;\n }\n const vals = [];\n for (const val of def.values) {\n if (val === undefined) {\n // a custom schema replaces the whole literal, so there is nothing left to accumulate\n if (handleUnrepresentable(schema, ctx, json, params, \"Literal `undefined` cannot be represented in JSON Schema\"))\n return;\n // otherwise do not add to vals\n }\n else if (typeof val === \"bigint\") {\n if (handleUnrepresentable(schema, ctx, json, params, \"BigInt literals cannot be represented in JSON Schema\"))\n return;\n vals.push(Number(val));\n }\n else {\n vals.push(val);\n }\n }\n if (vals.length === 0) {\n // do nothing (an undefined literal was stripped)\n }\n else if (vals.length === 1) {\n const val = vals[0];\n json.type = val === null ? \"null\" : typeof val;\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.enum = [val];\n }\n else {\n json.const = val;\n }\n }\n else {\n if (vals.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (vals.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n if (vals.every((v) => typeof v === \"boolean\"))\n json.type = \"boolean\";\n if (vals.every((v) => v === null))\n json.type = \"null\";\n json.enum = vals;\n }\n};\nexport const nanProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"NaN cannot be represented in JSON Schema\");\n};\nexport const templateLiteralProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const pattern = schema._zod.pattern;\n if (!pattern)\n throw new Error(\"Pattern not found in template literal\");\n _json.type = \"string\";\n _json.pattern = pattern.source;\n};\nexport const fileProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n _json.type = \"string\";\n _json.format = \"binary\";\n _json.contentEncoding = \"binary\";\n const { minimum, maximum, mime } = aggregateChecks(schema);\n if (minimum !== undefined)\n _json.minLength = minimum;\n if (maximum !== undefined)\n _json.maxLength = maximum;\n if (!mime)\n return;\n // an empty intersection means the mime checks share no value, so nothing passes at runtime; `anyOf` must be non-empty, so the false schema is `not: {}`\n if (mime.length === 0)\n _json.not = {};\n else if (mime.length === 1)\n _json.contentMediaType = mime[0];\n // only contentMediaType differs, so the shared props stay at the root\n else\n _json.anyOf = mime.map((m) => ({ contentMediaType: m }));\n};\nexport const successProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const customProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Custom types cannot be represented in JSON Schema\");\n};\nexport const functionProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Function types cannot be represented in JSON Schema\");\n};\nexport const transformProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Transforms cannot be represented in JSON Schema\");\n};\nexport const mapProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Map cannot be represented in JSON Schema\");\n};\nexport const setProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Set cannot be represented in JSON Schema\");\n};\n// ==================== COMPOSITE TYPE PROCESSORS ====================\nexport const arrayProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n const { minimum, maximum } = aggregateChecks(schema);\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n json.type = \"array\";\n json.items = processSchema(def.element, ctx, {\n ...params,\n path: [...params.path, \"items\"],\n });\n};\n// Transform and catch set `optin = \"optional\"` at runtime so the parser lets them observe an\n// absent key, but their declared input type stays required. An input JSON Schema describes the\n// declared type, so resolve past them to the schema that actually carries the optionality.\n// Used by both `objectProcessor` (for `required`) and `tupleProcessor` (for `minItems`); see\n// wiki/optionality.md, \"The JSON Schema emitter reads the *static* value\".\nfunction inputOptin(schema) {\n const def = schema._zod.def;\n if (def.type === \"pipe\" && def.in._zod.traits.has(\"$ZodTransform\")) {\n return inputOptin(def.out);\n }\n if (def.type === \"catch\") {\n return inputOptin(def.innerType);\n }\n return schema._zod.optin;\n}\nexport const objectProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n const shape = def.shape;\n // dropping it while still emitting `additionalProperties: false` would emit a schema that rejects data this one requires\n const symbolKeys = Object.getOwnPropertySymbols(shape);\n if (symbolKeys.length &&\n handleUnrepresentable(schema, ctx, json, params, \"Symbol keys cannot be represented in JSON Schema\")) {\n return;\n }\n json.type = \"object\";\n json.properties = {};\n for (const key in shape) {\n // assignProp so a __proto__ key becomes an own property instead of hitting the inherited setter on the plain {} we build into\n assignProp(json.properties, key, processSchema(shape[key], ctx, {\n ...params,\n path: [...params.path, \"properties\", key],\n }));\n }\n // required keys\n const requiredKeys = [];\n for (const key of Object.keys(shape)) {\n const field = def.shape[key];\n if (ctx.io === \"input\" ? inputOptin(field) === undefined : field._zod.optout === undefined) {\n requiredKeys.push(key);\n }\n }\n if (requiredKeys.length > 0) {\n json.required = requiredKeys;\n }\n // catchall\n if (def.catchall?._zod.def.type === \"never\") {\n // strict\n json.additionalProperties = false;\n }\n else if (!def.catchall) {\n // regular\n if (ctx.io === \"output\")\n json.additionalProperties = false;\n }\n else if (def.catchall) {\n json.additionalProperties = processSchema(def.catchall, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n};\nexport const unionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n // Exclusive unions (inclusive === false) use oneOf (exactly one match) instead of anyOf (one or more matches). This includes both z.xor() and discriminated unions\n const isExclusive = def.inclusive === false;\n const options = def.options.map((x, i) => processSchema(x, ctx, {\n ...params,\n path: [...params.path, isExclusive ? \"oneOf\" : \"anyOf\", i],\n }));\n if (isExclusive) {\n json.oneOf = options;\n }\n else {\n json.anyOf = options;\n }\n};\nexport const intersectionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const a = processSchema(def.left, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 0],\n });\n const b = processSchema(def.right, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 1],\n });\n const isSimpleIntersection = (val) => \"allOf\" in val && Object.keys(val).length === 1;\n const allOf = [\n ...(isSimpleIntersection(a) ? a.allOf : [a]),\n ...(isSimpleIntersection(b) ? b.allOf : [b]),\n ];\n json.allOf = allOf;\n // Recorded innermost first, so a nested intersection has already folded by the time this one is considered. The array is the handle rather than the schema, because a wrapper that inherits this schema shares the same array; `finalize` folds every object holding it. See `foldIntersection`.\n ctx.intersections.push(allOf);\n};\nexport const tupleProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"array\";\n const prefixPath = ctx.target === \"draft-2020-12\" ? \"prefixItems\" : \"items\";\n const restPath = ctx.target === \"draft-2020-12\" ? \"items\" : ctx.target === \"openapi-3.0\" ? \"items\" : \"additionalItems\";\n const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {\n ...params,\n path: [...params.path, prefixPath, i],\n }));\n const rest = def.rest\n ? processSchema(def.rest, ctx, {\n ...params,\n path: [...params.path, restPath, ...(ctx.target === \"openapi-3.0\" ? [def.items.length] : [])],\n })\n : null;\n let minItems = def.items.length;\n while (minItems > 0) {\n const item = def.items[minItems - 1];\n const optional = ctx.io === \"input\" ? inputOptin(item) !== undefined : item._zod.optout === \"optional\";\n if (!optional)\n break;\n minItems--;\n }\n const maxItems = def.items.length;\n const isClosed = !def.rest;\n if (ctx.target === \"draft-2020-12\") {\n json.prefixItems = prefixItems;\n if (isClosed) {\n json.items = false;\n }\n else if (rest) {\n json.items = rest;\n }\n if (minItems > 0)\n json.minItems = minItems;\n if (isClosed)\n json.maxItems = maxItems;\n }\n else if (ctx.target === \"openapi-3.0\") {\n json.items = {\n anyOf: prefixItems,\n };\n if (rest) {\n json.items.anyOf.push(rest);\n }\n if (minItems > 0)\n json.minItems = minItems;\n if (isClosed)\n json.maxItems = maxItems;\n }\n else {\n json.items = prefixItems;\n if (isClosed) {\n json.additionalItems = false;\n }\n else if (rest) {\n json.additionalItems = rest;\n }\n if (minItems > 0)\n json.minItems = minItems;\n if (isClosed)\n json.maxItems = maxItems;\n }\n // explicit user-defined length checks take precedence\n const { minimum, maximum } = aggregateChecks(schema);\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n};\n/** JSON object keys are always strings, so a numeric record key schema is re-expressed over the\n * numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key\n * behind a wrapper only carries its own `type` before then, and a union key only has its branches.\n *\n * A numeric bound cannot apply to a property name, so `minimum` and its siblings are dropped rather\n * than carried over: keeping them beside `type: \"string\"` reproduces the match-nothing schema this\n * exists to fix. A key that carries one therefore emits wider than the record parses — `z.record(z.number().min(5), V)`\n * accepts `\"3\"` — which is the deliberate trade, since throwing on it would reject an ordinary schema\n * outright. */\nfunction stringifyKeyNames(bySchema, json, visited) {\n // an extracted key that rewrites cannot go on sharing its definition — the string form a key position needs is not the number form every other reference wants — so it inlines. One that does not rewrite keeps the `$ref`.\n if (json.$ref) {\n // a recursive key holds its own reference inside its definition, so a node already on the path is left alone rather than resolved again\n if (visited.has(json))\n return json;\n visited.add(json);\n const def = bySchema.get(json)?.def;\n if (!def)\n return json;\n const inlined = stringifyKeyNames(bySchema, def, visited);\n return inlined === def ? json : inlined;\n }\n for (const keyword of [\"anyOf\", \"oneOf\"]) {\n const branches = json[keyword];\n if (!Array.isArray(branches))\n continue;\n const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));\n // rebuilding regardless would detach a key that had nothing to re-express, dropping its `$ref` and leaking the internal `id`\n if (mapped.some((branch, i) => branch !== branches[i]))\n json = { ...json, [keyword]: mapped };\n }\n // a member that already admits a string leaves the key unconstrained, so the node's own type re-expresses only when every member is numeric\n const types = Array.isArray(json.type) ? json.type : [json.type];\n const numericType = !types.includes(\"string\") && types.some((t) => t === \"number\" || t === \"integer\");\n // a heterogeneous key carries no type at all, so its numeric members are caught here instead\n const values = json.enum ?? (json.const !== undefined ? [json.const] : undefined);\n if (!numericType && !values?.some((v) => typeof v === \"number\"))\n return json;\n const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;\n if (rest.enum)\n rest.enum = rest.enum.map((v) => (typeof v === \"number\" ? String(v) : v));\n else if (typeof rest.const === \"number\")\n rest.const = String(rest.const);\n // a heterogeneous key keeps its absent type: the stringified members already say what a key may be\n if (!numericType)\n return rest;\n rest.type = \"string\";\n if (!values)\n rest.pattern = (types.includes(\"number\") ? regexes.number : regexes.integer).source;\n return rest;\n}\n/** Every record of one conversion, so the carriers are found in a single pass rather than once per record. */\nconst pendingRecords = new WeakMap();\nfunction rewriteKeyNames(ctx) {\n // an extracted key is resolved by the object `extractToDef` left in its place, so the map is built once rather than searched per reference. `_zod.toJSONSchema` can hand the same object to two schemas, so the first entry carrying a body wins, as a search would have found it.\n const bySchema = new Map();\n for (const entry of ctx.seen.values()) {\n if (entry.def && !bySchema.has(entry.schema))\n bySchema.set(entry.schema, entry);\n }\n const rewrites = new Map();\n for (const record of pendingRecords.get(ctx) ?? []) {\n const seen = ctx.seen.get(record);\n const names = (seen?.def ?? seen?.schema)?.propertyNames;\n if (!names || names === true || rewrites.has(names))\n continue;\n const rewritten = stringifyKeyNames(bySchema, names, new Set());\n if (rewritten !== names)\n rewrites.set(names, rewritten);\n }\n if (!rewrites.size)\n return;\n // the flatten has already copied each record's own properties onto every wrapper by reference, and an extracted body is another such copy, so every carrier holding a rewritten key is updated together\n for (const entry of ctx.seen.values()) {\n for (const carrier of [entry.schema, entry.def]) {\n const rewritten = carrier && rewrites.get(carrier.propertyNames);\n if (rewritten)\n carrier.propertyNames = rewritten;\n }\n }\n}\nexport const recordProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n // For looseRecord with regex patterns, use patternProperties. This correctly represents \"only validate keys matching the pattern\" semantics and composes well with allOf (intersections)\n const keyType = def.keyType;\n const patterns = aggregateChecks(keyType).patterns;\n if (def.mode === \"loose\" && patterns && patterns.size > 0) {\n // Use patternProperties for looseRecord with regex patterns\n const valueSchema = processSchema(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"patternProperties\", \"*\"],\n });\n json.patternProperties = {};\n for (const pattern of patterns) {\n assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);\n }\n }\n else {\n // Default behavior: use propertyNames + additionalProperties\n if (ctx.target === \"draft-07\" || ctx.target === \"draft-2020-12\") {\n json.propertyNames = processSchema(def.keyType, ctx, {\n ...params,\n path: [...params.path, \"propertyNames\"],\n });\n let pending = pendingRecords.get(ctx);\n if (!pending) {\n pending = [];\n pendingRecords.set(ctx, pending);\n ctx.deferred.push(() => rewriteKeyNames(ctx));\n }\n pending.push(schema);\n }\n json.additionalProperties = processSchema(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n // Add required for keys with discrete values (enum, literal, etc.)\n const keyValues = keyType._zod.values;\n // Every key shares one value schema, so an optional-in value makes the whole key set omittable on input. Output keeps them: the exhaustive branch assigns every key, even one whose value came back undefined.\n const omittableOnInput = ctx.io === \"input\" && inputOptin(def.valueType) !== undefined;\n if (keyValues && !def.partial && !omittableOnInput) {\n const validKeyValues = [...keyValues].filter((v) => typeof v === \"string\" || typeof v === \"number\");\n if (validKeyValues.length > 0) {\n json.required = validKeyValues.map(String);\n }\n }\n};\nexport const nullableProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const inner = processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n if (ctx.target === \"openapi-3.0\") {\n seen.ref = def.innerType;\n json.nullable = true;\n }\n else {\n json.anyOf = [inner, { type: \"null\" }];\n }\n};\nexport const nonoptionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\n/** Round-trips a default value through JSON so the emitted schema is guaranteed to be valid JSON.\n * A BigInt has no reliable encoding, so it goes through `unrepresentable` like any other\n * unrepresentable value. Returns a sentinel when the caller must not write a default of its own. */\nconst UNREPRESENTABLE_DEFAULT = Symbol();\nfunction serializeDefaultValue(value, schema, ctx, json, params) {\n let unrepresentable = false;\n const serialized = JSON.stringify(value, (_, val) => {\n if (typeof val !== \"bigint\")\n return val;\n unrepresentable = true;\n return null;\n });\n if (!unrepresentable)\n return JSON.parse(serialized);\n handleUnrepresentable(schema, ctx, json, params, \"BigInt defaults cannot be represented in JSON Schema\");\n return UNREPRESENTABLE_DEFAULT;\n}\nexport const defaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);\n if (value !== UNREPRESENTABLE_DEFAULT)\n json.default = value;\n};\nexport const prefaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n if (ctx.io !== \"input\")\n return;\n const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);\n if (value !== UNREPRESENTABLE_DEFAULT)\n json._prefault = value;\n};\nexport const catchProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n let catchValue;\n try {\n catchValue = def.catchValue(undefined);\n }\n catch {\n handleUnrepresentable(schema, ctx, json, params, \"Dynamic catch values are not supported in JSON Schema\");\n return;\n }\n json.default = catchValue;\n};\nexport const pipeProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n const inIsTransform = def.in._zod.traits.has(\"$ZodTransform\");\n const innerType = ctx.io === \"input\" ? (inIsTransform ? def.out : def.in) : def.out;\n processSchema(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\nexport const readonlyProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.readOnly = true;\n};\nexport const promiseProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const optionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const lazyProcessor = (schema, ctx, _json, params) => {\n const innerType = schema._zod.innerType;\n processSchema(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\n// ==================== ALL PROCESSORS ====================\nexport const allProcessors = {\n string: stringProcessor,\n number: numberProcessor,\n boolean: booleanProcessor,\n bigint: bigintProcessor,\n symbol: symbolProcessor,\n null: nullProcessor,\n undefined: undefinedProcessor,\n void: voidProcessor,\n never: neverProcessor,\n any: anyProcessor,\n unknown: unknownProcessor,\n date: dateProcessor,\n enum: enumProcessor,\n literal: literalProcessor,\n nan: nanProcessor,\n template_literal: templateLiteralProcessor,\n file: fileProcessor,\n success: successProcessor,\n custom: customProcessor,\n function: functionProcessor,\n transform: transformProcessor,\n map: mapProcessor,\n set: setProcessor,\n array: arrayProcessor,\n object: objectProcessor,\n union: unionProcessor,\n intersection: intersectionProcessor,\n tuple: tupleProcessor,\n record: recordProcessor,\n nullable: nullableProcessor,\n nonoptional: nonoptionalProcessor,\n default: defaultProcessor,\n prefault: prefaultProcessor,\n catch: catchProcessor,\n pipe: pipeProcessor,\n readonly: readonlyProcessor,\n promise: promiseProcessor,\n optional: optionalProcessor,\n lazy: lazyProcessor,\n};\nexport function toJSONSchema(input, params) {\n if (\"_idmap\" in input) {\n // Registry case\n const registry = input;\n const ctx = initializeContext({ ...params, processors: allProcessors });\n const defs = {};\n // First pass: process all schemas to build the seen map\n for (const entry of registry._idmap.entries()) {\n const [_, schema] = entry;\n processSchema(schema, ctx);\n }\n const schemas = {};\n const external = {\n registry,\n uri: params?.uri,\n defs,\n };\n // Update the context with external configuration\n ctx.external = external;\n // Second pass: emit each schema\n for (const entry of registry._idmap.entries()) {\n const [key, schema] = entry;\n extractDefs(ctx, schema);\n assignProp(schemas, key, finalize(ctx, schema));\n }\n if (Object.keys(defs).length > 0) {\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n schemas.__shared = {\n [defsSegment]: defs,\n };\n }\n return { schemas };\n }\n // Single schema case\n const ctx = initializeContext({ ...params, processors: allProcessors });\n processSchema(input, ctx);\n extractDefs(ctx, input);\n return finalize(ctx, input);\n}\n","import * as core from \"../core/index.js\";\nimport { $ZodError } from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\n/* Prototypes that already carry the lazy helper methods. Seeded with the\n * intrinsics so that `init` on a foreign object — it accepts any object —\n * can never install an accessor onto a prototype we do not own. */\nconst _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);\n/* Helper methods live as non-enumerable lazy getters on the shared\n * prototype instead of own properties on every instance. On first\n * access the getter allocates the per-instance closure and caches it\n * as a non-enumerable own property, so detached usage still works and\n * the allocation only happens for methods actually touched. */\nfunction _lazyMethod(proto, key, make) {\n Object.defineProperty(proto, key, {\n configurable: true,\n enumerable: false,\n get() {\n const value = make(this);\n Object.defineProperty(this, key, { value, configurable: true, writable: true });\n return value;\n },\n set(value) {\n Object.defineProperty(this, key, { value, configurable: true, writable: true });\n },\n });\n}\nconst initializer = (inst, issues) => {\n $ZodError.init(inst, issues);\n inst.name = \"ZodError\";\n const proto = Object.getPrototypeOf(inst);\n if (_installedErrorProtos.has(proto))\n return;\n _installedErrorProtos.add(proto);\n _lazyMethod(proto, \"format\", (self) => (mapper) => core.formatError(self, mapper));\n _lazyMethod(proto, \"flatten\", (self) => (mapper) => core.flattenError(self, mapper));\n _lazyMethod(proto, \"addIssue\", (self) => (issue) => {\n self.issues.push(issue);\n self.message = JSON.stringify(self.issues, util.jsonStringifyReplacer, 2);\n });\n _lazyMethod(proto, \"addIssues\", (self) => (issues) => {\n self.issues.push(...issues);\n self.message = JSON.stringify(self.issues, util.jsonStringifyReplacer, 2);\n });\n Object.defineProperty(proto, \"isEmpty\", {\n configurable: true,\n enumerable: false,\n get() {\n return this.issues.length === 0;\n },\n });\n};\nexport const ZodError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer);\nexport const ZodRealError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer, undefined, {\n Parent: Error,\n});\n// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */\n// export type ErrorMapCtx = core.$ZodErrorMapCtx;\n","import * as core from \"../core/index.js\";\nimport { ZodRealError } from \"./errors.js\";\nexport const parse = /* @__PURE__ */ core._parse(ZodRealError);\nexport const parseAsync = /* @__PURE__ */ core._parseAsync(ZodRealError);\nexport const safeParse = /* @__PURE__ */ core._safeParse(ZodRealError);\nexport const safeParseAsync = /* @__PURE__ */ core._safeParseAsync(ZodRealError);\nexport { validate, validateAsync } from \"../core/index.js\";\n// Codec functions\nexport const encode = /* @__PURE__ */ core._encode(ZodRealError);\nexport const decode = /* @__PURE__ */ core._decode(ZodRealError);\nexport const encodeAsync = /* @__PURE__ */ core._encodeAsync(ZodRealError);\nexport const decodeAsync = /* @__PURE__ */ core._decodeAsync(ZodRealError);\nexport const safeEncode = /* @__PURE__ */ core._safeEncode(ZodRealError);\nexport const safeDecode = /* @__PURE__ */ core._safeDecode(ZodRealError);\nexport const safeEncodeAsync = /* @__PURE__ */ core._safeEncodeAsync(ZodRealError);\nexport const safeDecodeAsync = /* @__PURE__ */ core._safeDecodeAsync(ZodRealError);\n","import * as core from \"../core/index.js\";\nimport { util } from \"../core/index.js\";\nimport * as processors from \"../core/json-schema-processors.js\";\nimport * as regexes from \"../core/regexes.js\";\nimport { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from \"../core/to-json-schema.js\";\nimport en from \"../locales/en.js\";\nimport * as checks from \"./checks.js\";\nimport * as parse from \"./parse.js\";\n// Register English as the default locale on first ZodType construction. Hooked into the `ZodType` `$constructor` (rather than a top-level `config(en())` in `external.ts`) so bundlers honoring `sideEffects: false` can't tree-shake it out — see #5953, #5725. An explicit `z.config(z.locales.xx())` call wins regardless of order, since this only sets the default when none is present.\nfunction _ensureDefaultLocale() {\n if (!core.globalConfig.localeError)\n core.config(en());\n}\n// the default memoizer is read by the core container init, which runs before `ZodType.init`, so each container calls this first\nfunction _ensureDefaultMemoizer() {\n if (!core.globalConfig.memoizer)\n core.config({ memoizer: core.memoizer() });\n}\nexport const ZodType = /*@__PURE__*/ core.$constructor(\"ZodType\", (inst, def) => {\n _ensureDefaultLocale();\n core.$ZodType.init(inst, def);\n inst.def = def;\n inst.type = def.type;\n return inst;\n}, {\n check(...chks) {\n const def = this.def;\n return this.clone(util.mergeDefs(def, {\n checks: [\n ...(def.checks ?? []),\n ...chks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }), { parent: true });\n },\n with(...chks) {\n return this.check(...chks);\n },\n clone(def, params) {\n return core.clone(this, def, params);\n },\n brand() {\n return this;\n },\n register(reg, meta) {\n reg.add(this, meta);\n return this;\n },\n refine(check, params) {\n return this.check(refine(check, params));\n },\n superRefine(refinement, params) {\n return this.check(superRefine(refinement, params));\n },\n overwrite(fn) {\n return this.check(checks.overwrite(fn));\n },\n optional() {\n return optional(this);\n },\n exactOptional() {\n return exactOptional(this);\n },\n nullable() {\n return nullable(this);\n },\n nullish() {\n return optional(nullable(this));\n },\n nonoptional(params) {\n return nonoptional(this, params);\n },\n array() {\n return array(this);\n },\n or(arg) {\n return union([this, arg]);\n },\n and(arg) {\n return intersection(this, arg);\n },\n transform(tx) {\n return pipe(this, transform(tx));\n },\n default(d) {\n return _default(this, d);\n },\n prefault(d) {\n return prefault(this, d);\n },\n catch(params) {\n return _catch(this, params);\n },\n pipe(target) {\n return pipe(this, target);\n },\n readonly() {\n return readonly(this);\n },\n describe(description) {\n const cl = this.clone();\n core.globalRegistry.add(cl, { description });\n return cl;\n },\n meta(...args) {\n // overloaded: meta() returns the registered metadata, meta(data) returns a clone with `data` registered. The mapped type picks up the second overload, so we accept variadic any-args and return `any` to satisfy both at runtime.\n if (args.length === 0)\n return core.globalRegistry.get(this);\n const cl = this.clone();\n core.globalRegistry.add(cl, args[0]);\n return cl;\n },\n isOptional() {\n return this.safeParse(undefined).success;\n },\n isNullable() {\n return this.safeParse(null).success;\n },\n apply(fn, ...args) {\n return args.length === 0 ? fn(this) : fn(this, ...args);\n },\n // Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.\n get \"~standard\"() {\n return util.hide(this, \"~standard\", {\n ...core.standardProps(this),\n jsonSchema: {\n input: createStandardJSONSchemaMethod(this, \"input\"),\n output: createStandardJSONSchemaMethod(this, \"output\"),\n },\n });\n },\n set \"~standard\"(value) {\n util.own(this, \"~standard\", value);\n },\n parse: function _parse(data, params) {\n return parse.parse(this, data, params, { callee: _parse });\n },\n parseAsync: async function _parseAsync(data, params) {\n return await parse.parseAsync(this, data, params, { callee: _parseAsync });\n },\n safeParse(data, params) {\n return parse.safeParse(this, data, params);\n },\n async safeParseAsync(data, params) {\n return parse.safeParseAsync(this, data, params);\n },\n // `spa` is an alias: same function object as `safeParseAsync`, as before.\n get spa() {\n return this?.safeParseAsync;\n },\n set spa(value) {\n util.own(this, \"spa\", value);\n },\n validate(data, params) {\n return parse.validate(this, data, params);\n },\n validateAsync(data, params) {\n return parse.validateAsync(this, data, params);\n },\n encode: function _encode(data, params) {\n return parse.encode(this, data, params, { callee: _encode });\n },\n decode: function _decode(data, params) {\n return parse.decode(this, data, params, { callee: _decode });\n },\n encodeAsync: async function _encodeAsync(data, params) {\n return await parse.encodeAsync(this, data, params, { callee: _encodeAsync });\n },\n decodeAsync: async function _decodeAsync(data, params) {\n return await parse.decodeAsync(this, data, params, { callee: _decodeAsync });\n },\n safeEncode(data, params) {\n return parse.safeEncode(this, data, params);\n },\n safeDecode(data, params) {\n return parse.safeDecode(this, data, params);\n },\n async safeEncodeAsync(data, params) {\n return parse.safeEncodeAsync(this, data, params);\n },\n async safeDecodeAsync(data, params) {\n return parse.safeDecodeAsync(this, data, params);\n },\n toJSONSchema(params) {\n return createToJSONSchemaMethod(this, {})(params);\n },\n // Reads through to the registry on every access, so it must not cache.\n get description() {\n return core.globalRegistry.get(this)?.description;\n },\n // No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.\n get _def() {\n return this._zod.def;\n },\n});\n/** @internal */\nexport const _ZodString = /*@__PURE__*/ core.$constructor(\"_ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);\n}, \n/*@__PURE__*/ util.derived({\n format: (inst) => processors.aggregateChecks(inst).format ?? null,\n minLength: (inst) => processors.aggregateChecks(inst).minimum ?? null,\n maxLength: (inst) => processors.aggregateChecks(inst).maximum ?? null,\n}, {\n regex(...args) {\n return this.check(checks.regex(...args));\n },\n includes(...args) {\n return this.check(checks.includes(...args));\n },\n startsWith(...args) {\n return this.check(checks.startsWith(...args));\n },\n endsWith(...args) {\n return this.check(checks.endsWith(...args));\n },\n min(...args) {\n return this.check(checks.minLength(...args));\n },\n max(...args) {\n return this.check(checks.maxLength(...args));\n },\n length(...args) {\n return this.check(checks.length(...args));\n },\n nonempty(...args) {\n return this.check(checks.minLength(1, ...args));\n },\n lowercase(params) {\n return this.check(checks.lowercase(params));\n },\n uppercase(params) {\n return this.check(checks.uppercase(params));\n },\n trim() {\n return this.check(checks.trim());\n },\n normalize(...args) {\n return this.check(checks.normalize(...args));\n },\n toLowerCase() {\n return this.check(checks.toLowerCase());\n },\n toUpperCase() {\n return this.check(checks.toUpperCase());\n },\n slugify() {\n return this.check(checks.slugify());\n },\n}));\nexport const ZodString = /*@__PURE__*/ core.$constructor(\"ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n _ZodString.init(inst, def);\n}, {\n email(params) {\n return this.check(core._email(ZodEmail, params));\n },\n url(params) {\n return this.check(core._url(ZodURL, params));\n },\n jwt(params) {\n return this.check(core._jwt(ZodJWT, params));\n },\n emoji(params) {\n return this.check(core._emoji(ZodEmoji, params));\n },\n guid(params) {\n return this.check(core._guid(ZodGUID, params));\n },\n uuid(params) {\n return this.check(core._uuid(ZodUUID, params));\n },\n uuidv4(params) {\n return this.check(core._uuidv4(ZodUUID, params));\n },\n uuidv6(params) {\n return this.check(core._uuidv6(ZodUUID, params));\n },\n uuidv7(params) {\n return this.check(core._uuidv7(ZodUUID, params));\n },\n nanoid(params) {\n return this.check(core._nanoid(ZodNanoID, params));\n },\n cuid(params) {\n return this.check(core._cuid(ZodCUID, params));\n },\n cuid2(params) {\n return this.check(core._cuid2(ZodCUID2, params));\n },\n ulid(params) {\n return this.check(core._ulid(ZodULID, params));\n },\n base64(params) {\n return this.check(core._base64(ZodBase64, params));\n },\n base64url(params) {\n return this.check(core._base64url(ZodBase64URL, params));\n },\n xid(params) {\n return this.check(core._xid(ZodXID, params));\n },\n ksuid(params) {\n return this.check(core._ksuid(ZodKSUID, params));\n },\n ipv4(params) {\n return this.check(core._ipv4(ZodIPv4, params));\n },\n ipv6(params) {\n return this.check(core._ipv6(ZodIPv6, params));\n },\n cidrv4(params) {\n return this.check(core._cidrv4(ZodCIDRv4, params));\n },\n cidrv6(params) {\n return this.check(core._cidrv6(ZodCIDRv6, params));\n },\n e164(params) {\n return this.check(core._e164(ZodE164, params));\n },\n datetime(params) {\n return this.check(core._isoDateTime(ZodISODateTime, params));\n },\n date(params) {\n return this.check(core._isoDate(ZodISODate, params));\n },\n time(params) {\n return this.check(core._isoTime(ZodISOTime, params));\n },\n duration(params) {\n return this.check(core._isoDuration(ZodISODuration, params));\n },\n});\nexport function string(params) {\n return core._string(ZodString, params);\n}\nexport const ZodStringFormat = /*@__PURE__*/ core.$constructor(\"ZodStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n _ZodString.init(inst, def);\n});\nexport const ZodISODateTime = /*@__PURE__*/ core.$constructor(\"ZodISODateTime\", (inst, def) => {\n core.$ZodISODateTime.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodISODate = /*@__PURE__*/ core.$constructor(\"ZodISODate\", (inst, def) => {\n core.$ZodISODate.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodISOTime = /*@__PURE__*/ core.$constructor(\"ZodISOTime\", (inst, def) => {\n core.$ZodISOTime.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodISODuration = /*@__PURE__*/ core.$constructor(\"ZodISODuration\", (inst, def) => {\n core.$ZodISODuration.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodEmail = /*@__PURE__*/ core.$constructor(\"ZodEmail\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmail.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function email(params) {\n return core._email(ZodEmail, params);\n}\nexport const ZodGUID = /*@__PURE__*/ core.$constructor(\"ZodGUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodGUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function guid(params) {\n return core._guid(ZodGUID, params);\n}\nexport const ZodUUID = /*@__PURE__*/ core.$constructor(\"ZodUUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodUUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function uuid(params) {\n return core._uuid(ZodUUID, params);\n}\nexport function uuidv4(params) {\n return core._uuidv4(ZodUUID, params);\n}\n// ZodUUIDv6\nexport function uuidv6(params) {\n return core._uuidv6(ZodUUID, params);\n}\n// ZodUUIDv7\nexport function uuidv7(params) {\n return core._uuidv7(ZodUUID, params);\n}\nexport const ZodURL = /*@__PURE__*/ core.$constructor(\"ZodURL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodURL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function url(params) {\n return core._url(ZodURL, params);\n}\nexport function httpUrl(params) {\n return core._url(ZodURL, {\n protocol: regexes.httpProtocol,\n hostname: regexes.domain,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEmoji = /*@__PURE__*/ core.$constructor(\"ZodEmoji\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmoji.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function emoji(params) {\n return core._emoji(ZodEmoji, params);\n}\nexport const ZodNanoID = /*@__PURE__*/ core.$constructor(\"ZodNanoID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodNanoID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function nanoid(params) {\n return core._nanoid(ZodNanoID, params);\n}\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link ZodCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const ZodCUID = /*@__PURE__*/ core.$constructor(\"ZodCUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\n/**\n * Validates a CUID v1 string.\n *\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport function cuid(params) {\n return core._cuid(ZodCUID, params);\n}\nexport const ZodCUID2 = /*@__PURE__*/ core.$constructor(\"ZodCUID2\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID2.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid2(params) {\n return core._cuid2(ZodCUID2, params);\n}\nexport const ZodULID = /*@__PURE__*/ core.$constructor(\"ZodULID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodULID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ulid(params) {\n return core._ulid(ZodULID, params);\n}\nexport const ZodXID = /*@__PURE__*/ core.$constructor(\"ZodXID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodXID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function xid(params) {\n return core._xid(ZodXID, params);\n}\nexport const ZodKSUID = /*@__PURE__*/ core.$constructor(\"ZodKSUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodKSUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ksuid(params) {\n return core._ksuid(ZodKSUID, params);\n}\nexport const ZodIPv4 = /*@__PURE__*/ core.$constructor(\"ZodIPv4\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv4(params) {\n return core._ipv4(ZodIPv4, params);\n}\nexport const ZodMAC = /*@__PURE__*/ core.$constructor(\"ZodMAC\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodMAC.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function mac(params) {\n return core._mac(ZodMAC, params);\n}\nexport const ZodIPv6 = /*@__PURE__*/ core.$constructor(\"ZodIPv6\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv6(params) {\n return core._ipv6(ZodIPv6, params);\n}\nexport const ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv4(params) {\n return core._cidrv4(ZodCIDRv4, params);\n}\nexport const ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv6(params) {\n return core._cidrv6(ZodCIDRv6, params);\n}\nexport const ZodBase64 = /*@__PURE__*/ core.$constructor(\"ZodBase64\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64(params) {\n return core._base64(ZodBase64, params);\n}\nexport const ZodBase64URL = /*@__PURE__*/ core.$constructor(\"ZodBase64URL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64URL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64url(params) {\n return core._base64url(ZodBase64URL, params);\n}\nexport const ZodE164 = /*@__PURE__*/ core.$constructor(\"ZodE164\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodE164.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function e164(params) {\n return core._e164(ZodE164, params);\n}\nexport const ZodCreditCard = /*@__PURE__*/ core.$constructor(\"ZodCreditCard\", (inst, def) => {\n core.$ZodCreditCard.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function creditCard(params) {\n return core._creditCard(ZodCreditCard, params);\n}\nexport const ZodIBAN = /*@__PURE__*/ core.$constructor(\"ZodIBAN\", (inst, def) => {\n core.$ZodIBAN.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function iban(params) {\n return core._iban(ZodIBAN, params);\n}\nexport const ZodJWT = /*@__PURE__*/ core.$constructor(\"ZodJWT\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodJWT.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function jwt(params) {\n return core._jwt(ZodJWT, params);\n}\nexport const ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodCustomStringFormat\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCustomStringFormat.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);\n}\nexport function hostname(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hostname\", regexes.hostname, _params);\n}\nexport function hex(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hex\", regexes.hex, _params);\n}\nexport function currencyCode(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"currency_code\", regexes.currencyCode, _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 if (!regex)\n throw new Error(`Unrecognized hash format: ${format}`);\n return core._stringFormat(ZodCustomStringFormat, format, regex, params);\n}\nexport const ZodNumber = /*@__PURE__*/ core.$constructor(\"ZodNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);\n inst.isFinite = true;\n}, \n/*@__PURE__*/ util.derived({\n minValue: (inst) => {\n const { minimum, exclusiveMinimum } = processors.aggregateChecks(inst);\n return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);\n },\n maxValue: (inst) => {\n const { maximum, exclusiveMaximum } = processors.aggregateChecks(inst);\n return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);\n },\n isInt: (inst) => {\n const { isInt, multipleOf } = processors.aggregateChecks(inst);\n return !!isInt || !!multipleOf?.some(Number.isSafeInteger);\n },\n format: (inst) => processors.aggregateChecks(inst).format ?? null,\n}, {\n gt(value, params) {\n return this.check(checks.gt(value, params));\n },\n gte(value, params) {\n return this.check(checks.gte(value, params));\n },\n min(value, params) {\n return this.check(checks.gte(value, params));\n },\n lt(value, params) {\n return this.check(checks.lt(value, params));\n },\n lte(value, params) {\n return this.check(checks.lte(value, params));\n },\n max(value, params) {\n return this.check(checks.lte(value, params));\n },\n int(params) {\n return this.check(int(params));\n },\n safe(params) {\n return this.check(int(params));\n },\n positive(params) {\n return this.check(checks.gt(0, params));\n },\n nonnegative(params) {\n return this.check(checks.gte(0, params));\n },\n negative(params) {\n return this.check(checks.lt(0, params));\n },\n nonpositive(params) {\n return this.check(checks.lte(0, params));\n },\n multipleOf(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n step(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n finite() {\n return this;\n },\n}));\nexport function number(params) {\n return core._number(ZodNumber, params);\n}\nexport const ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodNumber.init(inst, def);\n});\nexport function int(params) {\n return core._int(ZodNumberFormat, params);\n}\nexport function float32(params) {\n return core._float32(ZodNumberFormat, params);\n}\nexport function float64(params) {\n return core._float64(ZodNumberFormat, params);\n}\nexport function int32(params) {\n return core._int32(ZodNumberFormat, params);\n}\nexport function uint32(params) {\n return core._uint32(ZodNumberFormat, params);\n}\nexport const ZodBoolean = /*@__PURE__*/ core.$constructor(\"ZodBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.booleanProcessor(inst, ctx, json, params);\n});\nexport function boolean(params) {\n return core._boolean(ZodBoolean, params);\n}\nexport const ZodBigInt = /*@__PURE__*/ core.$constructor(\"ZodBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);\n}, \n/*@__PURE__*/ util.derived({\n minValue: (inst) => processors.aggregateChecks(inst).minimum ?? null,\n maxValue: (inst) => processors.aggregateChecks(inst).maximum ?? null,\n format: (inst) => processors.aggregateChecks(inst).format ?? null,\n}, {\n gte(value, params) {\n return this.check(checks.gte(value, params));\n },\n min(value, params) {\n return this.check(checks.gte(value, params));\n },\n gt(value, params) {\n return this.check(checks.gt(value, params));\n },\n lt(value, params) {\n return this.check(checks.lt(value, params));\n },\n lte(value, params) {\n return this.check(checks.lte(value, params));\n },\n max(value, params) {\n return this.check(checks.lte(value, params));\n },\n positive(params) {\n return this.check(checks.gt(BigInt(0), params));\n },\n negative(params) {\n return this.check(checks.lt(BigInt(0), params));\n },\n nonpositive(params) {\n return this.check(checks.lte(BigInt(0), params));\n },\n nonnegative(params) {\n return this.check(checks.gte(BigInt(0), params));\n },\n multipleOf(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n}));\nexport function bigint(params) {\n return core._bigint(ZodBigInt, params);\n}\nexport const ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodBigInt.init(inst, def);\n});\nexport function int64(params) {\n return core._int64(ZodBigIntFormat, params);\n}\nexport function uint64(params) {\n return core._uint64(ZodBigIntFormat, params);\n}\nexport const ZodSymbol = /*@__PURE__*/ core.$constructor(\"ZodSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.symbolProcessor(inst, ctx, json, params);\n});\nexport function symbol(params) {\n return core._symbol(ZodSymbol, params);\n}\nexport const ZodUndefined = /*@__PURE__*/ core.$constructor(\"ZodUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.undefinedProcessor(inst, ctx, json, params);\n});\nfunction _undefined(params) {\n return core._undefined(ZodUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodNull = /*@__PURE__*/ core.$constructor(\"ZodNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullProcessor(inst, ctx, json, params);\n});\nfunction _null(params) {\n return core._null(ZodNull, params);\n}\nexport { _null as null };\nexport const ZodAny = /*@__PURE__*/ core.$constructor(\"ZodAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.anyProcessor(inst, ctx, json, params);\n});\nexport function any() {\n return core._any(ZodAny);\n}\nexport const ZodUnknown = /*@__PURE__*/ core.$constructor(\"ZodUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unknownProcessor(inst, ctx, json, params);\n});\nexport function unknown() {\n return core._unknown(ZodUnknown);\n}\nexport const ZodNever = /*@__PURE__*/ core.$constructor(\"ZodNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.neverProcessor(inst, ctx, json, params);\n});\nexport function never(params) {\n return core._never(ZodNever, params);\n}\nexport const ZodVoid = /*@__PURE__*/ core.$constructor(\"ZodVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.voidProcessor(inst, ctx, json, params);\n});\nfunction _void(params) {\n return core._void(ZodVoid, params);\n}\nexport { _void as void };\nexport const ZodDate = /*@__PURE__*/ core.$constructor(\"ZodDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n}, \n/*@__PURE__*/ util.derived({\n minDate: (inst) => {\n const { minimum } = processors.aggregateChecks(inst);\n return minimum ? new Date(minimum) : null;\n },\n maxDate: (inst) => {\n const { maximum } = processors.aggregateChecks(inst);\n return maximum ? new Date(maximum) : null;\n },\n}, {}));\nexport function date(params) {\n return core._date(ZodDate, params);\n}\nexport const ZodArray = /*@__PURE__*/ core.$constructor(\"ZodArray\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodArray.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);\n inst.element = def.element;\n}, {\n min(n, params) {\n return this.check(checks.minLength(n, params));\n },\n nonempty(params) {\n return this.check(checks.minLength(1, params));\n },\n max(n, params) {\n return this.check(checks.maxLength(n, params));\n },\n length(n, params) {\n return this.check(checks.length(n, params));\n },\n unwrap() {\n return this.element;\n },\n});\nexport function array(element, params) {\n return core._array(ZodArray, element, params);\n}\n// .keyof\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return _enum(Object.keys(shape));\n}\nexport const ZodObject = /*@__PURE__*/ core.$constructor(\"ZodObject\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodObjectJIT.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);\n util.installLazyProp(inst, \"shape\", (self) => self._zod.def.shape, false);\n}, {\n keyof() {\n return _enum(Object.keys(this._zod.def.shape));\n },\n catchall(catchall) {\n // `mergeDefs` rather than a spread: spreading reads `shape`, and resolving it can mint a whole fresh subtree\n return this.clone(util.mergeDefs(this._zod.def, { catchall: catchall }));\n },\n passthrough() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));\n },\n loose() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));\n },\n strict() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: never() }));\n },\n strip() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: undefined }));\n },\n extend(incoming) {\n return util.extend(this, incoming);\n },\n safeExtend(incoming) {\n return util.safeExtend(this, incoming);\n },\n merge(other) {\n return util.merge(this, other);\n },\n pick(mask) {\n return util.pick(this, mask);\n },\n omit(mask) {\n return util.omit(this, mask);\n },\n partial(...args) {\n return util.partial(ZodOptional, this, args[0]);\n },\n exactPartial(...args) {\n return util.partial(ZodExactOptional, this, args[0], \"exactPartial\");\n },\n required(...args) {\n return util.required(ZodNonOptional, this, args[0]);\n },\n});\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n shape: shape ?? {},\n ...util.normalizeParams(params),\n };\n return new ZodObject(def);\n}\n// strictObject\nexport function strictObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\nexport function looseObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\nexport const ZodUnion = /*@__PURE__*/ core.$constructor(\"ZodUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\n});\nexport function union(options, params) {\n return new ZodUnion({\n type: \"union\",\n options: options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodXor = /*@__PURE__*/ core.$constructor(\"ZodXor\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodXor.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\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 ZodXor({\n type: \"union\",\n options: options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodDiscriminatedUnion\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodDiscriminatedUnion.init(inst, def);\n});\nexport function discriminatedUnion(discriminator, options, params) {\n // const [options, params] = args;\n return new ZodDiscriminatedUnion({\n type: \"union\",\n options: options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodIntersection = /*@__PURE__*/ core.$constructor(\"ZodIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.intersectionProcessor(inst, ctx, json, params);\n});\nexport function intersection(left, right) {\n return new ZodIntersection({\n type: \"intersection\",\n left: left,\n right: right,\n });\n}\nexport const ZodTuple = /*@__PURE__*/ core.$constructor(\"ZodTuple\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodTuple.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);\n}, {\n rest(rest) {\n return this.clone({\n ...this._zod.def,\n rest: rest,\n });\n },\n partial() {\n const def = this._zod.def;\n // a refinement was authored against the full arity; partialing would run it on a shorter array\n if (def.checks?.length)\n throw new Error(\".partial() cannot be used on tuple schemas containing refinements\");\n return this.clone({\n ...def,\n items: def.items.map((item) => new ZodOptional({ type: \"optional\", innerType: item })),\n });\n },\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 ZodTuple({\n type: \"tuple\",\n items: items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodRecord = /*@__PURE__*/ core.$constructor(\"ZodRecord\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodRecord.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n});\nexport function record(keyType, valueType, params) {\n // v3-compat: z.record(valueType, params?) — defaults keyType to z.string()\n if (!valueType || !valueType._zod) {\n return new ZodRecord({\n type: \"record\",\n keyType: string(),\n valueType: keyType,\n ...util.normalizeParams(valueType),\n });\n }\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\n// type alksjf = core.output<core.$ZodRecordKey>;\nexport function partialRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n partial: true,\n });\n}\nexport function looseRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n mode: \"loose\",\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMap = /*@__PURE__*/ core.$constructor(\"ZodMap\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodMap.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function map(keyType, valueType, params) {\n return new ZodMap({\n type: \"map\",\n keyType: keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSet = /*@__PURE__*/ core.$constructor(\"ZodSet\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodSet.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function set(valueType, params) {\n return new ZodSet({\n type: \"set\",\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEnum = /*@__PURE__*/ core.$constructor(\"ZodEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);\n inst.enum = def.entries;\n // reuse the parsed value set so a numeric TS enum's reverse-mapping keys stay out\n inst.options = [...inst._zod.values];\n const keys = new Set(Object.keys(def.entries));\n inst.extract = (values, params) => {\n const newEntries = {};\n for (const value of values) {\n if (keys.has(value)) {\n newEntries[value] = def.entries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n inst.exclude = (values, params) => {\n const newEntries = { ...def.entries };\n for (const value of values) {\n if (keys.has(value)) {\n delete newEntries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n});\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodEnum({\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 ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLiteral = /*@__PURE__*/ core.$constructor(\"ZodLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.literalProcessor(inst, ctx, json, params);\n inst.values = new Set(def.values);\n Object.defineProperty(inst, \"value\", {\n get() {\n if (def.values.length > 1) {\n throw new Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");\n }\n return def.values[0];\n },\n });\n});\nexport function literal(value, params) {\n return new ZodLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodFile = /*@__PURE__*/ core.$constructor(\"ZodFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.fileProcessor(inst, ctx, json, params);\n inst.min = (size, params) => inst.check(core._minSize(size, params));\n inst.max = (size, params) => inst.check(core._maxSize(size, params));\n inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));\n});\nexport function file(params) {\n return core._file(ZodFile, params);\n}\nexport const ZodTransform = /*@__PURE__*/ core.$constructor(\"ZodTransform\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodTransform.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);\n inst._zod.parse = (payload, _ctx) => {\n if (_ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, 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 if (!(\"input\" in _issue))\n _issue.input = payload.value;\n _issue.inst ?? (_issue.inst = inst);\n // _issue.continue ??= true;\n payload.issues.push(util.issue(_issue));\n }\n };\n const output = def.transform(payload.value, payload);\n if (output instanceof Promise) {\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n payload.value = output;\n return payload;\n };\n});\nexport function transform(fn) {\n return new ZodTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodOptional = /*@__PURE__*/ core.$constructor(\"ZodOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function optional(innerType) {\n return new ZodOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodExactOptional = /*@__PURE__*/ core.$constructor(\"ZodExactOptional\", (inst, def) => {\n core.$ZodExactOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function exactOptional(innerType) {\n return new ZodExactOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodNullable = /*@__PURE__*/ core.$constructor(\"ZodNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullableProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nullable(innerType) {\n return new ZodNullable({\n type: \"nullable\",\n innerType: innerType,\n });\n}\n// nullish\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodDefault = /*@__PURE__*/ core.$constructor(\"ZodDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.defaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeDefault = inst.unwrap;\n});\nexport function _default(innerType, defaultValue) {\n return new ZodDefault({\n type: \"default\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodPrefault = /*@__PURE__*/ core.$constructor(\"ZodPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.prefaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function prefault(innerType, defaultValue) {\n return new ZodPrefault({\n type: \"prefault\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodNonOptional = /*@__PURE__*/ core.$constructor(\"ZodNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nonoptionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nonoptional(innerType, params) {\n return new ZodNonOptional({\n type: \"nonoptional\",\n innerType: innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSuccess = /*@__PURE__*/ core.$constructor(\"ZodSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.successProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function success(innerType) {\n return new ZodSuccess({\n type: \"success\",\n innerType: innerType,\n });\n}\nexport const ZodCatch = /*@__PURE__*/ core.$constructor(\"ZodCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.catchProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeCatch = inst.unwrap;\n});\nfunction _catch(innerType, catchValue) {\n return new ZodCatch({\n type: \"catch\",\n innerType: innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : core.util.constantCatch(catchValue)),\n });\n}\nexport { _catch as catch };\nexport const ZodNaN = /*@__PURE__*/ core.$constructor(\"ZodNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nanProcessor(inst, ctx, json, params);\n});\nexport function nan(params) {\n return core._nan(ZodNaN, params);\n}\nexport const ZodPipe = /*@__PURE__*/ core.$constructor(\"ZodPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.pipeProcessor(inst, ctx, json, params);\n inst.in = def.in;\n inst.out = def.out;\n});\nexport function pipe(in_, out) {\n return new ZodPipe({\n type: \"pipe\",\n in: in_,\n out: out,\n // ...util.normalizeParams(params),\n });\n}\nexport const ZodCodec = /*@__PURE__*/ core.$constructor(\"ZodCodec\", (inst, def) => {\n ZodPipe.init(inst, def);\n core.$ZodCodec.init(inst, def);\n});\nexport function codec(in_, out, params) {\n return new ZodCodec({\n type: \"pipe\",\n in: in_,\n out: out,\n transform: params.decode,\n reverseTransform: params.encode,\n });\n}\nexport function invertCodec(codec) {\n const def = codec._zod.def;\n return new ZodCodec({\n type: \"pipe\",\n in: def.out,\n out: def.in,\n transform: def.reverseTransform,\n reverseTransform: def.transform,\n });\n}\nexport const ZodPreprocess = /*@__PURE__*/ core.$constructor(\"ZodPreprocess\", (inst, def) => {\n ZodPipe.init(inst, def);\n core.$ZodPreprocess.init(inst, def);\n});\nexport const ZodReadonly = /*@__PURE__*/ core.$constructor(\"ZodReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.readonlyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function readonly(innerType) {\n return new ZodReadonly({\n type: \"readonly\",\n innerType: innerType,\n });\n}\nexport const ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.templateLiteralProcessor(inst, ctx, json, params);\n});\nexport function templateLiteral(parts, params) {\n return new ZodTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLazy = /*@__PURE__*/ core.$constructor(\"ZodLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.lazyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.getter();\n});\nexport function lazy(getter) {\n return new ZodLazy({\n type: \"lazy\",\n getter: getter,\n });\n}\nexport const ZodPromise = /*@__PURE__*/ core.$constructor(\"ZodPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.promiseProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function promise(innerType) {\n return new ZodPromise({\n type: \"promise\",\n innerType: innerType,\n });\n}\nexport const ZodFunction = /*@__PURE__*/ core.$constructor(\"ZodFunction\", (inst, def) => {\n core.$ZodFunction.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.functionProcessor(inst, ctx, json, params);\n});\nexport function _function(params) {\n return new ZodFunction({\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 };\nexport const ZodCustom = /*@__PURE__*/ core.$constructor(\"ZodCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);\n});\n// custom checks\nexport function check(fn) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n // ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\nexport function custom(fn, _params) {\n return core._custom(ZodCustom, fn ?? (() => true), _params);\n}\nexport function refine(fn, _params = {}) {\n return core._refine(ZodCustom, fn, _params);\n}\n// superRefine\nexport function superRefine(fn, params) {\n return core._superRefine(fn, params);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\nexport const ZodInstanceOf = /*@__PURE__*/ core.$constructor(\"ZodInstanceOf\", (inst, def) => {\n ZodCustom.init(inst, def);\n}, {\n properties(shape, params) {\n // asserts in place, so the narrowed output type is truthful without a wrapper\n return this.check(core._properties(shape, params));\n },\n});\nfunction _instanceof(cls, params = {}) {\n const inst = new ZodInstanceOf({\n type: \"custom\",\n check: \"custom\",\n fn: (data) => data instanceof cls,\n abort: true,\n ...util.normalizeParams(params),\n });\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: ZodCodec,\n Boolean: ZodBoolean,\n String: ZodString,\n}, ...args);\nexport function json(params) {\n const jsonSchema = lazy(() => {\n return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\n// preprocess\nexport function preprocess(fn, schema) {\n return new ZodPreprocess({\n type: \"pipe\",\n in: transform(fn),\n out: schema,\n });\n}\n","/** Browser-safe Skills wire shapes. Session IDs select authority; clients never send paths. */\nimport { z } from 'zod'\nexport const SKILLS_ENDPOINTS = ['skillsList', 'skillsPreview', 'skillsChanges'] as const\nexport type SkillsEndpoint = typeof SKILLS_ENDPOINTS[number]\nconst nameSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*:[a-z0-9]+(?:-[a-z0-9]+)*$/)\nexport const skillsRequestSchema = z.object({ sessionId: z.string().min(1), name: nameSchema.optional(), generation: z.number().int().nonnegative().optional() }).strict()\nconst status = { sessionId: z.string(), generation: z.number().int().nonnegative(), enabled: z.boolean() }\nexport const skillsStatusSchema = z.object(status)\nexport const skillsCatalogSchema = z.object({ ...status, skills: z.array(z.object({ name: nameSchema, description: z.string(), modelInvocable: z.boolean() })) })\nexport const skillsPreviewSchema = z.object({ ...status, name: nameSchema, content: z.string() })\nexport type SkillsStatusView = z.infer<typeof skillsStatusSchema>\nexport type SkillsCatalogView = z.infer<typeof skillsCatalogSchema>\nexport type SkillsPreviewView = z.infer<typeof skillsPreviewSchema>\nexport interface SkillsResponseMap { skillsList: SkillsCatalogView; skillsPreview: SkillsPreviewView; skillsChanges: SkillsStatusView }\n","/**\n * The wire contract between the browser panel and this plugin's host half.\n *\n * It is deliberately transport-agnostic plain data: the host registers one\n * Connection RPC channel (see `command.ts`) and the client bundle inlines this\n * module, so both sides agree on endpoint names and payload shapes without\n * sharing any runtime identity. Error codes are the stable half of the\n * contract; `message` is only a fallback the panel does not have to show.\n *\n * Two properties this module owns:\n *\n * - **One shape per endpoint.** {@link PanelResponseMap} is the single mapping\n * from endpoint to response type, so the panel cannot silently decode one\n * endpoint's answer as another's. `reveal` answers with\n * {@link RevealedView}; root-management endpoints answer with\n * {@link RootsView}.\n * The host builds those answers in `command.ts` and the\n * panel parses them here — one definition, two consumers.\n * - **Runtime validation at the boundary.** The payload arrives from a browser\n * and the answer arrives from the host; neither is trusted to match the\n * TypeScript types. {@link parsePanelCall} and the `parse*View` functions\n * check the shapes and report structural failures as a message, so a\n * mismatch becomes a visible, localized error instead of a crash or a\n * silently wrong render.\n *\n * Nothing here may import `node:*` or `@deepseek-ai/*`: this module is inlined\n * into the browser bundle.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/contract\n */\n\nimport { z } from 'zod'\nimport type { SkillsResponseMap } from './skills-contract.ts'\nexport { SKILLS_ENDPOINTS, skillsRequestSchema, skillsCatalogSchema, skillsPreviewSchema, skillsStatusSchema } from './skills-contract.ts'\nexport type { SkillsEndpoint, SkillsStatusView, SkillsCatalogView, SkillsPreviewView } from './skills-contract.ts'\nexport interface WorkspaceResponseMap extends PanelResponseMap, SkillsResponseMap {}\n\n/** The absolute logical channel both halves speak over. */\nexport const PANEL_CHANNEL = '/multi-root-workspace'\n\n/** Endpoint names, relative to {@link PANEL_CHANNEL}. */\nexport type PanelEndpoint = 'list' | 'add' | 'remove' | 'alias' | 'move' | 'setAccess' | 'setSkillsEnabled' | 'setAliasId' | 'reveal'\n\n/** Every endpoint name, for exhaustive iteration in tests and callers. */\nexport const PANEL_ENDPOINTS: readonly PanelEndpoint[] = ['list', 'add', 'remove', 'alias', 'move', 'setAccess', 'setSkillsEnabled', 'setAliasId', 'reveal']\n\n/**\n * How one registered root currently stands, as the panel renders it. Kept in\n * step with the root vocabulary in `src/roots.ts` deliberately: this module is\n * inlined into the browser bundle and must not pull in `node:*`, so the one\n * value the two sides share is spelled out rather than imported.\n */\nexport type RootState = 'available' | 'missing' | 'redirected' | 'invalid'\n\n/**\n * The write authority one registration carries (B9 three-state), spelled out\n * rather than imported: this module is inlined into the browser bundle and\n * must not pull in `node:*`, so the one value the two sides share is\n * duplicated here.\n */\nexport type RootAccess = 'inherit' | 'read-write' | 'read-only'\nexport type WorkspaceMode = 'read-only' | 'workspace-write' | 'danger-full-access'\nexport type EffectiveRootAccess = 'read-only' | 'read-write' | 'full-access' | 'unavailable'\n\n/** The shared nine-cell rule; tool dispatch may subsequently narrow writes. */\nexport function effectiveRootAccess(access: RootAccess, mode: WorkspaceMode): EffectiveRootAccess {\n if (access !== 'inherit') return access\n return mode === 'danger-full-access' ? 'full-access' : mode === 'workspace-write' ? 'read-write' : 'read-only'\n}\n\n/** One root as the panel renders it. */\nexport interface RootView {\n /** 1-based position in the returned snapshot. */\n readonly ordinal: number\n /** Stable identity, used by every mutating endpoint. */\n readonly id: string\n /** Canonical absolute directory. */\n readonly path: string\n /** Display alias as stored; absent when cleared. */\n readonly aliasId?: string\n readonly skillsEnabled?: boolean\n readonly alias?: string\n /** ISO-8601 registration instant. */\n readonly addedAt: string\n /** Whether the directory is writable right now, withheld, or unusable. */\n readonly state: RootState\n /** The write authority the registration carries. */\n readonly access: RootAccess\n /** Host-derived session permission, before any per-tool cap. */\n readonly effectiveAccess?: EffectiveRootAccess\n /** Why the root is not `available`; a code the panel localizes. */\n readonly detail?: string\n}\n\n/** Exact identity of one row in a returned list snapshot. */\nexport interface RootEntryView {\n readonly ordinal: number\n readonly id: string\n readonly path: string\n readonly addedAt: string\n}\n\n/** The panel's whole view, returned by root-management endpoints. */\nexport interface RootsView {\n /** The canonical workspace root these registrations belong to. */\n readonly primaryRoot: string\n /**\n * Display name of the primary root: the workspace's upstream title when the\n * host could resolve one; absent means the panel falls back to the path's\n * basename.\n */\n readonly primaryName?: string\n /** Execution directory only; never a registry key or an authorization grant. */\n readonly effectiveCwd?: string\n readonly mode?: WorkspaceMode\n readonly cappedTools?: readonly string[]\n readonly toolAccessInvalid?: boolean\n /** The additional roots, in registry order. */\n readonly roots: readonly RootView[]\n /** The host cap; MAX_SAFE_INTEGER means a legacy host reported no limit. */\n readonly limit: number\n /**\n * How many records are stored, in every state. `count > limit` is a\n * historical over-limit store: everything stays granted, only adds refuse.\n */\n readonly count: number\n /** Set when the store itself could not be read; the panel shows this verbatim. */\n readonly unavailable?: string\n}\n\n/** What `reveal` answers with: the directory the host asked the file manager to show. */\nexport interface RevealedView {\n /** Canonical path of the revealed root. */\n readonly revealed: string\n}\n\n/** The response type of every endpoint — the mapping the panel is typed against. */\nexport interface PanelResponseMap {\n readonly list: RootsView\n readonly add: RootsView\n readonly remove: RootsView\n readonly alias: RootsView\n readonly move: RootsView\n readonly setSkillsEnabled: RootsView\n readonly setAliasId: RootsView\n readonly setAccess: RootsView\n readonly reveal: RevealedView\n}\n\n/**\n * The fields a request may carry. `sessionId` is required on every endpoint:\n * the host derives the primary root from that session's immutable cwd and\n * never accepts a client-named path. The remaining fields are used per\n * endpoint and the host asserts which ones that endpoint requires.\n */\nexport interface PanelRequest {\n /** The live host session whose cwd is the primary root this call acts on. */\n readonly sessionId: string\n /** Exact target row from the most recent list snapshot. */\n readonly entry?: RootEntryView\n /** Compatibility reference; accepted only when the id is unique. */\n readonly id?: string\n /** Candidate directory (add). */\n readonly path?: string\n /** Display alias (add/alias); empty clears it. */\n readonly aliasId?: string\n readonly skillsEnabled?: boolean\n readonly alias?: string\n /** Write authority (add — defaults to `inherit` — and setAccess). */\n readonly access?: RootAccess\n /** Exact anchor row (move): the target is placed in front of it; absent moves it last. */\n readonly beforeEntry?: RootEntryView\n /** Compatibility anchor; accepted only when the id is unique. */\n readonly beforeId?: string\n}\n\n/** One validated call: the endpoint plus the request fields it may use. */\nexport interface PanelCall extends PanelRequest {\n /** The endpoint to call. */\n readonly endpoint: PanelEndpoint\n}\n\n/** A failure the panel renders by `code`. */\nexport interface PanelFailure {\n /** Stable code from the root vocabulary, or `panel/bad-request`. */\n readonly code: string\n /** Human-readable fallback text. */\n readonly message: string\n}\n\n/** One parse result: the value, or one sentence naming what was wrong. */\nexport type Parsed<T> = { readonly ok: true; readonly value: T } | { readonly ok: false; readonly message: string }\n\n/**\n * The request body on the wire. The endpoint travels as the RPC method, not as\n * a field, so this schema covers the fields only; the host pairs it with the\n * method the channel dispatched (and rejects the pair if the body contradicts\n * it). Unknown keys are rejected rather than ignored: a client sending a field\n * this host does not understand is out of contract, and silently dropping it\n * would hide the drift.\n */\nconst panelRequestSchema = z.object({\n sessionId: z.string().min(1),\n entry: z.object({\n ordinal: z.number().int().positive(),\n id: z.string(),\n path: z.string(),\n addedAt: z.string(),\n }).strict().optional(),\n id: z.string().optional(),\n path: z.string().optional(),\n aliasId: z.string().optional(),\n skillsEnabled: z.boolean().optional(),\n alias: z.string().optional(),\n access: z.enum(['inherit', 'read-write', 'read-only']).optional(),\n beforeEntry: z.object({\n ordinal: z.number().int().positive(),\n id: z.string(),\n path: z.string(),\n addedAt: z.string(),\n }).strict().optional(),\n beforeId: z.string().optional(),\n}).strict()\n\n/**\n * One root as it travels over the channel. Deliberately NOT strict, in both\n * directions: a newer host that adds a field must not brick an older panel, and\n * the field that matters is the state it reports.\n */\nconst rootViewSchema = z.object({\n ordinal: z.number().int().positive(),\n id: z.string(),\n path: z.string(),\n aliasId: z.string().optional(),\n skillsEnabled: z.boolean().optional(),\n alias: z.string().optional(),\n addedAt: z.string(),\n state: z.enum(['available', 'missing', 'redirected', 'invalid']),\n // Optional on the wire so an older host (which always meant session-following\n // read-write — `inherit` under B9) still parses; narrowed to the legacy\n // default in `narrowRootView`.\n access: z.enum(['inherit', 'read-write', 'read-only']).optional(),\n detail: z.string().optional(),\n effectiveAccess: z.enum(['read-only', 'read-write', 'full-access', 'unavailable']).optional(),\n})\n\nconst rootsViewSchema = z.object({\n primaryRoot: z.string(),\n primaryName: z.string().optional(),\n effectiveCwd: z.string().optional(),\n mode: z.enum(['read-only', 'workspace-write', 'danger-full-access']).optional(),\n cappedTools: z.array(z.string()).optional(),\n toolAccessInvalid: z.boolean().optional(),\n roots: z.array(rootViewSchema),\n // Pre-limit hosts omitted both fields. Absence is compatible; malformed\n // supplied values still fail validation.\n limit: z.number().int().nonnegative().optional(),\n count: z.number().int().nonnegative().optional(),\n unavailable: z.string().optional(),\n})\n\nconst revealedViewSchema = z.object({ revealed: z.string() })\n\nconst errorViewSchema = z.object({\n code: z.string(),\n message: z.string(),\n details: z.unknown().optional(),\n})\n\n/**\n * Validate the payload the host received for one endpoint.\n * @param endpoint - the endpoint the channel dispatched (the RPC method).\n * @param payload - the raw channel payload (the request body).\n * @returns the call the host may act on, or the reason it is not one.\n */\nexport function parsePanelCall(endpoint: string, payload: unknown): Parsed<PanelCall> {\n const known = (PANEL_ENDPOINTS as readonly string[]).includes(endpoint)\n if (!known) return { ok: false, message: `unknown endpoint \"${endpoint}\"` }\n const parsed = panelRequestSchema.safeParse(payload ?? {})\n if (!parsed.success) return { ok: false, message: `the request body is invalid: ${firstIssue(parsed.error)}` }\n return { ok: true, value: narrowCall(endpoint as PanelEndpoint, parsed.data) }\n}\n\n/**\n * Validate a `RootsView` when it arrives.\n * @param value - the raw endpoint value.\n * @returns the view, or the reason it is not one.\n */\nexport function parseRootsView(value: unknown): Parsed<RootsView> {\n const parsed = rootsViewSchema.safeParse(value)\n if (!parsed.success) return { ok: false, message: `the answer is not a roots view: ${firstIssue(parsed.error)}` }\n const view = parsed.data\n return {\n ok: true,\n value: {\n primaryRoot: view.primaryRoot,\n ...(view.primaryName === undefined ? {} : { primaryName: view.primaryName }),\n ...(view.effectiveCwd === undefined ? {} : { effectiveCwd: view.effectiveCwd }),\n ...(view.mode === undefined ? {} : { mode: view.mode }),\n ...(view.cappedTools === undefined ? {} : { cappedTools: view.cappedTools }),\n ...(view.toolAccessInvalid === undefined ? {} : { toolAccessInvalid: view.toolAccessInvalid }),\n roots: view.roots.map(narrowRootView),\n // Legacy hosts had no cap. Do not invent a client-side limit that\n // disables their Add controls; all stored states count equally.\n limit: view.limit ?? Number.MAX_SAFE_INTEGER,\n count: view.count ?? view.roots.length,\n ...(view.unavailable === undefined ? {} : { unavailable: view.unavailable }),\n },\n }\n}\n\n/**\n * Validate a `RevealedView` when it arrives.\n * @param value - the raw endpoint value.\n * @returns the view, or the reason it is not one.\n */\nexport function parseRevealedView(value: unknown): Parsed<RevealedView> {\n const parsed = revealedViewSchema.safeParse(value)\n if (!parsed.success) return { ok: false, message: `the answer is not a reveal result: ${firstIssue(parsed.error)}` }\n return { ok: true, value: parsed.data }\n}\n\n/**\n * Validate the `{ code, message }` envelope of a failed call.\n * @param value - the raw error value.\n * @returns the failure, or `undefined` when the value is not one.\n */\nexport function parseErrorView(value: unknown): PanelFailure | undefined {\n const parsed = errorViewSchema.safeParse(value)\n if (!parsed.success) return undefined\n return { code: parsed.data.code, message: parsed.data.message }\n}\n\n/**\n * Rebuild a parsed call as the declared type, keeping absent optional fields\n * ABSENT (`exactOptionalPropertyTypes` distinguishes \"absent\" from \"undefined\",\n * and the host's own code reads the two the same way the panel sent them).\n */\nfunction narrowCall(endpoint: PanelEndpoint, value: z.infer<typeof panelRequestSchema>): PanelCall {\n return {\n endpoint,\n sessionId: value.sessionId,\n ...(value.entry === undefined ? {} : { entry: value.entry }),\n ...(value.id === undefined ? {} : { id: value.id }),\n ...(value.path === undefined ? {} : { path: value.path }),\n ...(value.aliasId === undefined ? {} : { aliasId: value.aliasId }),\n ...(value.skillsEnabled === undefined ? {} : { skillsEnabled: value.skillsEnabled }),\n ...(value.alias === undefined ? {} : { alias: value.alias }),\n ...(value.access === undefined ? {} : { access: value.access }),\n ...(value.beforeEntry === undefined ? {} : { beforeEntry: value.beforeEntry }),\n ...(value.beforeId === undefined ? {} : { beforeId: value.beforeId }),\n }\n}\n\n/** Rebuild one parsed root as the declared `RootView`. */\nfunction narrowRootView(value: z.infer<typeof rootViewSchema>): RootView {\n return {\n ordinal: value.ordinal,\n id: value.id,\n path: value.path,\n addedAt: value.addedAt,\n state: value.state,\n // A host that predates the field only ever granted session-following\n // read-write — `inherit` under B9.\n access: value.access ?? 'inherit',\n ...(value.effectiveAccess === undefined ? {} : { effectiveAccess: value.effectiveAccess }),\n ...(value.aliasId === undefined ? {} : { aliasId: value.aliasId }),\n ...(value.skillsEnabled === undefined ? {} : { skillsEnabled: value.skillsEnabled }),\n ...(value.alias === undefined ? {} : { alias: value.alias }),\n ...(value.detail === undefined ? {} : { detail: value.detail }),\n }\n}\n\n/** Render the first zod issue as one short sentence. */\nfunction firstIssue(error: z.ZodError): string {\n const issue = error.issues[0]\n if (issue === undefined) return 'invalid'\n const path = issue.path.length === 0 ? '' : `${issue.path.join('.')}: `\n return `${path}${issue.message}`\n}\n","/**\n * The panel's bilingual copy.\n *\n * Flat `Record<string, string>` dictionaries keyed by a bare key (never\n * `ns.key`), `zh` as the canonical shape and `en` pinned to it by `satisfies`,\n * so a missing translation is a type error and a divergence is caught by\n * `tests/locale-parity.spec.ts` as well.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/locales\n */\n\n/** The locale namespace this plugin owns. */\nexport const NS = 'multiRootWorkspace'\n\n/** Chinese copy (the canonical shape). */\nexport const zh = {\n 'skills.globalEnable': '启用附属根 Skills',\n 'skills.globalHint': '控制所有附属目录的 Skill 发现与新调用;保留每个目录的独立选择。',\n 'skills.settingsFailed': '设置保存失败,请重试。',\n 'skills.userOnly': '仅用户调用',\n 'panel.skills': '目录技能',\n 'panel.skillsEnabled': '此目录技能已启用,点击停用',\n 'panel.skillsDisabled': '此目录技能已停用,点击启用',\n 'panel.aliasIdEdit': '编辑 Skill 命名空间',\n 'panel.aliasIdPlaceholder': '唯一的 kebab-case 标识',\n 'panel.aliasIdInvalid': '命名空间需要修复',\n 'error.invalid-alias-id': 'Skill 命名空间须为唯一的 kebab-case,最长 48 字符。',\n 'panel.accessEffective': '{access}({effective})',\n 'panel.toolCaps': '工具 {tools} 对附属根始终只读。',\n 'panel.invalidCap': '工具权限配置无效,附属根写入全部被拒绝。',\n 'effective.read-only': '只读',\n 'effective.read-write': '读写',\n 'effective.full-access': '完全权限(Full-access)',\n 'effective.unavailable': '不可用',\n 'action.label': '工作区目录',\n 'action.title': '管理本会话的附属工作目录',\n 'switcher.manage': '管理工作区目录…',\n 'panel.title': '工作区目录',\n 'panel.primary': '主要工作目录',\n 'panel.primaryNote': '会话原始项目,不可移除',\n 'panel.currentAgentCwd': '当前Agent工作目录',\n 'panel.additional': '附属工作目录',\n 'panel.limitReached': '已达到附加目录数量上限,请先移除一个再添加。',\n 'panel.empty': '还没有附属工作目录。',\n 'panel.emptyHint': '添加后,Agent 可在同一会话中读写该目录,受限 shell 和终端同步生效。',\n 'panel.noSession': '当前没有活动会话',\n 'panel.loading': '正在读取…',\n 'panel.retry': '重试',\n 'panel.close': '关闭',\n 'panel.add': '添加目录',\n 'panel.addManual': '输入绝对路径',\n 'panel.addConfirm': '添加',\n 'panel.remove': '移除',\n 'panel.removeConfirm': '确认移除',\n 'panel.more': '更多操作',\n 'panel.rename': '重命名',\n 'panel.aliasPlaceholder': '显示名(留空清除)',\n 'panel.aliasSave': '保存',\n 'panel.aliasCancel': '取消',\n 'panel.copyPath': '复制路径',\n 'panel.copied': '已复制',\n 'panel.reveal': '在文件管理器中显示',\n 'panel.reRegister': '重新登记(保留原访问级别)',\n 'panel.moveUp': '上移',\n 'panel.moveDown': '下移',\n 'access.inherit': '跟随会话',\n 'access.readWrite': '工作区内修改',\n 'access.readOnly': '仅可查看',\n 'panel.accessLabel': '访问权限',\n 'panel.accessInherit': '设为跟随会话',\n 'panel.accessReadOnly': '仅可查看',\n 'panel.accessReadWrite': '工作区内修改',\n 'panel.accessUpgradeConfirm': '将该目录的权限改为「{access}」?在某些沙箱模式下,这将允许 Agent 修改其中的文件。',\n 'panel.accessUpgradeTitle': '扩大访问权限',\n 'panel.accessUpgradeDo': '修改',\n 'state.available': '已授予',\n 'state.missing': '目录不存在,暂不授予',\n 'state.redirected': '登记目录已被替换(现在指向别处),暂不授予',\n 'state.invalid': '登记无效',\n 'error.not-absolute': '请给出绝对路径(或 ~/ 开头的路径)。',\n 'error.missing': '该目录不存在。',\n 'error.not-a-directory': '该路径不是目录。',\n 'error.equals-primary': '这就是本会话的工作目录,无需重复添加。',\n 'error.primary-overlap': '该目录与主工作目录互相包含,不会带来新的可写范围。',\n 'error.duplicate': '该目录已经登记过了。',\n 'error.nested': '该目录与已登记的根互相包含,不会带来新的可写范围。',\n 'error.invalid-alias': '别名不能包含控制字符,且不能过长。',\n 'error.not-found': '没有找到对应的登记项。',\n 'error.invalid-ref': '请求缺少必要的标识。',\n 'error.storage-unavailable': '根目录登记的存储不可用,请检查 $DSH_HOME/storages 下的文件。',\n 'error.registry-contended': '根目录登记正由另一个 DSH 进程占用;本进程不会授予附加根。关闭另一个进程后点重试。',\n 'error.root-limit-reached': '已达到附加目录数量上限,请先移除一个再添加。',\n 'error.config-invalid': '根目录登记的配置无效;本进程不会授予附加根,请修正配置后重启。',\n 'error.root-unavailable': '该目录当前不可用,只能设为只读;请先恢复目录再调整权限。',\n 'error.reveal-unavailable': '无法打开系统的文件管理器;登记项不受影响,路径仍可复制。',\n 'error.unavailable': '无法连接到 dsh 主进程。',\n 'error.copy-failed': '无法写入剪贴板,请检查浏览器的剪贴板权限。',\n 'error.session-not-found': '找不到该会话;请先打开一个工作区会话。',\n 'error.unsupported-path': '该路径是网络或设备路径,Windows ACL 隔离无法覆盖它。',\n 'error.fallback': '操作失败。',\n} satisfies Record<string, string>\n\n/** The canonical key set. */\nexport type Key = keyof typeof zh\n\n/** English copy, pinned to the Chinese key set. */\nexport const en = {\n 'skills.globalEnable': 'Enable additional-root Skills',\n 'skills.globalHint': 'Controls discovery and new invocations for all additional folders, preserving each folder’s choice.',\n 'skills.settingsFailed': 'Could not save settings. Please try again.',\n 'skills.userOnly': 'User invocation only',\n 'panel.skills': 'Folder skills',\n 'panel.skillsEnabled': 'Skills enabled for this folder. Click to disable.',\n 'panel.skillsDisabled': 'Skills disabled for this folder. Click to enable.',\n 'panel.aliasIdEdit': 'Edit Skill namespace',\n 'panel.aliasIdPlaceholder': 'Unique kebab-case identifier',\n 'panel.aliasIdInvalid': 'Namespace needs repair',\n 'error.invalid-alias-id': 'Skill namespace must be unique kebab-case, up to 48 characters.',\n 'panel.accessEffective': '{access} ({effective})',\n 'panel.toolCaps': 'The tools {tools} always have read-only access to additional roots.',\n 'panel.invalidCap': 'Invalid tool access configuration refuses all additional-root writes.',\n 'effective.read-only': 'Read-only',\n 'effective.read-write': 'Read-write',\n 'effective.full-access': 'Full-access',\n 'effective.unavailable': 'Unavailable',\n 'action.label': 'Folders',\n 'action.title': 'Manage this session\\'s secondary working directories',\n 'switcher.manage': 'Manage workspace folders…',\n 'panel.title': 'Workspace folders',\n 'panel.primary': 'Primary working directory',\n 'panel.primaryNote': 'The session\\'s original project; it cannot be removed',\n 'panel.currentAgentCwd': 'Current Agent working directory',\n 'panel.additional': 'Secondary working directories',\n 'panel.limitReached': 'The additional-folder limit is reached; remove one before adding another.',\n 'panel.empty': 'No secondary working directories yet.',\n 'panel.emptyHint': 'Once added, the agent can use the folder in this session, including confined shells and terminals.',\n 'panel.noSession': 'No active session',\n 'panel.loading': 'Loading…',\n 'panel.retry': 'Retry',\n 'panel.close': 'Close',\n 'panel.add': 'Add folder',\n 'panel.addManual': 'Enter an absolute path',\n 'panel.addConfirm': 'Add',\n 'panel.remove': 'Remove',\n 'panel.removeConfirm': 'Confirm removal',\n 'panel.more': 'More actions',\n 'panel.rename': 'Rename',\n 'panel.aliasPlaceholder': 'Display name (empty clears it)',\n 'panel.aliasSave': 'Save',\n 'panel.aliasCancel': 'Cancel',\n 'panel.copyPath': 'Copy path',\n 'panel.copied': 'Copied',\n 'panel.reveal': 'Reveal in file manager',\n 'panel.reRegister': 'Re-register (keeps its access level)',\n 'panel.moveUp': 'Move up',\n 'panel.moveDown': 'Move down',\n 'access.inherit': 'Inherit',\n 'access.readWrite': 'Workspace Write',\n 'access.readOnly': 'Read Only',\n 'panel.accessLabel': 'Access',\n 'panel.accessInherit': 'Make inherit',\n 'panel.accessReadOnly': 'Read Only',\n 'panel.accessReadWrite': 'Workspace Write',\n 'panel.accessUpgradeConfirm': 'Change this folder\\'s access to \"{access}\"? Under some sandbox modes this lets the agent modify files in it.',\n 'panel.accessUpgradeTitle': 'Widen access',\n 'panel.accessUpgradeDo': 'Change',\n 'state.available': 'Granted',\n 'state.missing': 'Directory is absent; not granted',\n 'state.redirected': 'Registration was replaced (it now points elsewhere); not granted',\n 'state.invalid': 'Registration is unusable',\n 'error.not-absolute': 'Give an absolute path (or one starting with ~/).',\n 'error.missing': 'That directory does not exist.',\n 'error.not-a-directory': 'That path is not a directory.',\n 'error.equals-primary': 'That is this session\\'s workspace root; it needs no registration.',\n 'error.primary-overlap': 'That directory and the primary working directory contain each other, so it grants nothing new.',\n 'error.duplicate': 'That directory is already registered.',\n 'error.nested': 'That directory and a registered root contain each other, so it grants nothing new.',\n 'error.invalid-alias': 'An alias may not contain control characters or be overly long.',\n 'error.not-found': 'No registration matches that reference.',\n 'error.invalid-ref': 'The request is missing a required identity.',\n 'error.storage-unavailable': 'The root registry store is unavailable; check the files under $DSH_HOME/storages.',\n 'error.registry-contended': 'The root registry is owned by another DSH process; this process grants no additional roots. Close the other process, then retry.',\n 'error.root-limit-reached': 'The additional-root limit is reached; remove one before adding another.',\n 'error.config-invalid': 'The root registry configuration is invalid; this process grants no additional roots. Fix the configuration and restart.',\n 'error.root-unavailable': 'That folder is not available right now and cannot be made writable; restore the directory first.',\n 'error.reveal-unavailable': 'Could not open the system file manager; the registration is untouched, and the path can still be copied.',\n 'error.unavailable': 'Could not reach the dsh host process.',\n 'error.copy-failed': 'Could not write to the clipboard; check the browser\\'s clipboard permission.',\n 'error.session-not-found': 'That session is not active; open a workspace session first.',\n 'error.unsupported-path': 'That is a network or device path, which Windows ACL confinement cannot cover.',\n 'error.fallback': 'The operation failed.',\n} satisfies Record<Key, string>\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** This plugin's panel copy. */\n multiRootWorkspace: Key\n }\n}\n","/**\n * The panel's own client for the Connection RPC channel.\n *\n * The browser half cannot use a Typert Remote namespace: contract generation\n * is workspace-shaped and the client assembly's contribution list belongs to\n * the shipped composition, so an out-of-tree plugin has no supported way to\n * mount one (see docs/decisions/ADR-0005 and the M3 plan). What IS public and\n * present in both supported runtimes is the generic Connection channel the\n * shipped sibling plugin already uses: the host registers\n * `connection.rpc.handle(PANEL_CHANNEL, …)` and this module calls it.\n *\n * The call is typed by {@link PanelResponseMap}: the endpoint decides the\n * request shape AND the response type, so a caller cannot decode one endpoint's\n * answer as another's. The response is additionally parsed at the boundary,\n * because the type is a promise about the host while the value on the wire is\n * whatever the host actually sent.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/panel-client\n */\n\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client'\nimport {\n PANEL_CHANNEL,\n parseErrorView,\n parseRevealedView,\n parseRootsView,\n type PanelEndpoint,\n type PanelRequest,\n type PanelResponseMap,\n} from '../contract.ts'\nimport { zh, type Key } from './locales.ts'\n\n/**\n * The Connection result shape this plugin consumes. Declared structurally\n * rather than imported: the host face of the same package would drag the\n * HOST context augmentations into the browser program, and a channel handler\n * is an ordinary `{ ok, value } | { ok, error }` envelope on the wire.\n */\ntype ChannelResult =\n | { readonly ok: true; readonly value: unknown }\n | { readonly ok: false; readonly error: unknown }\n\n/** A failure the panel renders from its `code`. */\nexport class PanelError extends Error {\n /**\n * @param code - stable code from the root vocabulary, or a transport code.\n * @param message - the host's fallback text.\n */\n constructor(readonly code: string, message: string) {\n super(message)\n this.name = 'PanelError'\n }\n}\n\n/**\n * The copy key for one failure code, with a safe fallback for codes this build\n * does not know (a newer host, or a transport failure).\n * @param code - the failure code.\n * @returns the locale key to render.\n */\nexport function errorKeyOf(code: string): Key {\n const candidate = `error.${code}`\n return (candidate in zh ? candidate : 'error.fallback') as Key\n}\n\n/** The panel's callable face, injected into its component. */\nexport interface PanelClient {\n /**\n * Call one endpoint.\n * @param endpoint - the endpoint name; it also selects the response type.\n * @param payload - the request fields for that endpoint (the endpoint name\n * travels as the RPC method, so it is not repeated in the payload).\n * @param signal - optional cancellation; aborting rejects the call.\n * @returns the host's value, in the shape the endpoint promises.\n * @throws {PanelError} when the host answered with a failure, or with a value\n * that is not what this endpoint promises.\n */\n call<E extends PanelEndpoint>(endpoint: E, payload: PanelRequest, signal?: AbortSignal): Promise<PanelResponseMap[E]>\n}\n\n/**\n * Build the panel client over a Connection handle.\n * @param connection - the client Connection service.\n * @returns the client, with every transport failure normalized to a `PanelError`.\n */\nexport function createPanelClient(connection: ConnectionHandle): PanelClient {\n return {\n async call(endpoint, payload, signal) {\n let result: ChannelResult\n try {\n result = await connection.rpc.call(PANEL_CHANNEL, endpoint, payload, signal) as ChannelResult\n } catch (error: unknown) {\n throw new PanelError('unavailable', error instanceof Error ? error.message : String(error))\n }\n if (!result.ok) {\n // The host reports failures as `{ code, message }`; a transport that\n // failed differently still has to reach the panel as a renderable code.\n const failure = parseErrorView(result.error)\n throw failure === undefined\n ? new PanelError('unavailable', 'the host answered with an unreadable failure')\n : new PanelError(failure.code, failure.message)\n }\n return expectShape(endpoint, result.value)\n },\n }\n}\n\n/**\n * Read the value one endpoint promised, narrowing it at the boundary so a host\n * that answered a different endpoint — or a shape from another version — cannot\n * crash the render.\n * @param endpoint - the endpoint that was called.\n * @param value - the raw endpoint value.\n * @returns the value as the endpoint's declared type.\n * @throws {PanelError} `panel/bad-response` when the value is not that shape.\n */\nfunction expectShape<E extends PanelEndpoint>(endpoint: E, value: unknown): PanelResponseMap[E] {\n const parsed = endpoint === 'reveal' ? parseRevealedView(value) : parseRootsView(value)\n if (!parsed.ok) throw new PanelError('panel/bad-response', parsed.message)\n return parsed.value as PanelResponseMap[E]\n}\n","/**\n * The plugin's one stylesheet, injected into the document by the client entry.\n *\n * The host ships its design tokens as CSS custom properties on `body`\n * (`--dsw-alias-*` semantics, `--dsw-elevation-*` shadows, `--ds-*` motion and\n * code-font tokens), so this sheet names no color of its own: light and dark\n * theme follow the host automatically. The recipes mirror the native surfaces\n * this UI sits beside — the sidebar footer trigger, the Modal primitive, and\n * the capsule Button (ADR-0006 records the decision).\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/styles\n */\n\n/** The stylesheet text; every class is prefixed `mrfw-` to stay collision-free. */\nexport const STYLES = /* css */ `\n/* Sidebar footer row, mirroring the host ui-settings-general trigger: the row\n * wrapper overhangs each side by 2px (width calc(100% + 4px) against the\n * shell's 12px inline padding) so the icon's ink line lands at 18px from the\n * column edge — exactly where the Settings gear below sits. */\n.mrfw-triggerRow {\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n width: calc(100% + 4px);\n margin: 4px -2px;\n}\n\n.mrfw-triggerRow.mrfw-railRow {\n width: 36px;\n margin: 8px 0 10px;\n}\n\n.mrfw-trigger {\n box-sizing: border-box;\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n width: auto;\n height: 42px;\n margin: 0;\n padding: 0 10px 0 8px;\n border: none;\n border-radius: 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n font-size: 14px;\n line-height: 22px;\n text-align: left;\n cursor: pointer;\n overflow: hidden;\n transition: background-color var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-trigger:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mrfw-triggerIcon {\n flex: none;\n display: inline-flex;\n}\n\n.mrfw-triggerLabel {\n overflow: hidden;\n white-space: nowrap;\n}\n\n.mrfw-triggerRail {\n flex: none;\n width: 36px;\n height: 36px;\n margin: 0;\n padding: 0;\n gap: 0;\n border-radius: 50%;\n justify-content: center;\n}\n\n/* Icon-only launcher inside the upstream Files tab header. Upstream's\n FilesBody renders .header as one flat flex row — PathLabel, then the\n reload button, then the files.actions slot occupants — and each of those\n children carries a stable data-files-* attribute on the flex item itself\n (data-files-root on the pane, data-files-path, data-files-reload).\n A registration order sorts only INSIDE the actions slot and can never\n overtake the reload button, so the launcher is moved with the flex order\n property instead: this wrapper is the slot's root element and therefore a\n direct flex item of .header, and order: -1 puts it ahead of every\n order-0 sibling while the :has() rule below keeps the path first. */\n.mrfw-fileLauncher {\n order: -1;\n flex: none;\n display: flex;\n align-items: center;\n}\n\n/* Pin the upstream path label ahead of the launcher — but only while this\n plugin is in the row: the :has() guard keeps a rule that names an\n upstream element inert whenever the launcher is absent. The\n :not([data-files-entry]) qualifier is load-bearing, not decorative:\n upstream puts data-files-path on EVERY tree row too (the row's own\n absolute path), so an unqualified selector would match the whole tree,\n not just the header's PathLabel. Both selectors depend on upstream's DOM\n shape, which is not part of the slot contract; if it changes, the rules\n simply stop matching and the launcher falls back to its in-slot position —\n a silent degradation, never a broken header. */\n[data-files-root]:has(.mrfw-fileLauncher) [data-files-path]:not([data-files-entry]) {\n order: -2;\n}\n\n/* The root switcher is the launcher's grown-up form on runtimes whose\n files.actions owner carries absolutePath. It takes the path label's flex\n position and stretch: order: -1 ahead of every order-0 sibling, and a\n growing min-width:0 item so both the trigger label and the PathLabel\n inside it can ellipsize instead of pushing the header controls out. */\n.mrfw-rootSwitcher {\n order: -1;\n flex: 1 1 auto;\n min-width: 0;\n display: flex;\n align-items: center;\n /* Same 4px the upstream .header puts between its own flex items, so the\n takeover controls (reload, open-in-app fork) sit at the same offsets the\n hidden native ones did — no drift between primary and additional state. */\n gap: 4px;\n}\n\n/* While the switcher exists it hides the upstream path label — the\n :has() guard again keeps the upstream-naming rule inert unless this\n plugin is actually in the row. The switcher draws its own PathLabel of\n the selected root next to the trigger (className mrfw-switcherPath, no\n data-files-* attributes), so the header keeps a path in the same spot.\n :not([data-files-entry]) is what confines this rule to the header:\n every tree row carries data-files-path with its own path as the value,\n and only the PathLabel carries it bare. Without the qualifier this\n display:none would blank the entire native tree. */\n[data-files-root]:has(.mrfw-rootSwitcher) [data-files-path]:not([data-files-entry]) {\n display: none;\n}\n\n/* While the switcher names an additional root, the native tree body and its\n reload hide: the reload refreshes the very tree that is no longer\n visible, and the plugin's forked tree is portaled in as the body's sibling.\n The header still offers a reload — the switcher's own .mrfw-switcherReload\n calls the forked face's refresh. The native tree keeps watching in the\n background, so switching back to the primary root restores it instantly. */\n[data-files-root]:has(.mrfw-rootSwitcher[data-root-kind=\"additional\"]) [data-files-body],\n[data-files-root]:has(.mrfw-rootSwitcher[data-root-kind=\"additional\"]) [data-files-reload] {\n display: none;\n}\n\n/* While the switcher names an additional root, the native open-in-app split\n button hides too: its slot props carry the pane's primary root, so it\n would always open the primary root no matter what the switcher selected.\n The header gets the plugin's own fork of that same control instead (the\n open-in-app directory), wired to the selected root.\n\n The slot's render site is wrapped in the renderer's own anchor —\n <div data-slot=\"sidebar.right.tab.files.actions\" style=\"display:contents\">\n — so the header's flex items inside it are the occupants themselves, and\n the native item is the ui-primitives Menu anchor span wrapping the marked\n .split. The first selector hides that occupant item through the data-slot\n anchor: hiding only the inner control would leave the empty anchor span\n as a zero-width flex item whose header gap pushes the fork 4px left of\n the native position. The wrapper itself can never be the target — its\n inline display:contents beats any stylesheet rule, and hiding it would\n take the switcher with it. The second selector is the fallback for an\n upstream that moves the attribute off the item. The fork survives both:\n the only data-open-target inside .mrfw-rootSwitcher is its own\n .mrfw-openSplit, which :not() excludes. */\n[data-files-root]:has(.mrfw-rootSwitcher[data-root-kind=\"additional\"]) [data-slot=\"sidebar.right.tab.files.actions\"] > *:has([data-open-target=\"directory\"]:not(.mrfw-openSplit)),\n[data-files-root]:has(.mrfw-rootSwitcher[data-root-kind=\"additional\"]) [data-open-target=\"directory\"]:not(.mrfw-openSplit) {\n display: none;\n}\n\n/* The trigger borrows the path label's look: quiet text with a folder\n glyph, the hover of the neighboring header buttons, and the overflow\n behavior PathLabel itself uses in a narrow header. It may shrink but\n never grows — the PathLabel after it owns the free header space. */\n.mrfw-rootSwitchBtn {\n flex: 0 1 auto;\n min-width: 0;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n margin: 0;\n padding: 0 4px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n font-size: inherit;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n transition: background-color var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-rootSwitchBtn:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mrfw-rootSwitchBtn .mrfw-triggerIcon {\n color: var(--dsw-alias-label-secondary);\n}\n\n.mrfw-rootSwitchLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mrfw-rootSwitchChevron {\n margin-left: auto;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* The selected root's full path sits between the trigger and the reload —\n the very PathLabel upstream draws there, so it brings its own grow,\n left-clip and hover-title behavior; only the gutters are ours. The right\n margin plus the container gap reproduces upstream's .path margin-right\n 12px + header gap 4px; the left gutter comes from the same container gap. */\n.mrfw-switcherPath {\n margin: 0 12px 0 0;\n}\n\n/* The takeover's own reload, standing exactly where the hidden native one\n did: the upstream .tool recipe verbatim (28px hit area, 15px glyph,\n secondary voice, hover fills). It calls the forked face's refresh — an\n in-place re-list, not a remount. */\n.mrfw-switcherReload {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 6px;\n border: none;\n border-radius: var(--dsw-radius-sm);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n line-height: 1;\n cursor: pointer;\n}\n\n.mrfw-switcherReload:hover {\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n/* ── files-tree fork (verbatim rules, renamed classes) ─────────────────────\n Copied from upstream's FilesBody.module.css (ui-sidebar-files @\n 0.2.2-alpha.2) with local names mapped to mrfw-ft* so the rules cannot\n collide with host DOM — and so the fork's own body (which must NOT carry\n data-files-body) stays visible while the rules above hide the native one.\n The header-only rules (root/header/path/tool/status/statusLine/titleIcon)\n belong to the upstream shell this fork drops and are not mapped. Fork sync\n re-diffs the upstream file and re-applies the rename — see\n src/client/files-tree/FORK.md. */\n\n/* The pane's own .root already supplies the flex column, color, and font;\n the fork's body takes the same stretch item the hidden native body held,\n including the workspace list's 2px scrollbar offset and stable gutter. */\n.mrfw-ftBody {\n flex: 1 1 auto;\n min-height: 0;\n margin-right: 2px;\n padding: 8px 0 8px 8px;\n overflow: auto;\n scrollbar-gutter: stable;\n}\n\n.mrfw-ftBody::-webkit-scrollbar-track {\n margin: 2px;\n}\n\n.mrfw-ftLevel {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.mrfw-ftLevel .mrfw-ftLevel {\n padding-left: 18px;\n}\n\n.mrfw-ftItem {\n margin: 0;\n padding: 0;\n}\n\n/* Rows abut, so the hover fill is the whole row; the tree's air is this\n inset, not a gap between rows. */\n.mrfw-ftRow {\n display: flex;\n gap: 6px;\n align-items: center;\n width: 100%;\n min-width: 0;\n padding: 5px 10px;\n color: inherit;\n font: inherit;\n text-align: left;\n background: transparent;\n border: 0;\n border-radius: var(--dsw-radius-md);\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .mrfw-ftRow:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n/* The folder glyph rides the tertiary ink, as the workspace tree's does. */\n.mrfw-ftIcon {\n flex: 0 0 auto;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* The type's coloured sheet at the folder glyph's 16px; its colour is its own. */\n.mrfw-ftFileIcon {\n flex: 0 0 auto;\n}\n\n.mrfw-ftName {\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n/* Neither a file nor a directory: shown so the directory is reported whole,\n greyed so nobody tries to open it. */\n.mrfw-ftOther {\n color: var(--dsw-alias-label-tertiary);\n cursor: default;\n}\n\n@media (hover: hover) {\n .mrfw-ftOther:hover {\n background: transparent;\n }\n}\n\n.mrfw-ftNote {\n margin: 0;\n padding: 3px 10px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n}\n\n/* ── open-in-app fork (verbatim rules, renamed classes) ───────────────────\n Copied from upstream's OpenTargetButton.module.css\n (dsh-client-ui-open-in-app @ 0.2.1-alpha.2) with local names mapped to\n mrfw-open* so the rules cannot collide with host DOM. Fork sync re-diffs\n the upstream file and re-applies the rename — see\n src/client/open-in-app/FORK.md. */\n\n/* Sized to sit in the document header's 24px control row beside its round\n icon buttons: a hairline pill with a 12px label and a narrow chevron half. */\n.mrfw-openMenuAnchor {\n display: inline-flex;\n flex: none;\n align-self: center;\n}\n\n.mrfw-openSplit {\n display: inline-flex;\n align-items: stretch;\n box-sizing: border-box;\n height: 24px;\n overflow: hidden;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-sm);\n font-family: var(--dsw-font-family);\n}\n\n.mrfw-openMain,\n.mrfw-openChevron {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: 0;\n background: none;\n color: var(--dsw-alias-label-primary);\n font-size: 11px;\n line-height: 16px;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.mrfw-openMain {\n gap: 4px;\n padding: 3px 5px;\n}\n\n.mrfw-openChevron {\n padding: 3px 4px 3px 3px;\n border-left: 0.5px solid var(--dsw-alias-border-l4);\n color: var(--dsw-alias-label-secondary);\n}\n\n.mrfw-openMain:hover:not(:disabled),\n.mrfw-openMain:focus-visible,\n.mrfw-openChevron:hover:not(:disabled),\n.mrfw-openChevron:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n/* Pending disables clicks without a restyle; only hover feedback pauses. */\n.mrfw-openMain:disabled,\n.mrfw-openChevron:disabled {\n cursor: default;\n}\n\n.mrfw-openAppIcon {\n object-fit: contain;\n}\n\n/* The unavailable preview emphasizes the same actions with a labeled button. */\n.mrfw-openSplit[data-size='large'] {\n height: 36px;\n border-radius: var(--dsw-radius-md);\n border-color: var(--dsw-alias-border-l2);\n}\n\n.mrfw-openSplit[data-size='large'] .mrfw-openMain {\n gap: 6px;\n padding: 6px 14px;\n font-size: 14px;\n}\n\n.mrfw-openSplit[data-size='large'] .mrfw-openChevron {\n padding: 6px 10px;\n}\n\n.mrfw-openSkeleton { display: inline-block; flex: none; border-radius: var(--dsw-radius-xs); background: var(--dsw-alias-interactive-bg-hover); }\n\n.mrfw-overlay {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n}\n\n.mrfw-mask {\n position: absolute;\n inset: 0;\n background: var(--dsw-alias-bg-mask-1);\n backdrop-filter: var(--dsw-mask-blur);\n}\n\n.mrfw-dialog {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n width: min(640px, 100%);\n max-height: 100%;\n overflow: hidden;\n border: none;\n border-radius: 24px;\n background: var(--dsw-alias-bg-layer-2);\n box-shadow: var(--dsw-elevation-prominent);\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n outline: none;\n}\n\n.mrfw-header {\n flex: none;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 22px 14px 12px 24px;\n}\n\n.mrfw-title {\n margin: 0;\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n\n.mrfw-close {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n border-radius: 8px;\n background: transparent;\n cursor: pointer;\n color: var(--dsw-alias-label-secondary);\n transition: background-color var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-close:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mrfw-body {\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow-y: auto;\n padding: 0 24px 24px;\n}\n\n.mrfw-alert {\n margin: 0 0 8px;\n font-size: 14px;\n line-height: 22px;\n color: var(--dsw-alias-state-error-primary);\n}\n\n.mrfw-section {\n display: flex;\n flex-direction: column;\n}\n\n.mrfw-section + .mrfw-section {\n margin-top: 8px;\n}\n\n.mrfw-sectionTitleRow {\n display: flex;\n align-items: baseline;\n gap: 8px;\n padding: 8px 0 4px;\n}\n\n.mrfw-sectionTitle {\n font-size: 14px;\n line-height: 22px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n\n.mrfw-sectionNote {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.mrfw-row {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n padding: 12px 0;\n border-bottom: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n.mrfw-rowBare {\n border-bottom: none;\n}\n\n/* A root entry's two lines: the display name on top, the absolute path under\n it in the tertiary voice (the workspace rows recipe of the host sidebar). */\n/* Match upstream General Settings' DeveloperToolsRow layout. */\n.mrfw-skillsSettings {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 24px;\n padding: 16px 0;\n border-bottom: 0.5px solid var(--dsw-alias-border-l2);\n}\n.mrfw-skillsSettingsText { min-width: 0; }\n.mrfw-skillsSettingsTitle { font-size: 14px; line-height: 20px; }\n.mrfw-skillsSettingsDescription {\n margin-top: 4px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n.mrfw-rootText {\n display: flex;\n flex: 1 1 240px;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n/* Keep status tags and permission glyphs visible beside the alias, wrapping\n onto another line when the dialog is narrow. */\n.mrfw-rootName {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 6px;\n min-width: 0;\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n\n.mrfw-rootNameText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mrfw-rootPath {\n font-family: var(--ds-font-family-code);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* The path doubles as the copy control: an unstyled button that keeps the\n text recipe and makes the whole string clickable — the whole region, not\n just the icon, copies on click. */\n.mrfw-pathCopy {\n display: block;\n width: 100%;\n padding: 0;\n border: 0;\n background: transparent;\n text-align: left;\n cursor: pointer;\n}\n\n/* The trailing icon stays in flow but invisible until the path is hovered\n or focused: appearing never re-wraps the text, and the icon inherits the\n path's own tertiary ink. */\n.mrfw-pathCopyIcon {\n display: inline-flex;\n margin-left: 4px;\n vertical-align: -2px;\n opacity: 0;\n transition: opacity var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-pathCopy:hover .mrfw-pathCopyIcon,\n.mrfw-pathCopy:focus-visible .mrfw-pathCopyIcon {\n opacity: 1;\n}\n\n.mrfw-note {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.mrfw-stateWarn {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.mrfw-btn {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n gap: 4px;\n height: 28px;\n padding: 0 10px;\n border: none;\n border-radius: 14px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n font-size: 12px;\n line-height: 18px;\n cursor: pointer;\n transition: background-color var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-btn[aria-busy='true'] {\n cursor: wait;\n}\n\n.mrfw-btn:disabled {\n cursor: not-allowed;\n opacity: 0.4;\n}\n\n.mrfw-btnGhost:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mrfw-btnGhost:active:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-active);\n}\n\n/* The solid destructive action of the capsule family: the upgrade confirm's\n red button. state-error-primary is the error ink upstream also uses as a\n fill (StateDot); the hover mixes in the host's primary label token to\n follow its theme and contrast choices. Neither color is a guessed token:\n an undefined var() would fall back\n to transparent and white-out the whole button. */\n.mrfw-btnDanger {\n background: var(--dsw-alias-state-error-primary);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.mrfw-btnDanger:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 85%, var(--dsw-alias-label-primary));\n}\n\n.mrfw-btnOutline {\n border: 0.5px solid var(--dsw-alias-border-l3);\n background: transparent;\n}\n\n.mrfw-btnOutline:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mrfw-btnPrimary {\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.mrfw-btnPrimary:hover:not(:disabled) {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n/* One icon-only action: a square of the capsule family, meaning in title.\n Declared after the .mrfw-btn family so its padding wins the cascade tie:\n the capsule's 0 10px padding would otherwise squeeze the icon glyph. */\n.mrfw-iconBtn {\n width: 28px;\n padding: 0;\n border-radius: 8px;\n}\n\n.mrfw-input {\n flex: 1 1 220px;\n min-width: 0;\n height: 32px;\n padding: 0 8px;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n font-size: 14px;\n line-height: 22px;\n outline: none;\n transition: border-color var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-input:focus {\n border-color: var(--dsw-alias-brand-primary);\n}\n\n.mrfw-input::placeholder {\n color: var(--dsw-alias-label-dimmed);\n}\n\n.mrfw-inputInline {\n flex: 1 1 auto;\n}\n\n.mrfw-accessSelect {\n flex: 0 0 auto;\n}\n\n/* The access dropdown's capsule trigger: the Menu anchor wrapper is the flex\n item, the button inside keeps the control row's 32px capsule recipe. */\n.mrfw-accessTrigger {\n padding: 0 12px;\n}\n\n.mrfw-cwdTag {\n flex: none;\n padding: 0 6px;\n border-radius: 4px;\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-secondary);\n font-size: 11px;\n line-height: 18px;\n}\n\n.mrfw-accessBadge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.mrfw-accessBadge {\n flex: none;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.mrfw-aliasEditor {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n flex-basis: 100%;\n}\n\n.mrfw-actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n margin-top: 16px;\n padding-top: 16px;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n/* One control row, one height: the capsule buttons match the 32px input. */\n.mrfw-actions .mrfw-btn {\n height: 32px;\n border-radius: 16px;\n}\n\n.mrfw-actions .mrfw-iconBtn {\n width: 32px;\n}\n`\n","/** Structural client seams: older hosts have namespace forms and no UserTextRule registry. */\nimport type { Context } from '@deepseek-ai/cordis'\nexport interface SkillsForm {\n getSnapshot(): { value?: { enabled?: boolean } | undefined; status: string; writable: boolean; revision?: number | undefined }\n subscribe(listener: () => void): () => void\n mutate(ops: readonly { op: 'set'; path: string[]; value: boolean }[], revision?: number): Promise<boolean>\n}\ninterface SettingsScope { bind(input: { namespace: string }): SkillsForm }\ninterface ConfigForms { get(entryId: string): SkillsForm }\n\nexport function bindSkillsForm(ctx: Context): SkillsForm | undefined {\n const modern = ctx.get('configForms' as never) as ConfigForms | undefined\n if (modern !== undefined) return modern.get('multi-root-skills')\n const legacy = ctx.get('settingsScope' as never) as SettingsScope | undefined\n return legacy?.bind({ namespace: 'multi-root-skills' })\n}\nexport function clientInject(ctx: Context, services: string[], callback: (scope: Context) => void | (() => void)): void {\n // Recording client fixtures may omit dynamic injection; real Cordis always supplies it.\n if (typeof ctx.inject === 'function') ctx.inject(services, callback)\n}\nexport interface NamespaceRule {\n id: string; order: number\n match(text: string, from: number): { id: string; start: number; end: number; data: { name: string } } | undefined\n}\nexport function registerNamespaceRule(ctx: Context, rule: NamespaceRule): (() => void) | undefined {\n const conversation = ctx.get('uiConversation' as never) as { userText?: { register(rule: NamespaceRule): () => void } } | undefined\n return typeof conversation?.userText?.register === 'function' ? conversation.userText.register(rule) : undefined\n}\n","/** Session-addressed Connection cache. Every refresh and change notification fences old replies. */\nimport { PANEL_CHANNEL } from '../contract.ts'\nimport { skillsCatalogSchema, skillsPreviewSchema, skillsStatusSchema, type SkillsCatalogView, type SkillsPreviewView } from '../skills-contract.ts'\ninterface Connection { rpc: { call(channel: string, endpoint: string, payload: unknown, signal?: AbortSignal): Promise<unknown> } }\ninterface State { pending?: Promise<SkillsCatalogView>; epoch: number; value?: SkillsCatalogView; request?: AbortController; watching?: AbortController; listeners: Set<() => void> }\nexport class SkillsClient {\n private readonly states = new Map<string, State>()\n private closed = false\n constructor(private readonly connection: Connection) {}\n private state(id: string): State {\n let state = this.states.get(id)\n if (state === undefined) { state = { epoch: 0, listeners: new Set() }; this.states.set(id, state) }\n return state\n }\n private async call(endpoint: string, payload: unknown, signal?: AbortSignal): Promise<unknown> {\n signal?.throwIfAborted()\n const result = await this.connection.rpc.call(PANEL_CHANNEL, endpoint, payload, signal) as { ok: boolean; value?: unknown; error?: { message?: string } }\n signal?.throwIfAborted()\n if (!result.ok) throw new Error(result.error?.message ?? 'Skills request failed')\n return result.value\n }\n async list(sessionId: string, signal?: AbortSignal): Promise<SkillsCatalogView> {\n if (this.closed) throw new Error('Skills client is closed')\n const state = this.state(sessionId)\n if (state.pending === undefined) {\n const epoch = ++state.epoch\n state.request?.abort(); const request = new AbortController(); state.request = request\n const pending = (async () => {\n const value = skillsCatalogSchema.parse(await this.call('skillsList', { sessionId }, request.signal))\n if (this.closed || value.sessionId !== sessionId || epoch !== state.epoch) throw new Error('Stale Skills response')\n const changed = JSON.stringify(state.value) !== JSON.stringify(value)\n state.value = value\n if (changed) for (const listener of state.listeners) listener()\n return value\n })()\n state.pending = pending\n void pending.then(() => { if (state.pending === pending) delete state.pending }, () => { if (state.pending === pending) delete state.pending })\n }\n return await withAbort(state.pending, signal)\n }\n\n snapshot(sessionId: string): SkillsCatalogView | undefined { return this.states.get(sessionId)?.value }\n async preview(sessionId: string, name: string, signal?: AbortSignal): Promise<SkillsPreviewView> {\n const state = this.state(sessionId), epoch = state.epoch\n const value = skillsPreviewSchema.parse(await this.call('skillsPreview', { sessionId, name }, signal))\n if (this.closed || epoch !== state.epoch || value.sessionId !== sessionId || value.name !== name) throw new Error('Stale Skills preview')\n return value\n }\n subscribe(sessionId: string, listener: () => void): () => void {\n const state = this.state(sessionId); state.listeners.add(listener)\n if (state.watching === undefined) {\n const lifetime = new AbortController(); state.watching = lifetime\n void this.watch(sessionId, state, lifetime.signal)\n }\n return () => {\n state.listeners.delete(listener)\n if (state.listeners.size === 0) { state.watching?.abort(); delete state.watching; state.request?.abort(); this.states.delete(sessionId) }\n }\n }\n private invalidate(state: State): void {\n state.epoch++; state.request?.abort(); delete state.pending; delete state.value\n for (const listener of state.listeners) listener()\n }\n reset(): void { for (const state of this.states.values()) this.invalidate(state) }\n dispose(): void {\n this.closed = true\n for (const state of this.states.values()) { this.invalidate(state); state.watching?.abort() }\n this.states.clear()\n }\n private async watch(id: string, state: State, signal: AbortSignal): Promise<void> {\n while (!signal.aborted && !this.closed) {\n try {\n const current = state.value ?? await this.list(id, signal)\n const next = skillsStatusSchema.parse(await this.call('skillsChanges', { sessionId: id, generation: current.generation }, signal))\n if (next.sessionId !== id) throw new Error('Wrong Skills Session')\n if (next.generation !== current.generation) this.invalidate(state)\n } catch {\n if (signal.aborted || this.closed) return\n this.invalidate(state)\n await new Promise<void>(resolve => {\n const finish = () => { clearTimeout(timer); signal.removeEventListener('abort', finish); resolve() }\n const timer = setTimeout(finish, 1000); signal.addEventListener('abort', finish, { once: true })\n })\n }\n }\n }\n}\n\nasync function withAbort<T>(promise: Promise<T>, signal?: AbortSignal): Promise<T> {\n signal?.throwIfAborted()\n if (signal === undefined) return await promise\n return await new Promise<T>((resolve, reject) => {\n const abort = () => reject(signal.reason)\n signal.addEventListener('abort', abort, { once: true })\n promise.then(value => { signal.removeEventListener('abort', abort); if (!signal.aborted) resolve(value) }, error => { signal.removeEventListener('abort', abort); reject(error) })\n })\n}\n","/** Namespaced Slash completion and plain-text sent-message references. */\nimport type { Context } from '@deepseek-ai/cordis'\nimport { clientInject, registerNamespaceRule, type NamespaceRule } from '../compat/skills-client.ts'\nimport { SkillsClient } from './skills-client.ts'\nimport type { Translate } from './WorkspaceFoldersAction.tsx'\n\ninterface Source {\n trigger: '/'; name: string; order: number\n candidates(session: { sessionId: string }, request: { query: string; signal: AbortSignal }): Promise<readonly { name: string; description: string }[]>\n onPick(pick: { candidate: { name: string } }): { text: string }\n lexicon(session: { sessionId: string }): readonly string[] | undefined\n subscribeLexicon(session: { sessionId: string }, listener: () => void): () => void\n}\nexport const namespaceSkillRule: NamespaceRule = {\n id: 'multi-root-skill', order: 19,\n match(text, from) {\n const regex = /(?<!\\S)\\/([a-z0-9]+(?:-[a-z0-9]+)*:[a-z0-9]+(?:-[a-z0-9]+)*)(?!\\S)/g\n regex.lastIndex = from\n const match = regex.exec(text)\n return match === null ? undefined : { id: 'multi-root-skill', start: match.index, end: match.index + match[0].length, data: { name: match[1]! } }\n },\n}\nexport function namespaceSource(client: SkillsClient, t: Translate): Source {\n return {\n trigger: '/', name: 'multi-root-skills', order: 3,\n async candidates({ sessionId }, { query, signal }) {\n try {\n const view = client.snapshot(sessionId) ?? await client.list(sessionId, signal)\n signal.throwIfAborted()\n return view.skills.filter(skill => skill.name.toLowerCase().includes(query.toLowerCase())).map(skill => ({ name: skill.name, description: skill.modelInvocable ? skill.description : `${t('skills.userOnly')} · ${skill.description}` }))\n } catch (error) { if (signal.aborted) return []; throw error }\n },\n onPick({ candidate }) { return { text: `/${candidate.name} ` } },\n lexicon({ sessionId }) { return client.snapshot(sessionId)?.skills.map(skill => skill.name) },\n subscribeLexicon({ sessionId }, listener) { return client.subscribe(sessionId, listener) },\n }\n}\n\nexport function installSkillsClient(ctx: Context, t: Translate, subscribeSession: (listener: () => void) => () => void): void {\n const connection = ctx.get('connection')\n if (connection === undefined) return\n const client = new SkillsClient(connection)\n ctx.effect(() => () => client.dispose())\n ctx.effect(() => subscribeSession(() => { client.reset() }))\n const source = namespaceSource(client, t)\n clientInject(ctx, ['inputTriggers'], scope => {\n const triggers = scope.get('inputTriggers' as never) as unknown as { registerSource(source: Source): () => void }\n return triggers.registerSource(source)\n })\n clientInject(ctx, ['uiConversation'], scope => {\n const stop = registerNamespaceRule(scope, namespaceSkillRule)\n if (stop === undefined) return\n const slots = scope.slots as unknown as { inject(name: string, callback: () => unknown): () => void; register(options: object, component: unknown): () => void }\n const stopRenderer = slots.inject('conversation.user.text.node', () => slots.register({\n name: 'conversation.user.text.node', key: namespaceSkillRule.id, priority: 100,\n }, ({ node }: { node: { data: { name: string } } }) => `/${node.data.name}`))\n return () => { stopRenderer(); stop() }\n })\n if (typeof ctx.on === 'function') (ctx.on as (...args: any[]) => unknown)('connection/reset', () => { client.reset() })\n}\n","import { useEffect, useRef, useState, useSyncExternalStore } from 'react'\nimport { Switch } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { Context } from '@deepseek-ai/cordis'\nimport { bindSkillsForm, clientInject, type SkillsForm } from '../compat/skills-client.ts'\nimport type { Translate } from './WorkspaceFoldersAction.tsx'\nconst BUNDLE_KEY = '@dsh-electron/dsh-plugin-multi-root-workspace'\ninterface CardProps { form: SkillsForm; t: Translate }\nexport function SkillsSettingsCard({ form, t }: CardProps) {\n const snapshot = useSyncExternalStore(listener => form.subscribe(listener), () => form.getSnapshot())\n const [busy, setBusy] = useState(false), [error, setError] = useState<string>()\n const mounted = useRef(true)\n useEffect(() => { mounted.current = true; return () => { mounted.current = false } }, [])\n return <div className=\"mrfw-skillsSettings\">\n <div className=\"mrfw-skillsSettingsText\">\n <div className=\"mrfw-skillsSettingsTitle\">{t('skills.globalEnable')}</div>\n <div className=\"mrfw-skillsSettingsDescription\">{t('skills.globalHint')}</div>\n {error ? <div role=\"alert\">{error}</div> : null}\n </div>\n <Switch label={t('skills.globalEnable')} checked={snapshot.value?.enabled ?? true} disabled={busy || snapshot.status !== 'ready' || !snapshot.writable}\n onChange={enabled => {\n setBusy(true); setError(undefined)\n void form.mutate([{ op: 'set', path: ['enabled'], value: enabled }], snapshot.revision).then(ok => { if (mounted.current && !ok) setError(t('skills.settingsFailed')) }).catch(() => { if (mounted.current) setError(t('skills.settingsFailed')) }).finally(() => { if (mounted.current) setBusy(false) })\n }} />\n </div>\n}\nexport function installSkillsSettingsCard(ctx: Context, t: Translate): void {\n // One coordinator prevents duplicate cards if a host temporarily exposes both shapes.\n let current: object | undefined\n let stop: (() => void) | undefined\n const candidates = new Map<Context, SkillsForm>()\n const update = () => {\n const chosen = [...candidates.entries()].sort(([a], [b]) => Number(b.get('configForms' as never) !== undefined) - Number(a.get('configForms' as never) !== undefined))[0]\n if (chosen?.[1] === current) return\n stop?.(); stop = undefined; current = chosen?.[1]\n if (!chosen) return\n const [scope, form] = chosen\n const slots = scope.slots as unknown as { inject(name: string, callback: () => unknown): () => void; register(options: object, component: unknown): () => void }\n const disposers = [\n slots.inject('settings.plugin.item', () => slots.register({ name: 'settings.plugin.item', key: 'multi-root-skills', inject: () => ({ form, t }) }, SkillsSettingsCard)),\n slots.inject('plugins.bundle.config', () => slots.register({ name: 'plugins.bundle.config', key: BUNDLE_KEY, inject: () => ({ form, t }) }, SkillsSettingsCard)),\n ]\n stop = () => { for (const dispose of disposers) dispose() }\n }\n for (const service of ['settingsScope', 'configForms']) clientInject(ctx, [service], scope => {\n const form = bindSkillsForm(scope)\n if (form === undefined) return\n candidates.set(scope, form); update()\n return () => { candidates.delete(scope); update() }\n })\n ctx.effect(() => () => { stop?.(); candidates.clear() })\n}\n","/**\n * Compatibility adapter for the product icons the panel renders.\n *\n * ```text\n * 0.1.5-rc.2 / 0.1.6 IconFolderClose16, IconChevronDownOutline14, … (pixel size in the name)\n * 0.1.7-alpha.1 through 0.2.0-rc.2 IconFolderCloseRegular, IconChevronDownOutlineRegular, … (weight in the name)\n * ```\n *\n * `0.1.7-alpha.1` kept `size` as a prop and split each glyph into a Regular\n * (1px) and a Medium (1.3px) weight. Upstream's own client surfaces use\n * Regular for these glyphs, so that is the name this probe prefers after the\n * pixel-sized one. The lookup is by export name, not by release string.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/compat/client-icons\n */\n\nimport type { ReactNode } from 'react'\nimport * as primitives from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { IconProps } from '@deepseek-ai/dsh-client-ui-primitives'\n\n/** One icon component, spelled the way both releases spell `IconProps`. */\nexport type PanelIcon = (props: IconProps) => ReactNode\n\n/** Exports addressed by name. A release carries one name from each pair. */\ntype IconModule = Readonly<Record<string, PanelIcon | undefined>>\n\n/**\n * The installed icon module, addressed by export name.\n *\n * Named imports cannot spell both releases: each name is absent from the\n * other release's declaration, so the compiler is told once, here.\n */\nconst installed = primitives as unknown as IconModule\n\n/**\n * Pick the first export name this release actually provides.\n * @param module - the icon module to read.\n * @param names - candidate export names, preferred first.\n * @returns the component.\n * @throws {Error} when none of the names is exported. That is a compatibility\n * break to adapt here, not a missing optional peer.\n */\nexport function selectIcon(module: IconModule, names: readonly string[]): PanelIcon {\n for (const name of names) {\n const found = module[name]\n if (found !== undefined) return found\n }\n throw new Error(\n 'multi-root workspace: @deepseek-ai/dsh-client-ui-primitives exports none of '\n + `${names.join(', ')}; the workspace-folders panel cannot render its icons. `\n + 'Adapt src/compat/client-icons.ts to the installed release.',\n )\n}\n\n/**\n * The same by-name probe for a decorative glyph a release may simply not\n * carry: absence degrades to no icon, not to a boot error. Required icons go\n * through `selectIcon` and fail loud; optional ones go through here.\n */\nexport function maybeIcon(names: readonly string[]): PanelIcon | undefined {\n for (const name of names) {\n const found = installed[name]\n if (found !== undefined) return found\n }\n return undefined\n}\n\n/**\n * The same by-name probe for a whole component a release may not carry:\n * `PathLabel` arrived in `0.1.7-alpha.1`, so pixel-era runtimes degrade to a\n * plain span where the header invites one. Absence degrades to no component,\n * not to a boot error.\n */\nexport function maybeComponent<T>(names: readonly string[]): T | undefined {\n return maybeIcon(names) as T | undefined\n}\n\n/** Resolved once, against the installed module. */\nfunction icon(pixelName: string, regularName: string): PanelIcon {\n return selectIcon(installed, [pixelName, regularName])\n}\n\nexport const IconChevronDown = icon('IconChevronDownOutline14', 'IconChevronDownOutlineRegular')\nexport const IconChevronUp = icon('IconChevronUpOutline14', 'IconChevronUpOutlineRegular')\nexport const IconCopy = icon('IconCopyOutline16', 'IconCopyOutlineRegular')\nexport const IconEdit = icon('IconEditOutline16', 'IconEditOutlineRegular')\nexport const IconEllipsis = icon('IconEllipsisOutline16', 'IconEllipsisOutlineRegular')\nexport const IconFolderClose = icon('IconFolderClose16', 'IconFolderCloseRegular')\nexport const IconFolderOpen = icon('IconFolderOpenOutline16', 'IconFolderOpenOutlineRegular')\nexport const IconPlus = icon('IconPlusOutline16', 'IconPlusOutlineRegular')\nexport const IconRefresh = icon('IconRefreshOutline16', 'IconRefreshOutlineRegular')\nexport const IconSettings = icon('IconSettingsOutline16', 'IconSettingsOutlineRegular')\nexport const IconTrash = icon('IconTrashOutline16', 'IconTrashOutlineRegular')\n\n// The permission glyphs exist only from 0.1.7-alpha.1 on; earlier releases\n// render the access picker's menu rows — and its trigger — without icons.\nexport const IconAccessReadWrite = maybeIcon(['PermissionIconWorkspaceWriteRegular', 'IconWorkspaceWriteRegular'])\nexport const IconAccessReadOnly = maybeIcon(['PermissionIconReadOnlyRegular', 'IconReadOnlyRegular'])\nexport const IconAccessInherit = maybeIcon(['IconWorkspaceTreeOutline16', 'IconWorkspaceTreeOutlineRegular'])\n","import { Context, Service } from \"@deepseek-ai/cordis\";\n//#region lib/types/remote-error.js\n/** The one Remote failure class shared by owners, the Gateway, and consumers. */\n/**\n* One Remote call failure: a real Error carrying its stable code and typed\n* details. Owners throw it at the failure point; the Host Gateway encodes it\n* onto the wire unchanged; the Client face rebuilds an instance for the\n* `RemoteResult` error branch, so `throw result.error` keeps throw semantics.\n* Discrimination is always by `code`, never by instanceof.\n*/\nvar RemoteError = class extends Error {\n\tcode;\n\tdetails;\n\t/** Structural marker: cross-realm/bundle identification never uses instanceof. */\n\tisDSHRemoteError = true;\n\t/**\n\t* @param code - stable failure code declared in {@link RemoteErrorDetailsMap}.\n\t* @param message - human diagnostic carried across the wire.\n\t* @param details - structured payload typed by the code.\n\t* @param options - standard Error options (`cause` survives in-process only).\n\t*/\n\tconstructor(code, message, details, options) {\n\t\tsuper(message, options);\n\t\tthis.code = code;\n\t\tthis.details = details;\n\t\tthis.name = \"RemoteError\";\n\t}\n};\n/**\n* Structurally identify a RemoteError thrown across module or realm copies of\n* this class. Mechanism-internal: the Gateway and test assertions use it;\n* business code receives typed failures and never needs it.\n* @param value - a caught value.\n* @returns the failure when the marker matches, otherwise undefined.\n*/\nfunction remoteErrorOf(value) {\n\tif (typeof value === \"object\" && value !== null && value.isDSHRemoteError === true && typeof value.code === \"string\") return value;\n}\n//#endregion\n//#region lib/types/owned-value.js\n/** Generic invocation-owned values returned by synchronous Client Context resolvers. */\n/** Shared identity across independently bundled Context providers and Gateway. */\nconst TYPERT_OWNED_VALUE = Symbol.for(\"dsh.typert.owned-value\");\n/**\n* Transfer cleanup ownership without adding another resource reference count.\n* @param value - resolved payload passed to the invocation.\n* @param release - non-throwing synchronous release, called at most once.\n* @returns an owned payload disposed after invocation and reply settlement.\n*/\nfunction typertOwnedValue(value, release) {\n\tlet active = true;\n\treturn {\n\t\t[TYPERT_OWNED_VALUE]: true,\n\t\tvalue,\n\t\t[Symbol.dispose]() {\n\t\t\tif (!active) return;\n\t\t\tactive = false;\n\t\t\trelease();\n\t\t}\n\t};\n}\n/**\n* Identify invocation-owned values using the shared marker.\n* @param value - borrowed or owned resolver result.\n* @returns whether the result carries invocation cleanup.\n*/\nfunction isTypertOwnedValue(value) {\n\treturn typeof value === \"object\" && value !== null && TYPERT_OWNED_VALUE in value && value[TYPERT_OWNED_VALUE] === true;\n}\n//#endregion\n//#region lib/types/json-value.js\n/**\n* Lossless JSON checks every Remote carrier shares: the Client handle before it\n* queues an uplink item, the Gateway at its wire and codec-less uplink\n* boundaries, and the in-process mock.\n*/\n/**\n* Test whether a value crosses JSON transport without coercion or omission.\n* @param value - candidate boundary value.\n* @returns whether the value is losslessly JSON-compatible.\n*/\nfunction isRemoteJsonValue(value) {\n\treturn visitJsonValue(value, /* @__PURE__ */ new Set());\n}\n/**\n* Test whether a value may travel as one uplink item: a lossless JSON value, or\n* a top-level `undefined`, which the wire carries as an `item` frame without\n* `value`. Nested `undefined`, `NaN`, and infinities stay rejected.\n* @param value - candidate uplink item.\n* @returns whether the item crosses every carrier unchanged.\n*/\nfunction isRemoteUplinkItem(value) {\n\treturn value === void 0 || isRemoteJsonValue(value);\n}\nfunction visitJsonValue(value, ancestors) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value) && !Object.is(value, -0);\n\tif (typeof value !== \"object\") return false;\n\tif (ancestors.has(value)) return false;\n\tancestors.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) {\n\t\t\tif (Object.getPrototypeOf(value) !== Array.prototype || Reflect.ownKeys(value).length !== value.length + 1) return false;\n\t\t\tfor (let index = 0; index < value.length; index++) if (!Object.hasOwn(value, index) || !visitJsonValue(value[index], ancestors)) return false;\n\t\t\treturn true;\n\t\t}\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\tif (prototype !== Object.prototype && prototype !== null) return false;\n\t\tfor (const key of Reflect.ownKeys(value)) {\n\t\t\tif (typeof key !== \"string\") return false;\n\t\t\tif (Object.getOwnPropertyDescriptor(value, key)?.enumerable !== true || !visitJsonValue(Reflect.get(value, key), ancestors)) return false;\n\t\t}\n\t\treturn true;\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n}\n//#endregion\n//#region lib/types/remote-info.js\n/** Lazy assembly of generated Remote definitions using caller-supplied Zod; no runtime imports. */\n/**\n* Retain one generated definition per endpoint without constructing parsers or projections.\n* The class instance builds its shared descriptor/method index on first access;\n* input schemas and JSON Schema projections are cached only when requested.\n* @param spec - compiler-produced method facts and Zod factories.\n* @param zod - the generated artifact's Zod runtime for named-input parsers.\n* @returns a lazy, mountable info instance with no registration or transport effects.\n*/\nfunction createTypertRemoteInfo(spec, zod) {\n\treturn new RemoteInfo(spec, zod);\n}\nvar RemoteInfo = class {\n\tspec;\n\tzod;\n\tindex;\n\tconstructor(spec, zod) {\n\t\tthis.spec = spec;\n\t\tthis.zod = zod;\n\t}\n\tget package() {\n\t\treturn this.spec.package;\n\t}\n\tget descriptors() {\n\t\treturn this.resolve().descriptors;\n\t}\n\tget methods() {\n\t\treturn this.resolve().methods;\n\t}\n\tresolve() {\n\t\tif (this.index !== void 0) return this.index;\n\t\tconst zod = this.zod;\n\t\tconst descriptors = [];\n\t\tconst methods = Object.create(null);\n\t\tfor (const [endpoint, definition] of Object.entries(this.spec.methods)) {\n\t\t\tconst separator = endpoint.indexOf(\"/\");\n\t\t\tconst namespace = endpoint.slice(0, separator);\n\t\t\tconst method = endpoint.slice(separator + 1);\n\t\t\tconst parameters = definition.parameters.map((parameter) => ({\n\t\t\t\t...parameter,\n\t\t\t\twire: parameter.wire ?? parameter.name\n\t\t\t}));\n\t\t\tconst descriptor = {\n\t\t\t\t...definition,\n\t\t\t\tid: `${this.spec.package}#${endpoint}`,\n\t\t\t\tnamespace,\n\t\t\t\tmethod,\n\t\t\t\tparameters,\n\t\t\t\tresult: definition.result.description === void 0 ? definition.result : new ResultValue(definition.result)\n\t\t\t};\n\t\t\tif (definition.invocation.kind === \"direct\") {\n\t\t\t\tconst inputs = [];\n\t\t\t\tmethods[endpoint] = Object.assign(descriptor, {\n\t\t\t\t\tinput(options) {\n\t\t\t\t\t\tconst strict = options?.strict === true;\n\t\t\t\t\t\treturn inputs[strict ? 1 : 0] ??= new NamedInput(parameters, strict, zod);\n\t\t\t\t\t},\n\t\t\t\t\tinvoke(remote, input, signal) {\n\t\t\t\t\t\tconst named = input;\n\t\t\t\t\t\tconst values = parameters.map((parameter) => named[parameter.wire]);\n\t\t\t\t\t\tif (definition.cancellation !== void 0) values.push(signal);\n\t\t\t\t\t\tconst receiver = Reflect.get(remote, namespace);\n\t\t\t\t\t\treturn Reflect.get(receiver, method).apply(receiver, values);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tdescriptors.push(descriptor);\n\t\t}\n\t\treturn this.index = {\n\t\t\tdescriptors,\n\t\t\tmethods\n\t\t};\n\t}\n};\n/**\n* Narrow a Registry descriptor to its generated direct-method capabilities.\n* @param descriptor - a live descriptor, including possible source fallback or Context-only receivers.\n* @returns whether generated named input and direct invocation are available.\n*/\nfunction isTypertRemoteMethod(descriptor) {\n\treturn descriptor.invocation.kind === \"direct\" && descriptor.result.mode === \"strict\" && \"input\" in descriptor && typeof descriptor.input === \"function\" && \"invoke\" in descriptor && typeof descriptor.invoke === \"function\";\n}\nfunction optional(parameter) {\n\treturn parameter.source === \"json\" && parameter.acceptsUndefined === true;\n}\nvar NamedInput = class {\n\tparameters;\n\tstrict;\n\tzod;\n\tschema;\n\tprojection;\n\tconstructor(parameters, strict, zod) {\n\t\tthis.parameters = parameters;\n\t\tthis.strict = strict;\n\t\tthis.zod = zod;\n\t}\n\tcodec(parameter) {\n\t\treturn this.strict ? parameter.strictCodec : parameter.codec;\n\t}\n\tcreate = () => this.schema ??= this.zod.strictObject(Object.fromEntries(this.parameters.map((parameter) => {\n\t\tconst value = this.codec(parameter).create();\n\t\treturn [parameter.wire, optional(parameter) ? value.optional() : value.nonoptional()];\n\t})));\n\tget jsonSchema() {\n\t\treturn this.project().jsonSchema;\n\t}\n\tget jsonSchemaError() {\n\t\treturn this.project().jsonSchemaError;\n\t}\n\tproject() {\n\t\tif (this.projection !== void 0) return this.projection;\n\t\tconst unavailable = this.parameters.find((parameter) => this.codec(parameter).jsonSchema === void 0);\n\t\tif (unavailable !== void 0) return this.projection = { jsonSchemaError: this.codec(unavailable).jsonSchemaError ?? `No JSON Schema for parameter ${unavailable.wire}` };\n\t\treturn this.projection = { jsonSchema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: Object.fromEntries(this.parameters.map((parameter) => [parameter.wire, {\n\t\t\t\t...this.codec(parameter).jsonSchema,\n\t\t\t\t...parameter.description === void 0 ? {} : { description: parameter.description }\n\t\t\t}])),\n\t\t\trequired: this.parameters.filter((parameter) => !optional(parameter)).map((parameter) => parameter.wire),\n\t\t\tadditionalProperties: false\n\t\t} };\n\t}\n};\nvar ResultValue = class {\n\tspec;\n\tprojection;\n\tconstructor(spec) {\n\t\tthis.spec = spec;\n\t}\n\tget mode() {\n\t\treturn this.spec.mode;\n\t}\n\tget typeSymbol() {\n\t\treturn this.spec.typeSymbol;\n\t}\n\tget create() {\n\t\treturn this.spec.create;\n\t}\n\tget decode() {\n\t\treturn this.spec.decode;\n\t}\n\tget encode() {\n\t\treturn this.spec.encode;\n\t}\n\tget description() {\n\t\treturn this.spec.description;\n\t}\n\tget jsonSchemaError() {\n\t\treturn this.spec.jsonSchemaError;\n\t}\n\tget jsonSchema() {\n\t\tif (this.projection === void 0) {\n\t\t\tconst schema = this.spec.jsonSchema;\n\t\t\tthis.projection = { value: schema === void 0 ? void 0 : {\n\t\t\t\t...schema,\n\t\t\t\tdescription: this.spec.description\n\t\t\t} };\n\t\t}\n\t\treturn this.projection.value;\n\t}\n};\n//#endregion\n//#region lib/types/principal.js\n/**\n* Reads the non-owner caller of the current Remote call.\n* @module @deepseek-ai/dsh-typert-protocol/principal\n*/\n/**\n* The identity a Remote-call producer records on durable output.\n* @param invocation - `ctx.invocation`; `undefined` outside a Remote call.\n* @returns the caller's principal when it is not the owner; `undefined` for the\n* owner and for trusted in-process code outside a Remote call.\n*/\nfunction principalOf(invocation) {\n\tconst principal = invocation?.peer.principal;\n\treturn principal?.kind === \"owner\" ? void 0 : principal;\n}\n//#endregion\n//#region lib/types/index.js\n/**\n* Remote decorators and explicit Gateway bindings backed by versioned\n* descriptors carried on decorated class prototypes. Strict reflection\n* remains a Typert compiler responsibility.\n* @module @deepseek-ai/dsh-typert-protocol\n*/\nconst TYPERT_REMOTE_SEGMENT_PATTERN = /^[A-Za-z0-9_$.-]+$/;\n/**\n* Test one generated Remote name against the Connection endpoint grammar.\n* @param value - namespace, method, lookup, or Context segment.\n* @returns whether the value can cross the shared RPC carrier unchanged.\n*/\nfunction isTypertRemoteSegment(value) {\n\treturn value !== \".\" && value !== \"..\" && TYPERT_REMOTE_SEGMENT_PATTERN.test(value);\n}\nconst REMOTE_METHOD_DESCRIPTOR = \"@deepseek-ai/dsh-typert-protocol/remote-methods\";\n/**\n* Bind one visible Service field to a Cordis key and Remote namespace. A\n* service that owns a Cordis Context also gives its tree `ctx.invocation`,\n* `undefined` outside a Remote call, so no `TypertRemoteService` is needed for\n* a Host composition to read it.\n* @param service - owning Service instance, normally `this`.\n* @param serviceKey - exact Cordis service key.\n* @param options - optional wire namespace.\n* @returns a frozen, inspectable binding with no compiler-injected metadata.\n*/\nfunction bindTypertRemote(service, serviceKey, options = {}) {\n\tvalidateName(\"service key\", serviceKey);\n\tconst namespace = options.namespace ?? serviceKey;\n\tvalidateName(\"namespace\", namespace);\n\tconst ctx = Reflect.get(service, \"ctx\");\n\tif (Context.is(ctx)) provideInvocationAccessor(ctx);\n\treturn Object.freeze({\n\t\tservice,\n\t\tserviceKey,\n\t\tnamespace\n\t});\n}\n/** Cordis Service base that exposes its registered name through Typert Gateway. */\nvar TypertRemoteService = class extends Service {\n\t/** Visible binding consumed by the Gateway's source-mode discovery. */\n\ttypertRemote;\n\t/**\n\t* Register the Service and bind the same key to Typert Gateway.\n\t* @param ctx - owning Cordis Context.\n\t* @param serviceKey - exact Cordis service key and default wire namespace.\n\t* @param options - optional wire namespace.\n\t*/\n\tconstructor(ctx, serviceKey, options = {}) {\n\t\tsuper(ctx, serviceKey);\n\t\tthis.typertRemote = bindTypertRemote(this, this.name, options);\n\t}\n};\n/**\n* Make `ctx.invocation` read as `undefined` outside a Remote call instead of the\n* reflect service's \"cannot get property\" error; a call-derived Context shadows\n* the accessor with its own property. The first Remote Service constructed in a\n* tree registers it on the root, where it outlives any one Service.\n*/\nfunction provideInvocationAccessor(ctx) {\n\tif (Object.hasOwn(ctx.root.reflect.props, \"invocation\")) return;\n\tctx.root.accessor(\"invocation\", { get: () => void 0 });\n}\nfunction Remote(methodExportOrOptions, context) {\n\tif (typeof methodExportOrOptions === \"string\") {\n\t\tvalidateName(\"Remote export name\", methodExportOrOptions);\n\t\treturn remoteDecorator({ kind: \"direct\" }, { exportName: methodExportOrOptions });\n\t}\n\tif (typeof methodExportOrOptions === \"object\") return remoteDecorator({ kind: \"direct\" }, markerOptions(methodExportOrOptions, REMOTE_OPTION_KEYS, \"Remote options require name, mode: \\\"stream\\\", or resources\"));\n\tif (context === void 0) throw new TypeError(\"typert-protocol: Remote decorator context is missing\");\n\taddMarkerInitializer(context, { kind: \"direct\" });\n}\nconst REMOTE_OPTION_KEYS = new Set([\n\t\"name\",\n\t\"mode\",\n\t\"resources\"\n]);\nconst REMOTE_SCOPE_OPTION_KEYS = new Set([\"name\", \"resources\"]);\n/** Validate one decorator options object against its accepted keys and select the marker fields. */\nfunction markerOptions(options, accepted, requirement) {\n\tconst keys = Reflect.ownKeys(options);\n\tif (keys.length === 0 || keys.some((key) => typeof key !== \"string\" || !accepted.has(key)) || Object.hasOwn(options, \"mode\") && options.mode !== \"stream\") throw new TypeError(`typert-protocol: ${requirement}`);\n\tconst { mode, name, resources } = options;\n\tif (name !== void 0) validateName(\"Remote export name\", name);\n\treturn {\n\t\t...mode === void 0 ? {} : { mode },\n\t\t...name === void 0 ? {} : { exportName: name },\n\t\t...resources === void 0 ? {} : { resources: resourceReaders(resources) }\n\t};\n}\n/** Freeze declared readers into the marker record; a misdeclared reader fails at decoration. */\nfunction resourceReaders(resources) {\n\tconst readers = {};\n\tfor (const [kind, reader] of Object.entries(resources)) {\n\t\tif (typeof reader !== \"function\") throw new TypeError(`typert-protocol: Remote resource reader \"${kind}\" must be a function`);\n\t\treaders[kind] = reader;\n\t}\n\tif (Object.keys(readers).length === 0) throw new TypeError(\"typert-protocol: Remote resources require at least one reader\");\n\treturn Object.freeze(readers);\n}\nfunction remoteDecorator(invocation, options = {}) {\n\treturn function(_method, context) {\n\t\taddMarkerInitializer(context, invocation, options);\n\t};\n}\nfunction RemoteScope(key, option) {\n\tvalidateName(\"Scope key\", key);\n\tconst invocation = {\n\t\tkind: \"context\",\n\t\tcontext: key\n\t};\n\tif (option === void 0) return remoteDecorator(invocation);\n\tif (typeof option === \"string\") {\n\t\tvalidateName(\"Remote export name\", option);\n\t\treturn remoteDecorator(invocation, { exportName: option });\n\t}\n\treturn remoteDecorator(invocation, markerOptions(option, REMOTE_SCOPE_OPTION_KEYS, \"RemoteScope options require name or resources\"));\n}\n/**\n* Read Remote markers attached to a live Service's class prototype.\n* The returned snapshot cannot mutate the stored descriptor.\n* @param service - live Service instance.\n* @returns markers in class declaration order.\n*/\nfunction remoteMethods(service) {\n\tconst prototype = Object.getPrototypeOf(service);\n\tif (prototype === null) return [];\n\treturn (readRemoteMethodDescriptor(prototype)?.methods ?? []).map((marker) => ({ ...marker }));\n}\nfunction readRemoteMethodDescriptor(prototype) {\n\tconst property = Object.getOwnPropertyDescriptor(prototype, REMOTE_METHOD_DESCRIPTOR);\n\tif (property === void 0) return void 0;\n\tconst descriptor = property.value;\n\tif (descriptor === null || typeof descriptor !== \"object\") throw new TypeError(\"typert-protocol: Remote method descriptor must be an object\");\n\tconst version = Reflect.get(descriptor, \"version\");\n\tif (version !== 1) throw new TypeError(`typert-protocol: unsupported Remote method descriptor version ${String(version)}`);\n\tconst methods = Reflect.get(descriptor, \"methods\");\n\tif (!Array.isArray(methods)) throw new TypeError(\"typert-protocol: Remote method descriptor methods must be an array\");\n\treturn descriptor;\n}\nfunction addMarkerInitializer(context, invocation, options = {}) {\n\tif (context.private || context.static || typeof context.name !== \"string\") throw new TypeError(\"typert-protocol: Remote decorators require a public instance method with a string name\");\n\tconst method = context.name;\n\tcontext.addInitializer(function() {\n\t\tconst prototype = Object.getPrototypeOf(this);\n\t\tif (prototype === null) throw new TypeError(`typert-protocol: cannot mark Remote method \"${method}\" on an object without a prototype`);\n\t\tmark(prototype, method, invocation, options);\n\t});\n}\nfunction mark(prototype, method, invocation, { mode, exportName, resources }) {\n\tconst descriptor = readRemoteMethodDescriptor(prototype);\n\tconst marker = Object.freeze({\n\t\tmethod,\n\t\t...exportName === void 0 || exportName === method ? {} : { exportName },\n\t\t...mode === void 0 ? {} : { mode },\n\t\tinvocation: Object.freeze(invocation),\n\t\t...resources === void 0 ? {} : { resources }\n\t});\n\tconst current = descriptor?.methods.find((candidate) => candidate.method === method);\n\tif (current !== void 0) {\n\t\tif (current.exportName === marker.exportName && current.mode === marker.mode && current.resources === marker.resources && sameInvocation(current.invocation, invocation)) return;\n\t\tthrow new Error(`typert-protocol: Remote method \"${method}\" has conflicting invocation markers`);\n\t}\n\tObject.defineProperty(prototype, REMOTE_METHOD_DESCRIPTOR, {\n\t\tconfigurable: true,\n\t\tvalue: Object.freeze({\n\t\t\tversion: 1,\n\t\t\tmethods: Object.freeze([...descriptor?.methods ?? [], marker])\n\t\t})\n\t});\n}\nfunction sameInvocation(left, right) {\n\tif (left.kind === \"direct\") return right.kind === \"direct\";\n\tif (right.kind === \"direct\") return false;\n\treturn left.context === right.context;\n}\nfunction validateName(subject, value) {\n\tif (!isTypertRemoteSegment(value)) throw new TypeError(`typert-protocol: ${subject} must contain only RPC endpoint segment characters`);\n}\n//#endregion\nexport { Remote, RemoteError, RemoteScope, TYPERT_OWNED_VALUE, TypertRemoteService, bindTypertRemote, createTypertRemoteInfo, isRemoteJsonValue, isRemoteUplinkItem, isTypertOwnedValue, isTypertRemoteMethod, isTypertRemoteSegment, principalOf, remoteErrorOf, remoteMethods, typertOwnedValue };\n","/** Watch and read ownership for the Files panel's expanded directory tree. */\nimport type { DirLevel } from './store.ts'\n\n/** One open directory and its active child nodes; cached view preferences live in the store. */\nexport class DirectoryNode {\n /** Open direct-child directories, keyed by absolute path. */\n readonly children = new Map<string, DirectoryNode>()\n private readonly controller = new AbortController()\n private readonly signal: AbortSignal\n private task: Promise<void> | undefined\n private reading: Promise<void> | undefined\n private dirty = false\n private initialized = false\n private automatic = true\n\n constructor(\n readonly path: string,\n private readonly load: (path: string, signal: AbortSignal) => Promise<DirLevel | undefined>,\n private readonly watch: (path: string, signal: AbortSignal) => AsyncIterable<'ready' | 'change'>,\n private readonly failed: (path: string, error: unknown) => void,\n lifetime: AbortSignal,\n private restore: readonly string[] = [],\n ) {\n this.signal = AbortSignal.any([lifetime, this.controller.signal])\n }\n\n /**\n * Start observation once; readiness triggers the initial listing.\n * @returns this node.\n */\n open(): this {\n this.task ??= this.follow()\n return this\n }\n\n /**\n * Find an active node in this subtree.\n * @param path - absolute directory path.\n * @returns the matching node, or undefined when that directory is closed.\n */\n find(path: string): DirectoryNode | undefined {\n if (path === this.path) return this\n for (const child of this.children.values()) {\n const found = child.find(path)\n if (found !== undefined) return found\n }\n return undefined\n }\n\n /**\n * Update the expansion preferences used by pending directory listings.\n * @param expanded - latest expansion preferences from the store.\n */\n setExpanded(expanded: readonly string[]): void {\n this.restore = expanded\n for (const child of this.children.values()) child.setExpanded(expanded)\n }\n\n /**\n * Open a direct child using this node's lifetime and automatic-refresh setting.\n * @param path - absolute direct-child directory path.\n * @param restore - descendant expansion preferences to restore after listing.\n * @returns the active child, or undefined after cancellation.\n */\n expand(path: string, restore: readonly string[] = []): DirectoryNode | undefined {\n if (this.signal.aborted) return undefined\n let child = this.children.get(path)\n if (child === undefined) {\n child = new DirectoryNode(path, this.load, this.watch, this.failed, this.signal, restore)\n child.automatic = this.automatic\n this.children.set(path, child)\n }\n return child.open()\n }\n\n /**\n * Remove a child and its pending restoration preferences.\n * @param path - absolute direct-child directory path.\n * @returns once the child subtree's reads and watches have ended.\n */\n async collapse(path: string): Promise<void> {\n this.restore = this.restore.filter(value => value !== path && !value.startsWith(`${path}/`))\n const child = this.children.get(path)\n this.children.delete(path)\n await child?.close()\n }\n\n /**\n * Control subtree rereads without ending subscriptions.\n * @param enabled - refresh dirty nodes automatically.\n */\n setAutomatic(enabled: boolean): void {\n this.automatic = enabled\n if (enabled && this.dirty) void this.refresh()\n for (const child of this.children.values()) child.setAutomatic(enabled)\n }\n\n /** Queue a reread, coalescing with active work. @returns completion of the active read and its coalesced rereads. */\n refresh(): Promise<void> {\n this.dirty = true\n this.reading ??= this.read()\n return this.reading\n }\n\n /** Refresh this node and its open descendants. @returns once their listings settle. */\n async refreshTree(): Promise<void> {\n await this.refresh()\n await Promise.all([...this.children.values()].map(child => child.refreshTree()))\n }\n\n /** Cancel the active subtree. @returns once all owned reads and watches have ended. */\n async close(): Promise<void> {\n this.controller.abort()\n await Promise.all([this.task, this.reading, ...[...this.children.values()].map(child => child.close())])\n this.children.clear()\n }\n\n private async follow(): Promise<void> {\n try {\n for await (const _event of this.watch(this.path, this.signal)) {\n this.dirty = true\n if (!this.initialized || this.automatic) void this.refresh()\n }\n } catch (error) {\n if (!this.signal.aborted) {\n if (!this.initialized) await this.refresh()\n if (!(typeof error === 'object' && error !== null && 'code' in error && error.code === 'workspace-file/watch-unsupported')) {\n this.failed(this.path, error)\n }\n }\n }\n }\n\n private async read(): Promise<void> {\n const readAgain = (): boolean => this.dirty && this.automatic && !this.signal.aborted\n try {\n do {\n this.dirty = false\n const level = await this.load(this.path, this.signal)\n if (this.signal.aborted || level === undefined) return\n this.initialized = true\n const directories = new Set(level.entries.filter(entry => entry.type === 'directory')\n .map(entry => `${this.path.replace(/[/\\\\]+$/, '')}/${entry.name}`))\n for (const path of this.children.keys()) {\n if (!directories.has(path)) await this.collapse(path)\n }\n for (const path of directories) {\n if (this.restore.includes(path)) this.expand(path, this.restore)\n }\n this.restore = []\n } while (readAgain())\n } finally {\n this.reading = undefined\n }\n }\n}\n","/**\n * The tree's asynchronous half: listing directories into the store.\n *\n * The component never awaits anything. It calls `start` / `refresh` / `toggle`, and\n * this face performs the listing and writes the outcome through the store's own\n * actions — the Slot-standard `inject` shape, so the session id is resolved by\n * the framework and the write set stays the store's.\n *\n * The listing itself is bound here to the Client Remote face: the tree keys\n * every level by absolute path and hands the endpoint that same absolute path;\n * the endpoint answers with the directory's workspace-relative path as well,\n * which the tree has no use for and drops.\n *\n * One level has one listing in force: asking for a level again — the reload\n * gesture, a directory reopened after a reset — retires the listing still in\n * flight for it, whose settlement then writes nothing. Cleanup rides the owner's\n * `signal`: a request is not made for a record that already ended, and when the\n * record goes away the bucket and the tab's listing bookkeeping are forgotten,\n * so no later settlement writes to it.\n */\nimport type { ClientRemote, RemoteResult } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { BoundActions } from '@deepseek-ai/dsh-client-store'\nimport type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport type { DirLevel, createFilesStore } from './store.ts'\nimport type { WorkspaceFileWatchFrame } from '@deepseek-ai/dsh-api-workspace-files/types'\nimport { RemoteError } from '@deepseek-ai/dsh-typert-protocol'\nimport { DirectoryNode } from './directory-node.ts'\n\n/**\n * Observe one directory without recursively watching its descendants.\n * @param sessionId - Session owning the directory tree.\n * @param path - absolute directory path.\n * @param signal - node lifetime.\n * @returns readiness and invalidation notifications.\n */\nexport type WatchWorkspaceDirectory = (sessionId: SessionId, path: string, signal: AbortSignal) => AsyncIterable<'ready' | 'change'>\n\n/**\n * Bind directory observation to the Remote stream supervisor.\n * @param remote - Client Remote with workspace file streams.\n * @returns a watcher that awaits stream disposal when its node ends.\n */\nexport function createWatch(remote: ClientRemote): WatchWorkspaceDirectory {\n return async function* (sessionId, path, signal) {\n const aborted = (): boolean => signal.aborted\n if (aborted()) return\n const stream = remote.$stream<WorkspaceFileWatchFrame>({\n name: `directory ${path}`,\n open: lifetime => remote.workspaceFiles.changes(sessionId, path, lifetime),\n ended: () => new Error(`Directory watch ended: ${path}`),\n })\n const abort = (): void => { void stream.dispose() }\n signal.addEventListener('abort', abort, { once: true })\n try {\n for await (const item of stream) {\n if (aborted()) return\n if (item.value.kind === 'ready') item.accept()\n yield item.value.kind\n }\n } finally {\n signal.removeEventListener('abort', abort)\n await stream.dispose()\n }\n }\n}\n\n/**\n * One directory listing, bound to a Remote face.\n *\n * The session travels with the call because the endpoint resolves the workspace\n * root from it: the same path means different directories in different sessions.\n * A Remote call does not reject — the result carries the failure.\n */\nexport type ListWorkspaceDirectory = (\n sessionId: SessionId,\n path: string,\n signal: AbortSignal,\n) => Promise<RemoteResult<DirLevel>>\n\n/**\n * The slice of the Client Remote face this package calls: the `workspaceFiles`\n * namespace's `list`, exactly as the Host's generated client declares it.\n */\nexport type WorkspaceFilesListRemote = {\n readonly workspaceFiles: Pick<ClientRemote['workspaceFiles'], 'list'>\n}\n\n/**\n * Bind the listing to one Remote face, keeping only what the tree stores.\n * @param remote - the Client Remote face carrying the `workspaceFiles` namespace.\n * @returns the listing the tree's face performs.\n */\nexport function createList(remote: WorkspaceFilesListRemote): ListWorkspaceDirectory {\n return async (sessionId, path, signal) => {\n const result = await remote.workspaceFiles.list(sessionId, path, signal)\n if (!result.ok) return result\n return { ok: true, value: { entries: result.value.entries, truncated: result.value.truncated } }\n }\n}\n\n/**\n * The absolute path of one child entry.\n *\n * Joined with `/` whatever the parent's separators: the Host resolves mixed\n * separators, and the tree only needs a stable key.\n * @param parent - absolute path of the listed directory.\n * @param name - the entry's basename.\n * @returns the child's absolute path.\n */\nexport function childPath(parent: string, name: string): string {\n return `${parent.replace(/[/\\\\]+$/, '')}/${name}`\n}\n\n/** The tree's injected business face, as the body receives it. */\nexport interface FilesInjected {\n /** Refresh the open directory tree. @param tabId - owning tab. */\n readonly refresh: (tabId: TabId) => void\n /** Control automatic rereads without closing watches. @param tabId - owning tab. @param enabled - automatic-refresh setting. */\n readonly setAutoRefresh: (tabId: TabId, enabled: boolean) => void\n /**\n * Seed this tab's tree and list its root.\n * @param tabId - the tab being drawn.\n * @param root - absolute path of the workspace root.\n * @param signal - the tab record's lifetime.\n */\n readonly start: (tabId: TabId, root: string, signal: AbortSignal) => void\n /**\n * List one directory into the store.\n * @param tabId - the tab being drawn.\n * @param path - absolute directory path.\n * @param signal - the tab record's lifetime.\n */\n readonly load: (tabId: TabId, path: string, signal: AbortSignal) => void\n /**\n * Open or collapse one directory, retaining intent during ancestor restoration.\n * @param tabId - the tab being drawn.\n * @param parentPath - the listed parent directory's exact tree key.\n * @param path - absolute directory path.\n * @param expanded - current expansion preferences, including descendants to restore.\n * @param signal - the tab record's lifetime.\n */\n readonly toggle: (tabId: TabId, parentPath: string, path: string, expanded: readonly string[], signal: AbortSignal) => void\n}\n\n/**\n * Bind the tree's face to one directory listing.\n * @param list - the bound `workspaceFiles.list` call.\n * @param watch - target-scoped directory observation.\n * @returns the Slot `inject` factory: session and bound actions in, face out.\n */\nexport function filesFace(\n list: ListWorkspaceDirectory,\n watch: WatchWorkspaceDirectory,\n): (sessionId: SessionId, actions: BoundActions<ReturnType<typeof createFilesStore>>) => FilesInjected {\n return (\n sessionId: SessionId,\n actions: BoundActions<ReturnType<typeof createFilesStore>>,\n ): FilesInjected => {\n /** Per tab, per absolute path: the listing generation a settlement must match; the latest request wins. */\n const generations = new Map<TabId, Map<string, number>>()\n const roots = new Map<TabId, DirectoryNode>()\n const nextGeneration = (tabId: TabId, path: string): number => {\n const byPath = generations.get(tabId) ?? new Map<string, number>()\n generations.set(tabId, byPath)\n const generation = (byPath.get(path) ?? 0) + 1\n byPath.set(path, generation)\n return generation\n }\n const load = async (tabId: TabId, path: string, signal: AbortSignal): Promise<DirLevel | undefined> => {\n if (signal.aborted) return\n const generation = nextGeneration(tabId, path)\n actions.loading(tabId, path)\n return list(sessionId, path, signal).then((result) => {\n // A newer listing of this level was asked for since, or the record is\n // gone and its bookkeeping with it: nothing left for this one to write.\n if (signal.aborted || generations.get(tabId)?.get(path) !== generation) return\n if (result.ok) actions.loaded(tabId, path, result.value)\n else actions.failed(tabId, path, result.error)\n return result.ok ? result.value : undefined\n })\n }\n return {\n refresh: (tabId) => { void roots.get(tabId)?.refreshTree() },\n setAutoRefresh: (tabId, enabled) => {\n actions.autoRefresh(tabId, enabled)\n roots.get(tabId)?.setAutomatic(enabled)\n },\n start(tabId, root, signal) {\n actions.start(tabId, root)\n signal.addEventListener('abort', () => {\n void roots.get(tabId)?.close()\n roots.delete(tabId)\n generations.delete(tabId)\n actions.forget(tabId)\n }, { once: true })\n roots.set(tabId, new DirectoryNode(root,\n (path, lifetime) => load(tabId, path, lifetime),\n (path, lifetime) => watch(sessionId, path, lifetime),\n (path, error) => {\n if (!signal.aborted) actions.failed(tabId, path, new RemoteError('gateway/internal', error instanceof Error ? error.message : String(error), {}))\n }, signal,\n ).open())\n },\n load: (tabId, path, signal) => { void load(tabId, path, signal) },\n toggle(tabId, parentPath, path, expanded, signal) {\n if (signal.aborted) return\n const root = roots.get(tabId)\n if (root === undefined) return\n const parent = root.find(parentPath)\n if (parent === undefined && !expanded.includes(parentPath)) return\n const collapsing = expanded.includes(path)\n const next = collapsing ? expanded.filter(value => value !== path) : [...expanded, path]\n root.setExpanded(next)\n if (collapsing) void parent?.collapse(path)\n else parent?.expand(path, next)\n actions.toggled(tabId, path)\n },\n }\n }\n}\n","/**\n * The file tree's view state: which directories are expanded, what each\n * loaded level contains, and where the body is scrolled to.\n *\n * The tree is not one resource. A directory listing per level, expanded lazily,\n * is state the type owns — so it lives in a Slot-standard exclusive store\n * (one instance per session), bucketed by tab id because two tabs of this kind\n * in one session expand independently.\n *\n * Writers run between `start` and `forget`: the owner's `signal` is what ends a\n * bucket's life, and the face stops dispatching once it aborts.\n */\nimport { defineStore, type EngineStoreHandle } from '@deepseek-ai/dsh-client-store'\nimport type { RemoteFailure } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit'\nimport type { WorkspaceDirectoryEntry } from '@deepseek-ai/dsh-api-workspace-files/types'\n\n/**\n * One directory's contents, as one expanded level of the tree.\n *\n * The endpoint's listing also names the directory as a workspace-relative path;\n * the tree keys every level by absolute path instead, so the adapter drops it.\n */\nexport interface DirLevel {\n /** The directory's entries, in the endpoint's order. */\n readonly entries: readonly WorkspaceDirectoryEntry[]\n /** The listing hit the endpoint's entry cap, so entries are missing. */\n readonly truncated: boolean\n}\n\n/** What one directory level is doing right now. */\nexport type LevelState =\n | { readonly kind: 'loading' }\n | { readonly kind: 'ready'; readonly level: DirLevel; readonly failure?: RemoteFailure }\n | { readonly kind: 'failed'; readonly failure: RemoteFailure }\n\n/**\n * One tab's tree: its root, the levels it has asked for, and what is open.\n *\n * Every path here is absolute: the root is the session's working directory as\n * the Host reports it, and a child is the parent joined with the entry name.\n */\nexport interface FilesTabState {\n autoRefresh: boolean\n /** Absolute path of the workspace root this tree is rooted at. */\n root: string\n /** Level state by absolute directory path; a path absent here was never asked for. */\n levels: Record<string, LevelState>\n /** Expanded absolute directory paths, root included. */\n expanded: string[]\n /** The body's scroll offset in px, so a remounted tree comes back where the reader was. */\n scrollTop: number\n}\n\n/** Every tab's tree, keyed by tab id. */\nexport interface FilesState {\n byTab: Record<TabId, FilesTabState>\n}\n\n/**\n * One tab's bucket, which every writer after `start` relies on: the face only\n * dispatches while the record's signal is live, and `forget` runs on its abort.\n * @param state - the draft.\n * @param tabId - the tab being written.\n * @returns the tab's tree.\n */\nfunction bucket(state: FilesState, tabId: TabId): FilesTabState {\n const tree = state.byTab[tabId]\n if (tree === undefined) throw new Error(`ui-sidebar-files: no tree for tab \"${tabId}\"`)\n return tree\n}\n\n/** The tree store's write set; every action names the tab it writes. */\ntype FilesActions = {\n autoRefresh: (draft: FilesState, tabId: TabId, enabled: boolean) => void\n start: (draft: FilesState, tabId: TabId, root: string) => void\n loading: (draft: FilesState, tabId: TabId, path: string) => void\n loaded: (draft: FilesState, tabId: TabId, path: string, level: DirLevel) => void\n failed: (draft: FilesState, tabId: TabId, path: string, failure: RemoteFailure) => void\n toggled: (draft: FilesState, tabId: TabId, path: string) => void\n scrolled: (draft: FilesState, tabId: TabId, scrollTop: number) => void\n reset: (draft: FilesState, tabId: TabId) => void\n forget: (draft: FilesState, tabId: TabId) => void\n}\n\n/**\n * Declare the file tree's store.\n *\n * A factory rather than a shared handle: the registration declares it as an\n * exclusive store, so the framework mints one instance per session.\n * @returns the store handle to declare on the registration.\n */\nexport function createFilesStore(): EngineStoreHandle<FilesState, FilesActions> {\n return defineStore({\n init: (): FilesState => ({ byTab: {} }),\n actions: {\n autoRefresh: (d, tabId: TabId, enabled: boolean) => { bucket(d, tabId).autoRefresh = enabled },\n /**\n * Seed one tab's tree at its workspace root, with the root expanded.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param root - absolute path of the workspace root.\n */\n start: (d, tabId: TabId, root: string) => {\n d.byTab[tabId] = { root, levels: {}, expanded: [root], scrollTop: 0, autoRefresh: true }\n },\n /**\n * Mark one directory as being listed.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param path - absolute directory path.\n */\n loading: (d, tabId: TabId, path: string) => {\n const state = bucket(d, tabId)\n if (state.levels[path]?.kind !== 'ready') state.levels[path] = { kind: 'loading' }\n },\n /**\n * Record one directory's contents.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param path - absolute directory path.\n * @param level - the listing to show under it.\n */\n loaded: (d, tabId: TabId, path: string, level: DirLevel) => {\n const state = bucket(d, tabId)\n const previous = state.levels[path]\n if (previous?.kind === 'ready') {\n const directories = new Set(level.entries.filter(entry => entry.type === 'directory').map(entry => entry.name))\n for (const entry of previous.level.entries) {\n if (entry.type !== 'directory' || directories.has(entry.name)) continue\n const removed = `${path.replace(/[/\\\\]+$/, '')}/${entry.name}`\n state.expanded = state.expanded.filter(value => value !== removed && !value.startsWith(`${removed}/`))\n state.levels = Object.fromEntries(Object.entries(state.levels)\n .filter(([key]) => key !== removed && !key.startsWith(`${removed}/`)))\n }\n }\n state.levels[path] = { kind: 'ready', level }\n },\n /**\n * Record why one directory could not be listed.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param path - absolute directory path.\n * @param failure - the settled Remote failure.\n */\n failed: (d, tabId: TabId, path: string, failure: RemoteFailure) => {\n const level = bucket(d, tabId).levels[path]\n bucket(d, tabId).levels[path] = level?.kind === 'ready'\n ? { ...level, failure }\n : { kind: 'failed', failure }\n },\n /**\n * Open a collapsed directory, or collapse an open one.\n *\n * A collapsed level keeps what it loaded, so reopening it draws at once.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param path - absolute directory path.\n */\n toggled: (d, tabId: TabId, path: string) => {\n const state = bucket(d, tabId)\n const at = state.expanded.indexOf(path)\n if (at >= 0) state.expanded.splice(at, 1)\n else state.expanded.push(path)\n },\n /**\n * Record where one tab's body is scrolled to.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param scrollTop - the body's scroll offset, in px.\n */\n scrolled: (d, tabId: TabId, scrollTop: number) => {\n bucket(d, tabId).scrollTop = scrollTop\n },\n /**\n * Drop every loaded level, keeping what is expanded.\n *\n * This is the reload gesture's first half: the expanded set says which\n * levels to fetch again.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n */\n reset: (d, tabId: TabId) => {\n bucket(d, tabId).levels = {}\n },\n /**\n * Forget one tab's tree, for a tab record that is gone.\n * @param d - draft state.\n * @param tabId - the tab that went away.\n */\n forget: (d, tabId: TabId) => {\n d.byTab = Object.fromEntries(Object.entries(d.byTab).filter(([id]) => id !== tabId))\n },\n },\n })\n}\n","/**\n * Runtime probes for the `@deepseek-ai/dsh-client-ui-primitives` exports the\n * verbatim Files-tree files spell.\n *\n * The upstream imports name the `*Regular` glyph family (0.1.7+; the pixel\n * names are kept as fallbacks for the same reason `compat/client-icons`\n * dual-names them) plus `FileTypeIcon` and `classifyFileType`, which every\n * supported release carries. A named import cannot spell two release eras at\n * once, so the resolution goes through `maybeIcon`/`maybeComponent` — the\n * same probe the open-in-app fork uses.\n *\n * The exported bindings are typed definite because the adapter mounts the\n * tree only after {@link filesTreeSurfaceSupported} passes; reaching for a\n * binding on a composition that failed the gate is a caller bug, and the\n * gate — not this module — is what a missing export degrades into.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/files-tree/primitives\n */\n\nimport { maybeComponent, maybeIcon, type PanelIcon } from '../../compat/client-icons.ts'\nimport type {} from '@deepseek-ai/dsh-client-ui-primitives'\n\n/** The upstream types the probed exports spell, kept honest by the type-only import. */\ntype Primitives = typeof import('@deepseek-ai/dsh-client-ui-primitives')\n\n/** Exports the fork's row rendering needs, keyed by their upstream names. */\nconst probed = {\n folderClose: maybeIcon(['IconFolderCloseRegular', 'IconFolderClose16']),\n folderOpen: maybeIcon(['IconFolderOpenRegular', 'IconFolderOpen16']),\n fileTypeIcon: maybeComponent<Primitives['FileTypeIcon']>(['FileTypeIcon']),\n classifyFileType: maybeComponent<Primitives['classifyFileType']>(['classifyFileType']),\n}\n\n/**\n * Whether this composition's primitives carry everything the forked rows\n * spell. The adapter consults this once: `false` means the additional-root\n * menu stays menu-only and no fork mount is attempted — the same absence\n * upstream's own no-such-export state would produce.\n */\nexport function filesTreeSurfaceSupported(): boolean {\n return probed.folderClose !== undefined\n && probed.folderOpen !== undefined\n && probed.fileTypeIcon !== undefined\n && probed.classifyFileType !== undefined\n}\n\nexport const IconFolderCloseRegular = probed.folderClose as PanelIcon\nexport const IconFolderOpenRegular = probed.folderOpen as PanelIcon\nexport const FileTypeIcon = probed.fileTypeIcon as Primitives['FileTypeIcon']\nexport const classifyFileType = probed.classifyFileType as Primitives['classifyFileType']\n","/**\n * Fork-facing shim for upstream `ui-sidebar-files/src/client/locales.ts`.\n *\n * Upstream's dictionaries stay upstream's: the runtime `sidebarFiles`\n * namespace is already registered by `@deepseek-ai/dsh-client-ui-sidebar-files`\n * in every composition where the Files tab exists, and this plugin binds that\n * same namespace instead of registering a second copy (`locale.register`\n * throws on a duplicate locale inside one namespace). What the forked\n * components still need from this file is the namespace name and the key\n * domain for `TranslateNS<typeof NS>` — copied verbatim from upstream. When\n * upstream edits copy, the string values follow automatically; only a NEW key\n * requires extending the union below.\n *\n * Sync: `SidebarFilesKey` must equal `keyof typeof zh` in upstream's\n * `locales.ts`. See FORK.md.\n */\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\n\n/** Dictionary namespace owned by upstream's plugin (verbatim). */\nexport const NS = 'sidebarFiles'\n\n/** Key domain of the `sidebarFiles` namespace (verbatim union of upstream's zh keys). */\nexport type SidebarFilesKey =\n | 'shortcut.noSession'\n | 'type.label'\n | 'guide.title'\n | 'guide.description'\n | 'loading'\n | 'empty'\n | 'truncated'\n | 'noWorkspace'\n | 'reload'\n | 'autoRefresh'\n | 'autoRefresh.enable'\n | 'autoRefresh.disable'\n | 'entry.other'\n | 'error.notFound'\n | 'error.outsideWorkspace'\n | 'error.notDirectory'\n | 'error.unavailable'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** File-tree type name, guide entry, row states, and failure lines. */\n sidebarFiles: SidebarFilesKey\n }\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","//#region lib/types/file-address.js\n/**\n* The `dsh-resource://file/…` address grammar: how a file is named across the\n* Sidebar and the resource model, built and parsed without touching a\n* filesystem.\n* @module\n*/\n/** The scheme and type every file address opens with. */\nconst FILE_ADDRESS_PREFIX = \"dsh-resource://file/\";\n/** Component-encode one id or path segment, keeping `:` literal for drive letters. */\nfunction encodeSegment(segment) {\n\treturn encodeURIComponent(segment).replace(/%3A/gi, \":\");\n}\n/** Encode a `/`-separated path segment by segment. */\nfunction encodePath(path) {\n\treturn path.split(\"/\").map(encodeSegment).join(\"/\");\n}\n/** Whether a decoded first path segment is a Windows drive (`C:`). */\nfunction isDriveSegment(segment) {\n\treturn segment !== void 0 && /^[A-Za-z]:$/.test(segment);\n}\n/**\n* Build the address of a file read through one Session.\n* @param sessionId - the Session whose Host workspace resolves the path.\n* @param path - absolute or workspace-relative path; backslashes are normalized to `/`, and leading `./` prefixes are dropped.\n* @returns the `dsh-resource://file/session/<sessionId>/<path>` address.\n*/\nfunction sessionFileAddress(sessionId, path) {\n\tconst normalized = path.replace(/\\\\/g, \"/\").replace(/^(?:\\.\\/)+/, \"\");\n\treturn `${FILE_ADDRESS_PREFIX}session/${encodeSegment(sessionId)}/${encodePath(normalized)}`;\n}\n/**\n* Build the address of a file by its absolute path.\n* @param path - absolute path; backslashes are normalized to `/` and the leading `/` is dropped,\n* except that a UNC path (`\\\\server\\share`) keeps one empty first segment.\n* @returns the `dsh-resource://file/absolute/<path>` address.\n*/\nfunction absoluteFileAddress(path) {\n\tconst normalized = path.replace(/\\\\/g, \"/\");\n\tconst unc = normalized.startsWith(\"//\");\n\tconst absolute = normalized.replace(/^\\/+/, \"\");\n\treturn `${FILE_ADDRESS_PREFIX}absolute/${unc ? \"/\" : \"\"}${encodePath(absolute)}`;\n}\n/**\n* Read a file address back into its parts without resolving `.` or `..`.\n* Query and fragment suffixes are ignored; encoded path segments are decoded.\n* @param address - a candidate address.\n* @returns the parts, or `undefined` when the string is not a `dsh-resource://file/` URI in a known scope with a path, or a segment is not validly encoded.\n*/\nfunction parseFileAddress(address) {\n\ttry {\n\t\tif (!address.startsWith(FILE_ADDRESS_PREFIX)) return void 0;\n\t\tconst end = address.search(/[?#]/);\n\t\tconst [scope, ...rest] = address.slice(20, end === -1 ? void 0 : end).split(\"/\");\n\t\tif (scope === \"session\") {\n\t\t\tconst [id, ...segments] = rest;\n\t\t\tif (id === void 0 || id === \"\" || segments.length === 0) return void 0;\n\t\t\treturn {\n\t\t\t\tscope,\n\t\t\t\tsessionId: decodeURIComponent(id),\n\t\t\t\tpath: segments.map(decodeURIComponent).join(\"/\")\n\t\t\t};\n\t\t}\n\t\tif (scope === \"absolute\") {\n\t\t\tconst unc = rest[0] === \"\" && rest.length > 1;\n\t\t\tconst segments = (unc ? rest.slice(1) : rest).map(decodeURIComponent);\n\t\t\tif (segments.length === 0 || segments[0] === \"\") return void 0;\n\t\t\tif (unc) return {\n\t\t\t\tscope,\n\t\t\t\tpath: `//${segments.join(\"/\")}`\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tscope,\n\t\t\t\tpath: isDriveSegment(segments[0]) ? segments.join(\"/\") : `/${segments.join(\"/\")}`\n\t\t\t};\n\t\t}\n\t\treturn;\n\t} catch {\n\t\treturn;\n\t}\n}\n//#endregion\n//#region lib/types/index.js\n/**\n* Browser-safe Workspace path and display helpers.\n* @module @deepseek-ai/dsh-util-workspace-path\n*/\n/** Whether a path uses a Windows drive or UNC prefix. */\nfunction isWindowsStylePath(value) {\n\treturn /^[A-Za-z]:[/\\\\]/.test(value) || value.startsWith(\"\\\\\\\\\");\n}\n/**\n* Whether a path is absolute in either spelling the Host accepts: POSIX (`/a/b`) or Windows drive or UNC.\n* @param path - the path to classify.\n* @returns `true` for an absolute path; `false` for a Workspace-relative one.\n*/\nfunction isAbsoluteWorkspacePath(path) {\n\treturn path.startsWith(\"/\") || isWindowsStylePath(path);\n}\n/**\n* Resolve a Workspace-relative path into the Host-facing spelling used by path operations.\n* @param cwd - Session Workspace root, when known.\n* @param path - Absolute or Workspace-relative path; leading `./` segments are dropped when joining.\n* @returns an absolute path when a Workspace root is available, otherwise the original path.\n*/\nfunction resolveWorkspacePath(cwd, path) {\n\tif (isAbsoluteWorkspacePath(path)) return path;\n\tif (cwd === void 0 || cwd === \"\") return path;\n\tconst separator = isWindowsStylePath(cwd) && cwd.includes(\"\\\\\") ? \"\\\\\" : \"/\";\n\treturn `${cwd.replace(/[/\\\\]+$/, \"\")}${separator}${path.replace(/^(?:\\.?[/\\\\])+/, \"\")}`;\n}\n/**\n* Abbreviate a POSIX home directory for display.\n* @param path - Absolute or already-short display path.\n* @param home - Host account home; absent skips abbreviation.\n* @returns `~` or `~/…` for the POSIX home and its descendants, otherwise `path`.\n*/\nfunction abbreviateHomePath(path, home) {\n\tif (home === void 0 || home === \"\") return path;\n\tif (isWindowsStylePath(path) || isWindowsStylePath(home)) return path;\n\tconst root = home.replace(/\\/+$/, \"\");\n\tif (root === \"\" || root === \"/\") return path;\n\tif (path.replace(/\\/+$/, \"\") === root) return \"~\";\n\tif (path.startsWith(`${root}/`)) return `~${path.slice(root.length)}`;\n\treturn path;\n}\n/**\n* Read the final non-empty segment of a Workspace path for display.\n* Workspace-label surfaces use this helper instead of deriving another basename.\n* @param path - Workspace directory path using POSIX or Windows separators.\n* @returns the final segment, or an empty string for a separator-only path.\n*/\nfunction workspaceTitleOf(path) {\n\tconst trimmed = path.replace(/[/\\\\]+$/, \"\");\n\tconst separator = Math.max(trimmed.lastIndexOf(\"/\"), trimmed.lastIndexOf(\"\\\\\"));\n\treturn trimmed.slice(separator + 1);\n}\n/**\n* Split a path for display: the directories through their last separator, and\n* the final segment after it. Both `/` and `\\` separate, so a Windows path\n* splits where its own segments end; trailing separators are dropped first, so\n* a directory path names its own last segment. A path with no separator, or a\n* separator-only path, is all name.\n* @param path - file or directory path using POSIX or Windows separators.\n* @returns the directory prefix (possibly empty) and the final segment.\n*/\nfunction pathPartsOf(path) {\n\tconst trimmed = path.replace(/[/\\\\]+$/, \"\");\n\tif (trimmed === \"\") return {\n\t\tdirectory: \"\",\n\t\tname: path\n\t};\n\tconst cut = Math.max(trimmed.lastIndexOf(\"/\"), trimmed.lastIndexOf(\"\\\\\")) + 1;\n\treturn {\n\t\tdirectory: trimmed.slice(0, cut),\n\t\tname: trimmed.slice(cut)\n\t};\n}\n/**\n* The address for a path as a caller holds it: a relative path, or an absolute\n* path inside the Session's workspace, becomes a `session`-scoped address; an\n* absolute path outside it, or one whose workspace root is unknown, keeps its\n* absolute path in that Session's address.\n* @param sessionId - the Session the path is read in.\n* @param cwd - that Session's workspace root, when known.\n* @param path - absolute or workspace-relative path, in either separator spelling.\n* @returns the `dsh-resource://file/…` address.\n*/\nfunction fileAddressFor(sessionId, cwd, path) {\n\tconst normalized = path.replace(/\\\\/g, \"/\");\n\tif (!isAbsoluteWorkspacePath(normalized)) return sessionFileAddress(sessionId, normalized);\n\tconst root = cwd === void 0 ? \"\" : cwd.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\");\n\tif (root !== \"\" && normalized === root) return sessionFileAddress(sessionId, \"\");\n\tif (root !== \"\" && normalized.startsWith(`${root}/`)) return sessionFileAddress(sessionId, normalized.slice(root.length + 1));\n\treturn sessionFileAddress(sessionId, normalized);\n}\n/**\n* Strip the workspace root from a workspace-rooted absolute path (display only).\n* @param text - the path to shorten.\n* @param cwd - session workspace root; absent or empty leaves the path unchanged.\n* @returns the path relative to the workspace root, or unchanged when it is not rooted there.\n*/\nfunction relativizeToCwd(text, cwd) {\n\tif (cwd === void 0 || cwd === \"\") return text;\n\tconst root = cwd.replace(/[/\\\\]+$/, \"\");\n\tif (text.startsWith(`${root}/`) || text.startsWith(`${root}\\\\`)) return text.slice(root.length + 1);\n\treturn text;\n}\n/**\n* Address a decoded absolute file path through the authenticated file route.\n* @param base - HTTP(S) application base, including its deployment prefix, or `dsh-app://app/`.\n* @param path - Native file path; URL escapes in authored Markdown must already be decoded.\n* @returns File URL, or undefined for unsupported transports and non-absolute paths.\n*/\nfunction fileMediaUrl(base, path) {\n\tif (!/^https?:/u.test(base) && !base.startsWith(\"dsh-app://app/\") || !isAbsoluteWorkspacePath(path) || /^[/\\\\]{2}/u.test(path) || /[\\u0000-\\u001f\\u007f]/u.test(path)) return void 0;\n\treturn new URL(`api/file?path=${encodeURIComponent(path)}`, base).href;\n}\n//#endregion\nexport { abbreviateHomePath, absoluteFileAddress, fileAddressFor, fileMediaUrl, isAbsoluteWorkspacePath, parseFileAddress, pathPartsOf, relativizeToCwd, resolveWorkspacePath, sessionFileAddress, workspaceTitleOf };\n","/**\n * Shim for the CSS-module virtual module `./FilesBody.module.css`.\n *\n * This toolchain resolves real files, not CSS-module virtual modules — so\n * the forked body imports this file instead (the one-line specifier delta\n * recorded in FORK.md). It exports the same `css.<name>` map, pointed at the\n * plugin-prefixed `mrfw-ft*` classes whose rules live in `styles.ts`; the\n * upstream `FilesBody.module.css` sits beside it verbatim as the diffable\n * source. Only the names the fork's JSX actually reads are mapped — the\n * header-only entries (`root`, `header`, `path`, `tool`, `status`,\n * `statusLine`, `titleIcon`) belong to the shell this fork drops.\n */\nconst css = {\n body: 'mrfw-ftBody',\n level: 'mrfw-ftLevel',\n item: 'mrfw-ftItem',\n row: 'mrfw-ftRow',\n icon: 'mrfw-ftIcon',\n fileIcon: 'mrfw-ftFileIcon',\n name: 'mrfw-ftName',\n other: 'mrfw-ftOther',\n note: 'mrfw-ftNote',\n} as const\n\nexport default css\n","/**\n * The file tree's body, forked to a caller-supplied root: one additional\n * workspace root, listed one level at a time.\n *\n * Everything the tree keeps lives in its store, keyed by tab; everything it\n * asks for goes through its injected face. The component itself only decides\n * what to draw for each absolute path and what a click means: a directory\n * toggles, a file opens through the owner's open callback for a `file:`\n * viewer to claim, and anything else is shown but refuses to open.\n *\n * The rows below the exported shell are byte-identical to upstream's\n * `FilesBody.tsx`; the shell is the adaptation — upstream's version derives\n * the root from the session's `cwd`, takes its tab identity and lifetime from\n * `useTabInfo()`, opens resources through `tab.actions.openResource`, and\n * draws the header (PathLabel, auto-refresh, reload, actions slot) that this\n * plugin's switcher already owns. This fork takes all four as props and\n * draws only the body. See FORK.md.\n */\nimport { useEffect, useLayoutEffect, useRef } from 'react'\nimport type { ReactNode } from 'react'\nimport clsx from 'clsx'\nimport type { RemoteFailure } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { PropsLocale, PropsStore, TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport {\n FileTypeIcon, IconFolderCloseRegular, IconFolderOpenRegular, classifyFileType,\n} from './primitives.ts'\nimport { fileAddressFor } from '@deepseek-ai/dsh-util-workspace-path'\nimport type { WorkspaceDirectoryEntry } from '@deepseek-ai/dsh-api-workspace-files/types'\nimport { childPath } from './face.ts'\nimport type { FilesInjected } from './face.ts'\nimport type {} from './locales.ts'\nimport type { createFilesStore, FilesTabState } from './store.ts'\nimport css from './FilesBody.module.css.ts'\n\n/**\n * The fork's props: the store/locale shares verbatim from upstream's\n * composed props, `start`/`toggle` from the injected face, and the four\n * seams upstream binds inside `FilesBody` — tab id, lifetime, root, and the\n * resource-opening callback — supplied by the adapter instead.\n */\nexport type FilesTreeProps =\n & PropsStore<ReturnType<typeof createFilesStore>>\n & Pick<FilesInjected, 'start' | 'toggle'>\n & PropsLocale<'sidebarFiles'>\n & {\n /** The store bucket this tree reads and writes — the pane's own dockkit tab id. */\n readonly tabId: TabId\n /** Session the listing and the resource addresses belong to. */\n readonly sessionId: SessionId\n /** Absolute path of the root this tree lists (the selected additional root). */\n readonly root: string\n /** Takeover lifetime: aborting forgets the bucket and closes the watch tree. */\n readonly signal: AbortSignal\n /** Open one `dsh-resource://file` address (the adapter's sidebarRight route). */\n readonly onOpen: (address: string) => void\n }\n\n/** Natural, case-insensitive name order, so `file2` precedes `file10`. */\nconst byName = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' })\n\n/**\n * Order one level's entries for display: directories first, then everything\n * else, each group by name. The endpoint's order is a listing fact; this is the\n * reader's.\n * @param entries - the listing as the endpoint returned it.\n * @returns a new array, directories first, then by name within each group.\n */\nexport function orderEntries(entries: readonly WorkspaceDirectoryEntry[]): WorkspaceDirectoryEntry[] {\n return [...entries].sort((left, right) => {\n const group = Number(right.type === 'directory') - Number(left.type === 'directory')\n return group !== 0 ? group : byName.compare(left.name, right.name)\n })\n}\n\n/**\n * Say why a directory could not be listed, in terms of the directory.\n * @param t - namespace-bound translate.\n * @param failure - the settled Remote failure.\n * @returns the line to show under the directory.\n */\nexport function failureLine(t: TranslateNS<'sidebarFiles'>, failure: RemoteFailure): string {\n switch (failure.code) {\n case 'workspace-file/not-found': return t('error.notFound')\n case 'workspace-file/outside-workspace': return t('error.outsideWorkspace')\n case 'workspace-file/not-directory': return t('error.notDirectory')\n // Carrier and unclassified host failures reach the reader as themselves:\n // this tree knows nothing useful to add to a transport-level message.\n default: return t('error.unavailable', { message: failure.message })\n }\n}\n\n/** What every level shares: the tab's tree and the two gestures. */\ninterface TreeContext {\n readonly state: FilesTabState\n readonly onToggle: (parent: string, path: string) => void\n readonly onOpen: (path: string) => void\n readonly t: TranslateNS<'sidebarFiles'>\n}\n\n/** One entry's row, and its children when it is an expanded directory. */\nfunction Entry({ parent, entry, tree }: { parent: string; entry: WorkspaceDirectoryEntry; tree: TreeContext }): ReactNode {\n const path = childPath(parent, entry.name)\n if (entry.type === 'directory') {\n const expanded = tree.state.expanded.includes(path)\n return (\n <li className={css.item} data-files-entry=\"directory\" data-files-path={path}>\n <button type=\"button\" className={css.row} aria-expanded={expanded} onClick={() => { tree.onToggle(parent, path) }}>\n {expanded ? <IconFolderOpenRegular className={css.icon} /> : <IconFolderCloseRegular className={css.icon} />}\n <span className={css.name}>{entry.name}</span>\n </button>\n {expanded && <ul className={css.level}><Level path={path} tree={tree} /></ul>}\n </li>\n )\n }\n if (entry.type === 'file') {\n return (\n <li className={css.item} data-files-entry=\"file\" data-files-path={path}>\n <button type=\"button\" className={css.row} onClick={() => { tree.onOpen(path) }}>\n <FileTypeIcon kind={classifyFileType(entry.name)} size={16} className={css.fileIcon} />\n <span className={css.name}>{entry.name}</span>\n </button>\n </li>\n )\n }\n return (\n <li className={css.item} data-files-entry=\"other\" data-files-path={path}>\n <span className={clsx(css.row, css.other)} aria-disabled=\"true\" title={tree.t('entry.other')}>\n <span className={css.name}>{entry.name}</span>\n </span>\n </li>\n )\n}\n\n/** One directory's rows: its state while listing, its entries once listed. */\nfunction Level({ path, tree }: { path: string; tree: TreeContext }): ReactNode {\n const { state, t } = tree\n const level = state.levels[path]\n if (level === undefined || level.kind === 'loading') {\n return <li className={css.note} data-files-row=\"loading\">{t('loading')}</li>\n }\n if (level.kind === 'failed') {\n return (\n <li className={css.note} data-files-row=\"failed\" data-files-code={level.failure.code}>\n {failureLine(t, level.failure)}\n </li>\n )\n }\n const entries = orderEntries(level.level.entries)\n return (\n <>\n {level.failure !== undefined && <li className={css.note} data-files-row=\"failed\">{failureLine(t, level.failure)}</li>}\n {entries.length === 0 && <li className={css.note} data-files-row=\"empty\">{t('empty')}</li>}\n {entries.map(entry => <Entry key={entry.name} parent={path} entry={entry} tree={tree} />)}\n {level.level.truncated && <li className={css.note} data-files-row=\"truncated\">{t('truncated')}</li>}\n </>\n )\n}\n\n/**\n * The additional-root tree's body: the selected root and whatever the reader\n * has opened under it — the upstream body's scroll, seed, and render logic\n * verbatim, with the root arriving as a prop instead of `useSessions(cwd)`.\n */\nexport function FilesTree({\n tabId, sessionId, root, signal, useStore, actions, start, toggle, onOpen, t,\n}: FilesTreeProps): ReactNode {\n const state = useStore(store => store.byTab[tabId])\n const bodyRef = useRef<HTMLDivElement>(null)\n const scrollTopRef = useRef(0)\n // Come back where the reader was: loaded levels outlive the body in the\n // store, so a remounted tree lays out at its full height before this runs\n // and the stored offset re-lands exactly. A fresh tree stores 0.\n const seeded = state !== undefined\n useLayoutEffect(() => {\n const body = bodyRef.current\n if (seeded && body !== null) {\n body.scrollTop = state.scrollTop\n scrollTopRef.current = body.scrollTop\n }\n }, [seeded])\n // Scrolling only moves the ref; the store hears about it once, on unmount,\n // so a scroll neither re-renders the tree nor writes after the owner's\n // abort has forgotten the bucket.\n useEffect(() => () => {\n if (seeded && !signal.aborted) actions.scrolled(tabId, scrollTopRef.current)\n }, [seeded, signal, tabId, actions])\n useEffect(() => {\n // A bucket gone because the record aborted must not be re-seeded by a\n // component that has not unmounted yet.\n if (state !== undefined || signal.aborted) return\n start(tabId, root, signal)\n }, [state, root, tabId, signal, start])\n\n if (state === undefined) return null\n const tree: TreeContext = {\n state,\n onToggle: (parent, path) => { toggle(tabId, parent, path, state.expanded, signal) },\n // Every row carries an absolute path; the address leaves cwd undefined so\n // the host resolves the file as written — a cwd here would relativize it\n // against the session's primary root and open the wrong file.\n onOpen: (path) => { onOpen(fileAddressFor(sessionId, undefined, path)) },\n t,\n }\n return (\n <div\n ref={bodyRef}\n className={css.body}\n onScroll={(event) => { scrollTopRef.current = event.currentTarget.scrollTop }}\n >\n <ul className={css.level}><Level path={state.root} tree={tree} /></ul>\n </div>\n )\n}\n","/**\n * The plugin-owned wiring around the verbatim files-tree fork.\n *\n * Upstream wires its store and face inside `apply` over `ctx.remote`, and the\n * slot framework resolves the session and hands the face its bound actions.\n * This plugin registers onto `sidebar.right.tab.files.actions` — a\n * session-scoped list slot — so the same `store`/`inject` declaration gives\n * the fork the same props; what differs is only *which* remote and *which*\n * open-route the fork sees:\n *\n * - `remote` is an optional service here (upstream injects it unconditionally),\n * so {@link lazyFilesRemote} resolves `remote` / `remote.workspaceFiles` per\n * call through `ctx.get` — the inject-free lookup, since a declaration would\n * gate this whole row on an optional service — and folds absence into the\n * same `gateway/internal` failure a carrier error would produce;\n * - opening a file goes through `sidebarRight.openResourceIn`, bound with the\n * session inside the `inject` factory so the component never resolves one;\n * - the primitives the forked rows spell are runtime-probed (pixel-era\n * manifests lack the `*Regular` names), and the gate's `false` means the\n * caller simply never mounts the tree — upstream's own absence shape.\n *\n * Everything here is ours; nothing in this file needs upstream sync.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/files-tree/adapter\n */\n\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type { ClientRemote } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { BoundActions } from '@deepseek-ai/dsh-client-store'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport { RemoteError, type RemoteFailure } from '@deepseek-ai/dsh-typert-protocol'\nimport { createList, createWatch, filesFace, type FilesInjected } from './face.ts'\nimport { createFilesStore } from './store.ts'\nimport { filesTreeSurfaceSupported } from './primitives.ts'\nimport type { FilesTreeProps } from './FilesTree.tsx'\nimport { NS } from './locales.ts'\n\n/** The `sidebarRight` face the fork uses to open a file resource. */\ninterface SidebarRightOpen {\n readonly openResourceIn?: (sessionId: SessionId, address: string) => void\n}\n\n/** The inject face the registration composes onto the occupant's props. */\nexport interface FilesTreeInjected {\n /** The verbatim files face (list/watch bookkeeping included). */\n readonly face: FilesInjected\n /** Open one `dsh-resource://file` address in the host viewer. */\n readonly openFile: (address: string) => void\n}\n\n/** Everything `FilesTree` needs that the slot framework does not synthesize. */\nexport interface FilesTreeSurface {\n readonly sessionId: SessionId\n readonly useStore: FilesTreeProps['useStore']\n readonly actions: FilesTreeProps['actions']\n readonly face: FilesInjected\n readonly openFile: (address: string) => void\n readonly t: FilesTreeProps['t']\n}\n\n/** The failure every lazy-remote path reports when the carrier is absent. */\nconst unavailable = (): RemoteError<'gateway/internal'> =>\n new RemoteError('gateway/internal', 'the remote service is not available in this composition', {})\n\n/**\n * Fold an unexpected exception into the Remote failure a dead carrier would\n * produce. A generated Remote call cannot reject — but the lazy indirection\n * can (a `remote` whose `workspaceFiles` namespace is not mounted leaves\n * `.list` throwing a TypeError). The verbatim `load` awaits `list` through\n * `.then` without `.catch`, so an escaped rejection would die inside\n * `DirectoryNode.task` and pin the level at `loading` forever; folding it\n * here keeps the failure a settled Remote result — the visible failure row.\n */\nconst failureOf = (error: unknown): RemoteFailure =>\n typeof error === 'object' && error !== null && 'code' in error\n ? error as RemoteFailure\n : new RemoteError('gateway/internal', error instanceof Error ? error.message : String(error), {})\n\n/** An AsyncIterable whose first read throws the absent-carrier failure. */\nconst deadStream = (error: unknown = unavailable()): AsyncIterable<never> & { dispose(): Promise<void> } => ({\n [Symbol.asyncIterator]: () => ({ next: () => Promise.reject(failureOf(error)) }),\n dispose: () => Promise.resolve(),\n})\n\n/**\n * A `ClientRemote` stand-in that resolves the real service per call.\n *\n * The verbatim `createList`/`createWatch` hold one remote face for the\n * session's life; resolving lazily keeps the fork correct on compositions\n * that acquire `remote` after this plugin activates, and a composition that\n * never acquires it still answers every call — with the same failure kind a\n * dead carrier returns — instead of crashing the slot. Every method upholds\n * the Remote contract the face relies on: `list` resolves a `RemoteResult`\n * and never rejects; `changes`/`$stream` surface synchronous lookup failures\n * through the stream's own failure path.\n */\nexport function lazyFilesRemote(ctx: ClientContext): ClientRemote {\n const get = (name: string): unknown =>\n (ctx as unknown as { get(key: string): unknown }).get(name)\n // `remote.workspaceFiles` is a *nested service*, so `remote.workspaceFiles`\n // on the traceable resolves through the inject-guarded context proxy and\n // throws \"without inject\" for any fiber that never declared it — which no\n // fiber of ours may do, since this cordis treats every inject entry as\n // required and a declaration would gate the whole row on an optional\n // service. `ctx.get` reads the service store with no inject requirement —\n // exactly the lazy-optional semantics this adapter exists for.\n const namespace = (): ClientRemote['workspaceFiles'] | undefined =>\n get('remote.workspaceFiles') as ClientRemote['workspaceFiles'] | undefined\n return {\n workspaceFiles: {\n list: (sessionId: SessionId, path: string, signal?: AbortSignal) => {\n try {\n const ns = namespace()\n if (ns === undefined) return Promise.resolve({ ok: false as const, error: unavailable() })\n return Promise.resolve(ns.list(sessionId, path, signal))\n .catch((error: unknown) => ({ ok: false as const, error: failureOf(error) }))\n } catch (error) {\n return Promise.resolve({ ok: false as const, error: failureOf(error) })\n }\n },\n changes: (sessionId: SessionId, path: string, signal?: AbortSignal) => {\n try {\n const ns = namespace()\n return ns === undefined ? deadStream() : ns.changes(sessionId, path, signal)\n } catch (error) {\n return deadStream(error)\n }\n },\n },\n $stream: ((options: Parameters<ClientRemote['$stream']>[0]) => {\n try {\n const remote = get('remote') as ClientRemote | undefined\n return remote === undefined ? deadStream() : remote.$stream(options)\n } catch (error) {\n return deadStream(error)\n }\n }) as ClientRemote['$stream'],\n } as unknown as ClientRemote\n}\n\n/**\n * The registration's `store`/`inject` declarations, built once in `apply`.\n *\n * The inject face nests the verbatim files face under `face` and adds the\n * session-bound `openFile` — keeping `FilesInjected` untouched means the\n * fork's call sites and the sync diff stay upstream-shaped.\n * @param ctx - the client root context (the remote/sidebarRight lookups).\n * @returns the store handle and the inject factory for `register`.\n */\nexport function createFilesTreeSeats(ctx: ClientContext): {\n readonly store: ReturnType<typeof createFilesStore>\n readonly inject: (sessionId: SessionId, actions: BoundActions<ReturnType<typeof createFilesStore>>) => FilesTreeInjected\n} {\n const store = createFilesStore()\n const remote = lazyFilesRemote(ctx)\n const face = filesFace(createList(remote), createWatch(remote))\n const inject = (sessionId: SessionId, actions: BoundActions<ReturnType<typeof createFilesStore>>): FilesTreeInjected => ({\n face: face(sessionId, actions),\n openFile: (address: string) => {\n const sidebar = (ctx as unknown as { get(key: string): unknown }).get('sidebarRight') as SidebarRightOpen | undefined\n sidebar?.openResourceIn?.(sessionId, address)\n },\n })\n return { store, inject }\n}\n\n/**\n * Assemble the props `RootSwitcher` portals into `FilesTree`, or `undefined`\n * when this composition cannot render the fork — the caller then keeps the\n * additional-root rows out of the menu entirely, which is the same absence\n * upstream produces when its own tree cannot draw.\n * @param props - the occupant's composed props (store, inject, session shares).\n * @param t - the `sidebarFiles`-bound translate.\n * @returns the stable surface, or `undefined` when the fork cannot mount.\n */\nexport function createFilesTreeSurface(\n props: {\n readonly sessionId: SessionId\n readonly useStore: FilesTreeSurface['useStore']\n readonly actions: FilesTreeSurface['actions']\n readonly face: FilesInjected | undefined\n readonly openFile: ((address: string) => void) | undefined\n },\n t: FilesTreeProps['t'],\n): FilesTreeSurface | undefined {\n if (!filesTreeSurfaceSupported()) return undefined\n const { sessionId, useStore, actions, face, openFile } = props\n if (face === undefined || openFile === undefined || useStore === undefined || actions === undefined) return undefined\n return { sessionId, useStore, actions, face, openFile, t }\n}\n\nexport { filesTreeSurfaceSupported, NS as FILES_TREE_NS }\nexport { FilesTree } from './FilesTree.tsx'\n","/**\n * Route paths and wire payloads shared verbatim by the host routes and the\n * browser package (`@deepseek-ai/dsh-client-ui-open-in-app`), published as\n * the `./shared` subpath. Browser-safe: constants and types only. Each route\n * carries the absolute pathname the Host registers beside the\n * document-relative form the browser addresses; see\n * .agents/notes/implemented/architecture/2026-09-14-web-document-relative-app-routes.md.\n */\n/** GET route path serving the probed application ids. */\nexport const OPEN_IN_APP_APPS_PATH = '/open-in-app/apps';\n/** Browser-relative form of {@link OPEN_IN_APP_APPS_PATH}. */\nexport const OPEN_IN_APP_APPS_ROUTE = OPEN_IN_APP_APPS_PATH.slice(1);\n/** GET prefix path serving one PNG bundle icon per application id. */\nexport const OPEN_IN_APP_ICON_PREFIX_PATH = '/open-in-app/icon';\n/** Browser-relative form of {@link OPEN_IN_APP_ICON_PREFIX_PATH}. */\nexport const OPEN_IN_APP_ICON_PREFIX_ROUTE = OPEN_IN_APP_ICON_PREFIX_PATH.slice(1);\n/** POST route path launching one application on one workspace directory. */\nexport const OPEN_IN_APP_OPEN_PATH = '/open-in-app/open';\n/** Browser-relative form of {@link OPEN_IN_APP_OPEN_PATH}. */\nexport const OPEN_IN_APP_OPEN_ROUTE = OPEN_IN_APP_OPEN_PATH.slice(1);\n//# sourceMappingURL=shared.js.map","/**\n * Compatibility adapter for the route constants of\n * `@deepseek-ai/dsh-host-open-in-app/shared`.\n *\n * ```text\n * 0.1.5-rc.2 / 0.1.6 OPEN_IN_APP_ICON_PREFIX = '/open-in-app/icon' (absolute pathname)\n * 0.1.7-alpha.1 + OPEN_IN_APP_ICON_PREFIX_ROUTE = 'open-in-app/icon' (document-relative)\n * ```\n *\n * `0.1.7-alpha.1` split every shared route constant into a `*_PATH` spelling\n * the Host registers and a `*_ROUTE` spelling the browser addresses, retiring\n * the old names. The fork's `iconUrl` needs the browser-facing form — which a\n * pixel-era release spells without the `_ROUTE` suffix, so a named import of\n * the new name does not even BUILD against those manifests (MISSING_EXPORT at\n * bundle time, not a runtime undefined). The lookup is by export name, not by\n * release string.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/compat/open-in-app-routes\n */\n\nimport * as shared from '@deepseek-ai/dsh-host-open-in-app/shared'\n\n/** Exports addressed by name. A release spells each route exactly one way. */\ntype SharedModule = Readonly<Record<string, string | undefined>>\n\n/**\n * The installed shared module, addressed by export name.\n *\n * Named imports cannot spell both eras: each name is absent from the other\n * era's declaration, so the compiler is told once, here.\n */\nconst installed = shared as unknown as SharedModule\n\n/**\n * Pick the first export name this release actually provides.\n * @param module - the shared module to read.\n * @param names - candidate export names, preferred first.\n * @returns the route string.\n * @throws {Error} when none of the names is exported. That is a compatibility\n * break to adapt here, not a missing optional peer.\n */\nexport function selectSharedRoute(module: SharedModule, names: readonly string[]): string {\n for (const name of names) {\n const found = module[name]\n if (found !== undefined) return found\n }\n throw new Error(\n 'multi-root workspace: @deepseek-ai/dsh-host-open-in-app/shared exports none of '\n + `${names.join(', ')}; the open-in-app fork cannot address its icon route. `\n + 'Adapt src/compat/open-in-app-routes.ts to the installed release.',\n )\n}\n\n/**\n * The browser-facing icon-prefix route, whichever spelling this release\n * exports. Resolved once at module load: the fork's adapter only reaches\n * `iconUrl` on runtimes whose glyph gate already passed, and on the pixel era\n * the absolute form is exactly what upstream's own client fetched.\n */\nexport const OPEN_IN_APP_ICON_URL_PREFIX = selectSharedRoute(installed, [\n 'OPEN_IN_APP_ICON_PREFIX_ROUTE',\n 'OPEN_IN_APP_ICON_PREFIX',\n])\n","/** Nameable application ids shared by the button and its keyboard command. */\nimport type { OpenInAppKey } from './locales.ts'\n\n/** Label keys for applications supported by this client. */\nexport const APP_LABEL_KEY: Record<string, OpenInAppKey | undefined> = {\n finder: 'app.finder',\n explorer: 'app.explorer',\n filemanager: 'app.filemanager',\n cursor: 'app.cursor',\n vscode: 'app.vscode',\n vscodeinsiders: 'app.vscodeinsiders',\n windsurf: 'app.windsurf',\n zed: 'app.zed',\n sublimetext: 'app.sublimetext',\n xcode: 'app.xcode',\n androidstudio: 'app.androidstudio',\n intellij: 'app.intellij',\n pycharm: 'app.pycharm',\n webstorm: 'app.webstorm',\n phpstorm: 'app.phpstorm',\n goland: 'app.goland',\n rider: 'app.rider',\n rustrover: 'app.rustrover',\n fork: 'app.fork',\n sourcetree: 'app.sourcetree',\n github: 'app.github',\n tower: 'app.tower',\n gitkraken: 'app.gitkraken',\n smartgit: 'app.smartgit',\n sublimemerge: 'app.sublimemerge',\n ghostty: 'app.ghostty',\n warp: 'app.warp',\n iterm: 'app.iterm',\n kitty: 'app.kitty',\n terminal: 'app.terminal',\n windowsterminal: 'app.windowsterminal',\n gitbash: 'app.gitbash',\n gnometerminal: 'app.gnometerminal',\n konsole: 'app.konsole',\n}\n","/** Browser availability/choice state and the launch carrier for the split button. */\n\nimport { createSnapshotStore, type SnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport {\n OPEN_IN_APP_APPS_ROUTE, OPEN_IN_APP_OPEN_ROUTE,\n type OpenInAppAppsPayload, type OpenInAppOpenPayload,\n} from '@deepseek-ai/dsh-host-open-in-app/shared'\n\nimport { APP_LABEL_KEY } from './applications.ts'\nimport type { OpenInAppOutcome } from './outcome.ts'\n\n/** Shared launch status for controls targeting the captured workspace path. */\nexport interface OpenInAppLaunchState {\n readonly phase: 'idle' | 'busy' | 'error'\n readonly path: string | null\n}\n\ntype Fetch = (input: string | URL, init?: RequestInit) => Promise<Response>\n\n/**\n * Owns the once-per-page availability read, the persisted last choice, and\n * the launch POST. Availability and choice publish through uSES-safe sources\n * so every Session header shares one truth.\n */\nexport class OpenInAppController {\n /** Installed app ids in host menu order; null until the host answered. */\n readonly apps: SnapshotStore<readonly string[] | null> = createSnapshotStore<readonly string[] | null>(null)\n /** Last chosen app id, or empty before the first choice, shared across sessions and browser restarts. */\n readonly choice: SnapshotStore<string> = createSnapshotStore<string>('', {\n persist: { name: 'dsh.open-in-app.choice' },\n })\n\n /** Current launch, shared by pointer and keyboard gestures. */\n readonly operation = createSnapshotStore<OpenInAppLaunchState>({ phase: 'idle', path: null })\n\n /**\n * Resolve the remembered nameable installed application, with the button's first-app fallback.\n * @returns the installed app id, or undefined while unavailable.\n */\n currentApp(): string | undefined {\n const apps = (this.apps.getSnapshot() ?? []).filter(id => APP_LABEL_KEY[id] !== undefined)\n const choice = this.choice.getSnapshot()\n return apps.includes(choice) ? choice : apps[0]\n }\n\n private loading: Promise<void> | undefined\n\n /**\n * @param fetcher - HTTP carrier for the apps read and the launch POST.\n */\n constructor(private readonly fetcher: Fetch = (input, init) => fetch(input, init)) {}\n\n /**\n * Read availability once per controller life; concurrent calls share the read.\n * A failed read publishes an empty list, which renders no button at all.\n * @returns after availability is published.\n */\n load(): Promise<void> {\n this.loading ??= this.run()\n return this.loading\n }\n\n /**\n * Remember one picked app id.\n * @param appId - catalog id from the availability list.\n */\n choose(appId: string): void {\n if (this.operation.getSnapshot().phase !== 'busy') this.choice.set(appId)\n }\n\n /**\n * Launch one installed app on a workspace directory.\n * @param appId - catalog id from the availability list.\n * @param path - the session's absolute workspace directory.\n * Concurrent gestures are ignored until the current Host request settles.\n * @returns the acknowledged handoff, or `{ kind: 'skipped' }` while another\n * launch holds the operation, or a named failure when the Host refuses or\n * cannot be reached. Host and transport failures resolve without rejecting.\n */\n async launch(appId: string, path: string): Promise<OpenInAppOutcome> {\n if (this.operation.getSnapshot().phase === 'busy') return { kind: 'skipped' }\n this.operation.set({ phase: 'busy', path })\n const body: OpenInAppOpenPayload = { app: appId, path }\n try {\n const response = await this.fetcher(OPEN_IN_APP_OPEN_ROUTE, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(body),\n })\n if (!response.ok) throw new Error(`open failed: HTTP ${String(response.status)}`)\n this.operation.set({ phase: 'idle', path })\n return { kind: 'opened' }\n } catch (_error) {\n // Refusal and transport failure share the same user-visible outcome.\n this.operation.set({ phase: 'error', path })\n return { kind: 'failed', failure: 'openError' }\n }\n }\n\n private async run(): Promise<void> {\n let apps: readonly string[] = []\n try {\n const response = await this.fetcher(OPEN_IN_APP_APPS_ROUTE, {\n headers: { accept: 'application/json' },\n })\n if (response.ok) {\n const payload = await response.json() as OpenInAppAppsPayload\n if (Array.isArray(payload.apps)) apps = payload.apps.filter(id => typeof id === 'string')\n }\n } catch {\n // Swallows network failures: an unreachable host reads as no apps, and\n // the header simply shows no button rather than a broken one.\n }\n this.apps.set(apps)\n }\n}\n","/**\n * Fork-facing shim for upstream `ui-open-in-app/src/client/locales.ts`.\n *\n * Upstream's dictionaries stay upstream's: the runtime `open-in-app`\n * namespace is already registered by `@deepseek-ai/dsh-client-ui-open-in-app`\n * in every composition where the open-in-app feature exists, and this\n * plugin binds that same namespace instead of registering a second copy\n * (`locale.register` throws on a duplicate locale inside one namespace).\n * What the forked components still need from this file is the namespace\n * name and the key domain for `TranslateNS<typeof NS>` — copied verbatim\n * from upstream. When upstream edits copy, the string values follow\n * automatically; only a NEW key requires extending the union below.\n *\n * Sync: `OpenInAppKey` must equal `keyof typeof zh` in upstream's\n * `locales.ts`. See FORK.md.\n */\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\n\n/** Dictionary namespace owned by upstream's plugin (verbatim). */\nexport const NS = 'open-in-app'\n\n/** Key domain of the `open-in-app` namespace (verbatim union of upstream's zh keys). */\nexport type OpenInAppKey =\n | 'open.title'\n | 'path.appDefault'\n | 'path.appsError'\n | 'shortcut.busy'\n | 'shortcut.unavailable'\n | 'open.tooltip'\n | 'path.open'\n | 'path.more'\n | 'path.reveal'\n | 'path.opened'\n | 'path.revealed'\n | 'path.openError'\n | 'path.revealError'\n | 'app.cursor'\n | 'app.vscode'\n | 'app.vscodeinsiders'\n | 'app.windsurf'\n | 'app.zed'\n | 'app.sublimetext'\n | 'app.xcode'\n | 'app.androidstudio'\n | 'app.intellij'\n | 'app.pycharm'\n | 'app.webstorm'\n | 'app.phpstorm'\n | 'app.goland'\n | 'app.rider'\n | 'app.rustrover'\n | 'app.fork'\n | 'app.sourcetree'\n | 'app.github'\n | 'app.tower'\n | 'app.gitkraken'\n | 'app.smartgit'\n | 'app.sublimemerge'\n | 'app.ghostty'\n | 'app.warp'\n | 'app.iterm'\n | 'app.kitty'\n | 'app.terminal'\n | 'app.windowsterminal'\n | 'app.gitbash'\n | 'app.gnometerminal'\n | 'app.konsole'\n | 'app.finder'\n | 'app.explorer'\n | 'app.filemanager'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Session-header \"open workspace in application\" copy (upstream declaration). */\n 'open-in-app': OpenInAppKey\n }\n}\n","/**\n * Fork-facing shim for upstream `OpenTargetButton.module.css`.\n *\n * This plugin's bundle has no CSS-module pipeline: the `<style>` element it\n * installs carries one flat sheet (`src/client/styles.ts`). The upstream\n * component reads `css.<name>` so the forked file needs one importable\n * module exporting that same key map — this file, reached through the\n * verbatim `./OpenTargetButton.module.css.ts` specifier (the one sanctioned\n * fork edit: the specifier gains the `.ts` this toolchain resolves\n * everywhere — tsc, tsdown, vitest). The specifier text is spelled without\n * its `import` clause on purpose: the packed-artifact check scans every\n * bundle comment too, and quoting the full statement would read as a\n * relative import the tarball does not carry.\n *\n * Each upstream local class maps to an `mrfw-open*` name so the copied\n * rules cannot collide with host DOM; the rules themselves live in\n * styles.ts verbatim apart from that rename. `data-open-target` and the\n * other data attributes are literals in the component and stay byte-exact.\n * See FORK.md.\n */\n\nconst css = {\n menuAnchor: 'mrfw-openMenuAnchor',\n split: 'mrfw-openSplit',\n main: 'mrfw-openMain',\n chevron: 'mrfw-openChevron',\n appIcon: 'mrfw-openAppIcon',\n skeleton: 'mrfw-openSkeleton',\n} as const\n\nexport default css\n","/** Shared file and directory opener: one default action, application menu, and one reported outcome per gesture. */\nimport { useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport {\n IconChevronDownOutlineRegular, IconFolderOpenOutlineRegular, IconRightUpOutlineRegular, Menu, Tooltip,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ShortcutCatalogEntry } from '@deepseek-ai/dsh-client-shortcuts/client'\nimport type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { OpenInAppOutcome } from './outcome.ts'\nimport type { NS } from './locales.ts'\nimport css from './OpenTargetButton.module.css.ts'\n\n/** Application metadata supplied by either the directory catalog or a file association query. */\nexport interface OpenTargetApplication {\n readonly id: string\n readonly name: string\n readonly icon: string | null\n}\n\n/** Opening intent; default selection remains owned by the target's adapter. */\nexport type OpenTargetOperation = { readonly kind: 'default' } | { readonly kind: 'application'; readonly id: string } | { readonly kind: 'reveal' }\n\n/** Seat a contribution sends one settled gesture to for app-wide announcement. */\nexport interface OpenTargetReporter {\n /** Report the settled outcome; `{ kind: 'skipped' }` announces nothing. */\n readonly report: (outcome: OpenInAppOutcome) => void\n}\n\n/** Inputs shared by both target adapters and the file empty-state action. */\nexport interface OpenTargetButtonProps extends OpenTargetReporter {\n readonly shortcut?: Pick<ShortcutCatalogEntry, 'keys' | 'aria'> | undefined\n readonly kind: 'file' | 'directory'\n readonly applications: readonly OpenTargetApplication[]\n readonly defaultId: string | undefined\n readonly failed: boolean\n readonly busy?: boolean\n readonly loading?: boolean\n readonly prominent?: boolean\n readonly t: TranslateNS<typeof NS>\n /** Resolve every gesture to an outcome, including Host and transport failures; never reject. */\n readonly execute: (operation: OpenTargetOperation) => Promise<OpenInAppOutcome>\n readonly refresh?: () => void\n}\n\n/**\n * Serialize gestures and report the outcome each one settles on to the app-wide\n * announcer, which outlives this control and the panel holding it.\n * @param execute - target adapter that settles on the gesture's outcome.\n * @param report - announcement seat the settled outcome is sent to.\n * @returns the pending state and the guarded action callback.\n */\nexport function useOpenTargetGesture(\n execute: OpenTargetButtonProps['execute'], report: OpenTargetButtonProps['report'],\n): {\n pending: boolean\n act: (operation: OpenTargetOperation) => void\n} {\n const [pending, setPending] = useState(false)\n const inFlight = useRef(false)\n return {\n pending,\n act: (operation) => {\n if (inFlight.current) return\n inFlight.current = true\n setPending(true)\n void execute(operation).then(report).finally(() => { inFlight.current = false; setPending(false) })\n },\n }\n}\n\n/** One application image with a per-image fallback, shared by main and menu buttons. */\nfunction ApplicationIcon({ source, size = 14 }: { source: string | null; size?: number }): ReactNode {\n const [failed, setFailed] = useState(false)\n return source === null || failed\n ? <IconRightUpOutlineRegular size={size} />\n : <img src={source} width={size} height={size} className={css.appIcon} alt=\"\" draggable={false} onError={() => { setFailed(true) }} />\n}\n\n/**\n * Render identical split buttons for files and directories. File reveal always\n * stays last; it is the default only when no application is registered.\n * @param props - target applications, default selection, and operations.\n * @returns the control alone: its settled outcomes are announced by the seat it reports to.\n */\nexport function OpenTargetButton(props: OpenTargetButtonProps): ReactNode {\n const { applications, defaultId, kind, t } = props\n const [menuOpen, setMenuOpen] = useState(false)\n const { pending, act } = useOpenTargetGesture(props.execute, props.report)\n // Files open through an application whenever one is registered: the OS-marked\n // default when the Host reported one, else the first entry in the Shell's\n // preference order. Reveal is only promoted with no registered application, so\n // a missing default marker never hides the applications behind it.\n const preferred = kind === 'file'\n ? applications.find(app => app.id === defaultId) ?? applications[0]\n : applications.find(app => app.id === defaultId)\n const disabled = pending || props.busy === true || props.loading === true\n const hasMenu = props.loading === true || props.failed || applications.length + (kind === 'file' ? 1 : 0) > 1\n const revealDefault = kind === 'file' && preferred === undefined && props.loading !== true\n const primaryLabel = preferred === undefined ? t('path.reveal') : t('open.title', { app: preferred.name })\n const run = (operation: OpenTargetOperation): void => { setMenuOpen(false); act(operation) }\n const primary = (): void => {\n if (revealDefault) { run({ kind: 'reveal' }); return }\n // The Host's default marker is best effort. With none, request the application\n // this control names instead of letting the OS resolve the association again.\n if (preferred !== undefined && preferred.id !== defaultId) { run({ kind: 'application', id: preferred.id }); return }\n run({ kind: 'default' })\n }\n const icon = props.loading === true && preferred === undefined\n ? <span className={css.skeleton} data-open-target-skeleton aria-hidden=\"true\" style={{ width: props.prominent ? 18 : 13, height: props.prominent ? 18 : 13 }} />\n : revealDefault\n ? <IconFolderOpenOutlineRegular size={props.prominent ? 18 : 13} />\n : <ApplicationIcon key={preferred?.icon} source={preferred?.icon ?? null} size={props.prominent ? 18 : 13} />\n return (\n <Menu\n className={css.menuAnchor}\n open={menuOpen && !disabled && hasMenu}\n autoFocus\n portal\n dense\n align=\"end\"\n onClose={() => { setMenuOpen(false) }}\n items={[\n ...applications.map(app => ({\n id: `app:${app.id}`,\n icon: <ApplicationIcon key={app.icon} source={app.icon} />,\n label: app.id === preferred?.id ? t('path.appDefault', { app: app.name }) : app.name,\n })),\n ...(props.failed ? [{ id: 'unavailable', label: t('path.appsError'), disabled: true }] : []),\n ]}\n footer={kind === 'file' ? [{\n id: 'reveal', icon: <IconFolderOpenOutlineRegular />,\n label: revealDefault ? t('path.appDefault', { app: t('path.reveal') }) : t('path.reveal'),\n }] : []}\n onSelect={(id) => { run(id === 'reveal' ? { kind: 'reveal' } : { kind: 'application', id: id.slice(4) }) }}\n anchor={(\n <div className={css.split} data-open-target={kind} data-size={props.prominent ? 'large' : 'compact'}\n data-open-path={kind === 'file' && !props.prominent ? '' : undefined} data-state={disabled ? 'busy' : 'idle'}>\n <Tooltip portal label={primaryLabel} shortcutKeys={props.shortcut?.keys} side=\"bottom\" delayMs={500}>\n <button type=\"button\" className={css.main} disabled={disabled} aria-label={props.prominent ? undefined : primaryLabel}\n aria-keyshortcuts={props.shortcut?.aria}\n data-open-path-open={kind === 'file' && !props.prominent ? '' : undefined}\n data-open-path-unpreviewable={props.prominent ? '' : undefined} onClick={primary}>\n {icon}{(props.prominent) && (revealDefault ? t('path.reveal') : t('path.open'))}\n </button>\n </Tooltip>\n {hasMenu && <button\n type=\"button\" className={css.chevron} disabled={disabled}\n aria-haspopup=\"menu\" aria-expanded={menuOpen && !disabled} aria-label={t('path.more')}\n data-open-path-more={kind === 'file' && !props.prominent ? '' : undefined}\n onClick={() => {\n if (!menuOpen) props.refresh?.()\n setMenuOpen(value => !value)\n }}\n >\n <IconChevronDownOutlineRegular size={props.prominent ? 14 : 10} />\n </button>}\n </div>\n )}\n />\n )\n}\n","import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport { APP_LABEL_KEY } from './applications.ts'\nimport type { OpenInAppLaunchState } from './controller.ts'\nimport type { OpenInAppOutcome } from './outcome.ts'\nimport type { ShortcutCatalogEntry } from '@deepseek-ai/dsh-client-shortcuts/client'\nimport { NS } from './locales.ts'\nimport { OpenTargetButton, type OpenTargetReporter } from './OpenTargetButton.tsx'\n\n/** Browser operations and state shared by the Session header and file tree contributions. */\nexport interface OpenInAppActionInjected extends OpenTargetReporter {\n hooks: {\n openInAppApps: ObservableSnapshot<readonly string[] | null>\n openInAppChoice: ObservableSnapshot<string>\n openInAppLaunch: ObservableSnapshot<OpenInAppLaunchState>\n shortcuts: ObservableSnapshot<readonly ShortcutCatalogEntry[]>\n }\n launch: (appId: string, path: string) => Promise<OpenInAppOutcome>\n choose: (appId: string) => void\n iconUrl: (appId: string) => string\n}\n\n/** Directory path, installed applications, and launch operations for the split button. */\nexport type OpenInAppActionProps =\n PropsLocale<typeof NS>\n & InjectFace<OpenInAppActionInjected>\n & { absolutePath: string }\n\n/**\n * Adapt the installed directory catalog to the shared opening control.\n * @param props - displayed directory, installed catalog, launch operations, and the announcement seat.\n * @returns the shared control, or null without an eligible application.\n */\nexport function OpenInAppAction(props: OpenInAppActionProps): React.JSX.Element | null {\n const { absolutePath, useOpenInAppApps, useOpenInAppChoice, t } = props\n const available = useOpenInAppApps(apps => apps)\n const choice = useOpenInAppChoice(id => id)\n const operation = props.useOpenInAppLaunch(value => value)\n const shortcut = props.useShortcuts(rows => rows.find(row => row.id === 'workspace.openLocal'))\n const apps = (available ?? []).flatMap((id) => {\n const key = APP_LABEL_KEY[id]\n return key === undefined ? [] : [{ id, name: t(key), icon: props.iconUrl(id) }]\n })\n const preferred = apps.find(app => app.id === choice) ?? apps[0]\n if (preferred === undefined) return null\n return (\n <OpenTargetButton\n key={absolutePath} kind=\"directory\" applications={apps} defaultId={preferred.id} failed={false} t={t}\n busy={operation.phase === 'busy'} shortcut={shortcut} report={props.report}\n execute={async (operation) => {\n const id = operation.kind === 'application' ? operation.id : preferred.id\n const outcome = await props.launch(id, absolutePath)\n if (outcome.kind === 'opened' && operation.kind === 'application') props.choose(id)\n return outcome\n }}\n />\n )\n}\n","/**\n * Compatibility adapter for `isMobileDevice` from\n * `@deepseek-ai/dsh-client-ui-primitives`.\n *\n * ```text\n * 0.1.5-rc.2 through 0.2.1-rc.5 no `isMobileDevice` export\n * 0.2.2-alpha.2 + `isMobileDevice` exported\n * ```\n *\n * The open-in-app fork's verbatim `open-toast.tsx` spells the detector as a\n * primitives import — a name absent before `0.2.2-alpha.2` — so the lookup\n * is by export name, not by release string (the `client-icons.ts` pattern).\n * An older runtime falls back to upstream's identical detection: mobile\n * userAgent, or a touch-capable MacIntel platform, memoized like upstream's.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/compat/open-in-app-device\n */\n\nimport * as primitives from '@deepseek-ai/dsh-client-ui-primitives'\n\n/**\n * The DOM `navigator`, declared at module scope so this file still\n * typechecks under `tsconfig.host.json`, which compiles every `src/compat/`\n * file with no DOM lib. Module-scoped and type-only: it emits nothing, and\n * at run time the name resolves to the real global.\n */\ndeclare const navigator: {\n readonly userAgent: string\n readonly platform: string\n readonly maxTouchPoints: number\n}\n\n/** The primitives module, addressed by export name. */\nconst installed = primitives as unknown as { readonly isMobileDevice?: unknown }\n\n/** Upstream's own detector when the installed release carries it (verbatim logic below otherwise). */\nconst upstream = typeof installed.isMobileDevice === 'function'\n ? installed.isMobileDevice as () => boolean\n : undefined\n\nlet fallbackResult: boolean | undefined\n\n/**\n * Whether this browser is a mobile device — upstream's detection verbatim.\n * @returns true for a mobile userAgent or a touch-capable macOS surface.\n */\nfunction isMobileDeviceFallback(): boolean {\n fallbackResult ??= /Android|iPhone|iPad|iPod/i.test(navigator.userAgent)\n || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)\n return fallbackResult\n}\n\n/**\n * Resolve the installed release's `isMobileDevice`, or the identical local\n * fallback on releases that predate the export.\n * @returns the mobile-device verdict.\n */\nexport function isMobileDevice(): boolean {\n return upstream === undefined ? isMobileDeviceFallback() : upstream()\n}\n","/** Native-open feedback that survives the initiating panel: mobile success and all failures. */\nimport type { ReactNode } from 'react'\nimport { createSnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport { IconWarningOutlineRegular, Toast } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { HostObservable, InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { isMobileDevice } from './device.ts'\nimport { NS } from './locales.ts'\nimport type { OpenInAppOutcome } from './outcome.ts'\n\n/** One announced gesture; `seq` keys the banner so a repeat restarts it. */\nexport type OpenInAppToastState = Exclude<OpenInAppOutcome, { kind: 'skipped' }> & { readonly seq: number }\n\n/** Store every contribution reports into and the overlay entry reads. */\nexport interface OpenInAppToastSource {\n /** Current notice for the overlay entry, or null while none shows. */\n readonly hooks: { readonly toast: HostObservable<OpenInAppToastState | null> }\n /**\n * Announce failures on every device and acknowledged opens or reveals on mobile.\n * Desktop successes and skipped gestures leave the current notice unchanged.\n * @param outcome - settled native-open result.\n */\n readonly report: (outcome: OpenInAppOutcome) => void\n /** Clear the shown notice. */\n readonly dismiss: () => void\n}\n\n/**\n * Create the one outcome store the overlay entry shows.\n * @returns the observable notice with its report and dismiss actions.\n */\nexport function createOpenInAppToastSource(): OpenInAppToastSource {\n const store = createSnapshotStore<OpenInAppToastState | null>(null)\n let seq = 0\n return {\n hooks: { toast: store },\n report: (outcome) => {\n if (outcome.kind === 'skipped') return\n if (outcome.kind !== 'failed' && !isMobileDevice()) return\n seq += 1\n store.set({ ...outcome, seq })\n },\n dismiss: () => { store.set(null) },\n }\n}\n\n/** Props of the `shell.overlay` entry: the notice store, its dismissal, and localized copy. */\nexport type OpenInAppToastProps = PropsRuntime<'shell.overlay'>\n & PropsLocale<typeof NS>\n & InjectFace<Omit<OpenInAppToastSource, 'report'>>\n\n/**\n * Render a mobile handoff confirmation or a native-open failure.\n * @param props - the notice hook, its dismissal, and the locale seat.\n * @returns the banner on display, or null.\n */\nexport function OpenInAppToast({ useToast, dismiss, t }: OpenInAppToastProps): ReactNode {\n const toast = useToast(current => current)\n if (toast === null) return null\n const key = `open-in-app-${String(toast.seq)}`\n if (toast.kind === 'failed') {\n return <Toast key={key} text={t(toast.failure === 'revealError' ? 'path.revealError' : 'path.openError')}\n icon={<IconWarningOutlineRegular />} onDone={dismiss} />\n }\n return <Toast key={key} text={t(toast.kind === 'opened' ? 'path.opened' : 'path.revealed')} tone=\"success\" onDone={dismiss} />\n}\n","/**\n * The plugin-owned wiring around the verbatim open-in-app fork.\n *\n * Upstream builds the same props in its `apply` (`directoryInjected`): one\n * controller per page, its SnapshotStores bound by the slot renderer into\n * `use*` props, and a `t` bound to the `open-in-app` namespace. This module\n * reproduces exactly that — minus slot machinery the fork never sees —\n * plus the two degradations only a fork needs:\n *\n * - the glyph set the fork spells is the `*Regular` family (0.1.7+); a\n * pixel-name runtime (0.1.5/0.1.6) leaves the adapter undefined, so the\n * header simply keeps the native button, mirroring upstream's own\n * \"no apps → no button\" absence;\n * - `ctx.locale.bind('open-in-app')` consumes upstream's registered\n * dictionary verbatim — same strings, upstream's updates included;\n * - the icon route comes through `compat/open-in-app-routes`: the `*_ROUTE`\n * spelling is another 0.1.7+ name, so the constant is probed by export\n * name rather than imported (a pixel-era manifest lacks it entirely —\n * a named import would fail the bundle's own build).\n *\n * Everything here is ours; nothing in this file needs upstream sync.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/open-in-app/adapter\n */\n\nimport { useSyncExternalStore } from 'react'\nimport type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { ShortcutCatalogEntry } from '@deepseek-ai/dsh-client-shortcuts/client'\nimport { maybeIcon } from '../../compat/client-icons.ts'\nimport { OPEN_IN_APP_ICON_URL_PREFIX } from '../../compat/open-in-app-routes.ts'\nimport { OpenInAppController } from './controller.ts'\nimport { OpenInAppAction, type OpenInAppActionProps } from './OpenInAppAction.tsx'\nimport { createOpenInAppToastSource, type OpenInAppToastSource } from './open-toast.tsx'\nimport { NS } from './locales.ts'\n\n/**\n * The props `OpenInAppAction` consumes, minus the per-render `absolutePath`\n * the switcher supplies — the shape upstream's `directoryInjected` returns.\n */\nexport type OpenInAppAdapter = Omit<OpenInAppActionProps, 'absolutePath'>\n\n/**\n * Turn one observable into the renderer-bound `use*` prop shape:\n * `useSyncExternalStore` under the hood, exactly like the slot renderer's\n * own binding. Built once per store so `subscribe` stays referentially\n * stable across renders.\n * @param source - the observable to bind.\n * @returns the bound selector hook.\n */\nfunction bindSnapshot<S>(source: ObservableSnapshot<S>): <T>(selector: (snapshot: S) => T) => T {\n const subscribe = (listener: () => void): (() => void) => source.subscribe(listener)\n const getSnapshot = (): S => source.getSnapshot()\n return function useBound<T>(selector: (snapshot: S) => T): T {\n return useSyncExternalStore(subscribe, () => selector(getSnapshot()))\n }\n}\n\n/** Glyphs the forked components spell verbatim — all `*Regular`, all probed. */\nconst REQUIRED_GLYPHS = [\n 'IconChevronDownOutlineRegular',\n 'IconRightUpOutlineRegular',\n 'IconFolderOpenOutlineRegular',\n 'IconWarningOutlineRegular',\n] as const\n\n/** The empty catalog stand-in when the composition carries no shortcuts service. */\nconst NO_SHORTCUTS: ObservableSnapshot<readonly ShortcutCatalogEntry[]> = {\n getSnapshot: () => [],\n subscribe: () => () => {},\n}\n\n/**\n * Build the open-in-app props upstream hands its own registration.\n * @param deps - the namespace-bound translate for `open-in-app`, and the\n * composition's shortcuts catalog when it exists.\n * @returns the adapter, or `undefined` when this runtime cannot render the\n * fork (pixel-era icon names — the forked files would crash on missing\n * exports, so absence mirrors upstream's own no-button path).\n */\nexport function createOpenInAppAdapter(deps: {\n readonly t: (key: string, params?: Record<string, unknown>) => string\n readonly shortcuts?: ObservableSnapshot<readonly ShortcutCatalogEntry[]> | undefined\n}): { readonly adapter: OpenInAppAdapter; readonly toast: OpenInAppToastSource } | undefined {\n if (!REQUIRED_GLYPHS.every(name => maybeIcon([name]) !== undefined)) return undefined\n const controller = new OpenInAppController()\n void controller.load()\n // Gesture feedback outlives the switcher panel that initiated it, exactly\n // like upstream's own `shell.overlay` announcement seat.\n const toast = createOpenInAppToastSource()\n return {\n toast,\n adapter: {\n useOpenInAppApps: bindSnapshot(controller.apps),\n useOpenInAppChoice: bindSnapshot(controller.choice),\n useOpenInAppLaunch: bindSnapshot(controller.operation),\n useShortcuts: bindSnapshot(deps.shortcuts ?? NO_SHORTCUTS),\n launch: (appId, path) => controller.launch(appId, path),\n report: toast.report,\n choose: (appId) => { controller.choose(appId) },\n iconUrl: appId => `${OPEN_IN_APP_ICON_URL_PREFIX}/${appId}`,\n t: deps.t as OpenInAppActionProps['t'],\n },\n }\n}\n\nexport { OpenInAppAction, NS as OPEN_IN_APP_NS }\n","/**\n * The Workspace Folders panel: one sidebar footer action that opens a dialog\n * listing this session's workspace root and the additional roots registered for\n * it, with the actions the milestone requires — Add (through the composed\n * directory picker), Remove, Alias, Copy Path, and Reveal.\n *\n * Why a footer action and its own dialog, instead of a first-class panel: the\n * slots that can host a full panel (`sidebar.panellist` + the keyed `main`\n * panel) exist only in the pinned 0.1.5 surface, while `sidebar.footer.action`\n * exists in both supported runtimes — and `sidebar.workspaces` is a single slot\n * already owned by the workspace browser, so it cannot be extended in place.\n *\n * Styling is the host's, not this file's: the elements carry `mrfw-*` classes\n * resolved by the stylesheet the client entry injects (`styles.ts`), and every\n * color in that sheet is a host `--dsw-*` token, so the panel inherits the\n * native look — sidebar trigger, modal card, capsule buttons — in both themes\n * without naming a single color here (see ADR-0006).\n *\n * The dialog itself is also exported: the Files-tab root switcher opens the\n * same manager through its trailing menu item instead of carrying a second\n * dialog.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/WorkspaceFoldersAction\n */\n\nimport { useCallback, useEffect, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from 'react'\nimport { Menu, Modal } from '@deepseek-ai/dsh-client-ui-primitives'\nimport {\n IconAccessInherit,\n IconAccessReadOnly,\n IconAccessReadWrite,\n IconChevronDown,\n IconChevronUp,\n IconCopy,\n IconEdit,\n IconEllipsis,\n IconFolderOpen,\n IconPlus,\n IconRefresh,\n IconSettings,\n IconTrash,\n} from '../compat/client-icons.ts'\nimport { errorKeyOf, PanelError, type PanelClient } from './panel-client.ts'\nimport type { Key } from './locales.ts'\nimport type { RootAccess, RootEntryView, RootState, RootView, RootsView } from '../contract.ts'\n\n/** Translate one key of this plugin's namespace. */\nexport type Translate = (key: Key, params?: Record<string, unknown>) => string\n\n/** What the registered action receives from the plugin body. */\nexport interface WorkspaceFoldersActionProps {\n /** The channel client; absent when this composition has no host Connection. */\n readonly panel: PanelClient | undefined\n /** Opens the composed directory picker, when one is composed. */\n readonly pickDirectory: (() => Promise<string | null>) | undefined\n /** Bound translator for this plugin's namespace. */\n readonly t: Translate\n /**\n * The current session id, read when a request is built. A function rather\n * than a value because the selection changes while the panel stays mounted.\n */\n readonly sessionId?: () => string | undefined\n readonly subscribeSession?: (listener: () => void) => () => void\n /** Whether the sidebar renders wide content (`false` in the icon rail). */\n readonly wide?: boolean\n /** Icon-only launcher in the upstream Files tab's public actions slot. */\n readonly compact?: boolean\n}\n\n/** The visual family of one capsule button, mirroring the host Button kit. */\ntype ActionVariant = 'ghost' | 'outline' | 'primary' | 'danger'\n\nconst VARIANT_CLASS: Record<ActionVariant, string> = {\n ghost: 'mrfw-btnGhost',\n outline: 'mrfw-btnOutline',\n primary: 'mrfw-btnPrimary',\n danger: 'mrfw-btnDanger',\n}\n\n/** One small capsule button matching the panel's own styling.\n * Pending requests block activation through aria-disabled without changing\n * opacity, hover or keyboard focus. Native disabled is for unavailable actions.\n */\nfunction Action(props: {\n onClick: () => void\n children: ReactNode\n disabled?: boolean\n pending?: boolean\n variant?: ActionVariant\n}): ReactNode {\n const variant = props.variant ?? 'ghost'\n return (\n <button\n type=\"button\"\n className={`mrfw-btn ${VARIANT_CLASS[variant]}`}\n onClick={props.pending === true ? undefined : props.onClick}\n disabled={props.disabled === true}\n aria-disabled={props.disabled === true || props.pending === true || undefined}\n aria-busy={props.pending === true || undefined}\n >\n {props.children}\n </button>\n )\n}\n\n/**\n * One icon-only button (a host \"iconButton\"): a fixed square of the capsule\n * family whose meaning travels in `title`/`aria-label` instead of text.\n */\nfunction IconButton(props: {\n onClick: () => void\n icon: ReactNode\n label: string\n disabled?: boolean\n pending?: boolean\n pressed?: boolean\n hint?: string\n variant?: ActionVariant\n}): ReactNode {\n const variant = props.variant ?? 'ghost'\n return (\n <button\n type=\"button\"\n className={`mrfw-btn mrfw-iconBtn ${VARIANT_CLASS[variant]}`}\n title={props.hint ?? props.label}\n aria-label={props.label}\n aria-pressed={props.pressed}\n onClick={props.pending === true ? undefined : props.onClick}\n disabled={props.disabled === true}\n aria-disabled={props.disabled === true || props.pending === true || undefined}\n aria-busy={props.pending === true || undefined}\n >\n {props.icon}\n </button>\n )\n}\n\n/** A skill is a reusable instruction document; the star denotes its capability. */\nfunction SkillsIcon({ enabled }: { enabled: boolean }): ReactNode {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M8 13.5H3a1 1 0 0 1-1-1v-10a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1V7M4.5 4.5h5M4.5 7h3\" />\n <path d=\"m11.5 8 .85 2.65L15 11.5l-2.65.85-.85 2.65-.85-2.65L8 11.5l2.65-.85Z\" />\n {enabled ? null : <path d=\"m2 14 12-12\" />}\n </svg>\n )\n}\n\n/** The 16px close glyph of the dialog's header button. */\nfunction CloseIcon(): ReactNode {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 4l8 8M12 4l-8 8\" />\n </svg>\n )\n}\n\n/**\n * One path that copies itself: text that paints like the surrounding copy\n * and reveals a trailing icon on hover — clicking the text or the icon\n * copies the same canonical path. The accessible name swaps to \"copied\"\n * for the feedback window, the icon button's old recipe. Shared by the\n * primary row and every additional root.\n */\nfunction PathCopy(props: {\n readonly path: string\n readonly copied: boolean\n readonly onCopy: () => void\n readonly t: Translate\n}): ReactNode {\n return (\n <button\n type=\"button\"\n className=\"mrfw-rootPath mrfw-pathCopy\"\n title={props.path}\n aria-label={props.copied ? props.t('panel.copied') : props.t('panel.copyPath')}\n onClick={props.onCopy}\n >\n {props.path}\n <span className=\"mrfw-pathCopyIcon\" aria-hidden=\"true\"><IconCopy size={14} /></span>\n </button>\n )\n}\n\n/** The locale key for one reported root state. */\nexport function stateKey(state: RootState): Key {\n switch (state) {\n case 'available': return 'state.available'\n case 'missing': return 'state.missing'\n case 'redirected': return 'state.redirected'\n case 'invalid': return 'state.invalid'\n }\n}\n\n/** The locale key for one registration's access level. */\nexport function accessKey(access: RootAccess): Key {\n switch (access) {\n case 'inherit': return 'access.inherit'\n case 'read-only': return 'access.readOnly'\n case 'read-write': return 'access.readWrite'\n }\n}\n\n/**\n * Whether moving FROM `from` TO `to` could widen the agent's write authority\n * under some session mode. The three levels are not a total order — `inherit`\n * is weaker than `read-write` under a read-only session but never weaker\n * under the others — so the check is spelled out per pair rather than\n * computed from a rank. Only a widening change asks for confirmation.\n */\nexport function widensAccess(from: RootAccess, to: RootAccess): boolean {\n if (from === 'read-only') return to !== 'read-only'\n return (from === 'inherit' && to === 'read-write') || (from === 'read-write' && to === 'inherit')\n}\n\n/** The final segment of an absolute path, on either platform separator. */\nexport function basename(path: string): string {\n const segments = path.split(/[\\\\/]/).filter(segment => segment !== '')\n return segments[segments.length - 1] ?? path\n}\n\n/**\n * The primary text of one row: the stored alias when set, otherwise the\n * directory's own name — the display the registration was added with.\n */\nexport function displayNameOf(root: RootView): string {\n return root.alias ?? basename(root.path)\n}\n\n/** Display-only path matching; the host remains the sole authority for grants. */\nfunction workingRootOf(view: RootsView | undefined): string | undefined {\n if (view?.effectiveCwd === undefined) return undefined\n const normalize = (path: string): string => {\n const windows = /^[a-z]:[\\\\/]/i.test(path) || path.startsWith('\\\\')\n const normalized = (windows ? path.replace(/\\\\/g, '/').toLowerCase() : path).replace(/\\/+$/, '')\n return normalized || '/'\n }\n const cwd = normalize(view.effectiveCwd)\n // Longest boundary match is equivalent to walking up to the nearest listed root.\n return [view.primaryRoot, ...view.roots.map(root => root.path)]\n .filter(path => {\n const root = normalize(path)\n return cwd === root || cwd.startsWith(root.endsWith('/') ? root : `${root}/`)\n })\n .sort((a, b) => normalize(b).length - normalize(a).length)[0]\n}\n\n/** The sidebar footer action plus the dialog it opens. */\nexport function WorkspaceFoldersAction(props: WorkspaceFoldersActionProps): ReactNode {\n const [open, setOpen] = useState(false)\n const rail = props.wide === false\n return (\n <>\n {/* The row wrapper mirrors the host `.triggerRow`: its 2px side overhang\n (`calc(100% + 4px)` + negative margins) is what puts this row's icon\n on the same 18px ink line as the Settings gear below it. */}\n <div className={props.compact ? 'mrfw-fileLauncher' : rail ? 'mrfw-triggerRow mrfw-railRow' : 'mrfw-triggerRow'}>\n <button\n type=\"button\"\n className={props.compact ? 'mrfw-btn mrfw-btnGhost mrfw-iconBtn' : rail ? 'mrfw-trigger mrfw-triggerRail' : 'mrfw-trigger'}\n title={props.t('action.title')}\n aria-label={props.compact === true ? props.t('action.title') : undefined}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => { setOpen(value => !value) }}\n >\n <span className=\"mrfw-triggerIcon\" aria-hidden=\"true\"><IconSettings size={rail ? 18 : 16} /></span>\n {rail || props.compact === true ? null : <span className=\"mrfw-triggerLabel\">{props.t('action.label')}</span>}\n </button>\n </div>\n {open ? <WorkspaceFoldersDialog {...props} onClose={() => { setOpen(false) }} /> : null}\n </>\n )\n}\n\n/** State of one dialog instance. */\ninterface DialogState {\n readonly view: RootsView | undefined\n readonly error: PanelError | undefined\n readonly busy: boolean\n /** True when the client has no current session and must not call the host. */\n readonly noSession: boolean\n}\n\n/** The exact row reference the browsing endpoints and mutations carry. */\nexport function entryOf(root: RootView): RootEntryView {\n return { ordinal: root.ordinal, id: root.id, path: root.path, addedAt: root.addedAt }\n}\n\nfunction rowKey(root: RootView): string {\n return `${root.ordinal}\\u0000${root.id}\\u0000${root.path}\\u0000${root.addedAt}`\n}\n\n/**\n * The dialog: reads the view once per open, then after every mutation.\n *\n * Two shapes travel back over the channel, and they are handled separately on\n * purpose: every mutating endpoint answers with the whole refreshed view, while\n * `reveal` answers with the path it revealed and leaves the list untouched\n * (see `contract.ts`). Treating a reveal answer as a roots view is exactly the\n * contract mismatch this split removes.\n */\nexport function WorkspaceFoldersDialog(props: WorkspaceFoldersActionProps & { onClose: () => void }): ReactNode {\n const { panel, t } = props\n const [state, setState] = useState<DialogState>({\n view: undefined,\n error: undefined,\n busy: false,\n noSession: false,\n })\n const [manualPath, setManualPath] = useState('')\n /** The access the Add controls register new roots with; `inherit` is the default. */\n const [addAccess, setAddAccess] = useState<RootAccess>('inherit')\n /**\n * Whether the operator actually picked a level. The select shows its default\n * before they do, and sending that default would be an explicit value the\n * operator never named: on a revive the registry upgrades a read-only record\n * to it. Only a chosen level may travel in the request.\n */\n const [accessChosen, setAccessChosen] = useState(false)\n const [accessMenuOpen, setAccessMenuOpen] = useState(false)\n /** The widening access change waiting on the confirmation's red button. */\n const [upgradeFor, setUpgradeFor] = useState<{ root: RootView; access: RootAccess } | undefined>(undefined)\n const [aliasFor, setAliasFor] = useState<string | undefined>(undefined)\n const [aliasDraft, setAliasDraft] = useState('')\n const [aliasField, setAliasField] = useState<'alias' | 'aliasId'>('alias')\n const [copiedId, setCopiedId] = useState<string | undefined>(undefined)\n const [menuFor, setMenuFor] = useState<string | undefined>(undefined)\n const dialogRef = useRef<HTMLDivElement | null>(null)\n const requestEpoch = useRef(0)\n const mounted = useRef(true)\n\n useEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n requestEpoch.current += 1\n }\n }, [])\n\n const requestBase = useCallback((): { sessionId: string } | undefined => {\n const current = props.sessionId?.()\n return current === undefined || current === '' ? undefined : { sessionId: current }\n }, [props.sessionId])\n\n // The dialog is modal: it takes focus when it opens, Escape closes it, and\n // Tab cycles within it instead of escaping into the sidebar behind it.\n useEffect(() => { dialogRef.current?.focus() }, [])\n const onDialogKeyDown = (event: ReactKeyboardEvent): void => {\n if (event.key === 'Escape') {\n // An open menu or the upgrade confirmation owns Escape: its own\n // listener closes just that layer, and this handler must not close the\n // dialog underneath it — the portaled dropdown and Modal bubble their\n // events through this dialog's React tree too.\n if (menuFor !== undefined || accessMenuOpen || upgradeFor !== undefined) return\n event.stopPropagation()\n props.onClose()\n return\n }\n if (event.key !== 'Tab') return\n // While the upgrade confirmation owns the topmost modal, Tab belongs to\n // its own focus trap. The portaled Modal still bubbles keys through this\n // dialog's React tree (like Escape above), and trapping here would yank\n // focus to a control behind the active confirmation.\n if (upgradeFor !== undefined) return\n const dialog = dialogRef.current\n if (dialog === null) return\n const focusable = Array.from(\n dialog.querySelectorAll<HTMLElement>('button, input, select, [href], [tabindex]:not([tabindex=\"-1\"])'),\n ).filter(element => !element.hasAttribute('disabled'))\n if (focusable.length === 0) {\n event.preventDefault()\n return\n }\n const first = focusable[0]!\n const last = focusable[focusable.length - 1]!\n const active = dialog.ownerDocument.activeElement\n if (event.shiftKey && (active === first || !(active instanceof HTMLElement) || !dialog.contains(active))) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && (active === last || !(active instanceof HTMLElement) || !dialog.contains(active))) {\n event.preventDefault()\n first.focus()\n }\n }\n\n const refresh = useCallback(async () => {\n if (panel === undefined) {\n setState({\n view: undefined,\n error: new PanelError('unavailable', 'no connection'),\n busy: false,\n noSession: false,\n })\n return\n }\n const base = requestBase()\n if (base === undefined) {\n setState({ view: undefined, error: undefined, busy: false, noSession: true })\n return\n }\n const epoch = ++requestEpoch.current\n setState(previous => ({ ...previous, busy: true, noSession: false }))\n try {\n const view = await panel.call('list', base)\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return\n setState({ view, error: undefined, busy: false, noSession: false })\n } catch (error: unknown) {\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return\n setState({ view: undefined, error: asPanelError(error), busy: false, noSession: false })\n }\n }, [panel, requestBase])\n\n useEffect(() => { void refresh() }, [refresh])\n useEffect(() => {\n let previous = props.sessionId?.()\n return props.subscribeSession?.(() => {\n const current = props.sessionId?.()\n if (current === previous) return\n previous = current\n requestEpoch.current += 1\n setState({ view: undefined, error: undefined, busy: false, noSession: current === undefined })\n setMenuFor(undefined)\n setAliasFor(undefined)\n void refresh()\n })\n }, [props.subscribeSession, props.sessionId, refresh])\n\n /**\n * Submit one change to the host and adopt the view it answers with.\n * @returns whether the host accepted it (the caller decides whether to clear\n * the input it came from).\n */\n const mutate = useCallback(async (endpoint: 'add' | 'remove' | 'alias' | 'move' | 'setAccess' | 'setAliasId' | 'setSkillsEnabled', payload: Record<string, unknown>): Promise<boolean> => {\n if (panel === undefined) return false\n const base = requestBase()\n if (base === undefined) {\n setState({ view: undefined, error: undefined, busy: false, noSession: true })\n return false\n }\n const epoch = ++requestEpoch.current\n setState(previous => ({ ...previous, busy: true, noSession: false }))\n try {\n const view = await panel.call(endpoint, { ...base, ...payload })\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return false\n setState({ view, error: undefined, busy: false, noSession: false })\n return true\n } catch (error: unknown) {\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return false\n setState(previous => ({ ...previous, error: asPanelError(error), busy: false }))\n return false\n }\n }, [panel, requestBase])\n\n /**\n * Open the composed picker and add whatever it returns. A picker that is not\n * composed, or a dialog the operator dismissed, adds nothing — it never falls\n * back to the manual field, because the operator who clicked \"Add folder…\"\n * asked for the picker, not for the text they may have typed earlier.\n */\n const addViaPicker = useCallback(async () => {\n if (props.pickDirectory === undefined) return\n let picked: string | null = null\n try {\n picked = await props.pickDirectory()\n } catch (error: unknown) {\n setState(previous => ({ ...previous, error: asPanelError(error) }))\n return\n }\n if (picked === null || picked.trim() === '') return\n await mutate('add', { path: picked, ...(accessChosen ? { access: addAccess } : {}) })\n }, [mutate, props, addAccess, accessChosen])\n\n /**\n * Add the path in the manual field — the one the operator typed. The picker\n * plays no part here: this is the entry point the confirm button and the\n * Enter key use.\n */\n const addManualPath = useCallback(async () => {\n const path = manualPath.trim()\n if (path === '') return\n // Cleared only on success: a rejected path stays in the field so the operator\n // can fix it instead of retyping it.\n if (await mutate('add', { path, ...(accessChosen ? { access: addAccess } : {}) })) setManualPath('')\n }, [manualPath, mutate, addAccess, accessChosen])\n\n /**\n * Re-register one withheld or unusable root in place. The request carries\n * the stored path and deliberately NO access: `registry.add` treats the call\n * as a revive — it keeps the record's access, alias, and identity instead of\n * creating a new registration — which is also why the root limit must not\n * gate this button: a revive consumes no slot, and it is the panel's only\n * repair route for a redirected entry.\n */\n const reRegister = useCallback(async (root: RootView) => {\n await mutate('add', { path: root.path })\n }, [mutate])\n\n /** Reveal one root: the answer is the revealed path, not a new view. */\n const reveal = useCallback(async (root: RootView) => {\n if (panel === undefined) return\n const base = requestBase()\n if (base === undefined) {\n setState({ view: undefined, error: undefined, busy: false, noSession: true })\n return\n }\n const epoch = ++requestEpoch.current\n setState(previous => ({ ...previous, busy: true, noSession: false }))\n try {\n await panel.call('reveal', { ...base, entry: entryOf(root) })\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return\n setState(previous => ({ ...previous, error: undefined, busy: false }))\n } catch (error: unknown) {\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return\n setState(previous => ({ ...previous, error: asPanelError(error), busy: false }))\n }\n }, [panel, requestBase])\n\n const copyPath = useCallback(async (key: string, path: string) => {\n try {\n await navigator.clipboard.writeText(path)\n setCopiedId(key)\n setState(previous => ({ ...previous, error: undefined }))\n window.setTimeout(() => { setCopiedId(current => (current === key ? undefined : current)) }, 1500)\n } catch (error: unknown) {\n // A clipboard refusal is the browser environment's, not the host's, so it\n // is reported here with its own code rather than left silent.\n setCopiedId(undefined)\n setState(previous => ({\n ...previous,\n error: new PanelError('copy-failed', error instanceof Error ? error.message : String(error)),\n }))\n }\n }, [])\n\n // Retained for a future drag-to-reorder interaction; no ordering controls are shown.\n const _move = useCallback(async (root: RootView, before: RootView | undefined) => {\n await mutate('move', before === undefined\n ? { entry: entryOf(root) }\n : { entry: entryOf(root), beforeEntry: entryOf(before) })\n }, [mutate])\n\n const roots = state.view?.roots ?? []\n // The host refuses the add as `root-limit-reached` anyway; disabling here is\n // what makes the refusal explain itself before the operator clicks.\n const atLimit = state.view !== undefined && state.view.count >= state.view.limit\n const IconAccessTrigger = addAccess === 'read-only' ? IconAccessReadOnly\n : addAccess === 'read-write' ? IconAccessReadWrite : IconAccessInherit\n // Captured as consts: narrowing does not reach the onCopy closures below.\n const primaryPath = state.view?.primaryRoot\n const workingRoot = workingRootOf(state.view)\n return (\n <>\n <div className=\"mrfw-overlay\" role=\"presentation\">\n <div\n className=\"mrfw-mask\"\n role=\"presentation\"\n onClick={event => { if (event.target === event.currentTarget) props.onClose() }}\n />\n <div\n ref={dialogRef}\n tabIndex={-1}\n onKeyDown={onDialogKeyDown}\n className=\"mrfw-dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={t('panel.title')}\n >\n <div className=\"mrfw-header\">\n <h2 className=\"mrfw-title\">{t('panel.title')}</h2>\n <button\n type=\"button\"\n className=\"mrfw-close\"\n title={t('panel.close')}\n aria-label={t('panel.close')}\n onClick={props.onClose}\n >\n <CloseIcon />\n </button>\n </div>\n <div className=\"mrfw-body\">\n {state.noSession ? (\n <p className=\"mrfw-note\">{t('panel.noSession')}</p>\n ) : (\n <>\n {state.view?.toolAccessInvalid ? <p className=\"mrfw-note\">{t('panel.invalidCap')}</p>\n : (state.view?.cappedTools?.length ?? 0) > 0 ? <p className=\"mrfw-note\">\n {t('panel.toolCaps', { tools: state.view!.cappedTools!.join(', ') })}\n </p> : null}\n\n {state.error === undefined ? null : (\n <p role=\"alert\" className=\"mrfw-alert\">\n {t(errorKeyOf(state.error.code))}\n {(state.error.code === 'unavailable' || state.error.code === 'panel/internal') ? ` (${state.error.message})` : ''}\n </p>\n )}\n {state.view?.unavailable === undefined ? null : (\n <p role=\"alert\" className=\"mrfw-alert\">{state.view.unavailable}</p>\n )}\n\n <section className=\"mrfw-section\">\n <div className=\"mrfw-sectionTitleRow\">\n <span className=\"mrfw-sectionTitle\">{t('panel.primary')}</span>\n <span className=\"mrfw-sectionNote\">{t('panel.primaryNote')}</span>\n </div>\n <div className=\"mrfw-row mrfw-rowBare\">\n <div className=\"mrfw-rootText\">\n <span className=\"mrfw-rootName\">\n <span className=\"mrfw-rootNameText\">\n {state.view === undefined ? '…' : (state.view.primaryName ?? basename(state.view.primaryRoot))}\n </span>\n {primaryPath !== undefined && workingRoot === primaryPath ? <span className=\"mrfw-cwdTag\">{t('panel.currentAgentCwd')}</span> : null}\n </span>\n {primaryPath === undefined\n ? <span className=\"mrfw-rootPath\">…</span>\n : (\n <PathCopy\n path={primaryPath}\n copied={copiedId === 'primary'}\n onCopy={() => { void copyPath('primary', primaryPath) }}\n t={t}\n />\n )}\n </div>\n </div>\n </section>\n\n <section className=\"mrfw-section\">\n <div className=\"mrfw-sectionTitleRow\">\n <span className=\"mrfw-sectionTitle\">{t('panel.additional')}</span>\n </div>\n {state.view === undefined ? <p className=\"mrfw-note\">{t('panel.loading')}</p> : null}\n {state.view !== undefined && roots.length === 0 ? (\n <p className=\"mrfw-note\">\n {t('panel.empty')} {t('panel.emptyHint')}\n </p>\n ) : null}\n {roots.map(root => {\n const key = rowKey(root)\n const IconAccess = root.access === 'read-only' ? IconAccessReadOnly\n : root.access === 'read-write' ? IconAccessReadWrite : IconAccessInherit\n return <div key={key} className=\"mrfw-row\">\n <div className=\"mrfw-rootText\">\n <span className=\"mrfw-rootName\">\n <span className=\"mrfw-rootNameText\">{displayNameOf(root)}</span>\n {workingRoot === root.path ? <span className=\"mrfw-cwdTag\">{t('panel.currentAgentCwd')}</span> : null}\n {/* The access level rides beside the name as read-only\n text; changing it stays behind the row's … menu. */}\n <span className=\"mrfw-accessBadge\">\n {IconAccess === undefined ? null : <IconAccess size={14} />}\n {root.effectiveAccess === undefined ? t(accessKey(root.access)) : t('panel.accessEffective', {\n access: t(accessKey(root.access)),\n effective: t(`effective.${root.effectiveAccess}`),\n })}\n </span>\n </span>\n <PathCopy\n path={root.path}\n copied={copiedId === key}\n onCopy={() => { void copyPath(key, root.path) }}\n t={t}\n />\n </div>\n {root.state === 'available' ? null : (\n <span title={root.detail} className=\"mrfw-stateWarn\">\n {t(stateKey(root.state))}\n </span>\n )}\n {root.state === 'available' ? null : (\n <IconButton\n pending={state.busy}\n onClick={() => { void reRegister(root) }}\n icon={<IconRefresh />}\n label={t('panel.reRegister')}\n />\n )}\n {root.skillsEnabled === undefined ? null : (\n <IconButton\n pending={state.busy}\n pressed={root.skillsEnabled}\n onClick={() => { void mutate('setSkillsEnabled', { entry: entryOf(root), skillsEnabled: !root.skillsEnabled }) }}\n icon={<SkillsIcon enabled={root.skillsEnabled} />}\n label={t('panel.skills')}\n hint={t(root.skillsEnabled ? 'panel.skillsEnabled' : 'panel.skillsDisabled')}\n />\n )}\n <IconButton\n pending={state.busy}\n onClick={() => { void reveal(root) }}\n icon={<IconFolderOpen />}\n label={t('panel.reveal')}\n />\n <Menu\n open={menuFor === key}\n onClose={() => { setMenuFor(undefined) }}\n items={[\n { id: 'rename', label: t('panel.rename'), icon: <IconEdit /> },\n { id: 'alias-id', label: t('panel.aliasIdEdit'), disabled: state.busy },\n { id: 'access:inherit', label: t('panel.accessInherit'), icon: IconAccessInherit === undefined ? undefined : <IconAccessInherit />, disabled: state.busy || root.access === 'inherit' },\n { id: 'access:read-only', label: t('panel.accessReadOnly'), icon: IconAccessReadOnly === undefined ? undefined : <IconAccessReadOnly />, disabled: state.busy || root.access === 'read-only' },\n { id: 'access:read-write', label: t('panel.accessReadWrite'), icon: IconAccessReadWrite === undefined ? undefined : <IconAccessReadWrite />, disabled: state.busy || root.access === 'read-write' },\n { id: 'remove', label: t('panel.remove'), icon: <IconTrash />, danger: true, disabled: state.busy },\n ]}\n onSelect={(id) => {\n setMenuFor(undefined)\n if (id === 'alias-id') {\n setAliasField('aliasId')\n setAliasFor(key)\n setAliasDraft(root.aliasId ?? '')\n }\n if (id === 'rename') {\n setAliasField('alias')\n setAliasFor(key)\n setAliasDraft(root.alias ?? '')\n }\n if (id.startsWith('access:')) {\n const access = id.slice('access:'.length) as RootAccess\n // Widening what the agent may modify — under ANY session\n // mode — asks first, through the confirmation layered\n // over this dialog, not the browser's window.confirm.\n if (widensAccess(root.access, access)) { setUpgradeFor({ root, access }); return }\n void mutate('setAccess', { entry: entryOf(root), access })\n }\n if (id === 'remove') void mutate('remove', { entry: entryOf(root) })\n }}\n portal\n align=\"end\"\n closeOnPointerLeave\n anchor={(\n <IconButton\n pending={state.busy}\n onClick={() => { setMenuFor(current => (current === key ? undefined : key)) }}\n icon={<IconEllipsis />}\n label={t('panel.more')}\n />\n )}\n />\n {aliasFor === key ? (\n <span className=\"mrfw-aliasEditor\">\n <input\n autoFocus\n className=\"mrfw-input mrfw-inputInline\"\n value={aliasDraft}\n placeholder={t(aliasField === 'aliasId' ? 'panel.aliasIdPlaceholder' : 'panel.aliasPlaceholder')}\n onChange={event => { setAliasDraft(event.target.value) }}\n />\n <Action pending={state.busy} onClick={() => { void mutate(aliasField === 'aliasId' ? 'setAliasId' : 'alias', { entry: entryOf(root), [aliasField]: aliasDraft }).then(ok => { if (ok) setAliasFor(undefined) }) }}>\n {t('panel.aliasSave')}\n </Action>\n <Action onClick={() => { setAliasFor(undefined) }}>{t('panel.aliasCancel')}</Action>\n </span>\n ) : null}\n </div>\n })}\n </section>\n </>\n )}\n\n <div className=\"mrfw-actions\">\n {state.noSession || props.pickDirectory === undefined ? null : (\n <IconButton\n variant=\"outline\"\n pending={state.busy}\n disabled={atLimit}\n onClick={() => { void addViaPicker() }}\n icon={<IconPlus />}\n label={atLimit ? t('panel.limitReached') : t('panel.add')}\n />\n )}\n {state.noSession ? null : (\n <>\n <input\n className=\"mrfw-input\"\n value={manualPath}\n placeholder={t('panel.addManual')}\n disabled={atLimit}\n onChange={event => { setManualPath(event.target.value) }}\n onKeyDown={event => { if (event.key === 'Enter') void addManualPath() }}\n />\n {/* The access picker is the host's own anchored menu — the same\n dropdown kit the root switcher and the row menus use — not a\n native select. Only an explicit selection marks the level\n chosen, so the displayed default still travels in no request\n (accessChosen keeps its meaning). Opens upward: the row sits\n at the dialog's bottom edge. */}\n <Menu\n open={accessMenuOpen}\n onClose={() => { setAccessMenuOpen(false) }}\n className=\"mrfw-accessSelect\"\n items={[\n {\n id: 'inherit',\n label: t('access.inherit'),\n icon: IconAccessInherit === undefined ? undefined : <IconAccessInherit />,\n },\n {\n id: 'read-write',\n label: t('access.readWrite'),\n icon: IconAccessReadWrite === undefined ? undefined : <IconAccessReadWrite />,\n },\n {\n id: 'read-only',\n label: t('access.readOnly'),\n icon: IconAccessReadOnly === undefined ? undefined : <IconAccessReadOnly />,\n },\n ]}\n selectedId={addAccess}\n onSelect={(id) => {\n setAccessMenuOpen(false)\n if (id === 'inherit' || id === 'read-write' || id === 'read-only') {\n setAccessChosen(true)\n setAddAccess(id)\n }\n }}\n portal\n side=\"top\"\n align=\"end\"\n closeOnPointerLeave\n anchor={(\n <button\n type=\"button\"\n className=\"mrfw-btn mrfw-btnOutline mrfw-accessTrigger\"\n title={t('panel.accessLabel')}\n aria-label={t('panel.accessLabel')}\n aria-haspopup=\"menu\"\n aria-expanded={accessMenuOpen}\n disabled={atLimit}\n aria-disabled={state.busy || atLimit || undefined}\n aria-busy={state.busy || undefined}\n onClick={() => { if (!state.busy) setAccessMenuOpen(open => !open) }}\n >\n {IconAccessTrigger === undefined ? null : <IconAccessTrigger />}\n {t(accessKey(addAccess))}\n {accessMenuOpen ? <IconChevronUp size={14} /> : <IconChevronDown size={14} />}\n </button>\n )}\n />\n <Action\n onClick={() => { void addManualPath() }}\n pending={state.busy}\n disabled={atLimit || manualPath.trim() === ''}\n variant=\"primary\"\n >\n {t('panel.addConfirm')}\n </Action>\n </>\n )}\n {atLimit ? <span className=\"mrfw-note\">{t('panel.limitReached')}</span> : null}\n <Action onClick={() => { void refresh() }} pending={state.busy} variant=\"outline\">{t('panel.retry')}</Action>\n </div>\n </div>\n </div>\n </div>\n {/* A widening access change asks first: a host-modal confirmation layered\n over this dialog — cancel or a mask click dismisses, the red button\n commits the setAccess mutation. Narrowing changes skip it entirely. */}\n <Modal\n open={upgradeFor !== undefined}\n onClose={() => { setUpgradeFor(undefined) }}\n title={t('panel.accessUpgradeTitle')}\n description={upgradeFor === undefined ? '' : t('panel.accessUpgradeConfirm', { access: t(accessKey(upgradeFor.access)) })}\n closeLabel={t('panel.close')}\n footer={(\n <>\n <Action onClick={() => { setUpgradeFor(undefined) }}>{t('panel.aliasCancel')}</Action>\n <Action\n variant=\"danger\"\n pending={state.busy}\n onClick={() => {\n const pending = upgradeFor\n setUpgradeFor(undefined)\n if (pending !== undefined) {\n void mutate('setAccess', { entry: entryOf(pending.root), access: pending.access })\n }\n }}\n >\n {t('panel.accessUpgradeDo')}\n </Action>\n </>\n )}\n />\n </>\n )\n}\n\n/** Normalize any thrown value into a `PanelError` the dialog can render. */\nfunction asPanelError(error: unknown): PanelError {\n if (error instanceof PanelError) return error\n return new PanelError('fallback', error instanceof Error ? error.message : String(error))\n}\n","/**\n * The Files-tab root switcher — the entry that took over the header position\n * the P1 gear launcher first claimed. It poses as the pane's path label: a\n * trigger that opens a menu of this session's roots (primary first, the\n * registered additional roots next, and the Workspace Folders manager last),\n * followed by a `PathLabel` of the selected root's full path — the same\n * component upstream draws in that spot, so both primary and additional\n * selections read exactly like the native header. While an additional root\n * is selected it also lends the pane's body area to this plugin's verbatim\n * fork of the native Files tree (`files-tree/`), so an additional root reads\n * and behaves exactly like the primary one.\n *\n * Two upstream DOM hooks make the takeover work, and both degrade silently:\n *\n * - The stylesheet rules: while `.mrfw-rootSwitcher` exists inside a\n * `[data-files-root]` pane the upstream `data-files-path` is hidden and the\n * switcher takes its flex position; while the switcher carries\n * `data-root-kind=\"additional\"` the native `data-files-body`,\n * `data-files-reload`, and `data-open-target=\"directory\"` split button\n * hide too (the reload refreshes the very tree that is no longer\n * visible, and the native open-in-app button only ever receives the\n * primary root through its slot props — the header gets a\n * `.mrfw-switcherReload` replacement and the plugin's verbatim fork of\n * the open-in-app control, pointed at the selected root). Upstream\n * changing that DOM shape simply stops the selectors from matching — the\n * native header keeps working and the switcher is just another actions\n * occupant.\n * - `closest('[data-files-root]')` from the switcher's own element locates\n * the pane the forked Files tree is portaled into, as a sibling of\n * `data-files-body`. No match → no portal: the component keeps working as\n * a menu and the native tree keeps its area. The tree's tab id comes from\n * the same element's `closest('[data-dockkit-content]')` — the dockkit\n * tabHost section — with a generated fallback where the hook is absent.\n *\n * The selected root is component state on purpose: every tab render\n * occurrence gets its own, and reopening the pane resets to the primary\n * root. There is no cross-tab or persisted selection.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/RootSwitcher\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'\nimport { createPortal } from 'react-dom'\nimport { Menu, type MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit'\nimport { IconChevronDown, IconFolderClose, IconFolderOpen, IconRefresh, IconSettings, maybeComponent } from '../compat/client-icons.ts'\nimport type { RootsView, RootView } from '../contract.ts'\nimport { FilesTree, type FilesTreeSurface } from './files-tree/adapter.tsx'\nimport { OpenInAppAction, type OpenInAppAdapter } from './open-in-app/adapter.tsx'\nimport {\n basename,\n displayNameOf,\n stateKey,\n WorkspaceFoldersDialog,\n type WorkspaceFoldersActionProps,\n} from './WorkspaceFoldersAction.tsx'\n\n/** What the registered Files-actions occupant needs beyond the slot owner. */\nexport interface RootSwitcherProps extends Omit<WorkspaceFoldersActionProps, 'compact' | 'wide'> {\n /** This pane's workspace root, carried by the slot owner's `absolutePath`. */\n readonly primaryPath: string\n /**\n * The forked open-in-app control's shared props, or `undefined` where the\n * fork cannot render (an undefined adapter is upstream's own \"no button\"\n * state, so the switcher just draws nothing there too).\n */\n readonly openInApp?: OpenInAppAdapter | undefined\n /**\n * The forked Files tree's shared props, or `undefined` where the fork\n * cannot render — the additional-root rows then stay out of the menu at\n * all, which is the same absence upstream's own tree produces.\n */\n readonly filesTree?: FilesTreeSurface | undefined\n}\n\n/** The takeover's portal + lifetime, created while an additional root browses. */\ninterface Takeover {\n /** Lifetime handed to the tree's face: aborting forgets the store bucket and closes the watches. */\n readonly signal: AbortSignal\n /** The store bucket's key — the dockkit tab id where the hook exists, else a generated one. */\n readonly tabId: TabId\n /** The root the tree lists. */\n readonly root: string\n}\n\n/**\n * The subdued full-path label upstream's Files header draws — it exists from\n * `0.1.7-alpha.1` on. A pixel-era runtime has no such export, so the probe\n * returns `undefined` and the header falls back to a plain titled span: the\n * path stays readable and hoverable, only the dir/file typography differs.\n */\nconst PathLabel = maybeComponent<(props: { path: string; className?: string | undefined }) => ReactNode>(['PathLabel'])\n\n/** The Files-header switcher: root menu, dialog entry, and the portal tree. */\nexport function RootSwitcher(props: RootSwitcherProps): ReactNode {\n const { panel, t, primaryPath, filesTree } = props\n const [menuOpen, setMenuOpen] = useState(false)\n const [dialogOpen, setDialogOpen] = useState(false)\n const [view, setView] = useState<RootsView | undefined>(undefined)\n const [selected, setSelected] = useState<RootView | 'primary'>('primary')\n const [takeover, setTakeover] = useState<Takeover | null>(null)\n const wrapperRef = useRef<HTMLSpanElement | null>(null)\n const fallbackTabId = useRef<TabId | undefined>(undefined)\n const [pane, setPane] = useState<HTMLElement | null>(null)\n const mounted = useRef(true)\n const requestEpoch = useRef(0)\n\n useEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n requestEpoch.current += 1\n }\n }, [])\n\n // Locate the pane once, after mount. Finding no `[data-files-root]`\n // ancestor is the supported degradation: nothing is portaled, and the\n // stylesheet rules that would hide the native body match nothing either.\n useEffect(() => {\n setPane(wrapperRef.current?.closest<HTMLElement>('[data-files-root]') ?? null)\n }, [])\n\n const refresh = useCallback(async (): Promise<void> => {\n if (panel === undefined) { setView(undefined); return }\n const session = props.sessionId?.()\n if (session === undefined || session === '') { setView(undefined); return }\n const epoch = ++requestEpoch.current\n try {\n const next = await panel.call('list', { sessionId: session })\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== session) return\n setView(next)\n } catch {\n // A failed list degrades to \"primary only\": the menu keeps working and\n // the trigger still mirrors the pane path. The dialog reports channel\n // failures itself, so the switcher stays silent here on purpose.\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== session) return\n setView(undefined)\n }\n }, [panel, props.sessionId])\n\n useEffect(() => { void refresh() }, [refresh])\n\n // A session change makes the whole view — and any selected root — stale:\n // the registry is keyed by the session's primary root, so the selection\n // falls back to primary and the list reloads.\n useEffect(() => {\n let previous = props.sessionId?.()\n return props.subscribeSession?.(() => {\n const current = props.sessionId?.()\n if (current === previous) return\n previous = current\n requestEpoch.current += 1\n setSelected('primary')\n setView(undefined)\n void refresh()\n })\n }, [props.subscribeSession, props.sessionId, refresh])\n\n // A refresh that reports the selected root gone or withheld sends the\n // selection back to the primary root instead of browsing a stale grant —\n // and a refresh that could not answer at all does the same: an undefined\n // view means nothing revalidated the selection, so the takeover must not\n // keep the native primary tree hidden behind it.\n useEffect(() => {\n if (selected === 'primary') return\n const current = view?.roots.find(root => root.id === selected.id)\n if (current === undefined || current.state !== 'available') { setSelected('primary'); return }\n // The match can carry a newer alias, access, or path than the row\n // `onSelect` captured; adopt the refreshed object so the trigger label,\n // the path label, and the tree entry stop rendering the stale snapshot.\n if (current !== selected) setSelected(current)\n }, [view, selected])\n\n const roots = useMemo(() => view?.roots ?? [], [view])\n const primaryLabel = view?.primaryName ?? basename(view?.primaryRoot ?? primaryPath)\n const triggerLabel = selected === 'primary' ? primaryLabel : displayNameOf(selected)\n const triggerPath = selected === 'primary' ? (view?.primaryRoot ?? primaryPath) : selected.path\n // Exactly the portal condition: the forked tree — and the header reload\n // that refreshes it — exist together or not at all. A missing fork keeps\n // every native piece visible and the menu's additional rows unlisted, so\n // data-root-kind never hides controls the takeover did not replace.\n const treeVisible = selected !== 'primary' && panel !== undefined && pane !== null && filesTree !== undefined\n const selectedPath = selected === 'primary' ? undefined : selected.path\n\n // While an additional root is selected the pane's body area belongs to the\n // forked tree: the takeover mints the AbortController the face's watches\n // and store bucket live under, and the dockkit tabHost's\n // data-dockkit-content supplies the same tab id the native tree uses — so\n // the fork's store bucket, scroll memory, and expansion state are keyed\n // exactly like a real Files tab. Deselecting, switching roots, or\n // unmounting aborts the controller: the face forgets the bucket and closes\n // every watch, mirroring what upstream's tab-record signal does on close.\n useEffect(() => {\n if (!treeVisible || selectedPath === undefined) { setTakeover(null); return }\n const controller = new AbortController()\n const tabId = (wrapperRef.current?.closest<HTMLElement>('[data-dockkit-content]')?.dataset.dockkitContent ?? '')\n || (fallbackTabId.current ??= `mrfw-${Math.random().toString(36).slice(2)}` as TabId)\n setTakeover({ signal: controller.signal, tabId: tabId as TabId, root: selectedPath })\n return () => { controller.abort() }\n }, [treeVisible, selectedPath])\n\n const items = useMemo((): MenuEntry[] => [\n { id: 'primary', label: `${primaryLabel} · ${t('panel.primary')}`, icon: <IconFolderOpen /> },\n // Where the fork cannot render, the additional rows stay out of the menu\n // entirely: offering a root the body cannot browse would desynchronize\n // the label from the pane. The primary row and the manager stay.\n ...(filesTree === undefined ? [] : roots).map((root): MenuEntry => ({\n id: `root:${root.id}`,\n label: root.state === 'available' ? displayNameOf(root) : `${displayNameOf(root)} · ${t(stateKey(root.state))}`,\n icon: <IconFolderClose />,\n disabled: root.state !== 'available',\n })),\n ], [roots, primaryLabel, t, filesTree])\n\n const onSelect = (id: string): void => {\n setMenuOpen(false)\n if (id === 'manage') { setDialogOpen(true); return }\n if (id === 'primary') { setSelected('primary'); return }\n const root = roots.find(candidate => `root:${candidate.id}` === id)\n if (root !== undefined) setSelected(root)\n }\n\n return (\n <>\n <span\n ref={wrapperRef}\n className=\"mrfw-rootSwitcher\"\n data-root-kind={treeVisible ? 'additional' : 'primary'}\n >\n <Menu\n open={menuOpen}\n onClose={() => { setMenuOpen(false) }}\n items={items}\n // The manager entry pins below the scrolling roots list — it is\n // chrome, not a root, and a long registry must not scroll it away.\n footer={[{ id: 'manage', label: t('switcher.manage'), icon: <IconSettings /> }]}\n selectedId={selected === 'primary' ? 'primary' : `root:${selected.id}`}\n onSelect={onSelect}\n portal\n align=\"start\"\n anchor={(\n <button\n type=\"button\"\n className=\"mrfw-rootSwitchBtn\"\n title={triggerPath}\n aria-haspopup=\"menu\"\n aria-expanded={menuOpen}\n onClick={() => {\n const opening = !menuOpen\n setMenuOpen(opening)\n // States change between opens; the menu always lists a fresh\n // view rather than the snapshot from the previous visit.\n if (opening) void refresh()\n }}\n >\n <span className=\"mrfw-triggerIcon\" aria-hidden=\"true\"><IconFolderClose size={16} /></span>\n <span className=\"mrfw-rootSwitchLabel\">{triggerLabel}</span>\n <span className=\"mrfw-triggerIcon mrfw-rootSwitchChevron\" aria-hidden=\"true\"><IconChevronDown size={14} /></span>\n </button>\n )}\n />\n {/* The selected root's full path, between the trigger and the reload:\n the same PathLabel upstream puts in this spot, so the header reads\n exactly as before except the label now follows the selection. On a\n runtime that does not export PathLabel a plain span carries the\n same class and title instead. */}\n {PathLabel === undefined\n ? <span className=\"mrfw-switcherPath\" title={triggerPath}>{triggerPath}</span>\n : <PathLabel path={triggerPath} className=\"mrfw-switcherPath\" />}\n {/* The takeover hides the native reload (it refreshes the hidden\n tree), so the header gets a replacement of its own — same position,\n same icon-button recipe as the upstream `.tool`, and upstream's own\n `reload` string through the fork's bound namespace. It calls the\n face's refresh: every mounted directory re-lists under its current\n rows, so a refresh never blanks to a loading note. Rendered under\n exactly the portal condition, so a menu-only switcher never shows\n a dead button. */}\n {treeVisible && filesTree !== undefined ? (\n <button\n type=\"button\"\n className=\"mrfw-switcherReload\"\n aria-label={filesTree.t('reload')}\n title={filesTree.t('reload')}\n onClick={() => { if (takeover !== null) filesTree.face.refresh(takeover.tabId) }}\n >\n <IconRefresh size={15} />\n </button>\n ) : null}\n {/* The takeover hides the native open-in-app split button (its slot\n props only ever carry the primary root), so the header gets the\n plugin's verbatim fork of that same control, pointed at the\n selected additional root — same component, same dictionary, same\n persisted app choice, same routes. Rendered under exactly the\n hide rule's condition; undefined adapter means no button, just\n like upstream's own \"no apps\" absence. */}\n {treeVisible && props.openInApp !== undefined ? (\n <OpenInAppAction {...props.openInApp} absolutePath={triggerPath} />\n ) : null}\n </span>\n {treeVisible && takeover !== null && filesTree !== undefined\n ? createPortal(\n <FilesTree\n tabId={takeover.tabId}\n sessionId={filesTree.sessionId}\n root={takeover.root}\n signal={takeover.signal}\n useStore={filesTree.useStore}\n actions={filesTree.actions}\n start={filesTree.face.start}\n toggle={filesTree.face.toggle}\n onOpen={filesTree.openFile}\n t={filesTree.t}\n />,\n pane,\n )\n : null}\n {dialogOpen ? (\n <WorkspaceFoldersDialog\n panel={props.panel}\n pickDirectory={props.pickDirectory}\n {...(props.sessionId === undefined ? {} : { sessionId: props.sessionId })}\n {...(props.subscribeSession === undefined ? {} : { subscribeSession: props.subscribeSession })}\n t={t}\n onClose={() => {\n setDialogOpen(false)\n // The manager may have removed or invalidated the selected root;\n // those mutations live in the dialog's own state and never reach\n // this snapshot, so closing re-lists and lets the reconciliation\n // above drop a selection the registry revoked.\n void refresh()\n }}\n />\n ) : null}\n </>\n )\n}\n","/**\n * Browser half of the multi-root workspace plugin.\n *\n * Sidebar footer and optional Files actions open the Workspace Folders dialog.\n * Everything it needs arrives through services the composition already\n * provides — `slots` to contribute, `locale` for its copy, `connection` for the\n * channel to the host half, and (optionally) `uiWorkspace` for the composed\n * directory picker and the client Session Controller for the current session.\n *\n * `slots.inject` is the soft seam: the footer action is registered when a\n * sidebar declares that slot and never otherwise, so a runtime whose sidebar\n * surface differs simply shows no panel instead of failing the client graph.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client\n */\n\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\n// Type-only: the SlotMap merge this plugin registers against, plus the CLIENT\n// faces that publish `ctx.slots` / `ctx.locale` on the browser context.\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-connection/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-workspace/client'\n// Merges `sessionId` onto session-scope composed props and `SessionId` onto\n// the inject factory's first parameter — the same merge upstream's Files\n// registration compiles against.\nimport type {} from '@deepseek-ai/dsh-client-ui-session/client'\nimport { createElement } from 'react'\nimport type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { ShortcutCatalogEntry } from '@deepseek-ai/dsh-client-shortcuts/client'\nimport { currentSessionIdOf, subscribeSessions, subscribeCurrentSession } from '../compat/client-session.ts'\nimport { createPanelClient, type PanelClient } from './panel-client.ts'\nimport { NS, en, zh } from './locales.ts'\nimport { STYLES } from './styles.ts'\nimport { installSkillsClient } from './skills.tsx'\nimport { installSkillsSettingsCard } from './skills-settings.tsx'\nimport { RootSwitcher } from './RootSwitcher.tsx'\nimport { WorkspaceFoldersAction, type Translate } from './WorkspaceFoldersAction.tsx'\nimport { OPEN_IN_APP_NS, createOpenInAppAdapter } from './open-in-app/adapter.tsx'\nimport { OpenInAppToast } from './open-in-app/open-toast.tsx'\nimport { FILES_TREE_NS, createFilesTreeSeats, createFilesTreeSurface } from './files-tree/adapter.tsx'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface SlotMap {\n 'sidebar.right.tab.files.actions': {\n kind: 'list'\n scope: 'session'\n owner: { readonly absolutePath: string }\n }\n }\n}\n\n/** The footer-action cell this plugin owns. */\nexport const SLOT_ID = 'multi-root-folders'\n\n/** The id of the `<style>` element carrying this plugin's sheet. */\nconst STYLE_ELEMENT_ID = 'multi-root-workspace-styles'\n\n/** Services the client half needs before it may activate. */\nexport const inject = ['slots', 'locale', 'connection']\n\n/**\n * Register the panel.\n * @param ctx - the client root context.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'multi-root-workspace: dictionaries')\n\n // The panel's classes resolve against this sheet; removing it on unload keeps\n // a hot-unplugged plugin from leaving dead rules behind.\n ctx.effect(() => {\n let element = document.getElementById(STYLE_ELEMENT_ID)\n if (element === null) {\n element = document.createElement('style')\n element.id = STYLE_ELEMENT_ID\n element.textContent = STYLES\n document.head.append(element)\n }\n return () => { element?.remove() }\n }, 'multi-root-workspace: styles')\n\n // Cordis binds `this.ctx` to the *caller's* fiber for the registry methods, so\n // reading the injected services here keeps them owned by this plugin.\n const panel: PanelClient | undefined = (() => {\n const connection = ctx.get('connection')\n return connection === undefined ? undefined : createPanelClient(connection)\n })()\n const pickDirectory = async (): Promise<string | null> => {\n const workspace = readService<{ pickDirectory?: () => Promise<string | null> }>(ctx, 'uiWorkspace')\n if (workspace?.pickDirectory === undefined) return null\n return await workspace.pickDirectory()\n }\n // The selection field moved between supported releases; the probe lives in\n // compat so this entry never compares version strings.\n const sessionId = (): string | undefined => currentSessionIdOf(readService(ctx, 'sessions'))\n const subscribeSession = (listener: () => void): (() => void) => subscribeSessions(readService(ctx, 'sessions'), listener)\n const t = ctx.locale.bind(NS) as unknown as Translate\n installSkillsClient(ctx, t, listener => subscribeCurrentSession(readService(ctx, 'sessions'), listener))\n installSkillsSettingsCard(ctx, t)\n // The fork binds upstream's own open-in-app namespace — the same strings\n // the native button shows, upstream's dictionary updates included. The\n // adapter is undefined where the fork cannot render (pixel-era glyph\n // names), which is also upstream's own \"no button\" state.\n const openInApp = createOpenInAppAdapter({\n t: ctx.locale.bind(OPEN_IN_APP_NS) as unknown as (key: string, params?: Record<string, unknown>) => string,\n shortcuts: readService<{ catalog?: ObservableSnapshot<readonly ShortcutCatalogEntry[]> }>(ctx, 'shortcuts')?.catalog,\n })\n // The toast entry mirrors upstream's own `shell.overlay` registration so a\n // native-open failure (and a mobile handoff) announces from the shell even\n // after this panel unmounts; absent adapter means the fork cannot render.\n if (openInApp !== undefined) {\n const { toast } = openInApp\n ctx.slots.inject('shell.overlay', () => ctx.slots.register({\n name: 'shell.overlay', id: 'multi-root-open-in-app.toast', locale: OPEN_IN_APP_NS,\n inject: () => ({ hooks: toast.hooks, dismiss: toast.dismiss }),\n }, OpenInAppToast))\n }\n // The files-tree fork's seats: an exclusive store and the verbatim face\n // over a lazily resolved `remote` — the same declaration upstream's own\n // Files registration makes, plus the session-bound open route. The fork\n // binds upstream's `sidebarFiles` namespace so its rows say exactly what\n // the native tree says.\n const filesTreeSeats = createFilesTreeSeats(ctx)\n const filesTreeT = ctx.locale.bind(FILES_TREE_NS)\n\n ctx.slots.inject('sidebar.footer.action', () => ctx.slots.register({\n name: 'sidebar.footer.action',\n id: SLOT_ID,\n // After the shipped foot controls; the sidebar sorts a list slot by `order`.\n order: 50,\n // A thunk: the sidebar re-reads it per projection, so the label follows the\n // active locale without re-registering.\n label: () => t('action.label'),\n locale: NS,\n // The composed props include the owner share (`{ wide }`): forwarding it\n // lets the trigger render its rail form when the sidebar collapses.\n }, owner => {\n const wide = (owner as { readonly wide?: boolean } | undefined)?.wide\n return createElement(WorkspaceFoldersAction, {\n panel,\n pickDirectory,\n sessionId,\n subscribeSession,\n t,\n ...(wide === undefined ? {} : { wide }),\n })\n }))\n // Optional: old surfaces without the Files actions slot retain the footer entry.\n ctx.slots.inject('sidebar.right.tab.files.actions', () => ctx.slots.register({\n name: 'sidebar.right.tab.files.actions', id: SLOT_ID, order: 50,\n // The fork's store + face, declared exactly as upstream declares them on\n // its own registration: the framework mints the store per session, runs\n // the inject factory with (sessionId, bound actions), and spreads the\n // face's members onto the composed props.\n store: filesTreeSeats.store,\n inject: filesTreeSeats.inject,\n }, function FilesActionsOccupant(props) {\n // The slot contract promises owner.absolutePath — the pane's primary root.\n // A runtime that stops carrying it falls back to the icon-only launcher\n // rather than to a nameless switcher.\n const absolutePath = (props as { readonly absolutePath?: string } | undefined)?.absolutePath\n // The slot is session-scoped: `props.sessionId` is THIS pane's session —\n // the same identity the framework minted `filesTree` with. Panel calls\n // must target it, not the global current-session resolver: a Files pane\n // that outlives a session switch would otherwise list — and fail to\n // route — another session's roots over its own tree and primary root.\n // The global resolver remains the fallback for a composition that\n // composes the occupant without session shares.\n const paneSessionId = (): string | undefined =>\n (props as { readonly sessionId?: string } | undefined)?.sessionId ?? sessionId()\n // The wrapper is rebuilt per render but every member it carries is a\n // framework-stable prop or an apply-level constant, so the switcher's\n // takeover effect — which keys on the selection, not the wrapper —\n // never restarts because of it. `undefined` means the fork cannot mount.\n const filesTree = createFilesTreeSurface(props, filesTreeT)\n return absolutePath === undefined\n ? createElement(WorkspaceFoldersAction, { panel, pickDirectory, sessionId: paneSessionId, subscribeSession, t, compact: true })\n : createElement(RootSwitcher, { primaryPath: absolutePath, panel, pickDirectory, sessionId: paneSessionId, subscribeSession, t, openInApp: openInApp?.adapter, filesTree })\n }))\n}\n\n/**\n * Read one optional service by name.\n *\n * Both lookups are deliberately untyped reads: the client Session Controller\n * and the workspace UI service are composed by the surface, not by this\n * plugin, and neither is a dependency it may assume (the footer action exists\n * on surfaces where they do not). Absence is a supported state — the panel then\n * shows \"No active session\" and does not ask the host to guess a workspace root.\n * @param ctx - the client context.\n * @param name - the service key to read.\n * @returns the service, or `undefined` when this composition has none.\n */\nfunction readService<T>(ctx: ClientContext, name: string): T | undefined {\n const reader = ctx as unknown as { get(key: string): unknown }\n return reader.get(name) as T | undefined\n}\n\nexport type { PanelClient, Translate }\n"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,29,35,36,40],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCA,SAAgB,mBAAmB,UAAuC;GACxE,MAAM,WAAW,eAAe,QAAQ;GACxC,IAAI,aAAa,KAAA,GAAW,OAAO,KAAA;GACnC,MAAM,UAAU,SAAS;GACzB,IAAI,OAAO,YAAY,YAAY,YAAY,IAAI,OAAO;GAC1D,OAAO,kBAAkB,SAAS,IAAI;EACxC;;EAGA,SAAgB,kBAAkB,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E,KAAK;IACvC,CAAC;GACH,CAAC,CAAC;GAEF,IAAI,MAAM,OAAO,yCAAyC,IAAI,MAAM,SAAS;IAC3E,MAAM;IAAmC,IAAI;IAAS,OAAO;IAK7D,OAAO,eAAe;IACtB,QAAQ,eAAe;GACzB,GAAG,SAAS,qBAAqB,OAAO;IAItC,MAAM,eAAgB,OAA0D;IAQhF,MAAM,sBACH,OAAuD,aAAa,UAAU;IAKjF,MAAM,YAAY,uBAAuB,OAAO,UAAU;IAC1D,OAAO,iBAAiB,KAAA,KAAA,GACpBA,MAAAA,cAAAA,CAAc,wBAAwB;KAAE;KAAO;KAAe,WAAW;KAAe;KAAkB;KAAG,SAAS;IAAK,CAAC,KAAA,GAC5HA,MAAAA,cAAAA,CAAc,cAAc;KAAE,aAAa;KAAc;KAAO;KAAe,WAAW;KAAe;KAAkB;KAAG,WAAW,WAAW;KAAS;IAAU,CAAC;GAC9K,CAAC,CAAC;EACJ;;;;;;;;;;;;;EAcA,SAAS,YAAe,KAAoB,MAA6B;GAEvE,OAAOC,IAAO,IAAI,IAAI;EACxB"}
1
+ {"version":3,"file":"client.js","names":["F","_a","util.jsonStringifyReplacer","initializer","core.$ZodAsyncError","util.finalizeIssue","core.config","validateAsync","_emoji","number","boolean","util.nullish","util.floatSafeRemainder","util.NUMBER_FORMAT_RANGES","util.codePointLength","util.getLengthableOrigin","regexes.lowercase","regexes.uppercase","util.escapeRegex","content","util.aborted","util.explicitlyAborted","core.$ZodAsyncError","util.hide","util.finalizeIssue","core.config","regexes.anyString","regexes.guid","regexes.uuid","regexes.email","regexes.emoji","regexes.nanoid","regexes.nanoidOfLength","regexes.cuid","regexes.cuid2","regexes.ulid","regexes.xid","regexes.ksuid","regexes.datetime","regexes.date","regexes.time","regexes.duration","regexes.ipv4","regexes.ipv6","regexes.cidrv4","regexes.cidrv6","regexes.e164","regexes.number","regexes.boolean","util.sizeCaps","util.prefixIssues","util.optionalKeys","util.cached","isObject","util.isObject","util.esc","allowsEval","util.allowsEval","util.cleanRegex","util.isPlainObject","util.getEnumValues","util.escapeRegex","core.$ZodEncodeError","util.issue","util.rawShape","util.parsedType","util.stringifyPrimitive","util.joinValues","util.normalizeParams","checks.$ZodCheckLessThan","checks.$ZodCheckGreaterThan","checks.$ZodCheckMultipleOf","checks.$ZodCheckMaxLength","checks.$ZodCheckMinLength","checks.$ZodCheckLengthEquals","checks.$ZodCheckRegex","checks.$ZodCheckLowerCase","checks.$ZodCheckUpperCase","checks.$ZodCheckIncludes","checks.$ZodCheckStartsWith","checks.$ZodCheckEndsWith","checks.$ZodCheckOverwrite","util.slugify","issue","util.issue","checks.$ZodCheck","regexes.base64","regexes.base64url","core.formatError","core.flattenError","util.jsonStringifyReplacer","en","core.memoizer","util.mergeDefs","core.clone","checks.overwrite","util.hide","core.standardProps","parse.parse","parse.parseAsync","parse.safeParse","parse.safeParseAsync","parse.validate","parse.validateAsync","parse.encode","parse.decode","parse.encodeAsync","parse.decodeAsync","parse.safeEncode","parse.safeDecode","parse.safeEncodeAsync","parse.safeDecodeAsync","processors.stringProcessor","processors.aggregateChecks","checks.regex","checks.includes","checks.startsWith","checks.endsWith","checks.minLength","checks.maxLength","checks.length","checks.lowercase","checks.uppercase","checks.trim","checks.normalize","checks.toLowerCase","checks.toUpperCase","checks.slugify","core._email","core._url","core._jwt","core._emoji","core._guid","core._uuid","core._uuidv4","core._uuidv6","core._uuidv7","core._nanoid","core._cuid","core._cuid2","core._ulid","core._base64","core._base64url","core._xid","core._ksuid","core._ipv4","core._ipv6","core._cidrv4","core._cidrv6","core._e164","core._isoDateTime","core._isoDate","core._isoTime","core._isoDuration","core._string","processors.numberProcessor","checks.gt","checks.gte","checks.lt","checks.lte","checks.multipleOf","core._number","core._int","processors.booleanProcessor","core._boolean","processors.unknownProcessor","core._unknown","processors.neverProcessor","core._never","processors.arrayProcessor","core._array","processors.objectProcessor","util.extend","util.safeExtend","util.merge","util.pick","util.omit","util.partial","util.required","util.normalizeParams","processors.unionProcessor","processors.intersectionProcessor","processors.enumProcessor","processors.transformProcessor","core.$ZodEncodeError","issue","util.issue","processors.optionalProcessor","processors.nullableProcessor","processors.defaultProcessor","util.shallowClone","processors.prefaultProcessor","processors.nonoptionalProcessor","processors.catchProcessor","core.util.constantCatch","processors.pipeProcessor","processors.readonlyProcessor","processors.customProcessor","core._refine","core._superRefine","z.string","z.object","z.number","z.boolean","z.array","z.object","z.string","z.number","z.boolean","z.enum","z.array","z.unknown","NS","useSyncExternalStore","useState","useRef","Switch","installed","primitives","defineStore","NS","css","css","useRef","createSnapshotStore","installed","shared","createSnapshotStore","useState","useRef","IconRightUpOutlineRegular","IconFolderOpenOutlineRegular","Menu","Tooltip","IconChevronDownOutlineRegular","primitives","createSnapshotStore","Toast","IconWarningOutlineRegular","useSyncExternalStore","useState","useRef","useCallback","Menu","Modal","useState","useRef","useCallback","useMemo","Menu","createPortal","NS","OPEN_IN_APP_NS","FILES_TREE_NS","createElement","useCallback","reader"],"sources":["../src/compat/client-session.ts","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.js","../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.js","../src/skills-contract.ts","../src/contract.ts","../src/client/locales.ts","../src/client/panel-client.ts","../src/client/styles.ts","../src/compat/skills-client.ts","../src/client/skills-client.ts","../src/client/skills.tsx","../src/client/skills-settings.tsx","../src/compat/client-icons.ts","../node_modules/.pnpm/@deepseek-ai+dsh-typert-protocol@0.2.2-alpha.2_@deepseek-ai+cordis@4.0.6-alpha.1/node_modules/@deepseek-ai/dsh-typert-protocol/lib/index.js","../src/client/files-tree/directory-node.ts","../src/client/files-tree/face.ts","../src/client/files-tree/store.ts","../src/client/files-tree/primitives.ts","../src/client/files-tree/locales.ts","../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../node_modules/.pnpm/@deepseek-ai+dsh-util-workspace-path@0.2.2-alpha.2_@deepseek-ai+cordis@4.0.6-alpha.1/node_modules/@deepseek-ai/dsh-util-workspace-path/lib/index.js","../src/client/files-tree/FilesBody.module.css.ts","../src/client/files-tree/FilesTree.tsx","../src/client/files-tree/adapter.tsx","../node_modules/.pnpm/@deepseek-ai+dsh-host-open-in-app@0.2.2-alpha.2_@deepseek-ai+cordis@4.0.6-alpha.1_@deep_d76f08f4e35ff3a756a48d7d013379f6/node_modules/@deepseek-ai/dsh-host-open-in-app/lib/types/shared.js","../src/compat/open-in-app-routes.ts","../src/client/open-in-app/applications.ts","../src/client/open-in-app/controller.ts","../src/client/open-in-app/locales.ts","../src/client/open-in-app/OpenTargetButton.module.css.ts","../src/client/open-in-app/OpenTargetButton.tsx","../src/client/open-in-app/OpenInAppAction.tsx","../src/compat/open-in-app-device.ts","../src/client/open-in-app/open-toast.tsx","../src/client/open-in-app/adapter.tsx","../src/client/WorkspaceFoldersAction.tsx","../src/client/RootSwitcher.tsx","../src/client/index.ts"],"sourcesContent":["/**\n * Compatibility adapter for \"which session is the client looking at\".\n *\n * The browser panel has to name that session before it may call the host\n * (ADR-0008). Upstream moved the fact between two releases this plugin\n * supports, without renaming the `sessions` service:\n *\n * ```text\n * 0.1.5-rc.2, 0.1.6-alpha.1\n * sessions.list.getSnapshot().current SessionId | undefined\n * 0.1.6-alpha.2, 0.1.7-alpha.1, 0.1.7-alpha.2, 0.1.7-rc.1, 0.1.7-rc.2\n * the catalog has no `current`. The main view retains its session with\n * source `mainView`, and that count is projected onto the list row:\n * sessions.list.getSnapshot().byId[id].retainedBy.mainView > 0\n * ```\n *\n * Reading only `current` makes 0.1.6-alpha.2 report \"no active session\"\n * while a conversation is on screen. Reading the first catalog id would\n * name a session the operator is not looking at. This probe prefers the\n * explicit selection when that field is a non-empty string, and otherwise\n * the first row the main view actually retains — the same predicate\n * `ui-session` uses to publish the main binding.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/compat/client-session\n */\n\n/** The list snapshot, when the service actually exposes one. */\ninterface ListSnapshot {\n readonly current?: unknown\n readonly byId?: unknown\n}\n\n/**\n * The session the composed client is showing, when it can name one.\n * @param sessions - the client `sessions` service, or whatever this\n * composition provided under that name. Absence is a supported state.\n * @returns the session id, or `undefined` when no main view holds one.\n */\nexport function currentSessionIdOf(sessions: unknown): string | undefined {\n const snapshot = listSnapshotOf(sessions)\n if (snapshot === undefined) return undefined\n const current = snapshot.current\n if (typeof current === 'string' && current !== '') return current\n return mainViewSessionId(snapshot.byId)\n}\n\n/** Observe native catalog changes when this surface provides a subscribable store. */\nexport function subscribeSessions(sessions: unknown, listener: () => void): () => void {\n if (sessions === null || typeof sessions !== 'object') return () => {}\n const list = (sessions as { list?: { subscribe?: (listener: () => void) => () => void } }).list\n return typeof list?.subscribe === 'function' ? list.subscribe(listener) : () => {}\n}\n\n/** Selection changes only: activity/title updates must not close a Skill preview. */\nexport function subscribeCurrentSession(sessions: unknown, listener: () => void): () => void {\n let previous = currentSessionIdOf(sessions)\n return subscribeSessions(sessions, () => {\n const current = currentSessionIdOf(sessions)\n if (current !== previous) { previous = current; listener() }\n })\n}\n\n/**\n * The list snapshot, when the service actually exposes one.\n *\n * `getSnapshot` is invoked as a method so a real store can read `this`.\n * Extracting the function and calling it unbound drops that binding and\n * yields `undefined` even when a session is selected.\n */\nfunction listSnapshotOf(sessions: unknown): ListSnapshot | undefined {\n if (sessions === null || typeof sessions !== 'object') return undefined\n const list = (sessions as { list?: unknown }).list\n if (list === null || typeof list !== 'object') return undefined\n const holder = list as { getSnapshot?: unknown }\n if (typeof holder.getSnapshot !== 'function') return undefined\n let snapshot: unknown\n try {\n snapshot = holder.getSnapshot()\n } catch {\n return undefined\n }\n if (snapshot === null || typeof snapshot !== 'object') return undefined\n return snapshot as ListSnapshot\n}\n\n/**\n * The first catalog row retained by the main view.\n *\n * Enumeration order is the catalog's insertion order, which is the order\n * upstream's own main-binding projection scans. A row counts only while\n * `retainedBy.mainView` is a positive number: zero, a missing source, and a\n * non-numeric value are not a selection.\n * @param byId - the catalog map, or anything else the snapshot happened to carry.\n * @returns that row's session id.\n */\nfunction mainViewSessionId(byId: unknown): string | undefined {\n if (byId === null || typeof byId !== 'object') return undefined\n for (const [key, row] of Object.entries(byId)) {\n if (!isMainViewRow(row)) continue\n const id = (row as { id?: unknown }).id\n if (typeof id === 'string' && id !== '') return id\n if (key !== '') return key\n }\n return undefined\n}\n\n/** Whether one catalog value is a row the main view currently retains. */\nfunction isMainViewRow(row: unknown): boolean {\n if (row === null || typeof row !== 'object') return false\n const retainedBy = (row as { retainedBy?: unknown }).retainedBy\n if (retainedBy === null || typeof retainedBy !== 'object') return false\n const count = (retainedBy as { mainView?: unknown }).mainView\n return typeof count === 'number' && count > 0\n}\n","import { globalConfig } from \"./core.js\";\n// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function toZod() {\n return (schema) => schema;\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}\n// the accessor lives on a shared prototype: an own accessor makes every box a dictionary-mode object (~360 B and a slow load per read against ~100 B and an inlined getter here)\nclass Cached {\n constructor(getter) {\n this._getter = getter;\n this._value = undefined;\n }\n get value() {\n const getter = this._getter;\n if (getter !== undefined) {\n this._value = getter();\n this._getter = undefined;\n }\n return this._value;\n }\n}\nexport function cached(getter) {\n return new Cached(getter);\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 ratio = val / step;\n const roundedRatio = Math.round(ratio);\n // `val` and `step` each round to a double before the division rounds again, so a true decimal multiple's quotient can sit up to 1.5 of these scaled epsilons from the integer. A 1x tolerance therefore rejected 2.03 as a multiple of 0.07; 4x covers the worst case with margin.\n const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);\n if (Math.abs(ratio - roundedRatio) < tolerance)\n return 0;\n return ratio - roundedRatio;\n}\nconst EVALUATING = /* @__PURE__*/ 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}\n/**\n * Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.\n *\n * Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.\n */\nexport function rawShape(def) {\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n return desc?.get ? desc.get.raw : desc?.value;\n}\n// where a builder reads its source's keys and descriptors, resolving only a shape a def answers for itself. A shape resolves by object spread, so only its enumerable keys are ever part of it.\nfunction sourceShape(schema) {\n return rawShape(schema._zod.def) ?? schema._zod.def.shape;\n}\n// a key whose value is not settled yet, self-caching so every read after the first gets the same one\nfunction deferProp(target, key, getter) {\n Object.defineProperty(target, key, {\n get() {\n const value = getter();\n assignProp(this, key, value);\n return value;\n },\n enumerable: true,\n configurable: true,\n });\n}\n// Writes a settled key. A plain assignment is much cheaper than `defineProperty` and produces the same descriptor, but it runs whatever setter already answers to the key — an accessor this shape deferred, or an inherited one, which `__proto__` has on every object and prototype pollution can add for any name.\nfunction putProp(target, key, value) {\n if (key in target)\n assignProp(target, key, value);\n else\n target[key] = value;\n}\n/**\n * Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.\n *\n * A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.\n */\nfunction mirrorShape(target, source, keys, wrap) {\n const raw = sourceShape(source);\n for (const key of keys) {\n const desc = Object.getOwnPropertyDescriptor(raw, key);\n if (!desc.enumerable)\n continue;\n if (desc.get) {\n deferProp(target, key, () => {\n const value = source._zod.def.shape[key];\n return wrap ? wrap(value, key) : value;\n });\n }\n else\n putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);\n }\n}\n// same, for a plain shape a caller passed rather than a schema's\nfunction mirrorProps(target, source) {\n for (const key of Reflect.ownKeys(source)) {\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!desc.enumerable)\n continue;\n if (desc.get)\n deferProp(target, key, () => source[key]);\n else\n putProp(target, key, desc.value);\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 = /* @__PURE__*/ cached(() => {\n // Skip the probe under `jitless`: strict CSPs report the caught `new Function` as a `securitypolicyviolation` even though the throw is swallowed.\n if (globalConfig.jitless) {\n return false;\n }\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 if (o instanceof Map)\n return new Map(o);\n if (o instanceof Set)\n return new Set(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 = /* @__PURE__*/ new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = /* @__PURE__*/ new Set([\n \"string\",\n \"number\",\n \"bigint\",\n \"boolean\",\n \"symbol\",\n \"undefined\",\n]);\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 !== undefined && shape[k]._zod.optout === \"optional\";\n });\n}\n// Wrapped in a `@__PURE__` IIFE: esbuild never tree-shakes a top-level initializer that contains a member access on `Number`, so the bare object literal survived into every bundle.\nexport const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({\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 newShape = {};\n mirrorShape(newShape, schema, maskedKeys(schema, mask));\n return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));\n}\n// the mask keys that select something, checked against the source's shape without resolving it\nfunction maskedKeys(schema, mask) {\n const raw = sourceShape(schema);\n const keys = [];\n // `for...in` skips symbols, so a symbol in the mask would select nothing\n for (const key of Reflect.ownKeys(mask)) {\n if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {\n throw new Error(`Unrecognized key: \"${String(key)}\"`);\n }\n if (mask[key])\n keys.push(key);\n }\n return keys;\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 omitted = new Set(maskedKeys(schema, mask));\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));\n return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));\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. Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = sourceShape(schema);\n for (const key of Reflect.ownKeys(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 return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));\n}\n// the source's keys, then the caller's overlaid on top\nfunction extended(schema, shape) {\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));\n mirrorProps(newShape, shape);\n return newShape;\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));\n}\nexport function merge(a, b) {\n if (!b?._zod?.def) {\n throw new Error(\"Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.\");\n }\n if (a._zod.def.checks?.length) {\n throw new Error(\".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.\");\n }\n const newShape = {};\n mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));\n mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));\n const def = mergeDefs(a._zod.def, {\n shape: newShape,\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: b._zod.def.checks ?? [],\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask, name = \"partial\") {\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(`.${name}() cannot be used on object schemas containing refinements`);\n }\n const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class &&\n ((value, key) => (selected && !selected.has(key) ? value : new Class({ type: \"optional\", innerType: value }))));\n return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));\n}\nexport function required(Class, schema, mask) {\n const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;\n const newShape = {};\n mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => \n // overwrite with non-optional\n selected && !selected.has(key) ? value : new Class({ type: \"nonoptional\", innerType: value }));\n return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));\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}\n// Checks for explicit abort (continue === false), as opposed to implicit abort (continue === undefined). Used to respect `abort: true` in .refine() even for checks that have a `when` function.\nexport function explicitlyAborted(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 === false) {\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}\n/* A check holds no link back to the schema it is attached to — the same check instance is shared by every clone of that schema — so the owner is stamped onto the issues a check just raised, at the only point where both are in scope. Runs on the failure path only; `start` is the issue count from before the check ran. */\n/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */\nexport function sizeCaps(defChecks) {\n const caps = [];\n for (const ch of defChecks ?? []) {\n const d = ch._zod.def;\n // a later check may rewrite the value\n if (!/_(length|size)$|_equals$/.test(d.check))\n break;\n const max = d.maximum ?? d.length ?? d.size;\n if (max >= 0)\n caps.push([max, ch]);\n }\n return caps;\n}\nexport function attachSchema(issues, start, inst) {\n var _a;\n for (let i = start; i < issues.length; i++) {\n (_a = issues[i]).schema ?? (_a.schema = inst);\n }\n}\nexport function finalizeIssue(iss, ctx, config) {\n var _a;\n // A schema that raised an issue itself owns it outright, and outranks any stamp an enclosing check left in `attachSchema`. String formats and z.custom() are schema and check at once, so when they act as a check they defer to that stamp instead.\n const traits = iss.inst?._zod?.traits;\n if (traits?.has(\"$ZodType\")) {\n if (traits.has(\"$ZodCheck\"))\n (_a = iss).schema ?? (_a.schema = iss.inst);\n else\n iss.schema = iss.inst;\n }\n // Decreasing specificity, first map to return a message wins. `inst` is whatever raised the issue, so a check's own map outranks the owning schema's.\n const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;\n const message = iss.message\n ? iss.message\n : (unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(schemaError?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\");\n // an explicit own-key copy beats object rest with excluded keys, which v8 routes through a generic runtime call; Object.keys rather than for-in so an issue pushed with a prototype does not leak inherited keys, and an own __proto__ key is dropped rather than assigned through the setter\n const full = {};\n for (const k of Object.keys(iss)) {\n if (k === \"inst\" || k === \"schema\" || k === \"continue\" || k === \"input\" || k === \"__proto__\")\n continue;\n full[k] = iss[k];\n }\n full.path ?? (full.path = []);\n full.message = message;\n if (ctx?.reportInput) {\n full.input = iss.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}\nconst highSurrogate = /[\\uD800-\\uDBFF]/;\n// Code points in `str`: a surrogate pair counts once, a lone surrogate as itself. Hand-rolled because the string iterator allocates and runs ~250x slower on this path; the regex probe exits ~50x quicker for a string with no astral characters.\nexport function codePointLength(str) {\n const units = str.length;\n if (!highSurrogate.test(str))\n return units;\n let count = units;\n for (let i = 0; i < units - 1; i++) {\n if ((str.charCodeAt(i) & 0xfc00) === 0xd800 && (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n count--;\n i++;\n }\n }\n return count;\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////////// PROTOTYPE INSTALLERS //////////\n//\n// Members live on the prototype and materialize per instance on first read, which keeps own-property count under the step where V8 stops using inline slots. Changing anything here means re-measuring runtime, memory and bundle size together — see \"The three axes\" in AGENTS.md.\n/**\n * Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.\n *\n * Call this from a `proto` initializer, which runs once per prototype — never per instance.\n */\nexport function members(proto, table) {\n for (const key in table) {\n const desc = Object.getOwnPropertyDescriptor(table, key);\n // a getter installs as written, so it stays live: `description` reads through to the registry on every access. not enumerable: an object literal's is, and a prototype member never was\n if (desc.get)\n Object.defineProperty(proto, key, { ...desc, enumerable: false });\n // a method materializes bound on first read, which is what keeps a detached member working: `const opt = schema.optional; opt()`\n else\n defineBound(proto, key, desc.value);\n }\n}\n/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */\nexport function own(inst, key, value, enumerable = true) {\n Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });\n return value;\n}\n/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */\nexport function hide(inst, key, value) {\n return own(inst, key, value, false);\n}\n/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */\nexport /*@__NO_SIDE_EFFECTS__*/ function derived(computes, table) {\n for (const key in computes) {\n const compute = computes[key];\n // an object literal's accessor is configurable and enumerable, and `members` copies the descriptor as written\n Object.defineProperty(table, key, {\n configurable: true,\n enumerable: true,\n get() {\n return own(this, key, compute(this));\n },\n set(value) {\n own(this, key, value);\n },\n });\n }\n return table;\n}\nfunction defineBound(proto, key, fn) {\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n // vitest's spyOn calls a prototype getter bare to find the function it wraps, so a nullish receiver answers the raw method\n return this == null ? fn : own(this, key, fn.bind(this));\n },\n set(value) {\n own(this, key, value);\n },\n });\n}\n/** Returns the prototype to install on, or `undefined` if this group is already installed on it. */\nfunction claim(inst, sentinel) {\n const proto = Object.getPrototypeOf(inst);\n // Runs on every construction, so `in` rather than the costlier `hasOwnProperty.call`. Sentinels are keys the group itself defines.\n return sentinel in proto ? undefined : proto;\n}\n// The internals whose init chain is installing. A second call for the same one is a derived constructor overriding its base, so it must not construct another schema in between or the override is dropped.\nlet installing;\n// Set while a getter is running, so a value that resolved through a recursion break is not memoized. One shared descriptor shadows the key for the duration, which costs no per-key allocation.\nlet broke = false;\nconst breaker = {\n configurable: true,\n get() {\n broke = true;\n return undefined;\n },\n};\n/**\n * Installs a lazily-derived internal on the `_zod` prototype of `inst`'s\n * constructor, computed from the internals object itself and cached there on\n * first read. One accessor per constructor rather than one per instance.\n */\nexport function defineLazyInternal(inst, key, compute) {\n const proto = Object.getPrototypeOf(inst._zod);\n if (key in proto && installing !== inst._zod) {\n // A repeat construction: everything is installed already. Cleared here so the reference is not held past the first construction of every type.\n installing = undefined;\n return;\n }\n installing = inst._zod;\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n // Shadowed before computing so a re-entrant read from a recursive schema resolves to undefined instead of running the getter again.\n Object.defineProperty(this, key, breaker);\n const outer = broke;\n broke = false;\n try {\n const value = compute(this);\n // A result that resolved through a recursion break is recomputed once the graph is complete; everything else memoizes, undefined included.\n if (broke)\n delete this[key];\n else\n Object.defineProperty(this, key, { configurable: true, writable: true, value });\n broke = broke || outer;\n return value;\n }\n catch (err) {\n // A compute that threw memoizes nothing, so a later read runs it again and fails the same way. The shadow goes with it, since leaving it installed would answer undefined for every later read.\n delete this[key];\n broke = broke || outer;\n throw err;\n }\n },\n set(value) {\n Object.defineProperty(this, key, { configurable: true, writable: true, value });\n },\n });\n}\n/**\n * Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own\n * data property. One accessor per constructor rather than one per instance, because an own accessor\n * puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.\n */\nexport function installLazyProp(inst, key, make, enumerable) {\n const proto = claim(inst, key);\n if (!proto)\n return;\n Object.defineProperty(proto, key, {\n configurable: true,\n get() {\n // Shadowed before computing, so a re-entrant read from a self-referential shape resolves to undefined instead of running the getter again. A data property rather than an accessor: an own accessor is the dictionary-mode transition this exists to avoid.\n const desc = { configurable: true, writable: true, enumerable, value: undefined };\n Object.defineProperty(this, key, desc);\n // a compute that throws leaves the shadow behind, so later reads answer undefined instead of re-throwing; `defineLazy` did the same, and `defineLazyInternal`'s delete-on-catch would cost bytes in every bundle for a case only a throwing user getter reaches\n desc.value = make(this);\n Object.defineProperty(this, key, desc);\n return desc.value;\n },\n set(value) {\n Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });\n },\n });\n}\n/** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */\nexport const CONSTANT_CATCH = \"~constantCatch\";\n/** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */\nexport function constantCatch(value) {\n const fn = () => value;\n fn[CONSTANT_CATCH] = true;\n return fn;\n}\n","var _a;\nimport { members as installMembers } from \"./util.js\";\n/** A special constant with type `never` */\nexport const NEVER = /*@__PURE__*/ Object.freeze({\n status: \"aborted\",\n});\n/* Shared descriptor for installing `_zod`; defineProperty reads it\n * synchronously, so reusing one object avoids a per-instance allocation. */\nconst _zodDesc = { value: undefined, enumerable: false };\n// null where suppressing the capture would be unrecoverable: `parse()` puts the frames back with `captureStackTrace`, so without it the throw would lose its stack. also latched to null once `stackTraceLimit` proves unassignable, which a realm can do at any point by hardening Error\nlet _E = \"captureStackTrace\" in Error ? Error : null;\n// v8 captures a stack trace inside the Error constructor, which dominates a failed parse; costs only the frames, and parse() restores those. the constructor must RUN: Object.create is cheaper and passes instanceof, but Error.isError and util.types.isNativeError check an internal slot\nfunction newError(Definition) {\n const E = _E;\n if (E) {\n const saved = E.stackTraceLimit;\n if (typeof saved === \"number\") {\n try {\n E.stackTraceLimit = 0;\n }\n catch {\n _E = null;\n return new Definition();\n }\n try {\n return new Definition();\n }\n finally {\n E.stackTraceLimit = saved;\n }\n }\n }\n return new Definition();\n}\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, \n/** This trait's members, installed once on every prototype that composes it. They cannot be declared in the initializer above: that runs per instance, and the prototype is shared. */\nproto, params) {\n // Prototype for this constructor's `_zod` internals. Lazily-derived fields (`values`, `pattern`, `optin`, …) install here once rather than as an accessor on every instance.\n const zodProto = {};\n // Assigning the fields in the constructor body is what gives instances in-object slots; building the object literally and reparenting it costs a second allocation and a generic property copy.\n function Internals(def) {\n this.def = def;\n this.constr = _;\n this.traits = new Set();\n }\n Internals.prototype = zodProto;\n const protoMembers = proto;\n // One trait's members land on every prototype whose chain composes it, so the answer is per prototype rather than per trait.\n const initialized = protoMembers && new WeakSet();\n function init(inst, def) {\n if (!inst._zod) {\n _zodDesc.value = new Internals(def);\n try {\n Object.defineProperty(inst, \"_zod\", _zodDesc);\n }\n finally {\n // Cleared even on throw, so the shared descriptor never leaks one instance's internals into the next.\n _zodDesc.value = undefined;\n }\n }\n else if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n if (initialized) {\n // `super(def)` from a user subclass gives `this` a prototype the subclass owns, and installing there would overwrite whatever the subclass declared. `constr` built the instance, so its prototype is the one below the subclass's that should carry the members. A receiver whose chain never reaches that prototype installs on its own, which for a plain object handed straight to `init` means `Object.prototype` — unchanged from before.\n const own = Object.getPrototypeOf(inst);\n const ctorProto = inst._zod.constr.prototype;\n let up = own;\n while (up && up !== ctorProto)\n up = Object.getPrototypeOf(up);\n const target = up ?? own;\n if (!initialized.has(target)) {\n initialized.add(target);\n installMembers(target, protoMembers);\n }\n }\n // support prototype modifications; for-in avoids the array allocation of Object.keys on the (usually empty) prototype\n const proto = _.prototype;\n for (const k in proto) {\n if (!Object.prototype.hasOwnProperty.call(proto, k))\n continue;\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 const inst = params?.Parent ? newError(Definition) : this;\n init(inst, def);\n const deferred = inst._zod.deferred;\n if (deferred) {\n for (const fn of deferred) {\n fn();\n }\n // Released: initializers run once, and the list would otherwise be retained for the schema's lifetime.\n inst._zod.deferred = undefined;\n }\n // Global post-processor hook. Internal: installed by `import \"zod/compile\"` to enable AOT compilation for every constructed schema. Runs last, once the instance is fully built, because it hands the instance to compile(). The post-processor is expected to be reentrancy-guarded by its own implementation.\n const pp = globalThis.__zod_globalConfig?.postProcessor;\n if (pp)\n pp(inst);\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 = /*@__PURE__*/ 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}\n(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});\nexport const globalConfig = globalThis.__zod_globalConfig;\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\n/* Computing the message eagerly is expensive (pretty-printed JSON of all\n * issues), so defer it until first read. The accessor functions and\n * descriptors are shared across instances to keep error construction\n * cheap; the computed message is cached on the internals object. The\n * setter preserves plain assignment semantics for consumers that\n * overwrite `message`. */\nfunction _getMessage() {\n const internals = this._zod;\n internals.message ?? (internals.message = JSON.stringify(internals.def, util.jsonStringifyReplacer, 2));\n return internals.message;\n}\nfunction _setMessage(value) {\n this._zod.message = value;\n}\nconst _messageDesc = {\n get: _getMessage,\n set: _setMessage,\n enumerable: true,\n configurable: true,\n};\nconst _issuesDesc = { value: undefined, enumerable: false };\n/* Prototypes that already carry the lazy `toString`. Seeded with the\n * intrinsics so that `init` on a foreign object — it accepts any object —\n * can never install an accessor onto a prototype we do not own. */\nconst _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n // `_zod` is already non-enumerable: $constructor's init defined it with this same descriptor\n _issuesDesc.value = def;\n Object.defineProperty(inst, \"issues\", _issuesDesc);\n // Clear the shared slot; a retained `value` pins the last error's issues.\n _issuesDesc.value = undefined;\n Object.defineProperty(inst, \"message\", _messageDesc);\n /* `toString` lives as a non-enumerable lazy getter on the shared\n * prototype; on first access it caches a per-instance closure so\n * detached usage still works. */\n const proto = Object.getPrototypeOf(inst);\n if (!_installedToString.has(proto)) {\n _installedToString.add(proto);\n Object.defineProperty(proto, \"toString\", {\n configurable: true,\n enumerable: false,\n get() {\n const value = () => this.message;\n Object.defineProperty(this, \"toString\", { value, configurable: true, writable: true });\n return value;\n },\n set(value) {\n Object.defineProperty(this, \"toString\", { value, configurable: true, writable: true });\n },\n });\n }\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, undefined, {\n Parent: Error,\n});\n/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member\n * (\"toString\", \"constructor\") would otherwise read through to the prototype, and assigning\n * \"__proto__\" would hit the setter instead of creating a key. */\nfunction node(obj, key, make) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) {\n if (key === \"__proto__\") {\n Object.defineProperty(obj, key, { value: make(), writable: true, enumerable: true, configurable: true });\n }\n else {\n obj[key] = make();\n }\n }\n return obj[key];\n}\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 node(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, path = []) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n // `_errors` is reserved by this legacy format, so merge a matching path segment into the current node instead of treating its array as a child.\n if (el === \"_errors\") {\n if (terminal)\n curr._errors.push(mapper(issue));\n i++;\n continue;\n }\n // A path element may collide with an inherited property name such as\n // \"__proto__\" or \"constructor\". Truthiness checks read the prototype\n // (so no node is created, then ._errors.push throws), and bracket\n // assignment of \"__proto__\" hits the setter instead of creating an\n // own key. Guard the read with hasOwnProperty and create the node\n // with defineProperty so any path element becomes a real own key.\n if (!Object.prototype.hasOwnProperty.call(curr, el)) {\n Object.defineProperty(curr, el, {\n value: { _errors: [] },\n enumerable: true,\n writable: true,\n configurable: true,\n });\n }\n const node = curr[el];\n if (terminal) {\n node._errors.push(mapper(issue));\n }\n curr = node;\n i++;\n }\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;\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 }, [...path, ...issue.path]));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, [...path, ...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 // el may collide with an inherited property name (\"__proto__\",\n // \"constructor\", ...); ??= reads the prototype so the node is never\n // created and curr.errors.push throws. Guard with hasOwnProperty and\n // create the node with defineProperty so \"__proto__\" becomes a real\n // own key rather than invoking the prototype setter.\n if (!Object.prototype.hasOwnProperty.call(curr.properties, el)) {\n Object.defineProperty(curr.properties, el, {\n value: { errors: [] },\n enumerable: true,\n writable: true,\n configurable: true,\n });\n }\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_a = curr.items)[el] ?? (_a[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\";\n// Always both keys, so the `_params` read site in `_parse` sees one object shape rather than two.\nfunction finalizeParams(callee, params) {\n return { callee: params?.callee ?? callee, Err: params?.Err };\n}\nexport const _parse = (_Err) => {\n const fn = (schema, value, _ctx, _params) => {\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 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 ?? fn);\n throw e;\n }\n return result.value;\n };\n return fn;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => {\n const fn = async (schema, value, _ctx, params) => {\n const ctx = _ctx ? { ..._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 ?? fn);\n throw e;\n }\n return result.value;\n };\n return fn;\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 ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\n// the error is built on the first read of `error`: finalizing the issues and constructing the instance is most of a failing parse, and a caller that only branches on `success` never pays it. a getter in the literal keeps this small; the alternative, one shared accessor descriptor plus a hidden state slot, reads ~15% faster but costs ~75 B gzipped in every bundle\nfunction failure(Err, issues, ctx) {\n let error;\n return {\n success: false,\n get error() {\n if (!error) {\n error = new Err(issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n // finalizeIssue drops `input`, so the built error holds nothing; keeping the raw issues past this point pins the parsed value for the life of the result\n issues = undefined;\n ctx = undefined;\n }\n return error;\n },\n set error(e) {\n error = e;\n // a replacement makes the getter's branch unreachable, so the captures have to go here too\n issues = undefined;\n ctx = undefined;\n },\n };\n}\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._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 ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\n// registry mirrors of the compiler's sentinels, so this module never imports the compiler\nconst COMPILE_INVALID = /* @__PURE__ */ Symbol.for(\"zod.compile.invalid\");\nconst COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for(\"zod.compile.fallback\");\n// Deliberately tiny, because v8 will not inline a body carrying the fallback's object literals and throw. Everything that is not the compiled happy path lives in validateFallback, and that split is worth ~35% on a compiled schema.\nexport const validate = ((schema, value, _ctx) => {\n const validator = schema._zod.bag.validator;\n if (validator !== undefined) {\n if (validator(value) !== COMPILE_INVALID)\n return true;\n // a definite sentinel means the runtime would reject, so skip the re-parse; a ctx can still change the answer\n if (validator.definite === true && _ctx === undefined)\n return false;\n }\n return validateFallback(schema, value, _ctx);\n});\nfunction validateFallback(schema, value, _ctx) {\n const ctx = _ctx\n ? { ..._ctx, async: false, abortEarly: true }\n : { async: false, abortEarly: true };\n const fallbackRun = schema._zod.bag.fallbackRun;\n let result;\n if (fallbackRun) {\n // skip nested fast paths on the fallback, so user callbacks keep the at-most-twice bound\n ctx[COMPILE_FALLBACK] = true;\n result = fallbackRun({ value, issues: [] }, ctx);\n }\n else {\n result = schema._zod.run({ value, issues: [] }, ctx);\n }\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length === 0;\n}\n// no fast path: the compiler keeps async parses on the runtime, because a promise-returning callback that is not declared async compiles to a throw\nexport const validateAsync = async (schema, value, _ctx) => {\n const ctx = _ctx\n ? { ..._ctx, async: true, abortEarly: true }\n : { async: true, abortEarly: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length === 0;\n};\nexport const _encode = (_Err) => {\n const parse = _parse(_Err);\n const fn = (schema, value, _ctx, _params) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return parse(schema, value, ctx, finalizeParams(fn, _params));\n };\n return fn;\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => {\n const parse = _parse(_Err);\n const fn = (schema, value, _ctx, _params) => {\n return parse(schema, value, _ctx, finalizeParams(fn, _params));\n };\n return fn;\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => {\n const parseAsync = _parseAsync(_Err);\n const fn = async (schema, value, _ctx, _params) => {\n const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n return (await parseAsync(schema, value, ctx, finalizeParams(fn, _params)));\n };\n return fn;\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => {\n const parseAsync = _parseAsync(_Err);\n const fn = async (schema, value, _ctx, _params) => {\n return await parseAsync(schema, value, _ctx, finalizeParams(fn, _params));\n };\n return fn;\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._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 ? { ..._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\";\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const cuid = /^[cC][0-9a-z]{6,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\nexport function nanoidOfLength(length) {\n return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);\n}\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-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\n// Single character class, not an alternation: the two properties overlap (U+1F9B0-U+1F9B3), so `(A|B)+` backtracks exponentially on a failed match. The leading lookahead then demands one anchor — a pictograph, a regional indicator, or the enclosing keycap — because `\\p{Emoji_Component}` on its own covers ASCII digits, `#`, `*`, ZWJ, variation selectors and skin tone modifiers, none of which is an emoji without a base.\nconst _emoji = `^(?=[\\\\s\\\\S]*[\\\\p{Extended_Pictographic}\\\\p{Regional_Indicator}\\\\u20E3])[\\\\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}:){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}|:))\\/(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_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;\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 = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,63}$/;\nexport const httpProtocol = /^https?$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces) E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15\nexport const e164 = /^\\+[1-9]\\d{6,14}$/;\n// Credit card shape: 12–19 digits, optionally separated by single spaces or single hyphens. ISO/IEC 7812 caps the PAN at 19 digits; 12 is the shortest issued length (Maestro).\nexport const creditCard = /^\\d(?:[ -]?\\d){11,18}$/;\n// ISO 4217 alpha codes from the SIX list, regenerated by scripts/update-iso-4217.ts\nexport const currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;\n// iban electronic format: 2-letter country, check digits 02-98 (the only values `98 - remainder` can produce), 11-30 bban characters\nexport const iban = /^[A-Z]{2}(?!00|01|99)\\d{2}[A-Z0-9]{11,30}$/;\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])))`;\n/** Anchors a pattern source. The interpolation lives here rather than at the call site because\n * esbuild will not drop a `@__PURE__` call whose own argument interpolates a variable, but it\n * will drop `anchor(dateSource)`. Keeping it inline pinned `date` into every bundle. */\nfunction anchor(source) {\n return new RegExp(`^${source}$`);\n}\nexport const date = /*@__PURE__*/ anchor(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 : args.seconds\n ? `${hhmm}:[0-5]\\\\d(?:\\\\.\\\\d+)?`\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 opts = [\"Z\"];\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 // RFC 3339 mandates seconds wherever the time carries a `Z` or an offset, so only the unqualified form `local` adds may omit them\n const qualified = `${timeSource({ precision: args.precision, seconds: true })}(?:${opts.join(\"|\")})`;\n const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\n// the unbounded form of `string()` as a literal, so every plain string shares one instance instead of building its own\nexport const anyString = /^[\\s\\S]{0,}$/;\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","// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n var _a;\n inst._zod ?? (inst._zod = {});\n inst._zod.def = def;\n (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\n/** Default `when` for size-based checks: run only on non-nullish values with a `size`. */\nconst _whenHasSize = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n};\n/** Default `when` for length-based checks: run only on non-nullish values with a `length`. */\nconst _whenHasLength = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n};\nconst numericOriginMap = {\n number: \"number\",\n bigint: \"bigint\",\n object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n return;\n }\n payload.issues.push({\n origin: numericOriginMap[typeof payload.value] ?? origin,\n code: \"too_big\",\n maximum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n return;\n }\n payload.issues.push({\n origin: numericOriginMap[typeof payload.value] ?? origin,\n code: \"too_small\",\n minimum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n if (typeof payload.value !== typeof def.value)\n throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n const isMultiple = typeof payload.value === \"bigint\"\n ? // `value % 0n` throws, and nothing is a multiple of zero — the number branch already fails this way via NaN\n def.value !== BigInt(0) && payload.value % def.value === BigInt(0)\n : util.floatSafeRemainder(payload.value, def.value) === 0;\n if (isMultiple)\n return;\n payload.issues.push({\n origin: typeof payload.value,\n code: \"not_multiple_of\",\n divisor: def.value,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n def.format = def.format || \"float64\";\n const isInt = def.format?.includes(\"int\");\n const origin = isInt ? \"int\" : \"number\";\n const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (isInt) {\n if (!Number.isInteger(input)) {\n // invalid_format issue\n // payload.issues.push({\n // expected: def.format,\n // format: def.format,\n // code: \"invalid_format\",\n // input,\n // inst,\n // });\n // invalid_type issue\n payload.issues.push({\n expected: origin,\n format: def.format,\n code: \"invalid_type\",\n continue: false,\n input,\n inst,\n });\n return;\n // not_multiple_of issue\n // payload.issues.push({\n // code: \"not_multiple_of\",\n // origin: \"number\",\n // input,\n // inst,\n // divisor: 1,\n // });\n }\n if (!Number.isSafeInteger(input)) {\n if (input > 0) {\n // too_big\n payload.issues.push({\n input,\n code: \"too_big\",\n maximum: Number.MAX_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n else {\n // too_small\n payload.issues.push({\n input,\n code: \"too_small\",\n minimum: Number.MIN_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n return;\n }\n }\n if (input < minimum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_small\",\n minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (input < minimum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size <= def.maximum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size >= def.minimum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size === def.size)\n return;\n const tooBig = size > def.size;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // Strings are measured in Unicode code points, not UTF-16 units. A code point is at most two units, so a string that already fits in units fits in code points; only an overflow has to be counted.\n const length = typeof input === \"string\" && units > def.maximum ? util.codePointLength(input) : units;\n if (length <= def.maximum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // A code point is one or two UTF-16 units, so fewer units than the floor can never reach it and twice the floor always clears it. Only in between is the exact count in doubt.\n const length = typeof input === \"string\" && units >= def.minimum && units < def.minimum * 2\n ? util.codePointLength(input)\n : units;\n if (length >= def.minimum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // A code point is one or two UTF-16 units, so outside `[length, length * 2]` units the target is missed either way — and missed in the same direction in both measures.\n const length = typeof input === \"string\" && units >= def.length && units <= def.length * 2\n ? util.codePointLength(input)\n : units;\n if (length === def.length)\n return;\n const origin = util.getLengthableOrigin(input);\n const tooBig = length > def.length;\n payload.issues.push({\n origin,\n ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n var _a, _b;\n $ZodCheck.init(inst, def);\n if (def.pattern)\n (_a = inst._zod).check ?? (_a.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n inst,\n continue: !def.abort,\n });\n });\n else\n (_b = inst._zod).check ?? (_b.check = () => { });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n $ZodCheckStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"regex\",\n input: payload.value,\n pattern: def.pattern.toString(),\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.lowercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.uppercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const escapedRegex = util.escapeRegex(def.includes);\n // `String.prototype.includes(sub, position)` matches `sub` at `position`\n // OR LATER, so the pattern must allow at least `position` leading chars\n // (`{N,}`), not exactly `position` chars (`{N}`).\n const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);\n def.pattern = pattern;\n inst._zod.check = (payload) => {\n if (payload.value.includes(def.includes, def.position))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"includes\",\n includes: def.includes,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.check = (payload) => {\n if (payload.value.startsWith(def.prefix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"starts_with\",\n prefix: def.prefix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.check = (payload) => {\n if (payload.value.endsWith(def.suffix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"ends_with\",\n suffix: def.suffix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n///////////////////////////////////\n///// $ZodCheckProperty /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(property, result.issues));\n }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n const result = def.schema._zod.run({\n value: payload.value[def.property],\n issues: [],\n }, {});\n if (result instanceof Promise) {\n return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n }\n handleCheckPropertyResult(result, payload, def.property);\n return;\n };\n});\nexport const $ZodCheckProperties = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperties\", (inst, def) => {\n $ZodCheck.init(inst, def);\n util.hide(inst, Symbol.iterator, function* () {\n yield inst;\n });\n // key and schema snapshotted together: reading one live and the other cached lets a later mutation of the caller's shape object pair a stale key with a missing schema\n let entries;\n inst._zod.check = (payload) => {\n // the base schema already typed the value, so only a nullish one is rejected here: the properties read on a primitive too, matching z.property() on a string's length\n if (payload.value == null) {\n payload.issues.push({ expected: \"object\", code: \"invalid_type\", input: payload.value, inst });\n return undefined;\n }\n entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));\n const input = payload.value;\n let proms;\n for (const [key, schema] of entries) {\n const result = schema._zod.run({ value: input[key], issues: [] }, {});\n if (result instanceof Promise) {\n proms ?? (proms = []);\n proms.push(result.then((result) => handleCheckPropertyResult(result, payload, key)));\n }\n else {\n handleCheckPropertyResult(result, payload, key);\n }\n }\n if (proms)\n return Promise.all(proms).then(() => undefined);\n return undefined;\n };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const mimeSet = new Set(def.mime);\n inst._zod.check = (payload) => {\n if (mimeSet.has(payload.value.type))\n return;\n payload.issues.push({\n code: \"invalid_value\",\n values: def.mime,\n input: payload.value.type,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n payload.value = def.tx(payload.value);\n };\n});\n","export class Doc {\n constructor(args = [], closed = {}) {\n this.content = [];\n this.indent = 0;\n this.args = args;\n this.closed = closed;\n }\n // the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it\n indented(fn) {\n this.indent += 1;\n try {\n fn(this);\n }\n finally {\n this.indent -= 1;\n }\n }\n write(arg) {\n if (typeof arg === \"function\") {\n arg(this, { execution: \"sync\" });\n arg(this, { execution: \"async\" });\n return;\n }\n const content = arg;\n const lines = content.split(\"\\n\").filter((x) => x);\n const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));\n const dedented = lines.map((x) => x.slice(minIndent)).map((x) => \" \".repeat(this.indent * 2) + x);\n for (const line of dedented) {\n this.content.push(line);\n }\n }\n compile() {\n const F = Function;\n const content = this?.content ?? [``];\n const factory = new F(...Object.keys(this.closed), `return function (${this.args.join(\", \")}) {\\n${content.join(\"\\n\")}\\n};`);\n return factory(...Object.values(this.closed));\n }\n}\n","export const version = {\n major: 4,\n minor: 6,\n patch: 7,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync } 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 defChecks = inst._zod.def.checks;\n // if inst is itself a checks.$ZodCheck, run it as a check\n const checks = inst._zod.traits.has(\"$ZodCheck\")\n ? [inst, ...(defChecks ?? [])]\n : defChecks?.length\n ? [...defChecks]\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 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 if (payload.memo)\n return payload;\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.def.when) {\n if (util.explicitlyAborted(payload))\n continue;\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 util.attachSchema(payload.issues, currLen, inst);\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 util.attachSchema(payload.issues, currLen, inst);\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 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}, {\n // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.\n get \"~standard\"() {\n return util.hide(this, \"~standard\", standardProps(this));\n },\n set \"~standard\"(value) {\n util.own(this, \"~standard\", value);\n },\n});\n/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */\n// a Standard Schema result only reports issues, so a failure finalizes them straight off the raw payload: no ZodError, and no lazy result to read through\nconst toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())) } : { value: r.value };\nasync function validateAsync(inst, value) {\n const ctx = { async: true };\n return toStandardResult((await inst._zod.run({ value, issues: [] }, ctx)), ctx);\n}\nexport function standardProps(inst) {\n return {\n validate: (value) => {\n const ctx = { async: false };\n try {\n const r = inst._zod.run({ value, issues: [] }, ctx);\n if (!(r instanceof Promise))\n return toStandardResult(r, ctx);\n }\n catch (_) { }\n // async function so a synchronously throwing check rejects instead of escaping validate\n return validateAsync(inst, value);\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 // a format's own pattern, else unbounded; a template literal derives the check-aware form itself\n inst._zod.pattern = def.pattern ?? regexes.anyString;\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});\n/** The `://` guard rejected the input before the URL constructor saw it. */\nexport const URL_BAD_FORMAT = 1;\n/** The URL parser rejected the input. */\nexport const URL_UNPARSEABLE = 2;\nexport function canParseURL(input) {\n try {\n if (typeof URL !== \"undefined\" && typeof URL.canParse === \"function\")\n return URL.canParse(input);\n new URL(input);\n return true;\n }\n catch {\n return false;\n }\n}\nexport function validateURL(trimmed, def) {\n if (!(\"normalize\" in def) && !(\"hostname\" in def) && !(\"protocol\" in def)) {\n return canParseURL(trimmed) || URL_UNPARSEABLE;\n }\n return parseURLObject(trimmed, def);\n}\n/** Parses a URL while preserving the non-normalizing HTTP guard. */\nexport function parseURLObject(trimmed, def) {\n // When normalize is off, require :// for http/https URLs. This prevents strings like \"http:example.com\" or \"https:/path\" from being silently accepted\n if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source && !/^https?:\\/\\//i.test(trimmed)) {\n return URL_BAD_FORMAT;\n }\n try {\n if (typeof URL !== \"undefined\") {\n const URLStatic = URL;\n if (typeof URLStatic.parse === \"function\")\n return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;\n }\n // @ts-ignore\n return new URL(trimmed);\n }\n catch {\n return URL_UNPARSEABLE;\n }\n}\nconst asciiTabOrNewline = /[\\t\\n\\r]/g;\n/** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL(\"https://exa\\nmple.com\")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */\nexport function stripTabAndNewline(value) {\n return value.replace(asciiTabOrNewline, \"\");\n}\nexport function urlHostnameOk(url, hostname) {\n hostname.lastIndex = 0;\n return hostname.test(url.hostname);\n}\nexport function urlProtocolOk(url, protocol) {\n protocol.lastIndex = 0;\n return protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol);\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 const url = validateURL(trimmed, def);\n if (url === URL_BAD_FORMAT) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid URL format\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n return;\n }\n if (url === URL_UNPARSEABLE) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n return;\n }\n if (url === true) {\n payload.value = stripTabAndNewline(trimmed);\n return;\n }\n if (def.hostname && !urlHostnameOk(url, def.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 if (def.protocol && !urlProtocolOk(url, def.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 // Set the output value based on normalize flag\n payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);\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 if (def.length !== undefined && (!Number.isInteger(def.length) || def.length < 1))\n throw new Error(`Invalid nanoid length: ${def.length}`);\n def.pattern ?? (def.pattern = def.length === undefined ? regexes.nanoid : regexes.nanoidOfLength(def.length));\n $ZodStringFormat.init(inst, def);\n});\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\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});\n/** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL(\"http://[...]\")` parses an authority, not an address, so `@` and `\\` re-delimit it and `\"::@1\\\\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `\"::1\\n\"` validated as `::1`. */\nconst ipv6Alphabet = /^[0-9a-fA-F:.]+$/;\nexport function isValidIPv6(value) {\n if (!ipv6Alphabet.test(value))\n return false;\n return canParseURL(`http://[${value}]`);\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.check = (payload) => {\n if (!isValidIPv6(payload.value)) {\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});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport function isValidCIDRv6(value) {\n const parts = value.split(\"/\");\n if (parts.length !== 2)\n return false;\n const [address, prefix] = parts;\n if (!prefix)\n return false;\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n return false;\n if (prefixNum < 0 || prefixNum > 128)\n return false;\n return isValidIPv6(address);\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 if (!isValidCIDRv6(payload.value)) {\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 // atob ignores whitespace, so reject it up front.\n if (/\\s/.test(data))\n return false;\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}\n// lax on purpose: the quantified regexes.base64 overflows the regex stack on multi-MB input and its leading ^$| alternation leaks through template-literal composition; isValidBase64 enforces length and padding\nexport const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = base64Charset);\n $ZodStringFormat.init(inst, def);\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////////////////////////////// ZodBase64URL //////////////////////////////\n// lax on purpose: the quantified regexes.base64url overflows the regex stack on multi-MB input; isValidBase64 enforces length on the padded string\nexport const base64urlCharset = /^[A-Za-z0-9_-]*$/;\nexport function isValidBase64URL(data) {\n if (!base64urlCharset.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 = base64urlCharset);\n $ZodStringFormat.init(inst, def);\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////////////////////////////// ZodCreditCard //////////////////////////////\nconst CC_SANITIZE = /[- ]/g;\n/** Luhn checksum on a digit-only string. Adapted from valibot (MIT). */\nfunction isLuhnAlgo(digits) {\n let length = digits.length;\n let bit = 1;\n let sum = 0;\n while (length) {\n const value = digits.charCodeAt(--length) - 48;\n bit ^= 1;\n sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;\n }\n return sum % 10 === 0;\n}\nexport function isValidCreditCard(input) {\n if (!regexes.creditCard.test(input))\n return false;\n return isLuhnAlgo(input.replace(CC_SANITIZE, \"\"));\n}\nexport const $ZodCreditCard = /*@__PURE__*/ core.$constructor(\"$ZodCreditCard\", (inst, def) => {\n // Shape only — the Luhn check below is not expressible as a pattern, so consumers of `pattern` (JSON Schema, template literals) get the length and separator rules alone.\n def.pattern ?? (def.pattern = regexes.creditCard);\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidCreditCard(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"credit_card\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodIBAN //////////////////////////////\n// iso 7064 mod 97-10 checksum without BigInt\nfunction isIso7064Mod97(iban) {\n let remainder = 0;\n const len = iban.length;\n for (let i = 4; i < len; i++) {\n const code = iban.charCodeAt(i);\n remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;\n }\n for (let i = 0; i < 4; i++) {\n const code = iban.charCodeAt(i);\n remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;\n }\n return remainder === 1;\n}\nexport function isValidIBAN(input) {\n if (!regexes.iban.test(input))\n return false;\n return isIso7064Mod97(input);\n}\nexport const $ZodIBAN = /*@__PURE__*/ core.$constructor(\"$ZodIBAN\", (inst, def) => {\n // shape only — checksum is not expressible as a pattern\n def.pattern ?? (def.pattern = regexes.iban);\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidIBAN(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"iban\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\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 = 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 ? String(input)\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.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});\n// an oversized container fails its leading size checks before any element is parsed\nfunction capSize(inst, size) {\n const caps = util.sizeCaps(inst._zod.def.checks);\n if (!caps.length)\n return;\n const cap = Math.min(...caps.map((c) => c[0]));\n const parse = inst._zod.parse;\n inst._zod.parse = (payload, ctx) => {\n const n = size(payload.value);\n if (n > cap && !ctx?.skipChecks && ctx?.direction !== \"backward\") {\n for (const [max, ch] of util.sizeCaps(inst._zod.def.checks)) {\n if (n > max && ch._zod.def.when(payload)) {\n const start = payload.issues.length;\n ch._zod.check(payload);\n // the value is still the raw input, so no later check may read it\n payload.issues[start].continue = false;\n util.attachSchema(payload.issues, start, inst);\n return payload;\n }\n }\n }\n return parse(payload, ctx);\n };\n}\nconst arraySize = (input) => (Array.isArray(input) ? input.length : -1);\nconst mapSize = (input) => (input instanceof Map ? input.size : -1);\nconst setSize = (input) => (input instanceof Set ? input.size : -1);\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 const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);\n const proms = [];\n const abortEarly = ctx?.abortEarly;\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 // the element's payload is authoritative here, since handleArrayResult forwards every issue; an object's is not, because it drops a failed absent optional\n if (abortEarly && result.issues.length !== 0 && util.aborted(result))\n break;\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n capSize(inst, arraySize);\n});\nfunction handlePropertyResult(result, final, key, input, optin, optout) {\n const isPresent = key in input;\n const isOptionalOut = optout === \"optional\";\n // The middle rung means \"absence permitted, nothing supplied in its place\", so an absent key contributes nothing — whatever the schema made of `undefined` is invented, not substituted. Only `optional` reaches this with a value: `defaulted` substitutes, and a schema that isn't optional-out has to keep the key.\n if (!isPresent && isOptionalOut && optin === \"optional\") {\n return;\n }\n if (result.issues.length) {\n // For optional-in/out schemas, ignore errors on absent keys.\n if (optin !== undefined && isOptionalOut && !isPresent) {\n return;\n }\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n if (!isPresent && optin === undefined) {\n if (!result.issues.length) {\n final.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: undefined,\n path: [key],\n });\n }\n return;\n }\n if (result.value === undefined) {\n if (isPresent || (optin === \"defaulted\" && !isOptionalOut)) {\n final.value[key] = undefined;\n }\n }\n else {\n final.value[key] = result.value;\n }\n}\n// one shared instance; a fresh [] per schema cost 56 bytes retained\nconst NO_SYMBOL_KEYS = [];\nfunction normalizeDef(def) {\n const keys = Object.keys(def.shape);\n const ownSymbols = Object.getOwnPropertySymbols(def.shape);\n const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;\n // aliases `keys` when there are no symbols, so a string-only shape keeps one array\n const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;\n for (const k of allKeys) {\n if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n throw new Error(`Invalid element at key \"${String(k)}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n ...def,\n allKeys,\n symbolKeys,\n // string-only: handleCatchall matches it against `for...in`, which never yields a symbol\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {\n const unrecognized = [];\n const keySet = def.keySet;\n const _catchall = def.catchall._zod;\n const t = _catchall.def.type;\n const optin = _catchall.optin;\n const optout = _catchall.optout;\n // starts at 0, not the current length: the shape phase already ran and may have aborted\n let seen = 0;\n for (const key in input) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n // Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.\n if (keySet.has(key))\n continue;\n // Don't copy an undeclared __proto__ into the result; assignment to a plain {} would replace the result prototype. But in strict mode it is still an unknown key, so report it before skipping.\n if (key === \"__proto__\") {\n if (t === \"never\")\n unrecognized.push(key);\n continue;\n }\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, optin, optout)));\n }\n else {\n handlePropertyResult(r, payload, key, input, optin, optout);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n // Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.\n continue: true,\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 desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n // a cloned def carries its source's accessor, which knows the shape it answers from; adopting that keeps the clone's keys readable without running it\n const sh = desc?.get ? desc.get.raw : (def.shape ?? {});\n if (sh) {\n // Freezes the shape on first read, so its getters resolve once and every later read sees the same schemas.\n const get = () => {\n const newSh = { ...sh };\n Object.defineProperty(def, \"shape\", { value: newSh });\n get.raw = newSh;\n return newSh;\n };\n get.raw = sh;\n Object.defineProperty(def, \"shape\", { get });\n }\n const _normalized = util.cached(() => normalizeDef(def));\n util.defineLazyInternal(inst, \"propValues\", (zod) => {\n const shape = zod.def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n if (!Object.prototype.hasOwnProperty.call(propValues, key)) {\n util.assignProp(propValues, key, new Set());\n }\n for (const v of field.values)\n propValues[key].add(v);\n // An omittable slot reads back as undefined at a discriminator lookup, so it has to claim undefined: two options that can both omit the key are not discriminable on it.\n if (field.optin !== undefined)\n propValues[key].add(undefined);\n }\n }\n return propValues;\n });\n const isObject = util.isObject;\n const catchall = def.catchall;\n let value;\n const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 = memo ? memo.alloc(inst, payload, {}, ctx) : {};\n const proms = [];\n const shape = value.shape;\n const abortEarly = ctx?.abortEarly;\n let seen = payload.issues.length;\n for (const key of value.allKeys) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n if (key === \"__proto__\")\n continue;\n const el = shape[key];\n const optin = el._zod.optin;\n const optout = el._zod.optout;\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, optin, optout)));\n }\n else {\n handlePropertyResult(r, payload, key, input, optin, optout);\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, abortEarly === true);\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 memo = core.globalConfig.memoizer;\n const generateFastpass = (shape) => {\n const normalized = _normalized.value;\n const syms = normalized.symbolKeys;\n // a symbol has no source literal, so it is read as `syms[i]` off the closed-over scope\n const doc = new Doc([\"payload\", \"ctx\"], { shape, inst, memo, syms });\n const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n // prefixes in place, like util.prefixIssues. newResult must land before the early return: a catchall runs after this and would otherwise write onto the caller's input\n const prefixStr = (id, k) => `\n let ${id}_ab = false;\n for (let i = 0; i < ${id}.issues.length; i++) {\n const iss = ${id}.issues[i];\n iss.path = iss.path ? [${k}, ...iss.path] : [${k}];\n payload.issues.push(iss);\n if (iss.continue !== true) ${id}_ab = true;\n }\n if (${id}_ab && ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }`;\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n let counter = 0;\n for (const key of normalized.allKeys) {\n ids[key] = `key_${counter++}`;\n }\n // A: preserve key order {\n doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);\n for (const key of normalized.allKeys) {\n if (key === \"__proto__\")\n continue;\n const id = ids[key];\n const k = typeof key === \"symbol\" ? `syms[${syms.indexOf(key)}]` : util.esc(key);\n const isPresent = `${k} in input`;\n const schema = shape[key];\n const optin = schema?._zod?.optin;\n const isOptionalIn = optin !== undefined;\n const isOptionalOut = schema?._zod?.optout === \"optional\";\n doc.write(`const ${id} = ${parseStr(k)};`);\n if (isOptionalIn && isOptionalOut) {\n // For optional-in/out schemas, ignore errors on absent keys — and, like the interpreted path, drop the value produced alongside them. The middle rung goes further: it permits absence without supplying anything in its place, so an absent key contributes nothing at all.\n const assign = optin === \"optional\" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;\n doc.write(`\n const ${id}_present = ${isPresent};\n if (!${id}.issues.length || ${id}_present) {\n if (${id}.issues.length) {${prefixStr(id, k)}\n }\n\n if (${assign}) {\n newResult[${k}] = ${id}.value;\n }\n }\n\n `);\n }\n else if (!isOptionalIn) {\n doc.write(`\n const ${id}_present = ${isPresent};\n if (${id}.issues.length) {${prefixStr(id, k)}\n }\n if (!${id}_present && !${id}.issues.length) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: undefined,\n path: [${k}]\n });\n if (ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }\n }\n\n if (${id}_present) {\n newResult[${k}] = ${id}.value;\n }\n\n `);\n }\n else {\n doc.write(`\n if (${id}.issues.length) {${prefixStr(id, k)}\n }\n `);\n if (optin === \"defaulted\") {\n doc.write(`newResult[${k}] = ${id}.value;`);\n }\n else {\n doc.write(`\n if (${id}.value !== undefined || ${isPresent}) {\n newResult[${k}] = ${id}.value;\n }\n `);\n }\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n // closing `shape` in is what pays: turbofan specializes the parser against that one shape object, so every `shape[k]._zod.run` folds to a known callee. as a parameter it stays a generic load and measures 13% slower even with the forwarding frame gone\n return doc.compile();\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, ctx?.abortEarly === true);\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.defineLazyInternal(inst, \"optin\", (zod) => zod.def.options.some((o) => o._zod.optin === \"defaulted\")\n ? \"defaulted\"\n : zod.def.options.some((o) => o._zod.optin !== undefined)\n ? \"optional\"\n : undefined);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n util.defineLazyInternal(inst, \"values\", (zod) => {\n if (zod.def.options.every((o) => o._zod.values)) {\n return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n if (zod.def.options.every((o) => o._zod.pattern)) {\n const patterns = zod.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 first = def.options.length === 1 ? def.options[0]._zod.run : null;\n inst._zod.parse = (payload, ctx) => {\n if (first) {\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 matches = [];\n for (let i = 0; i < results.length; i++) {\n if (results[i].issues.length === 0)\n matches.push(i);\n }\n if (matches.length === 1) {\n final.value = results[matches[0]].value;\n return final;\n }\n if (matches.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 matches,\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 first = def.options.length === 1 ? def.options[0]._zod.run : null;\n inst._zod.parse = (payload, ctx) => {\n if (first) {\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});\n/** Returns the option whose discriminator claims `value`, or throws if ambiguous. */\nexport function getDiscriminatedOption(union, value) {\n const internals = union._zod;\n let map = internals.bag.optionsMap;\n if (!map) {\n map = discriminatorMap(internals.def);\n internals.bag.optionsMap = map;\n }\n const option = map.get(value);\n if (option === null)\n throw new Error(`Ambiguous discriminator value \"${String(value)}\"`);\n return option;\n}\nfunction discriminatorMap(def) {\n const map = new Map();\n for (const option of def.options) {\n const values = option._zod.propValues?.[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const value of values) {\n if (map.has(value)) {\n if (value !== undefined)\n throw new Error(`Duplicate discriminator value \"${String(value)}\"`);\n // keep the collision marked so a later member cannot reclaim it\n map.set(value, null);\n }\n else {\n map.set(value, option);\n }\n }\n }\n return map;\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.defineLazyInternal(inst, \"propValues\", (zod) => {\n const propValues = {};\n let undefinedCount = 0;\n for (const option of zod.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 \"${zod.def.options.indexOf(option)}\"`);\n if (pv[zod.def.discriminator]?.has(undefined))\n undefinedCount++;\n for (const [k, v] of Object.entries(pv)) {\n if (!Object.prototype.hasOwnProperty.call(propValues, k)) {\n util.assignProp(propValues, k, new Set());\n }\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n if (!zod.def.unionFallback && undefinedCount > 1)\n propValues[zod.def.discriminator]?.delete(undefined);\n return propValues;\n });\n // Checked now rather than in the lookup map below, so an option that lacks the discriminator fails at the `discriminatedUnion` call instead of on the first object parsed. Options whose shape cannot be enumerated without resolving it — pipes and lazies — are left to the map.\n def.options.forEach((option, i) => {\n const propShape = util.rawShape(option._zod.def);\n if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {\n throw new Error(`Invalid discriminated union option at index \"${i}\"`);\n }\n });\n const disc = util.cached(() => discriminatorMap(def));\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 value = input?.[def.discriminator];\n const opt = disc.value.get(value);\n // forward metadata cannot choose an encoder for an absent tag\n if (opt && (value !== undefined || ctx.direction !== \"backward\")) {\n return opt._zod.run(payload, ctx);\n }\n // Fall back to union matching when the fast discriminator path fails:\n // - explicitly enabled via unionFallback, or\n // - during backward direction (encode), since codec-based discriminators have different values in forward vs backward directions\n if (def.unionFallback || ctx.direction === \"backward\") {\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 options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),\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});\nexport function 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 if (Object.prototype.hasOwnProperty.call(newObj, \"__proto__\"))\n delete newObj.__proto__;\n for (const key of sharedKeys) {\n if (key === \"__proto__\")\n continue;\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) reject each key. A key rejection is reported only when BOTH sides reject it, so a key owned by one branch survives the other's key schema. strictObject reports these as unrecognized_keys; a record with an open key schema reports one invalid_key per key.\n const unrecKeys = new Map();\n let unrecIssue;\n const keyIssues = new Map();\n const collect = (iss, side) => {\n let keys;\n if (iss.code === \"unrecognized_keys\" && !iss.path?.length) {\n unrecIssue ?? (unrecIssue = iss);\n keys = iss.keys;\n }\n else if (iss.code === \"invalid_key\" && iss.origin === \"record\" && iss.path?.length === 1) {\n const k = String(iss.path[0]);\n if (!keyIssues.has(k))\n keyIssues.set(k, iss);\n keys = [k];\n }\n else {\n return false;\n }\n for (const k of keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k)[side] = true;\n }\n return true;\n };\n for (const iss of left.issues) {\n if (!collect(iss, \"l\"))\n result.issues.push(iss);\n }\n for (const iss of right.issues) {\n if (!collect(iss, \"r\"))\n result.issues.push(iss);\n }\n // Report only keys rejected by BOTH sides\n const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);\n if (bothKeys.length) {\n const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];\n if (aggregated.length)\n result.issues.push({ ...unrecIssue, keys: aggregated });\n for (const k of bothKeys) {\n if (!aggregated.includes(k) && keyIssues.has(k))\n result.issues.push(keyIssues.get(k));\n }\n }\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n if (util.aborted(result))\n return result;\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 const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 = memo ? memo.alloc(inst, payload, [], ctx) : [];\n const proms = [];\n const optinStart = getTupleOptStart(items, \"optin\");\n const optoutStart = getTupleOptStart(items, \"optout\");\n if (!def.rest) {\n if (input.length < optinStart) {\n payload.issues.push({\n code: \"too_small\",\n minimum: optinStart,\n inclusive: true,\n input,\n inst,\n origin: \"array\",\n });\n return payload;\n }\n if (input.length > items.length) {\n payload.issues.push({\n code: \"too_big\",\n maximum: items.length,\n inclusive: true,\n input,\n inst,\n origin: \"array\",\n });\n }\n }\n // Run every item in parallel, collecting results into an indexed array. The post-processing in `handleTupleResults` walks them in order so it can decide whether an absent optional-output error can truncate the tail or must be reported to preserve required output.\n const itemResults = new Array(items.length);\n // only tracked when there is a rest loop to skip\n const abortEarly = def.rest ? ctx?.abortEarly : undefined;\n let itemAborted = false;\n for (let i = 0; i < items.length; i++) {\n const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((rr) => {\n itemResults[i] = rr;\n }));\n }\n else {\n itemResults[i] = r;\n if (abortEarly && !itemAborted && r.issues.length)\n itemAborted = util.aborted(r);\n }\n }\n // sound because rest is non-empty exactly when every fixed index is present, the one case handleTupleResults cannot discard an item's issues\n if (def.rest && !itemAborted) {\n let i = items.length - 1;\n const rest = input.slice(items.length);\n let seen = payload.issues.length;\n for (const el of rest) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\n i++;\n const result = def.rest._zod.run({ value: el, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((r) => handleTupleResult(r, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));\n }\n return handleTupleResults(itemResults, payload, items, input, optoutStart);\n };\n});\nfunction getTupleOptStart(items, key) {\n for (let i = items.length - 1; i >= 0; i--) {\n // optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.\n const omittable = key === \"optin\" ? items[i]._zod.optin !== undefined : items[i]._zod.optout === \"optional\";\n if (!omittable)\n return i + 1;\n }\n return 0;\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}\nfunction handleTupleResults(itemResults, final, items, input, optoutStart) {\n // Walk results in order. Mirror $ZodObject's swallow-on-absent-optional rule, but only after `optoutStart`: the first index where the output tuple tail can be absent.\n for (let i = 0; i < items.length; i++) {\n const r = itemResults[i];\n const isPresent = i < input.length;\n // The array analog of `handlePropertyResult`'s absent-key early return: the middle rung permits absence without supplying anything in its place, so the tail truncates here instead of materializing whatever the item made of `undefined`.\n if (!isPresent && i >= optoutStart && items[i]._zod.optin === \"optional\") {\n final.value.length = i;\n break;\n }\n if (r.issues.length) {\n if (!isPresent && i >= optoutStart) {\n final.value.length = i;\n break;\n }\n final.issues.push(...util.prefixIssues(i, r.issues));\n }\n final.value[i] = r.value;\n }\n // Drop trailing slots that produced `undefined` for absent input\n // (the array analog of an absent optional key on an object). The\n // `i >= input.length` floor is critical: an explicit `undefined`\n // *inside* the input must be preserved even when the schema is\n // optional-out (e.g. `z.string().or(z.undefined())` accepting an\n // explicit undefined value).\n for (let i = final.value.length - 1; i >= input.length; i--) {\n if (items[i]._zod.optout === \"optional\" && final.value[i] === undefined) {\n final.value.length = i;\n }\n else {\n break;\n }\n }\n return final;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 // no guard in either loop below: a record's invalid_key aborts but an enclosing intersection can reconcile it, so a stopped loop hides keys the sibling does not own and the intersection then rejects nothing\n const proms = [];\n const values = def.keyType._zod.values;\n if (values && !def.partial) {\n payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};\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 // A declared __proto__ is stripped but is not an unrecognized key.\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 continue;\n }\n const outKey = keyResult.value;\n if (outKey === \"__proto__\")\n continue;\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[outKey] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[outKey] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!recordKeys.has(key)) {\n if (def.mode === \"loose\") {\n // skip __proto__ so it can't replace the result prototype via the assignment setter on the plain {} we build into\n if (key === \"__proto__\")\n continue;\n payload.value[key] = input[key];\n }\n else {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n continue: true,\n });\n }\n }\n else {\n payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};\n // An enumerable key schema declares which keys the record owns, so a key outside the set is unrecognized. A non-enumerable one (regex, refine) is a constraint every key must satisfy, so a failing key is invalid. Only the former is reconcilable against the other side of an intersection.\n let unrecognized;\n // Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n if (!Object.prototype.propertyIsEnumerable.call(input, key))\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 is a numeric string and failed, retry with Number(key). This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals\n const checkNumericKey = typeof key === \"string\" && regexes.number.test(key) && keyResult.issues.length;\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 if (values) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(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 // the guard above tests the raw input key, but the key schema can normalize an ordinary key into __proto__; re-check the key we actually write under\n const outKey = keyResult.value;\n if (outKey === \"__proto__\")\n continue;\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[outKey] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[outKey] = result.value;\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n continue: true,\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 const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();\n const abortEarly = ctx?.abortEarly;\n let seen = payload.issues.length;\n for (const [key, value] of input) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\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 capSize(inst, mapSize);\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 const memo = core.globalConfig.memoizer;\n memo?.attach(inst);\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 = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();\n const abortEarly = ctx?.abortEarly;\n let seen = payload.issues.length;\n for (const item of input) {\n if (abortEarly && payload.issues.length !== seen) {\n if (util.aborted(payload, seen))\n break;\n seen = payload.issues.length;\n }\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 capSize(inst, setSize);\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 util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const patternValues = util.getEnumValues(zod.def.entries).filter((k) => util.propertyKeyTypes.has(typeof k));\n // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches \"\"\n return new RegExp(patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join(\"|\")})$` : \"^[^\\\\s\\\\S]$\");\n });\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 const values = new Set(def.values);\n inst._zod.values = values;\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const vals = zod.def.values;\n // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches \"\"\n return new RegExp(vals.length\n ? `^(${vals\n .map((o) => typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o))\n .join(\"|\")})$`\n : \"^[^\\\\s\\\\S]$\");\n });\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.optin = \"optional\";\n core.globalConfig.memoizer?.guard(inst);\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(payload, result) {\n // A substituting schema that still failed has no usable answer; yield undefined. Its issues are simply dropped: it ran on a payload of its own, so there is no shared array to truncate and nothing of the caller's to lose with it.\n payload.value = result.issues.length ? undefined : result.value;\n return payload;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n // .optional() propagates absence rather than substituting for it, so a defaulted inner keeps its rung.\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin === \"defaulted\" ? \"defaulted\" : \"optional\");\n inst._zod.optout = \"optional\";\n util.defineLazyInternal(inst, \"values\", (zod) => {\n const values = zod.def.innerType._zod.values;\n return values ? new Set([...values, undefined]) : undefined;\n });\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const pattern = zod.def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === undefined) {\n // Only the top rung substitutes a value for absence; everything else leaves it intact, which is what .optional() means.\n if (def.innerType._zod.optin !== \"defaulted\")\n return payload;\n // Its own payload, for the same reason $ZodCatch gets one: a pipe forwards an unrecognized key through the caller's issues array, and this must not read that as the substituting schema failing and drop it.\n const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);\n if (result instanceof Promise)\n return result.then((result) => handleOptionalResult(payload, result));\n return handleOptionalResult(payload, result);\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.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n util.defineLazyInternal(inst, \"pattern\", (zod) => zod.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.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.innerType._zod.optout);\n util.defineLazyInternal(inst, \"pattern\", (zod) => {\n const pattern = zod.def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazyInternal(inst, \"values\", (zod) => {\n return zod.def.innerType._zod.values ? new Set([...zod.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 = \"defaulted\";\n util.defineLazyInternal(inst, \"values\", (zod) => zod.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 = \"defaulted\";\n util.defineLazyInternal(inst, \"values\", (zod) => zod.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.defineLazyInternal(inst, \"values\", (zod) => {\n const v = zod.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});\nfunction handleCatchResult(payload, result, def, ctx) {\n if (!result.issues.length) {\n payload.value = result.value;\n // The value carries up, so the flag describing it has to carry with it: a back-edge into a node still being parsed must not be frozen by an enclosing readonly, and its checks belong to the node itself. Guarded so the ordinary case adds no own property.\n if (result.memo)\n payload.memo = true;\n return payload;\n }\n // Spread the inner's own payload, not ours: `value` has to stay the input the catch was handed, and the inner ran on a payload of its own so its issues are already private to this call.\n payload.value = def.catchValue({\n ...result,\n value: payload.value,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n return payload;\n}\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin === \"defaulted\" ? \"defaulted\" : \"optional\");\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.innerType._zod.optout);\n util.defineLazyInternal(inst, \"values\", (zod) => zod.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({ value: payload.value, issues: [] }, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleCatchResult(payload, result, def, ctx));\n }\n return handleCatchResult(payload, result, def, ctx);\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.defineLazyInternal(inst, \"values\", (zod) => zod.def.in._zod.values);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.in._zod.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.out._zod.optout);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.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 // Any issue stops the pipe, so a failing refinement never feeds its transform. An unrecognized key is the exception: it describes the input's extra properties, not the value being piped, and an enclosing intersection may yet reconcile it.\n if (left.issues.some((iss) => iss.code !== \"unrecognized_keys\")) {\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.defineLazyInternal(inst, \"values\", (zod) => zod.def.in._zod.values);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.in._zod.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.out._zod.optout);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.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 $ZodPreprocess = /*@__PURE__*/ core.$constructor(\"$ZodPreprocess\", (inst, def) => {\n $ZodPipe.init(inst, def);\n});\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.def.innerType._zod.propValues);\n util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType?._zod?.optin);\n util.defineLazyInternal(inst, \"optout\", (zod) => zod.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 // A repeat visit hands back a node that is still being built; freezing it here would make the rest of its keys fail to assign.\n if (!payload.memo)\n payload.value = Object.freeze(payload.value);\n return payload;\n}\n// a leaf's pattern source with its own checks folded in: the last pattern-carrying check wins, else length bounds narrow the catch-all, else an integer format narrows the number form. the fold lives here instead of on `_zod.pattern` so a bundle without template literals never pays for it\nfunction leafPattern(schema) {\n const def = schema._zod.def;\n let pattern = def.pattern;\n let isInt = !!def.format?.includes(\"int\");\n let minimum;\n let maximum;\n for (const ch of def.checks ?? []) {\n const d = ch._zod.def;\n if (d.pattern)\n pattern = d.pattern;\n isInt || (isInt = !!d.format?.includes(\"int\"));\n const lo = d.minimum ?? d.length;\n const hi = d.maximum ?? d.length;\n if (lo !== undefined && (minimum === undefined || lo > minimum))\n minimum = lo;\n if (hi !== undefined && (maximum === undefined || hi < maximum))\n maximum = hi;\n }\n if (pattern)\n return pattern.source;\n // an empty range matches nothing at runtime, and `{8,5}` is not a legal quantifier\n if (minimum !== undefined && maximum !== undefined && minimum > maximum)\n return \"(?!)\";\n if (minimum !== undefined || maximum !== undefined)\n return regexes.string({ minimum, maximum }).source;\n const own = schema._zod.pattern;\n return (isInt && own === regexes.number ? regexes.integer : own)?.source;\n}\n// a part's pattern source. a wrapper's pattern embeds its inner pattern's source verbatim, so the folded form is substituted in place without knowing the wrapper's own composition; a union's options are joined the way the union builds its own pattern\nfunction partPattern(schema) {\n const def = schema._zod.def;\n const own = schema._zod.pattern?.source;\n // lazy resolves its inner on the internals, not the def\n const inner = def.innerType ?? schema._zod.innerType;\n if (inner) {\n const before = inner._zod.pattern?.source;\n const after = partPattern(inner);\n if (own && before && after && after !== before) {\n return own.replace(util.cleanRegex(before), () => util.cleanRegex(after));\n }\n return own;\n }\n if (def.options) {\n const sources = def.options.map(partPattern);\n if (sources.every(Boolean))\n return `^(${sources.map((s) => util.cleanRegex(s)).join(\"|\")})$`;\n }\n return leafPattern(schema);\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 const source = partPattern(part);\n if (!source) {\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n regexParts.push(util.cleanRegex(source));\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 // Defined, not assigned: the classic prototype exposes `_def` as a getter with no setter.\n Object.defineProperty(inst, \"_def\", { value: 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 // Defined inline so the closure stays anonymous: binding it to a `const` first names it, which costs 256 bytes per implemented function.\n return Object.defineProperty(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 }, \"_zod\", { value: inst._zod, enumerable: false });\n };\n inst.implementAsync = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implementAsync() must be called with a function\");\n }\n return Object.defineProperty(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 }, \"_zod\", { value: inst._zod, enumerable: false });\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 // Cache the resolved inner type on the shared `def` so all clones of this lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance, preserving identity for cycle detection on recursive schemas.\n util.defineLazy(inst._zod, \"innerType\", () => {\n const d = def;\n if (!d._cachedInner)\n d._cachedInner = def.getter();\n return d._cachedInner;\n });\n util.defineLazyInternal(inst, \"pattern\", (zod) => zod.innerType?._zod?.pattern);\n util.defineLazyInternal(inst, \"propValues\", (zod) => zod.innerType?._zod?.propValues);\n util.defineLazyInternal(inst, \"optin\", (zod) => zod.innerType?._zod?.optin ?? undefined);\n util.defineLazyInternal(inst, \"optout\", (zod) => 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","import * as util from \"./util.js\";\nexport class $ZodCyclicError extends Error {\n constructor() {\n super(`Cannot parse a reference cycle that closes through a transform`);\n this.name = \"ZodCyclicError\";\n }\n}\n/** Keyed off the context object every schema in one parse call already shares. */\nconst STATE = \"~memo\";\nconst NO_ISSUES = [];\n// a value a cycle can close through\nfunction isRef(value) {\n return value !== null && typeof value === \"object\";\n}\n// Receivers prefix paths in place, so the cache and every hand-out need their own copies.\nfunction cloneIssues(issues) {\n return issues.map((iss) => (iss.path ? { ...iss, path: iss.path.slice() } : { ...iss }));\n}\nconst recursive = /*@__PURE__*/ new WeakMap();\n/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */\nconst NONE = 0;\nconst ASSUMED = 1;\nconst PROVEN = 2;\n/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */\nfunction isRecursive(inst, stack, resolve) {\n const cached = recursive.get(inst);\n if (cached !== undefined)\n return cached ? PROVEN : NONE;\n // Relative to the walk in progress, so not cached.\n if (stack.has(inst))\n return PROVEN;\n stack.add(inst);\n let result = NONE;\n const check = (child) => {\n if (result !== PROVEN && child?._zod) {\n const answer = isRecursive(child, stack, resolve);\n if (answer > result)\n result = answer;\n }\n };\n // `Reflect.ownKeys` rather than `Object.keys`, so a cycle through a declared symbol key is still seen\n const shape = (sh, spread) => {\n let answer = NONE;\n for (const key of Reflect.ownKeys(sh)) {\n const desc = Object.getOwnPropertyDescriptor(sh, key);\n // an object resolves its shape by spread, so a key it does not enumerate is never parsed; `z.properties` reads every own key and so keeps them all\n if (spread && !desc.enumerable)\n continue;\n // resolving runs user code, and a factory mints a fresh subtree per read, so an edge the walk can't follow counts as a cycle\n const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;\n if (child > answer)\n answer = child;\n }\n return answer;\n };\n const merge = (answer) => {\n if (answer > result)\n result = answer;\n };\n const def = inst._zod.def;\n const kind = def.type;\n switch (kind) {\n case \"object\": {\n const raw = util.rawShape(def);\n // a def with no raw shape answers `shape` from an accessor of its own, and running that can mint a whole fresh subtree\n merge(raw ? shape(raw, true) : ASSUMED);\n check(def.catchall);\n break;\n }\n case \"array\":\n check(def.element);\n break;\n case \"tuple\":\n for (const el of def.items)\n check(el);\n check(def.rest);\n break;\n case \"record\":\n case \"map\":\n check(def.keyType);\n check(def.valueType);\n break;\n case \"set\":\n check(def.valueType);\n break;\n case \"union\":\n for (const el of def.options)\n check(el);\n break;\n case \"intersection\":\n check(def.left);\n check(def.right);\n break;\n case \"optional\":\n case \"nullable\":\n case \"default\":\n case \"prefault\":\n case \"catch\":\n case \"readonly\":\n case \"nonoptional\":\n case \"promise\":\n case \"success\":\n check(def.innerType);\n break;\n case \"pipe\":\n check(def.in);\n check(def.out);\n break;\n case \"function\":\n check(def.input);\n check(def.output);\n break;\n // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly\n case \"lazy\": {\n const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);\n // walked with resolution off: one hop sees past the deferral, and a lazy that yields only another unresolved lazy is generative, so it stops there\n merge(inner ? isRecursive(inner, stack, false) : ASSUMED);\n break;\n }\n // a leaf by choice: `parts` are regex fragments, not data positions\n case \"template_literal\":\n // leaves\n case \"string\":\n case \"number\":\n case \"int\":\n case \"boolean\":\n case \"bigint\":\n case \"symbol\":\n case \"undefined\":\n case \"null\":\n case \"void\":\n case \"never\":\n case \"any\":\n case \"unknown\":\n case \"date\":\n case \"nan\":\n case \"enum\":\n case \"literal\":\n case \"file\":\n case \"transform\":\n case \"custom\":\n break;\n default: {\n // a new built-in kind becomes a compile error here\n kind;\n // a user-defined kind can still hold children, and only its author knows where, so fall back to scanning the def — skipping accessors, since reading one can run user code\n for (const key in def) {\n const desc = Object.getOwnPropertyDescriptor(def, key);\n if (!desc || desc.get)\n continue;\n const value = desc.value;\n if (!value || typeof value !== \"object\")\n continue;\n if (value._zod)\n check(value);\n else if (Array.isArray(value))\n for (const el of value)\n check(el);\n }\n }\n }\n stack.delete(inst);\n return settle(inst, result);\n}\n/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */\nfunction settle(inst, answer) {\n if (answer !== ASSUMED)\n recursive.set(inst, answer === PROVEN);\n return answer;\n}\n/**\n * Whether one parse can re-enter this schema, i.e. its subtree contains a cycle.\n * Exported for `z.compile`, which refuses to compile such a schema: cycle\n * breaking is driven from here off state keyed on the parse context, and a\n * generated fast path has no context to key on.\n */\nexport function isRecursiveSchema(inst) {\n // z.compile never parses, so nothing would ever resolve a lazy for it; it runs once and already treats a throw here as recursive\n return isRecursive(inst, new Set(), true) !== NONE;\n}\nfunction bucketFor(state, inst) {\n let bucket = state.buckets.get(inst);\n if (!bucket) {\n bucket = new WeakMap();\n state.buckets.set(inst, bucket);\n }\n return bucket;\n}\n// Set immediately before delegating to core and cleared immediately after, so `alloc` registers only for a visit this module is driving.\nlet handoff;\n// Allocated but unfinished entries. `alloc` and the matching pop both happen in the synchronous part of a parse, so they nest even when children are async, and one stack serves every schema.\nconst open = [];\nconst memo = {\n alloc(_inst, payload, empty) {\n const bucket = handoff;\n if (!bucket)\n return empty;\n handoff = undefined;\n const entry = { value: empty, issues: null };\n bucket.set(payload.value, entry);\n open.push(entry);\n return empty;\n },\n guard(inst) {\n var _a;\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred.push(() => {\n const base = inst._zod.parse;\n const wrapped = (payload, ctx) => {\n // The value is a placeholder a back-edge is still waiting on, so the cycle closes through this transform. Its output can't exist in time to bind.\n if (ctx.direction !== \"backward\" && isBackEdge(ctx, payload.value))\n throw new $ZodCyclicError();\n return base(payload, ctx);\n };\n inst._zod.parse = wrapped;\n if (inst._zod.run === base)\n inst._zod.run = wrapped;\n });\n },\n attach(inst) {\n var _a;\n let isRecursiveInst;\n let rechecked = false;\n // a recursive schema is re-entered many times per parse and its bucket never changes\n let lastCtx;\n let lastBucket;\n // Wraps `parse` in a deferred so it sees the container's final parse. Core's own deferred copies `parse` into `run` when there are no checks, and it ran first, so `run` is patched to match; with checks, `run` reads `parse` dynamically.\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred.push(() => {\n const base = inst._zod.parse;\n const wrapped = (payload, ctx) => {\n if (isRecursiveInst === undefined) {\n const walked = isRecursive(inst, new Set(), false);\n if (walked === NONE) {\n // Nothing here can ever fire, so take it back out.\n inst._zod.parse = base;\n if (inst._zod.run === wrapped)\n inst._zod.run = base;\n return base(payload, ctx);\n }\n // this parse resolves the deferred edges on its own path, so ask once more before latching\n if (walked === PROVEN || rechecked)\n isRecursiveInst = true;\n else\n rechecked = true;\n }\n const input = payload.value;\n if (!isRef(input))\n return base(payload, ctx);\n let state = ctx[STATE];\n if (!state) {\n state = { buckets: new WeakMap(), backEdges: undefined };\n ctx[STATE] = state;\n }\n let bucket;\n if (lastCtx === ctx) {\n bucket = lastBucket;\n }\n else {\n bucket = bucketFor(state, inst);\n lastCtx = ctx;\n lastBucket = bucket;\n }\n const hit = bucket.get(input);\n if (hit) {\n payload.value = hit.value;\n if (hit.issues) {\n if (hit.issues.length)\n payload.issues.push(...cloneIssues(hit.issues));\n }\n else {\n // Still being parsed: its own checks cover it, so skip them here.\n payload.memo = true;\n state.backEdges ?? (state.backEdges = new WeakSet());\n state.backEdges.add(hit.value);\n }\n return payload;\n }\n handoff = bucket;\n const depth = open.length;\n const result = base(payload, ctx);\n handoff = undefined;\n // A container that rejected its input outright allocated nothing.\n const entry = open.length > depth ? open.pop() : undefined;\n // Both paths written out so the sync one allocates no closure. It runs once per node, and capturing here cost more than everything else combined.\n if (result instanceof Promise) {\n return result.then((r) => {\n if (entry)\n entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;\n return r;\n });\n }\n if (entry)\n entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;\n return result;\n };\n inst._zod.parse = wrapped;\n if (inst._zod.run === base)\n inst._zod.run = wrapped;\n });\n },\n};\n/** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */\nexport function memoizer() {\n return memo;\n}\n/** Whether this value is a node a back-edge resolved to before it finished. */\nexport function isBackEdge(ctx, value) {\n const backEdges = ctx[STATE]?.backEdges;\n return backEdges !== undefined && isRef(value) && backEdges.has(value);\n}\n","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 currency_code: \"currency code\",\n credit_card: \"credit card number\",\n iban: \"IBAN\",\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 function getTypeName(type, input) {\n if (type === \"number\" && typeof input === \"number\" && !Number.isFinite(input)) {\n return String(input);\n }\n return TypeDictionary[type] ?? type;\n }\n return (issue) => {\n switch (issue.code) {\n case \"invalid_type\": {\n const expected = getTypeName(issue.expected);\n const receivedType = util.parsedType(issue.input);\n const received = getTypeName(receivedType, issue.input);\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.exact ? \"exactly \" : 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.exact ? \"exactly \" : 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 if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) {\n const opts = issue.options.map((o) => `'${o}'`).join(\" | \");\n return `Invalid discriminator value. Expected ${opts}`;\n }\n if (issue.inclusive === false) {\n return \"Invalid input: more than one option matched\";\n }\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","var _a;\nexport const $output = /*@__PURE__*/ Symbol(\"ZodOutput\");\nexport const $input = /*@__PURE__*/ 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 checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\nfunction snapshotChecks(def) {\n if (def.checks)\n def.checks = [...def.checks];\n return def;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class(snapshotChecks({ type: \"string\", ...util.normalizeParams(params) }));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class(snapshotChecks({ type: \"string\", coerce: true, ...util.normalizeParams(params) }));\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/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link _cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\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 _creditCard(Class, params) {\n return new Class({\n type: \"string\",\n format: \"credit_card\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _iban(Class, params) {\n return new Class({\n type: \"string\",\n format: \"iban\",\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(snapshotChecks({ type: \"number\", checks: [], ...util.normalizeParams(params) }));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class(snapshotChecks({ type: \"number\", coerce: true, checks: [], ...util.normalizeParams(params) }));\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 _properties(shape, params) {\n return new checks.$ZodCheckProperties({\n check: \"properties\",\n shape,\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: 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 : util.constantCatch(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, params) {\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 if (!(\"input\" in _issue))\n _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 }, params);\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 codec._zod.bag.truthy = truthyArray;\n codec._zod.bag.falsy = falsyArray;\n codec._zod.bag.case = params.case ?? \"insensitive\";\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 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","import { globalRegistry } from \"./registries.js\";\nimport { assignProp } from \"./util.js\";\nfunction assignProps(target, ...sources) {\n for (const source of sources) {\n for (const key of Reflect.ownKeys(source)) {\n if (Object.prototype.propertyIsEnumerable.call(source, key)) {\n assignProp(target, key, source[key]);\n }\n }\n }\n return target;\n}\n// function initializeContext<T extends schemas.$ZodType>(inputs: JSONSchemaGeneratorParams<T>): ToJSONSchemaContext<T> {\n// return {\n// processor: inputs.processor,\n// metadataRegistry: inputs.metadata ?? globalRegistry,\n// target: inputs.target ?? \"draft-2020-12\",\n// unrepresentable: inputs.unrepresentable ?? \"throw\",\n// };\n// }\nexport function initializeContext(params) {\n // Normalize target: convert old non-hyphenated versions to hyphenated versions\n let target = params?.target ?? \"draft-2020-12\";\n if (target === \"draft-4\")\n target = \"draft-04\";\n if (target === \"draft-7\")\n target = \"draft-07\";\n return {\n processors: params.processors ?? {},\n metadataRegistry: params?.metadata ?? globalRegistry,\n target,\n unrepresentable: params?.unrepresentable ?? \"throw\",\n override: params?.override ?? (() => { }),\n io: params?.io ?? \"output\",\n counter: 0,\n seen: new Map(),\n sharedDefsExtractedFor: undefined,\n sharedEmitDoneFor: undefined,\n cycles: params?.cycles ?? \"ref\",\n reused: params?.reused ?? \"inline\",\n intersections: [],\n deferred: [],\n external: params?.external ?? undefined,\n };\n}\n/**\n * Applies the `unrepresentable` setting at a site that has no JSON Schema equivalent. Throws\n * `message` unless the setting (or the handler's return value) says otherwise. Returns `true` if a\n * custom JSON Schema was written into `json`, in which case the caller must not write its own.\n */\nexport function handleUnrepresentable(schema, ctx, json, params, message) {\n const result = typeof ctx.unrepresentable === \"function\"\n ? ctx.unrepresentable({ zodSchema: schema, path: params.path, message })\n : ctx.unrepresentable;\n if (result === \"any\")\n return false;\n if (result === undefined || result === \"throw\")\n throw new Error(message);\n Object.assign(json, result);\n return true;\n}\n// never rename this back to `process`: bundler polyfills inject a top-level `const process` that a lexical declaration of the same name collides with (#6397)\nexport function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {\n var _a;\n const def = schema._zod.def;\n // check for schema in seens\n const seen = ctx.seen.get(schema);\n if (seen) {\n seen.count++;\n // check if cycle\n const isCycle = _params.schemaPath.includes(schema);\n if (isCycle) {\n seen.cycle = _params.path;\n }\n return seen.schema;\n }\n // initialize\n const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };\n ctx.seen.set(schema, result);\n ctx.sharedDefsExtractedFor = undefined;\n ctx.sharedEmitDoneFor = undefined;\n // custom method overrides default behavior\n const overrideSchema = schema._zod.toJSONSchema?.();\n if (overrideSchema) {\n result.schema = overrideSchema;\n }\n else {\n const params = {\n ..._params,\n schemaPath: [..._params.schemaPath, schema],\n path: _params.path,\n };\n if (schema._zod.processJSONSchema) {\n schema._zod.processJSONSchema(ctx, result.schema, params);\n }\n else {\n const _json = result.schema;\n const processor = ctx.processors[def.type];\n if (!processor) {\n throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);\n }\n processor(schema, ctx, _json, params);\n }\n const parent = schema._zod.parent;\n if (parent) {\n // Also set ref if processor didn't (for inheritance)\n if (!result.ref)\n result.ref = parent;\n processSchema(parent, ctx, params);\n ctx.seen.get(parent).isParent = true;\n }\n }\n // metadata\n const meta = ctx.metadataRegistry.get(schema);\n if (meta)\n assignProps(result.schema, meta);\n if (ctx.io === \"input\" && isTransforming(schema)) {\n // examples/defaults only apply to output type of pipe\n delete result.schema.examples;\n delete result.schema.default;\n }\n // set prefault as default\n if (ctx.io === \"input\" && \"_prefault\" in result.schema)\n (_a = result.schema).default ?? (_a.default = result.schema._prefault);\n delete result.schema._prefault;\n // pulling fresh from ctx.seen in case it was overwritten\n const _result = ctx.seen.get(schema);\n return _result.schema;\n}\n/** @deprecated Renamed to `processSchema`. An export alias declares no binding, so it is safe to keep. */\nexport { processSchema as process };\n// Escape a reference token for use in a JSON Pointer fragment (RFC 6901): `~` becomes `~0` and `/` becomes `~1`. The `~` replacement must run first.\nfunction encodeJSONPointerSegment(segment) {\n return segment.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nexport function extractDefs(ctx, schema\n// params: EmitParams\n) {\n // iterate over seen map;\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // With `external` set, every registered schema resolves through the external branch of `makeURI`, so the root branch below produces the same ref the external branch would — this pass is identical whichever schema it is called with, and only needs to run once.\n if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external)\n return;\n // Track ids to detect duplicates across different schemas\n const idToSchema = new Map();\n for (const entry of ctx.seen.entries()) {\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n const existing = idToSchema.get(id);\n if (existing && existing !== entry[0]) {\n throw new Error(`Duplicate schema id \"${id}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);\n }\n idToSchema.set(id, entry[0]);\n }\n }\n // returns a ref to the schema defId will be empty if the ref points to an external schema (or #)\n const makeURI = (entry) => {\n // comparing the seen objects because sometimes multiple schemas map to the same seen object. e.g. lazy\n // external is configured\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n if (ctx.external) {\n const externalId = ctx.external.registry.get(entry[0])?.id; // ?? \"__shared\";// `__schema${ctx.counter++}`;\n // check if schema is in the external registry\n const uriGenerator = ctx.external.uri ?? ((id) => id);\n if (externalId) {\n return { ref: uriGenerator(externalId) };\n }\n // otherwise, add to __shared\n const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;\n entry[1].defId = id; // set defId so it will be reused if needed\n return { defId: id, ref: `${uriGenerator(\"__shared\")}#/${defsSegment}/${encodeJSONPointerSegment(id)}` };\n }\n const uriPrefix = `#`;\n const defUriPrefix = `${uriPrefix}/${defsSegment}/`;\n // an id-less root has nowhere to be extracted to, so it stays inline and self-references as `#`\n if (entry[1] === root && !entry[1].schema.id) {\n return { ref: uriPrefix };\n }\n // self-contained schema\n const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;\n return { defId, ref: defUriPrefix + encodeJSONPointerSegment(defId) };\n };\n // stored cached version in `def` property remove all properties, set $ref\n const extractToDef = (entry) => {\n // if the schema is already a reference, do not extract it\n if (entry[1].schema.$ref) {\n return;\n }\n const seen = entry[1];\n const { ref, defId } = makeURI(entry);\n seen.def = { ...seen.schema };\n // defId won't be set if the schema is a reference to an external schema or if the schema is the root schema\n if (defId)\n seen.defId = defId;\n // wipe away all properties except $ref\n const schema = seen.schema;\n for (const key in schema) {\n delete schema[key];\n }\n schema.$ref = ref;\n };\n // throw on cycles\n // break cycles\n if (ctx.cycles === \"throw\") {\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.cycle) {\n throw new Error(\"Cycle detected: \" +\n `#/${seen.cycle?.join(\"/\")}/<root>` +\n '\\n\\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.');\n }\n }\n }\n // extract schemas into $defs\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n // convert root schema to # $ref\n if (schema === entry[0]) {\n extractToDef(entry); // this has special handling for the root schema\n continue;\n }\n // extract schemas that are in the external registry\n if (ctx.external) {\n const ext = ctx.external.registry.get(entry[0])?.id;\n if (schema !== entry[0] && ext) {\n extractToDef(entry);\n continue;\n }\n }\n // extract schemas with `id` meta\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n extractToDef(entry);\n continue;\n }\n // break cycles\n if (seen.cycle) {\n // any\n extractToDef(entry);\n continue;\n }\n // extract reused schemas\n if (seen.count > 1) {\n if (ctx.reused === \"ref\") {\n extractToDef(entry);\n }\n }\n }\n if (ctx.external)\n ctx.sharedDefsExtractedFor = ctx.external;\n}\n/** Rewrites `anyOf: [{type: \"a\"}, {type: \"b\"}]` to `type: [\"a\", \"b\"]`, which every JSON Schema draft treats as equivalent and most consumers render far better for the nullable case. Only branches that are a bare type assertion qualify — anything carrying a constraint, `$ref`, `const` or metadata is left alone. Runs after `flattenRef`, so a branch an override decorated or `$defs` extraction turned into a `$ref` is no longer bare and correctly stays in `anyOf`. `oneOf` is excluded: `integer` and `number` overlap, so \"exactly one\" and \"at least one\" are not the same there. OpenAPI 3.0 is excluded: its `type` must be a single string. */\nfunction compactTypeUnion(schema) {\n const options = schema.anyOf;\n if (!Array.isArray(options) || options.length === 0 || schema.type !== undefined)\n return;\n const types = [];\n for (const option of options) {\n if (!option || typeof option !== \"object\")\n return;\n // A branch that is itself a compactible union folds into this one — nested `anyOf` and a flat `type` array say the same thing. Compacting it first also makes the result independent of the order this pass walks the seen map in.\n compactTypeUnion(option);\n const keys = Object.keys(option);\n if (keys.length !== 1 || keys[0] !== \"type\")\n return;\n const type = option.type;\n for (const member of Array.isArray(type) ? type : [type]) {\n if (typeof member !== \"string\")\n return;\n if (!types.includes(member))\n types.push(member);\n }\n }\n delete schema.anyOf;\n // A `type` array must be non-empty and unique (metaschema); a single member is spelled as a bare string.\n schema.type = types.length === 1 ? types[0] : types;\n}\n/** Keywords `foldIntersection` knows how to combine. Anything else — `$ref`, `patternProperties`,\n * an annotation like `description` — makes a member unfoldable, so a constraint this does not\n * understand leaves the `allOf` alone instead of being silently dropped or misattributed. */\nconst FOLDABLE_KEYS = new Set([\"type\", \"properties\", \"required\", \"additionalProperties\"]);\nconst UNION_KEYS = [\"oneOf\", \"anyOf\"];\n/** A member's constraint on a key it does not declare itself. A `catchall` states one; `false`, an absent `additionalProperties`, and the empty schema a loose object emits state nothing. */\nfunction undeclaredConstraint(member) {\n const extra = member.additionalProperties;\n if (extra === undefined || extra === false || typeof extra !== \"object\" || extra === null)\n return null;\n return Object.keys(extra).length ? extra : null;\n}\n/** Combines object members into the single object they describe together, or returns `null` if any of them carries a keyword outside {@link FOLDABLE_KEYS}. */\nfunction foldObjects(members) {\n const objects = [];\n for (const member of members) {\n // A boolean subschema is legal JSON Schema and carries no keywords to fold.\n if (typeof member !== \"object\" || member.type !== \"object\")\n return null;\n for (const key in member) {\n if (!FOLDABLE_KEYS.has(key))\n return null;\n }\n objects.push(member);\n }\n const properties = {};\n const required = new Set();\n for (const object of objects) {\n for (const key in object.properties) {\n // `in` would report a `__proto__` key as already present via the prototype chain and skip it.\n if (Object.prototype.hasOwnProperty.call(properties, key))\n continue;\n // Every member constrains this key: the ones that declare it say how, and a `catchall` member constrains it too even though it does not name it. The key has to satisfy all of them, which is the same intersection one level down.\n const parts = [];\n for (const other of objects) {\n const part = other.properties?.[key] ?? undeclaredConstraint(other);\n if (part === null || part === undefined)\n continue;\n if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part)))\n parts.push(part);\n }\n const merged = parts.length === 1\n ? parts[0]\n : (foldObjects(parts) ?? { allOf: parts });\n assignProp(properties, key, merged);\n }\n for (const key of object.required ?? [])\n required.add(key);\n }\n const folded = { type: \"object\", properties };\n if (required.size)\n folded.required = [...required];\n // A key no member declares is rejected only when every member rejects it, so the fold is closed only when every member is. Otherwise it carries whatever the `catchall` members demand of such a key.\n if (objects.every((object) => object.additionalProperties === false)) {\n folded.additionalProperties = false;\n }\n else {\n const constraints = [];\n for (const object of objects) {\n const constraint = undeclaredConstraint(object);\n if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint)))\n constraints.push(constraint);\n }\n if (constraints.length === 1)\n folded.additionalProperties = constraints[0];\n else if (constraints.length > 1)\n folded.additionalProperties = { allOf: constraints };\n }\n return folded;\n}\n/** `additionalProperties` in an `allOf` member sees only that member's own `properties`, so two\n * closed object members reject each other's keys and the schema validates nothing. Zod's parser\n * pools the key sets instead — `handleIntersectionResults` reports a key as unrecognized only when\n * *every* side rejects it — so the emitted schema has to pool them too, and folding the members\n * into one object is the encoding that says so on every target.\n *\n * This runs from `finalize`, after `extractDefs`, which is what keeps it clear of the `$ref`\n * machinery: a member extracted into `$defs` is already a `$ref` by now and declines to fold, so it\n * keeps its reference and its own closedness rather than being inlined as a stale copy. */\nfunction foldIntersection(json) {\n const allOf = json.allOf;\n if (!Array.isArray(allOf) || allOf.length < 2)\n return;\n // An `override` runs before this pass and may have written object keywords onto the intersection itself. Those are deliberate, so decline rather than overwrite them.\n for (const key of FOLDABLE_KEYS)\n if (key in json)\n return;\n // An intersection distributes over a union: `A & (X | Y)` is `(A & X) | (A & Y)`. Only the first union is distributed over; a second one stays among the members every branch folds against, where it fails the object check and declines the whole intersection rather than multiplying out.\n const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));\n let folded = null;\n if (!unions.length) {\n folded = foldObjects(allOf);\n }\n else {\n const union = unions[0];\n const keyword = UNION_KEYS.find((k) => Array.isArray(union[k]));\n if (Object.keys(union).length !== 1)\n return;\n const rest = allOf.filter((m) => m !== union);\n const branches = union[keyword].map((branch) => foldObjects([...rest, branch]));\n if (branches.some((b) => !b))\n return;\n folded = { [keyword]: branches };\n }\n if (!folded)\n return;\n delete json.allOf;\n assignProps(json, folded);\n}\nexport function finalize(ctx, schema) {\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // flatten refs - inherit properties from parent schemas\n const flattenRef = (zodSchema) => {\n const seen = ctx.seen.get(zodSchema);\n // already processed\n if (seen.ref === null)\n return;\n const schema = seen.def ?? seen.schema;\n const _cached = { ...schema };\n const ref = seen.ref;\n seen.ref = null; // prevent infinite recursion\n if (ref) {\n flattenRef(ref);\n const refSeen = ctx.seen.get(ref);\n const refSchema = refSeen.schema;\n // merge referenced schema into current\n if (refSchema.$ref && (ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\")) {\n // older drafts can't combine $ref with other properties\n schema.allOf = schema.allOf ?? [];\n schema.allOf.push(refSchema);\n }\n else {\n assignProps(schema, refSchema);\n }\n // restore child's own properties (child wins)\n assignProps(schema, _cached);\n const isParentRef = zodSchema._zod.parent === ref;\n // For parent chain, child is a refinement - remove parent-only properties\n if (isParentRef) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (!(key in _cached)) {\n delete schema[key];\n }\n }\n }\n // When ref was extracted to $defs, remove properties that match the definition\n if (refSchema.$ref && refSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n // If parent was extracted (has $ref), propagate $ref to this schema. This handles cases like: readonly().meta({id}).describe() where processor sets ref to innerType but parent should be referenced\n const parent = zodSchema._zod.parent;\n if (parent && parent !== ref) {\n // Ensure parent is processed first so its def has inherited properties\n flattenRef(parent);\n const parentSeen = ctx.seen.get(parent);\n if (parentSeen?.schema.$ref) {\n schema.$ref = parentSeen.schema.$ref;\n // De-duplicate with parent's definition\n if (parentSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n }\n // execute overrides\n ctx.override({\n zodSchema: zodSchema,\n jsonSchema: schema,\n path: seen.path ?? [],\n });\n };\n // Flattening walks the whole map and clears each `ref` as it goes, so a second call over the same map is a no-op scan. Skip it outright once it has run for a registry conversion.\n if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {\n for (const entry of [...ctx.seen.entries()].reverse()) {\n flattenRef(entry[0]);\n }\n if (ctx.target !== \"openapi-3.0\") {\n for (const entry of ctx.seen.entries()) {\n compactTypeUnion(entry[1].def ?? entry[1].schema);\n }\n }\n for (const rewrite of ctx.deferred)\n rewrite();\n // After flattening, every member that was extracted is a `$ref`, so the fold sees the final shape. A schema that inherits an intersection — through `z.lazy`, or any `ref` chain — holds the same `allOf` array, so fold by array identity to catch every copy.\n if (ctx.intersections.length) {\n const carriers = new Map();\n for (const seen of ctx.seen.values()) {\n for (const json of [seen.schema, seen.def]) {\n const allOf = json?.allOf;\n if (!Array.isArray(allOf))\n continue;\n const existing = carriers.get(allOf);\n if (existing)\n existing.push(json);\n else\n carriers.set(allOf, [json]);\n }\n }\n for (const allOf of ctx.intersections) {\n for (const json of carriers.get(allOf) ?? [])\n foldIntersection(json);\n }\n }\n }\n const result = {};\n if (ctx.target === \"draft-2020-12\") {\n result.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n }\n else if (ctx.target === \"draft-07\") {\n result.$schema = \"http://json-schema.org/draft-07/schema#\";\n }\n else if (ctx.target === \"draft-04\") {\n result.$schema = \"http://json-schema.org/draft-04/schema#\";\n }\n else if (ctx.target === \"openapi-3.0\") {\n // OpenAPI 3.0 schema objects should not include a $schema property\n }\n else {\n // Arbitrary string values are allowed but won't have a $schema property set\n }\n if (ctx.external?.uri) {\n const id = ctx.external.registry.get(schema)?.id;\n if (!id)\n throw new Error(\"Schema is missing an `id` property\");\n result.$id = ctx.external.uri(id);\n }\n // when the root was extracted into $defs, `root.schema` is the `$ref` wrapper and `root.def` is the body that now lives under $defs\n assignProps(result, root.defId ? root.schema : (root.def ?? root.schema));\n // The `id` in `.meta()` is a Zod-specific registration tag used to extract schemas into $defs — it is not user-facing JSON Schema metadata. Strip it from the output body where it would otherwise leak. The id is preserved implicitly via the $defs key (and via $ref paths).\n const rootMetaId = ctx.metadataRegistry.get(schema)?.id;\n if (rootMetaId !== undefined && result.id === rootMetaId)\n delete result.id;\n // build defs object. With `external`, `defs` is the shared object every schema writes into, so the same entries are reassigned on every call. Without it, `defs` is fresh per call and must be rebuilt.\n const defs = ctx.external?.defs ?? {};\n if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.def && seen.defId) {\n if (seen.def.id === seen.defId)\n delete seen.def.id;\n assignProp(defs, seen.defId, seen.def);\n }\n }\n }\n if (ctx.external)\n ctx.sharedEmitDoneFor = ctx.external;\n // set definitions in result\n if (ctx.external) {\n }\n else {\n if (Object.keys(defs).length > 0) {\n if (ctx.target === \"draft-2020-12\") {\n result.$defs = defs;\n }\n else {\n result.definitions = defs;\n }\n }\n }\n try {\n // this \"finalizes\" this schema and ensures all cycles are removed each call to finalize() is functionally independent though the seen map is shared\n const finalized = JSON.parse(JSON.stringify(result));\n Object.defineProperty(finalized, \"~standard\", {\n value: {\n ...schema[\"~standard\"],\n jsonSchema: {\n input: createStandardJSONSchemaMethod(schema, \"input\", ctx.processors),\n output: createStandardJSONSchemaMethod(schema, \"output\", ctx.processors),\n },\n },\n enumerable: false,\n writable: false,\n });\n return finalized;\n }\n catch (_err) {\n throw new Error(\"Error converting schema to JSON.\");\n }\n}\nfunction isTransforming(_schema, _ctx) {\n const ctx = _ctx ?? { seen: new Set() };\n if (ctx.seen.has(_schema))\n return false;\n ctx.seen.add(_schema);\n const def = _schema._zod.def;\n if (def.type === \"transform\")\n return true;\n if (def.type === \"array\")\n return isTransforming(def.element, ctx);\n if (def.type === \"set\")\n return isTransforming(def.valueType, ctx);\n if (def.type === \"lazy\")\n return isTransforming(def.getter(), ctx);\n if (def.type === \"promise\" ||\n def.type === \"optional\" ||\n def.type === \"nonoptional\" ||\n def.type === \"nullable\" ||\n def.type === \"readonly\" ||\n def.type === \"default\" ||\n def.type === \"prefault\" ||\n def.type === \"catch\") {\n return isTransforming(def.innerType, ctx);\n }\n if (def.type === \"intersection\") {\n return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);\n }\n if (def.type === \"record\" || def.type === \"map\") {\n return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);\n }\n if (def.type === \"pipe\") {\n if (_schema._zod.traits.has(\"$ZodCodec\"))\n return true;\n return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);\n }\n if (def.type === \"object\") {\n for (const key in def.shape) {\n if (isTransforming(def.shape[key], ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"union\") {\n for (const option of def.options) {\n if (isTransforming(option, ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"tuple\") {\n for (const item of def.items) {\n if (isTransforming(item, ctx))\n return true;\n }\n if (def.rest && isTransforming(def.rest, ctx))\n return true;\n return false;\n }\n return false;\n}\n/**\n * Creates a toJSONSchema method for a schema instance.\n * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.\n */\nexport const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {\n const ctx = initializeContext({ ...params, processors });\n processSchema(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\nexport const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {\n const { libraryOptions, target } = params ?? {};\n const ctx = initializeContext({ ...(libraryOptions ?? {}), target, io, processors });\n processSchema(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\n","import * as regexes from \"./regexes.js\";\nimport { base64Charset, base64urlCharset } from \"./schemas.js\";\nimport { extractDefs, finalize, handleUnrepresentable, initializeContext, processSchema, } from \"./to-json-schema.js\";\nimport { BIGINT_FORMAT_RANGES, NUMBER_FORMAT_RANGES, assignProp, getEnumValues } from \"./util.js\";\nconst narrowMin = (agg, key, value) => {\n if (agg[key] === undefined || value > agg[key])\n agg[key] = value;\n};\nconst narrowMax = (agg, key, value) => {\n if (agg[key] === undefined || value < agg[key])\n agg[key] = value;\n};\nconst narrowBoth = (agg, value) => {\n narrowMin(agg, \"minimum\", value);\n narrowMax(agg, \"maximum\", value);\n};\nconst addDivisor = (agg, value) => {\n agg.multipleOf ?? (agg.multipleOf = []);\n if (!agg.multipleOf.includes(value))\n agg.multipleOf.push(value);\n};\nconst addPattern = (agg, pattern) => {\n agg.patterns ?? (agg.patterns = new Set());\n agg.patterns.add(pattern);\n};\nconst intersectMime = (agg, mime) => {\n agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];\n};\n// last-wins, matching the bag's historical write order; the flag keeps an integer format from being lost to a later float one\nconst setFormat = (agg, format) => {\n agg.format = format;\n if (format.includes(\"int\"))\n agg.isInt = true;\n};\nconst minContributor = (agg, def) => narrowMin(agg, \"minimum\", def.minimum);\nconst maxContributor = (agg, def) => narrowMax(agg, \"maximum\", def.maximum);\nconst formatContributor = (ranges) => (agg, def) => {\n setFormat(agg, def.format);\n const [minimum, maximum] = ranges[def.format];\n narrowMin(agg, \"minimum\", minimum);\n narrowMax(agg, \"maximum\", maximum);\n};\nconst contributors = {\n greater_than: (agg, def) => narrowMin(agg, def.inclusive ? \"minimum\" : \"exclusiveMinimum\", def.value),\n less_than: (agg, def) => narrowMax(agg, def.inclusive ? \"maximum\" : \"exclusiveMaximum\", def.value),\n multiple_of: (agg, def) => addDivisor(agg, def.value),\n number_format: formatContributor(NUMBER_FORMAT_RANGES),\n bigint_format: formatContributor(BIGINT_FORMAT_RANGES),\n min_length: minContributor,\n max_length: maxContributor,\n length_equals: (agg, def) => narrowBoth(agg, def.length),\n min_size: minContributor,\n max_size: maxContributor,\n size_equals: (agg, def) => narrowBoth(agg, def.size),\n string_format: (agg, def) => {\n setFormat(agg, def.format);\n if (def.pattern)\n addPattern(agg, def.pattern);\n if (def.format === \"base64\" || def.format === \"base64url\")\n agg.contentEncoding = def.format;\n if (def.local || def.precision === -1)\n agg.laxFormat = true;\n },\n mime_type: (agg, def) => intersectMime(agg, def.mime),\n};\nexport function aggregateChecks(schema) {\n const agg = {};\n const def = schema._zod.def;\n // a format schema is its own first check, same rule as $ZodType init\n const list = schema._zod.traits.has(\"$ZodCheck\")\n ? [schema, ...(def.checks ?? [])]\n : (def.checks ?? []);\n for (const ch of list)\n contributors[ch._zod.def.check]?.(agg, ch._zod.def);\n // reconcile with the bag so third-party onattach contributions still land; first-party residue is never tighter than the fold, so merging it back is idempotent for one and additive for the other\n const bag = schema._zod.bag;\n if (bag.minimum !== undefined)\n narrowMin(agg, \"minimum\", bag.minimum);\n if (bag.exclusiveMinimum !== undefined)\n narrowMin(agg, \"exclusiveMinimum\", bag.exclusiveMinimum);\n if (bag.maximum !== undefined)\n narrowMax(agg, \"maximum\", bag.maximum);\n if (bag.exclusiveMaximum !== undefined)\n narrowMax(agg, \"exclusiveMaximum\", bag.exclusiveMaximum);\n if (bag.multipleOf !== undefined)\n addDivisor(agg, bag.multipleOf);\n if (bag.format !== undefined) {\n agg.format ?? (agg.format = bag.format);\n if (bag.format.includes(\"int\"))\n agg.isInt = true;\n }\n if (bag.mime)\n intersectMime(agg, bag.mime);\n for (const pattern of bag.patterns ?? [])\n addPattern(agg, pattern);\n return agg;\n}\nconst formatMap = {\n guid: \"uuid\",\n url: \"uri\",\n datetime: \"date-time\",\n json_string: \"json-string\",\n regex: \"\", // do not set\n};\n// ==================== SIMPLE TYPE PROCESSORS ====================\n// the runtime patterns are lax so parse paths never overflow the regex stack; the emitted schema swaps in the exact block forms, which zod itself never executes\nconst exactPatterns = new Map([\n [base64Charset, regexes.base64],\n [base64urlCharset, regexes.base64url],\n]);\nconst exactPattern = (p) => exactPatterns.get(p) ?? p;\nexport const stringProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n json.type = \"string\";\n const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);\n if (typeof minimum === \"number\")\n json.minLength = minimum;\n if (typeof maximum === \"number\")\n json.maxLength = maximum;\n // custom pattern overrides format\n if (format) {\n json.format = formatMap[format] ?? format;\n if (json.format === \"\")\n delete json.format; // empty format is not valid\n // `z.iso.time()` is never full-time, and `laxFormat` carries the datetime shapes that also accept what their keyword forbids\n if (format === \"time\" || laxFormat) {\n delete json.format;\n }\n }\n if (contentEncoding)\n json.contentEncoding = contentEncoding;\n if (patterns && patterns.size > 0) {\n const patternList = [...patterns].map(exactPattern);\n if (patternList.length === 1)\n json.pattern = patternList[0].source;\n else if (patternList.length > 1) {\n json.allOf = [\n ...patternList.map((regex) => ({\n ...(ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\"\n ? { type: \"string\" }\n : {}),\n pattern: regex.source,\n })),\n ];\n }\n }\n};\nexport const numberProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);\n json.type = isInt ? \"integer\" : \"number\";\n // when both minimum and exclusiveMinimum exist, pick the more restrictive one\n const exMin = typeof exclusiveMinimum === \"number\" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);\n const exMax = typeof exclusiveMaximum === \"number\" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);\n const legacy = ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\";\n if (exMin) {\n if (legacy) {\n json.minimum = exclusiveMinimum;\n json.exclusiveMinimum = true;\n }\n else {\n json.exclusiveMinimum = exclusiveMinimum;\n }\n }\n else if (typeof minimum === \"number\") {\n json.minimum = minimum;\n }\n if (exMax) {\n if (legacy) {\n json.maximum = exclusiveMaximum;\n json.exclusiveMaximum = true;\n }\n else {\n json.exclusiveMaximum = exclusiveMaximum;\n }\n }\n else if (typeof maximum === \"number\") {\n json.maximum = maximum;\n }\n if (multipleOf) {\n // JSON Schema requires a divisor strictly greater than zero, and a non-finite one does not survive JSON at all. A negative divisor accepts exactly what its absolute value accepts, so it still maps; zero, NaN and Infinity have no keyword form.\n const divisors = new Set();\n for (const divisor of multipleOf) {\n if (Number.isFinite(divisor) && divisor !== 0)\n divisors.add(Math.abs(divisor));\n else\n handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);\n }\n // chained divisors are a conjunction the keyword cannot carry alone, so extras ride an allOf, same as stacked patterns\n const [first, ...rest] = divisors;\n if (first !== undefined)\n json.multipleOf = first;\n if (rest.length)\n json.allOf = [...(json.allOf ?? []), ...rest.map((m) => ({ multipleOf: m }))];\n }\n};\nexport const booleanProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const bigintProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"BigInt cannot be represented in JSON Schema\");\n};\nexport const symbolProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Symbols cannot be represented in JSON Schema\");\n};\nexport const nullProcessor = (_schema, ctx, json, _params) => {\n if (ctx.target === \"openapi-3.0\") {\n json.type = \"string\";\n json.nullable = true;\n json.enum = [null];\n }\n else {\n json.type = \"null\";\n }\n};\nexport const undefinedProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Undefined cannot be represented in JSON Schema\");\n};\nexport const voidProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Void cannot be represented in JSON Schema\");\n};\nexport const neverProcessor = (_schema, _ctx, json, _params) => {\n json.not = {};\n};\nexport const anyProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const unknownProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const dateProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Date cannot be represented in JSON Schema\");\n};\nexport const enumProcessor = (schema, _ctx, json, _params) => {\n const def = schema._zod.def;\n const values = getEnumValues(def.entries);\n // an empty enum accepts nothing, same as z.never()\n if (values.length === 0) {\n json.not = {};\n return;\n }\n // Number enums can have both string and number values\n if (values.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (values.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n json.enum = values;\n};\nexport const literalProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n // a literal with no values accepts nothing, same as z.never()\n if (def.values.length === 0) {\n json.not = {};\n return;\n }\n const vals = [];\n for (const val of def.values) {\n if (val === undefined) {\n // a custom schema replaces the whole literal, so there is nothing left to accumulate\n if (handleUnrepresentable(schema, ctx, json, params, \"Literal `undefined` cannot be represented in JSON Schema\"))\n return;\n // otherwise do not add to vals\n }\n else if (typeof val === \"bigint\") {\n if (handleUnrepresentable(schema, ctx, json, params, \"BigInt literals cannot be represented in JSON Schema\"))\n return;\n vals.push(Number(val));\n }\n else {\n vals.push(val);\n }\n }\n if (vals.length === 0) {\n // do nothing (an undefined literal was stripped)\n }\n else if (vals.length === 1) {\n const val = vals[0];\n json.type = val === null ? \"null\" : typeof val;\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.enum = [val];\n }\n else {\n json.const = val;\n }\n }\n else {\n if (vals.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (vals.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n if (vals.every((v) => typeof v === \"boolean\"))\n json.type = \"boolean\";\n if (vals.every((v) => v === null))\n json.type = \"null\";\n json.enum = vals;\n }\n};\nexport const nanProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"NaN cannot be represented in JSON Schema\");\n};\nexport const templateLiteralProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const pattern = schema._zod.pattern;\n if (!pattern)\n throw new Error(\"Pattern not found in template literal\");\n _json.type = \"string\";\n _json.pattern = pattern.source;\n};\nexport const fileProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n _json.type = \"string\";\n _json.format = \"binary\";\n _json.contentEncoding = \"binary\";\n const { minimum, maximum, mime } = aggregateChecks(schema);\n if (minimum !== undefined)\n _json.minLength = minimum;\n if (maximum !== undefined)\n _json.maxLength = maximum;\n if (!mime)\n return;\n // an empty intersection means the mime checks share no value, so nothing passes at runtime; `anyOf` must be non-empty, so the false schema is `not: {}`\n if (mime.length === 0)\n _json.not = {};\n else if (mime.length === 1)\n _json.contentMediaType = mime[0];\n // only contentMediaType differs, so the shared props stay at the root\n else\n _json.anyOf = mime.map((m) => ({ contentMediaType: m }));\n};\nexport const successProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const customProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Custom types cannot be represented in JSON Schema\");\n};\nexport const functionProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Function types cannot be represented in JSON Schema\");\n};\nexport const transformProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Transforms cannot be represented in JSON Schema\");\n};\nexport const mapProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Map cannot be represented in JSON Schema\");\n};\nexport const setProcessor = (schema, ctx, json, params) => {\n handleUnrepresentable(schema, ctx, json, params, \"Set cannot be represented in JSON Schema\");\n};\n// ==================== COMPOSITE TYPE PROCESSORS ====================\nexport const arrayProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n const { minimum, maximum } = aggregateChecks(schema);\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n json.type = \"array\";\n json.items = processSchema(def.element, ctx, {\n ...params,\n path: [...params.path, \"items\"],\n });\n};\n// Transform and catch set `optin = \"optional\"` at runtime so the parser lets them observe an\n// absent key, but their declared input type stays required. An input JSON Schema describes the\n// declared type, so resolve past them to the schema that actually carries the optionality.\n// Used by both `objectProcessor` (for `required`) and `tupleProcessor` (for `minItems`); see\n// wiki/optionality.md, \"The JSON Schema emitter reads the *static* value\".\nfunction inputOptin(schema) {\n const def = schema._zod.def;\n if (def.type === \"pipe\" && def.in._zod.traits.has(\"$ZodTransform\")) {\n return inputOptin(def.out);\n }\n if (def.type === \"catch\") {\n return inputOptin(def.innerType);\n }\n return schema._zod.optin;\n}\nexport const objectProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n const shape = def.shape;\n // dropping it while still emitting `additionalProperties: false` would emit a schema that rejects data this one requires\n const symbolKeys = Object.getOwnPropertySymbols(shape);\n if (symbolKeys.length &&\n handleUnrepresentable(schema, ctx, json, params, \"Symbol keys cannot be represented in JSON Schema\")) {\n return;\n }\n json.type = \"object\";\n json.properties = {};\n for (const key in shape) {\n // assignProp so a __proto__ key becomes an own property instead of hitting the inherited setter on the plain {} we build into\n assignProp(json.properties, key, processSchema(shape[key], ctx, {\n ...params,\n path: [...params.path, \"properties\", key],\n }));\n }\n // required keys\n const requiredKeys = [];\n for (const key of Object.keys(shape)) {\n const field = def.shape[key];\n if (ctx.io === \"input\" ? inputOptin(field) === undefined : field._zod.optout === undefined) {\n requiredKeys.push(key);\n }\n }\n if (requiredKeys.length > 0) {\n json.required = requiredKeys;\n }\n // catchall\n if (def.catchall?._zod.def.type === \"never\") {\n // strict\n json.additionalProperties = false;\n }\n else if (!def.catchall) {\n // regular\n if (ctx.io === \"output\")\n json.additionalProperties = false;\n }\n else if (def.catchall) {\n json.additionalProperties = processSchema(def.catchall, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n};\nexport const unionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n // Exclusive unions (inclusive === false) use oneOf (exactly one match) instead of anyOf (one or more matches). This includes both z.xor() and discriminated unions\n const isExclusive = def.inclusive === false;\n const options = def.options.map((x, i) => processSchema(x, ctx, {\n ...params,\n path: [...params.path, isExclusive ? \"oneOf\" : \"anyOf\", i],\n }));\n if (isExclusive) {\n json.oneOf = options;\n }\n else {\n json.anyOf = options;\n }\n};\nexport const intersectionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const a = processSchema(def.left, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 0],\n });\n const b = processSchema(def.right, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 1],\n });\n const isSimpleIntersection = (val) => \"allOf\" in val && Object.keys(val).length === 1;\n const allOf = [\n ...(isSimpleIntersection(a) ? a.allOf : [a]),\n ...(isSimpleIntersection(b) ? b.allOf : [b]),\n ];\n json.allOf = allOf;\n // Recorded innermost first, so a nested intersection has already folded by the time this one is considered. The array is the handle rather than the schema, because a wrapper that inherits this schema shares the same array; `finalize` folds every object holding it. See `foldIntersection`.\n ctx.intersections.push(allOf);\n};\nexport const tupleProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"array\";\n const prefixPath = ctx.target === \"draft-2020-12\" ? \"prefixItems\" : \"items\";\n const restPath = ctx.target === \"draft-2020-12\" ? \"items\" : ctx.target === \"openapi-3.0\" ? \"items\" : \"additionalItems\";\n const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {\n ...params,\n path: [...params.path, prefixPath, i],\n }));\n const rest = def.rest\n ? processSchema(def.rest, ctx, {\n ...params,\n path: [...params.path, restPath, ...(ctx.target === \"openapi-3.0\" ? [def.items.length] : [])],\n })\n : null;\n let minItems = def.items.length;\n while (minItems > 0) {\n const item = def.items[minItems - 1];\n const optional = ctx.io === \"input\" ? inputOptin(item) !== undefined : item._zod.optout === \"optional\";\n if (!optional)\n break;\n minItems--;\n }\n const maxItems = def.items.length;\n const isClosed = !def.rest;\n if (ctx.target === \"draft-2020-12\") {\n json.prefixItems = prefixItems;\n if (isClosed) {\n json.items = false;\n }\n else if (rest) {\n json.items = rest;\n }\n if (minItems > 0)\n json.minItems = minItems;\n if (isClosed)\n json.maxItems = maxItems;\n }\n else if (ctx.target === \"openapi-3.0\") {\n json.items = {\n anyOf: prefixItems,\n };\n if (rest) {\n json.items.anyOf.push(rest);\n }\n if (minItems > 0)\n json.minItems = minItems;\n if (isClosed)\n json.maxItems = maxItems;\n }\n else {\n json.items = prefixItems;\n if (isClosed) {\n json.additionalItems = false;\n }\n else if (rest) {\n json.additionalItems = rest;\n }\n if (minItems > 0)\n json.minItems = minItems;\n if (isClosed)\n json.maxItems = maxItems;\n }\n // explicit user-defined length checks take precedence\n const { minimum, maximum } = aggregateChecks(schema);\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n};\n/** JSON object keys are always strings, so a numeric record key schema is re-expressed over the\n * numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key\n * behind a wrapper only carries its own `type` before then, and a union key only has its branches.\n *\n * A numeric bound cannot apply to a property name, so `minimum` and its siblings are dropped rather\n * than carried over: keeping them beside `type: \"string\"` reproduces the match-nothing schema this\n * exists to fix. A key that carries one therefore emits wider than the record parses — `z.record(z.number().min(5), V)`\n * accepts `\"3\"` — which is the deliberate trade, since throwing on it would reject an ordinary schema\n * outright. */\nfunction stringifyKeyNames(bySchema, json, visited) {\n // an extracted key that rewrites cannot go on sharing its definition — the string form a key position needs is not the number form every other reference wants — so it inlines. One that does not rewrite keeps the `$ref`.\n if (json.$ref) {\n // a recursive key holds its own reference inside its definition, so a node already on the path is left alone rather than resolved again\n if (visited.has(json))\n return json;\n visited.add(json);\n const def = bySchema.get(json)?.def;\n if (!def)\n return json;\n const inlined = stringifyKeyNames(bySchema, def, visited);\n return inlined === def ? json : inlined;\n }\n for (const keyword of [\"anyOf\", \"oneOf\"]) {\n const branches = json[keyword];\n if (!Array.isArray(branches))\n continue;\n const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));\n // rebuilding regardless would detach a key that had nothing to re-express, dropping its `$ref` and leaking the internal `id`\n if (mapped.some((branch, i) => branch !== branches[i]))\n json = { ...json, [keyword]: mapped };\n }\n // a member that already admits a string leaves the key unconstrained, so the node's own type re-expresses only when every member is numeric\n const types = Array.isArray(json.type) ? json.type : [json.type];\n const numericType = !types.includes(\"string\") && types.some((t) => t === \"number\" || t === \"integer\");\n // a heterogeneous key carries no type at all, so its numeric members are caught here instead\n const values = json.enum ?? (json.const !== undefined ? [json.const] : undefined);\n if (!numericType && !values?.some((v) => typeof v === \"number\"))\n return json;\n const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;\n if (rest.enum)\n rest.enum = rest.enum.map((v) => (typeof v === \"number\" ? String(v) : v));\n else if (typeof rest.const === \"number\")\n rest.const = String(rest.const);\n // a heterogeneous key keeps its absent type: the stringified members already say what a key may be\n if (!numericType)\n return rest;\n rest.type = \"string\";\n if (!values)\n rest.pattern = (types.includes(\"number\") ? regexes.number : regexes.integer).source;\n return rest;\n}\n/** Every record of one conversion, so the carriers are found in a single pass rather than once per record. */\nconst pendingRecords = new WeakMap();\nfunction rewriteKeyNames(ctx) {\n // an extracted key is resolved by the object `extractToDef` left in its place, so the map is built once rather than searched per reference. `_zod.toJSONSchema` can hand the same object to two schemas, so the first entry carrying a body wins, as a search would have found it.\n const bySchema = new Map();\n for (const entry of ctx.seen.values()) {\n if (entry.def && !bySchema.has(entry.schema))\n bySchema.set(entry.schema, entry);\n }\n const rewrites = new Map();\n for (const record of pendingRecords.get(ctx) ?? []) {\n const seen = ctx.seen.get(record);\n const names = (seen?.def ?? seen?.schema)?.propertyNames;\n if (!names || names === true || rewrites.has(names))\n continue;\n const rewritten = stringifyKeyNames(bySchema, names, new Set());\n if (rewritten !== names)\n rewrites.set(names, rewritten);\n }\n if (!rewrites.size)\n return;\n // the flatten has already copied each record's own properties onto every wrapper by reference, and an extracted body is another such copy, so every carrier holding a rewritten key is updated together\n for (const entry of ctx.seen.values()) {\n for (const carrier of [entry.schema, entry.def]) {\n const rewritten = carrier && rewrites.get(carrier.propertyNames);\n if (rewritten)\n carrier.propertyNames = rewritten;\n }\n }\n}\nexport const recordProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n // For looseRecord with regex patterns, use patternProperties. This correctly represents \"only validate keys matching the pattern\" semantics and composes well with allOf (intersections)\n const keyType = def.keyType;\n const patterns = aggregateChecks(keyType).patterns;\n if (def.mode === \"loose\" && patterns && patterns.size > 0) {\n // Use patternProperties for looseRecord with regex patterns\n const valueSchema = processSchema(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"patternProperties\", \"*\"],\n });\n json.patternProperties = {};\n for (const pattern of patterns) {\n assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);\n }\n }\n else {\n // Default behavior: use propertyNames + additionalProperties\n if (ctx.target === \"draft-07\" || ctx.target === \"draft-2020-12\") {\n json.propertyNames = processSchema(def.keyType, ctx, {\n ...params,\n path: [...params.path, \"propertyNames\"],\n });\n let pending = pendingRecords.get(ctx);\n if (!pending) {\n pending = [];\n pendingRecords.set(ctx, pending);\n ctx.deferred.push(() => rewriteKeyNames(ctx));\n }\n pending.push(schema);\n }\n json.additionalProperties = processSchema(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n // Add required for keys with discrete values (enum, literal, etc.)\n const keyValues = keyType._zod.values;\n // Every key shares one value schema, so an optional-in value makes the whole key set omittable on input. Output keeps them: the exhaustive branch assigns every key, even one whose value came back undefined.\n const omittableOnInput = ctx.io === \"input\" && inputOptin(def.valueType) !== undefined;\n if (keyValues && !def.partial && !omittableOnInput) {\n const validKeyValues = [...keyValues].filter((v) => typeof v === \"string\" || typeof v === \"number\");\n if (validKeyValues.length > 0) {\n json.required = validKeyValues.map(String);\n }\n }\n};\nexport const nullableProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const inner = processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n if (ctx.target === \"openapi-3.0\") {\n seen.ref = def.innerType;\n json.nullable = true;\n }\n else {\n json.anyOf = [inner, { type: \"null\" }];\n }\n};\nexport const nonoptionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\n/** Round-trips a default value through JSON so the emitted schema is guaranteed to be valid JSON.\n * A BigInt has no reliable encoding, so it goes through `unrepresentable` like any other\n * unrepresentable value. Returns a sentinel when the caller must not write a default of its own. */\nconst UNREPRESENTABLE_DEFAULT = Symbol();\nfunction serializeDefaultValue(value, schema, ctx, json, params) {\n let unrepresentable = false;\n const serialized = JSON.stringify(value, (_, val) => {\n if (typeof val !== \"bigint\")\n return val;\n unrepresentable = true;\n return null;\n });\n if (!unrepresentable)\n return JSON.parse(serialized);\n handleUnrepresentable(schema, ctx, json, params, \"BigInt defaults cannot be represented in JSON Schema\");\n return UNREPRESENTABLE_DEFAULT;\n}\nexport const defaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);\n if (value !== UNREPRESENTABLE_DEFAULT)\n json.default = value;\n};\nexport const prefaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n if (ctx.io !== \"input\")\n return;\n const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);\n if (value !== UNREPRESENTABLE_DEFAULT)\n json._prefault = value;\n};\nexport const catchProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n let catchValue;\n try {\n catchValue = def.catchValue(undefined);\n }\n catch {\n handleUnrepresentable(schema, ctx, json, params, \"Dynamic catch values are not supported in JSON Schema\");\n return;\n }\n json.default = catchValue;\n};\nexport const pipeProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n const inIsTransform = def.in._zod.traits.has(\"$ZodTransform\");\n const innerType = ctx.io === \"input\" ? (inIsTransform ? def.out : def.in) : def.out;\n processSchema(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\nexport const readonlyProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.readOnly = true;\n};\nexport const promiseProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const optionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n processSchema(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const lazyProcessor = (schema, ctx, _json, params) => {\n const innerType = schema._zod.innerType;\n processSchema(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\n// ==================== ALL PROCESSORS ====================\nexport const allProcessors = {\n string: stringProcessor,\n number: numberProcessor,\n boolean: booleanProcessor,\n bigint: bigintProcessor,\n symbol: symbolProcessor,\n null: nullProcessor,\n undefined: undefinedProcessor,\n void: voidProcessor,\n never: neverProcessor,\n any: anyProcessor,\n unknown: unknownProcessor,\n date: dateProcessor,\n enum: enumProcessor,\n literal: literalProcessor,\n nan: nanProcessor,\n template_literal: templateLiteralProcessor,\n file: fileProcessor,\n success: successProcessor,\n custom: customProcessor,\n function: functionProcessor,\n transform: transformProcessor,\n map: mapProcessor,\n set: setProcessor,\n array: arrayProcessor,\n object: objectProcessor,\n union: unionProcessor,\n intersection: intersectionProcessor,\n tuple: tupleProcessor,\n record: recordProcessor,\n nullable: nullableProcessor,\n nonoptional: nonoptionalProcessor,\n default: defaultProcessor,\n prefault: prefaultProcessor,\n catch: catchProcessor,\n pipe: pipeProcessor,\n readonly: readonlyProcessor,\n promise: promiseProcessor,\n optional: optionalProcessor,\n lazy: lazyProcessor,\n};\nexport function toJSONSchema(input, params) {\n if (\"_idmap\" in input) {\n // Registry case\n const registry = input;\n const ctx = initializeContext({ ...params, processors: allProcessors });\n const defs = {};\n // First pass: process all schemas to build the seen map\n for (const entry of registry._idmap.entries()) {\n const [_, schema] = entry;\n processSchema(schema, ctx);\n }\n const schemas = {};\n const external = {\n registry,\n uri: params?.uri,\n defs,\n };\n // Update the context with external configuration\n ctx.external = external;\n // Second pass: emit each schema\n for (const entry of registry._idmap.entries()) {\n const [key, schema] = entry;\n extractDefs(ctx, schema);\n assignProp(schemas, key, finalize(ctx, schema));\n }\n if (Object.keys(defs).length > 0) {\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n schemas.__shared = {\n [defsSegment]: defs,\n };\n }\n return { schemas };\n }\n // Single schema case\n const ctx = initializeContext({ ...params, processors: allProcessors });\n processSchema(input, ctx);\n extractDefs(ctx, input);\n return finalize(ctx, input);\n}\n","import * as core from \"../core/index.js\";\nimport { $ZodError } from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\n/* Prototypes that already carry the lazy helper methods. Seeded with the\n * intrinsics so that `init` on a foreign object — it accepts any object —\n * can never install an accessor onto a prototype we do not own. */\nconst _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);\n/* Helper methods live as non-enumerable lazy getters on the shared\n * prototype instead of own properties on every instance. On first\n * access the getter allocates the per-instance closure and caches it\n * as a non-enumerable own property, so detached usage still works and\n * the allocation only happens for methods actually touched. */\nfunction _lazyMethod(proto, key, make) {\n Object.defineProperty(proto, key, {\n configurable: true,\n enumerable: false,\n get() {\n const value = make(this);\n Object.defineProperty(this, key, { value, configurable: true, writable: true });\n return value;\n },\n set(value) {\n Object.defineProperty(this, key, { value, configurable: true, writable: true });\n },\n });\n}\nconst initializer = (inst, issues) => {\n $ZodError.init(inst, issues);\n inst.name = \"ZodError\";\n const proto = Object.getPrototypeOf(inst);\n if (_installedErrorProtos.has(proto))\n return;\n _installedErrorProtos.add(proto);\n _lazyMethod(proto, \"format\", (self) => (mapper) => core.formatError(self, mapper));\n _lazyMethod(proto, \"flatten\", (self) => (mapper) => core.flattenError(self, mapper));\n _lazyMethod(proto, \"addIssue\", (self) => (issue) => {\n self.issues.push(issue);\n self.message = JSON.stringify(self.issues, util.jsonStringifyReplacer, 2);\n });\n _lazyMethod(proto, \"addIssues\", (self) => (issues) => {\n self.issues.push(...issues);\n self.message = JSON.stringify(self.issues, util.jsonStringifyReplacer, 2);\n });\n Object.defineProperty(proto, \"isEmpty\", {\n configurable: true,\n enumerable: false,\n get() {\n return this.issues.length === 0;\n },\n });\n};\nexport const ZodError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer);\nexport const ZodRealError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer, undefined, {\n Parent: Error,\n});\n// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */\n// export type ErrorMapCtx = core.$ZodErrorMapCtx;\n","import * as core from \"../core/index.js\";\nimport { ZodRealError } from \"./errors.js\";\nexport const parse = /* @__PURE__ */ core._parse(ZodRealError);\nexport const parseAsync = /* @__PURE__ */ core._parseAsync(ZodRealError);\nexport const safeParse = /* @__PURE__ */ core._safeParse(ZodRealError);\nexport const safeParseAsync = /* @__PURE__ */ core._safeParseAsync(ZodRealError);\nexport { validate, validateAsync } from \"../core/index.js\";\n// Codec functions\nexport const encode = /* @__PURE__ */ core._encode(ZodRealError);\nexport const decode = /* @__PURE__ */ core._decode(ZodRealError);\nexport const encodeAsync = /* @__PURE__ */ core._encodeAsync(ZodRealError);\nexport const decodeAsync = /* @__PURE__ */ core._decodeAsync(ZodRealError);\nexport const safeEncode = /* @__PURE__ */ core._safeEncode(ZodRealError);\nexport const safeDecode = /* @__PURE__ */ core._safeDecode(ZodRealError);\nexport const safeEncodeAsync = /* @__PURE__ */ core._safeEncodeAsync(ZodRealError);\nexport const safeDecodeAsync = /* @__PURE__ */ core._safeDecodeAsync(ZodRealError);\n","import * as core from \"../core/index.js\";\nimport { util } from \"../core/index.js\";\nimport * as processors from \"../core/json-schema-processors.js\";\nimport * as regexes from \"../core/regexes.js\";\nimport { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from \"../core/to-json-schema.js\";\nimport en from \"../locales/en.js\";\nimport * as checks from \"./checks.js\";\nimport * as parse from \"./parse.js\";\n// Register English as the default locale on first ZodType construction. Hooked into the `ZodType` `$constructor` (rather than a top-level `config(en())` in `external.ts`) so bundlers honoring `sideEffects: false` can't tree-shake it out — see #5953, #5725. An explicit `z.config(z.locales.xx())` call wins regardless of order, since this only sets the default when none is present.\nfunction _ensureDefaultLocale() {\n if (!core.globalConfig.localeError)\n core.config(en());\n}\n// the default memoizer is read by the core container init, which runs before `ZodType.init`, so each container calls this first\nfunction _ensureDefaultMemoizer() {\n if (!core.globalConfig.memoizer)\n core.config({ memoizer: core.memoizer() });\n}\nexport const ZodType = /*@__PURE__*/ core.$constructor(\"ZodType\", (inst, def) => {\n _ensureDefaultLocale();\n core.$ZodType.init(inst, def);\n inst.def = def;\n inst.type = def.type;\n return inst;\n}, {\n check(...chks) {\n const def = this.def;\n return this.clone(util.mergeDefs(def, {\n checks: [\n ...(def.checks ?? []),\n ...chks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }), { parent: true });\n },\n with(...chks) {\n return this.check(...chks);\n },\n clone(def, params) {\n return core.clone(this, def, params);\n },\n brand() {\n return this;\n },\n register(reg, meta) {\n reg.add(this, meta);\n return this;\n },\n refine(check, params) {\n return this.check(refine(check, params));\n },\n superRefine(refinement, params) {\n return this.check(superRefine(refinement, params));\n },\n overwrite(fn) {\n return this.check(checks.overwrite(fn));\n },\n optional() {\n return optional(this);\n },\n exactOptional() {\n return exactOptional(this);\n },\n nullable() {\n return nullable(this);\n },\n nullish() {\n return optional(nullable(this));\n },\n nonoptional(params) {\n return nonoptional(this, params);\n },\n array() {\n return array(this);\n },\n or(arg) {\n return union([this, arg]);\n },\n and(arg) {\n return intersection(this, arg);\n },\n transform(tx) {\n return pipe(this, transform(tx));\n },\n default(d) {\n return _default(this, d);\n },\n prefault(d) {\n return prefault(this, d);\n },\n catch(params) {\n return _catch(this, params);\n },\n pipe(target) {\n return pipe(this, target);\n },\n readonly() {\n return readonly(this);\n },\n describe(description) {\n const cl = this.clone();\n core.globalRegistry.add(cl, { description });\n return cl;\n },\n meta(...args) {\n // overloaded: meta() returns the registered metadata, meta(data) returns a clone with `data` registered. The mapped type picks up the second overload, so we accept variadic any-args and return `any` to satisfy both at runtime.\n if (args.length === 0)\n return core.globalRegistry.get(this);\n const cl = this.clone();\n core.globalRegistry.add(cl, args[0]);\n return cl;\n },\n isOptional() {\n return this.safeParse(undefined).success;\n },\n isNullable() {\n return this.safeParse(null).success;\n },\n apply(fn, ...args) {\n return args.length === 0 ? fn(this) : fn(this, ...args);\n },\n // Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.\n get \"~standard\"() {\n return util.hide(this, \"~standard\", {\n ...core.standardProps(this),\n jsonSchema: {\n input: createStandardJSONSchemaMethod(this, \"input\"),\n output: createStandardJSONSchemaMethod(this, \"output\"),\n },\n });\n },\n set \"~standard\"(value) {\n util.own(this, \"~standard\", value);\n },\n parse: function _parse(data, params) {\n return parse.parse(this, data, params, { callee: _parse });\n },\n parseAsync: async function _parseAsync(data, params) {\n return await parse.parseAsync(this, data, params, { callee: _parseAsync });\n },\n safeParse(data, params) {\n return parse.safeParse(this, data, params);\n },\n async safeParseAsync(data, params) {\n return parse.safeParseAsync(this, data, params);\n },\n // `spa` is an alias: same function object as `safeParseAsync`, as before.\n get spa() {\n return this?.safeParseAsync;\n },\n set spa(value) {\n util.own(this, \"spa\", value);\n },\n validate(data, params) {\n return parse.validate(this, data, params);\n },\n validateAsync(data, params) {\n return parse.validateAsync(this, data, params);\n },\n encode: function _encode(data, params) {\n return parse.encode(this, data, params, { callee: _encode });\n },\n decode: function _decode(data, params) {\n return parse.decode(this, data, params, { callee: _decode });\n },\n encodeAsync: async function _encodeAsync(data, params) {\n return await parse.encodeAsync(this, data, params, { callee: _encodeAsync });\n },\n decodeAsync: async function _decodeAsync(data, params) {\n return await parse.decodeAsync(this, data, params, { callee: _decodeAsync });\n },\n safeEncode(data, params) {\n return parse.safeEncode(this, data, params);\n },\n safeDecode(data, params) {\n return parse.safeDecode(this, data, params);\n },\n async safeEncodeAsync(data, params) {\n return parse.safeEncodeAsync(this, data, params);\n },\n async safeDecodeAsync(data, params) {\n return parse.safeDecodeAsync(this, data, params);\n },\n toJSONSchema(params) {\n return createToJSONSchemaMethod(this, {})(params);\n },\n // Reads through to the registry on every access, so it must not cache.\n get description() {\n return core.globalRegistry.get(this)?.description;\n },\n // No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.\n get _def() {\n return this._zod.def;\n },\n});\n/** @internal */\nexport const _ZodString = /*@__PURE__*/ core.$constructor(\"_ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);\n}, \n/*@__PURE__*/ util.derived({\n format: (inst) => processors.aggregateChecks(inst).format ?? null,\n minLength: (inst) => processors.aggregateChecks(inst).minimum ?? null,\n maxLength: (inst) => processors.aggregateChecks(inst).maximum ?? null,\n}, {\n regex(...args) {\n return this.check(checks.regex(...args));\n },\n includes(...args) {\n return this.check(checks.includes(...args));\n },\n startsWith(...args) {\n return this.check(checks.startsWith(...args));\n },\n endsWith(...args) {\n return this.check(checks.endsWith(...args));\n },\n min(...args) {\n return this.check(checks.minLength(...args));\n },\n max(...args) {\n return this.check(checks.maxLength(...args));\n },\n length(...args) {\n return this.check(checks.length(...args));\n },\n nonempty(...args) {\n return this.check(checks.minLength(1, ...args));\n },\n lowercase(params) {\n return this.check(checks.lowercase(params));\n },\n uppercase(params) {\n return this.check(checks.uppercase(params));\n },\n trim() {\n return this.check(checks.trim());\n },\n normalize(...args) {\n return this.check(checks.normalize(...args));\n },\n toLowerCase() {\n return this.check(checks.toLowerCase());\n },\n toUpperCase() {\n return this.check(checks.toUpperCase());\n },\n slugify() {\n return this.check(checks.slugify());\n },\n}));\nexport const ZodString = /*@__PURE__*/ core.$constructor(\"ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n _ZodString.init(inst, def);\n}, {\n email(params) {\n return this.check(core._email(ZodEmail, params));\n },\n url(params) {\n return this.check(core._url(ZodURL, params));\n },\n jwt(params) {\n return this.check(core._jwt(ZodJWT, params));\n },\n emoji(params) {\n return this.check(core._emoji(ZodEmoji, params));\n },\n guid(params) {\n return this.check(core._guid(ZodGUID, params));\n },\n uuid(params) {\n return this.check(core._uuid(ZodUUID, params));\n },\n uuidv4(params) {\n return this.check(core._uuidv4(ZodUUID, params));\n },\n uuidv6(params) {\n return this.check(core._uuidv6(ZodUUID, params));\n },\n uuidv7(params) {\n return this.check(core._uuidv7(ZodUUID, params));\n },\n nanoid(params) {\n return this.check(core._nanoid(ZodNanoID, params));\n },\n cuid(params) {\n return this.check(core._cuid(ZodCUID, params));\n },\n cuid2(params) {\n return this.check(core._cuid2(ZodCUID2, params));\n },\n ulid(params) {\n return this.check(core._ulid(ZodULID, params));\n },\n base64(params) {\n return this.check(core._base64(ZodBase64, params));\n },\n base64url(params) {\n return this.check(core._base64url(ZodBase64URL, params));\n },\n xid(params) {\n return this.check(core._xid(ZodXID, params));\n },\n ksuid(params) {\n return this.check(core._ksuid(ZodKSUID, params));\n },\n ipv4(params) {\n return this.check(core._ipv4(ZodIPv4, params));\n },\n ipv6(params) {\n return this.check(core._ipv6(ZodIPv6, params));\n },\n cidrv4(params) {\n return this.check(core._cidrv4(ZodCIDRv4, params));\n },\n cidrv6(params) {\n return this.check(core._cidrv6(ZodCIDRv6, params));\n },\n e164(params) {\n return this.check(core._e164(ZodE164, params));\n },\n datetime(params) {\n return this.check(core._isoDateTime(ZodISODateTime, params));\n },\n date(params) {\n return this.check(core._isoDate(ZodISODate, params));\n },\n time(params) {\n return this.check(core._isoTime(ZodISOTime, params));\n },\n duration(params) {\n return this.check(core._isoDuration(ZodISODuration, params));\n },\n});\nexport function string(params) {\n return core._string(ZodString, params);\n}\nexport const ZodStringFormat = /*@__PURE__*/ core.$constructor(\"ZodStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n _ZodString.init(inst, def);\n});\nexport const ZodISODateTime = /*@__PURE__*/ core.$constructor(\"ZodISODateTime\", (inst, def) => {\n core.$ZodISODateTime.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodISODate = /*@__PURE__*/ core.$constructor(\"ZodISODate\", (inst, def) => {\n core.$ZodISODate.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodISOTime = /*@__PURE__*/ core.$constructor(\"ZodISOTime\", (inst, def) => {\n core.$ZodISOTime.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodISODuration = /*@__PURE__*/ core.$constructor(\"ZodISODuration\", (inst, def) => {\n core.$ZodISODuration.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport const ZodEmail = /*@__PURE__*/ core.$constructor(\"ZodEmail\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmail.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function email(params) {\n return core._email(ZodEmail, params);\n}\nexport const ZodGUID = /*@__PURE__*/ core.$constructor(\"ZodGUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodGUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function guid(params) {\n return core._guid(ZodGUID, params);\n}\nexport const ZodUUID = /*@__PURE__*/ core.$constructor(\"ZodUUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodUUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function uuid(params) {\n return core._uuid(ZodUUID, params);\n}\nexport function uuidv4(params) {\n return core._uuidv4(ZodUUID, params);\n}\n// ZodUUIDv6\nexport function uuidv6(params) {\n return core._uuidv6(ZodUUID, params);\n}\n// ZodUUIDv7\nexport function uuidv7(params) {\n return core._uuidv7(ZodUUID, params);\n}\nexport const ZodURL = /*@__PURE__*/ core.$constructor(\"ZodURL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodURL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function url(params) {\n return core._url(ZodURL, params);\n}\nexport function httpUrl(params) {\n return core._url(ZodURL, {\n protocol: regexes.httpProtocol,\n hostname: regexes.domain,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEmoji = /*@__PURE__*/ core.$constructor(\"ZodEmoji\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmoji.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function emoji(params) {\n return core._emoji(ZodEmoji, params);\n}\nexport const ZodNanoID = /*@__PURE__*/ core.$constructor(\"ZodNanoID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodNanoID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function nanoid(params) {\n return core._nanoid(ZodNanoID, params);\n}\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link ZodCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const ZodCUID = /*@__PURE__*/ core.$constructor(\"ZodCUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\n/**\n * Validates a CUID v1 string.\n *\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport function cuid(params) {\n return core._cuid(ZodCUID, params);\n}\nexport const ZodCUID2 = /*@__PURE__*/ core.$constructor(\"ZodCUID2\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID2.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid2(params) {\n return core._cuid2(ZodCUID2, params);\n}\nexport const ZodULID = /*@__PURE__*/ core.$constructor(\"ZodULID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodULID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ulid(params) {\n return core._ulid(ZodULID, params);\n}\nexport const ZodXID = /*@__PURE__*/ core.$constructor(\"ZodXID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodXID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function xid(params) {\n return core._xid(ZodXID, params);\n}\nexport const ZodKSUID = /*@__PURE__*/ core.$constructor(\"ZodKSUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodKSUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ksuid(params) {\n return core._ksuid(ZodKSUID, params);\n}\nexport const ZodIPv4 = /*@__PURE__*/ core.$constructor(\"ZodIPv4\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv4(params) {\n return core._ipv4(ZodIPv4, params);\n}\nexport const ZodMAC = /*@__PURE__*/ core.$constructor(\"ZodMAC\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodMAC.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function mac(params) {\n return core._mac(ZodMAC, params);\n}\nexport const ZodIPv6 = /*@__PURE__*/ core.$constructor(\"ZodIPv6\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv6(params) {\n return core._ipv6(ZodIPv6, params);\n}\nexport const ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv4(params) {\n return core._cidrv4(ZodCIDRv4, params);\n}\nexport const ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv6(params) {\n return core._cidrv6(ZodCIDRv6, params);\n}\nexport const ZodBase64 = /*@__PURE__*/ core.$constructor(\"ZodBase64\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64(params) {\n return core._base64(ZodBase64, params);\n}\nexport const ZodBase64URL = /*@__PURE__*/ core.$constructor(\"ZodBase64URL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64URL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64url(params) {\n return core._base64url(ZodBase64URL, params);\n}\nexport const ZodE164 = /*@__PURE__*/ core.$constructor(\"ZodE164\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodE164.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function e164(params) {\n return core._e164(ZodE164, params);\n}\nexport const ZodCreditCard = /*@__PURE__*/ core.$constructor(\"ZodCreditCard\", (inst, def) => {\n core.$ZodCreditCard.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function creditCard(params) {\n return core._creditCard(ZodCreditCard, params);\n}\nexport const ZodIBAN = /*@__PURE__*/ core.$constructor(\"ZodIBAN\", (inst, def) => {\n core.$ZodIBAN.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function iban(params) {\n return core._iban(ZodIBAN, params);\n}\nexport const ZodJWT = /*@__PURE__*/ core.$constructor(\"ZodJWT\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodJWT.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function jwt(params) {\n return core._jwt(ZodJWT, params);\n}\nexport const ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodCustomStringFormat\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCustomStringFormat.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);\n}\nexport function hostname(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hostname\", regexes.hostname, _params);\n}\nexport function hex(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hex\", regexes.hex, _params);\n}\nexport function currencyCode(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"currency_code\", regexes.currencyCode, _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 if (!regex)\n throw new Error(`Unrecognized hash format: ${format}`);\n return core._stringFormat(ZodCustomStringFormat, format, regex, params);\n}\nexport const ZodNumber = /*@__PURE__*/ core.$constructor(\"ZodNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);\n inst.isFinite = true;\n}, \n/*@__PURE__*/ util.derived({\n minValue: (inst) => {\n const { minimum, exclusiveMinimum } = processors.aggregateChecks(inst);\n return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);\n },\n maxValue: (inst) => {\n const { maximum, exclusiveMaximum } = processors.aggregateChecks(inst);\n return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);\n },\n isInt: (inst) => {\n const { isInt, multipleOf } = processors.aggregateChecks(inst);\n return !!isInt || !!multipleOf?.some(Number.isSafeInteger);\n },\n format: (inst) => processors.aggregateChecks(inst).format ?? null,\n}, {\n gt(value, params) {\n return this.check(checks.gt(value, params));\n },\n gte(value, params) {\n return this.check(checks.gte(value, params));\n },\n min(value, params) {\n return this.check(checks.gte(value, params));\n },\n lt(value, params) {\n return this.check(checks.lt(value, params));\n },\n lte(value, params) {\n return this.check(checks.lte(value, params));\n },\n max(value, params) {\n return this.check(checks.lte(value, params));\n },\n int(params) {\n return this.check(int(params));\n },\n safe(params) {\n return this.check(int(params));\n },\n positive(params) {\n return this.check(checks.gt(0, params));\n },\n nonnegative(params) {\n return this.check(checks.gte(0, params));\n },\n negative(params) {\n return this.check(checks.lt(0, params));\n },\n nonpositive(params) {\n return this.check(checks.lte(0, params));\n },\n multipleOf(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n step(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n finite() {\n return this;\n },\n}));\nexport function number(params) {\n return core._number(ZodNumber, params);\n}\nexport const ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodNumber.init(inst, def);\n});\nexport function int(params) {\n return core._int(ZodNumberFormat, params);\n}\nexport function float32(params) {\n return core._float32(ZodNumberFormat, params);\n}\nexport function float64(params) {\n return core._float64(ZodNumberFormat, params);\n}\nexport function int32(params) {\n return core._int32(ZodNumberFormat, params);\n}\nexport function uint32(params) {\n return core._uint32(ZodNumberFormat, params);\n}\nexport const ZodBoolean = /*@__PURE__*/ core.$constructor(\"ZodBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.booleanProcessor(inst, ctx, json, params);\n});\nexport function boolean(params) {\n return core._boolean(ZodBoolean, params);\n}\nexport const ZodBigInt = /*@__PURE__*/ core.$constructor(\"ZodBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);\n}, \n/*@__PURE__*/ util.derived({\n minValue: (inst) => processors.aggregateChecks(inst).minimum ?? null,\n maxValue: (inst) => processors.aggregateChecks(inst).maximum ?? null,\n format: (inst) => processors.aggregateChecks(inst).format ?? null,\n}, {\n gte(value, params) {\n return this.check(checks.gte(value, params));\n },\n min(value, params) {\n return this.check(checks.gte(value, params));\n },\n gt(value, params) {\n return this.check(checks.gt(value, params));\n },\n lt(value, params) {\n return this.check(checks.lt(value, params));\n },\n lte(value, params) {\n return this.check(checks.lte(value, params));\n },\n max(value, params) {\n return this.check(checks.lte(value, params));\n },\n positive(params) {\n return this.check(checks.gt(BigInt(0), params));\n },\n negative(params) {\n return this.check(checks.lt(BigInt(0), params));\n },\n nonpositive(params) {\n return this.check(checks.lte(BigInt(0), params));\n },\n nonnegative(params) {\n return this.check(checks.gte(BigInt(0), params));\n },\n multipleOf(value, params) {\n return this.check(checks.multipleOf(value, params));\n },\n}));\nexport function bigint(params) {\n return core._bigint(ZodBigInt, params);\n}\nexport const ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodBigInt.init(inst, def);\n});\nexport function int64(params) {\n return core._int64(ZodBigIntFormat, params);\n}\nexport function uint64(params) {\n return core._uint64(ZodBigIntFormat, params);\n}\nexport const ZodSymbol = /*@__PURE__*/ core.$constructor(\"ZodSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.symbolProcessor(inst, ctx, json, params);\n});\nexport function symbol(params) {\n return core._symbol(ZodSymbol, params);\n}\nexport const ZodUndefined = /*@__PURE__*/ core.$constructor(\"ZodUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.undefinedProcessor(inst, ctx, json, params);\n});\nfunction _undefined(params) {\n return core._undefined(ZodUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodNull = /*@__PURE__*/ core.$constructor(\"ZodNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullProcessor(inst, ctx, json, params);\n});\nfunction _null(params) {\n return core._null(ZodNull, params);\n}\nexport { _null as null };\nexport const ZodAny = /*@__PURE__*/ core.$constructor(\"ZodAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.anyProcessor(inst, ctx, json, params);\n});\nexport function any() {\n return core._any(ZodAny);\n}\nexport const ZodUnknown = /*@__PURE__*/ core.$constructor(\"ZodUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unknownProcessor(inst, ctx, json, params);\n});\nexport function unknown() {\n return core._unknown(ZodUnknown);\n}\nexport const ZodNever = /*@__PURE__*/ core.$constructor(\"ZodNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.neverProcessor(inst, ctx, json, params);\n});\nexport function never(params) {\n return core._never(ZodNever, params);\n}\nexport const ZodVoid = /*@__PURE__*/ core.$constructor(\"ZodVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.voidProcessor(inst, ctx, json, params);\n});\nfunction _void(params) {\n return core._void(ZodVoid, params);\n}\nexport { _void as void };\nexport const ZodDate = /*@__PURE__*/ core.$constructor(\"ZodDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n}, \n/*@__PURE__*/ util.derived({\n minDate: (inst) => {\n const { minimum } = processors.aggregateChecks(inst);\n return minimum ? new Date(minimum) : null;\n },\n maxDate: (inst) => {\n const { maximum } = processors.aggregateChecks(inst);\n return maximum ? new Date(maximum) : null;\n },\n}, {}));\nexport function date(params) {\n return core._date(ZodDate, params);\n}\nexport const ZodArray = /*@__PURE__*/ core.$constructor(\"ZodArray\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodArray.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);\n inst.element = def.element;\n}, {\n min(n, params) {\n return this.check(checks.minLength(n, params));\n },\n nonempty(params) {\n return this.check(checks.minLength(1, params));\n },\n max(n, params) {\n return this.check(checks.maxLength(n, params));\n },\n length(n, params) {\n return this.check(checks.length(n, params));\n },\n unwrap() {\n return this.element;\n },\n});\nexport function array(element, params) {\n return core._array(ZodArray, element, params);\n}\n// .keyof\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return _enum(Object.keys(shape));\n}\nexport const ZodObject = /*@__PURE__*/ core.$constructor(\"ZodObject\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodObjectJIT.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);\n util.installLazyProp(inst, \"shape\", (self) => self._zod.def.shape, false);\n}, {\n keyof() {\n return _enum(Object.keys(this._zod.def.shape));\n },\n catchall(catchall) {\n // `mergeDefs` rather than a spread: spreading reads `shape`, and resolving it can mint a whole fresh subtree\n return this.clone(util.mergeDefs(this._zod.def, { catchall: catchall }));\n },\n passthrough() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));\n },\n loose() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));\n },\n strict() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: never() }));\n },\n strip() {\n return this.clone(util.mergeDefs(this._zod.def, { catchall: undefined }));\n },\n extend(incoming) {\n return util.extend(this, incoming);\n },\n safeExtend(incoming) {\n return util.safeExtend(this, incoming);\n },\n merge(other) {\n return util.merge(this, other);\n },\n pick(mask) {\n return util.pick(this, mask);\n },\n omit(mask) {\n return util.omit(this, mask);\n },\n partial(...args) {\n return util.partial(ZodOptional, this, args[0]);\n },\n exactPartial(...args) {\n return util.partial(ZodExactOptional, this, args[0], \"exactPartial\");\n },\n required(...args) {\n return util.required(ZodNonOptional, this, args[0]);\n },\n});\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n shape: shape ?? {},\n ...util.normalizeParams(params),\n };\n return new ZodObject(def);\n}\n// strictObject\nexport function strictObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\nexport function looseObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\nexport const ZodUnion = /*@__PURE__*/ core.$constructor(\"ZodUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\n});\nexport function union(options, params) {\n return new ZodUnion({\n type: \"union\",\n options: options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodXor = /*@__PURE__*/ core.$constructor(\"ZodXor\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodXor.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\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 ZodXor({\n type: \"union\",\n options: options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodDiscriminatedUnion\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodDiscriminatedUnion.init(inst, def);\n});\nexport function discriminatedUnion(discriminator, options, params) {\n // const [options, params] = args;\n return new ZodDiscriminatedUnion({\n type: \"union\",\n options: options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodIntersection = /*@__PURE__*/ core.$constructor(\"ZodIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.intersectionProcessor(inst, ctx, json, params);\n});\nexport function intersection(left, right) {\n return new ZodIntersection({\n type: \"intersection\",\n left: left,\n right: right,\n });\n}\nexport const ZodTuple = /*@__PURE__*/ core.$constructor(\"ZodTuple\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodTuple.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);\n}, {\n rest(rest) {\n return this.clone({\n ...this._zod.def,\n rest: rest,\n });\n },\n partial() {\n const def = this._zod.def;\n // a refinement was authored against the full arity; partialing would run it on a shorter array\n if (def.checks?.length)\n throw new Error(\".partial() cannot be used on tuple schemas containing refinements\");\n return this.clone({\n ...def,\n items: def.items.map((item) => new ZodOptional({ type: \"optional\", innerType: item })),\n });\n },\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 ZodTuple({\n type: \"tuple\",\n items: items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodRecord = /*@__PURE__*/ core.$constructor(\"ZodRecord\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodRecord.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n});\nexport function record(keyType, valueType, params) {\n // v3-compat: z.record(valueType, params?) — defaults keyType to z.string()\n if (!valueType || !valueType._zod) {\n return new ZodRecord({\n type: \"record\",\n keyType: string(),\n valueType: keyType,\n ...util.normalizeParams(valueType),\n });\n }\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\n// type alksjf = core.output<core.$ZodRecordKey>;\nexport function partialRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n partial: true,\n });\n}\nexport function looseRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n mode: \"loose\",\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMap = /*@__PURE__*/ core.$constructor(\"ZodMap\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodMap.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function map(keyType, valueType, params) {\n return new ZodMap({\n type: \"map\",\n keyType: keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSet = /*@__PURE__*/ core.$constructor(\"ZodSet\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodSet.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function set(valueType, params) {\n return new ZodSet({\n type: \"set\",\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEnum = /*@__PURE__*/ core.$constructor(\"ZodEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);\n inst.enum = def.entries;\n // reuse the parsed value set so a numeric TS enum's reverse-mapping keys stay out\n inst.options = [...inst._zod.values];\n const keys = new Set(Object.keys(def.entries));\n inst.extract = (values, params) => {\n const newEntries = {};\n for (const value of values) {\n if (keys.has(value)) {\n newEntries[value] = def.entries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n inst.exclude = (values, params) => {\n const newEntries = { ...def.entries };\n for (const value of values) {\n if (keys.has(value)) {\n delete newEntries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n});\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodEnum({\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 ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLiteral = /*@__PURE__*/ core.$constructor(\"ZodLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.literalProcessor(inst, ctx, json, params);\n inst.values = new Set(def.values);\n Object.defineProperty(inst, \"value\", {\n get() {\n if (def.values.length > 1) {\n throw new Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");\n }\n return def.values[0];\n },\n });\n});\nexport function literal(value, params) {\n return new ZodLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodFile = /*@__PURE__*/ core.$constructor(\"ZodFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.fileProcessor(inst, ctx, json, params);\n inst.min = (size, params) => inst.check(core._minSize(size, params));\n inst.max = (size, params) => inst.check(core._maxSize(size, params));\n inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));\n});\nexport function file(params) {\n return core._file(ZodFile, params);\n}\nexport const ZodTransform = /*@__PURE__*/ core.$constructor(\"ZodTransform\", (inst, def) => {\n _ensureDefaultMemoizer();\n core.$ZodTransform.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);\n inst._zod.parse = (payload, _ctx) => {\n if (_ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, 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 if (!(\"input\" in _issue))\n _issue.input = payload.value;\n _issue.inst ?? (_issue.inst = inst);\n // _issue.continue ??= true;\n payload.issues.push(util.issue(_issue));\n }\n };\n const output = def.transform(payload.value, payload);\n if (output instanceof Promise) {\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n payload.value = output;\n return payload;\n };\n});\nexport function transform(fn) {\n return new ZodTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodOptional = /*@__PURE__*/ core.$constructor(\"ZodOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function optional(innerType) {\n return new ZodOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodExactOptional = /*@__PURE__*/ core.$constructor(\"ZodExactOptional\", (inst, def) => {\n core.$ZodExactOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function exactOptional(innerType) {\n return new ZodExactOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodNullable = /*@__PURE__*/ core.$constructor(\"ZodNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullableProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nullable(innerType) {\n return new ZodNullable({\n type: \"nullable\",\n innerType: innerType,\n });\n}\n// nullish\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodDefault = /*@__PURE__*/ core.$constructor(\"ZodDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.defaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeDefault = inst.unwrap;\n});\nexport function _default(innerType, defaultValue) {\n return new ZodDefault({\n type: \"default\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodPrefault = /*@__PURE__*/ core.$constructor(\"ZodPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.prefaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function prefault(innerType, defaultValue) {\n return new ZodPrefault({\n type: \"prefault\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodNonOptional = /*@__PURE__*/ core.$constructor(\"ZodNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nonoptionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nonoptional(innerType, params) {\n return new ZodNonOptional({\n type: \"nonoptional\",\n innerType: innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSuccess = /*@__PURE__*/ core.$constructor(\"ZodSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.successProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function success(innerType) {\n return new ZodSuccess({\n type: \"success\",\n innerType: innerType,\n });\n}\nexport const ZodCatch = /*@__PURE__*/ core.$constructor(\"ZodCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.catchProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeCatch = inst.unwrap;\n});\nfunction _catch(innerType, catchValue) {\n return new ZodCatch({\n type: \"catch\",\n innerType: innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : core.util.constantCatch(catchValue)),\n });\n}\nexport { _catch as catch };\nexport const ZodNaN = /*@__PURE__*/ core.$constructor(\"ZodNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nanProcessor(inst, ctx, json, params);\n});\nexport function nan(params) {\n return core._nan(ZodNaN, params);\n}\nexport const ZodPipe = /*@__PURE__*/ core.$constructor(\"ZodPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.pipeProcessor(inst, ctx, json, params);\n inst.in = def.in;\n inst.out = def.out;\n});\nexport function pipe(in_, out) {\n return new ZodPipe({\n type: \"pipe\",\n in: in_,\n out: out,\n // ...util.normalizeParams(params),\n });\n}\nexport const ZodCodec = /*@__PURE__*/ core.$constructor(\"ZodCodec\", (inst, def) => {\n ZodPipe.init(inst, def);\n core.$ZodCodec.init(inst, def);\n});\nexport function codec(in_, out, params) {\n return new ZodCodec({\n type: \"pipe\",\n in: in_,\n out: out,\n transform: params.decode,\n reverseTransform: params.encode,\n });\n}\nexport function invertCodec(codec) {\n const def = codec._zod.def;\n return new ZodCodec({\n type: \"pipe\",\n in: def.out,\n out: def.in,\n transform: def.reverseTransform,\n reverseTransform: def.transform,\n });\n}\nexport const ZodPreprocess = /*@__PURE__*/ core.$constructor(\"ZodPreprocess\", (inst, def) => {\n ZodPipe.init(inst, def);\n core.$ZodPreprocess.init(inst, def);\n});\nexport const ZodReadonly = /*@__PURE__*/ core.$constructor(\"ZodReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.readonlyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function readonly(innerType) {\n return new ZodReadonly({\n type: \"readonly\",\n innerType: innerType,\n });\n}\nexport const ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.templateLiteralProcessor(inst, ctx, json, params);\n});\nexport function templateLiteral(parts, params) {\n return new ZodTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLazy = /*@__PURE__*/ core.$constructor(\"ZodLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.lazyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.getter();\n});\nexport function lazy(getter) {\n return new ZodLazy({\n type: \"lazy\",\n getter: getter,\n });\n}\nexport const ZodPromise = /*@__PURE__*/ core.$constructor(\"ZodPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.promiseProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function promise(innerType) {\n return new ZodPromise({\n type: \"promise\",\n innerType: innerType,\n });\n}\nexport const ZodFunction = /*@__PURE__*/ core.$constructor(\"ZodFunction\", (inst, def) => {\n core.$ZodFunction.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.functionProcessor(inst, ctx, json, params);\n});\nexport function _function(params) {\n return new ZodFunction({\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 };\nexport const ZodCustom = /*@__PURE__*/ core.$constructor(\"ZodCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);\n});\n// custom checks\nexport function check(fn) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n // ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\nexport function custom(fn, _params) {\n return core._custom(ZodCustom, fn ?? (() => true), _params);\n}\nexport function refine(fn, _params = {}) {\n return core._refine(ZodCustom, fn, _params);\n}\n// superRefine\nexport function superRefine(fn, params) {\n return core._superRefine(fn, params);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\nexport const ZodInstanceOf = /*@__PURE__*/ core.$constructor(\"ZodInstanceOf\", (inst, def) => {\n ZodCustom.init(inst, def);\n}, {\n properties(shape, params) {\n // asserts in place, so the narrowed output type is truthful without a wrapper\n return this.check(core._properties(shape, params));\n },\n});\nfunction _instanceof(cls, params = {}) {\n const inst = new ZodInstanceOf({\n type: \"custom\",\n check: \"custom\",\n fn: (data) => data instanceof cls,\n abort: true,\n ...util.normalizeParams(params),\n });\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: ZodCodec,\n Boolean: ZodBoolean,\n String: ZodString,\n}, ...args);\nexport function json(params) {\n const jsonSchema = lazy(() => {\n return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\n// preprocess\nexport function preprocess(fn, schema) {\n return new ZodPreprocess({\n type: \"pipe\",\n in: transform(fn),\n out: schema,\n });\n}\n","/** Browser-safe Skills wire shapes. Session IDs select authority; clients never send paths. */\nimport { z } from 'zod'\nexport const SKILLS_ENDPOINTS = ['skillsList', 'skillsPreview', 'skillsChanges'] as const\nexport type SkillsEndpoint = typeof SKILLS_ENDPOINTS[number]\nconst nameSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*:[a-z0-9]+(?:-[a-z0-9]+)*$/)\nexport const skillsRequestSchema = z.object({ sessionId: z.string().min(1), name: nameSchema.optional(), generation: z.number().int().nonnegative().optional() }).strict()\nconst status = { sessionId: z.string(), generation: z.number().int().nonnegative(), enabled: z.boolean() }\nexport const skillsStatusSchema = z.object(status)\nexport const skillsCatalogSchema = z.object({ ...status, skills: z.array(z.object({ name: nameSchema, description: z.string(), modelInvocable: z.boolean() })) })\nexport const skillsPreviewSchema = z.object({ ...status, name: nameSchema, content: z.string() })\nexport type SkillsStatusView = z.infer<typeof skillsStatusSchema>\nexport type SkillsCatalogView = z.infer<typeof skillsCatalogSchema>\nexport type SkillsPreviewView = z.infer<typeof skillsPreviewSchema>\nexport interface SkillsResponseMap { skillsList: SkillsCatalogView; skillsPreview: SkillsPreviewView; skillsChanges: SkillsStatusView }\n","/**\n * The wire contract between the browser panel and this plugin's host half.\n *\n * It is deliberately transport-agnostic plain data: the host registers one\n * Connection RPC channel (see `command.ts`) and the client bundle inlines this\n * module, so both sides agree on endpoint names and payload shapes without\n * sharing any runtime identity. Error codes are the stable half of the\n * contract; `message` is only a fallback the panel does not have to show.\n *\n * Two properties this module owns:\n *\n * - **One shape per endpoint.** {@link PanelResponseMap} is the single mapping\n * from endpoint to response type, so the panel cannot silently decode one\n * endpoint's answer as another's. `reveal` answers with\n * {@link RevealedView}; root-management endpoints answer with\n * {@link RootsView}.\n * The host builds those answers in `command.ts` and the\n * panel parses them here — one definition, two consumers.\n * - **Runtime validation at the boundary.** The payload arrives from a browser\n * and the answer arrives from the host; neither is trusted to match the\n * TypeScript types. {@link parsePanelCall} and the `parse*View` functions\n * check the shapes and report structural failures as a message, so a\n * mismatch becomes a visible, localized error instead of a crash or a\n * silently wrong render.\n *\n * Nothing here may import `node:*` or `@deepseek-ai/*`: this module is inlined\n * into the browser bundle.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/contract\n */\n\nimport { z } from 'zod'\nimport type { SkillsResponseMap } from './skills-contract.ts'\nexport { SKILLS_ENDPOINTS, skillsRequestSchema, skillsCatalogSchema, skillsPreviewSchema, skillsStatusSchema } from './skills-contract.ts'\nexport type { SkillsEndpoint, SkillsStatusView, SkillsCatalogView, SkillsPreviewView } from './skills-contract.ts'\nexport interface WorkspaceResponseMap extends PanelResponseMap, SkillsResponseMap {}\n\n/** The absolute logical channel both halves speak over. */\nexport const PANEL_CHANNEL = '/multi-root-workspace'\n\n/** Endpoint names, relative to {@link PANEL_CHANNEL}. */\nexport type PanelEndpoint = 'list' | 'add' | 'remove' | 'alias' | 'move' | 'setAccess' | 'setSkillsEnabled' | 'setAliasId' | 'reveal'\n\n/** Every endpoint name, for exhaustive iteration in tests and callers. */\nexport const PANEL_ENDPOINTS: readonly PanelEndpoint[] = ['list', 'add', 'remove', 'alias', 'move', 'setAccess', 'setSkillsEnabled', 'setAliasId', 'reveal']\n\n/**\n * How one registered root currently stands, as the panel renders it. Kept in\n * step with the root vocabulary in `src/roots.ts` deliberately: this module is\n * inlined into the browser bundle and must not pull in `node:*`, so the one\n * value the two sides share is spelled out rather than imported.\n */\nexport type RootState = 'available' | 'missing' | 'redirected' | 'invalid'\n\n/**\n * The write authority one registration carries (B9 three-state), spelled out\n * rather than imported: this module is inlined into the browser bundle and\n * must not pull in `node:*`, so the one value the two sides share is\n * duplicated here.\n */\nexport type RootAccess = 'inherit' | 'read-write' | 'read-only'\nexport type WorkspaceMode = 'read-only' | 'workspace-write' | 'danger-full-access'\nexport type EffectiveRootAccess = 'read-only' | 'read-write' | 'full-access' | 'unavailable'\n\n/** The shared nine-cell rule; tool dispatch may subsequently narrow writes. */\nexport function effectiveRootAccess(access: RootAccess, mode: WorkspaceMode): EffectiveRootAccess {\n if (access !== 'inherit') return access\n return mode === 'danger-full-access' ? 'full-access' : mode === 'workspace-write' ? 'read-write' : 'read-only'\n}\n\n/** One root as the panel renders it. */\nexport interface RootView {\n /** 1-based position in the returned snapshot. */\n readonly ordinal: number\n /** Stable identity, used by every mutating endpoint. */\n readonly id: string\n /** Canonical absolute directory. */\n readonly path: string\n /** Display alias as stored; absent when cleared. */\n readonly aliasId?: string\n readonly skillsEnabled?: boolean\n readonly alias?: string\n /** ISO-8601 registration instant. */\n readonly addedAt: string\n /** Whether the directory is writable right now, withheld, or unusable. */\n readonly state: RootState\n /** The write authority the registration carries. */\n readonly access: RootAccess\n /** Host-derived session permission, before any per-tool cap. */\n readonly effectiveAccess?: EffectiveRootAccess\n /** Why the root is not `available`; a code the panel localizes. */\n readonly detail?: string\n}\n\n/** Exact identity of one row in a returned list snapshot. */\nexport interface RootEntryView {\n readonly ordinal: number\n readonly id: string\n readonly path: string\n readonly addedAt: string\n}\n\n/** The panel's whole view, returned by root-management endpoints. */\nexport interface RootsView {\n /** The canonical workspace root these registrations belong to. */\n readonly primaryRoot: string\n /**\n * Display name of the primary root: the workspace's upstream title when the\n * host could resolve one; absent means the panel falls back to the path's\n * basename.\n */\n readonly primaryName?: string\n /** Execution directory only; never a registry key or an authorization grant. */\n readonly effectiveCwd?: string\n readonly mode?: WorkspaceMode\n readonly cappedTools?: readonly string[]\n readonly toolAccessInvalid?: boolean\n /** The additional roots, in registry order. */\n readonly roots: readonly RootView[]\n /** The host cap; MAX_SAFE_INTEGER means a legacy host reported no limit. */\n readonly limit: number\n /**\n * How many records are stored, in every state. `count > limit` is a\n * historical over-limit store: everything stays granted, only adds refuse.\n */\n readonly count: number\n /** Set when the store itself could not be read; the panel shows this verbatim. */\n readonly unavailable?: string\n}\n\n/** What `reveal` answers with: the directory the host asked the file manager to show. */\nexport interface RevealedView {\n /** Canonical path of the revealed root. */\n readonly revealed: string\n}\n\n/** The response type of every endpoint — the mapping the panel is typed against. */\nexport interface PanelResponseMap {\n readonly list: RootsView\n readonly add: RootsView\n readonly remove: RootsView\n readonly alias: RootsView\n readonly move: RootsView\n readonly setSkillsEnabled: RootsView\n readonly setAliasId: RootsView\n readonly setAccess: RootsView\n readonly reveal: RevealedView\n}\n\n/**\n * The fields a request may carry. `sessionId` is required on every endpoint:\n * the host derives the primary root from that session's immutable cwd and\n * never accepts a client-named path. The remaining fields are used per\n * endpoint and the host asserts which ones that endpoint requires.\n */\nexport interface PanelRequest {\n /** The live host session whose cwd is the primary root this call acts on. */\n readonly sessionId: string\n /** Exact target row from the most recent list snapshot. */\n readonly entry?: RootEntryView\n /** Compatibility reference; accepted only when the id is unique. */\n readonly id?: string\n /** Candidate directory (add). */\n readonly path?: string\n /** Display alias (add/alias); empty clears it. */\n readonly aliasId?: string\n readonly skillsEnabled?: boolean\n readonly alias?: string\n /** Write authority (add — defaults to `inherit` — and setAccess). */\n readonly access?: RootAccess\n /** Exact anchor row (move): the target is placed in front of it; absent moves it last. */\n readonly beforeEntry?: RootEntryView\n /** Compatibility anchor; accepted only when the id is unique. */\n readonly beforeId?: string\n}\n\n/** One validated call: the endpoint plus the request fields it may use. */\nexport interface PanelCall extends PanelRequest {\n /** The endpoint to call. */\n readonly endpoint: PanelEndpoint\n}\n\n/** A failure the panel renders by `code`. */\nexport interface PanelFailure {\n /** Stable code from the root vocabulary, or `panel/bad-request`. */\n readonly code: string\n /** Human-readable fallback text. */\n readonly message: string\n}\n\n/** One parse result: the value, or one sentence naming what was wrong. */\nexport type Parsed<T> = { readonly ok: true; readonly value: T } | { readonly ok: false; readonly message: string }\n\n/**\n * The request body on the wire. The endpoint travels as the RPC method, not as\n * a field, so this schema covers the fields only; the host pairs it with the\n * method the channel dispatched (and rejects the pair if the body contradicts\n * it). Unknown keys are rejected rather than ignored: a client sending a field\n * this host does not understand is out of contract, and silently dropping it\n * would hide the drift.\n */\nconst panelRequestSchema = z.object({\n sessionId: z.string().min(1),\n entry: z.object({\n ordinal: z.number().int().positive(),\n id: z.string(),\n path: z.string(),\n addedAt: z.string(),\n }).strict().optional(),\n id: z.string().optional(),\n path: z.string().optional(),\n aliasId: z.string().optional(),\n skillsEnabled: z.boolean().optional(),\n alias: z.string().optional(),\n access: z.enum(['inherit', 'read-write', 'read-only']).optional(),\n beforeEntry: z.object({\n ordinal: z.number().int().positive(),\n id: z.string(),\n path: z.string(),\n addedAt: z.string(),\n }).strict().optional(),\n beforeId: z.string().optional(),\n}).strict()\n\n/**\n * One root as it travels over the channel. Deliberately NOT strict, in both\n * directions: a newer host that adds a field must not brick an older panel, and\n * the field that matters is the state it reports.\n */\nconst rootViewSchema = z.object({\n ordinal: z.number().int().positive(),\n id: z.string(),\n path: z.string(),\n aliasId: z.string().optional(),\n skillsEnabled: z.boolean().optional(),\n alias: z.string().optional(),\n addedAt: z.string(),\n state: z.enum(['available', 'missing', 'redirected', 'invalid']),\n // Optional on the wire so an older host (which always meant session-following\n // read-write — `inherit` under B9) still parses; narrowed to the legacy\n // default in `narrowRootView`.\n access: z.enum(['inherit', 'read-write', 'read-only']).optional(),\n detail: z.string().optional(),\n effectiveAccess: z.enum(['read-only', 'read-write', 'full-access', 'unavailable']).optional(),\n})\n\nconst rootsViewSchema = z.object({\n primaryRoot: z.string(),\n primaryName: z.string().optional(),\n effectiveCwd: z.string().optional(),\n mode: z.enum(['read-only', 'workspace-write', 'danger-full-access']).optional(),\n cappedTools: z.array(z.string()).optional(),\n toolAccessInvalid: z.boolean().optional(),\n roots: z.array(rootViewSchema),\n // Pre-limit hosts omitted both fields. Absence is compatible; malformed\n // supplied values still fail validation.\n limit: z.number().int().nonnegative().optional(),\n count: z.number().int().nonnegative().optional(),\n unavailable: z.string().optional(),\n})\n\nconst revealedViewSchema = z.object({ revealed: z.string() })\n\nconst errorViewSchema = z.object({\n code: z.string(),\n message: z.string(),\n details: z.unknown().optional(),\n})\n\n/**\n * Validate the payload the host received for one endpoint.\n * @param endpoint - the endpoint the channel dispatched (the RPC method).\n * @param payload - the raw channel payload (the request body).\n * @returns the call the host may act on, or the reason it is not one.\n */\nexport function parsePanelCall(endpoint: string, payload: unknown): Parsed<PanelCall> {\n const known = (PANEL_ENDPOINTS as readonly string[]).includes(endpoint)\n if (!known) return { ok: false, message: `unknown endpoint \"${endpoint}\"` }\n const parsed = panelRequestSchema.safeParse(payload ?? {})\n if (!parsed.success) return { ok: false, message: `the request body is invalid: ${firstIssue(parsed.error)}` }\n return { ok: true, value: narrowCall(endpoint as PanelEndpoint, parsed.data) }\n}\n\n/**\n * Validate a `RootsView` when it arrives.\n * @param value - the raw endpoint value.\n * @returns the view, or the reason it is not one.\n */\nexport function parseRootsView(value: unknown): Parsed<RootsView> {\n const parsed = rootsViewSchema.safeParse(value)\n if (!parsed.success) return { ok: false, message: `the answer is not a roots view: ${firstIssue(parsed.error)}` }\n const view = parsed.data\n return {\n ok: true,\n value: {\n primaryRoot: view.primaryRoot,\n ...(view.primaryName === undefined ? {} : { primaryName: view.primaryName }),\n ...(view.effectiveCwd === undefined ? {} : { effectiveCwd: view.effectiveCwd }),\n ...(view.mode === undefined ? {} : { mode: view.mode }),\n ...(view.cappedTools === undefined ? {} : { cappedTools: view.cappedTools }),\n ...(view.toolAccessInvalid === undefined ? {} : { toolAccessInvalid: view.toolAccessInvalid }),\n roots: view.roots.map(narrowRootView),\n // Legacy hosts had no cap. Do not invent a client-side limit that\n // disables their Add controls; all stored states count equally.\n limit: view.limit ?? Number.MAX_SAFE_INTEGER,\n count: view.count ?? view.roots.length,\n ...(view.unavailable === undefined ? {} : { unavailable: view.unavailable }),\n },\n }\n}\n\n/**\n * Validate a `RevealedView` when it arrives.\n * @param value - the raw endpoint value.\n * @returns the view, or the reason it is not one.\n */\nexport function parseRevealedView(value: unknown): Parsed<RevealedView> {\n const parsed = revealedViewSchema.safeParse(value)\n if (!parsed.success) return { ok: false, message: `the answer is not a reveal result: ${firstIssue(parsed.error)}` }\n return { ok: true, value: parsed.data }\n}\n\n/**\n * Validate the `{ code, message }` envelope of a failed call.\n * @param value - the raw error value.\n * @returns the failure, or `undefined` when the value is not one.\n */\nexport function parseErrorView(value: unknown): PanelFailure | undefined {\n const parsed = errorViewSchema.safeParse(value)\n if (!parsed.success) return undefined\n return { code: parsed.data.code, message: parsed.data.message }\n}\n\n/**\n * Rebuild a parsed call as the declared type, keeping absent optional fields\n * ABSENT (`exactOptionalPropertyTypes` distinguishes \"absent\" from \"undefined\",\n * and the host's own code reads the two the same way the panel sent them).\n */\nfunction narrowCall(endpoint: PanelEndpoint, value: z.infer<typeof panelRequestSchema>): PanelCall {\n return {\n endpoint,\n sessionId: value.sessionId,\n ...(value.entry === undefined ? {} : { entry: value.entry }),\n ...(value.id === undefined ? {} : { id: value.id }),\n ...(value.path === undefined ? {} : { path: value.path }),\n ...(value.aliasId === undefined ? {} : { aliasId: value.aliasId }),\n ...(value.skillsEnabled === undefined ? {} : { skillsEnabled: value.skillsEnabled }),\n ...(value.alias === undefined ? {} : { alias: value.alias }),\n ...(value.access === undefined ? {} : { access: value.access }),\n ...(value.beforeEntry === undefined ? {} : { beforeEntry: value.beforeEntry }),\n ...(value.beforeId === undefined ? {} : { beforeId: value.beforeId }),\n }\n}\n\n/** Rebuild one parsed root as the declared `RootView`. */\nfunction narrowRootView(value: z.infer<typeof rootViewSchema>): RootView {\n return {\n ordinal: value.ordinal,\n id: value.id,\n path: value.path,\n addedAt: value.addedAt,\n state: value.state,\n // A host that predates the field only ever granted session-following\n // read-write — `inherit` under B9.\n access: value.access ?? 'inherit',\n ...(value.effectiveAccess === undefined ? {} : { effectiveAccess: value.effectiveAccess }),\n ...(value.aliasId === undefined ? {} : { aliasId: value.aliasId }),\n ...(value.skillsEnabled === undefined ? {} : { skillsEnabled: value.skillsEnabled }),\n ...(value.alias === undefined ? {} : { alias: value.alias }),\n ...(value.detail === undefined ? {} : { detail: value.detail }),\n }\n}\n\n/** Render the first zod issue as one short sentence. */\nfunction firstIssue(error: z.ZodError): string {\n const issue = error.issues[0]\n if (issue === undefined) return 'invalid'\n const path = issue.path.length === 0 ? '' : `${issue.path.join('.')}: `\n return `${path}${issue.message}`\n}\n","/**\n * The panel's bilingual copy.\n *\n * Flat `Record<string, string>` dictionaries keyed by a bare key (never\n * `ns.key`), `zh` as the canonical shape and `en` pinned to it by `satisfies`,\n * so a missing translation is a type error and a divergence is caught by\n * `tests/locale-parity.spec.ts` as well.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/locales\n */\n\n/** The locale namespace this plugin owns. */\nexport const NS = 'multiRootWorkspace'\n\n/** Chinese copy (the canonical shape). */\nexport const zh = {\n 'skills.globalEnable': '启用附属根 Skills',\n 'skills.globalHint': '控制所有附属目录的 Skill 发现与新调用;保留每个目录的独立选择。',\n 'skills.settingsFailed': '设置保存失败,请重试。',\n 'skills.userOnly': '仅用户调用',\n 'panel.skills': '目录技能',\n 'panel.skillsEnabled': '此目录技能已启用,点击停用',\n 'panel.skillsDisabled': '此目录技能已停用,点击启用',\n 'panel.aliasIdEdit': '编辑 Skill 命名空间',\n 'panel.aliasIdPlaceholder': '唯一的 kebab-case 标识',\n 'panel.aliasIdInvalid': '命名空间需要修复',\n 'error.invalid-alias-id': 'Skill 命名空间须为唯一的 kebab-case,最长 48 字符。',\n 'panel.accessEffective': '{access}({effective})',\n 'panel.toolCaps': '工具 {tools} 对附属根始终只读。',\n 'panel.invalidCap': '工具权限配置无效,附属根写入全部被拒绝。',\n 'effective.read-only': '只读',\n 'effective.read-write': '读写',\n 'effective.full-access': '完全权限(Full-access)',\n 'effective.unavailable': '不可用',\n 'action.label': '工作区目录',\n 'action.title': '管理本会话的附属工作目录',\n 'switcher.manage': '管理工作区目录…',\n 'panel.title': '工作区目录',\n 'panel.primary': '主要工作目录',\n 'panel.primaryNote': '会话原始项目,不可移除',\n 'panel.currentAgentCwd': '当前Agent工作目录',\n 'panel.additional': '附属工作目录',\n 'panel.limitReached': '已达到附加目录数量上限,请先移除一个再添加。',\n 'panel.empty': '还没有附属工作目录。',\n 'panel.emptyHint': '添加后,Agent 可在同一会话中读写该目录,受限 shell 和终端同步生效。',\n 'panel.noSession': '当前没有活动会话',\n 'panel.loading': '正在读取…',\n 'panel.retry': '重试',\n 'panel.close': '关闭',\n 'panel.add': '添加目录',\n 'panel.addManual': '输入绝对路径',\n 'panel.addConfirm': '添加',\n 'panel.remove': '移除',\n 'panel.removeConfirm': '确认移除',\n 'panel.more': '更多操作',\n 'panel.rename': '重命名',\n 'panel.aliasPlaceholder': '显示名(留空清除)',\n 'panel.aliasSave': '保存',\n 'panel.aliasCancel': '取消',\n 'panel.copyPath': '复制路径',\n 'panel.copied': '已复制',\n 'panel.reveal': '在文件管理器中显示',\n 'panel.reRegister': '重新登记(保留原访问级别)',\n 'panel.moveUp': '上移',\n 'panel.moveDown': '下移',\n 'access.inherit': '跟随会话',\n 'access.readWrite': '工作区内修改',\n 'access.readOnly': '仅可查看',\n 'panel.accessLabel': '访问权限',\n 'panel.accessInherit': '设为跟随会话',\n 'panel.accessReadOnly': '仅可查看',\n 'panel.accessReadWrite': '工作区内修改',\n 'panel.accessUpgradeConfirm': '将该目录的权限改为「{access}」?在某些沙箱模式下,这将允许 Agent 修改其中的文件。',\n 'panel.accessUpgradeTitle': '扩大访问权限',\n 'panel.accessUpgradeDo': '修改',\n 'state.available': '已授予',\n 'state.missing': '目录不存在,暂不授予',\n 'state.redirected': '登记目录已被替换(现在指向别处),暂不授予',\n 'state.invalid': '登记无效',\n 'error.not-absolute': '请给出绝对路径(或 ~/ 开头的路径)。',\n 'error.missing': '该目录不存在。',\n 'error.not-a-directory': '该路径不是目录。',\n 'error.equals-primary': '这就是本会话的工作目录,无需重复添加。',\n 'error.primary-overlap': '该目录与主工作目录互相包含,不会带来新的可写范围。',\n 'error.duplicate': '该目录已经登记过了。',\n 'error.nested': '该目录与已登记的根互相包含,不会带来新的可写范围。',\n 'error.invalid-alias': '别名不能包含控制字符,且不能过长。',\n 'error.not-found': '没有找到对应的登记项。',\n 'error.invalid-ref': '请求缺少必要的标识。',\n 'error.storage-unavailable': '根目录登记的存储不可用,请检查 $DSH_HOME/storages 下的文件。',\n 'error.registry-contended': '根目录登记正由另一个 DSH 进程占用;本进程不会授予附加根。关闭另一个进程后点重试。',\n 'error.root-limit-reached': '已达到附加目录数量上限,请先移除一个再添加。',\n 'error.config-invalid': '根目录登记的配置无效;本进程不会授予附加根,请修正配置后重启。',\n 'error.root-unavailable': '该目录当前不可用,只能设为只读;请先恢复目录再调整权限。',\n 'error.reveal-unavailable': '无法打开系统的文件管理器;登记项不受影响,路径仍可复制。',\n 'error.unavailable': '无法连接到 dsh 主进程。',\n 'error.copy-failed': '无法写入剪贴板,请检查浏览器的剪贴板权限。',\n 'error.session-not-found': '找不到该会话;请先打开一个工作区会话。',\n 'error.unsupported-path': '该路径是网络或设备路径,Windows ACL 隔离无法覆盖它。',\n 'error.fallback': '操作失败。',\n} satisfies Record<string, string>\n\n/** The canonical key set. */\nexport type Key = keyof typeof zh\n\n/** English copy, pinned to the Chinese key set. */\nexport const en = {\n 'skills.globalEnable': 'Enable additional-root Skills',\n 'skills.globalHint': 'Controls discovery and new invocations for all additional folders, preserving each folder’s choice.',\n 'skills.settingsFailed': 'Could not save settings. Please try again.',\n 'skills.userOnly': 'User invocation only',\n 'panel.skills': 'Folder skills',\n 'panel.skillsEnabled': 'Skills enabled for this folder. Click to disable.',\n 'panel.skillsDisabled': 'Skills disabled for this folder. Click to enable.',\n 'panel.aliasIdEdit': 'Edit Skill namespace',\n 'panel.aliasIdPlaceholder': 'Unique kebab-case identifier',\n 'panel.aliasIdInvalid': 'Namespace needs repair',\n 'error.invalid-alias-id': 'Skill namespace must be unique kebab-case, up to 48 characters.',\n 'panel.accessEffective': '{access} ({effective})',\n 'panel.toolCaps': 'The tools {tools} always have read-only access to additional roots.',\n 'panel.invalidCap': 'Invalid tool access configuration refuses all additional-root writes.',\n 'effective.read-only': 'Read-only',\n 'effective.read-write': 'Read-write',\n 'effective.full-access': 'Full-access',\n 'effective.unavailable': 'Unavailable',\n 'action.label': 'Folders',\n 'action.title': 'Manage this session\\'s secondary working directories',\n 'switcher.manage': 'Manage workspace folders…',\n 'panel.title': 'Workspace folders',\n 'panel.primary': 'Primary working directory',\n 'panel.primaryNote': 'The session\\'s original project; it cannot be removed',\n 'panel.currentAgentCwd': 'Current Agent working directory',\n 'panel.additional': 'Secondary working directories',\n 'panel.limitReached': 'The additional-folder limit is reached; remove one before adding another.',\n 'panel.empty': 'No secondary working directories yet.',\n 'panel.emptyHint': 'Once added, the agent can use the folder in this session, including confined shells and terminals.',\n 'panel.noSession': 'No active session',\n 'panel.loading': 'Loading…',\n 'panel.retry': 'Retry',\n 'panel.close': 'Close',\n 'panel.add': 'Add folder',\n 'panel.addManual': 'Enter an absolute path',\n 'panel.addConfirm': 'Add',\n 'panel.remove': 'Remove',\n 'panel.removeConfirm': 'Confirm removal',\n 'panel.more': 'More actions',\n 'panel.rename': 'Rename',\n 'panel.aliasPlaceholder': 'Display name (empty clears it)',\n 'panel.aliasSave': 'Save',\n 'panel.aliasCancel': 'Cancel',\n 'panel.copyPath': 'Copy path',\n 'panel.copied': 'Copied',\n 'panel.reveal': 'Reveal in file manager',\n 'panel.reRegister': 'Re-register (keeps its access level)',\n 'panel.moveUp': 'Move up',\n 'panel.moveDown': 'Move down',\n 'access.inherit': 'Inherit',\n 'access.readWrite': 'Workspace Write',\n 'access.readOnly': 'Read Only',\n 'panel.accessLabel': 'Access',\n 'panel.accessInherit': 'Make inherit',\n 'panel.accessReadOnly': 'Read Only',\n 'panel.accessReadWrite': 'Workspace Write',\n 'panel.accessUpgradeConfirm': 'Change this folder\\'s access to \"{access}\"? Under some sandbox modes this lets the agent modify files in it.',\n 'panel.accessUpgradeTitle': 'Widen access',\n 'panel.accessUpgradeDo': 'Change',\n 'state.available': 'Granted',\n 'state.missing': 'Directory is absent; not granted',\n 'state.redirected': 'Registration was replaced (it now points elsewhere); not granted',\n 'state.invalid': 'Registration is unusable',\n 'error.not-absolute': 'Give an absolute path (or one starting with ~/).',\n 'error.missing': 'That directory does not exist.',\n 'error.not-a-directory': 'That path is not a directory.',\n 'error.equals-primary': 'That is this session\\'s workspace root; it needs no registration.',\n 'error.primary-overlap': 'That directory and the primary working directory contain each other, so it grants nothing new.',\n 'error.duplicate': 'That directory is already registered.',\n 'error.nested': 'That directory and a registered root contain each other, so it grants nothing new.',\n 'error.invalid-alias': 'An alias may not contain control characters or be overly long.',\n 'error.not-found': 'No registration matches that reference.',\n 'error.invalid-ref': 'The request is missing a required identity.',\n 'error.storage-unavailable': 'The root registry store is unavailable; check the files under $DSH_HOME/storages.',\n 'error.registry-contended': 'The root registry is owned by another DSH process; this process grants no additional roots. Close the other process, then retry.',\n 'error.root-limit-reached': 'The additional-root limit is reached; remove one before adding another.',\n 'error.config-invalid': 'The root registry configuration is invalid; this process grants no additional roots. Fix the configuration and restart.',\n 'error.root-unavailable': 'That folder is not available right now and cannot be made writable; restore the directory first.',\n 'error.reveal-unavailable': 'Could not open the system file manager; the registration is untouched, and the path can still be copied.',\n 'error.unavailable': 'Could not reach the dsh host process.',\n 'error.copy-failed': 'Could not write to the clipboard; check the browser\\'s clipboard permission.',\n 'error.session-not-found': 'That session is not active; open a workspace session first.',\n 'error.unsupported-path': 'That is a network or device path, which Windows ACL confinement cannot cover.',\n 'error.fallback': 'The operation failed.',\n} satisfies Record<Key, string>\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** This plugin's panel copy. */\n multiRootWorkspace: Key\n }\n}\n","/**\n * The panel's own client for the Connection RPC channel.\n *\n * The browser half cannot use a Typert Remote namespace: contract generation\n * is workspace-shaped and the client assembly's contribution list belongs to\n * the shipped composition, so an out-of-tree plugin has no supported way to\n * mount one (see docs/decisions/ADR-0005 and the M3 plan). What IS public and\n * present in both supported runtimes is the generic Connection channel the\n * shipped sibling plugin already uses: the host registers\n * `connection.rpc.handle(PANEL_CHANNEL, …)` and this module calls it.\n *\n * The call is typed by {@link PanelResponseMap}: the endpoint decides the\n * request shape AND the response type, so a caller cannot decode one endpoint's\n * answer as another's. The response is additionally parsed at the boundary,\n * because the type is a promise about the host while the value on the wire is\n * whatever the host actually sent.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/panel-client\n */\n\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client'\nimport {\n PANEL_CHANNEL,\n parseErrorView,\n parseRevealedView,\n parseRootsView,\n type PanelEndpoint,\n type PanelRequest,\n type PanelResponseMap,\n} from '../contract.ts'\nimport { zh, type Key } from './locales.ts'\n\n/**\n * The Connection result shape this plugin consumes. Declared structurally\n * rather than imported: the host face of the same package would drag the\n * HOST context augmentations into the browser program, and a channel handler\n * is an ordinary `{ ok, value } | { ok, error }` envelope on the wire.\n */\ntype ChannelResult =\n | { readonly ok: true; readonly value: unknown }\n | { readonly ok: false; readonly error: unknown }\n\n/** A failure the panel renders from its `code`. */\nexport class PanelError extends Error {\n /**\n * @param code - stable code from the root vocabulary, or a transport code.\n * @param message - the host's fallback text.\n */\n constructor(readonly code: string, message: string) {\n super(message)\n this.name = 'PanelError'\n }\n}\n\n/**\n * The copy key for one failure code, with a safe fallback for codes this build\n * does not know (a newer host, or a transport failure).\n * @param code - the failure code.\n * @returns the locale key to render.\n */\nexport function errorKeyOf(code: string): Key {\n const candidate = `error.${code}`\n return (candidate in zh ? candidate : 'error.fallback') as Key\n}\n\n/** The panel's callable face, injected into its component. */\nexport interface PanelClient {\n /**\n * Call one endpoint.\n * @param endpoint - the endpoint name; it also selects the response type.\n * @param payload - the request fields for that endpoint (the endpoint name\n * travels as the RPC method, so it is not repeated in the payload).\n * @param signal - optional cancellation; aborting rejects the call.\n * @returns the host's value, in the shape the endpoint promises.\n * @throws {PanelError} when the host answered with a failure, or with a value\n * that is not what this endpoint promises.\n */\n call<E extends PanelEndpoint>(endpoint: E, payload: PanelRequest, signal?: AbortSignal): Promise<PanelResponseMap[E]>\n}\n\n/**\n * Build the panel client over a Connection handle.\n * @param connection - the client Connection service.\n * @returns the client, with every transport failure normalized to a `PanelError`.\n */\nexport function createPanelClient(connection: ConnectionHandle): PanelClient {\n return {\n async call(endpoint, payload, signal) {\n let result: ChannelResult\n try {\n result = await connection.rpc.call(PANEL_CHANNEL, endpoint, payload, signal) as ChannelResult\n } catch (error: unknown) {\n throw new PanelError('unavailable', error instanceof Error ? error.message : String(error))\n }\n if (!result.ok) {\n // The host reports failures as `{ code, message }`; a transport that\n // failed differently still has to reach the panel as a renderable code.\n const failure = parseErrorView(result.error)\n throw failure === undefined\n ? new PanelError('unavailable', 'the host answered with an unreadable failure')\n : new PanelError(failure.code, failure.message)\n }\n return expectShape(endpoint, result.value)\n },\n }\n}\n\n/**\n * Read the value one endpoint promised, narrowing it at the boundary so a host\n * that answered a different endpoint — or a shape from another version — cannot\n * crash the render.\n * @param endpoint - the endpoint that was called.\n * @param value - the raw endpoint value.\n * @returns the value as the endpoint's declared type.\n * @throws {PanelError} `panel/bad-response` when the value is not that shape.\n */\nfunction expectShape<E extends PanelEndpoint>(endpoint: E, value: unknown): PanelResponseMap[E] {\n const parsed = endpoint === 'reveal' ? parseRevealedView(value) : parseRootsView(value)\n if (!parsed.ok) throw new PanelError('panel/bad-response', parsed.message)\n return parsed.value as PanelResponseMap[E]\n}\n","/**\n * The plugin's one stylesheet, injected into the document by the client entry.\n *\n * The host ships its design tokens as CSS custom properties on `body`\n * (`--dsw-alias-*` semantics, `--dsw-elevation-*` shadows, `--ds-*` motion and\n * code-font tokens), so this sheet names no color of its own: light and dark\n * theme follow the host automatically. The recipes mirror the native surfaces\n * this UI sits beside — the sidebar footer trigger, the Modal primitive, and\n * the capsule Button (ADR-0006 records the decision).\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/styles\n */\n\n/** The stylesheet text; every class is prefixed `mrfw-` to stay collision-free. */\nexport const STYLES = /* css */ `\n/* Sidebar footer row, mirroring the host ui-settings-general trigger: the row\n * wrapper overhangs each side by 2px (width calc(100% + 4px) against the\n * shell's 12px inline padding) so the icon's ink line lands at 18px from the\n * column edge — exactly where the Settings gear below sits. */\n.mrfw-triggerRow {\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n width: calc(100% + 4px);\n margin: 4px -2px;\n}\n\n.mrfw-triggerRow.mrfw-railRow {\n width: 36px;\n margin: 8px 0 10px;\n}\n\n.mrfw-trigger {\n box-sizing: border-box;\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n width: auto;\n height: 42px;\n margin: 0;\n padding: 0 10px 0 8px;\n border: none;\n border-radius: 12px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n font-size: 14px;\n line-height: 22px;\n text-align: left;\n cursor: pointer;\n overflow: hidden;\n transition: background-color var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-trigger:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mrfw-triggerIcon {\n flex: none;\n display: inline-flex;\n}\n\n.mrfw-triggerLabel {\n overflow: hidden;\n white-space: nowrap;\n}\n\n.mrfw-triggerRail {\n flex: none;\n width: 36px;\n height: 36px;\n margin: 0;\n padding: 0;\n gap: 0;\n border-radius: 50%;\n justify-content: center;\n}\n\n/* Icon-only launcher inside the upstream Files tab header. Upstream's\n FilesBody renders .header as one flat flex row — PathLabel, then the\n reload button, then the files.actions slot occupants — and each of those\n children carries a stable data-files-* attribute on the flex item itself\n (data-files-root on the pane, data-files-path, data-files-reload).\n A registration order sorts only INSIDE the actions slot and can never\n overtake the reload button, so the launcher is moved with the flex order\n property instead: this wrapper is the slot's root element and therefore a\n direct flex item of .header, and order: -1 puts it ahead of every\n order-0 sibling while the :has() rule below keeps the path first. */\n.mrfw-fileLauncher {\n order: -1;\n flex: none;\n display: flex;\n align-items: center;\n}\n\n/* Pin the upstream path label ahead of the launcher — but only while this\n plugin is in the row: the :has() guard keeps a rule that names an\n upstream element inert whenever the launcher is absent. The\n :not([data-files-entry]) qualifier is load-bearing, not decorative:\n upstream puts data-files-path on EVERY tree row too (the row's own\n absolute path), so an unqualified selector would match the whole tree,\n not just the header's PathLabel. Both selectors depend on upstream's DOM\n shape, which is not part of the slot contract; if it changes, the rules\n simply stop matching and the launcher falls back to its in-slot position —\n a silent degradation, never a broken header. */\n[data-files-root]:has(.mrfw-fileLauncher) [data-files-path]:not([data-files-entry]) {\n order: -2;\n}\n\n/* The root switcher is the launcher's grown-up form on runtimes whose\n files.actions owner carries absolutePath. It takes the path label's flex\n position and stretch: order: -1 ahead of every order-0 sibling, and a\n growing min-width:0 item so both the trigger label and the PathLabel\n inside it can ellipsize instead of pushing the header controls out. */\n.mrfw-rootSwitcher {\n order: -1;\n flex: 1 1 auto;\n min-width: 0;\n display: flex;\n align-items: center;\n /* Same 4px the upstream .header puts between its own flex items, so the\n takeover controls (reload, open-in-app fork) sit at the same offsets the\n hidden native ones did — no drift between primary and additional state. */\n gap: 4px;\n}\n\n/* While the switcher exists it hides the upstream path label — the\n :has() guard again keeps the upstream-naming rule inert unless this\n plugin is actually in the row. The switcher draws its own PathLabel of\n the selected root next to the trigger (className mrfw-switcherPath, no\n data-files-* attributes), so the header keeps a path in the same spot.\n :not([data-files-entry]) is what confines this rule to the header:\n every tree row carries data-files-path with its own path as the value,\n and only the PathLabel carries it bare. Without the qualifier this\n display:none would blank the entire native tree. */\n[data-files-root]:has(.mrfw-rootSwitcher) [data-files-path]:not([data-files-entry]) {\n display: none;\n}\n\n/* While the switcher names an additional root, the native tree body and its\n reload hide: the reload refreshes the very tree that is no longer\n visible, and the plugin's forked tree is portaled in as the body's sibling.\n The header still offers a reload — the switcher's own .mrfw-switcherReload\n calls the forked face's refresh. The native tree keeps watching in the\n background, so switching back to the primary root restores it instantly. */\n[data-files-root]:has(.mrfw-rootSwitcher[data-root-kind=\"additional\"]) [data-files-body],\n[data-files-root]:has(.mrfw-rootSwitcher[data-root-kind=\"additional\"]) [data-files-reload] {\n display: none;\n}\n\n/* While the switcher names an additional root, the native open-in-app split\n button hides too: its slot props carry the pane's primary root, so it\n would always open the primary root no matter what the switcher selected.\n The header gets the plugin's own fork of that same control instead (the\n open-in-app directory), wired to the selected root.\n\n The slot's render site is wrapped in the renderer's own anchor —\n <div data-slot=\"sidebar.right.tab.files.actions\" style=\"display:contents\">\n — so the header's flex items inside it are the occupants themselves, and\n the native item is the ui-primitives Menu anchor span wrapping the marked\n .split. The first selector hides that occupant item through the data-slot\n anchor: hiding only the inner control would leave the empty anchor span\n as a zero-width flex item whose header gap pushes the fork 4px left of\n the native position. The wrapper itself can never be the target — its\n inline display:contents beats any stylesheet rule, and hiding it would\n take the switcher with it. The second selector is the fallback for an\n upstream that moves the attribute off the item. The fork survives both:\n the only data-open-target inside .mrfw-rootSwitcher is its own\n .mrfw-openSplit, which :not() excludes. */\n[data-files-root]:has(.mrfw-rootSwitcher[data-root-kind=\"additional\"]) [data-slot=\"sidebar.right.tab.files.actions\"] > *:has([data-open-target=\"directory\"]:not(.mrfw-openSplit)),\n[data-files-root]:has(.mrfw-rootSwitcher[data-root-kind=\"additional\"]) [data-open-target=\"directory\"]:not(.mrfw-openSplit) {\n display: none;\n}\n\n/* The trigger borrows the path label's look: quiet text with a folder\n glyph, the hover of the neighboring header buttons, and the overflow\n behavior PathLabel itself uses in a narrow header. It may shrink but\n never grows — the PathLabel after it owns the free header space. */\n.mrfw-rootSwitchBtn {\n flex: 0 1 auto;\n min-width: 0;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n margin: 0;\n padding: 0 4px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n font-size: inherit;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n transition: background-color var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-rootSwitchBtn:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mrfw-rootSwitchBtn .mrfw-triggerIcon {\n color: var(--dsw-alias-label-secondary);\n}\n\n.mrfw-rootSwitchLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mrfw-rootSwitchChevron {\n margin-left: auto;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* The selected root's full path sits between the trigger and the reload —\n the very PathLabel upstream draws there, so it brings its own grow,\n left-clip and hover-title behavior; only the gutters are ours. The right\n margin plus the container gap reproduces upstream's .path margin-right\n 12px + header gap 4px; the left gutter comes from the same container gap. */\n.mrfw-switcherPath {\n margin: 0 12px 0 0;\n}\n\n/* The takeover's own reload, standing exactly where the hidden native one\n did: the upstream .tool recipe verbatim (28px hit area, 15px glyph,\n secondary voice, hover fills). It calls the forked face's refresh — an\n in-place re-list, not a remount. */\n.mrfw-switcherReload {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 6px;\n border: none;\n border-radius: var(--dsw-radius-sm);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n line-height: 1;\n cursor: pointer;\n}\n\n.mrfw-switcherReload:hover {\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n/* ── files-tree fork (verbatim rules, renamed classes) ─────────────────────\n Copied from upstream's FilesBody.module.css (ui-sidebar-files @\n 0.2.2-alpha.2) with local names mapped to mrfw-ft* so the rules cannot\n collide with host DOM — and so the fork's own body (which must NOT carry\n data-files-body) stays visible while the rules above hide the native one.\n The header-only rules (root/header/path/tool/status/statusLine/titleIcon)\n belong to the upstream shell this fork drops and are not mapped. Fork sync\n re-diffs the upstream file and re-applies the rename — see\n src/client/files-tree/FORK.md. */\n\n/* The pane's own .root already supplies the flex column, color, and font;\n the fork's body takes the same stretch item the hidden native body held,\n including the workspace list's 2px scrollbar offset and stable gutter. */\n.mrfw-ftBody {\n flex: 1 1 auto;\n min-height: 0;\n margin-right: 2px;\n padding: 8px 0 8px 8px;\n overflow: auto;\n scrollbar-gutter: stable;\n}\n\n.mrfw-ftBody::-webkit-scrollbar-track {\n margin: 2px;\n}\n\n.mrfw-ftLevel {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.mrfw-ftLevel .mrfw-ftLevel {\n padding-left: 18px;\n}\n\n.mrfw-ftItem {\n margin: 0;\n padding: 0;\n}\n\n/* Rows abut, so the hover fill is the whole row; the tree's air is this\n inset, not a gap between rows. */\n.mrfw-ftRow {\n display: flex;\n gap: 6px;\n align-items: center;\n width: 100%;\n min-width: 0;\n padding: 5px 10px;\n color: inherit;\n font: inherit;\n text-align: left;\n background: transparent;\n border: 0;\n border-radius: var(--dsw-radius-md);\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .mrfw-ftRow:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n/* The folder glyph rides the tertiary ink, as the workspace tree's does. */\n.mrfw-ftIcon {\n flex: 0 0 auto;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* The type's coloured sheet at the folder glyph's 16px; its colour is its own. */\n.mrfw-ftFileIcon {\n flex: 0 0 auto;\n}\n\n.mrfw-ftName {\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n/* Neither a file nor a directory: shown so the directory is reported whole,\n greyed so nobody tries to open it. */\n.mrfw-ftOther {\n color: var(--dsw-alias-label-tertiary);\n cursor: default;\n}\n\n@media (hover: hover) {\n .mrfw-ftOther:hover {\n background: transparent;\n }\n}\n\n.mrfw-ftNote {\n margin: 0;\n padding: 3px 10px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n}\n\n/* ── open-in-app fork (verbatim rules, renamed classes) ───────────────────\n Copied from upstream's OpenTargetButton.module.css\n (dsh-client-ui-open-in-app @ 0.2.1-alpha.2) with local names mapped to\n mrfw-open* so the rules cannot collide with host DOM. Fork sync re-diffs\n the upstream file and re-applies the rename — see\n src/client/open-in-app/FORK.md. */\n\n/* Sized to sit in the document header's 24px control row beside its round\n icon buttons: a hairline pill with a 12px label and a narrow chevron half. */\n.mrfw-openMenuAnchor {\n display: inline-flex;\n flex: none;\n align-self: center;\n}\n\n.mrfw-openSplit {\n display: inline-flex;\n align-items: stretch;\n box-sizing: border-box;\n height: 24px;\n overflow: hidden;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-sm);\n font-family: var(--dsw-font-family);\n}\n\n.mrfw-openMain,\n.mrfw-openChevron {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: 0;\n background: none;\n color: var(--dsw-alias-label-primary);\n font-size: 11px;\n line-height: 16px;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.mrfw-openMain {\n gap: 4px;\n padding: 3px 5px;\n}\n\n.mrfw-openChevron {\n padding: 3px 4px 3px 3px;\n border-left: 0.5px solid var(--dsw-alias-border-l4);\n color: var(--dsw-alias-label-secondary);\n}\n\n.mrfw-openMain:hover:not(:disabled),\n.mrfw-openMain:focus-visible,\n.mrfw-openChevron:hover:not(:disabled),\n.mrfw-openChevron:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n/* Pending disables clicks without a restyle; only hover feedback pauses. */\n.mrfw-openMain:disabled,\n.mrfw-openChevron:disabled {\n cursor: default;\n}\n\n.mrfw-openAppIcon {\n object-fit: contain;\n}\n\n/* The unavailable preview emphasizes the same actions with a labeled button. */\n.mrfw-openSplit[data-size='large'] {\n height: 36px;\n border-radius: var(--dsw-radius-md);\n border-color: var(--dsw-alias-border-l2);\n}\n\n.mrfw-openSplit[data-size='large'] .mrfw-openMain {\n gap: 6px;\n padding: 6px 14px;\n font-size: 14px;\n}\n\n.mrfw-openSplit[data-size='large'] .mrfw-openChevron {\n padding: 6px 10px;\n}\n\n.mrfw-openSkeleton { display: inline-block; flex: none; border-radius: var(--dsw-radius-xs); background: var(--dsw-alias-interactive-bg-hover); }\n\n.mrfw-overlay {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n}\n\n.mrfw-mask {\n position: absolute;\n inset: 0;\n background: var(--dsw-alias-bg-mask-1);\n backdrop-filter: var(--dsw-mask-blur);\n}\n\n.mrfw-dialog {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n width: min(640px, 100%);\n max-height: 100%;\n overflow: hidden;\n border: none;\n border-radius: 24px;\n background: var(--dsw-alias-bg-layer-2);\n box-shadow: var(--dsw-elevation-prominent);\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n outline: none;\n}\n\n.mrfw-header {\n flex: none;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 22px 14px 12px 24px;\n}\n\n.mrfw-title {\n margin: 0;\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n\n.mrfw-close {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n border-radius: 8px;\n background: transparent;\n cursor: pointer;\n color: var(--dsw-alias-label-secondary);\n transition: background-color var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-close:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mrfw-body {\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow-y: auto;\n padding: 0 24px 24px;\n}\n\n.mrfw-alert {\n margin: 0 0 8px;\n font-size: 14px;\n line-height: 22px;\n color: var(--dsw-alias-state-error-primary);\n}\n\n.mrfw-section {\n display: flex;\n flex-direction: column;\n}\n\n.mrfw-section + .mrfw-section {\n margin-top: 8px;\n}\n\n.mrfw-sectionTitleRow {\n display: flex;\n align-items: baseline;\n gap: 8px;\n padding: 8px 0 4px;\n}\n\n.mrfw-sectionTitle {\n font-size: 14px;\n line-height: 22px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n\n.mrfw-sectionNote {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.mrfw-row {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n padding: 12px 0;\n border-bottom: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n.mrfw-rowBare {\n border-bottom: none;\n}\n\n/* A root entry's two lines: the display name on top, the absolute path under\n it in the tertiary voice (the workspace rows recipe of the host sidebar). */\n/* Match upstream General Settings' DeveloperToolsRow layout. */\n.mrfw-skillsSettings {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 24px;\n padding: 16px 0;\n border-bottom: 0.5px solid var(--dsw-alias-border-l2);\n}\n.mrfw-skillsSettingsText { min-width: 0; }\n.mrfw-skillsSettingsTitle { font-size: 14px; line-height: 20px; }\n.mrfw-skillsSettingsDescription {\n margin-top: 4px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n.mrfw-rootText {\n display: flex;\n flex: 1 1 240px;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n/* Keep status tags and permission glyphs visible beside the alias, wrapping\n onto another line when the dialog is narrow. */\n.mrfw-rootName {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 6px;\n min-width: 0;\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n\n.mrfw-rootNameText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mrfw-rootPath {\n font-family: var(--ds-font-family-code);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* The path doubles as the copy control: an unstyled button that keeps the\n text recipe and makes the whole string clickable — the whole region, not\n just the icon, copies on click. */\n.mrfw-pathCopy {\n display: block;\n width: 100%;\n padding: 0;\n border: 0;\n background: transparent;\n text-align: left;\n cursor: pointer;\n}\n\n/* The trailing icon stays in flow but invisible until the path is hovered\n or focused: appearing never re-wraps the text, and the icon inherits the\n path's own tertiary ink. */\n.mrfw-pathCopyIcon {\n display: inline-flex;\n margin-left: 4px;\n vertical-align: -2px;\n opacity: 0;\n transition: opacity var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-pathCopy:hover .mrfw-pathCopyIcon,\n.mrfw-pathCopy:focus-visible .mrfw-pathCopyIcon {\n opacity: 1;\n}\n\n.mrfw-note {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.mrfw-stateWarn {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.mrfw-btn {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n gap: 4px;\n height: 28px;\n padding: 0 10px;\n border: none;\n border-radius: 14px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n font-size: 12px;\n line-height: 18px;\n cursor: pointer;\n transition: background-color var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-btn[aria-busy='true'] {\n cursor: wait;\n}\n\n.mrfw-btn:disabled {\n cursor: not-allowed;\n opacity: 0.4;\n}\n\n.mrfw-btnGhost:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mrfw-btnGhost:active:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-active);\n}\n\n/* The solid destructive action of the capsule family: the upgrade confirm's\n red button. state-error-primary is the error ink upstream also uses as a\n fill (StateDot); the hover mixes in the host's primary label token to\n follow its theme and contrast choices. Neither color is a guessed token:\n an undefined var() would fall back\n to transparent and white-out the whole button. */\n.mrfw-btnDanger {\n background: var(--dsw-alias-state-error-primary);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.mrfw-btnDanger:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 85%, var(--dsw-alias-label-primary));\n}\n\n.mrfw-btnOutline {\n border: 0.5px solid var(--dsw-alias-border-l3);\n background: transparent;\n}\n\n.mrfw-btnOutline:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mrfw-btnPrimary {\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.mrfw-btnPrimary:hover:not(:disabled) {\n background: var(--dsw-alias-button-primary-hover);\n}\n\n/* One icon-only action: a square of the capsule family, meaning in title.\n Declared after the .mrfw-btn family so its padding wins the cascade tie:\n the capsule's 0 10px padding would otherwise squeeze the icon glyph. */\n.mrfw-iconBtn {\n width: 28px;\n padding: 0;\n border-radius: 8px;\n}\n\n.mrfw-input {\n flex: 1 1 220px;\n min-width: 0;\n height: 32px;\n padding: 0 8px;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n font-size: 14px;\n line-height: 22px;\n outline: none;\n transition: border-color var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n}\n\n.mrfw-input:focus {\n border-color: var(--dsw-alias-brand-primary);\n}\n\n.mrfw-input::placeholder {\n color: var(--dsw-alias-label-dimmed);\n}\n\n.mrfw-inputInline {\n flex: 1 1 auto;\n}\n\n.mrfw-accessSelect {\n flex: 0 0 auto;\n}\n\n/* The access dropdown's capsule trigger: the Menu anchor wrapper is the flex\n item, the button inside keeps the control row's 32px capsule recipe. */\n.mrfw-accessTrigger {\n padding: 0 12px;\n}\n\n.mrfw-cwdTag {\n flex: none;\n padding: 0 6px;\n border-radius: 4px;\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-secondary);\n font-size: 11px;\n line-height: 18px;\n}\n\n.mrfw-accessBadge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.mrfw-accessBadge {\n flex: none;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.mrfw-aliasEditor {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n flex-basis: 100%;\n}\n\n.mrfw-actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n margin-top: 16px;\n padding-top: 16px;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n/* One control row, one height: the capsule buttons match the 32px input. */\n.mrfw-actions .mrfw-btn {\n height: 32px;\n border-radius: 16px;\n}\n\n.mrfw-actions .mrfw-iconBtn {\n width: 32px;\n}\n`\n","/** Structural client seams: older hosts have namespace forms and no UserTextRule registry. */\nimport type { Context } from '@deepseek-ai/cordis'\nexport interface SkillsForm {\n getSnapshot(): { value?: { enabled?: boolean } | undefined; status: string; writable: boolean; revision?: number | undefined }\n subscribe(listener: () => void): () => void\n mutate(ops: readonly { op: 'set'; path: string[]; value: boolean }[], revision?: number): Promise<boolean>\n}\ninterface SettingsScope { bind(input: { namespace: string }): SkillsForm }\ninterface ConfigForms { get(entryId: string): SkillsForm }\n\nexport function bindSkillsForm(ctx: Context): SkillsForm | undefined {\n const modern = ctx.get('configForms' as never) as ConfigForms | undefined\n if (modern !== undefined) return modern.get('multi-root-skills')\n const legacy = ctx.get('settingsScope' as never) as SettingsScope | undefined\n return legacy?.bind({ namespace: 'multi-root-skills' })\n}\nexport function clientInject(ctx: Context, services: string[], callback: (scope: Context) => void | (() => void)): void {\n // Recording client fixtures may omit dynamic injection; real Cordis always supplies it.\n if (typeof ctx.inject === 'function') ctx.inject(services, callback)\n}\nexport interface NamespaceRule {\n id: string; order: number\n match(text: string, from: number): { id: string; start: number; end: number; data: { name: string } } | undefined\n}\nexport function registerNamespaceRule(ctx: Context, rule: NamespaceRule): (() => void) | undefined {\n const conversation = ctx.get('uiConversation' as never) as { userText?: { register(rule: NamespaceRule): () => void } } | undefined\n return typeof conversation?.userText?.register === 'function' ? conversation.userText.register(rule) : undefined\n}\n","/** Session-addressed Connection cache. Every refresh and change notification fences old replies. */\nimport { PANEL_CHANNEL } from '../contract.ts'\nimport { skillsCatalogSchema, skillsPreviewSchema, skillsStatusSchema, type SkillsCatalogView, type SkillsPreviewView } from '../skills-contract.ts'\ninterface Connection { rpc: { call(channel: string, endpoint: string, payload: unknown, signal?: AbortSignal): Promise<unknown> } }\ninterface State { pending?: Promise<SkillsCatalogView>; epoch: number; value?: SkillsCatalogView; request?: AbortController; watching?: AbortController; listeners: Set<() => void> }\nexport class SkillsClient {\n private readonly states = new Map<string, State>()\n private closed = false\n constructor(private readonly connection: Connection) {}\n private state(id: string): State {\n let state = this.states.get(id)\n if (state === undefined) { state = { epoch: 0, listeners: new Set() }; this.states.set(id, state) }\n return state\n }\n private async call(endpoint: string, payload: unknown, signal?: AbortSignal): Promise<unknown> {\n signal?.throwIfAborted()\n const result = await this.connection.rpc.call(PANEL_CHANNEL, endpoint, payload, signal) as { ok: boolean; value?: unknown; error?: { message?: string } }\n signal?.throwIfAborted()\n if (!result.ok) throw new Error(result.error?.message ?? 'Skills request failed')\n return result.value\n }\n async list(sessionId: string, signal?: AbortSignal): Promise<SkillsCatalogView> {\n if (this.closed) throw new Error('Skills client is closed')\n const state = this.state(sessionId)\n if (state.pending === undefined) {\n const epoch = ++state.epoch\n state.request?.abort(); const request = new AbortController(); state.request = request\n const pending = (async () => {\n const value = skillsCatalogSchema.parse(await this.call('skillsList', { sessionId }, request.signal))\n if (this.closed || value.sessionId !== sessionId || epoch !== state.epoch) throw new Error('Stale Skills response')\n const changed = JSON.stringify(state.value) !== JSON.stringify(value)\n state.value = value\n if (changed) for (const listener of state.listeners) listener()\n return value\n })()\n state.pending = pending\n void pending.then(() => { if (state.pending === pending) delete state.pending }, () => { if (state.pending === pending) delete state.pending })\n }\n return await withAbort(state.pending, signal)\n }\n\n snapshot(sessionId: string): SkillsCatalogView | undefined { return this.states.get(sessionId)?.value }\n async preview(sessionId: string, name: string, signal?: AbortSignal): Promise<SkillsPreviewView> {\n const state = this.state(sessionId), epoch = state.epoch\n const value = skillsPreviewSchema.parse(await this.call('skillsPreview', { sessionId, name }, signal))\n if (this.closed || epoch !== state.epoch || value.sessionId !== sessionId || value.name !== name) throw new Error('Stale Skills preview')\n return value\n }\n subscribe(sessionId: string, listener: () => void): () => void {\n const state = this.state(sessionId); state.listeners.add(listener)\n if (state.watching === undefined) {\n const lifetime = new AbortController(); state.watching = lifetime\n void this.watch(sessionId, state, lifetime.signal)\n }\n return () => {\n state.listeners.delete(listener)\n if (state.listeners.size === 0) { state.watching?.abort(); delete state.watching; state.request?.abort(); this.states.delete(sessionId) }\n }\n }\n private invalidate(state: State): void {\n state.epoch++; state.request?.abort(); delete state.pending; delete state.value\n for (const listener of state.listeners) listener()\n }\n reset(): void { for (const state of this.states.values()) this.invalidate(state) }\n dispose(): void {\n this.closed = true\n for (const state of this.states.values()) { this.invalidate(state); state.watching?.abort() }\n this.states.clear()\n }\n private async watch(id: string, state: State, signal: AbortSignal): Promise<void> {\n while (!signal.aborted && !this.closed) {\n try {\n const current = state.value ?? await this.list(id, signal)\n const next = skillsStatusSchema.parse(await this.call('skillsChanges', { sessionId: id, generation: current.generation }, signal))\n if (next.sessionId !== id) throw new Error('Wrong Skills Session')\n if (next.generation !== current.generation) this.invalidate(state)\n } catch {\n if (signal.aborted || this.closed) return\n this.invalidate(state)\n await new Promise<void>(resolve => {\n const finish = () => { clearTimeout(timer); signal.removeEventListener('abort', finish); resolve() }\n const timer = setTimeout(finish, 1000); signal.addEventListener('abort', finish, { once: true })\n })\n }\n }\n }\n}\n\nasync function withAbort<T>(promise: Promise<T>, signal?: AbortSignal): Promise<T> {\n signal?.throwIfAborted()\n if (signal === undefined) return await promise\n return await new Promise<T>((resolve, reject) => {\n const abort = () => reject(signal.reason)\n signal.addEventListener('abort', abort, { once: true })\n promise.then(value => { signal.removeEventListener('abort', abort); if (!signal.aborted) resolve(value) }, error => { signal.removeEventListener('abort', abort); reject(error) })\n })\n}\n","/** Namespaced Slash completion and plain-text sent-message references. */\nimport type { Context } from '@deepseek-ai/cordis'\nimport { clientInject, registerNamespaceRule, type NamespaceRule } from '../compat/skills-client.ts'\nimport { SkillsClient } from './skills-client.ts'\nimport type { Translate } from './WorkspaceFoldersAction.tsx'\n\ninterface Source {\n trigger: '/'; name: string; order: number\n candidates(session: { sessionId: string }, request: { query: string; signal: AbortSignal }): Promise<readonly { name: string; description: string }[]>\n onPick(pick: { candidate: { name: string } }): { text: string }\n lexicon(session: { sessionId: string }): readonly string[] | undefined\n subscribeLexicon(session: { sessionId: string }, listener: () => void): () => void\n}\nexport const namespaceSkillRule: NamespaceRule = {\n id: 'multi-root-skill', order: 19,\n match(text, from) {\n const regex = /(?<!\\S)\\/([a-z0-9]+(?:-[a-z0-9]+)*:[a-z0-9]+(?:-[a-z0-9]+)*)(?!\\S)/g\n regex.lastIndex = from\n const match = regex.exec(text)\n return match === null ? undefined : { id: 'multi-root-skill', start: match.index, end: match.index + match[0].length, data: { name: match[1]! } }\n },\n}\nexport function namespaceSource(client: SkillsClient, t: Translate): Source {\n return {\n trigger: '/', name: 'multi-root-skills', order: 3,\n async candidates({ sessionId }, { query, signal }) {\n try {\n const view = client.snapshot(sessionId) ?? await client.list(sessionId, signal)\n signal.throwIfAborted()\n return view.skills.filter(skill => skill.name.toLowerCase().includes(query.toLowerCase())).map(skill => ({ name: skill.name, description: skill.modelInvocable ? skill.description : `${t('skills.userOnly')} · ${skill.description}` }))\n } catch (error) { if (signal.aborted) return []; throw error }\n },\n onPick({ candidate }) { return { text: `/${candidate.name} ` } },\n lexicon({ sessionId }) { return client.snapshot(sessionId)?.skills.map(skill => skill.name) },\n subscribeLexicon({ sessionId }, listener) { return client.subscribe(sessionId, listener) },\n }\n}\n\nexport function installSkillsClient(ctx: Context, t: Translate, subscribeSession: (listener: () => void) => () => void): void {\n const connection = ctx.get('connection')\n if (connection === undefined) return\n const client = new SkillsClient(connection)\n ctx.effect(() => () => client.dispose())\n ctx.effect(() => subscribeSession(() => { client.reset() }))\n const source = namespaceSource(client, t)\n clientInject(ctx, ['inputTriggers'], scope => {\n const triggers = scope.get('inputTriggers' as never) as unknown as { registerSource(source: Source): () => void }\n return triggers.registerSource(source)\n })\n clientInject(ctx, ['uiConversation'], scope => {\n const stop = registerNamespaceRule(scope, namespaceSkillRule)\n if (stop === undefined) return\n const slots = scope.slots as unknown as { inject(name: string, callback: () => unknown): () => void; register(options: object, component: unknown): () => void }\n const stopRenderer = slots.inject('conversation.user.text.node', () => slots.register({\n name: 'conversation.user.text.node', key: namespaceSkillRule.id, priority: 100,\n }, ({ node }: { node: { data: { name: string } } }) => `/${node.data.name}`))\n return () => { stopRenderer(); stop() }\n })\n if (typeof ctx.on === 'function') (ctx.on as (...args: any[]) => unknown)('connection/reset', () => { client.reset() })\n}\n","import { useEffect, useRef, useState, useSyncExternalStore } from 'react'\nimport { Switch } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { Context } from '@deepseek-ai/cordis'\nimport { bindSkillsForm, clientInject, type SkillsForm } from '../compat/skills-client.ts'\nimport type { Translate } from './WorkspaceFoldersAction.tsx'\nconst BUNDLE_KEY = '@dsh-electron/dsh-plugin-multi-root-workspace'\ninterface CardProps { form: SkillsForm; t: Translate }\nexport function SkillsSettingsCard({ form, t }: CardProps) {\n const snapshot = useSyncExternalStore(listener => form.subscribe(listener), () => form.getSnapshot())\n const [busy, setBusy] = useState(false), [error, setError] = useState<string>()\n const mounted = useRef(true)\n useEffect(() => { mounted.current = true; return () => { mounted.current = false } }, [])\n return <div className=\"mrfw-skillsSettings\">\n <div className=\"mrfw-skillsSettingsText\">\n <div className=\"mrfw-skillsSettingsTitle\">{t('skills.globalEnable')}</div>\n <div className=\"mrfw-skillsSettingsDescription\">{t('skills.globalHint')}</div>\n {error ? <div role=\"alert\">{error}</div> : null}\n </div>\n <Switch label={t('skills.globalEnable')} checked={snapshot.value?.enabled ?? true} disabled={busy || snapshot.status !== 'ready' || !snapshot.writable}\n onChange={enabled => {\n setBusy(true); setError(undefined)\n void form.mutate([{ op: 'set', path: ['enabled'], value: enabled }], snapshot.revision).then(ok => { if (mounted.current && !ok) setError(t('skills.settingsFailed')) }).catch(() => { if (mounted.current) setError(t('skills.settingsFailed')) }).finally(() => { if (mounted.current) setBusy(false) })\n }} />\n </div>\n}\nexport function installSkillsSettingsCard(ctx: Context, t: Translate): void {\n // One coordinator prevents duplicate cards if a host temporarily exposes both shapes.\n let current: object | undefined\n let stop: (() => void) | undefined\n const candidates = new Map<Context, SkillsForm>()\n const update = () => {\n const chosen = [...candidates.entries()].sort(([a], [b]) => Number(b.get('configForms' as never) !== undefined) - Number(a.get('configForms' as never) !== undefined))[0]\n if (chosen?.[1] === current) return\n stop?.(); stop = undefined; current = chosen?.[1]\n if (!chosen) return\n const [scope, form] = chosen\n const slots = scope.slots as unknown as { inject(name: string, callback: () => unknown): () => void; register(options: object, component: unknown): () => void }\n const disposers = [\n slots.inject('settings.plugin.item', () => slots.register({ name: 'settings.plugin.item', key: 'multi-root-skills', inject: () => ({ form, t }) }, SkillsSettingsCard)),\n slots.inject('plugins.bundle.config', () => slots.register({ name: 'plugins.bundle.config', key: BUNDLE_KEY, inject: () => ({ form, t }) }, SkillsSettingsCard)),\n ]\n stop = () => { for (const dispose of disposers) dispose() }\n }\n for (const service of ['settingsScope', 'configForms']) clientInject(ctx, [service], scope => {\n const form = bindSkillsForm(scope)\n if (form === undefined) return\n candidates.set(scope, form); update()\n return () => { candidates.delete(scope); update() }\n })\n ctx.effect(() => () => { stop?.(); candidates.clear() })\n}\n","/**\n * Compatibility adapter for the product icons the panel renders.\n *\n * ```text\n * 0.1.5-rc.2 / 0.1.6 IconFolderClose16, IconChevronDownOutline14, … (pixel size in the name)\n * 0.1.7-alpha.1 through 0.2.0-rc.2 IconFolderCloseRegular, IconChevronDownOutlineRegular, … (weight in the name)\n * ```\n *\n * `0.1.7-alpha.1` kept `size` as a prop and split each glyph into a Regular\n * (1px) and a Medium (1.3px) weight. Upstream's own client surfaces use\n * Regular for these glyphs, so that is the name this probe prefers after the\n * pixel-sized one. The lookup is by export name, not by release string.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/compat/client-icons\n */\n\nimport type { ReactNode } from 'react'\nimport * as primitives from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { IconProps } from '@deepseek-ai/dsh-client-ui-primitives'\n\n/** One icon component, spelled the way both releases spell `IconProps`. */\nexport type PanelIcon = (props: IconProps) => ReactNode\n\n/** Exports addressed by name. A release carries one name from each pair. */\ntype IconModule = Readonly<Record<string, PanelIcon | undefined>>\n\n/**\n * The installed icon module, addressed by export name.\n *\n * Named imports cannot spell both releases: each name is absent from the\n * other release's declaration, so the compiler is told once, here.\n */\nconst installed = primitives as unknown as IconModule\n\n/**\n * Pick the first export name this release actually provides.\n * @param module - the icon module to read.\n * @param names - candidate export names, preferred first.\n * @returns the component.\n * @throws {Error} when none of the names is exported. That is a compatibility\n * break to adapt here, not a missing optional peer.\n */\nexport function selectIcon(module: IconModule, names: readonly string[]): PanelIcon {\n for (const name of names) {\n const found = module[name]\n if (found !== undefined) return found\n }\n throw new Error(\n 'multi-root workspace: @deepseek-ai/dsh-client-ui-primitives exports none of '\n + `${names.join(', ')}; the workspace-folders panel cannot render its icons. `\n + 'Adapt src/compat/client-icons.ts to the installed release.',\n )\n}\n\n/**\n * The same by-name probe for a decorative glyph a release may simply not\n * carry: absence degrades to no icon, not to a boot error. Required icons go\n * through `selectIcon` and fail loud; optional ones go through here.\n */\nexport function maybeIcon(names: readonly string[]): PanelIcon | undefined {\n for (const name of names) {\n const found = installed[name]\n if (found !== undefined) return found\n }\n return undefined\n}\n\n/**\n * The same by-name probe for a whole component a release may not carry:\n * `PathLabel` arrived in `0.1.7-alpha.1`, so pixel-era runtimes degrade to a\n * plain span where the header invites one. Absence degrades to no component,\n * not to a boot error.\n */\nexport function maybeComponent<T>(names: readonly string[]): T | undefined {\n return maybeIcon(names) as T | undefined\n}\n\n/** Resolved once, against the installed module. */\nfunction icon(pixelName: string, regularName: string): PanelIcon {\n return selectIcon(installed, [pixelName, regularName])\n}\n\nexport const IconChevronDown = icon('IconChevronDownOutline14', 'IconChevronDownOutlineRegular')\nexport const IconChevronUp = icon('IconChevronUpOutline14', 'IconChevronUpOutlineRegular')\nexport const IconCopy = icon('IconCopyOutline16', 'IconCopyOutlineRegular')\nexport const IconEdit = icon('IconEditOutline16', 'IconEditOutlineRegular')\nexport const IconEllipsis = icon('IconEllipsisOutline16', 'IconEllipsisOutlineRegular')\nexport const IconFolderClose = icon('IconFolderClose16', 'IconFolderCloseRegular')\nexport const IconFolderOpen = icon('IconFolderOpenOutline16', 'IconFolderOpenOutlineRegular')\nexport const IconPlus = icon('IconPlusOutline16', 'IconPlusOutlineRegular')\nexport const IconRefresh = icon('IconRefreshOutline16', 'IconRefreshOutlineRegular')\nexport const IconSettings = icon('IconSettingsOutline16', 'IconSettingsOutlineRegular')\nexport const IconTrash = icon('IconTrashOutline16', 'IconTrashOutlineRegular')\n\n// The permission glyphs exist only from 0.1.7-alpha.1 on; earlier releases\n// render the access picker's menu rows — and its trigger — without icons.\nexport const IconAccessReadWrite = maybeIcon(['PermissionIconWorkspaceWriteRegular', 'IconWorkspaceWriteRegular'])\nexport const IconAccessReadOnly = maybeIcon(['PermissionIconReadOnlyRegular', 'IconReadOnlyRegular'])\nexport const IconAccessInherit = maybeIcon(['IconWorkspaceTreeOutline16', 'IconWorkspaceTreeOutlineRegular'])\n","import { Context, Service } from \"@deepseek-ai/cordis\";\n//#region lib/types/remote-error.js\n/** The one Remote failure class shared by owners, the Gateway, and consumers. */\n/**\n* One Remote call failure: a real Error carrying its stable code and typed\n* details. Owners throw it at the failure point; the Host Gateway encodes it\n* onto the wire unchanged; the Client face rebuilds an instance for the\n* `RemoteResult` error branch, so `throw result.error` keeps throw semantics.\n* Discrimination is always by `code`, never by instanceof.\n*/\nvar RemoteError = class extends Error {\n\tcode;\n\tdetails;\n\t/** Structural marker: cross-realm/bundle identification never uses instanceof. */\n\tisDSHRemoteError = true;\n\t/**\n\t* @param code - stable failure code declared in {@link RemoteErrorDetailsMap}.\n\t* @param message - human diagnostic carried across the wire.\n\t* @param details - structured payload typed by the code.\n\t* @param options - standard Error options (`cause` survives in-process only).\n\t*/\n\tconstructor(code, message, details, options) {\n\t\tsuper(message, options);\n\t\tthis.code = code;\n\t\tthis.details = details;\n\t\tthis.name = \"RemoteError\";\n\t}\n};\n/**\n* Structurally identify a RemoteError thrown across module or realm copies of\n* this class. Mechanism-internal: the Gateway and test assertions use it;\n* business code receives typed failures and never needs it.\n* @param value - a caught value.\n* @returns the failure when the marker matches, otherwise undefined.\n*/\nfunction remoteErrorOf(value) {\n\tif (typeof value === \"object\" && value !== null && value.isDSHRemoteError === true && typeof value.code === \"string\") return value;\n}\n//#endregion\n//#region lib/types/owned-value.js\n/** Generic invocation-owned values returned by synchronous Client Context resolvers. */\n/** Shared identity across independently bundled Context providers and Gateway. */\nconst TYPERT_OWNED_VALUE = Symbol.for(\"dsh.typert.owned-value\");\n/**\n* Transfer cleanup ownership without adding another resource reference count.\n* @param value - resolved payload passed to the invocation.\n* @param release - non-throwing synchronous release, called at most once.\n* @returns an owned payload disposed after invocation and reply settlement.\n*/\nfunction typertOwnedValue(value, release) {\n\tlet active = true;\n\treturn {\n\t\t[TYPERT_OWNED_VALUE]: true,\n\t\tvalue,\n\t\t[Symbol.dispose]() {\n\t\t\tif (!active) return;\n\t\t\tactive = false;\n\t\t\trelease();\n\t\t}\n\t};\n}\n/**\n* Identify invocation-owned values using the shared marker.\n* @param value - borrowed or owned resolver result.\n* @returns whether the result carries invocation cleanup.\n*/\nfunction isTypertOwnedValue(value) {\n\treturn typeof value === \"object\" && value !== null && TYPERT_OWNED_VALUE in value && value[TYPERT_OWNED_VALUE] === true;\n}\n//#endregion\n//#region lib/types/json-value.js\n/**\n* Lossless JSON checks every Remote carrier shares: the Client handle before it\n* queues an uplink item, the Gateway at its wire and codec-less uplink\n* boundaries, and the in-process mock.\n*/\n/**\n* Test whether a value crosses JSON transport without coercion or omission.\n* @param value - candidate boundary value.\n* @returns whether the value is losslessly JSON-compatible.\n*/\nfunction isRemoteJsonValue(value) {\n\treturn visitJsonValue(value, /* @__PURE__ */ new Set());\n}\n/**\n* Test whether a value may travel as one uplink item: a lossless JSON value, or\n* a top-level `undefined`, which the wire carries as an `item` frame without\n* `value`. Nested `undefined`, `NaN`, and infinities stay rejected.\n* @param value - candidate uplink item.\n* @returns whether the item crosses every carrier unchanged.\n*/\nfunction isRemoteUplinkItem(value) {\n\treturn value === void 0 || isRemoteJsonValue(value);\n}\nfunction visitJsonValue(value, ancestors) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value) && !Object.is(value, -0);\n\tif (typeof value !== \"object\") return false;\n\tif (ancestors.has(value)) return false;\n\tancestors.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) {\n\t\t\tif (Object.getPrototypeOf(value) !== Array.prototype || Reflect.ownKeys(value).length !== value.length + 1) return false;\n\t\t\tfor (let index = 0; index < value.length; index++) if (!Object.hasOwn(value, index) || !visitJsonValue(value[index], ancestors)) return false;\n\t\t\treturn true;\n\t\t}\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\tif (prototype !== Object.prototype && prototype !== null) return false;\n\t\tfor (const key of Reflect.ownKeys(value)) {\n\t\t\tif (typeof key !== \"string\") return false;\n\t\t\tif (Object.getOwnPropertyDescriptor(value, key)?.enumerable !== true || !visitJsonValue(Reflect.get(value, key), ancestors)) return false;\n\t\t}\n\t\treturn true;\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n}\n//#endregion\n//#region lib/types/remote-info.js\n/** Lazy assembly of generated Remote definitions using caller-supplied Zod; no runtime imports. */\n/**\n* Retain one generated definition per endpoint without constructing parsers or projections.\n* The class instance builds its shared descriptor/method index on first access;\n* input schemas and JSON Schema projections are cached only when requested.\n* @param spec - compiler-produced method facts and Zod factories.\n* @param zod - the generated artifact's Zod runtime for named-input parsers.\n* @returns a lazy, mountable info instance with no registration or transport effects.\n*/\nfunction createTypertRemoteInfo(spec, zod) {\n\treturn new RemoteInfo(spec, zod);\n}\nvar RemoteInfo = class {\n\tspec;\n\tzod;\n\tindex;\n\tconstructor(spec, zod) {\n\t\tthis.spec = spec;\n\t\tthis.zod = zod;\n\t}\n\tget package() {\n\t\treturn this.spec.package;\n\t}\n\tget descriptors() {\n\t\treturn this.resolve().descriptors;\n\t}\n\tget methods() {\n\t\treturn this.resolve().methods;\n\t}\n\tresolve() {\n\t\tif (this.index !== void 0) return this.index;\n\t\tconst zod = this.zod;\n\t\tconst descriptors = [];\n\t\tconst methods = Object.create(null);\n\t\tfor (const [endpoint, definition] of Object.entries(this.spec.methods)) {\n\t\t\tconst separator = endpoint.indexOf(\"/\");\n\t\t\tconst namespace = endpoint.slice(0, separator);\n\t\t\tconst method = endpoint.slice(separator + 1);\n\t\t\tconst parameters = definition.parameters.map((parameter) => ({\n\t\t\t\t...parameter,\n\t\t\t\twire: parameter.wire ?? parameter.name\n\t\t\t}));\n\t\t\tconst descriptor = {\n\t\t\t\t...definition,\n\t\t\t\tid: `${this.spec.package}#${endpoint}`,\n\t\t\t\tnamespace,\n\t\t\t\tmethod,\n\t\t\t\tparameters,\n\t\t\t\tresult: definition.result.description === void 0 ? definition.result : new ResultValue(definition.result)\n\t\t\t};\n\t\t\tif (definition.invocation.kind === \"direct\") {\n\t\t\t\tconst inputs = [];\n\t\t\t\tmethods[endpoint] = Object.assign(descriptor, {\n\t\t\t\t\tinput(options) {\n\t\t\t\t\t\tconst strict = options?.strict === true;\n\t\t\t\t\t\treturn inputs[strict ? 1 : 0] ??= new NamedInput(parameters, strict, zod);\n\t\t\t\t\t},\n\t\t\t\t\tinvoke(remote, input, signal) {\n\t\t\t\t\t\tconst named = input;\n\t\t\t\t\t\tconst values = parameters.map((parameter) => named[parameter.wire]);\n\t\t\t\t\t\tif (definition.cancellation !== void 0) values.push(signal);\n\t\t\t\t\t\tconst receiver = Reflect.get(remote, namespace);\n\t\t\t\t\t\treturn Reflect.get(receiver, method).apply(receiver, values);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tdescriptors.push(descriptor);\n\t\t}\n\t\treturn this.index = {\n\t\t\tdescriptors,\n\t\t\tmethods\n\t\t};\n\t}\n};\n/**\n* Narrow a Registry descriptor to its generated direct-method capabilities.\n* @param descriptor - a live descriptor, including possible source fallback or Context-only receivers.\n* @returns whether generated named input and direct invocation are available.\n*/\nfunction isTypertRemoteMethod(descriptor) {\n\treturn descriptor.invocation.kind === \"direct\" && descriptor.result.mode === \"strict\" && \"input\" in descriptor && typeof descriptor.input === \"function\" && \"invoke\" in descriptor && typeof descriptor.invoke === \"function\";\n}\nfunction optional(parameter) {\n\treturn parameter.source === \"json\" && parameter.acceptsUndefined === true;\n}\nvar NamedInput = class {\n\tparameters;\n\tstrict;\n\tzod;\n\tschema;\n\tprojection;\n\tconstructor(parameters, strict, zod) {\n\t\tthis.parameters = parameters;\n\t\tthis.strict = strict;\n\t\tthis.zod = zod;\n\t}\n\tcodec(parameter) {\n\t\treturn this.strict ? parameter.strictCodec : parameter.codec;\n\t}\n\tcreate = () => this.schema ??= this.zod.strictObject(Object.fromEntries(this.parameters.map((parameter) => {\n\t\tconst value = this.codec(parameter).create();\n\t\treturn [parameter.wire, optional(parameter) ? value.optional() : value.nonoptional()];\n\t})));\n\tget jsonSchema() {\n\t\treturn this.project().jsonSchema;\n\t}\n\tget jsonSchemaError() {\n\t\treturn this.project().jsonSchemaError;\n\t}\n\tproject() {\n\t\tif (this.projection !== void 0) return this.projection;\n\t\tconst unavailable = this.parameters.find((parameter) => this.codec(parameter).jsonSchema === void 0);\n\t\tif (unavailable !== void 0) return this.projection = { jsonSchemaError: this.codec(unavailable).jsonSchemaError ?? `No JSON Schema for parameter ${unavailable.wire}` };\n\t\treturn this.projection = { jsonSchema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: Object.fromEntries(this.parameters.map((parameter) => [parameter.wire, {\n\t\t\t\t...this.codec(parameter).jsonSchema,\n\t\t\t\t...parameter.description === void 0 ? {} : { description: parameter.description }\n\t\t\t}])),\n\t\t\trequired: this.parameters.filter((parameter) => !optional(parameter)).map((parameter) => parameter.wire),\n\t\t\tadditionalProperties: false\n\t\t} };\n\t}\n};\nvar ResultValue = class {\n\tspec;\n\tprojection;\n\tconstructor(spec) {\n\t\tthis.spec = spec;\n\t}\n\tget mode() {\n\t\treturn this.spec.mode;\n\t}\n\tget typeSymbol() {\n\t\treturn this.spec.typeSymbol;\n\t}\n\tget create() {\n\t\treturn this.spec.create;\n\t}\n\tget decode() {\n\t\treturn this.spec.decode;\n\t}\n\tget encode() {\n\t\treturn this.spec.encode;\n\t}\n\tget description() {\n\t\treturn this.spec.description;\n\t}\n\tget jsonSchemaError() {\n\t\treturn this.spec.jsonSchemaError;\n\t}\n\tget jsonSchema() {\n\t\tif (this.projection === void 0) {\n\t\t\tconst schema = this.spec.jsonSchema;\n\t\t\tthis.projection = { value: schema === void 0 ? void 0 : {\n\t\t\t\t...schema,\n\t\t\t\tdescription: this.spec.description\n\t\t\t} };\n\t\t}\n\t\treturn this.projection.value;\n\t}\n};\n//#endregion\n//#region lib/types/principal.js\n/**\n* Reads the non-owner caller of the current Remote call.\n* @module @deepseek-ai/dsh-typert-protocol/principal\n*/\n/**\n* The identity a Remote-call producer records on durable output.\n* @param invocation - `ctx.invocation`; `undefined` outside a Remote call.\n* @returns the caller's principal when it is not the owner; `undefined` for the\n* owner and for trusted in-process code outside a Remote call.\n*/\nfunction principalOf(invocation) {\n\tconst principal = invocation?.peer.principal;\n\treturn principal?.kind === \"owner\" ? void 0 : principal;\n}\n//#endregion\n//#region lib/types/index.js\n/**\n* Remote decorators and explicit Gateway bindings backed by versioned\n* descriptors carried on decorated class prototypes. Strict reflection\n* remains a Typert compiler responsibility.\n* @module @deepseek-ai/dsh-typert-protocol\n*/\nconst TYPERT_REMOTE_SEGMENT_PATTERN = /^[A-Za-z0-9_$.-]+$/;\n/**\n* Test one generated Remote name against the Connection endpoint grammar.\n* @param value - namespace, method, lookup, or Context segment.\n* @returns whether the value can cross the shared RPC carrier unchanged.\n*/\nfunction isTypertRemoteSegment(value) {\n\treturn value !== \".\" && value !== \"..\" && TYPERT_REMOTE_SEGMENT_PATTERN.test(value);\n}\nconst REMOTE_METHOD_DESCRIPTOR = \"@deepseek-ai/dsh-typert-protocol/remote-methods\";\n/**\n* Bind one visible Service field to a Cordis key and Remote namespace. A\n* service that owns a Cordis Context also gives its tree `ctx.invocation`,\n* `undefined` outside a Remote call, so no `TypertRemoteService` is needed for\n* a Host composition to read it.\n* @param service - owning Service instance, normally `this`.\n* @param serviceKey - exact Cordis service key.\n* @param options - optional wire namespace.\n* @returns a frozen, inspectable binding with no compiler-injected metadata.\n*/\nfunction bindTypertRemote(service, serviceKey, options = {}) {\n\tvalidateName(\"service key\", serviceKey);\n\tconst namespace = options.namespace ?? serviceKey;\n\tvalidateName(\"namespace\", namespace);\n\tconst ctx = Reflect.get(service, \"ctx\");\n\tif (Context.is(ctx)) provideInvocationAccessor(ctx);\n\treturn Object.freeze({\n\t\tservice,\n\t\tserviceKey,\n\t\tnamespace\n\t});\n}\n/** Cordis Service base that exposes its registered name through Typert Gateway. */\nvar TypertRemoteService = class extends Service {\n\t/** Visible binding consumed by the Gateway's source-mode discovery. */\n\ttypertRemote;\n\t/**\n\t* Register the Service and bind the same key to Typert Gateway.\n\t* @param ctx - owning Cordis Context.\n\t* @param serviceKey - exact Cordis service key and default wire namespace.\n\t* @param options - optional wire namespace.\n\t*/\n\tconstructor(ctx, serviceKey, options = {}) {\n\t\tsuper(ctx, serviceKey);\n\t\tthis.typertRemote = bindTypertRemote(this, this.name, options);\n\t}\n};\n/**\n* Make `ctx.invocation` read as `undefined` outside a Remote call instead of the\n* reflect service's \"cannot get property\" error; a call-derived Context shadows\n* the accessor with its own property. The first Remote Service constructed in a\n* tree registers it on the root, where it outlives any one Service.\n*/\nfunction provideInvocationAccessor(ctx) {\n\tif (Object.hasOwn(ctx.root.reflect.props, \"invocation\")) return;\n\tctx.root.accessor(\"invocation\", { get: () => void 0 });\n}\nfunction Remote(methodExportOrOptions, context) {\n\tif (typeof methodExportOrOptions === \"string\") {\n\t\tvalidateName(\"Remote export name\", methodExportOrOptions);\n\t\treturn remoteDecorator({ kind: \"direct\" }, { exportName: methodExportOrOptions });\n\t}\n\tif (typeof methodExportOrOptions === \"object\") return remoteDecorator({ kind: \"direct\" }, markerOptions(methodExportOrOptions, REMOTE_OPTION_KEYS, \"Remote options require name, mode: \\\"stream\\\", or resources\"));\n\tif (context === void 0) throw new TypeError(\"typert-protocol: Remote decorator context is missing\");\n\taddMarkerInitializer(context, { kind: \"direct\" });\n}\nconst REMOTE_OPTION_KEYS = new Set([\n\t\"name\",\n\t\"mode\",\n\t\"resources\"\n]);\nconst REMOTE_SCOPE_OPTION_KEYS = new Set([\"name\", \"resources\"]);\n/** Validate one decorator options object against its accepted keys and select the marker fields. */\nfunction markerOptions(options, accepted, requirement) {\n\tconst keys = Reflect.ownKeys(options);\n\tif (keys.length === 0 || keys.some((key) => typeof key !== \"string\" || !accepted.has(key)) || Object.hasOwn(options, \"mode\") && options.mode !== \"stream\") throw new TypeError(`typert-protocol: ${requirement}`);\n\tconst { mode, name, resources } = options;\n\tif (name !== void 0) validateName(\"Remote export name\", name);\n\treturn {\n\t\t...mode === void 0 ? {} : { mode },\n\t\t...name === void 0 ? {} : { exportName: name },\n\t\t...resources === void 0 ? {} : { resources: resourceReaders(resources) }\n\t};\n}\n/** Freeze declared readers into the marker record; a misdeclared reader fails at decoration. */\nfunction resourceReaders(resources) {\n\tconst readers = {};\n\tfor (const [kind, reader] of Object.entries(resources)) {\n\t\tif (typeof reader !== \"function\") throw new TypeError(`typert-protocol: Remote resource reader \"${kind}\" must be a function`);\n\t\treaders[kind] = reader;\n\t}\n\tif (Object.keys(readers).length === 0) throw new TypeError(\"typert-protocol: Remote resources require at least one reader\");\n\treturn Object.freeze(readers);\n}\nfunction remoteDecorator(invocation, options = {}) {\n\treturn function(_method, context) {\n\t\taddMarkerInitializer(context, invocation, options);\n\t};\n}\nfunction RemoteScope(key, option) {\n\tvalidateName(\"Scope key\", key);\n\tconst invocation = {\n\t\tkind: \"context\",\n\t\tcontext: key\n\t};\n\tif (option === void 0) return remoteDecorator(invocation);\n\tif (typeof option === \"string\") {\n\t\tvalidateName(\"Remote export name\", option);\n\t\treturn remoteDecorator(invocation, { exportName: option });\n\t}\n\treturn remoteDecorator(invocation, markerOptions(option, REMOTE_SCOPE_OPTION_KEYS, \"RemoteScope options require name or resources\"));\n}\n/**\n* Read Remote markers attached to a live Service's class prototype.\n* The returned snapshot cannot mutate the stored descriptor.\n* @param service - live Service instance.\n* @returns markers in class declaration order.\n*/\nfunction remoteMethods(service) {\n\tconst prototype = Object.getPrototypeOf(service);\n\tif (prototype === null) return [];\n\treturn (readRemoteMethodDescriptor(prototype)?.methods ?? []).map((marker) => ({ ...marker }));\n}\nfunction readRemoteMethodDescriptor(prototype) {\n\tconst property = Object.getOwnPropertyDescriptor(prototype, REMOTE_METHOD_DESCRIPTOR);\n\tif (property === void 0) return void 0;\n\tconst descriptor = property.value;\n\tif (descriptor === null || typeof descriptor !== \"object\") throw new TypeError(\"typert-protocol: Remote method descriptor must be an object\");\n\tconst version = Reflect.get(descriptor, \"version\");\n\tif (version !== 1) throw new TypeError(`typert-protocol: unsupported Remote method descriptor version ${String(version)}`);\n\tconst methods = Reflect.get(descriptor, \"methods\");\n\tif (!Array.isArray(methods)) throw new TypeError(\"typert-protocol: Remote method descriptor methods must be an array\");\n\treturn descriptor;\n}\nfunction addMarkerInitializer(context, invocation, options = {}) {\n\tif (context.private || context.static || typeof context.name !== \"string\") throw new TypeError(\"typert-protocol: Remote decorators require a public instance method with a string name\");\n\tconst method = context.name;\n\tcontext.addInitializer(function() {\n\t\tconst prototype = Object.getPrototypeOf(this);\n\t\tif (prototype === null) throw new TypeError(`typert-protocol: cannot mark Remote method \"${method}\" on an object without a prototype`);\n\t\tmark(prototype, method, invocation, options);\n\t});\n}\nfunction mark(prototype, method, invocation, { mode, exportName, resources }) {\n\tconst descriptor = readRemoteMethodDescriptor(prototype);\n\tconst marker = Object.freeze({\n\t\tmethod,\n\t\t...exportName === void 0 || exportName === method ? {} : { exportName },\n\t\t...mode === void 0 ? {} : { mode },\n\t\tinvocation: Object.freeze(invocation),\n\t\t...resources === void 0 ? {} : { resources }\n\t});\n\tconst current = descriptor?.methods.find((candidate) => candidate.method === method);\n\tif (current !== void 0) {\n\t\tif (current.exportName === marker.exportName && current.mode === marker.mode && current.resources === marker.resources && sameInvocation(current.invocation, invocation)) return;\n\t\tthrow new Error(`typert-protocol: Remote method \"${method}\" has conflicting invocation markers`);\n\t}\n\tObject.defineProperty(prototype, REMOTE_METHOD_DESCRIPTOR, {\n\t\tconfigurable: true,\n\t\tvalue: Object.freeze({\n\t\t\tversion: 1,\n\t\t\tmethods: Object.freeze([...descriptor?.methods ?? [], marker])\n\t\t})\n\t});\n}\nfunction sameInvocation(left, right) {\n\tif (left.kind === \"direct\") return right.kind === \"direct\";\n\tif (right.kind === \"direct\") return false;\n\treturn left.context === right.context;\n}\nfunction validateName(subject, value) {\n\tif (!isTypertRemoteSegment(value)) throw new TypeError(`typert-protocol: ${subject} must contain only RPC endpoint segment characters`);\n}\n//#endregion\nexport { Remote, RemoteError, RemoteScope, TYPERT_OWNED_VALUE, TypertRemoteService, bindTypertRemote, createTypertRemoteInfo, isRemoteJsonValue, isRemoteUplinkItem, isTypertOwnedValue, isTypertRemoteMethod, isTypertRemoteSegment, principalOf, remoteErrorOf, remoteMethods, typertOwnedValue };\n","/** Watch and read ownership for the Files panel's expanded directory tree. */\nimport type { DirLevel } from './store.ts'\n\n/** One open directory and its active child nodes; cached view preferences live in the store. */\nexport class DirectoryNode {\n /** Open direct-child directories, keyed by absolute path. */\n readonly children = new Map<string, DirectoryNode>()\n private readonly controller = new AbortController()\n private readonly signal: AbortSignal\n private task: Promise<void> | undefined\n private reading: Promise<void> | undefined\n private dirty = false\n private initialized = false\n private automatic = true\n\n constructor(\n readonly path: string,\n private readonly load: (path: string, signal: AbortSignal) => Promise<DirLevel | undefined>,\n private readonly watch: (path: string, signal: AbortSignal) => AsyncIterable<'ready' | 'change'>,\n private readonly failed: (path: string, error: unknown) => void,\n lifetime: AbortSignal,\n private restore: readonly string[] = [],\n ) {\n this.signal = AbortSignal.any([lifetime, this.controller.signal])\n }\n\n /**\n * Start observation once; readiness triggers the initial listing.\n * @returns this node.\n */\n open(): this {\n this.task ??= this.follow()\n return this\n }\n\n /**\n * Find an active node in this subtree.\n * @param path - absolute directory path.\n * @returns the matching node, or undefined when that directory is closed.\n */\n find(path: string): DirectoryNode | undefined {\n if (path === this.path) return this\n for (const child of this.children.values()) {\n const found = child.find(path)\n if (found !== undefined) return found\n }\n return undefined\n }\n\n /**\n * Update the expansion preferences used by pending directory listings.\n * @param expanded - latest expansion preferences from the store.\n */\n setExpanded(expanded: readonly string[]): void {\n this.restore = expanded\n for (const child of this.children.values()) child.setExpanded(expanded)\n }\n\n /**\n * Open a direct child using this node's lifetime and automatic-refresh setting.\n * @param path - absolute direct-child directory path.\n * @param restore - descendant expansion preferences to restore after listing.\n * @returns the active child, or undefined after cancellation.\n */\n expand(path: string, restore: readonly string[] = []): DirectoryNode | undefined {\n if (this.signal.aborted) return undefined\n let child = this.children.get(path)\n if (child === undefined) {\n child = new DirectoryNode(path, this.load, this.watch, this.failed, this.signal, restore)\n child.automatic = this.automatic\n this.children.set(path, child)\n }\n return child.open()\n }\n\n /**\n * Remove a child and its pending restoration preferences.\n * @param path - absolute direct-child directory path.\n * @returns once the child subtree's reads and watches have ended.\n */\n async collapse(path: string): Promise<void> {\n this.restore = this.restore.filter(value => value !== path && !value.startsWith(`${path}/`))\n const child = this.children.get(path)\n this.children.delete(path)\n await child?.close()\n }\n\n /**\n * Control subtree rereads without ending subscriptions.\n * @param enabled - refresh dirty nodes automatically.\n */\n setAutomatic(enabled: boolean): void {\n this.automatic = enabled\n if (enabled && this.dirty) void this.refresh()\n for (const child of this.children.values()) child.setAutomatic(enabled)\n }\n\n /** Queue a reread, coalescing with active work. @returns completion of the active read and its coalesced rereads. */\n refresh(): Promise<void> {\n this.dirty = true\n this.reading ??= this.read()\n return this.reading\n }\n\n /** Refresh this node and its open descendants. @returns once their listings settle. */\n async refreshTree(): Promise<void> {\n await this.refresh()\n await Promise.all([...this.children.values()].map(child => child.refreshTree()))\n }\n\n /** Cancel the active subtree. @returns once all owned reads and watches have ended. */\n async close(): Promise<void> {\n this.controller.abort()\n await Promise.all([this.task, this.reading, ...[...this.children.values()].map(child => child.close())])\n this.children.clear()\n }\n\n private async follow(): Promise<void> {\n try {\n for await (const _event of this.watch(this.path, this.signal)) {\n this.dirty = true\n if (!this.initialized || this.automatic) void this.refresh()\n }\n } catch (error) {\n if (!this.signal.aborted) {\n if (!this.initialized) await this.refresh()\n if (!(typeof error === 'object' && error !== null && 'code' in error && error.code === 'workspace-file/watch-unsupported')) {\n this.failed(this.path, error)\n }\n }\n }\n }\n\n private async read(): Promise<void> {\n const readAgain = (): boolean => this.dirty && this.automatic && !this.signal.aborted\n try {\n do {\n this.dirty = false\n const level = await this.load(this.path, this.signal)\n if (this.signal.aborted || level === undefined) return\n this.initialized = true\n const directories = new Set(level.entries.filter(entry => entry.type === 'directory')\n .map(entry => `${this.path.replace(/[/\\\\]+$/, '')}/${entry.name}`))\n for (const path of this.children.keys()) {\n if (!directories.has(path)) await this.collapse(path)\n }\n for (const path of directories) {\n if (this.restore.includes(path)) this.expand(path, this.restore)\n }\n this.restore = []\n } while (readAgain())\n } finally {\n this.reading = undefined\n }\n }\n}\n","/**\n * The tree's asynchronous half: listing directories into the store.\n *\n * The component never awaits anything. It calls `start` / `refresh` / `toggle`, and\n * this face performs the listing and writes the outcome through the store's own\n * actions — the Slot-standard `inject` shape, so the session id is resolved by\n * the framework and the write set stays the store's.\n *\n * The listing itself is bound here to the Client Remote face: the tree keys\n * every level by absolute path and hands the endpoint that same absolute path;\n * the endpoint answers with the directory's workspace-relative path as well,\n * which the tree has no use for and drops.\n *\n * One level has one listing in force: asking for a level again — the reload\n * gesture, a directory reopened after a reset — retires the listing still in\n * flight for it, whose settlement then writes nothing. Cleanup rides the owner's\n * `signal`: a request is not made for a record that already ended, and when the\n * record goes away the bucket and the tab's listing bookkeeping are forgotten,\n * so no later settlement writes to it.\n */\nimport type { ClientRemote, RemoteResult } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { BoundActions } from '@deepseek-ai/dsh-client-store'\nimport type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport type { DirLevel, createFilesStore } from './store.ts'\nimport type { WorkspaceFileWatchFrame } from '@deepseek-ai/dsh-api-workspace-files/types'\nimport { RemoteError } from '@deepseek-ai/dsh-typert-protocol'\nimport { DirectoryNode } from './directory-node.ts'\n\n/**\n * Observe one directory without recursively watching its descendants.\n * @param sessionId - Session owning the directory tree.\n * @param path - absolute directory path.\n * @param signal - node lifetime.\n * @returns readiness and invalidation notifications.\n */\nexport type WatchWorkspaceDirectory = (sessionId: SessionId, path: string, signal: AbortSignal) => AsyncIterable<'ready' | 'change'>\n\n/**\n * Bind directory observation to the Remote stream supervisor.\n * @param remote - Client Remote with workspace file streams.\n * @returns a watcher that awaits stream disposal when its node ends.\n */\nexport function createWatch(remote: ClientRemote): WatchWorkspaceDirectory {\n return async function* (sessionId, path, signal) {\n const aborted = (): boolean => signal.aborted\n if (aborted()) return\n const stream = remote.$stream<WorkspaceFileWatchFrame>({\n name: `directory ${path}`,\n open: lifetime => remote.workspaceFiles.changes(sessionId, path, lifetime),\n ended: () => new Error(`Directory watch ended: ${path}`),\n })\n const abort = (): void => { void stream.dispose() }\n signal.addEventListener('abort', abort, { once: true })\n try {\n for await (const item of stream) {\n if (aborted()) return\n if (item.value.kind === 'ready') item.accept()\n yield item.value.kind\n }\n } finally {\n signal.removeEventListener('abort', abort)\n await stream.dispose()\n }\n }\n}\n\n/**\n * One directory listing, bound to a Remote face.\n *\n * The session travels with the call because the endpoint resolves the workspace\n * root from it: the same path means different directories in different sessions.\n * A Remote call does not reject — the result carries the failure.\n */\nexport type ListWorkspaceDirectory = (\n sessionId: SessionId,\n path: string,\n signal: AbortSignal,\n) => Promise<RemoteResult<DirLevel>>\n\n/**\n * The slice of the Client Remote face this package calls: the `workspaceFiles`\n * namespace's `list`, exactly as the Host's generated client declares it.\n */\nexport type WorkspaceFilesListRemote = {\n readonly workspaceFiles: Pick<ClientRemote['workspaceFiles'], 'list'>\n}\n\n/**\n * Bind the listing to one Remote face, keeping only what the tree stores.\n * @param remote - the Client Remote face carrying the `workspaceFiles` namespace.\n * @returns the listing the tree's face performs.\n */\nexport function createList(remote: WorkspaceFilesListRemote): ListWorkspaceDirectory {\n return async (sessionId, path, signal) => {\n const result = await remote.workspaceFiles.list(sessionId, path, signal)\n if (!result.ok) return result\n return { ok: true, value: { entries: result.value.entries, truncated: result.value.truncated } }\n }\n}\n\n/**\n * The absolute path of one child entry.\n *\n * Joined with `/` whatever the parent's separators: the Host resolves mixed\n * separators, and the tree only needs a stable key.\n * @param parent - absolute path of the listed directory.\n * @param name - the entry's basename.\n * @returns the child's absolute path.\n */\nexport function childPath(parent: string, name: string): string {\n return `${parent.replace(/[/\\\\]+$/, '')}/${name}`\n}\n\n/** The tree's injected business face, as the body receives it. */\nexport interface FilesInjected {\n /** Refresh the open directory tree. @param tabId - owning tab. */\n readonly refresh: (tabId: TabId) => void\n /** Control automatic rereads without closing watches. @param tabId - owning tab. @param enabled - automatic-refresh setting. */\n readonly setAutoRefresh: (tabId: TabId, enabled: boolean) => void\n /**\n * Seed this tab's tree and list its root.\n * @param tabId - the tab being drawn.\n * @param root - absolute path of the workspace root.\n * @param signal - the tab record's lifetime.\n */\n readonly start: (tabId: TabId, root: string, signal: AbortSignal) => void\n /**\n * List one directory into the store.\n * @param tabId - the tab being drawn.\n * @param path - absolute directory path.\n * @param signal - the tab record's lifetime.\n */\n readonly load: (tabId: TabId, path: string, signal: AbortSignal) => void\n /**\n * Open or collapse one directory, retaining intent during ancestor restoration.\n * @param tabId - the tab being drawn.\n * @param parentPath - the listed parent directory's exact tree key.\n * @param path - absolute directory path.\n * @param expanded - current expansion preferences, including descendants to restore.\n * @param signal - the tab record's lifetime.\n */\n readonly toggle: (tabId: TabId, parentPath: string, path: string, expanded: readonly string[], signal: AbortSignal) => void\n}\n\n/**\n * Bind the tree's face to one directory listing.\n * @param list - the bound `workspaceFiles.list` call.\n * @param watch - target-scoped directory observation.\n * @returns the Slot `inject` factory: session and bound actions in, face out.\n */\nexport function filesFace(\n list: ListWorkspaceDirectory,\n watch: WatchWorkspaceDirectory,\n): (sessionId: SessionId, actions: BoundActions<ReturnType<typeof createFilesStore>>) => FilesInjected {\n return (\n sessionId: SessionId,\n actions: BoundActions<ReturnType<typeof createFilesStore>>,\n ): FilesInjected => {\n /** Per tab, per absolute path: the listing generation a settlement must match; the latest request wins. */\n const generations = new Map<TabId, Map<string, number>>()\n const roots = new Map<TabId, DirectoryNode>()\n const nextGeneration = (tabId: TabId, path: string): number => {\n const byPath = generations.get(tabId) ?? new Map<string, number>()\n generations.set(tabId, byPath)\n const generation = (byPath.get(path) ?? 0) + 1\n byPath.set(path, generation)\n return generation\n }\n const load = async (tabId: TabId, path: string, signal: AbortSignal): Promise<DirLevel | undefined> => {\n if (signal.aborted) return\n const generation = nextGeneration(tabId, path)\n actions.loading(tabId, path)\n return list(sessionId, path, signal).then((result) => {\n // A newer listing of this level was asked for since, or the record is\n // gone and its bookkeeping with it: nothing left for this one to write.\n if (signal.aborted || generations.get(tabId)?.get(path) !== generation) return\n if (result.ok) actions.loaded(tabId, path, result.value)\n else actions.failed(tabId, path, result.error)\n return result.ok ? result.value : undefined\n })\n }\n return {\n refresh: (tabId) => { void roots.get(tabId)?.refreshTree() },\n setAutoRefresh: (tabId, enabled) => {\n actions.autoRefresh(tabId, enabled)\n roots.get(tabId)?.setAutomatic(enabled)\n },\n start(tabId, root, signal) {\n actions.start(tabId, root)\n signal.addEventListener('abort', () => {\n void roots.get(tabId)?.close()\n roots.delete(tabId)\n generations.delete(tabId)\n actions.forget(tabId)\n }, { once: true })\n roots.set(tabId, new DirectoryNode(root,\n (path, lifetime) => load(tabId, path, lifetime),\n (path, lifetime) => watch(sessionId, path, lifetime),\n (path, error) => {\n if (!signal.aborted) actions.failed(tabId, path, new RemoteError('gateway/internal', error instanceof Error ? error.message : String(error), {}))\n }, signal,\n ).open())\n },\n load: (tabId, path, signal) => { void load(tabId, path, signal) },\n toggle(tabId, parentPath, path, expanded, signal) {\n if (signal.aborted) return\n const root = roots.get(tabId)\n if (root === undefined) return\n const parent = root.find(parentPath)\n if (parent === undefined && !expanded.includes(parentPath)) return\n const collapsing = expanded.includes(path)\n const next = collapsing ? expanded.filter(value => value !== path) : [...expanded, path]\n root.setExpanded(next)\n if (collapsing) void parent?.collapse(path)\n else parent?.expand(path, next)\n actions.toggled(tabId, path)\n },\n }\n }\n}\n","/**\n * The file tree's view state: which directories are expanded, what each\n * loaded level contains, and where the body is scrolled to.\n *\n * The tree is not one resource. A directory listing per level, expanded lazily,\n * is state the type owns — so it lives in a Slot-standard exclusive store\n * (one instance per session), bucketed by tab id because two tabs of this kind\n * in one session expand independently.\n *\n * Writers run between `start` and `forget`: the owner's `signal` is what ends a\n * bucket's life, and the face stops dispatching once it aborts.\n */\nimport { defineStore, type EngineStoreHandle } from '@deepseek-ai/dsh-client-store'\nimport type { RemoteFailure } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit'\nimport type { WorkspaceDirectoryEntry } from '@deepseek-ai/dsh-api-workspace-files/types'\n\n/**\n * One directory's contents, as one expanded level of the tree.\n *\n * The endpoint's listing also names the directory as a workspace-relative path;\n * the tree keys every level by absolute path instead, so the adapter drops it.\n */\nexport interface DirLevel {\n /** The directory's entries, in the endpoint's order. */\n readonly entries: readonly WorkspaceDirectoryEntry[]\n /** The listing hit the endpoint's entry cap, so entries are missing. */\n readonly truncated: boolean\n}\n\n/** What one directory level is doing right now. */\nexport type LevelState =\n | { readonly kind: 'loading' }\n | { readonly kind: 'ready'; readonly level: DirLevel; readonly failure?: RemoteFailure }\n | { readonly kind: 'failed'; readonly failure: RemoteFailure }\n\n/**\n * One tab's tree: its root, the levels it has asked for, and what is open.\n *\n * Every path here is absolute: the root is the session's working directory as\n * the Host reports it, and a child is the parent joined with the entry name.\n */\nexport interface FilesTabState {\n autoRefresh: boolean\n /** Absolute path of the workspace root this tree is rooted at. */\n root: string\n /** Level state by absolute directory path; a path absent here was never asked for. */\n levels: Record<string, LevelState>\n /** Expanded absolute directory paths, root included. */\n expanded: string[]\n /** The body's scroll offset in px, so a remounted tree comes back where the reader was. */\n scrollTop: number\n}\n\n/** Every tab's tree, keyed by tab id. */\nexport interface FilesState {\n byTab: Record<TabId, FilesTabState>\n}\n\n/**\n * One tab's bucket, which every writer after `start` relies on: the face only\n * dispatches while the record's signal is live, and `forget` runs on its abort.\n * @param state - the draft.\n * @param tabId - the tab being written.\n * @returns the tab's tree.\n */\nfunction bucket(state: FilesState, tabId: TabId): FilesTabState {\n const tree = state.byTab[tabId]\n if (tree === undefined) throw new Error(`ui-sidebar-files: no tree for tab \"${tabId}\"`)\n return tree\n}\n\n/** The tree store's write set; every action names the tab it writes. */\ntype FilesActions = {\n autoRefresh: (draft: FilesState, tabId: TabId, enabled: boolean) => void\n start: (draft: FilesState, tabId: TabId, root: string) => void\n loading: (draft: FilesState, tabId: TabId, path: string) => void\n loaded: (draft: FilesState, tabId: TabId, path: string, level: DirLevel) => void\n failed: (draft: FilesState, tabId: TabId, path: string, failure: RemoteFailure) => void\n toggled: (draft: FilesState, tabId: TabId, path: string) => void\n scrolled: (draft: FilesState, tabId: TabId, scrollTop: number) => void\n reset: (draft: FilesState, tabId: TabId) => void\n forget: (draft: FilesState, tabId: TabId) => void\n}\n\n/**\n * Declare the file tree's store.\n *\n * A factory rather than a shared handle: the registration declares it as an\n * exclusive store, so the framework mints one instance per session.\n * @returns the store handle to declare on the registration.\n */\nexport function createFilesStore(): EngineStoreHandle<FilesState, FilesActions> {\n return defineStore({\n init: (): FilesState => ({ byTab: {} }),\n actions: {\n autoRefresh: (d, tabId: TabId, enabled: boolean) => { bucket(d, tabId).autoRefresh = enabled },\n /**\n * Seed one tab's tree at its workspace root, with the root expanded.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param root - absolute path of the workspace root.\n */\n start: (d, tabId: TabId, root: string) => {\n d.byTab[tabId] = { root, levels: {}, expanded: [root], scrollTop: 0, autoRefresh: true }\n },\n /**\n * Mark one directory as being listed.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param path - absolute directory path.\n */\n loading: (d, tabId: TabId, path: string) => {\n const state = bucket(d, tabId)\n if (state.levels[path]?.kind !== 'ready') state.levels[path] = { kind: 'loading' }\n },\n /**\n * Record one directory's contents.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param path - absolute directory path.\n * @param level - the listing to show under it.\n */\n loaded: (d, tabId: TabId, path: string, level: DirLevel) => {\n const state = bucket(d, tabId)\n const previous = state.levels[path]\n if (previous?.kind === 'ready') {\n const directories = new Set(level.entries.filter(entry => entry.type === 'directory').map(entry => entry.name))\n for (const entry of previous.level.entries) {\n if (entry.type !== 'directory' || directories.has(entry.name)) continue\n const removed = `${path.replace(/[/\\\\]+$/, '')}/${entry.name}`\n state.expanded = state.expanded.filter(value => value !== removed && !value.startsWith(`${removed}/`))\n state.levels = Object.fromEntries(Object.entries(state.levels)\n .filter(([key]) => key !== removed && !key.startsWith(`${removed}/`)))\n }\n }\n state.levels[path] = { kind: 'ready', level }\n },\n /**\n * Record why one directory could not be listed.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param path - absolute directory path.\n * @param failure - the settled Remote failure.\n */\n failed: (d, tabId: TabId, path: string, failure: RemoteFailure) => {\n const level = bucket(d, tabId).levels[path]\n bucket(d, tabId).levels[path] = level?.kind === 'ready'\n ? { ...level, failure }\n : { kind: 'failed', failure }\n },\n /**\n * Open a collapsed directory, or collapse an open one.\n *\n * A collapsed level keeps what it loaded, so reopening it draws at once.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param path - absolute directory path.\n */\n toggled: (d, tabId: TabId, path: string) => {\n const state = bucket(d, tabId)\n const at = state.expanded.indexOf(path)\n if (at >= 0) state.expanded.splice(at, 1)\n else state.expanded.push(path)\n },\n /**\n * Record where one tab's body is scrolled to.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n * @param scrollTop - the body's scroll offset, in px.\n */\n scrolled: (d, tabId: TabId, scrollTop: number) => {\n bucket(d, tabId).scrollTop = scrollTop\n },\n /**\n * Drop every loaded level, keeping what is expanded.\n *\n * This is the reload gesture's first half: the expanded set says which\n * levels to fetch again.\n * @param d - draft state.\n * @param tabId - the tab being drawn.\n */\n reset: (d, tabId: TabId) => {\n bucket(d, tabId).levels = {}\n },\n /**\n * Forget one tab's tree, for a tab record that is gone.\n * @param d - draft state.\n * @param tabId - the tab that went away.\n */\n forget: (d, tabId: TabId) => {\n d.byTab = Object.fromEntries(Object.entries(d.byTab).filter(([id]) => id !== tabId))\n },\n },\n })\n}\n","/**\n * Runtime probes for the `@deepseek-ai/dsh-client-ui-primitives` exports the\n * verbatim Files-tree files spell.\n *\n * The upstream imports name the `*Regular` glyph family (0.1.7+; the pixel\n * names are kept as fallbacks for the same reason `compat/client-icons`\n * dual-names them) plus `FileTypeIcon` and `classifyFileType`, which every\n * supported release carries. A named import cannot spell two release eras at\n * once, so the resolution goes through `maybeIcon`/`maybeComponent` — the\n * same probe the open-in-app fork uses.\n *\n * The exported bindings are typed definite because the adapter mounts the\n * tree only after {@link filesTreeSurfaceSupported} passes; reaching for a\n * binding on a composition that failed the gate is a caller bug, and the\n * gate — not this module — is what a missing export degrades into.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/files-tree/primitives\n */\n\nimport { maybeComponent, maybeIcon, type PanelIcon } from '../../compat/client-icons.ts'\nimport type {} from '@deepseek-ai/dsh-client-ui-primitives'\n\n/** The upstream types the probed exports spell, kept honest by the type-only import. */\ntype Primitives = typeof import('@deepseek-ai/dsh-client-ui-primitives')\n\n/** Exports the fork's row rendering needs, keyed by their upstream names. */\nconst probed = {\n folderClose: maybeIcon(['IconFolderCloseRegular', 'IconFolderClose16']),\n folderOpen: maybeIcon(['IconFolderOpenRegular', 'IconFolderOpen16']),\n fileTypeIcon: maybeComponent<Primitives['FileTypeIcon']>(['FileTypeIcon']),\n classifyFileType: maybeComponent<Primitives['classifyFileType']>(['classifyFileType']),\n}\n\n/**\n * Whether this composition's primitives carry everything the forked rows\n * spell. The adapter consults this once: `false` means the additional-root\n * menu stays menu-only and no fork mount is attempted — the same absence\n * upstream's own no-such-export state would produce.\n */\nexport function filesTreeSurfaceSupported(): boolean {\n return probed.folderClose !== undefined\n && probed.folderOpen !== undefined\n && probed.fileTypeIcon !== undefined\n && probed.classifyFileType !== undefined\n}\n\nexport const IconFolderCloseRegular = probed.folderClose as PanelIcon\nexport const IconFolderOpenRegular = probed.folderOpen as PanelIcon\nexport const FileTypeIcon = probed.fileTypeIcon as Primitives['FileTypeIcon']\nexport const classifyFileType = probed.classifyFileType as Primitives['classifyFileType']\n","/**\n * Fork-facing shim for upstream `ui-sidebar-files/src/client/locales.ts`.\n *\n * Upstream's dictionaries stay upstream's: the runtime `sidebarFiles`\n * namespace is already registered by `@deepseek-ai/dsh-client-ui-sidebar-files`\n * in every composition where the Files tab exists, and this plugin binds that\n * same namespace instead of registering a second copy (`locale.register`\n * throws on a duplicate locale inside one namespace). What the forked\n * components still need from this file is the namespace name and the key\n * domain for `TranslateNS<typeof NS>` — copied verbatim from upstream. When\n * upstream edits copy, the string values follow automatically; only a NEW key\n * requires extending the union below.\n *\n * Sync: `SidebarFilesKey` must equal `keyof typeof zh` in upstream's\n * `locales.ts`. See FORK.md.\n */\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\n\n/** Dictionary namespace owned by upstream's plugin (verbatim). */\nexport const NS = 'sidebarFiles'\n\n/** Key domain of the `sidebarFiles` namespace (verbatim union of upstream's zh keys). */\nexport type SidebarFilesKey =\n | 'shortcut.noSession'\n | 'type.label'\n | 'guide.title'\n | 'guide.description'\n | 'loading'\n | 'empty'\n | 'truncated'\n | 'noWorkspace'\n | 'reload'\n | 'autoRefresh'\n | 'autoRefresh.enable'\n | 'autoRefresh.disable'\n | 'entry.other'\n | 'error.notFound'\n | 'error.outsideWorkspace'\n | 'error.notDirectory'\n | 'error.unavailable'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** File-tree type name, guide entry, row states, and failure lines. */\n sidebarFiles: SidebarFilesKey\n }\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","//#region lib/types/file-address.js\n/**\n* The `dsh-resource://file/…` address grammar: how a file is named across the\n* Sidebar and the resource model, built and parsed without touching a\n* filesystem.\n* @module\n*/\n/** The scheme and type every file address opens with. */\nconst FILE_ADDRESS_PREFIX = \"dsh-resource://file/\";\n/** Component-encode one id or path segment, keeping `:` literal for drive letters. */\nfunction encodeSegment(segment) {\n\treturn encodeURIComponent(segment).replace(/%3A/gi, \":\");\n}\n/** Encode a `/`-separated path segment by segment. */\nfunction encodePath(path) {\n\treturn path.split(\"/\").map(encodeSegment).join(\"/\");\n}\n/** Whether a decoded first path segment is a Windows drive (`C:`). */\nfunction isDriveSegment(segment) {\n\treturn segment !== void 0 && /^[A-Za-z]:$/.test(segment);\n}\n/**\n* Build the address of a file read through one Session.\n* @param sessionId - the Session whose Host workspace resolves the path.\n* @param path - absolute or workspace-relative path; backslashes are normalized to `/`, and leading `./` prefixes are dropped.\n* @returns the `dsh-resource://file/session/<sessionId>/<path>` address.\n*/\nfunction sessionFileAddress(sessionId, path) {\n\tconst normalized = path.replace(/\\\\/g, \"/\").replace(/^(?:\\.\\/)+/, \"\");\n\treturn `${FILE_ADDRESS_PREFIX}session/${encodeSegment(sessionId)}/${encodePath(normalized)}`;\n}\n/**\n* Build the address of a file by its absolute path.\n* @param path - absolute path; backslashes are normalized to `/` and the leading `/` is dropped,\n* except that a UNC path (`\\\\server\\share`) keeps one empty first segment.\n* @returns the `dsh-resource://file/absolute/<path>` address.\n*/\nfunction absoluteFileAddress(path) {\n\tconst normalized = path.replace(/\\\\/g, \"/\");\n\tconst unc = normalized.startsWith(\"//\");\n\tconst absolute = normalized.replace(/^\\/+/, \"\");\n\treturn `${FILE_ADDRESS_PREFIX}absolute/${unc ? \"/\" : \"\"}${encodePath(absolute)}`;\n}\n/**\n* Read a file address back into its parts without resolving `.` or `..`.\n* Query and fragment suffixes are ignored; encoded path segments are decoded.\n* @param address - a candidate address.\n* @returns the parts, or `undefined` when the string is not a `dsh-resource://file/` URI in a known scope with a path, or a segment is not validly encoded.\n*/\nfunction parseFileAddress(address) {\n\ttry {\n\t\tif (!address.startsWith(FILE_ADDRESS_PREFIX)) return void 0;\n\t\tconst end = address.search(/[?#]/);\n\t\tconst [scope, ...rest] = address.slice(20, end === -1 ? void 0 : end).split(\"/\");\n\t\tif (scope === \"session\") {\n\t\t\tconst [id, ...segments] = rest;\n\t\t\tif (id === void 0 || id === \"\" || segments.length === 0) return void 0;\n\t\t\treturn {\n\t\t\t\tscope,\n\t\t\t\tsessionId: decodeURIComponent(id),\n\t\t\t\tpath: segments.map(decodeURIComponent).join(\"/\")\n\t\t\t};\n\t\t}\n\t\tif (scope === \"absolute\") {\n\t\t\tconst unc = rest[0] === \"\" && rest.length > 1;\n\t\t\tconst segments = (unc ? rest.slice(1) : rest).map(decodeURIComponent);\n\t\t\tif (segments.length === 0 || segments[0] === \"\") return void 0;\n\t\t\tif (unc) return {\n\t\t\t\tscope,\n\t\t\t\tpath: `//${segments.join(\"/\")}`\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tscope,\n\t\t\t\tpath: isDriveSegment(segments[0]) ? segments.join(\"/\") : `/${segments.join(\"/\")}`\n\t\t\t};\n\t\t}\n\t\treturn;\n\t} catch {\n\t\treturn;\n\t}\n}\n//#endregion\n//#region lib/types/index.js\n/**\n* Browser-safe Workspace path and display helpers.\n* @module @deepseek-ai/dsh-util-workspace-path\n*/\n/** Whether a path uses a Windows drive or UNC prefix. */\nfunction isWindowsStylePath(value) {\n\treturn /^[A-Za-z]:[/\\\\]/.test(value) || value.startsWith(\"\\\\\\\\\");\n}\n/**\n* Whether a path is absolute in either spelling the Host accepts: POSIX (`/a/b`) or Windows drive or UNC.\n* @param path - the path to classify.\n* @returns `true` for an absolute path; `false` for a Workspace-relative one.\n*/\nfunction isAbsoluteWorkspacePath(path) {\n\treturn path.startsWith(\"/\") || isWindowsStylePath(path);\n}\n/**\n* Resolve a Workspace-relative path into the Host-facing spelling used by path operations.\n* @param cwd - Session Workspace root, when known.\n* @param path - Absolute or Workspace-relative path; leading `./` segments are dropped when joining.\n* @returns an absolute path when a Workspace root is available, otherwise the original path.\n*/\nfunction resolveWorkspacePath(cwd, path) {\n\tif (isAbsoluteWorkspacePath(path)) return path;\n\tif (cwd === void 0 || cwd === \"\") return path;\n\tconst separator = isWindowsStylePath(cwd) && cwd.includes(\"\\\\\") ? \"\\\\\" : \"/\";\n\treturn `${cwd.replace(/[/\\\\]+$/, \"\")}${separator}${path.replace(/^(?:\\.?[/\\\\])+/, \"\")}`;\n}\n/**\n* Abbreviate a POSIX home directory for display.\n* @param path - Absolute or already-short display path.\n* @param home - Host account home; absent skips abbreviation.\n* @returns `~` or `~/…` for the POSIX home and its descendants, otherwise `path`.\n*/\nfunction abbreviateHomePath(path, home) {\n\tif (home === void 0 || home === \"\") return path;\n\tif (isWindowsStylePath(path) || isWindowsStylePath(home)) return path;\n\tconst root = home.replace(/\\/+$/, \"\");\n\tif (root === \"\" || root === \"/\") return path;\n\tif (path.replace(/\\/+$/, \"\") === root) return \"~\";\n\tif (path.startsWith(`${root}/`)) return `~${path.slice(root.length)}`;\n\treturn path;\n}\n/**\n* Read the final non-empty segment of a Workspace path for display.\n* Workspace-label surfaces use this helper instead of deriving another basename.\n* @param path - Workspace directory path using POSIX or Windows separators.\n* @returns the final segment, or an empty string for a separator-only path.\n*/\nfunction workspaceTitleOf(path) {\n\tconst trimmed = path.replace(/[/\\\\]+$/, \"\");\n\tconst separator = Math.max(trimmed.lastIndexOf(\"/\"), trimmed.lastIndexOf(\"\\\\\"));\n\treturn trimmed.slice(separator + 1);\n}\n/**\n* Split a path for display: the directories through their last separator, and\n* the final segment after it. Both `/` and `\\` separate, so a Windows path\n* splits where its own segments end; trailing separators are dropped first, so\n* a directory path names its own last segment. A path with no separator, or a\n* separator-only path, is all name.\n* @param path - file or directory path using POSIX or Windows separators.\n* @returns the directory prefix (possibly empty) and the final segment.\n*/\nfunction pathPartsOf(path) {\n\tconst trimmed = path.replace(/[/\\\\]+$/, \"\");\n\tif (trimmed === \"\") return {\n\t\tdirectory: \"\",\n\t\tname: path\n\t};\n\tconst cut = Math.max(trimmed.lastIndexOf(\"/\"), trimmed.lastIndexOf(\"\\\\\")) + 1;\n\treturn {\n\t\tdirectory: trimmed.slice(0, cut),\n\t\tname: trimmed.slice(cut)\n\t};\n}\n/**\n* The address for a path as a caller holds it: a relative path, or an absolute\n* path inside the Session's workspace, becomes a `session`-scoped address; an\n* absolute path outside it, or one whose workspace root is unknown, keeps its\n* absolute path in that Session's address.\n* @param sessionId - the Session the path is read in.\n* @param cwd - that Session's workspace root, when known.\n* @param path - absolute or workspace-relative path, in either separator spelling.\n* @returns the `dsh-resource://file/…` address.\n*/\nfunction fileAddressFor(sessionId, cwd, path) {\n\tconst normalized = path.replace(/\\\\/g, \"/\");\n\tif (!isAbsoluteWorkspacePath(normalized)) return sessionFileAddress(sessionId, normalized);\n\tconst root = cwd === void 0 ? \"\" : cwd.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\");\n\tif (root !== \"\" && normalized === root) return sessionFileAddress(sessionId, \"\");\n\tif (root !== \"\" && normalized.startsWith(`${root}/`)) return sessionFileAddress(sessionId, normalized.slice(root.length + 1));\n\treturn sessionFileAddress(sessionId, normalized);\n}\n/**\n* Strip the workspace root from a workspace-rooted absolute path (display only).\n* @param text - the path to shorten.\n* @param cwd - session workspace root; absent or empty leaves the path unchanged.\n* @returns the path relative to the workspace root, or unchanged when it is not rooted there.\n*/\nfunction relativizeToCwd(text, cwd) {\n\tif (cwd === void 0 || cwd === \"\") return text;\n\tconst root = cwd.replace(/[/\\\\]+$/, \"\");\n\tif (text.startsWith(`${root}/`) || text.startsWith(`${root}\\\\`)) return text.slice(root.length + 1);\n\treturn text;\n}\n/**\n* Address a decoded absolute file path through the authenticated file route.\n* @param base - HTTP(S) application base, including its deployment prefix, or `dsh-app://app/`.\n* @param path - Native file path; URL escapes in authored Markdown must already be decoded.\n* @returns File URL, or undefined for unsupported transports and non-absolute paths.\n*/\nfunction fileMediaUrl(base, path) {\n\tif (!/^https?:/u.test(base) && !base.startsWith(\"dsh-app://app/\") || !isAbsoluteWorkspacePath(path) || /^[/\\\\]{2}/u.test(path) || /[\\u0000-\\u001f\\u007f]/u.test(path)) return void 0;\n\treturn new URL(`api/file?path=${encodeURIComponent(path)}`, base).href;\n}\n//#endregion\nexport { abbreviateHomePath, absoluteFileAddress, fileAddressFor, fileMediaUrl, isAbsoluteWorkspacePath, parseFileAddress, pathPartsOf, relativizeToCwd, resolveWorkspacePath, sessionFileAddress, workspaceTitleOf };\n","/**\n * Shim for the CSS-module virtual module `./FilesBody.module.css`.\n *\n * This toolchain resolves real files, not CSS-module virtual modules — so\n * the forked body imports this file instead (the one-line specifier delta\n * recorded in FORK.md). It exports the same `css.<name>` map, pointed at the\n * plugin-prefixed `mrfw-ft*` classes whose rules live in `styles.ts`; the\n * upstream `FilesBody.module.css` sits beside it verbatim as the diffable\n * source. Only the names the fork's JSX actually reads are mapped — the\n * header-only entries (`root`, `header`, `path`, `tool`, `status`,\n * `statusLine`, `titleIcon`) belong to the shell this fork drops.\n */\nconst css = {\n body: 'mrfw-ftBody',\n level: 'mrfw-ftLevel',\n item: 'mrfw-ftItem',\n row: 'mrfw-ftRow',\n icon: 'mrfw-ftIcon',\n fileIcon: 'mrfw-ftFileIcon',\n name: 'mrfw-ftName',\n other: 'mrfw-ftOther',\n note: 'mrfw-ftNote',\n} as const\n\nexport default css\n","/**\n * The file tree's body, forked to a caller-supplied root: one additional\n * workspace root, listed one level at a time.\n *\n * Everything the tree keeps lives in its store, keyed by tab; everything it\n * asks for goes through its injected face. The component itself only decides\n * what to draw for each absolute path and what a click means: a directory\n * toggles, a file opens through the owner's open callback for a `file:`\n * viewer to claim, and anything else is shown but refuses to open.\n *\n * The rows below the exported shell are byte-identical to upstream's\n * `FilesBody.tsx`; the shell is the adaptation — upstream's version derives\n * the root from the session's `cwd`, takes its tab identity and lifetime from\n * `useTabInfo()`, opens resources through `tab.actions.openResource`, and\n * draws the header (PathLabel, auto-refresh, reload, actions slot) that this\n * plugin's switcher already owns. This fork takes all four as props and\n * draws only the body. See FORK.md.\n */\nimport { useEffect, useLayoutEffect, useRef } from 'react'\nimport type { ReactNode } from 'react'\nimport clsx from 'clsx'\nimport type { RemoteFailure } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { PropsLocale, PropsStore, TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport {\n FileTypeIcon, IconFolderCloseRegular, IconFolderOpenRegular, classifyFileType,\n} from './primitives.ts'\nimport { fileAddressFor } from '@deepseek-ai/dsh-util-workspace-path'\nimport type { WorkspaceDirectoryEntry } from '@deepseek-ai/dsh-api-workspace-files/types'\nimport { childPath } from './face.ts'\nimport type { FilesInjected } from './face.ts'\nimport type {} from './locales.ts'\nimport type { createFilesStore, FilesTabState } from './store.ts'\nimport css from './FilesBody.module.css.ts'\n\n/**\n * The fork's props: the store/locale shares verbatim from upstream's\n * composed props, `start`/`toggle` from the injected face, and the four\n * seams upstream binds inside `FilesBody` — tab id, lifetime, root, and the\n * resource-opening callback — supplied by the adapter instead.\n */\nexport type FilesTreeProps =\n & PropsStore<ReturnType<typeof createFilesStore>>\n & Pick<FilesInjected, 'start' | 'toggle'>\n & PropsLocale<'sidebarFiles'>\n & {\n /** The store bucket this tree reads and writes — the pane's own dockkit tab id. */\n readonly tabId: TabId\n /** Session the listing and the resource addresses belong to. */\n readonly sessionId: SessionId\n /** Absolute path of the root this tree lists (the selected additional root). */\n readonly root: string\n /** Takeover lifetime: aborting forgets the bucket and closes the watch tree. */\n readonly signal: AbortSignal\n /** Open one `dsh-resource://file` address (the adapter's sidebarRight route). */\n readonly onOpen: (address: string) => void\n }\n\n/** Natural, case-insensitive name order, so `file2` precedes `file10`. */\nconst byName = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' })\n\n/**\n * Order one level's entries for display: directories first, then everything\n * else, each group by name. The endpoint's order is a listing fact; this is the\n * reader's.\n * @param entries - the listing as the endpoint returned it.\n * @returns a new array, directories first, then by name within each group.\n */\nexport function orderEntries(entries: readonly WorkspaceDirectoryEntry[]): WorkspaceDirectoryEntry[] {\n return [...entries].sort((left, right) => {\n const group = Number(right.type === 'directory') - Number(left.type === 'directory')\n return group !== 0 ? group : byName.compare(left.name, right.name)\n })\n}\n\n/**\n * Say why a directory could not be listed, in terms of the directory.\n * @param t - namespace-bound translate.\n * @param failure - the settled Remote failure.\n * @returns the line to show under the directory.\n */\nexport function failureLine(t: TranslateNS<'sidebarFiles'>, failure: RemoteFailure): string {\n switch (failure.code) {\n case 'workspace-file/not-found': return t('error.notFound')\n case 'workspace-file/outside-workspace': return t('error.outsideWorkspace')\n case 'workspace-file/not-directory': return t('error.notDirectory')\n // Carrier and unclassified host failures reach the reader as themselves:\n // this tree knows nothing useful to add to a transport-level message.\n default: return t('error.unavailable', { message: failure.message })\n }\n}\n\n/** What every level shares: the tab's tree and the two gestures. */\ninterface TreeContext {\n readonly state: FilesTabState\n readonly onToggle: (parent: string, path: string) => void\n readonly onOpen: (path: string) => void\n readonly t: TranslateNS<'sidebarFiles'>\n}\n\n/** One entry's row, and its children when it is an expanded directory. */\nfunction Entry({ parent, entry, tree }: { parent: string; entry: WorkspaceDirectoryEntry; tree: TreeContext }): ReactNode {\n const path = childPath(parent, entry.name)\n if (entry.type === 'directory') {\n const expanded = tree.state.expanded.includes(path)\n return (\n <li className={css.item} data-files-entry=\"directory\" data-files-path={path}>\n <button type=\"button\" className={css.row} aria-expanded={expanded} onClick={() => { tree.onToggle(parent, path) }}>\n {expanded ? <IconFolderOpenRegular className={css.icon} /> : <IconFolderCloseRegular className={css.icon} />}\n <span className={css.name}>{entry.name}</span>\n </button>\n {expanded && <ul className={css.level}><Level path={path} tree={tree} /></ul>}\n </li>\n )\n }\n if (entry.type === 'file') {\n return (\n <li className={css.item} data-files-entry=\"file\" data-files-path={path}>\n <button type=\"button\" className={css.row} onClick={() => { tree.onOpen(path) }}>\n <FileTypeIcon kind={classifyFileType(entry.name)} size={16} className={css.fileIcon} />\n <span className={css.name}>{entry.name}</span>\n </button>\n </li>\n )\n }\n return (\n <li className={css.item} data-files-entry=\"other\" data-files-path={path}>\n <span className={clsx(css.row, css.other)} aria-disabled=\"true\" title={tree.t('entry.other')}>\n <span className={css.name}>{entry.name}</span>\n </span>\n </li>\n )\n}\n\n/** One directory's rows: its state while listing, its entries once listed. */\nfunction Level({ path, tree }: { path: string; tree: TreeContext }): ReactNode {\n const { state, t } = tree\n const level = state.levels[path]\n if (level === undefined || level.kind === 'loading') {\n return <li className={css.note} data-files-row=\"loading\">{t('loading')}</li>\n }\n if (level.kind === 'failed') {\n return (\n <li className={css.note} data-files-row=\"failed\" data-files-code={level.failure.code}>\n {failureLine(t, level.failure)}\n </li>\n )\n }\n const entries = orderEntries(level.level.entries)\n return (\n <>\n {level.failure !== undefined && <li className={css.note} data-files-row=\"failed\">{failureLine(t, level.failure)}</li>}\n {entries.length === 0 && <li className={css.note} data-files-row=\"empty\">{t('empty')}</li>}\n {entries.map(entry => <Entry key={entry.name} parent={path} entry={entry} tree={tree} />)}\n {level.level.truncated && <li className={css.note} data-files-row=\"truncated\">{t('truncated')}</li>}\n </>\n )\n}\n\n/**\n * The additional-root tree's body: the selected root and whatever the reader\n * has opened under it — the upstream body's scroll, seed, and render logic\n * verbatim, with the root arriving as a prop instead of `useSessions(cwd)`.\n */\nexport function FilesTree({\n tabId, sessionId, root, signal, useStore, actions, start, toggle, onOpen, t,\n}: FilesTreeProps): ReactNode {\n const state = useStore(store => store.byTab[tabId])\n const bodyRef = useRef<HTMLDivElement>(null)\n const scrollTopRef = useRef(0)\n // Come back where the reader was: loaded levels outlive the body in the\n // store, so a remounted tree lays out at its full height before this runs\n // and the stored offset re-lands exactly. A fresh tree stores 0.\n const seeded = state !== undefined\n useLayoutEffect(() => {\n const body = bodyRef.current\n if (seeded && body !== null) {\n body.scrollTop = state.scrollTop\n scrollTopRef.current = body.scrollTop\n }\n }, [seeded])\n // Scrolling only moves the ref; the store hears about it once, on unmount,\n // so a scroll neither re-renders the tree nor writes after the owner's\n // abort has forgotten the bucket.\n useEffect(() => () => {\n if (seeded && !signal.aborted) actions.scrolled(tabId, scrollTopRef.current)\n }, [seeded, signal, tabId, actions])\n useEffect(() => {\n // A bucket gone because the record aborted must not be re-seeded by a\n // component that has not unmounted yet.\n if (state !== undefined || signal.aborted) return\n start(tabId, root, signal)\n }, [state, root, tabId, signal, start])\n\n if (state === undefined) return null\n const tree: TreeContext = {\n state,\n onToggle: (parent, path) => { toggle(tabId, parent, path, state.expanded, signal) },\n // Every row carries an absolute path; the address leaves cwd undefined so\n // the host resolves the file as written — a cwd here would relativize it\n // against the session's primary root and open the wrong file.\n onOpen: (path) => { onOpen(fileAddressFor(sessionId, undefined, path)) },\n t,\n }\n return (\n <div\n ref={bodyRef}\n className={css.body}\n onScroll={(event) => { scrollTopRef.current = event.currentTarget.scrollTop }}\n >\n <ul className={css.level}><Level path={state.root} tree={tree} /></ul>\n </div>\n )\n}\n","/**\n * The plugin-owned wiring around the verbatim files-tree fork.\n *\n * Upstream wires its store and face inside `apply` over `ctx.remote`, and the\n * slot framework resolves the session and hands the face its bound actions.\n * This plugin registers onto `sidebar.right.tab.files.actions` — a\n * session-scoped list slot — so the same `store`/`inject` declaration gives\n * the fork the same props; what differs is only *which* remote and *which*\n * open-route the fork sees:\n *\n * - `remote` is an optional service here (upstream injects it unconditionally),\n * so {@link lazyFilesRemote} resolves `remote` / `remote.workspaceFiles` per\n * call through `ctx.get` — the inject-free lookup, since a declaration would\n * gate this whole row on an optional service — and folds absence into the\n * same `gateway/internal` failure a carrier error would produce;\n * - opening a file goes through `sidebarRight.openResourceIn`, bound with the\n * session inside the `inject` factory so the component never resolves one;\n * - the primitives the forked rows spell are runtime-probed (pixel-era\n * manifests lack the `*Regular` names), and the gate's `false` means the\n * caller simply never mounts the tree — upstream's own absence shape.\n *\n * Everything here is ours; nothing in this file needs upstream sync.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/files-tree/adapter\n */\n\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type { ClientRemote } from '@deepseek-ai/dsh-api-remotes/client'\nimport { createSnapshotStore, type BoundActions, type SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store'\nimport type { HostObservable } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport { RemoteError, type RemoteFailure } from '@deepseek-ai/dsh-typert-protocol'\nimport { createList, createWatch, filesFace, type FilesInjected } from './face.ts'\nimport { createFilesStore } from './store.ts'\nimport { filesTreeSurfaceSupported } from './primitives.ts'\nimport type { FilesTreeProps } from './FilesTree.tsx'\nimport type { RootView } from '../../contract.ts'\nimport { NS } from './locales.ts'\n\n/** The `sidebarRight` face the fork uses to open a file resource. */\ninterface SidebarRightOpen {\n readonly openResourceIn?: (sessionId: SessionId, address: string) => void\n}\n\n/**\n * One session's per-tab additional-root selections, keyed by the pane's\n * dockkit tab id. An absent entry means the primary root.\n */\nexport type TreeSelection = Readonly<Record<string, RootView>>\n\n/**\n * The lifetimes a selection runs under, keyed by tab like the store bucket:\n * while an entry's signal is live the tree keeps its loaded levels, watches,\n * expansion, and scroll — exactly what upstream's tab-record signal gives the\n * native tree across a body remount (opening a file deactivates this tab,\n * unmounting its body without ending the record).\n */\nexport interface FilesTreeTakeover {\n /**\n * The live signal for (tabId, root); reuses the live entry so a remounted\n * body finds its bucket and watches intact. A different root — or an entry\n * already aborted — ends the previous controller before minting the next.\n * @param tabId - the pane's dockkit tab id.\n * @param root - absolute path of the root being browsed.\n * @param section - the dockkit tabHost section the caller mounted under; a\n * live entry keeps an observer on it that ends the takeover whenever the\n * section leaves the document — the record's real end — including when the\n * body that mounted it has long been unmounted itself.\n * @returns the signal the forked tree lives under.\n */\n readonly signal: (tabId: TabId, root: string, section?: Element) => AbortSignal\n /**\n * Abort and drop one tab's takeover: the reader deselected or switched\n * roots, or the tab record itself went away.\n * @param tabId - the pane's dockkit tab id.\n */\n readonly end: (tabId: TabId) => void\n}\n\n/** The inject face the registration composes onto the occupant's props. */\nexport interface FilesTreeInjected {\n /** The verbatim files face (list/watch bookkeeping included). */\n readonly face: FilesInjected\n /** Open one `dsh-resource://file` address in the host viewer. */\n readonly openFile: (address: string) => void\n /**\n * The reserved inject compartment: the slot renderer binds each source to a\n * `use<Name>` selector hook, so `treeSelection` reaches the component as\n * `useTreeSelection`, never as a prop under its own key.\n */\n readonly hooks: { readonly treeSelection: HostObservable<TreeSelection> }\n /**\n * Persist one pane's selected root; `'primary'` drops its entry. The\n * session-scoped snapshot survives the body remount a file open causes.\n * @param tabId - the pane's dockkit tab id.\n * @param root - the selected root, or `'primary'` to browse the session root.\n */\n readonly selectRoot: (tabId: TabId, root: RootView | 'primary') => void\n /** The forked tree's lifetimes; see {@link FilesTreeTakeover}. */\n readonly takeover: FilesTreeTakeover\n}\n\n/** Everything `FilesTree` needs that the slot framework does not synthesize. */\nexport interface FilesTreeSurface {\n readonly sessionId: SessionId\n readonly useStore: FilesTreeProps['useStore']\n readonly actions: FilesTreeProps['actions']\n readonly face: FilesInjected\n readonly openFile: (address: string) => void\n readonly t: FilesTreeProps['t']\n /** Selector hook over this session's per-tab root selections. */\n readonly useTreeSelection: SnapshotSelectorHook<TreeSelection>\n /** The selection's write side; see {@link FilesTreeInjected.selectRoot}. */\n readonly selectRoot: FilesTreeInjected['selectRoot']\n /** The forked tree's lifetimes; see {@link FilesTreeTakeover}. */\n readonly takeover: FilesTreeTakeover\n}\n\n/** The failure every lazy-remote path reports when the carrier is absent. */\nconst unavailable = (): RemoteError<'gateway/internal'> =>\n new RemoteError('gateway/internal', 'the remote service is not available in this composition', {})\n\n/**\n * Fold an unexpected exception into the Remote failure a dead carrier would\n * produce. A generated Remote call cannot reject — but the lazy indirection\n * can (a `remote` whose `workspaceFiles` namespace is not mounted leaves\n * `.list` throwing a TypeError). The verbatim `load` awaits `list` through\n * `.then` without `.catch`, so an escaped rejection would die inside\n * `DirectoryNode.task` and pin the level at `loading` forever; folding it\n * here keeps the failure a settled Remote result — the visible failure row.\n */\nconst failureOf = (error: unknown): RemoteFailure =>\n typeof error === 'object' && error !== null && 'code' in error\n ? error as RemoteFailure\n : new RemoteError('gateway/internal', error instanceof Error ? error.message : String(error), {})\n\n/** An AsyncIterable whose first read throws the absent-carrier failure. */\nconst deadStream = (error: unknown = unavailable()): AsyncIterable<never> & { dispose(): Promise<void> } => ({\n [Symbol.asyncIterator]: () => ({ next: () => Promise.reject(failureOf(error)) }),\n dispose: () => Promise.resolve(),\n})\n\n/**\n * A `ClientRemote` stand-in that resolves the real service per call.\n *\n * The verbatim `createList`/`createWatch` hold one remote face for the\n * session's life; resolving lazily keeps the fork correct on compositions\n * that acquire `remote` after this plugin activates, and a composition that\n * never acquires it still answers every call — with the same failure kind a\n * dead carrier returns — instead of crashing the slot. Every method upholds\n * the Remote contract the face relies on: `list` resolves a `RemoteResult`\n * and never rejects; `changes`/`$stream` surface synchronous lookup failures\n * through the stream's own failure path.\n */\nexport function lazyFilesRemote(ctx: ClientContext): ClientRemote {\n const get = (name: string): unknown =>\n (ctx as unknown as { get(key: string): unknown }).get(name)\n // `remote.workspaceFiles` is a *nested service*, so `remote.workspaceFiles`\n // on the traceable resolves through the inject-guarded context proxy and\n // throws \"without inject\" for any fiber that never declared it — which no\n // fiber of ours may do, since this cordis treats every inject entry as\n // required and a declaration would gate the whole row on an optional\n // service. `ctx.get` reads the service store with no inject requirement —\n // exactly the lazy-optional semantics this adapter exists for.\n const namespace = (): ClientRemote['workspaceFiles'] | undefined =>\n get('remote.workspaceFiles') as ClientRemote['workspaceFiles'] | undefined\n return {\n workspaceFiles: {\n list: (sessionId: SessionId, path: string, signal?: AbortSignal) => {\n try {\n const ns = namespace()\n if (ns === undefined) return Promise.resolve({ ok: false as const, error: unavailable() })\n return Promise.resolve(ns.list(sessionId, path, signal))\n .catch((error: unknown) => ({ ok: false as const, error: failureOf(error) }))\n } catch (error) {\n return Promise.resolve({ ok: false as const, error: failureOf(error) })\n }\n },\n changes: (sessionId: SessionId, path: string, signal?: AbortSignal) => {\n try {\n const ns = namespace()\n return ns === undefined ? deadStream() : ns.changes(sessionId, path, signal)\n } catch (error) {\n return deadStream(error)\n }\n },\n },\n $stream: ((options: Parameters<ClientRemote['$stream']>[0]) => {\n try {\n const remote = get('remote') as ClientRemote | undefined\n return remote === undefined ? deadStream() : remote.$stream(options)\n } catch (error) {\n return deadStream(error)\n }\n }) as ClientRemote['$stream'],\n } as unknown as ClientRemote\n}\n\n/**\n * The registration's `store`/`inject` declarations, built once in `apply`.\n *\n * The inject face nests the verbatim files face under `face` and adds the\n * session-bound `openFile` — keeping `FilesInjected` untouched means the\n * fork's call sites and the sync diff stay upstream-shaped.\n * @param ctx - the client root context (the remote/sidebarRight lookups).\n * @returns the store handle and the inject factory for `register`.\n */\nexport function createFilesTreeSeats(ctx: ClientContext): {\n readonly store: ReturnType<typeof createFilesStore>\n readonly inject: (sessionId: SessionId, actions: BoundActions<ReturnType<typeof createFilesStore>>) => FilesTreeInjected\n} {\n const store = createFilesStore()\n const remote = lazyFilesRemote(ctx)\n const face = filesFace(createList(remote), createWatch(remote))\n const inject = (sessionId: SessionId, actions: BoundActions<ReturnType<typeof createFilesStore>>): FilesTreeInjected => {\n // Both live at the inject product's scope — one instance per session — so\n // the selection and the controllers it runs under survive the body remount\n // an opened file causes (the file tab takes the pane, the Files body\n // unmounts, and component state would otherwise reset to 'primary').\n const selection = createSnapshotStore<TreeSelection>({})\n interface Held {\n readonly controller: AbortController\n readonly root: string\n section: Element | undefined\n observer: MutationObserver | undefined\n }\n const takeovers = new Map<TabId, Held>()\n const endTakeover = (tabId: TabId): void => {\n const held = takeovers.get(tabId)\n held?.observer?.disconnect()\n held?.controller.abort()\n takeovers.delete(tabId)\n }\n return {\n face: face(sessionId, actions),\n openFile: (address: string) => {\n const sidebar = (ctx as unknown as { get(key: string): unknown }).get('sidebarRight') as SidebarRightOpen | undefined\n sidebar?.openResourceIn?.(sessionId, address)\n },\n hooks: { treeSelection: selection },\n selectRoot: (tabId, root) => {\n const next: Record<string, RootView> = { ...selection.getSnapshot() }\n if (root === 'primary') delete next[tabId]\n else next[tabId] = root\n selection.set(next)\n },\n takeover: {\n signal: (tabId, root, section) => {\n let held = takeovers.get(tabId)\n if (held === undefined || held.root !== root || held.controller.signal.aborted) {\n held?.observer?.disconnect()\n held?.controller.abort()\n held = { controller: new AbortController(), root, section: undefined, observer: undefined }\n takeovers.set(tabId, held)\n }\n // The section watch lives at this scope, not the caller's: a body\n // that unmounted cannot run another cleanup, but the record may\n // still end — closing an already-hidden tab removes the section —\n // and only an observer outliving the body sees that.\n if (section !== undefined && held.section !== section) {\n held.section = section\n held.observer?.disconnect()\n held.observer = new MutationObserver(() => {\n if (!section.isConnected) endTakeover(tabId)\n })\n held.observer.observe(document, { childList: true, subtree: true })\n }\n if (held.section !== undefined && !held.section.isConnected) endTakeover(tabId)\n return held.controller.signal\n },\n end: endTakeover,\n },\n }\n }\n return { store, inject }\n}\n\n/**\n * Assemble the props `RootSwitcher` portals into `FilesTree`, or `undefined`\n * when this composition cannot render the fork — the caller then keeps the\n * additional-root rows out of the menu entirely, which is the same absence\n * upstream produces when its own tree cannot draw.\n * @param props - the occupant's composed props (store, inject, session shares).\n * @param t - the `sidebarFiles`-bound translate.\n * @returns the stable surface, or `undefined` when the fork cannot mount.\n */\nexport function createFilesTreeSurface(\n props: {\n readonly sessionId: SessionId\n readonly useStore: FilesTreeSurface['useStore']\n readonly actions: FilesTreeSurface['actions']\n readonly face: FilesInjected | undefined\n readonly openFile: ((address: string) => void) | undefined\n readonly useTreeSelection: FilesTreeSurface['useTreeSelection'] | undefined\n readonly selectRoot: FilesTreeSurface['selectRoot'] | undefined\n readonly takeover: FilesTreeSurface['takeover'] | undefined\n },\n t: FilesTreeProps['t'],\n): FilesTreeSurface | undefined {\n if (!filesTreeSurfaceSupported()) return undefined\n const { sessionId, useStore, actions, face, openFile, useTreeSelection, selectRoot, takeover } = props\n if (face === undefined || openFile === undefined || useStore === undefined || actions === undefined\n || useTreeSelection === undefined || selectRoot === undefined || takeover === undefined) return undefined\n return { sessionId, useStore, actions, face, openFile, useTreeSelection, selectRoot, takeover, t }\n}\n\nexport { filesTreeSurfaceSupported, NS as FILES_TREE_NS }\nexport { FilesTree } from './FilesTree.tsx'\n","/**\n * Route paths and wire payloads shared verbatim by the host routes and the\n * browser package (`@deepseek-ai/dsh-client-ui-open-in-app`), published as\n * the `./shared` subpath. Browser-safe: constants and types only. Each route\n * carries the absolute pathname the Host registers beside the\n * document-relative form the browser addresses; see\n * .agents/notes/implemented/architecture/2026-09-14-web-document-relative-app-routes.md.\n */\n/** GET route path serving the probed application ids. */\nexport const OPEN_IN_APP_APPS_PATH = '/open-in-app/apps';\n/** Browser-relative form of {@link OPEN_IN_APP_APPS_PATH}. */\nexport const OPEN_IN_APP_APPS_ROUTE = OPEN_IN_APP_APPS_PATH.slice(1);\n/** GET prefix path serving one PNG bundle icon per application id. */\nexport const OPEN_IN_APP_ICON_PREFIX_PATH = '/open-in-app/icon';\n/** Browser-relative form of {@link OPEN_IN_APP_ICON_PREFIX_PATH}. */\nexport const OPEN_IN_APP_ICON_PREFIX_ROUTE = OPEN_IN_APP_ICON_PREFIX_PATH.slice(1);\n/** POST route path launching one application on one workspace directory. */\nexport const OPEN_IN_APP_OPEN_PATH = '/open-in-app/open';\n/** Browser-relative form of {@link OPEN_IN_APP_OPEN_PATH}. */\nexport const OPEN_IN_APP_OPEN_ROUTE = OPEN_IN_APP_OPEN_PATH.slice(1);\n//# sourceMappingURL=shared.js.map","/**\n * Compatibility adapter for the route constants of\n * `@deepseek-ai/dsh-host-open-in-app/shared`.\n *\n * ```text\n * 0.1.5-rc.2 / 0.1.6 OPEN_IN_APP_ICON_PREFIX = '/open-in-app/icon' (absolute pathname)\n * 0.1.7-alpha.1 + OPEN_IN_APP_ICON_PREFIX_ROUTE = 'open-in-app/icon' (document-relative)\n * ```\n *\n * `0.1.7-alpha.1` split every shared route constant into a `*_PATH` spelling\n * the Host registers and a `*_ROUTE` spelling the browser addresses, retiring\n * the old names. The fork's `iconUrl` needs the browser-facing form — which a\n * pixel-era release spells without the `_ROUTE` suffix, so a named import of\n * the new name does not even BUILD against those manifests (MISSING_EXPORT at\n * bundle time, not a runtime undefined). The lookup is by export name, not by\n * release string.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/compat/open-in-app-routes\n */\n\nimport * as shared from '@deepseek-ai/dsh-host-open-in-app/shared'\n\n/** Exports addressed by name. A release spells each route exactly one way. */\ntype SharedModule = Readonly<Record<string, string | undefined>>\n\n/**\n * The installed shared module, addressed by export name.\n *\n * Named imports cannot spell both eras: each name is absent from the other\n * era's declaration, so the compiler is told once, here.\n */\nconst installed = shared as unknown as SharedModule\n\n/**\n * Pick the first export name this release actually provides.\n * @param module - the shared module to read.\n * @param names - candidate export names, preferred first.\n * @returns the route string.\n * @throws {Error} when none of the names is exported. That is a compatibility\n * break to adapt here, not a missing optional peer.\n */\nexport function selectSharedRoute(module: SharedModule, names: readonly string[]): string {\n for (const name of names) {\n const found = module[name]\n if (found !== undefined) return found\n }\n throw new Error(\n 'multi-root workspace: @deepseek-ai/dsh-host-open-in-app/shared exports none of '\n + `${names.join(', ')}; the open-in-app fork cannot address its icon route. `\n + 'Adapt src/compat/open-in-app-routes.ts to the installed release.',\n )\n}\n\n/**\n * The browser-facing icon-prefix route, whichever spelling this release\n * exports. Resolved once at module load: the fork's adapter only reaches\n * `iconUrl` on runtimes whose glyph gate already passed, and on the pixel era\n * the absolute form is exactly what upstream's own client fetched.\n */\nexport const OPEN_IN_APP_ICON_URL_PREFIX = selectSharedRoute(installed, [\n 'OPEN_IN_APP_ICON_PREFIX_ROUTE',\n 'OPEN_IN_APP_ICON_PREFIX',\n])\n","/** Nameable application ids shared by the button and its keyboard command. */\nimport type { OpenInAppKey } from './locales.ts'\n\n/** Label keys for applications supported by this client. */\nexport const APP_LABEL_KEY: Record<string, OpenInAppKey | undefined> = {\n finder: 'app.finder',\n explorer: 'app.explorer',\n filemanager: 'app.filemanager',\n cursor: 'app.cursor',\n vscode: 'app.vscode',\n vscodeinsiders: 'app.vscodeinsiders',\n windsurf: 'app.windsurf',\n zed: 'app.zed',\n sublimetext: 'app.sublimetext',\n xcode: 'app.xcode',\n androidstudio: 'app.androidstudio',\n intellij: 'app.intellij',\n pycharm: 'app.pycharm',\n webstorm: 'app.webstorm',\n phpstorm: 'app.phpstorm',\n goland: 'app.goland',\n rider: 'app.rider',\n rustrover: 'app.rustrover',\n fork: 'app.fork',\n sourcetree: 'app.sourcetree',\n github: 'app.github',\n tower: 'app.tower',\n gitkraken: 'app.gitkraken',\n smartgit: 'app.smartgit',\n sublimemerge: 'app.sublimemerge',\n ghostty: 'app.ghostty',\n warp: 'app.warp',\n iterm: 'app.iterm',\n kitty: 'app.kitty',\n terminal: 'app.terminal',\n windowsterminal: 'app.windowsterminal',\n gitbash: 'app.gitbash',\n gnometerminal: 'app.gnometerminal',\n konsole: 'app.konsole',\n}\n","/** Browser availability/choice state and the launch carrier for the split button. */\n\nimport { createSnapshotStore, type SnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport {\n OPEN_IN_APP_APPS_ROUTE, OPEN_IN_APP_OPEN_ROUTE,\n type OpenInAppAppsPayload, type OpenInAppOpenPayload,\n} from '@deepseek-ai/dsh-host-open-in-app/shared'\n\nimport { APP_LABEL_KEY } from './applications.ts'\nimport type { OpenInAppOutcome } from './outcome.ts'\n\n/** Shared launch status for controls targeting the captured workspace path. */\nexport interface OpenInAppLaunchState {\n readonly phase: 'idle' | 'busy' | 'error'\n readonly path: string | null\n}\n\ntype Fetch = (input: string | URL, init?: RequestInit) => Promise<Response>\n\n/**\n * Owns the once-per-page availability read, the persisted last choice, and\n * the launch POST. Availability and choice publish through uSES-safe sources\n * so every Session header shares one truth.\n */\nexport class OpenInAppController {\n /** Installed app ids in host menu order; null until the host answered. */\n readonly apps: SnapshotStore<readonly string[] | null> = createSnapshotStore<readonly string[] | null>(null)\n /** Last chosen app id, or empty before the first choice, shared across sessions and browser restarts. */\n readonly choice: SnapshotStore<string> = createSnapshotStore<string>('', {\n persist: { name: 'dsh.open-in-app.choice' },\n })\n\n /** Current launch, shared by pointer and keyboard gestures. */\n readonly operation = createSnapshotStore<OpenInAppLaunchState>({ phase: 'idle', path: null })\n\n /**\n * Resolve the remembered nameable installed application, with the button's first-app fallback.\n * @returns the installed app id, or undefined while unavailable.\n */\n currentApp(): string | undefined {\n const apps = (this.apps.getSnapshot() ?? []).filter(id => APP_LABEL_KEY[id] !== undefined)\n const choice = this.choice.getSnapshot()\n return apps.includes(choice) ? choice : apps[0]\n }\n\n private loading: Promise<void> | undefined\n\n /**\n * @param fetcher - HTTP carrier for the apps read and the launch POST.\n */\n constructor(private readonly fetcher: Fetch = (input, init) => fetch(input, init)) {}\n\n /**\n * Read availability once per controller life; concurrent calls share the read.\n * A failed read publishes an empty list, which renders no button at all.\n * @returns after availability is published.\n */\n load(): Promise<void> {\n this.loading ??= this.run()\n return this.loading\n }\n\n /**\n * Remember one picked app id.\n * @param appId - catalog id from the availability list.\n */\n choose(appId: string): void {\n if (this.operation.getSnapshot().phase !== 'busy') this.choice.set(appId)\n }\n\n /**\n * Launch one installed app on a workspace directory.\n * @param appId - catalog id from the availability list.\n * @param path - the session's absolute workspace directory.\n * Concurrent gestures are ignored until the current Host request settles.\n * @returns the acknowledged handoff, or `{ kind: 'skipped' }` while another\n * launch holds the operation, or a named failure when the Host refuses or\n * cannot be reached. Host and transport failures resolve without rejecting.\n */\n async launch(appId: string, path: string): Promise<OpenInAppOutcome> {\n if (this.operation.getSnapshot().phase === 'busy') return { kind: 'skipped' }\n this.operation.set({ phase: 'busy', path })\n const body: OpenInAppOpenPayload = { app: appId, path }\n try {\n const response = await this.fetcher(OPEN_IN_APP_OPEN_ROUTE, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(body),\n })\n if (!response.ok) throw new Error(`open failed: HTTP ${String(response.status)}`)\n this.operation.set({ phase: 'idle', path })\n return { kind: 'opened' }\n } catch (_error) {\n // Refusal and transport failure share the same user-visible outcome.\n this.operation.set({ phase: 'error', path })\n return { kind: 'failed', failure: 'openError' }\n }\n }\n\n private async run(): Promise<void> {\n let apps: readonly string[] = []\n try {\n const response = await this.fetcher(OPEN_IN_APP_APPS_ROUTE, {\n headers: { accept: 'application/json' },\n })\n if (response.ok) {\n const payload = await response.json() as OpenInAppAppsPayload\n if (Array.isArray(payload.apps)) apps = payload.apps.filter(id => typeof id === 'string')\n }\n } catch {\n // Swallows network failures: an unreachable host reads as no apps, and\n // the header simply shows no button rather than a broken one.\n }\n this.apps.set(apps)\n }\n}\n","/**\n * Fork-facing shim for upstream `ui-open-in-app/src/client/locales.ts`.\n *\n * Upstream's dictionaries stay upstream's: the runtime `open-in-app`\n * namespace is already registered by `@deepseek-ai/dsh-client-ui-open-in-app`\n * in every composition where the open-in-app feature exists, and this\n * plugin binds that same namespace instead of registering a second copy\n * (`locale.register` throws on a duplicate locale inside one namespace).\n * What the forked components still need from this file is the namespace\n * name and the key domain for `TranslateNS<typeof NS>` — copied verbatim\n * from upstream. When upstream edits copy, the string values follow\n * automatically; only a NEW key requires extending the union below.\n *\n * Sync: `OpenInAppKey` must equal `keyof typeof zh` in upstream's\n * `locales.ts`. See FORK.md.\n */\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\n\n/** Dictionary namespace owned by upstream's plugin (verbatim). */\nexport const NS = 'open-in-app'\n\n/** Key domain of the `open-in-app` namespace (verbatim union of upstream's zh keys). */\nexport type OpenInAppKey =\n | 'open.title'\n | 'path.appDefault'\n | 'path.appsError'\n | 'shortcut.busy'\n | 'shortcut.unavailable'\n | 'open.tooltip'\n | 'path.open'\n | 'path.more'\n | 'path.reveal'\n | 'path.opened'\n | 'path.revealed'\n | 'path.openError'\n | 'path.revealError'\n | 'app.cursor'\n | 'app.vscode'\n | 'app.vscodeinsiders'\n | 'app.windsurf'\n | 'app.zed'\n | 'app.sublimetext'\n | 'app.xcode'\n | 'app.androidstudio'\n | 'app.intellij'\n | 'app.pycharm'\n | 'app.webstorm'\n | 'app.phpstorm'\n | 'app.goland'\n | 'app.rider'\n | 'app.rustrover'\n | 'app.fork'\n | 'app.sourcetree'\n | 'app.github'\n | 'app.tower'\n | 'app.gitkraken'\n | 'app.smartgit'\n | 'app.sublimemerge'\n | 'app.ghostty'\n | 'app.warp'\n | 'app.iterm'\n | 'app.kitty'\n | 'app.terminal'\n | 'app.windowsterminal'\n | 'app.gitbash'\n | 'app.gnometerminal'\n | 'app.konsole'\n | 'app.finder'\n | 'app.explorer'\n | 'app.filemanager'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Session-header \"open workspace in application\" copy (upstream declaration). */\n 'open-in-app': OpenInAppKey\n }\n}\n","/**\n * Fork-facing shim for upstream `OpenTargetButton.module.css`.\n *\n * This plugin's bundle has no CSS-module pipeline: the `<style>` element it\n * installs carries one flat sheet (`src/client/styles.ts`). The upstream\n * component reads `css.<name>` so the forked file needs one importable\n * module exporting that same key map — this file, reached through the\n * verbatim `./OpenTargetButton.module.css.ts` specifier (the one sanctioned\n * fork edit: the specifier gains the `.ts` this toolchain resolves\n * everywhere — tsc, tsdown, vitest). The specifier text is spelled without\n * its `import` clause on purpose: the packed-artifact check scans every\n * bundle comment too, and quoting the full statement would read as a\n * relative import the tarball does not carry.\n *\n * Each upstream local class maps to an `mrfw-open*` name so the copied\n * rules cannot collide with host DOM; the rules themselves live in\n * styles.ts verbatim apart from that rename. `data-open-target` and the\n * other data attributes are literals in the component and stay byte-exact.\n * See FORK.md.\n */\n\nconst css = {\n menuAnchor: 'mrfw-openMenuAnchor',\n split: 'mrfw-openSplit',\n main: 'mrfw-openMain',\n chevron: 'mrfw-openChevron',\n appIcon: 'mrfw-openAppIcon',\n skeleton: 'mrfw-openSkeleton',\n} as const\n\nexport default css\n","/** Shared file and directory opener: one default action, application menu, and one reported outcome per gesture. */\nimport { useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport {\n IconChevronDownOutlineRegular, IconFolderOpenOutlineRegular, IconRightUpOutlineRegular, Menu, Tooltip,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ShortcutCatalogEntry } from '@deepseek-ai/dsh-client-shortcuts/client'\nimport type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { OpenInAppOutcome } from './outcome.ts'\nimport type { NS } from './locales.ts'\nimport css from './OpenTargetButton.module.css.ts'\n\n/** Application metadata supplied by either the directory catalog or a file association query. */\nexport interface OpenTargetApplication {\n readonly id: string\n readonly name: string\n readonly icon: string | null\n}\n\n/** Opening intent; default selection remains owned by the target's adapter. */\nexport type OpenTargetOperation = { readonly kind: 'default' } | { readonly kind: 'application'; readonly id: string } | { readonly kind: 'reveal' }\n\n/** Seat a contribution sends one settled gesture to for app-wide announcement. */\nexport interface OpenTargetReporter {\n /** Report the settled outcome; `{ kind: 'skipped' }` announces nothing. */\n readonly report: (outcome: OpenInAppOutcome) => void\n}\n\n/** Inputs shared by both target adapters and the file empty-state action. */\nexport interface OpenTargetButtonProps extends OpenTargetReporter {\n readonly shortcut?: Pick<ShortcutCatalogEntry, 'keys' | 'aria'> | undefined\n readonly kind: 'file' | 'directory'\n readonly applications: readonly OpenTargetApplication[]\n readonly defaultId: string | undefined\n readonly failed: boolean\n readonly busy?: boolean\n readonly loading?: boolean\n readonly prominent?: boolean\n readonly t: TranslateNS<typeof NS>\n /** Resolve every gesture to an outcome, including Host and transport failures; never reject. */\n readonly execute: (operation: OpenTargetOperation) => Promise<OpenInAppOutcome>\n readonly refresh?: () => void\n}\n\n/**\n * Serialize gestures and report the outcome each one settles on to the app-wide\n * announcer, which outlives this control and the panel holding it.\n * @param execute - target adapter that settles on the gesture's outcome.\n * @param report - announcement seat the settled outcome is sent to.\n * @returns the pending state and the guarded action callback.\n */\nexport function useOpenTargetGesture(\n execute: OpenTargetButtonProps['execute'], report: OpenTargetButtonProps['report'],\n): {\n pending: boolean\n act: (operation: OpenTargetOperation) => void\n} {\n const [pending, setPending] = useState(false)\n const inFlight = useRef(false)\n return {\n pending,\n act: (operation) => {\n if (inFlight.current) return\n inFlight.current = true\n setPending(true)\n void execute(operation).then(report).finally(() => { inFlight.current = false; setPending(false) })\n },\n }\n}\n\n/** One application image with a per-image fallback, shared by main and menu buttons. */\nfunction ApplicationIcon({ source, size = 14 }: { source: string | null; size?: number }): ReactNode {\n const [failed, setFailed] = useState(false)\n return source === null || failed\n ? <IconRightUpOutlineRegular size={size} />\n : <img src={source} width={size} height={size} className={css.appIcon} alt=\"\" draggable={false} onError={() => { setFailed(true) }} />\n}\n\n/**\n * Render identical split buttons for files and directories. File reveal always\n * stays last; it is the default only when no application is registered.\n * @param props - target applications, default selection, and operations.\n * @returns the control alone: its settled outcomes are announced by the seat it reports to.\n */\nexport function OpenTargetButton(props: OpenTargetButtonProps): ReactNode {\n const { applications, defaultId, kind, t } = props\n const [menuOpen, setMenuOpen] = useState(false)\n const { pending, act } = useOpenTargetGesture(props.execute, props.report)\n // Files open through an application whenever one is registered: the OS-marked\n // default when the Host reported one, else the first entry in the Shell's\n // preference order. Reveal is only promoted with no registered application, so\n // a missing default marker never hides the applications behind it.\n const preferred = kind === 'file'\n ? applications.find(app => app.id === defaultId) ?? applications[0]\n : applications.find(app => app.id === defaultId)\n const disabled = pending || props.busy === true || props.loading === true\n const hasMenu = props.loading === true || props.failed || applications.length + (kind === 'file' ? 1 : 0) > 1\n const revealDefault = kind === 'file' && preferred === undefined && props.loading !== true\n const primaryLabel = preferred === undefined ? t('path.reveal') : t('open.title', { app: preferred.name })\n const run = (operation: OpenTargetOperation): void => { setMenuOpen(false); act(operation) }\n const primary = (): void => {\n if (revealDefault) { run({ kind: 'reveal' }); return }\n // The Host's default marker is best effort. With none, request the application\n // this control names instead of letting the OS resolve the association again.\n if (preferred !== undefined && preferred.id !== defaultId) { run({ kind: 'application', id: preferred.id }); return }\n run({ kind: 'default' })\n }\n const icon = props.loading === true && preferred === undefined\n ? <span className={css.skeleton} data-open-target-skeleton aria-hidden=\"true\" style={{ width: props.prominent ? 18 : 13, height: props.prominent ? 18 : 13 }} />\n : revealDefault\n ? <IconFolderOpenOutlineRegular size={props.prominent ? 18 : 13} />\n : <ApplicationIcon key={preferred?.icon} source={preferred?.icon ?? null} size={props.prominent ? 18 : 13} />\n return (\n <Menu\n className={css.menuAnchor}\n open={menuOpen && !disabled && hasMenu}\n autoFocus\n portal\n dense\n align=\"end\"\n onClose={() => { setMenuOpen(false) }}\n items={[\n ...applications.map(app => ({\n id: `app:${app.id}`,\n icon: <ApplicationIcon key={app.icon} source={app.icon} />,\n label: app.id === preferred?.id ? t('path.appDefault', { app: app.name }) : app.name,\n })),\n ...(props.failed ? [{ id: 'unavailable', label: t('path.appsError'), disabled: true }] : []),\n ]}\n footer={kind === 'file' ? [{\n id: 'reveal', icon: <IconFolderOpenOutlineRegular />,\n label: revealDefault ? t('path.appDefault', { app: t('path.reveal') }) : t('path.reveal'),\n }] : []}\n onSelect={(id) => { run(id === 'reveal' ? { kind: 'reveal' } : { kind: 'application', id: id.slice(4) }) }}\n anchor={(\n <div className={css.split} data-open-target={kind} data-size={props.prominent ? 'large' : 'compact'}\n data-open-path={kind === 'file' && !props.prominent ? '' : undefined} data-state={disabled ? 'busy' : 'idle'}>\n <Tooltip portal label={primaryLabel} shortcutKeys={props.shortcut?.keys} side=\"bottom\" delayMs={500}>\n <button type=\"button\" className={css.main} disabled={disabled} aria-label={props.prominent ? undefined : primaryLabel}\n aria-keyshortcuts={props.shortcut?.aria}\n data-open-path-open={kind === 'file' && !props.prominent ? '' : undefined}\n data-open-path-unpreviewable={props.prominent ? '' : undefined} onClick={primary}>\n {icon}{(props.prominent) && (revealDefault ? t('path.reveal') : t('path.open'))}\n </button>\n </Tooltip>\n {hasMenu && <button\n type=\"button\" className={css.chevron} disabled={disabled}\n aria-haspopup=\"menu\" aria-expanded={menuOpen && !disabled} aria-label={t('path.more')}\n data-open-path-more={kind === 'file' && !props.prominent ? '' : undefined}\n onClick={() => {\n if (!menuOpen) props.refresh?.()\n setMenuOpen(value => !value)\n }}\n >\n <IconChevronDownOutlineRegular size={props.prominent ? 14 : 10} />\n </button>}\n </div>\n )}\n />\n )\n}\n","import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport { APP_LABEL_KEY } from './applications.ts'\nimport type { OpenInAppLaunchState } from './controller.ts'\nimport type { OpenInAppOutcome } from './outcome.ts'\nimport type { ShortcutCatalogEntry } from '@deepseek-ai/dsh-client-shortcuts/client'\nimport { NS } from './locales.ts'\nimport { OpenTargetButton, type OpenTargetReporter } from './OpenTargetButton.tsx'\n\n/** Browser operations and state shared by the Session header and file tree contributions. */\nexport interface OpenInAppActionInjected extends OpenTargetReporter {\n hooks: {\n openInAppApps: ObservableSnapshot<readonly string[] | null>\n openInAppChoice: ObservableSnapshot<string>\n openInAppLaunch: ObservableSnapshot<OpenInAppLaunchState>\n shortcuts: ObservableSnapshot<readonly ShortcutCatalogEntry[]>\n }\n launch: (appId: string, path: string) => Promise<OpenInAppOutcome>\n choose: (appId: string) => void\n iconUrl: (appId: string) => string\n}\n\n/** Directory path, installed applications, and launch operations for the split button. */\nexport type OpenInAppActionProps =\n PropsLocale<typeof NS>\n & InjectFace<OpenInAppActionInjected>\n & { absolutePath: string }\n\n/**\n * Adapt the installed directory catalog to the shared opening control.\n * @param props - displayed directory, installed catalog, launch operations, and the announcement seat.\n * @returns the shared control, or null without an eligible application.\n */\nexport function OpenInAppAction(props: OpenInAppActionProps): React.JSX.Element | null {\n const { absolutePath, useOpenInAppApps, useOpenInAppChoice, t } = props\n const available = useOpenInAppApps(apps => apps)\n const choice = useOpenInAppChoice(id => id)\n const operation = props.useOpenInAppLaunch(value => value)\n const shortcut = props.useShortcuts(rows => rows.find(row => row.id === 'workspace.openLocal'))\n const apps = (available ?? []).flatMap((id) => {\n const key = APP_LABEL_KEY[id]\n return key === undefined ? [] : [{ id, name: t(key), icon: props.iconUrl(id) }]\n })\n const preferred = apps.find(app => app.id === choice) ?? apps[0]\n if (preferred === undefined) return null\n return (\n <OpenTargetButton\n key={absolutePath} kind=\"directory\" applications={apps} defaultId={preferred.id} failed={false} t={t}\n busy={operation.phase === 'busy'} shortcut={shortcut} report={props.report}\n execute={async (operation) => {\n const id = operation.kind === 'application' ? operation.id : preferred.id\n const outcome = await props.launch(id, absolutePath)\n if (outcome.kind === 'opened' && operation.kind === 'application') props.choose(id)\n return outcome\n }}\n />\n )\n}\n","/**\n * Compatibility adapter for `isMobileDevice` from\n * `@deepseek-ai/dsh-client-ui-primitives`.\n *\n * ```text\n * 0.1.5-rc.2 through 0.2.1-rc.5 no `isMobileDevice` export\n * 0.2.2-alpha.2 + `isMobileDevice` exported\n * ```\n *\n * The open-in-app fork's verbatim `open-toast.tsx` spells the detector as a\n * primitives import — a name absent before `0.2.2-alpha.2` — so the lookup\n * is by export name, not by release string (the `client-icons.ts` pattern).\n * An older runtime falls back to upstream's identical detection: mobile\n * userAgent, or a touch-capable MacIntel platform, memoized like upstream's.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/compat/open-in-app-device\n */\n\nimport * as primitives from '@deepseek-ai/dsh-client-ui-primitives'\n\n/**\n * The DOM `navigator`, declared at module scope so this file still\n * typechecks under `tsconfig.host.json`, which compiles every `src/compat/`\n * file with no DOM lib. Module-scoped and type-only: it emits nothing, and\n * at run time the name resolves to the real global.\n */\ndeclare const navigator: {\n readonly userAgent: string\n readonly platform: string\n readonly maxTouchPoints: number\n}\n\n/** The primitives module, addressed by export name. */\nconst installed = primitives as unknown as { readonly isMobileDevice?: unknown }\n\n/** Upstream's own detector when the installed release carries it (verbatim logic below otherwise). */\nconst upstream = typeof installed.isMobileDevice === 'function'\n ? installed.isMobileDevice as () => boolean\n : undefined\n\nlet fallbackResult: boolean | undefined\n\n/**\n * Whether this browser is a mobile device — upstream's detection verbatim.\n * @returns true for a mobile userAgent or a touch-capable macOS surface.\n */\nfunction isMobileDeviceFallback(): boolean {\n fallbackResult ??= /Android|iPhone|iPad|iPod/i.test(navigator.userAgent)\n || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)\n return fallbackResult\n}\n\n/**\n * Resolve the installed release's `isMobileDevice`, or the identical local\n * fallback on releases that predate the export.\n * @returns the mobile-device verdict.\n */\nexport function isMobileDevice(): boolean {\n return upstream === undefined ? isMobileDeviceFallback() : upstream()\n}\n","/** Native-open feedback that survives the initiating panel: mobile success and all failures. */\nimport type { ReactNode } from 'react'\nimport { createSnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport { IconWarningOutlineRegular, Toast } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { HostObservable, InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { isMobileDevice } from './device.ts'\nimport { NS } from './locales.ts'\nimport type { OpenInAppOutcome } from './outcome.ts'\n\n/** One announced gesture; `seq` keys the banner so a repeat restarts it. */\nexport type OpenInAppToastState = Exclude<OpenInAppOutcome, { kind: 'skipped' }> & { readonly seq: number }\n\n/** Store every contribution reports into and the overlay entry reads. */\nexport interface OpenInAppToastSource {\n /** Current notice for the overlay entry, or null while none shows. */\n readonly hooks: { readonly toast: HostObservable<OpenInAppToastState | null> }\n /**\n * Announce failures on every device and acknowledged opens or reveals on mobile.\n * Desktop successes and skipped gestures leave the current notice unchanged.\n * @param outcome - settled native-open result.\n */\n readonly report: (outcome: OpenInAppOutcome) => void\n /** Clear the shown notice. */\n readonly dismiss: () => void\n}\n\n/**\n * Create the one outcome store the overlay entry shows.\n * @returns the observable notice with its report and dismiss actions.\n */\nexport function createOpenInAppToastSource(): OpenInAppToastSource {\n const store = createSnapshotStore<OpenInAppToastState | null>(null)\n let seq = 0\n return {\n hooks: { toast: store },\n report: (outcome) => {\n if (outcome.kind === 'skipped') return\n if (outcome.kind !== 'failed' && !isMobileDevice()) return\n seq += 1\n store.set({ ...outcome, seq })\n },\n dismiss: () => { store.set(null) },\n }\n}\n\n/** Props of the `shell.overlay` entry: the notice store, its dismissal, and localized copy. */\nexport type OpenInAppToastProps = PropsRuntime<'shell.overlay'>\n & PropsLocale<typeof NS>\n & InjectFace<Omit<OpenInAppToastSource, 'report'>>\n\n/**\n * Render a mobile handoff confirmation or a native-open failure.\n * @param props - the notice hook, its dismissal, and the locale seat.\n * @returns the banner on display, or null.\n */\nexport function OpenInAppToast({ useToast, dismiss, t }: OpenInAppToastProps): ReactNode {\n const toast = useToast(current => current)\n if (toast === null) return null\n const key = `open-in-app-${String(toast.seq)}`\n if (toast.kind === 'failed') {\n return <Toast key={key} text={t(toast.failure === 'revealError' ? 'path.revealError' : 'path.openError')}\n icon={<IconWarningOutlineRegular />} onDone={dismiss} />\n }\n return <Toast key={key} text={t(toast.kind === 'opened' ? 'path.opened' : 'path.revealed')} tone=\"success\" onDone={dismiss} />\n}\n","/**\n * The plugin-owned wiring around the verbatim open-in-app fork.\n *\n * Upstream builds the same props in its `apply` (`directoryInjected`): one\n * controller per page, its SnapshotStores bound by the slot renderer into\n * `use*` props, and a `t` bound to the `open-in-app` namespace. This module\n * reproduces exactly that — minus slot machinery the fork never sees —\n * plus the two degradations only a fork needs:\n *\n * - the glyph set the fork spells is the `*Regular` family (0.1.7+); a\n * pixel-name runtime (0.1.5/0.1.6) leaves the adapter undefined, so the\n * header simply keeps the native button, mirroring upstream's own\n * \"no apps → no button\" absence;\n * - `ctx.locale.bind('open-in-app')` consumes upstream's registered\n * dictionary verbatim — same strings, upstream's updates included;\n * - the icon route comes through `compat/open-in-app-routes`: the `*_ROUTE`\n * spelling is another 0.1.7+ name, so the constant is probed by export\n * name rather than imported (a pixel-era manifest lacks it entirely —\n * a named import would fail the bundle's own build).\n *\n * Everything here is ours; nothing in this file needs upstream sync.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/open-in-app/adapter\n */\n\nimport { useSyncExternalStore } from 'react'\nimport type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { ShortcutCatalogEntry } from '@deepseek-ai/dsh-client-shortcuts/client'\nimport { maybeIcon } from '../../compat/client-icons.ts'\nimport { OPEN_IN_APP_ICON_URL_PREFIX } from '../../compat/open-in-app-routes.ts'\nimport { OpenInAppController } from './controller.ts'\nimport { OpenInAppAction, type OpenInAppActionProps } from './OpenInAppAction.tsx'\nimport { createOpenInAppToastSource, type OpenInAppToastSource } from './open-toast.tsx'\nimport { NS } from './locales.ts'\n\n/**\n * The props `OpenInAppAction` consumes, minus the per-render `absolutePath`\n * the switcher supplies — the shape upstream's `directoryInjected` returns.\n */\nexport type OpenInAppAdapter = Omit<OpenInAppActionProps, 'absolutePath'>\n\n/**\n * Turn one observable into the renderer-bound `use*` prop shape:\n * `useSyncExternalStore` under the hood, exactly like the slot renderer's\n * own binding. Built once per store so `subscribe` stays referentially\n * stable across renders.\n * @param source - the observable to bind.\n * @returns the bound selector hook.\n */\nfunction bindSnapshot<S>(source: ObservableSnapshot<S>): <T>(selector: (snapshot: S) => T) => T {\n const subscribe = (listener: () => void): (() => void) => source.subscribe(listener)\n const getSnapshot = (): S => source.getSnapshot()\n return function useBound<T>(selector: (snapshot: S) => T): T {\n return useSyncExternalStore(subscribe, () => selector(getSnapshot()))\n }\n}\n\n/** Glyphs the forked components spell verbatim — all `*Regular`, all probed. */\nconst REQUIRED_GLYPHS = [\n 'IconChevronDownOutlineRegular',\n 'IconRightUpOutlineRegular',\n 'IconFolderOpenOutlineRegular',\n 'IconWarningOutlineRegular',\n] as const\n\n/** The empty catalog stand-in when the composition carries no shortcuts service. */\nconst NO_SHORTCUTS: ObservableSnapshot<readonly ShortcutCatalogEntry[]> = {\n getSnapshot: () => [],\n subscribe: () => () => {},\n}\n\n/**\n * Build the open-in-app props upstream hands its own registration.\n * @param deps - the namespace-bound translate for `open-in-app`, and the\n * composition's shortcuts catalog when it exists.\n * @returns the adapter, or `undefined` when this runtime cannot render the\n * fork (pixel-era icon names — the forked files would crash on missing\n * exports, so absence mirrors upstream's own no-button path).\n */\nexport function createOpenInAppAdapter(deps: {\n readonly t: (key: string, params?: Record<string, unknown>) => string\n readonly shortcuts?: ObservableSnapshot<readonly ShortcutCatalogEntry[]> | undefined\n}): { readonly adapter: OpenInAppAdapter; readonly toast: OpenInAppToastSource } | undefined {\n if (!REQUIRED_GLYPHS.every(name => maybeIcon([name]) !== undefined)) return undefined\n const controller = new OpenInAppController()\n void controller.load()\n // Gesture feedback outlives the switcher panel that initiated it, exactly\n // like upstream's own `shell.overlay` announcement seat.\n const toast = createOpenInAppToastSource()\n return {\n toast,\n adapter: {\n useOpenInAppApps: bindSnapshot(controller.apps),\n useOpenInAppChoice: bindSnapshot(controller.choice),\n useOpenInAppLaunch: bindSnapshot(controller.operation),\n useShortcuts: bindSnapshot(deps.shortcuts ?? NO_SHORTCUTS),\n launch: (appId, path) => controller.launch(appId, path),\n report: toast.report,\n choose: (appId) => { controller.choose(appId) },\n iconUrl: appId => `${OPEN_IN_APP_ICON_URL_PREFIX}/${appId}`,\n t: deps.t as OpenInAppActionProps['t'],\n },\n }\n}\n\nexport { OpenInAppAction, NS as OPEN_IN_APP_NS }\n","/**\n * The Workspace Folders panel: one sidebar footer action that opens a dialog\n * listing this session's workspace root and the additional roots registered for\n * it, with the actions the milestone requires — Add (through the composed\n * directory picker), Remove, Alias, Copy Path, and Reveal.\n *\n * Why a footer action and its own dialog, instead of a first-class panel: the\n * slots that can host a full panel (`sidebar.panellist` + the keyed `main`\n * panel) exist only in the pinned 0.1.5 surface, while `sidebar.footer.action`\n * exists in both supported runtimes — and `sidebar.workspaces` is a single slot\n * already owned by the workspace browser, so it cannot be extended in place.\n *\n * Styling is the host's, not this file's: the elements carry `mrfw-*` classes\n * resolved by the stylesheet the client entry injects (`styles.ts`), and every\n * color in that sheet is a host `--dsw-*` token, so the panel inherits the\n * native look — sidebar trigger, modal card, capsule buttons — in both themes\n * without naming a single color here (see ADR-0006).\n *\n * The dialog itself is also exported: the Files-tab root switcher opens the\n * same manager through its trailing menu item instead of carrying a second\n * dialog.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/WorkspaceFoldersAction\n */\n\nimport { useCallback, useEffect, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from 'react'\nimport { Menu, Modal } from '@deepseek-ai/dsh-client-ui-primitives'\nimport {\n IconAccessInherit,\n IconAccessReadOnly,\n IconAccessReadWrite,\n IconChevronDown,\n IconChevronUp,\n IconCopy,\n IconEdit,\n IconEllipsis,\n IconFolderOpen,\n IconPlus,\n IconRefresh,\n IconSettings,\n IconTrash,\n} from '../compat/client-icons.ts'\nimport { errorKeyOf, PanelError, type PanelClient } from './panel-client.ts'\nimport type { Key } from './locales.ts'\nimport type { RootAccess, RootEntryView, RootState, RootView, RootsView } from '../contract.ts'\n\n/** Translate one key of this plugin's namespace. */\nexport type Translate = (key: Key, params?: Record<string, unknown>) => string\n\n/** What the registered action receives from the plugin body. */\nexport interface WorkspaceFoldersActionProps {\n /** The channel client; absent when this composition has no host Connection. */\n readonly panel: PanelClient | undefined\n /** Opens the composed directory picker, when one is composed. */\n readonly pickDirectory: (() => Promise<string | null>) | undefined\n /** Bound translator for this plugin's namespace. */\n readonly t: Translate\n /**\n * The current session id, read when a request is built. A function rather\n * than a value because the selection changes while the panel stays mounted.\n */\n readonly sessionId?: () => string | undefined\n readonly subscribeSession?: (listener: () => void) => () => void\n /** Whether the sidebar renders wide content (`false` in the icon rail). */\n readonly wide?: boolean\n /** Icon-only launcher in the upstream Files tab's public actions slot. */\n readonly compact?: boolean\n}\n\n/** The visual family of one capsule button, mirroring the host Button kit. */\ntype ActionVariant = 'ghost' | 'outline' | 'primary' | 'danger'\n\nconst VARIANT_CLASS: Record<ActionVariant, string> = {\n ghost: 'mrfw-btnGhost',\n outline: 'mrfw-btnOutline',\n primary: 'mrfw-btnPrimary',\n danger: 'mrfw-btnDanger',\n}\n\n/** One small capsule button matching the panel's own styling.\n * Pending requests block activation through aria-disabled without changing\n * opacity, hover or keyboard focus. Native disabled is for unavailable actions.\n */\nfunction Action(props: {\n onClick: () => void\n children: ReactNode\n disabled?: boolean\n pending?: boolean\n variant?: ActionVariant\n}): ReactNode {\n const variant = props.variant ?? 'ghost'\n return (\n <button\n type=\"button\"\n className={`mrfw-btn ${VARIANT_CLASS[variant]}`}\n onClick={props.pending === true ? undefined : props.onClick}\n disabled={props.disabled === true}\n aria-disabled={props.disabled === true || props.pending === true || undefined}\n aria-busy={props.pending === true || undefined}\n >\n {props.children}\n </button>\n )\n}\n\n/**\n * One icon-only button (a host \"iconButton\"): a fixed square of the capsule\n * family whose meaning travels in `title`/`aria-label` instead of text.\n */\nfunction IconButton(props: {\n onClick: () => void\n icon: ReactNode\n label: string\n disabled?: boolean\n pending?: boolean\n pressed?: boolean\n hint?: string\n variant?: ActionVariant\n}): ReactNode {\n const variant = props.variant ?? 'ghost'\n return (\n <button\n type=\"button\"\n className={`mrfw-btn mrfw-iconBtn ${VARIANT_CLASS[variant]}`}\n title={props.hint ?? props.label}\n aria-label={props.label}\n aria-pressed={props.pressed}\n onClick={props.pending === true ? undefined : props.onClick}\n disabled={props.disabled === true}\n aria-disabled={props.disabled === true || props.pending === true || undefined}\n aria-busy={props.pending === true || undefined}\n >\n {props.icon}\n </button>\n )\n}\n\n/** A skill is a reusable instruction document; the star denotes its capability. */\nfunction SkillsIcon({ enabled }: { enabled: boolean }): ReactNode {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M8 13.5H3a1 1 0 0 1-1-1v-10a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1V7M4.5 4.5h5M4.5 7h3\" />\n <path d=\"m11.5 8 .85 2.65L15 11.5l-2.65.85-.85 2.65-.85-2.65L8 11.5l2.65-.85Z\" />\n {enabled ? null : <path d=\"m2 14 12-12\" />}\n </svg>\n )\n}\n\n/** The 16px close glyph of the dialog's header button. */\nfunction CloseIcon(): ReactNode {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 4l8 8M12 4l-8 8\" />\n </svg>\n )\n}\n\n/**\n * One path that copies itself: text that paints like the surrounding copy\n * and reveals a trailing icon on hover — clicking the text or the icon\n * copies the same canonical path. The accessible name swaps to \"copied\"\n * for the feedback window, the icon button's old recipe. Shared by the\n * primary row and every additional root.\n */\nfunction PathCopy(props: {\n readonly path: string\n readonly copied: boolean\n readonly onCopy: () => void\n readonly t: Translate\n}): ReactNode {\n return (\n <button\n type=\"button\"\n className=\"mrfw-rootPath mrfw-pathCopy\"\n title={props.path}\n aria-label={props.copied ? props.t('panel.copied') : props.t('panel.copyPath')}\n onClick={props.onCopy}\n >\n {props.path}\n <span className=\"mrfw-pathCopyIcon\" aria-hidden=\"true\"><IconCopy size={14} /></span>\n </button>\n )\n}\n\n/** The locale key for one reported root state. */\nexport function stateKey(state: RootState): Key {\n switch (state) {\n case 'available': return 'state.available'\n case 'missing': return 'state.missing'\n case 'redirected': return 'state.redirected'\n case 'invalid': return 'state.invalid'\n }\n}\n\n/** The locale key for one registration's access level. */\nexport function accessKey(access: RootAccess): Key {\n switch (access) {\n case 'inherit': return 'access.inherit'\n case 'read-only': return 'access.readOnly'\n case 'read-write': return 'access.readWrite'\n }\n}\n\n/**\n * Whether moving FROM `from` TO `to` could widen the agent's write authority\n * under some session mode. The three levels are not a total order — `inherit`\n * is weaker than `read-write` under a read-only session but never weaker\n * under the others — so the check is spelled out per pair rather than\n * computed from a rank. Only a widening change asks for confirmation.\n */\nexport function widensAccess(from: RootAccess, to: RootAccess): boolean {\n if (from === 'read-only') return to !== 'read-only'\n return (from === 'inherit' && to === 'read-write') || (from === 'read-write' && to === 'inherit')\n}\n\n/** The final segment of an absolute path, on either platform separator. */\nexport function basename(path: string): string {\n const segments = path.split(/[\\\\/]/).filter(segment => segment !== '')\n return segments[segments.length - 1] ?? path\n}\n\n/**\n * The primary text of one row: the stored alias when set, otherwise the\n * directory's own name — the display the registration was added with.\n */\nexport function displayNameOf(root: RootView): string {\n return root.alias ?? basename(root.path)\n}\n\n/** Display-only path matching; the host remains the sole authority for grants. */\nfunction workingRootOf(view: RootsView | undefined): string | undefined {\n if (view?.effectiveCwd === undefined) return undefined\n const normalize = (path: string): string => {\n const windows = /^[a-z]:[\\\\/]/i.test(path) || path.startsWith('\\\\')\n const normalized = (windows ? path.replace(/\\\\/g, '/').toLowerCase() : path).replace(/\\/+$/, '')\n return normalized || '/'\n }\n const cwd = normalize(view.effectiveCwd)\n // Longest boundary match is equivalent to walking up to the nearest listed root.\n return [view.primaryRoot, ...view.roots.map(root => root.path)]\n .filter(path => {\n const root = normalize(path)\n return cwd === root || cwd.startsWith(root.endsWith('/') ? root : `${root}/`)\n })\n .sort((a, b) => normalize(b).length - normalize(a).length)[0]\n}\n\n/** The sidebar footer action plus the dialog it opens. */\nexport function WorkspaceFoldersAction(props: WorkspaceFoldersActionProps): ReactNode {\n const [open, setOpen] = useState(false)\n const rail = props.wide === false\n return (\n <>\n {/* The row wrapper mirrors the host `.triggerRow`: its 2px side overhang\n (`calc(100% + 4px)` + negative margins) is what puts this row's icon\n on the same 18px ink line as the Settings gear below it. */}\n <div className={props.compact ? 'mrfw-fileLauncher' : rail ? 'mrfw-triggerRow mrfw-railRow' : 'mrfw-triggerRow'}>\n <button\n type=\"button\"\n className={props.compact ? 'mrfw-btn mrfw-btnGhost mrfw-iconBtn' : rail ? 'mrfw-trigger mrfw-triggerRail' : 'mrfw-trigger'}\n title={props.t('action.title')}\n aria-label={props.compact === true ? props.t('action.title') : undefined}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => { setOpen(value => !value) }}\n >\n <span className=\"mrfw-triggerIcon\" aria-hidden=\"true\"><IconSettings size={rail ? 18 : 16} /></span>\n {rail || props.compact === true ? null : <span className=\"mrfw-triggerLabel\">{props.t('action.label')}</span>}\n </button>\n </div>\n {open ? <WorkspaceFoldersDialog {...props} onClose={() => { setOpen(false) }} /> : null}\n </>\n )\n}\n\n/** State of one dialog instance. */\ninterface DialogState {\n readonly view: RootsView | undefined\n readonly error: PanelError | undefined\n readonly busy: boolean\n /** True when the client has no current session and must not call the host. */\n readonly noSession: boolean\n}\n\n/** The exact row reference the browsing endpoints and mutations carry. */\nexport function entryOf(root: RootView): RootEntryView {\n return { ordinal: root.ordinal, id: root.id, path: root.path, addedAt: root.addedAt }\n}\n\nfunction rowKey(root: RootView): string {\n return `${root.ordinal}\\u0000${root.id}\\u0000${root.path}\\u0000${root.addedAt}`\n}\n\n/**\n * The dialog: reads the view once per open, then after every mutation.\n *\n * Two shapes travel back over the channel, and they are handled separately on\n * purpose: every mutating endpoint answers with the whole refreshed view, while\n * `reveal` answers with the path it revealed and leaves the list untouched\n * (see `contract.ts`). Treating a reveal answer as a roots view is exactly the\n * contract mismatch this split removes.\n */\nexport function WorkspaceFoldersDialog(props: WorkspaceFoldersActionProps & { onClose: () => void }): ReactNode {\n const { panel, t } = props\n const [state, setState] = useState<DialogState>({\n view: undefined,\n error: undefined,\n busy: false,\n noSession: false,\n })\n const [manualPath, setManualPath] = useState('')\n /** The access the Add controls register new roots with; `inherit` is the default. */\n const [addAccess, setAddAccess] = useState<RootAccess>('inherit')\n /**\n * Whether the operator actually picked a level. The select shows its default\n * before they do, and sending that default would be an explicit value the\n * operator never named: on a revive the registry upgrades a read-only record\n * to it. Only a chosen level may travel in the request.\n */\n const [accessChosen, setAccessChosen] = useState(false)\n const [accessMenuOpen, setAccessMenuOpen] = useState(false)\n /** The widening access change waiting on the confirmation's red button. */\n const [upgradeFor, setUpgradeFor] = useState<{ root: RootView; access: RootAccess } | undefined>(undefined)\n const [aliasFor, setAliasFor] = useState<string | undefined>(undefined)\n const [aliasDraft, setAliasDraft] = useState('')\n const [aliasField, setAliasField] = useState<'alias' | 'aliasId'>('alias')\n const [copiedId, setCopiedId] = useState<string | undefined>(undefined)\n const [menuFor, setMenuFor] = useState<string | undefined>(undefined)\n const dialogRef = useRef<HTMLDivElement | null>(null)\n const requestEpoch = useRef(0)\n const mounted = useRef(true)\n\n useEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n requestEpoch.current += 1\n }\n }, [])\n\n const requestBase = useCallback((): { sessionId: string } | undefined => {\n const current = props.sessionId?.()\n return current === undefined || current === '' ? undefined : { sessionId: current }\n }, [props.sessionId])\n\n // The dialog is modal: it takes focus when it opens, Escape closes it, and\n // Tab cycles within it instead of escaping into the sidebar behind it.\n useEffect(() => { dialogRef.current?.focus() }, [])\n const onDialogKeyDown = (event: ReactKeyboardEvent): void => {\n if (event.key === 'Escape') {\n // An open menu or the upgrade confirmation owns Escape: its own\n // listener closes just that layer, and this handler must not close the\n // dialog underneath it — the portaled dropdown and Modal bubble their\n // events through this dialog's React tree too.\n if (menuFor !== undefined || accessMenuOpen || upgradeFor !== undefined) return\n event.stopPropagation()\n props.onClose()\n return\n }\n if (event.key !== 'Tab') return\n // While the upgrade confirmation owns the topmost modal, Tab belongs to\n // its own focus trap. The portaled Modal still bubbles keys through this\n // dialog's React tree (like Escape above), and trapping here would yank\n // focus to a control behind the active confirmation.\n if (upgradeFor !== undefined) return\n const dialog = dialogRef.current\n if (dialog === null) return\n const focusable = Array.from(\n dialog.querySelectorAll<HTMLElement>('button, input, select, [href], [tabindex]:not([tabindex=\"-1\"])'),\n ).filter(element => !element.hasAttribute('disabled'))\n if (focusable.length === 0) {\n event.preventDefault()\n return\n }\n const first = focusable[0]!\n const last = focusable[focusable.length - 1]!\n const active = dialog.ownerDocument.activeElement\n if (event.shiftKey && (active === first || !(active instanceof HTMLElement) || !dialog.contains(active))) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && (active === last || !(active instanceof HTMLElement) || !dialog.contains(active))) {\n event.preventDefault()\n first.focus()\n }\n }\n\n const refresh = useCallback(async () => {\n if (panel === undefined) {\n setState({\n view: undefined,\n error: new PanelError('unavailable', 'no connection'),\n busy: false,\n noSession: false,\n })\n return\n }\n const base = requestBase()\n if (base === undefined) {\n setState({ view: undefined, error: undefined, busy: false, noSession: true })\n return\n }\n const epoch = ++requestEpoch.current\n setState(previous => ({ ...previous, busy: true, noSession: false }))\n try {\n const view = await panel.call('list', base)\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return\n setState({ view, error: undefined, busy: false, noSession: false })\n } catch (error: unknown) {\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return\n setState({ view: undefined, error: asPanelError(error), busy: false, noSession: false })\n }\n }, [panel, requestBase])\n\n useEffect(() => { void refresh() }, [refresh])\n useEffect(() => {\n let previous = props.sessionId?.()\n return props.subscribeSession?.(() => {\n const current = props.sessionId?.()\n if (current === previous) return\n previous = current\n requestEpoch.current += 1\n setState({ view: undefined, error: undefined, busy: false, noSession: current === undefined })\n setMenuFor(undefined)\n setAliasFor(undefined)\n void refresh()\n })\n }, [props.subscribeSession, props.sessionId, refresh])\n\n /**\n * Submit one change to the host and adopt the view it answers with.\n * @returns whether the host accepted it (the caller decides whether to clear\n * the input it came from).\n */\n const mutate = useCallback(async (endpoint: 'add' | 'remove' | 'alias' | 'move' | 'setAccess' | 'setAliasId' | 'setSkillsEnabled', payload: Record<string, unknown>): Promise<boolean> => {\n if (panel === undefined) return false\n const base = requestBase()\n if (base === undefined) {\n setState({ view: undefined, error: undefined, busy: false, noSession: true })\n return false\n }\n const epoch = ++requestEpoch.current\n setState(previous => ({ ...previous, busy: true, noSession: false }))\n try {\n const view = await panel.call(endpoint, { ...base, ...payload })\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return false\n setState({ view, error: undefined, busy: false, noSession: false })\n return true\n } catch (error: unknown) {\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return false\n setState(previous => ({ ...previous, error: asPanelError(error), busy: false }))\n return false\n }\n }, [panel, requestBase])\n\n /**\n * Open the composed picker and add whatever it returns. A picker that is not\n * composed, or a dialog the operator dismissed, adds nothing — it never falls\n * back to the manual field, because the operator who clicked \"Add folder…\"\n * asked for the picker, not for the text they may have typed earlier.\n */\n const addViaPicker = useCallback(async () => {\n if (props.pickDirectory === undefined) return\n let picked: string | null = null\n try {\n picked = await props.pickDirectory()\n } catch (error: unknown) {\n setState(previous => ({ ...previous, error: asPanelError(error) }))\n return\n }\n if (picked === null || picked.trim() === '') return\n await mutate('add', { path: picked, ...(accessChosen ? { access: addAccess } : {}) })\n }, [mutate, props, addAccess, accessChosen])\n\n /**\n * Add the path in the manual field — the one the operator typed. The picker\n * plays no part here: this is the entry point the confirm button and the\n * Enter key use.\n */\n const addManualPath = useCallback(async () => {\n const path = manualPath.trim()\n if (path === '') return\n // Cleared only on success: a rejected path stays in the field so the operator\n // can fix it instead of retyping it.\n if (await mutate('add', { path, ...(accessChosen ? { access: addAccess } : {}) })) setManualPath('')\n }, [manualPath, mutate, addAccess, accessChosen])\n\n /**\n * Re-register one withheld or unusable root in place. The request carries\n * the stored path and deliberately NO access: `registry.add` treats the call\n * as a revive — it keeps the record's access, alias, and identity instead of\n * creating a new registration — which is also why the root limit must not\n * gate this button: a revive consumes no slot, and it is the panel's only\n * repair route for a redirected entry.\n */\n const reRegister = useCallback(async (root: RootView) => {\n await mutate('add', { path: root.path })\n }, [mutate])\n\n /** Reveal one root: the answer is the revealed path, not a new view. */\n const reveal = useCallback(async (root: RootView) => {\n if (panel === undefined) return\n const base = requestBase()\n if (base === undefined) {\n setState({ view: undefined, error: undefined, busy: false, noSession: true })\n return\n }\n const epoch = ++requestEpoch.current\n setState(previous => ({ ...previous, busy: true, noSession: false }))\n try {\n await panel.call('reveal', { ...base, entry: entryOf(root) })\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return\n setState(previous => ({ ...previous, error: undefined, busy: false }))\n } catch (error: unknown) {\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== base.sessionId) return\n setState(previous => ({ ...previous, error: asPanelError(error), busy: false }))\n }\n }, [panel, requestBase])\n\n const copyPath = useCallback(async (key: string, path: string) => {\n try {\n await navigator.clipboard.writeText(path)\n setCopiedId(key)\n setState(previous => ({ ...previous, error: undefined }))\n window.setTimeout(() => { setCopiedId(current => (current === key ? undefined : current)) }, 1500)\n } catch (error: unknown) {\n // A clipboard refusal is the browser environment's, not the host's, so it\n // is reported here with its own code rather than left silent.\n setCopiedId(undefined)\n setState(previous => ({\n ...previous,\n error: new PanelError('copy-failed', error instanceof Error ? error.message : String(error)),\n }))\n }\n }, [])\n\n // Retained for a future drag-to-reorder interaction; no ordering controls are shown.\n const _move = useCallback(async (root: RootView, before: RootView | undefined) => {\n await mutate('move', before === undefined\n ? { entry: entryOf(root) }\n : { entry: entryOf(root), beforeEntry: entryOf(before) })\n }, [mutate])\n\n const roots = state.view?.roots ?? []\n // The host refuses the add as `root-limit-reached` anyway; disabling here is\n // what makes the refusal explain itself before the operator clicks.\n const atLimit = state.view !== undefined && state.view.count >= state.view.limit\n const IconAccessTrigger = addAccess === 'read-only' ? IconAccessReadOnly\n : addAccess === 'read-write' ? IconAccessReadWrite : IconAccessInherit\n // Captured as consts: narrowing does not reach the onCopy closures below.\n const primaryPath = state.view?.primaryRoot\n const workingRoot = workingRootOf(state.view)\n return (\n <>\n <div className=\"mrfw-overlay\" role=\"presentation\">\n <div\n className=\"mrfw-mask\"\n role=\"presentation\"\n onClick={event => { if (event.target === event.currentTarget) props.onClose() }}\n />\n <div\n ref={dialogRef}\n tabIndex={-1}\n onKeyDown={onDialogKeyDown}\n className=\"mrfw-dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={t('panel.title')}\n >\n <div className=\"mrfw-header\">\n <h2 className=\"mrfw-title\">{t('panel.title')}</h2>\n <button\n type=\"button\"\n className=\"mrfw-close\"\n title={t('panel.close')}\n aria-label={t('panel.close')}\n onClick={props.onClose}\n >\n <CloseIcon />\n </button>\n </div>\n <div className=\"mrfw-body\">\n {state.noSession ? (\n <p className=\"mrfw-note\">{t('panel.noSession')}</p>\n ) : (\n <>\n {state.view?.toolAccessInvalid ? <p className=\"mrfw-note\">{t('panel.invalidCap')}</p>\n : (state.view?.cappedTools?.length ?? 0) > 0 ? <p className=\"mrfw-note\">\n {t('panel.toolCaps', { tools: state.view!.cappedTools!.join(', ') })}\n </p> : null}\n\n {state.error === undefined ? null : (\n <p role=\"alert\" className=\"mrfw-alert\">\n {t(errorKeyOf(state.error.code))}\n {(state.error.code === 'unavailable' || state.error.code === 'panel/internal') ? ` (${state.error.message})` : ''}\n </p>\n )}\n {state.view?.unavailable === undefined ? null : (\n <p role=\"alert\" className=\"mrfw-alert\">{state.view.unavailable}</p>\n )}\n\n <section className=\"mrfw-section\">\n <div className=\"mrfw-sectionTitleRow\">\n <span className=\"mrfw-sectionTitle\">{t('panel.primary')}</span>\n <span className=\"mrfw-sectionNote\">{t('panel.primaryNote')}</span>\n </div>\n <div className=\"mrfw-row mrfw-rowBare\">\n <div className=\"mrfw-rootText\">\n <span className=\"mrfw-rootName\">\n <span className=\"mrfw-rootNameText\">\n {state.view === undefined ? '…' : (state.view.primaryName ?? basename(state.view.primaryRoot))}\n </span>\n {primaryPath !== undefined && workingRoot === primaryPath ? <span className=\"mrfw-cwdTag\">{t('panel.currentAgentCwd')}</span> : null}\n </span>\n {primaryPath === undefined\n ? <span className=\"mrfw-rootPath\">…</span>\n : (\n <PathCopy\n path={primaryPath}\n copied={copiedId === 'primary'}\n onCopy={() => { void copyPath('primary', primaryPath) }}\n t={t}\n />\n )}\n </div>\n </div>\n </section>\n\n <section className=\"mrfw-section\">\n <div className=\"mrfw-sectionTitleRow\">\n <span className=\"mrfw-sectionTitle\">{t('panel.additional')}</span>\n </div>\n {state.view === undefined ? <p className=\"mrfw-note\">{t('panel.loading')}</p> : null}\n {state.view !== undefined && roots.length === 0 ? (\n <p className=\"mrfw-note\">\n {t('panel.empty')} {t('panel.emptyHint')}\n </p>\n ) : null}\n {roots.map(root => {\n const key = rowKey(root)\n const IconAccess = root.access === 'read-only' ? IconAccessReadOnly\n : root.access === 'read-write' ? IconAccessReadWrite : IconAccessInherit\n return <div key={key} className=\"mrfw-row\">\n <div className=\"mrfw-rootText\">\n <span className=\"mrfw-rootName\">\n <span className=\"mrfw-rootNameText\">{displayNameOf(root)}</span>\n {workingRoot === root.path ? <span className=\"mrfw-cwdTag\">{t('panel.currentAgentCwd')}</span> : null}\n {/* The access level rides beside the name as read-only\n text; changing it stays behind the row's … menu. */}\n <span className=\"mrfw-accessBadge\">\n {IconAccess === undefined ? null : <IconAccess size={14} />}\n {root.effectiveAccess === undefined ? t(accessKey(root.access)) : t('panel.accessEffective', {\n access: t(accessKey(root.access)),\n effective: t(`effective.${root.effectiveAccess}`),\n })}\n </span>\n </span>\n <PathCopy\n path={root.path}\n copied={copiedId === key}\n onCopy={() => { void copyPath(key, root.path) }}\n t={t}\n />\n </div>\n {root.state === 'available' ? null : (\n <span title={root.detail} className=\"mrfw-stateWarn\">\n {t(stateKey(root.state))}\n </span>\n )}\n {root.state === 'available' ? null : (\n <IconButton\n pending={state.busy}\n onClick={() => { void reRegister(root) }}\n icon={<IconRefresh />}\n label={t('panel.reRegister')}\n />\n )}\n {root.skillsEnabled === undefined ? null : (\n <IconButton\n pending={state.busy}\n pressed={root.skillsEnabled}\n onClick={() => { void mutate('setSkillsEnabled', { entry: entryOf(root), skillsEnabled: !root.skillsEnabled }) }}\n icon={<SkillsIcon enabled={root.skillsEnabled} />}\n label={t('panel.skills')}\n hint={t(root.skillsEnabled ? 'panel.skillsEnabled' : 'panel.skillsDisabled')}\n />\n )}\n <IconButton\n pending={state.busy}\n onClick={() => { void reveal(root) }}\n icon={<IconFolderOpen />}\n label={t('panel.reveal')}\n />\n <Menu\n open={menuFor === key}\n onClose={() => { setMenuFor(undefined) }}\n items={[\n { id: 'rename', label: t('panel.rename'), icon: <IconEdit /> },\n { id: 'alias-id', label: t('panel.aliasIdEdit'), disabled: state.busy },\n { id: 'access:inherit', label: t('panel.accessInherit'), icon: IconAccessInherit === undefined ? undefined : <IconAccessInherit />, disabled: state.busy || root.access === 'inherit' },\n { id: 'access:read-only', label: t('panel.accessReadOnly'), icon: IconAccessReadOnly === undefined ? undefined : <IconAccessReadOnly />, disabled: state.busy || root.access === 'read-only' },\n { id: 'access:read-write', label: t('panel.accessReadWrite'), icon: IconAccessReadWrite === undefined ? undefined : <IconAccessReadWrite />, disabled: state.busy || root.access === 'read-write' },\n { id: 'remove', label: t('panel.remove'), icon: <IconTrash />, danger: true, disabled: state.busy },\n ]}\n onSelect={(id) => {\n setMenuFor(undefined)\n if (id === 'alias-id') {\n setAliasField('aliasId')\n setAliasFor(key)\n setAliasDraft(root.aliasId ?? '')\n }\n if (id === 'rename') {\n setAliasField('alias')\n setAliasFor(key)\n setAliasDraft(root.alias ?? '')\n }\n if (id.startsWith('access:')) {\n const access = id.slice('access:'.length) as RootAccess\n // Widening what the agent may modify — under ANY session\n // mode — asks first, through the confirmation layered\n // over this dialog, not the browser's window.confirm.\n if (widensAccess(root.access, access)) { setUpgradeFor({ root, access }); return }\n void mutate('setAccess', { entry: entryOf(root), access })\n }\n if (id === 'remove') void mutate('remove', { entry: entryOf(root) })\n }}\n portal\n align=\"end\"\n closeOnPointerLeave\n anchor={(\n <IconButton\n pending={state.busy}\n onClick={() => { setMenuFor(current => (current === key ? undefined : key)) }}\n icon={<IconEllipsis />}\n label={t('panel.more')}\n />\n )}\n />\n {aliasFor === key ? (\n <span className=\"mrfw-aliasEditor\">\n <input\n autoFocus\n className=\"mrfw-input mrfw-inputInline\"\n value={aliasDraft}\n placeholder={t(aliasField === 'aliasId' ? 'panel.aliasIdPlaceholder' : 'panel.aliasPlaceholder')}\n onChange={event => { setAliasDraft(event.target.value) }}\n />\n <Action pending={state.busy} onClick={() => { void mutate(aliasField === 'aliasId' ? 'setAliasId' : 'alias', { entry: entryOf(root), [aliasField]: aliasDraft }).then(ok => { if (ok) setAliasFor(undefined) }) }}>\n {t('panel.aliasSave')}\n </Action>\n <Action onClick={() => { setAliasFor(undefined) }}>{t('panel.aliasCancel')}</Action>\n </span>\n ) : null}\n </div>\n })}\n </section>\n </>\n )}\n\n <div className=\"mrfw-actions\">\n {state.noSession || props.pickDirectory === undefined ? null : (\n <IconButton\n variant=\"outline\"\n pending={state.busy}\n disabled={atLimit}\n onClick={() => { void addViaPicker() }}\n icon={<IconPlus />}\n label={atLimit ? t('panel.limitReached') : t('panel.add')}\n />\n )}\n {state.noSession ? null : (\n <>\n <input\n className=\"mrfw-input\"\n value={manualPath}\n placeholder={t('panel.addManual')}\n disabled={atLimit}\n onChange={event => { setManualPath(event.target.value) }}\n onKeyDown={event => { if (event.key === 'Enter') void addManualPath() }}\n />\n {/* The access picker is the host's own anchored menu — the same\n dropdown kit the root switcher and the row menus use — not a\n native select. Only an explicit selection marks the level\n chosen, so the displayed default still travels in no request\n (accessChosen keeps its meaning). Opens upward: the row sits\n at the dialog's bottom edge. */}\n <Menu\n open={accessMenuOpen}\n onClose={() => { setAccessMenuOpen(false) }}\n className=\"mrfw-accessSelect\"\n items={[\n {\n id: 'inherit',\n label: t('access.inherit'),\n icon: IconAccessInherit === undefined ? undefined : <IconAccessInherit />,\n },\n {\n id: 'read-write',\n label: t('access.readWrite'),\n icon: IconAccessReadWrite === undefined ? undefined : <IconAccessReadWrite />,\n },\n {\n id: 'read-only',\n label: t('access.readOnly'),\n icon: IconAccessReadOnly === undefined ? undefined : <IconAccessReadOnly />,\n },\n ]}\n selectedId={addAccess}\n onSelect={(id) => {\n setAccessMenuOpen(false)\n if (id === 'inherit' || id === 'read-write' || id === 'read-only') {\n setAccessChosen(true)\n setAddAccess(id)\n }\n }}\n portal\n side=\"top\"\n align=\"end\"\n closeOnPointerLeave\n anchor={(\n <button\n type=\"button\"\n className=\"mrfw-btn mrfw-btnOutline mrfw-accessTrigger\"\n title={t('panel.accessLabel')}\n aria-label={t('panel.accessLabel')}\n aria-haspopup=\"menu\"\n aria-expanded={accessMenuOpen}\n disabled={atLimit}\n aria-disabled={state.busy || atLimit || undefined}\n aria-busy={state.busy || undefined}\n onClick={() => { if (!state.busy) setAccessMenuOpen(open => !open) }}\n >\n {IconAccessTrigger === undefined ? null : <IconAccessTrigger />}\n {t(accessKey(addAccess))}\n {accessMenuOpen ? <IconChevronUp size={14} /> : <IconChevronDown size={14} />}\n </button>\n )}\n />\n <Action\n onClick={() => { void addManualPath() }}\n pending={state.busy}\n disabled={atLimit || manualPath.trim() === ''}\n variant=\"primary\"\n >\n {t('panel.addConfirm')}\n </Action>\n </>\n )}\n {atLimit ? <span className=\"mrfw-note\">{t('panel.limitReached')}</span> : null}\n <Action onClick={() => { void refresh() }} pending={state.busy} variant=\"outline\">{t('panel.retry')}</Action>\n </div>\n </div>\n </div>\n </div>\n {/* A widening access change asks first: a host-modal confirmation layered\n over this dialog — cancel or a mask click dismisses, the red button\n commits the setAccess mutation. Narrowing changes skip it entirely. */}\n <Modal\n open={upgradeFor !== undefined}\n onClose={() => { setUpgradeFor(undefined) }}\n title={t('panel.accessUpgradeTitle')}\n description={upgradeFor === undefined ? '' : t('panel.accessUpgradeConfirm', { access: t(accessKey(upgradeFor.access)) })}\n closeLabel={t('panel.close')}\n footer={(\n <>\n <Action onClick={() => { setUpgradeFor(undefined) }}>{t('panel.aliasCancel')}</Action>\n <Action\n variant=\"danger\"\n pending={state.busy}\n onClick={() => {\n const pending = upgradeFor\n setUpgradeFor(undefined)\n if (pending !== undefined) {\n void mutate('setAccess', { entry: entryOf(pending.root), access: pending.access })\n }\n }}\n >\n {t('panel.accessUpgradeDo')}\n </Action>\n </>\n )}\n />\n </>\n )\n}\n\n/** Normalize any thrown value into a `PanelError` the dialog can render. */\nfunction asPanelError(error: unknown): PanelError {\n if (error instanceof PanelError) return error\n return new PanelError('fallback', error instanceof Error ? error.message : String(error))\n}\n","/**\n * The Files-tab root switcher — the entry that took over the header position\n * the P1 gear launcher first claimed. It poses as the pane's path label: a\n * trigger that opens a menu of this session's roots (primary first, the\n * registered additional roots next, and the Workspace Folders manager last),\n * followed by a `PathLabel` of the selected root's full path — the same\n * component upstream draws in that spot, so both primary and additional\n * selections read exactly like the native header. While an additional root\n * is selected it also lends the pane's body area to this plugin's verbatim\n * fork of the native Files tree (`files-tree/`), so an additional root reads\n * and behaves exactly like the primary one.\n *\n * Two upstream DOM hooks make the takeover work, and both degrade silently:\n *\n * - The stylesheet rules: while `.mrfw-rootSwitcher` exists inside a\n * `[data-files-root]` pane the upstream `data-files-path` is hidden and the\n * switcher takes its flex position; while the switcher carries\n * `data-root-kind=\"additional\"` the native `data-files-body`,\n * `data-files-reload`, and `data-open-target=\"directory\"` split button\n * hide too (the reload refreshes the very tree that is no longer\n * visible, and the native open-in-app button only ever receives the\n * primary root through its slot props — the header gets a\n * `.mrfw-switcherReload` replacement and the plugin's verbatim fork of\n * the open-in-app control, pointed at the selected root). Upstream\n * changing that DOM shape simply stops the selectors from matching — the\n * native header keeps working and the switcher is just another actions\n * occupant.\n * - `closest('[data-files-root]')` from the switcher's own element locates\n * the pane the forked Files tree is portaled into, as a sibling of\n * `data-files-body`. No match → no portal: the component keeps working as\n * a menu and the native tree keeps its area. The tree's tab id comes from\n * the same element's `closest('[data-dockkit-content]')` — the dockkit\n * tabHost section — with a generated fallback where the hook is absent.\n *\n * The selected root lives in the inject product's session-scoped snapshot,\n * keyed by that dockkit tab id — component state could not survive the\n * remount every file open causes (the opened tab takes the pane, the Files\n * body unmounts with the whole occupant subtree). One selection per tab;\n * session switches mint a fresh inject product, so no selection crosses\n * sessions, and a registry eviction reconciles it back to primary.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client/RootSwitcher\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'\nimport { createPortal } from 'react-dom'\nimport { Menu, type MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit'\nimport { IconChevronDown, IconFolderClose, IconFolderOpen, IconRefresh, IconSettings, maybeComponent } from '../compat/client-icons.ts'\nimport type { RootsView, RootView } from '../contract.ts'\nimport { FilesTree, type FilesTreeSurface } from './files-tree/adapter.tsx'\nimport { OpenInAppAction, type OpenInAppAdapter } from './open-in-app/adapter.tsx'\nimport {\n basename,\n displayNameOf,\n stateKey,\n WorkspaceFoldersDialog,\n type WorkspaceFoldersActionProps,\n} from './WorkspaceFoldersAction.tsx'\n\n/** What the registered Files-actions occupant needs beyond the slot owner. */\nexport interface RootSwitcherProps extends Omit<WorkspaceFoldersActionProps, 'compact' | 'wide'> {\n /** This pane's workspace root, carried by the slot owner's `absolutePath`. */\n readonly primaryPath: string\n /**\n * The forked open-in-app control's shared props, or `undefined` where the\n * fork cannot render (an undefined adapter is upstream's own \"no button\"\n * state, so the switcher just draws nothing there too).\n */\n readonly openInApp?: OpenInAppAdapter | undefined\n /**\n * The forked Files tree's shared props, or `undefined` where the fork\n * cannot render — the additional-root rows then stay out of the menu at\n * all, which is the same absence upstream's own tree produces.\n */\n readonly filesTree?: FilesTreeSurface | undefined\n}\n\n/** The takeover's portal + lifetime, created while an additional root browses. */\ninterface Takeover {\n /** Lifetime handed to the tree's face: aborting forgets the store bucket and closes the watches. */\n readonly signal: AbortSignal\n /** The store bucket's key — the dockkit tab id where the hook exists, else a generated one. */\n readonly tabId: TabId\n /** The root the tree lists. */\n readonly root: string\n}\n\n/**\n * The subdued full-path label upstream's Files header draws — it exists from\n * `0.1.7-alpha.1` on. A pixel-era runtime has no such export, so the probe\n * returns `undefined` and the header falls back to a plain titled span: the\n * path stays readable and hoverable, only the dir/file typography differs.\n */\nconst PathLabel = maybeComponent<(props: { path: string; className?: string | undefined }) => ReactNode>(['PathLabel'])\n\n/** Selector hook for a composition without the fork: nothing was ever selectable. */\nconst noTreeSelection: NonNullable<RootSwitcherProps['filesTree']>['useTreeSelection'] = () => undefined as never\n\n/** The Files-header switcher: root menu, dialog entry, and the portal tree. */\nexport function RootSwitcher(props: RootSwitcherProps): ReactNode {\n const { panel, t, primaryPath, filesTree } = props\n const [menuOpen, setMenuOpen] = useState(false)\n const [dialogOpen, setDialogOpen] = useState(false)\n const [view, setView] = useState<RootsView | undefined>(undefined)\n const [takeover, setTakeover] = useState<Takeover | null>(null)\n const wrapperRef = useRef<HTMLSpanElement | null>(null)\n const fallbackTabId = useRef<TabId | undefined>(undefined)\n const sectionRef = useRef<HTMLElement | null>(null)\n const [pane, setPane] = useState<HTMLElement | null>(null)\n const [tabId, setTabId] = useState<TabId | undefined>(undefined)\n const mounted = useRef(true)\n const requestEpoch = useRef(0)\n\n useEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n requestEpoch.current += 1\n }\n }, [])\n\n // Locate the pane and the dockkit tab once, after mount. The\n // `[data-dockkit-content]` section outlives every hide/remount cycle of the\n // body — only the tab record's end removes it — so it keys the persisted\n // selection and answers the takeover's deferred end check. Finding no\n // `[data-files-root]` ancestor is the supported degradation: nothing is\n // portaled, and the stylesheet rules that would hide the native body match\n // nothing either.\n useEffect(() => {\n const wrapper = wrapperRef.current\n sectionRef.current = wrapper?.closest<HTMLElement>('[data-dockkit-content]') ?? null\n const content = sectionRef.current?.dataset.dockkitContent\n setTabId((content !== undefined && content !== ''\n ? content\n : (fallbackTabId.current ??= `mrfw-${Math.random().toString(36).slice(2)}` as TabId)) as TabId)\n setPane(wrapper?.closest<HTMLElement>('[data-files-root]') ?? null)\n }, [])\n\n // The persisted selection, keyed by this pane's tab id; an absent entry is\n // the primary root. The bound hook is stable across renders, so the\n // filesTree gate only ever picks the noop stand-in where the fork cannot\n // mount at all — and no additional root can be selected there anyway.\n const useTreeSelection = filesTree?.useTreeSelection ?? noTreeSelection\n const stored = useTreeSelection(selection => (tabId === undefined ? undefined : selection[tabId]))\n const selected: RootView | 'primary' = stored ?? 'primary'\n const selectRoot = filesTree?.selectRoot\n const setSelected = useCallback((next: RootView | 'primary'): void => {\n if (selectRoot === undefined || tabId === undefined) return\n selectRoot(tabId, next)\n }, [selectRoot, tabId])\n\n const refresh = useCallback(async (): Promise<void> => {\n if (panel === undefined) { setView(undefined); return }\n const session = props.sessionId?.()\n if (session === undefined || session === '') { setView(undefined); return }\n const epoch = ++requestEpoch.current\n try {\n const next = await panel.call('list', { sessionId: session })\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== session) return\n setView(next)\n } catch {\n // A failed list degrades to \"primary only\": the menu keeps working and\n // the trigger still mirrors the pane path. The dialog reports channel\n // failures itself, so the switcher stays silent here on purpose.\n if (!mounted.current || epoch !== requestEpoch.current || props.sessionId?.() !== session) return\n setView(undefined)\n }\n }, [panel, props.sessionId])\n\n useEffect(() => { void refresh() }, [refresh])\n\n // A session change makes the whole view — and any selected root — stale:\n // the registry is keyed by the session's primary root, so the selection\n // falls back to primary and the list reloads.\n useEffect(() => {\n let previous = props.sessionId?.()\n return props.subscribeSession?.(() => {\n const current = props.sessionId?.()\n if (current === previous) return\n previous = current\n requestEpoch.current += 1\n setSelected('primary')\n setView(undefined)\n void refresh()\n })\n }, [props.subscribeSession, props.sessionId, refresh, setSelected])\n\n // A refresh that reports the selected root gone or withheld sends the\n // selection back to the primary root instead of browsing a stale grant.\n // Only an answered view may evict it: while the list is still pending — or\n // a refresh failed — the persisted choice stands, the trigger keeps naming\n // it, and the forked tree's own rows surface whatever the host reports.\n // Treating an unanswered list as eviction would drop the selection on every\n // remount's first pending moment and on any transient failure.\n useEffect(() => {\n if (selected === 'primary' || view === undefined) return\n const current = view.roots.find(root => root.id === selected.id)\n if (current === undefined || current.state !== 'available') { setSelected('primary'); return }\n // The match can carry a newer alias, access, or path than the row\n // `onSelect` captured; adopt the refreshed object so the trigger label,\n // the path label, and the tree entry stop rendering the stale snapshot.\n if (current !== selected) setSelected(current)\n }, [view, selected, setSelected])\n\n const roots = useMemo(() => view?.roots ?? [], [view])\n const primaryLabel = view?.primaryName ?? basename(view?.primaryRoot ?? primaryPath)\n const triggerLabel = selected === 'primary' ? primaryLabel : displayNameOf(selected)\n const triggerPath = selected === 'primary' ? (view?.primaryRoot ?? primaryPath) : selected.path\n // Exactly the portal condition: the forked tree — and the header reload\n // that refreshes it — exist together or not at all. A missing fork keeps\n // every native piece visible and the menu's additional rows unlisted, so\n // data-root-kind never hides controls the takeover did not replace.\n const treeVisible = selected !== 'primary' && panel !== undefined && pane !== null && filesTree !== undefined\n const selectedPath = selected === 'primary' ? undefined : selected.path\n\n const takeoverCtl = filesTree?.takeover\n // While an additional root is selected the pane's body area belongs to the\n // forked tree: the takeover keeps one controller per (tab, root) in the\n // inject product, and the dockkit tabHost's data-dockkit-content supplies\n // the same tab id the native tree uses — so the fork's store bucket, scroll\n // memory, expansion state, and watches are keyed exactly like a real Files\n // tab and survive the body unmount an opened file causes, mirroring what\n // upstream's tab-record signal does for the native tree. Deselecting or\n // switching roots ends the entry at once; a body unmount leaves it to the\n // inject-side observer, which ends it whenever the tabHost section leaves\n // the document — the record's real end, even long after this body is gone.\n useEffect(() => {\n if (!treeVisible || selectedPath === undefined || tabId === undefined || takeoverCtl === undefined) { setTakeover(null); return }\n setTakeover({ signal: takeoverCtl.signal(tabId, selectedPath, sectionRef.current ?? undefined), tabId, root: selectedPath })\n return () => {\n // The mounted flag settles the branch: a deps change ends the entry\n // now, while an unmount is a hide — upstream's occurrence signal never\n // aborts on hide either — and the armed section observer owns the real\n // end. No section hook means the fallback tabId, which cannot rejoin\n // anything, so the old abort-on-unmount bound stands there.\n if (mounted.current || sectionRef.current === null) takeoverCtl.end(tabId)\n }\n }, [treeVisible, selectedPath, tabId, takeoverCtl])\n\n const items = useMemo((): MenuEntry[] => [\n { id: 'primary', label: `${primaryLabel} · ${t('panel.primary')}`, icon: <IconFolderOpen /> },\n // Where the fork cannot render, the additional rows stay out of the menu\n // entirely: offering a root the body cannot browse would desynchronize\n // the label from the pane. The primary row and the manager stay.\n ...(filesTree === undefined ? [] : roots).map((root): MenuEntry => ({\n id: `root:${root.id}`,\n label: root.state === 'available' ? displayNameOf(root) : `${displayNameOf(root)} · ${t(stateKey(root.state))}`,\n icon: <IconFolderClose />,\n disabled: root.state !== 'available',\n })),\n ], [roots, primaryLabel, t, filesTree])\n\n const onSelect = (id: string): void => {\n setMenuOpen(false)\n if (id === 'manage') { setDialogOpen(true); return }\n if (id === 'primary') { setSelected('primary'); return }\n const root = roots.find(candidate => `root:${candidate.id}` === id)\n if (root !== undefined) setSelected(root)\n }\n\n return (\n <>\n <span\n ref={wrapperRef}\n className=\"mrfw-rootSwitcher\"\n data-root-kind={treeVisible ? 'additional' : 'primary'}\n >\n <Menu\n open={menuOpen}\n onClose={() => { setMenuOpen(false) }}\n items={items}\n // The manager entry pins below the scrolling roots list — it is\n // chrome, not a root, and a long registry must not scroll it away.\n footer={[{ id: 'manage', label: t('switcher.manage'), icon: <IconSettings /> }]}\n selectedId={selected === 'primary' ? 'primary' : `root:${selected.id}`}\n onSelect={onSelect}\n portal\n align=\"start\"\n anchor={(\n <button\n type=\"button\"\n className=\"mrfw-rootSwitchBtn\"\n title={triggerPath}\n aria-haspopup=\"menu\"\n aria-expanded={menuOpen}\n onClick={() => {\n const opening = !menuOpen\n setMenuOpen(opening)\n // States change between opens; the menu always lists a fresh\n // view rather than the snapshot from the previous visit.\n if (opening) void refresh()\n }}\n >\n <span className=\"mrfw-triggerIcon\" aria-hidden=\"true\"><IconFolderClose size={16} /></span>\n <span className=\"mrfw-rootSwitchLabel\">{triggerLabel}</span>\n <span className=\"mrfw-triggerIcon mrfw-rootSwitchChevron\" aria-hidden=\"true\"><IconChevronDown size={14} /></span>\n </button>\n )}\n />\n {/* The selected root's full path, between the trigger and the reload:\n the same PathLabel upstream puts in this spot, so the header reads\n exactly as before except the label now follows the selection. On a\n runtime that does not export PathLabel a plain span carries the\n same class and title instead. */}\n {PathLabel === undefined\n ? <span className=\"mrfw-switcherPath\" title={triggerPath}>{triggerPath}</span>\n : <PathLabel path={triggerPath} className=\"mrfw-switcherPath\" />}\n {/* The takeover hides the native reload (it refreshes the hidden\n tree), so the header gets a replacement of its own — same position,\n same icon-button recipe as the upstream `.tool`, and upstream's own\n `reload` string through the fork's bound namespace. It calls the\n face's refresh: every mounted directory re-lists under its current\n rows, so a refresh never blanks to a loading note. Rendered under\n exactly the portal condition, so a menu-only switcher never shows\n a dead button. */}\n {treeVisible && filesTree !== undefined ? (\n <button\n type=\"button\"\n className=\"mrfw-switcherReload\"\n aria-label={filesTree.t('reload')}\n title={filesTree.t('reload')}\n onClick={() => { if (takeover !== null) filesTree.face.refresh(takeover.tabId) }}\n >\n <IconRefresh size={15} />\n </button>\n ) : null}\n {/* The takeover hides the native open-in-app split button (its slot\n props only ever carry the primary root), so the header gets the\n plugin's verbatim fork of that same control, pointed at the\n selected additional root — same component, same dictionary, same\n persisted app choice, same routes. Rendered under exactly the\n hide rule's condition; undefined adapter means no button, just\n like upstream's own \"no apps\" absence. */}\n {treeVisible && props.openInApp !== undefined ? (\n <OpenInAppAction {...props.openInApp} absolutePath={triggerPath} />\n ) : null}\n </span>\n {treeVisible && takeover !== null && filesTree !== undefined\n ? createPortal(\n <FilesTree\n tabId={takeover.tabId}\n sessionId={filesTree.sessionId}\n root={takeover.root}\n signal={takeover.signal}\n useStore={filesTree.useStore}\n actions={filesTree.actions}\n start={filesTree.face.start}\n toggle={filesTree.face.toggle}\n onOpen={filesTree.openFile}\n t={filesTree.t}\n />,\n pane,\n )\n : null}\n {dialogOpen ? (\n <WorkspaceFoldersDialog\n panel={props.panel}\n pickDirectory={props.pickDirectory}\n {...(props.sessionId === undefined ? {} : { sessionId: props.sessionId })}\n {...(props.subscribeSession === undefined ? {} : { subscribeSession: props.subscribeSession })}\n t={t}\n onClose={() => {\n setDialogOpen(false)\n // The manager may have removed or invalidated the selected root;\n // those mutations live in the dialog's own state and never reach\n // this snapshot, so closing re-lists and lets the reconciliation\n // above drop a selection the registry revoked.\n void refresh()\n }}\n />\n ) : null}\n </>\n )\n}\n","/**\n * Browser half of the multi-root workspace plugin.\n *\n * Sidebar footer and optional Files actions open the Workspace Folders dialog.\n * Everything it needs arrives through services the composition already\n * provides — `slots` to contribute, `locale` for its copy, `connection` for the\n * channel to the host half, and (optionally) `uiWorkspace` for the composed\n * directory picker and the client Session Controller for the current session.\n *\n * `slots.inject` is the soft seam: the footer action is registered when a\n * sidebar declares that slot and never otherwise, so a runtime whose sidebar\n * surface differs simply shows no panel instead of failing the client graph.\n *\n * @module @dsh-electron/dsh-plugin-multi-root-workspace/client\n */\n\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\n// Type-only: the SlotMap merge this plugin registers against, plus the CLIENT\n// faces that publish `ctx.slots` / `ctx.locale` on the browser context.\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-connection/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-workspace/client'\n// Merges `sessionId` onto session-scope composed props and `SessionId` onto\n// the inject factory's first parameter — the same merge upstream's Files\n// registration compiles against.\nimport type {} from '@deepseek-ai/dsh-client-ui-session/client'\nimport { createElement, useCallback } from 'react'\nimport type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { ShortcutCatalogEntry } from '@deepseek-ai/dsh-client-shortcuts/client'\nimport { currentSessionIdOf, subscribeSessions, subscribeCurrentSession } from '../compat/client-session.ts'\nimport { createPanelClient, type PanelClient } from './panel-client.ts'\nimport { NS, en, zh } from './locales.ts'\nimport { STYLES } from './styles.ts'\nimport { installSkillsClient } from './skills.tsx'\nimport { installSkillsSettingsCard } from './skills-settings.tsx'\nimport { RootSwitcher } from './RootSwitcher.tsx'\nimport { WorkspaceFoldersAction, type Translate } from './WorkspaceFoldersAction.tsx'\nimport { OPEN_IN_APP_NS, createOpenInAppAdapter } from './open-in-app/adapter.tsx'\nimport { OpenInAppToast } from './open-in-app/open-toast.tsx'\nimport { FILES_TREE_NS, createFilesTreeSeats, createFilesTreeSurface } from './files-tree/adapter.tsx'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface SlotMap {\n 'sidebar.right.tab.files.actions': {\n kind: 'list'\n scope: 'session'\n owner: { readonly absolutePath: string }\n }\n }\n}\n\n/** The footer-action cell this plugin owns. */\nexport const SLOT_ID = 'multi-root-folders'\n\n/** The id of the `<style>` element carrying this plugin's sheet. */\nconst STYLE_ELEMENT_ID = 'multi-root-workspace-styles'\n\n/** Services the client half needs before it may activate. */\nexport const inject = ['slots', 'locale', 'connection']\n\n/**\n * Register the panel.\n * @param ctx - the client root context.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'multi-root-workspace: dictionaries')\n\n // The panel's classes resolve against this sheet; removing it on unload keeps\n // a hot-unplugged plugin from leaving dead rules behind.\n ctx.effect(() => {\n let element = document.getElementById(STYLE_ELEMENT_ID)\n if (element === null) {\n element = document.createElement('style')\n element.id = STYLE_ELEMENT_ID\n element.textContent = STYLES\n document.head.append(element)\n }\n return () => { element?.remove() }\n }, 'multi-root-workspace: styles')\n\n // Cordis binds `this.ctx` to the *caller's* fiber for the registry methods, so\n // reading the injected services here keeps them owned by this plugin.\n const panel: PanelClient | undefined = (() => {\n const connection = ctx.get('connection')\n return connection === undefined ? undefined : createPanelClient(connection)\n })()\n const pickDirectory = async (): Promise<string | null> => {\n const workspace = readService<{ pickDirectory?: () => Promise<string | null> }>(ctx, 'uiWorkspace')\n if (workspace?.pickDirectory === undefined) return null\n return await workspace.pickDirectory()\n }\n // The selection field moved between supported releases; the probe lives in\n // compat so this entry never compares version strings.\n const sessionId = (): string | undefined => currentSessionIdOf(readService(ctx, 'sessions'))\n const subscribeSession = (listener: () => void): (() => void) => subscribeSessions(readService(ctx, 'sessions'), listener)\n const t = ctx.locale.bind(NS) as unknown as Translate\n installSkillsClient(ctx, t, listener => subscribeCurrentSession(readService(ctx, 'sessions'), listener))\n installSkillsSettingsCard(ctx, t)\n // The fork binds upstream's own open-in-app namespace — the same strings\n // the native button shows, upstream's dictionary updates included. The\n // adapter is undefined where the fork cannot render (pixel-era glyph\n // names), which is also upstream's own \"no button\" state.\n const openInApp = createOpenInAppAdapter({\n t: ctx.locale.bind(OPEN_IN_APP_NS) as unknown as (key: string, params?: Record<string, unknown>) => string,\n shortcuts: readService<{ catalog?: ObservableSnapshot<readonly ShortcutCatalogEntry[]> }>(ctx, 'shortcuts')?.catalog,\n })\n // The toast entry mirrors upstream's own `shell.overlay` registration so a\n // native-open failure (and a mobile handoff) announces from the shell even\n // after this panel unmounts; absent adapter means the fork cannot render.\n if (openInApp !== undefined) {\n const { toast } = openInApp\n ctx.slots.inject('shell.overlay', () => ctx.slots.register({\n name: 'shell.overlay', id: 'multi-root-open-in-app.toast', locale: OPEN_IN_APP_NS,\n inject: () => ({ hooks: toast.hooks, dismiss: toast.dismiss }),\n }, OpenInAppToast))\n }\n // The files-tree fork's seats: an exclusive store and the verbatim face\n // over a lazily resolved `remote` — the same declaration upstream's own\n // Files registration makes, plus the session-bound open route. The fork\n // binds upstream's `sidebarFiles` namespace so its rows say exactly what\n // the native tree says.\n const filesTreeSeats = createFilesTreeSeats(ctx)\n const filesTreeT = ctx.locale.bind(FILES_TREE_NS)\n\n ctx.slots.inject('sidebar.footer.action', () => ctx.slots.register({\n name: 'sidebar.footer.action',\n id: SLOT_ID,\n // After the shipped foot controls; the sidebar sorts a list slot by `order`.\n order: 50,\n // A thunk: the sidebar re-reads it per projection, so the label follows the\n // active locale without re-registering.\n label: () => t('action.label'),\n locale: NS,\n // The composed props include the owner share (`{ wide }`): forwarding it\n // lets the trigger render its rail form when the sidebar collapses.\n }, owner => {\n const wide = (owner as { readonly wide?: boolean } | undefined)?.wide\n return createElement(WorkspaceFoldersAction, {\n panel,\n pickDirectory,\n sessionId,\n subscribeSession,\n t,\n ...(wide === undefined ? {} : { wide }),\n })\n }))\n // Optional: old surfaces without the Files actions slot retain the footer entry.\n ctx.slots.inject('sidebar.right.tab.files.actions', () => ctx.slots.register({\n name: 'sidebar.right.tab.files.actions', id: SLOT_ID, order: 50,\n // The fork's store + face, declared exactly as upstream declares them on\n // its own registration: the framework mints the store per session, runs\n // the inject factory with (sessionId, bound actions), and spreads the\n // face's members onto the composed props.\n store: filesTreeSeats.store,\n inject: filesTreeSeats.inject,\n }, function FilesActionsOccupant(props) {\n // The slot contract promises owner.absolutePath — the pane's primary root.\n // A runtime that stops carrying it falls back to the icon-only launcher\n // rather than to a nameless switcher.\n const absolutePath = (props as { readonly absolutePath?: string } | undefined)?.absolutePath\n // The slot is session-scoped: `props.sessionId` is THIS pane's session —\n // the same identity the framework minted `filesTree` with. Panel calls\n // must target it, not the global current-session resolver: a Files pane\n // that outlives a session switch would otherwise list — and fail to\n // route — another session's roots over its own tree and primary root.\n // The global resolver remains the fallback for a composition that\n // composes the occupant without session shares.\n // The composed session share is a stable string; resolving it inside a\n // callback memoized on that string keeps `refresh`'s identity — and with\n // it the list-call effect — stable across every render this occupant\n // sees, instead of re-issuing `list` on each upstream store write.\n const composedSessionId = (props as { readonly sessionId?: string } | undefined)?.sessionId\n const paneSessionId = useCallback(\n (): string | undefined => composedSessionId ?? sessionId(),\n [composedSessionId],\n )\n // The wrapper is rebuilt per render but every member it carries is a\n // framework-stable prop or an apply-level constant, so the switcher's\n // takeover effect — which keys on the selection, not the wrapper —\n // never restarts because of it. `undefined` means the fork cannot mount.\n const filesTree = createFilesTreeSurface(props, filesTreeT)\n return absolutePath === undefined\n ? createElement(WorkspaceFoldersAction, { panel, pickDirectory, sessionId: paneSessionId, subscribeSession, t, compact: true })\n : createElement(RootSwitcher, { primaryPath: absolutePath, panel, pickDirectory, sessionId: paneSessionId, subscribeSession, t, openInApp: openInApp?.adapter, filesTree })\n }))\n}\n\n/**\n * Read one optional service by name.\n *\n * Both lookups are deliberately untyped reads: the client Session Controller\n * and the workspace UI service are composed by the surface, not by this\n * plugin, and neither is a dependency it may assume (the footer action exists\n * on surfaces where they do not). Absence is a supported state — the panel then\n * shows \"No active session\" and does not ask the host to guess a workspace root.\n * @param ctx - the client context.\n * @param name - the service key to read.\n * @returns the service, or `undefined` when this composition has none.\n */\nfunction readService<T>(ctx: ClientContext, name: string): T | undefined {\n const reader = ctx as unknown as { get(key: string): unknown }\n return reader.get(name) as T | undefined\n}\n\nexport type { PanelClient, Translate }\n"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,29,35,36,40],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCA,SAAgB,mBAAmB,UAAuC;GACxE,MAAM,WAAW,eAAe,QAAQ;GACxC,IAAI,aAAa,KAAA,GAAW,OAAO,KAAA;GACnC,MAAM,UAAU,SAAS;GACzB,IAAI,OAAO,YAAY,YAAY,YAAY,IAAI,OAAO;GAC1D,OAAO,kBAAkB,SAAS,IAAI;EACxC;;EAGA,SAAgB,kBAAkB,UAAmB,UAAkC;GACrF,IAAI,aAAa,QAAQ,OAAO,aAAa,UAAU,aAAa,CAAC;GACrE,MAAM,OAAQ,SAA6E;GAC3F,OAAO,OAAO,MAAM,cAAc,aAAa,KAAK,UAAU,QAAQ,UAAU,CAAC;EACnF;;EAGA,SAAgB,wBAAwB,UAAmB,UAAkC;GAC3F,IAAI,WAAW,mBAAmB,QAAQ;GAC1C,OAAO,kBAAkB,gBAAgB;IACvC,MAAM,UAAU,mBAAmB,QAAQ;IAC3C,IAAI,YAAY,UAAU;KAAE,WAAW;KAAS,SAAS;IAAE;GAC7D,CAAC;EACH;;;;;;;;EASA,SAAS,eAAe,UAA6C;GACnE,IAAI,aAAa,QAAQ,OAAO,aAAa,UAAU,OAAO,KAAA;GAC9D,MAAM,OAAQ,SAAgC;GAC9C,IAAI,SAAS,QAAQ,OAAO,SAAS,UAAU,OAAO,KA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