@workclaw/openclaw-workclaw 1.0.343 → 1.0.346

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 (40) hide show
  1. package/dist/{anthropic-C1jzp_Rc.js → anthropic-Sa15w5z4.js} +1 -1
  2. package/dist/api.js +1 -1
  3. package/dist/{azure-openai-responses-zym2wxMB.js → azure-openai-responses-CPtWbf1C.js} +2 -2
  4. package/dist/{channel-CWeiUgV5.js → channel-DAmPopBf.js} +886 -848
  5. package/dist/{channel-bootstrap.runtime-B0t3vnup-S_ZINco5.js → channel-bootstrap.runtime-B0t3vnup-BAOsCuTr.js} +1 -1
  6. package/dist/channel-entry-api.js +1 -1
  7. package/dist/channel-plugin-api.js +1 -1
  8. package/dist/{cleanup-i9QIMqva-DceifGSO.js → cleanup-i9QIMqva-6zIggooW.js} +1 -1
  9. package/dist/{config-QB0JLJHX.js → config-BYmtGm8e.js} +1 -1
  10. package/dist/{google-DqQHu2NY.js → google-BnRHrBN8.js} +2 -2
  11. package/dist/{google-shared-BeRWP6yE.js → google-shared-CAR6IShv.js} +1 -1
  12. package/dist/{google-vertex-Cs1hEe_j.js → google-vertex-Hiq4fZCi.js} +2 -2
  13. package/dist/{host-hook-cleanup-BNlJQu7G-NNZIzDgg.js → host-hook-cleanup-BNlJQu7G-BwHWtmzK.js} +1 -1
  14. package/dist/{index-mQv9vOMk.js → index-BPHxMrth.js} +1 -1
  15. package/dist/{index-DvlDhBhd.js → index-DUxxZDuE.js} +1 -1
  16. package/dist/{legacy-config-issues-Czu0_ffE-C-SKoHc6.js → legacy-config-issues-Czu0_ffE-YYGt7Dsf.js} +1 -1
  17. package/dist/{message-oTt1u1XX-NFsrpDss.js → message-oTt1u1XX-xhdlS1dt.js} +3 -3
  18. package/dist/message.config.runtime-BG74oiu7.js +4 -0
  19. package/dist/{message.gateway.runtime-BIIf6teh.js → message.gateway.runtime-DB5W21Jl.js} +1 -1
  20. package/dist/{mistral-B0v4IfAz.js → mistral-hhgCrfG_.js} +1 -1
  21. package/dist/{models-config.runtime-cY4XGOI0.js → models-config.runtime-BnpSlXPo.js} +1 -1
  22. package/dist/{openai-codex-responses-tC0hde6o.js → openai-codex-responses-CBorkFRy.js} +2 -2
  23. package/dist/{openai-completions-w3FtI3rd.js → openai-completions-Bd-A-Zxa.js} +1 -1
  24. package/dist/{openai-responses-rRjf4OAK.js → openai-responses-8Q6No8u_.js} +2 -2
  25. package/dist/{openai-responses-shared-ZlolmuqL.js → openai-responses-shared-C4up_jLa.js} +1 -1
  26. package/dist/{openrouter-CXWxTM8p.js → openrouter-CjDOFscf.js} +1 -1
  27. package/dist/{photon_rs-CGHeuAJ1.js → photon_rs-BsXu_h4Z.js} +1 -1
  28. package/dist/{plugins-C54ejDC8-qGQvFNWW.js → plugins-C54ejDC8-Cmv2tfRd.js} +2 -2
  29. package/dist/{provider-discovery.runtime-ZgcVwu5_.js → provider-discovery.runtime-D_JTH7-C.js} +1 -1
  30. package/dist/{session-archive.runtime-SvY1eJq4.js → session-archive.runtime-CDu25YlV.js} +1 -1
  31. package/dist/src/config-schema.d.ts +4 -0
  32. package/dist/src/config-schema.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-DEpdQ2rB.js +4 -0
  36. package/dist/{transcript.runtime-Dchg_w3u.js → transcript.runtime-BJj5V1X4.js} +1 -1
  37. package/openclaw.plugin.json +244 -236
  38. package/package.json +71 -71
  39. package/dist/message.config.runtime-DmvQNASl.js +0 -4
  40. package/dist/subsystem-W8wAQXn1-BIMucqMi.js +0 -4
@@ -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-DUxxZDuE.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-mQv9vOMk.js"));
21188
+ const fileTypeModuleLoader = createLazyImportLoader(() => import("./index-BPHxMrth.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-BIMucqMi.js").then(({ createSubsystemLogger: createSubsystemLogger2 }) => {
22380
+ import("./subsystem-W8wAQXn1-DEpdQ2rB.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
  }
@@ -22868,6 +22868,8 @@ const WorkclawConfigSchema = z.object({
22868
22868
  enabled: z.boolean().optional(),
22869
22869
  baseUrl: z.string().url().optional(),
22870
22870
  websocketUrl: z.string().url().optional(),
22871
+ connectionMode: z.string().optional(),
22872
+ wsConnectionStrategy: z.string().optional(),
22871
22873
  appKey: z.string().optional(),
22872
22874
  appSecret: z.string().optional(),
22873
22875
  agentId: z.union([z.string(), z.number()]).optional(),
@@ -26519,7 +26521,7 @@ function isRegistryLive(registry2) {
26519
26521
  return state$1.activeRegistry === registry2 || isRegistryPinned(registry2);
26520
26522
  }
26521
26523
  async function cleanupPreviousPluginHostRegistry(params) {
26522
- const [{ getRuntimeConfig: getRuntimeConfig2 }, { cleanupReplacedPluginHostRegistry }] = await Promise.all([import("./config-QB0JLJHX.js"), import("./host-hook-cleanup-BNlJQu7G-NNZIzDgg.js")]);
26524
+ const [{ getRuntimeConfig: getRuntimeConfig2 }, { cleanupReplacedPluginHostRegistry }] = await Promise.all([import("./config-BYmtGm8e.js"), import("./host-hook-cleanup-BNlJQu7G-BwHWtmzK.js")]);
26523
26525
  const nextRegistry = asPluginRegistry(state$1.activeRegistry);
26524
26526
  if (!nextRegistry || nextRegistry === params.previousRegistry) return;
26525
26527
  const shouldCleanup = () => state$1.activeRegistry !== params.previousRegistry;
@@ -39421,7 +39423,7 @@ async function finalizeReadConfigSnapshotInternalResult(deps, result2) {
39421
39423
  }
39422
39424
  async function collectInvalidConfigLegacyIssues(raw, sourceRaw) {
39423
39425
  if (!raw || typeof raw !== "object") return [];
39424
- const { findDoctorLegacyConfigIssues } = await import("./legacy-config-issues-Czu0_ffE-C-SKoHc6.js");
39426
+ const { findDoctorLegacyConfigIssues } = await import("./legacy-config-issues-Czu0_ffE-YYGt7Dsf.js");
39425
39427
  return findDoctorLegacyConfigIssues(raw, sourceRaw);
39426
39428
  }
39427
39429
  function createConfigIO(overrides2 = {}) {
@@ -42998,11 +43000,11 @@ const log$a = createSubsystemLogger("sessions/store");
42998
43000
  let sessionArchiveRuntimePromise = null;
42999
43001
  let trajectoryCleanupRuntimePromise = null;
43000
43002
  function loadSessionArchiveRuntime() {
43001
- sessionArchiveRuntimePromise ??= import("./session-archive.runtime-SvY1eJq4.js");
43003
+ sessionArchiveRuntimePromise ??= import("./session-archive.runtime-CDu25YlV.js");
43002
43004
  return sessionArchiveRuntimePromise;
43003
43005
  }
43004
43006
  function loadTrajectoryCleanupRuntime() {
43005
- trajectoryCleanupRuntimePromise ??= import("./cleanup-i9QIMqva-DceifGSO.js");
43007
+ trajectoryCleanupRuntimePromise ??= import("./cleanup-i9QIMqva-6zIggooW.js");
43006
43008
  return trajectoryCleanupRuntimePromise;
43007
43009
  }
43008
43010
  function updateSessionStoreWriteCaches(params) {
@@ -45387,12 +45389,12 @@ const attachmentProbeFs = { open: (...args) => fs$1$1.open(...args) };
45387
45389
  const MAX_ATTACHMENT_FILES = 10;
45388
45390
  let sendMessagePromise;
45389
45391
  async function loadSendMessage() {
45390
- sendMessagePromise ??= import("./message-oTt1u1XX-NFsrpDss.js").then((module) => module.sendMessage);
45392
+ sendMessagePromise ??= import("./message-oTt1u1XX-xhdlS1dt.js").then((module) => module.sendMessage);
45391
45393
  return sendMessagePromise;
45392
45394
  }
45393
45395
  let getChannelPluginPromise;
45394
45396
  async function loadGetChannelPlugin() {
45395
- getChannelPluginPromise ??= import("./plugins-C54ejDC8-qGQvFNWW.js").then((module) => module.getChannelPlugin);
45397
+ getChannelPluginPromise ??= import("./plugins-C54ejDC8-Cmv2tfRd.js").then((module) => module.getChannelPlugin);
45396
45398
  return getChannelPluginPromise;
45397
45399
  }
45398
45400
  function captionFormatToParseMode(captionFormat) {
@@ -54265,8 +54267,8 @@ var scope = {};
54265
54267
  var util$1 = {};
54266
54268
  Object.defineProperty(util$1, "__esModule", { value: true });
54267
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;
54268
- const codegen_1$v = codegen;
54269
- const code_1$a = code$1;
54270
+ const codegen_1$q = codegen;
54271
+ const code_1$9 = code$1;
54270
54272
  function toHash(arr) {
54271
54273
  const hash = {};
54272
54274
  for (const item of arr)
@@ -54319,9 +54321,9 @@ function schemaRefOrVal({ topSchemaRef, schemaPath }, schema2, keyword2, $data)
54319
54321
  if (typeof schema2 == "number" || typeof schema2 == "boolean")
54320
54322
  return schema2;
54321
54323
  if (typeof schema2 == "string")
54322
- return (0, codegen_1$v._)`${schema2}`;
54324
+ return (0, codegen_1$q._)`${schema2}`;
54323
54325
  }
54324
- 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)}`;
54325
54327
  }
54326
54328
  util$1.schemaRefOrVal = schemaRefOrVal;
54327
54329
  function unescapeFragment(str2) {
@@ -54353,20 +54355,20 @@ function eachItem(xs2, f) {
54353
54355
  util$1.eachItem = eachItem;
54354
54356
  function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues: mergeValues2, resultToName }) {
54355
54357
  return (gen, from, to, toName) => {
54356
- 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);
54357
- 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;
54358
54360
  };
54359
54361
  }
54360
54362
  util$1.mergeEvaluated = {
54361
54363
  props: makeMergeEvaluated({
54362
- mergeNames: (gen, from, to) => gen.if((0, codegen_1$v._)`${to} !== true && ${from} !== undefined`, () => {
54363
- 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})`));
54364
54366
  }),
54365
- 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`, () => {
54366
54368
  if (from === true) {
54367
54369
  gen.assign(to, true);
54368
54370
  } else {
54369
- gen.assign(to, (0, codegen_1$v._)`${to} || {}`);
54371
+ gen.assign(to, (0, codegen_1$q._)`${to} || {}`);
54370
54372
  setEvaluated(gen, to, from);
54371
54373
  }
54372
54374
  }),
@@ -54374,8 +54376,8 @@ util$1.mergeEvaluated = {
54374
54376
  resultToName: evaluatedPropsToName
54375
54377
  }),
54376
54378
  items: makeMergeEvaluated({
54377
- 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}`)),
54378
- 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}`)),
54379
54381
  mergeValues: (from, to) => from === true ? true : Math.max(from, to),
54380
54382
  resultToName: (gen, items2) => gen.var("items", items2)
54381
54383
  })
@@ -54383,21 +54385,21 @@ util$1.mergeEvaluated = {
54383
54385
  function evaluatedPropsToName(gen, ps2) {
54384
54386
  if (ps2 === true)
54385
54387
  return gen.var("props", true);
54386
- const props = gen.var("props", (0, codegen_1$v._)`{}`);
54388
+ const props = gen.var("props", (0, codegen_1$q._)`{}`);
54387
54389
  if (ps2 !== void 0)
54388
54390
  setEvaluated(gen, props, ps2);
54389
54391
  return props;
54390
54392
  }
54391
54393
  util$1.evaluatedPropsToName = evaluatedPropsToName;
54392
54394
  function setEvaluated(gen, props, ps2) {
54393
- 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));
54394
54396
  }
54395
54397
  util$1.setEvaluated = setEvaluated;
54396
54398
  const snippets = {};
54397
54399
  function useFunc(gen, f) {
54398
54400
  return gen.scopeValue("func", {
54399
54401
  ref: f,
54400
- 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))
54401
54403
  });
54402
54404
  }
54403
54405
  util$1.useFunc = useFunc;
@@ -54407,11 +54409,11 @@ var Type;
54407
54409
  Type2[Type2["Str"] = 1] = "Str";
54408
54410
  })(Type || (util$1.Type = Type = {}));
54409
54411
  function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
54410
- if (dataProp instanceof codegen_1$v.Name) {
54412
+ if (dataProp instanceof codegen_1$q.Name) {
54411
54413
  const isNumber2 = dataPropType === Type.Num;
54412
- 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")`;
54413
54415
  }
