@animaapp/anima-sdk-react 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -40,15 +40,15 @@ class Hr extends Error {
40
40
  super(e), tn(this, "type"), tn(this, "field"), tn(this, "value"), tn(this, "line"), this.name = "ParseError", this.type = n.type, this.field = n.field, this.value = n.value, this.line = n.line;
41
41
  }
42
42
  }
43
- function Nn(t) {
43
+ function Rn(t) {
44
44
  }
45
45
  function va(t) {
46
- const { onEvent: e = Nn, onError: n = Nn, onRetry: r = Nn, onComment: s } = t;
46
+ const { onEvent: e = Rn, onError: n = Rn, onRetry: r = Rn, onComment: s } = t;
47
47
  let a = "", i = !0, o, u = "", c = "";
48
48
  function h(l) {
49
- const v = i ? l.replace(/^\xEF\xBB\xBF/, "") : l, [y, z] = ba(`${a}${v}`);
50
- for (const N of y)
51
- p(N);
49
+ const v = i ? l.replace(/^\xEF\xBB\xBF/, "") : l, [m, z] = ba(`${a}${v}`);
50
+ for (const R of m)
51
+ p(R);
52
52
  a = z, i = !1;
53
53
  }
54
54
  function p(l) {
@@ -62,13 +62,13 @@ function va(t) {
62
62
  }
63
63
  const v = l.indexOf(":");
64
64
  if (v !== -1) {
65
- const y = l.slice(0, v), z = l[v + 1] === " " ? 2 : 1, N = l.slice(v + z);
66
- k(y, N, l);
65
+ const m = l.slice(0, v), z = l[v + 1] === " " ? 2 : 1, R = l.slice(v + z);
66
+ k(m, R, l);
67
67
  return;
68
68
  }
69
69
  k(l, "", l);
70
70
  }
71
- function k(l, v, y) {
71
+ function k(l, v, m) {
72
72
  switch (l) {
73
73
  case "event":
74
74
  c = v;
@@ -85,7 +85,7 @@ function va(t) {
85
85
  new Hr(`Invalid \`retry\` value: "${v}"`, {
86
86
  type: "invalid-retry",
87
87
  value: v,
88
- line: y
88
+ line: m
89
89
  })
90
90
  );
91
91
  break;
@@ -93,7 +93,7 @@ function va(t) {
93
93
  n(
94
94
  new Hr(
95
95
  `Unknown field "${l.length > 20 ? `${l.slice(0, 20)}…` : l}"`,
96
- { type: "unknown-field", field: l, value: v, line: y }
96
+ { type: "unknown-field", field: l, value: v, line: m }
97
97
  )
98
98
  );
99
99
  break;
@@ -187,11 +187,11 @@ function Jr(t) {
187
187
  }
188
188
  var Ss = (t) => {
189
189
  throw TypeError(t);
190
- }, Ar = (t, e, n) => e.has(t) || Ss("Cannot " + n), A = (t, e, n) => (Ar(t, e, "read from private field"), n ? n.call(t) : e.get(t)), U = (t, e, n) => e.has(t) ? Ss("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), L = (t, e, n, r) => (Ar(t, e, "write to private field"), e.set(t, n), n), Ce = (t, e, n) => (Ar(t, e, "access private method"), n), ne, He, ut, on, fn, Pt, ft, Rt, Ze, ct, ht, dt, Et, fe, Hn, Gn, Jn, Xr, Xn, Yn, xt, Qn, er;
190
+ }, Ar = (t, e, n) => e.has(t) || Ss("Cannot " + n), A = (t, e, n) => (Ar(t, e, "read from private field"), n ? n.call(t) : e.get(t)), U = (t, e, n) => e.has(t) ? Ss("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), L = (t, e, n, r) => (Ar(t, e, "write to private field"), e.set(t, n), n), Ce = (t, e, n) => (Ar(t, e, "access private method"), n), re, He, ut, on, fn, Nt, ft, Pt, Ze, ct, ht, dt, Et, fe, Hn, Gn, Jn, Xr, Xn, Yn, xt, Qn, er;
191
191
  class un extends EventTarget {
192
192
  constructor(e, n) {
193
193
  var r, s;
194
- super(), U(this, fe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, U(this, ne), U(this, He), U(this, ut), U(this, on), U(this, fn), U(this, Pt), U(this, ft), U(this, Rt, null), U(this, Ze), U(this, ct), U(this, ht, null), U(this, dt, null), U(this, Et, null), U(this, Gn, (a) => Be(this, null, function* () {
194
+ super(), U(this, fe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, U(this, re), U(this, He), U(this, ut), U(this, on), U(this, fn), U(this, Nt), U(this, ft), U(this, Pt, null), U(this, Ze), U(this, ct), U(this, ht, null), U(this, dt, null), U(this, Et, null), U(this, Gn, (a) => Be(this, null, function* () {
195
195
  var i;
196
196
  A(this, ct).reset();
197
197
  const { body: o, redirected: u, status: c, headers: h } = a;
@@ -207,9 +207,9 @@ class un extends EventTarget {
207
207
  Ce(this, fe, xt).call(this, 'Invalid content type, expected "text/event-stream"', c);
208
208
  return;
209
209
  }
210
- if (A(this, ne) === this.CLOSED)
210
+ if (A(this, re) === this.CLOSED)
211
211
  return;
212
- L(this, ne, this.OPEN);
212
+ L(this, re, this.OPEN);
213
213
  const p = new Event("open");
214
214
  if ((i = A(this, Et)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
215
215
  Ce(this, fe, xt).call(this, "Invalid response body, expected a web ReadableStream", c), this.close();
@@ -224,7 +224,7 @@ class un extends EventTarget {
224
224
  })), U(this, Jn, (a) => {
225
225
  L(this, Ze, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ce(this, fe, Qn).call(this, Kn(a));
226
226
  }), U(this, Xn, (a) => {
227
- typeof a.id == "string" && L(this, Rt, a.id);
227
+ typeof a.id == "string" && L(this, Pt, a.id);
228
228
  const i = new MessageEvent(a.event || "message", {
229
229
  data: a.data,
230
230
  origin: A(this, ut) ? A(this, ut).origin : A(this, He).origin,
@@ -232,9 +232,9 @@ class un extends EventTarget {
232
232
  });
233
233
  A(this, dt) && (!a.event || a.event === "message") && A(this, dt).call(this, i), this.dispatchEvent(i);
234
234
  }), U(this, Yn, (a) => {
235
- L(this, Pt, a);
235
+ L(this, Nt, a);
236
236
  }), U(this, er, () => {
237
- L(this, ft, void 0), A(this, ne) === this.CONNECTING && Ce(this, fe, Hn).call(this);
237
+ L(this, ft, void 0), A(this, re) === this.CONNECTING && Ce(this, fe, Hn).call(this);
238
238
  });
239
239
  try {
240
240
  if (e instanceof URL)
@@ -249,7 +249,7 @@ class un extends EventTarget {
249
249
  L(this, ct, va({
250
250
  onEvent: A(this, Xn),
251
251
  onRetry: A(this, Yn)
252
- })), L(this, ne, this.CONNECTING), L(this, Pt, 3e3), L(this, fn, (r = n == null ? void 0 : n.fetch) != null ? r : globalThis.fetch), L(this, on, (s = n == null ? void 0 : n.withCredentials) != null ? s : !1), Ce(this, fe, Hn).call(this);
252
+ })), L(this, re, this.CONNECTING), L(this, Nt, 3e3), L(this, fn, (r = n == null ? void 0 : n.fetch) != null ? r : globalThis.fetch), L(this, on, (s = n == null ? void 0 : n.withCredentials) != null ? s : !1), Ce(this, fe, Hn).call(this);
253
253
  }
254
254
  /**
255
255
  * Returns the state of this EventSource object's connection. It can have the values described below.
@@ -262,7 +262,7 @@ class un extends EventTarget {
262
262
  * @public
263
263
  */
264
264
  get readyState() {
265
- return A(this, ne);
265
+ return A(this, re);
266
266
  }
267
267
  /**
268
268
  * Returns the URL providing the event stream.
@@ -319,16 +319,16 @@ class un extends EventTarget {
319
319
  * @public
320
320
  */
321
321
  close() {
322
- A(this, ft) && clearTimeout(A(this, ft)), A(this, ne) !== this.CLOSED && (A(this, Ze) && A(this, Ze).abort(), L(this, ne, this.CLOSED), L(this, Ze, void 0));
322
+ A(this, ft) && clearTimeout(A(this, ft)), A(this, re) !== this.CLOSED && (A(this, Ze) && A(this, Ze).abort(), L(this, re, this.CLOSED), L(this, Ze, void 0));
323
323
  }
324
324
  }
325
- ne = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), on = /* @__PURE__ */ new WeakMap(), fn = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakSet(), /**
325
+ re = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), on = /* @__PURE__ */ new WeakMap(), fn = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakSet(), /**
326
326
  * Connect to the given URL and start receiving events
327
327
  *
328
328
  * @internal
329
329
  */
330
330
  Hn = function() {
331
- L(this, ne, this.CONNECTING), L(this, Ze, new AbortController()), A(this, fn)(A(this, He), Ce(this, fe, Xr).call(this)).then(A(this, Gn)).catch(A(this, Jn));
331
+ L(this, re, this.CONNECTING), L(this, Ze, new AbortController()), A(this, fn)(A(this, He), Ce(this, fe, Xr).call(this)).then(A(this, Gn)).catch(A(this, Jn));
332
332
  }, Gn = /* @__PURE__ */ new WeakMap(), Jn = /* @__PURE__ */ new WeakMap(), /**
333
333
  * Get request options for the `fetch()` request
334
334
  *
@@ -342,7 +342,7 @@ Xr = function() {
342
342
  // [spec] …will have their mode set to "cors"…
343
343
  mode: "cors",
344
344
  redirect: "follow",
345
- headers: Ue({ Accept: "text/event-stream" }, A(this, Rt) ? { "Last-Event-ID": A(this, Rt) } : void 0),
345
+ headers: Ue({ Accept: "text/event-stream" }, A(this, Pt) ? { "Last-Event-ID": A(this, Pt) } : void 0),
346
346
  cache: "no-store",
347
347
  signal: (t = A(this, Ze)) == null ? void 0 : t.signal
348
348
  };
@@ -356,7 +356,7 @@ Xr = function() {
356
356
  */
357
357
  xt = function(t, e) {
358
358
  var n;
359
- A(this, ne) !== this.CLOSED && L(this, ne, this.CLOSED);
359
+ A(this, re) !== this.CLOSED && L(this, re, this.CLOSED);
360
360
  const r = new Gr("error", { code: e, message: t });
361
361
  (n = A(this, ht)) == null || n.call(this, r), this.dispatchEvent(r);
362
362
  }, /**
@@ -368,11 +368,11 @@ xt = function(t, e) {
368
368
  */
369
369
  Qn = function(t, e) {
370
370
  var n;
371
- if (A(this, ne) === this.CLOSED)
371
+ if (A(this, re) === this.CLOSED)
372
372
  return;
373
- L(this, ne, this.CONNECTING);
373
+ L(this, re, this.CONNECTING);
374
374
  const r = new Gr("error", { code: e, message: t });
375
- (n = A(this, ht)) == null || n.call(this, r), this.dispatchEvent(r), L(this, ft, setTimeout(A(this, er), A(this, Pt)));
375
+ (n = A(this, ht)) == null || n.call(this, r), this.dispatchEvent(r), L(this, ft, setTimeout(A(this, er), A(this, Nt)));
376
376
  }, er = /* @__PURE__ */ new WeakMap(), /**
377
377
  * ReadyState representing an EventSource currently trying to connect
378
378
  *
@@ -424,7 +424,7 @@ var Os = Symbol.for("immer-nothing"), Yr = Symbol.for("immer-draftable"), oe = S
424
424
  // Note: if more errors are added, the errorOffset in Patches.ts should be increased
425
425
  // See Patches.ts for additional errors
426
426
  ] : [];
427
- function re(t, ...e) {
427
+ function se(t, ...e) {
428
428
  if (process.env.NODE_ENV !== "production") {
429
429
  const n = Ea[t], r = typeof n == "function" ? n.apply(null, e) : n;
430
430
  throw new Error(`[Immer] ${r}`);
@@ -510,11 +510,11 @@ function nr(t, e) {
510
510
  return Object.assign(s, t);
511
511
  }
512
512
  }
513
- function Nt(t, e = !1) {
514
- return Tn(t) || yt(t) || !Ye(t) || (xn(t) > 1 && (t.set = t.add = t.clear = t.delete = Oa), Object.freeze(t), e && Object.entries(t).forEach(([n, r]) => Nt(r, !0))), t;
513
+ function Rt(t, e = !1) {
514
+ return Tn(t) || yt(t) || !Ye(t) || (xn(t) > 1 && (t.set = t.add = t.clear = t.delete = Oa), Object.freeze(t), e && Object.entries(t).forEach(([n, r]) => Rt(r, !0))), t;
515
515
  }
516
516
  function Oa() {
517
- re(2);
517
+ se(2);
518
518
  }
519
519
  function Tn(t) {
520
520
  return Object.isFrozen(t);
@@ -522,11 +522,11 @@ function Tn(t) {
522
522
  var Ta = {};
523
523
  function Qe(t) {
524
524
  const e = Ta[t];
525
- return e || re(0, t), e;
525
+ return e || se(0, t), e;
526
526
  }
527
- var It;
527
+ var jt;
528
528
  function Cs() {
529
- return It;
529
+ return jt;
530
530
  }
531
531
  function Aa(t, e) {
532
532
  return {
@@ -546,10 +546,10 @@ function rr(t) {
546
546
  sr(t), t.drafts_.forEach(Ca), t.drafts_ = null;
547
547
  }
548
548
  function sr(t) {
549
- t === It && (It = t.parent_);
549
+ t === jt && (jt = t.parent_);
550
550
  }
551
551
  function es(t) {
552
- return It = Aa(It, t);
552
+ return jt = Aa(jt, t);
553
553
  }
554
554
  function Ca(t) {
555
555
  const e = t[oe];
@@ -558,7 +558,7 @@ function Ca(t) {
558
558
  function ts(t, e) {
559
559
  e.unfinalizedDrafts_ = e.drafts_.length;
560
560
  const n = e.drafts_[0];
561
- return t !== void 0 && t !== n ? (n[oe].modified_ && (rr(e), re(4)), Ye(t) && (t = pn(e, t), e.parent_ || mn(e, t)), e.patches_ && Qe("Patches").generateReplacementPatches_(
561
+ return t !== void 0 && t !== n ? (n[oe].modified_ && (rr(e), se(4)), Ye(t) && (t = pn(e, t), e.parent_ || mn(e, t)), e.patches_ && Qe("Patches").generateReplacementPatches_(
562
562
  n[oe].base_,
563
563
  t,
564
564
  e.patches_,
@@ -595,7 +595,7 @@ function pn(t, e, n) {
595
595
  return r.copy_;
596
596
  }
597
597
  function ns(t, e, n, r, s, a, i) {
598
- if (process.env.NODE_ENV !== "production" && s === n && re(5), yt(s)) {
598
+ if (process.env.NODE_ENV !== "production" && s === n && se(5), yt(s)) {
599
599
  const o = a && e && e.type_ !== 3 && // Set objects are atomic since they have no keys.
600
600
  !tr(e.assigned_, r) ? a.concat(r) : void 0, u = pn(t, s, o);
601
601
  if (As(n, r, u), yt(u))
@@ -610,9 +610,9 @@ function ns(t, e, n, r, s, a, i) {
610
610
  }
611
611
  }
612
612
  function mn(t, e, n = !1) {
613
- !t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && Nt(e, n);
613
+ !t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && Rt(e, n);
614
614
  }
615
- function Pa(t, e) {
615
+ function Na(t, e) {
616
616
  const n = Array.isArray(t), r = {
617
617
  type_: n ? 1 : 0,
618
618
  // Track which produce call this is associated with.
@@ -637,7 +637,7 @@ function Pa(t, e) {
637
637
  isManual_: !1
638
638
  };
639
639
  let s = r, a = Cr;
640
- n && (s = [r], a = jt);
640
+ n && (s = [r], a = It);
641
641
  const { revoke: i, proxy: o } = Proxy.revocable(s, a);
642
642
  return r.draft_ = o, r.revoke_ = i, o;
643
643
  }
@@ -647,9 +647,9 @@ var Cr = {
647
647
  return t;
648
648
  const n = Ke(t);
649
649
  if (!tr(n, e))
650
- return Ra(t, n, e);
650
+ return Pa(t, n, e);
651
651
  const r = n[e];
652
- return t.finalized_ || !Ye(r) ? r : r === In(t.base_, e) ? (jn(t), t.copy_[e] = ir(r, t)) : r;
652
+ return t.finalized_ || !Ye(r) ? r : r === jn(t.base_, e) ? (In(t), t.copy_[e] = ir(r, t)) : r;
653
653
  },
654
654
  has(t, e) {
655
655
  return e in Ke(t);
@@ -658,23 +658,23 @@ var Cr = {
658
658
  return Reflect.ownKeys(Ke(t));
659
659
  },
660
660
  set(t, e, n) {
661
- const r = Ps(Ke(t), e);
661
+ const r = Ns(Ke(t), e);
662
662
  if (r != null && r.set)
663
663
  return r.set.call(t.draft_, n), !0;
664
664
  if (!t.modified_) {
665
- const s = In(Ke(t), e), a = s == null ? void 0 : s[oe];
665
+ const s = jn(Ke(t), e), a = s == null ? void 0 : s[oe];
666
666
  if (a && a.base_ === n)
667
667
  return t.copy_[e] = n, t.assigned_[e] = !1, !0;
668
668
  if (Sa(n, s) && (n !== void 0 || tr(t.base_, e)))
669
669
  return !0;
670
- jn(t), ar(t);
670
+ In(t), ar(t);
671
671
  }
672
672
  return t.copy_[e] === n && // special case: handle new props with value 'undefined'
673
673
  (n !== void 0 || e in t.copy_) || // special case: NaN
674
674
  Number.isNaN(n) && Number.isNaN(t.copy_[e]) || (t.copy_[e] = n, t.assigned_[e] = !0), !0;
675
675
  },
676
676
  deleteProperty(t, e) {
677
- return In(t.base_, e) !== void 0 || e in t.base_ ? (t.assigned_[e] = !1, jn(t), ar(t)) : delete t.assigned_[e], t.copy_ && delete t.copy_[e], !0;
677
+ return jn(t.base_, e) !== void 0 || e in t.base_ ? (t.assigned_[e] = !1, In(t), ar(t)) : delete t.assigned_[e], t.copy_ && delete t.copy_[e], !0;
678
678
  },
679
679
  // Note: We never coerce `desc.value` into an Immer draft, because we can't make
680
680
  // the same guarantee in ES5 mode.
@@ -688,40 +688,40 @@ var Cr = {
688
688
  };
689
689
  },
690
690
  defineProperty() {
691
- re(11);
691
+ se(11);
692
692
  },
693
693
  getPrototypeOf(t) {
694
694
  return mt(t.base_);
695
695
  },
696
696
  setPrototypeOf() {
697
- re(12);
697
+ se(12);
698
698
  }
699
- }, jt = {};
699
+ }, It = {};
700
700
  hn(Cr, (t, e) => {
701
- jt[t] = function() {
701
+ It[t] = function() {
702
702
  return arguments[0] = arguments[0][0], e.apply(this, arguments);
703
703
  };
704
704
  });
705
- jt.deleteProperty = function(t, e) {
706
- return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && re(13), jt.set.call(this, t, e, void 0);
705
+ It.deleteProperty = function(t, e) {
706
+ return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && se(13), It.set.call(this, t, e, void 0);
707
707
  };
708
- jt.set = function(t, e, n) {
709
- return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && re(14), Cr.set.call(this, t[0], e, n, t[0]);
708
+ It.set = function(t, e, n) {
709
+ return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && se(14), Cr.set.call(this, t[0], e, n, t[0]);
710
710
  };
711
- function In(t, e) {
711
+ function jn(t, e) {
712
712
  const n = t[oe];
713
713
  return (n ? Ke(n) : t)[e];
714
714
  }
715
- function Ra(t, e, n) {
715
+ function Pa(t, e, n) {
716
716
  var s;
717
- const r = Ps(e, n);
717
+ const r = Ns(e, n);
718
718
  return r ? "value" in r ? r.value : (
719
719
  // This is a very special case, if the prop is a getter defined by the
720
720
  // prototype, we should invoke it with the draft as context!
721
721
  (s = r.get) == null ? void 0 : s.call(t.draft_)
722
722
  ) : void 0;
723
723
  }
724
- function Ps(t, e) {
724
+ function Ns(t, e) {
725
725
  if (!(e in t))
726
726
  return;
727
727
  let n = mt(t);
@@ -735,13 +735,13 @@ function Ps(t, e) {
735
735
  function ar(t) {
736
736
  t.modified_ || (t.modified_ = !0, t.parent_ && ar(t.parent_));
737
737
  }
738
- function jn(t) {
738
+ function In(t) {
739
739
  t.copy_ || (t.copy_ = nr(
740
740
  t.base_,
741
741
  t.scope_.immer_.useStrictShallowCopy_
742
742
  ));
743
743
  }
744
- var Na = class {
744
+ var Ra = class {
745
745
  constructor(t) {
746
746
  this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (e, n, r) => {
747
747
  if (typeof e == "function" && typeof n != "function") {
@@ -752,7 +752,7 @@ var Na = class {
752
752
  return i.produce(u, (h) => n.call(this, h, ...c));
753
753
  };
754
754
  }
755
- typeof n != "function" && re(6), r !== void 0 && typeof r != "function" && re(7);
755
+ typeof n != "function" && se(6), r !== void 0 && typeof r != "function" && se(7);
756
756
  let s;
757
757
  if (Ye(e)) {
758
758
  const a = es(this), i = ir(e, void 0);
@@ -764,13 +764,13 @@ var Na = class {
764
764
  }
765
765
  return Qr(a, r), ts(s, a);
766
766
  } else if (!e || typeof e != "object") {
767
- if (s = n(e), s === void 0 && (s = e), s === Os && (s = void 0), this.autoFreeze_ && Nt(s, !0), r) {
767
+ if (s = n(e), s === void 0 && (s = e), s === Os && (s = void 0), this.autoFreeze_ && Rt(s, !0), r) {
768
768
  const a = [], i = [];
769
769
  Qe("Patches").generateReplacementPatches_(e, s, a, i), r(a, i);
770
770
  }
771
771
  return s;
772
772
  } else
773
- re(1, e);
773
+ se(1, e);
774
774
  }, this.produceWithPatches = (e, n) => {
775
775
  if (typeof e == "function")
776
776
  return (i, ...o) => this.produceWithPatches(i, (u) => e(u, ...o));
@@ -781,13 +781,13 @@ var Na = class {
781
781
  }, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
782
782
  }
783
783
  createDraft(t) {
784
- Ye(t) || re(8), yt(t) && (t = Ia(t));
784
+ Ye(t) || se(8), yt(t) && (t = ja(t));
785
785
  const e = es(this), n = ir(t, void 0);
786
786
  return n[oe].isManual_ = !0, sr(e), n;
787
787
  }
788
788
  finishDraft(t, e) {
789
789
  const n = t && t[oe];
790
- (!n || !n.isManual_) && re(9);
790
+ (!n || !n.isManual_) && se(9);
791
791
  const { scope_: r } = n;
792
792
  return Qr(r, e), ts(void 0, r);
793
793
  }
@@ -825,13 +825,13 @@ var Na = class {
825
825
  }
826
826
  };
827
827
  function ir(t, e) {
828
- const n = Sn(t) ? Qe("MapSet").proxyMap_(t, e) : On(t) ? Qe("MapSet").proxySet_(t, e) : Pa(t, e);
828
+ const n = Sn(t) ? Qe("MapSet").proxyMap_(t, e) : On(t) ? Qe("MapSet").proxySet_(t, e) : Na(t, e);
829
829
  return (e ? e.scope_ : Cs()).drafts_.push(n), n;
830
830
  }
831
- function Ia(t) {
832
- return yt(t) || re(10, t), Rs(t);
831
+ function ja(t) {
832
+ return yt(t) || se(10, t), Ps(t);
833
833
  }
834
- function Rs(t) {
834
+ function Ps(t) {
835
835
  if (!Ye(t) || Tn(t))
836
836
  return t;
837
837
  const e = t[oe];
@@ -843,10 +843,10 @@ function Rs(t) {
843
843
  } else
844
844
  n = nr(t, !0);
845
845
  return hn(n, (r, s) => {
846
- As(n, r, Rs(s));
846
+ As(n, r, Ps(s));
847
847
  }), e && (e.finalized_ = !1), n;
848
848
  }
849
- var ue = new Na(), ja = ue.produce;
849
+ var ue = new Ra(), Ia = ue.produce;
850
850
  ue.produceWithPatches.bind(
851
851
  ue
852
852
  );
@@ -857,10 +857,10 @@ ue.createDraft.bind(ue);
857
857
  ue.finishDraft.bind(ue);
858
858
  function Za(t) {
859
859
  var e = ca(function() {
860
- return Nt(typeof t == "function" ? t() : t, !0);
860
+ return Rt(typeof t == "function" ? t() : t, !0);
861
861
  }), n = e[1];
862
862
  return [e[0], an(function(r) {
863
- n(typeof r == "function" ? ja(r) : Nt(r));
863
+ n(typeof r == "function" ? Ia(r) : Rt(r));
864
864
  }, [])];
865
865
  }
866
866
  const rs = {
@@ -909,14 +909,14 @@ const rs = {
909
909
  const b = {};
910
910
  o.addEventListener("start", (l) => {
911
911
  const v = JSON.parse(l.data);
912
- b.sessionId = v.sessionId, r((y) => {
913
- y.tasks.fetchDesign.status = "running";
912
+ b.sessionId = v.sessionId, r((m) => {
913
+ m.tasks.fetchDesign.status = "running";
914
914
  });
915
915
  }), o.addEventListener("pre_codegen", (l) => {
916
916
  JSON.parse(
917
917
  l.data
918
- ).message === "Anima model built" && r((y) => {
919
- y.tasks.fetchDesign.status = "finished", y.tasks.codeGeneration.status = "running", y.tasks.uploadAssets.status = "running";
918
+ ).message === "Anima model built" && r((m) => {
919
+ m.tasks.fetchDesign.status = "finished", m.tasks.codeGeneration.status = "running", m.tasks.uploadAssets.status = "running";
920
920
  });
921
921
  }), o.addEventListener("figma_metadata", (l) => {
922
922
  const v = JSON.parse(
@@ -934,8 +934,8 @@ const rs = {
934
934
  const v = JSON.parse(
935
935
  l.data
936
936
  );
937
- v.payload.status === "success" && (b.files = v.payload.files), r((y) => {
938
- y.tasks.codeGeneration.progress = v.payload.progress;
937
+ v.payload.status === "success" && (b.files = v.payload.files), r((m) => {
938
+ m.tasks.codeGeneration.progress = v.payload.progress;
939
939
  });
940
940
  }), o.addEventListener("codegen_completed", () => {
941
941
  r((l) => {
@@ -955,8 +955,8 @@ const rs = {
955
955
  const v = JSON.parse(
956
956
  l.data
957
957
  );
958
- r((y) => {
959
- y.status = "error", y.error = new Error(v.payload.message);
958
+ r((m) => {
959
+ m.status = "error", m.error = new Error(v.payload.message);
960
960
  }), g({
961
961
  result: null,
962
962
  error: new Error(v.payload.message)
@@ -968,9 +968,12 @@ const rs = {
968
968
  result: null,
969
969
  error: new Error("HTTP error: " + l.message)
970
970
  });
971
- }), o.addEventListener("done", () => {
972
- r((l) => {
973
- l.status = "success", l.result = b;
971
+ }), o.addEventListener("done", (l) => {
972
+ const v = JSON.parse(
973
+ l.data
974
+ );
975
+ b.tokenUsage = v.payload.tokenUsage, r((m) => {
976
+ m.status = "success", m.result = b;
974
977
  }), g({ result: b, error: null });
975
978
  });
976
979
  });
@@ -979,20 +982,20 @@ const rs = {
979
982
  if (((h = i.assetsStorage) == null ? void 0 : h.strategy) === "local" && ((p = l == null ? void 0 : l.assets) != null && p.length)) {
980
983
  const { filePath: v } = ss(
981
984
  i.assetsStorage
982
- ), y = l.assets.map((N) => Be(void 0, null, function* () {
983
- const D = yield (yield fetch(N.url)).arrayBuffer();
985
+ ), m = l.assets.map((R) => Be(void 0, null, function* () {
986
+ const D = yield (yield fetch(R.url)).arrayBuffer();
984
987
  return {
985
- assetName: N.name,
988
+ assetName: R.name,
986
989
  base64: ya(D)
987
990
  };
988
- })), z = yield Promise.allSettled(y);
989
- for (const N of z) {
991
+ })), z = yield Promise.allSettled(m);
992
+ for (const R of z) {
990
993
  const q = {};
991
- if (N.status === "fulfilled") {
992
- const { assetName: D, base64: B } = N.value;
994
+ if (R.status === "fulfilled") {
995
+ const { assetName: D, base64: B } = R.value;
993
996
  q[D] = B;
994
- const I = v ? `${v}/${D}` : D;
995
- l.files[I] = {
997
+ const j = v ? `${v}/${D}` : D;
998
+ l.files[j] = {
996
999
  content: B,
997
1000
  isBinary: !0
998
1001
  };
@@ -1094,16 +1097,16 @@ function Ma() {
1094
1097
  v = i({
1095
1098
  inst: { value: l, getSnapshot: b }
1096
1099
  });
1097
- var y = v[0].inst, z = v[1];
1100
+ var m = v[0].inst, z = v[1];
1098
1101
  return u(
1099
1102
  function() {
1100
- y.value = l, y.getSnapshot = b, n(y) && z({ inst: y });
1103
+ m.value = l, m.getSnapshot = b, n(m) && z({ inst: m });
1101
1104
  },
1102
1105
  [g, l, b]
1103
1106
  ), o(
1104
1107
  function() {
1105
- return n(y) && z({ inst: y }), g(function() {
1106
- n(y) && z({ inst: y });
1108
+ return n(m) && z({ inst: m }), g(function() {
1109
+ n(m) && z({ inst: m });
1107
1110
  });
1108
1111
  },
1109
1112
  [g]
@@ -1132,7 +1135,7 @@ function La() {
1132
1135
  return os || (os = 1, process.env.NODE_ENV === "production" ? nn.exports = Da() : nn.exports = Ma()), nn.exports;
1133
1136
  }
1134
1137
  var $a = La();
1135
- const Ns = 0, Is = 1, js = 2, us = 3;
1138
+ const Rs = 0, js = 1, Is = 2, us = 3;
1136
1139
  var cs = Object.prototype.hasOwnProperty;
1137
1140
  function or(t, e) {
1138
1141
  var n, r;
@@ -1154,18 +1157,18 @@ function or(t, e) {
1154
1157
  }
1155
1158
  return t !== t && e !== e;
1156
1159
  }
1157
- const Re = /* @__PURE__ */ new WeakMap(), De = () => {
1160
+ const Pe = /* @__PURE__ */ new WeakMap(), De = () => {
1158
1161
  }, Q = (
1159
1162
  /*#__NOINLINE__*/
1160
1163
  De()
1161
- ), ur = Object, P = (t) => t === Q, be = (t) => typeof t == "function", Me = (t, e) => Ue(Ue({}, t), e), Zs = (t) => be(t.then), Mn = {}, rn = {}, Pr = "undefined", Jt = typeof window != Pr, cr = typeof document != Pr, Fa = Jt && "Deno" in window, Wa = () => Jt && typeof window.requestAnimationFrame != Pr, Ds = (t, e) => {
1162
- const n = Re.get(t);
1164
+ ), ur = Object, N = (t) => t === Q, be = (t) => typeof t == "function", Me = (t, e) => Ue(Ue({}, t), e), Zs = (t) => be(t.then), Mn = {}, rn = {}, Nr = "undefined", Jt = typeof window != Nr, cr = typeof document != Nr, Fa = Jt && "Deno" in window, Wa = () => Jt && typeof window.requestAnimationFrame != Nr, Ds = (t, e) => {
1165
+ const n = Pe.get(t);
1163
1166
  return [
1164
1167
  // Getter
1165
- () => !P(e) && t.get(e) || Mn,
1168
+ () => !N(e) && t.get(e) || Mn,
1166
1169
  // Setter
1167
1170
  (r) => {
1168
- if (!P(e)) {
1171
+ if (!N(e)) {
1169
1172
  const s = t.get(e);
1170
1173
  e in rn || (rn[e] = s), n[5](e, Me(s, r), s || Mn);
1171
1174
  }
@@ -1173,7 +1176,7 @@ const Re = /* @__PURE__ */ new WeakMap(), De = () => {
1173
1176
  // Subscriber
1174
1177
  n[6],
1175
1178
  // Get server cache snapshot
1176
- () => !P(e) && e in rn ? rn[e] : !P(e) && t.get(e) || Mn
1179
+ () => !N(e) && e in rn ? rn[e] : !N(e) && t.get(e) || Mn
1177
1180
  ];
1178
1181
  };
1179
1182
  let dr = !0;
@@ -1185,7 +1188,7 @@ const za = () => dr, [lr, fr] = Jt && window.addEventListener ? [
1185
1188
  De
1186
1189
  ], Va = () => {
1187
1190
  const t = cr && document.visibilityState;
1188
- return P(t) || t !== "hidden";
1191
+ return N(t) || t !== "hidden";
1189
1192
  }, Ua = (t) => (cr && document.addEventListener("visibilitychange", t), lr("focus", t), () => {
1190
1193
  cr && document.removeEventListener("visibilitychange", t), fr("focus", t);
1191
1194
  }), Ba = (t) => {
@@ -1221,14 +1224,14 @@ const hr = (t) => {
1221
1224
  if (s) {
1222
1225
  a = "#";
1223
1226
  const o = ur.keys(t).sort();
1224
- for (; !P(i = o.pop()); )
1225
- P(t[i]) || (a += i + ":" + hr(t[i]) + ",");
1227
+ for (; !N(i = o.pop()); )
1228
+ N(t[i]) || (a += i + ":" + hr(t[i]) + ",");
1226
1229
  sn.set(t, a);
1227
1230
  }
1228
1231
  } else
1229
1232
  a = n ? t.toJSON() : e == "symbol" ? t.toString() : e == "string" ? JSON.stringify(t) : "" + t;
1230
1233
  return a;
1231
- }, Rr = (t) => {
1234
+ }, Pr = (t) => {
1232
1235
  if (be(t))
1233
1236
  try {
1234
1237
  t = t();
@@ -1265,21 +1268,21 @@ function Ms(...t) {
1265
1268
  return p(n);
1266
1269
  function p(k) {
1267
1270
  return Be(this, null, function* () {
1268
- const [g] = Rr(k);
1271
+ const [g] = Pr(k);
1269
1272
  if (!g) return;
1270
- const [b, l] = Ds(e, g), [v, y, z, N] = Re.get(e), q = () => {
1273
+ const [b, l] = Ds(e, g), [v, m, z, R] = Pe.get(e), q = () => {
1271
1274
  const le = v[g];
1272
- return (be(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete z[g], delete N[g], le && le[0]) ? le[0](js).then(() => b().data) : b().data;
1275
+ return (be(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete z[g], delete R[g], le && le[0]) ? le[0](Is).then(() => b().data) : b().data;
1273
1276
  };
1274
1277
  if (t.length < 3)
1275
1278
  return q();
1276
1279
  let D = r, B;
1277
- const I = pr();
1278
- y[g] = [
1279
- I,
1280
+ const j = pr();
1281
+ m[g] = [
1282
+ j,
1280
1283
  0
1281
1284
  ];
1282
- const $ = !P(u), Se = b(), M = Se.data, rt = Se._c, ze = P(rt) ? M : rt;
1285
+ const $ = !N(u), Se = b(), M = Se.data, rt = Se._c, ze = N(rt) ? M : rt;
1283
1286
  if ($ && (u = be(u) ? u(ze, M) : u, l({
1284
1287
  data: u,
1285
1288
  _c: ze
@@ -1292,7 +1295,7 @@ function Ms(...t) {
1292
1295
  if (D && Zs(D))
1293
1296
  if (D = yield D.catch((le) => {
1294
1297
  B = le;
1295
- }), I !== y[g][0]) {
1298
+ }), j !== m[g][0]) {
1296
1299
  if (B) throw B;
1297
1300
  return D;
1298
1301
  } else B && $ && c(B) && (i = !0, l({
@@ -1313,7 +1316,7 @@ function Ms(...t) {
1313
1316
  error: Q,
1314
1317
  _c: Q
1315
1318
  });
1316
- if (y[g][1] = pr(), Promise.resolve(q()).then(() => {
1319
+ if (m[g][1] = pr(), Promise.resolve(q()).then(() => {
1317
1320
  l({
1318
1321
  _c: Q
1319
1322
  });
@@ -1330,7 +1333,7 @@ const fs = (t, e) => {
1330
1333
  for (const n in t)
1331
1334
  t[n][0] && t[n][0](e);
1332
1335
  }, Xa = (t, e) => {
1333
- if (!Re.has(t)) {
1336
+ if (!Pe.has(t)) {
1334
1337
  const n = Me(Ka, e), r = {}, s = Ms.bind(Q, t);
1335
1338
  let a = De;
1336
1339
  const i = {}, o = (h, p) => {
@@ -1343,7 +1346,7 @@ const fs = (t, e) => {
1343
1346
  for (const b of g)
1344
1347
  b(p, k);
1345
1348
  }, c = () => {
1346
- if (!Re.has(t) && (Re.set(t, [
1349
+ if (!Pe.has(t) && (Pe.set(t, [
1347
1350
  r,
1348
1351
  {},
1349
1352
  {},
@@ -1352,9 +1355,9 @@ const fs = (t, e) => {
1352
1355
  u,
1353
1356
  o
1354
1357
  ]), !Zt)) {
1355
- const h = n.initFocus(setTimeout.bind(Q, fs.bind(Q, r, Ns))), p = n.initReconnect(setTimeout.bind(Q, fs.bind(Q, r, Is)));
1358
+ const h = n.initFocus(setTimeout.bind(Q, fs.bind(Q, r, Rs))), p = n.initReconnect(setTimeout.bind(Q, fs.bind(Q, r, js)));
1356
1359
  a = () => {
1357
- h && h(), p && p(), Re.delete(t);
1360
+ h && h(), p && p(), Pe.delete(t);
1358
1361
  };
1359
1362
  }
1360
1363
  };
@@ -1367,11 +1370,11 @@ const fs = (t, e) => {
1367
1370
  }
1368
1371
  return [
1369
1372
  t,
1370
- Re.get(t)[4]
1373
+ Pe.get(t)[4]
1371
1374
  ];
1372
1375
  }, Ya = (t, e, n, r, s) => {
1373
1376
  const a = n.errorRetryCount, i = s.retryCount, o = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * n.errorRetryInterval;
1374
- !P(a) && i > a || setTimeout(r, o, s);
1377
+ !N(a) && i > a || setTimeout(r, o, s);
1375
1378
  }, Qa = or, [Ls, ei] = Xa(/* @__PURE__ */ new Map()), ti = Me(
1376
1379
  {
1377
1380
  // events
@@ -1417,11 +1420,11 @@ const fs = (t, e) => {
1417
1420
  null,
1418
1421
  (t[1] === null ? t[2] : t[1]) || {}
1419
1422
  ], ui = () => Me(ti, ha(ri)), ci = (t) => (e, n, r) => t(e, n && ((...a) => {
1420
- const [i] = Rr(e), [, , , o] = Re.get(Ls);
1423
+ const [i] = Pr(e), [, , , o] = Pe.get(Ls);
1421
1424
  if (i.startsWith(si))
1422
1425
  return n(...a);
1423
1426
  const u = o[i];
1424
- return P(u) ? n(...a) : (delete o[i], u);
1427
+ return N(u) ? n(...a) : (delete o[i], u);
1425
1428
  }), r), di = ai.concat(ci), li = (t) => function(...n) {
1426
1429
  const r = ui(), [s, a, i] = oi(n), o = ni(r, i);
1427
1430
  let u = t;
@@ -1459,20 +1462,20 @@ const Wn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
1459
1462
  }), zn = {
1460
1463
  dedupe: !0
1461
1464
  }, hi = (t, e, n) => {
1462
- const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: u, refreshInterval: c, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [g, b, l, v] = Re.get(r), [y, z] = Rr(t), N = qe(!1), q = qe(!1), D = qe(y), B = qe(e), I = qe(n), $ = () => I.current, Se = () => $().isVisible() && $().isOnline(), [M, rt, ze, le] = Ds(r, y), st = qe({}).current, Yt = P(i) ? P(n.fallback) ? Q : n.fallback[y] : i, Dr = (j, Z) => {
1465
+ const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: u, refreshInterval: c, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [g, b, l, v] = Pe.get(r), [m, z] = Pr(t), R = qe(!1), q = qe(!1), D = qe(m), B = qe(e), j = qe(n), $ = () => j.current, Se = () => $().isVisible() && $().isOnline(), [M, rt, ze, le] = Ds(r, m), st = qe({}).current, Yt = N(i) ? N(n.fallback) ? Q : n.fallback[m] : i, Dr = (I, Z) => {
1463
1466
  for (const H in st) {
1464
1467
  const W = H;
1465
1468
  if (W === "data") {
1466
- if (!s(j[W], Z[W]) && (!P(j[W]) || !s(en, Z[W])))
1469
+ if (!s(I[W], Z[W]) && (!N(I[W]) || !s(en, Z[W])))
1467
1470
  return !1;
1468
- } else if (Z[W] !== j[W])
1471
+ } else if (Z[W] !== I[W])
1469
1472
  return !1;
1470
1473
  }
1471
1474
  return !0;
1472
1475
  }, Mr = pa(() => {
1473
- const j = !y || !e ? !1 : P(o) ? $().isPaused() || a ? !1 : u !== !1 : o, Z = (X) => {
1476
+ const I = !m || !e ? !1 : N(o) ? $().isPaused() || a ? !1 : u !== !1 : o, Z = (X) => {
1474
1477
  const Oe = Me(X);
1475
- return delete Oe._k, j ? Ue({
1478
+ return delete Oe._k, I ? Ue({
1476
1479
  isValidating: !0,
1477
1480
  isLoading: !0
1478
1481
  }, Oe) : Oe;
@@ -1487,57 +1490,57 @@ const Wn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
1487
1490
  ];
1488
1491
  }, [
1489
1492
  r,
1490
- y
1493
+ m
1491
1494
  ]), at = $a.useSyncExternalStore(an(
1492
- (j) => ze(y, (Z, H) => {
1493
- Dr(H, Z) || j();
1495
+ (I) => ze(m, (Z, H) => {
1496
+ Dr(H, Z) || I();
1494
1497
  }),
1495
1498
  // eslint-disable-next-line react-hooks/exhaustive-deps
1496
1499
  [
1497
1500
  r,
1498
- y
1501
+ m
1499
1502
  ]
1500
- ), Mr[0], Mr[1]), Lr = !N.current, ea = g[y] && g[y].length > 0, it = at.data, Ve = P(it) ? Yt && Zs(Yt) ? Wn(Yt) : Yt : it, Qt = at.error, Cn = qe(Ve), en = k ? P(it) ? P(Cn.current) ? Ve : Cn.current : it : Ve, $r = ea && !P(Qt) ? !1 : Lr && !P(o) ? o : $().isPaused() ? !1 : a ? P(Ve) ? !1 : u : P(Ve) || u, Fr = !!(y && e && Lr && $r), ta = P(at.isValidating) ? Fr : at.isValidating, na = P(at.isLoading) ? Fr : at.isLoading, wt = an(
1501
- (j) => Be(void 0, null, function* () {
1503
+ ), Mr[0], Mr[1]), Lr = !R.current, ea = g[m] && g[m].length > 0, it = at.data, Ve = N(it) ? Yt && Zs(Yt) ? Wn(Yt) : Yt : it, Qt = at.error, Cn = qe(Ve), en = k ? N(it) ? N(Cn.current) ? Ve : Cn.current : it : Ve, $r = ea && !N(Qt) ? !1 : Lr && !N(o) ? o : $().isPaused() ? !1 : a ? N(Ve) ? !1 : u : N(Ve) || u, Fr = !!(m && e && Lr && $r), ta = N(at.isValidating) ? Fr : at.isValidating, na = N(at.isLoading) ? Fr : at.isLoading, wt = an(
1504
+ (I) => Be(void 0, null, function* () {
1502
1505
  const Z = B.current;
1503
- if (!y || !Z || q.current || $().isPaused())
1506
+ if (!m || !Z || q.current || $().isPaused())
1504
1507
  return !1;
1505
1508
  let H, W, ye = !0;
1506
- const ot = j || {}, K = !l[y] || !ot.dedupe, X = () => ds ? !q.current && y === D.current && N.current : y === D.current, Oe = {
1509
+ const ot = I || {}, K = !l[m] || !ot.dedupe, X = () => ds ? !q.current && m === D.current && R.current : m === D.current, Oe = {
1507
1510
  isValidating: !1,
1508
1511
  isLoading: !1
1509
1512
  }, zr = () => {
1510
1513
  rt(Oe);
1511
1514
  }, Vr = () => {
1512
- const ce = l[y];
1513
- ce && ce[1] === W && delete l[y];
1515
+ const ce = l[m];
1516
+ ce && ce[1] === W && delete l[m];
1514
1517
  }, Ur = {
1515
1518
  isValidating: !0
1516
1519
  };
1517
- P(M().data) && (Ur.isLoading = !0);
1520
+ N(M().data) && (Ur.isLoading = !0);
1518
1521
  try {
1519
- if (K && (rt(Ur), n.loadingTimeout && P(M().data) && setTimeout(() => {
1520
- ye && X() && $().onLoadingSlow(y, n);
1521
- }, n.loadingTimeout), l[y] = [
1522
+ if (K && (rt(Ur), n.loadingTimeout && N(M().data) && setTimeout(() => {
1523
+ ye && X() && $().onLoadingSlow(m, n);
1524
+ }, n.loadingTimeout), l[m] = [
1522
1525
  Z(z),
1523
1526
  pr()
1524
- ]), [H, W] = l[y], H = yield H, K && setTimeout(Vr, n.dedupingInterval), !l[y] || l[y][1] !== W)
1525
- return K && X() && $().onDiscarded(y), !1;
1527
+ ]), [H, W] = l[m], H = yield H, K && setTimeout(Vr, n.dedupingInterval), !l[m] || l[m][1] !== W)
1528
+ return K && X() && $().onDiscarded(m), !1;
1526
1529
  Oe.error = Q;
1527
- const ce = b[y];
1528
- if (!P(ce) && // case 1
1530
+ const ce = b[m];
1531
+ if (!N(ce) && // case 1
1529
1532
  (W <= ce[0] || // case 2
1530
1533
  W <= ce[1] || // case 3
1531
1534
  ce[1] === 0))
1532
- return zr(), K && X() && $().onDiscarded(y), !1;
1535
+ return zr(), K && X() && $().onDiscarded(m), !1;
1533
1536
  const Te = M().data;
1534
- Oe.data = s(Te, H) ? Te : H, K && X() && $().onSuccess(H, y, n);
1537
+ Oe.data = s(Te, H) ? Te : H, K && X() && $().onSuccess(H, m, n);
1535
1538
  } catch (ce) {
1536
1539
  Vr();
1537
- const Te = $(), { shouldRetryOnError: Pn } = Te;
1538
- Te.isPaused() || (Oe.error = ce, K && X() && (Te.onError(ce, y, Te), (Pn === !0 || be(Pn) && Pn(ce)) && (!$().revalidateOnFocus || !$().revalidateOnReconnect || Se()) && Te.onErrorRetry(ce, y, Te, (ra) => {
1539
- const Rn = g[y];
1540
- Rn && Rn[0] && Rn[0](us, ra);
1540
+ const Te = $(), { shouldRetryOnError: Nn } = Te;
1541
+ Te.isPaused() || (Oe.error = ce, K && X() && (Te.onError(ce, m, Te), (Nn === !0 || be(Nn) && Nn(ce)) && (!$().revalidateOnFocus || !$().revalidateOnReconnect || Se()) && Te.onErrorRetry(ce, m, Te, (ra) => {
1542
+ const Pn = g[m];
1543
+ Pn && Pn[0] && Pn[0](us, ra);
1541
1544
  }, {
1542
1545
  retryCount: (ot.retryCount || 0) + 1,
1543
1546
  dedupe: !0
@@ -1557,70 +1560,70 @@ const Wn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
1557
1560
  // even though it might cause unexpected behaviors.
1558
1561
  // eslint-disable-next-line react-hooks/exhaustive-deps
1559
1562
  [
1560
- y,
1563
+ m,
1561
1564
  r
1562
1565
  ]
1563
1566
  ), Wr = an(
1564
1567
  // Use callback to make sure `keyRef.current` returns latest result every time
1565
- (...j) => Ms(r, D.current, ...j),
1568
+ (...I) => Ms(r, D.current, ...I),
1566
1569
  // eslint-disable-next-line react-hooks/exhaustive-deps
1567
1570
  []
1568
1571
  );
1569
1572
  if (Ln(() => {
1570
- B.current = e, I.current = n, P(it) || (Cn.current = it);
1573
+ B.current = e, j.current = n, N(it) || (Cn.current = it);
1571
1574
  }), Ln(() => {
1572
- if (!y) return;
1573
- const j = wt.bind(Q, zn);
1575
+ if (!m) return;
1576
+ const I = wt.bind(Q, zn);
1574
1577
  let Z = 0;
1575
- const W = fi(y, g, (ye, ot = {}) => {
1576
- if (ye == Ns) {
1578
+ const W = fi(m, g, (ye, ot = {}) => {
1579
+ if (ye == Rs) {
1577
1580
  const K = Date.now();
1578
- $().revalidateOnFocus && K > Z && Se() && (Z = K + $().focusThrottleInterval, j());
1579
- } else if (ye == Is)
1580
- $().revalidateOnReconnect && Se() && j();
1581
+ $().revalidateOnFocus && K > Z && Se() && (Z = K + $().focusThrottleInterval, I());
1582
+ } else if (ye == js)
1583
+ $().revalidateOnReconnect && Se() && I();
1581
1584
  else {
1582
- if (ye == js)
1585
+ if (ye == Is)
1583
1586
  return wt();
1584
1587
  if (ye == us)
1585
1588
  return wt(ot);
1586
1589
  }
1587
1590
  });
1588
- return q.current = !1, D.current = y, N.current = !0, rt({
1591
+ return q.current = !1, D.current = m, R.current = !0, rt({
1589
1592
  _k: z
1590
- }), $r && (P(Ve) || Zt ? j() : Ha(j)), () => {
1593
+ }), $r && (N(Ve) || Zt ? I() : Ha(I)), () => {
1591
1594
  q.current = !0, W();
1592
1595
  };
1593
1596
  }, [
1594
- y
1597
+ m
1595
1598
  ]), Ln(() => {
1596
- let j;
1599
+ let I;
1597
1600
  function Z() {
1598
1601
  const W = be(c) ? c(M().data) : c;
1599
- W && j !== -1 && (j = setTimeout(H, W));
1602
+ W && I !== -1 && (I = setTimeout(H, W));
1600
1603
  }
1601
1604
  function H() {
1602
1605
  !M().error && (h || $().isVisible()) && (p || $().isOnline()) ? wt(zn).then(Z) : Z();
1603
1606
  }
1604
1607
  return Z(), () => {
1605
- j && (clearTimeout(j), j = -1);
1608
+ I && (clearTimeout(I), I = -1);
1606
1609
  };
1607
1610
  }, [
1608
1611
  c,
1609
1612
  h,
1610
1613
  p,
1611
- y
1612
- ]), ma(en), a && P(Ve) && y) {
1614
+ m
1615
+ ]), ma(en), a && N(Ve) && m) {
1613
1616
  if (!ds && Zt)
1614
1617
  throw new Error("Fallback data is required when using Suspense in SSR.");
1615
- B.current = e, I.current = n, q.current = !1;
1616
- const j = v[y];
1617
- if (!P(j)) {
1618
- const Z = Wr(j);
1618
+ B.current = e, j.current = n, q.current = !1;
1619
+ const I = v[m];
1620
+ if (!N(I)) {
1621
+ const Z = Wr(I);
1619
1622
  Wn(Z);
1620
1623
  }
1621
- if (P(Qt)) {
1624
+ if (N(Qt)) {
1622
1625
  const Z = wt(zn);
1623
- P(en) || (Z.status = "fulfilled", Z.value = !0), Wn(Z);
1626
+ N(en) || (Z.status = "fulfilled", Z.value = !0), Wn(Z);
1624
1627
  } else
1625
1628
  throw Qt;
1626
1629
  }
@@ -1723,7 +1726,7 @@ const _ = C.arrayToEnum([
1723
1726
  "never",
1724
1727
  "map",
1725
1728
  "set"
1726
- ]), Pe = (t) => {
1729
+ ]), Ne = (t) => {
1727
1730
  switch (typeof t) {
1728
1731
  case "undefined":
1729
1732
  return _.undefined;
@@ -1903,7 +1906,7 @@ const gn = (t) => {
1903
1906
  message: o
1904
1907
  });
1905
1908
  }, ki = [];
1906
- function m(t, e) {
1909
+ function y(t, e) {
1907
1910
  const n = yn(), r = gn({
1908
1911
  issueData: e,
1909
1912
  data: t.data,
@@ -2020,13 +2023,13 @@ class T {
2020
2023
  return this._def.description;
2021
2024
  }
2022
2025
  _getType(e) {
2023
- return Pe(e.data);
2026
+ return Ne(e.data);
2024
2027
  }
2025
2028
  _getOrReturnCtx(e, n) {
2026
2029
  return n || {
2027
2030
  common: e.parent.common,
2028
2031
  data: e.data,
2029
- parsedType: Pe(e.data),
2032
+ parsedType: Ne(e.data),
2030
2033
  schemaErrorMap: this._def.errorMap,
2031
2034
  path: e.path,
2032
2035
  parent: e.parent
@@ -2038,7 +2041,7 @@ class T {
2038
2041
  ctx: {
2039
2042
  common: e.parent.common,
2040
2043
  data: e.data,
2041
- parsedType: Pe(e.data),
2044
+ parsedType: Ne(e.data),
2042
2045
  schemaErrorMap: this._def.errorMap,
2043
2046
  path: e.path,
2044
2047
  parent: e.parent
@@ -2073,7 +2076,7 @@ class T {
2073
2076
  schemaErrorMap: this._def.errorMap,
2074
2077
  parent: null,
2075
2078
  data: e,
2076
- parsedType: Pe(e)
2079
+ parsedType: Ne(e)
2077
2080
  }, a = this._parseSync({ data: e, path: s.path, parent: s });
2078
2081
  return ms(s, a);
2079
2082
  }
@@ -2088,7 +2091,7 @@ class T {
2088
2091
  schemaErrorMap: this._def.errorMap,
2089
2092
  parent: null,
2090
2093
  data: e,
2091
- parsedType: Pe(e)
2094
+ parsedType: Ne(e)
2092
2095
  };
2093
2096
  if (!this["~standard"].async)
2094
2097
  try {
@@ -2130,7 +2133,7 @@ class T {
2130
2133
  schemaErrorMap: this._def.errorMap,
2131
2134
  parent: null,
2132
2135
  data: e,
2133
- parsedType: Pe(e)
2136
+ parsedType: Ne(e)
2134
2137
  }, s = this._parse({ data: e, path: r.path, parent: r }), a = yield Dt(s) ? s : Promise.resolve(s);
2135
2138
  return ms(r, a);
2136
2139
  });
@@ -2201,7 +2204,7 @@ class T {
2201
2204
  }));
2202
2205
  }
2203
2206
  brand() {
2204
- return new Nr(d({
2207
+ return new Rr(d({
2205
2208
  typeName: E.ZodBranded,
2206
2209
  type: this
2207
2210
  }, O(this._def)));
@@ -2233,9 +2236,9 @@ class T {
2233
2236
  return this.safeParse(null).success;
2234
2237
  }
2235
2238
  }
2236
- const Ei = /^c[^\s-]{8,}$/i, xi = /^[0-9a-z]+$/, Si = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Oi = /^[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, Ti = /^[a-z0-9_-]{21}$/i, Ai = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ci = /^[-+]?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)?)??$/, Pi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ri = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
2239
+ const Ei = /^c[^\s-]{8,}$/i, xi = /^[0-9a-z]+$/, Si = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Oi = /^[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, Ti = /^[a-z0-9_-]{21}$/i, Ai = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ci = /^[-+]?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)?)??$/, Ni = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Pi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
2237
2240
  let Vn;
2238
- const Ni = /^(?:(?: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])$/, Ii = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, ji = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Zi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Di = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Mi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, zs = "((\\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])))", Li = new RegExp(`^${zs}$`);
2241
+ const Ri = /^(?:(?: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])$/, ji = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ii = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Zi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Di = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Mi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, zs = "((\\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])))", Li = new RegExp(`^${zs}$`);
2239
2242
  function Vs(t) {
2240
2243
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
2241
2244
  return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
@@ -2249,7 +2252,7 @@ function Us(t) {
2249
2252
  return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
2250
2253
  }
2251
2254
  function Fi(t, e) {
2252
- return !!((e === "v4" || !e) && Ni.test(t) || (e === "v6" || !e) && ji.test(t));
2255
+ return !!((e === "v4" || !e) && Ri.test(t) || (e === "v6" || !e) && Ii.test(t));
2253
2256
  }
2254
2257
  function Wi(t, e) {
2255
2258
  if (!Ai.test(t))
@@ -2262,13 +2265,13 @@ function Wi(t, e) {
2262
2265
  }
2263
2266
  }
2264
2267
  function zi(t, e) {
2265
- return !!((e === "v4" || !e) && Ii.test(t) || (e === "v6" || !e) && Zi.test(t));
2268
+ return !!((e === "v4" || !e) && ji.test(t) || (e === "v6" || !e) && Zi.test(t));
2266
2269
  }
2267
2270
  class he extends T {
2268
2271
  _parse(e) {
2269
2272
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== _.string) {
2270
2273
  const s = this._getOrReturnCtx(e);
2271
- return m(s, {
2274
+ return y(s, {
2272
2275
  code: f.invalid_type,
2273
2276
  expected: _.string,
2274
2277
  received: s.parsedType
@@ -2278,7 +2281,7 @@ class he extends T {
2278
2281
  let r;
2279
2282
  for (const s of this._def.checks)
2280
2283
  if (s.kind === "min")
2281
- e.data.length < s.value && (r = this._getOrReturnCtx(e, r), m(r, {
2284
+ e.data.length < s.value && (r = this._getOrReturnCtx(e, r), y(r, {
2282
2285
  code: f.too_small,
2283
2286
  minimum: s.value,
2284
2287
  type: "string",
@@ -2287,7 +2290,7 @@ class he extends T {
2287
2290
  message: s.message
2288
2291
  }), n.dirty());
2289
2292
  else if (s.kind === "max")
2290
- e.data.length > s.value && (r = this._getOrReturnCtx(e, r), m(r, {
2293
+ e.data.length > s.value && (r = this._getOrReturnCtx(e, r), y(r, {
2291
2294
  code: f.too_big,
2292
2295
  maximum: s.value,
2293
2296
  type: "string",
@@ -2297,14 +2300,14 @@ class he extends T {
2297
2300
  }), n.dirty());
2298
2301
  else if (s.kind === "length") {
2299
2302
  const a = e.data.length > s.value, i = e.data.length < s.value;
2300
- (a || i) && (r = this._getOrReturnCtx(e, r), a ? m(r, {
2303
+ (a || i) && (r = this._getOrReturnCtx(e, r), a ? y(r, {
2301
2304
  code: f.too_big,
2302
2305
  maximum: s.value,
2303
2306
  type: "string",
2304
2307
  inclusive: !0,
2305
2308
  exact: !0,
2306
2309
  message: s.message
2307
- }) : i && m(r, {
2310
+ }) : i && y(r, {
2308
2311
  code: f.too_small,
2309
2312
  minimum: s.value,
2310
2313
  type: "string",
@@ -2313,43 +2316,43 @@ class he extends T {
2313
2316
  message: s.message
2314
2317
  }), n.dirty());
2315
2318
  } else if (s.kind === "email")
2316
- Pi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2319
+ Ni.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2317
2320
  validation: "email",
2318
2321
  code: f.invalid_string,
2319
2322
  message: s.message
2320
2323
  }), n.dirty());
2321
2324
  else if (s.kind === "emoji")
2322
- Vn || (Vn = new RegExp(Ri, "u")), Vn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2325
+ Vn || (Vn = new RegExp(Pi, "u")), Vn.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2323
2326
  validation: "emoji",
2324
2327
  code: f.invalid_string,
2325
2328
  message: s.message
2326
2329
  }), n.dirty());
2327
2330
  else if (s.kind === "uuid")
2328
- Oi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2331
+ Oi.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2329
2332
  validation: "uuid",
2330
2333
  code: f.invalid_string,
2331
2334
  message: s.message
2332
2335
  }), n.dirty());
2333
2336
  else if (s.kind === "nanoid")
2334
- Ti.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2337
+ Ti.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2335
2338
  validation: "nanoid",
2336
2339
  code: f.invalid_string,
2337
2340
  message: s.message
2338
2341
  }), n.dirty());
2339
2342
  else if (s.kind === "cuid")
2340
- Ei.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2343
+ Ei.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2341
2344
  validation: "cuid",
2342
2345
  code: f.invalid_string,
2343
2346
  message: s.message
2344
2347
  }), n.dirty());
2345
2348
  else if (s.kind === "cuid2")
2346
- xi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2349
+ xi.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2347
2350
  validation: "cuid2",
2348
2351
  code: f.invalid_string,
2349
2352
  message: s.message
2350
2353
  }), n.dirty());
2351
2354
  else if (s.kind === "ulid")
2352
- Si.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2355
+ Si.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2353
2356
  validation: "ulid",
2354
2357
  code: f.invalid_string,
2355
2358
  message: s.message
@@ -2358,61 +2361,61 @@ class he extends T {
2358
2361
  try {
2359
2362
  new URL(e.data);
2360
2363
  } catch (a) {
2361
- r = this._getOrReturnCtx(e, r), m(r, {
2364
+ r = this._getOrReturnCtx(e, r), y(r, {
2362
2365
  validation: "url",
2363
2366
  code: f.invalid_string,
2364
2367
  message: s.message
2365
2368
  }), n.dirty();
2366
2369
  }
2367
- else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2370
+ else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2368
2371
  validation: "regex",
2369
2372
  code: f.invalid_string,
2370
2373
  message: s.message
2371
- }), n.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (r = this._getOrReturnCtx(e, r), m(r, {
2374
+ }), n.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (r = this._getOrReturnCtx(e, r), y(r, {
2372
2375
  code: f.invalid_string,
2373
2376
  validation: { includes: s.value, position: s.position },
2374
2377
  message: s.message
2375
- }), n.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (r = this._getOrReturnCtx(e, r), m(r, {
2378
+ }), n.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (r = this._getOrReturnCtx(e, r), y(r, {
2376
2379
  code: f.invalid_string,
2377
2380
  validation: { startsWith: s.value },
2378
2381
  message: s.message
2379
- }), n.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (r = this._getOrReturnCtx(e, r), m(r, {
2382
+ }), n.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (r = this._getOrReturnCtx(e, r), y(r, {
2380
2383
  code: f.invalid_string,
2381
2384
  validation: { endsWith: s.value },
2382
2385
  message: s.message
2383
- }), n.dirty()) : s.kind === "datetime" ? Us(s).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2386
+ }), n.dirty()) : s.kind === "datetime" ? Us(s).test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2384
2387
  code: f.invalid_string,
2385
2388
  validation: "datetime",
2386
2389
  message: s.message
2387
- }), n.dirty()) : s.kind === "date" ? Li.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2390
+ }), n.dirty()) : s.kind === "date" ? Li.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2388
2391
  code: f.invalid_string,
2389
2392
  validation: "date",
2390
2393
  message: s.message
2391
- }), n.dirty()) : s.kind === "time" ? $i(s).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2394
+ }), n.dirty()) : s.kind === "time" ? $i(s).test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2392
2395
  code: f.invalid_string,
2393
2396
  validation: "time",
2394
2397
  message: s.message
2395
- }), n.dirty()) : s.kind === "duration" ? Ci.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2398
+ }), n.dirty()) : s.kind === "duration" ? Ci.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2396
2399
  validation: "duration",
2397
2400
  code: f.invalid_string,
2398
2401
  message: s.message
2399
- }), n.dirty()) : s.kind === "ip" ? Fi(e.data, s.version) || (r = this._getOrReturnCtx(e, r), m(r, {
2402
+ }), n.dirty()) : s.kind === "ip" ? Fi(e.data, s.version) || (r = this._getOrReturnCtx(e, r), y(r, {
2400
2403
  validation: "ip",
2401
2404
  code: f.invalid_string,
2402
2405
  message: s.message
2403
- }), n.dirty()) : s.kind === "jwt" ? Wi(e.data, s.alg) || (r = this._getOrReturnCtx(e, r), m(r, {
2406
+ }), n.dirty()) : s.kind === "jwt" ? Wi(e.data, s.alg) || (r = this._getOrReturnCtx(e, r), y(r, {
2404
2407
  validation: "jwt",
2405
2408
  code: f.invalid_string,
2406
2409
  message: s.message
2407
- }), n.dirty()) : s.kind === "cidr" ? zi(e.data, s.version) || (r = this._getOrReturnCtx(e, r), m(r, {
2410
+ }), n.dirty()) : s.kind === "cidr" ? zi(e.data, s.version) || (r = this._getOrReturnCtx(e, r), y(r, {
2408
2411
  validation: "cidr",
2409
2412
  code: f.invalid_string,
2410
2413
  message: s.message
2411
- }), n.dirty()) : s.kind === "base64" ? Di.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2414
+ }), n.dirty()) : s.kind === "base64" ? Di.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2412
2415
  validation: "base64",
2413
2416
  code: f.invalid_string,
2414
2417
  message: s.message
2415
- }), n.dirty()) : s.kind === "base64url" ? Mi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
2418
+ }), n.dirty()) : s.kind === "base64url" ? Mi.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
2416
2419
  validation: "base64url",
2417
2420
  code: f.invalid_string,
2418
2421
  message: s.message
@@ -2646,7 +2649,7 @@ class Le extends T {
2646
2649
  _parse(e) {
2647
2650
  if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== _.number) {
2648
2651
  const s = this._getOrReturnCtx(e);
2649
- return m(s, {
2652
+ return y(s, {
2650
2653
  code: f.invalid_type,
2651
2654
  expected: _.number,
2652
2655
  received: s.parsedType
@@ -2655,30 +2658,30 @@ class Le extends T {
2655
2658
  let n;
2656
2659
  const r = new J();
2657
2660
  for (const s of this._def.checks)
2658
- s.kind === "int" ? C.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
2661
+ s.kind === "int" ? C.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
2659
2662
  code: f.invalid_type,
2660
2663
  expected: "integer",
2661
2664
  received: "float",
2662
2665
  message: s.message
2663
- }), r.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), m(n, {
2666
+ }), r.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), y(n, {
2664
2667
  code: f.too_small,
2665
2668
  minimum: s.value,
2666
2669
  type: "number",
2667
2670
  inclusive: s.inclusive,
2668
2671
  exact: !1,
2669
2672
  message: s.message
2670
- }), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), m(n, {
2673
+ }), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), y(n, {
2671
2674
  code: f.too_big,
2672
2675
  maximum: s.value,
2673
2676
  type: "number",
2674
2677
  inclusive: s.inclusive,
2675
2678
  exact: !1,
2676
2679
  message: s.message
2677
- }), r.dirty()) : s.kind === "multipleOf" ? Vi(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), m(n, {
2680
+ }), r.dirty()) : s.kind === "multipleOf" ? Vi(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), y(n, {
2678
2681
  code: f.not_multiple_of,
2679
2682
  multipleOf: s.value,
2680
2683
  message: s.message
2681
- }), r.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
2684
+ }), r.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
2682
2685
  code: f.not_finite,
2683
2686
  message: s.message
2684
2687
  }), r.dirty()) : C.assertNever(s);
@@ -2824,19 +2827,19 @@ class $e extends T {
2824
2827
  let n;
2825
2828
  const r = new J();
2826
2829
  for (const s of this._def.checks)
2827
- s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), m(n, {
2830
+ s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), y(n, {
2828
2831
  code: f.too_small,
2829
2832
  type: "bigint",
2830
2833
  minimum: s.value,
2831
2834
  inclusive: s.inclusive,
2832
2835
  message: s.message
2833
- }), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), m(n, {
2836
+ }), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), y(n, {
2834
2837
  code: f.too_big,
2835
2838
  type: "bigint",
2836
2839
  maximum: s.value,
2837
2840
  inclusive: s.inclusive,
2838
2841
  message: s.message
2839
- }), r.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), m(n, {
2842
+ }), r.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), y(n, {
2840
2843
  code: f.not_multiple_of,
2841
2844
  multipleOf: s.value,
2842
2845
  message: s.message
@@ -2845,7 +2848,7 @@ class $e extends T {
2845
2848
  }
2846
2849
  _getInvalidInput(e) {
2847
2850
  const n = this._getOrReturnCtx(e);
2848
- return m(n, {
2851
+ return y(n, {
2849
2852
  code: f.invalid_type,
2850
2853
  expected: _.bigint,
2851
2854
  received: n.parsedType
@@ -2945,7 +2948,7 @@ class Mt extends T {
2945
2948
  _parse(e) {
2946
2949
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
2947
2950
  const n = this._getOrReturnCtx(e);
2948
- return m(n, {
2951
+ return y(n, {
2949
2952
  code: f.invalid_type,
2950
2953
  expected: _.boolean,
2951
2954
  received: n.parsedType
@@ -2962,7 +2965,7 @@ class tt extends T {
2962
2965
  _parse(e) {
2963
2966
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== _.date) {
2964
2967
  const s = this._getOrReturnCtx(e);
2965
- return m(s, {
2968
+ return y(s, {
2966
2969
  code: f.invalid_type,
2967
2970
  expected: _.date,
2968
2971
  received: s.parsedType
@@ -2970,21 +2973,21 @@ class tt extends T {
2970
2973
  }
2971
2974
  if (isNaN(e.data.getTime())) {
2972
2975
  const s = this._getOrReturnCtx(e);
2973
- return m(s, {
2976
+ return y(s, {
2974
2977
  code: f.invalid_date
2975
2978
  }), S;
2976
2979
  }
2977
2980
  const n = new J();
2978
2981
  let r;
2979
2982
  for (const s of this._def.checks)
2980
- s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r), m(r, {
2983
+ s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r), y(r, {
2981
2984
  code: f.too_small,
2982
2985
  message: s.message,
2983
2986
  inclusive: !0,
2984
2987
  exact: !1,
2985
2988
  minimum: s.value,
2986
2989
  type: "date"
2987
- }), n.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (r = this._getOrReturnCtx(e, r), m(r, {
2990
+ }), n.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (r = this._getOrReturnCtx(e, r), y(r, {
2988
2991
  code: f.too_big,
2989
2992
  message: s.message,
2990
2993
  inclusive: !0,
@@ -3038,7 +3041,7 @@ class bn extends T {
3038
3041
  _parse(e) {
3039
3042
  if (this._getType(e) !== _.symbol) {
3040
3043
  const n = this._getOrReturnCtx(e);
3041
- return m(n, {
3044
+ return y(n, {
3042
3045
  code: f.invalid_type,
3043
3046
  expected: _.symbol,
3044
3047
  received: n.parsedType
@@ -3054,7 +3057,7 @@ class Lt extends T {
3054
3057
  _parse(e) {
3055
3058
  if (this._getType(e) !== _.undefined) {
3056
3059
  const n = this._getOrReturnCtx(e);
3057
- return m(n, {
3060
+ return y(n, {
3058
3061
  code: f.invalid_type,
3059
3062
  expected: _.undefined,
3060
3063
  received: n.parsedType
@@ -3070,7 +3073,7 @@ class $t extends T {
3070
3073
  _parse(e) {
3071
3074
  if (this._getType(e) !== _.null) {
3072
3075
  const n = this._getOrReturnCtx(e);
3073
- return m(n, {
3076
+ return y(n, {
3074
3077
  code: f.invalid_type,
3075
3078
  expected: _.null,
3076
3079
  received: n.parsedType
@@ -3104,24 +3107,24 @@ class Xe extends T {
3104
3107
  Xe.create = (t) => new Xe(d({
3105
3108
  typeName: E.ZodUnknown
3106
3109
  }, O(t)));
3107
- class Ne extends T {
3110
+ class Re extends T {
3108
3111
  _parse(e) {
3109
3112
  const n = this._getOrReturnCtx(e);
3110
- return m(n, {
3113
+ return y(n, {
3111
3114
  code: f.invalid_type,
3112
3115
  expected: _.never,
3113
3116
  received: n.parsedType
3114
3117
  }), S;
3115
3118
  }
3116
3119
  }
3117
- Ne.create = (t) => new Ne(d({
3120
+ Re.create = (t) => new Re(d({
3118
3121
  typeName: E.ZodNever
3119
3122
  }, O(t)));
3120
3123
  class wn extends T {
3121
3124
  _parse(e) {
3122
3125
  if (this._getType(e) !== _.undefined) {
3123
3126
  const n = this._getOrReturnCtx(e);
3124
- return m(n, {
3127
+ return y(n, {
3125
3128
  code: f.invalid_type,
3126
3129
  expected: _.void,
3127
3130
  received: n.parsedType
@@ -3137,14 +3140,14 @@ class pe extends T {
3137
3140
  _parse(e) {
3138
3141
  const { ctx: n, status: r } = this._processInputParams(e), s = this._def;
3139
3142
  if (n.parsedType !== _.array)
3140
- return m(n, {
3143
+ return y(n, {
3141
3144
  code: f.invalid_type,
3142
3145
  expected: _.array,
3143
3146
  received: n.parsedType
3144
3147
  }), S;
3145
3148
  if (s.exactLength !== null) {
3146
3149
  const i = n.data.length > s.exactLength.value, o = n.data.length < s.exactLength.value;
3147
- (i || o) && (m(n, {
3150
+ (i || o) && (y(n, {
3148
3151
  code: i ? f.too_big : f.too_small,
3149
3152
  minimum: o ? s.exactLength.value : void 0,
3150
3153
  maximum: i ? s.exactLength.value : void 0,
@@ -3154,14 +3157,14 @@ class pe extends T {
3154
3157
  message: s.exactLength.message
3155
3158
  }), r.dirty());
3156
3159
  }
3157
- if (s.minLength !== null && n.data.length < s.minLength.value && (m(n, {
3160
+ if (s.minLength !== null && n.data.length < s.minLength.value && (y(n, {
3158
3161
  code: f.too_small,
3159
3162
  minimum: s.minLength.value,
3160
3163
  type: "array",
3161
3164
  inclusive: !0,
3162
3165
  exact: !1,
3163
3166
  message: s.minLength.message
3164
- }), r.dirty()), s.maxLength !== null && n.data.length > s.maxLength.value && (m(n, {
3167
+ }), r.dirty()), s.maxLength !== null && n.data.length > s.maxLength.value && (y(n, {
3165
3168
  code: f.too_big,
3166
3169
  maximum: s.maxLength.value,
3167
3170
  type: "array",
@@ -3229,14 +3232,14 @@ class F extends T {
3229
3232
  _parse(e) {
3230
3233
  if (this._getType(e) !== _.object) {
3231
3234
  const u = this._getOrReturnCtx(e);
3232
- return m(u, {
3235
+ return y(u, {
3233
3236
  code: f.invalid_type,
3234
3237
  expected: _.object,
3235
3238
  received: u.parsedType
3236
3239
  }), S;
3237
3240
  }
3238
3241
  const { status: n, ctx: r } = this._processInputParams(e), { shape: s, keys: a } = this._getCached(), i = [];
3239
- if (!(this._def.catchall instanceof Ne && this._def.unknownKeys === "strip"))
3242
+ if (!(this._def.catchall instanceof Re && this._def.unknownKeys === "strip"))
3240
3243
  for (const u in r.data)
3241
3244
  a.includes(u) || i.push(u);
3242
3245
  const o = [];
@@ -3248,7 +3251,7 @@ class F extends T {
3248
3251
  alwaysSet: u in r.data
3249
3252
  });
3250
3253
  }
3251
- if (this._def.catchall instanceof Ne) {
3254
+ if (this._def.catchall instanceof Re) {
3252
3255
  const u = this._def.unknownKeys;
3253
3256
  if (u === "passthrough")
3254
3257
  for (const c of i)
@@ -3257,7 +3260,7 @@ class F extends T {
3257
3260
  value: { status: "valid", value: r.data[c] }
3258
3261
  });
3259
3262
  else if (u === "strict")
3260
- i.length > 0 && (m(r, {
3263
+ i.length > 0 && (y(r, {
3261
3264
  code: f.unrecognized_keys,
3262
3265
  keys: i
3263
3266
  }), n.dirty());
@@ -3469,19 +3472,19 @@ class F extends T {
3469
3472
  F.create = (t, e) => new F(d({
3470
3473
  shape: () => t,
3471
3474
  unknownKeys: "strip",
3472
- catchall: Ne.create(),
3475
+ catchall: Re.create(),
3473
3476
  typeName: E.ZodObject
3474
3477
  }, O(e)));
3475
3478
  F.strictCreate = (t, e) => new F(d({
3476
3479
  shape: () => t,
3477
3480
  unknownKeys: "strict",
3478
- catchall: Ne.create(),
3481
+ catchall: Re.create(),
3479
3482
  typeName: E.ZodObject
3480
3483
  }, O(e)));
3481
3484
  F.lazycreate = (t, e) => new F(d({
3482
3485
  shape: t,
3483
3486
  unknownKeys: "strip",
3484
- catchall: Ne.create(),
3487
+ catchall: Re.create(),
3485
3488
  typeName: E.ZodObject
3486
3489
  }, O(e)));
3487
3490
  class Ft extends T {
@@ -3495,7 +3498,7 @@ class Ft extends T {
3495
3498
  if (o.result.status === "dirty")
3496
3499
  return n.common.issues.push(...o.ctx.common.issues), o.result;
3497
3500
  const i = a.map((o) => new ie(o.ctx.common.issues));
3498
- return m(n, {
3501
+ return y(n, {
3499
3502
  code: f.invalid_union,
3500
3503
  unionErrors: i
3501
3504
  }), S;
@@ -3538,7 +3541,7 @@ class Ft extends T {
3538
3541
  if (a)
3539
3542
  return n.common.issues.push(...a.ctx.common.issues), a.result;
3540
3543
  const o = i.map((u) => new ie(u));
3541
- return m(n, {
3544
+ return y(n, {
3542
3545
  code: f.invalid_union,
3543
3546
  unionErrors: o
3544
3547
  }), S;
@@ -3552,12 +3555,12 @@ Ft.create = (t, e) => new Ft(d({
3552
3555
  options: t,
3553
3556
  typeName: E.ZodUnion
3554
3557
  }, O(e)));
3555
- const Ie = (t) => t instanceof Vt ? Ie(t.schema) : t instanceof me ? Ie(t.innerType()) : t instanceof Ut ? [t.value] : t instanceof Fe ? t.options : t instanceof Bt ? C.objectValues(t.enum) : t instanceof qt ? Ie(t._def.innerType) : t instanceof Lt ? [void 0] : t instanceof $t ? [null] : t instanceof we ? [void 0, ...Ie(t.unwrap())] : t instanceof We ? [null, ...Ie(t.unwrap())] : t instanceof Nr || t instanceof Ht ? Ie(t.unwrap()) : t instanceof Kt ? Ie(t._def.innerType) : [];
3558
+ const je = (t) => t instanceof Vt ? je(t.schema) : t instanceof me ? je(t.innerType()) : t instanceof Ut ? [t.value] : t instanceof Fe ? t.options : t instanceof Bt ? C.objectValues(t.enum) : t instanceof qt ? je(t._def.innerType) : t instanceof Lt ? [void 0] : t instanceof $t ? [null] : t instanceof we ? [void 0, ...je(t.unwrap())] : t instanceof We ? [null, ...je(t.unwrap())] : t instanceof Rr || t instanceof Ht ? je(t.unwrap()) : t instanceof Kt ? je(t._def.innerType) : [];
3556
3559
  class An extends T {
3557
3560
  _parse(e) {
3558
3561
  const { ctx: n } = this._processInputParams(e);
3559
3562
  if (n.parsedType !== _.object)
3560
- return m(n, {
3563
+ return y(n, {
3561
3564
  code: f.invalid_type,
3562
3565
  expected: _.object,
3563
3566
  received: n.parsedType
@@ -3571,7 +3574,7 @@ class An extends T {
3571
3574
  data: n.data,
3572
3575
  path: n.path,
3573
3576
  parent: n
3574
- }) : (m(n, {
3577
+ }) : (y(n, {
3575
3578
  code: f.invalid_union_discriminator,
3576
3579
  options: Array.from(this.optionsMap.keys()),
3577
3580
  path: [r]
@@ -3597,7 +3600,7 @@ class An extends T {
3597
3600
  static create(e, n, r) {
3598
3601
  const s = /* @__PURE__ */ new Map();
3599
3602
  for (const a of n) {
3600
- const i = Ie(a.shape[e]);
3603
+ const i = je(a.shape[e]);
3601
3604
  if (!i.length)
3602
3605
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
3603
3606
  for (const o of i) {
@@ -3615,7 +3618,7 @@ class An extends T {
3615
3618
  }
3616
3619
  }
3617
3620
  function _r(t, e) {
3618
- const n = Pe(t), r = Pe(e);
3621
+ const n = Ne(t), r = Ne(e);
3619
3622
  if (t === e)
3620
3623
  return { valid: !0, data: t };
3621
3624
  if (n === _.object && r === _.object) {
@@ -3646,7 +3649,7 @@ class Wt extends T {
3646
3649
  if (yr(a) || yr(i))
3647
3650
  return S;
3648
3651
  const o = _r(a.value, i.value);
3649
- return o.valid ? ((gr(a) || gr(i)) && n.dirty(), { status: n.value, value: o.data }) : (m(r, {
3652
+ return o.valid ? ((gr(a) || gr(i)) && n.dirty(), { status: n.value, value: o.data }) : (y(r, {
3650
3653
  code: f.invalid_intersection_types
3651
3654
  }), S);
3652
3655
  };
@@ -3681,20 +3684,20 @@ class xe extends T {
3681
3684
  _parse(e) {
3682
3685
  const { status: n, ctx: r } = this._processInputParams(e);
3683
3686
  if (r.parsedType !== _.array)
3684
- return m(r, {
3687
+ return y(r, {
3685
3688
  code: f.invalid_type,
3686
3689
  expected: _.array,
3687
3690
  received: r.parsedType
3688
3691
  }), S;
3689
3692
  if (r.data.length < this._def.items.length)
3690
- return m(r, {
3693
+ return y(r, {
3691
3694
  code: f.too_small,
3692
3695
  minimum: this._def.items.length,
3693
3696
  inclusive: !0,
3694
3697
  exact: !1,
3695
3698
  type: "array"
3696
3699
  }), S;
3697
- !this._def.rest && r.data.length > this._def.items.length && (m(r, {
3700
+ !this._def.rest && r.data.length > this._def.items.length && (y(r, {
3698
3701
  code: f.too_big,
3699
3702
  maximum: this._def.items.length,
3700
3703
  inclusive: !0,
@@ -3735,7 +3738,7 @@ class zt extends T {
3735
3738
  _parse(e) {
3736
3739
  const { status: n, ctx: r } = this._processInputParams(e);
3737
3740
  if (r.parsedType !== _.object)
3738
- return m(r, {
3741
+ return y(r, {
3739
3742
  code: f.invalid_type,
3740
3743
  expected: _.object,
3741
3744
  received: r.parsedType
@@ -3774,7 +3777,7 @@ class kn extends T {
3774
3777
  _parse(e) {
3775
3778
  const { status: n, ctx: r } = this._processInputParams(e);
3776
3779
  if (r.parsedType !== _.map)
3777
- return m(r, {
3780
+ return y(r, {
3778
3781
  code: f.invalid_type,
3779
3782
  expected: _.map,
3780
3783
  received: r.parsedType
@@ -3815,20 +3818,20 @@ class nt extends T {
3815
3818
  _parse(e) {
3816
3819
  const { status: n, ctx: r } = this._processInputParams(e);
3817
3820
  if (r.parsedType !== _.set)
3818
- return m(r, {
3821
+ return y(r, {
3819
3822
  code: f.invalid_type,
3820
3823
  expected: _.set,
3821
3824
  received: r.parsedType
3822
3825
  }), S;
3823
3826
  const s = this._def;
3824
- s.minSize !== null && r.data.size < s.minSize.value && (m(r, {
3827
+ s.minSize !== null && r.data.size < s.minSize.value && (y(r, {
3825
3828
  code: f.too_small,
3826
3829
  minimum: s.minSize.value,
3827
3830
  type: "set",
3828
3831
  inclusive: !0,
3829
3832
  exact: !1,
3830
3833
  message: s.minSize.message
3831
- }), n.dirty()), s.maxSize !== null && r.data.size > s.maxSize.value && (m(r, {
3834
+ }), n.dirty()), s.maxSize !== null && r.data.size > s.maxSize.value && (y(r, {
3832
3835
  code: f.too_big,
3833
3836
  maximum: s.maxSize.value,
3834
3837
  type: "set",
@@ -3879,7 +3882,7 @@ class pt extends T {
3879
3882
  _parse(e) {
3880
3883
  const { ctx: n } = this._processInputParams(e);
3881
3884
  if (n.parsedType !== _.function)
3882
- return m(n, {
3885
+ return y(n, {
3883
3886
  code: f.invalid_type,
3884
3887
  expected: _.function,
3885
3888
  received: n.parsedType
@@ -3989,7 +3992,7 @@ class Ut extends T {
3989
3992
  _parse(e) {
3990
3993
  if (e.data !== this._def.value) {
3991
3994
  const n = this._getOrReturnCtx(e);
3992
- return m(n, {
3995
+ return y(n, {
3993
3996
  received: n.data,
3994
3997
  code: f.invalid_literal,
3995
3998
  expected: this._def.value
@@ -4018,7 +4021,7 @@ class Fe extends T {
4018
4021
  _parse(e) {
4019
4022
  if (typeof e.data != "string") {
4020
4023
  const n = this._getOrReturnCtx(e), r = this._def.values;
4021
- return m(n, {
4024
+ return y(n, {
4022
4025
  expected: C.joinValues(r),
4023
4026
  received: n.parsedType,
4024
4027
  code: f.invalid_type
@@ -4026,7 +4029,7 @@ class Fe extends T {
4026
4029
  }
4027
4030
  if (vn(this, St) || Ws(this, St, new Set(this._def.values)), !vn(this, St).has(e.data)) {
4028
4031
  const n = this._getOrReturnCtx(e), r = this._def.values;
4029
- return m(n, {
4032
+ return y(n, {
4030
4033
  received: n.data,
4031
4034
  code: f.invalid_enum_value,
4032
4035
  options: r
@@ -4072,7 +4075,7 @@ class Bt extends T {
4072
4075
  const n = C.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
4073
4076
  if (r.parsedType !== _.string && r.parsedType !== _.number) {
4074
4077
  const s = C.objectValues(n);
4075
- return m(r, {
4078
+ return y(r, {
4076
4079
  expected: C.joinValues(s),
4077
4080
  received: r.parsedType,
4078
4081
  code: f.invalid_type
@@ -4080,7 +4083,7 @@ class Bt extends T {
4080
4083
  }
4081
4084
  if (vn(this, Ot) || Ws(this, Ot, new Set(C.getValidEnumValues(this._def.values))), !vn(this, Ot).has(e.data)) {
4082
4085
  const s = C.objectValues(n);
4083
- return m(r, {
4086
+ return y(r, {
4084
4087
  received: r.data,
4085
4088
  code: f.invalid_enum_value,
4086
4089
  options: s
@@ -4104,7 +4107,7 @@ class vt extends T {
4104
4107
  _parse(e) {
4105
4108
  const { ctx: n } = this._processInputParams(e);
4106
4109
  if (n.parsedType !== _.promise && n.common.async === !1)
4107
- return m(n, {
4110
+ return y(n, {
4108
4111
  code: f.invalid_type,
4109
4112
  expected: _.promise,
4110
4113
  received: n.parsedType
@@ -4130,7 +4133,7 @@ class me extends T {
4130
4133
  _parse(e) {
4131
4134
  const { status: n, ctx: r } = this._processInputParams(e), s = this._def.effect || null, a = {
4132
4135
  addIssue: (i) => {
4133
- m(r, i), i.fatal ? n.abort() : n.dirty();
4136
+ y(r, i), i.fatal ? n.abort() : n.dirty();
4134
4137
  },
4135
4138
  get path() {
4136
4139
  return r.path;
@@ -4292,7 +4295,7 @@ class En extends T {
4292
4295
  _parse(e) {
4293
4296
  if (this._getType(e) !== _.nan) {
4294
4297
  const n = this._getOrReturnCtx(e);
4295
- return m(n, {
4298
+ return y(n, {
4296
4299
  code: f.invalid_type,
4297
4300
  expected: _.nan,
4298
4301
  received: n.parsedType
@@ -4305,7 +4308,7 @@ En.create = (t) => new En(d({
4305
4308
  typeName: E.ZodNaN
4306
4309
  }, O(t)));
4307
4310
  const Ui = Symbol("zod_brand");
4308
- class Nr extends T {
4311
+ class Rr extends T {
4309
4312
  _parse(e) {
4310
4313
  const { ctx: n } = this._processInputParams(e), r = n.data;
4311
4314
  return this._def.type._parse({
@@ -4389,7 +4392,7 @@ var E;
4389
4392
  })(E || (E = {}));
4390
4393
  const qi = (t, e = {
4391
4394
  message: `Input not instance of ${t.name}`
4392
- }) => qs((n) => n instanceof t, e), Ks = he.create, Hs = Le.create, Ki = En.create, Hi = $e.create, Gs = Mt.create, Gi = tt.create, Ji = bn.create, Xi = Lt.create, Yi = $t.create, Qi = _t.create, eo = Xe.create, to = Ne.create, no = wn.create, ro = pe.create, so = F.create, ao = F.strictCreate, io = Ft.create, oo = An.create, uo = Wt.create, co = xe.create, lo = zt.create, fo = kn.create, ho = nt.create, po = pt.create, mo = Vt.create, yo = Ut.create, go = Fe.create, _o = Bt.create, vo = vt.create, ys = me.create, bo = we.create, wo = We.create, ko = me.createWithPreprocess, Eo = Xt.create, xo = () => Ks().optional(), So = () => Hs().optional(), Oo = () => Gs().optional(), To = {
4395
+ }) => qs((n) => n instanceof t, e), Ks = he.create, Hs = Le.create, Ki = En.create, Hi = $e.create, Gs = Mt.create, Gi = tt.create, Ji = bn.create, Xi = Lt.create, Yi = $t.create, Qi = _t.create, eo = Xe.create, to = Re.create, no = wn.create, ro = pe.create, so = F.create, ao = F.strictCreate, io = Ft.create, oo = An.create, uo = Wt.create, co = xe.create, lo = zt.create, fo = kn.create, ho = nt.create, po = pt.create, mo = Vt.create, yo = Ut.create, go = Fe.create, _o = Bt.create, vo = vt.create, ys = me.create, bo = we.create, wo = We.create, ko = me.createWithPreprocess, Eo = Xt.create, xo = () => Ks().optional(), So = () => Hs().optional(), Oo = () => Gs().optional(), To = {
4393
4396
  string: (t) => he.create(x(d({}, t), { coerce: !0 })),
4394
4397
  number: (t) => Le.create(x(d({}, t), { coerce: !0 })),
4395
4398
  boolean: (t) => Mt.create(x(d({}, t), {
@@ -4398,14 +4401,14 @@ const qi = (t, e = {
4398
4401
  bigint: (t) => $e.create(x(d({}, t), { coerce: !0 })),
4399
4402
  date: (t) => tt.create(x(d({}, t), { coerce: !0 }))
4400
4403
  }, Ao = S;
4401
- var se = /* @__PURE__ */ Object.freeze({
4404
+ var te = /* @__PURE__ */ Object.freeze({
4402
4405
  __proto__: null,
4403
4406
  defaultErrorMap: gt,
4404
4407
  setErrorMap: wi,
4405
4408
  getErrorMap: yn,
4406
4409
  makeIssue: gn,
4407
4410
  EMPTY_PATH: ki,
4408
- addIssueToContext: m,
4411
+ addIssueToContext: y,
4409
4412
  ParseStatus: J,
4410
4413
  INVALID: S,
4411
4414
  DIRTY: _n,
@@ -4421,7 +4424,7 @@ var se = /* @__PURE__ */ Object.freeze({
4421
4424
  return mr;
4422
4425
  },
4423
4426
  ZodParsedType: _,
4424
- getParsedType: Pe,
4427
+ getParsedType: Ne,
4425
4428
  ZodType: T,
4426
4429
  datetimeRegex: Us,
4427
4430
  ZodString: he,
@@ -4434,7 +4437,7 @@ var se = /* @__PURE__ */ Object.freeze({
4434
4437
  ZodNull: $t,
4435
4438
  ZodAny: _t,
4436
4439
  ZodUnknown: Xe,
4437
- ZodNever: Ne,
4440
+ ZodNever: Re,
4438
4441
  ZodVoid: wn,
4439
4442
  ZodArray: pe,
4440
4443
  ZodObject: F,
@@ -4459,7 +4462,7 @@ var se = /* @__PURE__ */ Object.freeze({
4459
4462
  ZodCatch: Kt,
4460
4463
  ZodNaN: En,
4461
4464
  BRAND: Ui,
4462
- ZodBranded: Nr,
4465
+ ZodBranded: Rr,
4463
4466
  ZodPipeline: Xt,
4464
4467
  ZodReadonly: Ht,
4465
4468
  custom: qs,
@@ -4514,14 +4517,14 @@ var se = /* @__PURE__ */ Object.freeze({
4514
4517
  quotelessJson: bi,
4515
4518
  ZodError: ie
4516
4519
  });
4517
- se.object({
4518
- language: se.enum(["typescript", "javascript"]).optional()
4520
+ te.object({
4521
+ language: te.enum(["typescript", "javascript"]).optional()
4519
4522
  }).and(
4520
- se.union([
4521
- se.object({
4522
- framework: se.literal("react"),
4523
- model: se.string().optional(),
4524
- styling: se.enum([
4523
+ te.union([
4524
+ te.object({
4525
+ framework: te.literal("react"),
4526
+ model: te.string().optional(),
4527
+ styling: te.enum([
4525
4528
  "plain_css",
4526
4529
  "css_modules",
4527
4530
  "styled_components",
@@ -4530,26 +4533,27 @@ se.object({
4530
4533
  "scss",
4531
4534
  "inline_styles"
4532
4535
  ]),
4533
- uiLibrary: se.enum(["mui", "antd", "radix", "shadcn"]).optional(),
4534
- enableUILibraryTheming: se.boolean().optional()
4536
+ uiLibrary: te.enum(["mui", "antd", "radix", "shadcn"]).optional(),
4537
+ enableUILibraryTheming: te.boolean().optional(),
4538
+ enableCompactStructure: te.boolean().optional()
4535
4539
  }),
4536
- se.object({
4537
- framework: se.literal("html"),
4538
- styling: se.enum(["plain_css", "inline_styles"]),
4539
- enableTranslation: se.boolean().optional()
4540
+ te.object({
4541
+ framework: te.literal("html"),
4542
+ styling: te.enum(["plain_css", "inline_styles"]),
4543
+ enableTranslation: te.boolean().optional()
4540
4544
  })
4541
4545
  ])
4542
4546
  );
4543
- var Co = Object.defineProperty, Po = Object.defineProperties, Ro = Object.getOwnPropertyDescriptors, gs = Object.getOwnPropertySymbols, No = Object.prototype.hasOwnProperty, Io = Object.prototype.propertyIsEnumerable, _s = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), Js = (t) => {
4547
+ var Co = Object.defineProperty, No = Object.defineProperties, Po = Object.getOwnPropertyDescriptors, gs = Object.getOwnPropertySymbols, Ro = Object.prototype.hasOwnProperty, jo = Object.prototype.propertyIsEnumerable, _s = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), Js = (t) => {
4544
4548
  throw TypeError(t);
4545
4549
  }, vs = (t, e, n) => e in t ? Co(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ae = (t, e) => {
4546
4550
  for (var n in e || (e = {}))
4547
- No.call(e, n) && vs(t, n, e[n]);
4551
+ Ro.call(e, n) && vs(t, n, e[n]);
4548
4552
  if (gs)
4549
4553
  for (var n of gs(e))
4550
- Io.call(e, n) && vs(t, n, e[n]);
4554
+ jo.call(e, n) && vs(t, n, e[n]);
4551
4555
  return t;
4552
- }, Ir = (t, e) => Po(t, Ro(e)), jr = (t, e, n) => e.has(t) || Js("Cannot " + n), R = (t, e, n) => (jr(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Js("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), G = (t, e, n, r) => (jr(t, e, "write to private field"), e.set(t, n), n), ve = (t, e, n) => (jr(t, e, "access private method"), n), V = (t, e, n) => new Promise((r, s) => {
4556
+ }, jr = (t, e) => No(t, Po(e)), Ir = (t, e, n) => e.has(t) || Js("Cannot " + n), P = (t, e, n) => (Ir(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Js("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), G = (t, e, n, r) => (Ir(t, e, "write to private field"), e.set(t, n), n), ve = (t, e, n) => (Ir(t, e, "access private method"), n), V = (t, e, n) => new Promise((r, s) => {
4553
4557
  var a = (u) => {
4554
4558
  try {
4555
4559
  o(n.next(u));
@@ -4564,7 +4568,7 @@ var Co = Object.defineProperty, Po = Object.defineProperties, Ro = Object.getOwn
4564
4568
  }
4565
4569
  }, o = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(a, i);
4566
4570
  o((n = n.apply(t, e)).next());
4567
- }), jo = (t, e, n) => (e = t[_s("asyncIterator")]) ? e.call(t) : (t = t[_s("iterator")](), e = {}, n = (r, s) => (s = t[r]) && (e[r] = (a) => new Promise((i, o, u) => (a = s.call(t, a), u = a.done, Promise.resolve(a.value).then((c) => i({ value: c, done: u }), o)))), n("next"), n("return"), e), Zo = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
4571
+ }), Io = (t, e, n) => (e = t[_s("asyncIterator")]) ? e.call(t) : (t = t[_s("iterator")](), e = {}, n = (r, s) => (s = t[r]) && (e[r] = (a) => new Promise((i, o, u) => (a = s.call(t, a), u = a.done, Promise.resolve(a.value).then((c) => i({ value: c, done: u }), o)))), n("next"), n("return"), e), Zo = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
4568
4572
  function Do(t) {
4569
4573
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
4570
4574
  }
@@ -4574,42 +4578,42 @@ function Lo() {
4574
4578
  (function(n, r) {
4575
4579
  t.exports = r();
4576
4580
  })(Mo, function() {
4577
- var n = typeof Promise == "function", r = typeof self == "object" ? self : Zo, s = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", u = typeof WeakSet != "undefined", c = typeof DataView != "undefined", h = s && typeof Symbol.iterator != "undefined", p = s && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", g = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), l = g && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), v = h && typeof Array.prototype[Symbol.iterator] == "function", y = v && Object.getPrototypeOf([][Symbol.iterator]()), z = h && typeof String.prototype[Symbol.iterator] == "function", N = z && Object.getPrototypeOf(""[Symbol.iterator]()), q = 8, D = -1;
4578
- function B(I) {
4579
- var $ = typeof I;
4581
+ var n = typeof Promise == "function", r = typeof self == "object" ? self : Zo, s = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", u = typeof WeakSet != "undefined", c = typeof DataView != "undefined", h = s && typeof Symbol.iterator != "undefined", p = s && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", g = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), l = g && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), v = h && typeof Array.prototype[Symbol.iterator] == "function", m = v && Object.getPrototypeOf([][Symbol.iterator]()), z = h && typeof String.prototype[Symbol.iterator] == "function", R = z && Object.getPrototypeOf(""[Symbol.iterator]()), q = 8, D = -1;
4582
+ function B(j) {
4583
+ var $ = typeof j;
4580
4584
  if ($ !== "object")
4581
4585
  return $;
4582
- if (I === null)
4586
+ if (j === null)
4583
4587
  return "null";
4584
- if (I === r)
4588
+ if (j === r)
4585
4589
  return "global";
4586
- if (Array.isArray(I) && (p === !1 || !(Symbol.toStringTag in I)))
4590
+ if (Array.isArray(j) && (p === !1 || !(Symbol.toStringTag in j)))
4587
4591
  return "Array";
4588
4592
  if (typeof window == "object" && window !== null) {
4589
- if (typeof window.location == "object" && I === window.location)
4593
+ if (typeof window.location == "object" && j === window.location)
4590
4594
  return "Location";
4591
- if (typeof window.document == "object" && I === window.document)
4595
+ if (typeof window.document == "object" && j === window.document)
4592
4596
  return "Document";
4593
4597
  if (typeof window.navigator == "object") {
4594
- if (typeof window.navigator.mimeTypes == "object" && I === window.navigator.mimeTypes)
4598
+ if (typeof window.navigator.mimeTypes == "object" && j === window.navigator.mimeTypes)
4595
4599
  return "MimeTypeArray";
4596
- if (typeof window.navigator.plugins == "object" && I === window.navigator.plugins)
4600
+ if (typeof window.navigator.plugins == "object" && j === window.navigator.plugins)
4597
4601
  return "PluginArray";
4598
4602
  }
4599
- if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && I instanceof window.HTMLElement) {
4600
- if (I.tagName === "BLOCKQUOTE")
4603
+ if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && j instanceof window.HTMLElement) {
4604
+ if (j.tagName === "BLOCKQUOTE")
4601
4605
  return "HTMLQuoteElement";
4602
- if (I.tagName === "TD")
4606
+ if (j.tagName === "TD")
4603
4607
  return "HTMLTableDataCellElement";
4604
- if (I.tagName === "TH")
4608
+ if (j.tagName === "TH")
4605
4609
  return "HTMLTableHeaderCellElement";
4606
4610
  }
4607
4611
  }
4608
- var Se = p && I[Symbol.toStringTag];
4612
+ var Se = p && j[Symbol.toStringTag];
4609
4613
  if (typeof Se == "string")
4610
4614
  return Se;
4611
- var M = Object.getPrototypeOf(I);
4612
- return M === RegExp.prototype ? "RegExp" : M === Date.prototype ? "Date" : n && M === Promise.prototype ? "Promise" : i && M === Set.prototype ? "Set" : a && M === Map.prototype ? "Map" : u && M === WeakSet.prototype ? "WeakSet" : o && M === WeakMap.prototype ? "WeakMap" : c && M === DataView.prototype ? "DataView" : a && M === l ? "Map Iterator" : i && M === b ? "Set Iterator" : v && M === y ? "Array Iterator" : z && M === N ? "String Iterator" : M === null ? "Object" : Object.prototype.toString.call(I).slice(q, D);
4615
+ var M = Object.getPrototypeOf(j);
4616
+ return M === RegExp.prototype ? "RegExp" : M === Date.prototype ? "Date" : n && M === Promise.prototype ? "Promise" : i && M === Set.prototype ? "Set" : a && M === Map.prototype ? "Map" : u && M === WeakSet.prototype ? "WeakSet" : o && M === WeakMap.prototype ? "WeakMap" : c && M === DataView.prototype ? "DataView" : a && M === l ? "Map Iterator" : i && M === b ? "Set Iterator" : v && M === m ? "Array Iterator" : z && M === R ? "String Iterator" : M === null ? "Object" : Object.prototype.toString.call(j).slice(q, D);
4613
4617
  }
4614
4618
  return B;
4615
4619
  });
@@ -4888,9 +4892,9 @@ class cu {
4888
4892
  run() {
4889
4893
  return V(this, null, function* () {
4890
4894
  try {
4891
- return yield R(this, dn).call(this);
4895
+ return yield P(this, dn).call(this);
4892
4896
  } catch (e) {
4893
- if (G(this, Ge, R(this, Ge) + 1), R(this, Ge) > R(this, cn))
4897
+ if (G(this, Ge, P(this, Ge) + 1), P(this, Ge) > P(this, cn))
4894
4898
  throw console.error("Max attempts reached"), e;
4895
4899
  const n = ve(this, Er, Xs).call(this);
4896
4900
  return yield uu(n), yield this.run();
@@ -4899,7 +4903,7 @@ class cu {
4899
4903
  }
4900
4904
  }
4901
4905
  cn = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), dn = /* @__PURE__ */ new WeakMap(), Er = /* @__PURE__ */ new WeakSet(), Xs = function() {
4902
- return R(this, Ge) * 1e3 * 1.5;
4906
+ return P(this, Ge) * 1e3 * 1.5;
4903
4907
  };
4904
4908
  function du() {
4905
4909
  return typeof CompressionStream != "undefined";
@@ -4908,7 +4912,7 @@ function lu(t) {
4908
4912
  return V(this, null, function* () {
4909
4913
  const e = new Blob([t]).stream().pipeThrough(new CompressionStream("gzip")), n = [];
4910
4914
  try {
4911
- for (var r = jo(e), s, a, i; s = !(a = yield r.next()).done; s = !1) {
4915
+ for (var r = Io(e), s, a, i; s = !(a = yield r.next()).done; s = !1) {
4912
4916
  const o = a.value;
4913
4917
  n.push(o);
4914
4918
  }
@@ -4990,10 +4994,10 @@ function xr() {
4990
4994
  return Math.floor(Date.now() / 1e3).toString();
4991
4995
  }
4992
4996
  const mu = 5 * 60 * 1e3, yu = 1 * 1e3;
4993
- var Je, te, ge, Sr, Or, At;
4997
+ var Je, ne, ge, Sr, Or, At;
4994
4998
  class gu {
4995
4999
  constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
4996
- de(this, ge), de(this, Je), de(this, te), this.baseAddress = n, G(this, Je, e), G(this, te, {}), this.plugins = [];
5000
+ de(this, ge), de(this, Je), de(this, ne), this.baseAddress = n, G(this, Je, e), G(this, ne, {}), this.plugins = [];
4997
5001
  }
4998
5002
  get headers() {
4999
5003
  throw new Error("Missing implementation");
@@ -5005,47 +5009,47 @@ class gu {
5005
5009
  this.plugins = this.plugins.filter((n) => n.name !== e);
5006
5010
  }
5007
5011
  withOptions(e = {}) {
5008
- return G(this, te, e), this;
5012
+ return G(this, ne, e), this;
5009
5013
  }
5010
5014
  get(e) {
5011
5015
  return V(this, arguments, function* (n, r = {}) {
5012
5016
  const { overrideBaseAddress: s, overrideDefaultHeaders: a } = r, i = s != null ? s : this.baseAddress;
5013
5017
  let o = a != null ? a : this.headers;
5014
- const u = kt(R(this, te));
5015
- return G(this, te, {}), u.extraHeaders && (o = ae(ae({}, o), u.extraHeaders)), u.requestValidation && (o = Ir(ae({}, o), { "X-Request-Nonce": Ys(), "X-Request-Timestamp": xr() })), u.async ? yield ve(this, ge, Or).call(this, `${i}${n}`, u.async, { headers: o }) : yield ve(this, ge, Sr).call(this, `${i}${n}`, u, { headers: o });
5018
+ const u = kt(P(this, ne));
5019
+ return G(this, ne, {}), u.extraHeaders && (o = ae(ae({}, o), u.extraHeaders)), u.requestValidation && (o = jr(ae({}, o), { "X-Request-Nonce": Ys(), "X-Request-Timestamp": xr() })), u.async ? yield ve(this, ge, Or).call(this, `${i}${n}`, u.async, { headers: o }) : yield ve(this, ge, Sr).call(this, `${i}${n}`, u, { headers: o });
5016
5020
  });
5017
5021
  }
5018
5022
  post(e, n) {
5019
5023
  return V(this, arguments, function* (r, s, a = {}) {
5020
- const i = kt(R(this, te));
5021
- return G(this, te, {}), ve(this, ge, At).call(this, r, "POST", s, a, i);
5024
+ const i = kt(P(this, ne));
5025
+ return G(this, ne, {}), ve(this, ge, At).call(this, r, "POST", s, a, i);
5022
5026
  });
5023
5027
  }
5024
5028
  put(e, n) {
5025
5029
  return V(this, arguments, function* (r, s, a = {}) {
5026
- const i = kt(R(this, te));
5027
- return G(this, te, {}), ve(this, ge, At).call(this, r, "PUT", s, a, i);
5030
+ const i = kt(P(this, ne));
5031
+ return G(this, ne, {}), ve(this, ge, At).call(this, r, "PUT", s, a, i);
5028
5032
  });
5029
5033
  }
5030
5034
  delete(e, n) {
5031
5035
  return V(this, arguments, function* (r, s, a = {}) {
5032
- const i = kt(R(this, te));
5033
- return G(this, te, {}), ve(this, ge, At).call(this, r, "DELETE", s, a, i);
5036
+ const i = kt(P(this, ne));
5037
+ return G(this, ne, {}), ve(this, ge, At).call(this, r, "DELETE", s, a, i);
5034
5038
  });
5035
5039
  }
5036
5040
  patch(e, n) {
5037
5041
  return V(this, arguments, function* (r, s, a = {}) {
5038
- const i = kt(R(this, te));
5039
- return G(this, te, {}), ve(this, ge, At).call(this, r, "PATCH", s, a, i);
5042
+ const i = kt(P(this, ne));
5043
+ return G(this, ne, {}), ve(this, ge, At).call(this, r, "PATCH", s, a, i);
5040
5044
  });
5041
5045
  }
5042
5046
  }
5043
- Je = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakSet(), Sr = function(t, e, n) {
5047
+ Je = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakSet(), Sr = function(t, e, n) {
5044
5048
  return V(this, null, function* () {
5045
5049
  const r = () => V(this, null, function* () {
5046
5050
  var u, c;
5047
5051
  try {
5048
- return yield R(this, Je).call(this, t, ae(ae({}, n), e.abortSignal && { signal: e.abortSignal }));
5052
+ return yield P(this, Je).call(this, t, ae(ae({}, n), e.abortSignal && { signal: e.abortSignal }));
5049
5053
  } catch (h) {
5050
5054
  throw h instanceof Error && h.name === "AbortError" ? new Tt({ canceled: (c = (u = e.abortSignal) == null ? void 0 : u.aborted) != null ? c : !1 }) : h;
5051
5055
  }
@@ -5105,7 +5109,7 @@ Je = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ge = /*
5105
5109
  } = e, c = `${t}/async`, h = `${t}/async/job`;
5106
5110
  let p;
5107
5111
  try {
5108
- p = yield R(this, Je).call(this, c, ae(ae({}, n), i && { signal: i }));
5112
+ p = yield P(this, Je).call(this, c, ae(ae({}, n), i && { signal: i }));
5109
5113
  } catch (b) {
5110
5114
  throw b instanceof Error && b.name === "AbortError" ? new Tt({ canceled: (r = i == null ? void 0 : i.aborted) != null ? r : !1 }) : b;
5111
5115
  }
@@ -5126,40 +5130,40 @@ Je = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ge = /*
5126
5130
  return new Promise((b, l) => V(this, null, function* () {
5127
5131
  const v = setTimeout(() => {
5128
5132
  l(new Error("Job timed out"));
5129
- }, u), y = (z = 0) => V(this, null, function* () {
5133
+ }, u), m = (z = 0) => V(this, null, function* () {
5130
5134
  if (i != null && i.aborted) {
5131
- clearTimeout(v), R(this, Je).call(this, `${h}/${g}/cancel`, { method: "POST", headers: this.headers }).then(() => {
5135
+ clearTimeout(v), P(this, Je).call(this, `${h}/${g}/cancel`, { method: "POST", headers: this.headers }).then(() => {
5132
5136
  l(new Tt({ canceled: !0 }));
5133
- }).catch((N) => {
5137
+ }).catch((R) => {
5134
5138
  l(new Tt({ canceled: !1 }));
5135
5139
  });
5136
5140
  return;
5137
5141
  }
5138
5142
  try {
5139
- const N = yield (yield R(this, Je).call(this, `${h}/${g}`, { headers: this.headers })).json();
5140
- if (N.status === "success") {
5143
+ const R = yield (yield P(this, Je).call(this, `${h}/${g}`, { headers: this.headers })).json();
5144
+ if (R.status === "success") {
5141
5145
  clearTimeout(v);
5142
- const q = N.response_json;
5146
+ const q = R.response_json;
5143
5147
  b(q);
5144
- } else if (N.status === "failed")
5145
- clearTimeout(v), l(new pu(N.response_json));
5148
+ } else if (R.status === "failed")
5149
+ clearTimeout(v), l(new pu(R.response_json));
5146
5150
  else {
5147
- a && a(N.response_json);
5151
+ a && a(R.response_json);
5148
5152
  const q = o(z);
5149
- setTimeout(() => y(z + 1), q);
5153
+ setTimeout(() => m(z + 1), q);
5150
5154
  }
5151
- } catch (N) {
5152
- l(N);
5155
+ } catch (R) {
5156
+ l(R);
5153
5157
  }
5154
5158
  });
5155
- y();
5159
+ m();
5156
5160
  }));
5157
5161
  });
5158
5162
  }, At = function(t, e, n, r, s) {
5159
5163
  return V(this, null, function* () {
5160
5164
  const { overrideBaseAddress: a, overrideDefaultHeaders: i } = r, o = a != null ? a : this.baseAddress;
5161
5165
  let u = i != null ? i : this.headers;
5162
- s.extraHeaders && (u = ae(ae({}, u), s.extraHeaders)), s.requestValidation && (u = Ir(ae({}, u), { "X-Request-Nonce": Ys(), "X-Request-Timestamp": xr() }));
5166
+ s.extraHeaders && (u = ae(ae({}, u), s.extraHeaders)), s.requestValidation && (u = jr(ae({}, u), { "X-Request-Nonce": Ys(), "X-Request-Timestamp": xr() }));
5163
5167
  let c = r.skipBodyJsonStringify ? n : JSON.stringify(n);
5164
5168
  return s.compress && du() && (u["Content-Encoding"] = "gzip", c = yield lu(c)), s.async ? yield ve(this, ge, Or).call(this, `${o}${t}`, s.async, {
5165
5169
  method: e,
@@ -5199,14 +5203,14 @@ class _u {
5199
5203
  const s = new URLSearchParams(ae({
5200
5204
  plugin_data: "857346721138427857"
5201
5205
  }, r)).toString(), a = `v1/files/${n}?${s}`;
5202
- return yield R(this, Ct).get(a);
5206
+ return yield P(this, Ct).get(a);
5203
5207
  });
5204
5208
  }
5205
5209
  getImageFills(e) {
5206
5210
  return V(this, arguments, function* ({ fileKey: n }) {
5207
5211
  var r, s;
5208
5212
  const a = `v1/files/${n}/images`;
5209
- return (s = (r = (yield R(this, Ct).get(a)).meta) == null ? void 0 : r.images) != null ? s : {};
5213
+ return (s = (r = (yield P(this, Ct).get(a)).meta) == null ? void 0 : r.images) != null ? s : {};
5210
5214
  });
5211
5215
  }
5212
5216
  }
@@ -5226,29 +5230,29 @@ class wu {
5226
5230
  */
5227
5231
  get(e) {
5228
5232
  return V(this, arguments, function* ({ fileKey: n, nodeIds: r, format: s = "jpg", scale: a }) {
5229
- const i = vu(n, r, s), o = R(this, _e).cache.images.entries.get(i);
5233
+ const i = vu(n, r, s), o = P(this, _e).cache.images.entries.get(i);
5230
5234
  if (bu(o))
5231
5235
  return o.result;
5232
- o && R(this, _e).cache.images.entries.delete(i);
5233
- const u = R(this, _e).cache.images.pendingRequests.get(i);
5236
+ o && P(this, _e).cache.images.entries.delete(i);
5237
+ const u = P(this, _e).cache.images.pendingRequests.get(i);
5234
5238
  if (u)
5235
5239
  return u;
5236
5240
  const c = ve(this, Tr, Qs).call(this, i, n, r, s, a);
5237
- R(this, _e).cache.images.pendingRequests.set(i, c);
5241
+ P(this, _e).cache.images.pendingRequests.set(i, c);
5238
5242
  try {
5239
5243
  return yield c;
5240
5244
  } finally {
5241
- R(this, _e).cache.images.pendingRequests.delete(i);
5245
+ P(this, _e).cache.images.pendingRequests.delete(i);
5242
5246
  }
5243
5247
  });
5244
5248
  }
5245
5249
  }
5246
5250
  _e = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new WeakSet(), Qs = function(t, e, n, r, s) {
5247
5251
  return V(this, null, function* () {
5248
- const a = yield R(this, _e).get(
5252
+ const a = yield P(this, _e).get(
5249
5253
  `v1/images/${e}?ids=${n}&format=${r}${s ? `&scale=${s}` : ""}`
5250
5254
  );
5251
- return R(this, _e).cache.images.entries.set(t, {
5255
+ return P(this, _e).cache.images.entries.set(t, {
5252
5256
  result: a,
5253
5257
  ts: Date.now()
5254
5258
  }), a;
@@ -5261,23 +5265,23 @@ class ku {
5261
5265
  }
5262
5266
  get(e) {
5263
5267
  return V(this, arguments, function* ({ fileKey: n, nodeIds: r, params: s = {} }) {
5264
- const a = Ir(ae({}, s), {
5268
+ const a = jr(ae({}, s), {
5265
5269
  ids: r.join(",")
5266
5270
  }), i = new URLSearchParams(ae({
5267
5271
  plugin_data: "857346721138427857"
5268
5272
  }, a)).toString(), o = `v1/files/${n}/nodes?${i}`;
5269
- return yield R(this, ln).get(o);
5273
+ return yield P(this, ln).get(o);
5270
5274
  });
5271
5275
  }
5272
5276
  }
5273
5277
  ln = /* @__PURE__ */ new WeakMap();
5274
- var je;
5278
+ var Ie;
5275
5279
  class Eu extends gu {
5276
5280
  constructor({
5277
5281
  baseAddress: e = "https://api.figma.com/",
5278
5282
  fetch: n = globalThis.fetch.bind(globalThis)
5279
5283
  } = {}) {
5280
- super({ fetch: n, baseAddress: e }), de(this, je, ""), this.cache = {
5284
+ super({ fetch: n, baseAddress: e }), de(this, Ie, ""), this.cache = {
5281
5285
  images: {
5282
5286
  entries: /* @__PURE__ */ new Map(),
5283
5287
  pendingRequests: /* @__PURE__ */ new Map()
@@ -5287,19 +5291,19 @@ class Eu extends gu {
5287
5291
  set token(e) {
5288
5292
  if (!e.startsWith("figd_") && !e.startsWith("figu_"))
5289
5293
  throw new Error("Invalid Figma access token");
5290
- G(this, je, e);
5294
+ G(this, Ie, e);
5291
5295
  }
5292
5296
  get token() {
5293
- return R(this, je);
5297
+ return P(this, Ie);
5294
5298
  }
5295
5299
  get headers() {
5296
5300
  const e = {
5297
5301
  "Content-Type": "application/json"
5298
5302
  };
5299
- return R(this, je).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = R(this, je) : R(this, je).startsWith("figu_") && (e.Authorization = `Bearer ${R(this, je)}`), e;
5303
+ return P(this, Ie).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = P(this, Ie) : P(this, Ie).startsWith("figu_") && (e.Authorization = `Bearer ${P(this, Ie)}`), e;
5300
5304
  }
5301
5305
  }
5302
- je = /* @__PURE__ */ new WeakMap();
5306
+ Ie = /* @__PURE__ */ new WeakMap();
5303
5307
  const xu = (t) => ke(void 0, [t], function* ({
5304
5308
  fileKey: e,
5305
5309
  authToken: n,