@logto/connector-github 1.0.0-beta.11 → 1.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /******/ (() => { // webpackBootstrap
2
2
  /******/ var __webpack_modules__ = ({
3
3
 
4
- /***/ 1743:
4
+ /***/ 5254:
5
5
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
6
6
 
7
7
  "use strict";
@@ -21,115 +21,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
21
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", ({ value: true }));
24
- exports.parseJson = exports.validateConfig = void 0;
25
- const types_1 = __nccwpck_require__(8053);
26
- __exportStar(__nccwpck_require__(8053), exports);
27
- function validateConfig(config, guard) {
28
- const result = guard.safeParse(config);
29
- if (!result.success) {
30
- throw new types_1.ConnectorError(types_1.ConnectorErrorCodes.InvalidConfig, result.error);
31
- }
32
- }
33
- exports.validateConfig = validateConfig;
34
- const parseJson = (jsonString, errorCode = types_1.ConnectorErrorCodes.InvalidResponse, errorPayload) => {
35
- try {
36
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
37
- return JSON.parse(jsonString);
38
- }
39
- catch {
40
- throw new types_1.ConnectorError(errorCode, errorPayload ?? jsonString);
41
- }
42
- };
43
- exports.parseJson = parseJson;
44
-
45
-
46
- /***/ }),
47
-
48
- /***/ 8053:
49
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
50
-
51
- "use strict";
52
-
53
- Object.defineProperty(exports, "__esModule", ({ value: true }));
54
- exports.messageTypesGuard = exports.MessageTypes = exports.ConnectorError = exports.ConnectorErrorCodes = exports.ConnectorPlatform = exports.ConnectorType = void 0;
55
- const zod_1 = __nccwpck_require__(8062);
56
- // MARK: Foundation
57
- var ConnectorType;
58
- (function (ConnectorType) {
59
- ConnectorType["Email"] = "Email";
60
- ConnectorType["Sms"] = "Sms";
61
- ConnectorType["Social"] = "Social";
62
- })(ConnectorType = exports.ConnectorType || (exports.ConnectorType = {}));
63
- var ConnectorPlatform;
64
- (function (ConnectorPlatform) {
65
- ConnectorPlatform["Native"] = "Native";
66
- ConnectorPlatform["Universal"] = "Universal";
67
- ConnectorPlatform["Web"] = "Web";
68
- })(ConnectorPlatform = exports.ConnectorPlatform || (exports.ConnectorPlatform = {}));
69
- var ConnectorErrorCodes;
70
- (function (ConnectorErrorCodes) {
71
- ConnectorErrorCodes["General"] = "general";
72
- ConnectorErrorCodes["InvalidMetadata"] = "invalid_metadata";
73
- ConnectorErrorCodes["UnexpectedType"] = "unexpected_type";
74
- ConnectorErrorCodes["InvalidConfigGuard"] = "invalid_config_guard";
75
- ConnectorErrorCodes["InvalidRequestParameters"] = "invalid_request_parameters";
76
- ConnectorErrorCodes["InsufficientRequestParameters"] = "insufficient_request_parameters";
77
- ConnectorErrorCodes["InvalidConfig"] = "invalid_config";
78
- ConnectorErrorCodes["InvalidResponse"] = "invalid_response";
79
- ConnectorErrorCodes["TemplateNotFound"] = "template_not_found";
80
- ConnectorErrorCodes["NotImplemented"] = "not_implemented";
81
- ConnectorErrorCodes["SocialAuthCodeInvalid"] = "social_auth_code_invalid";
82
- ConnectorErrorCodes["SocialAccessTokenInvalid"] = "social_invalid_access_token";
83
- ConnectorErrorCodes["SocialIdTokenInvalid"] = "social_invalid_id_token";
84
- ConnectorErrorCodes["AuthorizationFailed"] = "authorization_failed";
85
- })(ConnectorErrorCodes = exports.ConnectorErrorCodes || (exports.ConnectorErrorCodes = {}));
86
- class ConnectorError extends Error {
87
- constructor(code, data) {
88
- const message = typeof data === 'string' ? data : 'Connector error occurred.';
89
- super(message);
90
- this.code = code;
91
- this.data = typeof data === 'string' ? { message: data } : data;
92
- }
93
- }
94
- exports.ConnectorError = ConnectorError;
95
- var MessageTypes;
96
- (function (MessageTypes) {
97
- MessageTypes["SignIn"] = "SignIn";
98
- MessageTypes["Register"] = "Register";
99
- MessageTypes["ForgotPassword"] = "ForgotPassword";
100
- MessageTypes["Test"] = "Test";
101
- })(MessageTypes = exports.MessageTypes || (exports.MessageTypes = {}));
102
- exports.messageTypesGuard = zod_1.z.nativeEnum(MessageTypes);
103
-
104
-
105
- /***/ }),
106
-
107
- /***/ 8138:
108
- /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
109
-
110
- "use strict";
111
-
112
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
113
- if (k2 === undefined) k2 = k;
114
- var desc = Object.getOwnPropertyDescriptor(m, k);
115
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
116
- desc = { enumerable: true, get: function() { return m[k]; } };
117
- }
118
- Object.defineProperty(o, k2, desc);
119
- }) : (function(o, m, k, k2) {
120
- if (k2 === undefined) k2 = k;
121
- o[k2] = m[k];
122
- }));
123
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
124
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
125
- };
126
- Object.defineProperty(exports, "__esModule", ({ value: true }));
127
- __exportStar(__nccwpck_require__(685), exports);
24
+ __exportStar(__nccwpck_require__(7189), exports);
128
25
 
129
26
 
130
27
  /***/ }),
131
28
 
132
- /***/ 6375:
29
+ /***/ 9454:
133
30
  /***/ ((__unused_webpack_module, exports) => {
134
31
 
135
32
  "use strict";
@@ -158,7 +55,7 @@ exports.repeat = repeat;
158
55
 
159
56
  /***/ }),
160
57
 
161
- /***/ 2965:
58
+ /***/ 8980:
162
59
  /***/ ((__unused_webpack_module, exports) => {
163
60
 
164
61
  "use strict";
@@ -178,7 +75,7 @@ exports.assert = assert;
178
75
 
179
76
  /***/ }),
180
77
 
181
- /***/ 6386:
78
+ /***/ 1635:
182
79
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
183
80
 
184
81
  "use strict";
@@ -188,7 +85,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
188
85
  };
189
86
  Object.defineProperty(exports, "__esModule", ({ value: true }));
190
87
  exports.hasChineseCharacter = exports.has = exports.notEmpty = exports.notFalsy = exports.isSameArray = void 0;
191
- const lodash_orderby_1 = __importDefault(__nccwpck_require__(7650));
88
+ const lodash_orderby_1 = __importDefault(__nccwpck_require__(1128));
192
89
  const isSameArray = (array1, array2) => {
193
90
  if (array1.length !== array2.length) {
194
91
  return false;
@@ -211,14 +108,14 @@ exports.hasChineseCharacter = hasChineseCharacter;
211
108
 
212
109
  /***/ }),
213
110
 
214
- /***/ 7451:
111
+ /***/ 9532:
215
112
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
216
113
 
217
114
  "use strict";
218
115
 
219
116
  Object.defineProperty(exports, "__esModule", ({ value: true }));
220
117
  exports.conditionalString = exports.conditional = exports.nullable = void 0;
221
- const assertions_1 = __nccwpck_require__(6386);
118
+ const assertions_1 = __nccwpck_require__(1635);
222
119
  const nullable = (exp) => ((0, assertions_1.notFalsy)(exp) ? exp : null);
223
120
  exports.nullable = nullable;
224
121
  const conditional = (exp) => ((0, assertions_1.notFalsy)(exp) ? exp : undefined);
@@ -229,14 +126,14 @@ exports.conditionalString = conditionalString;
229
126
 
230
127
  /***/ }),
231
128
 
232
- /***/ 5980:
129
+ /***/ 316:
233
130
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
234
131
 
235
132
  "use strict";
236
133
 
237
134
  Object.defineProperty(exports, "__esModule", ({ value: true }));
238
135
  exports.isNode = exports.assertEnv = exports.getEnvAsStringArray = exports.getEnv = void 0;
239
- const assert_1 = __nccwpck_require__(2965);
136
+ const assert_1 = __nccwpck_require__(8980);
240
137
  // Browsers don't have `process`
241
138
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
242
139
  const getEnv = (key, fallback = '') => { var _a; return (_a = process === null || process === void 0 ? void 0 : process.env[key]) !== null && _a !== void 0 ? _a : fallback; };
@@ -266,7 +163,7 @@ exports.isNode = isNode;
266
163
 
267
164
  /***/ }),
268
165
 
269
- /***/ 685:
166
+ /***/ 7189:
270
167
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
271
168
 
272
169
  "use strict";
@@ -290,21 +187,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
290
187
  };
291
188
  Object.defineProperty(exports, "__esModule", ({ value: true }));
292
189
  exports.orderBy = void 0;
293
- __exportStar(__nccwpck_require__(6375), exports);
294
- __exportStar(__nccwpck_require__(2965), exports);
295
- __exportStar(__nccwpck_require__(6386), exports);
296
- __exportStar(__nccwpck_require__(7451), exports);
297
- __exportStar(__nccwpck_require__(5980), exports);
298
- __exportStar(__nccwpck_require__(7661), exports);
299
- __exportStar(__nccwpck_require__(7011), exports);
300
- __exportStar(__nccwpck_require__(7134), exports);
301
- var lodash_orderby_1 = __nccwpck_require__(7650);
190
+ __exportStar(__nccwpck_require__(9454), exports);
191
+ __exportStar(__nccwpck_require__(8980), exports);
192
+ __exportStar(__nccwpck_require__(1635), exports);
193
+ __exportStar(__nccwpck_require__(9532), exports);
194
+ __exportStar(__nccwpck_require__(316), exports);
195
+ __exportStar(__nccwpck_require__(4110), exports);
196
+ __exportStar(__nccwpck_require__(2973), exports);
197
+ __exportStar(__nccwpck_require__(5827), exports);
198
+ var lodash_orderby_1 = __nccwpck_require__(1128);
302
199
  Object.defineProperty(exports, "orderBy", ({ enumerable: true, get: function () { return __importDefault(lodash_orderby_1).default; } }));
303
200
 
304
201
 
305
202
  /***/ }),
306
203
 
307
- /***/ 7661:
204
+ /***/ 4110:
308
205
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
309
206
 
310
207
  "use strict";
@@ -314,8 +211,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
314
211
  };
315
212
  Object.defineProperty(exports, "__esModule", ({ value: true }));
316
213
  exports.pickState = exports.pick = void 0;
317
- const lodash_pick_1 = __importDefault(__nccwpck_require__(5002));
318
- var lodash_pick_2 = __nccwpck_require__(5002);
214
+ const lodash_pick_1 = __importDefault(__nccwpck_require__(9103));
215
+ var lodash_pick_2 = __nccwpck_require__(9103);
319
216
  Object.defineProperty(exports, "pick", ({ enumerable: true, get: function () { return __importDefault(lodash_pick_2).default; } }));
320
217
  const pickState = (...keys) => (state) => (0, lodash_pick_1.default)(state, ...keys);
321
218
  exports.pickState = pickState;
@@ -323,14 +220,14 @@ exports.pickState = pickState;
323
220
 
324
221
  /***/ }),
325
222
 
326
- /***/ 7011:
223
+ /***/ 2973:
327
224
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
328
225
 
329
226
  "use strict";
330
227
 
331
228
  Object.defineProperty(exports, "__esModule", ({ value: true }));
332
229
  exports.UrlSafeBase64 = exports.toTitle = void 0;
333
- const env_1 = __nccwpck_require__(5980);
230
+ const env_1 = __nccwpck_require__(316);
334
231
  function toTitle(string) {
335
232
  if (typeof string !== 'string') {
336
233
  throw new TypeError('Expected a string');
@@ -375,7 +272,7 @@ exports.UrlSafeBase64 = {
375
272
 
376
273
  /***/ }),
377
274
 
378
- /***/ 7134:
275
+ /***/ 5827:
379
276
  /***/ ((__unused_webpack_module, exports) => {
380
277
 
381
278
  "use strict";
@@ -386,7 +283,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
386
283
 
387
284
  /***/ }),
388
285
 
389
- /***/ 5173:
286
+ /***/ 6198:
390
287
  /***/ ((module, exports) => {
391
288
 
392
289
  "use strict";
@@ -828,13 +725,13 @@ module.exports.assert = exports.assert;
828
725
 
829
726
  /***/ }),
830
727
 
831
- /***/ 629:
728
+ /***/ 3632:
832
729
  /***/ ((module, exports, __nccwpck_require__) => {
833
730
 
834
731
  "use strict";
835
732
 
836
733
  Object.defineProperty(exports, "__esModule", ({ value: true }));
837
- const defer_to_connect_1 = __nccwpck_require__(8985);
734
+ const defer_to_connect_1 = __nccwpck_require__(8836);
838
735
  const util_1 = __nccwpck_require__(3837);
839
736
  const nodejsMajorVersion = Number(process.versions.node.split('.')[0]);
840
737
  const timer = (request) => {
@@ -962,7 +859,7 @@ module.exports["default"] = timer;
962
859
 
963
860
  /***/ }),
964
861
 
965
- /***/ 6825:
862
+ /***/ 2074:
966
863
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
967
864
 
968
865
  "use strict";
@@ -1406,7 +1303,7 @@ module.exports["default"] = CacheableLookup;
1406
1303
 
1407
1304
  /***/ }),
1408
1305
 
1409
- /***/ 5442:
1306
+ /***/ 5967:
1410
1307
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1411
1308
 
1412
1309
  "use strict";
@@ -1414,13 +1311,13 @@ module.exports["default"] = CacheableLookup;
1414
1311
 
1415
1312
  const EventEmitter = __nccwpck_require__(2361);
1416
1313
  const urlLib = __nccwpck_require__(7310);
1417
- const normalizeUrl = __nccwpck_require__(5299);
1418
- const getStream = __nccwpck_require__(5288);
1419
- const CachePolicy = __nccwpck_require__(1454);
1420
- const Response = __nccwpck_require__(1534);
1421
- const lowercaseKeys = __nccwpck_require__(4162);
1422
- const cloneResponse = __nccwpck_require__(895);
1423
- const Keyv = __nccwpck_require__(787);
1314
+ const normalizeUrl = __nccwpck_require__(5797);
1315
+ const getStream = __nccwpck_require__(3421);
1316
+ const CachePolicy = __nccwpck_require__(8412);
1317
+ const Response = __nccwpck_require__(4404);
1318
+ const lowercaseKeys = __nccwpck_require__(2893);
1319
+ const cloneResponse = __nccwpck_require__(6592);
1320
+ const Keyv = __nccwpck_require__(6474);
1424
1321
 
1425
1322
  class CacheableRequest {
1426
1323
  constructor(request, cacheAdapter) {
@@ -1665,14 +1562,14 @@ module.exports = CacheableRequest;
1665
1562
 
1666
1563
  /***/ }),
1667
1564
 
1668
- /***/ 895:
1565
+ /***/ 6592:
1669
1566
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1670
1567
 
1671
1568
  "use strict";
1672
1569
 
1673
1570
 
1674
1571
  const PassThrough = (__nccwpck_require__(2781).PassThrough);
1675
- const mimicResponse = __nccwpck_require__(4240);
1572
+ const mimicResponse = __nccwpck_require__(7642);
1676
1573
 
1677
1574
  const cloneResponse = response => {
1678
1575
  if (!(response && response.pipe)) {
@@ -1690,17 +1587,17 @@ module.exports = cloneResponse;
1690
1587
 
1691
1588
  /***/ }),
1692
1589
 
1693
- /***/ 2809:
1590
+ /***/ 996:
1694
1591
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1695
1592
 
1696
1593
  "use strict";
1697
1594
 
1698
1595
 
1699
1596
  const { promisify } = __nccwpck_require__(3837)
1700
- const JSONB = __nccwpck_require__(9604)
1597
+ const JSONB = __nccwpck_require__(3180)
1701
1598
  const zlib = __nccwpck_require__(9796)
1702
1599
 
1703
- const mergeOptions = __nccwpck_require__(113)
1600
+ const mergeOptions = __nccwpck_require__(8672)
1704
1601
 
1705
1602
  const compress = promisify(zlib.brotliCompress)
1706
1603
 
@@ -1743,7 +1640,7 @@ module.exports.parse = JSONB.parse
1743
1640
 
1744
1641
  /***/ }),
1745
1642
 
1746
- /***/ 113:
1643
+ /***/ 8672:
1747
1644
  /***/ ((module) => {
1748
1645
 
1749
1646
  "use strict";
@@ -1769,7 +1666,7 @@ module.exports = (defaultOptions = {}, options = {}) => {
1769
1666
 
1770
1667
  /***/ }),
1771
1668
 
1772
- /***/ 3014:
1669
+ /***/ 164:
1773
1670
  /***/ ((module) => {
1774
1671
 
1775
1672
  "use strict";
@@ -1871,14 +1768,14 @@ module.exports = function (encodedURI) {
1871
1768
 
1872
1769
  /***/ }),
1873
1770
 
1874
- /***/ 2269:
1771
+ /***/ 1331:
1875
1772
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1876
1773
 
1877
1774
  "use strict";
1878
1775
 
1879
1776
  const {Transform, PassThrough} = __nccwpck_require__(2781);
1880
1777
  const zlib = __nccwpck_require__(9796);
1881
- const mimicResponse = __nccwpck_require__(9021);
1778
+ const mimicResponse = __nccwpck_require__(9443);
1882
1779
 
1883
1780
  module.exports = response => {
1884
1781
  const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase();
@@ -1937,7 +1834,7 @@ module.exports = response => {
1937
1834
 
1938
1835
  /***/ }),
1939
1836
 
1940
- /***/ 8985:
1837
+ /***/ 8836:
1941
1838
  /***/ ((module, exports) => {
1942
1839
 
1943
1840
  "use strict";
@@ -1992,10 +1889,10 @@ module.exports["default"] = deferToConnect;
1992
1889
 
1993
1890
  /***/ }),
1994
1891
 
1995
- /***/ 1014:
1892
+ /***/ 1243:
1996
1893
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1997
1894
 
1998
- var once = __nccwpck_require__(9852);
1895
+ var once = __nccwpck_require__(2469);
1999
1896
 
2000
1897
  var noop = function() {};
2001
1898
 
@@ -2093,7 +1990,7 @@ module.exports = eos;
2093
1990
 
2094
1991
  /***/ }),
2095
1992
 
2096
- /***/ 1464:
1993
+ /***/ 8172:
2097
1994
  /***/ ((module) => {
2098
1995
 
2099
1996
  "use strict";
@@ -2118,7 +2015,7 @@ module.exports = function (obj, predicate) {
2118
2015
 
2119
2016
  /***/ }),
2120
2017
 
2121
- /***/ 4776:
2018
+ /***/ 6957:
2122
2019
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2123
2020
 
2124
2021
  "use strict";
@@ -2178,14 +2075,14 @@ module.exports = options => {
2178
2075
 
2179
2076
  /***/ }),
2180
2077
 
2181
- /***/ 5288:
2078
+ /***/ 3421:
2182
2079
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2183
2080
 
2184
2081
  "use strict";
2185
2082
 
2186
2083
  const {constants: BufferConstants} = __nccwpck_require__(4300);
2187
- const pump = __nccwpck_require__(1619);
2188
- const bufferStream = __nccwpck_require__(4776);
2084
+ const pump = __nccwpck_require__(1216);
2085
+ const bufferStream = __nccwpck_require__(6957);
2189
2086
 
2190
2087
  class MaxBufferError extends Error {
2191
2088
  constructor() {
@@ -2246,13 +2143,13 @@ module.exports.MaxBufferError = MaxBufferError;
2246
2143
 
2247
2144
  /***/ }),
2248
2145
 
2249
- /***/ 1729:
2146
+ /***/ 4827:
2250
2147
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2251
2148
 
2252
2149
  "use strict";
2253
2150
 
