@connectedxm/zpl-generator 0.0.2-beta.3 → 0.0.2-beta.7

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/dist/index.es.js CHANGED
@@ -1,48 +1,48 @@
1
1
  var v;
2
2
  (function(n) {
3
- n.assertEqual = (s) => {
3
+ n.assertEqual = (r) => {
4
4
  };
5
- function e(s) {
5
+ function e(r) {
6
6
  }
7
7
  n.assertIs = e;
8
- function t(s) {
8
+ function t(r) {
9
9
  throw new Error();
10
10
  }
11
- n.assertNever = t, n.arrayToEnum = (s) => {
11
+ n.assertNever = t, n.arrayToEnum = (r) => {
12
12
  const a = {};
13
- for (const i of s)
13
+ for (const i of r)
14
14
  a[i] = i;
15
15
  return a;
16
- }, n.getValidEnumValues = (s) => {
17
- const a = n.objectKeys(s).filter((o) => typeof s[s[o]] != "number"), i = {};
16
+ }, n.getValidEnumValues = (r) => {
17
+ const a = n.objectKeys(r).filter((o) => typeof r[r[o]] != "number"), i = {};
18
18
  for (const o of a)
19
- i[o] = s[o];
19
+ i[o] = r[o];
20
20
  return n.objectValues(i);
21
- }, n.objectValues = (s) => n.objectKeys(s).map(function(a) {
22
- return s[a];
23
- }), n.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
21
+ }, n.objectValues = (r) => n.objectKeys(r).map(function(a) {
22
+ return r[a];
23
+ }), n.objectKeys = typeof Object.keys == "function" ? (r) => Object.keys(r) : (r) => {
24
24
  const a = [];
25
- for (const i in s)
26
- Object.prototype.hasOwnProperty.call(s, i) && a.push(i);
25
+ for (const i in r)
26
+ Object.prototype.hasOwnProperty.call(r, i) && a.push(i);
27
27
  return a;
28
- }, n.find = (s, a) => {
29
- for (const i of s)
28
+ }, n.find = (r, a) => {
29
+ for (const i of r)
30
30
  if (a(i))
31
31
  return i;
32
- }, n.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && Number.isFinite(s) && Math.floor(s) === s;
33
- function r(s, a = " | ") {
34
- return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
32
+ }, n.isInteger = typeof Number.isInteger == "function" ? (r) => Number.isInteger(r) : (r) => typeof r == "number" && Number.isFinite(r) && Math.floor(r) === r;
33
+ function s(r, a = " | ") {
34
+ return r.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
35
35
  }
36
- n.joinValues = r, n.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
36
+ n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
37
37
  })(v || (v = {}));
38
- var pe;
38
+ var ge;
39
39
  (function(n) {
40
40
  n.mergeShapes = (e, t) => ({
41
41
  ...e,
42
42
  ...t
43
43
  // second overwrites first
44
44
  });
45
- })(pe || (pe = {}));
45
+ })(ge || (ge = {}));
46
46
  const u = v.arrayToEnum([
47
47
  "string",
48
48
  "nan",
@@ -85,7 +85,7 @@ const u = v.arrayToEnum([
85
85
  default:
86
86
  return u.unknown;
87
87
  }
88
- }, d = v.arrayToEnum([
88
+ }, c = v.arrayToEnum([
89
89
  "invalid_type",
90
90
  "invalid_literal",
91
91
  "custom",
@@ -108,10 +108,10 @@ class O extends Error {
108
108
  return this.issues;
109
109
  }
110
110
  constructor(e) {
111
- super(), this.issues = [], this.addIssue = (r) => {
112
- this.issues = [...this.issues, r];
113
- }, this.addIssues = (r = []) => {
114
- this.issues = [...this.issues, ...r];
111
+ super(), this.issues = [], this.addIssue = (s) => {
112
+ this.issues = [...this.issues, s];
113
+ }, this.addIssues = (s = []) => {
114
+ this.issues = [...this.issues, ...s];
115
115
  };
116
116
  const t = new.target.prototype;
117
117
  Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
@@ -119,25 +119,25 @@ class O extends Error {
119
119
  format(e) {
120
120
  const t = e || function(a) {
121
121
  return a.message;
122
- }, r = { _errors: [] }, s = (a) => {
122
+ }, s = { _errors: [] }, r = (a) => {
123
123
  for (const i of a.issues)
124
124
  if (i.code === "invalid_union")
125
- i.unionErrors.map(s);
125
+ i.unionErrors.map(r);
126
126
  else if (i.code === "invalid_return_type")
127
- s(i.returnTypeError);
127
+ r(i.returnTypeError);
128
128
  else if (i.code === "invalid_arguments")
129
- s(i.argumentsError);
129
+ r(i.argumentsError);
130
130
  else if (i.path.length === 0)
131
- r._errors.push(t(i));
131
+ s._errors.push(t(i));
132
132
  else {
133
- let o = r, f = 0;
133
+ let o = s, f = 0;
134
134
  for (; f < i.path.length; ) {
135
135
  const h = i.path[f];
136
136
  f === i.path.length - 1 ? (o[h] = o[h] || { _errors: [] }, o[h]._errors.push(t(i))) : o[h] = o[h] || { _errors: [] }, o = o[h], f++;
137
137
  }
138
138
  }
139
139
  };
140
- return s(this), r;
140
+ return r(this), s;
141
141
  }
142
142
  static assert(e) {
143
143
  if (!(e instanceof O))
@@ -153,14 +153,14 @@ class O extends Error {
153
153
  return this.issues.length === 0;
154
154
  }
155
155
  flatten(e = (t) => t.message) {
156
- const t = {}, r = [];
157
- for (const s of this.issues)
158
- if (s.path.length > 0) {
159
- const a = s.path[0];
160
- t[a] = t[a] || [], t[a].push(e(s));
156
+ const t = {}, s = [];
157
+ for (const r of this.issues)
158
+ if (r.path.length > 0) {
159
+ const a = r.path[0];
160
+ t[a] = t[a] || [], t[a].push(e(r));
161
161
  } else
162
- r.push(e(s));
163
- return { formErrors: r, fieldErrors: t };
162
+ s.push(e(r));
163
+ return { formErrors: s, fieldErrors: t };
164
164
  }
165
165
  get formErrors() {
166
166
  return this.flatten();
@@ -170,52 +170,52 @@ O.create = (n) => new O(n);
170
170
  const ae = (n, e) => {
171
171
  let t;
172
172
  switch (n.code) {
173
- case d.invalid_type:
173
+ case c.invalid_type:
174
174
  n.received === u.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
175
175
  break;
176
- case d.invalid_literal:
176
+ case c.invalid_literal:
177
177
  t = `Invalid literal value, expected ${JSON.stringify(n.expected, v.jsonStringifyReplacer)}`;
178
178
  break;
179
- case d.unrecognized_keys:
179
+ case c.unrecognized_keys:
180
180
  t = `Unrecognized key(s) in object: ${v.joinValues(n.keys, ", ")}`;
181
181
  break;
182
- case d.invalid_union:
182
+ case c.invalid_union:
183
183
  t = "Invalid input";
184
184
  break;
185
- case d.invalid_union_discriminator:
185
+ case c.invalid_union_discriminator:
186
186
  t = `Invalid discriminator value. Expected ${v.joinValues(n.options)}`;
187
187
  break;
188
- case d.invalid_enum_value:
188
+ case c.invalid_enum_value:
189
189
  t = `Invalid enum value. Expected ${v.joinValues(n.options)}, received '${n.received}'`;
190
190
  break;
191
- case d.invalid_arguments:
191
+ case c.invalid_arguments:
192
192
  t = "Invalid function arguments";
193
193
  break;
194
- case d.invalid_return_type:
194
+ case c.invalid_return_type:
195
195
  t = "Invalid function return type";
196
196
  break;
197
- case d.invalid_date:
197
+ case c.invalid_date:
198
198
  t = "Invalid date";
199
199
  break;
200
- case d.invalid_string:
200
+ case c.invalid_string:
201
201
  typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` : v.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
202
202
  break;
203
- case d.too_small:
203
+ case c.too_small:
204
204
  n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "more than"} ${n.minimum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "over"} ${n.minimum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "bigint" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(n.minimum))}` : t = "Invalid input";
205
205
  break;
206
- case d.too_big:
206
+ case c.too_big:
207
207
  n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "less than"} ${n.maximum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "under"} ${n.maximum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "bigint" ? t = `BigInt must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly" : n.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(n.maximum))}` : t = "Invalid input";
208
208
  break;
209
- case d.custom:
209
+ case c.custom:
210
210
  t = "Invalid input";
211
211
  break;
212
- case d.invalid_intersection_types:
212
+ case c.invalid_intersection_types:
213
213
  t = "Intersection results could not be merged";
214
214
  break;
215
- case d.not_multiple_of:
215
+ case c.not_multiple_of:
216
216
  t = `Number must be a multiple of ${n.multipleOf}`;
217
217
  break;
218
- case d.not_finite:
218
+ case c.not_finite:
219
219
  t = "Number must be finite";
220
220
  break;
221
221
  default:
@@ -228,28 +228,28 @@ function Ie() {
228
228
  return Ee;
229
229
  }
230
230
  const Me = (n) => {
231
- const { data: e, path: t, errorMaps: r, issueData: s } = n, a = [...t, ...s.path || []], i = {
232
- ...s,
231
+ const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], i = {
232
+ ...r,
233
233
  path: a
234
234
  };
235
- if (s.message !== void 0)
235
+ if (r.message !== void 0)
236
236
  return {
237
- ...s,
237
+ ...r,
238
238
  path: a,
239
- message: s.message
239
+ message: r.message
240
240
  };
241
241
  let o = "";
242
- const f = r.filter((h) => !!h).slice().reverse();
242
+ const f = s.filter((h) => !!h).slice().reverse();
243
243
  for (const h of f)
244
244
  o = h(i, { data: e, defaultError: o }).message;
245
245
  return {
246
- ...s,
246
+ ...r,
247
247
  path: a,
248
248
  message: o
249
249
  };
250
250
  };
251
- function c(n, e) {
252
- const t = Ie(), r = Me({
251
+ function d(n, e) {
252
+ const t = Ie(), s = Me({
253
253
  issueData: e,
254
254
  data: n.data,
255
255
  path: n.path,
@@ -262,9 +262,9 @@ function c(n, e) {
262
262
  // then global override map
263
263
  t === ae ? void 0 : ae
264
264
  // then global default map
265
- ].filter((s) => !!s)
265
+ ].filter((r) => !!r)
266
266
  });
267
- n.common.issues.push(r);
267
+ n.common.issues.push(s);
268
268
  }
269
269
  class w {
270
270
  constructor() {
@@ -277,52 +277,52 @@ class w {
277
277
  this.value !== "aborted" && (this.value = "aborted");
278
278
  }
279
279
  static mergeArray(e, t) {
280
- const r = [];
281
- for (const s of t) {
282
- if (s.status === "aborted")
280
+ const s = [];
281
+ for (const r of t) {
282
+ if (r.status === "aborted")
283
283
  return m;
284
- s.status === "dirty" && e.dirty(), r.push(s.value);
284
+ r.status === "dirty" && e.dirty(), s.push(r.value);
285
285
  }
286
- return { status: e.value, value: r };
286
+ return { status: e.value, value: s };
287
287
  }
288
288
  static async mergeObjectAsync(e, t) {
289
- const r = [];
290
- for (const s of t) {
291
- const a = await s.key, i = await s.value;
292
- r.push({
289
+ const s = [];
290
+ for (const r of t) {
291
+ const a = await r.key, i = await r.value;
292
+ s.push({
293
293
  key: a,
294
294
  value: i
295
295
  });
296
296
  }
297
- return w.mergeObjectSync(e, r);
297
+ return w.mergeObjectSync(e, s);
298
298
  }
299
299
  static mergeObjectSync(e, t) {
300
- const r = {};
301
- for (const s of t) {
302
- const { key: a, value: i } = s;
300
+ const s = {};
301
+ for (const r of t) {
302
+ const { key: a, value: i } = r;
303
303
  if (a.status === "aborted" || i.status === "aborted")
304
304
  return m;
305
- a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || s.alwaysSet) && (r[a.value] = i.value);
305
+ a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || r.alwaysSet) && (s[a.value] = i.value);
306
306
  }
307
- return { status: e.value, value: r };
307
+ return { status: e.value, value: s };
308
308
  }
309
309
  }
310
310
  const m = Object.freeze({
311
311
  status: "aborted"
312
- }), W = (n) => ({ status: "dirty", value: n }), S = (n) => ({ status: "valid", value: n }), ge = (n) => n.status === "aborted", ye = (n) => n.status === "dirty", D = (n) => n.status === "valid", U = (n) => typeof Promise < "u" && n instanceof Promise;
312
+ }), W = (n) => ({ status: "dirty", value: n }), T = (n) => ({ status: "valid", value: n }), ye = (n) => n.status === "aborted", _e = (n) => n.status === "dirty", D = (n) => n.status === "valid", q = (n) => typeof Promise < "u" && n instanceof Promise;
313
313
  var l;
314
314
  (function(n) {
315
315
  n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e?.message;
316
316
  })(l || (l = {}));
317
317
  class Z {
318
- constructor(e, t, r, s) {
319
- this._cachedPath = [], this.parent = e, this.data = t, this._path = r, this._key = s;
318
+ constructor(e, t, s, r) {
319
+ this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
320
320
  }
321
321
  get path() {
322
322
  return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
323
323
  }
324
324
  }
325
- const _e = (n, e) => {
325
+ const ve = (n, e) => {
326
326
  if (D(e))
327
327
  return { success: !0, data: e.value };
328
328
  if (!n.common.issues.length)
@@ -340,13 +340,13 @@ const _e = (n, e) => {
340
340
  function g(n) {
341
341
  if (!n)
342
342
  return {};
343
- const { errorMap: e, invalid_type_error: t, required_error: r, description: s } = n;
344
- if (e && (t || r))
343
+ const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
344
+ if (e && (t || s))
345
345
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
346
- return e ? { errorMap: e, description: s } : { errorMap: (i, o) => {
346
+ return e ? { errorMap: e, description: r } : { errorMap: (i, o) => {
347
347
  const { message: f } = n;
348
- return i.code === "invalid_enum_value" ? { message: f ?? o.defaultError } : typeof o.data > "u" ? { message: f ?? r ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: f ?? t ?? o.defaultError };
349
- }, description: s };
348
+ return i.code === "invalid_enum_value" ? { message: f ?? o.defaultError } : typeof o.data > "u" ? { message: f ?? s ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: f ?? t ?? o.defaultError };
349
+ }, description: r };
350
350
  }
351
351
  class _ {
352
352
  get description() {
@@ -380,7 +380,7 @@ class _ {
380
380
  }
381
381
  _parseSync(e) {
382
382
  const t = this._parse(e);
383
- if (U(t))
383
+ if (q(t))
384
384
  throw new Error("Synchronous parse encountered promise.");
385
385
  return t;
386
386
  }
@@ -389,13 +389,13 @@ class _ {
389
389
  return Promise.resolve(t);
390
390
  }
391
391
  parse(e, t) {
392
- const r = this.safeParse(e, t);
393
- if (r.success)
394
- return r.data;
395
- throw r.error;
392
+ const s = this.safeParse(e, t);
393
+ if (s.success)
394
+ return s.data;
395
+ throw s.error;
396
396
  }
397
397
  safeParse(e, t) {
398
- const r = {
398
+ const s = {
399
399
  common: {
400
400
  issues: [],
401
401
  async: t?.async ?? !1,
@@ -406,8 +406,8 @@ class _ {
406
406
  parent: null,
407
407
  data: e,
408
408
  parsedType: $(e)
409
- }, s = this._parseSync({ data: e, path: r.path, parent: r });
410
- return _e(r, s);
409
+ }, r = this._parseSync({ data: e, path: s.path, parent: s });
410
+ return ve(s, r);
411
411
  }
412
412
  "~validate"(e) {
413
413
  const t = {
@@ -423,32 +423,32 @@ class _ {
423
423
  };
424
424
  if (!this["~standard"].async)
425
425
  try {
426
- const r = this._parseSync({ data: e, path: [], parent: t });
427
- return D(r) ? {
428
- value: r.value
426
+ const s = this._parseSync({ data: e, path: [], parent: t });
427
+ return D(s) ? {
428
+ value: s.value
429
429
  } : {
430
430
  issues: t.common.issues
431
431
  };
432
- } catch (r) {
433
- r?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
432
+ } catch (s) {
433
+ s?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
434
434
  issues: [],
435
435
  async: !0
436
436
  };
437
437
  }
438
- return this._parseAsync({ data: e, path: [], parent: t }).then((r) => D(r) ? {
439
- value: r.value
438
+ return this._parseAsync({ data: e, path: [], parent: t }).then((s) => D(s) ? {
439
+ value: s.value
440
440
  } : {
441
441
  issues: t.common.issues
442
442
  });
443
443
  }
444
444
  async parseAsync(e, t) {
445
- const r = await this.safeParseAsync(e, t);
446
- if (r.success)
447
- return r.data;
448
- throw r.error;
445
+ const s = await this.safeParseAsync(e, t);
446
+ if (s.success)
447
+ return s.data;
448
+ throw s.error;
449
449
  }
450
450
  async safeParseAsync(e, t) {
451
- const r = {
451
+ const s = {
452
452
  common: {
453
453
  issues: [],
454
454
  contextualErrorMap: t?.errorMap,
@@ -459,21 +459,21 @@ class _ {
459
459
  parent: null,
460
460
  data: e,
461
461
  parsedType: $(e)
462
- }, s = this._parse({ data: e, path: r.path, parent: r }), a = await (U(s) ? s : Promise.resolve(s));
463
- return _e(r, a);
462
+ }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (q(r) ? r : Promise.resolve(r));
463
+ return ve(s, a);
464
464
  }
465
465
  refine(e, t) {
466
- const r = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
467
- return this._refinement((s, a) => {
468
- const i = e(s), o = () => a.addIssue({
469
- code: d.custom,
470
- ...r(s)
466
+ const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
467
+ return this._refinement((r, a) => {
468
+ const i = e(r), o = () => a.addIssue({
469
+ code: c.custom,
470
+ ...s(r)
471
471
  });
472
472
  return typeof Promise < "u" && i instanceof Promise ? i.then((f) => f ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
473
473
  });
474
474
  }
475
475
  refinement(e, t) {
476
- return this._refinement((r, s) => e(r) ? !0 : (s.addIssue(typeof t == "function" ? t(r, s) : t), !1));
476
+ return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof t == "function" ? t(s, r) : t), !1));
477
477
  }
478
478
  _refinement(e) {
479
479
  return new M({
@@ -502,16 +502,16 @@ class _ {
502
502
  return this.nullable().optional();
503
503
  }
504
504
  array() {
505
- return T.create(this);
505
+ return S.create(this);
506
506
  }
507
507
  promise() {
508
- return X.create(this, this._def);
508
+ return G.create(this, this._def);
509
509
  }
510
510
  or(e) {
511
- return H.create([this, e], this._def);
511
+ return Y.create([this, e], this._def);
512
512
  }
513
513
  and(e) {
514
- return Y.create(this, e, this._def);
514
+ return J.create(this, e, this._def);
515
515
  }
516
516
  transform(e) {
517
517
  return new M({
@@ -523,7 +523,7 @@ class _ {
523
523
  }
524
524
  default(e) {
525
525
  const t = typeof e == "function" ? e : () => e;
526
- return new G({
526
+ return new K({
527
527
  ...g(this._def),
528
528
  innerType: this,
529
529
  defaultValue: t,
@@ -539,7 +539,7 @@ class _ {
539
539
  }
540
540
  catch(e) {
541
541
  const t = typeof e == "function" ? e : () => e;
542
- return new K({
542
+ return new ee({
543
543
  ...g(this._def),
544
544
  innerType: this,
545
545
  catchValue: t,
@@ -554,10 +554,10 @@ class _ {
554
554
  });
555
555
  }
556
556
  pipe(e) {
557
- return le.create(this, e);
557
+ return he.create(this, e);
558
558
  }
559
559
  readonly() {
560
- return ee.create(this);
560
+ return te.create(this);
561
561
  }
562
562
  isOptional() {
563
563
  return this.safeParse(void 0).success;
@@ -567,19 +567,19 @@ class _ {
567
567
  }
568
568
  }
569
569
  const Le = /^c[^\s-]{8,}$/i, Pe = /^[0-9a-z]+$/, Ve = /^[0-9A-HJKMNP-TV-Z]{26}$/i, De = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Be = /^[a-z0-9_-]{21}$/i, We = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ze = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Fe = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ue = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
570
- let re;
571
- const qe = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, He = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ye = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Je = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Qe = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Xe = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ce = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ge = new RegExp(`^${Ce}$`);
572
- function Ae(n) {
570
+ let se;
571
+ const qe = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, He = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ye = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Je = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Qe = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Xe = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ae = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ge = new RegExp(`^${Ae}$`);
572
+ function Ce(n) {
573
573
  let e = "[0-5]\\d";
574
574
  n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
575
575
  const t = n.precision ? "+" : "?";
576
576
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
577
577
  }
578
578
  function Ke(n) {
579
- return new RegExp(`^${Ae(n)}$`);
579
+ return new RegExp(`^${Ce(n)}$`);
580
580
  }
581
581
  function et(n) {
582
- let e = `${Ce}T${Ae(n)}`;
582
+ let e = `${Ae}T${Ce(n)}`;
583
583
  const t = [];
584
584
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
585
585
  }
@@ -593,175 +593,175 @@ function nt(n, e) {
593
593
  const [t] = n.split(".");
594
594
  if (!t)
595
595
  return !1;
596
- const r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(r));
597
- return !(typeof s != "object" || s === null || "typ" in s && s?.typ !== "JWT" || !s.alg || e && s.alg !== e);
596
+ const s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), r = JSON.parse(atob(s));
597
+ return !(typeof r != "object" || r === null || "typ" in r && r?.typ !== "JWT" || !r.alg || e && r.alg !== e);
598
598
  } catch {
599
599
  return !1;
600
600
  }
601
601
  }
602
- function rt(n, e) {
602
+ function st(n, e) {
603
603
  return !!((e === "v4" || !e) && He.test(n) || (e === "v6" || !e) && Je.test(n));
604
604
  }
605
605
  class R extends _ {
606
606
  _parse(e) {
607
607
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== u.string) {
608
608
  const a = this._getOrReturnCtx(e);
609
- return c(a, {
610
- code: d.invalid_type,
609
+ return d(a, {
610
+ code: c.invalid_type,
611
611
  expected: u.string,
612
612
  received: a.parsedType
613
613
  }), m;
614
614
  }
615
- const r = new w();
616
- let s;
615
+ const s = new w();
616
+ let r;
617
617
  for (const a of this._def.checks)
618
618
  if (a.kind === "min")
619
- e.data.length < a.value && (s = this._getOrReturnCtx(e, s), c(s, {
620
- code: d.too_small,
619
+ e.data.length < a.value && (r = this._getOrReturnCtx(e, r), d(r, {
620
+ code: c.too_small,
621
621
  minimum: a.value,
622
622
  type: "string",
623
623
  inclusive: !0,
624
624
  exact: !1,
625
625
  message: a.message
626
- }), r.dirty());
626
+ }), s.dirty());
627
627
  else if (a.kind === "max")
628
- e.data.length > a.value && (s = this._getOrReturnCtx(e, s), c(s, {
629
- code: d.too_big,
628
+ e.data.length > a.value && (r = this._getOrReturnCtx(e, r), d(r, {
629
+ code: c.too_big,
630
630
  maximum: a.value,
631
631
  type: "string",
632
632
  inclusive: !0,
633
633
  exact: !1,
634
634
  message: a.message
635
- }), r.dirty());
635
+ }), s.dirty());
636
636
  else if (a.kind === "length") {
637
637
  const i = e.data.length > a.value, o = e.data.length < a.value;
638
- (i || o) && (s = this._getOrReturnCtx(e, s), i ? c(s, {
639
- code: d.too_big,
638
+ (i || o) && (r = this._getOrReturnCtx(e, r), i ? d(r, {
639
+ code: c.too_big,
640
640
  maximum: a.value,
641
641
  type: "string",
642
642
  inclusive: !0,
643
643
  exact: !0,
644
644
  message: a.message
645
- }) : o && c(s, {
646
- code: d.too_small,
645
+ }) : o && d(r, {
646
+ code: c.too_small,
647
647
  minimum: a.value,
648
648
  type: "string",
649
649
  inclusive: !0,
650
650
  exact: !0,
651
651
  message: a.message
652
- }), r.dirty());
652
+ }), s.dirty());
653
653
  } else if (a.kind === "email")
654
- Fe.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
654
+ Fe.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
655
655
  validation: "email",
656
- code: d.invalid_string,
656
+ code: c.invalid_string,
657
657
  message: a.message
658
- }), r.dirty());
658
+ }), s.dirty());
659
659
  else if (a.kind === "emoji")
660
- re || (re = new RegExp(Ue, "u")), re.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
660
+ se || (se = new RegExp(Ue, "u")), se.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
661
661
  validation: "emoji",
662
- code: d.invalid_string,
662
+ code: c.invalid_string,
663
663
  message: a.message
664
- }), r.dirty());
664
+ }), s.dirty());
665
665
  else if (a.kind === "uuid")
666
- De.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
666
+ De.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
667
667
  validation: "uuid",
668
- code: d.invalid_string,
668
+ code: c.invalid_string,
669
669
  message: a.message
670
- }), r.dirty());
670
+ }), s.dirty());
671
671
  else if (a.kind === "nanoid")
672
- Be.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
672
+ Be.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
673
673
  validation: "nanoid",
674
- code: d.invalid_string,
674
+ code: c.invalid_string,
675
675
  message: a.message
676
- }), r.dirty());
676
+ }), s.dirty());
677
677
  else if (a.kind === "cuid")
678
- Le.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
678
+ Le.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
679
679
  validation: "cuid",
680
- code: d.invalid_string,
680
+ code: c.invalid_string,
681
681
  message: a.message
682
- }), r.dirty());
682
+ }), s.dirty());
683
683
  else if (a.kind === "cuid2")
684
- Pe.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
684
+ Pe.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
685
685
  validation: "cuid2",
686
- code: d.invalid_string,
686
+ code: c.invalid_string,
687
687
  message: a.message
688
- }), r.dirty());
688
+ }), s.dirty());
689
689
  else if (a.kind === "ulid")
690
- Ve.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
690
+ Ve.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
691
691
  validation: "ulid",
692
- code: d.invalid_string,
692
+ code: c.invalid_string,
693
693
  message: a.message
694
- }), r.dirty());
694
+ }), s.dirty());
695
695
  else if (a.kind === "url")
696
696
  try {
697
697
  new URL(e.data);
698
698
  } catch {
699
- s = this._getOrReturnCtx(e, s), c(s, {
699
+ r = this._getOrReturnCtx(e, r), d(r, {
700
700
  validation: "url",
701
- code: d.invalid_string,
701
+ code: c.invalid_string,
702
702
  message: a.message
703
- }), r.dirty();
703
+ }), s.dirty();
704
704
  }
705
- else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
705
+ else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
706
706
  validation: "regex",
707
- code: d.invalid_string,
707
+ code: c.invalid_string,
708
708
  message: a.message
709
- }), r.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (s = this._getOrReturnCtx(e, s), c(s, {
710
- code: d.invalid_string,
709
+ }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (r = this._getOrReturnCtx(e, r), d(r, {
710
+ code: c.invalid_string,
711
711
  validation: { includes: a.value, position: a.position },
712
712
  message: a.message
713
- }), r.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (s = this._getOrReturnCtx(e, s), c(s, {
714
- code: d.invalid_string,
713
+ }), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (r = this._getOrReturnCtx(e, r), d(r, {
714
+ code: c.invalid_string,
715
715
  validation: { startsWith: a.value },
716
716
  message: a.message
717
- }), r.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), c(s, {
718
- code: d.invalid_string,
717
+ }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (r = this._getOrReturnCtx(e, r), d(r, {
718
+ code: c.invalid_string,
719
719
  validation: { endsWith: a.value },
720
720
  message: a.message
721
- }), r.dirty()) : a.kind === "datetime" ? et(a).test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
722
- code: d.invalid_string,
721
+ }), s.dirty()) : a.kind === "datetime" ? et(a).test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
722
+ code: c.invalid_string,
723
723
  validation: "datetime",
724
724
  message: a.message
725
- }), r.dirty()) : a.kind === "date" ? Ge.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
726
- code: d.invalid_string,
725
+ }), s.dirty()) : a.kind === "date" ? Ge.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
726
+ code: c.invalid_string,
727
727
  validation: "date",
728
728
  message: a.message
729
- }), r.dirty()) : a.kind === "time" ? Ke(a).test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
730
- code: d.invalid_string,
729
+ }), s.dirty()) : a.kind === "time" ? Ke(a).test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
730
+ code: c.invalid_string,
731
731
  validation: "time",