54414
- return jsPropertySyntax ? (0, codegen_1$v.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
54416
+ return jsPropertySyntax ? (0, codegen_1$q.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
54415
54417
  }
54416
54418
  util$1.getErrorPath = getErrorPath;
54417
54419
  function checkStrictMode(it2, msg, mode2 = it2.opts.strictSchema) {
@@ -54425,35 +54427,35 @@ function checkStrictMode(it2, msg, mode2 = it2.opts.strictSchema) {
54425
54427
  util$1.checkStrictMode = checkStrictMode;
54426
54428
  var names$1 = {};
54427
54429
  Object.defineProperty(names$1, "__esModule", { value: true });
54428
- const codegen_1$u = codegen;
54430
+ const codegen_1$p = codegen;
54429
54431
  const names = {
54430
54432
  // validation function arguments
54431
- data: new codegen_1$u.Name("data"),
54433
+ data: new codegen_1$p.Name("data"),
54432
54434
  // data passed to validation function
54433
54435
  // args passed from referencing schema
54434
- valCxt: new codegen_1$u.Name("valCxt"),
54436
+ valCxt: new codegen_1$p.Name("valCxt"),
54435
54437
  // validation/data context - should not be used directly, it is destructured to the names below
54436
- instancePath: new codegen_1$u.Name("instancePath"),
54437
- parentData: new codegen_1$u.Name("parentData"),
54438
- parentDataProperty: new codegen_1$u.Name("parentDataProperty"),
54439
- 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"),
54440
54442
  // root data - same as the data passed to the first/top validation function
54441
- dynamicAnchors: new codegen_1$u.Name("dynamicAnchors"),
54443
+ dynamicAnchors: new codegen_1$p.Name("dynamicAnchors"),
54442
54444
  // used to support recursiveRef and dynamicRef
54443
54445
  // function scoped variables
54444
- vErrors: new codegen_1$u.Name("vErrors"),
54446
+ vErrors: new codegen_1$p.Name("vErrors"),
54445
54447
  // null or array of validation errors
54446
- errors: new codegen_1$u.Name("errors"),
54448
+ errors: new codegen_1$p.Name("errors"),
54447
54449
  // counter of validation errors
54448
- this: new codegen_1$u.Name("this"),
54450
+ this: new codegen_1$p.Name("this"),
54449
54451
  // "globals"
54450
- self: new codegen_1$u.Name("self"),
54451
- scope: new codegen_1$u.Name("scope"),
54452
+ self: new codegen_1$p.Name("self"),
54453
+ scope: new codegen_1$p.Name("scope"),
54452
54454
  // JTD serialize/parse name for JSON string and position
54453
- json: new codegen_1$u.Name("json"),
54454
- jsonPos: new codegen_1$u.Name("jsonPos"),
54455
- jsonLen: new codegen_1$u.Name("jsonLen"),
54456
- 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")
54457
54459
  };
54458
54460
  names$1.default = names;
54459
54461
  (function(exports$1) {
@@ -54573,49 +54575,55 @@ names$1.default = names;
54573
54575
  keyValues.push([E.propertyName, propertyName]);
54574
54576
  }
54575
54577
  })(errors);
54576
- Object.defineProperty(boolSchema, "__esModule", { value: true });
54577
- boolSchema.boolOrEmptySchema = boolSchema.topBoolOrEmptySchema = void 0;
54578
- const errors_1$3 = errors;
54579
- const codegen_1$t = codegen;
54580
- const names_1$6 = names$1;
54581
- const boolError = {
54582
- message: "boolean schema is false"
54583
- };
54584
- function topBoolOrEmptySchema(it2) {
54585
- const { gen, schema: schema2, validateName: validateName2 } = it2;
54586
- if (schema2 === false) {
54587
- falseSchemaError(it2, false);
54588
- } else if (typeof schema2 == "object" && schema2.$async === true) {
54589
- gen.return(names_1$6.default.data);
54590
- } else {
54591
- gen.assign((0, codegen_1$t._)`${validateName2}.errors`, null);
54592
- 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
+ }
54593
54600
  }
54594
- }
54595
- boolSchema.topBoolOrEmptySchema = topBoolOrEmptySchema;
54596
- function boolOrEmptySchema(it2, valid) {
54597
- const { gen, schema: schema2 } = it2;
54598
- if (schema2 === false) {
54599
- gen.var(valid, false);
54600
- falseSchemaError(it2);
54601
- } else {
54602
- 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
+ }
54603
54610
  }
54604
- }
54605
- boolSchema.boolOrEmptySchema = boolOrEmptySchema;
54606
- function falseSchemaError(it2, overrideAllErrors) {
54607
- const { gen, data } = it2;
54608
- const cxt = {
54609
- gen,
54610
- keyword: "false schema",
54611
- data,
54612
- schema: false,
54613
- schemaCode: false,
54614
- schemaValue: false,
54615
- params: {},
54616
- it: it2
54617
- };
54618
- (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;
54619
54627
  }
54620
54628
  var dataType = {};
54621
54629
  var rules = {};
@@ -54663,10 +54671,10 @@ applicability.shouldUseRule = shouldUseRule;
54663
54671
  Object.defineProperty(dataType, "__esModule", { value: true });
54664
54672
  dataType.reportTypeError = dataType.checkDataTypes = dataType.checkDataType = dataType.coerceAndCheckDataType = dataType.getJSONTypes = dataType.getSchemaTypes = dataType.DataType = void 0;
54665
54673
  const rules_1 = rules;
54666
- const applicability_1$1 = applicability;
54667
- const errors_1$2 = errors;
54668
- const codegen_1$s = codegen;
54669
- 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;
54670
54678
  var DataType;
54671
54679
  (function(DataType2) {
54672
54680
  DataType2[DataType2["Correct"] = 0] = "Correct";
@@ -54698,7 +54706,7 @@ dataType.getJSONTypes = getJSONTypes;
54698
54706
  function coerceAndCheckDataType(it2, types2) {
54699
54707
  const { gen, data, opts } = it2;
54700
54708
  const coerceTo = coerceToTypes(types2, opts.coerceTypes);
54701
- 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]));
54702
54710
  if (checkTypes) {
54703
54711
  const wrongType = checkDataTypes(types2, data, opts.strictNumbers, DataType.Wrong);
54704
54712
  gen.if(wrongType, () => {
@@ -54717,12 +54725,12 @@ function coerceToTypes(types2, coerceTypes) {
54717
54725
  }
54718
54726
  function coerceData(it2, types2, coerceTo) {
54719
54727
  const { gen, data, opts } = it2;
54720
- const dataType2 = gen.let("dataType", (0, codegen_1$s._)`typeof ${data}`);
54721
- 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`);
54722
54730
  if (opts.coerceTypes === "array") {
54723
- 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)));
54724
54732
  }
54725
- gen.if((0, codegen_1$s._)`${coerced} !== undefined`);
54733
+ gen.if((0, codegen_1$o._)`${coerced} !== undefined`);
54726
54734
  for (const t of coerceTo) {
54727
54735
  if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") {
54728
54736
  coerceSpecificType(t);
@@ -54731,63 +54739,63 @@ function coerceData(it2, types2, coerceTo) {
54731
54739
  gen.else();
54732
54740
  reportTypeError(it2);
54733
54741
  gen.endIf();
54734
- gen.if((0, codegen_1$s._)`${coerced} !== undefined`, () => {
54742
+ gen.if((0, codegen_1$o._)`${coerced} !== undefined`, () => {
54735
54743
  gen.assign(data, coerced);
54736
54744
  assignParentData(it2, coerced);
54737
54745
  });
54738
54746
  function coerceSpecificType(t) {
54739
54747
  switch (t) {
54740
54748
  case "string":
54741
- 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._)`""`);
54742
54750
  return;
54743
54751
  case "number":
54744
- gen.elseIf((0, codegen_1$s._)`${dataType2} == "boolean" || ${data} === null
54745
- || (${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}`);
54746
54754
  return;
54747
54755
  case "integer":
54748
- gen.elseIf((0, codegen_1$s._)`${dataType2} === "boolean" || ${data} === null
54749
- || (${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}`);
54750
54758
  return;
54751
54759
  case "boolean":
54752
- 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);
54753
54761
  return;
54754
54762
  case "null":
54755
- gen.elseIf((0, codegen_1$s._)`${data} === "" || ${data} === 0 || ${data} === false`);
54763
+ gen.elseIf((0, codegen_1$o._)`${data} === "" || ${data} === 0 || ${data} === false`);
54756
54764
  gen.assign(coerced, null);
54757
54765
  return;
54758
54766
  case "array":
54759
- gen.elseIf((0, codegen_1$s._)`${dataType2} === "string" || ${dataType2} === "number"
54760
- || ${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}]`);
54761
54769
  }
54762
54770
  }
54763
54771
  }
54764
54772
  function assignParentData({ gen, parentData, parentDataProperty }, expr) {
54765
- 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));
54766
54774
  }
54767
54775
  function checkDataType(dataType2, data, strictNums, correct = DataType.Correct) {
54768
- 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;
54769
54777
  let cond;
54770
54778
  switch (dataType2) {
54771
54779
  case "null":
54772
- return (0, codegen_1$s._)`${data} ${EQ} null`;
54780
+ return (0, codegen_1$o._)`${data} ${EQ} null`;
54773
54781
  case "array":
54774
- cond = (0, codegen_1$s._)`Array.isArray(${data})`;
54782
+ cond = (0, codegen_1$o._)`Array.isArray(${data})`;
54775
54783
  break;
54776
54784
  case "object":
54777
- 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})`;
54778
54786
  break;
54779
54787
  case "integer":
54780
- cond = numCond((0, codegen_1$s._)`!(${data} % 1) && !isNaN(${data})`);
54788
+ cond = numCond((0, codegen_1$o._)`!(${data} % 1) && !isNaN(${data})`);
54781
54789
  break;
54782
54790
  case "number":
54783
54791
  cond = numCond();
54784
54792
  break;
54785
54793
  default:
54786
- return (0, codegen_1$s._)`typeof ${data} ${EQ} ${dataType2}`;
54794
+ return (0, codegen_1$o._)`typeof ${data} ${EQ} ${dataType2}`;
54787
54795
  }
54788
- return correct === DataType.Correct ? cond : (0, codegen_1$s.not)(cond);
54789
- function numCond(_cond = codegen_1$s.nil) {
54790
- 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);
54791
54799
  }
54792
54800
  }
54793
54801
  dataType.checkDataType = checkDataType;
@@ -54796,35 +54804,35 @@ function checkDataTypes(dataTypes, data, strictNums, correct) {
54796
54804
  return checkDataType(dataTypes[0], data, strictNums, correct);
54797
54805
  }
54798
54806
  let cond;
54799
- const types2 = (0, util_1$r.toHash)(dataTypes);
54807
+ const types2 = (0, util_1$o.toHash)(dataTypes);
54800
54808
  if (types2.array && types2.object) {
54801
- const notObj = (0, codegen_1$s._)`typeof ${data} != "object"`;
54802
- 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}`;
54803
54811
  delete types2.null;
54804
54812
  delete types2.array;
54805
54813
  delete types2.object;
54806
54814
  } else {
54807
- cond = codegen_1$s.nil;
54815
+ cond = codegen_1$o.nil;
54808
54816
  }
54809
54817
  if (types2.number)
54810
54818
  delete types2.integer;
54811
54819
  for (const t in types2)
54812
- 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));
54813
54821
  return cond;
54814
54822
  }
54815
54823
  dataType.checkDataTypes = checkDataTypes;
54816
54824
  const typeError = {
54817
54825
  message: ({ schema: schema2 }) => `must be ${schema2}`,
54818
- 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}}`
54819
54827
  };
54820
54828
  function reportTypeError(it2) {
54821
54829
  const cxt = getTypeErrorContext(it2);
54822
- (0, errors_1$2.reportError)(cxt, typeError);
54830
+ (0, errors_1.reportError)(cxt, typeError);
54823
54831
  }
54824
54832
  dataType.reportTypeError = reportTypeError;
54825
54833
  function getTypeErrorContext(it2) {
54826
54834
  const { gen, data, schema: schema2 } = it2;
54827
- const schemaCode = (0, util_1$r.schemaRefOrVal)(it2, schema2, "type");
54835
+ const schemaCode = (0, util_1$o.schemaRefOrVal)(it2, schema2, "type");
54828
54836
  return {
54829
54837
  gen,
54830
54838
  keyword: "type",
@@ -54838,54 +54846,60 @@ function getTypeErrorContext(it2) {
54838
54846
  };
54839
54847
  }
54840
54848
  var defaults$4 = {};
54841
- Object.defineProperty(defaults$4, "__esModule", { value: true });
54842
- defaults$4.assignDefaults = void 0;
54843
- const codegen_1$r = codegen;
54844
- const util_1$q = util$1;
54845
- function assignDefaults(it2, ty) {
54846
- const { properties: properties2, items: items2 } = it2.schema;
54847
- if (ty === "object" && properties2) {
54848
- for (const key2 in properties2) {
54849
- assignDefault(it2, key2, properties2[key2].default);
54850
- }
54851
- } else if (ty === "array" && Array.isArray(items2)) {
54852
- items2.forEach((sch, i) => assignDefault(it2, i, sch.default));
54853
- }
54854
- }
54855
- defaults$4.assignDefaults = assignDefaults;
54856
- function assignDefault(it2, prop, defaultValue) {
54857
- const { gen, compositeRule, data, opts } = it2;
54858
- if (defaultValue === void 0)
54859
- return;
54860
- const childData = (0, codegen_1$r._)`${data}${(0, codegen_1$r.getProperty)(prop)}`;
54861
- if (compositeRule) {
54862
- (0, util_1$q.checkStrictMode)(it2, `default is ignored for: ${childData}`);
54863
- 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
+ }
54864
54866
  }
54865
- let condition = (0, codegen_1$r._)`${childData} === undefined`;
54866
- if (opts.useDefaults === "empty") {
54867
- 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)}`);
54868
54882
  }
54869
- gen.if(condition, (0, codegen_1$r._)`${childData} = ${(0, codegen_1$r.stringify)(defaultValue)}`);
54883
+ return defaults$4;
54870
54884
  }
54871
54885
  var keyword = {};
54872
54886
  var code = {};
54873
54887
  Object.defineProperty(code, "__esModule", { value: true });
54874
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;
54875
- const codegen_1$q = codegen;
54876
- const util_1$p = util$1;
54877
- 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;
54878
54892
  const util_2$1 = util$1;
54879
54893
  function checkReportMissingProp(cxt, prop) {
54880
54894
  const { gen, data, it: it2 } = cxt;
54881
54895
  gen.if(noPropertyInData(gen, data, prop, it2.opts.ownProperties), () => {
54882
- cxt.setParams({ missingProperty: (0, codegen_1$q._)`${prop}` }, true);
54896
+ cxt.setParams({ missingProperty: (0, codegen_1$n._)`${prop}` }, true);
54883
54897
  cxt.error();
54884
54898
  });
54885
54899
  }
54886
54900
  code.checkReportMissingProp = checkReportMissingProp;
54887
54901
  function checkMissingProp({ gen, data, it: { opts } }, properties2, missing) {
54888
- 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}`)));
54889
54903
  }
