@animaapp/anima-sdk 0.4.4 → 0.4.6

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
@@ -1,37 +1,37 @@
1
1
  var xr = Object.defineProperty, kr = Object.defineProperties;
2
2
  var Tr = Object.getOwnPropertyDescriptors;
3
3
  var Pt = Object.getOwnPropertySymbols;
4
- var Sr = Object.prototype.hasOwnProperty, Ar = Object.prototype.propertyIsEnumerable;
4
+ var Sr = Object.prototype.hasOwnProperty, Er = Object.prototype.propertyIsEnumerable;
5
5
  var Ft = (r) => {
6
6
  throw TypeError(r);
7
7
  };
8
- var $t = (r, e, t) => e in r ? xr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, d = (r, e) => {
8
+ var $t = (r, e, t) => e in r ? xr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, u = (r, e) => {
9
9
  for (var t in e || (e = {}))
10
10
  Sr.call(e, t) && $t(r, t, e[t]);
11
11
  if (Pt)
12
12
  for (var t of Pt(e))
13
- Ar.call(e, t) && $t(r, t, e[t]);
13
+ Er.call(e, t) && $t(r, t, e[t]);
14
14
  return r;
15
15
  }, g = (r, e) => kr(r, Tr(e));
16
- var lt = (r, e, t) => e.has(r) || Ft("Cannot " + t);
17
- var P = (r, e, t) => (lt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), Xe = (r, e, t) => e.has(r) ? Ft("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), ft = (r, e, t, s) => (lt(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t), Ye = (r, e, t) => (lt(r, e, "access private method"), t);
16
+ var ft = (r, e, t) => e.has(r) || Ft("Cannot " + t);
17
+ var M = (r, e, t) => (ft(r, e, "read from private field"), t ? t.call(r) : e.get(r)), Ye = (r, e, t) => e.has(r) ? Ft("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), ht = (r, e, t, s) => (ft(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t), Qe = (r, e, t) => (ft(r, e, "access private method"), t);
18
18
  var C = (r, e, t) => new Promise((s, n) => {
19
19
  var a = (c) => {
20
20
  try {
21
21
  o(t.next(c));
22
- } catch (u) {
23
- n(u);
22
+ } catch (d) {
23
+ n(d);
24
24
  }
25
25
  }, i = (c) => {
26
26
  try {
27
27
  o(t.throw(c));
28
- } catch (u) {
29
- n(u);
28
+ } catch (d) {
29
+ n(d);
30
30
  }
31
31
  }, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
32
32
  o((t = t.apply(r, e)).next());
33
33
  });
34
- class oe extends Error {
34
+ class de extends Error {
35
35
  constructor({
36
36
  name: e,
37
37
  reason: t,
@@ -42,7 +42,7 @@ class oe extends Error {
42
42
  }
43
43
  }
44
44
  const Xt = "Figma Token Issue";
45
- class Er extends Error {
45
+ class Ar extends Error {
46
46
  constructor({
47
47
  fileKey: e,
48
48
  reason: t,
@@ -52,13 +52,13 @@ class Er extends Error {
52
52
  }
53
53
  }
54
54
  const Yt = "Rate Limit Exceeded";
55
- class Cr extends Error {
55
+ class Or extends Error {
56
56
  constructor({ fileKey: e, cause: t }) {
57
57
  super(Yt), this.fileKey = e, this.cause = t;
58
58
  }
59
59
  }
60
60
  const Qt = "Request Too Large";
61
- class Or extends Error {
61
+ class Cr extends Error {
62
62
  constructor({ fileKey: e, cause: t }) {
63
63
  super(Qt), this.fileKey = e, this.cause = t;
64
64
  }
@@ -85,17 +85,17 @@ const Gn = (r) => r.message === tr, Rr = (r) => r.message === Yt, Zr = (r) => [X
85
85
  if (((s = r == null ? void 0 : r.cause) == null ? void 0 : s.message) === "Fetch Error") {
86
86
  const { err: n, status: a } = r.cause.body;
87
87
  if (a === 403)
88
- return new Er({
88
+ return new Ar({
89
89
  fileKey: e,
90
90
  reason: n,
91
91
  cause: r
92
92
  });
93
93
  if (a === 429)
94
- return new Cr({ fileKey: e, cause: r });
94
+ return new Or({ fileKey: e, cause: r });
95
95
  if (a === 404)
96
96
  return new Nr({ fileKey: e, cause: r });
97
97
  if (a === 400 && n.includes("Request too large"))
98
- return new Or({ fileKey: e, cause: r });
98
+ return new Cr({ fileKey: e, cause: r });
99
99
  }
100
100
  return new jr({ fileKey: e, cause: r });
101
101
  }, Kn = (r) => Ir(r) ? "NotFound" : Rr(r) ? "RateLimitExceeded" : Zr(r) ? "FigmaTokenIssue" : Mr(r) ? "RequestTooLarge" : "UnknownFigmaApiException";
@@ -108,74 +108,74 @@ var Pr = Object.defineProperty, $r = Object.defineProperties, Fr = Object.getOwn
108
108
  for (var t of Lt(e))
109
109
  Vr.call(e, t) && Dt(r, t, e[t]);
110
110
  return r;
111
- }, It = (r, e) => $r(r, Fr(e)), jt = (r, e, t) => e.has(r) || sr("Cannot " + t), T = (r, e, t) => (jt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), B = (r, e, t) => e.has(r) ? sr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), I = (r, e, t, s) => (jt(r, e, "write to private field"), e.set(r, t), t), X = (r, e, t) => (jt(r, e, "access private method"), t), E = (r, e, t) => new Promise((s, n) => {
111
+ }, jt = (r, e) => $r(r, Fr(e)), Rt = (r, e, t) => e.has(r) || sr("Cannot " + t), T = (r, e, t) => (Rt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), B = (r, e, t) => e.has(r) ? sr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), j = (r, e, t, s) => (Rt(r, e, "write to private field"), e.set(r, t), t), Q = (r, e, t) => (Rt(r, e, "access private method"), t), O = (r, e, t) => new Promise((s, n) => {
112
112
  var a = (c) => {
113
113
  try {
114
114
  o(t.next(c));
115
- } catch (u) {
116
- n(u);
115
+ } catch (d) {
116
+ n(d);
117
117
  }
118
118
  }, i = (c) => {
119
119
  try {
120
120
  o(t.throw(c));
121
- } catch (u) {
122
- n(u);
121
+ } catch (d) {
122
+ n(d);
123
123
  }
124
124
  }, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
125
125
  o((t = t.apply(r, e)).next());
126
- }), Dr = (r, e, t) => (e = r[Vt("asyncIterator")]) ? e.call(r) : (r = r[Vt("iterator")](), e = {}, t = (s, n) => (n = r[s]) && (e[s] = (a) => new Promise((i, o, c) => (a = n.call(r, a), c = a.done, Promise.resolve(a.value).then((u) => i({ value: u, done: c }), o)))), t("next"), t("return"), e), Ur = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
126
+ }), Dr = (r, e, t) => (e = r[Vt("asyncIterator")]) ? e.call(r) : (r = r[Vt("iterator")](), e = {}, t = (s, n) => (n = r[s]) && (e[s] = (a) => new Promise((i, o, c) => (a = n.call(r, a), c = a.done, Promise.resolve(a.value).then((d) => i({ value: d, done: c }), o)))), t("next"), t("return"), e), Ur = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
127
127
  function zr(r) {
128
128
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
129
129
  }
130
- var yt = { exports: {} }, Wr = yt.exports, Ut;
130
+ var vt = { exports: {} }, Wr = vt.exports, Ut;
131
131
  function Br() {
132
132
  return Ut || (Ut = 1, function(r, e) {
133
133
  (function(t, s) {
134
134
  r.exports = s();
135
135
  })(Wr, function() {
136
- var t = typeof Promise == "function", s = typeof self == "object" ? self : Ur, n = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", f = n && typeof Symbol.iterator != "undefined", v = n && typeof Symbol.toStringTag != "undefined", O = i && typeof Set.prototype.entries == "function", R = a && typeof Map.prototype.entries == "function", L = O && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), W = R && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), te = f && typeof Array.prototype[Symbol.iterator] == "function", he = te && Object.getPrototypeOf([][Symbol.iterator]()), ie = f && typeof String.prototype[Symbol.iterator] == "function", Z = ie && Object.getPrototypeOf(""[Symbol.iterator]()), M = 8, Oe = -1;
137
- function we(b) {
138
- var ut = typeof b;
139
- if (ut !== "object")
140
- return ut;
141
- if (b === null)
136
+ var t = typeof Promise == "function", s = typeof self == "object" ? self : Ur, n = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", d = typeof DataView != "undefined", f = n && typeof Symbol.iterator != "undefined", v = n && typeof Symbol.toStringTag != "undefined", N = i && typeof Set.prototype.entries == "function", Z = a && typeof Map.prototype.entries == "function", F = N && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), W = Z && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), se = f && typeof Array.prototype[Symbol.iterator] == "function", me = se && Object.getPrototypeOf([][Symbol.iterator]()), ce = f && typeof String.prototype[Symbol.iterator] == "function", V = ce && Object.getPrototypeOf(""[Symbol.iterator]()), K = 8, q = -1;
137
+ function Ne(A) {
138
+ var k = typeof A;
139
+ if (k !== "object")
140
+ return k;
141
+ if (A === null)
142
142
  return "null";
143
- if (b === s)
143
+ if (A === s)
144
144
  return "global";
145
- if (Array.isArray(b) && (v === !1 || !(Symbol.toStringTag in b)))
145
+ if (Array.isArray(A) && (v === !1 || !(Symbol.toStringTag in A)))
146
146
  return "Array";
147
147
  if (typeof window == "object" && window !== null) {
148
- if (typeof window.location == "object" && b === window.location)
148
+ if (typeof window.location == "object" && A === window.location)
149
149
  return "Location";
150
- if (typeof window.document == "object" && b === window.document)
150
+ if (typeof window.document == "object" && A === window.document)
151
151
  return "Document";
152
152
  if (typeof window.navigator == "object") {
153
- if (typeof window.navigator.mimeTypes == "object" && b === window.navigator.mimeTypes)
153
+ if (typeof window.navigator.mimeTypes == "object" && A === window.navigator.mimeTypes)
154
154
  return "MimeTypeArray";
155
- if (typeof window.navigator.plugins == "object" && b === window.navigator.plugins)
155
+ if (typeof window.navigator.plugins == "object" && A === window.navigator.plugins)
156
156
  return "PluginArray";
157
157
  }
158
- if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && b instanceof window.HTMLElement) {
159
- if (b.tagName === "BLOCKQUOTE")
158
+ if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && A instanceof window.HTMLElement) {
159
+ if (A.tagName === "BLOCKQUOTE")
160
160
  return "HTMLQuoteElement";
161
- if (b.tagName === "TD")
161
+ if (A.tagName === "TD")
162
162
  return "HTMLTableDataCellElement";
163
- if (b.tagName === "TH")
163
+ if (A.tagName === "TH")
164
164
  return "HTMLTableHeaderCellElement";
165
165
  }
166
166
  }
167
- var Mt = v && b[Symbol.toStringTag];
168
- if (typeof Mt == "string")
169
- return Mt;
170
- var D = Object.getPrototypeOf(b);
171
- return D === RegExp.prototype ? "RegExp" : D === Date.prototype ? "Date" : t && D === Promise.prototype ? "Promise" : i && D === Set.prototype ? "Set" : a && D === Map.prototype ? "Map" : c && D === WeakSet.prototype ? "WeakSet" : o && D === WeakMap.prototype ? "WeakMap" : u && D === DataView.prototype ? "DataView" : a && D === W ? "Map Iterator" : i && D === L ? "Set Iterator" : te && D === he ? "Array Iterator" : ie && D === Z ? "String Iterator" : D === null ? "Object" : Object.prototype.toString.call(b).slice(M, Oe);
167
+ var lt = v && A[Symbol.toStringTag];
168
+ if (typeof lt == "string")
169
+ return lt;
170
+ var D = Object.getPrototypeOf(A);
171
+ return D === RegExp.prototype ? "RegExp" : D === Date.prototype ? "Date" : t && D === Promise.prototype ? "Promise" : i && D === Set.prototype ? "Set" : a && D === Map.prototype ? "Map" : c && D === WeakSet.prototype ? "WeakSet" : o && D === WeakMap.prototype ? "WeakMap" : d && D === DataView.prototype ? "DataView" : a && D === W ? "Map Iterator" : i && D === F ? "Set Iterator" : se && D === me ? "Array Iterator" : ce && D === V ? "String Iterator" : D === null ? "Object" : Object.prototype.toString.call(A).slice(K, q);
172
172
  }
173
- return we;
173
+ return Ne;
174
174
  });
175
- }(yt)), yt.exports;
175
+ }(vt)), vt.exports;
176
176
  }
177
177
  var qr = Br();
178
- const Hr = /* @__PURE__ */ zr(qr), Rt = typeof Buffer != "undefined", Jr = Rt && typeof Buffer.from != "undefined", Gr = Rt ? (
178
+ const Hr = /* @__PURE__ */ zr(qr), Zt = typeof Buffer != "undefined", Jr = Zt && typeof Buffer.from != "undefined", Gr = Zt ? (
179
179
  /**
180
180
  * is value is Buffer?
181
181
  *
@@ -206,7 +206,7 @@ const Hr = /* @__PURE__ */ zr(qr), Rt = typeof Buffer != "undefined", Jr = Rt &&
206
206
  function(r) {
207
207
  return Buffer.from(r);
208
208
  }
209
- ) : Rt ? (
209
+ ) : Zt ? (
210
210
  /**
211
211
  * copy Buffer
212
212
  *
@@ -231,7 +231,7 @@ const Hr = /* @__PURE__ */ zr(qr), Rt = typeof Buffer != "undefined", Jr = Rt &&
231
231
  return r;
232
232
  }
233
233
  );
234
- function Se(r) {
234
+ function Ee(r) {
235
235
  return Gr(r) ? "Buffer" : Hr(r);
236
236
  }
237
237
  const Xr = /* @__PURE__ */ new Set([
@@ -242,7 +242,7 @@ const Xr = /* @__PURE__ */ new Set([
242
242
  "Set"
243
243
  ]);
244
244
  function Yr(r, e, t = null) {
245
- switch (t || Se(r)) {
245
+ switch (t || Ee(r)) {
246
246
  case "Arguments":
247
247
  case "Array":
248
248
  case "Object":
@@ -253,11 +253,11 @@ function Yr(r, e, t = null) {
253
253
  return e;
254
254
  }
255
255
  }
256
- function vt(r) {
256
+ function _t(r) {
257
257
  return Xr.has(r);
258
258
  }
259
259
  function zt(r, e, t, s = null) {
260
- switch (s || Se(r)) {
260
+ switch (s || Ee(r)) {
261
261
  case "Arguments":
262
262
  case "Array":
263
263
  case "Object":
@@ -272,7 +272,7 @@ function zt(r, e, t, s = null) {
272
272
  }
273
273
  return r;
274
274
  }
275
- const Qr = typeof globalThis != "undefined" && globalThis !== null && globalThis.Object === Object && globalThis, es = typeof global != "undefined" && global !== null && global.Object === Object && global, ts = typeof self != "undefined" && self !== null && self.Object === Object && self, ht = Qr || es || ts || Function("return this")();
275
+ const Qr = typeof globalThis != "undefined" && globalThis !== null && globalThis.Object === Object && globalThis, es = typeof global != "undefined" && global !== null && global.Object === Object && global, ts = typeof self != "undefined" && self !== null && self.Object === Object && self, pt = Qr || es || ts || Function("return this")();
276
276
  function rs(r) {
277
277
  return r.slice(0);
278
278
  }
@@ -297,10 +297,10 @@ function cs(r) {
297
297
  function ds(r) {
298
298
  return new String(r);
299
299
  }
300
- function re(r, e) {
301
- return ht[e].from ? ht[e].from(r) : new ht[e](r);
300
+ function ne(r, e) {
301
+ return pt[e].from ? pt[e].from(r) : new pt[e](r);
302
302
  }
303
- function $(r) {
303
+ function P(r) {
304
304
  return r;
305
305
  }
306
306
  function Wt() {
@@ -327,33 +327,33 @@ const hs = /* @__PURE__ */ new Map([
327
327
  ["String", ds],
328
328
  // typed arrays
329
329
  // TODO: pass bound function
330
- ["Float32Array", re],
331
- ["Float64Array", re],
332
- ["Int16Array", re],
333
- ["Int32Array", re],
334
- ["Int8Array", re],
335
- ["Uint16Array", re],
336
- ["Uint32Array", re],
337
- ["Uint8Array", re],
338
- ["Uint8ClampedArray", re],
330
+ ["Float32Array", ne],
331
+ ["Float64Array", ne],
332
+ ["Int16Array", ne],
333
+ ["Int32Array", ne],
334
+ ["Int8Array", ne],
335
+ ["Uint16Array", ne],
336
+ ["Uint32Array", ne],
337
+ ["Uint8Array", ne],
338
+ ["Uint8ClampedArray", ne],
339
339
  // shallow copy
340
- ["Array Iterator", $],
341
- ["Map Iterator", $],
342
- ["Promise", $],
343
- ["Set Iterator", $],
344
- ["String Iterator", $],
345
- ["function", $],
346
- ["global", $],
340
+ ["Array Iterator", P],
341
+ ["Map Iterator", P],
342
+ ["Promise", P],
343
+ ["Set Iterator", P],
344
+ ["String Iterator", P],
345
+ ["function", P],
346
+ ["global", P],
347
347
  // NOTE: WeakMap and WeakSet cannot get entries
348
- ["WeakMap", $],
349
- ["WeakSet", $],
348
+ ["WeakMap", P],
349
+ ["WeakSet", P],
350
350
  // primitives
351
- ["boolean", $],
352
- ["null", $],
353
- ["number", $],
354
- ["string", $],
355
- ["symbol", $],
356
- ["undefined", $],
351
+ ["boolean", P],
352
+ ["null", P],
353
+ ["number", P],
354
+ ["string", P],
355
+ ["symbol", P],
356
+ ["undefined", P],
357
357
  // collections
358
358
  // NOTE: return empty value, because recursively copy later.
359
359
  ["Arguments", Wt],
@@ -374,9 +374,9 @@ const hs = /* @__PURE__ */ new Map([
374
374
  ]);
375
375
  function ps() {
376
376
  }
377
- function _t(r, e = null, t = ps) {
377
+ function bt(r, e = null, t = ps) {
378
378
  arguments.length === 2 && typeof e == "function" && (t = e, e = null);
379
- const s = e || Se(r), n = hs.get(s);
379
+ const s = e || Ee(r), n = hs.get(s);
380
380
  if (s === "Object") {
381
381
  const a = t(r, s);
382
382
  if (a !== void 0)
@@ -384,7 +384,7 @@ function _t(r, e = null, t = ps) {
384
384
  }
385
385
  return n ? n(r, s) : r;
386
386
  }
387
- function Ne(r, e = {}) {
387
+ function Ie(r, e = {}) {
388
388
  typeof e == "function" && (e = {
389
389
  customizer: e
390
390
  });
@@ -393,15 +393,15 @@ function Ne(r, e = {}) {
393
393
  customizer: t
394
394
  // TODO: max depth
395
395
  // depth = Infinity,
396
- } = e, s = Se(r);
397
- if (!vt(s))
398
- return bt(r, null, null, null);
399
- const n = _t(r, s, t), a = new WeakMap([[r, n]]), i = new WeakSet([r]);
400
- return bt(r, n, a, i);
396
+ } = e, s = Ee(r);
397
+ if (!_t(s))
398
+ return wt(r, null, null, null);
399
+ const n = bt(r, s, t), a = new WeakMap([[r, n]]), i = new WeakSet([r]);
400
+ return wt(r, n, a, i);
401
401
  }
402
- function bt(r, e, t, s, n) {
403
- const a = Se(r), i = _t(r, a);
404
- if (!vt(a))
402
+ function wt(r, e, t, s, n) {
403
+ const a = Ee(r), i = bt(r, a);
404
+ if (!_t(a))
405
405
  return i;
406
406
  let o;
407
407
  switch (a) {
@@ -418,16 +418,16 @@ function bt(r, e, t, s, n) {
418
418
  break;
419
419
  }
420
420
  for (let c of o) {
421
- const u = Yr(r, c, a);
422
- if (s.has(u))
423
- zt(e, c, t.get(u), a);
421
+ const d = Yr(r, c, a);
422
+ if (s.has(d))
423
+ zt(e, c, t.get(d), a);
424
424
  else {
425
- const f = Se(u), v = _t(u, f);
426
- vt(f) && (t.set(u, v), s.add(u)), zt(
425
+ const f = Ee(d), v = bt(d, f);
426
+ _t(f) && (t.set(d, v), s.add(d)), zt(
427
427
  e,
428
428
  c,
429
- bt(
430
- u,
429
+ wt(
430
+ d,
431
431
  v,
432
432
  t,
433
433
  s
@@ -439,32 +439,32 @@ function bt(r, e, t, s, n) {
439
439
  return e;
440
440
  }
441
441
  const ms = (r) => new Promise((e) => setTimeout(e, r));
442
- var Qe, pe, et, wt, nr;
442
+ var et, ge, tt, xt, nr;
443
443
  class gs {
444
444
  constructor({ maxAttempts: e = 3, func: t }) {
445
- B(this, wt), B(this, Qe), B(this, pe), B(this, et), I(this, Qe, e), I(this, et, t), I(this, pe, 0);
445
+ B(this, xt), B(this, et), B(this, ge), B(this, tt), j(this, et, e), j(this, tt, t), j(this, ge, 0);
446
446
  }
447
447
  run() {
448
- return E(this, null, function* () {
448
+ return O(this, null, function* () {
449
449
  try {
450
- return yield T(this, et).call(this);
450
+ return yield T(this, tt).call(this);
451
451
  } catch (e) {
452
- if (I(this, pe, T(this, pe) + 1), T(this, pe) > T(this, Qe))
452
+ if (j(this, ge, T(this, ge) + 1), T(this, ge) > T(this, et))
453
453
  throw console.error("Max attempts reached"), e;
454
- const t = X(this, wt, nr).call(this);
454
+ const t = Q(this, xt, nr).call(this);
455
455
  return yield ms(t), yield this.run();
456
456
  }
457
457
  });
458
458
  }
459
459
  }
460
- Qe = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakSet(), nr = function() {
461
- return T(this, pe) * 1e3 * 1.5;
460
+ et = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakSet(), nr = function() {
461
+ return T(this, ge) * 1e3 * 1.5;
462
462
  };
463
463
  function ys() {
464
464
  return typeof CompressionStream != "undefined";
465
465
  }
466
466
  function vs(r) {
467
- return E(this, null, function* () {
467
+ return O(this, null, function* () {
468
468
  const e = new Blob([r]).stream().pipeThrough(new CompressionStream("gzip")), t = [];
469
469
  try {
470
470
  for (var s = Dr(e), n, a, i; n = !(a = yield s.next()).done; n = !1) {
@@ -485,7 +485,7 @@ function vs(r) {
485
485
  });
486
486
  }
487
487
  function _s(r) {
488
- return E(this, null, function* () {
488
+ return O(this, null, function* () {
489
489
  const e = yield new Blob(r).arrayBuffer();
490
490
  return new Uint8Array(e);
491
491
  });
@@ -496,8 +496,8 @@ class bs extends Error {
496
496
  for (const [i, o] of Object.entries(n))
497
497
  if (typeof Headers != "undefined" && o instanceof Headers) {
498
498
  const c = {};
499
- o.forEach((u, f) => {
500
- c[f] = u;
499
+ o.forEach((d, f) => {
500
+ c[f] = d;
501
501
  }), this.causeProperties[i] = c;
502
502
  } else
503
503
  this.causeProperties[i] = o;
@@ -523,7 +523,7 @@ class Bt extends Error {
523
523
  }
524
524
  }
525
525
  }
526
- class Ie extends Error {
526
+ class je extends Error {
527
527
  constructor(e = {}) {
528
528
  const { canceled: t = !1 } = e;
529
529
  super("Abort Error"), this.name = "Abort Error", this.canceled = t;
@@ -534,7 +534,7 @@ class ws extends Error {
534
534
  super(`Async API Error: ${JSON.stringify(e)}`), this.name = "Async API Error", this.body = e;
535
535
  }
536
536
  }
537
- class pt extends Error {
537
+ class mt extends Error {
538
538
  constructor(e) {
539
539
  super(e), this.name = "Request Validation Error";
540
540
  }
@@ -545,14 +545,14 @@ function ar() {
545
545
  () => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
546
546
  ).join("");
547
547
  }
548
- function xt() {
548
+ function kt() {
549
549
  return Math.floor(Date.now() / 1e3).toString();
550
550
  }
551
551
  const xs = 5 * 60 * 1e3, ks = 1 * 1e3;
552
- var me, V, G, kt, Tt, je;
552
+ var ye, L, X, Tt, St, Re;
553
553
  class Ts {
554
554
  constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: t }) {
555
- B(this, G), B(this, me), B(this, V), this.baseAddress = t, I(this, me, e), I(this, V, {}), this.plugins = [];
555
+ B(this, X), B(this, ye), B(this, L), this.baseAddress = t, j(this, ye, e), j(this, L, {}), this.plugins = [];
556
556
  }
557
557
  get headers() {
558
558
  throw new Error("Missing implementation");
@@ -564,60 +564,60 @@ class Ts {
564
564
  this.plugins = this.plugins.filter((t) => t.name !== e);
565
565
  }
566
566
  withOptions(e = {}) {
567
- return I(this, V, e), this;
567
+ return j(this, L, e), this;
568
568
  }
569
569
  get(e) {
570
- return E(this, arguments, function* (t, s = {}) {
570
+ return O(this, arguments, function* (t, s = {}) {
571
571
  const { overrideBaseAddress: n, overrideDefaultHeaders: a } = s, i = n != null ? n : this.baseAddress;
572
572
  let o = a != null ? a : this.headers;
573
- const c = Ne(T(this, V));
574
- return I(this, V, {}), c.extraHeaders && (o = U(U({}, o), c.extraHeaders)), c.requestValidation && (o = It(U({}, o), { "X-Request-Nonce": ar(), "X-Request-Timestamp": xt() })), c.async ? yield X(this, G, Tt).call(this, `${i}${t}`, c.async, { headers: o }) : yield X(this, G, kt).call(this, `${i}${t}`, c, { headers: o });
573
+ const c = Ie(T(this, L));
574
+ return j(this, L, {}), c.extraHeaders && (o = U(U({}, o), c.extraHeaders)), c.requestValidation && (o = jt(U({}, o), { "X-Request-Nonce": ar(), "X-Request-Timestamp": kt() })), c.async ? yield Q(this, X, St).call(this, `${i}${t}`, c.async, { headers: o }) : yield Q(this, X, Tt).call(this, `${i}${t}`, c, { headers: o });
575
575
  });
576
576
  }
577
577
  post(e, t) {
578
- return E(this, arguments, function* (s, n, a = {}) {
579
- const i = Ne(T(this, V));
580
- return I(this, V, {}), X(this, G, je).call(this, s, "POST", n, a, i);
578
+ return O(this, arguments, function* (s, n, a = {}) {
579
+ const i = Ie(T(this, L));
580
+ return j(this, L, {}), Q(this, X, Re).call(this, s, "POST", n, a, i);
581
581
  });
582
582
  }
583
583
  put(e, t) {
584
- return E(this, arguments, function* (s, n, a = {}) {
585
- const i = Ne(T(this, V));
586
- return I(this, V, {}), X(this, G, je).call(this, s, "PUT", n, a, i);
584
+ return O(this, arguments, function* (s, n, a = {}) {
585
+ const i = Ie(T(this, L));
586
+ return j(this, L, {}), Q(this, X, Re).call(this, s, "PUT", n, a, i);
587
587
  });
588
588
  }
589
589
  delete(e, t) {
590
- return E(this, arguments, function* (s, n, a = {}) {
591
- const i = Ne(T(this, V));
592
- return I(this, V, {}), X(this, G, je).call(this, s, "DELETE", n, a, i);
590
+ return O(this, arguments, function* (s, n, a = {}) {
591
+ const i = Ie(T(this, L));
592
+ return j(this, L, {}), Q(this, X, Re).call(this, s, "DELETE", n, a, i);
593
593
  });
594
594
  }
595
595
  patch(e, t) {
596
- return E(this, arguments, function* (s, n, a = {}) {
597
- const i = Ne(T(this, V));
598
- return I(this, V, {}), X(this, G, je).call(this, s, "PATCH", n, a, i);
596
+ return O(this, arguments, function* (s, n, a = {}) {
597
+ const i = Ie(T(this, L));
598
+ return j(this, L, {}), Q(this, X, Re).call(this, s, "PATCH", n, a, i);
599
599
  });
600
600
  }
601
601
  }
602
- me = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakSet(), kt = function(r, e, t) {
603
- return E(this, null, function* () {
604
- const s = () => E(this, null, function* () {
605
- var c, u;
602
+ ye = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakSet(), Tt = function(r, e, t) {
603
+ return O(this, null, function* () {
604
+ const s = () => O(this, null, function* () {
605
+ var c, d;
606
606
  try {
607
- return yield T(this, me).call(this, r, U(U({}, t), e.abortSignal && { signal: e.abortSignal }));
607
+ return yield T(this, ye).call(this, r, U(U({}, t), e.abortSignal && { signal: e.abortSignal }));
608
608
  } catch (f) {
609
- throw f instanceof Error && f.name === "AbortError" ? new Ie({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : f;
609
+ throw f instanceof Error && f.name === "AbortError" ? new je({ canceled: (d = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? d : !1 }) : f;
610
610
  }
611
- }), { headers: n } = t != null ? t : {}, a = (c, u) => {
611
+ }), { headers: n } = t != null ? t : {}, a = (c, d) => {
612
612
  var f, v;
613
- return ((f = c == null ? void 0 : c.headers) == null ? void 0 : f.get(u)) || ((v = c == null ? void 0 : c.headersObject) == null ? void 0 : v[u]) || "";
614
- }, i = (c) => E(this, null, function* () {
615
- var u;
613
+ return ((f = c == null ? void 0 : c.headers) == null ? void 0 : f.get(d)) || ((v = c == null ? void 0 : c.headersObject) == null ? void 0 : v[d]) || "";
614
+ }, i = (c) => O(this, null, function* () {
615
+ var d;
616
616
  if (!c.ok) {
617
617
  const v = yield c.text().catch();
618
618
  throw new Bt({
619
619
  url: r,
620
- method: (u = t == null ? void 0 : t.method) != null ? u : "GET",
620
+ method: (d = t == null ? void 0 : t.method) != null ? d : "GET",
621
621
  statusCode: c.status,
622
622
  requestHeaders: n,
623
623
  responseHeaders: c.headers,
@@ -626,15 +626,15 @@ me = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), G = /* @_
626
626
  }
627
627
  if (e.requestValidation && process.env.UI_TESTS !== !0)
628
628
  try {
629
- const v = a(c, "x-response-nonce"), O = n == null ? void 0 : n["X-Request-Nonce"];
630
- if (!v || v !== O)
631
- throw new pt("Response nonce mismatch");
632
- const R = Number(a(c, "x-response-timestamp")), L = Number(xt()), W = 60 * 60 * 24;
633
- if (isNaN(R) || Math.abs(L - R) > W)
634
- throw new pt("Invalid response timestamp");
629
+ const v = a(c, "x-response-nonce"), N = n == null ? void 0 : n["X-Request-Nonce"];
630
+ if (!v || v !== N)
631
+ throw new mt("Response nonce mismatch");
632
+ const Z = Number(a(c, "x-response-timestamp")), F = Number(kt()), W = 60 * 60 * 24;
633
+ if (isNaN(Z) || Math.abs(F - Z) > W)
634
+ throw new mt("Invalid response timestamp");
635
635
  } catch (v) {
636
- const O = v instanceof Error ? v.message : "Request validation failed";
637
- throw new pt(O);
636
+ const N = v instanceof Error ? v.message : "Request validation failed";
637
+ throw new mt(N);
638
638
  }
639
639
  let f = yield c.text();
640
640
  try {
@@ -653,81 +653,81 @@ me = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), G = /* @_
653
653
  const o = yield s();
654
654
  return yield i(o);
655
655
  });
656
- }, Tt = function(r, e, t) {
657
- return E(this, null, function* () {
656
+ }, St = function(r, e, t) {
657
+ return O(this, null, function* () {
658
658
  var s, n;
659
659
  const {
660
660
  onProgress: a,
661
661
  abortSignal: i,
662
662
  pollingInterval: o = () => ks,
663
663
  maxTimeout: c = xs
664
- } = e, u = `${r}/async`, f = `${r}/async/job`;
664
+ } = e, d = `${r}/async`, f = `${r}/async/job`;
665
665
  let v;
666
666
  try {
667
- v = yield T(this, me).call(this, u, U(U({}, t), i && { signal: i }));
668
- } catch (L) {
669
- throw L instanceof Error && L.name === "AbortError" ? new Ie({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : L;
667
+ v = yield T(this, ye).call(this, d, U(U({}, t), i && { signal: i }));
668
+ } catch (F) {
669
+ throw F instanceof Error && F.name === "AbortError" ? new je({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : F;
670
670
  }
671
671
  if (!v.ok) {
672
- const L = yield v.text().catch();
672
+ const F = yield v.text().catch();
673
673
  throw new Bt({
674
674
  url: r,
675
675
  method: (n = t == null ? void 0 : t.method) != null ? n : "GET",
676
676
  statusCode: v.status,
677
677
  requestHeaders: this.headers,
678
678
  responseHeaders: v.headers,
679
- body: L
679
+ body: F
680
680
  });
681
681
  }
682
- const O = yield v.json(), { job_id: R } = O;
683
- if (!R)
682
+ const N = yield v.json(), { job_id: Z } = N;
683
+ if (!Z)
684
684
  throw new Error("Job ID not found in response");
685
- return new Promise((L, W) => E(this, null, function* () {
686
- const te = setTimeout(() => {
685
+ return new Promise((F, W) => O(this, null, function* () {
686
+ const se = setTimeout(() => {
687
687
  W(new Error("Job timed out"));
688
- }, c), he = (ie = 0) => E(this, null, function* () {
688
+ }, c), me = (ce = 0) => O(this, null, function* () {
689
689
  if (i != null && i.aborted) {
690
- clearTimeout(te), T(this, me).call(this, `${f}/${R}/cancel`, { method: "POST", headers: this.headers }).then(() => {
691
- W(new Ie({ canceled: !0 }));
692
- }).catch((Z) => {
693
- W(new Ie({ canceled: !1 }));
690
+ clearTimeout(se), T(this, ye).call(this, `${f}/${Z}/cancel`, { method: "POST", headers: this.headers }).then(() => {
691
+ W(new je({ canceled: !0 }));
692
+ }).catch((V) => {
693
+ W(new je({ canceled: !1 }));
694
694
  });
695
695
  return;
696
696
  }
697
697
  try {
698
- const Z = yield (yield T(this, me).call(this, `${f}/${R}`, { headers: this.headers })).json();
699
- if (Z.status === "success") {
700
- clearTimeout(te);
701
- const M = Z.response_json;
702
- L(M);
703
- } else if (Z.status === "failed")
704
- clearTimeout(te), W(new ws(Z.response_json));
698
+ const V = yield (yield T(this, ye).call(this, `${f}/${Z}`, { headers: this.headers })).json();
699
+ if (V.status === "success") {
700
+ clearTimeout(se);
701
+ const K = V.response_json;
702
+ F(K);
703
+ } else if (V.status === "failed")
704
+ clearTimeout(se), W(new ws(V.response_json));
705
705
  else {
706
- a && a(Z.response_json);
707
- const M = o(ie);
708
- setTimeout(() => he(ie + 1), M);
706
+ a && a(V.response_json);
707
+ const K = o(ce);
708
+ setTimeout(() => me(ce + 1), K);
709
709
  }
710
- } catch (Z) {
711
- W(Z);
710
+ } catch (V) {
711
+ W(V);
712
712
  }
713
713
  });
714
- he();
714
+ me();
715
715
  }));
716
716
  });
717
- }, je = function(r, e, t, s, n) {
718
- return E(this, null, function* () {
717
+ }, Re = function(r, e, t, s, n) {
718
+ return O(this, null, function* () {
719
719
  const { overrideBaseAddress: a, overrideDefaultHeaders: i } = s, o = a != null ? a : this.baseAddress;
720
720
  let c = i != null ? i : this.headers;
721
- n.extraHeaders && (c = U(U({}, c), n.extraHeaders)), n.requestValidation && (c = It(U({}, c), { "X-Request-Nonce": ar(), "X-Request-Timestamp": xt() }));
722
- let u = t;
723
- return typeof FormData != "undefined" && t instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? t : JSON.stringify(t), n.compress && ys() && (c["Content-Encoding"] = "gzip", u = yield vs(u))), n.async ? yield X(this, G, Tt).call(this, `${o}${r}`, n.async, {
721
+ n.extraHeaders && (c = U(U({}, c), n.extraHeaders)), n.requestValidation && (c = jt(U({}, c), { "X-Request-Nonce": ar(), "X-Request-Timestamp": kt() }));
722
+ let d = t;
723
+ return typeof FormData != "undefined" && t instanceof FormData ? delete c["Content-Type"] : (d = s.skipBodyJsonStringify ? t : JSON.stringify(t), n.compress && ys() && (c["Content-Encoding"] = "gzip", d = yield vs(d))), n.async ? yield Q(this, X, St).call(this, `${o}${r}`, n.async, {
724
724
  method: e,
725
725
  headers: c,
726
- body: u
727
- }) : yield X(this, G, kt).call(this, `${o}${r}`, n, { method: e, headers: c, body: u });
726
+ body: d
727
+ }) : yield Q(this, X, Tt).call(this, `${o}${r}`, n, { method: e, headers: c, body: d });
728
728
  });
729
729
  };
730
- const qt = (r, e, t, s) => r instanceof Ie ? r : new bs({ resource: e, api: String(t), args: s, cause: r }), mt = (r, e) => new Proxy(e, {
730
+ const qt = (r, e, t, s) => r instanceof je ? r : new bs({ resource: e, api: String(t), args: s, cause: r }), gt = (r, e) => new Proxy(e, {
731
731
  get(t, s) {
732
732
  return (...n) => {
733
733
  var a;
@@ -748,148 +748,154 @@ const qt = (r, e, t, s) => r instanceof Ie ? r : new bs({ resource: e, api: Stri
748
748
  };
749
749
  }
750
750
  });
751
- var Re;
751
+ var Ze;
752
752
  class Ss {
753
753
  constructor(e) {
754
- B(this, Re), this.resourceName = "Files", I(this, Re, e);
754
+ B(this, Ze), this.resourceName = "Files", j(this, Ze, e);
755
755
  }
756
756
  get(e) {
757
- return E(this, arguments, function* ({ fileKey: t, params: s = {} }) {
757
+ return O(this, arguments, function* ({ fileKey: t, params: s = {} }) {
758
758
  const n = new URLSearchParams(U({
759
759
  plugin_data: "857346721138427857"
760
760
  }, s)).toString(), a = `v1/files/${t}?${n}`;
761
- return yield T(this, Re).get(a);
761
+ return yield T(this, Ze).get(a);
762
762
  });
763
763
  }
764
764
  getImageFills(e) {
765
- return E(this, arguments, function* ({ fileKey: t }) {
765
+ return O(this, arguments, function* ({ fileKey: t }) {
766
766
  var s, n;
767
767
  const a = `v1/files/${t}/images`;
768
- return (n = (s = (yield T(this, Re).get(a)).meta) == null ? void 0 : s.images) != null ? n : {};
768
+ return (n = (s = (yield T(this, Ze).get(a)).meta) == null ? void 0 : s.images) != null ? n : {};
769
769
  });
770
770
  }
771
771
  }
772
- Re = /* @__PURE__ */ new WeakMap();
773
- const As = (r, e, t) => {
772
+ Ze = /* @__PURE__ */ new WeakMap();
773
+ const Es = (r, e, t) => {
774
774
  const s = e.sort();
775
775
  return `${r}-${s.join("-")}-${t}`;
776
- }, Es = (r) => r ? r.ts > Date.now() - 1e3 * 30 : !1;
777
- var K, St, ir;
778
- class Cs {
776
+ }, As = (r) => r ? r.ts > Date.now() - 1e3 * 30 : !1;
777
+ var Y, Et, ir;
778
+ class Os {
779
779
  constructor(e) {
780
- B(this, St), B(this, K), this.resourceName = "Images", I(this, K, e);
780
+ B(this, Et), B(this, Y), this.resourceName = "Images", j(this, Y, e);
781
781
  }
782
782
  /**
783
783
  * Return the URL for the _layer_ images for the given nodes.
784
784
  * Note: Use the `file.images` API to get the _source_ images used on the node fills, which has better quality.
785
785
  */
786
786
  get(e) {
787
- return E(this, arguments, function* ({ fileKey: t, nodeIds: s, format: n = "jpg", scale: a }) {
788
- const i = As(t, s, n), o = T(this, K).cache.images.entries.get(i);
789
- if (Es(o))
787
+ return O(this, arguments, function* ({ fileKey: t, nodeIds: s, format: n = "jpg", scale: a }) {
788
+ const i = Es(t, s, n), o = T(this, Y).cache.images.entries.get(i);
789
+ if (As(o))
790
790
  return o.result;
791
- o && T(this, K).cache.images.entries.delete(i);
792
- const c = T(this, K).cache.images.pendingRequests.get(i);
791
+ o && T(this, Y).cache.images.entries.delete(i);
792
+ const c = T(this, Y).cache.images.pendingRequests.get(i);
793
793
  if (c)
794
794
  return c;
795
- const u = X(this, St, ir).call(this, i, t, s, n, a);
796
- T(this, K).cache.images.pendingRequests.set(i, u);
795
+ const d = Q(this, Et, ir).call(this, i, t, s, n, a);
796
+ T(this, Y).cache.images.pendingRequests.set(i, d);
797
797
  try {
798
- return yield u;
798
+ return yield d;
799
799
  } finally {
800
- T(this, K).cache.images.pendingRequests.delete(i);
800
+ T(this, Y).cache.images.pendingRequests.delete(i);
801
801
  }
802
802
  });
803
803
  }
804
804
  }
805
- K = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), ir = function(r, e, t, s, n) {
806
- return E(this, null, function* () {
807
- const a = yield T(this, K).get(
805
+ Y = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakSet(), ir = function(r, e, t, s, n) {
806
+ return O(this, null, function* () {
807
+ const a = yield T(this, Y).get(
808
808
  `v1/images/${e}?ids=${t}&format=${s}${n ? `&scale=${n}` : ""}`
809
809
  );
810
- return T(this, K).cache.images.entries.set(r, {
810
+ return T(this, Y).cache.images.entries.set(r, {
811
811
  result: a,
812
812
  ts: Date.now()
813
813
  }), a;
814
814
  });
815
815
  };
816
- var tt;
817
- class Os {
816
+ var rt;
817
+ class Cs {
818
818
  constructor(e) {
819
- B(this, tt), this.resourceName = "Nodes", I(this, tt, e);
819
+ B(this, rt), this.resourceName = "Nodes", j(this, rt, e);
820
820
  }
821
821
  get(e) {
822
- return E(this, arguments, function* ({ fileKey: t, nodeIds: s, params: n = {} }) {
823
- const a = It(U({}, n), {
822
+ return O(this, arguments, function* ({ fileKey: t, nodeIds: s, params: n = {} }) {
823
+ const a = jt(U({}, n), {
824
824
  ids: s.join(",")
825
825
  }), i = new URLSearchParams(U({
826
826
  plugin_data: "857346721138427857"
827
827
  }, a)).toString(), o = `v1/files/${t}/nodes?${i}`;
828
- return yield T(this, tt).get(o);
828
+ return yield T(this, rt).get(o);
829
829
  });
830
830
  }
831
831
  }
832
- tt = /* @__PURE__ */ new WeakMap();
833
- var ce;
832
+ rt = /* @__PURE__ */ new WeakMap();
833
+ var ue;
834
834
  class or extends Ts {
835
835
  constructor({
836
836
  baseAddress: e = "https://api.figma.com/",
837
837
  fetch: t = globalThis.fetch.bind(globalThis)
838
838
  } = {}) {
839
- super({ fetch: t, baseAddress: e }), B(this, ce, ""), this.cache = {
839
+ super({ fetch: t, baseAddress: e }), B(this, ue, ""), this.cache = {
840
840
  images: {
841
841
  entries: /* @__PURE__ */ new Map(),
842
842
  pendingRequests: /* @__PURE__ */ new Map()
843
843
  }
844
- }, this.files = mt(this, new Ss(this)), this.nodes = mt(this, new Os(this)), this.images = mt(this, new Cs(this));
844
+ }, this.files = gt(this, new Ss(this)), this.nodes = gt(this, new Cs(this)), this.images = gt(this, new Os(this));
845
845
  }
846
846
  set token(e) {
847
847
  if (!e.startsWith("figd_") && !e.startsWith("figu_"))
848
848
  throw new Error("Invalid Figma access token");
849
- I(this, ce, e);
849
+ j(this, ue, e);
850
850
  }
851
851
  get token() {
852
- return T(this, ce);
852
+ return T(this, ue);
853
853
  }
854
854
  get headers() {
855
855
  const e = {
856
856
  "Content-Type": "application/json"
857
857
  };
858
- return T(this, ce).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = T(this, ce) : T(this, ce).startsWith("figu_") && (e.Authorization = `Bearer ${T(this, ce)}`), e;
858
+ return T(this, ue).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = T(this, ue) : T(this, ue).startsWith("figu_") && (e.Authorization = `Bearer ${T(this, ue)}`), e;
859
859
  }
860
860
  }
861
- ce = /* @__PURE__ */ new WeakMap();
862
- const Ns = (n) => C(void 0, [n], function* ({
861
+ ue = /* @__PURE__ */ new WeakMap();
862
+ const Ns = (a) => C(void 0, [a], function* ({
863
863
  fileKey: r,
864
864
  authToken: e,
865
865
  figmaRestApi: t = new or(),
866
- params: s = {}
866
+ params: s = {},
867
+ signal: n
867
868
  }) {
868
869
  e && (t.token = e);
869
870
  try {
870
- return yield t.files.get({
871
+ return yield t.withOptions({
872
+ abortSignal: n
873
+ }).files.get({
871
874
  fileKey: r,
872
875
  params: s
873
876
  });
874
- } catch (a) {
875
- throw console.error(a), rr(a, r);
877
+ } catch (i) {
878
+ throw i instanceof Error && i.name === "AbortError" ? i : (console.error(i), rr(i, r));
876
879
  }
877
- }), Xn = (a) => C(void 0, [a], function* ({
880
+ }), Xn = (i) => C(void 0, [i], function* ({
878
881
  fileKey: r,
879
882
  authToken: e,
880
883
  nodeIds: t,
881
884
  figmaRestApi: s = new or(),
882
- params: n = {}
885
+ params: n = {},
886
+ signal: a
883
887
  }) {
884
888
  e && (s.token = e);
885
889
  try {
886
- return (yield s.nodes.get({
890
+ return (yield s.withOptions({
891
+ abortSignal: a
892
+ }).nodes.get({
887
893
  fileKey: r,
888
894
  nodeIds: t,
889
- params: d({}, n)
895
+ params: u({}, n)
890
896
  })).nodes;
891
- } catch (i) {
892
- throw rr(i, r);
897
+ } catch (o) {
898
+ throw o instanceof Error && o.name === "AbortError" ? o : rr(o, r);
893
899
  }
894
900
  }), cr = (r, e) => {
895
901
  if (r.id === e)
@@ -902,7 +908,7 @@ const Ns = (n) => C(void 0, [n], function* ({
902
908
  }
903
909
  return null;
904
910
  };
905
- var k;
911
+ var x;
906
912
  (function(r) {
907
913
  r.assertEqual = (n) => n;
908
914
  function e(n) {
@@ -937,12 +943,12 @@ var k;
937
943
  return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
938
944
  }
939
945
  r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
940
- })(k || (k = {}));
946
+ })(x || (x = {}));
941
947
  var At;
942
948
  (function(r) {
943
- r.mergeShapes = (e, t) => d(d({}, e), t);
949
+ r.mergeShapes = (e, t) => u(u({}, e), t);
944
950
  })(At || (At = {}));
945
- const p = k.arrayToEnum([
951
+ const p = x.arrayToEnum([
946
952
  "string",
947
953
  "nan",
948
954
  "number",
@@ -963,7 +969,7 @@ const p = k.arrayToEnum([
963
969
  "never",
964
970
  "map",
965
971
  "set"
966
- ]), ne = (r) => {
972
+ ]), ie = (r) => {
967
973
  switch (typeof r) {
968
974
  case "undefined":
969
975
  return p.undefined;
@@ -984,7 +990,7 @@ const p = k.arrayToEnum([
984
990
  default:
985
991
  return p.unknown;
986
992
  }
987
- }, l = k.arrayToEnum([
993
+ }, l = x.arrayToEnum([
988
994
  "invalid_type",
989
995
  "invalid_literal",
990
996
  "custom",
@@ -1031,8 +1037,8 @@ class z extends Error {
1031
1037
  else {
1032
1038
  let o = s, c = 0;
1033
1039
  for (; c < i.path.length; ) {
1034
- const u = i.path[c];
1035
- c === i.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(t(i))) : o[u] = o[u] || { _errors: [] }, o = o[u], c++;
1040
+ const d = i.path[c];
1041
+ c === i.path.length - 1 ? (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(t(i))) : o[d] = o[d] || { _errors: [] }, o = o[d], c++;
1036
1042
  }
1037
1043
  }
1038
1044
  };
@@ -1046,7 +1052,7 @@ class z extends Error {
1046
1052
  return this.message;
1047
1053
  }
1048
1054
  get message() {
1049
- return JSON.stringify(this.issues, k.jsonStringifyReplacer, 2);
1055
+ return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
1050
1056
  }
1051
1057
  get isEmpty() {
1052
1058
  return this.issues.length === 0;
@@ -1069,19 +1075,19 @@ const Ae = (r, e) => {
1069
1075
  r.received === p.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
1070
1076
  break;
1071
1077
  case l.invalid_literal:
1072
- t = `Invalid literal value, expected ${JSON.stringify(r.expected, k.jsonStringifyReplacer)}`;
1078
+ t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
1073
1079
  break;
1074
1080
  case l.unrecognized_keys:
1075
- t = `Unrecognized key(s) in object: ${k.joinValues(r.keys, ", ")}`;
1081
+ t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
1076
1082
  break;
1077
1083
  case l.invalid_union:
1078
1084
  t = "Invalid input";
1079
1085
  break;
1080
1086
  case l.invalid_union_discriminator:
1081
- t = `Invalid discriminator value. Expected ${k.joinValues(r.options)}`;
1087
+ t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
1082
1088
  break;
1083
1089
  case l.invalid_enum_value:
1084
- t = `Invalid enum value. Expected ${k.joinValues(r.options)}, received '${r.received}'`;
1090
+ t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
1085
1091
  break;
1086
1092
  case l.invalid_arguments:
1087
1093
  t = "Invalid function arguments";
@@ -1093,7 +1099,7 @@ const Ae = (r, e) => {
1093
1099
  t = "Invalid date";
1094
1100
  break;
1095
1101
  case l.invalid_string:
1096
- typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : k.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
1102
+ typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
1097
1103
  break;
1098
1104
  case l.too_small:
1099
1105
  r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
@@ -1114,7 +1120,7 @@ const Ae = (r, e) => {
1114
1120
  t = "Number must be finite";
1115
1121
  break;
1116
1122
  default:
1117
- t = e.defaultError, k.assertNever(r);
1123
+ t = e.defaultError, x.assertNever(r);
1118
1124
  }
1119
1125
  return { message: t };
1120
1126
  };
@@ -1122,29 +1128,29 @@ let dr = Ae;
1122
1128
  function js(r) {
1123
1129
  dr = r;
1124
1130
  }
1125
- function rt() {
1131
+ function st() {
1126
1132
  return dr;
1127
1133
  }
1128
- const st = (r) => {
1129
- const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = g(d({}, n), {
1134
+ const nt = (r) => {
1135
+ const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = g(u({}, n), {
1130
1136
  path: a
1131
1137
  });
1132
1138
  if (n.message !== void 0)
1133
- return g(d({}, n), {
1139
+ return g(u({}, n), {
1134
1140
  path: a,
1135
1141
  message: n.message
1136
1142
  });
1137
1143
  let o = "";
1138
- const c = s.filter((u) => !!u).slice().reverse();
1139
- for (const u of c)
1140
- o = u(i, { data: e, defaultError: o }).message;
1141
- return g(d({}, n), {
1144
+ const c = s.filter((d) => !!d).slice().reverse();
1145
+ for (const d of c)
1146
+ o = d(i, { data: e, defaultError: o }).message;
1147
+ return g(u({}, n), {
1142
1148
  path: a,
1143
1149
  message: o
1144
1150
  });
1145
1151
  }, Rs = [];
1146
1152
  function h(r, e) {
1147
- const t = rt(), s = st({
1153
+ const t = st(), s = nt({
1148
1154
  issueData: e,
1149
1155
  data: r.data,
1150
1156
  path: r.path,
@@ -1161,7 +1167,7 @@ function h(r, e) {
1161
1167
  });
1162
1168
  r.common.issues.push(s);
1163
1169
  }
1164
- class j {
1170
+ class R {
1165
1171
  constructor() {
1166
1172
  this.value = "valid";
1167
1173
  }
@@ -1190,7 +1196,7 @@ class j {
1190
1196
  value: i
1191
1197
  });
1192
1198
  }
1193
- return j.mergeObjectSync(e, s);
1199
+ return R.mergeObjectSync(e, s);
1194
1200
  });
1195
1201
  }
1196
1202
  static mergeObjectSync(e, t) {
@@ -1206,8 +1212,8 @@ class j {
1206
1212
  }
1207
1213
  const _ = Object.freeze({
1208
1214
  status: "aborted"
1209
- }), ke = (r) => ({ status: "dirty", value: r }), F = (r) => ({ status: "valid", value: r }), Et = (r) => r.status === "aborted", Ct = (r) => r.status === "dirty", ye = (r) => r.status === "valid", Pe = (r) => typeof Promise != "undefined" && r instanceof Promise;
1210
- function nt(r, e, t, s) {
1215
+ }), Te = (r) => ({ status: "dirty", value: r }), $ = (r) => ({ status: "valid", value: r }), Ot = (r) => r.status === "aborted", Ct = (r) => r.status === "dirty", _e = (r) => r.status === "valid", $e = (r) => typeof Promise != "undefined" && r instanceof Promise;
1216
+ function at(r, e, t, s) {
1211
1217
  if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1212
1218
  return e.get(r);
1213
1219
  }
@@ -1219,8 +1225,8 @@ var m;
1219
1225
  (function(r) {
1220
1226
  r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
1221
1227
  })(m || (m = {}));
1222
- var Ze, Me;
1223
- class Q {
1228
+ var Me, Pe;
1229
+ class te {
1224
1230
  constructor(e, t, s, n) {
1225
1231
  this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
1226
1232
  }
@@ -1229,7 +1235,7 @@ class Q {
1229
1235
  }
1230
1236
  }
1231
1237
  const Ht = (r, e) => {
1232
- if (ye(e))
1238
+ if (_e(e))
1233
1239
  return { success: !0, data: e.value };
1234
1240
  if (!r.common.issues.length)
1235
1241
  throw new Error("Validation failed but no issues detected.");
@@ -1243,30 +1249,30 @@ const Ht = (r, e) => {
1243
1249
  }
1244
1250
  };
1245
1251
  };
1246
- function w(r) {
1252
+ function b(r) {
1247
1253
  if (!r)
1248
1254
  return {};
1249
1255
  const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
1250
1256
  if (e && (t || s))
1251
1257
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
1252
1258
  return e ? { errorMap: e, description: n } : { errorMap: (i, o) => {
1253
- var c, u;
1259
+ var c, d;
1254
1260
  const { message: f } = r;
1255
- return i.code === "invalid_enum_value" ? { message: f != null ? f : o.defaultError } : typeof o.data == "undefined" ? { message: (c = f != null ? f : s) !== null && c !== void 0 ? c : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (u = f != null ? f : t) !== null && u !== void 0 ? u : o.defaultError };
1261
+ return i.code === "invalid_enum_value" ? { message: f != null ? f : o.defaultError } : typeof o.data == "undefined" ? { message: (c = f != null ? f : s) !== null && c !== void 0 ? c : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (d = f != null ? f : t) !== null && d !== void 0 ? d : o.defaultError };
1256
1262
  }, description: n };
1257
1263
  }
1258
- class x {
1264
+ class w {
1259
1265
  get description() {
1260
1266
  return this._def.description;
1261
1267
  }
1262
1268
  _getType(e) {
1263
- return ne(e.data);
1269
+ return ie(e.data);
1264
1270
  }
1265
1271
  _getOrReturnCtx(e, t) {
1266
1272
  return t || {
1267
1273
  common: e.parent.common,
1268
1274
  data: e.data,
1269
- parsedType: ne(e.data),
1275
+ parsedType: ie(e.data),
1270
1276
  schemaErrorMap: this._def.errorMap,
1271
1277
  path: e.path,
1272
1278
  parent: e.parent
@@ -1274,11 +1280,11 @@ class x {
1274
1280
  }
1275
1281
  _processInputParams(e) {
1276
1282
  return {
1277
- status: new j(),
1283
+ status: new R(),
1278
1284
  ctx: {
1279
1285
  common: e.parent.common,
1280
1286
  data: e.data,
1281
- parsedType: ne(e.data),
1287
+ parsedType: ie(e.data),
1282
1288
  schemaErrorMap: this._def.errorMap,
1283
1289
  path: e.path,
1284
1290
  parent: e.parent
@@ -1287,7 +1293,7 @@ class x {
1287
1293
  }
1288
1294
  _parseSync(e) {
1289
1295
  const t = this._parse(e);
1290
- if (Pe(t))
1296
+ if ($e(t))
1291
1297
  throw new Error("Synchronous parse encountered promise.");
1292
1298
  return t;
1293
1299
  }
@@ -1313,7 +1319,7 @@ class x {
1313
1319
  schemaErrorMap: this._def.errorMap,
1314
1320
  parent: null,
1315
1321
  data: e,
1316
- parsedType: ne(e)
1322
+ parsedType: ie(e)
1317
1323
  }, a = this._parseSync({ data: e, path: n.path, parent: n });
1318
1324
  return Ht(n, a);
1319
1325
  }
@@ -1328,12 +1334,12 @@ class x {
1328
1334
  schemaErrorMap: this._def.errorMap,
1329
1335
  parent: null,
1330
1336
  data: e,
1331
- parsedType: ne(e)
1337
+ parsedType: ie(e)
1332
1338
  };
1333
1339
  if (!this["~standard"].async)
1334
1340
  try {
1335
1341
  const a = this._parseSync({ data: e, path: [], parent: n });
1336
- return ye(a) ? {
1342
+ return _e(a) ? {
1337
1343
  value: a.value
1338
1344
  } : {
1339
1345
  issues: n.common.issues
@@ -1344,7 +1350,7 @@ class x {
1344
1350
  async: !0
1345
1351
  };
1346
1352
  }
1347
- return this._parseAsync({ data: e, path: [], parent: n }).then((a) => ye(a) ? {
1353
+ return this._parseAsync({ data: e, path: [], parent: n }).then((a) => _e(a) ? {
1348
1354
  value: a.value
1349
1355
  } : {
1350
1356
  issues: n.common.issues
@@ -1370,15 +1376,15 @@ class x {
1370
1376
  schemaErrorMap: this._def.errorMap,
1371
1377
  parent: null,
1372
1378
  data: e,
1373
- parsedType: ne(e)
1374
- }, n = this._parse({ data: e, path: s.path, parent: s }), a = yield Pe(n) ? n : Promise.resolve(n);
1379
+ parsedType: ie(e)
1380
+ }, n = this._parse({ data: e, path: s.path, parent: s }), a = yield $e(n) ? n : Promise.resolve(n);
1375
1381
  return Ht(s, a);
1376
1382
  });
1377
1383
  }
1378
1384
  refine(e, t) {
1379
1385
  const s = (n) => typeof t == "string" || typeof t == "undefined" ? { message: t } : typeof t == "function" ? t(n) : t;
1380
1386
  return this._refinement((n, a) => {
1381
- const i = e(n), o = () => a.addIssue(d({
1387
+ const i = e(n), o = () => a.addIssue(u({
1382
1388
  code: l.custom
1383
1389
  }, s(n)));
1384
1390
  return typeof Promise != "undefined" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
@@ -1388,7 +1394,7 @@ class x {
1388
1394
  return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
1389
1395
  }
1390
1396
  _refinement(e) {
1391
- return new J({
1397
+ return new G({
1392
1398
  schema: this,
1393
1399
  typeName: y.ZodEffects,
1394
1400
  effect: { type: "refinement", refinement: e }
@@ -1405,28 +1411,28 @@ class x {
1405
1411
  };
1406
1412
  }
1407
1413
  optional() {
1408
- return Y.create(this, this._def);
1414
+ return ee.create(this, this._def);
1409
1415
  }
1410
1416
  nullable() {
1411
- return fe.create(this, this._def);
1417
+ return pe.create(this, this._def);
1412
1418
  }
1413
1419
  nullish() {
1414
1420
  return this.nullable().optional();
1415
1421
  }
1416
1422
  array() {
1417
- return H.create(this);
1423
+ return J.create(this);
1418
1424
  }
1419
1425
  promise() {
1420
1426
  return Ce.create(this, this._def);
1421
1427
  }
1422
1428
  or(e) {
1423
- return Ve.create([this, e], this._def);
1429
+ return De.create([this, e], this._def);
1424
1430
  }
1425
1431
  and(e) {
1426
- return De.create(this, e, this._def);
1432
+ return Ue.create(this, e, this._def);
1427
1433
  }
1428
1434
  transform(e) {
1429
- return new J(g(d({}, w(this._def)), {
1435
+ return new G(g(u({}, b(this._def)), {
1430
1436
  schema: this,
1431
1437
  typeName: y.ZodEffects,
1432
1438
  effect: { type: "transform", transform: e }
@@ -1434,21 +1440,21 @@ class x {
1434
1440
  }
1435
1441
  default(e) {
1436
1442
  const t = typeof e == "function" ? e : () => e;
1437
- return new qe(g(d({}, w(this._def)), {
1443
+ return new He(g(u({}, b(this._def)), {
1438
1444
  innerType: this,
1439
1445
  defaultValue: t,
1440
1446
  typeName: y.ZodDefault
1441
1447
  }));
1442
1448
  }
1443
1449
  brand() {
1444
- return new Zt(d({
1450
+ return new Mt(u({
1445
1451
  typeName: y.ZodBranded,
1446
1452
  type: this
1447
- }, w(this._def)));
1453
+ }, b(this._def)));
1448
1454
  }
1449
1455
  catch(e) {
1450
1456
  const t = typeof e == "function" ? e : () => e;
1451
- return new He(g(d({}, w(this._def)), {
1457
+ return new Je(g(u({}, b(this._def)), {
1452
1458
  innerType: this,
1453
1459
  catchValue: t,
1454
1460
  typeName: y.ZodCatch
@@ -1456,15 +1462,15 @@ class x {
1456
1462
  }
1457
1463
  describe(e) {
1458
1464
  const t = this.constructor;
1459
- return new t(g(d({}, this._def), {
1465
+ return new t(g(u({}, this._def), {
1460
1466
  description: e
1461
1467
  }));
1462
1468
  }
1463
1469
  pipe(e) {
1464
- return Ke.create(this, e);
1470
+ return Xe.create(this, e);
1465
1471
  }
1466
1472
  readonly() {
1467
- return Je.create(this);
1473
+ return Ge.create(this);
1468
1474
  }
1469
1475
  isOptional() {
1470
1476
  return this.safeParse(void 0).success;
@@ -1474,7 +1480,7 @@ class x {
1474
1480
  }
1475
1481
  }
1476
1482
  const Zs = /^c[^\s-]{8,}$/i, Ms = /^[0-9a-z]+$/, Ps = /^[0-9A-HJKMNP-TV-Z]{26}$/i, $s = /^[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, Fs = /^[a-z0-9_-]{21}$/i, Ls = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Vs = /^[-+]?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)?)??$/, Ds = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Us = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1477
- let gt;
1483
+ let yt;
1478
1484
  const zs = /^(?:(?: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])$/, Ws = /^(?:(?: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])$/, Bs = /^(([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]))$/, qs = /^(([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])$/, Hs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Js = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, lr = "((\\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])))", Gs = new RegExp(`^${lr}$`);
1479
1485
  function fr(r) {
1480
1486
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
@@ -1504,7 +1510,7 @@ function Ys(r, e) {
1504
1510
  function Qs(r, e) {
1505
1511
  return !!((e === "v4" || !e) && Ws.test(r) || (e === "v6" || !e) && qs.test(r));
1506
1512
  }
1507
- class q extends x {
1513
+ class H extends w {
1508
1514
  _parse(e) {
1509
1515
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== p.string) {
1510
1516
  const a = this._getOrReturnCtx(e);
@@ -1514,7 +1520,7 @@ class q extends x {
1514
1520
  received: a.parsedType
1515
1521
  }), _;
1516
1522
  }
1517
- const s = new j();
1523
+ const s = new R();
1518
1524
  let n;
1519
1525
  for (const a of this._def.checks)
1520
1526
  if (a.kind === "min")
@@ -1559,7 +1565,7 @@ class q extends x {
1559
1565
  message: a.message
1560
1566
  }), s.dirty());
1561
1567
  else if (a.kind === "emoji")
1562
- gt || (gt = new RegExp(Us, "u")), gt.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1568
+ yt || (yt = new RegExp(Us, "u")), yt.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1563
1569
  validation: "emoji",
1564
1570
  code: l.invalid_string,
1565
1571
  message: a.message
@@ -1656,60 +1662,60 @@ class q extends x {
1656
1662
  validation: "base64url",
1657
1663
  code: l.invalid_string,
1658
1664
  message: a.message
1659
- }), s.dirty()) : k.assertNever(a);
1665
+ }), s.dirty()) : x.assertNever(a);
1660
1666
  return { status: s.value, value: e.data };
1661
1667
  }
1662
1668
  _regex(e, t, s) {
1663
- return this.refinement((n) => e.test(n), d({
1669
+ return this.refinement((n) => e.test(n), u({
1664
1670
  validation: t,
1665
1671
  code: l.invalid_string
1666
1672
  }, m.errToObj(s)));
1667
1673
  }
1668
1674
  _addCheck(e) {
1669
- return new q(g(d({}, this._def), {
1675
+ return new H(g(u({}, this._def), {
1670
1676
  checks: [...this._def.checks, e]
1671
1677
  }));
1672
1678
  }
1673
1679
  email(e) {
1674
- return this._addCheck(d({ kind: "email" }, m.errToObj(e)));
1680
+ return this._addCheck(u({ kind: "email" }, m.errToObj(e)));
1675
1681
  }
1676
1682
  url(e) {
1677
- return this._addCheck(d({ kind: "url" }, m.errToObj(e)));
1683
+ return this._addCheck(u({ kind: "url" }, m.errToObj(e)));
1678
1684
  }
1679
1685
  emoji(e) {
1680
- return this._addCheck(d({ kind: "emoji" }, m.errToObj(e)));
1686
+ return this._addCheck(u({ kind: "emoji" }, m.errToObj(e)));
1681
1687
  }
1682
1688
  uuid(e) {
1683
- return this._addCheck(d({ kind: "uuid" }, m.errToObj(e)));
1689
+ return this._addCheck(u({ kind: "uuid" }, m.errToObj(e)));
1684
1690
  }
1685
1691
  nanoid(e) {
1686
- return this._addCheck(d({ kind: "nanoid" }, m.errToObj(e)));
1692
+ return this._addCheck(u({ kind: "nanoid" }, m.errToObj(e)));
1687
1693
  }
1688
1694
  cuid(e) {
1689
- return this._addCheck(d({ kind: "cuid" }, m.errToObj(e)));
1695
+ return this._addCheck(u({ kind: "cuid" }, m.errToObj(e)));
1690
1696
  }
1691
1697
  cuid2(e) {
1692
- return this._addCheck(d({ kind: "cuid2" }, m.errToObj(e)));
1698
+ return this._addCheck(u({ kind: "cuid2" }, m.errToObj(e)));
1693
1699
  }
1694
1700
  ulid(e) {
1695
- return this._addCheck(d({ kind: "ulid" }, m.errToObj(e)));
1701
+ return this._addCheck(u({ kind: "ulid" }, m.errToObj(e)));
1696
1702
  }
1697
1703
  base64(e) {
1698
- return this._addCheck(d({ kind: "base64" }, m.errToObj(e)));
1704
+ return this._addCheck(u({ kind: "base64" }, m.errToObj(e)));
1699
1705
  }
1700
1706
  base64url(e) {
1701
- return this._addCheck(d({
1707
+ return this._addCheck(u({
1702
1708
  kind: "base64url"
1703
1709
  }, m.errToObj(e)));
1704
1710
  }
1705
1711
  jwt(e) {
1706
- return this._addCheck(d({ kind: "jwt" }, m.errToObj(e)));
1712
+ return this._addCheck(u({ kind: "jwt" }, m.errToObj(e)));
1707
1713
  }
1708
1714
  ip(e) {
1709
- return this._addCheck(d({ kind: "ip" }, m.errToObj(e)));
1715
+ return this._addCheck(u({ kind: "ip" }, m.errToObj(e)));
1710
1716
  }
1711
1717
  cidr(e) {
1712
- return this._addCheck(d({ kind: "cidr" }, m.errToObj(e)));
1718
+ return this._addCheck(u({ kind: "cidr" }, m.errToObj(e)));
1713
1719
  }
1714
1720
  datetime(e) {
1715
1721
  var t, s;
@@ -1719,7 +1725,7 @@ class q extends x {
1719
1725
  offset: !1,
1720
1726
  local: !1,
1721
1727
  message: e
1722
- }) : this._addCheck(d({
1728
+ }) : this._addCheck(u({
1723
1729
  kind: "datetime",
1724
1730
  precision: typeof (e == null ? void 0 : e.precision) == "undefined" ? null : e == null ? void 0 : e.precision,
1725
1731
  offset: (t = e == null ? void 0 : e.offset) !== null && t !== void 0 ? t : !1,
@@ -1734,53 +1740,53 @@ class q extends x {
1734
1740
  kind: "time",
1735
1741
  precision: null,
1736
1742
  message: e
1737
- }) : this._addCheck(d({
1743
+ }) : this._addCheck(u({
1738
1744
  kind: "time",
1739
1745
  precision: typeof (e == null ? void 0 : e.precision) == "undefined" ? null : e == null ? void 0 : e.precision
1740
1746
  }, m.errToObj(e == null ? void 0 : e.message)));
1741
1747
  }
1742
1748
  duration(e) {
1743
- return this._addCheck(d({ kind: "duration" }, m.errToObj(e)));
1749
+ return this._addCheck(u({ kind: "duration" }, m.errToObj(e)));
1744
1750
  }
1745
1751
  regex(e, t) {
1746
- return this._addCheck(d({
1752
+ return this._addCheck(u({
1747
1753
  kind: "regex",
1748
1754
  regex: e
1749
1755
  }, m.errToObj(t)));
1750
1756
  }
1751
1757
  includes(e, t) {
1752
- return this._addCheck(d({
1758
+ return this._addCheck(u({
1753
1759
  kind: "includes",
1754
1760
  value: e,
1755
1761
  position: t == null ? void 0 : t.position
1756
1762
  }, m.errToObj(t == null ? void 0 : t.message)));
1757
1763
  }
1758
1764
  startsWith(e, t) {
1759
- return this._addCheck(d({
1765
+ return this._addCheck(u({
1760
1766
  kind: "startsWith",
1761
1767
  value: e
1762
1768
  }, m.errToObj(t)));
1763
1769
  }
1764
1770
  endsWith(e, t) {
1765
- return this._addCheck(d({
1771
+ return this._addCheck(u({
1766
1772
  kind: "endsWith",
1767
1773
  value: e
1768
1774
  }, m.errToObj(t)));
1769
1775
  }
1770
1776
  min(e, t) {
1771
- return this._addCheck(d({
1777
+ return this._addCheck(u({
1772
1778
  kind: "min",
1773
1779
  value: e
1774
1780
  }, m.errToObj(t)));
1775
1781
  }
1776
1782
  max(e, t) {
1777
- return this._addCheck(d({
1783
+ return this._addCheck(u({
1778
1784
  kind: "max",
1779
1785
  value: e
1780
1786
  }, m.errToObj(t)));
1781
1787
  }
1782
1788
  length(e, t) {
1783
- return this._addCheck(d({
1789
+ return this._addCheck(u({
1784
1790
  kind: "length",
1785
1791
  value: e
1786
1792
  }, m.errToObj(t)));
@@ -1792,17 +1798,17 @@ class q extends x {
1792
1798
  return this.min(1, m.errToObj(e));
1793
1799
  }
1794
1800
  trim() {
1795
- return new q(g(d({}, this._def), {
1801
+ return new H(g(u({}, this._def), {
1796
1802
  checks: [...this._def.checks, { kind: "trim" }]
1797
1803
  }));
1798
1804
  }
1799
1805
  toLowerCase() {
1800
- return new q(g(d({}, this._def), {
1806
+ return new H(g(u({}, this._def), {
1801
1807
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1802
1808
  }));
1803
1809
  }
1804
1810
  toUpperCase() {
1805
- return new q(g(d({}, this._def), {
1811
+ return new H(g(u({}, this._def), {
1806
1812
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1807
1813
  }));
1808
1814
  }
@@ -1867,19 +1873,19 @@ class q extends x {
1867
1873
  return e;
1868
1874
  }
1869
1875
  }
1870
- q.create = (r) => {
1876
+ H.create = (r) => {
1871
1877
  var e;
1872
- return new q(d({
1878
+ return new H(u({
1873
1879
  checks: [],
1874
1880
  typeName: y.ZodString,
1875
1881
  coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1
1876
- }, w(r)));
1882
+ }, b(r)));
1877
1883
  };
1878
1884
  function en(r, e) {
1879
1885
  const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = parseInt(r.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
1880
1886
  return a % i / Math.pow(10, n);
1881
1887
  }
1882
- class de extends x {
1888
+ class le extends w {
1883
1889
  constructor() {
1884
1890
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1885
1891
  }
@@ -1893,9 +1899,9 @@ class de extends x {
1893
1899
  }), _;
1894
1900
  }
1895
1901
  let s;
1896
- const n = new j();
1902
+ const n = new R();
1897
1903
  for (const a of this._def.checks)
1898
- a.kind === "int" ? k.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
1904
+ a.kind === "int" ? x.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
1899
1905
  code: l.invalid_type,
1900
1906
  expected: "integer",
1901
1907
  received: "float",
@@ -1921,7 +1927,7 @@ class de extends x {
1921
1927
  }), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
1922
1928
  code: l.not_finite,
1923
1929
  message: a.message
1924
- }), n.dirty()) : k.assertNever(a);
1930
+ }), n.dirty()) : x.assertNever(a);
1925
1931
  return { status: n.value, value: e.data };
1926
1932
  }
1927
1933
  gte(e, t) {
@@ -1937,7 +1943,7 @@ class de extends x {
1937
1943
  return this.setLimit("max", e, !1, m.toString(t));
1938
1944
  }
1939
1945
  setLimit(e, t, s, n) {
1940
- return new de(g(d({}, this._def), {
1946
+ return new le(g(u({}, this._def), {
1941
1947
  checks: [
1942
1948
  ...this._def.checks,
1943
1949
  {
@@ -1950,7 +1956,7 @@ class de extends x {
1950
1956
  }));
1951
1957
  }
1952
1958
  _addCheck(e) {
1953
- return new de(g(d({}, this._def), {
1959
+ return new le(g(u({}, this._def), {
1954
1960
  checks: [...this._def.checks, e]
1955
1961
  }));
1956
1962
  }
@@ -2031,7 +2037,7 @@ class de extends x {
2031
2037
  return e;
2032
2038
  }
2033
2039
  get isInt() {
2034
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && k.isInteger(e.value));
2040
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
2035
2041
  }
2036
2042
  get isFinite() {
2037
2043
  let e = null, t = null;
@@ -2043,12 +2049,12 @@ class de extends x {
2043
2049
  return Number.isFinite(t) && Number.isFinite(e);
2044
2050
  }
2045
2051
  }
2046
- de.create = (r) => new de(d({
2052
+ le.create = (r) => new le(u({
2047
2053
  checks: [],
2048
2054
  typeName: y.ZodNumber,
2049
2055
  coerce: (r == null ? void 0 : r.coerce) || !1
2050
- }, w(r)));
2051
- class ue extends x {
2056
+ }, b(r)));
2057
+ class fe extends w {
2052
2058
  constructor() {
2053
2059
  super(...arguments), this.min = this.gte, this.max = this.lte;
2054
2060
  }
@@ -2062,7 +2068,7 @@ class ue extends x {
2062
2068
  if (this._getType(e) !== p.bigint)
2063
2069
  return this._getInvalidInput(e);
2064
2070
  let s;
2065
- const n = new j();
2071
+ const n = new R();
2066
2072
  for (const a of this._def.checks)
2067
2073
  a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
2068
2074
  code: l.too_small,
@@ -2080,7 +2086,7 @@ class ue extends x {
2080
2086
  code: l.not_multiple_of,
2081
2087
  multipleOf: a.value,
2082
2088
  message: a.message
2083
- }), n.dirty()) : k.assertNever(a);
2089
+ }), n.dirty()) : x.assertNever(a);
2084
2090
  return { status: n.value, value: e.data };
2085
2091
  }
2086
2092
  _getInvalidInput(e) {
@@ -2104,7 +2110,7 @@ class ue extends x {
2104
2110
  return this.setLimit("max", e, !1, m.toString(t));
2105
2111
  }
2106
2112
  setLimit(e, t, s, n) {
2107
- return new ue(g(d({}, this._def), {
2113
+ return new fe(g(u({}, this._def), {
2108
2114
  checks: [
2109
2115
  ...this._def.checks,
2110
2116
  {
@@ -2117,7 +2123,7 @@ class ue extends x {
2117
2123
  }));
2118
2124
  }
2119
2125
  _addCheck(e) {
2120
- return new ue(g(d({}, this._def), {
2126
+ return new fe(g(u({}, this._def), {
2121
2127
  checks: [...this._def.checks, e]
2122
2128
  }));
2123
2129
  }
@@ -2173,15 +2179,15 @@ class ue extends x {
2173
2179
  return e;
2174
2180
  }
2175
2181
  }
2176
- ue.create = (r) => {
2182
+ fe.create = (r) => {
2177
2183
  var e;
2178
- return new ue(d({
2184
+ return new fe(u({
2179
2185
  checks: [],
2180
2186
  typeName: y.ZodBigInt,
2181
2187
  coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1
2182
- }, w(r)));
2188
+ }, b(r)));
2183
2189
  };
2184
- class $e extends x {
2190
+ class Fe extends w {
2185
2191
  _parse(e) {
2186
2192
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
2187
2193
  const s = this._getOrReturnCtx(e);
@@ -2191,14 +2197,14 @@ class $e extends x {
2191
2197
  received: s.parsedType
2192
2198
  }), _;
2193
2199
  }
2194
- return F(e.data);
2200
+ return $(e.data);
2195
2201
  }
2196
2202
  }
2197
- $e.create = (r) => new $e(d({
2203
+ Fe.create = (r) => new Fe(u({
2198
2204
  typeName: y.ZodBoolean,
2199
2205
  coerce: (r == null ? void 0 : r.coerce) || !1
2200
- }, w(r)));
2201
- class ve extends x {
2206
+ }, b(r)));
2207
+ class be extends w {
2202
2208
  _parse(e) {
2203
2209
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
2204
2210
  const a = this._getOrReturnCtx(e);
@@ -2214,7 +2220,7 @@ class ve extends x {
2214
2220
  code: l.invalid_date
2215
2221
  }), _;
2216
2222
  }
2217
- const s = new j();
2223
+ const s = new R();
2218
2224
  let n;
2219
2225
  for (const a of this._def.checks)
2220
2226
  a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), h(n, {
@@ -2231,14 +2237,14 @@ class ve extends x {
2231
2237
  exact: !1,
2232
2238
  maximum: a.value,
2233
2239
  type: "date"
2234
- }), s.dirty()) : k.assertNever(a);
2240
+ }), s.dirty()) : x.assertNever(a);
2235
2241
  return {
2236
2242
  status: s.value,
2237
2243
  value: new Date(e.data.getTime())
2238
2244
  };
2239
2245
  }
2240
2246
  _addCheck(e) {
2241
- return new ve(g(d({}, this._def), {
2247
+ return new be(g(u({}, this._def), {
2242
2248
  checks: [...this._def.checks, e]
2243
2249
  }));
2244
2250
  }
@@ -2269,12 +2275,12 @@ class ve extends x {
2269
2275
  return e != null ? new Date(e) : null;
2270
2276
  }
2271
2277
  }
2272
- ve.create = (r) => new ve(d({
2278
+ be.create = (r) => new be(u({
2273
2279
  checks: [],
2274
2280
  coerce: (r == null ? void 0 : r.coerce) || !1,
2275
2281
  typeName: y.ZodDate
2276
- }, w(r)));
2277
- class at extends x {
2282
+ }, b(r)));
2283
+ class it extends w {
2278
2284
  _parse(e) {
2279
2285
  if (this._getType(e) !== p.symbol) {
2280
2286
  const s = this._getOrReturnCtx(e);
@@ -2284,13 +2290,13 @@ class at extends x {
2284
2290
  received: s.parsedType
2285
2291
  }), _;
2286
2292
  }
2287
- return F(e.data);
2293
+ return $(e.data);
2288
2294
  }
2289
2295
  }
2290
- at.create = (r) => new at(d({
2296
+ it.create = (r) => new it(u({
2291
2297
  typeName: y.ZodSymbol
2292
- }, w(r)));
2293
- class Fe extends x {
2298
+ }, b(r)));
2299
+ class Le extends w {
2294
2300
  _parse(e) {
2295
2301
  if (this._getType(e) !== p.undefined) {
2296
2302
  const s = this._getOrReturnCtx(e);
@@ -2300,13 +2306,13 @@ class Fe extends x {
2300
2306
  received: s.parsedType
2301
2307
  }), _;
2302
2308
  }
2303
- return F(e.data);
2309
+ return $(e.data);
2304
2310
  }
2305
2311
  }
2306
- Fe.create = (r) => new Fe(d({
2312
+ Le.create = (r) => new Le(u({
2307
2313
  typeName: y.ZodUndefined
2308
- }, w(r)));
2309
- class Le extends x {
2314
+ }, b(r)));
2315
+ class Ve extends w {
2310
2316
  _parse(e) {
2311
2317
  if (this._getType(e) !== p.null) {
2312
2318
  const s = this._getOrReturnCtx(e);
@@ -2316,35 +2322,35 @@ class Le extends x {
2316
2322
  received: s.parsedType
2317
2323
  }), _;
2318
2324
  }
2319
- return F(e.data);
2325
+ return $(e.data);
2320
2326
  }
2321
2327
  }
2322
- Le.create = (r) => new Le(d({
2328
+ Ve.create = (r) => new Ve(u({
2323
2329
  typeName: y.ZodNull
2324
- }, w(r)));
2325
- class Ee extends x {
2330
+ }, b(r)));
2331
+ class Oe extends w {
2326
2332
  constructor() {
2327
2333
  super(...arguments), this._any = !0;
2328
2334
  }
2329
2335
  _parse(e) {
2330
- return F(e.data);
2336
+ return $(e.data);
2331
2337
  }
2332
2338
  }
2333
- Ee.create = (r) => new Ee(d({
2339
+ Oe.create = (r) => new Oe(u({
2334
2340
  typeName: y.ZodAny
2335
- }, w(r)));
2336
- class ge extends x {
2341
+ }, b(r)));
2342
+ class ve extends w {
2337
2343
  constructor() {
2338
2344
  super(...arguments), this._unknown = !0;
2339
2345
  }
2340
2346
  _parse(e) {
2341
- return F(e.data);
2347
+ return $(e.data);
2342
2348
  }
2343
2349
  }
2344
- ge.create = (r) => new ge(d({
2350
+ ve.create = (r) => new ve(u({
2345
2351
  typeName: y.ZodUnknown
2346
- }, w(r)));
2347
- class ae extends x {
2352
+ }, b(r)));
2353
+ class oe extends w {
2348
2354
  _parse(e) {
2349
2355
  const t = this._getOrReturnCtx(e);
2350
2356
  return h(t, {
@@ -2354,10 +2360,10 @@ class ae extends x {
2354
2360
  }), _;
2355
2361
  }
2356
2362
  }
2357
- ae.create = (r) => new ae(d({
2363
+ oe.create = (r) => new oe(u({
2358
2364
  typeName: y.ZodNever
2359
- }, w(r)));
2360
- class it extends x {
2365
+ }, b(r)));
2366
+ class ot extends w {
2361
2367
  _parse(e) {
2362
2368
  if (this._getType(e) !== p.undefined) {
2363
2369
  const s = this._getOrReturnCtx(e);
@@ -2367,13 +2373,13 @@ class it extends x {
2367
2373
  received: s.parsedType
2368
2374
  }), _;
2369
2375
  }
2370
- return F(e.data);
2376
+ return $(e.data);
2371
2377
  }
2372
2378
  }
2373
- it.create = (r) => new it(d({
2379
+ ot.create = (r) => new ot(u({
2374
2380
  typeName: y.ZodVoid
2375
- }, w(r)));
2376
- class H extends x {
2381
+ }, b(r)));
2382
+ class J extends w {
2377
2383
  _parse(e) {
2378
2384
  const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
2379
2385
  if (t.parsedType !== p.array)
@@ -2409,25 +2415,25 @@ class H extends x {
2409
2415
  exact: !1,
2410
2416
  message: n.maxLength.message
2411
2417
  }), s.dirty()), t.common.async)
2412
- return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new Q(t, i, t.path, o)))).then((i) => j.mergeArray(s, i));
2413
- const a = [...t.data].map((i, o) => n.type._parseSync(new Q(t, i, t.path, o)));
2414
- return j.mergeArray(s, a);
2418
+ return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new te(t, i, t.path, o)))).then((i) => R.mergeArray(s, i));
2419
+ const a = [...t.data].map((i, o) => n.type._parseSync(new te(t, i, t.path, o)));
2420
+ return R.mergeArray(s, a);
2415
2421
  }
2416
2422
  get element() {
2417
2423
  return this._def.type;
2418
2424
  }
2419
2425
  min(e, t) {
2420
- return new H(g(d({}, this._def), {
2426
+ return new J(g(u({}, this._def), {
2421
2427
  minLength: { value: e, message: m.toString(t) }
2422
2428
  }));
2423
2429
  }
2424
2430
  max(e, t) {
2425
- return new H(g(d({}, this._def), {
2431
+ return new J(g(u({}, this._def), {
2426
2432
  maxLength: { value: e, message: m.toString(t) }
2427
2433
  }));
2428
2434
  }
2429
2435
  length(e, t) {
2430
- return new H(g(d({}, this._def), {
2436
+ return new J(g(u({}, this._def), {
2431
2437
  exactLength: { value: e, message: m.toString(t) }
2432
2438
  }));
2433
2439
  }
@@ -2435,81 +2441,81 @@ class H extends x {
2435
2441
  return this.min(1, e);
2436
2442
  }
2437
2443
  }
2438
- H.create = (r, e) => new H(d({
2444
+ J.create = (r, e) => new J(u({
2439
2445
  type: r,
2440
2446
  minLength: null,
2441
2447
  maxLength: null,
2442
2448
  exactLength: null,
2443
2449
  typeName: y.ZodArray
2444
- }, w(e)));
2445
- function xe(r) {
2446
- if (r instanceof A) {
2450
+ }, b(e)));
2451
+ function ke(r) {
2452
+ if (r instanceof E) {
2447
2453
  const e = {};
2448
2454
  for (const t in r.shape) {
2449
2455
  const s = r.shape[t];
2450
- e[t] = Y.create(xe(s));
2456
+ e[t] = ee.create(ke(s));
2451
2457
  }
2452
- return new A(g(d({}, r._def), {
2458
+ return new E(g(u({}, r._def), {
2453
2459
  shape: () => e
2454
2460
  }));
2455
- } else return r instanceof H ? new H(g(d({}, r._def), {
2456
- type: xe(r.element)
2457
- })) : r instanceof Y ? Y.create(xe(r.unwrap())) : r instanceof fe ? fe.create(xe(r.unwrap())) : r instanceof ee ? ee.create(r.items.map((e) => xe(e))) : r;
2461
+ } else return r instanceof J ? new J(g(u({}, r._def), {
2462
+ type: ke(r.element)
2463
+ })) : r instanceof ee ? ee.create(ke(r.unwrap())) : r instanceof pe ? pe.create(ke(r.unwrap())) : r instanceof re ? re.create(r.items.map((e) => ke(e))) : r;
2458
2464
  }
2459
- class A extends x {
2465
+ class E extends w {
2460
2466
  constructor() {
2461
2467
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
2462
2468
  }
2463
2469
  _getCached() {
2464
2470
  if (this._cached !== null)
2465
2471
  return this._cached;
2466
- const e = this._def.shape(), t = k.objectKeys(e);
2472
+ const e = this._def.shape(), t = x.objectKeys(e);
2467
2473
  return this._cached = { shape: e, keys: t };
2468
2474
  }
2469
2475
  _parse(e) {
2470
2476
  if (this._getType(e) !== p.object) {
2471
- const u = this._getOrReturnCtx(e);
2472
- return h(u, {
2477
+ const d = this._getOrReturnCtx(e);
2478
+ return h(d, {
2473
2479
  code: l.invalid_type,
2474
2480
  expected: p.object,
2475
- received: u.parsedType
2481
+ received: d.parsedType
2476
2482
  }), _;
2477
2483
  }
2478
2484
  const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
2479
- if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
2480
- for (const u in n.data)
2481
- i.includes(u) || o.push(u);
2485
+ if (!(this._def.catchall instanceof oe && this._def.unknownKeys === "strip"))
2486
+ for (const d in n.data)
2487
+ i.includes(d) || o.push(d);
2482
2488
  const c = [];
2483
- for (const u of i) {
2484
- const f = a[u], v = n.data[u];
2489
+ for (const d of i) {
2490
+ const f = a[d], v = n.data[d];
2485
2491
  c.push({
2486
- key: { status: "valid", value: u },
2487
- value: f._parse(new Q(n, v, n.path, u)),
2488
- alwaysSet: u in n.data
2492
+ key: { status: "valid", value: d },
2493
+ value: f._parse(new te(n, v, n.path, d)),
2494
+ alwaysSet: d in n.data
2489
2495
  });
2490
2496
  }
2491
- if (this._def.catchall instanceof ae) {
2492
- const u = this._def.unknownKeys;
2493
- if (u === "passthrough")
2497
+ if (this._def.catchall instanceof oe) {
2498
+ const d = this._def.unknownKeys;
2499
+ if (d === "passthrough")
2494
2500
  for (const f of o)
2495
2501
  c.push({
2496
2502
  key: { status: "valid", value: f },
2497
2503
  value: { status: "valid", value: n.data[f] }
2498
2504
  });
2499
- else if (u === "strict")
2505
+ else if (d === "strict")
2500
2506
  o.length > 0 && (h(n, {
2501
2507
  code: l.unrecognized_keys,
2502
2508
  keys: o
2503
2509
  }), s.dirty());
2504
- else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
2510
+ else if (d !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
2505
2511
  } else {
2506
- const u = this._def.catchall;
2512
+ const d = this._def.catchall;
2507
2513
  for (const f of o) {
2508
2514
  const v = n.data[f];
2509
2515
  c.push({
2510
2516
  key: { status: "valid", value: f },
2511
- value: u._parse(
2512
- new Q(n, v, n.path, f)
2517
+ value: d._parse(
2518
+ new te(n, v, n.path, f)
2513
2519
  //, ctx.child(key), value, getParsedType(value)
2514
2520
  ),
2515
2521
  alwaysSet: f in n.data
@@ -2517,23 +2523,23 @@ class A extends x {
2517
2523
  }
2518
2524
  }
2519
2525
  return n.common.async ? Promise.resolve().then(() => C(this, null, function* () {
2520
- const u = [];
2526
+ const d = [];
2521
2527
  for (const f of c) {
2522
- const v = yield f.key, O = yield f.value;
2523
- u.push({
2528
+ const v = yield f.key, N = yield f.value;
2529
+ d.push({
2524
2530
  key: v,
2525
- value: O,
2531
+ value: N,
2526
2532
  alwaysSet: f.alwaysSet
2527
2533
  });
2528
2534
  }
2529
- return u;
2530
- })).then((u) => j.mergeObjectSync(s, u)) : j.mergeObjectSync(s, c);
2535
+ return d;
2536
+ })).then((d) => R.mergeObjectSync(s, d)) : R.mergeObjectSync(s, c);
2531
2537
  }
2532
2538
  get shape() {
2533
2539
  return this._def.shape();
2534
2540
  }
2535
2541
  strict(e) {
2536
- return m.errToObj, new A(d(g(d({}, this._def), {
2542
+ return m.errToObj, new E(u(g(u({}, this._def), {
2537
2543
  unknownKeys: "strict"
2538
2544
  }), e !== void 0 ? {
2539
2545
  errorMap: (t, s) => {
@@ -2548,12 +2554,12 @@ class A extends x {
2548
2554
  } : {}));
2549
2555
  }
2550
2556
  strip() {
2551
- return new A(g(d({}, this._def), {
2557
+ return new E(g(u({}, this._def), {
2552
2558
  unknownKeys: "strip"
2553
2559
  }));
2554
2560
  }
2555
2561
  passthrough() {
2556
- return new A(g(d({}, this._def), {
2562
+ return new E(g(u({}, this._def), {
2557
2563
  unknownKeys: "passthrough"
2558
2564
  }));
2559
2565
  }
@@ -2575,8 +2581,8 @@ class A extends x {
2575
2581
  // }) as any;
2576
2582
  // };
2577
2583
  extend(e) {
2578
- return new A(g(d({}, this._def), {
2579
- shape: () => d(d({}, this._def.shape()), e)
2584
+ return new E(g(u({}, this._def), {
2585
+ shape: () => u(u({}, this._def.shape()), e)
2580
2586
  }));
2581
2587
  }
2582
2588
  /**
@@ -2585,10 +2591,10 @@ class A extends x {
2585
2591
  * upgrade if you are experiencing issues.
2586
2592
  */
2587
2593
  merge(e) {
2588
- return new A({
2594
+ return new E({
2589
2595
  unknownKeys: e._def.unknownKeys,
2590
2596
  catchall: e._def.catchall,
2591
- shape: () => d(d({}, this._def.shape()), e._def.shape()),
2597
+ shape: () => u(u({}, this._def.shape()), e._def.shape()),
2592
2598
  typeName: y.ZodObject
2593
2599
  });
2594
2600
  }
@@ -2652,23 +2658,23 @@ class A extends x {
2652
2658
  // return merged;
2653
2659
  // }
2654
2660
  catchall(e) {
2655
- return new A(g(d({}, this._def), {
2661
+ return new E(g(u({}, this._def), {
2656
2662
  catchall: e
2657
2663
  }));
2658
2664
  }
2659
2665
  pick(e) {
2660
2666
  const t = {};
2661
- return k.objectKeys(e).forEach((s) => {
2667
+ return x.objectKeys(e).forEach((s) => {
2662
2668
  e[s] && this.shape[s] && (t[s] = this.shape[s]);
2663
- }), new A(g(d({}, this._def), {
2669
+ }), new E(g(u({}, this._def), {
2664
2670
  shape: () => t
2665
2671
  }));
2666
2672
  }
2667
2673
  omit(e) {
2668
2674
  const t = {};
2669
- return k.objectKeys(this.shape).forEach((s) => {
2675
+ return x.objectKeys(this.shape).forEach((s) => {
2670
2676
  e[s] || (t[s] = this.shape[s]);
2671
- }), new A(g(d({}, this._def), {
2677
+ }), new E(g(u({}, this._def), {
2672
2678
  shape: () => t
2673
2679
  }));
2674
2680
  }
@@ -2676,55 +2682,55 @@ class A extends x {
2676
2682
  * @deprecated
2677
2683
  */
2678
2684
  deepPartial() {
2679
- return xe(this);
2685
+ return ke(this);
2680
2686
  }
2681
2687
  partial(e) {
2682
2688
  const t = {};
2683
- return k.objectKeys(this.shape).forEach((s) => {
2689
+ return x.objectKeys(this.shape).forEach((s) => {
2684
2690
  const n = this.shape[s];
2685
2691
  e && !e[s] ? t[s] = n : t[s] = n.optional();
2686
- }), new A(g(d({}, this._def), {
2692
+ }), new E(g(u({}, this._def), {
2687
2693
  shape: () => t
2688
2694
  }));
2689
2695
  }
2690
2696
  required(e) {
2691
2697
  const t = {};
2692
- return k.objectKeys(this.shape).forEach((s) => {
2698
+ return x.objectKeys(this.shape).forEach((s) => {
2693
2699
  if (e && !e[s])
2694
2700
  t[s] = this.shape[s];
2695
2701
  else {
2696
2702
  let a = this.shape[s];
2697
- for (; a instanceof Y; )
2703
+ for (; a instanceof ee; )
2698
2704
  a = a._def.innerType;
2699
2705
  t[s] = a;
2700
2706
  }
2701
- }), new A(g(d({}, this._def), {
2707
+ }), new E(g(u({}, this._def), {
2702
2708
  shape: () => t
2703
2709
  }));
2704
2710
  }
2705
2711
  keyof() {
2706
- return pr(k.objectKeys(this.shape));
2712
+ return pr(x.objectKeys(this.shape));
2707
2713
  }
2708
2714
  }
2709
- A.create = (r, e) => new A(d({
2715
+ E.create = (r, e) => new E(u({
2710
2716
  shape: () => r,
2711
2717
  unknownKeys: "strip",
2712
- catchall: ae.create(),
2718
+ catchall: oe.create(),
2713
2719
  typeName: y.ZodObject
2714
- }, w(e)));
2715
- A.strictCreate = (r, e) => new A(d({
2720
+ }, b(e)));
2721
+ E.strictCreate = (r, e) => new E(u({
2716
2722
  shape: () => r,
2717
2723
  unknownKeys: "strict",
2718
- catchall: ae.create(),
2724
+ catchall: oe.create(),
2719
2725
  typeName: y.ZodObject
2720
- }, w(e)));
2721
- A.lazycreate = (r, e) => new A(d({
2726
+ }, b(e)));
2727
+ E.lazycreate = (r, e) => new E(u({
2722
2728
  shape: r,
2723
2729
  unknownKeys: "strip",
2724
- catchall: ae.create(),
2730
+ catchall: oe.create(),
2725
2731
  typeName: y.ZodObject
2726
- }, w(e)));
2727
- class Ve extends x {
2732
+ }, b(e)));
2733
+ class De extends w {
2728
2734
  _parse(e) {
2729
2735
  const { ctx: t } = this._processInputParams(e), s = this._def.options;
2730
2736
  function n(a) {
@@ -2742,8 +2748,8 @@ class Ve extends x {
2742
2748
  }
2743
2749
  if (t.common.async)
2744
2750
  return Promise.all(s.map((a) => C(this, null, function* () {
2745
- const i = g(d({}, t), {
2746
- common: g(d({}, t.common), {
2751
+ const i = g(u({}, t), {
2752
+ common: g(u({}, t.common), {
2747
2753
  issues: []
2748
2754
  }),
2749
2755
  parent: null
@@ -2761,19 +2767,19 @@ class Ve extends x {
2761
2767
  let a;
2762
2768
  const i = [];
2763
2769
  for (const c of s) {
2764
- const u = g(d({}, t), {
2765
- common: g(d({}, t.common), {
2770
+ const d = g(u({}, t), {
2771
+ common: g(u({}, t.common), {
2766
2772
  issues: []
2767
2773
  }),
2768
2774
  parent: null
2769
2775
  }), f = c._parseSync({
2770
2776
  data: t.data,
2771
2777
  path: t.path,
2772
- parent: u
2778
+ parent: d
2773
2779
  });
2774
2780
  if (f.status === "valid")
2775
2781
  return f;
2776
- f.status === "dirty" && !a && (a = { result: f, ctx: u }), u.common.issues.length && i.push(u.common.issues);
2782
+ f.status === "dirty" && !a && (a = { result: f, ctx: d }), d.common.issues.length && i.push(d.common.issues);
2777
2783
  }
2778
2784
  if (a)
2779
2785
  return t.common.issues.push(...a.ctx.common.issues), a.result;
@@ -2788,12 +2794,12 @@ class Ve extends x {
2788
2794
  return this._def.options;
2789
2795
  }
2790
2796
  }
2791
- Ve.create = (r, e) => new Ve(d({
2797
+ De.create = (r, e) => new De(u({
2792
2798
  options: r,
2793
2799
  typeName: y.ZodUnion
2794
- }, w(e)));
2795
- const se = (r) => r instanceof ze ? se(r.schema) : r instanceof J ? se(r.innerType()) : r instanceof We ? [r.value] : r instanceof le ? r.options : r instanceof Be ? k.objectValues(r.enum) : r instanceof qe ? se(r._def.innerType) : r instanceof Fe ? [void 0] : r instanceof Le ? [null] : r instanceof Y ? [void 0, ...se(r.unwrap())] : r instanceof fe ? [null, ...se(r.unwrap())] : r instanceof Zt || r instanceof Je ? se(r.unwrap()) : r instanceof He ? se(r._def.innerType) : [];
2796
- class dt extends x {
2800
+ }, b(e)));
2801
+ const ae = (r) => r instanceof We ? ae(r.schema) : r instanceof G ? ae(r.innerType()) : r instanceof Be ? [r.value] : r instanceof he ? r.options : r instanceof qe ? x.objectValues(r.enum) : r instanceof He ? ae(r._def.innerType) : r instanceof Le ? [void 0] : r instanceof Ve ? [null] : r instanceof ee ? [void 0, ...ae(r.unwrap())] : r instanceof pe ? [null, ...ae(r.unwrap())] : r instanceof Mt || r instanceof Ge ? ae(r.unwrap()) : r instanceof Je ? ae(r._def.innerType) : [];
2802
+ class ut extends w {
2797
2803
  _parse(e) {
2798
2804
  const { ctx: t } = this._processInputParams(e);
2799
2805
  if (t.parsedType !== p.object)
@@ -2837,7 +2843,7 @@ class dt extends x {
2837
2843
  static create(e, t, s) {
2838
2844
  const n = /* @__PURE__ */ new Map();
2839
2845
  for (const a of t) {
2840
- const i = se(a.shape[e]);
2846
+ const i = ae(a.shape[e]);
2841
2847
  if (!i.length)
2842
2848
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2843
2849
  for (const o of i) {
@@ -2846,22 +2852,22 @@ class dt extends x {
2846
2852
  n.set(o, a);
2847
2853
  }
2848
2854
  }
2849
- return new dt(d({
2855
+ return new ut(u({
2850
2856
  typeName: y.ZodDiscriminatedUnion,
2851
2857
  discriminator: e,
2852
2858
  options: t,
2853
2859
  optionsMap: n
2854
- }, w(s)));
2860
+ }, b(s)));
2855
2861
  }
2856
2862
  }
2857
- function Ot(r, e) {
2858
- const t = ne(r), s = ne(e);
2863
+ function Nt(r, e) {
2864
+ const t = ie(r), s = ie(e);
2859
2865
  if (r === e)
2860
2866
  return { valid: !0, data: r };
2861
2867
  if (t === p.object && s === p.object) {
2862
- const n = k.objectKeys(e), a = k.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = d(d({}, r), e);
2868
+ const n = x.objectKeys(e), a = x.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = u(u({}, r), e);
2863
2869
  for (const o of a) {
2864
- const c = Ot(r[o], e[o]);
2870
+ const c = Nt(r[o], e[o]);
2865
2871
  if (!c.valid)
2866
2872
  return { valid: !1 };
2867
2873
  i[o] = c.data;
@@ -2872,7 +2878,7 @@ function Ot(r, e) {
2872
2878
  return { valid: !1 };
2873
2879
  const n = [];
2874
2880
  for (let a = 0; a < r.length; a++) {
2875
- const i = r[a], o = e[a], c = Ot(i, o);
2881
+ const i = r[a], o = e[a], c = Nt(i, o);
2876
2882
  if (!c.valid)
2877
2883
  return { valid: !1 };
2878
2884
  n.push(c.data);
@@ -2880,12 +2886,12 @@ function Ot(r, e) {
2880
2886
  return { valid: !0, data: n };
2881
2887
  } else return t === p.date && s === p.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
2882
2888
  }
2883
- class De extends x {
2889
+ class Ue extends w {
2884
2890
  _parse(e) {
2885
2891
  const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
2886
- if (Et(a) || Et(i))
2892
+ if (Ot(a) || Ot(i))
2887
2893
  return _;
2888
- const o = Ot(a.value, i.value);
2894
+ const o = Nt(a.value, i.value);
2889
2895
  return o.valid ? ((Ct(a) || Ct(i)) && t.dirty(), { status: t.value, value: o.data }) : (h(s, {
2890
2896
  code: l.invalid_intersection_types
2891
2897
  }), _);
@@ -2912,12 +2918,12 @@ class De extends x {
2912
2918
  }));
2913
2919
  }
2914
2920
  }
2915
- De.create = (r, e, t) => new De(d({
2921
+ Ue.create = (r, e, t) => new Ue(u({
2916
2922
  left: r,
2917
2923
  right: e,
2918
2924
  typeName: y.ZodIntersection
2919
- }, w(t)));
2920
- class ee extends x {
2925
+ }, b(t)));
2926
+ class re extends w {
2921
2927
  _parse(e) {
2922
2928
  const { status: t, ctx: s } = this._processInputParams(e);
2923
2929
  if (s.parsedType !== p.array)
@@ -2943,29 +2949,29 @@ class ee extends x {
2943
2949
  }), t.dirty());
2944
2950
  const a = [...s.data].map((i, o) => {
2945
2951
  const c = this._def.items[o] || this._def.rest;
2946
- return c ? c._parse(new Q(s, i, s.path, o)) : null;
2952
+ return c ? c._parse(new te(s, i, s.path, o)) : null;
2947
2953
  }).filter((i) => !!i);
2948
- return s.common.async ? Promise.all(a).then((i) => j.mergeArray(t, i)) : j.mergeArray(t, a);
2954
+ return s.common.async ? Promise.all(a).then((i) => R.mergeArray(t, i)) : R.mergeArray(t, a);
2949
2955
  }
2950
2956
  get items() {
2951
2957
  return this._def.items;
2952
2958
  }
2953
2959
  rest(e) {
2954
- return new ee(g(d({}, this._def), {
2960
+ return new re(g(u({}, this._def), {
2955
2961
  rest: e
2956
2962
  }));
2957
2963
  }
2958
2964
  }
2959
- ee.create = (r, e) => {
2965
+ re.create = (r, e) => {
2960
2966
  if (!Array.isArray(r))
2961
2967
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2962
- return new ee(d({
2968
+ return new re(u({
2963
2969
  items: r,
2964
2970
  typeName: y.ZodTuple,
2965
2971
  rest: null
2966
- }, w(e)));
2972
+ }, b(e)));
2967
2973
  };
2968
- class Ue extends x {
2974
+ class ze extends w {
2969
2975
  get keySchema() {
2970
2976
  return this._def.keyType;
2971
2977
  }
@@ -2983,28 +2989,28 @@ class Ue extends x {
2983
2989
  const n = [], a = this._def.keyType, i = this._def.valueType;
2984
2990
  for (const o in s.data)
2985
2991
  n.push({
2986
- key: a._parse(new Q(s, o, s.path, o)),
2987
- value: i._parse(new Q(s, s.data[o], s.path, o)),
2992
+ key: a._parse(new te(s, o, s.path, o)),
2993
+ value: i._parse(new te(s, s.data[o], s.path, o)),
2988
2994
  alwaysSet: o in s.data
2989
2995
  });
2990
- return s.common.async ? j.mergeObjectAsync(t, n) : j.mergeObjectSync(t, n);
2996
+ return s.common.async ? R.mergeObjectAsync(t, n) : R.mergeObjectSync(t, n);
2991
2997
  }
2992
2998
  get element() {
2993
2999
  return this._def.valueType;
2994
3000
  }
2995
3001
  static create(e, t, s) {
2996
- return t instanceof x ? new Ue(d({
3002
+ return t instanceof w ? new ze(u({
2997
3003
  keyType: e,
2998
3004
  valueType: t,
2999
3005
  typeName: y.ZodRecord
3000
- }, w(s))) : new Ue(d({
3001
- keyType: q.create(),
3006
+ }, b(s))) : new ze(u({
3007
+ keyType: H.create(),
3002
3008
  valueType: e,
3003
3009
  typeName: y.ZodRecord
3004
- }, w(t)));
3010
+ }, b(t)));
3005
3011
  }
3006
3012
  }
3007
- class ot extends x {
3013
+ class ct extends w {
3008
3014
  get keySchema() {
3009
3015
  return this._def.keyType;
3010
3016
  }
@@ -3019,39 +3025,39 @@ class ot extends x {
3019
3025
  expected: p.map,
3020
3026
  received: s.parsedType
3021
3027
  }), _;
3022
- const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
3023
- key: n._parse(new Q(s, o, s.path, [u, "key"])),
3024
- value: a._parse(new Q(s, c, s.path, [u, "value"]))
3028
+ const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], d) => ({
3029
+ key: n._parse(new te(s, o, s.path, [d, "key"])),
3030
+ value: a._parse(new te(s, c, s.path, [d, "value"]))
3025
3031
  }));
3026
3032
  if (s.common.async) {
3027
3033
  const o = /* @__PURE__ */ new Map();
3028
3034
  return Promise.resolve().then(() => C(this, null, function* () {
3029
3035
  for (const c of i) {
3030
- const u = yield c.key, f = yield c.value;
3031
- if (u.status === "aborted" || f.status === "aborted")
3036
+ const d = yield c.key, f = yield c.value;
3037
+ if (d.status === "aborted" || f.status === "aborted")
3032
3038
  return _;
3033
- (u.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(u.value, f.value);
3039
+ (d.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(d.value, f.value);
3034
3040
  }
3035
3041
  return { status: t.value, value: o };
3036
3042
  }));
3037
3043
  } else {
3038
3044
  const o = /* @__PURE__ */ new Map();
3039
3045
  for (const c of i) {
3040
- const u = c.key, f = c.value;
3041
- if (u.status === "aborted" || f.status === "aborted")
3046
+ const d = c.key, f = c.value;
3047
+ if (d.status === "aborted" || f.status === "aborted")
3042
3048
  return _;
3043
- (u.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(u.value, f.value);
3049
+ (d.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(d.value, f.value);
3044
3050
  }
3045
3051
  return { status: t.value, value: o };
3046
3052
  }
3047
3053
  }
3048
3054
  }
3049
- ot.create = (r, e, t) => new ot(d({
3055
+ ct.create = (r, e, t) => new ct(u({
3050
3056
  valueType: e,
3051
3057
  keyType: r,
3052
3058
  typeName: y.ZodMap
3053
- }, w(t)));
3054
- class _e extends x {
3059
+ }, b(t)));
3060
+ class we extends w {
3055
3061
  _parse(e) {
3056
3062
  const { status: t, ctx: s } = this._processInputParams(e);
3057
3063
  if (s.parsedType !== p.set)
@@ -3078,24 +3084,24 @@ class _e extends x {
3078
3084
  }), t.dirty());
3079
3085
  const a = this._def.valueType;
3080
3086
  function i(c) {
3081
- const u = /* @__PURE__ */ new Set();
3087
+ const d = /* @__PURE__ */ new Set();
3082
3088
  for (const f of c) {
3083
3089
  if (f.status === "aborted")
3084
3090
  return _;
3085
- f.status === "dirty" && t.dirty(), u.add(f.value);
3091
+ f.status === "dirty" && t.dirty(), d.add(f.value);
3086
3092
  }
3087
- return { status: t.value, value: u };
3093
+ return { status: t.value, value: d };
3088
3094
  }
3089
- const o = [...s.data.values()].map((c, u) => a._parse(new Q(s, c, s.path, u)));
3095
+ const o = [...s.data.values()].map((c, d) => a._parse(new te(s, c, s.path, d)));
3090
3096
  return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
3091
3097
  }
3092
3098
  min(e, t) {
3093
- return new _e(g(d({}, this._def), {
3099
+ return new we(g(u({}, this._def), {
3094
3100
  minSize: { value: e, message: m.toString(t) }
3095
3101
  }));
3096
3102
  }
3097
3103
  max(e, t) {
3098
- return new _e(g(d({}, this._def), {
3104
+ return new we(g(u({}, this._def), {
3099
3105
  maxSize: { value: e, message: m.toString(t) }
3100
3106
  }));
3101
3107
  }
@@ -3106,13 +3112,13 @@ class _e extends x {
3106
3112
  return this.min(1, e);
3107
3113
  }
3108
3114
  }
3109
- _e.create = (r, e) => new _e(d({
3115
+ we.create = (r, e) => new we(u({
3110
3116
  valueType: r,
3111
3117
  minSize: null,
3112
3118
  maxSize: null,
3113
3119
  typeName: y.ZodSet
3114
- }, w(e)));
3115
- class Te extends x {
3120
+ }, b(e)));
3121
+ class Se extends w {
3116
3122
  constructor() {
3117
3123
  super(...arguments), this.validate = this.implement;
3118
3124
  }
@@ -3125,15 +3131,15 @@ class Te extends x {
3125
3131
  received: t.parsedType
3126
3132
  }), _;
3127
3133
  function s(o, c) {
3128
- return st({
3134
+ return nt({
3129
3135
  data: o,
3130
3136
  path: t.path,
3131
3137
  errorMaps: [
3132
3138
  t.common.contextualErrorMap,
3133
3139
  t.schemaErrorMap,
3134
- rt(),
3140
+ st(),
3135
3141
  Ae
3136
- ].filter((u) => !!u),
3142
+ ].filter((d) => !!d),
3137
3143
  issueData: {
3138
3144
  code: l.invalid_arguments,
3139
3145
  argumentsError: c
@@ -3141,15 +3147,15 @@ class Te extends x {
3141
3147
  });
3142
3148
  }
3143
3149
  function n(o, c) {
3144
- return st({
3150
+ return nt({
3145
3151
  data: o,
3146
3152
  path: t.path,
3147
3153
  errorMaps: [
3148
3154
  t.common.contextualErrorMap,
3149
3155
  t.schemaErrorMap,
3150
- rt(),
3156
+ st(),
3151
3157
  Ae
3152
- ].filter((u) => !!u),
3158
+ ].filter((d) => !!d),
3153
3159
  issueData: {
3154
3160
  code: l.invalid_return_type,
3155
3161
  returnTypeError: c
@@ -3159,23 +3165,23 @@ class Te extends x {
3159
3165
  const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
3160
3166
  if (this._def.returns instanceof Ce) {
3161
3167
  const o = this;
3162
- return F(function(...c) {
3168
+ return $(function(...c) {
3163
3169
  return C(this, null, function* () {
3164
- const u = new z([]), f = yield o._def.args.parseAsync(c, a).catch((R) => {
3165
- throw u.addIssue(s(c, R)), u;
3170
+ const d = new z([]), f = yield o._def.args.parseAsync(c, a).catch((Z) => {
3171
+ throw d.addIssue(s(c, Z)), d;
3166
3172
  }), v = yield Reflect.apply(i, this, f);
3167
- return yield o._def.returns._def.type.parseAsync(v, a).catch((R) => {
3168
- throw u.addIssue(n(v, R)), u;
3173
+ return yield o._def.returns._def.type.parseAsync(v, a).catch((Z) => {
3174
+ throw d.addIssue(n(v, Z)), d;
3169
3175
  });
3170
3176
  });
3171
3177
  });
3172
3178
  } else {
3173
3179
  const o = this;
3174
- return F(function(...c) {
3175
- const u = o._def.args.safeParse(c, a);
3176
- if (!u.success)
3177
- throw new z([s(c, u.error)]);
3178
- const f = Reflect.apply(i, this, u.data), v = o._def.returns.safeParse(f, a);
3180
+ return $(function(...c) {
3181
+ const d = o._def.args.safeParse(c, a);
3182
+ if (!d.success)
3183
+ throw new z([s(c, d.error)]);
3184
+ const f = Reflect.apply(i, this, d.data), v = o._def.returns.safeParse(f, a);
3179
3185
  if (!v.success)
3180
3186
  throw new z([n(f, v.error)]);
3181
3187
  return v.data;
@@ -3189,12 +3195,12 @@ class Te extends x {
3189
3195
  return this._def.returns;
3190
3196
  }
3191
3197
  args(...e) {
3192
- return new Te(g(d({}, this._def), {
3193
- args: ee.create(e).rest(ge.create())
3198
+ return new Se(g(u({}, this._def), {
3199
+ args: re.create(e).rest(ve.create())
3194
3200
  }));
3195
3201
  }
3196
3202
  returns(e) {
3197
- return new Te(g(d({}, this._def), {
3203
+ return new Se(g(u({}, this._def), {
3198
3204
  returns: e
3199
3205
  }));
3200
3206
  }
@@ -3205,14 +3211,14 @@ class Te extends x {
3205
3211
  return this.parse(e);
3206
3212
  }
3207
3213
  static create(e, t, s) {
3208
- return new Te(d({
3209
- args: e || ee.create([]).rest(ge.create()),
3210
- returns: t || ge.create(),
3214
+ return new Se(u({
3215
+ args: e || re.create([]).rest(ve.create()),
3216
+ returns: t || ve.create(),
3211
3217
  typeName: y.ZodFunction
3212
- }, w(s)));
3218
+ }, b(s)));
3213
3219
  }
3214
3220
  }
3215
- class ze extends x {
3221
+ class We extends w {
3216
3222
  get schema() {
3217
3223
  return this._def.getter();
3218
3224
  }
@@ -3221,11 +3227,11 @@ class ze extends x {
3221
3227
  return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
3222
3228
  }
3223
3229
  }
3224
- ze.create = (r, e) => new ze(d({
3230
+ We.create = (r, e) => new We(u({
3225
3231
  getter: r,
3226
3232
  typeName: y.ZodLazy
3227
- }, w(e)));
3228
- class We extends x {
3233
+ }, b(e)));
3234
+ class Be extends w {
3229
3235
  _parse(e) {
3230
3236
  if (e.data !== this._def.value) {
3231
3237
  const t = this._getOrReturnCtx(e);
@@ -3241,30 +3247,30 @@ class We extends x {
3241
3247
  return this._def.value;
3242
3248
  }
3243
3249
  }
3244
- We.create = (r, e) => new We(d({
3250
+ Be.create = (r, e) => new Be(u({
3245
3251
  value: r,
3246
3252
  typeName: y.ZodLiteral
3247
- }, w(e)));
3253
+ }, b(e)));
3248
3254
  function pr(r, e) {
3249
- return new le(d({
3255
+ return new he(u({
3250
3256
  values: r,
3251
3257
  typeName: y.ZodEnum
3252
- }, w(e)));
3258
+ }, b(e)));
3253
3259
  }
3254
- class le extends x {
3260
+ class he extends w {
3255
3261
  constructor() {
3256
- super(...arguments), Ze.set(this, void 0);
3262
+ super(...arguments), Me.set(this, void 0);
3257
3263
  }
3258
3264
  _parse(e) {
3259
3265
  if (typeof e.data != "string") {
3260
3266
  const t = this._getOrReturnCtx(e), s = this._def.values;
3261
3267
  return h(t, {
3262
- expected: k.joinValues(s),
3268
+ expected: x.joinValues(s),
3263
3269
  received: t.parsedType,
3264
3270
  code: l.invalid_type
3265
3271
  }), _;
3266
3272
  }
3267
- if (nt(this, Ze) || ur(this, Ze, new Set(this._def.values)), !nt(this, Ze).has(e.data)) {
3273
+ if (at(this, Me) || ur(this, Me, new Set(this._def.values)), !at(this, Me).has(e.data)) {
3268
3274
  const t = this._getOrReturnCtx(e), s = this._def.values;
3269
3275
  return h(t, {
3270
3276
  received: t.data,
@@ -3272,7 +3278,7 @@ class le extends x {
3272
3278
  options: s
3273
3279
  }), _;
3274
3280
  }
3275
- return F(e.data);
3281
+ return $(e.data);
3276
3282
  }
3277
3283
  get options() {
3278
3284
  return this._def.values;
@@ -3296,48 +3302,48 @@ class le extends x {
3296
3302
  return e;
3297
3303
  }
3298
3304
  extract(e, t = this._def) {
3299
- return le.create(e, d(d({}, this._def), t));
3305
+ return he.create(e, u(u({}, this._def), t));
3300
3306
  }
3301
3307
  exclude(e, t = this._def) {
3302
- return le.create(this.options.filter((s) => !e.includes(s)), d(d({}, this._def), t));
3308
+ return he.create(this.options.filter((s) => !e.includes(s)), u(u({}, this._def), t));
3303
3309
  }
3304
3310
  }
3305
- Ze = /* @__PURE__ */ new WeakMap();
3306
- le.create = pr;
3307
- class Be extends x {
3311
+ Me = /* @__PURE__ */ new WeakMap();
3312
+ he.create = pr;
3313
+ class qe extends w {
3308
3314
  constructor() {
3309
- super(...arguments), Me.set(this, void 0);
3315
+ super(...arguments), Pe.set(this, void 0);
3310
3316
  }
3311
3317
  _parse(e) {
3312
- const t = k.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
3318
+ const t = x.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
3313
3319
  if (s.parsedType !== p.string && s.parsedType !== p.number) {
3314
- const n = k.objectValues(t);
3320
+ const n = x.objectValues(t);
3315
3321
  return h(s, {
3316
- expected: k.joinValues(n),
3322
+ expected: x.joinValues(n),
3317
3323
  received: s.parsedType,
3318
3324
  code: l.invalid_type
3319
3325
  }), _;
3320
3326
  }
3321
- if (nt(this, Me) || ur(this, Me, new Set(k.getValidEnumValues(this._def.values))), !nt(this, Me).has(e.data)) {
3322
- const n = k.objectValues(t);
3327
+ if (at(this, Pe) || ur(this, Pe, new Set(x.getValidEnumValues(this._def.values))), !at(this, Pe).has(e.data)) {
3328
+ const n = x.objectValues(t);
3323
3329
  return h(s, {
3324
3330
  received: s.data,
3325
3331
  code: l.invalid_enum_value,
3326
3332
  options: n
3327
3333
  }), _;
3328
3334
  }
3329
- return F(e.data);
3335
+ return $(e.data);
3330
3336
  }
3331
3337
  get enum() {
3332
3338
  return this._def.values;
3333
3339
  }
3334
3340
  }
3335
- Me = /* @__PURE__ */ new WeakMap();
3336
- Be.create = (r, e) => new Be(d({
3341
+ Pe = /* @__PURE__ */ new WeakMap();
3342
+ qe.create = (r, e) => new qe(u({
3337
3343
  values: r,
3338
3344
  typeName: y.ZodNativeEnum
3339
- }, w(e)));
3340
- class Ce extends x {
3345
+ }, b(e)));
3346
+ class Ce extends w {
3341
3347
  unwrap() {
3342
3348
  return this._def.type;
3343
3349
  }
@@ -3350,17 +3356,17 @@ class Ce extends x {
3350
3356
  received: t.parsedType
3351
3357
  }), _;
3352
3358
  const s = t.parsedType === p.promise ? t.data : Promise.resolve(t.data);
3353
- return F(s.then((n) => this._def.type.parseAsync(n, {
3359
+ return $(s.then((n) => this._def.type.parseAsync(n, {
3354
3360
  path: t.path,
3355
3361
  errorMap: t.common.contextualErrorMap
3356
3362
  })));
3357
3363
  }
3358
3364
  }
3359
- Ce.create = (r, e) => new Ce(d({
3365
+ Ce.create = (r, e) => new Ce(u({
3360
3366
  type: r,
3361
3367
  typeName: y.ZodPromise
3362
- }, w(e)));
3363
- class J extends x {
3368
+ }, b(e)));
3369
+ class G extends w {
3364
3370
  innerType() {
3365
3371
  return this._def.schema;
3366
3372
  }
@@ -3387,7 +3393,7 @@ class J extends x {
3387
3393
  path: s.path,
3388
3394
  parent: s
3389
3395
  });
3390
- return c.status === "aborted" ? _ : c.status === "dirty" || t.value === "dirty" ? ke(c.value) : c;
3396
+ return c.status === "aborted" ? _ : c.status === "dirty" || t.value === "dirty" ? Te(c.value) : c;
3391
3397
  }));
3392
3398
  {
3393
3399
  if (t.value === "aborted")
@@ -3397,7 +3403,7 @@ class J extends x {
3397
3403
  path: s.path,
3398
3404
  parent: s
3399
3405
  });
3400
- return o.status === "aborted" ? _ : o.status === "dirty" || t.value === "dirty" ? ke(o.value) : o;
3406
+ return o.status === "aborted" ? _ : o.status === "dirty" || t.value === "dirty" ? Te(o.value) : o;
3401
3407
  }
3402
3408
  }
3403
3409
  if (n.type === "refinement") {
@@ -3426,52 +3432,52 @@ class J extends x {
3426
3432
  path: s.path,
3427
3433
  parent: s
3428
3434
  });
3429
- if (!ye(i))
3435
+ if (!_e(i))
3430
3436
  return i;
3431
3437
  const o = n.transform(i.value, a);
3432
3438
  if (o instanceof Promise)
3433
3439
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
3434
3440
  return { status: t.value, value: o };
3435
3441
  } else
3436
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => ye(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
3437
- k.assertNever(n);
3442
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => _e(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
3443
+ x.assertNever(n);
3438
3444
  }
3439
3445
  }
3440
- J.create = (r, e, t) => new J(d({
3446
+ G.create = (r, e, t) => new G(u({
3441
3447
  schema: r,
3442
3448
  typeName: y.ZodEffects,
3443
3449
  effect: e
3444
- }, w(t)));
3445
- J.createWithPreprocess = (r, e, t) => new J(d({
3450
+ }, b(t)));
3451
+ G.createWithPreprocess = (r, e, t) => new G(u({
3446
3452
  schema: e,
3447
3453
  effect: { type: "preprocess", transform: r },
3448
3454
  typeName: y.ZodEffects
3449
- }, w(t)));
3450
- class Y extends x {
3455
+ }, b(t)));
3456
+ class ee extends w {
3451
3457
  _parse(e) {
3452
- return this._getType(e) === p.undefined ? F(void 0) : this._def.innerType._parse(e);
3458
+ return this._getType(e) === p.undefined ? $(void 0) : this._def.innerType._parse(e);
3453
3459
  }
3454
3460
  unwrap() {
3455
3461
  return this._def.innerType;
3456
3462
  }
3457
3463
  }
3458
- Y.create = (r, e) => new Y(d({
3464
+ ee.create = (r, e) => new ee(u({
3459
3465
  innerType: r,
3460
3466
  typeName: y.ZodOptional
3461
- }, w(e)));
3462
- class fe extends x {
3467
+ }, b(e)));
3468
+ class pe extends w {
3463
3469
  _parse(e) {
3464
- return this._getType(e) === p.null ? F(null) : this._def.innerType._parse(e);
3470
+ return this._getType(e) === p.null ? $(null) : this._def.innerType._parse(e);
3465
3471
  }
3466
3472
  unwrap() {
3467
3473
  return this._def.innerType;
3468
3474
  }
3469
3475
  }
3470
- fe.create = (r, e) => new fe(d({
3476
+ pe.create = (r, e) => new pe(u({
3471
3477
  innerType: r,
3472
3478
  typeName: y.ZodNullable
3473
- }, w(e)));
3474
- class qe extends x {
3479
+ }, b(e)));
3480
+ class He extends w {
3475
3481
  _parse(e) {
3476
3482
  const { ctx: t } = this._processInputParams(e);
3477
3483
  let s = t.data;
@@ -3485,23 +3491,23 @@ class qe extends x {
3485
3491
  return this._def.innerType;
3486
3492
  }
3487
3493
  }
3488
- qe.create = (r, e) => new qe(d({
3494
+ He.create = (r, e) => new He(u({
3489
3495
  innerType: r,
3490
3496
  typeName: y.ZodDefault,
3491
3497
  defaultValue: typeof e.default == "function" ? e.default : () => e.default
3492
- }, w(e)));
3493
- class He extends x {
3498
+ }, b(e)));
3499
+ class Je extends w {
3494
3500
  _parse(e) {
3495
- const { ctx: t } = this._processInputParams(e), s = g(d({}, t), {
3496
- common: g(d({}, t.common), {
3501
+ const { ctx: t } = this._processInputParams(e), s = g(u({}, t), {
3502
+ common: g(u({}, t.common), {
3497
3503
  issues: []
3498
3504
  })
3499
3505
  }), n = this._def.innerType._parse({
3500
3506
  data: s.data,
3501
3507
  path: s.path,
3502
- parent: d({}, s)
3508
+ parent: u({}, s)
3503
3509
  });
3504
- return Pe(n) ? n.then((a) => ({
3510
+ return $e(n) ? n.then((a) => ({
3505
3511
  status: "valid",
3506
3512
  value: a.status === "valid" ? a.value : this._def.catchValue({
3507
3513
  get error() {
@@ -3523,12 +3529,12 @@ class He extends x {
3523
3529
  return this._def.innerType;
3524
3530
  }
3525
3531
  }
3526
- He.create = (r, e) => new He(d({
3532
+ Je.create = (r, e) => new Je(u({
3527
3533
  innerType: r,
3528
3534
  typeName: y.ZodCatch,
3529
3535
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
3530
- }, w(e)));
3531
- class ct extends x {
3536
+ }, b(e)));
3537
+ class dt extends w {
3532
3538
  _parse(e) {
3533
3539
  if (this._getType(e) !== p.nan) {
3534
3540
  const s = this._getOrReturnCtx(e);
@@ -3541,11 +3547,11 @@ class ct extends x {
3541
3547
  return { status: "valid", value: e.data };
3542
3548
  }
3543
3549
  }
3544
- ct.create = (r) => new ct(d({
3550
+ dt.create = (r) => new dt(u({
3545
3551
  typeName: y.ZodNaN
3546
- }, w(r)));
3552
+ }, b(r)));
3547
3553
  const tn = Symbol("zod_brand");
3548
- class Zt extends x {
3554
+ class Mt extends w {
3549
3555
  _parse(e) {
3550
3556
  const { ctx: t } = this._processInputParams(e), s = t.data;
3551
3557
  return this._def.type._parse({
@@ -3558,7 +3564,7 @@ class Zt extends x {
3558
3564
  return this._def.type;
3559
3565
  }
3560
3566
  }
3561
- class Ke extends x {
3567
+ class Xe extends w {
3562
3568
  _parse(e) {
3563
3569
  const { status: t, ctx: s } = this._processInputParams(e);
3564
3570
  if (s.common.async)
@@ -3568,7 +3574,7 @@ class Ke extends x {
3568
3574
  path: s.path,
3569
3575
  parent: s
3570
3576
  });
3571
- return a.status === "aborted" ? _ : a.status === "dirty" ? (t.dirty(), ke(a.value)) : this._def.out._parseAsync({
3577
+ return a.status === "aborted" ? _ : a.status === "dirty" ? (t.dirty(), Te(a.value)) : this._def.out._parseAsync({
3572
3578
  data: a.value,
3573
3579
  path: s.path,
3574
3580
  parent: s
@@ -3591,50 +3597,50 @@ class Ke extends x {
3591
3597
  }
3592
3598
  }
3593
3599
  static create(e, t) {
3594
- return new Ke({
3600
+ return new Xe({
3595
3601
  in: e,
3596
3602
  out: t,
3597
3603
  typeName: y.ZodPipeline
3598
3604
  });
3599
3605
  }
3600
3606
  }
3601
- class Je extends x {
3607
+ class Ge extends w {
3602
3608
  _parse(e) {
3603
- const t = this._def.innerType._parse(e), s = (n) => (ye(n) && (n.value = Object.freeze(n.value)), n);
3604
- return Pe(t) ? t.then((n) => s(n)) : s(t);
3609
+ const t = this._def.innerType._parse(e), s = (n) => (_e(n) && (n.value = Object.freeze(n.value)), n);
3610
+ return $e(t) ? t.then((n) => s(n)) : s(t);
3605
3611
  }
3606
3612
  unwrap() {
3607
3613
  return this._def.innerType;
3608
3614
  }
3609
3615
  }
3610
- Je.create = (r, e) => new Je(d({
3616
+ Ge.create = (r, e) => new Ge(u({
3611
3617
  innerType: r,
3612
3618
  typeName: y.ZodReadonly
3613
- }, w(e)));
3619
+ }, b(e)));
3614
3620
  function Jt(r, e) {
3615
3621
  const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
3616
3622
  return typeof t == "string" ? { message: t } : t;
3617
3623
  }
3618
3624
  function mr(r, e = {}, t) {
3619
- return r ? Ee.create().superRefine((s, n) => {
3625
+ return r ? Oe.create().superRefine((s, n) => {
3620
3626
  var a, i;
3621
3627
  const o = r(s);
3622
3628
  if (o instanceof Promise)
3623
3629
  return o.then((c) => {
3624
- var u, f;
3630
+ var d, f;
3625
3631
  if (!c) {
3626
- const v = Jt(e, s), O = (f = (u = v.fatal) !== null && u !== void 0 ? u : t) !== null && f !== void 0 ? f : !0;
3627
- n.addIssue(g(d({ code: "custom" }, v), { fatal: O }));
3632
+ const v = Jt(e, s), N = (f = (d = v.fatal) !== null && d !== void 0 ? d : t) !== null && f !== void 0 ? f : !0;
3633
+ n.addIssue(g(u({ code: "custom" }, v), { fatal: N }));
3628
3634
  }
3629
3635
  });
3630
3636
  if (!o) {
3631
- const c = Jt(e, s), u = (i = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
3632
- n.addIssue(g(d({ code: "custom" }, c), { fatal: u }));
3637
+ const c = Jt(e, s), d = (i = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
3638
+ n.addIssue(g(u({ code: "custom" }, c), { fatal: d }));
3633
3639
  }
3634
- }) : Ee.create();
3640
+ }) : Oe.create();
3635
3641
  }
3636
3642
  const rn = {
3637
- object: A.lazycreate
3643
+ object: E.lazycreate
3638
3644
  };
3639
3645
  var y;
3640
3646
  (function(r) {
@@ -3642,82 +3648,82 @@ var y;
3642
3648
  })(y || (y = {}));
3643
3649
  const sn = (r, e = {
3644
3650
  message: `Input not instance of ${r.name}`
3645
- }) => mr((t) => t instanceof r, e), gr = q.create, yr = de.create, nn = ct.create, an = ue.create, vr = $e.create, on = ve.create, cn = at.create, dn = Fe.create, un = Le.create, ln = Ee.create, fn = ge.create, hn = ae.create, pn = it.create, mn = H.create, gn = A.create, yn = A.strictCreate, vn = Ve.create, _n = dt.create, bn = De.create, wn = ee.create, xn = Ue.create, kn = ot.create, Tn = _e.create, Sn = Te.create, An = ze.create, En = We.create, Cn = le.create, On = Be.create, Nn = Ce.create, Gt = J.create, In = Y.create, jn = fe.create, Rn = J.createWithPreprocess, Zn = Ke.create, Mn = () => gr().optional(), Pn = () => yr().optional(), $n = () => vr().optional(), Fn = {
3646
- string: (r) => q.create(g(d({}, r), { coerce: !0 })),
3647
- number: (r) => de.create(g(d({}, r), { coerce: !0 })),
3648
- boolean: (r) => $e.create(g(d({}, r), {
3651
+ }) => mr((t) => t instanceof r, e), gr = H.create, yr = le.create, nn = dt.create, an = fe.create, vr = Fe.create, on = be.create, cn = it.create, dn = Le.create, un = Ve.create, ln = Oe.create, fn = ve.create, hn = oe.create, pn = ot.create, mn = J.create, gn = E.create, yn = E.strictCreate, vn = De.create, _n = ut.create, bn = Ue.create, wn = re.create, xn = ze.create, kn = ct.create, Tn = we.create, Sn = Se.create, En = We.create, An = Be.create, On = he.create, Cn = qe.create, Nn = Ce.create, Gt = G.create, In = ee.create, jn = pe.create, Rn = G.createWithPreprocess, Zn = Xe.create, Mn = () => gr().optional(), Pn = () => yr().optional(), $n = () => vr().optional(), Fn = {
3652
+ string: (r) => H.create(g(u({}, r), { coerce: !0 })),
3653
+ number: (r) => le.create(g(u({}, r), { coerce: !0 })),
3654
+ boolean: (r) => Fe.create(g(u({}, r), {
3649
3655
  coerce: !0
3650
3656
  })),
3651
- bigint: (r) => ue.create(g(d({}, r), { coerce: !0 })),
3652
- date: (r) => ve.create(g(d({}, r), { coerce: !0 }))
3657
+ bigint: (r) => fe.create(g(u({}, r), { coerce: !0 })),
3658
+ date: (r) => be.create(g(u({}, r), { coerce: !0 }))
3653
3659
  }, Ln = _;
3654
3660
  var S = /* @__PURE__ */ Object.freeze({
3655
3661
  __proto__: null,
3656
3662
  defaultErrorMap: Ae,
3657
3663
  setErrorMap: js,
3658
- getErrorMap: rt,
3659
- makeIssue: st,
3664
+ getErrorMap: st,
3665
+ makeIssue: nt,
3660
3666
  EMPTY_PATH: Rs,
3661
3667
  addIssueToContext: h,
3662
- ParseStatus: j,
3668
+ ParseStatus: R,
3663
3669
  INVALID: _,
3664
- DIRTY: ke,
3665
- OK: F,
3666
- isAborted: Et,
3670
+ DIRTY: Te,
3671
+ OK: $,
3672
+ isAborted: Ot,
3667
3673
  isDirty: Ct,
3668
- isValid: ye,
3669
- isAsync: Pe,
3674
+ isValid: _e,
3675
+ isAsync: $e,
3670
3676
  get util() {
3671
- return k;
3677
+ return x;
3672
3678
  },
3673
3679
  get objectUtil() {
3674
3680
  return At;
3675
3681
  },
3676
3682
  ZodParsedType: p,
3677
- getParsedType: ne,
3678
- ZodType: x,
3683
+ getParsedType: ie,
3684
+ ZodType: w,
3679
3685
  datetimeRegex: hr,
3680
- ZodString: q,
3681
- ZodNumber: de,
3682
- ZodBigInt: ue,
3683
- ZodBoolean: $e,
3684
- ZodDate: ve,
3685
- ZodSymbol: at,
3686
- ZodUndefined: Fe,
3687
- ZodNull: Le,
3688
- ZodAny: Ee,
3689
- ZodUnknown: ge,
3690
- ZodNever: ae,
3691
- ZodVoid: it,
3692
- ZodArray: H,
3693
- ZodObject: A,
3694
- ZodUnion: Ve,
3695
- ZodDiscriminatedUnion: dt,
3696
- ZodIntersection: De,
3697
- ZodTuple: ee,
3698
- ZodRecord: Ue,
3699
- ZodMap: ot,
3700
- ZodSet: _e,
3701
- ZodFunction: Te,
3702
- ZodLazy: ze,
3703
- ZodLiteral: We,
3704
- ZodEnum: le,
3705
- ZodNativeEnum: Be,
3686
+ ZodString: H,
3687
+ ZodNumber: le,
3688
+ ZodBigInt: fe,
3689
+ ZodBoolean: Fe,
3690
+ ZodDate: be,
3691
+ ZodSymbol: it,
3692
+ ZodUndefined: Le,
3693
+ ZodNull: Ve,
3694
+ ZodAny: Oe,
3695
+ ZodUnknown: ve,
3696
+ ZodNever: oe,
3697
+ ZodVoid: ot,
3698
+ ZodArray: J,
3699
+ ZodObject: E,
3700
+ ZodUnion: De,
3701
+ ZodDiscriminatedUnion: ut,
3702
+ ZodIntersection: Ue,
3703
+ ZodTuple: re,
3704
+ ZodRecord: ze,
3705
+ ZodMap: ct,
3706
+ ZodSet: we,
3707
+ ZodFunction: Se,
3708
+ ZodLazy: We,
3709
+ ZodLiteral: Be,
3710
+ ZodEnum: he,
3711
+ ZodNativeEnum: qe,
3706
3712
  ZodPromise: Ce,
3707
- ZodEffects: J,
3708
- ZodTransformer: J,
3709
- ZodOptional: Y,
3710
- ZodNullable: fe,
3711
- ZodDefault: qe,
3712
- ZodCatch: He,
3713
- ZodNaN: ct,
3713
+ ZodEffects: G,
3714
+ ZodTransformer: G,
3715
+ ZodOptional: ee,
3716
+ ZodNullable: pe,
3717
+ ZodDefault: He,
3718
+ ZodCatch: Je,
3719
+ ZodNaN: dt,
3714
3720
  BRAND: tn,
3715
- ZodBranded: Zt,
3716
- ZodPipeline: Ke,
3717
- ZodReadonly: Je,
3721
+ ZodBranded: Mt,
3722
+ ZodPipeline: Xe,
3723
+ ZodReadonly: Ge,
3718
3724
  custom: mr,
3719
- Schema: x,
3720
- ZodSchema: x,
3725
+ Schema: w,
3726
+ ZodSchema: w,
3721
3727
  late: rn,
3722
3728
  get ZodFirstPartyTypeKind() {
3723
3729
  return y;
@@ -3730,15 +3736,15 @@ var S = /* @__PURE__ */ Object.freeze({
3730
3736
  date: on,
3731
3737
  discriminatedUnion: _n,
3732
3738
  effect: Gt,
3733
- enum: Cn,
3739
+ enum: On,
3734
3740
  function: Sn,
3735
3741
  instanceof: sn,
3736
3742
  intersection: bn,
3737
- lazy: An,
3738
- literal: En,
3743
+ lazy: En,
3744
+ literal: An,
3739
3745
  map: kn,
3740
3746
  nan: nn,
3741
- nativeEnum: On,
3747
+ nativeEnum: Cn,
3742
3748
  never: hn,
3743
3749
  null: un,
3744
3750
  nullable: jn,
@@ -3850,58 +3856,58 @@ const Vn = S.object({
3850
3856
  reason: "Selected node type is not supported"
3851
3857
  };
3852
3858
  };
3853
- var N, Ge, be, _r, Nt;
3859
+ var I, Ke, xe, _r, It;
3854
3860
  class Yn {
3855
3861
  constructor({
3856
3862
  auth: e,
3857
3863
  apiBaseAddress: t = "https://public-api.animaapp.com"
3858
3864
  } = {}) {
3859
- Xe(this, be);
3860
- Xe(this, N);
3861
- Xe(this, Ge);
3862
- ft(this, Ge, t), e && (this.auth = e);
3865
+ Ye(this, xe);
3866
+ Ye(this, I);
3867
+ Ye(this, Ke);
3868
+ ht(this, Ke, t), e && (this.auth = e);
3863
3869
  }
3864
3870
  hasAuth() {
3865
- return !!P(this, N);
3871
+ return !!M(this, I);
3866
3872
  }
3867
3873
  set auth(e) {
3868
- ft(this, N, e);
3874
+ ht(this, I, e);
3869
3875
  }
3870
3876
  get headers() {
3871
3877
  const e = {
3872
3878
  "Content-Type": "application/json"
3873
3879
  };
3874
- return P(this, N) && (e.Authorization = `Bearer ${P(this, N).token}`, "teamId" in P(this, N) && (e["X-Team-Id"] = P(this, N).teamId)), e;
3875
- }
3876
- generateCode(s) {
3877
- return C(this, arguments, function* (e, t = {}) {
3878
- var o;
3879
- const n = Dn(e.settings);
3880
- e.figmaToken && (yield Ye(this, be, _r).call(this, e.fileKey, e.figmaToken, e.nodesId, { allowAutoSelectFirstNode: (o = n.allowAutoSelectFirstNode) != null ? o : !0 }));
3881
- let a = e.tracking;
3882
- P(this, N) && "userId" in P(this, N) && P(this, N).userId && (a != null && a.externalId || (a = { externalId: P(this, N).userId }));
3883
- const i = {
3884
- tracking: a,
3880
+ return M(this, I) && (e.Authorization = `Bearer ${M(this, I).token}`, "teamId" in M(this, I) && (e["X-Team-Id"] = M(this, I).teamId)), e;
3881
+ }
3882
+ generateCode(n) {
3883
+ return C(this, arguments, function* (e, t = {}, s) {
3884
+ var c;
3885
+ const a = Dn(e.settings);
3886
+ e.figmaToken && (yield Qe(this, xe, _r).call(this, e.fileKey, e.figmaToken, e.nodesId, { allowAutoSelectFirstNode: (c = a.allowAutoSelectFirstNode) != null ? c : !0 }, s));
3887
+ let i = e.tracking;
3888
+ M(this, I) && "userId" in M(this, I) && M(this, I).userId && (i != null && i.externalId || (i = { externalId: M(this, I).userId }));
3889
+ const o = {
3890
+ tracking: i,
3885
3891
  fileKey: e.fileKey,
3886
3892
  figmaToken: e.figmaToken,
3887
3893
  nodesId: e.nodesId,
3888
3894
  assetsStorage: e.assetsStorage,
3889
- language: n.language,
3890
- model: n.model,
3891
- framework: n.framework,
3892
- styling: n.styling,
3893
- uiLibrary: n.uiLibrary,
3894
- enableTranslation: n.enableTranslation,
3895
- enableUILibraryTheming: n.enableUILibraryTheming,
3896
- enableCompactStructure: n.enableCompactStructure,
3897
- enableAutoSplit: n.enableAutoSplit,
3898
- autoSplitThreshold: n.autoSplitThreshold,
3899
- disableMarkedForExport: n.disableMarkedForExport,
3900
- allowAutoSelectFirstNode: n.allowAutoSelectFirstNode,
3901
- enableDisplayScreenModelId: n.enableDisplayScreenModelId,
3902
- enableGeneratePackageLock: n.enableGeneratePackageLock
3895
+ language: a.language,
3896
+ model: a.model,
3897
+ framework: a.framework,
3898
+ styling: a.styling,
3899
+ uiLibrary: a.uiLibrary,
3900
+ enableTranslation: a.enableTranslation,
3901
+ enableUILibraryTheming: a.enableUILibraryTheming,
3902
+ enableCompactStructure: a.enableCompactStructure,
3903
+ enableAutoSplit: a.enableAutoSplit,
3904
+ autoSplitThreshold: a.autoSplitThreshold,
3905
+ disableMarkedForExport: a.disableMarkedForExport,
3906
+ allowAutoSelectFirstNode: a.allowAutoSelectFirstNode,
3907
+ enableDisplayScreenModelId: a.enableDisplayScreenModelId,
3908
+ enableGeneratePackageLock: a.enableGeneratePackageLock
3903
3909
  };
3904
- return Ye(this, be, Nt).call(this, "/v1/codegen", i, t, "codegen");
3910
+ return Qe(this, xe, It).call(this, "/v1/codegen", o, t, "codegen", s);
3905
3911
  });
3906
3912
  }
3907
3913
  /**
@@ -3909,166 +3915,170 @@ class Yn {
3909
3915
  * This API is experimental and may change or be removed in future releases.
3910
3916
  * Link2Code (l2c) flow.
3911
3917
  */
3912
- generateLink2Code(s) {
3913
- return C(this, arguments, function* (e, t = {}) {
3914
- let n = e.tracking;
3915
- P(this, N) && "userId" in P(this, N) && P(this, N).userId && (n != null && n.externalId || (n = { externalId: P(this, N).userId }));
3916
- const a = {
3917
- tracking: n,
3918
+ generateLink2Code(n) {
3919
+ return C(this, arguments, function* (e, t = {}, s) {
3920
+ let a = e.tracking;
3921
+ M(this, I) && "userId" in M(this, I) && M(this, I).userId && (a != null && a.externalId || (a = { externalId: M(this, I).userId }));
3922
+ const i = {
3923
+ tracking: a,
3918
3924
  assetsStorage: e.assetsStorage,
3919
3925
  params: e.params
3920
3926
  };
3921
- return Ye(this, be, Nt).call(this, "/v1/l2c", a, t, "l2c");
3927
+ return Qe(this, xe, It).call(this, "/v1/l2c", i, t, "l2c", s);
3922
3928
  });
3923
3929
  }
3924
3930
  }
3925
- N = new WeakMap(), Ge = new WeakMap(), be = new WeakSet(), _r = function(e, t, s, n) {
3931
+ I = new WeakMap(), Ke = new WeakMap(), xe = new WeakSet(), _r = function(e, t, s, n, a) {
3926
3932
  return C(this, null, function* () {
3927
- let a;
3933
+ let i;
3928
3934
  try {
3929
- a = yield Ns({
3935
+ i = yield Ns({
3930
3936
  fileKey: e,
3931
3937
  authToken: t,
3932
3938
  params: {
3933
3939
  geometry: "paths"
3934
- }
3940
+ },
3941
+ signal: a
3935
3942
  });
3936
- } catch (c) {
3943
+ } catch (d) {
3944
+ if (d instanceof Error && d.name === "AbortError")
3945
+ throw d;
3937
3946
  return;
3938
3947
  }
3939
- const o = s.map(
3940
- (c) => Un(a, c, n)
3948
+ const c = s.map(
3949
+ (d) => Un(i, d, n)
3941
3950
  ).find(
3942
- (c) => !c.isValid
3951
+ (d) => !d.isValid
3943
3952
  );
3944
- if (o)
3945
- throw new oe({
3953
+ if (c)
3954
+ throw new de({
3946
3955
  name: "Task Crashed",
3947
- reason: o.reason
3956
+ reason: c.reason
3948
3957
  });
3949
3958
  });
3950
- }, Nt = function(e, t, s, n) {
3959
+ }, It = function(e, t, s, n, a) {
3951
3960
  return C(this, null, function* () {
3952
- var f, v, O, R, L, W, te, he, ie;
3961
+ var v, N, Z, F, W, se, me, ce, V;
3953
3962
  if (this.hasAuth() === !1)
3954
3963
  throw new Error('It needs to set "auth" before calling this method.');
3955
- const a = {}, i = yield fetch(`${P(this, Ge)}${e}`, {
3964
+ const i = {}, o = yield fetch(`${M(this, Ke)}${e}`, {
3956
3965
  method: "POST",
3957
- headers: g(d({}, this.headers), {
3966
+ headers: g(u({}, this.headers), {
3958
3967
  Accept: "text/event-stream"
3959
3968
  }),
3960
- body: JSON.stringify(t)
3969
+ body: JSON.stringify(t),
3970
+ signal: a
3961
3971
  });
3962
- if (!i.ok) {
3963
- const Z = yield i.text();
3964
- let M;
3972
+ if (!o.ok) {
3973
+ const K = yield o.text();
3974
+ let q;
3965
3975
  try {
3966
- M = JSON.parse(Z);
3967
- } catch (Oe) {
3976
+ q = JSON.parse(K);
3977
+ } catch (Ne) {
3968
3978
  }
3969
- throw ((f = M == null ? void 0 : M.error) == null ? void 0 : f.name) === "ZodError" ? new oe({
3979
+ throw ((v = q == null ? void 0 : q.error) == null ? void 0 : v.name) === "ZodError" ? new de({
3970
3980
  name: "HTTP error from Anima API",
3971
3981
  reason: "Invalid body payload",
3972
- detail: M.error.issues,
3973
- status: i.status
3974
- }) : typeof M == "object" ? new oe({
3975
- name: `Error "${M}"`,
3982
+ detail: q.error.issues,
3983
+ status: o.status
3984
+ }) : typeof q == "object" ? new de({
3985
+ name: `Error "${q}"`,
3976
3986
  reason: "Unknown",
3977
- status: i.status
3978
- }) : new oe({
3987
+ status: o.status
3988
+ }) : new de({
3979
3989
  name: "HTTP error from Anima API",
3980
- reason: Z,
3981
- status: i.status
3990
+ reason: K,
3991
+ status: o.status
3982
3992
  });
3983
3993
  }
3984
- if (!i.body)
3985
- throw new oe({
3994
+ if (!o.body)
3995
+ throw new de({
3986
3996
  name: "Stream Error",
3987
3997
  reason: "Response body is null",
3988
- status: i.status
3998
+ status: o.status
3989
3999
  });
3990
- const o = i.body.getReader(), c = new TextDecoder();
3991
- let u = "";
4000
+ const c = o.body.getReader(), d = new TextDecoder();
4001
+ let f = "";
3992
4002
  try {
3993
4003
  for (; ; ) {
3994
- const { done: Z, value: M } = yield o.read();
3995
- if (Z)
4004
+ const { done: K, value: q } = yield c.read();
4005
+ if (K)
3996
4006
  break;
3997
- u += c.decode(M, { stream: !0 });
3998
- const Oe = u.split(`
4007
+ f += d.decode(q, { stream: !0 });
4008
+ const Ne = f.split(`
3999
4009
  `);
4000
- u = Oe.pop() || "";
4001
- for (const we of Oe)
4002
- if (!(!we.trim() || we.startsWith(":")) && we.startsWith("data: ")) {
4003
- let b;
4010
+ f = Ne.pop() || "";
4011
+ for (const A of Ne)
4012
+ if (!(!A.trim() || A.startsWith(":")) && A.startsWith("data: ")) {
4013
+ let k;
4004
4014
  try {
4005
- b = JSON.parse(we.slice(6));
4006
- } catch (ut) {
4015
+ k = JSON.parse(A.slice(6));
4016
+ } catch (lt) {
4007
4017
  continue;
4008
4018
  }
4009
- switch (b.type) {
4019
+ switch (k.type) {
4010
4020
  case "queueing": {
4011
- typeof s == "function" ? s(b) : (v = s.onQueueing) == null || v.call(s);
4021
+ typeof s == "function" ? s(k) : (N = s.onQueueing) == null || N.call(s);
4012
4022
  break;
4013
4023
  }
4014
4024
  case "start": {
4015
- a.sessionId = b.sessionId, typeof s == "function" ? s(b) : (O = s.onStart) == null || O.call(s, { sessionId: b.sessionId });
4025
+ i.sessionId = k.sessionId, typeof s == "function" ? s(k) : (Z = s.onStart) == null || Z.call(s, { sessionId: k.sessionId });
4016
4026
  break;
4017
4027
  }
4018
4028
  case "pre_codegen": {
4019
- n === "codegen" && (typeof s == "function" ? s(b) : (R = s.onPreCodegen) == null || R.call(s, {
4020
- message: b.message
4029
+ n === "codegen" && (typeof s == "function" ? s(k) : (F = s.onPreCodegen) == null || F.call(s, {
4030
+ message: k.message
4021
4031
  }));
4022
4032
  break;
4023
4033
  }
4024
4034
  case "assets_uploaded": {
4025
- typeof s == "function" ? s(b) : (L = s.onAssetsUploaded) == null || L.call(s);
4035
+ typeof s == "function" ? s(k) : (W = s.onAssetsUploaded) == null || W.call(s);
4026
4036
  break;
4027
4037
  }
4028
4038
  case "assets_list": {
4029
- a.assets = b.payload.assets, typeof s == "function" ? s(b) : (W = s.onAssetsList) == null || W.call(s, b.payload);
4039
+ i.assets = k.payload.assets, typeof s == "function" ? s(k) : (se = s.onAssetsList) == null || se.call(s, k.payload);
4030
4040
  break;
4031
4041
  }
4032
4042
  case "figma_metadata": {
4033
- n === "codegen" && (a.figmaFileName = b.figmaFileName, a.figmaSelectedFrameName = b.figmaSelectedFrameName, typeof s == "function" ? s(b) : (te = s.onFigmaMetadata) == null || te.call(s, {
4034
- figmaFileName: b.figmaFileName,
4035
- figmaSelectedFrameName: b.figmaSelectedFrameName
4043
+ n === "codegen" && (i.figmaFileName = k.figmaFileName, i.figmaSelectedFrameName = k.figmaSelectedFrameName, typeof s == "function" ? s(k) : (me = s.onFigmaMetadata) == null || me.call(s, {
4044
+ figmaFileName: k.figmaFileName,
4045
+ figmaSelectedFrameName: k.figmaSelectedFrameName
4036
4046
  }));
4037
4047
  break;
4038
4048
  }
4039
4049
  case "generating_code": {
4040
- b.payload.status === "success" && (a.files = b.payload.files), typeof s == "function" ? s(b) : (he = s.onGeneratingCode) == null || he.call(s, {
4041
- status: b.payload.status,
4042
- progress: b.payload.progress,
4043
- files: b.payload.files
4050
+ k.payload.status === "success" && (i.files = k.payload.files), typeof s == "function" ? s(k) : (ce = s.onGeneratingCode) == null || ce.call(s, {
4051
+ status: k.payload.status,
4052
+ progress: k.payload.progress,
4053
+ files: k.payload.files
4044
4054
  });
4045
4055
  break;
4046
4056
  }
4047
4057
  case "codegen_completed":
4048
4058
  case "generation_completed": {
4049
- typeof s == "function" ? s(b) : (ie = s.onCodegenCompleted) == null || ie.call(s);
4059
+ typeof s == "function" ? s(k) : (V = s.onCodegenCompleted) == null || V.call(s);
4050
4060
  break;
4051
4061
  }
4052
4062
  case "error":
4053
- throw new oe({
4054
- name: b.payload.errorName,
4055
- reason: b.payload.reason
4063
+ throw new de({
4064
+ name: k.payload.errorName,
4065
+ reason: k.payload.reason
4056
4066
  });
4057
4067
  case "done": {
4058
- if (!a.files)
4059
- throw new oe({
4068
+ if (!i.files)
4069
+ throw new de({
4060
4070
  name: "Invalid response",
4061
4071
  reason: "No code generated"
4062
4072
  });
4063
- return a.tokenUsage = b.payload.tokenUsage, a;
4073
+ return i.tokenUsage = k.payload.tokenUsage, i;
4064
4074
  }
4065
4075
  }
4066
4076
  }
4067
4077
  }
4068
4078
  } finally {
4069
- o.cancel();
4079
+ c.cancel();
4070
4080
  }
4071
- throw new oe({
4081
+ throw new de({
4072
4082
  name: "Connection",
4073
4083
  reason: "Connection closed before the 'done' message",
4074
4084
  status: 500
@@ -4116,8 +4126,8 @@ const ra = ({
4116
4126
  try {
4117
4127
  const c = Wn(a, o);
4118
4128
  if (c.startsWith("src/")) {
4119
- const u = c.split("/").slice(0, -1).join("/");
4120
- Bn(r, u).forEach((v) => {
4129
+ const d = c.split("/").slice(0, -1).join("/");
4130
+ Bn(r, d).forEach((v) => {
4121
4131
  s.has(v) || n(v);
4122
4132
  });
4123
4133
  }
@@ -4188,11 +4198,11 @@ const qn = (r, e) => br(
4188
4198
  );
4189
4199
  function wr(r) {
4190
4200
  return C(this, null, function* () {
4191
- var i, o, c, u;
4201
+ var i, o, c, d;
4192
4202
  const [e, t] = r.tee(), s = yield e.getReader().read();
4193
4203
  if (s.done || !s.value || s.value.type === "error" && ((i = s.value.payload) != null && i.status))
4194
4204
  return new Response(JSON.stringify(s.value), {
4195
- status: ((o = s.value) == null ? void 0 : o.type) === "error" && (u = (c = s.value.payload) == null ? void 0 : c.status) != null ? u : 500,
4205
+ status: ((o = s.value) == null ? void 0 : o.type) === "error" && (d = (c = s.value.payload) == null ? void 0 : c.status) != null ? d : 500,
4196
4206
  headers: {
4197
4207
  "Content-Type": "application/json"
4198
4208
  }
@@ -4200,13 +4210,13 @@ function wr(r) {
4200
4210
  const n = new TextEncoder(), a = t.pipeThrough(
4201
4211
  new TransformStream({
4202
4212
  transform(f, v) {
4203
- const O = `event: ${f.type}
4213
+ const N = `event: ${f.type}
4204
4214
  data: ${JSON.stringify(
4205
4215
  f
4206
4216
  )}
4207
4217
 
4208
4218
  `;
4209
- v.enqueue(n.encode(O));
4219
+ v.enqueue(n.encode(N));
4210
4220
  }
4211
4221
  })
4212
4222
  );
@@ -4233,11 +4243,11 @@ const sa = (r, e) => C(void 0, null, function* () {
4233
4243
  });
4234
4244
  export {
4235
4245
  Yn as Anima,
4236
- oe as CodegenError,
4237
- Er as FigmaTokenIssue,
4246
+ de as CodegenError,
4247
+ Ar as FigmaTokenIssue,
4238
4248
  Nr as NotFound,
4239
- Cr as RateLimitExceeded,
4240
- Or as RequestTooLarge,
4249
+ Or as RateLimitExceeded,
4250
+ Cr as RequestTooLarge,
4241
4251
  ta as ResponseError,
4242
4252
  jr as UnknownFigmaApiException,
4243
4253
  sa as createCodegenResponseEventStream,