@kohost/api-client 3.0.0-beta.4 → 3.0.0-beta.41

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 (167) hide show
  1. package/README.md +71 -0
  2. package/dist/cjs/AMQPClient.js +425 -0
  3. package/dist/cjs/Client.js +1702 -1112
  4. package/dist/cjs/Commands.js +308 -93
  5. package/dist/cjs/Errors.js +24 -22
  6. package/dist/cjs/Events.js +225 -45
  7. package/dist/cjs/Models.js +1447 -555
  8. package/dist/cjs/SocketIoClient.js +66 -0
  9. package/dist/cjs/defs.js +37 -47
  10. package/dist/cjs/index.cjs.js +4 -0
  11. package/dist/cjs/utils.js +257 -15
  12. package/dist/esm/Client.js +1992 -1274
  13. package/dist/esm/Client.js.map +4 -4
  14. package/dist/esm/Commands.js +308 -93
  15. package/dist/esm/Commands.js.map +3 -3
  16. package/dist/esm/Errors.js +24 -22
  17. package/dist/esm/Errors.js.map +1 -1
  18. package/dist/esm/Events.js +225 -45
  19. package/dist/esm/Events.js.map +3 -3
  20. package/dist/esm/Models.js +2062 -551
  21. package/dist/esm/Models.js.map +4 -4
  22. package/dist/esm/SocketIoClient.js +4546 -0
  23. package/dist/esm/SocketIoClient.js.map +7 -0
  24. package/dist/esm/defs.js +394 -276
  25. package/dist/esm/defs.js.map +4 -4
  26. package/dist/esm/index.js +11 -10
  27. package/dist/esm/utils.js +640 -63
  28. package/dist/esm/utils.js.map +3 -3
  29. package/dist/useCases/AddDefaultScenesToRooms.js +2 -2
  30. package/dist/useCases/AddScenesToRoom.js +2 -2
  31. package/dist/useCases/AdminUpdateCustomer.js +32 -0
  32. package/dist/useCases/AssignSpaceToReservation.js +32 -0
  33. package/dist/useCases/BatchNotifyCheckIn.js +32 -0
  34. package/dist/useCases/BatchNotifyPreArrival.js +2 -2
  35. package/dist/useCases/CheckInReservation.js +2 -2
  36. package/dist/useCases/CheckVerificationCode.js +2 -2
  37. package/dist/useCases/CreateAlarm.js +2 -2
  38. package/dist/useCases/CreateCamera.js +2 -2
  39. package/dist/useCases/CreateCourtesy.js +2 -2
  40. package/dist/useCases/CreateDefaultScenes.js +2 -2
  41. package/dist/useCases/CreateDimmer.js +2 -2
  42. package/dist/useCases/CreateDiscoveredDevice.js +2 -2
  43. package/dist/useCases/CreateDiscoveredDeviceAssociation.js +2 -2
  44. package/dist/useCases/CreateImageUploadEndpoint.js +32 -0
  45. package/dist/useCases/CreateLock.js +2 -2
  46. package/dist/useCases/{CreateSource.js → CreateMediaSource.js} +3 -3
  47. package/dist/useCases/CreateOrganization.js +32 -0
  48. package/dist/useCases/{AdminCreateProperty.js → CreateProperty.js} +3 -3
  49. package/dist/useCases/CreateReservation.js +2 -2
  50. package/dist/useCases/CreateRoom.js +2 -2
  51. package/dist/useCases/CreateRoomInSpace.js +2 -2
  52. package/dist/useCases/CreateSpace.js +2 -2
  53. package/dist/useCases/{CreateIntegration.js → CreateSpaceType.js} +3 -3
  54. package/dist/useCases/CreateSwitch.js +2 -2
  55. package/dist/useCases/CreateThermostat.js +2 -2
  56. package/dist/useCases/CreateTicket.js +2 -2
  57. package/dist/useCases/CreateTicketMessage.js +2 -2
  58. package/dist/useCases/CreateUser.js +2 -2
  59. package/dist/useCases/CreateWindowCovering.js +2 -2
  60. package/dist/useCases/DeleteAlarm.js +2 -2
  61. package/dist/useCases/DeleteCamera.js +2 -2
  62. package/dist/useCases/DeleteCourtesy.js +2 -2
  63. package/dist/useCases/DeleteDimmer.js +2 -2
  64. package/dist/useCases/DeleteDiscoveredDevice.js +2 -2
  65. package/dist/useCases/DeleteLock.js +2 -2
  66. package/dist/useCases/DeleteMediaFile.js +32 -0
  67. package/dist/useCases/{DeleteSource.js → DeleteMediaSource.js} +3 -3
  68. package/dist/useCases/DeleteReservation.js +2 -2
  69. package/dist/useCases/DeleteRoom.js +2 -2
  70. package/dist/useCases/DeleteSpace.js +2 -2
  71. package/dist/useCases/DeleteSpaceType.js +32 -0
  72. package/dist/useCases/DeleteSwitch.js +2 -2
  73. package/dist/useCases/DeleteThermostat.js +2 -2
  74. package/dist/useCases/DeleteTicket.js +2 -2
  75. package/dist/useCases/DeleteUser.js +2 -2
  76. package/dist/useCases/DeleteWindowCovering.js +2 -2
  77. package/dist/useCases/DescribeAlarm.js +2 -2
  78. package/dist/useCases/DescribeCamera.js +2 -2
  79. package/dist/useCases/DescribeCourtesy.js +2 -2
  80. package/dist/useCases/DescribeDimmer.js +2 -2
  81. package/dist/useCases/DescribeDiscoveredDevice.js +2 -2
  82. package/dist/useCases/DescribeLock.js +2 -2
  83. package/dist/useCases/DescribeLockCredential.js +32 -0
  84. package/dist/useCases/{DescribeSource.js → DescribeMediaSource.js} +3 -3
  85. package/dist/useCases/DescribeMyAccessCredentials.js +32 -0
  86. package/dist/useCases/DescribeMyProperty.js +2 -2
  87. package/dist/useCases/DescribeOrganization.js +32 -0
  88. package/dist/useCases/{DescribeIntegration.js → DescribeProperty.js} +3 -3
  89. package/dist/useCases/DescribeReservation.js +2 -2
  90. package/dist/useCases/DescribeReservationCheckinStatus.js +2 -2
  91. package/dist/useCases/DescribeRoom.js +2 -2
  92. package/dist/useCases/DescribeSelf.js +2 -2
  93. package/dist/useCases/DescribeSpace.js +2 -2
  94. package/dist/useCases/{DeleteIntegration.js → DescribeSpaceType.js} +3 -3
  95. package/dist/useCases/DescribeSwitch.js +2 -2
  96. package/dist/useCases/DescribeThermostat.js +2 -2
  97. package/dist/useCases/DescribeTicket.js +2 -2
  98. package/dist/useCases/DescribeUser.js +2 -2
  99. package/dist/useCases/DescribeWindowCovering.js +2 -2
  100. package/dist/useCases/DiscoverReservations.js +2 -2
  101. package/dist/useCases/EmailUserAccountSetup.js +2 -2
  102. package/dist/useCases/ListAlarms.js +2 -2
  103. package/dist/useCases/ListCameras.js +2 -2
  104. package/dist/useCases/ListCourtesy.js +2 -2
  105. package/dist/useCases/ListDimmers.js +2 -2
  106. package/dist/useCases/ListDiscoveredDevices.js +2 -2
  107. package/dist/useCases/ListLocks.js +2 -2
  108. package/dist/useCases/{ListSources.js → ListMediaSources.js} +3 -3
  109. package/dist/useCases/ListMyReservations.js +2 -2
  110. package/dist/useCases/ListMySpaces.js +2 -2
  111. package/dist/useCases/ListMyTickets.js +32 -0
  112. package/dist/useCases/ListOrganizations.js +32 -0
  113. package/dist/useCases/{AdminListCustomers.js → ListProperties.js} +3 -3
  114. package/dist/useCases/ListReservations.js +2 -2
  115. package/dist/useCases/ListRooms.js +2 -2
  116. package/dist/useCases/ListRoomsInSpace.js +2 -2
  117. package/dist/useCases/{AdminListProperties.js → ListSpaceTypes.js} +3 -3
  118. package/dist/useCases/ListSpaces.js +2 -2
  119. package/dist/useCases/ListSwitches.js +2 -2
  120. package/dist/useCases/{ListIntegrations.js → ListTeam.js} +3 -3
  121. package/dist/useCases/ListThermostats.js +2 -2
  122. package/dist/useCases/ListTickets.js +2 -2
  123. package/dist/useCases/ListUserReservations.js +2 -2
  124. package/dist/useCases/{AdminDescribeProperty.js → ListUserSpaces.js} +3 -3
  125. package/dist/useCases/ListUsers.js +2 -2
  126. package/dist/useCases/ListWindowCoverings.js +2 -2
  127. package/dist/useCases/LoginUser.js +2 -2
  128. package/dist/useCases/{CreateIntegrationDeviceMapEntry.js → LogoutUser.js} +3 -3
  129. package/dist/useCases/MatchUserIdentification.js +2 -2
  130. package/dist/useCases/OCRDocument.js +2 -2
  131. package/dist/useCases/RefreshToken.js +2 -2
  132. package/dist/useCases/RequestLoginLink.js +3 -3
  133. package/dist/useCases/RequestMyKeyToken.js +32 -0
  134. package/dist/useCases/SendCheckInSMS.js +32 -0
  135. package/dist/useCases/SendPreArrivalEmail.js +2 -2
  136. package/dist/useCases/SendPreArrivalSMS.js +2 -2
  137. package/dist/useCases/SendVerificationCode.js +2 -2
  138. package/dist/useCases/SetCamera.js +2 -2
  139. package/dist/useCases/SetCourtesy.js +2 -2
  140. package/dist/useCases/{SetSource.js → SetDimmer.js} +3 -3
  141. package/dist/useCases/SetLock.js +2 -2
  142. package/dist/useCases/SetMediaSource.js +32 -0
  143. package/dist/useCases/SetSwitch.js +2 -2
  144. package/dist/useCases/SetThermostat.js +2 -2
  145. package/dist/useCases/SetWindowCovering.js +2 -2
  146. package/dist/useCases/UpdateAlarm.js +2 -2
  147. package/dist/useCases/UpdateCamera.js +2 -2
  148. package/dist/useCases/UpdateCourtesy.js +2 -2
  149. package/dist/useCases/UpdateDimmer.js +2 -2
  150. package/dist/useCases/UpdateDiscoveredDevice.js +2 -2
  151. package/dist/useCases/UpdateLock.js +2 -2
  152. package/dist/useCases/{UpdateSource.js → UpdateMediaSource.js} +3 -3
  153. package/dist/useCases/UpdateMessageReadStatus.js +2 -2
  154. package/dist/useCases/{AdminUpdateProperty.js → UpdateProperty.js} +3 -3
  155. package/dist/useCases/UpdateReservation.js +2 -2
  156. package/dist/useCases/UpdateRoom.js +2 -2
  157. package/dist/useCases/UpdateSelf.js +2 -2
  158. package/dist/useCases/UpdateSpace.js +2 -2
  159. package/dist/useCases/{UpdateIntegration.js → UpdateSpaceType.js} +3 -3
  160. package/dist/useCases/UpdateSwitch.js +2 -2
  161. package/dist/useCases/UpdateThermostat.js +2 -2
  162. package/dist/useCases/UpdateTicket.js +2 -2
  163. package/dist/useCases/UpdateTicketStatus.js +2 -2
  164. package/dist/useCases/UpdateUser.js +2 -2
  165. package/dist/useCases/UpdateWindowCovering.js +2 -2
  166. package/dist/useCases/UpsertDiscoveredDevice.js +2 -2
  167. package/package.json +14 -3
package/dist/esm/utils.js CHANGED
@@ -1,4 +1,6 @@
1
+ var __defProp = Object.defineProperty;
1
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
2
4
  var __commonJS = (cb, mod) => function __require() {
3
5
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
6
  };
@@ -9,6 +11,7 @@ var require_getFormalDeviceType = __commonJS({
9
11
  function getFormalDeviceType(deviceType) {
10
12
  return deviceType.charAt(0).toUpperCase() + deviceType.slice(1);
11
13
  }
14
+ __name(getFormalDeviceType, "getFormalDeviceType");
12
15
  module.exports = getFormalDeviceType;
13
16
  }
14
17
  });
@@ -22,12 +25,12 @@ var require_deviceTypes = __commonJS({
22
25
  "thermostat",
23
26
  "lock",
24
27
  "windowCovering",
25
- "sceneController",
26
28
  "courtesy",
27
29
  "alarm",
28
30
  "camera",
29
- "source",
30
- "motionSensor"
31
+ "mediaSource",
32
+ "motionSensor",
33
+ "gateway"
31
34
  ];
32
35
  module.exports = types;
33
36
  }
@@ -40,6 +43,7 @@ var require_getDeviceTypes = __commonJS({
40
43
  function getDeviceTypes() {
41
44
  return deviceTypes;
42
45
  }
46
+ __name(getDeviceTypes, "getDeviceTypes");
43
47
  module.exports = getDeviceTypes;
44
48
  }
45
49
  });