54890
54904
  code.checkMissingProp = checkMissingProp;
54891
54905
  function reportMissingProp(cxt, missing) {
@@ -54897,22 +54911,22 @@ function hasPropFunc(gen) {
54897
54911
  return gen.scopeValue("func", {
54898
54912
  // eslint-disable-next-line @typescript-eslint/unbound-method
54899
54913
  ref: Object.prototype.hasOwnProperty,
54900
- code: (0, codegen_1$q._)`Object.prototype.hasOwnProperty`
54914
+ code: (0, codegen_1$n._)`Object.prototype.hasOwnProperty`
54901
54915
  });
54902
54916
  }
54903
54917
  code.hasPropFunc = hasPropFunc;
54904
54918
  function isOwnProperty(gen, data, property) {
54905
- return (0, codegen_1$q._)`${hasPropFunc(gen)}.call(${data}, ${property})`;
54919
+ return (0, codegen_1$n._)`${hasPropFunc(gen)}.call(${data}, ${property})`;
54906
54920
  }
54907
54921
  code.isOwnProperty = isOwnProperty;
54908
54922
  function propertyInData(gen, data, property, ownProperties) {
54909
- const cond = (0, codegen_1$q._)`${data}${(0, codegen_1$q.getProperty)(property)} !== undefined`;
54910
- 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;
54911
54925
  }
54912
54926
  code.propertyInData = propertyInData;
54913
54927
  function noPropertyInData(gen, data, property, ownProperties) {
54914
- const cond = (0, codegen_1$q._)`${data}${(0, codegen_1$q.getProperty)(property)} === undefined`;
54915
- 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;
54916
54930
  }
54917
54931
  code.noPropertyInData = noPropertyInData;
54918
54932
  function allSchemaProperties(schemaMap) {
@@ -54920,24 +54934,24 @@ function allSchemaProperties(schemaMap) {
54920
54934
  }
54921
54935
  code.allSchemaProperties = allSchemaProperties;
54922
54936
  function schemaProperties(it2, schemaMap) {
54923
- 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]));
54924
54938
  }
54925
54939
  code.schemaProperties = schemaProperties;
54926
54940
  function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it: it2 }, func, context, passSchema) {
54927
- 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;
54928
54942
  const valCxt = [
54929
- [names_1$5.default.instancePath, (0, codegen_1$q.strConcat)(names_1$5.default.instancePath, errorPath)],
54930
- [names_1$5.default.parentData, it2.parentData],
54931
- [names_1$5.default.parentDataProperty, it2.parentDataProperty],
54932
- [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]
54933
54947
  ];
54934
54948
  if (it2.opts.dynamicRef)
54935
- valCxt.push([names_1$5.default.dynamicAnchors, names_1$5.default.dynamicAnchors]);
54936
- const args = (0, codegen_1$q._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
54937
- 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})`;
54938
54952
  }
54939
54953
  code.callValidateCode = callValidateCode;
54940
- const newRegExp = (0, codegen_1$q._)`new RegExp`;
54954
+ const newRegExp = (0, codegen_1$n._)`new RegExp`;
54941
54955
  function usePattern({ gen, it: { opts } }, pattern2) {
54942
54956
  const u = opts.unicodeRegExp ? "u" : "";
54943
54957
  const { regExp } = opts.code;
@@ -54945,7 +54959,7 @@ function usePattern({ gen, it: { opts } }, pattern2) {
54945
54959
  return gen.scopeValue("pattern", {
54946
54960
  key: rx.toString(),
54947
54961
  ref: rx,
54948
- 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})`
54949
54963
  });