2254
2151
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2255
- const types_1 = __nccwpck_require__(2580);
2152
+ const types_1 = __nccwpck_require__(2554);
2256
2153
  function createRejection(error, ...beforeErrorGroups) {
2257
2154
  const promise = (async () => {
2258
2155
  if (error instanceof types_1.RequestError) {
@@ -2284,7 +2181,7 @@ exports["default"] = createRejection;
2284
2181
 
2285
2182
  /***/ }),
2286
2183
 
2287
- /***/ 2234:
2184
+ /***/ 6894:
2288
2185
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
2289
2186
 
2290
2187
  "use strict";
@@ -2301,14 +2198,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
2301
2198
  };
2302
2199
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2303
2200
  const events_1 = __nccwpck_require__(2361);
2304
- const is_1 = __nccwpck_require__(5173);
2305
- const PCancelable = __nccwpck_require__(6419);
2306
- const types_1 = __nccwpck_require__(2580);
2307
- const parse_body_1 = __nccwpck_require__(416);
2308
- const core_1 = __nccwpck_require__(1032);
2309
- const proxy_events_1 = __nccwpck_require__(5262);
2310
- const get_buffer_1 = __nccwpck_require__(7342);
2311
- const is_response_ok_1 = __nccwpck_require__(6948);
2201
+ const is_1 = __nccwpck_require__(6198);
2202
+ const PCancelable = __nccwpck_require__(5323);
2203
+ const types_1 = __nccwpck_require__(2554);
2204
+ const parse_body_1 = __nccwpck_require__(3544);
2205
+ const core_1 = __nccwpck_require__(8525);
2206
+ const proxy_events_1 = __nccwpck_require__(8423);
2207
+ const get_buffer_1 = __nccwpck_require__(5444);
2208
+ const is_response_ok_1 = __nccwpck_require__(3117);
2312
2209
  const proxiedRequestEvents = [
2313
2210
  'request',
2314
2211
  'response',
@@ -2462,18 +2359,18 @@ function asPromise(normalizedOptions) {
2462
2359
  return promise;
2463
2360
  }
2464
2361
  exports["default"] = asPromise;
2465
- __exportStar(__nccwpck_require__(2580), exports);
2362
+ __exportStar(__nccwpck_require__(2554), exports);
2466
2363
 
2467
2364
 
2468
2365
  /***/ }),
2469
2366
 
2470
- /***/ 530:
2367
+ /***/ 5040:
2471
2368
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2472
2369
 
2473
2370
  "use strict";
2474
2371
 
2475
2372
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2476
- const is_1 = __nccwpck_require__(5173);
2373
+ const is_1 = __nccwpck_require__(6198);
2477
2374
  const normalizeArguments = (options, defaults) => {
2478
2375
  if (is_1.default.null_(options.encoding)) {
2479
2376
  throw new TypeError('To get a Buffer, set `options.responseType` to `buffer` instead');
@@ -2553,13 +2450,13 @@ exports["default"] = normalizeArguments;
2553
2450
 
2554
2451
  /***/ }),
2555
2452
 
2556
- /***/ 416:
2453
+ /***/ 3544:
2557
2454
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2558
2455
 
2559
2456
  "use strict";
2560
2457
 
2561
2458
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2562
- const types_1 = __nccwpck_require__(2580);
2459
+ const types_1 = __nccwpck_require__(2554);
2563
2460
  const parseBody = (response, responseType, parseJson, encoding) => {
2564
2461
  const { rawBody } = response;
2565
2462
  try {
@@ -2586,7 +2483,7 @@ exports["default"] = parseBody;
2586
2483
 
2587
2484
  /***/ }),
2588
2485
 
2589
- /***/ 2580:
2486
+ /***/ 2554:
2590
2487
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
2591
2488
 
2592
2489
  "use strict";
@@ -2603,7 +2500,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
2603
2500
  };
2604
2501
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2605
2502
  exports.CancelError = exports.ParseError = void 0;
2606
- const core_1 = __nccwpck_require__(1032);
2503
+ const core_1 = __nccwpck_require__(8525);
2607
2504
  /**
2608
2505
  An error to be thrown when server response code is 2xx, and parsing body fails.
2609
2506
  Includes a `response` property.
@@ -2631,12 +2528,12 @@ class CancelError extends core_1.RequestError {
2631
2528
  }
2632
2529
  }
2633
2530
  exports.CancelError = CancelError;
2634
- __exportStar(__nccwpck_require__(1032), exports);
2531
+ __exportStar(__nccwpck_require__(8525), exports);
2635
2532
 
2636
2533
 
2637
2534
  /***/ }),
2638
2535
 
2639
- /***/ 1879:
2536
+ /***/ 9388:
2640
2537
  /***/ ((__unused_webpack_module, exports) => {
2641
2538
 
2642
2539
  "use strict";
@@ -2673,7 +2570,7 @@ exports["default"] = calculateRetryDelay;
2673
2570
 
2674
2571
  /***/ }),
2675
2572
 
2676
- /***/ 1032:
2573
+ /***/ 8525:
2677
2574
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2678
2575
 
2679
2576
  "use strict";
@@ -2687,27 +2584,27 @@ const url_1 = __nccwpck_require__(7310);
2687
2584
  const http = __nccwpck_require__(3685);
2688
2585
  const http_1 = __nccwpck_require__(3685);
2689
2586
  const https = __nccwpck_require__(5687);
2690
- const http_timer_1 = __nccwpck_require__(629);
2691
- const cacheable_lookup_1 = __nccwpck_require__(6825);
2692
- const CacheableRequest = __nccwpck_require__(5442);
2693
- const decompressResponse = __nccwpck_require__(2269);
2587
+ const http_timer_1 = __nccwpck_require__(3632);
2588
+ const cacheable_lookup_1 = __nccwpck_require__(2074);
2589
+ const CacheableRequest = __nccwpck_require__(5967);
2590
+ const decompressResponse = __nccwpck_require__(1331);
2694
2591
  // @ts-expect-error Missing types
2695
- const http2wrapper = __nccwpck_require__(7952);
2696
- const lowercaseKeys = __nccwpck_require__(4162);
2697
- const is_1 = __nccwpck_require__(5173);
2698
- const get_body_size_1 = __nccwpck_require__(4543);
2699
- const is_form_data_1 = __nccwpck_require__(8652);
2700
- const proxy_events_1 = __nccwpck_require__(5262);
2701
- const timed_out_1 = __nccwpck_require__(7738);
2702
- const url_to_options_1 = __nccwpck_require__(4892);
2703
- const options_to_url_1 = __nccwpck_require__(1186);
2704
- const weakable_map_1 = __nccwpck_require__(2009);
2705
- const get_buffer_1 = __nccwpck_require__(7342);
2706
- const dns_ip_version_1 = __nccwpck_require__(3371);
2707
- const is_response_ok_1 = __nccwpck_require__(6948);
2708
- const deprecation_warning_1 = __nccwpck_require__(3351);
2709
- const normalize_arguments_1 = __nccwpck_require__(530);
2710
- const calculate_retry_delay_1 = __nccwpck_require__(1879);
2592
+ const http2wrapper = __nccwpck_require__(739);
2593
+ const lowercaseKeys = __nccwpck_require__(2893);
2594
+ const is_1 = __nccwpck_require__(6198);
2595
+ const get_body_size_1 = __nccwpck_require__(7408);
2596
+ const is_form_data_1 = __nccwpck_require__(9502);
2597
+ const proxy_events_1 = __nccwpck_require__(8423);
2598
+ const timed_out_1 = __nccwpck_require__(6843);
2599
+ const url_to_options_1 = __nccwpck_require__(4003);
2600
+ const options_to_url_1 = __nccwpck_require__(8124);
2601
+ const weakable_map_1 = __nccwpck_require__(7849);
2602
+ const get_buffer_1 = __nccwpck_require__(5444);
2603
+ const dns_ip_version_1 = __nccwpck_require__(4254);
2604
+ const is_response_ok_1 = __nccwpck_require__(3117);
2605
+ const deprecation_warning_1 = __nccwpck_require__(5531);
2606
+ const normalize_arguments_1 = __nccwpck_require__(5040);
2607
+ const calculate_retry_delay_1 = __nccwpck_require__(9388);
2711
2608
  let globalDnsCache;
2712
2609
  const kRequest = Symbol('request');
2713
2610
  const kResponse = Symbol('response');
@@ -4186,7 +4083,7 @@ exports["default"] = Request;
4186
4083
 
4187
4084
  /***/ }),
4188
4085
 
4189
- /***/ 3371:
4086
+ /***/ 4254:
4190
4087
  /***/ ((__unused_webpack_module, exports) => {
4191
4088
 
4192
4089
  "use strict";
@@ -4211,7 +4108,7 @@ exports.dnsLookupIpVersionToFamily = (dnsLookupIpVersion) => {
4211
4108
 
4212
4109
  /***/ }),
4213
4110
 
4214
- /***/ 4543:
4111
+ /***/ 7408:
4215
4112
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4216
4113
 
4217
4114
  "use strict";
@@ -4219,8 +4116,8 @@ exports.dnsLookupIpVersionToFamily = (dnsLookupIpVersion) => {
4219
4116
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4220
4117
  const fs_1 = __nccwpck_require__(7147);
4221
4118
  const util_1 = __nccwpck_require__(3837);
4222
- const is_1 = __nccwpck_require__(5173);
4223
- const is_form_data_1 = __nccwpck_require__(8652);
4119
+ const is_1 = __nccwpck_require__(6198);
4120
+ const is_form_data_1 = __nccwpck_require__(9502);
4224
4121
  const statAsync = util_1.promisify(fs_1.stat);
4225
4122
  exports["default"] = async (body, headers) => {
4226
4123
  if (headers && 'content-length' in headers) {
@@ -4251,7 +4148,7 @@ exports["default"] = async (body, headers) => {
4251
4148
 
4252
4149
  /***/ }),
4253
4150
 
4254
- /***/ 7342:
4151
+ /***/ 5444:
4255
4152
  /***/ ((__unused_webpack_module, exports) => {
4256
4153
 
4257
4154
  "use strict";
@@ -4275,19 +4172,19 @@ exports["default"] = getBuffer;
4275
4172
 
4276
4173
  /***/ }),
4277
4174
 
4278
- /***/ 8652:
4175
+ /***/ 9502:
4279
4176
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4280
4177
 
4281
4178
  "use strict";
4282
4179
 
4283
4180
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4284
- const is_1 = __nccwpck_require__(5173);
4181
+ const is_1 = __nccwpck_require__(6198);
4285
4182
  exports["default"] = (body) => is_1.default.nodeStream(body) && is_1.default.function_(body.getBoundary);
4286
4183
 
4287
4184
 
4288
4185
  /***/ }),
4289
4186
 
4290
- /***/ 6948:
4187
+ /***/ 3117:
4291
4188
  /***/ ((__unused_webpack_module, exports) => {
4292
4189
 
4293
4190
  "use strict";
@@ -4303,7 +4200,7 @@ exports.isResponseOk = (response) => {
4303
4200
 
4304
4201
  /***/ }),
4305
4202
 
4306
- /***/ 1186:
4203
+ /***/ 8124:
4307
4204
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4308
4205
 
4309
4206
  "use strict";
@@ -4364,7 +4261,7 @@ exports["default"] = (origin, options) => {
4364
4261
 
4365
4262
  /***/ }),
4366
4263
 
4367
- /***/ 5262:
4264
+ /***/ 8423:
4368
4265
  /***/ ((__unused_webpack_module, exports) => {
4369
4266
 
4370
4267
  "use strict";
@@ -4389,7 +4286,7 @@ exports["default"] = default_1;
4389
4286
 
4390
4287
  /***/ }),
4391
4288
 
4392
- /***/ 7738:
4289
+ /***/ 6843:
4393
4290
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4394
4291
 
4395
4292
  "use strict";
@@ -4397,7 +4294,7 @@ exports["default"] = default_1;
4397
4294
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4398
4295
  exports.TimeoutError = void 0;
4399
4296
  const net = __nccwpck_require__(1808);
4400
- const unhandle_1 = __nccwpck_require__(3762);
4297
+ const unhandle_1 = __nccwpck_require__(6922);
4401
4298
  const reentry = Symbol('reentry');
4402
4299
  const noop = () => { };
4403
4300
  class TimeoutError extends Error {
@@ -4518,7 +4415,7 @@ exports["default"] = (request, delays, options) => {
4518
4415
 
4519
4416
  /***/ }),
4520
4417
 
4521
- /***/ 3762:
4418
+ /***/ 6922:
4522
4419
  /***/ ((__unused_webpack_module, exports) => {
4523
4420
 
4524
4421
  "use strict";
@@ -4548,13 +4445,13 @@ exports["default"] = () => {
4548
4445
 
4549
4446
  /***/ }),
4550
4447
 
4551
- /***/ 4892:
4448
+ /***/ 4003:
4552
4449
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4553
4450
 
4554
4451
  "use strict";
4555
4452
 
4556
4453
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4557
- const is_1 = __nccwpck_require__(5173);
4454
+ const is_1 = __nccwpck_require__(6198);
4558
4455
  exports["default"] = (url) => {
4559
4456
  // Cast to URL
4560
4457
  url = url;
@@ -4580,7 +4477,7 @@ exports["default"] = (url) => {
4580
4477
 
4581
4478
  /***/ }),
4582
4479
 
4583
- /***/ 2009:
4480
+ /***/ 7849:
4584
4481
  /***/ ((__unused_webpack_module, exports) => {
4585
4482
 
4586
4483
  "use strict";
@@ -4617,7 +4514,7 @@ exports["default"] = WeakableMap;
4617
4514
 
4618
4515
  /***/ }),
4619
4516
 
4620
- /***/ 5133:
4517
+ /***/ 9162:
4621
4518
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
4622
4519
 
4623
4520
  "use strict";
@@ -4634,11 +4531,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
4634
4531
  };
4635
4532
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4636
4533
  exports.defaultHandler = void 0;
4637
- const is_1 = __nccwpck_require__(5173);
4638
- const as_promise_1 = __nccwpck_require__(2234);
4639
- const create_rejection_1 = __nccwpck_require__(1729);
4640
- const core_1 = __nccwpck_require__(1032);
4641
- const deep_freeze_1 = __nccwpck_require__(8295);
4534
+ const is_1 = __nccwpck_require__(6198);
4535
+ const as_promise_1 = __nccwpck_require__(6894);
4536
+ const create_rejection_1 = __nccwpck_require__(4827);
4537
+ const core_1 = __nccwpck_require__(8525);
4538
+ const deep_freeze_1 = __nccwpck_require__(2982);
4642
4539
  const errors = {
4643
4540
  RequestError: as_promise_1.RequestError,
4644
4541
  CacheError: as_promise_1.CacheError,
@@ -4860,12 +4757,12 @@ const create = (defaults) => {
4860
4757
  return got;
4861
4758
  };
4862
4759
  exports["default"] = create;
4863
- __exportStar(__nccwpck_require__(5499), exports);
4760
+ __exportStar(__nccwpck_require__(9239), exports);
4864
4761
 
4865
4762
 
4866
4763
  /***/ }),
4867
4764
 
4868
- /***/ 5569:
4765
+ /***/ 9235:
4869
4766
  /***/ (function(module, exports, __nccwpck_require__) {
4870
4767
 
4871
4768
  "use strict";
@@ -4882,7 +4779,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
4882
4779
  };
4883
4780
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4884
4781
  const url_1 = __nccwpck_require__(7310);
4885
- const create_1 = __nccwpck_require__(5133);
4782
+ const create_1 = __nccwpck_require__(9162);
4886
4783
  const defaults = {
4887
4784
  options: {
4888
4785
  method: 'GET',
@@ -4999,13 +4896,13 @@ exports["default"] = got;
4999
4896
  module.exports = got;
5000
4897
  module.exports["default"] = got;
5001
4898
  module.exports.__esModule = true; // Workaround for TS issue: https://github.com/sindresorhus/got/pull/1267
5002
- __exportStar(__nccwpck_require__(5133), exports);
5003
- __exportStar(__nccwpck_require__(2234), exports);
4899
+ __exportStar(__nccwpck_require__(9162), exports);
4900
+ __exportStar(__nccwpck_require__(6894), exports);
5004
4901
 
5005
4902
 
5006
4903
  /***/ }),
5007
4904
 
5008
- /***/ 5499:
4905
+ /***/ 9239:
5009
4906
  /***/ ((__unused_webpack_module, exports) => {
5010
4907
 
5011
4908
  "use strict";
@@ -5015,13 +4912,13 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
5015
4912
 
5016
4913
  /***/ }),
5017
4914
 
5018
- /***/ 8295:
4915
+ /***/ 2982:
5019
4916
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
5020
4917
 
5021
4918
  "use strict";
5022
4919
 
5023
4920
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5024
- const is_1 = __nccwpck_require__(5173);
4921
+ const is_1 = __nccwpck_require__(6198);
5025
4922
  function deepFreeze(object) {
5026
4923
  for (const value of Object.values(object)) {
5027
4924
  if (is_1.default.plainObject(value) || is_1.default.array(value)) {
@@ -5035,7 +4932,7 @@ exports["default"] = deepFreeze;
5035
4932
 
5036
4933
  /***/ }),
5037
4934
 
5038
- /***/ 3351:
4935
+ /***/ 5531:
5039
4936
  /***/ ((__unused_webpack_module, exports) => {
5040
4937
 
5041
4938
  "use strict";
@@ -5056,7 +4953,7 @@ exports["default"] = (message) => {
5056
4953
 
5057
4954
  /***/ }),
5058
4955
 
5059
- /***/ 1454:
4956
+ /***/ 8412:
5060
4957
  /***/ ((module) => {
5061
4958
 
5062
4959
  "use strict";
@@ -5737,15 +5634,15 @@ module.exports = class CachePolicy {
5737
5634
 
5738
5635
  /***/ }),
5739
5636
 
5740
- /***/ 6838:
5637
+ /***/ 6495:
5741
5638
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
5742
5639
 
5743
5640
  "use strict";
5744
5641
 
5745
5642
  const EventEmitter = __nccwpck_require__(2361);
5746
- const tls = __nccwpck_require__(4404);
5643
+ const tls = __nccwpck_require__(6821);
5747
5644
  const http2 = __nccwpck_require__(5158);
5748
- const QuickLRU = __nccwpck_require__(6664);
5645
+ const QuickLRU = __nccwpck_require__(4225);
5749
5646
 
5750
5647
  const kCurrentStreamsCount = Symbol('currentStreamsCount');
5751
5648
  const kRequest = Symbol('request');
@@ -6415,18 +6312,18 @@ module.exports = {
6415
6312
 
6416
6313
  /***/ }),
6417
6314
 
6418
- /***/ 3379:
6315
+ /***/ 229:
6419
6316
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
6420
6317
 
6421
6318
  "use strict";
6422
6319
 
6423
6320
  const http = __nccwpck_require__(3685);
6424
6321
  const https = __nccwpck_require__(5687);
6425
- const resolveALPN = __nccwpck_require__(8826);
6426
- const QuickLRU = __nccwpck_require__(6664);
6427
- const Http2ClientRequest = __nccwpck_require__(2126);
6428
- const calculateServerName = __nccwpck_require__(7161);
6429
- const urlToOptions = __nccwpck_require__(3730);
6322
+ const resolveALPN = __nccwpck_require__(6354);
6323
+ const QuickLRU = __nccwpck_require__(4225);
6324
+ const Http2ClientRequest = __nccwpck_require__(3674);
6325
+ const calculateServerName = __nccwpck_require__(5502);
6326
+ const urlToOptions = __nccwpck_require__(5142);
6430
6327
 
6431
6328
  const cache = new QuickLRU({maxSize: 100});
6432
6329
  const queue = new Map();
@@ -6572,18 +6469,18 @@ module.exports.protocolCache = cache;
6572
6469
 
6573
6470
  /***/ }),
6574
6471
 
6575
- /***/ 2126:
6472
+ /***/ 3674:
6576
6473
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
6577
6474
 
6578
6475
  "use strict";
6579
6476
 
6580
6477
  const http2 = __nccwpck_require__(5158);
6581
6478
  const {Writable} = __nccwpck_require__(2781);
6582
- const {Agent, globalAgent} = __nccwpck_require__(6838);
6583
- const IncomingMessage = __nccwpck_require__(994);
6584
- const urlToOptions = __nccwpck_require__(3730);
6585
- const proxyEvents = __nccwpck_require__(9067);
6586
- const isRequestPseudoHeader = __nccwpck_require__(5864);
6479
+ const {Agent, globalAgent} = __nccwpck_require__(6495);
6480
+ const IncomingMessage = __nccwpck_require__(6877);
6481
+ const urlToOptions = __nccwpck_require__(5142);
6482
+ const proxyEvents = __nccwpck_require__(6993);
6483
+ const isRequestPseudoHeader = __nccwpck_require__(7708);
6587
6484
  const {
6588
6485
  ERR_INVALID_ARG_TYPE,
6589
6486
  ERR_INVALID_PROTOCOL,
@@ -6591,7 +6488,7 @@ const {
6591
6488
  ERR_INVALID_HTTP_TOKEN,
6592
6489
  ERR_HTTP_INVALID_HEADER_VALUE,
6593
6490
  ERR_INVALID_CHAR
6594
- } = __nccwpck_require__(8131);
6491
+ } = __nccwpck_require__(3223);
6595
6492
 
6596
6493
  const {
6597
6494
  HTTP2_HEADER_STATUS,
@@ -7025,7 +6922,7 @@ module.exports = ClientRequest;
7025
6922
 
7026
6923
  /***/ }),
