@hyperjump/json-schema 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +176 -0
  3. package/dist/json-schema-amd.js +4710 -0
  4. package/dist/json-schema-amd.js.map +1 -0
  5. package/dist/json-schema-amd.min.js +2 -0
  6. package/dist/json-schema-amd.min.js.map +1 -0
  7. package/dist/json-schema-cjs.js +4708 -0
  8. package/dist/json-schema-cjs.js.map +1 -0
  9. package/dist/json-schema-cjs.min.js +2 -0
  10. package/dist/json-schema-cjs.min.js.map +1 -0
  11. package/dist/json-schema-esm.js +4691 -0
  12. package/dist/json-schema-esm.js.map +1 -0
  13. package/dist/json-schema-esm.min.js +2 -0
  14. package/dist/json-schema-esm.min.js.map +1 -0
  15. package/dist/json-schema-iife.js +4713 -0
  16. package/dist/json-schema-iife.js.map +1 -0
  17. package/dist/json-schema-iife.min.js +2 -0
  18. package/dist/json-schema-iife.min.js.map +1 -0
  19. package/dist/json-schema-system.js +4698 -0
  20. package/dist/json-schema-system.js.map +1 -0
  21. package/dist/json-schema-system.min.js +2 -0
  22. package/dist/json-schema-system.min.js.map +1 -0
  23. package/dist/json-schema-umd.js +4714 -0
  24. package/dist/json-schema-umd.js.map +1 -0
  25. package/dist/json-schema-umd.min.js +2 -0
  26. package/dist/json-schema-umd.min.js.map +1 -0
  27. package/lib/common.js +13 -0
  28. package/lib/draft-04.d.ts +40 -0
  29. package/lib/draft-04.js +94 -0
  30. package/lib/draft-06.d.ts +44 -0
  31. package/lib/draft-06.js +51 -0
  32. package/lib/draft-07.d.ts +52 -0
  33. package/lib/draft-07.js +55 -0
  34. package/lib/draft-2019-09.d.ts +62 -0
  35. package/lib/draft-2019-09.js +92 -0
  36. package/lib/draft-2020-12.d.ts +62 -0
  37. package/lib/draft-2020-12.js +103 -0
  38. package/lib/index.d.ts +28 -0
  39. package/lib/index.js +26 -0
  40. package/lib/index.mjs +18 -0
  41. package/lib/keywords/additionalItems.js +27 -0
  42. package/lib/keywords/additionalItems6.js +23 -0
  43. package/lib/keywords/additionalProperties.js +33 -0
  44. package/lib/keywords/additionalProperties6.js +28 -0
  45. package/lib/keywords/allOf.js +28 -0
  46. package/lib/keywords/anyOf.js +29 -0
  47. package/lib/keywords/const.js +8 -0
  48. package/lib/keywords/contains-minContains-maxContains.js +33 -0
  49. package/lib/keywords/contains.js +10 -0
  50. package/lib/keywords/definitions.js +15 -0
  51. package/lib/keywords/dependencies.js +29 -0
  52. package/lib/keywords/dependentRequired.js +19 -0
  53. package/lib/keywords/dependentSchemas.js +30 -0
  54. package/lib/keywords/dynamicRef.js +24 -0
  55. package/lib/keywords/else.js +43 -0
  56. package/lib/keywords/enum.js +8 -0
  57. package/lib/keywords/exclusiveMaximum.js +7 -0
  58. package/lib/keywords/exclusiveMinimum.js +7 -0
  59. package/lib/keywords/if.js +19 -0
  60. package/lib/keywords/index.js +55 -0
  61. package/lib/keywords/items.js +31 -0
  62. package/lib/keywords/items202012.js +23 -0
  63. package/lib/keywords/maxItems.js +7 -0
  64. package/lib/keywords/maxLength.js +7 -0
  65. package/lib/keywords/maxLength6.js +7 -0
  66. package/lib/keywords/maxProperties.js +7 -0
  67. package/lib/keywords/maximum-exclusiveMaximum.js +20 -0
  68. package/lib/keywords/maximum.js +7 -0
  69. package/lib/keywords/minItems.js +7 -0
  70. package/lib/keywords/minLength.js +7 -0
  71. package/lib/keywords/minLength6.js +7 -0
  72. package/lib/keywords/minProperties.js +7 -0
  73. package/lib/keywords/minimum-exclusiveMinimum.js +20 -0
  74. package/lib/keywords/minimum.js +7 -0
  75. package/lib/keywords/multipleOf.js +17 -0
  76. package/lib/keywords/not.js +7 -0
  77. package/lib/keywords/oneOf.js +48 -0
  78. package/lib/keywords/pattern.js +7 -0
  79. package/lib/keywords/patternProperties.js +23 -0
  80. package/lib/keywords/properties.js +25 -0
  81. package/lib/keywords/propertyNames.js +11 -0
  82. package/lib/keywords/ref.js +13 -0
  83. package/lib/keywords/required.js +10 -0
  84. package/lib/keywords/then.js +43 -0
  85. package/lib/keywords/tupleItems.js +24 -0
  86. package/lib/keywords/type.js +7 -0
  87. package/lib/keywords/unevaluatedItems.js +23 -0
  88. package/lib/keywords/unevaluatedProperties.js +24 -0
  89. package/lib/keywords/uniqueItems.js +16 -0
  90. package/meta/draft/2019-09/meta/applicator.js +55 -0
  91. package/meta/draft/2019-09/meta/content.js +17 -0
  92. package/meta/draft/2019-09/meta/core.js +57 -0
  93. package/meta/draft/2019-09/meta/format.js +14 -0
  94. package/meta/draft/2019-09/meta/meta-data.js +37 -0
  95. package/meta/draft/2019-09/meta/validation.js +98 -0
  96. package/meta/draft/2019-09/schema.js +42 -0
  97. package/meta/draft/2020-12/meta/applicator.js +49 -0
  98. package/meta/draft/2020-12/meta/content.js +17 -0
  99. package/meta/draft/2020-12/meta/core.js +57 -0
  100. package/meta/draft/2020-12/meta/format-annotation.js +14 -0
  101. package/meta/draft/2020-12/meta/format-assertion.js +14 -0
  102. package/meta/draft/2020-12/meta/meta-data.js +37 -0
  103. package/meta/draft/2020-12/meta/unevaluated.js +15 -0
  104. package/meta/draft/2020-12/meta/validation.js +98 -0
  105. package/meta/draft/2020-12/schema.js +44 -0
  106. package/meta/draft-04/hyper-schema.js +136 -0
  107. package/meta/draft-04/schema.js +149 -0
  108. package/meta/draft-06/schema.js +154 -0
  109. package/meta/draft-07/schema.js +172 -0
  110. package/package.json +57 -0
