@eslint-react/core 1.43.1-next.0 → 1.43.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +1228 -328
  2. package/dist/index.mjs +1228 -328
  3. package/package.json +7 -7
package/dist/index.mjs CHANGED
@@ -8,343 +8,1235 @@ import * as VAR from '@eslint-react/var';
8
8
  import { isMatching, P, match } from 'ts-pattern';
9
9
  import birecord from 'birecord';
10
10
 
11
- // src/component/component-collector.ts
11
+ var __defProp = Object.defineProperty;
12
+ var __export = (target, all) => {
13
+ for (var name in all)
14
+ __defProp(target, name, { get: all[name], enumerable: true });
15
+ };
12
16
 
13
- // ../../node_modules/.pnpm/valibot@1.0.0_typescript@5.8.3/node_modules/valibot/dist/index.js
14
- var store;
17
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/core.js
15
18
  // @__NO_SIDE_EFFECTS__
16
- function getGlobalConfig(config2) {
19
+ function $constructor(name, initializer) {
20
+ class _6 {
21
+ constructor(def) {
22
+ var _a;
23
+ const th = this;
24
+ _6.init(th, def);
25
+ (_a = th._zod).deferred ?? (_a.deferred = []);
26
+ for (const fn of th._zod.deferred) {
27
+ fn();
28
+ }
29
+ }
30
+ static init(inst, def) {
31
+ var _a;
32
+ inst._zod ?? (inst._zod = {});
33
+ (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
34
+ inst._zod.traits.add(name);
35
+ initializer(inst, def);
36
+ for (const k in _6.prototype) {
37
+ Object.defineProperty(inst, k, { value: _6.prototype[k].bind(inst) });
38
+ }
39
+ inst._zod.constr = _6;
40
+ inst._zod.def = def;
41
+ }
42
+ static [Symbol.hasInstance](inst) {
43
+ return inst?._zod?.traits?.has(name);
44
+ }
45
+ }
46
+ Object.defineProperty(_6, "name", { value: name });
47
+ return _6;
48
+ }
49
+ var $ZodAsyncError = class extends Error {
50
+ constructor() {
51
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
52
+ }
53
+ };
54
+ var globalConfig = {};
55
+ function config(config2) {
56
+ return globalConfig;
57
+ }
58
+
59
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/util.js
60
+ var util_exports = {};
61
+ __export(util_exports, {
62
+ BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
63
+ NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
64
+ aborted: () => aborted,
65
+ allowsEval: () => allowsEval,
66
+ assert: () => assert,
67
+ assertEqual: () => assertEqual,
68
+ assertIs: () => assertIs,
69
+ assertNever: () => assertNever,
70
+ assertNotEqual: () => assertNotEqual,
71
+ assignProp: () => assignProp,
72
+ cached: () => cached,
73
+ cleanInterfaceKey: () => cleanInterfaceKey,
74
+ cleanInterfaceShape: () => cleanInterfaceShape,
75
+ cleanRegex: () => cleanRegex,
76
+ clone: () => clone,
77
+ createTransparentProxy: () => createTransparentProxy,
78
+ defineLazy: () => defineLazy,
79
+ esc: () => esc,
80
+ escapeRegex: () => escapeRegex,
81
+ extend: () => extend,
82
+ extendObjectLike: () => extendObjectLike,
83
+ finalizeIssue: () => finalizeIssue,
84
+ floatSafeRemainder: () => floatSafeRemainder,
85
+ getElementAtPath: () => getElementAtPath,
86
+ getLengthableOrigin: () => getLengthableOrigin,
87
+ getParsedType: () => getParsedType,
88
+ getSizableOrigin: () => getSizableOrigin,
89
+ getValidEnumValues: () => getValidEnumValues,
90
+ isObject: () => isObject,
91
+ isPlainObject: () => isPlainObject,
92
+ issue: () => issue,
93
+ joinValues: () => joinValues,
94
+ jsonStringifyReplacer: () => jsonStringifyReplacer,
95
+ mergeObjectLike: () => mergeObjectLike,
96
+ normalizeObjectLikeDef: () => normalizeObjectLikeDef,
97
+ normalizeParams: () => normalizeParams,
98
+ nullish: () => nullish,
99
+ numKeys: () => numKeys,
100
+ omit: () => omit,
101
+ optionalInterfaceKeys: () => optionalInterfaceKeys,
102
+ optionalObjectKeys: () => optionalObjectKeys,
103
+ partialObjectLike: () => partialObjectLike,
104
+ pick: () => pick,
105
+ prefixIssues: () => prefixIssues,
106
+ primitiveTypes: () => primitiveTypes,
107
+ promiseAllObject: () => promiseAllObject,
108
+ propertyKeyTypes: () => propertyKeyTypes,
109
+ randomString: () => randomString,
110
+ requiredObjectLike: () => requiredObjectLike,
111
+ splitChecksAndParams: () => splitChecksAndParams,
112
+ stringifyPrimitive: () => stringifyPrimitive,
113
+ unwrapMessage: () => unwrapMessage
114
+ });
115
+ function assertEqual(val) {
116
+ return val;
117
+ }
118
+ function assertNotEqual(val) {
119
+ return val;
120
+ }
121
+ function assertIs(_arg) {
122
+ }
123
+ function assertNever(_x) {
124
+ throw new Error();
125
+ }
126
+ function assert(_6) {
127
+ }
128
+ function getValidEnumValues(obj) {
129
+ const validKeys = Object.keys(obj).filter((k) => typeof obj[obj[k]] !== "number");
130
+ const filtered = {};
131
+ for (const k of validKeys) {
132
+ filtered[k] = obj[k];
133
+ }
134
+ return Object.values(filtered);
135
+ }
136
+ function joinValues(array2, separator = "|") {
137
+ return array2.map((val) => stringifyPrimitive(val)).join(separator);
138
+ }
139
+ function jsonStringifyReplacer(_6, value) {
140
+ if (typeof value === "bigint")
141
+ return value.toString();
142
+ return value;
143
+ }
144
+ function cached(getter) {
17
145
  return {
18
- lang: config2?.lang ?? store?.lang,
19
- message: config2?.message,
20
- abortEarly: config2?.abortEarly ?? store?.abortEarly,
21
- abortPipeEarly: config2?.abortPipeEarly ?? store?.abortPipeEarly
146
+ get value() {
147
+ {
148
+ const value = getter();
149
+ Object.defineProperty(this, "value", { value });
150
+ return value;
151
+ }
152
+ }
22
153
  };
23
154
  }
24
- var store2;
25
- // @__NO_SIDE_EFFECTS__
26
- function getGlobalMessage(lang) {
27
- return store2?.get(lang);
155
+ function nullish(input) {
156
+ return input === null || input === void 0;
157
+ }
158
+ function cleanRegex(source) {
159
+ const start = source.startsWith("^") ? 1 : 0;
160
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
161
+ return source.slice(start, end);
162
+ }
163
+ function floatSafeRemainder(val, step) {
164
+ const valDecCount = (val.toString().split(".")[1] || "").length;
165
+ const stepDecCount = (step.toString().split(".")[1] || "").length;
166
+ const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
167
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
168
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
169
+ return valInt % stepInt / 10 ** decCount;
170
+ }
171
+ function defineLazy(object2, key, getter) {
172
+ Object.defineProperty(object2, key, {
173
+ get() {
174
+ {
175
+ const value = getter();
176
+ object2[key] = value;
177
+ return value;
178
+ }
179
+ },
180
+ set(v) {
181
+ Object.defineProperty(object2, key, {
182
+ value: v
183
+ // configurable: true,
184
+ });
185
+ },
186
+ configurable: true
187
+ });
28
188
  }
29
- var store3;
30
- // @__NO_SIDE_EFFECTS__
31
- function getSchemaMessage(lang) {
32
- return store3?.get(lang);
189
+ function assignProp(target, prop, value) {
190
+ Object.defineProperty(target, prop, {
191
+ value,
192
+ writable: true,
193
+ enumerable: true,
194
+ configurable: true
195
+ });
33
196
  }
34
- var store4;
35
- // @__NO_SIDE_EFFECTS__
36
- function getSpecificMessage(reference, lang) {
37
- return store4?.get(reference)?.get(lang);
197
+ function getElementAtPath(obj, path) {
198
+ if (!path)
199
+ return obj;
200
+ return path.reduce((acc, key) => acc?.[key], obj);
201
+ }
202
+ function promiseAllObject(promisesObj) {
203
+ const keys = Object.keys(promisesObj);
204
+ const promises = keys.map((key) => promisesObj[key]);
205
+ return Promise.all(promises).then((results) => {
206
+ const resolvedObj = {};
207
+ for (let i = 0; i < keys.length; i++) {
208
+ resolvedObj[keys[i]] = results[i];
209
+ }
210
+ return resolvedObj;
211
+ });
38
212
  }
39
- // @__NO_SIDE_EFFECTS__
40
- function _stringify(input) {
41
- const type = typeof input;
42
- if (type === "string") {
43
- return `"${input}"`;
44
- }
45
- if (type === "number" || type === "bigint" || type === "boolean") {
46
- return `${input}`;
47
- }
48
- if (type === "object" || type === "function") {
49
- return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
50
- }
51
- return type;
52
- }
53
- function _addIssue(context, label, dataset, config2, other) {
54
- const input = other && "input" in other ? other.input : dataset.value;
55
- const expected = other?.expected ?? context.expects ?? null;
56
- const received = other?.received ?? /* @__PURE__ */ _stringify(input);
57
- const issue = {
58
- kind: context.kind,
59
- type: context.type,
60
- input,
61
- expected,
62
- received,
63
- message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
64
- requirement: context.requirement,
65
- path: other?.path,
66
- issues: other?.issues,
67
- lang: config2.lang,
68
- abortEarly: config2.abortEarly,
69
- abortPipeEarly: config2.abortPipeEarly
70
- };
71
- const isSchema = context.kind === "schema";
72
- const message = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config2.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
73
- if (message !== void 0) {
74
- issue.message = typeof message === "function" ? (
75
- // @ts-expect-error
76
- message(issue)
77
- ) : message;
78
- }
79
- if (isSchema) {
80
- dataset.typed = false;
81
- }
82
- if (dataset.issues) {
83
- dataset.issues.push(issue);
84
- } else {
85
- dataset.issues = [issue];
213
+ function randomString(length = 10) {
214
+ const chars = "abcdefghijklmnopqrstuvwxyz";
215
+ let str = "";
216
+ for (let i = 0; i < length; i++) {
217
+ str += chars[Math.floor(Math.random() * chars.length)];
86
218
  }
219
+ return str;
87
220
  }
88
- // @__NO_SIDE_EFFECTS__
89
- function _getStandardProps(context) {
221
+ function esc(str) {
222
+ return JSON.stringify(str);
223
+ }
224
+ function isObject(data) {
225
+ return typeof data === "object" && data !== null;
226
+ }
227
+ var allowsEval = cached(() => {
228
+ try {
229
+ new Function("");
230
+ return true;
231
+ } catch (_6) {
232
+ return false;
233
+ }
234
+ });
235
+ function isPlainObject(data) {
236
+ return typeof data === "object" && data !== null && Object.getPrototypeOf(data) === Object.prototype;
237
+ }
238
+ function numKeys(data) {
239
+ let keyCount = 0;
240
+ for (const key in data) {
241
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
242
+ keyCount++;
243
+ }
244
+ }
245
+ return keyCount;
246
+ }
247
+ var getParsedType = (data) => {
248
+ const t = typeof data;
249
+ switch (t) {
250
+ case "undefined":
251
+ return "undefined";
252
+ case "string":
253
+ return "string";
254
+ case "number":
255
+ return Number.isNaN(data) ? "nan" : "number";
256
+ case "boolean":
257
+ return "boolean";
258
+ case "function":
259
+ return "function";
260
+ case "bigint":
261
+ return "bigint";
262
+ case "symbol":
263
+ return "symbol";
264
+ case "object":
265
+ if (Array.isArray(data)) {
266
+ return "array";
267
+ }
268
+ if (data === null) {
269
+ return "null";
270
+ }
271
+ if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
272
+ return "promise";
273
+ }
274
+ if (typeof Map !== "undefined" && data instanceof Map) {
275
+ return "map";
276
+ }
277
+ if (typeof Set !== "undefined" && data instanceof Set) {
278
+ return "set";
279
+ }
280
+ if (typeof Date !== "undefined" && data instanceof Date) {
281
+ return "date";
282
+ }
283
+ if (typeof File !== "undefined" && data instanceof File) {
284
+ return "file";
285
+ }
286
+ return "object";
287
+ default:
288
+ throw new Error(`Unknown data type: ${t}`);
289
+ }
290
+ };
291
+ var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
292
+ var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
293
+ function escapeRegex(str) {
294
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
295
+ }
296
+ function clone(inst, def) {
297
+ return new inst._zod.constr(def);
298
+ }
299
+ function splitChecksAndParams(_paramsOrChecks, _checks) {
300
+ const params = Array.isArray(_paramsOrChecks) ? {} : _paramsOrChecks ?? {};
301
+ const checks = Array.isArray(_paramsOrChecks) ? _paramsOrChecks : _checks ?? [];
90
302
  return {
91
- version: 1,
92
- vendor: "valibot",
93
- validate(value2) {
94
- return context["~run"]({ value: value2 }, /* @__PURE__ */ getGlobalConfig());
303
+ checks,
304
+ params
305
+ };
306
+ }
307
+ function normalizeParams(_params) {
308
+ const params = _params;
309
+ if (!params)
310
+ return {};
311
+ if (typeof params === "string")
312
+ return { error: () => params };
313
+ if (params?.message !== void 0) {
314
+ if (params?.error !== void 0)
315
+ throw new Error("Cannot specify both `message` and `error` params");
316
+ params.error = params.message;
317
+ }
318
+ delete params.message;
319
+ if (typeof params.error === "string")
320
+ return { ...params, error: () => params.error };
321
+ return params;
322
+ }
323
+ function createTransparentProxy(getter) {
324
+ let target;
325
+ return new Proxy({}, {
326
+ get(_6, prop, receiver) {
327
+ target ?? (target = getter());
328
+ return Reflect.get(target, prop, receiver);
329
+ },
330
+ set(_6, prop, value, receiver) {
331
+ target ?? (target = getter());
332
+ return Reflect.set(target, prop, value, receiver);
333
+ },
334
+ has(_6, prop) {
335
+ target ?? (target = getter());
336
+ return Reflect.has(target, prop);
337
+ },
338
+ deleteProperty(_6, prop) {
339
+ target ?? (target = getter());
340
+ return Reflect.deleteProperty(target, prop);
341
+ },
342
+ ownKeys(_6) {
343
+ target ?? (target = getter());
344
+ return Reflect.ownKeys(target);
345
+ },
346
+ getOwnPropertyDescriptor(_6, prop) {
347
+ target ?? (target = getter());
348
+ return Reflect.getOwnPropertyDescriptor(target, prop);
349
+ },
350
+ defineProperty(_6, prop, descriptor) {
351
+ target ?? (target = getter());
352
+ return Reflect.defineProperty(target, prop, descriptor);
353
+ }
354
+ // apply(target, thisArg, args) {
355
+ // return Reflect.apply(target, thisArg, args);
356
+ // },
357
+ // construct(target, args, newTarget) {
358
+ // return Reflect.construct(target, args, newTarget);
359
+ // },
360
+ });
361
+ }
362
+ function stringifyPrimitive(value) {
363
+ if (typeof value === "bigint")
364
+ return value.toString() + "n";
365
+ if (typeof value === "string")
366
+ return `"${value}"`;
367
+ return `${value}`;
368
+ }
369
+ function optionalObjectKeys(shape) {
370
+ return Object.keys(shape).filter((k) => {
371
+ return shape[k]._zod.qout === "true";
372
+ });
373
+ }
374
+ function optionalInterfaceKeys(shape) {
375
+ return Object.keys(shape).filter((k) => {
376
+ return k.endsWith("?");
377
+ }).map((k) => k.replace(/\?$/, ""));
378
+ }
379
+ function cleanInterfaceKey(key) {
380
+ return key.replace(/^\?/, "").replace(/\?$/, "");
381
+ }
382
+ function cleanInterfaceShape(_shape) {
383
+ const keyMap = {};
384
+ const shape = {};
385
+ const optional2 = [];
386
+ const defaulted = [];
387
+ for (const [key, value] of Object.entries(_shape)) {
388
+ if (key.endsWith("?"))
389
+ optional2.push(key.slice(0, -1));
390
+ if (key.startsWith("?"))
391
+ defaulted.push(key.slice(1));
392
+ const cleanKey = cleanInterfaceKey(key);
393
+ shape[cleanKey] = value;
394
+ keyMap[cleanKey] = key;
395
+ }
396
+ return { shape, keyMap, optional: optional2, defaulted };
397
+ }
398
+ var NUMBER_FORMAT_RANGES = {
399
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
400
+ int32: [-2147483648, 2147483647],
401
+ uint32: [0, 4294967295],
402
+ float32: [-34028234663852886e22, 34028234663852886e22],
403
+ float64: [-17976931348623157e292, 17976931348623157e292]
404
+ };
405
+ var BIGINT_FORMAT_RANGES = {
406
+ int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
407
+ uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
408
+ };
409
+ function pick(schema, mask) {
410
+ const newShape = {};
411
+ const newOptional = [];
412
+ const currShape = schema._zod.def.shape;
413
+ const currOptional = new Set(schema._zod.def.optional);
414
+ for (const key in mask) {
415
+ if (!(key in currShape)) {
416
+ throw new Error(`Unrecognized key: "${key}"`);
417
+ }
418
+ if (!mask[key])
419
+ continue;
420
+ newShape[key] = currShape[key];
421
+ if (currOptional.has(key)) {
422
+ newOptional.push(key);
423
+ }
424
+ }
425
+ return clone(schema, {
426
+ ...schema._zod.def,
427
+ shape: newShape,
428
+ optional: newOptional,
429
+ checks: []
430
+ });
431
+ }
432
+ function omit(schema, mask) {
433
+ const newShape = { ...schema._zod.def.shape };
434
+ const newOptional = new Set(schema._zod.def.optional);
435
+ for (const key in mask) {
436
+ if (!(key in schema._zod.def.shape)) {
437
+ throw new Error(`Unrecognized key: "${key}"`);
95
438
  }
439
+ if (!mask[key])
440
+ continue;
441
+ delete newShape[key];
442
+ newOptional.delete(key);
443
+ }
444
+ return clone(schema, {
445
+ ...schema._zod.def,
446
+ shape: newShape,
447
+ optional: [...newOptional],
448
+ checks: []
449
+ });
450
+ }
451
+ function extend(schema, shape) {
452
+ const def = {
453
+ ...schema._zod.def,
454
+ get shape() {
455
+ const _shape = { ...schema._zod.def.shape, ...shape };
456
+ assignProp(this, "shape", _shape);
457
+ return _shape;
458
+ },
459
+ checks: []
460
+ // delete existing checks
96
461
  };
462
+ defineLazy(def, "shape", () => ({ ...schema._zod.def.shape, ...shape }));
463
+ return clone(schema, def);
464
+ }
465
+ function mergeObjectLike(a, b) {
466
+ const bKeys = new Set(Object.keys(b._zod.def.shape));
467
+ const optional2 = [...a._zod.def.optional.filter((k) => !bKeys.has(k)), ...b._zod.def.optional];
468
+ return clone(a, {
469
+ ...a._zod.def,
470
+ get shape() {
471
+ const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
472
+ assignProp(this, "shape", _shape);
473
+ return _shape;
474
+ },
475
+ optional: optional2,
476
+ catchall: b._zod.def.catchall,
477
+ checks: []
478
+ // delete existing checks
479
+ });
97
480
  }
98
- var ValiError = class extends Error {
99
- /**
100
- * Creates a Valibot error with useful information.
101
- *
102
- * @param issues The error issues.
103
- */
481
+ function extendObjectLike(a, b) {
482
+ const bKeys = new Set(Object.keys(b._zod.def.shape));
483
+ const optional2 = [...a._zod.def.optional.filter((k) => !bKeys.has(k)), ...b._zod.def.optional];
484
+ return clone(a, {
485
+ ...a._zod.def,
486
+ get shape() {
487
+ const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
488
+ assignProp(this, "shape", _shape);
489
+ return _shape;
490
+ },
491
+ optional: optional2,
492
+ checks: []
493
+ // delete existent checks
494
+ });
495
+ }
496
+ function partialObjectLike(Class, schema, mask) {
497
+ const shape = { ...schema._zod.def.shape };
498
+ const optional2 = new Set(schema._zod.def.optional);
499
+ if (mask) {
500
+ for (const key in mask) {
501
+ if (!(key in shape)) {
502
+ throw new Error(`Unrecognized key: "${key}"`);
503
+ }
504
+ if (!mask[key])
505
+ continue;
506
+ shape[key] = new Class({
507
+ type: "optional",
508
+ innerType: schema._zod.def.shape[key]
509
+ });
510
+ optional2.add(key);
511
+ }
512
+ } else {
513
+ for (const key in schema._zod.def.shape) {
514
+ shape[key] = new Class({
515
+ type: "optional",
516
+ innerType: schema._zod.def.shape[key]
517
+ });
518
+ optional2.add(key);
519
+ }
520
+ }
521
+ return clone(schema, {
522
+ ...schema._zod.def,
523
+ shape,
524
+ optional: [...optional2],
525
+ checks: []
526
+ });
527
+ }
528
+ function requiredObjectLike(Class, schema, mask) {
529
+ const shape = { ...schema._zod.def.shape };
530
+ if (mask) {
531
+ for (const key in mask) {
532
+ if (!(key in shape)) {
533
+ throw new Error(`Unrecognized key: "${key}"`);
534
+ }
535
+ if (!mask[key])
536
+ continue;
537
+ shape[key] = new Class({
538
+ type: "nonoptional",
539
+ innerType: schema._zod.def.shape[key]
540
+ });
541
+ }
542
+ } else {
543
+ for (const key in schema._zod.def.shape) {
544
+ shape[key] = new Class({
545
+ type: "nonoptional",
546
+ innerType: schema._zod.def.shape[key]
547
+ });
548
+ }
549
+ }
550
+ return clone(schema, {
551
+ ...schema._zod.def,
552
+ shape,
553
+ optional: [],
554
+ checks: []
555
+ });
556
+ }
557
+ function normalizeObjectLikeDef(def) {
558
+ if (def.type === "interface") {
559
+ const keys = Object.keys(def.shape);
560
+ const keySet = new Set(Object.keys(def.shape));
561
+ return {
562
+ shape: { ...def.shape },
563
+ // resolve getters
564
+ keys,
565
+ keySet,
566
+ numKeys: keys.length,
567
+ optionalKeys: new Set(def.optional)
568
+ };
569
+ }
570
+ if (def.type === "object") {
571
+ const keys = Object.keys(def.shape);
572
+ const keySet = new Set(Object.keys(def.shape));
573
+ return {
574
+ shape: { ...def.shape },
575
+ // resolve getters
576
+ keys,
577
+ keySet,
578
+ numKeys: keys.length,
579
+ optionalKeys: new Set(def.optional)
580
+ };
581
+ }
582
+ throw new Error("Invalid object-like type");
583
+ }
584
+ function aborted(x, startIndex = 0) {
585
+ for (let i = startIndex; i < x.issues.length; i++) {
586
+ if (x.issues[i].continue !== true)
587
+ return true;
588
+ }
589
+ return false;
590
+ }
591
+ function prefixIssues(path, issues) {
592
+ return issues.map((iss) => {
593
+ var _a;
594
+ (_a = iss).path ?? (_a.path = []);
595
+ iss.path.unshift(path);
596
+ return iss;
597
+ });
598
+ }
599
+ function unwrapMessage(message) {
600
+ return typeof message === "string" ? message : message?.message;
601
+ }
602
+ function finalizeIssue(iss, ctx, config2) {
603
+ const full = { ...iss, path: iss.path ?? [] };
604
+ if (!iss.message) {
605
+ const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
606
+ full.message = message;
607
+ }
608
+ delete full.inst;
609
+ delete full.continue;
610
+ if (!ctx?.reportInput) {
611
+ delete full.input;
612
+ }
613
+ return full;
614
+ }
615
+ function getSizableOrigin(input) {
616
+ if (input instanceof Set)
617
+ return "set";
618
+ if (input instanceof Map)
619
+ return "map";
620
+ if (input instanceof File)
621
+ return "file";
622
+ return "unknown";
623
+ }
624
+ function getLengthableOrigin(input) {
625
+ if (Array.isArray(input))
626
+ return "array";
627
+ if (typeof input === "string")
628
+ return "string";
629
+ return "unknown";
630
+ }
631
+ function issue(...args) {
632
+ const [iss, input, inst] = args;
633
+ if (typeof iss === "string") {
634
+ return {
635
+ message: iss,
636
+ code: "custom",
637
+ input,
638
+ inst
639
+ };
640
+ }
641
+ return { ...iss };
642
+ }
643
+
644
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/errors.js
645
+ var ZOD_ERROR = Symbol.for("{{zod.error}}");
646
+ var $ZodError = class {
647
+ get message() {
648
+ return JSON.stringify(this.issues, jsonStringifyReplacer, 2);
649
+ }
104
650
  constructor(issues) {
105
- super(issues[0].message);
106
- this.name = "ValiError";
651
+ Object.defineProperty(this, "_tag", { value: ZOD_ERROR, enumerable: false });
652
+ Object.defineProperty(this, "name", { value: "$ZodError", enumerable: false });
107
653
  this.issues = issues;
108
654
  }
655
+ // @ts-ignore
656
+ static [Symbol.hasInstance](inst) {
657
+ return inst?._tag === ZOD_ERROR;
658
+ }
109
659
  };
110
- // @__NO_SIDE_EFFECTS__
111
- function getFallback(schema, dataset, config2) {
112
- return typeof schema.fallback === "function" ? (
113
- // @ts-expect-error
114
- schema.fallback(dataset, config2)
115
- ) : (
116
- // @ts-expect-error
117
- schema.fallback
118
- );
660
+
661
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/parse.js
662
+ function _parse(schema, value, _ctx) {
663
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
664
+ const result = schema._zod.run({ value, issues: [] }, ctx);
665
+ if (result instanceof Promise) {
666
+ throw new $ZodAsyncError();
667
+ }
668
+ if (result.issues.length) {
669
+ throw new (this?.Error ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
670
+ }
671
+ return result.value;
119
672
  }
120
- // @__NO_SIDE_EFFECTS__
121
- function getDefault(schema, dataset, config2) {
122
- return typeof schema.default === "function" ? (
123
- // @ts-expect-error
124
- schema.default(dataset, config2)
125
- ) : (
126
- // @ts-expect-error
127
- schema.default
128
- );
673
+ function _safeParse(schema, value, _ctx) {
674
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
675
+ const result = schema._zod.run({ value, issues: [] }, ctx);
676
+ if (result instanceof Promise) {
677
+ throw new $ZodAsyncError();
678
+ }
679
+ return result.issues.length ? {
680
+ success: false,
681
+ error: new (this?.Error ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
682
+ } : { success: true, data: result.value };
683
+ }
684
+ async function _parseAsync(schema, value, _ctx) {
685
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
686
+ let result = schema._zod.run({ value, issues: [] }, ctx);
687
+ if (result instanceof Promise)
688
+ result = await result;
689
+ if (result.issues.length) {
690
+ throw new (this?.Error ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
691
+ }
692
+ return result.value;
693
+ }
694
+ async function _safeParseAsync(schema, value, _ctx) {
695
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
696
+ let result = schema._zod.run({ value, issues: [] }, ctx);
697
+ if (result instanceof Promise)
698
+ result = await result;
699
+ if (result.issues.length) {
700
+ return {
701
+ success: false,
702
+ error: new (this?.Error ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
703
+ };
704
+ }
705
+ return { success: true, data: result.value };
129
706
  }
130
- // @__NO_SIDE_EFFECTS__
131
- function array(item, message) {
132
- return {
133
- kind: "schema",
134
- type: "array",
135
- reference: array,
136
- expects: "Array",
137
- async: false,
138
- item,
139
- message,
140
- get "~standard"() {
141
- return /* @__PURE__ */ _getStandardProps(this);
142
- },
143
- "~run"(dataset, config2) {
144
- const input = dataset.value;
145
- if (Array.isArray(input)) {
146
- dataset.typed = true;
147
- dataset.value = [];
148
- for (let key = 0; key < input.length; key++) {
149
- const value2 = input[key];
150
- const itemDataset = this.item["~run"]({ value: value2 }, config2);
151
- if (itemDataset.issues) {
152
- const pathItem = {
153
- type: "array",
154
- origin: "value",
155
- input,
156
- key,
157
- value: value2
158
- };
159
- for (const issue of itemDataset.issues) {
160
- if (issue.path) {
161
- issue.path.unshift(pathItem);
162
- } else {
163
- issue.path = [pathItem];
164
- }
165
- dataset.issues?.push(issue);
166
- }
167
- if (!dataset.issues) {
168
- dataset.issues = itemDataset.issues;
169
- }
170
- if (config2.abortEarly) {
171
- dataset.typed = false;
172
- break;
173
- }
174
- }
175
- if (!itemDataset.typed) {
176
- dataset.typed = false;
707
+ var string = (params) => {
708
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
709
+ return new RegExp(`^${regex}$`);
710
+ };
711
+ var boolean = /true|false/i;
712
+
713
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/doc.js
714
+ var Doc = class {
715
+ constructor(args) {
716
+ this.content = [];
717
+ this.indent = 0;
718
+ this.args = args;
719
+ }
720
+ indented(fn) {
721
+ this.indent += 1;
722
+ fn(this);
723
+ this.indent -= 1;
724
+ }
725
+ write(arg) {
726
+ if (typeof arg === "function") {
727
+ arg(this, { execution: "sync" });
728
+ arg(this, { execution: "async" });
729
+ return;
730
+ }
731
+ const content = arg;
732
+ const lines = content.split("\n").filter((x) => x);
733
+ const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
734
+ const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
735
+ for (const line of dedented) {
736
+ this.content.push(line);
737
+ }
738
+ }
739
+ compile() {
740
+ const lines = [...this.content.map((x) => ` ${x}`)];
741
+ return new Function(...this.args, lines.join("\n"));
742
+ }
743
+ };
744
+
745
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/versions.js
746
+ var version = {
747
+ major: 0,
748
+ minor: 3,
749
+ patch: 3
750
+ };
751
+
752
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/schemas.js
753
+ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
754
+ var _a;
755
+ inst ?? (inst = {});
756
+ inst._zod.id = def.type + "_" + randomString(10);
757
+ inst._zod.def = def;
758
+ inst._zod.computed = inst._zod.computed || {};
759
+ inst._zod.version = version;
760
+ const checks = [...inst._zod.def.checks ?? []];
761
+ def.type;
762
+ if (inst._zod.traits.has("$ZodCheck")) {
763
+ checks.unshift(inst);
764
+ }
765
+ for (const ch of checks) {
766
+ ch._zod.onattach?.(inst);
767
+ }
768
+ if (checks.length === 0) {
769
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
770
+ inst._zod.deferred?.push(() => {
771
+ inst._zod.run = inst._zod.parse;
772
+ });
773
+ } else {
774
+ const runChecks = (payload, checks2, ctx) => {
775
+ let isAborted = aborted(payload);
776
+ let asyncResult;
777
+ for (const ch of checks2) {
778
+ if (ch._zod.when) {
779
+ const shouldRun = ch._zod.when(payload);
780
+ if (!shouldRun)
781
+ continue;
782
+ } else {
783
+ if (isAborted) {
784
+ continue;
177
785
  }
178
- dataset.value.push(itemDataset.value);
179
786
  }
787
+ const currLen = payload.issues.length;
788
+ const _6 = ch._zod.check(payload);
789
+ if (_6 instanceof Promise && ctx?.async === false) {
790
+ throw new $ZodAsyncError();
791
+ }
792
+ if (asyncResult || _6 instanceof Promise) {
793
+ asyncResult = asyncResult ?? Promise.resolve();
794
+ asyncResult.then(async () => {
795
+ await _6;
796
+ const nextLen = payload.issues.length;
797
+ if (nextLen === currLen)
798
+ return;
799
+ if (!isAborted)
800
+ isAborted = aborted(payload, currLen);
801
+ });
802
+ } else {
803
+ const nextLen = payload.issues.length;
804
+ if (nextLen === currLen)
805
+ continue;
806
+ if (!isAborted)
807
+ isAborted = aborted(payload, currLen);
808
+ }
809
+ }
810
+ if (asyncResult) {
811
+ return asyncResult.then(() => {
812
+ return payload;
813
+ });
814
+ }
815
+ return payload;
816
+ };
817
+ inst._zod.run = (payload, ctx) => {
818
+ const result = inst._zod.parse(payload, ctx);
819
+ if (result instanceof Promise) {
820
+ if (ctx.async === false)
821
+ throw new $ZodAsyncError();
822
+ return result.then((result2) => runChecks(result2, checks, ctx));
823
+ }
824
+ return runChecks(result, checks, ctx);
825
+ };
826
+ }
827
+ inst["~standard"] = {
828
+ validate: (value) => {
829
+ const result = inst._zod.run({ value, issues: [] }, {});
830
+ if (result instanceof Promise) {
831
+ return result.then(({ issues, value: value2 }) => {
832
+ if (issues.length === 0)
833
+ return { value: value2 };
834
+ return { issues };
835
+ });
836
+ }
837
+ if (result.issues.length === 0)
838
+ return { value: result.value };
839
+ return { issues: result.issues };
840
+ },
841
+ vendor: "zod",
842
+ version: 1
843
+ };
844
+ });
845
+ var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
846
+ $ZodType.init(inst, def);
847
+ inst._zod.pattern = inst?._zod.computed?.pattern ?? string(inst._zod.computed);
848
+ inst._zod.parse = (payload, _6) => {
849
+ if (def.coerce)
850
+ try {
851
+ payload.value = String(payload.value);
852
+ } catch (_7) {
853
+ }
854
+ if (typeof payload.value === "string")
855
+ return payload;
856
+ payload.issues.push({
857
+ expected: "string",
858
+ code: "invalid_type",
859
+ input: payload.value,
860
+ inst
861
+ });
862
+ return payload;
863
+ };
864
+ });
865
+ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
866
+ $ZodType.init(inst, def);
867
+ inst._zod.pattern = boolean;
868
+ inst._zod.parse = (payload, _ctx) => {
869
+ if (def.coerce)
870
+ try {
871
+ payload.value = Boolean(payload.value);
872
+ } catch (_6) {
873
+ }
874
+ const input = payload.value;
875
+ if (typeof input === "boolean")
876
+ return payload;
877
+ payload.issues.push({
878
+ expected: "boolean",
879
+ code: "invalid_type",
880
+ input,
881
+ inst
882
+ });
883
+ return payload;
884
+ };
885
+ });
886
+ function handleArrayResult(result, final, index) {
887
+ if (result.issues.length) {
888
+ final.issues.push(...prefixIssues(index, result.issues));
889
+ }
890
+ final.value[index] = result.value;
891
+ }
892
+ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
893
+ $ZodType.init(inst, def);
894
+ inst._zod.parse = (payload, ctx) => {
895
+ const input = payload.value;
896
+ if (!Array.isArray(input)) {
897
+ payload.issues.push({
898
+ expected: "array",
899
+ code: "invalid_type",
900
+ input,
901
+ inst
902
+ });
903
+ return payload;
904
+ }
905
+ payload.value = Array(input.length);
906
+ const proms = [];
907
+ for (let i = 0; i < input.length; i++) {
908
+ const item = input[i];
909
+ const result = def.element._zod.run({
910
+ value: item,
911
+ issues: []
912
+ }, ctx);
913
+ if (result instanceof Promise) {
914
+ proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
180
915
  } else {
181
- _addIssue(this, "type", dataset, config2);
916
+ handleArrayResult(result, payload, i);
182
917
  }
183
- return dataset;
184
918
  }
919
+ if (proms.length) {
920
+ return Promise.all(proms).then(() => payload);
921
+ }
922
+ return payload;
185
923
  };
924
+ });
925
+ function handleObjectResult(result, final, key) {
926
+ if (result.issues.length) {
927
+ final.issues.push(...prefixIssues(key, result.issues));
928
+ } else {
929
+ final.value[key] = result.value;
930
+ }
186
931
  }
187
- // @__NO_SIDE_EFFECTS__
188
- function boolean(message) {
189
- return {
190
- kind: "schema",
191
- type: "boolean",
192
- reference: boolean,
193
- expects: "boolean",
194
- async: false,
195
- message,
196
- get "~standard"() {
197
- return /* @__PURE__ */ _getStandardProps(this);
198
- },
199
- "~run"(dataset, config2) {
200
- if (typeof dataset.value === "boolean") {
201
- dataset.typed = true;
202
- } else {
203
- _addIssue(this, "type", dataset, config2);
932
+ function handleOptionalObjectResult(result, final, key, input) {
933
+ if (result.issues.length) {
934
+ if (input[key] === void 0) {
935
+ if (key in input) {
936
+ final.value[key] = void 0;
204
937
  }
205
- return dataset;
938
+ } else {
939
+ final.issues.push(...prefixIssues(key, result.issues));
206
940
  }
207
- };
941
+ } else if (result.value === void 0) {
942
+ if (key in input)
943
+ final.value[key] = void 0;
944
+ } else {
945
+ final.value[key] = result.value;
946
+ }
208
947
  }
209
- // @__NO_SIDE_EFFECTS__
210
- function object(entries, message) {
211
- return {
212
- kind: "schema",
213
- type: "object",
214
- reference: object,
215
- expects: "Object",
216
- async: false,
217
- entries,
218
- message,
219
- get "~standard"() {
220
- return /* @__PURE__ */ _getStandardProps(this);
221
- },
222
- "~run"(dataset, config2) {
223
- const input = dataset.value;
224
- if (input && typeof input === "object") {
225
- dataset.typed = true;
226
- dataset.value = {};
227
- for (const key in this.entries) {
228
- const valueSchema = this.entries[key];
229
- if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && // @ts-expect-error
230
- valueSchema.default !== void 0) {
231
- const value2 = key in input ? (
232
- // @ts-expect-error
233
- input[key]
234
- ) : /* @__PURE__ */ getDefault(valueSchema);
235
- const valueDataset = valueSchema["~run"]({ value: value2 }, config2);
236
- if (valueDataset.issues) {
237
- const pathItem = {
238
- type: "object",
239
- origin: "value",
240
- input,
241
- key,
242
- value: value2
243
- };
244
- for (const issue of valueDataset.issues) {
245
- if (issue.path) {
246
- issue.path.unshift(pathItem);
247
- } else {
248
- issue.path = [pathItem];
249
- }
250
- dataset.issues?.push(issue);
251
- }
252
- if (!dataset.issues) {
253
- dataset.issues = valueDataset.issues;
254
- }
255
- if (config2.abortEarly) {
256
- dataset.typed = false;
257
- break;
258
- }
259
- }
260
- if (!valueDataset.typed) {
261
- dataset.typed = false;
262
- }
263
- dataset.value[key] = valueDataset.value;
264
- } else if (valueSchema.fallback !== void 0) {
265
- dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
266
- } else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
267
- _addIssue(this, "key", dataset, config2, {
268
- input: void 0,
269
- expected: `"${key}"`,
270
- path: [
271
- {
272
- type: "object",
273
- origin: "key",
274
- input,
275
- key,
276
- // @ts-expect-error
277
- value: input[key]
278
- }
279
- ]
280
- });
281
- if (config2.abortEarly) {
282
- break;
948
+ var $ZodObjectLike = /* @__PURE__ */ $constructor("$ZodObjectLike", (inst, def) => {
949
+ $ZodType.init(inst, def);
950
+ defineLazy(inst._zod, "shape", () => def.shape);
951
+ const _normalized = cached(() => {
952
+ const keys = Object.keys(def.shape);
953
+ return {
954
+ shape: def.shape,
955
+ keys,
956
+ keySet: new Set(keys),
957
+ numKeys: keys.length,
958
+ optionalKeys: new Set(def.optional)
959
+ };
960
+ });
961
+ defineLazy(inst._zod, "disc", () => {
962
+ const shape = def.shape;
963
+ const discMap = /* @__PURE__ */ new Map();
964
+ let hasDisc = false;
965
+ for (const key in shape) {
966
+ const field = shape[key]._zod;
967
+ if (field.values || field.disc) {
968
+ hasDisc = true;
969
+ const o = {
970
+ values: new Set(field.values ?? []),
971
+ maps: field.disc ? [field.disc] : []
972
+ };
973
+ discMap.set(key, o);
974
+ }
975
+ }
976
+ if (!hasDisc)
977
+ return void 0;
978
+ return discMap;
979
+ });
980
+ const generateFastpass = (shape) => {
981
+ const doc = new Doc(["shape", "payload", "ctx"]);
982
+ const { keys, optionalKeys } = _normalized.value;
983
+ const parseStr = (key) => {
984
+ const k = esc(key);
985
+ return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
986
+ };
987
+ doc.write(`const input = payload.value;`);
988
+ const ids = {};
989
+ for (const key of keys) {
990
+ ids[key] = randomString(15);
991
+ }
992
+ for (const key of keys) {
993
+ if (optionalKeys.has(key))
994
+ continue;
995
+ const id = ids[key];
996
+ doc.write(`const ${id} = ${parseStr(key)};`);
997
+ doc.write(`
998
+ if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
999
+ ...iss,
1000
+ path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
1001
+ })));`);
1002
+ }
1003
+ doc.write(`payload.value = {`);
1004
+ doc.indented(() => {
1005
+ for (const key of keys) {
1006
+ if (optionalKeys.has(key))
1007
+ continue;
1008
+ const id = ids[key];
1009
+ doc.write(` ${esc(key)}: ${id}.value,`);
1010
+ }
1011
+ });
1012
+ doc.write(`}`);
1013
+ for (const key of keys) {
1014
+ if (!optionalKeys.has(key))
1015
+ continue;
1016
+ const id = ids[key];
1017
+ doc.write(`const ${id} = ${parseStr(key)};`);
1018
+ const k = esc(key);
1019
+ doc.write(`
1020
+ if (${id}.issues.length) {
1021
+ if (input[${k}] === undefined) {
1022
+ if (${k} in input) {
1023
+ payload.value[${k}] = undefined;
283
1024
  }
1025
+ } else {
1026
+ payload.issues = payload.issues.concat(
1027
+ ${id}.issues.map((iss) => ({
1028
+ ...iss,
1029
+ path: iss.path ? [${k}, ...iss.path] : [${k}],
1030
+ }))
1031
+ );
1032
+ }
1033
+ } else if (${id}.value === undefined) {
1034
+ if (${k} in input) payload.value[${k}] = undefined;
1035
+ } else {
1036
+ payload.value[${k}] = ${id}.value;
1037
+ }
1038
+ `);
1039
+ }
1040
+ doc.write(`return payload;`);
1041
+ const fn = doc.compile();
1042
+ return (payload, ctx) => fn(shape, payload, ctx);
1043
+ };
1044
+ let fastpass;
1045
+ const fastEnabled = allowsEval.value;
1046
+ const isObject2 = isObject;
1047
+ const { catchall } = def;
1048
+ let value;
1049
+ inst._zod.parse = (payload, ctx) => {
1050
+ value ?? (value = _normalized.value);
1051
+ const input = payload.value;
1052
+ if (!isObject2(input)) {
1053
+ payload.issues.push({
1054
+ expected: "object",
1055
+ code: "invalid_type",
1056
+ input,
1057
+ inst
1058
+ });
1059
+ return payload;
1060
+ }
1061
+ const proms = [];
1062
+ if (fastEnabled && ctx?.async === false && ctx.noPrecompilation !== true) {
1063
+ if (!fastpass)
1064
+ fastpass = generateFastpass(def.shape);
1065
+ payload = fastpass(payload, ctx);
1066
+ } else {
1067
+ payload.value = {};
1068
+ const { keys, shape, optionalKeys } = value;
1069
+ for (const key of keys) {
1070
+ const valueSchema = shape[key];
1071
+ const r = valueSchema._zod.run({ value: input[key], issues: [] }, ctx);
1072
+ const isOptional = optionalKeys.has(key);
1073
+ if (r instanceof Promise) {
1074
+ proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult(r2, payload, key, input) : handleObjectResult(r2, payload, key)));
1075
+ } else {
1076
+ if (isOptional) {
1077
+ handleOptionalObjectResult(r, payload, key, input);
1078
+ } else {
1079
+ handleObjectResult(r, payload, key);
284
1080
  }
285
1081
  }
1082
+ }
1083
+ }
1084
+ if (!catchall) {
1085
+ return proms.length ? Promise.all(proms).then(() => payload) : payload;
1086
+ }
1087
+ const unrecognized = [];
1088
+ const keySet = value.keySet;
1089
+ const _catchall = catchall._zod;
1090
+ const t = _catchall.def.type;
1091
+ for (const key of Object.keys(input)) {
1092
+ if (keySet.has(key))
1093
+ continue;
1094
+ if (t === "never") {
1095
+ unrecognized.push(key);
1096
+ continue;
1097
+ }
1098
+ const r = _catchall.run({ value: input[key], issues: [] }, ctx);
1099
+ if (r instanceof Promise) {
1100
+ proms.push(r.then((r2) => handleObjectResult(r2, payload, key)));
286
1101
  } else {
287
- _addIssue(this, "type", dataset, config2);
1102
+ handleObjectResult(r, payload, key);
288
1103
  }
289
- return dataset;
290
1104
  }
1105
+ if (unrecognized.length) {
1106
+ payload.issues.push({
1107
+ code: "unrecognized_keys",
1108
+ keys: unrecognized,
1109
+ input,
1110
+ inst
1111
+ });
1112
+ }
1113
+ if (!proms.length)
1114
+ return payload;
1115
+ return Promise.all(proms).then(() => {
1116
+ return payload;
1117
+ });
291
1118
  };
292
- }
293
- // @__NO_SIDE_EFFECTS__
294
- function optional(wrapped, default_) {
295
- return {
296
- kind: "schema",
297
- type: "optional",
298
- reference: optional,
299
- expects: `(${wrapped.expects} | undefined)`,
300
- async: false,
301
- wrapped,
302
- default: default_,
303
- get "~standard"() {
304
- return /* @__PURE__ */ _getStandardProps(this);
305
- },
306
- "~run"(dataset, config2) {
307
- if (dataset.value === void 0) {
308
- if (this.default !== void 0) {
309
- dataset.value = /* @__PURE__ */ getDefault(this, dataset, config2);
310
- }
311
- if (dataset.value === void 0) {
312
- dataset.typed = true;
313
- return dataset;
314
- }
315
- }
316
- return this.wrapped["~run"](dataset, config2);
1119
+ });
1120
+ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1121
+ $ZodObjectLike.init(inst, def);
1122
+ });
1123
+ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
1124
+ $ZodType.init(inst, def);
1125
+ inst._zod.qout = "true";
1126
+ if (def.innerType._zod.values)
1127
+ inst._zod.values = /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]);
1128
+ const pattern = def.innerType._zod.pattern;
1129
+ if (pattern)
1130
+ inst._zod.pattern = new RegExp(`^(${cleanRegex(pattern.source)})?$`);
1131
+ inst._zod.parse = (payload, ctx) => {
1132
+ if (payload.value === void 0) {
1133
+ return payload;
317
1134
  }
1135
+ return def.innerType._zod.run(payload, ctx);
318
1136
  };
319
- }
320
- // @__NO_SIDE_EFFECTS__
321
- function string(message) {
322
- return {
323
- kind: "schema",
1137
+ });
1138
+
1139
+ // ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/api.js
1140
+ function _string(Class, params) {
1141
+ return new Class({
324
1142
  type: "string",
325
- reference: string,
326
- expects: "string",
327
- async: false,
328
- message,
329
- get "~standard"() {
330
- return /* @__PURE__ */ _getStandardProps(this);
1143
+ ...normalizeParams(params)
1144
+ });
1145
+ }
1146
+ function _boolean(Class, params) {
1147
+ return new Class({
1148
+ type: "boolean",
1149
+ ...normalizeParams(params)
1150
+ });
1151
+ }
1152
+
1153
+ // ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.20250411T005215_60e10b0f348e07070e4d24639ea7d4ee/node_modules/@zod/mini/dist/esm/parse.js
1154
+ var parse2 = /* @__PURE__ */ _parse.bind({ Error: $ZodError });
1155
+ var safeParse = /* @__PURE__ */ _safeParse.bind({ Error: $ZodError });
1156
+ var parseAsync2 = /* @__PURE__ */ _parseAsync.bind({ Error: $ZodError });
1157
+ var safeParseAsync = /* @__PURE__ */ _safeParseAsync.bind({
1158
+ Error: $ZodError
1159
+ });
1160
+
1161
+ // ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.20250411T005215_60e10b0f348e07070e4d24639ea7d4ee/node_modules/@zod/mini/dist/esm/schemas.js
1162
+ var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
1163
+ if (!inst._zod)
1164
+ throw new Error("Uninitialized schema in mixin ZodMiniType.");
1165
+ $ZodType.init(inst, def);
1166
+ inst.def = def;
1167
+ inst.parse = (data, params) => parse2(inst, data, params);
1168
+ inst.safeParse = (data, params) => safeParse(inst, data, params);
1169
+ inst.parseAsync = async (data, params) => parseAsync2(inst, data, params);
1170
+ inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
1171
+ inst.check = (...checks) => {
1172
+ return inst.clone({
1173
+ ...def,
1174
+ checks: [
1175
+ ...def.checks ?? [],
1176
+ ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" } } } : ch)
1177
+ ]
1178
+ });
1179
+ };
1180
+ inst.clone = (_def) => clone(inst, _def ?? def);
1181
+ inst.brand = () => inst;
1182
+ inst.register = (reg, meta) => {
1183
+ reg.add(inst, meta);
1184
+ return inst;
1185
+ };
1186
+ });
1187
+ var ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
1188
+ $ZodString.init(inst, def);
1189
+ ZodMiniType.init(inst, def);
1190
+ });
1191
+ function string2(params) {
1192
+ return _string(ZodMiniString, params);
1193
+ }
1194
+ var ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
1195
+ $ZodBoolean.init(inst, def);
1196
+ ZodMiniType.init(inst, def);
1197
+ });
1198
+ function boolean2(params) {
1199
+ return _boolean(ZodMiniBoolean, params);
1200
+ }
1201
+ var ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
1202
+ $ZodArray.init(inst, def);
1203
+ ZodMiniType.init(inst, def);
1204
+ });
1205
+ function array(element, params) {
1206
+ return new ZodMiniArray({
1207
+ type: "array",
1208
+ element,
1209
+ // get element() {
1210
+ // return element;
1211
+ // },
1212
+ ...util_exports.normalizeParams(params)
1213
+ });
1214
+ }
1215
+ var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
1216
+ $ZodObject.init(inst, def);
1217
+ ZodMiniType.init(inst, def);
1218
+ });
1219
+ function object(shape, params) {
1220
+ const def = {
1221
+ type: "object",
1222
+ shape: shape ?? {},
1223
+ get optional() {
1224
+ return util_exports.optionalObjectKeys(shape ?? {});
331
1225
  },
332
- "~run"(dataset, config2) {
333
- if (typeof dataset.value === "string") {
334
- dataset.typed = true;
335
- } else {
336
- _addIssue(this, "type", dataset, config2);
337
- }
338
- return dataset;
339
- }
1226
+ ...util_exports.normalizeParams(params)
340
1227
  };
1228
+ return new ZodMiniObject(def);
341
1229
  }
342
- function parse(schema, input, config2) {
343
- const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config2));
344
- if (dataset.issues) {
345
- throw new ValiError(dataset.issues);
346
- }
347
- return dataset.value;
1230
+ var ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
1231
+ $ZodOptional.init(inst, def);
1232
+ ZodMiniType.init(inst, def);
1233
+ });
1234
+ function optional(innerType, params) {
1235
+ return new ZodMiniOptional({
1236
+ type: "optional",
1237
+ innerType,
1238
+ ...util_exports.normalizeParams(params)
1239
+ });
348
1240
  }
349
1241
 
350
1242
  // ../shared/src/schemas.ts
@@ -354,26 +1246,26 @@ var CustomComponentPropSchema = object({
354
1246
  * @example
355
1247
  * "to"
356
1248
  */
357
- name: string(),
1249
+ name: string2(),
358
1250
  /**
359
1251
  * The name of the prop in the host component.
360
1252
  * @example
361
1253
  * "href"
362
1254
  */
363
- as: optional(string()),
1255
+ as: optional(string2()),
364
1256
  /**
365
1257
  * Whether the prop is controlled or not in the user-defined component.
366
1258
  * @internal
367
1259
  * @example
368
1260
  * `true`
369
1261
  */
370
- controlled: optional(boolean()),
1262
+ controlled: optional(boolean2()),
371
1263
  /**
372
1264
  * The default value of the prop in the user-defined component.
373
1265
  * @example
374
1266
  * `"/"`
375
1267
  */
376
- defaultValue: optional(string())
1268
+ defaultValue: optional(string2())
377
1269
  });
378
1270
  var CustomComponentSchema = object({
379
1271
  /**
@@ -381,13 +1273,13 @@ var CustomComponentSchema = object({
381
1273
  * @example
382
1274
  * "Link"
383
1275
  */
384
- name: string(),
1276
+ name: string2(),
385
1277
  /**
386
1278
  * The name of the host component that the user-defined component represents.
387
1279
  * @example
388
1280
  * "a"
389
1281
  */
390
- as: optional(string()),
1282
+ as: optional(string2()),
391
1283
  /**
392
1284
  * Attributes mapping between the user-defined component and the host component.
393
1285
  * @example
@@ -400,28 +1292,28 @@ var CustomComponentSchema = object({
400
1292
  * @example
401
1293
  * `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
402
1294
  */
403
- selector: optional(string())
1295
+ selector: optional(string2())
404
1296
  });
405
1297
  var CustomHooksSchema = object({
406
- use: optional(array(string())),
407
- useActionState: optional(array(string())),
408
- useCallback: optional(array(string())),
409
- useContext: optional(array(string())),
410
- useDebugValue: optional(array(string())),
411
- useDeferredValue: optional(array(string())),
412
- useEffect: optional(array(string())),
413
- useFormStatus: optional(array(string())),
414
- useId: optional(array(string())),
415
- useImperativeHandle: optional(array(string())),
416
- useInsertionEffect: optional(array(string())),
417
- useLayoutEffect: optional(array(string())),
418
- useMemo: optional(array(string())),
419
- useOptimistic: optional(array(string())),
420
- useReducer: optional(array(string())),
421
- useRef: optional(array(string())),
422
- useState: optional(array(string())),
423
- useSyncExternalStore: optional(array(string())),
424
- useTransition: optional(array(string()))
1298
+ use: optional(array(string2())),
1299
+ useActionState: optional(array(string2())),
1300
+ useCallback: optional(array(string2())),
1301
+ useContext: optional(array(string2())),
1302
+ useDebugValue: optional(array(string2())),
1303
+ useDeferredValue: optional(array(string2())),
1304
+ useEffect: optional(array(string2())),
1305
+ useFormStatus: optional(array(string2())),
1306
+ useId: optional(array(string2())),
1307
+ useImperativeHandle: optional(array(string2())),
1308
+ useInsertionEffect: optional(array(string2())),
1309
+ useLayoutEffect: optional(array(string2())),
1310
+ useMemo: optional(array(string2())),
1311
+ useOptimistic: optional(array(string2())),
1312
+ useReducer: optional(array(string2())),
1313
+ useRef: optional(array(string2())),
1314
+ useState: optional(array(string2())),
1315
+ useSyncExternalStore: optional(array(string2())),
1316
+ useTransition: optional(array(string2()))
425
1317
  });
426
1318
  var ESLintReactSettingsSchema = object({
427
1319
  /**
@@ -430,43 +1322,43 @@ var ESLintReactSettingsSchema = object({
430
1322
  * @default `"react"`
431
1323
  * @example `"@pika/react"`
432
1324
  */
433
- importSource: optional(string()),
1325
+ importSource: optional(string2()),
434
1326
  /**
435
1327
  * The identifier that's used for JSX Element creation.
436
1328
  * @default `"createElement"`
437
1329
  * @deprecated
438
1330
  */
439
- jsxPragma: optional(string()),
1331
+ jsxPragma: optional(string2()),
440
1332
  /**
441
1333
  * The identifier that's used for JSX fragment elements.
442
1334
  * @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
443
1335
  * @default `"Fragment"`
444
1336
  * @deprecated
445
1337
  */
446
- jsxPragmaFrag: optional(string()),
1338
+ jsxPragmaFrag: optional(string2()),
447
1339
  /**
448
1340
  * The name of the prop that is used for polymorphic components.
449
1341
  * @description This is used to determine the type of the component.
450
1342
  * @example `"as"`
451
1343
  */
452
- polymorphicPropName: optional(string()),
1344
+ polymorphicPropName: optional(string2()),
453
1345
  /**
454
1346
  * @internal
455
1347
  */
456
- strict: optional(boolean(), false),
1348
+ strict: optional(boolean2()),
457
1349
  /**
458
1350
  * Check both the shape and the import to determine if an API is from React.
459
1351
  * @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
460
1352
  * @default `true`
461
1353
  */
462
- skipImportCheck: optional(boolean(), true),
1354
+ skipImportCheck: optional(boolean2()),
463
1355
  /**
464
1356
  * React version to use, "detect" means auto detect React version from the project's dependencies.
465
1357
  * If `importSource` is specified, an equivalent version of React should be provided here.
466
1358
  * @example `"18.3.1"`
467
1359
  * @default `"detect"`
468
1360
  */
469
- version: optional(string()),
1361
+ version: optional(string2()),
470
1362
  /**
471
1363
  * A object to define additional hooks that are equivalent to the built-in React Hooks.
472
1364
  * @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
@@ -480,8 +1372,16 @@ var ESLintReactSettingsSchema = object({
480
1372
  */
481
1373
  additionalComponents: optional(array(CustomComponentSchema))
482
1374
  });
1375
+ optional(
1376
+ object({
1377
+ "react-x": optional(ESLintReactSettingsSchema),
1378
+ /** @deprecated Use `react-x` instead */
1379
+ reactOptions: optional(ESLintReactSettingsSchema)
1380
+ }),
1381
+ {}
1382
+ );
483
1383
  var DEFAULT_ESLINT_REACT_SETTINGS = {
484
- ...parse(ESLintReactSettingsSchema, {}),
1384
+ ...parse2(ESLintReactSettingsSchema, {}),
485
1385
  importSource: "react"};
486
1386
  function getInstanceId(node, prev) {
487
1387
  switch (true) {