732
732
  message: a.message
733
- }), r.dirty()) : a.kind === "duration" ? ze.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
733
+ }), s.dirty()) : a.kind === "duration" ? ze.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
734
734
  validation: "duration",
735
- code: d.invalid_string,
735
+ code: c.invalid_string,
736
736
  message: a.message
737
- }), r.dirty()) : a.kind === "ip" ? tt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), c(s, {
737
+ }), s.dirty()) : a.kind === "ip" ? tt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), d(r, {
738
738
  validation: "ip",
739
- code: d.invalid_string,
739
+ code: c.invalid_string,
740
740
  message: a.message
741
- }), r.dirty()) : a.kind === "jwt" ? nt(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), c(s, {
741
+ }), s.dirty()) : a.kind === "jwt" ? nt(e.data, a.alg) || (r = this._getOrReturnCtx(e, r), d(r, {
742
742
  validation: "jwt",
743
- code: d.invalid_string,
743
+ code: c.invalid_string,
744
744
  message: a.message
745
- }), r.dirty()) : a.kind === "cidr" ? rt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), c(s, {
745
+ }), s.dirty()) : a.kind === "cidr" ? st(e.data, a.version) || (r = this._getOrReturnCtx(e, r), d(r, {
746
746
  validation: "cidr",
747
- code: d.invalid_string,
747
+ code: c.invalid_string,
748
748
  message: a.message
749
- }), r.dirty()) : a.kind === "base64" ? Qe.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
749
+ }), s.dirty()) : a.kind === "base64" ? Qe.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
750
750
  validation: "base64",
