@animaapp/anima-sdk-react 0.4.4 → 0.5.0
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.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +425 -421
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var va = Object.defineProperty, _a = Object.defineProperties, ba = Object.getOwn
|
|
|
41
41
|
for (var n of qs(e))
|
|
42
42
|
ka.call(e, n) && Hs(t, n, e[n]);
|
|
43
43
|
return t;
|
|
44
|
-
},
|
|
44
|
+
}, E = (t, e) => _a(t, ba(e)), ke = (t, e, n) => new Promise((s, r) => {
|
|
45
45
|
var a = (c) => {
|
|
46
46
|
try {
|
|
47
47
|
o(n.next(c));
|
|
@@ -67,14 +67,14 @@ class Gs extends Error {
|
|
|
67
67
|
super(), this.name = e, this.message = n, this.detail = r, this.status = s;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
class
|
|
70
|
+
const xa = "Figma Token Issue";
|
|
71
|
+
class Ea extends Error {
|
|
72
72
|
constructor({
|
|
73
73
|
fileKey: e,
|
|
74
74
|
reason: n,
|
|
75
75
|
cause: s
|
|
76
76
|
}) {
|
|
77
|
-
super(
|
|
77
|
+
super(xa), this.fileKey = e, this.reason = n, this.cause = s;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
const Sa = "Rate Limit Exceeded";
|
|
@@ -84,15 +84,15 @@ class Oa extends Error {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
const Ta = "Request Too Large";
|
|
87
|
-
class
|
|
87
|
+
class Ca extends Error {
|
|
88
88
|
constructor({ fileKey: e, cause: n }) {
|
|
89
89
|
super(Ta), this.fileKey = e, this.cause = n;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const Aa = "Not Found";
|
|
93
93
|
class Na extends Error {
|
|
94
94
|
constructor({ fileKey: e, cause: n }) {
|
|
95
|
-
super(
|
|
95
|
+
super(Aa), this.fileKey = e, this.cause = n;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
const Ra = "Unknown Figma API Exception";
|
|
@@ -106,7 +106,7 @@ const Ia = (t, e) => {
|
|
|
106
106
|
if (((n = t == null ? void 0 : t.cause) == null ? void 0 : n.message) === "Fetch Error") {
|
|
107
107
|
const { err: s, status: r } = t.cause.body;
|
|
108
108
|
if (r === 403)
|
|
109
|
-
return new
|
|
109
|
+
return new Ea({
|
|
110
110
|
fileKey: e,
|
|
111
111
|
reason: s,
|
|
112
112
|
cause: t
|
|
@@ -116,7 +116,7 @@ const Ia = (t, e) => {
|
|
|
116
116
|
if (r === 404)
|
|
117
117
|
return new Na({ fileKey: e, cause: t });
|
|
118
118
|
if (r === 400 && s.includes("Request too large"))
|
|
119
|
-
return new
|
|
119
|
+
return new Ca({ fileKey: e, cause: t });
|
|
120
120
|
}
|
|
121
121
|
return new Pa({ fileKey: e, cause: t });
|
|
122
122
|
};
|
|
@@ -129,7 +129,7 @@ var ja = Object.defineProperty, Za = Object.defineProperties, Da = Object.getOwn
|
|
|
129
129
|
for (var n of Js(e))
|
|
130
130
|
La.call(e, n) && Ys(t, n, e[n]);
|
|
131
131
|
return t;
|
|
132
|
-
}, Ts = (t, e) => Za(t, Da(e)),
|
|
132
|
+
}, Ts = (t, e) => Za(t, Da(e)), Cs = (t, e, n) => e.has(t) || Or("Cannot " + n), P = (t, e, n) => (Cs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Or("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), J = (t, e, n, s) => (Cs(t, e, "write to private field"), e.set(t, n), n), _e = (t, e, n) => (Cs(t, e, "access private method"), n), B = (t, e, n) => new Promise((s, r) => {
|
|
133
133
|
var a = (c) => {
|
|
134
134
|
try {
|
|
135
135
|
o(n.next(c));
|
|
@@ -148,55 +148,55 @@ var ja = Object.defineProperty, Za = Object.defineProperties, Da = Object.getOwn
|
|
|
148
148
|
function Wa(t) {
|
|
149
149
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
150
150
|
}
|
|
151
|
-
var Kn = { exports: {} },
|
|
152
|
-
function
|
|
151
|
+
var Kn = { exports: {} }, Va = Kn.exports, Qs;
|
|
152
|
+
function za() {
|
|
153
153
|
return Qs || (Qs = 1, function(t, e) {
|
|
154
154
|
(function(n, s) {
|
|
155
155
|
t.exports = s();
|
|
156
|
-
})(
|
|
157
|
-
var n = typeof Promise == "function", s = typeof self == "object" ? self : Fa, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = r && typeof Symbol.iterator != "undefined", p = r && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", v = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), l = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), y = h && typeof Array.prototype[Symbol.iterator] == "function", m = y && Object.getPrototypeOf([][Symbol.iterator]()), W = h && typeof String.prototype[Symbol.iterator] == "function", R = W && Object.getPrototypeOf(""[Symbol.iterator]()),
|
|
158
|
-
function q(
|
|
159
|
-
var
|
|
160
|
-
if (
|
|
161
|
-
return
|
|
162
|
-
if (
|
|
156
|
+
})(Va, function() {
|
|
157
|
+
var n = typeof Promise == "function", s = typeof self == "object" ? self : Fa, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = r && typeof Symbol.iterator != "undefined", p = r && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", v = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), l = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), y = h && typeof Array.prototype[Symbol.iterator] == "function", m = y && Object.getPrototypeOf([][Symbol.iterator]()), W = h && typeof String.prototype[Symbol.iterator] == "function", R = W && Object.getPrototypeOf(""[Symbol.iterator]()), z = 8, L = -1;
|
|
158
|
+
function q(Z) {
|
|
159
|
+
var D = typeof Z;
|
|
160
|
+
if (D !== "object")
|
|
161
|
+
return D;
|
|
162
|
+
if (Z === null)
|
|
163
163
|
return "null";
|
|
164
|
-
if (
|
|
164
|
+
if (Z === s)
|
|
165
165
|
return "global";
|
|
166
|
-
if (Array.isArray(
|
|
166
|
+
if (Array.isArray(Z) && (p === !1 || !(Symbol.toStringTag in Z)))
|
|
167
167
|
return "Array";
|
|
168
168
|
if (typeof window == "object" && window !== null) {
|
|
169
|
-
if (typeof window.location == "object" &&
|
|
169
|
+
if (typeof window.location == "object" && Z === window.location)
|
|
170
170
|
return "Location";
|
|
171
|
-
if (typeof window.document == "object" &&
|
|
171
|
+
if (typeof window.document == "object" && Z === window.document)
|
|
172
172
|
return "Document";
|
|
173
173
|
if (typeof window.navigator == "object") {
|
|
174
|
-
if (typeof window.navigator.mimeTypes == "object" &&
|
|
174
|
+
if (typeof window.navigator.mimeTypes == "object" && Z === window.navigator.mimeTypes)
|
|
175
175
|
return "MimeTypeArray";
|
|
176
|
-
if (typeof window.navigator.plugins == "object" &&
|
|
176
|
+
if (typeof window.navigator.plugins == "object" && Z === window.navigator.plugins)
|
|
177
177
|
return "PluginArray";
|
|
178
178
|
}
|
|
179
|
-
if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") &&
|
|
180
|
-
if (
|
|
179
|
+
if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && Z instanceof window.HTMLElement) {
|
|
180
|
+
if (Z.tagName === "BLOCKQUOTE")
|
|
181
181
|
return "HTMLQuoteElement";
|
|
182
|
-
if (
|
|
182
|
+
if (Z.tagName === "TD")
|
|
183
183
|
return "HTMLTableDataCellElement";
|
|
184
|
-
if (
|
|
184
|
+
if (Z.tagName === "TH")
|
|
185
185
|
return "HTMLTableHeaderCellElement";
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
var Se = p &&
|
|
188
|
+
var Se = p && Z[Symbol.toStringTag];
|
|
189
189
|
if (typeof Se == "string")
|
|
190
190
|
return Se;
|
|
191
|
-
var $ = Object.getPrototypeOf(
|
|
192
|
-
return $ === RegExp.prototype ? "RegExp" : $ === Date.prototype ? "Date" : n && $ === Promise.prototype ? "Promise" : i && $ === Set.prototype ? "Set" : a && $ === Map.prototype ? "Map" : c && $ === WeakSet.prototype ? "WeakSet" : o && $ === WeakMap.prototype ? "WeakMap" : u && $ === DataView.prototype ? "DataView" : a && $ === l ? "Map Iterator" : i && $ === b ? "Set Iterator" : y && $ === m ? "Array Iterator" : W && $ === R ? "String Iterator" : $ === null ? "Object" : Object.prototype.toString.call(
|
|
191
|
+
var $ = Object.getPrototypeOf(Z);
|
|
192
|
+
return $ === RegExp.prototype ? "RegExp" : $ === Date.prototype ? "Date" : n && $ === Promise.prototype ? "Promise" : i && $ === Set.prototype ? "Set" : a && $ === Map.prototype ? "Map" : c && $ === WeakSet.prototype ? "WeakSet" : o && $ === WeakMap.prototype ? "WeakMap" : u && $ === DataView.prototype ? "DataView" : a && $ === l ? "Map Iterator" : i && $ === b ? "Set Iterator" : y && $ === m ? "Array Iterator" : W && $ === R ? "String Iterator" : $ === null ? "Object" : Object.prototype.toString.call(Z).slice(z, L);
|
|
193
193
|
}
|
|
194
194
|
return q;
|
|
195
195
|
});
|
|
196
196
|
}(Kn)), Kn.exports;
|
|
197
197
|
}
|
|
198
|
-
var Ua =
|
|
199
|
-
const Ba = /* @__PURE__ */ Wa(Ua),
|
|
198
|
+
var Ua = za();
|
|
199
|
+
const Ba = /* @__PURE__ */ Wa(Ua), As = typeof Buffer != "undefined", Ka = As && typeof Buffer.from != "undefined", qa = As ? (
|
|
200
200
|
/**
|
|
201
201
|
* is value is Buffer?
|
|
202
202
|
*
|
|
@@ -227,7 +227,7 @@ const Ba = /* @__PURE__ */ Wa(Ua), Cs = typeof Buffer != "undefined", Ka = Cs &&
|
|
|
227
227
|
function(t) {
|
|
228
228
|
return Buffer.from(t);
|
|
229
229
|
}
|
|
230
|
-
) :
|
|
230
|
+
) : As ? (
|
|
231
231
|
/**
|
|
232
232
|
* copy Buffer
|
|
233
233
|
*
|
|
@@ -318,7 +318,7 @@ function ii(t) {
|
|
|
318
318
|
function oi(t) {
|
|
319
319
|
return new String(t);
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Ce(t, e) {
|
|
322
322
|
return Rn[e].from ? Rn[e].from(t) : new Rn[e](t);
|
|
323
323
|
}
|
|
324
324
|
function Q(t) {
|
|
@@ -348,15 +348,15 @@ const li = /* @__PURE__ */ new Map([
|
|
|
348
348
|
["String", oi],
|
|
349
349
|
// typed arrays
|
|
350
350
|
// TODO: pass bound function
|
|
351
|
-
["Float32Array",
|
|
352
|
-
["Float64Array",
|
|
353
|
-
["Int16Array",
|
|
354
|
-
["Int32Array",
|
|
355
|
-
["Int8Array",
|
|
356
|
-
["Uint16Array",
|
|
357
|
-
["Uint32Array",
|
|
358
|
-
["Uint8Array",
|
|
359
|
-
["Uint8ClampedArray",
|
|
351
|
+
["Float32Array", Ce],
|
|
352
|
+
["Float64Array", Ce],
|
|
353
|
+
["Int16Array", Ce],
|
|
354
|
+
["Int32Array", Ce],
|
|
355
|
+
["Int8Array", Ce],
|
|
356
|
+
["Uint16Array", Ce],
|
|
357
|
+
["Uint32Array", Ce],
|
|
358
|
+
["Uint8Array", Ce],
|
|
359
|
+
["Uint8ClampedArray", Ce],
|
|
360
360
|
// shallow copy
|
|
361
361
|
["Array Iterator", Q],
|
|
362
362
|
["Map Iterator", Q],
|
|
@@ -544,7 +544,7 @@ class nr extends Error {
|
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
class
|
|
547
|
+
class xt extends Error {
|
|
548
548
|
constructor(e = {}) {
|
|
549
549
|
const { canceled: n = !1 } = e;
|
|
550
550
|
super("Abort Error"), this.name = "Abort Error", this.canceled = n;
|
|
@@ -560,7 +560,7 @@ class Pn extends Error {
|
|
|
560
560
|
super(e), this.name = "Request Validation Error";
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Cr() {
|
|
564
564
|
return Array.from(
|
|
565
565
|
{ length: 32 },
|
|
566
566
|
() => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
|
|
@@ -570,7 +570,7 @@ function Xn() {
|
|
|
570
570
|
return Math.floor(Date.now() / 1e3).toString();
|
|
571
571
|
}
|
|
572
572
|
const bi = 5 * 60 * 1e3, wi = 1 * 1e3;
|
|
573
|
-
var Ge, ne, ge, Yn, Qn,
|
|
573
|
+
var Ge, ne, ge, Yn, Qn, Et;
|
|
574
574
|
class ki {
|
|
575
575
|
constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
|
|
576
576
|
de(this, ge), de(this, Ge), de(this, ne), this.baseAddress = n, J(this, Ge, e), J(this, ne, {}), this.plugins = [];
|
|
@@ -592,31 +592,31 @@ class ki {
|
|
|
592
592
|
const { overrideBaseAddress: r, overrideDefaultHeaders: a } = s, i = r != null ? r : this.baseAddress;
|
|
593
593
|
let o = a != null ? a : this.headers;
|
|
594
594
|
const c = kt(P(this, ne));
|
|
595
|
-
return J(this, ne, {}), c.extraHeaders && (o = ae(ae({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ae({}, o), { "X-Request-Nonce":
|
|
595
|
+
return J(this, ne, {}), c.extraHeaders && (o = ae(ae({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ae({}, o), { "X-Request-Nonce": Cr(), "X-Request-Timestamp": Xn() })), c.async ? yield _e(this, ge, Qn).call(this, `${i}${n}`, c.async, { headers: o }) : yield _e(this, ge, Yn).call(this, `${i}${n}`, c, { headers: o });
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
post(e, n) {
|
|
599
599
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
600
600
|
const i = kt(P(this, ne));
|
|
601
|
-
return J(this, ne, {}), _e(this, ge,
|
|
601
|
+
return J(this, ne, {}), _e(this, ge, Et).call(this, s, "POST", r, a, i);
|
|
602
602
|
});
|
|
603
603
|
}
|
|
604
604
|
put(e, n) {
|
|
605
605
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
606
606
|
const i = kt(P(this, ne));
|
|
607
|
-
return J(this, ne, {}), _e(this, ge,
|
|
607
|
+
return J(this, ne, {}), _e(this, ge, Et).call(this, s, "PUT", r, a, i);
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
delete(e, n) {
|
|
611
611
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
612
612
|
const i = kt(P(this, ne));
|
|
613
|
-
return J(this, ne, {}), _e(this, ge,
|
|
613
|
+
return J(this, ne, {}), _e(this, ge, Et).call(this, s, "DELETE", r, a, i);
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
616
|
patch(e, n) {
|
|
617
617
|
return B(this, arguments, function* (s, r, a = {}) {
|
|
618
618
|
const i = kt(P(this, ne));
|
|
619
|
-
return J(this, ne, {}), _e(this, ge,
|
|
619
|
+
return J(this, ne, {}), _e(this, ge, Et).call(this, s, "PATCH", r, a, i);
|
|
620
620
|
});
|
|
621
621
|
}
|
|
622
622
|
}
|
|
@@ -627,7 +627,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
627
627
|
try {
|
|
628
628
|
return yield P(this, Ge).call(this, t, ae(ae({}, n), e.abortSignal && { signal: e.abortSignal }));
|
|
629
629
|
} catch (h) {
|
|
630
|
-
throw h instanceof Error && h.name === "AbortError" ? new
|
|
630
|
+
throw h instanceof Error && h.name === "AbortError" ? new xt({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : h;
|
|
631
631
|
}
|
|
632
632
|
}), { headers: r } = n != null ? n : {}, a = (c, u) => {
|
|
633
633
|
var h, p;
|
|
@@ -687,7 +687,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
687
687
|
try {
|
|
688
688
|
p = yield P(this, Ge).call(this, u, ae(ae({}, n), i && { signal: i }));
|
|
689
689
|
} catch (b) {
|
|
690
|
-
throw b instanceof Error && b.name === "AbortError" ? new
|
|
690
|
+
throw b instanceof Error && b.name === "AbortError" ? new xt({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : b;
|
|
691
691
|
}
|
|
692
692
|
if (!p.ok) {
|
|
693
693
|
const b = yield p.text().catch();
|
|
@@ -709,9 +709,9 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
709
709
|
}, c), m = (W = 0) => B(this, null, function* () {
|
|
710
710
|
if (i != null && i.aborted) {
|
|
711
711
|
clearTimeout(y), P(this, Ge).call(this, `${h}/${v}/cancel`, { method: "POST", headers: this.headers }).then(() => {
|
|
712
|
-
l(new
|
|
712
|
+
l(new xt({ canceled: !0 }));
|
|
713
713
|
}).catch((R) => {
|
|
714
|
-
l(new
|
|
714
|
+
l(new xt({ canceled: !1 }));
|
|
715
715
|
});
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
@@ -719,14 +719,14 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
719
719
|
const R = yield (yield P(this, Ge).call(this, `${h}/${v}`, { headers: this.headers })).json();
|
|
720
720
|
if (R.status === "success") {
|
|
721
721
|
clearTimeout(y);
|
|
722
|
-
const
|
|
723
|
-
b(
|
|
722
|
+
const z = R.response_json;
|
|
723
|
+
b(z);
|
|
724
724
|
} else if (R.status === "failed")
|
|
725
725
|
clearTimeout(y), l(new _i(R.response_json));
|
|
726
726
|
else {
|
|
727
727
|
a && a(R.response_json);
|
|
728
|
-
const
|
|
729
|
-
setTimeout(() => m(W + 1),
|
|
728
|
+
const z = o(W);
|
|
729
|
+
setTimeout(() => m(W + 1), z);
|
|
730
730
|
}
|
|
731
731
|
} catch (R) {
|
|
732
732
|
l(R);
|
|
@@ -735,11 +735,11 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
735
735
|
m();
|
|
736
736
|
}));
|
|
737
737
|
});
|
|
738
|
-
},
|
|
738
|
+
}, Et = function(t, e, n, s, r) {
|
|
739
739
|
return B(this, null, function* () {
|
|
740
740
|
const { overrideBaseAddress: a, overrideDefaultHeaders: i } = s, o = a != null ? a : this.baseAddress;
|
|
741
741
|
let c = i != null ? i : this.headers;
|
|
742
|
-
r.extraHeaders && (c = ae(ae({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ae({}, c), { "X-Request-Nonce":
|
|
742
|
+
r.extraHeaders && (c = ae(ae({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ae({}, c), { "X-Request-Nonce": Cr(), "X-Request-Timestamp": Xn() }));
|
|
743
743
|
let u = n;
|
|
744
744
|
return typeof FormData != "undefined" && n instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? n : JSON.stringify(n), r.compress && mi() && (c["Content-Encoding"] = "gzip", u = yield yi(u))), r.async ? yield _e(this, ge, Qn).call(this, `${o}${t}`, r.async, {
|
|
745
745
|
method: e,
|
|
@@ -748,7 +748,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
748
748
|
}) : yield _e(this, ge, Yn).call(this, `${o}${t}`, r, { method: e, headers: c, body: u });
|
|
749
749
|
});
|
|
750
750
|
};
|
|
751
|
-
const sr = (t, e, n, s) => t instanceof
|
|
751
|
+
const sr = (t, e, n, s) => t instanceof xt ? t : new vi({ resource: e, api: String(n), args: s, cause: t }), In = (t, e) => new Proxy(e, {
|
|
752
752
|
get(n, s) {
|
|
753
753
|
return (...r) => {
|
|
754
754
|
var a;
|
|
@@ -770,7 +770,7 @@ const sr = (t, e, n, s) => t instanceof Et ? t : new vi({ resource: e, api: Stri
|
|
|
770
770
|
}
|
|
771
771
|
});
|
|
772
772
|
var St;
|
|
773
|
-
class
|
|
773
|
+
class xi {
|
|
774
774
|
constructor(e) {
|
|
775
775
|
de(this, St), this.resourceName = "Files", J(this, St, e);
|
|
776
776
|
}
|
|
@@ -791,11 +791,11 @@ class Ei {
|
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
793
|
St = /* @__PURE__ */ new WeakMap();
|
|
794
|
-
const
|
|
794
|
+
const Ei = (t, e, n) => {
|
|
795
795
|
const s = e.sort();
|
|
796
796
|
return `${t}-${s.join("-")}-${n}`;
|
|
797
797
|
}, Si = (t) => t ? t.ts > Date.now() - 1e3 * 30 : !1;
|
|
798
|
-
var ve, es,
|
|
798
|
+
var ve, es, Ar;
|
|
799
799
|
class Oi {
|
|
800
800
|
constructor(e) {
|
|
801
801
|
de(this, es), de(this, ve), this.resourceName = "Images", J(this, ve, e);
|
|
@@ -806,14 +806,14 @@ class Oi {
|
|
|
806
806
|
*/
|
|
807
807
|
get(e) {
|
|
808
808
|
return B(this, arguments, function* ({ fileKey: n, nodeIds: s, format: r = "jpg", scale: a }) {
|
|
809
|
-
const i =
|
|
809
|
+
const i = Ei(n, s, r), o = P(this, ve).cache.images.entries.get(i);
|
|
810
810
|
if (Si(o))
|
|
811
811
|
return o.result;
|
|
812
812
|
o && P(this, ve).cache.images.entries.delete(i);
|
|
813
813
|
const c = P(this, ve).cache.images.pendingRequests.get(i);
|
|
814
814
|
if (c)
|
|
815
815
|
return c;
|
|
816
|
-
const u = _e(this, es,
|
|
816
|
+
const u = _e(this, es, Ar).call(this, i, n, s, r, a);
|
|
817
817
|
P(this, ve).cache.images.pendingRequests.set(i, u);
|
|
818
818
|
try {
|
|
819
819
|
return yield u;
|
|
@@ -823,7 +823,7 @@ class Oi {
|
|
|
823
823
|
});
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
|
-
ve = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakSet(),
|
|
826
|
+
ve = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakSet(), Ar = function(t, e, n, s, r) {
|
|
827
827
|
return B(this, null, function* () {
|
|
828
828
|
const a = yield P(this, ve).get(
|
|
829
829
|
`v1/images/${e}?ids=${n}&format=${s}${r ? `&scale=${r}` : ""}`
|
|
@@ -852,7 +852,7 @@ class Ti {
|
|
|
852
852
|
}
|
|
853
853
|
cn = /* @__PURE__ */ new WeakMap();
|
|
854
854
|
var je;
|
|
855
|
-
class
|
|
855
|
+
class Ci extends ki {
|
|
856
856
|
constructor({
|
|
857
857
|
baseAddress: e = "https://api.figma.com/",
|
|
858
858
|
fetch: n = globalThis.fetch.bind(globalThis)
|
|
@@ -862,7 +862,7 @@ class Ai extends ki {
|
|
|
862
862
|
entries: /* @__PURE__ */ new Map(),
|
|
863
863
|
pendingRequests: /* @__PURE__ */ new Map()
|
|
864
864
|
}
|
|
865
|
-
}, this.files = In(this, new
|
|
865
|
+
}, this.files = In(this, new xi(this)), this.nodes = In(this, new Ti(this)), this.images = In(this, new Oi(this));
|
|
866
866
|
}
|
|
867
867
|
set token(e) {
|
|
868
868
|
if (!e.startsWith("figd_") && !e.startsWith("figu_"))
|
|
@@ -880,23 +880,26 @@ class Ai extends ki {
|
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
je = /* @__PURE__ */ new WeakMap();
|
|
883
|
-
const
|
|
883
|
+
const Ai = (t) => ke(void 0, [t], function* ({
|
|
884
884
|
fileKey: e,
|
|
885
885
|
authToken: n,
|
|
886
|
-
figmaRestApi: s = new
|
|
887
|
-
params: r = {}
|
|
886
|
+
figmaRestApi: s = new Ci(),
|
|
887
|
+
params: r = {},
|
|
888
|
+
signal: a
|
|
888
889
|
}) {
|
|
889
890
|
n && (s.token = n);
|
|
890
891
|
try {
|
|
891
|
-
return yield s.
|
|
892
|
+
return yield s.withOptions({
|
|
893
|
+
abortSignal: a
|
|
894
|
+
}).files.get({
|
|
892
895
|
fileKey: e,
|
|
893
896
|
params: r
|
|
894
897
|
});
|
|
895
|
-
} catch (
|
|
896
|
-
throw console.error(
|
|
898
|
+
} catch (i) {
|
|
899
|
+
throw i instanceof Error && i.name === "AbortError" ? i : (console.error(i), Ia(i, e));
|
|
897
900
|
}
|
|
898
901
|
});
|
|
899
|
-
var
|
|
902
|
+
var A;
|
|
900
903
|
(function(t) {
|
|
901
904
|
t.assertEqual = (r) => r;
|
|
902
905
|
function e(r) {
|
|
@@ -931,12 +934,12 @@ var C;
|
|
|
931
934
|
return r.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
932
935
|
}
|
|
933
936
|
t.joinValues = s, t.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
934
|
-
})(
|
|
937
|
+
})(A || (A = {}));
|
|
935
938
|
var ts;
|
|
936
939
|
(function(t) {
|
|
937
940
|
t.mergeShapes = (e, n) => d(d({}, e), n);
|
|
938
941
|
})(ts || (ts = {}));
|
|
939
|
-
const _ =
|
|
942
|
+
const _ = A.arrayToEnum([
|
|
940
943
|
"string",
|
|
941
944
|
"nan",
|
|
942
945
|
"number",
|
|
@@ -978,7 +981,7 @@ const _ = C.arrayToEnum([
|
|
|
978
981
|
default:
|
|
979
982
|
return _.unknown;
|
|
980
983
|
}
|
|
981
|
-
}, f =
|
|
984
|
+
}, f = A.arrayToEnum([
|
|
982
985
|
"invalid_type",
|
|
983
986
|
"invalid_literal",
|
|
984
987
|
"custom",
|
|
@@ -1040,7 +1043,7 @@ class ie extends Error {
|
|
|
1040
1043
|
return this.message;
|
|
1041
1044
|
}
|
|
1042
1045
|
get message() {
|
|
1043
|
-
return JSON.stringify(this.issues,
|
|
1046
|
+
return JSON.stringify(this.issues, A.jsonStringifyReplacer, 2);
|
|
1044
1047
|
}
|
|
1045
1048
|
get isEmpty() {
|
|
1046
1049
|
return this.issues.length === 0;
|
|
@@ -1063,19 +1066,19 @@ const yt = (t, e) => {
|
|
|
1063
1066
|
t.received === _.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
|
|
1064
1067
|
break;
|
|
1065
1068
|
case f.invalid_literal:
|
|
1066
|
-
n = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
1069
|
+
n = `Invalid literal value, expected ${JSON.stringify(t.expected, A.jsonStringifyReplacer)}`;
|
|
1067
1070
|
break;
|
|
1068
1071
|
case f.unrecognized_keys:
|
|
1069
|
-
n = `Unrecognized key(s) in object: ${
|
|
1072
|
+
n = `Unrecognized key(s) in object: ${A.joinValues(t.keys, ", ")}`;
|
|
1070
1073
|
break;
|
|
1071
1074
|
case f.invalid_union:
|
|
1072
1075
|
n = "Invalid input";
|
|
1073
1076
|
break;
|
|
1074
1077
|
case f.invalid_union_discriminator:
|
|
1075
|
-
n = `Invalid discriminator value. Expected ${
|
|
1078
|
+
n = `Invalid discriminator value. Expected ${A.joinValues(t.options)}`;
|
|
1076
1079
|
break;
|
|
1077
1080
|
case f.invalid_enum_value:
|
|
1078
|
-
n = `Invalid enum value. Expected ${
|
|
1081
|
+
n = `Invalid enum value. Expected ${A.joinValues(t.options)}, received '${t.received}'`;
|
|
1079
1082
|
break;
|
|
1080
1083
|
case f.invalid_arguments:
|
|
1081
1084
|
n = "Invalid function arguments";
|
|
@@ -1087,7 +1090,7 @@ const yt = (t, e) => {
|
|
|
1087
1090
|
n = "Invalid date";
|
|
1088
1091
|
break;
|
|
1089
1092
|
case f.invalid_string:
|
|
1090
|
-
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` :
|
|
1093
|
+
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : A.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
|
|
1091
1094
|
break;
|
|
1092
1095
|
case f.too_small:
|
|
1093
1096
|
t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : n = "Invalid input";
|
|
@@ -1108,7 +1111,7 @@ const yt = (t, e) => {
|
|
|
1108
1111
|
n = "Number must be finite";
|
|
1109
1112
|
break;
|
|
1110
1113
|
default:
|
|
1111
|
-
n = e.defaultError,
|
|
1114
|
+
n = e.defaultError, A.assertNever(t);
|
|
1112
1115
|
}
|
|
1113
1116
|
return { message: n };
|
|
1114
1117
|
};
|
|
@@ -1120,11 +1123,11 @@ function ln() {
|
|
|
1120
1123
|
return Nr;
|
|
1121
1124
|
}
|
|
1122
1125
|
const fn = (t) => {
|
|
1123
|
-
const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i =
|
|
1126
|
+
const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i = E(d({}, r), {
|
|
1124
1127
|
path: a
|
|
1125
1128
|
});
|
|
1126
1129
|
if (r.message !== void 0)
|
|
1127
|
-
return
|
|
1130
|
+
return E(d({}, r), {
|
|
1128
1131
|
path: a,
|
|
1129
1132
|
message: r.message
|
|
1130
1133
|
});
|
|
@@ -1132,7 +1135,7 @@ const fn = (t) => {
|
|
|
1132
1135
|
const c = s.filter((u) => !!u).slice().reverse();
|
|
1133
1136
|
for (const u of c)
|
|
1134
1137
|
o = u(i, { data: e, defaultError: o }).message;
|
|
1135
|
-
return
|
|
1138
|
+
return E(d({}, r), {
|
|
1136
1139
|
path: a,
|
|
1137
1140
|
message: o
|
|
1138
1141
|
});
|
|
@@ -1214,7 +1217,7 @@ var w;
|
|
|
1214
1217
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
1215
1218
|
})(w || (w = {}));
|
|
1216
1219
|
var Ot, Tt;
|
|
1217
|
-
class
|
|
1220
|
+
class xe {
|
|
1218
1221
|
constructor(e, n, s, r) {
|
|
1219
1222
|
this._cachedPath = [], this.parent = e, this.data = n, this._path = s, this._key = r;
|
|
1220
1223
|
}
|
|
@@ -1384,7 +1387,7 @@ class T {
|
|
|
1384
1387
|
_refinement(e) {
|
|
1385
1388
|
return new ye({
|
|
1386
1389
|
schema: this,
|
|
1387
|
-
typeName:
|
|
1390
|
+
typeName: x.ZodEffects,
|
|
1388
1391
|
effect: { type: "refinement", refinement: e }
|
|
1389
1392
|
});
|
|
1390
1393
|
}
|
|
@@ -1420,37 +1423,37 @@ class T {
|
|
|
1420
1423
|
return Mt.create(this, e, this._def);
|
|
1421
1424
|
}
|
|
1422
1425
|
transform(e) {
|
|
1423
|
-
return new ye(
|
|
1426
|
+
return new ye(E(d({}, O(this._def)), {
|
|
1424
1427
|
schema: this,
|
|
1425
|
-
typeName:
|
|
1428
|
+
typeName: x.ZodEffects,
|
|
1426
1429
|
effect: { type: "transform", transform: e }
|
|
1427
1430
|
}));
|
|
1428
1431
|
}
|
|
1429
1432
|
default(e) {
|
|
1430
1433
|
const n = typeof e == "function" ? e : () => e;
|
|
1431
|
-
return new
|
|
1434
|
+
return new Vt(E(d({}, O(this._def)), {
|
|
1432
1435
|
innerType: this,
|
|
1433
1436
|
defaultValue: n,
|
|
1434
|
-
typeName:
|
|
1437
|
+
typeName: x.ZodDefault
|
|
1435
1438
|
}));
|
|
1436
1439
|
}
|
|
1437
1440
|
brand() {
|
|
1438
1441
|
return new Ns(d({
|
|
1439
|
-
typeName:
|
|
1442
|
+
typeName: x.ZodBranded,
|
|
1440
1443
|
type: this
|
|
1441
1444
|
}, O(this._def)));
|
|
1442
1445
|
}
|
|
1443
1446
|
catch(e) {
|
|
1444
1447
|
const n = typeof e == "function" ? e : () => e;
|
|
1445
|
-
return new
|
|
1448
|
+
return new zt(E(d({}, O(this._def)), {
|
|
1446
1449
|
innerType: this,
|
|
1447
1450
|
catchValue: n,
|
|
1448
|
-
typeName:
|
|
1451
|
+
typeName: x.ZodCatch
|
|
1449
1452
|
}));
|
|
1450
1453
|
}
|
|
1451
1454
|
describe(e) {
|
|
1452
1455
|
const n = this.constructor;
|
|
1453
|
-
return new n(
|
|
1456
|
+
return new n(E(d({}, this._def), {
|
|
1454
1457
|
description: e
|
|
1455
1458
|
}));
|
|
1456
1459
|
}
|
|
@@ -1469,7 +1472,7 @@ class T {
|
|
|
1469
1472
|
}
|
|
1470
1473
|
const Ii = /^c[^\s-]{8,}$/i, ji = /^[0-9a-z]+$/, Zi = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Di = /^[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, Mi = /^[a-z0-9_-]{21}$/i, Li = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, $i = /^[-+]?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)?)??$/, Fi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Wi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1471
1474
|
let jn;
|
|
1472
|
-
const
|
|
1475
|
+
const Vi = /^(?:(?: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])$/, zi = /^(?:(?: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])$/, Ui = /^(([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]))$/, Bi = /^(([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])$/, Ki = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, qi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Pr = "((\\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])))", Hi = new RegExp(`^${Pr}$`);
|
|
1473
1476
|
function Ir(t) {
|
|
1474
1477
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
1475
1478
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
@@ -1483,7 +1486,7 @@ function jr(t) {
|
|
|
1483
1486
|
return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
|
|
1484
1487
|
}
|
|
1485
1488
|
function Ji(t, e) {
|
|
1486
|
-
return !!((e === "v4" || !e) &&
|
|
1489
|
+
return !!((e === "v4" || !e) && Vi.test(t) || (e === "v6" || !e) && Ui.test(t));
|
|
1487
1490
|
}
|
|
1488
1491
|
function Xi(t, e) {
|
|
1489
1492
|
if (!Li.test(t))
|
|
@@ -1496,7 +1499,7 @@ function Xi(t, e) {
|
|
|
1496
1499
|
}
|
|
1497
1500
|
}
|
|
1498
1501
|
function Yi(t, e) {
|
|
1499
|
-
return !!((e === "v4" || !e) &&
|
|
1502
|
+
return !!((e === "v4" || !e) && zi.test(t) || (e === "v6" || !e) && Bi.test(t));
|
|
1500
1503
|
}
|
|
1501
1504
|
class pe extends T {
|
|
1502
1505
|
_parse(e) {
|
|
@@ -1650,7 +1653,7 @@ class pe extends T {
|
|
|
1650
1653
|
validation: "base64url",
|
|
1651
1654
|
code: f.invalid_string,
|
|
1652
1655
|
message: r.message
|
|
1653
|
-
}), n.dirty()) :
|
|
1656
|
+
}), n.dirty()) : A.assertNever(r);
|
|
1654
1657
|
return { status: n.value, value: e.data };
|
|
1655
1658
|
}
|
|
1656
1659
|
_regex(e, n, s) {
|
|
@@ -1660,7 +1663,7 @@ class pe extends T {
|
|
|
1660
1663
|
}, w.errToObj(s)));
|
|
1661
1664
|
}
|
|
1662
1665
|
_addCheck(e) {
|
|
1663
|
-
return new pe(
|
|
1666
|
+
return new pe(E(d({}, this._def), {
|
|
1664
1667
|
checks: [...this._def.checks, e]
|
|
1665
1668
|
}));
|
|
1666
1669
|
}
|
|
@@ -1786,17 +1789,17 @@ class pe extends T {
|
|
|
1786
1789
|
return this.min(1, w.errToObj(e));
|
|
1787
1790
|
}
|
|
1788
1791
|
trim() {
|
|
1789
|
-
return new pe(
|
|
1792
|
+
return new pe(E(d({}, this._def), {
|
|
1790
1793
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1791
1794
|
}));
|
|
1792
1795
|
}
|
|
1793
1796
|
toLowerCase() {
|
|
1794
|
-
return new pe(
|
|
1797
|
+
return new pe(E(d({}, this._def), {
|
|
1795
1798
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1796
1799
|
}));
|
|
1797
1800
|
}
|
|
1798
1801
|
toUpperCase() {
|
|
1799
|
-
return new pe(
|
|
1802
|
+
return new pe(E(d({}, this._def), {
|
|
1800
1803
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1801
1804
|
}));
|
|
1802
1805
|
}
|
|
@@ -1865,7 +1868,7 @@ pe.create = (t) => {
|
|
|
1865
1868
|
var e;
|
|
1866
1869
|
return new pe(d({
|
|
1867
1870
|
checks: [],
|
|
1868
|
-
typeName:
|
|
1871
|
+
typeName: x.ZodString,
|
|
1869
1872
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
1870
1873
|
}, O(t)));
|
|
1871
1874
|
};
|
|
@@ -1889,7 +1892,7 @@ class Le extends T {
|
|
|
1889
1892
|
let n;
|
|
1890
1893
|
const s = new X();
|
|
1891
1894
|
for (const r of this._def.checks)
|
|
1892
|
-
r.kind === "int" ?
|
|
1895
|
+
r.kind === "int" ? A.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1893
1896
|
code: f.invalid_type,
|
|
1894
1897
|
expected: "integer",
|
|
1895
1898
|
received: "float",
|
|
@@ -1915,7 +1918,7 @@ class Le extends T {
|
|
|
1915
1918
|
}), s.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1916
1919
|
code: f.not_finite,
|
|
1917
1920
|
message: r.message
|
|
1918
|
-
}), s.dirty()) :
|
|
1921
|
+
}), s.dirty()) : A.assertNever(r);
|
|
1919
1922
|
return { status: s.value, value: e.data };
|
|
1920
1923
|
}
|
|
1921
1924
|
gte(e, n) {
|
|
@@ -1931,7 +1934,7 @@ class Le extends T {
|
|
|
1931
1934
|
return this.setLimit("max", e, !1, w.toString(n));
|
|
1932
1935
|
}
|
|
1933
1936
|
setLimit(e, n, s, r) {
|
|
1934
|
-
return new Le(
|
|
1937
|
+
return new Le(E(d({}, this._def), {
|
|
1935
1938
|
checks: [
|
|
1936
1939
|
...this._def.checks,
|
|
1937
1940
|
{
|
|
@@ -1944,7 +1947,7 @@ class Le extends T {
|
|
|
1944
1947
|
}));
|
|
1945
1948
|
}
|
|
1946
1949
|
_addCheck(e) {
|
|
1947
|
-
return new Le(
|
|
1950
|
+
return new Le(E(d({}, this._def), {
|
|
1948
1951
|
checks: [...this._def.checks, e]
|
|
1949
1952
|
}));
|
|
1950
1953
|
}
|
|
@@ -2025,7 +2028,7 @@ class Le extends T {
|
|
|
2025
2028
|
return e;
|
|
2026
2029
|
}
|
|
2027
2030
|
get isInt() {
|
|
2028
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
2031
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && A.isInteger(e.value));
|
|
2029
2032
|
}
|
|
2030
2033
|
get isFinite() {
|
|
2031
2034
|
let e = null, n = null;
|
|
@@ -2039,7 +2042,7 @@ class Le extends T {
|
|
|
2039
2042
|
}
|
|
2040
2043
|
Le.create = (t) => new Le(d({
|
|
2041
2044
|
checks: [],
|
|
2042
|
-
typeName:
|
|
2045
|
+
typeName: x.ZodNumber,
|
|
2043
2046
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2044
2047
|
}, O(t)));
|
|
2045
2048
|
class $e extends T {
|
|
@@ -2074,7 +2077,7 @@ class $e extends T {
|
|
|
2074
2077
|
code: f.not_multiple_of,
|
|
2075
2078
|
multipleOf: r.value,
|
|
2076
2079
|
message: r.message
|
|
2077
|
-
}), s.dirty()) :
|
|
2080
|
+
}), s.dirty()) : A.assertNever(r);
|
|
2078
2081
|
return { status: s.value, value: e.data };
|
|
2079
2082
|
}
|
|
2080
2083
|
_getInvalidInput(e) {
|
|
@@ -2098,7 +2101,7 @@ class $e extends T {
|
|
|
2098
2101
|
return this.setLimit("max", e, !1, w.toString(n));
|
|
2099
2102
|
}
|
|
2100
2103
|
setLimit(e, n, s, r) {
|
|
2101
|
-
return new $e(
|
|
2104
|
+
return new $e(E(d({}, this._def), {
|
|
2102
2105
|
checks: [
|
|
2103
2106
|
...this._def.checks,
|
|
2104
2107
|
{
|
|
@@ -2111,7 +2114,7 @@ class $e extends T {
|
|
|
2111
2114
|
}));
|
|
2112
2115
|
}
|
|
2113
2116
|
_addCheck(e) {
|
|
2114
|
-
return new $e(
|
|
2117
|
+
return new $e(E(d({}, this._def), {
|
|
2115
2118
|
checks: [...this._def.checks, e]
|
|
2116
2119
|
}));
|
|
2117
2120
|
}
|
|
@@ -2171,7 +2174,7 @@ $e.create = (t) => {
|
|
|
2171
2174
|
var e;
|
|
2172
2175
|
return new $e(d({
|
|
2173
2176
|
checks: [],
|
|
2174
|
-
typeName:
|
|
2177
|
+
typeName: x.ZodBigInt,
|
|
2175
2178
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
2176
2179
|
}, O(t)));
|
|
2177
2180
|
};
|
|
@@ -2189,7 +2192,7 @@ class It extends T {
|
|
|
2189
2192
|
}
|
|
2190
2193
|
}
|
|
2191
2194
|
It.create = (t) => new It(d({
|
|
2192
|
-
typeName:
|
|
2195
|
+
typeName: x.ZodBoolean,
|
|
2193
2196
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2194
2197
|
}, O(t)));
|
|
2195
2198
|
class Qe extends T {
|
|
@@ -2225,14 +2228,14 @@ class Qe extends T {
|
|
|
2225
2228
|
exact: !1,
|
|
2226
2229
|
maximum: r.value,
|
|
2227
2230
|
type: "date"
|
|
2228
|
-
}), n.dirty()) :
|
|
2231
|
+
}), n.dirty()) : A.assertNever(r);
|
|
2229
2232
|
return {
|
|
2230
2233
|
status: n.value,
|
|
2231
2234
|
value: new Date(e.data.getTime())
|
|
2232
2235
|
};
|
|
2233
2236
|
}
|
|
2234
2237
|
_addCheck(e) {
|
|
2235
|
-
return new Qe(
|
|
2238
|
+
return new Qe(E(d({}, this._def), {
|
|
2236
2239
|
checks: [...this._def.checks, e]
|
|
2237
2240
|
}));
|
|
2238
2241
|
}
|
|
@@ -2266,7 +2269,7 @@ class Qe extends T {
|
|
|
2266
2269
|
Qe.create = (t) => new Qe(d({
|
|
2267
2270
|
checks: [],
|
|
2268
2271
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
2269
|
-
typeName:
|
|
2272
|
+
typeName: x.ZodDate
|
|
2270
2273
|
}, O(t)));
|
|
2271
2274
|
class mn extends T {
|
|
2272
2275
|
_parse(e) {
|
|
@@ -2282,7 +2285,7 @@ class mn extends T {
|
|
|
2282
2285
|
}
|
|
2283
2286
|
}
|
|
2284
2287
|
mn.create = (t) => new mn(d({
|
|
2285
|
-
typeName:
|
|
2288
|
+
typeName: x.ZodSymbol
|
|
2286
2289
|
}, O(t)));
|
|
2287
2290
|
class jt extends T {
|
|
2288
2291
|
_parse(e) {
|
|
@@ -2298,7 +2301,7 @@ class jt extends T {
|
|
|
2298
2301
|
}
|
|
2299
2302
|
}
|
|
2300
2303
|
jt.create = (t) => new jt(d({
|
|
2301
|
-
typeName:
|
|
2304
|
+
typeName: x.ZodUndefined
|
|
2302
2305
|
}, O(t)));
|
|
2303
2306
|
class Zt extends T {
|
|
2304
2307
|
_parse(e) {
|
|
@@ -2314,7 +2317,7 @@ class Zt extends T {
|
|
|
2314
2317
|
}
|
|
2315
2318
|
}
|
|
2316
2319
|
Zt.create = (t) => new Zt(d({
|
|
2317
|
-
typeName:
|
|
2320
|
+
typeName: x.ZodNull
|
|
2318
2321
|
}, O(t)));
|
|
2319
2322
|
class gt extends T {
|
|
2320
2323
|
constructor() {
|
|
@@ -2325,7 +2328,7 @@ class gt extends T {
|
|
|
2325
2328
|
}
|
|
2326
2329
|
}
|
|
2327
2330
|
gt.create = (t) => new gt(d({
|
|
2328
|
-
typeName:
|
|
2331
|
+
typeName: x.ZodAny
|
|
2329
2332
|
}, O(t)));
|
|
2330
2333
|
class Xe extends T {
|
|
2331
2334
|
constructor() {
|
|
@@ -2336,7 +2339,7 @@ class Xe extends T {
|
|
|
2336
2339
|
}
|
|
2337
2340
|
}
|
|
2338
2341
|
Xe.create = (t) => new Xe(d({
|
|
2339
|
-
typeName:
|
|
2342
|
+
typeName: x.ZodUnknown
|
|
2340
2343
|
}, O(t)));
|
|
2341
2344
|
class Pe extends T {
|
|
2342
2345
|
_parse(e) {
|
|
@@ -2349,7 +2352,7 @@ class Pe extends T {
|
|
|
2349
2352
|
}
|
|
2350
2353
|
}
|
|
2351
2354
|
Pe.create = (t) => new Pe(d({
|
|
2352
|
-
typeName:
|
|
2355
|
+
typeName: x.ZodNever
|
|
2353
2356
|
}, O(t)));
|
|
2354
2357
|
class yn extends T {
|
|
2355
2358
|
_parse(e) {
|
|
@@ -2365,7 +2368,7 @@ class yn extends T {
|
|
|
2365
2368
|
}
|
|
2366
2369
|
}
|
|
2367
2370
|
yn.create = (t) => new yn(d({
|
|
2368
|
-
typeName:
|
|
2371
|
+
typeName: x.ZodVoid
|
|
2369
2372
|
}, O(t)));
|
|
2370
2373
|
class me extends T {
|
|
2371
2374
|
_parse(e) {
|
|
@@ -2403,25 +2406,25 @@ class me extends T {
|
|
|
2403
2406
|
exact: !1,
|
|
2404
2407
|
message: r.maxLength.message
|
|
2405
2408
|
}), s.dirty()), n.common.async)
|
|
2406
|
-
return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new
|
|
2407
|
-
const a = [...n.data].map((i, o) => r.type._parseSync(new
|
|
2409
|
+
return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new xe(n, i, n.path, o)))).then((i) => X.mergeArray(s, i));
|
|
2410
|
+
const a = [...n.data].map((i, o) => r.type._parseSync(new xe(n, i, n.path, o)));
|
|
2408
2411
|
return X.mergeArray(s, a);
|
|
2409
2412
|
}
|
|
2410
2413
|
get element() {
|
|
2411
2414
|
return this._def.type;
|
|
2412
2415
|
}
|
|
2413
2416
|
min(e, n) {
|
|
2414
|
-
return new me(
|
|
2417
|
+
return new me(E(d({}, this._def), {
|
|
2415
2418
|
minLength: { value: e, message: w.toString(n) }
|
|
2416
2419
|
}));
|
|
2417
2420
|
}
|
|
2418
2421
|
max(e, n) {
|
|
2419
|
-
return new me(
|
|
2422
|
+
return new me(E(d({}, this._def), {
|
|
2420
2423
|
maxLength: { value: e, message: w.toString(n) }
|
|
2421
2424
|
}));
|
|
2422
2425
|
}
|
|
2423
2426
|
length(e, n) {
|
|
2424
|
-
return new me(
|
|
2427
|
+
return new me(E(d({}, this._def), {
|
|
2425
2428
|
exactLength: { value: e, message: w.toString(n) }
|
|
2426
2429
|
}));
|
|
2427
2430
|
}
|
|
@@ -2434,30 +2437,30 @@ me.create = (t, e) => new me(d({
|
|
|
2434
2437
|
minLength: null,
|
|
2435
2438
|
maxLength: null,
|
|
2436
2439
|
exactLength: null,
|
|
2437
|
-
typeName:
|
|
2440
|
+
typeName: x.ZodArray
|
|
2438
2441
|
}, O(e)));
|
|
2439
2442
|
function ct(t) {
|
|
2440
|
-
if (t instanceof
|
|
2443
|
+
if (t instanceof V) {
|
|
2441
2444
|
const e = {};
|
|
2442
2445
|
for (const n in t.shape) {
|
|
2443
2446
|
const s = t.shape[n];
|
|
2444
2447
|
e[n] = we.create(ct(s));
|
|
2445
2448
|
}
|
|
2446
|
-
return new
|
|
2449
|
+
return new V(E(d({}, t._def), {
|
|
2447
2450
|
shape: () => e
|
|
2448
2451
|
}));
|
|
2449
|
-
} else return t instanceof me ? new me(
|
|
2452
|
+
} else return t instanceof me ? new me(E(d({}, t._def), {
|
|
2450
2453
|
type: ct(t.element)
|
|
2451
|
-
})) : t instanceof we ? we.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof
|
|
2454
|
+
})) : t instanceof we ? we.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof Ee ? Ee.create(t.items.map((e) => ct(e))) : t;
|
|
2452
2455
|
}
|
|
2453
|
-
class
|
|
2456
|
+
class V extends T {
|
|
2454
2457
|
constructor() {
|
|
2455
2458
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2456
2459
|
}
|
|
2457
2460
|
_getCached() {
|
|
2458
2461
|
if (this._cached !== null)
|
|
2459
2462
|
return this._cached;
|
|
2460
|
-
const e = this._def.shape(), n =
|
|
2463
|
+
const e = this._def.shape(), n = A.objectKeys(e);
|
|
2461
2464
|
return this._cached = { shape: e, keys: n };
|
|
2462
2465
|
}
|
|
2463
2466
|
_parse(e) {
|
|
@@ -2478,7 +2481,7 @@ class z extends T {
|
|
|
2478
2481
|
const u = r[c], h = s.data[c];
|
|
2479
2482
|
o.push({
|
|
2480
2483
|
key: { status: "valid", value: c },
|
|
2481
|
-
value: u._parse(new
|
|
2484
|
+
value: u._parse(new xe(s, h, s.path, c)),
|
|
2482
2485
|
alwaysSet: c in s.data
|
|
2483
2486
|
});
|
|
2484
2487
|
}
|
|
@@ -2503,7 +2506,7 @@ class z extends T {
|
|
|
2503
2506
|
o.push({
|
|
2504
2507
|
key: { status: "valid", value: u },
|
|
2505
2508
|
value: c._parse(
|
|
2506
|
-
new
|
|
2509
|
+
new xe(s, h, s.path, u)
|
|
2507
2510
|
//, ctx.child(key), value, getParsedType(value)
|
|
2508
2511
|
),
|
|
2509
2512
|
alwaysSet: u in s.data
|
|
@@ -2527,7 +2530,7 @@ class z extends T {
|
|
|
2527
2530
|
return this._def.shape();
|
|
2528
2531
|
}
|
|
2529
2532
|
strict(e) {
|
|
2530
|
-
return w.errToObj, new
|
|
2533
|
+
return w.errToObj, new V(d(E(d({}, this._def), {
|
|
2531
2534
|
unknownKeys: "strict"
|
|
2532
2535
|
}), e !== void 0 ? {
|
|
2533
2536
|
errorMap: (n, s) => {
|
|
@@ -2542,12 +2545,12 @@ class z extends T {
|
|
|
2542
2545
|
} : {}));
|
|
2543
2546
|
}
|
|
2544
2547
|
strip() {
|
|
2545
|
-
return new
|
|
2548
|
+
return new V(E(d({}, this._def), {
|
|
2546
2549
|
unknownKeys: "strip"
|
|
2547
2550
|
}));
|
|
2548
2551
|
}
|
|
2549
2552
|
passthrough() {
|
|
2550
|
-
return new
|
|
2553
|
+
return new V(E(d({}, this._def), {
|
|
2551
2554
|
unknownKeys: "passthrough"
|
|
2552
2555
|
}));
|
|
2553
2556
|
}
|
|
@@ -2569,7 +2572,7 @@ class z extends T {
|
|
|
2569
2572
|
// }) as any;
|
|
2570
2573
|
// };
|
|
2571
2574
|
extend(e) {
|
|
2572
|
-
return new
|
|
2575
|
+
return new V(E(d({}, this._def), {
|
|
2573
2576
|
shape: () => d(d({}, this._def.shape()), e)
|
|
2574
2577
|
}));
|
|
2575
2578
|
}
|
|
@@ -2579,11 +2582,11 @@ class z extends T {
|
|
|
2579
2582
|
* upgrade if you are experiencing issues.
|
|
2580
2583
|
*/
|
|
2581
2584
|
merge(e) {
|
|
2582
|
-
return new
|
|
2585
|
+
return new V({
|
|
2583
2586
|
unknownKeys: e._def.unknownKeys,
|
|
2584
2587
|
catchall: e._def.catchall,
|
|
2585
2588
|
shape: () => d(d({}, this._def.shape()), e._def.shape()),
|
|
2586
|
-
typeName:
|
|
2589
|
+
typeName: x.ZodObject
|
|
2587
2590
|
});
|
|
2588
2591
|
}
|
|
2589
2592
|
// merge<
|
|
@@ -2646,23 +2649,23 @@ class z extends T {
|
|
|
2646
2649
|
// return merged;
|
|
2647
2650
|
// }
|
|
2648
2651
|
catchall(e) {
|
|
2649
|
-
return new
|
|
2652
|
+
return new V(E(d({}, this._def), {
|
|
2650
2653
|
catchall: e
|
|
2651
2654
|
}));
|
|
2652
2655
|
}
|
|
2653
2656
|
pick(e) {
|
|
2654
2657
|
const n = {};
|
|
2655
|
-
return
|
|
2658
|
+
return A.objectKeys(e).forEach((s) => {
|
|
2656
2659
|
e[s] && this.shape[s] && (n[s] = this.shape[s]);
|
|
2657
|
-
}), new
|
|
2660
|
+
}), new V(E(d({}, this._def), {
|
|
2658
2661
|
shape: () => n
|
|
2659
2662
|
}));
|
|
2660
2663
|
}
|
|
2661
2664
|
omit(e) {
|
|
2662
2665
|
const n = {};
|
|
2663
|
-
return
|
|
2666
|
+
return A.objectKeys(this.shape).forEach((s) => {
|
|
2664
2667
|
e[s] || (n[s] = this.shape[s]);
|
|
2665
|
-
}), new
|
|
2668
|
+
}), new V(E(d({}, this._def), {
|
|
2666
2669
|
shape: () => n
|
|
2667
2670
|
}));
|
|
2668
2671
|
}
|
|
@@ -2674,16 +2677,16 @@ class z extends T {
|
|
|
2674
2677
|
}
|
|
2675
2678
|
partial(e) {
|
|
2676
2679
|
const n = {};
|
|
2677
|
-
return
|
|
2680
|
+
return A.objectKeys(this.shape).forEach((s) => {
|
|
2678
2681
|
const r = this.shape[s];
|
|
2679
2682
|
e && !e[s] ? n[s] = r : n[s] = r.optional();
|
|
2680
|
-
}), new
|
|
2683
|
+
}), new V(E(d({}, this._def), {
|
|
2681
2684
|
shape: () => n
|
|
2682
2685
|
}));
|
|
2683
2686
|
}
|
|
2684
2687
|
required(e) {
|
|
2685
2688
|
const n = {};
|
|
2686
|
-
return
|
|
2689
|
+
return A.objectKeys(this.shape).forEach((s) => {
|
|
2687
2690
|
if (e && !e[s])
|
|
2688
2691
|
n[s] = this.shape[s];
|
|
2689
2692
|
else {
|
|
@@ -2692,31 +2695,31 @@ class z extends T {
|
|
|
2692
2695
|
r = r._def.innerType;
|
|
2693
2696
|
n[s] = r;
|
|
2694
2697
|
}
|
|
2695
|
-
}), new
|
|
2698
|
+
}), new V(E(d({}, this._def), {
|
|
2696
2699
|
shape: () => n
|
|
2697
2700
|
}));
|
|
2698
2701
|
}
|
|
2699
2702
|
keyof() {
|
|
2700
|
-
return Zr(
|
|
2703
|
+
return Zr(A.objectKeys(this.shape));
|
|
2701
2704
|
}
|
|
2702
2705
|
}
|
|
2703
|
-
|
|
2706
|
+
V.create = (t, e) => new V(d({
|
|
2704
2707
|
shape: () => t,
|
|
2705
2708
|
unknownKeys: "strip",
|
|
2706
2709
|
catchall: Pe.create(),
|
|
2707
|
-
typeName:
|
|
2710
|
+
typeName: x.ZodObject
|
|
2708
2711
|
}, O(e)));
|
|
2709
|
-
|
|
2712
|
+
V.strictCreate = (t, e) => new V(d({
|
|
2710
2713
|
shape: () => t,
|
|
2711
2714
|
unknownKeys: "strict",
|
|
2712
2715
|
catchall: Pe.create(),
|
|
2713
|
-
typeName:
|
|
2716
|
+
typeName: x.ZodObject
|
|
2714
2717
|
}, O(e)));
|
|
2715
|
-
|
|
2718
|
+
V.lazycreate = (t, e) => new V(d({
|
|
2716
2719
|
shape: t,
|
|
2717
2720
|
unknownKeys: "strip",
|
|
2718
2721
|
catchall: Pe.create(),
|
|
2719
|
-
typeName:
|
|
2722
|
+
typeName: x.ZodObject
|
|
2720
2723
|
}, O(e)));
|
|
2721
2724
|
class Dt extends T {
|
|
2722
2725
|
_parse(e) {
|
|
@@ -2736,8 +2739,8 @@ class Dt extends T {
|
|
|
2736
2739
|
}
|
|
2737
2740
|
if (n.common.async)
|
|
2738
2741
|
return Promise.all(s.map((a) => ke(this, null, function* () {
|
|
2739
|
-
const i =
|
|
2740
|
-
common:
|
|
2742
|
+
const i = E(d({}, n), {
|
|
2743
|
+
common: E(d({}, n.common), {
|
|
2741
2744
|
issues: []
|
|
2742
2745
|
}),
|
|
2743
2746
|
parent: null
|
|
@@ -2755,8 +2758,8 @@ class Dt extends T {
|
|
|
2755
2758
|
let a;
|
|
2756
2759
|
const i = [];
|
|
2757
2760
|
for (const c of s) {
|
|
2758
|
-
const u =
|
|
2759
|
-
common:
|
|
2761
|
+
const u = E(d({}, n), {
|
|
2762
|
+
common: E(d({}, n.common), {
|
|
2760
2763
|
issues: []
|
|
2761
2764
|
}),
|
|
2762
2765
|
parent: null
|
|
@@ -2784,10 +2787,10 @@ class Dt extends T {
|
|
|
2784
2787
|
}
|
|
2785
2788
|
Dt.create = (t, e) => new Dt(d({
|
|
2786
2789
|
options: t,
|
|
2787
|
-
typeName:
|
|
2790
|
+
typeName: x.ZodUnion
|
|
2788
2791
|
}, O(e)));
|
|
2789
|
-
const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof ye ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ?
|
|
2790
|
-
class
|
|
2792
|
+
const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof ye ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ? A.objectValues(t.enum) : t instanceof Vt ? Ze(t._def.innerType) : t instanceof jt ? [void 0] : t instanceof Zt ? [null] : t instanceof we ? [void 0, ...Ze(t.unwrap())] : t instanceof We ? [null, ...Ze(t.unwrap())] : t instanceof Ns || t instanceof Ut ? Ze(t.unwrap()) : t instanceof zt ? Ze(t._def.innerType) : [];
|
|
2793
|
+
class xn extends T {
|
|
2791
2794
|
_parse(e) {
|
|
2792
2795
|
const { ctx: n } = this._processInputParams(e);
|
|
2793
2796
|
if (n.parsedType !== _.object)
|
|
@@ -2840,8 +2843,8 @@ class En extends T {
|
|
|
2840
2843
|
r.set(o, a);
|
|
2841
2844
|
}
|
|
2842
2845
|
}
|
|
2843
|
-
return new
|
|
2844
|
-
typeName:
|
|
2846
|
+
return new xn(d({
|
|
2847
|
+
typeName: x.ZodDiscriminatedUnion,
|
|
2845
2848
|
discriminator: e,
|
|
2846
2849
|
options: n,
|
|
2847
2850
|
optionsMap: r
|
|
@@ -2853,7 +2856,7 @@ function rs(t, e) {
|
|
|
2853
2856
|
if (t === e)
|
|
2854
2857
|
return { valid: !0, data: t };
|
|
2855
2858
|
if (n === _.object && s === _.object) {
|
|
2856
|
-
const r =
|
|
2859
|
+
const r = A.objectKeys(e), a = A.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = d(d({}, t), e);
|
|
2857
2860
|
for (const o of a) {
|
|
2858
2861
|
const c = rs(t[o], e[o]);
|
|
2859
2862
|
if (!c.valid)
|
|
@@ -2909,9 +2912,9 @@ class Mt extends T {
|
|
|
2909
2912
|
Mt.create = (t, e, n) => new Mt(d({
|
|
2910
2913
|
left: t,
|
|
2911
2914
|
right: e,
|
|
2912
|
-
typeName:
|
|
2915
|
+
typeName: x.ZodIntersection
|
|
2913
2916
|
}, O(n)));
|
|
2914
|
-
class
|
|
2917
|
+
class Ee extends T {
|
|
2915
2918
|
_parse(e) {
|
|
2916
2919
|
const { status: n, ctx: s } = this._processInputParams(e);
|
|
2917
2920
|
if (s.parsedType !== _.array)
|
|
@@ -2937,7 +2940,7 @@ class xe extends T {
|
|
|
2937
2940
|
}), n.dirty());
|
|
2938
2941
|
const r = [...s.data].map((a, i) => {
|
|
2939
2942
|
const o = this._def.items[i] || this._def.rest;
|
|
2940
|
-
return o ? o._parse(new
|
|
2943
|
+
return o ? o._parse(new xe(s, a, s.path, i)) : null;
|
|
2941
2944
|
}).filter((a) => !!a);
|
|
2942
2945
|
return s.common.async ? Promise.all(r).then((a) => X.mergeArray(n, a)) : X.mergeArray(n, r);
|
|
2943
2946
|
}
|
|
@@ -2945,17 +2948,17 @@ class xe extends T {
|
|
|
2945
2948
|
return this._def.items;
|
|
2946
2949
|
}
|
|
2947
2950
|
rest(e) {
|
|
2948
|
-
return new
|
|
2951
|
+
return new Ee(E(d({}, this._def), {
|
|
2949
2952
|
rest: e
|
|
2950
2953
|
}));
|
|
2951
2954
|
}
|
|
2952
2955
|
}
|
|
2953
|
-
|
|
2956
|
+
Ee.create = (t, e) => {
|
|
2954
2957
|
if (!Array.isArray(t))
|
|
2955
2958
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2956
|
-
return new
|
|
2959
|
+
return new Ee(d({
|
|
2957
2960
|
items: t,
|
|
2958
|
-
typeName:
|
|
2961
|
+
typeName: x.ZodTuple,
|
|
2959
2962
|
rest: null
|
|
2960
2963
|
}, O(e)));
|
|
2961
2964
|
};
|
|
@@ -2977,8 +2980,8 @@ class Lt extends T {
|
|
|
2977
2980
|
const r = [], a = this._def.keyType, i = this._def.valueType;
|
|
2978
2981
|
for (const o in s.data)
|
|
2979
2982
|
r.push({
|
|
2980
|
-
key: a._parse(new
|
|
2981
|
-
value: i._parse(new
|
|
2983
|
+
key: a._parse(new xe(s, o, s.path, o)),
|
|
2984
|
+
value: i._parse(new xe(s, s.data[o], s.path, o)),
|
|
2982
2985
|
alwaysSet: o in s.data
|
|
2983
2986
|
});
|
|
2984
2987
|
return s.common.async ? X.mergeObjectAsync(n, r) : X.mergeObjectSync(n, r);
|
|
@@ -2990,11 +2993,11 @@ class Lt extends T {
|
|
|
2990
2993
|
return n instanceof T ? new Lt(d({
|
|
2991
2994
|
keyType: e,
|
|
2992
2995
|
valueType: n,
|
|
2993
|
-
typeName:
|
|
2996
|
+
typeName: x.ZodRecord
|
|
2994
2997
|
}, O(s))) : new Lt(d({
|
|
2995
2998
|
keyType: pe.create(),
|
|
2996
2999
|
valueType: e,
|
|
2997
|
-
typeName:
|
|
3000
|
+
typeName: x.ZodRecord
|
|
2998
3001
|
}, O(n)));
|
|
2999
3002
|
}
|
|
3000
3003
|
}
|
|
@@ -3014,8 +3017,8 @@ class gn extends T {
|
|
|
3014
3017
|
received: s.parsedType
|
|
3015
3018
|
}), S;
|
|
3016
3019
|
const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
|
|
3017
|
-
key: r._parse(new
|
|
3018
|
-
value: a._parse(new
|
|
3020
|
+
key: r._parse(new xe(s, o, s.path, [u, "key"])),
|
|
3021
|
+
value: a._parse(new xe(s, c, s.path, [u, "value"]))
|
|
3019
3022
|
}));
|
|
3020
3023
|
if (s.common.async) {
|
|
3021
3024
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -3043,7 +3046,7 @@ class gn extends T {
|
|
|
3043
3046
|
gn.create = (t, e, n) => new gn(d({
|
|
3044
3047
|
valueType: e,
|
|
3045
3048
|
keyType: t,
|
|
3046
|
-
typeName:
|
|
3049
|
+
typeName: x.ZodMap
|
|
3047
3050
|
}, O(n)));
|
|
3048
3051
|
class et extends T {
|
|
3049
3052
|
_parse(e) {
|
|
@@ -3080,16 +3083,16 @@ class et extends T {
|
|
|
3080
3083
|
}
|
|
3081
3084
|
return { status: n.value, value: u };
|
|
3082
3085
|
}
|
|
3083
|
-
const o = [...s.data.values()].map((c, u) => a._parse(new
|
|
3086
|
+
const o = [...s.data.values()].map((c, u) => a._parse(new xe(s, c, s.path, u)));
|
|
3084
3087
|
return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
3085
3088
|
}
|
|
3086
3089
|
min(e, n) {
|
|
3087
|
-
return new et(
|
|
3090
|
+
return new et(E(d({}, this._def), {
|
|
3088
3091
|
minSize: { value: e, message: w.toString(n) }
|
|
3089
3092
|
}));
|
|
3090
3093
|
}
|
|
3091
3094
|
max(e, n) {
|
|
3092
|
-
return new et(
|
|
3095
|
+
return new et(E(d({}, this._def), {
|
|
3093
3096
|
maxSize: { value: e, message: w.toString(n) }
|
|
3094
3097
|
}));
|
|
3095
3098
|
}
|
|
@@ -3104,7 +3107,7 @@ et.create = (t, e) => new et(d({
|
|
|
3104
3107
|
valueType: t,
|
|
3105
3108
|
minSize: null,
|
|
3106
3109
|
maxSize: null,
|
|
3107
|
-
typeName:
|
|
3110
|
+
typeName: x.ZodSet
|
|
3108
3111
|
}, O(e)));
|
|
3109
3112
|
class ht extends T {
|
|
3110
3113
|
constructor() {
|
|
@@ -3183,12 +3186,12 @@ class ht extends T {
|
|
|
3183
3186
|
return this._def.returns;
|
|
3184
3187
|
}
|
|
3185
3188
|
args(...e) {
|
|
3186
|
-
return new ht(
|
|
3187
|
-
args:
|
|
3189
|
+
return new ht(E(d({}, this._def), {
|
|
3190
|
+
args: Ee.create(e).rest(Xe.create())
|
|
3188
3191
|
}));
|
|
3189
3192
|
}
|
|
3190
3193
|
returns(e) {
|
|
3191
|
-
return new ht(
|
|
3194
|
+
return new ht(E(d({}, this._def), {
|
|
3192
3195
|
returns: e
|
|
3193
3196
|
}));
|
|
3194
3197
|
}
|
|
@@ -3200,9 +3203,9 @@ class ht extends T {
|
|
|
3200
3203
|
}
|
|
3201
3204
|
static create(e, n, s) {
|
|
3202
3205
|
return new ht(d({
|
|
3203
|
-
args: e ||
|
|
3206
|
+
args: e || Ee.create([]).rest(Xe.create()),
|
|
3204
3207
|
returns: n || Xe.create(),
|
|
3205
|
-
typeName:
|
|
3208
|
+
typeName: x.ZodFunction
|
|
3206
3209
|
}, O(s)));
|
|
3207
3210
|
}
|
|
3208
3211
|
}
|
|
@@ -3217,7 +3220,7 @@ class $t extends T {
|
|
|
3217
3220
|
}
|
|
3218
3221
|
$t.create = (t, e) => new $t(d({
|
|
3219
3222
|
getter: t,
|
|
3220
|
-
typeName:
|
|
3223
|
+
typeName: x.ZodLazy
|
|
3221
3224
|
}, O(e)));
|
|
3222
3225
|
class Ft extends T {
|
|
3223
3226
|
_parse(e) {
|
|
@@ -3237,12 +3240,12 @@ class Ft extends T {
|
|
|
3237
3240
|
}
|
|
3238
3241
|
Ft.create = (t, e) => new Ft(d({
|
|
3239
3242
|
value: t,
|
|
3240
|
-
typeName:
|
|
3243
|
+
typeName: x.ZodLiteral
|
|
3241
3244
|
}, O(e)));
|
|
3242
3245
|
function Zr(t, e) {
|
|
3243
3246
|
return new Fe(d({
|
|
3244
3247
|
values: t,
|
|
3245
|
-
typeName:
|
|
3248
|
+
typeName: x.ZodEnum
|
|
3246
3249
|
}, O(e)));
|
|
3247
3250
|
}
|
|
3248
3251
|
class Fe extends T {
|
|
@@ -3253,7 +3256,7 @@ class Fe extends T {
|
|
|
3253
3256
|
if (typeof e.data != "string") {
|
|
3254
3257
|
const n = this._getOrReturnCtx(e), s = this._def.values;
|
|
3255
3258
|
return g(n, {
|
|
3256
|
-
expected:
|
|
3259
|
+
expected: A.joinValues(s),
|
|
3257
3260
|
received: n.parsedType,
|
|
3258
3261
|
code: f.invalid_type
|
|
3259
3262
|
}), S;
|
|
@@ -3303,17 +3306,17 @@ class Wt extends T {
|
|
|
3303
3306
|
super(...arguments), Tt.set(this, void 0);
|
|
3304
3307
|
}
|
|
3305
3308
|
_parse(e) {
|
|
3306
|
-
const n =
|
|
3309
|
+
const n = A.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
3307
3310
|
if (s.parsedType !== _.string && s.parsedType !== _.number) {
|
|
3308
|
-
const r =
|
|
3311
|
+
const r = A.objectValues(n);
|
|
3309
3312
|
return g(s, {
|
|
3310
|
-
expected:
|
|
3313
|
+
expected: A.joinValues(r),
|
|
3311
3314
|
received: s.parsedType,
|
|
3312
3315
|
code: f.invalid_type
|
|
3313
3316
|
}), S;
|
|
3314
3317
|
}
|
|
3315
|
-
if (pn(this, Tt) || Rr(this, Tt, new Set(
|
|
3316
|
-
const r =
|
|
3318
|
+
if (pn(this, Tt) || Rr(this, Tt, new Set(A.getValidEnumValues(this._def.values))), !pn(this, Tt).has(e.data)) {
|
|
3319
|
+
const r = A.objectValues(n);
|
|
3317
3320
|
return g(s, {
|
|
3318
3321
|
received: s.data,
|
|
3319
3322
|
code: f.invalid_enum_value,
|
|
@@ -3329,7 +3332,7 @@ class Wt extends T {
|
|
|
3329
3332
|
Tt = /* @__PURE__ */ new WeakMap();
|
|
3330
3333
|
Wt.create = (t, e) => new Wt(d({
|
|
3331
3334
|
values: t,
|
|
3332
|
-
typeName:
|
|
3335
|
+
typeName: x.ZodNativeEnum
|
|
3333
3336
|
}, O(e)));
|
|
3334
3337
|
class vt extends T {
|
|
3335
3338
|
unwrap() {
|
|
@@ -3352,14 +3355,14 @@ class vt extends T {
|
|
|
3352
3355
|
}
|
|
3353
3356
|
vt.create = (t, e) => new vt(d({
|
|
3354
3357
|
type: t,
|
|
3355
|
-
typeName:
|
|
3358
|
+
typeName: x.ZodPromise
|
|
3356
3359
|
}, O(e)));
|
|
3357
3360
|
class ye extends T {
|
|
3358
3361
|
innerType() {
|
|
3359
3362
|
return this._def.schema;
|
|
3360
3363
|
}
|
|
3361
3364
|
sourceType() {
|
|
3362
|
-
return this._def.schema._def.typeName ===
|
|
3365
|
+
return this._def.schema._def.typeName === x.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3363
3366
|
}
|
|
3364
3367
|
_parse(e) {
|
|
3365
3368
|
const { status: n, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
|
|
@@ -3428,18 +3431,18 @@ class ye extends T {
|
|
|
3428
3431
|
return { status: n.value, value: o };
|
|
3429
3432
|
} else
|
|
3430
3433
|
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => Ye(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({ status: n.value, value: o })) : i);
|
|
3431
|
-
|
|
3434
|
+
A.assertNever(r);
|
|
3432
3435
|
}
|
|
3433
3436
|
}
|
|
3434
3437
|
ye.create = (t, e, n) => new ye(d({
|
|
3435
3438
|
schema: t,
|
|
3436
|
-
typeName:
|
|
3439
|
+
typeName: x.ZodEffects,
|
|
3437
3440
|
effect: e
|
|
3438
3441
|
}, O(n)));
|
|
3439
3442
|
ye.createWithPreprocess = (t, e, n) => new ye(d({
|
|
3440
3443
|
schema: e,
|
|
3441
3444
|
effect: { type: "preprocess", transform: t },
|
|
3442
|
-
typeName:
|
|
3445
|
+
typeName: x.ZodEffects
|
|
3443
3446
|
}, O(n)));
|
|
3444
3447
|
class we extends T {
|
|
3445
3448
|
_parse(e) {
|
|
@@ -3451,7 +3454,7 @@ class we extends T {
|
|
|
3451
3454
|
}
|
|
3452
3455
|
we.create = (t, e) => new we(d({
|
|
3453
3456
|
innerType: t,
|
|
3454
|
-
typeName:
|
|
3457
|
+
typeName: x.ZodOptional
|
|
3455
3458
|
}, O(e)));
|
|
3456
3459
|
class We extends T {
|
|
3457
3460
|
_parse(e) {
|
|
@@ -3463,9 +3466,9 @@ class We extends T {
|
|
|
3463
3466
|
}
|
|
3464
3467
|
We.create = (t, e) => new We(d({
|
|
3465
3468
|
innerType: t,
|
|
3466
|
-
typeName:
|
|
3469
|
+
typeName: x.ZodNullable
|
|
3467
3470
|
}, O(e)));
|
|
3468
|
-
class
|
|
3471
|
+
class Vt extends T {
|
|
3469
3472
|
_parse(e) {
|
|
3470
3473
|
const { ctx: n } = this._processInputParams(e);
|
|
3471
3474
|
let s = n.data;
|
|
@@ -3479,15 +3482,15 @@ class zt extends T {
|
|
|
3479
3482
|
return this._def.innerType;
|
|
3480
3483
|
}
|
|
3481
3484
|
}
|
|
3482
|
-
|
|
3485
|
+
Vt.create = (t, e) => new Vt(d({
|
|
3483
3486
|
innerType: t,
|
|
3484
|
-
typeName:
|
|
3487
|
+
typeName: x.ZodDefault,
|
|
3485
3488
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default
|
|
3486
3489
|
}, O(e)));
|
|
3487
|
-
class
|
|
3490
|
+
class zt extends T {
|
|
3488
3491
|
_parse(e) {
|
|
3489
|
-
const { ctx: n } = this._processInputParams(e), s =
|
|
3490
|
-
common:
|
|
3492
|
+
const { ctx: n } = this._processInputParams(e), s = E(d({}, n), {
|
|
3493
|
+
common: E(d({}, n.common), {
|
|
3491
3494
|
issues: []
|
|
3492
3495
|
})
|
|
3493
3496
|
}), r = this._def.innerType._parse({
|
|
@@ -3517,9 +3520,9 @@ class Vt extends T {
|
|
|
3517
3520
|
return this._def.innerType;
|
|
3518
3521
|
}
|
|
3519
3522
|
}
|
|
3520
|
-
|
|
3523
|
+
zt.create = (t, e) => new zt(d({
|
|
3521
3524
|
innerType: t,
|
|
3522
|
-
typeName:
|
|
3525
|
+
typeName: x.ZodCatch,
|
|
3523
3526
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
|
|
3524
3527
|
}, O(e)));
|
|
3525
3528
|
class vn extends T {
|
|
@@ -3536,7 +3539,7 @@ class vn extends T {
|
|
|
3536
3539
|
}
|
|
3537
3540
|
}
|
|
3538
3541
|
vn.create = (t) => new vn(d({
|
|
3539
|
-
typeName:
|
|
3542
|
+
typeName: x.ZodNaN
|
|
3540
3543
|
}, O(t)));
|
|
3541
3544
|
const eo = Symbol("zod_brand");
|
|
3542
3545
|
class Ns extends T {
|
|
@@ -3588,7 +3591,7 @@ class Jt extends T {
|
|
|
3588
3591
|
return new Jt({
|
|
3589
3592
|
in: e,
|
|
3590
3593
|
out: n,
|
|
3591
|
-
typeName:
|
|
3594
|
+
typeName: x.ZodPipeline
|
|
3592
3595
|
});
|
|
3593
3596
|
}
|
|
3594
3597
|
}
|
|
@@ -3603,7 +3606,7 @@ class Ut extends T {
|
|
|
3603
3606
|
}
|
|
3604
3607
|
Ut.create = (t, e) => new Ut(d({
|
|
3605
3608
|
innerType: t,
|
|
3606
|
-
typeName:
|
|
3609
|
+
typeName: x.ZodReadonly
|
|
3607
3610
|
}, O(e)));
|
|
3608
3611
|
function ar(t, e) {
|
|
3609
3612
|
const n = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
|
|
@@ -3618,34 +3621,34 @@ function Dr(t, e = {}, n) {
|
|
|
3618
3621
|
var u, h;
|
|
3619
3622
|
if (!c) {
|
|
3620
3623
|
const p = ar(e, s), k = (h = (u = p.fatal) !== null && u !== void 0 ? u : n) !== null && h !== void 0 ? h : !0;
|
|
3621
|
-
r.addIssue(
|
|
3624
|
+
r.addIssue(E(d({ code: "custom" }, p), { fatal: k }));
|
|
3622
3625
|
}
|
|
3623
3626
|
});
|
|
3624
3627
|
if (!o) {
|
|
3625
3628
|
const c = ar(e, s), u = (i = (a = c.fatal) !== null && a !== void 0 ? a : n) !== null && i !== void 0 ? i : !0;
|
|
3626
|
-
r.addIssue(
|
|
3629
|
+
r.addIssue(E(d({ code: "custom" }, c), { fatal: u }));
|
|
3627
3630
|
}
|
|
3628
3631
|
}) : gt.create();
|
|
3629
3632
|
}
|
|
3630
3633
|
const to = {
|
|
3631
|
-
object:
|
|
3634
|
+
object: V.lazycreate
|
|
3632
3635
|
};
|
|
3633
|
-
var
|
|
3636
|
+
var x;
|
|
3634
3637
|
(function(t) {
|
|
3635
3638
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
3636
|
-
})(
|
|
3639
|
+
})(x || (x = {}));
|
|
3637
3640
|
const no = (t, e = {
|
|
3638
3641
|
message: `Input not instance of ${t.name}`
|
|
3639
|
-
}) => Dr((n) => n instanceof t, e), Mr = pe.create, Lr = Le.create, so = vn.create, ro = $e.create, $r = It.create, ao = Qe.create, io = mn.create, oo = jt.create, co = Zt.create, uo = gt.create, lo = Xe.create, fo = Pe.create, ho = yn.create, po = me.create, mo =
|
|
3640
|
-
string: (t) => pe.create(
|
|
3641
|
-
number: (t) => Le.create(
|
|
3642
|
-
boolean: (t) => It.create(
|
|
3642
|
+
}) => Dr((n) => n instanceof t, e), Mr = pe.create, Lr = Le.create, so = vn.create, ro = $e.create, $r = It.create, ao = Qe.create, io = mn.create, oo = jt.create, co = Zt.create, uo = gt.create, lo = Xe.create, fo = Pe.create, ho = yn.create, po = me.create, mo = V.create, yo = V.strictCreate, go = Dt.create, vo = xn.create, _o = Mt.create, bo = Ee.create, wo = Lt.create, ko = gn.create, xo = et.create, Eo = ht.create, So = $t.create, Oo = Ft.create, To = Fe.create, Co = Wt.create, Ao = vt.create, ir = ye.create, No = we.create, Ro = We.create, Po = ye.createWithPreprocess, Io = Jt.create, jo = () => Mr().optional(), Zo = () => Lr().optional(), Do = () => $r().optional(), Mo = {
|
|
3643
|
+
string: (t) => pe.create(E(d({}, t), { coerce: !0 })),
|
|
3644
|
+
number: (t) => Le.create(E(d({}, t), { coerce: !0 })),
|
|
3645
|
+
boolean: (t) => It.create(E(d({}, t), {
|
|
3643
3646
|
coerce: !0
|
|
3644
3647
|
})),
|
|
3645
|
-
bigint: (t) => $e.create(
|
|
3646
|
-
date: (t) => Qe.create(
|
|
3648
|
+
bigint: (t) => $e.create(E(d({}, t), { coerce: !0 })),
|
|
3649
|
+
date: (t) => Qe.create(E(d({}, t), { coerce: !0 }))
|
|
3647
3650
|
}, Lo = S;
|
|
3648
|
-
var
|
|
3651
|
+
var I = /* @__PURE__ */ Object.freeze({
|
|
3649
3652
|
__proto__: null,
|
|
3650
3653
|
defaultErrorMap: yt,
|
|
3651
3654
|
setErrorMap: Ri,
|
|
@@ -3662,7 +3665,7 @@ var M = /* @__PURE__ */ Object.freeze({
|
|
|
3662
3665
|
isValid: Ye,
|
|
3663
3666
|
isAsync: Pt,
|
|
3664
3667
|
get util() {
|
|
3665
|
-
return
|
|
3668
|
+
return A;
|
|
3666
3669
|
},
|
|
3667
3670
|
get objectUtil() {
|
|
3668
3671
|
return ts;
|
|
@@ -3684,11 +3687,11 @@ var M = /* @__PURE__ */ Object.freeze({
|
|
|
3684
3687
|
ZodNever: Pe,
|
|
3685
3688
|
ZodVoid: yn,
|
|
3686
3689
|
ZodArray: me,
|
|
3687
|
-
ZodObject:
|
|
3690
|
+
ZodObject: V,
|
|
3688
3691
|
ZodUnion: Dt,
|
|
3689
|
-
ZodDiscriminatedUnion:
|
|
3692
|
+
ZodDiscriminatedUnion: xn,
|
|
3690
3693
|
ZodIntersection: Mt,
|
|
3691
|
-
ZodTuple:
|
|
3694
|
+
ZodTuple: Ee,
|
|
3692
3695
|
ZodRecord: Lt,
|
|
3693
3696
|
ZodMap: gn,
|
|
3694
3697
|
ZodSet: et,
|
|
@@ -3702,8 +3705,8 @@ var M = /* @__PURE__ */ Object.freeze({
|
|
|
3702
3705
|
ZodTransformer: ye,
|
|
3703
3706
|
ZodOptional: we,
|
|
3704
3707
|
ZodNullable: We,
|
|
3705
|
-
ZodDefault:
|
|
3706
|
-
ZodCatch:
|
|
3708
|
+
ZodDefault: Vt,
|
|
3709
|
+
ZodCatch: zt,
|
|
3707
3710
|
ZodNaN: vn,
|
|
3708
3711
|
BRAND: eo,
|
|
3709
3712
|
ZodBranded: Ns,
|
|
@@ -3714,7 +3717,7 @@ var M = /* @__PURE__ */ Object.freeze({
|
|
|
3714
3717
|
ZodSchema: T,
|
|
3715
3718
|
late: to,
|
|
3716
3719
|
get ZodFirstPartyTypeKind() {
|
|
3717
|
-
return
|
|
3720
|
+
return x;
|
|
3718
3721
|
},
|
|
3719
3722
|
coerce: Mo,
|
|
3720
3723
|
any: uo,
|
|
@@ -3725,14 +3728,14 @@ var M = /* @__PURE__ */ Object.freeze({
|
|
|
3725
3728
|
discriminatedUnion: vo,
|
|
3726
3729
|
effect: ir,
|
|
3727
3730
|
enum: To,
|
|
3728
|
-
function:
|
|
3731
|
+
function: Eo,
|
|
3729
3732
|
instanceof: no,
|
|
3730
3733
|
intersection: _o,
|
|
3731
3734
|
lazy: So,
|
|
3732
3735
|
literal: Oo,
|
|
3733
3736
|
map: ko,
|
|
3734
3737
|
nan: so,
|
|
3735
|
-
nativeEnum:
|
|
3738
|
+
nativeEnum: Co,
|
|
3736
3739
|
never: fo,
|
|
3737
3740
|
null: co,
|
|
3738
3741
|
nullable: Ro,
|
|
@@ -3744,9 +3747,9 @@ var M = /* @__PURE__ */ Object.freeze({
|
|
|
3744
3747
|
ostring: jo,
|
|
3745
3748
|
pipeline: Io,
|
|
3746
3749
|
preprocess: Po,
|
|
3747
|
-
promise:
|
|
3750
|
+
promise: Ao,
|
|
3748
3751
|
record: wo,
|
|
3749
|
-
set:
|
|
3752
|
+
set: xo,
|
|
3750
3753
|
strictObject: yo,
|
|
3751
3754
|
string: Mr,
|
|
3752
3755
|
symbol: io,
|
|
@@ -3761,16 +3764,16 @@ var M = /* @__PURE__ */ Object.freeze({
|
|
|
3761
3764
|
quotelessJson: Ni,
|
|
3762
3765
|
ZodError: ie
|
|
3763
3766
|
});
|
|
3764
|
-
|
|
3765
|
-
language:
|
|
3766
|
-
disableMarkedForExport:
|
|
3767
|
-
allowAutoSelectFirstNode:
|
|
3767
|
+
I.object({
|
|
3768
|
+
language: I.enum(["typescript", "javascript"]).optional(),
|
|
3769
|
+
disableMarkedForExport: I.boolean().optional(),
|
|
3770
|
+
allowAutoSelectFirstNode: I.boolean().optional().default(!0)
|
|
3768
3771
|
}).and(
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
framework:
|
|
3772
|
-
model:
|
|
3773
|
-
styling:
|
|
3772
|
+
I.union([
|
|
3773
|
+
I.object({
|
|
3774
|
+
framework: I.literal("react"),
|
|
3775
|
+
model: I.string().optional(),
|
|
3776
|
+
styling: I.enum([
|
|
3774
3777
|
"plain_css",
|
|
3775
3778
|
"css_modules",
|
|
3776
3779
|
"styled_components",
|
|
@@ -3779,24 +3782,25 @@ M.object({
|
|
|
3779
3782
|
"scss",
|
|
3780
3783
|
"inline_styles"
|
|
3781
3784
|
]),
|
|
3782
|
-
uiLibrary:
|
|
3783
|
-
responsivePages:
|
|
3784
|
-
|
|
3785
|
-
name:
|
|
3786
|
-
framesId:
|
|
3785
|
+
uiLibrary: I.enum(["mui", "antd", "radix", "shadcn"]).optional(),
|
|
3786
|
+
responsivePages: I.array(
|
|
3787
|
+
I.object({
|
|
3788
|
+
name: I.string(),
|
|
3789
|
+
framesId: I.array(I.string())
|
|
3787
3790
|
})
|
|
3788
3791
|
).optional(),
|
|
3789
|
-
enableUILibraryTheming:
|
|
3790
|
-
enableCompactStructure:
|
|
3791
|
-
enableDisplayScreenModelId:
|
|
3792
|
-
enableGeneratePackageLock:
|
|
3793
|
-
enableAutoSplit:
|
|
3794
|
-
autoSplitThreshold:
|
|
3792
|
+
enableUILibraryTheming: I.boolean().optional(),
|
|
3793
|
+
enableCompactStructure: I.boolean().optional(),
|
|
3794
|
+
enableDisplayScreenModelId: I.boolean().optional(),
|
|
3795
|
+
enableGeneratePackageLock: I.boolean().optional(),
|
|
3796
|
+
enableAutoSplit: I.boolean().optional(),
|
|
3797
|
+
autoSplitThreshold: I.number().optional(),
|
|
3798
|
+
codegenSettings: I.record(I.unknown()).optional()
|
|
3795
3799
|
}),
|
|
3796
|
-
|
|
3797
|
-
framework:
|
|
3798
|
-
styling:
|
|
3799
|
-
enableTranslation:
|
|
3800
|
+
I.object({
|
|
3801
|
+
framework: I.literal("html"),
|
|
3802
|
+
styling: I.enum(["plain_css", "inline_styles", "tailwind"]),
|
|
3803
|
+
enableTranslation: I.boolean().optional()
|
|
3800
3804
|
})
|
|
3801
3805
|
])
|
|
3802
3806
|
);
|
|
@@ -3962,69 +3966,69 @@ function ur(t) {
|
|
|
3962
3966
|
}
|
|
3963
3967
|
var Fr = (t) => {
|
|
3964
3968
|
throw TypeError(t);
|
|
3965
|
-
}, Rs = (t, e, n) => e.has(t) || Fr("Cannot " + n),
|
|
3969
|
+
}, Rs = (t, e, n) => e.has(t) || Fr("Cannot " + n), C = (t, e, n) => (Rs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), K = (t, e, n) => e.has(t) ? Fr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), F = (t, e, n, s) => (Rs(t, e, "write to private field"), e.set(t, n), n), Ae = (t, e, n) => (Rs(t, e, "access private method"), n), se, Je, ut, un, _n, Nt, ft, Rt, De, dt, pt, lt, Ct, he, is, os, cs, dr, us, ds, At, ls, fs;
|
|
3966
3970
|
class dn extends EventTarget {
|
|
3967
3971
|
constructor(e, n) {
|
|
3968
3972
|
var s, r;
|
|
3969
|
-
super(), K(this, he), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, K(this, se), K(this, Je), K(this, ut), K(this, un), K(this, _n), K(this, Nt), K(this, ft), K(this, Rt, null), K(this, De), K(this, dt), K(this, pt, null), K(this, lt, null), K(this,
|
|
3973
|
+
super(), K(this, he), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, K(this, se), K(this, Je), K(this, ut), K(this, un), K(this, _n), K(this, Nt), K(this, ft), K(this, Rt, null), K(this, De), K(this, dt), K(this, pt, null), K(this, lt, null), K(this, Ct, null), K(this, os, (a) => Ie(this, null, function* () {
|
|
3970
3974
|
var i;
|
|
3971
|
-
|
|
3975
|
+
C(this, dt).reset();
|
|
3972
3976
|
const { body: o, redirected: c, status: u, headers: h } = a;
|
|
3973
3977
|
if (u === 204) {
|
|
3974
|
-
|
|
3978
|
+
Ae(this, he, At).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
3975
3979
|
return;
|
|
3976
3980
|
}
|
|
3977
3981
|
if (c ? F(this, ut, new URL(a.url)) : F(this, ut, void 0), u !== 200) {
|
|
3978
|
-
|
|
3982
|
+
Ae(this, he, At).call(this, `Non-200 status code (${u})`, u);
|
|
3979
3983
|
return;
|
|
3980
3984
|
}
|
|
3981
3985
|
if (!(h.get("content-type") || "").startsWith("text/event-stream")) {
|
|
3982
|
-
|
|
3986
|
+
Ae(this, he, At).call(this, 'Invalid content type, expected "text/event-stream"', u);
|
|
3983
3987
|
return;
|
|
3984
3988
|
}
|
|
3985
|
-
if (
|
|
3989
|
+
if (C(this, se) === this.CLOSED)
|
|
3986
3990
|
return;
|
|
3987
3991
|
F(this, se, this.OPEN);
|
|
3988
3992
|
const p = new Event("open");
|
|
3989
|
-
if ((i =
|
|
3990
|
-
|
|
3993
|
+
if ((i = C(this, Ct)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
|
|
3994
|
+
Ae(this, he, At).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
|
|
3991
3995
|
return;
|
|
3992
3996
|
}
|
|
3993
3997
|
const k = new TextDecoder(), v = o.getReader();
|
|
3994
3998
|
let b = !0;
|
|
3995
3999
|
do {
|
|
3996
4000
|
const { done: l, value: y } = yield v.read();
|
|
3997
|
-
y &&
|
|
4001
|
+
y && C(this, dt).feed(k.decode(y, { stream: !l })), l && (b = !1, C(this, dt).reset(), Ae(this, he, ls).call(this));
|
|
3998
4002
|
} while (b);
|
|
3999
4003
|
})), K(this, cs, (a) => {
|
|
4000
|
-
F(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") &&
|
|
4004
|
+
F(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ae(this, he, ls).call(this, as(a));
|
|
4001
4005
|
}), K(this, us, (a) => {
|
|
4002
4006
|
typeof a.id == "string" && F(this, Rt, a.id);
|
|
4003
4007
|
const i = new MessageEvent(a.event || "message", {
|
|
4004
4008
|
data: a.data,
|
|
4005
|
-
origin:
|
|
4009
|
+
origin: C(this, ut) ? C(this, ut).origin : C(this, Je).origin,
|
|
4006
4010
|
lastEventId: a.id || ""
|
|
4007
4011
|
});
|
|
4008
|
-
|
|
4012
|
+
C(this, lt) && (!a.event || a.event === "message") && C(this, lt).call(this, i), this.dispatchEvent(i);
|
|
4009
4013
|
}), K(this, ds, (a) => {
|
|
4010
4014
|
F(this, Nt, a);
|
|
4011
4015
|
}), K(this, fs, () => {
|
|
4012
|
-
F(this, ft, void 0),
|
|
4016
|
+
F(this, ft, void 0), C(this, se) === this.CONNECTING && Ae(this, he, is).call(this);
|
|
4013
4017
|
});
|
|
4014
4018
|
try {
|
|
4015
4019
|
if (e instanceof URL)
|
|
4016
4020
|
F(this, Je, e);
|
|
4017
4021
|
else if (typeof e == "string")
|
|
4018
|
-
F(this, Je, new URL(e,
|
|
4022
|
+
F(this, Je, new URL(e, Vo()));
|
|
4019
4023
|
else
|
|
4020
4024
|
throw new Error("Invalid URL");
|
|
4021
4025
|
} catch (a) {
|
|
4022
4026
|
throw Wo("An invalid or illegal string was specified");
|
|
4023
4027
|
}
|
|
4024
4028
|
F(this, dt, $o({
|
|
4025
|
-
onEvent:
|
|
4026
|
-
onRetry:
|
|
4027
|
-
})), F(this, se, this.CONNECTING), F(this, Nt, 3e3), F(this, _n, (s = n == null ? void 0 : n.fetch) != null ? s : globalThis.fetch), F(this, un, (r = n == null ? void 0 : n.withCredentials) != null ? r : !1),
|
|
4029
|
+
onEvent: C(this, us),
|
|
4030
|
+
onRetry: C(this, ds)
|
|
4031
|
+
})), F(this, se, this.CONNECTING), F(this, Nt, 3e3), F(this, _n, (s = n == null ? void 0 : n.fetch) != null ? s : globalThis.fetch), F(this, un, (r = n == null ? void 0 : n.withCredentials) != null ? r : !1), Ae(this, he, is).call(this);
|
|
4028
4032
|
}
|
|
4029
4033
|
/**
|
|
4030
4034
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -4037,7 +4041,7 @@ class dn extends EventTarget {
|
|
|
4037
4041
|
* @public
|
|
4038
4042
|
*/
|
|
4039
4043
|
get readyState() {
|
|
4040
|
-
return
|
|
4044
|
+
return C(this, se);
|
|
4041
4045
|
}
|
|
4042
4046
|
/**
|
|
4043
4047
|
* Returns the URL providing the event stream.
|
|
@@ -4047,7 +4051,7 @@ class dn extends EventTarget {
|
|
|
4047
4051
|
* @public
|
|
4048
4052
|
*/
|
|
4049
4053
|
get url() {
|
|
4050
|
-
return
|
|
4054
|
+
return C(this, Je).href;
|
|
4051
4055
|
}
|
|
4052
4056
|
/**
|
|
4053
4057
|
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
@@ -4055,28 +4059,28 @@ class dn extends EventTarget {
|
|
|
4055
4059
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
4056
4060
|
*/
|
|
4057
4061
|
get withCredentials() {
|
|
4058
|
-
return
|
|
4062
|
+
return C(this, un);
|
|
4059
4063
|
}
|
|
4060
4064
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
4061
4065
|
get onerror() {
|
|
4062
|
-
return
|
|
4066
|
+
return C(this, pt);
|
|
4063
4067
|
}
|
|
4064
4068
|
set onerror(e) {
|
|
4065
4069
|
F(this, pt, e);
|
|
4066
4070
|
}
|
|
4067
4071
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
4068
4072
|
get onmessage() {
|
|
4069
|
-
return
|
|
4073
|
+
return C(this, lt);
|
|
4070
4074
|
}
|
|
4071
4075
|
set onmessage(e) {
|
|
4072
4076
|
F(this, lt, e);
|
|
4073
4077
|
}
|
|
4074
4078
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
4075
4079
|
get onopen() {
|
|
4076
|
-
return
|
|
4080
|
+
return C(this, Ct);
|
|
4077
4081
|
}
|
|
4078
4082
|
set onopen(e) {
|
|
4079
|
-
F(this,
|
|
4083
|
+
F(this, Ct, e);
|
|
4080
4084
|
}
|
|
4081
4085
|
addEventListener(e, n, s) {
|
|
4082
4086
|
const r = n;
|
|
@@ -4094,16 +4098,16 @@ class dn extends EventTarget {
|
|
|
4094
4098
|
* @public
|
|
4095
4099
|
*/
|
|
4096
4100
|
close() {
|
|
4097
|
-
|
|
4101
|
+
C(this, ft) && clearTimeout(C(this, ft)), C(this, se) !== this.CLOSED && (C(this, De) && C(this, De).abort(), F(this, se, this.CLOSED), F(this, De, void 0));
|
|
4098
4102
|
}
|
|
4099
4103
|
}
|
|
4100
|
-
se = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(),
|
|
4104
|
+
se = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakSet(), /**
|
|
4101
4105
|
* Connect to the given URL and start receiving events
|
|
4102
4106
|
*
|
|
4103
4107
|
* @internal
|
|
4104
4108
|
*/
|
|
4105
4109
|
is = function() {
|
|
4106
|
-
F(this, se, this.CONNECTING), F(this, De, new AbortController()),
|
|
4110
|
+
F(this, se, this.CONNECTING), F(this, De, new AbortController()), C(this, _n)(C(this, Je), Ae(this, he, dr).call(this)).then(C(this, os)).catch(C(this, cs));
|
|
4107
4111
|
}, os = /* @__PURE__ */ new WeakMap(), cs = /* @__PURE__ */ new WeakMap(), /**
|
|
4108
4112
|
* Get request options for the `fetch()` request
|
|
4109
4113
|
*
|
|
@@ -4117,9 +4121,9 @@ dr = function() {
|
|
|
4117
4121
|
// [spec] …will have their mode set to "cors"…
|
|
4118
4122
|
mode: "cors",
|
|
4119
4123
|
redirect: "follow",
|
|
4120
|
-
headers: Be({ Accept: "text/event-stream" },
|
|
4124
|
+
headers: Be({ Accept: "text/event-stream" }, C(this, Rt) ? { "Last-Event-ID": C(this, Rt) } : void 0),
|
|
4121
4125
|
cache: "no-store",
|
|
4122
|
-
signal: (t =
|
|
4126
|
+
signal: (t = C(this, De)) == null ? void 0 : t.signal
|
|
4123
4127
|
};
|
|
4124
4128
|
return "window" in globalThis && (e.credentials = this.withCredentials ? "include" : "same-origin"), e;
|
|
4125
4129
|
}, us = /* @__PURE__ */ new WeakMap(), ds = /* @__PURE__ */ new WeakMap(), /**
|
|
@@ -4129,11 +4133,11 @@ dr = function() {
|
|
|
4129
4133
|
* @param code - The HTTP status code, if available
|
|
4130
4134
|
* @internal
|
|
4131
4135
|
*/
|
|
4132
|
-
|
|
4136
|
+
At = function(t, e) {
|
|
4133
4137
|
var n;
|
|
4134
|
-
|
|
4138
|
+
C(this, se) !== this.CLOSED && F(this, se, this.CLOSED);
|
|
4135
4139
|
const s = new cr("error", { code: e, message: t });
|
|
4136
|
-
(n =
|
|
4140
|
+
(n = C(this, pt)) == null || n.call(this, s), this.dispatchEvent(s);
|
|
4137
4141
|
}, /**
|
|
4138
4142
|
* Schedules a reconnection attempt against the EventSource endpoint.
|
|
4139
4143
|
*
|
|
@@ -4143,11 +4147,11 @@ Ct = function(t, e) {
|
|
|
4143
4147
|
*/
|
|
4144
4148
|
ls = function(t, e) {
|
|
4145
4149
|
var n;
|
|
4146
|
-
if (
|
|
4150
|
+
if (C(this, se) === this.CLOSED)
|
|
4147
4151
|
return;
|
|
4148
4152
|
F(this, se, this.CONNECTING);
|
|
4149
4153
|
const s = new cr("error", { code: e, message: t });
|
|
4150
|
-
(n =
|
|
4154
|
+
(n = C(this, pt)) == null || n.call(this, s), this.dispatchEvent(s), F(this, ft, setTimeout(C(this, fs), C(this, Nt)));
|
|
4151
4155
|
}, fs = /* @__PURE__ */ new WeakMap(), /**
|
|
4152
4156
|
* ReadyState representing an EventSource currently trying to connect
|
|
4153
4157
|
*
|
|
@@ -4164,11 +4168,11 @@ dn.OPEN = 1, /**
|
|
|
4164
4168
|
* @public
|
|
4165
4169
|
*/
|
|
4166
4170
|
dn.CLOSED = 2;
|
|
4167
|
-
function
|
|
4171
|
+
function Vo() {
|
|
4168
4172
|
const t = "document" in globalThis ? globalThis.document : void 0;
|
|
4169
4173
|
return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
|
|
4170
4174
|
}
|
|
4171
|
-
var Wr = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"),
|
|
4175
|
+
var Wr = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"), zo = process.env.NODE_ENV !== "production" ? [
|
|
4172
4176
|
// All error codes, starting by 0:
|
|
4173
4177
|
function(t) {
|
|
4174
4178
|
return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
|
|
@@ -4201,7 +4205,7 @@ var Wr = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = S
|
|
|
4201
4205
|
] : [];
|
|
4202
4206
|
function re(t, ...e) {
|
|
4203
4207
|
if (process.env.NODE_ENV !== "production") {
|
|
4204
|
-
const n =
|
|
4208
|
+
const n = zo[t], s = typeof n == "function" ? n.apply(null, e) : n;
|
|
4205
4209
|
throw new Error(`[Immer] ${s}`);
|
|
4206
4210
|
}
|
|
4207
4211
|
throw new Error(
|
|
@@ -4214,10 +4218,10 @@ function bt(t) {
|
|
|
4214
4218
|
}
|
|
4215
4219
|
function tt(t) {
|
|
4216
4220
|
var e;
|
|
4217
|
-
return t ?
|
|
4221
|
+
return t ? Vr(t) || Array.isArray(t) || !!t[lr] || !!((e = t.constructor) != null && e[lr]) || Sn(t) || On(t) : !1;
|
|
4218
4222
|
}
|
|
4219
4223
|
var Uo = Object.prototype.constructor.toString();
|
|
4220
|
-
function
|
|
4224
|
+
function Vr(t) {
|
|
4221
4225
|
if (!t || typeof t != "object")
|
|
4222
4226
|
return !1;
|
|
4223
4227
|
const e = _t(t);
|
|
@@ -4227,19 +4231,19 @@ function zr(t) {
|
|
|
4227
4231
|
return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === Uo;
|
|
4228
4232
|
}
|
|
4229
4233
|
function bn(t, e) {
|
|
4230
|
-
|
|
4234
|
+
En(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
|
|
4231
4235
|
e(n, t[n], t);
|
|
4232
4236
|
}) : t.forEach((n, s) => e(s, n, t));
|
|
4233
4237
|
}
|
|
4234
|
-
function
|
|
4238
|
+
function En(t) {
|
|
4235
4239
|
const e = t[oe];
|
|
4236
4240
|
return e ? e.type_ : Array.isArray(t) ? 1 : Sn(t) ? 2 : On(t) ? 3 : 0;
|
|
4237
4241
|
}
|
|
4238
4242
|
function hs(t, e) {
|
|
4239
|
-
return
|
|
4243
|
+
return En(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
4240
4244
|
}
|
|
4241
|
-
function
|
|
4242
|
-
const s =
|
|
4245
|
+
function zr(t, e, n) {
|
|
4246
|
+
const s = En(t);
|
|
4243
4247
|
s === 2 ? t.set(e, n) : s === 3 ? t.add(n) : t[e] = n;
|
|
4244
4248
|
}
|
|
4245
4249
|
function Bo(t, e) {
|
|
@@ -4261,7 +4265,7 @@ function ps(t, e) {
|
|
|
4261
4265
|
return new Set(t);
|
|
4262
4266
|
if (Array.isArray(t))
|
|
4263
4267
|
return Array.prototype.slice.call(t);
|
|
4264
|
-
const n =
|
|
4268
|
+
const n = Vr(t);
|
|
4265
4269
|
if (e === !0 || e === "class_only" && !n) {
|
|
4266
4270
|
const s = Object.getOwnPropertyDescriptors(t);
|
|
4267
4271
|
delete s[oe];
|
|
@@ -4286,7 +4290,7 @@ function ps(t, e) {
|
|
|
4286
4290
|
}
|
|
4287
4291
|
}
|
|
4288
4292
|
function Bt(t, e = !1) {
|
|
4289
|
-
return Tn(t) || bt(t) || !tt(t) || (
|
|
4293
|
+
return Tn(t) || bt(t) || !tt(t) || (En(t) > 1 && (t.set = t.add = t.clear = t.delete = Ko), Object.freeze(t), e && Object.entries(t).forEach(([n, s]) => Bt(s, !0))), t;
|
|
4290
4294
|
}
|
|
4291
4295
|
function Ko() {
|
|
4292
4296
|
re(2);
|
|
@@ -4373,7 +4377,7 @@ function mr(t, e, n, s, r, a, i) {
|
|
|
4373
4377
|
if (process.env.NODE_ENV !== "production" && r === n && re(5), bt(r)) {
|
|
4374
4378
|
const o = a && e && e.type_ !== 3 && // Set objects are atomic since they have no keys.
|
|
4375
4379
|
!hs(e.assigned_, s) ? a.concat(s) : void 0, c = wn(t, r, o);
|
|
4376
|
-
if (
|
|
4380
|
+
if (zr(n, s, c), bt(c))
|
|
4377
4381
|
t.canAutoFreeze_ = !1;
|
|
4378
4382
|
else
|
|
4379
4383
|
return;
|
|
@@ -4618,7 +4622,7 @@ function Kr(t) {
|
|
|
4618
4622
|
} else
|
|
4619
4623
|
n = ps(t, !0);
|
|
4620
4624
|
return bn(n, (s, r) => {
|
|
4621
|
-
|
|
4625
|
+
zr(n, s, Kr(r));
|
|
4622
4626
|
}), e && (e.finalized_ = !1), n;
|
|
4623
4627
|
}
|
|
4624
4628
|
var ce = new Yo(), ec = ce.produce;
|
|
@@ -4736,7 +4740,7 @@ const yr = {
|
|
|
4736
4740
|
let y;
|
|
4737
4741
|
try {
|
|
4738
4742
|
l instanceof MessageEvent ? y = JSON.parse(l.data) : y = yield (yield o).json();
|
|
4739
|
-
} catch (
|
|
4743
|
+
} catch (z) {
|
|
4740
4744
|
}
|
|
4741
4745
|
const m = new Gs({
|
|
4742
4746
|
name: (W = y == null ? void 0 : y.payload.name) != null ? W : "Unknown error",
|
|
@@ -4744,8 +4748,8 @@ const yr = {
|
|
|
4744
4748
|
status: y == null ? void 0 : y.payload.status,
|
|
4745
4749
|
detail: y == null ? void 0 : y.payload.detail
|
|
4746
4750
|
});
|
|
4747
|
-
s((
|
|
4748
|
-
|
|
4751
|
+
s((z) => {
|
|
4752
|
+
z.status = "error", z.error = m;
|
|
4749
4753
|
}), v({
|
|
4750
4754
|
result: null,
|
|
4751
4755
|
error: m
|
|
@@ -4770,12 +4774,12 @@ const yr = {
|
|
|
4770
4774
|
};
|
|
4771
4775
|
})), W = yield Promise.allSettled(m);
|
|
4772
4776
|
for (const R of W) {
|
|
4773
|
-
const
|
|
4777
|
+
const z = {};
|
|
4774
4778
|
if (R.status === "fulfilled") {
|
|
4775
4779
|
const { assetName: L, base64: q } = R.value;
|
|
4776
|
-
|
|
4777
|
-
const
|
|
4778
|
-
l.files[
|
|
4780
|
+
z[L] = q;
|
|
4781
|
+
const Z = y ? `${y}/${L}` : L;
|
|
4782
|
+
l.files[Z] = {
|
|
4779
4783
|
content: q,
|
|
4780
4784
|
isBinary: !0
|
|
4781
4785
|
};
|
|
@@ -4938,7 +4942,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4938
4942
|
}, ee = (
|
|
4939
4943
|
/*#__NOINLINE__*/
|
|
4940
4944
|
Me()
|
|
4941
|
-
), bs = Object, N = (t) => t === ee, be = (t) => typeof t == "function",
|
|
4945
|
+
), bs = Object, N = (t) => t === ee, be = (t) => typeof t == "function", Ve = (t, e) => Be(Be({}, t), e), Jr = (t) => be(t.then), Fn = {}, nn = {}, Is = "undefined", Xt = typeof window != Is, ws = typeof document != Is, ic = Xt && "Deno" in window, oc = () => Xt && typeof window.requestAnimationFrame != Is, Xr = (t, e) => {
|
|
4942
4946
|
const n = Re.get(t);
|
|
4943
4947
|
return [
|
|
4944
4948
|
// Getter
|
|
@@ -4947,7 +4951,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4947
4951
|
(s) => {
|
|
4948
4952
|
if (!N(e)) {
|
|
4949
4953
|
const r = t.get(e);
|
|
4950
|
-
e in nn || (nn[e] = r), n[5](e,
|
|
4954
|
+
e in nn || (nn[e] = r), n[5](e, Ve(r, s), r || Fn);
|
|
4951
4955
|
}
|
|
4952
4956
|
},
|
|
4953
4957
|
// Subscriber
|
|
@@ -4957,7 +4961,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4957
4961
|
];
|
|
4958
4962
|
};
|
|
4959
4963
|
let ks = !0;
|
|
4960
|
-
const cc = () => ks, [
|
|
4964
|
+
const cc = () => ks, [xs, Es] = Xt && window.addEventListener ? [
|
|
4961
4965
|
window.addEventListener.bind(window),
|
|
4962
4966
|
window.removeEventListener.bind(window)
|
|
4963
4967
|
] : [
|
|
@@ -4966,16 +4970,16 @@ const cc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
|
|
|
4966
4970
|
], uc = () => {
|
|
4967
4971
|
const t = ws && document.visibilityState;
|
|
4968
4972
|
return N(t) || t !== "hidden";
|
|
4969
|
-
}, dc = (t) => (ws && document.addEventListener("visibilitychange", t),
|
|
4970
|
-
ws && document.removeEventListener("visibilitychange", t),
|
|
4973
|
+
}, dc = (t) => (ws && document.addEventListener("visibilitychange", t), xs("focus", t), () => {
|
|
4974
|
+
ws && document.removeEventListener("visibilitychange", t), Es("focus", t);
|
|
4971
4975
|
}), lc = (t) => {
|
|
4972
4976
|
const e = () => {
|
|
4973
4977
|
ks = !0, t();
|
|
4974
4978
|
}, n = () => {
|
|
4975
4979
|
ks = !1;
|
|
4976
4980
|
};
|
|
4977
|
-
return
|
|
4978
|
-
|
|
4981
|
+
return xs("online", e), xs("offline", n), () => {
|
|
4982
|
+
Es("online", e), Es("offline", n);
|
|
4979
4983
|
};
|
|
4980
4984
|
}, fc = {
|
|
4981
4985
|
isOnline: cc,
|
|
@@ -4983,13 +4987,13 @@ const cc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
|
|
|
4983
4987
|
}, hc = {
|
|
4984
4988
|
initFocus: dc,
|
|
4985
4989
|
initReconnect: lc
|
|
4986
|
-
},
|
|
4990
|
+
}, xr = !Gt.useId, Ht = !Xt || ic, pc = (t) => oc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? fa : ha, Vn = typeof navigator != "undefined" && navigator.connection, Er = !Ht && Vn && ([
|
|
4987
4991
|
"slow-2g",
|
|
4988
4992
|
"2g"
|
|
4989
|
-
].includes(
|
|
4993
|
+
].includes(Vn.effectiveType) || Vn.saveData), sn = /* @__PURE__ */ new WeakMap(), zn = (t, e) => bs.prototype.toString.call(t) === `[object ${e}]`;
|
|
4990
4994
|
let mc = 0;
|
|
4991
4995
|
const Ss = (t) => {
|
|
4992
|
-
const e = typeof t, n =
|
|
4996
|
+
const e = typeof t, n = zn(t, "Date"), s = zn(t, "RegExp"), r = zn(t, "Object");
|
|
4993
4997
|
let a, i;
|
|
4994
4998
|
if (bs(t) === t && !n && !s) {
|
|
4995
4999
|
if (a = sn.get(t), a) return a;
|
|
@@ -5025,7 +5029,7 @@ let yc = 0;
|
|
|
5025
5029
|
const Os = () => ++yc;
|
|
5026
5030
|
function Yr(...t) {
|
|
5027
5031
|
return Ie(this, null, function* () {
|
|
5028
|
-
const [e, n, s, r] = t, a =
|
|
5032
|
+
const [e, n, s, r] = t, a = Ve({
|
|
5029
5033
|
populateCache: !0,
|
|
5030
5034
|
throwOnError: !0
|
|
5031
5035
|
}, typeof r == "boolean" ? {
|
|
@@ -5047,41 +5051,41 @@ function Yr(...t) {
|
|
|
5047
5051
|
return Ie(this, null, function* () {
|
|
5048
5052
|
const [v] = js(k);
|
|
5049
5053
|
if (!v) return;
|
|
5050
|
-
const [b, l] = Xr(e, v), [y, m, W, R] = Re.get(e),
|
|
5054
|
+
const [b, l] = Xr(e, v), [y, m, W, R] = Re.get(e), z = () => {
|
|
5051
5055
|
const le = y[v];
|
|
5052
5056
|
return (be(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete W[v], delete R[v], le && le[0]) ? le[0](Gr).then(() => b().data) : b().data;
|
|
5053
5057
|
};
|
|
5054
5058
|
if (t.length < 3)
|
|
5055
|
-
return
|
|
5059
|
+
return z();
|
|
5056
5060
|
let L = s, q;
|
|
5057
|
-
const
|
|
5061
|
+
const Z = Os();
|
|
5058
5062
|
m[v] = [
|
|
5059
|
-
|
|
5063
|
+
Z,
|
|
5060
5064
|
0
|
|
5061
5065
|
];
|
|
5062
|
-
const
|
|
5063
|
-
if (
|
|
5066
|
+
const D = !N(c), Se = b(), $ = Se.data, st = Se._c, ze = N(st) ? $ : st;
|
|
5067
|
+
if (D && (c = be(c) ? c(ze, $) : c, l({
|
|
5064
5068
|
data: c,
|
|
5065
|
-
_c:
|
|
5069
|
+
_c: ze
|
|
5066
5070
|
})), be(L))
|
|
5067
5071
|
try {
|
|
5068
|
-
L = L(
|
|
5072
|
+
L = L(ze);
|
|
5069
5073
|
} catch (le) {
|
|
5070
5074
|
q = le;
|
|
5071
5075
|
}
|
|
5072
5076
|
if (L && Jr(L))
|
|
5073
5077
|
if (L = yield L.catch((le) => {
|
|
5074
5078
|
q = le;
|
|
5075
|
-
}),
|
|
5079
|
+
}), Z !== m[v][0]) {
|
|
5076
5080
|
if (q) throw q;
|
|
5077
5081
|
return L;
|
|
5078
|
-
} else q &&
|
|
5079
|
-
data:
|
|
5082
|
+
} else q && D && u(q) && (i = !0, l({
|
|
5083
|
+
data: ze,
|
|
5080
5084
|
_c: ee
|
|
5081
5085
|
}));
|
|
5082
5086
|
if (i && !q)
|
|
5083
5087
|
if (be(i)) {
|
|
5084
|
-
const le = i(L,
|
|
5088
|
+
const le = i(L, ze);
|
|
5085
5089
|
l({
|
|
5086
5090
|
data: le,
|
|
5087
5091
|
error: ee,
|
|
@@ -5093,7 +5097,7 @@ function Yr(...t) {
|
|
|
5093
5097
|
error: ee,
|
|
5094
5098
|
_c: ee
|
|
5095
5099
|
});
|
|
5096
|
-
if (m[v][1] = Os(), Promise.resolve(
|
|
5100
|
+
if (m[v][1] = Os(), Promise.resolve(z()).then(() => {
|
|
5097
5101
|
l({
|
|
5098
5102
|
_c: ee
|
|
5099
5103
|
});
|
|
@@ -5111,7 +5115,7 @@ const Sr = (t, e) => {
|
|
|
5111
5115
|
t[n][0] && t[n][0](e);
|
|
5112
5116
|
}, gc = (t, e) => {
|
|
5113
5117
|
if (!Re.has(t)) {
|
|
5114
|
-
const n =
|
|
5118
|
+
const n = Ve(hc, e), s = /* @__PURE__ */ Object.create(null), r = Yr.bind(ee, t);
|
|
5115
5119
|
let a = Me;
|
|
5116
5120
|
const i = /* @__PURE__ */ Object.create(null), o = (h, p) => {
|
|
5117
5121
|
const k = i[h] || [];
|
|
@@ -5152,7 +5156,7 @@ const Sr = (t, e) => {
|
|
|
5152
5156
|
}, vc = (t, e, n, s, r) => {
|
|
5153
5157
|
const a = n.errorRetryCount, i = r.retryCount, o = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * n.errorRetryInterval;
|
|
5154
5158
|
!N(a) && i > a || setTimeout(s, o, r);
|
|
5155
|
-
}, _c = _s, [Qr, bc] = gc(/* @__PURE__ */ new Map()), wc =
|
|
5159
|
+
}, _c = _s, [Qr, bc] = gc(/* @__PURE__ */ new Map()), wc = Ve(
|
|
5156
5160
|
{
|
|
5157
5161
|
// events
|
|
5158
5162
|
onLoadingSlow: Me,
|
|
@@ -5166,10 +5170,10 @@ const Sr = (t, e) => {
|
|
|
5166
5170
|
revalidateIfStale: !0,
|
|
5167
5171
|
shouldRetryOnError: !0,
|
|
5168
5172
|
// timeouts
|
|
5169
|
-
errorRetryInterval:
|
|
5173
|
+
errorRetryInterval: Er ? 1e4 : 5e3,
|
|
5170
5174
|
focusThrottleInterval: 5 * 1e3,
|
|
5171
5175
|
dedupingInterval: 2 * 1e3,
|
|
5172
|
-
loadingTimeout:
|
|
5176
|
+
loadingTimeout: Er ? 5e3 : 3e3,
|
|
5173
5177
|
// providers
|
|
5174
5178
|
compare: _c,
|
|
5175
5179
|
isPaused: () => !1,
|
|
@@ -5180,13 +5184,13 @@ const Sr = (t, e) => {
|
|
|
5180
5184
|
// use web preset by default
|
|
5181
5185
|
fc
|
|
5182
5186
|
), kc = (t, e) => {
|
|
5183
|
-
const n =
|
|
5187
|
+
const n = Ve(t, e);
|
|
5184
5188
|
if (e) {
|
|
5185
5189
|
const { use: s, fallback: r } = t, { use: a, fallback: i } = e;
|
|
5186
|
-
s && a && (n.use = s.concat(a)), r && i && (n.fallback =
|
|
5190
|
+
s && a && (n.use = s.concat(a)), r && i && (n.fallback = Ve(r, i));
|
|
5187
5191
|
}
|
|
5188
5192
|
return n;
|
|
5189
|
-
},
|
|
5193
|
+
}, xc = la({}), Ec = "$inf$", ea = Xt && window.__SWR_DEVTOOLS_USE__, Sc = ea ? window.__SWR_DEVTOOLS_USE__ : [], Oc = () => {
|
|
5190
5194
|
ea && (window.__SWR_DEVTOOLS_REACT__ = Gt);
|
|
5191
5195
|
}, Tc = (t) => be(t[1]) ? [
|
|
5192
5196
|
t[0],
|
|
@@ -5196,14 +5200,14 @@ const Sr = (t, e) => {
|
|
|
5196
5200
|
t[0],
|
|
5197
5201
|
null,
|
|
5198
5202
|
(t[1] === null ? t[2] : t[1]) || {}
|
|
5199
|
-
],
|
|
5203
|
+
], Cc = () => Ve(wc, pa(xc)), Ac = (t) => (e, n, s) => t(e, n && ((...a) => {
|
|
5200
5204
|
const [i] = js(e), [, , , o] = Re.get(Qr);
|
|
5201
|
-
if (i.startsWith(
|
|
5205
|
+
if (i.startsWith(Ec))
|
|
5202
5206
|
return n(...a);
|
|
5203
5207
|
const c = o[i];
|
|
5204
5208
|
return N(c) ? n(...a) : (delete o[i], c);
|
|
5205
|
-
}), s), Nc = Sc.concat(
|
|
5206
|
-
const s =
|
|
5209
|
+
}), s), Nc = Sc.concat(Ac), Rc = (t) => function(...n) {
|
|
5210
|
+
const s = Cc(), [r, a, i] = Tc(n), o = kc(s, i);
|
|
5207
5211
|
let c = t;
|
|
5208
5212
|
const { use: u } = o, h = (u || []).concat(Nc);
|
|
5209
5213
|
for (let p = h.length; p--; )
|
|
@@ -5239,28 +5243,28 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5239
5243
|
}), Bn = {
|
|
5240
5244
|
dedupe: !0
|
|
5241
5245
|
}, Ic = (t, e, n) => {
|
|
5242
|
-
const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, l, y] = Re.get(s), [m, W] = js(t), R = Ke(!1),
|
|
5246
|
+
const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, l, y] = Re.get(s), [m, W] = js(t), R = Ke(!1), z = Ke(!1), L = Ke(m), q = Ke(e), Z = Ke(n), D = () => Z.current, Se = () => D().isVisible() && D().isOnline(), [$, st, ze, le] = Xr(s, m), rt = Ke({}).current, Yt = N(i) ? N(n.fallback) ? ee : n.fallback[m] : i, Zs = (M, j) => {
|
|
5243
5247
|
for (const G in rt) {
|
|
5244
5248
|
const U = G;
|
|
5245
5249
|
if (U === "data") {
|
|
5246
|
-
if (!r(
|
|
5250
|
+
if (!r(M[U], j[U]) && (!N(M[U]) || !r(en, j[U])))
|
|
5247
5251
|
return !1;
|
|
5248
|
-
} else if (
|
|
5252
|
+
} else if (j[U] !== M[U])
|
|
5249
5253
|
return !1;
|
|
5250
5254
|
}
|
|
5251
5255
|
return !0;
|
|
5252
5256
|
}, Ds = ma(() => {
|
|
5253
|
-
const
|
|
5254
|
-
const Oe =
|
|
5255
|
-
return delete Oe._k,
|
|
5257
|
+
const M = !m || !e ? !1 : N(o) ? D().isPaused() || a ? !1 : c !== !1 : o, j = (Y) => {
|
|
5258
|
+
const Oe = Ve(Y);
|
|
5259
|
+
return delete Oe._k, M ? Be({
|
|
5256
5260
|
isValidating: !0,
|
|
5257
5261
|
isLoading: !0
|
|
5258
5262
|
}, Oe) : Oe;
|
|
5259
|
-
}, G = $(), U = le(), fe =
|
|
5263
|
+
}, G = $(), U = le(), fe = j(G), ot = G === U ? fe : j(U);
|
|
5260
5264
|
let H = fe;
|
|
5261
5265
|
return [
|
|
5262
5266
|
() => {
|
|
5263
|
-
const Y =
|
|
5267
|
+
const Y = j($());
|
|
5264
5268
|
return Zs(Y, H) ? (H.data = Y.data, H.isLoading = Y.isLoading, H.isValidating = Y.isValidating, H.error = Y.error, H) : (H = Y, Y);
|
|
5265
5269
|
},
|
|
5266
5270
|
() => ot
|
|
@@ -5269,53 +5273,53 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5269
5273
|
s,
|
|
5270
5274
|
m
|
|
5271
5275
|
]), at = ac.useSyncExternalStore(rn(
|
|
5272
|
-
(
|
|
5273
|
-
Zs(G,
|
|
5276
|
+
(M) => ze(m, (j, G) => {
|
|
5277
|
+
Zs(G, j) || M();
|
|
5274
5278
|
}),
|
|
5275
5279
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5276
5280
|
[
|
|
5277
5281
|
s,
|
|
5278
5282
|
m
|
|
5279
5283
|
]
|
|
5280
|
-
), Ds[0], Ds[1]), Ms = !R.current, ta = v[m] && v[m].length > 0, it = at.data, Ue = N(it) ? Yt && Jr(Yt) ? Un(Yt) : Yt : it, Qt = at.error,
|
|
5281
|
-
(
|
|
5282
|
-
const
|
|
5283
|
-
if (!m || !
|
|
5284
|
+
), Ds[0], Ds[1]), Ms = !R.current, ta = v[m] && v[m].length > 0, it = at.data, Ue = N(it) ? Yt && Jr(Yt) ? Un(Yt) : Yt : it, Qt = at.error, Cn = Ke(Ue), en = k ? N(it) ? N(Cn.current) ? Ue : Cn.current : it : Ue, Ls = ta && !N(Qt) ? !1 : Ms && !N(o) ? o : D().isPaused() ? !1 : a ? N(Ue) ? !1 : c : N(Ue) || c, $s = !!(m && e && Ms && Ls), na = N(at.isValidating) ? $s : at.isValidating, sa = N(at.isLoading) ? $s : at.isLoading, wt = rn(
|
|
5285
|
+
(M) => Ie(void 0, null, function* () {
|
|
5286
|
+
const j = q.current;
|
|
5287
|
+
if (!m || !j || z.current || D().isPaused())
|
|
5284
5288
|
return !1;
|
|
5285
5289
|
let G, U, fe = !0;
|
|
5286
|
-
const ot =
|
|
5290
|
+
const ot = M || {}, H = !l[m] || !ot.dedupe, Y = () => xr ? !z.current && m === L.current && R.current : m === L.current, Oe = {
|
|
5287
5291
|
isValidating: !1,
|
|
5288
5292
|
isLoading: !1
|
|
5289
5293
|
}, Ws = () => {
|
|
5290
5294
|
st(Oe);
|
|
5291
|
-
},
|
|
5295
|
+
}, Vs = () => {
|
|
5292
5296
|
const ue = l[m];
|
|
5293
5297
|
ue && ue[1] === U && delete l[m];
|
|
5294
|
-
},
|
|
5298
|
+
}, zs = {
|
|
5295
5299
|
isValidating: !0
|
|
5296
5300
|
};
|
|
5297
|
-
N($().data) && (
|
|
5301
|
+
N($().data) && (zs.isLoading = !0);
|
|
5298
5302
|
try {
|
|
5299
|
-
if (H && (st(
|
|
5300
|
-
fe && Y() &&
|
|
5303
|
+
if (H && (st(zs), n.loadingTimeout && N($().data) && setTimeout(() => {
|
|
5304
|
+
fe && Y() && D().onLoadingSlow(m, n);
|
|
5301
5305
|
}, n.loadingTimeout), l[m] = [
|
|
5302
|
-
|
|
5306
|
+
j(W),
|
|
5303
5307
|
Os()
|
|
5304
|
-
]), [G, U] = l[m], G = yield G, H && setTimeout(
|
|
5305
|
-
return H && Y() &&
|
|
5308
|
+
]), [G, U] = l[m], G = yield G, H && setTimeout(Vs, n.dedupingInterval), !l[m] || l[m][1] !== U)
|
|
5309
|
+
return H && Y() && D().onDiscarded(m), !1;
|
|
5306
5310
|
Oe.error = ee;
|
|
5307
5311
|
const ue = b[m];
|
|
5308
5312
|
if (!N(ue) && // case 1
|
|
5309
5313
|
(U <= ue[0] || // case 2
|
|
5310
5314
|
U <= ue[1] || // case 3
|
|
5311
5315
|
ue[1] === 0))
|
|
5312
|
-
return Ws(), H && Y() &&
|
|
5316
|
+
return Ws(), H && Y() && D().onDiscarded(m), !1;
|
|
5313
5317
|
const Te = $().data;
|
|
5314
|
-
Oe.data = r(Te, G) ? Te : G, H && Y() &&
|
|
5318
|
+
Oe.data = r(Te, G) ? Te : G, H && Y() && D().onSuccess(G, m, n);
|
|
5315
5319
|
} catch (ue) {
|
|
5316
|
-
|
|
5317
|
-
const Te =
|
|
5318
|
-
Te.isPaused() || (Oe.error = ue, H && Y() && (Te.onError(ue, m, Te), (
|
|
5320
|
+
Vs();
|
|
5321
|
+
const Te = D(), { shouldRetryOnError: An } = Te;
|
|
5322
|
+
Te.isPaused() || (Oe.error = ue, H && Y() && (Te.onError(ue, m, Te), (An === !0 || be(An) && An(ue)) && (!D().revalidateOnFocus || !D().revalidateOnReconnect || Se()) && Te.onErrorRetry(ue, m, Te, (ra) => {
|
|
5319
5323
|
const Nn = v[m];
|
|
5320
5324
|
Nn && Nn[0] && Nn[0](wr, ra);
|
|
5321
5325
|
}, {
|
|
@@ -5342,23 +5346,23 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5342
5346
|
]
|
|
5343
5347
|
), Fs = rn(
|
|
5344
5348
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
5345
|
-
(...
|
|
5349
|
+
(...M) => Yr(s, L.current, ...M),
|
|
5346
5350
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5347
5351
|
[]
|
|
5348
5352
|
);
|
|
5349
5353
|
if (Wn(() => {
|
|
5350
|
-
q.current = e,
|
|
5354
|
+
q.current = e, Z.current = n, N(it) || (Cn.current = it);
|
|
5351
5355
|
}), Wn(() => {
|
|
5352
5356
|
if (!m) return;
|
|
5353
|
-
const
|
|
5354
|
-
let
|
|
5355
|
-
|
|
5357
|
+
const M = wt.bind(ee, Bn);
|
|
5358
|
+
let j = 0;
|
|
5359
|
+
D().revalidateOnFocus && (j = Date.now() + D().focusThrottleInterval);
|
|
5356
5360
|
const U = Pc(m, v, (fe, ot = {}) => {
|
|
5357
5361
|
if (fe == qr) {
|
|
5358
5362
|
const H = Date.now();
|
|
5359
|
-
|
|
5363
|
+
D().revalidateOnFocus && H > j && Se() && (j = H + D().focusThrottleInterval, M());
|
|
5360
5364
|
} else if (fe == Hr)
|
|
5361
|
-
|
|
5365
|
+
D().revalidateOnReconnect && Se() && M();
|
|
5362
5366
|
else {
|
|
5363
5367
|
if (fe == Gr)
|
|
5364
5368
|
return wt();
|
|
@@ -5366,24 +5370,24 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5366
5370
|
return wt(ot);
|
|
5367
5371
|
}
|
|
5368
5372
|
});
|
|
5369
|
-
return
|
|
5373
|
+
return z.current = !1, L.current = m, R.current = !0, st({
|
|
5370
5374
|
_k: W
|
|
5371
|
-
}), Ls && (N(Ue) || Ht ?
|
|
5372
|
-
|
|
5375
|
+
}), Ls && (N(Ue) || Ht ? M() : pc(M)), () => {
|
|
5376
|
+
z.current = !0, U();
|
|
5373
5377
|
};
|
|
5374
5378
|
}, [
|
|
5375
5379
|
m
|
|
5376
5380
|
]), Wn(() => {
|
|
5377
|
-
let
|
|
5378
|
-
function
|
|
5381
|
+
let M;
|
|
5382
|
+
function j() {
|
|
5379
5383
|
const U = be(u) ? u($().data) : u;
|
|
5380
|
-
U &&
|
|
5384
|
+
U && M !== -1 && (M = setTimeout(G, U));
|
|
5381
5385
|
}
|
|
5382
5386
|
function G() {
|
|
5383
|
-
!$().error && (h ||
|
|
5387
|
+
!$().error && (h || D().isVisible()) && (p || D().isOnline()) ? wt(Bn).then(j) : j();
|
|
5384
5388
|
}
|
|
5385
|
-
return
|
|
5386
|
-
|
|
5389
|
+
return j(), () => {
|
|
5390
|
+
M && (clearTimeout(M), M = -1);
|
|
5387
5391
|
};
|
|
5388
5392
|
}, [
|
|
5389
5393
|
u,
|
|
@@ -5391,17 +5395,17 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5391
5395
|
p,
|
|
5392
5396
|
m
|
|
5393
5397
|
]), ya(en), a && N(Ue) && m) {
|
|
5394
|
-
if (!
|
|
5398
|
+
if (!xr && Ht)
|
|
5395
5399
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
5396
|
-
q.current = e,
|
|
5397
|
-
const
|
|
5398
|
-
if (!N(
|
|
5399
|
-
const
|
|
5400
|
-
Un(
|
|
5400
|
+
q.current = e, Z.current = n, z.current = !1;
|
|
5401
|
+
const M = y[m];
|
|
5402
|
+
if (!N(M)) {
|
|
5403
|
+
const j = Fs(M);
|
|
5404
|
+
Un(j);
|
|
5401
5405
|
}
|
|
5402
5406
|
if (N(Qt)) {
|
|
5403
|
-
const
|
|
5404
|
-
N(en) || (
|
|
5407
|
+
const j = wt(Bn);
|
|
5408
|
+
N(en) || (j.status = "fulfilled", j.value = !0), Un(j);
|
|
5405
5409
|
} else
|
|
5406
5410
|
throw Qt;
|
|
5407
5411
|
}
|
|
@@ -5427,8 +5431,8 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5427
5431
|
params: s = {}
|
|
5428
5432
|
}) => {
|
|
5429
5433
|
const r = !!(n && t && e), { data: a, isLoading: i, error: o } = jc(
|
|
5430
|
-
["
|
|
5431
|
-
() => r ?
|
|
5434
|
+
["useFigmaFile", t, e, s],
|
|
5435
|
+
() => r ? Ai({
|
|
5432
5436
|
fileKey: t,
|
|
5433
5437
|
authToken: e,
|
|
5434
5438
|
params: s
|