54950
54964
  }
54951
54965
  code.usePattern = usePattern;
@@ -54961,14 +54975,14 @@ function validateArray(cxt) {
54961
54975
  validateItems(() => gen.break());
54962
54976
  return valid;
54963
54977
  function validateItems(notValid) {
54964
- const len = gen.const("len", (0, codegen_1$q._)`${data}.length`);
54978
+ const len = gen.const("len", (0, codegen_1$n._)`${data}.length`);
54965
54979
  gen.forRange("i", 0, len, (i) => {
54966
54980
  cxt.subschema({
54967
54981
  keyword: keyword2,
54968
54982
  dataProp: i,
54969
- dataPropType: util_1$p.Type.Num
54983
+ dataPropType: util_1$n.Type.Num
54970
54984
  }, valid);
54971
- gen.if((0, codegen_1$q.not)(valid), notValid);
54985
+ gen.if((0, codegen_1$n.not)(valid), notValid);
54972
54986
  });
54973
54987
  }
54974
54988
  }
@@ -54977,7 +54991,7 @@ function validateUnion(cxt) {
54977
54991
  const { gen, schema: schema2, keyword: keyword2, it: it2 } = cxt;
54978
54992
  if (!Array.isArray(schema2))
54979
54993
  throw new Error("ajv implementation error");
54980
- 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));
54981
54995
  if (alwaysValid && !it2.opts.unevaluated)
54982
54996
  return;
54983
54997
  const valid = gen.let("valid", false);
@@ -54988,202 +55002,214 @@ function validateUnion(cxt) {
54988
55002
  schemaProp: i,
54989
55003
  compositeRule: true
54990
55004
  }, schValid);
54991
- gen.assign(valid, (0, codegen_1$q._)`${valid} || ${schValid}`);
55005
+ gen.assign(valid, (0, codegen_1$n._)`${valid} || ${schValid}`);
54992
55006
  const merged = cxt.mergeValidEvaluated(schCxt, schValid);
54993
55007
  if (!merged)
54994
- gen.if((0, codegen_1$q.not)(valid));
55008
+ gen.if((0, codegen_1$n.not)(valid));
54995
55009
  }));
54996
55010
  cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
54997
55011
  }
54998
55012
  code.validateUnion = validateUnion;
54999
- Object.defineProperty(keyword, "__esModule", { value: true });
55000
- keyword.validateKeywordUsage = keyword.validSchemaType = keyword.funcKeywordCode = keyword.macroKeywordCode = void 0;
55001
- const codegen_1$p = codegen;
55002
- const names_1$4 = names$1;
55003
- const code_1$9 = code;
55004
- const errors_1$1 = errors;
55005
- function macroKeywordCode(cxt, def2) {
55006
- const { gen, keyword: keyword2, schema: schema2, parentSchema, it: it2 } = cxt;
55007
- const macroSchema = def2.macro.call(it2.self, schema2, parentSchema, it2);
55008
- const schemaRef = useKeyword(gen, keyword2, macroSchema);
55009
- if (it2.opts.validateSchema !== false)
55010
- it2.self.validateSchema(macroSchema, true);
55011
- const valid = gen.name("valid");
55012
- cxt.subschema({
55013
- schema: macroSchema,
55014
- schemaPath: codegen_1$p.nil,
55015
- errSchemaPath: `${it2.errSchemaPath}/${keyword2}`,
55016
- topSchemaRef: schemaRef,
55017
- compositeRule: true
55018
- }, valid);
55019
- cxt.pass(valid, () => cxt.error(true));
55020
- }
55021
- keyword.macroKeywordCode = macroKeywordCode;
55022
- function funcKeywordCode(cxt, def2) {
55023
- var _a2;
55024
- const { gen, keyword: keyword2, schema: schema2, parentSchema, $data, it: it2 } = cxt;
55025
- checkAsyncKeyword(it2, def2);
55026
- const validate2 = !$data && def2.compile ? def2.compile.call(it2.self, schema2, parentSchema, it2) : def2.validate;
55027
- const validateRef = useKeyword(gen, keyword2, validate2);
55028
- const valid = gen.let("valid");
55029
- cxt.block$data(valid, validateKeyword);
55030
- cxt.ok((_a2 = def2.valid) !== null && _a2 !== void 0 ? _a2 : valid);
55031
- function validateKeyword() {
55032
- if (def2.errors === false) {
55033
- assignValid();
55034
- if (def2.modifying)
55035
- modifyData(cxt);
55036
- reportErrs(() => cxt.error());
55037
- } else {
55038
- const ruleErrs = def2.async ? validateAsync() : validateSync();
55039
- if (def2.modifying)
55040
- modifyData(cxt);
55041
- reportErrs(() => addErrs(cxt, ruleErrs));
55042
- }
55043
- }
55044
- function validateAsync() {
55045
- const ruleErrs = gen.let("ruleErrs", null);
55046
- 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)));
55047
- return ruleErrs;
55048
- }
55049
- function validateSync() {
55050
- const validateErrs = (0, codegen_1$p._)`${validateRef}.errors`;
55051
- gen.assign(validateErrs, null);
55052
- assignValid(codegen_1$p.nil);
55053
- return validateErrs;
55054
- }
55055
- function assignValid(_await = def2.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
55056
- const passCxt = it2.opts.passContext ? names_1$4.default.this : names_1$4.default.self;
55057
- const passSchema = !("compile" in def2 && !$data || def2.schema === false);
55058
- gen.assign(valid, (0, codegen_1$p._)`${_await}${(0, code_1$9.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def2.modifying);
55059
- }
55060
- function reportErrs(errors2) {
55061
- var _a3;
55062
- gen.if((0, codegen_1$p.not)((_a3 = def2.valid) !== null && _a3 !== void 0 ? _a3 : valid), errors2);
55063
- }
55064
- }
55065
- keyword.funcKeywordCode = funcKeywordCode;
55066
- function modifyData(cxt) {
55067
- const { gen, data, it: it2 } = cxt;
55068
- gen.if(it2.parentData, () => gen.assign(data, (0, codegen_1$p._)`${it2.parentData}[${it2.parentDataProperty}]`));
55069
- }
55070
- function addErrs(cxt, errs) {
55071
- const { gen } = cxt;
55072
- gen.if((0, codegen_1$p._)`Array.isArray(${errs})`, () => {
55073
- 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`);
55074
- (0, errors_1$1.extendErrors)(cxt);
55075
- }, () => cxt.error());
55076
- }
55077
- function checkAsyncKeyword({ schemaEnv }, def2) {
55078
- if (def2.async && !schemaEnv.$async)
55079
- throw new Error("async keyword in sync schema");
55080
- }
55081
- function useKeyword(gen, keyword2, result2) {
55082
- if (result2 === void 0)
55083
- throw new Error(`keyword "${keyword2}" failed to compile`);
55084
- return gen.scopeValue("keyword", typeof result2 == "function" ? { ref: result2 } : { ref: result2, code: (0, codegen_1$p.stringify)(result2) });
55085
- }
55086
- function validSchemaType(schema2, schemaType, allowUndefined = false) {
55087
- 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");
55088
- }
55089
- keyword.validSchemaType = validSchemaType;
55090
- function validateKeywordUsage({ schema: schema2, opts, self: self2, errSchemaPath }, def2, keyword2) {
55091
- if (Array.isArray(def2.keyword) ? !def2.keyword.includes(keyword2) : def2.keyword !== keyword2) {
55092
- 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));
55093
55038
  }
55094
- const deps = def2.dependencies;
55095
- if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema2, kwd))) {
55096
- 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
+ }
55097
55082
  }
55098
- if (def2.validateSchema) {
55099
- const valid = def2.validateSchema(schema2[keyword2]);
55100
- if (!valid) {
55101
- const msg = `keyword "${keyword2}" value is invalid at path "${errSchemaPath}": ` + self2.errorsText(def2.validateSchema.errors);
55102
- if (opts.validateSchema === "log")
55103
- self2.logger.error(msg);
55104
- else
55105
- 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
+ }
55106
55125
  }
55107
55126
  }
55127
+ keyword.validateKeywordUsage = validateKeywordUsage;
55128
+ return keyword;
55108
55129
  }
55109
- keyword.validateKeywordUsage = validateKeywordUsage;
55110
55130
  var subschema = {};
