@workclaw/openclaw-workclaw 1.0.345 → 1.0.347

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.
Files changed (42) hide show
  1. package/dist/{anthropic-DPIo8aZS.js → anthropic-iz9b7eTM.js} +1 -1
  2. package/dist/api.js +2 -2
  3. package/dist/{azure-openai-responses-DD2qWGIN.js → azure-openai-responses-BY4VCLhI.js} +2 -2
  4. package/dist/{channel-DRvDqBYj.js → channel-BSz5NViV.js} +885 -849
  5. package/dist/{channel-bootstrap.runtime-B0t3vnup-Czzea06A.js → channel-bootstrap.runtime-B0t3vnup-OrZCNcwN.js} +1 -1
  6. package/dist/channel-entry-api.js +3 -3
  7. package/dist/channel-plugin-api.js +1 -1
  8. package/dist/{cleanup-i9QIMqva-1f5yGy3c.js → cleanup-i9QIMqva-BflvVH5S.js} +1 -1
  9. package/dist/{config-B7WCpONg.js → config-DsT1JRO0.js} +1 -1
  10. package/dist/{google-CO2HXSN_.js → google-BJ705Vhr.js} +2 -2
  11. package/dist/{google-shared-BzJ3YIh8.js → google-shared-DOkMvbgI.js} +1 -1
  12. package/dist/{google-vertex-BD9-XVFI.js → google-vertex-DdruQhTJ.js} +2 -2
  13. package/dist/{host-hook-cleanup-BNlJQu7G-B6gPaEXw.js → host-hook-cleanup-BNlJQu7G-BIgPXmmV.js} +1 -1
  14. package/dist/{index-D9W7_ln2.js → index-CEXJFX3f.js} +1 -1
  15. package/dist/{index-DLeHpawu.js → index-C_RXZIe3.js} +1 -1
  16. package/dist/{index-DvlDhBhd.js → index-DXYf5cvH.js} +2 -2
  17. package/dist/{legacy-config-issues-Czu0_ffE-ktq5IpXk.js → legacy-config-issues-Czu0_ffE-CF_9nVpj.js} +2 -2
  18. package/dist/{message-oTt1u1XX-DOBlhTmr.js → message-oTt1u1XX-BNA1iCaV.js} +3 -3
  19. package/dist/message.config.runtime-BgZncy2p.js +4 -0
  20. package/dist/{message.gateway.runtime-DF-QRcSW.js → message.gateway.runtime-BSJCpWsl.js} +1 -1
  21. package/dist/{mistral-BIsV4aGY.js → mistral-CB_7K2QD.js} +1 -1
  22. package/dist/{models-config.runtime-C39G_JMq.js → models-config.runtime-D573bKUC.js} +1 -1
  23. package/dist/{openai-codex-responses-C6Z_AwQQ.js → openai-codex-responses-bQDvwjaM.js} +2 -2
  24. package/dist/{openai-completions-DZosJ4E4.js → openai-completions-B6nYcarp.js} +1 -1
  25. package/dist/{openai-responses-S_jH9SLK.js → openai-responses-BSzLx4jt.js} +2 -2
  26. package/dist/{openai-responses-shared-CFqFtFHI.js → openai-responses-shared-NccwYW-T.js} +1 -1
  27. package/dist/{openrouter-DmigfOuL.js → openrouter-C6vD-ZCW.js} +1 -1
  28. package/dist/{photon_rs-r_qXiR7O.js → photon_rs-DLMtqH7u.js} +1 -1
  29. package/dist/{plugins-C54ejDC8-DvOLwS0D.js → plugins-C54ejDC8-8qm7-b04.js} +2 -2
  30. package/dist/{provider-discovery.runtime-C7QlqKhh.js → provider-discovery.runtime-Ut_h1pRP.js} +1 -1
  31. package/dist/{session-archive.runtime-DlZRauFQ.js → session-archive.runtime-BMP_pofW.js} +1 -1
  32. package/dist/src/connection/workclaw-client.d.ts.map +1 -1
  33. package/dist/src/types/system.d.ts +1 -1
  34. package/dist/src/types/system.d.ts.map +1 -1
  35. package/dist/subsystem-W8wAQXn1-Cq-tO-kG.js +4 -0
  36. package/dist/tools-api.js +1 -1
  37. package/dist/{transcript.runtime-C6BHG-XW.js → transcript.runtime-Bi3y3q3h.js} +1 -1
  38. package/dist/{workclaw-client-CMjcFjJx.js → workclaw-client-C8l2Z0za.js} +14 -2
  39. package/openclaw.plugin.json +244 -244
  40. package/package.json +1 -1
  41. package/dist/message.config.runtime-C_TAuIcE.js +0 -4
  42. package/dist/subsystem-W8wAQXn1-BRIb6Mz-.js +0 -4
@@ -4,7 +4,7 @@ import * as os$2 from "node:os";
4
4
  import os__default, { tmpdir, homedir as homedir$1 } from "node:os";
5
5
  import * as path$8 from "node:path";
6
6
  import path__default, { posix, dirname, join as join$2, delimiter, resolve as resolve$4, relative, sep as sep$2, isAbsolute as isAbsolute$1, basename as basename$1, win32 as win32$1, toNamespacedPath } from "node:path";
7
- import { f as isBlockedObjectKey, j as normalizeOptionalAccountId, k as normalizeAccountId$1, e as resolveAccountByUserIdAndAgentId, l as refreshAccountCache, m as allocateWorkerAccountId, c as resolveWorkclawAccountWithCache, h as getWorkclawAccessToken, o as getWorkclawModelConfigByAppKey, p as clearWorkclawTokenCache, q as openWorkclawConnection, t as buildAccountMap, D as DEFAULT_ACCOUNT_ID, u as isWorkclawAccountConfigured, v as resolveWorkclawAccount, w as listWorkclawAccountIds } from "./workclaw-client-CMjcFjJx.js";
7
+ import { f as isBlockedObjectKey, j as normalizeOptionalAccountId, k as normalizeAccountId$1, e as resolveAccountByUserIdAndAgentId, l as refreshAccountCache, m as allocateWorkerAccountId, c as resolveWorkclawAccountWithCache, h as getWorkclawAccessToken, o as getWorkclawModelConfigByAppKey, p as clearWorkclawTokenCache, q as openWorkclawConnection, t as buildAccountMap, D as DEFAULT_ACCOUNT_ID, u as isWorkclawAccountConfigured, v as resolveWorkclawAccount, w as listWorkclawAccountIds } from "./workclaw-client-C8l2Z0za.js";
8
8
  import { Q as resolvePathViaExistingAncestorSync, R as union$1, T as string$3, U as object$1, V as array$1, W as number$3, X as boolean$3, Y as literal$2, Z as ZodIssueCode$1, _ as record$1, $ as SecretInputSchema$1, a0 as sensitive, a1 as preprocess$1, a2 as unknown$1, a3 as _enum$2, a4 as GroupChatSchema, a5 as IdentitySchema, a6 as TtsConfigSchema, a7 as HumanDelaySchema, a8 as ToolsLinksSchema, a9 as ToolsMediaSchema, aa as resolveHomeRelativePath, w as resolveRequiredHomeDir, ab as assertAsyncDirectoryGuard, ac as createAsyncDirectoryGuard, ad as runPinnedWriteHelper, ae as sameFileIdentity, N as FsSafeError, af as sanitizeForLog, ag as expandHomePrefix, ah as appendRegularFileSync, M as MODEL_APIS, A as isRecord$i, i as isModelThinkingFormat, q as openRootFileSync, ai as matchRootFileOpenFailure, aj as createPluginCacheKey, ak as PluginLruCache, al as readRootStructuredFileSync, am as resolveConfigDir, J as resolveUserPath$2, an as resolveOpenClawPackageRootSync, x as isPathInside, ao as resolveRootPathSync, ap as safeRealpathSync$2, aq as safeStatSync, ar as tryReadJsonSync, as as readRootJsonObjectSync, at as writeJsonSync, au as isPathInsideWithRealpath, C as normalizeProviderId, v as resolveLoaderPackageRoot, av as isJavaScriptModulePath, y as getCachedPluginModuleLoader, aw as stringifyJsonDocument, ax as root$1, ay as resolveSafeRelativePath, az as readRegularFile, aA as getFsSafeTestHooks, aB as createSyncDirectoryGuard, aC as isPathRelativeEscape, aD as assertSyncDirectoryGuard$1, aE as resolvePluginLoaderTryNative, z as createPluginModuleLoaderCache, aF as escapeRegExp$1, aG as isPlainObject$1, aH as canUseRootFileOpen, aI as sanitizeTerminalText, d as coerceSecretRef, aJ as TypingModeSchema, aK as BlockStreamingCoalesceSchema, aL as BlockStreamingChunkSchema, aM as CliBackendSchema, aN as lazy$1, aO as TranscribeAudioSchema, aP as ContextVisibilityModeSchema, aQ as GroupPolicySchema, aR as url$2, aS as createAllowDenyChannelRulesSchema, aT as InboundDebounceSchema, aU as QueueSchema, aV as VisibleRepliesSchema, aW as NativeCommandsSettingSchema, aX as discriminatedUnion$1, aY as ModelsConfigSchema$1, aZ as SecretsConfigSchema, a_ as HexColorSchema, a$ as NEVER$1, b0 as replaceFileAtomic, b1 as summarizeAllowedValues, b2 as appendAllowedValuesHint, b3 as isBuiltInModelProviderOverlayId, b4 as validateJsonSchemaValue, b5 as replaceFileAtomicSync, u as getCachedPluginSourceModuleLoader, b6 as writeTextAtomic, b7 as resolvePluginRuntimeModulePath, b8 as withProfile, t as toSafeImportPath, b9 as buildPluginLoaderAliasMap, ba as CONFIG_DIR, bb as pathExists, bc as ensureDir, bd as shortenHomeInString, be as SECRET_PROVIDER_ALIAS_PATTERN, E as ENV_SECRET_REF_ID_RE, S as SINGLE_VALUE_FILE_REF_ID, bf as FILE_SECRET_REF_ID_INVALID_ESCAPE_JSON_SCHEMA_PATTERN, bg as EXEC_SECRET_REF_ID_JSON_SCHEMA_PATTERN, bh as resolveConfigScopedRuntimeCacheValue, bi as normalizeProviderIdForAuth, r as resolveSecretInputRef, bj as findNormalizedProviderValue, g as normalizeSecretInputString, bk as replaceFileAtomic$1, bl as assertSafePathSegment, bm as safeFileURLToPath, bn as readLocalFileSafely, bo as shouldPreferNativeModuleLoad, bp as resolveRequiredOsHomeDir, bq as writeJson, br as resolveRootPath, bs as buildChannelConfigSchema } from "./plugin-load-profile-DOnG9jJ5-B0ymqOTX.js";
9
9
  import { b as normalizeOptionalString, n as normalizeLowercaseStringOrEmpty, a as normalizeOptionalLowercaseString, h as hasNonEmptyString$1, r as readStringValue, c as normalizeStringifiedOptionalString, d as normalizeFastMode, e as normalizeOptionalThreadValue } from "./string-coerce-DyL154ka-BEV0SzzS.js";
10
10
  import * as fs$1$1 from "node:fs/promises";
@@ -26,7 +26,7 @@ import { z } from "zod";
26
26
  import { l as logger$1, a as getWorkclawRuntime, j as setToolContext, k as getWorkclawWsConnection, m as setWorkclawWsConnection, n as clearWorkclawWsConnection, o as getAppKeyByAccountId, u as unregisterAccountContext, p as getAllDispatchersByAppKey, q as getReconnectScheduler, r as clearReconnectScheduler, t as clearWorkclawConnectionConfig, v as registerAccountContext, w as tryStartConnecting, x as setReconnectScheduler, y as finishConnecting, z as setWorkclawConnectionConfig, A as getDispatcherByAppKeyAndAccountId, B as getLastInboundAt, C as getLastOutboundAt } from "./runtime-api-DU-e2Pen.js";
27
27
  import http$1 from "node:http";
28
28
  import https$1 from "node:https";
29
- import { P as PLUGIN_ID, w as writeConfigFile$1, a as saveOpenConversationId, s as sendMessageWorkclaw, i as initWorkclawAgent } from "./index-DvlDhBhd.js";
29
+ import { P as PLUGIN_ID, w as writeConfigFile$1, a as saveOpenConversationId, s as sendMessageWorkclaw, i as initWorkclawAgent } from "./index-DXYf5cvH.js";
30
30
  import require$$15, { performance as performance$1 } from "node:perf_hooks";
31
31
  import I$2, { readFileSync as readFileSync$1, existsSync as existsSync$1, accessSync, constants as constants$2, realpathSync, statSync, readdirSync, mkdirSync as mkdirSync$1, writeFileSync, appendFileSync, openSync, readSync, closeSync, renameSync, chmodSync as chmodSync$1, rmSync, createWriteStream as createWriteStream$1, readlinkSync, readdir as readdir$2, lstatSync, unwatchFile, watchFile, unlinkSync } from "fs";
32
32
  import * as path$9 from "path";
@@ -21185,7 +21185,7 @@ const MIME_BY_EXT = {
21185
21185
  ".htm": "text/html",
21186
21186
  ".xml": "text/xml"
21187
21187
  };
