@animaapp/anima-sdk-react 0.6.28 → 0.6.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +370 -370
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var ia = Object.defineProperty, oa = Object.defineProperties;
|
|
|
2
2
|
var ca = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Vr = Object.getOwnPropertySymbols;
|
|
4
4
|
var ua = Object.prototype.hasOwnProperty, da = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var Kr = (t, e, n) => e in t ? ia(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n,
|
|
5
|
+
var Kr = (t, e, n) => e in t ? ia(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Be = (t, e) => {
|
|
6
6
|
for (var n in e || (e = {}))
|
|
7
7
|
ua.call(e, n) && Kr(t, n, e[n]);
|
|
8
8
|
if (Vr)
|
|
@@ -26,7 +26,7 @@ var Ie = (t, e, n) => new Promise((r, s) => {
|
|
|
26
26
|
}, o = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(a, i);
|
|
27
27
|
o((n = n.apply(t, e)).next());
|
|
28
28
|
});
|
|
29
|
-
import Gt, { useState as la, useCallback as sn, createContext as fa, useEffect as ha, useLayoutEffect as pa, useContext as ma, useRef as
|
|
29
|
+
import Gt, { useState as la, useCallback as sn, createContext as fa, useEffect as ha, useLayoutEffect as pa, useContext as ma, useRef as qe, useMemo as ya, useDebugValue as ga } from "react";
|
|
30
30
|
const va = (t) => {
|
|
31
31
|
let e = "";
|
|
32
32
|
const n = new Uint8Array(t), r = n.byteLength;
|
|
@@ -122,14 +122,14 @@ const Pa = (t, e) => {
|
|
|
122
122
|
};
|
|
123
123
|
var Za = Object.defineProperty, Da = Object.defineProperties, Ma = Object.getOwnPropertyDescriptors, Jr = Object.getOwnPropertySymbols, La = Object.prototype.hasOwnProperty, $a = Object.prototype.propertyIsEnumerable, Xr = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), Ts = (t) => {
|
|
124
124
|
throw TypeError(t);
|
|
125
|
-
}, Yr = (t, e, n) => e in t ? Za(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n,
|
|
125
|
+
}, Yr = (t, e, n) => e in t ? Za(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ae = (t, e) => {
|
|
126
126
|
for (var n in e || (e = {}))
|
|
127
127
|
La.call(e, n) && Yr(t, n, e[n]);
|
|
128
128
|
if (Jr)
|
|
129
129
|
for (var n of Jr(e))
|
|
130
130
|
$a.call(e, n) && Yr(t, n, e[n]);
|
|
131
131
|
return t;
|
|
132
|
-
}, Tr = (t, e) => Da(t, Ma(e)), Ar = (t, e, n) => e.has(t) || Ts("Cannot " + n),
|
|
132
|
+
}, Tr = (t, e) => Da(t, Ma(e)), Ar = (t, e, n) => e.has(t) || Ts("Cannot " + n), Z = (t, e, n) => (Ar(t, e, "read from private field"), n ? n.call(t) : e.get(t)), le = (t, e, n) => e.has(t) ? Ts("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), J = (t, e, n, r) => (Ar(t, e, "write to private field"), e.set(t, n), n), be = (t, e, n) => (Ar(t, e, "access private method"), n), B = (t, e, n) => new Promise((r, s) => {
|
|
133
133
|
var a = (c) => {
|
|
134
134
|
try {
|
|
135
135
|
o(n.next(c));
|
|
@@ -154,42 +154,42 @@ function Va() {
|
|
|
154
154
|
(function(n, r) {
|
|
155
155
|
t.exports = r();
|
|
156
156
|
})(Ua, function() {
|
|
157
|
-
var n = typeof Promise == "function", r = typeof self == "object" ? self : Wa, s = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = s && typeof Symbol.iterator != "undefined", p = s && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", v = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), m = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), g = h && typeof Array.prototype[Symbol.iterator] == "function", l = g && Object.getPrototypeOf([][Symbol.iterator]()), O = h && typeof String.prototype[Symbol.iterator] == "function",
|
|
158
|
-
function U(
|
|
159
|
-
var
|
|
160
|
-
if (
|
|
161
|
-
return
|
|
162
|
-
if (
|
|
157
|
+
var n = typeof Promise == "function", r = typeof self == "object" ? self : Wa, s = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = s && typeof Symbol.iterator != "undefined", p = s && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", v = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), m = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), g = h && typeof Array.prototype[Symbol.iterator] == "function", l = g && Object.getPrototypeOf([][Symbol.iterator]()), O = h && typeof String.prototype[Symbol.iterator] == "function", P = O && Object.getPrototypeOf(""[Symbol.iterator]()), K = 8, D = -1;
|
|
158
|
+
function U(M) {
|
|
159
|
+
var L = typeof M;
|
|
160
|
+
if (L !== "object")
|
|
161
|
+
return L;
|
|
162
|
+
if (M === null)
|
|
163
163
|
return "null";
|
|
164
|
-
if (
|
|
164
|
+
if (M === r)
|
|
165
165
|
return "global";
|
|
166
|
-
if (Array.isArray(
|
|
166
|
+
if (Array.isArray(M) && (p === !1 || !(Symbol.toStringTag in M)))
|
|
167
167
|
return "Array";
|
|
168
168
|
if (typeof window == "object" && window !== null) {
|
|
169
|
-
if (typeof window.location == "object" &&
|
|
169
|
+
if (typeof window.location == "object" && M === window.location)
|
|
170
170
|
return "Location";
|
|
171
|
-
if (typeof window.document == "object" &&
|
|
171
|
+
if (typeof window.document == "object" && M === window.document)
|
|
172
172
|
return "Document";
|
|
173
173
|
if (typeof window.navigator == "object") {
|
|
174
|
-
if (typeof window.navigator.mimeTypes == "object" &&
|
|
174
|
+
if (typeof window.navigator.mimeTypes == "object" && M === window.navigator.mimeTypes)
|
|
175
175
|
return "MimeTypeArray";
|
|
176
|
-
if (typeof window.navigator.plugins == "object" &&
|
|
176
|
+
if (typeof window.navigator.plugins == "object" && M === window.navigator.plugins)
|
|
177
177
|
return "PluginArray";
|
|
178
178
|
}
|
|
179
|
-
if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") &&
|
|
180
|
-
if (
|
|
179
|
+
if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && M instanceof window.HTMLElement) {
|
|
180
|
+
if (M.tagName === "BLOCKQUOTE")
|
|
181
181
|
return "HTMLQuoteElement";
|
|
182
|
-
if (
|
|
182
|
+
if (M.tagName === "TD")
|
|
183
183
|
return "HTMLTableDataCellElement";
|
|
184
|
-
if (
|
|
184
|
+
if (M.tagName === "TH")
|
|
185
185
|
return "HTMLTableHeaderCellElement";
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
var
|
|
189
|
-
if (typeof
|
|
190
|
-
return
|
|
191
|
-
var
|
|
192
|
-
return
|
|
188
|
+
var ue = p && M[Symbol.toStringTag];
|
|
189
|
+
if (typeof ue == "string")
|
|
190
|
+
return ue;
|
|
191
|
+
var j = Object.getPrototypeOf(M);
|
|
192
|
+
return j === RegExp.prototype ? "RegExp" : j === Date.prototype ? "Date" : n && j === Promise.prototype ? "Promise" : i && j === Set.prototype ? "Set" : a && j === Map.prototype ? "Map" : c && j === WeakSet.prototype ? "WeakSet" : o && j === WeakMap.prototype ? "WeakMap" : u && j === DataView.prototype ? "DataView" : a && j === m ? "Map Iterator" : i && j === b ? "Set Iterator" : g && j === l ? "Array Iterator" : O && j === P ? "String Iterator" : j === null ? "Object" : Object.prototype.toString.call(M).slice(K, D);
|
|
193
193
|
}
|
|
194
194
|
return U;
|
|
195
195
|
});
|
|
@@ -321,7 +321,7 @@ function ci(t) {
|
|
|
321
321
|
function Ae(t, e) {
|
|
322
322
|
return Rn[e].from ? Rn[e].from(t) : new Rn[e](t);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Q(t) {
|
|
325
325
|
return t;
|
|
326
326
|
}
|
|
327
327
|
function ts() {
|
|
@@ -358,23 +358,23 @@ const fi = /* @__PURE__ */ new Map([
|
|
|
358
358
|
["Uint8Array", Ae],
|
|
359
359
|
["Uint8ClampedArray", Ae],
|
|
360
360
|
// shallow copy
|
|
361
|
-
["Array Iterator",
|
|
362
|
-
["Map Iterator",
|
|
363
|
-
["Promise",
|
|
364
|
-
["Set Iterator",
|
|
365
|
-
["String Iterator",
|
|
366
|
-
["function",
|
|
367
|
-
["global",
|
|
361
|
+
["Array Iterator", Q],
|
|
362
|
+
["Map Iterator", Q],
|
|
363
|
+
["Promise", Q],
|
|
364
|
+
["Set Iterator", Q],
|
|
365
|
+
["String Iterator", Q],
|
|
366
|
+
["function", Q],
|
|
367
|
+
["global", Q],
|
|
368
368
|
// NOTE: WeakMap and WeakSet cannot get entries
|
|
369
|
-
["WeakMap",
|
|
370
|
-
["WeakSet",
|
|
369
|
+
["WeakMap", Q],
|
|
370
|
+
["WeakSet", Q],
|
|
371
371
|
// primitives
|
|
372
|
-
["boolean",
|
|
373
|
-
["null",
|
|
374
|
-
["number",
|
|
375
|
-
["string",
|
|
376
|
-
["symbol",
|
|
377
|
-
["undefined",
|
|
372
|
+
["boolean", Q],
|
|
373
|
+
["null", Q],
|
|
374
|
+
["number", Q],
|
|
375
|
+
["string", Q],
|
|
376
|
+
["symbol", Q],
|
|
377
|
+
["undefined", Q],
|
|
378
378
|
// collections
|
|
379
379
|
// NOTE: return empty value, because recursively copy later.
|
|
380
380
|
["Arguments", ts],
|
|
@@ -460,17 +460,17 @@ function Gn(t, e, n, r, s) {
|
|
|
460
460
|
return e;
|
|
461
461
|
}
|
|
462
462
|
const pi = (t) => new Promise((e) => setTimeout(e, t));
|
|
463
|
-
var an,
|
|
463
|
+
var an, Ge, on, Jn, As;
|
|
464
464
|
class mi {
|
|
465
465
|
constructor({ maxAttempts: e = 3, func: n }) {
|
|
466
|
-
le(this, Jn), le(this, an), le(this,
|
|
466
|
+
le(this, Jn), le(this, an), le(this, Ge), le(this, on), J(this, an, e), J(this, on, n), J(this, Ge, 0);
|
|
467
467
|
}
|
|
468
468
|
run() {
|
|
469
469
|
return B(this, null, function* () {
|
|
470
470
|
try {
|
|
471
|
-
return yield
|
|
471
|
+
return yield Z(this, on).call(this);
|
|
472
472
|
} catch (e) {
|
|
473
|
-
if (
|
|
473
|
+
if (J(this, Ge, Z(this, Ge) + 1), Z(this, Ge) > Z(this, an))
|
|
474
474
|
throw console.error("Max attempts reached"), e;
|
|
475
475
|
const n = be(this, Jn, As).call(this);
|
|
476
476
|
return yield pi(n), yield this.run();
|
|
@@ -478,8 +478,8 @@ class mi {
|
|
|
478
478
|
});
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
an = /* @__PURE__ */ new WeakMap(),
|
|
482
|
-
return
|
|
481
|
+
an = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), on = /* @__PURE__ */ new WeakMap(), Jn = /* @__PURE__ */ new WeakSet(), As = function() {
|
|
482
|
+
return Z(this, Ge) * 1e3 * 1.5;
|
|
483
483
|
};
|
|
484
484
|
function yi() {
|
|
485
485
|
return typeof CompressionStream != "undefined";
|
|
@@ -570,10 +570,10 @@ function Xn() {
|
|
|
570
570
|
return Math.floor(Date.now() / 1e3).toString();
|
|
571
571
|
}
|
|
572
572
|
const wi = 5 * 60 * 1e3, ki = 1 * 1e3;
|
|
573
|
-
var
|
|
573
|
+
var Je, ne, ve, Yn, Qn, xt;
|
|
574
574
|
class Si {
|
|
575
575
|
constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
|
|
576
|
-
le(this, ve), le(this,
|
|
576
|
+
le(this, ve), le(this, Je), le(this, ne), this.baseAddress = n, J(this, Je, e), J(this, ne, {}), this.plugins = [];
|
|
577
577
|
}
|
|
578
578
|
get headers() {
|
|
579
579
|
throw new Error("Missing implementation");
|
|
@@ -585,47 +585,47 @@ class Si {
|
|
|
585
585
|
this.plugins = this.plugins.filter((n) => n.name !== e);
|
|
586
586
|
}
|
|
587
587
|
withOptions(e = {}) {
|
|
588
|
-
return
|
|
588
|
+
return J(this, ne, e), this;
|
|
589
589
|
}
|
|
590
590
|
get(e) {
|
|
591
591
|
return B(this, arguments, function* (n, r = {}) {
|
|
592
592
|
const { overrideBaseAddress: s, overrideDefaultHeaders: a } = r, i = s != null ? s : this.baseAddress;
|
|
593
593
|
let o = a != null ? a : this.headers;
|
|
594
|
-
const c = kt(
|
|
595
|
-
return
|
|
594
|
+
const c = kt(Z(this, ne));
|
|
595
|
+
return J(this, ne, {}), c.extraHeaders && (o = ae(ae({}, o), c.extraHeaders)), c.requestValidation && (o = Tr(ae({}, o), { "X-Request-Nonce": Cs(), "X-Request-Timestamp": Xn() })), c.async ? yield be(this, ve, Qn).call(this, `${i}${n}`, c.async, { headers: o }) : yield be(this, ve, Yn).call(this, `${i}${n}`, c, { headers: o });
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
post(e, n) {
|
|
599
599
|
return B(this, arguments, function* (r, s, a = {}) {
|
|
600
|
-
const i = kt(
|
|
601
|
-
return
|
|
600
|
+
const i = kt(Z(this, ne));
|
|
601
|
+
return J(this, ne, {}), be(this, ve, xt).call(this, r, "POST", s, a, i);
|
|
602
602
|
});
|
|
603
603
|
}
|
|
604
604
|
put(e, n) {
|
|
605
605
|
return B(this, arguments, function* (r, s, a = {}) {
|
|
606
|
-
const i = kt(
|
|
607
|
-
return
|
|
606
|
+
const i = kt(Z(this, ne));
|
|
607
|
+
return J(this, ne, {}), be(this, ve, xt).call(this, r, "PUT", s, a, i);
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
delete(e, n) {
|
|
611
611
|
return B(this, arguments, function* (r, s, a = {}) {
|
|
612
|
-
const i = kt(
|
|
613
|
-
return
|
|
612
|
+
const i = kt(Z(this, ne));
|
|
613
|
+
return J(this, ne, {}), be(this, ve, xt).call(this, r, "DELETE", s, a, i);
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
616
|
patch(e, n) {
|
|
617
617
|
return B(this, arguments, function* (r, s, a = {}) {
|
|
618
|
-
const i = kt(
|
|
619
|
-
return
|
|
618
|
+
const i = kt(Z(this, ne));
|
|
619
|
+
return J(this, ne, {}), be(this, ve, xt).call(this, r, "PATCH", s, a, i);
|
|
620
620
|
});
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
|
|
623
|
+
Je = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakSet(), Yn = function(t, e, n) {
|
|
624
624
|
return B(this, null, function* () {
|
|
625
625
|
const r = () => B(this, null, function* () {
|
|
626
626
|
var c, u;
|
|
627
627
|
try {
|
|
628
|
-
return yield
|
|
628
|
+
return yield Z(this, Je).call(this, t, ae(ae({}, n), e.abortSignal && { signal: e.abortSignal }));
|
|
629
629
|
} catch (h) {
|
|
630
630
|
throw h instanceof Error && h.name === "AbortError" ? new St({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : h;
|
|
631
631
|
}
|
|
@@ -685,7 +685,7 @@ Ge = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
685
685
|
} = e, u = `${t}/async`, h = `${t}/async/job`;
|
|
686
686
|
let p;
|
|
687
687
|
try {
|
|
688
|
-
p = yield
|
|
688
|
+
p = yield Z(this, Je).call(this, u, ae(ae({}, n), i && { signal: i }));
|
|
689
689
|
} catch (b) {
|
|
690
690
|
throw b instanceof Error && b.name === "AbortError" ? new St({ canceled: (r = i == null ? void 0 : i.aborted) != null ? r : !1 }) : b;
|
|
691
691
|
}
|
|
@@ -708,28 +708,28 @@ Ge = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
708
708
|
m(new Error("Job timed out"));
|
|
709
709
|
}, c), l = (O = 0) => B(this, null, function* () {
|
|
710
710
|
if (i != null && i.aborted) {
|
|
711
|
-
clearTimeout(g),
|
|
711
|
+
clearTimeout(g), Z(this, Je).call(this, `${h}/${v}/cancel`, { method: "POST", headers: this.headers }).then(() => {
|
|
712
712
|
m(new St({ canceled: !0 }));
|
|
713
|
-
}).catch((
|
|
713
|
+
}).catch((P) => {
|
|
714
714
|
m(new St({ canceled: !1 }));
|
|
715
715
|
});
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
718
718
|
try {
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
719
|
+
const P = yield (yield Z(this, Je).call(this, `${h}/${v}`, { headers: this.headers })).json();
|
|
720
|
+
if (P.status === "success") {
|
|
721
721
|
clearTimeout(g);
|
|
722
|
-
const K =
|
|
722
|
+
const K = P.response_json;
|
|
723
723
|
b(K);
|
|
724
|
-
} else if (
|
|
725
|
-
clearTimeout(g), m(new bi(
|
|
724
|
+
} else if (P.status === "failed")
|
|
725
|
+
clearTimeout(g), m(new bi(P.response_json));
|
|
726
726
|
else {
|
|
727
|
-
a && a(
|
|
727
|
+
a && a(P.response_json);
|
|
728
728
|
const K = o(O);
|
|
729
729
|
setTimeout(() => l(O + 1), K);
|
|
730
730
|
}
|
|
731
|
-
} catch (
|
|
732
|
-
m(
|
|
731
|
+
} catch (P) {
|
|
732
|
+
m(P);
|
|
733
733
|
}
|
|
734
734
|
});
|
|
735
735
|
l();
|
|
@@ -739,7 +739,7 @@ Ge = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ve = /*
|
|
|
739
739
|
return B(this, null, function* () {
|
|
740
740
|
const { overrideBaseAddress: a, overrideDefaultHeaders: i } = r, o = a != null ? a : this.baseAddress;
|
|
741
741
|
let c = i != null ? i : this.headers;
|
|
742
|
-
s.extraHeaders && (c =
|
|
742
|
+
s.extraHeaders && (c = ae(ae({}, c), s.extraHeaders)), s.requestValidation && (c = Tr(ae({}, c), { "X-Request-Nonce": Cs(), "X-Request-Timestamp": Xn() }));
|
|
743
743
|
let u = n;
|
|
744
744
|
return typeof FormData != "undefined" && n instanceof FormData ? delete c["Content-Type"] : (u = r.skipBodyJsonStringify ? n : JSON.stringify(n), s.compress && yi() && (c["Content-Encoding"] = "gzip", u = yield gi(u))), s.async ? yield be(this, ve, Qn).call(this, `${o}${t}`, s.async, {
|
|
745
745
|
method: e,
|
|
@@ -772,21 +772,21 @@ const rs = (t, e, n, r) => t instanceof St ? t : new _i({ resource: e, api: Stri
|
|
|
772
772
|
var Et;
|
|
773
773
|
class xi {
|
|
774
774
|
constructor(e) {
|
|
775
|
-
le(this, Et), this.resourceName = "Files",
|
|
775
|
+
le(this, Et), this.resourceName = "Files", J(this, Et, e);
|
|
776
776
|
}
|
|
777
777
|
get(e) {
|
|
778
778
|
return B(this, arguments, function* ({ fileKey: n, params: r = {} }) {
|
|
779
|
-
const s = new URLSearchParams(
|
|
779
|
+
const s = new URLSearchParams(ae({
|
|
780
780
|
plugin_data: "857346721138427857"
|
|
781
781
|
}, r)).toString(), a = `v1/files/${n}?${s}`;
|
|
782
|
-
return yield
|
|
782
|
+
return yield Z(this, Et).get(a);
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
785
|
getImageFills(e) {
|
|
786
786
|
return B(this, arguments, function* ({ fileKey: n }) {
|
|
787
787
|
var r, s;
|
|
788
788
|
const a = `v1/files/${n}/images`;
|
|
789
|
-
return (s = (r = (yield
|
|
789
|
+
return (s = (r = (yield Z(this, Et).get(a)).meta) == null ? void 0 : r.images) != null ? s : {};
|
|
790
790
|
});
|
|
791
791
|
}
|
|
792
792
|
}
|
|
@@ -798,7 +798,7 @@ const Ei = (t, e, n) => {
|
|
|
798
798
|
var _e, er, Ns;
|
|
799
799
|
class Ti {
|
|
800
800
|
constructor(e) {
|
|
801
|
-
le(this, er), le(this, _e), this.resourceName = "Images",
|
|
801
|
+
le(this, er), le(this, _e), this.resourceName = "Images", J(this, _e, e);
|
|
802
802
|
}
|
|
803
803
|
/**
|
|
804
804
|
* Return the URL for the _layer_ images for the given nodes.
|
|
@@ -806,29 +806,29 @@ class Ti {
|
|
|
806
806
|
*/
|
|
807
807
|
get(e) {
|
|
808
808
|
return B(this, arguments, function* ({ fileKey: n, nodeIds: r, format: s = "jpg", scale: a }) {
|
|
809
|
-
const i = Ei(n, r, s), o =
|
|
809
|
+
const i = Ei(n, r, s), o = Z(this, _e).cache.images.entries.get(i);
|
|
810
810
|
if (Oi(o))
|
|
811
811
|
return o.result;
|
|
812
|
-
o &&
|
|
813
|
-
const c =
|
|
812
|
+
o && Z(this, _e).cache.images.entries.delete(i);
|
|
813
|
+
const c = Z(this, _e).cache.images.pendingRequests.get(i);
|
|
814
814
|
if (c)
|
|
815
815
|
return c;
|
|
816
816
|
const u = be(this, er, Ns).call(this, i, n, r, s, a);
|
|
817
|
-
|
|
817
|
+
Z(this, _e).cache.images.pendingRequests.set(i, u);
|
|
818
818
|
try {
|
|
819
819
|
return yield u;
|
|
820
820
|
} finally {
|
|
821
|
-
|
|
821
|
+
Z(this, _e).cache.images.pendingRequests.delete(i);
|
|
822
822
|
}
|
|
823
823
|
});
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
826
|
_e = /* @__PURE__ */ new WeakMap(), er = /* @__PURE__ */ new WeakSet(), Ns = function(t, e, n, r, s) {
|
|
827
827
|
return B(this, null, function* () {
|
|
828
|
-
const a = yield
|
|
828
|
+
const a = yield Z(this, _e).get(
|
|
829
829
|
`v1/images/${e}?ids=${n}&format=${r}${s ? `&scale=${s}` : ""}`
|
|
830
830
|
);
|
|
831
|
-
return
|
|
831
|
+
return Z(this, _e).cache.images.entries.set(t, {
|
|
832
832
|
result: a,
|
|
833
833
|
ts: Date.now()
|
|
834
834
|
}), a;
|
|
@@ -837,16 +837,16 @@ _e = /* @__PURE__ */ new WeakMap(), er = /* @__PURE__ */ new WeakSet(), Ns = fun
|
|
|
837
837
|
var cn;
|
|
838
838
|
class Ai {
|
|
839
839
|
constructor(e) {
|
|
840
|
-
le(this, cn), this.resourceName = "Nodes",
|
|
840
|
+
le(this, cn), this.resourceName = "Nodes", J(this, cn, e);
|
|
841
841
|
}
|
|
842
842
|
get(e) {
|
|
843
843
|
return B(this, arguments, function* ({ fileKey: n, nodeIds: r, params: s = {} }) {
|
|
844
|
-
const a = Tr(
|
|
844
|
+
const a = Tr(ae({}, s), {
|
|
845
845
|
ids: r.join(",")
|
|
846
|
-
}), i = new URLSearchParams(
|
|
846
|
+
}), i = new URLSearchParams(ae({
|
|
847
847
|
plugin_data: "857346721138427857"
|
|
848
848
|
}, a)).toString(), o = `v1/files/${n}/nodes?${i}`;
|
|
849
|
-
return yield
|
|
849
|
+
return yield Z(this, cn).get(o);
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
852
|
}
|
|
@@ -867,16 +867,16 @@ class Ci extends Si {
|
|
|
867
867
|
set token(e) {
|
|
868
868
|
if (!e.startsWith("figd_") && !e.startsWith("figu_"))
|
|
869
869
|
throw new Error("Invalid Figma access token");
|
|
870
|
-
|
|
870
|
+
J(this, Pe, e);
|
|
871
871
|
}
|
|
872
872
|
get token() {
|
|
873
|
-
return
|
|
873
|
+
return Z(this, Pe);
|
|
874
874
|
}
|
|
875
875
|
get headers() {
|
|
876
876
|
const e = {
|
|
877
877
|
"Content-Type": "application/json"
|
|
878
878
|
};
|
|
879
|
-
return
|
|
879
|
+
return Z(this, Pe).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = Z(this, Pe) : Z(this, Pe).startsWith("figu_") && (e.Authorization = `Bearer ${Z(this, Pe)}`), e;
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
Pe = /* @__PURE__ */ new WeakMap();
|
|
@@ -999,7 +999,7 @@ const _ = N.arrayToEnum([
|
|
|
999
999
|
"not_multiple_of",
|
|
1000
1000
|
"not_finite"
|
|
1001
1001
|
]), Ri = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
1002
|
-
class
|
|
1002
|
+
class ie extends Error {
|
|
1003
1003
|
get errors() {
|
|
1004
1004
|
return this.issues;
|
|
1005
1005
|
}
|
|
@@ -1036,7 +1036,7 @@ class oe extends Error {
|
|
|
1036
1036
|
return s(this), r;
|
|
1037
1037
|
}
|
|
1038
1038
|
static assert(e) {
|
|
1039
|
-
if (!(e instanceof
|
|
1039
|
+
if (!(e instanceof ie))
|
|
1040
1040
|
throw new Error(`Not a ZodError: ${e}`);
|
|
1041
1041
|
}
|
|
1042
1042
|
toString() {
|
|
@@ -1058,7 +1058,7 @@ class oe extends Error {
|
|
|
1058
1058
|
return this.flatten();
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
|
|
1061
|
+
ie.create = (t) => new ie(t);
|
|
1062
1062
|
const yt = (t, e) => {
|
|
1063
1063
|
let n;
|
|
1064
1064
|
switch (t.code) {
|
|
@@ -1158,7 +1158,7 @@ function y(t, e) {
|
|
|
1158
1158
|
});
|
|
1159
1159
|
t.common.issues.push(r);
|
|
1160
1160
|
}
|
|
1161
|
-
class
|
|
1161
|
+
class X {
|
|
1162
1162
|
constructor() {
|
|
1163
1163
|
this.value = "valid";
|
|
1164
1164
|
}
|
|
@@ -1187,7 +1187,7 @@ class Y {
|
|
|
1187
1187
|
value: i
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
1190
|
-
return
|
|
1190
|
+
return X.mergeObjectSync(e, r);
|
|
1191
1191
|
});
|
|
1192
1192
|
}
|
|
1193
1193
|
static mergeObjectSync(e, n) {
|
|
@@ -1203,7 +1203,7 @@ class Y {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
const E = Object.freeze({
|
|
1205
1205
|
status: "aborted"
|
|
1206
|
-
}), hn = (t) => ({ status: "dirty", value: t }),
|
|
1206
|
+
}), hn = (t) => ({ status: "dirty", value: t }), te = (t) => ({ status: "valid", value: t }), nr = (t) => t.status === "aborted", rr = (t) => t.status === "dirty", Qe = (t) => t.status === "valid", jt = (t) => typeof Promise != "undefined" && t instanceof Promise;
|
|
1207
1207
|
function pn(t, e, n, r) {
|
|
1208
1208
|
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");
|
|
1209
1209
|
return e.get(t);
|
|
@@ -1226,7 +1226,7 @@ class xe {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
1228
|
const ss = (t, e) => {
|
|
1229
|
-
if (
|
|
1229
|
+
if (Qe(e))
|
|
1230
1230
|
return { success: !0, data: e.value };
|
|
1231
1231
|
if (!t.common.issues.length)
|
|
1232
1232
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -1235,7 +1235,7 @@ const ss = (t, e) => {
|
|
|
1235
1235
|
get error() {
|
|
1236
1236
|
if (this._error)
|
|
1237
1237
|
return this._error;
|
|
1238
|
-
const n = new
|
|
1238
|
+
const n = new ie(t.common.issues);
|
|
1239
1239
|
return this._error = n, this._error;
|
|
1240
1240
|
}
|
|
1241
1241
|
};
|
|
@@ -1271,7 +1271,7 @@ class A {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
_processInputParams(e) {
|
|
1273
1273
|
return {
|
|
1274
|
-
status: new
|
|
1274
|
+
status: new X(),
|
|
1275
1275
|
ctx: {
|
|
1276
1276
|
common: e.parent.common,
|
|
1277
1277
|
data: e.data,
|
|
@@ -1330,7 +1330,7 @@ class A {
|
|
|
1330
1330
|
if (!this["~standard"].async)
|
|
1331
1331
|
try {
|
|
1332
1332
|
const a = this._parseSync({ data: e, path: [], parent: s });
|
|
1333
|
-
return
|
|
1333
|
+
return Qe(a) ? {
|
|
1334
1334
|
value: a.value
|
|
1335
1335
|
} : {
|
|
1336
1336
|
issues: s.common.issues
|
|
@@ -1341,7 +1341,7 @@ class A {
|
|
|
1341
1341
|
async: !0
|
|
1342
1342
|
};
|
|
1343
1343
|
}
|
|
1344
|
-
return this._parseAsync({ data: e, path: [], parent: s }).then((a) =>
|
|
1344
|
+
return this._parseAsync({ data: e, path: [], parent: s }).then((a) => Qe(a) ? {
|
|
1345
1345
|
value: a.value
|
|
1346
1346
|
} : {
|
|
1347
1347
|
issues: s.common.issues
|
|
@@ -1511,7 +1511,7 @@ class me extends A {
|
|
|
1511
1511
|
received: s.parsedType
|
|
1512
1512
|
}), E;
|
|
1513
1513
|
}
|
|
1514
|
-
const n = new
|
|
1514
|
+
const n = new X();
|
|
1515
1515
|
let r;
|
|
1516
1516
|
for (const s of this._def.checks)
|
|
1517
1517
|
if (s.kind === "min")
|
|
@@ -1890,7 +1890,7 @@ class Le extends A {
|
|
|
1890
1890
|
}), E;
|
|
1891
1891
|
}
|
|
1892
1892
|
let n;
|
|
1893
|
-
const r = new
|
|
1893
|
+
const r = new X();
|
|
1894
1894
|
for (const s of this._def.checks)
|
|
1895
1895
|
s.kind === "int" ? N.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
1896
1896
|
code: f.invalid_type,
|
|
@@ -2059,7 +2059,7 @@ class $e extends A {
|
|
|
2059
2059
|
if (this._getType(e) !== _.bigint)
|
|
2060
2060
|
return this._getInvalidInput(e);
|
|
2061
2061
|
let n;
|
|
2062
|
-
const r = new
|
|
2062
|
+
const r = new X();
|
|
2063
2063
|
for (const s of this._def.checks)
|
|
2064
2064
|
s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2065
2065
|
code: f.too_small,
|
|
@@ -2188,14 +2188,14 @@ class It extends A {
|
|
|
2188
2188
|
received: n.parsedType
|
|
2189
2189
|
}), E;
|
|
2190
2190
|
}
|
|
2191
|
-
return
|
|
2191
|
+
return te(e.data);
|
|
2192
2192
|
}
|
|
2193
2193
|
}
|
|
2194
2194
|
It.create = (t) => new It(d({
|
|
2195
2195
|
typeName: S.ZodBoolean,
|
|
2196
2196
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2197
2197
|
}, T(t)));
|
|
2198
|
-
class
|
|
2198
|
+
class et extends A {
|
|
2199
2199
|
_parse(e) {
|
|
2200
2200
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== _.date) {
|
|
2201
2201
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2211,7 +2211,7 @@ class Qe extends A {
|
|
|
2211
2211
|
code: f.invalid_date
|
|
2212
2212
|
}), E;
|
|
2213
2213
|
}
|
|
2214
|
-
const n = new
|
|
2214
|
+
const n = new X();
|
|
2215
2215
|
let r;
|
|
2216
2216
|
for (const s of this._def.checks)
|
|
2217
2217
|
s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r), y(r, {
|
|
@@ -2235,7 +2235,7 @@ class Qe extends A {
|
|
|
2235
2235
|
};
|
|
2236
2236
|
}
|
|
2237
2237
|
_addCheck(e) {
|
|
2238
|
-
return new
|
|
2238
|
+
return new et(x(d({}, this._def), {
|
|
2239
2239
|
checks: [...this._def.checks, e]
|
|
2240
2240
|
}));
|
|
2241
2241
|
}
|
|
@@ -2266,7 +2266,7 @@ class Qe extends A {
|
|
|
2266
2266
|
return e != null ? new Date(e) : null;
|
|
2267
2267
|
}
|
|
2268
2268
|
}
|
|
2269
|
-
|
|
2269
|
+
et.create = (t) => new et(d({
|
|
2270
2270
|
checks: [],
|
|
2271
2271
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
2272
2272
|
typeName: S.ZodDate
|
|
@@ -2281,7 +2281,7 @@ class mn extends A {
|
|
|
2281
2281
|
received: n.parsedType
|
|
2282
2282
|
}), E;
|
|
2283
2283
|
}
|
|
2284
|
-
return
|
|
2284
|
+
return te(e.data);
|
|
2285
2285
|
}
|
|
2286
2286
|
}
|
|
2287
2287
|
mn.create = (t) => new mn(d({
|
|
@@ -2297,7 +2297,7 @@ class Pt extends A {
|
|
|
2297
2297
|
received: n.parsedType
|
|
2298
2298
|
}), E;
|
|
2299
2299
|
}
|
|
2300
|
-
return
|
|
2300
|
+
return te(e.data);
|
|
2301
2301
|
}
|
|
2302
2302
|
}
|
|
2303
2303
|
Pt.create = (t) => new Pt(d({
|
|
@@ -2313,7 +2313,7 @@ class Zt extends A {
|
|
|
2313
2313
|
received: n.parsedType
|
|
2314
2314
|
}), E;
|
|
2315
2315
|
}
|
|
2316
|
-
return
|
|
2316
|
+
return te(e.data);
|
|
2317
2317
|
}
|
|
2318
2318
|
}
|
|
2319
2319
|
Zt.create = (t) => new Zt(d({
|
|
@@ -2324,21 +2324,21 @@ class gt extends A {
|
|
|
2324
2324
|
super(...arguments), this._any = !0;
|
|
2325
2325
|
}
|
|
2326
2326
|
_parse(e) {
|
|
2327
|
-
return
|
|
2327
|
+
return te(e.data);
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
2330
2330
|
gt.create = (t) => new gt(d({
|
|
2331
2331
|
typeName: S.ZodAny
|
|
2332
2332
|
}, T(t)));
|
|
2333
|
-
class
|
|
2333
|
+
class Ye extends A {
|
|
2334
2334
|
constructor() {
|
|
2335
2335
|
super(...arguments), this._unknown = !0;
|
|
2336
2336
|
}
|
|
2337
2337
|
_parse(e) {
|
|
2338
|
-
return
|
|
2338
|
+
return te(e.data);
|
|
2339
2339
|
}
|
|
2340
2340
|
}
|
|
2341
|
-
|
|
2341
|
+
Ye.create = (t) => new Ye(d({
|
|
2342
2342
|
typeName: S.ZodUnknown
|
|
2343
2343
|
}, T(t)));
|
|
2344
2344
|
class je extends A {
|
|
@@ -2364,7 +2364,7 @@ class yn extends A {
|
|
|
2364
2364
|
received: n.parsedType
|
|
2365
2365
|
}), E;
|
|
2366
2366
|
}
|
|
2367
|
-
return
|
|
2367
|
+
return te(e.data);
|
|
2368
2368
|
}
|
|
2369
2369
|
}
|
|
2370
2370
|
yn.create = (t) => new yn(d({
|
|
@@ -2406,9 +2406,9 @@ class ye extends A {
|
|
|
2406
2406
|
exact: !1,
|
|
2407
2407
|
message: s.maxLength.message
|
|
2408
2408
|
}), r.dirty()), n.common.async)
|
|
2409
|
-
return Promise.all([...n.data].map((i, o) => s.type._parseAsync(new xe(n, i, n.path, o)))).then((i) =>
|
|
2409
|
+
return Promise.all([...n.data].map((i, o) => s.type._parseAsync(new xe(n, i, n.path, o)))).then((i) => X.mergeArray(r, i));
|
|
2410
2410
|
const a = [...n.data].map((i, o) => s.type._parseSync(new xe(n, i, n.path, o)));
|
|
2411
|
-
return
|
|
2411
|
+
return X.mergeArray(r, a);
|
|
2412
2412
|
}
|
|
2413
2413
|
get element() {
|
|
2414
2414
|
return this._def.type;
|
|
@@ -2524,7 +2524,7 @@ class z extends A {
|
|
|
2524
2524
|
});
|
|
2525
2525
|
}
|
|
2526
2526
|
return c;
|
|
2527
|
-
})).then((c) =>
|
|
2527
|
+
})).then((c) => X.mergeObjectSync(n, c)) : X.mergeObjectSync(n, o);
|
|
2528
2528
|
}
|
|
2529
2529
|
get shape() {
|
|
2530
2530
|
return this._def.shape();
|
|
@@ -2731,7 +2731,7 @@ class Dt extends A {
|
|
|
2731
2731
|
for (const o of a)
|
|
2732
2732
|
if (o.result.status === "dirty")
|
|
2733
2733
|
return n.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2734
|
-
const i = a.map((o) => new
|
|
2734
|
+
const i = a.map((o) => new ie(o.ctx.common.issues));
|
|
2735
2735
|
return y(n, {
|
|
2736
2736
|
code: f.invalid_union,
|
|
2737
2737
|
unionErrors: i
|
|
@@ -2774,7 +2774,7 @@ class Dt extends A {
|
|
|
2774
2774
|
}
|
|
2775
2775
|
if (a)
|
|
2776
2776
|
return n.common.issues.push(...a.ctx.common.issues), a.result;
|
|
2777
|
-
const o = i.map((c) => new
|
|
2777
|
+
const o = i.map((c) => new ie(c));
|
|
2778
2778
|
return y(n, {
|
|
2779
2779
|
code: f.invalid_union,
|
|
2780
2780
|
unionErrors: o
|
|
@@ -2942,7 +2942,7 @@ class Ee extends A {
|
|
|
2942
2942
|
const o = this._def.items[i] || this._def.rest;
|
|
2943
2943
|
return o ? o._parse(new xe(r, a, r.path, i)) : null;
|
|
2944
2944
|
}).filter((a) => !!a);
|
|
2945
|
-
return r.common.async ? Promise.all(s).then((a) =>
|
|
2945
|
+
return r.common.async ? Promise.all(s).then((a) => X.mergeArray(n, a)) : X.mergeArray(n, s);
|
|
2946
2946
|
}
|
|
2947
2947
|
get items() {
|
|
2948
2948
|
return this._def.items;
|
|
@@ -2984,7 +2984,7 @@ class Lt extends A {
|
|
|
2984
2984
|
value: i._parse(new xe(r, r.data[o], r.path, o)),
|
|
2985
2985
|
alwaysSet: o in r.data
|
|
2986
2986
|
});
|
|
2987
|
-
return r.common.async ?
|
|
2987
|
+
return r.common.async ? X.mergeObjectAsync(n, s) : X.mergeObjectSync(n, s);
|
|
2988
2988
|
}
|
|
2989
2989
|
get element() {
|
|
2990
2990
|
return this._def.valueType;
|
|
@@ -3048,7 +3048,7 @@ gn.create = (t, e, n) => new gn(d({
|
|
|
3048
3048
|
keyType: t,
|
|
3049
3049
|
typeName: S.ZodMap
|
|
3050
3050
|
}, T(n)));
|
|
3051
|
-
class
|
|
3051
|
+
class tt extends A {
|
|
3052
3052
|
_parse(e) {
|
|
3053
3053
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
3054
3054
|
if (r.parsedType !== _.set)
|
|
@@ -3087,12 +3087,12 @@ class et extends A {
|
|
|
3087
3087
|
return r.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
3088
3088
|
}
|
|
3089
3089
|
min(e, n) {
|
|
3090
|
-
return new
|
|
3090
|
+
return new tt(x(d({}, this._def), {
|
|
3091
3091
|
minSize: { value: e, message: w.toString(n) }
|
|
3092
3092
|
}));
|
|
3093
3093
|
}
|
|
3094
3094
|
max(e, n) {
|
|
3095
|
-
return new
|
|
3095
|
+
return new tt(x(d({}, this._def), {
|
|
3096
3096
|
maxSize: { value: e, message: w.toString(n) }
|
|
3097
3097
|
}));
|
|
3098
3098
|
}
|
|
@@ -3103,7 +3103,7 @@ class et extends A {
|
|
|
3103
3103
|
return this.min(1, e);
|
|
3104
3104
|
}
|
|
3105
3105
|
}
|
|
3106
|
-
|
|
3106
|
+
tt.create = (t, e) => new tt(d({
|
|
3107
3107
|
valueType: t,
|
|
3108
3108
|
minSize: null,
|
|
3109
3109
|
maxSize: null,
|
|
@@ -3156,9 +3156,9 @@ class ht extends A {
|
|
|
3156
3156
|
const a = { errorMap: n.common.contextualErrorMap }, i = n.data;
|
|
3157
3157
|
if (this._def.returns instanceof vt) {
|
|
3158
3158
|
const o = this;
|
|
3159
|
-
return
|
|
3159
|
+
return te(function(...c) {
|
|
3160
3160
|
return Se(this, null, function* () {
|
|
3161
|
-
const u = new
|
|
3161
|
+
const u = new ie([]), h = yield o._def.args.parseAsync(c, a).catch((k) => {
|
|
3162
3162
|
throw u.addIssue(r(c, k)), u;
|
|
3163
3163
|
}), p = yield Reflect.apply(i, this, h);
|
|
3164
3164
|
return yield o._def.returns._def.type.parseAsync(p, a).catch((k) => {
|
|
@@ -3168,13 +3168,13 @@ class ht extends A {
|
|
|
3168
3168
|
});
|
|
3169
3169
|
} else {
|
|
3170
3170
|
const o = this;
|
|
3171
|
-
return
|
|
3171
|
+
return te(function(...c) {
|
|
3172
3172
|
const u = o._def.args.safeParse(c, a);
|
|
3173
3173
|
if (!u.success)
|
|
3174
|
-
throw new
|
|
3174
|
+
throw new ie([r(c, u.error)]);
|
|
3175
3175
|
const h = Reflect.apply(i, this, u.data), p = o._def.returns.safeParse(h, a);
|
|
3176
3176
|
if (!p.success)
|
|
3177
|
-
throw new
|
|
3177
|
+
throw new ie([s(h, p.error)]);
|
|
3178
3178
|
return p.data;
|
|
3179
3179
|
});
|
|
3180
3180
|
}
|
|
@@ -3187,7 +3187,7 @@ class ht extends A {
|
|
|
3187
3187
|
}
|
|
3188
3188
|
args(...e) {
|
|
3189
3189
|
return new ht(x(d({}, this._def), {
|
|
3190
|
-
args: Ee.create(e).rest(
|
|
3190
|
+
args: Ee.create(e).rest(Ye.create())
|
|
3191
3191
|
}));
|
|
3192
3192
|
}
|
|
3193
3193
|
returns(e) {
|
|
@@ -3203,8 +3203,8 @@ class ht extends A {
|
|
|
3203
3203
|
}
|
|
3204
3204
|
static create(e, n, r) {
|
|
3205
3205
|
return new ht(d({
|
|
3206
|
-
args: e || Ee.create([]).rest(
|
|
3207
|
-
returns: n ||
|
|
3206
|
+
args: e || Ee.create([]).rest(Ye.create()),
|
|
3207
|
+
returns: n || Ye.create(),
|
|
3208
3208
|
typeName: S.ZodFunction
|
|
3209
3209
|
}, T(r)));
|
|
3210
3210
|
}
|
|
@@ -3269,7 +3269,7 @@ class Fe extends A {
|
|
|
3269
3269
|
options: r
|
|
3270
3270
|
}), E;
|
|
3271
3271
|
}
|
|
3272
|
-
return
|
|
3272
|
+
return te(e.data);
|
|
3273
3273
|
}
|
|
3274
3274
|
get options() {
|
|
3275
3275
|
return this._def.values;
|
|
@@ -3323,7 +3323,7 @@ class Wt extends A {
|
|
|
3323
3323
|
options: s
|
|
3324
3324
|
}), E;
|
|
3325
3325
|
}
|
|
3326
|
-
return
|
|
3326
|
+
return te(e.data);
|
|
3327
3327
|
}
|
|
3328
3328
|
get enum() {
|
|
3329
3329
|
return this._def.values;
|
|
@@ -3347,7 +3347,7 @@ class vt extends A {
|
|
|
3347
3347
|
received: n.parsedType
|
|
3348
3348
|
}), E;
|
|
3349
3349
|
const r = n.parsedType === _.promise ? n.data : Promise.resolve(n.data);
|
|
3350
|
-
return
|
|
3350
|
+
return te(r.then((s) => this._def.type.parseAsync(s, {
|
|
3351
3351
|
path: n.path,
|
|
3352
3352
|
errorMap: n.common.contextualErrorMap
|
|
3353
3353
|
})));
|
|
@@ -3423,14 +3423,14 @@ class ge extends A {
|
|
|
3423
3423
|
path: r.path,
|
|
3424
3424
|
parent: r
|
|
3425
3425
|
});
|
|
3426
|
-
if (!
|
|
3426
|
+
if (!Qe(i))
|
|
3427
3427
|
return i;
|
|
3428
3428
|
const o = s.transform(i.value, a);
|
|
3429
3429
|
if (o instanceof Promise)
|
|
3430
3430
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3431
3431
|
return { status: n.value, value: o };
|
|
3432
3432
|
} else
|
|
3433
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) =>
|
|
3433
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) => Qe(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: n.value, value: o })) : i);
|
|
3434
3434
|
N.assertNever(s);
|
|
3435
3435
|
}
|
|
3436
3436
|
}
|
|
@@ -3446,7 +3446,7 @@ ge.createWithPreprocess = (t, e, n) => new ge(d({
|
|
|
3446
3446
|
}, T(n)));
|
|
3447
3447
|
class ke extends A {
|
|
3448
3448
|
_parse(e) {
|
|
3449
|
-
return this._getType(e) === _.undefined ?
|
|
3449
|
+
return this._getType(e) === _.undefined ? te(void 0) : this._def.innerType._parse(e);
|
|
3450
3450
|
}
|
|
3451
3451
|
unwrap() {
|
|
3452
3452
|
return this._def.innerType;
|
|
@@ -3458,7 +3458,7 @@ ke.create = (t, e) => new ke(d({
|
|
|
3458
3458
|
}, T(e)));
|
|
3459
3459
|
class We extends A {
|
|
3460
3460
|
_parse(e) {
|
|
3461
|
-
return this._getType(e) === _.null ?
|
|
3461
|
+
return this._getType(e) === _.null ? te(null) : this._def.innerType._parse(e);
|
|
3462
3462
|
}
|
|
3463
3463
|
unwrap() {
|
|
3464
3464
|
return this._def.innerType;
|
|
@@ -3502,7 +3502,7 @@ class Ut extends A {
|
|
|
3502
3502
|
status: "valid",
|
|
3503
3503
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
3504
3504
|
get error() {
|
|
3505
|
-
return new
|
|
3505
|
+
return new ie(r.common.issues);
|
|
3506
3506
|
},
|
|
3507
3507
|
input: r.data
|
|
3508
3508
|
})
|
|
@@ -3510,7 +3510,7 @@ class Ut extends A {
|
|
|
3510
3510
|
status: "valid",
|
|
3511
3511
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
3512
3512
|
get error() {
|
|
3513
|
-
return new
|
|
3513
|
+
return new ie(r.common.issues);
|
|
3514
3514
|
},
|
|
3515
3515
|
input: r.data
|
|
3516
3516
|
})
|
|
@@ -3597,7 +3597,7 @@ class Jt extends A {
|
|
|
3597
3597
|
}
|
|
3598
3598
|
class Vt extends A {
|
|
3599
3599
|
_parse(e) {
|
|
3600
|
-
const n = this._def.innerType._parse(e), r = (s) => (
|
|
3600
|
+
const n = this._def.innerType._parse(e), r = (s) => (Qe(s) && (s.value = Object.freeze(s.value)), s);
|
|
3601
3601
|
return jt(n) ? n.then((s) => r(s)) : r(n);
|
|
3602
3602
|
}
|
|
3603
3603
|
unwrap() {
|
|
@@ -3639,16 +3639,16 @@ var S;
|
|
|
3639
3639
|
})(S || (S = {}));
|
|
3640
3640
|
const ro = (t, e = {
|
|
3641
3641
|
message: `Input not instance of ${t.name}`
|
|
3642
|
-
}) => Ms((n) => n instanceof t, e), Ls = me.create, $s = Le.create, so = vn.create, ao = $e.create, Fs = It.create, io =
|
|
3642
|
+
}) => Ms((n) => n instanceof t, e), Ls = me.create, $s = Le.create, so = vn.create, ao = $e.create, Fs = It.create, io = et.create, oo = mn.create, co = Pt.create, uo = Zt.create, lo = gt.create, fo = Ye.create, ho = je.create, po = yn.create, mo = ye.create, yo = z.create, go = z.strictCreate, vo = Dt.create, _o = Sn.create, bo = Mt.create, wo = Ee.create, ko = Lt.create, So = gn.create, xo = tt.create, Eo = ht.create, Oo = $t.create, To = Ft.create, Ao = Fe.create, Co = Wt.create, No = vt.create, is = ge.create, Ro = ke.create, jo = We.create, Io = ge.createWithPreprocess, Po = Jt.create, Zo = () => Ls().optional(), Do = () => $s().optional(), Mo = () => Fs().optional(), Lo = {
|
|
3643
3643
|
string: (t) => me.create(x(d({}, t), { coerce: !0 })),
|
|
3644
3644
|
number: (t) => Le.create(x(d({}, t), { coerce: !0 })),
|
|
3645
3645
|
boolean: (t) => It.create(x(d({}, t), {
|
|
3646
3646
|
coerce: !0
|
|
3647
3647
|
})),
|
|
3648
3648
|
bigint: (t) => $e.create(x(d({}, t), { coerce: !0 })),
|
|
3649
|
-
date: (t) =>
|
|
3649
|
+
date: (t) => et.create(x(d({}, t), { coerce: !0 }))
|
|
3650
3650
|
}, $o = E;
|
|
3651
|
-
var
|
|
3651
|
+
var I = /* @__PURE__ */ Object.freeze({
|
|
3652
3652
|
__proto__: null,
|
|
3653
3653
|
defaultErrorMap: yt,
|
|
3654
3654
|
setErrorMap: ji,
|
|
@@ -3656,13 +3656,13 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3656
3656
|
makeIssue: fn,
|
|
3657
3657
|
EMPTY_PATH: Ii,
|
|
3658
3658
|
addIssueToContext: y,
|
|
3659
|
-
ParseStatus:
|
|
3659
|
+
ParseStatus: X,
|
|
3660
3660
|
INVALID: E,
|
|
3661
3661
|
DIRTY: hn,
|
|
3662
|
-
OK:
|
|
3662
|
+
OK: te,
|
|
3663
3663
|
isAborted: nr,
|
|
3664
3664
|
isDirty: rr,
|
|
3665
|
-
isValid:
|
|
3665
|
+
isValid: Qe,
|
|
3666
3666
|
isAsync: jt,
|
|
3667
3667
|
get util() {
|
|
3668
3668
|
return N;
|
|
@@ -3678,12 +3678,12 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3678
3678
|
ZodNumber: Le,
|
|
3679
3679
|
ZodBigInt: $e,
|
|
3680
3680
|
ZodBoolean: It,
|
|
3681
|
-
ZodDate:
|
|
3681
|
+
ZodDate: et,
|
|
3682
3682
|
ZodSymbol: mn,
|
|
3683
3683
|
ZodUndefined: Pt,
|
|
3684
3684
|
ZodNull: Zt,
|
|
3685
3685
|
ZodAny: gt,
|
|
3686
|
-
ZodUnknown:
|
|
3686
|
+
ZodUnknown: Ye,
|
|
3687
3687
|
ZodNever: je,
|
|
3688
3688
|
ZodVoid: yn,
|
|
3689
3689
|
ZodArray: ye,
|
|
@@ -3694,7 +3694,7 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3694
3694
|
ZodTuple: Ee,
|
|
3695
3695
|
ZodRecord: Lt,
|
|
3696
3696
|
ZodMap: gn,
|
|
3697
|
-
ZodSet:
|
|
3697
|
+
ZodSet: tt,
|
|
3698
3698
|
ZodFunction: ht,
|
|
3699
3699
|
ZodLazy: $t,
|
|
3700
3700
|
ZodLiteral: Ft,
|
|
@@ -3762,20 +3762,20 @@ var j = /* @__PURE__ */ Object.freeze({
|
|
|
3762
3762
|
NEVER: $o,
|
|
3763
3763
|
ZodIssueCode: f,
|
|
3764
3764
|
quotelessJson: Ri,
|
|
3765
|
-
ZodError:
|
|
3765
|
+
ZodError: ie
|
|
3766
3766
|
});
|
|
3767
|
-
|
|
3768
|
-
language:
|
|
3769
|
-
disableMarkedForExport:
|
|
3770
|
-
allowAutoSelectFirstNode:
|
|
3771
|
-
enableDisplayDataId:
|
|
3772
|
-
enableDisplayDataName:
|
|
3767
|
+
I.object({
|
|
3768
|
+
language: I.enum(["typescript", "javascript"]).optional(),
|
|
3769
|
+
disableMarkedForExport: I.boolean().optional(),
|
|
3770
|
+
allowAutoSelectFirstNode: I.boolean().optional().default(!0),
|
|
3771
|
+
enableDisplayDataId: I.boolean().optional(),
|
|
3772
|
+
enableDisplayDataName: I.boolean().optional()
|
|
3773
3773
|
}).and(
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
framework:
|
|
3777
|
-
model:
|
|
3778
|
-
styling:
|
|
3774
|
+
I.union([
|
|
3775
|
+
I.object({
|
|
3776
|
+
framework: I.literal("react"),
|
|
3777
|
+
model: I.string().optional(),
|
|
3778
|
+
styling: I.enum([
|
|
3779
3779
|
"plain_css",
|
|
3780
3780
|
"css_modules",
|
|
3781
3781
|
"styled_components",
|
|
@@ -3784,27 +3784,27 @@ j.object({
|
|
|
3784
3784
|
"scss",
|
|
3785
3785
|
"inline_styles"
|
|
3786
3786
|
]),
|
|
3787
|
-
uiLibrary:
|
|
3788
|
-
responsivePages:
|
|
3789
|
-
|
|
3790
|
-
name:
|
|
3791
|
-
framesId:
|
|
3787
|
+
uiLibrary: I.enum(["mui", "antd", "radix", "shadcn", "clean_react"]).optional(),
|
|
3788
|
+
responsivePages: I.array(
|
|
3789
|
+
I.object({
|
|
3790
|
+
name: I.string(),
|
|
3791
|
+
framesId: I.array(I.string())
|
|
3792
3792
|
})
|
|
3793
3793
|
).optional(),
|
|
3794
|
-
enableUILibraryTheming:
|
|
3795
|
-
enableCompactStructure:
|
|
3796
|
-
enableDisplayScreenModelId:
|
|
3797
|
-
enableGeneratePackageLock:
|
|
3798
|
-
enableAnimationsPreset:
|
|
3799
|
-
enableAutoSplit:
|
|
3800
|
-
autoSplitThreshold:
|
|
3801
|
-
url:
|
|
3802
|
-
codegenSettings:
|
|
3794
|
+
enableUILibraryTheming: I.boolean().optional(),
|
|
3795
|
+
enableCompactStructure: I.boolean().optional(),
|
|
3796
|
+
enableDisplayScreenModelId: I.boolean().optional(),
|
|
3797
|
+
enableGeneratePackageLock: I.boolean().optional(),
|
|
3798
|
+
enableAnimationsPreset: I.boolean().optional(),
|
|
3799
|
+
enableAutoSplit: I.boolean().optional(),
|
|
3800
|
+
autoSplitThreshold: I.number().optional(),
|
|
3801
|
+
url: I.string().url().optional(),
|
|
3802
|
+
codegenSettings: I.record(I.unknown()).optional()
|
|
3803
3803
|
}),
|
|
3804
|
-
|
|
3805
|
-
framework:
|
|
3806
|
-
styling:
|
|
3807
|
-
enableTranslation:
|
|
3804
|
+
I.object({
|
|
3805
|
+
framework: I.literal("html"),
|
|
3806
|
+
styling: I.enum(["plain_css", "inline_styles", "tailwind"]),
|
|
3807
|
+
enableTranslation: I.boolean().optional()
|
|
3808
3808
|
})
|
|
3809
3809
|
])
|
|
3810
3810
|
);
|
|
@@ -3824,8 +3824,8 @@ function Fo(t) {
|
|
|
3824
3824
|
let a = "", i = !0, o, c = "", u = "";
|
|
3825
3825
|
function h(m) {
|
|
3826
3826
|
const g = i ? m.replace(/^\xEF\xBB\xBF/, "") : m, [l, O] = Wo(`${a}${g}`);
|
|
3827
|
-
for (const
|
|
3828
|
-
p(
|
|
3827
|
+
for (const P of l)
|
|
3828
|
+
p(P);
|
|
3829
3829
|
a = O, i = !1;
|
|
3830
3830
|
}
|
|
3831
3831
|
function p(m) {
|
|
@@ -3839,8 +3839,8 @@ function Fo(t) {
|
|
|
3839
3839
|
}
|
|
3840
3840
|
const g = m.indexOf(":");
|
|
3841
3841
|
if (g !== -1) {
|
|
3842
|
-
const l = m.slice(0, g), O = m[g + 1] === " " ? 2 : 1,
|
|
3843
|
-
k(l,
|
|
3842
|
+
const l = m.slice(0, g), O = m[g + 1] === " " ? 2 : 1, P = m.slice(g + O);
|
|
3843
|
+
k(l, P, m);
|
|
3844
3844
|
return;
|
|
3845
3845
|
}
|
|
3846
3846
|
k(m, "", m);
|
|
@@ -3970,11 +3970,11 @@ function us(t) {
|
|
|
3970
3970
|
}
|
|
3971
3971
|
var Ws = (t) => {
|
|
3972
3972
|
throw TypeError(t);
|
|
3973
|
-
}, Rr = (t, e, n) => e.has(t) || Ws("Cannot " + n), C = (t, e, n) => (Rr(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? Ws("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), W = (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),
|
|
3973
|
+
}, Rr = (t, e, n) => e.has(t) || Ws("Cannot " + n), C = (t, e, n) => (Rr(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? Ws("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), W = (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), re, Xe, ut, un, _n, Nt, ft, Rt, De, dt, pt, lt, At, pe, ir, or, cr, ds, ur, dr, Ct, lr, fr;
|
|
3974
3974
|
class dn extends EventTarget {
|
|
3975
3975
|
constructor(e, n) {
|
|
3976
3976
|
var r, s;
|
|
3977
|
-
super(), q(this, pe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, q(this,
|
|
3977
|
+
super(), q(this, pe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, q(this, re), q(this, Xe), q(this, ut), q(this, un), q(this, _n), q(this, Nt), q(this, ft), q(this, Rt, null), q(this, De), q(this, dt), q(this, pt, null), q(this, lt, null), q(this, At, null), q(this, or, (a) => Ie(this, null, function* () {
|
|
3978
3978
|
var i;
|
|
3979
3979
|
C(this, dt).reset();
|
|
3980
3980
|
const { body: o, redirected: c, status: u, headers: h } = a;
|
|
@@ -3990,9 +3990,9 @@ class dn extends EventTarget {
|
|
|
3990
3990
|
Ce(this, pe, Ct).call(this, 'Invalid content type, expected "text/event-stream"', u);
|
|
3991
3991
|
return;
|
|
3992
3992
|
}
|
|
3993
|
-
if (C(this,
|
|
3993
|
+
if (C(this, re) === this.CLOSED)
|
|
3994
3994
|
return;
|
|
3995
|
-
W(this,
|
|
3995
|
+
W(this, re, this.OPEN);
|
|
3996
3996
|
const p = new Event("open");
|
|
3997
3997
|
if ((i = C(this, At)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
|
|
3998
3998
|
Ce(this, pe, Ct).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
|
|
@@ -4010,20 +4010,20 @@ class dn extends EventTarget {
|
|
|
4010
4010
|
typeof a.id == "string" && W(this, Rt, a.id);
|
|
4011
4011
|
const i = new MessageEvent(a.event || "message", {
|
|
4012
4012
|
data: a.data,
|
|
4013
|
-
origin: C(this, ut) ? C(this, ut).origin : C(this,
|
|
4013
|
+
origin: C(this, ut) ? C(this, ut).origin : C(this, Xe).origin,
|
|
4014
4014
|
lastEventId: a.id || ""
|
|
4015
4015
|
});
|
|
4016
4016
|
C(this, lt) && (!a.event || a.event === "message") && C(this, lt).call(this, i), this.dispatchEvent(i);
|
|
4017
4017
|
}), q(this, dr, (a) => {
|
|
4018
4018
|
W(this, Nt, a);
|
|
4019
4019
|
}), q(this, fr, () => {
|
|
4020
|
-
W(this, ft, void 0), C(this,
|
|
4020
|
+
W(this, ft, void 0), C(this, re) === this.CONNECTING && Ce(this, pe, ir).call(this);
|
|
4021
4021
|
});
|
|
4022
4022
|
try {
|
|
4023
4023
|
if (e instanceof URL)
|
|
4024
|
-
W(this,
|
|
4024
|
+
W(this, Xe, e);
|
|
4025
4025
|
else if (typeof e == "string")
|
|
4026
|
-
W(this,
|
|
4026
|
+
W(this, Xe, new URL(e, Uo()));
|
|
4027
4027
|
else
|
|
4028
4028
|
throw new Error("Invalid URL");
|
|
4029
4029
|
} catch (a) {
|
|
@@ -4032,7 +4032,7 @@ class dn extends EventTarget {
|
|
|
4032
4032
|
W(this, dt, Fo({
|
|
4033
4033
|
onEvent: C(this, ur),
|
|
4034
4034
|
onRetry: C(this, dr)
|
|
4035
|
-
})), W(this,
|
|
4035
|
+
})), W(this, re, this.CONNECTING), W(this, Nt, 3e3), W(this, _n, (r = n == null ? void 0 : n.fetch) != null ? r : globalThis.fetch), W(this, un, (s = n == null ? void 0 : n.withCredentials) != null ? s : !1), Ce(this, pe, ir).call(this);
|
|
4036
4036
|
}
|
|
4037
4037
|
/**
|
|
4038
4038
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -4045,7 +4045,7 @@ class dn extends EventTarget {
|
|
|
4045
4045
|
* @public
|
|
4046
4046
|
*/
|
|
4047
4047
|
get readyState() {
|
|
4048
|
-
return C(this,
|
|
4048
|
+
return C(this, re);
|
|
4049
4049
|
}
|
|
4050
4050
|
/**
|
|
4051
4051
|
* Returns the URL providing the event stream.
|
|
@@ -4055,7 +4055,7 @@ class dn extends EventTarget {
|
|
|
4055
4055
|
* @public
|
|
4056
4056
|
*/
|
|
4057
4057
|
get url() {
|
|
4058
|
-
return C(this,
|
|
4058
|
+
return C(this, Xe).href;
|
|
4059
4059
|
}
|
|
4060
4060
|
/**
|
|
4061
4061
|
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
@@ -4102,16 +4102,16 @@ class dn extends EventTarget {
|
|
|
4102
4102
|
* @public
|
|
4103
4103
|
*/
|
|
4104
4104
|
close() {
|
|
4105
|
-
C(this, ft) && clearTimeout(C(this, ft)), C(this,
|
|
4105
|
+
C(this, ft) && clearTimeout(C(this, ft)), C(this, re) !== this.CLOSED && (C(this, De) && C(this, De).abort(), W(this, re, this.CLOSED), W(this, De, void 0));
|
|
4106
4106
|
}
|
|
4107
4107
|
}
|
|
4108
|
-
|
|
4108
|
+
re = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakSet(), /**
|
|
4109
4109
|
* Connect to the given URL and start receiving events
|
|
4110
4110
|
*
|
|
4111
4111
|
* @internal
|
|
4112
4112
|
*/
|
|
4113
4113
|
ir = function() {
|
|
4114
|
-
W(this,
|
|
4114
|
+
W(this, re, this.CONNECTING), W(this, De, new AbortController()), C(this, _n)(C(this, Xe), Ce(this, pe, ds).call(this)).then(C(this, or)).catch(C(this, cr));
|
|
4115
4115
|
}, or = /* @__PURE__ */ new WeakMap(), cr = /* @__PURE__ */ new WeakMap(), /**
|
|
4116
4116
|
* Get request options for the `fetch()` request
|
|
4117
4117
|
*
|
|
@@ -4125,7 +4125,7 @@ ds = function() {
|
|
|
4125
4125
|
// [spec] …will have their mode set to "cors"…
|
|
4126
4126
|
mode: "cors",
|
|
4127
4127
|
redirect: "follow",
|
|
4128
|
-
headers:
|
|
4128
|
+
headers: Be({ Accept: "text/event-stream" }, C(this, Rt) ? { "Last-Event-ID": C(this, Rt) } : void 0),
|
|
4129
4129
|
cache: "no-store",
|
|
4130
4130
|
signal: (t = C(this, De)) == null ? void 0 : t.signal
|
|
4131
4131
|
};
|
|
@@ -4139,7 +4139,7 @@ ds = function() {
|
|
|
4139
4139
|
*/
|
|
4140
4140
|
Ct = function(t, e) {
|
|
4141
4141
|
var n;
|
|
4142
|
-
C(this,
|
|
4142
|
+
C(this, re) !== this.CLOSED && W(this, re, this.CLOSED);
|
|
4143
4143
|
const r = new cs("error", { code: e, message: t });
|
|
4144
4144
|
(n = C(this, pt)) == null || n.call(this, r), this.dispatchEvent(r);
|
|
4145
4145
|
}, /**
|
|
@@ -4151,9 +4151,9 @@ Ct = function(t, e) {
|
|
|
4151
4151
|
*/
|
|
4152
4152
|
lr = function(t, e) {
|
|
4153
4153
|
var n;
|
|
4154
|
-
if (C(this,
|
|
4154
|
+
if (C(this, re) === this.CLOSED)
|
|
4155
4155
|
return;
|
|
4156
|
-
W(this,
|
|
4156
|
+
W(this, re, this.CONNECTING);
|
|
4157
4157
|
const r = new cs("error", { code: e, message: t });
|
|
4158
4158
|
(n = C(this, pt)) == null || n.call(this, r), this.dispatchEvent(r), W(this, ft, setTimeout(C(this, fr), C(this, Nt)));
|
|
4159
4159
|
}, fr = /* @__PURE__ */ new WeakMap(), /**
|
|
@@ -4176,7 +4176,7 @@ function Uo() {
|
|
|
4176
4176
|
const t = "document" in globalThis ? globalThis.document : void 0;
|
|
4177
4177
|
return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
|
|
4178
4178
|
}
|
|
4179
|
-
var zs = Symbol.for("immer-nothing"), ls = Symbol.for("immer-draftable"),
|
|
4179
|
+
var zs = Symbol.for("immer-nothing"), ls = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"), Vo = process.env.NODE_ENV !== "production" ? [
|
|
4180
4180
|
// All error codes, starting by 0:
|
|
4181
4181
|
function(t) {
|
|
4182
4182
|
return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
|
|
@@ -4207,7 +4207,7 @@ var zs = Symbol.for("immer-nothing"), ls = Symbol.for("immer-draftable"), ce = S
|
|
|
4207
4207
|
// Note: if more errors are added, the errorOffset in Patches.ts should be increased
|
|
4208
4208
|
// See Patches.ts for additional errors
|
|
4209
4209
|
] : [];
|
|
4210
|
-
function
|
|
4210
|
+
function se(t, ...e) {
|
|
4211
4211
|
if (process.env.NODE_ENV !== "production") {
|
|
4212
4212
|
const n = Vo[t], r = typeof n == "function" ? n.apply(null, e) : n;
|
|
4213
4213
|
throw new Error(`[Immer] ${r}`);
|
|
@@ -4218,9 +4218,9 @@ function ae(t, ...e) {
|
|
|
4218
4218
|
}
|
|
4219
4219
|
var _t = Object.getPrototypeOf;
|
|
4220
4220
|
function bt(t) {
|
|
4221
|
-
return !!t && !!t[
|
|
4221
|
+
return !!t && !!t[oe];
|
|
4222
4222
|
}
|
|
4223
|
-
function
|
|
4223
|
+
function nt(t) {
|
|
4224
4224
|
var e;
|
|
4225
4225
|
return t ? Us(t) || Array.isArray(t) || !!t[ls] || !!((e = t.constructor) != null && e[ls]) || En(t) || On(t) : !1;
|
|
4226
4226
|
}
|
|
@@ -4240,7 +4240,7 @@ function bn(t, e) {
|
|
|
4240
4240
|
}) : t.forEach((n, r) => e(r, n, t));
|
|
4241
4241
|
}
|
|
4242
4242
|
function xn(t) {
|
|
4243
|
-
const e = t[
|
|
4243
|
+
const e = t[oe];
|
|
4244
4244
|
return e ? e.type_ : Array.isArray(t) ? 1 : En(t) ? 2 : On(t) ? 3 : 0;
|
|
4245
4245
|
}
|
|
4246
4246
|
function hr(t, e) {
|
|
@@ -4259,7 +4259,7 @@ function En(t) {
|
|
|
4259
4259
|
function On(t) {
|
|
4260
4260
|
return t instanceof Set;
|
|
4261
4261
|
}
|
|
4262
|
-
function
|
|
4262
|
+
function He(t) {
|
|
4263
4263
|
return t.copy_ || t.base_;
|
|
4264
4264
|
}
|
|
4265
4265
|
function pr(t, e) {
|
|
@@ -4272,7 +4272,7 @@ function pr(t, e) {
|
|
|
4272
4272
|
const n = Us(t);
|
|
4273
4273
|
if (e === !0 || e === "class_only" && !n) {
|
|
4274
4274
|
const r = Object.getOwnPropertyDescriptors(t);
|
|
4275
|
-
delete r[
|
|
4275
|
+
delete r[oe];
|
|
4276
4276
|
let s = Reflect.ownKeys(r);
|
|
4277
4277
|
for (let a = 0; a < s.length; a++) {
|
|
4278
4278
|
const i = s[a], o = r[i];
|
|
@@ -4288,24 +4288,24 @@ function pr(t, e) {
|
|
|
4288
4288
|
} else {
|
|
4289
4289
|
const r = _t(t);
|
|
4290
4290
|
if (r !== null && n)
|
|
4291
|
-
return
|
|
4291
|
+
return Be({}, t);
|
|
4292
4292
|
const s = Object.create(r);
|
|
4293
4293
|
return Object.assign(s, t);
|
|
4294
4294
|
}
|
|
4295
4295
|
}
|
|
4296
4296
|
function Kt(t, e = !1) {
|
|
4297
|
-
return Tn(t) || bt(t) || !
|
|
4297
|
+
return Tn(t) || bt(t) || !nt(t) || (xn(t) > 1 && (t.set = t.add = t.clear = t.delete = qo), Object.freeze(t), e && Object.entries(t).forEach(([n, r]) => Kt(r, !0))), t;
|
|
4298
4298
|
}
|
|
4299
4299
|
function qo() {
|
|
4300
|
-
|
|
4300
|
+
se(2);
|
|
4301
4301
|
}
|
|
4302
4302
|
function Tn(t) {
|
|
4303
4303
|
return Object.isFrozen(t);
|
|
4304
4304
|
}
|
|
4305
4305
|
var Ho = {};
|
|
4306
|
-
function
|
|
4306
|
+
function rt(t) {
|
|
4307
4307
|
const e = Ho[t];
|
|
4308
|
-
return e ||
|
|
4308
|
+
return e || se(0, t), e;
|
|
4309
4309
|
}
|
|
4310
4310
|
var Bt;
|
|
4311
4311
|
function Ks() {
|
|
@@ -4323,7 +4323,7 @@ function Go(t, e) {
|
|
|
4323
4323
|
};
|
|
4324
4324
|
}
|
|
4325
4325
|
function fs(t, e) {
|
|
4326
|
-
e && (
|
|
4326
|
+
e && (rt("Patches"), t.patches_ = [], t.inversePatches_ = [], t.patchListener_ = e);
|
|
4327
4327
|
}
|
|
4328
4328
|
function mr(t) {
|
|
4329
4329
|
yr(t), t.drafts_.forEach(Jo), t.drafts_ = null;
|
|
@@ -4335,14 +4335,14 @@ function hs(t) {
|
|
|
4335
4335
|
return Bt = Go(Bt, t);
|
|
4336
4336
|
}
|
|
4337
4337
|
function Jo(t) {
|
|
4338
|
-
const e = t[
|
|
4338
|
+
const e = t[oe];
|
|
4339
4339
|
e.type_ === 0 || e.type_ === 1 ? e.revoke_() : e.revoked_ = !0;
|
|
4340
4340
|
}
|
|
4341
4341
|
function ps(t, e) {
|
|
4342
4342
|
e.unfinalizedDrafts_ = e.drafts_.length;
|
|
4343
4343
|
const n = e.drafts_[0];
|
|
4344
|
-
return t !== void 0 && t !== n ? (n[
|
|
4345
|
-
n[
|
|
4344
|
+
return t !== void 0 && t !== n ? (n[oe].modified_ && (mr(e), se(4)), nt(t) && (t = wn(e, t), e.parent_ || kn(e, t)), e.patches_ && rt("Patches").generateReplacementPatches_(
|
|
4345
|
+
n[oe].base_,
|
|
4346
4346
|
t,
|
|
4347
4347
|
e.patches_,
|
|
4348
4348
|
e.inversePatches_
|
|
@@ -4351,7 +4351,7 @@ function ps(t, e) {
|
|
|
4351
4351
|
function wn(t, e, n) {
|
|
4352
4352
|
if (Tn(e))
|
|
4353
4353
|
return e;
|
|
4354
|
-
const r = e[
|
|
4354
|
+
const r = e[oe];
|
|
4355
4355
|
if (!r)
|
|
4356
4356
|
return bn(
|
|
4357
4357
|
e,
|
|
@@ -4368,7 +4368,7 @@ function wn(t, e, n) {
|
|
|
4368
4368
|
r.type_ === 3 && (a = new Set(s), s.clear(), i = !0), bn(
|
|
4369
4369
|
a,
|
|
4370
4370
|
(o, c) => ms(t, r, s, o, c, n, i)
|
|
4371
|
-
), kn(t, s, !1), n && t.patches_ &&
|
|
4371
|
+
), kn(t, s, !1), n && t.patches_ && rt("Patches").generatePatches_(
|
|
4372
4372
|
r,
|
|
4373
4373
|
n,
|
|
4374
4374
|
t.patches_,
|
|
@@ -4378,7 +4378,7 @@ function wn(t, e, n) {
|
|
|
4378
4378
|
return r.copy_;
|
|
4379
4379
|
}
|
|
4380
4380
|
function ms(t, e, n, r, s, a, i) {
|
|
4381
|
-
if (process.env.NODE_ENV !== "production" && s === n &&
|
|
4381
|
+
if (process.env.NODE_ENV !== "production" && s === n && se(5), bt(s)) {
|
|
4382
4382
|
const o = a && e && e.type_ !== 3 && // Set objects are atomic since they have no keys.
|
|
4383
4383
|
!hr(e.assigned_, r) ? a.concat(r) : void 0, c = wn(t, s, o);
|
|
4384
4384
|
if (Vs(n, r, c), bt(c))
|
|
@@ -4386,7 +4386,7 @@ function ms(t, e, n, r, s, a, i) {
|
|
|
4386
4386
|
else
|
|
4387
4387
|
return;
|
|
4388
4388
|
} else i && n.add(s);
|
|
4389
|
-
if (
|
|
4389
|
+
if (nt(s) && !Tn(s)) {
|
|
4390
4390
|
if (!t.immer_.autoFreeze_ && t.unfinalizedDrafts_ < 1)
|
|
4391
4391
|
return;
|
|
4392
4392
|
wn(t, s), (!e || !e.scope_.parent_) && typeof r != "symbol" && Object.prototype.propertyIsEnumerable.call(n, r) && kn(t, s);
|
|
@@ -4426,26 +4426,26 @@ function Xo(t, e) {
|
|
|
4426
4426
|
}
|
|
4427
4427
|
var jr = {
|
|
4428
4428
|
get(t, e) {
|
|
4429
|
-
if (e ===
|
|
4429
|
+
if (e === oe)
|
|
4430
4430
|
return t;
|
|
4431
|
-
const n =
|
|
4431
|
+
const n = He(t);
|
|
4432
4432
|
if (!hr(n, e))
|
|
4433
4433
|
return Yo(t, n, e);
|
|
4434
4434
|
const r = n[e];
|
|
4435
|
-
return t.finalized_ || !
|
|
4435
|
+
return t.finalized_ || !nt(r) ? r : r === Dn(t.base_, e) ? (Mn(t), t.copy_[e] = vr(r, t)) : r;
|
|
4436
4436
|
},
|
|
4437
4437
|
has(t, e) {
|
|
4438
|
-
return e in
|
|
4438
|
+
return e in He(t);
|
|
4439
4439
|
},
|
|
4440
4440
|
ownKeys(t) {
|
|
4441
|
-
return Reflect.ownKeys(
|
|
4441
|
+
return Reflect.ownKeys(He(t));
|
|
4442
4442
|
},
|
|
4443
4443
|
set(t, e, n) {
|
|
4444
|
-
const r = Bs(
|
|
4444
|
+
const r = Bs(He(t), e);
|
|
4445
4445
|
if (r != null && r.set)
|
|
4446
4446
|
return r.set.call(t.draft_, n), !0;
|
|
4447
4447
|
if (!t.modified_) {
|
|
4448
|
-
const s = Dn(
|
|
4448
|
+
const s = Dn(He(t), e), a = s == null ? void 0 : s[oe];
|
|
4449
4449
|
if (a && a.base_ === n)
|
|
4450
4450
|
return t.copy_[e] = n, t.assigned_[e] = !1, !0;
|
|
4451
4451
|
if (Bo(n, s) && (n !== void 0 || hr(t.base_, e)))
|
|
@@ -4462,7 +4462,7 @@ var jr = {
|
|
|
4462
4462
|
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
4463
4463
|
// the same guarantee in ES5 mode.
|
|
4464
4464
|
getOwnPropertyDescriptor(t, e) {
|
|
4465
|
-
const n =
|
|
4465
|
+
const n = He(t), r = Reflect.getOwnPropertyDescriptor(n, e);
|
|
4466
4466
|
return r && {
|
|
4467
4467
|
writable: !0,
|
|
4468
4468
|
configurable: t.type_ !== 1 || e !== "length",
|
|
@@ -4471,13 +4471,13 @@ var jr = {
|
|
|
4471
4471
|
};
|
|
4472
4472
|
},
|
|
4473
4473
|
defineProperty() {
|
|
4474
|
-
|
|
4474
|
+
se(11);
|
|
4475
4475
|
},
|
|
4476
4476
|
getPrototypeOf(t) {
|
|
4477
4477
|
return _t(t.base_);
|
|
4478
4478
|
},
|
|
4479
4479
|
setPrototypeOf() {
|
|
4480
|
-
|
|
4480
|
+
se(12);
|
|
4481
4481
|
}
|
|
4482
4482
|
}, qt = {};
|
|
4483
4483
|
bn(jr, (t, e) => {
|
|
@@ -4486,14 +4486,14 @@ bn(jr, (t, e) => {
|
|
|
4486
4486
|
};
|
|
4487
4487
|
});
|
|
4488
4488
|
qt.deleteProperty = function(t, e) {
|
|
4489
|
-
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) &&
|
|
4489
|
+
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && se(13), qt.set.call(this, t, e, void 0);
|
|
4490
4490
|
};
|
|
4491
4491
|
qt.set = function(t, e, n) {
|
|
4492
|
-
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) &&
|
|
4492
|
+
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && se(14), jr.set.call(this, t[0], e, n, t[0]);
|
|
4493
4493
|
};
|
|
4494
4494
|
function Dn(t, e) {
|
|
4495
|
-
const n = t[
|
|
4496
|
-
return (n ?
|
|
4495
|
+
const n = t[oe];
|
|
4496
|
+
return (n ? He(n) : t)[e];
|
|
4497
4497
|
}
|
|
4498
4498
|
function Yo(t, e, n) {
|
|
4499
4499
|
var s;
|
|
@@ -4535,9 +4535,9 @@ var Qo = class {
|
|
|
4535
4535
|
return i.produce(c, (h) => n.call(this, h, ...u));
|
|
4536
4536
|
};
|
|
4537
4537
|
}
|
|
4538
|
-
typeof n != "function" &&
|
|
4538
|
+
typeof n != "function" && se(6), r !== void 0 && typeof r != "function" && se(7);
|
|
4539
4539
|
let s;
|
|
4540
|
-
if (
|
|
4540
|
+
if (nt(e)) {
|
|
4541
4541
|
const a = hs(this), i = vr(e, void 0);
|
|
4542
4542
|
let o = !0;
|
|
4543
4543
|
try {
|
|
@@ -4549,11 +4549,11 @@ var Qo = class {
|
|
|
4549
4549
|
} else if (!e || typeof e != "object") {
|
|
4550
4550
|
if (s = n(e), s === void 0 && (s = e), s === zs && (s = void 0), this.autoFreeze_ && Kt(s, !0), r) {
|
|
4551
4551
|
const a = [], i = [];
|
|
4552
|
-
|
|
4552
|
+
rt("Patches").generateReplacementPatches_(e, s, a, i), r(a, i);
|
|
4553
4553
|
}
|
|
4554
4554
|
return s;
|
|
4555
4555
|
} else
|
|
4556
|
-
|
|
4556
|
+
se(1, e);
|
|
4557
4557
|
}, this.produceWithPatches = (e, n) => {
|
|
4558
4558
|
if (typeof e == "function")
|
|
4559
4559
|
return (i, ...o) => this.produceWithPatches(i, (c) => e(c, ...o));
|
|
@@ -4564,13 +4564,13 @@ var Qo = class {
|
|
|
4564
4564
|
}, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
|
|
4565
4565
|
}
|
|
4566
4566
|
createDraft(t) {
|
|
4567
|
-
|
|
4567
|
+
nt(t) || se(8), bt(t) && (t = ec(t));
|
|
4568
4568
|
const e = hs(this), n = vr(t, void 0);
|
|
4569
|
-
return n[
|
|
4569
|
+
return n[oe].isManual_ = !0, yr(e), n;
|
|
4570
4570
|
}
|
|
4571
4571
|
finishDraft(t, e) {
|
|
4572
|
-
const n = t && t[
|
|
4573
|
-
(!n || !n.isManual_) &&
|
|
4572
|
+
const n = t && t[oe];
|
|
4573
|
+
(!n || !n.isManual_) && se(9);
|
|
4574
4574
|
const { scope_: r } = n;
|
|
4575
4575
|
return fs(r, e), ps(void 0, r);
|
|
4576
4576
|
}
|
|
@@ -4600,7 +4600,7 @@ var Qo = class {
|
|
|
4600
4600
|
}
|
|
4601
4601
|
}
|
|
4602
4602
|
n > -1 && (e = e.slice(n + 1));
|
|
4603
|
-
const r =
|
|
4603
|
+
const r = rt("Patches").applyPatches_;
|
|
4604
4604
|
return bt(t) ? r(t, e) : this.produce(
|
|
4605
4605
|
t,
|
|
4606
4606
|
(s) => r(s, e)
|
|
@@ -4608,16 +4608,16 @@ var Qo = class {
|
|
|
4608
4608
|
}
|
|
4609
4609
|
};
|
|
4610
4610
|
function vr(t, e) {
|
|
4611
|
-
const n = En(t) ?
|
|
4611
|
+
const n = En(t) ? rt("MapSet").proxyMap_(t, e) : On(t) ? rt("MapSet").proxySet_(t, e) : Xo(t, e);
|
|
4612
4612
|
return (e ? e.scope_ : Ks()).drafts_.push(n), n;
|
|
4613
4613
|
}
|
|
4614
4614
|
function ec(t) {
|
|
4615
|
-
return bt(t) ||
|
|
4615
|
+
return bt(t) || se(10, t), qs(t);
|
|
4616
4616
|
}
|
|
4617
4617
|
function qs(t) {
|
|
4618
|
-
if (!
|
|
4618
|
+
if (!nt(t) || Tn(t))
|
|
4619
4619
|
return t;
|
|
4620
|
-
const e = t[
|
|
4620
|
+
const e = t[oe];
|
|
4621
4621
|
let n;
|
|
4622
4622
|
if (e) {
|
|
4623
4623
|
if (!e.modified_)
|
|
@@ -4629,15 +4629,15 @@ function qs(t) {
|
|
|
4629
4629
|
Vs(n, r, qs(s));
|
|
4630
4630
|
}), e && (e.finalized_ = !1), n;
|
|
4631
4631
|
}
|
|
4632
|
-
var
|
|
4633
|
-
|
|
4634
|
-
|
|
4632
|
+
var ce = new Qo(), tc = ce.produce;
|
|
4633
|
+
ce.produceWithPatches.bind(
|
|
4634
|
+
ce
|
|
4635
4635
|
);
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4636
|
+
ce.setAutoFreeze.bind(ce);
|
|
4637
|
+
ce.setUseStrictShallowCopy.bind(ce);
|
|
4638
|
+
ce.applyPatches.bind(ce);
|
|
4639
|
+
ce.createDraft.bind(ce);
|
|
4640
|
+
ce.finishDraft.bind(ce);
|
|
4641
4641
|
function nc(t) {
|
|
4642
4642
|
var e = la(function() {
|
|
4643
4643
|
return Kt(typeof t == "function" ? t() : t, !0);
|
|
@@ -4688,7 +4688,7 @@ const ys = 10, gs = {
|
|
|
4688
4688
|
}
|
|
4689
4689
|
let o;
|
|
4690
4690
|
const c = new dn(t, {
|
|
4691
|
-
fetch: (v, b) => (o = fetch(v, Br(
|
|
4691
|
+
fetch: (v, b) => (o = fetch(v, Br(Be({}, b), {
|
|
4692
4692
|
method: e,
|
|
4693
4693
|
body: JSON.stringify(a)
|
|
4694
4694
|
})), o)
|
|
@@ -4766,36 +4766,36 @@ const ys = 10, gs = {
|
|
|
4766
4766
|
});
|
|
4767
4767
|
let m = 0;
|
|
4768
4768
|
c.addEventListener("error", (g) => Ie(void 0, null, function* () {
|
|
4769
|
-
var U,
|
|
4769
|
+
var U, M, L, ue;
|
|
4770
4770
|
console.warn(
|
|
4771
4771
|
`Experienced error during code generation (attempt ${m + 1} / ${ys})`,
|
|
4772
4772
|
g
|
|
4773
4773
|
);
|
|
4774
|
-
let l, O,
|
|
4774
|
+
let l, O, P = !1;
|
|
4775
4775
|
try {
|
|
4776
4776
|
if (g instanceof MessageEvent)
|
|
4777
4777
|
l = JSON.parse(g.data);
|
|
4778
4778
|
else {
|
|
4779
|
-
const
|
|
4780
|
-
O =
|
|
4779
|
+
const j = yield o;
|
|
4780
|
+
O = j.status;
|
|
4781
4781
|
try {
|
|
4782
|
-
l = yield
|
|
4783
|
-
} catch (
|
|
4782
|
+
l = yield j.json();
|
|
4783
|
+
} catch (Ue) {
|
|
4784
4784
|
}
|
|
4785
4785
|
}
|
|
4786
|
-
(((U = l == null ? void 0 : l.payload) == null ? void 0 : U.name) === "Task Crashed" || O === 429) && (
|
|
4787
|
-
} catch (
|
|
4786
|
+
(((U = l == null ? void 0 : l.payload) == null ? void 0 : U.name) === "Task Crashed" || ((M = l == null ? void 0 : l.payload) == null ? void 0 : M.name) === "TimeoutError" || O === 429) && (P = !0);
|
|
4787
|
+
} catch (j) {
|
|
4788
4788
|
}
|
|
4789
4789
|
const K = new Gr({
|
|
4790
|
-
name: (
|
|
4791
|
-
reason: (
|
|
4790
|
+
name: (L = l == null ? void 0 : l.payload.name) != null ? L : "Unknown error",
|
|
4791
|
+
reason: (ue = l == null ? void 0 : l.payload.message) != null ? ue : "Unknown",
|
|
4792
4792
|
status: l == null ? void 0 : l.payload.status,
|
|
4793
4793
|
detail: l == null ? void 0 : l.payload.detail
|
|
4794
4794
|
});
|
|
4795
4795
|
m++;
|
|
4796
|
-
let
|
|
4797
|
-
m > ys ? (console.error("Experienced too many errors, terminating request"),
|
|
4798
|
-
|
|
4796
|
+
let D = !1;
|
|
4797
|
+
m > ys ? (console.error("Experienced too many errors, terminating request"), D = !0) : P && (console.error("Experienced unrecoverable error, terminating request"), D = !0), D && (r((j) => {
|
|
4798
|
+
j.status = "error", j.error = K;
|
|
4799
4799
|
}), v({
|
|
4800
4800
|
result: null,
|
|
4801
4801
|
error: K
|
|
@@ -4812,20 +4812,20 @@ const ys = 10, gs = {
|
|
|
4812
4812
|
if (((p = i.assetsStorage) == null ? void 0 : p.strategy) === "local" && ((k = m == null ? void 0 : m.assets) != null && k.length)) {
|
|
4813
4813
|
const { filePath: g } = vs(
|
|
4814
4814
|
i.assetsStorage
|
|
4815
|
-
), l = m.assets.map((
|
|
4816
|
-
const
|
|
4815
|
+
), l = m.assets.map((P) => Ie(void 0, null, function* () {
|
|
4816
|
+
const D = yield (yield fetch(P.url)).arrayBuffer();
|
|
4817
4817
|
return {
|
|
4818
|
-
assetName:
|
|
4819
|
-
base64: va(
|
|
4818
|
+
assetName: P.name,
|
|
4819
|
+
base64: va(D)
|
|
4820
4820
|
};
|
|
4821
4821
|
})), O = yield Promise.allSettled(l);
|
|
4822
|
-
for (const
|
|
4822
|
+
for (const P of O) {
|
|
4823
4823
|
const K = {};
|
|
4824
|
-
if (
|
|
4825
|
-
const { assetName:
|
|
4826
|
-
K[
|
|
4827
|
-
const
|
|
4828
|
-
m.files[
|
|
4824
|
+
if (P.status === "fulfilled") {
|
|
4825
|
+
const { assetName: D, base64: U } = P.value;
|
|
4826
|
+
K[D] = U;
|
|
4827
|
+
const M = g ? `${g}/${D}` : D;
|
|
4828
|
+
m.files[M] = {
|
|
4829
4829
|
content: U,
|
|
4830
4830
|
isBinary: !0
|
|
4831
4831
|
};
|
|
@@ -4988,10 +4988,10 @@ function _r(t, e) {
|
|
|
4988
4988
|
return t !== t && e !== e;
|
|
4989
4989
|
}
|
|
4990
4990
|
const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
4991
|
-
},
|
|
4991
|
+
}, ee = (
|
|
4992
4992
|
/*#__NOINLINE__*/
|
|
4993
4993
|
Me()
|
|
4994
|
-
), br = Object, R = (t) => t ===
|
|
4994
|
+
), br = Object, R = (t) => t === ee, we = (t) => typeof t == "function", ze = (t, e) => Be(Be({}, t), e), Xs = (t) => we(t.then), Fn = {}, nn = {}, Ir = "undefined", Xt = typeof window != Ir, wr = typeof document != Ir, oc = Xt && "Deno" in window, cc = () => Xt && typeof window.requestAnimationFrame != Ir, Ys = (t, e) => {
|
|
4995
4995
|
const n = Re.get(t);
|
|
4996
4996
|
return [
|
|
4997
4997
|
// Getter
|
|
@@ -5100,61 +5100,61 @@ function Qs(...t) {
|
|
|
5100
5100
|
return Ie(this, null, function* () {
|
|
5101
5101
|
const [v] = Pr(k);
|
|
5102
5102
|
if (!v) return;
|
|
5103
|
-
const [b, m] = Ys(e, v), [g, l, O,
|
|
5103
|
+
const [b, m] = Ys(e, v), [g, l, O, P] = Re.get(e), K = () => {
|
|
5104
5104
|
const fe = g[v];
|
|
5105
|
-
return (we(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete O[v], delete
|
|
5105
|
+
return (we(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete O[v], delete P[v], fe && fe[0]) ? fe[0](Js).then(() => b().data) : b().data;
|
|
5106
5106
|
};
|
|
5107
5107
|
if (t.length < 3)
|
|
5108
5108
|
return K();
|
|
5109
|
-
let
|
|
5110
|
-
const
|
|
5109
|
+
let D = r, U;
|
|
5110
|
+
const M = Or();
|
|
5111
5111
|
l[v] = [
|
|
5112
|
-
|
|
5112
|
+
M,
|
|
5113
5113
|
0
|
|
5114
5114
|
];
|
|
5115
|
-
const
|
|
5116
|
-
if (
|
|
5115
|
+
const L = !R(c), ue = b(), j = ue.data, Ue = ue._c, Ve = R(Ue) ? j : Ue;
|
|
5116
|
+
if (L && (c = we(c) ? c(Ve, j) : c, m({
|
|
5117
5117
|
data: c,
|
|
5118
|
-
_c:
|
|
5119
|
-
})), we(
|
|
5118
|
+
_c: Ve
|
|
5119
|
+
})), we(D))
|
|
5120
5120
|
try {
|
|
5121
|
-
|
|
5121
|
+
D = D(Ve);
|
|
5122
5122
|
} catch (fe) {
|
|
5123
5123
|
U = fe;
|
|
5124
5124
|
}
|
|
5125
|
-
if (
|
|
5126
|
-
if (
|
|
5125
|
+
if (D && Xs(D))
|
|
5126
|
+
if (D = yield D.catch((fe) => {
|
|
5127
5127
|
U = fe;
|
|
5128
|
-
}),
|
|
5128
|
+
}), M !== l[v][0]) {
|
|
5129
5129
|
if (U) throw U;
|
|
5130
|
-
return
|
|
5131
|
-
} else U &&
|
|
5132
|
-
data:
|
|
5133
|
-
_c:
|
|
5130
|
+
return D;
|
|
5131
|
+
} else U && L && u(U) && (i = !0, m({
|
|
5132
|
+
data: Ve,
|
|
5133
|
+
_c: ee
|
|
5134
5134
|
}));
|
|
5135
5135
|
if (i && !U)
|
|
5136
5136
|
if (we(i)) {
|
|
5137
|
-
const fe = i(
|
|
5137
|
+
const fe = i(D, Ve);
|
|
5138
5138
|
m({
|
|
5139
5139
|
data: fe,
|
|
5140
|
-
error:
|
|
5141
|
-
_c:
|
|
5140
|
+
error: ee,
|
|
5141
|
+
_c: ee
|
|
5142
5142
|
});
|
|
5143
5143
|
} else
|
|
5144
5144
|
m({
|
|
5145
|
-
data:
|
|
5146
|
-
error:
|
|
5147
|
-
_c:
|
|
5145
|
+
data: D,
|
|
5146
|
+
error: ee,
|
|
5147
|
+
_c: ee
|
|
5148
5148
|
});
|
|
5149
5149
|
if (l[v][1] = Or(), Promise.resolve(K()).then(() => {
|
|
5150
5150
|
m({
|
|
5151
|
-
_c:
|
|
5151
|
+
_c: ee
|
|
5152
5152
|
});
|
|
5153
5153
|
}), U) {
|
|
5154
5154
|
if (h) throw U;
|
|
5155
5155
|
return;
|
|
5156
5156
|
}
|
|
5157
|
-
return
|
|
5157
|
+
return D;
|
|
5158
5158
|
});
|
|
5159
5159
|
}
|
|
5160
5160
|
});
|
|
@@ -5164,7 +5164,7 @@ const Os = (t, e) => {
|
|
|
5164
5164
|
t[n][0] && t[n][0](e);
|
|
5165
5165
|
}, vc = (t, e) => {
|
|
5166
5166
|
if (!Re.has(t)) {
|
|
5167
|
-
const n = ze(pc, e), r = /* @__PURE__ */ Object.create(null), s = Qs.bind(
|
|
5167
|
+
const n = ze(pc, e), r = /* @__PURE__ */ Object.create(null), s = Qs.bind(ee, t);
|
|
5168
5168
|
let a = Me;
|
|
5169
5169
|
const i = /* @__PURE__ */ Object.create(null), o = (h, p) => {
|
|
5170
5170
|
const k = i[h] || [];
|
|
@@ -5185,7 +5185,7 @@ const Os = (t, e) => {
|
|
|
5185
5185
|
c,
|
|
5186
5186
|
o
|
|
5187
5187
|
]), !Ht)) {
|
|
5188
|
-
const h = n.initFocus(setTimeout.bind(
|
|
5188
|
+
const h = n.initFocus(setTimeout.bind(ee, Os.bind(ee, r, Hs))), p = n.initReconnect(setTimeout.bind(ee, Os.bind(ee, r, Gs)));
|
|
5189
5189
|
a = () => {
|
|
5190
5190
|
h && h(), p && p(), Re.delete(t);
|
|
5191
5191
|
};
|
|
@@ -5292,29 +5292,29 @@ const Vn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5292
5292
|
}), Kn = {
|
|
5293
5293
|
dedupe: !0
|
|
5294
5294
|
}, Pc = (t, e, n) => {
|
|
5295
|
-
const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, m, g] = Re.get(r), [l, O] = Pr(t),
|
|
5296
|
-
for (const
|
|
5297
|
-
const V =
|
|
5295
|
+
const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, m, g] = Re.get(r), [l, O] = Pr(t), P = qe(!1), K = qe(!1), D = qe(l), U = qe(e), M = qe(n), L = () => M.current, ue = () => L().isVisible() && L().isOnline(), [j, Ue, Ve, fe] = Ys(r, l), st = qe({}).current, Yt = R(i) ? R(n.fallback) ? ee : n.fallback[l] : i, Zr = (F, $) => {
|
|
5296
|
+
for (const G in st) {
|
|
5297
|
+
const V = G;
|
|
5298
5298
|
if (V === "data") {
|
|
5299
|
-
if (!s(F[V],
|
|
5299
|
+
if (!s(F[V], $[V]) && (!R(F[V]) || !s(en, $[V])))
|
|
5300
5300
|
return !1;
|
|
5301
|
-
} else if (
|
|
5301
|
+
} else if ($[V] !== F[V])
|
|
5302
5302
|
return !1;
|
|
5303
5303
|
}
|
|
5304
5304
|
return !0;
|
|
5305
5305
|
}, Dr = ya(() => {
|
|
5306
|
-
const F = !l || !e ? !1 : R(o) ?
|
|
5307
|
-
const Oe = ze(
|
|
5308
|
-
return delete Oe._k, F ?
|
|
5306
|
+
const F = !l || !e ? !1 : R(o) ? L().isPaused() || a ? !1 : c !== !1 : o, $ = (Y) => {
|
|
5307
|
+
const Oe = ze(Y);
|
|
5308
|
+
return delete Oe._k, F ? Be({
|
|
5309
5309
|
isValidating: !0,
|
|
5310
5310
|
isLoading: !0
|
|
5311
5311
|
}, Oe) : Oe;
|
|
5312
|
-
},
|
|
5312
|
+
}, G = j(), V = fe(), he = $(G), ot = G === V ? he : $(V);
|
|
5313
5313
|
let H = he;
|
|
5314
5314
|
return [
|
|
5315
5315
|
() => {
|
|
5316
|
-
const
|
|
5317
|
-
return Zr(
|
|
5316
|
+
const Y = $(j());
|
|
5317
|
+
return Zr(Y, H) ? (H.data = Y.data, H.isLoading = Y.isLoading, H.isValidating = Y.isValidating, H.error = Y.error, H) : (H = Y, Y);
|
|
5318
5318
|
},
|
|
5319
5319
|
() => ot
|
|
5320
5320
|
];
|
|
@@ -5322,53 +5322,53 @@ const Vn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5322
5322
|
r,
|
|
5323
5323
|
l
|
|
5324
5324
|
]), at = ic.useSyncExternalStore(sn(
|
|
5325
|
-
(F) =>
|
|
5326
|
-
Zr(
|
|
5325
|
+
(F) => Ve(l, ($, G) => {
|
|
5326
|
+
Zr(G, $) || F();
|
|
5327
5327
|
}),
|
|
5328
5328
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5329
5329
|
[
|
|
5330
5330
|
r,
|
|
5331
5331
|
l
|
|
5332
5332
|
]
|
|
5333
|
-
), Dr[0], Dr[1]), Mr = !
|
|
5333
|
+
), Dr[0], Dr[1]), Mr = !P.current, na = v[l] && v[l].length > 0, it = at.data, Ke = R(it) ? Yt && Xs(Yt) ? Vn(Yt) : Yt : it, Qt = at.error, An = qe(Ke), en = k ? R(it) ? R(An.current) ? Ke : An.current : it : Ke, Lr = na && !R(Qt) ? !1 : Mr && !R(o) ? o : L().isPaused() ? !1 : a ? R(Ke) ? !1 : c : R(Ke) || c, $r = !!(l && e && Mr && Lr), ra = R(at.isValidating) ? $r : at.isValidating, sa = R(at.isLoading) ? $r : at.isLoading, wt = sn(
|
|
5334
5334
|
(F) => Ie(void 0, null, function* () {
|
|
5335
|
-
const
|
|
5336
|
-
if (!l ||
|
|
5335
|
+
const $ = U.current;
|
|
5336
|
+
if (!l || !$ || K.current || L().isPaused())
|
|
5337
5337
|
return !1;
|
|
5338
|
-
let
|
|
5339
|
-
const ot = F || {}, H = !m[l] || !ot.dedupe,
|
|
5338
|
+
let G, V, he = !0;
|
|
5339
|
+
const ot = F || {}, H = !m[l] || !ot.dedupe, Y = () => xs ? !K.current && l === D.current && P.current : l === D.current, Oe = {
|
|
5340
5340
|
isValidating: !1,
|
|
5341
5341
|
isLoading: !1
|
|
5342
5342
|
}, Wr = () => {
|
|
5343
|
-
|
|
5343
|
+
Ue(Oe);
|
|
5344
5344
|
}, zr = () => {
|
|
5345
5345
|
const de = m[l];
|
|
5346
5346
|
de && de[1] === V && delete m[l];
|
|
5347
5347
|
}, Ur = {
|
|
5348
5348
|
isValidating: !0
|
|
5349
5349
|
};
|
|
5350
|
-
R(
|
|
5350
|
+
R(j().data) && (Ur.isLoading = !0);
|
|
5351
5351
|
try {
|
|
5352
|
-
if (H && (
|
|
5353
|
-
he &&
|
|
5352
|
+
if (H && (Ue(Ur), n.loadingTimeout && R(j().data) && setTimeout(() => {
|
|
5353
|
+
he && Y() && L().onLoadingSlow(l, n);
|
|
5354
5354
|
}, n.loadingTimeout), m[l] = [
|
|
5355
|
-
|
|
5355
|
+
$(O),
|
|
5356
5356
|
Or()
|
|
5357
|
-
]), [
|
|
5358
|
-
return H &&
|
|
5359
|
-
Oe.error =
|
|
5357
|
+
]), [G, V] = m[l], G = yield G, H && setTimeout(zr, n.dedupingInterval), !m[l] || m[l][1] !== V)
|
|
5358
|
+
return H && Y() && L().onDiscarded(l), !1;
|
|
5359
|
+
Oe.error = ee;
|
|
5360
5360
|
const de = b[l];
|
|
5361
5361
|
if (!R(de) && // case 1
|
|
5362
5362
|
(V <= de[0] || // case 2
|
|
5363
5363
|
V <= de[1] || // case 3
|
|
5364
5364
|
de[1] === 0))
|
|
5365
|
-
return Wr(), H &&
|
|
5366
|
-
const Te =
|
|
5367
|
-
Oe.data = s(Te,
|
|
5365
|
+
return Wr(), H && Y() && L().onDiscarded(l), !1;
|
|
5366
|
+
const Te = j().data;
|
|
5367
|
+
Oe.data = s(Te, G) ? Te : G, H && Y() && L().onSuccess(G, l, n);
|
|
5368
5368
|
} catch (de) {
|
|
5369
5369
|
zr();
|
|
5370
|
-
const Te =
|
|
5371
|
-
Te.isPaused() || (Oe.error = de, H &&
|
|
5370
|
+
const Te = L(), { shouldRetryOnError: Cn } = Te;
|
|
5371
|
+
Te.isPaused() || (Oe.error = de, H && Y() && (Te.onError(de, l, Te), (Cn === !0 || we(Cn) && Cn(de)) && (!L().revalidateOnFocus || !L().revalidateOnReconnect || ue()) && Te.onErrorRetry(de, l, Te, (aa) => {
|
|
5372
5372
|
const Nn = v[l];
|
|
5373
5373
|
Nn && Nn[0] && Nn[0](ks, aa);
|
|
5374
5374
|
}, {
|
|
@@ -5395,23 +5395,23 @@ const Vn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5395
5395
|
]
|
|
5396
5396
|
), Fr = sn(
|
|
5397
5397
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
5398
|
-
(...F) => Qs(r,
|
|
5398
|
+
(...F) => Qs(r, D.current, ...F),
|
|
5399
5399
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5400
5400
|
[]
|
|
5401
5401
|
);
|
|
5402
5402
|
if (Wn(() => {
|
|
5403
|
-
U.current = e,
|
|
5403
|
+
U.current = e, M.current = n, R(it) || (An.current = it);
|
|
5404
5404
|
}), Wn(() => {
|
|
5405
5405
|
if (!l) return;
|
|
5406
|
-
const F = wt.bind(
|
|
5407
|
-
let
|
|
5408
|
-
|
|
5406
|
+
const F = wt.bind(ee, Kn);
|
|
5407
|
+
let $ = 0;
|
|
5408
|
+
L().revalidateOnFocus && ($ = Date.now() + L().focusThrottleInterval);
|
|
5409
5409
|
const V = Ic(l, v, (he, ot = {}) => {
|
|
5410
5410
|
if (he == Hs) {
|
|
5411
5411
|
const H = Date.now();
|
|
5412
|
-
|
|
5412
|
+
L().revalidateOnFocus && H > $ && ue() && ($ = H + L().focusThrottleInterval, F());
|
|
5413
5413
|
} else if (he == Gs)
|
|
5414
|
-
|
|
5414
|
+
L().revalidateOnReconnect && ue() && F();
|
|
5415
5415
|
else {
|
|
5416
5416
|
if (he == Js)
|
|
5417
5417
|
return wt();
|
|
@@ -5419,23 +5419,23 @@ const Vn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5419
5419
|
return wt(ot);
|
|
5420
5420
|
}
|
|
5421
5421
|
});
|
|
5422
|
-
return K.current = !1,
|
|
5422
|
+
return K.current = !1, D.current = l, P.current = !0, Ue({
|
|
5423
5423
|
_k: O
|
|
5424
|
-
}), Lr && (R(
|
|
5424
|
+
}), Lr && (R(Ke) || Ht ? F() : mc(F)), () => {
|
|
5425
5425
|
K.current = !0, V();
|
|
5426
5426
|
};
|
|
5427
5427
|
}, [
|
|
5428
5428
|
l
|
|
5429
5429
|
]), Wn(() => {
|
|
5430
5430
|
let F;
|
|
5431
|
-
function
|
|
5432
|
-
const V = we(u) ? u(
|
|
5433
|
-
V && F !== -1 && (F = setTimeout(
|
|
5431
|
+
function $() {
|
|
5432
|
+
const V = we(u) ? u(j().data) : u;
|
|
5433
|
+
V && F !== -1 && (F = setTimeout(G, V));
|
|
5434
5434
|
}
|
|
5435
|
-
function
|
|
5436
|
-
|
|
5435
|
+
function G() {
|
|
5436
|
+
!j().error && (h || L().isVisible()) && (p || L().isOnline()) ? wt(Kn).then($) : $();
|
|
5437
5437
|
}
|
|
5438
|
-
return
|
|
5438
|
+
return $(), () => {
|
|
5439
5439
|
F && (clearTimeout(F), F = -1);
|
|
5440
5440
|
};
|
|
5441
5441
|
}, [
|
|
@@ -5443,18 +5443,18 @@ const Vn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5443
5443
|
h,
|
|
5444
5444
|
p,
|
|
5445
5445
|
l
|
|
5446
|
-
]), ga(en), a && R(
|
|
5446
|
+
]), ga(en), a && R(Ke) && l) {
|
|
5447
5447
|
if (!xs && Ht)
|
|
5448
5448
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
5449
|
-
U.current = e,
|
|
5449
|
+
U.current = e, M.current = n, K.current = !1;
|
|
5450
5450
|
const F = g[l];
|
|
5451
5451
|
if (!R(F)) {
|
|
5452
|
-
const
|
|
5453
|
-
Vn(
|
|
5452
|
+
const $ = Fr(F);
|
|
5453
|
+
Vn($);
|
|
5454
5454
|
}
|
|
5455
5455
|
if (R(Qt)) {
|
|
5456
|
-
const
|
|
5457
|
-
R(en) || (
|
|
5456
|
+
const $ = wt(Kn);
|
|
5457
|
+
R(en) || ($.status = "fulfilled", $.value = !0), Vn($);
|
|
5458
5458
|
} else
|
|
5459
5459
|
throw Qt;
|
|
5460
5460
|
}
|