@kohost/api-client 3.0.0-beta.5 → 3.0.0-beta.50

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 (210) hide show
  1. package/README.md +71 -0
  2. package/dist/cjs/AMQPClient/index.js +290 -0
  3. package/dist/cjs/{Client.js → Client/index.js} +1938 -986
  4. package/dist/cjs/Commands/CheckInReservationCommand.js +19 -0
  5. package/dist/cjs/Commands/Command.js +34 -0
  6. package/dist/cjs/Commands/CreateImageUploadEndpointCommand.js +17 -0
  7. package/dist/cjs/Commands/CreateShortLinkCommand.js +20 -0
  8. package/dist/cjs/Commands/DiscoverReservationRoomTypeUpsellOptionsCommand.js +20 -0
  9. package/dist/cjs/Commands/DiscoverReservationsCommand.js +20 -0
  10. package/dist/cjs/Commands/DiscoverRoomTypesCommand.js +19 -0
  11. package/dist/cjs/Commands/DiscoverRoomsCommand.js +35 -0
  12. package/dist/cjs/Commands/DiscoverUsersCommand.js +19 -0
  13. package/dist/cjs/Commands/GetMobileKeyCommand.js +24 -0
  14. package/dist/cjs/Commands/GetProductsCommand.js +17 -0
  15. package/dist/cjs/Commands/OCRDocumentCommand.js +15 -0
  16. package/dist/cjs/Commands/SellProductsCommand.js +17 -0
  17. package/dist/cjs/Commands/SendEmailCommand.js +24 -0
  18. package/dist/cjs/Commands/SendSMSCommand.js +21 -0
  19. package/dist/cjs/Commands/SetAlarmCommand.js +17 -0
  20. package/dist/cjs/Commands/SetCourtesyCommand.js +17 -0
  21. package/dist/cjs/Commands/SetDimmerCommand.js +17 -0
  22. package/dist/cjs/Commands/SetLockCommand.js +17 -0
  23. package/dist/cjs/Commands/SetMediaCommand.js +17 -0
  24. package/dist/cjs/Commands/SetSceneCommand.js +17 -0
  25. package/dist/cjs/Commands/SetSwitchCommand.js +17 -0
  26. package/dist/cjs/Commands/SetThermostatCommand.js +17 -0
  27. package/dist/cjs/Commands/SetWindowCoveringCommand.js +17 -0
  28. package/dist/cjs/Commands/UpdateReservationCommand.js +19 -0
  29. package/dist/cjs/Commands/UpdateUserCommand.js +41 -0
  30. package/dist/cjs/Commands/UploadImageCommand.js +17 -0
  31. package/dist/cjs/Commands/index.js +55 -0
  32. package/dist/cjs/Errors/AppError.js +8 -0
  33. package/dist/cjs/Errors/AuthenticationError.js +9 -0
  34. package/dist/cjs/Errors/AuthorizationError.js +9 -0
  35. package/dist/cjs/Errors/DeviceCommError.js +9 -0
  36. package/dist/cjs/Errors/LoginError.js +9 -0
  37. package/dist/cjs/Errors/NotFoundError.js +9 -0
  38. package/dist/cjs/Errors/RequestError.js +9 -0
  39. package/dist/cjs/Errors/SystemCommError.js +9 -0
  40. package/dist/cjs/Errors/TokenExpiredError.js +9 -0
  41. package/dist/cjs/Errors/UnprocessableRequestError.js +9 -0
  42. package/dist/cjs/Errors/ValidationError.js +9 -0
  43. package/dist/cjs/Errors/index.js +15 -0
  44. package/dist/cjs/Events/ApplicationInUseEvent.js +17 -0
  45. package/dist/cjs/Events/ApplicationOutOfUseEvent.js +17 -0
  46. package/dist/cjs/Events/EmailEvent.js +18 -0
  47. package/dist/cjs/Events/Event.js +55 -0
  48. package/dist/cjs/Events/SMSEvent.js +18 -0
  49. package/dist/cjs/Events/SMSSentEvent.js +17 -0
  50. package/dist/cjs/Events/ShortLinkCreatedEvent.js +17 -0
  51. package/dist/cjs/Events/SystemCameraUpdatedEvent.js +17 -0
  52. package/dist/cjs/Events/SystemCourtesyUpdatedEvent.js +17 -0
  53. package/dist/cjs/Events/SystemDimmerUpdatedEvent.js +17 -0
  54. package/dist/cjs/Events/SystemGatewayUpdatedEvent.js +17 -0
  55. package/dist/cjs/Events/SystemLockUpdatedEvent.js +17 -0
  56. package/dist/cjs/Events/SystemMediaSourceUpdatedEvent.js +17 -0
  57. package/dist/cjs/Events/SystemMotionSensorUpdatedEvent.js +17 -0
  58. package/dist/cjs/Events/SystemProductUpdatedEvent.js +17 -0
  59. package/dist/cjs/Events/SystemReservationUpdatedEvent.js +17 -0
  60. package/dist/cjs/Events/SystemSceneControllerUpdatedEvent.js +17 -0
  61. package/dist/cjs/Events/SystemSpaceTypeUpdatedEvent.js +17 -0
  62. package/dist/cjs/Events/SystemSpaceUpdatedEvent.js +17 -0
  63. package/dist/cjs/Events/SystemSwitchUpdatedEvent.js +17 -0
  64. package/dist/cjs/Events/SystemThermostatUpdatedEvent.js +17 -0
  65. package/dist/cjs/Events/SystemUserUpdatedEvent.js +17 -0
  66. package/dist/cjs/Events/SystemWindowCoveringUpdatedEvent.js +17 -0
  67. package/dist/cjs/Events/index.js +50 -0
  68. package/dist/cjs/Models/Alarm.js +29 -0
  69. package/dist/cjs/Models/Camera.js +29 -0
  70. package/dist/cjs/Models/Courtesy.js +33 -0
  71. package/dist/cjs/Models/Credential.js +29 -0
  72. package/dist/cjs/Models/Dimmer.js +61 -0
  73. package/dist/cjs/Models/DiscoveredDevice.js +30 -0
  74. package/dist/cjs/Models/EmailMessage.js +29 -0
  75. package/dist/cjs/Models/EnergyReport.js +29 -0
  76. package/dist/cjs/Models/EnergyReportShard.js +29 -0
  77. package/dist/cjs/Models/Gateway.js +29 -0
  78. package/dist/cjs/Models/Identification.js +32 -0
  79. package/dist/cjs/Models/Kohost.js +96 -0
  80. package/dist/cjs/Models/Lock.js +33 -0
  81. package/dist/cjs/Models/MediaFile.js +41 -0
  82. package/dist/cjs/Models/MediaSource.js +29 -0
  83. package/dist/cjs/Models/MotionSensor.js +29 -0
  84. package/dist/cjs/Models/Organization.js +28 -0
  85. package/dist/cjs/Models/Product.js +29 -0
  86. package/dist/cjs/Models/Property.js +28 -0
  87. package/dist/cjs/Models/Reservation.js +98 -0
  88. package/dist/cjs/Models/Room.js +212 -0
  89. package/dist/cjs/Models/Scene.js +183 -0
  90. package/dist/cjs/Models/ShortLink.js +29 -0
  91. package/dist/cjs/Models/SmsMessage.js +29 -0
  92. package/dist/cjs/Models/Space.js +97 -0
  93. package/dist/cjs/Models/SpaceType.js +30 -0
  94. package/dist/cjs/Models/Switch.js +33 -0
  95. package/dist/cjs/Models/SystemUser.js +48 -0
  96. package/dist/cjs/Models/Thermostat.js +80 -0
  97. package/dist/cjs/Models/Ticket.js +105 -0
  98. package/dist/cjs/Models/User.js +73 -0
  99. package/dist/cjs/Models/WindowCovering.js +49 -0
  100. package/dist/cjs/Models/index.js +68 -0
  101. package/dist/cjs/SocketIoClient/index.js +74 -0
  102. package/dist/cjs/defs/deviceTypes.js +15 -0
  103. package/dist/cjs/defs/formalDeviceTypes.js +6 -0
  104. package/dist/cjs/defs/index.js +11 -0
  105. package/dist/cjs/{index.cjs.js → index.js} +7 -1
  106. package/dist/cjs/schemas/alarm.json +103 -0
  107. package/dist/cjs/schemas/camera.json +50 -0
  108. package/dist/cjs/schemas/courtesy.json +46 -0
  109. package/dist/cjs/schemas/credential.json +31 -0
  110. package/dist/cjs/schemas/definitions.json +191 -0
  111. package/dist/cjs/schemas/dimmer.json +43 -0
  112. package/dist/cjs/schemas/discoveredDevice.json +31 -0
  113. package/dist/cjs/schemas/emailMessage.json +71 -0
  114. package/dist/cjs/schemas/energyReport.json +86 -0
  115. package/dist/cjs/schemas/energyReportShard.json +75 -0
  116. package/dist/cjs/schemas/gateway.json +35 -0
  117. package/dist/cjs/schemas/identification.json +61 -0
  118. package/dist/cjs/schemas/lock.json +45 -0
  119. package/dist/cjs/schemas/mediaFile.json +67 -0
  120. package/dist/cjs/schemas/mediaSource.json +184 -0
  121. package/dist/cjs/schemas/motionSensor.json +32 -0
  122. package/dist/cjs/schemas/organization.json +36 -0
  123. package/dist/cjs/schemas/payment.json +47 -0
  124. package/dist/cjs/schemas/product.json +40 -0
  125. package/dist/cjs/schemas/property.json +246 -0
  126. package/dist/cjs/schemas/reservation.json +118 -0
  127. package/dist/cjs/schemas/room.json +98 -0
  128. package/dist/cjs/schemas/scene.json +121 -0
  129. package/dist/cjs/schemas/shortLink.json +30 -0
  130. package/dist/cjs/schemas/smsMessage.json +61 -0
  131. package/dist/cjs/schemas/space.json +120 -0
  132. package/dist/cjs/schemas/spaceType.json +30 -0
  133. package/dist/cjs/schemas/switch.json +42 -0
  134. package/dist/cjs/schemas/systemUser.json +95 -0
  135. package/dist/cjs/schemas/thermostat.json +153 -0
  136. package/dist/cjs/schemas/ticket.json +96 -0
  137. package/dist/cjs/schemas/user.json +152 -0
  138. package/dist/cjs/schemas/windowCovering.json +43 -0
  139. package/dist/cjs/utils/errorFactory.js +8 -0
  140. package/dist/cjs/utils/eventFactory.js +10 -0
  141. package/dist/cjs/utils/getDeviceTypes.js +7 -0
  142. package/dist/cjs/utils/getFormalDeviceType.js +5 -0
  143. package/dist/cjs/utils/index.js +11 -0
  144. package/dist/cjs/utils/schema.js +25 -0
  145. package/dist/esm/Client.js +2293 -1205
  146. package/dist/esm/Client.js.map +4 -4
  147. package/dist/esm/Commands.js +478 -73
  148. package/dist/esm/Commands.js.map +3 -3
  149. package/dist/esm/Errors.js +35 -0
  150. package/dist/esm/Errors.js.map +1 -1
  151. package/dist/esm/Events.js +266 -63
  152. package/dist/esm/Events.js.map +3 -3
  153. package/dist/esm/Models.js +2853 -833
  154. package/dist/esm/Models.js.map +4 -4
  155. package/dist/esm/SocketIoClient.js +4748 -0
  156. package/dist/esm/SocketIoClient.js.map +7 -0
  157. package/dist/esm/defs.js +407 -279
  158. package/dist/esm/defs.js.map +4 -4
  159. package/dist/esm/index.js +17 -10
  160. package/dist/esm/utils.js +742 -85
  161. package/dist/esm/utils.js.map +3 -3
  162. package/dist/useCases/{AdminUpdateProperty.js → AdminUpdateCustomer.js} +2 -2
  163. package/dist/useCases/AssignSpaceToReservation.js +32 -0
  164. package/dist/useCases/BatchNotifyCheckIn.js +32 -0
  165. package/dist/useCases/CreateImageUploadEndpoint.js +32 -0
  166. package/dist/useCases/{CreateSource.js → CreateMediaSource.js} +2 -2
  167. package/dist/useCases/{AdminListCustomers.js → CreateOrganization.js} +3 -3
  168. package/dist/useCases/{LoginGateway.js → CreateProperty.js} +2 -2
  169. package/dist/useCases/{AdminCreateProperty.js → CreateSpaceType.js} +2 -2
  170. package/dist/useCases/DeleteMediaFile.js +32 -0
  171. package/dist/useCases/{DeleteSource.js → DeleteMediaSource.js} +2 -2
  172. package/dist/useCases/DeleteSpaceType.js +32 -0
  173. package/dist/useCases/DescribeLockCredential.js +32 -0
  174. package/dist/useCases/{DescribeIntegration.js → DescribeMediaSource.js} +3 -3
  175. package/dist/useCases/DescribeMyAccessCredentials.js +32 -0
  176. package/dist/useCases/{AdminDescribeProperty.js → DescribeOrganization.js} +2 -2
  177. package/dist/useCases/DescribeProduct.js +32 -0
  178. package/dist/useCases/{ListIntegrations.js → DescribeProperty.js} +3 -3
  179. package/dist/useCases/DescribeReservationEarlyCheckInProducts.js +32 -0
  180. package/dist/useCases/DescribeReservationRoomUpgrades.js +32 -0
  181. package/dist/useCases/{DeleteIntegration.js → DescribeSpaceType.js} +2 -2
  182. package/dist/useCases/ListMediaSources.js +32 -0
  183. package/dist/useCases/{AdminListProperties.js → ListMyTickets.js} +2 -2
  184. package/dist/useCases/{UpdateIntegration.js → ListOrganizations.js} +4 -4
  185. package/dist/useCases/ListProperties.js +32 -0
  186. package/dist/useCases/ListScenes.js +32 -0
  187. package/dist/useCases/ListSpaceTypes.js +32 -0
  188. package/dist/useCases/ListTeam.js +32 -0
  189. package/dist/useCases/ListUserSpaces.js +32 -0
  190. package/dist/useCases/LogoutUser.js +32 -0
  191. package/dist/useCases/PurchaseReservationEarlyCheckInProducts.js +32 -0
  192. package/dist/useCases/{CreateIntegrationDeviceMapEntry.js → PurchaseReservationRoomUpgrades.js} +2 -2
  193. package/dist/useCases/RequestLoginLink.js +1 -1
  194. package/dist/useCases/{CreateIntegration.js → RequestMyKeyToken.js} +2 -2
  195. package/dist/useCases/SendCheckInSMS.js +32 -0
  196. package/dist/useCases/{SetSource.js → SetDimmer.js} +2 -2
  197. package/dist/useCases/{DescribeSource.js → SetMediaSource.js} +3 -3
  198. package/dist/useCases/{UpdateSource.js → SetRoomScene.js} +3 -3
  199. package/dist/useCases/SetSpaceScene.js +32 -0
  200. package/dist/useCases/UpdateMediaSource.js +32 -0
  201. package/dist/useCases/UpdateProperty.js +32 -0
  202. package/dist/useCases/UpdateSpaceType.js +32 -0
  203. package/dist/useCases/{ListSources.js → UploadImage.js} +4 -4
  204. package/package.json +25 -10
  205. package/dist/cjs/Commands.js +0 -568
  206. package/dist/cjs/Errors.js +0 -174
  207. package/dist/cjs/Events.js +0 -375
  208. package/dist/cjs/Models.js +0 -3582
  209. package/dist/cjs/defs.js +0 -175
  210. package/dist/cjs/utils.js +0 -246
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
  });
