@resconet/qp-bridge 0.0.1-alpha.19 → 0.0.1-alpha.20

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/index.mjs CHANGED
@@ -1,25 +1,25 @@
1
- let ge;
2
- const Ke = new Uint8Array(16);
3
- function Fe() {
4
- if (!ge && (ge = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ge))
1
+ let ve;
2
+ const Fe = new Uint8Array(16);
3
+ function et() {
4
+ if (!ve && (ve = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ve))
5
5
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
6
- return ge(Ke);
6
+ return ve(Fe);
7
7
  }
8
8
  const k = [];
9
9
  for (let t = 0; t < 256; ++t)
10
10
  k.push((t + 256).toString(16).slice(1));
11
- function et(t, e = 0) {
11
+ function tt(t, e = 0) {
12
12
  return k[t[e + 0]] + k[t[e + 1]] + k[t[e + 2]] + k[t[e + 3]] + "-" + k[t[e + 4]] + k[t[e + 5]] + "-" + k[t[e + 6]] + k[t[e + 7]] + "-" + k[t[e + 8]] + k[t[e + 9]] + "-" + k[t[e + 10]] + k[t[e + 11]] + k[t[e + 12]] + k[t[e + 13]] + k[t[e + 14]] + k[t[e + 15]];
13
13
  }
14
- const tt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), je = {
15
- randomUUID: tt
14
+ const st = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), je = {
15
+ randomUUID: st
16
16
  };
17
- function $e(t, e, s) {
17
+ function qe(t, e, s) {
18
18
  if (je.randomUUID && !e && !t)
19
19
  return je.randomUUID();
20
20
  t = t || {};
21
- const n = t.random || (t.rng || Fe)();
22
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, et(n);
21
+ const n = t.random || (t.rng || et)();
22
+ return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, tt(n);
23
23
  }
24
24
  var x;
25
25
  (function(t) {
@@ -124,8 +124,8 @@ const f = x.arrayToEnum([
124
124
  "invalid_intersection_types",
125
125
  "not_multiple_of",
126
126
  "not_finite"
127
- ]), st = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
128
- class C extends Error {
127
+ ]), nt = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
128
+ class E extends Error {
129
129
  constructor(e) {
130
130
  super(), this.issues = [], this.addIssue = (n) => {
131
131
  this.issues = [...this.issues, n];
@@ -162,7 +162,7 @@ class C extends Error {
162
162
  return r(this), n;
163
163
  }
164
164
  static assert(e) {
165
- if (!(e instanceof C))
165
+ if (!(e instanceof E))
166
166
  throw new Error(`Not a ZodError: ${e}`);
167
167
  }
168
168
  toString() {
@@ -184,7 +184,7 @@ class C extends Error {
184
184
  return this.flatten();
185
185
  }
186
186
  }
187
- C.create = (t) => new C(t);
187
+ E.create = (t) => new E(t);
188
188
  const Y = (t, e) => {
189
189
  let s;
190
190
  switch (t.code) {
@@ -241,14 +241,14 @@ const Y = (t, e) => {
241
241
  }
242
242
  return { message: s };
243
243
  };
244
- let Ue = Y;
245
- function nt(t) {
246
- Ue = t;
244
+ let $e = Y;
245
+ function rt(t) {
246
+ $e = t;
247
247
  }
248
- function ye() {
249
- return Ue;
248
+ function _e() {
249
+ return $e;
250
250
  }
251
- const ve = (t) => {
251
+ const xe = (t) => {
252
252
  const { data: e, path: s, errorMaps: n, issueData: r } = t, a = [...s, ...r.path || []], i = {
253
253
  ...r,
254
254
  path: a
@@ -268,9 +268,9 @@ const ve = (t) => {
268
268
  path: a,
269
269
  message: o
270
270
  };
271
- }, rt = [];
271
+ }, at = [];
272
272
  function l(t, e) {
273
- const s = ye(), n = ve({
273
+ const s = _e(), n = xe({
274
274
  issueData: e,
275
275
  data: t.data,
276
276
  path: t.path,
@@ -284,7 +284,7 @@ function l(t, e) {
284
284
  });
285
285
  t.common.issues.push(n);
286
286
  }
287
- class w {
287
+ class S {
288
288
  constructor() {
289
289
  this.value = "valid";
290
290
  }
@@ -298,7 +298,7 @@ class w {
298
298
  const n = [];
299
299
  for (const r of s) {
300
300
  if (r.status === "aborted")
301
- return g;
301
+ return y;
302
302
  r.status === "dirty" && e.dirty(), n.push(r.value);
303
303
  }
304
304
  return { status: e.value, value: n };
@@ -312,28 +312,28 @@ class w {
312
312
  value: i
313
313
  });
314
314
  }
315
- return w.mergeObjectSync(e, n);
315
+ return S.mergeObjectSync(e, n);
316
316
  }
317
317
  static mergeObjectSync(e, s) {
318
318
  const n = {};
319
319
  for (const r of s) {
320
320
  const { key: a, value: i } = r;
321
321
  if (a.status === "aborted" || i.status === "aborted")
322
- return g;
322
+ return y;
323
323
  a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || r.alwaysSet) && (n[a.value] = i.value);
324
324
  }
325
325
  return { status: e.value, value: n };
326
326
  }
327
327
  }
328
- const g = Object.freeze({
328
+ const y = Object.freeze({
329
329
  status: "aborted"
330
- }), W = (t) => ({ status: "dirty", value: t }), T = (t) => ({ status: "valid", value: t }), Ee = (t) => t.status === "aborted", Oe = (t) => t.status === "dirty", te = (t) => t.status === "valid", se = (t) => typeof Promise < "u" && t instanceof Promise;
331
- function _e(t, e, s, n) {
330
+ }), W = (t) => ({ status: "dirty", value: t }), T = (t) => ({ status: "valid", value: t }), Oe = (t) => t.status === "aborted", Ie = (t) => t.status === "dirty", se = (t) => t.status === "valid", ne = (t) => typeof Promise < "u" && t instanceof Promise;
331
+ function be(t, e, s, n) {
332
332
  if (typeof e == "function" ? t !== e || !n : !e.has(t))
333
333
  throw new TypeError("Cannot read private member from an object whose class did not declare it");
334
334
  return e.get(t);
335
335
  }
336
- function qe(t, e, s, n, r) {
336
+ function Ue(t, e, s, n, r) {
337
337
  if (typeof e == "function" ? t !== e || !r : !e.has(t))
338
338
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
339
339
  return e.set(t, s), s;
@@ -342,7 +342,7 @@ var h;
342
342
  (function(t) {
343
343
  t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
344
344
  })(h || (h = {}));
345
- var K, F;
345
+ var F, ee;
346
346
  class M {
347
347
  constructor(e, s, n, r) {
348
348
  this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = r;
@@ -352,7 +352,7 @@ class M {
352
352
  }
353
353
  }
354
354
  const Ae = (t, e) => {
355
- if (te(e))
355
+ if (se(e))
356
356
  return { success: !0, data: e.value };
357
357
  if (!t.common.issues.length)
358
358
  throw new Error("Validation failed but no issues detected.");
@@ -361,7 +361,7 @@ const Ae = (t, e) => {
361
361
  get error() {
362
362
  if (this._error)
363
363
  return this._error;
364
- const s = new C(t.common.issues);
364
+ const s = new E(t.common.issues);
365
365
  return this._error = s, this._error;
366
366
  }
367
367
  };
@@ -374,8 +374,8 @@ function v(t) {
374
374
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
375
375
  return e ? { errorMap: e, description: r } : { errorMap: (i, o) => {
376
376
  var d, u;
377
- const { message: m } = t;
378
- return i.code === "invalid_enum_value" ? { message: m ?? o.defaultError } : typeof o.data > "u" ? { message: (d = m ?? n) !== null && d !== void 0 ? d : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (u = m ?? s) !== null && u !== void 0 ? u : o.defaultError };
377
+ const { message: g } = t;
378
+ return i.code === "invalid_enum_value" ? { message: g ?? o.defaultError } : typeof o.data > "u" ? { message: (d = g ?? n) !== null && d !== void 0 ? d : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (u = g ?? s) !== null && u !== void 0 ? u : o.defaultError };
379
379
  }, description: r };
380
380
  }
381
381
  class _ {
@@ -400,7 +400,7 @@ class _ {
400
400
  }
401
401
  _processInputParams(e) {
402
402
  return {
403
- status: new w(),
403
+ status: new S(),
404
404
  ctx: {
405
405
  common: e.parent.common,
406
406
  data: e.data,
@@ -413,7 +413,7 @@ class _ {
413
413
  }
414
414
  _parseSync(e) {
415
415
  const s = this._parse(e);
416
- if (se(s))
416
+ if (ne(s))
417
417
  throw new Error("Synchronous parse encountered promise.");
418
418
  return s;
419
419
  }
@@ -461,7 +461,7 @@ class _ {
461
461
  parent: null,
462
462
  data: e,
463
463
  parsedType: P(e)
464
- }, r = this._parse({ data: e, path: n.path, parent: n }), a = await (se(r) ? r : Promise.resolve(r));
464
+ }, r = this._parse({ data: e, path: n.path, parent: n }), a = await (ne(r) ? r : Promise.resolve(r));
465
465
  return Ae(n, a);
466
466
  }
467
467
  refine(e, s) {
@@ -480,7 +480,7 @@ class _ {
480
480
  _refinement(e) {
481
481
  return new O({
482
482
  schema: this,
483
- typeName: p.ZodEffects,
483
+ typeName: m.ZodEffects,
484
484
  effect: { type: "refinement", refinement: e }
485
485
  });
486
486
  }
@@ -488,7 +488,7 @@ class _ {
488
488
  return this._refinement(e);
489
489
  }
490
490
  optional() {
491
- return N.create(this, this._def);
491
+ return I.create(this, this._def);
492
492
  }
493
493
  nullable() {
494
494
  return L.create(this, this._def);
@@ -497,48 +497,48 @@ class _ {
497
497
  return this.nullable().optional();
498
498
  }
499
499
  array() {
500
- return E.create(this, this._def);
500
+ return Z.create(this, this._def);
501
501
  }
502
502
  promise() {
503
503
  return X.create(this, this._def);
504
504
  }
505
505
  or(e) {
506
- return ie.create([this, e], this._def);
506
+ return oe.create([this, e], this._def);
507
507
  }
508
508
  and(e) {
509
- return oe.create(this, e, this._def);
509
+ return ce.create(this, e, this._def);
510
510
  }
511
511
  transform(e) {
512
512
  return new O({
513
513
  ...v(this._def),
514
514
  schema: this,
515
- typeName: p.ZodEffects,
515
+ typeName: m.ZodEffects,
516
516
  effect: { type: "transform", transform: e }
517
517
  });
518
518
  }
519
519
  default(e) {
520
520
  const s = typeof e == "function" ? e : () => e;
521
- return new fe({
521
+ return new he({
522
522
  ...v(this._def),
523
523
  innerType: this,
524
524
  defaultValue: s,
525
- typeName: p.ZodDefault
525
+ typeName: m.ZodDefault
526
526
  });
527
527
  }
528
528
  brand() {
529
- return new Me({
530
- typeName: p.ZodBranded,
529
+ return new Ne({
530
+ typeName: m.ZodBranded,
531
531
  type: this,
532
532
  ...v(this._def)
533
533
  });
534
534
  }
535
535
  catch(e) {
536
536
  const s = typeof e == "function" ? e : () => e;
537
- return new he({
537
+ return new pe({
538
538
  ...v(this._def),
539
539
  innerType: this,
540
540
  catchValue: s,
541
- typeName: p.ZodCatch
541
+ typeName: m.ZodCatch
542
542
  });
543
543
  }
544
544
  describe(e) {
@@ -549,10 +549,10 @@ class _ {
549
549
  });
550
550
  }
551
551
  pipe(e) {
552
- return me.create(this, e);
552
+ return ge.create(this, e);
553
553
  }
554
554
  readonly() {
555
- return pe.create(this);
555
+ return me.create(this);
556
556
  }
557
557
  isOptional() {
558
558
  return this.safeParse(void 0).success;
@@ -561,14 +561,14 @@ class _ {
561
561
  return this.safeParse(null).success;
562
562
  }
563
563
  }
564
- const at = /^c[^\s-]{8,}$/i, it = /^[0-9a-z]+$/, ot = /^[0-9A-HJKMNP-TV-Z]{26}$/, ct = /^[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, dt = /^[a-z0-9_-]{21}$/i, ut = /^[-+]?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)?)??$/, lt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ft = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
564
+ const it = /^c[^\s-]{8,}$/i, ot = /^[0-9a-z]+$/, ct = /^[0-9A-HJKMNP-TV-Z]{26}$/, dt = /^[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, ut = /^[a-z0-9_-]{21}$/i, lt = /^[-+]?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)?)??$/, ft = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ht = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
565
565
  let Ce;
566
- const ht = /^(?:(?: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])$/, pt = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, mt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Le = "((\\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])))", gt = new RegExp(`^${Le}$`);
566
+ const pt = /^(?:(?: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])$/, mt = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, gt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Le = "((\\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])))", yt = new RegExp(`^${Le}$`);
567
567
  function Ve(t) {
568
568
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
569
569
  return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
570
570
  }
571
- function yt(t) {
571
+ function vt(t) {
572
572
  return new RegExp(`^${Ve(t)}$`);
573
573
  }
574
574
  function De(t) {
@@ -576,10 +576,10 @@ function De(t) {
576
576
  const s = [];
577
577
  return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
578
578
  }
579
- function vt(t, e) {
580
- return !!((e === "v4" || !e) && ht.test(t) || (e === "v6" || !e) && pt.test(t));
579
+ function _t(t, e) {
580
+ return !!((e === "v4" || !e) && pt.test(t) || (e === "v6" || !e) && mt.test(t));
581
581
  }
582
- class Z extends _ {
582
+ class C extends _ {
583
583
  _parse(e) {
584
584
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
585
585
  const a = this._getOrReturnCtx(e);
@@ -587,9 +587,9 @@ class Z extends _ {
587
587
  code: c.invalid_type,
588
588
  expected: f.string,
589
589
  received: a.parsedType
590
- }), g;
590
+ }), y;
591
591
  }
592
- const n = new w();
592
+ const n = new S();
593
593
  let r;
594
594
  for (const a of this._def.checks)
595
595
  if (a.kind === "min")
@@ -628,43 +628,43 @@ class Z extends _ {
628
628
  message: a.message
629
629
  }), n.dirty());
630
630
  } else if (a.kind === "email")
631
- lt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
631
+ ft.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
632
632
  validation: "email",
633
633
  code: c.invalid_string,
634
634
  message: a.message
635
635
  }), n.dirty());
636
636
  else if (a.kind === "emoji")
637
- Ce || (Ce = new RegExp(ft, "u")), Ce.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
637
+ Ce || (Ce = new RegExp(ht, "u")), Ce.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
638
638
  validation: "emoji",
639
639
  code: c.invalid_string,
640
640
  message: a.message
641
641
  }), n.dirty());
642
642
  else if (a.kind === "uuid")
643
- ct.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
643
+ dt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
644
644
  validation: "uuid",
645
645
  code: c.invalid_string,
646
646
  message: a.message
647
647
  }), n.dirty());
648
648
  else if (a.kind === "nanoid")
649
- dt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
649
+ ut.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
650
650
  validation: "nanoid",
651
651
  code: c.invalid_string,
652
652
  message: a.message
653
653
  }), n.dirty());
654
654
  else if (a.kind === "cuid")
655
- at.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
655
+ it.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
656
656
  validation: "cuid",
657
657
  code: c.invalid_string,
658
658
  message: a.message
659
659
  }), n.dirty());
660
660
  else if (a.kind === "cuid2")
661
- it.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
661
+ ot.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
662
662
  validation: "cuid2",
663
663
  code: c.invalid_string,
664
664
  message: a.message
665
665
  }), n.dirty());
666
666
  else if (a.kind === "ulid")
667
- ot.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
667
+ ct.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
668
668
  validation: "ulid",
669
669
  code: c.invalid_string,
670
670
  message: a.message
@@ -700,23 +700,23 @@ class Z extends _ {
700
700
  code: c.invalid_string,
701
701
  validation: "datetime",
702
702
  message: a.message
703
- }), n.dirty()) : a.kind === "date" ? gt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
703
+ }), n.dirty()) : a.kind === "date" ? yt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
704
704
  code: c.invalid_string,
