@agent-ix/quoin 0.13.0 → 0.15.1

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 (88) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/dist/advisor/advise.d.ts +57 -0
  4. package/dist/advisor/advise.d.ts.map +1 -0
  5. package/dist/advisor/index.d.ts +10 -0
  6. package/dist/advisor/index.d.ts.map +1 -0
  7. package/dist/advisor/methods.d.ts +50 -0
  8. package/dist/advisor/methods.d.ts.map +1 -0
  9. package/dist/advisor-D35K3_iI.js +50 -0
  10. package/dist/auditor/audit.d.ts +52 -0
  11. package/dist/auditor/audit.d.ts.map +1 -0
  12. package/dist/auditor/index.d.ts +8 -0
  13. package/dist/auditor/index.d.ts.map +1 -0
  14. package/dist/{base-D-_JMqkO.js → base-CtpwIg4M.js} +2 -2
  15. package/dist/catalog.d.ts +1 -0
  16. package/dist/catalog.d.ts.map +1 -1
  17. package/dist/cli.js +1 -1
  18. package/dist/commands/catalog/list.js +2 -2
  19. package/dist/commands/catalog/methods.d.ts +12 -0
  20. package/dist/commands/catalog/methods.d.ts.map +1 -0
  21. package/dist/commands/catalog/methods.js +43 -0
  22. package/dist/commands/catalog/show.js +2 -2
  23. package/dist/commands/catalog/validate.js +2 -2
  24. package/dist/commands/config/doctor.js +1 -1
  25. package/dist/commands/config/edit.js +1 -1
  26. package/dist/commands/config/get.js +1 -1
  27. package/dist/commands/config/set.js +1 -1
  28. package/dist/commands/evidence/affirm.d.ts +17 -0
  29. package/dist/commands/evidence/affirm.d.ts.map +1 -0
  30. package/dist/commands/evidence/affirm.js +81 -0
  31. package/dist/commands/evidence/audit.d.ts +15 -0
  32. package/dist/commands/evidence/audit.d.ts.map +1 -0
  33. package/dist/commands/evidence/audit.js +192 -0
  34. package/dist/commands/evidence/gc.d.ts +13 -0
  35. package/dist/commands/evidence/gc.d.ts.map +1 -0
  36. package/dist/commands/evidence/gc.js +34 -0
  37. package/dist/commands/evidence/index.d.ts +8 -0
  38. package/dist/commands/evidence/index.d.ts.map +1 -0
  39. package/dist/commands/evidence/index.js +16 -0
  40. package/dist/commands/evidence/record.d.ts +18 -0
  41. package/dist/commands/evidence/record.d.ts.map +1 -0
  42. package/dist/commands/evidence/record.js +85 -0
  43. package/dist/commands/matrix.js +1 -1
  44. package/dist/commands/module/ensure-defaults.js +3 -3
  45. package/dist/commands/module/install.js +2 -2
  46. package/dist/commands/module/list.js +2 -2
  47. package/dist/commands/module/remove.js +2 -2
  48. package/dist/commands/review.js +1 -1
  49. package/dist/commands/to-plan.js +1 -1
  50. package/dist/commands/update.js +2 -2
  51. package/dist/commands/write.js +3 -3
  52. package/dist/evidence/index.d.ts +13 -0
  53. package/dist/evidence/index.d.ts.map +1 -0
  54. package/dist/evidence/record.d.ts +52 -0
  55. package/dist/evidence/record.d.ts.map +1 -0
  56. package/dist/evidence/store.d.ts +77 -0
  57. package/dist/evidence/store.d.ts.map +1 -0
  58. package/dist/evidence/types.d.ts +122 -0
  59. package/dist/evidence/types.d.ts.map +1 -0
  60. package/dist/evidence-BvUyw-Yv.js +171 -0
  61. package/dist/{flow-command-BPwQwyEV.js → flow-command-BSMqxass.js} +1 -1
  62. package/dist/index.js +6 -6
  63. package/dist/{modules-Dn6ac8th.js → modules-Ckfaq5p4.js} +2 -2
  64. package/dist/{plugins-BCCcBgCW.js → plugins-CLuXx2Jr.js} +1 -1
  65. package/dist/quire/contract.d.ts +82 -0
  66. package/dist/quire/contract.d.ts.map +1 -0
  67. package/dist/quire/index.d.ts +11 -0
  68. package/dist/quire/index.d.ts.map +1 -0
  69. package/dist/quire/types.d.ts +155 -0
  70. package/dist/quire/types.d.ts.map +1 -0
  71. package/dist/quire/validate.d.ts +34 -0
  72. package/dist/quire/validate.d.ts.map +1 -0
  73. package/dist/quire-MbMdffPh.js +4872 -0
  74. package/dist/schemas/coverage-v1.schema.json +191 -0
  75. package/dist/schemas/properties-v1.schema.json +134 -0
  76. package/dist/{version-BGJINLrJ.js → version-By2YFRZQ.js} +1 -1
  77. package/dist/{write-FTRN1yh6.js → write-8JJ8Dumo.js} +1 -1
  78. package/package.json +6 -2
  79. package/skills/gap-analysis/SKILL.md +12 -0
  80. package/skills/gap-analysis/references/step-3-matrix-verification.md +24 -1
  81. package/skills/gap-analysis/references/step-6-specreview-artifact.md +7 -0
  82. package/skills/spec-correctness/references/step-6-review-artifact.md +13 -0
  83. package/skills/spec-correctness/references/step-7-report-and-handoff.md +21 -3
  84. package/skills/spec-ears-analysis/SKILL.md +13 -0
  85. package/skills/spec-evidence-analysis/SKILL.md +64 -52
  86. package/skills/spec-matrix/SKILL.md +13 -0
  87. package/skills/spec-review/SKILL.md +13 -0
  88. package/skills/spec-to-plan/SKILL.md +13 -0