@@ -0,0 +1,4691 @@
1
+ var justCurryIt = curry;
2
+
3
+ /*
4
+ function add(a, b, c) {
5
+ return a + b + c;
6
+ }
7
+ curry(add)(1)(2)(3); // 6
8
+ curry(add)(1)(2)(2); // 5
9
+ curry(add)(2)(4, 3); // 9
10
+
11
+ function add(...args) {
12
+ return args.reduce((sum, n) => sum + n, 0)
13
+ }
14
+ var curryAdd4 = curry(add, 4)
15
+ curryAdd4(1)(2, 3)(4); // 10
16
+
17
+ function converter(ratio, input) {
18
+ return (input*ratio).toFixed(1);
19
+ }
20
+ const curriedConverter = curry(converter)
21
+ const milesToKm = curriedConverter(1.62);
22
+ milesToKm(35); // 56.7
23
+ milesToKm(10); // 16.2
24
+ */
25
+
26
+ function curry(fn, arity) {
27
+ return function curried() {
28
+ if (arity == null) {
29
+ arity = fn.length;
30
+ }
31
+ var args = [].slice.call(arguments);
32
+ if (args.length >= arity) {
33
+ return fn.apply(this, args);
34
+ } else {
35
+ return function() {
36
+ return curried.apply(this, args.concat([].slice.call(arguments)));
37
+ };
38
+ }
39
+ };
40
+ }
41
+
42
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
43
+
44
+ function createCommonjsModule(fn, module) {
45
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
46
+ }
47
+
48
+ var pubsub = createCommonjsModule(function (module, exports) {
49
+ /**
50
+ * Copyright (c) 2010,2011,2012,2013,2014 Morgan Roderick http://roderick.dk
51
+ * License: MIT - http://mrgnrdrck.mit-license.org
52
+ *
53
+ * https://github.com/mroderick/PubSubJS
54
+ */
55
+
56
+ (function (root, factory){
57
+
58
+ var PubSub = {};
59
+ root.PubSub = PubSub;
60
+ factory(PubSub);
61
+ // CommonJS and Node.js module support
62
+ {
63
+ if (module !== undefined && module.exports) {
64
+ exports = module.exports = PubSub; // Node.js specific `module.exports`
65
+ }
66
+ exports.PubSub = PubSub; // CommonJS module 1.1.1 spec
67
+ module.exports = exports = PubSub; // CommonJS
68
+ }
69
+
70
+ }(( typeof window === 'object' && window ) || commonjsGlobal, function (PubSub){
71
+
72
+ var messages = {},
73
+ lastUid = -1,
74
+ ALL_SUBSCRIBING_MSG = '*';
75
+
76
+ function hasKeys(obj){
77
+ var key;
78
+
79
+ for (key in obj){
80
+ if ( Object.prototype.hasOwnProperty.call(obj, key) ){
81
+ return true;
82
+ }
83
+ }
84
+ return false;
85
+ }
86
+
87
+ /**
88
+ * Returns a function that throws the passed exception, for use as argument for setTimeout
89
+ * @alias throwException
90
+ * @function
91
+ * @param { Object } ex An Error object
92
+ */
93
+ function throwException( ex ){
94
+ return function reThrowException(){
95
+ throw ex;
96
+ };
97
+ }
98
+
99
+ function callSubscriberWithDelayedExceptions( subscriber, message, data ){
100
+ try {
101
+ subscriber( message, data );
102
+ } catch( ex ){
103
+ setTimeout( throwException( ex ), 0);
104
+ }
105
+ }
106
+
107
+ function callSubscriberWithImmediateExceptions( subscriber, message, data ){
108
+ subscriber( message, data );
109
+ }
110
+
111
+ function deliverMessage( originalMessage, matchedMessage, data, immediateExceptions ){
112
+ var subscribers = messages[matchedMessage],
113
+ callSubscriber = immediateExceptions ? callSubscriberWithImmediateExceptions : callSubscriberWithDelayedExceptions,
114
+ s;
115
+
116
+ if ( !Object.prototype.hasOwnProperty.call( messages, matchedMessage ) ) {
117
+ return;
118
+ }
119
+
120
+ for (s in subscribers){
121
+ if ( Object.prototype.hasOwnProperty.call(subscribers, s)){
122
+ callSubscriber( subscribers[s], originalMessage, data );
123
+ }
124
+ }
125
+ }
126
+
127
+ function createDeliveryFunction( message, data, immediateExceptions ){
128
+ return function deliverNamespaced(){
129
+ var topic = String( message ),
130
+ position = topic.lastIndexOf( '.' );
131
+
132
+ // deliver the message as it is now
133
+ deliverMessage(message, message, data, immediateExceptions);
134
+
135
+ // trim the hierarchy and deliver message to each level
136
+ while( position !== -1 ){
137
+ topic = topic.substr( 0, position );
138
+ position = topic.lastIndexOf('.');
139
+ deliverMessage( message, topic, data, immediateExceptions );
140
+ }
141
+
142
+ deliverMessage(message, ALL_SUBSCRIBING_MSG, data, immediateExceptions);
143
+ };
144
+ }
145
+
146
+ function hasDirectSubscribersFor( message ) {
147
+ var topic = String( message ),
148
+ found = Boolean(Object.prototype.hasOwnProperty.call( messages, topic ) && hasKeys(messages[topic]));
149
+
150
+ return found;
151
+ }
152
+
153
+ function messageHasSubscribers( message ){
154
+ var topic = String( message ),
155
+ found = hasDirectSubscribersFor(topic) || hasDirectSubscribersFor(ALL_SUBSCRIBING_MSG),
156
+ position = topic.lastIndexOf( '.' );
157
+
158
+ while ( !found && position !== -1 ){
159
+ topic = topic.substr( 0, position );
160
+ position = topic.lastIndexOf( '.' );
161
+ found = hasDirectSubscribersFor(topic);
162
+ }
163
+
164
+ return found;
165
+ }
166
+
167
+ function publish( message, data, sync, immediateExceptions ){
168
+ message = (typeof message === 'symbol') ? message.toString() : message;
169
+
170
+ var deliver = createDeliveryFunction( message, data, immediateExceptions ),
171
+ hasSubscribers = messageHasSubscribers( message );
172
+
173
+ if ( !hasSubscribers ){
174
+ return false;
175
+ }
176
+
177
+ if ( sync === true ){
178
+ deliver();
179
+ } else {
180
+ setTimeout( deliver, 0 );
181
+ }
182
+ return true;
183
+ }
184
+
185
+ /**
186
+ * Publishes the message, passing the data to it's subscribers
187
+ * @function
188
+ * @alias publish
189
+ * @param { String } message The message to publish
190
+ * @param {} data The data to pass to subscribers
191
+ * @return { Boolean }
192
+ */
193
+ PubSub.publish = function( message, data ){
194
+ return publish( message, data, false, PubSub.immediateExceptions );
195
+ };
196
+
197
+ /**
198
+ * Publishes the message synchronously, passing the data to it's subscribers
199
+ * @function
200
+ * @alias publishSync
201
+ * @param { String } message The message to publish
202
+ * @param {} data The data to pass to subscribers
203
+ * @return { Boolean }
204
+ */
205
+ PubSub.publishSync = function( message, data ){
206
+ return publish( message, data, true, PubSub.immediateExceptions );
207
+ };
208
+
209
+ /**
210
+ * Subscribes the passed function to the passed message. Every returned token is unique and should be stored if you need to unsubscribe
211
+ * @function
212
+ * @alias subscribe
213
+ * @param { String } message The message to subscribe to
214
+ * @param { Function } func The function to call when a new message is published
215
+ * @return { String }
216
+ */
217
+ PubSub.subscribe = function( message, func ){
218
+ if ( typeof func !== 'function'){
219
+ return false;
220
+ }
221
+
222
+ message = (typeof message === 'symbol') ? message.toString() : message;
223
+
224
+ // message is not registered yet
225
+ if ( !Object.prototype.hasOwnProperty.call( messages, message ) ){
226
+ messages[message] = {};
227
+ }
228
+
229
+ // forcing token as String, to allow for future expansions without breaking usage
230
+ // and allow for easy use as key names for the 'messages' object
231
+ var token = 'uid_' + String(++lastUid);
232
+ messages[message][token] = func;
233
+
234
+ // return token for unsubscribing
235
+ return token;
236
+ };
237
+
238
+ PubSub.subscribeAll = function( func ){
239
+ return PubSub.subscribe(ALL_SUBSCRIBING_MSG, func);
240
+ };
241
+
242
+ /**
243
+ * Subscribes the passed function to the passed message once
244
+ * @function
245
+ * @alias subscribeOnce
246
+ * @param { String } message The message to subscribe to
247
+ * @param { Function } func The function to call when a new message is published
248
+ * @return { PubSub }
249
+ */
250
+ PubSub.subscribeOnce = function( message, func ){
251
+ var token = PubSub.subscribe( message, function(){
252
+ // before func apply, unsubscribe message
253
+ PubSub.unsubscribe( token );
254
+ func.apply( this, arguments );
255
+ });
256
+ return PubSub;
257
+ };
258
+
259
+ /**
260
+ * Clears all subscriptions
261
+ * @function
262
+ * @public
263
+ * @alias clearAllSubscriptions
264
+ */
265
+ PubSub.clearAllSubscriptions = function clearAllSubscriptions(){
266
+ messages = {};
267
+ };
268
+
269
+ /**
270
+ * Clear subscriptions by the topic
271
+ * @function
272
+ * @public
273
+ * @alias clearAllSubscriptions
274
+ * @return { int }
275
+ */
276
+ PubSub.clearSubscriptions = function clearSubscriptions(topic){
277
+ var m;
278
+ for (m in messages){
279
+ if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){
280
+ delete messages[m];
281
+ }
282
+ }
283
+ };
284
+
285
+ /**
286
+ Count subscriptions by the topic
287
+ * @function
288
+ * @public
289
+ * @alias countSubscriptions
290
+ * @return { Array }
291
+ */
292
+ PubSub.countSubscriptions = function countSubscriptions(topic){
293
+ var m;
294
+ // eslint-disable-next-line no-unused-vars
295
+ var token;
296
+ var count = 0;
297
+ for (m in messages) {
298
+ if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0) {
299
+ for (token in messages[m]) {
300
+ count++;
301
+ }
302
+ break;
303
+ }
304
+ }
305
+ return count;
306
+ };
307
+
308
+
309
+ /**
310
+ Gets subscriptions by the topic
311
+ * @function
312
+ * @public
313
+ * @alias getSubscriptions
314
+ */
315
+ PubSub.getSubscriptions = function getSubscriptions(topic){
316
+ var m;
317
+ var list = [];
318
+ for (m in messages){
319
+ if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){
320
+ list.push(m);
321
+ }
322
+ }
323
+ return list;
324
+ };
325
+
326
+ /**
327
+ * Removes subscriptions
328
+ *
329
+ * - When passed a token, removes a specific subscription.
330
+ *
331
+ * - When passed a function, removes all subscriptions for that function
332
+ *
333
+ * - When passed a topic, removes all subscriptions for that topic (hierarchy)
334
+ * @function
335
+ * @public
336
+ * @alias subscribeOnce
337
+ * @param { String | Function } value A token, function or topic to unsubscribe from
338
+ * @example // Unsubscribing with a token
339
+ * var token = PubSub.subscribe('mytopic', myFunc);
340
+ * PubSub.unsubscribe(token);
341
+ * @example // Unsubscribing with a function
342
+ * PubSub.unsubscribe(myFunc);
343
+ * @example // Unsubscribing from a topic
344
+ * PubSub.unsubscribe('mytopic');
345
+ */
346
+ PubSub.unsubscribe = function(value){
347
+ var descendantTopicExists = function(topic) {
348
+ var m;
349
+ for ( m in messages ){
350
+ if ( Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0 ){
351
+ // a descendant of the topic exists:
352
+ return true;
353
+ }
354
+ }
355
+
356
+ return false;
357
+ },
358
+ isTopic = typeof value === 'string' && ( Object.prototype.hasOwnProperty.call(messages, value) || descendantTopicExists(value) ),
359
+ isToken = !isTopic && typeof value === 'string',
360
+ isFunction = typeof value === 'function',
361
+ result = false,
362
+ m, message, t;
363
+
364
+ if (isTopic){
365
+ PubSub.clearSubscriptions(value);
366
+ return;
367
+ }
368
+
369
+ for ( m in messages ){
370
+ if ( Object.prototype.hasOwnProperty.call( messages, m ) ){
371
+ message = messages[m];
372
+
373
+ if ( isToken && message[value] ){
374
+ delete message[value];
375
+ result = value;
376
+ // tokens are unique, so we can just stop here
377
+ break;
378
+ }
379
+
380
+ if (isFunction) {
381
+ for ( t in message ){
382
+ if (Object.prototype.hasOwnProperty.call(message, t) && message[t] === value){
383
+ delete message[t];
384
+ result = true;
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+
391
+ return result;
392
+ };
393
+ }));
394
+ });
395
+ pubsub.PubSub;
396
+
397
+ var urlResolveBrowser = urlResolve;
398
+
399
+ /*
400
+ The majority of the module is built by following RFC1808
401
+ url: https://tools.ietf.org/html/rfc1808
402
+ */
403
+
404
+ // adds a slash at end if not present
405
+ function _addSlash (url) {
406
+ return url + (url[url.length-1] === '/' ? '' : '/');
407
+ }
408
+
409
+ // resolve the ..'s (directory up) and such
410
+ function _pathResolve (path) {
411
+ let pathSplit = path.split('/');
412
+
413
+ // happens when path starts with /
414
+ if (pathSplit[0] === '') {
415
+ pathSplit = pathSplit.slice(1);
416
+ }
417
+
418
+ // let segmentCount = 0; // number of segments that have been passed
419
+ let resultArray = [];
420
+ pathSplit.forEach((current, index) => {
421
+ // skip occurances of '.'
422
+ if (current !== '.') {
423
+ if (current === '..') {
424
+ resultArray.pop(); // remove previous
425
+ } else if (current !== '' || index === pathSplit.length - 1) {
426
+ resultArray.push(current);
427
+ }
428
+ }
429
+ });
430
+ return '/' + resultArray.join('/');
431
+ }
432
+
433
+ // parses a base url string into an object containing host, path and query
434
+ function _baseParse (base) {
435
+ const resultObject = {
436
+ host: '',
437
+ path: '',
438
+ query: '',
439
+ protocol: ''
440
+ };
441
+
442
+ let path = base;
443
+ let protocolEndIndex = base.indexOf('//');
444
+
445
+ resultObject.protocol = path.substring(0, protocolEndIndex);
446
+
447
+ protocolEndIndex += 2; // add two to pass double slash
448
+
449
+ const pathIndex = base.indexOf('/', protocolEndIndex);
450
+ const queryIndex = base.indexOf('?');
451
+ const hashIndex = base.indexOf('#');
452
+
453
+ if (hashIndex !== -1) {
454
+ path = path.substring(0, hashIndex); // remove hash, not needed for base
455
+ }
456
+
457
+ if (queryIndex !== -1) {
458
+ const query = path.substring(queryIndex); // remove query, save in return obj
459
+ resultObject.query = query;
460
+ path = path.substring(0, queryIndex);
461
+ }
462
+
463
+ if (pathIndex !== -1) {
464
+ const host = path.substring(0, pathIndex); // separate host & path
465
+ resultObject.host = host;
466
+ path = path.substring(pathIndex);
467
+ resultObject.path = path;
468
+ } else {
469
+ resultObject.host = path; // there was no path, therefore path is host
470
+ }
471
+
472
+ return resultObject;
473
+ }
474
+
475
+ // https://tools.ietf.org/html/rfc3986#section-3.1
476
+ const _scheme = '[a-z][a-z0-9+.-]*'; // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )]
477
+ const _isAbsolute = new RegExp(`^(${_scheme}:)?//`, 'i');
478
+
479
+ // parses a relative url string into an object containing the href,
480
+ // hash, query and whether it is a net path, absolute path or relative path
481
+ function _relativeParse (relative) {
482
+ const resultObject = {
483
+ href: relative, // href is always what was passed through
484
+ hash: '',
485
+ query: '',
486
+ netPath: false,
487
+ absolutePath: false,
488
+ relativePath: false
489
+ };
490
+ // check for protocol
491
+ // if protocol exists, is net path (absolute URL)
492
+ if (_isAbsolute.test(relative)) {
493
+ resultObject.netPath = true;
494
+ // return, in this case the relative is the resolved url, no need to parse.
495
+ return resultObject;
496
+ }
497
+
498
+ // if / is first, this is an absolute path,
499
+ // I.E. it overwrites the base URL's path
500
+ if (relative[0] === '/') {
501
+ resultObject.absolutePath = true;
502
+ // return resultObject
503
+ } else if (relative !== '') {
504
+ resultObject.relativePath = true;
505
+ }
506
+
507
+ let path = relative;
508
+ const queryIndex = relative.indexOf('?');
509
+ const hashIndex = relative.indexOf('#');
510
+
511
+ if (hashIndex !== -1) {
512
+ const hash = path.substring(hashIndex);
513
+ resultObject.hash = hash;
514
+ path = path.substring(0, hashIndex);
515
+ }
516
+
517
+ if (queryIndex !== -1) {
518
+ const query = path.substring(queryIndex);
519
+ resultObject.query = query;
520
+ path = path.substring(0, queryIndex);
521
+ }
522
+
523
+ resultObject.path = path; // whatever is left is path
524
+ return resultObject;
525
+ }
526
+
527
+ function _shouldAddSlash (url) {
528
+ const protocolIndex = url.indexOf('//') + 2;
529
+ const noPath = !(url.includes('/', protocolIndex));
530
+ const noQuery = !(url.includes('?', protocolIndex));
531
+ const noHash = !(url.includes('#', protocolIndex));
532
+ return (noPath && noQuery && noHash);
533
+ }
534
+
535
+ function _shouldAddProtocol (url) {
536
+ return url.startsWith('//');
537
+ }
538
+
539
+ /*
540
+ * PRECONDITION: Base is a fully qualified URL. e.g. http://example.com/
541
+ * optional: path, query or hash
542
+ * returns the resolved url
543
+ */
544
+ function urlResolve (base, relative) {
545
+ base = base.trim();
546
+ relative = relative.trim();
547
+
548
+ // about is always absolute
549
+ if (relative.startsWith('about:')) {
550
+ return relative;
551
+ }
552
+
553
+ const baseObj = _baseParse(base);
554
+ const relativeObj = _relativeParse(relative);
555
+
556
+ if (!baseObj.protocol && !relativeObj.netPath) {
557
+ throw new Error('Error, protocol is not specified');
558
+ }
559
+
560
+ if (relativeObj.netPath) { // relative is full qualified URL
561
+ if (_shouldAddProtocol(relativeObj.href)) {
562
+ relativeObj.href = baseObj.protocol + relativeObj.href;
563
+ }
564
+
565
+ if (_shouldAddSlash(relativeObj.href)) {
566
+ return _addSlash(relativeObj.href);
567
+ }
568
+
569
+ return relativeObj.href;
570
+ } else if (relativeObj.absolutePath) { // relative is an absolute path
571
+ const {path, query, hash} = relativeObj;
572
+
573
+ return baseObj.host + _pathResolve(path) + query + hash;
574
+ } else if (relativeObj.relativePath) { // relative is a relative path
575
+ const {path, query, hash} = relativeObj;
576
+
577
+ let basePath = baseObj.path;
578
+ let resultString = baseObj.host;
579
+
580
+ let resolvePath;
581
+
582
+ if (path.length === 0) {
583
+ resolvePath = basePath;
584
+ } else {
585
+ // remove last segment if no slash at end
586
+ basePath = basePath.substring(0, basePath.lastIndexOf('/'));
587
+ resolvePath = _pathResolve(basePath + '/' + path);
588
+ }
589
+
590
+ // if result is just the base host, add /
591
+ if ((resolvePath === '') && (!query) && (!hash)) {
592
+ resultString += '/';
593
+ } else {
594
+ resultString += resolvePath + query + hash;
595
+ }
596
+
597
+ return resultString;
598
+ } else {
599
+ const {host, path, query} = baseObj;
600
+ // when path and query aren't supplied add slash
601
+ if ((!path) && (!query)) {
602
+ return _addSlash(host);
603
+ }
604
+ return host + path + query + relativeObj.hash;
605
+ }
606
+ }
607
+
608
+ const isObject$1 = (value) => typeof value === "object" && !Array.isArray(value) && value !== null;
609
+ const isType = {
610
+ null: (value) => value === null,
611
+ boolean: (value) => typeof value === "boolean",
612
+ object: isObject$1,
613
+ array: (value) => Array.isArray(value),
614
+ number: (value) => typeof value === "number",
615
+ integer: (value) => Number.isInteger(value),
616
+ string: (value) => typeof value === "string"
617
+ };
618
+ const jsonTypeOf$2 = (value, type) => isType[type](value);
619
+
620
+ const splitUrl$4 = (url) => {
621
+ const indexOfHash = url.indexOf("#");
622
+ const ndx = indexOfHash === -1 ? url.length : indexOfHash;
623
+ const urlReference = url.slice(0, ndx);
624
+ const urlFragment = url.slice(ndx + 1);
625
+
626
+ return [decodeURI(urlReference), decodeURI(urlFragment)];
627
+ };
628
+
629
+ const getScheme = (url) => {
630
+ const matches = RegExp(/^(.+):\/\//).exec(url);
631
+ return matches ? matches[1] : "";
632
+ };
633
+
634
+ const safeResolveUrl$1 = (contextUrl, url) => {
635
+ const resolvedUrl = urlResolveBrowser(contextUrl, url);
636
+ const contextId = splitUrl$4(contextUrl)[0];
637
+ if (contextId && getScheme(resolvedUrl) === "file" && getScheme(contextId) !== "file") {
638
+ throw Error(`Can't access file '${resolvedUrl}' resource from network context '${contextUrl}'`);
639
+ }
640
+ return resolvedUrl;
641
+ };
642
+
643
+ var common$1 = { jsonTypeOf: jsonTypeOf$2, splitUrl: splitUrl$4, safeResolveUrl: safeResolveUrl$1 };
644
+
645
+ const nil$2 = "";
646
+
647
+ const compile$P = (pointer) => {
648
+ if (pointer.length > 0 && pointer[0] !== "/") {
649
+ throw Error("Invalid JSON Pointer");
650
+ }
651
+
652
+ return pointer.split("/").slice(1).map(unescape);
653
+ };
654
+
655
+ const get$1 = (pointer, value = undefined) => {
656
+ const ptr = compile$P(pointer);
657
+
658
+ const fn = (value) => ptr.reduce(([value, pointer], segment) => {
659
+ return [applySegment(value, segment, pointer), append(segment, pointer)];
660
+ }, [value, ""])[0];
661
+
662
+ return value === undefined ? fn : fn(value);
663
+ };
664
+
665
+ const set = (pointer, subject = undefined, value = undefined) => {
666
+ const ptr = compile$P(pointer);
667
+ const fn = justCurryIt((subject, value) => _set(ptr, subject, value, nil$2));
668
+ return subject === undefined ? fn : fn(subject, value);
669
+ };
670
+
671
+ const _set = (pointer, subject, value, cursor) => {
672
+ if (pointer.length === 0) {
673
+ return value;
674
+ } else if (pointer.length > 1) {
675
+ const segment = pointer.shift();
676
+ return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
677
+ } else if (Array.isArray(subject)) {
678
+ const clonedSubject = [...subject];
679
+ const segment = computeSegment(subject, pointer[0]);
680
+ clonedSubject[segment] = value;
681
+ return clonedSubject;
682
+ } else if (typeof subject === "object" && subject !== null) {
683
+ return { ...subject, [pointer[0]]: value };
684
+ } else {
685
+ return applySegment(subject, pointer[0], cursor);
686
+ }
687
+ };
688
+
689
+ const assign = (pointer, subject = undefined, value = undefined) => {
690
+ const ptr = compile$P(pointer);
691
+ const fn = justCurryIt((subject, value) => _assign(ptr, subject, value, nil$2));
692
+ return subject === undefined ? fn : fn(subject, value);
693
+ };
694
+
695
+ const _assign = (pointer, subject, value, cursor) => {
696
+ if (pointer.length === 0) {
697
+ return;
698
+ } else if (pointer.length === 1 && !isScalar(subject)) {
699
+ const segment = computeSegment(subject, pointer[0]);
700
+ subject[segment] = value;
701
+ } else {
702
+ const segment = pointer.shift();
703
+ _assign(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor));
704
+ }
705
+ };
706
+
707
+ const unset = (pointer, subject = undefined) => {
708
+ const ptr = compile$P(pointer);
709
+ const fn = (subject) => _unset(ptr, subject, nil$2);
710
+ return subject === undefined ? fn : fn(subject);
711
+ };
712
+
713
+ const _unset = (pointer, subject, cursor) => {
714
+ if (pointer.length == 0) {
715
+ return undefined;
716
+ } else if (pointer.length > 1) {
717
+ const segment = pointer.shift();
718
+ const value = applySegment(subject, segment, cursor);
719
+ return { ...subject, [segment]: _unset(pointer, value, append(segment, cursor)) };
720
+ } else if (Array.isArray(subject)) {
721
+ return subject.filter((_, ndx) => ndx != pointer[0]);
722
+ } else if (typeof subject === "object" && subject !== null) {
723
+ // eslint-disable-next-line no-unused-vars
724
+ const { [pointer[0]]: _, ...result } = subject;
725
+ return result;
726
+ } else {
727
+ return applySegment(subject, pointer[0], cursor);
728
+ }
729
+ };
730
+
731
+ const remove = (pointer, subject = undefined) => {
732
+ const ptr = compile$P(pointer);
733
+ const fn = (subject) => _remove(ptr, subject, nil$2);
734
+ return subject === undefined ? fn : fn(subject);
735
+ };
736
+
737
+ const _remove = (pointer, subject, cursor) => {
738
+ if (pointer.length === 0) {
739
+ return;
740
+ } else if (pointer.length > 1) {
741
+ const segment = pointer.shift();
742
+ const value = applySegment(subject, segment, cursor);
743
+ _remove(pointer, value, append(segment, cursor));
744
+ } else if (Array.isArray(subject)) {
745
+ subject.splice(pointer[0], 1);
746
+ } else if (typeof subject === "object" && subject !== null) {
747
+ delete subject[pointer[0]];
748
+ } else {
749
+ applySegment(subject, pointer[0], cursor);
750
+ }
751
+ };
752
+
753
+ const append = justCurryIt((segment, pointer) => pointer + "/" + escape(segment));
754
+
755
+ const escape = (segment) => segment.toString().replace(/~/g, "~0").replace(/\//g, "~1");
756
+ const unescape = (segment) => segment.toString().replace(/~1/g, "/").replace(/~0/g, "~");
757
+ const computeSegment = (value, segment) => Array.isArray(value) && segment === "-" ? value.length : segment;
758
+
759
+ const applySegment = (value, segment, cursor = "") => {
760
+ if (value === undefined) {
761
+ throw TypeError(`Value at '${cursor}' is undefined and does not have property '${segment}'`);
762
+ } else if (value === null) {
763
+ throw TypeError(`Value at '${cursor}' is null and does not have property '${segment}'`);
764
+ } else if (isScalar(value)) {
765
+ throw TypeError(`Value at '${cursor}' is a ${typeof value} and does not have property '${segment}'`);
766
+ } else {
767
+ const computedSegment = computeSegment(value, segment);
768
+ return value[computedSegment];
769
+ }
770
+ };
771
+
772
+ const isScalar = (value) => value === null || typeof value !== "object";
773
+
774
+ var lib$3 = { nil: nil$2, append, get: get$1, set, assign, unset, remove };
775
+ lib$3.nil;
776
+ lib$3.append;
777
+ lib$3.get;
778
+ lib$3.set;
779
+ lib$3.assign;
780
+ lib$3.unset;
781
+ lib$3.remove;
782
+
783
+ const $__value = Symbol("$__value");
784
+ const $__href = Symbol("$__href");
785
+
786
+ const cons$1 = (href, value) => Object.freeze({
787
+ [$__href]: href,
788
+ [$__value]: value
789
+ });
790
+
791
+ const isReference = (ref) => ref && ref[$__href] !== undefined;
792
+ const href = (ref) => ref[$__href];
793
+ const value$2 = (ref) => ref[$__value];
794
+
795
+ var reference = { cons: cons$1, isReference, href, value: value$2 };
796
+
797
+ const { jsonTypeOf: jsonTypeOf$1 } = common$1;
798
+
799
+
800
+
801
+ const nil$1 = Object.freeze({ id: "", pointer: "", instance: undefined, value: undefined });
802
+ const cons = (instance, id = "") => Object.freeze({ ...nil$1, id, instance, value: instance });
803
+ const uri$1 = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;
804
+ const value$1 = (doc) => reference.isReference(doc.value) ? reference.value(doc.value) : doc.value;
805
+ const has$1 = (key, doc) => key in value$1(doc);
806
+ const typeOf$1 = justCurryIt((doc, type) => jsonTypeOf$1(value$1(doc), type));
807
+
808
+ const step$1 = (key, doc) => Object.freeze({
809
+ ...doc,
810
+ pointer: lib$3.append(key, doc.pointer),
811
+ value: value$1(doc)[key]
812
+ });
813
+
814
+ const entries$2 = (doc) => Object.keys(value$1(doc))
815
+ .map((key) => [key, step$1(key, doc)]);
816
+
817
+ const keys$1 = (doc) => Object.keys(value$1(doc));
818
+
819
+ const map$2 = justCurryIt((fn, doc) => value$1(doc)
820
+ .map((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
821
+
822
+ const filter$1 = justCurryIt((fn, doc) => value$1(doc)
823
+ .map((item, ndx, array, thisArg) => step$1(ndx, doc))
824
+ .filter((item, ndx, array, thisArg) => fn(item, ndx, array, thisArg)));
825
+
826
+ const reduce$1 = justCurryIt((fn, acc, doc) => value$1(doc)
827
+ .reduce((acc, item, ndx) => fn(acc, step$1(ndx, doc), ndx), acc));
828
+
829
+ const every$1 = justCurryIt((fn, doc) => value$1(doc)
830
+ .every((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
831
+
832
+ const some$1 = justCurryIt((fn, doc) => value$1(doc)
833
+ .some((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
834
+
835
+ const length$1 = (doc) => value$1(doc).length;
836
+
837
+ var instance = { nil: nil$1, cons, uri: uri$1, value: value$1, has: has$1, typeOf: typeOf$1, step: step$1, entries: entries$2, keys: keys$1, map: map$2, filter: filter$1, reduce: reduce$1, every: every$1, some: some$1, length: length$1 };
838
+ instance.nil;
839
+ instance.cons;
840
+ instance.uri;
841
+ instance.value;
842
+ instance.has;
843
+ instance.typeOf;
844
+ instance.step;
845
+ instance.entries;
846
+ instance.keys;
847
+ instance.map;
848
+ instance.filter;
849
+ instance.reduce;
850
+ instance.every;
851
+ instance.some;
852
+ instance.length;
853
+
854
+ /*!
855
+ * content-type
856
+ * Copyright(c) 2015 Douglas Christopher Wilson
857
+ * MIT Licensed
858
+ */
859
+
860
+ /**
861
+ * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
862
+ *
863
+ * parameter = token "=" ( token / quoted-string )
864
+ * token = 1*tchar
865
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
866
+ * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
867
+ * / DIGIT / ALPHA
868
+ * ; any VCHAR, except delimiters
869
+ * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
870
+ * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
871
+ * obs-text = %x80-FF
872
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
873
+ */
874
+ var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
875
+ var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;
876
+ var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
877
+
878
+ /**
879
+ * RegExp to match quoted-pair in RFC 7230 sec 3.2.6
880
+ *
881
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
882
+ * obs-text = %x80-FF
883
+ */
884
+ var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
885
+
886
+ /**
887
+ * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
888
+ */
889
+ var QUOTE_REGEXP = /([\\"])/g;
890
+
891
+ /**
892
+ * RegExp to match type in RFC 7231 sec 3.1.1.1
893
+ *
894
+ * media-type = type "/" subtype
895
+ * type = token
896
+ * subtype = token
897
+ */
898
+ var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
899
+
900
+ /**
901
+ * Module exports.
902
+ * @public
903
+ */
904
+
905
+ var format_1 = format$1;
906
+ var parse_1 = parse;
907
+
908
+ /**
909
+ * Format object to media type.
910
+ *
911
+ * @param {object} obj
912
+ * @return {string}
913
+ * @public
914
+ */
915
+
916
+ function format$1 (obj) {
917
+ if (!obj || typeof obj !== 'object') {
918
+ throw new TypeError('argument obj is required')
919
+ }
920
+
921
+ var parameters = obj.parameters;
922
+ var type = obj.type;
923
+
924
+ if (!type || !TYPE_REGEXP.test(type)) {
925
+ throw new TypeError('invalid type')
926
+ }
927
+
928
+ var string = type;
929
+
930
+ // append parameters
931
+ if (parameters && typeof parameters === 'object') {
932
+ var param;
933
+ var params = Object.keys(parameters).sort();
934
+
935
+ for (var i = 0; i < params.length; i++) {
936
+ param = params[i];
937
+
938
+ if (!TOKEN_REGEXP.test(param)) {
939
+ throw new TypeError('invalid parameter name')
940
+ }
941
+
942
+ string += '; ' + param + '=' + qstring(parameters[param]);
943
+ }
944
+ }
945
+
946
+ return string
947
+ }
948
+
949
+ /**
950
+ * Parse media type to object.
951
+ *
952
+ * @param {string|object} string
953
+ * @return {Object}
954
+ * @public
955
+ */
956
+
957
+ function parse (string) {
958
+ if (!string) {
959
+ throw new TypeError('argument string is required')
960
+ }
961
+
962
+ // support req/res-like objects as argument
963
+ var header = typeof string === 'object'
964
+ ? getcontenttype(string)
965
+ : string;
966
+
967
+ if (typeof header !== 'string') {
968
+ throw new TypeError('argument string is required to be a string')
969
+ }
970
+
971
+ var index = header.indexOf(';');
972
+ var type = index !== -1
973
+ ? header.substr(0, index).trim()
974
+ : header.trim();
975
+
976
+ if (!TYPE_REGEXP.test(type)) {
977
+ throw new TypeError('invalid media type')
978
+ }
979
+
980
+ var obj = new ContentType(type.toLowerCase());
981
+
982
+ // parse parameters
983
+ if (index !== -1) {
984
+ var key;
985
+ var match;
986
+ var value;
987
+
988
+ PARAM_REGEXP.lastIndex = index;
989
+
990
+ while ((match = PARAM_REGEXP.exec(header))) {
991
+ if (match.index !== index) {
992
+ throw new TypeError('invalid parameter format')
993
+ }
994
+
995
+ index += match[0].length;
996
+ key = match[1].toLowerCase();
997
+ value = match[2];
998
+
999
+ if (value[0] === '"') {
1000
+ // remove quotes and escapes
1001
+ value = value
1002
+ .substr(1, value.length - 2)
1003
+ .replace(QESC_REGEXP, '$1');
1004
+ }
1005
+
1006
+ obj.parameters[key] = value;
1007
+ }
1008
+
1009
+ if (index !== header.length) {
1010
+ throw new TypeError('invalid parameter format')
1011
+ }
1012
+ }
1013
+
1014
+ return obj
1015
+ }
1016
+
1017
+ /**
1018
+ * Get content-type from req/res objects.
1019
+ *
1020
+ * @param {object}
1021
+ * @return {Object}
1022
+ * @private
1023
+ */
1024
+
1025
+ function getcontenttype (obj) {
1026
+ var header;
1027
+
1028
+ if (typeof obj.getHeader === 'function') {
1029
+ // res-like
1030
+ header = obj.getHeader('content-type');
1031
+ } else if (typeof obj.headers === 'object') {
1032
+ // req-like
1033
+ header = obj.headers && obj.headers['content-type'];
1034
+ }
1035
+
1036
+ if (typeof header !== 'string') {
1037
+ throw new TypeError('content-type header is missing from object')
1038
+ }
1039
+
1040
+ return header
1041
+ }
1042
+
1043
+ /**
1044
+ * Quote a string if necessary.
1045
+ *
1046
+ * @param {string} val
1047
+ * @return {string}
1048
+ * @private
1049
+ */
1050
+
1051
+ function qstring (val) {
1052
+ var str = String(val);
1053
+
1054
+ // no need to quote tokens
1055
+ if (TOKEN_REGEXP.test(str)) {
1056
+ return str
1057
+ }
1058
+
1059
+ if (str.length > 0 && !TEXT_REGEXP.test(str)) {
1060
+ throw new TypeError('invalid parameter value')
1061
+ }
1062
+
1063
+ return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'
1064
+ }
1065
+
1066
+ /**
1067
+ * Class to represent a content type.
1068
+ * @private
1069
+ */
1070
+ function ContentType (type) {
1071
+ this.parameters = Object.create(null);
1072
+ this.type = type;
1073
+ }
1074
+
1075
+ var contentType = {
1076
+ format: format_1,
1077
+ parse: parse_1
1078
+ };
1079
+
1080
+ var entries$1 = async (doc) => Object.entries(await doc);
1081
+
1082
+ var map$1 = justCurryIt(async (fn, doc) => (await doc).map(fn));
1083
+
1084
+ var reduce = justCurryIt(async (fn, acc, doc) => {
1085
+ return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
1086
+ });
1087
+
1088
+ var filter = justCurryIt(async (fn, doc, options = {}) => {
1089
+ return reduce(async (acc, item) => {
1090
+ return (await fn(item)) ? acc.concat([item]) : acc;
1091
+ }, [], doc, options);
1092
+ });
1093
+
1094
+ var some = justCurryIt(async (fn, doc) => {
1095
+ const results = await map$1(fn, doc);
1096
+ return (await Promise.all(results))
1097
+ .some((a) => a);
1098
+ });
1099
+
1100
+ var every = justCurryIt(async (fn, doc) => {
1101
+ const results = await map$1(fn, doc);
1102
+ return (await Promise.all(results))
1103
+ .every((a) => a);
1104
+ });
1105
+
1106
+ var pipeline = justCurryIt((fns, doc) => {
1107
+ return fns.reduce(async (acc, fn) => fn(await acc), doc);
1108
+ });
1109
+
1110
+ var all = (doc) => Promise.all(doc);
1111
+
1112
+ var allValues = (doc) => {
1113
+ return pipeline([
1114
+ entries$1,
1115
+ reduce(async (acc, [propertyName, propertyValue]) => {
1116
+ acc[propertyName] = await propertyValue;
1117
+ return acc;
1118
+ }, {})
1119
+ ], doc);
1120
+ };
1121
+
1122
+ var lib$2 = {
1123
+ entries: entries$1,
1124
+ map: map$1,
1125
+ filter: filter,
1126
+ reduce: reduce,
1127
+ some: some,
1128
+ every: every,
1129
+ pipeline: pipeline,
1130
+ all: all,
1131
+ allValues: allValues
1132
+ };
1133
+ lib$2.entries;
1134
+ lib$2.map;
1135
+ lib$2.filter;
1136
+ lib$2.reduce;
1137
+ lib$2.some;
1138
+ lib$2.every;
1139
+ lib$2.pipeline;
1140
+ lib$2.all;
1141
+ lib$2.allValues;
1142
+
1143
+ var fetch_browser = fetch;
1144
+
1145
+ const { jsonTypeOf, splitUrl: splitUrl$3, safeResolveUrl } = common$1;
1146
+
1147
+
1148
+
1149
+
1150
+ // Config
1151
+ const config = {};
1152
+ const configAlias = {};
1153
+
1154
+ const setConfig = (schemaVersion, key, value) => {
1155
+ if (!config[schemaVersion]) {
1156
+ config[schemaVersion] = {};
1157
+ }
1158
+ config[schemaVersion][key] = value;
1159
+ };
1160
+
1161
+ const getConfig = (schemaVersion, key) => {
1162
+ const configVersion = schemaVersion in configAlias ? configAlias[schemaVersion] : schemaVersion;
1163
+ if (configVersion in config) {
1164
+ return config[configVersion][key];
1165
+ }
1166
+ };
1167
+
1168
+ // Schema Management
1169
+ const schemaStore = {};
1170
+ const schemaStoreAlias = {};
1171
+
1172
+ const add$1 = (schema, url = "", defaultSchemaVersion = "") => {
1173
+ schema = JSON.parse(JSON.stringify(schema));
1174
+
1175
+ // Schema Version
1176
+ const schemaVersion = splitUrl$3(schema["$schema"] || defaultSchemaVersion)[0];
1177
+ if (!schemaVersion) {
1178
+ throw Error("Couldn't determine schema version");
1179
+ }
1180
+ delete schema["$schema"];
1181
+
1182
+ // Identifier
1183
+ const baseToken = getConfig(schemaVersion, "baseToken");
1184
+ const anchorToken = getConfig(schemaVersion, "anchorToken");
1185
+ const externalId = splitUrl$3(url)[0];
1186
+ if (!externalId && !splitUrl$3(schema[baseToken] || "")[0]) {
1187
+ throw Error("Couldn't determine an identifier for the schema");
1188
+ }
1189
+ const internalUrl = safeResolveUrl(externalId, schema[baseToken] || "");
1190
+ const [id, fragment] = splitUrl$3(internalUrl);
1191
+ delete schema[baseToken];
1192
+ if (fragment && baseToken === anchorToken) {
1193
+ schema[anchorToken] = anchorToken !== baseToken ? encodeURI(fragment) : `#${encodeURI(fragment)}`;
1194
+ }
1195
+ if (externalId) {
1196
+ schemaStoreAlias[externalId] = id;
1197
+ }
1198
+
1199
+ // recursiveAnchor
1200
+ const dynamicAnchors = {};
1201
+ const recursiveAnchorToken = getConfig(schemaVersion, "recursiveAnchorToken");
1202
+ if (schema[recursiveAnchorToken] === true) {
1203
+ dynamicAnchors[""] = `${id}#`;
1204
+ schema[anchorToken] = "";
1205
+ delete schema[recursiveAnchorToken];
1206
+ }
1207
+
1208
+ // Vocabulary
1209
+ let vocabulary;
1210
+ const vocabularyToken = getConfig(schemaVersion, "vocabularyToken");
1211
+ if (jsonTypeOf(schema[vocabularyToken], "object")) {
1212
+ configAlias[id] = schemaVersion;
1213
+ vocabulary = schema[vocabularyToken];
1214
+ delete schema[vocabularyToken];
1215
+ } else {
1216
+ configAlias[id] = schemaVersion;
1217
+ vocabulary = { [schemaVersion]: true };
1218
+ }
1219
+
1220
+ // Store Schema
1221
+ const anchors = { "": "" };
1222
+ schemaStore[id] = {
1223
+ id: id,
1224
+ schemaVersion: schemaVersion,
1225
+ schema: processSchema(schema, id, schemaVersion, lib$3.nil, anchors, dynamicAnchors),
1226
+ anchors: anchors,
1227
+ dynamicAnchors: dynamicAnchors,
1228
+ vocabulary: vocabulary,
1229
+ validated: false
1230
+ };
1231
+
1232
+ return schemaStore[id];
1233
+ };
1234
+
1235
+ const processSchema = (subject, id, schemaVersion, pointer, anchors, dynamicAnchors) => {
1236
+ if (jsonTypeOf(subject, "object")) {
1237
+ const embeddedSchemaVersion = typeof subject["$schema"] === "string" ? splitUrl$3(subject["$schema"])[0] : schemaVersion;
1238
+ const embeddedEmbeddedToken = getConfig(embeddedSchemaVersion, "embeddedToken");
1239
+ const embeddedAnchorToken = getConfig(embeddedSchemaVersion, "anchorToken");
1240
+ if (typeof subject[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || subject[embeddedEmbeddedToken][0] !== "#")) {
1241
+ const ref = safeResolveUrl(id, subject[embeddedEmbeddedToken]);
1242
+ subject[embeddedEmbeddedToken] = ref;
1243
+ add$1(subject, ref, schemaVersion);
1244
+ return reference.cons(subject[embeddedEmbeddedToken], subject);
1245
+ }
1246
+
1247
+ const anchorToken = getConfig(schemaVersion, "anchorToken");
1248
+ const dynamicAnchorToken = getConfig(schemaVersion, "dynamicAnchorToken");
1249
+ if (typeof subject[dynamicAnchorToken] === "string") {
1250
+ dynamicAnchors[subject[dynamicAnchorToken]] = `${id}#${encodeURI(pointer)}`;
1251
+ anchors[subject[dynamicAnchorToken]] = pointer;
1252
+ delete subject[dynamicAnchorToken];
1253
+ }
1254
+
1255
+ const embeddedToken = getConfig(schemaVersion, "embeddedToken");
1256
+ if (typeof subject[anchorToken] === "string") {
1257
+ const anchor = anchorToken !== embeddedToken ? subject[anchorToken] : subject[anchorToken].slice(1);
1258
+ anchors[anchor] = pointer;
1259
+ delete subject[anchorToken];
1260
+ }
1261
+
1262
+ const jrefToken = getConfig(schemaVersion, "jrefToken");
1263
+ if (typeof subject[jrefToken] === "string") {
1264
+ return reference.cons(subject[jrefToken], subject);
1265
+ }
1266
+
1267
+ for (const key in subject) {
1268
+ subject[key] = processSchema(subject[key], id, schemaVersion, lib$3.append(key, pointer), anchors, dynamicAnchors);
1269
+ }
1270
+
1271
+ return subject;
1272
+ } else if (Array.isArray(subject)) {
1273
+ return subject.map((item, ndx) => processSchema(item, id, schemaVersion, lib$3.append(ndx, pointer), anchors, dynamicAnchors));
1274
+ } else {
1275
+ return subject;
1276
+ }
1277
+ };
1278
+
1279
+ const hasStoredSchema = (id) => id in schemaStore || id in schemaStoreAlias;
1280
+ const getStoredSchema = (id) => schemaStore[schemaStoreAlias[id]] || schemaStore[id];
1281
+
1282
+ const markValidated = (id) => {
1283
+ schemaStore[id].validated = true;
1284
+ };
1285
+
1286
+ // Schema Retrieval
1287
+ const nil = Object.freeze({
1288
+ id: "",
1289
+ schemaVersion: undefined,
1290
+ vocabulary: {},
1291
+ pointer: lib$3.nil,
1292
+ schema: undefined,
1293
+ value: undefined,
1294
+ anchors: {},
1295
+ dynamicAnchors: {},
1296
+ validated: true
1297
+ });
1298
+
1299
+ const get = async (url, contextDoc = nil) => {
1300
+ const resolvedUrl = safeResolveUrl(uri(contextDoc), url);
1301
+ const [id, fragment] = splitUrl$3(resolvedUrl);
1302
+
1303
+ if (!hasStoredSchema(id)) {
1304
+ const response = await fetch_browser(id, { headers: { Accept: "application/schema+json" } });
1305
+ if (response.status >= 400) {
1306
+ await response.text(); // Sometimes node hangs without this hack
1307
+ throw Error(`Failed to retrieve schema with id: ${id}`);
1308
+ }
1309
+
1310
+ if (response.headers.has("content-type")) {
1311
+ const contentType$1 = contentType.parse(response.headers.get("content-type")).type;
1312
+ if (contentType$1 !== "application/schema+json") {
1313
+ throw Error(`${id} is not a schema. Found a document with media type: ${contentType$1}`);
1314
+ }
1315
+ }
1316
+
1317
+ add$1(await response.json(), id);
1318
+ }
1319
+
1320
+ const storedSchema = getStoredSchema(id);
1321
+ const pointer = fragment[0] !== "/" ? getAnchorPointer(storedSchema, fragment) : fragment;
1322
+ const doc = Object.freeze({
1323
+ ...storedSchema,
1324
+ pointer: pointer,
1325
+ value: lib$3.get(pointer, storedSchema.schema)
1326
+ });
1327
+
1328
+ return followReferences$1(doc);
1329
+ };
1330
+
1331
+ const followReferences$1 = (doc) => reference.isReference(doc.value) ? get(reference.href(doc.value), doc) : doc;
1332
+
1333
+ const getAnchorPointer = (schema, fragment) => {
1334
+ if (!(fragment in schema.anchors)) {
1335
+ throw Error(`No such anchor '${encodeURI(schema.id)}#${encodeURI(fragment)}'`);
1336
+ }
1337
+
1338
+ return schema.anchors[fragment];
1339
+ };
1340
+
1341
+ // Utility Functions
1342
+ const uri = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;
1343
+ const value = (doc) => reference.isReference(doc.value) ? reference.value(doc.value) : doc.value;
1344
+ const has = (key, doc) => key in value(doc);
1345
+ const typeOf = (doc, type) => jsonTypeOf(value(doc), type);
1346
+
1347
+ const step = (key, doc) => {
1348
+ const storedSchema = getStoredSchema(doc.id);
1349
+ const nextDoc = Object.freeze({
1350
+ ...doc,
1351
+ pointer: lib$3.append(key, doc.pointer),
1352
+ value: value(doc)[key],
1353
+ validated: storedSchema.validated
1354
+ });
1355
+ return followReferences$1(nextDoc);
1356
+ };
1357
+
1358
+ const keys = (doc) => Object.keys(value(doc));
1359
+
1360
+ const entries = (doc) => lib$2.pipeline([
1361
+ value,
1362
+ Object.keys,
1363
+ lib$2.map(async (key) => [key, await step(key, doc)]),
1364
+ lib$2.all
1365
+ ], doc);
1366
+
1367
+ const map = justCurryIt((fn, doc) => lib$2.pipeline([
1368
+ value,
1369
+ lib$2.map(async (item, ndx) => fn(await step(ndx, doc), ndx)),
1370
+ lib$2.all
1371
+ ], doc));
1372
+
1373
+ const length = (doc) => value(doc).length;
1374
+
1375
+ var schema$5 = {
1376
+ setConfig, getConfig,
1377
+ add: add$1, get, markValidated,
1378
+ uri, value, getAnchorPointer, typeOf, has, step, keys, entries, map, length
1379
+ };
1380
+ schema$5.setConfig;
1381
+ schema$5.getConfig;
1382
+ schema$5.add;
1383
+ schema$5.get;
1384
+ schema$5.markValidated;
1385
+ schema$5.uri;
1386
+ schema$5.value;
1387
+ schema$5.getAnchorPointer;
1388
+ schema$5.typeOf;
1389
+ schema$5.has;
1390
+ schema$5.step;
1391
+ schema$5.keys;
1392
+ schema$5.entries;
1393
+ schema$5.map;
1394
+ schema$5.length;
1395
+
1396
+ class InvalidSchemaError$1 extends Error {
1397
+ constructor(output) {
1398
+ super("Invalid Schema");
1399
+ this.name = this.constructor.name;
1400
+ this.output = output;
1401
+ }
1402
+ }
1403
+
1404
+ var invalidSchemaError = InvalidSchemaError$1;
1405
+
1406
+ const { splitUrl: splitUrl$2 } = common$1;
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+ const FLAG = "FLAG", BASIC = "BASIC", DETAILED = "DETAILED", VERBOSE = "VERBOSE";
1413
+
1414
+ let metaOutputFormat = DETAILED;
1415
+ let shouldMetaValidate = true;
1416
+
1417
+ const validate$1 = async (schema, value = undefined, outputFormat = undefined) => {
1418
+ const compiled = await compile$O(schema);
1419
+ const interpretAst = (value, outputFormat) => interpret$O(compiled, instance.cons(value), outputFormat);
1420
+
1421
+ return value === undefined ? interpretAst : interpretAst(value, outputFormat);
1422
+ };
1423
+
1424
+ const compile$O = async (schema) => {
1425
+ const ast = { metaData: {} };
1426
+ const schemaUri = await compileSchema(schema, ast);
1427
+ return { ast, schemaUri };
1428
+ };
1429
+
1430
+ const interpret$O = justCurryIt(({ ast, schemaUri }, value, outputFormat = FLAG) => {
1431
+ if (![FLAG, BASIC, DETAILED, VERBOSE].includes(outputFormat)) {
1432
+ throw Error(`The '${outputFormat}' error format is not supported`);
1433
+ }
1434
+
1435
+ const output = [];
1436
+ const subscriptionToken = pubsub.subscribe("result", outputHandler(outputFormat, output));
1437
+ interpretSchema(schemaUri, value, ast, {});
1438
+ pubsub.unsubscribe(subscriptionToken);
1439
+
1440
+ return output[0];
1441
+ });
1442
+
1443
+ const outputHandler = (outputFormat, output) => {
1444
+ const resultStack = [];
1445
+
1446
+ return (message, keywordResult) => {
1447
+ if (message === "result") {
1448
+ const { keyword, absoluteKeywordLocation, instanceLocation, valid } = keywordResult;
1449
+ const result = { keyword, absoluteKeywordLocation, instanceLocation, valid, errors: [] };
1450
+ resultStack.push(result);
1451
+ } else if (message === "result.start") {
1452
+ resultStack.push(message);
1453
+ } else if (message === "result.end") {
1454
+ const result = resultStack.pop();
1455
+ while (resultStack[resultStack.length - 1] !== "result.start") {
1456
+ const topResult = resultStack.pop();
1457
+
1458
+ const errors = [topResult];
1459
+ if (outputFormat === BASIC) {
1460
+ errors.push(...topResult.errors);
1461
+ delete topResult.errors;
1462
+ }
1463
+
1464
+ if (outputFormat === VERBOSE || (outputFormat !== FLAG && !topResult.valid)) {
1465
+ result.errors.unshift(...errors);
1466
+ }
1467
+ }
1468
+ resultStack[resultStack.length - 1] = result;
1469
+
1470
+ output[0] = result;
1471
+ }
1472
+ };
1473
+ };
1474
+
1475
+ const setMetaOutputFormat = (format) => {
1476
+ metaOutputFormat = format;
1477
+ };
1478
+
1479
+ const setShouldMetaValidate = (isEnabled) => {
1480
+ shouldMetaValidate = isEnabled;
1481
+ };
1482
+
1483
+ const _keywords = {};
1484
+ const getKeyword = (id) => _keywords[id];
1485
+ const hasKeyword = (id) => id in _keywords;
1486
+ const addKeyword = (id, keywordHandler) => {
1487
+ _keywords[id] = {
1488
+ collectEvaluatedItems: (keywordValue, instance, ast, dynamicAnchors, isTop) => keywordHandler.interpret(keywordValue, instance, ast, dynamicAnchors, isTop) && new Set(),
1489
+ collectEvaluatedProperties: (keywordValue, instance, ast, dynamicAnchors, isTop) => keywordHandler.interpret(keywordValue, instance, ast, dynamicAnchors, isTop) && [],
1490
+ ...keywordHandler
1491
+ };
1492
+ };
1493
+
1494
+ const _vocabularies = {};
1495
+ const defineVocabulary = (id, keywords) => {
1496
+ _vocabularies[id] = keywords;
1497
+ };
1498
+
1499
+ const metaValidators = {};
1500
+ const compileSchema = async (schema, ast) => {
1501
+ schema = await followReferences(schema);
1502
+
1503
+ // Vocabularies
1504
+ if (!hasKeyword(`${schema.schemaVersion}#validate`)) {
1505
+ const metaSchema = await schema$5.get(schema.schemaVersion);
1506
+
1507
+ // Check for mandatory vocabularies
1508
+ const mandatoryVocabularies = schema$5.getConfig(metaSchema.id, "mandatoryVocabularies") || [];
1509
+ mandatoryVocabularies.forEach((vocabularyId) => {
1510
+ if (!metaSchema.vocabulary[vocabularyId]) {
1511
+ throw Error(`Vocabulary '${vocabularyId}' must be explicitly declared and required`);
1512
+ }
1513
+ });
1514
+
1515
+ // Load vocabularies
1516
+ Object.entries(metaSchema.vocabulary)
1517
+ .forEach(([vocabularyId, isRequired]) => {
1518
+ if (vocabularyId in _vocabularies) {
1519
+ Object.entries(_vocabularies[vocabularyId])
1520
+ .forEach(([keyword, keywordHandler]) => {
1521
+ addKeyword(`${metaSchema.id}#${keyword}`, keywordHandler);
1522
+ });
1523
+ } else if (isRequired) {
1524
+ throw Error(`Missing required vocabulary: ${vocabularyId}`);
1525
+ }
1526
+ });
1527
+ }
1528
+
1529
+ // Meta validation
1530
+ if (shouldMetaValidate && !schema.validated) {
1531
+ schema$5.markValidated(schema.id);
1532
+
1533
+ // Compile
1534
+ if (!(schema.schemaVersion in metaValidators)) {
1535
+ const metaSchema = await schema$5.get(schema.schemaVersion);
1536
+ const compiledSchema = await compile$O(metaSchema);
1537
+ metaValidators[metaSchema.id] = interpret$O(compiledSchema);
1538
+ }
1539
+
1540
+ // Interpret
1541
+ const schemaInstance = instance.cons(schema.schema, schema.id);
1542
+ const metaResults = metaValidators[schema.schemaVersion](schemaInstance, metaOutputFormat);
1543
+ if (!metaResults.valid) {
1544
+ throw new invalidSchemaError(metaResults);
1545
+ }
1546
+ }
1547
+
1548
+ // Compile
1549
+ if (!(schema.id in ast.metaData)) {
1550
+ ast.metaData[schema.id] = {
1551
+ id: schema.id,
1552
+ dynamicAnchors: schema.dynamicAnchors,
1553
+ anchors: schema.anchors
1554
+ };
1555
+ }
1556
+ return getKeyword(`${schema.schemaVersion}#validate`).compile(schema, ast);
1557
+ };
1558
+
1559
+ const followReferences = async (doc) => {
1560
+ return schema$5.typeOf(doc, "string") ? followReferences(await schema$5.get(schema$5.value(doc), doc)) : doc;
1561
+ };
1562
+
1563
+ const interpretSchema = (schemaUri, instance, ast, dynamicAnchors) => {
1564
+ const keywordId = getKeywordId(schemaUri, ast);
1565
+ const id = splitUrl$2(schemaUri)[0];
1566
+ return getKeyword(keywordId).interpret(schemaUri, instance, ast, { ...ast.metaData[id].dynamicAnchors, ...dynamicAnchors });
1567
+ };
1568
+
1569
+ const collectEvaluatedProperties$e = (schemaUri, instance, ast, dynamicAnchors, isTop) => {
1570
+ const keywordId = getKeywordId(schemaUri, ast);
1571
+ return getKeyword(keywordId).collectEvaluatedProperties(schemaUri, instance, ast, dynamicAnchors, isTop);
1572
+ };
1573
+
1574
+ const collectEvaluatedItems$f = (schemaUri, instance, ast, dynamicAnchors, isTop) => {
1575
+ const keywordId = getKeywordId(schemaUri, ast);
1576
+ return getKeyword(keywordId).collectEvaluatedItems(schemaUri, instance, ast, dynamicAnchors, isTop);
1577
+ };
1578
+
1579
+ const getKeywordId = (schemaUri, ast) => {
1580
+ if (!(schemaUri in ast)) {
1581
+ throw Error(`No schema found at ${schemaUri}`);
1582
+ }
1583
+
1584
+ return ast[schemaUri][0];
1585
+ };
1586
+
1587
+ const add = (schema, url = "", defaultSchemaVersion = "") => {
1588
+ const doc = schema$5.add(schema, url, defaultSchemaVersion);
1589
+ delete metaValidators[doc.id];
1590
+
1591
+ return doc;
1592
+ };
1593
+
1594
+ var core$2 = {
1595
+ validate: validate$1, compile: compile$O, interpret: interpret$O,
1596
+ setMetaOutputFormat, setShouldMetaValidate, FLAG, BASIC, DETAILED, VERBOSE,
1597
+ add, getKeyword, hasKeyword, defineVocabulary,
1598
+ compileSchema, interpretSchema, collectEvaluatedProperties: collectEvaluatedProperties$e, collectEvaluatedItems: collectEvaluatedItems$f
1599
+ };
1600
+ core$2.validate;
1601
+ core$2.compile;
1602
+ core$2.interpret;
1603
+ core$2.setMetaOutputFormat;
1604
+ core$2.setShouldMetaValidate;
1605
+ core$2.FLAG;
1606
+ core$2.BASIC;
1607
+ core$2.DETAILED;
1608
+ core$2.VERBOSE;
1609
+ core$2.add;
1610
+ core$2.getKeyword;
1611
+ core$2.hasKeyword;
1612
+ core$2.defineVocabulary;
1613
+ core$2.compileSchema;
1614
+ core$2.interpretSchema;
1615
+ core$2.collectEvaluatedProperties;
1616
+ core$2.collectEvaluatedItems;
1617
+
1618
+ const compile$N = (schema) => schema$5.value(schema);
1619
+ const interpret$N = () => true;
1620
+
1621
+ var metaData$2 = { compile: compile$N, interpret: interpret$N };
1622
+ metaData$2.compile;
1623
+ metaData$2.interpret;
1624
+
1625
+ const compile$M = async (schema, ast) => {
1626
+ const url = schema$5.uri(schema);
1627
+ if (!(url in ast)) {
1628
+ ast[url] = false; // Place dummy entry in ast to avoid recursive loops
1629
+
1630
+ const schemaValue = schema$5.value(schema);
1631
+ if (!["object", "boolean"].includes(typeof schemaValue)) {
1632
+ throw Error(`No schema found at '${schema$5.uri(schema)}'`);
1633
+ }
1634
+
1635
+ ast[url] = [
1636
+ `${schema.schemaVersion}#validate`,
1637
+ schema$5.uri(schema),
1638
+ typeof schemaValue === "boolean" ? schemaValue : await lib$2.pipeline([
1639
+ schema$5.entries,
1640
+ lib$2.map(([keyword, keywordSchema]) => [`${schema.schemaVersion}#${keyword}`, keywordSchema]),
1641
+ lib$2.filter(([keywordId]) => core$2.hasKeyword(keywordId) && keywordId !== `${schema.schemaVersion}#validate`),
1642
+ lib$2.map(async ([keywordId, keywordSchema]) => {
1643
+ const keywordAst = await core$2.getKeyword(keywordId).compile(keywordSchema, ast, schema);
1644
+ return [keywordId, schema$5.uri(keywordSchema), keywordAst];
1645
+ }),
1646
+ lib$2.all
1647
+ ], schema)
1648
+ ];
1649
+ }
1650
+
1651
+ return url;
1652
+ };
1653
+
1654
+ const interpret$M = (uri, instance$1, ast, dynamicAnchors) => {
1655
+ const [keywordId, schemaUrl, nodes] = ast[uri];
1656
+
1657
+ pubsub.publishSync("result.start");
1658
+ const isValid = typeof nodes === "boolean" ? nodes : nodes
1659
+ .every(([keywordId, schemaUrl, keywordValue]) => {
1660
+ pubsub.publishSync("result.start");
1661
+ const isValid = core$2.getKeyword(keywordId).interpret(keywordValue, instance$1, ast, dynamicAnchors);
1662
+
1663
+ pubsub.publishSync("result", {
1664
+ keyword: keywordId,
1665
+ absoluteKeywordLocation: schemaUrl,
1666
+ instanceLocation: instance.uri(instance$1),
1667
+ valid: isValid,
1668
+ ast: keywordValue
1669
+ });
1670
+ pubsub.publishSync("result.end");
1671
+ return isValid;
1672
+ });
1673
+
1674
+ pubsub.publishSync("result", {
1675
+ keyword: keywordId,
1676
+ absoluteKeywordLocation: schemaUrl,
1677
+ instanceLocation: instance.uri(instance$1),
1678
+ valid: isValid,
1679
+ ast: uri
1680
+ });
1681
+ pubsub.publishSync("result.end");
1682
+ return isValid;
1683
+ };
1684
+
1685
+ const collectEvaluatedProperties$d = (uri, instance, ast, dynamicAnchors, isTop = false) => {
1686
+ const nodes = ast[uri][2];
1687
+
1688
+ if (typeof nodes === "boolean") {
1689
+ return nodes ? [] : false;
1690
+ }
1691
+
1692
+ return nodes
1693
+ .filter(([keywordId]) => !isTop || !keywordId.endsWith("#unevaluatedProperties"))
1694
+ .reduce((acc, [keywordId, , keywordValue]) => {
1695
+ const propertyNames = acc && core$2.getKeyword(keywordId).collectEvaluatedProperties(keywordValue, instance, ast, dynamicAnchors);
1696
+ return propertyNames !== false && [...acc, ...propertyNames];
1697
+ }, []);
1698
+ };
1699
+
1700
+ const collectEvaluatedItems$e = (uri, instance, ast, dynamicAnchors, isTop = false) => {
1701
+ const nodes = ast[uri][2];
1702
+
1703
+ if (typeof nodes === "boolean") {
1704
+ return nodes ? new Set() : false;
1705
+ }
1706
+
1707
+ return nodes
1708
+ .filter(([keywordId]) => !isTop || !keywordId.endsWith("#unevaluatedItems"))
1709
+ .reduce((acc, [keywordId, , keywordValue]) => {
1710
+ const itemIndexes = acc !== false && core$2.getKeyword(keywordId).collectEvaluatedItems(keywordValue, instance, ast, dynamicAnchors);
1711
+ return itemIndexes !== false && new Set([...acc, ...itemIndexes]);
1712
+ }, new Set());
1713
+ };
1714
+
1715
+ var validate = { compile: compile$M, interpret: interpret$M, collectEvaluatedProperties: collectEvaluatedProperties$d, collectEvaluatedItems: collectEvaluatedItems$e };
1716
+ validate.compile;
1717
+ validate.interpret;
1718
+ validate.collectEvaluatedProperties;
1719
+ validate.collectEvaluatedItems;
1720
+
1721
+ var keywords$1 = { metaData: metaData$2, validate };
1722
+ keywords$1.metaData;
1723
+ keywords$1.validate;
1724
+
1725
+ var lib$1 = { Core: core$2, Schema: schema$5, Instance: instance, Keywords: keywords$1 };
1726
+
1727
+ const { Core: Core$v, Schema: Schema$N, Instance: Instance$B } = lib$1;
1728
+
1729
+
1730
+ const compile$L = async (schema, ast, parentSchema) => {
1731
+ const items = await Schema$N.step("items", parentSchema);
1732
+ const numberOfItems = Schema$N.typeOf(items, "array") ? Schema$N.length(items) : Number.MAX_SAFE_INTEGER;
1733
+
1734
+ if (Schema$N.typeOf(schema, "boolean")) {
1735
+ return [numberOfItems, Schema$N.value(schema)];
1736
+ } else {
1737
+ return [numberOfItems, await Core$v.compileSchema(schema, ast)];
1738
+ }
1739
+ };
1740
+
1741
+ const interpret$L = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
1742
+ if (!Instance$B.typeOf(instance, "array")) {
1743
+ return true;
1744
+ }
1745
+
1746
+ if (typeof additionalItems === "string") {
1747
+ return Instance$B.every((item, ndx) => ndx < numberOfItems || Core$v.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
1748
+ } else {
1749
+ return Instance$B.every((item, ndx) => ndx < numberOfItems ? true : additionalItems, instance);
1750
+ }
1751
+ };
1752
+
1753
+ var additionalItems = { compile: compile$L, interpret: interpret$L };
1754
+ additionalItems.compile;
1755
+ additionalItems.interpret;
1756
+
1757
+ const { Core: Core$u, Schema: Schema$M, Instance: Instance$A } = lib$1;
1758
+
1759
+
1760
+ const compile$K = async (schema, ast, parentSchema) => {
1761
+ const items = await Schema$M.step("items", parentSchema);
1762
+ const numberOfItems = Schema$M.typeOf(items, "array") ? Schema$M.length(items) : Number.MAX_SAFE_INTEGER;
1763
+
1764
+ return [numberOfItems, await Core$u.compileSchema(schema, ast)];
1765
+ };
1766
+
1767
+ const interpret$K = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
1768
+ if (!Instance$A.typeOf(instance, "array")) {
1769
+ return true;
1770
+ }
1771
+
1772
+ return Instance$A.every((item, ndx) => ndx < numberOfItems || Core$u.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
1773
+ };
1774
+
1775
+ const collectEvaluatedItems$d = (keywordValue, instance, ast, dynamicAnchors) => {
1776
+ return interpret$K(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$A.map((item, ndx) => ndx, instance));
1777
+ };
1778
+
1779
+ var additionalItems6 = { compile: compile$K, interpret: interpret$K, collectEvaluatedItems: collectEvaluatedItems$d };
1780
+ additionalItems6.compile;
1781
+ additionalItems6.interpret;
1782
+ additionalItems6.collectEvaluatedItems;
1783
+
1784
+ const { Core: Core$t, Schema: Schema$L, Instance: Instance$z } = lib$1;
1785
+
1786
+
1787
+ const compile$J = async (schema, ast, parentSchema) => {
1788
+ const properties = await Schema$L.step("properties", parentSchema);
1789
+ const propertyNames = Schema$L.typeOf(properties, "object") ? Schema$L.keys(properties) : [];
1790
+
1791
+ const patternProperties = await Schema$L.step("patternProperties", parentSchema);
1792
+ const propertyNamePatterns = Schema$L.typeOf(patternProperties, "object") ? Schema$L.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
1793
+
1794
+ if (Schema$L.typeOf(schema, "boolean")) {
1795
+ return [propertyNames, propertyNamePatterns, Schema$L.value(schema)];
1796
+ } else {
1797
+ return [propertyNames, propertyNamePatterns, await Core$t.compileSchema(schema, ast)];
1798
+ }
1799
+ };
1800
+
1801
+ const interpret$J = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
1802
+ if (!Instance$z.typeOf(instance, "object")) {
1803
+ return true;
1804
+ }
1805
+
1806
+ const properties = Instance$z.entries(instance)
1807
+ .filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)));
1808
+
1809
+ if (typeof additionalProperties === "string") {
1810
+ return properties.every(([, property]) => Core$t.interpretSchema(additionalProperties, property, ast, dynamicAnchors));
1811
+ } else {
1812
+ return properties.length === 0 || additionalProperties;
1813
+ }
1814
+ };
1815
+
1816
+ var additionalProperties = { compile: compile$J, interpret: interpret$J };
1817
+ additionalProperties.compile;
1818
+ additionalProperties.interpret;
1819
+
1820
+ const { Core: Core$s, Schema: Schema$K, Instance: Instance$y } = lib$1;
1821
+
1822
+
1823
+ const compile$I = async (schema, ast, parentSchema) => {
1824
+ const propertiesSchema = await Schema$K.step("properties", parentSchema);
1825
+ const propertyNames = Schema$K.typeOf(propertiesSchema, "object") ? Schema$K.keys(propertiesSchema) : [];
1826
+
1827
+ const patternProperties = await Schema$K.step("patternProperties", parentSchema);
1828
+ const propertyNamePatterns = Schema$K.typeOf(patternProperties, "object") ? Schema$K.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
1829
+
1830
+ return [propertyNames, propertyNamePatterns, await Core$s.compileSchema(schema, ast)];
1831
+ };
1832
+
1833
+ const interpret$I = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
1834
+ if (!Instance$y.typeOf(instance, "object")) {
1835
+ return true;
1836
+ }
1837
+
1838
+ return Instance$y.entries(instance)
1839
+ .filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)))
1840
+ .every(([, property]) => Core$s.interpretSchema(additionalProperties, property, ast, dynamicAnchors));
1841
+ };
1842
+
1843
+ const collectEvaluatedProperties$c = (keywordValue, instance, ast, dynamicAnchors) => {
1844
+ return interpret$I(keywordValue, instance, ast, dynamicAnchors) && [new RegExp("")];
1845
+ };
1846
+
1847
+ var additionalProperties6 = { compile: compile$I, interpret: interpret$I, collectEvaluatedProperties: collectEvaluatedProperties$c };
1848
+ additionalProperties6.compile;
1849
+ additionalProperties6.interpret;
1850
+ additionalProperties6.collectEvaluatedProperties;
1851
+
1852
+ const { Core: Core$r, Schema: Schema$J } = lib$1;
1853
+
1854
+
1855
+
1856
+ const compile$H = (schema, ast) => lib$2.pipeline([
1857
+ Schema$J.map(async (itemSchema) => Core$r.compileSchema(await itemSchema, ast)),
1858
+ lib$2.all
1859
+ ], schema);
1860
+
1861
+ const interpret$H = (allOf, instance, ast, dynamicAnchors) => {
1862
+ return allOf.every((schemaUrl) => Core$r.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
1863
+ };
1864
+
1865
+ const collectEvaluatedProperties$b = (allOf, instance, ast, dynamicAnchors) => {
1866
+ return allOf.reduce((acc, schemaUrl) => {
1867
+ const propertyNames = acc && Core$r.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors);
1868
+ return propertyNames !== false && [...acc, ...propertyNames];
1869
+ }, []);
1870
+ };
1871
+
1872
+ const collectEvaluatedItems$c = (allOf, instance, ast, dynamicAnchors) => {
1873
+ return allOf.reduce((acc, schemaUrl) => {
1874
+ const itemIndexes = acc !== false && Core$r.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors);
1875
+ return itemIndexes !== false && new Set([...acc, ...itemIndexes]);
1876
+ }, new Set());
1877
+ };
1878
+
1879
+ var allOf = { compile: compile$H, interpret: interpret$H, collectEvaluatedProperties: collectEvaluatedProperties$b, collectEvaluatedItems: collectEvaluatedItems$c };
1880
+ allOf.compile;
1881
+ allOf.interpret;
1882
+ allOf.collectEvaluatedProperties;
1883
+ allOf.collectEvaluatedItems;
1884
+
1885
+ const { Core: Core$q, Schema: Schema$I } = lib$1;
1886
+
1887
+
1888
+
1889
+ const compile$G = (schema, ast) => lib$2.pipeline([
1890
+ Schema$I.map(async (itemSchema) => Core$q.compileSchema(await itemSchema, ast)),
1891
+ lib$2.all
1892
+ ], schema);
1893
+
1894
+ const interpret$G = (anyOf, instance, ast, dynamicAnchors) => {
1895
+ const matches = anyOf.filter((schemaUrl) => Core$q.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
1896
+ return matches.length > 0;
1897
+ };
1898
+
1899
+ const collectEvaluatedProperties$a = (anyOf, instance, ast, dynamicAnchors) => {
1900
+ return anyOf.reduce((acc, schemaUrl) => {
1901
+ const propertyNames = Core$q.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors);
1902
+ return propertyNames !== false ? [...acc || [], ...propertyNames] : acc;
1903
+ }, false);
1904
+ };
1905
+
1906
+ const collectEvaluatedItems$b = (anyOf, instance, ast, dynamicAnchors) => {
1907
+ return anyOf.reduce((acc, schemaUrl) => {
1908
+ const itemIndexes = Core$q.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors);
1909
+ return itemIndexes !== false ? new Set([...acc || [], ...itemIndexes]) : acc;
1910
+ }, false);
1911
+ };
1912
+
1913
+ var anyOf = { compile: compile$G, interpret: interpret$G, collectEvaluatedProperties: collectEvaluatedProperties$a, collectEvaluatedItems: collectEvaluatedItems$b };
1914
+ anyOf.compile;
1915
+ anyOf.interpret;
1916
+ anyOf.collectEvaluatedProperties;
1917
+ anyOf.collectEvaluatedItems;
1918
+
1919
+ var keyList = Object.keys;
1920
+ var native_stringify = JSON.stringify;
1921
+
1922
+ function stringify(val, allowUndefined) {
1923
+ var i, max, str, keys, key, propVal, tipeof;
1924
+
1925
+ tipeof = typeof val;
1926
+
1927
+ if (tipeof === 'string') return native_stringify(val);
1928
+ if (val === true) return 'true';
1929
+ if (val === false) return 'false';
1930
+ if (val === null) return 'null';
1931
+
1932
+ if (val instanceof Array) {
1933
+ str = '[';
1934
+ max = val.length - 1;
1935
+ for(i = 0; i < max; i++)
1936
+ str += stringify(val[i], false) + ',';
1937
+ if (max > -1) {
1938
+ str += stringify(val[i], false);
1939
+ }
1940
+
1941
+ return str + ']';
1942
+ }
1943
+
1944
+ if (val instanceof Object) {
1945
+ if (typeof val.toJSON === 'function')
1946
+ return stringify(val.toJSON(), allowUndefined);
1947
+
1948
+ // only object is left
1949
+ keys = keyList(val).sort();
1950
+ max = keys.length;
1951
+ str = '';
1952
+ i = 0;
1953
+ while (i < max) {
1954
+ key = keys[i];
1955
+ propVal = stringify(val[key], true);
1956
+ if (propVal !== undefined) {
1957
+ if (i && str !== '') { //if the string is empty, don't add comma to avoid the json to become invalid.
1958
+ str += ',';
1959
+ }
1960
+ str += native_stringify(key) + ':' + propVal;
1961
+ }
1962
+ i++;
1963
+ }
1964
+ return '{' + str + '}';
1965
+ }
1966
+
1967
+ switch (tipeof) {
1968
+ case 'function':
1969
+ case 'undefined':
1970
+ return allowUndefined ? undefined : null;
1971
+ default:
1972
+ return isFinite(val) ? val : null;
1973
+ }
1974
+ }
1975
+
1976
+ var fastestStableStringify = function(obj) { return '' + stringify(obj, false); };
1977
+
1978
+ const { Schema: Schema$H, Instance: Instance$x } = lib$1;
1979
+
1980
+
1981
+
1982
+ const compile$F = (schema) => fastestStableStringify(Schema$H.value(schema));
1983
+ const interpret$F = (const_, instance) => fastestStableStringify(Instance$x.value(instance)) === const_;
1984
+
1985
+ var _const = { compile: compile$F, interpret: interpret$F };
1986
+ _const.compile;
1987
+ _const.interpret;
1988
+
1989
+ const { Core: Core$p, Instance: Instance$w } = lib$1;
1990
+
1991
+
1992
+ const compile$E = (schema, ast) => Core$p.compileSchema(schema, ast);
1993
+
1994
+ const interpret$E = (contains, instance, ast, dynamicAnchors) => {
1995
+ return !Instance$w.typeOf(instance, "array") || Instance$w.some((item) => Core$p.interpretSchema(contains, item, ast, dynamicAnchors), instance);
1996
+ };
1997
+
1998
+ var contains = { compile: compile$E, interpret: interpret$E };
1999
+ contains.compile;
2000
+ contains.interpret;
2001
+
2002
+ const { Core: Core$o, Schema: Schema$G, Instance: Instance$v } = lib$1;
2003
+
2004
+
2005
+ const compile$D = async (schema, ast, parentSchema) => {
2006
+ const contains = await Core$o.compileSchema(schema, ast);
2007
+
2008
+ const minContainsSchema = await Schema$G.step("minContains", parentSchema);
2009
+ const minContains = Schema$G.typeOf(minContainsSchema, "number") ? Schema$G.value(minContainsSchema) : 1;
2010
+
2011
+ const maxContainsSchema = await Schema$G.step("maxContains", parentSchema);
2012
+ const maxContains = Schema$G.typeOf(maxContainsSchema, "number") ? Schema$G.value(maxContainsSchema) : Number.MAX_SAFE_INTEGER;
2013
+
2014
+ return { contains, minContains, maxContains };
2015
+ };
2016
+
2017
+ const interpret$D = ({ contains, minContains, maxContains }, instance, ast, dynamicAnchors) => {
2018
+ if (!Instance$v.typeOf(instance, "array")) {
2019
+ return true;
2020
+ }
2021
+
2022
+ const matches = Instance$v.reduce((matches, item) => {
2023
+ return Core$o.interpretSchema(contains, item, ast, dynamicAnchors) ? matches + 1 : matches;
2024
+ }, 0, instance);
2025
+ return matches >= minContains && matches <= maxContains;
2026
+ };
2027
+
2028
+ const collectEvaluatedItems$a = (keywordValue, instance, ast, dynamicAnchors) => {
2029
+ return interpret$D(keywordValue, instance, ast, dynamicAnchors) && Instance$v.reduce((matchedIndexes, item, itemIndex) => {
2030
+ return Core$o.interpretSchema(keywordValue.contains, item, ast, dynamicAnchors) ? matchedIndexes.add(itemIndex) : matchedIndexes;
2031
+ }, new Set(), instance);
2032
+ };
2033
+
2034
+ var containsMinContainsMaxContains = { compile: compile$D, interpret: interpret$D, collectEvaluatedItems: collectEvaluatedItems$a };
2035
+ containsMinContainsMaxContains.compile;
2036
+ containsMinContainsMaxContains.interpret;
2037
+ containsMinContainsMaxContains.collectEvaluatedItems;
2038
+
2039
+ const { Core: Core$n, Schema: Schema$F } = lib$1;
2040
+
2041
+
2042
+
2043
+ const compile$C = async (schema, ast) => {
2044
+ await lib$2.pipeline([
2045
+ Schema$F.entries,
2046
+ lib$2.map(([, definitionSchema]) => Core$n.compileSchema(definitionSchema, ast)),
2047
+ lib$2.all
2048
+ ], schema);
2049
+ };
2050
+
2051
+ const interpret$C = () => true;
2052
+
2053
+ var definitions = { compile: compile$C, interpret: interpret$C };
2054
+ definitions.compile;
2055
+ definitions.interpret;
2056
+
2057
+ const { Core: Core$m, Schema: Schema$E, Instance: Instance$u } = lib$1;
2058
+
2059
+
2060
+
2061
+ const compile$B = (schema, ast) => lib$2.pipeline([
2062
+ Schema$E.entries,
2063
+ lib$2.map(async ([key, dependency]) => {
2064
+ return [key, Schema$E.typeOf(dependency, "array") ? Schema$E.value(dependency) : await Core$m.compileSchema(dependency, ast)];
2065
+ }),
2066
+ lib$2.all
2067
+ ], schema);
2068
+
2069
+ const interpret$B = (dependencies, instance, ast, dynamicAnchors) => {
2070
+ const value = Instance$u.value(instance);
2071
+
2072
+ return !Instance$u.typeOf(instance, "object") || dependencies.every(([propertyName, dependency]) => {
2073
+ if (!(propertyName in value)) {
2074
+ return true;
2075
+ }
2076
+
2077
+ if (Array.isArray(dependency)) {
2078
+ return dependency.every((key) => key in value);
2079
+ } else {
2080
+ return Core$m.interpretSchema(dependency, instance, ast, dynamicAnchors);
2081
+ }
2082
+ });
2083
+ };
2084
+
2085
+ var dependencies = { compile: compile$B, interpret: interpret$B };
2086
+ dependencies.compile;
2087
+ dependencies.interpret;
2088
+
2089
+ const { Schema: Schema$D, Instance: Instance$t } = lib$1;
2090
+
2091
+
2092
+
2093
+ const compile$A = (schema) => lib$2.pipeline([
2094
+ Schema$D.entries,
2095
+ lib$2.map(([key, dependentRequired]) => [key, Schema$D.value(dependentRequired)]),
2096
+ lib$2.all
2097
+ ], schema);
2098
+
2099
+ const interpret$A = (dependentRequired, instance) => {
2100
+ const value = Instance$t.value(instance);
2101
+
2102
+ return !Instance$t.typeOf(instance, "object") || dependentRequired.every(([propertyName, required]) => {
2103
+ return !(propertyName in value) || required.every((key) => key in value);
2104
+ });
2105
+ };
2106
+
2107
+ var dependentRequired = { compile: compile$A, interpret: interpret$A };
2108
+ dependentRequired.compile;
2109
+ dependentRequired.interpret;
2110
+
2111
+ const { Core: Core$l, Schema: Schema$C, Instance: Instance$s } = lib$1;
2112
+
2113
+
2114
+
2115
+ const compile$z = (schema, ast) => lib$2.pipeline([
2116
+ Schema$C.entries,
2117
+ lib$2.map(async ([key, dependentSchema]) => [key, await Core$l.compileSchema(dependentSchema, ast)]),
2118
+ lib$2.all
2119
+ ], schema);
2120
+
2121
+ const interpret$z = (dependentSchemas, instance, ast, dynamicAnchors) => {
2122
+ const value = Instance$s.value(instance);
2123
+
2124
+ return !Instance$s.typeOf(instance, "object") || dependentSchemas.every(([propertyName, dependentSchema]) => {
2125
+ return !(propertyName in value) || Core$l.interpretSchema(dependentSchema, instance, ast, dynamicAnchors);
2126
+ });
2127
+ };
2128
+
2129
+ const collectEvaluatedProperties$9 = (dependentSchemas, instance, ast, dynamicAnchors) => {
2130
+ return dependentSchemas.reduce((acc, [propertyName, dependentSchema]) => {
2131
+ if (!acc || !Instance$s.has(propertyName, instance)) {
2132
+ return acc;
2133
+ }
2134
+
2135
+ const propertyNames = Core$l.collectEvaluatedProperties(dependentSchema, instance, ast, dynamicAnchors);
2136
+ return propertyNames !== false && acc.concat(propertyNames);
2137
+ }, []);
2138
+ };
2139
+
2140
+ var dependentSchemas = { compile: compile$z, interpret: interpret$z, collectEvaluatedProperties: collectEvaluatedProperties$9 };
2141
+ dependentSchemas.compile;
2142
+ dependentSchemas.interpret;
2143
+ dependentSchemas.collectEvaluatedProperties;
2144
+
2145
+ const { Schema: Schema$B, Instance: Instance$r } = lib$1;
2146
+
2147
+
2148
+
2149
+ const compile$y = (schema) => Schema$B.value(schema).map(fastestStableStringify);
2150
+ const interpret$y = (enum_, instance) => enum_.some((enumValue) => fastestStableStringify(Instance$r.value(instance)) === enumValue);
2151
+
2152
+ var _enum = { compile: compile$y, interpret: interpret$y };
2153
+ _enum.compile;
2154
+ _enum.interpret;
2155
+
2156
+ const { Schema: Schema$A, Instance: Instance$q } = lib$1;
2157
+
2158
+
2159
+ const compile$x = async (schema) => Schema$A.value(schema);
2160
+ const interpret$x = (exclusiveMaximum, instance) => !Instance$q.typeOf(instance, "number") || Instance$q.value(instance) < exclusiveMaximum;
2161
+
2162
+ var exclusiveMaximum = { compile: compile$x, interpret: interpret$x };
2163
+ exclusiveMaximum.compile;
2164
+ exclusiveMaximum.interpret;
2165
+
2166
+ const { Schema: Schema$z, Instance: Instance$p } = lib$1;
2167
+
2168
+
2169
+ const compile$w = async (schema) => Schema$z.value(schema);
2170
+ const interpret$w = (exclusiveMinimum, instance) => !Instance$p.typeOf(instance, "number") || Instance$p.value(instance) > exclusiveMinimum;
2171
+
2172
+ var exclusiveMinimum = { compile: compile$w, interpret: interpret$w };
2173
+ exclusiveMinimum.compile;
2174
+ exclusiveMinimum.interpret;
2175
+
2176
+ const { Core: Core$k } = lib$1;
2177
+
2178
+
2179
+ const compile$v = (schema, ast) => Core$k.compileSchema(schema, ast);
2180
+
2181
+ const interpret$v = (ifSchema, instance, ast, dynamicAnchors) => {
2182
+ Core$k.interpretSchema(ifSchema, instance, ast, dynamicAnchors);
2183
+ return true;
2184
+ };
2185
+
2186
+ const collectEvaluatedProperties$8 = (ifSchema, instance, ast, dynamicAnchors) => {
2187
+ return Core$k.collectEvaluatedProperties(ifSchema, instance, ast, dynamicAnchors) || [];
2188
+ };
2189
+
2190
+ const collectEvaluatedItems$9 = (ifSchema, instance, ast, dynamicAnchors) => {
2191
+ return Core$k.collectEvaluatedItems(ifSchema, instance, ast, dynamicAnchors) || new Set();
2192
+ };
2193
+
2194
+ var _if = { compile: compile$v, interpret: interpret$v, collectEvaluatedProperties: collectEvaluatedProperties$8, collectEvaluatedItems: collectEvaluatedItems$9 };
2195
+ _if.compile;
2196
+ _if.interpret;
2197
+ _if.collectEvaluatedProperties;
2198
+ _if.collectEvaluatedItems;
2199
+
2200
+ const { Core: Core$j, Schema: Schema$y } = lib$1;
2201
+
2202
+
2203
+ const compile$u = async (schema, ast, parentSchema) => {
2204
+ if (Schema$y.has("if", parentSchema)) {
2205
+ const ifSchema = await Schema$y.step("if", parentSchema);
2206
+ return [await Core$j.compileSchema(ifSchema, ast), await Core$j.compileSchema(schema, ast)];
2207
+ } else {
2208
+ return [];
2209
+ }
2210
+ };
2211
+
2212
+ const interpret$u = ([guard, block], instance, ast, dynamicAnchors) => {
2213
+ return guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors) || Core$j.interpretSchema(block, instance, ast, dynamicAnchors);
2214
+ };
2215
+
2216
+ // Interpret a schema without events being emitted
2217
+ const quietInterpretSchema$1 = (uri, instance, ast, dynamicAnchors) => {
2218
+ const nodes = ast[uri][2];
2219
+
2220
+ return typeof nodes === "boolean" ? nodes : nodes
2221
+ .every(([keywordId, , keywordValue]) => {
2222
+ return Core$j.getKeyword(keywordId).interpret(keywordValue, instance, ast, dynamicAnchors);
2223
+ });
2224
+ };
2225
+
2226
+ const collectEvaluatedProperties$7 = ([guard, block], instance, ast, dynamicAnchors) => {
2227
+ if (guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors)) {
2228
+ return [];
2229
+ }
2230
+
2231
+ return Core$j.collectEvaluatedProperties(block, instance, ast, dynamicAnchors);
2232
+ };
2233
+
2234
+ const collectEvaluatedItems$8 = ([guard, block], instance, ast, dynamicAnchors) => {
2235
+ if (guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors)) {
2236
+ return new Set();
2237
+ }
2238
+
2239
+ return Core$j.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
2240
+ };
2241
+
2242
+ var then = { compile: compile$u, interpret: interpret$u, collectEvaluatedProperties: collectEvaluatedProperties$7, collectEvaluatedItems: collectEvaluatedItems$8 };
2243
+ then.compile;
2244
+ then.interpret;
2245
+ then.collectEvaluatedProperties;
2246
+ then.collectEvaluatedItems;
2247
+
2248
+ const { Core: Core$i, Schema: Schema$x } = lib$1;
2249
+
2250
+
2251
+ const compile$t = async (schema, ast, parentSchema) => {
2252
+ if (Schema$x.has("if", parentSchema)) {
2253
+ const ifSchema = await Schema$x.step("if", parentSchema);
2254
+ return [await Core$i.compileSchema(ifSchema, ast), await Core$i.compileSchema(schema, ast)];
2255
+ } else {
2256
+ return [];
2257
+ }
2258
+ };
2259
+
2260
+ const interpret$t = ([guard, block], instance, ast, dynamicAnchors) => {
2261
+ return guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors) || Core$i.interpretSchema(block, instance, ast, dynamicAnchors);
2262
+ };
2263
+
2264
+ // Interpret a schema without events being emitted
2265
+ const quietInterpretSchema = (uri, instance, ast, dynamicAnchors) => {
2266
+ const nodes = ast[uri][2];
2267
+
2268
+ return typeof nodes === "boolean" ? nodes : nodes
2269
+ .every(([keywordId, , keywordValue]) => {
2270
+ return Core$i.getKeyword(keywordId).interpret(keywordValue, instance, ast, dynamicAnchors);
2271
+ });
2272
+ };
2273
+
2274
+ const collectEvaluatedProperties$6 = ([guard, block], instance, ast, dynamicAnchors) => {
2275
+ if (guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors)) {
2276
+ return [];
2277
+ }
2278
+
2279
+ return Core$i.collectEvaluatedProperties(block, instance, ast, dynamicAnchors);
2280
+ };
2281
+
2282
+ const collectEvaluatedItems$7 = ([guard, block], instance, ast, dynamicAnchors) => {
2283
+ if (guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors)) {
2284
+ return new Set();
2285
+ }
2286
+
2287
+ return Core$i.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
2288
+ };
2289
+
2290
+ var _else = { compile: compile$t, interpret: interpret$t, collectEvaluatedProperties: collectEvaluatedProperties$6, collectEvaluatedItems: collectEvaluatedItems$7 };
2291
+ _else.compile;
2292
+ _else.interpret;
2293
+ _else.collectEvaluatedProperties;
2294
+ _else.collectEvaluatedItems;
2295
+
2296
+ const { Core: Core$h, Schema: Schema$w, Instance: Instance$o } = lib$1;
2297
+
2298
+
2299
+ const compile$s = async (schema, ast) => {
2300
+ if (Schema$w.typeOf(schema, "array")) {
2301
+ const tupleItems = await Schema$w.map((itemSchema) => Core$h.compileSchema(itemSchema, ast), schema);
2302
+ return Promise.all(tupleItems);
2303
+ } else {
2304
+ return Core$h.compileSchema(schema, ast);
2305
+ }
2306
+ };
2307
+
2308
+ const interpret$s = (items, instance, ast, dynamicAnchors) => {
2309
+ if (!Instance$o.typeOf(instance, "array")) {
2310
+ return true;
2311
+ }
2312
+
2313
+ if (typeof items === "string") {
2314
+ return Instance$o.every((itemValue) => Core$h.interpretSchema(items, itemValue, ast, dynamicAnchors), instance);
2315
+ } else {
2316
+ return Instance$o.every((item, ndx) => !(ndx in items) || Core$h.interpretSchema(items[ndx], item, ast, dynamicAnchors), instance);
2317
+ }
2318
+ };
2319
+
2320
+ const collectEvaluatedItems$6 = (items, instance, ast, dynamicAnchors) => {
2321
+ return interpret$s(items, instance, ast, dynamicAnchors) && (typeof items === "string"
2322
+ ? new Set(Instance$o.map((item, itemIndex) => itemIndex, instance))
2323
+ : new Set(items.map((item, itemIndex) => itemIndex)));
2324
+ };
2325
+
2326
+ var items = { compile: compile$s, interpret: interpret$s, collectEvaluatedItems: collectEvaluatedItems$6 };
2327
+ items.compile;
2328
+ items.interpret;
2329
+ items.collectEvaluatedItems;
2330
+
2331
+ const { Core: Core$g, Schema: Schema$v, Instance: Instance$n } = lib$1;
2332
+
2333
+
2334
+ const compile$r = async (schema, ast, parentSchema) => {
2335
+ const items = await Schema$v.step("prefixItems", parentSchema);
2336
+ const numberOfPrefixItems = Schema$v.typeOf(items, "array") ? Schema$v.length(items) : 0;
2337
+
2338
+ return [numberOfPrefixItems, await Core$g.compileSchema(schema, ast)];
2339
+ };
2340
+
2341
+ const interpret$r = ([numberOfPrefixItems, items], instance, ast, dynamicAnchors) => {
2342
+ if (!Instance$n.typeOf(instance, "array")) {
2343
+ return true;
2344
+ }
2345
+
2346
+ return Instance$n.every((item, ndx) => ndx < numberOfPrefixItems || Core$g.interpretSchema(items, item, ast, dynamicAnchors), instance);
2347
+ };
2348
+
2349
+ const collectEvaluatedItems$5 = (keywordValue, instance, ast, dynamicAnchors) => {
2350
+ return interpret$r(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$n.map((item, ndx) => ndx, instance));
2351
+ };
2352
+
2353
+ var items202012 = { compile: compile$r, interpret: interpret$r, collectEvaluatedItems: collectEvaluatedItems$5 };
2354
+ items202012.compile;
2355
+ items202012.interpret;
2356
+ items202012.collectEvaluatedItems;
2357
+
2358
+ const { Schema: Schema$u, Instance: Instance$m } = lib$1;
2359
+
2360
+
2361
+ const compile$q = (schema) => Schema$u.value(schema);
2362
+ const interpret$q = (maxItems, instance) => !Instance$m.typeOf(instance, "array") || Instance$m.length(instance) <= maxItems;
2363
+
2364
+ var maxItems = { compile: compile$q, interpret: interpret$q };
2365
+ maxItems.compile;
2366
+ maxItems.interpret;
2367
+
2368
+ const { Schema: Schema$t, Instance: Instance$l } = lib$1;
2369
+
2370
+
2371
+ const compile$p = (schema) => Schema$t.value(schema);
2372
+ const interpret$p = (maxLength, instance) => !Instance$l.typeOf(instance, "string") || Instance$l.length(instance) <= maxLength;
2373
+
2374
+ var maxLength = { compile: compile$p, interpret: interpret$p };
2375
+ maxLength.compile;
2376
+ maxLength.interpret;
2377
+
2378
+ const { Schema: Schema$s, Instance: Instance$k } = lib$1;
2379
+
2380
+
2381
+ const compile$o = (schema) => Schema$s.value(schema);
2382
+ const interpret$o = (maxLength, instance) => !Instance$k.typeOf(instance, "string") || [...Instance$k.value(instance)].length <= maxLength;
2383
+
2384
+ var maxLength6 = { compile: compile$o, interpret: interpret$o };
2385
+ maxLength6.compile;
2386
+ maxLength6.interpret;
2387
+
2388
+ const { Schema: Schema$r, Instance: Instance$j } = lib$1;
2389
+
2390
+
2391
+ const compile$n = (schema) => Schema$r.value(schema);
2392
+ const interpret$n = (maxProperties, instance) => !Instance$j.typeOf(instance, "object") || Instance$j.keys(instance).length <= maxProperties;
2393
+
2394
+ var maxProperties = { compile: compile$n, interpret: interpret$n };
2395
+ maxProperties.compile;
2396
+ maxProperties.interpret;
2397
+
2398
+ const { Schema: Schema$q, Instance: Instance$i } = lib$1;
2399
+
2400
+
2401
+ const compile$m = async (schema, ast, parentSchema) => {
2402
+ const exclusiveMaximum = await Schema$q.step("exclusiveMaximum", parentSchema);
2403
+ const isExclusive = Schema$q.value(exclusiveMaximum);
2404
+
2405
+ return [Schema$q.value(schema), isExclusive];
2406
+ };
2407
+
2408
+ const interpret$m = ([maximum, isExclusive], instance) => {
2409
+ if (!Instance$i.typeOf(instance, "number")) {
2410
+ return true;
2411
+ }
2412
+
2413
+ const value = Instance$i.value(instance);
2414
+ return isExclusive ? value < maximum : value <= maximum;
2415
+ };
2416
+
2417
+ var maximumExclusiveMaximum = { compile: compile$m, interpret: interpret$m };
2418
+ maximumExclusiveMaximum.compile;
2419
+ maximumExclusiveMaximum.interpret;
2420
+
2421
+ const { Schema: Schema$p, Instance: Instance$h } = lib$1;
2422
+
2423
+
2424
+ const compile$l = async (schema) => Schema$p.value(schema);
2425
+ const interpret$l = (maximum, instance) => !Instance$h.typeOf(instance, "number") || Instance$h.value(instance) <= maximum;
2426
+
2427
+ var maximum = { compile: compile$l, interpret: interpret$l };
2428
+ maximum.compile;
2429
+ maximum.interpret;
2430
+
2431
+ const { Schema: Schema$o, Instance: Instance$g } = lib$1;
2432
+
2433
+
2434
+ const compile$k = (schema) => Schema$o.value(schema);
2435
+ const interpret$k = (minItems, instance) => !Instance$g.typeOf(instance, "array") || Instance$g.length(instance) >= minItems;
2436
+
2437
+ var minItems = { compile: compile$k, interpret: interpret$k };
2438
+ minItems.compile;
2439
+ minItems.interpret;
2440
+
2441
+ const { Schema: Schema$n, Instance: Instance$f } = lib$1;
2442
+
2443
+
2444
+ const compile$j = (schema) => Schema$n.value(schema);
2445
+ const interpret$j = (minLength, instance) => !Instance$f.typeOf(instance, "string") || Instance$f.length(instance) >= minLength;
2446
+
2447
+ var minLength = { compile: compile$j, interpret: interpret$j };
2448
+ minLength.compile;
2449
+ minLength.interpret;
2450
+
2451
+ const { Schema: Schema$m, Instance: Instance$e } = lib$1;
2452
+
2453
+
2454
+ const compile$i = (schema) => Schema$m.value(schema);
2455
+ const interpret$i = (minLength, instance) => !Instance$e.typeOf(instance, "string") || [...Instance$e.value(instance)].length >= minLength;
2456
+
2457
+ var minLength6 = { compile: compile$i, interpret: interpret$i };
2458
+ minLength6.compile;
2459
+ minLength6.interpret;
2460
+
2461
+ const { Schema: Schema$l, Instance: Instance$d } = lib$1;
2462
+
2463
+
2464
+ const compile$h = (schema) => Schema$l.value(schema);
2465
+ const interpret$h = (minProperties, instance) => !Instance$d.typeOf(instance, "object") || Instance$d.keys(instance).length >= minProperties;
2466
+
2467
+ var minProperties = { compile: compile$h, interpret: interpret$h };
2468
+ minProperties.compile;
2469
+ minProperties.interpret;
2470
+
2471
+ const { Schema: Schema$k, Instance: Instance$c } = lib$1;
2472
+
2473
+
2474
+ const compile$g = async (schema, ast, parentSchema) => {
2475
+ const exclusiveMinimum = await Schema$k.step("exclusiveMinimum", parentSchema);
2476
+ const isExclusive = Schema$k.value(exclusiveMinimum);
2477
+
2478
+ return [Schema$k.value(schema), isExclusive];
2479
+ };
2480
+
2481
+ const interpret$g = ([minimum, isExclusive], instance) => {
2482
+ if (!Instance$c.typeOf(instance, "number")) {
2483
+ return true;
2484
+ }
2485
+
2486
+ const value = Instance$c.value(instance);
2487
+ return isExclusive ? value > minimum : value >= minimum;
2488
+ };
2489
+
2490
+ var minimumExclusiveMinimum = { compile: compile$g, interpret: interpret$g };
2491
+ minimumExclusiveMinimum.compile;
2492
+ minimumExclusiveMinimum.interpret;
2493
+
2494
+ const { Schema: Schema$j, Instance: Instance$b } = lib$1;
2495
+
2496
+
2497
+ const compile$f = async (schema) => Schema$j.value(schema);
2498
+ const interpret$f = (minimum, instance) => !Instance$b.typeOf(instance, "number") || Instance$b.value(instance) >= minimum;
2499
+
2500
+ var minimum = { compile: compile$f, interpret: interpret$f };
2501
+ minimum.compile;
2502
+ minimum.interpret;
2503
+
2504
+ const { Schema: Schema$i, Instance: Instance$a } = lib$1;
2505
+
2506
+
2507
+ const compile$e = (schema) => Schema$i.value(schema);
2508
+
2509
+ const interpret$e = (multipleOf, instance) => {
2510
+ if (!Instance$a.typeOf(instance, "number")) {
2511
+ return true;
2512
+ }
2513
+
2514
+ const remainder = Instance$a.value(instance) % multipleOf;
2515
+ return numberEqual(0, remainder) || numberEqual(multipleOf, remainder);
2516
+ };
2517
+
2518
+ const numberEqual = (a, b) => Math.abs(a - b) < 1.19209290e-7;
2519
+
2520
+ var multipleOf = { compile: compile$e, interpret: interpret$e };
2521
+ multipleOf.compile;
2522
+ multipleOf.interpret;
2523
+
2524
+ const { Core: Core$f } = lib$1;
2525
+
2526
+
2527
+ const compile$d = Core$f.compileSchema;
2528
+ const interpret$d = (not, instance, ast, dynamicAnchors) => !Core$f.interpretSchema(not, instance, ast, dynamicAnchors);
2529
+
2530
+ var not = { compile: compile$d, interpret: interpret$d };
2531
+ not.compile;
2532
+ not.interpret;
2533
+
2534
+ const { Core: Core$e, Schema: Schema$h } = lib$1;
2535
+
2536
+
2537
+ const compile$c = async (schema, ast) => {
2538
+ const oneOf = await Schema$h.map((itemSchema) => Core$e.compileSchema(itemSchema, ast), schema);
2539
+ return Promise.all(oneOf);
2540
+ };
2541
+
2542
+ const interpret$c = (oneOf, instance, ast, dynamicAnchors) => {
2543
+ let validCount = 0;
2544
+ for (const schemaUrl of oneOf) {
2545
+ if (Core$e.interpretSchema(schemaUrl, instance, ast, dynamicAnchors)) {
2546
+ validCount++;
2547
+ }
2548
+
2549
+ if (validCount > 1) {
2550
+ break;
2551
+ }
2552
+ }
2553
+
2554
+ return validCount === 1;
2555
+ };
2556
+
2557
+ const collectEvaluatedProperties$5 = (oneOf, instance, ast, dynamicAnchors) => {
2558
+ let validCount = 0;
2559
+ return oneOf.reduce((acc, schemaUrl) => {
2560
+ if (validCount > 1) {
2561
+ return false;
2562
+ }
2563
+
2564
+ const propertyNames = Core$e.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors);
2565
+ return propertyNames ? validCount++ === 0 && propertyNames : acc;
2566
+ }, false);
2567
+ };
2568
+
2569
+ const collectEvaluatedItems$4 = (oneOf, instance, ast, dynamicAnchors) => {
2570
+ let validCount = 0;
2571
+ return oneOf.reduce((acc, schemaUrl) => {
2572
+ if (validCount > 1) {
2573
+ return false;
2574
+ }
2575
+
2576
+ const itemIndexes = Core$e.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors);
2577
+ return itemIndexes ? validCount++ === 0 && itemIndexes : acc;
2578
+ }, false);
2579
+ };
2580
+
2581
+ var oneOf = { compile: compile$c, interpret: interpret$c, collectEvaluatedProperties: collectEvaluatedProperties$5, collectEvaluatedItems: collectEvaluatedItems$4 };
2582
+ oneOf.compile;
2583
+ oneOf.interpret;
2584
+ oneOf.collectEvaluatedProperties;
2585
+ oneOf.collectEvaluatedItems;
2586
+
2587
+ const { Schema: Schema$g, Instance: Instance$9 } = lib$1;
2588
+
2589
+
2590
+ const compile$b = (schema) => new RegExp(Schema$g.value(schema), "u");
2591
+ const interpret$b = (pattern, instance) => !Instance$9.typeOf(instance, "string") || pattern.test(Instance$9.value(instance));
2592
+
2593
+ var pattern = { compile: compile$b, interpret: interpret$b };
2594
+ pattern.compile;
2595
+ pattern.interpret;
2596
+
2597
+ const { Core: Core$d, Schema: Schema$f, Instance: Instance$8 } = lib$1;
2598
+
2599
+
2600
+
2601
+ const compile$a = (schema, ast) => lib$2.pipeline([
2602
+ Schema$f.entries,
2603
+ lib$2.map(async ([pattern, propertySchema]) => [new RegExp(pattern, "u"), await Core$d.compileSchema(propertySchema, ast)]),
2604
+ lib$2.all
2605
+ ], schema);
2606
+
2607
+ const interpret$a = (patternProperties, instance, ast, dynamicAnchors) => {
2608
+ return !Instance$8.typeOf(instance, "object") || patternProperties.every(([pattern, schemaUrl]) => {
2609
+ return Instance$8.entries(instance)
2610
+ .filter(([propertyName]) => pattern.test(propertyName))
2611
+ .every(([, propertyValue]) => Core$d.interpretSchema(schemaUrl, propertyValue, ast, dynamicAnchors));
2612
+ });
2613
+ };
2614
+
2615
+ const collectEvaluatedProperties$4 = (patternProperties, instance, ast, dynamicAnchors) => {
2616
+ return interpret$a(patternProperties, instance, ast, dynamicAnchors) && patternProperties.map(([pattern]) => pattern);
2617
+ };
2618
+
2619
+ var patternProperties = { compile: compile$a, interpret: interpret$a, collectEvaluatedProperties: collectEvaluatedProperties$4 };
2620
+ patternProperties.compile;
2621
+ patternProperties.interpret;
2622
+ patternProperties.collectEvaluatedProperties;
2623
+
2624
+ const isObject = (value) => typeof value === "object" && !Array.isArray(value) && value !== null;
2625
+ const escapeRegExp$1 = (string) => string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
2626
+
2627
+ const splitUrl$1 = (url) => {
2628
+ const indexOfHash = url.indexOf("#");
2629
+ const ndx = indexOfHash === -1 ? url.length : indexOfHash;
2630
+ const urlReference = url.slice(0, ndx);
2631
+ const urlFragment = url.slice(ndx + 1);
2632
+
2633
+ return [decodeURI(urlReference), decodeURI(urlFragment)];
2634
+ };
2635
+
2636
+ var common = { isObject, escapeRegExp: escapeRegExp$1, splitUrl: splitUrl$1 };
2637
+
2638
+ const { Core: Core$c, Schema: Schema$e, Instance: Instance$7 } = lib$1;
2639
+
2640
+ const { escapeRegExp } = common;
2641
+
2642
+
2643
+ const compile$9 = (schema, ast) => lib$2.pipeline([
2644
+ Schema$e.entries,
2645
+ lib$2.reduce(async (acc, [propertyName, propertySchema]) => {
2646
+ acc[propertyName] = await Core$c.compileSchema(propertySchema, ast);
2647
+ return acc;
2648
+ }, Object.create(null))
2649
+ ], schema);
2650
+
2651
+ const interpret$9 = (properties, instance, ast, dynamicAnchors) => {
2652
+ return !Instance$7.typeOf(instance, "object") || Instance$7.entries(instance)
2653
+ .filter(([propertyName]) => propertyName in properties)
2654
+ .every(([propertyName, schemaUrl]) => Core$c.interpretSchema(properties[propertyName], schemaUrl, ast, dynamicAnchors));
2655
+ };
2656
+
2657
+ const collectEvaluatedProperties$3 = (properties, instance, ast, dynamicAnchors) => {
2658
+ return interpret$9(properties, instance, ast, dynamicAnchors) && Object.keys(properties)
2659
+ .map((propertyName) => new RegExp(`^${escapeRegExp(propertyName)}$`));
2660
+ };
2661
+
2662
+ var properties = { compile: compile$9, interpret: interpret$9, collectEvaluatedProperties: collectEvaluatedProperties$3 };
2663
+ properties.compile;
2664
+ properties.interpret;
2665
+ properties.collectEvaluatedProperties;
2666
+
2667
+ const { Core: Core$b, Instance: Instance$6 } = lib$1;
2668
+
2669
+
2670
+ const compile$8 = (schema, ast) => Core$b.compileSchema(schema, ast);
2671
+
2672
+ const interpret$8 = (propertyNames, instance, ast, dynamicAnchors) => {
2673
+ return !Instance$6.typeOf(instance, "object") || Instance$6.keys(instance)
2674
+ .every((key) => Core$b.interpretSchema(propertyNames, Instance$6.cons(key), ast, dynamicAnchors));
2675
+ };
2676
+
2677
+ var propertyNames = { compile: compile$8, interpret: interpret$8 };
2678
+ propertyNames.compile;
2679
+ propertyNames.interpret;
2680
+
2681
+ const { Core: Core$a, Schema: Schema$d } = lib$1;
2682
+ const { splitUrl } = common;
2683
+
2684
+
2685
+ const compile$7 = async (dynamicRef, ast) => {
2686
+ const [, fragment] = splitUrl(Schema$d.value(dynamicRef));
2687
+ const referencedSchema = await Schema$d.get(Schema$d.value(dynamicRef), dynamicRef);
2688
+ await Core$a.compileSchema(referencedSchema, ast);
2689
+ return [referencedSchema.id, fragment];
2690
+ };
2691
+
2692
+ const interpret$7 = ([id, fragment], instance, ast, dynamicAnchors) => {
2693
+ if (fragment in ast.metaData[id].dynamicAnchors) {
2694
+ return Core$a.interpretSchema(dynamicAnchors[fragment], instance, ast, dynamicAnchors);
2695
+ } else {
2696
+ const pointer = Schema$d.getAnchorPointer(ast.metaData[id], fragment);
2697
+ return Core$a.interpretSchema(`${id}#${encodeURI(pointer)}`, instance, ast, dynamicAnchors);
2698
+ }
2699
+ };
2700
+
2701
+ const collectEvaluatedProperties$2 = Core$a.collectEvaluatedProperties;
2702
+ const collectEvaluatedItems$3 = Core$a.collectEvaluatedItems;
2703
+
2704
+ var dynamicRef = { compile: compile$7, interpret: interpret$7, collectEvaluatedProperties: collectEvaluatedProperties$2, collectEvaluatedItems: collectEvaluatedItems$3 };
2705
+ dynamicRef.compile;
2706
+ dynamicRef.interpret;
2707
+ dynamicRef.collectEvaluatedProperties;
2708
+ dynamicRef.collectEvaluatedItems;
2709
+
2710
+ const { Core: Core$9, Schema: Schema$c } = lib$1;
2711
+
2712
+
2713
+ const compile$6 = async (ref, ast) => {
2714
+ const referencedSchema = await Schema$c.get(Schema$c.value(ref), ref);
2715
+ return Core$9.compileSchema(referencedSchema, ast);
2716
+ };
2717
+
2718
+ const interpret$6 = Core$9.interpretSchema;
2719
+ const collectEvaluatedProperties$1 = Core$9.collectEvaluatedProperties;
2720
+ const collectEvaluatedItems$2 = Core$9.collectEvaluatedItems;
2721
+
2722
+ var ref = { compile: compile$6, interpret: interpret$6, collectEvaluatedProperties: collectEvaluatedProperties$1, collectEvaluatedItems: collectEvaluatedItems$2 };
2723
+ ref.compile;
2724
+ ref.interpret;
2725
+ ref.collectEvaluatedProperties;
2726
+ ref.collectEvaluatedItems;
2727
+
2728
+ const { Schema: Schema$b, Instance: Instance$5 } = lib$1;
2729
+
2730
+
2731
+ const compile$5 = (schema) => Schema$b.value(schema);
2732
+
2733
+ const interpret$5 = (required, instance) => {
2734
+ return !Instance$5.typeOf(instance, "object") || required.every((propertyName) => Object.prototype.hasOwnProperty.call(Instance$5.value(instance), propertyName));
2735
+ };
2736
+
2737
+ var required = { compile: compile$5, interpret: interpret$5 };
2738
+ required.compile;
2739
+ required.interpret;
2740
+
2741
+ const { Core: Core$8, Schema: Schema$a, Instance: Instance$4 } = lib$1;
2742
+
2743
+
2744
+
2745
+ const compile$4 = (schema, ast) => {
2746
+ return lib$2.pipeline([
2747
+ Schema$a.map((itemSchema) => Core$8.compileSchema(itemSchema, ast)),
2748
+ lib$2.all
2749
+ ], schema);
2750
+ };
2751
+
2752
+ const interpret$4 = (items, instance, ast, dynamicAnchors) => {
2753
+ if (!Instance$4.typeOf(instance, "array")) {
2754
+ return true;
2755
+ }
2756
+
2757
+ return Instance$4.every((item, ndx) => !(ndx in items) || Core$8.interpretSchema(items[ndx], item, ast, dynamicAnchors), instance);
2758
+ };
2759
+
2760
+ const collectEvaluatedItems$1 = (items, instance, ast, dynamicAnchors) => {
2761
+ return interpret$4(items, instance, ast, dynamicAnchors) && new Set(items.map((item, ndx) => ndx));
2762
+ };
2763
+
2764
+ var tupleItems = { compile: compile$4, interpret: interpret$4, collectEvaluatedItems: collectEvaluatedItems$1 };
2765
+ tupleItems.compile;
2766
+ tupleItems.interpret;
2767
+ tupleItems.collectEvaluatedItems;
2768
+
2769
+ const { Schema: Schema$9, Instance: Instance$3 } = lib$1;
2770
+
2771
+
2772
+ const compile$3 = (schema) => Schema$9.value(schema);
2773
+ const interpret$3 = (type, instance) => typeof type === "string" ? Instance$3.typeOf(instance, type) : type.some(Instance$3.typeOf(instance));
2774
+
2775
+ var type = { compile: compile$3, interpret: interpret$3 };
2776
+ type.compile;
2777
+ type.interpret;
2778
+
2779
+ const { Core: Core$7, Schema: Schema$8, Instance: Instance$2 } = lib$1;
2780
+
2781
+
2782
+ const compile$2 = async (schema, ast, parentSchema) => {
2783
+ return [Schema$8.uri(parentSchema), await Core$7.compileSchema(schema, ast)];
2784
+ };
2785
+
2786
+ const interpret$2 = ([schemaUrl, unevaluatedItems], instance, ast, dynamicAnchors) => {
2787
+ if (!Instance$2.typeOf(instance, "array")) {
2788
+ return true;
2789
+ }
2790
+
2791
+ const itemIndexes = Core$7.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors, true);
2792
+ return itemIndexes === false || Instance$2.every((item, itemIndex) => {
2793
+ return itemIndexes.has(itemIndex) || Core$7.interpretSchema(unevaluatedItems, Instance$2.step(itemIndex, instance), ast, dynamicAnchors);
2794
+ }, instance);
2795
+ };
2796
+
2797
+ const collectEvaluatedItems = (keywordValue, instance, ast, dynamicAnchors) => {
2798
+ return interpret$2(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$2.map((item, ndx) => ndx, instance));
2799
+ };
2800
+
2801
+ var unevaluatedItems = { compile: compile$2, interpret: interpret$2, collectEvaluatedItems };
2802
+ unevaluatedItems.compile;
2803
+ unevaluatedItems.interpret;
2804
+ unevaluatedItems.collectEvaluatedItems;
2805
+
2806
+ const { Core: Core$6, Schema: Schema$7, Instance: Instance$1 } = lib$1;
2807
+
2808
+
2809
+ const compile$1 = async (schema, ast, parentSchema) => {
2810
+ return [Schema$7.uri(parentSchema), await Core$6.compileSchema(schema, ast)];
2811
+ };
2812
+
2813
+ const interpret$1 = ([schemaUrl, unevaluatedProperties], instance, ast, dynamicAnchors) => {
2814
+ if (!Instance$1.typeOf(instance, "object")) {
2815
+ return true;
2816
+ }
2817
+
2818
+ const evaluatedPropertyNames = Core$6.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors, true);
2819
+
2820
+ return !evaluatedPropertyNames || Instance$1.entries(instance)
2821
+ .filter(([propertyName]) => !evaluatedPropertyNames.some((pattern) => propertyName.match(pattern)))
2822
+ .every(([, property]) => Core$6.interpretSchema(unevaluatedProperties, property, ast, dynamicAnchors));
2823
+ };
2824
+
2825
+ const collectEvaluatedProperties = (keywordValue, instance, ast, dynamicAnchors) =>{
2826
+ return interpret$1(keywordValue, instance, ast, dynamicAnchors) && [new RegExp("")];
2827
+ };
2828
+
2829
+ var unevaluatedProperties = { compile: compile$1, interpret: interpret$1, collectEvaluatedProperties };
2830
+ unevaluatedProperties.compile;
2831
+ unevaluatedProperties.interpret;
2832
+ unevaluatedProperties.collectEvaluatedProperties;
2833
+
2834
+ const { Schema: Schema$6, Instance } = lib$1;
2835
+
2836
+
2837
+
2838
+ const compile = (schema) => Schema$6.value(schema);
2839
+
2840
+ const interpret = (uniqueItems, instance) => {
2841
+ if (!Instance.typeOf(instance, "array") || uniqueItems === false) {
2842
+ return true;
2843
+ }
2844
+
2845
+ const normalizedItems = Instance.map((item) => fastestStableStringify(Instance.value(item)), instance);
2846
+ return new Set(normalizedItems).size === normalizedItems.length;
2847
+ };
2848
+
2849
+ var uniqueItems = { compile, interpret };
2850
+ uniqueItems.compile;
2851
+ uniqueItems.interpret;
2852
+
2853
+ const { Keywords } = lib$1;
2854
+
2855
+
2856
+ var keywords = {
2857
+ additionalItems: additionalItems,
2858
+ additionalItems6: additionalItems6,
2859
+ additionalProperties: additionalProperties,
2860
+ additionalProperties6: additionalProperties6,
2861
+ allOf: allOf,
2862
+ anyOf: anyOf,
2863
+ const: _const,
2864
+ contains: contains,
2865
+ containsMinContainsMaxContains: containsMinContainsMaxContains,
2866
+ definitions: definitions,
2867
+ dependencies: dependencies,
2868
+ dependentRequired: dependentRequired,
2869
+ dependentSchemas: dependentSchemas,
2870
+ enum: _enum,
2871
+ exclusiveMaximum: exclusiveMaximum,
2872
+ exclusiveMinimum: exclusiveMinimum,
2873
+ if: _if,
2874
+ then: then,
2875
+ else: _else,
2876
+ items: items,
2877
+ items202012: items202012,
2878
+ maxItems: maxItems,
2879
+ maxLength: maxLength,
2880
+ maxLength6: maxLength6,
2881
+ maxProperties: maxProperties,
2882
+ maximumExclusiveMaximum: maximumExclusiveMaximum,
2883
+ maximum: maximum,
2884
+ metaData: Keywords.metaData,
2885
+ minItems: minItems,
2886
+ minLength: minLength,
2887
+ minLength6: minLength6,
2888
+ minProperties: minProperties,
2889
+ minimumExclusiveMinimum: minimumExclusiveMinimum,
2890
+ minimum: minimum,
2891
+ multipleOf: multipleOf,
2892
+ not: not,
2893
+ oneOf: oneOf,
2894
+ pattern: pattern,
2895
+ patternProperties: patternProperties,
2896
+ properties: properties,
2897
+ propertyNames: propertyNames,
2898
+ dynamicRef: dynamicRef,
2899
+ ref: ref,
2900
+ required: required,
2901
+ tupleItems: tupleItems,
2902
+ type: type,
2903
+ unevaluatedItems: unevaluatedItems,
2904
+ unevaluatedProperties: unevaluatedProperties,
2905
+ uniqueItems: uniqueItems,
2906
+ validate: Keywords.validate
2907
+ };
2908
+ keywords.additionalItems;
2909
+ keywords.additionalItems6;
2910
+ keywords.additionalProperties;
2911
+ keywords.additionalProperties6;
2912
+ keywords.allOf;
2913
+ keywords.anyOf;
2914
+ keywords.contains;
2915
+ keywords.containsMinContainsMaxContains;
2916
+ keywords.definitions;
2917
+ keywords.dependencies;
2918
+ keywords.dependentRequired;
2919
+ keywords.dependentSchemas;
2920
+ keywords.exclusiveMaximum;
2921
+ keywords.exclusiveMinimum;
2922
+ keywords.then;
2923
+ keywords.items;
2924
+ keywords.items202012;
2925
+ keywords.maxItems;
2926
+ keywords.maxLength;
2927
+ keywords.maxLength6;
2928
+ keywords.maxProperties;
2929
+ keywords.maximumExclusiveMaximum;
2930
+ keywords.maximum;
2931
+ keywords.metaData;
2932
+ keywords.minItems;
2933
+ keywords.minLength;
2934
+ keywords.minLength6;
2935
+ keywords.minProperties;
2936
+ keywords.minimumExclusiveMinimum;
2937
+ keywords.minimum;
2938
+ keywords.multipleOf;
2939
+ keywords.not;
2940
+ keywords.oneOf;
2941
+ keywords.pattern;
2942
+ keywords.patternProperties;
2943
+ keywords.properties;
2944
+ keywords.propertyNames;
2945
+ keywords.dynamicRef;
2946
+ keywords.ref;
2947
+ keywords.required;
2948
+ keywords.tupleItems;
2949
+ keywords.type;
2950
+ keywords.unevaluatedItems;
2951
+ keywords.unevaluatedProperties;
2952
+ keywords.uniqueItems;
2953
+ keywords.validate;
2954
+
2955
+ var schema$4 = `{
2956
+ "id": "http://json-schema.org/draft-04/schema#",
2957
+ "$schema": "http://json-schema.org/draft-04/schema#",
2958
+ "description": "Core schema meta-schema",
2959
+ "definitions": {
2960
+ "schemaArray": {
2961
+ "type": "array",
2962
+ "minItems": 1,
2963
+ "items": { "$ref": "#" }
2964
+ },
2965
+ "positiveInteger": {
2966
+ "type": "integer",
2967
+ "minimum": 0
2968
+ },
2969
+ "positiveIntegerDefault0": {
2970
+ "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
2971
+ },
2972
+ "simpleTypes": {
2973
+ "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
2974
+ },
2975
+ "stringArray": {
2976
+ "type": "array",
2977
+ "items": { "type": "string" },
2978
+ "minItems": 1,
2979
+ "uniqueItems": true
2980
+ }
2981
+ },
2982
+ "type": "object",
2983
+ "properties": {
2984
+ "id": {
2985
+ "type": "string"
2986
+ },
2987
+ "$schema": {
2988
+ "type": "string"
2989
+ },
2990
+ "title": {
2991
+ "type": "string"
2992
+ },
2993
+ "description": {
2994
+ "type": "string"
2995
+ },
2996
+ "default": {},
2997
+ "multipleOf": {
2998
+ "type": "number",
2999
+ "minimum": 0,
3000
+ "exclusiveMinimum": true
3001
+ },
3002
+ "maximum": {
3003
+ "type": "number"
3004
+ },
3005
+ "exclusiveMaximum": {
3006
+ "type": "boolean",
3007
+ "default": false
3008
+ },
3009
+ "minimum": {
3010
+ "type": "number"
3011
+ },
3012
+ "exclusiveMinimum": {
3013
+ "type": "boolean",
3014
+ "default": false
3015
+ },
3016
+ "maxLength": { "$ref": "#/definitions/positiveInteger" },
3017
+ "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
3018
+ "pattern": {
3019
+ "type": "string",
3020
+ "format": "regex"
3021
+ },
3022
+ "additionalItems": {
3023
+ "anyOf": [
3024
+ { "type": "boolean" },
3025
+ { "$ref": "#" }
3026
+ ],
3027
+ "default": {}
3028
+ },
3029
+ "items": {
3030
+ "anyOf": [
3031
+ { "$ref": "#" },
3032
+ { "$ref": "#/definitions/schemaArray" }
3033
+ ],
3034
+ "default": {}
3035
+ },
3036
+ "maxItems": { "$ref": "#/definitions/positiveInteger" },
3037
+ "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
3038
+ "uniqueItems": {
3039
+ "type": "boolean",
3040
+ "default": false
3041
+ },
3042
+ "maxProperties": { "$ref": "#/definitions/positiveInteger" },
3043
+ "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
3044
+ "required": { "$ref": "#/definitions/stringArray" },
3045
+ "additionalProperties": {
3046
+ "anyOf": [
3047
+ { "type": "boolean" },
3048
+ { "$ref": "#" }
3049
+ ],
3050
+ "default": {}
3051
+ },
3052
+ "definitions": {
3053
+ "type": "object",
3054
+ "additionalProperties": { "$ref": "#" },
3055
+ "default": {}
3056
+ },
3057
+ "properties": {
3058
+ "type": "object",
3059
+ "additionalProperties": { "$ref": "#" },
3060
+ "default": {}
3061
+ },
3062
+ "patternProperties": {
3063
+ "type": "object",
3064
+ "additionalProperties": { "$ref": "#" },
3065
+ "default": {}
3066
+ },
3067
+ "dependencies": {
3068
+ "type": "object",
3069
+ "additionalProperties": {
3070
+ "anyOf": [
3071
+ { "$ref": "#" },
3072
+ { "$ref": "#/definitions/stringArray" }
3073
+ ]
3074
+ }
3075
+ },
3076
+ "enum": {
3077
+ "type": "array",
3078
+ "minItems": 1,
3079
+ "uniqueItems": true
3080
+ },
3081
+ "type": {
3082
+ "anyOf": [
3083
+ { "$ref": "#/definitions/simpleTypes" },
3084
+ {
3085
+ "type": "array",
3086
+ "items": { "$ref": "#/definitions/simpleTypes" },
3087
+ "minItems": 1,
3088
+ "uniqueItems": true
3089
+ }
3090
+ ]
3091
+ },
3092
+ "format": { "type": "string" },
3093
+ "allOf": { "$ref": "#/definitions/schemaArray" },
3094
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
3095
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
3096
+ "not": { "$ref": "#" }
3097
+ },
3098
+ "dependencies": {
3099
+ "exclusiveMaximum": [ "maximum" ],
3100
+ "exclusiveMinimum": [ "minimum" ]
3101
+ },
3102
+ "default": {}
3103
+ }`;
3104
+
3105
+ var hyperSchema = `{
3106
+ "$schema": "http://json-schema.org/draft-04/hyper-schema#",
3107
+ "id": "http://json-schema.org/draft-04/hyper-schema#",
3108
+ "title": "JSON Hyper-Schema",
3109
+ "allOf": [
3110
+ {"$ref": "http://json-schema.org/draft-04/schema#"}
3111
+ ],
3112
+ "properties": {
3113
+ "additionalItems": {
3114
+ "anyOf": [
3115
+ {"type": "boolean"},
3116
+ {"$ref": "#"}
3117
+ ]
3118
+ },
3119
+ "additionalProperties": {
3120
+ "anyOf": [
3121
+ {"type": "boolean"},
3122
+ {"$ref": "#"}
3123
+ ]
3124
+ },
3125
+ "dependencies": {
3126
+ "additionalProperties": {
3127
+ "anyOf": [
3128
+ {"$ref": "#"},
3129
+ {"type": "array"}
3130
+ ]
3131
+ }
3132
+ },
3133
+ "items": {
3134
+ "anyOf": [
3135
+ {"$ref": "#"},
3136
+ {"$ref": "#/definitions/schemaArray"}
3137
+ ]
3138
+ },
3139
+ "definitions": {
3140
+ "additionalProperties": {"$ref": "#"}
3141
+ },
3142
+ "patternProperties": {
3143
+ "additionalProperties": {"$ref": "#"}
3144
+ },
3145
+ "properties": {
3146
+ "additionalProperties": {"$ref": "#"}
3147
+ },
3148
+ "allOf": {"$ref": "#/definitions/schemaArray"},
3149
+ "anyOf": {"$ref": "#/definitions/schemaArray"},
3150
+ "oneOf": {"$ref": "#/definitions/schemaArray"},
3151
+ "not": { "$ref": "#" },
3152
+
3153
+ "links": {
3154
+ "type": "array",
3155
+ "items": {"$ref": "#/definitions/linkDescription"}
3156
+ },
3157
+ "fragmentResolution": {
3158
+ "type": "string"
3159
+ },
3160
+ "media": {
3161
+ "type": "object",
3162
+ "properties": {
3163
+ "type": {
3164
+ "description": "A media type, as described in RFC 2046",
3165
+ "type": "string"
3166
+ },
3167
+ "binaryEncoding": {
3168
+ "description": "A content encoding scheme, as described in RFC 2045",
3169
+ "type": "string"
3170
+ }
3171
+ }
3172
+ },
3173
+ "pathStart": {
3174
+ "description": "Instances' URIs must start with this value for this schema to apply to them",
3175
+ "type": "string",
3176
+ "format": "uri"
3177
+ }
3178
+ },
3179
+ "definitions": {
3180
+ "schemaArray": {
3181
+ "type": "array",
3182
+ "items": {"$ref": "#"}
3183
+ },
3184
+ "linkDescription": {
3185
+ "title": "Link Description Object",
3186
+ "type": "object",
3187
+ "required": ["href", "rel"],
3188
+ "properties": {
3189
+ "href": {
3190
+ "description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
3191
+ "type": "string"
3192
+ },
3193
+ "rel": {
3194
+ "description": "relation to the target resource of the link",
3195
+ "type": "string"
3196
+ },
3197
+ "title": {
3198
+ "description": "a title for the link",
3199
+ "type": "string"
3200
+ },
3201
+ "targetSchema": {
3202
+ "description": "JSON Schema describing the link target",
3203
+ "$ref": "#"
3204
+ },
3205
+ "mediaType": {
3206
+ "description": "media type (as defined by RFC 2046) describing the link target",
3207
+ "type": "string"
3208
+ },
3209
+ "method": {
3210
+ "description": "method for requesting the target of the link (e.g. for HTTP this might be \\"GET\\" or \\"DELETE\\")",
3211
+ "type": "string"
3212
+ },
3213
+ "encType": {
3214
+ "description": "The media type in which to submit data along with the request",
3215
+ "type": "string",
3216
+ "default": "application/json"
3217
+ },
3218
+ "schema": {
3219
+ "description": "Schema describing the data to submit along with the request",
3220
+ "$ref": "#"
3221
+ }
3222
+ }
3223
+ },
3224
+ "readOnly": {
3225
+ "description": "If true, indicates that the value of this property is controlled by the server.",
3226
+ "type": "boolean",
3227
+ "default": false
3228
+ }
3229
+ },
3230
+ "links": [
3231
+ {
3232
+ "rel": "self",
3233
+ "href": "{+id}"
3234
+ },
3235
+ {
3236
+ "rel": "full",
3237
+ "href": "{+($ref)}"
3238
+ }
3239
+ ]
3240
+ }`;
3241
+
3242
+ const { Core: Core$5, Schema: Schema$5 } = lib$1;
3243
+
3244
+
3245
+
3246
+
3247
+
3248
+ // JSON Schema Draft-04
3249
+ const schemaVersion$4 = "http://json-schema.org/draft-04/schema";
3250
+
3251
+ Schema$5.setConfig(schemaVersion$4, "baseToken", "id");
3252
+ Schema$5.setConfig(schemaVersion$4, "embeddedToken", "id");
3253
+ Schema$5.setConfig(schemaVersion$4, "anchorToken", "id");
3254
+ Schema$5.setConfig(schemaVersion$4, "jrefToken", "$ref");
3255
+
3256
+ Schema$5.add(JSON.parse(schema$4));
3257
+ Core$5.defineVocabulary(schemaVersion$4, {
3258
+ "validate": keywords.validate,
3259
+ "additionalItems": keywords.additionalItems,
3260
+ "additionalProperties": keywords.additionalProperties,
3261
+ "allOf": keywords.allOf,
3262
+ "anyOf": keywords.anyOf,
3263
+ "default": keywords.metaData,
3264
+ "definitions": keywords.definitions,
3265
+ "dependencies": keywords.dependencies,
3266
+ "description": keywords.metaData,
3267
+ "enum": keywords.enum,
3268
+ "format": keywords.metaData,
3269
+ "items": keywords.items,
3270
+ "maxItems": keywords.maxItems,
3271
+ "maxLength": keywords.maxLength,
3272
+ "maxProperties": keywords.maxProperties,
3273
+ "maximum": keywords.maximumExclusiveMaximum,
3274
+ "minItems": keywords.minItems,
3275
+ "minLength": keywords.minLength,
3276
+ "minProperties": keywords.minProperties,
3277
+ "minimum": keywords.minimumExclusiveMinimum,
3278
+ "multipleOf": keywords.multipleOf,
3279
+ "not": keywords.not,
3280
+ "oneOf": keywords.oneOf,
3281
+ "pattern": keywords.pattern,
3282
+ "patternProperties": keywords.patternProperties,
3283
+ "properties": keywords.properties,
3284
+ "required": keywords.required,
3285
+ "title": keywords.metaData,
3286
+ "type": keywords.type,
3287
+ "uniqueItems": keywords.uniqueItems
3288
+ });
3289
+
3290
+ // JSON Hyper-Schema Draft-04
3291
+ const hyperSchemaVersion = "http://json-schema.org/draft-04/hyper-schema";
3292
+
3293
+ Schema$5.setConfig(hyperSchemaVersion, "baseToken", "id");
3294
+ Schema$5.setConfig(hyperSchemaVersion, "embeddedToken", "id");
3295
+ Schema$5.setConfig(hyperSchemaVersion, "anchorToken", "id");
3296
+ Schema$5.setConfig(hyperSchemaVersion, "jrefToken", "$ref");
3297
+
3298
+ Schema$5.add(JSON.parse(hyperSchema));
3299
+ Core$5.defineVocabulary(hyperSchemaVersion, {
3300
+ "validate": keywords.validate,
3301
+ "additionalItems": keywords.additionalItems,
3302
+ "additionalProperties": keywords.additionalProperties,
3303
+ "allOf": keywords.allOf,
3304
+ "anyOf": keywords.anyOf,
3305
+ "default": keywords.metaData,
3306
+ "definitions": keywords.definitions,
3307
+ "dependencies": keywords.dependencies,
3308
+ "description": keywords.metaData,
3309
+ "enum": keywords.enum,
3310
+ "format": keywords.metaData,
3311
+ "fragmentResolution": keywords.metaData,
3312
+ "items": keywords.items,
3313
+ "maxItems": keywords.maxItems,
3314
+ "minProperties": keywords.minProperties,
3315
+ "maxProperties": keywords.maxProperties,
3316
+ "maximum": keywords.maximumExclusiveMaximum,
3317
+ "media": keywords.metaData,
3318
+ "minItems": keywords.minItems,
3319
+ "minLength": keywords.minLength,
3320
+ "maxLength": keywords.maxLength,
3321
+ "minimum": keywords.minimumExclusiveMinimum,
3322
+ "multipleOf": keywords.multipleOf,
3323
+ "links": keywords.metaData,
3324
+ "not": keywords.not,
3325
+ "oneOf": keywords.oneOf,
3326
+ "pathStart": keywords.metaData,
3327
+ "pattern": keywords.pattern,
3328
+ "patternProperties": keywords.patternProperties,
3329
+ "properties": keywords.properties,
3330
+ "readOnly": keywords.metaData,
3331
+ "required": keywords.required,
3332
+ "title": keywords.metaData,
3333
+ "type": keywords.type,
3334
+ "uniqueItems": keywords.uniqueItems
3335
+ });
3336
+
3337
+ var schema$3 = `{
3338
+ "$schema": "http://json-schema.org/draft-06/schema#",
3339
+ "$id": "http://json-schema.org/draft-06/schema#",
3340
+ "title": "Core schema meta-schema",
3341
+ "definitions": {
3342
+ "schemaArray": {
3343
+ "type": "array",
3344
+ "minItems": 1,
3345
+ "items": { "$ref": "#" }
3346
+ },
3347
+ "nonNegativeInteger": {
3348
+ "type": "integer",
3349
+ "minimum": 0
3350
+ },
3351
+ "nonNegativeIntegerDefault0": {
3352
+ "allOf": [
3353
+ { "$ref": "#/definitions/nonNegativeInteger" },
3354
+ { "default": 0 }
3355
+ ]
3356
+ },
3357
+ "simpleTypes": {
3358
+ "enum": [
3359
+ "array",
3360
+ "boolean",
3361
+ "integer",
3362
+ "null",
3363
+ "number",
3364
+ "object",
3365
+ "string"
3366
+ ]
3367
+ },
3368
+ "stringArray": {
3369
+ "type": "array",
3370
+ "items": { "type": "string" },
3371
+ "uniqueItems": true,
3372
+ "default": []
3373
+ }
3374
+ },
3375
+ "type": ["object", "boolean"],
3376
+ "properties": {
3377
+ "$id": {
3378
+ "type": "string",
3379
+ "format": "uri-reference"
3380
+ },
3381
+ "$schema": {
3382
+ "type": "string",
3383
+ "format": "uri"
3384
+ },
3385
+ "$ref": {
3386
+ "type": "string",
3387
+ "format": "uri-reference"
3388
+ },
3389
+ "title": {
3390
+ "type": "string"
3391
+ },
3392
+ "description": {
3393
+ "type": "string"
3394
+ },
3395
+ "default": {},
3396
+ "examples": {
3397
+ "type": "array",
3398
+ "items": {}
3399
+ },
3400
+ "multipleOf": {
3401
+ "type": "number",
3402
+ "exclusiveMinimum": 0
3403
+ },
3404
+ "maximum": {
3405
+ "type": "number"
3406
+ },
3407
+ "exclusiveMaximum": {
3408
+ "type": "number"
3409
+ },
3410
+ "minimum": {
3411
+ "type": "number"
3412
+ },
3413
+ "exclusiveMinimum": {
3414
+ "type": "number"
3415
+ },
3416
+ "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
3417
+ "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3418
+ "pattern": {
3419
+ "type": "string",
3420
+ "format": "regex"
3421
+ },
3422
+ "additionalItems": { "$ref": "#" },
3423
+ "items": {
3424
+ "anyOf": [
3425
+ { "$ref": "#" },
3426
+ { "$ref": "#/definitions/schemaArray" }
3427
+ ],
3428
+ "default": {}
3429
+ },
3430
+ "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
3431
+ "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3432
+ "uniqueItems": {
3433
+ "type": "boolean",
3434
+ "default": false
3435
+ },
3436
+ "contains": { "$ref": "#" },
3437
+ "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
3438
+ "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3439
+ "required": { "$ref": "#/definitions/stringArray" },
3440
+ "additionalProperties": { "$ref": "#" },
3441
+ "definitions": {
3442
+ "type": "object",
3443
+ "additionalProperties": { "$ref": "#" },
3444
+ "default": {}
3445
+ },
3446
+ "properties": {
3447
+ "type": "object",
3448
+ "additionalProperties": { "$ref": "#" },
3449
+ "default": {}
3450
+ },
3451
+ "patternProperties": {
3452
+ "type": "object",
3453
+ "additionalProperties": { "$ref": "#" },
3454
+ "default": {}
3455
+ },
3456
+ "dependencies": {
3457
+ "type": "object",
3458
+ "additionalProperties": {
3459
+ "anyOf": [
3460
+ { "$ref": "#" },
3461
+ { "$ref": "#/definitions/stringArray" }
3462
+ ]
3463
+ }
3464
+ },
3465
+ "propertyNames": { "$ref": "#" },
3466
+ "const": {},
3467
+ "enum": {
3468
+ "type": "array",
3469
+ "minItems": 1,
3470
+ "uniqueItems": true
3471
+ },
3472
+ "type": {
3473
+ "anyOf": [
3474
+ { "$ref": "#/definitions/simpleTypes" },
3475
+ {
3476
+ "type": "array",
3477
+ "items": { "$ref": "#/definitions/simpleTypes" },
3478
+ "minItems": 1,
3479
+ "uniqueItems": true
3480
+ }
3481
+ ]
3482
+ },
3483
+ "format": { "type": "string" },
3484
+ "allOf": { "$ref": "#/definitions/schemaArray" },
3485
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
3486
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
3487
+ "not": { "$ref": "#" }
3488
+ },
3489
+ "default": {}
3490
+ }`;
3491
+
3492
+ const { Core: Core$4, Schema: Schema$4 } = lib$1;
3493
+
3494
+
3495
+
3496
+
3497
+ const schemaVersion$3 = "http://json-schema.org/draft-06/schema";
3498
+
3499
+ Schema$4.setConfig(schemaVersion$3, "baseToken", "$id");
3500
+ Schema$4.setConfig(schemaVersion$3, "embeddedToken", "$id");
3501
+ Schema$4.setConfig(schemaVersion$3, "anchorToken", "$id");
3502
+ Schema$4.setConfig(schemaVersion$3, "jrefToken", "$ref");
3503
+
3504
+ Schema$4.add(JSON.parse(schema$3));
3505
+ Core$4.defineVocabulary(schemaVersion$3, {
3506
+ "validate": keywords.validate,
3507
+ "additionalItems": keywords.additionalItems6,
3508
+ "additionalProperties": keywords.additionalProperties6,
3509
+ "allOf": keywords.allOf,
3510
+ "anyOf": keywords.anyOf,
3511
+ "const": keywords.const,
3512
+ "contains": keywords.contains,
3513
+ "default": keywords.metaData,
3514
+ "definitions": keywords.definitions,
3515
+ "dependencies": keywords.dependencies,
3516
+ "description": keywords.metaData,
3517
+ "enum": keywords.enum,
3518
+ "examples": keywords.metaData,
3519
+ "exclusiveMaximum": keywords.exclusiveMaximum,
3520
+ "exclusiveMinimum": keywords.exclusiveMinimum,
3521
+ "format": keywords.metaData,
3522
+ "items": keywords.items,
3523
+ "maxItems": keywords.maxItems,
3524
+ "maxLength": keywords.maxLength6,
3525
+ "maxProperties": keywords.maxProperties,
3526
+ "maximum": keywords.maximum,
3527
+ "minItems": keywords.minItems,
3528
+ "minLength": keywords.minLength6,
3529
+ "minProperties": keywords.minProperties,
3530
+ "minimum": keywords.minimum,
3531
+ "multipleOf": keywords.multipleOf,
3532
+ "not": keywords.not,
3533
+ "oneOf": keywords.oneOf,
3534
+ "pattern": keywords.pattern,
3535
+ "patternProperties": keywords.patternProperties,
3536
+ "properties": keywords.properties,
3537
+ "propertyNames": keywords.propertyNames,
3538
+ "required": keywords.required,
3539
+ "title": keywords.metaData,
3540
+ "type": keywords.type,
3541
+ "uniqueItems": keywords.uniqueItems
3542
+ });
3543
+
3544
+ var schema$2 = `{
3545
+ "$schema": "http://json-schema.org/draft-07/schema#",
3546
+ "$id": "http://json-schema.org/draft-07/schema#",
3547
+ "title": "Core schema meta-schema",
3548
+ "definitions": {
3549
+ "schemaArray": {
3550
+ "type": "array",
3551
+ "minItems": 1,
3552
+ "items": { "$ref": "#" }
3553
+ },
3554
+ "nonNegativeInteger": {
3555
+ "type": "integer",
3556
+ "minimum": 0
3557
+ },
3558
+ "nonNegativeIntegerDefault0": {
3559
+ "allOf": [
3560
+ { "$ref": "#/definitions/nonNegativeInteger" },
3561
+ { "default": 0 }
3562
+ ]
3563
+ },
3564
+ "simpleTypes": {
3565
+ "enum": [
3566
+ "array",
3567
+ "boolean",
3568
+ "integer",
3569
+ "null",
3570
+ "number",
3571
+ "object",
3572
+ "string"
3573
+ ]
3574
+ },
3575
+ "stringArray": {
3576
+ "type": "array",
3577
+ "items": { "type": "string" },
3578
+ "uniqueItems": true,
3579
+ "default": []
3580
+ }
3581
+ },
3582
+ "type": ["object", "boolean"],
3583
+ "properties": {
3584
+ "$id": {
3585
+ "type": "string",
3586
+ "format": "uri-reference"
3587
+ },
3588
+ "$schema": {
3589
+ "type": "string",
3590
+ "format": "uri"
3591
+ },
3592
+ "$ref": {
3593
+ "type": "string",
3594
+ "format": "uri-reference"
3595
+ },
3596
+ "$comment": {
3597
+ "type": "string"
3598
+ },
3599
+ "title": {
3600
+ "type": "string"
3601
+ },
3602
+ "description": {
3603
+ "type": "string"
3604
+ },
3605
+ "default": true,
3606
+ "readOnly": {
3607
+ "type": "boolean",
3608
+ "default": false
3609
+ },
3610
+ "writeOnly": {
3611
+ "type": "boolean",
3612
+ "default": false
3613
+ },
3614
+ "examples": {
3615
+ "type": "array",
3616
+ "items": true
3617
+ },
3618
+ "multipleOf": {
3619
+ "type": "number",
3620
+ "exclusiveMinimum": 0
3621
+ },
3622
+ "maximum": {
3623
+ "type": "number"
3624
+ },
3625
+ "exclusiveMaximum": {
3626
+ "type": "number"
3627
+ },
3628
+ "minimum": {
3629
+ "type": "number"
3630
+ },
3631
+ "exclusiveMinimum": {
3632
+ "type": "number"
3633
+ },
3634
+ "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
3635
+ "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3636
+ "pattern": {
3637
+ "type": "string",
3638
+ "format": "regex"
3639
+ },
3640
+ "additionalItems": { "$ref": "#" },
3641
+ "items": {
3642
+ "anyOf": [
3643
+ { "$ref": "#" },
3644
+ { "$ref": "#/definitions/schemaArray" }
3645
+ ],
3646
+ "default": true
3647
+ },
3648
+ "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
3649
+ "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3650
+ "uniqueItems": {
3651
+ "type": "boolean",
3652
+ "default": false
3653
+ },
3654
+ "contains": { "$ref": "#" },
3655
+ "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
3656
+ "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3657
+ "required": { "$ref": "#/definitions/stringArray" },
3658
+ "additionalProperties": { "$ref": "#" },
3659
+ "definitions": {
3660
+ "type": "object",
3661
+ "additionalProperties": { "$ref": "#" },
3662
+ "default": {}
3663
+ },
3664
+ "properties": {
3665
+ "type": "object",
3666
+ "additionalProperties": { "$ref": "#" },
3667
+ "default": {}
3668
+ },
3669
+ "patternProperties": {
3670
+ "type": "object",
3671
+ "additionalProperties": { "$ref": "#" },
3672
+ "propertyNames": { "format": "regex" },
3673
+ "default": {}
3674
+ },
3675
+ "dependencies": {
3676
+ "type": "object",
3677
+ "additionalProperties": {
3678
+ "anyOf": [
3679
+ { "$ref": "#" },
3680
+ { "$ref": "#/definitions/stringArray" }
3681
+ ]
3682
+ }
3683
+ },
3684
+ "propertyNames": { "$ref": "#" },
3685
+ "const": true,
3686
+ "enum": {
3687
+ "type": "array",
3688
+ "items": true,
3689
+ "minItems": 1,
3690
+ "uniqueItems": true
3691
+ },
3692
+ "type": {
3693
+ "anyOf": [
3694
+ { "$ref": "#/definitions/simpleTypes" },
3695
+ {
3696
+ "type": "array",
3697
+ "items": { "$ref": "#/definitions/simpleTypes" },
3698
+ "minItems": 1,
3699
+ "uniqueItems": true
3700
+ }
3701
+ ]
3702
+ },
3703
+ "format": { "type": "string" },
3704
+ "contentMediaType": { "type": "string" },
3705
+ "contentEncoding": { "type": "string" },
3706
+ "if": { "$ref": "#" },
3707
+ "then": { "$ref": "#" },
3708
+ "else": { "$ref": "#" },
3709
+ "allOf": { "$ref": "#/definitions/schemaArray" },
3710
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
3711
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
3712
+ "not": { "$ref": "#" }
3713
+ },
3714
+ "default": true
3715
+ }`;
3716
+
3717
+ const { Core: Core$3, Schema: Schema$3 } = lib$1;
3718
+
3719
+
3720
+
3721
+
3722
+ const schemaVersion$2 = "http://json-schema.org/draft-07/schema";
3723
+
3724
+ Schema$3.setConfig(schemaVersion$2, "baseToken", "$id");
3725
+ Schema$3.setConfig(schemaVersion$2, "embeddedToken", "$id");
3726
+ Schema$3.setConfig(schemaVersion$2, "anchorToken", "$id");
3727
+ Schema$3.setConfig(schemaVersion$2, "jrefToken", "$ref");
3728
+
3729
+ Schema$3.add(JSON.parse(schema$2));
3730
+ Core$3.defineVocabulary(schemaVersion$2, {
3731
+ "validate": keywords.validate,
3732
+ "additionalItems": keywords.additionalItems6,
3733
+ "additionalProperties": keywords.additionalProperties6,
3734
+ "allOf": keywords.allOf,
3735
+ "anyOf": keywords.anyOf,
3736
+ "const": keywords.const,
3737
+ "contains": keywords.contains,
3738
+ "default": keywords.metaData,
3739
+ "definitions": keywords.definitions,
3740
+ "dependencies": keywords.dependencies,
3741
+ "description": keywords.metaData,
3742
+ "enum": keywords.enum,
3743
+ "exclusiveMaximum": keywords.exclusiveMaximum,
3744
+ "exclusiveMinimum": keywords.exclusiveMinimum,
3745
+ "format": keywords.metaData,
3746
+ "if": keywords.if,
3747
+ "then": keywords.then,
3748
+ "else": keywords.else,
3749
+ "items": keywords.items,
3750
+ "maxItems": keywords.maxItems,
3751
+ "maxLength": keywords.maxLength6,
3752
+ "maxProperties": keywords.maxProperties,
3753
+ "maximum": keywords.maximum,
3754
+ "minItems": keywords.minItems,
3755
+ "minLength": keywords.minLength6,
3756
+ "minProperties": keywords.minProperties,
3757
+ "minimum": keywords.minimum,
3758
+ "multipleOf": keywords.multipleOf,
3759
+ "not": keywords.not,
3760
+ "oneOf": keywords.oneOf,
3761
+ "pattern": keywords.pattern,
3762
+ "patternProperties": keywords.patternProperties,
3763
+ "properties": keywords.properties,
3764
+ "propertyNames": keywords.propertyNames,
3765
+ "readOnly": keywords.metaData,
3766
+ "required": keywords.required,
3767
+ "title": keywords.metaData,
3768
+ "type": keywords.type,
3769
+ "uniqueItems": keywords.uniqueItems,
3770
+ "writeOnly": keywords.metaData
3771
+ });
3772
+
3773
+ var schema$1 = `{
3774
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3775
+ "$id": "https://json-schema.org/draft/2019-09/schema",
3776
+ "$vocabulary": {
3777
+ "https://json-schema.org/draft/2019-09/vocab/core": true,
3778
+ "https://json-schema.org/draft/2019-09/vocab/applicator": true,
3779
+ "https://json-schema.org/draft/2019-09/vocab/validation": true,
3780
+ "https://json-schema.org/draft/2019-09/vocab/meta-data": true,
3781
+ "https://json-schema.org/draft/2019-09/vocab/format": false,
3782
+ "https://json-schema.org/draft/2019-09/vocab/content": true
3783
+ },
3784
+ "$recursiveAnchor": true,
3785
+
3786
+ "title": "Core and Validation specifications meta-schema",
3787
+ "allOf": [
3788
+ {"$ref": "meta/core"},
3789
+ {"$ref": "meta/applicator"},
3790
+ {"$ref": "meta/validation"},
3791
+ {"$ref": "meta/meta-data"},
3792
+ {"$ref": "meta/format"},
3793
+ {"$ref": "meta/content"}
3794
+ ],
3795
+ "type": ["object", "boolean"],
3796
+ "properties": {
3797
+ "definitions": {
3798
+ "$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.",
3799
+ "type": "object",
3800
+ "additionalProperties": { "$recursiveRef": "#" },
3801
+ "default": {}
3802
+ },
3803
+ "dependencies": {
3804
+ "$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",
3805
+ "type": "object",
3806
+ "additionalProperties": {
3807
+ "anyOf": [
3808
+ { "$recursiveRef": "#" },
3809
+ { "$ref": "meta/validation#/$defs/stringArray" }
3810
+ ]
3811
+ }
3812
+ }
3813
+ }
3814
+ }`;
3815
+
3816
+ var core$1 = `{
3817
+ "$id": "https://json-schema.org/draft/2019-09/meta/core",
3818
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3819
+ "$vocabulary": {
3820
+ "https://json-schema.org/draft/2019-09/vocab/core": true
3821
+ },
3822
+ "$recursiveAnchor": true,
3823
+
3824
+ "title": "Core vocabulary meta-schema",
3825
+ "type": ["object", "boolean"],
3826
+ "properties": {
3827
+ "$id": {
3828
+ "type": "string",
3829
+ "format": "uri-reference",
3830
+ "$comment": "Non-empty fragments not allowed.",
3831
+ "pattern": "^[^#]*#?$"
3832
+ },
3833
+ "$schema": {
3834
+ "type": "string",
3835
+ "format": "uri"
3836
+ },
3837
+ "$anchor": {
3838
+ "type": "string",
3839
+ "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$"
3840
+ },
3841
+ "$ref": {
3842
+ "type": "string",
3843
+ "format": "uri-reference"
3844
+ },
3845
+ "$recursiveRef": {
3846
+ "type": "string",
3847
+ "format": "uri-reference"
3848
+ },
3849
+ "$recursiveAnchor": {
3850
+ "type": "boolean",
3851
+ "default": false
3852
+ },
3853
+ "$vocabulary": {
3854
+ "type": "object",
3855
+ "propertyNames": {
3856
+ "type": "string",
3857
+ "format": "uri"
3858
+ },
3859
+ "additionalProperties": {
3860
+ "type": "boolean"
3861
+ }
3862
+ },
3863
+ "$comment": {
3864
+ "type": "string"
3865
+ },
3866
+ "$defs": {
3867
+ "type": "object",
3868
+ "additionalProperties": { "$recursiveRef": "#" },
3869
+ "default": {}
3870
+ }
3871
+ }
3872
+ }`;
3873
+
3874
+ var applicator$1 = `{
3875
+ "$id": "https://json-schema.org/draft/2019-09/meta/applicator",
3876
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3877
+ "$vocabulary": {
3878
+ "https://json-schema.org/draft/2019-09/vocab/applicator": true
3879
+ },
3880
+ "$recursiveAnchor": true,
3881
+
3882
+ "title": "Applicator vocabulary meta-schema",
3883
+ "properties": {
3884
+ "additionalItems": { "$recursiveRef": "#" },
3885
+ "unevaluatedItems": { "$recursiveRef": "#" },
3886
+ "items": {
3887
+ "anyOf": [
3888
+ { "$recursiveRef": "#" },
3889
+ { "$ref": "#/$defs/schemaArray" }
3890
+ ]
3891
+ },
3892
+ "contains": { "$recursiveRef": "#" },
3893
+ "additionalProperties": { "$recursiveRef": "#" },
3894
+ "unevaluatedProperties": { "$recursiveRef": "#" },
3895
+ "properties": {
3896
+ "type": "object",
3897
+ "additionalProperties": { "$recursiveRef": "#" },
3898
+ "default": {}
3899
+ },
3900
+ "patternProperties": {
3901
+ "type": "object",
3902
+ "additionalProperties": { "$recursiveRef": "#" },
3903
+ "propertyNames": { "format": "regex" },
3904
+ "default": {}
3905
+ },
3906
+ "dependentSchemas": {
3907
+ "type": "object",
3908
+ "additionalProperties": {
3909
+ "$recursiveRef": "#"
3910
+ }
3911
+ },
3912
+ "propertyNames": { "$recursiveRef": "#" },
3913
+ "if": { "$recursiveRef": "#" },
3914
+ "then": { "$recursiveRef": "#" },
3915
+ "else": { "$recursiveRef": "#" },
3916
+ "allOf": { "$ref": "#/$defs/schemaArray" },
3917
+ "anyOf": { "$ref": "#/$defs/schemaArray" },
3918
+ "oneOf": { "$ref": "#/$defs/schemaArray" },
3919
+ "not": { "$recursiveRef": "#" }
3920
+ },
3921
+ "$defs": {
3922
+ "schemaArray": {
3923
+ "type": "array",
3924
+ "minItems": 1,
3925
+ "items": { "$recursiveRef": "#" }
3926
+ }
3927
+ }
3928
+ }`;
3929
+
3930
+ var validation$1 = `{
3931
+ "$id": "https://json-schema.org/draft/2019-09/meta/validation",
3932
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3933
+ "$vocabulary": {
3934
+ "https://json-schema.org/draft/2019-09/vocab/validation": true
3935
+ },
3936
+ "$recursiveAnchor": true,
3937
+
3938
+ "title": "Validation vocabulary meta-schema",
3939
+ "type": ["object", "boolean"],
3940
+ "properties": {
3941
+ "multipleOf": {
3942
+ "type": "number",
3943
+ "exclusiveMinimum": 0
3944
+ },
3945
+ "maximum": {
3946
+ "type": "number"
3947
+ },
3948
+ "exclusiveMaximum": {
3949
+ "type": "number"
3950
+ },
3951
+ "minimum": {
3952
+ "type": "number"
3953
+ },
3954
+ "exclusiveMinimum": {
3955
+ "type": "number"
3956
+ },
3957
+ "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
3958
+ "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
3959
+ "pattern": {
3960
+ "type": "string",
3961
+ "format": "regex"
3962
+ },
3963
+ "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
3964
+ "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
3965
+ "uniqueItems": {
3966
+ "type": "boolean",
3967
+ "default": false
3968
+ },
3969
+ "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
3970
+ "minContains": {
3971
+ "$ref": "#/$defs/nonNegativeInteger",
3972
+ "default": 1
3973
+ },
3974
+ "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
3975
+ "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
3976
+ "required": { "$ref": "#/$defs/stringArray" },
3977
+ "dependentRequired": {
3978
+ "type": "object",
3979
+ "additionalProperties": {
3980
+ "$ref": "#/$defs/stringArray"
3981
+ }
3982
+ },
3983
+ "const": true,
3984
+ "enum": {
3985
+ "type": "array",
3986
+ "items": true
3987
+ },
3988
+ "type": {
3989
+ "anyOf": [
3990
+ { "$ref": "#/$defs/simpleTypes" },
3991
+ {
3992
+ "type": "array",
3993
+ "items": { "$ref": "#/$defs/simpleTypes" },
3994
+ "minItems": 1,
3995
+ "uniqueItems": true
3996
+ }
3997
+ ]
3998
+ }
3999
+ },
4000
+ "$defs": {
4001
+ "nonNegativeInteger": {
4002
+ "type": "integer",
4003
+ "minimum": 0
4004
+ },
4005
+ "nonNegativeIntegerDefault0": {
4006
+ "$ref": "#/$defs/nonNegativeInteger",
4007
+ "default": 0
4008
+ },
4009
+ "simpleTypes": {
4010
+ "enum": [
4011
+ "array",
4012
+ "boolean",
4013
+ "integer",
4014
+ "null",
4015
+ "number",
4016
+ "object",
4017
+ "string"
4018
+ ]
4019
+ },
4020
+ "stringArray": {
4021
+ "type": "array",
4022
+ "items": { "type": "string" },
4023
+ "uniqueItems": true,
4024
+ "default": []
4025
+ }
4026
+ }
4027
+ }`;
4028
+
4029
+ var metaData$1 = `{
4030
+ "$id": "https://json-schema.org/draft/2019-09/meta/meta-data",
4031
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4032
+ "$vocabulary": {
4033
+ "https://json-schema.org/draft/2019-09/vocab/meta-data": true
4034
+ },
4035
+ "$recursiveAnchor": true,
4036
+
4037
+ "title": "Meta-data vocabulary meta-schema",
4038
+
4039
+ "type": ["object", "boolean"],
4040
+ "properties": {
4041
+ "title": {
4042
+ "type": "string"
4043
+ },
4044
+ "description": {
4045
+ "type": "string"
4046
+ },
4047
+ "default": true,
4048
+ "deprecated": {
4049
+ "type": "boolean",
4050
+ "default": false
4051
+ },
4052
+ "readOnly": {
4053
+ "type": "boolean",
4054
+ "default": false
4055
+ },
4056
+ "writeOnly": {
4057
+ "type": "boolean",
4058
+ "default": false
4059
+ },
4060
+ "examples": {
4061
+ "type": "array",
4062
+ "items": true
4063
+ }
4064
+ }
4065
+ }`;
4066
+
4067
+ var format = `{
4068
+ "$id": "https://json-schema.org/draft/2019-09/meta/format",
4069
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4070
+ "$vocabulary": {
4071
+ "https://json-schema.org/draft/2019-09/vocab/format": true
4072
+ },
4073
+ "$recursiveAnchor": true,
4074
+
4075
+ "title": "Format vocabulary meta-schema",
4076
+ "type": ["object", "boolean"],
4077
+ "properties": {
4078
+ "format": { "type": "string" }
4079
+ }
4080
+ }`;
4081
+
4082
+ var content$1 = `{
4083
+ "$id": "https://json-schema.org/draft/2019-09/meta/content",
4084
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4085
+ "$vocabulary": {
4086
+ "https://json-schema.org/draft/2019-09/vocab/content": true
4087
+ },
4088
+ "$recursiveAnchor": true,
4089
+
4090
+ "title": "Content vocabulary meta-schema",
4091
+
4092
+ "type": ["object", "boolean"],
4093
+ "properties": {
4094
+ "contentMediaType": { "type": "string" },
4095
+ "contentEncoding": { "type": "string" },
4096
+ "contentSchema": { "$recursiveRef": "#" }
4097
+ }
4098
+ }`;
4099
+
4100
+ const { Core: Core$2, Schema: Schema$2 } = lib$1;
4101
+
4102
+
4103
+
4104
+
4105
+
4106
+
4107
+
4108
+
4109
+
4110
+
4111
+ const schemaVersion$1 = "https://json-schema.org/draft/2019-09/schema";
4112
+
4113
+ Schema$2.setConfig(schemaVersion$1, "baseToken", "$id");
4114
+ Schema$2.setConfig(schemaVersion$1, "embeddedToken", "$id");
4115
+ Schema$2.setConfig(schemaVersion$1, "anchorToken", "$anchor");
4116
+ Schema$2.setConfig(schemaVersion$1, "recursiveAnchorToken", "$recursiveAnchor");
4117
+ Schema$2.setConfig(schemaVersion$1, "vocabularyToken", "$vocabulary");
4118
+ Schema$2.setConfig(schemaVersion$1, "mandatoryVocabularies", ["https://json-schema.org/draft/2019-09/vocab/core"]);
4119
+
4120
+ Schema$2.add(JSON.parse(schema$1));
4121
+
4122
+ Schema$2.add(JSON.parse(core$1));
4123
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/core", {
4124
+ "validate": keywords.validate,
4125
+ "$defs": keywords.definitions,
4126
+ "$recursiveRef": keywords.dynamicRef,
4127
+ "$ref": keywords.ref
4128
+ });
4129
+
4130
+ Schema$2.add(JSON.parse(applicator$1));
4131
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/applicator", {
4132
+ "additionalItems": keywords.additionalItems6,
4133
+ "additionalProperties": keywords.additionalProperties6,
4134
+ "allOf": keywords.allOf,
4135
+ "anyOf": keywords.anyOf,
4136
+ "contains": keywords.containsMinContainsMaxContains,
4137
+ "dependentSchemas": keywords.dependentSchemas,
4138
+ "if": keywords.if,
4139
+ "then": keywords.then,
4140
+ "else": keywords.else,
4141
+ "items": keywords.items,
4142
+ "not": keywords.not,
4143
+ "oneOf": keywords.oneOf,
4144
+ "patternProperties": keywords.patternProperties,
4145
+ "properties": keywords.properties,
4146
+ "propertyNames": keywords.propertyNames,
4147
+ "unevaluatedItems": keywords.unevaluatedItems,
4148
+ "unevaluatedProperties": keywords.unevaluatedProperties
4149
+ });
4150
+
4151
+ Schema$2.add(JSON.parse(validation$1));
4152
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/validation", {
4153
+ "const": keywords.const,
4154
+ "dependentRequired": keywords.dependentRequired,
4155
+ "enum": keywords.enum,
4156
+ "exclusiveMaximum": keywords.exclusiveMaximum,
4157
+ "exclusiveMinimum": keywords.exclusiveMinimum,
4158
+ "maxItems": keywords.maxItems,
4159
+ "maxLength": keywords.maxLength6,
4160
+ "maxProperties": keywords.maxProperties,
4161
+ "maximum": keywords.maximum,
4162
+ "minItems": keywords.minItems,
4163
+ "minLength": keywords.minLength6,
4164
+ "minProperties": keywords.minProperties,
4165
+ "minimum": keywords.minimum,
4166
+ "multipleOf": keywords.multipleOf,
4167
+ "pattern": keywords.pattern,
4168
+ "required": keywords.required,
4169
+ "type": keywords.type,
4170
+ "uniqueItems": keywords.uniqueItems
4171
+ });
4172
+
4173
+ Schema$2.add(JSON.parse(metaData$1));
4174
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/meta-data", {
4175
+ "default": keywords.metaData,
4176
+ "deprecated": keywords.metaData,
4177
+ "description": keywords.metaData,
4178
+ "examples": keywords.metaData,
4179
+ "readOnly": keywords.metaData,
4180
+ "title": keywords.metaData,
4181
+ "writeOnly": keywords.metaData
4182
+ });
4183
+
4184
+ Schema$2.add(JSON.parse(format));
4185
+
4186
+ Schema$2.add(JSON.parse(content$1));
4187
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/content", {
4188
+ "contentEncoding": keywords.metaData,
4189
+ "contentMediaType": keywords.metaData,
4190
+ "contentSchema": keywords.metaData
4191
+ });
4192
+
4193
+ var schema = `{
4194
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4195
+ "$id": "https://json-schema.org/draft/2020-12/schema",
4196
+ "$vocabulary": {
4197
+ "https://json-schema.org/draft/2020-12/vocab/core": true,
4198
+ "https://json-schema.org/draft/2020-12/vocab/applicator": true,
4199
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
4200
+ "https://json-schema.org/draft/2020-12/vocab/validation": true,
4201
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": true,
4202
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
4203
+ "https://json-schema.org/draft/2020-12/vocab/content": true
4204
+ },
4205
+ "$dynamicAnchor": "meta",
4206
+
4207
+ "title": "Core and Validation specifications meta-schema",
4208
+ "allOf": [
4209
+ {"$ref": "meta/core"},
4210
+ {"$ref": "meta/applicator"},
4211
+ {"$ref": "meta/unevaluated"},
4212
+ {"$ref": "meta/validation"},
4213
+ {"$ref": "meta/meta-data"},
4214
+ {"$ref": "meta/format-annotation"},
4215
+ {"$ref": "meta/content"}
4216
+ ],
4217
+ "type": ["object", "boolean"],
4218
+ "properties": {
4219
+ "definitions": {
4220
+ "$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.",
4221
+ "type": "object",
4222
+ "additionalProperties": { "$dynamicRef": "#meta" },
4223
+ "default": {}
4224
+ },
4225
+ "dependencies": {
4226
+ "$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",
4227
+ "type": "object",
4228
+ "additionalProperties": {
4229
+ "anyOf": [
4230
+ { "$dynamicRef": "#meta" },
4231
+ { "$ref": "meta/validation#/$defs/stringArray" }
4232
+ ]
4233
+ }
4234
+ }
4235
+ }
4236
+ }`;
4237
+
4238
+ var core = `{
4239
+ "$id": "https://json-schema.org/draft/2020-12/meta/core",
4240
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4241
+ "$vocabulary": {
4242
+ "https://json-schema.org/draft/2020-12/vocab/core": true
4243
+ },
4244
+ "$dynamicAnchor": "meta",
4245
+
4246
+ "title": "Core vocabulary meta-schema",
4247
+ "type": ["object", "boolean"],
4248
+ "properties": {
4249
+ "$id": {
4250
+ "type": "string",
4251
+ "format": "uri-reference",
4252
+ "$comment": "Non-empty fragments not allowed.",
4253
+ "pattern": "^[^#]*#?$"
4254
+ },
4255
+ "$schema": {
4256
+ "type": "string",
4257
+ "format": "uri"
4258
+ },
4259
+ "$anchor": {
4260
+ "type": "string",
4261
+ "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
4262
+ },
4263
+ "$ref": {
4264
+ "type": "string",
4265
+ "format": "uri-reference"
4266
+ },
4267
+ "$dynamicRef": {
4268
+ "type": "string",
4269
+ "format": "uri-reference"
4270
+ },
4271
+ "$dynamicAnchor": {
4272
+ "type": "string",
4273
+ "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
4274
+ },
4275
+ "$vocabulary": {
4276
+ "type": "object",
4277
+ "propertyNames": {
4278
+ "type": "string",
4279
+ "format": "uri"
4280
+ },
4281
+ "additionalProperties": {
4282
+ "type": "boolean"
4283
+ }
4284
+ },
4285
+ "$comment": {
4286
+ "type": "string"
4287
+ },
4288
+ "$defs": {
4289
+ "type": "object",
4290
+ "additionalProperties": { "$dynamicRef": "#meta" },
4291
+ "default": {}
4292
+ }
4293
+ }
4294
+ }`;
4295
+
4296
+ var applicator = `{
4297
+ "$id": "https://json-schema.org/draft/2020-12/meta/applicator",
4298
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4299
+ "$vocabulary": {
4300
+ "https://json-schema.org/draft/2020-12/vocab/applicator": true
4301
+ },
4302
+ "$dynamicAnchor": "meta",
4303
+
4304
+ "title": "Applicator vocabulary meta-schema",
4305
+ "type": ["object", "boolean"],
4306
+ "properties": {
4307
+ "prefixItems": { "$ref": "#/$defs/schemaArray" },
4308
+ "items": { "$dynamicRef": "#meta" },
4309
+ "contains": { "$dynamicRef": "#meta" },
4310
+ "additionalProperties": { "$dynamicRef": "#meta" },
4311
+ "properties": {
4312
+ "type": "object",
4313
+ "additionalProperties": { "$dynamicRef": "#meta" },
4314
+ "default": {}
4315
+ },
4316
+ "patternProperties": {
4317
+ "type": "object",
4318
+ "additionalProperties": { "$dynamicRef": "#meta" },
4319
+ "propertyNames": { "format": "regex" },
4320
+ "default": {}
4321
+ },
4322
+ "dependentSchemas": {
4323
+ "type": "object",
4324
+ "additionalProperties": {
4325
+ "$dynamicRef": "#meta"
4326
+ }
4327
+ },
4328
+ "propertyNames": { "$dynamicRef": "#meta" },
4329
+ "if": { "$dynamicRef": "#meta" },
4330
+ "then": { "$dynamicRef": "#meta" },
4331
+ "else": { "$dynamicRef": "#meta" },
4332
+ "allOf": { "$ref": "#/$defs/schemaArray" },
4333
+ "anyOf": { "$ref": "#/$defs/schemaArray" },
4334
+ "oneOf": { "$ref": "#/$defs/schemaArray" },
4335
+ "not": { "$dynamicRef": "#meta" }
4336
+ },
4337
+ "$defs": {
4338
+ "schemaArray": {
4339
+ "type": "array",
4340
+ "minItems": 1,
4341
+ "items": { "$dynamicRef": "#meta" }
4342
+ }
4343
+ }
4344
+ }`;
4345
+
4346
+ var validation = `{
4347
+ "$id": "https://json-schema.org/draft/2020-12/meta/validation",
4348
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4349
+ "$vocabulary": {
4350
+ "https://json-schema.org/draft/2020-12/vocab/validation": true
4351
+ },
4352
+ "$dynamicAnchor": "meta",
4353
+
4354
+ "title": "Validation vocabulary meta-schema",
4355
+ "type": ["object", "boolean"],
4356
+ "properties": {
4357
+ "multipleOf": {
4358
+ "type": "number",
4359
+ "exclusiveMinimum": 0
4360
+ },
4361
+ "maximum": {
4362
+ "type": "number"
4363
+ },
4364
+ "exclusiveMaximum": {
4365
+ "type": "number"
4366
+ },
4367
+ "minimum": {
4368
+ "type": "number"
4369
+ },
4370
+ "exclusiveMinimum": {
4371
+ "type": "number"
4372
+ },
4373
+ "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
4374
+ "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
4375
+ "pattern": {
4376
+ "type": "string",
4377
+ "format": "regex"
4378
+ },
4379
+ "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
4380
+ "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
4381
+ "uniqueItems": {
4382
+ "type": "boolean",
4383
+ "default": false
4384
+ },
4385
+ "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
4386
+ "minContains": {
4387
+ "$ref": "#/$defs/nonNegativeInteger",
4388
+ "default": 1
4389
+ },
4390
+ "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
4391
+ "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
4392
+ "required": { "$ref": "#/$defs/stringArray" },
4393
+ "dependentRequired": {
4394
+ "type": "object",
4395
+ "additionalProperties": {
4396
+ "$ref": "#/$defs/stringArray"
4397
+ }
4398
+ },
4399
+ "const": true,
4400
+ "enum": {
4401
+ "type": "array",
4402
+ "items": true
4403
+ },
4404
+ "type": {
4405
+ "anyOf": [
4406
+ { "$ref": "#/$defs/simpleTypes" },
4407
+ {
4408
+ "type": "array",
4409
+ "items": { "$ref": "#/$defs/simpleTypes" },
4410
+ "minItems": 1,
4411
+ "uniqueItems": true
4412
+ }
4413
+ ]
4414
+ }
4415
+ },
4416
+ "$defs": {
4417
+ "nonNegativeInteger": {
4418
+ "type": "integer",
4419
+ "minimum": 0
4420
+ },
4421
+ "nonNegativeIntegerDefault0": {
4422
+ "$ref": "#/$defs/nonNegativeInteger",
4423
+ "default": 0
4424
+ },
4425
+ "simpleTypes": {
4426
+ "enum": [
4427
+ "array",
4428
+ "boolean",
4429
+ "integer",
4430
+ "null",
4431
+ "number",
4432
+ "object",
4433
+ "string"
4434
+ ]
4435
+ },
4436
+ "stringArray": {
4437
+ "type": "array",
4438
+ "items": { "type": "string" },
4439
+ "uniqueItems": true,
4440
+ "default": []
4441
+ }
4442
+ }
4443
+ }`;
4444
+
4445
+ var metaData = `{
4446
+ "$id": "https://json-schema.org/draft/2020-12/meta/meta-data",
4447
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4448
+ "$vocabulary": {
4449
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": true
4450
+ },
4451
+ "$dynamicAnchor": "meta",
4452
+
4453
+ "title": "Meta-data vocabulary meta-schema",
4454
+
4455
+ "type": ["object", "boolean"],
4456
+ "properties": {
4457
+ "title": {
4458
+ "type": "string"
4459
+ },
4460
+ "description": {
4461
+ "type": "string"
4462
+ },
4463
+ "default": true,
4464
+ "deprecated": {
4465
+ "type": "boolean",
4466
+ "default": false
4467
+ },
4468
+ "readOnly": {
4469
+ "type": "boolean",
4470
+ "default": false
4471
+ },
4472
+ "writeOnly": {
4473
+ "type": "boolean",
4474
+ "default": false
4475
+ },
4476
+ "examples": {
4477
+ "type": "array",
4478
+ "items": true
4479
+ }
4480
+ }
4481
+ }`;
4482
+
4483
+ var formatAnnotation = `{
4484
+ "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
4485
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4486
+ "$vocabulary": {
4487
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": true
4488
+ },
4489
+ "$dynamicAnchor": "meta",
4490
+
4491
+ "title": "Format vocabulary meta-schema for annotation results",
4492
+ "type": ["object", "boolean"],
4493
+ "properties": {
4494
+ "format": { "type": "string" }
4495
+ }
4496
+ }`;
4497
+
4498
+ var formatAssertion = `{
4499
+ "$id": "https://json-schema.org/draft/2020-12/meta/format-assertion",
4500
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4501
+ "$vocabulary": {
4502
+ "https://json-schema.org/draft/2020-12/vocab/format-assertion": true
4503
+ },
4504
+ "$dynamicAnchor": "meta",
4505
+
4506
+ "title": "Format vocabulary meta-schema for assertion results",
4507
+ "type": ["object", "boolean"],
4508
+ "properties": {
4509
+ "format": { "type": "string" }
4510
+ }
4511
+ }`;
4512
+
4513
+ var content = `{
4514
+ "$id": "https://json-schema.org/draft/2020-12/meta/content",
4515
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4516
+ "$vocabulary": {
4517
+ "https://json-schema.org/draft/2020-12/vocab/content": true
4518
+ },
4519
+ "$dynamicAnchor": "meta",
4520
+
4521
+ "title": "Content vocabulary meta-schema",
4522
+
4523
+ "type": ["object", "boolean"],
4524
+ "properties": {
4525
+ "contentMediaType": { "type": "string" },
4526
+ "contentEncoding": { "type": "string" },
4527
+ "contentSchema": { "$dynamicRef": "#meta" }
4528
+ }
4529
+ }`;
4530
+
4531
+ var unevaluated = `{
4532
+ "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",
4533
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4534
+ "$vocabulary": {
4535
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": true
4536
+ },
4537
+ "$dynamicAnchor": "meta",
4538
+
4539
+ "title": "Unevaluated applicator vocabulary meta-schema",
4540
+ "type": ["object", "boolean"],
4541
+ "properties": {
4542
+ "unevaluatedItems": { "$dynamicRef": "#meta" },
4543
+ "unevaluatedProperties": { "$dynamicRef": "#meta" }
4544
+ }
4545
+ }`;
4546
+
4547
+ const { Core: Core$1, Schema: Schema$1 } = lib$1;
4548
+
4549
+
4550
+
4551
+
4552
+
4553
+
4554
+
4555
+
4556
+
4557
+
4558
+
4559
+
4560
+ const schemaVersion = "https://json-schema.org/draft/2020-12/schema";
4561
+
4562
+ Schema$1.setConfig(schemaVersion, "baseToken", "$id");
4563
+ Schema$1.setConfig(schemaVersion, "embeddedToken", "$id");
4564
+ Schema$1.setConfig(schemaVersion, "anchorToken", "$anchor");
4565
+ Schema$1.setConfig(schemaVersion, "dynamicAnchorToken", "$dynamicAnchor");
4566
+ Schema$1.setConfig(schemaVersion, "vocabularyToken", "$vocabulary");
4567
+ Schema$1.setConfig(schemaVersion, "mandatoryVocabularies", ["https://json-schema.org/draft/2020-12/vocab/core"]);
4568
+
4569
+ Schema$1.add(JSON.parse(schema));
4570
+
4571
+ Schema$1.add(JSON.parse(core));
4572
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/core", {
4573
+ "validate": keywords.validate,
4574
+ "$defs": keywords.definitions,
4575
+ "$dynamicRef": keywords.dynamicRef,
4576
+ "$ref": keywords.ref
4577
+ });
4578
+
4579
+ Schema$1.add(JSON.parse(applicator));
4580
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/applicator", {
4581
+ "additionalProperties": keywords.additionalProperties6,
4582
+ "allOf": keywords.allOf,
4583
+ "anyOf": keywords.anyOf,
4584
+ "contains": keywords.containsMinContainsMaxContains,
4585
+ "dependentSchemas": keywords.dependentSchemas,
4586
+ "if": keywords.if,
4587
+ "then": keywords.then,
4588
+ "else": keywords.else,
4589
+ "items": keywords.items202012,
4590
+ "not": keywords.not,
4591
+ "oneOf": keywords.oneOf,
4592
+ "patternProperties": keywords.patternProperties,
4593
+ "prefixItems": keywords.tupleItems,
4594
+ "properties": keywords.properties,
4595
+ "propertyNames": keywords.propertyNames
4596
+ });
4597
+
4598
+ Schema$1.add(JSON.parse(validation));
4599
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/validation", {
4600
+ "const": keywords.const,
4601
+ "dependentRequired": keywords.dependentRequired,
4602
+ "enum": keywords.enum,
4603
+ "exclusiveMaximum": keywords.exclusiveMaximum,
4604
+ "exclusiveMinimum": keywords.exclusiveMinimum,
4605
+ "maxItems": keywords.maxItems,
4606
+ "maxLength": keywords.maxLength6,
4607
+ "maxProperties": keywords.maxProperties,
4608
+ "maximum": keywords.maximum,
4609
+ "minItems": keywords.minItems,
4610
+ "minLength": keywords.minLength6,
4611
+ "minProperties": keywords.minProperties,
4612
+ "minimum": keywords.minimum,
4613
+ "multipleOf": keywords.multipleOf,
4614
+ "pattern": keywords.pattern,
4615
+ "required": keywords.required,
4616
+ "type": keywords.type,
4617
+ "uniqueItems": keywords.uniqueItems
4618
+ });
4619
+
4620
+ Schema$1.add(JSON.parse(metaData));
4621
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/meta-data", {
4622
+ "default": keywords.metaData,
4623
+ "deprecated": keywords.metaData,
4624
+ "description": keywords.metaData,
4625
+ "examples": keywords.metaData,
4626
+ "readOnly": keywords.metaData,
4627
+ "title": keywords.metaData,
4628
+ "writeOnly": keywords.metaData
4629
+ });
4630
+
4631
+ Schema$1.add(JSON.parse(formatAnnotation));
4632
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/format-annotation", {
4633
+ "format": keywords.metaData
4634
+ });
4635
+
4636
+ Schema$1.add(JSON.parse(formatAssertion));
4637
+
4638
+ Schema$1.add(JSON.parse(content));
4639
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/content", {
4640
+ "contentEncoding": keywords.metaData,
4641
+ "contentMediaType": keywords.metaData,
4642
+ "contentSchema": keywords.metaData
4643
+ });
4644
+
4645
+ Schema$1.add(JSON.parse(unevaluated));
4646
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/unevaluated", {
4647
+ "unevaluatedItems": keywords.unevaluatedItems,
4648
+ "unevaluatedProperties": keywords.unevaluatedProperties
4649
+ });
4650
+
4651
+ const { Core, Schema, InvalidSchemaError } = lib$1;
4652
+
4653
+
4654
+
4655
+
4656
+
4657
+
4658
+
4659
+
4660
+
4661
+ var lib = {
4662
+ add: Core.add,
4663
+ get: Schema.get,
4664
+ validate: Core.validate,
4665
+ compile: Core.compile,
4666
+ interpret: Core.interpret,
4667
+ setMetaOutputFormat: Core.setMetaOutputFormat,
4668
+ setShouldMetaValidate: Core.setShouldMetaValidate,
4669
+ FLAG: Core.FLAG,
4670
+ BASIC: Core.BASIC,
4671
+ DETAILED: Core.DETAILED,
4672
+ VERBOSE: Core.VERBOSE,
4673
+ Keywords: keywords,
4674
+ InvalidSchemaError: InvalidSchemaError
4675
+ };
4676
+ var lib_1 = lib.add;
4677
+ var lib_2 = lib.get;
4678
+ var lib_3 = lib.validate;
4679
+ var lib_4 = lib.compile;
4680
+ var lib_5 = lib.interpret;
4681
+ var lib_6 = lib.setMetaOutputFormat;
4682
+ var lib_7 = lib.setShouldMetaValidate;
4683
+ var lib_8 = lib.FLAG;
4684
+ var lib_9 = lib.BASIC;
4685
+ var lib_10 = lib.DETAILED;
4686
+ var lib_11 = lib.VERBOSE;
4687
+ var lib_12 = lib.Keywords;
4688
+ var lib_13 = lib.InvalidSchemaError;
4689
+
4690
+ export { lib_9 as BASIC, lib_10 as DETAILED, lib_8 as FLAG, lib_13 as InvalidSchemaError, lib_12 as Keywords, lib_11 as VERBOSE, lib_1 as add, lib_4 as compile, lib as default, lib_2 as get, lib_5 as interpret, lib_6 as setMetaOutputFormat, lib_7 as setShouldMetaValidate, lib_3 as validate };
4691
+ //# sourceMappingURL=json-schema-esm.js.map