@coinbase/cdp-core 0.0.37 → 0.0.39
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/esm/index.native101.js +10 -79
- package/dist/esm/index.native102.js +79 -10
- package/dist/esm/index.native32.js +1 -1
- package/dist/esm/index.native92.js +1 -1
- package/dist/esm/index.web100.js +78 -6
- package/dist/esm/index.web102.js +5 -18
- package/dist/esm/index.web103.js +18 -28
- package/dist/esm/index.web104.js +26 -6
- package/dist/esm/index.web105.js +6 -9
- package/dist/esm/index.web106.js +11 -13
- package/dist/esm/index.web107.js +11 -8
- package/dist/esm/index.web108.js +7 -14
- package/dist/esm/index.web109.js +16 -80
- package/dist/esm/index.web110.js +81 -5
- package/dist/esm/index.web112.js +4 -4
- package/dist/esm/index.web113.js +5 -5
- package/dist/esm/index.web12.js +1 -1
- package/dist/esm/index.web19.js +13 -13
- package/dist/esm/index.web20.js +3 -3
- package/dist/esm/index.web23.js +2 -2
- package/dist/esm/index.web24.js +950 -16
- package/dist/esm/index.web25.js +2 -23
- package/dist/esm/index.web26.js +49 -50
- package/dist/esm/index.web27.js +26 -158
- package/dist/esm/index.web28.js +157 -45
- package/dist/esm/index.web29.js +43 -245
- package/dist/esm/index.web30.js +247 -53
- package/dist/esm/index.web31.js +56 -951
- package/dist/esm/index.web32.js +17 -2
- package/dist/esm/index.web33.js +21 -48
- package/dist/esm/index.web34.js +50 -27
- package/dist/esm/index.web35.js +2 -13
- package/dist/esm/index.web36.js +2 -12
- package/dist/esm/index.web37.js +9 -2
- package/dist/esm/index.web38.js +18 -2
- package/dist/esm/index.web39.js +44 -53
- package/dist/esm/index.web40.js +13 -10
- package/dist/esm/index.web41.js +56 -2
- package/dist/esm/index.web42.js +7 -45
- package/dist/esm/index.web43.js +21 -13
- package/dist/esm/index.web44.js +11 -8
- package/dist/esm/index.web45.js +3 -17
- package/dist/esm/index.web46.js +3 -45
- package/dist/esm/index.web47.js +34 -13
- package/dist/esm/index.web48.js +10 -53
- package/dist/esm/index.web49.js +4 -6
- package/dist/esm/index.web50.js +28 -21
- package/dist/esm/index.web51.js +6 -3
- package/dist/esm/index.web52.js +24 -3
- package/dist/esm/index.web53.js +16 -34
- package/dist/esm/index.web54.js +53 -11
- package/dist/esm/index.web55.js +23 -4
- package/dist/esm/index.web56.js +11 -28
- package/dist/esm/index.web57.js +27 -6
- package/dist/esm/index.web58.js +40 -22
- package/dist/esm/index.web59.js +55 -16
- package/dist/esm/index.web60.js +126 -53
- package/dist/esm/index.web61.js +11 -22
- package/dist/esm/index.web62.js +104 -11
- package/dist/esm/index.web63.js +6 -27
- package/dist/esm/index.web64.js +3 -43
- package/dist/esm/index.web65.js +14 -55
- package/dist/esm/index.web66.js +41 -126
- package/dist/esm/index.web67.js +76 -10
- package/dist/esm/index.web68.js +2 -105
- package/dist/esm/index.web69.js +2 -7
- package/dist/esm/index.web7.js +4 -4
- package/dist/esm/index.web70.js +13 -3
- package/dist/esm/index.web71.js +37 -14
- package/dist/esm/index.web72.js +5 -41
- package/dist/esm/index.web73.js +32 -76
- package/dist/esm/index.web74.js +9 -2
- package/dist/esm/index.web75.js +11 -2
- package/dist/esm/index.web76.js +11 -37
- package/dist/esm/index.web77.js +13 -6
- package/dist/esm/index.web78.js +17 -33
- package/dist/esm/index.web79.js +5 -8
- package/dist/esm/index.web80.js +5 -11
- package/dist/esm/index.web81.js +10 -11
- package/dist/esm/index.web82.js +54 -13
- package/dist/esm/index.web83.js +10 -18
- package/dist/esm/index.web84.js +2 -6
- package/dist/esm/index.web85.js +44 -4
- package/dist/esm/index.web86.js +13 -10
- package/dist/esm/index.web87.js +17 -100
- package/dist/esm/index.web88.js +2 -79
- package/dist/esm/index.web89.js +20 -80
- package/dist/esm/index.web90.js +79 -20
- package/dist/esm/index.web91.js +104 -10
- package/dist/esm/index.web92.js +31 -18
- package/dist/esm/index.web93.js +7 -94
- package/dist/esm/index.web94.js +20 -20
- package/dist/esm/index.web95.js +9 -117
- package/dist/esm/index.web96.js +20 -2
- package/dist/esm/index.web97.js +91 -18
- package/dist/esm/index.web98.js +20 -19
- package/dist/esm/index.web99.js +115 -30
- package/dist/native/index.native101.js +10 -79
- package/dist/native/index.native102.js +79 -10
- package/dist/native/index.native32.js +1 -1
- package/dist/native/index.native92.js +1 -1
- package/dist/web/index.web100.js +78 -6
- package/dist/web/index.web102.js +5 -18
- package/dist/web/index.web103.js +18 -28
- package/dist/web/index.web104.js +26 -6
- package/dist/web/index.web105.js +6 -9
- package/dist/web/index.web106.js +11 -13
- package/dist/web/index.web107.js +11 -8
- package/dist/web/index.web108.js +7 -14
- package/dist/web/index.web109.js +16 -80
- package/dist/web/index.web110.js +81 -5
- package/dist/web/index.web112.js +4 -4
- package/dist/web/index.web113.js +5 -5
- package/dist/web/index.web12.js +1 -1
- package/dist/web/index.web19.js +13 -13
- package/dist/web/index.web20.js +3 -3
- package/dist/web/index.web23.js +2 -2
- package/dist/web/index.web24.js +950 -16
- package/dist/web/index.web25.js +2 -23
- package/dist/web/index.web26.js +49 -50
- package/dist/web/index.web27.js +26 -158
- package/dist/web/index.web28.js +157 -45
- package/dist/web/index.web29.js +43 -245
- package/dist/web/index.web30.js +247 -53
- package/dist/web/index.web31.js +56 -951
- package/dist/web/index.web32.js +17 -2
- package/dist/web/index.web33.js +21 -48
- package/dist/web/index.web34.js +50 -27
- package/dist/web/index.web35.js +2 -13
- package/dist/web/index.web36.js +2 -12
- package/dist/web/index.web37.js +9 -2
- package/dist/web/index.web38.js +18 -2
- package/dist/web/index.web39.js +44 -53
- package/dist/web/index.web40.js +13 -10
- package/dist/web/index.web41.js +56 -2
- package/dist/web/index.web42.js +7 -45
- package/dist/web/index.web43.js +21 -13
- package/dist/web/index.web44.js +11 -8
- package/dist/web/index.web45.js +3 -17
- package/dist/web/index.web46.js +3 -45
- package/dist/web/index.web47.js +34 -13
- package/dist/web/index.web48.js +10 -53
- package/dist/web/index.web49.js +4 -6
- package/dist/web/index.web50.js +28 -21
- package/dist/web/index.web51.js +6 -3
- package/dist/web/index.web52.js +24 -3
- package/dist/web/index.web53.js +16 -34
- package/dist/web/index.web54.js +53 -11
- package/dist/web/index.web55.js +23 -4
- package/dist/web/index.web56.js +11 -28
- package/dist/web/index.web57.js +27 -6
- package/dist/web/index.web58.js +40 -22
- package/dist/web/index.web59.js +55 -16
- package/dist/web/index.web60.js +126 -53
- package/dist/web/index.web61.js +11 -22
- package/dist/web/index.web62.js +104 -11
- package/dist/web/index.web63.js +6 -27
- package/dist/web/index.web64.js +3 -43
- package/dist/web/index.web65.js +14 -55
- package/dist/web/index.web66.js +41 -126
- package/dist/web/index.web67.js +76 -10
- package/dist/web/index.web68.js +2 -105
- package/dist/web/index.web69.js +2 -7
- package/dist/web/index.web7.js +4 -4
- package/dist/web/index.web70.js +13 -3
- package/dist/web/index.web71.js +37 -14
- package/dist/web/index.web72.js +5 -41
- package/dist/web/index.web73.js +32 -76
- package/dist/web/index.web74.js +9 -2
- package/dist/web/index.web75.js +11 -2
- package/dist/web/index.web76.js +11 -37
- package/dist/web/index.web77.js +13 -6
- package/dist/web/index.web78.js +17 -33
- package/dist/web/index.web79.js +5 -8
- package/dist/web/index.web80.js +5 -11
- package/dist/web/index.web81.js +10 -11
- package/dist/web/index.web82.js +54 -13
- package/dist/web/index.web83.js +10 -18
- package/dist/web/index.web84.js +2 -6
- package/dist/web/index.web85.js +44 -4
- package/dist/web/index.web86.js +13 -10
- package/dist/web/index.web87.js +17 -100
- package/dist/web/index.web88.js +2 -79
- package/dist/web/index.web89.js +20 -80
- package/dist/web/index.web90.js +79 -20
- package/dist/web/index.web91.js +104 -10
- package/dist/web/index.web92.js +31 -18
- package/dist/web/index.web93.js +7 -94
- package/dist/web/index.web94.js +20 -20
- package/dist/web/index.web95.js +9 -117
- package/dist/web/index.web96.js +20 -2
- package/dist/web/index.web97.js +91 -18
- package/dist/web/index.web98.js +20 -19
- package/dist/web/index.web99.js +115 -30
- package/package.json +2 -2
package/dist/web/index.web25.js
CHANGED
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
static code = "ERR_JOSE_GENERIC";
|
|
3
|
-
code = "ERR_JOSE_GENERIC";
|
|
4
|
-
constructor(s, e) {
|
|
5
|
-
super(s, e), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
class E extends c {
|
|
9
|
-
static code = "ERR_JOSE_NOT_SUPPORTED";
|
|
10
|
-
code = "ERR_JOSE_NOT_SUPPORTED";
|
|
11
|
-
}
|
|
12
|
-
class o extends c {
|
|
13
|
-
static code = "ERR_JWS_INVALID";
|
|
14
|
-
code = "ERR_JWS_INVALID";
|
|
15
|
-
}
|
|
16
|
-
class r extends c {
|
|
17
|
-
static code = "ERR_JWT_INVALID";
|
|
18
|
-
code = "ERR_JWT_INVALID";
|
|
19
|
-
}
|
|
1
|
+
var r = {};
|
|
20
2
|
export {
|
|
21
|
-
|
|
22
|
-
E as JOSENotSupported,
|
|
23
|
-
o as JWSInvalid,
|
|
24
|
-
r as JWTInvalid
|
|
3
|
+
r as __exports
|
|
25
4
|
};
|
package/dist/web/index.web26.js
CHANGED
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
1
|
+
import { __exports as F } from "./index.web35.js";
|
|
2
|
+
var A;
|
|
3
|
+
function _() {
|
|
4
|
+
if (A) return F;
|
|
5
|
+
A = 1, F.byteLength = y, F.toByteArray = C, F.fromByteArray = B;
|
|
6
|
+
for (var c = [], n = [], l = typeof Uint8Array < "u" ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, p = d.length; s < p; ++s)
|
|
7
|
+
c[s] = d[s], n[d.charCodeAt(s)] = s;
|
|
8
|
+
n[45] = 62, n[95] = 63;
|
|
9
|
+
function x(r) {
|
|
10
|
+
var e = r.length;
|
|
11
|
+
if (e % 4 > 0)
|
|
12
|
+
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
13
|
+
var a = r.indexOf("=");
|
|
14
|
+
a === -1 && (a = e);
|
|
15
|
+
var o = a === e ? 0 : 4 - a % 4;
|
|
16
|
+
return [a, o];
|
|
17
|
+
}
|
|
18
|
+
function y(r) {
|
|
19
|
+
var e = x(r), a = e[0], o = e[1];
|
|
20
|
+
return (a + o) * 3 / 4 - o;
|
|
21
|
+
}
|
|
22
|
+
function i(r, e, a) {
|
|
23
|
+
return (e + a) * 3 / 4 - a;
|
|
24
|
+
}
|
|
25
|
+
function C(r) {
|
|
26
|
+
var e, a = x(r), o = a[0], v = a[1], t = new l(i(r, o, v)), h = 0, u = v > 0 ? o - 4 : o, f;
|
|
27
|
+
for (f = 0; f < u; f += 4)
|
|
28
|
+
e = n[r.charCodeAt(f)] << 18 | n[r.charCodeAt(f + 1)] << 12 | n[r.charCodeAt(f + 2)] << 6 | n[r.charCodeAt(f + 3)], t[h++] = e >> 16 & 255, t[h++] = e >> 8 & 255, t[h++] = e & 255;
|
|
29
|
+
return v === 2 && (e = n[r.charCodeAt(f)] << 2 | n[r.charCodeAt(f + 1)] >> 4, t[h++] = e & 255), v === 1 && (e = n[r.charCodeAt(f)] << 10 | n[r.charCodeAt(f + 1)] << 4 | n[r.charCodeAt(f + 2)] >> 2, t[h++] = e >> 8 & 255, t[h++] = e & 255), t;
|
|
30
|
+
}
|
|
31
|
+
function L(r) {
|
|
32
|
+
return c[r >> 18 & 63] + c[r >> 12 & 63] + c[r >> 6 & 63] + c[r & 63];
|
|
33
|
+
}
|
|
34
|
+
function g(r, e, a) {
|
|
35
|
+
for (var o, v = [], t = e; t < a; t += 3)
|
|
36
|
+
o = (r[t] << 16 & 16711680) + (r[t + 1] << 8 & 65280) + (r[t + 2] & 255), v.push(L(o));
|
|
37
|
+
return v.join("");
|
|
38
|
+
}
|
|
39
|
+
function B(r) {
|
|
40
|
+
for (var e, a = r.length, o = a % 3, v = [], t = 16383, h = 0, u = a - o; h < u; h += t)
|
|
41
|
+
v.push(g(r, h, h + t > u ? u : h + t));
|
|
42
|
+
return o === 1 ? (e = r[a - 1], v.push(
|
|
43
|
+
c[e >> 2] + c[e << 4 & 63] + "=="
|
|
44
|
+
)) : o === 2 && (e = (r[a - 2] << 8) + r[a - 1], v.push(
|
|
45
|
+
c[e >> 10] + c[e >> 4 & 63] + c[e << 2 & 63] + "="
|
|
46
|
+
)), v.join("");
|
|
47
|
+
}
|
|
48
|
+
return F;
|
|
50
49
|
}
|
|
51
50
|
export {
|
|
52
|
-
|
|
51
|
+
_ as __require
|
|
53
52
|
};
|
package/dist/web/index.web27.js
CHANGED
|
@@ -1,162 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { __exports as n } from "./index.web36.js";
|
|
2
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3
|
+
var d;
|
|
4
|
+
function q() {
|
|
5
|
+
return d ? n : (d = 1, n.read = function(s, a, N, w, M) {
|
|
6
|
+
var t, r, h = M * 8 - w - 1, e = (1 << h) - 1, f = e >> 1, i = -7, o = N ? M - 1 : 0, x = N ? -1 : 1, p = s[a + o];
|
|
7
|
+
for (o += x, t = p & (1 << -i) - 1, p >>= -i, i += h; i > 0; t = t * 256 + s[a + o], o += x, i -= 8)
|
|
8
|
+
;
|
|
9
|
+
for (r = t & (1 << -i) - 1, t >>= -i, i += w; i > 0; r = r * 256 + s[a + o], o += x, i -= 8)
|
|
10
|
+
;
|
|
11
|
+
if (t === 0)
|
|
12
|
+
t = 1 - f;
|
|
13
|
+
else {
|
|
14
|
+
if (t === e)
|
|
15
|
+
return r ? NaN : (p ? -1 : 1) * (1 / 0);
|
|
16
|
+
r = r + Math.pow(2, w), t = t - f;
|
|
15
17
|
}
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
getItem: (s) => {
|
|
28
|
-
var e;
|
|
29
|
-
const c = (a) => a === null ? null : JSON.parse(a, void 0), i = (e = n.getItem(s)) != null ? e : null;
|
|
30
|
-
return i instanceof Promise ? i.then(c) : c(i);
|
|
31
|
-
},
|
|
32
|
-
setItem: (s, e) => n.setItem(s, JSON.stringify(e, void 0)),
|
|
33
|
-
removeItem: (s) => n.removeItem(s)
|
|
34
|
-
};
|
|
18
|
+
return (p ? -1 : 1) * r * Math.pow(2, t - w);
|
|
19
|
+
}, n.write = function(s, a, N, w, M, t) {
|
|
20
|
+
var r, h, e, f = t * 8 - M - 1, i = (1 << f) - 1, o = i >> 1, x = M === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = w ? 0 : t - 1, c = w ? 1 : -1, I = a < 0 || a === 0 && 1 / a < 0 ? 1 : 0;
|
|
21
|
+
for (a = Math.abs(a), isNaN(a) || a === 1 / 0 ? (h = isNaN(a) ? 1 : 0, r = i) : (r = Math.floor(Math.log(a) / Math.LN2), a * (e = Math.pow(2, -r)) < 1 && (r--, e *= 2), r + o >= 1 ? a += x / e : a += x * Math.pow(2, 1 - o), a * e >= 2 && (r++, e /= 2), r + o >= i ? (h = 0, r = i) : r + o >= 1 ? (h = (a * e - 1) * Math.pow(2, M), r = r + o) : (h = a * Math.pow(2, o - 1) * Math.pow(2, M), r = 0)); M >= 8; s[N + p] = h & 255, p += c, h /= 256, M -= 8)
|
|
22
|
+
;
|
|
23
|
+
for (r = r << M | h, f += M; f > 0; s[N + p] = r & 255, p += c, r /= 256, f -= 8)
|
|
24
|
+
;
|
|
25
|
+
s[N + p - c] |= I * 128;
|
|
26
|
+
}, n);
|
|
35
27
|
}
|
|
36
|
-
const p = (m) => (h) => {
|
|
37
|
-
try {
|
|
38
|
-
const n = m(h);
|
|
39
|
-
return n instanceof Promise ? n : {
|
|
40
|
-
then(r) {
|
|
41
|
-
return p(r)(n);
|
|
42
|
-
},
|
|
43
|
-
catch(r) {
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
} catch (n) {
|
|
48
|
-
return {
|
|
49
|
-
then(r) {
|
|
50
|
-
return this;
|
|
51
|
-
},
|
|
52
|
-
catch(r) {
|
|
53
|
-
return p(r)(n);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}, O = (m, h) => (n, r, s) => {
|
|
58
|
-
let e = {
|
|
59
|
-
storage: F(() => localStorage),
|
|
60
|
-
partialize: (t) => t,
|
|
61
|
-
version: 0,
|
|
62
|
-
merge: (t, S) => ({
|
|
63
|
-
...S,
|
|
64
|
-
...t
|
|
65
|
-
}),
|
|
66
|
-
...h
|
|
67
|
-
}, c = !1;
|
|
68
|
-
const i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
69
|
-
let l = e.storage;
|
|
70
|
-
if (!l)
|
|
71
|
-
return m(
|
|
72
|
-
(...t) => {
|
|
73
|
-
console.warn(
|
|
74
|
-
`[zustand persist middleware] Unable to update item '${e.name}', the given storage is currently unavailable.`
|
|
75
|
-
), n(...t);
|
|
76
|
-
},
|
|
77
|
-
r,
|
|
78
|
-
s
|
|
79
|
-
);
|
|
80
|
-
const g = () => {
|
|
81
|
-
const t = e.partialize({ ...r() });
|
|
82
|
-
return l.setItem(e.name, {
|
|
83
|
-
state: t,
|
|
84
|
-
version: e.version
|
|
85
|
-
});
|
|
86
|
-
}, v = s.setState;
|
|
87
|
-
s.setState = (t, S) => {
|
|
88
|
-
v(t, S), g();
|
|
89
|
-
};
|
|
90
|
-
const f = m(
|
|
91
|
-
(...t) => {
|
|
92
|
-
n(...t), g();
|
|
93
|
-
},
|
|
94
|
-
r,
|
|
95
|
-
s
|
|
96
|
-
);
|
|
97
|
-
s.getInitialState = () => f;
|
|
98
|
-
let u;
|
|
99
|
-
const y = () => {
|
|
100
|
-
var t, S;
|
|
101
|
-
if (!l) return;
|
|
102
|
-
c = !1, i.forEach((o) => {
|
|
103
|
-
var d;
|
|
104
|
-
return o((d = r()) != null ? d : f);
|
|
105
|
-
});
|
|
106
|
-
const b = ((S = e.onRehydrateStorage) == null ? void 0 : S.call(e, (t = r()) != null ? t : f)) || void 0;
|
|
107
|
-
return p(l.getItem.bind(l))(e.name).then((o) => {
|
|
108
|
-
if (o)
|
|
109
|
-
if (typeof o.version == "number" && o.version !== e.version) {
|
|
110
|
-
if (e.migrate) {
|
|
111
|
-
const d = e.migrate(
|
|
112
|
-
o.state,
|
|
113
|
-
o.version
|
|
114
|
-
);
|
|
115
|
-
return d instanceof Promise ? d.then((I) => [!0, I]) : [!0, d];
|
|
116
|
-
}
|
|
117
|
-
console.error(
|
|
118
|
-
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
119
|
-
);
|
|
120
|
-
} else
|
|
121
|
-
return [!1, o.state];
|
|
122
|
-
return [!1, void 0];
|
|
123
|
-
}).then((o) => {
|
|
124
|
-
var d;
|
|
125
|
-
const [I, _] = o;
|
|
126
|
-
if (u = e.merge(
|
|
127
|
-
_,
|
|
128
|
-
(d = r()) != null ? d : f
|
|
129
|
-
), n(u, !0), I)
|
|
130
|
-
return g();
|
|
131
|
-
}).then(() => {
|
|
132
|
-
b?.(u, void 0), u = r(), c = !0, a.forEach((o) => o(u));
|
|
133
|
-
}).catch((o) => {
|
|
134
|
-
b?.(void 0, o);
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
return s.persist = {
|
|
138
|
-
setOptions: (t) => {
|
|
139
|
-
e = {
|
|
140
|
-
...e,
|
|
141
|
-
...t
|
|
142
|
-
}, t.storage && (l = t.storage);
|
|
143
|
-
},
|
|
144
|
-
clearStorage: () => {
|
|
145
|
-
l?.removeItem(e.name);
|
|
146
|
-
},
|
|
147
|
-
getOptions: () => e,
|
|
148
|
-
rehydrate: () => y(),
|
|
149
|
-
hasHydrated: () => c,
|
|
150
|
-
onHydrate: (t) => (i.add(t), () => {
|
|
151
|
-
i.delete(t);
|
|
152
|
-
}),
|
|
153
|
-
onFinishHydration: (t) => (a.add(t), () => {
|
|
154
|
-
a.delete(t);
|
|
155
|
-
})
|
|
156
|
-
}, e.skipHydration || y(), u || f;
|
|
157
|
-
}, w = O;
|
|
158
28
|
export {
|
|
159
|
-
|
|
160
|
-
w as persist,
|
|
161
|
-
R as subscribeWithSelector
|
|
29
|
+
q as __require
|
|
162
30
|
};
|
package/dist/web/index.web28.js
CHANGED
|
@@ -1,50 +1,162 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const H = (m) => (h, n, r) => {
|
|
2
|
+
const s = r.subscribe;
|
|
3
|
+
return r.subscribe = (c, i, a) => {
|
|
4
|
+
let l = c;
|
|
5
|
+
if (i) {
|
|
6
|
+
const g = a?.equalityFn || Object.is;
|
|
7
|
+
let v = c(r.getState());
|
|
8
|
+
l = (f) => {
|
|
9
|
+
const u = c(f);
|
|
10
|
+
if (!g(v, u)) {
|
|
11
|
+
const y = v;
|
|
12
|
+
i(v = u, y);
|
|
13
|
+
}
|
|
14
|
+
}, a?.fireImmediately && i(v, v);
|
|
15
|
+
}
|
|
16
|
+
return s(l);
|
|
17
|
+
}, m(h, n, r);
|
|
18
|
+
}, R = H;
|
|
19
|
+
function F(m, h) {
|
|
20
|
+
let n;
|
|
21
|
+
try {
|
|
22
|
+
n = m();
|
|
23
|
+
} catch {
|
|
24
|
+
return;
|
|
11
25
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.events[e] && this.events[e].forEach((t) => {
|
|
32
|
-
try {
|
|
33
|
-
t(...s);
|
|
34
|
-
} catch (i) {
|
|
35
|
-
console.error(`Error in event listener for ${e}:`, i);
|
|
26
|
+
return {
|
|
27
|
+
getItem: (s) => {
|
|
28
|
+
var e;
|
|
29
|
+
const c = (a) => a === null ? null : JSON.parse(a, void 0), i = (e = n.getItem(s)) != null ? e : null;
|
|
30
|
+
return i instanceof Promise ? i.then(c) : c(i);
|
|
31
|
+
},
|
|
32
|
+
setItem: (s, e) => n.setItem(s, JSON.stringify(e, void 0)),
|
|
33
|
+
removeItem: (s) => n.removeItem(s)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const p = (m) => (h) => {
|
|
37
|
+
try {
|
|
38
|
+
const n = m(h);
|
|
39
|
+
return n instanceof Promise ? n : {
|
|
40
|
+
then(r) {
|
|
41
|
+
return p(r)(n);
|
|
42
|
+
},
|
|
43
|
+
catch(r) {
|
|
44
|
+
return this;
|
|
36
45
|
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
};
|
|
47
|
+
} catch (n) {
|
|
48
|
+
return {
|
|
49
|
+
then(r) {
|
|
50
|
+
return this;
|
|
51
|
+
},
|
|
52
|
+
catch(r) {
|
|
53
|
+
return p(r)(n);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
46
56
|
}
|
|
47
|
-
}
|
|
57
|
+
}, O = (m, h) => (n, r, s) => {
|
|
58
|
+
let e = {
|
|
59
|
+
storage: F(() => localStorage),
|
|
60
|
+
partialize: (t) => t,
|
|
61
|
+
version: 0,
|
|
62
|
+
merge: (t, S) => ({
|
|
63
|
+
...S,
|
|
64
|
+
...t
|
|
65
|
+
}),
|
|
66
|
+
...h
|
|
67
|
+
}, c = !1;
|
|
68
|
+
const i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
69
|
+
let l = e.storage;
|
|
70
|
+
if (!l)
|
|
71
|
+
return m(
|
|
72
|
+
(...t) => {
|
|
73
|
+
console.warn(
|
|
74
|
+
`[zustand persist middleware] Unable to update item '${e.name}', the given storage is currently unavailable.`
|
|
75
|
+
), n(...t);
|
|
76
|
+
},
|
|
77
|
+
r,
|
|
78
|
+
s
|
|
79
|
+
);
|
|
80
|
+
const g = () => {
|
|
81
|
+
const t = e.partialize({ ...r() });
|
|
82
|
+
return l.setItem(e.name, {
|
|
83
|
+
state: t,
|
|
84
|
+
version: e.version
|
|
85
|
+
});
|
|
86
|
+
}, v = s.setState;
|
|
87
|
+
s.setState = (t, S) => {
|
|
88
|
+
v(t, S), g();
|
|
89
|
+
};
|
|
90
|
+
const f = m(
|
|
91
|
+
(...t) => {
|
|
92
|
+
n(...t), g();
|
|
93
|
+
},
|
|
94
|
+
r,
|
|
95
|
+
s
|
|
96
|
+
);
|
|
97
|
+
s.getInitialState = () => f;
|
|
98
|
+
let u;
|
|
99
|
+
const y = () => {
|
|
100
|
+
var t, S;
|
|
101
|
+
if (!l) return;
|
|
102
|
+
c = !1, i.forEach((o) => {
|
|
103
|
+
var d;
|
|
104
|
+
return o((d = r()) != null ? d : f);
|
|
105
|
+
});
|
|
106
|
+
const b = ((S = e.onRehydrateStorage) == null ? void 0 : S.call(e, (t = r()) != null ? t : f)) || void 0;
|
|
107
|
+
return p(l.getItem.bind(l))(e.name).then((o) => {
|
|
108
|
+
if (o)
|
|
109
|
+
if (typeof o.version == "number" && o.version !== e.version) {
|
|
110
|
+
if (e.migrate) {
|
|
111
|
+
const d = e.migrate(
|
|
112
|
+
o.state,
|
|
113
|
+
o.version
|
|
114
|
+
);
|
|
115
|
+
return d instanceof Promise ? d.then((I) => [!0, I]) : [!0, d];
|
|
116
|
+
}
|
|
117
|
+
console.error(
|
|
118
|
+
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
119
|
+
);
|
|
120
|
+
} else
|
|
121
|
+
return [!1, o.state];
|
|
122
|
+
return [!1, void 0];
|
|
123
|
+
}).then((o) => {
|
|
124
|
+
var d;
|
|
125
|
+
const [I, _] = o;
|
|
126
|
+
if (u = e.merge(
|
|
127
|
+
_,
|
|
128
|
+
(d = r()) != null ? d : f
|
|
129
|
+
), n(u, !0), I)
|
|
130
|
+
return g();
|
|
131
|
+
}).then(() => {
|
|
132
|
+
b?.(u, void 0), u = r(), c = !0, a.forEach((o) => o(u));
|
|
133
|
+
}).catch((o) => {
|
|
134
|
+
b?.(void 0, o);
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
return s.persist = {
|
|
138
|
+
setOptions: (t) => {
|
|
139
|
+
e = {
|
|
140
|
+
...e,
|
|
141
|
+
...t
|
|
142
|
+
}, t.storage && (l = t.storage);
|
|
143
|
+
},
|
|
144
|
+
clearStorage: () => {
|
|
145
|
+
l?.removeItem(e.name);
|
|
146
|
+
},
|
|
147
|
+
getOptions: () => e,
|
|
148
|
+
rehydrate: () => y(),
|
|
149
|
+
hasHydrated: () => c,
|
|
150
|
+
onHydrate: (t) => (i.add(t), () => {
|
|
151
|
+
i.delete(t);
|
|
152
|
+
}),
|
|
153
|
+
onFinishHydration: (t) => (a.add(t), () => {
|
|
154
|
+
a.delete(t);
|
|
155
|
+
})
|
|
156
|
+
}, e.skipHydration || y(), u || f;
|
|
157
|
+
}, w = O;
|
|
48
158
|
export {
|
|
49
|
-
|
|
159
|
+
F as createJSONStorage,
|
|
160
|
+
w as persist,
|
|
161
|
+
R as subscribeWithSelector
|
|
50
162
|
};
|