@animaapp/anima-sdk-react 0.1.3 → 0.2.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/.turbo/turbo-build.log +14 -6
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -4
- package/dist/index.js +593 -577
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/useAnimaCodegen.ts +36 -5
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var sa = Object.defineProperty, aa = Object.defineProperties;
|
|
2
|
+
var ia = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Br = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var qr = (t, e, n) => e in t ?
|
|
4
|
+
var oa = Object.prototype.hasOwnProperty, ua = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var qr = (t, e, n) => e in t ? sa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Ue = (t, e) => {
|
|
6
6
|
for (var n in e || (e = {}))
|
|
7
|
-
|
|
7
|
+
oa.call(e, n) && qr(t, n, e[n]);
|
|
8
8
|
if (Br)
|
|
9
9
|
for (var n of Br(e))
|
|
10
|
-
|
|
10
|
+
ua.call(e, n) && qr(t, n, e[n]);
|
|
11
11
|
return t;
|
|
12
|
-
}, Kr = (t, e) =>
|
|
12
|
+
}, Kr = (t, e) => aa(t, ia(e));
|
|
13
13
|
var Be = (t, e, n) => new Promise((r, s) => {
|
|
14
14
|
var a = (u) => {
|
|
15
15
|
try {
|
|
@@ -26,20 +26,20 @@ var Be = (t, e, n) => new Promise((r, s) => {
|
|
|
26
26
|
}, o = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(a, i);
|
|
27
27
|
o((n = n.apply(t, e)).next());
|
|
28
28
|
});
|
|
29
|
-
import Gt, { useState as
|
|
30
|
-
const
|
|
29
|
+
import Gt, { useState as ca, useCallback as an, createContext as da, useEffect as la, useLayoutEffect as fa, useContext as ha, useRef as qe, useMemo as pa, useDebugValue as ma } from "react";
|
|
30
|
+
const ya = (t) => {
|
|
31
31
|
for (var e = "", n = new Uint8Array(t), r = n.byteLength, s = 0; s < r; s++)
|
|
32
32
|
e += String.fromCharCode(n[s]);
|
|
33
33
|
return btoa(e);
|
|
34
34
|
};
|
|
35
|
-
var
|
|
35
|
+
var ga = Object.defineProperty, _a = Object.defineProperties, va = Object.getOwnPropertyDescriptors, Hr = Object.getOwnPropertySymbols, ba = Object.prototype.hasOwnProperty, wa = Object.prototype.propertyIsEnumerable, Gr = (t, e, n) => e in t ? ga(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, d = (t, e) => {
|
|
36
36
|
for (var n in e || (e = {}))
|
|
37
|
-
|
|
37
|
+
ba.call(e, n) && Gr(t, n, e[n]);
|
|
38
38
|
if (Hr)
|
|
39
39
|
for (var n of Hr(e))
|
|
40
|
-
|
|
40
|
+
wa.call(e, n) && Gr(t, n, e[n]);
|
|
41
41
|
return t;
|
|
42
|
-
}, E = (t, e) =>
|
|
42
|
+
}, E = (t, e) => _a(t, va(e)), ke = (t, e, n) => new Promise((r, s) => {
|
|
43
43
|
var a = (u) => {
|
|
44
44
|
try {
|
|
45
45
|
o(n.next(u));
|
|
@@ -55,7 +55,7 @@ var ya = Object.defineProperty, ga = Object.defineProperties, _a = Object.getOwn
|
|
|
55
55
|
}, o = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(a, i);
|
|
56
56
|
o((n = n.apply(t, e)).next());
|
|
57
57
|
});
|
|
58
|
-
const
|
|
58
|
+
const ka = (t) => Object.entries(t).reduce(
|
|
59
59
|
(e, [n, r]) => (e[n] = { content: r.code, isBinary: !1 }, e),
|
|
60
60
|
{}
|
|
61
61
|
);
|
|
@@ -158,7 +158,7 @@ const _ = C.arrayToEnum([
|
|
|
158
158
|
"invalid_intersection_types",
|
|
159
159
|
"not_multiple_of",
|
|
160
160
|
"not_finite"
|
|
161
|
-
]),
|
|
161
|
+
]), xa = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
162
162
|
class ie extends Error {
|
|
163
163
|
get errors() {
|
|
164
164
|
return this.issues;
|
|
@@ -275,12 +275,12 @@ const mt = (t, e) => {
|
|
|
275
275
|
}
|
|
276
276
|
return { message: n };
|
|
277
277
|
};
|
|
278
|
-
let
|
|
279
|
-
function
|
|
280
|
-
|
|
278
|
+
let Ss = mt;
|
|
279
|
+
function Ea(t) {
|
|
280
|
+
Ss = t;
|
|
281
281
|
}
|
|
282
282
|
function fn() {
|
|
283
|
-
return
|
|
283
|
+
return Ss;
|
|
284
284
|
}
|
|
285
285
|
const hn = (t) => {
|
|
286
286
|
const { data: e, path: n, errorMaps: r, issueData: s } = t, a = [...n, ...s.path || []], i = E(d({}, s), {
|
|
@@ -299,7 +299,7 @@ const hn = (t) => {
|
|
|
299
299
|
path: a,
|
|
300
300
|
message: o
|
|
301
301
|
});
|
|
302
|
-
},
|
|
302
|
+
}, Sa = [];
|
|
303
303
|
function y(t, e) {
|
|
304
304
|
const n = fn(), r = hn({
|
|
305
305
|
issueData: e,
|
|
@@ -318,7 +318,7 @@ function y(t, e) {
|
|
|
318
318
|
});
|
|
319
319
|
t.common.issues.push(r);
|
|
320
320
|
}
|
|
321
|
-
class
|
|
321
|
+
class J {
|
|
322
322
|
constructor() {
|
|
323
323
|
this.value = "valid";
|
|
324
324
|
}
|
|
@@ -347,7 +347,7 @@ class G {
|
|
|
347
347
|
value: i
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
|
-
return
|
|
350
|
+
return J.mergeObjectSync(e, r);
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
353
|
static mergeObjectSync(e, n) {
|
|
@@ -368,7 +368,7 @@ function mn(t, e, n, r) {
|
|
|
368
368
|
if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
369
369
|
return e.get(t);
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function Os(t, e, n, r, s) {
|
|
372
372
|
if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
373
373
|
return e.set(t, n), n;
|
|
374
374
|
}
|
|
@@ -431,7 +431,7 @@ class T {
|
|
|
431
431
|
}
|
|
432
432
|
_processInputParams(e) {
|
|
433
433
|
return {
|
|
434
|
-
status: new
|
|
434
|
+
status: new J(),
|
|
435
435
|
ctx: {
|
|
436
436
|
common: e.parent.common,
|
|
437
437
|
data: e.data,
|
|
@@ -630,26 +630,26 @@ class T {
|
|
|
630
630
|
return this.safeParse(null).success;
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
const
|
|
633
|
+
const Oa = /^c[^\s-]{8,}$/i, Ta = /^[0-9a-z]+$/, Aa = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ca = /^[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, Na = /^[a-z0-9_-]{21}$/i, Pa = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ra = /^[-+]?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)?)??$/, Ia = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ja = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
634
634
|
let Rn;
|
|
635
|
-
const
|
|
636
|
-
function
|
|
635
|
+
const Za = /^(?:(?: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])$/, Da = /^(?:(?: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])$/, Ma = /^(([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]))$/, La = /^(([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])$/, $a = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Fa = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ts = "((\\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])))", Wa = new RegExp(`^${Ts}$`);
|
|
636
|
+
function As(t) {
|
|
637
637
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
638
638
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
return new RegExp(`^${
|
|
640
|
+
function za(t) {
|
|
641
|
+
return new RegExp(`^${As(t)}$`);
|
|
642
642
|
}
|
|
643
|
-
function
|
|
644
|
-
let e = `${
|
|
643
|
+
function Cs(t) {
|
|
644
|
+
let e = `${Ts}T${As(t)}`;
|
|
645
645
|
const n = [];
|
|
646
646
|
return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
|
|
647
647
|
}
|
|
648
|
-
function za(t, e) {
|
|
649
|
-
return !!((e === "v4" || !e) && ja.test(t) || (e === "v6" || !e) && Da.test(t));
|
|
650
|
-
}
|
|
651
648
|
function Va(t, e) {
|
|
652
|
-
|
|
649
|
+
return !!((e === "v4" || !e) && Za.test(t) || (e === "v6" || !e) && Ma.test(t));
|
|
650
|
+
}
|
|
651
|
+
function Ua(t, e) {
|
|
652
|
+
if (!Pa.test(t))
|
|
653
653
|
return !1;
|
|
654
654
|
try {
|
|
655
655
|
const [n] = t.split("."), r = n.replace(/-/g, "+").replace(/_/g, "/").padEnd(n.length + (4 - n.length % 4) % 4, "="), s = JSON.parse(atob(r));
|
|
@@ -658,8 +658,8 @@ function Va(t, e) {
|
|
|
658
658
|
return !1;
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
function
|
|
662
|
-
return !!((e === "v4" || !e) &&
|
|
661
|
+
function Ba(t, e) {
|
|
662
|
+
return !!((e === "v4" || !e) && Da.test(t) || (e === "v6" || !e) && La.test(t));
|
|
663
663
|
}
|
|
664
664
|
class he extends T {
|
|
665
665
|
_parse(e) {
|
|
@@ -671,7 +671,7 @@ class he extends T {
|
|
|
671
671
|
received: s.parsedType
|
|
672
672
|
}), S;
|
|
673
673
|
}
|
|
674
|
-
const n = new
|
|
674
|
+
const n = new J();
|
|
675
675
|
let r;
|
|
676
676
|
for (const s of this._def.checks)
|
|
677
677
|
if (s.kind === "min")
|
|
@@ -710,43 +710,43 @@ class he extends T {
|
|
|
710
710
|
message: s.message
|
|
711
711
|
}), n.dirty());
|
|
712
712
|
} else if (s.kind === "email")
|
|
713
|
-
|
|
713
|
+
Ia.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
714
714
|
validation: "email",
|
|
715
715
|
code: f.invalid_string,
|
|
716
716
|
message: s.message
|
|
717
717
|
}), n.dirty());
|
|
718
718
|
else if (s.kind === "emoji")
|
|
719
|
-
Rn || (Rn = new RegExp(
|
|
719
|
+
Rn || (Rn = new RegExp(ja, "u")), Rn.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
720
720
|
validation: "emoji",
|
|
721
721
|
code: f.invalid_string,
|
|
722
722
|
message: s.message
|
|
723
723
|
}), n.dirty());
|
|
724
724
|
else if (s.kind === "uuid")
|
|
725
|
-
|
|
725
|
+
Ca.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
726
726
|
validation: "uuid",
|
|
727
727
|
code: f.invalid_string,
|
|
728
728
|
message: s.message
|
|
729
729
|
}), n.dirty());
|
|
730
730
|
else if (s.kind === "nanoid")
|
|
731
|
-
|
|
731
|
+
Na.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
732
732
|
validation: "nanoid",
|
|
733
733
|
code: f.invalid_string,
|
|
734
734
|
message: s.message
|
|
735
735
|
}), n.dirty());
|
|
736
736
|
else if (s.kind === "cuid")
|
|
737
|
-
|
|
737
|
+
Oa.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
738
738
|
validation: "cuid",
|
|
739
739
|
code: f.invalid_string,
|
|
740
740
|
message: s.message
|
|
741
741
|
}), n.dirty());
|
|
742
742
|
else if (s.kind === "cuid2")
|
|
743
|
-
|
|
743
|
+
Ta.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
744
744
|
validation: "cuid2",
|
|
745
745
|
code: f.invalid_string,
|
|
746
746
|
message: s.message
|
|
747
747
|
}), n.dirty());
|
|
748
748
|
else if (s.kind === "ulid")
|
|
749
|
-
|
|
749
|
+
Aa.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
750
750
|
validation: "ulid",
|
|
751
751
|
code: f.invalid_string,
|
|
752
752
|
message: s.message
|
|
@@ -777,39 +777,39 @@ class he extends T {
|
|
|
777
777
|
code: f.invalid_string,
|
|
778
778
|
validation: { endsWith: s.value },
|
|
779
779
|
message: s.message
|
|
780
|
-
}), n.dirty()) : s.kind === "datetime" ?
|
|
780
|
+
}), n.dirty()) : s.kind === "datetime" ? Cs(s).test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
781
781
|
code: f.invalid_string,
|
|
782
782
|
validation: "datetime",
|
|
783
783
|
message: s.message
|
|
784
|
-
}), n.dirty()) : s.kind === "date" ?
|
|
784
|
+
}), n.dirty()) : s.kind === "date" ? Wa.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
785
785
|
code: f.invalid_string,
|
|
786
786
|
validation: "date",
|
|
787
787
|
message: s.message
|
|
788
|
-
}), n.dirty()) : s.kind === "time" ?
|
|
788
|
+
}), n.dirty()) : s.kind === "time" ? za(s).test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
789
789
|
code: f.invalid_string,
|
|
790
790
|
validation: "time",
|
|
791
791
|
message: s.message
|
|
792
|
-
}), n.dirty()) : s.kind === "duration" ?
|
|
792
|
+
}), n.dirty()) : s.kind === "duration" ? Ra.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
793
793
|
validation: "duration",
|
|
794
794
|
code: f.invalid_string,
|
|
795
795
|
message: s.message
|
|
796
|
-
}), n.dirty()) : s.kind === "ip" ?
|
|
796
|
+
}), n.dirty()) : s.kind === "ip" ? Va(e.data, s.version) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
797
797
|
validation: "ip",
|
|
798
798
|
code: f.invalid_string,
|
|
799
799
|
message: s.message
|
|
800
|
-
}), n.dirty()) : s.kind === "jwt" ?
|
|
800
|
+
}), n.dirty()) : s.kind === "jwt" ? Ua(e.data, s.alg) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
801
801
|
validation: "jwt",
|
|
802
802
|
code: f.invalid_string,
|
|
803
803
|
message: s.message
|
|
804
|
-
}), n.dirty()) : s.kind === "cidr" ?
|
|
804
|
+
}), n.dirty()) : s.kind === "cidr" ? Ba(e.data, s.version) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
805
805
|
validation: "cidr",
|
|
806
806
|
code: f.invalid_string,
|
|
807
807
|
message: s.message
|
|
808
|
-
}), n.dirty()) : s.kind === "base64" ?
|
|
808
|
+
}), n.dirty()) : s.kind === "base64" ? $a.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
809
809
|
validation: "base64",
|
|
810
810
|
code: f.invalid_string,
|
|
811
811
|
message: s.message
|
|
812
|
-
}), n.dirty()) : s.kind === "base64url" ?
|
|
812
|
+
}), n.dirty()) : s.kind === "base64url" ? Fa.test(e.data) || (r = this._getOrReturnCtx(e, r), y(r, {
|
|
813
813
|
validation: "base64url",
|
|
814
814
|
code: f.invalid_string,
|
|
815
815
|
message: s.message
|
|
@@ -1032,7 +1032,7 @@ he.create = (t) => {
|
|
|
1032
1032
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
1033
1033
|
}, O(t)));
|
|
1034
1034
|
};
|
|
1035
|
-
function
|
|
1035
|
+
function qa(t, e) {
|
|
1036
1036
|
const n = (t.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = n > r ? n : r, a = parseInt(t.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
1037
1037
|
return a % i / Math.pow(10, s);
|
|
1038
1038
|
}
|
|
@@ -1050,7 +1050,7 @@ class Me extends T {
|
|
|
1050
1050
|
}), S;
|
|
1051
1051
|
}
|
|
1052
1052
|
let n;
|
|
1053
|
-
const r = new
|
|
1053
|
+
const r = new J();
|
|
1054
1054
|
for (const s of this._def.checks)
|
|
1055
1055
|
s.kind === "int" ? C.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
1056
1056
|
code: f.invalid_type,
|
|
@@ -1071,7 +1071,7 @@ class Me extends T {
|
|
|
1071
1071
|
inclusive: s.inclusive,
|
|
1072
1072
|
exact: !1,
|
|
1073
1073
|
message: s.message
|
|
1074
|
-
}), r.dirty()) : s.kind === "multipleOf" ?
|
|
1074
|
+
}), r.dirty()) : s.kind === "multipleOf" ? qa(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), y(n, {
|
|
1075
1075
|
code: f.not_multiple_of,
|
|
1076
1076
|
multipleOf: s.value,
|
|
1077
1077
|
message: s.message
|
|
@@ -1219,7 +1219,7 @@ class Le extends T {
|
|
|
1219
1219
|
if (this._getType(e) !== _.bigint)
|
|
1220
1220
|
return this._getInvalidInput(e);
|
|
1221
1221
|
let n;
|
|
1222
|
-
const r = new
|
|
1222
|
+
const r = new J();
|
|
1223
1223
|
for (const s of this._def.checks)
|
|
1224
1224
|
s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), y(n, {
|
|
1225
1225
|
code: f.too_small,
|
|
@@ -1371,7 +1371,7 @@ class Qe extends T {
|
|
|
1371
1371
|
code: f.invalid_date
|
|
1372
1372
|
}), S;
|
|
1373
1373
|
}
|
|
1374
|
-
const n = new
|
|
1374
|
+
const n = new J();
|
|
1375
1375
|
let r;
|
|
1376
1376
|
for (const s of this._def.checks)
|
|
1377
1377
|
s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r), y(r, {
|
|
@@ -1566,9 +1566,9 @@ class pe extends T {
|
|
|
1566
1566
|
exact: !1,
|
|
1567
1567
|
message: s.maxLength.message
|
|
1568
1568
|
}), r.dirty()), n.common.async)
|
|
1569
|
-
return Promise.all([...n.data].map((i, o) => s.type._parseAsync(new xe(n, i, n.path, o)))).then((i) =>
|
|
1569
|
+
return Promise.all([...n.data].map((i, o) => s.type._parseAsync(new xe(n, i, n.path, o)))).then((i) => J.mergeArray(r, i));
|
|
1570
1570
|
const a = [...n.data].map((i, o) => s.type._parseSync(new xe(n, i, n.path, o)));
|
|
1571
|
-
return
|
|
1571
|
+
return J.mergeArray(r, a);
|
|
1572
1572
|
}
|
|
1573
1573
|
get element() {
|
|
1574
1574
|
return this._def.type;
|
|
@@ -1684,7 +1684,7 @@ class F extends T {
|
|
|
1684
1684
|
});
|
|
1685
1685
|
}
|
|
1686
1686
|
return u;
|
|
1687
|
-
})).then((u) =>
|
|
1687
|
+
})).then((u) => J.mergeObjectSync(n, u)) : J.mergeObjectSync(n, o);
|
|
1688
1688
|
}
|
|
1689
1689
|
get shape() {
|
|
1690
1690
|
return this._def.shape();
|
|
@@ -1860,7 +1860,7 @@ class F extends T {
|
|
|
1860
1860
|
}));
|
|
1861
1861
|
}
|
|
1862
1862
|
keyof() {
|
|
1863
|
-
return
|
|
1863
|
+
return Ns(C.objectKeys(this.shape));
|
|
1864
1864
|
}
|
|
1865
1865
|
}
|
|
1866
1866
|
F.create = (t, e) => new F(d({
|
|
@@ -2102,7 +2102,7 @@ class Ee extends T {
|
|
|
2102
2102
|
const o = this._def.items[i] || this._def.rest;
|
|
2103
2103
|
return o ? o._parse(new xe(r, a, r.path, i)) : null;
|
|
2104
2104
|
}).filter((a) => !!a);
|
|
2105
|
-
return r.common.async ? Promise.all(s).then((a) =>
|
|
2105
|
+
return r.common.async ? Promise.all(s).then((a) => J.mergeArray(n, a)) : J.mergeArray(n, s);
|
|
2106
2106
|
}
|
|
2107
2107
|
get items() {
|
|
2108
2108
|
return this._def.items;
|
|
@@ -2144,7 +2144,7 @@ class Lt extends T {
|
|
|
2144
2144
|
value: i._parse(new xe(r, r.data[o], r.path, o)),
|
|
2145
2145
|
alwaysSet: o in r.data
|
|
2146
2146
|
});
|
|
2147
|
-
return r.common.async ?
|
|
2147
|
+
return r.common.async ? J.mergeObjectAsync(n, s) : J.mergeObjectSync(n, s);
|
|
2148
2148
|
}
|
|
2149
2149
|
get element() {
|
|
2150
2150
|
return this._def.valueType;
|
|
@@ -2402,7 +2402,7 @@ Ft.create = (t, e) => new Ft(d({
|
|
|
2402
2402
|
value: t,
|
|
2403
2403
|
typeName: x.ZodLiteral
|
|
2404
2404
|
}, O(e)));
|
|
2405
|
-
function
|
|
2405
|
+
function Ns(t, e) {
|
|
2406
2406
|
return new $e(d({
|
|
2407
2407
|
values: t,
|
|
2408
2408
|
typeName: x.ZodEnum
|
|
@@ -2421,7 +2421,7 @@ class $e extends T {
|
|
|
2421
2421
|
code: f.invalid_type
|
|
2422
2422
|
}), S;
|
|
2423
2423
|
}
|
|
2424
|
-
if (mn(this, xt) ||
|
|
2424
|
+
if (mn(this, xt) || Os(this, xt, new Set(this._def.values)), !mn(this, xt).has(e.data)) {
|
|
2425
2425
|
const n = this._getOrReturnCtx(e), r = this._def.values;
|
|
2426
2426
|
return y(n, {
|
|
2427
2427
|
received: n.data,
|
|
@@ -2460,7 +2460,7 @@ class $e extends T {
|
|
|
2460
2460
|
}
|
|
2461
2461
|
}
|
|
2462
2462
|
xt = /* @__PURE__ */ new WeakMap();
|
|
2463
|
-
$e.create =
|
|
2463
|
+
$e.create = Ns;
|
|
2464
2464
|
class Wt extends T {
|
|
2465
2465
|
constructor() {
|
|
2466
2466
|
super(...arguments), Et.set(this, void 0);
|
|
@@ -2475,7 +2475,7 @@ class Wt extends T {
|
|
|
2475
2475
|
code: f.invalid_type
|
|
2476
2476
|
}), S;
|
|
2477
2477
|
}
|
|
2478
|
-
if (mn(this, Et) ||
|
|
2478
|
+
if (mn(this, Et) || Os(this, Et, new Set(C.getValidEnumValues(this._def.values))), !mn(this, Et).has(e.data)) {
|
|
2479
2479
|
const s = C.objectValues(n);
|
|
2480
2480
|
return y(r, {
|
|
2481
2481
|
received: r.data,
|
|
@@ -2701,7 +2701,7 @@ class vn extends T {
|
|
|
2701
2701
|
vn.create = (t) => new vn(d({
|
|
2702
2702
|
typeName: x.ZodNaN
|
|
2703
2703
|
}, O(t)));
|
|
2704
|
-
const
|
|
2704
|
+
const Ka = Symbol("zod_brand");
|
|
2705
2705
|
class Ar extends T {
|
|
2706
2706
|
_parse(e) {
|
|
2707
2707
|
const { ctx: n } = this._processInputParams(e), r = n.data;
|
|
@@ -2768,7 +2768,7 @@ Ut.create = (t, e) => new Ut(d({
|
|
|
2768
2768
|
innerType: t,
|
|
2769
2769
|
typeName: x.ZodReadonly
|
|
2770
2770
|
}, O(e)));
|
|
2771
|
-
function
|
|
2771
|
+
function Ps(t, e = {}, n) {
|
|
2772
2772
|
return t ? yt.create().superRefine((r, s) => {
|
|
2773
2773
|
var a, i;
|
|
2774
2774
|
if (!t(r)) {
|
|
@@ -2777,16 +2777,16 @@ function Ns(t, e = {}, n) {
|
|
|
2777
2777
|
}
|
|
2778
2778
|
}) : yt.create();
|
|
2779
2779
|
}
|
|
2780
|
-
const
|
|
2780
|
+
const Ha = {
|
|
2781
2781
|
object: F.lazycreate
|
|
2782
2782
|
};
|
|
2783
2783
|
var x;
|
|
2784
2784
|
(function(t) {
|
|
2785
2785
|
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";
|
|
2786
2786
|
})(x || (x = {}));
|
|
2787
|
-
const
|
|
2787
|
+
const Ga = (t, e = {
|
|
2788
2788
|
message: `Input not instance of ${t.name}`
|
|
2789
|
-
}) =>
|
|
2789
|
+
}) => Ps((n) => n instanceof t, e), Rs = he.create, Is = Me.create, Ja = vn.create, Xa = Le.create, js = It.create, Ya = Qe.create, Qa = yn.create, ei = jt.create, ti = Zt.create, ni = yt.create, ri = Xe.create, si = Re.create, ai = gn.create, ii = pe.create, oi = F.create, ui = F.strictCreate, ci = Dt.create, di = En.create, li = Mt.create, fi = Ee.create, hi = Lt.create, pi = _n.create, mi = et.create, yi = ht.create, gi = $t.create, _i = Ft.create, vi = $e.create, bi = Wt.create, wi = gt.create, Xr = me.create, ki = we.create, xi = Fe.create, Ei = me.createWithPreprocess, Si = Jt.create, Oi = () => Rs().optional(), Ti = () => Is().optional(), Ai = () => js().optional(), Ci = {
|
|
2790
2790
|
string: (t) => he.create(E(d({}, t), { coerce: !0 })),
|
|
2791
2791
|
number: (t) => Me.create(E(d({}, t), { coerce: !0 })),
|
|
2792
2792
|
boolean: (t) => It.create(E(d({}, t), {
|
|
@@ -2794,16 +2794,16 @@ const Ha = (t, e = {
|
|
|
2794
2794
|
})),
|
|
2795
2795
|
bigint: (t) => Le.create(E(d({}, t), { coerce: !0 })),
|
|
2796
2796
|
date: (t) => Qe.create(E(d({}, t), { coerce: !0 }))
|
|
2797
|
-
},
|
|
2797
|
+
}, Ni = S;
|
|
2798
2798
|
var se = /* @__PURE__ */ Object.freeze({
|
|
2799
2799
|
__proto__: null,
|
|
2800
2800
|
defaultErrorMap: mt,
|
|
2801
|
-
setErrorMap:
|
|
2801
|
+
setErrorMap: Ea,
|
|
2802
2802
|
getErrorMap: fn,
|
|
2803
2803
|
makeIssue: hn,
|
|
2804
|
-
EMPTY_PATH:
|
|
2804
|
+
EMPTY_PATH: Sa,
|
|
2805
2805
|
addIssueToContext: y,
|
|
2806
|
-
ParseStatus:
|
|
2806
|
+
ParseStatus: J,
|
|
2807
2807
|
INVALID: S,
|
|
2808
2808
|
DIRTY: pn,
|
|
2809
2809
|
OK: ee,
|
|
@@ -2820,7 +2820,7 @@ var se = /* @__PURE__ */ Object.freeze({
|
|
|
2820
2820
|
ZodParsedType: _,
|
|
2821
2821
|
getParsedType: Ne,
|
|
2822
2822
|
ZodType: T,
|
|
2823
|
-
datetimeRegex:
|
|
2823
|
+
datetimeRegex: Cs,
|
|
2824
2824
|
ZodString: he,
|
|
2825
2825
|
ZodNumber: Me,
|
|
2826
2826
|
ZodBigInt: Le,
|
|
@@ -2855,60 +2855,60 @@ var se = /* @__PURE__ */ Object.freeze({
|
|
|
2855
2855
|
ZodDefault: zt,
|
|
2856
2856
|
ZodCatch: Vt,
|
|
2857
2857
|
ZodNaN: vn,
|
|
2858
|
-
BRAND:
|
|
2858
|
+
BRAND: Ka,
|
|
2859
2859
|
ZodBranded: Ar,
|
|
2860
2860
|
ZodPipeline: Jt,
|
|
2861
2861
|
ZodReadonly: Ut,
|
|
2862
|
-
custom:
|
|
2862
|
+
custom: Ps,
|
|
2863
2863
|
Schema: T,
|
|
2864
2864
|
ZodSchema: T,
|
|
2865
|
-
late:
|
|
2865
|
+
late: Ha,
|
|
2866
2866
|
get ZodFirstPartyTypeKind() {
|
|
2867
2867
|
return x;
|
|
2868
2868
|
},
|
|
2869
|
-
coerce:
|
|
2870
|
-
any:
|
|
2871
|
-
array:
|
|
2872
|
-
bigint:
|
|
2873
|
-
boolean:
|
|
2874
|
-
date:
|
|
2875
|
-
discriminatedUnion:
|
|
2869
|
+
coerce: Ci,
|
|
2870
|
+
any: ni,
|
|
2871
|
+
array: ii,
|
|
2872
|
+
bigint: Xa,
|
|
2873
|
+
boolean: js,
|
|
2874
|
+
date: Ya,
|
|
2875
|
+
discriminatedUnion: di,
|
|
2876
2876
|
effect: Xr,
|
|
2877
|
-
enum:
|
|
2878
|
-
function:
|
|
2879
|
-
instanceof:
|
|
2880
|
-
intersection:
|
|
2881
|
-
lazy:
|
|
2882
|
-
literal:
|
|
2883
|
-
map:
|
|
2884
|
-
nan:
|
|
2885
|
-
nativeEnum:
|
|
2886
|
-
never:
|
|
2887
|
-
null:
|
|
2888
|
-
nullable:
|
|
2889
|
-
number:
|
|
2890
|
-
object:
|
|
2891
|
-
oboolean:
|
|
2892
|
-
onumber:
|
|
2893
|
-
optional:
|
|
2894
|
-
ostring:
|
|
2895
|
-
pipeline:
|
|
2896
|
-
preprocess:
|
|
2897
|
-
promise:
|
|
2898
|
-
record:
|
|
2899
|
-
set:
|
|
2900
|
-
strictObject:
|
|
2901
|
-
string:
|
|
2902
|
-
symbol:
|
|
2877
|
+
enum: vi,
|
|
2878
|
+
function: yi,
|
|
2879
|
+
instanceof: Ga,
|
|
2880
|
+
intersection: li,
|
|
2881
|
+
lazy: gi,
|
|
2882
|
+
literal: _i,
|
|
2883
|
+
map: pi,
|
|
2884
|
+
nan: Ja,
|
|
2885
|
+
nativeEnum: bi,
|
|
2886
|
+
never: si,
|
|
2887
|
+
null: ti,
|
|
2888
|
+
nullable: xi,
|
|
2889
|
+
number: Is,
|
|
2890
|
+
object: oi,
|
|
2891
|
+
oboolean: Ai,
|
|
2892
|
+
onumber: Ti,
|
|
2893
|
+
optional: ki,
|
|
2894
|
+
ostring: Oi,
|
|
2895
|
+
pipeline: Si,
|
|
2896
|
+
preprocess: Ei,
|
|
2897
|
+
promise: wi,
|
|
2898
|
+
record: hi,
|
|
2899
|
+
set: mi,
|
|
2900
|
+
strictObject: ui,
|
|
2901
|
+
string: Rs,
|
|
2902
|
+
symbol: Qa,
|
|
2903
2903
|
transformer: Xr,
|
|
2904
|
-
tuple:
|
|
2905
|
-
undefined:
|
|
2906
|
-
union:
|
|
2907
|
-
unknown:
|
|
2908
|
-
void:
|
|
2909
|
-
NEVER:
|
|
2904
|
+
tuple: fi,
|
|
2905
|
+
undefined: ei,
|
|
2906
|
+
union: ci,
|
|
2907
|
+
unknown: ri,
|
|
2908
|
+
void: ai,
|
|
2909
|
+
NEVER: Ni,
|
|
2910
2910
|
ZodIssueCode: f,
|
|
2911
|
-
quotelessJson:
|
|
2911
|
+
quotelessJson: xa,
|
|
2912
2912
|
ZodError: ie
|
|
2913
2913
|
});
|
|
2914
2914
|
se.object({
|
|
@@ -2937,16 +2937,16 @@ se.object({
|
|
|
2937
2937
|
})
|
|
2938
2938
|
])
|
|
2939
2939
|
);
|
|
2940
|
-
var
|
|
2940
|
+
var Pi = Object.defineProperty, Ri = Object.defineProperties, Ii = Object.getOwnPropertyDescriptors, Yr = Object.getOwnPropertySymbols, ji = Object.prototype.hasOwnProperty, Zi = Object.prototype.propertyIsEnumerable, Qr = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), Zs = (t) => {
|
|
2941
2941
|
throw TypeError(t);
|
|
2942
|
-
}, es = (t, e, n) => e in t ?
|
|
2942
|
+
}, es = (t, e, n) => e in t ? Pi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ae = (t, e) => {
|
|
2943
2943
|
for (var n in e || (e = {}))
|
|
2944
|
-
|
|
2944
|
+
ji.call(e, n) && es(t, n, e[n]);
|
|
2945
2945
|
if (Yr)
|
|
2946
2946
|
for (var n of Yr(e))
|
|
2947
|
-
|
|
2947
|
+
Zi.call(e, n) && es(t, n, e[n]);
|
|
2948
2948
|
return t;
|
|
2949
|
-
}, Cr = (t, e) =>
|
|
2949
|
+
}, Cr = (t, e) => Ri(t, Ii(e)), Nr = (t, e, n) => e.has(t) || Zs("Cannot " + n), P = (t, e, n) => (Nr(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Zs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), G = (t, e, n, r) => (Nr(t, e, "write to private field"), e.set(t, n), n), ve = (t, e, n) => (Nr(t, e, "access private method"), n), V = (t, e, n) => new Promise((r, s) => {
|
|
2950
2950
|
var a = (u) => {
|
|
2951
2951
|
try {
|
|
2952
2952
|
o(n.next(u));
|
|
@@ -2961,59 +2961,59 @@ var Ni = Object.defineProperty, Pi = Object.defineProperties, Ri = Object.getOwn
|
|
|
2961
2961
|
}
|
|
2962
2962
|
}, o = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(a, i);
|
|
2963
2963
|
o((n = n.apply(t, e)).next());
|
|
2964
|
-
}),
|
|
2965
|
-
function
|
|
2964
|
+
}), Di = (t, e, n) => (e = t[Qr("asyncIterator")]) ? e.call(t) : (t = t[Qr("iterator")](), e = {}, n = (r, s) => (s = t[r]) && (e[r] = (a) => new Promise((i, o, u) => (a = s.call(t, a), u = a.done, Promise.resolve(a.value).then((c) => i({ value: c, done: u }), o)))), n("next"), n("return"), e), Mi = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
|
|
2965
|
+
function Li(t) {
|
|
2966
2966
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
2967
2967
|
}
|
|
2968
|
-
var Xn = { exports: {} },
|
|
2969
|
-
function
|
|
2968
|
+
var Xn = { exports: {} }, $i = Xn.exports, ts;
|
|
2969
|
+
function Fi() {
|
|
2970
2970
|
return ts || (ts = 1, function(t, e) {
|
|
2971
2971
|
(function(n, r) {
|
|
2972
2972
|
t.exports = r();
|
|
2973
|
-
})(
|
|
2974
|
-
var n = typeof Promise == "function", r = typeof self == "object" ? self :
|
|
2975
|
-
function
|
|
2976
|
-
var $ = typeof
|
|
2973
|
+
})($i, function() {
|
|
2974
|
+
var n = typeof Promise == "function", r = typeof self == "object" ? self : Mi, s = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", u = typeof WeakSet != "undefined", c = typeof DataView != "undefined", h = s && typeof Symbol.iterator != "undefined", p = s && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", g = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), l = g && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), v = h && typeof Array.prototype[Symbol.iterator] == "function", m = v && Object.getPrototypeOf([][Symbol.iterator]()), z = h && typeof String.prototype[Symbol.iterator] == "function", R = z && Object.getPrototypeOf(""[Symbol.iterator]()), q = 8, D = -1;
|
|
2975
|
+
function B(I) {
|
|
2976
|
+
var $ = typeof I;
|
|
2977
2977
|
if ($ !== "object")
|
|
2978
2978
|
return $;
|
|
2979
|
-
if (
|
|
2979
|
+
if (I === null)
|
|
2980
2980
|
return "null";
|
|
2981
|
-
if (
|
|
2981
|
+
if (I === r)
|
|
2982
2982
|
return "global";
|
|
2983
|
-
if (Array.isArray(
|
|
2983
|
+
if (Array.isArray(I) && (p === !1 || !(Symbol.toStringTag in I)))
|
|
2984
2984
|
return "Array";
|
|
2985
2985
|
if (typeof window == "object" && window !== null) {
|
|
2986
|
-
if (typeof window.location == "object" &&
|
|
2986
|
+
if (typeof window.location == "object" && I === window.location)
|
|
2987
2987
|
return "Location";
|
|
2988
|
-
if (typeof window.document == "object" &&
|
|
2988
|
+
if (typeof window.document == "object" && I === window.document)
|
|
2989
2989
|
return "Document";
|
|
2990
2990
|
if (typeof window.navigator == "object") {
|
|
2991
|
-
if (typeof window.navigator.mimeTypes == "object" &&
|
|
2991
|
+
if (typeof window.navigator.mimeTypes == "object" && I === window.navigator.mimeTypes)
|
|
2992
2992
|
return "MimeTypeArray";
|
|
2993
|
-
if (typeof window.navigator.plugins == "object" &&
|
|
2993
|
+
if (typeof window.navigator.plugins == "object" && I === window.navigator.plugins)
|
|
2994
2994
|
return "PluginArray";
|
|
2995
2995
|
}
|
|
2996
|
-
if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") &&
|
|
2997
|
-
if (
|
|
2996
|
+
if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && I instanceof window.HTMLElement) {
|
|
2997
|
+
if (I.tagName === "BLOCKQUOTE")
|
|
2998
2998
|
return "HTMLQuoteElement";
|
|
2999
|
-
if (
|
|
2999
|
+
if (I.tagName === "TD")
|
|
3000
3000
|
return "HTMLTableDataCellElement";
|
|
3001
|
-
if (
|
|
3001
|
+
if (I.tagName === "TH")
|
|
3002
3002
|
return "HTMLTableHeaderCellElement";
|
|
3003
3003
|
}
|
|
3004
3004
|
}
|
|
3005
|
-
var Se = p &&
|
|
3005
|
+
var Se = p && I[Symbol.toStringTag];
|
|
3006
3006
|
if (typeof Se == "string")
|
|
3007
3007
|
return Se;
|
|
3008
|
-
var
|
|
3009
|
-
return
|
|
3008
|
+
var M = Object.getPrototypeOf(I);
|
|
3009
|
+
return M === RegExp.prototype ? "RegExp" : M === Date.prototype ? "Date" : n && M === Promise.prototype ? "Promise" : i && M === Set.prototype ? "Set" : a && M === Map.prototype ? "Map" : u && M === WeakSet.prototype ? "WeakSet" : o && M === WeakMap.prototype ? "WeakMap" : c && M === DataView.prototype ? "DataView" : a && M === l ? "Map Iterator" : i && M === b ? "Set Iterator" : v && M === m ? "Array Iterator" : z && M === R ? "String Iterator" : M === null ? "Object" : Object.prototype.toString.call(I).slice(q, D);
|
|
3010
3010
|
}
|
|
3011
|
-
return
|
|
3011
|
+
return B;
|
|
3012
3012
|
});
|
|
3013
3013
|
}(Xn)), Xn.exports;
|
|
3014
3014
|
}
|
|
3015
|
-
var
|
|
3016
|
-
const
|
|
3015
|
+
var Wi = Fi();
|
|
3016
|
+
const zi = /* @__PURE__ */ Li(Wi), Pr = typeof Buffer != "undefined", Vi = Pr && typeof Buffer.from != "undefined", Ui = Pr ? (
|
|
3017
3017
|
/**
|
|
3018
3018
|
* is value is Buffer?
|
|
3019
3019
|
*
|
|
@@ -3034,7 +3034,7 @@ const Wi = /* @__PURE__ */ Mi(Fi), Pr = typeof Buffer != "undefined", zi = Pr &&
|
|
|
3034
3034
|
function() {
|
|
3035
3035
|
return !1;
|
|
3036
3036
|
}
|
|
3037
|
-
),
|
|
3037
|
+
), Bi = Vi ? (
|
|
3038
3038
|
/**
|
|
3039
3039
|
* copy Buffer
|
|
3040
3040
|
*
|
|
@@ -3070,16 +3070,16 @@ const Wi = /* @__PURE__ */ Mi(Fi), Pr = typeof Buffer != "undefined", zi = Pr &&
|
|
|
3070
3070
|
}
|
|
3071
3071
|
);
|
|
3072
3072
|
function _t(t) {
|
|
3073
|
-
return
|
|
3073
|
+
return Ui(t) ? "Buffer" : zi(t);
|
|
3074
3074
|
}
|
|
3075
|
-
const
|
|
3075
|
+
const qi = /* @__PURE__ */ new Set([
|
|
3076
3076
|
"Arguments",
|
|
3077
3077
|
"Array",
|
|
3078
3078
|
"Map",
|
|
3079
3079
|
"Object",
|
|
3080
3080
|
"Set"
|
|
3081
3081
|
]);
|
|
3082
|
-
function
|
|
3082
|
+
function Ki(t, e, n = null) {
|
|
3083
3083
|
switch (n || _t(t)) {
|
|
3084
3084
|
case "Arguments":
|
|
3085
3085
|
case "Array":
|
|
@@ -3092,7 +3092,7 @@ function qi(t, e, n = null) {
|
|
|
3092
3092
|
}
|
|
3093
3093
|
}
|
|
3094
3094
|
function Yn(t) {
|
|
3095
|
-
return
|
|
3095
|
+
return qi.has(t);
|
|
3096
3096
|
}
|
|
3097
3097
|
function ns(t, e, n, r = null) {
|
|
3098
3098
|
switch (r || _t(t)) {
|
|
@@ -3110,29 +3110,29 @@ function ns(t, e, n, r = null) {
|
|
|
3110
3110
|
}
|
|
3111
3111
|
return t;
|
|
3112
3112
|
}
|
|
3113
|
-
const
|
|
3114
|
-
function Ji(t) {
|
|
3115
|
-
return t.slice(0);
|
|
3116
|
-
}
|
|
3113
|
+
const Hi = typeof globalThis != "undefined" && globalThis !== null && globalThis.Object === Object && globalThis, Gi = typeof global != "undefined" && global !== null && global.Object === Object && global, Ji = typeof self != "undefined" && self !== null && self.Object === Object && self, In = Hi || Gi || Ji || Function("return this")();
|
|
3117
3114
|
function Xi(t) {
|
|
3118
|
-
return
|
|
3115
|
+
return t.slice(0);
|
|
3119
3116
|
}
|
|
3120
3117
|
function Yi(t) {
|
|
3121
|
-
return new
|
|
3118
|
+
return new Boolean(t.valueOf());
|
|
3122
3119
|
}
|
|
3123
3120
|
function Qi(t) {
|
|
3124
|
-
return
|
|
3121
|
+
return new DataView(t.buffer);
|
|
3125
3122
|
}
|
|
3126
3123
|
function eo(t) {
|
|
3127
|
-
return
|
|
3124
|
+
return Bi(t);
|
|
3128
3125
|
}
|
|
3129
3126
|
function to(t) {
|
|
3130
|
-
return new
|
|
3127
|
+
return new Date(t.getTime());
|
|
3131
3128
|
}
|
|
3132
3129
|
function no(t) {
|
|
3133
|
-
return new
|
|
3130
|
+
return new Number(t);
|
|
3134
3131
|
}
|
|
3135
3132
|
function ro(t) {
|
|
3133
|
+
return new RegExp(t.source, t.flags);
|
|
3134
|
+
}
|
|
3135
|
+
function so(t) {
|
|
3136
3136
|
return new String(t);
|
|
3137
3137
|
}
|
|
3138
3138
|
function Ae(t, e) {
|
|
@@ -3144,25 +3144,25 @@ function Y(t) {
|
|
|
3144
3144
|
function rs() {
|
|
3145
3145
|
return [];
|
|
3146
3146
|
}
|
|
3147
|
-
function
|
|
3147
|
+
function ao() {
|
|
3148
3148
|
return /* @__PURE__ */ new Map();
|
|
3149
3149
|
}
|
|
3150
|
-
function
|
|
3150
|
+
function io() {
|
|
3151
3151
|
return {};
|
|
3152
3152
|
}
|
|
3153
|
-
function
|
|
3153
|
+
function oo() {
|
|
3154
3154
|
return /* @__PURE__ */ new Set();
|
|
3155
3155
|
}
|
|
3156
|
-
const
|
|
3156
|
+
const uo = /* @__PURE__ */ new Map([
|
|
3157
3157
|
// deep copy
|
|
3158
|
-
["ArrayBuffer",
|
|
3159
|
-
["Boolean",
|
|
3160
|
-
["Buffer",
|
|
3161
|
-
["DataView",
|
|
3162
|
-
["Date",
|
|
3163
|
-
["Number",
|
|
3164
|
-
["RegExp",
|
|
3165
|
-
["String",
|
|
3158
|
+
["ArrayBuffer", Xi],
|
|
3159
|
+
["Boolean", Yi],
|
|
3160
|
+
["Buffer", eo],
|
|
3161
|
+
["DataView", Qi],
|
|
3162
|
+
["Date", to],
|
|
3163
|
+
["Number", no],
|
|
3164
|
+
["RegExp", ro],
|
|
3165
|
+
["String", so],
|
|
3166
3166
|
// typed arrays
|
|
3167
3167
|
// TODO: pass bound function
|
|
3168
3168
|
["Float32Array", Ae],
|
|
@@ -3196,9 +3196,9 @@ const oo = /* @__PURE__ */ new Map([
|
|
|
3196
3196
|
// NOTE: return empty value, because recursively copy later.
|
|
3197
3197
|
["Arguments", rs],
|
|
3198
3198
|
["Array", rs],
|
|
3199
|
-
["Map",
|
|
3200
|
-
["Object",
|
|
3201
|
-
["Set",
|
|
3199
|
+
["Map", ao],
|
|
3200
|
+
["Object", io],
|
|
3201
|
+
["Set", oo]
|
|
3202
3202
|
// NOTE: type-detect returns following types
|
|
3203
3203
|
// 'Location'
|
|
3204
3204
|
// 'Document'
|
|
@@ -3210,11 +3210,11 @@ const oo = /* @__PURE__ */ new Map([
|
|
|
3210
3210
|
// TODO: is type-detect never return 'object'?
|
|
3211
3211
|
// 'object'
|
|
3212
3212
|
]);
|
|
3213
|
-
function
|
|
3213
|
+
function co() {
|
|
3214
3214
|
}
|
|
3215
|
-
function Qn(t, e = null, n =
|
|
3215
|
+
function Qn(t, e = null, n = co) {
|
|
3216
3216
|
arguments.length === 2 && typeof e == "function" && (n = e, e = null);
|
|
3217
|
-
const r = e || _t(t), s =
|
|
3217
|
+
const r = e || _t(t), s = uo.get(r);
|
|
3218
3218
|
if (r === "Object") {
|
|
3219
3219
|
const a = n(t, r);
|
|
3220
3220
|
if (a !== void 0)
|
|
@@ -3256,7 +3256,7 @@ function er(t, e, n, r, s) {
|
|
|
3256
3256
|
break;
|
|
3257
3257
|
}
|
|
3258
3258
|
for (let u of o) {
|
|
3259
|
-
const c =
|
|
3259
|
+
const c = Ki(t, u, a);
|
|
3260
3260
|
if (r.has(c))
|
|
3261
3261
|
ns(e, u, n.get(c), a);
|
|
3262
3262
|
else {
|
|
@@ -3276,36 +3276,36 @@ function er(t, e, n, r, s) {
|
|
|
3276
3276
|
}
|
|
3277
3277
|
return e;
|
|
3278
3278
|
}
|
|
3279
|
-
const
|
|
3280
|
-
var on, He, un, tr,
|
|
3281
|
-
class
|
|
3279
|
+
const lo = (t) => new Promise((e) => setTimeout(e, t));
|
|
3280
|
+
var on, He, un, tr, Ds;
|
|
3281
|
+
class fo {
|
|
3282
3282
|
constructor({ maxAttempts: e = 3, func: n }) {
|
|
3283
|
-
de(this, tr), de(this, on), de(this, He), de(this, un),
|
|
3283
|
+
de(this, tr), de(this, on), de(this, He), de(this, un), G(this, on, e), G(this, un, n), G(this, He, 0);
|
|
3284
3284
|
}
|
|
3285
3285
|
run() {
|
|
3286
3286
|
return V(this, null, function* () {
|
|
3287
3287
|
try {
|
|
3288
3288
|
return yield P(this, un).call(this);
|
|
3289
3289
|
} catch (e) {
|
|
3290
|
-
if (
|
|
3290
|
+
if (G(this, He, P(this, He) + 1), P(this, He) > P(this, on))
|
|
3291
3291
|
throw console.error("Max attempts reached"), e;
|
|
3292
|
-
const n = ve(this, tr,
|
|
3293
|
-
return yield
|
|
3292
|
+
const n = ve(this, tr, Ds).call(this);
|
|
3293
|
+
return yield lo(n), yield this.run();
|
|
3294
3294
|
}
|
|
3295
3295
|
});
|
|
3296
3296
|
}
|
|
3297
3297
|
}
|
|
3298
|
-
on = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), tr = /* @__PURE__ */ new WeakSet(),
|
|
3298
|
+
on = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), tr = /* @__PURE__ */ new WeakSet(), Ds = function() {
|
|
3299
3299
|
return P(this, He) * 1e3 * 1.5;
|
|
3300
3300
|
};
|
|
3301
|
-
function
|
|
3301
|
+
function ho() {
|
|
3302
3302
|
return typeof CompressionStream != "undefined";
|
|
3303
3303
|
}
|
|
3304
|
-
function
|
|
3304
|
+
function po(t) {
|
|
3305
3305
|
return V(this, null, function* () {
|
|
3306
3306
|
const e = new Blob([t]).stream().pipeThrough(new CompressionStream("gzip")), n = [];
|
|
3307
3307
|
try {
|
|
3308
|
-
for (var r =
|
|
3308
|
+
for (var r = Di(e), s, a, i; s = !(a = yield r.next()).done; s = !1) {
|
|
3309
3309
|
const o = a.value;
|
|
3310
3310
|
n.push(o);
|
|
3311
3311
|
}
|
|
@@ -3319,16 +3319,16 @@ function ho(t) {
|
|
|
3319
3319
|
throw i[0];
|
|
3320
3320
|
}
|
|
3321
3321
|
}
|
|
3322
|
-
return yield
|
|
3322
|
+
return yield mo(n);
|
|
3323
3323
|
});
|
|
3324
3324
|
}
|
|
3325
|
-
function
|
|
3325
|
+
function mo(t) {
|
|
3326
3326
|
return V(this, null, function* () {
|
|
3327
3327
|
const e = yield new Blob(t).arrayBuffer();
|
|
3328
3328
|
return new Uint8Array(e);
|
|
3329
3329
|
});
|
|
3330
3330
|
}
|
|
3331
|
-
class
|
|
3331
|
+
class yo extends Error {
|
|
3332
3332
|
constructor({ resource: e, api: n, args: r, cause: s }) {
|
|
3333
3333
|
if (super(`API Error on resource "${e}" at api "${n}"`), this.causeProperties = {}, this.name = "API Error", this.resource = e, this.api = n, this.cause = s, this.args = r, s instanceof Error)
|
|
3334
3334
|
for (const [i, o] of Object.entries(s))
|
|
@@ -3367,7 +3367,7 @@ class St extends Error {
|
|
|
3367
3367
|
super("Abort Error"), this.name = "Abort Error", this.canceled = n;
|
|
3368
3368
|
}
|
|
3369
3369
|
}
|
|
3370
|
-
class
|
|
3370
|
+
class go extends Error {
|
|
3371
3371
|
constructor(e) {
|
|
3372
3372
|
super(`Async API Error: ${JSON.stringify(e)}`), this.name = "Async API Error", this.body = e;
|
|
3373
3373
|
}
|
|
@@ -3377,7 +3377,7 @@ class jn extends Error {
|
|
|
3377
3377
|
super(e), this.name = "Request Validation Error";
|
|
3378
3378
|
}
|
|
3379
3379
|
}
|
|
3380
|
-
function
|
|
3380
|
+
function Ms() {
|
|
3381
3381
|
return Array.from(
|
|
3382
3382
|
{ length: 32 },
|
|
3383
3383
|
() => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
|
|
@@ -3386,11 +3386,11 @@ function Ds() {
|
|
|
3386
3386
|
function nr() {
|
|
3387
3387
|
return Math.floor(Date.now() / 1e3).toString();
|
|
3388
3388
|
}
|
|
3389
|
-
const
|
|
3389
|
+
const _o = 5 * 60 * 1e3, vo = 1 * 1e3;
|
|
3390
3390
|
var Ge, te, ge, rr, sr, Ot;
|
|
3391
|
-
class
|
|
3391
|
+
class bo {
|
|
3392
3392
|
constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
|
|
3393
|
-
de(this, ge), de(this, Ge), de(this, te), this.baseAddress = n,
|
|
3393
|
+
de(this, ge), de(this, Ge), de(this, te), this.baseAddress = n, G(this, Ge, e), G(this, te, {}), this.plugins = [];
|
|
3394
3394
|
}
|
|
3395
3395
|
get headers() {
|
|
3396
3396
|
throw new Error("Missing implementation");
|
|
@@ -3402,38 +3402,38 @@ class vo {
|
|
|
3402
3402
|
this.plugins = this.plugins.filter((n) => n.name !== e);
|
|
3403
3403
|
}
|
|
3404
3404
|
withOptions(e = {}) {
|
|
3405
|
-
return
|
|
3405
|
+
return G(this, te, e), this;
|
|
3406
3406
|
}
|
|
3407
3407
|
get(e) {
|
|
3408
3408
|
return V(this, arguments, function* (n, r = {}) {
|
|
3409
3409
|
const { overrideBaseAddress: s, overrideDefaultHeaders: a } = r, i = s != null ? s : this.baseAddress;
|
|
3410
3410
|
let o = a != null ? a : this.headers;
|
|
3411
3411
|
const u = kt(P(this, te));
|
|
3412
|
-
return
|
|
3412
|
+
return G(this, te, {}), u.extraHeaders && (o = ae(ae({}, o), u.extraHeaders)), u.requestValidation && (o = Cr(ae({}, o), { "X-Request-Nonce": Ms(), "X-Request-Timestamp": nr() })), u.async ? yield ve(this, ge, sr).call(this, `${i}${n}`, u.async, { headers: o }) : yield ve(this, ge, rr).call(this, `${i}${n}`, u, { headers: o });
|
|
3413
3413
|
});
|
|
3414
3414
|
}
|
|
3415
3415
|
post(e, n) {
|
|
3416
3416
|
return V(this, arguments, function* (r, s, a = {}) {
|
|
3417
3417
|
const i = kt(P(this, te));
|
|
3418
|
-
return
|
|
3418
|
+
return G(this, te, {}), ve(this, ge, Ot).call(this, r, "POST", s, a, i);
|
|
3419
3419
|
});
|
|
3420
3420
|
}
|
|
3421
3421
|
put(e, n) {
|
|
3422
3422
|
return V(this, arguments, function* (r, s, a = {}) {
|
|
3423
3423
|
const i = kt(P(this, te));
|
|
3424
|
-
return
|
|
3424
|
+
return G(this, te, {}), ve(this, ge, Ot).call(this, r, "PUT", s, a, i);
|
|
3425
3425
|
});
|
|
3426
3426
|
}
|
|
3427
3427
|
delete(e, n) {
|
|
3428
3428
|
return V(this, arguments, function* (r, s, a = {}) {
|
|
3429
3429
|
const i = kt(P(this, te));
|
|
3430
|
-
return
|
|
3430
|
+
return G(this, te, {}), ve(this, ge, Ot).call(this, r, "DELETE", s, a, i);
|
|
3431
3431
|
});
|
|
3432
3432
|
}
|
|
3433
3433
|
patch(e, n) {
|
|
3434
3434
|
return V(this, arguments, function* (r, s, a = {}) {
|
|
3435
3435
|
const i = kt(P(this, te));
|
|
3436
|
-
return
|
|
3436
|
+
return G(this, te, {}), ve(this, ge, Ot).call(this, r, "PATCH", s, a, i);
|
|
3437
3437
|
});
|
|
3438
3438
|
}
|
|
3439
3439
|
}
|
|
@@ -3467,8 +3467,8 @@ Ge = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
3467
3467
|
const p = a(u, "x-response-nonce"), k = s == null ? void 0 : s["X-Request-Nonce"];
|
|
3468
3468
|
if (!p || p !== k)
|
|
3469
3469
|
throw new jn("Response nonce mismatch");
|
|
3470
|
-
const g = Number(a(u, "x-response-timestamp")),
|
|
3471
|
-
if (isNaN(g) || Math.abs(
|
|
3470
|
+
const g = Number(a(u, "x-response-timestamp")), b = Number(nr()), l = 60 * 60 * 24;
|
|
3471
|
+
if (isNaN(g) || Math.abs(b - g) > l)
|
|
3472
3472
|
throw new jn("Invalid response timestamp");
|
|
3473
3473
|
} catch (p) {
|
|
3474
3474
|
const k = p instanceof Error ? p.message : "Request validation failed";
|
|
@@ -3482,7 +3482,7 @@ Ge = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
3482
3482
|
return h;
|
|
3483
3483
|
});
|
|
3484
3484
|
if (e.retry) {
|
|
3485
|
-
const u = yield new
|
|
3485
|
+
const u = yield new fo({
|
|
3486
3486
|
maxAttempts: e.retry,
|
|
3487
3487
|
func: r
|
|
3488
3488
|
}).run();
|
|
@@ -3497,56 +3497,56 @@ Ge = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
3497
3497
|
const {
|
|
3498
3498
|
onProgress: a,
|
|
3499
3499
|
abortSignal: i,
|
|
3500
|
-
pollingInterval: o = () =>
|
|
3501
|
-
maxTimeout: u =
|
|
3500
|
+
pollingInterval: o = () => vo,
|
|
3501
|
+
maxTimeout: u = _o
|
|
3502
3502
|
} = e, c = `${t}/async`, h = `${t}/async/job`;
|
|
3503
3503
|
let p;
|
|
3504
3504
|
try {
|
|
3505
3505
|
p = yield P(this, Ge).call(this, c, ae(ae({}, n), i && { signal: i }));
|
|
3506
|
-
} catch (
|
|
3507
|
-
throw
|
|
3506
|
+
} catch (b) {
|
|
3507
|
+
throw b instanceof Error && b.name === "AbortError" ? new St({ canceled: (r = i == null ? void 0 : i.aborted) != null ? r : !1 }) : b;
|
|
3508
3508
|
}
|
|
3509
3509
|
if (!p.ok) {
|
|
3510
|
-
const
|
|
3510
|
+
const b = yield p.text().catch();
|
|
3511
3511
|
throw new ss({
|
|
3512
3512
|
url: t,
|
|
3513
3513
|
method: (s = n == null ? void 0 : n.method) != null ? s : "GET",
|
|
3514
3514
|
statusCode: p.status,
|
|
3515
3515
|
requestHeaders: this.headers,
|
|
3516
3516
|
responseHeaders: p.headers,
|
|
3517
|
-
body:
|
|
3517
|
+
body: b
|
|
3518
3518
|
});
|
|
3519
3519
|
}
|
|
3520
3520
|
const k = yield p.json(), { job_id: g } = k;
|
|
3521
3521
|
if (!g)
|
|
3522
3522
|
throw new Error("Job ID not found in response");
|
|
3523
|
-
return new Promise((
|
|
3524
|
-
const
|
|
3523
|
+
return new Promise((b, l) => V(this, null, function* () {
|
|
3524
|
+
const v = setTimeout(() => {
|
|
3525
3525
|
l(new Error("Job timed out"));
|
|
3526
|
-
}, u), m = (
|
|
3526
|
+
}, u), m = (z = 0) => V(this, null, function* () {
|
|
3527
3527
|
if (i != null && i.aborted) {
|
|
3528
|
-
clearTimeout(
|
|
3528
|
+
clearTimeout(v), P(this, Ge).call(this, `${h}/${g}/cancel`, { method: "POST", headers: this.headers }).then(() => {
|
|
3529
3529
|
l(new St({ canceled: !0 }));
|
|
3530
|
-
}).catch((
|
|
3530
|
+
}).catch((R) => {
|
|
3531
3531
|
l(new St({ canceled: !1 }));
|
|
3532
3532
|
});
|
|
3533
3533
|
return;
|
|
3534
3534
|
}
|
|
3535
3535
|
try {
|
|
3536
|
-
const
|
|
3537
|
-
if (
|
|
3538
|
-
clearTimeout(
|
|
3539
|
-
const
|
|
3540
|
-
|
|
3541
|
-
} else if (
|
|
3542
|
-
clearTimeout(
|
|
3536
|
+
const R = yield (yield P(this, Ge).call(this, `${h}/${g}`, { headers: this.headers })).json();
|
|
3537
|
+
if (R.status === "success") {
|
|
3538
|
+
clearTimeout(v);
|
|
3539
|
+
const q = R.response_json;
|
|
3540
|
+
b(q);
|
|
3541
|
+
} else if (R.status === "failed")
|
|
3542
|
+
clearTimeout(v), l(new go(R.response_json));
|
|
3543
3543
|
else {
|
|
3544
|
-
a && a(
|
|
3545
|
-
const
|
|
3546
|
-
setTimeout(() => m(
|
|
3544
|
+
a && a(R.response_json);
|
|
3545
|
+
const q = o(z);
|
|
3546
|
+
setTimeout(() => m(z + 1), q);
|
|
3547
3547
|
}
|
|
3548
|
-
} catch (
|
|
3549
|
-
l(
|
|
3548
|
+
} catch (R) {
|
|
3549
|
+
l(R);
|
|
3550
3550
|
}
|
|
3551
3551
|
});
|
|
3552
3552
|
m();
|
|
@@ -3556,16 +3556,16 @@ Ge = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
3556
3556
|
return V(this, null, function* () {
|
|
3557
3557
|
const { overrideBaseAddress: a, overrideDefaultHeaders: i } = r, o = a != null ? a : this.baseAddress;
|
|
3558
3558
|
let u = i != null ? i : this.headers;
|
|
3559
|
-
s.extraHeaders && (u = ae(ae({}, u), s.extraHeaders)), s.requestValidation && (u = Cr(ae({}, u), { "X-Request-Nonce":
|
|
3559
|
+
s.extraHeaders && (u = ae(ae({}, u), s.extraHeaders)), s.requestValidation && (u = Cr(ae({}, u), { "X-Request-Nonce": Ms(), "X-Request-Timestamp": nr() }));
|
|
3560
3560
|
let c = r.skipBodyJsonStringify ? n : JSON.stringify(n);
|
|
3561
|
-
return s.compress &&
|
|
3561
|
+
return s.compress && ho() && (u["Content-Encoding"] = "gzip", c = yield po(c)), s.async ? yield ve(this, ge, sr).call(this, `${o}${t}`, s.async, {
|
|
3562
3562
|
method: e,
|
|
3563
3563
|
headers: u,
|
|
3564
3564
|
body: c
|
|
3565
3565
|
}) : yield ve(this, ge, rr).call(this, `${o}${t}`, s, { method: e, headers: u, body: c });
|
|
3566
3566
|
});
|
|
3567
3567
|
};
|
|
3568
|
-
const as = (t, e, n, r) => t instanceof St ? t : new
|
|
3568
|
+
const as = (t, e, n, r) => t instanceof St ? t : new yo({ resource: e, api: String(n), args: r, cause: t }), Zn = (t, e) => new Proxy(e, {
|
|
3569
3569
|
get(n, r) {
|
|
3570
3570
|
return (...s) => {
|
|
3571
3571
|
var a;
|
|
@@ -3587,9 +3587,9 @@ const as = (t, e, n, r) => t instanceof St ? t : new mo({ resource: e, api: Stri
|
|
|
3587
3587
|
}
|
|
3588
3588
|
});
|
|
3589
3589
|
var Tt;
|
|
3590
|
-
class
|
|
3590
|
+
class wo {
|
|
3591
3591
|
constructor(e) {
|
|
3592
|
-
de(this, Tt), this.resourceName = "Files",
|
|
3592
|
+
de(this, Tt), this.resourceName = "Files", G(this, Tt, e);
|
|
3593
3593
|
}
|
|
3594
3594
|
get(e) {
|
|
3595
3595
|
return V(this, arguments, function* ({ fileKey: n, params: r = {} }) {
|
|
@@ -3608,14 +3608,14 @@ class bo {
|
|
|
3608
3608
|
}
|
|
3609
3609
|
}
|
|
3610
3610
|
Tt = /* @__PURE__ */ new WeakMap();
|
|
3611
|
-
const
|
|
3611
|
+
const ko = (t, e, n) => {
|
|
3612
3612
|
const r = e.sort();
|
|
3613
3613
|
return `${t}-${r.join("-")}-${n}`;
|
|
3614
|
-
},
|
|
3615
|
-
var _e, ar,
|
|
3616
|
-
class
|
|
3614
|
+
}, xo = (t) => t ? t.ts > Date.now() - 1e3 * 30 : !1;
|
|
3615
|
+
var _e, ar, Ls;
|
|
3616
|
+
class Eo {
|
|
3617
3617
|
constructor(e) {
|
|
3618
|
-
de(this, ar), de(this, _e), this.resourceName = "Images",
|
|
3618
|
+
de(this, ar), de(this, _e), this.resourceName = "Images", G(this, _e, e);
|
|
3619
3619
|
}
|
|
3620
3620
|
/**
|
|
3621
3621
|
* Return the URL for the _layer_ images for the given nodes.
|
|
@@ -3623,14 +3623,14 @@ class xo {
|
|
|
3623
3623
|
*/
|
|
3624
3624
|
get(e) {
|
|
3625
3625
|
return V(this, arguments, function* ({ fileKey: n, nodeIds: r, format: s = "jpg", scale: a }) {
|
|
3626
|
-
const i =
|
|
3627
|
-
if (
|
|
3626
|
+
const i = ko(n, r, s), o = P(this, _e).cache.images.entries.get(i);
|
|
3627
|
+
if (xo(o))
|
|
3628
3628
|
return o.result;
|
|
3629
3629
|
o && P(this, _e).cache.images.entries.delete(i);
|
|
3630
3630
|
const u = P(this, _e).cache.images.pendingRequests.get(i);
|
|
3631
3631
|
if (u)
|
|
3632
3632
|
return u;
|
|
3633
|
-
const c = ve(this, ar,
|
|
3633
|
+
const c = ve(this, ar, Ls).call(this, i, n, r, s, a);
|
|
3634
3634
|
P(this, _e).cache.images.pendingRequests.set(i, c);
|
|
3635
3635
|
try {
|
|
3636
3636
|
return yield c;
|
|
@@ -3640,7 +3640,7 @@ class xo {
|
|
|
3640
3640
|
});
|
|
3641
3641
|
}
|
|
3642
3642
|
}
|
|
3643
|
-
_e = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakSet(),
|
|
3643
|
+
_e = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakSet(), Ls = function(t, e, n, r, s) {
|
|
3644
3644
|
return V(this, null, function* () {
|
|
3645
3645
|
const a = yield P(this, _e).get(
|
|
3646
3646
|
`v1/images/${e}?ids=${n}&format=${r}${s ? `&scale=${s}` : ""}`
|
|
@@ -3652,9 +3652,9 @@ _e = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakSet(), Ms = fun
|
|
|
3652
3652
|
});
|
|
3653
3653
|
};
|
|
3654
3654
|
var cn;
|
|
3655
|
-
class
|
|
3655
|
+
class So {
|
|
3656
3656
|
constructor(e) {
|
|
3657
|
-
de(this, cn), this.resourceName = "Nodes",
|
|
3657
|
+
de(this, cn), this.resourceName = "Nodes", G(this, cn, e);
|
|
3658
3658
|
}
|
|
3659
3659
|
get(e) {
|
|
3660
3660
|
return V(this, arguments, function* ({ fileKey: n, nodeIds: r, params: s = {} }) {
|
|
@@ -3669,7 +3669,7 @@ class Eo {
|
|
|
3669
3669
|
}
|
|
3670
3670
|
cn = /* @__PURE__ */ new WeakMap();
|
|
3671
3671
|
var je;
|
|
3672
|
-
class
|
|
3672
|
+
class Oo extends bo {
|
|
3673
3673
|
constructor({
|
|
3674
3674
|
baseAddress: e = "https://api.figma.com/",
|
|
3675
3675
|
fetch: n = globalThis.fetch.bind(globalThis)
|
|
@@ -3679,12 +3679,12 @@ class So extends vo {
|
|
|
3679
3679
|
entries: /* @__PURE__ */ new Map(),
|
|
3680
3680
|
pendingRequests: /* @__PURE__ */ new Map()
|
|
3681
3681
|
}
|
|
3682
|
-
}, this.files = Zn(this, new
|
|
3682
|
+
}, this.files = Zn(this, new wo(this)), this.nodes = Zn(this, new So(this)), this.images = Zn(this, new Eo(this));
|
|
3683
3683
|
}
|
|
3684
3684
|
set token(e) {
|
|
3685
3685
|
if (!e.startsWith("figd_") && !e.startsWith("figu_"))
|
|
3686
3686
|
throw new Error("Invalid Figma access token");
|
|
3687
|
-
|
|
3687
|
+
G(this, je, e);
|
|
3688
3688
|
}
|
|
3689
3689
|
get token() {
|
|
3690
3690
|
return P(this, je);
|
|
@@ -3697,10 +3697,10 @@ class So extends vo {
|
|
|
3697
3697
|
}
|
|
3698
3698
|
}
|
|
3699
3699
|
je = /* @__PURE__ */ new WeakMap();
|
|
3700
|
-
const
|
|
3700
|
+
const To = (t) => ke(void 0, [t], function* ({
|
|
3701
3701
|
fileKey: e,
|
|
3702
3702
|
authToken: n,
|
|
3703
|
-
figmaRestApi: r = new
|
|
3703
|
+
figmaRestApi: r = new Oo(),
|
|
3704
3704
|
params: s = {}
|
|
3705
3705
|
}) {
|
|
3706
3706
|
n && (r.token = n);
|
|
@@ -3713,7 +3713,7 @@ const Oo = (t) => ke(void 0, [t], function* ({
|
|
|
3713
3713
|
throw console.error(a), a;
|
|
3714
3714
|
}
|
|
3715
3715
|
});
|
|
3716
|
-
var
|
|
3716
|
+
var Ao = Object.defineProperty, Co = (t, e, n) => e in t ? Ao(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, tn = (t, e, n) => Co(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3717
3717
|
class is extends Error {
|
|
3718
3718
|
constructor(e, n) {
|
|
3719
3719
|
super(e), tn(this, "type"), tn(this, "field"), tn(this, "value"), tn(this, "line"), this.name = "ParseError", this.type = n.type, this.field = n.field, this.value = n.value, this.line = n.line;
|
|
@@ -3721,14 +3721,14 @@ class is extends Error {
|
|
|
3721
3721
|
}
|
|
3722
3722
|
function Dn(t) {
|
|
3723
3723
|
}
|
|
3724
|
-
function
|
|
3724
|
+
function No(t) {
|
|
3725
3725
|
const { onEvent: e = Dn, onError: n = Dn, onRetry: r = Dn, onComment: s } = t;
|
|
3726
3726
|
let a = "", i = !0, o, u = "", c = "";
|
|
3727
3727
|
function h(l) {
|
|
3728
|
-
const
|
|
3729
|
-
for (const
|
|
3730
|
-
p(
|
|
3731
|
-
a =
|
|
3728
|
+
const v = i ? l.replace(/^\xEF\xBB\xBF/, "") : l, [m, z] = Po(`${a}${v}`);
|
|
3729
|
+
for (const R of m)
|
|
3730
|
+
p(R);
|
|
3731
|
+
a = z, i = !1;
|
|
3732
3732
|
}
|
|
3733
3733
|
function p(l) {
|
|
3734
3734
|
if (l === "") {
|
|
@@ -3739,31 +3739,31 @@ function Co(t) {
|
|
|
3739
3739
|
s && s(l.slice(l.startsWith(": ") ? 2 : 1));
|
|
3740
3740
|
return;
|
|
3741
3741
|
}
|
|
3742
|
-
const
|
|
3743
|
-
if (
|
|
3744
|
-
const m = l.slice(0,
|
|
3745
|
-
k(m,
|
|
3742
|
+
const v = l.indexOf(":");
|
|
3743
|
+
if (v !== -1) {
|
|
3744
|
+
const m = l.slice(0, v), z = l[v + 1] === " " ? 2 : 1, R = l.slice(v + z);
|
|
3745
|
+
k(m, R, l);
|
|
3746
3746
|
return;
|
|
3747
3747
|
}
|
|
3748
3748
|
k(l, "", l);
|
|
3749
3749
|
}
|
|
3750
|
-
function k(l,
|
|
3750
|
+
function k(l, v, m) {
|
|
3751
3751
|
switch (l) {
|
|
3752
3752
|
case "event":
|
|
3753
|
-
c =
|
|
3753
|
+
c = v;
|
|
3754
3754
|
break;
|
|
3755
3755
|
case "data":
|
|
3756
|
-
u = `${u}${
|
|
3756
|
+
u = `${u}${v}
|
|
3757
3757
|
`;
|
|
3758
3758
|
break;
|
|
3759
3759
|
case "id":
|
|
3760
|
-
o =
|
|
3760
|
+
o = v.includes("\0") ? void 0 : v;
|
|
3761
3761
|
break;
|
|
3762
3762
|
case "retry":
|
|
3763
|
-
/^\d+$/.test(
|
|
3764
|
-
new is(`Invalid \`retry\` value: "${
|
|
3763
|
+
/^\d+$/.test(v) ? r(parseInt(v, 10)) : n(
|
|
3764
|
+
new is(`Invalid \`retry\` value: "${v}"`, {
|
|
3765
3765
|
type: "invalid-retry",
|
|
3766
|
-
value:
|
|
3766
|
+
value: v,
|
|
3767
3767
|
line: m
|
|
3768
3768
|
})
|
|
3769
3769
|
);
|
|
@@ -3772,7 +3772,7 @@ function Co(t) {
|
|
|
3772
3772
|
n(
|
|
3773
3773
|
new is(
|
|
3774
3774
|
`Unknown field "${l.length > 20 ? `${l.slice(0, 20)}…` : l}"`,
|
|
3775
|
-
{ type: "unknown-field", field: l, value:
|
|
3775
|
+
{ type: "unknown-field", field: l, value: v, line: m }
|
|
3776
3776
|
)
|
|
3777
3777
|
);
|
|
3778
3778
|
break;
|
|
@@ -3788,12 +3788,12 @@ function Co(t) {
|
|
|
3788
3788
|
`) ? u.slice(0, -1) : u
|
|
3789
3789
|
}), o = void 0, u = "", c = "";
|
|
3790
3790
|
}
|
|
3791
|
-
function
|
|
3791
|
+
function b(l = {}) {
|
|
3792
3792
|
a && l.consume && p(a), o = void 0, u = "", c = "", a = "";
|
|
3793
3793
|
}
|
|
3794
|
-
return { feed: h, reset:
|
|
3794
|
+
return { feed: h, reset: b };
|
|
3795
3795
|
}
|
|
3796
|
-
function
|
|
3796
|
+
function Po(t) {
|
|
3797
3797
|
const e = [];
|
|
3798
3798
|
let n = "";
|
|
3799
3799
|
const r = t.length;
|
|
@@ -3847,7 +3847,7 @@ class os extends Event {
|
|
|
3847
3847
|
return e(us(this), n);
|
|
3848
3848
|
}
|
|
3849
3849
|
}
|
|
3850
|
-
function
|
|
3850
|
+
function Ro(t) {
|
|
3851
3851
|
const e = globalThis.DOMException;
|
|
3852
3852
|
return typeof e == "function" ? new e(t, "SyntaxError") : new SyntaxError(t);
|
|
3853
3853
|
}
|
|
@@ -3864,13 +3864,13 @@ function us(t) {
|
|
|
3864
3864
|
timeStamp: t.timeStamp
|
|
3865
3865
|
};
|
|
3866
3866
|
}
|
|
3867
|
-
var
|
|
3867
|
+
var $s = (t) => {
|
|
3868
3868
|
throw TypeError(t);
|
|
3869
|
-
}, Rr = (t, e, n) => e.has(t) ||
|
|
3869
|
+
}, Rr = (t, e, n) => e.has(t) || $s("Cannot " + n), A = (t, e, n) => (Rr(t, e, "read from private field"), n ? n.call(t) : e.get(t)), U = (t, e, n) => e.has(t) ? $s("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), L = (t, e, n, r) => (Rr(t, e, "write to private field"), e.set(t, n), n), Ce = (t, e, n) => (Rr(t, e, "access private method"), n), ne, Je, ct, dn, bn, Nt, ft, Pt, Ze, dt, pt, lt, At, fe, or, ur, cr, cs, dr, lr, Ct, fr, hr;
|
|
3870
3870
|
class ln extends EventTarget {
|
|
3871
3871
|
constructor(e, n) {
|
|
3872
3872
|
var r, s;
|
|
3873
|
-
super(),
|
|
3873
|
+
super(), U(this, fe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, U(this, ne), U(this, Je), U(this, ct), U(this, dn), U(this, bn), U(this, Nt), U(this, ft), U(this, Pt, null), U(this, Ze), U(this, dt), U(this, pt, null), U(this, lt, null), U(this, At, null), U(this, ur, (a) => Be(this, null, function* () {
|
|
3874
3874
|
var i;
|
|
3875
3875
|
A(this, dt).reset();
|
|
3876
3876
|
const { body: o, redirected: u, status: c, headers: h } = a;
|
|
@@ -3878,7 +3878,7 @@ class ln extends EventTarget {
|
|
|
3878
3878
|
Ce(this, fe, Ct).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
3879
3879
|
return;
|
|
3880
3880
|
}
|
|
3881
|
-
if (u ?
|
|
3881
|
+
if (u ? L(this, ct, new URL(a.url)) : L(this, ct, void 0), c !== 200) {
|
|
3882
3882
|
Ce(this, fe, Ct).call(this, `Non-200 status code (${c})`, c);
|
|
3883
3883
|
return;
|
|
3884
3884
|
}
|
|
@@ -3888,47 +3888,47 @@ class ln extends EventTarget {
|
|
|
3888
3888
|
}
|
|
3889
3889
|
if (A(this, ne) === this.CLOSED)
|
|
3890
3890
|
return;
|
|
3891
|
-
|
|
3891
|
+
L(this, ne, this.OPEN);
|
|
3892
3892
|
const p = new Event("open");
|
|
3893
3893
|
if ((i = A(this, At)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
|
|
3894
3894
|
Ce(this, fe, Ct).call(this, "Invalid response body, expected a web ReadableStream", c), this.close();
|
|
3895
3895
|
return;
|
|
3896
3896
|
}
|
|
3897
3897
|
const k = new TextDecoder(), g = o.getReader();
|
|
3898
|
-
let
|
|
3898
|
+
let b = !0;
|
|
3899
3899
|
do {
|
|
3900
|
-
const { done: l, value:
|
|
3901
|
-
|
|
3902
|
-
} while (
|
|
3903
|
-
})),
|
|
3904
|
-
|
|
3905
|
-
}),
|
|
3906
|
-
typeof a.id == "string" &&
|
|
3900
|
+
const { done: l, value: v } = yield g.read();
|
|
3901
|
+
v && A(this, dt).feed(k.decode(v, { stream: !l })), l && (b = !1, A(this, dt).reset(), Ce(this, fe, fr).call(this));
|
|
3902
|
+
} while (b);
|
|
3903
|
+
})), U(this, cr, (a) => {
|
|
3904
|
+
L(this, Ze, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ce(this, fe, fr).call(this, ir(a));
|
|
3905
|
+
}), U(this, dr, (a) => {
|
|
3906
|
+
typeof a.id == "string" && L(this, Pt, a.id);
|
|
3907
3907
|
const i = new MessageEvent(a.event || "message", {
|
|
3908
3908
|
data: a.data,
|
|
3909
3909
|
origin: A(this, ct) ? A(this, ct).origin : A(this, Je).origin,
|
|
3910
3910
|
lastEventId: a.id || ""
|
|
3911
3911
|
});
|
|
3912
3912
|
A(this, lt) && (!a.event || a.event === "message") && A(this, lt).call(this, i), this.dispatchEvent(i);
|
|
3913
|
-
}),
|
|
3914
|
-
|
|
3915
|
-
}),
|
|
3916
|
-
|
|
3913
|
+
}), U(this, lr, (a) => {
|
|
3914
|
+
L(this, Nt, a);
|
|
3915
|
+
}), U(this, hr, () => {
|
|
3916
|
+
L(this, ft, void 0), A(this, ne) === this.CONNECTING && Ce(this, fe, or).call(this);
|
|
3917
3917
|
});
|
|
3918
3918
|
try {
|
|
3919
3919
|
if (e instanceof URL)
|
|
3920
|
-
|
|
3920
|
+
L(this, Je, e);
|
|
3921
3921
|
else if (typeof e == "string")
|
|
3922
|
-
|
|
3922
|
+
L(this, Je, new URL(e, Io()));
|
|
3923
3923
|
else
|
|
3924
3924
|
throw new Error("Invalid URL");
|
|
3925
3925
|
} catch (a) {
|
|
3926
|
-
throw
|
|
3926
|
+
throw Ro("An invalid or illegal string was specified");
|
|
3927
3927
|
}
|
|
3928
|
-
|
|
3928
|
+
L(this, dt, No({
|
|
3929
3929
|
onEvent: A(this, dr),
|
|
3930
3930
|
onRetry: A(this, lr)
|
|
3931
|
-
})),
|
|
3931
|
+
})), L(this, ne, this.CONNECTING), L(this, Nt, 3e3), L(this, bn, (r = n == null ? void 0 : n.fetch) != null ? r : globalThis.fetch), L(this, dn, (s = n == null ? void 0 : n.withCredentials) != null ? s : !1), Ce(this, fe, or).call(this);
|
|
3932
3932
|
}
|
|
3933
3933
|
/**
|
|
3934
3934
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -3966,21 +3966,21 @@ class ln extends EventTarget {
|
|
|
3966
3966
|
return A(this, pt);
|
|
3967
3967
|
}
|
|
3968
3968
|
set onerror(e) {
|
|
3969
|
-
|
|
3969
|
+
L(this, pt, e);
|
|
3970
3970
|
}
|
|
3971
3971
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3972
3972
|
get onmessage() {
|
|
3973
3973
|
return A(this, lt);
|
|
3974
3974
|
}
|
|
3975
3975
|
set onmessage(e) {
|
|
3976
|
-
|
|
3976
|
+
L(this, lt, e);
|
|
3977
3977
|
}
|
|
3978
3978
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3979
3979
|
get onopen() {
|
|
3980
3980
|
return A(this, At);
|
|
3981
3981
|
}
|
|
3982
3982
|
set onopen(e) {
|
|
3983
|
-
|
|
3983
|
+
L(this, At, e);
|
|
3984
3984
|
}
|
|
3985
3985
|
addEventListener(e, n, r) {
|
|
3986
3986
|
const s = n;
|
|
@@ -3998,7 +3998,7 @@ class ln extends EventTarget {
|
|
|
3998
3998
|
* @public
|
|
3999
3999
|
*/
|
|
4000
4000
|
close() {
|
|
4001
|
-
A(this, ft) && clearTimeout(A(this, ft)), A(this, ne) !== this.CLOSED && (A(this, Ze) && A(this, Ze).abort(),
|
|
4001
|
+
A(this, ft) && clearTimeout(A(this, ft)), A(this, ne) !== this.CLOSED && (A(this, Ze) && A(this, Ze).abort(), L(this, ne, this.CLOSED), L(this, Ze, void 0));
|
|
4002
4002
|
}
|
|
4003
4003
|
}
|
|
4004
4004
|
ne = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), dn = /* @__PURE__ */ new WeakMap(), bn = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakSet(), /**
|
|
@@ -4007,7 +4007,7 @@ ne = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ct = /*
|
|
|
4007
4007
|
* @internal
|
|
4008
4008
|
*/
|
|
4009
4009
|
or = function() {
|
|
4010
|
-
|
|
4010
|
+
L(this, ne, this.CONNECTING), L(this, Ze, new AbortController()), A(this, bn)(A(this, Je), Ce(this, fe, cs).call(this)).then(A(this, ur)).catch(A(this, cr));
|
|
4011
4011
|
}, ur = /* @__PURE__ */ new WeakMap(), cr = /* @__PURE__ */ new WeakMap(), /**
|
|
4012
4012
|
* Get request options for the `fetch()` request
|
|
4013
4013
|
*
|
|
@@ -4035,7 +4035,7 @@ cs = function() {
|
|
|
4035
4035
|
*/
|
|
4036
4036
|
Ct = function(t, e) {
|
|
4037
4037
|
var n;
|
|
4038
|
-
A(this, ne) !== this.CLOSED &&
|
|
4038
|
+
A(this, ne) !== this.CLOSED && L(this, ne, this.CLOSED);
|
|
4039
4039
|
const r = new os("error", { code: e, message: t });
|
|
4040
4040
|
(n = A(this, pt)) == null || n.call(this, r), this.dispatchEvent(r);
|
|
4041
4041
|
}, /**
|
|
@@ -4049,9 +4049,9 @@ fr = function(t, e) {
|
|
|
4049
4049
|
var n;
|
|
4050
4050
|
if (A(this, ne) === this.CLOSED)
|
|
4051
4051
|
return;
|
|
4052
|
-
|
|
4052
|
+
L(this, ne, this.CONNECTING);
|
|
4053
4053
|
const r = new os("error", { code: e, message: t });
|
|
4054
|
-
(n = A(this, pt)) == null || n.call(this, r), this.dispatchEvent(r),
|
|
4054
|
+
(n = A(this, pt)) == null || n.call(this, r), this.dispatchEvent(r), L(this, ft, setTimeout(A(this, hr), A(this, Nt)));
|
|
4055
4055
|
}, hr = /* @__PURE__ */ new WeakMap(), /**
|
|
4056
4056
|
* ReadyState representing an EventSource currently trying to connect
|
|
4057
4057
|
*
|
|
@@ -4068,11 +4068,11 @@ ln.OPEN = 1, /**
|
|
|
4068
4068
|
* @public
|
|
4069
4069
|
*/
|
|
4070
4070
|
ln.CLOSED = 2;
|
|
4071
|
-
function
|
|
4071
|
+
function Io() {
|
|
4072
4072
|
const t = "document" in globalThis ? globalThis.document : void 0;
|
|
4073
4073
|
return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
|
|
4074
4074
|
}
|
|
4075
|
-
var
|
|
4075
|
+
var Fs = Symbol.for("immer-nothing"), ds = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"), jo = process.env.NODE_ENV !== "production" ? [
|
|
4076
4076
|
// All error codes, starting by 0:
|
|
4077
4077
|
function(t) {
|
|
4078
4078
|
return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
|
|
@@ -4105,7 +4105,7 @@ var $s = Symbol.for("immer-nothing"), ds = Symbol.for("immer-draftable"), oe = S
|
|
|
4105
4105
|
] : [];
|
|
4106
4106
|
function re(t, ...e) {
|
|
4107
4107
|
if (process.env.NODE_ENV !== "production") {
|
|
4108
|
-
const n =
|
|
4108
|
+
const n = jo[t], r = typeof n == "function" ? n.apply(null, e) : n;
|
|
4109
4109
|
throw new Error(`[Immer] ${r}`);
|
|
4110
4110
|
}
|
|
4111
4111
|
throw new Error(
|
|
@@ -4118,17 +4118,17 @@ function bt(t) {
|
|
|
4118
4118
|
}
|
|
4119
4119
|
function tt(t) {
|
|
4120
4120
|
var e;
|
|
4121
|
-
return t ?
|
|
4121
|
+
return t ? Ws(t) || Array.isArray(t) || !!t[ds] || !!((e = t.constructor) != null && e[ds]) || On(t) || Tn(t) : !1;
|
|
4122
4122
|
}
|
|
4123
|
-
var
|
|
4124
|
-
function
|
|
4123
|
+
var Zo = Object.prototype.constructor.toString();
|
|
4124
|
+
function Ws(t) {
|
|
4125
4125
|
if (!t || typeof t != "object")
|
|
4126
4126
|
return !1;
|
|
4127
4127
|
const e = vt(t);
|
|
4128
4128
|
if (e === null)
|
|
4129
4129
|
return !0;
|
|
4130
4130
|
const n = Object.hasOwnProperty.call(e, "constructor") && e.constructor;
|
|
4131
|
-
return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) ===
|
|
4131
|
+
return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === Zo;
|
|
4132
4132
|
}
|
|
4133
4133
|
function wn(t, e) {
|
|
4134
4134
|
Sn(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
|
|
@@ -4142,11 +4142,11 @@ function Sn(t) {
|
|
|
4142
4142
|
function pr(t, e) {
|
|
4143
4143
|
return Sn(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
4144
4144
|
}
|
|
4145
|
-
function
|
|
4145
|
+
function zs(t, e, n) {
|
|
4146
4146
|
const r = Sn(t);
|
|
4147
4147
|
r === 2 ? t.set(e, n) : r === 3 ? t.add(n) : t[e] = n;
|
|
4148
4148
|
}
|
|
4149
|
-
function
|
|
4149
|
+
function Do(t, e) {
|
|
4150
4150
|
return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
|
|
4151
4151
|
}
|
|
4152
4152
|
function On(t) {
|
|
@@ -4165,7 +4165,7 @@ function mr(t, e) {
|
|
|
4165
4165
|
return new Set(t);
|
|
4166
4166
|
if (Array.isArray(t))
|
|
4167
4167
|
return Array.prototype.slice.call(t);
|
|
4168
|
-
const n =
|
|
4168
|
+
const n = Ws(t);
|
|
4169
4169
|
if (e === !0 || e === "class_only" && !n) {
|
|
4170
4170
|
const r = Object.getOwnPropertyDescriptors(t);
|
|
4171
4171
|
delete r[oe];
|
|
@@ -4190,24 +4190,24 @@ function mr(t, e) {
|
|
|
4190
4190
|
}
|
|
4191
4191
|
}
|
|
4192
4192
|
function Bt(t, e = !1) {
|
|
4193
|
-
return An(t) || bt(t) || !tt(t) || (Sn(t) > 1 && (t.set = t.add = t.clear = t.delete =
|
|
4193
|
+
return An(t) || bt(t) || !tt(t) || (Sn(t) > 1 && (t.set = t.add = t.clear = t.delete = Mo), Object.freeze(t), e && Object.entries(t).forEach(([n, r]) => Bt(r, !0))), t;
|
|
4194
4194
|
}
|
|
4195
|
-
function
|
|
4195
|
+
function Mo() {
|
|
4196
4196
|
re(2);
|
|
4197
4197
|
}
|
|
4198
4198
|
function An(t) {
|
|
4199
4199
|
return Object.isFrozen(t);
|
|
4200
4200
|
}
|
|
4201
|
-
var
|
|
4201
|
+
var Lo = {};
|
|
4202
4202
|
function nt(t) {
|
|
4203
|
-
const e =
|
|
4203
|
+
const e = Lo[t];
|
|
4204
4204
|
return e || re(0, t), e;
|
|
4205
4205
|
}
|
|
4206
4206
|
var qt;
|
|
4207
|
-
function
|
|
4207
|
+
function Vs() {
|
|
4208
4208
|
return qt;
|
|
4209
4209
|
}
|
|
4210
|
-
function
|
|
4210
|
+
function $o(t, e) {
|
|
4211
4211
|
return {
|
|
4212
4212
|
drafts_: [],
|
|
4213
4213
|
parent_: t,
|
|
@@ -4222,15 +4222,15 @@ function ls(t, e) {
|
|
|
4222
4222
|
e && (nt("Patches"), t.patches_ = [], t.inversePatches_ = [], t.patchListener_ = e);
|
|
4223
4223
|
}
|
|
4224
4224
|
function yr(t) {
|
|
4225
|
-
gr(t), t.drafts_.forEach(
|
|
4225
|
+
gr(t), t.drafts_.forEach(Fo), t.drafts_ = null;
|
|
4226
4226
|
}
|
|
4227
4227
|
function gr(t) {
|
|
4228
4228
|
t === qt && (qt = t.parent_);
|
|
4229
4229
|
}
|
|
4230
4230
|
function fs(t) {
|
|
4231
|
-
return qt =
|
|
4231
|
+
return qt = $o(qt, t);
|
|
4232
4232
|
}
|
|
4233
|
-
function
|
|
4233
|
+
function Fo(t) {
|
|
4234
4234
|
const e = t[oe];
|
|
4235
4235
|
e.type_ === 0 || e.type_ === 1 ? e.revoke_() : e.revoked_ = !0;
|
|
4236
4236
|
}
|
|
@@ -4242,7 +4242,7 @@ function hs(t, e) {
|
|
|
4242
4242
|
t,
|
|
4243
4243
|
e.patches_,
|
|
4244
4244
|
e.inversePatches_
|
|
4245
|
-
)) : t = kn(e, n, []), yr(e), e.patches_ && e.patchListener_(e.patches_, e.inversePatches_), t !==
|
|
4245
|
+
)) : t = kn(e, n, []), yr(e), e.patches_ && e.patchListener_(e.patches_, e.inversePatches_), t !== Fs ? t : void 0;
|
|
4246
4246
|
}
|
|
4247
4247
|
function kn(t, e, n) {
|
|
4248
4248
|
if (An(e))
|
|
@@ -4277,7 +4277,7 @@ function ps(t, e, n, r, s, a, i) {
|
|
|
4277
4277
|
if (process.env.NODE_ENV !== "production" && s === n && re(5), bt(s)) {
|
|
4278
4278
|
const o = a && e && e.type_ !== 3 && // Set objects are atomic since they have no keys.
|
|
4279
4279
|
!pr(e.assigned_, r) ? a.concat(r) : void 0, u = kn(t, s, o);
|
|
4280
|
-
if (
|
|
4280
|
+
if (zs(n, r, u), bt(u))
|
|
4281
4281
|
t.canAutoFreeze_ = !1;
|
|
4282
4282
|
else
|
|
4283
4283
|
return;
|
|
@@ -4291,11 +4291,11 @@ function ps(t, e, n, r, s, a, i) {
|
|
|
4291
4291
|
function xn(t, e, n = !1) {
|
|
4292
4292
|
!t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && Bt(e, n);
|
|
4293
4293
|
}
|
|
4294
|
-
function
|
|
4294
|
+
function Wo(t, e) {
|
|
4295
4295
|
const n = Array.isArray(t), r = {
|
|
4296
4296
|
type_: n ? 1 : 0,
|
|
4297
4297
|
// Track which produce call this is associated with.
|
|
4298
|
-
scope_: e ? e.scope_ :
|
|
4298
|
+
scope_: e ? e.scope_ : Vs(),
|
|
4299
4299
|
// True for both shallow and deep changes.
|
|
4300
4300
|
modified_: !1,
|
|
4301
4301
|
// Used during finalization.
|
|
@@ -4326,7 +4326,7 @@ var Ir = {
|
|
|
4326
4326
|
return t;
|
|
4327
4327
|
const n = Ke(t);
|
|
4328
4328
|
if (!pr(n, e))
|
|
4329
|
-
return
|
|
4329
|
+
return zo(t, n, e);
|
|
4330
4330
|
const r = n[e];
|
|
4331
4331
|
return t.finalized_ || !tt(r) ? r : r === Mn(t.base_, e) ? (Ln(t), t.copy_[e] = vr(r, t)) : r;
|
|
4332
4332
|
},
|
|
@@ -4337,14 +4337,14 @@ var Ir = {
|
|
|
4337
4337
|
return Reflect.ownKeys(Ke(t));
|
|
4338
4338
|
},
|
|
4339
4339
|
set(t, e, n) {
|
|
4340
|
-
const r =
|
|
4340
|
+
const r = Us(Ke(t), e);
|
|
4341
4341
|
if (r != null && r.set)
|
|
4342
4342
|
return r.set.call(t.draft_, n), !0;
|
|
4343
4343
|
if (!t.modified_) {
|
|
4344
4344
|
const s = Mn(Ke(t), e), a = s == null ? void 0 : s[oe];
|
|
4345
4345
|
if (a && a.base_ === n)
|
|
4346
4346
|
return t.copy_[e] = n, t.assigned_[e] = !1, !0;
|
|
4347
|
-
if (
|
|
4347
|
+
if (Do(n, s) && (n !== void 0 || pr(t.base_, e)))
|
|
4348
4348
|
return !0;
|
|
4349
4349
|
Ln(t), _r(t);
|
|
4350
4350
|
}
|
|
@@ -4391,16 +4391,16 @@ function Mn(t, e) {
|
|
|
4391
4391
|
const n = t[oe];
|
|
4392
4392
|
return (n ? Ke(n) : t)[e];
|
|
4393
4393
|
}
|
|
4394
|
-
function
|
|
4394
|
+
function zo(t, e, n) {
|
|
4395
4395
|
var s;
|
|
4396
|
-
const r =
|
|
4396
|
+
const r = Us(e, n);
|
|
4397
4397
|
return r ? "value" in r ? r.value : (
|
|
4398
4398
|
// This is a very special case, if the prop is a getter defined by the
|
|
4399
4399
|
// prototype, we should invoke it with the draft as context!
|
|
4400
4400
|
(s = r.get) == null ? void 0 : s.call(t.draft_)
|
|
4401
4401
|
) : void 0;
|
|
4402
4402
|
}
|
|
4403
|
-
function
|
|
4403
|
+
function Us(t, e) {
|
|
4404
4404
|
if (!(e in t))
|
|
4405
4405
|
return;
|
|
4406
4406
|
let n = vt(t);
|
|
@@ -4420,7 +4420,7 @@ function Ln(t) {
|
|
|
4420
4420
|
t.scope_.immer_.useStrictShallowCopy_
|
|
4421
4421
|
));
|
|
4422
4422
|
}
|
|
4423
|
-
var
|
|
4423
|
+
var Vo = class {
|
|
4424
4424
|
constructor(t) {
|
|
4425
4425
|
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (e, n, r) => {
|
|
4426
4426
|
if (typeof e == "function" && typeof n != "function") {
|
|
@@ -4443,7 +4443,7 @@ var zo = class {
|
|
|
4443
4443
|
}
|
|
4444
4444
|
return ls(a, r), hs(s, a);
|
|
4445
4445
|
} else if (!e || typeof e != "object") {
|
|
4446
|
-
if (s = n(e), s === void 0 && (s = e), s ===
|
|
4446
|
+
if (s = n(e), s === void 0 && (s = e), s === Fs && (s = void 0), this.autoFreeze_ && Bt(s, !0), r) {
|
|
4447
4447
|
const a = [], i = [];
|
|
4448
4448
|
nt("Patches").generateReplacementPatches_(e, s, a, i), r(a, i);
|
|
4449
4449
|
}
|
|
@@ -4460,7 +4460,7 @@ var zo = class {
|
|
|
4460
4460
|
}, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
|
|
4461
4461
|
}
|
|
4462
4462
|
createDraft(t) {
|
|
4463
|
-
tt(t) || re(8), bt(t) && (t =
|
|
4463
|
+
tt(t) || re(8), bt(t) && (t = Uo(t));
|
|
4464
4464
|
const e = fs(this), n = vr(t, void 0);
|
|
4465
4465
|
return n[oe].isManual_ = !0, gr(e), n;
|
|
4466
4466
|
}
|
|
@@ -4504,13 +4504,13 @@ var zo = class {
|
|
|
4504
4504
|
}
|
|
4505
4505
|
};
|
|
4506
4506
|
function vr(t, e) {
|
|
4507
|
-
const n = On(t) ? nt("MapSet").proxyMap_(t, e) : Tn(t) ? nt("MapSet").proxySet_(t, e) :
|
|
4508
|
-
return (e ? e.scope_ :
|
|
4507
|
+
const n = On(t) ? nt("MapSet").proxyMap_(t, e) : Tn(t) ? nt("MapSet").proxySet_(t, e) : Wo(t, e);
|
|
4508
|
+
return (e ? e.scope_ : Vs()).drafts_.push(n), n;
|
|
4509
4509
|
}
|
|
4510
|
-
function
|
|
4511
|
-
return bt(t) || re(10, t),
|
|
4510
|
+
function Uo(t) {
|
|
4511
|
+
return bt(t) || re(10, t), Bs(t);
|
|
4512
4512
|
}
|
|
4513
|
-
function
|
|
4513
|
+
function Bs(t) {
|
|
4514
4514
|
if (!tt(t) || An(t))
|
|
4515
4515
|
return t;
|
|
4516
4516
|
const e = t[oe];
|
|
@@ -4522,10 +4522,10 @@ function Us(t) {
|
|
|
4522
4522
|
} else
|
|
4523
4523
|
n = mr(t, !0);
|
|
4524
4524
|
return wn(n, (r, s) => {
|
|
4525
|
-
|
|
4525
|
+
zs(n, r, Bs(s));
|
|
4526
4526
|
}), e && (e.finalized_ = !1), n;
|
|
4527
4527
|
}
|
|
4528
|
-
var ue = new
|
|
4528
|
+
var ue = new Vo(), Bo = ue.produce;
|
|
4529
4529
|
ue.produceWithPatches.bind(
|
|
4530
4530
|
ue
|
|
4531
4531
|
);
|
|
@@ -4534,12 +4534,12 @@ ue.setUseStrictShallowCopy.bind(ue);
|
|
|
4534
4534
|
ue.applyPatches.bind(ue);
|
|
4535
4535
|
ue.createDraft.bind(ue);
|
|
4536
4536
|
ue.finishDraft.bind(ue);
|
|
4537
|
-
function
|
|
4538
|
-
var e =
|
|
4537
|
+
function qo(t) {
|
|
4538
|
+
var e = ca(function() {
|
|
4539
4539
|
return Bt(typeof t == "function" ? t() : t, !0);
|
|
4540
4540
|
}), n = e[1];
|
|
4541
4541
|
return [e[0], an(function(r) {
|
|
4542
|
-
n(typeof r == "function" ?
|
|
4542
|
+
n(typeof r == "function" ? Bo(r) : Bt(r));
|
|
4543
4543
|
}, [])];
|
|
4544
4544
|
}
|
|
4545
4545
|
const ms = {
|
|
@@ -4551,11 +4551,18 @@ const ms = {
|
|
|
4551
4551
|
codeGeneration: { status: "pending", progress: 0 },
|
|
4552
4552
|
uploadAssets: { status: "pending" }
|
|
4553
4553
|
}
|
|
4554
|
-
},
|
|
4554
|
+
}, ys = (t) => "path" in t ? {
|
|
4555
|
+
filePath: t.path.replace(/^\//, ""),
|
|
4556
|
+
referencePath: t.path === "/" ? "" : t.path
|
|
4557
|
+
// Workaround to avoid duplicated slashes in the URL. Ideally, the fix should be done in Codegen.
|
|
4558
|
+
} : {
|
|
4559
|
+
filePath: t.filePath.replace(/^\//, ""),
|
|
4560
|
+
referencePath: t.referencePath === "/" ? "" : t.referencePath
|
|
4561
|
+
}, Cu = ({
|
|
4555
4562
|
url: t,
|
|
4556
4563
|
method: e = "POST"
|
|
4557
4564
|
}) => {
|
|
4558
|
-
const [n, r] =
|
|
4565
|
+
const [n, r] = qo(ms);
|
|
4559
4566
|
return {
|
|
4560
4567
|
getCode: (a) => Be(void 0, null, function* () {
|
|
4561
4568
|
var c, h, p, k;
|
|
@@ -4563,20 +4570,25 @@ const ms = {
|
|
|
4563
4570
|
g.status = "pending", g.error = null, g.result = null, g.tasks = ms.tasks;
|
|
4564
4571
|
});
|
|
4565
4572
|
const i = structuredClone(a);
|
|
4566
|
-
((c = a.assetsStorage) == null ? void 0 : c.strategy) === "local"
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4573
|
+
if (((c = a.assetsStorage) == null ? void 0 : c.strategy) === "local") {
|
|
4574
|
+
const { referencePath: g } = ys(
|
|
4575
|
+
a.assetsStorage
|
|
4576
|
+
);
|
|
4577
|
+
a.assetsStorage = {
|
|
4578
|
+
strategy: "external",
|
|
4579
|
+
url: g
|
|
4580
|
+
};
|
|
4581
|
+
}
|
|
4570
4582
|
const o = new ln(t, {
|
|
4571
|
-
fetch: (g,
|
|
4583
|
+
fetch: (g, b) => fetch(g, Kr(Ue({}, b), {
|
|
4572
4584
|
method: e,
|
|
4573
4585
|
body: JSON.stringify(a)
|
|
4574
4586
|
}))
|
|
4575
4587
|
}), u = new Promise((g) => {
|
|
4576
|
-
const
|
|
4588
|
+
const b = {};
|
|
4577
4589
|
o.addEventListener("start", (l) => {
|
|
4578
|
-
const
|
|
4579
|
-
|
|
4590
|
+
const v = JSON.parse(l.data);
|
|
4591
|
+
b.sessionId = v.sessionId, r((m) => {
|
|
4580
4592
|
m.tasks.fetchDesign.status = "running";
|
|
4581
4593
|
});
|
|
4582
4594
|
}), o.addEventListener("pre_codegen", (l) => {
|
|
@@ -4586,10 +4598,10 @@ const ms = {
|
|
|
4586
4598
|
m.tasks.fetchDesign.status = "finished", m.tasks.codeGeneration.status = "running", m.tasks.uploadAssets.status = "running";
|
|
4587
4599
|
});
|
|
4588
4600
|
}), o.addEventListener("figma_metadata", (l) => {
|
|
4589
|
-
const
|
|
4601
|
+
const v = JSON.parse(
|
|
4590
4602
|
l.data
|
|
4591
4603
|
);
|
|
4592
|
-
|
|
4604
|
+
b.figmaFileName = v.figmaFileName, b.figmaSelectedFrameName = v.figmaSelectedFrameName;
|
|
4593
4605
|
}), o.addEventListener("aborted", () => {
|
|
4594
4606
|
r((l) => {
|
|
4595
4607
|
l.status = "aborted";
|
|
@@ -4598,15 +4610,15 @@ const ms = {
|
|
|
4598
4610
|
error: new Error("The request was aborted")
|
|
4599
4611
|
});
|
|
4600
4612
|
}), o.addEventListener("generating_code", (l) => {
|
|
4601
|
-
const
|
|
4613
|
+
const v = JSON.parse(
|
|
4602
4614
|
l.data
|
|
4603
4615
|
);
|
|
4604
|
-
if (
|
|
4605
|
-
const m =
|
|
4606
|
-
|
|
4616
|
+
if (v.payload.status === "success") {
|
|
4617
|
+
const m = v.payload.files;
|
|
4618
|
+
b.files = ka(m);
|
|
4607
4619
|
}
|
|
4608
4620
|
r((m) => {
|
|
4609
|
-
m.tasks.codeGeneration.progress =
|
|
4621
|
+
m.tasks.codeGeneration.progress = v.payload.progress;
|
|
4610
4622
|
});
|
|
4611
4623
|
}), o.addEventListener("codegen_completed", () => {
|
|
4612
4624
|
r((l) => {
|
|
@@ -4617,59 +4629,63 @@ const ms = {
|
|
|
4617
4629
|
l.tasks.uploadAssets.status = "finished";
|
|
4618
4630
|
});
|
|
4619
4631
|
}), o.addEventListener("assets_list", (l) => {
|
|
4620
|
-
const
|
|
4632
|
+
const v = JSON.parse(
|
|
4621
4633
|
l.data
|
|
4622
4634
|
);
|
|
4623
|
-
|
|
4635
|
+
b.assets = v.payload.assets;
|
|
4624
4636
|
}), o.addEventListener("error", (l) => {
|
|
4625
4637
|
if (l instanceof MessageEvent) {
|
|
4626
|
-
const
|
|
4638
|
+
const v = JSON.parse(
|
|
4627
4639
|
l.data
|
|
4628
4640
|
);
|
|
4629
4641
|
r((m) => {
|
|
4630
|
-
m.status = "error", m.error = new Error(
|
|
4642
|
+
m.status = "error", m.error = new Error(v.payload.message);
|
|
4631
4643
|
}), g({
|
|
4632
4644
|
result: null,
|
|
4633
|
-
error: new Error(
|
|
4645
|
+
error: new Error(v.payload.message)
|
|
4634
4646
|
});
|
|
4635
4647
|
} else
|
|
4636
|
-
console.error("EventSource error:", l), r((
|
|
4637
|
-
|
|
4648
|
+
console.error("EventSource error:", l), r((v) => {
|
|
4649
|
+
v.status = "error", v.error = new Error("HTTP error: " + l.message);
|
|
4638
4650
|
}), g({
|
|
4639
4651
|
result: null,
|
|
4640
4652
|
error: new Error("HTTP error: " + l.message)
|
|
4641
4653
|
});
|
|
4642
4654
|
}), o.addEventListener("done", () => {
|
|
4643
4655
|
r((l) => {
|
|
4644
|
-
l.status = "success", l.result =
|
|
4645
|
-
}), g({ result:
|
|
4656
|
+
l.status = "success", l.result = b;
|
|
4657
|
+
}), g({ result: b, error: null });
|
|
4646
4658
|
});
|
|
4647
4659
|
});
|
|
4648
4660
|
try {
|
|
4649
|
-
const { result: g, error:
|
|
4661
|
+
const { result: g, error: b } = yield u, l = structuredClone(g);
|
|
4650
4662
|
if (((h = i.assetsStorage) == null ? void 0 : h.strategy) === "local" && ((p = l == null ? void 0 : l.assets) != null && p.length)) {
|
|
4651
|
-
const
|
|
4652
|
-
|
|
4663
|
+
const { filePath: v } = ys(
|
|
4664
|
+
i.assetsStorage
|
|
4665
|
+
), m = l.assets.map((R) => Be(void 0, null, function* () {
|
|
4666
|
+
const D = yield (yield fetch(R.url)).arrayBuffer();
|
|
4653
4667
|
return {
|
|
4654
|
-
assetName:
|
|
4655
|
-
base64:
|
|
4668
|
+
assetName: R.name,
|
|
4669
|
+
base64: ya(D)
|
|
4656
4670
|
};
|
|
4657
|
-
})),
|
|
4658
|
-
for (const
|
|
4659
|
-
const
|
|
4660
|
-
if (
|
|
4661
|
-
const { assetName:
|
|
4662
|
-
|
|
4663
|
-
|
|
4671
|
+
})), z = yield Promise.allSettled(m);
|
|
4672
|
+
for (const R of z) {
|
|
4673
|
+
const q = {};
|
|
4674
|
+
if (R.status === "fulfilled") {
|
|
4675
|
+
const { assetName: D, base64: B } = R.value;
|
|
4676
|
+
q[D] = B;
|
|
4677
|
+
const I = v ? `${v}/${D}` : D;
|
|
4678
|
+
l.files[I] = {
|
|
4679
|
+
content: B,
|
|
4664
4680
|
isBinary: !0
|
|
4665
4681
|
};
|
|
4666
4682
|
}
|
|
4667
4683
|
}
|
|
4668
4684
|
}
|
|
4669
|
-
return
|
|
4685
|
+
return b ? { result: null, error: b } : Object.keys((k = l == null ? void 0 : l.files) != null ? k : {}).length === 0 ? {
|
|
4670
4686
|
result: null,
|
|
4671
4687
|
error: new Error("No files received")
|
|
4672
|
-
} : { result: l, error:
|
|
4688
|
+
} : { result: l, error: b };
|
|
4673
4689
|
} finally {
|
|
4674
4690
|
o.close();
|
|
4675
4691
|
}
|
|
@@ -4690,26 +4706,26 @@ var nn = { exports: {} }, $n = {};
|
|
|
4690
4706
|
* This source code is licensed under the MIT license found in the
|
|
4691
4707
|
* LICENSE file in the root directory of this source tree.
|
|
4692
4708
|
*/
|
|
4693
|
-
var
|
|
4694
|
-
function
|
|
4695
|
-
if (
|
|
4696
|
-
|
|
4709
|
+
var gs;
|
|
4710
|
+
function Ko() {
|
|
4711
|
+
if (gs) return $n;
|
|
4712
|
+
gs = 1;
|
|
4697
4713
|
var t = Gt;
|
|
4698
4714
|
function e(p, k) {
|
|
4699
4715
|
return p === k && (p !== 0 || 1 / p === 1 / k) || p !== p && k !== k;
|
|
4700
4716
|
}
|
|
4701
4717
|
var n = typeof Object.is == "function" ? Object.is : e, r = t.useState, s = t.useEffect, a = t.useLayoutEffect, i = t.useDebugValue;
|
|
4702
4718
|
function o(p, k) {
|
|
4703
|
-
var g = k(),
|
|
4719
|
+
var g = k(), b = r({ inst: { value: g, getSnapshot: k } }), l = b[0].inst, v = b[1];
|
|
4704
4720
|
return a(
|
|
4705
4721
|
function() {
|
|
4706
|
-
l.value = g, l.getSnapshot = k, u(l) &&
|
|
4722
|
+
l.value = g, l.getSnapshot = k, u(l) && v({ inst: l });
|
|
4707
4723
|
},
|
|
4708
4724
|
[p, g, k]
|
|
4709
4725
|
), s(
|
|
4710
4726
|
function() {
|
|
4711
|
-
return u(l) &&
|
|
4712
|
-
u(l) &&
|
|
4727
|
+
return u(l) && v({ inst: l }), p(function() {
|
|
4728
|
+
u(l) && v({ inst: l });
|
|
4713
4729
|
});
|
|
4714
4730
|
},
|
|
4715
4731
|
[p]
|
|
@@ -4721,7 +4737,7 @@ function qo() {
|
|
|
4721
4737
|
try {
|
|
4722
4738
|
var g = k();
|
|
4723
4739
|
return !n(p, g);
|
|
4724
|
-
} catch (
|
|
4740
|
+
} catch (b) {
|
|
4725
4741
|
return !0;
|
|
4726
4742
|
}
|
|
4727
4743
|
}
|
|
@@ -4741,66 +4757,66 @@ var Fn = {};
|
|
|
4741
4757
|
* This source code is licensed under the MIT license found in the
|
|
4742
4758
|
* LICENSE file in the root directory of this source tree.
|
|
4743
4759
|
*/
|
|
4744
|
-
var
|
|
4745
|
-
function
|
|
4746
|
-
return
|
|
4747
|
-
function t(g,
|
|
4748
|
-
return g ===
|
|
4760
|
+
var _s;
|
|
4761
|
+
function Ho() {
|
|
4762
|
+
return _s || (_s = 1, process.env.NODE_ENV !== "production" && function() {
|
|
4763
|
+
function t(g, b) {
|
|
4764
|
+
return g === b && (g !== 0 || 1 / g === 1 / b) || g !== g && b !== b;
|
|
4749
4765
|
}
|
|
4750
|
-
function e(g,
|
|
4766
|
+
function e(g, b) {
|
|
4751
4767
|
h || s.startTransition === void 0 || (h = !0, console.error(
|
|
4752
4768
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
4753
4769
|
));
|
|
4754
|
-
var l =
|
|
4770
|
+
var l = b();
|
|
4755
4771
|
if (!p) {
|
|
4756
|
-
var
|
|
4757
|
-
a(l,
|
|
4772
|
+
var v = b();
|
|
4773
|
+
a(l, v) || (console.error(
|
|
4758
4774
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
4759
4775
|
), p = !0);
|
|
4760
4776
|
}
|
|
4761
|
-
|
|
4762
|
-
inst: { value: l, getSnapshot:
|
|
4777
|
+
v = i({
|
|
4778
|
+
inst: { value: l, getSnapshot: b }
|
|
4763
4779
|
});
|
|
4764
|
-
var m =
|
|
4780
|
+
var m = v[0].inst, z = v[1];
|
|
4765
4781
|
return u(
|
|
4766
4782
|
function() {
|
|
4767
|
-
m.value = l, m.getSnapshot =
|
|
4783
|
+
m.value = l, m.getSnapshot = b, n(m) && z({ inst: m });
|
|
4768
4784
|
},
|
|
4769
|
-
[g, l,
|
|
4785
|
+
[g, l, b]
|
|
4770
4786
|
), o(
|
|
4771
4787
|
function() {
|
|
4772
|
-
return n(m) &&
|
|
4773
|
-
n(m) &&
|
|
4788
|
+
return n(m) && z({ inst: m }), g(function() {
|
|
4789
|
+
n(m) && z({ inst: m });
|
|
4774
4790
|
});
|
|
4775
4791
|
},
|
|
4776
4792
|
[g]
|
|
4777
4793
|
), c(l), l;
|
|
4778
4794
|
}
|
|
4779
4795
|
function n(g) {
|
|
4780
|
-
var
|
|
4796
|
+
var b = g.getSnapshot;
|
|
4781
4797
|
g = g.value;
|
|
4782
4798
|
try {
|
|
4783
|
-
var l =
|
|
4799
|
+
var l = b();
|
|
4784
4800
|
return !a(g, l);
|
|
4785
|
-
} catch (
|
|
4801
|
+
} catch (v) {
|
|
4786
4802
|
return !0;
|
|
4787
4803
|
}
|
|
4788
4804
|
}
|
|
4789
|
-
function r(g,
|
|
4790
|
-
return
|
|
4805
|
+
function r(g, b) {
|
|
4806
|
+
return b();
|
|
4791
4807
|
}
|
|
4792
4808
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ != "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
4793
4809
|
var s = Gt, a = typeof Object.is == "function" ? Object.is : t, i = s.useState, o = s.useEffect, u = s.useLayoutEffect, c = s.useDebugValue, h = !1, p = !1, k = typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined" ? r : e;
|
|
4794
4810
|
Fn.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : k, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ != "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
4795
4811
|
}()), Fn;
|
|
4796
4812
|
}
|
|
4797
|
-
var
|
|
4798
|
-
function
|
|
4799
|
-
return
|
|
4813
|
+
var vs;
|
|
4814
|
+
function Go() {
|
|
4815
|
+
return vs || (vs = 1, process.env.NODE_ENV === "production" ? nn.exports = Ko() : nn.exports = Ho()), nn.exports;
|
|
4800
4816
|
}
|
|
4801
|
-
var
|
|
4802
|
-
const
|
|
4803
|
-
var
|
|
4817
|
+
var Jo = Go();
|
|
4818
|
+
const qs = 0, Ks = 1, Hs = 2, bs = 3;
|
|
4819
|
+
var ws = Object.prototype.hasOwnProperty;
|
|
4804
4820
|
function br(t, e) {
|
|
4805
4821
|
var n, r;
|
|
4806
4822
|
if (t === e) return !0;
|
|
@@ -4815,7 +4831,7 @@ function br(t, e) {
|
|
|
4815
4831
|
if (!n || typeof t == "object") {
|
|
4816
4832
|
r = 0;
|
|
4817
4833
|
for (n in t)
|
|
4818
|
-
if (
|
|
4834
|
+
if (ws.call(t, n) && ++r && !ws.call(e, n) || !(n in e) || !br(t[n], e[n])) return !1;
|
|
4819
4835
|
return Object.keys(e).length === r;
|
|
4820
4836
|
}
|
|
4821
4837
|
}
|
|
@@ -4825,7 +4841,7 @@ const Pe = /* @__PURE__ */ new WeakMap(), De = () => {
|
|
|
4825
4841
|
}, Q = (
|
|
4826
4842
|
/*#__NOINLINE__*/
|
|
4827
4843
|
De()
|
|
4828
|
-
), wr = Object, N = (t) => t === Q, be = (t) => typeof t == "function", We = (t, e) => Ue(Ue({}, t), e),
|
|
4844
|
+
), wr = Object, N = (t) => t === Q, be = (t) => typeof t == "function", We = (t, e) => Ue(Ue({}, t), e), Gs = (t) => be(t.then), Wn = {}, rn = {}, jr = "undefined", Xt = typeof window != jr, kr = typeof document != jr, Xo = Xt && "Deno" in window, Yo = () => Xt && typeof window.requestAnimationFrame != jr, Js = (t, e) => {
|
|
4829
4845
|
const n = Pe.get(t);
|
|
4830
4846
|
return [
|
|
4831
4847
|
// Getter
|
|
@@ -4844,18 +4860,18 @@ const Pe = /* @__PURE__ */ new WeakMap(), De = () => {
|
|
|
4844
4860
|
];
|
|
4845
4861
|
};
|
|
4846
4862
|
let xr = !0;
|
|
4847
|
-
const
|
|
4863
|
+
const Qo = () => xr, [Er, Sr] = Xt && window.addEventListener ? [
|
|
4848
4864
|
window.addEventListener.bind(window),
|
|
4849
4865
|
window.removeEventListener.bind(window)
|
|
4850
4866
|
] : [
|
|
4851
4867
|
De,
|
|
4852
4868
|
De
|
|
4853
|
-
],
|
|
4869
|
+
], eu = () => {
|
|
4854
4870
|
const t = kr && document.visibilityState;
|
|
4855
4871
|
return N(t) || t !== "hidden";
|
|
4856
|
-
},
|
|
4872
|
+
}, tu = (t) => (kr && document.addEventListener("visibilitychange", t), Er("focus", t), () => {
|
|
4857
4873
|
kr && document.removeEventListener("visibilitychange", t), Sr("focus", t);
|
|
4858
|
-
}),
|
|
4874
|
+
}), nu = (t) => {
|
|
4859
4875
|
const e = () => {
|
|
4860
4876
|
xr = !0, t();
|
|
4861
4877
|
}, n = () => {
|
|
@@ -4864,23 +4880,23 @@ const Yo = () => xr, [Er, Sr] = Xt && window.addEventListener ? [
|
|
|
4864
4880
|
return Er("online", e), Er("offline", n), () => {
|
|
4865
4881
|
Sr("online", e), Sr("offline", n);
|
|
4866
4882
|
};
|
|
4867
|
-
}, nu = {
|
|
4868
|
-
isOnline: Yo,
|
|
4869
|
-
isVisible: Qo
|
|
4870
4883
|
}, ru = {
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
},
|
|
4884
|
+
isOnline: Qo,
|
|
4885
|
+
isVisible: eu
|
|
4886
|
+
}, su = {
|
|
4887
|
+
initFocus: tu,
|
|
4888
|
+
initReconnect: nu
|
|
4889
|
+
}, ks = !Gt.useId, Ht = !Xt || Xo, au = (t) => Yo() ? window.requestAnimationFrame(t) : setTimeout(t, 1), zn = Ht ? la : fa, Vn = typeof navigator != "undefined" && navigator.connection, xs = !Ht && Vn && ([
|
|
4874
4890
|
"slow-2g",
|
|
4875
4891
|
"2g"
|
|
4876
4892
|
].includes(Vn.effectiveType) || Vn.saveData), sn = /* @__PURE__ */ new WeakMap(), Un = (t, e) => wr.prototype.toString.call(t) === `[object ${e}]`;
|
|
4877
|
-
let
|
|
4893
|
+
let iu = 0;
|
|
4878
4894
|
const Or = (t) => {
|
|
4879
4895
|
const e = typeof t, n = Un(t, "Date"), r = Un(t, "RegExp"), s = Un(t, "Object");
|
|
4880
4896
|
let a, i;
|
|
4881
4897
|
if (wr(t) === t && !n && !r) {
|
|
4882
4898
|
if (a = sn.get(t), a) return a;
|
|
4883
|
-
if (a = ++
|
|
4899
|
+
if (a = ++iu + "~", sn.set(t, a), Array.isArray(t)) {
|
|
4884
4900
|
for (a = "@", i = 0; i < t.length; i++)
|
|
4885
4901
|
a += Or(t[i]) + ",";
|
|
4886
4902
|
sn.set(t, a);
|
|
@@ -4908,9 +4924,9 @@ const Or = (t) => {
|
|
|
4908
4924
|
e
|
|
4909
4925
|
];
|
|
4910
4926
|
};
|
|
4911
|
-
let
|
|
4912
|
-
const Tr = () => ++
|
|
4913
|
-
function
|
|
4927
|
+
let ou = 0;
|
|
4928
|
+
const Tr = () => ++ou;
|
|
4929
|
+
function Xs(...t) {
|
|
4914
4930
|
return Be(this, null, function* () {
|
|
4915
4931
|
const [e, n, r, s] = t, a = We({
|
|
4916
4932
|
populateCache: !0,
|
|
@@ -4923,8 +4939,8 @@ function Js(...t) {
|
|
|
4923
4939
|
let u = a.optimisticData;
|
|
4924
4940
|
const c = (k) => typeof o == "function" ? o(k) : o !== !1, h = a.throwOnError;
|
|
4925
4941
|
if (be(n)) {
|
|
4926
|
-
const k = n, g = [],
|
|
4927
|
-
for (const l of
|
|
4942
|
+
const k = n, g = [], b = e.keys();
|
|
4943
|
+
for (const l of b)
|
|
4928
4944
|
// Skip the special useSWRInfinite and useSWRSubscription keys.
|
|
4929
4945
|
!/^\$(inf|sub)\$/.test(l) && k(e.get(l)._k) && g.push(l);
|
|
4930
4946
|
return Promise.all(g.map(p));
|
|
@@ -4934,41 +4950,41 @@ function Js(...t) {
|
|
|
4934
4950
|
return Be(this, null, function* () {
|
|
4935
4951
|
const [g] = Zr(k);
|
|
4936
4952
|
if (!g) return;
|
|
4937
|
-
const [
|
|
4938
|
-
const le =
|
|
4939
|
-
return (be(a.revalidate) ? a.revalidate(
|
|
4953
|
+
const [b, l] = Js(e, g), [v, m, z, R] = Pe.get(e), q = () => {
|
|
4954
|
+
const le = v[g];
|
|
4955
|
+
return (be(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete z[g], delete R[g], le && le[0]) ? le[0](Hs).then(() => b().data) : b().data;
|
|
4940
4956
|
};
|
|
4941
4957
|
if (t.length < 3)
|
|
4942
|
-
return
|
|
4943
|
-
let
|
|
4944
|
-
const
|
|
4958
|
+
return q();
|
|
4959
|
+
let D = r, B;
|
|
4960
|
+
const I = Tr();
|
|
4945
4961
|
m[g] = [
|
|
4946
|
-
|
|
4962
|
+
I,
|
|
4947
4963
|
0
|
|
4948
4964
|
];
|
|
4949
|
-
const $ = !N(u), Se =
|
|
4950
|
-
if ($ && (u = be(u) ? u(ze,
|
|
4965
|
+
const $ = !N(u), Se = b(), M = Se.data, rt = Se._c, ze = N(rt) ? M : rt;
|
|
4966
|
+
if ($ && (u = be(u) ? u(ze, M) : u, l({
|
|
4951
4967
|
data: u,
|
|
4952
4968
|
_c: ze
|
|
4953
|
-
})), be(
|
|
4969
|
+
})), be(D))
|
|
4954
4970
|
try {
|
|
4955
|
-
|
|
4971
|
+
D = D(ze);
|
|
4956
4972
|
} catch (le) {
|
|
4957
|
-
|
|
4973
|
+
B = le;
|
|
4958
4974
|
}
|
|
4959
|
-
if (
|
|
4960
|
-
if (
|
|
4961
|
-
|
|
4962
|
-
}),
|
|
4963
|
-
if (
|
|
4964
|
-
return
|
|
4965
|
-
} else
|
|
4975
|
+
if (D && Gs(D))
|
|
4976
|
+
if (D = yield D.catch((le) => {
|
|
4977
|
+
B = le;
|
|
4978
|
+
}), I !== m[g][0]) {
|
|
4979
|
+
if (B) throw B;
|
|
4980
|
+
return D;
|
|
4981
|
+
} else B && $ && c(B) && (i = !0, l({
|
|
4966
4982
|
data: ze,
|
|
4967
4983
|
_c: Q
|
|
4968
4984
|
}));
|
|
4969
|
-
if (i && !
|
|
4985
|
+
if (i && !B)
|
|
4970
4986
|
if (be(i)) {
|
|
4971
|
-
const le = i(
|
|
4987
|
+
const le = i(D, ze);
|
|
4972
4988
|
l({
|
|
4973
4989
|
data: le,
|
|
4974
4990
|
error: Q,
|
|
@@ -4976,29 +4992,29 @@ function Js(...t) {
|
|
|
4976
4992
|
});
|
|
4977
4993
|
} else
|
|
4978
4994
|
l({
|
|
4979
|
-
data:
|
|
4995
|
+
data: D,
|
|
4980
4996
|
error: Q,
|
|
4981
4997
|
_c: Q
|
|
4982
4998
|
});
|
|
4983
|
-
if (m[g][1] = Tr(), Promise.resolve(
|
|
4999
|
+
if (m[g][1] = Tr(), Promise.resolve(q()).then(() => {
|
|
4984
5000
|
l({
|
|
4985
5001
|
_c: Q
|
|
4986
5002
|
});
|
|
4987
|
-
}),
|
|
4988
|
-
if (h) throw
|
|
5003
|
+
}), B) {
|
|
5004
|
+
if (h) throw B;
|
|
4989
5005
|
return;
|
|
4990
5006
|
}
|
|
4991
|
-
return
|
|
5007
|
+
return D;
|
|
4992
5008
|
});
|
|
4993
5009
|
}
|
|
4994
5010
|
});
|
|
4995
5011
|
}
|
|
4996
|
-
const
|
|
5012
|
+
const Es = (t, e) => {
|
|
4997
5013
|
for (const n in t)
|
|
4998
5014
|
t[n][0] && t[n][0](e);
|
|
4999
|
-
},
|
|
5015
|
+
}, uu = (t, e) => {
|
|
5000
5016
|
if (!Pe.has(t)) {
|
|
5001
|
-
const n = We(
|
|
5017
|
+
const n = We(su, e), r = {}, s = Xs.bind(Q, t);
|
|
5002
5018
|
let a = De;
|
|
5003
5019
|
const i = {}, o = (h, p) => {
|
|
5004
5020
|
const k = i[h] || [];
|
|
@@ -5007,8 +5023,8 @@ const xs = (t, e) => {
|
|
|
5007
5023
|
t.set(h, p);
|
|
5008
5024
|
const g = i[h];
|
|
5009
5025
|
if (g)
|
|
5010
|
-
for (const
|
|
5011
|
-
|
|
5026
|
+
for (const b of g)
|
|
5027
|
+
b(p, k);
|
|
5012
5028
|
}, c = () => {
|
|
5013
5029
|
if (!Pe.has(t) && (Pe.set(t, [
|
|
5014
5030
|
r,
|
|
@@ -5019,7 +5035,7 @@ const xs = (t, e) => {
|
|
|
5019
5035
|
u,
|
|
5020
5036
|
o
|
|
5021
5037
|
]), !Ht)) {
|
|
5022
|
-
const h = n.initFocus(setTimeout.bind(Q,
|
|
5038
|
+
const h = n.initFocus(setTimeout.bind(Q, Es.bind(Q, r, qs))), p = n.initReconnect(setTimeout.bind(Q, Es.bind(Q, r, Ks)));
|
|
5023
5039
|
a = () => {
|
|
5024
5040
|
h && h(), p && p(), Pe.delete(t);
|
|
5025
5041
|
};
|
|
@@ -5036,16 +5052,16 @@ const xs = (t, e) => {
|
|
|
5036
5052
|
t,
|
|
5037
5053
|
Pe.get(t)[4]
|
|
5038
5054
|
];
|
|
5039
|
-
},
|
|
5055
|
+
}, cu = (t, e, n, r, s) => {
|
|
5040
5056
|
const a = n.errorRetryCount, i = s.retryCount, o = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * n.errorRetryInterval;
|
|
5041
5057
|
!N(a) && i > a || setTimeout(r, o, s);
|
|
5042
|
-
},
|
|
5058
|
+
}, du = br, [Ys, lu] = uu(/* @__PURE__ */ new Map()), fu = We(
|
|
5043
5059
|
{
|
|
5044
5060
|
// events
|
|
5045
5061
|
onLoadingSlow: De,
|
|
5046
5062
|
onSuccess: De,
|
|
5047
5063
|
onError: De,
|
|
5048
|
-
onErrorRetry:
|
|
5064
|
+
onErrorRetry: cu,
|
|
5049
5065
|
onDiscarded: De,
|
|
5050
5066
|
// switches
|
|
5051
5067
|
revalidateOnFocus: !0,
|
|
@@ -5053,29 +5069,29 @@ const xs = (t, e) => {
|
|
|
5053
5069
|
revalidateIfStale: !0,
|
|
5054
5070
|
shouldRetryOnError: !0,
|
|
5055
5071
|
// timeouts
|
|
5056
|
-
errorRetryInterval:
|
|
5072
|
+
errorRetryInterval: xs ? 1e4 : 5e3,
|
|
5057
5073
|
focusThrottleInterval: 5 * 1e3,
|
|
5058
5074
|
dedupingInterval: 2 * 1e3,
|
|
5059
|
-
loadingTimeout:
|
|
5075
|
+
loadingTimeout: xs ? 5e3 : 3e3,
|
|
5060
5076
|
// providers
|
|
5061
|
-
compare:
|
|
5077
|
+
compare: du,
|
|
5062
5078
|
isPaused: () => !1,
|
|
5063
|
-
cache:
|
|
5064
|
-
mutate:
|
|
5079
|
+
cache: Ys,
|
|
5080
|
+
mutate: lu,
|
|
5065
5081
|
fallback: {}
|
|
5066
5082
|
},
|
|
5067
5083
|
// use web preset by default
|
|
5068
|
-
|
|
5069
|
-
),
|
|
5084
|
+
ru
|
|
5085
|
+
), hu = (t, e) => {
|
|
5070
5086
|
const n = We(t, e);
|
|
5071
5087
|
if (e) {
|
|
5072
5088
|
const { use: r, fallback: s } = t, { use: a, fallback: i } = e;
|
|
5073
5089
|
r && a && (n.use = r.concat(a)), s && i && (n.fallback = We(s, i));
|
|
5074
5090
|
}
|
|
5075
5091
|
return n;
|
|
5076
|
-
},
|
|
5077
|
-
|
|
5078
|
-
},
|
|
5092
|
+
}, pu = da({}), mu = "$inf$", Qs = Xt && window.__SWR_DEVTOOLS_USE__, yu = Qs ? window.__SWR_DEVTOOLS_USE__ : [], gu = () => {
|
|
5093
|
+
Qs && (window.__SWR_DEVTOOLS_REACT__ = Gt);
|
|
5094
|
+
}, _u = (t) => be(t[1]) ? [
|
|
5079
5095
|
t[0],
|
|
5080
5096
|
t[1],
|
|
5081
5097
|
t[2] || {}
|
|
@@ -5083,27 +5099,27 @@ const xs = (t, e) => {
|
|
|
5083
5099
|
t[0],
|
|
5084
5100
|
null,
|
|
5085
5101
|
(t[1] === null ? t[2] : t[1]) || {}
|
|
5086
|
-
],
|
|
5087
|
-
const [i] = Zr(e), [, , , o] = Pe.get(
|
|
5088
|
-
if (i.startsWith(
|
|
5102
|
+
], vu = () => We(fu, ha(pu)), bu = (t) => (e, n, r) => t(e, n && ((...a) => {
|
|
5103
|
+
const [i] = Zr(e), [, , , o] = Pe.get(Ys);
|
|
5104
|
+
if (i.startsWith(mu))
|
|
5089
5105
|
return n(...a);
|
|
5090
5106
|
const u = o[i];
|
|
5091
5107
|
return N(u) ? n(...a) : (delete o[i], u);
|
|
5092
|
-
}), r),
|
|
5093
|
-
const r =
|
|
5108
|
+
}), r), wu = yu.concat(bu), ku = (t) => function(...n) {
|
|
5109
|
+
const r = vu(), [s, a, i] = _u(n), o = hu(r, i);
|
|
5094
5110
|
let u = t;
|
|
5095
|
-
const { use: c } = o, h = (c || []).concat(
|
|
5111
|
+
const { use: c } = o, h = (c || []).concat(wu);
|
|
5096
5112
|
for (let p = h.length; p--; )
|
|
5097
5113
|
u = h[p](u);
|
|
5098
5114
|
return u(s, a || o.fetcher || null, o);
|
|
5099
|
-
},
|
|
5115
|
+
}, xu = (t, e, n) => {
|
|
5100
5116
|
const r = e[t] || (e[t] = []);
|
|
5101
5117
|
return r.push(n), () => {
|
|
5102
5118
|
const s = r.indexOf(n);
|
|
5103
5119
|
s >= 0 && (r[s] = r[r.length - 1], r.pop());
|
|
5104
5120
|
};
|
|
5105
5121
|
};
|
|
5106
|
-
|
|
5122
|
+
gu();
|
|
5107
5123
|
const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
|
|
5108
5124
|
// and emitting an error.
|
|
5109
5125
|
// We assume that this is only for the `use(thenable)` case, not `use(context)`.
|
|
@@ -5125,86 +5141,86 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5125
5141
|
}
|
|
5126
5142
|
}), qn = {
|
|
5127
5143
|
dedupe: !0
|
|
5128
|
-
},
|
|
5129
|
-
const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: u, refreshInterval: c, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [g,
|
|
5130
|
-
for (const
|
|
5131
|
-
const
|
|
5132
|
-
if (
|
|
5133
|
-
if (!s(
|
|
5144
|
+
}, Eu = (t, e, n) => {
|
|
5145
|
+
const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: u, refreshInterval: c, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [g, b, l, v] = Pe.get(r), [m, z] = Zr(t), R = qe(!1), q = qe(!1), D = qe(m), B = qe(e), I = qe(n), $ = () => I.current, Se = () => $().isVisible() && $().isOnline(), [M, rt, ze, le] = Js(r, m), st = qe({}).current, Yt = N(i) ? N(n.fallback) ? Q : n.fallback[m] : i, Dr = (j, Z) => {
|
|
5146
|
+
for (const H in st) {
|
|
5147
|
+
const W = H;
|
|
5148
|
+
if (W === "data") {
|
|
5149
|
+
if (!s(j[W], Z[W]) && (!N(j[W]) || !s(en, Z[W])))
|
|
5134
5150
|
return !1;
|
|
5135
|
-
} else if (
|
|
5151
|
+
} else if (Z[W] !== j[W])
|
|
5136
5152
|
return !1;
|
|
5137
5153
|
}
|
|
5138
5154
|
return !0;
|
|
5139
|
-
}, Mr =
|
|
5140
|
-
const
|
|
5155
|
+
}, Mr = pa(() => {
|
|
5156
|
+
const j = !m || !e ? !1 : N(o) ? $().isPaused() || a ? !1 : u !== !1 : o, Z = (X) => {
|
|
5141
5157
|
const Oe = We(X);
|
|
5142
|
-
return delete Oe._k,
|
|
5158
|
+
return delete Oe._k, j ? Ue({
|
|
5143
5159
|
isValidating: !0,
|
|
5144
5160
|
isLoading: !0
|
|
5145
5161
|
}, Oe) : Oe;
|
|
5146
|
-
},
|
|
5147
|
-
let
|
|
5162
|
+
}, H = M(), W = le(), ye = Z(H), ot = H === W ? ye : Z(W);
|
|
5163
|
+
let K = ye;
|
|
5148
5164
|
return [
|
|
5149
5165
|
() => {
|
|
5150
|
-
const X =
|
|
5151
|
-
return Dr(X,
|
|
5166
|
+
const X = Z(M());
|
|
5167
|
+
return Dr(X, K) ? (K.data = X.data, K.isLoading = X.isLoading, K.isValidating = X.isValidating, K.error = X.error, K) : (K = X, X);
|
|
5152
5168
|
},
|
|
5153
5169
|
() => ot
|
|
5154
5170
|
];
|
|
5155
5171
|
}, [
|
|
5156
5172
|
r,
|
|
5157
5173
|
m
|
|
5158
|
-
]), at =
|
|
5159
|
-
(
|
|
5160
|
-
Dr(
|
|
5174
|
+
]), at = Jo.useSyncExternalStore(an(
|
|
5175
|
+
(j) => ze(m, (Z, H) => {
|
|
5176
|
+
Dr(H, Z) || j();
|
|
5161
5177
|
}),
|
|
5162
5178
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5163
5179
|
[
|
|
5164
5180
|
r,
|
|
5165
5181
|
m
|
|
5166
5182
|
]
|
|
5167
|
-
), Mr[0], Mr[1]), Lr = !
|
|
5168
|
-
(
|
|
5169
|
-
const
|
|
5170
|
-
if (!m || !
|
|
5183
|
+
), Mr[0], Mr[1]), Lr = !R.current, ea = g[m] && g[m].length > 0, it = at.data, Ve = N(it) ? Yt && Gs(Yt) ? Bn(Yt) : Yt : it, Qt = at.error, Cn = qe(Ve), en = k ? N(it) ? N(Cn.current) ? Ve : Cn.current : it : Ve, $r = ea && !N(Qt) ? !1 : Lr && !N(o) ? o : $().isPaused() ? !1 : a ? N(Ve) ? !1 : u : N(Ve) || u, Fr = !!(m && e && Lr && $r), ta = N(at.isValidating) ? Fr : at.isValidating, na = N(at.isLoading) ? Fr : at.isLoading, wt = an(
|
|
5184
|
+
(j) => Be(void 0, null, function* () {
|
|
5185
|
+
const Z = B.current;
|
|
5186
|
+
if (!m || !Z || q.current || $().isPaused())
|
|
5171
5187
|
return !1;
|
|
5172
|
-
let
|
|
5173
|
-
const ot =
|
|
5188
|
+
let H, W, ye = !0;
|
|
5189
|
+
const ot = j || {}, K = !l[m] || !ot.dedupe, X = () => ks ? !q.current && m === D.current && R.current : m === D.current, Oe = {
|
|
5174
5190
|
isValidating: !1,
|
|
5175
5191
|
isLoading: !1
|
|
5176
5192
|
}, zr = () => {
|
|
5177
5193
|
rt(Oe);
|
|
5178
5194
|
}, Vr = () => {
|
|
5179
5195
|
const ce = l[m];
|
|
5180
|
-
ce && ce[1] ===
|
|
5196
|
+
ce && ce[1] === W && delete l[m];
|
|
5181
5197
|
}, Ur = {
|
|
5182
5198
|
isValidating: !0
|
|
5183
5199
|
};
|
|
5184
|
-
N(
|
|
5200
|
+
N(M().data) && (Ur.isLoading = !0);
|
|
5185
5201
|
try {
|
|
5186
|
-
if (
|
|
5202
|
+
if (K && (rt(Ur), n.loadingTimeout && N(M().data) && setTimeout(() => {
|
|
5187
5203
|
ye && X() && $().onLoadingSlow(m, n);
|
|
5188
5204
|
}, n.loadingTimeout), l[m] = [
|
|
5189
|
-
|
|
5205
|
+
Z(z),
|
|
5190
5206
|
Tr()
|
|
5191
|
-
]), [
|
|
5192
|
-
return
|
|
5207
|
+
]), [H, W] = l[m], H = yield H, K && setTimeout(Vr, n.dedupingInterval), !l[m] || l[m][1] !== W)
|
|
5208
|
+
return K && X() && $().onDiscarded(m), !1;
|
|
5193
5209
|
Oe.error = Q;
|
|
5194
|
-
const ce =
|
|
5210
|
+
const ce = b[m];
|
|
5195
5211
|
if (!N(ce) && // case 1
|
|
5196
|
-
(
|
|
5197
|
-
|
|
5212
|
+
(W <= ce[0] || // case 2
|
|
5213
|
+
W <= ce[1] || // case 3
|
|
5198
5214
|
ce[1] === 0))
|
|
5199
|
-
return zr(),
|
|
5200
|
-
const Te =
|
|
5201
|
-
Oe.data = s(Te,
|
|
5215
|
+
return zr(), K && X() && $().onDiscarded(m), !1;
|
|
5216
|
+
const Te = M().data;
|
|
5217
|
+
Oe.data = s(Te, H) ? Te : H, K && X() && $().onSuccess(H, m, n);
|
|
5202
5218
|
} catch (ce) {
|
|
5203
5219
|
Vr();
|
|
5204
5220
|
const Te = $(), { shouldRetryOnError: Nn } = Te;
|
|
5205
|
-
Te.isPaused() || (Oe.error = ce,
|
|
5221
|
+
Te.isPaused() || (Oe.error = ce, K && X() && (Te.onError(ce, m, Te), (Nn === !0 || be(Nn) && Nn(ce)) && (!$().revalidateOnFocus || !$().revalidateOnReconnect || Se()) && Te.onErrorRetry(ce, m, Te, (ra) => {
|
|
5206
5222
|
const Pn = g[m];
|
|
5207
|
-
Pn && Pn[0] && Pn[0](
|
|
5223
|
+
Pn && Pn[0] && Pn[0](bs, ra);
|
|
5208
5224
|
}, {
|
|
5209
5225
|
retryCount: (ot.retryCount || 0) + 1,
|
|
5210
5226
|
dedupe: !0
|
|
@@ -5229,65 +5245,65 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5229
5245
|
]
|
|
5230
5246
|
), Wr = an(
|
|
5231
5247
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
5232
|
-
(...
|
|
5248
|
+
(...j) => Xs(r, D.current, ...j),
|
|
5233
5249
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5234
5250
|
[]
|
|
5235
5251
|
);
|
|
5236
5252
|
if (zn(() => {
|
|
5237
|
-
|
|
5253
|
+
B.current = e, I.current = n, N(it) || (Cn.current = it);
|
|
5238
5254
|
}), zn(() => {
|
|
5239
5255
|
if (!m) return;
|
|
5240
|
-
const
|
|
5241
|
-
let
|
|
5242
|
-
const
|
|
5243
|
-
if (ye ==
|
|
5244
|
-
const
|
|
5245
|
-
$().revalidateOnFocus &&
|
|
5246
|
-
} else if (ye ==
|
|
5247
|
-
$().revalidateOnReconnect && Se() &&
|
|
5256
|
+
const j = wt.bind(Q, qn);
|
|
5257
|
+
let Z = 0;
|
|
5258
|
+
const W = xu(m, g, (ye, ot = {}) => {
|
|
5259
|
+
if (ye == qs) {
|
|
5260
|
+
const K = Date.now();
|
|
5261
|
+
$().revalidateOnFocus && K > Z && Se() && (Z = K + $().focusThrottleInterval, j());
|
|
5262
|
+
} else if (ye == Ks)
|
|
5263
|
+
$().revalidateOnReconnect && Se() && j();
|
|
5248
5264
|
else {
|
|
5249
|
-
if (ye ==
|
|
5265
|
+
if (ye == Hs)
|
|
5250
5266
|
return wt();
|
|
5251
|
-
if (ye ==
|
|
5267
|
+
if (ye == bs)
|
|
5252
5268
|
return wt(ot);
|
|
5253
5269
|
}
|
|
5254
5270
|
});
|
|
5255
|
-
return
|
|
5256
|
-
_k:
|
|
5257
|
-
}), $r && (N(Ve) || Ht ?
|
|
5258
|
-
|
|
5271
|
+
return q.current = !1, D.current = m, R.current = !0, rt({
|
|
5272
|
+
_k: z
|
|
5273
|
+
}), $r && (N(Ve) || Ht ? j() : au(j)), () => {
|
|
5274
|
+
q.current = !0, W();
|
|
5259
5275
|
};
|
|
5260
5276
|
}, [
|
|
5261
5277
|
m
|
|
5262
5278
|
]), zn(() => {
|
|
5263
|
-
let
|
|
5264
|
-
function
|
|
5265
|
-
const
|
|
5266
|
-
|
|
5279
|
+
let j;
|
|
5280
|
+
function Z() {
|
|
5281
|
+
const W = be(c) ? c(M().data) : c;
|
|
5282
|
+
W && j !== -1 && (j = setTimeout(H, W));
|
|
5267
5283
|
}
|
|
5268
|
-
function
|
|
5269
|
-
!
|
|
5284
|
+
function H() {
|
|
5285
|
+
!M().error && (h || $().isVisible()) && (p || $().isOnline()) ? wt(qn).then(Z) : Z();
|
|
5270
5286
|
}
|
|
5271
|
-
return
|
|
5272
|
-
|
|
5287
|
+
return Z(), () => {
|
|
5288
|
+
j && (clearTimeout(j), j = -1);
|
|
5273
5289
|
};
|
|
5274
5290
|
}, [
|
|
5275
5291
|
c,
|
|
5276
5292
|
h,
|
|
5277
5293
|
p,
|
|
5278
5294
|
m
|
|
5279
|
-
]),
|
|
5280
|
-
if (!
|
|
5295
|
+
]), ma(en), a && N(Ve) && m) {
|
|
5296
|
+
if (!ks && Ht)
|
|
5281
5297
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
5282
|
-
|
|
5283
|
-
const
|
|
5284
|
-
if (!N(
|
|
5285
|
-
const
|
|
5286
|
-
Bn(
|
|
5298
|
+
B.current = e, I.current = n, q.current = !1;
|
|
5299
|
+
const j = v[m];
|
|
5300
|
+
if (!N(j)) {
|
|
5301
|
+
const Z = Wr(j);
|
|
5302
|
+
Bn(Z);
|
|
5287
5303
|
}
|
|
5288
5304
|
if (N(Qt)) {
|
|
5289
|
-
const
|
|
5290
|
-
N(en) || (
|
|
5305
|
+
const Z = wt(qn);
|
|
5306
|
+
N(en) || (Z.status = "fulfilled", Z.value = !0), Bn(Z);
|
|
5291
5307
|
} else
|
|
5292
5308
|
throw Qt;
|
|
5293
5309
|
}
|
|
@@ -5300,21 +5316,21 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5300
5316
|
return st.error = !0, Qt;
|
|
5301
5317
|
},
|
|
5302
5318
|
get isValidating() {
|
|
5303
|
-
return st.isValidating = !0,
|
|
5319
|
+
return st.isValidating = !0, ta;
|
|
5304
5320
|
},
|
|
5305
5321
|
get isLoading() {
|
|
5306
|
-
return st.isLoading = !0,
|
|
5322
|
+
return st.isLoading = !0, na;
|
|
5307
5323
|
}
|
|
5308
5324
|
};
|
|
5309
|
-
},
|
|
5325
|
+
}, Su = ku(Eu), Nu = ({
|
|
5310
5326
|
fileKey: t,
|
|
5311
5327
|
authToken: e,
|
|
5312
5328
|
enabled: n = !0,
|
|
5313
5329
|
params: r = {}
|
|
5314
5330
|
}) => {
|
|
5315
|
-
const s = !!(n && t && e), { data: a, isLoading: i, error: o } =
|
|
5331
|
+
const s = !!(n && t && e), { data: a, isLoading: i, error: o } = Su(
|
|
5316
5332
|
["figma", t, e, r],
|
|
5317
|
-
() => s ?
|
|
5333
|
+
() => s ? To({
|
|
5318
5334
|
fileKey: t,
|
|
5319
5335
|
authToken: e,
|
|
5320
5336
|
params: r
|
|
@@ -5332,7 +5348,7 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5332
5348
|
};
|
|
5333
5349
|
};
|
|
5334
5350
|
export {
|
|
5335
|
-
|
|
5336
|
-
|
|
5351
|
+
Cu as useAnimaCodegen,
|
|
5352
|
+
Nu as useFigmaFile
|
|
5337
5353
|
};
|
|
5338
5354
|
//# sourceMappingURL=index.js.map
|