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