z-schema 12.0.2 → 12.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +34 -3
- package/dist/format-validators.js +34 -3
- package/package.json +3 -3
- package/src/format-validators.ts +34 -3
- package/umd/ZSchema.js +34 -3
- package/umd/ZSchema.min.js +1 -1
package/cjs/index.js
CHANGED
|
@@ -4297,7 +4297,9 @@ const durationValidator = (input) => {
|
|
|
4297
4297
|
}
|
|
4298
4298
|
const datePart = parts[0];
|
|
4299
4299
|
const timePart = parts.length === 2 ? parts[1] : undefined;
|
|
4300
|
-
|
|
4300
|
+
// RFC 3339 Appendix A ABNF: dur-year = 1*DIGIT "Y" [dur-month], dur-month = 1*DIGIT "M" [dur-day]
|
|
4301
|
+
// Y can only be followed by M (not D directly), so P1Y2D is invalid
|
|
4302
|
+
if (datePart.length > 0 && !/^(?:\d+Y(?:\d+M(?:\d+D)?)?|\d+M(?:\d+D)?|\d+D)$/.test(datePart)) {
|
|
4301
4303
|
return false;
|
|
4302
4304
|
}
|
|
4303
4305
|
const hasDateComponent = /\d+[YMD]/.test(datePart);
|
|
@@ -4306,7 +4308,9 @@ const durationValidator = (input) => {
|
|
|
4306
4308
|
if (timePart.length === 0) {
|
|
4307
4309
|
return false;
|
|
4308
4310
|
}
|
|
4309
|
-
|
|
4311
|
+
// RFC 3339 Appendix A ABNF: dur-hour = 1*DIGIT "H" [dur-minute], dur-minute = 1*DIGIT "M" [dur-second]
|
|
4312
|
+
// H can only be followed by M (not S directly), so PT1H2S is invalid
|
|
4313
|
+
if (!/^(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S)$/.test(timePart)) {
|
|
4310
4314
|
return false;
|
|
4311
4315
|
}
|
|
4312
4316
|
hasTimeComponent = /\d+[HMS]/.test(timePart);
|
|
@@ -4323,13 +4327,25 @@ const uuidValidator = (input) => {
|
|
|
4323
4327
|
return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(input);
|
|
4324
4328
|
};
|
|
4325
4329
|
const strictUriValidator = (uri) => typeof uri !== 'string' || isURLModule.default(uri);
|
|
4330
|
+
const hasValidPercentEncoding = (str) => {
|
|
4331
|
+
for (let i = 0; i < str.length; i++) {
|
|
4332
|
+
if (str[i] === '%') {
|
|
4333
|
+
if (i + 2 >= str.length || !/[0-9a-fA-F]/.test(str[i + 1]) || !/[0-9a-fA-F]/.test(str[i + 2])) {
|
|
4334
|
+
return false;
|
|
4335
|
+
}
|
|
4336
|
+
}
|
|
4337
|
+
}
|
|
4338
|
+
return true;
|
|
4339
|
+
};
|
|
4326
4340
|
const uriValidator = function (uri) {
|
|
4327
4341
|
if (typeof uri !== 'string')
|
|
4328
4342
|
return true;
|
|
4329
4343
|
// eslint-disable-next-line no-control-regex
|
|
4330
4344
|
if (/[^\x00-\x7F]/.test(uri))
|
|
4331
4345
|
return false;
|
|
4332
|
-
|
|
4346
|
+
if (!hasValidPercentEncoding(uri))
|
|
4347
|
+
return false;
|
|
4348
|
+
const match = uri.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\/([^/?#]*)/);
|
|
4333
4349
|
if (match) {
|
|
4334
4350
|
const authority = match[2];
|
|
4335
4351
|
const atIndex = authority.indexOf('@');
|
|
@@ -4339,6 +4355,21 @@ const uriValidator = function (uri) {
|
|
|
4339
4355
|
return false;
|
|
4340
4356
|
}
|
|
4341
4357
|
}
|
|
4358
|
+
// Validate port: must be numeric
|
|
4359
|
+
let hostPort = atIndex >= 0 ? authority.substring(atIndex + 1) : authority;
|
|
4360
|
+
if (hostPort.startsWith('[')) {
|
|
4361
|
+
const bracketEnd = hostPort.indexOf(']');
|
|
4362
|
+
if (bracketEnd >= 0) {
|
|
4363
|
+
hostPort = hostPort.substring(bracketEnd + 1);
|
|
4364
|
+
}
|
|
4365
|
+
}
|
|
4366
|
+
const colonIndex = hostPort.lastIndexOf(':');
|
|
4367
|
+
if (colonIndex >= 0) {
|
|
4368
|
+
const port = hostPort.substring(colonIndex + 1);
|
|
4369
|
+
if (port.length > 0 && !/^\d+$/.test(port)) {
|
|
4370
|
+
return false;
|
|
4371
|
+
}
|
|
4372
|
+
}
|
|
4342
4373
|
}
|
|
4343
4374
|
return /^[a-zA-Z][a-zA-Z0-9+.-]*:[^"\\<>^{}^`| ]*$/.test(uri);
|
|
4344
4375
|
};
|
|
@@ -132,7 +132,9 @@ const durationValidator = (input) => {
|
|
|
132
132
|
}
|
|
133
133
|
const datePart = parts[0];
|
|
134
134
|
const timePart = parts.length === 2 ? parts[1] : undefined;
|
|
135
|
-
|
|
135
|
+
// RFC 3339 Appendix A ABNF: dur-year = 1*DIGIT "Y" [dur-month], dur-month = 1*DIGIT "M" [dur-day]
|
|
136
|
+
// Y can only be followed by M (not D directly), so P1Y2D is invalid
|
|
137
|
+
if (datePart.length > 0 && !/^(?:\d+Y(?:\d+M(?:\d+D)?)?|\d+M(?:\d+D)?|\d+D)$/.test(datePart)) {
|
|
136
138
|
return false;
|
|
137
139
|
}
|
|
138
140
|
const hasDateComponent = /\d+[YMD]/.test(datePart);
|
|
@@ -141,7 +143,9 @@ const durationValidator = (input) => {
|
|
|
141
143
|
if (timePart.length === 0) {
|
|
142
144
|
return false;
|
|
143
145
|
}
|
|
144
|
-
|
|
146
|
+
// RFC 3339 Appendix A ABNF: dur-hour = 1*DIGIT "H" [dur-minute], dur-minute = 1*DIGIT "M" [dur-second]
|
|
147
|
+
// H can only be followed by M (not S directly), so PT1H2S is invalid
|
|
148
|
+
if (!/^(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S)$/.test(timePart)) {
|
|
145
149
|
return false;
|
|
146
150
|
}
|
|
147
151
|
hasTimeComponent = /\d+[HMS]/.test(timePart);
|
|
@@ -158,13 +162,25 @@ const uuidValidator = (input) => {
|
|
|
158
162
|
return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(input);
|
|
159
163
|
};
|
|
160
164
|
const strictUriValidator = (uri) => typeof uri !== 'string' || isURLModule.default(uri);
|
|
165
|
+
const hasValidPercentEncoding = (str) => {
|
|
166
|
+
for (let i = 0; i < str.length; i++) {
|
|
167
|
+
if (str[i] === '%') {
|
|
168
|
+
if (i + 2 >= str.length || !/[0-9a-fA-F]/.test(str[i + 1]) || !/[0-9a-fA-F]/.test(str[i + 2])) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return true;
|
|
174
|
+
};
|
|
161
175
|
const uriValidator = function (uri) {
|
|
162
176
|
if (typeof uri !== 'string')
|
|
163
177
|
return true;
|
|
164
178
|
// eslint-disable-next-line no-control-regex
|
|
165
179
|
if (/[^\x00-\x7F]/.test(uri))
|
|
166
180
|
return false;
|
|
167
|
-
|
|
181
|
+
if (!hasValidPercentEncoding(uri))
|
|
182
|
+
return false;
|
|
183
|
+
const match = uri.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\/([^/?#]*)/);
|
|
168
184
|
if (match) {
|
|
169
185
|
const authority = match[2];
|
|
170
186
|
const atIndex = authority.indexOf('@');
|
|
@@ -174,6 +190,21 @@ const uriValidator = function (uri) {
|
|
|
174
190
|
return false;
|
|
175
191
|
}
|
|
176
192
|
}
|
|
193
|
+
// Validate port: must be numeric
|
|
194
|
+
let hostPort = atIndex >= 0 ? authority.substring(atIndex + 1) : authority;
|
|
195
|
+
if (hostPort.startsWith('[')) {
|
|
196
|
+
const bracketEnd = hostPort.indexOf(']');
|
|
197
|
+
if (bracketEnd >= 0) {
|
|
198
|
+
hostPort = hostPort.substring(bracketEnd + 1);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const colonIndex = hostPort.lastIndexOf(':');
|
|
202
|
+
if (colonIndex >= 0) {
|
|
203
|
+
const port = hostPort.substring(colonIndex + 1);
|
|
204
|
+
if (port.length > 0 && !/^\d+$/.test(port)) {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
177
208
|
}
|
|
178
209
|
return /^[a-zA-Z][a-zA-Z0-9+.-]*:[^"\\<>^{}^`| ]*$/.test(uri);
|
|
179
210
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "z-schema",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.3",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22.0.0"
|
|
6
6
|
},
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
98
98
|
"@rollup/plugin-json": "^6.1.0",
|
|
99
99
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
100
|
-
"@rollup/plugin-terser": "^0.
|
|
100
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
101
101
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
102
102
|
"@types/lodash.isequal": "^4.5.8",
|
|
103
103
|
"@types/node": "^25.2.0",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"lodash.isequal": "^4.5.0",
|
|
116
116
|
"prettier": "^3.8.1",
|
|
117
117
|
"rimraf": "^6.1.2",
|
|
118
|
-
"rollup": "^4.
|
|
118
|
+
"rollup": "^4.59.0",
|
|
119
119
|
"rollup-plugin-dts": "^6.3.0",
|
|
120
120
|
"tslib": "^2.8.1",
|
|
121
121
|
"typescript": "^5.9.3",
|
package/src/format-validators.ts
CHANGED
|
@@ -157,7 +157,9 @@ const durationValidator: FormatValidatorFn = (input: unknown) => {
|
|
|
157
157
|
const datePart = parts[0];
|
|
158
158
|
const timePart = parts.length === 2 ? parts[1] : undefined;
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
// RFC 3339 Appendix A ABNF: dur-year = 1*DIGIT "Y" [dur-month], dur-month = 1*DIGIT "M" [dur-day]
|
|
161
|
+
// Y can only be followed by M (not D directly), so P1Y2D is invalid
|
|
162
|
+
if (datePart.length > 0 && !/^(?:\d+Y(?:\d+M(?:\d+D)?)?|\d+M(?:\d+D)?|\d+D)$/.test(datePart)) {
|
|
161
163
|
return false;
|
|
162
164
|
}
|
|
163
165
|
|
|
@@ -168,7 +170,9 @@ const durationValidator: FormatValidatorFn = (input: unknown) => {
|
|
|
168
170
|
if (timePart.length === 0) {
|
|
169
171
|
return false;
|
|
170
172
|
}
|
|
171
|
-
|
|
173
|
+
// RFC 3339 Appendix A ABNF: dur-hour = 1*DIGIT "H" [dur-minute], dur-minute = 1*DIGIT "M" [dur-second]
|
|
174
|
+
// H can only be followed by M (not S directly), so PT1H2S is invalid
|
|
175
|
+
if (!/^(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S)$/.test(timePart)) {
|
|
172
176
|
return false;
|
|
173
177
|
}
|
|
174
178
|
hasTimeComponent = /\d+[HMS]/.test(timePart);
|
|
@@ -189,11 +193,23 @@ const uuidValidator: FormatValidatorFn = (input: unknown) => {
|
|
|
189
193
|
|
|
190
194
|
const strictUriValidator: FormatValidatorFn = (uri: unknown) => typeof uri !== 'string' || isURLModule.default(uri);
|
|
191
195
|
|
|
196
|
+
const hasValidPercentEncoding = (str: string): boolean => {
|
|
197
|
+
for (let i = 0; i < str.length; i++) {
|
|
198
|
+
if (str[i] === '%') {
|
|
199
|
+
if (i + 2 >= str.length || !/[0-9a-fA-F]/.test(str[i + 1]) || !/[0-9a-fA-F]/.test(str[i + 2])) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return true;
|
|
205
|
+
};
|
|
206
|
+
|
|
192
207
|
const uriValidator: FormatValidatorFn = function (uri: unknown) {
|
|
193
208
|
if (typeof uri !== 'string') return true;
|
|
194
209
|
// eslint-disable-next-line no-control-regex
|
|
195
210
|
if (/[^\x00-\x7F]/.test(uri)) return false;
|
|
196
|
-
|
|
211
|
+
if (!hasValidPercentEncoding(uri)) return false;
|
|
212
|
+
const match = uri.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\/([^/?#]*)/);
|
|
197
213
|
if (match) {
|
|
198
214
|
const authority = match[2];
|
|
199
215
|
const atIndex = authority.indexOf('@');
|
|
@@ -203,6 +219,21 @@ const uriValidator: FormatValidatorFn = function (uri: unknown) {
|
|
|
203
219
|
return false;
|
|
204
220
|
}
|
|
205
221
|
}
|
|
222
|
+
// Validate port: must be numeric
|
|
223
|
+
let hostPort = atIndex >= 0 ? authority.substring(atIndex + 1) : authority;
|
|
224
|
+
if (hostPort.startsWith('[')) {
|
|
225
|
+
const bracketEnd = hostPort.indexOf(']');
|
|
226
|
+
if (bracketEnd >= 0) {
|
|
227
|
+
hostPort = hostPort.substring(bracketEnd + 1);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const colonIndex = hostPort.lastIndexOf(':');
|
|
231
|
+
if (colonIndex >= 0) {
|
|
232
|
+
const port = hostPort.substring(colonIndex + 1);
|
|
233
|
+
if (port.length > 0 && !/^\d+$/.test(port)) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
206
237
|
}
|
|
207
238
|
return /^[a-zA-Z][a-zA-Z0-9+.-]*:[^"\\<>^{}^`| ]*$/.test(uri);
|
|
208
239
|
};
|
package/umd/ZSchema.js
CHANGED
|
@@ -4299,7 +4299,9 @@
|
|
|
4299
4299
|
}
|
|
4300
4300
|
const datePart = parts[0];
|
|
4301
4301
|
const timePart = parts.length === 2 ? parts[1] : undefined;
|
|
4302
|
-
|
|
4302
|
+
// RFC 3339 Appendix A ABNF: dur-year = 1*DIGIT "Y" [dur-month], dur-month = 1*DIGIT "M" [dur-day]
|
|
4303
|
+
// Y can only be followed by M (not D directly), so P1Y2D is invalid
|
|
4304
|
+
if (datePart.length > 0 && !/^(?:\d+Y(?:\d+M(?:\d+D)?)?|\d+M(?:\d+D)?|\d+D)$/.test(datePart)) {
|
|
4303
4305
|
return false;
|
|
4304
4306
|
}
|
|
4305
4307
|
const hasDateComponent = /\d+[YMD]/.test(datePart);
|
|
@@ -4308,7 +4310,9 @@
|
|
|
4308
4310
|
if (timePart.length === 0) {
|
|
4309
4311
|
return false;
|
|
4310
4312
|
}
|
|
4311
|
-
|
|
4313
|
+
// RFC 3339 Appendix A ABNF: dur-hour = 1*DIGIT "H" [dur-minute], dur-minute = 1*DIGIT "M" [dur-second]
|
|
4314
|
+
// H can only be followed by M (not S directly), so PT1H2S is invalid
|
|
4315
|
+
if (!/^(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S)$/.test(timePart)) {
|
|
4312
4316
|
return false;
|
|
4313
4317
|
}
|
|
4314
4318
|
hasTimeComponent = /\d+[HMS]/.test(timePart);
|
|
@@ -4325,13 +4329,25 @@
|
|
|
4325
4329
|
return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(input);
|
|
4326
4330
|
};
|
|
4327
4331
|
const strictUriValidator = (uri) => typeof uri !== 'string' || isURLModule.default(uri);
|
|
4332
|
+
const hasValidPercentEncoding = (str) => {
|
|
4333
|
+
for (let i = 0; i < str.length; i++) {
|
|
4334
|
+
if (str[i] === '%') {
|
|
4335
|
+
if (i + 2 >= str.length || !/[0-9a-fA-F]/.test(str[i + 1]) || !/[0-9a-fA-F]/.test(str[i + 2])) {
|
|
4336
|
+
return false;
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4340
|
+
return true;
|
|
4341
|
+
};
|
|
4328
4342
|
const uriValidator = function (uri) {
|
|
4329
4343
|
if (typeof uri !== 'string')
|
|
4330
4344
|
return true;
|
|
4331
4345
|
// eslint-disable-next-line no-control-regex
|
|
4332
4346
|
if (/[^\x00-\x7F]/.test(uri))
|
|
4333
4347
|
return false;
|
|
4334
|
-
|
|
4348
|
+
if (!hasValidPercentEncoding(uri))
|
|
4349
|
+
return false;
|
|
4350
|
+
const match = uri.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\/([^/?#]*)/);
|
|
4335
4351
|
if (match) {
|
|
4336
4352
|
const authority = match[2];
|
|
4337
4353
|
const atIndex = authority.indexOf('@');
|
|
@@ -4341,6 +4357,21 @@
|
|
|
4341
4357
|
return false;
|
|
4342
4358
|
}
|
|
4343
4359
|
}
|
|
4360
|
+
// Validate port: must be numeric
|
|
4361
|
+
let hostPort = atIndex >= 0 ? authority.substring(atIndex + 1) : authority;
|
|
4362
|
+
if (hostPort.startsWith('[')) {
|
|
4363
|
+
const bracketEnd = hostPort.indexOf(']');
|
|
4364
|
+
if (bracketEnd >= 0) {
|
|
4365
|
+
hostPort = hostPort.substring(bracketEnd + 1);
|
|
4366
|
+
}
|
|
4367
|
+
}
|
|
4368
|
+
const colonIndex = hostPort.lastIndexOf(':');
|
|
4369
|
+
if (colonIndex >= 0) {
|
|
4370
|
+
const port = hostPort.substring(colonIndex + 1);
|
|
4371
|
+
if (port.length > 0 && !/^\d+$/.test(port)) {
|
|
4372
|
+
return false;
|
|
4373
|
+
}
|
|
4374
|
+
}
|
|
4344
4375
|
}
|
|
4345
4376
|
return /^[a-zA-Z][a-zA-Z0-9+.-]*:[^"\\<>^{}^`| ]*$/.test(uri);
|
|
4346
4377
|
};
|
package/umd/ZSchema.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZSchema={})}(this,function(e){"use strict";const t=e=>{const t=e.indexOf("#");return-1===t?e:e.slice(0,t)},r=e=>/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(e),n=100,i=e=>"object"==typeof e?null===e?"null":Array.isArray(e)?"array":"object":"number"==typeof e?Number.isFinite(e)?e%1==0?"integer":"number":Number.isNaN(e)?"not-a-number":"unknown-number":typeof e;function o(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function a(e){return"number"==typeof e&&Number.isFinite(e)&&e%1==0}const s=["enum","const","default","examples"],c=e=>e.startsWith("__$"),d=e=>"string"==typeof e.$schema&&e.$schema.includes("draft-04")?e.id:e.$id??e.id,f=(e,n,i,a,l=100,u=0)=>{if("object"!=typeof e||null===e)return;if(!n)return e;if(u>=l)throw new Error(`Maximum recursion depth (${l}) exceeded in findId. If your schema is deeply nested and valid, increase the maxRecursionDepth option.`);const p=a??i,m=d(e);let h=p;if(m)if(r(m))h=t(m);else if(p&&r(p))try{h=t(new URL(m,p).toString())}catch{}if(!i||h===i){if(m&&(m===n||"#"===m[0]&&m.substring(1)===n))return e;if(e.$anchor===n||e.$dynamicAnchor===n)return e}let y;if(Array.isArray(e))for(let t=0;t<e.length;t++)if(y=f(e[t],n,i,h,l,u+1),y)return y;if(o(e)){const t=Object.keys(e);for(let r=t.length-1;r>=0;r--){const o=t[r];if(!c(o)&&!s.includes(o)&&(y=f(e[o],n,i,h,l,u+1),y))return y}}},l={INVALID_TYPE:"Expected type {0} but found type {1}",INVALID_FORMAT:"Object didn't pass validation for format {0}: {1}",ENUM_MISMATCH:"No enum match for: {0}",ENUM_CASE_MISMATCH:"Enum does not match case for: {0}",ANY_OF_MISSING:"Data does not match any schemas from 'anyOf'",ONE_OF_MISSING:"Data does not match any schemas from 'oneOf'",ONE_OF_MULTIPLE:"Data is valid against more than one schema from 'oneOf'",NOT_PASSED:"Data matches schema from 'not'",ARRAY_LENGTH_SHORT:"Array is too short ({0}), minimum {1}",ARRAY_LENGTH_LONG:"Array is too long ({0}), maximum {1}",ARRAY_UNIQUE:"Array items are not unique (indexes {0} and {1})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",ARRAY_UNEVALUATED_ITEMS:"Unevaluated items are not allowed",MULTIPLE_OF:"Value {0} is not a multiple of {1}",MINIMUM:"Value {0} is less than minimum {1}",MINIMUM_EXCLUSIVE:"Value {0} is equal or less than exclusive minimum {1}",MAXIMUM:"Value {0} is greater than maximum {1}",MAXIMUM_EXCLUSIVE:"Value {0} is equal or greater than exclusive maximum {1}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({0}), minimum {1}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({0}), maximum {1}",OBJECT_MISSING_REQUIRED_PROPERTY:"Missing required property: {0}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed: {0}",OBJECT_UNEVALUATED_PROPERTIES:"Unevaluated properties are not allowed: {0}",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {0} (due to key: {1})",MIN_LENGTH:"String is too short ({0} chars), minimum {1}",MAX_LENGTH:"String is too long ({0} chars), maximum {1}",PATTERN:"String does not match pattern {0}: {1}",KEYWORD_TYPE_EXPECTED:"Keyword '{0}' is expected to be of type '{1}'",KEYWORD_UNDEFINED_STRICT:"Keyword '{0}' must be defined in strict mode",KEYWORD_UNEXPECTED:"Keyword '{0}' is not expected to appear in the schema",KEYWORD_MUST_BE:"Keyword '{0}' must be {1}",KEYWORD_DEPENDENCY:"Keyword '{0}' requires keyword '{1}'",KEYWORD_PATTERN:"Keyword '{0}' is not a valid RegExp pattern: {1}",KEYWORD_VALUE_TYPE:"Each element of keyword '{0}' array must be a '{1}'",UNKNOWN_FORMAT:"There is no validation function for format '{0}'",CUSTOM_MODE_FORCE_PROPERTIES:"{0} must define at least one property if present",REF_UNRESOLVED:"Reference has not been resolved during compilation: {0}",UNRESOLVABLE_REFERENCE:"Reference could not be resolved: {0}",SCHEMA_NOT_REACHABLE:"Validator was not able to read schema with uri: {0}",SCHEMA_TYPE_EXPECTED:"Schema is expected to be of type 'object'",SCHEMA_NOT_AN_OBJECT:"Schema is not an object: {0}",ASYNC_TIMEOUT:"{0} asynchronous task(s) have timed out after {1} ms",PARENT_SCHEMA_VALIDATION_FAILED:"Schema failed to validate against its parent schema, see inner errors for details.",REMOTE_NOT_VALID:"Remote reference didn't compile successfully: {0}",SCHEMA_IS_FALSE:'Boolean schema "false" is always invalid.',CONST:"Value does not match const: {0}",CONTAINS:"Array does not contain an item matching the schema",PROPERTY_NAMES:"Property name {0} does not match the propertyNames schema",COLLECT_EVALUATED_DEPTH_EXCEEDED:"Schema nesting depth exceeded maximum ({0}) during unevaluated items/properties collection",MAX_RECURSION_DEPTH_EXCEEDED:"Maximum recursion depth ({0}) exceeded. If your schema or data is deeply nested and valid, increase the maxRecursionDepth option."};class u extends Error{name;details;constructor(e,t){super(e),this.name="z-schema validation error",this.details=t}}function p({message:e,details:t}){return new u(e||"",t)}function m(e,t,r,n){Object.hasOwn(e,r)&&Object.defineProperty(t,r,{value:n?n(e[r]):e[r],enumerable:!0,writable:!0,configurable:!0})}const h=e=>{if(null==e||"object"!=typeof e)return e;let t;if(Array.isArray(e)){t=[];for(let r=0;r<e.length;r++)t[r]=e[r]}else{t={};const r=Object.keys(e).sort();for(const n of r)m(e,t,n)}return t},y=(e,t=100)=>{let r=0;const n=new Map,i=[],o=(e,a)=>{if("object"!=typeof e||null===e)return e;if(a>=t)throw new Error(`Maximum recursion depth (${t}) exceeded in deepClone. If your schema or data is deeply nested and valid, increase the maxRecursionDepth option.`);let s;const c=n.get(e);if(void 0!==c)return i[c];if(n.set(e,r++),Array.isArray(e)){s=[],i.push(s);for(let t=0;t<e.length;t++)s[t]=o(e[t],a+1)}else{s={},i.push(s);const t=Object.keys(e).sort();for(const r of t)m(e,s,r,e=>o(e,a+1))}return s};return o(e,0)},v=(e,t,r,i=0)=>{const a=r?.caseInsensitiveComparison||!1,s=r?.maxDepth??n;if(e===t)return!0;if(!0===a&&"string"==typeof e&&"string"==typeof t&&e.toUpperCase()===t.toUpperCase())return!0;if(i>=s)throw new Error(`Maximum recursion depth (${s}) exceeded in areEqual. If your data is deeply nested and valid, increase the maxRecursionDepth option.`);let c,d;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(d=e.length,c=0;c<d;c++)if(!v(e[c],t[c],r,i+1))return!1;return!0}if(o(e)&&o(t)){const n=g(e),o=g(t);if(!v(n,o,r,i+1))return!1;for(d=n.length,c=0;c<d;c++)if(!v(e[n[c]],t[n[c]],r,i+1))return!1;return!0}return!1},E=e=>decodeURIComponent(e).replace(/~[0-1]/g,e=>"~1"===e?"/":"~"),g=e=>Object.keys(e).sort(),_=(e,t)=>("string"==typeof t&&(t=t.split(".")),t.reduce((e,t)=>e&&void 0!==e[t]?e[t]:void 0,e)),$=Symbol.for("z-schema/json"),O=Symbol.for("z-schema/schema");class b{asyncTasks=[];commonErrorMessage;__$recursiveAnchorStack=[];__$dynamicScopeStack=[];__validationResultCache=new Map;errors=[];json;path=[];schemaPath=[];rootSchema;parentReport;options;reportOptions;validateOptions={};constructor(e,t,r){this.parentReport=e instanceof b?e:void 0,this.options=e instanceof b?e.options:e||{},e instanceof b?(this.reportOptions=t||{},this.validateOptions=r||e.validateOptions,this.__$recursiveAnchorStack=[...e.__$recursiveAnchorStack],this.__$dynamicScopeStack=[...e.__$dynamicScopeStack],this.__validationResultCache=e.__validationResultCache):(this.reportOptions={},this.validateOptions=t||{},this.__$recursiveAnchorStack=[],this.__$dynamicScopeStack=[],this.__validationResultCache=new Map)}isValid(){if(this.asyncTasks.length>0)throw new Error("Async tasks pending, can't answer isValid");return 0===this.errors.length}addAsyncTask(e,t,r){this.asyncTasks.push([e,t,r])}addAsyncTaskWithPath(e,t,r){const n=h(this.path);this.asyncTasks.push([e,t,e=>{const t=this.path;this.path=n,r(e),this.path=t}])}getAncestor(e){if(this.parentReport)return this.parentReport.getSchemaId()===e?this.parentReport:this.parentReport.getAncestor(e)}processAsyncTasks(e,t){const r=Math.min(Math.max(e||2e3,0),6e4),n=Date.now()+r;let i=this.asyncTasks.length,o=!1;const a=()=>{setTimeout(()=>{const e=0===this.errors.length,r=e?void 0:p({details:this.errors});t(r,e)},0)},s=e=>t=>{o||(e(t),0===--i&&a())};if(0===i||this.errors.length>0&&this.options.breakOnFirstError)return void a();for(let e=0;e<this.asyncTasks.length;e++){const[t,r,n]=this.asyncTasks[e];t(...r,s(n))}const c=()=>{if(!(o||i<=0))return Date.now()>=n?(o=!0,this.addError("ASYNC_TIMEOUT",[i,r]),void t(p({details:this.errors}),!1)):void setTimeout(c,10)};setTimeout(c,10)}getPath(e){let t=[];return this.parentReport&&(t=t.concat(this.parentReport.path)),t=t.concat(this.path),!0!==e?"#/"+t.map(function(e){return e=e.toString(),r(e)?"uri("+e+")":e.replace(/~/g,"~0").replace(/\//g,"~1")}).join("/"):t}getSchemaPath(){let e=[];return this.parentReport&&(e=e.concat(this.parentReport.schemaPath)),e=e.concat(this.schemaPath),e}getSchemaId(){if(!this.rootSchema)return;let e=[];for(this.parentReport&&(e=e.concat(this.parentReport.path)),e=e.concat(this.path);e.length>0;){const t=_(this.rootSchema,e);if(t&&t.id)return t.id;e.pop()}return this.rootSchema.id}hasError(e,t){for(let r=0;r<this.errors.length;r++)if(this.errors[r].code===e){let e=!0;for(let n=0;n<this.errors[r].params.length;n++)this.errors[r].params[n]!==t[n]&&(e=!1);if(e)return e}return!1}addError(e,t,r,n,i){if(!e)throw new Error("No errorCode passed into addError()");this.addCustomError(e,l[e],t,r,n,i)}getJson(){return this.json?this.json:this.parentReport?this.parentReport.getJson():void 0}addCustomError(e,t,r,n,i,a){if("number"==typeof this.reportOptions.maxErrors&&this.errors.length>=this.reportOptions.maxErrors)return;if(!t)throw new Error("No errorMessage known for code "+e);r=r||[];for(let e=0;e<r.length;e++){const n=null===r[e]||o(r[e])?JSON.stringify(r[e]):r[e];t=t.replace("{"+e+"}",n.toString())}const s={code:e,params:r,message:t,path:this.getPath(this.options.reportPathAsArray),schemaPath:this.getSchemaPath(),schemaId:this.getSchemaId(),keyword:a};if(s[O]=i,s[$]=this.getJson(),i&&"string"==typeof i?s.description=i:i&&"object"==typeof i&&(i.title&&(s.title=i.title),i.description&&(s.description=i.description)),null!=n){Array.isArray(n)||(n=[n]),s.inner=[];for(const e of n)for(const t of e.errors)s.inner.push(t);0===s.inner.length&&(s.inner=void 0)}Array.isArray(this.validateOptions.excludeErrors)&&this.validateOptions.excludeErrors.includes(e)||this.errors.push(s)}}const A={"draft-04":"http://json-schema.org/draft-04/schema#","draft-06":"http://json-schema.org/draft-06/schema#","draft-07":"http://json-schema.org/draft-07/schema#","draft2019-09":"https://json-schema.org/draft/2019-09/schema","draft2020-12":"https://json-schema.org/draft/2020-12/schema"},R={version:"draft2020-12",asyncTimeout:2e3,forceAdditional:!1,assumeAdditional:!1,enumCaseInsensitiveComparison:!1,forceItems:!1,forceMinItems:!1,forceMaxItems:!1,forceMinLength:!1,forceMaxLength:!1,forceProperties:!1,ignoreUnresolvableReferences:!1,noExtraKeywords:!1,noTypeless:!1,noEmptyStrings:!1,noEmptyArrays:!1,strictUris:!1,strictMode:!1,reportPathAsArray:!1,breakOnFirstError:!1,pedanticCheck:!1,ignoreUnknownFormats:!1,formatAssertions:null,customValidator:null,maxRecursionDepth:n},x=e=>{let t;if("object"==typeof e){let r=Object.keys(e);for(const e of r)if(void 0===R[e])throw new Error("Unexpected option passed to constructor: "+e);r=Object.keys(R);for(const t of r)void 0===e[t]&&(e[t]=h(R[t]));t=e}else t=h(R);return null!=t.asyncTimeout&&(t.asyncTimeout=Math.min(Math.max(t.asyncTimeout,0),6e4)),!0===t.strictMode&&(t.forceAdditional=!0,t.forceItems=!0,t.forceMaxLength=!0,t.forceProperties=!0,t.noExtraKeywords=!0,t.noTypeless=!0,t.noEmptyStrings=!0,t.noEmptyArrays=!0),t};function I(e){const r=t(e);if(r&&"__proto__"!==r&&"constructor"!==r&&"prototype"!==r)return r}const S=e=>{let t=d(e);return t&&r(t)||"string"!=typeof e.id||!r(e.id)||(t=e.id),t};function T(e,t,r,n){let i;return i="string"==typeof e?JSON.parse(e):y(e,n),i.id||(i.id=t),r&&(i.__$validationOptions=x(r)),i}class P{validator;static global_cache=Object.create(null);cache=Object.create(null);constructor(e){this.validator=e}static cacheSchemaByUri(e,t){const r=I(e);r&&(this.global_cache[r]=t)}cacheSchemaByUri(e,t){const r=I(e);r&&(this.cache[r]=t)}removeFromCacheByUri(e){const t=I(e);t&&delete this.cache[t]}checkCacheForUri(e){const t=I(e);return!!t&&null!=this.cache[t]}getSchema(e,t){return Array.isArray(t)?t.map(t=>this.getSchema(e,t)):"string"==typeof t?this.getSchemaByUri(e,t):y(t,this.validator.options.maxRecursionDepth)}fromCache(e){if("__proto__"===e||"constructor"===e||"prototype"===e)return;let t=this.cache[e];if(t)return t;if(t=P.global_cache[e],t){const n=y(t,this.validator.options.maxRecursionDepth);return(!n.id||!r(n.id)&&r(e))&&(n.id=e),this.cache[e]=n,n}}getSchemaByUri(e,n,i){if(i&&!r(n)){const e=S(i);if(e&&r(e)){const t=e.indexOf("#"),r=-1===t?e:e.slice(0,t);try{n=new URL(n,r).toString()}catch{}}}const o=I(n),a=(e=>{const t=e.indexOf("#");return-1===t?void 0:e.slice(t+1)})(n);let s,c=!1;if(o){const t=e.getAncestor(o);t?.rootSchema&&(s=t.rootSchema,c=!0)}if(!s&&i&&o){const e=S(i),r=e?t(e):void 0;r&&r===o&&(s=i)}if(s||(s=o?this.fromCache(o):i),!(s&&o&&r(o))||s.id&&r(s.id)||(s.id=o),s&&o){if(s!==i&&!c){let i;e.path.push(o);let a=!1;const c=s.id?e.getAncestor(s.id):void 0;if(c)i=c,a=!0;else{i=new b(e);const n=!s.id||!r(s.id);if(this.validator.sc.compileSchema(i,s,{noCache:n})){const r=this.validator.options;try{this.validator.options=s.__$validationOptions||this.validator.options;const r="string"==typeof s.$schema?t(s.$schema):void 0,n=e.getSchemaId();!!r&&r.length>0&&(n===r||!!e.getAncestor(r))||this.validator.sv.validateSchema(i,s)}finally{this.validator.options=r}}}const d=!!a||i.isValid();if(d||e.addError("REMOTE_NOT_VALID",[n],i),e.path.pop(),!d)return}}const d=s;if(s&&a){const e=a.split("/");for(let t=0,r=e.length;s&&t<r;t++){const r=E(e[t]);s=0===t?f(s,r,o,o,this.validator.options.maxRecursionDepth):s[r]}}return s&&"object"==typeof s&&d&&"object"==typeof d&&(s.__$resourceRoot=d),s}}const D={$schema:"http://json-schema.org/draft-06/schema#",$id:"http://json-schema.org/draft-06/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},title:{type:"string"},description:{type:"string"},default:{},examples:{type:"array",items:{}},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:{},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:{}},j={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0},M={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}},N={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}},C={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}},w={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}},Y={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}},U={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{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}}},L={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{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"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{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:[]}}},F={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"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},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{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}}},k={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{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"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}},W={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}},K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$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"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}},q={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}},V={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-assertion",$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for assertion results",type:["object","boolean"],properties:{format:{type:"string"}}},X={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{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}}},B={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}},H={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{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"}}},$defs:{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:[]}}},z=(e,t,r)=>{const n=t;n.id||(n.id=e),r&&(n.__$validationOptions=x(r)),P.cacheSchemaByUri(e,n)};function J(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}z("http://json-schema.org/draft-04/schema",{id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string"},$schema:{type:"string"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}},{version:"none"}),z("http://json-schema.org/draft-06/schema",D,{version:"none"}),z("http://json-schema.org/draft-07/schema",j,{version:"none"}),z("https://json-schema.org/draft/2019-09/schema",M,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/applicator",N,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/content",C,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/core",w,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/format",Y,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/meta-data",U,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/validation",L,{version:"none"}),z("https://json-schema.org/draft/2020-12/schema",F,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/applicator",k,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/content",W,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/core",K,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/format-annotation",q,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/format-assertion",V,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/meta-data",X,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/unevaluated",B,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/validation",H,{version:"none"});var Z,G={exports:{}},Q={exports:{}};function ee(){return Z||(Z=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(null==e)throw new TypeError("Expected a string but received a ".concat(e));if("String"!==e.constructor.name)throw new TypeError("Expected a string but received a ".concat(e.constructor.name))},e.exports=t.default,e.exports.default=t.default}(Q,Q.exports)),Q.exports}var te,re={exports:{}};function ne(){return te||(te=1,function(e,t){function r(e){return"[object RegExp]"===Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var n=0;n<t.length;n++){var i=t[n];if(e===i||r(i)&&i.test(e))return!0}return!1},e.exports=t.default,e.exports.default=t.default}(re,re.exports)),re.exports}var ie,oe={exports:{}};function ae(){return ie||(ie=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,o;(0,n.default)(e),"object"===i(t)?(r=t.min||0,o=t.max):(r=arguments[1],o=arguments[2]);var a=encodeURI(e).split(/%..|./).length-1;return a>=r&&(void 0===o||a<=o)};var r,n=(r=ee())&&r.__esModule?r:{default:r};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}e.exports=t.default,e.exports.default=t.default}(oe,oe.exports)),oe.exports}var se,ce,de={exports:{}},fe={exports:{}};function le(){return se||(se=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default,e.exports.default=t.default}(fe,fe.exports)),fe.exports}function ue(){return ce||(ce=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)(e),(t=(0,n.default)(t,o)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var i=e.split("."),a=i[i.length-1];if(t.require_tld){if(i.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(a))return!1;if(/\s/.test(a))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(a))return!1;return i.every(function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))})};var r=i(ee()),n=i(le());function i(e){return e&&e.__esModule?e:{default:e}}var o={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(de,de.exports)),de.exports}var pe,me,he={exports:{}};function ye(){return pe||(pe=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.default)(t);var o=("object"===i(r)?r.version:arguments[1])||"";if(!o)return e(t,{version:4})||e(t,{version:6});if("4"===o.toString())return s.test(t);if("6"===o.toString())return d.test(t);return!1};var r,n=(r=ee())&&r.__esModule?r:{default:r};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",a="(".concat(o,"[.]){3}").concat(o),s=new RegExp("^".concat(a,"$")),c="(?:[0-9a-fA-F]{1,4})",d=new RegExp("^("+"(?:".concat(c,":){7}(?:").concat(c,"|:)|")+"(?:".concat(c,":){6}(?:").concat(a,"|:").concat(c,"|:)|")+"(?:".concat(c,":){5}(?::").concat(a,"|(:").concat(c,"){1,2}|:)|")+"(?:".concat(c,":){4}(?:(:").concat(c,"){0,1}:").concat(a,"|(:").concat(c,"){1,3}|:)|")+"(?:".concat(c,":){3}(?:(:").concat(c,"){0,2}:").concat(a,"|(:").concat(c,"){1,4}|:)|")+"(?:".concat(c,":){2}(?:(:").concat(c,"){0,3}:").concat(a,"|(:").concat(c,"){1,5}|:)|")+"(?:".concat(c,":){1}(?:(:").concat(c,"){0,4}:").concat(a,"|(:").concat(c,"){1,6}|:)|")+"(?::((?::".concat(c,"){0,5}:").concat(a,"|(?::").concat(c,"){1,7}|:))")+")(%[0-9a-zA-Z.]{1,})?$");e.exports=t.default,e.exports.default=t.default}(he,he.exports)),he.exports}function ve(){return me||(me=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.default)(e),(t=(0,s.default)(t,d)).require_display_name||t.allow_display_name){var c=e.match(f);if(c){var v=c[1];if(e=e.replace(v,"").replace(/(^<|>$)/g,""),v.endsWith(" ")&&(v=v.slice(0,-1)),!function(e){var t=e.replace(/^"(.+)"$/,"$1");if(!t.trim())return!1;if(/[\.";<>]/.test(t)){if(t===e)return!1;if(!(t.split('"').length===t.split('\\"').length))return!1}return!0}(v))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>y)return!1;var E=e.split("@"),g=E.pop(),_=g.toLowerCase();if(t.host_blacklist.length>0&&(0,n.default)(_,t.host_blacklist))return!1;if(t.host_whitelist.length>0&&!(0,n.default)(_,t.host_whitelist))return!1;var $=E.join("@");if(t.domain_specific_validation&&("gmail.com"===_||"googlemail.com"===_)){var O=($=$.toLowerCase()).split("+")[0];if(!(0,i.default)(O.replace(/\./g,""),{min:6,max:30}))return!1;for(var b=O.split("."),A=0;A<b.length;A++)if(!u.test(b[A]))return!1}if(!(!1!==t.ignore_max_length||(0,i.default)($,{max:64})&&(0,i.default)(g,{max:254})))return!1;if(!(0,o.default)(g,{require_tld:t.require_tld,ignore_max_length:t.ignore_max_length,allow_underscores:t.allow_underscores})){if(!t.allow_ip_domain)return!1;if(!(0,a.default)(g)){if(!g.startsWith("[")||!g.endsWith("]"))return!1;var R=g.slice(1,-1);if(0===R.length||!(0,a.default)(R))return!1}}if(t.blacklisted_chars&&-1!==$.search(new RegExp("[".concat(t.blacklisted_chars,"]+"),"g")))return!1;if('"'===$[0]&&'"'===$[$.length-1])return $=$.slice(1,$.length-1),t.allow_utf8_local_part?h.test($):p.test($);for(var x=t.allow_utf8_local_part?m:l,I=$.split("."),S=0;S<I.length;S++)if(!x.test(I[S]))return!1;return!0};var r=c(ee()),n=c(ne()),i=c(ae()),o=c(ue()),a=c(ye()),s=c(le());function c(e){return e&&e.__esModule?e:{default:e}}var d={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},f=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,l=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,u=/^[a-z\d]+$/,p=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,m=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,h=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,y=254;e.exports=t.default,e.exports.default=t.default}(G,G.exports)),G.exports}var Ee,ge,_e=J(ve()),$e=J(ye()),Oe={exports:{}},be={exports:{}};function Ae(){return Ee||(Ee=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e,t){return-1!==e.indexOf(t)},e.exports=t.default,e.exports.default=t.default}(be,be.exports)),be.exports}function Re(){return ge||(ge=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,s.default)(t,f)).validate_length&&e.length>t.max_allowed_length)return!1;if(!t.allow_fragments&&(0,i.default)(e,"#"))return!1;if(!t.allow_query_components&&((0,i.default)(e,"?")||(0,i.default)(e,"&")))return!1;var c,u,p,m,h,y,v,E;v=e.split("#"),e=v.shift(),v=e.split("?");var g=(e=v.shift()).match(/^([a-z][a-z0-9+\-.]*):/i),_=!1,$=function(r){return _=!0,c=r.toLowerCase(),(!t.require_valid_protocol||-1!==t.protocols.indexOf(c))&&e.substring(g[0].length)};if(g){var O=g[1],b=e.substring(g[0].length);if("//"===b.slice(0,2)){if(!1===(e=$(O)))return!1}else{var A=b.indexOf("/"),R=-1===A?b:b.substring(0,A),x=R.indexOf("@");if(-1!==x){var I=R.substring(0,x),S=/^[a-zA-Z0-9\-_.%:]*$/.test(I),T=/%[0-9a-fA-F]{2}/.test(I);if(S&&!T){if(t.require_protocol)return!1}else if(!1===(e=$(O)))return!1}else{if(/^[0-9]/.test(b)){if(t.require_protocol)return!1}else if(!1===(e=$(O)))return!1}}}else if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!_&&!t.allow_protocol_relative_urls)return!1;e=e.slice(2)}if(""===e)return!1;if(v=e.split("/"),""===(e=v.shift())&&!t.require_host)return!0;if((v=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===v[0])return!1;if((u=v.shift()).indexOf(":")>=0&&u.split(":").length>2)return!1;var P=u.split(":"),D=(C=2,function(e){if(Array.isArray(e))return e}(N=P)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,d=!1;try{if(o=(r=r.call(e)).next,0===t);else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){d=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw i}}return s}}(N,C)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}(N,C)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),j=D[0],M=D[1];if(""===j&&""===M)return!1}var N,C;m=v.join("@"),y=null,E=null;var w=m.match(l);w?(p="",E=w[1],y=w[2]||null):(p=(v=m.split(":")).shift(),v.length&&(y=v.join(":")));if(null!==y&&y.length>0){if(h=parseInt(y,10),!/^[0-9]+$/.test(y)||h<=0||h>65535)return!1}else if(t.require_port)return!1;if(t.host_whitelist)return(0,n.default)(p,t.host_whitelist);if(""===p&&!t.require_host)return!0;if(!((0,a.default)(p)||(0,o.default)(p,t)||E&&(0,a.default)(E,6)))return!1;if(p=p||E,t.host_blacklist&&(0,n.default)(p,t.host_blacklist))return!1;return!0};var r=c(ee()),n=c(ne()),i=c(Ae()),o=c(ue()),a=c(ye()),s=c(le());function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var f={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},l=/^\[([^\]]+)\](?::([0-9]+))?$/;e.exports=t.default,e.exports.default=t.default}(Oe,Oe.exports)),Oe.exports}var xe=J(Re());const Ie=(e,t,r)=>{if(t<1||t>12)return!1;const n=((e,t)=>{switch(t){case 2:return(e=>e%4==0&&(e%100!=0||e%400==0))(e)?29:28;case 4:case 6:case 9:case 11:return 30;default:return 31}})(e,t);return r>=1&&r<=n};var Se,Te;var Pe=function(){if(Te)return Se;Te=1;const e=2147483647,t=36,r=/^xn--/,n=/[^\0-\x7F]/,i=/[\x2E\u3002\uFF0E\uFF61]/g,o={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},a=Math.floor,s=String.fromCharCode;function c(e){throw new RangeError(o[e])}function d(e,t){const r=e.split("@");let n="";r.length>1&&(n=r[0]+"@",e=r[1]);const o=function(e,t){const r=[];let n=e.length;for(;n--;)r[n]=t(e[n]);return r}((e=e.replace(i,".")).split("."),t).join(".");return n+o}function f(e){const t=[];let r=0;const n=e.length;for(;r<n;){const i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){const n=e.charCodeAt(r++);56320==(64512&n)?t.push(((1023&i)<<10)+(1023&n)+65536):(t.push(i),r--)}else t.push(i)}return t}const l=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:t},u=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},p=function(e,r,n){let i=0;for(e=n?a(e/700):e>>1,e+=a(e/r);e>455;i+=t)e=a(e/35);return a(i+36*e/(e+38))},m=function(r){const n=[],i=r.length;let o=0,s=128,d=72,f=r.lastIndexOf("-");f<0&&(f=0);for(let e=0;e<f;++e)r.charCodeAt(e)>=128&&c("not-basic"),n.push(r.charCodeAt(e));for(let u=f>0?f+1:0;u<i;){const f=o;for(let n=1,s=t;;s+=t){u>=i&&c("invalid-input");const f=l(r.charCodeAt(u++));f>=t&&c("invalid-input"),f>a((e-o)/n)&&c("overflow"),o+=f*n;const p=s<=d?1:s>=d+26?26:s-d;if(f<p)break;const m=t-p;n>a(e/m)&&c("overflow"),n*=m}const m=n.length+1;d=p(o-f,m,0==f),a(o/m)>e-s&&c("overflow"),s+=a(o/m),o%=m,n.splice(o++,0,s)}return String.fromCodePoint(...n)},h=function(r){const n=[],i=(r=f(r)).length;let o=128,d=0,l=72;for(const e of r)e<128&&n.push(s(e));const m=n.length;let h=m;for(m&&n.push("-");h<i;){let i=e;for(const e of r)e>=o&&e<i&&(i=e);const f=h+1;i-o>a((e-d)/f)&&c("overflow"),d+=(i-o)*f,o=i;for(const i of r)if(i<o&&++d>e&&c("overflow"),i===o){let e=d;for(let r=t;;r+=t){const i=r<=l?1:r>=l+26?26:r-l;if(e<i)break;const o=e-i,c=t-i;n.push(s(u(i+o%c,0))),e=a(o/c)}n.push(s(u(e,0))),l=p(d,f,h===m),d=0,++h}++d,++o}return n.join("")};return Se={version:"2.3.1",ucs2:{decode:f,encode:e=>String.fromCodePoint(...e)},decode:m,encode:h,toASCII:function(e){return d(e,function(e){return n.test(e)?"xn--"+h(e):e})},toUnicode:function(e){return d(e,function(e){return r.test(e)?m(e.slice(4).toLowerCase()):e})}}}(),De=J(Pe);const je=/[\u3002\uff0e\uff61]/g,Me=/[\u3002\uff0e\uff61]/,Ne=e=>{if(0===e.length||e.length>255)return null;if(e.startsWith(".")||e.endsWith("."))return null;const t=e.split(".");return t.some(e=>0===e.length||e.length>63)?null:t},Ce=e=>/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(e),we=e=>/\p{Script=Greek}/u.test(e),Ye=e=>/\p{Script=Hebrew}/u.test(e),Ue=e=>{if(!/^xn--/i.test(e))return e;try{return De.toUnicode(e.toLowerCase())}catch(e){return null}},Le=e=>{if(e.startsWith("-")||e.endsWith("-"))return!1;if(e.length>=4&&"-"===e[2]&&"-"===e[3]&&!/^xn--/i.test(e))return!1;if(/^\p{M}/u.test(e))return!1;if(/[\u302e\u302f\u0640\u07fa]/u.test(e))return!1;for(let t=0;t<e.length;t++){const r=e[t];if("·"===r&&(0===t||t===e.length-1||"l"!==e[t-1]||"l"!==e[t+1]))return!1;if("͵"===r&&(t===e.length-1||!we(e[t+1])))return!1;if(!("׳"!==r&&"״"!==r||0!==t&&Ye(e[t-1])))return!1;if(""===r&&(0===t||"्"!==e[t-1]))return!1}if(e.includes("・")&&(t=e.replace(/\u30fb/g,""),!/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u.test(t)))return!1;var t;const r=/[\u0660-\u0669]/.test(e),n=/[\u06f0-\u06f9]/.test(e);return!r||!n},Fe=/^([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$/i,ke=e=>{const t=Fe.exec(e);if(null===t)return null;const r=parseInt(t[1],10),n=parseInt(t[2],10),i=parseInt(t[3],10);if(r>23||n>59||i>60)return null;let o=r,a=n;if("z"!==t[5].toLowerCase()){const e=/^([+-])([0-9]{2}):([0-9]{2})$/.exec(t[5]);if(null===e)return null;const i=e[1],s=parseInt(e[2],10),c=parseInt(e[3],10);if(s>23||c>59)return null;const d=((e,t,r,n,i)=>{const o=60*e+t,a=60*n+i,s=(("+"===r?o-a:o+a)%1440+1440)%1440;return{hour:Math.floor(s/60),minute:s%60}})(r,n,i,s,c);o=d.hour,a=d.minute}return 60!==i||23===o&&59===a?{hour:r,minute:n,second:i,utcHour:o,utcMinute:a}:null},We=e=>"string"!=typeof e||(e=>{if(Me.test(e)||/[^\x00-\x7F]/.test(e))return!1;if($e.default(e,4))return!1;const t=Ne(e);if(null===t)return!1;for(const e of t){if(!Ce(e))return!1;const t=Ue(e);if(null===t||!Le(t))return!1}return!0})(e),Ke=e=>"string"!=typeof e||xe.default(e),qe=e=>{for(let t=0;t<e.length;t++)if("~"===e[t]){const r=e[t+1];if("0"!==r&&"1"!==r)return!1;t++}return!0},Ve={date:e=>{if("string"!=typeof e)return!0;const t=/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.exec(e);if(null===t)return!1;const r=parseInt(t[1],10),n=parseInt(t[2],10),i=parseInt(t[3],10);return Ie(r,n,i)},"date-time":e=>{if("string"!=typeof e)return!0;const t=e.toLowerCase().split("t");if(2!==t.length)return!1;const r=t[0],n=t[1],i=/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.exec(r);if(null===i)return!1;const o=parseInt(i[1],10),a=parseInt(i[2],10),s=parseInt(i[3],10);return!!Ie(o,a,s)&&null!==ke(n)},email:e=>{if("string"!=typeof e)return!0;if(_e.default(e,{require_tld:!0,allow_ip_domain:!0}))return!0;const t=/^(.+)@\[IPv6:([^\]]+)\]$/i.exec(e);if(!t)return!1;const r=t[1],n=t[2];return!!$e.default(n,6)&&_e.default(`${r}@example.com`,{require_tld:!0})},hostname:We,"host-name":We,ipv4:e=>"string"!=typeof e||$e.default(e,4),ipv6:e=>"string"!=typeof e||!e.includes("%")&&$e.default(e,6),regex:e=>{if("string"!=typeof e)return!0;const t=new Set(["a"]);for(let r=0;r<e.length;r++){if("\\"!==e[r])continue;if(r++,r>=e.length)return!1;const n=e[r];if(t.has(n))return!1}try{return RegExp(e),!0}catch(e){return!1}},uri:function(e){if("string"!=typeof e)return!0;if(/[^\x00-\x7F]/.test(e))return!1;const t=e.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\/([^/]*)/);if(t){const e=t[2],r=e.indexOf("@");if(r>0){const t=e.substring(0,r);if(t.includes("[")||t.includes("]"))return!1}}return/^[a-zA-Z][a-zA-Z0-9+.-]*:[^"\\<>^{}^`| ]*$/.test(e)},"strict-uri":Ke,"uri-reference":e=>"string"!=typeof e||!/[^\x00-\x7F]/.test(e)&&/^([a-zA-Z][a-zA-Z0-9+.-]*:)?[^"\\<>^{}^`| ]*$/.test(e),"uri-template":e=>{if("string"!=typeof e)return!0;if(!/^([a-zA-Z][a-zA-Z0-9+.-]*:)?[^"\\<>^`| ]*$/.test(e))return!1;let t=!1;for(let r=0;r<e.length;r++){const n=e[r];if("{"===n){if(t)return!1;t=!0}else if("}"===n){if(!t)return!1;t=!1}}return!t},"json-pointer":e=>{if("string"!=typeof e)return!0;if(""===e)return!0;if(!/^(?:\/[^/]*)+$/.test(e))return!1;const t=e.split("/").slice(1);for(const e of t)if(!qe(e))return!1;return!0},"relative-json-pointer":e=>{if("string"!=typeof e)return!0;const t=e.match(/^(0|[1-9]\d*)(.*)$/);if(!t)return!1;const r=t[2];if(""===r||"#"===r)return!0;if(!r.startsWith("/"))return!1;if(!/^(?:\/[^/]*)+$/.test(r))return!1;const n=r.split("/").slice(1);for(const e of n)if(!qe(e))return!1;return!0},time:e=>"string"!=typeof e||null!==ke(e),"idn-email":e=>"string"!=typeof e||/^[^\s@]+@[^\s@]+$/.test(e),"idn-hostname":e=>"string"!=typeof e||(e=>{const t=e.replace(je,"."),r=Ne(t);if(null===r)return!1;for(const e of r){const t=Ue(e);if(null===t||!Le(t))return!1}return!0})(e),iri:e=>{if("string"!=typeof e)return!0;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:[^"\\<>^{}^`| ]*$/u.test(e))return!1;try{return new URL(e),!0}catch(e){return!1}},"iri-reference":e=>"string"!=typeof e||/^([a-zA-Z][a-zA-Z0-9+.-]*:)?[^"\\<>^{}^`| ]*$/u.test(e),duration:e=>{if("string"!=typeof e)return!0;if(!/^P[\x00-\x7F]*$/.test(e))return!1;if(!e.startsWith("P"))return!1;const t=e.slice(1);if(0===t.length)return!1;if(t.includes("W"))return/^\d+W$/.test(t);const r=t.split("T");if(r.length>2)return!1;const n=r[0],i=2===r.length?r[1]:void 0;if(!/^(?:\d+Y)?(?:\d+M)?(?:\d+D)?$/.test(n))return!1;const o=/\d+[YMD]/.test(n);let a=!1;if(void 0!==i){if(0===i.length)return!1;if(!/^(?:\d+H)?(?:\d+M)?(?:\d+S)?$/.test(i))return!1;if(a=/\d+[HMS]/.test(i),!a)return!1}return o||a},uuid:e=>"string"!=typeof e||/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)},Xe={};function Be(e){if(e.length>1e4)return{ok:!1,error:{pattern:e,message:`Pattern length ${e.length} exceeds maximum allowed length of 10000`}};if(/\\[pP]{/.test(e)||/[\u{10000}-\u{10FFFF}]/u.test(e)||/\\uD[89AB][0-9A-Fa-f]{2}\\uD[CDEF][0-9A-Fa-f]{2}/.test(e))try{return{ok:!0,value:new RegExp(e,"u")}}catch(t){return{ok:!1,error:{pattern:e,message:t&&t.message?t.message:"Invalid regular expression"}}}else try{return{ok:!0,value:new RegExp(e)}}catch(t){return{ok:!1,error:{pattern:e,message:t&&t.message?t.message:"Invalid regular expression"}}}}const He=(e,t,r)=>{const n=e.length;if(n<=1)return!0;let i=!0;for(let t=0;t<n;t++){const r=e[t];if(null!==r&&"object"==typeof r){i=!1;break}}if(i){const r=new Set;for(let i=0;i<n;i++){const n=e[i],o=typeof n+":"+String(n);if(r.has(o)){if(t)for(let r=0;r<i;r++){const o=e[r];if(typeof o==typeof n&&o===n){t.push(r,i);break}}return!1}r.add(o)}return!0}for(let i=0;i<n;i++)for(let o=i+1;o<n;o++)if(v(e[i],e[o],{maxDepth:r}))return t&&t.push(i,o),!1;return!0},ze=function(e,t){return e&&Array.isArray(e.includeErrors)&&e.includeErrors.length>0&&!t.some(function(t){return e.includeErrors.includes(t)})},Je=(e,t)=>"string"==typeof e.$schema?!/draft-04|draft-06|draft-07/.test(e.$schema):!("draft-04"===t||"draft-06"===t||"draft-07"===t),Ze="https://json-schema.org/draft/2019-09/vocab/validation",Ge="https://json-schema.org/draft/2020-12/vocab/validation",Qe="https://json-schema.org/draft/2019-09/vocab/format",et="https://json-schema.org/draft/2020-12/vocab/format-assertion",tt=new Set(["type","multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","maxContains","minContains","maxProperties","minProperties","required","dependentRequired","enum","const","contentEncoding","contentMediaType"]);function rt(e,t,r,n){let i=e.__validationResultCache.get(t);i||(i=new Map,e.__validationResultCache.set(t,i)),i.set(r,n)}function nt(e,t,r){return e.__validationResultCache.get(t)?.get(r)}function it(e,t,r){const n=e.asyncTasks.length;for(const r of t)e.asyncTasks.push(...r.asyncTasks);e.asyncTasks.length>n?e.addAsyncTaskWithPath(e=>{setTimeout(()=>e(null),0)},[],()=>{r()}):r()}function ot(e,t,r){if(ze(this.validateOptions,["OBJECT_ADDITIONAL_PROPERTIES"]))return;if(!o(r))return;const n=void 0!==t.properties?t.properties:{},i=void 0!==t.patternProperties?t.patternProperties:{};if(!1===t.additionalProperties){let o=Object.keys(r);const a=Object.keys(n),s=Object.keys(i);o=((e,t)=>{const r=new Set(t),n=[];let i=e.length;for(;i--;)r.has(e[i])||n.push(e[i]);return n})(o,a);for(const e of s){const t=Be(e);if(!t.ok)continue;const r=t.value;for(let e=o.length-1;e>=0;e--)!0===r.test(o[e])&&o.splice(e,1)}if(o.length>0){if(Array.isArray(this.options.assumeAdditional))for(const e of this.options.assumeAdditional){const t=o.indexOf(e);-1!==t&&o.splice(t,1)}if(o.length>0)for(const r of o)e.addError("OBJECT_ADDITIONAL_PROPERTIES",[r],void 0,t,"properties")}}}const at=(e,r)=>{const n=d(e),i=n?t(n):void 0,o=f(e,r,i,i);if(o&&o.$dynamicAnchor===r)return o},st=(e,t)=>{const r=e.__$recursiveRefResolved;if(!r)return;let n=r;if("object"==typeof n&&!0===n.$recursiveAnchor){const e=t[0];e&&(n=e)}return n},ct=(e,t)=>{const r=e.__$dynamicRefResolved;if(void 0===r||!e.$dynamicRef)return r;let n=r;const i=(e=>{const t=e.indexOf("#");if(-1===t)return;const r=e.slice(t+1);return r&&"/"!==r[0]?r:void 0})(e.$dynamicRef);if(i&&"object"==typeof n&&n.$dynamicAnchor===i)for(let e=0;e<t.length;e++){const r=t[e],o=at(r,i);if(o){n=o;break}}return n},dt=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,ft=e=>e.length%4==0&&dt.test(e);function lt(e){let t=0;for(const r of e)t++;return t}function ut(e){const{report:t,currentSchema:r,json:n,mode:i,depth:a}=e;if(!r||"boolean"==typeof r)return new Set;if(a>(this.options.maxRecursionDepth??100))return t.addError("COLLECT_EVALUATED_DEPTH_EXCEEDED",[a]),new Set;const s=new Set,c=e=>{if("all"===e)return!0;for(const t of e)s.add(t);return!1},d=r=>"items"===i?ut.call(this,{report:t,currentSchema:r,json:n,mode:"items",jsonArr:e.jsonArr,depth:a+1}):ut.call(this,{report:t,currentSchema:r,json:n,mode:"properties",jsonData:e.jsonData,depth:a+1});if("items"===i){const n=e.jsonArr;if(Array.isArray(r.prefixItems)){const e=Math.min(r.prefixItems.length,n.length);for(let t=0;t<e;t++)s.add(t)}if(void 0!==r.items)if(Array.isArray(r.items)){const e=Math.min(r.items.length,n.length);for(let t=0;t<e;t++)s.add(t)}else if(!1!==r.items)return"all";if(void 0!==r.additionalItems&&!1!==r.additionalItems&&Array.isArray(r.items))return"all";if(void 0!==r.contains)for(let e=0;e<n.length;e++){let i=nt(t,r.contains,n[e]);if(void 0===i){const o=new b(t);yt.call(this,o,r.contains,n[e]),i=0===o.errors.length}i&&s.add(e)}if(!0===r.unevaluatedItems)return"all"}else{const t=e.jsonData;if(o(r.properties))for(const e of Object.keys(r.properties))Object.hasOwn(t,e)&&s.add(e);if(o(r.patternProperties))for(const e of Object.keys(r.patternProperties)){const r=Be(e);if(r.ok)for(const e of Object.keys(t))r.value.test(e)&&s.add(e)}if(void 0!==r.additionalProperties){const e=o(r.properties)?Object.keys(r.properties):[],n=[];if(o(r.patternProperties))for(const e of Object.keys(r.patternProperties)){const t=Be(e);t.ok&&n.push(t.value)}for(const r of Object.keys(t))e.includes(r)||n.some(e=>e.test(r))||s.add(r)}if(o(r.dependentSchemas))for(const[e,n]of Object.entries(r.dependentSchemas))if(Object.hasOwn(t,e)&&c(d(n)))return"all";if(!0===r.unevaluatedProperties)return"all"}if(Array.isArray(r.allOf))for(const e of r.allOf)if(c(d(e)))return"all";if(Array.isArray(r.anyOf))for(const e of r.anyOf){let r=nt(t,e,n);if(void 0===r){const i=new b(t);yt.call(this,i,e,n),r=0===i.errors.length}if(r&&c(d(e)))return"all"}if(Array.isArray(r.oneOf))for(const e of r.oneOf){let r=nt(t,e,n);if(void 0===r){const i=new b(t);yt.call(this,i,e,n),r=0===i.errors.length}if(r&&c(d(e)))return"all"}if(void 0!==r.if){let e=nt(t,r.if,n);if(void 0===e){const i=new b(t);yt.call(this,i,r.if,n),e=0===i.errors.length}if(e){if(c(d(r.if)))return"all";if(void 0!==r.then&&c(d(r.then)))return"all"}else if(void 0!==r.else&&c(d(r.else)))return"all"}if(r.__$refResolved&&r.__$refResolved!==r&&c(d(r.__$refResolved)))return"all";const f=st(r,t.__$recursiveAnchorStack);if(f&&f!==r&&c(d(f)))return"all";const l=ct(r,t.__$dynamicScopeStack);return l&&l!==r&&c(d(l))?"all":s}const pt={id:()=>{},$id:()=>{},$ref:()=>{},$schema:()=>{},$dynamicAnchor:()=>{},$dynamicRef:()=>{},$anchor:()=>{},$defs:()=>{},$vocabulary:()=>{},$recursiveAnchor:()=>{},$recursiveRef:()=>{},examples:()=>{},title:()=>{},description:()=>{},default:()=>{},type:function(e,t,r){if(ze(this.validateOptions,["INVALID_TYPE"]))return;const n=i(r);"string"==typeof t.type?n===t.type||"integer"===n&&"number"===t.type||e.addError("INVALID_TYPE",[t.type,n],void 0,t,"type"):t.type.includes(n)||"integer"===n&&t.type.includes("number")||e.addError("INVALID_TYPE",[JSON.stringify(t.type),n],void 0,t,"type")},enum:function(e,t,r){if(ze(this.validateOptions,["ENUM_CASE_MISMATCH","ENUM_MISMATCH"]))return;let n=!1,i=!1;for(const e of t.enum){if(v(r,e,{maxDepth:this.options.maxRecursionDepth})){n=!0;break}v(r,e,{caseInsensitiveComparison:!0,maxDepth:this.options.maxRecursionDepth})&&(i=!0)}if(!1===n){const n=i&&this.options.enumCaseInsensitiveComparison?"ENUM_CASE_MISMATCH":"ENUM_MISMATCH";e.addError(n,[JSON.stringify(r)],void 0,t,"enum")}},const:function(e,t,r){const n=t.const;!1===v(r,n,{maxDepth:this.options.maxRecursionDepth})&&e.addError("CONST",[JSON.stringify(n)],void 0,t,void 0)},multipleOf:function(e,t,r){if(ze(this.validateOptions,["MULTIPLE_OF"]))return;if("number"!=typeof r)return;const n=r/t.multipleOf;(!Number.isFinite(n)||Math.abs(n-Math.round(n))>=1e-10)&&e.addError("MULTIPLE_OF",[r,t.multipleOf],void 0,t,"multipleOf")},maximum:function(e,t,r){ze(this.validateOptions,["MAXIMUM","MAXIMUM_EXCLUSIVE"])||"number"==typeof r&&(!0!==t.exclusiveMaximum?r>t.maximum&&e.addError("MAXIMUM",[r,t.maximum],void 0,t,"maximum"):r>=t.maximum&&e.addError("MAXIMUM_EXCLUSIVE",[r,t.maximum],void 0,t,"maximum"))},exclusiveMaximum:function(e,t,r){if("number"==typeof t.exclusiveMaximum){if(ze(this.validateOptions,["MAXIMUM_EXCLUSIVE"]))return;if("number"!=typeof r)return;r>=t.exclusiveMaximum&&e.addError("MAXIMUM_EXCLUSIVE",[r,t.exclusiveMaximum],void 0,t,"exclusiveMaximum")}},minimum:function(e,t,r){ze(this.validateOptions,["MINIMUM","MINIMUM_EXCLUSIVE"])||"number"==typeof r&&(!0!==t.exclusiveMinimum?r<t.minimum&&e.addError("MINIMUM",[r,t.minimum],void 0,t,"minimum"):r<=t.minimum&&e.addError("MINIMUM_EXCLUSIVE",[r,t.minimum],void 0,t,"minimum"))},exclusiveMinimum:function(e,t,r){if("number"==typeof t.exclusiveMinimum){if(ze(this.validateOptions,["MINIMUM_EXCLUSIVE"]))return;if("number"!=typeof r)return;r<=t.exclusiveMinimum&&e.addError("MINIMUM_EXCLUSIVE",[r,t.exclusiveMinimum],void 0,t,"exclusiveMinimum")}},maxLength:function(e,t,r){ze(this.validateOptions,["MAX_LENGTH"])||"string"==typeof r&<(r)>t.maxLength&&e.addError("MAX_LENGTH",[r.length,t.maxLength],void 0,t,"maxLength")},minLength:function(e,t,r){ze(this.validateOptions,["MIN_LENGTH"])||"string"==typeof r&<(r)<t.minLength&&e.addError("MIN_LENGTH",[r.length,t.minLength],void 0,t,"minLength")},pattern:function(e,t,r){if(ze(this.validateOptions,["PATTERN"]))return;if("string"!=typeof r)return;const n=Be(t.pattern);n.ok?n.value.test(r)||e.addError("PATTERN",[t.pattern,r],void 0,t,"pattern"):e.addError("PATTERN",[t.pattern,r,n.error.message],void 0,t,"pattern")},format:function(e,t,r){if(!1===this.options.formatAssertions)return;if(!0===this.options.formatAssertions&&!((e,t,r)=>{if("draft2019-09"!==r&&"draft2020-12"!==r)return!0;const n=e.__$schemaResolved,i=t.rootSchema&&"boolean"!=typeof t.rootSchema?t.rootSchema.__$schemaResolved:void 0,a=n||i;if(!a||"object"!=typeof a||!o(a.$vocabulary))return!1;const s=a.$vocabulary;return Object.hasOwn(s,et)?!0===s[et]:!!Object.hasOwn(s,Qe)&&!0===s[Qe]})(t,e,this.options.version))return;const n="draft2019-09"===this.options.version||"draft2020-12"===this.options.version;var a;const s=(a=this.options,{...Ve,...a?.strictUris?{uri:Ke}:{},...Xe,...a?.customFormats||{}})[t.format];if("function"==typeof s){if(ze(this.validateOptions,["INVALID_FORMAT"]))return;if(e.hasError("INVALID_TYPE",[t.type,i(r)]))return;if(2===s.length)e.addAsyncTaskWithPath(s,[r],function(n){!0!==n&&e.addError("INVALID_FORMAT",[t.format,JSON.stringify(r)],void 0,t,"format")});else{const n=s.call(this,r);if(n instanceof Promise){const i=n;e.addAsyncTaskWithPath(async e=>{try{e(await i)}catch(t){e(!1)}},[],function(n){!0!==n&&e.addError("INVALID_FORMAT",[t.format,JSON.stringify(r)],void 0,t,"format")})}else!0!==n&&e.addError("INVALID_FORMAT",[t.format,JSON.stringify(r)],void 0,t,"format")}}else!0===this.options.ignoreUnknownFormats||n||e.addError("UNKNOWN_FORMAT",[t.format],void 0,t,"format")},contentEncoding:function(e,t,r){if("draft-07"!==this.options.version)return;if("string"!=typeof r)return;"base64"===t.contentEncoding&&(ft(r)||e.addError("INVALID_FORMAT",["contentEncoding:base64",JSON.stringify(r)],void 0,t,"contentEncoding"))},contentMediaType:function(e,t,r){if("draft-07"!==this.options.version)return;if("string"!=typeof r)return;if("application/json"!==t.contentMediaType)return;let n=r;if("base64"===t.contentEncoding){const i=(e=>{if(ft(e)){if("function"==typeof atob)try{return atob(e)}catch{return}if("undefined"!=typeof Buffer)try{return Buffer.from(e,"base64").toString("utf8")}catch{return}}})(r);if(void 0===i)return void e.addError("INVALID_FORMAT",["contentEncoding:base64",JSON.stringify(r)],void 0,t,"contentEncoding");n=i}try{JSON.parse(n)}catch{e.addError("INVALID_FORMAT",["contentMediaType:application/json",JSON.stringify(r)],void 0,t,"contentMediaType")}},additionalItems:function(e,t,r){ze(this.validateOptions,["ARRAY_ADDITIONAL_ITEMS"])||Array.isArray(r)&&!1===t.additionalItems&&Array.isArray(t.items)&&r.length>t.items.length&&e.addError("ARRAY_ADDITIONAL_ITEMS",void 0,void 0,t,"additionalItems")},items:function(){},prefixItems:function(){},maxItems:function(e,t,r){ze(this.validateOptions,["ARRAY_LENGTH_LONG"])||Array.isArray(r)&&r.length>t.maxItems&&e.addError("ARRAY_LENGTH_LONG",[r.length,t.maxItems],void 0,t,"maxItems")},minItems:function(e,t,r){ze(this.validateOptions,["ARRAY_LENGTH_SHORT"])||Array.isArray(r)&&r.length<t.minItems&&e.addError("ARRAY_LENGTH_SHORT",[r.length,t.minItems],void 0,t,"minItems")},uniqueItems:function(e,t,r){if(!ze(this.validateOptions,["ARRAY_UNIQUE"])&&Array.isArray(r)&&!0===t.uniqueItems){const n=[];!1===He(r,n,this.options.maxRecursionDepth)&&e.addError("ARRAY_UNIQUE",n,void 0,t,"uniqueItems")}},contains:function(e,t,r){if(ze(this.validateOptions,["CONTAINS"]))return;if(!Array.isArray(r))return;const n=t.contains;if(void 0===n)return;const i=e.constructor,o=[];for(let t=0;t<r.length;t++){const a=new i(e);o.push(a),this._jsonValidate(a,n,r[t]),rt(e,n,r[t],0===a.errors.length)}it(e,o,()=>{let r=0;for(const e of o)0===e.errors.length&&(r+=1);const n="draft2019-09"===this.options.version||"draft2020-12"===this.options.version,i=n&&"number"==typeof t.minContains?t.minContains??1:1,a=n&&"number"==typeof t.maxContains?t.maxContains:void 0;r>=i&&(void 0===a||r<=a)||e.addError("CONTAINS",void 0,o,t,void 0)})},maxContains:function(){},minContains:function(){},unevaluatedItems:function(e,t,r){if(!Array.isArray(r))return;if(!0===t.unevaluatedItems)return;const n=t.unevaluatedItems;if(void 0===n)return;if(0===r.length)return;const i=ut.call(this,{report:e,currentSchema:t,json:r,mode:"items",jsonArr:r,depth:0});if("all"===i)return;const o=[];for(let e=0;e<r.length;e++)i.has(e)||o.push(e);if(0!==o.length)if(!1===n)e.addError("ARRAY_UNEVALUATED_ITEMS",void 0,void 0,t,"unevaluatedItems");else for(const i of o){const o=new b(e);if(yt.call(this,o,n,r[i]),o.errors.length>0){e.addError("ARRAY_UNEVALUATED_ITEMS",void 0,void 0,t,"unevaluatedItems");break}}},maxProperties:function(e,t,r){if(ze(this.validateOptions,["OBJECT_PROPERTIES_MAXIMUM"]))return;if(!o(r))return;const n=Object.keys(r).length;n>t.maxProperties&&e.addError("OBJECT_PROPERTIES_MAXIMUM",[n,t.maxProperties],void 0,t,"maxProperties")},minProperties:function(e,t,r){if(ze(this.validateOptions,["OBJECT_PROPERTIES_MINIMUM"]))return;if(!o(r))return;const n=Object.keys(r).length;n<t.minProperties&&e.addError("OBJECT_PROPERTIES_MINIMUM",[n,t.minProperties],void 0,t,"minProperties")},required:function(e,t,r){if(ze(this.validateOptions,["OBJECT_MISSING_REQUIRED_PROPERTY"]))return;if(!o(r))return;const n=t.required.length;for(let i=0;i<n;i++){const n=t.required[i];Object.hasOwn(r,n)||e.addError("OBJECT_MISSING_REQUIRED_PROPERTY",[n],void 0,t,"required")}},additionalProperties:function(e,t,r){if(void 0===t.properties&&void 0===t.patternProperties)return ot.call(this,e,t,r)},patternProperties:function(e,t,r){if(void 0===t.properties)return ot.call(this,e,t,r)},properties:ot,dependencies:function(e,t,r){if(ze(this.validateOptions,["OBJECT_DEPENDENCY_KEY"]))return;if(!o(r))return;const n=Object.keys(t.dependencies);for(const i of n)if(Object.hasOwn(r,i)){const n=t.dependencies[i];if(Array.isArray(n))for(const o of n)Object.hasOwn(r,o)||e.addError("OBJECT_DEPENDENCY_KEY",[o,i],void 0,t,"dependencies");else this._jsonValidate(e,n,r)}},dependentSchemas:function(e,t,r){if(!Je(t,this.options.version))return;if(!o(r)||!o(t.dependentSchemas))return;const n=Object.keys(t.dependentSchemas);for(const i of n)if(Object.hasOwn(r,i)){const n=t.dependentSchemas[i];this._jsonValidate(e,n,r)}},dependentRequired:function(e,t,r){if(!Je(t,this.options.version))return;if(ze(this.validateOptions,["OBJECT_DEPENDENCY_KEY"]))return;if(!o(r)||!o(t.dependentRequired))return;const n=Object.keys(t.dependentRequired);for(const i of n){if(!Object.hasOwn(r,i))continue;const n=t.dependentRequired[i];if(Array.isArray(n))for(const o of n)Object.hasOwn(r,o)||e.addError("OBJECT_DEPENDENCY_KEY",[o,i],void 0,t,"dependentRequired")}},propertyNames:function(e,t,r){if(ze(this.validateOptions,["PROPERTY_NAMES"]))return;if(!o(r))return;const n=t.propertyNames;if(void 0===n)return;const i=e.constructor,a=Object.keys(r),s=[];for(const t of a){const r=new i(e);s.push(r),this._jsonValidate(r,n,t)}it(e,s,()=>{for(let r=0;r<a.length;r++)s[r].errors.length>0&&e.addError("PROPERTY_NAMES",[a[r]],s[r],t,void 0)})},unevaluatedProperties:function(e,t,r){if(!o(r))return;if(!0===t.unevaluatedProperties)return;const n=t.unevaluatedProperties;if(void 0===n)return;const i=Object.keys(r);if(0===i.length)return;const a=ut.call(this,{report:e,currentSchema:t,json:r,mode:"properties",jsonData:r,depth:0});if("all"===a)return;const s=i.filter(e=>!a.has(e));if(0!==s.length)if(!1===n)e.addError("OBJECT_UNEVALUATED_PROPERTIES",[s.join(", ")],void 0,t,"unevaluatedProperties");else for(const i of s){const o=new b(e);yt.call(this,o,n,r[i]),o.errors.length>0&&e.addError("OBJECT_UNEVALUATED_PROPERTIES",[i],void 0,t,"unevaluatedProperties")}},allOf:function(e,t,r){for(let n=0;n<t.allOf.length;n++){const i=this._jsonValidate(e,t.allOf[n],r);if(this.options.breakOnFirstError&&!1===i)break}},anyOf:function(e,t,r){const n=[];for(let i=0;i<t.anyOf.length;i++){const o=new b(e);n.push(o),this._jsonValidate(o,t.anyOf[i],r),rt(e,t.anyOf[i],r,0===o.errors.length)}it(e,n,()=>{let r=!1;for(const e of n)if(0===e.errors.length){r=!0;break}!1===r&&e.addError("ANY_OF_MISSING",void 0,n,t,"anyOf")})},oneOf:function(e,t,r){const n=[];for(let i=0;i<t.oneOf.length;i++){const o=new b(e);n.push(o),this._jsonValidate(o,t.oneOf[i],r),rt(e,t.oneOf[i],r,0===o.errors.length)}it(e,n,()=>{let r=0;for(const e of n)0===e.errors.length&&r++;0===r?e.addError("ONE_OF_MISSING",void 0,n,t,"oneOf"):r>1&&e.addError("ONE_OF_MULTIPLE",void 0,void 0,t,"oneOf")})},not:function(e,t,r){const n=new b(e);!0===this._jsonValidate(n,t.not,r)&&e.addError("NOT_PASSED",void 0,void 0,t,"not")},if:function(e,t,r){if("draft-04"===this.options.version||"draft-06"===this.options.version)return;const n=t.if,i=t.then,o=t.else;if(void 0===n||void 0===i&&void 0===o)return;const a=new b(e);this._jsonValidate(a,n,r),rt(e,n,r,0===a.errors.length);const s=0===a.errors.length?i:o;void 0!==s&&this._jsonValidate(e,s,r)},then:function(){},else:function(){},definitions:function(){}},mt=function(e,t,r){const n="string"==typeof t.$schema?t.$schema:void 0,i=("https://json-schema.org/draft/2020-12/schema"===n||!n&&"draft2020-12"===this.options.version)&&Array.isArray(t.prefixItems)?t.prefixItems:void 0;if(i)for(let n=0;n<r.length;n++)n<i.length?(e.path.push(n),yt.call(this,e,i[n],r[n]),e.path.pop()):void 0===t.items||Array.isArray(t.items)||(e.path.push(n),e.schemaPath.push("items"),yt.call(this,e,t.items,r[n]),e.schemaPath.pop(),e.path.pop());else if(Array.isArray(t.items))for(let n=0;n<r.length;n++)n<t.items.length?(e.path.push(n),yt.call(this,e,t.items[n],r[n]),e.path.pop()):"object"==typeof t.additionalItems&&(e.path.push(n),yt.call(this,e,t.additionalItems,r[n]),e.path.pop());else if("object"==typeof t.items||"boolean"==typeof t.items)for(let n=0;n<r.length;n++)e.path.push(n),e.schemaPath.push("items"),yt.call(this,e,t.items,r[n]),e.schemaPath.pop(),e.path.pop()},ht=function(e,t,r){let n=t.additionalProperties;!0!==n&&void 0!==n||(n={});const i=t.properties?Object.keys(t.properties):[],o=t.patternProperties?Object.keys(t.patternProperties):[],a=Object.keys(r);for(const s of a){const a=r[s],c=[];i.includes(s)&&c.push(t.properties[s]);for(const e of o){const r=Be(e);r.ok&&!0===r.value.test(s)&&c.push(t.patternProperties[e])}0===c.length&&!1!==n&&c.push(n);for(const t of c)e.path.push(s),i.includes(s)?(e.schemaPath.push("properties"),e.schemaPath.push(s)):e.schemaPath.push("additionalProperties"),yt.call(this,e,t,a),e.path.pop(),e.schemaPath.pop(),i.includes(s)&&e.schemaPath.pop()}};function yt(e,t,r){if(e.commonErrorMessage="JSON_OBJECT_VALIDATION_FAILED",!0===t)return!0;if(!1===t)return e.addError("SCHEMA_IS_FALSE",[],void 0,t),!1;if(!o(t))return e.addError("SCHEMA_NOT_AN_OBJECT",[i(t)],void 0,t),!1;let n=Object.keys(t);if(0===n.length)return!0;let a=!1;e.rootSchema||(e.rootSchema=t,a=!0);const s=e.__$recursiveAnchorStack,c=e.__$dynamicScopeStack;let f=!1,l=!1;const u=d(t),p=t.__$resourceRoot||(a||"string"==typeof u?t:void 0);if(p&&c[c.length-1]!==p&&(c.push(p),l=!0),!0===t.$recursiveAnchor&&(s.push(t),f=!0),void 0!==t.$ref){if("draft2019-09"===this.options.version||"draft2020-12"===this.options.version)t.__$refResolved?yt.call(this,e,t.__$refResolved,r):e.addError("REF_UNRESOLVED",[t.$ref],void 0,t),n=n.filter(e=>"$ref"!==e);else{let r=99;for(;t.$ref&&r>0;){if(!t.__$refResolved){e.addError("REF_UNRESOLVED",[t.$ref],void 0,t);break}if(t.__$refResolved===t)break;t=t.__$refResolved,n=Object.keys(t),r--}if(0===r)throw new Error("Circular dependency by $ref references!");e.schemaPath=[]}}if(void 0!==t.$recursiveRef){if("draft2019-09"===this.options.version||"draft2020-12"===this.options.version){const i=st(t,s);i?yt.call(this,e,i,r):e.addError("REF_UNRESOLVED",[t.$recursiveRef],void 0,t),n=n.filter(e=>"$recursiveRef"!==e)}}if(void 0!==t.$dynamicRef){if("draft2020-12"===this.options.version){const i=ct(t,c);void 0===i?e.addError("REF_UNRESOLVED",[t.$dynamicRef],void 0,t):yt.call(this,e,i,r),n=n.filter(e=>"$dynamicRef"!==e)}}const m=((e,t,r)=>{if("draft2019-09"!==r&&"draft2020-12"!==r)return!0;const n=e.__$schemaResolved,i=t.rootSchema&&"boolean"!=typeof t.rootSchema?t.rootSchema.__$schemaResolved:void 0,a=n||i;if(!a||"object"!=typeof a||!o(a.$vocabulary))return!0;const s=a.$vocabulary,c=Object.hasOwn(s,Ze),d=Object.hasOwn(s,Ge);return!(!c&&!d||!0!==s[Ze]&&!0!==s[Ge])})(t,e,this.options.version);if(m||(n=n.filter(e=>!tt.has(e))),m&&t.type&&(n.splice(n.indexOf("type"),1),e.schemaPath.push("type"),pt.type.call(this,e,t,r),e.schemaPath.pop(),e.errors.length&&this.options.breakOnFirstError))return f&&s.pop(),l&&c.pop(),!1;const h=[];for(const i of n){if("unevaluatedItems"===i||"unevaluatedProperties"===i){h.push(i);continue}const n=pt[i];if(n&&(n.call(this,e,t,r),e.errors.length&&this.options.breakOnFirstError))break}if(h.length>0&&!(e.errors.length>0&&this.options.breakOnFirstError))for(const n of h){const i=pt[n];if(i&&(i.call(this,e,t,r),e.errors.length&&this.options.breakOnFirstError))break}return 0!==e.errors.length&&!1!==this.options.breakOnFirstError||(Array.isArray(r)?mt.call(this,e,t,r):o(r)&&ht.call(this,e,t,r)),"function"==typeof this.options.customValidator&&this.options.customValidator.call(this,e,t,r),f&&s.pop(),l&&c.pop(),a&&(e.rootSchema=void 0),0===e.errors.length}let vt;function Et(){return vt}function gt(e,t,r){[Object.prototype,Function.prototype,Array.prototype].includes(e)||"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=r)}const _t=(e,t,n,i,o,a=100,f=0)=>{if(t=t||[],n=n||[],i=i||[],o=o||{},"object"!=typeof e||null===e)return t;if(f>=a)throw new Error(`Maximum recursion depth (${a}) exceeded in collectReferences. If your schema is deeply nested and valid, increase the maxRecursionDepth option.`);const l="string"==typeof e.$ref&&void 0===e.__$refResolved;let u=!1;const p=0===n.length;let m=d(e);if("string"!=typeof e.id||!r(e.id)||m&&r(m)||(m=e.id),"string"==typeof m&&(p||!l||!0===o.useRefObjectScope)){const t=n.length>0?n[n.length-1]:void 0;n.push(bt(t,e,m)),u=!0}if(l&&t.push({ref:$t(n[n.length-1],e.$ref),key:"$ref",obj:e,path:i.slice(0)}),"string"==typeof e.$recursiveRef&&void 0===e.__$recursiveRefResolved&&t.push({ref:$t(n[n.length-1],e.$recursiveRef),key:"$recursiveRef",obj:e,path:i.slice(0)}),"string"==typeof e.$dynamicRef&&void 0===e.__$dynamicRefResolved&&t.push({ref:$t(n[n.length-1],e.$dynamicRef),key:"$dynamicRef",obj:e,path:i.slice(0)}),"string"==typeof e.$schema&&void 0===e.__$schemaResolved&&t.push({ref:$t(n[n.length-1],e.$schema),key:"$schema",obj:e,path:i.slice(0)}),Array.isArray(e))for(let r=0;r<e.length;r++)i.push(r),_t(e[r],t,n,i,o,a,f+1),i.pop();else{const r=Object.keys(e);for(const d of r)c(d)||s.includes(d)||(i.push(d),_t(e[d],t,n,i,o,a,f+1),i.pop())}return u&&n.pop(),t},$t=(e,t)=>{if(r(t))return t;const n=e??"";if("#"===t[0]){const e=n.indexOf("#");return(-1===e?n:n.slice(0,e))+t}if(!n)return t;const i=n.indexOf("#"),o=-1===i?n:n.slice(0,i);if(r(o))try{return new URL(t,o).toString()}catch{}let a=o;if(!a.endsWith("/")){const e=a.lastIndexOf("/");a=-1===e?"":a.slice(0,e+1)}return a+t},Ot=e=>"#"!==e[0]&&!e.includes("/")&&!e.includes(".")&&!e.includes("#"),bt=(e,t,n)=>"string"==typeof t.$id?$t(e,n):((e,t)=>{if(r(t))return t;const n=e??"";if(Ot(t)){const e=n.indexOf("#");return(-1===e?n:n.slice(0,e))+"#"+t}return $t(e,t)})(e,n);class At{validator;constructor(e){this.validator=e}collectAndCacheIds(e){const t=((e,t=100)=>{const n=[];return function e(i,o,a=0){if("object"!=typeof i||null==i)return;if(a>=t)throw new Error(`Maximum recursion depth (${t}) exceeded in collectIds. If your schema is deeply nested and valid, increase the maxRecursionDepth option.`);let f=!1;const l=d(i);if("string"==typeof l){let e=r(l)?"absolute":"relative";0===o.length&&(e="root");const t={id:l,type:e,obj:i};if("absolute"===e||"root"===e&&r(l))t.absoluteUri=l;else if("root"===e&&"string"==typeof i.id&&r(i.id)&&i.id!==l)t.absoluteUri=bt(i.id,i,l);else if("relative"===e&&(t.absoluteParent=o.filter(e=>"absolute"===e.type||"root"===e.type&&e.absoluteUri).slice(-1)[0],t.absoluteParent)){const e=t.absoluteParent.absoluteUri||t.absoluteParent.id;t.absoluteUri=bt(e,i,t.id)}n.push(t),o.push(t),f=!0}if(Array.isArray(i))for(const t of i)e(t,o,a+1);else for(const t of Object.keys(i))c(t)||s.includes(t)||e(i[t],o,a+1);f&&o.pop()}(e,[]),n})(e,this.validator.options.maxRecursionDepth);for(const e of t)if(e.absoluteUri){if(this.validator.scache.cacheSchemaByUri(e.absoluteUri,e.obj),"relative"===e.type&&e.absoluteParent&&Ot(e.id)){const t=e.absoluteParent.absoluteUri||e.absoluteParent.id,r=$t(t,e.id);this.validator.scache.cacheSchemaByUri(r,e.obj)}}else"root"===e.type&&this.validator.scache.cacheSchemaByUri(e.id,e.obj)}compileSchema(e,n,i){if(e.commonErrorMessage="SCHEMA_COMPILATION_FAILED","string"==typeof n){const t=this.validator.scache.getSchemaByUri(e,n);if(void 0===t)return e.addError("SCHEMA_NOT_REACHABLE",[n]),!1;n=t}if(Array.isArray(n))return i?.noCache||n.forEach(e=>this.collectAndCacheIds(e)),this.compileArrayOfSchemas(e,n);if("boolean"==typeof n)return!0;i?.noCache||this.collectAndCacheIds(n);const o=n!==Object.prototype&&n!==Function.prototype&&n!==Array.prototype;if(o&&n.__$compiled&&n.id&&!1===this.validator.scache.checkCacheForUri(n.id)&&(n.__$compiled=void 0),n.__$compiled)return!0;o&&!n.$schema&&"none"!==this.validator.options.version&&(n.$schema=this.validator.getDefaultSchemaId()),n.id&&"string"==typeof n.id&&!i?.noCache&&this.validator.scache.cacheSchemaByUri(n.id,n);let a=!1;e.rootSchema||(e.rootSchema=n,a=!0);const s=e.isValid();o&&delete n.__$missingReferences;const c="draft2019-09"===this.validator.options.version||"draft2020-12"===this.validator.options.version,d=_t(n,void 0,void 0,void 0,{useRefObjectScope:c},this.validator.options.maxRecursionDepth);for(const i of d){let a=this.validator.scache.getSchemaByUri(e,i.ref,n);if(void 0===a){const r=Et();if(r){const o=t(i.ref),s=r(o);if(s){s.id=o;const t=new b(e);this.compileSchema(t,s)?a=this.validator.scache.getSchemaByUri(e,i.ref,n):e.errors=e.errors.concat(t.errors)}}}if(void 0===a){const t=e.hasError("REMOTE_NOT_VALID",[i.ref]),a=r(i.ref);let c=!1;const d=!0===this.validator.options.ignoreUnresolvableReferences;a&&(c=this.validator.scache.checkCacheForUri(i.ref)),t||d&&a||c||(e.path.push(...i.path),e.addError("UNRESOLVABLE_REFERENCE",[i.ref]),e.path=e.path.slice(0,-i.path.length),s&&o&&(n.__$missingReferences=n.__$missingReferences||[],n.__$missingReferences.push(i)))}gt(i.obj,`__${i.key}Resolved`,a)}const f=e.isValid();return f&&o&&(n.__$compiled=!0),a&&(e.rootSchema=void 0),f}compileArrayOfSchemas(e,t){let r,n=0;do{e.errors=e.errors.filter(e=>"UNRESOLVABLE_REFERENCE"!==e.code),r=n,n=this.compileArrayOfSchemasLoop(e,t);for(const e of t)if(e.__$missingReferences){for(let r=e.__$missingReferences.length-1;r>=0;r--){const n=e.__$missingReferences[r],i=t.find(e=>e.id===n.ref);i&&(gt(n.obj,`__${n.key}Resolved`,i),e.__$missingReferences.splice(r,1))}0===e.__$missingReferences.length&&delete e.__$missingReferences}}while(n!==t.length&&n!==r);return e.isValid()}compileArrayOfSchemasLoop(e,t){let r=0;for(const n of t){const t=new b(e);this.compileSchema(t,n)&&r++,e.errors=e.errors.concat(t.errors)}return r}}const Rt={$ref:function(e,t){"string"!=typeof t.$ref&&e.addError("KEYWORD_TYPE_EXPECTED",["$ref","string"],void 0,t,"$ref")},$schema:function(e,t){"string"!=typeof t.$schema&&e.addError("KEYWORD_TYPE_EXPECTED",["$schema","string"],void 0,t,"$schema")},multipleOf:function(e,t){"number"!=typeof t.multipleOf?e.addError("KEYWORD_TYPE_EXPECTED",["multipleOf","number"],void 0,t,"multipleOf"):t.multipleOf<=0&&e.addError("KEYWORD_MUST_BE",["multipleOf","strictly greater than 0"],void 0,t,"multipleOf")},maximum:function(e,t){"number"!=typeof t.maximum&&e.addError("KEYWORD_TYPE_EXPECTED",["maximum","number"],void 0,t,"maximum")},exclusiveMaximum:function(e,t){"draft-04"===e.options.version?"boolean"!=typeof t.exclusiveMaximum?e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMaximum","boolean"],void 0,t,"exclusiveMaximum"):void 0===t.maximum&&e.addError("KEYWORD_DEPENDENCY",["exclusiveMaximum","maximum"],void 0,t,"exclusiveMaximum"):"boolean"!=typeof t.exclusiveMaximum&&"number"!=typeof t.exclusiveMaximum&&e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMaximum",["boolean","number"]],void 0,t,"exclusiveMaximum")},minimum:function(e,t){"number"!=typeof t.minimum&&e.addError("KEYWORD_TYPE_EXPECTED",["minimum","number"],void 0,t,"minimum")},exclusiveMinimum:function(e,t){"draft-04"===e.options.version?"boolean"!=typeof t.exclusiveMinimum?e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMinimum","boolean"],void 0,t,"exclusiveMinimum"):void 0===t.minimum&&e.addError("KEYWORD_DEPENDENCY",["exclusiveMinimum","minimum"],void 0,t,"exclusiveMinimum"):"boolean"!=typeof t.exclusiveMinimum&&"number"!=typeof t.exclusiveMinimum&&e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMinimum",["boolean","number"]],void 0,t,"exclusiveMinimum")},maxLength:function(e,t){a(t.maxLength)?t.maxLength<0&&e.addError("KEYWORD_MUST_BE",["maxLength","greater than, or equal to 0"],void 0,t,"maxLength"):e.addError("KEYWORD_TYPE_EXPECTED",["maxLength","integer"],void 0,t,"maxLength")},minLength:function(e,t){a(t.minLength)?t.minLength<0&&e.addError("KEYWORD_MUST_BE",["minLength","greater than, or equal to 0"],void 0,t,"minLength"):e.addError("KEYWORD_TYPE_EXPECTED",["minLength","integer"],void 0,t,"minLength")},pattern:function(e,t){if("string"!=typeof t.pattern)e.addError("KEYWORD_TYPE_EXPECTED",["pattern","string"],void 0,t,"pattern");else{const r=Be(t.pattern);r.ok||e.addError("KEYWORD_PATTERN",["pattern",t.pattern,r.error.message],void 0,t,"pattern")}},additionalItems:function(e,t){"boolean"==typeof t.additionalItems||o(t.additionalItems)?o(t.additionalItems)&&(e.path.push("additionalItems"),this.validateSchema(e,t.additionalItems),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["additionalItems",["boolean","object"]],void 0,t,"additionalItems")},items:function(e,t){if(Array.isArray(t.items))for(let r=0;r<t.items.length;r++)e.path.push("items"),e.path.push(r),this.validateSchema(e,t.items[r]),e.path.pop(),e.path.pop();else o(t.items)||"draft-04"!==e.options.version&&"boolean"==typeof t.items?(e.path.push("items"),this.validateSchema(e,t.items),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["items","draft-04"===e.options.version?["array","object"]:["array","object","boolean"]],void 0,t,"items");!0===this.options.forceAdditional&&void 0===t.additionalItems&&Array.isArray(t.items)&&e.addError("KEYWORD_UNDEFINED_STRICT",["additionalItems"],void 0,t,"additionalItems"),this.options.assumeAdditional&&void 0===t.additionalItems&&Array.isArray(t.items)&&(t.additionalItems=!1)},maxItems:function(e,t){"number"!=typeof t.maxItems?e.addError("KEYWORD_TYPE_EXPECTED",["maxItems","integer"],void 0,t,"maxItems"):t.maxItems<0&&e.addError("KEYWORD_MUST_BE",["maxItems","greater than, or equal to 0"],void 0,t,"maxItems")},minItems:function(e,t){a(t.minItems)?t.minItems<0&&e.addError("KEYWORD_MUST_BE",["minItems","greater than, or equal to 0"],void 0,t,"minItems"):e.addError("KEYWORD_TYPE_EXPECTED",["minItems","integer"],void 0,t,"minItems")},uniqueItems:function(e,t){"boolean"!=typeof t.uniqueItems&&e.addError("KEYWORD_TYPE_EXPECTED",["uniqueItems","boolean"],void 0,t,"uniqueItems")},maxProperties:function(e,t){a(t.maxProperties)?t.maxProperties<0&&e.addError("KEYWORD_MUST_BE",["maxProperties","greater than, or equal to 0"],void 0,t,"maxProperties"):e.addError("KEYWORD_TYPE_EXPECTED",["maxProperties","integer"],void 0,t,"maxProperties")},minProperties:function(e,t){a(t.minProperties)?t.minProperties<0&&e.addError("KEYWORD_MUST_BE",["minProperties","greater than, or equal to 0"],void 0,t,"minProperties"):e.addError("KEYWORD_TYPE_EXPECTED",["minProperties","integer"],void 0,t,"minProperties")},required:function(e,t){if(Array.isArray(t.required))if("draft-04"===e.options.version&&0===t.required.length)e.addError("KEYWORD_MUST_BE",["required","an array with at least one element"],void 0,t,"required");else{for(const r of t.required)"string"!=typeof r&&e.addError("KEYWORD_VALUE_TYPE",["required","string"],void 0,t,"required");!1===He(t.required)&&e.addError("KEYWORD_MUST_BE",["required","an array with unique items"],void 0,t,"required")}else e.addError("KEYWORD_TYPE_EXPECTED",["required","array"],void 0,t,"required")},additionalProperties:function(e,t){"boolean"==typeof t.additionalProperties||o(t.additionalProperties)?o(t.additionalProperties)&&(e.path.push("additionalProperties"),this.validateSchema(e,t.additionalProperties),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["additionalProperties",["boolean","object"]],void 0,t,"additionalProperties")},properties:function(e,t){if(!o(t.properties))return void e.addError("KEYWORD_TYPE_EXPECTED",["properties","object"],void 0,t,"properties");const r=Object.keys(t.properties);for(const n of r){const r=t.properties[n];e.path.push("properties"),e.path.push(n),this.validateSchema(e,r),e.path.pop(),e.path.pop()}!0===this.options.forceAdditional&&void 0===t.additionalProperties&&e.addError("KEYWORD_UNDEFINED_STRICT",["additionalProperties"],void 0,t,"additionalProperties"),this.options.assumeAdditional&&void 0===t.additionalProperties&&(t.additionalProperties=!1),!0===this.options.forceProperties&&0===r.length&&e.addError("CUSTOM_MODE_FORCE_PROPERTIES",["properties"],void 0,t,"properties")},patternProperties:function(e,t){if(!o(t.patternProperties))return void e.addError("KEYWORD_TYPE_EXPECTED",["patternProperties","object"],void 0,t,"patternProperties");const r=Object.keys(t.patternProperties);for(const n of r){const r=t.patternProperties[n],i=Be(n);i.ok||e.addError("KEYWORD_PATTERN",["patternProperties",n,i.error.message],void 0,t,"patternProperties"),e.path.push("patternProperties"),e.path.push(n),this.validateSchema(e,r),e.path.pop(),e.path.pop()}!0===this.options.forceProperties&&0===r.length&&e.addError("CUSTOM_MODE_FORCE_PROPERTIES",["patternProperties"],void 0,t,"patternProperties")},dependencies:function(e,t){if(o(t.dependencies)){const r=Object.keys(t.dependencies);for(const n of r){const r=t.dependencies[n];if(o(r)||"draft-04"!==e.options.version&&"boolean"==typeof r)e.path.push("dependencies"),e.path.push(n),this.validateSchema(e,r),e.path.pop(),e.path.pop();else if(Array.isArray(r)){const n=r;"draft-04"===e.options.version&&0===n.length&&e.addError("KEYWORD_MUST_BE",["dependencies","not empty array"],void 0,t,"dependencies");for(const r of n)"string"!=typeof r&&e.addError("KEYWORD_VALUE_TYPE",["dependencies","string"],void 0,t,"dependencies");!1===He(n)&&e.addError("KEYWORD_MUST_BE",["dependencies","an array with unique items"],void 0,t,"dependencies")}else e.addError("KEYWORD_VALUE_TYPE",["dependencies","draft-04"===e.options.version?"object or array":"boolean, object or array"],void 0,t,"dependencies")}}else e.addError("KEYWORD_TYPE_EXPECTED",["dependencies","object"],void 0,t,"dependencies")},enum:function(e,t){!1===Array.isArray(t.enum)?e.addError("KEYWORD_TYPE_EXPECTED",["enum","array"],void 0,t,"enum"):0===t.enum.length?e.addError("KEYWORD_MUST_BE",["enum","an array with at least one element"],void 0,t,"enum"):!1===He(t.enum)&&e.addError("KEYWORD_MUST_BE",["enum","an array with unique elements"],void 0,t,"enum")},type:function(e,t){const r=["array","boolean","integer","number","null","object","string"],n=r.join(","),i=Array.isArray(t.type);if(Array.isArray(t.type)){for(const i of t.type)r.includes(i)||e.addError("KEYWORD_TYPE_EXPECTED",["type",n],void 0,t,"type");!1===He(t.type)&&e.addError("KEYWORD_MUST_BE",["type","an object with unique properties"],void 0,t,"type")}else"string"==typeof t.type?r.includes(t.type)||e.addError("KEYWORD_TYPE_EXPECTED",["type",n],void 0,t,"type"):e.addError("KEYWORD_TYPE_EXPECTED",["type",["string","array"]],void 0,t,"type");!0===this.options.noEmptyStrings&&("string"===t.type||i&&t.type.includes("string"))&&void 0===t.minLength&&void 0===t.enum&&void 0===t.format&&(t.minLength=1),!0===this.options.noEmptyArrays&&("array"===t.type||i&&t.type.includes("array"))&&void 0===t.minItems&&(t.minItems=1),!0===this.options.forceProperties&&("object"===t.type||i&&t.type.includes("object"))&&void 0===t.properties&&void 0===t.patternProperties&&e.addError("KEYWORD_UNDEFINED_STRICT",["properties"],void 0,t,"properties"),!0===this.options.forceItems&&("array"===t.type||i&&t.type.includes("array"))&&void 0===t.items&&e.addError("KEYWORD_UNDEFINED_STRICT",["items"],void 0,t,"items"),!0===this.options.forceMinItems&&("array"===t.type||i&&t.type.includes("array"))&&void 0===t.minItems&&e.addError("KEYWORD_UNDEFINED_STRICT",["minItems"],void 0,t,"minItems"),!0===this.options.forceMaxItems&&("array"===t.type||i&&t.type.includes("array"))&&void 0===t.maxItems&&e.addError("KEYWORD_UNDEFINED_STRICT",["maxItems"],void 0,t,"maxItems"),!0===this.options.forceMinLength&&("string"===t.type||i&&t.type.includes("string"))&&void 0===t.minLength&&void 0===t.format&&void 0===t.enum&&void 0===t.pattern&&e.addError("KEYWORD_UNDEFINED_STRICT",["minLength"],void 0,t,"minLength"),!0===this.options.forceMaxLength&&("string"===t.type||i&&t.type.includes("string"))&&void 0===t.maxLength&&void 0===t.format&&void 0===t.enum&&void 0===t.pattern&&e.addError("KEYWORD_UNDEFINED_STRICT",["maxLength"],void 0,t,"maxLength")},allOf:function(e,t){if(!1===Array.isArray(t.allOf))e.addError("KEYWORD_TYPE_EXPECTED",["allOf","array"],void 0,t,"allOf");else if(0===t.allOf.length)e.addError("KEYWORD_MUST_BE",["allOf","an array with at least one element"],void 0,t,"allOf");else for(let r=0;r<t.allOf.length;r++)e.path.push("allOf"),e.path.push(r),this.validateSchema(e,t.allOf[r]),e.path.pop(),e.path.pop()},anyOf:function(e,t){if(!1===Array.isArray(t.anyOf))e.addError("KEYWORD_TYPE_EXPECTED",["anyOf","array"],void 0,t,"anyOf");else if(0===t.anyOf.length)e.addError("KEYWORD_MUST_BE",["anyOf","an array with at least one element"],void 0,t,"anyOf");else for(let r=0;r<t.anyOf.length;r++)e.path.push("anyOf"),e.path.push(r),this.validateSchema(e,t.anyOf[r]),e.path.pop(),e.path.pop()},oneOf:function(e,t){if(!1===Array.isArray(t.oneOf))e.addError("KEYWORD_TYPE_EXPECTED",["oneOf","array"],void 0,t,"oneOf");else if(0===t.oneOf.length)e.addError("KEYWORD_MUST_BE",["oneOf","an array with at least one element"],void 0,t,"oneOf");else for(let r=0;r<t.oneOf.length;r++)e.path.push("oneOf"),e.path.push(r),this.validateSchema(e,t.oneOf[r]),e.path.pop(),e.path.pop()},not:function(e,t){const r=t.not;("draft-04"===e.options.version?o(r):"boolean"==typeof r||o(r))?(e.path.push("not"),this.validateSchema(e,r),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["not","draft-04"===e.options.version?"object":["boolean","object"]],void 0,t,"not")},if:function(e,t){if("draft-07"!==e.options.version)return;const r=t.if;"boolean"==typeof r||o(r)?(e.path.push("if"),this.validateSchema(e,r),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["if",["boolean","object"]],void 0,t,"if")},then:function(e,t){if("draft-07"!==e.options.version)return;const r=t.then;"boolean"==typeof r||o(r)?(e.path.push("then"),this.validateSchema(e,r),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["then",["boolean","object"]],void 0,t,"then")},else:function(e,t){if("draft-07"!==e.options.version)return;const r=t.else;"boolean"==typeof r||o(r)?(e.path.push("else"),this.validateSchema(e,r),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["else",["boolean","object"]],void 0,t,"else")},definitions:function(e,t){if(o(t.definitions)){const r=Object.keys(t.definitions);for(const n of r){const r=t.definitions[n];e.path.push("definitions"),e.path.push(n),this.validateSchema(e,r),e.path.pop(),e.path.pop()}}else e.addError("KEYWORD_TYPE_EXPECTED",["definitions","object"],void 0,t,"definitions")},$defs:function(e,t){if("draft2019-09"!==e.options.version&&"draft2020-12"!==e.options.version)return;if(!o(t.$defs))return void e.addError("KEYWORD_TYPE_EXPECTED",["$defs","object"],void 0,t,"$defs");const r=Object.keys(t.$defs);for(const n of r){const r=t.$defs[n];e.path.push("$defs"),e.path.push(n),this.validateSchema(e,r),e.path.pop(),e.path.pop()}},format:function(e,t){if(!1!==this.options.formatAssertions)if("string"!=typeof t.format)e.addError("KEYWORD_TYPE_EXPECTED",["format","string"],void 0,t,"format");else{const r="draft2019-09"===this.options.version||"draft2020-12"===this.options.version;(function(e,t){if(t){const r=t[e];if(null===r)return!1;if(null!=r)return!0}return e in Xe?null!=Xe[e]:e in Ve})(t.format,this.options.customFormats)||!0===this.options.ignoreUnknownFormats||r||e.addError("UNKNOWN_FORMAT",[t.format],void 0,t,"format")}},contentEncoding:function(e,t){"draft-07"===e.options.version&&"string"!=typeof t.contentEncoding&&e.addError("KEYWORD_TYPE_EXPECTED",["contentEncoding","string"],void 0,t,"contentEncoding")},contentMediaType:function(e,t){"draft-07"===e.options.version&&"string"!=typeof t.contentMediaType&&e.addError("KEYWORD_TYPE_EXPECTED",["contentMediaType","string"],void 0,t,"contentMediaType")},id:function(e,t){"string"!=typeof t.id&&e.addError("KEYWORD_TYPE_EXPECTED",["id","string"],void 0,t,"id")},title:function(e,t){"string"!=typeof t.title&&e.addError("KEYWORD_TYPE_EXPECTED",["title","string"],void 0,t,"title")},description:function(e,t){"string"!=typeof t.description&&e.addError("KEYWORD_TYPE_EXPECTED",["description","string"],void 0,t,"description")},default:function(){}};class xt{validator;constructor(e){this.validator=e}get options(){return this.validator.options}validateArrayOfSchemas(e,t){for(const r of t)this.validateSchema(e,r);return e.isValid()}validateSchema(e,t){if(e.commonErrorMessage="SCHEMA_VALIDATION_FAILED",Array.isArray(t))return this.validateArrayOfSchemas(e,t);if("boolean"==typeof t)return!0;if(t.__$validated)return!0;const r=t.$schema&&d(t)!==t.$schema;if(r)if(t.__$schemaResolved&&t.__$schemaResolved!==t){const r=new b(e);!1===yt.call(this.validator,r,t.__$schemaResolved,t)&&e.addError("PARENT_SCHEMA_VALIDATION_FAILED",void 0,r,t,"$schema")}else!0!==this.validator.options.ignoreUnresolvableReferences&&e.addError("REF_UNRESOLVED",[t.$schema],void 0,t,"$schema");if(!0===this.validator.options.noTypeless){if(void 0!==t.type){let e=[];Array.isArray(t.anyOf)&&(e=e.concat(t.anyOf)),Array.isArray(t.oneOf)&&(e=e.concat(t.oneOf)),Array.isArray(t.allOf)&&(e=e.concat(t.allOf)),e.forEach(function(e){e.type||(e.type=t.type)})}void 0===t.enum&&void 0===t.type&&void 0===t.anyOf&&void 0===t.oneOf&&void 0===t.not&&void 0===t.$ref&&e.addError("KEYWORD_UNDEFINED_STRICT",["type"],void 0,t,"type")}const n=Object.keys(t);for(const i of n)i.startsWith("__")||(Object.hasOwn(Rt,i)?Rt[i].call(this,e,t):r||!0===this.validator.options.noExtraKeywords&&e.addError("KEYWORD_UNEXPECTED",[i],void 0,t,void 0));if(!0===this.validator.options.pedanticCheck){if(t.enum){const r=h(t);delete r.enum,delete r.default,e.path.push("enum");for(let n=0;n<t.enum.length;n++)e.path.push(n),yt.call(this.validator,e,r,t.enum[n]),e.path.pop();e.path.pop()}t.default&&(e.path.push("default"),yt.call(this.validator,e,t,t.default),e.path.pop())}const i=e.isValid();return i&&(t.__$validated=!0),i}}const It=Symbol("ZSchema.factory");class St{scache;sc;sv;validateOptions={};options;constructor(e,t){if(t!==It)throw new Error("do not use new ZSchema(), use ZSchema.create() instead");this.scache=new P(this),this.sc=new At(this),this.sv=new xt(this),this.options=x(e)}_jsonValidate(e,t,r){return yt.call(this,e,t,r)}getDefaultSchemaId(){return this.options.version&&"none"!==this.options.version?A[this.options.version]:A[R.version]}_validate(e,t,r,n){if("function"==typeof r&&(n=r,r={}),r||(r={}),this.validateOptions=r,"string"!=typeof t&&"boolean"!=typeof t&&!o(t)){const e=new Error("Invalid .validate call - schema must be a string or object but "+i(t)+" was passed!");if(n)return void setTimeout(function(){n(e,!1)},0);throw e}let a=!1;const s=new b(this.options,r);let c;if(s.json=e,"string"==typeof t){const e=t;if(c=this.scache.getSchema(s,e),!c){const t=new Error("Schema with id '"+e+"' wasn't found in the validator cache!");if(n)return void setTimeout(function(){n(t,!1)},0);throw t}}else c=this.scache.getSchema(s,t);let d=!1;a||(d=this.sc.compileSchema(s,c)),d||(a=!0);let f=!1;if(a||(f=this.sv.validateSchema(s,c)),f||(a=!0),r.schemaPath&&(s.rootSchema=c,c=_(c,r.schemaPath),!c)){const e=new Error("Schema path '"+r.schemaPath+"' wasn't found in the schema!");if(n)return void setTimeout(function(){n(e,!1)},0);throw e}if(a||yt.call(this,s,c,e),!n){if(s.asyncTasks.length>0)throw new Error("This validation has async tasks and cannot be done in sync mode, please provide callback argument.");if(!s.isValid())throw p({message:s.commonErrorMessage,details:s.errors});return!0}s.processAsyncTasks(this.options.asyncTimeout,n)}_validateSchema(e){if(Array.isArray(e)&&0===e.length)throw new Error(".compileSchema was called with an empty array");const t=new b(this.options);if(Array.isArray(e)){const r=this.scache.getSchema(t,e);this.sc.compileSchema(t,r)&&this.sv.validateSchema(t,r)}else{const r=this.scache.getSchema(t,e);this.sc.compileSchema(t,r)&&this.sv.validateSchema(t,r)}if(!t.isValid())throw p({message:t.commonErrorMessage,details:t.errors});return!0}registerFormat(e,t){this.options.customFormats||(this.options.customFormats={}),this.options.customFormats[e]=t}unregisterFormat(e){this.options.customFormats||(this.options.customFormats={}),this.options.customFormats[e]=null}getRegisteredFormats(){return g(this.options.customFormats||{}).filter(e=>null!=this.options.customFormats?.[e])}getSupportedFormats(){return function(e){const t={...Ve,...Xe,...e};return g(t).filter(e=>null!=t[e])}(this.options.customFormats)}setRemoteReference(e,t,r){const n=T(t,e,r,this.options.maxRecursionDepth);this.scache.cacheSchemaByUri(e,n)}getMissingReferences(e){if(!e)return[];const t=e.details||[],r=[];return function e(t){for(const n of t)"UNRESOLVABLE_REFERENCE"!==n.code&&"SCHEMA_NOT_REACHABLE"!==n.code||r.push(n.params[0]),n.inner&&e(n.inner)}(t),r}getMissingRemoteReferences(e){const r=this.getMissingReferences(e),n=[];for(const e of r){const r=t(e);r&&!n.includes(r)&&n.push(r)}return n}getResolvedSchema(e){const t=new b(this.options),r=this.scache.getSchemaByUri(t,e);if(!r)return;const n=y(r,this.options.maxRecursionDepth),o=new WeakSet,a=function(e){let t;const r=i(e);if(("object"===r||"array"===r)&&!o.has(e)){if(o.add(e),e.$ref&&e.__$refResolved){const r=e.__$refResolved,n=e;for(t in delete e.$ref,delete e.__$refResolved,r)m(r,n,t)}for(t in e)Object.hasOwn(e,t)&&(c(t)?delete e[t]:a(e[t]))}};return a(n),n}}class Tt extends St{constructor(e,t){super(e,t)}static registerFormat(e,t){return function(e,t){Xe[e]=t}(e,t)}static unregisterFormat(e){return function(e){delete Xe[e]}(e)}static getRegisteredFormats(){return g(Xe)}static getDefaultOptions(){return y(R)}static setRemoteReference(e,t,r){const n=T(t,e,r);P.cacheSchemaByUri(e,n)}static getSchemaReader(){return Et()}static setSchemaReader(e){return function(e){vt=e}(e)}static schemaSymbol=O;static jsonSymbol=$;static create(e={}){const t=e.async,r=e.safe;return delete e.async,delete e.safe,t&&r?new jt(e,It):t?new Dt(e,It):r?new Pt(e,It):new Tt(e,It)}validate(e,t,r={}){return this._validate(e,t,r)}validateSafe(e,t,r){try{return this._validate(e,t,r??{}),{valid:!0}}catch(e){return{valid:!1,err:e}}}validateAsync(e,t,r){return new Promise((n,i)=>{try{this._validate(e,t,r||{},(e,t)=>e||!0!==t?i(e):n(t))}catch(e){i(e)}})}validateAsyncSafe(e,t,r){return new Promise(n=>{try{this._validate(e,t,r||{},(e,t)=>{n({valid:t,err:e})})}catch(e){n({valid:!1,err:e})}})}validateSchema(e){return this._validateSchema(e)}validateSchemaSafe(e){try{return this._validateSchema(e),{valid:!0}}catch(e){return{valid:!1,err:e}}}}class Pt extends St{constructor(e,t){super(e,t)}validate(e,t,r={}){try{return this._validate(e,t,r),{valid:!0}}catch(e){return{valid:!1,err:e}}}validateSchema(e){try{return this._validateSchema(e),{valid:!0}}catch(e){return{valid:!1,err:e}}}}class Dt extends St{constructor(e,t){super(e,t)}validate(e,t,r={}){return new Promise((n,i)=>{try{this._validate(e,t,r,(e,t)=>e||!0!==t?i(e):n(t))}catch(e){i(e)}})}validateSchema(e){return this._validateSchema(e)}}class jt extends St{constructor(e,t){super(e,t)}validate(e,t,r={}){return new Promise(n=>{try{this._validate(e,t,r,(e,t)=>{n({valid:t,err:e})})}catch(e){n({valid:!1,err:e})}})}validateSchema(e){try{return this._validateSchema(e),{valid:!0}}catch(e){return{valid:!1,err:e}}}}e.ZSchema=Tt,e.ZSchemaAsync=Dt,e.ZSchemaAsyncSafe=jt,e.ZSchemaSafe=Pt});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZSchema={})}(this,function(e){"use strict";const t=e=>{const t=e.indexOf("#");return-1===t?e:e.slice(0,t)},r=e=>/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(e),n=100,i=e=>"object"==typeof e?null===e?"null":Array.isArray(e)?"array":"object":"number"==typeof e?Number.isFinite(e)?e%1==0?"integer":"number":Number.isNaN(e)?"not-a-number":"unknown-number":typeof e;function o(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function a(e){return"number"==typeof e&&Number.isFinite(e)&&e%1==0}const s=["enum","const","default","examples"],c=e=>e.startsWith("__$"),d=e=>"string"==typeof e.$schema&&e.$schema.includes("draft-04")?e.id:e.$id??e.id,f=(e,n,i,a,l=100,u=0)=>{if("object"!=typeof e||null===e)return;if(!n)return e;if(u>=l)throw new Error(`Maximum recursion depth (${l}) exceeded in findId. If your schema is deeply nested and valid, increase the maxRecursionDepth option.`);const p=a??i,m=d(e);let h=p;if(m)if(r(m))h=t(m);else if(p&&r(p))try{h=t(new URL(m,p).toString())}catch{}if(!i||h===i){if(m&&(m===n||"#"===m[0]&&m.substring(1)===n))return e;if(e.$anchor===n||e.$dynamicAnchor===n)return e}let y;if(Array.isArray(e))for(let t=0;t<e.length;t++)if(y=f(e[t],n,i,h,l,u+1),y)return y;if(o(e)){const t=Object.keys(e);for(let r=t.length-1;r>=0;r--){const o=t[r];if(!c(o)&&!s.includes(o)&&(y=f(e[o],n,i,h,l,u+1),y))return y}}},l={INVALID_TYPE:"Expected type {0} but found type {1}",INVALID_FORMAT:"Object didn't pass validation for format {0}: {1}",ENUM_MISMATCH:"No enum match for: {0}",ENUM_CASE_MISMATCH:"Enum does not match case for: {0}",ANY_OF_MISSING:"Data does not match any schemas from 'anyOf'",ONE_OF_MISSING:"Data does not match any schemas from 'oneOf'",ONE_OF_MULTIPLE:"Data is valid against more than one schema from 'oneOf'",NOT_PASSED:"Data matches schema from 'not'",ARRAY_LENGTH_SHORT:"Array is too short ({0}), minimum {1}",ARRAY_LENGTH_LONG:"Array is too long ({0}), maximum {1}",ARRAY_UNIQUE:"Array items are not unique (indexes {0} and {1})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",ARRAY_UNEVALUATED_ITEMS:"Unevaluated items are not allowed",MULTIPLE_OF:"Value {0} is not a multiple of {1}",MINIMUM:"Value {0} is less than minimum {1}",MINIMUM_EXCLUSIVE:"Value {0} is equal or less than exclusive minimum {1}",MAXIMUM:"Value {0} is greater than maximum {1}",MAXIMUM_EXCLUSIVE:"Value {0} is equal or greater than exclusive maximum {1}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({0}), minimum {1}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({0}), maximum {1}",OBJECT_MISSING_REQUIRED_PROPERTY:"Missing required property: {0}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed: {0}",OBJECT_UNEVALUATED_PROPERTIES:"Unevaluated properties are not allowed: {0}",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {0} (due to key: {1})",MIN_LENGTH:"String is too short ({0} chars), minimum {1}",MAX_LENGTH:"String is too long ({0} chars), maximum {1}",PATTERN:"String does not match pattern {0}: {1}",KEYWORD_TYPE_EXPECTED:"Keyword '{0}' is expected to be of type '{1}'",KEYWORD_UNDEFINED_STRICT:"Keyword '{0}' must be defined in strict mode",KEYWORD_UNEXPECTED:"Keyword '{0}' is not expected to appear in the schema",KEYWORD_MUST_BE:"Keyword '{0}' must be {1}",KEYWORD_DEPENDENCY:"Keyword '{0}' requires keyword '{1}'",KEYWORD_PATTERN:"Keyword '{0}' is not a valid RegExp pattern: {1}",KEYWORD_VALUE_TYPE:"Each element of keyword '{0}' array must be a '{1}'",UNKNOWN_FORMAT:"There is no validation function for format '{0}'",CUSTOM_MODE_FORCE_PROPERTIES:"{0} must define at least one property if present",REF_UNRESOLVED:"Reference has not been resolved during compilation: {0}",UNRESOLVABLE_REFERENCE:"Reference could not be resolved: {0}",SCHEMA_NOT_REACHABLE:"Validator was not able to read schema with uri: {0}",SCHEMA_TYPE_EXPECTED:"Schema is expected to be of type 'object'",SCHEMA_NOT_AN_OBJECT:"Schema is not an object: {0}",ASYNC_TIMEOUT:"{0} asynchronous task(s) have timed out after {1} ms",PARENT_SCHEMA_VALIDATION_FAILED:"Schema failed to validate against its parent schema, see inner errors for details.",REMOTE_NOT_VALID:"Remote reference didn't compile successfully: {0}",SCHEMA_IS_FALSE:'Boolean schema "false" is always invalid.',CONST:"Value does not match const: {0}",CONTAINS:"Array does not contain an item matching the schema",PROPERTY_NAMES:"Property name {0} does not match the propertyNames schema",COLLECT_EVALUATED_DEPTH_EXCEEDED:"Schema nesting depth exceeded maximum ({0}) during unevaluated items/properties collection",MAX_RECURSION_DEPTH_EXCEEDED:"Maximum recursion depth ({0}) exceeded. If your schema or data is deeply nested and valid, increase the maxRecursionDepth option."};class u extends Error{name;details;constructor(e,t){super(e),this.name="z-schema validation error",this.details=t}}function p({message:e,details:t}){return new u(e||"",t)}function m(e,t,r,n){Object.hasOwn(e,r)&&Object.defineProperty(t,r,{value:n?n(e[r]):e[r],enumerable:!0,writable:!0,configurable:!0})}const h=e=>{if(null==e||"object"!=typeof e)return e;let t;if(Array.isArray(e)){t=[];for(let r=0;r<e.length;r++)t[r]=e[r]}else{t={};const r=Object.keys(e).sort();for(const n of r)m(e,t,n)}return t},y=(e,t=100)=>{let r=0;const n=new Map,i=[],o=(e,a)=>{if("object"!=typeof e||null===e)return e;if(a>=t)throw new Error(`Maximum recursion depth (${t}) exceeded in deepClone. If your schema or data is deeply nested and valid, increase the maxRecursionDepth option.`);let s;const c=n.get(e);if(void 0!==c)return i[c];if(n.set(e,r++),Array.isArray(e)){s=[],i.push(s);for(let t=0;t<e.length;t++)s[t]=o(e[t],a+1)}else{s={},i.push(s);const t=Object.keys(e).sort();for(const r of t)m(e,s,r,e=>o(e,a+1))}return s};return o(e,0)},v=(e,t,r,i=0)=>{const a=r?.caseInsensitiveComparison||!1,s=r?.maxDepth??n;if(e===t)return!0;if(!0===a&&"string"==typeof e&&"string"==typeof t&&e.toUpperCase()===t.toUpperCase())return!0;if(i>=s)throw new Error(`Maximum recursion depth (${s}) exceeded in areEqual. If your data is deeply nested and valid, increase the maxRecursionDepth option.`);let c,d;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(d=e.length,c=0;c<d;c++)if(!v(e[c],t[c],r,i+1))return!1;return!0}if(o(e)&&o(t)){const n=g(e),o=g(t);if(!v(n,o,r,i+1))return!1;for(d=n.length,c=0;c<d;c++)if(!v(e[n[c]],t[n[c]],r,i+1))return!1;return!0}return!1},E=e=>decodeURIComponent(e).replace(/~[0-1]/g,e=>"~1"===e?"/":"~"),g=e=>Object.keys(e).sort(),_=(e,t)=>("string"==typeof t&&(t=t.split(".")),t.reduce((e,t)=>e&&void 0!==e[t]?e[t]:void 0,e)),$=Symbol.for("z-schema/json"),O=Symbol.for("z-schema/schema");class b{asyncTasks=[];commonErrorMessage;__$recursiveAnchorStack=[];__$dynamicScopeStack=[];__validationResultCache=new Map;errors=[];json;path=[];schemaPath=[];rootSchema;parentReport;options;reportOptions;validateOptions={};constructor(e,t,r){this.parentReport=e instanceof b?e:void 0,this.options=e instanceof b?e.options:e||{},e instanceof b?(this.reportOptions=t||{},this.validateOptions=r||e.validateOptions,this.__$recursiveAnchorStack=[...e.__$recursiveAnchorStack],this.__$dynamicScopeStack=[...e.__$dynamicScopeStack],this.__validationResultCache=e.__validationResultCache):(this.reportOptions={},this.validateOptions=t||{},this.__$recursiveAnchorStack=[],this.__$dynamicScopeStack=[],this.__validationResultCache=new Map)}isValid(){if(this.asyncTasks.length>0)throw new Error("Async tasks pending, can't answer isValid");return 0===this.errors.length}addAsyncTask(e,t,r){this.asyncTasks.push([e,t,r])}addAsyncTaskWithPath(e,t,r){const n=h(this.path);this.asyncTasks.push([e,t,e=>{const t=this.path;this.path=n,r(e),this.path=t}])}getAncestor(e){if(this.parentReport)return this.parentReport.getSchemaId()===e?this.parentReport:this.parentReport.getAncestor(e)}processAsyncTasks(e,t){const r=Math.min(Math.max(e||2e3,0),6e4),n=Date.now()+r;let i=this.asyncTasks.length,o=!1;const a=()=>{setTimeout(()=>{const e=0===this.errors.length,r=e?void 0:p({details:this.errors});t(r,e)},0)},s=e=>t=>{o||(e(t),0===--i&&a())};if(0===i||this.errors.length>0&&this.options.breakOnFirstError)return void a();for(let e=0;e<this.asyncTasks.length;e++){const[t,r,n]=this.asyncTasks[e];t(...r,s(n))}const c=()=>{if(!(o||i<=0))return Date.now()>=n?(o=!0,this.addError("ASYNC_TIMEOUT",[i,r]),void t(p({details:this.errors}),!1)):void setTimeout(c,10)};setTimeout(c,10)}getPath(e){let t=[];return this.parentReport&&(t=t.concat(this.parentReport.path)),t=t.concat(this.path),!0!==e?"#/"+t.map(function(e){return e=e.toString(),r(e)?"uri("+e+")":e.replace(/~/g,"~0").replace(/\//g,"~1")}).join("/"):t}getSchemaPath(){let e=[];return this.parentReport&&(e=e.concat(this.parentReport.schemaPath)),e=e.concat(this.schemaPath),e}getSchemaId(){if(!this.rootSchema)return;let e=[];for(this.parentReport&&(e=e.concat(this.parentReport.path)),e=e.concat(this.path);e.length>0;){const t=_(this.rootSchema,e);if(t&&t.id)return t.id;e.pop()}return this.rootSchema.id}hasError(e,t){for(let r=0;r<this.errors.length;r++)if(this.errors[r].code===e){let e=!0;for(let n=0;n<this.errors[r].params.length;n++)this.errors[r].params[n]!==t[n]&&(e=!1);if(e)return e}return!1}addError(e,t,r,n,i){if(!e)throw new Error("No errorCode passed into addError()");this.addCustomError(e,l[e],t,r,n,i)}getJson(){return this.json?this.json:this.parentReport?this.parentReport.getJson():void 0}addCustomError(e,t,r,n,i,a){if("number"==typeof this.reportOptions.maxErrors&&this.errors.length>=this.reportOptions.maxErrors)return;if(!t)throw new Error("No errorMessage known for code "+e);r=r||[];for(let e=0;e<r.length;e++){const n=null===r[e]||o(r[e])?JSON.stringify(r[e]):r[e];t=t.replace("{"+e+"}",n.toString())}const s={code:e,params:r,message:t,path:this.getPath(this.options.reportPathAsArray),schemaPath:this.getSchemaPath(),schemaId:this.getSchemaId(),keyword:a};if(s[O]=i,s[$]=this.getJson(),i&&"string"==typeof i?s.description=i:i&&"object"==typeof i&&(i.title&&(s.title=i.title),i.description&&(s.description=i.description)),null!=n){Array.isArray(n)||(n=[n]),s.inner=[];for(const e of n)for(const t of e.errors)s.inner.push(t);0===s.inner.length&&(s.inner=void 0)}Array.isArray(this.validateOptions.excludeErrors)&&this.validateOptions.excludeErrors.includes(e)||this.errors.push(s)}}const A={"draft-04":"http://json-schema.org/draft-04/schema#","draft-06":"http://json-schema.org/draft-06/schema#","draft-07":"http://json-schema.org/draft-07/schema#","draft2019-09":"https://json-schema.org/draft/2019-09/schema","draft2020-12":"https://json-schema.org/draft/2020-12/schema"},R={version:"draft2020-12",asyncTimeout:2e3,forceAdditional:!1,assumeAdditional:!1,enumCaseInsensitiveComparison:!1,forceItems:!1,forceMinItems:!1,forceMaxItems:!1,forceMinLength:!1,forceMaxLength:!1,forceProperties:!1,ignoreUnresolvableReferences:!1,noExtraKeywords:!1,noTypeless:!1,noEmptyStrings:!1,noEmptyArrays:!1,strictUris:!1,strictMode:!1,reportPathAsArray:!1,breakOnFirstError:!1,pedanticCheck:!1,ignoreUnknownFormats:!1,formatAssertions:null,customValidator:null,maxRecursionDepth:n},x=e=>{let t;if("object"==typeof e){let r=Object.keys(e);for(const e of r)if(void 0===R[e])throw new Error("Unexpected option passed to constructor: "+e);r=Object.keys(R);for(const t of r)void 0===e[t]&&(e[t]=h(R[t]));t=e}else t=h(R);return null!=t.asyncTimeout&&(t.asyncTimeout=Math.min(Math.max(t.asyncTimeout,0),6e4)),!0===t.strictMode&&(t.forceAdditional=!0,t.forceItems=!0,t.forceMaxLength=!0,t.forceProperties=!0,t.noExtraKeywords=!0,t.noTypeless=!0,t.noEmptyStrings=!0,t.noEmptyArrays=!0),t};function I(e){const r=t(e);if(r&&"__proto__"!==r&&"constructor"!==r&&"prototype"!==r)return r}const S=e=>{let t=d(e);return t&&r(t)||"string"!=typeof e.id||!r(e.id)||(t=e.id),t};function T(e,t,r,n){let i;return i="string"==typeof e?JSON.parse(e):y(e,n),i.id||(i.id=t),r&&(i.__$validationOptions=x(r)),i}class P{validator;static global_cache=Object.create(null);cache=Object.create(null);constructor(e){this.validator=e}static cacheSchemaByUri(e,t){const r=I(e);r&&(this.global_cache[r]=t)}cacheSchemaByUri(e,t){const r=I(e);r&&(this.cache[r]=t)}removeFromCacheByUri(e){const t=I(e);t&&delete this.cache[t]}checkCacheForUri(e){const t=I(e);return!!t&&null!=this.cache[t]}getSchema(e,t){return Array.isArray(t)?t.map(t=>this.getSchema(e,t)):"string"==typeof t?this.getSchemaByUri(e,t):y(t,this.validator.options.maxRecursionDepth)}fromCache(e){if("__proto__"===e||"constructor"===e||"prototype"===e)return;let t=this.cache[e];if(t)return t;if(t=P.global_cache[e],t){const n=y(t,this.validator.options.maxRecursionDepth);return(!n.id||!r(n.id)&&r(e))&&(n.id=e),this.cache[e]=n,n}}getSchemaByUri(e,n,i){if(i&&!r(n)){const e=S(i);if(e&&r(e)){const t=e.indexOf("#"),r=-1===t?e:e.slice(0,t);try{n=new URL(n,r).toString()}catch{}}}const o=I(n),a=(e=>{const t=e.indexOf("#");return-1===t?void 0:e.slice(t+1)})(n);let s,c=!1;if(o){const t=e.getAncestor(o);t?.rootSchema&&(s=t.rootSchema,c=!0)}if(!s&&i&&o){const e=S(i),r=e?t(e):void 0;r&&r===o&&(s=i)}if(s||(s=o?this.fromCache(o):i),!(s&&o&&r(o))||s.id&&r(s.id)||(s.id=o),s&&o){if(s!==i&&!c){let i;e.path.push(o);let a=!1;const c=s.id?e.getAncestor(s.id):void 0;if(c)i=c,a=!0;else{i=new b(e);const n=!s.id||!r(s.id);if(this.validator.sc.compileSchema(i,s,{noCache:n})){const r=this.validator.options;try{this.validator.options=s.__$validationOptions||this.validator.options;const r="string"==typeof s.$schema?t(s.$schema):void 0,n=e.getSchemaId();!!r&&r.length>0&&(n===r||!!e.getAncestor(r))||this.validator.sv.validateSchema(i,s)}finally{this.validator.options=r}}}const d=!!a||i.isValid();if(d||e.addError("REMOTE_NOT_VALID",[n],i),e.path.pop(),!d)return}}const d=s;if(s&&a){const e=a.split("/");for(let t=0,r=e.length;s&&t<r;t++){const r=E(e[t]);s=0===t?f(s,r,o,o,this.validator.options.maxRecursionDepth):s[r]}}return s&&"object"==typeof s&&d&&"object"==typeof d&&(s.__$resourceRoot=d),s}}const D={$schema:"http://json-schema.org/draft-06/schema#",$id:"http://json-schema.org/draft-06/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},title:{type:"string"},description:{type:"string"},default:{},examples:{type:"array",items:{}},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:{},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:{}},j={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0},M={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}},N={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}},C={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}},w={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}},Y={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}},U={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{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}}},L={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{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"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{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:[]}}},F={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"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},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{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}}},k={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{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"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}},W={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}},K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$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"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}},q={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}},V={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-assertion",$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for assertion results",type:["object","boolean"],properties:{format:{type:"string"}}},X={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{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}}},B={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}},H={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{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"}}},$defs:{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:[]}}},z=(e,t,r)=>{const n=t;n.id||(n.id=e),r&&(n.__$validationOptions=x(r)),P.cacheSchemaByUri(e,n)};function J(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}z("http://json-schema.org/draft-04/schema",{id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string"},$schema:{type:"string"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}},{version:"none"}),z("http://json-schema.org/draft-06/schema",D,{version:"none"}),z("http://json-schema.org/draft-07/schema",j,{version:"none"}),z("https://json-schema.org/draft/2019-09/schema",M,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/applicator",N,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/content",C,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/core",w,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/format",Y,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/meta-data",U,{version:"none"}),z("https://json-schema.org/draft/2019-09/meta/validation",L,{version:"none"}),z("https://json-schema.org/draft/2020-12/schema",F,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/applicator",k,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/content",W,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/core",K,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/format-annotation",q,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/format-assertion",V,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/meta-data",X,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/unevaluated",B,{version:"none"}),z("https://json-schema.org/draft/2020-12/meta/validation",H,{version:"none"});var Z,G={exports:{}},Q={exports:{}};function ee(){return Z||(Z=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(null==e)throw new TypeError("Expected a string but received a ".concat(e));if("String"!==e.constructor.name)throw new TypeError("Expected a string but received a ".concat(e.constructor.name))},e.exports=t.default,e.exports.default=t.default}(Q,Q.exports)),Q.exports}var te,re={exports:{}};function ne(){return te||(te=1,function(e,t){function r(e){return"[object RegExp]"===Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var n=0;n<t.length;n++){var i=t[n];if(e===i||r(i)&&i.test(e))return!0}return!1},e.exports=t.default,e.exports.default=t.default}(re,re.exports)),re.exports}var ie,oe={exports:{}};function ae(){return ie||(ie=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,o;(0,n.default)(e),"object"===i(t)?(r=t.min||0,o=t.max):(r=arguments[1],o=arguments[2]);var a=encodeURI(e).split(/%..|./).length-1;return a>=r&&(void 0===o||a<=o)};var r,n=(r=ee())&&r.__esModule?r:{default:r};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}e.exports=t.default,e.exports.default=t.default}(oe,oe.exports)),oe.exports}var se,ce,de={exports:{}},fe={exports:{}};function le(){return se||(se=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default,e.exports.default=t.default}(fe,fe.exports)),fe.exports}function ue(){return ce||(ce=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)(e),(t=(0,n.default)(t,o)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var i=e.split("."),a=i[i.length-1];if(t.require_tld){if(i.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(a))return!1;if(/\s/.test(a))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(a))return!1;return i.every(function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))})};var r=i(ee()),n=i(le());function i(e){return e&&e.__esModule?e:{default:e}}var o={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(de,de.exports)),de.exports}var pe,me,he={exports:{}};function ye(){return pe||(pe=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.default)(t);var o=("object"===i(r)?r.version:arguments[1])||"";if(!o)return e(t,{version:4})||e(t,{version:6});if("4"===o.toString())return s.test(t);if("6"===o.toString())return d.test(t);return!1};var r,n=(r=ee())&&r.__esModule?r:{default:r};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",a="(".concat(o,"[.]){3}").concat(o),s=new RegExp("^".concat(a,"$")),c="(?:[0-9a-fA-F]{1,4})",d=new RegExp("^("+"(?:".concat(c,":){7}(?:").concat(c,"|:)|")+"(?:".concat(c,":){6}(?:").concat(a,"|:").concat(c,"|:)|")+"(?:".concat(c,":){5}(?::").concat(a,"|(:").concat(c,"){1,2}|:)|")+"(?:".concat(c,":){4}(?:(:").concat(c,"){0,1}:").concat(a,"|(:").concat(c,"){1,3}|:)|")+"(?:".concat(c,":){3}(?:(:").concat(c,"){0,2}:").concat(a,"|(:").concat(c,"){1,4}|:)|")+"(?:".concat(c,":){2}(?:(:").concat(c,"){0,3}:").concat(a,"|(:").concat(c,"){1,5}|:)|")+"(?:".concat(c,":){1}(?:(:").concat(c,"){0,4}:").concat(a,"|(:").concat(c,"){1,6}|:)|")+"(?::((?::".concat(c,"){0,5}:").concat(a,"|(?::").concat(c,"){1,7}|:))")+")(%[0-9a-zA-Z.]{1,})?$");e.exports=t.default,e.exports.default=t.default}(he,he.exports)),he.exports}function ve(){return me||(me=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.default)(e),(t=(0,s.default)(t,d)).require_display_name||t.allow_display_name){var c=e.match(f);if(c){var v=c[1];if(e=e.replace(v,"").replace(/(^<|>$)/g,""),v.endsWith(" ")&&(v=v.slice(0,-1)),!function(e){var t=e.replace(/^"(.+)"$/,"$1");if(!t.trim())return!1;if(/[\.";<>]/.test(t)){if(t===e)return!1;if(!(t.split('"').length===t.split('\\"').length))return!1}return!0}(v))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>y)return!1;var E=e.split("@"),g=E.pop(),_=g.toLowerCase();if(t.host_blacklist.length>0&&(0,n.default)(_,t.host_blacklist))return!1;if(t.host_whitelist.length>0&&!(0,n.default)(_,t.host_whitelist))return!1;var $=E.join("@");if(t.domain_specific_validation&&("gmail.com"===_||"googlemail.com"===_)){var O=($=$.toLowerCase()).split("+")[0];if(!(0,i.default)(O.replace(/\./g,""),{min:6,max:30}))return!1;for(var b=O.split("."),A=0;A<b.length;A++)if(!u.test(b[A]))return!1}if(!(!1!==t.ignore_max_length||(0,i.default)($,{max:64})&&(0,i.default)(g,{max:254})))return!1;if(!(0,o.default)(g,{require_tld:t.require_tld,ignore_max_length:t.ignore_max_length,allow_underscores:t.allow_underscores})){if(!t.allow_ip_domain)return!1;if(!(0,a.default)(g)){if(!g.startsWith("[")||!g.endsWith("]"))return!1;var R=g.slice(1,-1);if(0===R.length||!(0,a.default)(R))return!1}}if(t.blacklisted_chars&&-1!==$.search(new RegExp("[".concat(t.blacklisted_chars,"]+"),"g")))return!1;if('"'===$[0]&&'"'===$[$.length-1])return $=$.slice(1,$.length-1),t.allow_utf8_local_part?h.test($):p.test($);for(var x=t.allow_utf8_local_part?m:l,I=$.split("."),S=0;S<I.length;S++)if(!x.test(I[S]))return!1;return!0};var r=c(ee()),n=c(ne()),i=c(ae()),o=c(ue()),a=c(ye()),s=c(le());function c(e){return e&&e.__esModule?e:{default:e}}var d={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},f=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,l=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,u=/^[a-z\d]+$/,p=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,m=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,h=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,y=254;e.exports=t.default,e.exports.default=t.default}(G,G.exports)),G.exports}var Ee,ge,_e=J(ve()),$e=J(ye()),Oe={exports:{}},be={exports:{}};function Ae(){return Ee||(Ee=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e,t){return-1!==e.indexOf(t)},e.exports=t.default,e.exports.default=t.default}(be,be.exports)),be.exports}function Re(){return ge||(ge=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,s.default)(t,f)).validate_length&&e.length>t.max_allowed_length)return!1;if(!t.allow_fragments&&(0,i.default)(e,"#"))return!1;if(!t.allow_query_components&&((0,i.default)(e,"?")||(0,i.default)(e,"&")))return!1;var c,u,p,m,h,y,v,E;v=e.split("#"),e=v.shift(),v=e.split("?");var g=(e=v.shift()).match(/^([a-z][a-z0-9+\-.]*):/i),_=!1,$=function(r){return _=!0,c=r.toLowerCase(),(!t.require_valid_protocol||-1!==t.protocols.indexOf(c))&&e.substring(g[0].length)};if(g){var O=g[1],b=e.substring(g[0].length);if("//"===b.slice(0,2)){if(!1===(e=$(O)))return!1}else{var A=b.indexOf("/"),R=-1===A?b:b.substring(0,A),x=R.indexOf("@");if(-1!==x){var I=R.substring(0,x),S=/^[a-zA-Z0-9\-_.%:]*$/.test(I),T=/%[0-9a-fA-F]{2}/.test(I);if(S&&!T){if(t.require_protocol)return!1}else if(!1===(e=$(O)))return!1}else{if(/^[0-9]/.test(b)){if(t.require_protocol)return!1}else if(!1===(e=$(O)))return!1}}}else if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!_&&!t.allow_protocol_relative_urls)return!1;e=e.slice(2)}if(""===e)return!1;if(v=e.split("/"),""===(e=v.shift())&&!t.require_host)return!0;if((v=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===v[0])return!1;if((u=v.shift()).indexOf(":")>=0&&u.split(":").length>2)return!1;var P=u.split(":"),D=(C=2,function(e){if(Array.isArray(e))return e}(N=P)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,d=!1;try{if(o=(r=r.call(e)).next,0===t);else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){d=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw i}}return s}}(N,C)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}(N,C)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),j=D[0],M=D[1];if(""===j&&""===M)return!1}var N,C;m=v.join("@"),y=null,E=null;var w=m.match(l);w?(p="",E=w[1],y=w[2]||null):(p=(v=m.split(":")).shift(),v.length&&(y=v.join(":")));if(null!==y&&y.length>0){if(h=parseInt(y,10),!/^[0-9]+$/.test(y)||h<=0||h>65535)return!1}else if(t.require_port)return!1;if(t.host_whitelist)return(0,n.default)(p,t.host_whitelist);if(""===p&&!t.require_host)return!0;if(!((0,a.default)(p)||(0,o.default)(p,t)||E&&(0,a.default)(E,6)))return!1;if(p=p||E,t.host_blacklist&&(0,n.default)(p,t.host_blacklist))return!1;return!0};var r=c(ee()),n=c(ne()),i=c(Ae()),o=c(ue()),a=c(ye()),s=c(le());function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var f={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},l=/^\[([^\]]+)\](?::([0-9]+))?$/;e.exports=t.default,e.exports.default=t.default}(Oe,Oe.exports)),Oe.exports}var xe=J(Re());const Ie=(e,t,r)=>{if(t<1||t>12)return!1;const n=((e,t)=>{switch(t){case 2:return(e=>e%4==0&&(e%100!=0||e%400==0))(e)?29:28;case 4:case 6:case 9:case 11:return 30;default:return 31}})(e,t);return r>=1&&r<=n};var Se,Te;var Pe=function(){if(Te)return Se;Te=1;const e=2147483647,t=36,r=/^xn--/,n=/[^\0-\x7F]/,i=/[\x2E\u3002\uFF0E\uFF61]/g,o={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},a=Math.floor,s=String.fromCharCode;function c(e){throw new RangeError(o[e])}function d(e,t){const r=e.split("@");let n="";r.length>1&&(n=r[0]+"@",e=r[1]);const o=function(e,t){const r=[];let n=e.length;for(;n--;)r[n]=t(e[n]);return r}((e=e.replace(i,".")).split("."),t).join(".");return n+o}function f(e){const t=[];let r=0;const n=e.length;for(;r<n;){const i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){const n=e.charCodeAt(r++);56320==(64512&n)?t.push(((1023&i)<<10)+(1023&n)+65536):(t.push(i),r--)}else t.push(i)}return t}const l=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:t},u=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},p=function(e,r,n){let i=0;for(e=n?a(e/700):e>>1,e+=a(e/r);e>455;i+=t)e=a(e/35);return a(i+36*e/(e+38))},m=function(r){const n=[],i=r.length;let o=0,s=128,d=72,f=r.lastIndexOf("-");f<0&&(f=0);for(let e=0;e<f;++e)r.charCodeAt(e)>=128&&c("not-basic"),n.push(r.charCodeAt(e));for(let u=f>0?f+1:0;u<i;){const f=o;for(let n=1,s=t;;s+=t){u>=i&&c("invalid-input");const f=l(r.charCodeAt(u++));f>=t&&c("invalid-input"),f>a((e-o)/n)&&c("overflow"),o+=f*n;const p=s<=d?1:s>=d+26?26:s-d;if(f<p)break;const m=t-p;n>a(e/m)&&c("overflow"),n*=m}const m=n.length+1;d=p(o-f,m,0==f),a(o/m)>e-s&&c("overflow"),s+=a(o/m),o%=m,n.splice(o++,0,s)}return String.fromCodePoint(...n)},h=function(r){const n=[],i=(r=f(r)).length;let o=128,d=0,l=72;for(const e of r)e<128&&n.push(s(e));const m=n.length;let h=m;for(m&&n.push("-");h<i;){let i=e;for(const e of r)e>=o&&e<i&&(i=e);const f=h+1;i-o>a((e-d)/f)&&c("overflow"),d+=(i-o)*f,o=i;for(const i of r)if(i<o&&++d>e&&c("overflow"),i===o){let e=d;for(let r=t;;r+=t){const i=r<=l?1:r>=l+26?26:r-l;if(e<i)break;const o=e-i,c=t-i;n.push(s(u(i+o%c,0))),e=a(o/c)}n.push(s(u(e,0))),l=p(d,f,h===m),d=0,++h}++d,++o}return n.join("")};return Se={version:"2.3.1",ucs2:{decode:f,encode:e=>String.fromCodePoint(...e)},decode:m,encode:h,toASCII:function(e){return d(e,function(e){return n.test(e)?"xn--"+h(e):e})},toUnicode:function(e){return d(e,function(e){return r.test(e)?m(e.slice(4).toLowerCase()):e})}}}(),De=J(Pe);const je=/[\u3002\uff0e\uff61]/g,Me=/[\u3002\uff0e\uff61]/,Ne=e=>{if(0===e.length||e.length>255)return null;if(e.startsWith(".")||e.endsWith("."))return null;const t=e.split(".");return t.some(e=>0===e.length||e.length>63)?null:t},Ce=e=>/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(e),we=e=>/\p{Script=Greek}/u.test(e),Ye=e=>/\p{Script=Hebrew}/u.test(e),Ue=e=>{if(!/^xn--/i.test(e))return e;try{return De.toUnicode(e.toLowerCase())}catch(e){return null}},Le=e=>{if(e.startsWith("-")||e.endsWith("-"))return!1;if(e.length>=4&&"-"===e[2]&&"-"===e[3]&&!/^xn--/i.test(e))return!1;if(/^\p{M}/u.test(e))return!1;if(/[\u302e\u302f\u0640\u07fa]/u.test(e))return!1;for(let t=0;t<e.length;t++){const r=e[t];if("·"===r&&(0===t||t===e.length-1||"l"!==e[t-1]||"l"!==e[t+1]))return!1;if("͵"===r&&(t===e.length-1||!we(e[t+1])))return!1;if(!("׳"!==r&&"״"!==r||0!==t&&Ye(e[t-1])))return!1;if(""===r&&(0===t||"्"!==e[t-1]))return!1}if(e.includes("・")&&(t=e.replace(/\u30fb/g,""),!/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u.test(t)))return!1;var t;const r=/[\u0660-\u0669]/.test(e),n=/[\u06f0-\u06f9]/.test(e);return!r||!n},Fe=/^([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$/i,ke=e=>{const t=Fe.exec(e);if(null===t)return null;const r=parseInt(t[1],10),n=parseInt(t[2],10),i=parseInt(t[3],10);if(r>23||n>59||i>60)return null;let o=r,a=n;if("z"!==t[5].toLowerCase()){const e=/^([+-])([0-9]{2}):([0-9]{2})$/.exec(t[5]);if(null===e)return null;const i=e[1],s=parseInt(e[2],10),c=parseInt(e[3],10);if(s>23||c>59)return null;const d=((e,t,r,n,i)=>{const o=60*e+t,a=60*n+i,s=(("+"===r?o-a:o+a)%1440+1440)%1440;return{hour:Math.floor(s/60),minute:s%60}})(r,n,i,s,c);o=d.hour,a=d.minute}return 60!==i||23===o&&59===a?{hour:r,minute:n,second:i,utcHour:o,utcMinute:a}:null},We=e=>"string"!=typeof e||(e=>{if(Me.test(e)||/[^\x00-\x7F]/.test(e))return!1;if($e.default(e,4))return!1;const t=Ne(e);if(null===t)return!1;for(const e of t){if(!Ce(e))return!1;const t=Ue(e);if(null===t||!Le(t))return!1}return!0})(e),Ke=e=>"string"!=typeof e||xe.default(e),qe=e=>{for(let t=0;t<e.length;t++)if("~"===e[t]){const r=e[t+1];if("0"!==r&&"1"!==r)return!1;t++}return!0},Ve={date:e=>{if("string"!=typeof e)return!0;const t=/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.exec(e);if(null===t)return!1;const r=parseInt(t[1],10),n=parseInt(t[2],10),i=parseInt(t[3],10);return Ie(r,n,i)},"date-time":e=>{if("string"!=typeof e)return!0;const t=e.toLowerCase().split("t");if(2!==t.length)return!1;const r=t[0],n=t[1],i=/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.exec(r);if(null===i)return!1;const o=parseInt(i[1],10),a=parseInt(i[2],10),s=parseInt(i[3],10);return!!Ie(o,a,s)&&null!==ke(n)},email:e=>{if("string"!=typeof e)return!0;if(_e.default(e,{require_tld:!0,allow_ip_domain:!0}))return!0;const t=/^(.+)@\[IPv6:([^\]]+)\]$/i.exec(e);if(!t)return!1;const r=t[1],n=t[2];return!!$e.default(n,6)&&_e.default(`${r}@example.com`,{require_tld:!0})},hostname:We,"host-name":We,ipv4:e=>"string"!=typeof e||$e.default(e,4),ipv6:e=>"string"!=typeof e||!e.includes("%")&&$e.default(e,6),regex:e=>{if("string"!=typeof e)return!0;const t=new Set(["a"]);for(let r=0;r<e.length;r++){if("\\"!==e[r])continue;if(r++,r>=e.length)return!1;const n=e[r];if(t.has(n))return!1}try{return RegExp(e),!0}catch(e){return!1}},uri:function(e){if("string"!=typeof e)return!0;if(/[^\x00-\x7F]/.test(e))return!1;if(!(e=>{for(let t=0;t<e.length;t++)if("%"===e[t]&&(t+2>=e.length||!/[0-9a-fA-F]/.test(e[t+1])||!/[0-9a-fA-F]/.test(e[t+2])))return!1;return!0})(e))return!1;const t=e.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\/([^/?#]*)/);if(t){const e=t[2],r=e.indexOf("@");if(r>0){const t=e.substring(0,r);if(t.includes("[")||t.includes("]"))return!1}let n=r>=0?e.substring(r+1):e;if(n.startsWith("[")){const e=n.indexOf("]");e>=0&&(n=n.substring(e+1))}const i=n.lastIndexOf(":");if(i>=0){const e=n.substring(i+1);if(e.length>0&&!/^\d+$/.test(e))return!1}}return/^[a-zA-Z][a-zA-Z0-9+.-]*:[^"\\<>^{}^`| ]*$/.test(e)},"strict-uri":Ke,"uri-reference":e=>"string"!=typeof e||!/[^\x00-\x7F]/.test(e)&&/^([a-zA-Z][a-zA-Z0-9+.-]*:)?[^"\\<>^{}^`| ]*$/.test(e),"uri-template":e=>{if("string"!=typeof e)return!0;if(!/^([a-zA-Z][a-zA-Z0-9+.-]*:)?[^"\\<>^`| ]*$/.test(e))return!1;let t=!1;for(let r=0;r<e.length;r++){const n=e[r];if("{"===n){if(t)return!1;t=!0}else if("}"===n){if(!t)return!1;t=!1}}return!t},"json-pointer":e=>{if("string"!=typeof e)return!0;if(""===e)return!0;if(!/^(?:\/[^/]*)+$/.test(e))return!1;const t=e.split("/").slice(1);for(const e of t)if(!qe(e))return!1;return!0},"relative-json-pointer":e=>{if("string"!=typeof e)return!0;const t=e.match(/^(0|[1-9]\d*)(.*)$/);if(!t)return!1;const r=t[2];if(""===r||"#"===r)return!0;if(!r.startsWith("/"))return!1;if(!/^(?:\/[^/]*)+$/.test(r))return!1;const n=r.split("/").slice(1);for(const e of n)if(!qe(e))return!1;return!0},time:e=>"string"!=typeof e||null!==ke(e),"idn-email":e=>"string"!=typeof e||/^[^\s@]+@[^\s@]+$/.test(e),"idn-hostname":e=>"string"!=typeof e||(e=>{const t=e.replace(je,"."),r=Ne(t);if(null===r)return!1;for(const e of r){const t=Ue(e);if(null===t||!Le(t))return!1}return!0})(e),iri:e=>{if("string"!=typeof e)return!0;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:[^"\\<>^{}^`| ]*$/u.test(e))return!1;try{return new URL(e),!0}catch(e){return!1}},"iri-reference":e=>"string"!=typeof e||/^([a-zA-Z][a-zA-Z0-9+.-]*:)?[^"\\<>^{}^`| ]*$/u.test(e),duration:e=>{if("string"!=typeof e)return!0;if(!/^P[\x00-\x7F]*$/.test(e))return!1;if(!e.startsWith("P"))return!1;const t=e.slice(1);if(0===t.length)return!1;if(t.includes("W"))return/^\d+W$/.test(t);const r=t.split("T");if(r.length>2)return!1;const n=r[0],i=2===r.length?r[1]:void 0;if(n.length>0&&!/^(?:\d+Y(?:\d+M(?:\d+D)?)?|\d+M(?:\d+D)?|\d+D)$/.test(n))return!1;const o=/\d+[YMD]/.test(n);let a=!1;if(void 0!==i){if(0===i.length)return!1;if(!/^(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S)$/.test(i))return!1;if(a=/\d+[HMS]/.test(i),!a)return!1}return o||a},uuid:e=>"string"!=typeof e||/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)},Xe={};function Be(e){if(e.length>1e4)return{ok:!1,error:{pattern:e,message:`Pattern length ${e.length} exceeds maximum allowed length of 10000`}};if(/\\[pP]{/.test(e)||/[\u{10000}-\u{10FFFF}]/u.test(e)||/\\uD[89AB][0-9A-Fa-f]{2}\\uD[CDEF][0-9A-Fa-f]{2}/.test(e))try{return{ok:!0,value:new RegExp(e,"u")}}catch(t){return{ok:!1,error:{pattern:e,message:t&&t.message?t.message:"Invalid regular expression"}}}else try{return{ok:!0,value:new RegExp(e)}}catch(t){return{ok:!1,error:{pattern:e,message:t&&t.message?t.message:"Invalid regular expression"}}}}const He=(e,t,r)=>{const n=e.length;if(n<=1)return!0;let i=!0;for(let t=0;t<n;t++){const r=e[t];if(null!==r&&"object"==typeof r){i=!1;break}}if(i){const r=new Set;for(let i=0;i<n;i++){const n=e[i],o=typeof n+":"+String(n);if(r.has(o)){if(t)for(let r=0;r<i;r++){const o=e[r];if(typeof o==typeof n&&o===n){t.push(r,i);break}}return!1}r.add(o)}return!0}for(let i=0;i<n;i++)for(let o=i+1;o<n;o++)if(v(e[i],e[o],{maxDepth:r}))return t&&t.push(i,o),!1;return!0},ze=function(e,t){return e&&Array.isArray(e.includeErrors)&&e.includeErrors.length>0&&!t.some(function(t){return e.includeErrors.includes(t)})},Je=(e,t)=>"string"==typeof e.$schema?!/draft-04|draft-06|draft-07/.test(e.$schema):!("draft-04"===t||"draft-06"===t||"draft-07"===t),Ze="https://json-schema.org/draft/2019-09/vocab/validation",Ge="https://json-schema.org/draft/2020-12/vocab/validation",Qe="https://json-schema.org/draft/2019-09/vocab/format",et="https://json-schema.org/draft/2020-12/vocab/format-assertion",tt=new Set(["type","multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","maxContains","minContains","maxProperties","minProperties","required","dependentRequired","enum","const","contentEncoding","contentMediaType"]);function rt(e,t,r,n){let i=e.__validationResultCache.get(t);i||(i=new Map,e.__validationResultCache.set(t,i)),i.set(r,n)}function nt(e,t,r){return e.__validationResultCache.get(t)?.get(r)}function it(e,t,r){const n=e.asyncTasks.length;for(const r of t)e.asyncTasks.push(...r.asyncTasks);e.asyncTasks.length>n?e.addAsyncTaskWithPath(e=>{setTimeout(()=>e(null),0)},[],()=>{r()}):r()}function ot(e,t,r){if(ze(this.validateOptions,["OBJECT_ADDITIONAL_PROPERTIES"]))return;if(!o(r))return;const n=void 0!==t.properties?t.properties:{},i=void 0!==t.patternProperties?t.patternProperties:{};if(!1===t.additionalProperties){let o=Object.keys(r);const a=Object.keys(n),s=Object.keys(i);o=((e,t)=>{const r=new Set(t),n=[];let i=e.length;for(;i--;)r.has(e[i])||n.push(e[i]);return n})(o,a);for(const e of s){const t=Be(e);if(!t.ok)continue;const r=t.value;for(let e=o.length-1;e>=0;e--)!0===r.test(o[e])&&o.splice(e,1)}if(o.length>0){if(Array.isArray(this.options.assumeAdditional))for(const e of this.options.assumeAdditional){const t=o.indexOf(e);-1!==t&&o.splice(t,1)}if(o.length>0)for(const r of o)e.addError("OBJECT_ADDITIONAL_PROPERTIES",[r],void 0,t,"properties")}}}const at=(e,r)=>{const n=d(e),i=n?t(n):void 0,o=f(e,r,i,i);if(o&&o.$dynamicAnchor===r)return o},st=(e,t)=>{const r=e.__$recursiveRefResolved;if(!r)return;let n=r;if("object"==typeof n&&!0===n.$recursiveAnchor){const e=t[0];e&&(n=e)}return n},ct=(e,t)=>{const r=e.__$dynamicRefResolved;if(void 0===r||!e.$dynamicRef)return r;let n=r;const i=(e=>{const t=e.indexOf("#");if(-1===t)return;const r=e.slice(t+1);return r&&"/"!==r[0]?r:void 0})(e.$dynamicRef);if(i&&"object"==typeof n&&n.$dynamicAnchor===i)for(let e=0;e<t.length;e++){const r=t[e],o=at(r,i);if(o){n=o;break}}return n},dt=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,ft=e=>e.length%4==0&&dt.test(e);function lt(e){let t=0;for(const r of e)t++;return t}function ut(e){const{report:t,currentSchema:r,json:n,mode:i,depth:a}=e;if(!r||"boolean"==typeof r)return new Set;if(a>(this.options.maxRecursionDepth??100))return t.addError("COLLECT_EVALUATED_DEPTH_EXCEEDED",[a]),new Set;const s=new Set,c=e=>{if("all"===e)return!0;for(const t of e)s.add(t);return!1},d=r=>"items"===i?ut.call(this,{report:t,currentSchema:r,json:n,mode:"items",jsonArr:e.jsonArr,depth:a+1}):ut.call(this,{report:t,currentSchema:r,json:n,mode:"properties",jsonData:e.jsonData,depth:a+1});if("items"===i){const n=e.jsonArr;if(Array.isArray(r.prefixItems)){const e=Math.min(r.prefixItems.length,n.length);for(let t=0;t<e;t++)s.add(t)}if(void 0!==r.items)if(Array.isArray(r.items)){const e=Math.min(r.items.length,n.length);for(let t=0;t<e;t++)s.add(t)}else if(!1!==r.items)return"all";if(void 0!==r.additionalItems&&!1!==r.additionalItems&&Array.isArray(r.items))return"all";if(void 0!==r.contains)for(let e=0;e<n.length;e++){let i=nt(t,r.contains,n[e]);if(void 0===i){const o=new b(t);yt.call(this,o,r.contains,n[e]),i=0===o.errors.length}i&&s.add(e)}if(!0===r.unevaluatedItems)return"all"}else{const t=e.jsonData;if(o(r.properties))for(const e of Object.keys(r.properties))Object.hasOwn(t,e)&&s.add(e);if(o(r.patternProperties))for(const e of Object.keys(r.patternProperties)){const r=Be(e);if(r.ok)for(const e of Object.keys(t))r.value.test(e)&&s.add(e)}if(void 0!==r.additionalProperties){const e=o(r.properties)?Object.keys(r.properties):[],n=[];if(o(r.patternProperties))for(const e of Object.keys(r.patternProperties)){const t=Be(e);t.ok&&n.push(t.value)}for(const r of Object.keys(t))e.includes(r)||n.some(e=>e.test(r))||s.add(r)}if(o(r.dependentSchemas))for(const[e,n]of Object.entries(r.dependentSchemas))if(Object.hasOwn(t,e)&&c(d(n)))return"all";if(!0===r.unevaluatedProperties)return"all"}if(Array.isArray(r.allOf))for(const e of r.allOf)if(c(d(e)))return"all";if(Array.isArray(r.anyOf))for(const e of r.anyOf){let r=nt(t,e,n);if(void 0===r){const i=new b(t);yt.call(this,i,e,n),r=0===i.errors.length}if(r&&c(d(e)))return"all"}if(Array.isArray(r.oneOf))for(const e of r.oneOf){let r=nt(t,e,n);if(void 0===r){const i=new b(t);yt.call(this,i,e,n),r=0===i.errors.length}if(r&&c(d(e)))return"all"}if(void 0!==r.if){let e=nt(t,r.if,n);if(void 0===e){const i=new b(t);yt.call(this,i,r.if,n),e=0===i.errors.length}if(e){if(c(d(r.if)))return"all";if(void 0!==r.then&&c(d(r.then)))return"all"}else if(void 0!==r.else&&c(d(r.else)))return"all"}if(r.__$refResolved&&r.__$refResolved!==r&&c(d(r.__$refResolved)))return"all";const f=st(r,t.__$recursiveAnchorStack);if(f&&f!==r&&c(d(f)))return"all";const l=ct(r,t.__$dynamicScopeStack);return l&&l!==r&&c(d(l))?"all":s}const pt={id:()=>{},$id:()=>{},$ref:()=>{},$schema:()=>{},$dynamicAnchor:()=>{},$dynamicRef:()=>{},$anchor:()=>{},$defs:()=>{},$vocabulary:()=>{},$recursiveAnchor:()=>{},$recursiveRef:()=>{},examples:()=>{},title:()=>{},description:()=>{},default:()=>{},type:function(e,t,r){if(ze(this.validateOptions,["INVALID_TYPE"]))return;const n=i(r);"string"==typeof t.type?n===t.type||"integer"===n&&"number"===t.type||e.addError("INVALID_TYPE",[t.type,n],void 0,t,"type"):t.type.includes(n)||"integer"===n&&t.type.includes("number")||e.addError("INVALID_TYPE",[JSON.stringify(t.type),n],void 0,t,"type")},enum:function(e,t,r){if(ze(this.validateOptions,["ENUM_CASE_MISMATCH","ENUM_MISMATCH"]))return;let n=!1,i=!1;for(const e of t.enum){if(v(r,e,{maxDepth:this.options.maxRecursionDepth})){n=!0;break}v(r,e,{caseInsensitiveComparison:!0,maxDepth:this.options.maxRecursionDepth})&&(i=!0)}if(!1===n){const n=i&&this.options.enumCaseInsensitiveComparison?"ENUM_CASE_MISMATCH":"ENUM_MISMATCH";e.addError(n,[JSON.stringify(r)],void 0,t,"enum")}},const:function(e,t,r){const n=t.const;!1===v(r,n,{maxDepth:this.options.maxRecursionDepth})&&e.addError("CONST",[JSON.stringify(n)],void 0,t,void 0)},multipleOf:function(e,t,r){if(ze(this.validateOptions,["MULTIPLE_OF"]))return;if("number"!=typeof r)return;const n=r/t.multipleOf;(!Number.isFinite(n)||Math.abs(n-Math.round(n))>=1e-10)&&e.addError("MULTIPLE_OF",[r,t.multipleOf],void 0,t,"multipleOf")},maximum:function(e,t,r){ze(this.validateOptions,["MAXIMUM","MAXIMUM_EXCLUSIVE"])||"number"==typeof r&&(!0!==t.exclusiveMaximum?r>t.maximum&&e.addError("MAXIMUM",[r,t.maximum],void 0,t,"maximum"):r>=t.maximum&&e.addError("MAXIMUM_EXCLUSIVE",[r,t.maximum],void 0,t,"maximum"))},exclusiveMaximum:function(e,t,r){if("number"==typeof t.exclusiveMaximum){if(ze(this.validateOptions,["MAXIMUM_EXCLUSIVE"]))return;if("number"!=typeof r)return;r>=t.exclusiveMaximum&&e.addError("MAXIMUM_EXCLUSIVE",[r,t.exclusiveMaximum],void 0,t,"exclusiveMaximum")}},minimum:function(e,t,r){ze(this.validateOptions,["MINIMUM","MINIMUM_EXCLUSIVE"])||"number"==typeof r&&(!0!==t.exclusiveMinimum?r<t.minimum&&e.addError("MINIMUM",[r,t.minimum],void 0,t,"minimum"):r<=t.minimum&&e.addError("MINIMUM_EXCLUSIVE",[r,t.minimum],void 0,t,"minimum"))},exclusiveMinimum:function(e,t,r){if("number"==typeof t.exclusiveMinimum){if(ze(this.validateOptions,["MINIMUM_EXCLUSIVE"]))return;if("number"!=typeof r)return;r<=t.exclusiveMinimum&&e.addError("MINIMUM_EXCLUSIVE",[r,t.exclusiveMinimum],void 0,t,"exclusiveMinimum")}},maxLength:function(e,t,r){ze(this.validateOptions,["MAX_LENGTH"])||"string"==typeof r&<(r)>t.maxLength&&e.addError("MAX_LENGTH",[r.length,t.maxLength],void 0,t,"maxLength")},minLength:function(e,t,r){ze(this.validateOptions,["MIN_LENGTH"])||"string"==typeof r&<(r)<t.minLength&&e.addError("MIN_LENGTH",[r.length,t.minLength],void 0,t,"minLength")},pattern:function(e,t,r){if(ze(this.validateOptions,["PATTERN"]))return;if("string"!=typeof r)return;const n=Be(t.pattern);n.ok?n.value.test(r)||e.addError("PATTERN",[t.pattern,r],void 0,t,"pattern"):e.addError("PATTERN",[t.pattern,r,n.error.message],void 0,t,"pattern")},format:function(e,t,r){if(!1===this.options.formatAssertions)return;if(!0===this.options.formatAssertions&&!((e,t,r)=>{if("draft2019-09"!==r&&"draft2020-12"!==r)return!0;const n=e.__$schemaResolved,i=t.rootSchema&&"boolean"!=typeof t.rootSchema?t.rootSchema.__$schemaResolved:void 0,a=n||i;if(!a||"object"!=typeof a||!o(a.$vocabulary))return!1;const s=a.$vocabulary;return Object.hasOwn(s,et)?!0===s[et]:!!Object.hasOwn(s,Qe)&&!0===s[Qe]})(t,e,this.options.version))return;const n="draft2019-09"===this.options.version||"draft2020-12"===this.options.version;var a;const s=(a=this.options,{...Ve,...a?.strictUris?{uri:Ke}:{},...Xe,...a?.customFormats||{}})[t.format];if("function"==typeof s){if(ze(this.validateOptions,["INVALID_FORMAT"]))return;if(e.hasError("INVALID_TYPE",[t.type,i(r)]))return;if(2===s.length)e.addAsyncTaskWithPath(s,[r],function(n){!0!==n&&e.addError("INVALID_FORMAT",[t.format,JSON.stringify(r)],void 0,t,"format")});else{const n=s.call(this,r);if(n instanceof Promise){const i=n;e.addAsyncTaskWithPath(async e=>{try{e(await i)}catch(t){e(!1)}},[],function(n){!0!==n&&e.addError("INVALID_FORMAT",[t.format,JSON.stringify(r)],void 0,t,"format")})}else!0!==n&&e.addError("INVALID_FORMAT",[t.format,JSON.stringify(r)],void 0,t,"format")}}else!0===this.options.ignoreUnknownFormats||n||e.addError("UNKNOWN_FORMAT",[t.format],void 0,t,"format")},contentEncoding:function(e,t,r){if("draft-07"!==this.options.version)return;if("string"!=typeof r)return;"base64"===t.contentEncoding&&(ft(r)||e.addError("INVALID_FORMAT",["contentEncoding:base64",JSON.stringify(r)],void 0,t,"contentEncoding"))},contentMediaType:function(e,t,r){if("draft-07"!==this.options.version)return;if("string"!=typeof r)return;if("application/json"!==t.contentMediaType)return;let n=r;if("base64"===t.contentEncoding){const i=(e=>{if(ft(e)){if("function"==typeof atob)try{return atob(e)}catch{return}if("undefined"!=typeof Buffer)try{return Buffer.from(e,"base64").toString("utf8")}catch{return}}})(r);if(void 0===i)return void e.addError("INVALID_FORMAT",["contentEncoding:base64",JSON.stringify(r)],void 0,t,"contentEncoding");n=i}try{JSON.parse(n)}catch{e.addError("INVALID_FORMAT",["contentMediaType:application/json",JSON.stringify(r)],void 0,t,"contentMediaType")}},additionalItems:function(e,t,r){ze(this.validateOptions,["ARRAY_ADDITIONAL_ITEMS"])||Array.isArray(r)&&!1===t.additionalItems&&Array.isArray(t.items)&&r.length>t.items.length&&e.addError("ARRAY_ADDITIONAL_ITEMS",void 0,void 0,t,"additionalItems")},items:function(){},prefixItems:function(){},maxItems:function(e,t,r){ze(this.validateOptions,["ARRAY_LENGTH_LONG"])||Array.isArray(r)&&r.length>t.maxItems&&e.addError("ARRAY_LENGTH_LONG",[r.length,t.maxItems],void 0,t,"maxItems")},minItems:function(e,t,r){ze(this.validateOptions,["ARRAY_LENGTH_SHORT"])||Array.isArray(r)&&r.length<t.minItems&&e.addError("ARRAY_LENGTH_SHORT",[r.length,t.minItems],void 0,t,"minItems")},uniqueItems:function(e,t,r){if(!ze(this.validateOptions,["ARRAY_UNIQUE"])&&Array.isArray(r)&&!0===t.uniqueItems){const n=[];!1===He(r,n,this.options.maxRecursionDepth)&&e.addError("ARRAY_UNIQUE",n,void 0,t,"uniqueItems")}},contains:function(e,t,r){if(ze(this.validateOptions,["CONTAINS"]))return;if(!Array.isArray(r))return;const n=t.contains;if(void 0===n)return;const i=e.constructor,o=[];for(let t=0;t<r.length;t++){const a=new i(e);o.push(a),this._jsonValidate(a,n,r[t]),rt(e,n,r[t],0===a.errors.length)}it(e,o,()=>{let r=0;for(const e of o)0===e.errors.length&&(r+=1);const n="draft2019-09"===this.options.version||"draft2020-12"===this.options.version,i=n&&"number"==typeof t.minContains?t.minContains??1:1,a=n&&"number"==typeof t.maxContains?t.maxContains:void 0;r>=i&&(void 0===a||r<=a)||e.addError("CONTAINS",void 0,o,t,void 0)})},maxContains:function(){},minContains:function(){},unevaluatedItems:function(e,t,r){if(!Array.isArray(r))return;if(!0===t.unevaluatedItems)return;const n=t.unevaluatedItems;if(void 0===n)return;if(0===r.length)return;const i=ut.call(this,{report:e,currentSchema:t,json:r,mode:"items",jsonArr:r,depth:0});if("all"===i)return;const o=[];for(let e=0;e<r.length;e++)i.has(e)||o.push(e);if(0!==o.length)if(!1===n)e.addError("ARRAY_UNEVALUATED_ITEMS",void 0,void 0,t,"unevaluatedItems");else for(const i of o){const o=new b(e);if(yt.call(this,o,n,r[i]),o.errors.length>0){e.addError("ARRAY_UNEVALUATED_ITEMS",void 0,void 0,t,"unevaluatedItems");break}}},maxProperties:function(e,t,r){if(ze(this.validateOptions,["OBJECT_PROPERTIES_MAXIMUM"]))return;if(!o(r))return;const n=Object.keys(r).length;n>t.maxProperties&&e.addError("OBJECT_PROPERTIES_MAXIMUM",[n,t.maxProperties],void 0,t,"maxProperties")},minProperties:function(e,t,r){if(ze(this.validateOptions,["OBJECT_PROPERTIES_MINIMUM"]))return;if(!o(r))return;const n=Object.keys(r).length;n<t.minProperties&&e.addError("OBJECT_PROPERTIES_MINIMUM",[n,t.minProperties],void 0,t,"minProperties")},required:function(e,t,r){if(ze(this.validateOptions,["OBJECT_MISSING_REQUIRED_PROPERTY"]))return;if(!o(r))return;const n=t.required.length;for(let i=0;i<n;i++){const n=t.required[i];Object.hasOwn(r,n)||e.addError("OBJECT_MISSING_REQUIRED_PROPERTY",[n],void 0,t,"required")}},additionalProperties:function(e,t,r){if(void 0===t.properties&&void 0===t.patternProperties)return ot.call(this,e,t,r)},patternProperties:function(e,t,r){if(void 0===t.properties)return ot.call(this,e,t,r)},properties:ot,dependencies:function(e,t,r){if(ze(this.validateOptions,["OBJECT_DEPENDENCY_KEY"]))return;if(!o(r))return;const n=Object.keys(t.dependencies);for(const i of n)if(Object.hasOwn(r,i)){const n=t.dependencies[i];if(Array.isArray(n))for(const o of n)Object.hasOwn(r,o)||e.addError("OBJECT_DEPENDENCY_KEY",[o,i],void 0,t,"dependencies");else this._jsonValidate(e,n,r)}},dependentSchemas:function(e,t,r){if(!Je(t,this.options.version))return;if(!o(r)||!o(t.dependentSchemas))return;const n=Object.keys(t.dependentSchemas);for(const i of n)if(Object.hasOwn(r,i)){const n=t.dependentSchemas[i];this._jsonValidate(e,n,r)}},dependentRequired:function(e,t,r){if(!Je(t,this.options.version))return;if(ze(this.validateOptions,["OBJECT_DEPENDENCY_KEY"]))return;if(!o(r)||!o(t.dependentRequired))return;const n=Object.keys(t.dependentRequired);for(const i of n){if(!Object.hasOwn(r,i))continue;const n=t.dependentRequired[i];if(Array.isArray(n))for(const o of n)Object.hasOwn(r,o)||e.addError("OBJECT_DEPENDENCY_KEY",[o,i],void 0,t,"dependentRequired")}},propertyNames:function(e,t,r){if(ze(this.validateOptions,["PROPERTY_NAMES"]))return;if(!o(r))return;const n=t.propertyNames;if(void 0===n)return;const i=e.constructor,a=Object.keys(r),s=[];for(const t of a){const r=new i(e);s.push(r),this._jsonValidate(r,n,t)}it(e,s,()=>{for(let r=0;r<a.length;r++)s[r].errors.length>0&&e.addError("PROPERTY_NAMES",[a[r]],s[r],t,void 0)})},unevaluatedProperties:function(e,t,r){if(!o(r))return;if(!0===t.unevaluatedProperties)return;const n=t.unevaluatedProperties;if(void 0===n)return;const i=Object.keys(r);if(0===i.length)return;const a=ut.call(this,{report:e,currentSchema:t,json:r,mode:"properties",jsonData:r,depth:0});if("all"===a)return;const s=i.filter(e=>!a.has(e));if(0!==s.length)if(!1===n)e.addError("OBJECT_UNEVALUATED_PROPERTIES",[s.join(", ")],void 0,t,"unevaluatedProperties");else for(const i of s){const o=new b(e);yt.call(this,o,n,r[i]),o.errors.length>0&&e.addError("OBJECT_UNEVALUATED_PROPERTIES",[i],void 0,t,"unevaluatedProperties")}},allOf:function(e,t,r){for(let n=0;n<t.allOf.length;n++){const i=this._jsonValidate(e,t.allOf[n],r);if(this.options.breakOnFirstError&&!1===i)break}},anyOf:function(e,t,r){const n=[];for(let i=0;i<t.anyOf.length;i++){const o=new b(e);n.push(o),this._jsonValidate(o,t.anyOf[i],r),rt(e,t.anyOf[i],r,0===o.errors.length)}it(e,n,()=>{let r=!1;for(const e of n)if(0===e.errors.length){r=!0;break}!1===r&&e.addError("ANY_OF_MISSING",void 0,n,t,"anyOf")})},oneOf:function(e,t,r){const n=[];for(let i=0;i<t.oneOf.length;i++){const o=new b(e);n.push(o),this._jsonValidate(o,t.oneOf[i],r),rt(e,t.oneOf[i],r,0===o.errors.length)}it(e,n,()=>{let r=0;for(const e of n)0===e.errors.length&&r++;0===r?e.addError("ONE_OF_MISSING",void 0,n,t,"oneOf"):r>1&&e.addError("ONE_OF_MULTIPLE",void 0,void 0,t,"oneOf")})},not:function(e,t,r){const n=new b(e);!0===this._jsonValidate(n,t.not,r)&&e.addError("NOT_PASSED",void 0,void 0,t,"not")},if:function(e,t,r){if("draft-04"===this.options.version||"draft-06"===this.options.version)return;const n=t.if,i=t.then,o=t.else;if(void 0===n||void 0===i&&void 0===o)return;const a=new b(e);this._jsonValidate(a,n,r),rt(e,n,r,0===a.errors.length);const s=0===a.errors.length?i:o;void 0!==s&&this._jsonValidate(e,s,r)},then:function(){},else:function(){},definitions:function(){}},mt=function(e,t,r){const n="string"==typeof t.$schema?t.$schema:void 0,i=("https://json-schema.org/draft/2020-12/schema"===n||!n&&"draft2020-12"===this.options.version)&&Array.isArray(t.prefixItems)?t.prefixItems:void 0;if(i)for(let n=0;n<r.length;n++)n<i.length?(e.path.push(n),yt.call(this,e,i[n],r[n]),e.path.pop()):void 0===t.items||Array.isArray(t.items)||(e.path.push(n),e.schemaPath.push("items"),yt.call(this,e,t.items,r[n]),e.schemaPath.pop(),e.path.pop());else if(Array.isArray(t.items))for(let n=0;n<r.length;n++)n<t.items.length?(e.path.push(n),yt.call(this,e,t.items[n],r[n]),e.path.pop()):"object"==typeof t.additionalItems&&(e.path.push(n),yt.call(this,e,t.additionalItems,r[n]),e.path.pop());else if("object"==typeof t.items||"boolean"==typeof t.items)for(let n=0;n<r.length;n++)e.path.push(n),e.schemaPath.push("items"),yt.call(this,e,t.items,r[n]),e.schemaPath.pop(),e.path.pop()},ht=function(e,t,r){let n=t.additionalProperties;!0!==n&&void 0!==n||(n={});const i=t.properties?Object.keys(t.properties):[],o=t.patternProperties?Object.keys(t.patternProperties):[],a=Object.keys(r);for(const s of a){const a=r[s],c=[];i.includes(s)&&c.push(t.properties[s]);for(const e of o){const r=Be(e);r.ok&&!0===r.value.test(s)&&c.push(t.patternProperties[e])}0===c.length&&!1!==n&&c.push(n);for(const t of c)e.path.push(s),i.includes(s)?(e.schemaPath.push("properties"),e.schemaPath.push(s)):e.schemaPath.push("additionalProperties"),yt.call(this,e,t,a),e.path.pop(),e.schemaPath.pop(),i.includes(s)&&e.schemaPath.pop()}};function yt(e,t,r){if(e.commonErrorMessage="JSON_OBJECT_VALIDATION_FAILED",!0===t)return!0;if(!1===t)return e.addError("SCHEMA_IS_FALSE",[],void 0,t),!1;if(!o(t))return e.addError("SCHEMA_NOT_AN_OBJECT",[i(t)],void 0,t),!1;let n=Object.keys(t);if(0===n.length)return!0;let a=!1;e.rootSchema||(e.rootSchema=t,a=!0);const s=e.__$recursiveAnchorStack,c=e.__$dynamicScopeStack;let f=!1,l=!1;const u=d(t),p=t.__$resourceRoot||(a||"string"==typeof u?t:void 0);if(p&&c[c.length-1]!==p&&(c.push(p),l=!0),!0===t.$recursiveAnchor&&(s.push(t),f=!0),void 0!==t.$ref){if("draft2019-09"===this.options.version||"draft2020-12"===this.options.version)t.__$refResolved?yt.call(this,e,t.__$refResolved,r):e.addError("REF_UNRESOLVED",[t.$ref],void 0,t),n=n.filter(e=>"$ref"!==e);else{let r=99;for(;t.$ref&&r>0;){if(!t.__$refResolved){e.addError("REF_UNRESOLVED",[t.$ref],void 0,t);break}if(t.__$refResolved===t)break;t=t.__$refResolved,n=Object.keys(t),r--}if(0===r)throw new Error("Circular dependency by $ref references!");e.schemaPath=[]}}if(void 0!==t.$recursiveRef){if("draft2019-09"===this.options.version||"draft2020-12"===this.options.version){const i=st(t,s);i?yt.call(this,e,i,r):e.addError("REF_UNRESOLVED",[t.$recursiveRef],void 0,t),n=n.filter(e=>"$recursiveRef"!==e)}}if(void 0!==t.$dynamicRef){if("draft2020-12"===this.options.version){const i=ct(t,c);void 0===i?e.addError("REF_UNRESOLVED",[t.$dynamicRef],void 0,t):yt.call(this,e,i,r),n=n.filter(e=>"$dynamicRef"!==e)}}const m=((e,t,r)=>{if("draft2019-09"!==r&&"draft2020-12"!==r)return!0;const n=e.__$schemaResolved,i=t.rootSchema&&"boolean"!=typeof t.rootSchema?t.rootSchema.__$schemaResolved:void 0,a=n||i;if(!a||"object"!=typeof a||!o(a.$vocabulary))return!0;const s=a.$vocabulary,c=Object.hasOwn(s,Ze),d=Object.hasOwn(s,Ge);return!(!c&&!d||!0!==s[Ze]&&!0!==s[Ge])})(t,e,this.options.version);if(m||(n=n.filter(e=>!tt.has(e))),m&&t.type&&(n.splice(n.indexOf("type"),1),e.schemaPath.push("type"),pt.type.call(this,e,t,r),e.schemaPath.pop(),e.errors.length&&this.options.breakOnFirstError))return f&&s.pop(),l&&c.pop(),!1;const h=[];for(const i of n){if("unevaluatedItems"===i||"unevaluatedProperties"===i){h.push(i);continue}const n=pt[i];if(n&&(n.call(this,e,t,r),e.errors.length&&this.options.breakOnFirstError))break}if(h.length>0&&!(e.errors.length>0&&this.options.breakOnFirstError))for(const n of h){const i=pt[n];if(i&&(i.call(this,e,t,r),e.errors.length&&this.options.breakOnFirstError))break}return 0!==e.errors.length&&!1!==this.options.breakOnFirstError||(Array.isArray(r)?mt.call(this,e,t,r):o(r)&&ht.call(this,e,t,r)),"function"==typeof this.options.customValidator&&this.options.customValidator.call(this,e,t,r),f&&s.pop(),l&&c.pop(),a&&(e.rootSchema=void 0),0===e.errors.length}let vt;function Et(){return vt}function gt(e,t,r){[Object.prototype,Function.prototype,Array.prototype].includes(e)||"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=r)}const _t=(e,t,n,i,o,a=100,f=0)=>{if(t=t||[],n=n||[],i=i||[],o=o||{},"object"!=typeof e||null===e)return t;if(f>=a)throw new Error(`Maximum recursion depth (${a}) exceeded in collectReferences. If your schema is deeply nested and valid, increase the maxRecursionDepth option.`);const l="string"==typeof e.$ref&&void 0===e.__$refResolved;let u=!1;const p=0===n.length;let m=d(e);if("string"!=typeof e.id||!r(e.id)||m&&r(m)||(m=e.id),"string"==typeof m&&(p||!l||!0===o.useRefObjectScope)){const t=n.length>0?n[n.length-1]:void 0;n.push(bt(t,e,m)),u=!0}if(l&&t.push({ref:$t(n[n.length-1],e.$ref),key:"$ref",obj:e,path:i.slice(0)}),"string"==typeof e.$recursiveRef&&void 0===e.__$recursiveRefResolved&&t.push({ref:$t(n[n.length-1],e.$recursiveRef),key:"$recursiveRef",obj:e,path:i.slice(0)}),"string"==typeof e.$dynamicRef&&void 0===e.__$dynamicRefResolved&&t.push({ref:$t(n[n.length-1],e.$dynamicRef),key:"$dynamicRef",obj:e,path:i.slice(0)}),"string"==typeof e.$schema&&void 0===e.__$schemaResolved&&t.push({ref:$t(n[n.length-1],e.$schema),key:"$schema",obj:e,path:i.slice(0)}),Array.isArray(e))for(let r=0;r<e.length;r++)i.push(r),_t(e[r],t,n,i,o,a,f+1),i.pop();else{const r=Object.keys(e);for(const d of r)c(d)||s.includes(d)||(i.push(d),_t(e[d],t,n,i,o,a,f+1),i.pop())}return u&&n.pop(),t},$t=(e,t)=>{if(r(t))return t;const n=e??"";if("#"===t[0]){const e=n.indexOf("#");return(-1===e?n:n.slice(0,e))+t}if(!n)return t;const i=n.indexOf("#"),o=-1===i?n:n.slice(0,i);if(r(o))try{return new URL(t,o).toString()}catch{}let a=o;if(!a.endsWith("/")){const e=a.lastIndexOf("/");a=-1===e?"":a.slice(0,e+1)}return a+t},Ot=e=>"#"!==e[0]&&!e.includes("/")&&!e.includes(".")&&!e.includes("#"),bt=(e,t,n)=>"string"==typeof t.$id?$t(e,n):((e,t)=>{if(r(t))return t;const n=e??"";if(Ot(t)){const e=n.indexOf("#");return(-1===e?n:n.slice(0,e))+"#"+t}return $t(e,t)})(e,n);class At{validator;constructor(e){this.validator=e}collectAndCacheIds(e){const t=((e,t=100)=>{const n=[];return function e(i,o,a=0){if("object"!=typeof i||null==i)return;if(a>=t)throw new Error(`Maximum recursion depth (${t}) exceeded in collectIds. If your schema is deeply nested and valid, increase the maxRecursionDepth option.`);let f=!1;const l=d(i);if("string"==typeof l){let e=r(l)?"absolute":"relative";0===o.length&&(e="root");const t={id:l,type:e,obj:i};if("absolute"===e||"root"===e&&r(l))t.absoluteUri=l;else if("root"===e&&"string"==typeof i.id&&r(i.id)&&i.id!==l)t.absoluteUri=bt(i.id,i,l);else if("relative"===e&&(t.absoluteParent=o.filter(e=>"absolute"===e.type||"root"===e.type&&e.absoluteUri).slice(-1)[0],t.absoluteParent)){const e=t.absoluteParent.absoluteUri||t.absoluteParent.id;t.absoluteUri=bt(e,i,t.id)}n.push(t),o.push(t),f=!0}if(Array.isArray(i))for(const t of i)e(t,o,a+1);else for(const t of Object.keys(i))c(t)||s.includes(t)||e(i[t],o,a+1);f&&o.pop()}(e,[]),n})(e,this.validator.options.maxRecursionDepth);for(const e of t)if(e.absoluteUri){if(this.validator.scache.cacheSchemaByUri(e.absoluteUri,e.obj),"relative"===e.type&&e.absoluteParent&&Ot(e.id)){const t=e.absoluteParent.absoluteUri||e.absoluteParent.id,r=$t(t,e.id);this.validator.scache.cacheSchemaByUri(r,e.obj)}}else"root"===e.type&&this.validator.scache.cacheSchemaByUri(e.id,e.obj)}compileSchema(e,n,i){if(e.commonErrorMessage="SCHEMA_COMPILATION_FAILED","string"==typeof n){const t=this.validator.scache.getSchemaByUri(e,n);if(void 0===t)return e.addError("SCHEMA_NOT_REACHABLE",[n]),!1;n=t}if(Array.isArray(n))return i?.noCache||n.forEach(e=>this.collectAndCacheIds(e)),this.compileArrayOfSchemas(e,n);if("boolean"==typeof n)return!0;i?.noCache||this.collectAndCacheIds(n);const o=n!==Object.prototype&&n!==Function.prototype&&n!==Array.prototype;if(o&&n.__$compiled&&n.id&&!1===this.validator.scache.checkCacheForUri(n.id)&&(n.__$compiled=void 0),n.__$compiled)return!0;o&&!n.$schema&&"none"!==this.validator.options.version&&(n.$schema=this.validator.getDefaultSchemaId()),n.id&&"string"==typeof n.id&&!i?.noCache&&this.validator.scache.cacheSchemaByUri(n.id,n);let a=!1;e.rootSchema||(e.rootSchema=n,a=!0);const s=e.isValid();o&&delete n.__$missingReferences;const c="draft2019-09"===this.validator.options.version||"draft2020-12"===this.validator.options.version,d=_t(n,void 0,void 0,void 0,{useRefObjectScope:c},this.validator.options.maxRecursionDepth);for(const i of d){let a=this.validator.scache.getSchemaByUri(e,i.ref,n);if(void 0===a){const r=Et();if(r){const o=t(i.ref),s=r(o);if(s){s.id=o;const t=new b(e);this.compileSchema(t,s)?a=this.validator.scache.getSchemaByUri(e,i.ref,n):e.errors=e.errors.concat(t.errors)}}}if(void 0===a){const t=e.hasError("REMOTE_NOT_VALID",[i.ref]),a=r(i.ref);let c=!1;const d=!0===this.validator.options.ignoreUnresolvableReferences;a&&(c=this.validator.scache.checkCacheForUri(i.ref)),t||d&&a||c||(e.path.push(...i.path),e.addError("UNRESOLVABLE_REFERENCE",[i.ref]),e.path=e.path.slice(0,-i.path.length),s&&o&&(n.__$missingReferences=n.__$missingReferences||[],n.__$missingReferences.push(i)))}gt(i.obj,`__${i.key}Resolved`,a)}const f=e.isValid();return f&&o&&(n.__$compiled=!0),a&&(e.rootSchema=void 0),f}compileArrayOfSchemas(e,t){let r,n=0;do{e.errors=e.errors.filter(e=>"UNRESOLVABLE_REFERENCE"!==e.code),r=n,n=this.compileArrayOfSchemasLoop(e,t);for(const e of t)if(e.__$missingReferences){for(let r=e.__$missingReferences.length-1;r>=0;r--){const n=e.__$missingReferences[r],i=t.find(e=>e.id===n.ref);i&&(gt(n.obj,`__${n.key}Resolved`,i),e.__$missingReferences.splice(r,1))}0===e.__$missingReferences.length&&delete e.__$missingReferences}}while(n!==t.length&&n!==r);return e.isValid()}compileArrayOfSchemasLoop(e,t){let r=0;for(const n of t){const t=new b(e);this.compileSchema(t,n)&&r++,e.errors=e.errors.concat(t.errors)}return r}}const Rt={$ref:function(e,t){"string"!=typeof t.$ref&&e.addError("KEYWORD_TYPE_EXPECTED",["$ref","string"],void 0,t,"$ref")},$schema:function(e,t){"string"!=typeof t.$schema&&e.addError("KEYWORD_TYPE_EXPECTED",["$schema","string"],void 0,t,"$schema")},multipleOf:function(e,t){"number"!=typeof t.multipleOf?e.addError("KEYWORD_TYPE_EXPECTED",["multipleOf","number"],void 0,t,"multipleOf"):t.multipleOf<=0&&e.addError("KEYWORD_MUST_BE",["multipleOf","strictly greater than 0"],void 0,t,"multipleOf")},maximum:function(e,t){"number"!=typeof t.maximum&&e.addError("KEYWORD_TYPE_EXPECTED",["maximum","number"],void 0,t,"maximum")},exclusiveMaximum:function(e,t){"draft-04"===e.options.version?"boolean"!=typeof t.exclusiveMaximum?e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMaximum","boolean"],void 0,t,"exclusiveMaximum"):void 0===t.maximum&&e.addError("KEYWORD_DEPENDENCY",["exclusiveMaximum","maximum"],void 0,t,"exclusiveMaximum"):"boolean"!=typeof t.exclusiveMaximum&&"number"!=typeof t.exclusiveMaximum&&e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMaximum",["boolean","number"]],void 0,t,"exclusiveMaximum")},minimum:function(e,t){"number"!=typeof t.minimum&&e.addError("KEYWORD_TYPE_EXPECTED",["minimum","number"],void 0,t,"minimum")},exclusiveMinimum:function(e,t){"draft-04"===e.options.version?"boolean"!=typeof t.exclusiveMinimum?e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMinimum","boolean"],void 0,t,"exclusiveMinimum"):void 0===t.minimum&&e.addError("KEYWORD_DEPENDENCY",["exclusiveMinimum","minimum"],void 0,t,"exclusiveMinimum"):"boolean"!=typeof t.exclusiveMinimum&&"number"!=typeof t.exclusiveMinimum&&e.addError("KEYWORD_TYPE_EXPECTED",["exclusiveMinimum",["boolean","number"]],void 0,t,"exclusiveMinimum")},maxLength:function(e,t){a(t.maxLength)?t.maxLength<0&&e.addError("KEYWORD_MUST_BE",["maxLength","greater than, or equal to 0"],void 0,t,"maxLength"):e.addError("KEYWORD_TYPE_EXPECTED",["maxLength","integer"],void 0,t,"maxLength")},minLength:function(e,t){a(t.minLength)?t.minLength<0&&e.addError("KEYWORD_MUST_BE",["minLength","greater than, or equal to 0"],void 0,t,"minLength"):e.addError("KEYWORD_TYPE_EXPECTED",["minLength","integer"],void 0,t,"minLength")},pattern:function(e,t){if("string"!=typeof t.pattern)e.addError("KEYWORD_TYPE_EXPECTED",["pattern","string"],void 0,t,"pattern");else{const r=Be(t.pattern);r.ok||e.addError("KEYWORD_PATTERN",["pattern",t.pattern,r.error.message],void 0,t,"pattern")}},additionalItems:function(e,t){"boolean"==typeof t.additionalItems||o(t.additionalItems)?o(t.additionalItems)&&(e.path.push("additionalItems"),this.validateSchema(e,t.additionalItems),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["additionalItems",["boolean","object"]],void 0,t,"additionalItems")},items:function(e,t){if(Array.isArray(t.items))for(let r=0;r<t.items.length;r++)e.path.push("items"),e.path.push(r),this.validateSchema(e,t.items[r]),e.path.pop(),e.path.pop();else o(t.items)||"draft-04"!==e.options.version&&"boolean"==typeof t.items?(e.path.push("items"),this.validateSchema(e,t.items),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["items","draft-04"===e.options.version?["array","object"]:["array","object","boolean"]],void 0,t,"items");!0===this.options.forceAdditional&&void 0===t.additionalItems&&Array.isArray(t.items)&&e.addError("KEYWORD_UNDEFINED_STRICT",["additionalItems"],void 0,t,"additionalItems"),this.options.assumeAdditional&&void 0===t.additionalItems&&Array.isArray(t.items)&&(t.additionalItems=!1)},maxItems:function(e,t){"number"!=typeof t.maxItems?e.addError("KEYWORD_TYPE_EXPECTED",["maxItems","integer"],void 0,t,"maxItems"):t.maxItems<0&&e.addError("KEYWORD_MUST_BE",["maxItems","greater than, or equal to 0"],void 0,t,"maxItems")},minItems:function(e,t){a(t.minItems)?t.minItems<0&&e.addError("KEYWORD_MUST_BE",["minItems","greater than, or equal to 0"],void 0,t,"minItems"):e.addError("KEYWORD_TYPE_EXPECTED",["minItems","integer"],void 0,t,"minItems")},uniqueItems:function(e,t){"boolean"!=typeof t.uniqueItems&&e.addError("KEYWORD_TYPE_EXPECTED",["uniqueItems","boolean"],void 0,t,"uniqueItems")},maxProperties:function(e,t){a(t.maxProperties)?t.maxProperties<0&&e.addError("KEYWORD_MUST_BE",["maxProperties","greater than, or equal to 0"],void 0,t,"maxProperties"):e.addError("KEYWORD_TYPE_EXPECTED",["maxProperties","integer"],void 0,t,"maxProperties")},minProperties:function(e,t){a(t.minProperties)?t.minProperties<0&&e.addError("KEYWORD_MUST_BE",["minProperties","greater than, or equal to 0"],void 0,t,"minProperties"):e.addError("KEYWORD_TYPE_EXPECTED",["minProperties","integer"],void 0,t,"minProperties")},required:function(e,t){if(Array.isArray(t.required))if("draft-04"===e.options.version&&0===t.required.length)e.addError("KEYWORD_MUST_BE",["required","an array with at least one element"],void 0,t,"required");else{for(const r of t.required)"string"!=typeof r&&e.addError("KEYWORD_VALUE_TYPE",["required","string"],void 0,t,"required");!1===He(t.required)&&e.addError("KEYWORD_MUST_BE",["required","an array with unique items"],void 0,t,"required")}else e.addError("KEYWORD_TYPE_EXPECTED",["required","array"],void 0,t,"required")},additionalProperties:function(e,t){"boolean"==typeof t.additionalProperties||o(t.additionalProperties)?o(t.additionalProperties)&&(e.path.push("additionalProperties"),this.validateSchema(e,t.additionalProperties),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["additionalProperties",["boolean","object"]],void 0,t,"additionalProperties")},properties:function(e,t){if(!o(t.properties))return void e.addError("KEYWORD_TYPE_EXPECTED",["properties","object"],void 0,t,"properties");const r=Object.keys(t.properties);for(const n of r){const r=t.properties[n];e.path.push("properties"),e.path.push(n),this.validateSchema(e,r),e.path.pop(),e.path.pop()}!0===this.options.forceAdditional&&void 0===t.additionalProperties&&e.addError("KEYWORD_UNDEFINED_STRICT",["additionalProperties"],void 0,t,"additionalProperties"),this.options.assumeAdditional&&void 0===t.additionalProperties&&(t.additionalProperties=!1),!0===this.options.forceProperties&&0===r.length&&e.addError("CUSTOM_MODE_FORCE_PROPERTIES",["properties"],void 0,t,"properties")},patternProperties:function(e,t){if(!o(t.patternProperties))return void e.addError("KEYWORD_TYPE_EXPECTED",["patternProperties","object"],void 0,t,"patternProperties");const r=Object.keys(t.patternProperties);for(const n of r){const r=t.patternProperties[n],i=Be(n);i.ok||e.addError("KEYWORD_PATTERN",["patternProperties",n,i.error.message],void 0,t,"patternProperties"),e.path.push("patternProperties"),e.path.push(n),this.validateSchema(e,r),e.path.pop(),e.path.pop()}!0===this.options.forceProperties&&0===r.length&&e.addError("CUSTOM_MODE_FORCE_PROPERTIES",["patternProperties"],void 0,t,"patternProperties")},dependencies:function(e,t){if(o(t.dependencies)){const r=Object.keys(t.dependencies);for(const n of r){const r=t.dependencies[n];if(o(r)||"draft-04"!==e.options.version&&"boolean"==typeof r)e.path.push("dependencies"),e.path.push(n),this.validateSchema(e,r),e.path.pop(),e.path.pop();else if(Array.isArray(r)){const n=r;"draft-04"===e.options.version&&0===n.length&&e.addError("KEYWORD_MUST_BE",["dependencies","not empty array"],void 0,t,"dependencies");for(const r of n)"string"!=typeof r&&e.addError("KEYWORD_VALUE_TYPE",["dependencies","string"],void 0,t,"dependencies");!1===He(n)&&e.addError("KEYWORD_MUST_BE",["dependencies","an array with unique items"],void 0,t,"dependencies")}else e.addError("KEYWORD_VALUE_TYPE",["dependencies","draft-04"===e.options.version?"object or array":"boolean, object or array"],void 0,t,"dependencies")}}else e.addError("KEYWORD_TYPE_EXPECTED",["dependencies","object"],void 0,t,"dependencies")},enum:function(e,t){!1===Array.isArray(t.enum)?e.addError("KEYWORD_TYPE_EXPECTED",["enum","array"],void 0,t,"enum"):0===t.enum.length?e.addError("KEYWORD_MUST_BE",["enum","an array with at least one element"],void 0,t,"enum"):!1===He(t.enum)&&e.addError("KEYWORD_MUST_BE",["enum","an array with unique elements"],void 0,t,"enum")},type:function(e,t){const r=["array","boolean","integer","number","null","object","string"],n=r.join(","),i=Array.isArray(t.type);if(Array.isArray(t.type)){for(const i of t.type)r.includes(i)||e.addError("KEYWORD_TYPE_EXPECTED",["type",n],void 0,t,"type");!1===He(t.type)&&e.addError("KEYWORD_MUST_BE",["type","an object with unique properties"],void 0,t,"type")}else"string"==typeof t.type?r.includes(t.type)||e.addError("KEYWORD_TYPE_EXPECTED",["type",n],void 0,t,"type"):e.addError("KEYWORD_TYPE_EXPECTED",["type",["string","array"]],void 0,t,"type");!0===this.options.noEmptyStrings&&("string"===t.type||i&&t.type.includes("string"))&&void 0===t.minLength&&void 0===t.enum&&void 0===t.format&&(t.minLength=1),!0===this.options.noEmptyArrays&&("array"===t.type||i&&t.type.includes("array"))&&void 0===t.minItems&&(t.minItems=1),!0===this.options.forceProperties&&("object"===t.type||i&&t.type.includes("object"))&&void 0===t.properties&&void 0===t.patternProperties&&e.addError("KEYWORD_UNDEFINED_STRICT",["properties"],void 0,t,"properties"),!0===this.options.forceItems&&("array"===t.type||i&&t.type.includes("array"))&&void 0===t.items&&e.addError("KEYWORD_UNDEFINED_STRICT",["items"],void 0,t,"items"),!0===this.options.forceMinItems&&("array"===t.type||i&&t.type.includes("array"))&&void 0===t.minItems&&e.addError("KEYWORD_UNDEFINED_STRICT",["minItems"],void 0,t,"minItems"),!0===this.options.forceMaxItems&&("array"===t.type||i&&t.type.includes("array"))&&void 0===t.maxItems&&e.addError("KEYWORD_UNDEFINED_STRICT",["maxItems"],void 0,t,"maxItems"),!0===this.options.forceMinLength&&("string"===t.type||i&&t.type.includes("string"))&&void 0===t.minLength&&void 0===t.format&&void 0===t.enum&&void 0===t.pattern&&e.addError("KEYWORD_UNDEFINED_STRICT",["minLength"],void 0,t,"minLength"),!0===this.options.forceMaxLength&&("string"===t.type||i&&t.type.includes("string"))&&void 0===t.maxLength&&void 0===t.format&&void 0===t.enum&&void 0===t.pattern&&e.addError("KEYWORD_UNDEFINED_STRICT",["maxLength"],void 0,t,"maxLength")},allOf:function(e,t){if(!1===Array.isArray(t.allOf))e.addError("KEYWORD_TYPE_EXPECTED",["allOf","array"],void 0,t,"allOf");else if(0===t.allOf.length)e.addError("KEYWORD_MUST_BE",["allOf","an array with at least one element"],void 0,t,"allOf");else for(let r=0;r<t.allOf.length;r++)e.path.push("allOf"),e.path.push(r),this.validateSchema(e,t.allOf[r]),e.path.pop(),e.path.pop()},anyOf:function(e,t){if(!1===Array.isArray(t.anyOf))e.addError("KEYWORD_TYPE_EXPECTED",["anyOf","array"],void 0,t,"anyOf");else if(0===t.anyOf.length)e.addError("KEYWORD_MUST_BE",["anyOf","an array with at least one element"],void 0,t,"anyOf");else for(let r=0;r<t.anyOf.length;r++)e.path.push("anyOf"),e.path.push(r),this.validateSchema(e,t.anyOf[r]),e.path.pop(),e.path.pop()},oneOf:function(e,t){if(!1===Array.isArray(t.oneOf))e.addError("KEYWORD_TYPE_EXPECTED",["oneOf","array"],void 0,t,"oneOf");else if(0===t.oneOf.length)e.addError("KEYWORD_MUST_BE",["oneOf","an array with at least one element"],void 0,t,"oneOf");else for(let r=0;r<t.oneOf.length;r++)e.path.push("oneOf"),e.path.push(r),this.validateSchema(e,t.oneOf[r]),e.path.pop(),e.path.pop()},not:function(e,t){const r=t.not;("draft-04"===e.options.version?o(r):"boolean"==typeof r||o(r))?(e.path.push("not"),this.validateSchema(e,r),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["not","draft-04"===e.options.version?"object":["boolean","object"]],void 0,t,"not")},if:function(e,t){if("draft-07"!==e.options.version)return;const r=t.if;"boolean"==typeof r||o(r)?(e.path.push("if"),this.validateSchema(e,r),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["if",["boolean","object"]],void 0,t,"if")},then:function(e,t){if("draft-07"!==e.options.version)return;const r=t.then;"boolean"==typeof r||o(r)?(e.path.push("then"),this.validateSchema(e,r),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["then",["boolean","object"]],void 0,t,"then")},else:function(e,t){if("draft-07"!==e.options.version)return;const r=t.else;"boolean"==typeof r||o(r)?(e.path.push("else"),this.validateSchema(e,r),e.path.pop()):e.addError("KEYWORD_TYPE_EXPECTED",["else",["boolean","object"]],void 0,t,"else")},definitions:function(e,t){if(o(t.definitions)){const r=Object.keys(t.definitions);for(const n of r){const r=t.definitions[n];e.path.push("definitions"),e.path.push(n),this.validateSchema(e,r),e.path.pop(),e.path.pop()}}else e.addError("KEYWORD_TYPE_EXPECTED",["definitions","object"],void 0,t,"definitions")},$defs:function(e,t){if("draft2019-09"!==e.options.version&&"draft2020-12"!==e.options.version)return;if(!o(t.$defs))return void e.addError("KEYWORD_TYPE_EXPECTED",["$defs","object"],void 0,t,"$defs");const r=Object.keys(t.$defs);for(const n of r){const r=t.$defs[n];e.path.push("$defs"),e.path.push(n),this.validateSchema(e,r),e.path.pop(),e.path.pop()}},format:function(e,t){if(!1!==this.options.formatAssertions)if("string"!=typeof t.format)e.addError("KEYWORD_TYPE_EXPECTED",["format","string"],void 0,t,"format");else{const r="draft2019-09"===this.options.version||"draft2020-12"===this.options.version;(function(e,t){if(t){const r=t[e];if(null===r)return!1;if(null!=r)return!0}return e in Xe?null!=Xe[e]:e in Ve})(t.format,this.options.customFormats)||!0===this.options.ignoreUnknownFormats||r||e.addError("UNKNOWN_FORMAT",[t.format],void 0,t,"format")}},contentEncoding:function(e,t){"draft-07"===e.options.version&&"string"!=typeof t.contentEncoding&&e.addError("KEYWORD_TYPE_EXPECTED",["contentEncoding","string"],void 0,t,"contentEncoding")},contentMediaType:function(e,t){"draft-07"===e.options.version&&"string"!=typeof t.contentMediaType&&e.addError("KEYWORD_TYPE_EXPECTED",["contentMediaType","string"],void 0,t,"contentMediaType")},id:function(e,t){"string"!=typeof t.id&&e.addError("KEYWORD_TYPE_EXPECTED",["id","string"],void 0,t,"id")},title:function(e,t){"string"!=typeof t.title&&e.addError("KEYWORD_TYPE_EXPECTED",["title","string"],void 0,t,"title")},description:function(e,t){"string"!=typeof t.description&&e.addError("KEYWORD_TYPE_EXPECTED",["description","string"],void 0,t,"description")},default:function(){}};class xt{validator;constructor(e){this.validator=e}get options(){return this.validator.options}validateArrayOfSchemas(e,t){for(const r of t)this.validateSchema(e,r);return e.isValid()}validateSchema(e,t){if(e.commonErrorMessage="SCHEMA_VALIDATION_FAILED",Array.isArray(t))return this.validateArrayOfSchemas(e,t);if("boolean"==typeof t)return!0;if(t.__$validated)return!0;const r=t.$schema&&d(t)!==t.$schema;if(r)if(t.__$schemaResolved&&t.__$schemaResolved!==t){const r=new b(e);!1===yt.call(this.validator,r,t.__$schemaResolved,t)&&e.addError("PARENT_SCHEMA_VALIDATION_FAILED",void 0,r,t,"$schema")}else!0!==this.validator.options.ignoreUnresolvableReferences&&e.addError("REF_UNRESOLVED",[t.$schema],void 0,t,"$schema");if(!0===this.validator.options.noTypeless){if(void 0!==t.type){let e=[];Array.isArray(t.anyOf)&&(e=e.concat(t.anyOf)),Array.isArray(t.oneOf)&&(e=e.concat(t.oneOf)),Array.isArray(t.allOf)&&(e=e.concat(t.allOf)),e.forEach(function(e){e.type||(e.type=t.type)})}void 0===t.enum&&void 0===t.type&&void 0===t.anyOf&&void 0===t.oneOf&&void 0===t.not&&void 0===t.$ref&&e.addError("KEYWORD_UNDEFINED_STRICT",["type"],void 0,t,"type")}const n=Object.keys(t);for(const i of n)i.startsWith("__")||(Object.hasOwn(Rt,i)?Rt[i].call(this,e,t):r||!0===this.validator.options.noExtraKeywords&&e.addError("KEYWORD_UNEXPECTED",[i],void 0,t,void 0));if(!0===this.validator.options.pedanticCheck){if(t.enum){const r=h(t);delete r.enum,delete r.default,e.path.push("enum");for(let n=0;n<t.enum.length;n++)e.path.push(n),yt.call(this.validator,e,r,t.enum[n]),e.path.pop();e.path.pop()}t.default&&(e.path.push("default"),yt.call(this.validator,e,t,t.default),e.path.pop())}const i=e.isValid();return i&&(t.__$validated=!0),i}}const It=Symbol("ZSchema.factory");class St{scache;sc;sv;validateOptions={};options;constructor(e,t){if(t!==It)throw new Error("do not use new ZSchema(), use ZSchema.create() instead");this.scache=new P(this),this.sc=new At(this),this.sv=new xt(this),this.options=x(e)}_jsonValidate(e,t,r){return yt.call(this,e,t,r)}getDefaultSchemaId(){return this.options.version&&"none"!==this.options.version?A[this.options.version]:A[R.version]}_validate(e,t,r,n){if("function"==typeof r&&(n=r,r={}),r||(r={}),this.validateOptions=r,"string"!=typeof t&&"boolean"!=typeof t&&!o(t)){const e=new Error("Invalid .validate call - schema must be a string or object but "+i(t)+" was passed!");if(n)return void setTimeout(function(){n(e,!1)},0);throw e}let a=!1;const s=new b(this.options,r);let c;if(s.json=e,"string"==typeof t){const e=t;if(c=this.scache.getSchema(s,e),!c){const t=new Error("Schema with id '"+e+"' wasn't found in the validator cache!");if(n)return void setTimeout(function(){n(t,!1)},0);throw t}}else c=this.scache.getSchema(s,t);let d=!1;a||(d=this.sc.compileSchema(s,c)),d||(a=!0);let f=!1;if(a||(f=this.sv.validateSchema(s,c)),f||(a=!0),r.schemaPath&&(s.rootSchema=c,c=_(c,r.schemaPath),!c)){const e=new Error("Schema path '"+r.schemaPath+"' wasn't found in the schema!");if(n)return void setTimeout(function(){n(e,!1)},0);throw e}if(a||yt.call(this,s,c,e),!n){if(s.asyncTasks.length>0)throw new Error("This validation has async tasks and cannot be done in sync mode, please provide callback argument.");if(!s.isValid())throw p({message:s.commonErrorMessage,details:s.errors});return!0}s.processAsyncTasks(this.options.asyncTimeout,n)}_validateSchema(e){if(Array.isArray(e)&&0===e.length)throw new Error(".compileSchema was called with an empty array");const t=new b(this.options);if(Array.isArray(e)){const r=this.scache.getSchema(t,e);this.sc.compileSchema(t,r)&&this.sv.validateSchema(t,r)}else{const r=this.scache.getSchema(t,e);this.sc.compileSchema(t,r)&&this.sv.validateSchema(t,r)}if(!t.isValid())throw p({message:t.commonErrorMessage,details:t.errors});return!0}registerFormat(e,t){this.options.customFormats||(this.options.customFormats={}),this.options.customFormats[e]=t}unregisterFormat(e){this.options.customFormats||(this.options.customFormats={}),this.options.customFormats[e]=null}getRegisteredFormats(){return g(this.options.customFormats||{}).filter(e=>null!=this.options.customFormats?.[e])}getSupportedFormats(){return function(e){const t={...Ve,...Xe,...e};return g(t).filter(e=>null!=t[e])}(this.options.customFormats)}setRemoteReference(e,t,r){const n=T(t,e,r,this.options.maxRecursionDepth);this.scache.cacheSchemaByUri(e,n)}getMissingReferences(e){if(!e)return[];const t=e.details||[],r=[];return function e(t){for(const n of t)"UNRESOLVABLE_REFERENCE"!==n.code&&"SCHEMA_NOT_REACHABLE"!==n.code||r.push(n.params[0]),n.inner&&e(n.inner)}(t),r}getMissingRemoteReferences(e){const r=this.getMissingReferences(e),n=[];for(const e of r){const r=t(e);r&&!n.includes(r)&&n.push(r)}return n}getResolvedSchema(e){const t=new b(this.options),r=this.scache.getSchemaByUri(t,e);if(!r)return;const n=y(r,this.options.maxRecursionDepth),o=new WeakSet,a=function(e){let t;const r=i(e);if(("object"===r||"array"===r)&&!o.has(e)){if(o.add(e),e.$ref&&e.__$refResolved){const r=e.__$refResolved,n=e;for(t in delete e.$ref,delete e.__$refResolved,r)m(r,n,t)}for(t in e)Object.hasOwn(e,t)&&(c(t)?delete e[t]:a(e[t]))}};return a(n),n}}class Tt extends St{constructor(e,t){super(e,t)}static registerFormat(e,t){return function(e,t){Xe[e]=t}(e,t)}static unregisterFormat(e){return function(e){delete Xe[e]}(e)}static getRegisteredFormats(){return g(Xe)}static getDefaultOptions(){return y(R)}static setRemoteReference(e,t,r){const n=T(t,e,r);P.cacheSchemaByUri(e,n)}static getSchemaReader(){return Et()}static setSchemaReader(e){return function(e){vt=e}(e)}static schemaSymbol=O;static jsonSymbol=$;static create(e={}){const t=e.async,r=e.safe;return delete e.async,delete e.safe,t&&r?new jt(e,It):t?new Dt(e,It):r?new Pt(e,It):new Tt(e,It)}validate(e,t,r={}){return this._validate(e,t,r)}validateSafe(e,t,r){try{return this._validate(e,t,r??{}),{valid:!0}}catch(e){return{valid:!1,err:e}}}validateAsync(e,t,r){return new Promise((n,i)=>{try{this._validate(e,t,r||{},(e,t)=>e||!0!==t?i(e):n(t))}catch(e){i(e)}})}validateAsyncSafe(e,t,r){return new Promise(n=>{try{this._validate(e,t,r||{},(e,t)=>{n({valid:t,err:e})})}catch(e){n({valid:!1,err:e})}})}validateSchema(e){return this._validateSchema(e)}validateSchemaSafe(e){try{return this._validateSchema(e),{valid:!0}}catch(e){return{valid:!1,err:e}}}}class Pt extends St{constructor(e,t){super(e,t)}validate(e,t,r={}){try{return this._validate(e,t,r),{valid:!0}}catch(e){return{valid:!1,err:e}}}validateSchema(e){try{return this._validateSchema(e),{valid:!0}}catch(e){return{valid:!1,err:e}}}}class Dt extends St{constructor(e,t){super(e,t)}validate(e,t,r={}){return new Promise((n,i)=>{try{this._validate(e,t,r,(e,t)=>e||!0!==t?i(e):n(t))}catch(e){i(e)}})}validateSchema(e){return this._validateSchema(e)}}class jt extends St{constructor(e,t){super(e,t)}validate(e,t,r={}){return new Promise(n=>{try{this._validate(e,t,r,(e,t)=>{n({valid:t,err:e})})}catch(e){n({valid:!1,err:e})}})}validateSchema(e){try{return this._validateSchema(e),{valid:!0}}catch(e){return{valid:!1,err:e}}}}e.ZSchema=Tt,e.ZSchemaAsync=Dt,e.ZSchemaAsyncSafe=jt,e.ZSchemaSafe=Pt});
|