55111
- Object.defineProperty(subschema, "__esModule", { value: true });
55112
- subschema.extendSubschemaMode = subschema.extendSubschemaData = subschema.getSubschema = void 0;
55113
- const codegen_1$o = codegen;
55114
- const util_1$o = util$1;
55115
- function getSubschema(it2, { keyword: keyword2, schemaProp, schema: schema2, schemaPath, errSchemaPath, topSchemaRef }) {
55116
- if (keyword2 !== void 0 && schema2 !== void 0) {
55117
- throw new Error('both "keyword" and "schema" passed, only one allowed');
55118
- }
55119
- if (keyword2 !== void 0) {
55120
- const sch = it2.schema[keyword2];
55121
- return schemaProp === void 0 ? {
55122
- schema: sch,
55123
- schemaPath: (0, codegen_1$o._)`${it2.schemaPath}${(0, codegen_1$o.getProperty)(keyword2)}`,
55124
- errSchemaPath: `${it2.errSchemaPath}/${keyword2}`
55125
- } : {
55126
- schema: sch[schemaProp],
55127
- schemaPath: (0, codegen_1$o._)`${it2.schemaPath}${(0, codegen_1$o.getProperty)(keyword2)}${(0, codegen_1$o.getProperty)(schemaProp)}`,
55128
- errSchemaPath: `${it2.errSchemaPath}/${keyword2}/${(0, util_1$o.escapeFragment)(schemaProp)}`
55129
- };
55130
- }
55131
- if (schema2 !== void 0) {
55132
- if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) {
55133
- 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');
55134
55142
  }
55135
- return {
55136
- schema: schema2,
55137
- schemaPath,
55138
- topSchemaRef,
55139
- errSchemaPath
55140
- };
55141
- }
55142
- throw new Error('either "keyword" or "schema" must be passed');
55143
- }
55144
- subschema.getSubschema = getSubschema;
55145
- function extendSubschemaData(subschema2, it2, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
55146
- if (data !== void 0 && dataProp !== void 0) {
55147
- throw new Error('both "data" and "dataProp" passed, only one allowed');
55148
- }
55149
- const { gen } = it2;
55150
- if (dataProp !== void 0) {
55151
- const { errorPath, dataPathArr, opts } = it2;
55152
- const nextData = gen.let("data", (0, codegen_1$o._)`${it2.data}${(0, codegen_1$o.getProperty)(dataProp)}`, true);
55153
- dataContextProps(nextData);
55154
- subschema2.errorPath = (0, codegen_1$o.str)`${errorPath}${(0, util_1$o.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;
55155
- subschema2.parentDataProperty = (0, codegen_1$o._)`${dataProp}`;
55156
- subschema2.dataPathArr = [...dataPathArr, subschema2.parentDataProperty];
55157
- }
55158
- if (data !== void 0) {
55159
- const nextData = data instanceof codegen_1$o.Name ? data : gen.let("data", data, true);
55160
- dataContextProps(nextData);
55161
- if (propertyName !== void 0)
55162
- subschema2.propertyName = propertyName;
55163
- }
55164
- if (dataTypes)
55165
- subschema2.dataTypes = dataTypes;
55166
- function dataContextProps(_nextData) {
55167
- subschema2.data = _nextData;
55168
- subschema2.dataLevel = it2.dataLevel + 1;
55169
- subschema2.dataTypes = [];
55170
- it2.definedProperties = /* @__PURE__ */ new Set();
55171
- subschema2.parentData = it2.data;
55172
- subschema2.dataNames = [...it2.dataNames, _nextData];
55173
- }
55174
- }
55175
- subschema.extendSubschemaData = extendSubschemaData;
55176
- function extendSubschemaMode(subschema2, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
55177
- if (compositeRule !== void 0)
55178
- subschema2.compositeRule = compositeRule;
55179
- if (createErrors !== void 0)
55180
- subschema2.createErrors = createErrors;
55181
- if (allErrors !== void 0)
55182
- subschema2.allErrors = allErrors;
55183
- subschema2.jtdDiscriminator = jtdDiscriminator;
55184
- subschema2.jtdMetadata = jtdMetadata;
55185
- }
55186
- 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
+ }
55187
55213
  var resolve$2 = {};
55188
55214
  var fastDeepEqual = function equal(a, b2) {
55189
55215
  if (a === b2) return true;
@@ -55298,7 +55324,7 @@ function escapeJsonPtr(str2) {
55298
55324
  var jsonSchemaTraverseExports = jsonSchemaTraverse.exports;
55299
55325
  Object.defineProperty(resolve$2, "__esModule", { value: true });
55300
55326
  resolve$2.getSchemaRefs = resolve$2.resolveUrl = resolve$2.normalizeId = resolve$2._getFullPath = resolve$2.getFullPath = resolve$2.inlineRef = void 0;
55301
- const util_1$n = util$1;
55327
+ const util_1$m = util$1;
55302
55328
  const equal$3 = fastDeepEqual;
55303
55329
  const traverse = jsonSchemaTraverseExports;
55304
55330
  const SIMPLE_INLINED = /* @__PURE__ */ new Set([
@@ -55357,7 +55383,7 @@ function countKeys(schema2) {
55357
55383
  if (SIMPLE_INLINED.has(key2))
55358
55384
  continue;
55359
55385
  if (typeof schema2[key2] == "object") {
55360
- (0, util_1$n.eachItem)(schema2[key2], (sch) => count += countKeys(sch));
55386
+ (0, util_1$m.eachItem)(schema2[key2], (sch) => count += countKeys(sch));
55361
55387
  }
55362
55388
  if (count === Infinity)
55363
55389
  return Infinity;
@@ -55445,516 +55471,528 @@ function getSchemaRefs(schema2, baseId) {
55445
55471
  }
55446
55472
  }
55447
55473
  resolve$2.getSchemaRefs = getSchemaRefs;
55448
- Object.defineProperty(validate$1, "__esModule", { value: true });
55449
- validate$1.getData = validate$1.KeywordCxt = validate$1.validateFunctionCode = void 0;
55450
- const boolSchema_1 = boolSchema;
55451
- const dataType_1$1 = dataType;
55452
- const applicability_1 = applicability;
55453
- const dataType_2 = dataType;
55454
- const defaults_1 = defaults$4;
55455
- const keyword_1 = keyword;
55456
- const subschema_1 = subschema;
55457
- const codegen_1$n = codegen;
55458
- const names_1$3 = names$1;
55459
- const resolve_1$2 = resolve$2;
55460
- const util_1$m = util$1;
55461
- const errors_1 = errors;
55462
- function validateFunctionCode(it2) {
55463
- if (isSchemaObj(it2)) {
55464
- checkKeywords(it2);
55465
- if (schemaCxtHasRules(it2)) {
55466
- topSchemaObjCode(it2);
55467
- 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
+ }
55468
55499
  }
55500
+ validateFunction(it2, () => (0, boolSchema_1.topBoolOrEmptySchema)(it2));
55469
55501
  }
55470
- validateFunction(it2, () => (0, boolSchema_1.topBoolOrEmptySchema)(it2));
55471
- }
55472
- validate$1.validateFunctionCode = validateFunctionCode;
55473
- function validateFunction({ gen, validateName: validateName2, schema: schema2, schemaEnv, opts }, body) {
55474
- if (opts.code.es5) {
55475
- gen.func(validateName2, (0, codegen_1$n._)`${names_1$3.default.data}, ${names_1$3.default.valCxt}`, schemaEnv.$async, () => {
55476
- gen.code((0, codegen_1$n._)`"use strict"; ${funcSourceUrl(schema2, opts)}`);
55477
- destructureValCxtES5(gen, opts);
55478
- gen.code(body);
55479
- });
55480
- } else {
55481
- gen.func(validateName2, (0, codegen_1$n._)`${names_1$3.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema2, opts)).code(body));
55482
- }
55483
- }
55484
- function destructureValCxt(opts) {
55485
- 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}}={}`;
55486
- }
55487
- function destructureValCxtES5(gen, opts) {
55488
- gen.if(names_1$3.default.valCxt, () => {
55489
- gen.var(names_1$3.default.instancePath, (0, codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.instancePath}`);
55490
- gen.var(names_1$3.default.parentData, (0, codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.parentData}`);
55491
- gen.var(names_1$3.default.parentDataProperty, (0, codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.parentDataProperty}`);
55492
- gen.var(names_1$3.default.rootData, (0, codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.rootData}`);
55493
- if (opts.dynamicRef)
55494
- gen.var(names_1$3.default.dynamicAnchors, (0, codegen_1$n._)`${names_1$3.default.valCxt}.${names_1$3.default.dynamicAnchors}`);
55495
- }, () => {
55496
- gen.var(names_1$3.default.instancePath, (0, codegen_1$n._)`""`);
55497
- gen.var(names_1$3.default.parentData, (0, codegen_1$n._)`undefined`);
55498
- gen.var(names_1$3.default.parentDataProperty, (0, codegen_1$n._)`undefined`);
55499
- gen.var(names_1$3.default.rootData, names_1$3.default.data);
55500
- if (opts.dynamicRef)
55501
- gen.var(names_1$3.default.dynamicAnchors, (0, codegen_1$n._)`{}`);
55502
- });
55503
- }
55504
- function topSchemaObjCode(it2) {
55505
- const { schema: schema2, opts, gen } = it2;
55506
- validateFunction(it2, () => {
55507
- if (opts.$comment && schema2.$comment)
55508
- commentKeyword(it2);
55509
- checkNoDefault(it2);
55510
- gen.let(names_1$3.default.vErrors, null);
55511
- gen.let(names_1$3.default.errors, 0);
55512
- if (opts.unevaluated)
55513
- resetEvaluated(it2);
55514
- typeAndKeywords(it2);
55515
- returnResults(it2);
55516
- });
55517
- return;
55518
- }
55519
- function resetEvaluated(it2) {
55520
- const { gen, validateName: validateName2 } = it2;
55521
- it2.evaluated = gen.const("evaluated", (0, codegen_1$n._)`${validateName2}.evaluated`);
55522
- gen.if((0, codegen_1$n._)`${it2.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1$n._)`${it2.evaluated}.props`, (0, codegen_1$n._)`undefined`));
55523
- gen.if((0, codegen_1$n._)`${it2.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1$n._)`${it2.evaluated}.items`, (0, codegen_1$n._)`undefined`));
55524
- }
55525
- function funcSourceUrl(schema2, opts) {
55526
- const schId = typeof schema2 == "object" && schema2[opts.schemaId];
55527
- return schId && (opts.code.source || opts.code.process) ? (0, codegen_1$n._)`/*# sourceURL=${schId} */` : codegen_1$n.nil;
55528
- }
55529
- function subschemaCode(it2, valid) {
55530
- if (isSchemaObj(it2)) {
55531
- checkKeywords(it2);
55532
- if (schemaCxtHasRules(it2)) {
55533
- subSchemaObjCode(it2, valid);
55534
- 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));
55535
55512
  }
55536
55513
  }
55537
- (0, boolSchema_1.boolOrEmptySchema)(it2, valid);
55538
- }
55539
- function schemaCxtHasRules({ schema: schema2, self: self2 }) {
55540
- if (typeof schema2 == "boolean")
55541
- return !schema2;
55542
- for (const key2 in schema2)
55543
- if (self2.RULES.all[key2])
55544
- return true;
55545
- return false;
55546
- }
55547
- function isSchemaObj(it2) {
55548
- return typeof it2.schema != "boolean";
55549
- }
55550
- function subSchemaObjCode(it2, valid) {
55551
- const { schema: schema2, gen, opts } = it2;
55552
- if (opts.$comment && schema2.$comment)
55553
- commentKeyword(it2);
55554
- updateContext(it2);
55555
- checkAsyncSchema(it2);
55556
- const errsCount = gen.const("_errs", names_1$3.default.errors);
55557
- typeAndKeywords(it2, errsCount);
55558
- gen.var(valid, (0, codegen_1$n._)`${errsCount} === ${names_1$3.default.errors}`);
55559
- }
55560
- function checkKeywords(it2) {
55561
- (0, util_1$m.checkUnknownRules)(it2);
55562
- checkRefsAndKeywords(it2);
55563
- }
55564
- function typeAndKeywords(it2, errsCount) {
55565
- if (it2.opts.jtd)
55566
- return schemaKeywords(it2, [], false, errsCount);
55567
- const types2 = (0, dataType_1$1.getSchemaTypes)(it2.schema);
55568
- const checkedTypes = (0, dataType_1$1.coerceAndCheckDataType)(it2, types2);
55569
- schemaKeywords(it2, types2, !checkedTypes, errsCount);
55570
- }
55571
- function checkRefsAndKeywords(it2) {
55572
- const { schema: schema2, errSchemaPath, opts, self: self2 } = it2;
55573
- if (schema2.$ref && opts.ignoreKeywordsWithRef && (0, util_1$m.schemaHasRulesButRef)(schema2, self2.RULES)) {
55574
- self2.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
55575
- }
55576
- }
55577
- function checkNoDefault(it2) {
55578
- const { schema: schema2, opts } = it2;
55579
- if (schema2.default !== void 0 && opts.useDefaults && opts.strictSchema) {
55580
- (0, util_1$m.checkStrictMode)(it2, "default is ignored in the schema root");
55581
- }
55582
- }
55583
- function updateContext(it2) {
55584
- const schId = it2.schema[it2.opts.schemaId];
55585
- if (schId)
55586
- it2.baseId = (0, resolve_1$2.resolveUrl)(it2.opts.uriResolver, it2.baseId, schId);
55587
- }
55588
- function checkAsyncSchema(it2) {
55589
- if (it2.schema.$async && !it2.schemaEnv.$async)
55590
- throw new Error("async schema in sync schema");
55591
- }
55592
- function commentKeyword({ gen, schemaEnv, schema: schema2, errSchemaPath, opts }) {
55593
- const msg = schema2.$comment;
55594
- if (opts.$comment === true) {
55595
- gen.code((0, codegen_1$n._)`${names_1$3.default.self}.logger.log(${msg})`);
55596
- } else if (typeof opts.$comment == "function") {
55597
- const schemaPath = (0, codegen_1$n.str)`${errSchemaPath}/$comment`;
55598
- const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
55599
- gen.code((0, codegen_1$n._)`${names_1$3.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
55600
- }
55601
- }
55602
- function returnResults(it2) {
55603
- const { gen, schemaEnv, validateName: validateName2, ValidationError: ValidationError2, opts } = it2;
55604
- if (schemaEnv.$async) {
55605
- 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})`));
55606
- } else {
55607
- gen.assign((0, codegen_1$n._)`${validateName2}.errors`, names_1$3.default.vErrors);
55608
- if (opts.unevaluated)
55609
- assignEvaluated(it2);
55610
- gen.return((0, codegen_1$n._)`${names_1$3.default.errors} === 0`);
55611
- }
55612
- }
55613
- function assignEvaluated({ gen, evaluated, props, items: items2 }) {
55614
- if (props instanceof codegen_1$n.Name)
55615
- gen.assign((0, codegen_1$n._)`${evaluated}.props`, props);
55616
- if (items2 instanceof codegen_1$n.Name)
55617
- gen.assign((0, codegen_1$n._)`${evaluated}.items`, items2);
55618
- }
55619
- function schemaKeywords(it2, types2, typeErrors, errsCount) {
55620
- const { gen, schema: schema2, data, allErrors, opts, self: self2 } = it2;
55621
- const { RULES } = self2;
55622
- if (schema2.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1$m.schemaHasRulesButRef)(schema2, RULES))) {
55623
- 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
+ });
55624
55547
  return;
55625
55548
  }
55626
- if (!opts.jtd)
55627
- checkStrictTypes(it2, types2);
55628
- gen.block(() => {
55629
- for (const group of RULES.rules)
55630
- groupKeywords(group);
55631
- groupKeywords(RULES.post);
55632
- });
55633
- function groupKeywords(group) {
55634
- if (!(0, applicability_1.shouldUseGroup)(schema2, group))
55635
- return;
55636
- if (group.type) {
55637
- gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
55638
- iterateKeywords(it2, group);
55639
- if (types2.length === 1 && types2[0] === group.type && typeErrors) {
55640
- gen.else();
55641
- (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;
55642
55565
  }
55643
- gen.endIf();
55644
- } else {
55645
- iterateKeywords(it2, group);
55646
55566
  }
55647
- if (!allErrors)
55648
- gen.if((0, codegen_1$n._)`${names_1$3.default.errors} === ${errsCount || 0}`);
55567
+ (0, boolSchema_1.boolOrEmptySchema)(it2, valid);
55649
55568
  }
55650
- }
55651
- function iterateKeywords(it2, group) {
55652
- const { gen, schema: schema2, opts: { useDefaults } } = it2;
55653
- if (useDefaults)
55654
- (0, defaults_1.assignDefaults)(it2, group.type);
55655
- gen.block(() => {
55656
- for (const rule of group.rules) {
55657
- if ((0, applicability_1.shouldUseRule)(schema2, rule)) {
55658
- keywordCode(it2, rule.keyword, rule.definition, group.type);
55659
- }
55660
- }
55661
- });
55662
- }
55663
- function checkStrictTypes(it2, types2) {
55664
- if (it2.schemaEnv.meta || !it2.opts.strictTypes)
55665
- return;
55666
- checkContextTypes(it2, types2);
55667
- if (!it2.opts.allowUnionTypes)
55668
- checkMultipleTypes(it2, types2);
55669
- checkKeywordTypes(it2, it2.dataTypes);
55670
- }
55671
- function checkContextTypes(it2, types2) {
55672
- if (!types2.length)
55673
- return;
55674
- if (!it2.dataTypes.length) {
55675
- it2.dataTypes = types2;
55676
- 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;
55677
55576
  }
55678
- types2.forEach((t) => {
55679
- if (!includesType(it2.dataTypes, t)) {
55680
- strictTypesError(it2, `type "${t}" not allowed by context "${it2.dataTypes.join(",")}"`);
55681
- }
55682
- });
55683
- narrowSchemaTypes(it2, types2);
55684
- }
55685
- function checkMultipleTypes(it2, ts2) {
55686
- if (ts2.length > 1 && !(ts2.length === 2 && ts2.includes("null"))) {
55687
- strictTypesError(it2, "use allowUnionTypes to allow union type keyword");
55577
+ function isSchemaObj(it2) {
55578
+ return typeof it2.schema != "boolean";
55688
55579
  }
55689
- }
55690
- function checkKeywordTypes(it2, ts2) {
55691
- const rules2 = it2.self.RULES.all;
55692
- for (const keyword2 in rules2) {
55693
- const rule = rules2[keyword2];
55694
- if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it2.schema, rule)) {
55695
- const { type: type2 } = rule.definition;
55696
- if (type2.length && !type2.some((t) => hasApplicableType(ts2, t))) {
55697
- strictTypesError(it2, `missing type "${type2.join(",")}" for keyword "${keyword2}"`);
55698
- }
55699
- }
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}`);
55700
55589
  }