705
705
  validation: "date",
706
706
  message: a.message
707
- }), n.dirty()) : a.kind === "time" ? yt(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
707
+ }), n.dirty()) : a.kind === "time" ? vt(a).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
708
708
  code: c.invalid_string,
709
709
  validation: "time",
710
710
  message: a.message
711
- }), n.dirty()) : a.kind === "duration" ? ut.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
711
+ }), n.dirty()) : a.kind === "duration" ? lt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
712
712
  validation: "duration",
713
713
  code: c.invalid_string,
714
714
  message: a.message
715
- }), n.dirty()) : a.kind === "ip" ? vt(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
715
+ }), n.dirty()) : a.kind === "ip" ? _t(e.data, a.version) || (r = this._getOrReturnCtx(e, r), l(r, {
716
716
  validation: "ip",
717
717
  code: c.invalid_string,
718
718
  message: a.message
719
- }), n.dirty()) : a.kind === "base64" ? mt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
719
+ }), n.dirty()) : a.kind === "base64" ? gt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
720
720
  validation: "base64",
721
721
  code: c.invalid_string,
722
722
  message: a.message
@@ -731,7 +731,7 @@ class Z extends _ {
731
731
  });
732
732
  }
733
733
  _addCheck(e) {
734
- return new Z({
734
+ return new C({
735
735
  ...this._def,
736
736
  checks: [...this._def.checks, e]
737
737
  });
@@ -857,19 +857,19 @@ class Z extends _ {
857
857
  return this.min(1, h.errToObj(e));
858
858
  }
859
859
  trim() {
860
- return new Z({
860
+ return new C({
861
861
  ...this._def,
862
862
  checks: [...this._def.checks, { kind: "trim" }]
863
863
  });
864
864
  }
865
865
  toLowerCase() {
866
- return new Z({
866
+ return new C({
867
867
  ...this._def,
868
868
  checks: [...this._def.checks, { kind: "toLowerCase" }]
869
869
  });
870
870
  }
871
871
  toUpperCase() {
872
- return new Z({
872
+ return new C({
873
873
  ...this._def,
874
874
  checks: [...this._def.checks, { kind: "toUpperCase" }]
875
875
  });
@@ -929,20 +929,20 @@ class Z extends _ {
929
929
  return e;
930
930
  }
931
931
  }
932
- Z.create = (t) => {
932
+ C.create = (t) => {
933
933
  var e;
934
- return new Z({
934
+ return new C({
935
935
  checks: [],
936
- typeName: p.ZodString,
936
+ typeName: m.ZodString,
937
937
  coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1,
938
938
  ...v(t)
939
939
  });
940
940
  };
941
- function _t(t, e) {
941
+ function xt(t, e) {
942
942
  const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = s > n ? s : n, a = parseInt(t.toFixed(r).replace(".", "")), i = parseInt(e.toFixed(r).replace(".", ""));
943
943
  return a % i / Math.pow(10, r);
944
944
  }
945
- class $ extends _ {
945
+ class q extends _ {
946
946
  constructor() {
947
947
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
948
948
  }
@@ -953,10 +953,10 @@ class $ extends _ {
953
953
  code: c.invalid_type,
954
954
  expected: f.number,
955
955
  received: a.parsedType
956
- }), g;
956
+ }), y;
957
957
  }
958
958
  let n;
959
- const r = new w();
959
+ const r = new S();
960
960
  for (const a of this._def.checks)
961
961
  a.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
962
962
  code: c.invalid_type,
@@ -977,7 +977,7 @@ class $ extends _ {
977
977
  inclusive: a.inclusive,
978
978
  exact: !1,
979
979
  message: a.message
980
- }), r.dirty()) : a.kind === "multipleOf" ? _t(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
980
+ }), r.dirty()) : a.kind === "multipleOf" ? xt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
981
981
  code: c.not_multiple_of,
982
982
  multipleOf: a.value,
983
983
  message: a.message
@@ -1000,7 +1000,7 @@ class $ extends _ {
1000
1000
  return this.setLimit("max", e, !1, h.toString(s));
1001
1001
  }
1002
1002
  setLimit(e, s, n, r) {
1003
- return new $({
1003
+ return new q({
1004
1004
  ...this._def,
1005
1005
  checks: [
1006
1006
  ...this._def.checks,
@@ -1014,7 +1014,7 @@ class $ extends _ {
1014
1014
  });
1015
1015
  }
1016
1016
  _addCheck(e) {
1017
- return new $({
1017
+ return new q({
1018
1018
  ...this._def,
1019
1019
  checks: [...this._def.checks, e]
1020
1020
  });
@@ -1108,13 +1108,13 @@ class $ extends _ {
1108
1108
  return Number.isFinite(s) && Number.isFinite(e);
1109
1109
  }
1110
1110
  }
1111
- $.create = (t) => new $({
1111
+ q.create = (t) => new q({
1112
1112
  checks: [],
1113
- typeName: p.ZodNumber,
1113
+ typeName: m.ZodNumber,
1114
1114
  coerce: (t == null ? void 0 : t.coerce) || !1,
1115
1115
  ...v(t)
1116
1116
  });
1117
- class U extends _ {
1117
+ class $ extends _ {
1118
1118
  constructor() {
1119
1119
  super(...arguments), this.min = this.gte, this.max = this.lte;
1120
1120
  }
@@ -1125,10 +1125,10 @@ class U extends _ {
1125
1125
  code: c.invalid_type,
1126
1126
  expected: f.bigint,
1127
1127
  received: a.parsedType
1128
- }), g;
1128
+ }), y;
1129
1129
  }
1130
1130
  let n;
1131
- const r = new w();
1131
+ const r = new S();
1132
1132
  for (const a of this._def.checks)
1133
1133
  a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1134
1134
  code: c.too_small,
@@ -1162,7 +1162,7 @@ class U extends _ {
1162
1162
  return this.setLimit("max", e, !1, h.toString(s));
1163
1163
  }
1164
1164
  setLimit(e, s, n, r) {
1165
- return new U({
1165
+ return new $({
1166
1166
  ...this._def,
1167
1167
  checks: [
1168
1168
  ...this._def.checks,
@@ -1176,7 +1176,7 @@ class U extends _ {
1176
1176
  });
1177
1177
  }
1178
1178
  _addCheck(e) {
1179
- return new U({
1179
+ return new $({
1180
1180
  ...this._def,
1181
1181
  checks: [...this._def.checks, e]
1182
1182
  });
@@ -1233,16 +1233,16 @@ class U extends _ {
1233
1233
  return e;
1234
1234
  }
1235
1235
  }
1236
- U.create = (t) => {
1236
+ $.create = (t) => {
1237
1237
  var e;
1238
- return new U({
1238
+ return new $({
1239
1239
  checks: [],
1240
- typeName: p.ZodBigInt,
1240
+ typeName: m.ZodBigInt,
1241
1241
  coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1,
1242
1242
  ...v(t)
1243
1243
  });
1244
1244
  };
1245
- class ne extends _ {
1245
+ class re extends _ {
1246
1246
  _parse(e) {
1247
1247
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1248
1248
  const n = this._getOrReturnCtx(e);
@@ -1250,13 +1250,13 @@ class ne extends _ {
1250
1250
  code: c.invalid_type,
1251
1251
  expected: f.boolean,
1252
1252
  received: n.parsedType
1253
- }), g;
1253
+ }), y;
1254
1254
  }
1255
1255
  return T(e.data);
1256
1256
  }
1257
1257
  }
1258
- ne.create = (t) => new ne({
1259
- typeName: p.ZodBoolean,
1258
+ re.create = (t) => new re({
1259
+ typeName: m.ZodBoolean,
1260
1260
  coerce: (t == null ? void 0 : t.coerce) || !1,
1261
1261
  ...v(t)
1262
1262
  });
@@ -1268,15 +1268,15 @@ class z extends _ {
1268
1268
  code: c.invalid_type,
1269
1269
  expected: f.date,
1270
1270
  received: a.parsedType
1271
- }), g;
1271
+ }), y;
1272
1272
  }
1273
1273
  if (isNaN(e.data.getTime())) {
1274
1274
  const a = this._getOrReturnCtx(e);
1275
1275
  return l(a, {
1276
1276
  code: c.invalid_date
1277
- }), g;
1277
+ }), y;
1278
1278
  }
1279
- const n = new w();
1279
+ const n = new S();
1280
1280
  let r;
1281
1281
  for (const a of this._def.checks)
1282
1282
  a.kind === "min" ? e.data.getTime() < a.value && (r = this._getOrReturnCtx(e, r), l(r, {
@@ -1335,10 +1335,10 @@ class z extends _ {
1335
1335
  z.create = (t) => new z({
1336
1336
  checks: [],
1337
1337
  coerce: (t == null ? void 0 : t.coerce) || !1,
1338
- typeName: p.ZodDate,
1338
+ typeName: m.ZodDate,
1339
1339
  ...v(t)
1340
1340
  });
1341
- class xe extends _ {
1341
+ class ke extends _ {
1342
1342
  _parse(e) {
1343
1343
  if (this._getType(e) !== f.symbol) {
1344
1344
  const n = this._getOrReturnCtx(e);
@@ -1346,16 +1346,16 @@ class xe extends _ {
1346
1346
  code: c.invalid_type,
1347
1347
  expected: f.symbol,
1348
1348
  received: n.parsedType
1349
- }), g;
1349
+ }), y;
1350
1350
  }
1351
1351
  return T(e.data);
1352
1352
  }
1353
1353
  }
1354
- xe.create = (t) => new xe({
1355
- typeName: p.ZodSymbol,
1354
+ ke.create = (t) => new ke({
1355
+ typeName: m.ZodSymbol,
1356
1356
  ...v(t)
1357
1357
  });
1358
- class re extends _ {
1358
+ class ae extends _ {
1359
1359
  _parse(e) {
1360
1360
  if (this._getType(e) !== f.undefined) {
1361
1361
  const n = this._getOrReturnCtx(e);
@@ -1363,16 +1363,16 @@ class re extends _ {
1363
1363
  code: c.invalid_type,
1364
1364
  expected: f.undefined,
1365
1365
  received: n.parsedType
1366
- }), g;
1366
+ }), y;
1367
1367
  }
1368
1368
  return T(e.data);
1369
1369
  }
1370
1370
  }
1371
- re.create = (t) => new re({
1372
- typeName: p.ZodUndefined,
1371
+ ae.create = (t) => new ae({
1372
+ typeName: m.ZodUndefined,
1373
1373
  ...v(t)
1374
1374
  });
1375
- class ae extends _ {
1375
+ class ie extends _ {
1376
1376
  _parse(e) {
1377
1377
  if (this._getType(e) !== f.null) {
1378
1378
  const n = this._getOrReturnCtx(e);
@@ -1380,13 +1380,13 @@ class ae extends _ {
1380
1380
  code: c.invalid_type,
1381
1381
  expected: f.null,
1382
1382
  received: n.parsedType
1383
- }), g;
1383
+ }), y;
1384
1384
  }
1385
1385
  return T(e.data);
1386
1386
  }
1387
1387
  }
1388
- ae.create = (t) => new ae({
1389
- typeName: p.ZodNull,
1388
+ ie.create = (t) => new ie({
1389
+ typeName: m.ZodNull,
1390
1390
  ...v(t)
1391
1391
  });
1392
1392
  class J extends _ {
@@ -1398,7 +1398,7 @@ class J extends _ {
1398
1398
  }
1399
1399
  }
1400
1400
  J.create = (t) => new J({
1401
- typeName: p.ZodAny,
1401
+ typeName: m.ZodAny,
1402
1402
  ...v(t)
1403
1403
  });
1404
1404
  class B extends _ {
@@ -1410,7 +1410,7 @@ class B extends _ {
1410
1410
  }
1411
1411
  }
1412
1412
  B.create = (t) => new B({
1413
- typeName: p.ZodUnknown,
1413
+ typeName: m.ZodUnknown,
1414
1414
  ...v(t)
1415
1415
  });
1416
1416
  class A extends _ {
@@ -1420,14 +1420,14 @@ class A extends _ {
1420
1420
  code: c.invalid_type,
1421
1421
  expected: f.never,
1422
1422
  received: s.parsedType
1423
- }), g;
1423
+ }), y;
1424
1424
  }
1425
1425
  }
1426
1426
  A.create = (t) => new A({
1427
- typeName: p.ZodNever,
1427
+ typeName: m.ZodNever,
1428
1428
  ...v(t)
1429
1429
  });
1430
- class be extends _ {
1430
+ class we extends _ {
1431
1431
  _parse(e) {
1432
1432
  if (this._getType(e) !== f.undefined) {
1433
1433
  const n = this._getOrReturnCtx(e);
@@ -1435,16 +1435,16 @@ class be extends _ {
1435
1435
  code: c.invalid_type,
1436
1436
  expected: f.void,
1437
1437
  received: n.parsedType
1438
- }), g;
1438
+ }), y;
1439
1439
  }
1440
1440
  return T(e.data);
1441
1441
  }
1442
1442
  }
1443
- be.create = (t) => new be({
1444
- typeName: p.ZodVoid,
1443
+ we.create = (t) => new we({
1444
+ typeName: m.ZodVoid,
1445
1445
  ...v(t)
1446
1446
  });
1447
- class E extends _ {
1447
+ class Z extends _ {
1448
1448
  _parse(e) {
1449
1449
  const { ctx: s, status: n } = this._processInputParams(e), r = this._def;
1450
1450
  if (s.parsedType !== f.array)
@@ -1452,7 +1452,7 @@ class E extends _ {
1452
1452
  code: c.invalid_type,
1453
1453
  expected: f.array,
1454
1454
  received: s.parsedType
1455
- }), g;
1455
+ }), y;
1456
1456
  if (r.exactLength !== null) {
1457
1457
  const i = s.data.length > r.exactLength.value, o = s.data.length < r.exactLength.value;
1458
1458
  (i || o) && (l(s, {
@@ -1480,27 +1480,27 @@ class E extends _ {
1480
1480
  exact: !1,
1481
1481
  message: r.maxLength.message
1482
1482
  }), n.dirty()), s.common.async)
1483
- return Promise.all([...s.data].map((i, o) => r.type._parseAsync(new M(s, i, s.path, o)))).then((i) => w.mergeArray(n, i));
1483
+ return Promise.all([...s.data].map((i, o) => r.type._parseAsync(new M(s, i, s.path, o)))).then((i) => S.mergeArray(n, i));
1484
1484
  const a = [...s.data].map((i, o) => r.type._parseSync(new M(s, i, s.path, o)));
1485
- return w.mergeArray(n, a);
1485
+ return S.mergeArray(n, a);
1486
1486
  }
1487
1487
  get element() {
1488
1488
  return this._def.type;
1489
1489
  }
1490
1490
  min(e, s) {
1491
- return new E({
1491
+ return new Z({
1492
1492
  ...this._def,
1493
1493
  minLength: { value: e, message: h.toString(s) }
1494
1494
  });
1495
1495
  }
1496
1496
  max(e, s) {
1497
- return new E({
1497
+ return new Z({
1498
1498
  ...this._def,
1499
1499
  maxLength: { value: e, message: h.toString(s) }
1500
1500
  });
1501
1501
  }
1502
1502
  length(e, s) {
1503
- return new E({
1503
+ return new Z({
1504
1504
  ...this._def,
1505
1505
  exactLength: { value: e, message: h.toString(s) }
1506
1506
  });
@@ -1509,30 +1509,30 @@ class E extends _ {
1509
1509
  return this.min(1, e);
1510
1510
  }
1511
1511
  }
1512
- E.create = (t, e) => new E({
1512
+ Z.create = (t, e) => new Z({
1513
1513
  type: t,
1514
1514
  minLength: null,
1515
1515
  maxLength: null,
1516
1516
  exactLength: null,
1517
- typeName: p.ZodArray,
1517
+ typeName: m.ZodArray,
1518
1518
  ...v(e)
1519
1519
  });
1520
- function G(t) {
1520
+ function Q(t) {
1521
1521
  if (t instanceof b) {
1522
1522
  const e = {};
1523
1523
  for (const s in t.shape) {
1524
1524
  const n = t.shape[s];
1525
- e[s] = N.create(G(n));
1525
+ e[s] = I.create(Q(n));
1526
1526
  }
1527
1527
  return new b({
1528
1528
  ...t._def,
1529
1529
  shape: () => e
1530
1530
  });
1531
1531
  } else
1532
- return t instanceof E ? new E({
1532
+ return t instanceof Z ? new Z({
1533
1533
  ...t._def,
1534
- type: G(t.element)
1535
- }) : t instanceof N ? N.create(G(t.unwrap())) : t instanceof L ? L.create(G(t.unwrap())) : t instanceof I ? I.create(t.items.map((e) => G(e))) : t;
1534
+ type: Q(t.element)
1535
+ }) : t instanceof I ? I.create(Q(t.unwrap())) : t instanceof L ? L.create(Q(t.unwrap())) : t instanceof N ? N.create(t.items.map((e) => Q(e))) : t;
1536
1536
  }
1537
1537
  class b extends _ {
1538
1538
  constructor() {
@@ -1551,7 +1551,7 @@ class b extends _ {
1551
1551
  code: c.invalid_type,
1552
1552
  expected: f.object,
1553
1553
  received: u.parsedType
1554
- }), g;
1554
+ }), y;
1555
1555
  }
1556
1556
  const { status: n, ctx: r } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1557
1557
  if (!(this._def.catchall instanceof A && this._def.unknownKeys === "strip"))
@@ -1559,20 +1559,20 @@ class b extends _ {
1559
1559
  i.includes(u) || o.push(u);
1560
1560
  const d = [];
1561
1561
  for (const u of i) {
1562
- const m = a[u], R = r.data[u];
1562
+ const g = a[u], R = r.data[u];
1563
1563
  d.push({
1564
1564
  key: { status: "valid", value: u },
1565
- value: m._parse(new M(r, R, r.path, u)),
1565
+ value: g._parse(new M(r, R, r.path, u)),
1566
1566
  alwaysSet: u in r.data
1567
1567
  });
1568
1568
  }
1569
1569
  if (this._def.catchall instanceof A) {
1570
1570
  const u = this._def.unknownKeys;
1571
1571
  if (u === "passthrough")
1572
- for (const m of o)
1572
+ for (const g of o)
1573
1573
  d.push({
1574
- key: { status: "valid", value: m },
1575
- value: { status: "valid", value: r.data[m] }
1574
+ key: { status: "valid", value: g },
1575
+ value: { status: "valid", value: r.data[g] }
1576
1576
  });
1577
1577
  else if (u === "strict")
1578
1578
  o.length > 0 && (l(r, {
@@ -1583,30 +1583,30 @@ class b extends _ {
1583
1583
  throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1584
1584
  } else {
1585
1585
  const u = this._def.catchall;
1586
- for (const m of o) {
1587
- const R = r.data[m];
1586
+ for (const g of o) {
1587
+ const R = r.data[g];
1588
1588
  d.push({
1589
- key: { status: "valid", value: m },
1589
+ key: { status: "valid", value: g },
1590
1590
  value: u._parse(
1591
- new M(r, R, r.path, m)
1591
+ new M(r, R, r.path, g)
1592
1592
  //, ctx.child(key), value, getParsedType(value)
1593
1593
  ),
1594
- alwaysSet: m in r.data
1594
+ alwaysSet: g in r.data
1595
1595
  });
1596
1596
  }
1597
1597
  }
1598
1598
  return r.common.async ? Promise.resolve().then(async () => {
1599
1599
  const u = [];
1600
- for (const m of d) {
1601
- const R = await m.key, D = await m.value;
1600
+ for (const g of d) {
1601
+ const R = await g.key, D = await g.value;
1602
1602
  u.push({
1603
1603
  key: R,
1604
1604
  value: D,
1605
- alwaysSet: m.alwaysSet
1605
+ alwaysSet: g.alwaysSet
1606
1606
  });
1607
1607
  }
1608
1608
  return u;
1609
- }).then((u) => w.mergeObjectSync(n, u)) : w.mergeObjectSync(n, d);
1609
+ }).then((u) => S.mergeObjectSync(n, u)) : S.mergeObjectSync(n, d);
1610
1610
  }
1611
1611
  get shape() {
1612
1612
  return this._def.shape();
@@ -1679,7 +1679,7 @@ class b extends _ {
1679
1679
  ...this._def.shape(),
1680
1680
  ...e._def.shape()
1681
1681
  }),
1682
- typeName: p.ZodObject
1682
+ typeName: m.ZodObject
1683
1683
  });
1684
1684
  }
1685
1685
  // merge<
@@ -1769,7 +1769,7 @@ class b extends _ {
1769
1769
  * @deprecated
1770
1770
  */
1771
1771
  deepPartial() {
1772
- return G(this);
1772
+ return Q(this);
1773
1773
  }
1774
1774
  partial(e) {
1775
1775
  const s = {};
@@ -1788,7 +1788,7 @@ class b extends _ {
1788
1788
  s[n] = this.shape[n];
1789
1789
  else {
1790
1790
  let a = this.shape[n];
1791
- for (; a instanceof N; )
1791
+ for (; a instanceof I; )
1792
1792
  a = a._def.innerType;
1793
1793
  s[n] = a;
1794
1794
  }
@@ -1805,24 +1805,24 @@ b.create = (t, e) => new b({
1805
1805
  shape: () => t,
1806
1806
  unknownKeys: "strip",
1807
1807
  catchall: A.create(),
1808
- typeName: p.ZodObject,
1808
+ typeName: m.ZodObject,
1809
1809
  ...v(e)
1810
1810
  });
1811
1811
  b.strictCreate = (t, e) => new b({
1812
1812
  shape: () => t,
1813
1813
  unknownKeys: "strict",
1814
1814
  catchall: A.create(),
1815
- typeName: p.ZodObject,
1815
+ typeName: m.ZodObject,
1816
1816
  ...v(e)
1817
1817
  });
1818
1818
  b.lazycreate = (t, e) => new b({
1819
1819
  shape: t,
1820
1820
  unknownKeys: "strip",
1821
1821
  catchall: A.create(),
1822
- typeName: p.ZodObject,
1822
+ typeName: m.ZodObject,
1823
1823
  ...v(e)
1824
1824
  });
1825
- class ie extends _ {
1825
+ class oe extends _ {
1826
1826
  _parse(e) {
1827
1827
  const { ctx: s } = this._processInputParams(e), n = this._def.options;
1828
1828
  function r(a) {
@@ -1832,11 +1832,11 @@ class ie extends _ {
1832
1832
  for (const o of a)
1833
1833
  if (o.result.status === "dirty")
1834
1834
  return s.common.issues.push(...o.ctx.common.issues), o.result;
1835
- const i = a.map((o) => new C(o.ctx.common.issues));
1835
+ const i = a.map((o) => new E(o.ctx.common.issues));
1836
1836
  return l(s, {
1837
1837
  code: c.invalid_union,
1838
1838
  unionErrors: i
1839
- }), g;
1839
+ }), y;
1840
1840
  }
1841
1841
  if (s.common.async)
1842
1842
  return Promise.all(n.map(async (a) => {
@@ -1868,35 +1868,35 @@ class ie extends _ {
1868
1868
  issues: []
1869
1869
  },
1870
1870
  parent: null
1871
- }, m = d._parseSync({
1871
+ }, g = d._parseSync({
1872
1872
  data: s.data,
1873
1873
  path: s.path,
1874
1874
  parent: u
1875
1875
  });
1876
- if (m.status === "valid")
1877
- return m;
1878
- m.status === "dirty" && !a && (a = { result: m, ctx: u }), u.common.issues.length && i.push(u.common.issues);
1876
+ if (g.status === "valid")
1877
+ return g;
1878
+ g.status === "dirty" && !a && (a = { result: g, ctx: u }), u.common.issues.length && i.push(u.common.issues);
1879
1879
  }
1880
1880
  if (a)
1881
1881
  return s.common.issues.push(...a.ctx.common.issues), a.result;
1882
- const o = i.map((d) => new C(d));
1882
+ const o = i.map((d) => new E(d));
1883
1883
  return l(s, {
1884
1884
  code: c.invalid_union,
1885
1885
  unionErrors: o
1886
- }), g;
1886
+ }), y;
1887
1887
  }
1888
1888
  }
1889
1889
  get options() {
1890
1890
  return this._def.options;
1891
1891
  }
1892
1892
  }
1893
- ie.create = (t, e) => new ie({
1893
+ oe.create = (t, e) => new oe({
1894
1894
  options: t,
1895
- typeName: p.ZodUnion,
1895
+ typeName: m.ZodUnion,
1896
1896
  ...v(e)
1897
1897
  });
1898
- const j = (t) => t instanceof de ? j(t.schema) : t instanceof O ? j(t.innerType()) : t instanceof ue ? [t.value] : t instanceof q ? t.options : t instanceof le ? x.objectValues(t.enum) : t instanceof fe ? j(t._def.innerType) : t instanceof re ? [void 0] : t instanceof ae ? [null] : t instanceof N ? [void 0, ...j(t.unwrap())] : t instanceof L ? [null, ...j(t.unwrap())] : t instanceof Me || t instanceof pe ? j(t.unwrap()) : t instanceof he ? j(t._def.innerType) : [];
1899
- class Te extends _ {
1898
+ const j = (t) => t instanceof ue ? j(t.schema) : t instanceof O ? j(t.innerType()) : t instanceof le ? [t.value] : t instanceof U ? t.options : t instanceof fe ? x.objectValues(t.enum) : t instanceof he ? j(t._def.innerType) : t instanceof ae ? [void 0] : t instanceof ie ? [null] : t instanceof I ? [void 0, ...j(t.unwrap())] : t instanceof L ? [null, ...j(t.unwrap())] : t instanceof Ne || t instanceof me ? j(t.unwrap()) : t instanceof pe ? j(t._def.innerType) : [];
1899
+ class Re extends _ {
1900
1900
  _parse(e) {
1901
1901
  const { ctx: s } = this._processInputParams(e);
1902
1902
  if (s.parsedType !== f.object)
@@ -1904,7 +1904,7 @@ class Te extends _ {
1904
1904
  code: c.invalid_type,
1905
1905
  expected: f.object,
1906
1906
  received: s.parsedType
1907
- }), g;
1907
+ }), y;
1908
1908
  const n = this.discriminator, r = s.data[n], a = this.optionsMap.get(r);
1909
1909
  return a ? s.common.async ? a._parseAsync({
1910
1910
  data: s.data,
@@ -1918,7 +1918,7 @@ class Te extends _ {
1918
1918
  code: c.invalid_union_discriminator,
1919
1919
  options: Array.from(this.optionsMap.keys()),
1920
1920
  path: [n]
1921
- }), g);
1921
+ }), y);
1922
1922
  }
1923
1923
  get discriminator() {
1924
1924
  return this._def.discriminator;
@@ -1949,8 +1949,8 @@ class Te extends _ {
1949
1949
  r.set(o, a);
1950
1950
  }
1951
1951
  }
1952
- return new Te({
1953
- typeName: p.ZodDiscriminatedUnion,
1952
+ return new Re({
1953
+ typeName: m.ZodDiscriminatedUnion,
1954
1954
  discriminator: e,
1955
1955
  options: s,
1956
1956
  optionsMap: r,
@@ -1958,14 +1958,14 @@ class Te extends _ {
1958
1958
  });
1959
1959
  }
1960
1960
  }
1961
- function Ne(t, e) {
1961
+ function Me(t, e) {
1962
1962
  const s = P(t), n = P(e);
1963
1963
  if (t === e)
1964
1964
  return { valid: !0, data: t };
1965
1965
  if (s === f.object && n === f.object) {
1966
1966
  const r = x.objectKeys(e), a = x.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = { ...t, ...e };
1967
1967
  for (const o of a) {
1968
- const d = Ne(t[o], e[o]);
1968
+ const d = Me(t[o], e[o]);
1969
1969
  if (!d.valid)
1970
1970
  return { valid: !1 };
1971
1971
  i[o] = d.data;
@@ -1976,7 +1976,7 @@ function Ne(t, e) {
1976
1976
  return { valid: !1 };
1977
1977
  const r = [];
1978
1978
  for (let a = 0; a < t.length; a++) {
1979
- const i = t[a], o = e[a], d = Ne(i, o);
1979
+ const i = t[a], o = e[a], d = Me(i, o);
1980
1980
  if (!d.valid)
1981
1981
  return { valid: !1 };
1982
1982
  r.push(d.data);
@@ -1985,15 +1985,15 @@ function Ne(t, e) {
1985
1985
  } else
1986
1986
  return s === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
1987
1987
  }
1988
- class oe extends _ {
1988
+ class ce extends _ {
1989
1989
  _parse(e) {
1990
1990
  const { status: s, ctx: n } = this._processInputParams(e), r = (a, i) => {
1991
- if (Ee(a) || Ee(i))
1992
- return g;
1993
- const o = Ne(a.value, i.value);
1994
- return o.valid ? ((Oe(a) || Oe(i)) && s.dirty(), { status: s.value, value: o.data }) : (l(n, {
1991
+ if (Oe(a) || Oe(i))
1992
+ return y;
1993
+ const o = Me(a.value, i.value);
1994
+ return o.valid ? ((Ie(a) || Ie(i)) && s.dirty(), { status: s.value, value: o.data }) : (l(n, {
1995
1995
  code: c.invalid_intersection_types
1996
- }), g);
1996
+ }), y);
1997
1997
  };
1998
1998
  return n.common.async ? Promise.all([
1999
1999
  this._def.left._parseAsync({
@@ -2017,13 +2017,13 @@ class oe extends _ {
2017
2017
  }));
2018
2018
  }
2019
2019
  }
2020
- oe.create = (t, e, s) => new oe({
2020
+ ce.create = (t, e, s) => new ce({
2021
2021
  left: t,
2022
2022
  right: e,
2023
- typeName: p.ZodIntersection,
2023
+ typeName: m.ZodIntersection,
2024
2024
  ...v(s)
2025
2025
  });
2026
- class I extends _ {
2026
+ class N extends _ {
2027
2027
  _parse(e) {
2028
2028
  const { status: s, ctx: n } = this._processInputParams(e);
2029
2029
  if (n.parsedType !== f.array)
@@ -2031,7 +2031,7 @@ class I extends _ {
2031
2031
  code: c.invalid_type,
2032
2032
  expected: f.array,
2033
2033
  received: n.parsedType
2034
- }), g;
2034
+ }), y;
2035
2035
  if (n.data.length < this._def.items.length)
2036
2036
  return l(n, {
2037
2037
  code: c.too_small,
@@ -2039,7 +2039,7 @@ class I extends _ {
2039
2039
  inclusive: !0,
2040
2040
  exact: !1,
2041
2041
  type: "array"
2042
- }), g;
2042
+ }), y;
2043
2043
  !this._def.rest && n.data.length > this._def.items.length && (l(n, {
2044
2044
  code: c.too_big,
2045
2045
  maximum: this._def.items.length,
@@ -2051,29 +2051,29 @@ class I extends _ {
2051
2051
  const d = this._def.items[o] || this._def.rest;
2052
2052
  return d ? d._parse(new M(n, i, n.path, o)) : null;
2053
2053
  }).filter((i) => !!i);
2054
- return n.common.async ? Promise.all(a).then((i) => w.mergeArray(s, i)) : w.mergeArray(s, a);
2054
+ return n.common.async ? Promise.all(a).then((i) => S.mergeArray(s, i)) : S.mergeArray(s, a);
2055
2055
  }
2056
2056
  get items() {
2057
2057
  return this._def.items;
2058
2058
  }
2059
2059
  rest(e) {
2060
- return new I({
2060
+ return new N({
2061
2061
  ...this._def,
2062
2062
  rest: e
2063
2063
  });
2064
2064
  }
2065
2065
  }
2066
- I.create = (t, e) => {
2066
+ N.create = (t, e) => {
2067
2067
  if (!Array.isArray(t))
2068
2068
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2069
- return new I({
2069
+ return new N({
2070
2070
  items: t,
2071
- typeName: p.ZodTuple,
2071
+ typeName: m.ZodTuple,
2072
2072
  rest: null,
2073
2073
  ...v(e)
2074
2074
  });
2075
2075
  };
2076
- class ce extends _ {
2076
+ class de extends _ {
2077
2077
  get keySchema() {
2078
2078
  return this._def.keyType;
2079
2079
  }
@@ -2087,7 +2087,7 @@ class ce extends _ {
2087
2087
  code: c.invalid_type,
2088
2088
  expected: f.object,
2089
2089
  received: n.parsedType
2090
- }), g;
2090
+ }), y;
2091
2091
  const r = [], a = this._def.keyType, i = this._def.valueType;
2092
2092
  for (const o in n.data)
2093
2093
  r.push({
@@ -2095,26 +2095,26 @@ class ce extends _ {
2095
2095
  value: i._parse(new M(n, n.data[o], n.path, o)),
2096
2096
  alwaysSet: o in n.data
2097
2097
  });
2098
- return n.common.async ? w.mergeObjectAsync(s, r) : w.mergeObjectSync(s, r);
2098
+ return n.common.async ? S.mergeObjectAsync(s, r) : S.mergeObjectSync(s, r);
2099
2099
  }
2100
2100
  get element() {
2101
2101
  return this._def.valueType;
2102
2102
  }
2103
2103
  static create(e, s, n) {
2104
- return s instanceof _ ? new ce({
2104
+ return s instanceof _ ? new de({
2105
2105
  keyType: e,
2106
2106
  valueType: s,
2107
- typeName: p.ZodRecord,
2107
+ typeName: m.ZodRecord,
2108
2108
  ...v(n)
2109
- }) : new ce({
2110
- keyType: Z.create(),
2109
+ }) : new de({
2110
+ keyType: C.create(),
2111
2111
  valueType: e,
2112
- typeName: p.ZodRecord,
2112
+ typeName: m.ZodRecord,
2113
2113
  ...v(s)
2114
2114
  });
2115
2115
  }
2116
2116
  }
2117
- class ke extends _ {
2117
+ class Se extends _ {
2118
2118
  get keySchema() {
2119
2119
  return this._def.keyType;
2120
2120
  }
@@ -2128,7 +2128,7 @@ class ke extends _ {
2128
2128
  code: c.invalid_type,
2129
2129
  expected: f.map,
2130
2130
  received: n.parsedType
2131
- }), g;
2131
+ }), y;
2132
2132
  const r = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, d], u) => ({
2133
2133
  key: r._parse(new M(n, o, n.path, [u, "key"])),
2134
2134
  value: a._parse(new M(n, d, n.path, [u, "value"]))
@@ -2137,32 +2137,32 @@ class ke extends _ {
2137
2137
  const o = /* @__PURE__ */ new Map();
2138
2138
  return Promise.resolve().then(async () => {
2139
2139
  for (const d of i) {
2140
- const u = await d.key, m = await d.value;
2141
- if (u.status === "aborted" || m.status === "aborted")
2142
- return g;
2143
- (u.status === "dirty" || m.status === "dirty") && s.dirty(), o.set(u.value, m.value);
2140
+ const u = await d.key, g = await d.value;
2141
+ if (u.status === "aborted" || g.status === "aborted")
2142
+ return y;
2143
+ (u.status === "dirty" || g.status === "dirty") && s.dirty(), o.set(u.value, g.value);
2144
2144
  }
2145
2145
  return { status: s.value, value: o };
2146
2146
  });
2147
2147
  } else {
2148
2148
  const o = /* @__PURE__ */ new Map();
2149
2149
  for (const d of i) {
2150
- const u = d.key, m = d.value;
2151
- if (u.status === "aborted" || m.status === "aborted")
2152
- return g;
2153
- (u.status === "dirty" || m.status === "dirty") && s.dirty(), o.set(u.value, m.value);
2150
+ const u = d.key, g = d.value;
2151
+ if (u.status === "aborted" || g.status === "aborted")
2152
+ return y;
2153
+ (u.status === "dirty" || g.status === "dirty") && s.dirty(), o.set(u.value, g.value);
2154
2154
  }
2155
2155
  return { status: s.value, value: o };
2156
2156
  }
2157
2157
  }
2158
2158
  }
2159
- ke.create = (t, e, s) => new ke({
2159
+ Se.create = (t, e, s) => new Se({
2160
2160
  valueType: e,
2161
2161
  keyType: t,
2162
- typeName: p.ZodMap,
2162
+ typeName: m.ZodMap,
2163
2163
  ...v(s)
2164
2164
  });
2165
- class Q extends _ {
2165
+ class G extends _ {
2166
2166
  _parse(e) {
2167
2167
  const { status: s, ctx: n } = this._processInputParams(e);
2168
2168
  if (n.parsedType !== f.set)
@@ -2170,7 +2170,7 @@ class Q extends _ {
2170
2170
  code: c.invalid_type,
2171
2171
  expected: f.set,
2172
2172
  received: n.parsedType
2173
- }), g;
2173
+ }), y;
2174
2174
  const r = this._def;
2175
2175
  r.minSize !== null && n.data.size < r.minSize.value && (l(n, {
2176
2176
  code: c.too_small,
@@ -2190,10 +2190,10 @@ class Q extends _ {
2190
2190
  const a = this._def.valueType;
2191
2191
  function i(d) {
2192
2192
  const u = /* @__PURE__ */ new Set();
2193
- for (const m of d) {
2194
- if (m.status === "aborted")
2195
- return g;
2196
- m.status === "dirty" && s.dirty(), u.add(m.value);
2193
+ for (const g of d) {
2194
+ if (g.status === "aborted")
2195
+ return y;
2196
+ g.status === "dirty" && s.dirty(), u.add(g.value);
2197
2197
  }
2198
2198
  return { status: s.value, value: u };
2199
2199
  }
@@ -2201,13 +2201,13 @@ class Q extends _ {
2201
2201
  return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
2202
2202
  }
2203
2203
  min(e, s) {
2204
- return new Q({
2204
+ return new G({
2205
2205
  ...this._def,
2206
2206
  minSize: { value: e, message: h.toString(s) }
2207
2207
  });
2208
2208
  }
2209
2209
  max(e, s) {
2210
- return new Q({
2210
+ return new G({
2211
2211
  ...this._def,
2212
2212
  maxSize: { value: e, message: h.toString(s) }
2213
2213
  });
@@ -2219,11 +2219,11 @@ class Q extends _ {
2219
2219
  return this.min(1, e);
2220
2220
  }
2221
2221
  }
2222
- Q.create = (t, e) => new Q({
2222
+ G.create = (t, e) => new G({
2223
2223
  valueType: t,
2224
2224
  minSize: null,
2225
2225
  maxSize: null,
2226
- typeName: p.ZodSet,
2226
+ typeName: m.ZodSet,
2227
2227
  ...v(e)
2228
2228
  });
2229
2229
  class H extends _ {
@@ -2237,15 +2237,15 @@ class H extends _ {
2237
2237
  code: c.invalid_type,
2238
2238
  expected: f.function,
2239
2239
  received: s.parsedType
2240
- }), g;
2240
+ }), y;
2241
2241
  function n(o, d) {
2242
- return ve({
2242
+ return xe({
2243
2243
  data: o,
2244
2244
  path: s.path,
2245
2245
  errorMaps: [
2246
2246
  s.common.contextualErrorMap,
2247
2247
  s.schemaErrorMap,
2248
- ye(),
2248
+ _e(),
2249
2249
  Y
2250
2250
  ].filter((u) => !!u),
2251
2251
  issueData: {
@@ -2255,13 +2255,13 @@ class H extends _ {
2255
2255
  });
2256
2256
  }
2257
2257
  function r(o, d) {
2258
- return ve({
2258
+ return xe({
2259
2259
  data: o,
2260
2260
  path: s.path,
2261
2261
  errorMaps: [
2262
2262
  s.common.contextualErrorMap,
2263
2263
  s.schemaErrorMap,
2264
- ye(),
2264
+ _e(),
2265
2265
  Y
2266
2266
  ].filter((u) => !!u),
2267
2267
  issueData: {
@@ -2274,11 +2274,11 @@ class H extends _ {
2274
2274
  if (this._def.returns instanceof X) {
2275
2275
  const o = this;
2276
2276
  return T(async function(...d) {
2277
- const u = new C([]), m = await o._def.args.parseAsync(d, a).catch((Re) => {
2278
- throw u.addIssue(n(d, Re)), u;
2279
- }), R = await Reflect.apply(i, this, m);
2280
- return await o._def.returns._def.type.parseAsync(R, a).catch((Re) => {
2281
- throw u.addIssue(r(R, Re)), u;
2277
+ const u = new E([]), g = await o._def.args.parseAsync(d, a).catch((Ee) => {
2278
+ throw u.addIssue(n(d, Ee)), u;
2279
+ }), R = await Reflect.apply(i, this, g);
2280
+ return await o._def.returns._def.type.parseAsync(R, a).catch((Ee) => {
2281
+ throw u.addIssue(r(R, Ee)), u;
2282
2282
  });
2283
2283
  });
2284
2284
  } else {
@@ -2286,10 +2286,10 @@ class H extends _ {
2286
2286
  return T(function(...d) {
2287
2287
  const u = o._def.args.safeParse(d, a);
2288
2288
  if (!u.success)
2289
- throw new C([n(d, u.error)]);
2290
- const m = Reflect.apply(i, this, u.data), R = o._def.returns.safeParse(m, a);
2289
+ throw new E([n(d, u.error)]);
2290
+ const g = Reflect.apply(i, this, u.data), R = o._def.returns.safeParse(g, a);
2291
2291
  if (!R.success)
2292
- throw new C([r(m, R.error)]);
2292
+ throw new E([r(g, R.error)]);
2293
2293
  return R.data;
2294
2294
  });
2295
2295
  }
@@ -2303,7 +2303,7 @@ class H extends _ {
2303
2303
  args(...e) {
2304
2304
  return new H({
2305
2305
  ...this._def,
2306
- args: I.create(e).rest(B.create())
2306
+ args: N.create(e).rest(B.create())
2307
2307
  });
2308
2308
  }
2309
2309
  returns(e) {
@@ -2320,14 +2320,14 @@ class H extends _ {
2320
2320
  }
2321
2321
  static create(e, s, n) {
2322
2322
  return new H({
2323
- args: e || I.create([]).rest(B.create()),
2323
+ args: e || N.create([]).rest(B.create()),
2324
2324
  returns: s || B.create(),
2325
- typeName: p.ZodFunction,
2325
+ typeName: m.ZodFunction,
2326
2326
  ...v(n)
2327
2327
  });
2328
2328
  }
2329
2329
  }
2330
- class de extends _ {
2330
+ class ue extends _ {
2331
2331
  get schema() {
2332
2332
  return this._def.getter();
2333
2333
  }
@@ -2336,12 +2336,12 @@ class de extends _ {
2336
2336
  return this._def.getter()._parse({ data: s.data, path: s.path, parent: s });
2337
2337
  }
2338
2338
  }
2339
- de.create = (t, e) => new de({
2339
+ ue.create = (t, e) => new ue({
2340
2340
  getter: t,
2341
- typeName: p.ZodLazy,
2341
+ typeName: m.ZodLazy,
2342
2342
  ...v(e)
2343
2343
  });
2344
- class ue extends _ {
2344
+ class le extends _ {
2345
2345
  _parse(e) {
2346
2346
  if (e.data !== this._def.value) {
2347
2347
  const s = this._getOrReturnCtx(e);
@@ -2349,7 +2349,7 @@ class ue extends _ {
2349
2349
  received: s.data,
2350
2350
  code: c.invalid_literal,
2351
2351
  expected: this._def.value
2352
- }), g;
2352
+ }), y;
2353
2353
  }
2354
2354
  return { status: "valid", value: e.data };
2355
2355
  }
@@ -2357,21 +2357,21 @@ class ue extends _ {
2357
2357
  return this._def.value;
2358
2358
  }
2359
2359
  }
2360
- ue.create = (t, e) => new ue({
2360
+ le.create = (t, e) => new le({
2361
2361
  value: t,
2362
- typeName: p.ZodLiteral,
2362
+ typeName: m.ZodLiteral,
2363
2363
  ...v(e)
2364
2364
  });
2365
2365
  function Be(t, e) {
2366
- return new q({
2366
+ return new U({
2367
2367
  values: t,
2368
- typeName: p.ZodEnum,
2368
+ typeName: m.ZodEnum,
2369
2369
  ...v(e)
2370
2370
  });
2371
2371
  }
2372
- class q extends _ {
2372
+ class U extends _ {
2373
2373
  constructor() {
2374
- super(...arguments), K.set(this, void 0);
2374
+ super(...arguments), F.set(this, void 0);
2375
2375
  }
2376
2376
  _parse(e) {
2377
2377
  if (typeof e.data != "string") {
@@ -2380,15 +2380,15 @@ class q extends _ {
2380
2380
  expected: x.joinValues(n),
2381
2381
  received: s.parsedType,
2382
2382
  code: c.invalid_type
2383
- }), g;
2383
+ }), y;
2384
2384
  }
2385
- if (_e(this, K) || qe(this, K, new Set(this._def.values)), !_e(this, K).has(e.data)) {
2385
+ if (be(this, F) || Ue(this, F, new Set(this._def.values)), !be(this, F).has(e.data)) {
2386
2386
  const s = this._getOrReturnCtx(e), n = this._def.values;
2387
2387
  return l(s, {
2388
2388
  received: s.data,
2389
2389
  code: c.invalid_enum_value,
2390
2390
  options: n
2391
- }), g;
2391
+ }), y;
2392
2392
  }
2393
2393
  return T(e.data);
2394
2394
  }
@@ -2414,23 +2414,23 @@ class q extends _ {
2414
2414
  return e;
2415
2415
  }
2416
2416
  extract(e, s = this._def) {
2417
- return q.create(e, {
2417
+ return U.create(e, {
2418
2418
  ...this._def,
2419
2419
  ...s
2420
2420
  });
2421
2421
  }
2422
2422
  exclude(e, s = this._def) {
2423
- return q.create(this.options.filter((n) => !e.includes(n)), {
2423
+ return U.create(this.options.filter((n) => !e.includes(n)), {
2424
2424
  ...this._def,
2425
2425
  ...s
2426
2426
  });
2427
2427
  }
2428
2428
  }
2429
- K = /* @__PURE__ */ new WeakMap();
2430
- q.create = Be;
2431
- class le extends _ {
2429
+ F = /* @__PURE__ */ new WeakMap();
2430
+ U.create = Be;
2431
+ class fe extends _ {
2432
2432
  constructor() {
2433
- super(...arguments), F.set(this, void 0);
2433
+ super(...arguments), ee.set(this, void 0);
2434
2434
  }
2435
2435
  _parse(e) {
2436
2436
  const s = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
@@ -2440,15 +2440,15 @@ class le extends _ {
2440
2440
  expected: x.joinValues(r),
2441
2441
  received: n.parsedType,
2442
2442
  code: c.invalid_type
2443
- }), g;
2443
+ }), y;
2444
2444
  }
2445
- if (_e(this, F) || qe(this, F, new Set(x.getValidEnumValues(this._def.values))), !_e(this, F).has(e.data)) {
2445
+ if (be(this, ee) || Ue(this, ee, new Set(x.getValidEnumValues(this._def.values))), !be(this, ee).has(e.data)) {
2446
2446
  const r = x.objectValues(s);
2447
2447
  return l(n, {
2448
2448
  received: n.data,
2449
2449
  code: c.invalid_enum_value,
2450
2450
  options: r
2451
- }), g;
2451
+ }), y;
2452
2452
  }
2453
2453
  return T(e.data);
2454
2454
  }
@@ -2456,10 +2456,10 @@ class le extends _ {
2456
2456
  return this._def.values;
2457
2457
  }
2458
2458
  }
2459
- F = /* @__PURE__ */ new WeakMap();
2460
- le.create = (t, e) => new le({
2459
+ ee = /* @__PURE__ */ new WeakMap();
2460
+ fe.create = (t, e) => new fe({
2461
2461
  values: t,
2462
- typeName: p.ZodNativeEnum,
2462
+ typeName: m.ZodNativeEnum,
2463
2463
  ...v(e)
2464
2464
  });
2465
2465
  class X extends _ {
@@ -2473,7 +2473,7 @@ class X extends _ {
2473
2473
  code: c.invalid_type,
2474
2474
  expected: f.promise,
2475
2475
  received: s.parsedType
2476
- }), g;
2476
+ }), y;
2477
2477
  const n = s.parsedType === f.promise ? s.data : Promise.resolve(s.data);
2478
2478
  return T(n.then((r) => this._def.type.parseAsync(r, {
2479
2479
  path: s.path,
@@ -2483,7 +2483,7 @@ class X extends _ {
2483
2483
  }
2484
2484
  X.create = (t, e) => new X({
2485
2485
  type: t,
2486
- typeName: p.ZodPromise,
2486
+ typeName: m.ZodPromise,
2487
2487
  ...v(e)
2488
2488
  });
2489
2489
  class O extends _ {
@@ -2491,7 +2491,7 @@ class O extends _ {
2491
2491
  return this._def.schema;
2492
2492
  }
2493
2493
  sourceType() {
2494
- return this._def.schema._def.typeName === p.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2494
+ return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2495
2495
  }
2496
2496
  _parse(e) {
2497
2497
  const { status: s, ctx: n } = this._processInputParams(e), r = this._def.effect || null, a = {
@@ -2507,23 +2507,23 @@ class O extends _ {
2507
2507
  if (n.common.async)
2508
2508
  return Promise.resolve(i).then(async (o) => {
2509
2509
  if (s.value === "aborted")
2510
- return g;
2510
+ return y;
2511
2511
  const d = await this._def.schema._parseAsync({
2512
2512
  data: o,
2513
2513
  path: n.path,
2514
2514
  parent: n
2515
2515
  });
2516
- return d.status === "aborted" ? g : d.status === "dirty" || s.value === "dirty" ? W(d.value) : d;
2516
+ return d.status === "aborted" ? y : d.status === "dirty" || s.value === "dirty" ? W(d.value) : d;
2517
2517
  });
2518
2518
  {
2519
2519
  if (s.value === "aborted")
2520
- return g;
2520
+ return y;
2521
2521
  const o = this._def.schema._parseSync({
2522
2522
  data: i,
2523
2523
  path: n.path,
2524
2524
  parent: n
2525
2525
  });
2526
- return o.status === "aborted" ? g : o.status === "dirty" || s.value === "dirty" ? W(o.value) : o;
2526
+ return o.status === "aborted" ? y : o.status === "dirty" || s.value === "dirty" ? W(o.value) : o;
2527
2527
  }
2528
2528
  }
2529
2529
  if (r.type === "refinement") {
@@ -2541,9 +2541,9 @@ class O extends _ {
2541
2541
  path: n.path,
2542
2542
  parent: n
2543
2543
  });
2544
- return o.status === "aborted" ? g : (o.status === "dirty" && s.dirty(), i(o.value), { status: s.value, value: o.value });
2544
+ return o.status === "aborted" ? y : (o.status === "dirty" && s.dirty(), i(o.value), { status: s.value, value: o.value });
2545
2545
  } else
2546
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? g : (o.status === "dirty" && s.dirty(), i(o.value).then(() => ({ status: s.value, value: o.value }))));
2546
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && s.dirty(), i(o.value).then(() => ({ status: s.value, value: o.value }))));
2547
2547
  }
2548
2548
  if (r.type === "transform")
2549
2549
  if (n.common.async === !1) {
@@ -2552,30 +2552,30 @@ class O extends _ {
2552
2552
  path: n.path,
2553
2553
  parent: n
2554
2554
  });
2555
- if (!te(i))
2555
+ if (!se(i))
2556
2556
  return i;
2557
2557
  const o = r.transform(i.value, a);
2558
2558
  if (o instanceof Promise)
2559
2559
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2560
2560
  return { status: s.value, value: o };
2561
2561
  } else
2562
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => te(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({ status: s.value, value: o })) : i);
2562
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => se(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({ status: s.value, value: o })) : i);
2563
2563
  x.assertNever(r);
2564
2564
  }
2565
2565
  }
2566
2566
  O.create = (t, e, s) => new O({
2567
2567
  schema: t,
2568
- typeName: p.ZodEffects,
2568
+ typeName: m.ZodEffects,
2569
2569
  effect: e,
2570
2570
  ...v(s)
2571
2571
  });
2572
2572
  O.createWithPreprocess = (t, e, s) => new O({
2573
2573
  schema: e,
2574
2574
  effect: { type: "preprocess", transform: t },
2575
- typeName: p.ZodEffects,
2575
+ typeName: m.ZodEffects,
2576
2576
  ...v(s)
2577
2577
  });
2578
- class N extends _ {
2578
+ class I extends _ {
2579
2579
  _parse(e) {
2580
2580
  return this._getType(e) === f.undefined ? T(void 0) : this._def.innerType._parse(e);
2581
2581
  }
@@ -2583,9 +2583,9 @@ class N extends _ {
2583
2583
  return this._def.innerType;
2584
2584
  }
2585
2585
  }
2586
- N.create = (t, e) => new N({
2586
+ I.create = (t, e) => new I({
2587
2587
  innerType: t,
2588
- typeName: p.ZodOptional,
2588
+ typeName: m.ZodOptional,
2589
2589
  ...v(e)
2590
2590
  });
2591
2591
  class L extends _ {
@@ -2598,10 +2598,10 @@ class L extends _ {
2598
2598
  }
2599
2599
  L.create = (t, e) => new L({
2600
2600
  innerType: t,
2601
- typeName: p.ZodNullable,
2601
+ typeName: m.ZodNullable,
2602
2602
  ...v(e)
2603
2603
  });
2604
- class fe extends _ {
2604
+ class he extends _ {
2605
2605
  _parse(e) {
2606
2606
  const { ctx: s } = this._processInputParams(e);
2607
2607
  let n = s.data;
@@ -2615,13 +2615,13 @@ class fe extends _ {
2615
2615
  return this._def.innerType;
2616
2616
  }
2617
2617
  }
2618
- fe.create = (t, e) => new fe({
2618
+ he.create = (t, e) => new he({
2619
2619
  innerType: t,
2620
- typeName: p.ZodDefault,
2620
+ typeName: m.ZodDefault,
2621
2621
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2622
2622
  ...v(e)
2623
2623
  });
2624
- class he extends _ {
2624
+ class pe extends _ {
2625
2625
  _parse(e) {
2626
2626
  const { ctx: s } = this._processInputParams(e), n = {
2627
2627
  ...s,
@@ -2636,11 +2636,11 @@ class he extends _ {
2636
2636
  ...n
2637
2637
  }
2638
2638
  });
2639
- return se(r) ? r.then((a) => ({
2639
+ return ne(r) ? r.then((a) => ({
2640
2640
  status: "valid",
2641
2641
  value: a.status === "valid" ? a.value : this._def.catchValue({
2642
2642
  get error() {
2643
- return new C(n.common.issues);
2643
+ return new E(n.common.issues);
2644
2644
  },
2645
2645
  input: n.data
2646
2646
  })
@@ -2648,7 +2648,7 @@ class he extends _ {
2648
2648
  status: "valid",
2649
2649
  value: r.status === "valid" ? r.value : this._def.catchValue({
2650
2650
  get error() {
2651
- return new C(n.common.issues);
2651
+ return new E(n.common.issues);
2652
2652
  },
2653
2653
  input: n.data
2654
2654
  })
@@ -2658,13 +2658,13 @@ class he extends _ {
2658
2658
  return this._def.innerType;
2659
2659
  }
2660
2660
  }
2661
- he.create = (t, e) => new he({
2661
+ pe.create = (t, e) => new pe({
2662
2662
  innerType: t,
2663
- typeName: p.ZodCatch,
2663
+ typeName: m.ZodCatch,
2664
2664
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2665
2665
  ...v(e)
2666
2666
  });
2667
- class we extends _ {
2667
+ class Te extends _ {
2668
2668
  _parse(e) {
2669
2669
  if (this._getType(e) !== f.nan) {
2670
2670
  const n = this._getOrReturnCtx(e);
@@ -2672,17 +2672,17 @@ class we extends _ {
2672
2672
  code: c.invalid_type,
2673
2673
  expected: f.nan,
2674
2674
  received: n.parsedType
2675
- }), g;
2675
+ }), y;
2676
2676
  }
2677
2677
  return { status: "valid", value: e.data };
2678
2678
  }
2679
2679
  }
2680
- we.create = (t) => new we({
2681
- typeName: p.ZodNaN,
2680
+ Te.create = (t) => new Te({
2681
+ typeName: m.ZodNaN,
2682
2682
  ...v(t)
2683
2683
  });
2684
- const xt = Symbol("zod_brand");
2685
- class Me extends _ {
2684
+ const bt = Symbol("zod_brand");
2685
+ class Ne extends _ {
2686
2686
  _parse(e) {
2687
2687
  const { ctx: s } = this._processInputParams(e), n = s.data;
2688
2688
  return this._def.type._parse({
@@ -2695,7 +2695,7 @@ class Me extends _ {
2695
2695
  return this._def.type;
2696
2696
  }
2697
2697
  }
2698
- class me extends _ {
2698
+ class ge extends _ {
2699
2699
  _parse(e) {
2700
2700
  const { status: s, ctx: n } = this._processInputParams(e);
2701
2701
  if (n.common.async)
@@ -2705,7 +2705,7 @@ class me extends _ {
2705
2705
  path: n.path,
2706
2706
  parent: n
2707
2707
  });
2708
- return a.status === "aborted" ? g : a.status === "dirty" ? (s.dirty(), W(a.value)) : this._def.out._parseAsync({
2708
+ return a.status === "aborted" ? y : a.status === "dirty" ? (s.dirty(), W(a.value)) : this._def.out._parseAsync({
2709
2709
  data: a.value,
2710
2710
  path: n.path,
2711
2711
  parent: n
@@ -2717,7 +2717,7 @@ class me extends _ {
2717
2717
  path: n.path,
2718
2718
  parent: n
2719
2719
  });
2720
- return r.status === "aborted" ? g : r.status === "dirty" ? (s.dirty(), {
2720
+ return r.status === "aborted" ? y : r.status === "dirty" ? (s.dirty(), {
2721
2721
  status: "dirty",
2722
2722
  value: r.value
2723
2723
  }) : this._def.out._parseSync({
@@ -2728,25 +2728,25 @@ class me extends _ {
2728
2728
  }
2729
2729
  }
2730
2730
  static create(e, s) {
2731
- return new me({
2731
+ return new ge({
2732
2732
  in: e,
2733
2733
  out: s,
2734
- typeName: p.ZodPipeline
2734
+ typeName: m.ZodPipeline
2735
2735
  });
2736
2736
  }
2737
2737
  }
2738
- class pe extends _ {
2738
+ class me extends _ {
2739
2739
  _parse(e) {
2740
- const s = this._def.innerType._parse(e), n = (r) => (te(r) && (r.value = Object.freeze(r.value)), r);
2741
- return se(s) ? s.then((r) => n(r)) : n(s);
2740
+ const s = this._def.innerType._parse(e), n = (r) => (se(r) && (r.value = Object.freeze(r.value)), r);
2741
+ return ne(s) ? s.then((r) => n(r)) : n(s);
2742
2742
  }
2743
2743
  unwrap() {
2744
2744
  return this._def.innerType;
2745
2745
  }
2746
2746
  }
2747
- pe.create = (t, e) => new pe({
2747
+ me.create = (t, e) => new me({
2748
2748
  innerType: t,
2749
- typeName: p.ZodReadonly,
2749
+ typeName: m.ZodReadonly,
2750
2750
  ...v(e)
2751
2751
  });
2752
2752
  function ze(t, e = {}, s) {
@@ -2758,41 +2758,41 @@ function ze(t, e = {}, s) {
2758
2758
  }
2759
2759
  }) : J.create();
2760
2760
  }
2761
- const bt = {
2761
+ const kt = {
2762
2762
  object: b.lazycreate
2763
2763
  };
2764
- var p;
2764
+ var m;
2765
2765
  (function(t) {
2766
2766
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
2767
- })(p || (p = {}));
2768
- const kt = (t, e = {
2767
+ })(m || (m = {}));
2768
+ const wt = (t, e = {
2769
2769
  message: `Input not instance of ${t.name}`
2770
- }) => ze((s) => s instanceof t, e), Qe = Z.create, Ge = $.create, wt = we.create, Tt = U.create, We = ne.create, St = z.create, Rt = xe.create, Ct = re.create, Zt = ae.create, Et = J.create, Ot = B.create, Nt = A.create, Mt = be.create, It = E.create, jt = b.create, At = b.strictCreate, Pt = ie.create, $t = Te.create, Ut = oe.create, qt = I.create, Lt = ce.create, Vt = ke.create, Dt = Q.create, Bt = H.create, zt = de.create, Qt = ue.create, Gt = q.create, Wt = le.create, Ht = X.create, Pe = O.create, Yt = N.create, Jt = L.create, Xt = O.createWithPreprocess, Kt = me.create, Ft = () => Qe().optional(), es = () => Ge().optional(), ts = () => We().optional(), ss = {
2771
- string: (t) => Z.create({ ...t, coerce: !0 }),
2772
- number: (t) => $.create({ ...t, coerce: !0 }),
2773
- boolean: (t) => ne.create({
2770
+ }) => ze((s) => s instanceof t, e), Ge = C.create, Qe = q.create, St = Te.create, Tt = $.create, We = re.create, Rt = z.create, Et = ke.create, Ct = ae.create, Zt = ie.create, Ot = J.create, It = B.create, Mt = A.create, Nt = we.create, jt = Z.create, At = b.create, Pt = b.strictCreate, qt = oe.create, $t = Re.create, Ut = ce.create, Lt = N.create, Vt = de.create, Dt = Se.create, Bt = G.create, zt = H.create, Gt = ue.create, Qt = le.create, Wt = U.create, Ht = fe.create, Yt = X.create, Pe = O.create, Jt = I.create, Xt = L.create, Kt = O.createWithPreprocess, Ft = ge.create, es = () => Ge().optional(), ts = () => Qe().optional(), ss = () => We().optional(), ns = {
2771
+ string: (t) => C.create({ ...t, coerce: !0 }),
2772
+ number: (t) => q.create({ ...t, coerce: !0 }),
2773
+ boolean: (t) => re.create({
2774
2774
  ...t,
2775
2775
  coerce: !0
2776
2776
  }),
2777
- bigint: (t) => U.create({ ...t, coerce: !0 }),
2777
+ bigint: (t) => $.create({ ...t, coerce: !0 }),
2778
2778
  date: (t) => z.create({ ...t, coerce: !0 })
2779
- }, ns = g;
2780
- var y = /* @__PURE__ */ Object.freeze({
2779
+ }, rs = y;
2780
+ var p = /* @__PURE__ */ Object.freeze({
2781
2781
  __proto__: null,
2782
2782
  defaultErrorMap: Y,
2783
- setErrorMap: nt,
2784
- getErrorMap: ye,
2785
- makeIssue: ve,
2786
- EMPTY_PATH: rt,
2783
+ setErrorMap: rt,
2784
+ getErrorMap: _e,
2785
+ makeIssue: xe,
2786
+ EMPTY_PATH: at,
2787
2787
  addIssueToContext: l,
2788
- ParseStatus: w,
2789
- INVALID: g,
2788
+ ParseStatus: S,
2789
+ INVALID: y,
2790
2790
  DIRTY: W,
2791
2791
  OK: T,
2792
- isAborted: Ee,
2793
- isDirty: Oe,
2794
- isValid: te,
2795
- isAsync: se,
2792
+ isAborted: Oe,
2793
+ isDirty: Ie,
2794
+ isValid: se,
2795
+ isAsync: ne,
2796
2796
  get util() {
2797
2797
  return x;
2798
2798
  },
@@ -2803,233 +2803,256 @@ var y = /* @__PURE__ */ Object.freeze({
2803
2803
  getParsedType: P,
2804
2804
  ZodType: _,
2805
2805
  datetimeRegex: De,
2806
- ZodString: Z,
2807
- ZodNumber: $,
2808
- ZodBigInt: U,
2809
- ZodBoolean: ne,
2806
+ ZodString: C,
2807
+ ZodNumber: q,
2808
+ ZodBigInt: $,
2809
+ ZodBoolean: re,
2810
2810
  ZodDate: z,
2811
- ZodSymbol: xe,
2812
- ZodUndefined: re,
2813
- ZodNull: ae,
2811
+ ZodSymbol: ke,
2812
+ ZodUndefined: ae,
2813
+ ZodNull: ie,
2814
2814
  ZodAny: J,
2815
2815
  ZodUnknown: B,
2816
2816
  ZodNever: A,
2817
- ZodVoid: be,
2818
- ZodArray: E,
2817
+ ZodVoid: we,
2818
+ ZodArray: Z,
2819
2819
  ZodObject: b,
2820
- ZodUnion: ie,
2821
- ZodDiscriminatedUnion: Te,
2822
- ZodIntersection: oe,
2823
- ZodTuple: I,
2824
- ZodRecord: ce,
2825
- ZodMap: ke,
2826
- ZodSet: Q,
2820
+ ZodUnion: oe,
2821
+ ZodDiscriminatedUnion: Re,
2822
+ ZodIntersection: ce,
2823
+ ZodTuple: N,
2824
+ ZodRecord: de,
2825
+ ZodMap: Se,
2826
+ ZodSet: G,
2827
2827
  ZodFunction: H,
2828
- ZodLazy: de,
2829
- ZodLiteral: ue,
2830
- ZodEnum: q,
2831
- ZodNativeEnum: le,
2828
+ ZodLazy: ue,
2829
+ ZodLiteral: le,
2830
+ ZodEnum: U,
2831
+ ZodNativeEnum: fe,
2832
2832
  ZodPromise: X,
2833
2833
  ZodEffects: O,
2834
2834
  ZodTransformer: O,
2835
- ZodOptional: N,
2835
+ ZodOptional: I,
2836
2836
  ZodNullable: L,
2837
- ZodDefault: fe,
2838
- ZodCatch: he,
2839
- ZodNaN: we,
2840
- BRAND: xt,
2841
- ZodBranded: Me,
2842
- ZodPipeline: me,
2843
- ZodReadonly: pe,
2837
+ ZodDefault: he,
2838
+ ZodCatch: pe,
2839
+ ZodNaN: Te,
2840
+ BRAND: bt,
2841
+ ZodBranded: Ne,
2842
+ ZodPipeline: ge,
2843
+ ZodReadonly: me,
2844
2844
  custom: ze,
2845
2845
  Schema: _,
2846
2846
  ZodSchema: _,
2847
- late: bt,
2847
+ late: kt,
2848
2848
  get ZodFirstPartyTypeKind() {
2849
- return p;
2849
+ return m;
2850
2850
  },
2851
- coerce: ss,
2852
- any: Et,
2853
- array: It,
2851
+ coerce: ns,
2852
+ any: Ot,
2853
+ array: jt,
2854
2854
  bigint: Tt,
2855
2855
  boolean: We,
2856
- date: St,
2856
+ date: Rt,
2857
2857
  discriminatedUnion: $t,
2858
2858
  effect: Pe,
2859
- enum: Gt,
2860
- function: Bt,
2861
- instanceof: kt,
2859
+ enum: Wt,
2860
+ function: zt,
2861
+ instanceof: wt,
2862
2862
  intersection: Ut,
2863
- lazy: zt,
2863
+ lazy: Gt,
2864
2864
  literal: Qt,
2865
- map: Vt,
2866
- nan: wt,
2867
- nativeEnum: Wt,
2868
- never: Nt,
2865
+ map: Dt,
2866
+ nan: St,
2867
+ nativeEnum: Ht,
2868
+ never: Mt,
2869
2869
  null: Zt,
2870
- nullable: Jt,
2871
- number: Ge,
2872
- object: jt,
2873
- oboolean: ts,
2874
- onumber: es,
2875
- optional: Yt,
2876
- ostring: Ft,
2877
- pipeline: Kt,
2878
- preprocess: Xt,
2879
- promise: Ht,
2880
- record: Lt,
2881
- set: Dt,
2882
- strictObject: At,
2883
- string: Qe,
2884
- symbol: Rt,
2870
+ nullable: Xt,
2871
+ number: Qe,
2872
+ object: At,
2873
+ oboolean: ss,
2874
+ onumber: ts,
2875
+ optional: Jt,
2876
+ ostring: es,
2877
+ pipeline: Ft,
2878
+ preprocess: Kt,
2879
+ promise: Yt,
2880
+ record: Vt,
2881
+ set: Bt,
2882
+ strictObject: Pt,
2883
+ string: Ge,
2884
+ symbol: Et,
2885
2885
  transformer: Pe,
2886
- tuple: qt,
2886
+ tuple: Lt,
2887
2887
  undefined: Ct,
2888
- union: Pt,
2889
- unknown: Ot,
2890
- void: Mt,
2891
- NEVER: ns,
2888
+ union: qt,
2889
+ unknown: It,
2890
+ void: Nt,
2891
+ NEVER: rs,
2892
2892
  ZodIssueCode: c,
2893
- quotelessJson: st,
2894
- ZodError: C
2893
+ quotelessJson: nt,
2894
+ ZodError: E
2895
2895
  });
2896
- const S = y.object({
2897
- type: y.literal("qp-bridge"),
2898
- id: y.string().optional()
2899
- }), rs = S.extend({
2900
- status: y.literal("answerChanged"),
2901
- question: y.string(),
2902
- answer: y.unknown()
2903
- }), Se = S.extend({
2904
- status: y.literal("success")
2905
- }), as = S.extend({
2906
- status: y.literal("error"),
2907
- message: y.string()
2908
- }), He = y.object({
2909
- semanticColor: y.string().optional(),
2910
- label: y.string(),
2911
- description: y.string(),
2912
- disabled: y.boolean(),
2913
- required: y.boolean(),
2914
- hidden: y.boolean(),
2915
- errorMessage: y.string().optional()
2916
- }), is = He.partial(), os = y.object({
2917
- id: y.string().uuid(),
2918
- name: y.string(),
2919
- mimeType: y.string(),
2920
- blobUrl: y.string()
2921
- }), Ye = y.object({
2922
- label: y.string(),
2923
- hidden: y.boolean(),
2924
- collapsed: y.boolean()
2925
- }), cs = Ye.partial(), ds = S.extend({
2926
- action: y.literal("getQuestion"),
2927
- question: y.string()
2928
- }), us = Se.extend({
2896
+ const w = p.object({
2897
+ type: p.literal("qp-bridge"),
2898
+ id: p.string().optional()
2899
+ }), as = w.extend({
2900
+ status: p.literal("answerChanged"),
2901
+ question: p.string(),
2902
+ answer: p.unknown()
2903
+ }), K = w.extend({
2904
+ status: p.literal("success")
2905
+ }), is = w.extend({
2906
+ status: p.literal("error"),
2907
+ message: p.string()
2908
+ }), He = p.object({
2909
+ semanticColor: p.string().optional(),
2910
+ label: p.string(),
2911
+ description: p.string(),
2912
+ disabled: p.boolean(),
2913
+ required: p.boolean(),
2914
+ hidden: p.boolean(),
2915
+ errorMessage: p.string().optional()
2916
+ }), os = He.partial(), cs = p.object({
2917
+ id: p.string().uuid(),
2918
+ name: p.string(),
2919
+ mimeType: p.string(),
2920
+ blobUrl: p.string()
2921
+ }), Ye = p.record(p.unknown()), Je = p.object({
2922
+ label: p.string(),
2923
+ hidden: p.boolean(),
2924
+ collapsed: p.boolean()
2925
+ }), ds = Je.partial(), us = w.extend({
2926
+ action: p.literal("getQuestion"),
2927
+ question: p.string()
2928
+ }), ls = K.extend({
2929
2929
  question: He
2930
- }), ls = S.extend({
2931
- action: y.literal("setQuestion"),
2932
- question: y.string(),
2933
- questionData: is
2934
- }), fs = S.extend({
2935
- action: y.literal("getGroup"),
2936
- group: y.string()
2937
- }), hs = Se.extend({
2938
- group: Ye
2939
- }), ps = Se.extend({
2940
- canSave: y.boolean()
2941
- }), ms = S.extend({
2942
- action: y.literal("canSave")
2943
- }), gs = S.extend({
2944
- action: y.literal("setGroup"),
2945
- group: y.string(),
2946
- groupData: cs
2947
- }), ys = S.extend({
2948
- action: y.literal("setAnswer"),
2949
- question: y.string(),
2950
- answer: y.unknown()
2951
- }), vs = S.extend({
2952
- action: y.literal("busyIndicatorStart")
2953
- }), _s = S.extend({
2954
- action: y.literal("busyIndicatorEnd")
2955
- }), xs = S.extend({
2956
- action: y.literal("saveQuestionnaire")
2957
- }), bs = S.extend({
2958
- action: y.literal("completeAndCloseQuestionnaire")
2959
- }), ks = S.extend({
2960
- action: y.literal("executeCustomCommand"),
2961
- commandName: y.string()
2930
+ }), fs = w.extend({
2931
+ action: p.literal("setQuestion"),
2932
+ question: p.string(),
2933
+ questionData: os
2934
+ }), hs = w.extend({
2935
+ action: p.literal("getGroup"),
2936
+ group: p.string()
2937
+ }), ps = K.extend({
2938
+ group: Je
2939
+ }), ms = K.extend({
2940
+ canSave: p.boolean()
2941
+ }), gs = w.extend({
2942
+ action: p.literal("canSave")
2943
+ }), ys = w.extend({
2944
+ action: p.literal("setGroup"),
2945
+ group: p.string(),
2946
+ groupData: ds
2947
+ }), vs = w.extend({
2948
+ action: p.literal("setAnswer"),
2949
+ question: p.string(),
2950
+ answer: p.unknown()
2951
+ }), _s = w.extend({
2952
+ action: p.literal("busyIndicatorStart")
2953
+ }), xs = w.extend({
2954
+ action: p.literal("busyIndicatorEnd")
2955
+ }), bs = w.extend({
2956
+ action: p.literal("saveQuestionnaire")
2957
+ }), ks = w.extend({
2958
+ action: p.literal("completeAndCloseQuestionnaire")
2959
+ }), ws = w.extend({
2960
+ action: p.literal("executeCustomCommand"),
2961
+ commandName: p.string()
2962
+ }), Ss = w.extend({
2963
+ action: p.literal("fetchEntities"),
2964
+ fetchXml: p.string()
2965
+ }), Ts = K.extend({
2966
+ entities: p.array(Ye)
2967
+ }), Rs = w.extend({
2968
+ action: p.literal("getEntityById"),
2969
+ entityName: p.string(),
2970
+ entityId: p.string()
2971
+ }), Es = K.extend({
2972
+ entity: Ye
2962
2973
  });
2963
- function js(t) {
2964
- return os.safeParse(t).success;
2965
- }
2966
- function ws(t) {
2967
- return rs.safeParse(t).success;
2974
+ function Bs(t) {
2975
+ return cs.safeParse(t).success;
2968
2976
  }
2969
- function Je(t) {
2970
- return S.safeParse(t).success;
2977
+ function Cs(t) {
2978
+ return as.safeParse(t).success;
2971
2979
  }
2972
- function Ts(t) {
2973
- return Se.safeParse(t).success;
2980
+ function Xe(t) {
2981
+ return w.safeParse(t).success;
2974
2982
  }
2975
- function Ss(t) {
2976
- return as.safeParse(t).success;
2983
+ function Zs(t) {
2984
+ return K.safeParse(t).success;
2977
2985
  }
2978
- function As(t) {
2979
- return ds.safeParse(t).success;
2986
+ function Os(t) {
2987
+ return is.safeParse(t).success;
2980
2988
  }
2981
- function Rs(t) {
2989
+ function zs(t) {
2982
2990
  return us.safeParse(t).success;
2983
2991
  }
2984
- function Ps(t) {
2985
- return ys.safeParse(t).success;
2986
- }
2987
- function $s(t) {
2992
+ function Is(t) {
2988
2993
  return ls.safeParse(t).success;
2989
2994
  }
2990
- function Us(t) {
2991
- return gs.safeParse(t).success;
2995
+ function Gs(t) {
2996
+ return vs.safeParse(t).success;
2992
2997
  }
2993
- function qs(t) {
2998
+ function Qs(t) {
2994
2999
  return fs.safeParse(t).success;
2995
3000
  }
2996
- function Cs(t) {
3001
+ function Ws(t) {
3002
+ return ys.safeParse(t).success;
3003
+ }
3004
+ function Hs(t) {
2997
3005
  return hs.safeParse(t).success;
2998
3006
  }
2999
- function Ls(t) {
3007
+ function Ms(t) {
3000
3008
  return ps.safeParse(t).success;
3001
3009
  }
3002
- function Zs(t) {
3010
+ function Ys(t) {
3003
3011
  return ms.safeParse(t).success;
3004
3012
  }
3005
- function Es(t) {
3006
- return vs.safeParse(t).success;
3013
+ function Ns(t) {
3014
+ return gs.safeParse(t).success;
3007
3015
  }
3008
- function Os(t) {
3016
+ function js(t) {
3009
3017
  return _s.safeParse(t).success;
3010
3018
  }
3011
- function Vs(t) {
3019
+ function As(t) {
3012
3020
  return xs.safeParse(t).success;
3013
3021
  }
3014
- function Ds(t) {
3022
+ function Js(t) {
3015
3023
  return bs.safeParse(t).success;
3016
3024
  }
3017
- function Bs(t) {
3025
+ function Xs(t) {
3018
3026
  return ks.safeParse(t).success;
3019
3027
  }
3020
- function zs(t) {
3021
- return Es(t) || Os(t);
3028
+ function Ks(t) {
3029
+ return ws.safeParse(t).success;
3022
3030
  }
3023
- function Xe(t) {
3031
+ function Fs(t) {
3032
+ return js(t) || As(t);
3033
+ }
3034
+ function en(t) {
3035
+ return Ss.safeParse(t).success;
3036
+ }
3037
+ function Ps(t) {
3038
+ return Ts.safeParse(t).success;
3039
+ }
3040
+ function tn(t) {
3041
+ return Rs.safeParse(t).success;
3042
+ }
3043
+ function qs(t) {
3044
+ return Es.safeParse(t).success;
3045
+ }
3046
+ function Ke(t) {
3024
3047
  if (t instanceof File || t instanceof Blob)
3025
3048
  return URL.createObjectURL(t);
3026
3049
  if (typeof t == "string") {
3027
3050
  if (/^data:/.test(t)) {
3028
3051
  const a = t.match(/^data:([^;]+);base64,(.*)$/);
3029
3052
  if (a) {
3030
- const i = a[1], o = a[2], d = atob(o), u = new ArrayBuffer(d.length), m = new Uint8Array(u);
3053
+ const i = a[1], o = a[2], d = atob(o), u = new ArrayBuffer(d.length), g = new Uint8Array(u);
3031
3054
  for (let D = 0; D < d.length; D++)
3032
- m[D] = d.charCodeAt(D);
3055
+ g[D] = d.charCodeAt(D);
3033
3056
  const R = new Blob([u], { type: i });
3034
3057
  return URL.createObjectURL(R);
3035
3058
  }
@@ -3047,24 +3070,24 @@ function Xe(t) {
3047
3070
  }
3048
3071
  throw new Error("Unsupported content type for blobUrl");
3049
3072
  }
3050
- function Qs(t, e, s, n) {
3073
+ function sn(t, e, s, n) {
3051
3074
  return {
3052
- id: n ?? $e(),
3075
+ id: n ?? qe(),
3053
3076
  name: t,
3054
3077
  mimeType: e,
3055
- blobUrl: Xe(s)
3078
+ blobUrl: Ke(s)
3056
3079
  };
3057
3080
  }
3058
- function Gs(t, e) {
3081
+ function nn(t, e) {
3059
3082
  let s = t.blobUrl;
3060
- return e.content !== void 0 && (s = Xe(e.content)), {
3083
+ return e.content !== void 0 && (s = Ke(e.content)), {
3061
3084
  ...t,
3062
3085
  ...e,
3063
3086
  blobUrl: s
3064
3087
  };
3065
3088
  }
3066
- window.addEventListener("message", Ns);
3067
- async function Ws(t, e) {
3089
+ window.addEventListener("message", $s);
3090
+ async function rn(t, e) {
3068
3091
  await V({
3069
3092
  type: "qp-bridge",
3070
3093
  action: "setAnswer",
@@ -3072,14 +3095,14 @@ async function Ws(t, e) {
3072
3095
  answer: e
3073
3096
  });
3074
3097
  }
3075
- async function Hs(t) {
3076
- return await Ms({
3098
+ async function an(t) {
3099
+ return await Us({
3077
3100
  type: "qp-bridge",
3078
3101
  action: "getQuestion",
3079
3102
  question: t
3080
3103
  });
3081
3104
  }
3082
- async function Ys(t, e) {
3105
+ async function on(t, e) {
3083
3106
  await V({
3084
3107
  type: "qp-bridge",
3085
3108
  action: "setQuestion",
@@ -3087,14 +3110,14 @@ async function Ys(t, e) {
3087
3110
  questionData: e
3088
3111
  });
3089
3112
  }
3090
- async function Js(t) {
3091
- return await Is({
3113
+ async function cn(t) {
3114
+ return await Ls({
3092
3115
  type: "qp-bridge",
3093
3116
  action: "getGroup",
3094
3117
  group: t
3095
3118
  });
3096
3119
  }
3097
- async function Xs(t, e) {
3120
+ async function dn(t, e) {
3098
3121
  await V({
3099
3122
  type: "qp-bridge",
3100
3123
  action: "setGroup",
@@ -3102,9 +3125,9 @@ async function Xs(t, e) {
3102
3125
  groupData: e
3103
3126
  });
3104
3127
  }
3105
- function Ks(t) {
3128
+ function un(t) {
3106
3129
  const e = (s) => {
3107
- ws(s.data) && t(s.data.question, s.data.answer);
3130
+ Cs(s.data) && t(s.data.question, s.data.answer);
3108
3131
  };
3109
3132
  return window.addEventListener("message", e), {
3110
3133
  cancelSubscription: () => {
@@ -3112,7 +3135,7 @@ function Ks(t) {
3112
3135
  }
3113
3136
  };
3114
3137
  }
3115
- async function Fs(t) {
3138
+ async function ln(t) {
3116
3139
  await V({
3117
3140
  type: "qp-bridge",
3118
3141
  action: "busyIndicatorStart"
@@ -3126,38 +3149,38 @@ async function Fs(t) {
3126
3149
  });
3127
3150
  }
3128
3151
  }
3129
- async function en() {
3152
+ async function fn() {
3130
3153
  await V({
3131
3154
  type: "qp-bridge",
3132
3155
  action: "saveQuestionnaire"
3133
3156
  });
3134
3157
  }
3135
- async function tn() {
3158
+ async function hn() {
3136
3159
  await V({
3137
3160
  type: "qp-bridge",
3138
3161
  action: "completeAndCloseQuestionnaire"
3139
3162
  });
3140
3163
  }
3141
- async function sn(t) {
3164
+ async function pn(t) {
3142
3165
  await V({
3143
3166
  type: "qp-bridge",
3144
3167
  action: "executeCustomCommand",
3145
3168
  commandName: t
3146
3169
  });
3147
3170
  }
3148
- const ee = [];
3149
- function nn(t) {
3150
- return ee.includes(t) || ee.push(t), {
3171
+ const te = [];
3172
+ function mn(t) {
3173
+ return te.includes(t) || te.push(t), {
3151
3174
  cancelSubscription: () => {
3152
- const e = ee.indexOf(t);
3153
- e !== -1 && ee.splice(e, 1);
3175
+ const e = te.indexOf(t);
3176
+ e !== -1 && te.splice(e, 1);
3154
3177
  }
3155
3178
  };
3156
3179
  }
3157
- async function Ns(t) {
3180
+ async function $s(t) {
3158
3181
  try {
3159
- if (Zs(t.data)) {
3160
- const e = await Promise.all(ee.map((n) => n())), s = {
3182
+ if (Ns(t.data)) {
3183
+ const e = await Promise.all(te.map((n) => n())), s = {
3161
3184
  type: "qp-bridge",
3162
3185
  status: "success",
3163
3186
  id: t.data.id,
@@ -3169,87 +3192,119 @@ async function Ns(t) {
3169
3192
  const s = {
3170
3193
  type: "qp-bridge",
3171
3194
  status: "error",
3172
- id: Je(t.data) ? t.data.id : void 0,
3195
+ id: Xe(t.data) ? t.data.id : void 0,
3173
3196
  message: e instanceof Error ? e.message : "Unknown error"
3174
3197
  };
3175
3198
  window.parent.postMessage(s, "*");
3176
3199
  }
3177
3200
  }
3178
- async function Ie(t, e) {
3201
+ async function gn(t) {
3202
+ return await Vs({
3203
+ type: "qp-bridge",
3204
+ action: "fetchEntities",
3205
+ fetchXml: t
3206
+ });
3207
+ }
3208
+ async function yn(t, e) {
3209
+ return await Ds({
3210
+ type: "qp-bridge",
3211
+ action: "getEntityById",
3212
+ entityName: t,
3213
+ entityId: e
3214
+ });
3215
+ }
3216
+ async function ye(t, e) {
3179
3217
  return new Promise((s, n) => {
3180
- const r = $e(), a = (i) => {
3181
- if (!Je(i.data) || i.data.id !== r)
3218
+ const r = qe(), a = (i) => {
3219
+ if (!Xe(i.data) || i.data.id !== r)
3182
3220
  return;
3183
3221
  const d = e(i.data);
3184
- d.success ? s(d.data) : Ss(i.data) ? n(new Error(i.data.message)) : n(new Error("Unknown message received")), window.removeEventListener("message", a);
3222
+ d.success ? s(d.data) : Os(i.data) ? n(new Error(i.data.message)) : n(new Error("Unknown message received")), window.removeEventListener("message", a);
3185
3223
  };
3186
3224
  window.addEventListener("message", a), window.parent.postMessage({ ...t, id: r }, "*");
3187
3225
  });
3188
3226
  }
3189
- async function Ms(t) {
3190
- return Ie(t, (e) => Rs(e) ? { success: !0, data: e.question } : { success: !1 });
3227
+ async function Us(t) {
3228
+ return ye(t, (e) => Is(e) ? { success: !0, data: e.question } : { success: !1 });
3191
3229
  }
3192
- async function Is(t) {
3193
- return Ie(t, (e) => Cs(e) ? { success: !0, data: e.group } : { success: !1 });
3230
+ async function Ls(t) {
3231
+ return ye(t, (e) => Ms(e) ? { success: !0, data: e.group } : { success: !1 });
3194
3232
  }
3195
3233
  function V(t) {
3196
- return Ie(t, (e) => Ts(e) ? { success: !0, data: void 0 } : { success: !1 });
3234
+ return ye(t, (e) => Zs(e) ? { success: !0, data: void 0 } : { success: !1 });
3235
+ }
3236
+ async function Vs(t) {
3237
+ return ye(t, (e) => Ps(e) ? { success: !0, data: e.entities } : { success: !1 });
3238
+ }
3239
+ async function Ds(t) {
3240
+ return ye(t, (e) => qs(e) ? { success: !0, data: e.entity } : { success: !1 });
3197
3241
  }
3198
3242
  export {
3199
- _s as busyIndicatorEndRequestMessageSchema,
3200
- vs as busyIndicatorStartRequestMessageSchema,
3201
- ms as canSaveRequestMessageSchema,
3202
- ps as canSaveSuccessResponseMessageSchema,
3203
- tn as completeAndCloseQuestionnaire,
3204
- bs as completeAndCloseQuestionnaireRequestMessageSchema,
3205
- Qs as createMediaItem,
3206
- sn as executeCustomCommand,
3207
- ks as executeCustomCommandRequestMessageSchema,
3208
- Js as getGroup,
3209
- fs as getGroupRequestMessageSchema,
3210
- hs as getGroupSuccessResponseMessageSchema,
3211
- Hs as getQuestion,
3212
- ds as getQuestionRequestMessageSchema,
3213
- us as getQuestionSuccessResponseMessageSchema,
3214
- cs as groupOptionalScheme,
3215
- Ye as groupSchema,
3216
- Os as isBusyIndicatorEndRequestMessage,
3217
- Es as isBusyIndicatorStartRequestMessage,
3218
- Zs as isCanSaveRequestMessage,
3219
- Ls as isCanSaveSuccessResponseMessage,
3220
- Ds as isCompleteAndCloseQuestionnaireRequestMessage,
3221
- Ss as isErrorMessage,
3222
- Bs as isExecuteCustomCommandRequestMessage,
3223
- qs as isGetGroupRequestMessage,
3224
- Cs as isGetGroupSuccessResponseMessage,
3225
- As as isGetQuestionRequestMessage,
3226
- Rs as isGetQuestionSuccessResponseMessage,
3227
- js as isMediaItem,
3228
- ws as isOnAnswerChangeMessage,
3229
- Je as isQpBridgeMessage,
3230
- Vs as isSaveQuestionnaireRequestMessage,
3231
- Ps as isSetAnswerRequestMessage,
3232
- Us as isSetGroupRequestMessage,
3233
- $s as isSetQuestionRequestMessage,
3234
- Ts as isSuccessMessage,
3235
- zs as isWithBusyIndicatorRequestMessage,
3236
- os as mediaItemSchema,
3237
- Ks as onAnswerChange,
3238
- rs as onAnswerChangeMessageSchema,
3239
- nn as onSave,
3240
- S as qpBridgeMessageSchema,
3241
- is as questionOptionalScheme,
3243
+ xs as busyIndicatorEndRequestMessageSchema,
3244
+ _s as busyIndicatorStartRequestMessageSchema,
3245
+ gs as canSaveRequestMessageSchema,
3246
+ ms as canSaveSuccessResponseMessageSchema,
3247
+ hn as completeAndCloseQuestionnaire,
3248
+ ks as completeAndCloseQuestionnaireRequestMessageSchema,
3249
+ sn as createMediaItem,
3250
+ Ye as entitySchema,
3251
+ pn as executeCustomCommand,
3252
+ ws as executeCustomCommandRequestMessageSchema,
3253
+ gn as fetchEntities,
3254
+ Ss as fetchEntitiesRequestMessageSchema,
3255
+ Ts as fetchEntitiesSuccessResponseMessageSchema,
3256
+ yn as getEntityById,
3257
+ Rs as getEntityByIdRequestMessageSchema,
3258
+ Es as getEntityByIdSuccessResponseMessageSchema,
3259
+ cn as getGroup,
3260
+ hs as getGroupRequestMessageSchema,
3261
+ ps as getGroupSuccessResponseMessageSchema,
3262
+ an as getQuestion,
3263
+ us as getQuestionRequestMessageSchema,
3264
+ ls as getQuestionSuccessResponseMessageSchema,
3265
+ ds as groupOptionalScheme,
3266
+ Je as groupSchema,
3267
+ As as isBusyIndicatorEndRequestMessage,
3268
+ js as isBusyIndicatorStartRequestMessage,
3269
+ Ns as isCanSaveRequestMessage,
3270
+ Ys as isCanSaveSuccessResponseMessage,
3271
+ Xs as isCompleteAndCloseQuestionnaireRequestMessage,
3272
+ Os as isErrorMessage,
3273
+ Ks as isExecuteCustomCommandRequestMessage,
3274
+ en as isFetchEntitiesRequestMessage,
3275
+ Ps as isFetchEntitiesSuccessResponseMessage,
3276
+ tn as isGetEntityByIdRequestMessage,
3277
+ qs as isGetEntityByIdSuccessResponseMessage,
3278
+ Hs as isGetGroupRequestMessage,
3279
+ Ms as isGetGroupSuccessResponseMessage,
3280
+ zs as isGetQuestionRequestMessage,
3281
+ Is as isGetQuestionSuccessResponseMessage,
3282
+ Bs as isMediaItem,
3283
+ Cs as isOnAnswerChangeMessage,
3284
+ Xe as isQpBridgeMessage,
3285
+ Js as isSaveQuestionnaireRequestMessage,
3286
+ Gs as isSetAnswerRequestMessage,
3287
+ Ws as isSetGroupRequestMessage,
3288
+ Qs as isSetQuestionRequestMessage,
3289
+ Zs as isSuccessMessage,
3290
+ Fs as isWithBusyIndicatorRequestMessage,
3291
+ cs as mediaItemSchema,
3292
+ un as onAnswerChange,
3293
+ as as onAnswerChangeMessageSchema,
3294
+ mn as onSave,
3295
+ w as qpBridgeMessageSchema,
3296
+ os as questionOptionalScheme,
3242
3297
  He as questionSchema,
3243
- as as responseErrorMessageSchema,
3244
- Se as responseSuccessMessageSchema,
3245
- en as saveQuestionnaire,
3246
- xs as saveQuestionnaireRequestMessageSchema,
3247
- Ws as setAnswer,
3248
- ys as setAnswerRequestMessageSchema,
3249
- Xs as setGroup,
3250
- gs as setGroupRequestMessageSchema,
3251
- Ys as setQuestion,
3252
- ls as setQuestionRequestMessageSchema,
3253
- Gs as updateMediaItem,
3254
- Fs as withBusyIndicator
3298
+ is as responseErrorMessageSchema,
3299
+ K as responseSuccessMessageSchema,
3300
+ fn as saveQuestionnaire,
3301
+ bs as saveQuestionnaireRequestMessageSchema,
3302
+ rn as setAnswer,
3303
+ vs as setAnswerRequestMessageSchema,
3304
+ dn as setGroup,
3305
+ ys as setGroupRequestMessageSchema,
3306
+ on as setQuestion,
3307
+ fs as setQuestionRequestMessageSchema,
3308
+ nn as updateMediaItem,
3309
+ ln as withBusyIndicator
3255
3310
  };