@vezham/start 0.2.1 → 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/{3VW64HDT-BpR9N6I5.mjs → 3VW64HDT-DzqQ9sJJ.mjs} +2 -2
- package/{67EVQ76A-B7zB1bOe.mjs → 67EVQ76A-Dv550KbX.mjs} +1 -1
- package/{J3FDRF32-BmFo5HGb.mjs → J3FDRF32-NokiGAcz.mjs} +2 -2
- package/index-BSmv-Jo5.mjs +51675 -0
- package/{index-bGStj5AC.mjs → index-BiIWfpNy.mjs} +624 -587
- package/{index-CGXZNDKt.mjs → index-CZ3OqGXH.mjs} +3 -3
- package/index.mjs +2 -2
- package/lib/provider/src/types.d.ts +11 -2
- package/package.json +4 -4
- package/style.css +1 -1
- package/3VW64HDT-BnET31Hh.js +0 -1
- package/67EVQ76A-C3tlqUTO.js +0 -1200
- package/J3FDRF32-x0Ykygn2.js +0 -1
- package/index-BM-G1h7Y.js +0 -256
- package/index-BsvrQ2Uq.mjs +0 -50232
- package/index-CMjQ2Sxu.js +0 -1
- package/index-DJ5f1L6V.js +0 -1
- package/index.js +0 -1
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { r as wn, a as xt, t as wt, b as Mn, m as ee, i as R, c as Pn, n as q, d as Re, e as Mt, f as G, p as ye, g as Cn, h as Pt, j as F, k as Ee, l as X, q as Dn, v as Fn, s as On, w as re, x as te, y as In, z as Ye, A as ve, B as Rn, C as oe, M as En, D as Ct, E as Dt, F as Ft, G as qe, H as Ot, I as Kn, J as It, K as Nn, L as Bn, N as Xe, S as kn, O as Ln, P as _n, Q as Gn, R as Un, T as $n, U as jn, V as Hn, W as Wn, X as zn, Y as Yn, Z as qn, _ as Xn } from "./index-BSmv-Jo5.mjs";
|
|
2
|
+
import { Fragment as Zn } from "react";
|
|
3
3
|
// @__NO_SIDE_EFFECTS__
|
|
4
|
-
function
|
|
4
|
+
function Ke(t) {
|
|
5
5
|
let e;
|
|
6
6
|
return () => (e === void 0 && (e = t()), e);
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const Ne = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
|
|
9
9
|
const s = e - t;
|
|
10
10
|
return s === 0 ? 1 : (n - t) / s;
|
|
11
|
-
}, I = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, E = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3;
|
|
12
|
-
|
|
13
|
-
const s = t.getProps();
|
|
14
|
-
return bt(s, e, n !== void 0 ? n : s.custom, t);
|
|
15
|
-
}
|
|
16
|
-
const Hn = /* @__PURE__ */ Re(() => window.ScrollTimeline !== void 0);
|
|
17
|
-
class Wn {
|
|
11
|
+
}, I = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, E = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3, Jn = /* @__PURE__ */ Ke(() => window.ScrollTimeline !== void 0);
|
|
12
|
+
class Qn {
|
|
18
13
|
constructor(e) {
|
|
19
14
|
this.stop = () => this.runAll("stop"), this.animations = e.filter(Boolean);
|
|
20
15
|
}
|
|
@@ -33,7 +28,7 @@ class Wn {
|
|
|
33
28
|
}
|
|
34
29
|
attachTimeline(e, n) {
|
|
35
30
|
const s = this.animations.map((i) => {
|
|
36
|
-
if (
|
|
31
|
+
if (Jn() && i.attachTimeline)
|
|
37
32
|
return i.attachTimeline(e);
|
|
38
33
|
if (typeof n == "function")
|
|
39
34
|
return n(i);
|
|
@@ -84,108 +79,97 @@ class Wn {
|
|
|
84
79
|
this.runAll("complete");
|
|
85
80
|
}
|
|
86
81
|
}
|
|
87
|
-
class
|
|
82
|
+
class es extends Qn {
|
|
88
83
|
then(e, n) {
|
|
89
84
|
return Promise.all(this.animations).then(e).catch(n);
|
|
90
85
|
}
|
|
91
86
|
}
|
|
92
|
-
function
|
|
87
|
+
function Rt(t, e) {
|
|
93
88
|
return t ? t[e] || t.default || t : void 0;
|
|
94
89
|
}
|
|
95
|
-
const
|
|
96
|
-
function
|
|
90
|
+
const be = 2e4;
|
|
91
|
+
function Et(t) {
|
|
97
92
|
let e = 0;
|
|
98
93
|
const n = 50;
|
|
99
94
|
let s = t.next(e);
|
|
100
|
-
for (; !s.done && e <
|
|
95
|
+
for (; !s.done && e < be; )
|
|
101
96
|
e += n, s = t.next(e);
|
|
102
|
-
return e >=
|
|
97
|
+
return e >= be ? 1 / 0 : e;
|
|
103
98
|
}
|
|
104
|
-
function
|
|
99
|
+
function Be(t) {
|
|
105
100
|
return typeof t == "function";
|
|
106
101
|
}
|
|
107
|
-
function
|
|
102
|
+
function Ze(t, e) {
|
|
108
103
|
t.timeline = e, t.onfinish = null;
|
|
109
104
|
}
|
|
110
|
-
const
|
|
105
|
+
const ke = (t) => Array.isArray(t) && typeof t[0] == "number", ts = {
|
|
111
106
|
linearEasing: void 0
|
|
112
107
|
};
|
|
113
|
-
function
|
|
114
|
-
const n = /* @__PURE__ */
|
|
108
|
+
function ns(t, e) {
|
|
109
|
+
const n = /* @__PURE__ */ Ke(t);
|
|
115
110
|
return () => {
|
|
116
111
|
var s;
|
|
117
|
-
return (s =
|
|
112
|
+
return (s = ts[e]) !== null && s !== void 0 ? s : n();
|
|
118
113
|
};
|
|
119
114
|
}
|
|
120
|
-
const
|
|
115
|
+
const ne = /* @__PURE__ */ ns(() => {
|
|
121
116
|
try {
|
|
122
117
|
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
123
118
|
} catch {
|
|
124
119
|
return !1;
|
|
125
120
|
}
|
|
126
121
|
return !0;
|
|
127
|
-
}, "linearEasing"),
|
|
122
|
+
}, "linearEasing"), Kt = (t, e, n = 10) => {
|
|
128
123
|
let s = "";
|
|
129
124
|
const i = Math.max(Math.round(e / n), 2);
|
|
130
125
|
for (let r = 0; r < i; r++)
|
|
131
|
-
s += t(/* @__PURE__ */
|
|
126
|
+
s += t(/* @__PURE__ */ Ne(0, i - 1, r)) + ", ";
|
|
132
127
|
return `linear(${s.substring(0, s.length - 2)})`;
|
|
133
128
|
};
|
|
134
|
-
function
|
|
135
|
-
return !!(typeof t == "function" &&
|
|
129
|
+
function Nt(t) {
|
|
130
|
+
return !!(typeof t == "function" && ne() || !t || typeof t == "string" && (t in Te || ne()) || ke(t) || Array.isArray(t) && t.every(Nt));
|
|
136
131
|
}
|
|
137
|
-
const
|
|
132
|
+
const H = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, Te = {
|
|
138
133
|
linear: "linear",
|
|
139
134
|
ease: "ease",
|
|
140
135
|
easeIn: "ease-in",
|
|
141
136
|
easeOut: "ease-out",
|
|
142
137
|
easeInOut: "ease-in-out",
|
|
143
|
-
circIn: /* @__PURE__ */
|
|
144
|
-
circOut: /* @__PURE__ */
|
|
145
|
-
backIn: /* @__PURE__ */
|
|
146
|
-
backOut: /* @__PURE__ */
|
|
138
|
+
circIn: /* @__PURE__ */ H([0, 0.65, 0.55, 1]),
|
|
139
|
+
circOut: /* @__PURE__ */ H([0.55, 0, 1, 0.45]),
|
|
140
|
+
backIn: /* @__PURE__ */ H([0.31, 0.01, 0.66, -0.59]),
|
|
141
|
+
backOut: /* @__PURE__ */ H([0.33, 1.53, 0.69, 0.99])
|
|
147
142
|
};
|
|
148
|
-
function
|
|
143
|
+
function Bt(t, e) {
|
|
149
144
|
if (t)
|
|
150
|
-
return typeof t == "function" &&
|
|
145
|
+
return typeof t == "function" && ne() ? Kt(t, e) : ke(t) ? H(t) : Array.isArray(t) ? t.map((n) => Bt(n, e) || Te.easeOut) : Te[t];
|
|
151
146
|
}
|
|
152
|
-
const
|
|
147
|
+
const ss = {
|
|
153
148
|
y: !1
|
|
154
149
|
};
|
|
155
|
-
function
|
|
156
|
-
return
|
|
157
|
-
}
|
|
158
|
-
function Jn(t, e, n) {
|
|
159
|
-
var s;
|
|
160
|
-
if (t instanceof EventTarget)
|
|
161
|
-
return [t];
|
|
162
|
-
if (typeof t == "string") {
|
|
163
|
-
let i = document;
|
|
164
|
-
const r = (s = void 0) !== null && s !== void 0 ? s : i.querySelectorAll(t);
|
|
165
|
-
return r ? Array.from(r) : [];
|
|
166
|
-
}
|
|
167
|
-
return Array.from(t);
|
|
150
|
+
function is() {
|
|
151
|
+
return ss.y;
|
|
168
152
|
}
|
|
169
|
-
function
|
|
170
|
-
const n =
|
|
153
|
+
function kt(t, e) {
|
|
154
|
+
const n = wn(t), s = new AbortController(), i = {
|
|
171
155
|
passive: !0,
|
|
172
156
|
...e,
|
|
173
157
|
signal: s.signal
|
|
174
158
|
};
|
|
175
159
|
return [n, i, () => s.abort()];
|
|
176
160
|
}
|
|
177
|
-
function
|
|
178
|
-
return !(t.pointerType === "touch" ||
|
|
161
|
+
function Je(t) {
|
|
162
|
+
return !(t.pointerType === "touch" || is());
|
|
179
163
|
}
|
|
180
|
-
function
|
|
181
|
-
const [s, i, r] =
|
|
182
|
-
if (!
|
|
164
|
+
function rs(t, e, n = {}) {
|
|
165
|
+
const [s, i, r] = kt(t, n), o = (a) => {
|
|
166
|
+
if (!Je(a))
|
|
183
167
|
return;
|
|
184
168
|
const { target: l } = a, u = e(l, a);
|
|
185
169
|
if (typeof u != "function" || !l)
|
|
186
170
|
return;
|
|
187
171
|
const c = (d) => {
|
|
188
|
-
|
|
172
|
+
Je(d) && (u(d), l.removeEventListener("pointerleave", c));
|
|
189
173
|
};
|
|
190
174
|
l.addEventListener("pointerleave", c, i);
|
|
191
175
|
};
|
|
@@ -193,7 +177,7 @@ function Qn(t, e, n = {}) {
|
|
|
193
177
|
a.addEventListener("pointerenter", o, i);
|
|
194
178
|
}), r;
|
|
195
179
|
}
|
|
196
|
-
function
|
|
180
|
+
function Qe(t, e) {
|
|
197
181
|
const n = `${e}PointerCapture`;
|
|
198
182
|
if (t.target instanceof Element && n in t.target && t.pointerId !== void 0)
|
|
199
183
|
try {
|
|
@@ -201,58 +185,58 @@ function Xe(t, e) {
|
|
|
201
185
|
} catch {
|
|
202
186
|
}
|
|
203
187
|
}
|
|
204
|
-
const
|
|
188
|
+
const Lt = (t, e) => e ? t === e ? !0 : Lt(t, e.parentElement) : !1, os = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== !1, as = /* @__PURE__ */ new Set([
|
|
205
189
|
"BUTTON",
|
|
206
190
|
"INPUT",
|
|
207
191
|
"SELECT",
|
|
208
192
|
"TEXTAREA",
|
|
209
193
|
"A"
|
|
210
194
|
]);
|
|
211
|
-
function
|
|
212
|
-
return
|
|
195
|
+
function ls(t) {
|
|
196
|
+
return as.has(t.tagName) || t.tabIndex !== -1;
|
|
213
197
|
}
|
|
214
|
-
const
|
|
215
|
-
function
|
|
198
|
+
const W = /* @__PURE__ */ new WeakSet();
|
|
199
|
+
function et(t) {
|
|
216
200
|
return (e) => {
|
|
217
201
|
e.key === "Enter" && t(e);
|
|
218
202
|
};
|
|
219
203
|
}
|
|
220
|
-
function
|
|
204
|
+
function he(t, e) {
|
|
221
205
|
t.dispatchEvent(new PointerEvent("pointer" + e, { isPrimary: !0, bubbles: !0 }));
|
|
222
206
|
}
|
|
223
|
-
const
|
|
207
|
+
const us = (t, e) => {
|
|
224
208
|
const n = t.currentTarget;
|
|
225
209
|
if (!n)
|
|
226
210
|
return;
|
|
227
|
-
const s =
|
|
228
|
-
if (
|
|
211
|
+
const s = et(() => {
|
|
212
|
+
if (W.has(n))
|
|
229
213
|
return;
|
|
230
|
-
|
|
231
|
-
const i =
|
|
232
|
-
|
|
233
|
-
}), r = () =>
|
|
214
|
+
he(n, "down");
|
|
215
|
+
const i = et(() => {
|
|
216
|
+
he(n, "up");
|
|
217
|
+
}), r = () => he(n, "cancel");
|
|
234
218
|
n.addEventListener("keyup", i, e), n.addEventListener("blur", r, e);
|
|
235
219
|
});
|
|
236
220
|
n.addEventListener("keydown", s, e), n.addEventListener("blur", () => n.removeEventListener("keydown", s), e);
|
|
237
221
|
};
|
|
238
|
-
function
|
|
239
|
-
return
|
|
222
|
+
function tt(t) {
|
|
223
|
+
return os(t) && !0;
|
|
240
224
|
}
|
|
241
|
-
function
|
|
242
|
-
const [s, i, r] =
|
|
225
|
+
function cs(t, e, n = {}) {
|
|
226
|
+
const [s, i, r] = kt(t, n), o = (a) => {
|
|
243
227
|
const l = a.currentTarget;
|
|
244
|
-
if (!l || !
|
|
228
|
+
if (!l || !tt(a) || W.has(l))
|
|
245
229
|
return;
|
|
246
|
-
|
|
230
|
+
W.add(l), Qe(a, "set");
|
|
247
231
|
const u = e(l, a), c = (f, b) => {
|
|
248
|
-
l.removeEventListener("pointerup", d), l.removeEventListener("pointercancel", h),
|
|
232
|
+
l.removeEventListener("pointerup", d), l.removeEventListener("pointercancel", h), Qe(f, "release"), !(!tt(f) || !W.has(l)) && (W.delete(l), typeof u == "function" && u(f, { success: b }));
|
|
249
233
|
}, d = (f) => {
|
|
250
|
-
(f.isTrusted ?
|
|
234
|
+
(f.isTrusted ? ds(f, l instanceof Element ? l.getBoundingClientRect() : {
|
|
251
235
|
left: 0,
|
|
252
236
|
top: 0,
|
|
253
237
|
right: window.innerWidth,
|
|
254
238
|
bottom: window.innerHeight
|
|
255
|
-
}) : !1) ? c(f, !1) : c(f, !(l instanceof Element) ||
|
|
239
|
+
}) : !1) ? c(f, !1) : c(f, !(l instanceof Element) || Lt(l, f.target));
|
|
256
240
|
}, h = (f) => {
|
|
257
241
|
c(f, !1);
|
|
258
242
|
};
|
|
@@ -261,85 +245,89 @@ function is(t, e, n = {}) {
|
|
|
261
245
|
return s.forEach((a) => {
|
|
262
246
|
a = n.useGlobalTarget ? window : a;
|
|
263
247
|
let l = !1;
|
|
264
|
-
a instanceof HTMLElement && (l = !0, !
|
|
248
|
+
a instanceof HTMLElement && (l = !0, !ls(a) && a.getAttribute("tabindex") === null && (a.tabIndex = 0)), a.addEventListener("pointerdown", o, i), l && a.addEventListener("focus", (u) => us(u, i), i);
|
|
265
249
|
}), r;
|
|
266
250
|
}
|
|
267
|
-
function
|
|
251
|
+
function ds(t, e) {
|
|
268
252
|
return t.clientX < e.left || t.clientX > e.right || t.clientY < e.top || t.clientY > e.bottom;
|
|
269
253
|
}
|
|
270
|
-
|
|
254
|
+
function Z(t, e, n) {
|
|
255
|
+
const s = t.getProps();
|
|
256
|
+
return xt(s, e, n !== void 0 ? n : s.custom, t);
|
|
257
|
+
}
|
|
258
|
+
const _t = /* @__PURE__ */ new Set([
|
|
271
259
|
"width",
|
|
272
260
|
"height",
|
|
273
261
|
"top",
|
|
274
262
|
"left",
|
|
275
263
|
"right",
|
|
276
264
|
"bottom",
|
|
277
|
-
...
|
|
265
|
+
...wt
|
|
278
266
|
]);
|
|
279
|
-
function
|
|
280
|
-
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e,
|
|
267
|
+
function hs(t, e, n) {
|
|
268
|
+
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, ee(n));
|
|
281
269
|
}
|
|
282
|
-
function
|
|
283
|
-
const n =
|
|
270
|
+
function fs(t, e) {
|
|
271
|
+
const n = Z(t, e);
|
|
284
272
|
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
|
|
285
273
|
r = { ...r, ...s };
|
|
286
274
|
for (const o in r) {
|
|
287
|
-
const a =
|
|
288
|
-
|
|
275
|
+
const a = Mn(r[o]);
|
|
276
|
+
hs(t, o, a);
|
|
289
277
|
}
|
|
290
278
|
}
|
|
291
|
-
function
|
|
292
|
-
return !!(
|
|
279
|
+
function ps(t) {
|
|
280
|
+
return !!(R(t) && t.add);
|
|
293
281
|
}
|
|
294
|
-
function
|
|
282
|
+
function ms(t, e) {
|
|
295
283
|
const n = t.getValue("willChange");
|
|
296
|
-
if (
|
|
284
|
+
if (ps(n))
|
|
297
285
|
return n.add(e);
|
|
298
286
|
}
|
|
299
|
-
function
|
|
300
|
-
return t.props[
|
|
287
|
+
function gs(t) {
|
|
288
|
+
return t.props[Pn];
|
|
301
289
|
}
|
|
302
|
-
const
|
|
303
|
-
function
|
|
290
|
+
const Gt = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, ys = 1e-7, vs = 12;
|
|
291
|
+
function bs(t, e, n, s, i) {
|
|
304
292
|
let r, o, a = 0;
|
|
305
293
|
do
|
|
306
|
-
o = e + (n - e) / 2, r =
|
|
307
|
-
while (Math.abs(r) >
|
|
294
|
+
o = e + (n - e) / 2, r = Gt(o, s, i) - t, r > 0 ? n = o : e = o;
|
|
295
|
+
while (Math.abs(r) > ys && ++a < vs);
|
|
308
296
|
return o;
|
|
309
297
|
}
|
|
310
|
-
function
|
|
298
|
+
function Q(t, e, n, s) {
|
|
311
299
|
if (t === e && n === s)
|
|
312
300
|
return q;
|
|
313
|
-
const i = (r) =>
|
|
314
|
-
return (r) => r === 0 || r === 1 ? r :
|
|
301
|
+
const i = (r) => bs(r, 0, 1, t, n);
|
|
302
|
+
return (r) => r === 0 || r === 1 ? r : Gt(i(r), e, s);
|
|
315
303
|
}
|
|
316
|
-
const
|
|
317
|
-
function
|
|
318
|
-
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" ||
|
|
304
|
+
const Ut = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, $t = (t) => (e) => 1 - t(1 - e), jt = /* @__PURE__ */ Q(0.33, 1.53, 0.69, 0.99), Le = /* @__PURE__ */ $t(jt), Ht = /* @__PURE__ */ Ut(Le), Wt = (t) => (t *= 2) < 1 ? 0.5 * Le(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), _e = (t) => 1 - Math.sin(Math.acos(t)), Ts = $t(_e), zt = Ut(_e), Yt = (t) => /^0[^.\s]+$/u.test(t);
|
|
305
|
+
function Vs(t) {
|
|
306
|
+
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Yt(t) : !0;
|
|
319
307
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
308
|
+
const z = (t) => Math.round(t * 1e5) / 1e5, Ge = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
309
|
+
function Ss(t) {
|
|
322
310
|
return t == null;
|
|
323
311
|
}
|
|
324
|
-
const
|
|
312
|
+
const As = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, Ue = (t, e) => (n) => !!(typeof n == "string" && As.test(n) && n.startsWith(t) || e && !Ss(n) && Object.prototype.hasOwnProperty.call(n, e)), qt = (t, e, n) => (s) => {
|
|
325
313
|
if (typeof s != "string")
|
|
326
314
|
return s;
|
|
327
|
-
const [i, r, o, a] = s.match(
|
|
315
|
+
const [i, r, o, a] = s.match(Ge);
|
|
328
316
|
return {
|
|
329
317
|
[t]: parseFloat(i),
|
|
330
318
|
[e]: parseFloat(r),
|
|
331
319
|
[n]: parseFloat(o),
|
|
332
320
|
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
333
321
|
};
|
|
334
|
-
},
|
|
335
|
-
...
|
|
336
|
-
transform: (t) => Math.round(
|
|
322
|
+
}, xs = (t) => G(0, 255, t), fe = {
|
|
323
|
+
...Re,
|
|
324
|
+
transform: (t) => Math.round(xs(t))
|
|
337
325
|
}, N = {
|
|
338
|
-
test: /* @__PURE__ */
|
|
339
|
-
parse: /* @__PURE__ */
|
|
340
|
-
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" +
|
|
326
|
+
test: /* @__PURE__ */ Ue("rgb", "red"),
|
|
327
|
+
parse: /* @__PURE__ */ qt("red", "green", "blue"),
|
|
328
|
+
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + fe.transform(t) + ", " + fe.transform(e) + ", " + fe.transform(n) + ", " + z(Mt.transform(s)) + ")"
|
|
341
329
|
};
|
|
342
|
-
function
|
|
330
|
+
function ws(t) {
|
|
343
331
|
let e = "", n = "", s = "", i = "";
|
|
344
332
|
return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), {
|
|
345
333
|
red: parseInt(e, 16),
|
|
@@ -348,79 +336,79 @@ function bs(t) {
|
|
|
348
336
|
alpha: i ? parseInt(i, 16) / 255 : 1
|
|
349
337
|
};
|
|
350
338
|
}
|
|
351
|
-
const
|
|
352
|
-
test: /* @__PURE__ */
|
|
353
|
-
parse:
|
|
339
|
+
const Ve = {
|
|
340
|
+
test: /* @__PURE__ */ Ue("#"),
|
|
341
|
+
parse: ws,
|
|
354
342
|
transform: N.transform
|
|
355
343
|
}, _ = {
|
|
356
|
-
test: /* @__PURE__ */
|
|
357
|
-
parse: /* @__PURE__ */
|
|
358
|
-
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " +
|
|
344
|
+
test: /* @__PURE__ */ Ue("hsl", "hue"),
|
|
345
|
+
parse: /* @__PURE__ */ qt("hue", "saturation", "lightness"),
|
|
346
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + ye.transform(z(e)) + ", " + ye.transform(z(n)) + ", " + z(Mt.transform(s)) + ")"
|
|
359
347
|
}, w = {
|
|
360
|
-
test: (t) => N.test(t) ||
|
|
361
|
-
parse: (t) => N.test(t) ? N.parse(t) : _.test(t) ? _.parse(t) :
|
|
348
|
+
test: (t) => N.test(t) || Ve.test(t) || _.test(t),
|
|
349
|
+
parse: (t) => N.test(t) ? N.parse(t) : _.test(t) ? _.parse(t) : Ve.parse(t),
|
|
362
350
|
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? N.transform(t) : _.transform(t)
|
|
363
|
-
},
|
|
364
|
-
function
|
|
351
|
+
}, Ms = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
352
|
+
function Ps(t) {
|
|
365
353
|
var e, n;
|
|
366
|
-
return isNaN(t) && typeof t == "string" && (((e = t.match(
|
|
354
|
+
return isNaN(t) && typeof t == "string" && (((e = t.match(Ge)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(Ms)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
|
|
367
355
|
}
|
|
368
|
-
const
|
|
369
|
-
function
|
|
356
|
+
const Xt = "number", Zt = "color", Cs = "var", Ds = "var(", nt = "${}", Fs = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
357
|
+
function J(t) {
|
|
370
358
|
const e = t.toString(), n = [], s = {
|
|
371
359
|
color: [],
|
|
372
360
|
number: [],
|
|
373
361
|
var: []
|
|
374
362
|
}, i = [];
|
|
375
363
|
let r = 0;
|
|
376
|
-
const a = e.replace(
|
|
364
|
+
const a = e.replace(Fs, (l) => (w.test(l) ? (s.color.push(r), i.push(Zt), n.push(w.parse(l))) : l.startsWith(Ds) ? (s.var.push(r), i.push(Cs), n.push(l)) : (s.number.push(r), i.push(Xt), n.push(parseFloat(l))), ++r, nt)).split(nt);
|
|
377
365
|
return { values: n, split: a, indexes: s, types: i };
|
|
378
366
|
}
|
|
379
|
-
function
|
|
380
|
-
return
|
|
367
|
+
function Jt(t) {
|
|
368
|
+
return J(t).values;
|
|
381
369
|
}
|
|
382
|
-
function
|
|
383
|
-
const { split: e, types: n } =
|
|
370
|
+
function Qt(t) {
|
|
371
|
+
const { split: e, types: n } = J(t), s = e.length;
|
|
384
372
|
return (i) => {
|
|
385
373
|
let r = "";
|
|
386
374
|
for (let o = 0; o < s; o++)
|
|
387
375
|
if (r += e[o], i[o] !== void 0) {
|
|
388
376
|
const a = n[o];
|
|
389
|
-
a ===
|
|
377
|
+
a === Xt ? r += z(i[o]) : a === Zt ? r += w.transform(i[o]) : r += i[o];
|
|
390
378
|
}
|
|
391
379
|
return r;
|
|
392
380
|
};
|
|
393
381
|
}
|
|
394
|
-
const
|
|
395
|
-
function
|
|
396
|
-
const e =
|
|
397
|
-
return
|
|
398
|
-
}
|
|
399
|
-
const
|
|
400
|
-
test:
|
|
401
|
-
parse:
|
|
402
|
-
createTransformer:
|
|
403
|
-
getAnimatableNone:
|
|
404
|
-
},
|
|
405
|
-
function
|
|
382
|
+
const Os = (t) => typeof t == "number" ? 0 : t;
|
|
383
|
+
function Is(t) {
|
|
384
|
+
const e = Jt(t);
|
|
385
|
+
return Qt(t)(e.map(Os));
|
|
386
|
+
}
|
|
387
|
+
const $ = {
|
|
388
|
+
test: Ps,
|
|
389
|
+
parse: Jt,
|
|
390
|
+
createTransformer: Qt,
|
|
391
|
+
getAnimatableNone: Is
|
|
392
|
+
}, Rs = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
393
|
+
function Es(t) {
|
|
406
394
|
const [e, n] = t.slice(0, -1).split("(");
|
|
407
395
|
if (e === "drop-shadow")
|
|
408
396
|
return t;
|
|
409
|
-
const [s] = n.match(
|
|
397
|
+
const [s] = n.match(Ge) || [];
|
|
410
398
|
if (!s)
|
|
411
399
|
return t;
|
|
412
400
|
const i = n.replace(s, "");
|
|
413
|
-
let r =
|
|
401
|
+
let r = Rs.has(e) ? 1 : 0;
|
|
414
402
|
return s !== n && (r *= 100), e + "(" + r + i + ")";
|
|
415
403
|
}
|
|
416
|
-
const
|
|
417
|
-
|
|
404
|
+
const Ks = /\b([a-z-]*)\(.*?\)/gu, Se = {
|
|
405
|
+
...$,
|
|
418
406
|
getAnimatableNone: (t) => {
|
|
419
|
-
const e = t.match(
|
|
420
|
-
return e ? e.map(
|
|
407
|
+
const e = t.match(Ks);
|
|
408
|
+
return e ? e.map(Es).join(" ") : t;
|
|
421
409
|
}
|
|
422
|
-
},
|
|
423
|
-
...
|
|
410
|
+
}, Ns = {
|
|
411
|
+
...Cn,
|
|
424
412
|
// Color props
|
|
425
413
|
color: w,
|
|
426
414
|
backgroundColor: w,
|
|
@@ -433,43 +421,93 @@ const Ds = /\b([a-z-]*)\(.*?\)/gu, Ve = {
|
|
|
433
421
|
borderRightColor: w,
|
|
434
422
|
borderBottomColor: w,
|
|
435
423
|
borderLeftColor: w,
|
|
436
|
-
filter:
|
|
437
|
-
WebkitFilter:
|
|
438
|
-
},
|
|
439
|
-
function
|
|
440
|
-
let n =
|
|
441
|
-
return n !==
|
|
442
|
-
}
|
|
443
|
-
const
|
|
444
|
-
function
|
|
424
|
+
filter: Se,
|
|
425
|
+
WebkitFilter: Se
|
|
426
|
+
}, en = (t) => Ns[t];
|
|
427
|
+
function tn(t, e) {
|
|
428
|
+
let n = en(t);
|
|
429
|
+
return n !== Se && (n = $), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
430
|
+
}
|
|
431
|
+
const Bs = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
432
|
+
function ks(t, e, n) {
|
|
445
433
|
let s = 0, i;
|
|
446
434
|
for (; s < t.length && !i; ) {
|
|
447
435
|
const r = t[s];
|
|
448
|
-
typeof r == "string" && !
|
|
436
|
+
typeof r == "string" && !Bs.has(r) && J(r).values.length && (i = t[s]), s++;
|
|
449
437
|
}
|
|
450
438
|
if (i && n)
|
|
451
439
|
for (const r of e)
|
|
452
|
-
t[r] =
|
|
453
|
-
}
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
440
|
+
t[r] = tn(n, i);
|
|
441
|
+
}
|
|
442
|
+
const B = (t) => t * 180 / Math.PI, Ae = (t) => {
|
|
443
|
+
const e = B(Math.atan2(t[1], t[0]));
|
|
444
|
+
return xe(e);
|
|
445
|
+
}, Ls = {
|
|
446
|
+
x: 4,
|
|
447
|
+
y: 5,
|
|
448
|
+
translateX: 4,
|
|
449
|
+
translateY: 5,
|
|
450
|
+
scaleX: 0,
|
|
451
|
+
scaleY: 3,
|
|
452
|
+
scale: (t) => (Math.abs(t[0]) + Math.abs(t[3])) / 2,
|
|
453
|
+
rotate: Ae,
|
|
454
|
+
rotateZ: Ae,
|
|
455
|
+
skewX: (t) => B(Math.atan(t[1])),
|
|
456
|
+
skewY: (t) => B(Math.atan(t[2])),
|
|
457
|
+
skew: (t) => (Math.abs(t[1]) + Math.abs(t[2])) / 2
|
|
458
|
+
}, xe = (t) => (t = t % 360, t < 0 && (t += 360), t), st = Ae, it = (t) => Math.sqrt(t[0] * t[0] + t[1] * t[1]), rt = (t) => Math.sqrt(t[4] * t[4] + t[5] * t[5]), _s = {
|
|
459
|
+
x: 12,
|
|
460
|
+
y: 13,
|
|
461
|
+
z: 14,
|
|
462
|
+
translateX: 12,
|
|
463
|
+
translateY: 13,
|
|
464
|
+
translateZ: 14,
|
|
465
|
+
scaleX: it,
|
|
466
|
+
scaleY: rt,
|
|
467
|
+
scale: (t) => (it(t) + rt(t)) / 2,
|
|
468
|
+
rotateX: (t) => xe(B(Math.atan2(t[6], t[5]))),
|
|
469
|
+
rotateY: (t) => xe(B(Math.atan2(-t[2], t[0]))),
|
|
470
|
+
rotateZ: st,
|
|
471
|
+
rotate: st,
|
|
472
|
+
skewX: (t) => B(Math.atan(t[4])),
|
|
473
|
+
skewY: (t) => B(Math.atan(t[1])),
|
|
474
|
+
skew: (t) => (Math.abs(t[1]) + Math.abs(t[4])) / 2
|
|
475
|
+
};
|
|
476
|
+
function ot(t) {
|
|
477
|
+
return t.includes("scale") ? 1 : 0;
|
|
478
|
+
}
|
|
479
|
+
function we(t, e) {
|
|
480
|
+
if (!t || t === "none")
|
|
481
|
+
return ot(e);
|
|
482
|
+
const n = t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
|
|
483
|
+
let s, i;
|
|
484
|
+
if (n)
|
|
485
|
+
s = _s, i = n;
|
|
486
|
+
else {
|
|
487
|
+
const a = t.match(/^matrix\(([-\d.e\s,]+)\)$/u);
|
|
488
|
+
s = Ls, i = a;
|
|
463
489
|
}
|
|
464
|
-
|
|
465
|
-
|
|
490
|
+
if (!i)
|
|
491
|
+
return ot(e);
|
|
492
|
+
const r = s[e], o = i[1].split(",").map(Us);
|
|
493
|
+
return typeof r == "function" ? r(o) : o[r];
|
|
494
|
+
}
|
|
495
|
+
const Gs = (t, e) => {
|
|
496
|
+
const { transform: n = "none" } = getComputedStyle(t);
|
|
497
|
+
return we(n, e);
|
|
498
|
+
};
|
|
499
|
+
function Us(t) {
|
|
500
|
+
return parseFloat(t.trim());
|
|
501
|
+
}
|
|
502
|
+
const at = (t) => t === Re || t === Pt, $s = /* @__PURE__ */ new Set(["x", "y", "z"]), js = wt.filter((t) => !$s.has(t));
|
|
503
|
+
function Hs(t) {
|
|
466
504
|
const e = [];
|
|
467
|
-
return
|
|
505
|
+
return js.forEach((n) => {
|
|
468
506
|
const s = t.getValue(n);
|
|
469
507
|
s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
470
508
|
}), e;
|
|
471
509
|
}
|
|
472
|
-
const
|
|
510
|
+
const U = {
|
|
473
511
|
// Dimensions
|
|
474
512
|
width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
475
513
|
height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
@@ -478,18 +516,18 @@ const G = {
|
|
|
478
516
|
bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
|
|
479
517
|
right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
|
|
480
518
|
// Transform
|
|
481
|
-
x:
|
|
482
|
-
y:
|
|
519
|
+
x: (t, { transform: e }) => we(e, "x"),
|
|
520
|
+
y: (t, { transform: e }) => we(e, "y")
|
|
483
521
|
};
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
const
|
|
487
|
-
let
|
|
488
|
-
function
|
|
489
|
-
if (
|
|
490
|
-
const t = Array.from(
|
|
522
|
+
U.translateX = U.x;
|
|
523
|
+
U.translateY = U.y;
|
|
524
|
+
const k = /* @__PURE__ */ new Set();
|
|
525
|
+
let Me = !1, Pe = !1;
|
|
526
|
+
function nn() {
|
|
527
|
+
if (Pe) {
|
|
528
|
+
const t = Array.from(k).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
491
529
|
e.forEach((s) => {
|
|
492
|
-
const i =
|
|
530
|
+
const i = Hs(s);
|
|
493
531
|
i.length && (n.set(s, i), s.render());
|
|
494
532
|
}), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
|
|
495
533
|
s.render();
|
|
@@ -502,22 +540,22 @@ function Xt() {
|
|
|
502
540
|
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
|
|
503
541
|
});
|
|
504
542
|
}
|
|
505
|
-
|
|
543
|
+
Pe = !1, Me = !1, k.forEach((t) => t.complete()), k.clear();
|
|
506
544
|
}
|
|
507
|
-
function
|
|
508
|
-
|
|
509
|
-
t.readKeyframes(), t.needsMeasurement && (
|
|
545
|
+
function sn() {
|
|
546
|
+
k.forEach((t) => {
|
|
547
|
+
t.readKeyframes(), t.needsMeasurement && (Pe = !0);
|
|
510
548
|
});
|
|
511
549
|
}
|
|
512
|
-
function
|
|
513
|
-
|
|
550
|
+
function Ws() {
|
|
551
|
+
sn(), nn();
|
|
514
552
|
}
|
|
515
|
-
class
|
|
553
|
+
class $e {
|
|
516
554
|
constructor(e, n, s, i, r, o = !1) {
|
|
517
555
|
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = o;
|
|
518
556
|
}
|
|
519
557
|
scheduleResolve() {
|
|
520
|
-
this.isScheduled = !0, this.isAsync ? (
|
|
558
|
+
this.isScheduled = !0, this.isAsync ? (k.add(this), Me || (Me = !0, F.read(sn), F.resolveKeyframes(nn))) : (this.readKeyframes(), this.complete());
|
|
521
559
|
}
|
|
522
560
|
readKeyframes() {
|
|
523
561
|
const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
|
|
@@ -544,44 +582,44 @@ class ke {
|
|
|
544
582
|
measureEndState() {
|
|
545
583
|
}
|
|
546
584
|
complete() {
|
|
547
|
-
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe),
|
|
585
|
+
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), k.delete(this);
|
|
548
586
|
}
|
|
549
587
|
cancel() {
|
|
550
|
-
this.isComplete || (this.isScheduled = !1,
|
|
588
|
+
this.isComplete || (this.isScheduled = !1, k.delete(this));
|
|
551
589
|
}
|
|
552
590
|
resume() {
|
|
553
591
|
this.isComplete || this.scheduleResolve();
|
|
554
592
|
}
|
|
555
593
|
}
|
|
556
|
-
const
|
|
594
|
+
const rn = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), zs = (
|
|
557
595
|
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
558
596
|
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
559
597
|
);
|
|
560
|
-
function
|
|
561
|
-
const e =
|
|
598
|
+
function Ys(t) {
|
|
599
|
+
const e = zs.exec(t);
|
|
562
600
|
if (!e)
|
|
563
601
|
return [,];
|
|
564
602
|
const [, n, s, i] = e;
|
|
565
603
|
return [`--${n ?? s}`, i];
|
|
566
604
|
}
|
|
567
|
-
const
|
|
568
|
-
function
|
|
569
|
-
|
|
570
|
-
const [s, i] =
|
|
605
|
+
const qs = 4;
|
|
606
|
+
function on(t, e, n = 1) {
|
|
607
|
+
X(n <= qs, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
|
|
608
|
+
const [s, i] = Ys(t);
|
|
571
609
|
if (!s)
|
|
572
610
|
return;
|
|
573
611
|
const r = window.getComputedStyle(e).getPropertyValue(s);
|
|
574
612
|
if (r) {
|
|
575
613
|
const o = r.trim();
|
|
576
|
-
return
|
|
614
|
+
return rn(o) ? parseFloat(o) : o;
|
|
577
615
|
}
|
|
578
|
-
return
|
|
616
|
+
return Ee(i) ? on(i, e, n + 1) : i;
|
|
579
617
|
}
|
|
580
|
-
const
|
|
618
|
+
const an = (t) => (e) => e.test(t), Xs = {
|
|
581
619
|
test: (t) => t === "auto",
|
|
582
620
|
parse: (t) => t
|
|
583
|
-
},
|
|
584
|
-
class
|
|
621
|
+
}, ln = [Re, Pt, ye, Dn, Fn, On, Xs], lt = (t) => ln.find(an(t));
|
|
622
|
+
class un extends $e {
|
|
585
623
|
constructor(e, n, s, i, r) {
|
|
586
624
|
super(e, n, s, i, r, !0);
|
|
587
625
|
}
|
|
@@ -592,16 +630,16 @@ class nn extends ke {
|
|
|
592
630
|
super.readKeyframes();
|
|
593
631
|
for (let l = 0; l < e.length; l++) {
|
|
594
632
|
let u = e[l];
|
|
595
|
-
if (typeof u == "string" && (u = u.trim(),
|
|
596
|
-
const c =
|
|
633
|
+
if (typeof u == "string" && (u = u.trim(), Ee(u))) {
|
|
634
|
+
const c = on(u, n.current);
|
|
597
635
|
c !== void 0 && (e[l] = c), l === e.length - 1 && (this.finalKeyframe = u);
|
|
598
636
|
}
|
|
599
637
|
}
|
|
600
|
-
if (this.resolveNoneKeyframes(), !
|
|
638
|
+
if (this.resolveNoneKeyframes(), !_t.has(s) || e.length !== 2)
|
|
601
639
|
return;
|
|
602
|
-
const [i, r] = e, o =
|
|
640
|
+
const [i, r] = e, o = lt(i), a = lt(r);
|
|
603
641
|
if (o !== a)
|
|
604
|
-
if (
|
|
642
|
+
if (at(o) && at(a))
|
|
605
643
|
for (let l = 0; l < e.length; l++) {
|
|
606
644
|
const u = e[l];
|
|
607
645
|
typeof u == "string" && (e[l] = parseFloat(u));
|
|
@@ -612,14 +650,14 @@ class nn extends ke {
|
|
|
612
650
|
resolveNoneKeyframes() {
|
|
613
651
|
const { unresolvedKeyframes: e, name: n } = this, s = [];
|
|
614
652
|
for (let i = 0; i < e.length; i++)
|
|
615
|
-
|
|
616
|
-
s.length &&
|
|
653
|
+
Vs(e[i]) && s.push(i);
|
|
654
|
+
s.length && ks(e, s, n);
|
|
617
655
|
}
|
|
618
656
|
measureInitialState() {
|
|
619
657
|
const { element: e, unresolvedKeyframes: n, name: s } = this;
|
|
620
658
|
if (!e || !e.current)
|
|
621
659
|
return;
|
|
622
|
-
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin =
|
|
660
|
+
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = U[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
|
|
623
661
|
const i = n[n.length - 1];
|
|
624
662
|
i !== void 0 && e.getValue(s, i).jump(i, !1);
|
|
625
663
|
}
|
|
@@ -631,15 +669,15 @@ class nn extends ke {
|
|
|
631
669
|
const r = n.getValue(s);
|
|
632
670
|
r && r.jump(this.measuredOrigin, !1);
|
|
633
671
|
const o = i.length - 1, a = i[o];
|
|
634
|
-
i[o] =
|
|
672
|
+
i[o] = U[s](n.measureViewportBox(), window.getComputedStyle(n.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), !((e = this.removedTransforms) === null || e === void 0) && e.length && this.removedTransforms.forEach(([l, u]) => {
|
|
635
673
|
n.getValue(l).set(u);
|
|
636
674
|
}), this.resolveNoneKeyframes();
|
|
637
675
|
}
|
|
638
676
|
}
|
|
639
|
-
const
|
|
640
|
-
(
|
|
677
|
+
const ut = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
|
|
678
|
+
($.test(t) || t === "0") && // And it contains numbers and/or colors
|
|
641
679
|
!t.startsWith("url("));
|
|
642
|
-
function
|
|
680
|
+
function Zs(t) {
|
|
643
681
|
const e = t[0];
|
|
644
682
|
if (t.length === 1)
|
|
645
683
|
return !0;
|
|
@@ -647,24 +685,24 @@ function Gs(t) {
|
|
|
647
685
|
if (t[n] !== e)
|
|
648
686
|
return !0;
|
|
649
687
|
}
|
|
650
|
-
function
|
|
688
|
+
function Js(t, e, n, s) {
|
|
651
689
|
const i = t[0];
|
|
652
690
|
if (i === null)
|
|
653
691
|
return !1;
|
|
654
692
|
if (e === "display" || e === "visibility")
|
|
655
693
|
return !0;
|
|
656
|
-
const r = t[t.length - 1], o =
|
|
657
|
-
return
|
|
694
|
+
const r = t[t.length - 1], o = ut(i, e), a = ut(r, e);
|
|
695
|
+
return re(o === a, `You are trying to animate ${e} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`), !o || !a ? !1 : Zs(t) || (n === "spring" || Be(n)) && s;
|
|
658
696
|
}
|
|
659
|
-
const
|
|
660
|
-
function
|
|
661
|
-
const i = t.filter(
|
|
697
|
+
const Qs = (t) => t !== null;
|
|
698
|
+
function ae(t, { repeat: e, repeatType: n = "loop" }, s) {
|
|
699
|
+
const i = t.filter(Qs), r = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
|
|
662
700
|
return !r || s === void 0 ? i[r] : s;
|
|
663
701
|
}
|
|
664
|
-
const
|
|
665
|
-
class
|
|
702
|
+
const ei = 40;
|
|
703
|
+
class cn {
|
|
666
704
|
constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", ...a }) {
|
|
667
|
-
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt =
|
|
705
|
+
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = te.now(), this.options = {
|
|
668
706
|
autoplay: e,
|
|
669
707
|
delay: n,
|
|
670
708
|
type: s,
|
|
@@ -685,7 +723,7 @@ class sn {
|
|
|
685
723
|
* to avoid a sudden jump into the animation.
|
|
686
724
|
*/
|
|
687
725
|
calcStartTime() {
|
|
688
|
-
return this.resolvedAt ? this.resolvedAt - this.createdAt >
|
|
726
|
+
return this.resolvedAt ? this.resolvedAt - this.createdAt > ei ? this.resolvedAt : this.createdAt : this.createdAt;
|
|
689
727
|
}
|
|
690
728
|
/**
|
|
691
729
|
* A getter for resolved data. If keyframes are not yet resolved, accessing
|
|
@@ -693,7 +731,7 @@ class sn {
|
|
|
693
731
|
* This is a deoptimisation, but at its worst still batches read/writes.
|
|
694
732
|
*/
|
|
695
733
|
get resolved() {
|
|
696
|
-
return !this._resolved && !this.hasAttemptedResolve &&
|
|
734
|
+
return !this._resolved && !this.hasAttemptedResolve && Ws(), this._resolved;
|
|
697
735
|
}
|
|
698
736
|
/**
|
|
699
737
|
* A method to be called when the keyframes resolver completes. This method
|
|
@@ -701,13 +739,13 @@ class sn {
|
|
|
701
739
|
* Otherwise, it will call initPlayback on the implementing class.
|
|
702
740
|
*/
|
|
703
741
|
onKeyframesResolved(e, n) {
|
|
704
|
-
this.resolvedAt =
|
|
742
|
+
this.resolvedAt = te.now(), this.hasAttemptedResolve = !0;
|
|
705
743
|
const { name: s, type: i, velocity: r, delay: o, onComplete: a, onUpdate: l, isGenerator: u } = this.options;
|
|
706
|
-
if (!u && !
|
|
744
|
+
if (!u && !Js(e, s, i, r))
|
|
707
745
|
if (o)
|
|
708
746
|
this.options.duration = 0;
|
|
709
747
|
else {
|
|
710
|
-
l && l(
|
|
748
|
+
l && l(ae(e, this.options, n)), a && a(), this.resolveFinishedPromise();
|
|
711
749
|
return;
|
|
712
750
|
}
|
|
713
751
|
const c = this.initPlayback(e, n);
|
|
@@ -728,7 +766,7 @@ class sn {
|
|
|
728
766
|
return this.currentFinishedPromise.then(e, n);
|
|
729
767
|
}
|
|
730
768
|
flatten() {
|
|
731
|
-
this.options.type = "keyframes", this.options.ease = "linear";
|
|
769
|
+
this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear");
|
|
732
770
|
}
|
|
733
771
|
updateFinishedPromise() {
|
|
734
772
|
this.currentFinishedPromise = new Promise((e) => {
|
|
@@ -736,18 +774,18 @@ class sn {
|
|
|
736
774
|
});
|
|
737
775
|
}
|
|
738
776
|
}
|
|
739
|
-
const
|
|
740
|
-
function
|
|
777
|
+
const le = (t, e, n) => t + (e - t) * n;
|
|
778
|
+
function pe(t, e, n) {
|
|
741
779
|
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
|
|
742
780
|
}
|
|
743
|
-
function
|
|
781
|
+
function ti({ hue: t, saturation: e, lightness: n, alpha: s }) {
|
|
744
782
|
t /= 360, e /= 100, n /= 100;
|
|
745
783
|
let i = 0, r = 0, o = 0;
|
|
746
784
|
if (!e)
|
|
747
785
|
i = r = o = n;
|
|
748
786
|
else {
|
|
749
787
|
const a = n < 0.5 ? n * (1 + e) : n + e - n * e, l = 2 * n - a;
|
|
750
|
-
i =
|
|
788
|
+
i = pe(l, a, t + 1 / 3), r = pe(l, a, t), o = pe(l, a, t - 1 / 3);
|
|
751
789
|
}
|
|
752
790
|
return {
|
|
753
791
|
red: Math.round(i * 255),
|
|
@@ -756,55 +794,55 @@ function Hs({ hue: t, saturation: e, lightness: n, alpha: s }) {
|
|
|
756
794
|
alpha: s
|
|
757
795
|
};
|
|
758
796
|
}
|
|
759
|
-
function
|
|
797
|
+
function se(t, e) {
|
|
760
798
|
return (n) => n > 0 ? e : t;
|
|
761
799
|
}
|
|
762
|
-
const
|
|
800
|
+
const me = (t, e, n) => {
|
|
763
801
|
const s = t * t, i = n * (e * e - s) + s;
|
|
764
802
|
return i < 0 ? 0 : Math.sqrt(i);
|
|
765
|
-
},
|
|
766
|
-
function
|
|
767
|
-
const e =
|
|
768
|
-
if (
|
|
803
|
+
}, ni = [Ve, N, _], si = (t) => ni.find((e) => e.test(t));
|
|
804
|
+
function ct(t) {
|
|
805
|
+
const e = si(t);
|
|
806
|
+
if (re(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
769
807
|
return !1;
|
|
770
808
|
let n = e.parse(t);
|
|
771
|
-
return e === _ && (n =
|
|
809
|
+
return e === _ && (n = ti(n)), n;
|
|
772
810
|
}
|
|
773
|
-
const
|
|
774
|
-
const n =
|
|
811
|
+
const dt = (t, e) => {
|
|
812
|
+
const n = ct(t), s = ct(e);
|
|
775
813
|
if (!n || !s)
|
|
776
|
-
return
|
|
814
|
+
return se(t, e);
|
|
777
815
|
const i = { ...n };
|
|
778
|
-
return (r) => (i.red =
|
|
779
|
-
},
|
|
780
|
-
function
|
|
781
|
-
return
|
|
816
|
+
return (r) => (i.red = me(n.red, s.red, r), i.green = me(n.green, s.green, r), i.blue = me(n.blue, s.blue, r), i.alpha = le(n.alpha, s.alpha, r), N.transform(i));
|
|
817
|
+
}, ii = (t, e) => (n) => e(t(n)), ue = (...t) => t.reduce(ii), Ce = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
818
|
+
function ri(t, e) {
|
|
819
|
+
return Ce.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
782
820
|
}
|
|
783
|
-
function
|
|
784
|
-
return (n) =>
|
|
821
|
+
function oi(t, e) {
|
|
822
|
+
return (n) => le(t, e, n);
|
|
785
823
|
}
|
|
786
|
-
function
|
|
787
|
-
return typeof t == "number" ?
|
|
824
|
+
function je(t) {
|
|
825
|
+
return typeof t == "number" ? oi : typeof t == "string" ? Ee(t) ? se : w.test(t) ? dt : ui : Array.isArray(t) ? dn : typeof t == "object" ? w.test(t) ? dt : ai : se;
|
|
788
826
|
}
|
|
789
|
-
function
|
|
790
|
-
const n = [...t], s = n.length, i = t.map((r, o) =>
|
|
827
|
+
function dn(t, e) {
|
|
828
|
+
const n = [...t], s = n.length, i = t.map((r, o) => je(r)(r, e[o]));
|
|
791
829
|
return (r) => {
|
|
792
830
|
for (let o = 0; o < s; o++)
|
|
793
831
|
n[o] = i[o](r);
|
|
794
832
|
return n;
|
|
795
833
|
};
|
|
796
834
|
}
|
|
797
|
-
function
|
|
835
|
+
function ai(t, e) {
|
|
798
836
|
const n = { ...t, ...e }, s = {};
|
|
799
837
|
for (const i in n)
|
|
800
|
-
t[i] !== void 0 && e[i] !== void 0 && (s[i] =
|
|
838
|
+
t[i] !== void 0 && e[i] !== void 0 && (s[i] = je(t[i])(t[i], e[i]));
|
|
801
839
|
return (i) => {
|
|
802
840
|
for (const r in s)
|
|
803
841
|
n[r] = s[r](i);
|
|
804
842
|
return n;
|
|
805
843
|
};
|
|
806
844
|
}
|
|
807
|
-
function
|
|
845
|
+
function li(t, e) {
|
|
808
846
|
var n;
|
|
809
847
|
const s = [], i = { color: 0, var: 0, number: 0 };
|
|
810
848
|
for (let r = 0; r < e.values.length; r++) {
|
|
@@ -813,17 +851,17 @@ function Js(t, e) {
|
|
|
813
851
|
}
|
|
814
852
|
return s;
|
|
815
853
|
}
|
|
816
|
-
const
|
|
817
|
-
const n =
|
|
818
|
-
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ?
|
|
854
|
+
const ui = (t, e) => {
|
|
855
|
+
const n = $.createTransformer(e), s = J(t), i = J(e);
|
|
856
|
+
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? Ce.has(t) && !i.values.length || Ce.has(e) && !s.values.length ? ri(t, e) : ue(dn(li(s, i), i.values), n) : (re(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), se(t, e));
|
|
819
857
|
};
|
|
820
|
-
function
|
|
821
|
-
return typeof t == "number" && typeof e == "number" && typeof n == "number" ?
|
|
858
|
+
function hn(t, e, n) {
|
|
859
|
+
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? le(t, e, n) : je(t)(t, e);
|
|
822
860
|
}
|
|
823
|
-
const
|
|
824
|
-
function
|
|
825
|
-
const s = Math.max(e -
|
|
826
|
-
return
|
|
861
|
+
const ci = 5;
|
|
862
|
+
function fn(t, e, n) {
|
|
863
|
+
const s = Math.max(e - ci, 0);
|
|
864
|
+
return In(n - t(s), e - s);
|
|
827
865
|
}
|
|
828
866
|
const A = {
|
|
829
867
|
// Default spring physics
|
|
@@ -853,17 +891,17 @@ const A = {
|
|
|
853
891
|
// in seconds
|
|
854
892
|
minDamping: 0.05,
|
|
855
893
|
maxDamping: 1
|
|
856
|
-
},
|
|
857
|
-
function
|
|
894
|
+
}, ht = 1e-3;
|
|
895
|
+
function di({ duration: t = A.duration, bounce: e = A.bounce, velocity: n = A.velocity, mass: s = A.mass }) {
|
|
858
896
|
let i, r;
|
|
859
|
-
|
|
897
|
+
re(t <= /* @__PURE__ */ I(A.maxDuration), "Spring duration must be 10 seconds or less");
|
|
860
898
|
let o = 1 - e;
|
|
861
|
-
o =
|
|
862
|
-
const c = u * o, d = c * t, h = c - n, f =
|
|
863
|
-
return
|
|
899
|
+
o = G(A.minDamping, A.maxDamping, o), t = G(A.minDuration, A.maxDuration, /* @__PURE__ */ E(t)), o < 1 ? (i = (u) => {
|
|
900
|
+
const c = u * o, d = c * t, h = c - n, f = De(u, o), b = Math.exp(-d);
|
|
901
|
+
return ht - h / f * b;
|
|
864
902
|
}, r = (u) => {
|
|
865
|
-
const d = u * o * t, h = d * n + n, f = Math.pow(o, 2) * Math.pow(u, 2) * t, b = Math.exp(-d), v =
|
|
866
|
-
return (-i(u) +
|
|
903
|
+
const d = u * o * t, h = d * n + n, f = Math.pow(o, 2) * Math.pow(u, 2) * t, b = Math.exp(-d), v = De(Math.pow(u, 2), o);
|
|
904
|
+
return (-i(u) + ht > 0 ? -1 : 1) * ((h - f) * b) / v;
|
|
867
905
|
}) : (i = (u) => {
|
|
868
906
|
const c = Math.exp(-u * t), d = (u - n) * t + 1;
|
|
869
907
|
return -1e-3 + c * d;
|
|
@@ -871,7 +909,7 @@ function ti({ duration: t = A.duration, bounce: e = A.bounce, velocity: n = A.ve
|
|
|
871
909
|
const c = Math.exp(-u * t), d = (n - u) * (t * t);
|
|
872
910
|
return c * d;
|
|
873
911
|
});
|
|
874
|
-
const a = 5 / t, l =
|
|
912
|
+
const a = 5 / t, l = fi(i, r, a);
|
|
875
913
|
if (t = /* @__PURE__ */ I(t), isNaN(l))
|
|
876
914
|
return {
|
|
877
915
|
stiffness: A.stiffness,
|
|
@@ -887,21 +925,21 @@ function ti({ duration: t = A.duration, bounce: e = A.bounce, velocity: n = A.ve
|
|
|
887
925
|
};
|
|
888
926
|
}
|
|
889
927
|
}
|
|
890
|
-
const
|
|
891
|
-
function
|
|
928
|
+
const hi = 12;
|
|
929
|
+
function fi(t, e, n) {
|
|
892
930
|
let s = n;
|
|
893
|
-
for (let i = 1; i <
|
|
931
|
+
for (let i = 1; i < hi; i++)
|
|
894
932
|
s = s - t(s) / e(s);
|
|
895
933
|
return s;
|
|
896
934
|
}
|
|
897
|
-
function
|
|
935
|
+
function De(t, e) {
|
|
898
936
|
return t * Math.sqrt(1 - e * e);
|
|
899
937
|
}
|
|
900
|
-
const
|
|
901
|
-
function
|
|
938
|
+
const pi = ["duration", "bounce"], mi = ["stiffness", "damping", "mass"];
|
|
939
|
+
function ft(t, e) {
|
|
902
940
|
return e.some((n) => t[n] !== void 0);
|
|
903
941
|
}
|
|
904
|
-
function
|
|
942
|
+
function gi(t) {
|
|
905
943
|
let e = {
|
|
906
944
|
velocity: A.velocity,
|
|
907
945
|
stiffness: A.stiffness,
|
|
@@ -910,9 +948,9 @@ function oi(t) {
|
|
|
910
948
|
isResolvedFromDuration: !1,
|
|
911
949
|
...t
|
|
912
950
|
};
|
|
913
|
-
if (!
|
|
951
|
+
if (!ft(t, mi) && ft(t, pi))
|
|
914
952
|
if (t.visualDuration) {
|
|
915
|
-
const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 *
|
|
953
|
+
const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * G(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(i);
|
|
916
954
|
e = {
|
|
917
955
|
...e,
|
|
918
956
|
mass: A.mass,
|
|
@@ -920,7 +958,7 @@ function oi(t) {
|
|
|
920
958
|
damping: r
|
|
921
959
|
};
|
|
922
960
|
} else {
|
|
923
|
-
const n =
|
|
961
|
+
const n = di(t);
|
|
924
962
|
e = {
|
|
925
963
|
...e,
|
|
926
964
|
...n,
|
|
@@ -929,21 +967,21 @@ function oi(t) {
|
|
|
929
967
|
}
|
|
930
968
|
return e;
|
|
931
969
|
}
|
|
932
|
-
function
|
|
970
|
+
function pn(t = A.visualDuration, e = A.bounce) {
|
|
933
971
|
const n = typeof t != "object" ? {
|
|
934
972
|
visualDuration: t,
|
|
935
973
|
keyframes: [0, 1],
|
|
936
974
|
bounce: e
|
|
937
975
|
} : t;
|
|
938
976
|
let { restSpeed: s, restDelta: i } = n;
|
|
939
|
-
const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: l, damping: u, mass: c, duration: d, velocity: h, isResolvedFromDuration: f } =
|
|
977
|
+
const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: l, damping: u, mass: c, duration: d, velocity: h, isResolvedFromDuration: f } = gi({
|
|
940
978
|
...n,
|
|
941
979
|
velocity: -/* @__PURE__ */ E(n.velocity || 0)
|
|
942
980
|
}), b = h || 0, v = u / (2 * Math.sqrt(l * c)), y = o - r, p = /* @__PURE__ */ E(Math.sqrt(l / c)), T = Math.abs(y) < 5;
|
|
943
981
|
s || (s = T ? A.restSpeed.granular : A.restSpeed.default), i || (i = T ? A.restDelta.granular : A.restDelta.default);
|
|
944
982
|
let V;
|
|
945
983
|
if (v < 1) {
|
|
946
|
-
const g =
|
|
984
|
+
const g = De(p, v);
|
|
947
985
|
V = (S) => {
|
|
948
986
|
const x = Math.exp(-v * p * S);
|
|
949
987
|
return o - x * ((b + v * p * y) / g * Math.sin(g * S) + y * Math.cos(g * S));
|
|
@@ -957,7 +995,7 @@ function ln(t = A.visualDuration, e = A.bounce) {
|
|
|
957
995
|
return o - x * ((b + v * p * y) * Math.sinh(m) + g * y * Math.cosh(m)) / g;
|
|
958
996
|
};
|
|
959
997
|
}
|
|
960
|
-
const
|
|
998
|
+
const C = {
|
|
961
999
|
calculatedDuration: f && d || null,
|
|
962
1000
|
next: (g) => {
|
|
963
1001
|
const S = V(g);
|
|
@@ -965,20 +1003,20 @@ function ln(t = A.visualDuration, e = A.bounce) {
|
|
|
965
1003
|
a.done = g >= d;
|
|
966
1004
|
else {
|
|
967
1005
|
let x = 0;
|
|
968
|
-
v < 1 && (x = g === 0 ? /* @__PURE__ */ I(b) :
|
|
969
|
-
const m = Math.abs(x) <= s,
|
|
970
|
-
a.done = m &&
|
|
1006
|
+
v < 1 && (x = g === 0 ? /* @__PURE__ */ I(b) : fn(V, g, S));
|
|
1007
|
+
const m = Math.abs(x) <= s, P = Math.abs(o - S) <= i;
|
|
1008
|
+
a.done = m && P;
|
|
971
1009
|
}
|
|
972
1010
|
return a.value = a.done ? o : S, a;
|
|
973
1011
|
},
|
|
974
1012
|
toString: () => {
|
|
975
|
-
const g = Math.min(
|
|
1013
|
+
const g = Math.min(Et(C), be), S = Kt((x) => C.next(g * x).value, g, 30);
|
|
976
1014
|
return g + "ms " + S;
|
|
977
1015
|
}
|
|
978
1016
|
};
|
|
979
|
-
return
|
|
1017
|
+
return C;
|
|
980
1018
|
}
|
|
981
|
-
function
|
|
1019
|
+
function pt({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
|
|
982
1020
|
const d = t[0], h = {
|
|
983
1021
|
done: !1,
|
|
984
1022
|
value: d
|
|
@@ -986,15 +1024,15 @@ function ut({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 3
|
|
|
986
1024
|
let v = n * e;
|
|
987
1025
|
const y = d + v, p = o === void 0 ? y : o(y);
|
|
988
1026
|
p !== y && (v = p - d);
|
|
989
|
-
const T = (m) => -v * Math.exp(-m / s), V = (m) => p + T(m),
|
|
990
|
-
const
|
|
991
|
-
h.done = Math.abs(
|
|
1027
|
+
const T = (m) => -v * Math.exp(-m / s), V = (m) => p + T(m), C = (m) => {
|
|
1028
|
+
const P = T(m), D = V(m);
|
|
1029
|
+
h.done = Math.abs(P) <= u, h.value = h.done ? p : D;
|
|
992
1030
|
};
|
|
993
1031
|
let g, S;
|
|
994
1032
|
const x = (m) => {
|
|
995
|
-
f(h.value) && (g = m, S =
|
|
1033
|
+
f(h.value) && (g = m, S = pn({
|
|
996
1034
|
keyframes: [h.value, b(h.value)],
|
|
997
|
-
velocity:
|
|
1035
|
+
velocity: fn(V, m, h.value),
|
|
998
1036
|
// TODO: This should be passing * 1000
|
|
999
1037
|
damping: i,
|
|
1000
1038
|
stiffness: r,
|
|
@@ -1005,117 +1043,117 @@ function ut({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 3
|
|
|
1005
1043
|
return x(0), {
|
|
1006
1044
|
calculatedDuration: null,
|
|
1007
1045
|
next: (m) => {
|
|
1008
|
-
let
|
|
1009
|
-
return !S && g === void 0 && (
|
|
1046
|
+
let P = !1;
|
|
1047
|
+
return !S && g === void 0 && (P = !0, C(m), x(m)), g !== void 0 && m >= g ? S.next(m - g) : (!P && C(m), h);
|
|
1010
1048
|
}
|
|
1011
1049
|
};
|
|
1012
1050
|
}
|
|
1013
|
-
const
|
|
1051
|
+
const yi = /* @__PURE__ */ Q(0.42, 0, 1, 1), vi = /* @__PURE__ */ Q(0, 0, 0.58, 1), mn = /* @__PURE__ */ Q(0.42, 0, 0.58, 1), bi = (t) => Array.isArray(t) && typeof t[0] != "number", mt = {
|
|
1014
1052
|
linear: q,
|
|
1015
|
-
easeIn:
|
|
1016
|
-
easeInOut:
|
|
1017
|
-
easeOut:
|
|
1018
|
-
circIn:
|
|
1019
|
-
circInOut:
|
|
1020
|
-
circOut:
|
|
1021
|
-
backIn:
|
|
1022
|
-
backInOut:
|
|
1023
|
-
backOut:
|
|
1024
|
-
anticipate:
|
|
1025
|
-
},
|
|
1026
|
-
if (
|
|
1027
|
-
|
|
1053
|
+
easeIn: yi,
|
|
1054
|
+
easeInOut: mn,
|
|
1055
|
+
easeOut: vi,
|
|
1056
|
+
circIn: _e,
|
|
1057
|
+
circInOut: zt,
|
|
1058
|
+
circOut: Ts,
|
|
1059
|
+
backIn: Le,
|
|
1060
|
+
backInOut: Ht,
|
|
1061
|
+
backOut: jt,
|
|
1062
|
+
anticipate: Wt
|
|
1063
|
+
}, gt = (t) => {
|
|
1064
|
+
if (ke(t)) {
|
|
1065
|
+
X(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
1028
1066
|
const [e, n, s, i] = t;
|
|
1029
|
-
return
|
|
1067
|
+
return Q(e, n, s, i);
|
|
1030
1068
|
} else if (typeof t == "string")
|
|
1031
|
-
return
|
|
1069
|
+
return X(mt[t] !== void 0, `Invalid easing type '${t}'`), mt[t];
|
|
1032
1070
|
return t;
|
|
1033
1071
|
};
|
|
1034
|
-
function
|
|
1035
|
-
const s = [], i = n ||
|
|
1072
|
+
function Ti(t, e, n) {
|
|
1073
|
+
const s = [], i = n || hn, r = t.length - 1;
|
|
1036
1074
|
for (let o = 0; o < r; o++) {
|
|
1037
1075
|
let a = i(t[o], t[o + 1]);
|
|
1038
1076
|
if (e) {
|
|
1039
1077
|
const l = Array.isArray(e) ? e[o] || q : e;
|
|
1040
|
-
a =
|
|
1078
|
+
a = ue(l, a);
|
|
1041
1079
|
}
|
|
1042
1080
|
s.push(a);
|
|
1043
1081
|
}
|
|
1044
1082
|
return s;
|
|
1045
1083
|
}
|
|
1046
|
-
function
|
|
1084
|
+
function Vi(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
1047
1085
|
const r = t.length;
|
|
1048
|
-
if (
|
|
1086
|
+
if (X(r === e.length, "Both input and output ranges must be the same length"), r === 1)
|
|
1049
1087
|
return () => e[0];
|
|
1050
1088
|
if (r === 2 && e[0] === e[1])
|
|
1051
1089
|
return () => e[1];
|
|
1052
1090
|
const o = t[0] === t[1];
|
|
1053
1091
|
t[0] > t[r - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
1054
|
-
const a =
|
|
1092
|
+
const a = Ti(e, s, i), l = a.length, u = (c) => {
|
|
1055
1093
|
if (o && c < t[0])
|
|
1056
1094
|
return e[0];
|
|
1057
1095
|
let d = 0;
|
|
1058
1096
|
if (l > 1)
|
|
1059
1097
|
for (; d < t.length - 2 && !(c < t[d + 1]); d++)
|
|
1060
1098
|
;
|
|
1061
|
-
const h = /* @__PURE__ */
|
|
1099
|
+
const h = /* @__PURE__ */ Ne(t[d], t[d + 1], c);
|
|
1062
1100
|
return a[d](h);
|
|
1063
1101
|
};
|
|
1064
|
-
return n ? (c) => u(
|
|
1102
|
+
return n ? (c) => u(G(t[0], t[r - 1], c)) : u;
|
|
1065
1103
|
}
|
|
1066
|
-
function
|
|
1104
|
+
function Si(t, e) {
|
|
1067
1105
|
const n = t[t.length - 1];
|
|
1068
1106
|
for (let s = 1; s <= e; s++) {
|
|
1069
|
-
const i = /* @__PURE__ */
|
|
1070
|
-
t.push(
|
|
1107
|
+
const i = /* @__PURE__ */ Ne(0, e, s);
|
|
1108
|
+
t.push(le(n, 1, i));
|
|
1071
1109
|
}
|
|
1072
1110
|
}
|
|
1073
|
-
function
|
|
1111
|
+
function Ai(t) {
|
|
1074
1112
|
const e = [0];
|
|
1075
|
-
return
|
|
1113
|
+
return Si(e, t.length - 1), e;
|
|
1076
1114
|
}
|
|
1077
|
-
function
|
|
1115
|
+
function xi(t, e) {
|
|
1078
1116
|
return t.map((n) => n * e);
|
|
1079
1117
|
}
|
|
1080
|
-
function
|
|
1081
|
-
return t.map(() => e ||
|
|
1118
|
+
function wi(t, e) {
|
|
1119
|
+
return t.map(() => e || mn).splice(0, t.length - 1);
|
|
1082
1120
|
}
|
|
1083
|
-
function
|
|
1084
|
-
const i =
|
|
1121
|
+
function Y({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
|
|
1122
|
+
const i = bi(s) ? s.map(gt) : gt(s), r = {
|
|
1085
1123
|
done: !1,
|
|
1086
1124
|
value: e[0]
|
|
1087
|
-
}, o =
|
|
1125
|
+
}, o = xi(
|
|
1088
1126
|
// Only use the provided offsets if they're the correct length
|
|
1089
1127
|
// TODO Maybe we should warn here if there's a length mismatch
|
|
1090
|
-
n && n.length === e.length ? n :
|
|
1128
|
+
n && n.length === e.length ? n : Ai(e),
|
|
1091
1129
|
t
|
|
1092
|
-
), a =
|
|
1093
|
-
ease: Array.isArray(i) ? i :
|
|
1130
|
+
), a = Vi(o, e, {
|
|
1131
|
+
ease: Array.isArray(i) ? i : wi(e, i)
|
|
1094
1132
|
});
|
|
1095
1133
|
return {
|
|
1096
1134
|
calculatedDuration: t,
|
|
1097
1135
|
next: (l) => (r.value = a(l), r.done = l >= t, r)
|
|
1098
1136
|
};
|
|
1099
1137
|
}
|
|
1100
|
-
const
|
|
1138
|
+
const Mi = (t) => {
|
|
1101
1139
|
const e = ({ timestamp: n }) => t(n);
|
|
1102
1140
|
return {
|
|
1103
1141
|
start: () => F.update(e, !0),
|
|
1104
|
-
stop: () =>
|
|
1142
|
+
stop: () => ve(e),
|
|
1105
1143
|
/**
|
|
1106
1144
|
* If we're processing this frame we can use the
|
|
1107
1145
|
* framelocked timestamp to keep things in sync.
|
|
1108
1146
|
*/
|
|
1109
|
-
now: () =>
|
|
1147
|
+
now: () => Ye.isProcessing ? Ye.timestamp : te.now()
|
|
1110
1148
|
};
|
|
1111
|
-
},
|
|
1112
|
-
decay:
|
|
1113
|
-
inertia:
|
|
1114
|
-
tween:
|
|
1115
|
-
keyframes:
|
|
1116
|
-
spring:
|
|
1117
|
-
},
|
|
1118
|
-
class
|
|
1149
|
+
}, Pi = {
|
|
1150
|
+
decay: pt,
|
|
1151
|
+
inertia: pt,
|
|
1152
|
+
tween: Y,
|
|
1153
|
+
keyframes: Y,
|
|
1154
|
+
spring: pn
|
|
1155
|
+
}, Ci = (t) => t / 100;
|
|
1156
|
+
class He extends cn {
|
|
1119
1157
|
constructor(e) {
|
|
1120
1158
|
super(e), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
|
|
1121
1159
|
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
@@ -1124,22 +1162,22 @@ class Ue extends sn {
|
|
|
1124
1162
|
const { onStop: l } = this.options;
|
|
1125
1163
|
l && l();
|
|
1126
1164
|
};
|
|
1127
|
-
const { name: n, motionValue: s, element: i, keyframes: r } = this.options, o = (i == null ? void 0 : i.KeyframeResolver) ||
|
|
1165
|
+
const { name: n, motionValue: s, element: i, keyframes: r } = this.options, o = (i == null ? void 0 : i.KeyframeResolver) || $e, a = (l, u) => this.onKeyframesResolved(l, u);
|
|
1128
1166
|
this.resolver = new o(r, a, n, s, i), this.resolver.scheduleResolve();
|
|
1129
1167
|
}
|
|
1130
1168
|
flatten() {
|
|
1131
1169
|
super.flatten(), this._resolved && Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));
|
|
1132
1170
|
}
|
|
1133
1171
|
initPlayback(e) {
|
|
1134
|
-
const { type: n = "keyframes", repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = this.options, a =
|
|
1172
|
+
const { type: n = "keyframes", repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = this.options, a = Be(n) ? n : Pi[n] || Y;
|
|
1135
1173
|
let l, u;
|
|
1136
|
-
process.env.NODE_ENV !== "production" && a !==
|
|
1174
|
+
process.env.NODE_ENV !== "production" && a !== Y && X(e.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`), a !== Y && typeof e[0] != "number" && (l = ue(Ci, hn(e[0], e[1])), e = [0, 100]);
|
|
1137
1175
|
const c = a({ ...this.options, keyframes: e });
|
|
1138
1176
|
r === "mirror" && (u = a({
|
|
1139
1177
|
...this.options,
|
|
1140
1178
|
keyframes: [...e].reverse(),
|
|
1141
1179
|
velocity: -o
|
|
1142
|
-
})), c.calculatedDuration === null && (c.calculatedDuration =
|
|
1180
|
+
})), c.calculatedDuration === null && (c.calculatedDuration = Et(c));
|
|
1143
1181
|
const { calculatedDuration: d } = c, h = d + i, f = h * (s + 1) - i;
|
|
1144
1182
|
return {
|
|
1145
1183
|
generator: c,
|
|
@@ -1167,18 +1205,18 @@ class Ue extends sn {
|
|
|
1167
1205
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - c / this.speed, this.startTime)), n ? this.currentTime = e : this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = Math.round(e - this.startTime) * this.speed;
|
|
1168
1206
|
const p = this.currentTime - h * (this.speed >= 0 ? 1 : -1), T = this.speed >= 0 ? p < 0 : p > c;
|
|
1169
1207
|
this.currentTime = Math.max(p, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = c);
|
|
1170
|
-
let V = this.currentTime,
|
|
1208
|
+
let V = this.currentTime, C = r;
|
|
1171
1209
|
if (f) {
|
|
1172
1210
|
const m = Math.min(this.currentTime, c) / d;
|
|
1173
|
-
let
|
|
1174
|
-
!D && m >= 1 && (D = 1), D === 1 &&
|
|
1211
|
+
let P = Math.floor(m), D = m % 1;
|
|
1212
|
+
!D && m >= 1 && (D = 1), D === 1 && P--, P = Math.min(P, f + 1), !!(P % 2) && (b === "reverse" ? (D = 1 - D, v && (D -= v / d)) : b === "mirror" && (C = o)), V = G(0, 1, D) * d;
|
|
1175
1213
|
}
|
|
1176
|
-
const g = T ? { done: !1, value: l[0] } :
|
|
1214
|
+
const g = T ? { done: !1, value: l[0] } : C.next(V);
|
|
1177
1215
|
a && (g.value = a(g.value));
|
|
1178
1216
|
let { done: S } = g;
|
|
1179
1217
|
!T && u !== null && (S = this.speed >= 0 ? this.currentTime >= c : this.currentTime <= 0);
|
|
1180
1218
|
const x = this.holdTime === null && (this.state === "finished" || this.state === "running" && S);
|
|
1181
|
-
return x && i !== void 0 && (g.value =
|
|
1219
|
+
return x && i !== void 0 && (g.value = ae(l, this.options, i)), y && y(g.value), x && this.finish(), g;
|
|
1182
1220
|
}
|
|
1183
1221
|
get duration() {
|
|
1184
1222
|
const { resolved: e } = this;
|
|
@@ -1204,7 +1242,7 @@ class Ue extends sn {
|
|
|
1204
1242
|
}
|
|
1205
1243
|
if (this.isStopped)
|
|
1206
1244
|
return;
|
|
1207
|
-
const { driver: e =
|
|
1245
|
+
const { driver: e = Mi, onPlay: n, startTime: s } = this.options;
|
|
1208
1246
|
this.driver || (this.driver = e((r) => this.tick(r))), n && n();
|
|
1209
1247
|
const i = this.driver.now();
|
|
1210
1248
|
this.holdTime !== null ? this.startTime = i - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = i) : this.startTime = s ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
|
|
@@ -1238,10 +1276,10 @@ class Ue extends sn {
|
|
|
1238
1276
|
return this.startTime = 0, this.tick(e, !0);
|
|
1239
1277
|
}
|
|
1240
1278
|
}
|
|
1241
|
-
function
|
|
1279
|
+
function Di(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a = "easeInOut", times: l } = {}) {
|
|
1242
1280
|
const u = { [e]: n };
|
|
1243
1281
|
l && (u.offset = l);
|
|
1244
|
-
const c =
|
|
1282
|
+
const c = Bt(a, i);
|
|
1245
1283
|
return Array.isArray(c) && (u.easing = c), t.animate(u, {
|
|
1246
1284
|
delay: s,
|
|
1247
1285
|
duration: i,
|
|
@@ -1251,12 +1289,12 @@ function bi(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatTyp
|
|
|
1251
1289
|
direction: o === "reverse" ? "alternate" : "normal"
|
|
1252
1290
|
});
|
|
1253
1291
|
}
|
|
1254
|
-
const
|
|
1255
|
-
function
|
|
1256
|
-
return
|
|
1292
|
+
const Fi = /* @__PURE__ */ Ke(() => Object.hasOwnProperty.call(Element.prototype, "animate")), ie = 10, Oi = 2e4;
|
|
1293
|
+
function Ii(t) {
|
|
1294
|
+
return Be(t.type) || t.type === "spring" || !Nt(t.ease);
|
|
1257
1295
|
}
|
|
1258
|
-
function
|
|
1259
|
-
const n = new
|
|
1296
|
+
function Ri(t, e) {
|
|
1297
|
+
const n = new He({
|
|
1260
1298
|
...e,
|
|
1261
1299
|
keyframes: t,
|
|
1262
1300
|
repeat: 0,
|
|
@@ -1266,41 +1304,41 @@ function Ai(t, e) {
|
|
|
1266
1304
|
let s = { done: !1, value: t[0] };
|
|
1267
1305
|
const i = [];
|
|
1268
1306
|
let r = 0;
|
|
1269
|
-
for (; !s.done && r <
|
|
1270
|
-
s = n.sample(r), i.push(s.value), r +=
|
|
1307
|
+
for (; !s.done && r < Oi; )
|
|
1308
|
+
s = n.sample(r), i.push(s.value), r += ie;
|
|
1271
1309
|
return {
|
|
1272
1310
|
times: void 0,
|
|
1273
1311
|
keyframes: i,
|
|
1274
|
-
duration: r -
|
|
1312
|
+
duration: r - ie,
|
|
1275
1313
|
ease: "linear"
|
|
1276
1314
|
};
|
|
1277
1315
|
}
|
|
1278
|
-
const
|
|
1279
|
-
anticipate:
|
|
1280
|
-
backInOut:
|
|
1281
|
-
circInOut:
|
|
1316
|
+
const gn = {
|
|
1317
|
+
anticipate: Wt,
|
|
1318
|
+
backInOut: Ht,
|
|
1319
|
+
circInOut: zt
|
|
1282
1320
|
};
|
|
1283
|
-
function
|
|
1284
|
-
return t in
|
|
1321
|
+
function Ei(t) {
|
|
1322
|
+
return t in gn;
|
|
1285
1323
|
}
|
|
1286
|
-
class
|
|
1324
|
+
class yt extends cn {
|
|
1287
1325
|
constructor(e) {
|
|
1288
1326
|
super(e);
|
|
1289
1327
|
const { name: n, motionValue: s, element: i, keyframes: r } = this.options;
|
|
1290
|
-
this.resolver = new
|
|
1328
|
+
this.resolver = new un(r, (o, a) => this.onKeyframesResolved(o, a), n, s, i), this.resolver.scheduleResolve();
|
|
1291
1329
|
}
|
|
1292
1330
|
initPlayback(e, n) {
|
|
1293
1331
|
let { duration: s = 300, times: i, ease: r, type: o, motionValue: a, name: l, startTime: u } = this.options;
|
|
1294
1332
|
if (!a.owner || !a.owner.current)
|
|
1295
1333
|
return !1;
|
|
1296
|
-
if (typeof r == "string" &&
|
|
1297
|
-
const { onComplete: d, onUpdate: h, motionValue: f, element: b, ...v } = this.options, y =
|
|
1334
|
+
if (typeof r == "string" && ne() && Ei(r) && (r = gn[r]), Ii(this.options)) {
|
|
1335
|
+
const { onComplete: d, onUpdate: h, motionValue: f, element: b, ...v } = this.options, y = Ri(e, v);
|
|
1298
1336
|
e = y.keyframes, e.length === 1 && (e[1] = e[0]), s = y.duration, i = y.times, r = y.ease, o = "keyframes";
|
|
1299
1337
|
}
|
|
1300
|
-
const c =
|
|
1301
|
-
return c.startTime = u ?? this.calcStartTime(), this.pendingTimeline ? (
|
|
1338
|
+
const c = Di(a.owner.current, l, e, { ...this.options, duration: s, times: i, ease: r });
|
|
1339
|
+
return c.startTime = u ?? this.calcStartTime(), this.pendingTimeline ? (Ze(c, this.pendingTimeline), this.pendingTimeline = void 0) : c.onfinish = () => {
|
|
1302
1340
|
const { onComplete: d } = this.options;
|
|
1303
|
-
a.set(
|
|
1341
|
+
a.set(ae(e, this.options, n)), d && d(), this.cancel(), this.resolveFinishedPromise();
|
|
1304
1342
|
}, {
|
|
1305
1343
|
animation: c,
|
|
1306
1344
|
duration: s,
|
|
@@ -1371,7 +1409,7 @@ class ht extends sn {
|
|
|
1371
1409
|
if (!n)
|
|
1372
1410
|
return q;
|
|
1373
1411
|
const { animation: s } = n;
|
|
1374
|
-
|
|
1412
|
+
Ze(s, e);
|
|
1375
1413
|
}
|
|
1376
1414
|
return q;
|
|
1377
1415
|
}
|
|
@@ -1402,7 +1440,7 @@ class ht extends sn {
|
|
|
1402
1440
|
if (n.playState === "idle" || n.playState === "finished")
|
|
1403
1441
|
return;
|
|
1404
1442
|
if (this.time) {
|
|
1405
|
-
const { motionValue: u, onUpdate: c, onComplete: d, element: h, ...f } = this.options, b = new
|
|
1443
|
+
const { motionValue: u, onUpdate: c, onComplete: d, element: h, ...f } = this.options, b = new He({
|
|
1406
1444
|
...f,
|
|
1407
1445
|
keyframes: s,
|
|
1408
1446
|
duration: i,
|
|
@@ -1411,7 +1449,7 @@ class ht extends sn {
|
|
|
1411
1449
|
times: a,
|
|
1412
1450
|
isGenerator: !0
|
|
1413
1451
|
}), v = /* @__PURE__ */ I(this.time);
|
|
1414
|
-
u.setWithVelocity(b.sample(v -
|
|
1452
|
+
u.setWithVelocity(b.sample(v - ie).value, b.sample(v).value, ie);
|
|
1415
1453
|
}
|
|
1416
1454
|
const { onStop: l } = this.options;
|
|
1417
1455
|
l && l(), this.cancel();
|
|
@@ -1429,36 +1467,36 @@ class ht extends sn {
|
|
|
1429
1467
|
if (!n || !n.owner || !(n.owner.current instanceof HTMLElement))
|
|
1430
1468
|
return !1;
|
|
1431
1469
|
const { onUpdate: l, transformTemplate: u } = n.owner.getProps();
|
|
1432
|
-
return
|
|
1470
|
+
return Fi() && s && Rn.has(s) && /**
|
|
1433
1471
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
1434
1472
|
* no way to read the value from WAAPI every frame.
|
|
1435
1473
|
*/
|
|
1436
1474
|
!l && !u && !i && r !== "mirror" && o !== 0 && a !== "inertia";
|
|
1437
1475
|
}
|
|
1438
1476
|
}
|
|
1439
|
-
const
|
|
1477
|
+
const Ki = {
|
|
1440
1478
|
type: "spring",
|
|
1441
1479
|
stiffness: 500,
|
|
1442
1480
|
damping: 25,
|
|
1443
1481
|
restSpeed: 10
|
|
1444
|
-
},
|
|
1482
|
+
}, Ni = (t) => ({
|
|
1445
1483
|
type: "spring",
|
|
1446
1484
|
stiffness: 550,
|
|
1447
1485
|
damping: t === 0 ? 2 * Math.sqrt(550) : 30,
|
|
1448
1486
|
restSpeed: 10
|
|
1449
|
-
}),
|
|
1487
|
+
}), Bi = {
|
|
1450
1488
|
type: "keyframes",
|
|
1451
1489
|
duration: 0.8
|
|
1452
|
-
},
|
|
1490
|
+
}, ki = {
|
|
1453
1491
|
type: "keyframes",
|
|
1454
1492
|
ease: [0.25, 0.1, 0.35, 1],
|
|
1455
1493
|
duration: 0.3
|
|
1456
|
-
},
|
|
1457
|
-
function
|
|
1494
|
+
}, Li = (t, { keyframes: e }) => e.length > 2 ? Bi : oe.has(t) ? t.startsWith("scale") ? Ni(e[1]) : Ki : ki;
|
|
1495
|
+
function _i({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: l, elapsed: u, ...c }) {
|
|
1458
1496
|
return !!Object.keys(c).length;
|
|
1459
1497
|
}
|
|
1460
|
-
const
|
|
1461
|
-
const a =
|
|
1498
|
+
const Gi = (t, e, n, s = {}, i, r) => (o) => {
|
|
1499
|
+
const a = Rt(s, t) || {}, l = a.delay || s.delay || 0;
|
|
1462
1500
|
let { elapsed: u = 0 } = s;
|
|
1463
1501
|
u = u - /* @__PURE__ */ I(l);
|
|
1464
1502
|
let c = {
|
|
@@ -1477,63 +1515,63 @@ const Ri = (t, e, n, s = {}, i, r) => (o) => {
|
|
|
1477
1515
|
motionValue: e,
|
|
1478
1516
|
element: r ? void 0 : i
|
|
1479
1517
|
};
|
|
1480
|
-
|
|
1518
|
+
_i(a) || (c = {
|
|
1481
1519
|
...c,
|
|
1482
|
-
...
|
|
1520
|
+
...Li(t, c)
|
|
1483
1521
|
}), c.duration && (c.duration = /* @__PURE__ */ I(c.duration)), c.repeatDelay && (c.repeatDelay = /* @__PURE__ */ I(c.repeatDelay)), c.from !== void 0 && (c.keyframes[0] = c.from);
|
|
1484
1522
|
let d = !1;
|
|
1485
|
-
if ((c.type === !1 || c.duration === 0 && !c.repeatDelay) && (c.duration = 0, c.delay === 0 && (d = !0)),
|
|
1486
|
-
const h =
|
|
1523
|
+
if ((c.type === !1 || c.duration === 0 && !c.repeatDelay) && (c.duration = 0, c.delay === 0 && (d = !0)), En.skipAnimations && (d = !0, c.duration = 0, c.delay = 0), c.allowFlatten = !a.type && !a.ease, d && !r && e.get() !== void 0) {
|
|
1524
|
+
const h = ae(c.keyframes, a);
|
|
1487
1525
|
if (h !== void 0)
|
|
1488
1526
|
return F.update(() => {
|
|
1489
1527
|
c.onUpdate(h), c.onComplete();
|
|
1490
|
-
}), new
|
|
1528
|
+
}), new es([]);
|
|
1491
1529
|
}
|
|
1492
|
-
return !r &&
|
|
1530
|
+
return !r && yt.supports(c) ? new yt(c) : new He(c);
|
|
1493
1531
|
};
|
|
1494
|
-
function
|
|
1532
|
+
function Ui({ protectedKeys: t, needsAnimating: e }, n) {
|
|
1495
1533
|
const s = t.hasOwnProperty(n) && e[n] !== !0;
|
|
1496
1534
|
return e[n] = !1, s;
|
|
1497
1535
|
}
|
|
1498
|
-
function
|
|
1536
|
+
function yn(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
1499
1537
|
var r;
|
|
1500
1538
|
let { transition: o = t.getDefaultTransition(), transitionEnd: a, ...l } = e;
|
|
1501
1539
|
s && (o = s);
|
|
1502
1540
|
const u = [], c = i && t.animationState && t.animationState.getState()[i];
|
|
1503
1541
|
for (const d in l) {
|
|
1504
1542
|
const h = t.getValue(d, (r = t.latestValues[d]) !== null && r !== void 0 ? r : null), f = l[d];
|
|
1505
|
-
if (f === void 0 || c &&
|
|
1543
|
+
if (f === void 0 || c && Ui(c, d))
|
|
1506
1544
|
continue;
|
|
1507
1545
|
const b = {
|
|
1508
1546
|
delay: n,
|
|
1509
|
-
...
|
|
1547
|
+
...Rt(o || {}, d)
|
|
1510
1548
|
};
|
|
1511
1549
|
let v = !1;
|
|
1512
1550
|
if (window.MotionHandoffAnimation) {
|
|
1513
|
-
const p =
|
|
1551
|
+
const p = gs(t);
|
|
1514
1552
|
if (p) {
|
|
1515
1553
|
const T = window.MotionHandoffAnimation(p, d, F);
|
|
1516
1554
|
T !== null && (b.startTime = T, v = !0);
|
|
1517
1555
|
}
|
|
1518
1556
|
}
|
|
1519
|
-
|
|
1557
|
+
ms(t, d), h.start(Gi(d, h, f, t.shouldReduceMotion && _t.has(d) ? { type: !1 } : b, t, v));
|
|
1520
1558
|
const y = h.animation;
|
|
1521
1559
|
y && u.push(y);
|
|
1522
1560
|
}
|
|
1523
1561
|
return a && Promise.all(u).then(() => {
|
|
1524
1562
|
F.update(() => {
|
|
1525
|
-
a &&
|
|
1563
|
+
a && fs(t, a);
|
|
1526
1564
|
});
|
|
1527
1565
|
}), u;
|
|
1528
1566
|
}
|
|
1529
|
-
function
|
|
1567
|
+
function Fe(t, e, n = {}) {
|
|
1530
1568
|
var s;
|
|
1531
|
-
const i =
|
|
1569
|
+
const i = Z(t, e, n.type === "exit" ? (s = t.presenceContext) === null || s === void 0 ? void 0 : s.custom : void 0);
|
|
1532
1570
|
let { transition: r = t.getDefaultTransition() || {} } = i || {};
|
|
1533
1571
|
n.transitionOverride && (r = n.transitionOverride);
|
|
1534
|
-
const o = i ? () => Promise.all(
|
|
1572
|
+
const o = i ? () => Promise.all(yn(t, i, n)) : () => Promise.resolve(), a = t.variantChildren && t.variantChildren.size ? (u = 0) => {
|
|
1535
1573
|
const { delayChildren: c = 0, staggerChildren: d, staggerDirection: h } = r;
|
|
1536
|
-
return
|
|
1574
|
+
return $i(t, e, c + u, d, h, n);
|
|
1537
1575
|
} : () => Promise.resolve(), { when: l } = r;
|
|
1538
1576
|
if (l) {
|
|
1539
1577
|
const [u, c] = l === "beforeChildren" ? [o, a] : [a, o];
|
|
@@ -1541,35 +1579,35 @@ function Me(t, e, n = {}) {
|
|
|
1541
1579
|
} else
|
|
1542
1580
|
return Promise.all([o(), a(n.delay)]);
|
|
1543
1581
|
}
|
|
1544
|
-
function
|
|
1582
|
+
function $i(t, e, n = 0, s = 0, i = 1, r) {
|
|
1545
1583
|
const o = [], a = (t.variantChildren.size - 1) * s, l = i === 1 ? (u = 0) => u * s : (u = 0) => a - u * s;
|
|
1546
|
-
return Array.from(t.variantChildren).sort(
|
|
1547
|
-
u.notify("AnimationStart", e), o.push(
|
|
1584
|
+
return Array.from(t.variantChildren).sort(ji).forEach((u, c) => {
|
|
1585
|
+
u.notify("AnimationStart", e), o.push(Fe(u, e, {
|
|
1548
1586
|
...r,
|
|
1549
1587
|
delay: n + l(c)
|
|
1550
1588
|
}).then(() => u.notify("AnimationComplete", e)));
|
|
1551
1589
|
}), Promise.all(o);
|
|
1552
1590
|
}
|
|
1553
|
-
function
|
|
1591
|
+
function ji(t, e) {
|
|
1554
1592
|
return t.sortNodePosition(e);
|
|
1555
1593
|
}
|
|
1556
|
-
function
|
|
1594
|
+
function Hi(t, e, n = {}) {
|
|
1557
1595
|
t.notify("AnimationStart", e);
|
|
1558
1596
|
let s;
|
|
1559
1597
|
if (Array.isArray(e)) {
|
|
1560
|
-
const i = e.map((r) =>
|
|
1598
|
+
const i = e.map((r) => Fe(t, r, n));
|
|
1561
1599
|
s = Promise.all(i);
|
|
1562
1600
|
} else if (typeof e == "string")
|
|
1563
|
-
s =
|
|
1601
|
+
s = Fe(t, e, n);
|
|
1564
1602
|
else {
|
|
1565
|
-
const i = typeof e == "function" ?
|
|
1566
|
-
s = Promise.all(
|
|
1603
|
+
const i = typeof e == "function" ? Z(t, e, n.custom) : e;
|
|
1604
|
+
s = Promise.all(yn(t, i, n));
|
|
1567
1605
|
}
|
|
1568
1606
|
return s.then(() => {
|
|
1569
1607
|
t.notify("AnimationComplete", e);
|
|
1570
1608
|
});
|
|
1571
1609
|
}
|
|
1572
|
-
function
|
|
1610
|
+
function vn(t, e) {
|
|
1573
1611
|
if (!Array.isArray(e))
|
|
1574
1612
|
return !1;
|
|
1575
1613
|
const n = e.length;
|
|
@@ -1580,30 +1618,30 @@ function hn(t, e) {
|
|
|
1580
1618
|
return !1;
|
|
1581
1619
|
return !0;
|
|
1582
1620
|
}
|
|
1583
|
-
const
|
|
1584
|
-
function
|
|
1621
|
+
const Wi = Dt.length;
|
|
1622
|
+
function bn(t) {
|
|
1585
1623
|
if (!t)
|
|
1586
1624
|
return;
|
|
1587
1625
|
if (!t.isControllingVariants) {
|
|
1588
|
-
const n = t.parent ?
|
|
1626
|
+
const n = t.parent ? bn(t.parent) || {} : {};
|
|
1589
1627
|
return t.props.initial !== void 0 && (n.initial = t.props.initial), n;
|
|
1590
1628
|
}
|
|
1591
1629
|
const e = {};
|
|
1592
|
-
for (let n = 0; n <
|
|
1593
|
-
const s =
|
|
1594
|
-
(
|
|
1630
|
+
for (let n = 0; n < Wi; n++) {
|
|
1631
|
+
const s = Dt[n], i = t.props[s];
|
|
1632
|
+
(Ct(i) || i === !1) && (e[s] = i);
|
|
1595
1633
|
}
|
|
1596
1634
|
return e;
|
|
1597
1635
|
}
|
|
1598
|
-
const
|
|
1599
|
-
function
|
|
1600
|
-
return (e) => Promise.all(e.map(({ animation: n, options: s }) =>
|
|
1636
|
+
const zi = [...Ot].reverse(), Yi = Ot.length;
|
|
1637
|
+
function qi(t) {
|
|
1638
|
+
return (e) => Promise.all(e.map(({ animation: n, options: s }) => Hi(t, n, s)));
|
|
1601
1639
|
}
|
|
1602
|
-
function
|
|
1603
|
-
let e =
|
|
1640
|
+
function Xi(t) {
|
|
1641
|
+
let e = qi(t), n = vt(), s = !0;
|
|
1604
1642
|
const i = (l) => (u, c) => {
|
|
1605
1643
|
var d;
|
|
1606
|
-
const h =
|
|
1644
|
+
const h = Z(t, c, l === "exit" ? (d = t.presenceContext) === null || d === void 0 ? void 0 : d.custom : void 0);
|
|
1607
1645
|
if (h) {
|
|
1608
1646
|
const { transition: f, transitionEnd: b, ...v } = h;
|
|
1609
1647
|
u = { ...u, ...v, ...b };
|
|
@@ -1614,40 +1652,40 @@ function ki(t) {
|
|
|
1614
1652
|
e = l(t);
|
|
1615
1653
|
}
|
|
1616
1654
|
function o(l) {
|
|
1617
|
-
const { props: u } = t, c =
|
|
1655
|
+
const { props: u } = t, c = bn(t.parent) || {}, d = [], h = /* @__PURE__ */ new Set();
|
|
1618
1656
|
let f = {}, b = 1 / 0;
|
|
1619
|
-
for (let y = 0; y <
|
|
1620
|
-
const p =
|
|
1657
|
+
for (let y = 0; y < Yi; y++) {
|
|
1658
|
+
const p = zi[y], T = n[p], V = u[p] !== void 0 ? u[p] : c[p], C = Ct(V), g = p === l ? T.isActive : null;
|
|
1621
1659
|
g === !1 && (b = y);
|
|
1622
|
-
let S = V === c[p] && V !== u[p] &&
|
|
1660
|
+
let S = V === c[p] && V !== u[p] && C;
|
|
1623
1661
|
if (S && s && t.manuallyAnimateOnMount && (S = !1), T.protectedKeys = { ...f }, // If it isn't active and hasn't *just* been set as inactive
|
|
1624
1662
|
!T.isActive && g === null || // If we didn't and don't have any defined prop for this animation type
|
|
1625
1663
|
!V && !T.prevProp || // Or if the prop doesn't define an animation
|
|
1626
|
-
|
|
1664
|
+
Ft(V) || typeof V == "boolean")
|
|
1627
1665
|
continue;
|
|
1628
|
-
const x =
|
|
1666
|
+
const x = Zi(T.prevProp, V);
|
|
1629
1667
|
let m = x || // If we're making this variant active, we want to always make it active
|
|
1630
|
-
p === l && T.isActive && !S &&
|
|
1631
|
-
y > b &&
|
|
1668
|
+
p === l && T.isActive && !S && C || // If we removed a higher-priority variant (i is in reverse order)
|
|
1669
|
+
y > b && C, P = !1;
|
|
1632
1670
|
const D = Array.isArray(V) ? V : [V];
|
|
1633
1671
|
let L = D.reduce(i(p), {});
|
|
1634
1672
|
g === !1 && (L = {});
|
|
1635
|
-
const { prevResolvedValues:
|
|
1636
|
-
|
|
1673
|
+
const { prevResolvedValues: We = {} } = T, xn = {
|
|
1674
|
+
...We,
|
|
1637
1675
|
...L
|
|
1638
|
-
},
|
|
1639
|
-
m = !0, h.has(M) && (
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1676
|
+
}, ze = (M) => {
|
|
1677
|
+
m = !0, h.has(M) && (P = !0, h.delete(M)), T.needsAnimating[M] = !0;
|
|
1678
|
+
const O = t.getValue(M);
|
|
1679
|
+
O && (O.liveStyle = !1);
|
|
1642
1680
|
};
|
|
1643
|
-
for (const M in
|
|
1644
|
-
const
|
|
1681
|
+
for (const M in xn) {
|
|
1682
|
+
const O = L[M], ce = We[M];
|
|
1645
1683
|
if (f.hasOwnProperty(M))
|
|
1646
1684
|
continue;
|
|
1647
|
-
let
|
|
1648
|
-
|
|
1685
|
+
let de = !1;
|
|
1686
|
+
qe(O) && qe(ce) ? de = !vn(O, ce) : de = O !== ce, de ? O != null ? ze(M) : h.add(M) : O !== void 0 && h.has(M) ? ze(M) : T.protectedKeys[M] = !0;
|
|
1649
1687
|
}
|
|
1650
|
-
T.prevProp = V, T.prevResolvedValues = L, T.isActive && (f = { ...f, ...L }), s && t.blockInitialAnimation && (m = !1), m && (!(S && x) ||
|
|
1688
|
+
T.prevProp = V, T.prevResolvedValues = L, T.isActive && (f = { ...f, ...L }), s && t.blockInitialAnimation && (m = !1), m && (!(S && x) || P) && d.push(...D.map((M) => ({
|
|
1651
1689
|
animation: M,
|
|
1652
1690
|
options: { type: p }
|
|
1653
1691
|
})));
|
|
@@ -1655,7 +1693,7 @@ function ki(t) {
|
|
|
1655
1693
|
if (h.size) {
|
|
1656
1694
|
const y = {};
|
|
1657
1695
|
if (typeof u.initial != "boolean") {
|
|
1658
|
-
const p =
|
|
1696
|
+
const p = Z(t, Array.isArray(u.initial) ? u.initial[0] : u.initial);
|
|
1659
1697
|
p && p.transition && (y.transition = p.transition);
|
|
1660
1698
|
}
|
|
1661
1699
|
h.forEach((p) => {
|
|
@@ -1685,12 +1723,12 @@ function ki(t) {
|
|
|
1685
1723
|
setAnimateFunction: r,
|
|
1686
1724
|
getState: () => n,
|
|
1687
1725
|
reset: () => {
|
|
1688
|
-
n =
|
|
1726
|
+
n = vt(), s = !0;
|
|
1689
1727
|
}
|
|
1690
1728
|
};
|
|
1691
1729
|
}
|
|
1692
|
-
function
|
|
1693
|
-
return typeof e == "string" ? e !== t : Array.isArray(e) ? !
|
|
1730
|
+
function Zi(t, e) {
|
|
1731
|
+
return typeof e == "string" ? e !== t : Array.isArray(e) ? !vn(e, t) : !1;
|
|
1694
1732
|
}
|
|
1695
1733
|
function K(t = !1) {
|
|
1696
1734
|
return {
|
|
@@ -1700,7 +1738,7 @@ function K(t = !1) {
|
|
|
1700
1738
|
prevResolvedValues: {}
|
|
1701
1739
|
};
|
|
1702
1740
|
}
|
|
1703
|
-
function
|
|
1741
|
+
function vt() {
|
|
1704
1742
|
return {
|
|
1705
1743
|
animate: K(!0),
|
|
1706
1744
|
whileInView: K(),
|
|
@@ -1711,25 +1749,25 @@ function ft() {
|
|
|
1711
1749
|
exit: K()
|
|
1712
1750
|
};
|
|
1713
1751
|
}
|
|
1714
|
-
class
|
|
1752
|
+
class j {
|
|
1715
1753
|
constructor(e) {
|
|
1716
1754
|
this.isMounted = !1, this.node = e;
|
|
1717
1755
|
}
|
|
1718
1756
|
update() {
|
|
1719
1757
|
}
|
|
1720
1758
|
}
|
|
1721
|
-
class
|
|
1759
|
+
class Ji extends j {
|
|
1722
1760
|
/**
|
|
1723
1761
|
* We dynamically generate the AnimationState manager as it contains a reference
|
|
1724
1762
|
* to the underlying animation library. We only want to load that if we load this,
|
|
1725
1763
|
* so people can optionally code split it out using the `m` component.
|
|
1726
1764
|
*/
|
|
1727
1765
|
constructor(e) {
|
|
1728
|
-
super(e), e.animationState || (e.animationState =
|
|
1766
|
+
super(e), e.animationState || (e.animationState = Xi(e));
|
|
1729
1767
|
}
|
|
1730
1768
|
updateAnimationControlsSubscription() {
|
|
1731
1769
|
const { animate: e } = this.node.getProps();
|
|
1732
|
-
|
|
1770
|
+
Ft(e) && (this.unmountControls = e.subscribe(this.node));
|
|
1733
1771
|
}
|
|
1734
1772
|
/**
|
|
1735
1773
|
* Subscribe any provided AnimationControls to the component's VisualElement
|
|
@@ -1746,10 +1784,10 @@ class Ui extends $ {
|
|
|
1746
1784
|
this.node.animationState.reset(), (e = this.unmountControls) === null || e === void 0 || e.call(this);
|
|
1747
1785
|
}
|
|
1748
1786
|
}
|
|
1749
|
-
let
|
|
1750
|
-
class
|
|
1787
|
+
let Qi = 0;
|
|
1788
|
+
class er extends j {
|
|
1751
1789
|
constructor() {
|
|
1752
|
-
super(...arguments), this.id =
|
|
1790
|
+
super(...arguments), this.id = Qi++;
|
|
1753
1791
|
}
|
|
1754
1792
|
update() {
|
|
1755
1793
|
if (!this.node.presenceContext)
|
|
@@ -1769,18 +1807,18 @@ class ji extends $ {
|
|
|
1769
1807
|
unmount() {
|
|
1770
1808
|
}
|
|
1771
1809
|
}
|
|
1772
|
-
const
|
|
1810
|
+
const tr = {
|
|
1773
1811
|
animation: {
|
|
1774
|
-
Feature:
|
|
1812
|
+
Feature: Ji
|
|
1775
1813
|
},
|
|
1776
1814
|
exit: {
|
|
1777
|
-
Feature:
|
|
1815
|
+
Feature: er
|
|
1778
1816
|
}
|
|
1779
1817
|
};
|
|
1780
|
-
function
|
|
1818
|
+
function bt(t, e, n, s = { passive: !0 }) {
|
|
1781
1819
|
return t.addEventListener(e, n, s), () => t.removeEventListener(e, n);
|
|
1782
1820
|
}
|
|
1783
|
-
function
|
|
1821
|
+
function Tn(t) {
|
|
1784
1822
|
return {
|
|
1785
1823
|
point: {
|
|
1786
1824
|
x: t.pageX,
|
|
@@ -1788,13 +1826,13 @@ function pn(t) {
|
|
|
1788
1826
|
}
|
|
1789
1827
|
};
|
|
1790
1828
|
}
|
|
1791
|
-
function
|
|
1829
|
+
function nr({ top: t, left: e, right: n, bottom: s }) {
|
|
1792
1830
|
return {
|
|
1793
1831
|
x: { min: e, max: n },
|
|
1794
1832
|
y: { min: t, max: s }
|
|
1795
1833
|
};
|
|
1796
1834
|
}
|
|
1797
|
-
function
|
|
1835
|
+
function sr(t, e) {
|
|
1798
1836
|
if (!e)
|
|
1799
1837
|
return t;
|
|
1800
1838
|
const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
|
|
@@ -1805,28 +1843,28 @@ function zi(t, e) {
|
|
|
1805
1843
|
right: s.x
|
|
1806
1844
|
};
|
|
1807
1845
|
}
|
|
1808
|
-
const
|
|
1809
|
-
x:
|
|
1810
|
-
y:
|
|
1846
|
+
const Tt = () => ({ min: 0, max: 0 }), Vn = () => ({
|
|
1847
|
+
x: Tt(),
|
|
1848
|
+
y: Tt()
|
|
1811
1849
|
});
|
|
1812
|
-
function
|
|
1813
|
-
return
|
|
1850
|
+
function ir(t, e) {
|
|
1851
|
+
return nr(sr(t.getBoundingClientRect(), e));
|
|
1814
1852
|
}
|
|
1815
|
-
function
|
|
1853
|
+
function Vt(t, e, n) {
|
|
1816
1854
|
const { props: s } = t;
|
|
1817
1855
|
t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
1818
1856
|
const i = "onHover" + n, r = s[i];
|
|
1819
|
-
r && F.postRender(() => r(e,
|
|
1857
|
+
r && F.postRender(() => r(e, Tn(e)));
|
|
1820
1858
|
}
|
|
1821
|
-
class
|
|
1859
|
+
class rr extends j {
|
|
1822
1860
|
mount() {
|
|
1823
1861
|
const { current: e } = this.node;
|
|
1824
|
-
e && (this.unmount =
|
|
1862
|
+
e && (this.unmount = rs(e, (n, s) => (Vt(this.node, s, "Start"), (i) => Vt(this.node, i, "End"))));
|
|
1825
1863
|
}
|
|
1826
1864
|
unmount() {
|
|
1827
1865
|
}
|
|
1828
1866
|
}
|
|
1829
|
-
class
|
|
1867
|
+
class or extends j {
|
|
1830
1868
|
constructor() {
|
|
1831
1869
|
super(...arguments), this.isActive = !1;
|
|
1832
1870
|
}
|
|
@@ -1843,50 +1881,50 @@ class Xi extends $ {
|
|
|
1843
1881
|
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
1844
1882
|
}
|
|
1845
1883
|
mount() {
|
|
1846
|
-
this.unmount =
|
|
1884
|
+
this.unmount = ue(bt(this.node.current, "focus", () => this.onFocus()), bt(this.node.current, "blur", () => this.onBlur()));
|
|
1847
1885
|
}
|
|
1848
1886
|
unmount() {
|
|
1849
1887
|
}
|
|
1850
1888
|
}
|
|
1851
|
-
function
|
|
1889
|
+
function St(t, e, n) {
|
|
1852
1890
|
const { props: s } = t;
|
|
1853
1891
|
if (t.current instanceof HTMLButtonElement && t.current.disabled)
|
|
1854
1892
|
return;
|
|
1855
1893
|
t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
1856
1894
|
const i = "onTap" + (n === "End" ? "" : n), r = s[i];
|
|
1857
|
-
r && F.postRender(() => r(e,
|
|
1895
|
+
r && F.postRender(() => r(e, Tn(e)));
|
|
1858
1896
|
}
|
|
1859
|
-
class
|
|
1897
|
+
class ar extends j {
|
|
1860
1898
|
mount() {
|
|
1861
1899
|
const { current: e } = this.node;
|
|
1862
|
-
e && (this.unmount =
|
|
1900
|
+
e && (this.unmount = cs(e, (n, s) => (St(this.node, s, "Start"), (i, { success: r }) => St(this.node, i, r ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
1863
1901
|
}
|
|
1864
1902
|
unmount() {
|
|
1865
1903
|
}
|
|
1866
1904
|
}
|
|
1867
|
-
const
|
|
1868
|
-
const e =
|
|
1905
|
+
const Oe = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), lr = (t) => {
|
|
1906
|
+
const e = Oe.get(t.target);
|
|
1869
1907
|
e && e(t);
|
|
1870
|
-
},
|
|
1871
|
-
t.forEach(
|
|
1908
|
+
}, ur = (t) => {
|
|
1909
|
+
t.forEach(lr);
|
|
1872
1910
|
};
|
|
1873
|
-
function
|
|
1911
|
+
function cr({ root: t, ...e }) {
|
|
1874
1912
|
const n = t || document;
|
|
1875
|
-
|
|
1876
|
-
const s =
|
|
1877
|
-
return s[i] || (s[i] = new IntersectionObserver(
|
|
1878
|
-
}
|
|
1879
|
-
function
|
|
1880
|
-
const s =
|
|
1881
|
-
return
|
|
1882
|
-
|
|
1913
|
+
ge.has(n) || ge.set(n, {});
|
|
1914
|
+
const s = ge.get(n), i = JSON.stringify(e);
|
|
1915
|
+
return s[i] || (s[i] = new IntersectionObserver(ur, { root: t, ...e })), s[i];
|
|
1916
|
+
}
|
|
1917
|
+
function dr(t, e, n) {
|
|
1918
|
+
const s = cr(e);
|
|
1919
|
+
return Oe.set(t, n), s.observe(t), () => {
|
|
1920
|
+
Oe.delete(t), s.unobserve(t);
|
|
1883
1921
|
};
|
|
1884
1922
|
}
|
|
1885
|
-
const
|
|
1923
|
+
const hr = {
|
|
1886
1924
|
some: 0,
|
|
1887
1925
|
all: 1
|
|
1888
1926
|
};
|
|
1889
|
-
class
|
|
1927
|
+
class fr extends j {
|
|
1890
1928
|
constructor() {
|
|
1891
1929
|
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
1892
1930
|
}
|
|
@@ -1895,7 +1933,7 @@ class sr extends $ {
|
|
|
1895
1933
|
const { viewport: e = {} } = this.node.getProps(), { root: n, margin: s, amount: i = "some", once: r } = e, o = {
|
|
1896
1934
|
root: n ? n.current : void 0,
|
|
1897
1935
|
rootMargin: s,
|
|
1898
|
-
threshold: typeof i == "number" ? i :
|
|
1936
|
+
threshold: typeof i == "number" ? i : hr[i]
|
|
1899
1937
|
}, a = (l) => {
|
|
1900
1938
|
const { isIntersecting: u } = l;
|
|
1901
1939
|
if (this.isInView === u || (this.isInView = u, r && !u && this.hasEnteredView))
|
|
@@ -1904,7 +1942,7 @@ class sr extends $ {
|
|
|
1904
1942
|
const { onViewportEnter: c, onViewportLeave: d } = this.node.getProps(), h = u ? c : d;
|
|
1905
1943
|
h && h(l);
|
|
1906
1944
|
};
|
|
1907
|
-
return
|
|
1945
|
+
return dr(this.node.current, o, a);
|
|
1908
1946
|
}
|
|
1909
1947
|
mount() {
|
|
1910
1948
|
this.startObserver();
|
|
@@ -1913,58 +1951,58 @@ class sr extends $ {
|
|
|
1913
1951
|
if (typeof IntersectionObserver > "u")
|
|
1914
1952
|
return;
|
|
1915
1953
|
const { props: e, prevProps: n } = this.node;
|
|
1916
|
-
["amount", "margin", "root"].some(
|
|
1954
|
+
["amount", "margin", "root"].some(pr(e, n)) && this.startObserver();
|
|
1917
1955
|
}
|
|
1918
1956
|
unmount() {
|
|
1919
1957
|
}
|
|
1920
1958
|
}
|
|
1921
|
-
function
|
|
1959
|
+
function pr({ viewport: t = {} }, { viewport: e = {} } = {}) {
|
|
1922
1960
|
return (n) => t[n] !== e[n];
|
|
1923
1961
|
}
|
|
1924
|
-
const
|
|
1962
|
+
const mr = {
|
|
1925
1963
|
inView: {
|
|
1926
|
-
Feature:
|
|
1964
|
+
Feature: fr
|
|
1927
1965
|
},
|
|
1928
1966
|
tap: {
|
|
1929
|
-
Feature:
|
|
1967
|
+
Feature: ar
|
|
1930
1968
|
},
|
|
1931
1969
|
focus: {
|
|
1932
|
-
Feature:
|
|
1970
|
+
Feature: or
|
|
1933
1971
|
},
|
|
1934
1972
|
hover: {
|
|
1935
|
-
Feature:
|
|
1973
|
+
Feature: rr
|
|
1936
1974
|
}
|
|
1937
|
-
},
|
|
1938
|
-
function
|
|
1939
|
-
if (
|
|
1975
|
+
}, Ie = { current: null }, Sn = { current: !1 };
|
|
1976
|
+
function gr() {
|
|
1977
|
+
if (Sn.current = !0, !!Kn)
|
|
1940
1978
|
if (window.matchMedia) {
|
|
1941
|
-
const t = window.matchMedia("(prefers-reduced-motion)"), e = () =>
|
|
1979
|
+
const t = window.matchMedia("(prefers-reduced-motion)"), e = () => Ie.current = t.matches;
|
|
1942
1980
|
t.addListener(e), e();
|
|
1943
1981
|
} else
|
|
1944
|
-
|
|
1982
|
+
Ie.current = !1;
|
|
1945
1983
|
}
|
|
1946
|
-
const
|
|
1947
|
-
function
|
|
1984
|
+
const yr = [...ln, w, $], vr = (t) => yr.find(an(t)), br = /* @__PURE__ */ new WeakMap();
|
|
1985
|
+
function Tr(t, e, n) {
|
|
1948
1986
|
for (const s in e) {
|
|
1949
1987
|
const i = e[s], r = n[s];
|
|
1950
|
-
if (
|
|
1951
|
-
t.addValue(s, i), process.env.NODE_ENV === "development" &&
|
|
1952
|
-
else if (
|
|
1953
|
-
t.addValue(s,
|
|
1988
|
+
if (R(i))
|
|
1989
|
+
t.addValue(s, i), process.env.NODE_ENV === "development" && It(i.version === "12.5.0", `Attempting to mix Motion versions ${i.version} with 12.5.0 may not work as expected.`);
|
|
1990
|
+
else if (R(r))
|
|
1991
|
+
t.addValue(s, ee(i, { owner: t }));
|
|
1954
1992
|
else if (r !== i)
|
|
1955
1993
|
if (t.hasValue(s)) {
|
|
1956
1994
|
const o = t.getValue(s);
|
|
1957
1995
|
o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
|
|
1958
1996
|
} else {
|
|
1959
1997
|
const o = t.getStaticValue(s);
|
|
1960
|
-
t.addValue(s,
|
|
1998
|
+
t.addValue(s, ee(o !== void 0 ? o : i, { owner: t }));
|
|
1961
1999
|
}
|
|
1962
2000
|
}
|
|
1963
2001
|
for (const s in n)
|
|
1964
2002
|
e[s] === void 0 && t.removeValue(s);
|
|
1965
2003
|
return e;
|
|
1966
2004
|
}
|
|
1967
|
-
const
|
|
2005
|
+
const At = [
|
|
1968
2006
|
"AnimationStart",
|
|
1969
2007
|
"AnimationComplete",
|
|
1970
2008
|
"Update",
|
|
@@ -1973,7 +2011,7 @@ const vt = [
|
|
|
1973
2011
|
"LayoutAnimationStart",
|
|
1974
2012
|
"LayoutAnimationComplete"
|
|
1975
2013
|
];
|
|
1976
|
-
class
|
|
2014
|
+
class Vr {
|
|
1977
2015
|
/**
|
|
1978
2016
|
* This method takes React props and returns found MotionValues. For example, HTML
|
|
1979
2017
|
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
@@ -1985,25 +2023,25 @@ class dr {
|
|
|
1985
2023
|
return {};
|
|
1986
2024
|
}
|
|
1987
2025
|
constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: o }, a = {}) {
|
|
1988
|
-
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver =
|
|
2026
|
+
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = $e, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
1989
2027
|
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
1990
2028
|
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
1991
|
-
const f =
|
|
2029
|
+
const f = te.now();
|
|
1992
2030
|
this.renderScheduledAt < f && (this.renderScheduledAt = f, F.render(this.render, !1, !0));
|
|
1993
2031
|
};
|
|
1994
2032
|
const { latestValues: l, renderState: u, onUpdate: c } = o;
|
|
1995
|
-
this.onUpdate = c, this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = u, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!r, this.isControllingVariants =
|
|
2033
|
+
this.onUpdate = c, this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = u, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!r, this.isControllingVariants = Nn(n), this.isVariantNode = Bn(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
1996
2034
|
const { willChange: d, ...h } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
1997
2035
|
for (const f in h) {
|
|
1998
2036
|
const b = h[f];
|
|
1999
|
-
l[f] !== void 0 &&
|
|
2037
|
+
l[f] !== void 0 && R(b) && b.set(l[f], !1);
|
|
2000
2038
|
}
|
|
2001
2039
|
}
|
|
2002
2040
|
mount(e) {
|
|
2003
|
-
this.current = e,
|
|
2041
|
+
this.current = e, br.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), Sn.current || gr(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : Ie.current, process.env.NODE_ENV !== "production" && It(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
2004
2042
|
}
|
|
2005
2043
|
unmount() {
|
|
2006
|
-
this.projection && this.projection.unmount(),
|
|
2044
|
+
this.projection && this.projection.unmount(), ve(this.notifyUpdate), ve(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
2007
2045
|
for (const e in this.events)
|
|
2008
2046
|
this.events[e].clear();
|
|
2009
2047
|
for (const e in this.features) {
|
|
@@ -2014,7 +2052,7 @@ class dr {
|
|
|
2014
2052
|
}
|
|
2015
2053
|
bindToMotionValue(e, n) {
|
|
2016
2054
|
this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
|
|
2017
|
-
const s =
|
|
2055
|
+
const s = oe.has(e);
|
|
2018
2056
|
s && this.onBindTransform && this.onBindTransform();
|
|
2019
2057
|
const i = n.on("change", (a) => {
|
|
2020
2058
|
this.latestValues[e] = a, this.props.onUpdate && F.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
|
|
@@ -2029,8 +2067,8 @@ class dr {
|
|
|
2029
2067
|
}
|
|
2030
2068
|
updateFeatures() {
|
|
2031
2069
|
let e = "animation";
|
|
2032
|
-
for (e in
|
|
2033
|
-
const n =
|
|
2070
|
+
for (e in Xe) {
|
|
2071
|
+
const n = Xe[e];
|
|
2034
2072
|
if (!n)
|
|
2035
2073
|
continue;
|
|
2036
2074
|
const { isEnabled: s, Feature: i } = n;
|
|
@@ -2049,7 +2087,7 @@ class dr {
|
|
|
2049
2087
|
* removed with a re-render to work.
|
|
2050
2088
|
*/
|
|
2051
2089
|
measureViewportBox() {
|
|
2052
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) :
|
|
2090
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : Vn();
|
|
2053
2091
|
}
|
|
2054
2092
|
getStaticValue(e) {
|
|
2055
2093
|
return this.latestValues[e];
|
|
@@ -2063,13 +2101,13 @@ class dr {
|
|
|
2063
2101
|
*/
|
|
2064
2102
|
update(e, n) {
|
|
2065
2103
|
(e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
|
|
2066
|
-
for (let s = 0; s <
|
|
2067
|
-
const i =
|
|
2104
|
+
for (let s = 0; s < At.length; s++) {
|
|
2105
|
+
const i = At[s];
|
|
2068
2106
|
this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
|
|
2069
2107
|
const r = "on" + i, o = e[r];
|
|
2070
2108
|
o && (this.propEventSubscriptions[i] = this.on(i, o));
|
|
2071
2109
|
}
|
|
2072
|
-
this.prevMotionValues =
|
|
2110
|
+
this.prevMotionValues = Tr(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue(), this.onUpdate && this.onUpdate(this);
|
|
2073
2111
|
}
|
|
2074
2112
|
getProps() {
|
|
2075
2113
|
return this.props;
|
|
@@ -2125,7 +2163,7 @@ class dr {
|
|
|
2125
2163
|
if (this.props.values && this.props.values[e])
|
|
2126
2164
|
return this.props.values[e];
|
|
2127
2165
|
let s = this.values.get(e);
|
|
2128
|
-
return s === void 0 && n !== void 0 && (s =
|
|
2166
|
+
return s === void 0 && n !== void 0 && (s = ee(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
|
|
2129
2167
|
}
|
|
2130
2168
|
/**
|
|
2131
2169
|
* If we're trying to animate to a previously unencountered value,
|
|
@@ -2135,7 +2173,7 @@ class dr {
|
|
|
2135
2173
|
readValue(e, n) {
|
|
2136
2174
|
var s;
|
|
2137
2175
|
let i = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (s = this.getBaseTargetFromProps(this.props, e)) !== null && s !== void 0 ? s : this.readValueFromInstance(this.current, e, this.options);
|
|
2138
|
-
return i != null && (typeof i == "string" && (
|
|
2176
|
+
return i != null && (typeof i == "string" && (rn(i) || Yt(i)) ? i = parseFloat(i) : !vr(i) && $.test(n) && (i = tn(e, n)), this.setBaseTarget(e, R(i) ? i.get() : i)), R(i) ? i.get() : i;
|
|
2139
2177
|
}
|
|
2140
2178
|
/**
|
|
2141
2179
|
* Set the base target to later animate back to. This is currently
|
|
@@ -2153,24 +2191,24 @@ class dr {
|
|
|
2153
2191
|
const { initial: s } = this.props;
|
|
2154
2192
|
let i;
|
|
2155
2193
|
if (typeof s == "string" || typeof s == "object") {
|
|
2156
|
-
const o =
|
|
2194
|
+
const o = xt(this.props, s, (n = this.presenceContext) === null || n === void 0 ? void 0 : n.custom);
|
|
2157
2195
|
o && (i = o[e]);
|
|
2158
2196
|
}
|
|
2159
2197
|
if (s && i !== void 0)
|
|
2160
2198
|
return i;
|
|
2161
2199
|
const r = this.getBaseTargetFromProps(this.props, e);
|
|
2162
|
-
return r !== void 0 && !
|
|
2200
|
+
return r !== void 0 && !R(r) ? r : this.initialValues[e] !== void 0 && i === void 0 ? void 0 : this.baseTarget[e];
|
|
2163
2201
|
}
|
|
2164
2202
|
on(e, n) {
|
|
2165
|
-
return this.events[e] || (this.events[e] = new
|
|
2203
|
+
return this.events[e] || (this.events[e] = new kn()), this.events[e].add(n);
|
|
2166
2204
|
}
|
|
2167
2205
|
notify(e, ...n) {
|
|
2168
2206
|
this.events[e] && this.events[e].notify(...n);
|
|
2169
2207
|
}
|
|
2170
2208
|
}
|
|
2171
|
-
class
|
|
2209
|
+
class An extends Vr {
|
|
2172
2210
|
constructor() {
|
|
2173
|
-
super(...arguments), this.KeyframeResolver =
|
|
2211
|
+
super(...arguments), this.KeyframeResolver = un;
|
|
2174
2212
|
}
|
|
2175
2213
|
sortInstanceNodePosition(e, n) {
|
|
2176
2214
|
return e.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
@@ -2184,77 +2222,76 @@ class yn extends dr {
|
|
|
2184
2222
|
handleChildMotionValue() {
|
|
2185
2223
|
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
2186
2224
|
const { children: e } = this.props;
|
|
2187
|
-
|
|
2225
|
+
R(e) && (this.childSubscription = e.on("change", (n) => {
|
|
2188
2226
|
this.current && (this.current.textContent = `${n}`);
|
|
2189
2227
|
}));
|
|
2190
2228
|
}
|
|
2191
2229
|
}
|
|
2192
|
-
function
|
|
2230
|
+
function Sr(t) {
|
|
2193
2231
|
return window.getComputedStyle(t);
|
|
2194
2232
|
}
|
|
2195
|
-
class
|
|
2233
|
+
class Ar extends An {
|
|
2196
2234
|
constructor() {
|
|
2197
|
-
super(...arguments), this.type = "html", this.renderInstance =
|
|
2235
|
+
super(...arguments), this.type = "html", this.renderInstance = Ln;
|
|
2198
2236
|
}
|
|
2199
2237
|
readValueFromInstance(e, n) {
|
|
2200
|
-
if (
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
const s = hr(e), i = (On(n) ? s.getPropertyValue(n) : s[n]) || 0;
|
|
2238
|
+
if (oe.has(n))
|
|
2239
|
+
return Gs(e, n);
|
|
2240
|
+
{
|
|
2241
|
+
const s = Sr(e), i = (_n(n) ? s.getPropertyValue(n) : s[n]) || 0;
|
|
2205
2242
|
return typeof i == "string" ? i.trim() : i;
|
|
2206
2243
|
}
|
|
2207
2244
|
}
|
|
2208
2245
|
measureInstanceViewportBox(e, { transformPagePoint: n }) {
|
|
2209
|
-
return
|
|
2246
|
+
return ir(e, n);
|
|
2210
2247
|
}
|
|
2211
2248
|
build(e, n, s) {
|
|
2212
|
-
|
|
2249
|
+
Gn(e, n, s.transformTemplate);
|
|
2213
2250
|
}
|
|
2214
2251
|
scrapeMotionValuesFromProps(e, n, s) {
|
|
2215
|
-
return
|
|
2252
|
+
return Un(e, n, s);
|
|
2216
2253
|
}
|
|
2217
2254
|
}
|
|
2218
|
-
class
|
|
2255
|
+
class xr extends An {
|
|
2219
2256
|
constructor() {
|
|
2220
|
-
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox =
|
|
2221
|
-
this.current && !this.renderState.dimensions &&
|
|
2257
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = Vn, this.updateDimensions = () => {
|
|
2258
|
+
this.current && !this.renderState.dimensions && $n(this.current, this.renderState);
|
|
2222
2259
|
};
|
|
2223
2260
|
}
|
|
2224
2261
|
getBaseTargetFromProps(e, n) {
|
|
2225
2262
|
return e[n];
|
|
2226
2263
|
}
|
|
2227
2264
|
readValueFromInstance(e, n) {
|
|
2228
|
-
if (
|
|
2229
|
-
const s =
|
|
2265
|
+
if (oe.has(n)) {
|
|
2266
|
+
const s = en(n);
|
|
2230
2267
|
return s && s.default || 0;
|
|
2231
2268
|
}
|
|
2232
|
-
return n =
|
|
2269
|
+
return n = Hn.has(n) ? n : jn(n), e.getAttribute(n);
|
|
2233
2270
|
}
|
|
2234
2271
|
scrapeMotionValuesFromProps(e, n, s) {
|
|
2235
|
-
return
|
|
2272
|
+
return Wn(e, n, s);
|
|
2236
2273
|
}
|
|
2237
2274
|
onBindTransform() {
|
|
2238
2275
|
this.current && !this.renderState.dimensions && F.postRender(this.updateDimensions);
|
|
2239
2276
|
}
|
|
2240
2277
|
build(e, n, s) {
|
|
2241
|
-
|
|
2278
|
+
zn(e, n, this.isSVGTag, s.transformTemplate);
|
|
2242
2279
|
}
|
|
2243
2280
|
renderInstance(e, n, s, i) {
|
|
2244
|
-
|
|
2281
|
+
Yn(e, n, s, i);
|
|
2245
2282
|
}
|
|
2246
2283
|
mount(e) {
|
|
2247
|
-
this.isSVGTag =
|
|
2284
|
+
this.isSVGTag = qn(e.tagName), super.mount(e);
|
|
2248
2285
|
}
|
|
2249
2286
|
}
|
|
2250
|
-
const
|
|
2251
|
-
allowProjection: t !==
|
|
2252
|
-
}),
|
|
2253
|
-
renderer:
|
|
2254
|
-
...
|
|
2255
|
-
...
|
|
2287
|
+
const wr = (t, e) => Xn(t) ? new xr(e) : new Ar(e, {
|
|
2288
|
+
allowProjection: t !== Zn
|
|
2289
|
+
}), Mr = {
|
|
2290
|
+
renderer: wr,
|
|
2291
|
+
...tr,
|
|
2292
|
+
...mr
|
|
2256
2293
|
};
|
|
2257
|
-
var
|
|
2294
|
+
var Or = Mr;
|
|
2258
2295
|
export {
|
|
2259
|
-
|
|
2296
|
+
Or as default
|
|
2260
2297
|
};
|