21188
- const fileTypeModuleLoader = createLazyImportLoader(() => import("./index-D9W7_ln2.js"));
21188
+ const fileTypeModuleLoader = createLazyImportLoader(() => import("./index-CEXJFX3f.js"));
21189
21189
  function normalizeMimeType(mime) {
21190
21190
  if (!mime) return;
21191
21191
  const cleaned = mime.split(";")[0]?.trim().toLowerCase();
@@ -22377,7 +22377,7 @@ function resolveDefaultAgentWorkspaceDir(env = process.env, homedir2 = os__defau
22377
22377
  resolveDefaultAgentWorkspaceDir();
22378
22378
  let defaultAgentWarned = false;
22379
22379
  function warnMultipleDefaultAgents() {
22380
- import("./subsystem-W8wAQXn1-BRIb6Mz-.js").then(({ createSubsystemLogger: createSubsystemLogger2 }) => {
22380
+ import("./subsystem-W8wAQXn1-Cq-tO-kG.js").then(({ createSubsystemLogger: createSubsystemLogger2 }) => {
22381
22381
  createSubsystemLogger2("agent-scope").warn("Multiple agents marked default=true; using the first entry as default.");
22382
22382
  }).catch(() => void 0);
22383
22383
  }
@@ -26521,7 +26521,7 @@ function isRegistryLive(registry2) {
26521
26521
  return state$1.activeRegistry === registry2 || isRegistryPinned(registry2);
26522
26522
  }
26523
26523
  async function cleanupPreviousPluginHostRegistry(params) {
26524
- const [{ getRuntimeConfig: getRuntimeConfig2 }, { cleanupReplacedPluginHostRegistry }] = await Promise.all([import("./config-B7WCpONg.js"), import("./host-hook-cleanup-BNlJQu7G-B6gPaEXw.js")]);
26524
+ const [{ getRuntimeConfig: getRuntimeConfig2 }, { cleanupReplacedPluginHostRegistry }] = await Promise.all([import("./config-DsT1JRO0.js"), import("./host-hook-cleanup-BNlJQu7G-BIgPXmmV.js")]);
26525
26525
  const nextRegistry = asPluginRegistry(state$1.activeRegistry);
26526
26526
  if (!nextRegistry || nextRegistry === params.previousRegistry) return;
26527
26527
  const shouldCleanup = () => state$1.activeRegistry !== params.previousRegistry;
@@ -39423,7 +39423,7 @@ async function finalizeReadConfigSnapshotInternalResult(deps, result2) {
39423
39423
  }
39424
39424
  async function collectInvalidConfigLegacyIssues(raw, sourceRaw) {
39425
39425
  if (!raw || typeof raw !== "object") return [];
39426
- const { findDoctorLegacyConfigIssues } = await import("./legacy-config-issues-Czu0_ffE-ktq5IpXk.js");
39426
+ const { findDoctorLegacyConfigIssues } = await import("./legacy-config-issues-Czu0_ffE-CF_9nVpj.js");
39427
39427
  return findDoctorLegacyConfigIssues(raw, sourceRaw);
39428
39428
  }
39429
39429
  function createConfigIO(overrides2 = {}) {
@@ -43000,11 +43000,11 @@ const log$a = createSubsystemLogger("sessions/store");
43000
43000
  let sessionArchiveRuntimePromise = null;
43001
43001
  let trajectoryCleanupRuntimePromise = null;
43002
43002
  function loadSessionArchiveRuntime() {
43003
- sessionArchiveRuntimePromise ??= import("./session-archive.runtime-DlZRauFQ.js");
43003
+ sessionArchiveRuntimePromise ??= import("./session-archive.runtime-BMP_pofW.js");
43004
43004
  return sessionArchiveRuntimePromise;
43005
43005
  }
43006
43006
  function loadTrajectoryCleanupRuntime() {
43007
- trajectoryCleanupRuntimePromise ??= import("./cleanup-i9QIMqva-1f5yGy3c.js");
43007
+ trajectoryCleanupRuntimePromise ??= import("./cleanup-i9QIMqva-BflvVH5S.js");
43008
43008
  return trajectoryCleanupRuntimePromise;
43009
43009
  }
43010
43010
  function updateSessionStoreWriteCaches(params) {
@@ -45389,12 +45389,12 @@ const attachmentProbeFs = { open: (...args) => fs$1$1.open(...args) };
45389
45389
  const MAX_ATTACHMENT_FILES = 10;
45390
45390
  let sendMessagePromise;
45391
45391
  async function loadSendMessage() {
45392
- sendMessagePromise ??= import("./message-oTt1u1XX-DOBlhTmr.js").then((module) => module.sendMessage);
45392
+ sendMessagePromise ??= import("./message-oTt1u1XX-BNA1iCaV.js").then((module) => module.sendMessage);
45393
45393
  return sendMessagePromise;
45394
45394
  }
45395
45395
  let getChannelPluginPromise;
45396
45396
  async function loadGetChannelPlugin() {
45397
- getChannelPluginPromise ??= import("./plugins-C54ejDC8-DvOLwS0D.js").then((module) => module.getChannelPlugin);
45397
+ getChannelPluginPromise ??= import("./plugins-C54ejDC8-8qm7-b04.js").then((module) => module.getChannelPlugin);
45398
45398
  return getChannelPluginPromise;
45399
45399
  }
45400
45400
  function captionFormatToParseMode(captionFormat) {
@@ -54267,8 +54267,8 @@ var scope = {};
54267
54267
  var util$1 = {};
54268
54268
  Object.defineProperty(util$1, "__esModule", { value: true });
54269
54269
  util$1.checkStrictMode = util$1.getErrorPath = util$1.Type = util$1.useFunc = util$1.setEvaluated = util$1.evaluatedPropsToName = util$1.mergeEvaluated = util$1.eachItem = util$1.unescapeJsonPointer = util$1.escapeJsonPointer = util$1.escapeFragment = util$1.unescapeFragment = util$1.schemaRefOrVal = util$1.schemaHasRulesButRef = util$1.schemaHasRules = util$1.checkUnknownRules = util$1.alwaysValidSchema = util$1.toHash = void 0;
54270
- const codegen_1$v = codegen;
54271
- const code_1$a = code$1;
54270
+ const codegen_1$q = codegen;
54271
+ const code_1$9 = code$1;
54272
54272
  function toHash(arr) {
54273
54273
  const hash = {};
54274
54274
  for (const item of arr)
@@ -54321,9 +54321,9 @@ function schemaRefOrVal({ topSchemaRef, schemaPath }, schema2, keyword2, $data)
54321
54321
  if (typeof schema2 == "number" || typeof schema2 == "boolean")
54322
54322
  return schema2;
54323
54323
  if (typeof schema2 == "string")
54324
- return (0, codegen_1$v._)`${schema2}`;
54324
+ return (0, codegen_1$q._)`${schema2}`;
54325
54325
  }
54326
- return (0, codegen_1$v._)`${topSchemaRef}${schemaPath}${(0, codegen_1$v.getProperty)(keyword2)}`;
54326
+ return (0, codegen_1$q._)`${topSchemaRef}${schemaPath}${(0, codegen_1$q.getProperty)(keyword2)}`;
54327
54327
  }
54328
54328
  util$1.schemaRefOrVal = schemaRefOrVal;
54329
54329
  function unescapeFragment(str2) {
@@ -54355,20 +54355,20 @@ function eachItem(xs2, f) {
54355
54355
  util$1.eachItem = eachItem;
54356
54356
  function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues: mergeValues2, resultToName }) {
54357
54357
  return (gen, from, to, toName) => {
54358
- const res = to === void 0 ? from : to instanceof codegen_1$v.Name ? (from instanceof codegen_1$v.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1$v.Name ? (mergeToName(gen, to, from), from) : mergeValues2(from, to);
54359
- return toName === codegen_1$v.Name && !(res instanceof codegen_1$v.Name) ? resultToName(gen, res) : res;
54358
+ const res = to === void 0 ? from : to instanceof codegen_1$q.Name ? (from instanceof codegen_1$q.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1$q.Name ? (mergeToName(gen, to, from), from) : mergeValues2(from, to);
54359
+ return toName === codegen_1$q.Name && !(res instanceof codegen_1$q.Name) ? resultToName(gen, res) : res;
54360
54360
  };
54361
54361
  }
54362
54362
  util$1.mergeEvaluated = {
54363
54363
  props: makeMergeEvaluated({
54364
- mergeNames: (gen, from, to) => gen.if((0, codegen_1$v._)`${to} !== true && ${from} !== undefined`, () => {
54365
- gen.if((0, codegen_1$v._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1$v._)`${to} || {}`).code((0, codegen_1$v._)`Object.assign(${to}, ${from})`));
54364
+ mergeNames: (gen, from, to) => gen.if((0, codegen_1$q._)`${to} !== true && ${from} !== undefined`, () => {
54365
+ gen.if((0, codegen_1$q._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1$q._)`${to} || {}`).code((0, codegen_1$q._)`Object.assign(${to}, ${from})`));
54366
54366
  }),
54367
- mergeToName: (gen, from, to) => gen.if((0, codegen_1$v._)`${to} !== true`, () => {
54367
+ mergeToName: (gen, from, to) => gen.if((0, codegen_1$q._)`${to} !== true`, () => {
54368
54368
  if (from === true) {
54369
54369
  gen.assign(to, true);
54370
54370
  } else {
54371
- gen.assign(to, (0, codegen_1$v._)`${to} || {}`);
54371
+ gen.assign(to, (0, codegen_1$q._)`${to} || {}`);
54372
54372
  setEvaluated(gen, to, from);
54373
54373
  }
54374
54374
  }),
@@ -54376,8 +54376,8 @@ util$1.mergeEvaluated = {
54376
54376
  resultToName: evaluatedPropsToName
54377
54377
  }),
54378
54378
  items: makeMergeEvaluated({
54379
- mergeNames: (gen, from, to) => gen.if((0, codegen_1$v._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1$v._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
54380
- mergeToName: (gen, from, to) => gen.if((0, codegen_1$v._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1$v._)`${to} > ${from} ? ${to} : ${from}`)),
54379
+ mergeNames: (gen, from, to) => gen.if((0, codegen_1$q._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1$q._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
54380
+ mergeToName: (gen, from, to) => gen.if((0, codegen_1$q._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1$q._)`${to} > ${from} ? ${to} : ${from}`)),
54381
54381
  mergeValues: (from, to) => from === true ? true : Math.max(from, to),
54382
54382
  resultToName: (gen, items2) => gen.var("items", items2)
54383
54383
  })
@@ -54385,21 +54385,21 @@ util$1.mergeEvaluated = {
54385
54385
  function evaluatedPropsToName(gen, ps2) {
54386
54386
  if (ps2 === true)
54387
54387
  return gen.var("props", true);
54388
- const props = gen.var("props", (0, codegen_1$v._)`{}`);
54388
+ const props = gen.var("props", (0, codegen_1$q._)`{}`);
54389
54389
  if (ps2 !== void 0)
54390
54390
  setEvaluated(gen, props, ps2);
54391
54391
  return props;
54392
54392
  }
54393
54393
  util$1.evaluatedPropsToName = evaluatedPropsToName;
54394
54394
  function setEvaluated(gen, props, ps2) {
54395
- Object.keys(ps2).forEach((p) => gen.assign((0, codegen_1$v._)`${props}${(0, codegen_1$v.getProperty)(p)}`, true));
54395
+ Object.keys(ps2).forEach((p) => gen.assign((0, codegen_1$q._)`${props}${(0, codegen_1$q.getProperty)(p)}`, true));
54396
54396
  }
54397
54397
  util$1.setEvaluated = setEvaluated;
54398
54398
  const snippets = {};
54399
54399
  function useFunc(gen, f) {
54400
54400
  return gen.scopeValue("func", {
54401
54401
  ref: f,
54402
- code: snippets[f.code] || (snippets[f.code] = new code_1$a._Code(f.code))
54402
+ code: snippets[f.code] || (snippets[f.code] = new code_1$9._Code(f.code))
54403
54403
  });
54404
54404
  }
54405
54405
  util$1.useFunc = useFunc;
@@ -54409,11 +54409,11 @@ var Type;
54409
54409
  Type2[Type2["Str"] = 1] = "Str";
54410
54410
  })(Type || (util$1.Type = Type = {}));
54411
54411
  function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
54412
- if (dataProp instanceof codegen_1$v.Name) {
54412
+ if (dataProp instanceof codegen_1$q.Name) {
54413
54413
  const isNumber2 = dataPropType === Type.Num;
54414
- return jsPropertySyntax ? isNumber2 ? (0, codegen_1$v._)`"[" + ${dataProp} + "]"` : (0, codegen_1$v._)`"['" + ${dataProp} + "']"` : isNumber2 ? (0, codegen_1$v._)`"/" + ${dataProp}` : (0, codegen_1$v._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
54414
+ return jsPropertySyntax ? isNumber2 ? (0, codegen_1$q._)`"[" + ${dataProp} + "]"` : (0, codegen_1$q._)`"['" + ${dataProp} + "']"` : isNumber2 ? (0, codegen_1$q._)`"/" + ${dataProp}` : (0, codegen_1$q._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
54415
54415
  }
54416
- return jsPropertySyntax ? (0, codegen_1$v.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
54416
+ return jsPropertySyntax ? (0, codegen_1$q.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
54417
54417
  }
54418
54418
  util$1.getErrorPath = getErrorPath;
54419
54419
  function checkStrictMode(it2, msg, mode2 = it2.opts.strictSchema) {
@@ -54427,35 +54427,35 @@ function checkStrictMode(it2, msg, mode2 = it2.opts.strictSchema) {
54427
54427
  util$1.checkStrictMode = checkStrictMode;
54428
54428
  var names$1 = {};
54429
54429
  Object.defineProperty(names$1, "__esModule", { value: true });
54430
- const codegen_1$u = codegen;
54430
+ const codegen_1$p = codegen;
54431
54431
  const names = {
54432
54432
  // validation function arguments
54433
- data: new codegen_1$u.Name("data"),
54433
+ data: new codegen_1$p.Name("data"),
54434
54434
  // data passed to validation function
54435
54435
  // args passed from referencing schema
54436
- valCxt: new codegen_1$u.Name("valCxt"),
54436
+ valCxt: new codegen_1$p.Name("valCxt"),
54437
54437
  // validation/data context - should not be used directly, it is destructured to the names below
54438
- instancePath: new codegen_1$u.Name("instancePath"),
54439
- parentData: new codegen_1$u.Name("parentData"),
54440
- parentDataProperty: new codegen_1$u.Name("parentDataProperty"),
54441
- rootData: new codegen_1$u.Name("rootData"),
54438
+ instancePath: new codegen_1$p.Name("instancePath"),
54439
+ parentData: new codegen_1$p.Name("parentData"),
54440
+ parentDataProperty: new codegen_1$p.Name("parentDataProperty"),
54441
+ rootData: new codegen_1$p.Name("rootData"),
54442
54442
  // root data - same as the data passed to the first/top validation function
54443
- dynamicAnchors: new codegen_1$u.Name("dynamicAnchors"),
54443
+ dynamicAnchors: new codegen_1$p.Name("dynamicAnchors"),
54444
54444
  // used to support recursiveRef and dynamicRef
54445
54445
  // function scoped variables
54446
- vErrors: new codegen_1$u.Name("vErrors"),
54446
+ vErrors: new codegen_1$p.Name("vErrors"),
54447
54447
  // null or array of validation errors
54448
- errors: new codegen_1$u.Name("errors"),
54448
+ errors: new codegen_1$p.Name("errors"),
54449
54449
  // counter of validation errors
54450
- this: new codegen_1$u.Name("this"),
54450
+ this: new codegen_1$p.Name("this"),
54451
54451
  // "globals"
54452
- self: new codegen_1$u.Name("self"),
54453
- scope: new codegen_1$u.Name("scope"),
54452
+ self: new codegen_1$p.Name("self"),
54453
+ scope: new codegen_1$p.Name("scope"),
54454
54454
  // JTD serialize/parse name for JSON string and position
54455
- json: new codegen_1$u.Name("json"),
54456
- jsonPos: new codegen_1$u.Name("jsonPos"),
54457
- jsonLen: new codegen_1$u.Name("jsonLen"),
54458
- jsonPart: new codegen_1$u.Name("jsonPart")
54455
+ json: new codegen_1$p.Name("json"),
54456
+ jsonPos: new codegen_1$p.Name("jsonPos"),
54457
+ jsonLen: new codegen_1$p.Name("jsonLen"),
54458
+ jsonPart: new codegen_1$p.Name("jsonPart")
54459
54459
  };
54460
54460
  names$1.default = names;
54461
54461
  (function(exports$1) {
@@ -54575,49 +54575,55 @@ names$1.default = names;
54575
54575
  keyValues.push([E.propertyName, propertyName]);
54576
54576
  }
54577
54577
  })(errors);
54578
- Object.defineProperty(boolSchema, "__esModule", { value: true });
54579
- boolSchema.boolOrEmptySchema = boolSchema.topBoolOrEmptySchema = void 0;
54580
- const errors_1$3 = errors;
54581
- const codegen_1$t = codegen;
54582
- const names_1$6 = names$1;
54583
- const boolError = {
54584
- message: "boolean schema is false"
54585
- };
54586
- function topBoolOrEmptySchema(it2) {
54587
- const { gen, schema: schema2, validateName: validateName2 } = it2;
54588
- if (schema2 === false) {
54589
- falseSchemaError(it2, false);
54590
- } else if (typeof schema2 == "object" && schema2.$async === true) {
54591
- gen.return(names_1$6.default.data);
54592
- } else {
54593
- gen.assign((0, codegen_1$t._)`${validateName2}.errors`, null);
54594
- gen.return(true);
54578
+ var hasRequiredBoolSchema;
54579
+ function requireBoolSchema() {
54580
+ if (hasRequiredBoolSchema) return boolSchema;
54581
+ hasRequiredBoolSchema = 1;
54582
+ Object.defineProperty(boolSchema, "__esModule", { value: true });
54583
+ boolSchema.boolOrEmptySchema = boolSchema.topBoolOrEmptySchema = void 0;
54584
+ const errors_12 = errors;
54585
+ const codegen_12 = codegen;
54586
+ const names_12 = names$1;
54587
+ const boolError = {
54588
+ message: "boolean schema is false"
54589
+ };
54590
+ function topBoolOrEmptySchema(it2) {
54591
+ const { gen, schema: schema2, validateName: validateName2 } = it2;
54592
+ if (schema2 === false) {
54593
+ falseSchemaError(it2, false);
54594
+ } else if (typeof schema2 == "object" && schema2.$async === true) {
54595
+ gen.return(names_12.default.data);
54596
+ } else {
54597
+ gen.assign((0, codegen_12._)`${validateName2}.errors`, null);
54598
+ gen.return(true);
54599
+ }
54595
54600
  }
54596
- }
54597
- boolSchema.topBoolOrEmptySchema = topBoolOrEmptySchema;
54598
- function boolOrEmptySchema(it2, valid) {
54599
- const { gen, schema: schema2 } = it2;
54600
- if (schema2 === false) {
54601
- gen.var(valid, false);
54602
- falseSchemaError(it2);
54603
- } else {
54604
- gen.var(valid, true);
54601
+ boolSchema.topBoolOrEmptySchema = topBoolOrEmptySchema;
54602
+ function boolOrEmptySchema(it2, valid) {
54603
+ const { gen, schema: schema2 } = it2;
54604
+ if (schema2 === false) {
54605
+ gen.var(valid, false);
54606
+ falseSchemaError(it2);
54607
+ } else {
54608
+ gen.var(valid, true);
54609
+ }
54605
54610
  }
54606
- }
54607
- boolSchema.boolOrEmptySchema = boolOrEmptySchema;
54608
- function falseSchemaError(it2, overrideAllErrors) {
54609
- const { gen, data } = it2;
54610
- const cxt = {
54611
- gen,
54612
- keyword: "false schema",
54613
- data,
54614
- schema: false,
54615
- schemaCode: false,
54616
- schemaValue: false,
54617
- params: {},
54618
- it: it2
54619
- };
54620
- (0, errors_1$3.reportError)(cxt, boolError, void 0, overrideAllErrors);
54611
+ boolSchema.boolOrEmptySchema = boolOrEmptySchema;
54612
+ function falseSchemaError(it2, overrideAllErrors) {
54613
+ const { gen, data } = it2;
54614
+ const cxt = {
54615
+ gen,
54616
+ keyword: "false schema",
54617
+ data,
54618
+ schema: false,
54619
+ schemaCode: false,
54620
+ schemaValue: false,
54621
+ params: {},
54622
+ it: it2
54623
+ };
54624
+ (0, errors_12.reportError)(cxt, boolError, void 0, overrideAllErrors);
54625
+ }
54626
+ return boolSchema;
54621
54627
  }
54622
54628
  var dataType = {};
54623
54629
  var rules = {};
@@ -54665,10 +54671,10 @@ applicability.shouldUseRule = shouldUseRule;
54665
54671
  Object.defineProperty(dataType, "__esModule", { value: true });
54666
54672
  dataType.reportTypeError = dataType.checkDataTypes = dataType.checkDataType = dataType.coerceAndCheckDataType = dataType.getJSONTypes = dataType.getSchemaTypes = dataType.DataType = void 0;
54667
54673
  const rules_1 = rules;
54668
- const applicability_1$1 = applicability;
54669
- const errors_1$2 = errors;
54670
- const codegen_1$s = codegen;
54671
- const util_1$r = util$1;
54674
+ const applicability_1 = applicability;
54675
+ const errors_1 = errors;
54676
+ const codegen_1$o = codegen;
54677
+ const util_1$o = util$1;
54672
54678
  var DataType;
54673
54679
  (function(DataType2) {
54674
54680
  DataType2[DataType2["Correct"] = 0] = "Correct";
@@ -54700,7 +54706,7 @@ dataType.getJSONTypes = getJSONTypes;
54700
54706
  function coerceAndCheckDataType(it2, types2) {
54701
54707
  const { gen, data, opts } = it2;
54702
54708
  const coerceTo = coerceToTypes(types2, opts.coerceTypes);
54703
- const checkTypes = types2.length > 0 && !(coerceTo.length === 0 && types2.length === 1 && (0, applicability_1$1.schemaHasRulesForType)(it2, types2[0]));
54709
+ const checkTypes = types2.length > 0 && !(coerceTo.length === 0 && types2.length === 1 && (0, applicability_1.schemaHasRulesForType)(it2, types2[0]));
54704
54710
  if (checkTypes) {
54705
54711
  const wrongType = checkDataTypes(types2, data, opts.strictNumbers, DataType.Wrong);
54706
54712
  gen.if(wrongType, () => {
@@ -54719,12 +54725,12 @@ function coerceToTypes(types2, coerceTypes) {
54719
54725
  }
54720
54726
  function coerceData(it2, types2, coerceTo) {
54721
54727
  const { gen, data, opts } = it2;
54722
- const dataType2 = gen.let("dataType", (0, codegen_1$s._)`typeof ${data}`);
54723
- const coerced = gen.let("coerced", (0, codegen_1$s._)`undefined`);
54728
+ const dataType2 = gen.let("dataType", (0, codegen_1$o._)`typeof ${data}`);
54729
+ const coerced = gen.let("coerced", (0, codegen_1$o._)`undefined`);
54724
54730
  if (opts.coerceTypes === "array") {
54725
- gen.if((0, codegen_1$s._)`${dataType2} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1$s._)`${data}[0]`).assign(dataType2, (0, codegen_1$s._)`typeof ${data}`).if(checkDataTypes(types2, data, opts.strictNumbers), () => gen.assign(coerced, data)));
54731
+ gen.if((0, codegen_1$o._)`${dataType2} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1$o._)`${data}[0]`).assign(dataType2, (0, codegen_1$o._)`typeof ${data}`).if(checkDataTypes(types2, data, opts.strictNumbers), () => gen.assign(coerced, data)));
54726
54732
  }
54727
- gen.if((0, codegen_1$s._)`${coerced} !== undefined`);
54733
+ gen.if((0, codegen_1$o._)`${coerced} !== undefined`);
54728
54734
  for (const t of coerceTo) {
54729
54735
  if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") {
54730
54736
  coerceSpecificType(t);
@@ -54733,63 +54739,63 @@ function coerceData(it2, types2, coerceTo) {
54733
54739
  gen.else();
54734
54740
  reportTypeError(it2);
54735
54741
  gen.endIf();
54736
- gen.if((0, codegen_1$s._)`${coerced} !== undefined`, () => {
54742
+ gen.if((0, codegen_1$o._)`${coerced} !== undefined`, () => {
54737
54743
  gen.assign(data, coerced);
54738
54744
  assignParentData(it2, coerced);
54739
54745
  });
54740
54746
  function coerceSpecificType(t) {
54741
54747
  switch (t) {
54742
54748
  case "string":
54743
- gen.elseIf((0, codegen_1$s._)`${dataType2} == "number" || ${dataType2} == "boolean"`).assign(coerced, (0, codegen_1$s._)`"" + ${data}`).elseIf((0, codegen_1$s._)`${data} === null`).assign(coerced, (0, codegen_1$s._)`""`);
54749
+ gen.elseIf((0, codegen_1$o._)`${dataType2} == "number" || ${dataType2} == "boolean"`).assign(coerced, (0, codegen_1$o._)`"" + ${data}`).elseIf((0, codegen_1$o._)`${data} === null`).assign(coerced, (0, codegen_1$o._)`""`);
54744
54750
  return;
54745
54751
  case "number":
54746
- gen.elseIf((0, codegen_1$s._)`${dataType2} == "boolean" || ${data} === null
54747
- || (${dataType2} == "string" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1$s._)`+${data}`);
54752
+ gen.elseIf((0, codegen_1$o._)`${dataType2} == "boolean" || ${data} === null
54753
+ || (${dataType2} == "string" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1$o._)`+${data}`);
54748
54754
  return;
54749
54755
  case "integer":
54750
- gen.elseIf((0, codegen_1$s._)`${dataType2} === "boolean" || ${data} === null
54751
- || (${dataType2} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1$s._)`+${data}`);
54756
+ gen.elseIf((0, codegen_1$o._)`${dataType2} === "boolean" || ${data} === null
54757
+ || (${dataType2} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1$o._)`+${data}`);
54752
54758
  return;
54753
54759
  case "boolean":
54754
- gen.elseIf((0, codegen_1$s._)`${data} === "false" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1$s._)`${data} === "true" || ${data} === 1`).assign(coerced, true);
54760
+ gen.elseIf((0, codegen_1$o._)`${data} === "false" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1$o._)`${data} === "true" || ${data} === 1`).assign(coerced, true);
54755
54761
  return;
54756
54762
  case "null":
54757
- gen.elseIf((0, codegen_1$s._)`${data} === "" || ${data} === 0 || ${data} === false`);
54763
+ gen.elseIf((0, codegen_1$o._)`${data} === "" || ${data} === 0 || ${data} === false`);
54758
54764
  gen.assign(coerced, null);
54759
54765
  return;
54760
54766
  case "array":
54761
- gen.elseIf((0, codegen_1$s._)`${dataType2} === "string" || ${dataType2} === "number"
54762
- || ${dataType2} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1$s._)`[${data}]`);
54767
+ gen.elseIf((0, codegen_1$o._)`${dataType2} === "string" || ${dataType2} === "number"
54768
+ || ${dataType2} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1$o._)`[${data}]`);
54763
54769
  }
54764
54770
  }
54765
54771
  }
54766
54772
  function assignParentData({ gen, parentData, parentDataProperty }, expr) {
54767
- gen.if((0, codegen_1$s._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1$s._)`${parentData}[${parentDataProperty}]`, expr));
54773
+ gen.if((0, codegen_1$o._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1$o._)`${parentData}[${parentDataProperty}]`, expr));
54768
54774
  }
54769
54775
  function checkDataType(dataType2, data, strictNums, correct = DataType.Correct) {
54770
- const EQ = correct === DataType.Correct ? codegen_1$s.operators.EQ : codegen_1$s.operators.NEQ;
54776
+ const EQ = correct === DataType.Correct ? codegen_1$o.operators.EQ : codegen_1$o.operators.NEQ;
54771
54777
  let cond;
54772
54778
  switch (dataType2) {
54773
54779
  case "null":
54774
- return (0, codegen_1$s._)`${data} ${EQ} null`;
54780
+ return (0, codegen_1$o._)`${data} ${EQ} null`;
54775
54781
  case "array":
54776
- cond = (0, codegen_1$s._)`Array.isArray(${data})`;
54782
+ cond = (0, codegen_1$o._)`Array.isArray(${data})`;
54777
54783
  break;
54778
54784
  case "object":
54779
- cond = (0, codegen_1$s._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
54785
+ cond = (0, codegen_1$o._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
54780
54786
  break;
54781
54787
  case "integer":
54782
- cond = numCond((0, codegen_1$s._)`!(${data} % 1) && !isNaN(${data})`);
54788
+ cond = numCond((0, codegen_1$o._)`!(${data} % 1) && !isNaN(${data})`);
54783
54789
  break;
54784
54790
  case "number":
54785
54791
  cond = numCond();
54786
54792
  break;
54787
54793
  default:
54788
- return (0, codegen_1$s._)`typeof ${data} ${EQ} ${dataType2}`;
54794
+ return (0, codegen_1$o._)`typeof ${data} ${EQ} ${dataType2}`;
54789
54795
  }
54790
- return correct === DataType.Correct ? cond : (0, codegen_1$s.not)(cond);
54791
- function numCond(_cond = codegen_1$s.nil) {
54792
- return (0, codegen_1$s.and)((0, codegen_1$s._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1$s._)`isFinite(${data})` : codegen_1$s.nil);
54796
+ return correct === DataType.Correct ? cond : (0, codegen_1$o.not)(cond);
54797
+ function numCond(_cond = codegen_1$o.nil) {
54798
+ return (0, codegen_1$o.and)((0, codegen_1$o._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1$o._)`isFinite(${data})` : codegen_1$o.nil);
54793
54799
  }
54794
54800
  }
54795
54801
  dataType.checkDataType = checkDataType;
@@ -54798,35 +54804,35 @@ function checkDataTypes(dataTypes, data, strictNums, correct) {
54798
54804
  return checkDataType(dataTypes[0], data, strictNums, correct);
54799
54805
  }
54800
54806
  let cond;
54801
- const types2 = (0, util_1$r.toHash)(dataTypes);
54807
+ const types2 = (0, util_1$o.toHash)(dataTypes);
54802
54808
  if (types2.array && types2.object) {
54803
- const notObj = (0, codegen_1$s._)`typeof ${data} != "object"`;
54804
- cond = types2.null ? notObj : (0, codegen_1$s._)`!${data} || ${notObj}`;
54809
+ const notObj = (0, codegen_1$o._)`typeof ${data} != "object"`;
54810
+ cond = types2.null ? notObj : (0, codegen_1$o._)`!${data} || ${notObj}`;
54805
54811
  delete types2.null;
54806
54812
  delete types2.array;
54807
54813
  delete types2.object;
54808
54814
  } else {
54809
- cond = codegen_1$s.nil;
54815
+ cond = codegen_1$o.nil;
54810
54816
  }
54811
54817
  if (types2.number)
54812
54818
  delete types2.integer;
54813
54819
  for (const t in types2)
54814
- cond = (0, codegen_1$s.and)(cond, checkDataType(t, data, strictNums, correct));
54820
+ cond = (0, codegen_1$o.and)(cond, checkDataType(t, data, strictNums, correct));
54815
54821
  return cond;
54816
54822
  }
54817
54823
  dataType.checkDataTypes = checkDataTypes;
54818
54824
  const typeError = {
54819
54825
  message: ({ schema: schema2 }) => `must be ${schema2}`,
54820
- params: ({ schema: schema2, schemaValue }) => typeof schema2 == "string" ? (0, codegen_1$s._)`{type: ${schema2}}` : (0, codegen_1$s._)`{type: ${schemaValue}}`
54826
+ params: ({ schema: schema2, schemaValue }) => typeof schema2 == "string" ? (0, codegen_1$o._)`{type: ${schema2}}` : (0, codegen_1$o._)`{type: ${schemaValue}}`
54821
54827
  };
54822
54828
  function reportTypeError(it2) {
54823
54829
  const cxt = getTypeErrorContext(it2);
54824
- (0, errors_1$2.reportError)(cxt, typeError);
54830
+ (0, errors_1.reportError)(cxt, typeError);
54825
54831
  }
54826
54832
  dataType.reportTypeError = reportTypeError;
54827
54833
  function getTypeErrorContext(it2) {
54828
54834
  const { gen, data, schema: schema2 } = it2;
54829
- const schemaCode = (0, util_1$r.schemaRefOrVal)(it2, schema2, "type");
54835
+ const schemaCode = (0, util_1$o.schemaRefOrVal)(it2, schema2, "type");
54830
54836
  return {
54831
54837
  gen,
54832
54838
  keyword: "type",
@@ -54840,54 +54846,60 @@ function getTypeErrorContext(it2) {
54840
54846
  };
54841
54847
  }
54842
54848
  var defaults$4 = {};
54843
- Object.defineProperty(defaults$4, "__esModule", { value: true });
54844
- defaults$4.assignDefaults = void 0;
54845
- const codegen_1$r = codegen;
54846
- const util_1$q = util$1;
54847
- function assignDefaults(it2, ty) {
54848
- const { properties: properties2, items: items2 } = it2.schema;
54849
- if (ty === "object" && properties2) {
54850
- for (const key2 in properties2) {
54851
- assignDefault(it2, key2, properties2[key2].default);
54852
- }
54853
- } else if (ty === "array" && Array.isArray(items2)) {
54854
- items2.forEach((sch, i) => assignDefault(it2, i, sch.default));
54855
- }
54856
- }
54857
- defaults$4.assignDefaults = assignDefaults;
54858
- function assignDefault(it2, prop, defaultValue) {
54859
- const { gen, compositeRule, data, opts } = it2;
54860
- if (defaultValue === void 0)
54861
- return;
54862
- const childData = (0, codegen_1$r._)`${data}${(0, codegen_1$r.getProperty)(prop)}`;
54863
- if (compositeRule) {
54864
- (0, util_1$q.checkStrictMode)(it2, `default is ignored for: ${childData}`);
54865
- return;
54849
+ var hasRequiredDefaults;
54850
+ function requireDefaults() {
54851
+ if (hasRequiredDefaults) return defaults$4;
54852
+ hasRequiredDefaults = 1;
54853
+ Object.defineProperty(defaults$4, "__esModule", { value: true });
54854
+ defaults$4.assignDefaults = void 0;
54855
+ const codegen_12 = codegen;
54856
+ const util_12 = util$1;
54857
+ function assignDefaults(it2, ty) {
54858
+ const { properties: properties2, items: items2 } = it2.schema;
54859
+ if (ty === "object" && properties2) {
54860
+ for (const key2 in properties2) {
54861
+ assignDefault(it2, key2, properties2[key2].default);
54862
+ }
54863
+ } else if (ty === "array" && Array.isArray(items2)) {
54864
+ items2.forEach((sch, i) => assignDefault(it2, i, sch.default));
54865
+ }
54866
54866
  }
54867
- let condition = (0, codegen_1$r._)`${childData} === undefined`;
54868
- if (opts.useDefaults === "empty") {
54869
- condition = (0, codegen_1$r._)`${condition} || ${childData} === null || ${childData} === ""`;
54867
+ defaults$4.assignDefaults = assignDefaults;
54868
+ function assignDefault(it2, prop, defaultValue) {
54869
+ const { gen, compositeRule, data, opts } = it2;
54870
+ if (defaultValue === void 0)
54871
+ return;
54872
+ const childData = (0, codegen_12._)`${data}${(0, codegen_12.getProperty)(prop)}`;
54873
+ if (compositeRule) {
54874
+ (0, util_12.checkStrictMode)(it2, `default is ignored for: ${childData}`);
54875
+ return;
54876
+ }
54877
+ let condition = (0, codegen_12._)`${childData} === undefined`;
54878
+ if (opts.useDefaults === "empty") {
54879
+ condition = (0, codegen_12._)`${condition} || ${childData} === null || ${childData} === ""`;
54880
+ }
54881
+ gen.if(condition, (0, codegen_12._)`${childData} = ${(0, codegen_12.stringify)(defaultValue)}`);
54870
54882
  }
54871
- gen.if(condition, (0, codegen_1$r._)`${childData} = ${(0, codegen_1$r.stringify)(defaultValue)}`);
54883
+ return defaults$4;
54872
54884
  }
54873
54885
  var keyword = {};
54874
54886
  var code = {};
54875
54887
  Object.defineProperty(code, "__esModule", { value: true });
54876
54888
  code.validateUnion = code.validateArray = code.usePattern = code.callValidateCode = code.schemaProperties = code.allSchemaProperties = code.noPropertyInData = code.propertyInData = code.isOwnProperty = code.hasPropFunc = code.reportMissingProp = code.checkMissingProp = code.checkReportMissingProp = void 0;
54877
- const codegen_1$q = codegen;
54878
- const util_1$p = util$1;
54879
- const names_1$5 = names$1;
54889
+ const codegen_1$n = codegen;
54890
+ const util_1$n = util$1;
54891
+ const names_1$3 = names$1;
54880
54892
  const util_2$1 = util$1;
54881
54893
  function checkReportMissingProp(cxt, prop) {
54882
54894
  const { gen, data, it: it2 } = cxt;
54883
54895
  gen.if(noPropertyInData(gen, data, prop, it2.opts.ownProperties), () => {
54884
- cxt.setParams({ missingProperty: (0, codegen_1$q._)`${prop}` }, true);
54896
+ cxt.setParams({ missingProperty: (0, codegen_1$n._)`${prop}` }, true);
54885
54897
  cxt.error();
54886
54898
  });
54887
54899
  }
54888
54900
  code.checkReportMissingProp = checkReportMissingProp;
54889
54901
  function checkMissingProp({ gen, data, it: { opts } }, properties2, missing) {
54890
- return (0, codegen_1$q.or)(...properties2.map((prop) => (0, codegen_1$q.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1$q._)`${missing} = ${prop}`)));
54902
+ return (0, codegen_1$n.or)(...properties2.map((prop) => (0, codegen_1$n.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1$n._)`${missing} = ${prop}`)));
54891
54903
  }
54892
54904
  code.checkMissingProp = checkMissingProp;
54893
54905
  function reportMissingProp(cxt, missing) {
@@ -54899,22 +54911,22 @@ function hasPropFunc(gen) {
54899
54911
  return gen.scopeValue("func", {
54900
54912
  // eslint-disable-next-line @typescript-eslint/unbound-method
54901
54913
  ref: Object.prototype.hasOwnProperty,
54902
- code: (0, codegen_1$q._)`Object.prototype.hasOwnProperty`
54914
+ code: (0, codegen_1$n._)`Object.prototype.hasOwnProperty`
54903
54915
  });
54904
54916
  }
54905
54917
  code.hasPropFunc = hasPropFunc;
54906
54918
  function isOwnProperty(gen, data, property) {
54907
- return (0, codegen_1$q._)`${hasPropFunc(gen)}.call(${data}, ${property})`;
54919
+ return (0, codegen_1$n._)`${hasPropFunc(gen)}.call(${data}, ${property})`;
54908
54920
  }
54909
54921
  code.isOwnProperty = isOwnProperty;
54910
54922
  function propertyInData(gen, data, property, ownProperties) {
54911
- const cond = (0, codegen_1$q._)`${data}${(0, codegen_1$q.getProperty)(property)} !== undefined`;
54912
- return ownProperties ? (0, codegen_1$q._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond;
54923
+ const cond = (0, codegen_1$n._)`${data}${(0, codegen_1$n.getProperty)(property)} !== undefined`;
54924
+ return ownProperties ? (0, codegen_1$n._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond;
54913
54925
  }
54914
54926
  code.propertyInData = propertyInData;
54915
54927
  function noPropertyInData(gen, data, property, ownProperties) {
54916
- const cond = (0, codegen_1$q._)`${data}${(0, codegen_1$q.getProperty)(property)} === undefined`;
54917
- return ownProperties ? (0, codegen_1$q.or)(cond, (0, codegen_1$q.not)(isOwnProperty(gen, data, property))) : cond;
54928
+ const cond = (0, codegen_1$n._)`${data}${(0, codegen_1$n.getProperty)(property)} === undefined`;
54929
+ return ownProperties ? (0, codegen_1$n.or)(cond, (0, codegen_1$n.not)(isOwnProperty(gen, data, property))) : cond;
54918
54930
  }
54919
54931
  code.noPropertyInData = noPropertyInData;
54920
54932
  function allSchemaProperties(schemaMap) {
@@ -54922,24 +54934,24 @@ function allSchemaProperties(schemaMap) {
54922
54934
  }
54923
54935
  code.allSchemaProperties = allSchemaProperties;
54924
54936
  function schemaProperties(it2, schemaMap) {
54925
- return allSchemaProperties(schemaMap).filter((p) => !(0, util_1$p.alwaysValidSchema)(it2, schemaMap[p]));
54937
+ return allSchemaProperties(schemaMap).filter((p) => !(0, util_1$n.alwaysValidSchema)(it2, schemaMap[p]));
54926
54938
  }
54927
54939
  code.schemaProperties = schemaProperties;
54928
54940
  function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it: it2 }, func, context, passSchema) {
54929
- const dataAndSchema = passSchema ? (0, codegen_1$q._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
54941
+ const dataAndSchema = passSchema ? (0, codegen_1$n._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
54930
54942
  const valCxt = [
54931
- [names_1$5.default.instancePath, (0, codegen_1$q.strConcat)(names_1$5.default.instancePath, errorPath)],
54932
- [names_1$5.default.parentData, it2.parentData],
54933
- [names_1$5.default.parentDataProperty, it2.parentDataProperty],
54934
- [names_1$5.default.rootData, names_1$5.default.rootData]
54943
+ [names_1$3.default.instancePath, (0, codegen_1$n.strConcat)(names_1$3.default.instancePath, errorPath)],
54944
+ [names_1$3.default.parentData, it2.parentData],
54945
+ [names_1$3.default.parentDataProperty, it2.parentDataProperty],
54946
+ [names_1$3.default.rootData, names_1$3.default.rootData]
54935
54947
  ];
54936
54948
  if (it2.opts.dynamicRef)
54937
- valCxt.push([names_1$5.default.dynamicAnchors, names_1$5.default.dynamicAnchors]);
54938
- const args = (0, codegen_1$q._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
54939
- return context !== codegen_1$q.nil ? (0, codegen_1$q._)`${func}.call(${context}, ${args})` : (0, codegen_1$q._)`${func}(${args})`;
54949
+ valCxt.push([names_1$3.default.dynamicAnchors, names_1$3.default.dynamicAnchors]);
54950
+ const args = (0, codegen_1$n._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
54951
+ return context !== codegen_1$n.nil ? (0, codegen_1$n._)`${func}.call(${context}, ${args})` : (0, codegen_1$n._)`${func}(${args})`;
54940
54952
  }
54941
54953
  code.callValidateCode = callValidateCode;
54942
- const newRegExp = (0, codegen_1$q._)`new RegExp`;
54954
+ const newRegExp = (0, codegen_1$n._)`new RegExp`;
54943
54955
  function usePattern({ gen, it: { opts } }, pattern2) {
54944
54956
  const u = opts.unicodeRegExp ? "u" : "";
54945
54957
  const { regExp } = opts.code;
@@ -54947,7 +54959,7 @@ function usePattern({ gen, it: { opts } }, pattern2) {
54947
54959
  return gen.scopeValue("pattern", {
54948
54960
  key: rx.toString(),
54949
54961
  ref: rx,
54950
- code: (0, codegen_1$q._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2$1.useFunc)(gen, regExp)}(${pattern2}, ${u})`
54962
+ code: (0, codegen_1$n._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2$1.useFunc)(gen, regExp)}(${pattern2}, ${u})`
54951
54963
  });
54952
54964
  }
54953
54965
  code.usePattern = usePattern;
@@ -54963,14 +54975,14 @@ function validateArray(cxt) {
54963
54975
  validateItems(() => gen.break());
54964
54976
  return valid;
54965
54977
  function validateItems(notValid) {
54966
- const len = gen.const("len", (0, codegen_1$q._)`${data}.length`);
54978
+ const len = gen.const("len", (0, codegen_1$n._)`${data}.length`);
54967
54979
  gen.forRange("i", 0, len, (i) => {
54968
54980
  cxt.subschema({
54969
54981
  keyword: keyword2,
54970
54982
  dataProp: i,
54971
- dataPropType: util_1$p.Type.Num
54983
+ dataPropType: util_1$n.Type.Num
54972
54984
  }, valid);
54973
- gen.if((0, codegen_1$q.not)(valid), notValid);
54985
+ gen.if((0, codegen_1$n.not)(valid), notValid);
54974
54986
  });
54975
54987
  }
54976
54988
  }
@@ -54979,7 +54991,7 @@ function validateUnion(cxt) {
54979
54991
  const { gen, schema: schema2, keyword: keyword2, it: it2 } = cxt;
54980
54992
  if (!Array.isArray(schema2))
54981
54993
  throw new Error("ajv implementation error");
54982
- const alwaysValid = schema2.some((sch) => (0, util_1$p.alwaysValidSchema)(it2, sch));
54994
+ const alwaysValid = schema2.some((sch) => (0, util_1$n.alwaysValidSchema)(it2, sch));
54983
54995
  if (alwaysValid && !it2.opts.unevaluated)
54984
54996
  return;
54985
54997
  const valid = gen.let("valid", false);
@@ -54990,202 +55002,214 @@ function validateUnion(cxt) {
54990
55002
  schemaProp: i,
54991
55003
  compositeRule: true
54992
55004
  }, schValid);
54993
- gen.assign(valid, (0, codegen_1$q._)`${valid} || ${schValid}`);
55005
+ gen.assign(valid, (0, codegen_1$n._)`${valid} || ${schValid}`);
54994
55006
  const merged = cxt.mergeValidEvaluated(schCxt, schValid);
54995
55007
  if (!merged)
54996
- gen.if((0, codegen_1$q.not)(valid));
55008
+ gen.if((0, codegen_1$n.not)(valid));
54997
55009
  }));
54998
55010
  cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
54999
55011
  }
55000
55012
  code.validateUnion = validateUnion;
55001
- Object.defineProperty(keyword, "__esModule", { value: true });
55002
- keyword.validateKeywordUsage = keyword.validSchemaType = keyword.funcKeywordCode = keyword.macroKeywordCode = void 0;
55003
- const codegen_1$p = codegen;
55004
- const names_1$4 = names$1;
55005
- const code_1$9 = code;
55006
- const errors_1$1 = errors;
55007
- function macroKeywordCode(cxt, def2) {
55008
- const { gen, keyword: keyword2, schema: schema2, parentSchema, it: it2 } = cxt;
55009
- const macroSchema = def2.macro.call(it2.self, schema2, parentSchema, it2);
55010
- const schemaRef = useKeyword(gen, keyword2, macroSchema);
55011
- if (it2.opts.validateSchema !== false)
55012
- it2.self.validateSchema(macroSchema, true);
55013
- const valid = gen.name("valid");
55014
- cxt.subschema({
55015
- schema: macroSchema,
55016
- schemaPath: codegen_1$p.nil,
55017
- errSchemaPath: `${it2.errSchemaPath}/${keyword2}`,
55018
- topSchemaRef: schemaRef,
55019
- compositeRule: true
55020
- }, valid);
55021
- cxt.pass(valid, () => cxt.error(true));
55022
- }
55023
- keyword.macroKeywordCode = macroKeywordCode;
55024
- function funcKeywordCode(cxt, def2) {
55025
- var _a2;
55026
- const { gen, keyword: keyword2, schema: schema2, parentSchema, $data, it: it2 } = cxt;
55027
- checkAsyncKeyword(it2, def2);
55028
- const validate2 = !$data && def2.compile ? def2.compile.call(it2.self, schema2, parentSchema, it2) : def2.validate;
55029
- const validateRef = useKeyword(gen, keyword2, validate2);
55030
- const valid = gen.let("valid");
55031
- cxt.block$data(valid, validateKeyword);
55032
- cxt.ok((_a2 = def2.valid) !== null && _a2 !== void 0 ? _a2 : valid);
55033
- function validateKeyword() {
55034
- if (def2.errors === false) {
55035
- assignValid();
55036
- if (def2.modifying)
55037
- modifyData(cxt);
55038
- reportErrs(() => cxt.error());
55039
- } else {
55040
- const ruleErrs = def2.async ? validateAsync() : validateSync();
55041
- if (def2.modifying)
55042
- modifyData(cxt);
55043
- reportErrs(() => addErrs(cxt, ruleErrs));
55044
- }
55045
- }
55046
- function validateAsync() {
55047
- const ruleErrs = gen.let("ruleErrs", null);
55048
- gen.try(() => assignValid((0, codegen_1$p._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1$p._)`${e} instanceof ${it2.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1$p._)`${e}.errors`), () => gen.throw(e)));
55049
- return ruleErrs;
55050
- }
55051
- function validateSync() {
55052
- const validateErrs = (0, codegen_1$p._)`${validateRef}.errors`;
55053
- gen.assign(validateErrs, null);
55054
- assignValid(codegen_1$p.nil);
55055
- return validateErrs;
55056
- }
55057
- function assignValid(_await = def2.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
55058
- const passCxt = it2.opts.passContext ? names_1$4.default.this : names_1$4.default.self;
55059
- const passSchema = !("compile" in def2 && !$data || def2.schema === false);
55060
- gen.assign(valid, (0, codegen_1$p._)`${_await}${(0, code_1$9.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def2.modifying);
55061
- }
55062
- function reportErrs(errors2) {
55063
- var _a3;
55064
- gen.if((0, codegen_1$p.not)((_a3 = def2.valid) !== null && _a3 !== void 0 ? _a3 : valid), errors2);
55065
- }
55066
- }
55067
- keyword.funcKeywordCode = funcKeywordCode;
55068
- function modifyData(cxt) {
55069
- const { gen, data, it: it2 } = cxt;
55070
- gen.if(it2.parentData, () => gen.assign(data, (0, codegen_1$p._)`${it2.parentData}[${it2.parentDataProperty}]`));
55071
- }
55072
- function addErrs(cxt, errs) {
55073
- const { gen } = cxt;
55074
- gen.if((0, codegen_1$p._)`Array.isArray(${errs})`, () => {
55075
- gen.assign(names_1$4.default.vErrors, (0, codegen_1$p._)`${names_1$4.default.vErrors} === null ? ${errs} : ${names_1$4.default.vErrors}.concat(${errs})`).assign(names_1$4.default.errors, (0, codegen_1$p._)`${names_1$4.default.vErrors}.length`);
55076
- (0, errors_1$1.extendErrors)(cxt);
55077
- }, () => cxt.error());
55078
- }
55079
- function checkAsyncKeyword({ schemaEnv }, def2) {
55080
- if (def2.async && !schemaEnv.$async)
55081
- throw new Error("async keyword in sync schema");
55082
- }
55083
- function useKeyword(gen, keyword2, result2) {
55084
- if (result2 === void 0)
55085
- throw new Error(`keyword "${keyword2}" failed to compile`);
55086
- return gen.scopeValue("keyword", typeof result2 == "function" ? { ref: result2 } : { ref: result2, code: (0, codegen_1$p.stringify)(result2) });
55087
- }
55088
- function validSchemaType(schema2, schemaType, allowUndefined = false) {
55089
- return !schemaType.length || schemaType.some((st2) => st2 === "array" ? Array.isArray(schema2) : st2 === "object" ? schema2 && typeof schema2 == "object" && !Array.isArray(schema2) : typeof schema2 == st2 || allowUndefined && typeof schema2 == "undefined");
55090
- }
55091
- keyword.validSchemaType = validSchemaType;
55092
- function validateKeywordUsage({ schema: schema2, opts, self: self2, errSchemaPath }, def2, keyword2) {
55093
- if (Array.isArray(def2.keyword) ? !def2.keyword.includes(keyword2) : def2.keyword !== keyword2) {
55094
- throw new Error("ajv implementation error");
55013
+ var hasRequiredKeyword;
55014
+ function requireKeyword() {
55015
+ if (hasRequiredKeyword) return keyword;
55016
+ hasRequiredKeyword = 1;
55017
+ Object.defineProperty(keyword, "__esModule", { value: true });
55018
+ keyword.validateKeywordUsage = keyword.validSchemaType = keyword.funcKeywordCode = keyword.macroKeywordCode = void 0;
55019
+ const codegen_12 = codegen;
55020
+ const names_12 = names$1;
55021
+ const code_12 = code;
55022
+ const errors_12 = errors;
55023
+ function macroKeywordCode(cxt, def2) {
55024
+ const { gen, keyword: keyword2, schema: schema2, parentSchema, it: it2 } = cxt;
55025
+ const macroSchema = def2.macro.call(it2.self, schema2, parentSchema, it2);
55026
+ const schemaRef = useKeyword(gen, keyword2, macroSchema);
55027
+ if (it2.opts.validateSchema !== false)
55028
+ it2.self.validateSchema(macroSchema, true);
55029
+ const valid = gen.name("valid");
55030
+ cxt.subschema({
55031
+ schema: macroSchema,
55032
+ schemaPath: codegen_12.nil,
55033
+ errSchemaPath: `${it2.errSchemaPath}/${keyword2}`,
55034
+ topSchemaRef: schemaRef,
55035
+ compositeRule: true
55036
+ }, valid);
55037
+ cxt.pass(valid, () => cxt.error(true));
55095
55038
  }
55096
- const deps = def2.dependencies;
55097
- if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema2, kwd))) {
55098
- throw new Error(`parent schema must have dependencies of ${keyword2}: ${deps.join(",")}`);
55039
+ keyword.macroKeywordCode = macroKeywordCode;
55040
+ function funcKeywordCode(cxt, def2) {
55041
+ var _a2;
55042
+ const { gen, keyword: keyword2, schema: schema2, parentSchema, $data, it: it2 } = cxt;
55043
+ checkAsyncKeyword(it2, def2);
55044
+ const validate2 = !$data && def2.compile ? def2.compile.call(it2.self, schema2, parentSchema, it2) : def2.validate;
55045
+ const validateRef = useKeyword(gen, keyword2, validate2);
55046
+ const valid = gen.let("valid");
55047
+ cxt.block$data(valid, validateKeyword);
55048
+ cxt.ok((_a2 = def2.valid) !== null && _a2 !== void 0 ? _a2 : valid);
55049
+ function validateKeyword() {
55050
+ if (def2.errors === false) {
55051
+ assignValid();
55052
+ if (def2.modifying)
55053
+ modifyData(cxt);
55054
+ reportErrs(() => cxt.error());
55055
+ } else {
55056
+ const ruleErrs = def2.async ? validateAsync() : validateSync();
55057
+ if (def2.modifying)
55058
+ modifyData(cxt);
55059
+ reportErrs(() => addErrs(cxt, ruleErrs));
55060
+ }
55061
+ }
55062
+ function validateAsync() {
55063
+ const ruleErrs = gen.let("ruleErrs", null);
55064
+ gen.try(() => assignValid((0, codegen_12._)`await `), (e) => gen.assign(valid, false).if((0, codegen_12._)`${e} instanceof ${it2.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_12._)`${e}.errors`), () => gen.throw(e)));
55065
+ return ruleErrs;
55066
+ }
55067
+ function validateSync() {
55068
+ const validateErrs = (0, codegen_12._)`${validateRef}.errors`;
55069
+ gen.assign(validateErrs, null);
55070
+ assignValid(codegen_12.nil);
55071
+ return validateErrs;
55072
+ }
55073
+ function assignValid(_await = def2.async ? (0, codegen_12._)`await ` : codegen_12.nil) {
55074
+ const passCxt = it2.opts.passContext ? names_12.default.this : names_12.default.self;
55075
+ const passSchema = !("compile" in def2 && !$data || def2.schema === false);
55076
+ gen.assign(valid, (0, codegen_12._)`${_await}${(0, code_12.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def2.modifying);
55077
+ }
55078
+ function reportErrs(errors2) {
55079
+ var _a3;
55080
+ gen.if((0, codegen_12.not)((_a3 = def2.valid) !== null && _a3 !== void 0 ? _a3 : valid), errors2);
55081
+ }
55099
55082
  }
55100
- if (def2.validateSchema) {
55101
- const valid = def2.validateSchema(schema2[keyword2]);
55102
- if (!valid) {
55103
- const msg = `keyword "${keyword2}" value is invalid at path "${errSchemaPath}": ` + self2.errorsText(def2.validateSchema.errors);
55104
- if (opts.validateSchema === "log")
55105
- self2.logger.error(msg);
55106
- else
55107
- throw new Error(msg);
55083
+ keyword.funcKeywordCode = funcKeywordCode;
55084
+ function modifyData(cxt) {
55085
+ const { gen, data, it: it2 } = cxt;
55086
+ gen.if(it2.parentData, () => gen.assign(data, (0, codegen_12._)`${it2.parentData}[${it2.parentDataProperty}]`));
55087
+ }
55088
+ function addErrs(cxt, errs) {
55089
+ const { gen } = cxt;
55090
+ gen.if((0, codegen_12._)`Array.isArray(${errs})`, () => {
55091
+ gen.assign(names_12.default.vErrors, (0, codegen_12._)`${names_12.default.vErrors} === null ? ${errs} : ${names_12.default.vErrors}.concat(${errs})`).assign(names_12.default.errors, (0, codegen_12._)`${names_12.default.vErrors}.length`);
55092
+ (0, errors_12.extendErrors)(cxt);
55093
+ }, () => cxt.error());
55094
+ }
55095
+ function checkAsyncKeyword({ schemaEnv }, def2) {
55096
+ if (def2.async && !schemaEnv.$async)
55097
+ throw new Error("async keyword in sync schema");
55098
+ }
55099
+ function useKeyword(gen, keyword2, result2) {
55100
+ if (result2 === void 0)
55101
+ throw new Error(`keyword "${keyword2}" failed to compile`);
55102
+ return gen.scopeValue("keyword", typeof result2 == "function" ? { ref: result2 } : { ref: result2, code: (0, codegen_12.stringify)(result2) });
55103
+ }
55104
+ function validSchemaType(schema2, schemaType, allowUndefined = false) {
55105
+ return !schemaType.length || schemaType.some((st2) => st2 === "array" ? Array.isArray(schema2) : st2 === "object" ? schema2 && typeof schema2 == "object" && !Array.isArray(schema2) : typeof schema2 == st2 || allowUndefined && typeof schema2 == "undefined");
55106
+ }
55107
+ keyword.validSchemaType = validSchemaType;
55108
+ function validateKeywordUsage({ schema: schema2, opts, self: self2, errSchemaPath }, def2, keyword2) {
55109
+ if (Array.isArray(def2.keyword) ? !def2.keyword.includes(keyword2) : def2.keyword !== keyword2) {
55110
+ throw new Error("ajv implementation error");
55111
+ }
55112
+ const deps = def2.dependencies;
55113
+ if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema2, kwd))) {
55114
+ throw new Error(`parent schema must have dependencies of ${keyword2}: ${deps.join(",")}`);
55115
+ }
55116
+ if (def2.validateSchema) {
55117
+ const valid = def2.validateSchema(schema2[keyword2]);
55118
+ if (!valid) {
55119
+ const msg = `keyword "${keyword2}" value is invalid at path "${errSchemaPath}": ` + self2.errorsText(def2.validateSchema.errors);
55120
+ if (opts.validateSchema === "log")
55121
+ self2.logger.error(msg);
55122
+ else
55123
+ throw new Error(msg);
55124
+ }
55108
55125
  }
55109
55126
  }
55127
+ keyword.validateKeywordUsage = validateKeywordUsage;
55128
+ return keyword;
55110
55129
  }
55111
- keyword.validateKeywordUsage = validateKeywordUsage;
55112
55130
  var subschema = {};
55113
- Object.defineProperty(subschema, "__esModule", { value: true });
55114
- subschema.extendSubschemaMode = subschema.extendSubschemaData = subschema.getSubschema = void 0;
55115
- const codegen_1$o = codegen;
55116
- const util_1$o = util$1;
55117
- function getSubschema(it2, { keyword: keyword2, schemaProp, schema: schema2, schemaPath, errSchemaPath, topSchemaRef }) {
55118
- if (keyword2 !== void 0 && schema2 !== void 0) {
55119
- throw new Error('both "keyword" and "schema" passed, only one allowed');
55120
- }
55121
- if (keyword2 !== void 0) {
55122
- const sch = it2.schema[keyword2];
55123
- return schemaProp === void 0 ? {
55124
- schema: sch,
55125
- schemaPath: (0, codegen_1$o._)`${it2.schemaPath}${(0, codegen_1$o.getProperty)(keyword2)}`,
55126
- errSchemaPath: `${it2.errSchemaPath}/${keyword2}`
55127
- } : {
55128
- schema: sch[schemaProp],
55129
- schemaPath: (0, codegen_1$o._)`${it2.schemaPath}${(0, codegen_1$o.getProperty)(keyword2)}${(0, codegen_1$o.getProperty)(schemaProp)}`,
55130
- errSchemaPath: `${it2.errSchemaPath}/${keyword2}/${(0, util_1$o.escapeFragment)(schemaProp)}`
55131
- };
55132
- }
55133
- if (schema2 !== void 0) {
55134
- if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) {
55135
- throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
55131
+ var hasRequiredSubschema;
55132
+ function requireSubschema() {
55133
+ if (hasRequiredSubschema) return subschema;
55134
+ hasRequiredSubschema = 1;
55135
+ Object.defineProperty(subschema, "__esModule", { value: true });
55136
+ subschema.extendSubschemaMode = subschema.extendSubschemaData = subschema.getSubschema = void 0;
55137
+ const codegen_12 = codegen;
55138
+ const util_12 = util$1;
55139
+ function getSubschema(it2, { keyword: keyword2, schemaProp, schema: schema2, schemaPath, errSchemaPath, topSchemaRef }) {
55140
+ if (keyword2 !== void 0 && schema2 !== void 0) {
55141
+ throw new Error('both "keyword" and "schema" passed, only one allowed');
55136
55142
  }
55137
- return {
55138
- schema: schema2,
55139
- schemaPath,
55140
- topSchemaRef,
55141
- errSchemaPath
55142
- };
55143
- }
55144
- throw new Error('either "keyword" or "schema" must be passed');
55145
- }
55146
- subschema.getSubschema = getSubschema;
55147
- function extendSubschemaData(subschema2, it2, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
55148
- if (data !== void 0 && dataProp !== void 0) {
55149
- throw new Error('both "data" and "dataProp" passed, only one allowed');
55150
- }
55151
- const { gen } = it2;
55152
- if (dataProp !== void 0) {
55153
- const { errorPath, dataPathArr, opts } = it2;
55154
- const nextData = gen.let("data", (0, codegen_1$o._)`${it2.data}${(0, codegen_1$o.getProperty)(dataProp)}`, true);
55155
- dataContextProps(nextData);
55156
- subschema2.errorPath = (0, codegen_1$o.str)`${errorPath}${(0, util_1$o.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;
55157
- subschema2.parentDataProperty = (0, codegen_1$o._)`${dataProp}`;
55158
- subschema2.dataPathArr = [...dataPathArr, subschema2.parentDataProperty];
55159
- }
55160
- if (data !== void 0) {
55161
- const nextData = data instanceof codegen_1$o.Name ? data : gen.let("data", data, true);
55162
- dataContextProps(nextData);
55163
- if (propertyName !== void 0)
55164
- subschema2.propertyName = propertyName;
55165
- }
55166
- if (dataTypes)
55167
- subschema2.dataTypes = dataTypes;
55168
- function dataContextProps(_nextData) {
55169
- subschema2.data = _nextData;
55170
- subschema2.dataLevel = it2.dataLevel + 1;
55171
- subschema2.dataTypes = [];
55172
- it2.definedProperties = /* @__PURE__ */ new Set();
55173
- subschema2.parentData = it2.data;
55174
- subschema2.dataNames = [...it2.dataNames, _nextData];
55175
- }
55176
- }
55177
- subschema.extendSubschemaData = extendSubschemaData;
55178
- function extendSubschemaMode(subschema2, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
55179
- if (compositeRule !== void 0)
55180
- subschema2.compositeRule = compositeRule;
55181
- if (createErrors !== void 0)
55182
- subschema2.createErrors = createErrors;
55183
- if (allErrors !== void 0)
55184
- subschema2.allErrors = allErrors;
55185
- subschema2.jtdDiscriminator = jtdDiscriminator;
55186
- subschema2.jtdMetadata = jtdMetadata;
55187
- }
55188
- subschema.extendSubschemaMode = extendSubschemaMode;
55143
+ if (keyword2 !== void 0) {
55144
+ const sch = it2.schema[keyword2];
55145
+ return schemaProp === void 0 ? {
55146
+ schema: sch,
55147
+ schemaPath: (0, codegen_12._)`${it2.schemaPath}${(0, codegen_12.getProperty)(keyword2)}`,
55148
+ errSchemaPath: `${it2.errSchemaPath}/${keyword2}`
55149
+ } : {
55150
+ schema: sch[schemaProp],
55151
+ schemaPath: (0, codegen_12._)`${it2.schemaPath}${(0, codegen_12.getProperty)(keyword2)}${(0, codegen_12.getProperty)(schemaProp)}`,
55152
+ errSchemaPath: `${it2.errSchemaPath}/${keyword2}/${(0, util_12.escapeFragment)(schemaProp)}`
55153
+ };
55154
+ }
55155
+ if (schema2 !== void 0) {
55156
+ if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) {
55157
+ throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
55158
+ }
55159
+ return {
55160
+ schema: schema2,
55161
+ schemaPath,
55162
+ topSchemaRef,
55163
+ errSchemaPath
55164
+ };
55165
+ }
55166
+ throw new Error('either "keyword" or "schema" must be passed');
55167
+ }
55168
+ subschema.getSubschema = getSubschema;
55169
+ function extendSubschemaData(subschema2, it2, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
55170
+ if (data !== void 0 && dataProp !== void 0) {
55171
+ throw new Error('both "data" and "dataProp" passed, only one allowed');
55172
+ }
55173
+ const { gen } = it2;
55174
+ if (dataProp !== void 0) {
55175
+ const { errorPath, dataPathArr, opts } = it2;
55176
+ const nextData = gen.let("data", (0, codegen_12._)`${it2.data}${(0, codegen_12.getProperty)(dataProp)}`, true);
55177
+ dataContextProps(nextData);
55178
+ subschema2.errorPath = (0, codegen_12.str)`${errorPath}${(0, util_12.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;
55179
+ subschema2.parentDataProperty = (0, codegen_12._)`${dataProp}`;
55180
+ subschema2.dataPathArr = [...dataPathArr, subschema2.parentDataProperty];
55181
+ }
55182
+ if (data !== void 0) {
55183
+ const nextData = data instanceof codegen_12.Name ? data : gen.let("data", data, true);
55184
+ dataContextProps(nextData);
55185
+ if (propertyName !== void 0)
55186
+ subschema2.propertyName = propertyName;
55187
+ }
55188
+ if (dataTypes)
55189
+ subschema2.dataTypes = dataTypes;
55190
+ function dataContextProps(_nextData) {
55191
+ subschema2.data = _nextData;
55192
+ subschema2.dataLevel = it2.dataLevel + 1;
55193
+ subschema2.dataTypes = [];
55194
+ it2.definedProperties = /* @__PURE__ */ new Set();
55195
+ subschema2.parentData = it2.data;
55196
+ subschema2.dataNames = [...it2.dataNames, _nextData];
55197
+ }
55198
+ }
55199
+ subschema.extendSubschemaData = extendSubschemaData;
55200
+ function extendSubschemaMode(subschema2, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
55201
+ if (compositeRule !== void 0)
55202
+ subschema2.compositeRule = compositeRule;
55203
+ if (createErrors !== void 0)
55204
+ subschema2.createErrors = createErrors;
55205
+ if (allErrors !== void 0)
55206
+ subschema2.allErrors = allErrors;
55207
+ subschema2.jtdDiscriminator = jtdDiscriminator;
55208
+ subschema2.jtdMetadata = jtdMetadata;
55209
+ }
55210
+ subschema.extendSubschemaMode = extendSubschemaMode;
55211
+ return subschema;
55212
+ }
55189
55213
  var resolve$2 = {};
55190
55214
  var fastDeepEqual = function equal(a, b2) {
55191
55215
  if (a === b2) return true;
@@ -55300,7 +55324,7 @@ function escapeJsonPtr(str2) {
55300
55324
  var jsonSchemaTraverseExports = jsonSchemaTraverse.exports;
55301
55325
  Object.defineProperty(resolve$2, "__esModule", { value: true });
55302
55326
  resolve$2.getSchemaRefs = resolve$2.resolveUrl = resolve$2.normalizeId = resolve$2._getFullPath = resolve$2.getFullPath = resolve$2.inlineRef = void 0;
55303
- const util_1$n = util$1;
55327
+ const util_1$m = util$1;
55304
55328
  const equal$3 = fastDeepEqual;
55305
55329
  const traverse = jsonSchemaTraverseExports;
55306
55330
  const SIMPLE_INLINED = /* @__PURE__ */ new Set([
@@ -55359,7 +55383,7 @@ function countKeys(schema2) {
55359
55383
  if (SIMPLE_INLINED.has(key2))
55360
55384
  continue;
55361
55385
  if (typeof schema2[key2] == "object") {
55362
- (0, util_1$n.eachItem)(schema2[key2], (sch) => count += countKeys(sch));
55386
+ (0, util_1$m.eachItem)(schema2[key2], (sch) => count += countKeys(sch));
55363
55387
  }
55364
55388
  if (count === Infinity)
55365
55389
  return Infinity;
@@ -55447,516 +55471,528 @@ function getSchemaRefs(schema2, baseId) {
55447
55471
  }
55448
55472
  }
55449
55473
  resolve$2.getSchemaRefs = getSchemaRefs;
55450
- Object.defineProperty(validate$1, "__esModule", { value: true });
55451
- validate$1.getData = validate$1.KeywordCxt = validate$1.validateFunctionCode = void 0;
55452
- const boolSchema_1 = boolSchema;
55453
- const dataType_1$1 = dataType;
55454
- const applicability_1 = applicability;
55455
- const dataType_2 = dataType;
55456
- const defaults_1 = defaults$4;
55457
- const keyword_1 = keyword;
55458
- const subschema_1 = subschema;
55459
- const codegen_1$n = codegen;
55460
- const names_1$3 = names$1;
55461
- const resolve_1$2 = resolve$2;
55462
- const util_1$m = util$1;
55463
- const errors_1 = errors;
55464
- function validateFunctionCode(it2) {
55465
- if (isSchemaObj(it2)) {
55466
- checkKeywords(it2);
55467
- if (schemaCxtHasRules(it2)) {
55468
- topSchemaObjCode(it2);
55469
- return;
55474
+ var hasRequiredValidate;
55475
+ function requireValidate() {
55476
+ if (hasRequiredValidate) return validate$1;
55477
+ hasRequiredValidate = 1;
55478
+ Object.defineProperty(validate$1, "__esModule", { value: true });
55479
+ validate$1.getData = validate$1.KeywordCxt = validate$1.validateFunctionCode = void 0;
55480
+ const boolSchema_1 = requireBoolSchema();
55481
+ const dataType_12 = dataType;
55482
+ const applicability_12 = applicability;
55483
+ const dataType_2 = dataType;
55484
+ const defaults_1 = requireDefaults();
55485
+ const keyword_1 = requireKeyword();
55486
+ const subschema_1 = requireSubschema();
55487
+ const codegen_12 = codegen;
55488
+ const names_12 = names$1;
55489
+ const resolve_12 = resolve$2;
55490
+ const util_12 = util$1;
55491
+ const errors_12 = errors;
55492
+ function validateFunctionCode(it2) {
55493
+ if (isSchemaObj(it2)) {
55494
+ checkKeywords(it2);
55495
+ if (schemaCxtHasRules(it2)) {
55496
+ topSchemaObjCode(it2);
55497
+ return;
55498
+ }
55470
55499
  }
55500
+ validateFunction(it2, () => (0, boolSchema_1.topBoolOrEmptySchema)(it2));
55471
55501
  }
55472
- validateFunction(it2, () => (0, boolSchema_1.topBoolOrEmptySchema)(it2));
55473
- }
55474
- validate$1.validateFunctionCode = validateFunctionCode;
55475
- function validateFunction({ gen, validateName: validateName2, schema: schema2, schemaEnv, opts }, body) {
55476
- if (opts.code.es5) {
55477
- gen.func(validateName2, (0, codegen_1$n._)`${names_1$3.default.data}, ${names_1$3.default.valCxt}`, schemaEnv.$async, () => {
55478
- gen.code((0, codegen_1$n._)`"use strict"; ${funcSourceUrl(schema2, opts)}`);
55479
- destructureValCxtES5(gen, opts);
55480
- gen.code(body);
55481
- });
55482
- } else {
55483
- gen.func(validateName2, (0, codegen_1$n._)`${names_1$3.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema2, opts)).code(body));
55484
- }
55485
- }
55486
- function destructureValCxt(opts) {
55487
- return (0, codegen_1$n._)`{${names_1$3.default.instancePath}="", ${names_1$3.default.parentData}, ${names_1$3.default.parentDataProperty}, ${names_1$3.default.rootData}=${names_1$3.default.data}${opts.dynamicRef ? (0, codegen_1$n._)`, ${names_1$3.default.dynamicAnchors}={}` : codegen_1$n.nil}}={}`;
55488
- }
55489
- function destructureValCxtES5(gen, opts) {
55490
- gen.if(names_1$3.default.valCxt, () => {
55491
- gen.var(names_1$3.default.instancePath, (0, codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.instancePath}`);
55492
- gen.var(names_1$3.default.parentData, (0, codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.parentData}`);
55493
- gen.var(names_1$3.default.parentDataProperty, (0, codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.parentDataProperty}`);
55494
- gen.var(names_1$3.default.rootData, (0, codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.rootData}`);
55495
- if (opts.dynamicRef)
55496
- gen.var(names_1$3.default.dynamicAnchors, (0, codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.dynamicAnchors}`);
55497
- }, () => {
55498
- gen.var(names_1$3.default.instancePath, (0, codegen_1$n._)`""`);
55499
- gen.var(names_1$3.default.parentData, (0, codegen_1$n._)`undefined`);
55500
- gen.var(names_1$3.default.parentDataProperty, (0, codegen_1$n._)`undefined`);
55501
- gen.var(names_1$3.default.rootData, names_1$3.default.data);
55502
- if (opts.dynamicRef)
55503
- gen.var(names_1$3.default.dynamicAnchors, (0, codegen_1$n._)`{}`);
55504
- });
55505
- }
55506
- function topSchemaObjCode(it2) {
55507
- const { schema: schema2, opts, gen } = it2;
55508
- validateFunction(it2, () => {
55509
- if (opts.$comment && schema2.$comment)
55510
- commentKeyword(it2);
55511
- checkNoDefault(it2);
55512
- gen.let(names_1$3.default.vErrors, null);
55513
- gen.let(names_1$3.default.errors, 0);
55514
- if (opts.unevaluated)
55515
- resetEvaluated(it2);
55516
- typeAndKeywords(it2);
55517
- returnResults(it2);
55518
- });
55519
- return;
55520
- }
55521
- function resetEvaluated(it2) {
55522
- const { gen, validateName: validateName2 } = it2;
55523
- it2.evaluated = gen.const("evaluated", (0, codegen_1$n._)`${validateName2}.evaluated`);
55524
- gen.if((0, codegen_1$n._)`${it2.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1$n._)`${it2.evaluated}.props`, (0, codegen_1$n._)`undefined`));
55525
- gen.if((0, codegen_1$n._)`${it2.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1$n._)`${it2.evaluated}.items`, (0, codegen_1$n._)`undefined`));
55526
- }
55527
- function funcSourceUrl(schema2, opts) {
55528
- const schId = typeof schema2 == "object" && schema2[opts.schemaId];
55529
- return schId && (opts.code.source || opts.code.process) ? (0, codegen_1$n._)`/*# sourceURL=${schId} */` : codegen_1$n.nil;
55530
- }
55531
- function subschemaCode(it2, valid) {
55532
- if (isSchemaObj(it2)) {
55533
- checkKeywords(it2);
55534
- if (schemaCxtHasRules(it2)) {
55535
- subSchemaObjCode(it2, valid);
55536
- return;
55502
+ validate$1.validateFunctionCode = validateFunctionCode;
55503
+ function validateFunction({ gen, validateName: validateName2, schema: schema2, schemaEnv, opts }, body) {
55504
+ if (opts.code.es5) {
55505
+ gen.func(validateName2, (0, codegen_12._)`${names_12.default.data}, ${names_12.default.valCxt}`, schemaEnv.$async, () => {
55506
+ gen.code((0, codegen_12._)`"use strict"; ${funcSourceUrl(schema2, opts)}`);
55507
+ destructureValCxtES5(gen, opts);
55508
+ gen.code(body);
55509
+ });
55510
+ } else {
55511
+ gen.func(validateName2, (0, codegen_12._)`${names_12.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema2, opts)).code(body));
55537
55512
  }
55538
55513
  }
55539
- (0, boolSchema_1.boolOrEmptySchema)(it2, valid);
55540
- }
55541
- function schemaCxtHasRules({ schema: schema2, self: self2 }) {
55542
- if (typeof schema2 == "boolean")
55543
- return !schema2;
55544
- for (const key2 in schema2)
55545
- if (self2.RULES.all[key2])
55546
- return true;
55547
- return false;
55548
- }
55549
- function isSchemaObj(it2) {
55550
- return typeof it2.schema != "boolean";
55551
- }
55552
- function subSchemaObjCode(it2, valid) {
55553
- const { schema: schema2, gen, opts } = it2;
55554
- if (opts.$comment && schema2.$comment)
55555
- commentKeyword(it2);
55556
- updateContext(it2);
55557
- checkAsyncSchema(it2);
55558
- const errsCount = gen.const("_errs", names_1$3.default.errors);
55559
- typeAndKeywords(it2, errsCount);
55560
- gen.var(valid, (0, codegen_1$n._)`${errsCount} === ${names_1$3.default.errors}`);
55561
- }
55562
- function checkKeywords(it2) {
55563
- (0, util_1$m.checkUnknownRules)(it2);
55564
- checkRefsAndKeywords(it2);
55565
- }
55566
- function typeAndKeywords(it2, errsCount) {
55567
- if (it2.opts.jtd)
55568
- return schemaKeywords(it2, [], false, errsCount);
55569
- const types2 = (0, dataType_1$1.getSchemaTypes)(it2.schema);
55570
- const checkedTypes = (0, dataType_1$1.coerceAndCheckDataType)(it2, types2);
55571
- schemaKeywords(it2, types2, !checkedTypes, errsCount);
55572
- }
55573
- function checkRefsAndKeywords(it2) {
55574
- const { schema: schema2, errSchemaPath, opts, self: self2 } = it2;
55575
- if (schema2.$ref && opts.ignoreKeywordsWithRef && (0, util_1$m.schemaHasRulesButRef)(schema2, self2.RULES)) {
55576
- self2.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
55577
- }
55578
- }
55579
- function checkNoDefault(it2) {
55580
- const { schema: schema2, opts } = it2;
55581
- if (schema2.default !== void 0 && opts.useDefaults && opts.strictSchema) {
55582
- (0, util_1$m.checkStrictMode)(it2, "default is ignored in the schema root");
55583
- }
55584
- }
55585
- function updateContext(it2) {
55586
- const schId = it2.schema[it2.opts.schemaId];
55587
- if (schId)
55588
- it2.baseId = (0, resolve_1$2.resolveUrl)(it2.opts.uriResolver, it2.baseId, schId);
55589
- }
55590
- function checkAsyncSchema(it2) {
55591
- if (it2.schema.$async && !it2.schemaEnv.$async)
55592
- throw new Error("async schema in sync schema");
55593
- }
55594
- function commentKeyword({ gen, schemaEnv, schema: schema2, errSchemaPath, opts }) {
55595
- const msg = schema2.$comment;
55596
- if (opts.$comment === true) {
55597
- gen.code((0, codegen_1$n._)`${names_1$3.default.self}.logger.log(${msg})`);
55598
- } else if (typeof opts.$comment == "function") {
55599
- const schemaPath = (0, codegen_1$n.str)`${errSchemaPath}/$comment`;
55600
- const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
55601
- gen.code((0, codegen_1$n._)`${names_1$3.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
55602
- }
55603
- }
55604
- function returnResults(it2) {
55605
- const { gen, schemaEnv, validateName: validateName2, ValidationError: ValidationError2, opts } = it2;
55606
- if (schemaEnv.$async) {
55607
- gen.if((0, codegen_1$n._)`${names_1$3.default.errors} === 0`, () => gen.return(names_1$3.default.data), () => gen.throw((0, codegen_1$n._)`new ${ValidationError2}(${names_1$3.default.vErrors})`));
55608
- } else {
55609
- gen.assign((0, codegen_1$n._)`${validateName2}.errors`, names_1$3.default.vErrors);
55610
- if (opts.unevaluated)
55611
- assignEvaluated(it2);
55612
- gen.return((0, codegen_1$n._)`${names_1$3.default.errors} === 0`);
55613
- }
55614
- }
55615
- function assignEvaluated({ gen, evaluated, props, items: items2 }) {
55616
- if (props instanceof codegen_1$n.Name)
55617
- gen.assign((0, codegen_1$n._)`${evaluated}.props`, props);
55618
- if (items2 instanceof codegen_1$n.Name)
55619
- gen.assign((0, codegen_1$n._)`${evaluated}.items`, items2);
55620
- }
55621
- function schemaKeywords(it2, types2, typeErrors, errsCount) {
55622
- const { gen, schema: schema2, data, allErrors, opts, self: self2 } = it2;
55623
- const { RULES } = self2;
55624
- if (schema2.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1$m.schemaHasRulesButRef)(schema2, RULES))) {
55625
- gen.block(() => keywordCode(it2, "$ref", RULES.all.$ref.definition));
55514
+ function destructureValCxt(opts) {
55515
+ return (0, codegen_12._)`{${names_12.default.instancePath}="", ${names_12.default.parentData}, ${names_12.default.parentDataProperty}, ${names_12.default.rootData}=${names_12.default.data}${opts.dynamicRef ? (0, codegen_12._)`, ${names_12.default.dynamicAnchors}={}` : codegen_12.nil}}={}`;
55516
+ }
55517
+ function destructureValCxtES5(gen, opts) {
55518
+ gen.if(names_12.default.valCxt, () => {
55519
+ gen.var(names_12.default.instancePath, (0, codegen_12._)`${names_12.default.valCxt}.${names_12.default.instancePath}`);
55520
+ gen.var(names_12.default.parentData, (0, codegen_12._)`${names_12.default.valCxt}.${names_12.default.parentData}`);
55521
+ gen.var(names_12.default.parentDataProperty, (0, codegen_12._)`${names_12.default.valCxt}.${names_12.default.parentDataProperty}`);
55522
+ gen.var(names_12.default.rootData, (0, codegen_12._)`${names_12.default.valCxt}.${names_12.default.rootData}`);
55523
+ if (opts.dynamicRef)
55524
+ gen.var(names_12.default.dynamicAnchors, (0, codegen_12._)`${names_12.default.valCxt}.${names_12.default.dynamicAnchors}`);
55525
+ }, () => {
55526
+ gen.var(names_12.default.instancePath, (0, codegen_12._)`""`);
55527
+ gen.var(names_12.default.parentData, (0, codegen_12._)`undefined`);
55528
+ gen.var(names_12.default.parentDataProperty, (0, codegen_12._)`undefined`);
55529
+ gen.var(names_12.default.rootData, names_12.default.data);
55530
+ if (opts.dynamicRef)
55531
+ gen.var(names_12.default.dynamicAnchors, (0, codegen_12._)`{}`);
55532
+ });
55533
+ }
55534
+ function topSchemaObjCode(it2) {
55535
+ const { schema: schema2, opts, gen } = it2;
55536
+ validateFunction(it2, () => {
55537
+ if (opts.$comment && schema2.$comment)
55538
+ commentKeyword(it2);
55539
+ checkNoDefault(it2);
55540
+ gen.let(names_12.default.vErrors, null);
55541
+ gen.let(names_12.default.errors, 0);
55542
+ if (opts.unevaluated)
55543
+ resetEvaluated(it2);
55544
+ typeAndKeywords(it2);
55545
+ returnResults(it2);
55546
+ });
55626
55547
  return;
55627
55548
  }
55628
- if (!opts.jtd)
55629
- checkStrictTypes(it2, types2);
55630
- gen.block(() => {
55631
- for (const group of RULES.rules)
55632
- groupKeywords(group);
55633
- groupKeywords(RULES.post);
55634
- });
55635
- function groupKeywords(group) {
55636
- if (!(0, applicability_1.shouldUseGroup)(schema2, group))
55637
- return;
55638
- if (group.type) {
55639
- gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
55640
- iterateKeywords(it2, group);
55641
- if (types2.length === 1 && types2[0] === group.type && typeErrors) {
55642
- gen.else();
55643
- (0, dataType_2.reportTypeError)(it2);
55549
+ function resetEvaluated(it2) {
55550
+ const { gen, validateName: validateName2 } = it2;
55551
+ it2.evaluated = gen.const("evaluated", (0, codegen_12._)`${validateName2}.evaluated`);
55552
+ gen.if((0, codegen_12._)`${it2.evaluated}.dynamicProps`, () => gen.assign((0, codegen_12._)`${it2.evaluated}.props`, (0, codegen_12._)`undefined`));
55553
+ gen.if((0, codegen_12._)`${it2.evaluated}.dynamicItems`, () => gen.assign((0, codegen_12._)`${it2.evaluated}.items`, (0, codegen_12._)`undefined`));
55554
+ }
55555
+ function funcSourceUrl(schema2, opts) {
55556
+ const schId = typeof schema2 == "object" && schema2[opts.schemaId];
55557
+ return schId && (opts.code.source || opts.code.process) ? (0, codegen_12._)`/*# sourceURL=${schId} */` : codegen_12.nil;
55558
+ }
55559
+ function subschemaCode(it2, valid) {
55560
+ if (isSchemaObj(it2)) {
55561
+ checkKeywords(it2);
55562
+ if (schemaCxtHasRules(it2)) {
55563
+ subSchemaObjCode(it2, valid);
55564
+ return;
55644
55565
  }
55645
- gen.endIf();
55646
- } else {
55647
- iterateKeywords(it2, group);
55648
55566
  }
55649
- if (!allErrors)
55650
- gen.if((0, codegen_1$n._)`${names_1$3.default.errors} === ${errsCount || 0}`);
55567
+ (0, boolSchema_1.boolOrEmptySchema)(it2, valid);
55651
55568
  }
55652
- }
55653
- function iterateKeywords(it2, group) {
55654
- const { gen, schema: schema2, opts: { useDefaults } } = it2;
55655
- if (useDefaults)
55656
- (0, defaults_1.assignDefaults)(it2, group.type);
55657
- gen.block(() => {
55658
- for (const rule of group.rules) {
55659
- if ((0, applicability_1.shouldUseRule)(schema2, rule)) {
55660
- keywordCode(it2, rule.keyword, rule.definition, group.type);
55661
- }
55662
- }
55663
- });
55664
- }
55665
- function checkStrictTypes(it2, types2) {
55666
- if (it2.schemaEnv.meta || !it2.opts.strictTypes)
55667
- return;
55668
- checkContextTypes(it2, types2);
55669
- if (!it2.opts.allowUnionTypes)
55670
- checkMultipleTypes(it2, types2);
55671
- checkKeywordTypes(it2, it2.dataTypes);
55672
- }
55673
- function checkContextTypes(it2, types2) {
55674
- if (!types2.length)
55675
- return;
55676
- if (!it2.dataTypes.length) {
55677
- it2.dataTypes = types2;
55678
- return;
55569
+ function schemaCxtHasRules({ schema: schema2, self: self2 }) {
55570
+ if (typeof schema2 == "boolean")
55571
+ return !schema2;
55572
+ for (const key2 in schema2)
55573
+ if (self2.RULES.all[key2])
55574
+ return true;
55575
+ return false;
55679
55576
  }
55680
- types2.forEach((t) => {
55681
- if (!includesType(it2.dataTypes, t)) {
55682
- strictTypesError(it2, `type "${t}" not allowed by context "${it2.dataTypes.join(",")}"`);
55683
- }
55684
- });
55685
- narrowSchemaTypes(it2, types2);
55686
- }
55687
- function checkMultipleTypes(it2, ts2) {
55688
- if (ts2.length > 1 && !(ts2.length === 2 && ts2.includes("null"))) {
55689
- strictTypesError(it2, "use allowUnionTypes to allow union type keyword");
55577
+ function isSchemaObj(it2) {
55578
+ return typeof it2.schema != "boolean";
55690
55579
  }
55691
- }
55692
- function checkKeywordTypes(it2, ts2) {
55693
- const rules2 = it2.self.RULES.all;
55694
- for (const keyword2 in rules2) {
55695
- const rule = rules2[keyword2];
55696
- if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it2.schema, rule)) {
55697
- const { type: type2 } = rule.definition;
55698
- if (type2.length && !type2.some((t) => hasApplicableType(ts2, t))) {
55699
- strictTypesError(it2, `missing type "${type2.join(",")}" for keyword "${keyword2}"`);
55700
- }
55701
- }
55580
+ function subSchemaObjCode(it2, valid) {
55581
+ const { schema: schema2, gen, opts } = it2;
55582
+ if (opts.$comment && schema2.$comment)
55583
+ commentKeyword(it2);
55584
+ updateContext(it2);
55585
+ checkAsyncSchema(it2);
55586
+ const errsCount = gen.const("_errs", names_12.default.errors);
55587
+ typeAndKeywords(it2, errsCount);
55588
+ gen.var(valid, (0, codegen_12._)`${errsCount} === ${names_12.default.errors}`);
55702
55589
  }
55703
- }
55704
- function hasApplicableType(schTs, kwdT) {
55705
- return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
55706
- }
55707
- function includesType(ts2, t) {
55708
- return ts2.includes(t) || t === "integer" && ts2.includes("number");
55709
- }
55710
- function narrowSchemaTypes(it2, withTypes) {
55711
- const ts2 = [];
55712
- for (const t of it2.dataTypes) {
55713
- if (includesType(withTypes, t))
55714
- ts2.push(t);
55715
- else if (withTypes.includes("integer") && t === "number")
55716
- ts2.push("integer");
55590
+ function checkKeywords(it2) {
55591
+ (0, util_12.checkUnknownRules)(it2);
55592
+ checkRefsAndKeywords(it2);
55717
55593
  }
55718
- it2.dataTypes = ts2;
55719
- }
55720
- function strictTypesError(it2, msg) {
55721
- const schemaPath = it2.schemaEnv.baseId + it2.errSchemaPath;
55722
- msg += ` at "${schemaPath}" (strictTypes)`;
55723
- (0, util_1$m.checkStrictMode)(it2, msg, it2.opts.strictTypes);
55724
- }
55725
- class KeywordCxt {
55726
- constructor(it2, def2, keyword2) {
55727
- (0, keyword_1.validateKeywordUsage)(it2, def2, keyword2);
55728
- this.gen = it2.gen;
55729
- this.allErrors = it2.allErrors;
55730
- this.keyword = keyword2;
55731
- this.data = it2.data;
55732
- this.schema = it2.schema[keyword2];
55733
- this.$data = def2.$data && it2.opts.$data && this.schema && this.schema.$data;
55734
- this.schemaValue = (0, util_1$m.schemaRefOrVal)(it2, this.schema, keyword2, this.$data);
55735
- this.schemaType = def2.schemaType;
55736
- this.parentSchema = it2.schema;
55737
- this.params = {};
55738
- this.it = it2;
55739
- this.def = def2;
55740
- if (this.$data) {
55741
- this.schemaCode = it2.gen.const("vSchema", getData(this.$data, it2));
55742
- } else {
55743
- this.schemaCode = this.schemaValue;
55744
- if (!(0, keyword_1.validSchemaType)(this.schema, def2.schemaType, def2.allowUndefined)) {
55745
- throw new Error(`${keyword2} value must be ${JSON.stringify(def2.schemaType)}`);
55746
- }
55594
+ function typeAndKeywords(it2, errsCount) {
55595
+ if (it2.opts.jtd)
55596
+ return schemaKeywords(it2, [], false, errsCount);
55597
+ const types2 = (0, dataType_12.getSchemaTypes)(it2.schema);
55598
+ const checkedTypes = (0, dataType_12.coerceAndCheckDataType)(it2, types2);
55599
+ schemaKeywords(it2, types2, !checkedTypes, errsCount);
55600
+ }
55601
+ function checkRefsAndKeywords(it2) {
55602
+ const { schema: schema2, errSchemaPath, opts, self: self2 } = it2;
55603
+ if (schema2.$ref && opts.ignoreKeywordsWithRef && (0, util_12.schemaHasRulesButRef)(schema2, self2.RULES)) {
55604
+ self2.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
55747
55605
  }
55748
- if ("code" in def2 ? def2.trackErrors : def2.errors !== false) {
55749
- this.errsCount = it2.gen.const("_errs", names_1$3.default.errors);
55606
+ }
55607
+ function checkNoDefault(it2) {
55608
+ const { schema: schema2, opts } = it2;
55609
+ if (schema2.default !== void 0 && opts.useDefaults && opts.strictSchema) {
55610
+ (0, util_12.checkStrictMode)(it2, "default is ignored in the schema root");
55750
55611
  }
55751
55612
  }
55752
- result(condition, successAction, failAction) {
55753
- this.failResult((0, codegen_1$n.not)(condition), successAction, failAction);
55613
+ function updateContext(it2) {
55614
+ const schId = it2.schema[it2.opts.schemaId];
55615
+ if (schId)
55616
+ it2.baseId = (0, resolve_12.resolveUrl)(it2.opts.uriResolver, it2.baseId, schId);
55754
55617
  }
55755
- failResult(condition, successAction, failAction) {
55756
- this.gen.if(condition);
55757
- if (failAction)
55758
- failAction();
55759
- else
55760
- this.error();
55761
- if (successAction) {
55762
- this.gen.else();
55763
- successAction();
55764
- if (this.allErrors)
55765
- this.gen.endIf();
55618
+ function checkAsyncSchema(it2) {
55619
+ if (it2.schema.$async && !it2.schemaEnv.$async)
55620
+ throw new Error("async schema in sync schema");
55621
+ }
55622
+ function commentKeyword({ gen, schemaEnv, schema: schema2, errSchemaPath, opts }) {
55623
+ const msg = schema2.$comment;
55624
+ if (opts.$comment === true) {
55625
+ gen.code((0, codegen_12._)`${names_12.default.self}.logger.log(${msg})`);
55626
+ } else if (typeof opts.$comment == "function") {
55627
+ const schemaPath = (0, codegen_12.str)`${errSchemaPath}/$comment`;
55628
+ const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
55629
+ gen.code((0, codegen_12._)`${names_12.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
55630
+ }
55631
+ }
55632
+ function returnResults(it2) {
55633
+ const { gen, schemaEnv, validateName: validateName2, ValidationError, opts } = it2;
55634
+ if (schemaEnv.$async) {
55635
+ gen.if((0, codegen_12._)`${names_12.default.errors} === 0`, () => gen.return(names_12.default.data), () => gen.throw((0, codegen_12._)`new ${ValidationError}(${names_12.default.vErrors})`));
55766
55636
  } else {
55767
- if (this.allErrors)
55768
- this.gen.endIf();
55769
- else
55770
- this.gen.else();
55637
+ gen.assign((0, codegen_12._)`${validateName2}.errors`, names_12.default.vErrors);
55638
+ if (opts.unevaluated)
55639
+ assignEvaluated(it2);
55640
+ gen.return((0, codegen_12._)`${names_12.default.errors} === 0`);
55641
+ }
55642
+ }
55643
+ function assignEvaluated({ gen, evaluated, props, items: items2 }) {
55644
+ if (props instanceof codegen_12.Name)
55645
+ gen.assign((0, codegen_12._)`${evaluated}.props`, props);
55646
+ if (items2 instanceof codegen_12.Name)
55647
+ gen.assign((0, codegen_12._)`${evaluated}.items`, items2);
55648
+ }
55649
+ function schemaKeywords(it2, types2, typeErrors, errsCount) {
55650
+ const { gen, schema: schema2, data, allErrors, opts, self: self2 } = it2;
55651
+ const { RULES } = self2;
55652
+ if (schema2.$ref && (opts.ignoreKeywordsWithRef || !(0, util_12.schemaHasRulesButRef)(schema2, RULES))) {
55653
+ gen.block(() => keywordCode(it2, "$ref", RULES.all.$ref.definition));
55654
+ return;
55655
+ }
55656
+ if (!opts.jtd)
55657
+ checkStrictTypes(it2, types2);
55658
+ gen.block(() => {
55659
+ for (const group of RULES.rules)
55660
+ groupKeywords(group);
55661
+ groupKeywords(RULES.post);
55662
+ });
55663
+ function groupKeywords(group) {
55664
+ if (!(0, applicability_12.shouldUseGroup)(schema2, group))
55665
+ return;
55666
+ if (group.type) {
55667
+ gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
55668
+ iterateKeywords(it2, group);
55669
+ if (types2.length === 1 && types2[0] === group.type && typeErrors) {
55670
+ gen.else();
55671
+ (0, dataType_2.reportTypeError)(it2);
55672
+ }
55673
+ gen.endIf();
55674
+ } else {
55675
+ iterateKeywords(it2, group);
55676
+ }
55677
+ if (!allErrors)
55678
+ gen.if((0, codegen_12._)`${names_12.default.errors} === ${errsCount || 0}`);
55771
55679
  }
55772
55680
  }
55773
- pass(condition, failAction) {
55774
- this.failResult((0, codegen_1$n.not)(condition), void 0, failAction);
55681
+ function iterateKeywords(it2, group) {
55682
+ const { gen, schema: schema2, opts: { useDefaults } } = it2;
55683
+ if (useDefaults)
55684
+ (0, defaults_1.assignDefaults)(it2, group.type);
55685
+ gen.block(() => {
55686
+ for (const rule of group.rules) {
55687
+ if ((0, applicability_12.shouldUseRule)(schema2, rule)) {
55688
+ keywordCode(it2, rule.keyword, rule.definition, group.type);
55689
+ }
55690
+ }
55691
+ });
55775
55692
  }
55776
- fail(condition) {
55777
- if (condition === void 0) {
55778
- this.error();
55779
- if (!this.allErrors)
55780
- this.gen.if(false);
55693
+ function checkStrictTypes(it2, types2) {
55694
+ if (it2.schemaEnv.meta || !it2.opts.strictTypes)
55781
55695
  return;
55782
- }
55783
- this.gen.if(condition);
55784
- this.error();
55785
- if (this.allErrors)
55786
- this.gen.endIf();
55787
- else
55788
- this.gen.else();
55696
+ checkContextTypes(it2, types2);
55697
+ if (!it2.opts.allowUnionTypes)
55698
+ checkMultipleTypes(it2, types2);
55699
+ checkKeywordTypes(it2, it2.dataTypes);
55789
55700
  }
55790
- fail$data(condition) {
55791
- if (!this.$data)
55792
- return this.fail(condition);
55793
- const { schemaCode } = this;
55794
- this.fail((0, codegen_1$n._)`${schemaCode} !== undefined && (${(0, codegen_1$n.or)(this.invalid$data(), condition)})`);
55795
- }
55796
- error(append, errorParams, errorPaths) {
55797
- if (errorParams) {
55798
- this.setParams(errorParams);
55799
- this._error(append, errorPaths);
55800
- this.setParams({});
55701
+ function checkContextTypes(it2, types2) {
55702
+ if (!types2.length)
55703
+ return;
55704
+ if (!it2.dataTypes.length) {
55705
+ it2.dataTypes = types2;
55801
55706
  return;
55802
55707
  }
55803
- this._error(append, errorPaths);
55708
+ types2.forEach((t) => {
55709
+ if (!includesType(it2.dataTypes, t)) {
55710
+ strictTypesError(it2, `type "${t}" not allowed by context "${it2.dataTypes.join(",")}"`);
55711
+ }
55712
+ });
55713
+ narrowSchemaTypes(it2, types2);
55804
55714
  }
55805
- _error(append, errorPaths) {
55806
- (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);
55715
+ function checkMultipleTypes(it2, ts2) {
55716
+ if (ts2.length > 1 && !(ts2.length === 2 && ts2.includes("null"))) {
55717
+ strictTypesError(it2, "use allowUnionTypes to allow union type keyword");
55718
+ }
55807
55719
  }
55808
- $dataError() {
55809
- (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);
55720
+ function checkKeywordTypes(it2, ts2) {
55721
+ const rules2 = it2.self.RULES.all;
55722
+ for (const keyword2 in rules2) {
55723
+ const rule = rules2[keyword2];
55724
+ if (typeof rule == "object" && (0, applicability_12.shouldUseRule)(it2.schema, rule)) {
55725
+ const { type: type2 } = rule.definition;
55726
+ if (type2.length && !type2.some((t) => hasApplicableType(ts2, t))) {
55727
+ strictTypesError(it2, `missing type "${type2.join(",")}" for keyword "${keyword2}"`);
55728
+ }
55729
+ }
55730
+ }
55810
55731
  }
55811
- reset() {
55812
- if (this.errsCount === void 0)
55813
- throw new Error('add "trackErrors" to keyword definition');
55814
- (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);
55732
+ function hasApplicableType(schTs, kwdT) {
55733
+ return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
55815
55734
  }
55816
- ok(cond) {
55817
- if (!this.allErrors)
55818
- this.gen.if(cond);
55735
+ function includesType(ts2, t) {
55736
+ return ts2.includes(t) || t === "integer" && ts2.includes("number");
55819
55737
  }
55820
- setParams(obj, assign) {
55821
- if (assign)
55822
- Object.assign(this.params, obj);
55823
- else
55824
- this.params = obj;
55738
+ function narrowSchemaTypes(it2, withTypes) {
55739
+ const ts2 = [];
55740
+ for (const t of it2.dataTypes) {
55741
+ if (includesType(withTypes, t))
55742
+ ts2.push(t);
55743
+ else if (withTypes.includes("integer") && t === "number")
55744
+ ts2.push("integer");
55745
+ }
55746
+ it2.dataTypes = ts2;
55825
55747
  }
55826
- block$data(valid, codeBlock, $dataValid = codegen_1$n.nil) {
55827
- this.gen.block(() => {
55828
- this.check$data(valid, $dataValid);
55829
- codeBlock();
55830
- });
55748
+ function strictTypesError(it2, msg) {
55749
+ const schemaPath = it2.schemaEnv.baseId + it2.errSchemaPath;
55750
+ msg += ` at "${schemaPath}" (strictTypes)`;
55751
+ (0, util_12.checkStrictMode)(it2, msg, it2.opts.strictTypes);
55831
55752
  }
55832
- check$data(valid = codegen_1$n.nil, $dataValid = codegen_1$n.nil) {
55833
- if (!this.$data)
55834
- return;
55835
- const { gen, schemaCode, schemaType, def: def2 } = this;
55836
- gen.if((0, codegen_1$n.or)((0, codegen_1$n._)`${schemaCode} === undefined`, $dataValid));
55837
- if (valid !== codegen_1$n.nil)
55838
- gen.assign(valid, true);
55839
- if (schemaType.length || def2.validateSchema) {
55840
- gen.elseIf(this.invalid$data());
55841
- this.$dataError();
55842
- if (valid !== codegen_1$n.nil)
55843
- gen.assign(valid, false);
55753
+ class KeywordCxt {
55754
+ constructor(it2, def2, keyword2) {
55755
+ (0, keyword_1.validateKeywordUsage)(it2, def2, keyword2);
55756
+ this.gen = it2.gen;
55757
+ this.allErrors = it2.allErrors;
55758
+ this.keyword = keyword2;
55759
+ this.data = it2.data;
55760
+ this.schema = it2.schema[keyword2];
55761
+ this.$data = def2.$data && it2.opts.$data && this.schema && this.schema.$data;
55762
+ this.schemaValue = (0, util_12.schemaRefOrVal)(it2, this.schema, keyword2, this.$data);
55763
+ this.schemaType = def2.schemaType;
55764
+ this.parentSchema = it2.schema;
55765
+ this.params = {};
55766
+ this.it = it2;
55767
+ this.def = def2;
55768
+ if (this.$data) {
55769
+ this.schemaCode = it2.gen.const("vSchema", getData(this.$data, it2));
55770
+ } else {
55771
+ this.schemaCode = this.schemaValue;
55772
+ if (!(0, keyword_1.validSchemaType)(this.schema, def2.schemaType, def2.allowUndefined)) {
55773
+ throw new Error(`${keyword2} value must be ${JSON.stringify(def2.schemaType)}`);
55774
+ }
55775
+ }
55776
+ if ("code" in def2 ? def2.trackErrors : def2.errors !== false) {
55777
+ this.errsCount = it2.gen.const("_errs", names_12.default.errors);
55778
+ }
55844
55779
  }
55845
- gen.else();
55846
- }
55847
- invalid$data() {
55848
- const { gen, schemaCode, schemaType, def: def2, it: it2 } = this;
55849
- return (0, codegen_1$n.or)(wrong$DataType(), invalid$DataSchema());
55850
- function wrong$DataType() {
55851
- if (schemaType.length) {
55852
- if (!(schemaCode instanceof codegen_1$n.Name))
55853
- throw new Error("ajv implementation error");
55854
- const st2 = Array.isArray(schemaType) ? schemaType : [schemaType];
55855
- return (0, codegen_1$n._)`${(0, dataType_2.checkDataTypes)(st2, schemaCode, it2.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
55780
+ result(condition, successAction, failAction) {
55781
+ this.failResult((0, codegen_12.not)(condition), successAction, failAction);
55782
+ }
55783
+ failResult(condition, successAction, failAction) {
55784
+ this.gen.if(condition);
55785
+ if (failAction)
55786
+ failAction();
55787
+ else
55788
+ this.error();
55789
+ if (successAction) {
55790
+ this.gen.else();
55791
+ successAction();
55792
+ if (this.allErrors)
55793
+ this.gen.endIf();
55794
+ } else {
55795
+ if (this.allErrors)
55796
+ this.gen.endIf();
55797
+ else
55798
+ this.gen.else();
55856
55799
  }
55857
- return codegen_1$n.nil;
55858
55800
  }
55859
- function invalid$DataSchema() {
55860
- if (def2.validateSchema) {
55861
- const validateSchemaRef = gen.scopeValue("validate$data", { ref: def2.validateSchema });
55862
- return (0, codegen_1$n._)`!${validateSchemaRef}(${schemaCode})`;
55801
+ pass(condition, failAction) {
55802
+ this.failResult((0, codegen_12.not)(condition), void 0, failAction);
55803
+ }
55804
+ fail(condition) {
55805
+ if (condition === void 0) {
55806
+ this.error();
55807
+ if (!this.allErrors)
55808
+ this.gen.if(false);
55809
+ return;
55863
55810
  }
55864
- return codegen_1$n.nil;
55811
+ this.gen.if(condition);
55812
+ this.error();
55813
+ if (this.allErrors)
55814
+ this.gen.endIf();
55815
+ else
55816
+ this.gen.else();
55865
55817
  }
55866
- }
55867
- subschema(appl, valid) {
55868
- const subschema2 = (0, subschema_1.getSubschema)(this.it, appl);
55869
- (0, subschema_1.extendSubschemaData)(subschema2, this.it, appl);
55870
- (0, subschema_1.extendSubschemaMode)(subschema2, appl);
55871
- const nextContext = { ...this.it, ...subschema2, items: void 0, props: void 0 };
55872
- subschemaCode(nextContext, valid);
55873
- return nextContext;
55874
- }
55875
- mergeEvaluated(schemaCxt, toName) {
55876
- const { it: it2, gen } = this;
55877
- if (!it2.opts.unevaluated)
55878
- return;
55879
- if (it2.props !== true && schemaCxt.props !== void 0) {
55880
- it2.props = util_1$m.mergeEvaluated.props(gen, schemaCxt.props, it2.props, toName);
55818
+ fail$data(condition) {
55819
+ if (!this.$data)
55820
+ return this.fail(condition);
55821
+ const { schemaCode } = this;
55822
+ this.fail((0, codegen_12._)`${schemaCode} !== undefined && (${(0, codegen_12.or)(this.invalid$data(), condition)})`);
55823
+ }
55824
+ error(append, errorParams, errorPaths) {
55825
+ if (errorParams) {
55826
+ this.setParams(errorParams);
55827
+ this._error(append, errorPaths);
55828
+ this.setParams({});
55829
+ return;
55830
+ }
55831
+ this._error(append, errorPaths);
55881
55832
  }
55882
- if (it2.items !== true && schemaCxt.items !== void 0) {
55883
- it2.items = util_1$m.mergeEvaluated.items(gen, schemaCxt.items, it2.items, toName);
55833
+ _error(append, errorPaths) {
55834
+ (append ? errors_12.reportExtraError : errors_12.reportError)(this, this.def.error, errorPaths);
55884
55835
  }
55885
- }
55886
- mergeValidEvaluated(schemaCxt, valid) {
55887
- const { it: it2, gen } = this;
55888
- if (it2.opts.unevaluated && (it2.props !== true || it2.items !== true)) {
55889
- gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1$n.Name));
55890
- return true;
55836
+ $dataError() {
55837
+ (0, errors_12.reportError)(this, this.def.$dataError || errors_12.keyword$DataError);
55891
55838
  }
55892
- }
55893
- }
55894
- validate$1.KeywordCxt = KeywordCxt;
55895
- function keywordCode(it2, keyword2, def2, ruleType) {
55896
- const cxt = new KeywordCxt(it2, def2, keyword2);
55897
- if ("code" in def2) {
55898
- def2.code(cxt, ruleType);
55899
- } else if (cxt.$data && def2.validate) {
55900
- (0, keyword_1.funcKeywordCode)(cxt, def2);
55901
- } else if ("macro" in def2) {
55902
- (0, keyword_1.macroKeywordCode)(cxt, def2);
55903
- } else if (def2.compile || def2.validate) {
55904
- (0, keyword_1.funcKeywordCode)(cxt, def2);
55905
- }
55906
- }
55907
- const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
55908
- const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
55909
- function getData($data, { dataLevel, dataNames, dataPathArr }) {
55910
- let jsonPointer;
55911
- let data;
55912
- if ($data === "")
55913
- return names_1$3.default.rootData;
55914
- if ($data[0] === "/") {
55915
- if (!JSON_POINTER.test($data))
55916
- throw new Error(`Invalid JSON-pointer: ${$data}`);
55917
- jsonPointer = $data;
55918
- data = names_1$3.default.rootData;
55919
- } else {
55920
- const matches = RELATIVE_JSON_POINTER.exec($data);
55921
- if (!matches)
55922
- throw new Error(`Invalid JSON-pointer: ${$data}`);
55923
- const up = +matches[1];
55924
- jsonPointer = matches[2];
55925
- if (jsonPointer === "#") {
55926
- if (up >= dataLevel)
55927
- throw new Error(errorMsg("property/index", up));
55928
- return dataPathArr[dataLevel - up];
55929
- }
55930
- if (up > dataLevel)
55931
- throw new Error(errorMsg("data", up));
55932
- data = dataNames[dataLevel - up];
55933
- if (!jsonPointer)
55934
- return data;
55935
- }
55936
- let expr = data;
55937
- const segments = jsonPointer.split("/");
55938
- for (const segment2 of segments) {
55939
- if (segment2) {
55940
- data = (0, codegen_1$n._)`${data}${(0, codegen_1$n.getProperty)((0, util_1$m.unescapeJsonPointer)(segment2))}`;
55941
- expr = (0, codegen_1$n._)`${expr} && ${data}`;
55839
+ reset() {
55840
+ if (this.errsCount === void 0)
55841
+ throw new Error('add "trackErrors" to keyword definition');
55842
+ (0, errors_12.resetErrorsCount)(this.gen, this.errsCount);
55843
+ }
55844
+ ok(cond) {
55845
+ if (!this.allErrors)
55846
+ this.gen.if(cond);
55847
+ }
55848
+ setParams(obj, assign) {
55849
+ if (assign)
55850
+ Object.assign(this.params, obj);
55851
+ else
55852
+ this.params = obj;
55853
+ }
55854
+ block$data(valid, codeBlock, $dataValid = codegen_12.nil) {
55855
+ this.gen.block(() => {
55856
+ this.check$data(valid, $dataValid);
55857
+ codeBlock();
55858
+ });
55859
+ }
55860
+ check$data(valid = codegen_12.nil, $dataValid = codegen_12.nil) {
55861
+ if (!this.$data)
55862
+ return;
55863
+ const { gen, schemaCode, schemaType, def: def2 } = this;
55864
+ gen.if((0, codegen_12.or)((0, codegen_12._)`${schemaCode} === undefined`, $dataValid));
55865
+ if (valid !== codegen_12.nil)
55866
+ gen.assign(valid, true);
55867
+ if (schemaType.length || def2.validateSchema) {
55868
+ gen.elseIf(this.invalid$data());
55869
+ this.$dataError();
55870
+ if (valid !== codegen_12.nil)
55871
+ gen.assign(valid, false);
55872
+ }
55873
+ gen.else();
55874
+ }
55875
+ invalid$data() {
55876
+ const { gen, schemaCode, schemaType, def: def2, it: it2 } = this;
55877
+ return (0, codegen_12.or)(wrong$DataType(), invalid$DataSchema());
55878
+ function wrong$DataType() {
55879
+ if (schemaType.length) {
55880
+ if (!(schemaCode instanceof codegen_12.Name))
55881
+ throw new Error("ajv implementation error");
55882
+ const st2 = Array.isArray(schemaType) ? schemaType : [schemaType];
55883
+ return (0, codegen_12._)`${(0, dataType_2.checkDataTypes)(st2, schemaCode, it2.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
55884
+ }
55885
+ return codegen_12.nil;
55886
+ }
55887
+ function invalid$DataSchema() {
55888
+ if (def2.validateSchema) {
55889
+ const validateSchemaRef = gen.scopeValue("validate$data", { ref: def2.validateSchema });
55890
+ return (0, codegen_12._)`!${validateSchemaRef}(${schemaCode})`;
55891
+ }
55892
+ return codegen_12.nil;
55893
+ }
55894
+ }
55895
+ subschema(appl, valid) {
55896
+ const subschema2 = (0, subschema_1.getSubschema)(this.it, appl);
55897
+ (0, subschema_1.extendSubschemaData)(subschema2, this.it, appl);
55898
+ (0, subschema_1.extendSubschemaMode)(subschema2, appl);
55899
+ const nextContext = { ...this.it, ...subschema2, items: void 0, props: void 0 };
55900
+ subschemaCode(nextContext, valid);
55901
+ return nextContext;
55902
+ }
55903
+ mergeEvaluated(schemaCxt, toName) {
55904
+ const { it: it2, gen } = this;
55905
+ if (!it2.opts.unevaluated)
55906
+ return;
55907
+ if (it2.props !== true && schemaCxt.props !== void 0) {
55908
+ it2.props = util_12.mergeEvaluated.props(gen, schemaCxt.props, it2.props, toName);
55909
+ }
55910
+ if (it2.items !== true && schemaCxt.items !== void 0) {
55911
+ it2.items = util_12.mergeEvaluated.items(gen, schemaCxt.items, it2.items, toName);
55912
+ }
55913
+ }
55914
+ mergeValidEvaluated(schemaCxt, valid) {
55915
+ const { it: it2, gen } = this;
55916
+ if (it2.opts.unevaluated && (it2.props !== true || it2.items !== true)) {
55917
+ gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_12.Name));
55918
+ return true;
55919
+ }
55942
55920
  }
55943
55921
  }
55944
- return expr;
55945
- function errorMsg(pointerType, up) {
55946
- return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
55922
+ validate$1.KeywordCxt = KeywordCxt;
55923
+ function keywordCode(it2, keyword2, def2, ruleType) {
55924
+ const cxt = new KeywordCxt(it2, def2, keyword2);
55925
+ if ("code" in def2) {
55926
+ def2.code(cxt, ruleType);
55927
+ } else if (cxt.$data && def2.validate) {
55928
+ (0, keyword_1.funcKeywordCode)(cxt, def2);
55929
+ } else if ("macro" in def2) {
55930
+ (0, keyword_1.macroKeywordCode)(cxt, def2);
55931
+ } else if (def2.compile || def2.validate) {
55932
+ (0, keyword_1.funcKeywordCode)(cxt, def2);
55933
+ }
55934
+ }
55935
+ const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
55936
+ const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
55937
+ function getData($data, { dataLevel, dataNames, dataPathArr }) {
55938
+ let jsonPointer;
55939
+ let data;
55940
+ if ($data === "")
55941
+ return names_12.default.rootData;
55942
+ if ($data[0] === "/") {
55943
+ if (!JSON_POINTER.test($data))
55944
+ throw new Error(`Invalid JSON-pointer: ${$data}`);
55945
+ jsonPointer = $data;
55946
+ data = names_12.default.rootData;
55947
+ } else {
55948
+ const matches = RELATIVE_JSON_POINTER.exec($data);
55949
+ if (!matches)
55950
+ throw new Error(`Invalid JSON-pointer: ${$data}`);
55951
+ const up = +matches[1];
55952
+ jsonPointer = matches[2];
55953
+ if (jsonPointer === "#") {
55954
+ if (up >= dataLevel)
55955
+ throw new Error(errorMsg("property/index", up));
55956
+ return dataPathArr[dataLevel - up];
55957
+ }
55958
+ if (up > dataLevel)
55959
+ throw new Error(errorMsg("data", up));
55960
+ data = dataNames[dataLevel - up];
55961
+ if (!jsonPointer)
55962
+ return data;
55963
+ }
55964
+ let expr = data;
55965
+ const segments = jsonPointer.split("/");
55966
+ for (const segment2 of segments) {
55967
+ if (segment2) {
55968
+ data = (0, codegen_12._)`${data}${(0, codegen_12.getProperty)((0, util_12.unescapeJsonPointer)(segment2))}`;
55969
+ expr = (0, codegen_12._)`${expr} && ${data}`;
55970
+ }
55971
+ }
55972
+ return expr;
55973
+ function errorMsg(pointerType, up) {
55974
+ return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
55975
+ }
55947
55976
  }
55977
+ validate$1.getData = getData;
55978
+ return validate$1;
55948
55979
  }
55949
- validate$1.getData = getData;
55950
55980
  var validation_error = {};
55951
- Object.defineProperty(validation_error, "__esModule", { value: true });
55952
- class ValidationError extends Error {
55953
- constructor(errors2) {
55954
- super("validation failed");
55955
- this.errors = errors2;
55956
- this.ajv = this.validation = true;
55981
+ var hasRequiredValidation_error;
55982
+ function requireValidation_error() {
55983
+ if (hasRequiredValidation_error) return validation_error;
55984
+ hasRequiredValidation_error = 1;
55985
+ Object.defineProperty(validation_error, "__esModule", { value: true });
55986
+ class ValidationError extends Error {
55987
+ constructor(errors2) {
55988
+ super("validation failed");
55989
+ this.errors = errors2;
55990
+ this.ajv = this.validation = true;
55991
+ }
55957
55992
  }
55993
+ validation_error.default = ValidationError;
55994
+ return validation_error;
55958
55995
  }
55959
- validation_error.default = ValidationError;
55960
55996
  var ref_error = {};
55961
55997
  Object.defineProperty(ref_error, "__esModule", { value: true });
55962
55998
  const resolve_1$1 = resolve$2;
@@ -55972,11 +56008,11 @@ var compile = {};
55972
56008
  Object.defineProperty(compile, "__esModule", { value: true });
55973
56009
  compile.resolveSchema = compile.getCompilingSchema = compile.resolveRef = compile.compileSchema = compile.SchemaEnv = void 0;
55974
56010
  const codegen_1$m = codegen;
55975
- const validation_error_1 = validation_error;
56011
+ const validation_error_1 = requireValidation_error();
55976
56012
  const names_1$2 = names$1;
55977
56013
  const resolve_1 = resolve$2;
55978
56014
  const util_1$l = util$1;
55979
- const validate_1$1 = validate$1;
56015
+ const validate_1$1 = requireValidate();
55980
56016
  class SchemaEnv {
55981
56017
  constructor(env) {
55982
56018
  var _a2;
@@ -56992,7 +57028,7 @@ uri$1.default = uri;
56992
57028
  (function(exports$1) {
56993
57029
  Object.defineProperty(exports$1, "__esModule", { value: true });
56994
57030
  exports$1.CodeGen = exports$1.Name = exports$1.nil = exports$1.stringify = exports$1.str = exports$1._ = exports$1.KeywordCxt = void 0;
56995
- var validate_12 = validate$1;
57031
+ var validate_12 = requireValidate();
56996
57032
  Object.defineProperty(exports$1, "KeywordCxt", { enumerable: true, get: function() {
56997
57033
  return validate_12.KeywordCxt;
56998
57034
  } });
@@ -57015,7 +57051,7 @@ uri$1.default = uri;
57015
57051
  Object.defineProperty(exports$1, "CodeGen", { enumerable: true, get: function() {
57016
57052
  return codegen_12.CodeGen;
57017
57053
  } });
57018
- const validation_error_12 = validation_error;
57054
+ const validation_error_12 = requireValidation_error();
57019
57055
  const ref_error_12 = ref_error;
57020
57056
  const rules_12 = rules;
57021
57057
  const compile_12 = compile;
@@ -58603,7 +58639,7 @@ const def$b = {
58603
58639
  additionalProperties.default = def$b;
58604
58640
  var properties$1 = {};
58605
58641
  Object.defineProperty(properties$1, "__esModule", { value: true });
58606
- const validate_1 = validate$1;
58642
+ const validate_1 = requireValidate();
58607
58643
  const code_1$2 = code;
58608
58644
  const util_1$7 = util$1;
58609
58645
  const additionalProperties_1$1 = additionalProperties;
@@ -59454,7 +59490,7 @@ const require$$3 = {
59454
59490
  module.exports.Ajv = Ajv2;
59455
59491
  Object.defineProperty(exports$1, "__esModule", { value: true });
59456
59492
  exports$1.default = Ajv2;
59457
- var validate_12 = validate$1;
59493
+ var validate_12 = requireValidate();
59458
59494
  Object.defineProperty(exports$1, "KeywordCxt", { enumerable: true, get: function() {
59459
59495
  return validate_12.KeywordCxt;
59460
59496
  } });
@@ -59477,7 +59513,7 @@ const require$$3 = {
59477
59513
  Object.defineProperty(exports$1, "CodeGen", { enumerable: true, get: function() {
59478
59514
  return codegen_12.CodeGen;
59479
59515
  } });
59480
- var validation_error_12 = validation_error;
59516
+ var validation_error_12 = requireValidation_error();
59481
59517
  Object.defineProperty(exports$1, "ValidationError", { enumerable: true, get: function() {
59482
59518
  return validation_error_12.default;
59483
59519
  } });
@@ -67910,7 +67946,7 @@ const DANGEROUS_PROVIDER_KEYS = /* @__PURE__ */ new Set([
67910
67946
  "prototype",
67911
67947
  "constructor"
67912
67948
  ]);
67913
- const providerRuntimeLoader = createLazyImportLoader(() => import("./provider-discovery.runtime-C7QlqKhh.js"));
67949
+ const providerRuntimeLoader = createLazyImportLoader(() => import("./provider-discovery.runtime-Ut_h1pRP.js"));
67914
67950
  function loadProviderRuntime() {
67915
67951
  return providerRuntimeLoader.load();
67916
67952
  }
@@ -69551,7 +69587,7 @@ const CONTEXT_WINDOW_RUNTIME_STATE_KEY = Symbol.for("openclaw.contextWindowRunti
69551
69587
  configuredConfig: void 0,
69552
69588
  configLoadFailures: 0,
69553
69589
  nextConfigLoadAttemptAtMs: 0,
69554
- modelsConfigRuntimeLoader: createLazyImportLoader(() => import("./models-config.runtime-C39G_JMq.js"))
69590
+ modelsConfigRuntimeLoader: createLazyImportLoader(() => import("./models-config.runtime-D573bKUC.js"))
69555
69591
  };
69556
69592
  return globalState[CONTEXT_WINDOW_RUNTIME_STATE_KEY];
69557
69593
  })();
@@ -90472,12 +90508,12 @@ function planOutboundMediaMessageUnits(params) {
90472
90508
  const log$3 = createSubsystemLogger("outbound/deliver");
90473
90509
  let transcriptRuntimePromise;
90474
90510
  async function loadTranscriptRuntime() {
90475
- transcriptRuntimePromise ??= import("./transcript.runtime-C6BHG-XW.js");
90511
+ transcriptRuntimePromise ??= import("./transcript.runtime-Bi3y3q3h.js");
90476
90512
  return await transcriptRuntimePromise;
90477
90513
  }
90478
90514
  let channelBootstrapRuntimePromise;
90479
90515
  async function loadChannelBootstrapRuntime() {
90480
- channelBootstrapRuntimePromise ??= import("./channel-bootstrap.runtime-B0t3vnup-Czzea06A.js");
90516
+ channelBootstrapRuntimePromise ??= import("./channel-bootstrap.runtime-B0t3vnup-OrZCNcwN.js");
90481
90517
  return await channelBootstrapRuntimePromise;
90482
90518
  }
90483
90519
  async function resolveChannelOutboundDirectiveOptions(params) {
@@ -93958,7 +93994,7 @@ function createLazyLoadErrorImages(model, error2) {
93958
93994
  };
93959
93995
  }
93960
93996
  function loadOpenRouterImagesProviderModule() {
93961
- openRouterImagesProviderModulePromise ||= import("./openrouter-DmigfOuL.js").then((module) => module);
93997
+ openRouterImagesProviderModulePromise ||= import("./openrouter-C6vD-ZCW.js").then((module) => module);
93962
93998
  return openRouterImagesProviderModulePromise;
93963
93999
  }
93964
94000
  const generateImagesOpenRouter = async (model, context, options2) => {
@@ -94501,7 +94537,7 @@ function createLazySimpleStream(loadModule2) {
94501
94537
  };
94502
94538
  }
94503
94539
  function loadAnthropicProviderModule() {
94504
- anthropicProviderModulePromise ||= import("./anthropic-DPIo8aZS.js").then((module) => {
94540
+ anthropicProviderModulePromise ||= import("./anthropic-iz9b7eTM.js").then((module) => {
94505
94541
  const provider = module;
94506
94542
  return {
94507
94543
  stream: provider.streamAnthropic,
@@ -94511,7 +94547,7 @@ function loadAnthropicProviderModule() {
94511
94547
  return anthropicProviderModulePromise;
94512
94548
  }
94513
94549
  function loadAzureOpenAIResponsesProviderModule() {
94514
- azureOpenAIResponsesProviderModulePromise ||= import("./azure-openai-responses-DD2qWGIN.js").then((module) => {
94550
+ azureOpenAIResponsesProviderModulePromise ||= import("./azure-openai-responses-BY4VCLhI.js").then((module) => {
94515
94551
  const provider = module;
94516
94552
  return {
94517
94553
  stream: provider.streamAzureOpenAIResponses,
@@ -94521,7 +94557,7 @@ function loadAzureOpenAIResponsesProviderModule() {
94521
94557
  return azureOpenAIResponsesProviderModulePromise;
94522
94558
  }
94523
94559
  function loadGoogleProviderModule() {
94524
- googleProviderModulePromise ||= import("./google-CO2HXSN_.js").then((module) => {
94560
+ googleProviderModulePromise ||= import("./google-BJ705Vhr.js").then((module) => {
94525
94561
  const provider = module;
94526
94562
  return {
94527
94563
  stream: provider.streamGoogle,
@@ -94531,7 +94567,7 @@ function loadGoogleProviderModule() {
94531
94567
  return googleProviderModulePromise;
94532
94568
  }
94533
94569
  function loadGoogleVertexProviderModule() {
94534
- googleVertexProviderModulePromise ||= import("./google-vertex-BD9-XVFI.js").then((module) => {
94570
+ googleVertexProviderModulePromise ||= import("./google-vertex-DdruQhTJ.js").then((module) => {
94535
94571
  const provider = module;
94536
94572
  return {
94537
94573
  stream: provider.streamGoogleVertex,
@@ -94541,7 +94577,7 @@ function loadGoogleVertexProviderModule() {
94541
94577
  return googleVertexProviderModulePromise;
94542
94578
  }
94543
94579
  function loadMistralProviderModule() {
94544
- mistralProviderModulePromise ||= import("./mistral-BIsV4aGY.js").then((module) => {
94580
+ mistralProviderModulePromise ||= import("./mistral-CB_7K2QD.js").then((module) => {
94545
94581
  const provider = module;
94546
94582
  return {
94547
94583
  stream: provider.streamMistral,
@@ -94551,7 +94587,7 @@ function loadMistralProviderModule() {
94551
94587
  return mistralProviderModulePromise;
94552
94588
  }
94553
94589
  function loadOpenAICodexResponsesProviderModule() {
94554
- openAICodexResponsesProviderModulePromise ||= import("./openai-codex-responses-C6Z_AwQQ.js").then((module) => {
94590
+ openAICodexResponsesProviderModulePromise ||= import("./openai-codex-responses-bQDvwjaM.js").then((module) => {
94555
94591
  const provider = module;
94556
94592
  return {
94557
94593
  stream: provider.streamOpenAICodexResponses,
@@ -94561,7 +94597,7 @@ function loadOpenAICodexResponsesProviderModule() {
94561
94597
  return openAICodexResponsesProviderModulePromise;
94562
94598
  }
94563
94599
  function loadOpenAICompletionsProviderModule() {
94564
- openAICompletionsProviderModulePromise ||= import("./openai-completions-DZosJ4E4.js").then((module) => {
94600
+ openAICompletionsProviderModulePromise ||= import("./openai-completions-B6nYcarp.js").then((module) => {
94565
94601
  const provider = module;
94566
94602
  return {
94567
94603
  stream: provider.streamOpenAICompletions,
@@ -94571,7 +94607,7 @@ function loadOpenAICompletionsProviderModule() {
94571
94607
  return openAICompletionsProviderModulePromise;
94572
94608
  }
94573
94609
  function loadOpenAIResponsesProviderModule() {
94574
- openAIResponsesProviderModulePromise ||= import("./openai-responses-S_jH9SLK.js").then((module) => {
94610
+ openAIResponsesProviderModulePromise ||= import("./openai-responses-BSzLx4jt.js").then((module) => {
94575
94611
  const provider = module;
94576
94612
  return {
94577
94613
  stream: provider.streamOpenAIResponses,
@@ -172374,7 +172410,7 @@ See https://babeljs.io/docs/configuration#print-effective-configs for more info.
172374
172410
  s5.names.push(i4);
172375
172411
  });
172376
172412
  }), o3;
172377
- }(e4, r3, s3), o2 = /* @__PURE__ */ new Map(), a2 = /* @__PURE__ */ new Map(), getData2 = (t5, r4) => {
172413
+ }(e4, r3, s3), o2 = /* @__PURE__ */ new Map(), a2 = /* @__PURE__ */ new Map(), getData = (t5, r4) => {
172378
172414
  const s4 = t5.value;
172379
172415
  let i3 = a2.get(s4);
172380
172416
  return i3 ? o2.get(s4).push(r4) : (i3 = { name: e4.scope.generateUidIdentifier((0, n7.basename)(s4, (0, n7.extname)(s4))).name, interop: "none", loc: null, imports: /* @__PURE__ */ new Map(), importsNamespace: /* @__PURE__ */ new Set(), reexports: /* @__PURE__ */ new Map(), reexportNamespace: /* @__PURE__ */ new Set(), reexportAll: null, wrap: null, get lazy() {
@@ -172384,7 +172420,7 @@ See https://babeljs.io/docs/configuration#print-effective-configs for more info.
172384
172420
  let l2 = false;
172385
172421
  e4.get("body").forEach((e5) => {
172386
172422
  if (e5.isImportDeclaration()) {
172387
- const t5 = getData2(e5.node.source, e5.node);
172423
+ const t5 = getData(e5.node.source, e5.node);
172388
172424
  t5.loc || (t5.loc = e5.node.loc), e5.get("specifiers").forEach((e6) => {
172389
172425
  if (e6.isImportDefaultSpecifier()) {
172390
172426
  const r4 = e6.get("local").node.name;
@@ -172411,11 +172447,11 @@ See https://babeljs.io/docs/configuration#print-effective-configs for more info.
172411
172447
  });
172412
172448
  } else if (e5.isExportAllDeclaration()) {
172413
172449
  l2 = true;
172414
- const t5 = getData2(e5.node.source, e5.node);
172450
+ const t5 = getData(e5.node.source, e5.node);
172415
172451
  t5.loc || (t5.loc = e5.node.loc), t5.reexportAll = { loc: e5.node.loc }, t5.referenced = true;
172416
172452
  } else if (e5.isExportNamedDeclaration() && e5.node.source) {
172417
172453
  l2 = true;
172418
- const t5 = getData2(e5.node.source, e5.node);
172454
+ const t5 = getData(e5.node.source, e5.node);
172419
172455
  t5.loc || (t5.loc = e5.node.loc), e5.get("specifiers").forEach((e6) => {
172420
172456
  assertExportSpecifier(e6);
172421
172457
  const r4 = getExportSpecifierName(e6.get("local"), s3), n8 = getExportSpecifierName(e6.get("exported"), s3);
@@ -196859,7 +196895,7 @@ async function loadPhoton() {
196859
196895
  loadPromise = (async () => {
196860
196896
  const restoreReadFileSync = patchPhotonWasmRead();
196861
196897
  try {
196862
- photonModule = await import("./photon_rs-r_qXiR7O.js").then((n7) => n7.p);
196898
+ photonModule = await import("./photon_rs-DLMtqH7u.js").then((n7) => n7.p);
196863
196899
  return photonModule;
196864
196900
  } catch {
196865
196901
  photonModule = null;