@@ -51,10 +55,16 @@ var require_code = __commonJS({
51
55
  Object.defineProperty(exports, "__esModule", { value: true });
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 {
58
+ static {
59
+ __name(this, "_CodeOrName");
60
+ }
54
61
  };
55
62
  exports._CodeOrName = _CodeOrName;
56
63
  exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
57
64
  var Name = class extends _CodeOrName {
65
+ static {
66
+ __name(this, "Name");
67
+ }
58
68
  constructor(s) {
59
69
  super();
60
70
  if (!exports.IDENTIFIER.test(s))
@@ -73,6 +83,9 @@ var require_code = __commonJS({
73
83
  };
74
84
  exports.Name = Name;
75
85
  var _Code = class extends _CodeOrName {
86
+ static {
87
+ __name(this, "_Code");
88
+ }
76
89
  constructor(code) {
77
90
  super();
78
91
  this._items = typeof code === "string" ? [code] : code;
@@ -110,6 +123,7 @@ var require_code = __commonJS({
110
123
  }
111
124
  return new _Code(code);
112
125
  }
126
+ __name(_, "_");
113
127
  exports._ = _;
114
128
  var plus = new _Code("+");
115
129
  function str(strs, ...args) {
@@ -123,6 +137,7 @@ var require_code = __commonJS({
123
137
  optimize(expr);
124
138
  return new _Code(expr);
125
139
  }
140
+ __name(str, "str");
126
141
  exports.str = str;
127
142
  function addCodeArg(code, arg) {
128
143
  if (arg instanceof _Code)
@@ -132,6 +147,7 @@ var require_code = __commonJS({
132
147
  else
133
148
  code.push(interpolate(arg));
134
149
  }
150
+ __name(addCodeArg, "addCodeArg");
135
151
  exports.addCodeArg = addCodeArg;
136
152
  function optimize(expr) {
137
153
  let i = 1;
@@ -147,6 +163,7 @@ var require_code = __commonJS({
147
163
  i++;
148
164
  }
149
165
  }
166
+ __name(optimize, "optimize");
150
167
  function mergeExprItems(a, b) {
151
168
  if (b === '""')
152
169
  return a;
@@ -165,24 +182,30 @@ var require_code = __commonJS({
165
182
  return `"${a}${b.slice(1)}`;
166
183
  return;
167
184
  }
185
+ __name(mergeExprItems, "mergeExprItems");
168
186
  function strConcat(c1, c2) {
169
187
  return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
170
188
  }
189
+ __name(strConcat, "strConcat");
171
190
  exports.strConcat = strConcat;
172
191
  function interpolate(x) {
173
192
  return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x);
174
193
  }
194
+ __name(interpolate, "interpolate");
175
195
  function stringify(x) {
176
196
  return new _Code(safeStringify(x));
177
197
  }
198
+ __name(stringify, "stringify");
178
199
  exports.stringify = stringify;
179
200
  function safeStringify(x) {
180
201
  return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
181
202
  }
203
+ __name(safeStringify, "safeStringify");
182
204
  exports.safeStringify = safeStringify;
183
205
  function getProperty(key) {
184
206
  return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
185
207
  }
208
+ __name(getProperty, "getProperty");
186
209
  exports.getProperty = getProperty;
187
210
  function getEsmExportName(key) {
188
211
  if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
@@ -190,10 +213,12 @@ var require_code = __commonJS({
190
213
  }
191
214
  throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
192
215
  }
216
+ __name(getEsmExportName, "getEsmExportName");
193
217
  exports.getEsmExportName = getEsmExportName;
194
218
  function regexpCode(rx) {
195
219
  return new _Code(rx.toString());
196
220
  }
221
+ __name(regexpCode, "regexpCode");
197
222
  exports.regexpCode = regexpCode;
198
223
  }
199
224
  });
@@ -206,6 +231,9 @@ var require_scope = __commonJS({
206
231
  exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
207
232
  var code_1 = require_code();
208
233
  var ValueError = class extends Error {
234
+ static {
235
+ __name(this, "ValueError");
236
+ }
209
237
  constructor(name) {
210
238
  super(`CodeGen: "code" for ${name} not defined`);
211
239
  this.value = name.value;
@@ -222,6 +250,9 @@ var require_scope = __commonJS({
222
250
  var: new code_1.Name("var")
223
251
  };
224
252
  var Scope = class {
253
+ static {
254
+ __name(this, "Scope");
255
+ }
225
256
  constructor({ prefixes, parent } = {}) {
226
257
  this._names = {};
227
258
  this._prefixes = prefixes;
@@ -247,6 +278,9 @@ var require_scope = __commonJS({
247
278
  };
248
279
  exports.Scope = Scope;
249
280
  var ValueScopeName = class extends code_1.Name {
281
+ static {
282
+ __name(this, "ValueScopeName");
283
+ }
250
284
  constructor(prefix, nameStr) {
251
285
  super(nameStr);
252
286
  this.prefix = prefix;
@@ -259,6 +293,9 @@ var require_scope = __commonJS({
259
293
  exports.ValueScopeName = ValueScopeName;
260
294
  var line = (0, code_1._)`\n`;
261
295
  var ValueScope = class extends Scope {
296
+ static {
297
+ __name(this, "ValueScope");
298
+ }
262
299
  constructor(opts) {
263
300
  super(opts);
264
301
  this._values = {};
@@ -402,6 +439,9 @@ var require_codegen = __commonJS({
402
439
  ADD: new code_1._Code("+")
403
440
  };
404
441
  var Node = class {
442
+ static {
443
+ __name(this, "Node");
444
+ }
405
445
  optimizeNodes() {
406
446
  return this;
407
447
  }
@@ -410,6 +450,9 @@ var require_codegen = __commonJS({
410
450
  }
411
451
  };
412
452
  var Def = class extends Node {
453
+ static {
454
+ __name(this, "Def");
455
+ }
413
456
  constructor(varKind, name, rhs) {
414
457
  super();
415
458
  this.varKind = varKind;
@@ -433,6 +476,9 @@ var require_codegen = __commonJS({
433
476
  }
434
477
  };
435
478
  var Assign = class extends Node {
479
+ static {
480
+ __name(this, "Assign");
481
+ }
436
482
  constructor(lhs, rhs, sideEffects) {
437
483
  super();
438
484
  this.lhs = lhs;
@@ -454,6 +500,9 @@ var require_codegen = __commonJS({
454
500
  }
455
501
  };
456
502
  var AssignOp = class extends Assign {
503
+ static {
504
+ __name(this, "AssignOp");
505
+ }
457
506
  constructor(lhs, op, rhs, sideEffects) {
458
507
  super(lhs, rhs, sideEffects);
459
508
  this.op = op;
@@ -463,6 +512,9 @@ var require_codegen = __commonJS({
463
512
  }
464
513
  };
465
514
  var Label = class extends Node {
515
+ static {
516
+ __name(this, "Label");
517
+ }
466
518
  constructor(label) {
467
519
  super();
468
520
  this.label = label;
@@ -473,6 +525,9 @@ var require_codegen = __commonJS({
473
525
  }
474
526
  };
475
527
  var Break = class extends Node {
528
+ static {
529
+ __name(this, "Break");
530
+ }
476
531
  constructor(label) {
477
532
  super();
478
533
  this.label = label;
@@ -484,6 +539,9 @@ var require_codegen = __commonJS({
484
539
  }
485
540
  };
486
541
  var Throw = class extends Node {
542
+ static {
543
+ __name(this, "Throw");
544
+ }
487
545
  constructor(error) {
488
546
  super();
489
547
  this.error = error;
@@ -496,6 +554,9 @@ var require_codegen = __commonJS({
496
554
  }
497
555
  };
498
556
  var AnyCode = class extends Node {
557
+ static {
558
+ __name(this, "AnyCode");
559
+ }
499
560
  constructor(code) {
500
561
  super();
501
562
  this.code = code;
@@ -515,6 +576,9 @@ var require_codegen = __commonJS({
515
576
  }
516
577
  };
517
578
  var ParentNode = class extends Node {
579
+ static {
580
+ __name(this, "ParentNode");
581
+ }
518
582
  constructor(nodes = []) {
519
583
  super();
520
584
  this.nodes = nodes;
@@ -553,16 +617,28 @@ var require_codegen = __commonJS({
553
617
  }
554
618
  };
555
619
  var BlockNode = class extends ParentNode {
620
+ static {
621
+ __name(this, "BlockNode");
622
+ }
556
623
  render(opts) {
557
624
  return "{" + opts._n + super.render(opts) + "}" + opts._n;
558
625
  }
559
626
  };
560
627
  var Root = class extends ParentNode {
628
+ static {
629
+ __name(this, "Root");
630
+ }
561
631
  };
562
632
  var Else = class extends BlockNode {
633
+ static {
634
+ __name(this, "Else");
635
+ }
563
636
  };
564
637
  Else.kind = "else";
565
- var If = class extends BlockNode {
638
+ var If = class _If extends BlockNode {
639
+ static {
640
+ __name(this, "If");
641
+ }
566
642
  constructor(condition, nodes) {
567
643
  super(nodes);
568
644
  this.condition = condition;
@@ -585,10 +661,10 @@ var require_codegen = __commonJS({
585
661
  }
586
662
  if (e) {
587
663
  if (cond === false)
588
- return e instanceof If ? e : e.nodes;
664
+ return e instanceof _If ? e : e.nodes;
589
665
  if (this.nodes.length)
590
666
  return this;
591
- return new If(not(cond), e instanceof If ? [e] : e.nodes);
667
+ return new _If(not(cond), e instanceof _If ? [e] : e.nodes);
592
668
  }
593
669
  if (cond === false || !this.nodes.length)
594
670
  return void 0;
@@ -612,9 +688,15 @@ var require_codegen = __commonJS({
612
688
  };
613
689
  If.kind = "if";
614
690
  var For = class extends BlockNode {
691
+ static {
692
+ __name(this, "For");
693
+ }
615
694
  };
616
695
  For.kind = "for";
617
696
  var ForLoop = class extends For {
697
+ static {
698
+ __name(this, "ForLoop");
699
+ }
618
700
  constructor(iteration) {
619
701
  super();
620
702
  this.iteration = iteration;
@@ -633,6 +715,9 @@ var require_codegen = __commonJS({
633
715
  }
634
716
  };
635
717
  var ForRange = class extends For {
718
+ static {
719
+ __name(this, "ForRange");
720
+ }
636
721
  constructor(varKind, name, from, to) {
637
722
  super();
638
723
  this.varKind = varKind;
@@ -651,6 +736,9 @@ var require_codegen = __commonJS({
651
736
  }
652
737
  };
653
738
  var ForIter = class extends For {
739
+ static {
740
+ __name(this, "ForIter");
741
+ }
654
742
  constructor(loop, varKind, name, iterable) {
655
743
  super();
656
744
  this.loop = loop;
@@ -672,6 +760,9 @@ var require_codegen = __commonJS({
672
760
  }
673
761
  };
674
762
  var Func = class extends BlockNode {
763
+ static {
764
+ __name(this, "Func");
765
+ }
675
766
  constructor(name, args, async) {
676
767
  super();
677
768
  this.name = name;
@@ -685,12 +776,18 @@ var require_codegen = __commonJS({
685
776
  };
686
777
  Func.kind = "func";
687
778
  var Return = class extends ParentNode {
779
+ static {
780
+ __name(this, "Return");
781
+ }
688
782
  render(opts) {
689
783
  return "return " + super.render(opts);
690
784
  }
691
785
  };
692
786
  Return.kind = "return";
693
787
  var Try = class extends BlockNode {
788
+ static {
789
+ __name(this, "Try");
790
+ }
694
791
  render(opts) {
695
792
  let code = "try" + super.render(opts);
696
793
  if (this.catch)
@@ -723,6 +820,9 @@ var require_codegen = __commonJS({
723
820
  }
724
821
  };
725
822
  var Catch = class extends BlockNode {
823
+ static {
824
+ __name(this, "Catch");
825
+ }
726
826
  constructor(error) {
727
827
  super();
728
828
  this.error = error;
@@ -733,12 +833,18 @@ var require_codegen = __commonJS({
733
833
  };
734
834
  Catch.kind = "catch";
735
835
  var Finally = class extends BlockNode {
836
+ static {
837
+ __name(this, "Finally");
838
+ }
736
839
  render(opts) {
737
840
  return "finally" + super.render(opts);
738
841
  }
739
842
  };
740
843
  Finally.kind = "finally";
741
844
  var CodeGen = class {
845
+ static {
846
+ __name(this, "CodeGen");
847
+ }
742
848
  constructor(extScope, opts = {}) {
743
849
  this._values = {};
744
850
  this._blockStarts = [];
@@ -1008,9 +1114,11 @@ var require_codegen = __commonJS({
1008
1114
  names[n] = (names[n] || 0) + (from[n] || 0);
1009
1115
  return names;
1010
1116
  }
1117
+ __name(addNames, "addNames");
1011
1118
  function addExprNames(names, from) {
1012
1119
  return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
1013
1120
  }
1121
+ __name(addExprNames, "addExprNames");
1014
1122
  function optimizeExpr(expr, names, constants) {
1015
1123
  if (expr instanceof code_1.Name)
1016
1124
  return replaceName(expr);
@@ -1032,34 +1140,43 @@ var require_codegen = __commonJS({
1032
1140
  delete names[n.str];
1033
1141
  return c;
1034
1142
  }
1143
+ __name(replaceName, "replaceName");
1035
1144
  function canOptimize(e) {
1036
1145
  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
1146
  }
1147
+ __name(canOptimize, "canOptimize");
1038
1148
  }
1149
+ __name(optimizeExpr, "optimizeExpr");
1039
1150
  function subtractNames(names, from) {
1040
1151
  for (const n in from)
1041
1152
  names[n] = (names[n] || 0) - (from[n] || 0);
1042
1153
  }
1154
+ __name(subtractNames, "subtractNames");
1043
1155
  function not(x) {
1044
1156
  return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`;
1045
1157
  }
1158
+ __name(not, "not");
1046
1159
  exports.not = not;
1047
1160
  var andCode = mappend(exports.operators.AND);
1048
1161
  function and(...args) {
1049
1162
  return args.reduce(andCode);
1050
1163
  }
1164
+ __name(and, "and");
1051
1165
  exports.and = and;
1052
1166
  var orCode = mappend(exports.operators.OR);
1053
1167
  function or(...args) {
1054
1168
  return args.reduce(orCode);
1055
1169
  }
1170
+ __name(or, "or");
1056
1171
  exports.or = or;
1057
1172
  function mappend(op) {
1058
1173
  return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;
1059
1174
  }
1175
+ __name(mappend, "mappend");
1060
1176
  function par(x) {
1061
1177
  return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`;
1062
1178
  }
1179
+ __name(par, "par");
1063
1180
  }
1064
1181
  });
1065
1182
 
@@ -1077,6 +1194,7 @@ var require_util = __commonJS({
1077
1194
  hash[item] = true;
1078
1195
  return hash;
1079
1196
  }
1197
+ __name(toHash, "toHash");
1080
1198
  exports.toHash = toHash;
1081
1199
  function alwaysValidSchema(it, schema) {
1082
1200
  if (typeof schema == "boolean")
@@ -1086,6 +1204,7 @@ var require_util = __commonJS({
1086
1204
  checkUnknownRules(it, schema);
1087
1205
  return !schemaHasRules(schema, it.self.RULES.all);
1088
1206
  }
1207
+ __name(alwaysValidSchema, "alwaysValidSchema");
1089
1208
  exports.alwaysValidSchema = alwaysValidSchema;
1090
1209
  function checkUnknownRules(it, schema = it.schema) {
1091
1210
  const { opts, self } = it;
@@ -1099,6 +1218,7 @@ var require_util = __commonJS({
1099
1218
  checkStrictMode(it, `unknown keyword: "${key}"`);
1100
1219
  }
1101
1220
  }
1221
+ __name(checkUnknownRules, "checkUnknownRules");
1102
1222
  exports.checkUnknownRules = checkUnknownRules;
1103
1223
  function schemaHasRules(schema, rules) {
1104
1224
  if (typeof schema == "boolean")
@@ -1108,6 +1228,7 @@ var require_util = __commonJS({
1108
1228
  return true;
1109
1229
  return false;
1110
1230
  }
1231
+ __name(schemaHasRules, "schemaHasRules");
1111
1232
  exports.schemaHasRules = schemaHasRules;
1112
1233
  function schemaHasRulesButRef(schema, RULES) {
1113
1234
  if (typeof schema == "boolean")
@@ -1117,6 +1238,7 @@ var require_util = __commonJS({
1117
1238
  return true;
1118
1239
  return false;
1119
1240
  }
1241
+ __name(schemaHasRulesButRef, "schemaHasRulesButRef");
1120
1242
  exports.schemaHasRulesButRef = schemaHasRulesButRef;
1121
1243
  function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {
1122
1244
  if (!$data) {
@@ -1127,24 +1249,29 @@ var require_util = __commonJS({
1127
1249
  }
1128
1250
  return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
1129
1251
  }
1252
+ __name(schemaRefOrVal, "schemaRefOrVal");
1130
1253
  exports.schemaRefOrVal = schemaRefOrVal;
1131
1254
  function unescapeFragment(str) {
1132
1255
  return unescapeJsonPointer(decodeURIComponent(str));
1133
1256
  }
1257
+ __name(unescapeFragment, "unescapeFragment");
1134
1258
  exports.unescapeFragment = unescapeFragment;
1135
1259
  function escapeFragment(str) {
1136
1260
  return encodeURIComponent(escapeJsonPointer(str));
1137
1261
  }
1262
+ __name(escapeFragment, "escapeFragment");
1138
1263
  exports.escapeFragment = escapeFragment;
1139
1264
  function escapeJsonPointer(str) {
1140
1265
  if (typeof str == "number")
1141
1266
  return `${str}`;
1142
1267
  return str.replace(/~/g, "~0").replace(/\//g, "~1");
1143
1268
  }
1269
+ __name(escapeJsonPointer, "escapeJsonPointer");
1144
1270
  exports.escapeJsonPointer = escapeJsonPointer;
1145
1271
  function unescapeJsonPointer(str) {
1146
1272
  return str.replace(/~1/g, "/").replace(/~0/g, "~");
1147
1273
  }
1274
+ __name(unescapeJsonPointer, "unescapeJsonPointer");
1148
1275
  exports.unescapeJsonPointer = unescapeJsonPointer;
1149
1276
  function eachItem(xs, f) {
1150
1277
  if (Array.isArray(xs)) {
@@ -1154,6 +1281,7 @@ var require_util = __commonJS({
1154
1281
  f(xs);
1155
1282
  }
1156
1283
  }
1284
+ __name(eachItem, "eachItem");
1157
1285
  exports.eachItem = eachItem;
1158
1286
  function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName }) {
1159
1287
  return (gen, from, to, toName) => {
@@ -1161,6 +1289,7 @@ var require_util = __commonJS({
1161
1289
  return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
1162
1290
  };
1163
1291
  }
1292
+ __name(makeMergeEvaluated, "makeMergeEvaluated");
1164
1293
  exports.mergeEvaluated = {
1165
1294
  props: makeMergeEvaluated({
1166
1295
  mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => {
@@ -1192,10 +1321,12 @@ var require_util = __commonJS({
1192
1321
  setEvaluated(gen, props, ps);
1193
1322
  return props;
1194
1323
  }
1324
+ __name(evaluatedPropsToName, "evaluatedPropsToName");
1195
1325
  exports.evaluatedPropsToName = evaluatedPropsToName;
1196
1326
  function setEvaluated(gen, props, ps) {
1197
1327
  Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true));
1198
1328
  }
1329
+ __name(setEvaluated, "setEvaluated");
1199
1330
  exports.setEvaluated = setEvaluated;
1200
1331
  var snippets = {};
1201
1332
  function useFunc(gen, f) {
@@ -1204,6 +1335,7 @@ var require_util = __commonJS({
1204
1335
  code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code))
1205
1336
  });
1206
1337
  }
1338
+ __name(useFunc, "useFunc");
1207
1339
  exports.useFunc = useFunc;
1208
1340
  var Type;
1209
1341
  (function(Type2) {
@@ -1217,6 +1349,7 @@ var require_util = __commonJS({
1217
1349
  }
1218
1350
  return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
1219
1351
  }
1352
+ __name(getErrorPath, "getErrorPath");
1220
1353
  exports.getErrorPath = getErrorPath;
1221
1354
  function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
1222
1355
  if (!mode)
@@ -1226,6 +1359,7 @@ var require_util = __commonJS({
1226
1359
  throw new Error(msg);
1227
1360
  it.self.logger.warn(msg);
1228
1361
  }
1362
+ __name(checkStrictMode, "checkStrictMode");
1229
1363
  exports.checkStrictMode = checkStrictMode;
1230
1364
  }
1231
1365
  });
@@ -1288,6 +1422,7 @@ var require_errors = __commonJS({
1288
1422
  returnErrors(it, (0, codegen_1._)`[${errObj}]`);
1289
1423
  }
1290
1424
  }
1425
+ __name(reportError, "reportError");
1291
1426
  exports.reportError = reportError;
1292
1427
  function reportExtraError(cxt, error = exports.keywordError, errorPaths) {
1293
1428
  const { it } = cxt;
@@ -1298,11 +1433,13 @@ var require_errors = __commonJS({
1298
1433
  returnErrors(it, names_1.default.vErrors);
1299
1434
  }
1300
1435
  }
1436
+ __name(reportExtraError, "reportExtraError");
1301
1437
  exports.reportExtraError = reportExtraError;
1302
1438
  function resetErrorsCount(gen, errsCount) {
1303
1439
  gen.assign(names_1.default.errors, errsCount);
1304
1440
  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
1441
  }
1442
+ __name(resetErrorsCount, "resetErrorsCount");
1306
1443
  exports.resetErrorsCount = resetErrorsCount;
1307
1444
  function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) {
1308
1445
  if (errsCount === void 0)
@@ -1318,12 +1455,14 @@ var require_errors = __commonJS({
1318
1455
  }
1319
1456
  });
1320
1457
  }
1458
+ __name(extendErrors, "extendErrors");
1321
1459
  exports.extendErrors = extendErrors;
1322
1460
  function addError(gen, errObj) {
1323
1461
  const err = gen.const("err", errObj);
1324
1462
  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
1463
  gen.code((0, codegen_1._)`${names_1.default.errors}++`);
1326
1464
  }
1465
+ __name(addError, "addError");
1327
1466
  function returnErrors(it, errs) {
1328
1467
  const { gen, validateName, schemaEnv } = it;
1329
1468
  if (schemaEnv.$async) {
@@ -1333,6 +1472,7 @@ var require_errors = __commonJS({
1333
1472
  gen.return(false);
1334
1473
  }
1335
1474
  }
1475
+ __name(returnErrors, "returnErrors");
1336
1476
  var E = {
1337
1477
  keyword: new codegen_1.Name("keyword"),
1338
1478
  schemaPath: new codegen_1.Name("schemaPath"),
@@ -1348,6 +1488,7 @@ var require_errors = __commonJS({
1348
1488
  return (0, codegen_1._)`{}`;
1349
1489
  return errorObject(cxt, error, errorPaths);
1350
1490
  }
1491
+ __name(errorObjectCode, "errorObjectCode");
1351
1492
  function errorObject(cxt, error, errorPaths = {}) {
1352
1493
  const { gen, it } = cxt;
1353
1494
  const keyValues = [
@@ -1357,10 +1498,12 @@ var require_errors = __commonJS({
1357
1498
  extraErrorProps(cxt, error, keyValues);
1358
1499
  return gen.object(...keyValues);
1359
1500
  }
1501
+ __name(errorObject, "errorObject");
1360
1502
  function errorInstancePath({ errorPath }, { instancePath }) {
1361
1503
  const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath;
1362
1504
  return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
1363
1505
  }
1506
+ __name(errorInstancePath, "errorInstancePath");
1364
1507
  function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
1365
1508
  let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`;
1366
1509
  if (schemaPath) {
@@ -1368,6 +1511,7 @@ var require_errors = __commonJS({
1368
1511
  }
1369
1512
  return [E.schemaPath, schPath];
1370
1513
  }
1514
+ __name(errorSchemaPath, "errorSchemaPath");
1371
1515
  function extraErrorProps(cxt, { params, message }, keyValues) {
1372
1516
  const { keyword, data, schemaValue, it } = cxt;
1373
1517
  const { opts, propertyName, topSchemaRef, schemaPath } = it;
@@ -1381,6 +1525,7 @@ var require_errors = __commonJS({
1381
1525
  if (propertyName)
1382
1526
  keyValues.push([E.propertyName, propertyName]);
1383
1527
  }
1528
+ __name(extraErrorProps, "extraErrorProps");
1384
1529
  }
1385
1530
  });
1386
1531
 
@@ -1407,6 +1552,7 @@ var require_boolSchema = __commonJS({
1407
1552
  gen.return(true);
1408
1553
  }
1409
1554
  }
1555
+ __name(topBoolOrEmptySchema, "topBoolOrEmptySchema");
1410
1556
  exports.topBoolOrEmptySchema = topBoolOrEmptySchema;
1411
1557
  function boolOrEmptySchema(it, valid) {
1412
1558
  const { gen, schema } = it;
@@ -1417,6 +1563,7 @@ var require_boolSchema = __commonJS({
1417
1563
  gen.var(valid, true);
1418
1564
  }
1419
1565
  }
1566
+ __name(boolOrEmptySchema, "boolOrEmptySchema");
1420
1567
  exports.boolOrEmptySchema = boolOrEmptySchema;
1421
1568
  function falseSchemaError(it, overrideAllErrors) {
1422
1569
  const { gen, data } = it;
@@ -1432,6 +1579,7 @@ var require_boolSchema = __commonJS({
1432
1579
  };
1433
1580
  (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors);
1434
1581
  }
1582
+ __name(falseSchemaError, "falseSchemaError");
1435
1583
  }
1436
1584
  });
1437
1585
 
@@ -1446,6 +1594,7 @@ var require_rules = __commonJS({
1446
1594
  function isJSONType(x) {
1447
1595
  return typeof x == "string" && jsonTypes.has(x);
1448
1596
  }
1597
+ __name(isJSONType, "isJSONType");
1449
1598
  exports.isJSONType = isJSONType;
1450
1599
  function getRules() {
1451
1600
  const groups = {
@@ -1462,6 +1611,7 @@ var require_rules = __commonJS({
1462
1611
  keywords: {}
1463
1612
  };
1464
1613
  }
1614
+ __name(getRules, "getRules");
1465
1615
  exports.getRules = getRules;
1466
1616
  }
1467
1617
  });
@@ -1476,15 +1626,18 @@ var require_applicability = __commonJS({
1476
1626
  const group = self.RULES.types[type];
1477
1627
  return group && group !== true && shouldUseGroup(schema, group);
1478
1628
  }
1629
+ __name(schemaHasRulesForType, "schemaHasRulesForType");
1479
1630
  exports.schemaHasRulesForType = schemaHasRulesForType;
1480
1631
  function shouldUseGroup(schema, group) {
1481
1632
  return group.rules.some((rule) => shouldUseRule(schema, rule));
1482
1633
  }
1634
+ __name(shouldUseGroup, "shouldUseGroup");
1483
1635
  exports.shouldUseGroup = shouldUseGroup;
1484
1636
  function shouldUseRule(schema, rule) {
1485
1637
  var _a;
1486
1638
  return schema[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== void 0));
1487
1639
  }
1640
+ __name(shouldUseRule, "shouldUseRule");
1488
1641
  exports.shouldUseRule = shouldUseRule;
1489
1642
  }
1490
1643
  });
@@ -1520,6 +1673,7 @@ var require_dataType = __commonJS({
1520
1673
  }
1521
1674
  return types;
1522
1675
  }
1676
+ __name(getSchemaTypes, "getSchemaTypes");
1523
1677
  exports.getSchemaTypes = getSchemaTypes;
1524
1678
  function getJSONTypes(ts) {
1525
1679
  const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
@@ -1527,6 +1681,7 @@ var require_dataType = __commonJS({
1527
1681
  return types;
1528
1682
  throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
1529
1683
  }
1684
+ __name(getJSONTypes, "getJSONTypes");
1530
1685
  exports.getJSONTypes = getJSONTypes;
1531
1686
  function coerceAndCheckDataType(it, types) {
1532
1687
  const { gen, data, opts } = it;
@@ -1543,11 +1698,13 @@ var require_dataType = __commonJS({
1543
1698
  }
1544
1699
  return checkTypes;
1545
1700
  }
1701
+ __name(coerceAndCheckDataType, "coerceAndCheckDataType");
1546
1702
  exports.coerceAndCheckDataType = coerceAndCheckDataType;
1547
1703
  var COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
1548
1704
  function coerceToTypes(types, coerceTypes) {
1549
1705
  return coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : [];
1550
1706
  }
1707
+ __name(coerceToTypes, "coerceToTypes");
1551
1708
  function coerceData(it, types, coerceTo) {
1552
1709
  const { gen, data, opts } = it;
1553
1710
  const dataType = gen.let("dataType", (0, codegen_1._)`typeof ${data}`);
@@ -1593,10 +1750,13 @@ var require_dataType = __commonJS({
1593
1750
  || ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`);
1594
1751
  }
1595
1752
  }
1753
+ __name(coerceSpecificType, "coerceSpecificType");
1596
1754
  }
1755
+ __name(coerceData, "coerceData");
1597
1756
  function assignParentData({ gen, parentData, parentDataProperty }, expr) {
1598
1757
  gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));
1599
1758
  }
1759
+ __name(assignParentData, "assignParentData");
1600
1760
  function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
1601
1761
  const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
1602
1762
  let cond;
@@ -1622,7 +1782,9 @@ var require_dataType = __commonJS({
1622
1782
  function numCond(_cond = codegen_1.nil) {
1623
1783
  return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil);
1624
1784
  }
1785
+ __name(numCond, "numCond");
1625
1786
  }
1787
+ __name(checkDataType, "checkDataType");
1626
1788
  exports.checkDataType = checkDataType;
1627
1789
  function checkDataTypes(dataTypes, data, strictNums, correct) {
1628
1790
  if (dataTypes.length === 1) {
@@ -1645,6 +1807,7 @@ var require_dataType = __commonJS({
1645
1807
  cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
1646
1808
  return cond;
1647
1809
  }
1810
+ __name(checkDataTypes, "checkDataTypes");
1648
1811
  exports.checkDataTypes = checkDataTypes;
1649
1812
  var typeError = {
1650
1813
  message: ({ schema }) => `must be ${schema}`,
@@ -1654,6 +1817,7 @@ var require_dataType = __commonJS({
1654
1817
  const cxt = getTypeErrorContext(it);
1655
1818
  (0, errors_1.reportError)(cxt, typeError);
1656
1819
  }
1820
+ __name(reportTypeError, "reportTypeError");
1657
1821
  exports.reportTypeError = reportTypeError;
1658
1822
  function getTypeErrorContext(it) {
1659
1823
  const { gen, data, schema } = it;
@@ -1670,6 +1834,7 @@ var require_dataType = __commonJS({
1670
1834
  it
1671
1835
  };
1672
1836
  }
1837
+ __name(getTypeErrorContext, "getTypeErrorContext");
1673
1838
  }
1674
1839
  });
1675
1840
 
@@ -1691,6 +1856,7 @@ var require_defaults = __commonJS({
1691
1856
  items.forEach((sch, i) => assignDefault(it, i, sch.default));
1692
1857
  }
1693
1858
  }
1859
+ __name(assignDefaults, "assignDefaults");
1694
1860
  exports.assignDefaults = assignDefaults;
1695
1861
  function assignDefault(it, prop, defaultValue) {
1696
1862
  const { gen, compositeRule, data, opts } = it;
@@ -1707,6 +1873,7 @@ var require_defaults = __commonJS({
1707
1873
  }
1708
1874
  gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
1709
1875
  }
1876
+ __name(assignDefault, "assignDefault");
1710
1877
  }
1711
1878
  });
1712
1879
 
@@ -1727,15 +1894,18 @@ var require_code2 = __commonJS({
1727
1894
  cxt.error();
1728
1895
  });
1729
1896
  }
1897
+ __name(checkReportMissingProp, "checkReportMissingProp");
1730
1898
  exports.checkReportMissingProp = checkReportMissingProp;
1731
1899
  function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
1732
1900
  return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));
1733
1901
  }
1902
+ __name(checkMissingProp, "checkMissingProp");
1734
1903
  exports.checkMissingProp = checkMissingProp;
1735
1904
  function reportMissingProp(cxt, missing) {
1736
1905
  cxt.setParams({ missingProperty: missing }, true);
1737
1906
  cxt.error();
1738
1907
  }
1908
+ __name(reportMissingProp, "reportMissingProp");
1739
1909
  exports.reportMissingProp = reportMissingProp;
1740
1910
  function hasPropFunc(gen) {
1741
1911
  return gen.scopeValue("func", {
@@ -1744,28 +1914,34 @@ var require_code2 = __commonJS({
1744
1914
  code: (0, codegen_1._)`Object.prototype.hasOwnProperty`
1745
1915
  });
1746
1916
  }
1917
+ __name(hasPropFunc, "hasPropFunc");
1747
1918
  exports.hasPropFunc = hasPropFunc;
1748
1919
  function isOwnProperty(gen, data, property) {
1749
1920
  return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`;
1750
1921
  }
1922
+ __name(isOwnProperty, "isOwnProperty");
1751
1923
  exports.isOwnProperty = isOwnProperty;
1752
1924
  function propertyInData(gen, data, property, ownProperties) {
1753
1925
  const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`;
1754
1926
  return ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond;
1755
1927
  }
1928
+ __name(propertyInData, "propertyInData");
1756
1929
  exports.propertyInData = propertyInData;
1757
1930
  function noPropertyInData(gen, data, property, ownProperties) {
1758
1931
  const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`;
1759
1932
  return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;
1760
1933
  }
1934
+ __name(noPropertyInData, "noPropertyInData");
1761
1935
  exports.noPropertyInData = noPropertyInData;
1762
1936
  function allSchemaProperties(schemaMap) {
1763
1937
  return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
1764
1938
  }
1939
+ __name(allSchemaProperties, "allSchemaProperties");
1765
1940
  exports.allSchemaProperties = allSchemaProperties;
1766
1941
  function schemaProperties(it, schemaMap) {
1767
1942
  return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
1768
1943
  }
1944
+ __name(schemaProperties, "schemaProperties");
1769
1945
  exports.schemaProperties = schemaProperties;
1770
1946
  function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
1771
1947
  const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
@@ -1780,6 +1956,7 @@ var require_code2 = __commonJS({
1780
1956
  const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
1781
1957
  return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`;
1782
1958
  }
1959
+ __name(callValidateCode, "callValidateCode");
1783
1960
  exports.callValidateCode = callValidateCode;
1784
1961
  var newRegExp = (0, codegen_1._)`new RegExp`;
1785
1962
  function usePattern({ gen, it: { opts } }, pattern) {
@@ -1792,6 +1969,7 @@ var require_code2 = __commonJS({
1792
1969
  code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`
1793
1970
  });
1794
1971
  }
1972
+ __name(usePattern, "usePattern");
1795
1973
  exports.usePattern = usePattern;
1796
1974
  function validateArray(cxt) {
1797
1975
  const { gen, data, keyword, it } = cxt;
@@ -1815,7 +1993,9 @@ var require_code2 = __commonJS({
1815
1993
  gen.if((0, codegen_1.not)(valid), notValid);
1816
1994
  });
1817
1995
  }
1996
+ __name(validateItems, "validateItems");
1818
1997
  }
1998
+ __name(validateArray, "validateArray");
1819
1999
  exports.validateArray = validateArray;
1820
2000
  function validateUnion(cxt) {
1821
2001
  const { gen, schema, keyword, it } = cxt;
@@ -1839,6 +2019,7 @@ var require_code2 = __commonJS({
1839
2019
  }));
1840
2020
  cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
1841
2021
  }
2022
+ __name(validateUnion, "validateUnion");
1842
2023
  exports.validateUnion = validateUnion;
1843
2024
  }
1844
2025
  });
@@ -1869,6 +2050,7 @@ var require_keyword = __commonJS({
1869
2050
  }, valid);
1870
2051
  cxt.pass(valid, () => cxt.error(true));
1871
2052
  }
2053
+ __name(macroKeywordCode, "macroKeywordCode");
1872
2054
  exports.macroKeywordCode = macroKeywordCode;
1873
2055
  function funcKeywordCode(cxt, def) {
1874
2056
  var _a;
@@ -1892,32 +2074,39 @@ var require_keyword = __commonJS({
1892
2074
  reportErrs(() => addErrs(cxt, ruleErrs));
1893
2075
  }
1894
2076
  }
2077
+ __name(validateKeyword, "validateKeyword");
1895
2078
  function validateAsync() {
1896
2079
  const ruleErrs = gen.let("ruleErrs", null);
1897
2080
  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
2081
  return ruleErrs;
1899
2082
  }
2083
+ __name(validateAsync, "validateAsync");
1900
2084
  function validateSync() {
1901
2085
  const validateErrs = (0, codegen_1._)`${validateRef}.errors`;
1902
2086
  gen.assign(validateErrs, null);
1903
2087
  assignValid(codegen_1.nil);
1904
2088
  return validateErrs;
1905
2089
  }
2090
+ __name(validateSync, "validateSync");
1906
2091
  function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) {
1907
2092
  const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;
1908
2093
  const passSchema = !("compile" in def && !$data || def.schema === false);
1909
2094
  gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
1910
2095
  }
2096
+ __name(assignValid, "assignValid");
1911
2097
  function reportErrs(errors) {
1912
2098
  var _a2;
1913
2099
  gen.if((0, codegen_1.not)((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid), errors);
1914
2100
  }
2101
+ __name(reportErrs, "reportErrs");
1915
2102
  }
2103
+ __name(funcKeywordCode, "funcKeywordCode");
1916
2104
  exports.funcKeywordCode = funcKeywordCode;
1917
2105
  function modifyData(cxt) {
1918
2106
  const { gen, data, it } = cxt;
1919
2107
  gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`));
1920
2108
  }
2109
+ __name(modifyData, "modifyData");
1921
2110
  function addErrs(cxt, errs) {
1922
2111
  const { gen } = cxt;
1923
2112
  gen.if((0, codegen_1._)`Array.isArray(${errs})`, () => {
@@ -1925,18 +2114,22 @@ var require_keyword = __commonJS({
1925
2114
  (0, errors_1.extendErrors)(cxt);
1926
2115
  }, () => cxt.error());
1927
2116
  }
2117
+ __name(addErrs, "addErrs");
1928
2118
  function checkAsyncKeyword({ schemaEnv }, def) {
1929
2119
  if (def.async && !schemaEnv.$async)
1930
2120
  throw new Error("async keyword in sync schema");
1931
2121
  }
2122
+ __name(checkAsyncKeyword, "checkAsyncKeyword");
1932
2123
  function useKeyword(gen, keyword, result) {
1933
2124
  if (result === void 0)
1934
2125
  throw new Error(`keyword "${keyword}" failed to compile`);
1935
2126
  return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
1936
2127
  }
2128
+ __name(useKeyword, "useKeyword");
1937
2129
  function validSchemaType(schema, schemaType, allowUndefined = false) {
1938
2130
  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
2131
  }
2132
+ __name(validSchemaType, "validSchemaType");
1940
2133
  exports.validSchemaType = validSchemaType;
1941
2134
  function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {
1942
2135
  if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
@@ -1957,6 +2150,7 @@ var require_keyword = __commonJS({
1957
2150
  }
1958
2151
  }
1959
2152
  }
2153
+ __name(validateKeywordUsage, "validateKeywordUsage");
1960
2154
  exports.validateKeywordUsage = validateKeywordUsage;
1961
2155
  }
1962
2156
  });
@@ -1998,6 +2192,7 @@ var require_subschema = __commonJS({
1998
2192
  }
1999
2193
  throw new Error('either "keyword" or "schema" must be passed');
2000
2194
  }
2195
+ __name(getSubschema, "getSubschema");
2001
2196
  exports.getSubschema = getSubschema;
2002
2197
  function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
2003
2198
  if (data !== void 0 && dataProp !== void 0) {
@@ -2028,7 +2223,9 @@ var require_subschema = __commonJS({
2028
2223
  subschema.parentData = it.data;
2029
2224
  subschema.dataNames = [...it.dataNames, _nextData];
2030
2225
  }
2226
+ __name(dataContextProps, "dataContextProps");
2031
2227
  }
2228
+ __name(extendSubschemaData, "extendSubschemaData");
2032
2229
  exports.extendSubschemaData = extendSubschemaData;
2033
2230
  function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
2034
2231
  if (compositeRule !== void 0)
@@ -2040,6 +2237,7 @@ var require_subschema = __commonJS({
2040
2237
  subschema.jtdDiscriminator = jtdDiscriminator;
2041
2238
  subschema.jtdMetadata = jtdMetadata;
2042
2239
  }
2240
+ __name(extendSubschemaMode, "extendSubschemaMode");
2043
2241
  exports.extendSubschemaMode = extendSubschemaMode;
2044
2242
  }
2045
2243
  });
@@ -2048,7 +2246,7 @@ var require_subschema = __commonJS({
2048
2246
  var require_fast_deep_equal = __commonJS({
2049
2247
  "node_modules/fast-deep-equal/index.js"(exports, module) {
2050
2248
  "use strict";
2051
- module.exports = function equal(a, b) {
2249
+ module.exports = /* @__PURE__ */ __name(function equal(a, b) {
2052
2250
  if (a === b)
2053
2251
  return true;
2054
2252
  if (a && b && typeof a == "object" && typeof b == "object") {
@@ -2085,7 +2283,7 @@ var require_fast_deep_equal = __commonJS({
2085
2283
  return true;
2086
2284
  }
2087
2285
  return a !== a && b !== b;
2088
- };
2286
+ }, "equal");
2089
2287
  }
2090
2288
  });
2091
2289
 
@@ -2171,9 +2369,11 @@ var require_json_schema_traverse = __commonJS({
2171
2369
  post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
2172
2370
  }
2173
2371
  }
2372
+ __name(_traverse, "_traverse");
2174
2373
  function escapeJsonPtr(str) {
2175
2374
  return str.replace(/~/g, "~0").replace(/\//g, "~1");
2176
2375
  }
2376
+ __name(escapeJsonPtr, "escapeJsonPtr");
2177
2377
  }
2178
2378
  });
2179
2379
 
@@ -2213,6 +2413,7 @@ var require_resolve = __commonJS({
2213
2413
  return false;
2214
2414
  return countKeys(schema) <= limit;
2215
2415
  }
2416
+ __name(inlineRef, "inlineRef");
2216
2417
  exports.inlineRef = inlineRef;
2217
2418
  var REF_KEYWORDS = /* @__PURE__ */ new Set([
2218
2419
  "$ref",
@@ -2233,6 +2434,7 @@ var require_resolve = __commonJS({
2233
2434
  }
2234
2435
  return false;
2235
2436
  }
2437
+ __name(hasRef, "hasRef");
2236
2438
  function countKeys(schema) {
2237
2439
  let count = 0;
2238
2440
  for (const key in schema) {
@@ -2249,27 +2451,32 @@ var require_resolve = __commonJS({
2249
2451
  }
2250
2452
  return count;
2251
2453
  }
2454
+ __name(countKeys, "countKeys");
2252
2455
  function getFullPath(resolver, id = "", normalize) {
2253
2456
  if (normalize !== false)
2254
2457
  id = normalizeId(id);
2255
2458
  const p = resolver.parse(id);
2256
2459
  return _getFullPath(resolver, p);
2257
2460
  }
2461
+ __name(getFullPath, "getFullPath");
2258
2462
  exports.getFullPath = getFullPath;
2259
2463
  function _getFullPath(resolver, p) {
2260
2464
  const serialized = resolver.serialize(p);
2261
2465
  return serialized.split("#")[0] + "#";
2262
2466
  }
2467
+ __name(_getFullPath, "_getFullPath");
2263
2468
  exports._getFullPath = _getFullPath;
2264
2469
  var TRAILING_SLASH_HASH = /#\/?$/;
2265
2470
  function normalizeId(id) {
2266
2471
  return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
2267
2472
  }
2473
+ __name(normalizeId, "normalizeId");
2268
2474
  exports.normalizeId = normalizeId;
2269
2475
  function resolveUrl(resolver, baseId, id) {
2270
2476
  id = normalizeId(id);
2271
2477
  return resolver.resolve(baseId, id);
2272
2478
  }
2479
+ __name(resolveUrl, "resolveUrl");
2273
2480
  exports.resolveUrl = resolveUrl;
2274
2481
  var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
2275
2482
  function getSchemaRefs(schema, baseId) {
@@ -2312,6 +2519,7 @@ var require_resolve = __commonJS({
2312
2519
  }
2313
2520
  return ref;
2314
2521
  }
2522
+ __name(addRef, "addRef");
2315
2523
  function addAnchor(anchor) {
2316
2524
  if (typeof anchor == "string") {
2317
2525
  if (!ANCHOR.test(anchor))
@@ -2319,16 +2527,20 @@ var require_resolve = __commonJS({
2319
2527
  addRef.call(this, `#${anchor}`);
2320
2528
  }
2321
2529
  }
2530
+ __name(addAnchor, "addAnchor");
2322
2531
  });
2323
2532
  return localRefs;
2324
2533
  function checkAmbiguosRef(sch1, sch2, ref) {
2325
2534
  if (sch2 !== void 0 && !equal(sch1, sch2))
2326
2535
  throw ambiguos(ref);
2327
2536
  }
2537
+ __name(checkAmbiguosRef, "checkAmbiguosRef");
2328
2538
  function ambiguos(ref) {
2329
2539
  return new Error(`reference "${ref}" resolves to more than one schema`);
2330
2540
  }
2541
+ __name(ambiguos, "ambiguos");
2331
2542
  }
2543
+ __name(getSchemaRefs, "getSchemaRefs");
2332
2544
  exports.getSchemaRefs = getSchemaRefs;
2333
2545
  }
2334
2546
  });
@@ -2361,6 +2573,7 @@ var require_validate = __commonJS({
2361
2573
  }
2362
2574
  validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
2363
2575
  }
2576
+ __name(validateFunctionCode, "validateFunctionCode");
2364
2577
  exports.validateFunctionCode = validateFunctionCode;
2365
2578
  function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
2366
2579
  if (opts.code.es5) {
@@ -2373,9 +2586,11 @@ var require_validate = __commonJS({
2373
2586
  gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
2374
2587
  }
2375
2588
  }
2589
+ __name(validateFunction, "validateFunction");
2376
2590
  function destructureValCxt(opts) {
2377
2591
  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
2592
  }
2593
+ __name(destructureValCxt, "destructureValCxt");
2379
2594
  function destructureValCxtES5(gen, opts) {
2380
2595
  gen.if(names_1.default.valCxt, () => {
2381
2596
  gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`);
@@ -2393,6 +2608,7 @@ var require_validate = __commonJS({
2393
2608
  gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`);
2394
2609
  });
2395
2610
  }
2611
+ __name(destructureValCxtES5, "destructureValCxtES5");
2396
2612
  function topSchemaObjCode(it) {
2397
2613
  const { schema, opts, gen } = it;
2398
2614
  validateFunction(it, () => {
@@ -2408,16 +2624,19 @@ var require_validate = __commonJS({
2408
2624
  });
2409
2625
  return;
2410
2626
  }
2627
+ __name(topSchemaObjCode, "topSchemaObjCode");
2411
2628
  function resetEvaluated(it) {
2412
2629
  const { gen, validateName } = it;
2413
2630
  it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`);
2414
2631
  gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));
2415
2632
  gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));
2416
2633
  }
2634
+ __name(resetEvaluated, "resetEvaluated");
2417
2635
  function funcSourceUrl(schema, opts) {
2418
2636
  const schId = typeof schema == "object" && schema[opts.schemaId];
2419
2637
  return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;
2420
2638
  }
2639
+ __name(funcSourceUrl, "funcSourceUrl");
2421
2640
  function subschemaCode(it, valid) {
2422
2641
  if (isSchemaObj(it)) {
2423
2642
  checkKeywords(it);
@@ -2428,6 +2647,7 @@ var require_validate = __commonJS({
2428
2647
  }
2429
2648
  (0, boolSchema_1.boolOrEmptySchema)(it, valid);
2430
2649
  }
2650
+ __name(subschemaCode, "subschemaCode");
2431
2651
  function schemaCxtHasRules({ schema, self }) {
2432
2652
  if (typeof schema == "boolean")
2433
2653
  return !schema;
@@ -2436,9 +2656,11 @@ var require_validate = __commonJS({
2436
2656
  return true;
2437
2657
  return false;
2438
2658
  }
2659
+ __name(schemaCxtHasRules, "schemaCxtHasRules");
2439
2660
  function isSchemaObj(it) {
2440
2661
  return typeof it.schema != "boolean";
2441
2662
  }
2663
+ __name(isSchemaObj, "isSchemaObj");
2442
2664
  function subSchemaObjCode(it, valid) {
2443
2665
  const { schema, gen, opts } = it;
2444
2666
  if (opts.$comment && schema.$comment)
@@ -2449,10 +2671,12 @@ var require_validate = __commonJS({
2449
2671
  typeAndKeywords(it, errsCount);
2450
2672
  gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
2451
2673
  }
2674
+ __name(subSchemaObjCode, "subSchemaObjCode");
2452
2675
  function checkKeywords(it) {
2453
2676
  (0, util_1.checkUnknownRules)(it);
2454
2677
  checkRefsAndKeywords(it);
2455
2678
  }
2679
+ __name(checkKeywords, "checkKeywords");
2456
2680
  function typeAndKeywords(it, errsCount) {
2457
2681
  if (it.opts.jtd)
2458
2682
  return schemaKeywords(it, [], false, errsCount);
@@ -2460,27 +2684,32 @@ var require_validate = __commonJS({
2460
2684
  const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
2461
2685
  schemaKeywords(it, types, !checkedTypes, errsCount);
2462
2686
  }
2687
+ __name(typeAndKeywords, "typeAndKeywords");
2463
2688
  function checkRefsAndKeywords(it) {
2464
2689
  const { schema, errSchemaPath, opts, self } = it;
2465
2690
  if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {
2466
2691
  self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
2467
2692
  }
2468
2693
  }
2694
+ __name(checkRefsAndKeywords, "checkRefsAndKeywords");
2469
2695
  function checkNoDefault(it) {
2470
2696
  const { schema, opts } = it;
2471
2697
  if (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) {
2472
2698
  (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
2473
2699
  }
2474
2700
  }
2701
+ __name(checkNoDefault, "checkNoDefault");
2475
2702
  function updateContext(it) {
2476
2703
  const schId = it.schema[it.opts.schemaId];
2477
2704
  if (schId)
2478
2705
  it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
2479
2706
  }
2707
+ __name(updateContext, "updateContext");
2480
2708
  function checkAsyncSchema(it) {
2481
2709
  if (it.schema.$async && !it.schemaEnv.$async)
2482
2710
  throw new Error("async schema in sync schema");
2483
2711
  }
2712
+ __name(checkAsyncSchema, "checkAsyncSchema");
2484
2713
  function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {
2485
2714
  const msg = schema.$comment;
2486
2715
  if (opts.$comment === true) {
@@ -2491,6 +2720,7 @@ var require_validate = __commonJS({
2491
2720
  gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
2492
2721
  }
2493
2722
  }
2723
+ __name(commentKeyword, "commentKeyword");
2494
2724
  function returnResults(it) {
2495
2725
  const { gen, schemaEnv, validateName, ValidationError, opts } = it;
2496
2726
  if (schemaEnv.$async) {
@@ -2502,12 +2732,14 @@ var require_validate = __commonJS({
2502
2732
  gen.return((0, codegen_1._)`${names_1.default.errors} === 0`);
2503
2733
  }
2504
2734
  }
2735
+ __name(returnResults, "returnResults");
2505
2736
  function assignEvaluated({ gen, evaluated, props, items }) {
2506
2737
  if (props instanceof codegen_1.Name)
2507
2738
  gen.assign((0, codegen_1._)`${evaluated}.props`, props);
2508
2739
  if (items instanceof codegen_1.Name)
2509
2740
  gen.assign((0, codegen_1._)`${evaluated}.items`, items);
2510
2741
  }
2742
+ __name(assignEvaluated, "assignEvaluated");
2511
2743
  function schemaKeywords(it, types, typeErrors, errsCount) {
2512
2744
  const { gen, schema, data, allErrors, opts, self } = it;
2513
2745
  const { RULES } = self;
@@ -2539,7 +2771,9 @@ var require_validate = __commonJS({
2539
2771
  if (!allErrors)
2540
2772
  gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`);
2541
2773
  }
2774
+ __name(groupKeywords, "groupKeywords");
2542
2775
  }
2776
+ __name(schemaKeywords, "schemaKeywords");
2543
2777
  function iterateKeywords(it, group) {
2544
2778
  const { gen, schema, opts: { useDefaults } } = it;
2545
2779
  if (useDefaults)
@@ -2552,6 +2786,7 @@ var require_validate = __commonJS({
2552
2786
  }
2553
2787
  });
2554
2788
  }
2789
+ __name(iterateKeywords, "iterateKeywords");
2555
2790
  function checkStrictTypes(it, types) {
2556
2791
  if (it.schemaEnv.meta || !it.opts.strictTypes)
2557
2792
  return;
@@ -2560,6 +2795,7 @@ var require_validate = __commonJS({
2560
2795
  checkMultipleTypes(it, types);
2561
2796
  checkKeywordTypes(it, it.dataTypes);
2562
2797
  }
2798
+ __name(checkStrictTypes, "checkStrictTypes");
2563
2799
  function checkContextTypes(it, types) {
2564
2800
  if (!types.length)
2565
2801
  return;
@@ -2574,11 +2810,13 @@ var require_validate = __commonJS({
2574
2810
  });
2575
2811
  narrowSchemaTypes(it, types);
2576
2812
  }
2813
+ __name(checkContextTypes, "checkContextTypes");
2577
2814
  function checkMultipleTypes(it, ts) {
2578
2815
  if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
2579
2816
  strictTypesError(it, "use allowUnionTypes to allow union type keyword");
2580
2817
  }
2581
2818
  }
2819
+ __name(checkMultipleTypes, "checkMultipleTypes");
2582
2820
  function checkKeywordTypes(it, ts) {
2583
2821
  const rules = it.self.RULES.all;
2584
2822
  for (const keyword in rules) {
@@ -2591,12 +2829,15 @@ var require_validate = __commonJS({
2591
2829
  }
2592
2830
  }
2593
2831
  }
2832
+ __name(checkKeywordTypes, "checkKeywordTypes");
2594
2833
  function hasApplicableType(schTs, kwdT) {
2595
2834
  return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
2596
2835
  }
2836
+ __name(hasApplicableType, "hasApplicableType");
2597
2837
  function includesType(ts, t) {
2598
2838
  return ts.includes(t) || t === "integer" && ts.includes("number");
2599
2839
  }
2840
+ __name(includesType, "includesType");
2600
2841
  function narrowSchemaTypes(it, withTypes) {
2601
2842
  const ts = [];
2602
2843
  for (const t of it.dataTypes) {
@@ -2607,12 +2848,17 @@ var require_validate = __commonJS({
2607
2848
  }
2608
2849
  it.dataTypes = ts;
2609
2850
  }
2851
+ __name(narrowSchemaTypes, "narrowSchemaTypes");
2610
2852
  function strictTypesError(it, msg) {
2611
2853
  const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
2612
2854
  msg += ` at "${schemaPath}" (strictTypes)`;
2613
2855
  (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
2614
2856
  }
2857
+ __name(strictTypesError, "strictTypesError");
2615
2858
  var KeywordCxt = class {
2859
+ static {
2860
+ __name(this, "KeywordCxt");
2861
+ }
2616
2862
  constructor(it, def, keyword) {
2617
2863
  (0, keyword_1.validateKeywordUsage)(it, def, keyword);
2618
2864
  this.gen = it.gen;
@@ -2747,6 +2993,7 @@ var require_validate = __commonJS({
2747
2993
  }
2748
2994
  return codegen_1.nil;
2749
2995
  }
2996
+ __name(wrong$DataType, "wrong$DataType");
2750
2997
  function invalid$DataSchema() {
2751
2998
  if (def.validateSchema) {
2752
2999
  const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema });
@@ -2754,6 +3001,7 @@ var require_validate = __commonJS({
2754
3001
  }
2755
3002
  return codegen_1.nil;
2756
3003
  }
3004
+ __name(invalid$DataSchema, "invalid$DataSchema");
2757
3005
  }
2758
3006
  subschema(appl, valid) {
2759
3007
  const subschema = (0, subschema_1.getSubschema)(this.it, appl);
@@ -2795,6 +3043,7 @@ var require_validate = __commonJS({
2795
3043
  (0, keyword_1.funcKeywordCode)(cxt, def);
2796
3044
  }
2797
3045
  }
3046
+ __name(keywordCode, "keywordCode");
2798
3047
  var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
2799
3048
  var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
2800
3049
  function getData($data, { dataLevel, dataNames, dataPathArr }) {
@@ -2836,7 +3085,9 @@ var require_validate = __commonJS({
2836
3085
  function errorMsg(pointerType, up) {
2837
3086
  return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
2838
3087
  }
3088
+ __name(errorMsg, "errorMsg");
2839
3089
  }
3090
+ __name(getData, "getData");
2840
3091
  exports.getData = getData;
2841
3092
  }
2842
3093
  });
@@ -2847,6 +3098,9 @@ var require_validation_error = __commonJS({
2847
3098
  "use strict";
2848
3099
  Object.defineProperty(exports, "__esModule", { value: true });
2849
3100
  var ValidationError = class extends Error {
3101
+ static {
3102
+ __name(this, "ValidationError");
3103
+ }
2850
3104
  constructor(errors) {
2851
3105
  super("validation failed");
2852
3106
  this.errors = errors;
@@ -2864,6 +3118,9 @@ var require_ref_error = __commonJS({
2864
3118
  Object.defineProperty(exports, "__esModule", { value: true });
2865
3119
  var resolve_1 = require_resolve();
2866
3120
  var MissingRefError = class extends Error {
3121
+ static {
3122
+ __name(this, "MissingRefError");
3123
+ }
2867
3124
  constructor(resolver, baseId, ref, msg) {
2868
3125
  super(msg || `can't resolve reference ${ref} from id ${baseId}`);
2869
3126
  this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);
@@ -2887,6 +3144,9 @@ var require_compile = __commonJS({
2887
3144
  var util_1 = require_util();
2888
3145
  var validate_1 = require_validate();
2889
3146
  var SchemaEnv = class {
3147
+ static {
3148
+ __name(this, "SchemaEnv");
3149
+ }
2890
3150
  constructor(env) {
2891
3151
  var _a;
2892
3152
  this.refs = {};
@@ -2990,6 +3250,7 @@ var require_compile = __commonJS({
2990
3250
  this._compilations.delete(sch);
2991
3251
  }
2992
3252
  }
3253
+ __name(compileSchema, "compileSchema");
2993
3254
  exports.compileSchema = compileSchema;
2994
3255
  function resolveRef(root, baseId, ref) {
2995
3256
  var _a;
@@ -3008,28 +3269,33 @@ var require_compile = __commonJS({
3008
3269
  return;
3009
3270
  return root.refs[ref] = inlineOrCompile.call(this, _sch);
3010
3271
  }
3272
+ __name(resolveRef, "resolveRef");
3011
3273
  exports.resolveRef = resolveRef;
3012
3274
  function inlineOrCompile(sch) {
3013
3275
  if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
3014
3276
  return sch.schema;
3015
3277
  return sch.validate ? sch : compileSchema.call(this, sch);
3016
3278
  }
3279
+ __name(inlineOrCompile, "inlineOrCompile");
3017
3280
  function getCompilingSchema(schEnv) {
3018
3281
  for (const sch of this._compilations) {
3019
3282
  if (sameSchemaEnv(sch, schEnv))
3020
3283
  return sch;
3021
3284
  }
3022
3285
  }
3286
+ __name(getCompilingSchema, "getCompilingSchema");
3023
3287
  exports.getCompilingSchema = getCompilingSchema;
3024
3288
  function sameSchemaEnv(s1, s2) {
3025
3289
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
3026
3290
  }
3291
+ __name(sameSchemaEnv, "sameSchemaEnv");
3027
3292
  function resolve(root, ref) {
3028
3293
  let sch;
3029
3294
  while (typeof (sch = this.refs[ref]) == "string")
3030
3295
  ref = sch;
3031
3296
  return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
3032
3297
  }
3298
+ __name(resolve, "resolve");
3033
3299
  function resolveSchema(root, ref) {
3034
3300
  const p = this.opts.uriResolver.parse(ref);
3035
3301
  const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
@@ -3059,6 +3325,7 @@ var require_compile = __commonJS({
3059
3325
  }
3060
3326
  return getJsonPointer.call(this, p, schOrRef);
3061
3327
  }
3328
+ __name(resolveSchema, "resolveSchema");
3062
3329
  exports.resolveSchema = resolveSchema;
3063
3330
  var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([
3064
3331
  "properties",
@@ -3094,6 +3361,7 @@ var require_compile = __commonJS({
3094
3361
  return env;
3095
3362
  return void 0;
3096
3363
  }
3364
+ __name(getJsonPointer, "getJsonPointer");
3097
3365
  }
3098
3366
  });
3099
3367
 
@@ -3139,18 +3407,23 @@ var require_uri_all = __commonJS({
3139
3407
  return sets[0];
3140
3408
  }
3141
3409
  }
3410
+ __name(merge, "merge");
3142
3411
  function subexp(str) {
3143
3412
  return "(?:" + str + ")";
3144
3413
  }
3414
+ __name(subexp, "subexp");
3145
3415
  function typeOf(o) {
3146
3416
  return o === void 0 ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
3147
3417
  }
3418
+ __name(typeOf, "typeOf");
3148
3419
  function toUpperCase(str) {
3149
3420
  return str.toUpperCase();
3150
3421
  }
3422
+ __name(toUpperCase, "toUpperCase");
3151
3423
  function toArray(obj) {
3152
3424
  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) : [];
3153
3425
  }
3426
+ __name(toArray, "toArray");
3154
3427
  function assign(target, source) {
3155
3428
  var obj = target;
3156
3429
  if (source) {
@@ -3160,6 +3433,7 @@ var require_uri_all = __commonJS({
3160
3433
  }
3161
3434
  return obj;
3162
3435
  }
3436
+ __name(assign, "assign");
3163
3437
  function buildExps(isIRI2) {
3164
3438
  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$ + ")") + "?$";
3165
3439
  return {
@@ -3179,6 +3453,7 @@ var require_uri_all = __commonJS({
3179
3453
  //RFC 6874, with relaxed parsing rules
3180
3454
  };
3181
3455
  }
3456
+ __name(buildExps, "buildExps");
3182
3457
  var URI_PROTOCOL = buildExps(false);
3183
3458
  var IRI_PROTOCOL = buildExps(true);
3184
3459
  var slicedToArray = function() {
@@ -3207,6 +3482,7 @@ var require_uri_all = __commonJS({
3207
3482
  }
3208
3483
  return _arr;
3209
3484
  }
3485
+ __name(sliceIterator, "sliceIterator");
3210
3486
  return function(arr, i) {
3211
3487
  if (Array.isArray(arr)) {
3212
3488
  return arr;
@@ -3217,7 +3493,7 @@ var require_uri_all = __commonJS({
3217
3493
  }
3218
3494
  };
3219
3495
  }();
3220
- var toConsumableArray = function(arr) {
3496
+ var toConsumableArray = /* @__PURE__ */ __name(function(arr) {
3221
3497
  if (Array.isArray(arr)) {
3222
3498
  for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++)
3223
3499
  arr2[i] = arr[i];
@@ -3225,7 +3501,7 @@ var require_uri_all = __commonJS({
3225
3501
  } else {
3226
3502
  return Array.from(arr);
3227
3503
  }
3228
- };
3504
+ }, "toConsumableArray");
3229
3505
  var maxInt = 2147483647;
3230
3506
  var base = 36;
3231
3507
  var tMin = 1;
@@ -3249,6 +3525,7 @@ var require_uri_all = __commonJS({
3249
3525
  function error$1(type) {
3250
3526
  throw new RangeError(errors[type]);
3251
3527
  }
3528
+ __name(error$1, "error$1");
3252
3529
  function map(array, fn) {
3253
3530
  var result = [];
3254
3531
  var length = array.length;
@@ -3257,6 +3534,7 @@ var require_uri_all = __commonJS({
3257
3534
  }
3258
3535
  return result;
3259
3536
  }
3537
+ __name(map, "map");
3260
3538
  function mapDomain(string, fn) {
3261
3539
  var parts = string.split("@");
3262
3540
  var result = "";
@@ -3269,6 +3547,7 @@ var require_uri_all = __commonJS({
3269
3547
  var encoded = map(labels, fn).join(".");
3270
3548
  return result + encoded;
3271
3549
  }
3550
+ __name(mapDomain, "mapDomain");
3272
3551
  function ucs2decode(string) {
3273
3552
  var output = [];
3274
3553
  var counter = 0;
@@ -3289,10 +3568,11 @@ var require_uri_all = __commonJS({
3289
3568
  }
3290
3569
  return output;
3291
3570
  }
3292
- var ucs2encode = function ucs2encode2(array) {
3571
+ __name(ucs2decode, "ucs2decode");
3572
+ var ucs2encode = /* @__PURE__ */ __name(function ucs2encode2(array) {
3293
3573
  return String.fromCodePoint.apply(String, toConsumableArray(array));
3294
- };
3295
- var basicToDigit = function basicToDigit2(codePoint) {
3574
+ }, "ucs2encode");
3575
+ var basicToDigit = /* @__PURE__ */ __name(function basicToDigit2(codePoint) {
3296
3576
  if (codePoint - 48 < 10) {
3297
3577
  return codePoint - 22;
3298
3578
  }
@@ -3303,11 +3583,11 @@ var require_uri_all = __commonJS({
3303
3583
  return codePoint - 97;
3304
3584
  }
3305
3585
  return base;
3306
- };
3307
- var digitToBasic = function digitToBasic2(digit, flag) {
3586
+ }, "basicToDigit");
3587
+ var digitToBasic = /* @__PURE__ */ __name(function digitToBasic2(digit, flag) {
3308
3588
  return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
3309
- };
3310
- var adapt = function adapt2(delta, numPoints, firstTime) {
3589
+ }, "digitToBasic");
3590
+ var adapt = /* @__PURE__ */ __name(function adapt2(delta, numPoints, firstTime) {
3311
3591
  var k = 0;
3312
3592
  delta = firstTime ? floor(delta / damp) : delta >> 1;
3313
3593
  delta += floor(delta / numPoints);
@@ -3320,8 +3600,8 @@ var require_uri_all = __commonJS({
3320
3600
  delta = floor(delta / baseMinusTMin);
3321
3601
  }
3322
3602
  return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
3323
- };
3324
- var decode = function decode2(input) {
3603
+ }, "adapt");
3604
+ var decode = /* @__PURE__ */ __name(function decode2(input) {
3325
3605
  var output = [];
3326
3606
  var inputLength = input.length;
3327
3607
  var i = 0;
@@ -3373,8 +3653,8 @@ var require_uri_all = __commonJS({
3373
3653
  output.splice(i++, 0, n);
3374
3654
  }
3375
3655
  return String.fromCodePoint.apply(String, output);
3376
- };
3377
- var encode = function encode2(input) {
3656
+ }, "decode");
3657
+ var encode = /* @__PURE__ */ __name(function encode2(input) {
3378
3658
  var output = [];
3379
3659
  input = ucs2decode(input);
3380
3660
  var inputLength = input.length;
@@ -3492,17 +3772,17 @@ var require_uri_all = __commonJS({
3492
3772
  ++n;
3493
3773
  }
3494
3774
  return output.join("");
3495
- };
3496
- var toUnicode = function toUnicode2(input) {
3775
+ }, "encode");
3776
+ var toUnicode = /* @__PURE__ */ __name(function toUnicode2(input) {
3497
3777
  return mapDomain(input, function(string) {
3498
3778
  return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
3499
3779
  });
3500
- };
3501
- var toASCII = function toASCII2(input) {
3780
+ }, "toUnicode");
3781
+ var toASCII = /* @__PURE__ */ __name(function toASCII2(input) {
3502
3782
  return mapDomain(input, function(string) {
3503
3783
  return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
3504
3784
  });
3505
- };
3785
+ }, "toASCII");
3506
3786
  var punycode = {
3507
3787
  /**
3508
3788
  * A string representing the current Punycode.js version number.
@@ -3540,6 +3820,7 @@ var require_uri_all = __commonJS({
3540
3820
  e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
3541
3821
  return e;
3542
3822
  }
3823
+ __name(pctEncChar, "pctEncChar");
3543
3824
  function pctDecChars(str) {
3544
3825
  var newStr = "";
3545
3826
  var i = 0;
@@ -3573,11 +3854,13 @@ var require_uri_all = __commonJS({
3573
3854
  }
3574
3855
  return newStr;
3575
3856
  }
3857
+ __name(pctDecChars, "pctDecChars");
3576
3858
  function _normalizeComponentEncoding(components, protocol) {
3577
3859
  function decodeUnreserved2(str) {
3578
3860
  var decStr = pctDecChars(str);
3579
3861
  return !decStr.match(protocol.UNRESERVED) ? str : decStr;
3580
3862
  }
3863
+ __name(decodeUnreserved2, "decodeUnreserved");
3581
3864
  if (components.scheme)
3582
3865
  components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_SCHEME, "");
3583
3866
  if (components.userinfo !== void 0)
@@ -3592,9 +3875,11 @@ var require_uri_all = __commonJS({
3592
3875
  components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3593
3876
  return components;
3594
3877
  }
3878
+ __name(_normalizeComponentEncoding, "_normalizeComponentEncoding");
3595
3879
  function _stripLeadingZeros(str) {
3596
3880
  return str.replace(/^0*(.*)/, "$1") || "0";
3597
3881
  }
3882
+ __name(_stripLeadingZeros, "_stripLeadingZeros");
3598
3883
  function _normalizeIPv4(host, protocol) {
3599
3884
  var matches = host.match(protocol.IPV4ADDRESS) || [];
3600
3885
  var _matches = slicedToArray(matches, 2), address = _matches[1];
@@ -3604,6 +3889,7 @@ var require_uri_all = __commonJS({
3604
3889
  return host;
3605
3890
  }
3606
3891
  }
3892
+ __name(_normalizeIPv4, "_normalizeIPv4");
3607
3893
  function _normalizeIPv6(host, protocol) {
3608
3894
  var matches = host.match(protocol.IPV6ADDRESS) || [];
3609
3895
  var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2];
@@ -3651,6 +3937,7 @@ var require_uri_all = __commonJS({
3651
3937
  return host;
3652
3938
  }
3653
3939
  }
3940
+ __name(_normalizeIPv6, "_normalizeIPv6");
3654
3941
  var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
3655
3942
  var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0;
3656
3943
  function parse(uriString) {
@@ -3720,6 +4007,7 @@ var require_uri_all = __commonJS({
3720
4007
  }
3721
4008
  return components;
3722
4009
  }
4010
+ __name(parse, "parse");
3723
4011
  function _recomposeAuthority(components, options) {
3724
4012
  var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
3725
4013
  var uriTokens = [];
@@ -3738,6 +4026,7 @@ var require_uri_all = __commonJS({
3738
4026
  }
3739
4027
  return uriTokens.length ? uriTokens.join("") : void 0;
3740
4028
  }
4029
+ __name(_recomposeAuthority, "_recomposeAuthority");
3741
4030
  var RDS1 = /^\.\.?\//;
3742
4031
  var RDS2 = /^\/\.(\/|$)/;
3743
4032
  var RDS3 = /^\/\.\.(\/|$)/;
@@ -3767,6 +4056,7 @@ var require_uri_all = __commonJS({
3767
4056
  }
3768
4057
  return output.join("");
3769
4058
  }
4059
+ __name(removeDotSegments, "removeDotSegments");
3770
4060
  function serialize(components) {
3771
4061
  var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3772
4062
  var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
@@ -3819,6 +4109,7 @@ var require_uri_all = __commonJS({
3819
4109
  }
3820
4110
  return uriTokens.join("");
3821
4111
  }
4112
+ __name(serialize, "serialize");
3822
4113
  function resolveComponents(base2, relative) {
3823
4114
  var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3824
4115
  var skipNormalization = arguments[3];
@@ -3874,10 +4165,12 @@ var require_uri_all = __commonJS({
3874
4165
  target.fragment = relative.fragment;
3875
4166
  return target;
3876
4167
  }
4168
+ __name(resolveComponents, "resolveComponents");
3877
4169
  function resolve(baseURI, relativeURI, options) {
3878
4170
  var schemelessOptions = assign({ scheme: "null" }, options);
3879
4171
  return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
3880
4172
  }
4173
+ __name(resolve, "resolve");
3881
4174
  function normalize(uri, options) {
3882
4175
  if (typeof uri === "string") {
3883
4176
  uri = serialize(parse(uri, options), options);
@@ -3886,6 +4179,7 @@ var require_uri_all = __commonJS({
3886
4179
  }
3887
4180
  return uri;
3888
4181
  }
4182
+ __name(normalize, "normalize");
3889
4183
  function equal(uriA, uriB, options) {
3890
4184
  if (typeof uriA === "string") {
3891
4185
  uriA = serialize(parse(uriA, options), options);
@@ -3899,22 +4193,25 @@ var require_uri_all = __commonJS({
3899
4193
  }
3900
4194
  return uriA === uriB;
3901
4195
  }
4196
+ __name(equal, "equal");
3902
4197
  function escapeComponent(str, options) {
3903
4198
  return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
3904
4199
  }
4200
+ __name(escapeComponent, "escapeComponent");
3905
4201
  function unescapeComponent(str, options) {
3906
4202
  return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
3907
4203
  }
4204
+ __name(unescapeComponent, "unescapeComponent");
3908
4205
  var handler = {
3909
4206
  scheme: "http",
3910
4207
  domainHost: true,
3911
- parse: function parse2(components, options) {
4208
+ parse: /* @__PURE__ */ __name(function parse2(components, options) {
3912
4209
  if (!components.host) {
3913
4210
  components.error = components.error || "HTTP URIs must have a host.";
3914
4211
  }
3915
4212
  return components;
3916
- },
3917
- serialize: function serialize2(components, options) {
4213
+ }, "parse"),
4214
+ serialize: /* @__PURE__ */ __name(function serialize2(components, options) {
3918
4215
  var secure = String(components.scheme).toLowerCase() === "https";
3919
4216
  if (components.port === (secure ? 443 : 80) || components.port === "") {
3920
4217
  components.port = void 0;
@@ -3923,7 +4220,7 @@ var require_uri_all = __commonJS({
3923
4220
  components.path = "/";
3924
4221
  }
3925
4222
  return components;
3926
- }
4223
+ }, "serialize")
3927
4224
  };
3928
4225
  var handler$1 = {
3929
4226
  scheme: "https",
@@ -3934,18 +4231,19 @@ var require_uri_all = __commonJS({
3934
4231
  function isSecure(wsComponents) {
3935
4232
  return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
3936
4233
  }
4234
+ __name(isSecure, "isSecure");
3937
4235
  var handler$2 = {
3938
4236
  scheme: "ws",
3939
4237
  domainHost: true,
3940
- parse: function parse2(components, options) {
4238
+ parse: /* @__PURE__ */ __name(function parse2(components, options) {
3941
4239
  var wsComponents = components;
3942
4240
  wsComponents.secure = isSecure(wsComponents);
3943
4241
  wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
3944
4242
  wsComponents.path = void 0;
3945
4243
  wsComponents.query = void 0;
3946
4244
  return wsComponents;
3947
- },
3948
- serialize: function serialize2(wsComponents, options) {
4245
+ }, "parse"),
4246
+ serialize: /* @__PURE__ */ __name(function serialize2(wsComponents, options) {
3949
4247
  if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
3950
4248
  wsComponents.port = void 0;
3951
4249
  }
@@ -3961,7 +4259,7 @@ var require_uri_all = __commonJS({
3961
4259
  }
3962
4260
  wsComponents.fragment = void 0;
3963
4261
  return wsComponents;
3964
- }
4262
+ }, "serialize")
3965
4263
  };
3966
4264
  var handler$3 = {
3967
4265
  scheme: "wss",
@@ -3987,9 +4285,10 @@ var require_uri_all = __commonJS({
3987
4285
  var decStr = pctDecChars(str);
3988
4286
  return !decStr.match(UNRESERVED) ? str : decStr;
3989
4287
  }
4288
+ __name(decodeUnreserved, "decodeUnreserved");
3990
4289
  var handler$4 = {
3991
4290
  scheme: "mailto",
3992
- parse: function parse$$1(components, options) {
4291
+ parse: /* @__PURE__ */ __name(function parse$$1(components, options) {
3993
4292
  var mailtoComponents = components;
3994
4293
  var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
3995
4294
  mailtoComponents.path = void 0;
@@ -4037,8 +4336,8 @@ var require_uri_all = __commonJS({
4037
4336
  to[_x2] = addr.join("@");
4038
4337
  }
4039
4338
  return mailtoComponents;
4040
- },
4041
- serialize: function serialize$$1(mailtoComponents, options) {
4339
+ }, "parse$$1"),
4340
+ serialize: /* @__PURE__ */ __name(function serialize$$1(mailtoComponents, options) {
4042
4341
  var components = mailtoComponents;
4043
4342
  var to = toArray(mailtoComponents.to);
4044
4343
  if (to) {
@@ -4071,12 +4370,12 @@ var require_uri_all = __commonJS({
4071
4370
  components.query = fields.join("&");
4072
4371
  }
4073
4372
  return components;
4074
- }
4373
+ }, "serialize$$1")
4075
4374
  };
4076
4375
  var URN_PARSE = /^([^\:]+)\:(.*)/;
4077
4376
  var handler$5 = {
4078
4377
  scheme: "urn",
4079
- parse: function parse$$1(components, options) {
4378
+ parse: /* @__PURE__ */ __name(function parse$$1(components, options) {
4080
4379
  var matches = components.path && components.path.match(URN_PARSE);
4081
4380
  var urnComponents = components;
4082
4381
  if (matches) {
@@ -4095,8 +4394,8 @@ var require_uri_all = __commonJS({
4095
4394
  urnComponents.error = urnComponents.error || "URN can not be parsed.";
4096
4395
  }
4097
4396
  return urnComponents;
4098
- },
4099
- serialize: function serialize$$1(urnComponents, options) {
4397
+ }, "parse$$1"),
4398
+ serialize: /* @__PURE__ */ __name(function serialize$$1(urnComponents, options) {
4100
4399
  var scheme = options.scheme || urnComponents.scheme || "urn";
4101
4400
  var nid = urnComponents.nid;
4102
4401
  var urnScheme = scheme + ":" + (options.nid || nid);
@@ -4108,12 +4407,12 @@ var require_uri_all = __commonJS({
4108
4407
  var nss = urnComponents.nss;
4109
4408
  uriComponents.path = (nid || options.nid) + ":" + nss;
4110
4409
  return uriComponents;
4111
- }
4410
+ }, "serialize$$1")
4112
4411
  };
4113
4412
  var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
4114
4413
  var handler$6 = {
4115
4414
  scheme: "urn:uuid",
4116
- parse: function parse2(urnComponents, options) {
4415
+ parse: /* @__PURE__ */ __name(function parse2(urnComponents, options) {
4117
4416
  var uuidComponents = urnComponents;
4118
4417
  uuidComponents.uuid = uuidComponents.nss;
4119
4418
  uuidComponents.nss = void 0;
@@ -4121,12 +4420,12 @@ var require_uri_all = __commonJS({
4121
4420
  uuidComponents.error = uuidComponents.error || "UUID is not valid.";
4122
4421
  }
4123
4422
  return uuidComponents;
4124
- },
4125
- serialize: function serialize2(uuidComponents, options) {
4423
+ }, "parse"),
4424
+ serialize: /* @__PURE__ */ __name(function serialize2(uuidComponents, options) {
4126
4425
  var urnComponents = uuidComponents;
4127
4426
  urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
4128
4427
  return urnComponents;
4129
- }
4428
+ }, "serialize")
4130
4429
  };
4131
4430
  SCHEMES[handler.scheme] = handler;
4132
4431
  SCHEMES[handler$1.scheme] = handler$1;
@@ -4202,7 +4501,7 @@ var require_core = __commonJS({
4202
4501
  var util_1 = require_util();
4203
4502
  var $dataRefSchema = require_data();
4204
4503
  var uri_1 = require_uri();
4205
- var defaultRegExp = (str, flags) => new RegExp(str, flags);
4504
+ var defaultRegExp = /* @__PURE__ */ __name((str, flags) => new RegExp(str, flags), "defaultRegExp");
4206
4505
  defaultRegExp.code = "new RegExp";
4207
4506
  var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
4208
4507
  var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([
@@ -4271,7 +4570,11 @@ var require_core = __commonJS({
4271
4570
  uriResolver
4272
4571
  };
4273
4572
  }
4573
+ __name(requiredOptions, "requiredOptions");
4274
4574
  var Ajv = class {
4575
+ static {
4576
+ __name(this, "Ajv");
4577
+ }
4275
4578
  constructor(opts = {}) {
4276
4579
  this.schemas = {};
4277
4580
  this.refs = {};
@@ -4347,11 +4650,13 @@ var require_core = __commonJS({
4347
4650
  const sch = this._addSchema(_schema, _meta);
4348
4651
  return sch.validate || _compileAsync.call(this, sch);
4349
4652
  }
4653
+ __name(runCompileAsync, "runCompileAsync");
4350
4654
  async function loadMetaSchema($ref) {
4351
4655
  if ($ref && !this.getSchema($ref)) {
4352
4656
  await runCompileAsync.call(this, { $ref }, true);
4353
4657
  }
4354
4658
  }
4659
+ __name(loadMetaSchema, "loadMetaSchema");
4355
4660
  async function _compileAsync(sch) {
4356
4661
  try {
4357
4662
  return this._compileSchemaEnv(sch);
@@ -4363,11 +4668,13 @@ var require_core = __commonJS({
4363
4668
  return _compileAsync.call(this, sch);
4364
4669
  }
4365
4670
  }
4671
+ __name(_compileAsync, "_compileAsync");
4366
4672
  function checkLoaded({ missingSchema: ref, missingRef }) {
4367
4673
  if (this.refs[ref]) {
4368
4674
  throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);
4369
4675
  }
4370
4676
  }
4677
+ __name(checkLoaded, "checkLoaded");
4371
4678
  async function loadMissingSchema(ref) {
4372
4679
  const _schema = await _loadSchema.call(this, ref);
4373
4680
  if (!this.refs[ref])
@@ -4375,6 +4682,7 @@ var require_core = __commonJS({
4375
4682
  if (!this.refs[ref])
4376
4683
  this.addSchema(_schema, ref, meta);
4377
4684
  }
4685
+ __name(loadMissingSchema, "loadMissingSchema");
4378
4686
  async function _loadSchema(ref) {
4379
4687
  const p = this._loading[ref];
4380
4688
  if (p)
@@ -4385,6 +4693,7 @@ var require_core = __commonJS({
4385
4693
  delete this._loading[ref];
4386
4694
  }
4387
4695
  }
4696
+ __name(_loadSchema, "_loadSchema");
4388
4697
  }
4389
4698
  // Adds schema to the instance
4390
4699
  addSchema(schema, key, _meta, _validateSchema = this.opts.validateSchema) {
@@ -4651,10 +4960,12 @@ var require_core = __commonJS({
4651
4960
  this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
4652
4961
  }
4653
4962
  }
4963
+ __name(checkOptions, "checkOptions");
4654
4964
  function getSchEnv(keyRef) {
4655
4965
  keyRef = (0, resolve_1.normalizeId)(keyRef);
4656
4966
  return this.schemas[keyRef] || this.refs[keyRef];
4657
4967
  }
4968
+ __name(getSchEnv, "getSchEnv");
4658
4969
  function addInitialSchemas() {
4659
4970
  const optsSchemas = this.opts.schemas;
4660
4971
  if (!optsSchemas)
@@ -4665,6 +4976,7 @@ var require_core = __commonJS({
4665
4976
  for (const key in optsSchemas)
4666
4977
  this.addSchema(optsSchemas[key], key);
4667
4978
  }
4979
+ __name(addInitialSchemas, "addInitialSchemas");
4668
4980
  function addInitialFormats() {
4669
4981
  for (const name in this.opts.formats) {
4670
4982
  const format = this.opts.formats[name];
@@ -4672,6 +4984,7 @@ var require_core = __commonJS({
4672
4984
  this.addFormat(name, format);
4673
4985
  }
4674
4986
  }
4987
+ __name(addInitialFormats, "addInitialFormats");
4675
4988
  function addInitialKeywords(defs) {
4676
4989
  if (Array.isArray(defs)) {
4677
4990
  this.addVocabulary(defs);
@@ -4685,12 +4998,14 @@ var require_core = __commonJS({
4685
4998
  this.addKeyword(def);
4686
4999
  }
4687
5000
  }
5001
+ __name(addInitialKeywords, "addInitialKeywords");
4688
5002
  function getMetaSchemaOptions() {
4689
5003
  const metaOpts = { ...this.opts };
4690
5004
  for (const opt of META_IGNORE_OPTIONS)
4691
5005
  delete metaOpts[opt];
4692
5006
  return metaOpts;
4693
5007
  }
5008
+ __name(getMetaSchemaOptions, "getMetaSchemaOptions");
4694
5009
  var noLogs = { log() {
4695
5010
  }, warn() {
4696
5011
  }, error() {
@@ -4704,6 +5019,7 @@ var require_core = __commonJS({
4704
5019
  return logger;
4705
5020
  throw new Error("logger must implement log, warn and error methods");
4706
5021
  }
5022
+ __name(getLogger, "getLogger");
4707
5023
  var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
4708
5024
  function checkKeyword(keyword, def) {
4709
5025
  const { RULES } = this;
@@ -4719,6 +5035,7 @@ var require_core = __commonJS({
4719
5035
  throw new Error('$data keyword must have "code" or "validate" function');
4720
5036
  }
4721
5037
  }
5038
+ __name(checkKeyword, "checkKeyword");
4722
5039
  function addRule(keyword, definition, dataType) {
4723
5040
  var _a;
4724
5041
  const post = definition === null || definition === void 0 ? void 0 : definition.post;
@@ -4748,6 +5065,7 @@ var require_core = __commonJS({
4748
5065
  RULES.all[keyword] = rule;
4749
5066
  (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
4750
5067
  }
5068
+ __name(addRule, "addRule");
4751
5069
  function addBeforeRule(ruleGroup, rule, before) {
4752
5070
  const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
4753
5071
  if (i >= 0) {
@@ -4757,6 +5075,7 @@ var require_core = __commonJS({
4757
5075
  this.logger.warn(`rule ${before} is not defined`);
4758
5076
  }
4759
5077
  }
5078
+ __name(addBeforeRule, "addBeforeRule");
4760
5079
  function keywordMetaschema(def) {
4761
5080
  let { metaSchema } = def;
4762
5081
  if (metaSchema === void 0)
@@ -4765,12 +5084,14 @@ var require_core = __commonJS({
4765
5084
  metaSchema = schemaOrData(metaSchema);
4766
5085
  def.validateSchema = this.compile(metaSchema, true);
4767
5086
  }
5087
+ __name(keywordMetaschema, "keywordMetaschema");
4768
5088
  var $dataRef = {
4769
5089
  $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
4770
5090
  };
4771
5091
  function schemaOrData(schema) {
4772
5092
  return { anyOf: [schema, $dataRef] };
4773
5093
  }
5094
+ __name(schemaOrData, "schemaOrData");
4774
5095
  }
4775
5096
  });
4776
5097
 
@@ -4822,10 +5143,12 @@ var require_ref = __commonJS({
4822
5143
  const rootName = gen.scopeValue("root", { ref: root });
4823
5144
  return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
4824
5145
  }
5146
+ __name(callRootRef, "callRootRef");
4825
5147
  function callValidate(sch) {
4826
5148
  const v = getValidate(cxt, sch);
4827
5149
  callRef(cxt, v, sch, sch.$async);
4828
5150
  }
5151
+ __name(callValidate, "callValidate");
4829
5152
  function inlineRefSchema(sch) {
4830
5153
  const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
4831
5154
  const valid = gen.name("valid");
@@ -4839,12 +5162,14 @@ var require_ref = __commonJS({
4839
5162
  cxt.mergeEvaluated(schCxt);
4840
5163
  cxt.ok(valid);
4841
5164
  }
5165
+ __name(inlineRefSchema, "inlineRefSchema");
4842
5166
  }
4843
5167
  };
4844
5168
  function getValidate(cxt, sch) {
4845
5169
  const { gen } = cxt;
4846
5170
  return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
4847
5171
  }
5172
+ __name(getValidate, "getValidate");
4848
5173
  exports.getValidate = getValidate;
4849
5174
  function callRef(cxt, v, sch, $async) {
4850
5175
  const { gen, it } = cxt;
@@ -4871,14 +5196,17 @@ var require_ref = __commonJS({
4871
5196
  });
4872
5197
  cxt.ok(valid);
4873
5198
  }
5199
+ __name(callAsyncRef, "callAsyncRef");
4874
5200
  function callSyncRef() {
4875
5201
  cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
4876
5202
  }
5203
+ __name(callSyncRef, "callSyncRef");
4877
5204
  function addErrorsFrom(source) {
4878
5205
  const errs = (0, codegen_1._)`${source}.errors`;
4879
5206
  gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`);
4880
5207
  gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
4881
5208
  }
5209
+ __name(addErrorsFrom, "addErrorsFrom");
4882
5210
  function addEvaluatedFrom(source) {
4883
5211
  var _a;
4884
5212
  if (!it.opts.unevaluated)
@@ -4905,7 +5233,9 @@ var require_ref = __commonJS({
4905
5233
  }
4906
5234
  }
4907
5235
  }
5236
+ __name(addEvaluatedFrom, "addEvaluatedFrom");
4908
5237
  }
5238
+ __name(callRef, "callRef");
4909
5239
  exports.callRef = callRef;
4910
5240
  exports.default = def;
4911
5241
  }
@@ -5013,6 +5343,7 @@ var require_ucs2length = __commonJS({
5013
5343
  }
5014
5344
  return length;
5015
5345
  }
5346
+ __name(ucs2length, "ucs2length");
5016
5347
  exports.default = ucs2length;
5017
5348
  ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
5018
5349
  }
@@ -5155,6 +5486,7 @@ var require_required = __commonJS({
5155
5486
  }
5156
5487
  }
5157
5488
  }
5489
+ __name(allErrorsMode, "allErrorsMode");
5158
5490
  function exitOnErrorMode() {
5159
5491
  const missing = gen.let("missing");
5160
5492
  if (useLoop || $data) {
@@ -5167,12 +5499,14 @@ var require_required = __commonJS({
5167
5499
  gen.else();
5168
5500
  }
5169
5501
  }
5502
+ __name(exitOnErrorMode, "exitOnErrorMode");
5170
5503
  function loopAllRequired() {
5171
5504
  gen.forOf("prop", schemaCode, (prop) => {
5172
5505
  cxt.setParams({ missingProperty: prop });
5173
5506
  gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
5174
5507
  });
5175
5508
  }
5509
+ __name(loopAllRequired, "loopAllRequired");
5176
5510
  function loopUntilMissing(missing, valid) {
5177
5511
  cxt.setParams({ missingProperty: missing });
5178
5512
  gen.forOf(missing, schemaCode, () => {
@@ -5183,6 +5517,7 @@ var require_required = __commonJS({
5183
5517
  });
5184
5518
  }, codegen_1.nil);
5185
5519
  }
5520
+ __name(loopUntilMissing, "loopUntilMissing");
5186
5521
  }
5187
5522
  };
5188
5523
  exports.default = def;
@@ -5263,9 +5598,11 @@ var require_uniqueItems = __commonJS({
5263
5598
  gen.assign(valid, true);
5264
5599
  gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
5265
5600
  }
5601
+ __name(validateUniqueItems, "validateUniqueItems");
5266
5602
  function canOptimize() {
5267
5603
  return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
5268
5604
  }
5605
+ __name(canOptimize, "canOptimize");
5269
5606
  function loopN(i, j) {
5270
5607
  const item = gen.name("item");
5271
5608
  const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
@@ -5282,6 +5619,7 @@ var require_uniqueItems = __commonJS({
5282
5619
  }).code((0, codegen_1._)`${indices}[${item}] = ${i}`);
5283
5620
  });
5284
5621
  }
5622
+ __name(loopN, "loopN");
5285
5623
  function loopN2(i, j) {
5286
5624
  const eql = (0, util_1.useFunc)(gen, equal_1.default);
5287
5625
  const outer = gen.name("outer");
@@ -5290,6 +5628,7 @@ var require_uniqueItems = __commonJS({
5290
5628
  gen.assign(valid, false).break(outer);
5291
5629
  })));
5292
5630
  }
5631
+ __name(loopN2, "loopN2");
5293
5632
  }
5294
5633
  };
5295
5634
  exports.default = def;
@@ -5348,7 +5687,7 @@ var require_enum = __commonJS({
5348
5687
  throw new Error("enum must have non-empty array");
5349
5688
  const useLoop = schema.length >= it.opts.loopEnum;
5350
5689
  let eql;
5351
- const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);
5690
+ const getEql = /* @__PURE__ */ __name(() => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default), "getEql");
5352
5691
  let valid;
5353
5692
  if (useLoop || $data) {
5354
5693
  valid = gen.let("valid");
@@ -5364,10 +5703,12 @@ var require_enum = __commonJS({
5364
5703
  gen.assign(valid, false);
5365
5704
  gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
5366
5705
  }
5706
+ __name(loopEnum, "loopEnum");
5367
5707
  function equalCode(vSchema, i) {
5368
5708
  const sch = schema[i];
5369
5709
  return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;
5370
5710
  }
5711
+ __name(equalCode, "equalCode");
5371
5712
  }
5372
5713
  };
5373
5714
  exports.default = def;
@@ -5459,7 +5800,9 @@ var require_additionalItems = __commonJS({
5459
5800
  gen.if((0, codegen_1.not)(valid), () => gen.break());
5460
5801
  });
5461
5802
  }
5803
+ __name(validateItems, "validateItems");
5462
5804
  }
5805
+ __name(validateAdditionalItems, "validateAdditionalItems");
5463
5806
  exports.validateAdditionalItems = validateAdditionalItems;
5464
5807
  exports.default = def;
5465
5808
  }
@@ -5516,7 +5859,9 @@ var require_items = __commonJS({
5516
5859
  (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
5517
5860
  }
5518
5861
  }
5862
+ __name(checkStrictTuple, "checkStrictTuple");
5519
5863
  }
5864
+ __name(validateTuple, "validateTuple");
5520
5865
  exports.validateTuple = validateTuple;
5521
5866
  exports.default = def;
5522
5867
  }
@@ -5639,6 +5984,7 @@ var require_contains = __commonJS({
5639
5984
  const count = gen.let("count", 0);
5640
5985
  validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
5641
5986
  }
5987
+ __name(validateItemsWithCount, "validateItemsWithCount");
5642
5988
  function validateItems(_valid, block) {
5643
5989
  gen.forRange("i", 0, len, (i) => {
5644
5990
  cxt.subschema({
@@ -5650,6 +5996,7 @@ var require_contains = __commonJS({
5650
5996
  block();
5651
5997
  });
5652
5998
  }
5999
+ __name(validateItems, "validateItems");
5653
6000
  function checkLimits(count) {
5654
6001
  gen.code((0, codegen_1._)`${count}++`);
5655
6002
  if (max === void 0) {
@@ -5662,6 +6009,7 @@ var require_contains = __commonJS({
5662
6009
  gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
5663
6010
  }
5664
6011
  }
6012
+ __name(checkLimits, "checkLimits");
5665
6013
  }
5666
6014
  };
5667
6015
  exports.default = def;
@@ -5710,6 +6058,7 @@ var require_dependencies = __commonJS({
5710
6058
  }
5711
6059
  return [propertyDeps, schemaDeps];
5712
6060
  }
6061
+ __name(splitDependencies, "splitDependencies");
5713
6062
  function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
5714
6063
  const { gen, data, it } = cxt;
5715
6064
  if (Object.keys(propertyDeps).length === 0)
@@ -5738,6 +6087,7 @@ var require_dependencies = __commonJS({
5738
6087
  }
5739
6088
  }
5740
6089
  }
6090
+ __name(validatePropertyDeps, "validatePropertyDeps");
5741
6091
  exports.validatePropertyDeps = validatePropertyDeps;
5742
6092
  function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
5743
6093
  const { gen, data, keyword, it } = cxt;
@@ -5757,6 +6107,7 @@ var require_dependencies = __commonJS({
5757
6107
  cxt.ok(valid);
5758
6108
  }
5759
6109
  }
6110
+ __name(validateSchemaDeps, "validateSchemaDeps");
5760
6111
  exports.validateSchemaDeps = validateSchemaDeps;
5761
6112
  exports.default = def;
5762
6113
  }
@@ -5845,6 +6196,7 @@ var require_additionalProperties = __commonJS({
5845
6196
  gen.if(isAdditional(key), () => additionalPropertyCode(key));
5846
6197
  });
5847
6198
  }
6199
+ __name(checkAdditionalProperties, "checkAdditionalProperties");
5848
6200
  function isAdditional(key) {
5849
6201
  let definedProp;
5850
6202
  if (props.length > 8) {
@@ -5860,9 +6212,11 @@ var require_additionalProperties = __commonJS({
5860
6212
  }
5861
6213
  return (0, codegen_1.not)(definedProp);
5862
6214
  }
6215
+ __name(isAdditional, "isAdditional");
5863
6216
  function deleteAdditional(key) {
5864
6217
  gen.code((0, codegen_1._)`delete ${data}[${key}]`);
5865
6218
  }
6219
+ __name(deleteAdditional, "deleteAdditional");
5866
6220
  function additionalPropertyCode(key) {
5867
6221
  if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) {
5868
6222
  deleteAdditional(key);
@@ -5890,6 +6244,7 @@ var require_additionalProperties = __commonJS({
5890
6244
  }
5891
6245
  }
5892
6246
  }
6247
+ __name(additionalPropertyCode, "additionalPropertyCode");
5893
6248
  function applyAdditionalSchema(key, valid, errors) {
5894
6249
  const subschema = {
5895
6250
  keyword: "additionalProperties",
@@ -5905,6 +6260,7 @@ var require_additionalProperties = __commonJS({
5905
6260
  }
5906
6261
  cxt.subschema(subschema, valid);
5907
6262
  }
6263
+ __name(applyAdditionalSchema, "applyAdditionalSchema");
5908
6264
  }
5909
6265
  };
5910
6266
  exports.default = def;
@@ -5956,6 +6312,7 @@ var require_properties = __commonJS({
5956
6312
  function hasDefault(prop) {
5957
6313
  return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0;
5958
6314
  }
6315
+ __name(hasDefault, "hasDefault");
5959
6316
  function applyPropertySchema(prop) {
5960
6317
  cxt.subschema({
5961
6318
  keyword: "properties",
@@ -5963,6 +6320,7 @@ var require_properties = __commonJS({
5963
6320
  dataProp: prop
5964
6321
  }, valid);
5965
6322
  }
6323
+ __name(applyPropertySchema, "applyPropertySchema");
5966
6324
  }
5967
6325
  };
5968
6326
  exports.default = def;
@@ -6010,6 +6368,7 @@ var require_patternProperties = __commonJS({
6010
6368
  }
6011
6369
  }
6012
6370
  }
6371
+ __name(validatePatternProperties, "validatePatternProperties");
6013
6372
  function checkMatchingProperties(pat) {
6014
6373
  for (const prop in checkProperties) {
6015
6374
  if (new RegExp(pat).test(prop)) {
@@ -6017,6 +6376,7 @@ var require_patternProperties = __commonJS({
6017
6376
  }
6018
6377
  }
6019
6378
  }
6379
+ __name(checkMatchingProperties, "checkMatchingProperties");
6020
6380
  function validateProperties(pat) {
6021
6381
  gen.forIn("key", data, (key) => {
6022
6382
  gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
@@ -6037,6 +6397,7 @@ var require_patternProperties = __commonJS({
6037
6397
  });
6038
6398
  });
6039
6399
  }
6400
+ __name(validateProperties, "validateProperties");
6040
6401
  }
6041
6402
  };
6042
6403
  exports.default = def;
@@ -6143,6 +6504,7 @@ var require_oneOf = __commonJS({
6143
6504
  });
6144
6505
  });
6145
6506
  }
6507
+ __name(validateOneOf, "validateOneOf");
6146
6508
  }
6147
6509
  };
6148
6510
  exports.default = def;
@@ -6224,6 +6586,7 @@ var require_if = __commonJS({
6224
6586
  }, schValid);
6225
6587
  cxt.mergeEvaluated(schCxt);
6226
6588
  }
6589
+ __name(validateIf, "validateIf");
6227
6590
  function validateClause(keyword, ifClause) {
6228
6591
  return () => {
6229
6592
  const schCxt = cxt.subschema({ keyword }, schValid);
@@ -6235,12 +6598,14 @@ var require_if = __commonJS({
6235
6598
  cxt.setParams({ ifClause: keyword });
6236
6599
  };
6237
6600
  }
6601
+ __name(validateClause, "validateClause");
6238
6602
  }
6239
6603
  };
6240
6604
  function hasSchema(it, keyword) {
6241
6605
  const schema = it.schema[keyword];
6242
6606
  return schema !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema);
6243
6607
  }
6608
+ __name(hasSchema, "hasSchema");
6244
6609
  exports.default = def;
6245
6610
  }
6246
6611
  });
@@ -6307,6 +6672,7 @@ var require_applicator = __commonJS({
6307
6672
  applicator.push(contains_1.default);
6308
6673
  return applicator;
6309
6674
  }
6675
+ __name(getApplicator, "getApplicator");
6310
6676
  exports.default = getApplicator;
6311
6677
  }
6312
6678
  });
@@ -6351,12 +6717,15 @@ var require_format = __commonJS({
6351
6717
  return codegen_1.nil;
6352
6718
  return (0, codegen_1._)`${schemaCode} && !${format}`;
6353
6719
  }
6720
+ __name(unknownFmt, "unknownFmt");
6354
6721
  function invalidFmt() {
6355
6722
  const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
6356
6723
  const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
6357
6724
  return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
6358
6725
  }
6726
+ __name(invalidFmt, "invalidFmt");
6359
6727
  }
6728
+ __name(validate$DataFormat, "validate$DataFormat");
6360
6729
  function validateFormat() {
6361
6730
  const formatDef = self.formats[schema];
6362
6731
  if (!formatDef) {
@@ -6377,7 +6746,9 @@ var require_format = __commonJS({
6377
6746
  function unknownMsg() {
6378
6747
  return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
6379
6748
  }
6749
+ __name(unknownMsg, "unknownMsg");
6380
6750
  }
6751
+ __name(unknownFormat, "unknownFormat");
6381
6752
  function getFormat(fmtDef) {
6382
6753
  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;
6383
6754
  const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
@@ -6386,6 +6757,7 @@ var require_format = __commonJS({
6386
6757
  }
6387
6758
  return ["string", fmtDef, fmt];
6388
6759
  }
6760
+ __name(getFormat, "getFormat");
6389
6761
  function validCondition() {
6390
6762
  if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
6391
6763
  if (!schemaEnv.$async)
@@ -6394,7 +6766,9 @@ var require_format = __commonJS({
6394
6766
  }
6395
6767
  return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
6396
6768
  }
6769
+ __name(validCondition, "validCondition");
6397
6770
  }
6771
+ __name(validateFormat, "validateFormat");
6398
6772
  }
6399
6773
  };
6400
6774
  exports.default = def;
@@ -6517,12 +6891,14 @@ var require_discriminator = __commonJS({
6517
6891
  cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
6518
6892
  gen.endIf();
6519
6893
  }
6894
+ __name(validateMapping, "validateMapping");
6520
6895
  function applyTagSchema(schemaProp) {
6521
6896
  const _valid = gen.name("valid");
6522
6897
  const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
6523
6898
  cxt.mergeEvaluated(schCxt, codegen_1.Name);
6524
6899
  return _valid;
6525
6900
  }
6901
+ __name(applyTagSchema, "applyTagSchema");
6526
6902
  function getMapping() {
6527
6903
  var _a;
6528
6904
  const oneOfMapping = {};
@@ -6548,6 +6924,7 @@ var require_discriminator = __commonJS({
6548
6924
  function hasRequired({ required }) {
6549
6925
  return Array.isArray(required) && required.includes(tagName);
6550
6926
  }
6927
+ __name(hasRequired, "hasRequired");
6551
6928
  function addMappings(sch, i) {
6552
6929
  if (sch.const) {
6553
6930
  addMapping(sch.const, i);
@@ -6559,13 +6936,16 @@ var require_discriminator = __commonJS({
6559
6936
  throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
6560
6937
  }
6561
6938
  }
6939
+ __name(addMappings, "addMappings");
6562
6940
  function addMapping(tagValue, i) {
6563
6941
  if (typeof tagValue != "string" || tagValue in oneOfMapping) {
6564
6942
  throw new Error(`discriminator: "${tagName}" values must be unique strings`);
6565
6943
  }
6566
6944
  oneOfMapping[tagValue] = i;
6567
6945
  }
6946
+ __name(addMapping, "addMapping");
6568
6947
  }
6948
+ __name(getMapping, "getMapping");
6569
6949
  }
6570
6950
  };
6571
6951
  exports.default = def;
@@ -6742,6 +7122,9 @@ var require_ajv = __commonJS({
6742
7122
  var META_SUPPORT_DATA = ["/properties"];
6743
7123
  var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
6744
7124
  var Ajv = class extends core_1.default {
7125
+ static {
7126
+ __name(this, "Ajv");
7127
+ }
6745
7128
  _addVocabularies() {
6746
7129
  super._addVocabularies();
6747
7130
  draft7_1.default.forEach((v) => this.addVocabulary(v));
@@ -6806,6 +7189,7 @@ var require_formats = __commonJS({
6806
7189
  function fmtDef(validate, compare) {
6807
7190
  return { validate, compare };
6808
7191
  }
7192
+ __name(fmtDef, "fmtDef");
6809
7193
  exports.fullFormats = {
6810
7194
  // date: http://tools.ietf.org/html/rfc3339#section-5.6
6811
7195
  date: fmtDef(date, compareDate),
@@ -6868,6 +7252,7 @@ var require_formats = __commonJS({
6868
7252
  function isLeapYear(year) {
6869
7253
  return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
6870
7254
  }
7255
+ __name(isLeapYear, "isLeapYear");
6871
7256
  var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
6872
7257
  var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
6873
7258
  function date(str) {
@@ -6879,6 +7264,7 @@ var require_formats = __commonJS({
6879
7264
  const day = +matches[3];
6880
7265
  return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);
6881
7266
  }
7267
+ __name(date, "date");
6882
7268
  function compareDate(d1, d2) {
6883
7269
  if (!(d1 && d2))
6884
7270
  return void 0;
@@ -6888,6 +7274,7 @@ var require_formats = __commonJS({
6888
7274
  return -1;
6889
7275
  return 0;
6890
7276
  }
7277
+ __name(compareDate, "compareDate");
6891
7278
  var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
6892
7279
  function time(str, withTimeZone) {
6893
7280
  const matches = TIME.exec(str);
@@ -6899,6 +7286,7 @@ var require_formats = __commonJS({
6899
7286
  const timeZone = matches[5];
6900
7287
  return (hour <= 23 && minute <= 59 && second <= 59 || hour === 23 && minute === 59 && second === 60) && (!withTimeZone || timeZone !== "");
6901
7288
  }
7289
+ __name(time, "time");
6902
7290
  function compareTime(t1, t2) {
6903
7291
  if (!(t1 && t2))
6904
7292
  return void 0;
@@ -6914,11 +7302,13 @@ var require_formats = __commonJS({
6914
7302
  return -1;
6915
7303
  return 0;
6916
7304
  }
7305
+ __name(compareTime, "compareTime");
6917
7306
  var DATE_TIME_SEPARATOR = /t|\s/i;
6918
7307
  function date_time(str) {
6919
7308
  const dateTime = str.split(DATE_TIME_SEPARATOR);
6920
7309
  return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1], true);
6921
7310
  }
7311
+ __name(date_time, "date_time");
6922
7312
  function compareDateTime(dt1, dt2) {
6923
7313
  if (!(dt1 && dt2))
6924
7314
  return void 0;
@@ -6929,27 +7319,33 @@ var require_formats = __commonJS({
6929
7319
  return void 0;
6930
7320
  return res || compareTime(t1, t2);
6931
7321
  }
7322
+ __name(compareDateTime, "compareDateTime");
6932
7323
  var NOT_URI_FRAGMENT = /\/|:/;
6933
7324
  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;
6934
7325
  function uri(str) {
6935
7326
  return NOT_URI_FRAGMENT.test(str) && URI.test(str);
6936
7327
  }
7328
+ __name(uri, "uri");
6937
7329
  var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
6938
7330
  function byte(str) {
6939
7331
  BYTE.lastIndex = 0;
6940
7332
  return BYTE.test(str);
6941
7333
  }
7334
+ __name(byte, "byte");
6942
7335
  var MIN_INT32 = -(2 ** 31);
6943
7336
  var MAX_INT32 = 2 ** 31 - 1;
6944
7337
  function validateInt32(value) {
6945
7338
  return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
6946
7339
  }
7340
+ __name(validateInt32, "validateInt32");
6947
7341
  function validateInt64(value) {
6948
7342
  return Number.isInteger(value);
6949
7343
  }
7344
+ __name(validateInt64, "validateInt64");
6950
7345
  function validateNumber() {
6951
7346
  return true;
6952
7347
  }
7348
+ __name(validateNumber, "validateNumber");
6953
7349
  var Z_ANCHOR = /[^\\]\\Z/;
6954
7350
  function regex(str) {
6955
7351
  if (Z_ANCHOR.test(str))
@@ -6961,6 +7357,7 @@ var require_formats = __commonJS({
6961
7357
  return false;
6962
7358
  }
6963
7359
  }
7360
+ __name(regex, "regex");
6964
7361
  }
6965
7362
  });
6966
7363
 
@@ -7007,6 +7404,7 @@ var require_limit = __commonJS({
7007
7404
  const fmt = gen.const("fmt", codegen_1._`${fmts}[${fCxt.schemaCode}]`);
7008
7405
  cxt.fail$data(codegen_1.or(codegen_1._`typeof ${fmt} != "object"`, codegen_1._`${fmt} instanceof RegExp`, codegen_1._`typeof ${fmt}.compare != "function"`, compareCode(fmt)));
7009
7406
  }
7407
+ __name(validate$DataFormat, "validate$DataFormat");
7010
7408
  function validateFormat() {
7011
7409
  const format = fCxt.schema;
7012
7410
  const fmtDef = self.formats[format];
@@ -7022,16 +7420,18 @@ var require_limit = __commonJS({
7022
7420
  });
7023
7421
  cxt.fail$data(compareCode(fmt));
7024
7422
  }
7423
+ __name(validateFormat, "validateFormat");
7025
7424
  function compareCode(fmt) {
7026
7425
  return codegen_1._`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;
7027
7426
  }
7427
+ __name(compareCode, "compareCode");
7028
7428
  },
7029
7429
  dependencies: ["format"]
7030
7430
  };
7031
- var formatLimitPlugin = (ajv) => {
7431
+ var formatLimitPlugin = /* @__PURE__ */ __name((ajv) => {
7032
7432
  ajv.addKeyword(exports.formatLimitDefinition);
7033
7433
  return ajv;
7034
- };
7434
+ }, "formatLimitPlugin");
7035
7435
  exports.default = formatLimitPlugin;
7036
7436
  }
7037
7437
  });
@@ -7046,7 +7446,7 @@ var require_dist = __commonJS({
7046
7446
  var codegen_1 = require_codegen();
7047
7447
  var fullName = new codegen_1.Name("fullFormats");
7048
7448
  var fastName = new codegen_1.Name("fastFormats");
7049
- var formatsPlugin = (ajv, opts = { keywords: true }) => {
7449
+ var formatsPlugin = /* @__PURE__ */ __name((ajv, opts = { keywords: true }) => {
7050
7450
  if (Array.isArray(opts)) {
7051
7451
  addFormats(ajv, opts, formats_1.fullFormats, fullName);
7052
7452
  return ajv;
@@ -7057,7 +7457,7 @@ var require_dist = __commonJS({
7057
7457
  if (opts.keywords)
7058
7458
  limit_1.default(ajv);
7059
7459
  return ajv;
7060
- };
7460
+ }, "formatsPlugin");
7061
7461
  formatsPlugin.get = (name, mode = "full") => {
7062
7462
  const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
7063
7463
  const f = formats[name];
@@ -7072,21 +7472,26 @@ var require_dist = __commonJS({
7072
7472
  for (const f of list)
7073
7473
  ajv.addFormat(f, fs[f]);
7074
7474
  }
7475
+ __name(addFormats, "addFormats");
7075
7476
  module.exports = exports = formatsPlugin;
7076
7477
  Object.defineProperty(exports, "__esModule", { value: true });
7077
7478
  exports.default = formatsPlugin;
7078
7479
  }
7079
7480
  });
7080
7481
 
7081
- // src/schemas/definitions/common.json
7082
- var require_common = __commonJS({
7083
- "src/schemas/definitions/common.json"(exports, module) {
7482
+ // src/schemas/definitions.json
7483
+ var require_definitions = __commonJS({
7484
+ "src/schemas/definitions.json"(exports, module) {
7084
7485
  module.exports = {
7085
7486
  $schema: "http://json-schema.org/draft-07/schema",
7086
- $id: "https://api.kohost.app/schemas/v3/definitions/common.json",
7487
+ $id: "definitions.json",
7488
+ title: "Definitions",
7087
7489
  definitions: {
7088
7490
  id: {
7089
- type: "string"
7491
+ type: "string",
7492
+ not: {
7493
+ enum: ["global", "system"]
7494
+ }
7090
7495
  },
7091
7496
  systemData: {
7092
7497
  type: "object",
@@ -7096,6 +7501,10 @@ var require_common = __commonJS({
7096
7501
  type: "object",
7097
7502
  default: {}
7098
7503
  },
7504
+ date: {
7505
+ type: ["string", "object"],
7506
+ format: "date-time"
7507
+ },
7099
7508
  createdAt: {
7100
7509
  type: ["string", "object"],
7101
7510
  format: "date-time"
@@ -7152,28 +7561,39 @@ var require_common = __commonJS({
7152
7561
  maxLength: 2
7153
7562
  }
7154
7563
  }
7155
- }
7156
- }
7157
- };
7158
- }
7159
- });
7160
-
7161
- // src/schemas/definitions/device.json
7162
- var require_device = __commonJS({
7163
- "src/schemas/definitions/device.json"(exports, module) {
7164
- module.exports = {
7165
- $schema: "http://json-schema.org/draft-07/schema",
7166
- $id: "https://api.kohost.app/schemas/v3/definitions/device.json",
7167
- definitions: {
7168
- id: {
7169
- $ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/id"
7170
7564
  },
7171
- systemData: {
7172
- $ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/systemData"
7565
+ driver: {
7566
+ type: "string",
7567
+ enum: [
7568
+ "aws-kinesis",
7569
+ "butler",
7570
+ "crestron",
7571
+ "ecobee",
7572
+ "igor",
7573
+ "inncom",
7574
+ "kohost-k7",
7575
+ "kohost-pms",
7576
+ "lg",
7577
+ "lirc",
7578
+ "mews",
7579
+ "paxton",
7580
+ "pelican-wireless",
7581
+ "rebrandly",
7582
+ "salto",
7583
+ "salto-irn",
7584
+ "se",
7585
+ "sendgrid",
7586
+ "stay-n-touch",
7587
+ "twilio",
7588
+ "cloudflare-images",
7589
+ "cloudflare-stream",
7590
+ "insperia-privacy"
7591
+ ]
7173
7592
  },
7174
7593
  type: {
7175
7594
  type: "string",
7176
7595
  enum: [
7596
+ "alarm",
7177
7597
  "dimmer",
7178
7598
  "switch",
7179
7599
  "motionSensor",
@@ -7183,8 +7603,13 @@ var require_device = __commonJS({
7183
7603
  "thermostat",
7184
7604
  "lock",
7185
7605
  "courtesy",
7186
- "sceneController",
7187
- "gateway"
7606
+ "gateway",
7607
+ "tv",
7608
+ "dvr",
7609
+ "appleTv",
7610
+ "discPlayer",
7611
+ "mediaPlayer",
7612
+ "uncontrolledDevice"
7188
7613
  ]
7189
7614
  },
7190
7615
  name: {
@@ -7213,7 +7638,11 @@ var require_device = __commonJS({
7213
7638
  "softwareFailure",
7214
7639
  "hardwareFailureWithCode",
7215
7640
  "softwareFailureWithCode",
7216
- "motionDetection"
7641
+ "motionDetection",
7642
+ "airFilterNeedsCleaned",
7643
+ "smokeDetected",
7644
+ "outsideSafeTemperatureRange",
7645
+ "outsideSafeHumidityRange"
7217
7646
  ]
7218
7647
  }
7219
7648
  },
@@ -7227,6 +7656,9 @@ var require_device = __commonJS({
7227
7656
  timestamp: {
7228
7657
  type: "number",
7229
7658
  minimum: 1655907956593
7659
+ },
7660
+ description: {
7661
+ type: "string"
7230
7662
  }
7231
7663
  }
7232
7664
  },
@@ -7234,6 +7666,10 @@ var require_device = __commonJS({
7234
7666
  type: "number",
7235
7667
  minimum: 0,
7236
7668
  maximum: 100
7669
+ },
7670
+ watts: {
7671
+ type: "number",
7672
+ minimum: 0
7237
7673
  }
7238
7674
  }
7239
7675
  };
@@ -7253,32 +7689,253 @@ var require_schema = __commonJS({
7253
7689
  strictRequired: false
7254
7690
  });
7255
7691
  var addFormats = require_dist();
7256
- var commonDefs = require_common();
7257
- var deviceDefs = require_device();
7692
+ var defininitions = require_definitions();
7258
7693
  addFormats(ajv);
7259
- ajv.addSchema(commonDefs);
7260
- ajv.addSchema(deviceDefs);
7694
+ ajv.addSchema(defininitions);
7261
7695
  module.exports = {
7262
- add: function add(schema) {
7696
+ add: /* @__PURE__ */ __name(function add(schema) {
7263
7697
  ajv.addSchema(schema);
7264
- },
7265
- compile: function compile(schema) {
7698
+ }, "add"),
7699
+ compile: /* @__PURE__ */ __name(function compile(schema) {
7266
7700
  return ajv.compile(schema);
7701
+ }, "compile")
7702
+ };
7703
+ }
7704
+ });
7705
+
7706
+ // src/Errors/AppError.js
7707
+ var require_AppError = __commonJS({
7708
+ "src/Errors/AppError.js"(exports, module) {
7709
+ module.exports = class AppError extends Error {
7710
+ static {
7711
+ __name(this, "AppError");
7712
+ }
7713
+ constructor(message = "Internal Server Error", options) {
7714
+ super(message, options);
7715
+ this.type = this.constructor.name;
7716
+ this.statusCode = 500;
7717
+ Object.setPrototypeOf(this, AppError.prototype);
7718
+ }
7719
+ };
7720
+ }
7721
+ });
7722
+
7723
+ // src/Errors/AuthenticationError.js
7724
+ var require_AuthenticationError = __commonJS({
7725
+ "src/Errors/AuthenticationError.js"(exports, module) {
7726
+ var AppError = require_AppError();
7727
+ module.exports = class AuthenticationError extends AppError {
7728
+ static {
7729
+ __name(this, "AuthenticationError");
7730
+ }
7731
+ constructor(message = "Authentication Error", options = {}) {
7732
+ super(message, options);
7733
+ this.statusCode = 401;
7734
+ Object.setPrototypeOf(this, AuthenticationError.prototype);
7735
+ }
7736
+ };
7737
+ }
7738
+ });
7739
+
7740
+ // src/Errors/AuthorizationError.js
7741
+ var require_AuthorizationError = __commonJS({
7742
+ "src/Errors/AuthorizationError.js"(exports, module) {
7743
+ var AppError = require_AppError();
7744
+ module.exports = class AuthorizationError extends AppError {
7745
+ static {
7746
+ __name(this, "AuthorizationError");
7747
+ }
7748
+ constructor(message = "Authorization Error", options = {}) {
7749
+ super(message, options);
7750
+ this.statusCode = 403;
7751
+ Object.setPrototypeOf(this, AuthorizationError.prototype);
7752
+ }
7753
+ };
7754
+ }
7755
+ });
7756
+
7757
+ // src/Errors/DeviceCommError.js
7758
+ var require_DeviceCommError = __commonJS({
7759
+ "src/Errors/DeviceCommError.js"(exports, module) {
7760
+ var AppError = require_AppError();
7761
+ module.exports = class DeviceCommError extends AppError {
7762
+ static {
7763
+ __name(this, "DeviceCommError");
7764
+ }
7765
+ constructor(message = "Device Communication Error", options = {}) {
7766
+ super(message, options);
7767
+ this.statusCode = 503;
7768
+ Object.setPrototypeOf(this, DeviceCommError.prototype);
7769
+ }
7770
+ };
7771
+ }
7772
+ });
7773
+
7774
+ // src/Errors/LoginError.js
7775
+ var require_LoginError = __commonJS({
7776
+ "src/Errors/LoginError.js"(exports, module) {
7777
+ var AppError = require_AppError();
7778
+ module.exports = class LoginError extends AppError {
7779
+ static {
7780
+ __name(this, "LoginError");
7781
+ }
7782
+ constructor(message = "Invalid Login information provided", options = {}) {
7783
+ super(message, options);
7784
+ this.statusCode = 401;
7785
+ Object.setPrototypeOf(this, LoginError.prototype);
7786
+ }
7787
+ };
7788
+ }
7789
+ });
7790
+
7791
+ // src/Errors/NotFoundError.js
7792
+ var require_NotFoundError = __commonJS({
7793
+ "src/Errors/NotFoundError.js"(exports, module) {
7794
+ var AppError = require_AppError();
7795
+ module.exports = class NotFoundError extends AppError {
7796
+ static {
7797
+ __name(this, "NotFoundError");
7798
+ }
7799
+ constructor(message = "Resource Not Found", options = {}) {
7800
+ super(message, options);
7801
+ this.statusCode = 404;
7802
+ Object.setPrototypeOf(this, NotFoundError.prototype);
7803
+ }
7804
+ };
7805
+ }
7806
+ });
7807
+
7808
+ // src/Errors/RequestError.js
7809
+ var require_RequestError = __commonJS({
7810
+ "src/Errors/RequestError.js"(exports, module) {
7811
+ var AppError = require_AppError();
7812
+ module.exports = class RequestError extends AppError {
7813
+ static {
7814
+ __name(this, "RequestError");
7815
+ }
7816
+ constructor(message = "Bad Request", options = {}) {
7817
+ super(message, options);
7818
+ this.statusCode = 400;
7819
+ Object.setPrototypeOf(this, RequestError.prototype);
7820
+ }
7821
+ };
7822
+ }
7823
+ });
7824
+
7825
+ // src/Errors/SystemCommError.js
7826
+ var require_SystemCommError = __commonJS({
7827
+ "src/Errors/SystemCommError.js"(exports, module) {
7828
+ var AppError = require_AppError();
7829
+ module.exports = class SystemCommError extends AppError {
7830
+ static {
7831
+ __name(this, "SystemCommError");
7832
+ }
7833
+ constructor(message = "System Communication Error", options = {}) {
7834
+ super(message, options);
7835
+ this.statusCode = 503;
7836
+ Object.setPrototypeOf(this, SystemCommError.prototype);
7837
+ }
7838
+ };
7839
+ }
7840
+ });
7841
+
7842
+ // src/Errors/TokenExpiredError.js
7843
+ var require_TokenExpiredError = __commonJS({
7844
+ "src/Errors/TokenExpiredError.js"(exports, module) {
7845
+ var AppError = require_AppError();
7846
+ module.exports = class TokenExpiredError extends AppError {
7847
+ static {
7848
+ __name(this, "TokenExpiredError");
7849
+ }
7850
+ constructor(message = "Token Expired", options = {}) {
7851
+ super(message, options);
7852
+ this.statusCode = 401;
7853
+ Object.setPrototypeOf(this, TokenExpiredError.prototype);
7854
+ }
7855
+ };
7856
+ }
7857
+ });
7858
+
7859
+ // src/Errors/UnprocessableRequestError.js
7860
+ var require_UnprocessableRequestError = __commonJS({
7861
+ "src/Errors/UnprocessableRequestError.js"(exports, module) {
7862
+ var AppError = require_AppError();
7863
+ module.exports = class UnprocessableRequestError extends AppError {
7864
+ static {
7865
+ __name(this, "UnprocessableRequestError");
7866
+ }
7867
+ constructor(message = "Unprocessable Request Error", options = {}) {
7868
+ super(message, options);
7869
+ this.statusCode = 422;
7870
+ Object.setPrototypeOf(this, UnprocessableRequestError.prototype);
7871
+ }
7872
+ };
7873
+ }
7874
+ });
7875
+
7876
+ // src/Errors/ValidationError.js
7877
+ var require_ValidationError = __commonJS({
7878
+ "src/Errors/ValidationError.js"(exports, module) {
7879
+ var AppError = require_AppError();
7880
+ module.exports = class ValidationError extends AppError {
7881
+ static {
7882
+ __name(this, "ValidationError");
7883
+ }
7884
+ constructor(message = "Validation Error", options = {}) {
7885
+ super(message, options);
7886
+ this.statusCode = 400;
7887
+ Object.setPrototypeOf(this, ValidationError.prototype);
7267
7888
  }
7268
7889
  };
7269
7890
  }
7270
7891
  });
7271
7892
 
7893
+ // src/Errors/index.js
7894
+ var require_Errors = __commonJS({
7895
+ "src/Errors/index.js"(exports, module) {
7896
+ var Errors = {
7897
+ AppError: require_AppError(),
7898
+ AuthenticationError: require_AuthenticationError(),
7899
+ AuthorizationError: require_AuthorizationError(),
7900
+ DeviceCommError: require_DeviceCommError(),
7901
+ LoginError: require_LoginError(),
7902
+ NotFoundError: require_NotFoundError(),
7903
+ RequestError: require_RequestError(),
7904
+ SystemCommError: require_SystemCommError(),
7905
+ TokenExpiredError: require_TokenExpiredError(),
7906
+ UnprocessableRequestError: require_UnprocessableRequestError(),
7907
+ ValidationError: require_ValidationError()
7908
+ };
7909
+ module.exports = Errors;
7910
+ }
7911
+ });
7912
+
7913
+ // src/utils/errorFactory.js
7914
+ var require_errorFactory = __commonJS({
7915
+ "src/utils/errorFactory.js"(exports, module) {
7916
+ var Errors = require_Errors();
7917
+ module.exports = /* @__PURE__ */ __name(function errorFactory(errName) {
7918
+ const AllErrors = Object.values(Errors);
7919
+ const TheError = AllErrors.find((E) => E.prototype.name === errName);
7920
+ if (!TheError)
7921
+ return new Error("Invalid error name: " + errName);
7922
+ return TheError;
7923
+ }, "errorFactory");
7924
+ }
7925
+ });
7926
+
7272
7927
  // src/utils/index.js
7273
7928
  var require_utils = __commonJS({
7274
7929
  "src/utils/index.js"(exports, module) {
7275
7930
  var getFormalDeviceType = require_getFormalDeviceType();
7276
7931
  var getDeviceTypes = require_getDeviceTypes();
7277
7932
  var schema = require_schema();
7933
+ var errorFactory = require_errorFactory();
7278
7934
  module.exports = {
7279
7935
  getFormalDeviceType,
7280
7936
  getDeviceTypes,
7281
- schema
7937
+ schema,
7938
+ errorFactory
7282
7939
  };
7283
7940
  }
7284
7941
  });