751
- code: d.invalid_string,
751
+ code: c.invalid_string,
752
752
  message: a.message
753
- }), r.dirty()) : a.kind === "base64url" ? Xe.test(e.data) || (s = this._getOrReturnCtx(e, s), c(s, {
753
+ }), s.dirty()) : a.kind === "base64url" ? Xe.test(e.data) || (r = this._getOrReturnCtx(e, r), d(r, {
754
754
  validation: "base64url",
755
- code: d.invalid_string,
755
+ code: c.invalid_string,
756
756
  message: a.message
757
- }), r.dirty()) : v.assertNever(a);
758
- return { status: r.value, value: e.data };
757
+ }), s.dirty()) : v.assertNever(a);
758
+ return { status: s.value, value: e.data };
759
759
  }
760
- _regex(e, t, r) {
761
- return this.refinement((s) => e.test(s), {
760
+ _regex(e, t, s) {
761
+ return this.refinement((r) => e.test(r), {
762
762
  validation: t,
763
- code: d.invalid_string,
764
- ...l.errToObj(r)
763
+ code: c.invalid_string,
764
+ ...l.errToObj(s)
765
765
  });
766
766
  }
767
767
  _addCheck(e) {
@@ -985,9 +985,9 @@ R.create = (n) => new R({
985
985
  coerce: n?.coerce ?? !1,
986
986
  ...g(n)
987
987
  });
988
- function st(n, e) {
989
- const t = (n.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = t > r ? t : r, a = Number.parseInt(n.toFixed(s).replace(".", "")), i = Number.parseInt(e.toFixed(s).replace(".", ""));
990
- return a % i / 10 ** s;
988
+ function rt(n, e) {
989
+ const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = Number.parseInt(n.toFixed(r).replace(".", "")), i = Number.parseInt(e.toFixed(r).replace(".", ""));
990
+ return a % i / 10 ** r;
991
991
  }
992
992
  class B extends _ {
993
993
  constructor() {
@@ -996,43 +996,43 @@ class B extends _ {
996
996
  _parse(e) {
997
997
  if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== u.number) {
998
998
  const a = this._getOrReturnCtx(e);
999
- return c(a, {
1000
- code: d.invalid_type,
999
+ return d(a, {
1000
+ code: c.invalid_type,
1001
1001
  expected: u.number,
1002
1002
  received: a.parsedType
1003
1003
  }), m;
1004
1004
  }
1005
- let r;
1006
- const s = new w();
1005
+ let s;
1006
+ const r = new w();
1007
1007
  for (const a of this._def.checks)
1008
- a.kind === "int" ? v.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
1009
- code: d.invalid_type,
1008
+ a.kind === "int" ? v.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
1009
+ code: c.invalid_type,
1010
1010
  expected: "integer",
1011
1011
  received: "float",
1012
1012
  message: a.message
1013
- }), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1014
- code: d.too_small,
1013
+ }), r.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), d(s, {
1014
+ code: c.too_small,
1015
1015
  minimum: a.value,
1016
1016
  type: "number",
1017
1017
  inclusive: a.inclusive,
1018
1018
  exact: !1,
1019
1019
  message: a.message
1020
- }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1021
- code: d.too_big,
1020
+ }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), d(s, {
1021
+ code: c.too_big,
1022
1022
  maximum: a.value,
1023
1023
  type: "number",
1024
1024
  inclusive: a.inclusive,
1025
1025
  exact: !1,
1026
1026
  message: a.message
1027
- }), s.dirty()) : a.kind === "multipleOf" ? st(e.data, a.value) !== 0 && (r = this._getOrReturnCtx(e, r), c(r, {
1028
- code: d.not_multiple_of,
1027
+ }), r.dirty()) : a.kind === "multipleOf" ? rt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), d(s, {
1028
+ code: c.not_multiple_of,
1029
1029
  multipleOf: a.value,
1030
1030
  message: a.message
1031
- }), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
1032
- code: d.not_finite,
1031
+ }), r.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
1032
+ code: c.not_finite,
1033
1033
  message: a.message
1034
- }), s.dirty()) : v.assertNever(a);
1035
- return { status: s.value, value: e.data };
1034
+ }), r.dirty()) : v.assertNever(a);
1035
+ return { status: r.value, value: e.data };
1036
1036
  }