@@ -0,0 +1,4872 @@
1
+ import { readFileSync as e } from "node:fs";
2
+ import { dirname as t, join as n } from "node:path";
3
+ import { fileURLToPath as r } from "node:url";
4
+ import "node:crypto";
5
+ //#region \0rolldown/runtime.js
6
+ var i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.prototype.hasOwnProperty, c = (e, t, n) => () => {
7
+ if (n) throw n[0];
8
+ try {
9
+ return e && (t = e(e = 0)), t;
10
+ } catch (e) {
11
+ throw n = [e], e;
12
+ }
13
+ }, l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), u = (e, t) => {
14
+ let n = {};
15
+ for (var r in e) i(n, r, {
16
+ get: e[r],
17
+ enumerable: !0
18
+ });
19
+ return t || i(n, Symbol.toStringTag, { value: "Module" }), n;
20
+ }, d = (e, t, n, r) => {
21
+ if (t && typeof t == "object" || typeof t == "function") for (var c = o(t), l = 0, u = c.length, d; l < u; l++) d = c[l], !s.call(e, d) && d !== n && i(e, d, {
22
+ get: ((e) => t[e]).bind(null, d),
23
+ enumerable: !(r = a(t, d)) || r.enumerable
24
+ });
25
+ return e;
26
+ }, f = (e) => s.call(e, "module.exports") ? e["module.exports"] : d(i({}, "__esModule", { value: !0 }), e), p = {
27
+ sourceTag: "v0.29.0",
28
+ contractVersion: "v1",
29
+ minimumCli: "0.21.0",
30
+ hashes: {
31
+ "coverage-v1.schema.json": "bcc79e194a2f6c1a60d5345cf4f7947913fe0fe7dcde3f31989b9d9b8cecdbc3",
32
+ "properties-v1.schema.json": "d81f1ec85abdecd1f1664ded15e081f9aecb6c0f054d6b332b71e904cf826292"
33
+ }
34
+ }, m = t(r(import.meta.url));
35
+ function h(e) {
36
+ return n(m, "schemas", e);
37
+ }
38
+ function g(t) {
39
+ return JSON.parse(e(h(t), "utf8"));
40
+ }
41
+ function _(e) {
42
+ let t = /(\d+)\.(\d+)\.(\d+)/.exec(e);
43
+ return t ? t[0] : null;
44
+ }
45
+ function v(e, t) {
46
+ let n = e.split(".").map((e) => Number.parseInt(e, 10)), r = t.split(".").map((e) => Number.parseInt(e, 10));
47
+ for (let e = 0; e < 3; e += 1) {
48
+ let t = (n[e] ?? 0) - (r[e] ?? 0);
49
+ if (t !== 0) return t;
50
+ }
51
+ return 0;
52
+ }
53
+ function y(e) {
54
+ let t = e ? _(e) : null, n = p.minimumCli;
55
+ return t === null ? {
56
+ kind: "version-premise",
57
+ found: null,
58
+ required: n,
59
+ message: `could not determine the quire CLI version (expected >= ${n}). Install or update quire-cli: the JSON contract quoin reads is only emitted from ${n} onward.`
60
+ } : v(t, n) < 0 ? {
61
+ kind: "version-premise",
62
+ found: t,
63
+ required: n,
64
+ message: `quire ${t} is older than the ${n} this contract requires. Its JSON payloads predate the published schemas (quire-rs FR-055) and the obligation records (FR-053), so quoin would misread them rather than fail. Update quire-cli.`
65
+ } : null;
66
+ }
67
+ //#endregion
68
+ //#region node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js
69
+ var b = /* @__PURE__ */ l(((e) => {
70
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0;
71
+ var t = class {};
72
+ e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
73
+ var n = class extends t {
74
+ constructor(t) {
75
+ if (super(), !e.IDENTIFIER.test(t)) throw Error("CodeGen: name must be a valid identifier");
76
+ this.str = t;
77
+ }
78
+ toString() {
79
+ return this.str;
80
+ }
81
+ emptyStr() {
82
+ return !1;
83
+ }
84
+ get names() {
85
+ return { [this.str]: 1 };
86
+ }
87
+ };
88
+ e.Name = n;
89
+ var r = class extends t {
90
+ constructor(e) {
91
+ super(), this._items = typeof e == "string" ? [e] : e;
92
+ }
93
+ toString() {
94
+ return this.str;
95
+ }
96
+ emptyStr() {
97
+ if (this._items.length > 1) return !1;
98
+ let e = this._items[0];
99
+ return e === "" || e === "\"\"";
100
+ }
101
+ get str() {
102
+ return this._str ??= this._items.reduce((e, t) => `${e}${t}`, "");
103
+ }
104
+ get names() {
105
+ return this._names ??= this._items.reduce((e, t) => (t instanceof n && (e[t.str] = (e[t.str] || 0) + 1), e), {});
106
+ }
107
+ };
108
+ e._Code = r, e.nil = new r("");
109
+ function i(e, ...t) {
110
+ let n = [e[0]], i = 0;
111
+ for (; i < t.length;) s(n, t[i]), n.push(e[++i]);
112
+ return new r(n);
113
+ }
114
+ e._ = i;
115
+ var a = new r("+");
116
+ function o(e, ...t) {
117
+ let n = [p(e[0])], i = 0;
118
+ for (; i < t.length;) n.push(a), s(n, t[i]), n.push(a, p(e[++i]));
119
+ return c(n), new r(n);
120
+ }
121
+ e.str = o;
122
+ function s(e, t) {
123
+ t instanceof r ? e.push(...t._items) : t instanceof n ? e.push(t) : e.push(d(t));
124
+ }
125
+ e.addCodeArg = s;
126
+ function c(e) {
127
+ let t = 1;
128
+ for (; t < e.length - 1;) {
129
+ if (e[t] === a) {
130
+ let n = l(e[t - 1], e[t + 1]);
131
+ if (n !== void 0) {
132
+ e.splice(t - 1, 3, n);
133
+ continue;
134
+ }
135
+ e[t++] = "+";
136
+ }
137
+ t++;
138
+ }
139
+ }
140
+ function l(e, t) {
141
+ if (t === "\"\"") return e;
142
+ if (e === "\"\"") return t;
143
+ if (typeof e == "string") return t instanceof n || e[e.length - 1] !== "\"" ? void 0 : typeof t == "string" ? t[0] === "\"" ? e.slice(0, -1) + t.slice(1) : void 0 : `${e.slice(0, -1)}${t}"`;
144
+ if (typeof t == "string" && t[0] === "\"" && !(e instanceof n)) return `"${e}${t.slice(1)}`;
145
+ }
146
+ function u(e, t) {
147
+ return t.emptyStr() ? e : e.emptyStr() ? t : o`${e}${t}`;
148
+ }
149
+ e.strConcat = u;
150
+ function d(e) {
151
+ return typeof e == "number" || typeof e == "boolean" || e === null ? e : p(Array.isArray(e) ? e.join(",") : e);
152
+ }
153
+ function f(e) {
154
+ return new r(p(e));
155
+ }
156
+ e.stringify = f;
157
+ function p(e) {
158
+ return JSON.stringify(e).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
159
+ }
160
+ e.safeStringify = p;
161
+ function m(t) {
162
+ return typeof t == "string" && e.IDENTIFIER.test(t) ? new r(`.${t}`) : i`[${t}]`;
163
+ }
164
+ e.getProperty = m;
165
+ function h(t) {
166
+ if (typeof t == "string" && e.IDENTIFIER.test(t)) return new r(`${t}`);
167
+ throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`);
168
+ }
169
+ e.getEsmExportName = h;
170
+ function g(e) {
171
+ return new r(e.toString());
172
+ }
173
+ e.regexpCode = g;
174
+ })), x = /* @__PURE__ */ l(((e) => {
175
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0;
176
+ var t = b(), n = class extends Error {
177
+ constructor(e) {
178
+ super(`CodeGen: "code" for ${e} not defined`), this.value = e.value;
179
+ }
180
+ }, r;
181
+ (function(e) {
182
+ e[e.Started = 0] = "Started", e[e.Completed = 1] = "Completed";
183
+ })(r || (e.UsedValueState = r = {})), e.varKinds = {
184
+ const: new t.Name("const"),
185
+ let: new t.Name("let"),
186
+ var: new t.Name("var")
187
+ };
188
+ var i = class {
189
+ constructor({ prefixes: e, parent: t } = {}) {
190
+ this._names = {}, this._prefixes = e, this._parent = t;
191
+ }
192
+ toName(e) {
193
+ return e instanceof t.Name ? e : this.name(e);
194
+ }
195
+ name(e) {
196
+ return new t.Name(this._newName(e));
197
+ }
198
+ _newName(e) {
199
+ let t = this._names[e] || this._nameGroup(e);
200
+ return `${e}${t.index++}`;
201
+ }
202
+ _nameGroup(e) {
203
+ if ((this._parent?._prefixes)?.has(e) || this._prefixes && !this._prefixes.has(e)) throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);
204
+ return this._names[e] = {
205
+ prefix: e,
206
+ index: 0
207
+ };
208
+ }
209
+ };
210
+ e.Scope = i;
211
+ var a = class extends t.Name {
212
+ constructor(e, t) {
213
+ super(t), this.prefix = e;
214
+ }
215
+ setValue(e, { property: n, itemIndex: r }) {
216
+ this.value = e, this.scopePath = (0, t._)`.${new t.Name(n)}[${r}]`;
217
+ }
218
+ };
219
+ e.ValueScopeName = a;
220
+ var o = (0, t._)`\n`;
221
+ e.ValueScope = class extends i {
222
+ constructor(e) {
223
+ super(e), this._values = {}, this._scope = e.scope, this.opts = {
224
+ ...e,
225
+ _n: e.lines ? o : t.nil
226
+ };
227
+ }
228
+ get() {
229
+ return this._scope;
230
+ }
231
+ name(e) {
232
+ return new a(e, this._newName(e));
233
+ }
234
+ value(e, t) {
235
+ if (t.ref === void 0) throw Error("CodeGen: ref must be passed in value");
236
+ let n = this.toName(e), { prefix: r } = n, i = t.key ?? t.ref, a = this._values[r];
237
+ if (a) {
238
+ let e = a.get(i);
239
+ if (e) return e;
240
+ } else a = this._values[r] = /* @__PURE__ */ new Map();
241
+ a.set(i, n);
242
+ let o = this._scope[r] || (this._scope[r] = []), s = o.length;
243
+ return o[s] = t.ref, n.setValue(t, {
244
+ property: r,
245
+ itemIndex: s
246
+ }), n;
247
+ }
248
+ getValue(e, t) {
249
+ let n = this._values[e];
250
+ if (n) return n.get(t);
251
+ }
252
+ scopeRefs(e, n = this._values) {
253
+ return this._reduceValues(n, (n) => {
254
+ if (n.scopePath === void 0) throw Error(`CodeGen: name "${n}" has no value`);
255
+ return (0, t._)`${e}${n.scopePath}`;
256
+ });
257
+ }
258
+ scopeCode(e = this._values, t, n) {
259
+ return this._reduceValues(e, (e) => {
260
+ if (e.value === void 0) throw Error(`CodeGen: name "${e}" has no value`);
261
+ return e.value.code;
262
+ }, t, n);
263
+ }
264
+ _reduceValues(i, a, o = {}, s) {
265
+ let c = t.nil;
266
+ for (let l in i) {
267
+ let u = i[l];
268
+ if (!u) continue;
269
+ let d = o[l] = o[l] || /* @__PURE__ */ new Map();
270
+ u.forEach((i) => {
271
+ if (d.has(i)) return;
272
+ d.set(i, r.Started);
273
+ let o = a(i);
274
+ if (o) {
275
+ let n = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
276
+ c = (0, t._)`${c}${n} ${i} = ${o};${this.opts._n}`;
277
+ } else if (o = s?.(i)) c = (0, t._)`${c}${o}${this.opts._n}`;
278
+ else throw new n(i);
279
+ d.set(i, r.Completed);
280
+ });
281
+ }
282
+ return c;
283
+ }
284
+ };
285
+ })), S = /* @__PURE__ */ l(((e) => {
286
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0;
287
+ var t = b(), n = x(), r = b();
288
+ Object.defineProperty(e, "_", {
289
+ enumerable: !0,
290
+ get: function() {
291
+ return r._;
292
+ }
293
+ }), Object.defineProperty(e, "str", {
294
+ enumerable: !0,
295
+ get: function() {
296
+ return r.str;
297
+ }
298
+ }), Object.defineProperty(e, "strConcat", {
299
+ enumerable: !0,
300
+ get: function() {
301
+ return r.strConcat;
302
+ }
303
+ }), Object.defineProperty(e, "nil", {
304
+ enumerable: !0,
305
+ get: function() {
306
+ return r.nil;
307
+ }
308
+ }), Object.defineProperty(e, "getProperty", {
309
+ enumerable: !0,
310
+ get: function() {
311
+ return r.getProperty;
312
+ }
313
+ }), Object.defineProperty(e, "stringify", {
314
+ enumerable: !0,
315
+ get: function() {
316
+ return r.stringify;
317
+ }
318
+ }), Object.defineProperty(e, "regexpCode", {
319
+ enumerable: !0,
320
+ get: function() {
321
+ return r.regexpCode;
322
+ }
323
+ }), Object.defineProperty(e, "Name", {
324
+ enumerable: !0,
325
+ get: function() {
326
+ return r.Name;
327
+ }
328
+ });
329
+ var i = x();
330
+ Object.defineProperty(e, "Scope", {
331
+ enumerable: !0,
332
+ get: function() {
333
+ return i.Scope;
334
+ }
335
+ }), Object.defineProperty(e, "ValueScope", {
336
+ enumerable: !0,
337
+ get: function() {
338
+ return i.ValueScope;
339
+ }
340
+ }), Object.defineProperty(e, "ValueScopeName", {
341
+ enumerable: !0,
342
+ get: function() {
343
+ return i.ValueScopeName;
344
+ }
345
+ }), Object.defineProperty(e, "varKinds", {
346
+ enumerable: !0,
347
+ get: function() {
348
+ return i.varKinds;
349
+ }
350
+ }), e.operators = {
351
+ GT: new t._Code(">"),
352
+ GTE: new t._Code(">="),
353
+ LT: new t._Code("<"),
354
+ LTE: new t._Code("<="),
355
+ EQ: new t._Code("==="),
356
+ NEQ: new t._Code("!=="),
357
+ NOT: new t._Code("!"),
358
+ OR: new t._Code("||"),
359
+ AND: new t._Code("&&"),
360
+ ADD: new t._Code("+")
361
+ };
362
+ var a = class {
363
+ optimizeNodes() {
364
+ return this;
365
+ }
366
+ optimizeNames(e, t) {
367
+ return this;
368
+ }
369
+ }, o = class extends a {
370
+ constructor(e, t, n) {
371
+ super(), this.varKind = e, this.name = t, this.rhs = n;
372
+ }
373
+ render({ es5: e, _n: t }) {
374
+ let r = e ? n.varKinds.var : this.varKind, i = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
375
+ return `${r} ${this.name}${i};` + t;
376
+ }
377
+ optimizeNames(e, t) {
378
+ if (e[this.name.str]) return this.rhs &&= j(this.rhs, e, t), this;
379
+ }
380
+ get names() {
381
+ return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
382
+ }
383
+ }, s = class extends a {
384
+ constructor(e, t, n) {
385
+ super(), this.lhs = e, this.rhs = t, this.sideEffects = n;
386
+ }
387
+ render({ _n: e }) {
388
+ return `${this.lhs} = ${this.rhs};` + e;
389
+ }
390
+ optimizeNames(e, n) {
391
+ if (!(this.lhs instanceof t.Name && !e[this.lhs.str] && !this.sideEffects)) return this.rhs = j(this.rhs, e, n), this;
392
+ }
393
+ get names() {
394
+ return A(this.lhs instanceof t.Name ? {} : { ...this.lhs.names }, this.rhs);
395
+ }
396
+ }, c = class extends s {
397
+ constructor(e, t, n, r) {
398
+ super(e, n, r), this.op = t;
399
+ }
400
+ render({ _n: e }) {
401
+ return `${this.lhs} ${this.op}= ${this.rhs};` + e;
402
+ }
403
+ }, l = class extends a {
404
+ constructor(e) {
405
+ super(), this.label = e, this.names = {};
406
+ }
407
+ render({ _n: e }) {
408
+ return `${this.label}:` + e;
409
+ }
410
+ }, u = class extends a {
411
+ constructor(e) {
412
+ super(), this.label = e, this.names = {};
413
+ }
414
+ render({ _n: e }) {
415
+ return `break${this.label ? ` ${this.label}` : ""};` + e;
416
+ }
417
+ }, d = class extends a {
418
+ constructor(e) {
419
+ super(), this.error = e;
420
+ }
421
+ render({ _n: e }) {
422
+ return `throw ${this.error};` + e;
423
+ }
424
+ get names() {
425
+ return this.error.names;
426
+ }
427
+ }, f = class extends a {
428
+ constructor(e) {
429
+ super(), this.code = e;
430
+ }
431
+ render({ _n: e }) {
432
+ return `${this.code};` + e;
433
+ }
434
+ optimizeNodes() {
435
+ return `${this.code}` ? this : void 0;
436
+ }
437
+ optimizeNames(e, t) {
438
+ return this.code = j(this.code, e, t), this;
439
+ }
440
+ get names() {
441
+ return this.code instanceof t._CodeOrName ? this.code.names : {};
442
+ }
443
+ }, p = class extends a {
444
+ constructor(e = []) {
445
+ super(), this.nodes = e;
446
+ }
447
+ render(e) {
448
+ return this.nodes.reduce((t, n) => t + n.render(e), "");
449
+ }
450
+ optimizeNodes() {
451
+ let { nodes: e } = this, t = e.length;
452
+ for (; t--;) {
453
+ let n = e[t].optimizeNodes();
454
+ Array.isArray(n) ? e.splice(t, 1, ...n) : n ? e[t] = n : e.splice(t, 1);
455
+ }
456
+ return e.length > 0 ? this : void 0;
457
+ }
458
+ optimizeNames(e, t) {
459
+ let { nodes: n } = this, r = n.length;
460
+ for (; r--;) {
461
+ let i = n[r];
462
+ i.optimizeNames(e, t) || (M(e, i.names), n.splice(r, 1));
463
+ }
464
+ return n.length > 0 ? this : void 0;
465
+ }
466
+ get names() {
467
+ return this.nodes.reduce((e, t) => k(e, t.names), {});
468
+ }
469
+ }, m = class extends p {
470
+ render(e) {
471
+ return "{" + e._n + super.render(e) + "}" + e._n;
472
+ }
473
+ }, h = class extends p {}, g = class extends m {};
474
+ g.kind = "else";
475
+ var _ = class e extends m {
476
+ constructor(e, t) {
477
+ super(t), this.condition = e;
478
+ }
479
+ render(e) {
480
+ let t = `if(${this.condition})` + super.render(e);
481
+ return this.else && (t += "else " + this.else.render(e)), t;
482
+ }
483
+ optimizeNodes() {
484
+ super.optimizeNodes();
485
+ let t = this.condition;
486
+ if (t === !0) return this.nodes;
487
+ let n = this.else;
488
+ if (n) {
489
+ let e = n.optimizeNodes();
490
+ n = this.else = Array.isArray(e) ? new g(e) : e;
491
+ }
492
+ if (n) return t === !1 ? n instanceof e ? n : n.nodes : this.nodes.length ? this : new e(N(t), n instanceof e ? [n] : n.nodes);
493
+ if (!(t === !1 || !this.nodes.length)) return this;
494
+ }
495
+ optimizeNames(e, t) {
496
+ if (this.else = this.else?.optimizeNames(e, t), super.optimizeNames(e, t) || this.else) return this.condition = j(this.condition, e, t), this;
497
+ }
498
+ get names() {
499
+ let e = super.names;
500
+ return A(e, this.condition), this.else && k(e, this.else.names), e;
501
+ }
502
+ };
503
+ _.kind = "if";
504
+ var v = class extends m {};
505
+ v.kind = "for";
506
+ var y = class extends v {
507
+ constructor(e) {
508
+ super(), this.iteration = e;
509
+ }
510
+ render(e) {
511
+ return `for(${this.iteration})` + super.render(e);
512
+ }
513
+ optimizeNames(e, t) {
514
+ if (super.optimizeNames(e, t)) return this.iteration = j(this.iteration, e, t), this;
515
+ }
516
+ get names() {
517
+ return k(super.names, this.iteration.names);
518
+ }
519
+ }, S = class extends v {
520
+ constructor(e, t, n, r) {
521
+ super(), this.varKind = e, this.name = t, this.from = n, this.to = r;
522
+ }
523
+ render(e) {
524
+ let t = e.es5 ? n.varKinds.var : this.varKind, { name: r, from: i, to: a } = this;
525
+ return `for(${t} ${r}=${i}; ${r}<${a}; ${r}++)` + super.render(e);
526
+ }
527
+ get names() {
528
+ return A(A(super.names, this.from), this.to);
529
+ }
530
+ }, C = class extends v {
531
+ constructor(e, t, n, r) {
532
+ super(), this.loop = e, this.varKind = t, this.name = n, this.iterable = r;
533
+ }
534
+ render(e) {
535
+ return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(e);
536
+ }
537
+ optimizeNames(e, t) {
538
+ if (super.optimizeNames(e, t)) return this.iterable = j(this.iterable, e, t), this;
539
+ }
540
+ get names() {
541
+ return k(super.names, this.iterable.names);
542
+ }
543
+ }, w = class extends m {
544
+ constructor(e, t, n) {
545
+ super(), this.name = e, this.args = t, this.async = n;
546
+ }
547
+ render(e) {
548
+ return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(e);
549
+ }
550
+ };
551
+ w.kind = "func";
552
+ var T = class extends p {
553
+ render(e) {
554
+ return "return " + super.render(e);
555
+ }
556
+ };
557
+ T.kind = "return";
558
+ var E = class extends m {
559
+ render(e) {
560
+ let t = "try" + super.render(e);
561
+ return this.catch && (t += this.catch.render(e)), this.finally && (t += this.finally.render(e)), t;
562
+ }
563
+ optimizeNodes() {
564
+ var e, t;
565
+ return super.optimizeNodes(), (e = this.catch) == null || e.optimizeNodes(), (t = this.finally) == null || t.optimizeNodes(), this;
566
+ }
567
+ optimizeNames(e, t) {
568
+ var n, r;
569
+ return super.optimizeNames(e, t), (n = this.catch) == null || n.optimizeNames(e, t), (r = this.finally) == null || r.optimizeNames(e, t), this;
570
+ }
571
+ get names() {
572
+ let e = super.names;
573
+ return this.catch && k(e, this.catch.names), this.finally && k(e, this.finally.names), e;
574
+ }
575
+ }, D = class extends m {
576
+ constructor(e) {
577
+ super(), this.error = e;
578
+ }
579
+ render(e) {
580
+ return `catch(${this.error})` + super.render(e);
581
+ }
582
+ };
583
+ D.kind = "catch";
584
+ var O = class extends m {
585
+ render(e) {
586
+ return "finally" + super.render(e);
587
+ }
588
+ };
589
+ O.kind = "finally", e.CodeGen = class {
590
+ constructor(e, t = {}) {
591
+ this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = {
592
+ ...t,
593
+ _n: t.lines ? "\n" : ""
594
+ }, this._extScope = e, this._scope = new n.Scope({ parent: e }), this._nodes = [new h()];
595
+ }
596
+ toString() {
597
+ return this._root.render(this.opts);
598
+ }
599
+ name(e) {
600
+ return this._scope.name(e);
601
+ }
602
+ scopeName(e) {
603
+ return this._extScope.name(e);
604
+ }
605
+ scopeValue(e, t) {
606
+ let n = this._extScope.value(e, t);
607
+ return (this._values[n.prefix] || (this._values[n.prefix] = /* @__PURE__ */ new Set())).add(n), n;
608
+ }
609
+ getScopeValue(e, t) {
610
+ return this._extScope.getValue(e, t);
611
+ }
612
+ scopeRefs(e) {
613
+ return this._extScope.scopeRefs(e, this._values);
614
+ }
615
+ scopeCode() {
616
+ return this._extScope.scopeCode(this._values);
617
+ }
618
+ _def(e, t, n, r) {
619
+ let i = this._scope.toName(t);
620
+ return n !== void 0 && r && (this._constants[i.str] = n), this._leafNode(new o(e, i, n)), i;
621
+ }
622
+ const(e, t, r) {
623
+ return this._def(n.varKinds.const, e, t, r);
624
+ }
625
+ let(e, t, r) {
626
+ return this._def(n.varKinds.let, e, t, r);
627
+ }
628
+ var(e, t, r) {
629
+ return this._def(n.varKinds.var, e, t, r);
630
+ }
631
+ assign(e, t, n) {
632
+ return this._leafNode(new s(e, t, n));
633
+ }
634
+ add(t, n) {
635
+ return this._leafNode(new c(t, e.operators.ADD, n));
636
+ }
637
+ code(e) {
638
+ return typeof e == "function" ? e() : e !== t.nil && this._leafNode(new f(e)), this;
639
+ }
640
+ object(...e) {
641
+ let n = ["{"];
642
+ for (let [r, i] of e) n.length > 1 && n.push(","), n.push(r), (r !== i || this.opts.es5) && (n.push(":"), (0, t.addCodeArg)(n, i));
643
+ return n.push("}"), new t._Code(n);
644
+ }
645
+ if(e, t, n) {
646
+ if (this._blockNode(new _(e)), t && n) this.code(t).else().code(n).endIf();
647
+ else if (t) this.code(t).endIf();
648
+ else if (n) throw Error("CodeGen: \"else\" body without \"then\" body");
649
+ return this;
650
+ }
651
+ elseIf(e) {
652
+ return this._elseNode(new _(e));
653
+ }
654
+ else() {
655
+ return this._elseNode(new g());
656
+ }
657
+ endIf() {
658
+ return this._endBlockNode(_, g);
659
+ }
660
+ _for(e, t) {
661
+ return this._blockNode(e), t && this.code(t).endFor(), this;
662
+ }
663
+ for(e, t) {
664
+ return this._for(new y(e), t);
665
+ }
666
+ forRange(e, t, r, i, a = this.opts.es5 ? n.varKinds.var : n.varKinds.let) {
667
+ let o = this._scope.toName(e);
668
+ return this._for(new S(a, o, t, r), () => i(o));
669
+ }
670
+ forOf(e, r, i, a = n.varKinds.const) {
671
+ let o = this._scope.toName(e);
672
+ if (this.opts.es5) {
673
+ let e = r instanceof t.Name ? r : this.var("_arr", r);
674
+ return this.forRange("_i", 0, (0, t._)`${e}.length`, (n) => {
675
+ this.var(o, (0, t._)`${e}[${n}]`), i(o);
676
+ });
677
+ }
678
+ return this._for(new C("of", a, o, r), () => i(o));
679
+ }
680
+ forIn(e, r, i, a = this.opts.es5 ? n.varKinds.var : n.varKinds.const) {
681
+ if (this.opts.ownProperties) return this.forOf(e, (0, t._)`Object.keys(${r})`, i);
682
+ let o = this._scope.toName(e);
683
+ return this._for(new C("in", a, o, r), () => i(o));
684
+ }
685
+ endFor() {
686
+ return this._endBlockNode(v);
687
+ }
688
+ label(e) {
689
+ return this._leafNode(new l(e));
690
+ }
691
+ break(e) {
692
+ return this._leafNode(new u(e));
693
+ }
694
+ return(e) {
695
+ let t = new T();
696
+ if (this._blockNode(t), this.code(e), t.nodes.length !== 1) throw Error("CodeGen: \"return\" should have one node");
697
+ return this._endBlockNode(T);
698
+ }
699
+ try(e, t, n) {
700
+ if (!t && !n) throw Error("CodeGen: \"try\" without \"catch\" and \"finally\"");
701
+ let r = new E();
702
+ if (this._blockNode(r), this.code(e), t) {
703
+ let e = this.name("e");
704
+ this._currNode = r.catch = new D(e), t(e);
705
+ }
706
+ return n && (this._currNode = r.finally = new O(), this.code(n)), this._endBlockNode(D, O);
707
+ }
708
+ throw(e) {
709
+ return this._leafNode(new d(e));
710
+ }
711
+ block(e, t) {
712
+ return this._blockStarts.push(this._nodes.length), e && this.code(e).endBlock(t), this;
713
+ }
714
+ endBlock(e) {
715
+ let t = this._blockStarts.pop();
716
+ if (t === void 0) throw Error("CodeGen: not in self-balancing block");
717
+ let n = this._nodes.length - t;
718
+ if (n < 0 || e !== void 0 && n !== e) throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);
719
+ return this._nodes.length = t, this;
720
+ }
721
+ func(e, n = t.nil, r, i) {
722
+ return this._blockNode(new w(e, n, r)), i && this.code(i).endFunc(), this;
723
+ }
724
+ endFunc() {
725
+ return this._endBlockNode(w);
726
+ }
727
+ optimize(e = 1) {
728
+ for (; e-- > 0;) this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants);
729
+ }
730
+ _leafNode(e) {
731
+ return this._currNode.nodes.push(e), this;
732
+ }
733
+ _blockNode(e) {
734
+ this._currNode.nodes.push(e), this._nodes.push(e);
735
+ }
736
+ _endBlockNode(e, t) {
737
+ let n = this._currNode;
738
+ if (n instanceof e || t && n instanceof t) return this._nodes.pop(), this;
739
+ throw Error(`CodeGen: not in block "${t ? `${e.kind}/${t.kind}` : e.kind}"`);
740
+ }
741
+ _elseNode(e) {
742
+ let t = this._currNode;
743
+ if (!(t instanceof _)) throw Error("CodeGen: \"else\" without \"if\"");
744
+ return this._currNode = t.else = e, this;
745
+ }
746
+ get _root() {
747
+ return this._nodes[0];
748
+ }
749
+ get _currNode() {
750
+ let e = this._nodes;
751
+ return e[e.length - 1];
752
+ }
753
+ set _currNode(e) {
754
+ let t = this._nodes;
755
+ t[t.length - 1] = e;
756
+ }
757
+ };
758
+ function k(e, t) {
759
+ for (let n in t) e[n] = (e[n] || 0) + (t[n] || 0);
760
+ return e;
761
+ }
762
+ function A(e, n) {
763
+ return n instanceof t._CodeOrName ? k(e, n.names) : e;
764
+ }
765
+ function j(e, n, r) {
766
+ if (e instanceof t.Name) return i(e);
767
+ if (!a(e)) return e;
768
+ return new t._Code(e._items.reduce((e, n) => (n instanceof t.Name && (n = i(n)), n instanceof t._Code ? e.push(...n._items) : e.push(n), e), []));
769
+ function i(e) {
770
+ let t = r[e.str];
771
+ return t === void 0 || n[e.str] !== 1 ? e : (delete n[e.str], t);
772
+ }
773
+ function a(e) {
774
+ return e instanceof t._Code && e._items.some((e) => e instanceof t.Name && n[e.str] === 1 && r[e.str] !== void 0);
775
+ }
776
+ }
777
+ function M(e, t) {
778
+ for (let n in t) e[n] = (e[n] || 0) - (t[n] || 0);
779
+ }
780
+ function N(e) {
781
+ return typeof e == "boolean" || typeof e == "number" || e === null ? !e : (0, t._)`!${z(e)}`;
782
+ }
783
+ e.not = N;
784
+ var P = R(e.operators.AND);
785
+ function F(...e) {
786
+ return e.reduce(P);
787
+ }
788
+ e.and = F;
789
+ var I = R(e.operators.OR);
790
+ function L(...e) {
791
+ return e.reduce(I);
792
+ }
793
+ e.or = L;
794
+ function R(e) {
795
+ return (n, r) => n === t.nil ? r : r === t.nil ? n : (0, t._)`${z(n)} ${e} ${z(r)}`;
796
+ }
797
+ function z(e) {
798
+ return e instanceof t.Name ? e : (0, t._)`(${e})`;
799
+ }
800
+ })), C = /* @__PURE__ */ l(((e) => {
801
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.checkStrictMode = e.getErrorPath = e.Type = e.useFunc = e.setEvaluated = e.evaluatedPropsToName = e.mergeEvaluated = e.eachItem = e.unescapeJsonPointer = e.escapeJsonPointer = e.escapeFragment = e.unescapeFragment = e.schemaRefOrVal = e.schemaHasRulesButRef = e.schemaHasRules = e.checkUnknownRules = e.alwaysValidSchema = e.toHash = void 0;
802
+ var t = S(), n = b();
803
+ function r(e) {
804
+ let t = {};
805
+ for (let n of e) t[n] = !0;
806
+ return t;
807
+ }
808
+ e.toHash = r;
809
+ function i(e, t) {
810
+ return typeof t == "boolean" ? t : Object.keys(t).length === 0 || (a(e, t), !o(t, e.self.RULES.all));
811
+ }
812
+ e.alwaysValidSchema = i;
813
+ function a(e, t = e.schema) {
814
+ let { opts: n, self: r } = e;
815
+ if (!n.strictSchema || typeof t == "boolean") return;
816
+ let i = r.RULES.keywords;
817
+ for (let n in t) i[n] || C(e, `unknown keyword: "${n}"`);
818
+ }
819
+ e.checkUnknownRules = a;
820
+ function o(e, t) {
821
+ if (typeof e == "boolean") return !e;
822
+ for (let n in e) if (t[n]) return !0;
823
+ return !1;
824
+ }
825
+ e.schemaHasRules = o;
826
+ function s(e, t) {
827
+ if (typeof e == "boolean") return !e;
828
+ for (let n in e) if (n !== "$ref" && t.all[n]) return !0;
829
+ return !1;
830
+ }
831
+ e.schemaHasRulesButRef = s;
832
+ function c({ topSchemaRef: e, schemaPath: n }, r, i, a) {
833
+ if (!a) {
834
+ if (typeof r == "number" || typeof r == "boolean") return r;
835
+ if (typeof r == "string") return (0, t._)`${r}`;
836
+ }
837
+ return (0, t._)`${e}${n}${(0, t.getProperty)(i)}`;
838
+ }
839
+ e.schemaRefOrVal = c;
840
+ function l(e) {
841
+ return f(decodeURIComponent(e));
842
+ }
843
+ e.unescapeFragment = l;
844
+ function u(e) {
845
+ return encodeURIComponent(d(e));
846
+ }
847
+ e.escapeFragment = u;
848
+ function d(e) {
849
+ return typeof e == "number" ? `${e}` : e.replace(/~/g, "~0").replace(/\//g, "~1");
850
+ }
851
+ e.escapeJsonPointer = d;
852
+ function f(e) {
853
+ return e.replace(/~1/g, "/").replace(/~0/g, "~");
854
+ }
855
+ e.unescapeJsonPointer = f;
856
+ function p(e, t) {
857
+ if (Array.isArray(e)) for (let n of e) t(n);
858
+ else t(e);
859
+ }
860
+ e.eachItem = p;
861
+ function m({ mergeNames: e, mergeToName: n, mergeValues: r, resultToName: i }) {
862
+ return (a, o, s, c) => {
863
+ let l = s === void 0 ? o : s instanceof t.Name ? (o instanceof t.Name ? e(a, o, s) : n(a, o, s), s) : o instanceof t.Name ? (n(a, s, o), o) : r(o, s);
864
+ return c === t.Name && !(l instanceof t.Name) ? i(a, l) : l;
865
+ };
866
+ }
867
+ e.mergeEvaluated = {
868
+ props: m({
869
+ mergeNames: (e, n, r) => e.if((0, t._)`${r} !== true && ${n} !== undefined`, () => {
870
+ e.if((0, t._)`${n} === true`, () => e.assign(r, !0), () => e.assign(r, (0, t._)`${r} || {}`).code((0, t._)`Object.assign(${r}, ${n})`));
871
+ }),
872
+ mergeToName: (e, n, r) => e.if((0, t._)`${r} !== true`, () => {
873
+ n === !0 ? e.assign(r, !0) : (e.assign(r, (0, t._)`${r} || {}`), g(e, r, n));
874
+ }),
875
+ mergeValues: (e, t) => e === !0 || {
876
+ ...e,
877
+ ...t
878
+ },
879
+ resultToName: h
880
+ }),
881
+ items: m({
882
+ mergeNames: (e, n, r) => e.if((0, t._)`${r} !== true && ${n} !== undefined`, () => e.assign(r, (0, t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),
883
+ mergeToName: (e, n, r) => e.if((0, t._)`${r} !== true`, () => e.assign(r, n === !0 || (0, t._)`${r} > ${n} ? ${r} : ${n}`)),
884
+ mergeValues: (e, t) => e === !0 || Math.max(e, t),
885
+ resultToName: (e, t) => e.var("items", t)
886
+ })
887
+ };
888
+ function h(e, n) {
889
+ if (n === !0) return e.var("props", !0);
890
+ let r = e.var("props", (0, t._)`{}`);
891
+ return n !== void 0 && g(e, r, n), r;
892
+ }
893
+ e.evaluatedPropsToName = h;
894
+ function g(e, n, r) {
895
+ Object.keys(r).forEach((r) => e.assign((0, t._)`${n}${(0, t.getProperty)(r)}`, !0));
896
+ }
897
+ e.setEvaluated = g;
898
+ var _ = {};
899
+ function v(e, t) {
900
+ return e.scopeValue("func", {
901
+ ref: t,
902
+ code: _[t.code] || (_[t.code] = new n._Code(t.code))
903
+ });
904
+ }
905
+ e.useFunc = v;
906
+ var y;
907
+ (function(e) {
908
+ e[e.Num = 0] = "Num", e[e.Str = 1] = "Str";
909
+ })(y || (e.Type = y = {}));
910
+ function x(e, n, r) {
911
+ if (e instanceof t.Name) {
912
+ let i = n === y.Num;
913
+ return r ? i ? (0, t._)`"[" + ${e} + "]"` : (0, t._)`"['" + ${e} + "']"` : i ? (0, t._)`"/" + ${e}` : (0, t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
914
+ }
915
+ return r ? (0, t.getProperty)(e).toString() : "/" + d(e);
916
+ }
917
+ e.getErrorPath = x;
918
+ function C(e, t, n = e.opts.strictSchema) {
919
+ if (n) {
920
+ if (t = `strict mode: ${t}`, n === !0) throw Error(t);
921
+ e.self.logger.warn(t);
922
+ }
923
+ }
924
+ e.checkStrictMode = C;
925
+ })), w = /* @__PURE__ */ l(((e) => {
926
+ Object.defineProperty(e, "__esModule", { value: !0 });
927
+ var t = S();
928
+ e.default = {
929
+ data: new t.Name("data"),
930
+ valCxt: new t.Name("valCxt"),
931
+ instancePath: new t.Name("instancePath"),
932
+ parentData: new t.Name("parentData"),
933
+ parentDataProperty: new t.Name("parentDataProperty"),
934
+ rootData: new t.Name("rootData"),
935
+ dynamicAnchors: new t.Name("dynamicAnchors"),
936
+ vErrors: new t.Name("vErrors"),
937
+ errors: new t.Name("errors"),
938
+ this: new t.Name("this"),
939
+ self: new t.Name("self"),
940
+ scope: new t.Name("scope"),
941
+ json: new t.Name("json"),
942
+ jsonPos: new t.Name("jsonPos"),
943
+ jsonLen: new t.Name("jsonLen"),
944
+ jsonPart: new t.Name("jsonPart")
945
+ };
946
+ })), T = /* @__PURE__ */ l(((e) => {
947
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
948
+ var t = S(), n = C(), r = w();
949
+ e.keywordError = { message: ({ keyword: e }) => (0, t.str)`must pass "${e}" keyword validation` }, e.keyword$DataError = { message: ({ keyword: e, schemaType: n }) => n ? (0, t.str)`"${e}" keyword must be ${n} ($data)` : (0, t.str)`"${e}" keyword is invalid ($data)` };
950
+ function i(n, r = e.keywordError, i, a) {
951
+ let { it: o } = n, { gen: s, compositeRule: u, allErrors: f } = o, p = d(n, r, i);
952
+ a ?? (u || f) ? c(s, p) : l(o, (0, t._)`[${p}]`);
953
+ }
954
+ e.reportError = i;
955
+ function a(t, n = e.keywordError, i) {
956
+ let { it: a } = t, { gen: o, compositeRule: s, allErrors: u } = a;
957
+ c(o, d(t, n, i)), s || u || l(a, r.default.vErrors);
958
+ }
959
+ e.reportExtraError = a;
960
+ function o(e, n) {
961
+ e.assign(r.default.errors, n), e.if((0, t._)`${r.default.vErrors} !== null`, () => e.if(n, () => e.assign((0, t._)`${r.default.vErrors}.length`, n), () => e.assign(r.default.vErrors, null)));
962
+ }
963
+ e.resetErrorsCount = o;
964
+ function s({ gen: e, keyword: n, schemaValue: i, data: a, errsCount: o, it: s }) {
965
+ /* istanbul ignore if */
966
+ if (o === void 0) throw Error("ajv implementation error");
967
+ let c = e.name("err");
968
+ e.forRange("i", o, r.default.errors, (o) => {
969
+ e.const(c, (0, t._)`${r.default.vErrors}[${o}]`), e.if((0, t._)`${c}.instancePath === undefined`, () => e.assign((0, t._)`${c}.instancePath`, (0, t.strConcat)(r.default.instancePath, s.errorPath))), e.assign((0, t._)`${c}.schemaPath`, (0, t.str)`${s.errSchemaPath}/${n}`), s.opts.verbose && (e.assign((0, t._)`${c}.schema`, i), e.assign((0, t._)`${c}.data`, a));
970
+ });
971
+ }
972
+ e.extendErrors = s;
973
+ function c(e, n) {
974
+ let i = e.const("err", n);
975
+ e.if((0, t._)`${r.default.vErrors} === null`, () => e.assign(r.default.vErrors, (0, t._)`[${i}]`), (0, t._)`${r.default.vErrors}.push(${i})`), e.code((0, t._)`${r.default.errors}++`);
976
+ }
977
+ function l(e, n) {
978
+ let { gen: r, validateName: i, schemaEnv: a } = e;
979
+ a.$async ? r.throw((0, t._)`new ${e.ValidationError}(${n})`) : (r.assign((0, t._)`${i}.errors`, n), r.return(!1));
980
+ }
981
+ var u = {
982
+ keyword: new t.Name("keyword"),
983
+ schemaPath: new t.Name("schemaPath"),
984
+ params: new t.Name("params"),
985
+ propertyName: new t.Name("propertyName"),
986
+ message: new t.Name("message"),
987
+ schema: new t.Name("schema"),
988
+ parentSchema: new t.Name("parentSchema")
989
+ };
990
+ function d(e, n, r) {
991
+ let { createErrors: i } = e.it;
992
+ return i === !1 ? (0, t._)`{}` : f(e, n, r);
993
+ }
994
+ function f(e, t, n = {}) {
995
+ let { gen: r, it: i } = e, a = [p(i, n), m(e, n)];
996
+ return h(e, t, a), r.object(...a);
997
+ }
998
+ function p({ errorPath: e }, { instancePath: i }) {
999
+ let a = i ? (0, t.str)`${e}${(0, n.getErrorPath)(i, n.Type.Str)}` : e;
1000
+ return [r.default.instancePath, (0, t.strConcat)(r.default.instancePath, a)];
1001
+ }
1002
+ function m({ keyword: e, it: { errSchemaPath: r } }, { schemaPath: i, parentSchema: a }) {
1003
+ let o = a ? r : (0, t.str)`${r}/${e}`;
1004
+ return i && (o = (0, t.str)`${o}${(0, n.getErrorPath)(i, n.Type.Str)}`), [u.schemaPath, o];
1005
+ }
1006
+ function h(e, { params: n, message: i }, a) {
1007
+ let { keyword: o, data: s, schemaValue: c, it: l } = e, { opts: d, propertyName: f, topSchemaRef: p, schemaPath: m } = l;
1008
+ a.push([u.keyword, o], [u.params, typeof n == "function" ? n(e) : n || (0, t._)`{}`]), d.messages && a.push([u.message, typeof i == "function" ? i(e) : i]), d.verbose && a.push([u.schema, c], [u.parentSchema, (0, t._)`${p}${m}`], [r.default.data, s]), f && a.push([u.propertyName, f]);
1009
+ }
1010
+ })), E = /* @__PURE__ */ l(((e) => {
1011
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.boolOrEmptySchema = e.topBoolOrEmptySchema = void 0;
1012
+ var t = T(), n = S(), r = w(), i = { message: "boolean schema is false" };
1013
+ function a(e) {
1014
+ let { gen: t, schema: i, validateName: a } = e;
1015
+ i === !1 ? s(e, !1) : typeof i == "object" && i.$async === !0 ? t.return(r.default.data) : (t.assign((0, n._)`${a}.errors`, null), t.return(!0));
1016
+ }
1017
+ e.topBoolOrEmptySchema = a;
1018
+ function o(e, t) {
1019
+ let { gen: n, schema: r } = e;
1020
+ r === !1 ? (n.var(t, !1), s(e)) : n.var(t, !0);
1021
+ }
1022
+ e.boolOrEmptySchema = o;
1023
+ function s(e, n) {
1024
+ let { gen: r, data: a } = e, o = {
1025
+ gen: r,
1026
+ keyword: "false schema",
1027
+ data: a,
1028
+ schema: !1,
1029
+ schemaCode: !1,
1030
+ schemaValue: !1,
1031
+ params: {},
1032
+ it: e
1033
+ };
1034
+ (0, t.reportError)(o, i, void 0, n);
1035
+ }
1036
+ })), D = /* @__PURE__ */ l(((e) => {
1037
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.getRules = e.isJSONType = void 0;
1038
+ var t = /* @__PURE__ */ new Set([
1039
+ "string",
1040
+ "number",
1041
+ "integer",
1042
+ "boolean",
1043
+ "null",
1044
+ "object",
1045
+ "array"
1046
+ ]);
1047
+ function n(e) {
1048
+ return typeof e == "string" && t.has(e);
1049
+ }
1050
+ e.isJSONType = n;
1051
+ function r() {
1052
+ let e = {
1053
+ number: {
1054
+ type: "number",
1055
+ rules: []
1056
+ },
1057
+ string: {
1058
+ type: "string",
1059
+ rules: []
1060
+ },
1061
+ array: {
1062
+ type: "array",
1063
+ rules: []
1064
+ },
1065
+ object: {
1066
+ type: "object",
1067
+ rules: []
1068
+ }
1069
+ };
1070
+ return {
1071
+ types: {
1072
+ ...e,
1073
+ integer: !0,
1074
+ boolean: !0,
1075
+ null: !0
1076
+ },
1077
+ rules: [
1078
+ { rules: [] },
1079
+ e.number,
1080
+ e.string,
1081
+ e.array,
1082
+ e.object
1083
+ ],
1084
+ post: { rules: [] },
1085
+ all: {},
1086
+ keywords: {}
1087
+ };
1088
+ }
1089
+ e.getRules = r;
1090
+ })), O = /* @__PURE__ */ l(((e) => {
1091
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.shouldUseRule = e.shouldUseGroup = e.schemaHasRulesForType = void 0;
1092
+ function t({ schema: e, self: t }, r) {
1093
+ let i = t.RULES.types[r];
1094
+ return i && i !== !0 && n(e, i);
1095
+ }
1096
+ e.schemaHasRulesForType = t;
1097
+ function n(e, t) {
1098
+ return t.rules.some((t) => r(e, t));
1099
+ }
1100
+ e.shouldUseGroup = n;
1101
+ function r(e, t) {
1102
+ return e[t.keyword] !== void 0 || t.definition.implements?.some((t) => e[t] !== void 0);
1103
+ }
1104
+ e.shouldUseRule = r;
1105
+ })), k = /* @__PURE__ */ l(((e) => {
1106
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.reportTypeError = e.checkDataTypes = e.checkDataType = e.coerceAndCheckDataType = e.getJSONTypes = e.getSchemaTypes = e.DataType = void 0;
1107
+ var t = D(), n = O(), r = T(), i = S(), a = C(), o;
1108
+ (function(e) {
1109
+ e[e.Correct = 0] = "Correct", e[e.Wrong = 1] = "Wrong";
1110
+ })(o || (e.DataType = o = {}));
1111
+ function s(e) {
1112
+ let t = c(e.type);
1113
+ if (t.includes("null")) {
1114
+ if (e.nullable === !1) throw Error("type: null contradicts nullable: false");
1115
+ } else {
1116
+ if (!t.length && e.nullable !== void 0) throw Error("\"nullable\" cannot be used without \"type\"");
1117
+ e.nullable === !0 && t.push("null");
1118
+ }
1119
+ return t;
1120
+ }
1121
+ e.getSchemaTypes = s;
1122
+ function c(e) {
1123
+ let n = Array.isArray(e) ? e : e ? [e] : [];
1124
+ if (n.every(t.isJSONType)) return n;
1125
+ throw Error("type must be JSONType or JSONType[]: " + n.join(","));
1126
+ }
1127
+ e.getJSONTypes = c;
1128
+ function l(e, t) {
1129
+ let { gen: r, data: i, opts: a } = e, s = d(t, a.coerceTypes), c = t.length > 0 && !(s.length === 0 && t.length === 1 && (0, n.schemaHasRulesForType)(e, t[0]));
1130
+ if (c) {
1131
+ let n = h(t, i, a.strictNumbers, o.Wrong);
1132
+ r.if(n, () => {
1133
+ s.length ? f(e, t, s) : _(e);
1134
+ });
1135
+ }
1136
+ return c;
1137
+ }
1138
+ e.coerceAndCheckDataType = l;
1139
+ var u = /* @__PURE__ */ new Set([
1140
+ "string",
1141
+ "number",
1142
+ "integer",
1143
+ "boolean",
1144
+ "null"
1145
+ ]);
1146
+ function d(e, t) {
1147
+ return t ? e.filter((e) => u.has(e) || t === "array" && e === "array") : [];
1148
+ }
1149
+ function f(e, t, n) {
1150
+ let { gen: r, data: a, opts: o } = e, s = r.let("dataType", (0, i._)`typeof ${a}`), c = r.let("coerced", (0, i._)`undefined`);
1151
+ o.coerceTypes === "array" && r.if((0, i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`, () => r.assign(a, (0, i._)`${a}[0]`).assign(s, (0, i._)`typeof ${a}`).if(h(t, a, o.strictNumbers), () => r.assign(c, a))), r.if((0, i._)`${c} !== undefined`);
1152
+ for (let e of n) (u.has(e) || e === "array" && o.coerceTypes === "array") && l(e);
1153
+ r.else(), _(e), r.endIf(), r.if((0, i._)`${c} !== undefined`, () => {
1154
+ r.assign(a, c), p(e, c);
1155
+ });
1156
+ function l(e) {
1157
+ switch (e) {
1158
+ case "string":
1159
+ r.elseIf((0, i._)`${s} == "number" || ${s} == "boolean"`).assign(c, (0, i._)`"" + ${a}`).elseIf((0, i._)`${a} === null`).assign(c, (0, i._)`""`);
1160
+ return;
1161
+ case "number":
1162
+ r.elseIf((0, i._)`${s} == "boolean" || ${a} === null
1163
+ || (${s} == "string" && ${a} && ${a} == +${a})`).assign(c, (0, i._)`+${a}`);
1164
+ return;
1165
+ case "integer":
1166
+ r.elseIf((0, i._)`${s} === "boolean" || ${a} === null
1167
+ || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c, (0, i._)`+${a}`);
1168
+ return;
1169
+ case "boolean":
1170
+ r.elseIf((0, i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c, !1).elseIf((0, i._)`${a} === "true" || ${a} === 1`).assign(c, !0);
1171
+ return;
1172
+ case "null":
1173
+ r.elseIf((0, i._)`${a} === "" || ${a} === 0 || ${a} === false`), r.assign(c, null);
1174
+ return;
1175
+ case "array": r.elseIf((0, i._)`${s} === "string" || ${s} === "number"
1176
+ || ${s} === "boolean" || ${a} === null`).assign(c, (0, i._)`[${a}]`);
1177
+ }
1178
+ }
1179
+ }
1180
+ function p({ gen: e, parentData: t, parentDataProperty: n }, r) {
1181
+ e.if((0, i._)`${t} !== undefined`, () => e.assign((0, i._)`${t}[${n}]`, r));
1182
+ }
1183
+ function m(e, t, n, r = o.Correct) {
1184
+ let a = r === o.Correct ? i.operators.EQ : i.operators.NEQ, s;
1185
+ switch (e) {
1186
+ case "null": return (0, i._)`${t} ${a} null`;
1187
+ case "array":
1188
+ s = (0, i._)`Array.isArray(${t})`;
1189
+ break;
1190
+ case "object":
1191
+ s = (0, i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;
1192
+ break;
1193
+ case "integer":
1194
+ s = c((0, i._)`!(${t} % 1) && !isNaN(${t})`);
1195
+ break;
1196
+ case "number":
1197
+ s = c();
1198
+ break;
1199
+ default: return (0, i._)`typeof ${t} ${a} ${e}`;
1200
+ }
1201
+ return r === o.Correct ? s : (0, i.not)(s);
1202
+ function c(e = i.nil) {
1203
+ return (0, i.and)((0, i._)`typeof ${t} == "number"`, e, n ? (0, i._)`isFinite(${t})` : i.nil);
1204
+ }
1205
+ }
1206
+ e.checkDataType = m;
1207
+ function h(e, t, n, r) {
1208
+ if (e.length === 1) return m(e[0], t, n, r);
1209
+ let o, s = (0, a.toHash)(e);
1210
+ if (s.array && s.object) {
1211
+ let e = (0, i._)`typeof ${t} != "object"`;
1212
+ o = s.null ? e : (0, i._)`!${t} || ${e}`, delete s.null, delete s.array, delete s.object;
1213
+ } else o = i.nil;
1214
+ s.number && delete s.integer;
1215
+ for (let e in s) o = (0, i.and)(o, m(e, t, n, r));
1216
+ return o;
1217
+ }
1218
+ e.checkDataTypes = h;
1219
+ var g = {
1220
+ message: ({ schema: e }) => `must be ${e}`,
1221
+ params: ({ schema: e, schemaValue: t }) => typeof e == "string" ? (0, i._)`{type: ${e}}` : (0, i._)`{type: ${t}}`
1222
+ };
1223
+ function _(e) {
1224
+ let t = v(e);
1225
+ (0, r.reportError)(t, g);
1226
+ }
1227
+ e.reportTypeError = _;
1228
+ function v(e) {
1229
+ let { gen: t, data: n, schema: r } = e, i = (0, a.schemaRefOrVal)(e, r, "type");
1230
+ return {
1231
+ gen: t,
1232
+ keyword: "type",
1233
+ data: n,
1234
+ schema: r.type,
1235
+ schemaCode: i,
1236
+ schemaValue: i,
1237
+ parentSchema: r,
1238
+ params: {},
1239
+ it: e
1240
+ };
1241
+ }
1242
+ })), A = /* @__PURE__ */ l(((e) => {
1243
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.assignDefaults = void 0;
1244
+ var t = S(), n = C();
1245
+ function r(e, t) {
1246
+ let { properties: n, items: r } = e.schema;
1247
+ if (t === "object" && n) for (let t in n) i(e, t, n[t].default);
1248
+ else t === "array" && Array.isArray(r) && r.forEach((t, n) => i(e, n, t.default));
1249
+ }
1250
+ e.assignDefaults = r;
1251
+ function i(e, r, i) {
1252
+ let { gen: a, compositeRule: o, data: s, opts: c } = e;
1253
+ if (i === void 0) return;
1254
+ let l = (0, t._)`${s}${(0, t.getProperty)(r)}`;
1255
+ if (o) {
1256
+ (0, n.checkStrictMode)(e, `default is ignored for: ${l}`);
1257
+ return;
1258
+ }
1259
+ let u = (0, t._)`${l} === undefined`;
1260
+ c.useDefaults === "empty" && (u = (0, t._)`${u} || ${l} === null || ${l} === ""`), a.if(u, (0, t._)`${l} = ${(0, t.stringify)(i)}`);
1261
+ }
1262
+ })), j = /* @__PURE__ */ l(((e) => {
1263
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateUnion = e.validateArray = e.usePattern = e.callValidateCode = e.schemaProperties = e.allSchemaProperties = e.noPropertyInData = e.propertyInData = e.isOwnProperty = e.hasPropFunc = e.reportMissingProp = e.checkMissingProp = e.checkReportMissingProp = void 0;
1264
+ var t = S(), n = C(), r = w(), i = C();
1265
+ function a(e, n) {
1266
+ let { gen: r, data: i, it: a } = e;
1267
+ r.if(d(r, i, n, a.opts.ownProperties), () => {
1268
+ e.setParams({ missingProperty: (0, t._)`${n}` }, !0), e.error();
1269
+ });
1270
+ }
1271
+ e.checkReportMissingProp = a;
1272
+ function o({ gen: e, data: n, it: { opts: r } }, i, a) {
1273
+ return (0, t.or)(...i.map((i) => (0, t.and)(d(e, n, i, r.ownProperties), (0, t._)`${a} = ${i}`)));
1274
+ }
1275
+ e.checkMissingProp = o;
1276
+ function s(e, t) {
1277
+ e.setParams({ missingProperty: t }, !0), e.error();
1278
+ }
1279
+ e.reportMissingProp = s;
1280
+ function c(e) {
1281
+ return e.scopeValue("func", {
1282
+ ref: Object.prototype.hasOwnProperty,
1283
+ code: (0, t._)`Object.prototype.hasOwnProperty`
1284
+ });
1285
+ }
1286
+ e.hasPropFunc = c;
1287
+ function l(e, n, r) {
1288
+ return (0, t._)`${c(e)}.call(${n}, ${r})`;
1289
+ }
1290
+ e.isOwnProperty = l;
1291
+ function u(e, n, r, i) {
1292
+ let a = (0, t._)`${n}${(0, t.getProperty)(r)} !== undefined`;
1293
+ return i ? (0, t._)`${a} && ${l(e, n, r)}` : a;
1294
+ }
1295
+ e.propertyInData = u;
1296
+ function d(e, n, r, i) {
1297
+ let a = (0, t._)`${n}${(0, t.getProperty)(r)} === undefined`;
1298
+ return i ? (0, t.or)(a, (0, t.not)(l(e, n, r))) : a;
1299
+ }
1300
+ e.noPropertyInData = d;
1301
+ function f(e) {
1302
+ return e ? Object.keys(e).filter((e) => e !== "__proto__") : [];
1303
+ }
1304
+ e.allSchemaProperties = f;
1305
+ function p(e, t) {
1306
+ return f(t).filter((r) => !(0, n.alwaysValidSchema)(e, t[r]));
1307
+ }
1308
+ e.schemaProperties = p;
1309
+ function m({ schemaCode: e, data: n, it: { gen: i, topSchemaRef: a, schemaPath: o, errorPath: s }, it: c }, l, u, d) {
1310
+ let f = d ? (0, t._)`${e}, ${n}, ${a}${o}` : n, p = [
1311
+ [r.default.instancePath, (0, t.strConcat)(r.default.instancePath, s)],
1312
+ [r.default.parentData, c.parentData],
1313
+ [r.default.parentDataProperty, c.parentDataProperty],
1314
+ [r.default.rootData, r.default.rootData]
1315
+ ];
1316
+ c.opts.dynamicRef && p.push([r.default.dynamicAnchors, r.default.dynamicAnchors]);
1317
+ let m = (0, t._)`${f}, ${i.object(...p)}`;
1318
+ return u === t.nil ? (0, t._)`${l}(${m})` : (0, t._)`${l}.call(${u}, ${m})`;
1319
+ }
1320
+ e.callValidateCode = m;
1321
+ var h = (0, t._)`new RegExp`;
1322
+ function g({ gen: e, it: { opts: n } }, r) {
1323
+ let a = n.unicodeRegExp ? "u" : "", { regExp: o } = n.code, s = o(r, a);
1324
+ return e.scopeValue("pattern", {
1325
+ key: s.toString(),
1326
+ ref: s,
1327
+ code: (0, t._)`${o.code === "new RegExp" ? h : (0, i.useFunc)(e, o)}(${r}, ${a})`
1328
+ });
1329
+ }
1330
+ e.usePattern = g;
1331
+ function _(e) {
1332
+ let { gen: r, data: i, keyword: a, it: o } = e, s = r.name("valid");
1333
+ if (o.allErrors) {
1334
+ let e = r.let("valid", !0);
1335
+ return c(() => r.assign(e, !1)), e;
1336
+ }
1337
+ return r.var(s, !0), c(() => r.break()), s;
1338
+ function c(o) {
1339
+ let c = r.const("len", (0, t._)`${i}.length`);
1340
+ r.forRange("i", 0, c, (i) => {
1341
+ e.subschema({
1342
+ keyword: a,
1343
+ dataProp: i,
1344
+ dataPropType: n.Type.Num
1345
+ }, s), r.if((0, t.not)(s), o);
1346
+ });
1347
+ }
1348
+ }
1349
+ e.validateArray = _;
1350
+ function v(e) {
1351
+ let { gen: r, schema: i, keyword: a, it: o } = e;
1352
+ /* istanbul ignore if */
1353
+ if (!Array.isArray(i)) throw Error("ajv implementation error");
1354
+ if (i.some((e) => (0, n.alwaysValidSchema)(o, e)) && !o.opts.unevaluated) return;
1355
+ let s = r.let("valid", !1), c = r.name("_valid");
1356
+ r.block(() => i.forEach((n, i) => {
1357
+ let o = e.subschema({
1358
+ keyword: a,
1359
+ schemaProp: i,
1360
+ compositeRule: !0
1361
+ }, c);
1362
+ r.assign(s, (0, t._)`${s} || ${c}`), e.mergeValidEvaluated(o, c) || r.if((0, t.not)(s));
1363
+ })), e.result(s, () => e.reset(), () => e.error(!0));
1364
+ }
1365
+ e.validateUnion = v;
1366
+ })), M = /* @__PURE__ */ l(((e) => {
1367
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateKeywordUsage = e.validSchemaType = e.funcKeywordCode = e.macroKeywordCode = void 0;
1368
+ var t = S(), n = w(), r = j(), i = T();
1369
+ function a(e, n) {
1370
+ let { gen: r, keyword: i, schema: a, parentSchema: o, it: s } = e, c = n.macro.call(s.self, a, o, s), l = u(r, i, c);
1371
+ s.opts.validateSchema !== !1 && s.self.validateSchema(c, !0);
1372
+ let d = r.name("valid");
1373
+ e.subschema({
1374
+ schema: c,
1375
+ schemaPath: t.nil,
1376
+ errSchemaPath: `${s.errSchemaPath}/${i}`,
1377
+ topSchemaRef: l,
1378
+ compositeRule: !0
1379
+ }, d), e.pass(d, () => e.error(!0));
1380
+ }
1381
+ e.macroKeywordCode = a;
1382
+ function o(e, i) {
1383
+ let { gen: a, keyword: o, schema: d, parentSchema: f, $data: p, it: m } = e;
1384
+ l(m, i);
1385
+ let h = u(a, o, !p && i.compile ? i.compile.call(m.self, d, f, m) : i.validate), g = a.let("valid");
1386
+ e.block$data(g, _), e.ok(i.valid ?? g);
1387
+ function _() {
1388
+ if (i.errors === !1) b(), i.modifying && s(e), x(() => e.error());
1389
+ else {
1390
+ let t = i.async ? v() : y();
1391
+ i.modifying && s(e), x(() => c(e, t));
1392
+ }
1393
+ }
1394
+ function v() {
1395
+ let e = a.let("ruleErrs", null);
1396
+ return a.try(() => b((0, t._)`await `), (n) => a.assign(g, !1).if((0, t._)`${n} instanceof ${m.ValidationError}`, () => a.assign(e, (0, t._)`${n}.errors`), () => a.throw(n))), e;
1397
+ }
1398
+ function y() {
1399
+ let e = (0, t._)`${h}.errors`;
1400
+ return a.assign(e, null), b(t.nil), e;
1401
+ }
1402
+ function b(o = i.async ? (0, t._)`await ` : t.nil) {
1403
+ let s = m.opts.passContext ? n.default.this : n.default.self, c = !("compile" in i && !p || i.schema === !1);
1404
+ a.assign(g, (0, t._)`${o}${(0, r.callValidateCode)(e, h, s, c)}`, i.modifying);
1405
+ }
1406
+ function x(e) {
1407
+ a.if((0, t.not)(i.valid ?? g), e);
1408
+ }
1409
+ }
1410
+ e.funcKeywordCode = o;
1411
+ function s(e) {
1412
+ let { gen: n, data: r, it: i } = e;
1413
+ n.if(i.parentData, () => n.assign(r, (0, t._)`${i.parentData}[${i.parentDataProperty}]`));
1414
+ }
1415
+ function c(e, r) {
1416
+ let { gen: a } = e;
1417
+ a.if((0, t._)`Array.isArray(${r})`, () => {
1418
+ a.assign(n.default.vErrors, (0, t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors, (0, t._)`${n.default.vErrors}.length`), (0, i.extendErrors)(e);
1419
+ }, () => e.error());
1420
+ }
1421
+ function l({ schemaEnv: e }, t) {
1422
+ if (t.async && !e.$async) throw Error("async keyword in sync schema");
1423
+ }
1424
+ function u(e, n, r) {
1425
+ if (r === void 0) throw Error(`keyword "${n}" failed to compile`);
1426
+ return e.scopeValue("keyword", typeof r == "function" ? { ref: r } : {
1427
+ ref: r,
1428
+ code: (0, t.stringify)(r)
1429
+ });
1430
+ }
1431
+ function d(e, t, n = !1) {
1432
+ return !t.length || t.some((t) => t === "array" ? Array.isArray(e) : t === "object" ? e && typeof e == "object" && !Array.isArray(e) : typeof e == t || n && e === void 0);
1433
+ }
1434
+ e.validSchemaType = d;
1435
+ function f({ schema: e, opts: t, self: n, errSchemaPath: r }, i, a) {
1436
+ /* istanbul ignore if */
1437
+ if (Array.isArray(i.keyword) ? !i.keyword.includes(a) : i.keyword !== a) throw Error("ajv implementation error");
1438
+ let o = i.dependencies;
1439
+ if (o?.some((t) => !Object.prototype.hasOwnProperty.call(e, t))) throw Error(`parent schema must have dependencies of ${a}: ${o.join(",")}`);
1440
+ if (i.validateSchema && !i.validateSchema(e[a])) {
1441
+ let e = `keyword "${a}" value is invalid at path "${r}": ` + n.errorsText(i.validateSchema.errors);
1442
+ if (t.validateSchema === "log") n.logger.error(e);
1443
+ else throw Error(e);
1444
+ }
1445
+ }
1446
+ e.validateKeywordUsage = f;
1447
+ })), N = /* @__PURE__ */ l(((e) => {
1448
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.extendSubschemaMode = e.extendSubschemaData = e.getSubschema = void 0;
1449
+ var t = S(), n = C();
1450
+ function r(e, { keyword: r, schemaProp: i, schema: a, schemaPath: o, errSchemaPath: s, topSchemaRef: c }) {
1451
+ if (r !== void 0 && a !== void 0) throw Error("both \"keyword\" and \"schema\" passed, only one allowed");
1452
+ if (r !== void 0) {
1453
+ let a = e.schema[r];
1454
+ return i === void 0 ? {
1455
+ schema: a,
1456
+ schemaPath: (0, t._)`${e.schemaPath}${(0, t.getProperty)(r)}`,
1457
+ errSchemaPath: `${e.errSchemaPath}/${r}`
1458
+ } : {
1459
+ schema: a[i],
1460
+ schemaPath: (0, t._)`${e.schemaPath}${(0, t.getProperty)(r)}${(0, t.getProperty)(i)}`,
1461
+ errSchemaPath: `${e.errSchemaPath}/${r}/${(0, n.escapeFragment)(i)}`
1462
+ };
1463
+ }
1464
+ if (a !== void 0) {
1465
+ if (o === void 0 || s === void 0 || c === void 0) throw Error("\"schemaPath\", \"errSchemaPath\" and \"topSchemaRef\" are required with \"schema\"");
1466
+ return {
1467
+ schema: a,
1468
+ schemaPath: o,
1469
+ topSchemaRef: c,
1470
+ errSchemaPath: s
1471
+ };
1472
+ }
1473
+ throw Error("either \"keyword\" or \"schema\" must be passed");
1474
+ }
1475
+ e.getSubschema = r;
1476
+ function i(e, r, { dataProp: i, dataPropType: a, data: o, dataTypes: s, propertyName: c }) {
1477
+ if (o !== void 0 && i !== void 0) throw Error("both \"data\" and \"dataProp\" passed, only one allowed");
1478
+ let { gen: l } = r;
1479
+ if (i !== void 0) {
1480
+ let { errorPath: o, dataPathArr: s, opts: c } = r;
1481
+ u(l.let("data", (0, t._)`${r.data}${(0, t.getProperty)(i)}`, !0)), e.errorPath = (0, t.str)`${o}${(0, n.getErrorPath)(i, a, c.jsPropertySyntax)}`, e.parentDataProperty = (0, t._)`${i}`, e.dataPathArr = [...s, e.parentDataProperty];
1482
+ }
1483
+ o !== void 0 && (u(o instanceof t.Name ? o : l.let("data", o, !0)), c !== void 0 && (e.propertyName = c)), s && (e.dataTypes = s);
1484
+ function u(t) {
1485
+ e.data = t, e.dataLevel = r.dataLevel + 1, e.dataTypes = [], r.definedProperties = /* @__PURE__ */ new Set(), e.parentData = r.data, e.dataNames = [...r.dataNames, t];
1486
+ }
1487
+ }
1488
+ e.extendSubschemaData = i;
1489
+ function a(e, { jtdDiscriminator: t, jtdMetadata: n, compositeRule: r, createErrors: i, allErrors: a }) {
1490
+ r !== void 0 && (e.compositeRule = r), i !== void 0 && (e.createErrors = i), a !== void 0 && (e.allErrors = a), e.jtdDiscriminator = t, e.jtdMetadata = n;
1491
+ }
1492
+ e.extendSubschemaMode = a;
1493
+ })), P = /* @__PURE__ */ l(((e, t) => {
1494
+ t.exports = function e(t, n) {
1495
+ if (t === n) return !0;
1496
+ if (t && n && typeof t == "object" && typeof n == "object") {
1497
+ if (t.constructor !== n.constructor) return !1;
1498
+ var r, i, a;
1499
+ if (Array.isArray(t)) {
1500
+ if (r = t.length, r != n.length) return !1;
1501
+ for (i = r; i-- !== 0;) if (!e(t[i], n[i])) return !1;
1502
+ return !0;
1503
+ }
1504
+ if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
1505
+ if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
1506
+ if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
1507
+ if (a = Object.keys(t), r = a.length, r !== Object.keys(n).length) return !1;
1508
+ for (i = r; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(n, a[i])) return !1;
1509
+ for (i = r; i-- !== 0;) {
1510
+ var o = a[i];
1511
+ if (!e(t[o], n[o])) return !1;
1512
+ }
1513
+ return !0;
1514
+ }
1515
+ return t !== t && n !== n;
1516
+ };
1517
+ })), F = /* @__PURE__ */ l(((e, t) => {
1518
+ var n = t.exports = function(e, t, n) {
1519
+ typeof t == "function" && (n = t, t = {}), n = t.cb || n;
1520
+ var i = typeof n == "function" ? n : n.pre || function() {}, a = n.post || function() {};
1521
+ r(t, i, a, e, "", e);
1522
+ };
1523
+ n.keywords = {
1524
+ additionalItems: !0,
1525
+ items: !0,
1526
+ contains: !0,
1527
+ additionalProperties: !0,
1528
+ propertyNames: !0,
1529
+ not: !0,
1530
+ if: !0,
1531
+ then: !0,
1532
+ else: !0
1533
+ }, n.arrayKeywords = {
1534
+ items: !0,
1535
+ allOf: !0,
1536
+ anyOf: !0,
1537
+ oneOf: !0
1538
+ }, n.propsKeywords = {
1539
+ $defs: !0,
1540
+ definitions: !0,
1541
+ properties: !0,
1542
+ patternProperties: !0,
1543
+ dependencies: !0
1544
+ }, n.skipKeywords = {
1545
+ default: !0,
1546
+ enum: !0,
1547
+ const: !0,
1548
+ required: !0,
1549
+ maximum: !0,
1550
+ minimum: !0,
1551
+ exclusiveMaximum: !0,
1552
+ exclusiveMinimum: !0,
1553
+ multipleOf: !0,
1554
+ maxLength: !0,
1555
+ minLength: !0,
1556
+ pattern: !0,
1557
+ format: !0,
1558
+ maxItems: !0,
1559
+ minItems: !0,
1560
+ uniqueItems: !0,
1561
+ maxProperties: !0,
1562
+ minProperties: !0
1563
+ };
1564
+ function r(e, t, a, o, s, c, l, u, d, f) {
1565
+ if (o && typeof o == "object" && !Array.isArray(o)) {
1566
+ for (var p in t(o, s, c, l, u, d, f), o) {
1567
+ var m = o[p];
1568
+ if (Array.isArray(m)) {
1569
+ if (p in n.arrayKeywords) for (var h = 0; h < m.length; h++) r(e, t, a, m[h], s + "/" + p + "/" + h, c, s, p, o, h);
1570
+ } else if (p in n.propsKeywords) {
1571
+ if (m && typeof m == "object") for (var g in m) r(e, t, a, m[g], s + "/" + p + "/" + i(g), c, s, p, o, g);
1572
+ } else (p in n.keywords || e.allKeys && !(p in n.skipKeywords)) && r(e, t, a, m, s + "/" + p, c, s, p, o);
1573
+ }
1574
+ a(o, s, c, l, u, d, f);
1575
+ }
1576
+ }
1577
+ function i(e) {
1578
+ return e.replace(/~/g, "~0").replace(/\//g, "~1");
1579
+ }
1580
+ })), I = /* @__PURE__ */ l(((e) => {
1581
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.getSchemaRefs = e.resolveUrl = e.normalizeId = e._getFullPath = e.getFullPath = e.inlineRef = void 0;
1582
+ var t = C(), n = P(), r = F(), i = /* @__PURE__ */ new Set([
1583
+ "type",
1584
+ "format",
1585
+ "pattern",
1586
+ "maxLength",
1587
+ "minLength",
1588
+ "maxProperties",
1589
+ "minProperties",
1590
+ "maxItems",
1591
+ "minItems",
1592
+ "maximum",
1593
+ "minimum",
1594
+ "uniqueItems",
1595
+ "multipleOf",
1596
+ "required",
1597
+ "enum",
1598
+ "const"
1599
+ ]);
1600
+ function a(e, t = !0) {
1601
+ return typeof e == "boolean" ? !0 : t === !0 ? !s(e) : t ? c(e) <= t : !1;
1602
+ }
1603
+ e.inlineRef = a;
1604
+ var o = /* @__PURE__ */ new Set([
1605
+ "$ref",
1606
+ "$recursiveRef",
1607
+ "$recursiveAnchor",
1608
+ "$dynamicRef",
1609
+ "$dynamicAnchor"
1610
+ ]);
1611
+ function s(e) {
1612
+ for (let t in e) {
1613
+ if (o.has(t)) return !0;
1614
+ let n = e[t];
1615
+ if (Array.isArray(n) && n.some(s) || typeof n == "object" && s(n)) return !0;
1616
+ }
1617
+ return !1;
1618
+ }
1619
+ function c(e) {
1620
+ let n = 0;
1621
+ for (let r in e) if (r === "$ref" || (n++, !i.has(r) && (typeof e[r] == "object" && (0, t.eachItem)(e[r], (e) => n += c(e)), n === Infinity))) return Infinity;
1622
+ return n;
1623
+ }
1624
+ function l(e, t = "", n) {
1625
+ return n !== !1 && (t = f(t)), u(e, e.parse(t));
1626
+ }
1627
+ e.getFullPath = l;
1628
+ function u(e, t) {
1629
+ return e.serialize(t).split("#")[0] + "#";
1630
+ }
1631
+ e._getFullPath = u;
1632
+ var d = /#\/?$/;
1633
+ function f(e) {
1634
+ return e ? e.replace(d, "") : "";
1635
+ }
1636
+ e.normalizeId = f;
1637
+ function p(e, t, n) {
1638
+ return n = f(n), e.resolve(t, n);
1639
+ }
1640
+ e.resolveUrl = p;
1641
+ var m = /^[a-z_][-a-z0-9._]*$/i;
1642
+ function h(e, t) {
1643
+ if (typeof e == "boolean") return {};
1644
+ let { schemaId: i, uriResolver: a } = this.opts, o = f(e[i] || t), s = { "": o }, c = l(a, o, !1), u = {}, d = /* @__PURE__ */ new Set();
1645
+ return r(e, { allKeys: !0 }, (e, t, n, r) => {
1646
+ if (r === void 0) return;
1647
+ let a = c + t, o = s[r];
1648
+ typeof e[i] == "string" && (o = l.call(this, e[i])), g.call(this, e.$anchor), g.call(this, e.$dynamicAnchor), s[t] = o;
1649
+ function l(t) {
1650
+ let n = this.opts.uriResolver.resolve;
1651
+ if (t = f(o ? n(o, t) : t), d.has(t)) throw h(t);
1652
+ d.add(t);
1653
+ let r = this.refs[t];
1654
+ return typeof r == "string" && (r = this.refs[r]), typeof r == "object" ? p(e, r.schema, t) : t !== f(a) && (t[0] === "#" ? (p(e, u[t], t), u[t] = e) : this.refs[t] = a), t;
1655
+ }
1656
+ function g(e) {
1657
+ if (typeof e == "string") {
1658
+ if (!m.test(e)) throw Error(`invalid anchor "${e}"`);
1659
+ l.call(this, `#${e}`);
1660
+ }
1661
+ }
1662
+ }), u;
1663
+ function p(e, t, r) {
1664
+ if (t !== void 0 && !n(e, t)) throw h(r);
1665
+ }
1666
+ function h(e) {
1667
+ return /* @__PURE__ */ Error(`reference "${e}" resolves to more than one schema`);
1668
+ }
1669
+ }
1670
+ e.getSchemaRefs = h;
1671
+ })), L = /* @__PURE__ */ l(((e) => {
1672
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.getData = e.KeywordCxt = e.validateFunctionCode = void 0;
1673
+ var t = E(), n = k(), r = O(), i = k(), a = A(), o = M(), s = N(), c = S(), l = w(), u = I(), d = C(), f = T();
1674
+ function p(e) {
1675
+ if (D(e) && (P(e), x(e))) {
1676
+ _(e);
1677
+ return;
1678
+ }
1679
+ m(e, () => (0, t.topBoolOrEmptySchema)(e));
1680
+ }
1681
+ e.validateFunctionCode = p;
1682
+ function m({ gen: e, validateName: t, schema: n, schemaEnv: r, opts: i }, a) {
1683
+ i.code.es5 ? e.func(t, (0, c._)`${l.default.data}, ${l.default.valCxt}`, r.$async, () => {
1684
+ e.code((0, c._)`"use strict"; ${y(n, i)}`), g(e, i), e.code(a);
1685
+ }) : e.func(t, (0, c._)`${l.default.data}, ${h(i)}`, r.$async, () => e.code(y(n, i)).code(a));
1686
+ }
1687
+ function h(e) {
1688
+ return (0, c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef ? (0, c._)`, ${l.default.dynamicAnchors}={}` : c.nil}}={}`;
1689
+ }
1690
+ function g(e, t) {
1691
+ e.if(l.default.valCxt, () => {
1692
+ e.var(l.default.instancePath, (0, c._)`${l.default.valCxt}.${l.default.instancePath}`), e.var(l.default.parentData, (0, c._)`${l.default.valCxt}.${l.default.parentData}`), e.var(l.default.parentDataProperty, (0, c._)`${l.default.valCxt}.${l.default.parentDataProperty}`), e.var(l.default.rootData, (0, c._)`${l.default.valCxt}.${l.default.rootData}`), t.dynamicRef && e.var(l.default.dynamicAnchors, (0, c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`);
1693
+ }, () => {
1694
+ e.var(l.default.instancePath, (0, c._)`""`), e.var(l.default.parentData, (0, c._)`undefined`), e.var(l.default.parentDataProperty, (0, c._)`undefined`), e.var(l.default.rootData, l.default.data), t.dynamicRef && e.var(l.default.dynamicAnchors, (0, c._)`{}`);
1695
+ });
1696
+ }
1697
+ function _(e) {
1698
+ let { schema: t, opts: n, gen: r } = e;
1699
+ m(e, () => {
1700
+ n.$comment && t.$comment && V(e), R(e), r.let(l.default.vErrors, null), r.let(l.default.errors, 0), n.unevaluated && v(e), F(e), H(e);
1701
+ });
1702
+ }
1703
+ function v(e) {
1704
+ let { gen: t, validateName: n } = e;
1705
+ e.evaluated = t.const("evaluated", (0, c._)`${n}.evaluated`), t.if((0, c._)`${e.evaluated}.dynamicProps`, () => t.assign((0, c._)`${e.evaluated}.props`, (0, c._)`undefined`)), t.if((0, c._)`${e.evaluated}.dynamicItems`, () => t.assign((0, c._)`${e.evaluated}.items`, (0, c._)`undefined`));
1706
+ }
1707
+ function y(e, t) {
1708
+ let n = typeof e == "object" && e[t.schemaId];
1709
+ return n && (t.code.source || t.code.process) ? (0, c._)`/*# sourceURL=${n} */` : c.nil;
1710
+ }
1711
+ function b(e, n) {
1712
+ if (D(e) && (P(e), x(e))) {
1713
+ j(e, n);
1714
+ return;
1715
+ }
1716
+ (0, t.boolOrEmptySchema)(e, n);
1717
+ }
1718
+ function x({ schema: e, self: t }) {
1719
+ if (typeof e == "boolean") return !e;
1720
+ for (let n in e) if (t.RULES.all[n]) return !0;
1721
+ return !1;
1722
+ }
1723
+ function D(e) {
1724
+ return typeof e.schema != "boolean";
1725
+ }
1726
+ function j(e, t) {
1727
+ let { schema: n, gen: r, opts: i } = e;
1728
+ i.$comment && n.$comment && V(e), z(e), B(e);
1729
+ let a = r.const("_errs", l.default.errors);
1730
+ F(e, a), r.var(t, (0, c._)`${a} === ${l.default.errors}`);
1731
+ }
1732
+ function P(e) {
1733
+ (0, d.checkUnknownRules)(e), L(e);
1734
+ }
1735
+ function F(e, t) {
1736
+ if (e.opts.jtd) return W(e, [], !1, t);
1737
+ let r = (0, n.getSchemaTypes)(e.schema);
1738
+ W(e, r, !(0, n.coerceAndCheckDataType)(e, r), t);
1739
+ }
1740
+ function L(e) {
1741
+ let { schema: t, errSchemaPath: n, opts: r, self: i } = e;
1742
+ t.$ref && r.ignoreKeywordsWithRef && (0, d.schemaHasRulesButRef)(t, i.RULES) && i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`);
1743
+ }
1744
+ function R(e) {
1745
+ let { schema: t, opts: n } = e;
1746
+ t.default !== void 0 && n.useDefaults && n.strictSchema && (0, d.checkStrictMode)(e, "default is ignored in the schema root");
1747
+ }
1748
+ function z(e) {
1749
+ let t = e.schema[e.opts.schemaId];
1750
+ t && (e.baseId = (0, u.resolveUrl)(e.opts.uriResolver, e.baseId, t));
1751
+ }
1752
+ function B(e) {
1753
+ if (e.schema.$async && !e.schemaEnv.$async) throw Error("async schema in sync schema");
1754
+ }
1755
+ function V({ gen: e, schemaEnv: t, schema: n, errSchemaPath: r, opts: i }) {
1756
+ let a = n.$comment;
1757
+ if (i.$comment === !0) e.code((0, c._)`${l.default.self}.logger.log(${a})`);
1758
+ else if (typeof i.$comment == "function") {
1759
+ let n = (0, c.str)`${r}/$comment`, i = e.scopeValue("root", { ref: t.root });
1760
+ e.code((0, c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`);
1761
+ }
1762
+ }
1763
+ function H(e) {
1764
+ let { gen: t, schemaEnv: n, validateName: r, ValidationError: i, opts: a } = e;
1765
+ n.$async ? t.if((0, c._)`${l.default.errors} === 0`, () => t.return(l.default.data), () => t.throw((0, c._)`new ${i}(${l.default.vErrors})`)) : (t.assign((0, c._)`${r}.errors`, l.default.vErrors), a.unevaluated && U(e), t.return((0, c._)`${l.default.errors} === 0`));
1766
+ }
1767
+ function U({ gen: e, evaluated: t, props: n, items: r }) {
1768
+ n instanceof c.Name && e.assign((0, c._)`${t}.props`, n), r instanceof c.Name && e.assign((0, c._)`${t}.items`, r);
1769
+ }
1770
+ function W(e, t, n, a) {
1771
+ let { gen: o, schema: s, data: u, allErrors: f, opts: p, self: m } = e, { RULES: h } = m;
1772
+ if (s.$ref && (p.ignoreKeywordsWithRef || !(0, d.schemaHasRulesButRef)(s, h))) {
1773
+ o.block(() => X(e, "$ref", h.all.$ref.definition));
1774
+ return;
1775
+ }
1776
+ p.jtd || K(e, t), o.block(() => {
1777
+ for (let e of h.rules) g(e);
1778
+ g(h.post);
1779
+ });
1780
+ function g(d) {
1781
+ (0, r.shouldUseGroup)(s, d) && (d.type ? (o.if((0, i.checkDataType)(d.type, u, p.strictNumbers)), G(e, d), t.length === 1 && t[0] === d.type && n && (o.else(), (0, i.reportTypeError)(e)), o.endIf()) : G(e, d), f || o.if((0, c._)`${l.default.errors} === ${a || 0}`));
1782
+ }
1783
+ }
1784
+ function G(e, t) {
1785
+ let { gen: n, schema: i, opts: { useDefaults: o } } = e;
1786
+ o && (0, a.assignDefaults)(e, t.type), n.block(() => {
1787
+ for (let n of t.rules) (0, r.shouldUseRule)(i, n) && X(e, n.keyword, n.definition, t.type);
1788
+ });
1789
+ }
1790
+ function K(e, t) {
1791
+ e.schemaEnv.meta || !e.opts.strictTypes || (ee(e, t), e.opts.allowUnionTypes || te(e, t), ne(e, e.dataTypes));
1792
+ }
1793
+ function ee(e, t) {
1794
+ if (t.length) {
1795
+ if (!e.dataTypes.length) {
1796
+ e.dataTypes = t;
1797
+ return;
1798
+ }
1799
+ t.forEach((t) => {
1800
+ q(e.dataTypes, t) || J(e, `type "${t}" not allowed by context "${e.dataTypes.join(",")}"`);
1801
+ }), ie(e, t);
1802
+ }
1803
+ }
1804
+ function te(e, t) {
1805
+ t.length > 1 && !(t.length === 2 && t.includes("null")) && J(e, "use allowUnionTypes to allow union type keyword");
1806
+ }
1807
+ function ne(e, t) {
1808
+ let n = e.self.RULES.all;
1809
+ for (let i in n) {
1810
+ let a = n[i];
1811
+ if (typeof a == "object" && (0, r.shouldUseRule)(e.schema, a)) {
1812
+ let { type: n } = a.definition;
1813
+ n.length && !n.some((e) => re(t, e)) && J(e, `missing type "${n.join(",")}" for keyword "${i}"`);
1814
+ }
1815
+ }
1816
+ }
1817
+ function re(e, t) {
1818
+ return e.includes(t) || t === "number" && e.includes("integer");
1819
+ }
1820
+ function q(e, t) {
1821
+ return e.includes(t) || t === "integer" && e.includes("number");
1822
+ }
1823
+ function ie(e, t) {
1824
+ let n = [];
1825
+ for (let r of e.dataTypes) q(t, r) ? n.push(r) : t.includes("integer") && r === "number" && n.push("integer");
1826
+ e.dataTypes = n;
1827
+ }
1828
+ function J(e, t) {
1829
+ let n = e.schemaEnv.baseId + e.errSchemaPath;
1830
+ t += ` at "${n}" (strictTypes)`, (0, d.checkStrictMode)(e, t, e.opts.strictTypes);
1831
+ }
1832
+ var Y = class {
1833
+ constructor(e, t, n) {
1834
+ if ((0, o.validateKeywordUsage)(e, t, n), this.gen = e.gen, this.allErrors = e.allErrors, this.keyword = n, this.data = e.data, this.schema = e.schema[n], this.$data = t.$data && e.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, d.schemaRefOrVal)(e, this.schema, n, this.$data), this.schemaType = t.schemaType, this.parentSchema = e.schema, this.params = {}, this.it = e, this.def = t, this.$data) this.schemaCode = e.gen.const("vSchema", Z(this.$data, e));
1835
+ else if (this.schemaCode = this.schemaValue, !(0, o.validSchemaType)(this.schema, t.schemaType, t.allowUndefined)) throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);
1836
+ ("code" in t ? t.trackErrors : t.errors !== !1) && (this.errsCount = e.gen.const("_errs", l.default.errors));
1837
+ }
1838
+ result(e, t, n) {
1839
+ this.failResult((0, c.not)(e), t, n);
1840
+ }
1841
+ failResult(e, t, n) {
1842
+ this.gen.if(e), n ? n() : this.error(), t ? (this.gen.else(), t(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else();
1843
+ }
1844
+ pass(e, t) {
1845
+ this.failResult((0, c.not)(e), void 0, t);
1846
+ }
1847
+ fail(e) {
1848
+ if (e === void 0) {
1849
+ this.error(), this.allErrors || this.gen.if(!1);
1850
+ return;
1851
+ }
1852
+ this.gen.if(e), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else();
1853
+ }
1854
+ fail$data(e) {
1855
+ if (!this.$data) return this.fail(e);
1856
+ let { schemaCode: t } = this;
1857
+ this.fail((0, c._)`${t} !== undefined && (${(0, c.or)(this.invalid$data(), e)})`);
1858
+ }
1859
+ error(e, t, n) {
1860
+ if (t) {
1861
+ this.setParams(t), this._error(e, n), this.setParams({});
1862
+ return;
1863
+ }
1864
+ this._error(e, n);
1865
+ }
1866
+ _error(e, t) {
1867
+ (e ? f.reportExtraError : f.reportError)(this, this.def.error, t);
1868
+ }
1869
+ $dataError() {
1870
+ (0, f.reportError)(this, this.def.$dataError || f.keyword$DataError);
1871
+ }
1872
+ reset() {
1873
+ if (this.errsCount === void 0) throw Error("add \"trackErrors\" to keyword definition");
1874
+ (0, f.resetErrorsCount)(this.gen, this.errsCount);
1875
+ }
1876
+ ok(e) {
1877
+ this.allErrors || this.gen.if(e);
1878
+ }
1879
+ setParams(e, t) {
1880
+ t ? Object.assign(this.params, e) : this.params = e;
1881
+ }
1882
+ block$data(e, t, n = c.nil) {
1883
+ this.gen.block(() => {
1884
+ this.check$data(e, n), t();
1885
+ });
1886
+ }
1887
+ check$data(e = c.nil, t = c.nil) {
1888
+ if (!this.$data) return;
1889
+ let { gen: n, schemaCode: r, schemaType: i, def: a } = this;
1890
+ n.if((0, c.or)((0, c._)`${r} === undefined`, t)), e !== c.nil && n.assign(e, !0), (i.length || a.validateSchema) && (n.elseIf(this.invalid$data()), this.$dataError(), e !== c.nil && n.assign(e, !1)), n.else();
1891
+ }
1892
+ invalid$data() {
1893
+ let { gen: e, schemaCode: t, schemaType: n, def: r, it: a } = this;
1894
+ return (0, c.or)(o(), s());
1895
+ function o() {
1896
+ if (n.length) {
1897
+ /* istanbul ignore if */
1898
+ if (!(t instanceof c.Name)) throw Error("ajv implementation error");
1899
+ let e = Array.isArray(n) ? n : [n];
1900
+ return (0, c._)`${(0, i.checkDataTypes)(e, t, a.opts.strictNumbers, i.DataType.Wrong)}`;
1901
+ }
1902
+ return c.nil;
1903
+ }
1904
+ function s() {
1905
+ if (r.validateSchema) {
1906
+ let n = e.scopeValue("validate$data", { ref: r.validateSchema });
1907
+ return (0, c._)`!${n}(${t})`;
1908
+ }
1909
+ return c.nil;
1910
+ }
1911
+ }
1912
+ subschema(e, t) {
1913
+ let n = (0, s.getSubschema)(this.it, e);
1914
+ (0, s.extendSubschemaData)(n, this.it, e), (0, s.extendSubschemaMode)(n, e);
1915
+ let r = {
1916
+ ...this.it,
1917
+ ...n,
1918
+ items: void 0,
1919
+ props: void 0
1920
+ };
1921
+ return b(r, t), r;
1922
+ }
1923
+ mergeEvaluated(e, t) {
1924
+ let { it: n, gen: r } = this;
1925
+ n.opts.unevaluated && (n.props !== !0 && e.props !== void 0 && (n.props = d.mergeEvaluated.props(r, e.props, n.props, t)), n.items !== !0 && e.items !== void 0 && (n.items = d.mergeEvaluated.items(r, e.items, n.items, t)));
1926
+ }
1927
+ mergeValidEvaluated(e, t) {
1928
+ let { it: n, gen: r } = this;
1929
+ if (n.opts.unevaluated && (n.props !== !0 || n.items !== !0)) return r.if(t, () => this.mergeEvaluated(e, c.Name)), !0;
1930
+ }
1931
+ };
1932
+ e.KeywordCxt = Y;
1933
+ function X(e, t, n, r) {
1934
+ let i = new Y(e, n, t);
1935
+ "code" in n ? n.code(i, r) : i.$data && n.validate ? (0, o.funcKeywordCode)(i, n) : "macro" in n ? (0, o.macroKeywordCode)(i, n) : (n.compile || n.validate) && (0, o.funcKeywordCode)(i, n);
1936
+ }
1937
+ var ae = /^\/(?:[^~]|~0|~1)*$/, oe = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
1938
+ function Z(e, { dataLevel: t, dataNames: n, dataPathArr: r }) {
1939
+ let i, a;
1940
+ if (e === "") return l.default.rootData;
1941
+ if (e[0] === "/") {
1942
+ if (!ae.test(e)) throw Error(`Invalid JSON-pointer: ${e}`);
1943
+ i = e, a = l.default.rootData;
1944
+ } else {
1945
+ let o = oe.exec(e);
1946
+ if (!o) throw Error(`Invalid JSON-pointer: ${e}`);
1947
+ let s = +o[1];
1948
+ if (i = o[2], i === "#") {
1949
+ if (s >= t) throw Error(u("property/index", s));
1950
+ return r[t - s];
1951
+ }
1952
+ if (s > t) throw Error(u("data", s));
1953
+ if (a = n[t - s], !i) return a;
1954
+ }
1955
+ let o = a, s = i.split("/");
1956
+ for (let e of s) e && (a = (0, c._)`${a}${(0, c.getProperty)((0, d.unescapeJsonPointer)(e))}`, o = (0, c._)`${o} && ${a}`);
1957
+ return o;
1958
+ function u(e, n) {
1959
+ return `Cannot access ${e} ${n} levels up, current level is ${t}`;
1960
+ }
1961
+ }
1962
+ e.getData = Z;
1963
+ })), R = /* @__PURE__ */ l(((e) => {
1964
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.default = class extends Error {
1965
+ constructor(e) {
1966
+ super("validation failed"), this.errors = e, this.ajv = this.validation = !0;
1967
+ }
1968
+ };
1969
+ })), z = /* @__PURE__ */ l(((e) => {
1970
+ Object.defineProperty(e, "__esModule", { value: !0 });
1971
+ var t = I();
1972
+ e.default = class extends Error {
1973
+ constructor(e, n, r, i) {
1974
+ super(i || `can't resolve reference ${r} from id ${n}`), this.missingRef = (0, t.resolveUrl)(e, n, r), this.missingSchema = (0, t.normalizeId)((0, t.getFullPath)(e, this.missingRef));
1975
+ }
1976
+ };
1977
+ })), B = /* @__PURE__ */ l(((e) => {
1978
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.resolveSchema = e.getCompilingSchema = e.resolveRef = e.compileSchema = e.SchemaEnv = void 0;
1979
+ var t = S(), n = R(), r = w(), i = I(), a = C(), o = L(), s = class {
1980
+ constructor(e) {
1981
+ this.refs = {}, this.dynamicAnchors = {};
1982
+ let t;
1983
+ typeof e.schema == "object" && (t = e.schema), this.schema = e.schema, this.schemaId = e.schemaId, this.root = e.root || this, this.baseId = e.baseId ?? (0, i.normalizeId)(t?.[e.schemaId || "$id"]), this.schemaPath = e.schemaPath, this.localRefs = e.localRefs, this.meta = e.meta, this.$async = t?.$async, this.refs = {};
1984
+ }
1985
+ };
1986
+ e.SchemaEnv = s;
1987
+ function c(e) {
1988
+ let a = d.call(this, e);
1989
+ if (a) return a;
1990
+ let s = (0, i.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: c, lines: l } = this.opts.code, { ownProperties: u } = this.opts, f = new t.CodeGen(this.scope, {
1991
+ es5: c,
1992
+ lines: l,
1993
+ ownProperties: u
1994
+ }), p;
1995
+ e.$async && (p = f.scopeValue("Error", {
1996
+ ref: n.default,
1997
+ code: (0, t._)`require("ajv/dist/runtime/validation_error").default`
1998
+ }));
1999
+ let m = f.scopeName("validate");
2000
+ e.validateName = m;
2001
+ let h = {
2002
+ gen: f,
2003
+ allErrors: this.opts.allErrors,
2004
+ data: r.default.data,
2005
+ parentData: r.default.parentData,
2006
+ parentDataProperty: r.default.parentDataProperty,
2007
+ dataNames: [r.default.data],
2008
+ dataPathArr: [t.nil],
2009
+ dataLevel: 0,
2010
+ dataTypes: [],
2011
+ definedProperties: /* @__PURE__ */ new Set(),
2012
+ topSchemaRef: f.scopeValue("schema", this.opts.code.source === !0 ? {
2013
+ ref: e.schema,
2014
+ code: (0, t.stringify)(e.schema)
2015
+ } : { ref: e.schema }),
2016
+ validateName: m,
2017
+ ValidationError: p,
2018
+ schema: e.schema,
2019
+ schemaEnv: e,
2020
+ rootId: s,
2021
+ baseId: e.baseId || s,
2022
+ schemaPath: t.nil,
2023
+ errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"),
2024
+ errorPath: (0, t._)`""`,
2025
+ opts: this.opts,
2026
+ self: this
2027
+ }, g;
2028
+ try {
2029
+ this._compilations.add(e), (0, o.validateFunctionCode)(h), f.optimize(this.opts.code.optimize);
2030
+ let n = f.toString();
2031
+ g = `${f.scopeRefs(r.default.scope)}return ${n}`, this.opts.code.process && (g = this.opts.code.process(g, e));
2032
+ let i = Function(`${r.default.self}`, `${r.default.scope}`, g)(this, this.scope.get());
2033
+ if (this.scope.value(m, { ref: i }), i.errors = null, i.schema = e.schema, i.schemaEnv = e, e.$async && (i.$async = !0), this.opts.code.source === !0 && (i.source = {
2034
+ validateName: m,
2035
+ validateCode: n,
2036
+ scopeValues: f._values
2037
+ }), this.opts.unevaluated) {
2038
+ let { props: e, items: n } = h;
2039
+ i.evaluated = {
2040
+ props: e instanceof t.Name ? void 0 : e,
2041
+ items: n instanceof t.Name ? void 0 : n,
2042
+ dynamicProps: e instanceof t.Name,
2043
+ dynamicItems: n instanceof t.Name
2044
+ }, i.source && (i.source.evaluated = (0, t.stringify)(i.evaluated));
2045
+ }
2046
+ return e.validate = i, e;
2047
+ } catch (t) {
2048
+ throw delete e.validate, delete e.validateName, g && this.logger.error("Error compiling schema, function code:", g), t;
2049
+ } finally {
2050
+ this._compilations.delete(e);
2051
+ }
2052
+ }
2053
+ e.compileSchema = c;
2054
+ function l(e, t, n) {
2055
+ n = (0, i.resolveUrl)(this.opts.uriResolver, t, n);
2056
+ let r = e.refs[n];
2057
+ if (r) return r;
2058
+ let a = p.call(this, e, n);
2059
+ if (a === void 0) {
2060
+ let r = e.localRefs?.[n], { schemaId: i } = this.opts;
2061
+ r && (a = new s({
2062
+ schema: r,
2063
+ schemaId: i,
2064
+ root: e,
2065
+ baseId: t
2066
+ }));
2067
+ }
2068
+ if (a !== void 0) return e.refs[n] = u.call(this, a);
2069
+ }
2070
+ e.resolveRef = l;
2071
+ function u(e) {
2072
+ return (0, i.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : c.call(this, e);
2073
+ }
2074
+ function d(e) {
2075
+ for (let t of this._compilations) if (f(t, e)) return t;
2076
+ }
2077
+ e.getCompilingSchema = d;
2078
+ function f(e, t) {
2079
+ return e.schema === t.schema && e.root === t.root && e.baseId === t.baseId;
2080
+ }
2081
+ function p(e, t) {
2082
+ let n;
2083
+ for (; typeof (n = this.refs[t]) == "string";) t = n;
2084
+ return n || this.schemas[t] || m.call(this, e, t);
2085
+ }
2086
+ function m(e, t) {
2087
+ let n = this.opts.uriResolver.parse(t), r = (0, i._getFullPath)(this.opts.uriResolver, n), a = (0, i.getFullPath)(this.opts.uriResolver, e.baseId, void 0);
2088
+ if (Object.keys(e.schema).length > 0 && r === a) return g.call(this, n, e);
2089
+ let o = (0, i.normalizeId)(r), l = this.refs[o] || this.schemas[o];
2090
+ if (typeof l == "string") {
2091
+ let t = m.call(this, e, l);
2092
+ return typeof t?.schema == "object" ? g.call(this, n, t) : void 0;
2093
+ }
2094
+ if (typeof l?.schema == "object") {
2095
+ if (l.validate || c.call(this, l), o === (0, i.normalizeId)(t)) {
2096
+ let { schema: t } = l, { schemaId: n } = this.opts, r = t[n];
2097
+ return r && (a = (0, i.resolveUrl)(this.opts.uriResolver, a, r)), new s({
2098
+ schema: t,
2099
+ schemaId: n,
2100
+ root: e,
2101
+ baseId: a
2102
+ });
2103
+ }
2104
+ return g.call(this, n, l);
2105
+ }
2106
+ }
2107
+ e.resolveSchema = m;
2108
+ var h = /* @__PURE__ */ new Set([
2109
+ "properties",
2110
+ "patternProperties",
2111
+ "enum",
2112
+ "dependencies",
2113
+ "definitions"
2114
+ ]);
2115
+ function g(e, { baseId: t, schema: n, root: r }) {
2116
+ if (e.fragment?.[0] !== "/") return;
2117
+ for (let r of e.fragment.slice(1).split("/")) {
2118
+ if (typeof n == "boolean") return;
2119
+ let e = n[(0, a.unescapeFragment)(r)];
2120
+ if (e === void 0) return;
2121
+ n = e;
2122
+ let o = typeof n == "object" && n[this.opts.schemaId];
2123
+ !h.has(r) && o && (t = (0, i.resolveUrl)(this.opts.uriResolver, t, o));
2124
+ }
2125
+ let o;
2126
+ if (typeof n != "boolean" && n.$ref && !(0, a.schemaHasRulesButRef)(n, this.RULES)) {
2127
+ let e = (0, i.resolveUrl)(this.opts.uriResolver, t, n.$ref);
2128
+ o = m.call(this, r, e);
2129
+ }
2130
+ let { schemaId: c } = this.opts;
2131
+ if (o ||= new s({
2132
+ schema: n,
2133
+ schemaId: c,
2134
+ root: r,
2135
+ baseId: t
2136
+ }), o.schema !== o.root.schema) return o;
2137
+ }
2138
+ })), V = /* @__PURE__ */ u({
2139
+ $id: () => H,
2140
+ additionalProperties: () => !1,
2141
+ default: () => ee,
2142
+ description: () => U,
2143
+ properties: () => K,
2144
+ required: () => G,
2145
+ type: () => W
2146
+ }), H, U, W, G, K, ee, te = c((() => {
2147
+ H = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", U = "Meta-schema for $data reference (JSON AnySchema extension proposal)", W = "object", G = ["$data"], K = { $data: {
2148
+ type: "string",
2149
+ anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }]
2150
+ } }, ee = {
2151
+ $id: H,
2152
+ description: U,
2153
+ type: W,
2154
+ required: G,
2155
+ properties: K,
2156
+ additionalProperties: !1
2157
+ };
2158
+ })), ne = /* @__PURE__ */ l(((e, t) => {
2159
+ var n = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu), r = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u), i = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu), a = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu), o = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
2160
+ function s(e) {
2161
+ let t = "", n = 0, r = 0;
2162
+ for (r = 0; r < e.length; r++) if (n = e[r].charCodeAt(0), n !== 48) {
2163
+ if (!(n >= 48 && n <= 57 || n >= 65 && n <= 70 || n >= 97 && n <= 102)) return "";
2164
+ t += e[r];
2165
+ break;
2166
+ }
2167
+ for (r += 1; r < e.length; r++) {
2168
+ if (n = e[r].charCodeAt(0), !(n >= 48 && n <= 57 || n >= 65 && n <= 70 || n >= 97 && n <= 102)) return "";
2169
+ t += e[r];
2170
+ }
2171
+ return t;
2172
+ }
2173
+ var c = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
2174
+ function l(e) {
2175
+ return e.length = 0, !0;
2176
+ }
2177
+ function u(e, t, n) {
2178
+ if (e.length) {
2179
+ let r = s(e);
2180
+ if (r !== "") t.push(r);
2181
+ else return n.error = !0, !1;
2182
+ e.length = 0;
2183
+ }
2184
+ return !0;
2185
+ }
2186
+ function d(e) {
2187
+ let t = 0, n = {
2188
+ error: !1,
2189
+ address: "",
2190
+ zone: ""
2191
+ }, r = [], i = [], a = !1, o = !1, c = u;
2192
+ for (let s = 0; s < e.length; s++) {
2193
+ let u = e[s];
2194
+ if (u !== "[" && u !== "]") {
2195
+ if (u === ":") {
2196
+ if (a === !0 && (o = !0), !c(i, r, n)) break;
2197
+ if (++t > 7) {
2198
+ n.error = !0;
2199
+ break;
2200
+ }
2201
+ s > 0 && e[s - 1] === ":" && (a = !0), r.push(":");
2202
+ continue;
2203
+ }
2204
+ if (u === "%") {
2205
+ if (!c(i, r, n)) break;
2206
+ c = l;
2207
+ } else {
2208
+ i.push(u);
2209
+ continue;
2210
+ }
2211
+ }
2212
+ }
2213
+ return i.length && (c === l ? n.zone = i.join("") : o ? r.push(i.join("")) : r.push(s(i))), n.address = r.join(""), n;
2214
+ }
2215
+ function f(e) {
2216
+ if (p(e, ":") < 2) return {
2217
+ host: e,
2218
+ isIPV6: !1
2219
+ };
2220
+ let t = d(e);
2221
+ if (t.error) return {
2222
+ host: e,
2223
+ isIPV6: !1
2224
+ };
2225
+ {
2226
+ let e = t.address, n = t.address;
2227
+ return t.zone && (e += "%" + t.zone, n += "%25" + t.zone), {
2228
+ host: e,
2229
+ isIPV6: !0,
2230
+ escapedHost: n
2231
+ };
2232
+ }
2233
+ }
2234
+ function p(e, t) {
2235
+ let n = 0;
2236
+ for (let r = 0; r < e.length; r++) e[r] === t && n++;
2237
+ return n;
2238
+ }
2239
+ function m(e) {
2240
+ let t = e, n = [], r = -1, i = 0;
2241
+ for (; i = t.length;) {
2242
+ if (i === 1) {
2243
+ if (t === ".") break;
2244
+ if (t === "/") {
2245
+ n.push("/");
2246
+ break;
2247
+ }
2248
+ n.push(t);
2249
+ break;
2250
+ }
2251
+ if (i === 2) {
2252
+ if (t[0] === ".") {
2253
+ if (t[1] === ".") break;
2254
+ if (t[1] === "/") {
2255
+ t = t.slice(2);
2256
+ continue;
2257
+ }
2258
+ } else if (t[0] === "/" && (t[1] === "." || t[1] === "/")) {
2259
+ n.push("/");
2260
+ break;
2261
+ }
2262
+ } else if (i === 3 && t === "/..") {
2263
+ n.length !== 0 && n.pop(), n.push("/");
2264
+ break;
2265
+ }
2266
+ if (t[0] === ".") {
2267
+ if (t[1] === ".") {
2268
+ if (t[2] === "/") {
2269
+ t = t.slice(3);
2270
+ continue;
2271
+ }
2272
+ } else if (t[1] === "/") {
2273
+ t = t.slice(2);
2274
+ continue;
2275
+ }
2276
+ } else if (t[0] === "/" && t[1] === ".") {
2277
+ if (t[2] === "/") {
2278
+ t = t.slice(2);
2279
+ continue;
2280
+ }
2281
+ if (t[2] === "." && t[3] === "/") {
2282
+ t = t.slice(3), n.length !== 0 && n.pop();
2283
+ continue;
2284
+ }
2285
+ }
2286
+ if ((r = t.indexOf("/", 1)) === -1) {
2287
+ n.push(t);
2288
+ break;
2289
+ }
2290
+ n.push(t.slice(0, r)), t = t.slice(r);
2291
+ }
2292
+ return n.join("");
2293
+ }
2294
+ var h = {
2295
+ "@": "%40",
2296
+ "/": "%2F",
2297
+ "?": "%3F",
2298
+ "#": "%23",
2299
+ ":": "%3A"
2300
+ }, g = /[@/?#:]/g, _ = /[@/?#]/g;
2301
+ function v(e, t) {
2302
+ let n = t ? _ : g;
2303
+ return n.lastIndex = 0, e.replace(n, (e) => h[e]);
2304
+ }
2305
+ function y(e, t = !1) {
2306
+ if (e.indexOf("%") === -1) return e;
2307
+ let n = "";
2308
+ for (let r = 0; r < e.length; r++) {
2309
+ if (e[r] === "%" && r + 2 < e.length) {
2310
+ let o = e.slice(r + 1, r + 3);
2311
+ if (i(o)) {
2312
+ let e = o.toUpperCase(), i = String.fromCharCode(parseInt(e, 16));
2313
+ t && a(i) ? n += i : n += "%" + e, r += 2;
2314
+ continue;
2315
+ }
2316
+ }
2317
+ n += e[r];
2318
+ }
2319
+ return n;
2320
+ }
2321
+ function b(e) {
2322
+ let t = "";
2323
+ for (let n = 0; n < e.length; n++) {
2324
+ if (e[n] === "%" && n + 2 < e.length) {
2325
+ let r = e.slice(n + 1, n + 3);
2326
+ if (i(r)) {
2327
+ let e = r.toUpperCase(), i = String.fromCharCode(parseInt(e, 16));
2328
+ i !== "." && a(i) ? t += i : t += "%" + e, n += 2;
2329
+ continue;
2330
+ }
2331
+ }
2332
+ o(e[n]) ? t += e[n] : t += escape(e[n]);
2333
+ }
2334
+ return t;
2335
+ }
2336
+ function x(e) {
2337
+ let t = "";
2338
+ for (let n = 0; n < e.length; n++) {
2339
+ if (e[n] === "%" && n + 2 < e.length) {
2340
+ let r = e.slice(n + 1, n + 3);
2341
+ if (i(r)) {
2342
+ t += "%" + r.toUpperCase(), n += 2;
2343
+ continue;
2344
+ }
2345
+ }
2346
+ t += escape(e[n]);
2347
+ }
2348
+ return t;
2349
+ }
2350
+ function S(e) {
2351
+ let t = [];
2352
+ if (e.userinfo !== void 0 && (t.push(e.userinfo), t.push("@")), e.host !== void 0) {
2353
+ let n = unescape(e.host);
2354
+ if (!r(n)) {
2355
+ let e = f(n);
2356
+ n = e.isIPV6 === !0 ? `[${e.escapedHost}]` : v(n, !1);
2357
+ }
2358
+ t.push(n);
2359
+ }
2360
+ return (typeof e.port == "number" || typeof e.port == "string") && (t.push(":"), t.push(String(e.port))), t.length ? t.join("") : void 0;
2361
+ }
2362
+ t.exports = {
2363
+ nonSimpleDomain: c,
2364
+ recomposeAuthority: S,
2365
+ reescapeHostDelimiters: v,
2366
+ normalizePercentEncoding: y,
2367
+ normalizePathEncoding: b,
2368
+ escapePreservingEscapes: x,
2369
+ removeDotSegments: m,
2370
+ isIPv4: r,
2371
+ isUUID: n,
2372
+ normalizeIPv6: f,
2373
+ stringArrayToHexStripped: s
2374
+ };
2375
+ })), re = /* @__PURE__ */ l(((e, t) => {
2376
+ var { isUUID: n } = ne(), r = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu, i = [
2377
+ "http",
2378
+ "https",
2379
+ "ws",
2380
+ "wss",
2381
+ "urn",
2382
+ "urn:uuid"
2383
+ ];
2384
+ function a(e) {
2385
+ return i.indexOf(e) !== -1;
2386
+ }
2387
+ function o(e) {
2388
+ return e.secure === !0 ? !0 : e.secure === !1 ? !1 : e.scheme ? e.scheme.length === 3 && (e.scheme[0] === "w" || e.scheme[0] === "W") && (e.scheme[1] === "s" || e.scheme[1] === "S") && (e.scheme[2] === "s" || e.scheme[2] === "S") : !1;
2389
+ }
2390
+ function s(e) {
2391
+ return e.host || (e.error = e.error || "HTTP URIs must have a host."), e;
2392
+ }
2393
+ function c(e) {
2394
+ let t = String(e.scheme).toLowerCase() === "https";
2395
+ return (e.port === (t ? 443 : 80) || e.port === "") && (e.port = void 0), e.path ||= "/", e;
2396
+ }
2397
+ function l(e) {
2398
+ return e.secure = o(e), e.resourceName = (e.path || "/") + (e.query ? "?" + e.query : ""), e.path = void 0, e.query = void 0, e;
2399
+ }
2400
+ function u(e) {
2401
+ if ((e.port === (o(e) ? 443 : 80) || e.port === "") && (e.port = void 0), typeof e.secure == "boolean" && (e.scheme = e.secure ? "wss" : "ws", e.secure = void 0), e.resourceName) {
2402
+ let [t, n] = e.resourceName.split("?");
2403
+ e.path = t && t !== "/" ? t : void 0, e.query = n, e.resourceName = void 0;
2404
+ }
2405
+ return e.fragment = void 0, e;
2406
+ }
2407
+ function d(e, t) {
2408
+ if (!e.path) return e.error = "URN can not be parsed", e;
2409
+ let n = e.path.match(r);
2410
+ if (n) {
2411
+ let r = t.scheme || e.scheme || "urn";
2412
+ e.nid = n[1].toLowerCase(), e.nss = n[2];
2413
+ let i = y(`${r}:${t.nid || e.nid}`);
2414
+ e.path = void 0, i && (e = i.parse(e, t));
2415
+ } else e.error = e.error || "URN can not be parsed.";
2416
+ return e;
2417
+ }
2418
+ function f(e, t) {
2419
+ if (e.nid === void 0) throw Error("URN without nid cannot be serialized");
2420
+ let n = t.scheme || e.scheme || "urn", r = e.nid.toLowerCase(), i = y(`${n}:${t.nid || r}`);
2421
+ i && (e = i.serialize(e, t));
2422
+ let a = e, o = e.nss;
2423
+ return a.path = `${r || t.nid}:${o}`, t.skipEscape = !0, a;
2424
+ }
2425
+ function p(e, t) {
2426
+ let r = e;
2427
+ return r.uuid = r.nss, r.nss = void 0, !t.tolerant && (!r.uuid || !n(r.uuid)) && (r.error = r.error || "UUID is not valid."), r;
2428
+ }
2429
+ function m(e) {
2430
+ let t = e;
2431
+ return t.nss = (e.uuid || "").toLowerCase(), t;
2432
+ }
2433
+ var h = {
2434
+ scheme: "http",
2435
+ domainHost: !0,
2436
+ parse: s,
2437
+ serialize: c
2438
+ }, g = {
2439
+ scheme: "https",
2440
+ domainHost: h.domainHost,
2441
+ parse: s,
2442
+ serialize: c
2443
+ }, _ = {
2444
+ scheme: "ws",
2445
+ domainHost: !0,
2446
+ parse: l,
2447
+ serialize: u
2448
+ }, v = {
2449
+ http: h,
2450
+ https: g,
2451
+ ws: _,
2452
+ wss: {
2453
+ scheme: "wss",
2454
+ domainHost: _.domainHost,
2455
+ parse: _.parse,
2456
+ serialize: _.serialize
2457
+ },
2458
+ urn: {
2459
+ scheme: "urn",
2460
+ parse: d,
2461
+ serialize: f,
2462
+ skipNormalize: !0
2463
+ },
2464
+ "urn:uuid": {
2465
+ scheme: "urn:uuid",
2466
+ parse: p,
2467
+ serialize: m,
2468
+ skipNormalize: !0
2469
+ }
2470
+ };
2471
+ Object.setPrototypeOf(v, null);
2472
+ function y(e) {
2473
+ return e && (v[e] || v[e.toLowerCase()]) || void 0;
2474
+ }
2475
+ t.exports = {
2476
+ wsIsSecure: o,
2477
+ SCHEMES: v,
2478
+ isValidSchemeName: a,
2479
+ getSchemeHandler: y
2480
+ };
2481
+ })), q = /* @__PURE__ */ l(((e, t) => {
2482
+ var { normalizeIPv6: n, removeDotSegments: r, recomposeAuthority: i, normalizePercentEncoding: a, normalizePathEncoding: o, escapePreservingEscapes: s, reescapeHostDelimiters: c, isIPv4: l, nonSimpleDomain: u } = ne(), { SCHEMES: d, getSchemeHandler: f } = re();
2483
+ function p(e, t) {
2484
+ return typeof e == "string" ? e = w(e, t) : typeof e == "object" && (e = C(_(e, t), t)), e;
2485
+ }
2486
+ function m(e, t, n) {
2487
+ let r = n ? Object.assign({ scheme: "null" }, n) : { scheme: "null" }, { parsed: i, malformedAuthorityOrPort: a } = S(e, r), { parsed: o, malformedAuthorityOrPort: s } = S(t, r);
2488
+ if (a || s) throw Error(i.error || o.error || "URI is malformed.");
2489
+ let c = h(i, o, r, !0);
2490
+ return r.skipEscape = !0, _(c, r);
2491
+ }
2492
+ function h(e, t, n, i) {
2493
+ let a = {};
2494
+ return i || (e = C(_(e, n), n), t = C(_(t, n), n)), n ||= {}, !n.tolerant && t.scheme ? (a.scheme = t.scheme, a.userinfo = t.userinfo, a.host = t.host, a.port = t.port, a.path = r(t.path || ""), a.query = t.query) : (t.userinfo !== void 0 || t.host !== void 0 || t.port !== void 0 ? (a.userinfo = t.userinfo, a.host = t.host, a.port = t.port, a.path = r(t.path || ""), a.query = t.query) : (t.path ? (t.path[0] === "/" ? a.path = r(t.path) : (a.path = (e.userinfo !== void 0 || e.host !== void 0 || e.port !== void 0) && !e.path ? "/" + t.path : e.path ? e.path.slice(0, e.path.lastIndexOf("/") + 1) + t.path : t.path, a.path = r(a.path)), a.query = t.query) : (a.path = e.path, a.query = t.query === void 0 ? e.query : t.query), a.userinfo = e.userinfo, a.host = e.host, a.port = e.port), a.scheme = e.scheme), a.fragment = t.fragment, a;
2495
+ }
2496
+ function g(e, t, n) {
2497
+ let r = E(e, n), i = E(t, n);
2498
+ return r !== void 0 && i !== void 0 && r.toLowerCase() === i.toLowerCase();
2499
+ }
2500
+ function _(e, t) {
2501
+ let n = {
2502
+ host: e.host,
2503
+ scheme: e.scheme,
2504
+ userinfo: e.userinfo,
2505
+ port: e.port,
2506
+ path: e.path,
2507
+ query: e.query,
2508
+ nid: e.nid,
2509
+ nss: e.nss,
2510
+ uuid: e.uuid,
2511
+ fragment: e.fragment,
2512
+ reference: e.reference,
2513
+ resourceName: e.resourceName,
2514
+ secure: e.secure,
2515
+ error: ""
2516
+ }, o = Object.assign({}, t), c = [], l = f(o.scheme || n.scheme);
2517
+ l && l.serialize && l.serialize(n, o), n.path !== void 0 && (o.skipEscape ? n.path = a(n.path) : (n.path = s(n.path), n.scheme !== void 0 && (n.path = n.path.split("%3A").join(":")))), o.reference !== "suffix" && n.scheme && c.push(n.scheme, ":");
2518
+ let u = i(n);
2519
+ if (u !== void 0 && (o.reference !== "suffix" && c.push("//"), c.push(u), n.path && n.path[0] !== "/" && c.push("/")), n.path !== void 0) {
2520
+ let e = n.path;
2521
+ !o.absolutePath && (!l || !l.absolutePath) && (e = r(e)), u === void 0 && e[0] === "/" && e[1] === "/" && (e = "/%2F" + e.slice(2)), c.push(e);
2522
+ }
2523
+ return n.query !== void 0 && c.push("?", n.query), n.fragment !== void 0 && c.push("#", n.fragment), c.join("");
2524
+ }
2525
+ var v = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u, y = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/, b = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
2526
+ function x(e, t) {
2527
+ if (t[2] !== void 0 && e.path && e.path[0] !== "/") return "URI path must start with \"/\" when authority is present.";
2528
+ if (typeof e.port == "number" && (e.port < 0 || e.port > 65535)) return "URI port is malformed.";
2529
+ }
2530
+ function S(e, t) {
2531
+ let r = Object.assign({}, t), i = {
2532
+ scheme: void 0,
2533
+ userinfo: void 0,
2534
+ host: "",
2535
+ port: void 0,
2536
+ path: "",
2537
+ query: void 0,
2538
+ fragment: void 0
2539
+ }, a = !1, s = !1;
2540
+ r.reference === "suffix" && (e = r.scheme ? r.scheme + ":" + e : "//" + e);
2541
+ let d = e.match(y);
2542
+ d !== null && d[1].indexOf("\\") !== -1 && (i.error = "URI authority must not contain a literal backslash.", a = !0);
2543
+ let p = e.match(b);
2544
+ if (p !== null) {
2545
+ let e = p[1], t = e.replace(/[\t\n\r]/g, "");
2546
+ t.length >= 2 && (t.slice(0, 2) === "//" ? e.length !== t.length && (i.error = i.error || "URI authority introducer must not contain whitespace.", a = !0) : (i.error = i.error || "URI authority must not contain a literal backslash.", a = !0));
2547
+ }
2548
+ let m = e.match(v);
2549
+ if (m) {
2550
+ i.scheme = m[1], i.userinfo = m[3], i.host = m[4], i.port = parseInt(m[5], 10), i.path = m[6] || "", i.query = m[7], i.fragment = m[8], isNaN(i.port) && (i.port = m[5]);
2551
+ let t = x(i, m);
2552
+ if (t !== void 0 && (i.error = i.error || t, a = !0), i.host) if (l(i.host) === !1) {
2553
+ let e = n(i.host);
2554
+ i.host = e.host.toLowerCase(), s = e.isIPV6;
2555
+ } else s = !0;
2556
+ i.reference = i.scheme === void 0 && i.userinfo === void 0 && i.host === void 0 && i.port === void 0 && i.query === void 0 && !i.path ? "same-document" : i.scheme === void 0 ? "relative" : i.fragment === void 0 ? "absolute" : "uri", r.reference && r.reference !== "suffix" && r.reference !== i.reference && (i.error = i.error || "URI is not a " + r.reference + " reference.");
2557
+ let d = f(r.scheme || i.scheme);
2558
+ if (!r.unicodeSupport && (!d || !d.unicodeSupport) && i.host && (r.domainHost || d && d.domainHost) && s === !1 && u(i.host)) try {
2559
+ i.host = new URL("http://" + i.host).hostname;
2560
+ } catch (e) {
2561
+ i.error = i.error || "Host's domain name can not be converted to ASCII: " + e;
2562
+ }
2563
+ if ((!d || d && !d.skipNormalize) && (e.indexOf("%") !== -1 && (i.scheme !== void 0 && (i.scheme = unescape(i.scheme)), i.host !== void 0 && (i.host = c(unescape(i.host), s))), i.path &&= o(i.path), i.fragment)) try {
2564
+ i.fragment = encodeURI(decodeURIComponent(i.fragment));
2565
+ } catch {
2566
+ i.error = i.error || "URI malformed";
2567
+ }
2568
+ d && d.parse && d.parse(i, r);
2569
+ } else i.error = i.error || "URI can not be parsed.";
2570
+ return {
2571
+ parsed: i,
2572
+ malformedAuthorityOrPort: a
2573
+ };
2574
+ }
2575
+ function C(e, t) {
2576
+ return S(e, t).parsed;
2577
+ }
2578
+ function w(e, t) {
2579
+ return T(e, t).normalized;
2580
+ }
2581
+ function T(e, t) {
2582
+ let { parsed: n, malformedAuthorityOrPort: r } = S(e, t);
2583
+ return {
2584
+ normalized: r ? e : _(n, t),
2585
+ malformedAuthorityOrPort: r
2586
+ };
2587
+ }
2588
+ function E(e, t) {
2589
+ if (typeof e == "string") {
2590
+ let { normalized: n, malformedAuthorityOrPort: r } = T(e, t);
2591
+ return r ? void 0 : n;
2592
+ }
2593
+ if (typeof e == "object") return _(e, t);
2594
+ }
2595
+ var D = {
2596
+ SCHEMES: d,
2597
+ normalize: p,
2598
+ resolve: m,
2599
+ resolveComponent: h,
2600
+ equal: g,
2601
+ serialize: _,
2602
+ parse: C
2603
+ };
2604
+ t.exports = D, t.exports.default = D, t.exports.fastUri = D;
2605
+ })), ie = /* @__PURE__ */ l(((e) => {
2606
+ Object.defineProperty(e, "__esModule", { value: !0 });
2607
+ var t = q();
2608
+ t.code = "require(\"ajv/dist/runtime/uri\").default", e.default = t;
2609
+ })), J = /* @__PURE__ */ l(((e) => {
2610
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
2611
+ var t = L();
2612
+ Object.defineProperty(e, "KeywordCxt", {
2613
+ enumerable: !0,
2614
+ get: function() {
2615
+ return t.KeywordCxt;
2616
+ }
2617
+ });
2618
+ var n = S();
2619
+ Object.defineProperty(e, "_", {
2620
+ enumerable: !0,
2621
+ get: function() {
2622
+ return n._;
2623
+ }
2624
+ }), Object.defineProperty(e, "str", {
2625
+ enumerable: !0,
2626
+ get: function() {
2627
+ return n.str;
2628
+ }
2629
+ }), Object.defineProperty(e, "stringify", {
2630
+ enumerable: !0,
2631
+ get: function() {
2632
+ return n.stringify;
2633
+ }
2634
+ }), Object.defineProperty(e, "nil", {
2635
+ enumerable: !0,
2636
+ get: function() {
2637
+ return n.nil;
2638
+ }
2639
+ }), Object.defineProperty(e, "Name", {
2640
+ enumerable: !0,
2641
+ get: function() {
2642
+ return n.Name;
2643
+ }
2644
+ }), Object.defineProperty(e, "CodeGen", {
2645
+ enumerable: !0,
2646
+ get: function() {
2647
+ return n.CodeGen;
2648
+ }
2649
+ });
2650
+ var r = R(), i = z(), a = D(), o = B(), s = S(), c = I(), l = k(), u = C(), d = (te(), f(V).default), p = ie(), m = (e, t) => new RegExp(e, t);
2651
+ m.code = "new RegExp";
2652
+ var h = [
2653
+ "removeAdditional",
2654
+ "useDefaults",
2655
+ "coerceTypes"
2656
+ ], g = /* @__PURE__ */ new Set([
2657
+ "validate",
2658
+ "serialize",
2659
+ "parse",
2660
+ "wrapper",
2661
+ "root",
2662
+ "schema",
2663
+ "keyword",
2664
+ "pattern",
2665
+ "formats",
2666
+ "validate$data",
2667
+ "func",
2668
+ "obj",
2669
+ "Error"
2670
+ ]), _ = {
2671
+ errorDataPath: "",
2672
+ format: "`validateFormats: false` can be used instead.",
2673
+ nullable: "\"nullable\" keyword is supported by default.",
2674
+ jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
2675
+ extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
2676
+ missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
2677
+ processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
2678
+ sourceCode: "Use option `code: {source: true}`",
2679
+ strictDefaults: "It is default now, see option `strict`.",
2680
+ strictKeywords: "It is default now, see option `strict`.",
2681
+ uniqueItems: "\"uniqueItems\" keyword is always validated.",
2682
+ unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
2683
+ cache: "Map is used as cache, schema object as key.",
2684
+ serialize: "Map is used as cache, schema object as key.",
2685
+ ajvErrors: "It is default now."
2686
+ }, v = {
2687
+ ignoreKeywordsWithRef: "",
2688
+ jsPropertySyntax: "",
2689
+ unicode: "\"minLength\"/\"maxLength\" account for unicode characters by default."
2690
+ }, y = 200;
2691
+ function b(e) {
2692
+ let t = e.strict, n = e.code?.optimize, r = n === !0 || n === void 0 ? 1 : n || 0, i = e.code?.regExp ?? m, a = e.uriResolver ?? p.default;
2693
+ return {
2694
+ strictSchema: e.strictSchema ?? t ?? !0,
2695
+ strictNumbers: e.strictNumbers ?? t ?? !0,
2696
+ strictTypes: e.strictTypes ?? t ?? "log",
2697
+ strictTuples: e.strictTuples ?? t ?? "log",
2698
+ strictRequired: e.strictRequired ?? t ?? !1,
2699
+ code: e.code ? {
2700
+ ...e.code,
2701
+ optimize: r,
2702
+ regExp: i
2703
+ } : {
2704
+ optimize: r,
2705
+ regExp: i
2706
+ },
2707
+ loopRequired: e.loopRequired ?? y,
2708
+ loopEnum: e.loopEnum ?? y,
2709
+ meta: e.meta ?? !0,
2710
+ messages: e.messages ?? !0,
2711
+ inlineRefs: e.inlineRefs ?? !0,
2712
+ schemaId: e.schemaId ?? "$id",
2713
+ addUsedSchema: e.addUsedSchema ?? !0,
2714
+ validateSchema: e.validateSchema ?? !0,
2715
+ validateFormats: e.validateFormats ?? !0,
2716
+ unicodeRegExp: e.unicodeRegExp ?? !0,
2717
+ int32range: e.int32range ?? !0,
2718
+ uriResolver: a
2719
+ };
2720
+ }
2721
+ var x = class {
2722
+ constructor(e = {}) {
2723
+ this.schemas = {}, this.refs = {}, this.formats = Object.create(null), this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), e = this.opts = {
2724
+ ...e,
2725
+ ...b(e)
2726
+ };
2727
+ let { es5: t, lines: n } = this.opts.code;
2728
+ this.scope = new s.ValueScope({
2729
+ scope: {},
2730
+ prefixes: g,
2731
+ es5: t,
2732
+ lines: n
2733
+ }), this.logger = N(e.logger);
2734
+ let r = e.validateFormats;
2735
+ e.validateFormats = !1, this.RULES = (0, a.getRules)(), w.call(this, _, e, "NOT SUPPORTED"), w.call(this, v, e, "DEPRECATED", "warn"), this._metaOpts = j.call(this), e.formats && O.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), e.keywords && A.call(this, e.keywords), typeof e.meta == "object" && this.addMetaSchema(e.meta), E.call(this), e.validateFormats = r;
2736
+ }
2737
+ _addVocabularies() {
2738
+ this.addKeyword("$async");
2739
+ }
2740
+ _addDefaultMetaSchema() {
2741
+ let { $data: e, meta: t, schemaId: n } = this.opts, r = d;
2742
+ n === "id" && (r = { ...d }, r.id = r.$id, delete r.$id), t && e && this.addMetaSchema(r, r[n], !1);
2743
+ }
2744
+ defaultMeta() {
2745
+ let { meta: e, schemaId: t } = this.opts;
2746
+ return this.opts.defaultMeta = typeof e == "object" ? e[t] || e : void 0;
2747
+ }
2748
+ validate(e, t) {
2749
+ let n;
2750
+ if (typeof e == "string") {
2751
+ if (n = this.getSchema(e), !n) throw Error(`no schema with key or ref "${e}"`);
2752
+ } else n = this.compile(e);
2753
+ let r = n(t);
2754
+ return "$async" in n || (this.errors = n.errors), r;
2755
+ }
2756
+ compile(e, t) {
2757
+ let n = this._addSchema(e, t);
2758
+ return n.validate || this._compileSchemaEnv(n);
2759
+ }
2760
+ compileAsync(e, t) {
2761
+ if (typeof this.opts.loadSchema != "function") throw Error("options.loadSchema should be a function");
2762
+ let { loadSchema: n } = this.opts;
2763
+ return r.call(this, e, t);
2764
+ async function r(e, t) {
2765
+ await a.call(this, e.$schema);
2766
+ let n = this._addSchema(e, t);
2767
+ return n.validate || o.call(this, n);
2768
+ }
2769
+ async function a(e) {
2770
+ e && !this.getSchema(e) && await r.call(this, { $ref: e }, !0);
2771
+ }
2772
+ async function o(e) {
2773
+ try {
2774
+ return this._compileSchemaEnv(e);
2775
+ } catch (t) {
2776
+ if (!(t instanceof i.default)) throw t;
2777
+ return s.call(this, t), await c.call(this, t.missingSchema), o.call(this, e);
2778
+ }
2779
+ }
2780
+ function s({ missingSchema: e, missingRef: t }) {
2781
+ if (this.refs[e]) throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`);
2782
+ }
2783
+ async function c(e) {
2784
+ let n = await l.call(this, e);
2785
+ this.refs[e] || await a.call(this, n.$schema), this.refs[e] || this.addSchema(n, e, t);
2786
+ }
2787
+ async function l(e) {
2788
+ let t = this._loading[e];
2789
+ if (t) return t;
2790
+ try {
2791
+ return await (this._loading[e] = n(e));
2792
+ } finally {
2793
+ delete this._loading[e];
2794
+ }
2795
+ }
2796
+ }
2797
+ addSchema(e, t, n, r = this.opts.validateSchema) {
2798
+ if (Array.isArray(e)) {
2799
+ for (let t of e) this.addSchema(t, void 0, n, r);
2800
+ return this;
2801
+ }
2802
+ let i;
2803
+ if (typeof e == "object") {
2804
+ let { schemaId: t } = this.opts;
2805
+ if (i = e[t], i !== void 0 && typeof i != "string") throw Error(`schema ${t} must be string`);
2806
+ }
2807
+ return t = (0, c.normalizeId)(t || i), this._checkUnique(t), this.schemas[t] = this._addSchema(e, n, t, r, !0), this;
2808
+ }
2809
+ addMetaSchema(e, t, n = this.opts.validateSchema) {
2810
+ return this.addSchema(e, t, !0, n), this;
2811
+ }
2812
+ validateSchema(e, t) {
2813
+ if (typeof e == "boolean") return !0;
2814
+ let n;
2815
+ if (n = e.$schema, n !== void 0 && typeof n != "string") throw Error("$schema must be a string");
2816
+ if (n = n || this.opts.defaultMeta || this.defaultMeta(), !n) return this.logger.warn("meta-schema not available"), this.errors = null, !0;
2817
+ let r = this.validate(n, e);
2818
+ if (!r && t) {
2819
+ let e = "schema is invalid: " + this.errorsText();
2820
+ if (this.opts.validateSchema === "log") this.logger.error(e);
2821
+ else throw Error(e);
2822
+ }
2823
+ return r;
2824
+ }
2825
+ getSchema(e) {
2826
+ let t;
2827
+ for (; typeof (t = T.call(this, e)) == "string";) e = t;
2828
+ if (t === void 0) {
2829
+ let { schemaId: n } = this.opts, r = new o.SchemaEnv({
2830
+ schema: {},
2831
+ schemaId: n
2832
+ });
2833
+ if (t = o.resolveSchema.call(this, r, e), !t) return;
2834
+ this.refs[e] = t;
2835
+ }
2836
+ return t.validate || this._compileSchemaEnv(t);
2837
+ }
2838
+ removeSchema(e) {
2839
+ if (e instanceof RegExp) return this._removeAllSchemas(this.schemas, e), this._removeAllSchemas(this.refs, e), this;
2840
+ switch (typeof e) {
2841
+ case "undefined": return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
2842
+ case "string": {
2843
+ let t = T.call(this, e);
2844
+ return typeof t == "object" && this._cache.delete(t.schema), delete this.schemas[e], delete this.refs[e], this;
2845
+ }
2846
+ case "object": {
2847
+ let t = e;
2848
+ this._cache.delete(t);
2849
+ let n = e[this.opts.schemaId];
2850
+ return n && (n = (0, c.normalizeId)(n), delete this.schemas[n], delete this.refs[n]), this;
2851
+ }
2852
+ default: throw Error("ajv.removeSchema: invalid parameter");
2853
+ }
2854
+ }
2855
+ addVocabulary(e) {
2856
+ for (let t of e) this.addKeyword(t);
2857
+ return this;
2858
+ }
2859
+ addKeyword(e, t) {
2860
+ let n;
2861
+ if (typeof e == "string") n = e, typeof t == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), t.keyword = n);
2862
+ else if (typeof e == "object" && t === void 0) {
2863
+ if (t = e, n = t.keyword, Array.isArray(n) && !n.length) throw Error("addKeywords: keyword must be string or non-empty array");
2864
+ } else throw Error("invalid addKeywords parameters");
2865
+ if (F.call(this, n, t), !t) return (0, u.eachItem)(n, (e) => H.call(this, e)), this;
2866
+ W.call(this, t);
2867
+ let r = {
2868
+ ...t,
2869
+ type: (0, l.getJSONTypes)(t.type),
2870
+ schemaType: (0, l.getJSONTypes)(t.schemaType)
2871
+ };
2872
+ return (0, u.eachItem)(n, r.type.length === 0 ? (e) => H.call(this, e, r) : (e) => r.type.forEach((t) => H.call(this, e, r, t))), this;
2873
+ }
2874
+ getKeyword(e) {
2875
+ let t = this.RULES.all[e];
2876
+ return typeof t == "object" ? t.definition : !!t;
2877
+ }
2878
+ removeKeyword(e) {
2879
+ let { RULES: t } = this;
2880
+ delete t.keywords[e], delete t.all[e];
2881
+ for (let n of t.rules) {
2882
+ let t = n.rules.findIndex((t) => t.keyword === e);
2883
+ t >= 0 && n.rules.splice(t, 1);
2884
+ }
2885
+ return this;
2886
+ }
2887
+ addFormat(e, t) {
2888
+ return typeof t == "string" && (t = new RegExp(t)), this.formats[e] = t, this;
2889
+ }
2890
+ errorsText(e = this.errors, { separator: t = ", ", dataVar: n = "data" } = {}) {
2891
+ return !e || e.length === 0 ? "No errors" : e.map((e) => `${n}${e.instancePath} ${e.message}`).reduce((e, n) => e + t + n);
2892
+ }
2893
+ $dataMetaSchema(e, t) {
2894
+ let n = this.RULES.all;
2895
+ e = JSON.parse(JSON.stringify(e));
2896
+ for (let r of t) {
2897
+ let t = r.split("/").slice(1), i = e;
2898
+ for (let e of t) i = i[e];
2899
+ for (let e in n) {
2900
+ let t = n[e];
2901
+ if (typeof t != "object") continue;
2902
+ let { $data: r } = t.definition, a = i[e];
2903
+ r && a && (i[e] = K(a));
2904
+ }
2905
+ }
2906
+ return e;
2907
+ }
2908
+ _removeAllSchemas(e, t) {
2909
+ for (let n in e) {
2910
+ let r = e[n];
2911
+ (!t || t.test(n)) && (typeof r == "string" ? delete e[n] : r && !r.meta && (this._cache.delete(r.schema), delete e[n]));
2912
+ }
2913
+ }
2914
+ _addSchema(e, t, n, r = this.opts.validateSchema, i = this.opts.addUsedSchema) {
2915
+ let a, { schemaId: s } = this.opts;
2916
+ if (typeof e == "object") a = e[s];
2917
+ else if (this.opts.jtd) throw Error("schema must be object");
2918
+ else if (typeof e != "boolean") throw Error("schema must be object or boolean");
2919
+ let l = this._cache.get(e);
2920
+ if (l !== void 0) return l;
2921
+ n = (0, c.normalizeId)(a || n);
2922
+ let u = c.getSchemaRefs.call(this, e, n);
2923
+ return l = new o.SchemaEnv({
2924
+ schema: e,
2925
+ schemaId: s,
2926
+ meta: t,
2927
+ baseId: n,
2928
+ localRefs: u
2929
+ }), this._cache.set(l.schema, l), i && !n.startsWith("#") && (n && this._checkUnique(n), this.refs[n] = l), r && this.validateSchema(e, !0), l;
2930
+ }
2931
+ _checkUnique(e) {
2932
+ if (this.schemas[e] || this.refs[e]) throw Error(`schema with key or id "${e}" already exists`);
2933
+ }
2934
+ _compileSchemaEnv(e) {
2935
+ /* istanbul ignore if */
2936
+ if (e.meta ? this._compileMetaSchema(e) : o.compileSchema.call(this, e), !e.validate) throw Error("ajv implementation error");
2937
+ return e.validate;
2938
+ }
2939
+ _compileMetaSchema(e) {
2940
+ let t = this.opts;
2941
+ this.opts = this._metaOpts;
2942
+ try {
2943
+ o.compileSchema.call(this, e);
2944
+ } finally {
2945
+ this.opts = t;
2946
+ }
2947
+ }
2948
+ };
2949
+ x.ValidationError = r.default, x.MissingRefError = i.default, e.default = x;
2950
+ function w(e, t, n, r = "error") {
2951
+ for (let i in e) {
2952
+ let a = i;
2953
+ a in t && this.logger[r](`${n}: option ${i}. ${e[a]}`);
2954
+ }
2955
+ }
2956
+ function T(e) {
2957
+ return e = (0, c.normalizeId)(e), this.schemas[e] || this.refs[e];
2958
+ }
2959
+ function E() {
2960
+ let e = this.opts.schemas;
2961
+ if (e) if (Array.isArray(e)) this.addSchema(e);
2962
+ else for (let t in e) this.addSchema(e[t], t);
2963
+ }
2964
+ function O() {
2965
+ for (let e in this.opts.formats) {
2966
+ let t = this.opts.formats[e];
2967
+ t && this.addFormat(e, t);
2968
+ }
2969
+ }
2970
+ function A(e) {
2971
+ if (Array.isArray(e)) {
2972
+ this.addVocabulary(e);
2973
+ return;
2974
+ }
2975
+ this.logger.warn("keywords option as map is deprecated, pass array");
2976
+ for (let t in e) {
2977
+ let n = e[t];
2978
+ n.keyword ||= t, this.addKeyword(n);
2979
+ }
2980
+ }
2981
+ function j() {
2982
+ let e = { ...this.opts };
2983
+ for (let t of h) delete e[t];
2984
+ return e;
2985
+ }
2986
+ var M = {
2987
+ log() {},
2988
+ warn() {},
2989
+ error() {}
2990
+ };
2991
+ function N(e) {
2992
+ if (e === !1) return M;
2993
+ if (e === void 0) return console;
2994
+ if (e.log && e.warn && e.error) return e;
2995
+ throw Error("logger must implement log, warn and error methods");
2996
+ }
2997
+ var P = /^[a-z_$][a-z0-9_$:-]*$/i;
2998
+ function F(e, t) {
2999
+ let { RULES: n } = this;
3000
+ if ((0, u.eachItem)(e, (e) => {
3001
+ if (n.keywords[e]) throw Error(`Keyword ${e} is already defined`);
3002
+ if (!P.test(e)) throw Error(`Keyword ${e} has invalid name`);
3003
+ }), t && t.$data && !("code" in t || "validate" in t)) throw Error("$data keyword must have \"code\" or \"validate\" function");
3004
+ }
3005
+ function H(e, t, n) {
3006
+ var r;
3007
+ let i = t?.post;
3008
+ if (n && i) throw Error("keyword with \"post\" flag cannot have \"type\"");
3009
+ let { RULES: a } = this, o = i ? a.post : a.rules.find(({ type: e }) => e === n);
3010
+ if (o || (o = {
3011
+ type: n,
3012
+ rules: []
3013
+ }, a.rules.push(o)), a.keywords[e] = !0, !t) return;
3014
+ let s = {
3015
+ keyword: e,
3016
+ definition: {
3017
+ ...t,
3018
+ type: (0, l.getJSONTypes)(t.type),
3019
+ schemaType: (0, l.getJSONTypes)(t.schemaType)
3020
+ }
3021
+ };
3022
+ t.before ? U.call(this, o, s, t.before) : o.rules.push(s), a.all[e] = s, (r = t.implements) == null || r.forEach((e) => this.addKeyword(e));
3023
+ }
3024
+ function U(e, t, n) {
3025
+ let r = e.rules.findIndex((e) => e.keyword === n);
3026
+ r >= 0 ? e.rules.splice(r, 0, t) : (e.rules.push(t), this.logger.warn(`rule ${n} is not defined`));
3027
+ }
3028
+ function W(e) {
3029
+ let { metaSchema: t } = e;
3030
+ t !== void 0 && (e.$data && this.opts.$data && (t = K(t)), e.validateSchema = this.compile(t, !0));
3031
+ }
3032
+ var G = { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" };
3033
+ function K(e) {
3034
+ return { anyOf: [e, G] };
3035
+ }
3036
+ })), Y = /* @__PURE__ */ l(((e) => {
3037
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.default = {
3038
+ keyword: "id",
3039
+ code() {
3040
+ throw Error("NOT SUPPORTED: keyword \"id\", use \"$id\" for schema ID");
3041
+ }
3042
+ };
3043
+ })), X = /* @__PURE__ */ l(((e) => {
3044
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.callRef = e.getValidate = void 0;
3045
+ var t = z(), n = j(), r = S(), i = w(), a = B(), o = C(), s = {
3046
+ keyword: "$ref",
3047
+ schemaType: "string",
3048
+ code(e) {
3049
+ let { gen: n, schema: i, it: o } = e, { baseId: s, schemaEnv: u, validateName: d, opts: f, self: p } = o, { root: m } = u;
3050
+ if ((i === "#" || i === "#/") && s === m.baseId) return g();
3051
+ let h = a.resolveRef.call(p, m, s, i);
3052
+ if (h === void 0) throw new t.default(o.opts.uriResolver, s, i);
3053
+ if (h instanceof a.SchemaEnv) return _(h);
3054
+ return v(h);
3055
+ function g() {
3056
+ if (u === m) return l(e, d, u, u.$async);
3057
+ let t = n.scopeValue("root", { ref: m });
3058
+ return l(e, (0, r._)`${t}.validate`, m, m.$async);
3059
+ }
3060
+ function _(t) {
3061
+ l(e, c(e, t), t, t.$async);
3062
+ }
3063
+ function v(t) {
3064
+ let a = n.scopeValue("schema", f.code.source === !0 ? {
3065
+ ref: t,
3066
+ code: (0, r.stringify)(t)
3067
+ } : { ref: t }), o = n.name("valid"), s = e.subschema({
3068
+ schema: t,
3069
+ dataTypes: [],
3070
+ schemaPath: r.nil,
3071
+ topSchemaRef: a,
3072
+ errSchemaPath: i
3073
+ }, o);
3074
+ e.mergeEvaluated(s), e.ok(o);
3075
+ }
3076
+ }
3077
+ };
3078
+ function c(e, t) {
3079
+ let { gen: n } = e;
3080
+ return t.validate ? n.scopeValue("validate", { ref: t.validate }) : (0, r._)`${n.scopeValue("wrapper", { ref: t })}.validate`;
3081
+ }
3082
+ e.getValidate = c;
3083
+ function l(e, t, a, s) {
3084
+ let { gen: c, it: l } = e, { allErrors: u, schemaEnv: d, opts: f } = l, p = f.passContext ? i.default.this : r.nil;
3085
+ s ? m() : h();
3086
+ function m() {
3087
+ if (!d.$async) throw Error("async schema referenced by sync schema");
3088
+ let i = c.let("valid");
3089
+ c.try(() => {
3090
+ c.code((0, r._)`await ${(0, n.callValidateCode)(e, t, p)}`), _(t), u || c.assign(i, !0);
3091
+ }, (e) => {
3092
+ c.if((0, r._)`!(${e} instanceof ${l.ValidationError})`, () => c.throw(e)), g(e), u || c.assign(i, !1);
3093
+ }), e.ok(i);
3094
+ }
3095
+ function h() {
3096
+ e.result((0, n.callValidateCode)(e, t, p), () => _(t), () => g(t));
3097
+ }
3098
+ function g(e) {
3099
+ let t = (0, r._)`${e}.errors`;
3100
+ c.assign(i.default.vErrors, (0, r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`), c.assign(i.default.errors, (0, r._)`${i.default.vErrors}.length`);
3101
+ }
3102
+ function _(e) {
3103
+ if (!l.opts.unevaluated) return;
3104
+ let t = a?.validate?.evaluated;
3105
+ if (l.props !== !0) if (t && !t.dynamicProps) t.props !== void 0 && (l.props = o.mergeEvaluated.props(c, t.props, l.props));
3106
+ else {
3107
+ let t = c.var("props", (0, r._)`${e}.evaluated.props`);
3108
+ l.props = o.mergeEvaluated.props(c, t, l.props, r.Name);
3109
+ }
3110
+ if (l.items !== !0) if (t && !t.dynamicItems) t.items !== void 0 && (l.items = o.mergeEvaluated.items(c, t.items, l.items));
3111
+ else {
3112
+ let t = c.var("items", (0, r._)`${e}.evaluated.items`);
3113
+ l.items = o.mergeEvaluated.items(c, t, l.items, r.Name);
3114
+ }
3115
+ }
3116
+ }
3117
+ e.callRef = l, e.default = s;
3118
+ })), ae = /* @__PURE__ */ l(((e) => {
3119
+ Object.defineProperty(e, "__esModule", { value: !0 });
3120
+ var t = Y(), n = X();
3121
+ e.default = [
3122
+ "$schema",
3123
+ "$id",
3124
+ "$defs",
3125
+ "$vocabulary",
3126
+ { keyword: "$comment" },
3127
+ "definitions",
3128
+ t.default,
3129
+ n.default
3130
+ ];
3131
+ })), oe = /* @__PURE__ */ l(((e) => {
3132
+ Object.defineProperty(e, "__esModule", { value: !0 });
3133
+ var t = S(), n = t.operators, r = {
3134
+ maximum: {
3135
+ okStr: "<=",
3136
+ ok: n.LTE,
3137
+ fail: n.GT
3138
+ },
3139
+ minimum: {
3140
+ okStr: ">=",
3141
+ ok: n.GTE,
3142
+ fail: n.LT
3143
+ },
3144
+ exclusiveMaximum: {
3145
+ okStr: "<",
3146
+ ok: n.LT,
3147
+ fail: n.GTE
3148
+ },
3149
+ exclusiveMinimum: {
3150
+ okStr: ">",
3151
+ ok: n.GT,
3152
+ fail: n.LTE
3153
+ }
3154
+ };
3155
+ e.default = {
3156
+ keyword: Object.keys(r),
3157
+ type: "number",
3158
+ schemaType: "number",
3159
+ $data: !0,
3160
+ error: {
3161
+ message: ({ keyword: e, schemaCode: n }) => (0, t.str)`must be ${r[e].okStr} ${n}`,
3162
+ params: ({ keyword: e, schemaCode: n }) => (0, t._)`{comparison: ${r[e].okStr}, limit: ${n}}`
3163
+ },
3164
+ code(e) {
3165
+ let { keyword: n, data: i, schemaCode: a } = e;
3166
+ e.fail$data((0, t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`);
3167
+ }
3168
+ };
3169
+ })), Z = /* @__PURE__ */ l(((e) => {
3170
+ Object.defineProperty(e, "__esModule", { value: !0 });
3171
+ var t = S();
3172
+ e.default = {
3173
+ keyword: "multipleOf",
3174
+ type: "number",
3175
+ schemaType: "number",
3176
+ $data: !0,
3177
+ error: {
3178
+ message: ({ schemaCode: e }) => (0, t.str)`must be multiple of ${e}`,
3179
+ params: ({ schemaCode: e }) => (0, t._)`{multipleOf: ${e}}`
3180
+ },
3181
+ code(e) {
3182
+ let { gen: n, data: r, schemaCode: i, it: a } = e, o = a.opts.multipleOfPrecision, s = n.let("res"), c = o ? (0, t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}` : (0, t._)`${s} !== parseInt(${s})`;
3183
+ e.fail$data((0, t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`);
3184
+ }
3185
+ };
3186
+ })), se = /* @__PURE__ */ l(((e) => {
3187
+ Object.defineProperty(e, "__esModule", { value: !0 });
3188
+ function t(e) {
3189
+ let t = e.length, n = 0, r = 0, i;
3190
+ for (; r < t;) n++, i = e.charCodeAt(r++), i >= 55296 && i <= 56319 && r < t && (i = e.charCodeAt(r), (i & 64512) == 56320 && r++);
3191
+ return n;
3192
+ }
3193
+ e.default = t, t.code = "require(\"ajv/dist/runtime/ucs2length\").default";
3194
+ })), ce = /* @__PURE__ */ l(((e) => {
3195
+ Object.defineProperty(e, "__esModule", { value: !0 });
3196
+ var t = S(), n = C(), r = se();
3197
+ e.default = {
3198
+ keyword: ["maxLength", "minLength"],
3199
+ type: "string",
3200
+ schemaType: "number",
3201
+ $data: !0,
3202
+ error: {
3203
+ message({ keyword: e, schemaCode: n }) {
3204
+ let r = e === "maxLength" ? "more" : "fewer";
3205
+ return (0, t.str)`must NOT have ${r} than ${n} characters`;
3206
+ },
3207
+ params: ({ schemaCode: e }) => (0, t._)`{limit: ${e}}`
3208
+ },
3209
+ code(e) {
3210
+ let { keyword: i, data: a, schemaCode: o, it: s } = e, c = i === "maxLength" ? t.operators.GT : t.operators.LT, l = s.opts.unicode === !1 ? (0, t._)`${a}.length` : (0, t._)`${(0, n.useFunc)(e.gen, r.default)}(${a})`;
3211
+ e.fail$data((0, t._)`${l} ${c} ${o}`);
3212
+ }
3213
+ };
3214
+ })), le = /* @__PURE__ */ l(((e) => {
3215
+ Object.defineProperty(e, "__esModule", { value: !0 });
3216
+ var t = j(), n = C(), r = S();
3217
+ e.default = {
3218
+ keyword: "pattern",
3219
+ type: "string",
3220
+ schemaType: "string",
3221
+ $data: !0,
3222
+ error: {
3223
+ message: ({ schemaCode: e }) => (0, r.str)`must match pattern "${e}"`,
3224
+ params: ({ schemaCode: e }) => (0, r._)`{pattern: ${e}}`
3225
+ },
3226
+ code(e) {
3227
+ let { gen: i, data: a, $data: o, schema: s, schemaCode: c, it: l } = e, u = l.opts.unicodeRegExp ? "u" : "";
3228
+ if (o) {
3229
+ let { regExp: t } = l.opts.code, o = t.code === "new RegExp" ? (0, r._)`new RegExp` : (0, n.useFunc)(i, t), s = i.let("valid");
3230
+ i.try(() => i.assign(s, (0, r._)`${o}(${c}, ${u}).test(${a})`), () => i.assign(s, !1)), e.fail$data((0, r._)`!${s}`);
3231
+ } else {
3232
+ let n = (0, t.usePattern)(e, s);
3233
+ e.fail$data((0, r._)`!${n}.test(${a})`);
3234
+ }
3235
+ }
3236
+ };
3237
+ })), ue = /* @__PURE__ */ l(((e) => {
3238
+ Object.defineProperty(e, "__esModule", { value: !0 });
3239
+ var t = S();
3240
+ e.default = {
3241
+ keyword: ["maxProperties", "minProperties"],
3242
+ type: "object",
3243
+ schemaType: "number",
3244
+ $data: !0,
3245
+ error: {
3246
+ message({ keyword: e, schemaCode: n }) {
3247
+ let r = e === "maxProperties" ? "more" : "fewer";
3248
+ return (0, t.str)`must NOT have ${r} than ${n} properties`;
3249
+ },
3250
+ params: ({ schemaCode: e }) => (0, t._)`{limit: ${e}}`
3251
+ },
3252
+ code(e) {
3253
+ let { keyword: n, data: r, schemaCode: i } = e, a = n === "maxProperties" ? t.operators.GT : t.operators.LT;
3254
+ e.fail$data((0, t._)`Object.keys(${r}).length ${a} ${i}`);
3255
+ }
3256
+ };
3257
+ })), de = /* @__PURE__ */ l(((e) => {
3258
+ Object.defineProperty(e, "__esModule", { value: !0 });
3259
+ var t = j(), n = S(), r = C();
3260
+ e.default = {
3261
+ keyword: "required",
3262
+ type: "object",
3263
+ schemaType: "array",
3264
+ $data: !0,
3265
+ error: {
3266
+ message: ({ params: { missingProperty: e } }) => (0, n.str)`must have required property '${e}'`,
3267
+ params: ({ params: { missingProperty: e } }) => (0, n._)`{missingProperty: ${e}}`
3268
+ },
3269
+ code(e) {
3270
+ let { gen: i, schema: a, schemaCode: o, data: s, $data: c, it: l } = e, { opts: u } = l;
3271
+ if (!c && a.length === 0) return;
3272
+ let d = a.length >= u.loopRequired;
3273
+ if (l.allErrors ? f() : p(), u.strictRequired) {
3274
+ let t = e.parentSchema.properties, { definedProperties: n } = e.it;
3275
+ for (let e of a) if (t?.[e] === void 0 && !n.has(e)) {
3276
+ let t = `required property "${e}" is not defined at "${l.schemaEnv.baseId + l.errSchemaPath}" (strictRequired)`;
3277
+ (0, r.checkStrictMode)(l, t, l.opts.strictRequired);
3278
+ }
3279
+ }
3280
+ function f() {
3281
+ if (d || c) e.block$data(n.nil, m);
3282
+ else for (let n of a) (0, t.checkReportMissingProp)(e, n);
3283
+ }
3284
+ function p() {
3285
+ let n = i.let("missing");
3286
+ if (d || c) {
3287
+ let t = i.let("valid", !0);
3288
+ e.block$data(t, () => h(n, t)), e.ok(t);
3289
+ } else i.if((0, t.checkMissingProp)(e, a, n)), (0, t.reportMissingProp)(e, n), i.else();
3290
+ }
3291
+ function m() {
3292
+ i.forOf("prop", o, (n) => {
3293
+ e.setParams({ missingProperty: n }), i.if((0, t.noPropertyInData)(i, s, n, u.ownProperties), () => e.error());
3294
+ });
3295
+ }
3296
+ function h(r, a) {
3297
+ e.setParams({ missingProperty: r }), i.forOf(r, o, () => {
3298
+ i.assign(a, (0, t.propertyInData)(i, s, r, u.ownProperties)), i.if((0, n.not)(a), () => {
3299
+ e.error(), i.break();
3300
+ });
3301
+ }, n.nil);
3302
+ }
3303
+ }
3304
+ };
3305
+ })), fe = /* @__PURE__ */ l(((e) => {
3306
+ Object.defineProperty(e, "__esModule", { value: !0 });
3307
+ var t = S();
3308
+ e.default = {
3309
+ keyword: ["maxItems", "minItems"],
3310
+ type: "array",
3311
+ schemaType: "number",
3312
+ $data: !0,
3313
+ error: {
3314
+ message({ keyword: e, schemaCode: n }) {
3315
+ let r = e === "maxItems" ? "more" : "fewer";
3316
+ return (0, t.str)`must NOT have ${r} than ${n} items`;
3317
+ },
3318
+ params: ({ schemaCode: e }) => (0, t._)`{limit: ${e}}`
3319
+ },
3320
+ code(e) {
3321
+ let { keyword: n, data: r, schemaCode: i } = e, a = n === "maxItems" ? t.operators.GT : t.operators.LT;
3322
+ e.fail$data((0, t._)`${r}.length ${a} ${i}`);
3323
+ }
3324
+ };
3325
+ })), pe = /* @__PURE__ */ l(((e) => {
3326
+ Object.defineProperty(e, "__esModule", { value: !0 });
3327
+ var t = P();
3328
+ t.code = "require(\"ajv/dist/runtime/equal\").default", e.default = t;
3329
+ })), me = /* @__PURE__ */ l(((e) => {
3330
+ Object.defineProperty(e, "__esModule", { value: !0 });
3331
+ var t = k(), n = S(), r = C(), i = pe();
3332
+ e.default = {
3333
+ keyword: "uniqueItems",
3334
+ type: "array",
3335
+ schemaType: "boolean",
3336
+ $data: !0,
3337
+ error: {
3338
+ message: ({ params: { i: e, j: t } }) => (0, n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,
3339
+ params: ({ params: { i: e, j: t } }) => (0, n._)`{i: ${e}, j: ${t}}`
3340
+ },
3341
+ code(e) {
3342
+ let { gen: a, data: o, $data: s, schema: c, parentSchema: l, schemaCode: u, it: d } = e;
3343
+ if (!s && !c) return;
3344
+ let f = a.let("valid"), p = l.items ? (0, t.getSchemaTypes)(l.items) : [];
3345
+ e.block$data(f, m, (0, n._)`${u} === false`), e.ok(f);
3346
+ function m() {
3347
+ let t = a.let("i", (0, n._)`${o}.length`), r = a.let("j");
3348
+ e.setParams({
3349
+ i: t,
3350
+ j: r
3351
+ }), a.assign(f, !0), a.if((0, n._)`${t} > 1`, () => (h() ? g : _)(t, r));
3352
+ }
3353
+ function h() {
3354
+ return p.length > 0 && !p.some((e) => e === "object" || e === "array");
3355
+ }
3356
+ function g(r, i) {
3357
+ let s = a.name("item"), c = (0, t.checkDataTypes)(p, s, d.opts.strictNumbers, t.DataType.Wrong), l = a.const("indices", (0, n._)`{}`);
3358
+ a.for((0, n._)`;${r}--;`, () => {
3359
+ a.let(s, (0, n._)`${o}[${r}]`), a.if(c, (0, n._)`continue`), p.length > 1 && a.if((0, n._)`typeof ${s} == "string"`, (0, n._)`${s} += "_"`), a.if((0, n._)`typeof ${l}[${s}] == "number"`, () => {
3360
+ a.assign(i, (0, n._)`${l}[${s}]`), e.error(), a.assign(f, !1).break();
3361
+ }).code((0, n._)`${l}[${s}] = ${r}`);
3362
+ });
3363
+ }
3364
+ function _(t, s) {
3365
+ let c = (0, r.useFunc)(a, i.default), l = a.name("outer");
3366
+ a.label(l).for((0, n._)`;${t}--;`, () => a.for((0, n._)`${s} = ${t}; ${s}--;`, () => a.if((0, n._)`${c}(${o}[${t}], ${o}[${s}])`, () => {
3367
+ e.error(), a.assign(f, !1).break(l);
3368
+ })));
3369
+ }
3370
+ }
3371
+ };
3372
+ })), he = /* @__PURE__ */ l(((e) => {
3373
+ Object.defineProperty(e, "__esModule", { value: !0 });
3374
+ var t = S(), n = C(), r = pe();
3375
+ e.default = {
3376
+ keyword: "const",
3377
+ $data: !0,
3378
+ error: {
3379
+ message: "must be equal to constant",
3380
+ params: ({ schemaCode: e }) => (0, t._)`{allowedValue: ${e}}`
3381
+ },
3382
+ code(e) {
3383
+ let { gen: i, data: a, $data: o, schemaCode: s, schema: c } = e;
3384
+ o || c && typeof c == "object" ? e.fail$data((0, t._)`!${(0, n.useFunc)(i, r.default)}(${a}, ${s})`) : e.fail((0, t._)`${c} !== ${a}`);
3385
+ }
3386
+ };
3387
+ })), ge = /* @__PURE__ */ l(((e) => {
3388
+ Object.defineProperty(e, "__esModule", { value: !0 });
3389
+ var t = S(), n = C(), r = pe();
3390
+ e.default = {
3391
+ keyword: "enum",
3392
+ schemaType: "array",
3393
+ $data: !0,
3394
+ error: {
3395
+ message: "must be equal to one of the allowed values",
3396
+ params: ({ schemaCode: e }) => (0, t._)`{allowedValues: ${e}}`
3397
+ },
3398
+ code(e) {
3399
+ let { gen: i, data: a, $data: o, schema: s, schemaCode: c, it: l } = e;
3400
+ if (!o && s.length === 0) throw Error("enum must have non-empty array");
3401
+ let u = s.length >= l.opts.loopEnum, d, f = () => d ??= (0, n.useFunc)(i, r.default), p;
3402
+ if (u || o) p = i.let("valid"), e.block$data(p, m);
3403
+ else {
3404
+ /* istanbul ignore if */
3405
+ if (!Array.isArray(s)) throw Error("ajv implementation error");
3406
+ let e = i.const("vSchema", c);
3407
+ p = (0, t.or)(...s.map((t, n) => h(e, n)));
3408
+ }
3409
+ e.pass(p);
3410
+ function m() {
3411
+ i.assign(p, !1), i.forOf("v", c, (e) => i.if((0, t._)`${f()}(${a}, ${e})`, () => i.assign(p, !0).break()));
3412
+ }
3413
+ function h(e, n) {
3414
+ let r = s[n];
3415
+ return typeof r == "object" && r ? (0, t._)`${f()}(${a}, ${e}[${n}])` : (0, t._)`${a} === ${r}`;
3416
+ }
3417
+ }
3418
+ };
3419
+ })), _e = /* @__PURE__ */ l(((e) => {
3420
+ Object.defineProperty(e, "__esModule", { value: !0 });
3421
+ var t = oe(), n = Z(), r = ce(), i = le(), a = ue(), o = de(), s = fe(), c = me(), l = he(), u = ge();
3422
+ e.default = [
3423
+ t.default,
3424
+ n.default,
3425
+ r.default,
3426
+ i.default,
3427
+ a.default,
3428
+ o.default,
3429
+ s.default,
3430
+ c.default,
3431
+ {
3432
+ keyword: "type",
3433
+ schemaType: ["string", "array"]
3434
+ },
3435
+ {
3436
+ keyword: "nullable",
3437
+ schemaType: "boolean"
3438
+ },
3439
+ l.default,
3440
+ u.default
3441
+ ];
3442
+ })), ve = /* @__PURE__ */ l(((e) => {
3443
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateAdditionalItems = void 0;
3444
+ var t = S(), n = C(), r = {
3445
+ keyword: "additionalItems",
3446
+ type: "array",
3447
+ schemaType: ["boolean", "object"],
3448
+ before: "uniqueItems",
3449
+ error: {
3450
+ message: ({ params: { len: e } }) => (0, t.str)`must NOT have more than ${e} items`,
3451
+ params: ({ params: { len: e } }) => (0, t._)`{limit: ${e}}`
3452
+ },
3453
+ code(e) {
3454
+ let { parentSchema: t, it: r } = e, { items: a } = t;
3455
+ if (!Array.isArray(a)) {
3456
+ (0, n.checkStrictMode)(r, "\"additionalItems\" is ignored when \"items\" is not an array of schemas");
3457
+ return;
3458
+ }
3459
+ i(e, a);
3460
+ }
3461
+ };
3462
+ function i(e, r) {
3463
+ let { gen: i, schema: a, data: o, keyword: s, it: c } = e;
3464
+ c.items = !0;
3465
+ let l = i.const("len", (0, t._)`${o}.length`);
3466
+ if (a === !1) e.setParams({ len: r.length }), e.pass((0, t._)`${l} <= ${r.length}`);
3467
+ else if (typeof a == "object" && !(0, n.alwaysValidSchema)(c, a)) {
3468
+ let n = i.var("valid", (0, t._)`${l} <= ${r.length}`);
3469
+ i.if((0, t.not)(n), () => u(n)), e.ok(n);
3470
+ }
3471
+ function u(a) {
3472
+ i.forRange("i", r.length, l, (r) => {
3473
+ e.subschema({
3474
+ keyword: s,
3475
+ dataProp: r,
3476
+ dataPropType: n.Type.Num
3477
+ }, a), c.allErrors || i.if((0, t.not)(a), () => i.break());
3478
+ });
3479
+ }
3480
+ }
3481
+ e.validateAdditionalItems = i, e.default = r;
3482
+ })), ye = /* @__PURE__ */ l(((e) => {
3483
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateTuple = void 0;
3484
+ var t = S(), n = C(), r = j(), i = {
3485
+ keyword: "items",
3486
+ type: "array",
3487
+ schemaType: [
3488
+ "object",
3489
+ "array",
3490
+ "boolean"
3491
+ ],
3492
+ before: "uniqueItems",
3493
+ code(e) {
3494
+ let { schema: t, it: i } = e;
3495
+ if (Array.isArray(t)) return a(e, "additionalItems", t);
3496
+ i.items = !0, !(0, n.alwaysValidSchema)(i, t) && e.ok((0, r.validateArray)(e));
3497
+ }
3498
+ };
3499
+ function a(e, r, i = e.schema) {
3500
+ let { gen: a, parentSchema: o, data: s, keyword: c, it: l } = e;
3501
+ f(o), l.opts.unevaluated && i.length && l.items !== !0 && (l.items = n.mergeEvaluated.items(a, i.length, l.items));
3502
+ let u = a.name("valid"), d = a.const("len", (0, t._)`${s}.length`);
3503
+ i.forEach((r, i) => {
3504
+ (0, n.alwaysValidSchema)(l, r) || (a.if((0, t._)`${d} > ${i}`, () => e.subschema({
3505
+ keyword: c,
3506
+ schemaProp: i,
3507
+ dataProp: i
3508
+ }, u)), e.ok(u));
3509
+ });
3510
+ function f(e) {
3511
+ let { opts: t, errSchemaPath: a } = l, o = i.length, s = o === e.minItems && (o === e.maxItems || e[r] === !1);
3512
+ if (t.strictTuples && !s) {
3513
+ let e = `"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;
3514
+ (0, n.checkStrictMode)(l, e, t.strictTuples);
3515
+ }
3516
+ }
3517
+ }
3518
+ e.validateTuple = a, e.default = i;
3519
+ })), be = /* @__PURE__ */ l(((e) => {
3520
+ Object.defineProperty(e, "__esModule", { value: !0 });
3521
+ var t = ye();
3522
+ e.default = {
3523
+ keyword: "prefixItems",
3524
+ type: "array",
3525
+ schemaType: ["array"],
3526
+ before: "uniqueItems",
3527
+ code: (e) => (0, t.validateTuple)(e, "items")
3528
+ };
3529
+ })), xe = /* @__PURE__ */ l(((e) => {
3530
+ Object.defineProperty(e, "__esModule", { value: !0 });
3531
+ var t = S(), n = C(), r = j(), i = ve();
3532
+ e.default = {
3533
+ keyword: "items",
3534
+ type: "array",
3535
+ schemaType: ["object", "boolean"],
3536
+ before: "uniqueItems",
3537
+ error: {
3538
+ message: ({ params: { len: e } }) => (0, t.str)`must NOT have more than ${e} items`,
3539
+ params: ({ params: { len: e } }) => (0, t._)`{limit: ${e}}`
3540
+ },
3541
+ code(e) {
3542
+ let { schema: t, parentSchema: a, it: o } = e, { prefixItems: s } = a;
3543
+ o.items = !0, !(0, n.alwaysValidSchema)(o, t) && (s ? (0, i.validateAdditionalItems)(e, s) : e.ok((0, r.validateArray)(e)));
3544
+ }
3545
+ };
3546
+ })), Se = /* @__PURE__ */ l(((e) => {
3547
+ Object.defineProperty(e, "__esModule", { value: !0 });
3548
+ var t = S(), n = C();
3549
+ e.default = {
3550
+ keyword: "contains",
3551
+ type: "array",
3552
+ schemaType: ["object", "boolean"],
3553
+ before: "uniqueItems",
3554
+ trackErrors: !0,
3555
+ error: {
3556
+ message: ({ params: { min: e, max: n } }) => n === void 0 ? (0, t.str)`must contain at least ${e} valid item(s)` : (0, t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,
3557
+ params: ({ params: { min: e, max: n } }) => n === void 0 ? (0, t._)`{minContains: ${e}}` : (0, t._)`{minContains: ${e}, maxContains: ${n}}`
3558
+ },
3559
+ code(e) {
3560
+ let { gen: r, schema: i, parentSchema: a, data: o, it: s } = e, c, l, { minContains: u, maxContains: d } = a;
3561
+ s.opts.next ? (c = u === void 0 ? 1 : u, l = d) : c = 1;
3562
+ let f = r.const("len", (0, t._)`${o}.length`);
3563
+ if (e.setParams({
3564
+ min: c,
3565
+ max: l
3566
+ }), l === void 0 && c === 0) {
3567
+ (0, n.checkStrictMode)(s, "\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored");
3568
+ return;
3569
+ }
3570
+ if (l !== void 0 && c > l) {
3571
+ (0, n.checkStrictMode)(s, "\"minContains\" > \"maxContains\" is always invalid"), e.fail();
3572
+ return;
3573
+ }
3574
+ if ((0, n.alwaysValidSchema)(s, i)) {
3575
+ let n = (0, t._)`${f} >= ${c}`;
3576
+ l !== void 0 && (n = (0, t._)`${n} && ${f} <= ${l}`), e.pass(n);
3577
+ return;
3578
+ }
3579
+ s.items = !0;
3580
+ let p = r.name("valid");
3581
+ l === void 0 && c === 1 ? h(p, () => r.if(p, () => r.break())) : c === 0 ? (r.let(p, !0), l !== void 0 && r.if((0, t._)`${o}.length > 0`, m)) : (r.let(p, !1), m()), e.result(p, () => e.reset());
3582
+ function m() {
3583
+ let e = r.name("_valid"), t = r.let("count", 0);
3584
+ h(e, () => r.if(e, () => g(t)));
3585
+ }
3586
+ function h(t, i) {
3587
+ r.forRange("i", 0, f, (r) => {
3588
+ e.subschema({
3589
+ keyword: "contains",
3590
+ dataProp: r,
3591
+ dataPropType: n.Type.Num,
3592
+ compositeRule: !0
3593
+ }, t), i();
3594
+ });
3595
+ }
3596
+ function g(e) {
3597
+ r.code((0, t._)`${e}++`), l === void 0 ? r.if((0, t._)`${e} >= ${c}`, () => r.assign(p, !0).break()) : (r.if((0, t._)`${e} > ${l}`, () => r.assign(p, !1).break()), c === 1 ? r.assign(p, !0) : r.if((0, t._)`${e} >= ${c}`, () => r.assign(p, !0)));
3598
+ }
3599
+ }
3600
+ };
3601
+ })), Ce = /* @__PURE__ */ l(((e) => {
3602
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
3603
+ var t = S(), n = C(), r = j();
3604
+ e.error = {
3605
+ message: ({ params: { property: e, depsCount: n, deps: r } }) => {
3606
+ let i = n === 1 ? "property" : "properties";
3607
+ return (0, t.str)`must have ${i} ${r} when property ${e} is present`;
3608
+ },
3609
+ params: ({ params: { property: e, depsCount: n, deps: r, missingProperty: i } }) => (0, t._)`{property: ${e},
3610
+ missingProperty: ${i},
3611
+ depsCount: ${n},
3612
+ deps: ${r}}`
3613
+ };
3614
+ var i = {
3615
+ keyword: "dependencies",
3616
+ type: "object",
3617
+ schemaType: "object",
3618
+ error: e.error,
3619
+ code(e) {
3620
+ let [t, n] = a(e);
3621
+ o(e, t), s(e, n);
3622
+ }
3623
+ };
3624
+ function a({ schema: e }) {
3625
+ let t = {}, n = {};
3626
+ for (let r in e) {
3627
+ if (r === "__proto__") continue;
3628
+ let i = Array.isArray(e[r]) ? t : n;
3629
+ i[r] = e[r];
3630
+ }
3631
+ return [t, n];
3632
+ }
3633
+ function o(e, n = e.schema) {
3634
+ let { gen: i, data: a, it: o } = e;
3635
+ if (Object.keys(n).length === 0) return;
3636
+ let s = i.let("missing");
3637
+ for (let c in n) {
3638
+ let l = n[c];
3639
+ if (l.length === 0) continue;
3640
+ let u = (0, r.propertyInData)(i, a, c, o.opts.ownProperties);
3641
+ e.setParams({
3642
+ property: c,
3643
+ depsCount: l.length,
3644
+ deps: l.join(", ")
3645
+ }), o.allErrors ? i.if(u, () => {
3646
+ for (let t of l) (0, r.checkReportMissingProp)(e, t);
3647
+ }) : (i.if((0, t._)`${u} && (${(0, r.checkMissingProp)(e, l, s)})`), (0, r.reportMissingProp)(e, s), i.else());
3648
+ }
3649
+ }
3650
+ e.validatePropertyDeps = o;
3651
+ function s(e, t = e.schema) {
3652
+ let { gen: i, data: a, keyword: o, it: s } = e, c = i.name("valid");
3653
+ for (let l in t) (0, n.alwaysValidSchema)(s, t[l]) || (i.if((0, r.propertyInData)(i, a, l, s.opts.ownProperties), () => {
3654
+ let t = e.subschema({
3655
+ keyword: o,
3656
+ schemaProp: l
3657
+ }, c);
3658
+ e.mergeValidEvaluated(t, c);
3659
+ }, () => i.var(c, !0)), e.ok(c));
3660
+ }
3661
+ e.validateSchemaDeps = s, e.default = i;
3662
+ })), we = /* @__PURE__ */ l(((e) => {
3663
+ Object.defineProperty(e, "__esModule", { value: !0 });
3664
+ var t = S(), n = C();
3665
+ e.default = {
3666
+ keyword: "propertyNames",
3667
+ type: "object",
3668
+ schemaType: ["object", "boolean"],
3669
+ error: {
3670
+ message: "property name must be valid",
3671
+ params: ({ params: e }) => (0, t._)`{propertyName: ${e.propertyName}}`
3672
+ },
3673
+ code(e) {
3674
+ let { gen: r, schema: i, data: a, it: o } = e;
3675
+ if ((0, n.alwaysValidSchema)(o, i)) return;
3676
+ let s = r.name("valid");
3677
+ r.forIn("key", a, (n) => {
3678
+ e.setParams({ propertyName: n }), e.subschema({
3679
+ keyword: "propertyNames",
3680
+ data: n,
3681
+ dataTypes: ["string"],
3682
+ propertyName: n,
3683
+ compositeRule: !0
3684
+ }, s), r.if((0, t.not)(s), () => {
3685
+ e.error(!0), o.allErrors || r.break();
3686
+ });
3687
+ }), e.ok(s);
3688
+ }
3689
+ };
3690
+ })), Te = /* @__PURE__ */ l(((e) => {
3691
+ Object.defineProperty(e, "__esModule", { value: !0 });
3692
+ var t = j(), n = S(), r = w(), i = C();
3693
+ e.default = {
3694
+ keyword: "additionalProperties",
3695
+ type: ["object"],
3696
+ schemaType: ["boolean", "object"],
3697
+ allowUndefined: !0,
3698
+ trackErrors: !0,
3699
+ error: {
3700
+ message: "must NOT have additional properties",
3701
+ params: ({ params: e }) => (0, n._)`{additionalProperty: ${e.additionalProperty}}`
3702
+ },
3703
+ code(e) {
3704
+ let { gen: a, schema: o, parentSchema: s, data: c, errsCount: l, it: u } = e;
3705
+ /* istanbul ignore if */
3706
+ if (!l) throw Error("ajv implementation error");
3707
+ let { allErrors: d, opts: f } = u;
3708
+ if (u.props = !0, f.removeAdditional !== "all" && (0, i.alwaysValidSchema)(u, o)) return;
3709
+ let p = (0, t.allSchemaProperties)(s.properties), m = (0, t.allSchemaProperties)(s.patternProperties);
3710
+ h(), e.ok((0, n._)`${l} === ${r.default.errors}`);
3711
+ function h() {
3712
+ a.forIn("key", c, (e) => {
3713
+ !p.length && !m.length ? v(e) : a.if(g(e), () => v(e));
3714
+ });
3715
+ }
3716
+ function g(r) {
3717
+ let o;
3718
+ if (p.length > 8) {
3719
+ let e = (0, i.schemaRefOrVal)(u, s.properties, "properties");
3720
+ o = (0, t.isOwnProperty)(a, e, r);
3721
+ } else o = p.length ? (0, n.or)(...p.map((e) => (0, n._)`${r} === ${e}`)) : n.nil;
3722
+ return m.length && (o = (0, n.or)(o, ...m.map((i) => (0, n._)`${(0, t.usePattern)(e, i)}.test(${r})`))), (0, n.not)(o);
3723
+ }
3724
+ function _(e) {
3725
+ a.code((0, n._)`delete ${c}[${e}]`);
3726
+ }
3727
+ function v(t) {
3728
+ if (f.removeAdditional === "all" || f.removeAdditional && o === !1) {
3729
+ _(t);
3730
+ return;
3731
+ }
3732
+ if (o === !1) {
3733
+ e.setParams({ additionalProperty: t }), e.error(), d || a.break();
3734
+ return;
3735
+ }
3736
+ if (typeof o == "object" && !(0, i.alwaysValidSchema)(u, o)) {
3737
+ let r = a.name("valid");
3738
+ f.removeAdditional === "failing" ? (y(t, r, !1), a.if((0, n.not)(r), () => {
3739
+ e.reset(), _(t);
3740
+ })) : (y(t, r), d || a.if((0, n.not)(r), () => a.break()));
3741
+ }
3742
+ }
3743
+ function y(t, n, r) {
3744
+ let a = {
3745
+ keyword: "additionalProperties",
3746
+ dataProp: t,
3747
+ dataPropType: i.Type.Str
3748
+ };
3749
+ r === !1 && Object.assign(a, {
3750
+ compositeRule: !0,
3751
+ createErrors: !1,
3752
+ allErrors: !1
3753
+ }), e.subschema(a, n);
3754
+ }
3755
+ }
3756
+ };
3757
+ })), Ee = /* @__PURE__ */ l(((e) => {
3758
+ Object.defineProperty(e, "__esModule", { value: !0 });
3759
+ var t = L(), n = j(), r = C(), i = Te();
3760
+ e.default = {
3761
+ keyword: "properties",
3762
+ type: "object",
3763
+ schemaType: "object",
3764
+ code(e) {
3765
+ let { gen: a, schema: o, parentSchema: s, data: c, it: l } = e;
3766
+ l.opts.removeAdditional === "all" && s.additionalProperties === void 0 && i.default.code(new t.KeywordCxt(l, i.default, "additionalProperties"));
3767
+ let u = (0, n.allSchemaProperties)(o);
3768
+ for (let e of u) l.definedProperties.add(e);
3769
+ l.opts.unevaluated && u.length && l.props !== !0 && (l.props = r.mergeEvaluated.props(a, (0, r.toHash)(u), l.props));
3770
+ let d = u.filter((e) => !(0, r.alwaysValidSchema)(l, o[e]));
3771
+ if (d.length === 0) return;
3772
+ let f = a.name("valid");
3773
+ for (let t of d) p(t) ? m(t) : (a.if((0, n.propertyInData)(a, c, t, l.opts.ownProperties)), m(t), l.allErrors || a.else().var(f, !0), a.endIf()), e.it.definedProperties.add(t), e.ok(f);
3774
+ function p(e) {
3775
+ return l.opts.useDefaults && !l.compositeRule && o[e].default !== void 0;
3776
+ }
3777
+ function m(t) {
3778
+ e.subschema({
3779
+ keyword: "properties",
3780
+ schemaProp: t,
3781
+ dataProp: t
3782
+ }, f);
3783
+ }
3784
+ }
3785
+ };
3786
+ })), De = /* @__PURE__ */ l(((e) => {
3787
+ Object.defineProperty(e, "__esModule", { value: !0 });
3788
+ var t = j(), n = S(), r = C(), i = C();
3789
+ e.default = {
3790
+ keyword: "patternProperties",
3791
+ type: "object",
3792
+ schemaType: "object",
3793
+ code(e) {
3794
+ let { gen: a, schema: o, data: s, parentSchema: c, it: l } = e, { opts: u } = l, d = (0, t.allSchemaProperties)(o), f = d.filter((e) => (0, r.alwaysValidSchema)(l, o[e]));
3795
+ if (d.length === 0 || f.length === d.length && (!l.opts.unevaluated || l.props === !0)) return;
3796
+ let p = u.strictSchema && !u.allowMatchingProperties && c.properties, m = a.name("valid");
3797
+ l.props !== !0 && !(l.props instanceof n.Name) && (l.props = (0, i.evaluatedPropsToName)(a, l.props));
3798
+ let { props: h } = l;
3799
+ g();
3800
+ function g() {
3801
+ for (let e of d) p && _(e), l.allErrors ? v(e) : (a.var(m, !0), v(e), a.if(m));
3802
+ }
3803
+ function _(e) {
3804
+ for (let t in p) new RegExp(e).test(t) && (0, r.checkStrictMode)(l, `property ${t} matches pattern ${e} (use allowMatchingProperties)`);
3805
+ }
3806
+ function v(r) {
3807
+ a.forIn("key", s, (o) => {
3808
+ a.if((0, n._)`${(0, t.usePattern)(e, r)}.test(${o})`, () => {
3809
+ let t = f.includes(r);
3810
+ t || e.subschema({
3811
+ keyword: "patternProperties",
3812
+ schemaProp: r,
3813
+ dataProp: o,
3814
+ dataPropType: i.Type.Str
3815
+ }, m), l.opts.unevaluated && h !== !0 ? a.assign((0, n._)`${h}[${o}]`, !0) : !t && !l.allErrors && a.if((0, n.not)(m), () => a.break());
3816
+ });
3817
+ });
3818
+ }
3819
+ }
3820
+ };
3821
+ })), Oe = /* @__PURE__ */ l(((e) => {
3822
+ Object.defineProperty(e, "__esModule", { value: !0 });
3823
+ var t = C();
3824
+ e.default = {
3825
+ keyword: "not",
3826
+ schemaType: ["object", "boolean"],
3827
+ trackErrors: !0,
3828
+ code(e) {
3829
+ let { gen: n, schema: r, it: i } = e;
3830
+ if ((0, t.alwaysValidSchema)(i, r)) {
3831
+ e.fail();
3832
+ return;
3833
+ }
3834
+ let a = n.name("valid");
3835
+ e.subschema({
3836
+ keyword: "not",
3837
+ compositeRule: !0,
3838
+ createErrors: !1,
3839
+ allErrors: !1
3840
+ }, a), e.failResult(a, () => e.reset(), () => e.error());
3841
+ },
3842
+ error: { message: "must NOT be valid" }
3843
+ };
3844
+ })), ke = /* @__PURE__ */ l(((e) => {
3845
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.default = {
3846
+ keyword: "anyOf",
3847
+ schemaType: "array",
3848
+ trackErrors: !0,
3849
+ code: j().validateUnion,
3850
+ error: { message: "must match a schema in anyOf" }
3851
+ };
3852
+ })), Ae = /* @__PURE__ */ l(((e) => {
3853
+ Object.defineProperty(e, "__esModule", { value: !0 });
3854
+ var t = S(), n = C();
3855
+ e.default = {
3856
+ keyword: "oneOf",
3857
+ schemaType: "array",
3858
+ trackErrors: !0,
3859
+ error: {
3860
+ message: "must match exactly one schema in oneOf",
3861
+ params: ({ params: e }) => (0, t._)`{passingSchemas: ${e.passing}}`
3862
+ },
3863
+ code(e) {
3864
+ let { gen: r, schema: i, parentSchema: a, it: o } = e;
3865
+ /* istanbul ignore if */
3866
+ if (!Array.isArray(i)) throw Error("ajv implementation error");
3867
+ if (o.opts.discriminator && a.discriminator) return;
3868
+ let s = i, c = r.let("valid", !1), l = r.let("passing", null), u = r.name("_valid");
3869
+ e.setParams({ passing: l }), r.block(d), e.result(c, () => e.reset(), () => e.error(!0));
3870
+ function d() {
3871
+ s.forEach((i, a) => {
3872
+ let s;
3873
+ (0, n.alwaysValidSchema)(o, i) ? r.var(u, !0) : s = e.subschema({
3874
+ keyword: "oneOf",
3875
+ schemaProp: a,
3876
+ compositeRule: !0
3877
+ }, u), a > 0 && r.if((0, t._)`${u} && ${c}`).assign(c, !1).assign(l, (0, t._)`[${l}, ${a}]`).else(), r.if(u, () => {
3878
+ r.assign(c, !0), r.assign(l, a), s && e.mergeEvaluated(s, t.Name);
3879
+ });
3880
+ });
3881
+ }
3882
+ }
3883
+ };
3884
+ })), je = /* @__PURE__ */ l(((e) => {
3885
+ Object.defineProperty(e, "__esModule", { value: !0 });
3886
+ var t = C();
3887
+ e.default = {
3888
+ keyword: "allOf",
3889
+ schemaType: "array",
3890
+ code(e) {
3891
+ let { gen: n, schema: r, it: i } = e;
3892
+ /* istanbul ignore if */
3893
+ if (!Array.isArray(r)) throw Error("ajv implementation error");
3894
+ let a = n.name("valid");
3895
+ r.forEach((n, r) => {
3896
+ if ((0, t.alwaysValidSchema)(i, n)) return;
3897
+ let o = e.subschema({
3898
+ keyword: "allOf",
3899
+ schemaProp: r
3900
+ }, a);
3901
+ e.ok(a), e.mergeEvaluated(o);
3902
+ });
3903
+ }
3904
+ };
3905
+ })), Me = /* @__PURE__ */ l(((e) => {
3906
+ Object.defineProperty(e, "__esModule", { value: !0 });
3907
+ var t = S(), n = C(), r = {
3908
+ keyword: "if",
3909
+ schemaType: ["object", "boolean"],
3910
+ trackErrors: !0,
3911
+ error: {
3912
+ message: ({ params: e }) => (0, t.str)`must match "${e.ifClause}" schema`,
3913
+ params: ({ params: e }) => (0, t._)`{failingKeyword: ${e.ifClause}}`
3914
+ },
3915
+ code(e) {
3916
+ let { gen: r, parentSchema: a, it: o } = e;
3917
+ a.then === void 0 && a.else === void 0 && (0, n.checkStrictMode)(o, "\"if\" without \"then\" and \"else\" is ignored");
3918
+ let s = i(o, "then"), c = i(o, "else");
3919
+ if (!s && !c) return;
3920
+ let l = r.let("valid", !0), u = r.name("_valid");
3921
+ if (d(), e.reset(), s && c) {
3922
+ let t = r.let("ifClause");
3923
+ e.setParams({ ifClause: t }), r.if(u, f("then", t), f("else", t));
3924
+ } else s ? r.if(u, f("then")) : r.if((0, t.not)(u), f("else"));
3925
+ e.pass(l, () => e.error(!0));
3926
+ function d() {
3927
+ let t = e.subschema({
3928
+ keyword: "if",
3929
+ compositeRule: !0,
3930
+ createErrors: !1,
3931
+ allErrors: !1
3932
+ }, u);
3933
+ e.mergeEvaluated(t);
3934
+ }
3935
+ function f(n, i) {
3936
+ return () => {
3937
+ let a = e.subschema({ keyword: n }, u);
3938
+ r.assign(l, u), e.mergeValidEvaluated(a, l), i ? r.assign(i, (0, t._)`${n}`) : e.setParams({ ifClause: n });
3939
+ };
3940
+ }
3941
+ }
3942
+ };
3943
+ function i(e, t) {
3944
+ let r = e.schema[t];
3945
+ return r !== void 0 && !(0, n.alwaysValidSchema)(e, r);
3946
+ }
3947
+ e.default = r;
3948
+ })), Ne = /* @__PURE__ */ l(((e) => {
3949
+ Object.defineProperty(e, "__esModule", { value: !0 });
3950
+ var t = C();
3951
+ e.default = {
3952
+ keyword: ["then", "else"],
3953
+ schemaType: ["object", "boolean"],
3954
+ code({ keyword: e, parentSchema: n, it: r }) {
3955
+ n.if === void 0 && (0, t.checkStrictMode)(r, `"${e}" without "if" is ignored`);
3956
+ }
3957
+ };
3958
+ })), Pe = /* @__PURE__ */ l(((e) => {
3959
+ Object.defineProperty(e, "__esModule", { value: !0 });
3960
+ var t = ve(), n = be(), r = ye(), i = xe(), a = Se(), o = Ce(), s = we(), c = Te(), l = Ee(), u = De(), d = Oe(), f = ke(), p = Ae(), m = je(), h = Me(), g = Ne();
3961
+ function _(e = !1) {
3962
+ let _ = [
3963
+ d.default,
3964
+ f.default,
3965
+ p.default,
3966
+ m.default,
3967
+ h.default,
3968
+ g.default,
3969
+ s.default,
3970
+ c.default,
3971
+ o.default,
3972
+ l.default,
3973
+ u.default
3974
+ ];
3975
+ return e ? _.push(n.default, i.default) : _.push(t.default, r.default), _.push(a.default), _;
3976
+ }
3977
+ e.default = _;
3978
+ })), Fe = /* @__PURE__ */ l(((e) => {
3979
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.dynamicAnchor = void 0;
3980
+ var t = S(), n = w(), r = B(), i = X(), a = {
3981
+ keyword: "$dynamicAnchor",
3982
+ schemaType: "string",
3983
+ code: (e) => o(e, e.schema)
3984
+ };
3985
+ function o(e, r) {
3986
+ let { gen: i, it: a } = e;
3987
+ a.schemaEnv.root.dynamicAnchors[r] = !0;
3988
+ let o = (0, t._)`${n.default.dynamicAnchors}${(0, t.getProperty)(r)}`, c = a.errSchemaPath === "#" ? a.validateName : s(e);
3989
+ i.if((0, t._)`!${o}`, () => i.assign(o, c));
3990
+ }
3991
+ e.dynamicAnchor = o;
3992
+ function s(e) {
3993
+ let { schemaEnv: t, schema: n, self: a } = e.it, { root: o, baseId: s, localRefs: c, meta: l } = t.root, { schemaId: u } = a.opts, d = new r.SchemaEnv({
3994
+ schema: n,
3995
+ schemaId: u,
3996
+ root: o,
3997
+ baseId: s,
3998
+ localRefs: c,
3999
+ meta: l
4000
+ });
4001
+ return r.compileSchema.call(a, d), (0, i.getValidate)(e, d);
4002
+ }
4003
+ e.default = a;
4004
+ })), Ie = /* @__PURE__ */ l(((e) => {
4005
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.dynamicRef = void 0;
4006
+ var t = S(), n = w(), r = X(), i = {
4007
+ keyword: "$dynamicRef",
4008
+ schemaType: "string",
4009
+ code: (e) => a(e, e.schema)
4010
+ };
4011
+ function a(e, i) {
4012
+ let { gen: a, keyword: o, it: s } = e;
4013
+ if (i[0] !== "#") throw Error(`"${o}" only supports hash fragment reference`);
4014
+ let c = i.slice(1);
4015
+ if (s.allErrors) l();
4016
+ else {
4017
+ let t = a.let("valid", !1);
4018
+ l(t), e.ok(t);
4019
+ }
4020
+ function l(e) {
4021
+ if (s.schemaEnv.root.dynamicAnchors[c]) {
4022
+ let r = a.let("_v", (0, t._)`${n.default.dynamicAnchors}${(0, t.getProperty)(c)}`);
4023
+ a.if(r, u(r, e), u(s.validateName, e));
4024
+ } else u(s.validateName, e)();
4025
+ }
4026
+ function u(t, n) {
4027
+ return n ? () => a.block(() => {
4028
+ (0, r.callRef)(e, t), a.let(n, !0);
4029
+ }) : () => (0, r.callRef)(e, t);
4030
+ }
4031
+ }
4032
+ e.dynamicRef = a, e.default = i;
4033
+ })), Le = /* @__PURE__ */ l(((e) => {
4034
+ Object.defineProperty(e, "__esModule", { value: !0 });
4035
+ var t = Fe(), n = C();
4036
+ e.default = {
4037
+ keyword: "$recursiveAnchor",
4038
+ schemaType: "boolean",
4039
+ code(e) {
4040
+ e.schema ? (0, t.dynamicAnchor)(e, "") : (0, n.checkStrictMode)(e.it, "$recursiveAnchor: false is ignored");
4041
+ }
4042
+ };
4043
+ })), Re = /* @__PURE__ */ l(((e) => {
4044
+ Object.defineProperty(e, "__esModule", { value: !0 });
4045
+ var t = Ie();
4046
+ e.default = {
4047
+ keyword: "$recursiveRef",
4048
+ schemaType: "string",
4049
+ code: (e) => (0, t.dynamicRef)(e, e.schema)
4050
+ };
4051
+ })), ze = /* @__PURE__ */ l(((e) => {
4052
+ Object.defineProperty(e, "__esModule", { value: !0 });
4053
+ var t = Fe(), n = Ie(), r = Le(), i = Re();
4054
+ e.default = [
4055
+ t.default,
4056
+ n.default,
4057
+ r.default,
4058
+ i.default
4059
+ ];
4060
+ })), Be = /* @__PURE__ */ l(((e) => {
4061
+ Object.defineProperty(e, "__esModule", { value: !0 });
4062
+ var t = Ce();
4063
+ e.default = {
4064
+ keyword: "dependentRequired",
4065
+ type: "object",
4066
+ schemaType: "object",
4067
+ error: t.error,
4068
+ code: (e) => (0, t.validatePropertyDeps)(e)
4069
+ };
4070
+ })), Ve = /* @__PURE__ */ l(((e) => {
4071
+ Object.defineProperty(e, "__esModule", { value: !0 });
4072
+ var t = Ce();
4073
+ e.default = {
4074
+ keyword: "dependentSchemas",
4075
+ type: "object",
4076
+ schemaType: "object",
4077
+ code: (e) => (0, t.validateSchemaDeps)(e)
4078
+ };
4079
+ })), He = /* @__PURE__ */ l(((e) => {
4080
+ Object.defineProperty(e, "__esModule", { value: !0 });
4081
+ var t = C();
4082
+ e.default = {
4083
+ keyword: ["maxContains", "minContains"],
4084
+ type: "array",
4085
+ schemaType: "number",
4086
+ code({ keyword: e, parentSchema: n, it: r }) {
4087
+ n.contains === void 0 && (0, t.checkStrictMode)(r, `"${e}" without "contains" is ignored`);
4088
+ }
4089
+ };
4090
+ })), Ue = /* @__PURE__ */ l(((e) => {
4091
+ Object.defineProperty(e, "__esModule", { value: !0 });
4092
+ var t = Be(), n = Ve(), r = He();
4093
+ e.default = [
4094
+ t.default,
4095
+ n.default,
4096
+ r.default
4097
+ ];
4098
+ })), We = /* @__PURE__ */ l(((e) => {
4099
+ Object.defineProperty(e, "__esModule", { value: !0 });
4100
+ var t = S(), n = C(), r = w();
4101
+ e.default = {
4102
+ keyword: "unevaluatedProperties",
4103
+ type: "object",
4104
+ schemaType: ["boolean", "object"],
4105
+ trackErrors: !0,
4106
+ error: {
4107
+ message: "must NOT have unevaluated properties",
4108
+ params: ({ params: e }) => (0, t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`
4109
+ },
4110
+ code(e) {
4111
+ let { gen: i, schema: a, data: o, errsCount: s, it: c } = e;
4112
+ /* istanbul ignore if */
4113
+ if (!s) throw Error("ajv implementation error");
4114
+ let { allErrors: l, props: u } = c;
4115
+ u instanceof t.Name ? i.if((0, t._)`${u} !== true`, () => i.forIn("key", o, (e) => i.if(f(u, e), () => d(e)))) : u !== !0 && i.forIn("key", o, (e) => u === void 0 ? d(e) : i.if(p(u, e), () => d(e))), c.props = !0, e.ok((0, t._)`${s} === ${r.default.errors}`);
4116
+ function d(r) {
4117
+ if (a === !1) {
4118
+ e.setParams({ unevaluatedProperty: r }), e.error(), l || i.break();
4119
+ return;
4120
+ }
4121
+ if (!(0, n.alwaysValidSchema)(c, a)) {
4122
+ let a = i.name("valid");
4123
+ e.subschema({
4124
+ keyword: "unevaluatedProperties",
4125
+ dataProp: r,
4126
+ dataPropType: n.Type.Str
4127
+ }, a), l || i.if((0, t.not)(a), () => i.break());
4128
+ }
4129
+ }
4130
+ function f(e, n) {
4131
+ return (0, t._)`!${e} || !${e}[${n}]`;
4132
+ }
4133
+ function p(e, n) {
4134
+ let r = [];
4135
+ for (let i in e) e[i] === !0 && r.push((0, t._)`${n} !== ${i}`);
4136
+ return (0, t.and)(...r);
4137
+ }
4138
+ }
4139
+ };
4140
+ })), Ge = /* @__PURE__ */ l(((e) => {
4141
+ Object.defineProperty(e, "__esModule", { value: !0 });
4142
+ var t = S(), n = C();
4143
+ e.default = {
4144
+ keyword: "unevaluatedItems",
4145
+ type: "array",
4146
+ schemaType: ["boolean", "object"],
4147
+ error: {
4148
+ message: ({ params: { len: e } }) => (0, t.str)`must NOT have more than ${e} items`,
4149
+ params: ({ params: { len: e } }) => (0, t._)`{limit: ${e}}`
4150
+ },
4151
+ code(e) {
4152
+ let { gen: r, schema: i, data: a, it: o } = e, s = o.items || 0;
4153
+ if (s === !0) return;
4154
+ let c = r.const("len", (0, t._)`${a}.length`);
4155
+ if (i === !1) e.setParams({ len: s }), e.fail((0, t._)`${c} > ${s}`);
4156
+ else if (typeof i == "object" && !(0, n.alwaysValidSchema)(o, i)) {
4157
+ let n = r.var("valid", (0, t._)`${c} <= ${s}`);
4158
+ r.if((0, t.not)(n), () => l(n, s)), e.ok(n);
4159
+ }
4160
+ o.items = !0;
4161
+ function l(i, a) {
4162
+ r.forRange("i", a, c, (a) => {
4163
+ e.subschema({
4164
+ keyword: "unevaluatedItems",
4165
+ dataProp: a,
4166
+ dataPropType: n.Type.Num
4167
+ }, i), o.allErrors || r.if((0, t.not)(i), () => r.break());
4168
+ });
4169
+ }
4170
+ }
4171
+ };
4172
+ })), Ke = /* @__PURE__ */ l(((e) => {
4173
+ Object.defineProperty(e, "__esModule", { value: !0 });
4174
+ var t = We(), n = Ge();
4175
+ e.default = [t.default, n.default];
4176
+ })), qe = /* @__PURE__ */ l(((e) => {
4177
+ Object.defineProperty(e, "__esModule", { value: !0 });
4178
+ var t = S();
4179
+ e.default = {
4180
+ keyword: "format",
4181
+ type: ["number", "string"],
4182
+ schemaType: "string",
4183
+ $data: !0,
4184
+ error: {
4185
+ message: ({ schemaCode: e }) => (0, t.str)`must match format "${e}"`,
4186
+ params: ({ schemaCode: e }) => (0, t._)`{format: ${e}}`
4187
+ },
4188
+ code(e, n) {
4189
+ let { gen: r, data: i, $data: a, schema: o, schemaCode: s, it: c } = e, { opts: l, errSchemaPath: u, schemaEnv: d, self: f } = c;
4190
+ if (!l.validateFormats) return;
4191
+ a ? p() : m();
4192
+ function p() {
4193
+ let a = r.scopeValue("formats", {
4194
+ ref: f.formats,
4195
+ code: l.code.formats
4196
+ }), o = r.const("fDef", (0, t._)`${a}[${s}]`), c = r.let("fType"), u = r.let("format");
4197
+ r.if((0, t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`, () => r.assign(c, (0, t._)`${o}.type || "string"`).assign(u, (0, t._)`${o}.validate`), () => r.assign(c, (0, t._)`"string"`).assign(u, o)), e.fail$data((0, t.or)(p(), m()));
4198
+ function p() {
4199
+ return l.strictSchema === !1 ? t.nil : (0, t._)`${s} && !${u}`;
4200
+ }
4201
+ function m() {
4202
+ let e = d.$async ? (0, t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))` : (0, t._)`${u}(${i})`, r = (0, t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;
4203
+ return (0, t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`;
4204
+ }
4205
+ }
4206
+ function m() {
4207
+ let a = f.formats[o];
4208
+ if (!a) {
4209
+ m();
4210
+ return;
4211
+ }
4212
+ if (a === !0) return;
4213
+ let [s, c, p] = h(a);
4214
+ s === n && e.pass(g());
4215
+ function m() {
4216
+ if (l.strictSchema === !1) {
4217
+ f.logger.warn(e());
4218
+ return;
4219
+ }
4220
+ throw Error(e());
4221
+ function e() {
4222
+ return `unknown format "${o}" ignored in schema at path "${u}"`;
4223
+ }
4224
+ }
4225
+ function h(e) {
4226
+ let n = e instanceof RegExp ? (0, t.regexpCode)(e) : l.code.formats ? (0, t._)`${l.code.formats}${(0, t.getProperty)(o)}` : void 0, i = r.scopeValue("formats", {
4227
+ key: o,
4228
+ ref: e,
4229
+ code: n
4230
+ });
4231
+ return typeof e == "object" && !(e instanceof RegExp) ? [
4232
+ e.type || "string",
4233
+ e.validate,
4234
+ (0, t._)`${i}.validate`
4235
+ ] : [
4236
+ "string",
4237
+ e,
4238
+ i
4239
+ ];
4240
+ }
4241
+ function g() {
4242
+ if (typeof a == "object" && !(a instanceof RegExp) && a.async) {
4243
+ if (!d.$async) throw Error("async format in sync schema");
4244
+ return (0, t._)`await ${p}(${i})`;
4245
+ }
4246
+ return typeof c == "function" ? (0, t._)`${p}(${i})` : (0, t._)`${p}.test(${i})`;
4247
+ }
4248
+ }
4249
+ }
4250
+ };
4251
+ })), Je = /* @__PURE__ */ l(((e) => {
4252
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.default = [qe().default];
4253
+ })), Ye = /* @__PURE__ */ l(((e) => {
4254
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.contentVocabulary = e.metadataVocabulary = void 0, e.metadataVocabulary = [
4255
+ "title",
4256
+ "description",
4257
+ "default",
4258
+ "deprecated",
4259
+ "readOnly",
4260
+ "writeOnly",
4261
+ "examples"
4262
+ ], e.contentVocabulary = [
4263
+ "contentMediaType",
4264
+ "contentEncoding",
4265
+ "contentSchema"
4266
+ ];
4267
+ })), Xe = /* @__PURE__ */ l(((e) => {
4268
+ Object.defineProperty(e, "__esModule", { value: !0 });
4269
+ var t = ae(), n = _e(), r = Pe(), i = ze(), a = Ue(), o = Ke(), s = Je(), c = Ye();
4270
+ e.default = [
4271
+ i.default,
4272
+ t.default,
4273
+ n.default,
4274
+ (0, r.default)(!0),
4275
+ s.default,
4276
+ c.metadataVocabulary,
4277
+ c.contentVocabulary,
4278
+ a.default,
4279
+ o.default
4280
+ ];
4281
+ })), Ze = /* @__PURE__ */ l(((e) => {
4282
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.DiscrError = void 0;
4283
+ var t;
4284
+ (function(e) {
4285
+ e.Tag = "tag", e.Mapping = "mapping";
4286
+ })(t || (e.DiscrError = t = {}));
4287
+ })), Qe = /* @__PURE__ */ l(((e) => {
4288
+ Object.defineProperty(e, "__esModule", { value: !0 });
4289
+ var t = S(), n = Ze(), r = B(), i = z(), a = C();
4290
+ e.default = {
4291
+ keyword: "discriminator",
4292
+ type: "object",
4293
+ schemaType: "object",
4294
+ error: {
4295
+ message: ({ params: { discrError: e, tagName: t } }) => e === n.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`,
4296
+ params: ({ params: { discrError: e, tag: n, tagName: r } }) => (0, t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`
4297
+ },
4298
+ code(e) {
4299
+ let { gen: o, data: s, schema: c, parentSchema: l, it: u } = e, { oneOf: d } = l;
4300
+ if (!u.opts.discriminator) throw Error("discriminator: requires discriminator option");
4301
+ let f = c.propertyName;
4302
+ if (typeof f != "string") throw Error("discriminator: requires propertyName");
4303
+ if (c.mapping) throw Error("discriminator: mapping is not supported");
4304
+ if (!d) throw Error("discriminator: requires oneOf keyword");
4305
+ let p = o.let("valid", !1), m = o.const("tag", (0, t._)`${s}${(0, t.getProperty)(f)}`);
4306
+ o.if((0, t._)`typeof ${m} == "string"`, () => h(), () => e.error(!1, {
4307
+ discrError: n.DiscrError.Tag,
4308
+ tag: m,
4309
+ tagName: f
4310
+ })), e.ok(p);
4311
+ function h() {
4312
+ let r = _();
4313
+ o.if(!1);
4314
+ for (let e in r) o.elseIf((0, t._)`${m} === ${e}`), o.assign(p, g(r[e]));
4315
+ o.else(), e.error(!1, {
4316
+ discrError: n.DiscrError.Mapping,
4317
+ tag: m,
4318
+ tagName: f
4319
+ }), o.endIf();
4320
+ }
4321
+ function g(n) {
4322
+ let r = o.name("valid"), i = e.subschema({
4323
+ keyword: "oneOf",
4324
+ schemaProp: n
4325
+ }, r);
4326
+ return e.mergeEvaluated(i, t.Name), r;
4327
+ }
4328
+ function _() {
4329
+ let e = {}, t = o(l), n = !0;
4330
+ for (let e = 0; e < d.length; e++) {
4331
+ let c = d[e];
4332
+ if (c?.$ref && !(0, a.schemaHasRulesButRef)(c, u.self.RULES)) {
4333
+ let e = c.$ref;
4334
+ if (c = r.resolveRef.call(u.self, u.schemaEnv.root, u.baseId, e), c instanceof r.SchemaEnv && (c = c.schema), c === void 0) throw new i.default(u.opts.uriResolver, u.baseId, e);
4335
+ }
4336
+ let l = c?.properties?.[f];
4337
+ if (typeof l != "object") throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);
4338
+ n &&= t || o(c), s(l, e);
4339
+ }
4340
+ if (!n) throw Error(`discriminator: "${f}" must be required`);
4341
+ return e;
4342
+ function o({ required: e }) {
4343
+ return Array.isArray(e) && e.includes(f);
4344
+ }
4345
+ function s(e, t) {
4346
+ if (e.const) c(e.const, t);
4347
+ else if (e.enum) for (let n of e.enum) c(n, t);
4348
+ else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`);
4349
+ }
4350
+ function c(t, n) {
4351
+ if (typeof t != "string" || t in e) throw Error(`discriminator: "${f}" values must be unique strings`);
4352
+ e[t] = n;
4353
+ }
4354
+ }
4355
+ }
4356
+ };
4357
+ })), $e = /* @__PURE__ */ u({
4358
+ $comment: () => st,
4359
+ $dynamicAnchor: () => rt,
4360
+ $id: () => tt,
4361
+ $schema: () => et,
4362
+ $vocabulary: () => nt,
4363
+ allOf: () => at,
4364
+ default: () => lt,
4365
+ properties: () => ct,
4366
+ title: () => it,
4367
+ type: () => ot
4368
+ }), et, tt, nt, rt, it, at, ot, st, ct, lt, ut = c((() => {
4369
+ et = "https://json-schema.org/draft/2020-12/schema", tt = "https://json-schema.org/draft/2020-12/schema", nt = {
4370
+ "https://json-schema.org/draft/2020-12/vocab/core": !0,
4371
+ "https://json-schema.org/draft/2020-12/vocab/applicator": !0,
4372
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0,
4373
+ "https://json-schema.org/draft/2020-12/vocab/validation": !0,
4374
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": !0,
4375
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0,
4376
+ "https://json-schema.org/draft/2020-12/vocab/content": !0
4377
+ }, rt = "meta", it = "Core and Validation specifications meta-schema", at = [
4378
+ { $ref: "meta/core" },
4379
+ { $ref: "meta/applicator" },
4380
+ { $ref: "meta/unevaluated" },
4381
+ { $ref: "meta/validation" },
4382
+ { $ref: "meta/meta-data" },
4383
+ { $ref: "meta/format-annotation" },
4384
+ { $ref: "meta/content" }
4385
+ ], ot = ["object", "boolean"], st = "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", ct = {
4386
+ definitions: {
4387
+ $comment: "\"definitions\" has been replaced by \"$defs\".",
4388
+ type: "object",
4389
+ additionalProperties: { $dynamicRef: "#meta" },
4390
+ deprecated: !0,
4391
+ default: {}
4392
+ },
4393
+ dependencies: {
4394
+ $comment: "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.",
4395
+ type: "object",
4396
+ additionalProperties: { anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }] },
4397
+ deprecated: !0,
4398
+ default: {}
4399
+ },
4400
+ $recursiveAnchor: {
4401
+ $comment: "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".",
4402
+ $ref: "meta/core#/$defs/anchorString",
4403
+ deprecated: !0
4404
+ },
4405
+ $recursiveRef: {
4406
+ $comment: "\"$recursiveRef\" has been replaced by \"$dynamicRef\".",
4407
+ $ref: "meta/core#/$defs/uriReferenceString",
4408
+ deprecated: !0
4409
+ }
4410
+ }, lt = {
4411
+ $schema: et,
4412
+ $id: tt,
4413
+ $vocabulary: nt,
4414
+ $dynamicAnchor: rt,
4415
+ title: it,
4416
+ allOf: at,
4417
+ type: ot,
4418
+ $comment: st,
4419
+ properties: ct
4420
+ };
4421
+ })), dt = /* @__PURE__ */ u({
4422
+ $defs: () => yt,
4423
+ $dynamicAnchor: () => ht,
4424
+ $id: () => pt,
4425
+ $schema: () => ft,
4426
+ $vocabulary: () => mt,
4427
+ default: () => bt,
4428
+ properties: () => vt,
4429
+ title: () => gt,
4430
+ type: () => _t
4431
+ }), ft, pt, mt, ht, gt, _t, vt, yt, bt, xt = c((() => {
4432
+ ft = "https://json-schema.org/draft/2020-12/schema", pt = "https://json-schema.org/draft/2020-12/meta/applicator", mt = { "https://json-schema.org/draft/2020-12/vocab/applicator": !0 }, ht = "meta", gt = "Applicator vocabulary meta-schema", _t = ["object", "boolean"], vt = {
4433
+ prefixItems: { $ref: "#/$defs/schemaArray" },
4434
+ items: { $dynamicRef: "#meta" },
4435
+ contains: { $dynamicRef: "#meta" },
4436
+ additionalProperties: { $dynamicRef: "#meta" },
4437
+ properties: {
4438
+ type: "object",
4439
+ additionalProperties: { $dynamicRef: "#meta" },
4440
+ default: {}
4441
+ },
4442
+ patternProperties: {
4443
+ type: "object",
4444
+ additionalProperties: { $dynamicRef: "#meta" },
4445
+ propertyNames: { format: "regex" },
4446
+ default: {}
4447
+ },
4448
+ dependentSchemas: {
4449
+ type: "object",
4450
+ additionalProperties: { $dynamicRef: "#meta" },
4451
+ default: {}
4452
+ },
4453
+ propertyNames: { $dynamicRef: "#meta" },
4454
+ if: { $dynamicRef: "#meta" },
4455
+ then: { $dynamicRef: "#meta" },
4456
+ else: { $dynamicRef: "#meta" },
4457
+ allOf: { $ref: "#/$defs/schemaArray" },
4458
+ anyOf: { $ref: "#/$defs/schemaArray" },
4459
+ oneOf: { $ref: "#/$defs/schemaArray" },
4460
+ not: { $dynamicRef: "#meta" }
4461
+ }, yt = { schemaArray: {
4462
+ type: "array",
4463
+ minItems: 1,
4464
+ items: { $dynamicRef: "#meta" }
4465
+ } }, bt = {
4466
+ $schema: ft,
4467
+ $id: pt,
4468
+ $vocabulary: mt,
4469
+ $dynamicAnchor: ht,
4470
+ title: gt,
4471
+ type: _t,
4472
+ properties: vt,
4473
+ $defs: yt
4474
+ };
4475
+ })), St = /* @__PURE__ */ u({
4476
+ $dynamicAnchor: () => Et,
4477
+ $id: () => wt,
4478
+ $schema: () => Ct,
4479
+ $vocabulary: () => Tt,
4480
+ default: () => At,
4481
+ properties: () => kt,
4482
+ title: () => Dt,
4483
+ type: () => Ot
4484
+ }), Ct, wt, Tt, Et, Dt, Ot, kt, At, jt = c((() => {
4485
+ Ct = "https://json-schema.org/draft/2020-12/schema", wt = "https://json-schema.org/draft/2020-12/meta/unevaluated", Tt = { "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0 }, Et = "meta", Dt = "Unevaluated applicator vocabulary meta-schema", Ot = ["object", "boolean"], kt = {
4486
+ unevaluatedItems: { $dynamicRef: "#meta" },
4487
+ unevaluatedProperties: { $dynamicRef: "#meta" }
4488
+ }, At = {
4489
+ $schema: Ct,
4490
+ $id: wt,
4491
+ $vocabulary: Tt,
4492
+ $dynamicAnchor: Et,
4493
+ title: Dt,
4494
+ type: Ot,
4495
+ properties: kt
4496
+ };
4497
+ })), Mt = /* @__PURE__ */ u({
4498
+ $dynamicAnchor: () => It,
4499
+ $id: () => Pt,
4500
+ $schema: () => Nt,
4501
+ $vocabulary: () => Ft,
4502
+ default: () => Bt,
4503
+ properties: () => zt,
4504
+ title: () => Lt,
4505
+ type: () => Rt
4506
+ }), Nt, Pt, Ft, It, Lt, Rt, zt, Bt, Vt = c((() => {
4507
+ Nt = "https://json-schema.org/draft/2020-12/schema", Pt = "https://json-schema.org/draft/2020-12/meta/content", Ft = { "https://json-schema.org/draft/2020-12/vocab/content": !0 }, It = "meta", Lt = "Content vocabulary meta-schema", Rt = ["object", "boolean"], zt = {
4508
+ contentEncoding: { type: "string" },
4509
+ contentMediaType: { type: "string" },
4510
+ contentSchema: { $dynamicRef: "#meta" }
4511
+ }, Bt = {
4512
+ $schema: Nt,
4513
+ $id: Pt,
4514
+ $vocabulary: Ft,
4515
+ $dynamicAnchor: It,
4516
+ title: Lt,
4517
+ type: Rt,
4518
+ properties: zt
4519
+ };
4520
+ })), Ht = /* @__PURE__ */ u({
4521
+ $defs: () => Xt,
4522
+ $dynamicAnchor: () => Kt,
4523
+ $id: () => Wt,
4524
+ $schema: () => Ut,
4525
+ $vocabulary: () => Gt,
4526
+ default: () => Zt,
4527
+ properties: () => Yt,
4528
+ title: () => qt,
4529
+ type: () => Jt
4530
+ }), Ut, Wt, Gt, Kt, qt, Jt, Yt, Xt, Zt, Qt = c((() => {
4531
+ Ut = "https://json-schema.org/draft/2020-12/schema", Wt = "https://json-schema.org/draft/2020-12/meta/core", Gt = { "https://json-schema.org/draft/2020-12/vocab/core": !0 }, Kt = "meta", qt = "Core vocabulary meta-schema", Jt = ["object", "boolean"], Yt = {
4532
+ $id: {
4533
+ $ref: "#/$defs/uriReferenceString",
4534
+ $comment: "Non-empty fragments not allowed.",
4535
+ pattern: "^[^#]*#?$"
4536
+ },
4537
+ $schema: { $ref: "#/$defs/uriString" },
4538
+ $ref: { $ref: "#/$defs/uriReferenceString" },
4539
+ $anchor: { $ref: "#/$defs/anchorString" },
4540
+ $dynamicRef: { $ref: "#/$defs/uriReferenceString" },
4541
+ $dynamicAnchor: { $ref: "#/$defs/anchorString" },
4542
+ $vocabulary: {
4543
+ type: "object",
4544
+ propertyNames: { $ref: "#/$defs/uriString" },
4545
+ additionalProperties: { type: "boolean" }
4546
+ },
4547
+ $comment: { type: "string" },
4548
+ $defs: {
4549
+ type: "object",
4550
+ additionalProperties: { $dynamicRef: "#meta" }
4551
+ }
4552
+ }, Xt = {
4553
+ anchorString: {
4554
+ type: "string",
4555
+ pattern: "^[A-Za-z_][-A-Za-z0-9._]*$"
4556
+ },
4557
+ uriString: {
4558
+ type: "string",
4559
+ format: "uri"
4560
+ },
4561
+ uriReferenceString: {
4562
+ type: "string",
4563
+ format: "uri-reference"
4564
+ }
4565
+ }, Zt = {
4566
+ $schema: Ut,
4567
+ $id: Wt,
4568
+ $vocabulary: Gt,
4569
+ $dynamicAnchor: Kt,
4570
+ title: qt,
4571
+ type: Jt,
4572
+ properties: Yt,
4573
+ $defs: Xt
4574
+ };
4575
+ })), $t = /* @__PURE__ */ u({
4576
+ $dynamicAnchor: () => rn,
4577
+ $id: () => tn,
4578
+ $schema: () => en,
4579
+ $vocabulary: () => nn,
4580
+ default: () => cn,
4581
+ properties: () => sn,
4582
+ title: () => an,
4583
+ type: () => on
4584
+ }), en, tn, nn, rn, an, on, sn, cn, ln = c((() => {
4585
+ en = "https://json-schema.org/draft/2020-12/schema", tn = "https://json-schema.org/draft/2020-12/meta/format-annotation", nn = { "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0 }, rn = "meta", an = "Format vocabulary meta-schema for annotation results", on = ["object", "boolean"], sn = { format: { type: "string" } }, cn = {
4586
+ $schema: en,
4587
+ $id: tn,
4588
+ $vocabulary: nn,
4589
+ $dynamicAnchor: rn,
4590
+ title: an,
4591
+ type: on,
4592
+ properties: sn
4593
+ };
4594
+ })), un = /* @__PURE__ */ u({
4595
+ $dynamicAnchor: () => pn,
4596
+ $id: () => fn,
4597
+ $schema: () => dn,
4598
+ $vocabulary: () => Q,
4599
+ default: () => _n,
4600
+ properties: () => gn,
4601
+ title: () => mn,
4602
+ type: () => hn
4603
+ }), dn, fn, Q, pn, mn, hn, gn, _n, vn = c((() => {
4604
+ dn = "https://json-schema.org/draft/2020-12/schema", fn = "https://json-schema.org/draft/2020-12/meta/meta-data", Q = { "https://json-schema.org/draft/2020-12/vocab/meta-data": !0 }, pn = "meta", mn = "Meta-data vocabulary meta-schema", hn = ["object", "boolean"], gn = {
4605
+ title: { type: "string" },
4606
+ description: { type: "string" },
4607
+ default: !0,
4608
+ deprecated: {
4609
+ type: "boolean",
4610
+ default: !1
4611
+ },
4612
+ readOnly: {
4613
+ type: "boolean",
4614
+ default: !1
4615
+ },
4616
+ writeOnly: {
4617
+ type: "boolean",
4618
+ default: !1
4619
+ },
4620
+ examples: {
4621
+ type: "array",
4622
+ items: !0
4623
+ }
4624
+ }, _n = {
4625
+ $schema: dn,
4626
+ $id: fn,
4627
+ $vocabulary: Q,
4628
+ $dynamicAnchor: pn,
4629
+ title: mn,
4630
+ type: hn,
4631
+ properties: gn
4632
+ };
4633
+ })), yn = /* @__PURE__ */ u({
4634
+ $defs: () => $,
4635
+ $dynamicAnchor: () => Cn,
4636
+ $id: () => xn,
4637
+ $schema: () => bn,
4638
+ $vocabulary: () => Sn,
4639
+ default: () => Dn,
4640
+ properties: () => En,
4641
+ title: () => wn,
4642
+ type: () => Tn
4643
+ }), bn, xn, Sn, Cn, wn, Tn, En, $, Dn, On = c((() => {
4644
+ bn = "https://json-schema.org/draft/2020-12/schema", xn = "https://json-schema.org/draft/2020-12/meta/validation", Sn = { "https://json-schema.org/draft/2020-12/vocab/validation": !0 }, Cn = "meta", wn = "Validation vocabulary meta-schema", Tn = ["object", "boolean"], En = {
4645
+ type: { anyOf: [{ $ref: "#/$defs/simpleTypes" }, {
4646
+ type: "array",
4647
+ items: { $ref: "#/$defs/simpleTypes" },
4648
+ minItems: 1,
4649
+ uniqueItems: !0
4650
+ }] },
4651
+ const: !0,
4652
+ enum: {
4653
+ type: "array",
4654
+ items: !0
4655
+ },
4656
+ multipleOf: {
4657
+ type: "number",
4658
+ exclusiveMinimum: 0
4659
+ },
4660
+ maximum: { type: "number" },
4661
+ exclusiveMaximum: { type: "number" },
4662
+ minimum: { type: "number" },
4663
+ exclusiveMinimum: { type: "number" },
4664
+ maxLength: { $ref: "#/$defs/nonNegativeInteger" },
4665
+ minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
4666
+ pattern: {
4667
+ type: "string",
4668
+ format: "regex"
4669
+ },
4670
+ maxItems: { $ref: "#/$defs/nonNegativeInteger" },
4671
+ minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
4672
+ uniqueItems: {
4673
+ type: "boolean",
4674
+ default: !1
4675
+ },
4676
+ maxContains: { $ref: "#/$defs/nonNegativeInteger" },
4677
+ minContains: {
4678
+ $ref: "#/$defs/nonNegativeInteger",
4679
+ default: 1
4680
+ },
4681
+ maxProperties: { $ref: "#/$defs/nonNegativeInteger" },
4682
+ minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
4683
+ required: { $ref: "#/$defs/stringArray" },
4684
+ dependentRequired: {
4685
+ type: "object",
4686
+ additionalProperties: { $ref: "#/$defs/stringArray" }
4687
+ }
4688
+ }, $ = {
4689
+ nonNegativeInteger: {
4690
+ type: "integer",
4691
+ minimum: 0
4692
+ },
4693
+ nonNegativeIntegerDefault0: {
4694
+ $ref: "#/$defs/nonNegativeInteger",
4695
+ default: 0
4696
+ },
4697
+ simpleTypes: { enum: [
4698
+ "array",
4699
+ "boolean",
4700
+ "integer",
4701
+ "null",
4702
+ "number",
4703
+ "object",
4704
+ "string"
4705
+ ] },
4706
+ stringArray: {
4707
+ type: "array",
4708
+ items: { type: "string" },
4709
+ uniqueItems: !0,
4710
+ default: []
4711
+ }
4712
+ }, Dn = {
4713
+ $schema: bn,
4714
+ $id: xn,
4715
+ $vocabulary: Sn,
4716
+ $dynamicAnchor: Cn,
4717
+ title: wn,
4718
+ type: Tn,
4719
+ properties: En,
4720
+ $defs: $
4721
+ };
4722
+ })), kn = /* @__PURE__ */ l(((e) => {
4723
+ Object.defineProperty(e, "__esModule", { value: !0 });
4724
+ var t = (ut(), f($e).default), n = (xt(), f(dt).default), r = (jt(), f(St).default), i = (Vt(), f(Mt).default), a = (Qt(), f(Ht).default), o = (ln(), f($t).default), s = (vn(), f(un).default), c = (On(), f(yn).default), l = ["/properties"];
4725
+ function u(e) {
4726
+ return [
4727
+ t,
4728
+ n,
4729
+ r,
4730
+ i,
4731
+ a,
4732
+ u(this, o),
4733
+ s,
4734
+ u(this, c)
4735
+ ].forEach((e) => this.addMetaSchema(e, void 0, !1)), this;
4736
+ function u(t, n) {
4737
+ return e ? t.$dataMetaSchema(n, l) : n;
4738
+ }
4739
+ }
4740
+ e.default = u;
4741
+ })), An = (/* @__PURE__ */ l(((e, t) => {
4742
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.MissingRefError = e.ValidationError = e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = e.Ajv2020 = void 0;
4743
+ var n = J(), r = Xe(), i = Qe(), a = kn(), o = "https://json-schema.org/draft/2020-12/schema", s = class extends n.default {
4744
+ constructor(e = {}) {
4745
+ super({
4746
+ ...e,
4747
+ dynamicRef: !0,
4748
+ next: !0,
4749
+ unevaluated: !0
4750
+ });
4751
+ }
4752
+ _addVocabularies() {
4753
+ super._addVocabularies(), r.default.forEach((e) => this.addVocabulary(e)), this.opts.discriminator && this.addKeyword(i.default);
4754
+ }
4755
+ _addDefaultMetaSchema() {
4756
+ super._addDefaultMetaSchema();
4757
+ let { $data: e, meta: t } = this.opts;
4758
+ t && (a.default.call(this, e), this.refs["http://json-schema.org/schema"] = o);
4759
+ }
4760
+ defaultMeta() {
4761
+ return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(o) ? o : void 0);
4762
+ }
4763
+ };
4764
+ e.Ajv2020 = s, t.exports = e = s, t.exports.Ajv2020 = s, Object.defineProperty(e, "__esModule", { value: !0 }), e.default = s;
4765
+ var c = L();
4766
+ Object.defineProperty(e, "KeywordCxt", {
4767
+ enumerable: !0,
4768
+ get: function() {
4769
+ return c.KeywordCxt;
4770
+ }
4771
+ });
4772
+ var l = S();
4773
+ Object.defineProperty(e, "_", {
4774
+ enumerable: !0,
4775
+ get: function() {
4776
+ return l._;
4777
+ }
4778
+ }), Object.defineProperty(e, "str", {
4779
+ enumerable: !0,
4780
+ get: function() {
4781
+ return l.str;
4782
+ }
4783
+ }), Object.defineProperty(e, "stringify", {
4784
+ enumerable: !0,
4785
+ get: function() {
4786
+ return l.stringify;
4787
+ }
4788
+ }), Object.defineProperty(e, "nil", {
4789
+ enumerable: !0,
4790
+ get: function() {
4791
+ return l.nil;
4792
+ }
4793
+ }), Object.defineProperty(e, "Name", {
4794
+ enumerable: !0,
4795
+ get: function() {
4796
+ return l.Name;
4797
+ }
4798
+ }), Object.defineProperty(e, "CodeGen", {
4799
+ enumerable: !0,
4800
+ get: function() {
4801
+ return l.CodeGen;
4802
+ }
4803
+ });
4804
+ var u = R();
4805
+ Object.defineProperty(e, "ValidationError", {
4806
+ enumerable: !0,
4807
+ get: function() {
4808
+ return u.default;
4809
+ }
4810
+ });
4811
+ var d = z();
4812
+ Object.defineProperty(e, "MissingRefError", {
4813
+ enumerable: !0,
4814
+ get: function() {
4815
+ return d.default;
4816
+ }
4817
+ });
4818
+ })))(), jn = /* @__PURE__ */ new Map();
4819
+ function Mn(e) {
4820
+ let t = jn.get(e);
4821
+ if (t) return t;
4822
+ let n = new An.Ajv2020({
4823
+ allErrors: !0,
4824
+ strict: !1
4825
+ }).compile(g(e));
4826
+ return jn.set(e, n), n;
4827
+ }
4828
+ function Nn(e) {
4829
+ return (e ?? []).map((e) => `${e.instancePath === "" ? "<root>" : e.instancePath}: ${e.message ?? "invalid"}`);
4830
+ }
4831
+ function Pn(e, t) {
4832
+ let n = Mn(e);
4833
+ if (n(t)) return {
4834
+ ok: !0,
4835
+ value: t
4836
+ };
4837
+ let r = Nn(n.errors);
4838
+ return {
4839
+ ok: !1,
4840
+ error: {
4841
+ kind: "contract-violation",
4842
+ schema: e,
4843
+ errors: r,
4844
+ message: `the quire payload does not satisfy the published ${e} contract (${r.length} error${r.length === 1 ? "" : "s"}). This is a shape drift between the quire release in use and the contract quoin pins, not a defect in the document being read.`
4845
+ }
4846
+ };
4847
+ }
4848
+ function Fn(e) {
4849
+ return Pn("coverage-v1.schema.json", e);
4850
+ }
4851
+ function In(e) {
4852
+ return Ln(e, "coverage-v1.schema.json", Fn);
4853
+ }
4854
+ function Ln(e, t, n) {
4855
+ let r;
4856
+ try {
4857
+ r = JSON.parse(e);
4858
+ } catch (e) {
4859
+ return {
4860
+ ok: !1,
4861
+ error: {
4862
+ kind: "contract-violation",
4863
+ schema: t,
4864
+ errors: [`<root>: ${e instanceof Error ? e.message : String(e)}`],
4865
+ message: `the quire output is not valid JSON, so the ${t} contract could not be checked. Run the command directly to see what it emitted — a diagnostic on stdout rather than stderr is the usual cause.`
4866
+ }
4867
+ };
4868
+ }
4869
+ return n(r);
4870
+ }
4871
+ //#endregion
4872
+ export { y as n, In as t };