55701
- }
55702
- function hasApplicableType(schTs, kwdT) {
55703
- return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
55704
- }
55705
- function includesType(ts2, t) {
55706
- return ts2.includes(t) || t === "integer" && ts2.includes("number");
55707
- }
55708
- function narrowSchemaTypes(it2, withTypes) {
55709
- const ts2 = [];
55710
- for (const t of it2.dataTypes) {
55711
- if (includesType(withTypes, t))
55712
- ts2.push(t);
55713
- else if (withTypes.includes("integer") && t === "number")
55714
- ts2.push("integer");
55590
+ function checkKeywords(it2) {
55591
+ (0, util_12.checkUnknownRules)(it2);
55592
+ checkRefsAndKeywords(it2);
55715
55593
  }
55716
- it2.dataTypes = ts2;
55717
- }
55718
- function strictTypesError(it2, msg) {
55719
- const schemaPath = it2.schemaEnv.baseId + it2.errSchemaPath;
55720
- msg += ` at "${schemaPath}" (strictTypes)`;
55721
- (0, util_1$m.checkStrictMode)(it2, msg, it2.opts.strictTypes);
55722
- }
55723
- class KeywordCxt {
55724
- constructor(it2, def2, keyword2) {
55725
- (0, keyword_1.validateKeywordUsage)(it2, def2, keyword2);
55726
- this.gen = it2.gen;
55727
- this.allErrors = it2.allErrors;
55728
- this.keyword = keyword2;
55729
- this.data = it2.data;
55730
- this.schema = it2.schema[keyword2];
55731
- this.$data = def2.$data && it2.opts.$data && this.schema && this.schema.$data;
55732
- this.schemaValue = (0, util_1$m.schemaRefOrVal)(it2, this.schema, keyword2, this.$data);
55733
- this.schemaType = def2.schemaType;
55734
- this.parentSchema = it2.schema;
55735
- this.params = {};
55736
- this.it = it2;
55737
- this.def = def2;
55738
- if (this.$data) {
55739
- this.schemaCode = it2.gen.const("vSchema", getData(this.$data, it2));
55740
- } else {
55741
- this.schemaCode = this.schemaValue;
55742
- if (!(0, keyword_1.validSchemaType)(this.schema, def2.schemaType, def2.allowUndefined)) {
55743
- throw new Error(`${keyword2} value must be ${JSON.stringify(def2.schemaType)}`);
55744
- }
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}"`);
55745
55605
  }
55746
- if ("code" in def2 ? def2.trackErrors : def2.errors !== false) {
55747
- 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");
55748
55611
  }
55749
55612
  }
55750
- result(condition, successAction, failAction) {
55751
- 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);
55752
55617
  }
55753
- failResult(condition, successAction, failAction) {
55754
- this.gen.if(condition);
55755
- if (failAction)
55756
- failAction();
55757
- else
55758
- this.error();
55759
- if (successAction) {
55760
- this.gen.else();
55761
- successAction();
55762
- if (this.allErrors)
55763
- 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})`));
55764
55636
  } else {
55765
- if (this.allErrors)
55766
- this.gen.endIf();
55767
- else
55768
- 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}`);
55769
55679
  }
55770
55680
  }
55771
- pass(condition, failAction) {
55772
- 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
+ });
55773
55692
  }
