@graffiti-garden/wrapper-vue 0.7.2 → 1.0.3

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