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