55774
- fail(condition) {
55775
- if (condition === void 0) {
55776
- this.error();
55777
- if (!this.allErrors)
55778
- this.gen.if(false);
55693
+ function checkStrictTypes(it2, types2) {
55694
+ if (it2.schemaEnv.meta || !it2.opts.strictTypes)
55779
55695
  return;
55780
- }
55781
- this.gen.if(condition);
55782
- this.error();
55783
- if (this.allErrors)
55784
- this.gen.endIf();
55785
- else
55786
- this.gen.else();
55696
+ checkContextTypes(it2, types2);
55697
+ if (!it2.opts.allowUnionTypes)
55698
+ checkMultipleTypes(it2, types2);
55699
+ checkKeywordTypes(it2, it2.dataTypes);
55787
55700
  }
55788
- fail$data(condition) {
55789
- if (!this.$data)
55790
- return this.fail(condition);
55791
- const { schemaCode } = this;
55792
- this.fail((0, codegen_1$n._)`${schemaCode} !== undefined && (${(0, codegen_1$n.or)(this.invalid$data(), condition)})`);
55793
- }
55794
- error(append, errorParams, errorPaths) {
55795
- if (errorParams) {
55796
- this.setParams(errorParams);
55797
- this._error(append, errorPaths);
55798
- this.setParams({});
55701
+ function checkContextTypes(it2, types2) {
55702
+ if (!types2.length)
55703
+ return;
55704
+ if (!it2.dataTypes.length) {
55705
+ it2.dataTypes = types2;
55799
55706
  return;
55800
55707
  }
55801
- 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);
55802
55714
  }
55803
- _error(append, errorPaths) {
55804
- (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
+ }
55805
55719
  }
55806
- $dataError() {
55807
- (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
+ }
55808
55731
  }
55809
- reset() {
55810
- if (this.errsCount === void 0)
55811
- throw new Error('add "trackErrors" to keyword definition');
55812
- (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);
55732
+ function hasApplicableType(schTs, kwdT) {
55733
+ return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
55813
55734
  }
55814
- ok(cond) {
55815
- if (!this.allErrors)
55816
- this.gen.if(cond);
55735
+ function includesType(ts2, t) {
55736
+ return ts2.includes(t) || t === "integer" && ts2.includes("number");
55817
55737
  }
55818
- setParams(obj, assign) {
55819
- if (assign)
55820
- Object.assign(this.params, obj);
55821
- else
55822
- 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;
55823
55747
  }
55824
- block$data(valid, codeBlock, $dataValid = codegen_1$n.nil) {
55825
- this.gen.block(() => {
55826
- this.check$data(valid, $dataValid);
55827
- codeBlock();
55828
- });
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);
55829
55752
  }
55830
- check$data(valid = codegen_1$n.nil, $dataValid = codegen_1$n.nil) {
55831
- if (!this.$data)
55832
- return;
55833
- const { gen, schemaCode, schemaType, def: def2 } = this;
55834
- gen.if((0, codegen_1$n.or)((0, codegen_1$n._)`${schemaCode} === undefined`, $dataValid));
55835
- if (valid !== codegen_1$n.nil)
55836
- gen.assign(valid, true);
55837
- if (schemaType.length || def2.validateSchema) {
55838
- gen.elseIf(this.invalid$data());
55839
- this.$dataError();
55840
- if (valid !== codegen_1$n.nil)
55841
- 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
+ }
55842
55779
  }
55843
- gen.else();
55844
- }
55845
- invalid$data() {
55846
- const { gen, schemaCode, schemaType, def: def2, it: it2 } = this;
55847
- return (0, codegen_1$n.or)(wrong$DataType(), invalid$DataSchema());
55848
- function wrong$DataType() {
55849
- if (schemaType.length) {
55850
- if (!(schemaCode instanceof codegen_1$n.Name))
55851
- throw new Error("ajv implementation error");
55852
- const st2 = Array.isArray(schemaType) ? schemaType : [schemaType];
55853
- 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();
55854
55799
  }
55855
- return codegen_1$n.nil;
55856
55800
  }
55857
- function invalid$DataSchema() {
55858
- if (def2.validateSchema) {
55859
- const validateSchemaRef = gen.scopeValue("validate$data", { ref: def2.validateSchema });
55860
- 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;
55861
55810
  }
55862
- 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();
55863
55817
  }
55864
- }
55865
- subschema(appl, valid) {
55866
- const subschema2 = (0, subschema_1.getSubschema)(this.it, appl);
55867
- (0, subschema_1.extendSubschemaData)(subschema2, this.it, appl);
55868
- (0, subschema_1.extendSubschemaMode)(subschema2, appl);
55869
- const nextContext = { ...this.it, ...subschema2, items: void 0, props: void 0 };
55870
- subschemaCode(nextContext, valid);
55871
- return nextContext;
55872
- }
55873
- mergeEvaluated(schemaCxt, toName) {
55874
- const { it: it2, gen } = this;
55875
- if (!it2.opts.unevaluated)
55876
- return;
55877
- if (it2.props !== true && schemaCxt.props !== void 0) {
55878
- 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);
55879
55832
  }
55880
- if (it2.items !== true && schemaCxt.items !== void 0) {
55881
- 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);
55882
55835
  }
55883
- }
55884
- mergeValidEvaluated(schemaCxt, valid) {
55885
- const { it: it2, gen } = this;
55886
- if (it2.opts.unevaluated && (it2.props !== true || it2.items !== true)) {
55887
- gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1$n.Name));
55888
- return true;
55836
+ $dataError() {
55837
+ (0, errors_12.reportError)(this, this.def.$dataError || errors_12.keyword$DataError);
55889
55838
  }
55890
- }
55891
- }
55892
- validate$1.KeywordCxt = KeywordCxt;
55893
- function keywordCode(it2, keyword2, def2, ruleType) {
55894
- const cxt = new KeywordCxt(it2, def2, keyword2);
55895
- if ("code" in def2) {
55896
- def2.code(cxt, ruleType);
55897
- } else if (cxt.$data && def2.validate) {
55898
- (0, keyword_1.funcKeywordCode)(cxt, def2);
55899
- } else if ("macro" in def2) {
55900
- (0, keyword_1.macroKeywordCode)(cxt, def2);
55901
- } else if (def2.compile || def2.validate) {
55902
- (0, keyword_1.funcKeywordCode)(cxt, def2);
55903
- }
55904
- }
55905
- const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
55906
- const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
55907
- function getData($data, { dataLevel, dataNames, dataPathArr }) {
55908
- let jsonPointer;
55909
- let data;
55910
- if ($data === "")
55911
- return names_1$3.default.rootData;
55912
- if ($data[0] === "/") {
55913
- if (!JSON_POINTER.test($data))
55914
- throw new Error(`Invalid JSON-pointer: ${$data}`);
55915
- jsonPointer = $data;
55916
- data = names_1$3.default.rootData;
55917
- } else {
55918
- const matches = RELATIVE_JSON_POINTER.exec($data);
55919
- if (!matches)
55920
- throw new Error(`Invalid JSON-pointer: ${$data}`);
55921
- const up = +matches[1];
55922
- jsonPointer = matches[2];
55923
- if (jsonPointer === "#") {
55924
- if (up >= dataLevel)
55925
- throw new Error(errorMsg("property/index", up));
55926
- return dataPathArr[dataLevel - up];
55927
- }
55928
- if (up > dataLevel)
55929
- throw new Error(errorMsg("data", up));
55930
- data = dataNames[dataLevel - up];
55931
- if (!jsonPointer)
55932
- return data;
55933
- }
55934
- let expr = data;
55935
- const segments = jsonPointer.split("/");
55936
- for (const segment2 of segments) {
55937
- if (segment2) {
55938
- data = (0, codegen_1$n._)`${data}${(0, codegen_1$n.getProperty)((0, util_1$m.unescapeJsonPointer)(segment2))}`;
55939
- 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
+ }
55940
55920
  }
55941
55921
  }
55942
- return expr;
55943
- function errorMsg(pointerType, up) {
55944
- 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
+ }
55945
55976
  }
55977
+ validate$1.getData = getData;
55978
+ return validate$1;
55946
55979
  }
55947
- validate$1.getData = getData;
55948
55980
  var validation_error = {};
55949
- Object.defineProperty(validation_error, "__esModule", { value: true });
55950
- class ValidationError extends Error {
55951
- constructor(errors2) {
55952
- super("validation failed");
55953
- this.errors = errors2;
55954
- 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
+ }
55955
55992
  }
55993
+ validation_error.default = ValidationError;
55994
+ return validation_error;
55956
55995
  }
55957
- validation_error.default = ValidationError;
55958
55996
  var ref_error = {};
55959
55997
  Object.defineProperty(ref_error, "__esModule", { value: true });
55960
55998
  const resolve_1$1 = resolve$2;
@@ -55970,11 +56008,11 @@ var compile = {};
55970
56008
  Object.defineProperty(compile, "__esModule", { value: true });
55971
56009
  compile.resolveSchema = compile.getCompilingSchema = compile.resolveRef = compile.compileSchema = compile.SchemaEnv = void 0;
55972
56010
  const codegen_1$m = codegen;
55973
- const validation_error_1 = validation_error;
56011
+ const validation_error_1 = requireValidation_error();
55974
56012
  const names_1$2 = names$1;
55975
56013
  const resolve_1 = resolve$2;
55976
56014
  const util_1$l = util$1;
