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