1037
1037
  gte(e, t) {
1038
1038
  return this.setLimit("min", e, !0, l.toString(t));
@@ -1046,7 +1046,7 @@ class B extends _ {
1046
1046
  lt(e, t) {
1047
1047
  return this.setLimit("max", e, !1, l.toString(t));
1048
1048
  }
1049
- setLimit(e, t, r, s) {
1049
+ setLimit(e, t, s, r) {
1050
1050
  return new B({
1051
1051
  ...this._def,
1052
1052
  checks: [
@@ -1054,8 +1054,8 @@ class B extends _ {
1054
1054
  {
1055
1055
  kind: e,
1056
1056
  value: t,
1057
- inclusive: r,
1058
- message: l.toString(s)
1057
+ inclusive: s,
1058
+ message: l.toString(r)
1059
1059
  }
1060
1060
  ]
1061
1061
  });
@@ -1147,10 +1147,10 @@ class B extends _ {
1147
1147
  }
1148
1148
  get isFinite() {
1149
1149
  let e = null, t = null;
1150
- for (const r of this._def.checks) {
1151
- if (r.kind === "finite" || r.kind === "int" || r.kind === "multipleOf")
1150
+ for (const s of this._def.checks) {
1151
+ if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
1152
1152
  return !0;
1153
- r.kind === "min" ? (t === null || r.value > t) && (t = r.value) : r.kind === "max" && (e === null || r.value < e) && (e = r.value);
1153
+ s.kind === "min" ? (t === null || s.value > t) && (t = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1154
1154
  }
1155
1155
  return Number.isFinite(t) && Number.isFinite(e);
1156
1156
  }
@@ -1161,7 +1161,7 @@ B.create = (n) => new B({
1161
1161
  coerce: n?.coerce || !1,
1162
1162
  ...g(n)
1163
1163
  });
1164
- class z extends _ {
1164
+ class F extends _ {
1165
1165
  constructor() {
1166
1166
  super(...arguments), this.min = this.gte, this.max = this.lte;
1167
1167
  }
@@ -1174,32 +1174,32 @@ class z extends _ {
1174
1174
  }
1175
1175
  if (this._getType(e) !== u.bigint)
1176
1176
  return this._getInvalidInput(e);
1177
- let r;
1178
- const s = new w();
1177
+ let s;
1178
+ const r = new w();
1179
1179
  for (const a of this._def.checks)
1180
- a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1181
- code: d.too_small,
1180
+ a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), d(s, {
1181
+ code: c.too_small,
1182
1182
  type: "bigint",
1183
1183
  minimum: a.value,
1184
1184
  inclusive: a.inclusive,
1185
1185
  message: a.message
1186
- }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (r = this._getOrReturnCtx(e, r), c(r, {
1187
- code: d.too_big,
1186
+ }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), d(s, {
1187
+ code: c.too_big,
1188
1188
  type: "bigint",
1189
1189
  maximum: a.value,
1190
1190
  inclusive: a.inclusive,
1191
1191
  message: a.message
1192
- }), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r), c(r, {
1193
- code: d.not_multiple_of,
1192
+ }), r.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), d(s, {
1193
+ code: c.not_multiple_of,
1194
1194
  multipleOf: a.value,
1195
1195
  message: a.message
1196
- }), s.dirty()) : v.assertNever(a);
1197
- return { status: s.value, value: e.data };
1196
+ }), r.dirty()) : v.assertNever(a);
1197
+ return { status: r.value, value: e.data };
1198
1198
  }
1199
1199
  _getInvalidInput(e) {
1200
1200
  const t = this._getOrReturnCtx(e);
1201
- return c(t, {
1202
- code: d.invalid_type,
1201
+ return d(t, {
1202
+ code: c.invalid_type,
1203
1203
  expected: u.bigint,
1204
1204
  received: t.parsedType
1205
1205
  }), m;
@@ -1216,22 +1216,22 @@ class z extends _ {
1216
1216
  lt(e, t) {
1217
1217
  return this.setLimit("max", e, !1, l.toString(t));
1218
1218
  }
1219
- setLimit(e, t, r, s) {
1220
- return new z({
1219
+ setLimit(e, t, s, r) {
1220
+ return new F({
1221
1221
  ...this._def,
1222
1222
  checks: [
1223
1223
  ...this._def.checks,
1224
1224
  {
1225
1225
  kind: e,
1226
1226
  value: t,
1227
- inclusive: r,
1228
- message: l.toString(s)
1227
+ inclusive: s,
1228
+ message: l.toString(r)
1229
1229
  }
1230
1230
  ]
1231
1231
  });
1232
1232
  }
1233
1233
  _addCheck(e) {
1234
- return new z({
1234
+ return new F({
1235
1235
  ...this._def,
1236
1236
  checks: [...this._def.checks, e]
1237
1237
  });
@@ -1288,71 +1288,71 @@ class z extends _ {
1288
1288
  return e;
1289
1289
  }
1290
1290
  }
1291
- z.create = (n) => new z({
1291
+ F.create = (n) => new F({
1292
1292
  checks: [],
1293
1293
  typeName: p.ZodBigInt,
1294
1294
  coerce: n?.coerce ?? !1,
1295
1295
  ...g(n)
1296
1296
  });
1297
- class ve extends _ {
1297
+ class ie extends _ {
1298
1298
  _parse(e) {
1299
1299
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
1300
- const r = this._getOrReturnCtx(e);
1301
- return c(r, {
1302
- code: d.invalid_type,
1300
+ const s = this._getOrReturnCtx(e);
1301
+ return d(s, {
1302
+ code: c.invalid_type,
1303
1303
  expected: u.boolean,
1304
- received: r.parsedType
1304
+ received: s.parsedType
1305
1305
  }), m;
1306
1306
  }
1307
- return S(e.data);
1307
+ return T(e.data);
1308
1308
  }
1309
1309
  }
1310
- ve.create = (n) => new ve({
1310
+ ie.create = (n) => new ie({
1311
1311
  typeName: p.ZodBoolean,
1312
1312
  coerce: n?.coerce || !1,
1313
1313
  ...g(n)
1314
1314
  });
1315
- class q extends _ {
1315
+ class H extends _ {
1316
1316
  _parse(e) {
1317
1317
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== u.date) {
1318
1318
  const a = this._getOrReturnCtx(e);
1319
- return c(a, {
1320
- code: d.invalid_type,
1319
+ return d(a, {
1320
+ code: c.invalid_type,
1321
1321
  expected: u.date,
1322
1322
  received: a.parsedType
1323
1323
  }), m;
1324
1324
  }
1325
1325
  if (Number.isNaN(e.data.getTime())) {
1326
1326
  const a = this._getOrReturnCtx(e);
1327
- return c(a, {
1328
- code: d.invalid_date
1327
+ return d(a, {
1328
+ code: c.invalid_date
1329
1329
  }), m;
1330
1330
  }
1331
- const r = new w();
1332
- let s;
1331
+ const s = new w();
1332
+ let r;
1333
1333
  for (const a of this._def.checks)
1334
- a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), c(s, {
1335
- code: d.too_small,
1334
+ a.kind === "min" ? e.data.getTime() < a.value && (r = this._getOrReturnCtx(e, r), d(r, {
1335
+ code: c.too_small,
1336
1336
  message: a.message,
1337
1337
  inclusive: !0,
1338
1338
  exact: !1,
1339
1339
  minimum: a.value,
1340
1340
  type: "date"
1341
- }), r.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), c(s, {
1342
- code: d.too_big,
1341
+ }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (r = this._getOrReturnCtx(e, r), d(r, {
1342
+ code: c.too_big,
1343
1343
  message: a.message,
1344
1344
  inclusive: !0,
1345
1345
  exact: !1,
1346
1346
  maximum: a.value,
1347
1347
  type: "date"
1348
- }), r.dirty()) : v.assertNever(a);
1348
+ }), s.dirty()) : v.assertNever(a);
1349
1349
  return {
1350
- status: r.value,
1350
+ status: s.value,
1351
1351
  value: new Date(e.data.getTime())
1352
1352
  };
1353
1353
  }
1354
1354
  _addCheck(e) {
1355
- return new q({
1355
+ return new H({
1356
1356
  ...this._def,
1357
1357
  checks: [...this._def.checks, e]
1358
1358
  });
@@ -1384,7 +1384,7 @@ class q extends _ {
1384
1384
  return e != null ? new Date(e) : null;
1385
1385
  }
1386
1386
  }
1387
- q.create = (n) => new q({
1387
+ H.create = (n) => new H({
1388
1388
  checks: [],
1389
1389
  coerce: n?.coerce || !1,
1390
1390
  typeName: p.ZodDate,
@@ -1393,51 +1393,51 @@ q.create = (n) => new q({
1393
1393
  class xe extends _ {
1394
1394
  _parse(e) {
1395
1395
  if (this._getType(e) !== u.symbol) {
1396
- const r = this._getOrReturnCtx(e);
1397
- return c(r, {
1398
- code: d.invalid_type,
1396
+ const s = this._getOrReturnCtx(e);
1397
+ return d(s, {
1398
+ code: c.invalid_type,
1399
1399
  expected: u.symbol,
1400
- received: r.parsedType
1400
+ received: s.parsedType
1401
1401
  }), m;
1402
1402
  }
1403
- return S(e.data);
1403
+ return T(e.data);
1404
1404
  }
1405
1405
  }
1406
1406
  xe.create = (n) => new xe({
1407
1407
  typeName: p.ZodSymbol,
1408
1408
  ...g(n)
1409
1409
  });
1410
- class ie extends _ {
1410
+ class oe extends _ {
1411
1411
  _parse(e) {
1412
1412
  if (this._getType(e) !== u.undefined) {
1413
- const r = this._getOrReturnCtx(e);
1414
- return c(r, {
1415
- code: d.invalid_type,
1413
+ const s = this._getOrReturnCtx(e);
1414
+ return d(s, {
1415
+ code: c.invalid_type,
1416
1416
  expected: u.undefined,
1417
- received: r.parsedType
1417
+ received: s.parsedType
1418
1418
  }), m;
1419
1419
  }
1420
- return S(e.data);
1420
+ return T(e.data);
1421
1421
  }
1422
1422
  }
1423
- ie.create = (n) => new ie({
1423
+ oe.create = (n) => new oe({
1424
1424
  typeName: p.ZodUndefined,
1425
1425
  ...g(n)
1426
1426
  });
1427
- class oe extends _ {
1427
+ class ce extends _ {
1428
1428
  _parse(e) {
1429
1429
  if (this._getType(e) !== u.null) {
1430
- const r = this._getOrReturnCtx(e);
1431
- return c(r, {
1432
- code: d.invalid_type,
1430
+ const s = this._getOrReturnCtx(e);
1431
+ return d(s, {
1432
+ code: c.invalid_type,
1433
1433
  expected: u.null,
1434
- received: r.parsedType
1434
+ received: s.parsedType
1435
1435
  }), m;
1436
1436
  }
1437
- return S(e.data);
1437
+ return T(e.data);
1438
1438
  }
1439
1439
  }
1440
- oe.create = (n) => new oe({
1440
+ ce.create = (n) => new ce({
1441
1441
  typeName: p.ZodNull,
1442
1442
  ...g(n)
1443
1443
  });
@@ -1446,7 +1446,7 @@ class ke extends _ {
1446
1446
  super(...arguments), this._any = !0;
1447
1447
  }
1448
1448
  _parse(e) {
1449
- return S(e.data);
1449
+ return T(e.data);
1450
1450
  }
1451
1451
  }
1452
1452
  ke.create = (n) => new ke({
@@ -1458,7 +1458,7 @@ class be extends _ {
1458
1458
  super(...arguments), this._unknown = !0;
1459
1459
  }
1460
1460
  _parse(e) {
1461
- return S(e.data);
1461
+ return T(e.data);
1462
1462
  }
1463
1463
  }
1464
1464
  be.create = (n) => new be({
@@ -1468,8 +1468,8 @@ be.create = (n) => new be({
1468
1468
  class j extends _ {
1469
1469
  _parse(e) {
1470
1470
  const t = this._getOrReturnCtx(e);
1471
- return c(t, {
1472
- code: d.invalid_type,
1471
+ return d(t, {
1472
+ code: c.invalid_type,
1473
1473
  expected: u.never,
1474
1474
  received: t.parsedType
1475
1475
  }), m;
@@ -1482,77 +1482,77 @@ j.create = (n) => new j({
1482
1482
  class we extends _ {
1483
1483
  _parse(e) {
1484
1484
  if (this._getType(e) !== u.undefined) {
1485
- const r = this._getOrReturnCtx(e);
1486
- return c(r, {
1487
- code: d.invalid_type,
1485
+ const s = this._getOrReturnCtx(e);
1486
+ return d(s, {
1487
+ code: c.invalid_type,
1488
1488
  expected: u.void,
1489
- received: r.parsedType
1489
+ received: s.parsedType
1490
1490
  }), m;
1491
1491
  }
1492
- return S(e.data);
1492
+ return T(e.data);
1493
1493
  }
1494
1494
  }
1495
1495
  we.create = (n) => new we({
1496
1496
  typeName: p.ZodVoid,
1497
1497
  ...g(n)
1498
1498
  });
1499
- class T extends _ {
1499
+ class S extends _ {
1500
1500
  _parse(e) {
1501
- const { ctx: t, status: r } = this._processInputParams(e), s = this._def;
1501
+ const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
1502
1502
  if (t.parsedType !== u.array)
1503
- return c(t, {
1504
- code: d.invalid_type,
1503
+ return d(t, {
1504
+ code: c.invalid_type,
1505
1505
  expected: u.array,
1506
1506
  received: t.parsedType
1507
1507
  }), m;
1508
- if (s.exactLength !== null) {
1509
- const i = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
1510
- (i || o) && (c(t, {
1511
- code: i ? d.too_big : d.too_small,
1512
- minimum: o ? s.exactLength.value : void 0,
1513
- maximum: i ? s.exactLength.value : void 0,
1508
+ if (r.exactLength !== null) {
1509
+ const i = t.data.length > r.exactLength.value, o = t.data.length < r.exactLength.value;
1510
+ (i || o) && (d(t, {
1511
+ code: i ? c.too_big : c.too_small,
1512
+ minimum: o ? r.exactLength.value : void 0,
1513
+ maximum: i ? r.exactLength.value : void 0,
1514
1514
  type: "array",
1515
1515
  inclusive: !0,
1516
1516
  exact: !0,
1517
- message: s.exactLength.message
1518
- }), r.dirty());
1517
+ message: r.exactLength.message
1518
+ }), s.dirty());
1519
1519
  }
1520
- if (s.minLength !== null && t.data.length < s.minLength.value && (c(t, {
1521
- code: d.too_small,
1522
- minimum: s.minLength.value,
1520
+ if (r.minLength !== null && t.data.length < r.minLength.value && (d(t, {
1521
+ code: c.too_small,
1522
+ minimum: r.minLength.value,
1523
1523
  type: "array",
1524
1524
  inclusive: !0,
1525
1525
  exact: !1,
1526
- message: s.minLength.message
1527
- }), r.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (c(t, {
1528
- code: d.too_big,
1529
- maximum: s.maxLength.value,
1526
+ message: r.minLength.message
1527
+ }), s.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (d(t, {
1528
+ code: c.too_big,
1529
+ maximum: r.maxLength.value,
1530
1530
  type: "array",
1531
1531
  inclusive: !0,
1532
1532
  exact: !1,
1533
- message: s.maxLength.message
1534
- }), r.dirty()), t.common.async)
1535
- return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new Z(t, i, t.path, o)))).then((i) => w.mergeArray(r, i));
1536
- const a = [...t.data].map((i, o) => s.type._parseSync(new Z(t, i, t.path, o)));
1537
- return w.mergeArray(r, a);
1533
+ message: r.maxLength.message
1534
+ }), s.dirty()), t.common.async)
1535
+ return Promise.all([...t.data].map((i, o) => r.type._parseAsync(new Z(t, i, t.path, o)))).then((i) => w.mergeArray(s, i));
1536
+ const a = [...t.data].map((i, o) => r.type._parseSync(new Z(t, i, t.path, o)));
1537
+ return w.mergeArray(s, a);
1538
1538
  }
1539
1539
  get element() {
1540
1540
  return this._def.type;
1541
1541
  }
1542
1542
  min(e, t) {
1543
- return new T({
1543
+ return new S({
1544
1544
  ...this._def,
1545
1545
  minLength: { value: e, message: l.toString(t) }
1546
1546
  });
1547
1547
  }
1548
1548
  max(e, t) {
1549
- return new T({
1549
+ return new S({
1550
1550
  ...this._def,
1551
1551
  maxLength: { value: e, message: l.toString(t) }
1552
1552
  });
1553
1553
  }
1554
1554
  length(e, t) {
1555
- return new T({
1555
+ return new S({
1556
1556
  ...this._def,
1557
1557
  exactLength: { value: e, message: l.toString(t) }
1558
1558
  });
@@ -1561,7 +1561,7 @@ class T extends _ {
1561
1561
  return this.min(1, e);
1562
1562
  }
1563
1563
  }
1564
- T.create = (n, e) => new T({
1564
+ S.create = (n, e) => new S({
1565
1565
  type: n,
1566
1566
  minLength: null,
1567
1567
  maxLength: null,
@@ -1573,14 +1573,14 @@ function P(n) {
1573
1573
  if (n instanceof k) {
1574
1574
  const e = {};
1575
1575
  for (const t in n.shape) {
1576
- const r = n.shape[t];
1577
- e[t] = N.create(P(r));
1576
+ const s = n.shape[t];
1577
+ e[t] = N.create(P(s));
1578
1578
  }
1579
1579
  return new k({
1580
1580
  ...n._def,
1581
1581
  shape: () => e
1582
1582
  });
1583
- } else return n instanceof T ? new T({
1583
+ } else return n instanceof S ? new S({
1584
1584
  ...n._def,
1585
1585
  type: P(n.element)
1586
1586
  }) : n instanceof N ? N.create(P(n.unwrap())) : n instanceof L ? L.create(P(n.unwrap())) : n instanceof E ? E.create(n.items.map((e) => P(e))) : n;
@@ -1598,23 +1598,23 @@ class k extends _ {
1598
1598
  _parse(e) {
1599
1599
  if (this._getType(e) !== u.object) {
1600
1600
  const h = this._getOrReturnCtx(e);
1601
- return c(h, {
1602
- code: d.invalid_type,
1601
+ return d(h, {
1602
+ code: c.invalid_type,
1603
1603
  expected: u.object,
1604
1604
  received: h.parsedType
1605
1605
  }), m;
1606
1606
  }
1607
- const { status: r, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1607
+ const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1608
1608
  if (!(this._def.catchall instanceof j && this._def.unknownKeys === "strip"))
1609
- for (const h in s.data)
1609
+ for (const h in r.data)
1610
1610
  i.includes(h) || o.push(h);
1611
1611
  const f = [];
1612
1612
  for (const h of i) {
1613
- const y = a[h], C = s.data[h];
1613
+ const y = a[h], A = r.data[h];
1614
1614
  f.push({
1615
1615
  key: { status: "valid", value: h },
1616
- value: y._parse(new Z(s, C, s.path, h)),
1617
- alwaysSet: h in s.data
1616
+ value: y._parse(new Z(r, A, r.path, h)),
1617
+ alwaysSet: h in r.data
1618
1618
  });
1619
1619
  }
1620
1620
  if (this._def.catchall instanceof j) {
@@ -1623,40 +1623,40 @@ class k extends _ {
1623
1623
  for (const y of o)
1624
1624
  f.push({
1625
1625
  key: { status: "valid", value: y },
1626
- value: { status: "valid", value: s.data[y] }
1626
+ value: { status: "valid", value: r.data[y] }
1627
1627
  });
1628
1628
  else if (h === "strict")
1629
- o.length > 0 && (c(s, {
1630
- code: d.unrecognized_keys,
1629
+ o.length > 0 && (d(r, {
1630
+ code: c.unrecognized_keys,
1631
1631
  keys: o
1632
- }), r.dirty());
1632
+ }), s.dirty());
1633
1633
  else if (h !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1634
1634
  } else {
1635
1635
  const h = this._def.catchall;
1636
1636
  for (const y of o) {
1637
- const C = s.data[y];
1637
+ const A = r.data[y];
1638
1638
  f.push({
1639
1639
  key: { status: "valid", value: y },
1640
1640
  value: h._parse(
1641
- new Z(s, C, s.path, y)
1641
+ new Z(r, A, r.path, y)
1642
1642
  //, ctx.child(key), value, getParsedType(value)
1643
1643
  ),
1644
- alwaysSet: y in s.data
1644
+ alwaysSet: y in r.data
1645
1645
  });
1646
1646
  }
1647
1647
  }
1648
- return s.common.async ? Promise.resolve().then(async () => {
1648
+ return r.common.async ? Promise.resolve().then(async () => {
1649
1649
  const h = [];
1650
1650
  for (const y of f) {
1651
- const C = await y.key, ne = await y.value;
1651
+ const A = await y.key, ne = await y.value;
1652
1652
  h.push({
1653
- key: C,
1653
+ key: A,
1654
1654
  value: ne,
1655
1655
  alwaysSet: y.alwaysSet
1656
1656
  });
1657
1657
  }
1658
1658
  return h;
1659
- }).then((h) => w.mergeObjectSync(r, h)) : w.mergeObjectSync(r, f);
1659
+ }).then((h) => w.mergeObjectSync(s, h)) : w.mergeObjectSync(s, f);
1660
1660
  }
1661
1661
  get shape() {
1662
1662
  return this._def.shape();
@@ -1666,12 +1666,12 @@ class k extends _ {
1666
1666
  ...this._def,
1667
1667
  unknownKeys: "strict",
1668
1668
  ...e !== void 0 ? {
1669
- errorMap: (t, r) => {
1670
- const s = this._def.errorMap?.(t, r).message ?? r.defaultError;
1669
+ errorMap: (t, s) => {
1670
+ const r = this._def.errorMap?.(t, s).message ?? s.defaultError;
1671
1671
  return t.code === "unrecognized_keys" ? {
1672
- message: l.errToObj(e).message ?? s
1672
+ message: l.errToObj(e).message ?? r
1673
1673
  } : {
1674
- message: s
1674
+ message: r
1675
1675
  };
1676
1676
  }
1677
1677
  } : {}
@@ -1798,8 +1798,8 @@ class k extends _ {
1798
1798
  }
1799
1799
  pick(e) {
1800
1800
  const t = {};
1801
- for (const r of v.objectKeys(e))
1802
- e[r] && this.shape[r] && (t[r] = this.shape[r]);
1801
+ for (const s of v.objectKeys(e))
1802
+ e[s] && this.shape[s] && (t[s] = this.shape[s]);
1803
1803
  return new k({
1804
1804
  ...this._def,
1805
1805
  shape: () => t
@@ -1807,8 +1807,8 @@ class k extends _ {
1807
1807
  }
1808
1808
  omit(e) {
1809
1809
  const t = {};
1810
- for (const r of v.objectKeys(this.shape))
1811
- e[r] || (t[r] = this.shape[r]);
1810
+ for (const s of v.objectKeys(this.shape))
1811
+ e[s] || (t[s] = this.shape[s]);
1812
1812
  return new k({
1813
1813
  ...this._def,
1814
1814
  shape: () => t
@@ -1822,9 +1822,9 @@ class k extends _ {
1822
1822
  }
1823
1823
  partial(e) {
1824
1824
  const t = {};
1825
- for (const r of v.objectKeys(this.shape)) {
1826
- const s = this.shape[r];
1827
- e && !e[r] ? t[r] = s : t[r] = s.optional();
1825
+ for (const s of v.objectKeys(this.shape)) {
1826
+ const r = this.shape[s];
1827
+ e && !e[s] ? t[s] = r : t[s] = r.optional();
1828
1828
  }
1829
1829
  return new k({
1830
1830
  ...this._def,
@@ -1833,14 +1833,14 @@ class k extends _ {
1833
1833
  }
1834
1834
  required(e) {
1835
1835
  const t = {};
1836
- for (const r of v.objectKeys(this.shape))
1837
- if (e && !e[r])
1838
- t[r] = this.shape[r];
1836
+ for (const s of v.objectKeys(this.shape))
1837
+ if (e && !e[s])
1838
+ t[s] = this.shape[s];
1839
1839
  else {
1840
- let a = this.shape[r];
1840
+ let a = this.shape[s];
1841
1841
  for (; a instanceof N; )
1842
1842
  a = a._def.innerType;
1843
- t[r] = a;
1843
+ t[s] = a;
1844
1844
  }
1845
1845
  return new k({
1846
1846
  ...this._def,
@@ -1872,10 +1872,10 @@ k.lazycreate = (n, e) => new k({
1872
1872
  typeName: p.ZodObject,
1873
1873
  ...g(e)
1874
1874
  });
1875
- class H extends _ {
1875
+ class Y extends _ {
1876
1876
  _parse(e) {
1877
- const { ctx: t } = this._processInputParams(e), r = this._def.options;
1878
- function s(a) {
1877
+ const { ctx: t } = this._processInputParams(e), s = this._def.options;
1878
+ function r(a) {
1879
1879
  for (const o of a)
1880
1880
  if (o.result.status === "valid")
1881
1881
  return o.result;
@@ -1883,13 +1883,13 @@ class H extends _ {
1883
1883
  if (o.result.status === "dirty")
1884
1884
  return t.common.issues.push(...o.ctx.common.issues), o.result;
1885
1885
  const i = a.map((o) => new O(o.ctx.common.issues));
1886
- return c(t, {
1887
- code: d.invalid_union,
1886
+ return d(t, {
1887
+ code: c.invalid_union,
1888
1888
  unionErrors: i
1889
1889
  }), m;
1890
1890
  }
1891
1891
  if (t.common.async)
1892
- return Promise.all(r.map(async (a) => {
1892
+ return Promise.all(s.map(async (a) => {
1893
1893
  const i = {
1894
1894
  ...t,
1895
1895
  common: {
@@ -1906,11 +1906,11 @@ class H extends _ {
1906
1906
  }),
1907
1907
  ctx: i
1908
1908
  };
1909
- })).then(s);
1909
+ })).then(r);
1910
1910
  {
1911
1911
  let a;
1912
1912
  const i = [];
1913
- for (const f of r) {
1913
+ for (const f of s) {
1914
1914
  const h = {
1915
1915
  ...t,
1916
1916
  common: {
@@ -1930,8 +1930,8 @@ class H extends _ {
1930
1930
  if (a)
1931
1931
  return t.common.issues.push(...a.ctx.common.issues), a.result;
1932
1932
  const o = i.map((f) => new O(f));
1933
- return c(t, {
1934
- code: d.invalid_union,
1933
+ return d(t, {
1934
+ code: c.invalid_union,
1935
1935
  unionErrors: o
1936
1936
  }), m;
1937
1937
  }
@@ -1940,22 +1940,22 @@ class H extends _ {
1940
1940
  return this._def.options;
1941
1941
  }
1942
1942
  }
1943
- H.create = (n, e) => new H({
1943
+ Y.create = (n, e) => new Y({
1944
1944
  options: n,
1945
1945
  typeName: p.ZodUnion,
1946
1946
  ...g(e)
1947
1947
  });
1948
- const A = (n) => n instanceof ce ? A(n.schema) : n instanceof M ? A(n.innerType()) : n instanceof J ? [n.value] : n instanceof I ? n.options : n instanceof Q ? v.objectValues(n.enum) : n instanceof G ? A(n._def.innerType) : n instanceof ie ? [void 0] : n instanceof oe ? [null] : n instanceof N ? [void 0, ...A(n.unwrap())] : n instanceof L ? [null, ...A(n.unwrap())] : n instanceof Oe || n instanceof ee ? A(n.unwrap()) : n instanceof K ? A(n._def.innerType) : [];
1949
- class ue extends _ {
1948
+ const C = (n) => n instanceof ue ? C(n.schema) : n instanceof M ? C(n.innerType()) : n instanceof Q ? [n.value] : n instanceof I ? n.options : n instanceof X ? v.objectValues(n.enum) : n instanceof K ? C(n._def.innerType) : n instanceof oe ? [void 0] : n instanceof ce ? [null] : n instanceof N ? [void 0, ...C(n.unwrap())] : n instanceof L ? [null, ...C(n.unwrap())] : n instanceof Oe || n instanceof te ? C(n.unwrap()) : n instanceof ee ? C(n._def.innerType) : [];
1949
+ class le extends _ {
1950
1950
  _parse(e) {
1951
1951
  const { ctx: t } = this._processInputParams(e);
1952
1952
  if (t.parsedType !== u.object)
1953
- return c(t, {
1954
- code: d.invalid_type,
1953
+ return d(t, {
1954
+ code: c.invalid_type,
1955
1955
  expected: u.object,
1956
1956
  received: t.parsedType
1957
1957
  }), m;
1958
- const r = this.discriminator, s = t.data[r], a = this.optionsMap.get(s);
1958
+ const s = this.discriminator, r = t.data[s], a = this.optionsMap.get(r);
1959
1959
  return a ? t.common.async ? a._parseAsync({
1960
1960
  data: t.data,
1961
1961
  path: t.path,
@@ -1964,10 +1964,10 @@ class ue extends _ {
1964
1964
  data: t.data,
1965
1965
  path: t.path,
1966
1966
  parent: t
1967
- }) : (c(t, {
1968
- code: d.invalid_union_discriminator,
1967
+ }) : (d(t, {
1968
+ code: c.invalid_union_discriminator,
1969
1969
  options: Array.from(this.optionsMap.keys()),
1970
- path: [r]
1970
+ path: [s]
1971
1971
  }), m);
1972
1972
  }
1973
1973
  get discriminator() {
@@ -1987,33 +1987,33 @@ class ue extends _ {
1987
1987
  * @param types an array of object schemas
1988
1988
  * @param params
1989
1989
  */
1990
- static create(e, t, r) {
1991
- const s = /* @__PURE__ */ new Map();
1990
+ static create(e, t, s) {
1991
+ const r = /* @__PURE__ */ new Map();
1992
1992
  for (const a of t) {
1993
- const i = A(a.shape[e]);
1993
+ const i = C(a.shape[e]);
1994
1994
  if (!i.length)
1995
1995
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
1996
1996
  for (const o of i) {
1997
- if (s.has(o))
1997
+ if (r.has(o))
1998
1998
  throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
1999
- s.set(o, a);
1999
+ r.set(o, a);
2000
2000
  }
2001
2001
  }
2002
- return new ue({
2002
+ return new le({
2003
2003
  typeName: p.ZodDiscriminatedUnion,
2004
2004
  discriminator: e,
2005
2005
  options: t,
2006
- optionsMap: s,
2007
- ...g(r)
2006
+ optionsMap: r,
2007
+ ...g(s)
2008
2008
  });
2009
2009
  }
2010
2010
  }
2011
2011
  function de(n, e) {
2012
- const t = $(n), r = $(e);
2012
+ const t = $(n), s = $(e);
2013
2013
  if (n === e)
2014
2014
  return { valid: !0, data: n };
2015
- if (t === u.object && r === u.object) {
2016
- const s = v.objectKeys(e), a = v.objectKeys(n).filter((o) => s.indexOf(o) !== -1), i = { ...n, ...e };
2015
+ if (t === u.object && s === u.object) {
2016
+ const r = v.objectKeys(e), a = v.objectKeys(n).filter((o) => r.indexOf(o) !== -1), i = { ...n, ...e };
2017
2017
  for (const o of a) {
2018
2018
  const f = de(n[o], e[o]);
2019
2019
  if (!f.valid)
@@ -2021,52 +2021,52 @@ function de(n, e) {
2021
2021
  i[o] = f.data;
2022
2022
  }
2023
2023
  return { valid: !0, data: i };
2024
- } else if (t === u.array && r === u.array) {
2024
+ } else if (t === u.array && s === u.array) {
2025
2025
  if (n.length !== e.length)
2026
2026
  return { valid: !1 };
2027
- const s = [];
2027
+ const r = [];
2028
2028
  for (let a = 0; a < n.length; a++) {
2029
2029
  const i = n[a], o = e[a], f = de(i, o);
2030
2030
  if (!f.valid)
2031
2031
  return { valid: !1 };
2032
- s.push(f.data);
2032
+ r.push(f.data);
2033
2033
  }
2034
- return { valid: !0, data: s };
2035
- } else return t === u.date && r === u.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
2034
+ return { valid: !0, data: r };
2035
+ } else return t === u.date && s === u.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
2036
2036
  }
2037
- class Y extends _ {
2037
+ class J extends _ {
2038
2038
  _parse(e) {
2039
- const { status: t, ctx: r } = this._processInputParams(e), s = (a, i) => {
2040
- if (ge(a) || ge(i))
2039
+ const { status: t, ctx: s } = this._processInputParams(e), r = (a, i) => {
2040
+ if (ye(a) || ye(i))
2041
2041
  return m;
2042
2042
  const o = de(a.value, i.value);
2043
- return o.valid ? ((ye(a) || ye(i)) && t.dirty(), { status: t.value, value: o.data }) : (c(r, {
2044
- code: d.invalid_intersection_types
2043
+ return o.valid ? ((_e(a) || _e(i)) && t.dirty(), { status: t.value, value: o.data }) : (d(s, {
2044
+ code: c.invalid_intersection_types
2045
2045
  }), m);
2046
2046
  };
2047
- return r.common.async ? Promise.all([
2047
+ return s.common.async ? Promise.all([
2048
2048
  this._def.left._parseAsync({
2049
- data: r.data,
2050
- path: r.path,
2051
- parent: r
2049
+ data: s.data,
2050
+ path: s.path,
2051
+ parent: s
2052
2052
  }),
2053
2053
  this._def.right._parseAsync({
2054
- data: r.data,
2055
- path: r.path,
2056
- parent: r
2054
+ data: s.data,
2055
+ path: s.path,
2056
+ parent: s
2057
2057
  })
2058
- ]).then(([a, i]) => s(a, i)) : s(this._def.left._parseSync({
2059
- data: r.data,
2060
- path: r.path,
2061
- parent: r
2058
+ ]).then(([a, i]) => r(a, i)) : r(this._def.left._parseSync({
2059
+ data: s.data,
2060
+ path: s.path,
2061
+ parent: s
2062
2062
  }), this._def.right._parseSync({
2063
- data: r.data,
2064
- path: r.path,
2065
- parent: r
2063
+ data: s.data,
2064
+ path: s.path,
2065
+ parent: s
2066
2066
  }));
2067
2067
  }
2068
2068
  }
2069
- Y.create = (n, e, t) => new Y({
2069
+ J.create = (n, e, t) => new J({
2070
2070
  left: n,
2071
2071
  right: e,
2072
2072
  typeName: p.ZodIntersection,
@@ -2074,33 +2074,33 @@ Y.create = (n, e, t) => new Y({
2074
2074
  });
2075
2075
  class E extends _ {
2076
2076
  _parse(e) {
2077
- const { status: t, ctx: r } = this._processInputParams(e);
2078
- if (r.parsedType !== u.array)
2079
- return c(r, {
2080
- code: d.invalid_type,
2077
+ const { status: t, ctx: s } = this._processInputParams(e);
2078
+ if (s.parsedType !== u.array)
2079
+ return d(s, {
2080
+ code: c.invalid_type,
2081
2081
  expected: u.array,
2082
- received: r.parsedType
2082
+ received: s.parsedType
2083
2083
  }), m;
2084
- if (r.data.length < this._def.items.length)
2085
- return c(r, {
2086
- code: d.too_small,
2084
+ if (s.data.length < this._def.items.length)
2085
+ return d(s, {
2086
+ code: c.too_small,
2087
2087
  minimum: this._def.items.length,
2088
2088
  inclusive: !0,
2089
2089
  exact: !1,
2090
2090
  type: "array"
2091
2091
  }), m;
2092
- !this._def.rest && r.data.length > this._def.items.length && (c(r, {
2093
- code: d.too_big,
2092
+ !this._def.rest && s.data.length > this._def.items.length && (d(s, {
2093
+ code: c.too_big,
2094
2094
  maximum: this._def.items.length,
2095
2095
  inclusive: !0,
2096
2096
  exact: !1,
2097
2097
  type: "array"
2098
2098
  }), t.dirty());
2099
- const a = [...r.data].map((i, o) => {
2099
+ const a = [...s.data].map((i, o) => {
2100
2100
  const f = this._def.items[o] || this._def.rest;
2101
- return f ? f._parse(new Z(r, i, r.path, o)) : null;
2101
+ return f ? f._parse(new Z(s, i, s.path, o)) : null;
2102
2102
  }).filter((i) => !!i);
2103
- return r.common.async ? Promise.all(a).then((i) => w.mergeArray(t, i)) : w.mergeArray(t, a);
2103
+ return s.common.async ? Promise.all(a).then((i) => w.mergeArray(t, i)) : w.mergeArray(t, a);
2104
2104
  }
2105
2105
  get items() {
2106
2106
  return this._def.items;
@@ -2122,7 +2122,7 @@ E.create = (n, e) => {
2122
2122
  ...g(e)
2123
2123
  });
2124
2124
  };
2125
- class Se extends _ {
2125
+ class Te extends _ {
2126
2126
  get keySchema() {
2127
2127
  return this._def.keyType;
2128
2128
  }
@@ -2130,18 +2130,18 @@ class Se extends _ {
2130
2130
  return this._def.valueType;
2131
2131
  }
2132
2132
  _parse(e) {
2133
- const { status: t, ctx: r } = this._processInputParams(e);
2134
- if (r.parsedType !== u.map)
2135
- return c(r, {
2136
- code: d.invalid_type,
2133
+ const { status: t, ctx: s } = this._processInputParams(e);
2134
+ if (s.parsedType !== u.map)
2135
+ return d(s, {
2136
+ code: c.invalid_type,
2137
2137
  expected: u.map,
2138
- received: r.parsedType
2138
+ received: s.parsedType
2139
2139
  }), m;
2140
- const s = this._def.keyType, a = this._def.valueType, i = [...r.data.entries()].map(([o, f], h) => ({
2141
- key: s._parse(new Z(r, o, r.path, [h, "key"])),
2142
- value: a._parse(new Z(r, f, r.path, [h, "value"]))
2140
+ const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, f], h) => ({
2141
+ key: r._parse(new Z(s, o, s.path, [h, "key"])),
2142
+ value: a._parse(new Z(s, f, s.path, [h, "value"]))
2143
2143
  }));
2144
- if (r.common.async) {
2144
+ if (s.common.async) {
2145
2145
  const o = /* @__PURE__ */ new Map();
2146
2146
  return Promise.resolve().then(async () => {
2147
2147
  for (const f of i) {
@@ -2164,36 +2164,36 @@ class Se extends _ {
2164
2164
  }
2165
2165
  }
2166
2166
  }
2167
- Se.create = (n, e, t) => new Se({
2167
+ Te.create = (n, e, t) => new Te({
2168
2168
  valueType: e,
2169
2169
  keyType: n,
2170
2170
  typeName: p.ZodMap,
2171
2171
  ...g(t)
2172
2172
  });
2173
- class F extends _ {
2173
+ class U extends _ {
2174
2174
  _parse(e) {
2175
- const { status: t, ctx: r } = this._processInputParams(e);
2176
- if (r.parsedType !== u.set)
2177
- return c(r, {
2178
- code: d.invalid_type,
2175
+ const { status: t, ctx: s } = this._processInputParams(e);
2176
+ if (s.parsedType !== u.set)
2177
+ return d(s, {
2178
+ code: c.invalid_type,
2179
2179
  expected: u.set,
2180
- received: r.parsedType
2180
+ received: s.parsedType
2181
2181
  }), m;
2182
- const s = this._def;
2183
- s.minSize !== null && r.data.size < s.minSize.value && (c(r, {
2184
- code: d.too_small,
2185
- minimum: s.minSize.value,
2182
+ const r = this._def;
2183
+ r.minSize !== null && s.data.size < r.minSize.value && (d(s, {
2184
+ code: c.too_small,
2185
+ minimum: r.minSize.value,
2186
2186
  type: "set",
2187
2187
  inclusive: !0,
2188
2188
  exact: !1,
2189
- message: s.minSize.message
2190
- }), t.dirty()), s.maxSize !== null && r.data.size > s.maxSize.value && (c(r, {
2191
- code: d.too_big,
2192
- maximum: s.maxSize.value,
2189
+ message: r.minSize.message
2190
+ }), t.dirty()), r.maxSize !== null && s.data.size > r.maxSize.value && (d(s, {
2191
+ code: c.too_big,
2192
+ maximum: r.maxSize.value,
2193
2193
  type: "set",
2194
2194
  inclusive: !0,
2195
2195
  exact: !1,
2196
- message: s.maxSize.message
2196
+ message: r.maxSize.message
2197
2197
  }), t.dirty());
2198
2198
  const a = this._def.valueType;
2199
2199
  function i(f) {
@@ -2205,17 +2205,17 @@ class F extends _ {
2205
2205
  }
2206
2206
  return { status: t.value, value: h };
2207
2207
  }
2208
- const o = [...r.data.values()].map((f, h) => a._parse(new Z(r, f, r.path, h)));
2209
- return r.common.async ? Promise.all(o).then((f) => i(f)) : i(o);
2208
+ const o = [...s.data.values()].map((f, h) => a._parse(new Z(s, f, s.path, h)));
2209
+ return s.common.async ? Promise.all(o).then((f) => i(f)) : i(o);
2210
2210
  }
2211
2211
  min(e, t) {
2212
- return new F({
2212
+ return new U({
2213
2213
  ...this._def,
2214
2214
  minSize: { value: e, message: l.toString(t) }
2215
2215
  });
2216
2216
  }
2217
2217
  max(e, t) {
2218
- return new F({
2218
+ return new U({
2219
2219
  ...this._def,
2220
2220
  maxSize: { value: e, message: l.toString(t) }
2221
2221
  });
@@ -2227,14 +2227,14 @@ class F extends _ {
2227
2227
  return this.min(1, e);
2228
2228
  }
2229
2229
  }
2230
- F.create = (n, e) => new F({
2230
+ U.create = (n, e) => new U({
2231
2231
  valueType: n,
2232
2232
  minSize: null,
2233
2233
  maxSize: null,
2234
2234
  typeName: p.ZodSet,
2235
2235
  ...g(e)
2236
2236
  });
2237
- class ce extends _ {
2237
+ class ue extends _ {
2238
2238
  get schema() {
2239
2239
  return this._def.getter();
2240
2240
  }
@@ -2243,18 +2243,18 @@ class ce extends _ {
2243
2243
  return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2244
2244
  }
2245
2245
  }
2246
- ce.create = (n, e) => new ce({
2246
+ ue.create = (n, e) => new ue({
2247
2247
  getter: n,
2248
2248
  typeName: p.ZodLazy,
2249
2249
  ...g(e)
2250
2250
  });
2251
- class J extends _ {
2251
+ class Q extends _ {
2252
2252
  _parse(e) {
2253
2253
  if (e.data !== this._def.value) {
2254
2254
  const t = this._getOrReturnCtx(e);
2255
- return c(t, {
2255
+ return d(t, {
2256
2256
  received: t.data,
2257
- code: d.invalid_literal,
2257
+ code: c.invalid_literal,
2258
2258
  expected: this._def.value
2259
2259
  }), m;
2260
2260
  }
@@ -2264,7 +2264,7 @@ class J extends _ {
2264
2264
  return this._def.value;
2265
2265
  }
2266
2266
  }
2267
- J.create = (n, e) => new J({
2267
+ Q.create = (n, e) => new Q({
2268
2268
  value: n,
2269
2269
  typeName: p.ZodLiteral,
2270
2270
  ...g(e)
@@ -2279,22 +2279,22 @@ function Ne(n, e) {
2279
2279
  class I extends _ {
2280
2280
  _parse(e) {
2281
2281
  if (typeof e.data != "string") {
2282
- const t = this._getOrReturnCtx(e), r = this._def.values;
2283
- return c(t, {
2284
- expected: v.joinValues(r),
2282
+ const t = this._getOrReturnCtx(e), s = this._def.values;
2283
+ return d(t, {
2284
+ expected: v.joinValues(s),
2285
2285
  received: t.parsedType,
2286
- code: d.invalid_type
2286
+ code: c.invalid_type
2287
2287
  }), m;
2288
2288
  }
2289
2289
  if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
2290
- const t = this._getOrReturnCtx(e), r = this._def.values;
2291
- return c(t, {
2290
+ const t = this._getOrReturnCtx(e), s = this._def.values;
2291
+ return d(t, {
2292
2292
  received: t.data,
2293
- code: d.invalid_enum_value,
2294
- options: r
2293
+ code: c.invalid_enum_value,
2294
+ options: s
2295
2295
  }), m;
2296
2296
  }
2297
- return S(e.data);
2297
+ return T(e.data);
2298
2298
  }
2299
2299
  get options() {
2300
2300
  return this._def.values;
@@ -2324,63 +2324,63 @@ class I extends _ {
2324
2324
  });
2325
2325
  }
2326
2326
  exclude(e, t = this._def) {
2327
- return I.create(this.options.filter((r) => !e.includes(r)), {
2327
+ return I.create(this.options.filter((s) => !e.includes(s)), {
2328
2328
  ...this._def,
2329
2329
  ...t
2330
2330
  });
2331
2331
  }
2332
2332
  }
2333
2333
  I.create = Ne;
2334
- class Q extends _ {
2334
+ class X extends _ {
2335
2335
  _parse(e) {
2336
- const t = v.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
2337
- if (r.parsedType !== u.string && r.parsedType !== u.number) {
2338
- const s = v.objectValues(t);
2339
- return c(r, {
2340
- expected: v.joinValues(s),
2341
- received: r.parsedType,
2342
- code: d.invalid_type
2336
+ const t = v.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
2337
+ if (s.parsedType !== u.string && s.parsedType !== u.number) {
2338
+ const r = v.objectValues(t);
2339
+ return d(s, {
2340
+ expected: v.joinValues(r),
2341
+ received: s.parsedType,
2342
+ code: c.invalid_type
2343
2343
  }), m;
2344
2344
  }
2345
2345
  if (this._cache || (this._cache = new Set(v.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2346
- const s = v.objectValues(t);
2347
- return c(r, {
2348
- received: r.data,
2349
- code: d.invalid_enum_value,
2350
- options: s
2346
+ const r = v.objectValues(t);
2347
+ return d(s, {
2348
+ received: s.data,
2349
+ code: c.invalid_enum_value,
2350
+ options: r
2351
2351
  }), m;
2352
2352
  }
2353
- return S(e.data);
2353
+ return T(e.data);
2354
2354
  }
2355
2355
  get enum() {
2356
2356
  return this._def.values;
2357
2357
  }
2358
2358
  }
2359
- Q.create = (n, e) => new Q({
2359
+ X.create = (n, e) => new X({
2360
2360
  values: n,
2361
2361
  typeName: p.ZodNativeEnum,
2362
2362
  ...g(e)
2363
2363
  });
2364
- class X extends _ {
2364
+ class G extends _ {
2365
2365
  unwrap() {
2366
2366
  return this._def.type;
2367
2367
  }
2368
2368
  _parse(e) {
2369
2369
  const { ctx: t } = this._processInputParams(e);
2370
2370
  if (t.parsedType !== u.promise && t.common.async === !1)
2371
- return c(t, {
2372
- code: d.invalid_type,
2371
+ return d(t, {
2372
+ code: c.invalid_type,
2373
2373
  expected: u.promise,
2374
2374
  received: t.parsedType
2375
2375
  }), m;
2376
- const r = t.parsedType === u.promise ? t.data : Promise.resolve(t.data);
2377
- return S(r.then((s) => this._def.type.parseAsync(s, {
2376
+ const s = t.parsedType === u.promise ? t.data : Promise.resolve(t.data);
2377
+ return T(s.then((r) => this._def.type.parseAsync(r, {
2378
2378
  path: t.path,
2379
2379
  errorMap: t.common.contextualErrorMap
2380
2380
  })));
2381
2381
  }
2382
2382
  }
2383
- X.create = (n, e) => new X({
2383
+ G.create = (n, e) => new G({
2384
2384
  type: n,
2385
2385
  typeName: p.ZodPromise,
2386
2386
  ...g(e)
@@ -2393,24 +2393,24 @@ class M extends _ {
2393
2393
  return this._def.schema._def.typeName === p.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2394
2394
  }
2395
2395
  _parse(e) {
2396
- const { status: t, ctx: r } = this._processInputParams(e), s = this._def.effect || null, a = {
2396
+ const { status: t, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
2397
2397
  addIssue: (i) => {
2398
- c(r, i), i.fatal ? t.abort() : t.dirty();
2398
+ d(s, i), i.fatal ? t.abort() : t.dirty();
2399
2399
  },
2400
2400
  get path() {
2401
- return r.path;
2401
+ return s.path;
2402
2402
  }
2403
2403
  };
2404
- if (a.addIssue = a.addIssue.bind(a), s.type === "preprocess") {
2405
- const i = s.transform(r.data, a);
2406
- if (r.common.async)
2404
+ if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
2405
+ const i = r.transform(s.data, a);
2406
+ if (s.common.async)
2407
2407
  return Promise.resolve(i).then(async (o) => {
2408
2408
  if (t.value === "aborted")
2409
2409
  return m;
2410
2410
  const f = await this._def.schema._parseAsync({
2411
2411
  data: o,
2412
- path: r.path,
2413
- parent: r
2412
+ path: s.path,
2413
+ parent: s
2414
2414
  });
2415
2415
  return f.status === "aborted" ? m : f.status === "dirty" || t.value === "dirty" ? W(f.value) : f;
2416
2416
  });
@@ -2419,50 +2419,50 @@ class M extends _ {
2419
2419
  return m;
2420
2420
  const o = this._def.schema._parseSync({
2421
2421
  data: i,
2422
- path: r.path,
2423
- parent: r
2422
+ path: s.path,
2423
+ parent: s
2424
2424
  });
2425
2425
  return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ? W(o.value) : o;
2426
2426
  }
2427
2427
  }
2428
- if (s.type === "refinement") {
2428
+ if (r.type === "refinement") {
2429
2429
  const i = (o) => {
2430
- const f = s.refinement(o, a);
2431
- if (r.common.async)
2430
+ const f = r.refinement(o, a);
2431
+ if (s.common.async)
2432
2432
  return Promise.resolve(f);
2433
2433
  if (f instanceof Promise)
2434
2434
  throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2435
2435
  return o;
2436
2436
  };
2437
- if (r.common.async === !1) {
2437
+ if (s.common.async === !1) {
2438
2438
  const o = this._def.schema._parseSync({
2439
- data: r.data,
2440
- path: r.path,
2441
- parent: r
2439
+ data: s.data,
2440
+ path: s.path,
2441
+ parent: s
2442
2442
  });
2443
2443
  return o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2444
2444
  } else
2445
- return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2445
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2446
2446
  }
2447
- if (s.type === "transform")
2448
- if (r.common.async === !1) {
2447
+ if (r.type === "transform")
2448
+ if (s.common.async === !1) {
2449
2449
  const i = this._def.schema._parseSync({
2450
- data: r.data,
2451
- path: r.path,
2452
- parent: r
2450
+ data: s.data,
2451
+ path: s.path,
2452
+ parent: s
2453
2453
  });
2454
2454
  if (!D(i))
2455
2455
  return m;
2456
- const o = s.transform(i.value, a);
2456
+ const o = r.transform(i.value, a);
2457
2457
  if (o instanceof Promise)
2458
2458
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2459
2459
  return { status: t.value, value: o };
2460
2460
  } else
2461
- return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) => D(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({
2461
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => D(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({
2462
2462
  status: t.value,
2463
2463
  value: o
2464
2464
  })) : m);
2465
- v.assertNever(s);
2465
+ v.assertNever(r);
2466
2466
  }
2467
2467
  }
2468
2468
  M.create = (n, e, t) => new M({
@@ -2479,7 +2479,7 @@ M.createWithPreprocess = (n, e, t) => new M({
2479
2479
  });
2480
2480
  class N extends _ {
2481
2481
  _parse(e) {
2482
- return this._getType(e) === u.undefined ? S(void 0) : this._def.innerType._parse(e);
2482
+ return this._getType(e) === u.undefined ? T(void 0) : this._def.innerType._parse(e);
2483
2483
  }
2484
2484
  unwrap() {
2485
2485
  return this._def.innerType;
@@ -2492,7 +2492,7 @@ N.create = (n, e) => new N({
2492
2492
  });
2493
2493
  class L extends _ {
2494
2494
  _parse(e) {
2495
- return this._getType(e) === u.null ? S(null) : this._def.innerType._parse(e);
2495
+ return this._getType(e) === u.null ? T(null) : this._def.innerType._parse(e);
2496
2496
  }
2497
2497
  unwrap() {
2498
2498
  return this._def.innerType;
@@ -2503,12 +2503,12 @@ L.create = (n, e) => new L({
2503
2503
  typeName: p.ZodNullable,
2504
2504
  ...g(e)
2505
2505
  });
2506
- class G extends _ {
2506
+ class K extends _ {
2507
2507
  _parse(e) {
2508
2508
  const { ctx: t } = this._processInputParams(e);
2509
- let r = t.data;
2510
- return t.parsedType === u.undefined && (r = this._def.defaultValue()), this._def.innerType._parse({
2511
- data: r,
2509
+ let s = t.data;
2510
+ return t.parsedType === u.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
2511
+ data: s,
2512
2512
  path: t.path,
2513
2513
  parent: t
2514
2514
  });
@@ -2517,42 +2517,42 @@ class G extends _ {
2517
2517
  return this._def.innerType;
2518
2518
  }
2519
2519
  }
2520
- G.create = (n, e) => new G({
2520
+ K.create = (n, e) => new K({
2521
2521
  innerType: n,
2522
2522
  typeName: p.ZodDefault,
2523
2523
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2524
2524
  ...g(e)
2525
2525
  });
2526
- class K extends _ {
2526
+ class ee extends _ {
2527
2527
  _parse(e) {
2528
- const { ctx: t } = this._processInputParams(e), r = {
2528
+ const { ctx: t } = this._processInputParams(e), s = {
2529
2529
  ...t,
2530
2530
  common: {
2531
2531
  ...t.common,
2532
2532
  issues: []
2533
2533
  }
2534
- }, s = this._def.innerType._parse({
2535
- data: r.data,
2536
- path: r.path,
2534
+ }, r = this._def.innerType._parse({
2535
+ data: s.data,
2536
+ path: s.path,
2537
2537
  parent: {
2538
- ...r
2538
+ ...s
2539
2539
  }
2540
2540
  });
2541
- return U(s) ? s.then((a) => ({
2541
+ return q(r) ? r.then((a) => ({
2542
2542
  status: "valid",
2543
2543
  value: a.status === "valid" ? a.value : this._def.catchValue({
2544
2544
  get error() {
2545
- return new O(r.common.issues);
2545
+ return new O(s.common.issues);
2546
2546
  },
2547
- input: r.data
2547
+ input: s.data
2548
2548
  })
2549
2549
  })) : {
2550
2550
  status: "valid",
2551
- value: s.status === "valid" ? s.value : this._def.catchValue({
2551
+ value: r.status === "valid" ? r.value : this._def.catchValue({
2552
2552
  get error() {
2553
- return new O(r.common.issues);
2553
+ return new O(s.common.issues);
2554
2554
  },
2555
- input: r.data
2555
+ input: s.data
2556
2556
  })
2557
2557
  };
2558
2558
  }
@@ -2560,34 +2560,34 @@ class K extends _ {
2560
2560
  return this._def.innerType;
2561
2561
  }
2562
2562
  }
2563
- K.create = (n, e) => new K({
2563
+ ee.create = (n, e) => new ee({
2564
2564
  innerType: n,
2565
2565
  typeName: p.ZodCatch,
2566
2566
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2567
2567
  ...g(e)
2568
2568
  });
2569
- class Te extends _ {
2569
+ class Se extends _ {
2570
2570
  _parse(e) {
2571
2571
  if (this._getType(e) !== u.nan) {
2572
- const r = this._getOrReturnCtx(e);
2573
- return c(r, {
2574
- code: d.invalid_type,
2572
+ const s = this._getOrReturnCtx(e);
2573
+ return d(s, {
2574
+ code: c.invalid_type,
2575
2575
  expected: u.nan,
2576
- received: r.parsedType
2576
+ received: s.parsedType
2577
2577
  }), m;
2578
2578
  }
2579
2579
  return { status: "valid", value: e.data };
2580
2580
  }
2581
2581
  }
2582
- Te.create = (n) => new Te({
2582
+ Se.create = (n) => new Se({
2583
2583
  typeName: p.ZodNaN,
2584
2584
  ...g(n)
2585
2585
  });
2586
2586
  class Oe extends _ {
2587
2587
  _parse(e) {
2588
- const { ctx: t } = this._processInputParams(e), r = t.data;
2588
+ const { ctx: t } = this._processInputParams(e), s = t.data;
2589
2589
  return this._def.type._parse({
2590
- data: r,
2590
+ data: s,
2591
2591
  path: t.path,
2592
2592
  parent: t
2593
2593
  });
@@ -2596,56 +2596,56 @@ class Oe extends _ {
2596
2596
  return this._def.type;
2597
2597
  }
2598
2598
  }
2599
- class le extends _ {
2599
+ class he extends _ {
2600
2600
  _parse(e) {
2601
- const { status: t, ctx: r } = this._processInputParams(e);
2602
- if (r.common.async)
2601
+ const { status: t, ctx: s } = this._processInputParams(e);
2602
+ if (s.common.async)
2603
2603
  return (async () => {
2604
2604
  const a = await this._def.in._parseAsync({
2605
- data: r.data,
2606
- path: r.path,
2607
- parent: r
2605
+ data: s.data,
2606
+ path: s.path,
2607
+ parent: s
2608
2608
  });
2609
2609
  return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(), W(a.value)) : this._def.out._parseAsync({
2610
2610
  data: a.value,
2611
- path: r.path,
2612
- parent: r
2611
+ path: s.path,
2612
+ parent: s
2613
2613
  });
2614
2614
  })();
2615
2615
  {
2616
- const s = this._def.in._parseSync({
2617
- data: r.data,
2618
- path: r.path,
2619
- parent: r
2616
+ const r = this._def.in._parseSync({
2617
+ data: s.data,
2618
+ path: s.path,
2619
+ parent: s
2620
2620
  });
2621
- return s.status === "aborted" ? m : s.status === "dirty" ? (t.dirty(), {
2621
+ return r.status === "aborted" ? m : r.status === "dirty" ? (t.dirty(), {
2622
2622
  status: "dirty",
2623
- value: s.value
2623
+ value: r.value
2624
2624
  }) : this._def.out._parseSync({
2625
- data: s.value,
2626
- path: r.path,
2627
- parent: r
2625
+ data: r.value,
2626
+ path: s.path,
2627
+ parent: s
2628
2628
  });
2629
2629
  }
2630
2630
  }
2631
2631
  static create(e, t) {
2632
- return new le({
2632
+ return new he({
2633
2633
  in: e,
2634
2634
  out: t,
2635
2635
  typeName: p.ZodPipeline
2636
2636
  });
2637
2637
  }
2638
2638
  }
2639
- class ee extends _ {
2639
+ class te extends _ {
2640
2640
  _parse(e) {
2641
- const t = this._def.innerType._parse(e), r = (s) => (D(s) && (s.value = Object.freeze(s.value)), s);
2642
- return U(t) ? t.then((s) => r(s)) : r(t);
2641
+ const t = this._def.innerType._parse(e), s = (r) => (D(r) && (r.value = Object.freeze(r.value)), r);
2642
+ return q(t) ? t.then((r) => s(r)) : s(t);
2643
2643
  }
2644
2644
  unwrap() {
2645
2645
  return this._def.innerType;
2646
2646
  }
2647
2647
  }
2648
- ee.create = (n, e) => new ee({
2648
+ te.create = (n, e) => new te({
2649
2649
  innerType: n,
2650
2650
  typeName: p.ZodReadonly,
2651
2651
  ...g(e)
@@ -2654,20 +2654,20 @@ var p;
2654
2654
  (function(n) {
2655
2655
  n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
2656
2656
  })(p || (p = {}));
2657
- const te = R.create, x = B.create;
2657
+ const z = R.create, x = B.create, at = ie.create;
2658
2658
  j.create;
2659
- const $e = T.create, he = k.create;
2660
- H.create;
2661
- const at = ue.create;
2659
+ const $e = S.create, fe = k.create;
2662
2660
  Y.create;
2661
+ const it = le.create;
2662
+ J.create;
2663
2663
  E.create;
2664
- const V = J.create;
2664
+ const V = Q.create;
2665
2665
  I.create;
2666
- const b = Q.create;
2667
- X.create;
2666
+ const b = X.create;
2667
+ G.create;
2668
2668
  N.create;
2669
2669
  L.create;
2670
- const it = {
2670
+ const ot = {
2671
2671
  Off: "O",
2672
2672
  Normal: "N",
2673
2673
  BackfeedAfter: "A",
@@ -2681,29 +2681,29 @@ const it = {
2681
2681
  Backfeed70: "70",
2682
2682
  Backfeed80: "80",
2683
2683
  Backfeed90: "90"
2684
- }, ot = b(it), dt = {
2684
+ }, ct = b(ot), dt = {
2685
2685
  Continuous: "N",
2686
2686
  VariableLengthContinuous: "V",
2687
2687
  NonContinuousWebSensing: "W",
2688
2688
  NonContinuousWebSensingAlt: "Y",
2689
2689
  NonContinuousMarkSensing: "M",
2690
2690
  AutoDetect: "A"
2691
- }, ct = b(dt), ut = {
2691
+ }, ut = b(dt), lt = {
2692
2692
  DirectThermal: "D",
2693
2693
  ThermalTransfer: "T"
2694
- }, lt = b(ut), ht = {
2694
+ }, ht = b(lt), ft = {
2695
2695
  Invert: "I",
2696
2696
  Normal: "N"
2697
- }, ft = b(ht), mt = {
2697
+ }, mt = b(ft), pt = {
2698
2698
  Mirror: "Y",
2699
2699
  Normal: "N"
2700
- }, pt = b(mt), gt = {
2700
+ }, gt = b(pt), yt = {
2701
2701
  Normal: "A",
2702
2702
  Half: "B"
2703
- }, yt = b(gt), _t = {
2703
+ }, _t = b(yt), vt = {
2704
2704
  Enable: "Y",
2705
2705
  Disable: "N"
2706
- }, vt = b(_t), xt = {
2706
+ }, xt = b(vt), kt = {
2707
2707
  TearOff: "T",
2708
2708
  PeelOff: "P",
2709
2709
  Rewind: "R",
@@ -2712,46 +2712,56 @@ const it = {
2712
2712
  DelayedCut: "D",
2713
2713
  EncodeRFID: "F",
2714
2714
  Kiosk: "K"
2715
- }, kt = b(xt), bt = {
2715
+ }, bt = b(kt), wt = {
2716
2716
  Prepeel: "Y",
2717
2717
  NoPrepeel: "N"
2718
- }, wt = b(bt), St = {
2718
+ }, Tt = b(wt), St = {
2719
2719
  AllMedia: "Y",
2720
2720
  ContinuousOnly: "N"
2721
- }, Tt = b(St), Ct = {
2721
+ }, At = b(St), Ct = {
2722
2722
  NoRotation: "N",
2723
2723
  Rotate90: "R",
2724
2724
  Rotate180: "I",
2725
2725
  Rotate270: "B"
2726
- }, Re = b(Ct), At = {
2726
+ }, Re = b(Ct), Nt = {
2727
2727
  Left: "L",
2728
2728
  Right: "R",
2729
2729
  Center: "C",
2730
2730
  Justified: "J"
2731
- }, Nt = b(At), Ot = {
2731
+ }, Ot = b(Nt), $t = {
2732
2732
  Highest: "H",
2733
2733
  High: "Q",
2734
2734
  Medium: "M",
2735
2735
  Lower: "L"
2736
- }, $t = b(Ot), Rt = {
2736
+ }, Rt = b($t), Zt = {
2737
2737
  Yes: "Y",
2738
2738
  No: "N"
2739
- }, se = b(Rt), Ze = {
2739
+ }, re = b(Zt), Ze = {
2740
2740
  Start: "start",
2741
2741
  End: "end"
2742
- }, Zt = b(Ze), jt = he({
2743
- word: te(),
2742
+ }, jt = b(Ze), Et = {
2743
+ account: "account",
2744
+ accountAttributes: "accountAttributes",
2745
+ accountTiers: "accountTiers",
2746
+ pass: "pass",
2747
+ passResponses: "passResponses",
2748
+ passAttributes: "passAttributes"
2749
+ }, It = b(Et), Mt = fe({
2750
+ word: z(),
2744
2751
  width: x(),
2745
2752
  spaceWidth: x()
2746
- }), fe = he({
2747
- name: te(),
2753
+ }), me = fe({
2754
+ name: z(),
2748
2755
  x: x().int(),
2749
2756
  y: x().int(),
2750
- data: te()
2751
- }), Et = fe.extend({
2757
+ defaultValue: z(),
2758
+ sourceType: It,
2759
+ sourceLookup: z(),
2760
+ hideEmpty: at()
2761
+ }), Lt = me.extend({
2752
2762
  type: V("text"),
2753
2763
  // ^A font, height, width
2754
- font: te().regex(/^[A-Z0-9]$/, "Font must be a single character A-Z or 0-9"),
2764
+ font: z().regex(/^[A-Z0-9]$/, "Font must be a single character A-Z or 0-9"),
2755
2765
  fontOrientation: Re,
2756
2766
  fontHeight: x().int().min(1).max(32e3),
2757
2767
  fontWidth: x().int().min(1).max(32e3).optional(),
@@ -2759,52 +2769,52 @@ const it = {
2759
2769
  maxWidth: x().int().min(0).max(9999),
2760
2770
  maxLines: x().int().min(1).max(9999),
2761
2771
  lineSpacing: x().int().min(-9999).max(9999),
2762
- alignment: Nt,
2772
+ alignment: Ot,
2763
2773
  hangingIndent: x().int().min(0).max(9999),
2764
- verticalAlignment: Zt,
2765
- wordWidths: $e(jt).optional()
2766
- }), It = fe.extend({
2774
+ verticalAlignment: jt,
2775
+ wordWidths: $e(Mt).optional()
2776
+ }), Pt = me.extend({
2767
2777
  type: V("barcode"),
2768
2778
  // ^BY barWidth
2769
2779
  barWidth: x().int().min(4).max(9999),
2770
2780
  // ^BC orientation, height, line, lineAbove, checkDigit
2771
2781
  orientation: Re,
2772
2782
  height: x().int().min(1).max(32e3),
2773
- line: se,
2774
- lineAbove: se,
2775
- checkDigit: se
2776
- }), Mt = fe.extend({
2783
+ line: re,
2784
+ lineAbove: re,
2785
+ checkDigit: re
2786
+ }), Vt = me.extend({
2777
2787
  type: V("qrcode"),
2778
2788
  // ^BQ orientation, model, magnification, errorCorrection, mask
2779
2789
  orientation: V("N"),
2780
2790
  model: V("2"),
2781
2791
  magnification: x().int().min(1).max(100),
2782
- errorCorrection: $t,
2792
+ errorCorrection: Rt,
2783
2793
  mask: x().int().min(0).max(7)
2784
- }), Lt = at("type", [
2785
- Et,
2786
- It,
2787
- Mt
2788
- ]), je = he({
2794
+ }), Dt = it("type", [
2795
+ Lt,
2796
+ Pt,
2797
+ Vt
2798
+ ]), je = fe({
2789
2799
  type: V("thermal"),
2790
2800
  // ~TA adjustment
2791
2801
  tearOffAdjustment: x().int().min(0).max(120),
2792
2802
  // ~JS sequence
2793
- backfeedActions: ot,
2803
+ backfeedActions: ct,
2794
2804
  // ^MN media, offset
2795
- media: ct,
2805
+ media: ut,
2796
2806
  mediaOffset: x().int().min(-75).max(283),
2797
2807
  // ^MT mediaType
2798
- thermalMediaType: lt,
2808
+ thermalMediaType: ht,
2799
2809
  // ^PO orientation
2800
- printOrientation: ft,
2810
+ printOrientation: mt,
2801
2811
  // ^PM mirror
2802
- mirror: pt,
2812
+ mirror: gt,
2803
2813
  // ^LH x,y
2804
2814
  labelHomeX: x().int().min(0).max(32e3),
2805
2815
  labelHomeY: x().int().min(0).max(32e3),
2806
2816
  // ^JM adjustment
2807
- printDensityAdjustment: yt,
2817
+ printDensityAdjustment: _t,
2808
2818
  // ^PR printSpeed, slewSpeed, backfeedSpeed
2809
2819
  printSpeed: x().int().min(1).max(14),
2810
2820
  slewSpeed: x().int().min(1).max(14),
@@ -2812,37 +2822,37 @@ const it = {
2812
2822
  // ~SD darkness
2813
2823
  darkness: x().int().min(0).max(30),
2814
2824
  // ^LR reverse
2815
- reverse: vt,
2825
+ reverse: xt,
2816
2826
  // ^MM mode, prepeel
2817
- postPrintMode: kt,
2818
- prepeel: wt,
2827
+ postPrintMode: bt,
2828
+ prepeel: Tt,
2819
2829
  // ^PW width
2820
2830
  printWidth: x().int().min(2),
2821
2831
  // ^LL length, allMedia
2822
2832
  labelLength: x().int().min(1).max(32e3),
2823
- allMedia: Tt,
2833
+ allMedia: At,
2824
2834
  // Fields
2825
- fields: $e(Lt)
2835
+ fields: $e(Dt)
2826
2836
  });
2827
- function Yt(n) {
2837
+ function Gt(n) {
2828
2838
  return je.safeParse(n);
2829
2839
  }
2830
- function Jt(n) {
2840
+ function Kt(n) {
2831
2841
  return je.parse(n);
2832
2842
  }
2833
- function Qt(n) {
2843
+ function en(n, e) {
2834
2844
  if (n.type === "thermal")
2835
- return Pt(n);
2845
+ return Bt(n, e);
2836
2846
  throw new Error(`Unsupported badge type: ${n.type}`);
2837
2847
  }
2838
- function Pt(n) {
2839
- const e = ["^XA", Vt(n)];
2840
- for (const t of n.fields)
2841
- e.push(Dt(t));
2842
- return e.push("^XZ"), e.join(`
2848
+ function Bt(n, e) {
2849
+ const t = ["^XA", Wt(n)];
2850
+ for (const s of n.fields)
2851
+ t.push(zt(s, e));
2852
+ return t.push("^XZ"), t.join(`
2843
2853
  `);
2844
2854
  }
2845
- function Vt(n) {
2855
+ function Wt(n) {
2846
2856
  const t = [
2847
2857
  `~TA${String(n.tearOffAdjustment).padStart(3, "0")}`,
2848
2858
  `~JS${n.backfeedActions}`,
@@ -2862,114 +2872,137 @@ function Vt(n) {
2862
2872
  ), t.join(`
2863
2873
  `);
2864
2874
  }
2865
- function Dt(n) {
2875
+ function zt(n, e) {
2876
+ let t = Ft(n, e) ?? n.defaultValue ?? "";
2877
+ if (t === "" && n.hideEmpty) return "";
2866
2878
  switch (n.type) {
2867
2879
  case "text":
2868
- return Bt(n);
2880
+ return Ut(n, t);
2869
2881
  case "barcode":
2870
- return qt(n);
2882
+ return Qt(n, t);
2871
2883
  case "qrcode":
2872
- return Ht(n);
2884
+ return Xt(n, t);
2873
2885
  default: {
2874
- const e = n;
2875
- throw new Error(`Unsupported field type: ${e.type}`);
2886
+ const s = n;
2887
+ throw new Error(`Unsupported field type: ${s.type}`);
2876
2888
  }
2877
2889
  }
2878
2890
  }
2879
- function Bt(n) {
2880
- const e = n.fontOrientation;
2881
- let t = `^A${n.font}${e},${n.fontHeight}`;
2882
- n.fontWidth !== void 0 && (t += `,${n.fontWidth}`);
2883
- const r = `^FB${n.maxWidth},${n.maxLines},${n.lineSpacing},${n.alignment},${n.hangingIndent}`, s = Wt(n);
2884
- return `^FT${n.x},${n.y}${t}${r}^FD${s}^FS`;
2891
+ function Ft(n, e) {
2892
+ if (!e) return n.defaultValue;
2893
+ switch (n.sourceType) {
2894
+ case "account":
2895
+ return e.account[n.sourceLookup];
2896
+ case "accountAttributes":
2897
+ return e.accountAttributes.find((t) => t.id === n.sourceLookup)?.value;
2898
+ case "accountTiers":
2899
+ return e.accountTier?.name;
2900
+ case "pass":
2901
+ return e.pass[n.sourceLookup];
2902
+ case "passResponses":
2903
+ return e.passResponses.find((t) => t.questionId === n.sourceLookup)?.value;
2904
+ case "passAttributes":
2905
+ return e.passAttributes.find((t) => t.name === n.sourceLookup)?.value;
2906
+ default:
2907
+ return "";
2908
+ }
2909
+ }
2910
+ function Ut(n, e) {
2911
+ const t = n.fontOrientation;
2912
+ let s = `^A${n.font}${t},${n.fontHeight}`;
2913
+ n.fontWidth !== void 0 && (s += `,${n.fontWidth}`);
2914
+ const r = `^FB${n.maxWidth},${n.maxLines},${n.lineSpacing},${n.alignment},${n.hangingIndent}`, a = qt(n, e);
2915
+ return `^FT${n.x},${n.y}${s}${r}^FD${a}^FS`;
2885
2916
  }
2886
- function Wt(n) {
2917
+ function qt(n, e) {
2887
2918
  if (n.verticalAlignment !== Ze.End)
2888
- return n.data;
2889
- const e = zt(n), t = Math.max(0, n.maxLines - e);
2890
- return "\\&".repeat(t) + n.data;
2919
+ return e;
2920
+ const t = Ht(n, e), s = Math.max(0, n.maxLines - t);
2921
+ return "\\&".repeat(s) + e;
2891
2922
  }
2892
- function zt(n) {
2893
- const e = n.data.split("\\&");
2894
- return n.wordWidths ? Ft(e, n.wordWidths, n.maxWidth) : Ut(e, n.maxWidth, n.fontWidth ?? n.fontHeight);
2923
+ function Ht(n, e) {
2924
+ const t = e.split("\\&");
2925
+ return n.wordWidths ? Yt(t, n.wordWidths, n.maxWidth) : Jt(t, n.maxWidth, n.fontWidth ?? n.fontHeight);
2895
2926
  }
2896
- function Ft(n, e, t) {
2897
- const r = /* @__PURE__ */ new Map();
2927
+ function Yt(n, e, t) {
2928
+ const s = /* @__PURE__ */ new Map();
2898
2929
  for (const a of e)
2899
- r.set(a.word, a);
2900
- let s = 0;
2930
+ s.set(a.word, a);
2931
+ let r = 0;
2901
2932
  for (const a of n) {
2902
2933
  if (a.length === 0) {
2903
- s += 1;
2934
+ r += 1;
2904
2935
  continue;
2905
2936
  }
2906
2937
  const i = a.split(" ");
2907
2938
  let o = 0, f = 1;
2908
2939
  for (let h = 0; h < i.length; h++) {
2909
- const y = r.get(i[h]), C = y?.width ?? 0, ne = y?.spaceWidth ?? 0, me = o > 0 ? ne + C : C;
2910
- o > 0 && o + me > t ? (f++, o = C) : o += me;
2940
+ const y = s.get(i[h]), A = y?.width ?? 0, ne = y?.spaceWidth ?? 0, pe = o > 0 ? ne + A : A;
2941
+ o > 0 && o + pe > t ? (f++, o = A) : o += pe;
2911
2942
  }
2912
- s += f;
2943
+ r += f;
2913
2944
  }
2914
- return s;
2945
+ return r;
2915
2946
  }
2916
- function Ut(n, e, t) {
2917
- const r = Math.floor(e / t);
2918
- if (r <= 0)
2947
+ function Jt(n, e, t) {
2948
+ const s = Math.floor(e / t);
2949
+ if (s <= 0)
2919
2950
  return n.length;
2920
- let s = 0;
2951
+ let r = 0;
2921
2952
  for (const a of n)
2922
- s += Math.max(1, Math.ceil(a.length / r));
2923
- return s;
2953
+ r += Math.max(1, Math.ceil(a.length / s));
2954
+ return r;
2924
2955
  }
2925
- function qt(n) {
2926
- const e = `^BY${n.barWidth}`, t = `^BC${n.orientation},${n.height},${n.line},${n.lineAbove},${n.checkDigit},N`;
2927
- return `^FT${n.x},${n.y}${e}${t}^FD>;${n.data}^FS`;
2956
+ function Qt(n, e) {
2957
+ const t = `^BY${n.barWidth}`, s = `^BC${n.orientation},${n.height},${n.line},${n.lineAbove},${n.checkDigit},N`;
2958
+ return `^FT${n.x},${n.y}${t}${s}^FD>;${e}^FS`;
2928
2959
  }
2929
- function Ht(n) {
2930
- const e = `^BQ${n.orientation},${n.model},${n.magnification},${n.errorCorrection},${n.mask}`;
2931
- return `^FT${n.x},${n.y}${e}^FDQA,${n.data}^FS`;
2960
+ function Xt(n, e) {
2961
+ const t = `^BQ${n.orientation},${n.model},${n.magnification},${n.errorCorrection},${n.mask}`;
2962
+ return `^FT${n.x},${n.y}${t}^FDQA,${e}^FS`;
2932
2963
  }
2933
2964
  export {
2934
2965
  St as AllMediaMode,
2935
- it as BackfeedAction,
2966
+ ot as BackfeedAction,
2936
2967
  Ct as FontOrientation,
2937
2968
  dt as MediaType,
2938
- mt as MirrorMode,
2939
- xt as PostPrintMode,
2940
- bt as PrepeelMode,
2941
- gt as PrintDensityAdjustment,
2942
- ht as PrintOrientation,
2943
- Ot as QRCodeErrorCorrection,
2944
- _t as ReverseMode,
2945
- At as TextAlignment,
2946
- ut as ThermalMediaType,
2969
+ pt as MirrorMode,
2970
+ kt as PostPrintMode,
2971
+ wt as PrepeelMode,
2972
+ yt as PrintDensityAdjustment,
2973
+ ft as PrintOrientation,
2974
+ $t as QRCodeErrorCorrection,
2975
+ vt as ReverseMode,
2976
+ Et as SourceType,
2977
+ Nt as TextAlignment,
2978
+ lt as ThermalMediaType,
2947
2979
  Ze as VerticalAlignment,
2948
- Rt as YesNo,
2949
- Tt as allMediaModeSchema,
2950
- Wt as applyVerticalAlignment,
2951
- ot as backfeedActionSchema,
2980
+ Zt as YesNo,
2981
+ At as allMediaModeSchema,
2982
+ qt as applyVerticalAlignment,
2983
+ ct as backfeedActionSchema,
2952
2984
  je as badgeSchema,
2953
- It as barcodeFieldSchema,
2954
- zt as countLines,
2955
- Lt as fieldSchema,
2985
+ Pt as barcodeFieldSchema,
2986
+ Ht as countLines,
2987
+ Dt as fieldSchema,
2956
2988
  Re as fontOrientationSchema,
2957
- Qt as generate,
2958
- ct as mediaTypeSchema,
2959
- pt as mirrorModeSchema,
2960
- kt as postPrintModeSchema,
2961
- wt as prepeelModeSchema,
2962
- yt as printDensityAdjustmentSchema,
2963
- ft as printOrientationSchema,
2964
- $t as qrCodeErrorCorrectionSchema,
2965
- Mt as qrcodeFieldSchema,
2966
- vt as reverseModeSchema,
2967
- Nt as textAlignmentSchema,
2968
- Et as textFieldSchema,
2969
- lt as thermalMediaTypeSchema,
2970
- Yt as validateBadge,
2971
- Jt as validateBadgeOrThrow,
2972
- Zt as verticalAlignmentSchema,
2973
- jt as wordWidthSchema,
2974
- se as yesNoSchema
2989
+ en as generate,
2990
+ ut as mediaTypeSchema,
2991
+ gt as mirrorModeSchema,
2992
+ bt as postPrintModeSchema,
2993
+ Tt as prepeelModeSchema,
2994
+ _t as printDensityAdjustmentSchema,
2995
+ mt as printOrientationSchema,
2996
+ Rt as qrCodeErrorCorrectionSchema,
2997
+ Vt as qrcodeFieldSchema,
2998
+ xt as reverseModeSchema,
2999
+ It as sourceTypeSchema,
3000
+ Ot as textAlignmentSchema,
3001
+ Lt as textFieldSchema,
3002
+ ht as thermalMediaTypeSchema,
3003
+ Gt as validateBadge,
3004
+ Kt as validateBadgeOrThrow,
3005
+ jt as verticalAlignmentSchema,
3006
+ Mt as wordWidthSchema,
3007
+ re as yesNoSchema
2975
3008
  };