55977
- const validate_1$1 = validate$1;
56015
+ const validate_1$1 = requireValidate();
55978
56016
  class SchemaEnv {
55979
56017
  constructor(env) {
55980
56018
  var _a2;
@@ -56990,7 +57028,7 @@ uri$1.default = uri;
56990
57028
  (function(exports$1) {
56991
57029
  Object.defineProperty(exports$1, "__esModule", { value: true });
56992
57030
  exports$1.CodeGen = exports$1.Name = exports$1.nil = exports$1.stringify = exports$1.str = exports$1._ = exports$1.KeywordCxt = void 0;
56993
- var validate_12 = validate$1;
57031
+ var validate_12 = requireValidate();
56994
57032
  Object.defineProperty(exports$1, "KeywordCxt", { enumerable: true, get: function() {
56995
57033
  return validate_12.KeywordCxt;
56996
57034
  } });
@@ -57013,7 +57051,7 @@ uri$1.default = uri;
57013
57051
  Object.defineProperty(exports$1, "CodeGen", { enumerable: true, get: function() {
57014
57052
  return codegen_12.CodeGen;
57015
57053
  } });
57016
- const validation_error_12 = validation_error;
57054
+ const validation_error_12 = requireValidation_error();
57017
57055
  const ref_error_12 = ref_error;
57018
57056
  const rules_12 = rules;
57019
57057
  const compile_12 = compile;
@@ -58601,7 +58639,7 @@ const def$b = {
58601
58639
  additionalProperties.default = def$b;
58602
58640
  var properties$1 = {};
58603
58641
  Object.defineProperty(properties$1, "__esModule", { value: true });
58604
- const validate_1 = validate$1;
58642
+ const validate_1 = requireValidate();
58605
58643
  const code_1$2 = code;
58606
58644
  const util_1$7 = util$1;
58607
58645
  const additionalProperties_1$1 = additionalProperties;
@@ -59452,7 +59490,7 @@ const require$$3 = {
59452
59490
  module.exports.Ajv = Ajv2;
59453
59491
  Object.defineProperty(exports$1, "__esModule", { value: true });
59454
59492
  exports$1.default = Ajv2;
59455
- var validate_12 = validate$1;
59493
+ var validate_12 = requireValidate();
59456
59494
  Object.defineProperty(exports$1, "KeywordCxt", { enumerable: true, get: function() {
59457
59495
  return validate_12.KeywordCxt;
59458
59496
  } });
@@ -59475,7 +59513,7 @@ const require$$3 = {
59475
59513
  Object.defineProperty(exports$1, "CodeGen", { enumerable: true, get: function() {
59476
59514
  return codegen_12.CodeGen;
59477
59515
  } });
59478
- var validation_error_12 = validation_error;
59516
+ var validation_error_12 = requireValidation_error();
59479
59517
  Object.defineProperty(exports$1, "ValidationError", { enumerable: true, get: function() {
59480
59518
  return validation_error_12.default;
59481
59519
  } });
@@ -67908,7 +67946,7 @@ const DANGEROUS_PROVIDER_KEYS = /* @__PURE__ */ new Set([
67908
67946
  "prototype",
67909
67947
  "constructor"
67910
67948
  ]);
67911
- const providerRuntimeLoader = createLazyImportLoader(() => import("./provider-discovery.runtime-ZgcVwu5_.js"));
67949
+ const providerRuntimeLoader = createLazyImportLoader(() => import("./provider-discovery.runtime-D_JTH7-C.js"));
67912
67950
  function loadProviderRuntime() {
67913
67951
  return providerRuntimeLoader.load();
67914
67952
  }
@@ -69549,7 +69587,7 @@ const CONTEXT_WINDOW_RUNTIME_STATE_KEY = Symbol.for("openclaw.contextWindowRunti
69549
69587
  configuredConfig: void 0,
69550
69588
  configLoadFailures: 0,
69551
69589
  nextConfigLoadAttemptAtMs: 0,
69552
- modelsConfigRuntimeLoader: createLazyImportLoader(() => import("./models-config.runtime-cY4XGOI0.js"))
69590
+ modelsConfigRuntimeLoader: createLazyImportLoader(() => import("./models-config.runtime-BnpSlXPo.js"))
69553
69591
  };
69554
69592
  return globalState[CONTEXT_WINDOW_RUNTIME_STATE_KEY];
69555
69593
  })();
@@ -90470,12 +90508,12 @@ function planOutboundMediaMessageUnits(params) {
90470
90508
  const log$3 = createSubsystemLogger("outbound/deliver");
90471
90509
  let transcriptRuntimePromise;
90472
90510
  async function loadTranscriptRuntime() {
90473
- transcriptRuntimePromise ??= import("./transcript.runtime-Dchg_w3u.js");
90511
+ transcriptRuntimePromise ??= import("./transcript.runtime-BJj5V1X4.js");
90474
90512
  return await transcriptRuntimePromise;
90475
90513
  }
90476
90514
  let channelBootstrapRuntimePromise;
90477
90515
  async function loadChannelBootstrapRuntime() {
90478
- channelBootstrapRuntimePromise ??= import("./channel-bootstrap.runtime-B0t3vnup-S_ZINco5.js");
90516
+ channelBootstrapRuntimePromise ??= import("./channel-bootstrap.runtime-B0t3vnup-BAOsCuTr.js");
90479
90517
  return await channelBootstrapRuntimePromise;
90480
90518
  }
90481
90519
  async function resolveChannelOutboundDirectiveOptions(params) {
@@ -93956,7 +93994,7 @@ function createLazyLoadErrorImages(model, error2) {
93956
93994
  };
93957
93995
  }
93958
93996
  function loadOpenRouterImagesProviderModule() {
93959
- openRouterImagesProviderModulePromise ||= import("./openrouter-CXWxTM8p.js").then((module) => module);
93997
+ openRouterImagesProviderModulePromise ||= import("./openrouter-CjDOFscf.js").then((module) => module);
93960
93998
  return openRouterImagesProviderModulePromise;
93961
93999
  }
93962
94000
  const generateImagesOpenRouter = async (model, context, options2) => {
@@ -94499,7 +94537,7 @@ function createLazySimpleStream(loadModule2) {
94499
94537
  };
94500
94538
  }
94501
94539
  function loadAnthropicProviderModule() {
94502
- anthropicProviderModulePromise ||= import("./anthropic-C1jzp_Rc.js").then((module) => {
94540
+ anthropicProviderModulePromise ||= import("./anthropic-Sa15w5z4.js").then((module) => {
94503
94541
  const provider = module;
94504
94542
  return {
94505
94543
  stream: provider.streamAnthropic,
@@ -94509,7 +94547,7 @@ function loadAnthropicProviderModule() {
94509
94547
  return anthropicProviderModulePromise;
94510
94548
  }
94511
94549
  function loadAzureOpenAIResponsesProviderModule() {
94512
- azureOpenAIResponsesProviderModulePromise ||= import("./azure-openai-responses-zym2wxMB.js").then((module) => {
94550
+ azureOpenAIResponsesProviderModulePromise ||= import("./azure-openai-responses-CPtWbf1C.js").then((module) => {
94513
94551
  const provider = module;
94514
94552
  return {
94515
94553
  stream: provider.streamAzureOpenAIResponses,
@@ -94519,7 +94557,7 @@ function loadAzureOpenAIResponsesProviderModule() {
94519
94557
  return azureOpenAIResponsesProviderModulePromise;
94520
94558
  }
94521
94559
  function loadGoogleProviderModule() {
94522
- googleProviderModulePromise ||= import("./google-DqQHu2NY.js").then((module) => {
94560
+ googleProviderModulePromise ||= import("./google-BnRHrBN8.js").then((module) => {
94523
94561
  const provider = module;
94524
94562
  return {
94525
94563
  stream: provider.streamGoogle,
@@ -94529,7 +94567,7 @@ function loadGoogleProviderModule() {
94529
94567
  return googleProviderModulePromise;
94530
94568
  }
94531
94569
  function loadGoogleVertexProviderModule() {
94532
- googleVertexProviderModulePromise ||= import("./google-vertex-Cs1hEe_j.js").then((module) => {
94570
+ googleVertexProviderModulePromise ||= import("./google-vertex-Hiq4fZCi.js").then((module) => {
94533
94571
  const provider = module;
94534
94572
  return {
94535
94573
  stream: provider.streamGoogleVertex,
@@ -94539,7 +94577,7 @@ function loadGoogleVertexProviderModule() {
94539
94577
  return googleVertexProviderModulePromise;
94540
94578
  }
94541
94579
  function loadMistralProviderModule() {
94542
- mistralProviderModulePromise ||= import("./mistral-B0v4IfAz.js").then((module) => {
94580
+ mistralProviderModulePromise ||= import("./mistral-hhgCrfG_.js").then((module) => {
94543
94581
  const provider = module;
94544
94582
  return {
94545
94583
  stream: provider.streamMistral,
@@ -94549,7 +94587,7 @@ function loadMistralProviderModule() {
94549
94587
  return mistralProviderModulePromise;
94550
94588
  }
94551
94589
  function loadOpenAICodexResponsesProviderModule() {
94552
- openAICodexResponsesProviderModulePromise ||= import("./openai-codex-responses-tC0hde6o.js").then((module) => {
94590
+ openAICodexResponsesProviderModulePromise ||= import("./openai-codex-responses-CBorkFRy.js").then((module) => {
94553
94591
  const provider = module;
94554
94592
  return {
94555
94593
  stream: provider.streamOpenAICodexResponses,
@@ -94559,7 +94597,7 @@ function loadOpenAICodexResponsesProviderModule() {
94559
94597
  return openAICodexResponsesProviderModulePromise;
94560
94598
  }
94561
94599
  function loadOpenAICompletionsProviderModule() {
94562
- openAICompletionsProviderModulePromise ||= import("./openai-completions-w3FtI3rd.js").then((module) => {
94600
+ openAICompletionsProviderModulePromise ||= import("./openai-completions-Bd-A-Zxa.js").then((module) => {
94563
94601
  const provider = module;
94564
94602
  return {
94565
94603
  stream: provider.streamOpenAICompletions,
@@ -94569,7 +94607,7 @@ function loadOpenAICompletionsProviderModule() {
94569
94607
  return openAICompletionsProviderModulePromise;
94570
94608
  }
94571
94609
  function loadOpenAIResponsesProviderModule() {
94572
- openAIResponsesProviderModulePromise ||= import("./openai-responses-rRjf4OAK.js").then((module) => {
94610
+ openAIResponsesProviderModulePromise ||= import("./openai-responses-8Q6No8u_.js").then((module) => {
94573
94611
  const provider = module;
94574
94612
  return {
94575
94613
  stream: provider.streamOpenAIResponses,
@@ -172372,7 +172410,7 @@ See https://babeljs.io/docs/configuration#print-effective-configs for more info.
172372
172410
  s5.names.push(i4);
172373
172411
  });
172374
172412
  }), o3;
172375
- }(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) => {
172376
172414
  const s4 = t5.value;
172377
172415
  let i3 = a2.get(s4);
172378
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() {
@@ -172382,7 +172420,7 @@ See https://babeljs.io/docs/configuration#print-effective-configs for more info.
172382
172420
  let l2 = false;
172383
172421
  e4.get("body").forEach((e5) => {
172384
172422
  if (e5.isImportDeclaration()) {
172385
- const t5 = getData2(e5.node.source, e5.node);
172423
+ const t5 = getData(e5.node.source, e5.node);
172386
172424
  t5.loc || (t5.loc = e5.node.loc), e5.get("specifiers").forEach((e6) => {
172387
172425
  if (e6.isImportDefaultSpecifier()) {
172388
172426
  const r4 = e6.get("local").node.name;
@@ -172409,11 +172447,11 @@ See https://babeljs.io/docs/configuration#print-effective-configs for more info.
172409
172447
  });
172410
172448
  } else if (e5.isExportAllDeclaration()) {
172411
172449
  l2 = true;
172412
- const t5 = getData2(e5.node.source, e5.node);
172450
+ const t5 = getData(e5.node.source, e5.node);
172413
172451
  t5.loc || (t5.loc = e5.node.loc), t5.reexportAll = { loc: e5.node.loc }, t5.referenced = true;
172414
172452
  } else if (e5.isExportNamedDeclaration() && e5.node.source) {
172415
172453
  l2 = true;
172416
- const t5 = getData2(e5.node.source, e5.node);
172454
+ const t5 = getData(e5.node.source, e5.node);
172417
172455
  t5.loc || (t5.loc = e5.node.loc), e5.get("specifiers").forEach((e6) => {
172418
172456
  assertExportSpecifier(e6);
172419
172457
  const r4 = getExportSpecifierName(e6.get("local"), s3), n8 = getExportSpecifierName(e6.get("exported"), s3);
@@ -196857,7 +196895,7 @@ async function loadPhoton() {
196857
196895
  loadPromise = (async () => {
196858
196896
  const restoreReadFileSync = patchPhotonWasmRead();
196859
196897
  try {
196860
- photonModule = await import("./photon_rs-CGHeuAJ1.js").then((n7) => n7.p);
196898
+ photonModule = await import("./photon_rs-BsXu_h4Z.js").then((n7) => n7.p);
196861
196899
  return photonModule;
196862
196900
  } catch {
196863
196901
  photonModule = null;