@@ -52,6 +56,7 @@ var require_code = __commonJS({
52
56
  exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
53
57
  var _CodeOrName = class {
54
58
  };
59
+ __name(_CodeOrName, "_CodeOrName");
55
60
  exports._CodeOrName = _CodeOrName;
56
61
  exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
57
62
  var Name = class extends _CodeOrName {
@@ -71,6 +76,7 @@ var require_code = __commonJS({
71
76
  return { [this.str]: 1 };
72
77
  }
73
78
  };
79
+ __name(Name, "Name");
74
80
  exports.Name = Name;
75
81
  var _Code = class extends _CodeOrName {
76
82
  constructor(code) {
@@ -99,6 +105,7 @@ var require_code = __commonJS({
99
105
  }, {});
100
106
  }
101
107
  };
108
+ __name(_Code, "_Code");
102
109
  exports._Code = _Code;
103
110
  exports.nil = new _Code("");
104
111
  function _(strs, ...args) {
@@ -110,6 +117,7 @@ var require_code = __commonJS({
110
117
  }
111
118
  return new _Code(code);
112
119
  }
120
+ __name(_, "_");
113
121
  exports._ = _;
114
122
  var plus = new _Code("+");
115
123
  function str(strs, ...args) {
@@ -123,6 +131,7 @@ var require_code = __commonJS({
123
131
  optimize(expr);
124
132
  return new _Code(expr);
125
133
  }
134
+ __name(str, "str");
126
135
  exports.str = str;
127
136
  function addCodeArg(code, arg) {
128
137
  if (arg instanceof _Code)
@@ -132,6 +141,7 @@ var require_code = __commonJS({
132
141
  else
133
142
  code.push(interpolate(arg));
134
143
  }
144
+ __name(addCodeArg, "addCodeArg");
135
145
  exports.addCodeArg = addCodeArg;
136
146
  function optimize(expr) {
137
147
  let i = 1;
@@ -147,6 +157,7 @@ var require_code = __commonJS({
147
157
  i++;
148
158
  }
149
159
  }
160
+ __name(optimize, "optimize");
150
161
  function mergeExprItems(a, b) {
151
162
  if (b === '""')
152
163
  return a;
@@ -165,24 +176,30 @@ var require_code = __commonJS({
165
176
  return `"${a}${b.slice(1)}`;
166
177
  return;
167
178
  }
179
+ __name(mergeExprItems, "mergeExprItems");
168
180
  function strConcat(c1, c2) {
169
181
  return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
170
182
  }
183
+ __name(strConcat, "strConcat");
171
184
  exports.strConcat = strConcat;
172
185
  function interpolate(x) {
173
186
  return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x);
174
187
  }
188
+ __name(interpolate, "interpolate");
175
189
  function stringify(x) {
176
190
  return new _Code(safeStringify(x));
177
191
  }
192
+ __name(stringify, "stringify");
178
193
  exports.stringify = stringify;
179
194
  function safeStringify(x) {
180
195
  return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
181
196
  }
197
+ __name(safeStringify, "safeStringify");
182
198
  exports.safeStringify = safeStringify;
183
199
  function getProperty(key) {
184
200
  return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
185
201
  }
202
+ __name(getProperty, "getProperty");
186
203
  exports.getProperty = getProperty;
187
204
  function getEsmExportName(key) {
188
205
  if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
@@ -190,10 +207,12 @@ var require_code = __commonJS({
190
207
  }
191
208
  throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
192
209
  }
210
+ __name(getEsmExportName, "getEsmExportName");
193
211
  exports.getEsmExportName = getEsmExportName;
194
212
  function regexpCode(rx) {
195
213
  return new _Code(rx.toString());
196
214
  }
215
+ __name(regexpCode, "regexpCode");
197
216
  exports.regexpCode = regexpCode;
198
217
  }
199
218
  });
@@ -211,6 +230,7 @@ var require_scope = __commonJS({
211
230
  this.value = name.value;
212
231
  }
213
232
  };
233
+ __name(ValueError, "ValueError");
214
234
  var UsedValueState;
215
235
  (function(UsedValueState2) {
216
236
  UsedValueState2[UsedValueState2["Started"] = 0] = "Started";
@@ -245,6 +265,7 @@ var require_scope = __commonJS({
245
265
  return this._names[prefix] = { prefix, index: 0 };
246
266
  }
247
267
  };
268
+ __name(Scope, "Scope");
248
269
  exports.Scope = Scope;
249
270
  var ValueScopeName = class extends code_1.Name {
250
271
  constructor(prefix, nameStr) {
@@ -256,6 +277,7 @@ var require_scope = __commonJS({
256
277
  this.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`;
257
278
  }
258
279
  };
280
+ __name(ValueScopeName, "ValueScopeName");
259
281
  exports.ValueScopeName = ValueScopeName;
260
282
  var line = (0, code_1._)`\n`;
261
283
  var ValueScope = class extends Scope {
@@ -339,6 +361,7 @@ var require_scope = __commonJS({
339
361
  return code;
340
362
  }
341
363
  };
364
+ __name(ValueScope, "ValueScope");
342
365
  exports.ValueScope = ValueScope;
343
366
  }
344
367
  });
@@ -409,6 +432,7 @@ var require_codegen = __commonJS({
409
432
  return this;
410
433
  }
411
434
  };
435
+ __name(Node, "Node");
412
436
  var Def = class extends Node {
413
437
  constructor(varKind, name, rhs) {
414
438
  super();
@@ -432,6 +456,7 @@ var require_codegen = __commonJS({
432
456
  return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};
433
457
  }
434
458
  };
459
+ __name(Def, "Def");
435
460
  var Assign = class extends Node {
436
461
  constructor(lhs, rhs, sideEffects) {
437
462
  super();
@@ -453,6 +478,7 @@ var require_codegen = __commonJS({
453
478
  return addExprNames(names, this.rhs);
454
479
  }
455
480
  };
481
+ __name(Assign, "Assign");
456
482
  var AssignOp = class extends Assign {
457
483
  constructor(lhs, op, rhs, sideEffects) {
458
484
  super(lhs, rhs, sideEffects);
@@ -462,6 +488,7 @@ var require_codegen = __commonJS({
462
488
  return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
463
489
  }
464
490
  };
491
+ __name(AssignOp, "AssignOp");
465
492
  var Label = class extends Node {
466
493
  constructor(label) {
467
494
  super();
@@ -472,6 +499,7 @@ var require_codegen = __commonJS({
472
499
  return `${this.label}:` + _n;
473
500
  }
474
501
  };
502
+ __name(Label, "Label");
475
503
  var Break = class extends Node {
476
504
  constructor(label) {
477
505
  super();
@@ -483,6 +511,7 @@ var require_codegen = __commonJS({
483
511
  return `break${label};` + _n;
484
512
  }
485
513
  };
514
+ __name(Break, "Break");
486
515
  var Throw = class extends Node {
487
516
  constructor(error) {
488
517
  super();
@@ -495,6 +524,7 @@ var require_codegen = __commonJS({
495
524
  return this.error.names;
496
525
  }
497
526
  };
527
+ __name(Throw, "Throw");
498
528
  var AnyCode = class extends Node {
499
529
  constructor(code) {
500
530
  super();
@@ -514,6 +544,7 @@ var require_codegen = __commonJS({
514
544
  return this.code instanceof code_1._CodeOrName ? this.code.names : {};
515
545
  }
516
546
  };
547
+ __name(AnyCode, "AnyCode");
517
548
  var ParentNode = class extends Node {
518
549
  constructor(nodes = []) {
519
550
  super();
@@ -552,15 +583,19 @@ var require_codegen = __commonJS({
552
583
  return this.nodes.reduce((names, n) => addNames(names, n.names), {});
553
584
  }
554
585
  };
586
+ __name(ParentNode, "ParentNode");
555
587
  var BlockNode = class extends ParentNode {
556
588
  render(opts) {
557
589
  return "{" + opts._n + super.render(opts) + "}" + opts._n;
558
590
  }
559
591
  };
592
+ __name(BlockNode, "BlockNode");
560
593
  var Root = class extends ParentNode {
561
594
  };
595
+ __name(Root, "Root");
562
596
  var Else = class extends BlockNode {
563
597
  };
598
+ __name(Else, "Else");
564
599
  Else.kind = "else";
565
600
  var If = class extends BlockNode {
566
601
  constructor(condition, nodes) {
@@ -610,9 +645,11 @@ var require_codegen = __commonJS({
610
645
  return names;
611
646
  }
612
647
  };
648
+ __name(If, "If");
613
649
  If.kind = "if";
614
650
  var For = class extends BlockNode {
615
651
  };
652
+ __name(For, "For");
616
653
  For.kind = "for";
617
654
  var ForLoop = class extends For {
618
655
  constructor(iteration) {
@@ -632,6 +669,7 @@ var require_codegen = __commonJS({
632
669
  return addNames(super.names, this.iteration.names);
633
670
  }
634
671
  };
672
+ __name(ForLoop, "ForLoop");
635
673
  var ForRange = class extends For {
636
674
  constructor(varKind, name, from, to) {
637
675
  super();
@@ -650,6 +688,7 @@ var require_codegen = __commonJS({
650
688
  return addExprNames(names, this.to);
651
689
  }
652
690
  };
691
+ __name(ForRange, "ForRange");
653
692
  var ForIter = class extends For {
654
693
  constructor(loop, varKind, name, iterable) {
655
694
  super();
@@ -671,6 +710,7 @@ var require_codegen = __commonJS({
671
710
  return addNames(super.names, this.iterable.names);
672
711
  }
673
712
  };
713
+ __name(ForIter, "ForIter");
674
714
  var Func = class extends BlockNode {
675
715
  constructor(name, args, async) {
676
716
  super();
@@ -683,12 +723,14 @@ var require_codegen = __commonJS({
683
723
  return `${_async}function ${this.name}(${this.args})` + super.render(opts);
684
724
  }
685
725
  };
726
+ __name(Func, "Func");
686
727
  Func.kind = "func";
687
728
  var Return = class extends ParentNode {
688
729
  render(opts) {
689
730
  return "return " + super.render(opts);
690
731
  }
691
732
  };
733
+ __name(Return, "Return");
692
734
  Return.kind = "return";
693
735
  var Try = class extends BlockNode {
694
736
  render(opts) {
@@ -722,6 +764,7 @@ var require_codegen = __commonJS({
722
764
  return names;
723
765
  }
724
766
  };
767
+ __name(Try, "Try");
725
768
  var Catch = class extends BlockNode {
726
769
  constructor(error) {
727
770
  super();
@@ -731,12 +774,14 @@ var require_codegen = __commonJS({
731
774
  return `catch(${this.error})` + super.render(opts);
732
775
  }
733
776
  };
777
+ __name(Catch, "Catch");
734
778
  Catch.kind = "catch";
735
779
  var Finally = class extends BlockNode {
736
780
  render(opts) {
737
781
  return "finally" + super.render(opts);
738
782
  }
739
783
  };
784
+ __name(Finally, "Finally");
740
785
  Finally.kind = "finally";
741
786
  var CodeGen = class {
742
787
  constructor(extScope, opts = {}) {
@@ -1002,15 +1047,18 @@ var require_codegen = __commonJS({
1002
1047
  ns[ns.length - 1] = node;
1003
1048
  }
1004
1049
  };
1050
+ __name(CodeGen, "CodeGen");
1005
1051
  exports.CodeGen = CodeGen;
1006
1052
  function addNames(names, from) {
1007
1053
  for (const n in from)
1008
1054
  names[n] = (names[n] || 0) + (from[n] || 0);
1009
1055
  return names;
1010
1056
  }
1057
+ __name(addNames, "addNames");
1011
1058
  function addExprNames(names, from) {
1012
1059
  return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
1013
1060
  }
1061
+ __name(addExprNames, "addExprNames");
1014
1062
  function optimizeExpr(expr, names, constants) {
1015
1063
  if (expr instanceof code_1.Name)
1016
1064
  return replaceName(expr);
@@ -1032,34 +1080,43 @@ var require_codegen = __commonJS({
1032
1080
  delete names[n.str];
1033
1081
  return c;
1034
1082
  }
1083
+ __name(replaceName, "replaceName");
1035
1084
  function canOptimize(e) {
1036
1085
  return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
1037
1086
  }
1087
+ __name(canOptimize, "canOptimize");
1038
1088
  }
1089
+ __name(optimizeExpr, "optimizeExpr");
1039
1090
  function subtractNames(names, from) {
1040
1091
  for (const n in from)
1041
1092
  names[n] = (names[n] || 0) - (from[n] || 0);
1042
1093
  }
1094
+ __name(subtractNames, "subtractNames");
1043
1095
  function not(x) {
1044
1096
  return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`;
1045
1097
  }
1098
+ __name(not, "not");
1046
1099
  exports.not = not;
1047
1100
  var andCode = mappend(exports.operators.AND);
1048
1101
  function and(...args) {
1049
1102
  return args.reduce(andCode);
1050
1103
  }
1104
+ __name(and, "and");
1051
1105
  exports.and = and;
1052
1106
  var orCode = mappend(exports.operators.OR);
1053
1107
  function or(...args) {
1054
1108
  return args.reduce(orCode);
1055
1109
  }
1110
+ __name(or, "or");
1056
1111
  exports.or = or;
1057
1112
  function mappend(op) {
1058
1113
  return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;
1059
1114
  }
1115
+ __name(mappend, "mappend");
1060
1116
  function par(x) {
1061
1117
  return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`;
1062
1118
  }
1119
+ __name(par, "par");
1063
1120
  }
1064
1121
  });
1065
1122
 
@@ -1077,6 +1134,7 @@ var require_util = __commonJS({
1077
1134
  hash[item] = true;
1078
1135
  return hash;
1079
1136
  }
1137
+ __name(toHash, "toHash");
1080
1138
  exports.toHash = toHash;
1081
1139
  function alwaysValidSchema(it, schema) {
1082
1140
  if (typeof schema == "boolean")
@@ -1086,6 +1144,7 @@ var require_util = __commonJS({
1086
1144
  checkUnknownRules(it, schema);
1087
1145
  return !schemaHasRules(schema, it.self.RULES.all);
1088
1146
  }
1147
+ __name(alwaysValidSchema, "alwaysValidSchema");
1089
1148
  exports.alwaysValidSchema = alwaysValidSchema;
1090
1149
  function checkUnknownRules(it, schema = it.schema) {
1091
1150
  const { opts, self } = it;
@@ -1099,6 +1158,7 @@ var require_util = __commonJS({
1099
1158
  checkStrictMode(it, `unknown keyword: "${key}"`);
1100
1159
  }
1101
1160
  }
1161
+ __name(checkUnknownRules, "checkUnknownRules");
1102
1162
  exports.checkUnknownRules = checkUnknownRules;
1103
1163
  function schemaHasRules(schema, rules) {
1104
1164
  if (typeof schema == "boolean")
@@ -1108,6 +1168,7 @@ var require_util = __commonJS({
1108
1168
  return true;
1109
1169
  return false;
1110
1170
  }
1171
+ __name(schemaHasRules, "schemaHasRules");
1111
1172
  exports.schemaHasRules = schemaHasRules;
1112
1173
  function schemaHasRulesButRef(schema, RULES) {
1113
1174
  if (typeof schema == "boolean")
@@ -1117,6 +1178,7 @@ var require_util = __commonJS({
1117
1178
  return true;
1118
1179
  return false;
1119
1180
  }
1181
+ __name(schemaHasRulesButRef, "schemaHasRulesButRef");
1120
1182
  exports.schemaHasRulesButRef = schemaHasRulesButRef;
1121
1183
  function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {
1122
1184
  if (!$data) {
@@ -1127,24 +1189,29 @@ var require_util = __commonJS({
1127
1189
  }
1128
1190
  return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
1129
1191
  }
1192
+ __name(schemaRefOrVal, "schemaRefOrVal");
1130
1193
  exports.schemaRefOrVal = schemaRefOrVal;
1131
1194
  function unescapeFragment(str) {
1132
1195
  return unescapeJsonPointer(decodeURIComponent(str));
1133
1196
  }
1197
+ __name(unescapeFragment, "unescapeFragment");
1134
1198
  exports.unescapeFragment = unescapeFragment;
1135
1199
  function escapeFragment(str) {
1136
1200
  return encodeURIComponent(escapeJsonPointer(str));
1137
1201
  }
1202
+ __name(escapeFragment, "escapeFragment");
1138
1203
  exports.escapeFragment = escapeFragment;
1139
1204
  function escapeJsonPointer(str) {
1140
1205
  if (typeof str == "number")
1141
1206
  return `${str}`;
1142
1207
  return str.replace(/~/g, "~0").replace(/\//g, "~1");
1143
1208
  }
1209
+ __name(escapeJsonPointer, "escapeJsonPointer");
1144
1210
  exports.escapeJsonPointer = escapeJsonPointer;
1145
1211
  function unescapeJsonPointer(str) {
1146
1212
  return str.replace(/~1/g, "/").replace(/~0/g, "~");
1147
1213
  }
1214
+ __name(unescapeJsonPointer, "unescapeJsonPointer");
1148
1215
  exports.unescapeJsonPointer = unescapeJsonPointer;
1149
1216
  function eachItem(xs, f) {
1150
1217
  if (Array.isArray(xs)) {
@@ -1154,6 +1221,7 @@ var require_util = __commonJS({
1154
1221
  f(xs);
1155
1222
  }
1156
1223
  }
1224
+ __name(eachItem, "eachItem");
1157
1225
  exports.eachItem = eachItem;
1158
1226
  function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName }) {
1159
1227
  return (gen, from, to, toName) => {
@@ -1161,6 +1229,7 @@ var require_util = __commonJS({
1161
1229
  return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
1162
1230
  };
1163
1231
  }
1232
+ __name(makeMergeEvaluated, "makeMergeEvaluated");
1164
1233
  exports.mergeEvaluated = {
1165
1234
  props: makeMergeEvaluated({
1166
1235
  mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => {
@@ -1192,10 +1261,12 @@ var require_util = __commonJS({
1192
1261
  setEvaluated(gen, props, ps);
1193
1262
  return props;
1194
1263
  }
1264
+ __name(evaluatedPropsToName, "evaluatedPropsToName");
1195
1265
  exports.evaluatedPropsToName = evaluatedPropsToName;
1196
1266
  function setEvaluated(gen, props, ps) {
1197
1267
  Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true));
1198
1268
  }
1269
+ __name(setEvaluated, "setEvaluated");
1199
1270
  exports.setEvaluated = setEvaluated;
1200
1271
  var snippets = {};
1201
1272
  function useFunc(gen, f) {
@@ -1204,6 +1275,7 @@ var require_util = __commonJS({
1204
1275
  code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code))
1205
1276
  });
1206
1277
  }
1278
+ __name(useFunc, "useFunc");
1207
1279
  exports.useFunc = useFunc;
1208
1280
  var Type;
1209
1281
  (function(Type2) {
@@ -1217,6 +1289,7 @@ var require_util = __commonJS({
1217
1289
  }
1218
1290
  return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
1219
1291
  }
1292
+ __name(getErrorPath, "getErrorPath");
1220
1293
  exports.getErrorPath = getErrorPath;
1221
1294
  function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
1222
1295
  if (!mode)
@@ -1226,6 +1299,7 @@ var require_util = __commonJS({
1226
1299
  throw new Error(msg);
1227
1300
  it.self.logger.warn(msg);
1228
1301
  }
1302
+ __name(checkStrictMode, "checkStrictMode");
1229
1303
  exports.checkStrictMode = checkStrictMode;
1230
1304
  }
1231
1305
  });
@@ -1288,6 +1362,7 @@ var require_errors = __commonJS({
1288
1362
  returnErrors(it, (0, codegen_1._)`[${errObj}]`);
1289
1363
  }
1290
1364
  }
1365
+ __name(reportError, "reportError");
1291
1366
  exports.reportError = reportError;
1292
1367
  function reportExtraError(cxt, error = exports.keywordError, errorPaths) {
1293
1368
  const { it } = cxt;
@@ -1298,11 +1373,13 @@ var require_errors = __commonJS({
1298
1373
  returnErrors(it, names_1.default.vErrors);
1299
1374
  }
1300
1375
  }
1376
+ __name(reportExtraError, "reportExtraError");
1301
1377
  exports.reportExtraError = reportExtraError;
1302
1378
  function resetErrorsCount(gen, errsCount) {
1303
1379
  gen.assign(names_1.default.errors, errsCount);
1304
1380
  gen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
1305
1381
  }
1382
+ __name(resetErrorsCount, "resetErrorsCount");
1306
1383
  exports.resetErrorsCount = resetErrorsCount;
1307
1384
  function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) {
1308
1385
  if (errsCount === void 0)
@@ -1318,12 +1395,14 @@ var require_errors = __commonJS({
1318
1395
  }
1319
1396
  });
1320
1397
  }
1398
+ __name(extendErrors, "extendErrors");
1321
1399
  exports.extendErrors = extendErrors;
1322
1400
  function addError(gen, errObj) {
1323
1401
  const err = gen.const("err", errObj);
1324
1402
  gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`);
1325
1403
  gen.code((0, codegen_1._)`${names_1.default.errors}++`);
1326
1404
  }
1405
+ __name(addError, "addError");
1327
1406
  function returnErrors(it, errs) {
1328
1407
  const { gen, validateName, schemaEnv } = it;
1329
1408
  if (schemaEnv.$async) {
@@ -1333,6 +1412,7 @@ var require_errors = __commonJS({
1333
1412
  gen.return(false);
1334
1413
  }
1335
1414
  }
1415
+ __name(returnErrors, "returnErrors");
1336
1416
  var E = {
1337
1417
  keyword: new codegen_1.Name("keyword"),
1338
1418
  schemaPath: new codegen_1.Name("schemaPath"),
@@ -1348,6 +1428,7 @@ var require_errors = __commonJS({
1348
1428
  return (0, codegen_1._)`{}`;
1349
1429
  return errorObject(cxt, error, errorPaths);
1350
1430
  }
1431
+ __name(errorObjectCode, "errorObjectCode");
1351
1432
  function errorObject(cxt, error, errorPaths = {}) {
1352
1433
  const { gen, it } = cxt;
1353
1434
  const keyValues = [
@@ -1357,10 +1438,12 @@ var require_errors = __commonJS({
1357
1438
  extraErrorProps(cxt, error, keyValues);
1358
1439
  return gen.object(...keyValues);
1359
1440
  }
1441
+ __name(errorObject, "errorObject");
1360
1442
  function errorInstancePath({ errorPath }, { instancePath }) {
1361
1443
  const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath;
1362
1444
  return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
1363
1445
  }
1446
+ __name(errorInstancePath, "errorInstancePath");
1364
1447
  function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
1365
1448
  let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`;
1366
1449
  if (schemaPath) {
@@ -1368,6 +1451,7 @@ var require_errors = __commonJS({
1368
1451
  }
1369
1452
  return [E.schemaPath, schPath];
1370
1453
  }
1454
+ __name(errorSchemaPath, "errorSchemaPath");
1371
1455
  function extraErrorProps(cxt, { params, message }, keyValues) {
1372
1456
  const { keyword, data, schemaValue, it } = cxt;
1373
1457
  const { opts, propertyName, topSchemaRef, schemaPath } = it;
@@ -1381,6 +1465,7 @@ var require_errors = __commonJS({
1381
1465
  if (propertyName)
1382
1466
  keyValues.push([E.propertyName, propertyName]);
1383
1467
  }
1468
+ __name(extraErrorProps, "extraErrorProps");
1384
1469
  }
1385
1470
  });
1386
1471
 
@@ -1407,6 +1492,7 @@ var require_boolSchema = __commonJS({
1407
1492
  gen.return(true);
1408
1493
  }
1409
1494
  }
1495
+ __name(topBoolOrEmptySchema, "topBoolOrEmptySchema");
1410
1496
  exports.topBoolOrEmptySchema = topBoolOrEmptySchema;
1411
1497
  function boolOrEmptySchema(it, valid) {
1412
1498
  const { gen, schema } = it;
@@ -1417,6 +1503,7 @@ var require_boolSchema = __commonJS({
1417
1503
  gen.var(valid, true);
1418
1504
  }
1419
1505
  }
1506
+ __name(boolOrEmptySchema, "boolOrEmptySchema");
1420
1507
  exports.boolOrEmptySchema = boolOrEmptySchema;
1421
1508
  function falseSchemaError(it, overrideAllErrors) {
1422
1509
  const { gen, data } = it;
@@ -1432,6 +1519,7 @@ var require_boolSchema = __commonJS({
1432
1519
  };
1433
1520
  (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors);
1434
1521
  }
1522
+ __name(falseSchemaError, "falseSchemaError");
1435
1523
  }
1436
1524
  });
1437
1525
 
@@ -1446,6 +1534,7 @@ var require_rules = __commonJS({
1446
1534
  function isJSONType(x) {
1447
1535
  return typeof x == "string" && jsonTypes.has(x);
1448
1536
  }
1537
+ __name(isJSONType, "isJSONType");
1449
1538
  exports.isJSONType = isJSONType;
1450
1539
  function getRules() {
1451
1540
  const groups = {
@@ -1462,6 +1551,7 @@ var require_rules = __commonJS({
1462
1551
  keywords: {}
1463
1552
  };
1464
1553
  }
1554
+ __name(getRules, "getRules");
1465
1555
  exports.getRules = getRules;
1466
1556
  }
1467
1557
  });
@@ -1476,15 +1566,18 @@ var require_applicability = __commonJS({
1476
1566
  const group = self.RULES.types[type];
1477
1567
  return group && group !== true && shouldUseGroup(schema, group);
1478
1568
  }
1569
+ __name(schemaHasRulesForType, "schemaHasRulesForType");
1479
1570
  exports.schemaHasRulesForType = schemaHasRulesForType;
1480
1571
  function shouldUseGroup(schema, group) {
1481
1572
  return group.rules.some((rule) => shouldUseRule(schema, rule));
1482
1573
  }
1574
+ __name(shouldUseGroup, "shouldUseGroup");
1483
1575
  exports.shouldUseGroup = shouldUseGroup;
1484
1576
  function shouldUseRule(schema, rule) {
1485
1577
  var _a;
1486
1578
  return schema[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== void 0));
1487
1579
  }
1580
+ __name(shouldUseRule, "shouldUseRule");
1488
1581
  exports.shouldUseRule = shouldUseRule;
1489
1582
  }
1490
1583
  });
@@ -1520,6 +1613,7 @@ var require_dataType = __commonJS({
1520
1613
  }
1521
1614
  return types;
1522
1615
  }
1616
+ __name(getSchemaTypes, "getSchemaTypes");
1523
1617
  exports.getSchemaTypes = getSchemaTypes;
1524
1618
  function getJSONTypes(ts) {
1525
1619
  const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
@@ -1527,6 +1621,7 @@ var require_dataType = __commonJS({
1527
1621
  return types;
1528
1622
  throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
1529
1623
  }
1624
+ __name(getJSONTypes, "getJSONTypes");
1530
1625
  exports.getJSONTypes = getJSONTypes;
1531
1626
  function coerceAndCheckDataType(it, types) {
1532
1627
  const { gen, data, opts } = it;
@@ -1543,11 +1638,13 @@ var require_dataType = __commonJS({
1543
1638
  }
1544
1639
  return checkTypes;
1545
1640
  }
1641
+ __name(coerceAndCheckDataType, "coerceAndCheckDataType");
1546
1642
  exports.coerceAndCheckDataType = coerceAndCheckDataType;
1547
1643
  var COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
1548
1644
  function coerceToTypes(types, coerceTypes) {
1549
1645
  return coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : [];
1550
1646
  }
1647
+ __name(coerceToTypes, "coerceToTypes");
1551
1648
  function coerceData(it, types, coerceTo) {
1552
1649
  const { gen, data, opts } = it;
1553
1650
  const dataType = gen.let("dataType", (0, codegen_1._)`typeof ${data}`);
@@ -1593,10 +1690,13 @@ var require_dataType = __commonJS({
1593
1690
  || ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`);
1594
1691
  }
1595
1692
  }
1693
+ __name(coerceSpecificType, "coerceSpecificType");
1596
1694
  }
1695
+ __name(coerceData, "coerceData");
1597
1696
  function assignParentData({ gen, parentData, parentDataProperty }, expr) {
1598
1697
  gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));
1599
1698
  }
1699
+ __name(assignParentData, "assignParentData");
1600
1700
  function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
1601
1701
  const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
1602
1702
  let cond;
@@ -1622,7 +1722,9 @@ var require_dataType = __commonJS({
1622
1722
  function numCond(_cond = codegen_1.nil) {
1623
1723
  return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil);
1624
1724
  }
1725
+ __name(numCond, "numCond");
1625
1726
  }
1727
+ __name(checkDataType, "checkDataType");
1626
1728
  exports.checkDataType = checkDataType;
1627
1729
  function checkDataTypes(dataTypes, data, strictNums, correct) {
1628
1730
  if (dataTypes.length === 1) {
@@ -1645,6 +1747,7 @@ var require_dataType = __commonJS({
1645
1747
  cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
1646
1748
  return cond;
1647
1749
  }
1750
+ __name(checkDataTypes, "checkDataTypes");
1648
1751
  exports.checkDataTypes = checkDataTypes;
1649
1752
  var typeError = {
1650
1753
  message: ({ schema }) => `must be ${schema}`,
@@ -1654,6 +1757,7 @@ var require_dataType = __commonJS({
1654
1757
  const cxt = getTypeErrorContext(it);
1655
1758
  (0, errors_1.reportError)(cxt, typeError);
1656
1759
  }
1760
+ __name(reportTypeError, "reportTypeError");
1657
1761
  exports.reportTypeError = reportTypeError;
1658
1762
  function getTypeErrorContext(it) {
1659
1763
  const { gen, data, schema } = it;
@@ -1670,6 +1774,7 @@ var require_dataType = __commonJS({
1670
1774
  it
1671
1775
  };
1672
1776
  }
1777
+ __name(getTypeErrorContext, "getTypeErrorContext");
1673
1778
  }
1674
1779
  });
1675
1780
 
@@ -1691,6 +1796,7 @@ var require_defaults = __commonJS({
1691
1796
  items.forEach((sch, i) => assignDefault(it, i, sch.default));
1692
1797
  }
1693
1798
  }
1799
+ __name(assignDefaults, "assignDefaults");
1694
1800
  exports.assignDefaults = assignDefaults;
1695
1801
  function assignDefault(it, prop, defaultValue) {
1696
1802
  const { gen, compositeRule, data, opts } = it;
@@ -1707,6 +1813,7 @@ var require_defaults = __commonJS({
1707
1813
  }
1708
1814
  gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
1709
1815
  }
1816
+ __name(assignDefault, "assignDefault");
1710
1817
  }
1711
1818
  });
1712
1819
 
@@ -1727,15 +1834,18 @@ var require_code2 = __commonJS({
1727
1834
  cxt.error();
1728
1835
  });
1729
1836
  }
1837
+ __name(checkReportMissingProp, "checkReportMissingProp");
1730
1838
  exports.checkReportMissingProp = checkReportMissingProp;
1731
1839
  function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
1732
1840
  return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));
1733
1841
  }
1842
+ __name(checkMissingProp, "checkMissingProp");
1734
1843
  exports.checkMissingProp = checkMissingProp;
1735
1844
  function reportMissingProp(cxt, missing) {
1736
1845
  cxt.setParams({ missingProperty: missing }, true);
1737
1846
  cxt.error();
1738
1847
  }
1848
+ __name(reportMissingProp, "reportMissingProp");
1739
1849
  exports.reportMissingProp = reportMissingProp;
1740
1850
  function hasPropFunc(gen) {
1741
1851
  return gen.scopeValue("func", {
@@ -1744,28 +1854,34 @@ var require_code2 = __commonJS({
1744
1854
  code: (0, codegen_1._)`Object.prototype.hasOwnProperty`
1745
1855
  });
1746
1856
  }
1857
+ __name(hasPropFunc, "hasPropFunc");
1747
1858
  exports.hasPropFunc = hasPropFunc;
1748
1859
  function isOwnProperty(gen, data, property) {
1749
1860
  return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`;
1750
1861
  }
1862
+ __name(isOwnProperty, "isOwnProperty");
1751
1863
  exports.isOwnProperty = isOwnProperty;
1752
1864
  function propertyInData(gen, data, property, ownProperties) {
1753
1865
  const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`;
1754
1866
  return ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond;
1755
1867
  }
1868
+ __name(propertyInData, "propertyInData");
1756
1869
  exports.propertyInData = propertyInData;
1757
1870
  function noPropertyInData(gen, data, property, ownProperties) {
1758
1871
  const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`;
1759
1872
  return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;
1760
1873
  }
1874
+ __name(noPropertyInData, "noPropertyInData");
1761
1875
  exports.noPropertyInData = noPropertyInData;
1762
1876
  function allSchemaProperties(schemaMap) {
1763
1877
  return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
1764
1878
  }
1879
+ __name(allSchemaProperties, "allSchemaProperties");
1765
1880
  exports.allSchemaProperties = allSchemaProperties;
1766
1881
  function schemaProperties(it, schemaMap) {
1767
1882
  return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
1768
1883
  }
1884
+ __name(schemaProperties, "schemaProperties");
1769
1885
  exports.schemaProperties = schemaProperties;
1770
1886
  function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
1771
1887
  const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
@@ -1780,6 +1896,7 @@ var require_code2 = __commonJS({
1780
1896
  const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
1781
1897
  return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`;
1782
1898
  }
1899
+ __name(callValidateCode, "callValidateCode");
1783
1900
  exports.callValidateCode = callValidateCode;
1784
1901
  var newRegExp = (0, codegen_1._)`new RegExp`;
1785
1902
  function usePattern({ gen, it: { opts } }, pattern) {
@@ -1792,6 +1909,7 @@ var require_code2 = __commonJS({
1792
1909
  code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`
1793
1910
  });
1794
1911
  }
1912
+ __name(usePattern, "usePattern");
1795
1913
  exports.usePattern = usePattern;
1796
1914
  function validateArray(cxt) {
1797
1915
  const { gen, data, keyword, it } = cxt;
@@ -1815,7 +1933,9 @@ var require_code2 = __commonJS({
1815
1933
  gen.if((0, codegen_1.not)(valid), notValid);
1816
1934
  });
1817
1935
  }
1936
+ __name(validateItems, "validateItems");
1818
1937
  }
1938
+ __name(validateArray, "validateArray");
1819
1939
  exports.validateArray = validateArray;
1820
1940
  function validateUnion(cxt) {
1821
1941
  const { gen, schema, keyword, it } = cxt;
@@ -1839,6 +1959,7 @@ var require_code2 = __commonJS({
1839
1959
  }));
1840
1960
  cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
1841
1961
  }
1962
+ __name(validateUnion, "validateUnion");
1842
1963
  exports.validateUnion = validateUnion;
1843
1964
  }
1844
1965
  });
@@ -1869,6 +1990,7 @@ var require_keyword = __commonJS({
1869
1990
  }, valid);
1870
1991
  cxt.pass(valid, () => cxt.error(true));
1871
1992
  }
1993
+ __name(macroKeywordCode, "macroKeywordCode");
1872
1994
  exports.macroKeywordCode = macroKeywordCode;
1873
1995
  function funcKeywordCode(cxt, def) {
1874
1996
  var _a;
@@ -1892,32 +2014,39 @@ var require_keyword = __commonJS({
1892
2014
  reportErrs(() => addErrs(cxt, ruleErrs));
1893
2015
  }
1894
2016
  }
2017
+ __name(validateKeyword, "validateKeyword");
1895
2018
  function validateAsync() {
1896
2019
  const ruleErrs = gen.let("ruleErrs", null);
1897
2020
  gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));
1898
2021
  return ruleErrs;
1899
2022
  }
2023
+ __name(validateAsync, "validateAsync");
1900
2024
  function validateSync() {
1901
2025
  const validateErrs = (0, codegen_1._)`${validateRef}.errors`;
1902
2026
  gen.assign(validateErrs, null);
1903
2027
  assignValid(codegen_1.nil);
1904
2028
  return validateErrs;
1905
2029
  }
2030
+ __name(validateSync, "validateSync");
1906
2031
  function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) {
1907
2032
  const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;
1908
2033
  const passSchema = !("compile" in def && !$data || def.schema === false);
1909
2034
  gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
1910
2035
  }
2036
+ __name(assignValid, "assignValid");
1911
2037
  function reportErrs(errors) {
1912
2038
  var _a2;
1913
2039
  gen.if((0, codegen_1.not)((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid), errors);
1914
2040
  }
2041
+ __name(reportErrs, "reportErrs");
1915
2042
  }
2043
+ __name(funcKeywordCode, "funcKeywordCode");
1916
2044
  exports.funcKeywordCode = funcKeywordCode;
1917
2045
  function modifyData(cxt) {
1918
2046
  const { gen, data, it } = cxt;
1919
2047
  gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`));
1920
2048
  }
2049
+ __name(modifyData, "modifyData");
1921
2050
  function addErrs(cxt, errs) {
1922
2051
  const { gen } = cxt;
1923
2052
  gen.if((0, codegen_1._)`Array.isArray(${errs})`, () => {
@@ -1925,18 +2054,22 @@ var require_keyword = __commonJS({
1925
2054
  (0, errors_1.extendErrors)(cxt);
1926
2055
  }, () => cxt.error());
1927
2056
  }
2057
+ __name(addErrs, "addErrs");
1928
2058
  function checkAsyncKeyword({ schemaEnv }, def) {
1929
2059
  if (def.async && !schemaEnv.$async)
1930
2060
  throw new Error("async keyword in sync schema");
1931
2061
  }
2062
+ __name(checkAsyncKeyword, "checkAsyncKeyword");
1932
2063
  function useKeyword(gen, keyword, result) {
1933
2064
  if (result === void 0)
1934
2065
  throw new Error(`keyword "${keyword}" failed to compile`);
1935
2066
  return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
1936
2067
  }
2068
+ __name(useKeyword, "useKeyword");
1937
2069
  function validSchemaType(schema, schemaType, allowUndefined = false) {
1938
2070
  return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined");
1939
2071
  }
2072
+ __name(validSchemaType, "validSchemaType");
1940
2073
  exports.validSchemaType = validSchemaType;
1941
2074
  function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {
1942
2075
  if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
@@ -1957,6 +2090,7 @@ var require_keyword = __commonJS({
1957
2090
  }
1958
2091
  }
1959
2092
  }
2093
+ __name(validateKeywordUsage, "validateKeywordUsage");
1960
2094
  exports.validateKeywordUsage = validateKeywordUsage;
1961
2095
  }
1962
2096
  });
@@ -1998,6 +2132,7 @@ var require_subschema = __commonJS({
1998
2132
  }
1999
2133
  throw new Error('either "keyword" or "schema" must be passed');
2000
2134
  }
2135
+ __name(getSubschema, "getSubschema");
2001
2136
  exports.getSubschema = getSubschema;
2002
2137
  function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
2003
2138
  if (data !== void 0 && dataProp !== void 0) {
@@ -2028,7 +2163,9 @@ var require_subschema = __commonJS({
2028
2163
  subschema.parentData = it.data;
2029
2164
  subschema.dataNames = [...it.dataNames, _nextData];
2030
2165
  }
2166
+ __name(dataContextProps, "dataContextProps");
2031
2167
  }
2168
+ __name(extendSubschemaData, "extendSubschemaData");
2032
2169
  exports.extendSubschemaData = extendSubschemaData;
2033
2170
  function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
2034
2171
  if (compositeRule !== void 0)
@@ -2040,6 +2177,7 @@ var require_subschema = __commonJS({
2040
2177
  subschema.jtdDiscriminator = jtdDiscriminator;
2041
2178
  subschema.jtdMetadata = jtdMetadata;
2042
2179
  }
2180
+ __name(extendSubschemaMode, "extendSubschemaMode");
2043
2181
  exports.extendSubschemaMode = extendSubschemaMode;
2044
2182
  }
2045
2183
  });
@@ -2048,7 +2186,7 @@ var require_subschema = __commonJS({
2048
2186
  var require_fast_deep_equal = __commonJS({
2049
2187
  "node_modules/fast-deep-equal/index.js"(exports, module) {
2050
2188
  "use strict";
2051
- module.exports = function equal(a, b) {
2189
+ module.exports = /* @__PURE__ */ __name(function equal(a, b) {
2052
2190
  if (a === b)
2053
2191
  return true;
2054
2192
  if (a && b && typeof a == "object" && typeof b == "object") {
@@ -2085,7 +2223,7 @@ var require_fast_deep_equal = __commonJS({
2085
2223
  return true;
2086
2224
  }
2087
2225
  return a !== a && b !== b;
2088
- };
2226
+ }, "equal");
2089
2227
  }
2090
2228
  });
2091
2229
 
@@ -2171,9 +2309,11 @@ var require_json_schema_traverse = __commonJS({
2171
2309
  post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
2172
2310
  }
2173
2311
  }
2312
+ __name(_traverse, "_traverse");
2174
2313
  function escapeJsonPtr(str) {
2175
2314
  return str.replace(/~/g, "~0").replace(/\//g, "~1");
2176
2315
  }
2316
+ __name(escapeJsonPtr, "escapeJsonPtr");
2177
2317
  }
2178
2318
  });
2179
2319
 
@@ -2213,6 +2353,7 @@ var require_resolve = __commonJS({
2213
2353
  return false;
2214
2354
  return countKeys(schema) <= limit;
2215
2355
  }
2356
+ __name(inlineRef, "inlineRef");
2216
2357
  exports.inlineRef = inlineRef;
2217
2358
  var REF_KEYWORDS = /* @__PURE__ */ new Set([
2218
2359
  "$ref",
@@ -2233,6 +2374,7 @@ var require_resolve = __commonJS({
2233
2374
  }
2234
2375
  return false;
2235
2376
  }
2377
+ __name(hasRef, "hasRef");
2236
2378
  function countKeys(schema) {
2237
2379
  let count = 0;
2238
2380
  for (const key in schema) {
@@ -2249,27 +2391,32 @@ var require_resolve = __commonJS({
2249
2391
  }
2250
2392
  return count;
2251
2393
  }
2394
+ __name(countKeys, "countKeys");
2252
2395
  function getFullPath(resolver, id = "", normalize) {
2253
2396
  if (normalize !== false)
2254
2397
  id = normalizeId(id);
2255
2398
  const p = resolver.parse(id);
2256
2399
  return _getFullPath(resolver, p);
2257
2400
  }
2401
+ __name(getFullPath, "getFullPath");
2258
2402
  exports.getFullPath = getFullPath;
2259
2403
  function _getFullPath(resolver, p) {
2260
2404
  const serialized = resolver.serialize(p);
2261
2405
  return serialized.split("#")[0] + "#";
2262
2406
  }
2407
+ __name(_getFullPath, "_getFullPath");
2263
2408
  exports._getFullPath = _getFullPath;
2264
2409
  var TRAILING_SLASH_HASH = /#\/?$/;
2265
2410
  function normalizeId(id) {
2266
2411
  return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
2267
2412
  }
2413
+ __name(normalizeId, "normalizeId");
2268
2414
  exports.normalizeId = normalizeId;
2269
2415
  function resolveUrl(resolver, baseId, id) {
2270
2416
  id = normalizeId(id);
2271
2417
  return resolver.resolve(baseId, id);
2272
2418
  }
2419
+ __name(resolveUrl, "resolveUrl");
2273
2420
  exports.resolveUrl = resolveUrl;
2274
2421
  var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
2275
2422
  function getSchemaRefs(schema, baseId) {
@@ -2312,6 +2459,7 @@ var require_resolve = __commonJS({
2312
2459
  }
2313
2460
  return ref;
2314
2461
  }
2462
+ __name(addRef, "addRef");
2315
2463
  function addAnchor(anchor) {
2316
2464
  if (typeof anchor == "string") {
2317
2465
  if (!ANCHOR.test(anchor))
@@ -2319,16 +2467,20 @@ var require_resolve = __commonJS({
2319
2467
  addRef.call(this, `#${anchor}`);
2320
2468
  }
2321
2469
  }
2470
+ __name(addAnchor, "addAnchor");
2322
2471
  });
2323
2472
  return localRefs;
2324
2473
  function checkAmbiguosRef(sch1, sch2, ref) {
2325
2474
  if (sch2 !== void 0 && !equal(sch1, sch2))
2326
2475
  throw ambiguos(ref);
2327
2476
  }
2477
+ __name(checkAmbiguosRef, "checkAmbiguosRef");
2328
2478
  function ambiguos(ref) {
2329
2479
  return new Error(`reference "${ref}" resolves to more than one schema`);
2330
2480
  }
2481
+ __name(ambiguos, "ambiguos");
2331
2482
  }
2483
+ __name(getSchemaRefs, "getSchemaRefs");
2332
2484
  exports.getSchemaRefs = getSchemaRefs;
2333
2485
  }
2334
2486
  });
@@ -2361,6 +2513,7 @@ var require_validate = __commonJS({
2361
2513
  }
2362
2514
  validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
2363
2515
  }
2516
+ __name(validateFunctionCode, "validateFunctionCode");
2364
2517
  exports.validateFunctionCode = validateFunctionCode;
2365
2518
  function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
2366
2519
  if (opts.code.es5) {
@@ -2373,9 +2526,11 @@ var require_validate = __commonJS({
2373
2526
  gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
2374
2527
  }
2375
2528
  }
2529
+ __name(validateFunction, "validateFunction");
2376
2530
  function destructureValCxt(opts) {
2377
2531
  return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
2378
2532
  }
2533
+ __name(destructureValCxt, "destructureValCxt");
2379
2534
  function destructureValCxtES5(gen, opts) {
2380
2535
  gen.if(names_1.default.valCxt, () => {
2381
2536
  gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`);
@@ -2393,6 +2548,7 @@ var require_validate = __commonJS({
2393
2548
  gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`);
2394
2549
  });
2395
2550
  }
2551
+ __name(destructureValCxtES5, "destructureValCxtES5");
2396
2552
  function topSchemaObjCode(it) {
2397
2553
  const { schema, opts, gen } = it;
2398
2554
  validateFunction(it, () => {
@@ -2408,16 +2564,19 @@ var require_validate = __commonJS({
2408
2564
  });
2409
2565
  return;
2410
2566
  }
2567
+ __name(topSchemaObjCode, "topSchemaObjCode");
2411
2568
  function resetEvaluated(it) {
2412
2569
  const { gen, validateName } = it;
2413
2570
  it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`);
2414
2571
  gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));
2415
2572
  gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));
2416
2573
  }
2574
+ __name(resetEvaluated, "resetEvaluated");
2417
2575
  function funcSourceUrl(schema, opts) {
2418
2576
  const schId = typeof schema == "object" && schema[opts.schemaId];
2419
2577
  return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;
2420
2578
  }
2579
+ __name(funcSourceUrl, "funcSourceUrl");
2421
2580
  function subschemaCode(it, valid) {
2422
2581
  if (isSchemaObj(it)) {
2423
2582
  checkKeywords(it);
@@ -2428,6 +2587,7 @@ var require_validate = __commonJS({
2428
2587
  }
2429
2588
  (0, boolSchema_1.boolOrEmptySchema)(it, valid);
2430
2589
  }
2590
+ __name(subschemaCode, "subschemaCode");
2431
2591
  function schemaCxtHasRules({ schema, self }) {
2432
2592
  if (typeof schema == "boolean")
2433
2593
  return !schema;
@@ -2436,9 +2596,11 @@ var require_validate = __commonJS({
2436
2596
  return true;
2437
2597
  return false;
2438
2598
  }
2599
+ __name(schemaCxtHasRules, "schemaCxtHasRules");
2439
2600
  function isSchemaObj(it) {
2440
2601
  return typeof it.schema != "boolean";
2441
2602
  }
2603
+ __name(isSchemaObj, "isSchemaObj");
2442
2604
  function subSchemaObjCode(it, valid) {
2443
2605
  const { schema, gen, opts } = it;
2444
2606
  if (opts.$comment && schema.$comment)
@@ -2449,10 +2611,12 @@ var require_validate = __commonJS({
2449
2611
  typeAndKeywords(it, errsCount);
2450
2612
  gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
2451
2613
  }
2614
+ __name(subSchemaObjCode, "subSchemaObjCode");
2452
2615
  function checkKeywords(it) {
2453
2616
  (0, util_1.checkUnknownRules)(it);
2454
2617
  checkRefsAndKeywords(it);
2455
2618
  }
2619
+ __name(checkKeywords, "checkKeywords");
2456
2620
  function typeAndKeywords(it, errsCount) {
2457
2621
  if (it.opts.jtd)
2458
2622
  return schemaKeywords(it, [], false, errsCount);
@@ -2460,27 +2624,32 @@ var require_validate = __commonJS({
2460
2624
  const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
2461
2625
  schemaKeywords(it, types, !checkedTypes, errsCount);
2462
2626
  }
2627
+ __name(typeAndKeywords, "typeAndKeywords");
2463
2628
  function checkRefsAndKeywords(it) {
2464
2629
  const { schema, errSchemaPath, opts, self } = it;
2465
2630
  if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {
2466
2631
  self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
2467
2632
  }
2468
2633
  }
2634
+ __name(checkRefsAndKeywords, "checkRefsAndKeywords");
2469
2635
  function checkNoDefault(it) {
2470
2636
  const { schema, opts } = it;
2471
2637
  if (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) {
2472
2638
  (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
2473
2639
  }
2474
2640
  }
2641
+ __name(checkNoDefault, "checkNoDefault");
2475
2642
  function updateContext(it) {
2476
2643
  const schId = it.schema[it.opts.schemaId];
2477
2644
  if (schId)
2478
2645
  it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
2479
2646
  }
2647
+ __name(updateContext, "updateContext");
2480
2648
  function checkAsyncSchema(it) {
2481
2649
  if (it.schema.$async && !it.schemaEnv.$async)
2482
2650
  throw new Error("async schema in sync schema");
2483
2651
  }
2652
+ __name(checkAsyncSchema, "checkAsyncSchema");
2484
2653
  function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {
2485
2654
  const msg = schema.$comment;
2486
2655
  if (opts.$comment === true) {
@@ -2491,6 +2660,7 @@ var require_validate = __commonJS({
2491
2660
  gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
2492
2661
  }
2493
2662
  }
2663
+ __name(commentKeyword, "commentKeyword");
2494
2664
  function returnResults(it) {
2495
2665
  const { gen, schemaEnv, validateName, ValidationError, opts } = it;
2496
2666
  if (schemaEnv.$async) {
@@ -2502,12 +2672,14 @@ var require_validate = __commonJS({
2502
2672
  gen.return((0, codegen_1._)`${names_1.default.errors} === 0`);
2503
2673
  }
2504
2674
  }
2675
+ __name(returnResults, "returnResults");
2505
2676
  function assignEvaluated({ gen, evaluated, props, items }) {
2506
2677
  if (props instanceof codegen_1.Name)
2507
2678
  gen.assign((0, codegen_1._)`${evaluated}.props`, props);
2508
2679
  if (items instanceof codegen_1.Name)
2509
2680
  gen.assign((0, codegen_1._)`${evaluated}.items`, items);
2510
2681
  }
2682
+ __name(assignEvaluated, "assignEvaluated");
2511
2683
  function schemaKeywords(it, types, typeErrors, errsCount) {
2512
2684
  const { gen, schema, data, allErrors, opts, self } = it;
2513
2685
  const { RULES } = self;
@@ -2539,7 +2711,9 @@ var require_validate = __commonJS({
2539
2711
  if (!allErrors)
2540
2712
  gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`);
2541
2713
  }
2714
+ __name(groupKeywords, "groupKeywords");
2542
2715
  }
2716
+ __name(schemaKeywords, "schemaKeywords");
2543
2717
  function iterateKeywords(it, group) {
2544
2718
  const { gen, schema, opts: { useDefaults } } = it;
2545
2719
  if (useDefaults)
@@ -2552,6 +2726,7 @@ var require_validate = __commonJS({
2552
2726
  }
2553
2727
  });
2554
2728
  }
2729
+ __name(iterateKeywords, "iterateKeywords");
2555
2730
  function checkStrictTypes(it, types) {
2556
2731
  if (it.schemaEnv.meta || !it.opts.strictTypes)
2557
2732
  return;
@@ -2560,6 +2735,7 @@ var require_validate = __commonJS({
2560
2735
  checkMultipleTypes(it, types);
2561
2736
  checkKeywordTypes(it, it.dataTypes);
2562
2737
  }
2738
+ __name(checkStrictTypes, "checkStrictTypes");
2563
2739
  function checkContextTypes(it, types) {
2564
2740
  if (!types.length)
2565
2741
  return;
@@ -2572,13 +2748,15 @@ var require_validate = __commonJS({
2572
2748
  strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
2573
2749
  }
2574
2750
  });
2575
- it.dataTypes = it.dataTypes.filter((t) => includesType(types, t));
2751
+ narrowSchemaTypes(it, types);
2576
2752
  }
2753
+ __name(checkContextTypes, "checkContextTypes");
2577
2754
  function checkMultipleTypes(it, ts) {
2578
2755
  if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
2579
2756
  strictTypesError(it, "use allowUnionTypes to allow union type keyword");
2580
2757
  }
2581
2758
  }
2759
+ __name(checkMultipleTypes, "checkMultipleTypes");
2582
2760
  function checkKeywordTypes(it, ts) {
2583
2761
  const rules = it.self.RULES.all;
2584
2762
  for (const keyword in rules) {
@@ -2591,17 +2769,32 @@ var require_validate = __commonJS({
2591
2769
  }
2592
2770
  }
2593
2771
  }
2772
+ __name(checkKeywordTypes, "checkKeywordTypes");
2594
2773
  function hasApplicableType(schTs, kwdT) {
2595
2774
  return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
2596
2775
  }
2776
+ __name(hasApplicableType, "hasApplicableType");
2597
2777
  function includesType(ts, t) {
2598
2778
  return ts.includes(t) || t === "integer" && ts.includes("number");
2599
2779
  }
2780
+ __name(includesType, "includesType");
2781
+ function narrowSchemaTypes(it, withTypes) {
2782
+ const ts = [];
2783
+ for (const t of it.dataTypes) {
2784
+ if (includesType(withTypes, t))
2785
+ ts.push(t);
2786
+ else if (withTypes.includes("integer") && t === "number")
2787
+ ts.push("integer");
2788
+ }
2789
+ it.dataTypes = ts;
2790
+ }
2791
+ __name(narrowSchemaTypes, "narrowSchemaTypes");
2600
2792
  function strictTypesError(it, msg) {
2601
2793
  const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
2602
2794
  msg += ` at "${schemaPath}" (strictTypes)`;
2603
2795
  (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
2604
2796
  }
2797
+ __name(strictTypesError, "strictTypesError");
2605
2798
  var KeywordCxt = class {
2606
2799
  constructor(it, def, keyword) {
2607
2800
  (0, keyword_1.validateKeywordUsage)(it, def, keyword);
@@ -2737,6 +2930,7 @@ var require_validate = __commonJS({
2737
2930
  }
2738
2931
  return codegen_1.nil;
2739
2932
  }
2933
+ __name(wrong$DataType, "wrong$DataType");
2740
2934
  function invalid$DataSchema() {
2741
2935
  if (def.validateSchema) {
2742
2936
  const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema });
@@ -2744,6 +2938,7 @@ var require_validate = __commonJS({
2744
2938
  }
2745
2939
  return codegen_1.nil;
2746
2940
  }
2941
+ __name(invalid$DataSchema, "invalid$DataSchema");
2747
2942
  }
2748
2943
  subschema(appl, valid) {
2749
2944
  const subschema = (0, subschema_1.getSubschema)(this.it, appl);
@@ -2772,6 +2967,7 @@ var require_validate = __commonJS({
2772
2967
  }
2773
2968
  }
2774
2969
  };
2970
+ __name(KeywordCxt, "KeywordCxt");
2775
2971
  exports.KeywordCxt = KeywordCxt;
2776
2972
  function keywordCode(it, keyword, def, ruleType) {
2777
2973
  const cxt = new KeywordCxt(it, def, keyword);
@@ -2785,6 +2981,7 @@ var require_validate = __commonJS({
2785
2981
  (0, keyword_1.funcKeywordCode)(cxt, def);
2786
2982
  }
2787
2983
  }
2984
+ __name(keywordCode, "keywordCode");
2788
2985
  var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
2789
2986
  var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
2790
2987
  function getData($data, { dataLevel, dataNames, dataPathArr }) {
@@ -2826,7 +3023,9 @@ var require_validate = __commonJS({
2826
3023
  function errorMsg(pointerType, up) {
2827
3024
  return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
2828
3025
  }
3026
+ __name(errorMsg, "errorMsg");
2829
3027
  }
3028
+ __name(getData, "getData");
2830
3029
  exports.getData = getData;
2831
3030
  }
2832
3031
  });
@@ -2843,6 +3042,7 @@ var require_validation_error = __commonJS({
2843
3042
  this.ajv = this.validation = true;
2844
3043
  }
2845
3044
  };
3045
+ __name(ValidationError, "ValidationError");
2846
3046
  exports.default = ValidationError;
2847
3047
  }
2848
3048
  });
@@ -2860,6 +3060,7 @@ var require_ref_error = __commonJS({
2860
3060
  this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
2861
3061
  }
2862
3062
  };
3063
+ __name(MissingRefError, "MissingRefError");
2863
3064
  exports.default = MissingRefError;
2864
3065
  }
2865
3066
  });
@@ -2895,6 +3096,7 @@ var require_compile = __commonJS({
2895
3096
  this.refs = {};
2896
3097
  }
2897
3098
  };
3099
+ __name(SchemaEnv, "SchemaEnv");
2898
3100
  exports.SchemaEnv = SchemaEnv;
2899
3101
  function compileSchema(sch) {
2900
3102
  const _sch = getCompilingSchema.call(this, sch);
@@ -2980,6 +3182,7 @@ var require_compile = __commonJS({
2980
3182
  this._compilations.delete(sch);
2981
3183
  }
2982
3184
  }
3185
+ __name(compileSchema, "compileSchema");
2983
3186
  exports.compileSchema = compileSchema;
2984
3187
  function resolveRef(root, baseId, ref) {
2985
3188
  var _a;
@@ -2998,28 +3201,33 @@ var require_compile = __commonJS({
2998
3201
  return;
2999
3202
  return root.refs[ref] = inlineOrCompile.call(this, _sch);
3000
3203
  }
3204
+ __name(resolveRef, "resolveRef");
3001
3205
  exports.resolveRef = resolveRef;
3002
3206
  function inlineOrCompile(sch) {
3003
3207
  if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
3004
3208
  return sch.schema;
3005
3209
  return sch.validate ? sch : compileSchema.call(this, sch);
3006
3210
  }
3211
+ __name(inlineOrCompile, "inlineOrCompile");
3007
3212
  function getCompilingSchema(schEnv) {
3008
3213
  for (const sch of this._compilations) {
3009
3214
  if (sameSchemaEnv(sch, schEnv))
3010
3215
  return sch;
3011
3216
  }
3012
3217
  }
3218
+ __name(getCompilingSchema, "getCompilingSchema");
3013
3219
  exports.getCompilingSchema = getCompilingSchema;
3014
3220
  function sameSchemaEnv(s1, s2) {
3015
3221
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
3016
3222
  }
3223
+ __name(sameSchemaEnv, "sameSchemaEnv");
3017
3224
  function resolve(root, ref) {
3018
3225
  let sch;
3019
3226
  while (typeof (sch = this.refs[ref]) == "string")
3020
3227
  ref = sch;
3021
3228
  return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
3022
3229
  }
3230
+ __name(resolve, "resolve");
3023
3231
  function resolveSchema(root, ref) {
3024
3232
  const p = this.opts.uriResolver.parse(ref);
3025
3233
  const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
@@ -3049,6 +3257,7 @@ var require_compile = __commonJS({
3049
3257
  }
3050
3258
  return getJsonPointer.call(this, p, schOrRef);
3051
3259
  }
3260
+ __name(resolveSchema, "resolveSchema");
3052
3261
  exports.resolveSchema = resolveSchema;
3053
3262
  var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([
3054
3263
  "properties",
@@ -3084,6 +3293,7 @@ var require_compile = __commonJS({
3084
3293
  return env;
3085
3294
  return void 0;
3086
3295
  }
3296
+ __name(getJsonPointer, "getJsonPointer");
3087
3297
  }
3088
3298
  });
3089
3299
 
@@ -3129,18 +3339,23 @@ var require_uri_all = __commonJS({
3129
3339
  return sets[0];
3130
3340
  }
3131
3341
  }
3342
+ __name(merge, "merge");
3132
3343
  function subexp(str) {
3133
3344
  return "(?:" + str + ")";
3134
3345
  }
3346
+ __name(subexp, "subexp");
3135
3347
  function typeOf(o) {
3136
3348
  return o === void 0 ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
3137
3349
  }
3350
+ __name(typeOf, "typeOf");
3138
3351
  function toUpperCase(str) {
3139
3352
  return str.toUpperCase();
3140
3353
  }
3354
+ __name(toUpperCase, "toUpperCase");
3141
3355
  function toArray(obj) {
3142
3356
  return obj !== void 0 && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
3143
3357
  }
3358
+ __name(toArray, "toArray");
3144
3359
  function assign(target, source) {
3145
3360
  var obj = target;
3146
3361
  if (source) {
@@ -3150,6 +3365,7 @@ var require_uri_all = __commonJS({
3150
3365
  }
3151
3366
  return obj;
3152
3367
  }
3368
+ __name(assign, "assign");
3153
3369
  function buildExps(isIRI2) {
3154
3370
  var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$2 = merge(DIGIT$$, "[A-Fa-f]"), LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$2 = subexp(subexp("%[EFef]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%" + HEXDIG$$2 + HEXDIG$$2)), GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI2 ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", IPRIVATE$$ = isIRI2 ? "[\\uE000-\\uF8FF]" : "[]", UNRESERVED$$2 = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$2 + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$2 + "|" + PCT_ENCODED$2) + "+"), IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + ZONEID$), IPVFUTURE$ = subexp("[vV]" + HEXDIG$$2 + "+\\." + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), REG_NAME$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
3155
3371
  return {
@@ -3169,6 +3385,7 @@ var require_uri_all = __commonJS({
3169
3385
  //RFC 6874, with relaxed parsing rules
3170
3386
  };
3171
3387
  }
3388
+ __name(buildExps, "buildExps");
3172
3389
  var URI_PROTOCOL = buildExps(false);
3173
3390
  var IRI_PROTOCOL = buildExps(true);
3174
3391
  var slicedToArray = function() {
@@ -3197,6 +3414,7 @@ var require_uri_all = __commonJS({
3197
3414
  }
3198
3415
  return _arr;
3199
3416
  }
3417
+ __name(sliceIterator, "sliceIterator");
3200
3418
  return function(arr, i) {
3201
3419
  if (Array.isArray(arr)) {
3202
3420
  return arr;
@@ -3207,7 +3425,7 @@ var require_uri_all = __commonJS({
3207
3425
  }
3208
3426
  };
3209
3427
  }();
3210
- var toConsumableArray = function(arr) {
3428
+ var toConsumableArray = /* @__PURE__ */ __name(function(arr) {
3211
3429
  if (Array.isArray(arr)) {
3212
3430
  for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++)
3213
3431
  arr2[i] = arr[i];
@@ -3215,7 +3433,7 @@ var require_uri_all = __commonJS({
3215
3433
  } else {
3216
3434
  return Array.from(arr);
3217
3435
  }
3218
- };
3436
+ }, "toConsumableArray");
3219
3437
  var maxInt = 2147483647;
3220
3438
  var base = 36;
3221
3439
  var tMin = 1;
@@ -3239,6 +3457,7 @@ var require_uri_all = __commonJS({
3239
3457
  function error$1(type) {
3240
3458
  throw new RangeError(errors[type]);
3241
3459
  }
3460
+ __name(error$1, "error$1");
3242
3461
  function map(array, fn) {
3243
3462
  var result = [];
3244
3463
  var length = array.length;
@@ -3247,6 +3466,7 @@ var require_uri_all = __commonJS({
3247
3466
  }
3248
3467
  return result;
3249
3468
  }
3469
+ __name(map, "map");
3250
3470
  function mapDomain(string, fn) {
3251
3471
  var parts = string.split("@");
3252
3472
  var result = "";
@@ -3259,6 +3479,7 @@ var require_uri_all = __commonJS({
3259
3479
  var encoded = map(labels, fn).join(".");
3260
3480
  return result + encoded;
3261
3481
  }
3482
+ __name(mapDomain, "mapDomain");
3262
3483
  function ucs2decode(string) {
3263
3484
  var output = [];
3264
3485
  var counter = 0;
@@ -3279,10 +3500,11 @@ var require_uri_all = __commonJS({
3279
3500
  }
3280
3501
  return output;
3281
3502
  }
3282
- var ucs2encode = function ucs2encode2(array) {
3503
+ __name(ucs2decode, "ucs2decode");
3504
+ var ucs2encode = /* @__PURE__ */ __name(function ucs2encode2(array) {
3283
3505
  return String.fromCodePoint.apply(String, toConsumableArray(array));
3284
- };
3285
- var basicToDigit = function basicToDigit2(codePoint) {
3506
+ }, "ucs2encode");
3507
+ var basicToDigit = /* @__PURE__ */ __name(function basicToDigit2(codePoint) {
3286
3508
  if (codePoint - 48 < 10) {
3287
3509
  return codePoint - 22;
3288
3510
  }
@@ -3293,11 +3515,11 @@ var require_uri_all = __commonJS({
3293
3515
  return codePoint - 97;
3294
3516
  }
3295
3517
  return base;
3296
- };
3297
- var digitToBasic = function digitToBasic2(digit, flag) {
3518
+ }, "basicToDigit");
3519
+ var digitToBasic = /* @__PURE__ */ __name(function digitToBasic2(digit, flag) {
3298
3520
  return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
3299
- };
3300
- var adapt = function adapt2(delta, numPoints, firstTime) {
3521
+ }, "digitToBasic");
3522
+ var adapt = /* @__PURE__ */ __name(function adapt2(delta, numPoints, firstTime) {
3301
3523
  var k = 0;
3302
3524
  delta = firstTime ? floor(delta / damp) : delta >> 1;
3303
3525
  delta += floor(delta / numPoints);
@@ -3310,8 +3532,8 @@ var require_uri_all = __commonJS({
3310
3532
  delta = floor(delta / baseMinusTMin);
3311
3533
  }
3312
3534
  return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
3313
- };
3314
- var decode = function decode2(input) {
3535
+ }, "adapt");
3536
+ var decode = /* @__PURE__ */ __name(function decode2(input) {
3315
3537
  var output = [];
3316
3538
  var inputLength = input.length;
3317
3539
  var i = 0;
@@ -3363,8 +3585,8 @@ var require_uri_all = __commonJS({
3363
3585
  output.splice(i++, 0, n);
3364
3586
  }
3365
3587
  return String.fromCodePoint.apply(String, output);
3366
- };
3367
- var encode = function encode2(input) {
3588
+ }, "decode");
3589
+ var encode = /* @__PURE__ */ __name(function encode2(input) {
3368
3590
  var output = [];
3369
3591
  input = ucs2decode(input);
3370
3592
  var inputLength = input.length;
@@ -3482,17 +3704,17 @@ var require_uri_all = __commonJS({
3482
3704
  ++n;
3483
3705
  }
3484
3706
  return output.join("");
3485
- };
3486
- var toUnicode = function toUnicode2(input) {
3707
+ }, "encode");
3708
+ var toUnicode = /* @__PURE__ */ __name(function toUnicode2(input) {
3487
3709
  return mapDomain(input, function(string) {
3488
3710
  return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
3489
3711
  });
3490
- };
3491
- var toASCII = function toASCII2(input) {
3712
+ }, "toUnicode");
3713
+ var toASCII = /* @__PURE__ */ __name(function toASCII2(input) {
3492
3714
  return mapDomain(input, function(string) {
3493
3715
  return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
3494
3716
  });
3495
- };
3717
+ }, "toASCII");
3496
3718
  var punycode = {
3497
3719
  /**
3498
3720
  * A string representing the current Punycode.js version number.
@@ -3530,6 +3752,7 @@ var require_uri_all = __commonJS({
3530
3752
  e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
3531
3753
  return e;
3532
3754
  }
3755
+ __name(pctEncChar, "pctEncChar");
3533
3756
  function pctDecChars(str) {
3534
3757
  var newStr = "";
3535
3758
  var i = 0;
@@ -3563,11 +3786,13 @@ var require_uri_all = __commonJS({
3563
3786
  }
3564
3787
  return newStr;
3565
3788
  }
3789
+ __name(pctDecChars, "pctDecChars");
3566
3790
  function _normalizeComponentEncoding(components, protocol) {
3567
3791
  function decodeUnreserved2(str) {
3568
3792
  var decStr = pctDecChars(str);
3569
3793
  return !decStr.match(protocol.UNRESERVED) ? str : decStr;
3570
3794
  }
3795
+ __name(decodeUnreserved2, "decodeUnreserved");
3571
3796
  if (components.scheme)
3572
3797
  components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_SCHEME, "");
3573
3798
  if (components.userinfo !== void 0)
@@ -3582,9 +3807,11 @@ var require_uri_all = __commonJS({
3582
3807
  components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3583
3808
  return components;
3584
3809
  }
3810
+ __name(_normalizeComponentEncoding, "_normalizeComponentEncoding");
3585
3811
  function _stripLeadingZeros(str) {
3586
3812
  return str.replace(/^0*(.*)/, "$1") || "0";
3587
3813
  }
3814
+ __name(_stripLeadingZeros, "_stripLeadingZeros");
3588
3815
  function _normalizeIPv4(host, protocol) {
3589
3816
  var matches = host.match(protocol.IPV4ADDRESS) || [];
3590
3817
  var _matches = slicedToArray(matches, 2), address = _matches[1];
@@ -3594,6 +3821,7 @@ var require_uri_all = __commonJS({
3594
3821
  return host;
3595
3822
  }
3596
3823
  }
3824
+ __name(_normalizeIPv4, "_normalizeIPv4");
3597
3825
  function _normalizeIPv6(host, protocol) {
3598
3826
  var matches = host.match(protocol.IPV6ADDRESS) || [];
3599
3827
  var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2];
@@ -3641,6 +3869,7 @@ var require_uri_all = __commonJS({
3641
3869
  return host;
3642
3870
  }
3643
3871
  }
3872
+ __name(_normalizeIPv6, "_normalizeIPv6");
3644
3873
  var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
3645
3874
  var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0;
3646
3875
  function parse(uriString) {
@@ -3710,6 +3939,7 @@ var require_uri_all = __commonJS({
3710
3939
  }
3711
3940
  return components;
3712
3941
  }
3942
+ __name(parse, "parse");
3713
3943
  function _recomposeAuthority(components, options) {
3714
3944
  var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
3715
3945
  var uriTokens = [];
@@ -3728,6 +3958,7 @@ var require_uri_all = __commonJS({
3728
3958
  }
3729
3959
  return uriTokens.length ? uriTokens.join("") : void 0;
3730
3960
  }
3961
+ __name(_recomposeAuthority, "_recomposeAuthority");
3731
3962
  var RDS1 = /^\.\.?\//;
3732
3963
  var RDS2 = /^\/\.(\/|$)/;
3733
3964
  var RDS3 = /^\/\.\.(\/|$)/;
@@ -3757,6 +3988,7 @@ var require_uri_all = __commonJS({
3757
3988
  }
3758
3989
  return output.join("");
3759
3990
  }
3991
+ __name(removeDotSegments, "removeDotSegments");
3760
3992
  function serialize(components) {
3761
3993
  var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3762
3994
  var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
@@ -3809,6 +4041,7 @@ var require_uri_all = __commonJS({
3809
4041
  }
3810
4042
  return uriTokens.join("");
3811
4043
  }
4044
+ __name(serialize, "serialize");
3812
4045
  function resolveComponents(base2, relative) {
3813
4046
  var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3814
4047
  var skipNormalization = arguments[3];
@@ -3864,10 +4097,12 @@ var require_uri_all = __commonJS({
3864
4097
  target.fragment = relative.fragment;
3865
4098
  return target;
3866
4099
  }
4100
+ __name(resolveComponents, "resolveComponents");
3867
4101
  function resolve(baseURI, relativeURI, options) {
3868
4102
  var schemelessOptions = assign({ scheme: "null" }, options);
3869
4103
  return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
3870
4104
  }
4105
+ __name(resolve, "resolve");
3871
4106
  function normalize(uri, options) {
3872
4107
  if (typeof uri === "string") {
3873
4108
  uri = serialize(parse(uri, options), options);
@@ -3876,6 +4111,7 @@ var require_uri_all = __commonJS({
3876
4111
  }
3877
4112
  return uri;
3878
4113
  }
4114
+ __name(normalize, "normalize");
3879
4115
  function equal(uriA, uriB, options) {
3880
4116
  if (typeof uriA === "string") {
3881
4117
  uriA = serialize(parse(uriA, options), options);
@@ -3889,22 +4125,25 @@ var require_uri_all = __commonJS({
3889
4125
  }
3890
4126
  return uriA === uriB;
3891
4127
  }
4128
+ __name(equal, "equal");
3892
4129
  function escapeComponent(str, options) {
3893
4130
  return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
3894
4131
  }
4132
+ __name(escapeComponent, "escapeComponent");
3895
4133
  function unescapeComponent(str, options) {
3896
4134
  return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
3897
4135
  }
4136
+ __name(unescapeComponent, "unescapeComponent");
3898
4137
  var handler = {
3899
4138
  scheme: "http",
3900
4139
  domainHost: true,
3901
- parse: function parse2(components, options) {
4140
+ parse: /* @__PURE__ */ __name(function parse2(components, options) {
3902
4141
  if (!components.host) {
3903
4142
  components.error = components.error || "HTTP URIs must have a host.";
3904
4143
  }
3905
4144
  return components;
3906
- },
3907
- serialize: function serialize2(components, options) {
4145
+ }, "parse"),
4146
+ serialize: /* @__PURE__ */ __name(function serialize2(components, options) {
3908
4147
  var secure = String(components.scheme).toLowerCase() === "https";
3909
4148
  if (components.port === (secure ? 443 : 80) || components.port === "") {
3910
4149
  components.port = void 0;
@@ -3913,7 +4152,7 @@ var require_uri_all = __commonJS({
3913
4152
  components.path = "/";
3914
4153
  }
3915
4154
  return components;
3916
- }
4155
+ }, "serialize")
3917
4156
  };
3918
4157
  var handler$1 = {
3919
4158
  scheme: "https",
@@ -3924,18 +4163,19 @@ var require_uri_all = __commonJS({
3924
4163
  function isSecure(wsComponents) {
3925
4164
  return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
3926
4165
  }
4166
+ __name(isSecure, "isSecure");
3927
4167
  var handler$2 = {
3928
4168
  scheme: "ws",
3929
4169
  domainHost: true,
3930
- parse: function parse2(components, options) {
4170
+ parse: /* @__PURE__ */ __name(function parse2(components, options) {
3931
4171
  var wsComponents = components;
3932
4172
  wsComponents.secure = isSecure(wsComponents);
3933
4173
  wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
3934
4174
  wsComponents.path = void 0;
3935
4175
  wsComponents.query = void 0;
3936
4176
  return wsComponents;
3937
- },
3938
- serialize: function serialize2(wsComponents, options) {
4177
+ }, "parse"),
4178
+ serialize: /* @__PURE__ */ __name(function serialize2(wsComponents, options) {
3939
4179
  if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
3940
4180
  wsComponents.port = void 0;
3941
4181
  }
@@ -3951,7 +4191,7 @@ var require_uri_all = __commonJS({
3951
4191
  }
3952
4192
  wsComponents.fragment = void 0;
3953
4193
  return wsComponents;
3954
- }
4194
+ }, "serialize")
3955
4195
  };
3956
4196
  var handler$3 = {
3957
4197
  scheme: "wss",
@@ -3977,9 +4217,10 @@ var require_uri_all = __commonJS({
3977
4217
  var decStr = pctDecChars(str);
3978
4218
  return !decStr.match(UNRESERVED) ? str : decStr;
3979
4219
  }
4220
+ __name(decodeUnreserved, "decodeUnreserved");
3980
4221
  var handler$4 = {
3981
4222
  scheme: "mailto",
3982
- parse: function parse$$1(components, options) {
4223
+ parse: /* @__PURE__ */ __name(function parse$$1(components, options) {
3983
4224
  var mailtoComponents = components;
3984
4225
  var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
3985
4226
  mailtoComponents.path = void 0;
@@ -4027,8 +4268,8 @@ var require_uri_all = __commonJS({
4027
4268
  to[_x2] = addr.join("@");
4028
4269
  }
4029
4270
  return mailtoComponents;
4030
- },
4031
- serialize: function serialize$$1(mailtoComponents, options) {
4271
+ }, "parse$$1"),
4272
+ serialize: /* @__PURE__ */ __name(function serialize$$1(mailtoComponents, options) {
4032
4273
  var components = mailtoComponents;
4033
4274
  var to = toArray(mailtoComponents.to);
4034
4275
  if (to) {
@@ -4061,12 +4302,12 @@ var require_uri_all = __commonJS({
4061
4302
  components.query = fields.join("&");
4062
4303
  }
4063
4304
  return components;
4064
- }
4305
+ }, "serialize$$1")
4065
4306
  };
4066
4307
  var URN_PARSE = /^([^\:]+)\:(.*)/;
4067
4308
  var handler$5 = {
4068
4309
  scheme: "urn",
4069
- parse: function parse$$1(components, options) {
4310
+ parse: /* @__PURE__ */ __name(function parse$$1(components, options) {
4070
4311
  var matches = components.path && components.path.match(URN_PARSE);
4071
4312
  var urnComponents = components;
4072
4313
  if (matches) {
@@ -4085,8 +4326,8 @@ var require_uri_all = __commonJS({
4085
4326
  urnComponents.error = urnComponents.error || "URN can not be parsed.";
4086
4327
  }
4087
4328
  return urnComponents;
4088
- },
4089
- serialize: function serialize$$1(urnComponents, options) {
4329
+ }, "parse$$1"),
4330
+ serialize: /* @__PURE__ */ __name(function serialize$$1(urnComponents, options) {
4090
4331
  var scheme = options.scheme || urnComponents.scheme || "urn";
4091
4332
  var nid = urnComponents.nid;
4092
4333
  var urnScheme = scheme + ":" + (options.nid || nid);
@@ -4098,12 +4339,12 @@ var require_uri_all = __commonJS({
4098
4339
  var nss = urnComponents.nss;
4099
4340
  uriComponents.path = (nid || options.nid) + ":" + nss;
4100
4341
  return uriComponents;
4101
- }
4342
+ }, "serialize$$1")
4102
4343
  };
4103
4344
  var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
4104
4345
  var handler$6 = {
4105
4346
  scheme: "urn:uuid",
4106
- parse: function parse2(urnComponents, options) {
4347
+ parse: /* @__PURE__ */ __name(function parse2(urnComponents, options) {
4107
4348
  var uuidComponents = urnComponents;
4108
4349
  uuidComponents.uuid = uuidComponents.nss;
4109
4350
  uuidComponents.nss = void 0;
@@ -4111,12 +4352,12 @@ var require_uri_all = __commonJS({
4111
4352
  uuidComponents.error = uuidComponents.error || "UUID is not valid.";
4112
4353
  }
4113
4354
  return uuidComponents;
4114
- },
4115
- serialize: function serialize2(uuidComponents, options) {
4355
+ }, "parse"),
4356
+ serialize: /* @__PURE__ */ __name(function serialize2(uuidComponents, options) {
4116
4357
  var urnComponents = uuidComponents;
4117
4358
  urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
4118
4359
  return urnComponents;
4119
- }
4360
+ }, "serialize")
4120
4361
  };
4121
4362
  SCHEMES[handler.scheme] = handler;
4122
4363
  SCHEMES[handler$1.scheme] = handler$1;
@@ -4192,7 +4433,7 @@ var require_core = __commonJS({
4192
4433
  var util_1 = require_util();
4193
4434
  var $dataRefSchema = require_data();
4194
4435
  var uri_1 = require_uri();
4195
- var defaultRegExp = (str, flags) => new RegExp(str, flags);
4436
+ var defaultRegExp = /* @__PURE__ */ __name((str, flags) => new RegExp(str, flags), "defaultRegExp");
4196
4437
  defaultRegExp.code = "new RegExp";
4197
4438
  var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
4198
4439
  var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([
@@ -4261,6 +4502,7 @@ var require_core = __commonJS({
4261
4502
  uriResolver
4262
4503
  };
4263
4504
  }
4505
+ __name(requiredOptions, "requiredOptions");
4264
4506
  var Ajv = class {
4265
4507
  constructor(opts = {}) {
4266
4508
  this.schemas = {};
@@ -4337,11 +4579,13 @@ var require_core = __commonJS({
4337
4579
  const sch = this._addSchema(_schema, _meta);
4338
4580
  return sch.validate || _compileAsync.call(this, sch);
4339
4581
  }
4582
+ __name(runCompileAsync, "runCompileAsync");
4340
4583
  async function loadMetaSchema($ref) {
4341
4584
  if ($ref && !this.getSchema($ref)) {
4342
4585
  await runCompileAsync.call(this, { $ref }, true);
4343
4586
  }
4344
4587
  }
4588
+ __name(loadMetaSchema, "loadMetaSchema");
4345
4589
  async function _compileAsync(sch) {
4346
4590
  try {
4347
4591
  return this._compileSchemaEnv(sch);
@@ -4353,11 +4597,13 @@ var require_core = __commonJS({
4353
4597
  return _compileAsync.call(this, sch);
4354
4598
  }
4355
4599
  }
4600
+ __name(_compileAsync, "_compileAsync");
4356
4601
  function checkLoaded({ missingSchema: ref, missingRef }) {
4357
4602
  if (this.refs[ref]) {
4358
4603
  throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);
4359
4604
  }
4360
4605
  }
4606
+ __name(checkLoaded, "checkLoaded");
4361
4607
  async function loadMissingSchema(ref) {
4362
4608
  const _schema = await _loadSchema.call(this, ref);
4363
4609
  if (!this.refs[ref])
@@ -4365,6 +4611,7 @@ var require_core = __commonJS({
4365
4611
  if (!this.refs[ref])
4366
4612
  this.addSchema(_schema, ref, meta);
4367
4613
  }
4614
+ __name(loadMissingSchema, "loadMissingSchema");
4368
4615
  async function _loadSchema(ref) {
4369
4616
  const p = this._loading[ref];
4370
4617
  if (p)
@@ -4375,6 +4622,7 @@ var require_core = __commonJS({
4375
4622
  delete this._loading[ref];
4376
4623
  }
4377
4624
  }
4625
+ __name(_loadSchema, "_loadSchema");
4378
4626
  }
4379
4627
  // Adds schema to the instance
4380
4628
  addSchema(schema, key, _meta, _validateSchema = this.opts.validateSchema) {
@@ -4631,6 +4879,7 @@ var require_core = __commonJS({
4631
4879
  }
4632
4880
  }
4633
4881
  };
4882
+ __name(Ajv, "Ajv");
4634
4883
  exports.default = Ajv;
4635
4884
  Ajv.ValidationError = validation_error_1.default;
4636
4885
  Ajv.MissingRefError = ref_error_1.default;
@@ -4641,10 +4890,12 @@ var require_core = __commonJS({
4641
4890
  this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
4642
4891
  }
4643
4892
  }
4893
+ __name(checkOptions, "checkOptions");
4644
4894
  function getSchEnv(keyRef) {
4645
4895
  keyRef = (0, resolve_1.normalizeId)(keyRef);
4646
4896
  return this.schemas[keyRef] || this.refs[keyRef];
4647
4897
  }
4898
+ __name(getSchEnv, "getSchEnv");
4648
4899
  function addInitialSchemas() {
4649
4900
  const optsSchemas = this.opts.schemas;
4650
4901
  if (!optsSchemas)
@@ -4655,6 +4906,7 @@ var require_core = __commonJS({
4655
4906
  for (const key in optsSchemas)
4656
4907
  this.addSchema(optsSchemas[key], key);
4657
4908
  }
4909
+ __name(addInitialSchemas, "addInitialSchemas");
4658
4910
  function addInitialFormats() {
4659
4911
  for (const name in this.opts.formats) {
4660
4912
  const format = this.opts.formats[name];
@@ -4662,6 +4914,7 @@ var require_core = __commonJS({
4662
4914
  this.addFormat(name, format);
4663
4915
  }
4664
4916
  }
4917
+ __name(addInitialFormats, "addInitialFormats");
4665
4918
  function addInitialKeywords(defs) {
4666
4919
  if (Array.isArray(defs)) {
4667
4920
  this.addVocabulary(defs);
@@ -4675,12 +4928,14 @@ var require_core = __commonJS({
4675
4928
  this.addKeyword(def);
4676
4929
  }
4677
4930
  }
4931
+ __name(addInitialKeywords, "addInitialKeywords");
4678
4932
  function getMetaSchemaOptions() {
4679
4933
  const metaOpts = { ...this.opts };
4680
4934
  for (const opt of META_IGNORE_OPTIONS)
4681
4935
  delete metaOpts[opt];
4682
4936
  return metaOpts;
4683
4937
  }
4938
+ __name(getMetaSchemaOptions, "getMetaSchemaOptions");
4684
4939
  var noLogs = { log() {
4685
4940
  }, warn() {
4686
4941
  }, error() {
@@ -4694,6 +4949,7 @@ var require_core = __commonJS({
4694
4949
  return logger;
4695
4950
  throw new Error("logger must implement log, warn and error methods");
4696
4951
  }
4952
+ __name(getLogger, "getLogger");
4697
4953
  var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
4698
4954
  function checkKeyword(keyword, def) {
4699
4955
  const { RULES } = this;
@@ -4709,6 +4965,7 @@ var require_core = __commonJS({
4709
4965
  throw new Error('$data keyword must have "code" or "validate" function');
4710
4966
  }
4711
4967
  }
4968
+ __name(checkKeyword, "checkKeyword");
4712
4969
  function addRule(keyword, definition, dataType) {
4713
4970
  var _a;
4714
4971
  const post = definition === null || definition === void 0 ? void 0 : definition.post;
@@ -4738,6 +4995,7 @@ var require_core = __commonJS({
4738
4995
  RULES.all[keyword] = rule;
4739
4996
  (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
4740
4997
  }
4998
+ __name(addRule, "addRule");
4741
4999
  function addBeforeRule(ruleGroup, rule, before) {
4742
5000
  const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
4743
5001
  if (i >= 0) {
@@ -4747,6 +5005,7 @@ var require_core = __commonJS({
4747
5005
  this.logger.warn(`rule ${before} is not defined`);
4748
5006
  }
4749
5007
  }
5008
+ __name(addBeforeRule, "addBeforeRule");
4750
5009
  function keywordMetaschema(def) {
4751
5010
  let { metaSchema } = def;
4752
5011
  if (metaSchema === void 0)
@@ -4755,12 +5014,14 @@ var require_core = __commonJS({
4755
5014
  metaSchema = schemaOrData(metaSchema);
4756
5015
  def.validateSchema = this.compile(metaSchema, true);
4757
5016
  }
5017
+ __name(keywordMetaschema, "keywordMetaschema");
4758
5018
  var $dataRef = {
4759
5019
  $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
4760
5020
  };
4761
5021
  function schemaOrData(schema) {
4762
5022
  return { anyOf: [schema, $dataRef] };
4763
5023
  }
5024
+ __name(schemaOrData, "schemaOrData");
4764
5025
  }
4765
5026
  });
4766
5027
 
@@ -4812,10 +5073,12 @@ var require_ref = __commonJS({
4812
5073
  const rootName = gen.scopeValue("root", { ref: root });
4813
5074
  return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
4814
5075
  }
5076
+ __name(callRootRef, "callRootRef");
4815
5077
  function callValidate(sch) {
4816
5078
  const v = getValidate(cxt, sch);
4817
5079
  callRef(cxt, v, sch, sch.$async);
4818
5080
  }
5081
+ __name(callValidate, "callValidate");
4819
5082
  function inlineRefSchema(sch) {
4820
5083
  const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
4821
5084
  const valid = gen.name("valid");
@@ -4829,12 +5092,14 @@ var require_ref = __commonJS({
4829
5092
  cxt.mergeEvaluated(schCxt);
4830
5093
  cxt.ok(valid);
4831
5094
  }
5095
+ __name(inlineRefSchema, "inlineRefSchema");
4832
5096
  }
4833
5097
  };
4834
5098
  function getValidate(cxt, sch) {
4835
5099
  const { gen } = cxt;
4836
5100
  return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
4837
5101
  }
5102
+ __name(getValidate, "getValidate");
4838
5103
  exports.getValidate = getValidate;
4839
5104
  function callRef(cxt, v, sch, $async) {
4840
5105
  const { gen, it } = cxt;
@@ -4861,14 +5126,17 @@ var require_ref = __commonJS({
4861
5126
  });
4862
5127
  cxt.ok(valid);
4863
5128
  }
5129
+ __name(callAsyncRef, "callAsyncRef");
4864
5130
  function callSyncRef() {
4865
5131
  cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
4866
5132
  }
5133
+ __name(callSyncRef, "callSyncRef");
4867
5134
  function addErrorsFrom(source) {
4868
5135
  const errs = (0, codegen_1._)`${source}.errors`;
4869
5136
  gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`);
4870
5137
  gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
4871
5138
  }
5139
+ __name(addErrorsFrom, "addErrorsFrom");
4872
5140
  function addEvaluatedFrom(source) {
4873
5141
  var _a;
4874
5142
  if (!it.opts.unevaluated)
@@ -4895,7 +5163,9 @@ var require_ref = __commonJS({
4895
5163
  }
4896
5164
  }
4897
5165
  }
5166
+ __name(addEvaluatedFrom, "addEvaluatedFrom");
4898
5167
  }
5168
+ __name(callRef, "callRef");
4899
5169
  exports.callRef = callRef;
4900
5170
  exports.default = def;
4901
5171
  }
@@ -5003,6 +5273,7 @@ var require_ucs2length = __commonJS({
5003
5273
  }
5004
5274
  return length;
5005
5275
  }
5276
+ __name(ucs2length, "ucs2length");
5006
5277
  exports.default = ucs2length;
5007
5278
  ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
5008
5279
  }
@@ -5145,6 +5416,7 @@ var require_required = __commonJS({
5145
5416
  }
5146
5417
  }
5147
5418
  }
5419
+ __name(allErrorsMode, "allErrorsMode");
5148
5420
  function exitOnErrorMode() {
5149
5421
  const missing = gen.let("missing");
5150
5422
  if (useLoop || $data) {
@@ -5157,12 +5429,14 @@ var require_required = __commonJS({
5157
5429
  gen.else();
5158
5430
  }
5159
5431
  }
5432
+ __name(exitOnErrorMode, "exitOnErrorMode");
5160
5433
  function loopAllRequired() {
5161
5434
  gen.forOf("prop", schemaCode, (prop) => {
5162
5435
  cxt.setParams({ missingProperty: prop });
5163
5436
  gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
5164
5437
  });
5165
5438
  }
5439
+ __name(loopAllRequired, "loopAllRequired");
5166
5440
  function loopUntilMissing(missing, valid) {
5167
5441
  cxt.setParams({ missingProperty: missing });
5168
5442
  gen.forOf(missing, schemaCode, () => {
@@ -5173,6 +5447,7 @@ var require_required = __commonJS({
5173
5447
  });
5174
5448
  }, codegen_1.nil);
5175
5449
  }
5450
+ __name(loopUntilMissing, "loopUntilMissing");
5176
5451
  }
5177
5452
  };
5178
5453
  exports.default = def;
@@ -5253,9 +5528,11 @@ var require_uniqueItems = __commonJS({
5253
5528
  gen.assign(valid, true);
5254
5529
  gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
5255
5530
  }
5531
+ __name(validateUniqueItems, "validateUniqueItems");
5256
5532
  function canOptimize() {
5257
5533
  return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
5258
5534
  }
5535
+ __name(canOptimize, "canOptimize");
5259
5536
  function loopN(i, j) {
5260
5537
  const item = gen.name("item");
5261
5538
  const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
@@ -5272,6 +5549,7 @@ var require_uniqueItems = __commonJS({
5272
5549
  }).code((0, codegen_1._)`${indices}[${item}] = ${i}`);
5273
5550
  });
5274
5551
  }
5552
+ __name(loopN, "loopN");
5275
5553
  function loopN2(i, j) {
5276
5554
  const eql = (0, util_1.useFunc)(gen, equal_1.default);
5277
5555
  const outer = gen.name("outer");
@@ -5280,6 +5558,7 @@ var require_uniqueItems = __commonJS({
5280
5558
  gen.assign(valid, false).break(outer);
5281
5559
  })));
5282
5560
  }
5561
+ __name(loopN2, "loopN2");
5283
5562
  }
5284
5563
  };
5285
5564
  exports.default = def;
@@ -5338,7 +5617,7 @@ var require_enum = __commonJS({
5338
5617
  throw new Error("enum must have non-empty array");
5339
5618
  const useLoop = schema.length >= it.opts.loopEnum;
5340
5619
  let eql;
5341
- const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);
5620
+ const getEql = /* @__PURE__ */ __name(() => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default), "getEql");
5342
5621
  let valid;
5343
5622
  if (useLoop || $data) {
5344
5623
  valid = gen.let("valid");
@@ -5354,10 +5633,12 @@ var require_enum = __commonJS({
5354
5633
  gen.assign(valid, false);
5355
5634
  gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
5356
5635
  }
5636
+ __name(loopEnum, "loopEnum");
5357
5637
  function equalCode(vSchema, i) {
5358
5638
  const sch = schema[i];
5359
5639
  return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;
5360
5640
  }
5641
+ __name(equalCode, "equalCode");
5361
5642
  }
5362
5643
  };
5363
5644
  exports.default = def;
@@ -5449,7 +5730,9 @@ var require_additionalItems = __commonJS({
5449
5730
  gen.if((0, codegen_1.not)(valid), () => gen.break());
5450
5731
  });
5451
5732
  }
5733
+ __name(validateItems, "validateItems");
5452
5734
  }
5735
+ __name(validateAdditionalItems, "validateAdditionalItems");
5453
5736
  exports.validateAdditionalItems = validateAdditionalItems;
5454
5737
  exports.default = def;
5455
5738
  }
@@ -5506,7 +5789,9 @@ var require_items = __commonJS({
5506
5789
  (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
5507
5790
  }
5508
5791
  }
5792
+ __name(checkStrictTuple, "checkStrictTuple");
5509
5793
  }
5794
+ __name(validateTuple, "validateTuple");
5510
5795
  exports.validateTuple = validateTuple;
5511
5796
  exports.default = def;
5512
5797
  }
@@ -5629,6 +5914,7 @@ var require_contains = __commonJS({
5629
5914
  const count = gen.let("count", 0);
5630
5915
  validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
5631
5916
  }
5917
+ __name(validateItemsWithCount, "validateItemsWithCount");
5632
5918
  function validateItems(_valid, block) {
5633
5919
  gen.forRange("i", 0, len, (i) => {
5634
5920
  cxt.subschema({
@@ -5640,6 +5926,7 @@ var require_contains = __commonJS({
5640
5926
  block();
5641
5927
  });
5642
5928
  }
5929
+ __name(validateItems, "validateItems");
5643
5930
  function checkLimits(count) {
5644
5931
  gen.code((0, codegen_1._)`${count}++`);
5645
5932
  if (max === void 0) {
@@ -5652,6 +5939,7 @@ var require_contains = __commonJS({
5652
5939
  gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
5653
5940
  }
5654
5941
  }
5942
+ __name(checkLimits, "checkLimits");
5655
5943
  }
5656
5944
  };
5657
5945
  exports.default = def;
@@ -5700,6 +5988,7 @@ var require_dependencies = __commonJS({
5700
5988
  }
5701
5989
  return [propertyDeps, schemaDeps];
5702
5990
  }
5991
+ __name(splitDependencies, "splitDependencies");
5703
5992
  function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
5704
5993
  const { gen, data, it } = cxt;
5705
5994
  if (Object.keys(propertyDeps).length === 0)
@@ -5728,6 +6017,7 @@ var require_dependencies = __commonJS({
5728
6017
  }
5729
6018
  }
5730
6019
  }
6020
+ __name(validatePropertyDeps, "validatePropertyDeps");
5731
6021
  exports.validatePropertyDeps = validatePropertyDeps;
5732
6022
  function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
5733
6023
  const { gen, data, keyword, it } = cxt;
@@ -5747,6 +6037,7 @@ var require_dependencies = __commonJS({
5747
6037
  cxt.ok(valid);
5748
6038
  }
5749
6039
  }
6040
+ __name(validateSchemaDeps, "validateSchemaDeps");
5750
6041
  exports.validateSchemaDeps = validateSchemaDeps;
5751
6042
  exports.default = def;
5752
6043
  }
@@ -5835,6 +6126,7 @@ var require_additionalProperties = __commonJS({
5835
6126
  gen.if(isAdditional(key), () => additionalPropertyCode(key));
5836
6127
  });
5837
6128
  }
6129
+ __name(checkAdditionalProperties, "checkAdditionalProperties");
5838
6130
  function isAdditional(key) {
5839
6131
  let definedProp;
5840
6132
  if (props.length > 8) {
@@ -5850,9 +6142,11 @@ var require_additionalProperties = __commonJS({
5850
6142
  }
5851
6143
  return (0, codegen_1.not)(definedProp);
5852
6144
  }
6145
+ __name(isAdditional, "isAdditional");
5853
6146
  function deleteAdditional(key) {
5854
6147
  gen.code((0, codegen_1._)`delete ${data}[${key}]`);
5855
6148
  }
6149
+ __name(deleteAdditional, "deleteAdditional");
5856
6150
  function additionalPropertyCode(key) {
5857
6151
  if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) {
5858
6152
  deleteAdditional(key);
@@ -5880,6 +6174,7 @@ var require_additionalProperties = __commonJS({
5880
6174
  }
5881
6175
  }
5882
6176
  }
6177
+ __name(additionalPropertyCode, "additionalPropertyCode");
5883
6178
  function applyAdditionalSchema(key, valid, errors) {
5884
6179
  const subschema = {
5885
6180
  keyword: "additionalProperties",
@@ -5895,6 +6190,7 @@ var require_additionalProperties = __commonJS({
5895
6190
  }
5896
6191
  cxt.subschema(subschema, valid);
5897
6192
  }
6193
+ __name(applyAdditionalSchema, "applyAdditionalSchema");
5898
6194
  }
5899
6195
  };
5900
6196
  exports.default = def;
@@ -5946,6 +6242,7 @@ var require_properties = __commonJS({
5946
6242
  function hasDefault(prop) {
5947
6243
  return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0;
5948
6244
  }
6245
+ __name(hasDefault, "hasDefault");
5949
6246
  function applyPropertySchema(prop) {
5950
6247
  cxt.subschema({
5951
6248
  keyword: "properties",
@@ -5953,6 +6250,7 @@ var require_properties = __commonJS({
5953
6250
  dataProp: prop
5954
6251
  }, valid);
5955
6252
  }
6253
+ __name(applyPropertySchema, "applyPropertySchema");
5956
6254
  }
5957
6255
  };
5958
6256
  exports.default = def;
@@ -6000,6 +6298,7 @@ var require_patternProperties = __commonJS({
6000
6298
  }
6001
6299
  }
6002
6300
  }
6301
+ __name(validatePatternProperties, "validatePatternProperties");
6003
6302
  function checkMatchingProperties(pat) {
6004
6303
  for (const prop in checkProperties) {
6005
6304
  if (new RegExp(pat).test(prop)) {
@@ -6007,6 +6306,7 @@ var require_patternProperties = __commonJS({
6007
6306
  }
6008
6307
  }
6009
6308
  }
6309
+ __name(checkMatchingProperties, "checkMatchingProperties");
6010
6310
  function validateProperties(pat) {
6011
6311
  gen.forIn("key", data, (key) => {
6012
6312
  gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
@@ -6027,6 +6327,7 @@ var require_patternProperties = __commonJS({
6027
6327
  });
6028
6328
  });
6029
6329
  }
6330
+ __name(validateProperties, "validateProperties");
6030
6331
  }
6031
6332
  };
6032
6333
  exports.default = def;
@@ -6133,6 +6434,7 @@ var require_oneOf = __commonJS({
6133
6434
  });
6134
6435
  });
6135
6436
  }
6437
+ __name(validateOneOf, "validateOneOf");
6136
6438
  }
6137
6439
  };
6138
6440
  exports.default = def;
@@ -6214,6 +6516,7 @@ var require_if = __commonJS({
6214
6516
  }, schValid);
6215
6517
  cxt.mergeEvaluated(schCxt);
6216
6518
  }
6519
+ __name(validateIf, "validateIf");
6217
6520
  function validateClause(keyword, ifClause) {
6218
6521
  return () => {
6219
6522
  const schCxt = cxt.subschema({ keyword }, schValid);
@@ -6225,12 +6528,14 @@ var require_if = __commonJS({
6225
6528
  cxt.setParams({ ifClause: keyword });
6226
6529
  };
6227
6530
  }
6531
+ __name(validateClause, "validateClause");
6228
6532
  }
6229
6533
  };
6230
6534
  function hasSchema(it, keyword) {
6231
6535
  const schema = it.schema[keyword];
6232
6536
  return schema !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema);
6233
6537
  }
6538
+ __name(hasSchema, "hasSchema");
6234
6539
  exports.default = def;
6235
6540
  }
6236
6541
  });
@@ -6297,6 +6602,7 @@ var require_applicator = __commonJS({
6297
6602
  applicator.push(contains_1.default);
6298
6603
  return applicator;
6299
6604
  }
6605
+ __name(getApplicator, "getApplicator");
6300
6606
  exports.default = getApplicator;
6301
6607
  }
6302
6608
  });
@@ -6341,12 +6647,15 @@ var require_format = __commonJS({
6341
6647
  return codegen_1.nil;
6342
6648
  return (0, codegen_1._)`${schemaCode} && !${format}`;
6343
6649
  }
6650
+ __name(unknownFmt, "unknownFmt");
6344
6651
  function invalidFmt() {
6345
6652
  const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
6346
6653
  const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
6347
6654
  return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
6348
6655
  }
6656
+ __name(invalidFmt, "invalidFmt");
6349
6657
  }
6658
+ __name(validate$DataFormat, "validate$DataFormat");
6350
6659
  function validateFormat() {
6351
6660
  const formatDef = self.formats[schema];
6352
6661
  if (!formatDef) {
@@ -6367,7 +6676,9 @@ var require_format = __commonJS({
6367
6676
  function unknownMsg() {
6368
6677
  return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
6369
6678
  }
6679
+ __name(unknownMsg, "unknownMsg");
6370
6680
  }
6681
+ __name(unknownFormat, "unknownFormat");
6371
6682
  function getFormat(fmtDef) {
6372
6683
  const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
6373
6684
  const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
@@ -6376,6 +6687,7 @@ var require_format = __commonJS({
6376
6687
  }
6377
6688
  return ["string", fmtDef, fmt];
6378
6689
  }
6690
+ __name(getFormat, "getFormat");
6379
6691
  function validCondition() {
6380
6692
  if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
6381
6693
  if (!schemaEnv.$async)
@@ -6384,7 +6696,9 @@ var require_format = __commonJS({
6384
6696
  }
6385
6697
  return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
6386
6698
  }
6699
+ __name(validCondition, "validCondition");
6387
6700
  }
6701
+ __name(validateFormat, "validateFormat");
6388
6702
  }
6389
6703
  };
6390
6704
  exports.default = def;
@@ -6507,12 +6821,14 @@ var require_discriminator = __commonJS({
6507
6821
  cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
6508
6822
  gen.endIf();
6509
6823
  }
6824
+ __name(validateMapping, "validateMapping");
6510
6825
  function applyTagSchema(schemaProp) {
6511
6826
  const _valid = gen.name("valid");
6512
6827
  const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
6513
6828
  cxt.mergeEvaluated(schCxt, codegen_1.Name);
6514
6829
  return _valid;
6515
6830
  }
6831
+ __name(applyTagSchema, "applyTagSchema");
6516
6832
  function getMapping() {
6517
6833
  var _a;
6518
6834
  const oneOfMapping = {};
@@ -6538,6 +6854,7 @@ var require_discriminator = __commonJS({
6538
6854
  function hasRequired({ required }) {
6539
6855
  return Array.isArray(required) && required.includes(tagName);
6540
6856
  }
6857
+ __name(hasRequired, "hasRequired");
6541
6858
  function addMappings(sch, i) {
6542
6859
  if (sch.const) {
6543
6860
  addMapping(sch.const, i);
@@ -6549,13 +6866,16 @@ var require_discriminator = __commonJS({
6549
6866
  throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
6550
6867
  }
6551
6868
  }
6869
+ __name(addMappings, "addMappings");
6552
6870
  function addMapping(tagValue, i) {
6553
6871
  if (typeof tagValue != "string" || tagValue in oneOfMapping) {
6554
6872
  throw new Error(`discriminator: "${tagName}" values must be unique strings`);
6555
6873
  }
6556
6874
  oneOfMapping[tagValue] = i;
6557
6875
  }
6876
+ __name(addMapping, "addMapping");
6558
6877
  }
6878
+ __name(getMapping, "getMapping");
6559
6879
  }
6560
6880
  };
6561
6881
  exports.default = def;
@@ -6750,6 +7070,7 @@ var require_ajv = __commonJS({
6750
7070
  return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
6751
7071
  }
6752
7072
  };
7073
+ __name(Ajv, "Ajv");
6753
7074
  module.exports = exports = Ajv;
6754
7075
  Object.defineProperty(exports, "__esModule", { value: true });
6755
7076
  exports.default = Ajv;
@@ -6796,6 +7117,7 @@ var require_formats = __commonJS({
6796
7117
  function fmtDef(validate, compare) {
6797
7118
  return { validate, compare };
6798
7119
  }
7120
+ __name(fmtDef, "fmtDef");
6799
7121
  exports.fullFormats = {
6800
7122
  // date: http://tools.ietf.org/html/rfc3339#section-5.6
6801
7123
  date: fmtDef(date, compareDate),
@@ -6858,6 +7180,7 @@ var require_formats = __commonJS({
6858
7180
  function isLeapYear(year) {
6859
7181
  return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
6860
7182
  }
7183
+ __name(isLeapYear, "isLeapYear");
6861
7184
  var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
6862
7185
  var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
6863
7186
  function date(str) {
@@ -6869,6 +7192,7 @@ var require_formats = __commonJS({
6869
7192
  const day = +matches[3];
6870
7193
  return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);
6871
7194
  }
7195
+ __name(date, "date");
6872
7196
  function compareDate(d1, d2) {
6873
7197
  if (!(d1 && d2))
6874
7198
  return void 0;
@@ -6878,6 +7202,7 @@ var require_formats = __commonJS({
6878
7202
  return -1;
6879
7203
  return 0;
6880
7204
  }
7205
+ __name(compareDate, "compareDate");
6881
7206
  var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
6882
7207
  function time(str, withTimeZone) {
6883
7208
  const matches = TIME.exec(str);
@@ -6889,6 +7214,7 @@ var require_formats = __commonJS({
6889
7214
  const timeZone = matches[5];
6890
7215
  return (hour <= 23 && minute <= 59 && second <= 59 || hour === 23 && minute === 59 && second === 60) && (!withTimeZone || timeZone !== "");
6891
7216
  }
7217
+ __name(time, "time");
6892
7218
  function compareTime(t1, t2) {
6893
7219
  if (!(t1 && t2))
6894
7220
  return void 0;
@@ -6904,11 +7230,13 @@ var require_formats = __commonJS({
6904
7230
  return -1;
6905
7231
  return 0;
6906
7232
  }
7233
+ __name(compareTime, "compareTime");
6907
7234
  var DATE_TIME_SEPARATOR = /t|\s/i;
6908
7235
  function date_time(str) {
6909
7236
  const dateTime = str.split(DATE_TIME_SEPARATOR);
6910
7237
  return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1], true);
6911
7238
  }
7239
+ __name(date_time, "date_time");
6912
7240
  function compareDateTime(dt1, dt2) {
6913
7241
  if (!(dt1 && dt2))
6914
7242
  return void 0;
@@ -6919,27 +7247,33 @@ var require_formats = __commonJS({
6919
7247
  return void 0;
6920
7248
  return res || compareTime(t1, t2);
6921
7249
  }
7250
+ __name(compareDateTime, "compareDateTime");
6922
7251
  var NOT_URI_FRAGMENT = /\/|:/;
6923
7252
  var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
6924
7253
  function uri(str) {
6925
7254
  return NOT_URI_FRAGMENT.test(str) && URI.test(str);
6926
7255
  }
7256
+ __name(uri, "uri");
6927
7257
  var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
6928
7258
  function byte(str) {
6929
7259
  BYTE.lastIndex = 0;
6930
7260
  return BYTE.test(str);
6931
7261
  }
7262
+ __name(byte, "byte");
6932
7263
  var MIN_INT32 = -(2 ** 31);
6933
7264
  var MAX_INT32 = 2 ** 31 - 1;
6934
7265
  function validateInt32(value) {
6935
7266
  return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
6936
7267
  }
7268
+ __name(validateInt32, "validateInt32");
6937
7269
  function validateInt64(value) {
6938
7270
  return Number.isInteger(value);
6939
7271
  }
7272
+ __name(validateInt64, "validateInt64");
6940
7273
  function validateNumber() {
6941
7274
  return true;
6942
7275
  }
7276
+ __name(validateNumber, "validateNumber");
6943
7277
  var Z_ANCHOR = /[^\\]\\Z/;
6944
7278
  function regex(str) {
6945
7279
  if (Z_ANCHOR.test(str))
@@ -6951,6 +7285,7 @@ var require_formats = __commonJS({
6951
7285
  return false;
6952
7286
  }
6953
7287
  }
7288
+ __name(regex, "regex");
6954
7289
  }
6955
7290
  });
6956
7291
 
@@ -6997,6 +7332,7 @@ var require_limit = __commonJS({
6997
7332
  const fmt = gen.const("fmt", codegen_1._`${fmts}[${fCxt.schemaCode}]`);
6998
7333
  cxt.fail$data(codegen_1.or(codegen_1._`typeof ${fmt} != "object"`, codegen_1._`${fmt} instanceof RegExp`, codegen_1._`typeof ${fmt}.compare != "function"`, compareCode(fmt)));
6999
7334
  }
7335
+ __name(validate$DataFormat, "validate$DataFormat");
7000
7336
  function validateFormat() {
7001
7337
  const format = fCxt.schema;
7002
7338
  const fmtDef = self.formats[format];
@@ -7012,16 +7348,18 @@ var require_limit = __commonJS({
7012
7348
  });
7013
7349
  cxt.fail$data(compareCode(fmt));
7014
7350
  }
7351
+ __name(validateFormat, "validateFormat");
7015
7352
  function compareCode(fmt) {
7016
7353
  return codegen_1._`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;
7017
7354
  }
7355
+ __name(compareCode, "compareCode");
7018
7356
  },
7019
7357
  dependencies: ["format"]
7020
7358
  };
7021
- var formatLimitPlugin = (ajv) => {
7359
+ var formatLimitPlugin = /* @__PURE__ */ __name((ajv) => {
7022
7360
  ajv.addKeyword(exports.formatLimitDefinition);
7023
7361
  return ajv;
7024
- };
7362
+ }, "formatLimitPlugin");
7025
7363
  exports.default = formatLimitPlugin;
7026
7364
  }
7027
7365
  });
@@ -7036,7 +7374,7 @@ var require_dist = __commonJS({
7036
7374
  var codegen_1 = require_codegen();
7037
7375
  var fullName = new codegen_1.Name("fullFormats");
7038
7376
  var fastName = new codegen_1.Name("fastFormats");
7039
- var formatsPlugin = (ajv, opts = { keywords: true }) => {
7377
+ var formatsPlugin = /* @__PURE__ */ __name((ajv, opts = { keywords: true }) => {
7040
7378
  if (Array.isArray(opts)) {
7041
7379
  addFormats(ajv, opts, formats_1.fullFormats, fullName);
7042
7380
  return ajv;
@@ -7047,7 +7385,7 @@ var require_dist = __commonJS({
7047
7385
  if (opts.keywords)
7048
7386
  limit_1.default(ajv);
7049
7387
  return ajv;
7050
- };
7388
+ }, "formatsPlugin");
7051
7389
  formatsPlugin.get = (name, mode = "full") => {
7052
7390
  const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
7053
7391
  const f = formats[name];
@@ -7062,6 +7400,7 @@ var require_dist = __commonJS({
7062
7400
  for (const f of list)
7063
7401
  ajv.addFormat(f, fs[f]);
7064
7402
  }
7403
+ __name(addFormats, "addFormats");
7065
7404
  module.exports = exports = formatsPlugin;
7066
7405
  Object.defineProperty(exports, "__esModule", { value: true });
7067
7406
  exports.default = formatsPlugin;
@@ -7073,10 +7412,13 @@ var require_common = __commonJS({
7073
7412
  "src/schemas/definitions/common.json"(exports, module) {
7074
7413
  module.exports = {
7075
7414
  $schema: "http://json-schema.org/draft-07/schema",
7076
- $id: "https://api.kohost.app/schemas/v3/definitions/common.json",
7415
+ $id: "https://api.kohost.io/schemas/v3/definitions/common.json",
7077
7416
  definitions: {
7078
7417
  id: {
7079
- type: "string"
7418
+ type: "string",
7419
+ not: {
7420
+ enum: ["global", "system"]
7421
+ }
7080
7422
  },
7081
7423
  systemData: {
7082
7424
  type: "object",
@@ -7086,6 +7428,10 @@ var require_common = __commonJS({
7086
7428
  type: "object",
7087
7429
  default: {}
7088
7430
  },
7431
+ date: {
7432
+ type: ["string", "object"],
7433
+ format: "date-time"
7434
+ },
7089
7435
  createdAt: {
7090
7436
  type: ["string", "object"],
7091
7437
  format: "date-time"
@@ -7142,6 +7488,30 @@ var require_common = __commonJS({
7142
7488
  maxLength: 2
7143
7489
  }
7144
7490
  }
7491
+ },
7492
+ driver: {
7493
+ type: "string",
7494
+ enum: [
7495
+ "aws-kinesis",
7496
+ "butler",
7497
+ "crestron",
7498
+ "ecobee",
7499
+ "igor",
7500
+ "inncom",
7501
+ "kohost-k7",
7502
+ "kohost-pms",
7503
+ "lg",
7504
+ "lirc",
7505
+ "mews",
7506
+ "pelican-wireless",
7507
+ "rebrandly",
7508
+ "salto",
7509
+ "salto-irn",
7510
+ "se",
7511
+ "sendgrid",
7512
+ "stay-n-touch",
7513
+ "twilio"
7514
+ ]
7145
7515
  }
7146
7516
  }
7147
7517
  };
@@ -7153,17 +7523,18 @@ var require_device = __commonJS({
7153
7523
  "src/schemas/definitions/device.json"(exports, module) {
7154
7524
  module.exports = {
7155
7525
  $schema: "http://json-schema.org/draft-07/schema",
7156
- $id: "https://api.kohost.app/schemas/v3/definitions/device.json",
7526
+ $id: "https://api.kohost.io/schemas/v3/definitions/device.json",
7157
7527
  definitions: {
7158
7528
  id: {
7159
- $ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
7529
+ $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
7160
7530
  },
7161
7531
  systemData: {
7162
- $ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/systemData"
7532
+ $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/systemData"
7163
7533
  },
7164
7534
  type: {
7165
7535
  type: "string",
7166
7536
  enum: [
7537
+ "alarm",
7167
7538
  "dimmer",
7168
7539
  "switch",
7169
7540
  "motionSensor",
@@ -7173,8 +7544,13 @@ var require_device = __commonJS({
7173
7544
  "thermostat",
7174
7545
  "lock",
7175
7546
  "courtesy",
7176
- "sceneController",
7177
- "gateway"
7547
+ "gateway",
7548
+ "tv",
7549
+ "dvr",
7550
+ "appleTv",
7551
+ "discPlayer",
7552
+ "mediaPlayer",
7553
+ "uncontrolledDevice"
7178
7554
  ]
7179
7555
  },
7180
7556
  name: {
@@ -7203,7 +7579,11 @@ var require_device = __commonJS({
7203
7579
  "softwareFailure",
7204
7580
  "hardwareFailureWithCode",
7205
7581
  "softwareFailureWithCode",
7206
- "motionDetection"
7582
+ "motionDetection",
7583
+ "airFilterNeedsCleaned",
7584
+ "smokeDetected",
7585
+ "outsideSafeTemperatureRange",
7586
+ "outsideSafeHumidityRange"
7207
7587
  ]
7208
7588
  }
7209
7589
  },
@@ -7217,6 +7597,9 @@ var require_device = __commonJS({
7217
7597
  timestamp: {
7218
7598
  type: "number",
7219
7599
  minimum: 1655907956593
7600
+ },
7601
+ description: {
7602
+ type: "string"
7220
7603
  }
7221
7604
  }
7222
7605
  },
@@ -7224,6 +7607,10 @@ var require_device = __commonJS({
7224
7607
  type: "number",
7225
7608
  minimum: 0,
7226
7609
  maximum: 100
7610
+ },
7611
+ watts: {
7612
+ type: "number",
7613
+ minimum: 0
7227
7614
  }
7228
7615
  }
7229
7616
  };
@@ -7249,26 +7636,216 @@ var require_schema = __commonJS({
7249
7636
  ajv.addSchema(commonDefs);
7250
7637
  ajv.addSchema(deviceDefs);
7251
7638
  module.exports = {
7252
- add: function add(schema) {
7639
+ add: /* @__PURE__ */ __name(function add(schema) {
7253
7640
  ajv.addSchema(schema);
7254
- },
7255
- compile: function compile(schema) {
7641
+ }, "add"),
7642
+ compile: /* @__PURE__ */ __name(function compile(schema) {
7256
7643
  return ajv.compile(schema);
7257
- }
7644
+ }, "compile")
7258
7645
  };
7259
7646
  }
7260
7647
  });
7261
7648
 
7649
+ // src/Errors/AppError.js
7650
+ var require_AppError = __commonJS({
7651
+ "src/Errors/AppError.js"(exports, module) {
7652
+ module.exports = /* @__PURE__ */ __name(class AppError extends Error {
7653
+ constructor(message = "Internal Server Error", options) {
7654
+ super(message, options);
7655
+ this.type = this.constructor.name;
7656
+ this.statusCode = 500;
7657
+ Object.setPrototypeOf(this, AppError.prototype);
7658
+ }
7659
+ }, "AppError");
7660
+ }
7661
+ });
7662
+
7663
+ // src/Errors/AuthenticationError.js
7664
+ var require_AuthenticationError = __commonJS({
7665
+ "src/Errors/AuthenticationError.js"(exports, module) {
7666
+ var AppError = require_AppError();
7667
+ module.exports = /* @__PURE__ */ __name(class AuthenticationError extends AppError {
7668
+ constructor(message = "Authentication Error", options = {}) {
7669
+ super(message, options);
7670
+ this.statusCode = 401;
7671
+ Object.setPrototypeOf(this, AuthenticationError.prototype);
7672
+ }
7673
+ }, "AuthenticationError");
7674
+ }
7675
+ });
7676
+
7677
+ // src/Errors/AuthorizationError.js
7678
+ var require_AuthorizationError = __commonJS({
7679
+ "src/Errors/AuthorizationError.js"(exports, module) {
7680
+ var AppError = require_AppError();
7681
+ module.exports = /* @__PURE__ */ __name(class AuthorizationError extends AppError {
7682
+ constructor(message = "Authorization Error", options = {}) {
7683
+ super(message, options);
7684
+ this.statusCode = 403;
7685
+ Object.setPrototypeOf(this, AuthorizationError.prototype);
7686
+ }
7687
+ }, "AuthorizationError");
7688
+ }
7689
+ });
7690
+
7691
+ // src/Errors/DeviceCommError.js
7692
+ var require_DeviceCommError = __commonJS({
7693
+ "src/Errors/DeviceCommError.js"(exports, module) {
7694
+ var AppError = require_AppError();
7695
+ module.exports = /* @__PURE__ */ __name(class DeviceCommError extends AppError {
7696
+ constructor(message = "Device Communication Error", options = {}) {
7697
+ super(message, options);
7698
+ this.statusCode = 503;
7699
+ Object.setPrototypeOf(this, DeviceCommError.prototype);
7700
+ }
7701
+ }, "DeviceCommError");
7702
+ }
7703
+ });
7704
+
7705
+ // src/Errors/LoginError.js
7706
+ var require_LoginError = __commonJS({
7707
+ "src/Errors/LoginError.js"(exports, module) {
7708
+ var AppError = require_AppError();
7709
+ module.exports = /* @__PURE__ */ __name(class LoginError extends AppError {
7710
+ constructor(message = "Invalid Login information provided", options = {}) {
7711
+ super(message, options);
7712
+ this.statusCode = 401;
7713
+ Object.setPrototypeOf(this, LoginError.prototype);
7714
+ }
7715
+ }, "LoginError");
7716
+ }
7717
+ });
7718
+
7719
+ // src/Errors/NotFoundError.js
7720
+ var require_NotFoundError = __commonJS({
7721
+ "src/Errors/NotFoundError.js"(exports, module) {
7722
+ var AppError = require_AppError();
7723
+ module.exports = /* @__PURE__ */ __name(class NotFoundError extends AppError {
7724
+ constructor(message = "Resource Not Found", options = {}) {
7725
+ super(message, options);
7726
+ this.statusCode = 404;
7727
+ Object.setPrototypeOf(this, NotFoundError.prototype);
7728
+ }
7729
+ }, "NotFoundError");
7730
+ }
7731
+ });
7732
+
7733
+ // src/Errors/RequestError.js
7734
+ var require_RequestError = __commonJS({
7735
+ "src/Errors/RequestError.js"(exports, module) {
7736
+ var AppError = require_AppError();
7737
+ module.exports = /* @__PURE__ */ __name(class RequestError extends AppError {
7738
+ constructor(message = "Bad Request", options = {}) {
7739
+ super(message, options);
7740
+ this.statusCode = 400;
7741
+ Object.setPrototypeOf(this, RequestError.prototype);
7742
+ }
7743
+ }, "RequestError");
7744
+ }
7745
+ });
7746
+
7747
+ // src/Errors/SystemCommError.js
7748
+ var require_SystemCommError = __commonJS({
7749
+ "src/Errors/SystemCommError.js"(exports, module) {
7750
+ var AppError = require_AppError();
7751
+ module.exports = /* @__PURE__ */ __name(class SystemCommError extends AppError {
7752
+ constructor(message = "System Communication Error", options = {}) {
7753
+ super(message, options);
7754
+ this.statusCode = 503;
7755
+ Object.setPrototypeOf(this, SystemCommError.prototype);
7756
+ }
7757
+ }, "SystemCommError");
7758
+ }
7759
+ });
7760
+
7761
+ // src/Errors/TokenExpiredError.js
7762
+ var require_TokenExpiredError = __commonJS({
7763
+ "src/Errors/TokenExpiredError.js"(exports, module) {
7764
+ var AppError = require_AppError();
7765
+ module.exports = /* @__PURE__ */ __name(class TokenExpiredError extends AppError {
7766
+ constructor(message = "Token Expired", options = {}) {
7767
+ super(message, options);
7768
+ this.statusCode = 401;
7769
+ Object.setPrototypeOf(this, TokenExpiredError.prototype);
7770
+ }
7771
+ }, "TokenExpiredError");
7772
+ }
7773
+ });
7774
+
7775
+ // src/Errors/UnprocessableRequestError.js
7776
+ var require_UnprocessableRequestError = __commonJS({
7777
+ "src/Errors/UnprocessableRequestError.js"(exports, module) {
7778
+ var AppError = require_AppError();
7779
+ module.exports = /* @__PURE__ */ __name(class UnprocessableRequestError extends AppError {
7780
+ constructor(message = "Unprocessable Request Error", options = {}) {
7781
+ super(message, options);
7782
+ this.statusCode = 422;
7783
+ Object.setPrototypeOf(this, UnprocessableRequestError.prototype);
7784
+ }
7785
+ }, "UnprocessableRequestError");
7786
+ }
7787
+ });
7788
+
7789
+ // src/Errors/ValidationError.js
7790
+ var require_ValidationError = __commonJS({
7791
+ "src/Errors/ValidationError.js"(exports, module) {
7792
+ var AppError = require_AppError();
7793
+ module.exports = /* @__PURE__ */ __name(class ValidationError extends AppError {
7794
+ constructor(message = "Validation Error", options = {}) {
7795
+ super(message, options);
7796
+ this.statusCode = 400;
7797
+ Object.setPrototypeOf(this, ValidationError.prototype);
7798
+ }
7799
+ }, "ValidationError");
7800
+ }
7801
+ });
7802
+
7803
+ // src/Errors/index.js
7804
+ var require_Errors = __commonJS({
7805
+ "src/Errors/index.js"(exports, module) {
7806
+ var Errors = {
7807
+ AppError: require_AppError(),
7808
+ AuthenticationError: require_AuthenticationError(),
7809
+ AuthorizationError: require_AuthorizationError(),
7810
+ DeviceCommError: require_DeviceCommError(),
7811
+ LoginError: require_LoginError(),
7812
+ NotFoundError: require_NotFoundError(),
7813
+ RequestError: require_RequestError(),
7814
+ SystemCommError: require_SystemCommError(),
7815
+ TokenExpiredError: require_TokenExpiredError(),
7816
+ UnprocessableRequestError: require_UnprocessableRequestError(),
7817
+ ValidationError: require_ValidationError()
7818
+ };
7819
+ module.exports = Errors;
7820
+ }
7821
+ });
7822
+
7823
+ // src/utils/errorFactory.js
7824
+ var require_errorFactory = __commonJS({
7825
+ "src/utils/errorFactory.js"(exports, module) {
7826
+ var Errors = require_Errors();
7827
+ module.exports = /* @__PURE__ */ __name(function errorFactory(errName) {
7828
+ const AllErrors = Object.values(Errors);
7829
+ const TheError = AllErrors.find((E) => E.prototype.name === errName);
7830
+ if (!TheError)
7831
+ return new Error("Invalid error name: " + errName);
7832
+ return TheError;
7833
+ }, "errorFactory");
7834
+ }
7835
+ });
7836
+
7262
7837
  // src/utils/index.js
7263
7838
  var require_utils = __commonJS({
7264
7839
  "src/utils/index.js"(exports, module) {
7265
7840
  var getFormalDeviceType = require_getFormalDeviceType();
7266
7841
  var getDeviceTypes = require_getDeviceTypes();
7267
7842
  var schema = require_schema();
7843
+ var errorFactory = require_errorFactory();
7268
7844
  module.exports = {
7269
7845
  getFormalDeviceType,
7270
7846
  getDeviceTypes,
7271
- schema
7847
+ schema,
7848
+ errorFactory
7272
7849
  };
7273
7850
  }
7274
7851
  });