@nil-/xit 0.2.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/bundler.js +266 -260
- package/assets/index.html +3 -3
- package/assets/index.js +63 -63
- package/assets/svelte/index.js +1041 -954
- package/assets/svelte/internal/client.js +754 -735
- package/assets/svelte/motion.js +143 -142
- package/package.json +1 -1
package/assets/svelte/motion.js
CHANGED
|
@@ -2,12 +2,12 @@ var et = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var X = (e, t, s) => t.has(e) || et("Cannot " + s);
|
|
5
|
-
var r = (e, t, s) => (X(e, t, "read from private field"), s ? s.call(e) : t.get(e)),
|
|
5
|
+
var r = (e, t, s) => (X(e, t, "read from private field"), s ? s.call(e) : t.get(e)), c = (e, t, s) => t.has(e) ? et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), h = (e, t, s, i) => (X(e, t, "write to private field"), i ? i.call(e, s) : t.set(e, s), s), st = (e, t, s) => (X(e, t, "access private method"), s);
|
|
6
6
|
import "./internal/client.js";
|
|
7
|
-
import { o as dt, b as
|
|
7
|
+
import { o as dt, b as O, c as rt, a as g, k as lt, n as ut, g as S } from "./index.js";
|
|
8
8
|
import { c as mt, w as nt } from "./store.js";
|
|
9
9
|
import { linear as it } from "./easing.js";
|
|
10
|
-
const pt = () => performance.now(),
|
|
10
|
+
const pt = () => performance.now(), u = {
|
|
11
11
|
// don't access requestAnimationFrame eagerly outside method
|
|
12
12
|
// this allows basic testing of user code without JSDOM
|
|
13
13
|
// bunder will eval and remove ternary when the user's app is built
|
|
@@ -19,23 +19,23 @@ const pt = () => performance.now(), l = {
|
|
|
19
19
|
tasks: /* @__PURE__ */ new Set()
|
|
20
20
|
};
|
|
21
21
|
function ot() {
|
|
22
|
-
const e =
|
|
23
|
-
|
|
24
|
-
t.c(e) || (
|
|
25
|
-
}),
|
|
22
|
+
const e = u.now();
|
|
23
|
+
u.tasks.forEach((t) => {
|
|
24
|
+
t.c(e) || (u.tasks.delete(t), t.f());
|
|
25
|
+
}), u.tasks.size !== 0 && u.tick(ot);
|
|
26
26
|
}
|
|
27
27
|
function U(e) {
|
|
28
28
|
let t;
|
|
29
|
-
return
|
|
29
|
+
return u.tasks.size === 0 && u.tick(ot), {
|
|
30
30
|
promise: new Promise((s) => {
|
|
31
|
-
|
|
31
|
+
u.tasks.add(t = { c: e, f: s });
|
|
32
32
|
}),
|
|
33
33
|
abort() {
|
|
34
|
-
|
|
34
|
+
u.tasks.delete(t);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
var
|
|
38
|
+
var q, B;
|
|
39
39
|
class gt {
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
@@ -43,127 +43,128 @@ class gt {
|
|
|
43
43
|
* @param {(update: () => void) => void} onsubscribe
|
|
44
44
|
*/
|
|
45
45
|
constructor(t, s) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
h(this,
|
|
46
|
+
c(this, q);
|
|
47
|
+
c(this, B);
|
|
48
|
+
h(this, q, t), h(this, B, mt(s));
|
|
49
49
|
}
|
|
50
50
|
get current() {
|
|
51
|
-
return r(this, B).call(this), r(this,
|
|
51
|
+
return r(this, B).call(this), r(this, q).call(this);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
const bt = /\(.+\)
|
|
56
|
-
class
|
|
54
|
+
q = new WeakMap(), B = new WeakMap();
|
|
55
|
+
const bt = /\(.+\)/, yt = /* @__PURE__ */ new Set(["all", "print", "screen", "and", "or", "not", "only"]);
|
|
56
|
+
class wt extends gt {
|
|
57
57
|
/**
|
|
58
58
|
* @param {string} query A media query string
|
|
59
59
|
* @param {boolean} [fallback] Fallback value for the server
|
|
60
60
|
*/
|
|
61
61
|
constructor(t, s) {
|
|
62
|
-
let
|
|
63
|
-
|
|
62
|
+
let i = bt.test(t) || // we need to use `some` here because technically this `window.matchMedia('random,screen')` still returns true
|
|
63
|
+
t.split(/[\s,]+/).some((n) => yt.has(n.trim())) ? t : `(${t})`;
|
|
64
|
+
const o = window.matchMedia(i);
|
|
64
65
|
super(
|
|
65
66
|
() => o.matches,
|
|
66
|
-
(
|
|
67
|
+
(n) => dt(o, "change", n)
|
|
67
68
|
);
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
function J(e) {
|
|
71
72
|
return Object.prototype.toString.call(e) === "[object Date]";
|
|
72
73
|
}
|
|
73
|
-
function K(e, t, s,
|
|
74
|
+
function K(e, t, s, i) {
|
|
74
75
|
if (typeof s == "number" || J(s)) {
|
|
75
|
-
const o =
|
|
76
|
-
return Math.abs(m) < e.opts.precision && Math.abs(o) < e.opts.precision ?
|
|
76
|
+
const o = i - s, n = (s - t) / (e.dt || 1 / 60), f = e.opts.stiffness * o, a = e.opts.damping * n, d = (f - a) * e.inv_mass, m = (n + d) * e.dt;
|
|
77
|
+
return Math.abs(m) < e.opts.precision && Math.abs(o) < e.opts.precision ? i : (e.settled = !1, J(s) ? new Date(s.getTime() + m) : s + m);
|
|
77
78
|
} else {
|
|
78
79
|
if (Array.isArray(s))
|
|
79
80
|
return s.map(
|
|
80
|
-
(o,
|
|
81
|
+
(o, n) => (
|
|
81
82
|
// @ts-ignore
|
|
82
|
-
K(e, t[
|
|
83
|
+
K(e, t[n], s[n], i[n])
|
|
83
84
|
)
|
|
84
85
|
);
|
|
85
86
|
if (typeof s == "object") {
|
|
86
87
|
const o = {};
|
|
87
|
-
for (const
|
|
88
|
-
o[
|
|
88
|
+
for (const n in s)
|
|
89
|
+
o[n] = K(e, t[n], s[n], i[n]);
|
|
89
90
|
return o;
|
|
90
91
|
} else
|
|
91
92
|
throw new Error(`Cannot spring ${typeof s} values`);
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
-
const s = nt(e), { stiffness:
|
|
96
|
-
let f,
|
|
95
|
+
function kt(e, t = {}) {
|
|
96
|
+
const s = nt(e), { stiffness: i = 0.15, damping: o = 0.8, precision: n = 0.01 } = t;
|
|
97
|
+
let f, a, d, m = (
|
|
97
98
|
/** @type {T} */
|
|
98
99
|
e
|
|
99
100
|
), b = (
|
|
100
101
|
/** @type {T | undefined} */
|
|
101
102
|
e
|
|
102
|
-
),
|
|
103
|
-
function A(
|
|
104
|
-
b =
|
|
105
|
-
const
|
|
106
|
-
return e == null || w.hard || E.stiffness >= 1 && E.damping >= 1 ? (y = !0, f =
|
|
103
|
+
), l = 1, P = 0, y = !1;
|
|
104
|
+
function A(_, w = {}) {
|
|
105
|
+
b = _;
|
|
106
|
+
const at = d = {};
|
|
107
|
+
return e == null || w.hard || E.stiffness >= 1 && E.damping >= 1 ? (y = !0, f = u.now(), m = _, s.set(e = b), Promise.resolve()) : (w.soft && (P = 1 / ((w.soft === !0 ? 0.5 : +w.soft) * 60), l = 0), a || (f = u.now(), y = !1, a = U((V) => {
|
|
107
108
|
if (y)
|
|
108
|
-
return y = !1,
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
inv_mass:
|
|
109
|
+
return y = !1, a = null, !1;
|
|
110
|
+
l = Math.min(l + P, 1);
|
|
111
|
+
const ct = Math.min(V - f, 1e3 / 30), W = {
|
|
112
|
+
inv_mass: l,
|
|
112
113
|
opts: E,
|
|
113
114
|
settled: !0,
|
|
114
|
-
dt:
|
|
115
|
+
dt: ct * 60 / 1e3
|
|
115
116
|
}, ht = K(W, m, e, b);
|
|
116
|
-
return f =
|
|
117
|
+
return f = V, m = /** @type {T} */
|
|
117
118
|
e, s.set(e = /** @type {T} */
|
|
118
|
-
ht), W.settled && (
|
|
119
|
-
})), new Promise((
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
ht), W.settled && (a = null), !W.settled;
|
|
120
|
+
})), new Promise((V) => {
|
|
121
|
+
a.promise.then(() => {
|
|
122
|
+
at === d && V();
|
|
122
123
|
});
|
|
123
124
|
}));
|
|
124
125
|
}
|
|
125
126
|
const E = {
|
|
126
127
|
set: A,
|
|
127
|
-
update: (
|
|
128
|
+
update: (_, w) => A(_(
|
|
128
129
|
/** @type {T} */
|
|
129
130
|
b,
|
|
130
131
|
/** @type {T} */
|
|
131
132
|
e
|
|
132
133
|
), w),
|
|
133
134
|
subscribe: s.subscribe,
|
|
134
|
-
stiffness:
|
|
135
|
+
stiffness: i,
|
|
135
136
|
damping: o,
|
|
136
|
-
precision:
|
|
137
|
+
precision: n
|
|
137
138
|
};
|
|
138
139
|
return E;
|
|
139
140
|
}
|
|
140
|
-
var z, D, T, p, j, C,
|
|
141
|
+
var z, D, T, p, j, C, x, R, G, k, F, N, ft;
|
|
141
142
|
const v = class v {
|
|
142
143
|
/**
|
|
143
144
|
* @param {T} value
|
|
144
145
|
* @param {SpringOpts} [options]
|
|
145
146
|
*/
|
|
146
147
|
constructor(t, s = {}) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
c(this, N);
|
|
149
|
+
c(this, z, O(0.15));
|
|
150
|
+
c(this, D, O(0.8));
|
|
151
|
+
c(this, T, O(0.01));
|
|
152
|
+
c(this, p, O(
|
|
152
153
|
/** @type {T} */
|
|
153
154
|
void 0
|
|
154
155
|
));
|
|
155
|
-
|
|
156
|
+
c(this, j, O(
|
|
156
157
|
/** @type {T} */
|
|
157
158
|
void 0
|
|
158
159
|
));
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
c(this, C);
|
|
161
|
+
c(this, x, 0);
|
|
162
|
+
c(this, R, 1);
|
|
163
|
+
c(this, G, 0);
|
|
163
164
|
/** @type {import('../internal/client/types').Task | null} */
|
|
164
|
-
|
|
165
|
+
c(this, k, null);
|
|
165
166
|
/** @type {ReturnType<typeof deferred> | null} */
|
|
166
|
-
|
|
167
|
+
c(this, F, null);
|
|
167
168
|
r(this, p).v = r(this, j).v = t, typeof s.stiffness == "number" && (r(this, z).v = I(s.stiffness, 0, 1)), typeof s.damping == "number" && (r(this, D).v = I(s.damping, 0, 1)), typeof s.precision == "number" && (r(this, T).v = s.precision);
|
|
168
169
|
}
|
|
169
170
|
/**
|
|
@@ -184,10 +185,10 @@ const v = class v {
|
|
|
184
185
|
* @param {SpringOpts} [options]
|
|
185
186
|
*/
|
|
186
187
|
static of(t, s) {
|
|
187
|
-
const
|
|
188
|
+
const i = new v(t(), s);
|
|
188
189
|
return rt(() => {
|
|
189
|
-
|
|
190
|
-
}),
|
|
190
|
+
i.set(t());
|
|
191
|
+
}), i;
|
|
191
192
|
}
|
|
192
193
|
/**
|
|
193
194
|
* Sets `spring.target` to `value` and returns a `Promise` that resolves if and when `spring.current` catches up to it.
|
|
@@ -201,52 +202,52 @@ const v = class v {
|
|
|
201
202
|
* @param {SpringUpdateOpts} [options]
|
|
202
203
|
*/
|
|
203
204
|
set(t, s) {
|
|
204
|
-
var o,
|
|
205
|
-
if ((o = r(this,
|
|
206
|
-
return (
|
|
205
|
+
var o, n;
|
|
206
|
+
if ((o = r(this, F)) == null || o.reject(new Error("Aborted")), s != null && s.instant || r(this, p).v === void 0)
|
|
207
|
+
return (n = r(this, k)) == null || n.abort(), h(this, k, null), g(r(this, p), g(r(this, j), t)), h(this, C, t), Promise.resolve();
|
|
207
208
|
s != null && s.preserveMomentum && (h(this, R, 0), h(this, G, s.preserveMomentum));
|
|
208
|
-
var
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
}),
|
|
209
|
+
var i = h(this, F, lt());
|
|
210
|
+
return i.promise.catch(ut), st(this, N, ft).call(this, t).then(() => {
|
|
211
|
+
i === r(this, F) && i.resolve(void 0);
|
|
212
|
+
}), i.promise;
|
|
212
213
|
}
|
|
213
214
|
get current() {
|
|
214
|
-
return
|
|
215
|
+
return S(r(this, p));
|
|
215
216
|
}
|
|
216
217
|
get damping() {
|
|
217
|
-
return
|
|
218
|
+
return S(r(this, D));
|
|
218
219
|
}
|
|
219
220
|
set damping(t) {
|
|
220
221
|
g(r(this, D), I(t, 0, 1));
|
|
221
222
|
}
|
|
222
223
|
get precision() {
|
|
223
|
-
return
|
|
224
|
+
return S(r(this, T));
|
|
224
225
|
}
|
|
225
226
|
set precision(t) {
|
|
226
227
|
g(r(this, T), t);
|
|
227
228
|
}
|
|
228
229
|
get stiffness() {
|
|
229
|
-
return
|
|
230
|
+
return S(r(this, z));
|
|
230
231
|
}
|
|
231
232
|
set stiffness(t) {
|
|
232
233
|
g(r(this, z), I(t, 0, 1));
|
|
233
234
|
}
|
|
234
235
|
get target() {
|
|
235
|
-
return
|
|
236
|
+
return S(r(this, j));
|
|
236
237
|
}
|
|
237
238
|
set target(t) {
|
|
238
239
|
this.set(t);
|
|
239
240
|
}
|
|
240
241
|
};
|
|
241
|
-
z = new WeakMap(), D = new WeakMap(), T = new WeakMap(), p = new WeakMap(), j = new WeakMap(), C = new WeakMap(),
|
|
242
|
+
z = new WeakMap(), D = new WeakMap(), T = new WeakMap(), p = new WeakMap(), j = new WeakMap(), C = new WeakMap(), x = new WeakMap(), R = new WeakMap(), G = new WeakMap(), k = new WeakMap(), F = new WeakMap(), N = new WeakSet(), /** @param {T} value */
|
|
242
243
|
ft = function(t) {
|
|
243
|
-
var
|
|
244
|
-
if (g(r(this, j), t), (
|
|
245
|
-
h(this,
|
|
244
|
+
var i;
|
|
245
|
+
if (g(r(this, j), t), (i = r(this, p)).v ?? (i.v = t), r(this, C) ?? h(this, C, r(this, p).v), !r(this, k)) {
|
|
246
|
+
h(this, x, u.now());
|
|
246
247
|
var s = 1e3 / (r(this, G) * 60);
|
|
247
248
|
r(this, k) ?? h(this, k, U((o) => {
|
|
248
249
|
h(this, R, Math.min(r(this, R) + s, 1));
|
|
249
|
-
const
|
|
250
|
+
const n = Math.min(o - r(this, x), 1e3 / 30), f = {
|
|
250
251
|
inv_mass: r(this, R),
|
|
251
252
|
opts: {
|
|
252
253
|
stiffness: r(this, z).v,
|
|
@@ -254,10 +255,10 @@ ft = function(t) {
|
|
|
254
255
|
precision: r(this, T).v
|
|
255
256
|
},
|
|
256
257
|
settled: !0,
|
|
257
|
-
dt:
|
|
258
|
+
dt: n * 60 / 1e3
|
|
258
259
|
};
|
|
259
|
-
var
|
|
260
|
-
return h(this, C, r(this, p).v), h(this,
|
|
260
|
+
var a = K(f, r(this, C), r(this, p).v, r(this, j).v);
|
|
261
|
+
return h(this, C, r(this, p).v), h(this, x, o), g(r(this, p), a), f.settled && h(this, k, null), !f.settled;
|
|
261
262
|
}));
|
|
262
263
|
}
|
|
263
264
|
return r(this, k).promise;
|
|
@@ -272,106 +273,106 @@ function L(e, t) {
|
|
|
272
273
|
if (s !== typeof t || Array.isArray(e) !== Array.isArray(t))
|
|
273
274
|
throw new Error("Cannot interpolate values of different type");
|
|
274
275
|
if (Array.isArray(e)) {
|
|
275
|
-
const
|
|
276
|
+
const i = (
|
|
276
277
|
/** @type {Array<any>} */
|
|
277
|
-
t.map((o,
|
|
278
|
+
t.map((o, n) => L(
|
|
278
279
|
/** @type {Array<any>} */
|
|
279
|
-
e[
|
|
280
|
+
e[n],
|
|
280
281
|
o
|
|
281
282
|
))
|
|
282
283
|
);
|
|
283
|
-
return (o) =>
|
|
284
|
+
return (o) => i.map((n) => n(o));
|
|
284
285
|
}
|
|
285
286
|
if (s === "object") {
|
|
286
287
|
if (!e || !t)
|
|
287
288
|
throw new Error("Object cannot be null");
|
|
288
289
|
if (J(e) && J(t)) {
|
|
289
|
-
const
|
|
290
|
-
return (d) => new Date(
|
|
290
|
+
const n = e.getTime(), a = t.getTime() - n;
|
|
291
|
+
return (d) => new Date(n + d * a);
|
|
291
292
|
}
|
|
292
|
-
const
|
|
293
|
-
return
|
|
294
|
-
o[
|
|
295
|
-
}), (
|
|
293
|
+
const i = Object.keys(t), o = {};
|
|
294
|
+
return i.forEach((n) => {
|
|
295
|
+
o[n] = L(e[n], t[n]);
|
|
296
|
+
}), (n) => {
|
|
296
297
|
const f = {};
|
|
297
|
-
return
|
|
298
|
-
f[
|
|
298
|
+
return i.forEach((a) => {
|
|
299
|
+
f[a] = o[a](n);
|
|
299
300
|
}), f;
|
|
300
301
|
};
|
|
301
302
|
}
|
|
302
303
|
if (s === "number") {
|
|
303
|
-
const
|
|
304
|
+
const i = (
|
|
304
305
|
/** @type {number} */
|
|
305
306
|
t - /** @type {number} */
|
|
306
307
|
e
|
|
307
308
|
);
|
|
308
|
-
return (o) => e + o *
|
|
309
|
+
return (o) => e + o * i;
|
|
309
310
|
}
|
|
310
311
|
return () => t;
|
|
311
312
|
}
|
|
312
|
-
function
|
|
313
|
+
function Mt(e, t = {}) {
|
|
313
314
|
const s = nt(e);
|
|
314
|
-
let
|
|
315
|
-
function
|
|
315
|
+
let i, o = e;
|
|
316
|
+
function n(f, a) {
|
|
316
317
|
if (o = f, e == null)
|
|
317
318
|
return s.set(e = f), Promise.resolve();
|
|
318
|
-
let d =
|
|
319
|
+
let d = i, m = !1, {
|
|
319
320
|
delay: b = 0,
|
|
320
|
-
duration:
|
|
321
|
+
duration: l = 400,
|
|
321
322
|
easing: P = it,
|
|
322
323
|
interpolate: y = L
|
|
323
|
-
} = { ...t, ...
|
|
324
|
-
if (
|
|
324
|
+
} = { ...t, ...a };
|
|
325
|
+
if (l === 0)
|
|
325
326
|
return d && (d.abort(), d = null), s.set(e = o), Promise.resolve();
|
|
326
|
-
const A =
|
|
327
|
+
const A = u.now() + b;
|
|
327
328
|
let E;
|
|
328
|
-
return
|
|
329
|
-
if (
|
|
329
|
+
return i = U((_) => {
|
|
330
|
+
if (_ < A) return !0;
|
|
330
331
|
m || (E = y(
|
|
331
332
|
/** @type {any} */
|
|
332
333
|
e,
|
|
333
334
|
f
|
|
334
|
-
), typeof
|
|
335
|
+
), typeof l == "function" && (l = l(
|
|
335
336
|
/** @type {any} */
|
|
336
337
|
e,
|
|
337
338
|
f
|
|
338
339
|
)), m = !0), d && (d.abort(), d = null);
|
|
339
|
-
const w =
|
|
340
|
+
const w = _ - A;
|
|
340
341
|
return w > /** @type {number} */
|
|
341
|
-
|
|
342
|
-
}),
|
|
342
|
+
l ? (s.set(e = f), !1) : (s.set(e = E(P(w / l))), !0);
|
|
343
|
+
}), i.promise;
|
|
343
344
|
}
|
|
344
345
|
return {
|
|
345
|
-
set:
|
|
346
|
-
update: (f,
|
|
346
|
+
set: n,
|
|
347
|
+
update: (f, a) => n(f(
|
|
347
348
|
/** @type {any} */
|
|
348
349
|
o,
|
|
349
350
|
/** @type {any} */
|
|
350
351
|
e
|
|
351
|
-
),
|
|
352
|
+
), a),
|
|
352
353
|
subscribe: s.subscribe
|
|
353
354
|
};
|
|
354
355
|
}
|
|
355
|
-
var M,
|
|
356
|
+
var M, Q, H, $;
|
|
356
357
|
const tt = class tt {
|
|
357
358
|
/**
|
|
358
359
|
* @param {T} value
|
|
359
360
|
* @param {TweenedOptions<T>} options
|
|
360
361
|
*/
|
|
361
362
|
constructor(t, s = {}) {
|
|
362
|
-
|
|
363
|
+
c(this, M, O(
|
|
363
364
|
/** @type {T} */
|
|
364
365
|
void 0
|
|
365
366
|
));
|
|
366
|
-
|
|
367
|
+
c(this, Q, O(
|
|
367
368
|
/** @type {T} */
|
|
368
369
|
void 0
|
|
369
370
|
));
|
|
370
371
|
/** @type {TweenedOptions<T>} */
|
|
371
|
-
|
|
372
|
+
c(this, H);
|
|
372
373
|
/** @type {import('../internal/client/types').Task | null} */
|
|
373
|
-
|
|
374
|
-
r(this, M).v = r(this,
|
|
374
|
+
c(this, $, null);
|
|
375
|
+
r(this, M).v = r(this, Q).v = t, h(this, H, s);
|
|
375
376
|
}
|
|
376
377
|
/**
|
|
377
378
|
* Create a tween whose value is bound to the return value of `fn`. This must be called
|
|
@@ -391,10 +392,10 @@ const tt = class tt {
|
|
|
391
392
|
* @param {TweenedOptions<U>} [options]
|
|
392
393
|
*/
|
|
393
394
|
static of(t, s) {
|
|
394
|
-
const
|
|
395
|
+
const i = new tt(t(), s);
|
|
395
396
|
return rt(() => {
|
|
396
|
-
|
|
397
|
-
}),
|
|
397
|
+
i.set(t());
|
|
398
|
+
}), i;
|
|
398
399
|
}
|
|
399
400
|
/**
|
|
400
401
|
* Sets `tween.target` to `value` and returns a `Promise` that resolves if and when `tween.current` catches up to it.
|
|
@@ -405,56 +406,56 @@ const tt = class tt {
|
|
|
405
406
|
* @returns
|
|
406
407
|
*/
|
|
407
408
|
set(t, s) {
|
|
408
|
-
var
|
|
409
|
-
g(r(this,
|
|
409
|
+
var l;
|
|
410
|
+
g(r(this, Q), t);
|
|
410
411
|
let {
|
|
411
|
-
delay:
|
|
412
|
+
delay: i = 0,
|
|
412
413
|
duration: o = 400,
|
|
413
|
-
easing:
|
|
414
|
+
easing: n = it,
|
|
414
415
|
interpolate: f = L
|
|
415
416
|
} = { ...r(this, H), ...s };
|
|
416
417
|
if (o === 0)
|
|
417
|
-
return (
|
|
418
|
-
const
|
|
418
|
+
return (l = r(this, $)) == null || l.abort(), g(r(this, M), t), Promise.resolve();
|
|
419
|
+
const a = u.now() + i;
|
|
419
420
|
let d, m = !1, b = r(this, $);
|
|
420
421
|
return h(this, $, U((P) => {
|
|
421
|
-
if (P <
|
|
422
|
+
if (P < a)
|
|
422
423
|
return !0;
|
|
423
424
|
if (!m) {
|
|
424
425
|
m = !0;
|
|
425
426
|
const A = r(this, M).v;
|
|
426
427
|
d = f(A, t), typeof o == "function" && (o = o(A, t)), b == null || b.abort();
|
|
427
428
|
}
|
|
428
|
-
const y = P -
|
|
429
|
+
const y = P - a;
|
|
429
430
|
return y > /** @type {number} */
|
|
430
|
-
o ? (g(r(this, M), t), !1) : (g(r(this, M), d(
|
|
431
|
+
o ? (g(r(this, M), t), !1) : (g(r(this, M), d(n(y / /** @type {number} */
|
|
431
432
|
o))), !0);
|
|
432
433
|
})), r(this, $).promise;
|
|
433
434
|
}
|
|
434
435
|
get current() {
|
|
435
|
-
return
|
|
436
|
+
return S(r(this, M));
|
|
436
437
|
}
|
|
437
438
|
get target() {
|
|
438
|
-
return
|
|
439
|
+
return S(r(this, Q));
|
|
439
440
|
}
|
|
440
441
|
set target(t) {
|
|
441
442
|
this.set(t);
|
|
442
443
|
}
|
|
443
444
|
};
|
|
444
|
-
M = new WeakMap(),
|
|
445
|
+
M = new WeakMap(), Q = new WeakMap(), H = new WeakMap(), $ = new WeakMap();
|
|
445
446
|
let Z = tt;
|
|
446
|
-
const
|
|
447
|
+
const At = /* @__PURE__ */ new wt(
|
|
447
448
|
"(prefers-reduced-motion: reduce)"
|
|
448
449
|
), St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
449
450
|
__proto__: null,
|
|
450
451
|
Spring: Y,
|
|
451
452
|
Tween: Z,
|
|
452
|
-
prefersReducedMotion:
|
|
453
|
-
spring:
|
|
454
|
-
tweened:
|
|
453
|
+
prefersReducedMotion: At,
|
|
454
|
+
spring: kt,
|
|
455
|
+
tweened: Mt
|
|
455
456
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
456
457
|
export {
|
|
457
458
|
St as i,
|
|
458
459
|
U as l,
|
|
459
|
-
|
|
460
|
+
u as r
|
|
460
461
|
};
|