7027
6924
 
7028
- /***/ 994:
6925
+ /***/ 6877:
7029
6926
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
7030
6927
 
7031
6928
  "use strict";
@@ -7091,16 +6988,16 @@ module.exports = IncomingMessage;
7091
6988
 
7092
6989
  /***/ }),
7093
6990
 
7094
- /***/ 7952:
6991
+ /***/ 739:
7095
6992
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
7096
6993
 
7097
6994
  "use strict";
7098
6995
 
7099
6996
  const http2 = __nccwpck_require__(5158);
7100
- const agent = __nccwpck_require__(6838);
7101
- const ClientRequest = __nccwpck_require__(2126);
7102
- const IncomingMessage = __nccwpck_require__(994);
7103
- const auto = __nccwpck_require__(3379);
6997
+ const agent = __nccwpck_require__(6495);
6998
+ const ClientRequest = __nccwpck_require__(3674);
6999
+ const IncomingMessage = __nccwpck_require__(6877);
7000
+ const auto = __nccwpck_require__(229);
7104
7001
 
7105
7002
  const request = (url, options, callback) => {
7106
7003
  return new ClientRequest(url, options, callback);
@@ -7127,7 +7024,7 @@ module.exports = {
7127
7024
 
7128
7025
  /***/ }),
7129
7026
 
7130
- /***/ 7161:
7027
+ /***/ 5502:
7131
7028
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
7132
7029
 
7133
7030
  "use strict";
@@ -7162,7 +7059,7 @@ module.exports = options => {
7162
7059
 
7163
7060
  /***/ }),
7164
7061
 
7165
- /***/ 8131:
7062
+ /***/ 3223:
7166
7063
  /***/ ((module) => {
7167
7064
 
7168
7065
  "use strict";
@@ -7215,7 +7112,7 @@ makeError(TypeError, 'ERR_INVALID_CHAR', args => {
7215
7112
 
7216
7113
  /***/ }),
7217
7114
 
7218
- /***/ 5864:
7115
+ /***/ 7708:
7219
7116
  /***/ ((module) => {
7220
7117
 
7221
7118
  "use strict";
@@ -7236,7 +7133,7 @@ module.exports = header => {
7236
7133
 
7237
7134
  /***/ }),
7238
7135
 
7239
- /***/ 9067:
7136
+ /***/ 6993:
7240
7137
  /***/ ((module) => {
7241
7138
 
7242
7139
  "use strict";
@@ -7251,7 +7148,7 @@ module.exports = (from, to, events) => {
7251
7148
 
7252
7149
  /***/ }),
7253
7150
 
7254
- /***/ 3730:
7151
+ /***/ 5142:
7255
7152
  /***/ ((module) => {
7256
7153
 
7257
7154
  "use strict";
@@ -7284,7 +7181,7 @@ module.exports = url => {
7284
7181
 
7285
7182
  /***/ }),
7286
7183
 
7287
- /***/ 9604:
7184
+ /***/ 3180:
7288
7185
  /***/ ((__unused_webpack_module, exports) => {
7289
7186
 
7290
7187
  //TODO: handle reviver/dehydrate function like normal
@@ -7349,15 +7246,15 @@ exports.parse = function (s) {
7349
7246
 
7350
7247
  /***/ }),
7351
7248
 
7352
- /***/ 787:
7249
+ /***/ 6474:
7353
7250
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
7354
7251
 
7355
7252
  "use strict";
7356
7253
 
7357
7254
 
7358
7255
  const EventEmitter = __nccwpck_require__(2361);
7359
- const JSONB = __nccwpck_require__(9604);
7360
- const compressBrotli = __nccwpck_require__(2809);
7256
+ const JSONB = __nccwpck_require__(3180);
7257
+ const compressBrotli = __nccwpck_require__(996);
7361
7258
 
7362
7259
  const loadStore = options => {
7363
7260
  const adapters = {
@@ -7625,7 +7522,7 @@ module.exports = Keyv;
7625
7522
 
7626
7523
  /***/ }),
7627
7524
 
7628
- /***/ 7650:
7525
+ /***/ 1128:
7629
7526
  /***/ ((module, exports, __nccwpck_require__) => {
7630
7527
 
7631
7528
  /* module decorator */ module = __nccwpck_require__.nmd(module);
@@ -10119,7 +10016,7 @@ module.exports = orderBy;
10119
10016
 
10120
10017
  /***/ }),
10121
10018
 
10122
- /***/ 5002:
10019
+ /***/ 9103:
10123
10020
  /***/ ((module) => {
10124
10021
 
10125
10022
  /**
@@ -10629,7 +10526,7 @@ module.exports = pick;
10629
10526
 
10630
10527
  /***/ }),
10631
10528
 
10632
- /***/ 4162:
10529
+ /***/ 2893:
10633
10530
  /***/ ((module) => {
10634
10531
 
10635
10532
  "use strict";
@@ -10647,7 +10544,7 @@ module.exports = object => {
10647
10544
 
10648
10545
  /***/ }),
10649
10546
 
10650
- /***/ 4240:
10547
+ /***/ 7642:
10651
10548
  /***/ ((module) => {
10652
10549
 
10653
10550
  "use strict";
@@ -10687,7 +10584,7 @@ module.exports = (fromStream, toStream) => {
10687
10584
 
10688
10585
  /***/ }),
10689
10586
 
10690
- /***/ 9021:
10587
+ /***/ 9443:
10691
10588
  /***/ ((module) => {
10692
10589
 
10693
10590
  "use strict";
@@ -10772,7 +10669,7 @@ module.exports = (fromStream, toStream) => {
10772
10669
 
10773
10670
  /***/ }),
10774
10671
 
10775
- /***/ 5299:
10672
+ /***/ 5797:
10776
10673
  /***/ ((module) => {
10777
10674
 
10778
10675
  "use strict";
@@ -10996,10 +10893,10 @@ module.exports = normalizeUrl;
10996
10893
 
10997
10894
  /***/ }),
10998
10895
 
10999
- /***/ 9852:
10896
+ /***/ 2469:
11000
10897
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
11001
10898
 
11002
- var wrappy = __nccwpck_require__(3270)
10899
+ var wrappy = __nccwpck_require__(6540)
11003
10900
  module.exports = wrappy(once)
11004
10901
  module.exports.strict = wrappy(onceStrict)
11005
10902
 
@@ -11045,7 +10942,7 @@ function onceStrict (fn) {
11045
10942
 
11046
10943
  /***/ }),
11047
10944
 
11048
- /***/ 6419:
10945
+ /***/ 5323:
11049
10946
  /***/ ((module) => {
11050
10947
 
11051
10948
  "use strict";
@@ -11164,11 +11061,11 @@ module.exports.CancelError = CancelError;
11164
11061
 
11165
11062
  /***/ }),
11166
11063
 
11167
- /***/ 1619:
11064
+ /***/ 1216:
11168
11065
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
11169
11066
 
11170
- var once = __nccwpck_require__(9852)
11171
- var eos = __nccwpck_require__(1014)
11067
+ var once = __nccwpck_require__(2469)
11068
+ var eos = __nccwpck_require__(1243)
11172
11069
  var fs = __nccwpck_require__(7147) // we only need fs to get the ReadStream and WriteStream prototypes
11173
11070
 
11174
11071
  var noop = function () {}
@@ -11253,15 +11150,15 @@ module.exports = pump
11253
11150
 
11254
11151
  /***/ }),
11255
11152
 
11256
- /***/ 7348:
11153
+ /***/ 2024:
11257
11154
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
11258
11155
 
11259
11156
  "use strict";
11260
11157
 
11261
- const strictUriEncode = __nccwpck_require__(2833);
11262
- const decodeComponent = __nccwpck_require__(3014);
11263
- const splitOnFirst = __nccwpck_require__(1868);
11264
- const filterObject = __nccwpck_require__(1464);
11158
+ const strictUriEncode = __nccwpck_require__(4450);
11159
+ const decodeComponent = __nccwpck_require__(164);
11160
+ const splitOnFirst = __nccwpck_require__(179);
11161
+ const filterObject = __nccwpck_require__(8172);
11265
11162
 
11266
11163
  const isNullOrUndefined = value => value === null || value === undefined;
11267
11164
 
@@ -11743,7 +11640,7 @@ exports.exclude = (input, filter, options) => {
11743
11640
 
11744
11641
  /***/ }),
11745
11642
 
11746
- /***/ 6664:
11643
+ /***/ 4225:
11747
11644
  /***/ ((module) => {
11748
11645
 
11749
11646
  "use strict";
@@ -11874,12 +11771,12 @@ module.exports = QuickLRU;
11874
11771
 
11875
11772
  /***/ }),
11876
11773
 
11877
- /***/ 8826:
11774
+ /***/ 6354:
11878
11775
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
11879
11776
 
11880
11777
  "use strict";
11881
11778
 
11882
- const tls = __nccwpck_require__(4404);
11779
+ const tls = __nccwpck_require__(6821);
11883
11780
 
11884
11781
  module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, reject) => {
11885
11782
  let timeout = false;
@@ -11925,14 +11822,14 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve,
11925
11822
 
11926
11823
  /***/ }),
11927
11824
 
11928
- /***/ 1534:
11825
+ /***/ 4404:
11929
11826
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
11930
11827
 
11931
11828
  "use strict";
11932
11829
 
11933
11830
 
11934
11831
  const Readable = (__nccwpck_require__(2781).Readable);
11935
- const lowercaseKeys = __nccwpck_require__(4162);
11832
+ const lowercaseKeys = __nccwpck_require__(2893);
11936
11833
 
11937
11834
  class Response extends Readable {
11938
11835
  constructor(statusCode, headers, body, url) {
@@ -11967,7 +11864,7 @@ module.exports = Response;
11967
11864
 
11968
11865
  /***/ }),
11969
11866
 
11970
- /***/ 1868:
11867
+ /***/ 179:
11971
11868
  /***/ ((module) => {
11972
11869
 
11973
11870
  "use strict";
@@ -11997,7 +11894,7 @@ module.exports = (string, separator) => {
11997
11894
 
11998
11895
  /***/ }),
11999
11896
 
12000
- /***/ 2833:
11897
+ /***/ 4450:
12001
11898
  /***/ ((module) => {
12002
11899
 
12003
11900
  "use strict";
@@ -12007,7 +11904,7 @@ module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.c
12007
11904
 
12008
11905
  /***/ }),
12009
11906
 
12010
- /***/ 3270:
11907
+ /***/ 6540:
12011
11908
  /***/ ((module) => {
12012
11909
 
12013
11910
  // Returns a wrapper function that returns a wrapped callback
@@ -12047,15 +11944,14 @@ function wrappy (fn, cb) {
12047
11944
 
12048
11945
  /***/ }),
12049
11946
 
12050
- /***/ 6597:
11947
+ /***/ 3933:
12051
11948
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
12052
11949
 
12053
11950
  "use strict";
12054
11951
 
12055
11952
  Object.defineProperty(exports, "__esModule", ({ value: true }));
12056
- exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
12057
- const parseUtil_1 = __nccwpck_require__(7822);
12058
- const util_1 = __nccwpck_require__(809);
11953
+ exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
11954
+ const util_1 = __nccwpck_require__(9973);
12059
11955
  exports.ZodIssueCode = util_1.util.arrayToEnum([
12060
11956
  "invalid_type",
12061
11957
  "invalid_literal",
@@ -12072,6 +11968,7 @@ exports.ZodIssueCode = util_1.util.arrayToEnum([
12072
11968
  "too_big",
12073
11969
  "invalid_intersection_types",
12074
11970
  "not_multiple_of",
11971
+ "not_finite",
12075
11972
  ]);
12076
11973
  const quotelessJson = (obj) => {
12077
11974
  const json = JSON.stringify(obj, null, 2);
@@ -12155,7 +12052,7 @@ class ZodError extends Error {
12155
12052
  return this.message;
12156
12053
  }
12157
12054
  get message() {
12158
- return JSON.stringify(this.issues, parseUtil_1.jsonStringifyReplacer, 2);
12055
+ return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2);
12159
12056
  }
12160
12057
  get isEmpty() {
12161
12058
  return this.issues.length === 0;
@@ -12183,101 +12080,23 @@ ZodError.create = (issues) => {
12183
12080
  const error = new ZodError(issues);
12184
12081
  return error;
12185
12082
  };
12186
- const defaultErrorMap = (issue, _ctx) => {
12187
- let message;
12188
- switch (issue.code) {
12189
- case exports.ZodIssueCode.invalid_type:
12190
- if (issue.received === util_1.ZodParsedType.undefined) {
12191
- message = "Required";
12192
- }
12193
- else {
12194
- message = `Expected ${issue.expected}, received ${issue.received}`;
12195
- }
12196
- break;
12197
- case exports.ZodIssueCode.invalid_literal:
12198
- message = `Invalid literal value, expected ${JSON.stringify(issue.expected, parseUtil_1.jsonStringifyReplacer)}`;
12199
- break;
12200
- case exports.ZodIssueCode.unrecognized_keys:
12201
- message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
12202
- break;
12203
- case exports.ZodIssueCode.invalid_union:
12204
- message = `Invalid input`;
12205
- break;
12206
- case exports.ZodIssueCode.invalid_union_discriminator:
12207
- message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
12208
- break;
12209
- case exports.ZodIssueCode.invalid_enum_value:
12210
- message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
12211
- break;
12212
- case exports.ZodIssueCode.invalid_arguments:
12213
- message = `Invalid function arguments`;
12214
- break;
12215
- case exports.ZodIssueCode.invalid_return_type:
12216
- message = `Invalid function return type`;
12217
- break;
12218
- case exports.ZodIssueCode.invalid_date:
12219
- message = `Invalid date`;
12220
- break;
12221
- case exports.ZodIssueCode.invalid_string:
12222
- if (typeof issue.validation === "object") {
12223
- if ("startsWith" in issue.validation) {
12224
- message = `Invalid input: must start with "${issue.validation.startsWith}"`;
12225
- }
12226
- else if ("endsWith" in issue.validation) {
12227
- message = `Invalid input: must end with "${issue.validation.endsWith}"`;
12228
- }
12229
- else {
12230
- util_1.util.assertNever(issue.validation);
12231
- }
12232
- }
12233
- else if (issue.validation !== "regex") {
12234
- message = `Invalid ${issue.validation}`;
12235
- }
12236
- else {
12237
- message = "Invalid";
12238
- }
12239
- break;
12240
- case exports.ZodIssueCode.too_small:
12241
- if (issue.type === "array")
12242
- message = `Array must contain ${issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
12243
- else if (issue.type === "string")
12244
- message = `String must contain ${issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
12245
- else if (issue.type === "number")
12246
- message = `Number must be greater than ${issue.inclusive ? `or equal to ` : ``}${issue.minimum}`;
12247
- else if (issue.type === "date")
12248
- message = `Date must be greater than ${issue.inclusive ? `or equal to ` : ``}${new Date(issue.minimum)}`;
12249
- else
12250
- message = "Invalid input";
12251
- break;
12252
- case exports.ZodIssueCode.too_big:
12253
- if (issue.type === "array")
12254
- message = `Array must contain ${issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
12255
- else if (issue.type === "string")
12256
- message = `String must contain ${issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
12257
- else if (issue.type === "number")
12258
- message = `Number must be less than ${issue.inclusive ? `or equal to ` : ``}${issue.maximum}`;
12259
- else if (issue.type === "date")
12260
- message = `Date must be smaller than ${issue.inclusive ? `or equal to ` : ``}${new Date(issue.maximum)}`;
12261
- else
12262
- message = "Invalid input";
12263
- break;
12264
- case exports.ZodIssueCode.custom:
12265
- message = `Invalid input`;
12266
- break;
12267
- case exports.ZodIssueCode.invalid_intersection_types:
12268
- message = `Intersection results could not be merged`;
12269
- break;
12270
- case exports.ZodIssueCode.not_multiple_of:
12271
- message = `Number must be a multiple of ${issue.multipleOf}`;
12272
- break;
12273
- default:
12274
- message = _ctx.defaultError;
12275
- util_1.util.assertNever(issue);
12276
- }
12277
- return { message };
12083
+
12084
+
12085
+ /***/ }),
12086
+
12087
+ /***/ 5391:
12088
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
12089
+
12090
+ "use strict";
12091
+
12092
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12093
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12278
12094
  };
12279
- exports.defaultErrorMap = defaultErrorMap;
12280
- let overrideErrorMap = exports.defaultErrorMap;
12095
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
12096
+ exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0;
12097
+ const en_1 = __importDefault(__nccwpck_require__(184));
12098
+ exports.defaultErrorMap = en_1.default;
12099
+ let overrideErrorMap = en_1.default;
12281
12100
  function setErrorMap(map) {
12282
12101
  overrideErrorMap = map;
12283
12102
  }
@@ -12290,7 +12109,7 @@ exports.getErrorMap = getErrorMap;
12290
12109
 
12291
12110
  /***/ }),
12292
12111
 
12293
- /***/ 8857:
12112
+ /***/ 7365:
12294
12113
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
12295
12114
 
12296
12115
  "use strict";
@@ -12306,19 +12125,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12306
12125
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
12307
12126
  };
12308
12127
  Object.defineProperty(exports, "__esModule", ({ value: true }));
12309
- exports.ZodParsedType = exports.getParsedType = void 0;
12310
- __exportStar(__nccwpck_require__(7822), exports);
12311
- __exportStar(__nccwpck_require__(6836), exports);
12312
- var util_1 = __nccwpck_require__(809);
12313
- Object.defineProperty(exports, "getParsedType", ({ enumerable: true, get: function () { return util_1.getParsedType; } }));
12314
- Object.defineProperty(exports, "ZodParsedType", ({ enumerable: true, get: function () { return util_1.ZodParsedType; } }));
12315
- __exportStar(__nccwpck_require__(54), exports);
12316
- __exportStar(__nccwpck_require__(6597), exports);
12128
+ __exportStar(__nccwpck_require__(5391), exports);
12129
+ __exportStar(__nccwpck_require__(3636), exports);
12130
+ __exportStar(__nccwpck_require__(9599), exports);
12131
+ __exportStar(__nccwpck_require__(9973), exports);
12132
+ __exportStar(__nccwpck_require__(7889), exports);
12133
+ __exportStar(__nccwpck_require__(3933), exports);
12317
12134
 
12318
12135
 
12319
12136
  /***/ }),
12320
12137
 
12321
- /***/ 3797:
12138
+ /***/ 9849:
12322
12139
  /***/ ((__unused_webpack_module, exports) => {
12323
12140
 
12324
12141
  "use strict";
@@ -12334,14 +12151,18 @@ var errorUtil;
12334
12151
 
12335
12152
  /***/ }),
12336
12153
 
12337
- /***/ 7822:
12338
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
12154
+ /***/ 3636:
12155
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
12339
12156
 
12340
12157
  "use strict";
12341
12158
 
12159
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12160
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12161
+ };
12342
12162
  Object.defineProperty(exports, "__esModule", ({ value: true }));
12343
- exports.jsonStringifyReplacer = exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0;
12344
- const ZodError_1 = __nccwpck_require__(6597);
12163
+ exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0;
12164
+ const errors_1 = __nccwpck_require__(5391);
12165
+ const en_1 = __importDefault(__nccwpck_require__(184));
12345
12166
  const makeIssue = (params) => {
12346
12167
  const { data, path, errorMaps, issueData } = params;
12347
12168
  const fullPath = [...path, ...(issueData.path || [])];
@@ -12366,15 +12187,15 @@ const makeIssue = (params) => {
12366
12187
  exports.makeIssue = makeIssue;
12367
12188
  exports.EMPTY_PATH = [];
12368
12189
  function addIssueToContext(ctx, issueData) {
12369
- const issue = exports.makeIssue({
12190
+ const issue = (0, exports.makeIssue)({
12370
12191
  issueData: issueData,
12371
12192
  data: ctx.data,
12372
12193
  path: ctx.path,
12373
12194
  errorMaps: [
12374
12195
  ctx.common.contextualErrorMap,
12375
12196
  ctx.schemaErrorMap,
12376
- ZodError_1.getErrorMap(),
12377
- ZodError_1.defaultErrorMap,
12197
+ (0, errors_1.getErrorMap)(),
12198
+ en_1.default, // then global default map
12378
12199
  ].filter((x) => !!x),
12379
12200
  });
12380
12201
  ctx.common.issues.push(issue);
@@ -12448,18 +12269,11 @@ const isValid = (x) => x.status === "valid";
12448
12269
  exports.isValid = isValid;
12449
12270
  const isAsync = (x) => typeof Promise !== undefined && x instanceof Promise;
12450
12271
  exports.isAsync = isAsync;
12451
- const jsonStringifyReplacer = (_, value) => {
12452
- if (typeof value === "bigint") {
12453
- return value.toString();
12454
- }
12455
- return value;
12456
- };
12457
- exports.jsonStringifyReplacer = jsonStringifyReplacer;
12458
12272
 
12459
12273
 
12460
12274
  /***/ }),
12461
12275
 
12462
- /***/ 6836:
12276
+ /***/ 9599:
12463
12277
  /***/ ((__unused_webpack_module, exports) => {
12464
12278
 
12465
12279
  "use strict";
@@ -12469,7 +12283,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
12469
12283
 
12470
12284
  /***/ }),
12471
12285
 
12472
- /***/ 809:
12286
+ /***/ 9973:
12473
12287
  /***/ ((__unused_webpack_module, exports) => {
12474
12288
 
12475
12289
  "use strict";
@@ -12532,6 +12346,12 @@ var util;
12532
12346
  .join(separator);
12533
12347
  }
12534
12348
  util.joinValues = joinValues;
12349
+ util.jsonStringifyReplacer = (_, value) => {
12350
+ if (typeof value === "bigint") {
12351
+ return value.toString();
12352
+ }
12353
+ return value;
12354
+ };
12535
12355
  })(util = exports.util || (exports.util = {}));
12536
12356
  exports.ZodParsedType = util.arrayToEnum([
12537
12357
  "string",
@@ -12570,6 +12390,8 @@ const getParsedType = (data) => {
12570
12390
  return exports.ZodParsedType.function;
12571
12391
  case "bigint":
12572
12392
  return exports.ZodParsedType.bigint;
12393
+ case "symbol":
12394
+ return exports.ZodParsedType.symbol;
12573
12395
  case "object":
12574
12396
  if (Array.isArray(data)) {
12575
12397
  return exports.ZodParsedType.array;
@@ -12602,7 +12424,7 @@ exports.getParsedType = getParsedType;
12602
12424
 
12603
12425
  /***/ }),
12604
12426
 
12605
- /***/ 8062:
12427
+ /***/ 6319:
12606
12428
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
12607
12429
 
12608
12430
  "use strict";
@@ -12631,26 +12453,152 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12631
12453
  };
12632
12454
  Object.defineProperty(exports, "__esModule", ({ value: true }));
12633
12455
  exports.z = void 0;
12634
- const mod = __importStar(__nccwpck_require__(8857));
12456
+ const mod = __importStar(__nccwpck_require__(7365));
12635
12457
  exports.z = mod;
12636
- __exportStar(__nccwpck_require__(8857), exports);
12458
+ __exportStar(__nccwpck_require__(7365), exports);
12637
12459
  exports["default"] = mod;
12638
12460
 
12639
12461
 
12640
12462
  /***/ }),
12641
12463
 
12642
- /***/ 54:
12464
+ /***/ 184:
12465
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
12466
+
12467
+ "use strict";
12468
+
12469
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
12470
+ const util_1 = __nccwpck_require__(9973);
12471
+ const ZodError_1 = __nccwpck_require__(3933);
12472
+ const errorMap = (issue, _ctx) => {
12473
+ let message;
12474
+ switch (issue.code) {
12475
+ case ZodError_1.ZodIssueCode.invalid_type:
12476
+ if (issue.received === util_1.ZodParsedType.undefined) {
12477
+ message = "Required";
12478
+ }
12479
+ else {
12480
+ message = `Expected ${issue.expected}, received ${issue.received}`;
12481
+ }
12482
+ break;
12483
+ case ZodError_1.ZodIssueCode.invalid_literal:
12484
+ message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_1.util.jsonStringifyReplacer)}`;
12485
+ break;
12486
+ case ZodError_1.ZodIssueCode.unrecognized_keys:
12487
+ message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`;
12488
+ break;
12489
+ case ZodError_1.ZodIssueCode.invalid_union:
12490
+ message = `Invalid input`;
12491
+ break;
12492
+ case ZodError_1.ZodIssueCode.invalid_union_discriminator:
12493
+ message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`;
12494
+ break;
12495
+ case ZodError_1.ZodIssueCode.invalid_enum_value:
12496
+ message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`;
12497
+ break;
12498
+ case ZodError_1.ZodIssueCode.invalid_arguments:
12499
+ message = `Invalid function arguments`;
12500
+ break;
12501
+ case ZodError_1.ZodIssueCode.invalid_return_type:
12502
+ message = `Invalid function return type`;
12503
+ break;
12504
+ case ZodError_1.ZodIssueCode.invalid_date:
12505
+ message = `Invalid date`;
12506
+ break;
12507
+ case ZodError_1.ZodIssueCode.invalid_string:
12508
+ if (typeof issue.validation === "object") {
12509
+ if ("startsWith" in issue.validation) {
12510
+ message = `Invalid input: must start with "${issue.validation.startsWith}"`;
12511
+ }
12512
+ else if ("endsWith" in issue.validation) {
12513
+ message = `Invalid input: must end with "${issue.validation.endsWith}"`;
12514
+ }
12515
+ else {
12516
+ util_1.util.assertNever(issue.validation);
12517
+ }
12518
+ }
12519
+ else if (issue.validation !== "regex") {
12520
+ message = `Invalid ${issue.validation}`;
12521
+ }
12522
+ else {
12523
+ message = "Invalid";
12524
+ }
12525
+ break;
12526
+ case ZodError_1.ZodIssueCode.too_small:
12527
+ if (issue.type === "array")
12528
+ message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
12529
+ else if (issue.type === "string")
12530
+ message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
12531
+ else if (issue.type === "number")
12532
+ message = `Number must be ${issue.exact
12533
+ ? `exactly equal to `
12534
+ : issue.inclusive
12535
+ ? `greater than or equal to `
12536
+ : `greater than `}${issue.minimum}`;
12537
+ else if (issue.type === "date")
12538
+ message = `Date must be ${issue.exact
12539
+ ? `exactly equal to `
12540
+ : issue.inclusive
12541
+ ? `greater than or equal to `
12542
+ : `greater than `}${new Date(issue.minimum)}`;
12543
+ else
12544
+ message = "Invalid input";
12545
+ break;
12546
+ case ZodError_1.ZodIssueCode.too_big:
12547
+ if (issue.type === "array")
12548
+ message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
12549
+ else if (issue.type === "string")
12550
+ message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
12551
+ else if (issue.type === "number")
12552
+ message = `Number must be ${issue.exact
12553
+ ? `exactly`
12554
+ : issue.inclusive
12555
+ ? `less than or equal to`
12556
+ : `less than`} ${issue.maximum}`;
12557
+ else if (issue.type === "date")
12558
+ message = `Date must be ${issue.exact
12559
+ ? `exactly`
12560
+ : issue.inclusive
12561
+ ? `smaller than or equal to`
12562
+ : `smaller than`} ${new Date(issue.maximum)}`;
12563
+ else
12564
+ message = "Invalid input";
12565
+ break;
12566
+ case ZodError_1.ZodIssueCode.custom:
12567
+ message = `Invalid input`;
12568
+ break;
12569
+ case ZodError_1.ZodIssueCode.invalid_intersection_types:
12570
+ message = `Intersection results could not be merged`;
12571
+ break;
12572
+ case ZodError_1.ZodIssueCode.not_multiple_of:
12573
+ message = `Number must be a multiple of ${issue.multipleOf}`;
12574
+ break;
12575
+ case ZodError_1.ZodIssueCode.not_finite:
12576
+ message = "Number must be finite";
12577
+ break;
12578
+ default:
12579
+ message = _ctx.defaultError;
12580
+ util_1.util.assertNever(issue);
12581
+ }
12582
+ return { message };
12583
+ };
12584
+ exports["default"] = errorMap;
12585
+
12586
+
12587
+ /***/ }),
12588
+
12589
+ /***/ 7889:
12643
12590
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
12644
12591
 
