@rippling/pebble-sdui-mobile 0.15.0 → 0.17.0

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