{"version":3,"file":"error-BFAEkmpX-CdO6uP22.cjs","names":[],"sources":["../../connect-core/build/error-BFAEkmpX.mjs"],"sourcesContent":["//#region src/error/internal/internal_errors.ts\nlet _build;\n/** Wired once by `nice_core_errors` at module init to avoid an import cycle. */\nfunction _setInternalErrorBuilder(fn) {\n\t_build = fn;\n}\n/**\n* Build (for throwing) one of `nice-error`'s internal errors as a `NiceError`.\n* Falls back to a plain `Error` only in the unusual case where it's called before\n* `nice_core_errors` has registered the builder.\n*/\nfunction internalNiceError(kind, ctx) {\n\tif (_build != null) return _build(kind, ctx);\n\treturn /* @__PURE__ */ new Error(`[nice-error:${kind}]${ctx != null ? ` ${JSON.stringify(ctx)}` : \"\"}`);\n}\n//#endregion\n//#region src/error/utils/getErrorDomainProps.ts\n/**\n* Read the domain props (`domain` / `allDomains`) off a `NiceError` or its `def`.\n*\n* A `NiceError`'s `def` is `Omit<ERR_DEF, \"schema\">`, so widening it to the full\n* `INiceErrorDomainProps` for domain/ancestry checks needs one cast. This helper is\n* the single place that cast lives, instead of scattering it across every guard.\n*/\nfunction getErrorDomainProps(holder) {\n\treturn holder.def;\n}\n//#endregion\n//#region src/error/utils/jsErrorOrCastJsError.ts\nfunction jsErrorOrCastJsError(error, logMessage = true) {\n\tif (error instanceof Error) return Object.assign(error, { message: error.message });\n\tconst message = error?.message ?? (typeof error === \"string\" ? error : \"No error message found\");\n\tif (logMessage) console.error(`An unknown and unstructured error was thrown: ${message}`, error);\n\treturn {\n\t\t...new Error(message),\n\t\t...error\n\t};\n}\n//#endregion\n//#region src/error/utils/logger.ts\nlet activeLogger = {\n\twarn: (message, meta) => meta !== void 0 ? console.warn(message, meta) : console.warn(message),\n\tdebug: (message, meta) => meta !== void 0 ? console.debug(message, meta) : console.debug(message),\n\terror: (message, meta) => meta !== void 0 ? console.error(message, meta) : console.error(message)\n};\n/** Replace the logger `nice-error` uses for internal diagnostics. */\nfunction setNiceErrorLogger(logger) {\n\tactiveLogger = logger;\n}\n/** The logger `nice-error` currently logs through (defaults to `console`). */\nfunction getNiceErrorLogger() {\n\treturn activeLogger;\n}\n//#endregion\n//#region src/error/NiceError/nice_error.static.ts\nconst DUR_OBJ_PACK_PREFIX = \"NE_DUROBJ[[\";\nconst DUR_OBJ_PACK_SUFFIX = \"]]NE_DUROBJ\";\n/**\n* The domain of the generic wrapper `castNiceError` produces for anything that\n* wasn't already a `NiceError` (native throws, error-like objects, nullish,\n* primitives). `NiceError.isUnhandled` is defined as \"belongs to this domain\" —\n* i.e. an error we never accounted for and had to wrap. Kept here (not imported\n* from `nice_core_errors`) so `NiceError` can reference it without an import cycle.\n*/\nconst ERR_CAST_NOT_NICE_DOMAIN = \"err_cast_not_nice\";\n//#endregion\n//#region src/error/utils/packError/packError.enums.ts\nlet EErrorPackType = /* @__PURE__ */ function(EErrorPackType) {\n\tEErrorPackType[\"no_pack\"] = \"no_pack\";\n\tEErrorPackType[\"msg_pack\"] = \"msg_pack\";\n\tEErrorPackType[\"cause_pack\"] = \"cause_pack\";\n\treturn EErrorPackType;\n}({});\n//#endregion\n//#region src/error/utils/packError/causePack.ts\nconst causePack = (error) => {\n\terror._packedState = {\n\t\tcause: error.cause,\n\t\tpackedAs: \"cause_pack\"\n\t};\n\terror.cause = `${DUR_OBJ_PACK_PREFIX}${JSON.stringify(error.toJsonObject())}${DUR_OBJ_PACK_SUFFIX}`;\n\treturn error;\n};\n//#endregion\n//#region src/error/utils/packError/msgPack.ts\nconst msgPack = (error) => {\n\terror._packedState = {\n\t\tmessage: error.cleanMessage,\n\t\tpackedAs: \"msg_pack\"\n\t};\n\terror.message = `${DUR_OBJ_PACK_PREFIX}${JSON.stringify(error.toJsonObject())}${DUR_OBJ_PACK_SUFFIX}`;\n\treturn error;\n};\n//#endregion\n//#region src/error/utils/packError/packError.ts\nconst packError = (error, packType = \"msg_pack\") => {\n\tif (packType === \"no_pack\") return error;\n\tif (packType === \"msg_pack\") return msgPack(error);\n\treturn causePack(error);\n};\n//#endregion\n//#region src/error/utils/serializeErrorCause.ts\n/**\n* JSON-safe serialization of an error `cause` (and `AggregateError.errors`),\n* walked to a bounded depth so a nested `cause` chain survives transport without\n* dragging along non-serializable values or risking unbounded / circular nesting.\n*/\nconst DEFAULT_CAUSE_DEPTH = 4;\nfunction isErrorLike(value) {\n\tif (value instanceof Error) return true;\n\tif (typeof value !== \"object\" || value == null) return false;\n\tconst o = value;\n\treturn typeof o[\"name\"] === \"string\" && typeof o[\"message\"] === \"string\";\n}\n/**\n* Convert an arbitrary `cause` value into something JSON-safe.\n* - Errors / error-like objects → `{ name, message, stack, cause?, errors? }`,\n*   recursing into `cause` and `AggregateError.errors` until `depth` runs out.\n* - Other values → returned as-is when JSON-serializable, else `String(value)`.\n*/\nfunction serializeErrorCause(value, depth = DEFAULT_CAUSE_DEPTH) {\n\tif (value == null) return value;\n\tif (isErrorLike(value)) {\n\t\tconst out = {\n\t\t\tname: value.name,\n\t\t\tmessage: value.message,\n\t\t\tstack: value.stack\n\t\t};\n\t\tconst aggregate = value.errors;\n\t\tif (Array.isArray(aggregate)) out.errors = depth > 0 ? aggregate.map((sub) => serializeErrorCause(sub, depth - 1)) : [];\n\t\tif (value.cause != null && depth > 0) out.cause = serializeErrorCause(value.cause, depth - 1);\n\t\treturn out;\n\t}\n\ttry {\n\t\tJSON.stringify(value);\n\t\treturn value;\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n//#endregion\n//#region src/error/NiceError/NiceError.ts\nvar NiceError = class extends Error {\n\tname = \"NiceError\";\n\tdef;\n\t/** Primary id is first entry in ids. */\n\tids;\n\thttpStatusCode;\n\ttimeCreated;\n\tcleanMessage;\n\toriginError;\n\t_packedState;\n\t/** Internal: all active id → reconciled data pairs. */\n\t_errorDataMap;\n\tconstructor(options) {\n\t\tconst messagePure = options.message;\n\t\tconst prefixedMessage = `[${options.def.domain}](${options.ids.join(\",\")}) ${messagePure}`;\n\t\tsuper(prefixedMessage);\n\t\tthis.cleanMessage = messagePure;\n\t\tthis.def = options.def;\n\t\tthis.ids = options.ids;\n\t\tthis._errorDataMap = options.errorData;\n\t\tthis.httpStatusCode = options.httpStatusCode ?? 500;\n\t\tif (options.originError != null) this.originError = options.originError;\n\t\tthis.timeCreated = options.timeCreated ?? Date.now();\n\t}\n\t/**\n\t* `true` when this error is the generic wrapper `castNiceError` produces for a\n\t* value that wasn't already a `NiceError` (native throw, error-like object,\n\t* nullish, primitive) — i.e. an error that fell through without being handled\n\t* by any defined domain.\n\t*\n\t* Defined as \"belongs to the `err_cast_not_nice` domain\", so it is stable across\n\t* a serialization round-trip (the domain travels on the wire) and is `false` for\n\t* every domain-defined error, including a real `NiceError` reconstructed from JSON.\n\t*/\n\tget isUnhandled() {\n\t\treturn this.def.domain === ERR_CAST_NOT_NICE_DOMAIN;\n\t}\n\t/**\n\t* Type guard: returns `true` if this error was created with (or contains) the\n\t* given `id`. After the guard, `getContext(id)` will be strongly typed.\n\t*/\n\thasId(id) {\n\t\treturn id in this._errorDataMap;\n\t}\n\t/**\n\t* Returns `true` if this error contains **at least one** of the supplied ids.\n\t* Narrows `ACTIVE_IDS` to the matching subset of `IDS`.\n\t*/\n\thasOneOfIds(ids) {\n\t\treturn ids.some((id) => id in this._errorDataMap);\n\t}\n\t/** `true` when this error was created with more than one id (via `fromContext`). */\n\tget hasMultiple() {\n\t\treturn Object.keys(this._errorDataMap).length > 1;\n\t}\n\t/** Returns all active error ids on this instance. */\n\tgetIds() {\n\t\treturn Object.keys(this._errorDataMap);\n\t}\n\t/**\n\t* Returns the typed context value for the given error id.\n\t*\n\t* TypeScript will only allow you to call this with an id that is part of\n\t* `ACTIVE_IDS` (i.e. an id confirmed via `hasId` / `hasOneOfIds`, or passed\n\t* to `fromId` / `fromContext`).\n\t*\n\t* @throws If the context is in the `\"unhydrated\"` state — the error was\n\t* reconstructed from a JSON payload and its context has a custom serializer\n\t* that hasn't been run yet. Call `niceErrorDefined.hydrate(error)` first.\n\t*/\n\tgetContext(id) {\n\t\tconst state = this._errorDataMap[id]?.contextState;\n\t\tif (state == null) return;\n\t\tif (state.kind === \"unhydrated\") throw internalNiceError(\"context_unhydrated\", { id: String(id) });\n\t\treturn state.value;\n\t}\n\tgetErrorDataForId(id) {\n\t\treturn this._errorDataMap[id];\n\t}\n\twithOriginError(error) {\n\t\tthis.originError = jsErrorOrCastJsError(error);\n\t\tif (this._packedState?.packedAs !== \"cause_pack\") this.cause = this.originError;\n\t\treturn this;\n\t}\n\t/**\n\t* Returns `true` if `other` has the same domain and the exact same set of\n\t* active error ids as this error (order-independent).\n\t*\n\t* Useful for deduplication, retry logic, and asserting that two errors\n\t* represent the same \"kind\" of problem without comparing context values.\n\t*\n\t* ```ts\n\t* const a = err_auth.fromId(\"invalid_credentials\", { username: \"alice\" });\n\t* const b = err_auth.fromId(\"invalid_credentials\", { username: \"bob\" });\n\t* a.matches(b); // true  — same domain + same id set\n\t*\n\t* const c = err_auth.fromId(\"account_locked\");\n\t* a.matches(c); // false — same domain, different id\n\t* ```\n\t*/\n\tmatches(other) {\n\t\tconst myDef = getErrorDomainProps(this);\n\t\tconst otherDef = getErrorDomainProps(other);\n\t\tif (myDef.domain !== otherDef.domain) return false;\n\t\tconst myIds = this.getIds().map(String).sort();\n\t\tconst otherIds = other.getIds().map(String).sort();\n\t\tif (myIds.length !== otherIds.length) return false;\n\t\treturn myIds.every((id, i) => id === otherIds[i]);\n\t}\n\ttoJsonObject() {\n\t\tconst originError = this.originError ? {\n\t\t\tname: this.originError.name,\n\t\t\tmessage: this.originError.cleanMessage ?? this.originError.message,\n\t\t\tstack: this.originError.stack,\n\t\t\tcause: serializeErrorCause(this.originError.cause),\n\t\t\t...Array.isArray(this.originError.errors) ? { errors: this.originError.errors.map((e) => serializeErrorCause(e)) } : {}\n\t\t} : void 0;\n\t\tconst def = {\n\t\t\tdomain: this.def.domain,\n\t\t\tallDomains: this.def.allDomains\n\t\t};\n\t\tif (this.def.defaultHttpStatusCode != null) def[\"defaultHttpStatusCode\"] = this.def.defaultHttpStatusCode;\n\t\tif (this.def.defaultMessage != null) def[\"defaultMessage\"] = this.def.defaultMessage;\n\t\tconst errorData = {};\n\t\tfor (const rawId of Object.keys(this._errorDataMap)) {\n\t\t\tconst id = rawId;\n\t\t\tconst data = this._errorDataMap[id];\n\t\t\tif (data == null) continue;\n\t\t\tlet contextState;\n\t\t\tif (data.contextState.kind === \"hydrated\") contextState = {\n\t\t\t\tkind: \"unhydrated\",\n\t\t\t\tserialized: data.contextState.serialized\n\t\t\t};\n\t\t\telse contextState = data.contextState;\n\t\t\terrorData[id] = {\n\t\t\t\tcontextState,\n\t\t\t\tmessage: data.message,\n\t\t\t\thttpStatusCode: data.httpStatusCode,\n\t\t\t\ttimeAdded: data.timeAdded\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tname: \"NiceError\",\n\t\t\tdef,\n\t\t\tids: this.ids,\n\t\t\terrorData,\n\t\t\tisUnhandled: this.isUnhandled,\n\t\t\tmessage: this.cleanMessage,\n\t\t\thttpStatusCode: this.httpStatusCode,\n\t\t\ttimeCreated: this.timeCreated,\n\t\t\t...this.stack != null ? { stack: this.stack } : {},\n\t\t\toriginError\n\t\t};\n\t}\n\ttoJSON() {\n\t\treturn this.toJsonObject();\n\t}\n\t/**\n\t* The **wire form** — {@link toJsonObject} minus the server-only diagnostic fields (`stack`,\n\t* `originError`) that disclose server internals and fatten the frame. Everything a peer needs to\n\t* reconstruct a fully-typed error survives — ids, per-id context, rendered message, `isUnhandled`,\n\t* and the domain definition — so `castNiceError` on the far side yields an error whose `getIds()`,\n\t* `getContext()`, `message`, and `isUnknownOutcomeRejection(...)` all behave identically.\n\t*\n\t* Use this whenever an error crosses a trust/observability boundary to an untrusted peer (e.g. a\n\t* realm reject frame fanned out to every client): the stack must not leave the process, and at\n\t* high frequency (a cursor-write reject storm) the ~1.5 kB full form is mostly stack. Keep the\n\t* complete {@link toJsonObject} for server-side logs and hooks.\n\t*/\n\ttoWireJsonObject() {\n\t\tconst { stack: _stack, originError: _originError, ...wire } = this.toJsonObject();\n\t\treturn wire;\n\t}\n\t/**\n\t* A flat, log-friendly object for telemetry / structured logging — distinct\n\t* from {@link toJsonObject} (the wire form). Surfaces {@link isUnhandled} so a\n\t* sink can separate \"an error we accounted for\" from \"one we didn't\".\n\t*/\n\ttoStructuredLog() {\n\t\treturn {\n\t\t\tdomain: this.def.domain,\n\t\t\tids: this.getIds().map(String),\n\t\t\tmessage: this.cleanMessage,\n\t\t\thttpStatusCode: this.httpStatusCode,\n\t\t\tisUnhandled: this.isUnhandled,\n\t\t\ttimeCreated: this.timeCreated,\n\t\t\t...this.originError != null ? { originError: this.originError } : {}\n\t\t};\n\t}\n\ttoJsonString() {\n\t\treturn JSON.stringify(this.toJsonObject());\n\t}\n\ttoHttpResponse() {\n\t\treturn new Response(this.toJsonString(), {\n\t\t\tstatus: this.httpStatusCode,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n\thydrate(definedNiceError) {\n\t\treturn definedNiceError.hydrate(this);\n\t}\n\t/**\n\t* Iterates `cases` in order, finds the first whose domain matches this error\n\t* (via `is()`), optionally further filters by active ids, hydrates the error,\n\t* calls the handler, and returns `true`. Returns `false` if no case matched.\n\t*\n\t* Build cases with `forDomain` (any id in the domain) or `forIds` (specific\n\t* id subset). Handlers are invoked synchronously — any returned Promise is\n\t* not awaited. Use `handleWithAsync` when handlers are async.\n\t*\n\t* @example\n\t* ```ts\n\t* const handled = error.handleWith([\n\t*   forIds(err_feature, [\"not_found\"], (h) => {\n\t*     res.status(404).json({ missing: h.getContext(\"not_found\").resource });\n\t*   }),\n\t*   forDomain(err_feature, (h) => {\n\t*     matchFirst(h, {\n\t*       forbidden: ({ userId }) => res.status(403).json({ userId }),\n\t*       _: () => res.status(500).end(),\n\t*     });\n\t*   }),\n\t*   forDomain(err_service, (h) => {\n\t*     res.status(h.httpStatusCode).json({ error: h.message });\n\t*   }),\n\t* ]);\n\t* if (!handled) next(error);\n\t* ```\n\t*/\n\thandleWithSync(handlerInput, handlerOptions = {}) {\n\t\tconst handlersArray = Array.isArray(handlerInput) ? handlerInput : [handlerInput];\n\t\tfor (const handler of handlersArray) {\n\t\t\tconst result = handler.handleErrorWithPromiseInspection(this, handlerOptions);\n\t\t\tif (result.matched) {\n\t\t\t\tif (result.isPromise) getNiceErrorLogger().warn(internalNiceError(\"handler_returned_promise_in_sync\", { identifier: result.target.identifier }).message);\n\t\t\t\treturn result.isPromise ? void 0 : result.handlerResponse;\n\t\t\t}\n\t\t}\n\t\tif (handlerOptions.throwOnUnhandled === true) throw this;\n\t}\n\t/**\n\t* Same matching logic as `handleWith`, but `await`s the handler's returned\n\t* Promise before resolving. Use this when your handlers perform async work\n\t* (database writes, HTTP calls, etc.).\n\t*\n\t* @example\n\t* ```ts\n\t* const handled = await error.handleWithAsync([\n\t*   forDomain(err_payments, async (h) => {\n\t*     await db.logFailedPayment(h);\n\t*     await notifyOps(h.message);\n\t*   }),\n\t* ]);\n\t* ```\n\t*/\n\tasync handleWithAsync(handlerInput, handlerOptions = {}) {\n\t\tconst handlersArray = Array.isArray(handlerInput) ? handlerInput : [handlerInput];\n\t\tfor (const handler of handlersArray) {\n\t\t\tconst result = handler.handleErrorWithPromiseInspection(this, handlerOptions);\n\t\t\tif (result.matched) return result.isPromise ? await result.handlerPromise : result.handlerResponse;\n\t\t}\n\t\tif (handlerOptions.throwOnUnhandled === true) throw this;\n\t}\n\tget isPacked() {\n\t\treturn this._packedState != null;\n\t}\n\tpack(packType = \"msg_pack\") {\n\t\tif (this.isPacked) return this;\n\t\treturn packError(this, packType);\n\t}\n\tunpack() {\n\t\tif (this._packedState == null) return this;\n\t\tif (this._packedState.packedAs === \"msg_pack\") this.message = this._packedState.message;\n\t\tif (this._packedState.packedAs === \"cause_pack\") this.cause = this._packedState.cause;\n\t\tthis._packedState = void 0;\n\t\tdelete this._packedState;\n\t\treturn this;\n\t}\n};\n//#endregion\n//#region src/error/NiceError/NiceErrorHydrated.ts\nvar NiceErrorHydrated = class NiceErrorHydrated extends NiceError {\n\tdef;\n\tniceErrorDefined;\n\tconstructor(options) {\n\t\tsuper(options);\n\t\tthis.def = options.def;\n\t\tthis.niceErrorDefined = options.niceErrorDefined;\n\t}\n\t/**\n\t* Returns a **new** `NiceErrorHydrated` with additional id+context entries merged in.\n\t* The returned error's `ACTIVE_IDS` is the union of the original ids and the\n\t* newly supplied keys.\n\t*\n\t* ```ts\n\t* const err = errDef.fromId(\"id_a\", { a: 1 })\n\t*   .addContext({ id_b: { b: \"x\" } });\n\t* err.getIds(); // [\"id_a\", \"id_b\"]\n\t* ```\n\t*/\n\taddContext(context) {\n\t\tconst newIds = Object.keys(context);\n\t\tconst newErrorData = {};\n\t\tfor (const id of newIds) newErrorData[id] = this.niceErrorDefined.reconcileErrorDataForId(id, context[id]);\n\t\tconst mergedErrorData = {\n\t\t\t...this._errorDataMap,\n\t\t\t...newErrorData\n\t\t};\n\t\tconst mergedIds = Array.from(/* @__PURE__ */ new Set([...this.getIds(), ...Object.keys(context)]));\n\t\treturn new NiceErrorHydrated({\n\t\t\tdef: this.def,\n\t\t\tniceErrorDefined: this.niceErrorDefined,\n\t\t\tids: mergedIds,\n\t\t\terrorData: mergedErrorData,\n\t\t\tmessage: this.cleanMessage,\n\t\t\thttpStatusCode: this.httpStatusCode,\n\t\t\toriginError: this.originError\n\t\t});\n\t}\n\t/**\n\t* Returns a **new** `NiceErrorHydrated` with an additional error id (and its context,\n\t* if the schema requires one). Equivalent to `addContext({ [id]: context })`\n\t* but mirrors the `fromId` ergonomics for single-id additions.\n\t*/\n\taddId(...args) {\n\t\tconst [id, context] = args;\n\t\tconst reconciledData = this.niceErrorDefined.reconcileErrorDataForId(id, context);\n\t\tconst errorDataMap = {};\n\t\terrorDataMap[id] = reconciledData;\n\t\tconst mergedContexts = {\n\t\t\t...this._errorDataMap,\n\t\t\t...errorDataMap\n\t\t};\n\t\tconst mergedIds = Array.from(/* @__PURE__ */ new Set([...this.getIds(), id]));\n\t\treturn new NiceErrorHydrated({\n\t\t\tdef: this.def,\n\t\t\tniceErrorDefined: this.niceErrorDefined,\n\t\t\tids: mergedIds,\n\t\t\terrorData: mergedContexts,\n\t\t\tmessage: this.cleanMessage,\n\t\t\thttpStatusCode: this.httpStatusCode,\n\t\t\toriginError: this.originError\n\t\t});\n\t}\n};\n//#endregion\n//#region src/error/observability/tap.ts\nconst taps = /* @__PURE__ */ new Set();\n/**\n* Register a tap fired for every `NiceError` created via a domain\n* (`fromId` / `fromContext`). Returns an unsubscribe function.\n*\n* Opt-in and zero-cost when unused. A tap that throws is swallowed so it can\n* never break error creation.\n*/\nfunction onNiceError(tap) {\n\ttaps.add(tap);\n\treturn () => {\n\t\ttaps.delete(tap);\n\t};\n}\n/** Internal: notify all registered taps. Never throws. */\nfunction emitNiceError(error) {\n\tif (taps.size === 0) return;\n\tfor (const tap of taps) try {\n\t\ttap(error);\n\t} catch {}\n}\n//#endregion\n//#region src/error/NiceErrorDomain/NiceErrorDomain.ts\nvar NiceErrorDomain = class NiceErrorDomain {\n\tdomain;\n\tallDomains;\n\tdefaultHttpStatusCode;\n\tdefaultMessage;\n\t/** Kept for runtime use (message resolution, httpStatusCode, context serialization, etc.). */\n\t_schema;\n\t_definedChildNiceErrors = [];\n\t_definedParentNiceError;\n\t/** Set by `.packAs()` — explicit per-instance override, takes priority over `_packAsFn`. */\n\t_setPack;\n\t/** Set at definition time — called dynamically each time an error is created. */\n\t_packAsFn;\n\tconstructor(definition) {\n\t\tthis.domain = definition.domain;\n\t\tthis.allDomains = definition.allDomains;\n\t\tthis._schema = definition.schema;\n\t\tif (definition.packAs != null) this._packAsFn = definition.packAs;\n\t\tif (definition.defaultHttpStatusCode != null) this.defaultHttpStatusCode = definition.defaultHttpStatusCode;\n\t\tif (definition.defaultMessage != null) this.defaultMessage = definition.defaultMessage;\n\t}\n\t/**\n\t* Creates a child domain that inherits this domain in `allDomains`.\n\t* The child has its own schema and its own domain string.\n\t*/\n\tcreateChildDomain(subErrorDef) {\n\t\tconst child = new NiceErrorDomain({\n\t\t\tdomain: subErrorDef.domain,\n\t\t\tallDomains: [subErrorDef.domain, ...this.allDomains],\n\t\t\tschema: subErrorDef.schema,\n\t\t\tdefaultHttpStatusCode: subErrorDef.defaultHttpStatusCode,\n\t\t\tdefaultMessage: subErrorDef.defaultMessage\n\t\t});\n\t\tthis.addChildNiceErrorDomain(child);\n\t\tchild.addParentNiceErrorDomain(this);\n\t\tif (subErrorDef.packAs != null) child._packAsFn = subErrorDef.packAs;\n\t\telse if (this._setPack) child.packAs(this._setPack);\n\t\telse if (this._packAsFn) child._packAsFn = this._packAsFn;\n\t\treturn child;\n\t}\n\taddParentNiceErrorDomain(parentError) {\n\t\tif (this._definedParentNiceError?.domain === parentError.domain) return;\n\t\tthis._definedParentNiceError = {\n\t\t\tdomain: parentError.domain,\n\t\t\tdefinedError: parentError\n\t\t};\n\t}\n\taddChildNiceErrorDomain(child) {\n\t\tif (this._definedChildNiceErrors.some((linked) => linked.domain === child.domain)) return;\n\t\tthis._definedChildNiceErrors.push({\n\t\t\tdomain: child.domain,\n\t\t\tdefinedError: child\n\t\t});\n\t\tif (this._definedParentNiceError) this._definedParentNiceError.definedError.addChildNiceErrorDomain(child);\n\t}\n\tpackAs(pack) {\n\t\tthis._setPack = pack;\n\t\treturn this;\n\t}\n\tcreateError(input) {\n\t\tconst err = new NiceErrorHydrated(input);\n\t\temitNiceError(err);\n\t\tconst packType = this._setPack ?? this._packAsFn?.();\n\t\tif (packType != null && packType !== \"no_pack\") return err.pack(packType);\n\t\treturn err;\n\t}\n\t/**\n\t* Promotes a plain `NiceError<ERR_DEF>` back into a `NiceErrorHydrated` so\n\t* that builder methods (`addId`, `addContext`, etc.) are available again.\n\t*\n\t* For each active id, if the context is in the `\"unhydrated\"` state (i.e. the\n\t* error was reconstructed from a JSON payload), `hydrate` calls\n\t* `fromJsonSerializable` to reconstruct the typed value and advances the state\n\t* to `\"hydrated\"`. Ids already in `\"hydrated\"` or `\"raw_unset\"` state\n\t* are passed through unchanged.\n\t*\n\t* @throws If `error.def.domain` does not match this definition's domain. Use\n\t* `niceErrorDefined.isExact(error)` before calling `hydrate` to ensure compatibility.\n\t*\n\t* ```ts\n\t* const raw = castNiceError(apiResponseBody);\n\t*\n\t* if (err_user_auth.isExact(raw)) {\n\t*   const hydrated = err_user_auth.hydrate(raw);\n\t*   // hydrated.getContext(\"invalid_credentials\") — fully typed, no throw\n\t*   // hydrated.addId / addContext — available again\n\t* }\n\t* ```\n\t*/\n\thydrate(error) {\n\t\tconst errDef = getErrorDomainProps(error);\n\t\tif (errDef.domain !== this.domain) throw internalNiceError(\"hydrate_domain_mismatch\", {\n\t\t\texpected: this.domain,\n\t\t\treceived: errDef.domain\n\t\t});\n\t\tconst finalError = error instanceof NiceError ? error : new NiceError(error);\n\t\tconst reconciledErrorData = {};\n\t\tfor (const id of finalError.getIds()) {\n\t\t\tconst existingData = finalError.getErrorDataForId(id);\n\t\t\tif (existingData == null) continue;\n\t\t\tlet contextState = existingData.contextState;\n\t\t\tif (contextState.kind === \"unhydrated\") {\n\t\t\t\tconst deserialize = this._schema[id]?.context?.serialization?.fromJsonSerializable;\n\t\t\t\tif (deserialize != null) contextState = {\n\t\t\t\t\tkind: \"hydrated\",\n\t\t\t\t\tvalue: deserialize(contextState.serialized),\n\t\t\t\t\tserialized: contextState.serialized\n\t\t\t\t};\n\t\t\t}\n\t\t\treconciledErrorData[id] = {\n\t\t\t\tcontextState,\n\t\t\t\tmessage: existingData.message,\n\t\t\t\thttpStatusCode: existingData.httpStatusCode,\n\t\t\t\ttimeAdded: existingData.timeAdded\n\t\t\t};\n\t\t}\n\t\treturn new NiceErrorHydrated({\n\t\t\tdef: this._buildDef(),\n\t\t\tniceErrorDefined: this,\n\t\t\tids: finalError.ids,\n\t\t\terrorData: reconciledErrorData,\n\t\t\tmessage: finalError.cleanMessage ?? finalError.message,\n\t\t\thttpStatusCode: finalError.httpStatusCode,\n\t\t\toriginError: finalError.originError,\n\t\t\ttimeCreated: finalError.timeCreated\n\t\t});\n\t}\n\t/**\n\t* Creates a `NiceErrorHydrated` for a single error id.\n\t*\n\t* - `id` autocompletes to the schema keys.\n\t* - The second argument `context` is required / optional / absent based on\n\t*   whether the schema entry declares `context.required: true`.\n\t* - The returned error has `ACTIVE_IDS` narrowed to exactly `K`, so\n\t*   `getContext(id)` is immediately strongly typed.\n\t*/\n\tfromId(...args) {\n\t\tconst [id, context] = args;\n\t\tconst reconciledData = this.reconcileErrorDataForId(id, context);\n\t\tconst errorData = {};\n\t\terrorData[id] = reconciledData;\n\t\tconst err = this.createError({\n\t\t\tdef: this._buildDef(),\n\t\t\tniceErrorDefined: this,\n\t\t\tids: [id],\n\t\t\terrorData,\n\t\t\tmessage: reconciledData.message,\n\t\t\thttpStatusCode: reconciledData.httpStatusCode\n\t\t});\n\t\tif (typeof Error.captureStackTrace === \"function\") Error.captureStackTrace(err, this.fromId);\n\t\treturn err;\n\t}\n\tfromContext(context) {\n\t\tconst ids = Object.keys(context);\n\t\tif (ids.length === 0) throw internalNiceError(\"from_context_empty\", void 0);\n\t\tconst errorData = {};\n\t\tfor (const id of ids) errorData[id] = this.reconcileErrorDataForId(id, context[id]);\n\t\tconst primaryId = ids[0];\n\t\tconst err = this.createError({\n\t\t\tdef: this._buildDef(),\n\t\t\tniceErrorDefined: this,\n\t\t\tids,\n\t\t\terrorData,\n\t\t\tmessage: errorData[primaryId].message,\n\t\t\thttpStatusCode: errorData[primaryId].httpStatusCode\n\t\t});\n\t\tif (typeof Error.captureStackTrace === \"function\") Error.captureStackTrace(err, this.fromContext);\n\t\treturn err;\n\t}\n\t/**\n\t* Returns `true` if `error` is a `NiceError` whose `def.domain` exactly matches\n\t* this definition's domain.\n\t*\n\t* Use this after `castNiceError` to narrow an unknown error to this specific\n\t* domain before accessing its typed ids/context:\n\t*\n\t* ```ts\n\t* const caught = castNiceError(e);\n\t*\n\t* if (err_user_auth.isExact(caught)) {\n\t*   // caught is now NiceError<typeof err_user_auth's ERR_DEF>\n\t*   const hydrated = err_user_auth.hydrate(caught);\n\t*   const { username } = hydrated.getContext(\"invalid_credentials\");\n\t* }\n\t* ```\n\t*/\n\tisExact(error) {\n\t\tif (!(error instanceof NiceError)) return false;\n\t\treturn getErrorDomainProps(error).domain === this.domain;\n\t}\n\tisThisOrChild(error) {\n\t\tif (!(error instanceof NiceError)) return false;\n\t\tconst errDef = getErrorDomainProps(error);\n\t\treturn errDef.domain === this.domain || this.allDomains.includes(errDef.domain);\n\t}\n\t/**\n\t* Returns `true` if this domain appears anywhere in the target's ancestry\n\t* chain (including an exact domain match).\n\t*\n\t* Accepts either a `NiceErrorDomain` (domain definition) or a `NiceError`\n\t* instance (extracts the domain from its `def`).\n\t*/\n\tisParentOf(target) {\n\t\tconst allDomains = target instanceof NiceError ? getErrorDomainProps(target).allDomains : target.allDomains;\n\t\treturn Array.isArray(allDomains) && allDomains.includes(this.domain);\n\t}\n\t_buildDef() {\n\t\treturn {\n\t\t\tdomain: this.domain,\n\t\t\tallDomains: this.allDomains,\n\t\t\tschema: this._schema\n\t\t};\n\t}\n\t_resolveMessage(id, context) {\n\t\tconst entry = this._schema[id];\n\t\tif (typeof entry?.message === \"function\") return entry.message(context);\n\t\tif (typeof entry?.message === \"string\") return entry.message;\n\t\treturn this.defaultMessage ?? `[${this.domain}::${id}] An error occurred.`;\n\t}\n\t_resolveHttpStatusCode(id, context) {\n\t\tconst entry = this._schema[id];\n\t\tlet httpStatusCode;\n\t\tif (typeof entry?.httpStatusCode === \"function\") httpStatusCode = entry.httpStatusCode(context);\n\t\tif (typeof entry?.httpStatusCode === \"number\") httpStatusCode = entry.httpStatusCode;\n\t\treturn typeof httpStatusCode === \"number\" ? httpStatusCode : this.defaultHttpStatusCode ?? 500;\n\t}\n\treconcileErrorDataForId(id, context) {\n\t\tconst message = this._resolveMessage(id, context);\n\t\tconst httpStatusCode = this._resolveHttpStatusCode(id, context);\n\t\tconst entry = this._schema[id];\n\t\tlet contextState;\n\t\tif (context != null && entry?.context?.serialization != null) contextState = {\n\t\t\tkind: \"hydrated\",\n\t\t\tvalue: context,\n\t\t\tserialized: entry.context.serialization.toJsonSerializable(context)\n\t\t};\n\t\telse contextState = {\n\t\t\tkind: \"serde_unset\",\n\t\t\tvalue: context\n\t\t};\n\t\treturn {\n\t\t\tcontextState,\n\t\t\tmessage,\n\t\t\thttpStatusCode,\n\t\t\ttimeAdded: Date.now()\n\t\t};\n\t}\n};\n//#endregion\n//#region src/error/NiceErrorDomain/defineNiceError.ts\nconst defineNiceError = (definition) => {\n\treturn new NiceErrorDomain({\n\t\tdomain: definition.domain,\n\t\tallDomains: [definition.domain],\n\t\tschema: definition.schema,\n\t\t...definition.packAs != null ? { packAs: definition.packAs } : {}\n\t});\n};\n//#endregion\n//#region src/error/NiceErrorDomain/err.ts\nfunction err(meta) {\n\treturn meta ?? {};\n}\n//#endregion\n//#region src/error/internal/nice_core_errors.ts\nconst HTTP_UNPROCESSABLE_ENTITY = 422;\nconst HTTP_INTERNAL_SERVER_ERROR = 500;\nconst err_nice = defineNiceError({\n\tdomain: \"err_nice\",\n\tschema: {}\n});\nconst err_cast_not_nice = err_nice.createChildDomain({\n\tdomain: \"err_cast_not_nice\",\n\tdefaultHttpStatusCode: HTTP_UNPROCESSABLE_ENTITY,\n\tschema: {\n\t\t[\"native_error\"]: err({\n\t\t\tcontext: { required: true },\n\t\t\tmessage: ({ jsError }) => `A native JavaScript Error was encountered during casting: ${jsError.message}`,\n\t\t\thttpStatusCode: HTTP_INTERNAL_SERVER_ERROR\n\t\t}),\n\t\t[\"js_error_like_object\"]: err({\n\t\t\tcontext: { required: true },\n\t\t\tmessage: ({ jsErrorObject }) => `An object resembling a JavaScript Error was encountered during casting: [${jsErrorObject.name}] ${jsErrorObject.message}`,\n\t\t\thttpStatusCode: HTTP_INTERNAL_SERVER_ERROR\n\t\t}),\n\t\t[\"nullish_value\"]: err({\n\t\t\tcontext: { required: true },\n\t\t\tmessage: ({ value }) => `A nullish value [${value === null ? \"null\" : \"undefined\"}] was encountered during casting`\n\t\t}),\n\t\t[\"js_data_type\"]: err({\n\t\t\tcontext: { required: true },\n\t\t\tmessage: ({ jsDataType, jsDataValue }) => {\n\t\t\t\tlet inspectedValue;\n\t\t\t\ttry {\n\t\t\t\t\tinspectedValue = JSON.stringify(jsDataValue);\n\t\t\t\t} catch {}\n\t\t\t\treturn `A value of type [${jsDataType}] with value [${inspectedValue ?? \"UNSERIALIZABLE\"}] was encountered during casting, which is not a valid error type`;\n\t\t\t}\n\t\t}),\n\t\t[\"js_other\"]: err({\n\t\t\tcontext: { required: true },\n\t\t\tmessage: ({ jsDataValue }) => {\n\t\t\t\tlet inspectedValue;\n\t\t\t\ttry {\n\t\t\t\t\tinspectedValue = JSON.stringify(jsDataValue);\n\t\t\t\t} catch {}\n\t\t\t\treturn `An unhandled type [${typeof jsDataValue}] with value [${inspectedValue ?? \"UNSERIALIZABLE\"}] was encountered during casting, which is not a valid error type`;\n\t\t\t}\n\t\t})\n\t}\n});\nerr_nice.createChildDomain({\n\tdomain: \"err_nice_handler\",\n\tschema: {}\n});\n/**\n* `nice-error`'s own failure modes — thrown as `NiceError`s (not plain `Error`s)\n* so they are observable, pattern-matchable, and visible to the same handlers /\n* devtools / telemetry as every other error in the system. The ids live in\n* `internal_errors` so throw-sites can reference them without an import cycle.\n*/\nconst err_nice_error = err_nice.createChildDomain({\n\tdomain: \"err_nice_error\",\n\tdefaultHttpStatusCode: HTTP_INTERNAL_SERVER_ERROR,\n\tschema: {\n\t\t[\"context_unhydrated\"]: err({\n\t\t\tcontext: { required: true },\n\t\t\tmessage: ({ id }) => `[NiceError.getContext] Context for id \"${id}\" is in the \"unhydrated\" state. The error was reconstructed from a serialized payload but has not been deserialized yet. Call \\`niceErrorDomain.hydrate(error)\\` to reconstruct the typed context.`\n\t\t}),\n\t\t[\"hydrate_domain_mismatch\"]: err({\n\t\t\tcontext: { required: true },\n\t\t\tmessage: ({ expected, received }) => `[NiceErrorDomain.hydrate] Domain mismatch: this definition is \"${expected}\" but the error belongs to \"${received}\". Call \\`niceErrorDomain.isExact(error)\\` before hydrating to ensure compatibility.`\n\t\t}),\n\t\t[\"from_context_empty\"]: err({ message: \"[NiceErrorDomain.fromContext] context object must contain at least one error id.\" }),\n\t\t[\"handler_returned_promise_in_sync\"]: err({\n\t\t\tcontext: { required: true },\n\t\t\tmessage: ({ identifier }) => `[NiceError.handleWithSync] Handler ${identifier} returned a Promise but was called via \\`handleWithSync\\` (synchronous). The Promise will not be awaited. Use \\`handleWithAsync\\` for async handlers.`\n\t\t})\n\t}\n});\n_setInternalErrorBuilder((kind, ctx) => err_nice_error.fromId(kind, ctx));\n//#endregion\n//#region src/error/NiceErrorHandler/NiceErrorHandler.types.ts\nlet EErrorHandlerTargetType = /* @__PURE__ */ function(EErrorHandlerTargetType) {\n\tEErrorHandlerTargetType[\"ids\"] = \"ids\";\n\tEErrorHandlerTargetType[\"domain\"] = \"domain\";\n\tEErrorHandlerTargetType[\"default\"] = \"default\";\n\treturn EErrorHandlerTargetType;\n}({});\n//#endregion\n//#region src/error/NiceErrorHandler/NiceErrorHandler.ts\nvar NiceErrorHandler = class {\n\thandlerConfigs = [];\n\t_defaultRequester;\n\thandleErrorWithPromiseInspection(error, options) {\n\t\tfor (const handlerConfig of this.handlerConfigs) {\n\t\t\tif (!handlerConfig._matcher(error)) continue;\n\t\t\tconst errorResult = handlerConfig._requester(error);\n\t\t\tif (errorResult instanceof Promise) return {\n\t\t\t\tisPromise: true,\n\t\t\t\tmatched: true,\n\t\t\t\ttarget: handlerConfig.target,\n\t\t\t\thandlerPromise: errorResult\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tisPromise: false,\n\t\t\t\tmatched: true,\n\t\t\t\ttarget: handlerConfig.target,\n\t\t\t\thandlerResponse: errorResult\n\t\t\t};\n\t\t}\n\t\tif (this._defaultRequester) {\n\t\t\tconst defaultResult = this._defaultRequester(error);\n\t\t\tif (defaultResult instanceof Promise) return {\n\t\t\t\tisPromise: true,\n\t\t\t\tmatched: true,\n\t\t\t\ttarget: {\n\t\t\t\t\ttype: \"default\",\n\t\t\t\t\tidentifier: \"[matched:default]\"\n\t\t\t\t},\n\t\t\t\thandlerPromise: defaultResult\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tisPromise: false,\n\t\t\t\tmatched: true,\n\t\t\t\ttarget: {\n\t\t\t\t\ttype: \"default\",\n\t\t\t\t\tidentifier: \"[matched:default]\"\n\t\t\t\t},\n\t\t\t\thandlerResponse: defaultResult\n\t\t\t};\n\t\t}\n\t\tif (options?.throwOnUnhandled === true) throw error;\n\t\treturn {\n\t\t\tmatched: false,\n\t\t\tattemptedTargets: this.handlerConfigs.map((config) => config.target)\n\t\t};\n\t}\n\t/**\n\t* Register a handler that fires for **any** error whose domain matches `domain`.\n\t* The handler receives a fully hydrated error — `getContext`, `addId`, and `addContext`\n\t* are all available. First matching case wins.\n\t*/\n\tforDomain(domain, handler) {\n\t\tthis.handlerConfigs.push({\n\t\t\ttarget: {\n\t\t\t\ttype: \"domain\",\n\t\t\t\tdomain: domain.domain,\n\t\t\t\tidentifier: `[matched:domain:${domain.domain}]`\n\t\t\t},\n\t\t\t_matcher: (error) => domain.isExact(error),\n\t\t\t_requester: (error) => handler(domain.hydrate(error))\n\t\t});\n\t\treturn this;\n\t}\n\tforId(domain, id, handler) {\n\t\tthis.handlerConfigs.push({\n\t\t\ttarget: {\n\t\t\t\ttype: \"ids\",\n\t\t\t\tdomain: domain.domain,\n\t\t\t\tids: [id],\n\t\t\t\tidentifier: `[matched:ids:${domain.domain}:${id}]`\n\t\t\t},\n\t\t\t_matcher: (error) => domain.isExact(error) && error.hasId(id),\n\t\t\t_requester: (error) => handler(domain.hydrate(error))\n\t\t});\n\t\treturn this;\n\t}\n\tforIds(domain, ids, handler) {\n\t\tthis.handlerConfigs.push({\n\t\t\ttarget: {\n\t\t\t\ttype: \"ids\",\n\t\t\t\tdomain: domain.domain,\n\t\t\t\tids,\n\t\t\t\tidentifier: `[matched:ids:${domain.domain}:${ids.join(\",\")}]`\n\t\t\t},\n\t\t\t_matcher: (error) => domain.isExact(error) && ids.some((id) => error.hasId(id)),\n\t\t\t_requester: (error) => handler(domain.hydrate(error))\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t* Register a fallback handler that fires when no other case matches.\n\t* Only one default handler can be registered — calling this twice replaces the previous one.\n\t*/\n\tsetDefaultHandler(handler) {\n\t\tthis._defaultRequester = handler;\n\t\treturn this;\n\t}\n};\n//#endregion\n//#region src/error/NiceErrorHandler/handleWith.ts\nfunction forDomain(domain, handler) {\n\treturn new NiceErrorHandler().forDomain(domain, handler);\n}\nfunction forId(domain, id, handler) {\n\treturn new NiceErrorHandler().forId(domain, id, handler);\n}\nfunction forIds(domain, ids, handler) {\n\treturn new NiceErrorHandler().forIds(domain, ids, handler);\n}\n//#endregion\n//#region src/error/utils/isNiceErrorObject.ts\n/**\n* Returns `true` if `obj` is a JSON-serialised `NiceError` object matching the\n* current wire format (contextState-based errorData entries).\n*\n* Validates:\n* - Top-level shape (`name`, `message`, `isUnhandled`, `httpStatusCode`, `def`)\n* - Each `errorData` entry has a `contextState` with a valid `kind` discriminant\n*   (`\"no_serialization\"` or `\"unhydrated\"`) — rejecting payloads in the old\n*   format (`context` / `serialized` fields) to prevent silent data corruption.\n*/\nfunction isNiceErrorObject(obj) {\n\tif (typeof obj !== \"object\" || obj == null) return false;\n\tconst o = obj;\n\tif (o[\"name\"] !== \"NiceError\" || typeof o[\"message\"] !== \"string\" || typeof o[\"isUnhandled\"] !== \"boolean\" || typeof o[\"httpStatusCode\"] !== \"number\") return false;\n\tconst def = o[\"def\"];\n\tif (typeof def !== \"object\" || def == null) return false;\n\tconst d = def;\n\tif (typeof d[\"domain\"] !== \"string\" || !Array.isArray(d[\"allDomains\"])) return false;\n\tconst errorData = o[\"errorData\"];\n\tif (errorData != null) {\n\t\tif (typeof errorData !== \"object\") return false;\n\t\tfor (const entry of Object.values(errorData)) {\n\t\t\tif (entry == null) continue;\n\t\t\tif (typeof entry !== \"object\") return false;\n\t\t\tconst state = entry[\"contextState\"];\n\t\t\tif (state == null || typeof state !== \"object\") return false;\n\t\t\tconst kind = state[\"kind\"];\n\t\t\tif (kind !== \"serde_unset\" && kind !== \"unhydrated\") return false;\n\t\t}\n\t}\n\treturn true;\n}\n//#endregion\n//#region src/error/utils/isRegularErrorObject.ts\nfunction isRegularErrorJsonObject(obj) {\n\tif (typeof obj !== \"object\" || obj == null) return false;\n\tconst o = obj;\n\treturn typeof o[\"name\"] === \"string\" && typeof o[\"message\"] === \"string\";\n}\n//#endregion\n//#region src/error/utils/inspectPotentialError/inspectPotentialError.ts\nfunction interpretMessagePackedError(parsedError) {\n\tlet packedErrorStr;\n\tif (typeof parsedError.message === \"string\" && parsedError.message.includes(\"NE_DUROBJ[[\") && parsedError.message.includes(\"]]NE_DUROBJ\")) packedErrorStr = parsedError.message;\n\tif (typeof parsedError.cause === \"string\" && parsedError.cause.includes(\"NE_DUROBJ[[\") && parsedError.cause.includes(\"]]NE_DUROBJ\")) packedErrorStr = parsedError.cause;\n\tif (packedErrorStr != null) {\n\t\tconst jsonStr = packedErrorStr.split(DUR_OBJ_PACK_PREFIX)[1].split(DUR_OBJ_PACK_SUFFIX)[0];\n\t\ttry {\n\t\t\tconst errorObj = JSON.parse(jsonStr);\n\t\t\tif (isNiceErrorObject(errorObj)) return {\n\t\t\t\ttype: \"niceErrorObject\",\n\t\t\t\tniceErrorObject: errorObj\n\t\t\t};\n\t\t} catch {}\n\t}\n\treturn null;\n}\nconst inspectPotentialError = (potentialError) => {\n\tif (potentialError == null) return {\n\t\ttype: \"nullish\",\n\t\tvalue: potentialError\n\t};\n\tif (typeof potentialError === \"number\") return {\n\t\ttype: \"jsDataType\",\n\t\tjsDataType: \"number\",\n\t\tjsDataValue: potentialError\n\t};\n\tif (typeof potentialError === \"boolean\") return {\n\t\ttype: \"jsDataType\",\n\t\tjsDataType: \"boolean\",\n\t\tjsDataValue: potentialError\n\t};\n\tlet parsedError = potentialError;\n\tif (typeof potentialError === \"string\") if (potentialError.includes(\"{\") && potentialError.includes(\"name\")) try {\n\t\tparsedError = JSON.parse(potentialError);\n\t} catch {\n\t\treturn {\n\t\t\ttype: \"jsDataType\",\n\t\t\tjsDataType: \"string\",\n\t\t\tjsDataValue: potentialError\n\t\t};\n\t}\n\telse return {\n\t\ttype: \"jsDataType\",\n\t\tjsDataType: \"string\",\n\t\tjsDataValue: potentialError\n\t};\n\tif (typeof parsedError !== \"object\" || parsedError == null) {\n\t\tgetNiceErrorLogger().warn(\"Received a potential error that is a primitive data type other than string, number, or boolean. This is unexpected and may indicate an issue with error handling in the code.\", { potentialError });\n\t\treturn {\n\t\t\tjsDataValue: potentialError,\n\t\t\ttype: \"jsOther\"\n\t\t};\n\t}\n\tif (parsedError instanceof NiceError) return {\n\t\ttype: \"niceError\",\n\t\tniceError: parsedError\n\t};\n\tif (isNiceErrorObject(parsedError)) return {\n\t\ttype: \"niceErrorObject\",\n\t\tniceErrorObject: parsedError\n\t};\n\tif (parsedError instanceof Error) {\n\t\tconst durObjResult = interpretMessagePackedError(parsedError);\n\t\tif (durObjResult != null) return durObjResult;\n\t\treturn {\n\t\t\ttype: \"jsError\",\n\t\t\tjsError: parsedError\n\t\t};\n\t}\n\tif (isRegularErrorJsonObject(parsedError)) {\n\t\tconst durObjResult = interpretMessagePackedError(parsedError);\n\t\tif (durObjResult != null) return durObjResult;\n\t\treturn {\n\t\t\ttype: \"jsErrorObject\",\n\t\t\tjsErrorObject: parsedError\n\t\t};\n\t}\n\treturn {\n\t\ttype: \"jsDataType\",\n\t\tjsDataType: \"object\",\n\t\tjsDataValue: parsedError\n\t};\n};\n//#endregion\n//#region src/error/utils/castNiceError.ts\n/**\n* Casts any unknown value into a `NiceError`.\n*\n* - If the value is already a `NiceError` instance, it is returned as-is.\n* - If the value is a plain `Error`, it is wrapped with the original as `originError`.\n* - If the value is a JSON-serialised `NiceError` object (e.g. from an API\n*   response), a best-effort `NiceError` is re-created from it.\n* - For all other values, a generic `NiceError` is created with a descriptive\n*   message.\n*\n* After casting, use `NiceErrorDomain.isExact(error)` to narrow the error to a\n* specific domain and access its strongly-typed ids and context.\n*/\nconst castNiceError = (error) => {\n\tconst inspected = inspectPotentialError(error);\n\tswitch (inspected.type) {\n\t\tcase \"niceError\": return inspected.niceError;\n\t\tcase \"niceErrorObject\": {\n\t\t\tconst obj = inspected.niceErrorObject;\n\t\t\treturn new NiceError(obj);\n\t\t}\n\t\tcase \"jsError\": return err_cast_not_nice.fromContext({ [\"native_error\"]: inspected }).withOriginError(inspected.jsError);\n\t\tcase \"jsErrorObject\": {\n\t\t\tconst err = err_cast_not_nice.fromContext({ [\"js_error_like_object\"]: inspected });\n\t\t\terr.cause = inspected.jsErrorObject;\n\t\t\treturn err;\n\t\t}\n\t\tcase \"nullish\": return err_cast_not_nice.fromContext({ [\"nullish_value\"]: inspected });\n\t\tcase \"jsDataType\": return err_cast_not_nice.fromContext({ [\"js_data_type\"]: inspected });\n\t\tdefault: return err_cast_not_nice.fromContext({ [\"js_other\"]: inspected });\n\t}\n};\n//#endregion\n//#region src/error/result/niceTry.ts\n/**\n* Run a synchronous function and capture the outcome as a {@link TNiceResult}.\n*\n* Any thrown value is run through {@link castNiceError}, so the `error` branch is\n* always a `NiceError` — a defined domain error passes through untouched; a native\n* throw / nullish / primitive becomes an `err_cast_not_nice` wrapper (`isUnhandled`).\n*\n* ```ts\n* const r = niceTry(() => JSON.parse(input));\n* if (!r.ok) report(r.error);\n* else use(r.output);\n* ```\n*/\nfunction niceTry(fn) {\n\ttry {\n\t\treturn {\n\t\t\tok: true,\n\t\t\toutput: fn()\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\terror: castNiceError(error)\n\t\t};\n\t}\n}\n/**\n* Async counterpart of {@link niceTry}. Accepts a sync or async function and\n* awaits its result; a rejection is caught and `castNiceError`-d into the\n* `error` branch.\n*/\nasync function niceTryAsync(fn) {\n\ttry {\n\t\treturn {\n\t\t\tok: true,\n\t\t\toutput: await fn()\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\terror: castNiceError(error)\n\t\t};\n\t}\n}\n//#endregion\n//#region src/error/result/TNiceResult.ts\n/** Build a success result. */\nconst niceOk = (output) => ({\n\tok: true,\n\toutput\n});\n/** Build a failure result. */\nconst niceErr = (error) => ({\n\tok: false,\n\terror\n});\n//#endregion\n//#region src/error/utils/castAndHydrate.ts\n/**\n* Combines `castNiceError`, `isExact()`, and `hydrate()` in a single call — the\n* idiomatic way to handle an unknown value arriving from a remote boundary\n* (API response, message queue, IPC, etc.) when you have a specific domain in mind.\n*\n* - Casts `value` to a `NiceError` using `castNiceError`.\n* - If the result belongs to `niceErrorDefined`'s domain (`isExact()` returns `true`),\n*   hydrates it and returns a fully-typed `NiceErrorHydrated`.\n* - Otherwise returns the raw cast `NiceError` (which may be an `isUnhandled` error\n*   if `value` was not a NiceError at all).\n*\n* @example\n* ```ts\n* // In an Express error handler:\n* app.use((err, req, res, next) => {\n*   const error = castAndHydrate(err, err_user_auth);\n*\n*   if (err_user_auth.isExact(error)) {\n*     // error is NiceErrorHydrated — getContext / addId available\n*     const result = matchFirst(error, {\n*       invalid_credentials: ({ username }) => res.status(401).json({ username }),\n*       account_locked:      ()             => res.status(403).json({ locked: true }),\n*     });\n*     if (result) return;\n*   }\n*\n*   next(err);\n* });\n* ```\n*/\nfunction castAndHydrate(value, niceErrorDefined) {\n\tconst casted = castNiceError(value);\n\tif (niceErrorDefined.isExact(casted)) return niceErrorDefined.hydrate(casted);\n\treturn casted;\n}\n//#endregion\n//#region src/error/utils/matchFirst.ts\n/**\n* Pattern-matches an error against a map of id → handler functions, returning the\n* result of the first handler whose id is active on the error.\n*\n* - Ids are tested in the order returned by `error.getIds()`.\n* - If no id-specific handler matched and `_` is provided, the fallback is called.\n* - Returns `undefined` when neither any id handler nor the fallback fires.\n*\n* **Requires hydrated context.** If any matched id is in the `\"unhydrated\"` state,\n* `getContext` will throw. Call `niceErrorDefined.hydrate(error)` beforehand when\n* working with errors deserialized from a JSON payload.\n*\n* @example\n* ```ts\n* const result = matchFirst(error, {\n*   invalid_credentials: ({ username }) => `Wrong password for ${username}`,\n*   account_locked:      ()             => \"Account is locked\",\n*   _:                   ()             => \"Unknown auth error\",\n* });\n* ```\n*/\nfunction matchFirst(error, handlers) {\n\tfor (const id of error.getIds()) {\n\t\tconst handler = handlers[id];\n\t\tif (typeof handler === \"function\") return handler(error.getContext(id));\n\t}\n\tif (typeof handlers._ === \"function\") return handlers._();\n}\n//#endregion\nexport { setNiceErrorLogger as C, getNiceErrorLogger as S, emitNiceError as _, niceTry as a, NiceError as b, forDomain as c, NiceErrorHandler as d, EErrorHandlerTargetType as f, NiceErrorDomain as g, defineNiceError as h, niceOk as i, forId as l, err as m, castAndHydrate as n, niceTryAsync as o, err_nice as p, niceErr as r, castNiceError as s, matchFirst as t, forIds as u, onNiceError as v, EErrorPackType as x, NiceErrorHydrated as y };\n\n//# sourceMappingURL=error-BFAEkmpX.mjs.map"],"mappings":";AACA,IAAI;;AAEJ,SAAS,yBAAyB,IAAI;CACrC,SAAS;AACV;;;;;;AAMA,SAAS,kBAAkB,MAAM,KAAK;CACrC,IAAI,UAAU,MAAM,OAAO,OAAO,MAAM,GAAG;CAC3C,uBAAuB,IAAI,MAAM,eAAe,KAAK,GAAG,OAAO,OAAO,IAAI,KAAK,UAAU,GAAG,MAAM,IAAI;AACvG;;;;;;;;AAUA,SAAS,oBAAoB,QAAQ;CACpC,OAAO,OAAO;AACf;AAGA,SAAS,qBAAqB,OAAO,aAAa,MAAM;CACvD,IAAI,iBAAiB,OAAO,OAAO,OAAO,OAAO,OAAO,EAAE,SAAS,MAAM,QAAQ,CAAC;CAClF,MAAM,UAAU,OAAO,YAAY,OAAO,UAAU,WAAW,QAAQ;CACvE,IAAI,YAAY,QAAQ,MAAM,iDAAiD,WAAW,KAAK;CAC/F,OAAO;EACN,GAAG,IAAI,MAAM,OAAO;EACpB,G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