12645
12592
  "use strict";
12646
12593
 
12647
12594
  Object.defineProperty(exports, "__esModule", ({ value: true }));
12648
- exports["function"] = exports["enum"] = exports.effect = exports.discriminatedUnion = exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.objectUtil = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0;
12649
- exports["void"] = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports["null"] = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports["instanceof"] = void 0;
12650
- const errorUtil_1 = __nccwpck_require__(3797);
12651
- const parseUtil_1 = __nccwpck_require__(7822);
12652
- const util_1 = __nccwpck_require__(809);
12653
- const ZodError_1 = __nccwpck_require__(6597);
12595
+ exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.objectUtil = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0;
12596
+ exports.NEVER = exports["void"] = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports["null"] = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports["instanceof"] = exports["function"] = exports["enum"] = exports.effect = exports.discriminatedUnion = void 0;
12597
+ const errors_1 = __nccwpck_require__(5391);
12598
+ const errorUtil_1 = __nccwpck_require__(9849);
12599
+ const parseUtil_1 = __nccwpck_require__(3636);
12600
+ const util_1 = __nccwpck_require__(9973);
12601
+ const ZodError_1 = __nccwpck_require__(3933);
12654
12602
  class ParseInputLazyPath {
12655
12603
  constructor(parent, value, path, key) {
12656
12604
  this.parent = parent;
@@ -12663,7 +12611,7 @@ class ParseInputLazyPath {
12663
12611
  }
12664
12612
  }
12665
12613
  const handleResult = (ctx, result) => {
12666
- if (parseUtil_1.isValid(result)) {
12614
+ if ((0, parseUtil_1.isValid)(result)) {
12667
12615
  return { success: true, data: result.value };
12668
12616
  }
12669
12617
  else {
@@ -12679,7 +12627,7 @@ function processCreateParams(params) {
12679
12627
  return {};
12680
12628
  const { errorMap, invalid_type_error, required_error, description } = params;
12681
12629
  if (errorMap && (invalid_type_error || required_error)) {
12682
- throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);
12630
+ throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
12683
12631
  }
12684
12632
  if (errorMap)
12685
12633
  return { errorMap: errorMap, description };
@@ -12697,7 +12645,6 @@ class ZodType {
12697
12645
  constructor(def) {
12698
12646
  /** Alias of safeParseAsync */
12699
12647
  this.spa = this.safeParseAsync;
12700
- this.superRefine = this._refinement;
12701
12648
  this._def = def;
12702
12649
  this.parse = this.parse.bind(this);
12703
12650
  this.safeParse = this.safeParse.bind(this);
@@ -12715,8 +12662,11 @@ class ZodType {
12715
12662
  this.or = this.or.bind(this);
12716
12663
  this.and = this.and.bind(this);
12717
12664
  this.transform = this.transform.bind(this);
12665
+ this.brand = this.brand.bind(this);
12718
12666
  this.default = this.default.bind(this);
12667
+ this.catch = this.catch.bind(this);
12719
12668
  this.describe = this.describe.bind(this);
12669
+ this.pipe = this.pipe.bind(this);
12720
12670
  this.isNullable = this.isNullable.bind(this);
12721
12671
  this.isOptional = this.isOptional.bind(this);
12722
12672
  }
@@ -12724,13 +12674,13 @@ class ZodType {
12724
12674
  return this._def.description;
12725
12675
  }
12726
12676
  _getType(input) {
12727
- return util_1.getParsedType(input.data);
12677
+ return (0, util_1.getParsedType)(input.data);
12728
12678
  }
12729
12679
  _getOrReturnCtx(input, ctx) {
12730
12680
  return (ctx || {
12731
12681
  common: input.parent.common,
12732
12682
  data: input.data,
12733
- parsedType: util_1.getParsedType(input.data),
12683
+ parsedType: (0, util_1.getParsedType)(input.data),
12734
12684
  schemaErrorMap: this._def.errorMap,
12735
12685
  path: input.path,
12736
12686
  parent: input.parent,
@@ -12742,7 +12692,7 @@ class ZodType {
12742
12692
  ctx: {
12743
12693
  common: input.parent.common,
12744
12694
  data: input.data,
12745
- parsedType: util_1.getParsedType(input.data),
12695
+ parsedType: (0, util_1.getParsedType)(input.data),
12746
12696
  schemaErrorMap: this._def.errorMap,
12747
12697
  path: input.path,
12748
12698
  parent: input.parent,
@@ -12751,7 +12701,7 @@ class ZodType {
12751
12701
  }
12752
12702
  _parseSync(input) {
12753
12703
  const result = this._parse(input);
12754
- if (parseUtil_1.isAsync(result)) {
12704
+ if ((0, parseUtil_1.isAsync)(result)) {
12755
12705
  throw new Error("Synchronous parse encountered promise.");
12756
12706
  }
12757
12707
  return result;
@@ -12778,7 +12728,7 @@ class ZodType {
12778
12728
  schemaErrorMap: this._def.errorMap,
12779
12729
  parent: null,
12780
12730
  data,
12781
- parsedType: util_1.getParsedType(data),
12731
+ parsedType: (0, util_1.getParsedType)(data),
12782
12732
  };
12783
12733
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
12784
12734
  return handleResult(ctx, result);
@@ -12800,10 +12750,10 @@ class ZodType {
12800
12750
  schemaErrorMap: this._def.errorMap,
12801
12751
  parent: null,
12802
12752
  data,
12803
- parsedType: util_1.getParsedType(data),
12753
+ parsedType: (0, util_1.getParsedType)(data),
12804
12754
  };
12805
- const maybeAsyncResult = this._parse({ data, path: [], parent: ctx });
12806
- const result = await (parseUtil_1.isAsync(maybeAsyncResult)
12755
+ const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
12756
+ const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult)
12807
12757
  ? maybeAsyncResult
12808
12758
  : Promise.resolve(maybeAsyncResult));
12809
12759
  return handleResult(ctx, result);
@@ -12866,6 +12816,9 @@ class ZodType {
12866
12816
  effect: { type: "refinement", refinement },
12867
12817
  });
12868
12818
  }
12819
+ superRefine(refinement) {
12820
+ return this._refinement(refinement);
12821
+ }
12869
12822
  optional() {
12870
12823
  return ZodOptional.create(this);
12871
12824
  }
@@ -12909,13 +12862,24 @@ class ZodType {
12909
12862
  ...processCreateParams(undefined),
12910
12863
  });
12911
12864
  }
12912
- describe(description) {
12913
- const This = this.constructor;
12914
- return new This({
12915
- ...this._def,
12865
+ catch(def) {
12866
+ const defaultValueFunc = typeof def === "function" ? def : () => def;
12867
+ return new ZodCatch({
12868
+ innerType: this,
12869
+ defaultValue: defaultValueFunc,
12870
+ typeName: ZodFirstPartyTypeKind.ZodCatch,
12871
+ });
12872
+ }
12873
+ describe(description) {
12874
+ const This = this.constructor;
12875
+ return new This({
12876
+ ...this._def,
12916
12877
  description,
12917
12878
  });
12918
12879
  }
12880
+ pipe(target) {
12881
+ return ZodPipeline.create(this, target);
12882
+ }
12919
12883
  isOptional() {
12920
12884
  return this.safeParse(undefined).success;
12921
12885
  }
@@ -12933,6 +12897,39 @@ const uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-
12933
12897
  // const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
12934
12898
  // eslint-disable-next-line
12935
12899
  const emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
12900
+ // interface IsDateStringOptions extends StringDateOptions {
12901
+ /**
12902
+ * Match any configuration
12903
+ */
12904
+ // any?: boolean;
12905
+ // }
12906
+ // Adapted from https://stackoverflow.com/a/3143231
12907
+ const datetimeRegex = (args) => {
12908
+ if (args.precision) {
12909
+ if (args.offset) {
12910
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
12911
+ }
12912
+ else {
12913
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
12914
+ }
12915
+ }
12916
+ else if (args.precision === 0) {
12917
+ if (args.offset) {
12918
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
12919
+ }
12920
+ else {
12921
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
12922
+ }
12923
+ }
12924
+ else {
12925
+ if (args.offset) {
12926
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
12927
+ }
12928
+ else {
12929
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
12930
+ }
12931
+ }
12932
+ };
12936
12933
  class ZodString extends ZodType {
12937
12934
  constructor() {
12938
12935
  super(...arguments);
@@ -12952,10 +12949,13 @@ class ZodString extends ZodType {
12952
12949
  });
12953
12950
  }
12954
12951
  _parse(input) {
12952
+ if (this._def.coerce) {
12953
+ input.data = String(input.data);
12954
+ }
12955
12955
  const parsedType = this._getType(input);
12956
12956
  if (parsedType !== util_1.ZodParsedType.string) {
12957
12957
  const ctx = this._getOrReturnCtx(input);
12958
- parseUtil_1.addIssueToContext(ctx, {
12958
+ (0, parseUtil_1.addIssueToContext)(ctx, {
12959
12959
  code: ZodError_1.ZodIssueCode.invalid_type,
12960
12960
  expected: util_1.ZodParsedType.string,
12961
12961
  received: ctx.parsedType,
@@ -12970,11 +12970,12 @@ class ZodString extends ZodType {
12970
12970
  if (check.kind === "min") {
12971
12971
  if (input.data.length < check.value) {
12972
12972
  ctx = this._getOrReturnCtx(input, ctx);
12973
- parseUtil_1.addIssueToContext(ctx, {
12973
+ (0, parseUtil_1.addIssueToContext)(ctx, {
12974
12974
  code: ZodError_1.ZodIssueCode.too_small,
12975
12975
  minimum: check.value,
12976
12976
  type: "string",
12977
12977
  inclusive: true,
12978
+ exact: false,
12978
12979
  message: check.message,
12979
12980
  });
12980
12981
  status.dirty();
@@ -12983,20 +12984,49 @@ class ZodString extends ZodType {
12983
12984
  else if (check.kind === "max") {
12984
12985
  if (input.data.length > check.value) {
12985
12986
  ctx = this._getOrReturnCtx(input, ctx);
12986
- parseUtil_1.addIssueToContext(ctx, {
12987
+ (0, parseUtil_1.addIssueToContext)(ctx, {
12987
12988
  code: ZodError_1.ZodIssueCode.too_big,
12988
12989
  maximum: check.value,
12989
12990
  type: "string",
12990
12991
  inclusive: true,
12992
+ exact: false,
12991
12993
  message: check.message,
12992
12994
  });
12993
12995
  status.dirty();
12994
12996
  }
12995
12997
  }
12998
+ else if (check.kind === "length") {
12999
+ const tooBig = input.data.length > check.value;
13000
+ const tooSmall = input.data.length < check.value;
13001
+ if (tooBig || tooSmall) {
13002
+ ctx = this._getOrReturnCtx(input, ctx);
13003
+ if (tooBig) {
13004
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13005
+ code: ZodError_1.ZodIssueCode.too_big,
13006
+ maximum: check.value,
13007
+ type: "string",
13008
+ inclusive: true,
13009
+ exact: true,
13010
+ message: check.message,
13011
+ });
13012
+ }
13013
+ else if (tooSmall) {
13014
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13015
+ code: ZodError_1.ZodIssueCode.too_small,
13016
+ minimum: check.value,
13017
+ type: "string",
13018
+ inclusive: true,
13019
+ exact: true,
13020
+ message: check.message,
13021
+ });
13022
+ }
13023
+ status.dirty();
13024
+ }
13025
+ }
12996
13026
  else if (check.kind === "email") {
12997
13027
  if (!emailRegex.test(input.data)) {
12998
13028
  ctx = this._getOrReturnCtx(input, ctx);
12999
- parseUtil_1.addIssueToContext(ctx, {
13029
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13000
13030
  validation: "email",
13001
13031
  code: ZodError_1.ZodIssueCode.invalid_string,
13002
13032
  message: check.message,
@@ -13007,7 +13037,7 @@ class ZodString extends ZodType {
13007
13037
  else if (check.kind === "uuid") {
13008
13038
  if (!uuidRegex.test(input.data)) {
13009
13039
  ctx = this._getOrReturnCtx(input, ctx);
13010
- parseUtil_1.addIssueToContext(ctx, {
13040
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13011
13041
  validation: "uuid",
13012
13042
  code: ZodError_1.ZodIssueCode.invalid_string,
13013
13043
  message: check.message,
@@ -13018,7 +13048,7 @@ class ZodString extends ZodType {
13018
13048
  else if (check.kind === "cuid") {
13019
13049
  if (!cuidRegex.test(input.data)) {
13020
13050
  ctx = this._getOrReturnCtx(input, ctx);
13021
- parseUtil_1.addIssueToContext(ctx, {
13051
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13022
13052
  validation: "cuid",
13023
13053
  code: ZodError_1.ZodIssueCode.invalid_string,
13024
13054
  message: check.message,
@@ -13032,7 +13062,7 @@ class ZodString extends ZodType {
13032
13062
  }
13033
13063
  catch (_a) {
13034
13064
  ctx = this._getOrReturnCtx(input, ctx);
13035
- parseUtil_1.addIssueToContext(ctx, {
13065
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13036
13066
  validation: "url",
13037
13067
  code: ZodError_1.ZodIssueCode.invalid_string,
13038
13068
  message: check.message,
@@ -13045,7 +13075,7 @@ class ZodString extends ZodType {
13045
13075
  const testResult = check.regex.test(input.data);
13046
13076
  if (!testResult) {
13047
13077
  ctx = this._getOrReturnCtx(input, ctx);
13048
- parseUtil_1.addIssueToContext(ctx, {
13078
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13049
13079
  validation: "regex",
13050
13080
  code: ZodError_1.ZodIssueCode.invalid_string,
13051
13081
  message: check.message,
@@ -13059,7 +13089,7 @@ class ZodString extends ZodType {
13059
13089
  else if (check.kind === "startsWith") {
13060
13090
  if (!input.data.startsWith(check.value)) {
13061
13091
  ctx = this._getOrReturnCtx(input, ctx);
13062
- parseUtil_1.addIssueToContext(ctx, {
13092
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13063
13093
  code: ZodError_1.ZodIssueCode.invalid_string,
13064
13094
  validation: { startsWith: check.value },
13065
13095
  message: check.message,
@@ -13070,7 +13100,7 @@ class ZodString extends ZodType {
13070
13100
  else if (check.kind === "endsWith") {
13071
13101
  if (!input.data.endsWith(check.value)) {
13072
13102
  ctx = this._getOrReturnCtx(input, ctx);
13073
- parseUtil_1.addIssueToContext(ctx, {
13103
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13074
13104
  code: ZodError_1.ZodIssueCode.invalid_string,
13075
13105
  validation: { endsWith: check.value },
13076
13106
  message: check.message,
@@ -13078,6 +13108,18 @@ class ZodString extends ZodType {
13078
13108
  status.dirty();
13079
13109
  }
13080
13110
  }
13111
+ else if (check.kind === "datetime") {
13112
+ const regex = datetimeRegex(check);
13113
+ if (!regex.test(input.data)) {
13114
+ ctx = this._getOrReturnCtx(input, ctx);
13115
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13116
+ code: ZodError_1.ZodIssueCode.invalid_string,
13117
+ validation: "datetime",
13118
+ message: check.message,
13119
+ });
13120
+ status.dirty();
13121
+ }
13122
+ }
13081
13123
  else {
13082
13124
  util_1.util.assertNever(check);
13083
13125
  }
@@ -13102,6 +13144,23 @@ class ZodString extends ZodType {
13102
13144
  cuid(message) {
13103
13145
  return this._addCheck({ kind: "cuid", ...errorUtil_1.errorUtil.errToObj(message) });
13104
13146
  }
13147
+ datetime(options) {
13148
+ var _a;
13149
+ if (typeof options === "string") {
13150
+ return this._addCheck({
13151
+ kind: "datetime",
13152
+ precision: null,
13153
+ offset: false,
13154
+ message: options,
13155
+ });
13156
+ }
13157
+ return this._addCheck({
13158
+ kind: "datetime",
13159
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
13160
+ offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
13161
+ ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
13162
+ });
13163
+ }
13105
13164
  regex(regex, message) {
13106
13165
  return this._addCheck({
13107
13166
  kind: "regex",
@@ -13138,7 +13197,14 @@ class ZodString extends ZodType {
13138
13197
  });
13139
13198
  }
13140
13199
  length(len, message) {
13141
- return this.min(len, message).max(len, message);
13200
+ return this._addCheck({
13201
+ kind: "length",
13202
+ value: len,
13203
+ ...errorUtil_1.errorUtil.errToObj(message),
13204
+ });
13205
+ }
13206
+ get isDatetime() {
13207
+ return !!this._def.checks.find((ch) => ch.kind === "datetime");
13142
13208
  }
13143
13209
  get isEmail() {
13144
13210
  return !!this._def.checks.find((ch) => ch.kind === "email");
@@ -13175,9 +13241,11 @@ class ZodString extends ZodType {
13175
13241
  }
13176
13242
  exports.ZodString = ZodString;
13177
13243
  ZodString.create = (params) => {
13244
+ var _a;
13178
13245
  return new ZodString({
13179
13246
  checks: [],
13180
13247
  typeName: ZodFirstPartyTypeKind.ZodString,
13248
+ coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
13181
13249
  ...processCreateParams(params),
13182
13250
  });
13183
13251
  };
@@ -13198,10 +13266,13 @@ class ZodNumber extends ZodType {
13198
13266
  this.step = this.multipleOf;
13199
13267
  }
13200
13268
  _parse(input) {
13269
+ if (this._def.coerce) {
13270
+ input.data = Number(input.data);
13271
+ }
13201
13272
  const parsedType = this._getType(input);
13202
13273
  if (parsedType !== util_1.ZodParsedType.number) {
13203
13274
  const ctx = this._getOrReturnCtx(input);
13204
- parseUtil_1.addIssueToContext(ctx, {
13275
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13205
13276
  code: ZodError_1.ZodIssueCode.invalid_type,
13206
13277
  expected: util_1.ZodParsedType.number,
13207
13278
  received: ctx.parsedType,
@@ -13214,7 +13285,7 @@ class ZodNumber extends ZodType {
13214
13285
  if (check.kind === "int") {
13215
13286
  if (!util_1.util.isInteger(input.data)) {
13216
13287
  ctx = this._getOrReturnCtx(input, ctx);
13217
- parseUtil_1.addIssueToContext(ctx, {
13288
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13218
13289
  code: ZodError_1.ZodIssueCode.invalid_type,
13219
13290
  expected: "integer",
13220
13291
  received: "float",
@@ -13229,11 +13300,12 @@ class ZodNumber extends ZodType {
13229
13300
  : input.data <= check.value;
13230
13301
  if (tooSmall) {
13231
13302
  ctx = this._getOrReturnCtx(input, ctx);
13232
- parseUtil_1.addIssueToContext(ctx, {
13303
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13233
13304
  code: ZodError_1.ZodIssueCode.too_small,
13234
13305
  minimum: check.value,
13235
13306
  type: "number",
13236
13307
  inclusive: check.inclusive,
13308
+ exact: false,
13237
13309
  message: check.message,
13238
13310
  });
13239
13311
  status.dirty();
@@ -13245,11 +13317,12 @@ class ZodNumber extends ZodType {
13245
13317
  : input.data >= check.value;
13246
13318
  if (tooBig) {
13247
13319
  ctx = this._getOrReturnCtx(input, ctx);
13248
- parseUtil_1.addIssueToContext(ctx, {
13320
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13249
13321
  code: ZodError_1.ZodIssueCode.too_big,
13250
13322
  maximum: check.value,
13251
13323
  type: "number",
13252
13324
  inclusive: check.inclusive,
13325
+ exact: false,
13253
13326
  message: check.message,
13254
13327
  });
13255
13328
  status.dirty();
@@ -13258,7 +13331,7 @@ class ZodNumber extends ZodType {
13258
13331
  else if (check.kind === "multipleOf") {
13259
13332
  if (floatSafeRemainder(input.data, check.value) !== 0) {
13260
13333
  ctx = this._getOrReturnCtx(input, ctx);
13261
- parseUtil_1.addIssueToContext(ctx, {
13334
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13262
13335
  code: ZodError_1.ZodIssueCode.not_multiple_of,
13263
13336
  multipleOf: check.value,
13264
13337
  message: check.message,
@@ -13266,6 +13339,16 @@ class ZodNumber extends ZodType {
13266
13339
  status.dirty();
13267
13340
  }
13268
13341
  }
13342
+ else if (check.kind === "finite") {
13343
+ if (!Number.isFinite(input.data)) {
13344
+ ctx = this._getOrReturnCtx(input, ctx);
13345
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13346
+ code: ZodError_1.ZodIssueCode.not_finite,
13347
+ message: check.message,
13348
+ });
13349
+ status.dirty();
13350
+ }
13351
+ }
13269
13352
  else {
13270
13353
  util_1.util.assertNever(check);
13271
13354
  }
@@ -13349,6 +13432,12 @@ class ZodNumber extends ZodType {
13349
13432
  message: errorUtil_1.errorUtil.toString(message),
13350
13433
  });
13351
13434
  }
13435
+ finite(message) {
13436
+ return this._addCheck({
13437
+ kind: "finite",
13438
+ message: errorUtil_1.errorUtil.toString(message),
13439
+ });
13440
+ }
13352
13441
  get minValue() {
13353
13442
  let min = null;
13354
13443
  for (const ch of this._def.checks) {
@@ -13378,59 +13467,72 @@ ZodNumber.create = (params) => {
13378
13467
  return new ZodNumber({
13379
13468
  checks: [],
13380
13469
  typeName: ZodFirstPartyTypeKind.ZodNumber,
13470
+ coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
13381
13471
  ...processCreateParams(params),
13382
13472
  });
13383
13473
  };
13384
13474
  class ZodBigInt extends ZodType {
13385
13475
  _parse(input) {
13476
+ if (this._def.coerce) {
13477
+ input.data = BigInt(input.data);
13478
+ }
13386
13479
  const parsedType = this._getType(input);
13387
13480
  if (parsedType !== util_1.ZodParsedType.bigint) {
13388
13481
  const ctx = this._getOrReturnCtx(input);
13389
- parseUtil_1.addIssueToContext(ctx, {
13482
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13390
13483
  code: ZodError_1.ZodIssueCode.invalid_type,
13391
13484
  expected: util_1.ZodParsedType.bigint,
13392
13485
  received: ctx.parsedType,
13393
13486
  });
13394
13487
  return parseUtil_1.INVALID;
13395
13488
  }
13396
- return parseUtil_1.OK(input.data);
13489
+ return (0, parseUtil_1.OK)(input.data);
13397
13490
  }
13398
13491
  }
13399
13492
  exports.ZodBigInt = ZodBigInt;
13400
13493
  ZodBigInt.create = (params) => {
13494
+ var _a;
13401
13495
  return new ZodBigInt({
13402
13496
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
13497
+ coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
13403
13498
  ...processCreateParams(params),
13404
13499
  });
13405
13500
  };
13406
13501
  class ZodBoolean extends ZodType {
13407
13502
  _parse(input) {
13503
+ if (this._def.coerce) {
13504
+ input.data = Boolean(input.data);
13505
+ }
13408
13506
  const parsedType = this._getType(input);
13409
13507
  if (parsedType !== util_1.ZodParsedType.boolean) {
13410
13508
  const ctx = this._getOrReturnCtx(input);
13411
- parseUtil_1.addIssueToContext(ctx, {
13509
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13412
13510
  code: ZodError_1.ZodIssueCode.invalid_type,
13413
13511
  expected: util_1.ZodParsedType.boolean,
13414
13512
  received: ctx.parsedType,
13415
13513
  });
13416
13514
  return parseUtil_1.INVALID;
13417
13515
  }
13418
- return parseUtil_1.OK(input.data);
13516
+ return (0, parseUtil_1.OK)(input.data);
13419
13517
  }
13420
13518
  }
13421
13519
  exports.ZodBoolean = ZodBoolean;
13422
13520
  ZodBoolean.create = (params) => {
13423
13521
  return new ZodBoolean({
13424
13522
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
13523
+ coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
13425
13524
  ...processCreateParams(params),
13426
13525
  });
13427
13526
  };
13428
13527
  class ZodDate extends ZodType {
13429
13528
  _parse(input) {
13529
+ if (this._def.coerce) {
13530
+ input.data = new Date(input.data);
13531
+ }
13430
13532
  const parsedType = this._getType(input);
13431
13533
  if (parsedType !== util_1.ZodParsedType.date) {
13432
13534
  const ctx = this._getOrReturnCtx(input);
13433
- parseUtil_1.addIssueToContext(ctx, {
13535
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13434
13536
  code: ZodError_1.ZodIssueCode.invalid_type,
13435
13537
  expected: util_1.ZodParsedType.date,
13436
13538
  received: ctx.parsedType,
@@ -13439,7 +13541,7 @@ class ZodDate extends ZodType {
13439
13541
  }
13440
13542
  if (isNaN(input.data.getTime())) {
13441
13543
  const ctx = this._getOrReturnCtx(input);
13442
- parseUtil_1.addIssueToContext(ctx, {
13544
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13443
13545
  code: ZodError_1.ZodIssueCode.invalid_date,
13444
13546
  });
13445
13547
  return parseUtil_1.INVALID;
@@ -13450,10 +13552,11 @@ class ZodDate extends ZodType {
13450
13552
  if (check.kind === "min") {
13451
13553
  if (input.data.getTime() < check.value) {
13452
13554
  ctx = this._getOrReturnCtx(input, ctx);
13453
- parseUtil_1.addIssueToContext(ctx, {
13555
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13454
13556
  code: ZodError_1.ZodIssueCode.too_small,
13455
13557
  message: check.message,
13456
13558
  inclusive: true,
13559
+ exact: false,
13457
13560
  minimum: check.value,
13458
13561
  type: "date",
13459
13562
  });
@@ -13463,10 +13566,11 @@ class ZodDate extends ZodType {
13463
13566
  else if (check.kind === "max") {
13464
13567
  if (input.data.getTime() > check.value) {
13465
13568
  ctx = this._getOrReturnCtx(input, ctx);
13466
- parseUtil_1.addIssueToContext(ctx, {
13569
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13467
13570
  code: ZodError_1.ZodIssueCode.too_big,
13468
13571
  message: check.message,
13469
13572
  inclusive: true,
13573
+ exact: false,
13470
13574
  maximum: check.value,
13471
13575
  type: "date",
13472
13576
  });
@@ -13527,23 +13631,46 @@ exports.ZodDate = ZodDate;
13527
13631
  ZodDate.create = (params) => {
13528
13632
  return new ZodDate({
13529
13633
  checks: [],
13634
+ coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
13530
13635
  typeName: ZodFirstPartyTypeKind.ZodDate,
13531
13636
  ...processCreateParams(params),
13532
13637
  });
13533
13638
  };
13639
+ class ZodSymbol extends ZodType {
13640
+ _parse(input) {
13641
+ const parsedType = this._getType(input);
13642
+ if (parsedType !== util_1.ZodParsedType.symbol) {
13643
+ const ctx = this._getOrReturnCtx(input);
13644
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13645
+ code: ZodError_1.ZodIssueCode.invalid_type,
13646
+ expected: util_1.ZodParsedType.symbol,
13647
+ received: ctx.parsedType,
13648
+ });
13649
+ return parseUtil_1.INVALID;
13650
+ }
13651
+ return (0, parseUtil_1.OK)(input.data);
13652
+ }
13653
+ }
13654
+ exports.ZodSymbol = ZodSymbol;
13655
+ ZodSymbol.create = (params) => {
13656
+ return new ZodSymbol({
13657
+ typeName: ZodFirstPartyTypeKind.ZodSymbol,
13658
+ ...processCreateParams(params),
13659
+ });
13660
+ };
13534
13661
  class ZodUndefined extends ZodType {
13535
13662
  _parse(input) {
13536
13663
  const parsedType = this._getType(input);
13537
13664
  if (parsedType !== util_1.ZodParsedType.undefined) {
13538
13665
  const ctx = this._getOrReturnCtx(input);
13539
- parseUtil_1.addIssueToContext(ctx, {
13666
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13540
13667
  code: ZodError_1.ZodIssueCode.invalid_type,
13541
13668
  expected: util_1.ZodParsedType.undefined,
13542
13669
  received: ctx.parsedType,
13543
13670
  });
13544
13671
  return parseUtil_1.INVALID;
13545
13672
  }
13546
- return parseUtil_1.OK(input.data);
13673
+ return (0, parseUtil_1.OK)(input.data);
13547
13674
  }
13548
13675
  }
13549
13676
  exports.ZodUndefined = ZodUndefined;
@@ -13558,14 +13685,14 @@ class ZodNull extends ZodType {
13558
13685
  const parsedType = this._getType(input);
13559
13686
  if (parsedType !== util_1.ZodParsedType.null) {
13560
13687
  const ctx = this._getOrReturnCtx(input);
13561
- parseUtil_1.addIssueToContext(ctx, {
13688
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13562
13689
  code: ZodError_1.ZodIssueCode.invalid_type,
13563
13690
  expected: util_1.ZodParsedType.null,
13564
13691
  received: ctx.parsedType,
13565
13692
  });
13566
13693
  return parseUtil_1.INVALID;
13567
13694
  }
13568
- return parseUtil_1.OK(input.data);
13695
+ return (0, parseUtil_1.OK)(input.data);
13569
13696
  }
13570
13697
  }
13571
13698
  exports.ZodNull = ZodNull;
@@ -13582,7 +13709,7 @@ class ZodAny extends ZodType {
13582
13709
  this._any = true;
13583
13710
  }
13584
13711
  _parse(input) {
13585
- return parseUtil_1.OK(input.data);
13712
+ return (0, parseUtil_1.OK)(input.data);
13586
13713
  }
13587
13714
  }
13588
13715
  exports.ZodAny = ZodAny;
@@ -13599,7 +13726,7 @@ class ZodUnknown extends ZodType {
13599
13726
  this._unknown = true;
13600
13727
  }
13601
13728
  _parse(input) {
13602
- return parseUtil_1.OK(input.data);
13729
+ return (0, parseUtil_1.OK)(input.data);
13603
13730
  }
13604
13731
  }
13605
13732
  exports.ZodUnknown = ZodUnknown;
@@ -13612,7 +13739,7 @@ ZodUnknown.create = (params) => {
13612
13739
  class ZodNever extends ZodType {
13613
13740
  _parse(input) {
13614
13741
  const ctx = this._getOrReturnCtx(input);
13615
- parseUtil_1.addIssueToContext(ctx, {
13742
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13616
13743
  code: ZodError_1.ZodIssueCode.invalid_type,
13617
13744
  expected: util_1.ZodParsedType.never,
13618
13745
  received: ctx.parsedType,
@@ -13632,14 +13759,14 @@ class ZodVoid extends ZodType {
13632
13759
  const parsedType = this._getType(input);
13633
13760
  if (parsedType !== util_1.ZodParsedType.undefined) {
13634
13761
  const ctx = this._getOrReturnCtx(input);
13635
- parseUtil_1.addIssueToContext(ctx, {
13762
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13636
13763
  code: ZodError_1.ZodIssueCode.invalid_type,
13637
13764
  expected: util_1.ZodParsedType.void,
13638
13765
  received: ctx.parsedType,
13639
13766
  });
13640
13767
  return parseUtil_1.INVALID;
13641
13768
  }
13642
- return parseUtil_1.OK(input.data);
13769
+ return (0, parseUtil_1.OK)(input.data);
13643
13770
  }
13644
13771
  }
13645
13772
  exports.ZodVoid = ZodVoid;
@@ -13654,20 +13781,37 @@ class ZodArray extends ZodType {
13654
13781
  const { ctx, status } = this._processInputParams(input);
13655
13782
  const def = this._def;
13656
13783
  if (ctx.parsedType !== util_1.ZodParsedType.array) {
13657
- parseUtil_1.addIssueToContext(ctx, {
13784
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13658
13785
  code: ZodError_1.ZodIssueCode.invalid_type,
13659
13786
  expected: util_1.ZodParsedType.array,
13660
13787
  received: ctx.parsedType,
13661
13788
  });
13662
13789
  return parseUtil_1.INVALID;
13663
13790
  }
13791
+ if (def.exactLength !== null) {
13792
+ const tooBig = ctx.data.length > def.exactLength.value;
13793
+ const tooSmall = ctx.data.length < def.exactLength.value;
13794
+ if (tooBig || tooSmall) {
13795
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13796
+ code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small,
13797
+ minimum: (tooSmall ? def.exactLength.value : undefined),
13798
+ maximum: (tooBig ? def.exactLength.value : undefined),
13799
+ type: "array",
13800
+ inclusive: true,
13801
+ exact: true,
13802
+ message: def.exactLength.message,
13803
+ });
13804
+ status.dirty();
13805
+ }
13806
+ }
13664
13807
  if (def.minLength !== null) {
13665
13808
  if (ctx.data.length < def.minLength.value) {
13666
- parseUtil_1.addIssueToContext(ctx, {
13809
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13667
13810
  code: ZodError_1.ZodIssueCode.too_small,
13668
13811
  minimum: def.minLength.value,
13669
13812
  type: "array",
13670
13813
  inclusive: true,
13814
+ exact: false,
13671
13815
  message: def.minLength.message,
13672
13816
  });
13673
13817
  status.dirty();
@@ -13675,11 +13819,12 @@ class ZodArray extends ZodType {
13675
13819
  }
13676
13820
  if (def.maxLength !== null) {
13677
13821
  if (ctx.data.length > def.maxLength.value) {
13678
- parseUtil_1.addIssueToContext(ctx, {
13822
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13679
13823
  code: ZodError_1.ZodIssueCode.too_big,
13680
13824
  maximum: def.maxLength.value,
13681
13825
  type: "array",
13682
13826
  inclusive: true,
13827
+ exact: false,
13683
13828
  message: def.maxLength.message,
13684
13829
  });
13685
13830
  status.dirty();
@@ -13713,7 +13858,10 @@ class ZodArray extends ZodType {
13713
13858
  });
13714
13859
  }
13715
13860
  length(len, message) {
13716
- return this.min(len, message).max(len, message);
13861
+ return new ZodArray({
13862
+ ...this._def,
13863
+ exactLength: { value: len, message: errorUtil_1.errorUtil.toString(message) },
13864
+ });
13717
13865
  }
13718
13866
  nonempty(message) {
13719
13867
  return this.min(1, message);
@@ -13725,6 +13873,7 @@ ZodArray.create = (schema, params) => {
13725
13873
  type: schema,
13726
13874
  minLength: null,
13727
13875
  maxLength: null,
13876
+ exactLength: null,
13728
13877
  typeName: ZodFirstPartyTypeKind.ZodArray,
13729
13878
  ...processCreateParams(params),
13730
13879
  });
@@ -13741,7 +13890,7 @@ var objectUtil;
13741
13890
  objectUtil.mergeShapes = (first, second) => {
13742
13891
  return {
13743
13892
  ...first,
13744
- ...second,
13893
+ ...second, // second overwrites first
13745
13894
  };
13746
13895
  };
13747
13896
  })(objectUtil = exports.objectUtil || (exports.objectUtil = {}));
@@ -13805,7 +13954,7 @@ class ZodObject extends ZodType {
13805
13954
  const parsedType = this._getType(input);
13806
13955
  if (parsedType !== util_1.ZodParsedType.object) {
13807
13956
  const ctx = this._getOrReturnCtx(input);
13808
- parseUtil_1.addIssueToContext(ctx, {
13957
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13809
13958
  code: ZodError_1.ZodIssueCode.invalid_type,
13810
13959
  expected: util_1.ZodParsedType.object,
13811
13960
  received: ctx.parsedType,
@@ -13815,9 +13964,12 @@ class ZodObject extends ZodType {
13815
13964
  const { status, ctx } = this._processInputParams(input);
13816
13965
  const { shape, keys: shapeKeys } = this._getCached();
13817
13966
  const extraKeys = [];
13818
- for (const key in ctx.data) {
13819
- if (!shapeKeys.includes(key)) {
13820
- extraKeys.push(key);
13967
+ if (!(this._def.catchall instanceof ZodNever &&
13968
+ this._def.unknownKeys === "strip")) {
13969
+ for (const key in ctx.data) {
13970
+ if (!shapeKeys.includes(key)) {
13971
+ extraKeys.push(key);
13972
+ }
13821
13973
  }
13822
13974
  }
13823
13975
  const pairs = [];
@@ -13842,7 +13994,7 @@ class ZodObject extends ZodType {
13842
13994
  }
13843
13995
  else if (unknownKeys === "strict") {
13844
13996
  if (extraKeys.length > 0) {
13845
- parseUtil_1.addIssueToContext(ctx, {
13997
+ (0, parseUtil_1.addIssueToContext)(ctx, {
13846
13998
  code: ZodError_1.ZodIssueCode.unrecognized_keys,
13847
13999
  keys: extraKeys,
13848
14000
  });
@@ -14008,15 +14160,32 @@ class ZodObject extends ZodType {
14008
14160
  shape: () => newShape,
14009
14161
  });
14010
14162
  }
14011
- required() {
14163
+ required(mask) {
14012
14164
  const newShape = {};
14013
- for (const key in this.shape) {
14014
- const fieldSchema = this.shape[key];
14015
- let newField = fieldSchema;
14016
- while (newField instanceof ZodOptional) {
14017
- newField = newField._def.innerType;
14165
+ if (mask) {
14166
+ util_1.util.objectKeys(this.shape).map((key) => {
14167
+ if (util_1.util.objectKeys(mask).indexOf(key) === -1) {
14168
+ newShape[key] = this.shape[key];
14169
+ }
14170
+ else {
14171
+ const fieldSchema = this.shape[key];
14172
+ let newField = fieldSchema;
14173
+ while (newField instanceof ZodOptional) {
14174
+ newField = newField._def.innerType;
14175
+ }
14176
+ newShape[key] = newField;
14177
+ }
14178
+ });
14179
+ }
14180
+ else {
14181
+ for (const key in this.shape) {
14182
+ const fieldSchema = this.shape[key];
14183
+ let newField = fieldSchema;
14184
+ while (newField instanceof ZodOptional) {
14185
+ newField = newField._def.innerType;
14186
+ }
14187
+ newShape[key] = newField;
14018
14188
  }
14019
- newShape[key] = newField;
14020
14189
  }
14021
14190
  return new ZodObject({
14022
14191
  ...this._def,
@@ -14075,7 +14244,7 @@ class ZodUnion extends ZodType {
14075
14244
  }
14076
14245
  // return invalid
14077
14246
  const unionErrors = results.map((result) => new ZodError_1.ZodError(result.ctx.common.issues));
14078
- parseUtil_1.addIssueToContext(ctx, {
14247
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14079
14248
  code: ZodError_1.ZodIssueCode.invalid_union,
14080
14249
  unionErrors,
14081
14250
  });
@@ -14133,7 +14302,7 @@ class ZodUnion extends ZodType {
14133
14302
  return dirty.result;
14134
14303
  }
14135
14304
  const unionErrors = issues.map((issues) => new ZodError_1.ZodError(issues));
14136
- parseUtil_1.addIssueToContext(ctx, {
14305
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14137
14306
  code: ZodError_1.ZodIssueCode.invalid_union,
14138
14307
  unionErrors,
14139
14308
  });
@@ -14152,11 +14321,48 @@ ZodUnion.create = (types, params) => {
14152
14321
  ...processCreateParams(params),
14153
14322
  });
14154
14323
  };
14324
+ /////////////////////////////////////////////////////
14325
+ /////////////////////////////////////////////////////
14326
+ ////////// //////////
14327
+ ////////// ZodDiscriminatedUnion //////////
14328
+ ////////// //////////
14329
+ /////////////////////////////////////////////////////
14330
+ /////////////////////////////////////////////////////
14331
+ const getDiscriminator = (type) => {
14332
+ if (type instanceof ZodLazy) {
14333
+ return getDiscriminator(type.schema);
14334
+ }
14335
+ else if (type instanceof ZodEffects) {
14336
+ return getDiscriminator(type.innerType());
14337
+ }
14338
+ else if (type instanceof ZodLiteral) {
14339
+ return [type.value];
14340
+ }
14341
+ else if (type instanceof ZodEnum) {
14342
+ return type.options;
14343
+ }
14344
+ else if (type instanceof ZodNativeEnum) {
14345
+ // eslint-disable-next-line ban/ban
14346
+ return Object.keys(type.enum);
14347
+ }
14348
+ else if (type instanceof ZodDefault) {
14349
+ return getDiscriminator(type._def.innerType);
14350
+ }
14351
+ else if (type instanceof ZodUndefined) {
14352
+ return [undefined];
14353
+ }
14354
+ else if (type instanceof ZodNull) {
14355
+ return [null];
14356
+ }
14357
+ else {
14358
+ return null;
14359
+ }
14360
+ };
14155
14361
  class ZodDiscriminatedUnion extends ZodType {
14156
14362
  _parse(input) {
14157
14363
  const { ctx } = this._processInputParams(input);
14158
14364
  if (ctx.parsedType !== util_1.ZodParsedType.object) {
14159
- parseUtil_1.addIssueToContext(ctx, {
14365
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14160
14366
  code: ZodError_1.ZodIssueCode.invalid_type,
14161
14367
  expected: util_1.ZodParsedType.object,
14162
14368
  received: ctx.parsedType,
@@ -14165,11 +14371,11 @@ class ZodDiscriminatedUnion extends ZodType {
14165
14371
  }
14166
14372
  const discriminator = this.discriminator;
14167
14373
  const discriminatorValue = ctx.data[discriminator];
14168
- const option = this.options.get(discriminatorValue);
14374
+ const option = this.optionsMap.get(discriminatorValue);
14169
14375
  if (!option) {
14170
- parseUtil_1.addIssueToContext(ctx, {
14376
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14171
14377
  code: ZodError_1.ZodIssueCode.invalid_union_discriminator,
14172
- options: this.validDiscriminatorValues,
14378
+ options: Array.from(this.optionsMap.keys()),
14173
14379
  path: [discriminator],
14174
14380
  });
14175
14381
  return parseUtil_1.INVALID;
@@ -14192,12 +14398,12 @@ class ZodDiscriminatedUnion extends ZodType {
14192
14398
  get discriminator() {
14193
14399
  return this._def.discriminator;
14194
14400
  }
14195
- get validDiscriminatorValues() {
14196
- return Array.from(this.options.keys());
14197
- }
14198
14401
  get options() {
14199
14402
  return this._def.options;
14200
14403
  }
14404
+ get optionsMap() {
14405
+ return this._def.optionsMap;
14406
+ }
14201
14407
  /**
14202
14408
  * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
14203
14409
  * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
@@ -14206,34 +14412,35 @@ class ZodDiscriminatedUnion extends ZodType {
14206
14412
  * @param types an array of object schemas
14207
14413
  * @param params
14208
14414
  */
14209
- static create(discriminator, types, params) {
14415
+ static create(discriminator, options, params) {
14210
14416
  // Get all the valid discriminator values
14211
- const options = new Map();
14212
- try {
14213
- types.forEach((type) => {
14214
- const discriminatorValue = type.shape[discriminator].value;
14215
- options.set(discriminatorValue, type);
14216
- });
14217
- }
14218
- catch (e) {
14219
- throw new Error("The discriminator value could not be extracted from all the provided schemas");
14220
- }
14221
- // Assert that all the discriminator values are unique
14222
- if (options.size !== types.length) {
14223
- throw new Error("Some of the discriminator values are not unique");
14417
+ const optionsMap = new Map();
14418
+ // try {
14419
+ for (const type of options) {
14420
+ const discriminatorValues = getDiscriminator(type.shape[discriminator]);
14421
+ if (!discriminatorValues) {
14422
+ throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
14423
+ }
14424
+ for (const value of discriminatorValues) {
14425
+ if (optionsMap.has(value)) {
14426
+ throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
14427
+ }
14428
+ optionsMap.set(value, type);
14429
+ }
14224
14430
  }
14225
14431
  return new ZodDiscriminatedUnion({
14226
14432
  typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
14227
14433
  discriminator,
14228
14434
  options,
14435
+ optionsMap,
14229
14436
  ...processCreateParams(params),
14230
14437
  });
14231
14438
  }
14232
14439
  }
14233
14440
  exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;
14234
14441
  function mergeValues(a, b) {
14235
- const aType = util_1.getParsedType(a);
14236
- const bType = util_1.getParsedType(b);
14442
+ const aType = (0, util_1.getParsedType)(a);
14443
+ const bType = (0, util_1.getParsedType)(b);
14237
14444
  if (a === b) {
14238
14445
  return { valid: true, data: a };
14239
14446
  }
@@ -14281,17 +14488,17 @@ class ZodIntersection extends ZodType {
14281
14488
  _parse(input) {
14282
14489
  const { status, ctx } = this._processInputParams(input);
14283
14490
  const handleParsed = (parsedLeft, parsedRight) => {
14284
- if (parseUtil_1.isAborted(parsedLeft) || parseUtil_1.isAborted(parsedRight)) {
14491
+ if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) {
14285
14492
  return parseUtil_1.INVALID;
14286
14493
  }
14287
14494
  const merged = mergeValues(parsedLeft.value, parsedRight.value);
14288
14495
  if (!merged.valid) {
14289
- parseUtil_1.addIssueToContext(ctx, {
14496
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14290
14497
  code: ZodError_1.ZodIssueCode.invalid_intersection_types,
14291
14498
  });
14292
14499
  return parseUtil_1.INVALID;
14293
14500
  }
14294
- if (parseUtil_1.isDirty(parsedLeft) || parseUtil_1.isDirty(parsedRight)) {
14501
+ if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) {
14295
14502
  status.dirty();
14296
14503
  }
14297
14504
  return { status: status.value, value: merged.data };
@@ -14336,7 +14543,7 @@ class ZodTuple extends ZodType {
14336
14543
  _parse(input) {
14337
14544
  const { status, ctx } = this._processInputParams(input);
14338
14545
  if (ctx.parsedType !== util_1.ZodParsedType.array) {
14339
- parseUtil_1.addIssueToContext(ctx, {
14546
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14340
14547
  code: ZodError_1.ZodIssueCode.invalid_type,
14341
14548
  expected: util_1.ZodParsedType.array,
14342
14549
  received: ctx.parsedType,
@@ -14344,20 +14551,22 @@ class ZodTuple extends ZodType {
14344
14551
  return parseUtil_1.INVALID;
14345
14552
  }
14346
14553
  if (ctx.data.length < this._def.items.length) {
14347
- parseUtil_1.addIssueToContext(ctx, {
14554
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14348
14555
  code: ZodError_1.ZodIssueCode.too_small,
14349
14556
  minimum: this._def.items.length,
14350
14557
  inclusive: true,
14558
+ exact: false,
14351
14559
  type: "array",
14352
14560
  });
14353
14561
  return parseUtil_1.INVALID;
14354
14562
  }
14355
14563
  const rest = this._def.rest;
14356
14564
  if (!rest && ctx.data.length > this._def.items.length) {
14357
- parseUtil_1.addIssueToContext(ctx, {
14565
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14358
14566
  code: ZodError_1.ZodIssueCode.too_big,
14359
14567
  maximum: this._def.items.length,
14360
14568
  inclusive: true,
14569
+ exact: false,
14361
14570
  type: "array",
14362
14571
  });
14363
14572
  status.dirty();
@@ -14391,6 +14600,9 @@ class ZodTuple extends ZodType {
14391
14600
  }
14392
14601
  exports.ZodTuple = ZodTuple;
14393
14602
  ZodTuple.create = (schemas, params) => {
14603
+ if (!Array.isArray(schemas)) {
14604
+ throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
14605
+ }
14394
14606
  return new ZodTuple({
14395
14607
  items: schemas,
14396
14608
  typeName: ZodFirstPartyTypeKind.ZodTuple,
@@ -14408,7 +14620,7 @@ class ZodRecord extends ZodType {
14408
14620
  _parse(input) {
14409
14621
  const { status, ctx } = this._processInputParams(input);
14410
14622
  if (ctx.parsedType !== util_1.ZodParsedType.object) {
14411
- parseUtil_1.addIssueToContext(ctx, {
14623
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14412
14624
  code: ZodError_1.ZodIssueCode.invalid_type,
14413
14625
  expected: util_1.ZodParsedType.object,
14414
14626
  received: ctx.parsedType,
@@ -14456,7 +14668,7 @@ class ZodMap extends ZodType {
14456
14668
  _parse(input) {
14457
14669
  const { status, ctx } = this._processInputParams(input);
14458
14670
  if (ctx.parsedType !== util_1.ZodParsedType.map) {
14459
- parseUtil_1.addIssueToContext(ctx, {
14671
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14460
14672
  code: ZodError_1.ZodIssueCode.invalid_type,
14461
14673
  expected: util_1.ZodParsedType.map,
14462
14674
  received: ctx.parsedType,
@@ -14518,7 +14730,7 @@ class ZodSet extends ZodType {
14518
14730
  _parse(input) {
14519
14731
  const { status, ctx } = this._processInputParams(input);
14520
14732
  if (ctx.parsedType !== util_1.ZodParsedType.set) {
14521
- parseUtil_1.addIssueToContext(ctx, {
14733
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14522
14734
  code: ZodError_1.ZodIssueCode.invalid_type,
14523
14735
  expected: util_1.ZodParsedType.set,
14524
14736
  received: ctx.parsedType,
@@ -14528,11 +14740,12 @@ class ZodSet extends ZodType {
14528
14740
  const def = this._def;
14529
14741
  if (def.minSize !== null) {
14530
14742
  if (ctx.data.size < def.minSize.value) {
14531
- parseUtil_1.addIssueToContext(ctx, {
14743
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14532
14744
  code: ZodError_1.ZodIssueCode.too_small,
14533
14745
  minimum: def.minSize.value,
14534
14746
  type: "set",
14535
14747
  inclusive: true,
14748
+ exact: false,
14536
14749
  message: def.minSize.message,
14537
14750
  });
14538
14751
  status.dirty();
@@ -14540,11 +14753,12 @@ class ZodSet extends ZodType {
14540
14753
  }
14541
14754
  if (def.maxSize !== null) {
14542
14755
  if (ctx.data.size > def.maxSize.value) {
14543
- parseUtil_1.addIssueToContext(ctx, {
14756
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14544
14757
  code: ZodError_1.ZodIssueCode.too_big,
14545
14758
  maximum: def.maxSize.value,
14546
14759
  type: "set",
14547
14760
  inclusive: true,
14761
+ exact: false,
14548
14762
  message: def.maxSize.message,
14549
14763
  });
14550
14764
  status.dirty();
@@ -14607,7 +14821,7 @@ class ZodFunction extends ZodType {
14607
14821
  _parse(input) {
14608
14822
  const { ctx } = this._processInputParams(input);
14609
14823
  if (ctx.parsedType !== util_1.ZodParsedType.function) {
14610
- parseUtil_1.addIssueToContext(ctx, {
14824
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14611
14825
  code: ZodError_1.ZodIssueCode.invalid_type,
14612
14826
  expected: util_1.ZodParsedType.function,
14613
14827
  received: ctx.parsedType,
@@ -14615,14 +14829,14 @@ class ZodFunction extends ZodType {
14615
14829
  return parseUtil_1.INVALID;
14616
14830
  }
14617
14831
  function makeArgsIssue(args, error) {
14618
- return parseUtil_1.makeIssue({
14832
+ return (0, parseUtil_1.makeIssue)({
14619
14833
  data: args,
14620
14834
  path: ctx.path,
14621
14835
  errorMaps: [
14622
14836
  ctx.common.contextualErrorMap,
14623
14837
  ctx.schemaErrorMap,
14624
- ZodError_1.getErrorMap(),
14625
- ZodError_1.defaultErrorMap,
14838
+ (0, errors_1.getErrorMap)(),
14839
+ errors_1.defaultErrorMap,
14626
14840
  ].filter((x) => !!x),
14627
14841
  issueData: {
14628
14842
  code: ZodError_1.ZodIssueCode.invalid_arguments,
@@ -14631,14 +14845,14 @@ class ZodFunction extends ZodType {
14631
14845
  });
14632
14846
  }
14633
14847
  function makeReturnsIssue(returns, error) {
14634
- return parseUtil_1.makeIssue({
14848
+ return (0, parseUtil_1.makeIssue)({
14635
14849
  data: returns,
14636
14850
  path: ctx.path,
14637
14851
  errorMaps: [
14638
14852
  ctx.common.contextualErrorMap,
14639
14853
  ctx.schemaErrorMap,
14640
- ZodError_1.getErrorMap(),
14641
- ZodError_1.defaultErrorMap,
14854
+ (0, errors_1.getErrorMap)(),
14855
+ errors_1.defaultErrorMap,
14642
14856
  ].filter((x) => !!x),
14643
14857
  issueData: {
14644
14858
  code: ZodError_1.ZodIssueCode.invalid_return_type,
@@ -14649,7 +14863,7 @@ class ZodFunction extends ZodType {
14649
14863
  const params = { errorMap: ctx.common.contextualErrorMap };
14650
14864
  const fn = ctx.data;
14651
14865
  if (this._def.returns instanceof ZodPromise) {
14652
- return parseUtil_1.OK(async (...args) => {
14866
+ return (0, parseUtil_1.OK)(async (...args) => {
14653
14867
  const error = new ZodError_1.ZodError([]);
14654
14868
  const parsedArgs = await this._def.args
14655
14869
  .parseAsync(args, params)
@@ -14668,7 +14882,7 @@ class ZodFunction extends ZodType {
14668
14882
  });
14669
14883
  }
14670
14884
  else {
14671
- return parseUtil_1.OK((...args) => {
14885
+ return (0, parseUtil_1.OK)((...args) => {
14672
14886
  const parsedArgs = this._def.args.safeParse(args, params);
14673
14887
  if (!parsedArgs.success) {
14674
14888
  throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]);
@@ -14708,18 +14922,18 @@ class ZodFunction extends ZodType {
14708
14922
  const validatedFunc = this.parse(func);
14709
14923
  return validatedFunc;
14710
14924
  }
14925
+ static create(args, returns, params) {
14926
+ return new ZodFunction({
14927
+ args: (args
14928
+ ? args
14929
+ : ZodTuple.create([]).rest(ZodUnknown.create())),
14930
+ returns: returns || ZodUnknown.create(),
14931
+ typeName: ZodFirstPartyTypeKind.ZodFunction,
14932
+ ...processCreateParams(params),
14933
+ });
14934
+ }
14711
14935
  }
14712
14936
  exports.ZodFunction = ZodFunction;
14713
- ZodFunction.create = (args, returns, params) => {
14714
- return new ZodFunction({
14715
- args: (args
14716
- ? args.rest(ZodUnknown.create())
14717
- : ZodTuple.create([]).rest(ZodUnknown.create())),
14718
- returns: returns || ZodUnknown.create(),
14719
- typeName: ZodFirstPartyTypeKind.ZodFunction,
14720
- ...processCreateParams(params),
14721
- });
14722
- };
14723
14937
  class ZodLazy extends ZodType {
14724
14938
  get schema() {
14725
14939
  return this._def.getter();
@@ -14742,7 +14956,7 @@ class ZodLiteral extends ZodType {
14742
14956
  _parse(input) {
14743
14957
  if (input.data !== this._def.value) {
14744
14958
  const ctx = this._getOrReturnCtx(input);
14745
- parseUtil_1.addIssueToContext(ctx, {
14959
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14746
14960
  code: ZodError_1.ZodIssueCode.invalid_literal,
14747
14961
  expected: this._def.value,
14748
14962
  });
@@ -14774,7 +14988,7 @@ class ZodEnum extends ZodType {
14774
14988
  if (typeof input.data !== "string") {
14775
14989
  const ctx = this._getOrReturnCtx(input);
14776
14990
  const expectedValues = this._def.values;
14777
- parseUtil_1.addIssueToContext(ctx, {
14991
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14778
14992
  expected: util_1.util.joinValues(expectedValues),
14779
14993
  received: ctx.parsedType,
14780
14994
  code: ZodError_1.ZodIssueCode.invalid_type,
@@ -14784,14 +14998,14 @@ class ZodEnum extends ZodType {
14784
14998
  if (this._def.values.indexOf(input.data) === -1) {
14785
14999
  const ctx = this._getOrReturnCtx(input);
14786
15000
  const expectedValues = this._def.values;
14787
- parseUtil_1.addIssueToContext(ctx, {
15001
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14788
15002
  received: ctx.data,
14789
15003
  code: ZodError_1.ZodIssueCode.invalid_enum_value,
14790
15004
  options: expectedValues,
14791
15005
  });
14792
15006
  return parseUtil_1.INVALID;
14793
15007
  }
14794
- return parseUtil_1.OK(input.data);
15008
+ return (0, parseUtil_1.OK)(input.data);
14795
15009
  }
14796
15010
  get options() {
14797
15011
  return this._def.values;
@@ -14827,7 +15041,7 @@ class ZodNativeEnum extends ZodType {
14827
15041
  if (ctx.parsedType !== util_1.ZodParsedType.string &&
14828
15042
  ctx.parsedType !== util_1.ZodParsedType.number) {
14829
15043
  const expectedValues = util_1.util.objectValues(nativeEnumValues);
14830
- parseUtil_1.addIssueToContext(ctx, {
15044
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14831
15045
  expected: util_1.util.joinValues(expectedValues),
14832
15046
  received: ctx.parsedType,
14833
15047
  code: ZodError_1.ZodIssueCode.invalid_type,
@@ -14836,14 +15050,14 @@ class ZodNativeEnum extends ZodType {
14836
15050
  }
14837
15051
  if (nativeEnumValues.indexOf(input.data) === -1) {
14838
15052
  const expectedValues = util_1.util.objectValues(nativeEnumValues);
14839
- parseUtil_1.addIssueToContext(ctx, {
15053
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14840
15054
  received: ctx.data,
14841
15055
  code: ZodError_1.ZodIssueCode.invalid_enum_value,
14842
15056
  options: expectedValues,
14843
15057
  });
14844
15058
  return parseUtil_1.INVALID;
14845
15059
  }
14846
- return parseUtil_1.OK(input.data);
15060
+ return (0, parseUtil_1.OK)(input.data);
14847
15061
  }
14848
15062
  get enum() {
14849
15063
  return this._def.values;
@@ -14862,7 +15076,7 @@ class ZodPromise extends ZodType {
14862
15076
  const { ctx } = this._processInputParams(input);
14863
15077
  if (ctx.parsedType !== util_1.ZodParsedType.promise &&
14864
15078
  ctx.common.async === false) {
14865
- parseUtil_1.addIssueToContext(ctx, {
15079
+ (0, parseUtil_1.addIssueToContext)(ctx, {
14866
15080
  code: ZodError_1.ZodIssueCode.invalid_type,
14867
15081
  expected: util_1.ZodParsedType.promise,
14868
15082
  received: ctx.parsedType,
@@ -14872,7 +15086,7 @@ class ZodPromise extends ZodType {
14872
15086
  const promisified = ctx.parsedType === util_1.ZodParsedType.promise
14873
15087
  ? ctx.data
14874
15088
  : Promise.resolve(ctx.data);
14875
- return parseUtil_1.OK(promisified.then((data) => {
15089
+ return (0, parseUtil_1.OK)(promisified.then((data) => {
14876
15090
  return this._def.type.parseAsync(data, {
14877
15091
  path: ctx.path,
14878
15092
  errorMap: ctx.common.contextualErrorMap,
@@ -14892,6 +15106,11 @@ class ZodEffects extends ZodType {
14892
15106
  innerType() {
14893
15107
  return this._def.schema;
14894
15108
  }
15109
+ sourceType() {
15110
+ return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
15111
+ ? this._def.schema.sourceType()
15112
+ : this._def.schema;
15113
+ }
14895
15114
  _parse(input) {
14896
15115
  const { status, ctx } = this._processInputParams(input);
14897
15116
  const effect = this._def.effect || null;
@@ -14916,7 +15135,7 @@ class ZodEffects extends ZodType {
14916
15135
  }
14917
15136
  const checkCtx = {
14918
15137
  addIssue: (arg) => {
14919
- parseUtil_1.addIssueToContext(ctx, arg);
15138
+ (0, parseUtil_1.addIssueToContext)(ctx, arg);
14920
15139
  if (arg.fatal) {
14921
15140
  status.abort();
14922
15141
  }
@@ -14981,7 +15200,7 @@ class ZodEffects extends ZodType {
14981
15200
  // if (base.status === "dirty") {
14982
15201
  // return { status: "dirty", value: base.value };
14983
15202
  // }
14984
- if (!parseUtil_1.isValid(base))
15203
+ if (!(0, parseUtil_1.isValid)(base))
14985
15204
  return base;
14986
15205
  const result = effect.transform(base.value, checkCtx);
14987
15206
  if (result instanceof Promise) {
@@ -14993,7 +15212,7 @@ class ZodEffects extends ZodType {
14993
15212
  return this._def.schema
14994
15213
  ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
14995
15214
  .then((base) => {
14996
- if (!parseUtil_1.isValid(base))
15215
+ if (!(0, parseUtil_1.isValid)(base))
14997
15216
  return base;
14998
15217
  // if (base.status === "aborted") return INVALID;
14999
15218
  // if (base.status === "dirty") {
@@ -15028,7 +15247,7 @@ class ZodOptional extends ZodType {
15028
15247
  _parse(input) {
15029
15248
  const parsedType = this._getType(input);
15030
15249
  if (parsedType === util_1.ZodParsedType.undefined) {
15031
- return parseUtil_1.OK(undefined);
15250
+ return (0, parseUtil_1.OK)(undefined);
15032
15251
  }
15033
15252
  return this._def.innerType._parse(input);
15034
15253
  }
@@ -15048,7 +15267,7 @@ class ZodNullable extends ZodType {
15048
15267
  _parse(input) {
15049
15268
  const parsedType = this._getType(input);
15050
15269
  if (parsedType === util_1.ZodParsedType.null) {
15051
- return parseUtil_1.OK(null);
15270
+ return (0, parseUtil_1.OK)(null);
15052
15271
  }
15053
15272
  return this._def.innerType._parse(input);
15054
15273
  }
@@ -15083,9 +15302,50 @@ class ZodDefault extends ZodType {
15083
15302
  }
15084
15303
  exports.ZodDefault = ZodDefault;
15085
15304
  ZodDefault.create = (type, params) => {
15086
- return new ZodOptional({
15305
+ return new ZodDefault({
15087
15306
  innerType: type,
15088
- typeName: ZodFirstPartyTypeKind.ZodOptional,
15307
+ typeName: ZodFirstPartyTypeKind.ZodDefault,
15308
+ defaultValue: typeof params.default === "function"
15309
+ ? params.default
15310
+ : () => params.default,
15311
+ ...processCreateParams(params),
15312
+ });
15313
+ };
15314
+ class ZodCatch extends ZodType {
15315
+ _parse(input) {
15316
+ const { ctx } = this._processInputParams(input);
15317
+ const result = this._def.innerType._parse({
15318
+ data: ctx.data,
15319
+ path: ctx.path,
15320
+ parent: ctx,
15321
+ });
15322
+ if ((0, parseUtil_1.isAsync)(result)) {
15323
+ return result.then((result) => {
15324
+ return {
15325
+ status: "valid",
15326
+ value: result.status === "valid" ? result.value : this._def.defaultValue(),
15327
+ };
15328
+ });
15329
+ }
15330
+ else {
15331
+ return {
15332
+ status: "valid",
15333
+ value: result.status === "valid" ? result.value : this._def.defaultValue(),
15334
+ };
15335
+ }
15336
+ }
15337
+ removeDefault() {
15338
+ return this._def.innerType;
15339
+ }
15340
+ }
15341
+ exports.ZodCatch = ZodCatch;
15342
+ ZodCatch.create = (type, params) => {
15343
+ return new ZodCatch({
15344
+ innerType: type,
15345
+ typeName: ZodFirstPartyTypeKind.ZodCatch,
15346
+ defaultValue: typeof params.default === "function"
15347
+ ? params.default
15348
+ : () => params.default,
15089
15349
  ...processCreateParams(params),
15090
15350
  });
15091
15351
  };
@@ -15094,7 +15354,7 @@ class ZodNaN extends ZodType {
15094
15354
  const parsedType = this._getType(input);
15095
15355
  if (parsedType !== util_1.ZodParsedType.nan) {
15096
15356
  const ctx = this._getOrReturnCtx(input);
15097
- parseUtil_1.addIssueToContext(ctx, {
15357
+ (0, parseUtil_1.addIssueToContext)(ctx, {
15098
15358
  code: ZodError_1.ZodIssueCode.invalid_type,
15099
15359
  expected: util_1.ZodParsedType.nan,
15100
15360
  received: ctx.parsedType,
@@ -15127,6 +15387,65 @@ class ZodBranded extends ZodType {
15127
15387
  }
15128
15388
  }
15129
15389
  exports.ZodBranded = ZodBranded;
15390
+ class ZodPipeline extends ZodType {
15391
+ _parse(input) {
15392
+ const { status, ctx } = this._processInputParams(input);
15393
+ if (ctx.common.async) {
15394
+ const handleAsync = async () => {
15395
+ const inResult = await this._def.in._parseAsync({
15396
+ data: ctx.data,
15397
+ path: ctx.path,
15398
+ parent: ctx,
15399
+ });
15400
+ if (inResult.status === "aborted")
15401
+ return parseUtil_1.INVALID;
15402
+ if (inResult.status === "dirty") {
15403
+ status.dirty();
15404
+ return (0, parseUtil_1.DIRTY)(inResult.value);
15405
+ }
15406
+ else {
15407
+ return this._def.out._parseAsync({
15408
+ data: inResult.value,
15409
+ path: ctx.path,
15410
+ parent: ctx,
15411
+ });
15412
+ }
15413
+ };
15414
+ return handleAsync();
15415
+ }
15416
+ else {
15417
+ const inResult = this._def.in._parseSync({
15418
+ data: ctx.data,
15419
+ path: ctx.path,
15420
+ parent: ctx,
15421
+ });
15422
+ if (inResult.status === "aborted")
15423
+ return parseUtil_1.INVALID;
15424
+ if (inResult.status === "dirty") {
15425
+ status.dirty();
15426
+ return {
15427
+ status: "dirty",
15428
+ value: inResult.value,
15429
+ };
15430
+ }
15431
+ else {
15432
+ return this._def.out._parseSync({
15433
+ data: inResult.value,
15434
+ path: ctx.path,
15435
+ parent: ctx,
15436
+ });
15437
+ }
15438
+ }
15439
+ }
15440
+ static create(a, b) {
15441
+ return new ZodPipeline({
15442
+ in: a,
15443
+ out: b,
15444
+ typeName: ZodFirstPartyTypeKind.ZodPipeline,
15445
+ });
15446
+ }
15447
+ }
15448
+ exports.ZodPipeline = ZodPipeline;
15130
15449
  const custom = (check, params = {}, fatal) => {
15131
15450
  if (check)
15132
15451
  return ZodAny.create().superRefine((data, ctx) => {
@@ -15150,6 +15469,7 @@ var ZodFirstPartyTypeKind;
15150
15469
  ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
15151
15470
  ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
15152
15471
  ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
15472
+ ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
15153
15473
  ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
15154
15474
  ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
15155
15475
  ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
@@ -15174,12 +15494,21 @@ var ZodFirstPartyTypeKind;
15174
15494
  ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
15175
15495
  ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
15176
15496
  ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
15497
+ ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
15177
15498
  ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
15178
15499
  ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
15500
+ ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
15179
15501
  })(ZodFirstPartyTypeKind = exports.ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = {}));
15180
- const instanceOfType = (cls, params = {
15502
+ // new approach that works for abstract classes
15503
+ // but requires TS 4.4+
15504
+ class Class {
15505
+ constructor(..._) { }
15506
+ }
15507
+ const instanceOfType = (
15508
+ // const instanceOfType = <T extends new (...args: any[]) => any>(
15509
+ cls, params = {
15181
15510
  message: `Input not instance of ${cls.name}`,
15182
- }) => exports.custom((data) => data instanceof cls, params, true);
15511
+ }) => (0, exports.custom)((data) => data instanceof cls, params, true);
15183
15512
  exports["instanceof"] = instanceOfType;
15184
15513
  const stringType = ZodString.create;
15185
15514
  exports.string = stringType;
@@ -15193,6 +15522,8 @@ const booleanType = ZodBoolean.create;
15193
15522
  exports.boolean = booleanType;
15194
15523
  const dateType = ZodDate.create;
15195
15524
  exports.date = dateType;
15525
+ const symbolType = ZodSymbol.create;
15526
+ exports.symbol = symbolType;
15196
15527
  const undefinedType = ZodUndefined.create;
15197
15528
  exports.undefined = undefinedType;
15198
15529
  const nullType = ZodNull.create;
@@ -15246,24 +15577,34 @@ const nullableType = ZodNullable.create;
15246
15577
  exports.nullable = nullableType;
15247
15578
  const preprocessType = ZodEffects.createWithPreprocess;
15248
15579
  exports.preprocess = preprocessType;
15580
+ const pipelineType = ZodPipeline.create;
15581
+ exports.pipeline = pipelineType;
15249
15582
  const ostring = () => stringType().optional();
15250
15583
  exports.ostring = ostring;
15251
15584
  const onumber = () => numberType().optional();
15252
15585
  exports.onumber = onumber;
15253
15586
  const oboolean = () => booleanType().optional();
15254
15587
  exports.oboolean = oboolean;
15588
+ exports.coerce = {
15589
+ string: ((arg) => ZodString.create({ ...arg, coerce: true })),
15590
+ number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
15591
+ boolean: ((arg) => ZodBoolean.create({ ...arg, coerce: true })),
15592
+ bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
15593
+ date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
15594
+ };
15595
+ exports.NEVER = parseUtil_1.INVALID;
15255
15596
 
15256
15597
 
15257
15598
  /***/ }),
15258
15599
 
15259
- /***/ 87:
15600
+ /***/ 2124:
15260
15601
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
15261
15602
 
15262
15603
  "use strict";
15263
15604
 
15264
15605
  Object.defineProperty(exports, "__esModule", ({ value: true }));
15265
15606
  exports.defaultTimeout = exports.defaultMetadata = exports.userInfoEndpoint = exports.accessTokenEndpoint = exports.scope = exports.authorizationEndpoint = void 0;
15266
- const connector_kit_1 = __nccwpck_require__(1743);
15607
+ const connector_kit_1 = __nccwpck_require__(4758);
15267
15608
  exports.authorizationEndpoint = 'https://github.com/login/oauth/authorize';
15268
15609
  exports.scope = 'read:user';
15269
15610
  exports.accessTokenEndpoint = 'https://github.com/login/oauth/access_token';
@@ -15294,7 +15635,7 @@ exports.defaultTimeout = 5000;
15294
15635
 
15295
15636
  /***/ }),
15296
15637
 
15297
- /***/ 8488:
15638
+ /***/ 616:
15298
15639
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
15299
15640
 
15300
15641
  "use strict";
@@ -15324,12 +15665,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
15324
15665
  };
15325
15666
  Object.defineProperty(exports, "__esModule", ({ value: true }));
15326
15667
  exports.getAccessToken = void 0;
15327
- const connector_kit_1 = __nccwpck_require__(1743);
15328
- const essentials_1 = __nccwpck_require__(8138);
15329
- const got_1 = __importStar(__nccwpck_require__(5569));
15330
- const qs = __importStar(__nccwpck_require__(7348));
15331
- const constant_1 = __nccwpck_require__(87);
15332
- const types_1 = __nccwpck_require__(7760);
15668
+ const connector_kit_1 = __nccwpck_require__(4758);
15669
+ const essentials_1 = __nccwpck_require__(5254);
15670
+ const got_1 = __importStar(__nccwpck_require__(9235));
15671
+ const qs = __importStar(__nccwpck_require__(2024));
15672
+ const constant_1 = __nccwpck_require__(2124);
15673
+ const types_1 = __nccwpck_require__(2174);
15333
15674
  const getAuthorizationUri = (getConfig) => async ({ state, redirectUri }) => {
15334
15675
  const config = await getConfig(constant_1.defaultMetadata.id);
15335
15676
  (0, connector_kit_1.validateConfig)(config, types_1.githubConfigGuard);
@@ -15430,14 +15771,14 @@ exports["default"] = createGithubConnector;
15430
15771
 
15431
15772
  /***/ }),
15432
15773
 
15433
- /***/ 7760:
15774
+ /***/ 2174:
15434
15775
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
15435
15776
 
15436
15777
  "use strict";
15437
15778
 
15438
15779
  Object.defineProperty(exports, "__esModule", ({ value: true }));
15439
15780
  exports.authResponseGuard = exports.authorizationCallbackErrorGuard = exports.userInfoResponseGuard = exports.accessTokenResponseGuard = exports.githubConfigGuard = void 0;
15440
- const zod_1 = __nccwpck_require__(8062);
15781
+ const zod_1 = __nccwpck_require__(6319);
15441
15782
  exports.githubConfigGuard = zod_1.z.object({
15442
15783
  clientId: zod_1.z.string(),
15443
15784
  clientSecret: zod_1.z.string(),
@@ -15543,7 +15884,7 @@ module.exports = require("stream");
15543
15884
 
15544
15885
  /***/ }),
15545
15886
 
15546
- /***/ 4404:
15887
+ /***/ 6821:
15547
15888
  /***/ ((module) => {
15548
15889
 
15549
15890
  "use strict";
@@ -15573,6 +15914,337 @@ module.exports = require("util");
15573
15914
  "use strict";
15574
15915
  module.exports = require("zlib");
15575
15916
 
15917
+ /***/ }),
15918
+
15919
+ /***/ 4758:
15920
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
15921
+
15922
+ "use strict";
15923
+
15924
+
15925
+ var types = __nccwpck_require__(1876);
15926
+
15927
+ function validateConfig(config, guard) {
15928
+ const result = guard.safeParse(config);
15929
+ if (!result.success) {
15930
+ throw new types.ConnectorError(types.ConnectorErrorCodes.InvalidConfig, result.error);
15931
+ }
15932
+ }
15933
+ const parseJson = (jsonString, errorCode = types.ConnectorErrorCodes.InvalidResponse, errorPayload) => {
15934
+ try {
15935
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
15936
+ return JSON.parse(jsonString);
15937
+ }
15938
+ catch {
15939
+ throw new types.ConnectorError(errorCode, errorPayload ?? jsonString);
15940
+ }
15941
+ };
15942
+
15943
+ exports.ConnectorError = types.ConnectorError;
15944
+ Object.defineProperty(exports, "ConnectorErrorCodes", ({
15945
+ enumerable: true,
15946
+ get: function () { return types.ConnectorErrorCodes; }
15947
+ }));
15948
+ Object.defineProperty(exports, "ConnectorPlatform", ({
15949
+ enumerable: true,
15950
+ get: function () { return types.ConnectorPlatform; }
15951
+ }));
15952
+ Object.defineProperty(exports, "ConnectorType", ({
15953
+ enumerable: true,
15954
+ get: function () { return types.ConnectorType; }
15955
+ }));
15956
+ Object.defineProperty(exports, "MessageTypes", ({
15957
+ enumerable: true,
15958
+ get: function () { return types.MessageTypes; }
15959
+ }));
15960
+ exports.configurableConnectorMetadataGuard = types.configurableConnectorMetadataGuard;
15961
+ exports.connectorSessionGuard = types.connectorSessionGuard;
15962
+ exports.i18nPhrasesGuard = types.i18nPhrasesGuard;
15963
+ exports.messageTypesGuard = types.messageTypesGuard;
15964
+ exports.parseJson = parseJson;
15965
+ exports.validateConfig = validateConfig;
15966
+
15967
+
15968
+ /***/ }),
15969
+
15970
+ /***/ 1876:
15971
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
15972
+
15973
+ "use strict";
15974
+
15975
+
15976
+ var languageKit = __nccwpck_require__(1230);
15977
+ var zod = __nccwpck_require__(6319);
15978
+
15979
+ // MARK: Foundation
15980
+ exports.ConnectorType = void 0;
15981
+ (function (ConnectorType) {
15982
+ ConnectorType["Email"] = "Email";
15983
+ ConnectorType["Sms"] = "Sms";
15984
+ ConnectorType["Social"] = "Social";
15985
+ })(exports.ConnectorType || (exports.ConnectorType = {}));
15986
+ exports.ConnectorPlatform = void 0;
15987
+ (function (ConnectorPlatform) {
15988
+ ConnectorPlatform["Native"] = "Native";
15989
+ ConnectorPlatform["Universal"] = "Universal";
15990
+ ConnectorPlatform["Web"] = "Web";
15991
+ })(exports.ConnectorPlatform || (exports.ConnectorPlatform = {}));
15992
+ const i18nPhrasesGuard = zod.z
15993
+ .object({ en: zod.z.string() })
15994
+ .and(zod.z.record(zod.z.string()))
15995
+ .refine((i18nObject) => {
15996
+ const keys = Object.keys(i18nObject);
15997
+ if (!keys.includes('en')) {
15998
+ return false;
15999
+ }
16000
+ for (const value of keys) {
16001
+ if (!languageKit.isLanguageTag(value)) {
16002
+ return false;
16003
+ }
16004
+ }
16005
+ return true;
16006
+ });
16007
+ exports.ConnectorErrorCodes = void 0;
16008
+ (function (ConnectorErrorCodes) {
16009
+ ConnectorErrorCodes["General"] = "general";
16010
+ ConnectorErrorCodes["InvalidMetadata"] = "invalid_metadata";
16011
+ ConnectorErrorCodes["UnexpectedType"] = "unexpected_type";
16012
+ ConnectorErrorCodes["InvalidConfigGuard"] = "invalid_config_guard";
16013
+ ConnectorErrorCodes["InvalidRequestParameters"] = "invalid_request_parameters";
16014
+ ConnectorErrorCodes["InsufficientRequestParameters"] = "insufficient_request_parameters";
16015
+ ConnectorErrorCodes["InvalidConfig"] = "invalid_config";
16016
+ ConnectorErrorCodes["InvalidResponse"] = "invalid_response";
16017
+ ConnectorErrorCodes["TemplateNotFound"] = "template_not_found";
16018
+ ConnectorErrorCodes["NotImplemented"] = "not_implemented";
16019
+ ConnectorErrorCodes["SocialAuthCodeInvalid"] = "social_auth_code_invalid";
16020
+ ConnectorErrorCodes["SocialAccessTokenInvalid"] = "social_invalid_access_token";
16021
+ ConnectorErrorCodes["SocialIdTokenInvalid"] = "social_invalid_id_token";
16022
+ ConnectorErrorCodes["AuthorizationFailed"] = "authorization_failed";
16023
+ })(exports.ConnectorErrorCodes || (exports.ConnectorErrorCodes = {}));
16024
+ class ConnectorError extends Error {
16025
+ constructor(code, data) {
16026
+ const message = typeof data === 'string' ? data : 'Connector error occurred.';
16027
+ super(message);
16028
+ this.code = code;
16029
+ this.data = typeof data === 'string' ? { message: data } : data;
16030
+ }
16031
+ }
16032
+ exports.MessageTypes = void 0;
16033
+ (function (MessageTypes) {
16034
+ MessageTypes["SignIn"] = "SignIn";
16035
+ MessageTypes["Register"] = "Register";
16036
+ MessageTypes["ForgotPassword"] = "ForgotPassword";
16037
+ MessageTypes["Continue"] = "Continue";
16038
+ MessageTypes["Test"] = "Test";
16039
+ })(exports.MessageTypes || (exports.MessageTypes = {}));
16040
+ const messageTypesGuard = zod.z.nativeEnum(exports.MessageTypes);
16041
+ const connectorMetadataGuard = zod.z.object({
16042
+ id: zod.z.string(),
16043
+ target: zod.z.string(),
16044
+ platform: zod.z.nativeEnum(exports.ConnectorPlatform).nullable(),
16045
+ name: i18nPhrasesGuard,
16046
+ logo: zod.z.string(),
16047
+ logoDark: zod.z.string().nullable(),
16048
+ description: i18nPhrasesGuard,
16049
+ isStandard: zod.z.boolean().optional(),
16050
+ readme: zod.z.string(),
16051
+ configTemplate: zod.z.string(),
16052
+ });
16053
+ const configurableConnectorMetadataGuard = connectorMetadataGuard
16054
+ .pick({
16055
+ target: true,
16056
+ name: true,
16057
+ logo: true,
16058
+ logoDark: true,
16059
+ })
16060
+ .partial();
16061
+ const connectorSessionGuard = zod.z.object({
16062
+ nonce: zod.z.string().optional(),
16063
+ redirectUri: zod.z.string().optional(),
16064
+ });
16065
+
16066
+ exports.ConnectorError = ConnectorError;
16067
+ exports.configurableConnectorMetadataGuard = configurableConnectorMetadataGuard;
16068
+ exports.connectorSessionGuard = connectorSessionGuard;
16069
+ exports.i18nPhrasesGuard = i18nPhrasesGuard;
16070
+ exports.messageTypesGuard = messageTypesGuard;
16071
+
16072
+
16073
+ /***/ }),
16074
+
16075
+ /***/ 8670:
16076
+ /***/ ((__unused_webpack_module, exports) => {
16077
+
16078
+ "use strict";
16079
+
16080
+
16081
+ const languages = Object.freeze({
16082
+ 'af-ZA': 'Afrikaans',
16083
+ 'am-ET': 'አማርኛ',
16084
+ 'ar-AR': 'العربية',
16085
+ 'as-IN': 'অসমীয়া',
16086
+ 'az-AZ': 'Azərbaycan dili',
16087
+ 'be-BY': 'Беларуская',
16088
+ 'bg-BG': 'Български',
16089
+ 'bn-IN': 'বাংলা',
16090
+ 'br-FR': 'Brezhoneg',
16091
+ 'bs-BA': 'Bosanski',
16092
+ 'ca-ES': 'Català',
16093
+ 'cb-IQ': 'کوردیی ناوەندی',
16094
+ 'co-FR': 'Corsu',
16095
+ 'cs-CZ': 'Čeština',
16096
+ 'cx-PH': 'Bisaya',
16097
+ 'cy-GB': 'Cymraeg',
16098
+ 'da-DK': 'Dansk',
16099
+ de: 'Deutsch',
16100
+ 'de-DE': 'Deutsch (Deutschland)',
16101
+ 'el-GR': 'Ελληνικά',
16102
+ en: 'English',
16103
+ 'en-GB': 'English (UK)',
16104
+ 'en-US': 'English (US)',
16105
+ 'eo-EO': 'Esperanto',
16106
+ es: 'Español',
16107
+ 'es-ES': 'Español (España)',
16108
+ 'es-419': 'Español (Latinoamérica)',
16109
+ 'et-EE': 'Eesti',
16110
+ 'eu-ES': 'Euskara',
16111
+ 'fa-IR': 'فارسی',
16112
+ 'ff-NG': 'Fula',
16113
+ 'fi-FI': 'Suomi',
16114
+ 'fo-FO': 'Føroyskt',
16115
+ fr: 'Français',
16116
+ 'fr-CA': 'Français (Canada)',
16117
+ 'fr-FR': 'Français (France)',
16118
+ 'fy-NL': 'Frysk',
16119
+ 'ga-IE': 'Gaeilge',
16120
+ 'gl-ES': 'Galego',
16121
+ 'gn-PY': 'Guarani',
16122
+ 'gu-IN': 'ગુજરાતી',
16123
+ 'ha-NG': 'Hausa',
16124
+ 'he-IL': 'עברית',
16125
+ 'hi-IN': 'हिन्दी',
16126
+ 'hr-HR': 'Hrvatski',
16127
+ 'ht-HT': 'Kreyòl Ayisyen',
16128
+ 'hu-HU': 'Magyar',
16129
+ 'hy-AM': 'Հայերեն',
16130
+ 'id-ID': 'Bahasa Indonesia',
16131
+ 'ik-US': 'Iñupiatun',
16132
+ 'is-IS': 'Íslenska',
16133
+ it: 'Italiano',
16134
+ 'it-IT': 'italiano (Italia)',
16135
+ 'iu-CA': 'Inuktitut',
16136
+ ja: '日本語',
16137
+ 'ja-JP': '日本語',
16138
+ 'ja-KS': '日本語(関西)',
16139
+ 'jv-ID': 'Basa Jawa',
16140
+ 'ka-GE': 'ქართული',
16141
+ 'kk-KZ': 'Қазақша',
16142
+ 'km-KH': 'ភាសាខ្មែរ',
16143
+ 'kn-IN': 'ಕನ್ನಡ',
16144
+ ko: '한국어',
16145
+ 'ko-KR': '한국어',
16146
+ 'ku-TR': 'Kurdî (Kurmancî)',
16147
+ 'ky-KG': 'кыргызча',
16148
+ 'lo-LA': 'ພາສາລາວ',
16149
+ 'lt-LT': 'Lietuvių',
16150
+ 'lv-LV': 'Latviešu',
16151
+ 'mg-MG': 'Malagasy',
16152
+ 'mk-MK': 'Македонски',
16153
+ 'ml-IN': 'മലയാളം',
16154
+ 'mn-MN': 'Монгол',
16155
+ 'mr-IN': 'मराठी',
16156
+ 'ms-MY': 'Bahasa Melayu',
16157
+ 'mt-MT': 'Malti',
16158
+ 'my-MM': 'မြန်မာဘာသာ',
16159
+ 'nb-NO': 'Norsk (bokmål)',
16160
+ 'ne-NP': 'नेपाली',
16161
+ 'nl-BE': 'Vlaams',
16162
+ 'nl-NL': 'Nederlands',
16163
+ 'nn-NO': 'Norsk (nynorsk)',
16164
+ 'or-IN': 'ଓଡ଼ିଆ',
16165
+ 'pa-IN': 'ਪੰਜਾਬੀ',
16166
+ 'pl-PL': 'Polski',
16167
+ 'ps-AF': 'پښتو',
16168
+ pt: 'português',
16169
+ 'pt-BR': 'Português (Brasil)',
16170
+ 'pt-PT': 'português (Portugal)',
16171
+ 'ro-RO': 'Română',
16172
+ ru: 'Русский',
16173
+ 'ru-RU': 'Русский',
16174
+ 'rw-RW': 'Ikinyarwanda',
16175
+ 'sc-IT': 'Sardu',
16176
+ 'si-LK': 'සිංහල',
16177
+ 'sk-SK': 'Slovenčina',
16178
+ 'sl-SI': 'Slovenščina',
16179
+ 'sn-ZW': 'Shona',
16180
+ 'sq-AL': 'Shqip',
16181
+ 'sr-RS': 'Српски',
16182
+ 'sv-SE': 'Svenska',
16183
+ 'sw-KE': 'Kiswahili',
16184
+ 'sy-SY': 'ܣܘܪܝܝܐ',
16185
+ 'sz-PL': 'ślōnskŏ gŏdka',
16186
+ 'ta-IN': 'தமிழ்',
16187
+ 'te-IN': 'తెలుగు',
16188
+ 'tg-TJ': 'Тоҷикӣ',
16189
+ 'th-TH': 'ภาษาไทย',
16190
+ 'tl-PH': 'Filipino',
16191
+ tr: 'Türkçe',
16192
+ 'tr-TR': 'Türkçe',
16193
+ 'tt-RU': 'Татарча',
16194
+ 'tz-MA': 'ⵜⴰⵎⴰⵣⵉⵖⵜ',
16195
+ 'uk-UA': 'Українська',
16196
+ 'ur-PK': 'اردو',
16197
+ 'uz-UZ': "O'zbek",
16198
+ 'vi-VN': 'Tiếng Việt',
16199
+ zh: '中文',
16200
+ 'zh-CN': '简体中文',
16201
+ 'zh-HK': '繁體中文(香港)',
16202
+ 'zh-MO': '繁體中文(澳門)',
16203
+ 'zh-TW': '繁體中文(台灣)',
16204
+ 'zz-TR': 'Zaza',
16205
+ });
16206
+
16207
+ exports.languages = languages;
16208
+
16209
+
16210
+ /***/ }),
16211
+
16212
+ /***/ 1230:
16213
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
16214
+
16215
+ "use strict";
16216
+
16217
+
16218
+ var _const = __nccwpck_require__(8670);
16219
+ var utility = __nccwpck_require__(2304);
16220
+
16221
+
16222
+
16223
+ exports.languages = _const.languages;
16224
+ exports.isLanguageTag = utility.isLanguageTag;
16225
+ exports.languageTagGuard = utility.languageTagGuard;
16226
+
16227
+
16228
+ /***/ }),
16229
+
16230
+ /***/ 2304:
16231
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
16232
+
16233
+ "use strict";
16234
+
16235
+
16236
+ var zod = __nccwpck_require__(6319);
16237
+ var _const = __nccwpck_require__(8670);
16238
+
16239
+ const isLanguageTag = (value) => typeof value === 'string' && value in _const.languages;
16240
+ const languageTagGuard = zod.z
16241
+ .any()
16242
+ .refine((value) => isLanguageTag(value));
16243
+
16244
+ exports.isLanguageTag = isLanguageTag;
16245
+ exports.languageTagGuard = languageTagGuard;
16246
+
16247
+
15576
16248
  /***/ })
15577
16249
 
15578
16250
  /******/ });
@@ -15629,7 +16301,7 @@ module.exports = require("zlib");
15629
16301
  /******/ // startup
15630
16302
  /******/ // Load entry module and return exports
15631
16303
  /******/ // This entry module is referenced by other modules so it can't be inlined
15632
- /******/ var __webpack_exports__ = __nccwpck_require__(8488);
16304
+ /******/ var __webpack_exports__ = __nccwpck_require__(616);
15633
16305
  /******/ module.exports = __webpack_exports__;
15634
16306
  /******/
15635
16307
  /******/ })()