@telegraph/tooltip 0.0.54 → 0.0.55
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/CHANGELOG.md +6 -0
- package/README.md +710 -7
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +1595 -1583
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -1,54 +1,57 @@
|
|
|
1
|
-
import { jsx as R, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useControllableState as
|
|
4
|
-
import { OverrideAppearance as
|
|
5
|
-
import { RefToTgphRef as
|
|
6
|
-
import { Stack as
|
|
7
|
-
import { Text as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
const e =
|
|
1
|
+
import { jsx as R, jsxs as mn } from "react/jsx-runtime";
|
|
2
|
+
import * as ct from "@radix-ui/react-tooltip";
|
|
3
|
+
import { useControllableState as Rs } from "@radix-ui/react-use-controllable-state";
|
|
4
|
+
import { OverrideAppearance as Es } from "@telegraph/appearance";
|
|
5
|
+
import { RefToTgphRef as ks } from "@telegraph/helpers";
|
|
6
|
+
import { Stack as Ns } from "@telegraph/layout";
|
|
7
|
+
import { Text as Ls } from "@telegraph/typography";
|
|
8
|
+
import ht, { createContext as nt, useRef as ft, useLayoutEffect as Bs, useEffect as de, useState as Ks, useContext as k, useMemo as Et, Fragment as gn, createElement as Ws, useCallback as $s, useInsertionEffect as js, forwardRef as Gs } from "react";
|
|
9
|
+
const _s = nt({});
|
|
10
|
+
function Hs(t) {
|
|
11
|
+
const e = ft(null);
|
|
12
12
|
return e.current === null && (e.current = t()), e.current;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
function
|
|
14
|
+
const he = typeof window < "u", Us = he ? Bs : de, yn = /* @__PURE__ */ nt(null);
|
|
15
|
+
function zs(t, e) {
|
|
16
16
|
t.indexOf(e) === -1 && t.push(e);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Ys(t, e) {
|
|
19
19
|
const n = t.indexOf(e);
|
|
20
20
|
n > -1 && t.splice(n, 1);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
}
|
|
22
|
+
const Y = (t, e, n) => n > e ? e : n < t ? t : n;
|
|
23
|
+
function zt(t, e) {
|
|
24
|
+
return e ? `${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}` : t;
|
|
25
|
+
}
|
|
26
|
+
let yt = () => {
|
|
27
|
+
}, X = () => {
|
|
25
28
|
};
|
|
26
|
-
process.env.NODE_ENV !== "production" && (
|
|
27
|
-
!t && typeof console < "u" && console.warn(e);
|
|
28
|
-
},
|
|
29
|
+
process.env.NODE_ENV !== "production" && (yt = (t, e, n) => {
|
|
30
|
+
!t && typeof console < "u" && console.warn(zt(e, n));
|
|
31
|
+
}, X = (t, e, n) => {
|
|
29
32
|
if (!t)
|
|
30
|
-
throw new Error(e);
|
|
33
|
+
throw new Error(zt(e, n));
|
|
31
34
|
});
|
|
32
|
-
const W = {},
|
|
33
|
-
function
|
|
35
|
+
const W = {}, bn = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);
|
|
36
|
+
function Xs(t) {
|
|
34
37
|
return typeof t == "object" && t !== null;
|
|
35
38
|
}
|
|
36
|
-
const
|
|
39
|
+
const Tn = (t) => /^0[^.\s]+$/u.test(t);
|
|
37
40
|
// @__NO_SIDE_EFFECTS__
|
|
38
|
-
function
|
|
41
|
+
function pe(t) {
|
|
39
42
|
let e;
|
|
40
43
|
return () => (e === void 0 && (e = t()), e);
|
|
41
44
|
}
|
|
42
|
-
const
|
|
45
|
+
const st = /* @__NO_SIDE_EFFECTS__ */ (t) => t, qs = (t, e) => (n) => e(t(n)), kt = (...t) => t.reduce(qs), vn = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
|
|
43
46
|
const s = e - t;
|
|
44
47
|
return s === 0 ? 1 : (n - t) / s;
|
|
45
48
|
};
|
|
46
|
-
class
|
|
49
|
+
class wn {
|
|
47
50
|
constructor() {
|
|
48
51
|
this.subscriptions = [];
|
|
49
52
|
}
|
|
50
53
|
add(e) {
|
|
51
|
-
return
|
|
54
|
+
return zs(this.subscriptions, e), () => Ys(this.subscriptions, e);
|
|
52
55
|
}
|
|
53
56
|
notify(e, n, s) {
|
|
54
57
|
const i = this.subscriptions.length;
|
|
@@ -69,48 +72,48 @@ class Tn {
|
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
const L = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, K = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3;
|
|
72
|
-
function
|
|
75
|
+
function Sn(t, e) {
|
|
73
76
|
return e ? t * (1e3 / e) : 0;
|
|
74
77
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
77
|
-
t ||
|
|
78
|
+
const Le = /* @__PURE__ */ new Set();
|
|
79
|
+
function Vn(t, e, n) {
|
|
80
|
+
t || Le.has(e) || (console.warn(zt(e, n)), Le.add(e));
|
|
78
81
|
}
|
|
79
|
-
const
|
|
80
|
-
function
|
|
82
|
+
const An = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, Zs = 1e-7, Js = 12;
|
|
83
|
+
function Qs(t, e, n, s, i) {
|
|
81
84
|
let r, o, a = 0;
|
|
82
85
|
do
|
|
83
|
-
o = e + (n - e) / 2, r =
|
|
84
|
-
while (Math.abs(r) >
|
|
86
|
+
o = e + (n - e) / 2, r = An(o, s, i) - t, r > 0 ? n = o : e = o;
|
|
87
|
+
while (Math.abs(r) > Zs && ++a < Js);
|
|
85
88
|
return o;
|
|
86
89
|
}
|
|
87
|
-
function
|
|
90
|
+
function bt(t, e, n, s) {
|
|
88
91
|
if (t === e && n === s)
|
|
89
|
-
return
|
|
90
|
-
const i = (r) =>
|
|
91
|
-
return (r) => r === 0 || r === 1 ? r :
|
|
92
|
-
}
|
|
93
|
-
const
|
|
94
|
-
linear:
|
|
95
|
-
easeIn:
|
|
96
|
-
easeInOut:
|
|
97
|
-
easeOut:
|
|
98
|
-
circIn:
|
|
99
|
-
circInOut:
|
|
100
|
-
circOut:
|
|
101
|
-
backIn:
|
|
102
|
-
backInOut:
|
|
103
|
-
backOut:
|
|
104
|
-
anticipate:
|
|
105
|
-
},
|
|
106
|
-
if (
|
|
107
|
-
|
|
92
|
+
return st;
|
|
93
|
+
const i = (r) => Qs(r, 0, 1, t, n);
|
|
94
|
+
return (r) => r === 0 || r === 1 ? r : An(i(r), e, s);
|
|
95
|
+
}
|
|
96
|
+
const xn = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Mn = (t) => (e) => 1 - t(1 - e), Cn = /* @__PURE__ */ bt(0.33, 1.53, 0.69, 0.99), me = /* @__PURE__ */ Mn(Cn), Pn = /* @__PURE__ */ xn(me), Fn = (t) => (t *= 2) < 1 ? 0.5 * me(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), ge = (t) => 1 - Math.sin(Math.acos(t)), ti = Mn(ge), On = xn(ge), ei = /* @__PURE__ */ bt(0.42, 0, 1, 1), ni = /* @__PURE__ */ bt(0, 0, 0.58, 1), Dn = /* @__PURE__ */ bt(0.42, 0, 0.58, 1), si = (t) => Array.isArray(t) && typeof t[0] != "number", In = (t) => Array.isArray(t) && typeof t[0] == "number", Be = {
|
|
97
|
+
linear: st,
|
|
98
|
+
easeIn: ei,
|
|
99
|
+
easeInOut: Dn,
|
|
100
|
+
easeOut: ni,
|
|
101
|
+
circIn: ge,
|
|
102
|
+
circInOut: On,
|
|
103
|
+
circOut: ti,
|
|
104
|
+
backIn: me,
|
|
105
|
+
backInOut: Pn,
|
|
106
|
+
backOut: Cn,
|
|
107
|
+
anticipate: Fn
|
|
108
|
+
}, ii = (t) => typeof t == "string", Ke = (t) => {
|
|
109
|
+
if (In(t)) {
|
|
110
|
+
X(t.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
|
|
108
111
|
const [e, n, s, i] = t;
|
|
109
|
-
return
|
|
110
|
-
} else if (
|
|
111
|
-
return
|
|
112
|
+
return bt(e, n, s, i);
|
|
113
|
+
} else if (ii(t))
|
|
114
|
+
return X(Be[t] !== void 0, `Invalid easing type '${t}'`, "invalid-easing-type"), Be[t];
|
|
112
115
|
return t;
|
|
113
|
-
},
|
|
116
|
+
}, At = [
|
|
114
117
|
"setup",
|
|
115
118
|
// Compute
|
|
116
119
|
"read",
|
|
@@ -128,7 +131,7 @@ const Vn = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, An
|
|
|
128
131
|
"postRender"
|
|
129
132
|
// Compute
|
|
130
133
|
];
|
|
131
|
-
function
|
|
134
|
+
function ri(t, e) {
|
|
132
135
|
let n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), i = !1, r = !1;
|
|
133
136
|
const o = /* @__PURE__ */ new WeakSet();
|
|
134
137
|
let a = {
|
|
@@ -143,9 +146,9 @@ function ni(t, e) {
|
|
|
143
146
|
/**
|
|
144
147
|
* Schedule a process to run on the next frame.
|
|
145
148
|
*/
|
|
146
|
-
schedule: (u,
|
|
147
|
-
const y =
|
|
148
|
-
return
|
|
149
|
+
schedule: (u, f = !1, d = !1) => {
|
|
150
|
+
const y = d && i ? n : s;
|
|
151
|
+
return f && o.add(u), y.has(u) || y.add(u), u;
|
|
149
152
|
},
|
|
150
153
|
/**
|
|
151
154
|
* Cancel the provided callback from running on the next frame.
|
|
@@ -166,70 +169,70 @@ function ni(t, e) {
|
|
|
166
169
|
};
|
|
167
170
|
return l;
|
|
168
171
|
}
|
|
169
|
-
const
|
|
170
|
-
function
|
|
172
|
+
const oi = 40;
|
|
173
|
+
function Rn(t, e) {
|
|
171
174
|
let n = !1, s = !0;
|
|
172
175
|
const i = {
|
|
173
176
|
delta: 0,
|
|
174
177
|
timestamp: 0,
|
|
175
178
|
isProcessing: !1
|
|
176
|
-
}, r = () => n = !0, o =
|
|
179
|
+
}, r = () => n = !0, o = At.reduce((m, A) => (m[A] = ri(r), m), {}), { setup: a, read: c, resolveKeyframes: l, preUpdate: u, update: f, preRender: d, render: h, postRender: y } = o, b = () => {
|
|
177
180
|
const m = W.useManualTiming ? i.timestamp : performance.now();
|
|
178
|
-
n = !1, W.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(m - i.timestamp,
|
|
181
|
+
n = !1, W.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(m - i.timestamp, oi), 1)), i.timestamp = m, i.isProcessing = !0, a.process(i), c.process(i), l.process(i), u.process(i), f.process(i), d.process(i), h.process(i), y.process(i), i.isProcessing = !1, n && e && (s = !1, t(b));
|
|
179
182
|
}, v = () => {
|
|
180
183
|
n = !0, s = !0, i.isProcessing || t(b);
|
|
181
184
|
};
|
|
182
|
-
return { schedule:
|
|
185
|
+
return { schedule: At.reduce((m, A) => {
|
|
183
186
|
const T = o[A];
|
|
184
187
|
return m[A] = (V, M = !1, w = !1) => (n || v(), T.schedule(V, M, w)), m;
|
|
185
188
|
}, {}), cancel: (m) => {
|
|
186
|
-
for (let A = 0; A <
|
|
187
|
-
o[
|
|
189
|
+
for (let A = 0; A < At.length; A++)
|
|
190
|
+
o[At[A]].cancel(m);
|
|
188
191
|
}, state: i, steps: o };
|
|
189
192
|
}
|
|
190
|
-
const { schedule: N, cancel:
|
|
191
|
-
let
|
|
192
|
-
function
|
|
193
|
-
|
|
193
|
+
const { schedule: N, cancel: Yt, state: Pt } = /* @__PURE__ */ Rn(typeof requestAnimationFrame < "u" ? requestAnimationFrame : st, !0);
|
|
194
|
+
let Mt;
|
|
195
|
+
function ai() {
|
|
196
|
+
Mt = void 0;
|
|
194
197
|
}
|
|
195
198
|
const E = {
|
|
196
|
-
now: () => (
|
|
199
|
+
now: () => (Mt === void 0 && E.set(Pt.isProcessing || W.useManualTiming ? Pt.timestamp : performance.now()), Mt),
|
|
197
200
|
set: (t) => {
|
|
198
|
-
|
|
201
|
+
Mt = t, queueMicrotask(ai);
|
|
199
202
|
}
|
|
200
|
-
},
|
|
203
|
+
}, En = (t) => (e) => typeof e == "string" && e.startsWith(t), kn = /* @__PURE__ */ En("--"), ui = /* @__PURE__ */ En("var(--"), ye = (t) => ui(t) ? ci.test(t.split("/*")[0].trim()) : !1, ci = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, it = {
|
|
201
204
|
test: (t) => typeof t == "number",
|
|
202
205
|
parse: parseFloat,
|
|
203
206
|
transform: (t) => t
|
|
204
|
-
},
|
|
205
|
-
...
|
|
206
|
-
transform: (t) =>
|
|
207
|
-
},
|
|
208
|
-
...
|
|
207
|
+
}, pt = {
|
|
208
|
+
...it,
|
|
209
|
+
transform: (t) => Y(0, 1, t)
|
|
210
|
+
}, xt = {
|
|
211
|
+
...it,
|
|
209
212
|
default: 1
|
|
210
|
-
},
|
|
211
|
-
function
|
|
213
|
+
}, dt = (t) => Math.round(t * 1e5) / 1e5, be = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
214
|
+
function li(t) {
|
|
212
215
|
return t == null;
|
|
213
216
|
}
|
|
214
|
-
const
|
|
217
|
+
const fi = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, Te = (t, e) => (n) => !!(typeof n == "string" && fi.test(n) && n.startsWith(t) || e && !li(n) && Object.prototype.hasOwnProperty.call(n, e)), Nn = (t, e, n) => (s) => {
|
|
215
218
|
if (typeof s != "string")
|
|
216
219
|
return s;
|
|
217
|
-
const [i, r, o, a] = s.match(
|
|
220
|
+
const [i, r, o, a] = s.match(be);
|
|
218
221
|
return {
|
|
219
222
|
[t]: parseFloat(i),
|
|
220
223
|
[e]: parseFloat(r),
|
|
221
224
|
[n]: parseFloat(o),
|
|
222
225
|
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
223
226
|
};
|
|
224
|
-
},
|
|
225
|
-
...
|
|
226
|
-
transform: (t) => Math.round(
|
|
227
|
+
}, di = (t) => Y(0, 255, t), Wt = {
|
|
228
|
+
...it,
|
|
229
|
+
transform: (t) => Math.round(di(t))
|
|
227
230
|
}, _ = {
|
|
228
|
-
test: /* @__PURE__ */
|
|
229
|
-
parse: /* @__PURE__ */
|
|
230
|
-
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" +
|
|
231
|
+
test: /* @__PURE__ */ Te("rgb", "red"),
|
|
232
|
+
parse: /* @__PURE__ */ Nn("red", "green", "blue"),
|
|
233
|
+
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Wt.transform(t) + ", " + Wt.transform(e) + ", " + Wt.transform(n) + ", " + dt(pt.transform(s)) + ")"
|
|
231
234
|
};
|
|
232
|
-
function
|
|
235
|
+
function hi(t) {
|
|
233
236
|
let e = "", n = "", s = "", i = "";
|
|
234
237
|
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), {
|
|
235
238
|
red: parseInt(e, 16),
|
|
@@ -238,83 +241,83 @@ function li(t) {
|
|
|
238
241
|
alpha: i ? parseInt(i, 16) / 255 : 1
|
|
239
242
|
};
|
|
240
243
|
}
|
|
241
|
-
const
|
|
242
|
-
test: /* @__PURE__ */
|
|
243
|
-
parse:
|
|
244
|
+
const Xt = {
|
|
245
|
+
test: /* @__PURE__ */ Te("#"),
|
|
246
|
+
parse: hi,
|
|
244
247
|
transform: _.transform
|
|
245
|
-
},
|
|
248
|
+
}, Tt = /* @__NO_SIDE_EFFECTS__ */ (t) => ({
|
|
246
249
|
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
247
250
|
parse: parseFloat,
|
|
248
251
|
transform: (e) => `${e}${t}`
|
|
249
|
-
}),
|
|
250
|
-
...
|
|
251
|
-
parse: (t) =>
|
|
252
|
-
transform: (t) =>
|
|
253
|
-
},
|
|
254
|
-
test: /* @__PURE__ */
|
|
255
|
-
parse: /* @__PURE__ */
|
|
256
|
-
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " +
|
|
252
|
+
}), j = /* @__PURE__ */ Tt("deg"), Q = /* @__PURE__ */ Tt("%"), g = /* @__PURE__ */ Tt("px"), pi = /* @__PURE__ */ Tt("vh"), mi = /* @__PURE__ */ Tt("vw"), We = {
|
|
253
|
+
...Q,
|
|
254
|
+
parse: (t) => Q.parse(t) / 100,
|
|
255
|
+
transform: (t) => Q.transform(t * 100)
|
|
256
|
+
}, Z = {
|
|
257
|
+
test: /* @__PURE__ */ Te("hsl", "hue"),
|
|
258
|
+
parse: /* @__PURE__ */ Nn("hue", "saturation", "lightness"),
|
|
259
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + Q.transform(dt(e)) + ", " + Q.transform(dt(n)) + ", " + dt(pt.transform(s)) + ")"
|
|
257
260
|
}, C = {
|
|
258
|
-
test: (t) => _.test(t) ||
|
|
259
|
-
parse: (t) => _.test(t) ? _.parse(t) :
|
|
260
|
-
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? _.transform(t) :
|
|
261
|
+
test: (t) => _.test(t) || Xt.test(t) || Z.test(t),
|
|
262
|
+
parse: (t) => _.test(t) ? _.parse(t) : Z.test(t) ? Z.parse(t) : Xt.parse(t),
|
|
263
|
+
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? _.transform(t) : Z.transform(t),
|
|
261
264
|
getAnimatableNone: (t) => {
|
|
262
265
|
const e = C.parse(t);
|
|
263
266
|
return e.alpha = 0, C.transform(e);
|
|
264
267
|
}
|
|
265
|
-
},
|
|
266
|
-
function
|
|
268
|
+
}, gi = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
269
|
+
function yi(t) {
|
|
267
270
|
var e, n;
|
|
268
|
-
return isNaN(t) && typeof t == "string" && (((e = t.match(
|
|
271
|
+
return isNaN(t) && typeof t == "string" && (((e = t.match(be)) == null ? void 0 : e.length) || 0) + (((n = t.match(gi)) == null ? void 0 : n.length) || 0) > 0;
|
|
269
272
|
}
|
|
270
|
-
const
|
|
271
|
-
function
|
|
273
|
+
const Ln = "number", Bn = "color", bi = "var", Ti = "var(", $e = "${}", vi = /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;
|
|
274
|
+
function mt(t) {
|
|
272
275
|
const e = t.toString(), n = [], s = {
|
|
273
276
|
color: [],
|
|
274
277
|
number: [],
|
|
275
278
|
var: []
|
|
276
279
|
}, i = [];
|
|
277
280
|
let r = 0;
|
|
278
|
-
const a = e.replace(
|
|
281
|
+
const a = e.replace(vi, (c) => (C.test(c) ? (s.color.push(r), i.push(Bn), n.push(C.parse(c))) : c.startsWith(Ti) ? (s.var.push(r), i.push(bi), n.push(c)) : (s.number.push(r), i.push(Ln), n.push(parseFloat(c))), ++r, $e)).split($e);
|
|
279
282
|
return { values: n, split: a, indexes: s, types: i };
|
|
280
283
|
}
|
|
281
|
-
function
|
|
282
|
-
return
|
|
284
|
+
function Kn(t) {
|
|
285
|
+
return mt(t).values;
|
|
283
286
|
}
|
|
284
|
-
function
|
|
285
|
-
const { split: e, types: n } =
|
|
287
|
+
function Wn(t) {
|
|
288
|
+
const { split: e, types: n } = mt(t), s = e.length;
|
|
286
289
|
return (i) => {
|
|
287
290
|
let r = "";
|
|
288
291
|
for (let o = 0; o < s; o++)
|
|
289
292
|
if (r += e[o], i[o] !== void 0) {
|
|
290
293
|
const a = n[o];
|
|
291
|
-
a ===
|
|
294
|
+
a === Ln ? r += dt(i[o]) : a === Bn ? r += C.transform(i[o]) : r += i[o];
|
|
292
295
|
}
|
|
293
296
|
return r;
|
|
294
297
|
};
|
|
295
298
|
}
|
|
296
|
-
const
|
|
297
|
-
function
|
|
298
|
-
const e =
|
|
299
|
-
return
|
|
299
|
+
const wi = (t) => typeof t == "number" ? 0 : C.test(t) ? C.getAnimatableNone(t) : t;
|
|
300
|
+
function Si(t) {
|
|
301
|
+
const e = Kn(t);
|
|
302
|
+
return Wn(t)(e.map(wi));
|
|
300
303
|
}
|
|
301
|
-
const
|
|
302
|
-
test:
|
|
303
|
-
parse:
|
|
304
|
-
createTransformer:
|
|
305
|
-
getAnimatableNone:
|
|
304
|
+
const rt = {
|
|
305
|
+
test: yi,
|
|
306
|
+
parse: Kn,
|
|
307
|
+
createTransformer: Wn,
|
|
308
|
+
getAnimatableNone: Si
|
|
306
309
|
};
|
|
307
|
-
function
|
|
310
|
+
function $t(t, e, n) {
|
|
308
311
|
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;
|
|
309
312
|
}
|
|
310
|
-
function
|
|
313
|
+
function Vi({ hue: t, saturation: e, lightness: n, alpha: s }) {
|
|
311
314
|
t /= 360, e /= 100, n /= 100;
|
|
312
315
|
let i = 0, r = 0, o = 0;
|
|
313
316
|
if (!e)
|
|
314
317
|
i = r = o = n;
|
|
315
318
|
else {
|
|
316
319
|
const a = n < 0.5 ? n * (1 + e) : n + e - n * e, c = 2 * n - a;
|
|
317
|
-
i =
|
|
320
|
+
i = $t(c, a, t + 1 / 3), r = $t(c, a, t), o = $t(c, a, t - 1 / 3);
|
|
318
321
|
}
|
|
319
322
|
return {
|
|
320
323
|
red: Math.round(i * 255),
|
|
@@ -323,55 +326,55 @@ function vi({ hue: t, saturation: e, lightness: n, alpha: s }) {
|
|
|
323
326
|
alpha: s
|
|
324
327
|
};
|
|
325
328
|
}
|
|
326
|
-
function
|
|
329
|
+
function Ft(t, e) {
|
|
327
330
|
return (n) => n > 0 ? e : t;
|
|
328
331
|
}
|
|
329
|
-
const
|
|
332
|
+
const Nt = (t, e, n) => t + (e - t) * n, jt = (t, e, n) => {
|
|
330
333
|
const s = t * t, i = n * (e * e - s) + s;
|
|
331
334
|
return i < 0 ? 0 : Math.sqrt(i);
|
|
332
|
-
},
|
|
333
|
-
function
|
|
334
|
-
const e =
|
|
335
|
-
if (
|
|
335
|
+
}, Ai = [Xt, _, Z], xi = (t) => Ai.find((e) => e.test(t));
|
|
336
|
+
function je(t) {
|
|
337
|
+
const e = xi(t);
|
|
338
|
+
if (yt(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"), !e)
|
|
336
339
|
return !1;
|
|
337
340
|
let n = e.parse(t);
|
|
338
|
-
return e ===
|
|
341
|
+
return e === Z && (n = Vi(n)), n;
|
|
339
342
|
}
|
|
340
|
-
const
|
|
341
|
-
const n =
|
|
343
|
+
const Ge = (t, e) => {
|
|
344
|
+
const n = je(t), s = je(e);
|
|
342
345
|
if (!n || !s)
|
|
343
|
-
return
|
|
346
|
+
return Ft(t, e);
|
|
344
347
|
const i = { ...n };
|
|
345
|
-
return (r) => (i.red =
|
|
346
|
-
},
|
|
347
|
-
function
|
|
348
|
-
return
|
|
348
|
+
return (r) => (i.red = jt(n.red, s.red, r), i.green = jt(n.green, s.green, r), i.blue = jt(n.blue, s.blue, r), i.alpha = Nt(n.alpha, s.alpha, r), _.transform(i));
|
|
349
|
+
}, qt = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
350
|
+
function Mi(t, e) {
|
|
351
|
+
return qt.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
349
352
|
}
|
|
350
|
-
function
|
|
351
|
-
return (n) =>
|
|
353
|
+
function Ci(t, e) {
|
|
354
|
+
return (n) => Nt(t, e, n);
|
|
352
355
|
}
|
|
353
|
-
function
|
|
354
|
-
return typeof t == "number" ?
|
|
356
|
+
function ve(t) {
|
|
357
|
+
return typeof t == "number" ? Ci : typeof t == "string" ? ye(t) ? Ft : C.test(t) ? Ge : Oi : Array.isArray(t) ? $n : typeof t == "object" ? C.test(t) ? Ge : Pi : Ft;
|
|
355
358
|
}
|
|
356
|
-
function
|
|
357
|
-
const n = [...t], s = n.length, i = t.map((r, o) =>
|
|
359
|
+
function $n(t, e) {
|
|
360
|
+
const n = [...t], s = n.length, i = t.map((r, o) => ve(r)(r, e[o]));
|
|
358
361
|
return (r) => {
|
|
359
362
|
for (let o = 0; o < s; o++)
|
|
360
363
|
n[o] = i[o](r);
|
|
361
364
|
return n;
|
|
362
365
|
};
|
|
363
366
|
}
|
|
364
|
-
function
|
|
367
|
+
function Pi(t, e) {
|
|
365
368
|
const n = { ...t, ...e }, s = {};
|
|
366
369
|
for (const i in n)
|
|
367
|
-
t[i] !== void 0 && e[i] !== void 0 && (s[i] =
|
|
370
|
+
t[i] !== void 0 && e[i] !== void 0 && (s[i] = ve(t[i])(t[i], e[i]));
|
|
368
371
|
return (i) => {
|
|
369
372
|
for (const r in s)
|
|
370
373
|
n[r] = s[r](i);
|
|
371
374
|
return n;
|
|
372
375
|
};
|
|
373
376
|
}
|
|
374
|
-
function
|
|
377
|
+
function Fi(t, e) {
|
|
375
378
|
const n = [], s = { color: 0, var: 0, number: 0 };
|
|
376
379
|
for (let i = 0; i < e.values.length; i++) {
|
|
377
380
|
const r = e.types[i], o = t.indexes[r][s[r]], a = t.values[o] ?? 0;
|
|
@@ -379,51 +382,51 @@ function Mi(t, e) {
|
|
|
379
382
|
}
|
|
380
383
|
return n;
|
|
381
384
|
}
|
|
382
|
-
const
|
|
383
|
-
const n =
|
|
384
|
-
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 ?
|
|
385
|
+
const Oi = (t, e) => {
|
|
386
|
+
const n = rt.createTransformer(e), s = mt(t), i = mt(e);
|
|
387
|
+
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 ? qt.has(t) && !i.values.length || qt.has(e) && !s.values.length ? Mi(t, e) : kt($n(Fi(s, i), i.values), n) : (yt(!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.`, "complex-values-different"), Ft(t, e));
|
|
385
388
|
};
|
|
386
|
-
function
|
|
387
|
-
return typeof t == "number" && typeof e == "number" && typeof n == "number" ?
|
|
389
|
+
function jn(t, e, n) {
|
|
390
|
+
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? Nt(t, e, n) : ve(t)(t, e);
|
|
388
391
|
}
|
|
389
|
-
const
|
|
392
|
+
const Di = (t) => {
|
|
390
393
|
const e = ({ timestamp: n }) => t(n);
|
|
391
394
|
return {
|
|
392
395
|
start: (n = !0) => N.update(e, n),
|
|
393
|
-
stop: () =>
|
|
396
|
+
stop: () => Yt(e),
|
|
394
397
|
/**
|
|
395
398
|
* If we're processing this frame we can use the
|
|
396
399
|
* framelocked timestamp to keep things in sync.
|
|
397
400
|
*/
|
|
398
|
-
now: () =>
|
|
401
|
+
now: () => Pt.isProcessing ? Pt.timestamp : E.now()
|
|
399
402
|
};
|
|
400
|
-
},
|
|
403
|
+
}, Gn = (t, e, n = 10) => {
|
|
401
404
|
let s = "";
|
|
402
405
|
const i = Math.max(Math.round(e / n), 2);
|
|
403
406
|
for (let r = 0; r < i; r++)
|
|
404
407
|
s += Math.round(t(r / (i - 1)) * 1e4) / 1e4 + ", ";
|
|
405
408
|
return `linear(${s.substring(0, s.length - 2)})`;
|
|
406
|
-
},
|
|
407
|
-
function
|
|
409
|
+
}, Ot = 2e4;
|
|
410
|
+
function we(t) {
|
|
408
411
|
let e = 0;
|
|
409
412
|
const n = 50;
|
|
410
413
|
let s = t.next(e);
|
|
411
|
-
for (; !s.done && e <
|
|
414
|
+
for (; !s.done && e < Ot; )
|
|
412
415
|
e += n, s = t.next(e);
|
|
413
|
-
return e >=
|
|
416
|
+
return e >= Ot ? 1 / 0 : e;
|
|
414
417
|
}
|
|
415
|
-
function
|
|
416
|
-
const s = n({ ...t, keyframes: [0, e] }), i = Math.min(
|
|
418
|
+
function Ii(t, e = 100, n) {
|
|
419
|
+
const s = n({ ...t, keyframes: [0, e] }), i = Math.min(we(s), Ot);
|
|
417
420
|
return {
|
|
418
421
|
type: "keyframes",
|
|
419
422
|
ease: (r) => s.next(i * r).value / e,
|
|
420
423
|
duration: /* @__PURE__ */ K(i)
|
|
421
424
|
};
|
|
422
425
|
}
|
|
423
|
-
const
|
|
424
|
-
function
|
|
425
|
-
const s = Math.max(e -
|
|
426
|
-
return
|
|
426
|
+
const Ri = 5;
|
|
427
|
+
function _n(t, e, n) {
|
|
428
|
+
const s = Math.max(e - Ri, 0);
|
|
429
|
+
return Sn(n - t(s), e - s);
|
|
427
430
|
}
|
|
428
431
|
const x = {
|
|
429
432
|
// Default spring physics
|
|
@@ -453,25 +456,25 @@ const x = {
|
|
|
453
456
|
// in seconds
|
|
454
457
|
minDamping: 0.05,
|
|
455
458
|
maxDamping: 1
|
|
456
|
-
},
|
|
457
|
-
function
|
|
459
|
+
}, Gt = 1e-3;
|
|
460
|
+
function Ei({ duration: t = x.duration, bounce: e = x.bounce, velocity: n = x.velocity, mass: s = x.mass }) {
|
|
458
461
|
let i, r;
|
|
459
|
-
|
|
462
|
+
yt(t <= /* @__PURE__ */ L(x.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
|
|
460
463
|
let o = 1 - e;
|
|
461
|
-
o =
|
|
462
|
-
const u = l * o,
|
|
463
|
-
return
|
|
464
|
+
o = Y(x.minDamping, x.maxDamping, o), t = Y(x.minDuration, x.maxDuration, /* @__PURE__ */ K(t)), o < 1 ? (i = (l) => {
|
|
465
|
+
const u = l * o, f = u * t, d = u - n, h = Zt(l, o), y = Math.exp(-f);
|
|
466
|
+
return Gt - d / h * y;
|
|
464
467
|
}, r = (l) => {
|
|
465
|
-
const
|
|
466
|
-
return (-i(l) +
|
|
468
|
+
const f = l * o * t, d = f * n + n, h = Math.pow(o, 2) * Math.pow(l, 2) * t, y = Math.exp(-f), b = Zt(Math.pow(l, 2), o);
|
|
469
|
+
return (-i(l) + Gt > 0 ? -1 : 1) * ((d - h) * y) / b;
|
|
467
470
|
}) : (i = (l) => {
|
|
468
|
-
const u = Math.exp(-l * t),
|
|
469
|
-
return -
|
|
471
|
+
const u = Math.exp(-l * t), f = (l - n) * t + 1;
|
|
472
|
+
return -Gt + u * f;
|
|
470
473
|
}, r = (l) => {
|
|
471
|
-
const u = Math.exp(-l * t),
|
|
472
|
-
return u *
|
|
474
|
+
const u = Math.exp(-l * t), f = (n - l) * (t * t);
|
|
475
|
+
return u * f;
|
|
473
476
|
});
|
|
474
|
-
const a = 5 / t, c =
|
|
477
|
+
const a = 5 / t, c = Ni(i, r, a);
|
|
475
478
|
if (t = /* @__PURE__ */ L(t), isNaN(c))
|
|
476
479
|
return {
|
|
477
480
|
stiffness: x.stiffness,
|
|
@@ -487,21 +490,21 @@ function Di({ duration: t = x.duration, bounce: e = x.bounce, velocity: n = x.ve
|
|
|
487
490
|
};
|
|
488
491
|
}
|
|
489
492
|
}
|
|
490
|
-
const
|
|
491
|
-
function
|
|
493
|
+
const ki = 12;
|
|
494
|
+
function Ni(t, e, n) {
|
|
492
495
|
let s = n;
|
|
493
|
-
for (let i = 1; i <
|
|
496
|
+
for (let i = 1; i < ki; i++)
|
|
494
497
|
s = s - t(s) / e(s);
|
|
495
498
|
return s;
|
|
496
499
|
}
|
|
497
|
-
function
|
|
500
|
+
function Zt(t, e) {
|
|
498
501
|
return t * Math.sqrt(1 - e * e);
|
|
499
502
|
}
|
|
500
|
-
const
|
|
501
|
-
function
|
|
503
|
+
const Li = ["duration", "bounce"], Bi = ["stiffness", "damping", "mass"];
|
|
504
|
+
function _e(t, e) {
|
|
502
505
|
return e.some((n) => t[n] !== void 0);
|
|
503
506
|
}
|
|
504
|
-
function
|
|
507
|
+
function Ki(t) {
|
|
505
508
|
let e = {
|
|
506
509
|
velocity: x.velocity,
|
|
507
510
|
stiffness: x.stiffness,
|
|
@@ -510,9 +513,9 @@ function Ni(t) {
|
|
|
510
513
|
isResolvedFromDuration: !1,
|
|
511
514
|
...t
|
|
512
515
|
};
|
|
513
|
-
if (!
|
|
516
|
+
if (!_e(t, Bi) && _e(t, Li))
|
|
514
517
|
if (t.visualDuration) {
|
|
515
|
-
const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 *
|
|
518
|
+
const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * Y(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(i);
|
|
516
519
|
e = {
|
|
517
520
|
...e,
|
|
518
521
|
mass: x.mass,
|
|
@@ -520,7 +523,7 @@ function Ni(t) {
|
|
|
520
523
|
damping: r
|
|
521
524
|
};
|
|
522
525
|
} else {
|
|
523
|
-
const n =
|
|
526
|
+
const n = Ei(t);
|
|
524
527
|
e = {
|
|
525
528
|
...e,
|
|
526
529
|
...n,
|
|
@@ -529,21 +532,21 @@ function Ni(t) {
|
|
|
529
532
|
}
|
|
530
533
|
return e;
|
|
531
534
|
}
|
|
532
|
-
function
|
|
535
|
+
function Dt(t = x.visualDuration, e = x.bounce) {
|
|
533
536
|
const n = typeof t != "object" ? {
|
|
534
537
|
visualDuration: t,
|
|
535
538
|
keyframes: [0, 1],
|
|
536
539
|
bounce: e
|
|
537
540
|
} : t;
|
|
538
541
|
let { restSpeed: s, restDelta: i } = n;
|
|
539
|
-
const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: c, damping: l, mass: u, duration:
|
|
542
|
+
const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: c, damping: l, mass: u, duration: f, velocity: d, isResolvedFromDuration: h } = Ki({
|
|
540
543
|
...n,
|
|
541
544
|
velocity: -/* @__PURE__ */ K(n.velocity || 0)
|
|
542
|
-
}), y =
|
|
545
|
+
}), y = d || 0, b = l / (2 * Math.sqrt(c * u)), v = o - r, p = /* @__PURE__ */ K(Math.sqrt(c / u)), S = Math.abs(v) < 5;
|
|
543
546
|
s || (s = S ? x.restSpeed.granular : x.restSpeed.default), i || (i = S ? x.restDelta.granular : x.restDelta.default);
|
|
544
547
|
let m;
|
|
545
548
|
if (b < 1) {
|
|
546
|
-
const T =
|
|
549
|
+
const T = Zt(p, b);
|
|
547
550
|
m = (V) => {
|
|
548
551
|
const M = Math.exp(-b * p * V);
|
|
549
552
|
return o - M * ((y + b * p * v) / T * Math.sin(T * V) + v * Math.cos(T * V));
|
|
@@ -558,21 +561,21 @@ function Ft(t = x.visualDuration, e = x.bounce) {
|
|
|
558
561
|
};
|
|
559
562
|
}
|
|
560
563
|
const A = {
|
|
561
|
-
calculatedDuration: h &&
|
|
564
|
+
calculatedDuration: h && f || null,
|
|
562
565
|
next: (T) => {
|
|
563
566
|
const V = m(T);
|
|
564
567
|
if (h)
|
|
565
|
-
a.done = T >=
|
|
568
|
+
a.done = T >= f;
|
|
566
569
|
else {
|
|
567
570
|
let M = T === 0 ? y : 0;
|
|
568
|
-
b < 1 && (M = T === 0 ? /* @__PURE__ */ L(y) :
|
|
569
|
-
const w = Math.abs(M) <= s,
|
|
570
|
-
a.done = w &&
|
|
571
|
+
b < 1 && (M = T === 0 ? /* @__PURE__ */ L(y) : _n(m, T, V));
|
|
572
|
+
const w = Math.abs(M) <= s, O = Math.abs(o - V) <= i;
|
|
573
|
+
a.done = w && O;
|
|
571
574
|
}
|
|
572
575
|
return a.value = a.done ? o : V, a;
|
|
573
576
|
},
|
|
574
577
|
toString: () => {
|
|
575
|
-
const T = Math.min(
|
|
578
|
+
const T = Math.min(we(A), Ot), V = Gn((M) => A.next(T * M).value, T, 30);
|
|
576
579
|
return T + "ms " + V;
|
|
577
580
|
},
|
|
578
581
|
toTransition: () => {
|
|
@@ -580,27 +583,27 @@ function Ft(t = x.visualDuration, e = x.bounce) {
|
|
|
580
583
|
};
|
|
581
584
|
return A;
|
|
582
585
|
}
|
|
583
|
-
|
|
584
|
-
const e =
|
|
586
|
+
Dt.applyToOptions = (t) => {
|
|
587
|
+
const e = Ii(t, 100, Dt);
|
|
585
588
|
return t.ease = e.ease, t.duration = /* @__PURE__ */ L(e.duration), t.type = "keyframes", t;
|
|
586
589
|
};
|
|
587
|
-
function
|
|
588
|
-
const
|
|
590
|
+
function Jt({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: c, restDelta: l = 0.5, restSpeed: u }) {
|
|
591
|
+
const f = t[0], d = {
|
|
589
592
|
done: !1,
|
|
590
|
-
value:
|
|
593
|
+
value: f
|
|
591
594
|
}, h = (w) => a !== void 0 && w < a || c !== void 0 && w > c, y = (w) => a === void 0 ? c : c === void 0 || Math.abs(a - w) < Math.abs(c - w) ? a : c;
|
|
592
595
|
let b = n * e;
|
|
593
|
-
const v =
|
|
594
|
-
p !== v && (b = p -
|
|
596
|
+
const v = f + b, p = o === void 0 ? v : o(v);
|
|
597
|
+
p !== v && (b = p - f);
|
|
595
598
|
const S = (w) => -b * Math.exp(-w / s), m = (w) => p + S(w), A = (w) => {
|
|
596
|
-
const
|
|
597
|
-
|
|
599
|
+
const O = S(w), D = m(w);
|
|
600
|
+
d.done = Math.abs(O) <= l, d.value = d.done ? p : D;
|
|
598
601
|
};
|
|
599
602
|
let T, V;
|
|
600
603
|
const M = (w) => {
|
|
601
|
-
h(
|
|
602
|
-
keyframes: [
|
|
603
|
-
velocity:
|
|
604
|
+
h(d.value) && (T = w, V = Dt({
|
|
605
|
+
keyframes: [d.value, y(d.value)],
|
|
606
|
+
velocity: _n(m, w, d.value),
|
|
604
607
|
// TODO: This should be passing * 1000
|
|
605
608
|
damping: i,
|
|
606
609
|
stiffness: r,
|
|
@@ -611,93 +614,93 @@ function qt({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 3
|
|
|
611
614
|
return M(0), {
|
|
612
615
|
calculatedDuration: null,
|
|
613
616
|
next: (w) => {
|
|
614
|
-
let
|
|
615
|
-
return !V && T === void 0 && (
|
|
617
|
+
let O = !1;
|
|
618
|
+
return !V && T === void 0 && (O = !0, A(w), M(w)), T !== void 0 && w >= T ? V.next(w - T) : (!O && A(w), d);
|
|
616
619
|
}
|
|
617
620
|
};
|
|
618
621
|
}
|
|
619
|
-
function
|
|
620
|
-
const s = [], i = n || W.mix ||
|
|
622
|
+
function Wi(t, e, n) {
|
|
623
|
+
const s = [], i = n || W.mix || jn, r = t.length - 1;
|
|
621
624
|
for (let o = 0; o < r; o++) {
|
|
622
625
|
let a = i(t[o], t[o + 1]);
|
|
623
626
|
if (e) {
|
|
624
|
-
const c = Array.isArray(e) ? e[o] ||
|
|
625
|
-
a =
|
|
627
|
+
const c = Array.isArray(e) ? e[o] || st : e;
|
|
628
|
+
a = kt(c, a);
|
|
626
629
|
}
|
|
627
630
|
s.push(a);
|
|
628
631
|
}
|
|
629
632
|
return s;
|
|
630
633
|
}
|
|
631
|
-
function
|
|
634
|
+
function $i(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
632
635
|
const r = t.length;
|
|
633
|
-
if (
|
|
636
|
+
if (X(r === e.length, "Both input and output ranges must be the same length", "range-length"), r === 1)
|
|
634
637
|
return () => e[0];
|
|
635
638
|
if (r === 2 && e[0] === e[1])
|
|
636
639
|
return () => e[1];
|
|
637
640
|
const o = t[0] === t[1];
|
|
638
641
|
t[0] > t[r - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
639
|
-
const a =
|
|
642
|
+
const a = Wi(e, s, i), c = a.length, l = (u) => {
|
|
640
643
|
if (o && u < t[0])
|
|
641
644
|
return e[0];
|
|
642
|
-
let
|
|
645
|
+
let f = 0;
|
|
643
646
|
if (c > 1)
|
|
644
|
-
for (;
|
|
647
|
+
for (; f < t.length - 2 && !(u < t[f + 1]); f++)
|
|
645
648
|
;
|
|
646
|
-
const
|
|
647
|
-
return a[
|
|
649
|
+
const d = /* @__PURE__ */ vn(t[f], t[f + 1], u);
|
|
650
|
+
return a[f](d);
|
|
648
651
|
};
|
|
649
|
-
return n ? (u) => l(
|
|
652
|
+
return n ? (u) => l(Y(t[0], t[r - 1], u)) : l;
|
|
650
653
|
}
|
|
651
|
-
function
|
|
654
|
+
function ji(t, e) {
|
|
652
655
|
const n = t[t.length - 1];
|
|
653
656
|
for (let s = 1; s <= e; s++) {
|
|
654
|
-
const i = /* @__PURE__ */
|
|
655
|
-
t.push(
|
|
657
|
+
const i = /* @__PURE__ */ vn(0, e, s);
|
|
658
|
+
t.push(Nt(n, 1, i));
|
|
656
659
|
}
|
|
657
660
|
}
|
|
658
|
-
function
|
|
661
|
+
function Gi(t) {
|
|
659
662
|
const e = [0];
|
|
660
|
-
return
|
|
663
|
+
return ji(e, t.length - 1), e;
|
|
661
664
|
}
|
|
662
|
-
function
|
|
665
|
+
function _i(t, e) {
|
|
663
666
|
return t.map((n) => n * e);
|
|
664
667
|
}
|
|
665
|
-
function
|
|
666
|
-
return t.map(() => e ||
|
|
668
|
+
function Hi(t, e) {
|
|
669
|
+
return t.map(() => e || Dn).splice(0, t.length - 1);
|
|
667
670
|
}
|
|
668
|
-
function
|
|
669
|
-
const i =
|
|
671
|
+
function J({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
|
|
672
|
+
const i = si(s) ? s.map(Ke) : Ke(s), r = {
|
|
670
673
|
done: !1,
|
|
671
674
|
value: e[0]
|
|
672
|
-
}, o =
|
|
675
|
+
}, o = _i(
|
|
673
676
|
// Only use the provided offsets if they're the correct length
|
|
674
677
|
// TODO Maybe we should warn here if there's a length mismatch
|
|
675
|
-
n && n.length === e.length ? n :
|
|
678
|
+
n && n.length === e.length ? n : Gi(e),
|
|
676
679
|
t
|
|
677
|
-
), a =
|
|
678
|
-
ease: Array.isArray(i) ? i :
|
|
680
|
+
), a = $i(o, e, {
|
|
681
|
+
ease: Array.isArray(i) ? i : Hi(e, i)
|
|
679
682
|
});
|
|
680
683
|
return {
|
|
681
684
|
calculatedDuration: t,
|
|
682
685
|
next: (c) => (r.value = a(c), r.done = c >= t, r)
|
|
683
686
|
};
|
|
684
687
|
}
|
|
685
|
-
const
|
|
686
|
-
function
|
|
687
|
-
const r = t.filter(
|
|
688
|
+
const Ui = (t) => t !== null;
|
|
689
|
+
function Se(t, { repeat: e, repeatType: n = "loop" }, s, i = 1) {
|
|
690
|
+
const r = t.filter(Ui), a = i < 0 || e && n !== "loop" && e % 2 === 1 ? 0 : r.length - 1;
|
|
688
691
|
return !a || s === void 0 ? r[a] : s;
|
|
689
692
|
}
|
|
690
|
-
const
|
|
691
|
-
decay:
|
|
692
|
-
inertia:
|
|
693
|
-
tween:
|
|
694
|
-
keyframes:
|
|
695
|
-
spring:
|
|
693
|
+
const zi = {
|
|
694
|
+
decay: Jt,
|
|
695
|
+
inertia: Jt,
|
|
696
|
+
tween: J,
|
|
697
|
+
keyframes: J,
|
|
698
|
+
spring: Dt
|
|
696
699
|
};
|
|
697
|
-
function
|
|
698
|
-
typeof t.type == "string" && (t.type =
|
|
700
|
+
function Hn(t) {
|
|
701
|
+
typeof t.type == "string" && (t.type = zi[t.type]);
|
|
699
702
|
}
|
|
700
|
-
class
|
|
703
|
+
class Ve {
|
|
701
704
|
constructor() {
|
|
702
705
|
this.updateFinished();
|
|
703
706
|
}
|
|
@@ -721,8 +724,8 @@ class ve {
|
|
|
721
724
|
return this.finished.then(e, n);
|
|
722
725
|
}
|
|
723
726
|
}
|
|
724
|
-
const
|
|
725
|
-
class
|
|
727
|
+
const Yi = (t) => t / 100;
|
|
728
|
+
class Ae extends Ve {
|
|
726
729
|
constructor(e) {
|
|
727
730
|
super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = () => {
|
|
728
731
|
var s, i;
|
|
@@ -732,17 +735,17 @@ class we extends ve {
|
|
|
732
735
|
}
|
|
733
736
|
initAnimation() {
|
|
734
737
|
const { options: e } = this;
|
|
735
|
-
|
|
736
|
-
const { type: n =
|
|
738
|
+
Hn(e);
|
|
739
|
+
const { type: n = J, repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = e;
|
|
737
740
|
let { keyframes: a } = e;
|
|
738
|
-
const c = n ||
|
|
739
|
-
process.env.NODE_ENV !== "production" && c !==
|
|
741
|
+
const c = n || J;
|
|
742
|
+
process.env.NODE_ENV !== "production" && c !== J && X(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`, "spring-two-frames"), c !== J && typeof a[0] != "number" && (this.mixKeyframes = kt(Yi, jn(a[0], a[1])), a = [0, 100]);
|
|
740
743
|
const l = c({ ...e, keyframes: a });
|
|
741
744
|
r === "mirror" && (this.mirroredGenerator = c({
|
|
742
745
|
...e,
|
|
743
746
|
keyframes: [...a].reverse(),
|
|
744
747
|
velocity: -o
|
|
745
|
-
})), l.calculatedDuration === null && (l.calculatedDuration =
|
|
748
|
+
})), l.calculatedDuration === null && (l.calculatedDuration = we(l));
|
|
746
749
|
const { calculatedDuration: u } = l;
|
|
747
750
|
this.calculatedDuration = u, this.resolvedDuration = u + i, this.totalDuration = this.resolvedDuration * (s + 1) - i, this.generator = l;
|
|
748
751
|
}
|
|
@@ -754,22 +757,22 @@ class we extends ve {
|
|
|
754
757
|
const { generator: s, totalDuration: i, mixKeyframes: r, mirroredGenerator: o, resolvedDuration: a, calculatedDuration: c } = this;
|
|
755
758
|
if (this.startTime === null)
|
|
756
759
|
return s.next(0);
|
|
757
|
-
const { delay: l = 0, keyframes: u, repeat:
|
|
760
|
+
const { delay: l = 0, keyframes: u, repeat: f, repeatType: d, repeatDelay: h, type: y, onUpdate: b, finalKeyframe: v } = this.options;
|
|
758
761
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - i / this.speed, this.startTime)), n ? this.currentTime = e : this.updateTime(e);
|
|
759
762
|
const p = this.currentTime - l * (this.playbackSpeed >= 0 ? 1 : -1), S = this.playbackSpeed >= 0 ? p < 0 : p > i;
|
|
760
763
|
this.currentTime = Math.max(p, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = i);
|
|
761
764
|
let m = this.currentTime, A = s;
|
|
762
|
-
if (
|
|
765
|
+
if (f) {
|
|
763
766
|
const w = Math.min(this.currentTime, i) / a;
|
|
764
|
-
let
|
|
765
|
-
!D && w >= 1 && (D = 1), D === 1 &&
|
|
767
|
+
let O = Math.floor(w), D = w % 1;
|
|
768
|
+
!D && w >= 1 && (D = 1), D === 1 && O--, O = Math.min(O, f + 1), !!(O % 2) && (d === "reverse" ? (D = 1 - D, h && (D -= h / a)) : d === "mirror" && (A = o)), m = Y(0, 1, D) * a;
|
|
766
769
|
}
|
|
767
770
|
const T = S ? { done: !1, value: u[0] } : A.next(m);
|
|
768
771
|
r && (T.value = r(T.value));
|
|
769
772
|
let { done: V } = T;
|
|
770
773
|
!S && c !== null && (V = this.playbackSpeed >= 0 ? this.currentTime >= i : this.currentTime <= 0);
|
|
771
774
|
const M = this.holdTime === null && (this.state === "finished" || this.state === "running" && V);
|
|
772
|
-
return M && y !==
|
|
775
|
+
return M && y !== Jt && (T.value = Se(u, this.options, v, this.speed)), b && b(T.value), M && this.finish(), T;
|
|
773
776
|
}
|
|
774
777
|
/**
|
|
775
778
|
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
@@ -801,7 +804,7 @@ class we extends ve {
|
|
|
801
804
|
var i, r;
|
|
802
805
|
if (this.isStopped)
|
|
803
806
|
return;
|
|
804
|
-
const { driver: e =
|
|
807
|
+
const { driver: e = Di, startTime: n } = this.options;
|
|
805
808
|
this.driver || (this.driver = e((o) => this.tick(o))), (r = (i = this.options).onPlay) == null || r.call(i);
|
|
806
809
|
const s = this.driver.now();
|
|
807
810
|
this.state === "finished" ? (this.updateFinished(), this.startTime = s) : this.holdTime !== null ? this.startTime = s - this.holdTime : this.startTime || (this.startTime = n ?? s), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
|
|
@@ -834,14 +837,14 @@ class we extends ve {
|
|
|
834
837
|
return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), (n = this.driver) == null || n.stop(), e.observe(this);
|
|
835
838
|
}
|
|
836
839
|
}
|
|
837
|
-
function
|
|
840
|
+
function Xi(t) {
|
|
838
841
|
for (let e = 1; e < t.length; e++)
|
|
839
842
|
t[e] ?? (t[e] = t[e - 1]);
|
|
840
843
|
}
|
|
841
|
-
const
|
|
842
|
-
const e =
|
|
843
|
-
return
|
|
844
|
-
},
|
|
844
|
+
const H = (t) => t * 180 / Math.PI, Qt = (t) => {
|
|
845
|
+
const e = H(Math.atan2(t[1], t[0]));
|
|
846
|
+
return te(e);
|
|
847
|
+
}, qi = {
|
|
845
848
|
x: 4,
|
|
846
849
|
y: 5,
|
|
847
850
|
translateX: 4,
|
|
@@ -849,56 +852,56 @@ const G = (t) => t * 180 / Math.PI, Zt = (t) => {
|
|
|
849
852
|
scaleX: 0,
|
|
850
853
|
scaleY: 3,
|
|
851
854
|
scale: (t) => (Math.abs(t[0]) + Math.abs(t[3])) / 2,
|
|
852
|
-
rotate:
|
|
853
|
-
rotateZ:
|
|
854
|
-
skewX: (t) =>
|
|
855
|
-
skewY: (t) =>
|
|
855
|
+
rotate: Qt,
|
|
856
|
+
rotateZ: Qt,
|
|
857
|
+
skewX: (t) => H(Math.atan(t[1])),
|
|
858
|
+
skewY: (t) => H(Math.atan(t[2])),
|
|
856
859
|
skew: (t) => (Math.abs(t[1]) + Math.abs(t[2])) / 2
|
|
857
|
-
},
|
|
860
|
+
}, te = (t) => (t = t % 360, t < 0 && (t += 360), t), He = Qt, Ue = (t) => Math.sqrt(t[0] * t[0] + t[1] * t[1]), ze = (t) => Math.sqrt(t[4] * t[4] + t[5] * t[5]), Zi = {
|
|
858
861
|
x: 12,
|
|
859
862
|
y: 13,
|
|
860
863
|
z: 14,
|
|
861
864
|
translateX: 12,
|
|
862
865
|
translateY: 13,
|
|
863
866
|
translateZ: 14,
|
|
864
|
-
scaleX:
|
|
865
|
-
scaleY:
|
|
866
|
-
scale: (t) => (
|
|
867
|
-
rotateX: (t) =>
|
|
868
|
-
rotateY: (t) =>
|
|
869
|
-
rotateZ:
|
|
870
|
-
rotate:
|
|
871
|
-
skewX: (t) =>
|
|
872
|
-
skewY: (t) =>
|
|
867
|
+
scaleX: Ue,
|
|
868
|
+
scaleY: ze,
|
|
869
|
+
scale: (t) => (Ue(t) + ze(t)) / 2,
|
|
870
|
+
rotateX: (t) => te(H(Math.atan2(t[6], t[5]))),
|
|
871
|
+
rotateY: (t) => te(H(Math.atan2(-t[2], t[0]))),
|
|
872
|
+
rotateZ: He,
|
|
873
|
+
rotate: He,
|
|
874
|
+
skewX: (t) => H(Math.atan(t[4])),
|
|
875
|
+
skewY: (t) => H(Math.atan(t[1])),
|
|
873
876
|
skew: (t) => (Math.abs(t[1]) + Math.abs(t[4])) / 2
|
|
874
877
|
};
|
|
875
|
-
function
|
|
878
|
+
function ee(t) {
|
|
876
879
|
return t.includes("scale") ? 1 : 0;
|
|
877
880
|
}
|
|
878
|
-
function
|
|
881
|
+
function ne(t, e) {
|
|
879
882
|
if (!t || t === "none")
|
|
880
|
-
return
|
|
883
|
+
return ee(e);
|
|
881
884
|
const n = t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
|
|
882
885
|
let s, i;
|
|
883
886
|
if (n)
|
|
884
|
-
s =
|
|
887
|
+
s = Zi, i = n;
|
|
885
888
|
else {
|
|
886
889
|
const a = t.match(/^matrix\(([-\d.e\s,]+)\)$/u);
|
|
887
|
-
s =
|
|
890
|
+
s = qi, i = a;
|
|
888
891
|
}
|
|
889
892
|
if (!i)
|
|
890
|
-
return
|
|
891
|
-
const r = s[e], o = i[1].split(",").map(
|
|
893
|
+
return ee(e);
|
|
894
|
+
const r = s[e], o = i[1].split(",").map(Qi);
|
|
892
895
|
return typeof r == "function" ? r(o) : o[r];
|
|
893
896
|
}
|
|
894
|
-
const
|
|
897
|
+
const Ji = (t, e) => {
|
|
895
898
|
const { transform: n = "none" } = getComputedStyle(t);
|
|
896
|
-
return
|
|
899
|
+
return ne(n, e);
|
|
897
900
|
};
|
|
898
|
-
function
|
|
901
|
+
function Qi(t) {
|
|
899
902
|
return parseFloat(t.trim());
|
|
900
903
|
}
|
|
901
|
-
const
|
|
904
|
+
const ot = [
|
|
902
905
|
"transformPerspective",
|
|
903
906
|
"x",
|
|
904
907
|
"y",
|
|
@@ -916,10 +919,10 @@ const st = [
|
|
|
916
919
|
"skew",
|
|
917
920
|
"skewX",
|
|
918
921
|
"skewY"
|
|
919
|
-
],
|
|
920
|
-
function
|
|
922
|
+
], at = new Set(ot), Ye = (t) => t === it || t === g, tr = /* @__PURE__ */ new Set(["x", "y", "z"]), er = ot.filter((t) => !tr.has(t));
|
|
923
|
+
function nr(t) {
|
|
921
924
|
const e = [];
|
|
922
|
-
return
|
|
925
|
+
return er.forEach((n) => {
|
|
923
926
|
const s = t.getValue(n);
|
|
924
927
|
s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
925
928
|
}), e;
|
|
@@ -933,18 +936,18 @@ const U = {
|
|
|
933
936
|
bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
|
|
934
937
|
right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
|
|
935
938
|
// Transform
|
|
936
|
-
x: (t, { transform: e }) =>
|
|
937
|
-
y: (t, { transform: e }) =>
|
|
939
|
+
x: (t, { transform: e }) => ne(e, "x"),
|
|
940
|
+
y: (t, { transform: e }) => ne(e, "y")
|
|
938
941
|
};
|
|
939
942
|
U.translateX = U.x;
|
|
940
943
|
U.translateY = U.y;
|
|
941
|
-
const
|
|
942
|
-
let
|
|
943
|
-
function
|
|
944
|
-
if (
|
|
945
|
-
const t = Array.from(
|
|
944
|
+
const z = /* @__PURE__ */ new Set();
|
|
945
|
+
let se = !1, ie = !1, re = !1;
|
|
946
|
+
function Un() {
|
|
947
|
+
if (ie) {
|
|
948
|
+
const t = Array.from(z).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
946
949
|
e.forEach((s) => {
|
|
947
|
-
const i =
|
|
950
|
+
const i = nr(s);
|
|
948
951
|
i.length && (n.set(s, i), s.render());
|
|
949
952
|
}), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
|
|
950
953
|
s.render();
|
|
@@ -957,22 +960,22 @@ function Gn() {
|
|
|
957
960
|
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
|
|
958
961
|
});
|
|
959
962
|
}
|
|
960
|
-
|
|
963
|
+
ie = !1, se = !1, z.forEach((t) => t.complete(re)), z.clear();
|
|
961
964
|
}
|
|
962
|
-
function
|
|
963
|
-
|
|
964
|
-
t.readKeyframes(), t.needsMeasurement && (
|
|
965
|
+
function zn() {
|
|
966
|
+
z.forEach((t) => {
|
|
967
|
+
t.readKeyframes(), t.needsMeasurement && (ie = !0);
|
|
965
968
|
});
|
|
966
969
|
}
|
|
967
|
-
function
|
|
968
|
-
|
|
970
|
+
function sr() {
|
|
971
|
+
re = !0, zn(), Un(), re = !1;
|
|
969
972
|
}
|
|
970
|
-
class
|
|
973
|
+
class xe {
|
|
971
974
|
constructor(e, n, s, i, r, o = !1) {
|
|
972
975
|
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = o;
|
|
973
976
|
}
|
|
974
977
|
scheduleResolve() {
|
|
975
|
-
this.state = "scheduled", this.isAsync ? (
|
|
978
|
+
this.state = "scheduled", this.isAsync ? (z.add(this), se || (se = !0, N.read(zn), N.resolveKeyframes(Un))) : (this.readKeyframes(), this.complete());
|
|
976
979
|
}
|
|
977
980
|
readKeyframes() {
|
|
978
981
|
const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
|
|
@@ -986,7 +989,7 @@ class Se {
|
|
|
986
989
|
}
|
|
987
990
|
e[0] === void 0 && (e[0] = o), i && r === void 0 && i.set(e[0]);
|
|
988
991
|
}
|
|
989
|
-
|
|
992
|
+
Xi(e);
|
|
990
993
|
}
|
|
991
994
|
setFinalKeyframe() {
|
|
992
995
|
}
|
|
@@ -997,80 +1000,80 @@ class Se {
|
|
|
997
1000
|
measureEndState() {
|
|
998
1001
|
}
|
|
999
1002
|
complete(e = !1) {
|
|
1000
|
-
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e),
|
|
1003
|
+
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e), z.delete(this);
|
|
1001
1004
|
}
|
|
1002
1005
|
cancel() {
|
|
1003
|
-
this.state === "scheduled" && (
|
|
1006
|
+
this.state === "scheduled" && (z.delete(this), this.state = "pending");
|
|
1004
1007
|
}
|
|
1005
1008
|
resume() {
|
|
1006
1009
|
this.state === "pending" && this.scheduleResolve();
|
|
1007
1010
|
}
|
|
1008
1011
|
}
|
|
1009
|
-
const
|
|
1010
|
-
function
|
|
1011
|
-
|
|
1012
|
+
const ir = (t) => t.startsWith("--");
|
|
1013
|
+
function rr(t, e, n) {
|
|
1014
|
+
ir(e) ? t.style.setProperty(e, n) : t.style[e] = n;
|
|
1012
1015
|
}
|
|
1013
|
-
const
|
|
1014
|
-
function
|
|
1015
|
-
const n = /* @__PURE__ */
|
|
1016
|
-
return () =>
|
|
1016
|
+
const or = /* @__PURE__ */ pe(() => window.ScrollTimeline !== void 0), ar = {};
|
|
1017
|
+
function ur(t, e) {
|
|
1018
|
+
const n = /* @__PURE__ */ pe(t);
|
|
1019
|
+
return () => ar[e] ?? n();
|
|
1017
1020
|
}
|
|
1018
|
-
const
|
|
1021
|
+
const Yn = /* @__PURE__ */ ur(() => {
|
|
1019
1022
|
try {
|
|
1020
1023
|
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
1021
1024
|
} catch {
|
|
1022
1025
|
return !1;
|
|
1023
1026
|
}
|
|
1024
1027
|
return !0;
|
|
1025
|
-
}, "linearEasing"),
|
|
1028
|
+
}, "linearEasing"), lt = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, Xe = {
|
|
1026
1029
|
linear: "linear",
|
|
1027
1030
|
ease: "ease",
|
|
1028
1031
|
easeIn: "ease-in",
|
|
1029
1032
|
easeOut: "ease-out",
|
|
1030
1033
|
easeInOut: "ease-in-out",
|
|
1031
|
-
circIn: /* @__PURE__ */
|
|
1032
|
-
circOut: /* @__PURE__ */
|
|
1033
|
-
backIn: /* @__PURE__ */
|
|
1034
|
-
backOut: /* @__PURE__ */
|
|
1034
|
+
circIn: /* @__PURE__ */ lt([0, 0.65, 0.55, 1]),
|
|
1035
|
+
circOut: /* @__PURE__ */ lt([0.55, 0, 1, 0.45]),
|
|
1036
|
+
backIn: /* @__PURE__ */ lt([0.31, 0.01, 0.66, -0.59]),
|
|
1037
|
+
backOut: /* @__PURE__ */ lt([0.33, 1.53, 0.69, 0.99])
|
|
1035
1038
|
};
|
|
1036
|
-
function
|
|
1039
|
+
function Xn(t, e) {
|
|
1037
1040
|
if (t)
|
|
1038
|
-
return typeof t == "function" ?
|
|
1041
|
+
return typeof t == "function" ? Yn() ? Gn(t, e) : "ease-out" : In(t) ? lt(t) : Array.isArray(t) ? t.map((n) => Xn(n, e) || Xe.easeOut) : Xe[t];
|
|
1039
1042
|
}
|
|
1040
|
-
function
|
|
1043
|
+
function cr(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a = "easeOut", times: c } = {}, l = void 0) {
|
|
1041
1044
|
const u = {
|
|
1042
1045
|
[e]: n
|
|
1043
1046
|
};
|
|
1044
1047
|
c && (u.offset = c);
|
|
1045
|
-
const
|
|
1046
|
-
Array.isArray(
|
|
1047
|
-
const
|
|
1048
|
+
const f = Xn(a, i);
|
|
1049
|
+
Array.isArray(f) && (u.easing = f);
|
|
1050
|
+
const d = {
|
|
1048
1051
|
delay: s,
|
|
1049
1052
|
duration: i,
|
|
1050
|
-
easing: Array.isArray(
|
|
1053
|
+
easing: Array.isArray(f) ? "linear" : f,
|
|
1051
1054
|
fill: "both",
|
|
1052
1055
|
iterations: r + 1,
|
|
1053
1056
|
direction: o === "reverse" ? "alternate" : "normal"
|
|
1054
1057
|
};
|
|
1055
|
-
return l && (
|
|
1058
|
+
return l && (d.pseudoElement = l), t.animate(u, d);
|
|
1056
1059
|
}
|
|
1057
|
-
function
|
|
1060
|
+
function qn(t) {
|
|
1058
1061
|
return typeof t == "function" && "applyToOptions" in t;
|
|
1059
1062
|
}
|
|
1060
|
-
function
|
|
1061
|
-
return
|
|
1063
|
+
function lr({ type: t, ...e }) {
|
|
1064
|
+
return qn(t) && Yn() ? t.applyToOptions(e) : (e.duration ?? (e.duration = 300), e.ease ?? (e.ease = "easeOut"), e);
|
|
1062
1065
|
}
|
|
1063
|
-
class
|
|
1066
|
+
class fr extends Ve {
|
|
1064
1067
|
constructor(e) {
|
|
1065
1068
|
if (super(), this.finishedTime = null, this.isStopped = !1, !e)
|
|
1066
1069
|
return;
|
|
1067
1070
|
const { element: n, name: s, keyframes: i, pseudoElement: r, allowFlatten: o = !1, finalKeyframe: a, onComplete: c } = e;
|
|
1068
|
-
this.isPseudoElement = !!r, this.allowFlatten = o, this.options = e,
|
|
1069
|
-
const l =
|
|
1070
|
-
this.animation =
|
|
1071
|
+
this.isPseudoElement = !!r, this.allowFlatten = o, this.options = e, X(typeof e.type != "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring");
|
|
1072
|
+
const l = lr(e);
|
|
1073
|
+
this.animation = cr(n, s, i, l, r), l.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
|
|
1071
1074
|
if (this.finishedTime = this.time, !r) {
|
|
1072
|
-
const u =
|
|
1073
|
-
this.updateMotionValue ? this.updateMotionValue(u) :
|
|
1075
|
+
const u = Se(i, this.options, a, this.speed);
|
|
1076
|
+
this.updateMotionValue ? this.updateMotionValue(u) : rr(n, s, u), this.animation.cancel();
|
|
1074
1077
|
}
|
|
1075
1078
|
c == null || c(), this.notifyFinished();
|
|
1076
1079
|
};
|
|
@@ -1149,24 +1152,24 @@ class ur extends ve {
|
|
|
1149
1152
|
*/
|
|
1150
1153
|
attachTimeline({ timeline: e, observe: n }) {
|
|
1151
1154
|
var s;
|
|
1152
|
-
return this.allowFlatten && ((s = this.animation.effect) == null || s.updateTiming({ easing: "linear" })), this.animation.onfinish = null, e &&
|
|
1155
|
+
return this.allowFlatten && ((s = this.animation.effect) == null || s.updateTiming({ easing: "linear" })), this.animation.onfinish = null, e && or() ? (this.animation.timeline = e, st) : n(this);
|
|
1153
1156
|
}
|
|
1154
1157
|
}
|
|
1155
|
-
const
|
|
1156
|
-
anticipate:
|
|
1157
|
-
backInOut:
|
|
1158
|
-
circInOut:
|
|
1158
|
+
const Zn = {
|
|
1159
|
+
anticipate: Fn,
|
|
1160
|
+
backInOut: Pn,
|
|
1161
|
+
circInOut: On
|
|
1159
1162
|
};
|
|
1160
|
-
function
|
|
1161
|
-
return t in
|
|
1163
|
+
function dr(t) {
|
|
1164
|
+
return t in Zn;
|
|
1162
1165
|
}
|
|
1163
|
-
function
|
|
1164
|
-
typeof t.ease == "string" &&
|
|
1166
|
+
function hr(t) {
|
|
1167
|
+
typeof t.ease == "string" && dr(t.ease) && (t.ease = Zn[t.ease]);
|
|
1165
1168
|
}
|
|
1166
|
-
const
|
|
1167
|
-
class
|
|
1169
|
+
const qe = 10;
|
|
1170
|
+
class pr extends fr {
|
|
1168
1171
|
constructor(e) {
|
|
1169
|
-
|
|
1172
|
+
hr(e), Hn(e), super(e), e.startTime && (this.startTime = e.startTime), this.options = e;
|
|
1170
1173
|
}
|
|
1171
1174
|
/**
|
|
1172
1175
|
* WAAPI doesn't natively have any interruption capabilities.
|
|
@@ -1184,17 +1187,17 @@ class fr extends ur {
|
|
|
1184
1187
|
n.set(e);
|
|
1185
1188
|
return;
|
|
1186
1189
|
}
|
|
1187
|
-
const a = new
|
|
1190
|
+
const a = new Ae({
|
|
1188
1191
|
...o,
|
|
1189
1192
|
autoplay: !1
|
|
1190
1193
|
}), c = /* @__PURE__ */ L(this.finishedTime ?? this.time);
|
|
1191
|
-
n.setWithVelocity(a.sample(c -
|
|
1194
|
+
n.setWithVelocity(a.sample(c - qe).value, a.sample(c).value, qe), a.stop();
|
|
1192
1195
|
}
|
|
1193
1196
|
}
|
|
1194
|
-
const
|
|
1195
|
-
(
|
|
1197
|
+
const Ze = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
|
|
1198
|
+
(rt.test(t) || t === "0") && // And it contains numbers and/or colors
|
|
1196
1199
|
!t.startsWith("url("));
|
|
1197
|
-
function
|
|
1200
|
+
function mr(t) {
|
|
1198
1201
|
const e = t[0];
|
|
1199
1202
|
if (t.length === 1)
|
|
1200
1203
|
return !0;
|
|
@@ -1202,47 +1205,47 @@ function dr(t) {
|
|
|
1202
1205
|
if (t[n] !== e)
|
|
1203
1206
|
return !0;
|
|
1204
1207
|
}
|
|
1205
|
-
function
|
|
1208
|
+
function gr(t, e, n, s) {
|
|
1206
1209
|
const i = t[0];
|
|
1207
1210
|
if (i === null)
|
|
1208
1211
|
return !1;
|
|
1209
1212
|
if (e === "display" || e === "visibility")
|
|
1210
1213
|
return !0;
|
|
1211
|
-
const r = t[t.length - 1], o =
|
|
1212
|
-
return
|
|
1214
|
+
const r = t[t.length - 1], o = Ze(i, e), a = Ze(r, e);
|
|
1215
|
+
return yt(o === a, `You are trying to animate ${e} from "${i}" to "${r}". "${o ? r : i}" is not an animatable value.`, "value-not-animatable"), !o || !a ? !1 : mr(t) || (n === "spring" || qn(n)) && s;
|
|
1213
1216
|
}
|
|
1214
|
-
function
|
|
1215
|
-
|
|
1217
|
+
function oe(t) {
|
|
1218
|
+
t.duration = 0, t.type;
|
|
1216
1219
|
}
|
|
1217
|
-
const
|
|
1220
|
+
const yr = /* @__PURE__ */ new Set([
|
|
1218
1221
|
"opacity",
|
|
1219
1222
|
"clipPath",
|
|
1220
1223
|
"filter",
|
|
1221
1224
|
"transform"
|
|
1222
1225
|
// TODO: Could be re-enabled now we have support for linear() easing
|
|
1223
1226
|
// "background-color"
|
|
1224
|
-
]),
|
|
1225
|
-
function
|
|
1226
|
-
var
|
|
1227
|
+
]), br = /* @__PURE__ */ pe(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
1228
|
+
function Tr(t) {
|
|
1229
|
+
var u;
|
|
1227
1230
|
const { motionValue: e, name: n, repeatDelay: s, repeatType: i, damping: r, type: o } = t;
|
|
1228
|
-
if (!
|
|
1231
|
+
if (!(((u = e == null ? void 0 : e.owner) == null ? void 0 : u.current) instanceof HTMLElement))
|
|
1229
1232
|
return !1;
|
|
1230
|
-
const { onUpdate:
|
|
1231
|
-
return
|
|
1233
|
+
const { onUpdate: c, transformTemplate: l } = e.owner.getProps();
|
|
1234
|
+
return br() && n && yr.has(n) && (n !== "transform" || !l) && /**
|
|
1232
1235
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
1233
1236
|
* no way to read the value from WAAPI every frame.
|
|
1234
1237
|
*/
|
|
1235
|
-
!
|
|
1238
|
+
!c && !s && i !== "mirror" && r !== 0 && o !== "inertia";
|
|
1236
1239
|
}
|
|
1237
|
-
const
|
|
1238
|
-
class
|
|
1239
|
-
constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", keyframes: a, name: c, motionValue: l, element: u, ...
|
|
1240
|
+
const vr = 40;
|
|
1241
|
+
class wr extends Ve {
|
|
1242
|
+
constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", keyframes: a, name: c, motionValue: l, element: u, ...f }) {
|
|
1240
1243
|
var y;
|
|
1241
1244
|
super(), this.stop = () => {
|
|
1242
1245
|
var b, v;
|
|
1243
1246
|
this._animation && (this._animation.stop(), (b = this.stopTimeline) == null || b.call(this)), (v = this.keyframeResolver) == null || v.cancel();
|
|
1244
1247
|
}, this.createdAt = E.now();
|
|
1245
|
-
const
|
|
1248
|
+
const d = {
|
|
1246
1249
|
autoplay: e,
|
|
1247
1250
|
delay: n,
|
|
1248
1251
|
type: s,
|
|
@@ -1252,24 +1255,24 @@ class br extends ve {
|
|
|
1252
1255
|
name: c,
|
|
1253
1256
|
motionValue: l,
|
|
1254
1257
|
element: u,
|
|
1255
|
-
...
|
|
1256
|
-
}, h = (u == null ? void 0 : u.KeyframeResolver) ||
|
|
1257
|
-
this.keyframeResolver = new h(a, (b, v, p) => this.onKeyframesResolved(b, v,
|
|
1258
|
+
...f
|
|
1259
|
+
}, h = (u == null ? void 0 : u.KeyframeResolver) || xe;
|
|
1260
|
+
this.keyframeResolver = new h(a, (b, v, p) => this.onKeyframesResolved(b, v, d, !p), c, l, u), (y = this.keyframeResolver) == null || y.scheduleResolve();
|
|
1258
1261
|
}
|
|
1259
1262
|
onKeyframesResolved(e, n, s, i) {
|
|
1260
1263
|
this.keyframeResolver = void 0;
|
|
1261
1264
|
const { name: r, type: o, velocity: a, delay: c, isHandoff: l, onUpdate: u } = s;
|
|
1262
|
-
this.resolvedAt = E.now(),
|
|
1263
|
-
const
|
|
1264
|
-
startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt >
|
|
1265
|
+
this.resolvedAt = E.now(), gr(e, r, o, a) || ((W.instantAnimations || !c) && (u == null || u(Se(e, s, n))), e[0] = e[e.length - 1], oe(s), s.repeat = 0);
|
|
1266
|
+
const d = {
|
|
1267
|
+
startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt > vr ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
|
|
1265
1268
|
finalKeyframe: n,
|
|
1266
1269
|
...s,
|
|
1267
1270
|
keyframes: e
|
|
1268
|
-
}, h = !l &&
|
|
1269
|
-
...
|
|
1270
|
-
element:
|
|
1271
|
-
}) : new
|
|
1272
|
-
h.finished.then(() => this.notifyFinished()).catch(
|
|
1271
|
+
}, h = !l && Tr(d) ? new pr({
|
|
1272
|
+
...d,
|
|
1273
|
+
element: d.motionValue.owner.current
|
|
1274
|
+
}) : new Ae(d);
|
|
1275
|
+
h.finished.then(() => this.notifyFinished()).catch(st), this.pendingTimeline && (this.stopTimeline = h.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = h;
|
|
1273
1276
|
}
|
|
1274
1277
|
get finished() {
|
|
1275
1278
|
return this._animation ? this.animation.finished : this._finished;
|
|
@@ -1280,7 +1283,7 @@ class br extends ve {
|
|
|
1280
1283
|
}
|
|
1281
1284
|
get animation() {
|
|
1282
1285
|
var e;
|
|
1283
|
-
return this._animation || ((e = this.keyframeResolver) == null || e.resume(),
|
|
1286
|
+
return this._animation || ((e = this.keyframeResolver) == null || e.resume(), sr()), this._animation;
|
|
1284
1287
|
}
|
|
1285
1288
|
get duration() {
|
|
1286
1289
|
return this.animation.duration;
|
|
@@ -1320,81 +1323,81 @@ class br extends ve {
|
|
|
1320
1323
|
this._animation && this.animation.cancel(), (e = this.keyframeResolver) == null || e.cancel();
|
|
1321
1324
|
}
|
|
1322
1325
|
}
|
|
1323
|
-
const
|
|
1326
|
+
const Sr = (
|
|
1324
1327
|
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
1325
1328
|
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
1326
1329
|
);
|
|
1327
|
-
function
|
|
1328
|
-
const e =
|
|
1330
|
+
function Vr(t) {
|
|
1331
|
+
const e = Sr.exec(t);
|
|
1329
1332
|
if (!e)
|
|
1330
1333
|
return [,];
|
|
1331
1334
|
const [, n, s, i] = e;
|
|
1332
1335
|
return [`--${n ?? s}`, i];
|
|
1333
1336
|
}
|
|
1334
|
-
const
|
|
1335
|
-
function
|
|
1336
|
-
|
|
1337
|
-
const [s, i] =
|
|
1337
|
+
const Ar = 4;
|
|
1338
|
+
function Jn(t, e, n = 1) {
|
|
1339
|
+
X(n <= Ar, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
|
|
1340
|
+
const [s, i] = Vr(t);
|
|
1338
1341
|
if (!s)
|
|
1339
1342
|
return;
|
|
1340
1343
|
const r = window.getComputedStyle(e).getPropertyValue(s);
|
|
1341
1344
|
if (r) {
|
|
1342
1345
|
const o = r.trim();
|
|
1343
|
-
return
|
|
1346
|
+
return bn(o) ? parseFloat(o) : o;
|
|
1344
1347
|
}
|
|
1345
|
-
return
|
|
1348
|
+
return ye(i) ? Jn(i, e, n + 1) : i;
|
|
1346
1349
|
}
|
|
1347
|
-
function
|
|
1350
|
+
function Qn(t, e) {
|
|
1348
1351
|
return (t == null ? void 0 : t[e]) ?? (t == null ? void 0 : t.default) ?? t;
|
|
1349
1352
|
}
|
|
1350
|
-
const
|
|
1353
|
+
const ts = /* @__PURE__ */ new Set([
|
|
1351
1354
|
"width",
|
|
1352
1355
|
"height",
|
|
1353
1356
|
"top",
|
|
1354
1357
|
"left",
|
|
1355
1358
|
"right",
|
|
1356
1359
|
"bottom",
|
|
1357
|
-
...
|
|
1358
|
-
]),
|
|
1360
|
+
...ot
|
|
1361
|
+
]), xr = {
|
|
1359
1362
|
test: (t) => t === "auto",
|
|
1360
1363
|
parse: (t) => t
|
|
1361
|
-
},
|
|
1362
|
-
function
|
|
1363
|
-
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" ||
|
|
1364
|
+
}, es = (t) => (e) => e.test(t), ns = [it, g, Q, j, mi, pi, xr], Je = (t) => ns.find(es(t));
|
|
1365
|
+
function Mr(t) {
|
|
1366
|
+
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Tn(t) : !0;
|
|
1364
1367
|
}
|
|
1365
|
-
const
|
|
1366
|
-
function
|
|
1368
|
+
const Cr = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
1369
|
+
function Pr(t) {
|
|
1367
1370
|
const [e, n] = t.slice(0, -1).split("(");
|
|
1368
1371
|
if (e === "drop-shadow")
|
|
1369
1372
|
return t;
|
|
1370
|
-
const [s] = n.match(
|
|
1373
|
+
const [s] = n.match(be) || [];
|
|
1371
1374
|
if (!s)
|
|
1372
1375
|
return t;
|
|
1373
1376
|
const i = n.replace(s, "");
|
|
1374
|
-
let r =
|
|
1377
|
+
let r = Cr.has(e) ? 1 : 0;
|
|
1375
1378
|
return s !== n && (r *= 100), e + "(" + r + i + ")";
|
|
1376
1379
|
}
|
|
1377
|
-
const
|
|
1378
|
-
...
|
|
1380
|
+
const Fr = /\b([a-z-]*)\(.*?\)/gu, ae = {
|
|
1381
|
+
...rt,
|
|
1379
1382
|
getAnimatableNone: (t) => {
|
|
1380
|
-
const e = t.match(
|
|
1381
|
-
return e ? e.map(
|
|
1383
|
+
const e = t.match(Fr);
|
|
1384
|
+
return e ? e.map(Pr).join(" ") : t;
|
|
1382
1385
|
}
|
|
1383
|
-
},
|
|
1384
|
-
...
|
|
1386
|
+
}, Qe = {
|
|
1387
|
+
...it,
|
|
1385
1388
|
transform: Math.round
|
|
1386
|
-
},
|
|
1387
|
-
rotate:
|
|
1388
|
-
rotateX:
|
|
1389
|
-
rotateY:
|
|
1390
|
-
rotateZ:
|
|
1391
|
-
scale:
|
|
1392
|
-
scaleX:
|
|
1393
|
-
scaleY:
|
|
1394
|
-
scaleZ:
|
|
1395
|
-
skew:
|
|
1396
|
-
skewX:
|
|
1397
|
-
skewY:
|
|
1389
|
+
}, Or = {
|
|
1390
|
+
rotate: j,
|
|
1391
|
+
rotateX: j,
|
|
1392
|
+
rotateY: j,
|
|
1393
|
+
rotateZ: j,
|
|
1394
|
+
scale: xt,
|
|
1395
|
+
scaleX: xt,
|
|
1396
|
+
scaleY: xt,
|
|
1397
|
+
scaleZ: xt,
|
|
1398
|
+
skew: j,
|
|
1399
|
+
skewX: j,
|
|
1400
|
+
skewY: j,
|
|
1398
1401
|
distance: g,
|
|
1399
1402
|
translateX: g,
|
|
1400
1403
|
translateY: g,
|
|
@@ -1404,11 +1407,11 @@ const Mr = /\b([a-z-]*)\(.*?\)/gu, ie = {
|
|
|
1404
1407
|
z: g,
|
|
1405
1408
|
perspective: g,
|
|
1406
1409
|
transformPerspective: g,
|
|
1407
|
-
opacity:
|
|
1408
|
-
originX:
|
|
1409
|
-
originY:
|
|
1410
|
+
opacity: pt,
|
|
1411
|
+
originX: We,
|
|
1412
|
+
originY: We,
|
|
1410
1413
|
originZ: g
|
|
1411
|
-
},
|
|
1414
|
+
}, Me = {
|
|
1412
1415
|
// Border props
|
|
1413
1416
|
borderWidth: g,
|
|
1414
1417
|
borderTopWidth: g,
|
|
@@ -1444,14 +1447,14 @@ const Mr = /\b([a-z-]*)\(.*?\)/gu, ie = {
|
|
|
1444
1447
|
// Misc
|
|
1445
1448
|
backgroundPositionX: g,
|
|
1446
1449
|
backgroundPositionY: g,
|
|
1447
|
-
...
|
|
1448
|
-
zIndex:
|
|
1450
|
+
...Or,
|
|
1451
|
+
zIndex: Qe,
|
|
1449
1452
|
// SVG
|
|
1450
|
-
fillOpacity:
|
|
1451
|
-
strokeOpacity:
|
|
1452
|
-
numOctaves:
|
|
1453
|
-
},
|
|
1454
|
-
...
|
|
1453
|
+
fillOpacity: pt,
|
|
1454
|
+
strokeOpacity: pt,
|
|
1455
|
+
numOctaves: Qe
|
|
1456
|
+
}, Dr = {
|
|
1457
|
+
...Me,
|
|
1455
1458
|
// Color props
|
|
1456
1459
|
color: C,
|
|
1457
1460
|
backgroundColor: C,
|
|
@@ -1464,25 +1467,25 @@ const Mr = /\b([a-z-]*)\(.*?\)/gu, ie = {
|
|
|
1464
1467
|
borderRightColor: C,
|
|
1465
1468
|
borderBottomColor: C,
|
|
1466
1469
|
borderLeftColor: C,
|
|
1467
|
-
filter:
|
|
1468
|
-
WebkitFilter:
|
|
1469
|
-
},
|
|
1470
|
-
function
|
|
1471
|
-
let n =
|
|
1472
|
-
return n !==
|
|
1473
|
-
}
|
|
1474
|
-
const
|
|
1475
|
-
function
|
|
1470
|
+
filter: ae,
|
|
1471
|
+
WebkitFilter: ae
|
|
1472
|
+
}, ss = (t) => Dr[t];
|
|
1473
|
+
function is(t, e) {
|
|
1474
|
+
let n = ss(t);
|
|
1475
|
+
return n !== ae && (n = rt), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
1476
|
+
}
|
|
1477
|
+
const Ir = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
1478
|
+
function Rr(t, e, n) {
|
|
1476
1479
|
let s = 0, i;
|
|
1477
1480
|
for (; s < t.length && !i; ) {
|
|
1478
1481
|
const r = t[s];
|
|
1479
|
-
typeof r == "string" && !
|
|
1482
|
+
typeof r == "string" && !Ir.has(r) && mt(r).values.length && (i = t[s]), s++;
|
|
1480
1483
|
}
|
|
1481
1484
|
if (i && n)
|
|
1482
1485
|
for (const r of e)
|
|
1483
|
-
t[r] =
|
|
1486
|
+
t[r] = is(n, i);
|
|
1484
1487
|
}
|
|
1485
|
-
class
|
|
1488
|
+
class Er extends xe {
|
|
1486
1489
|
constructor(e, n, s, i, r) {
|
|
1487
1490
|
super(e, n, s, i, r, !0);
|
|
1488
1491
|
}
|
|
@@ -1493,16 +1496,16 @@ class Dr extends Se {
|
|
|
1493
1496
|
super.readKeyframes();
|
|
1494
1497
|
for (let c = 0; c < e.length; c++) {
|
|
1495
1498
|
let l = e[c];
|
|
1496
|
-
if (typeof l == "string" && (l = l.trim(),
|
|
1497
|
-
const u =
|
|
1499
|
+
if (typeof l == "string" && (l = l.trim(), ye(l))) {
|
|
1500
|
+
const u = Jn(l, n.current);
|
|
1498
1501
|
u !== void 0 && (e[c] = u), c === e.length - 1 && (this.finalKeyframe = l);
|
|
1499
1502
|
}
|
|
1500
1503
|
}
|
|
1501
|
-
if (this.resolveNoneKeyframes(), !
|
|
1504
|
+
if (this.resolveNoneKeyframes(), !ts.has(s) || e.length !== 2)
|
|
1502
1505
|
return;
|
|
1503
|
-
const [i, r] = e, o =
|
|
1506
|
+
const [i, r] = e, o = Je(i), a = Je(r);
|
|
1504
1507
|
if (o !== a)
|
|
1505
|
-
if (
|
|
1508
|
+
if (Ye(o) && Ye(a))
|
|
1506
1509
|
for (let c = 0; c < e.length; c++) {
|
|
1507
1510
|
const l = e[c];
|
|
1508
1511
|
typeof l == "string" && (e[c] = parseFloat(l));
|
|
@@ -1512,8 +1515,8 @@ class Dr extends Se {
|
|
|
1512
1515
|
resolveNoneKeyframes() {
|
|
1513
1516
|
const { unresolvedKeyframes: e, name: n } = this, s = [];
|
|
1514
1517
|
for (let i = 0; i < e.length; i++)
|
|
1515
|
-
(e[i] === null ||
|
|
1516
|
-
s.length &&
|
|
1518
|
+
(e[i] === null || Mr(e[i])) && s.push(i);
|
|
1519
|
+
s.length && Rr(e, s, n);
|
|
1517
1520
|
}
|
|
1518
1521
|
measureInitialState() {
|
|
1519
1522
|
const { element: e, unresolvedKeyframes: n, name: s } = this;
|
|
@@ -1536,7 +1539,7 @@ class Dr extends Se {
|
|
|
1536
1539
|
}), this.resolveNoneKeyframes();
|
|
1537
1540
|
}
|
|
1538
1541
|
}
|
|
1539
|
-
function
|
|
1542
|
+
function kr(t, e, n) {
|
|
1540
1543
|
if (t instanceof EventTarget)
|
|
1541
1544
|
return [t];
|
|
1542
1545
|
if (typeof t == "string") {
|
|
@@ -1546,8 +1549,12 @@ function Ir(t, e, n) {
|
|
|
1546
1549
|
}
|
|
1547
1550
|
return Array.from(t);
|
|
1548
1551
|
}
|
|
1549
|
-
const
|
|
1550
|
-
|
|
1552
|
+
const rs = (t, e) => e && typeof t == "number" ? e.transform(t) : t;
|
|
1553
|
+
function Nr(t) {
|
|
1554
|
+
return Xs(t) && "offsetHeight" in t;
|
|
1555
|
+
}
|
|
1556
|
+
const tn = 30, Lr = (t) => !isNaN(parseFloat(t));
|
|
1557
|
+
class Br {
|
|
1551
1558
|
/**
|
|
1552
1559
|
* @param init - The initiating value
|
|
1553
1560
|
* @param config - Optional configuration options
|
|
@@ -1555,17 +1562,16 @@ class Er {
|
|
|
1555
1562
|
* - `transformer`: A function to transform incoming values with.
|
|
1556
1563
|
*/
|
|
1557
1564
|
constructor(e, n = {}) {
|
|
1558
|
-
this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s
|
|
1559
|
-
var
|
|
1560
|
-
const
|
|
1561
|
-
if (this.updatedAt !==
|
|
1562
|
-
for (const
|
|
1563
|
-
|
|
1564
|
-
i && ((a = this.events.renderRequest) == null || a.notify(this.current));
|
|
1565
|
+
this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s) => {
|
|
1566
|
+
var r;
|
|
1567
|
+
const i = E.now();
|
|
1568
|
+
if (this.updatedAt !== i && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && ((r = this.events.change) == null || r.notify(this.current), this.dependents))
|
|
1569
|
+
for (const o of this.dependents)
|
|
1570
|
+
o.dirty();
|
|
1565
1571
|
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
|
|
1566
1572
|
}
|
|
1567
1573
|
setCurrent(e) {
|
|
1568
|
-
this.current = e, this.updatedAt = E.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity =
|
|
1574
|
+
this.current = e, this.updatedAt = E.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = Lr(this.current));
|
|
1569
1575
|
}
|
|
1570
1576
|
setPrevFrameValue(e = this.current) {
|
|
1571
1577
|
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -1611,10 +1617,10 @@ class Er {
|
|
|
1611
1617
|
* @deprecated
|
|
1612
1618
|
*/
|
|
1613
1619
|
onChange(e) {
|
|
1614
|
-
return process.env.NODE_ENV !== "production" &&
|
|
1620
|
+
return process.env.NODE_ENV !== "production" && Vn(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
|
|
1615
1621
|
}
|
|
1616
1622
|
on(e, n) {
|
|
1617
|
-
this.events[e] || (this.events[e] = new
|
|
1623
|
+
this.events[e] || (this.events[e] = new wn());
|
|
1618
1624
|
const s = this.events[e].add(n);
|
|
1619
1625
|
return e === "change" ? () => {
|
|
1620
1626
|
s(), N.read(() => {
|
|
@@ -1647,8 +1653,8 @@ class Er {
|
|
|
1647
1653
|
*
|
|
1648
1654
|
* @public
|
|
1649
1655
|
*/
|
|
1650
|
-
set(e
|
|
1651
|
-
|
|
1656
|
+
set(e) {
|
|
1657
|
+
this.passiveEffect ? this.passiveEffect(e, this.updateAndNotify) : this.updateAndNotify(e);
|
|
1652
1658
|
}
|
|
1653
1659
|
setWithVelocity(e, n, s) {
|
|
1654
1660
|
this.set(n), this.prev = void 0, this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt - s;
|
|
@@ -1695,10 +1701,10 @@ class Er {
|
|
|
1695
1701
|
*/
|
|
1696
1702
|
getVelocity() {
|
|
1697
1703
|
const e = E.now();
|
|
1698
|
-
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt >
|
|
1704
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > tn)
|
|
1699
1705
|
return 0;
|
|
1700
|
-
const n = Math.min(this.updatedAt - this.prevUpdatedAt,
|
|
1701
|
-
return
|
|
1706
|
+
const n = Math.min(this.updatedAt - this.prevUpdatedAt, tn);
|
|
1707
|
+
return Sn(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1702
1708
|
}
|
|
1703
1709
|
/**
|
|
1704
1710
|
* Registers a new animation to control this `MotionValue`. Only one
|
|
@@ -1750,35 +1756,35 @@ class Er {
|
|
|
1750
1756
|
(e = this.dependents) == null || e.clear(), (n = this.events.destroy) == null || n.notify(), this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1751
1757
|
}
|
|
1752
1758
|
}
|
|
1753
|
-
function
|
|
1754
|
-
return new
|
|
1759
|
+
function It(t, e) {
|
|
1760
|
+
return new Br(t, e);
|
|
1755
1761
|
}
|
|
1756
|
-
const { schedule:
|
|
1762
|
+
const { schedule: Kr } = /* @__PURE__ */ Rn(queueMicrotask, !1), Wr = {
|
|
1757
1763
|
y: !1
|
|
1758
1764
|
};
|
|
1759
|
-
function
|
|
1760
|
-
return
|
|
1765
|
+
function $r() {
|
|
1766
|
+
return Wr.y;
|
|
1761
1767
|
}
|
|
1762
|
-
function
|
|
1763
|
-
const n =
|
|
1768
|
+
function os(t, e) {
|
|
1769
|
+
const n = kr(t), s = new AbortController(), i = {
|
|
1764
1770
|
passive: !0,
|
|
1765
1771
|
...e,
|
|
1766
1772
|
signal: s.signal
|
|
1767
1773
|
};
|
|
1768
1774
|
return [n, i, () => s.abort()];
|
|
1769
1775
|
}
|
|
1770
|
-
function
|
|
1771
|
-
return !(t.pointerType === "touch" ||
|
|
1776
|
+
function en(t) {
|
|
1777
|
+
return !(t.pointerType === "touch" || $r());
|
|
1772
1778
|
}
|
|
1773
|
-
function
|
|
1774
|
-
const [s, i, r] =
|
|
1775
|
-
if (!
|
|
1779
|
+
function jr(t, e, n = {}) {
|
|
1780
|
+
const [s, i, r] = os(t, n), o = (a) => {
|
|
1781
|
+
if (!en(a))
|
|
1776
1782
|
return;
|
|
1777
1783
|
const { target: c } = a, l = e(c, a);
|
|
1778
1784
|
if (typeof l != "function" || !c)
|
|
1779
1785
|
return;
|
|
1780
|
-
const u = (
|
|
1781
|
-
|
|
1786
|
+
const u = (f) => {
|
|
1787
|
+
en(f) && (l(f), c.removeEventListener("pointerleave", u));
|
|
1782
1788
|
};
|
|
1783
1789
|
c.addEventListener("pointerleave", u, i);
|
|
1784
1790
|
};
|
|
@@ -1786,18 +1792,18 @@ function Br(t, e, n = {}) {
|
|
|
1786
1792
|
a.addEventListener("pointerenter", o, i);
|
|
1787
1793
|
}), r;
|
|
1788
1794
|
}
|
|
1789
|
-
const
|
|
1795
|
+
const as = (t, e) => e ? t === e ? !0 : as(t, e.parentElement) : !1, Gr = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== !1, _r = /* @__PURE__ */ new Set([
|
|
1790
1796
|
"BUTTON",
|
|
1791
1797
|
"INPUT",
|
|
1792
1798
|
"SELECT",
|
|
1793
1799
|
"TEXTAREA",
|
|
1794
1800
|
"A"
|
|
1795
1801
|
]);
|
|
1796
|
-
function
|
|
1797
|
-
return
|
|
1802
|
+
function Hr(t) {
|
|
1803
|
+
return _r.has(t.tagName) || t.tabIndex !== -1;
|
|
1798
1804
|
}
|
|
1799
|
-
const
|
|
1800
|
-
function
|
|
1805
|
+
const Ct = /* @__PURE__ */ new WeakSet();
|
|
1806
|
+
function nn(t) {
|
|
1801
1807
|
return (e) => {
|
|
1802
1808
|
e.key === "Enter" && t(e);
|
|
1803
1809
|
};
|
|
@@ -1805,48 +1811,48 @@ function tn(t) {
|
|
|
1805
1811
|
function _t(t, e) {
|
|
1806
1812
|
t.dispatchEvent(new PointerEvent("pointer" + e, { isPrimary: !0, bubbles: !0 }));
|
|
1807
1813
|
}
|
|
1808
|
-
const
|
|
1814
|
+
const Ur = (t, e) => {
|
|
1809
1815
|
const n = t.currentTarget;
|
|
1810
1816
|
if (!n)
|
|
1811
1817
|
return;
|
|
1812
|
-
const s =
|
|
1813
|
-
if (
|
|
1818
|
+
const s = nn(() => {
|
|
1819
|
+
if (Ct.has(n))
|
|
1814
1820
|
return;
|
|
1815
1821
|
_t(n, "down");
|
|
1816
|
-
const i =
|
|
1822
|
+
const i = nn(() => {
|
|
1817
1823
|
_t(n, "up");
|
|
1818
1824
|
}), r = () => _t(n, "cancel");
|
|
1819
1825
|
n.addEventListener("keyup", i, e), n.addEventListener("blur", r, e);
|
|
1820
1826
|
});
|
|
1821
1827
|
n.addEventListener("keydown", s, e), n.addEventListener("blur", () => n.removeEventListener("keydown", s), e);
|
|
1822
1828
|
};
|
|
1823
|
-
function
|
|
1824
|
-
return
|
|
1829
|
+
function sn(t) {
|
|
1830
|
+
return Gr(t) && !0;
|
|
1825
1831
|
}
|
|
1826
|
-
function
|
|
1827
|
-
const [s, i, r] =
|
|
1832
|
+
function zr(t, e, n = {}) {
|
|
1833
|
+
const [s, i, r] = os(t, n), o = (a) => {
|
|
1828
1834
|
const c = a.currentTarget;
|
|
1829
|
-
if (!
|
|
1835
|
+
if (!sn(a))
|
|
1830
1836
|
return;
|
|
1831
|
-
|
|
1837
|
+
Ct.add(c);
|
|
1832
1838
|
const l = e(c, a), u = (h, y) => {
|
|
1833
|
-
window.removeEventListener("pointerup",
|
|
1834
|
-
}, d = (h) => {
|
|
1835
|
-
u(h, c === window || c === document || n.useGlobalTarget || os(c, h.target));
|
|
1839
|
+
window.removeEventListener("pointerup", f), window.removeEventListener("pointercancel", d), Ct.has(c) && Ct.delete(c), sn(h) && typeof l == "function" && l(h, { success: y });
|
|
1836
1840
|
}, f = (h) => {
|
|
1841
|
+
u(h, c === window || c === document || n.useGlobalTarget || as(c, h.target));
|
|
1842
|
+
}, d = (h) => {
|
|
1837
1843
|
u(h, !1);
|
|
1838
1844
|
};
|
|
1839
|
-
window.addEventListener("pointerup",
|
|
1845
|
+
window.addEventListener("pointerup", f, i), window.addEventListener("pointercancel", d, i);
|
|
1840
1846
|
};
|
|
1841
1847
|
return s.forEach((a) => {
|
|
1842
|
-
(n.useGlobalTarget ? window : a).addEventListener("pointerdown", o, i),
|
|
1848
|
+
(n.useGlobalTarget ? window : a).addEventListener("pointerdown", o, i), Nr(a) && (a.addEventListener("focus", (l) => Ur(l, i)), !Hr(a) && !a.hasAttribute("tabindex") && (a.tabIndex = 0));
|
|
1843
1849
|
}), r;
|
|
1844
1850
|
}
|
|
1845
|
-
const I = (t) => !!(t && t.getVelocity),
|
|
1851
|
+
const I = (t) => !!(t && t.getVelocity), Yr = [...ns, C, rt], Xr = (t) => Yr.find(es(t)), us = nt({
|
|
1846
1852
|
transformPagePoint: (t) => t,
|
|
1847
1853
|
isStatic: !1,
|
|
1848
1854
|
reducedMotion: "never"
|
|
1849
|
-
}),
|
|
1855
|
+
}), Ce = nt({ strict: !1 }), rn = {
|
|
1850
1856
|
animation: [
|
|
1851
1857
|
"animate",
|
|
1852
1858
|
"variants",
|
|
@@ -1865,34 +1871,34 @@ const I = (t) => !!(t && t.getVelocity), Gr = [...es, C, nt], Ur = (t) => Gr.fin
|
|
|
1865
1871
|
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
1866
1872
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
1867
1873
|
layout: ["layout", "layoutId"]
|
|
1868
|
-
},
|
|
1869
|
-
for (const t in
|
|
1870
|
-
|
|
1871
|
-
isEnabled: (e) =>
|
|
1874
|
+
}, et = {};
|
|
1875
|
+
for (const t in rn)
|
|
1876
|
+
et[t] = {
|
|
1877
|
+
isEnabled: (e) => rn[t].some((n) => !!e[n])
|
|
1872
1878
|
};
|
|
1873
|
-
function
|
|
1879
|
+
function on(t) {
|
|
1874
1880
|
for (const e in t)
|
|
1875
|
-
|
|
1876
|
-
...
|
|
1881
|
+
et[e] = {
|
|
1882
|
+
...et[e],
|
|
1877
1883
|
...t[e]
|
|
1878
1884
|
};
|
|
1879
1885
|
}
|
|
1880
|
-
function
|
|
1881
|
-
const [, s] =
|
|
1882
|
-
if (!
|
|
1886
|
+
function qr({ children: t, features: e, strict: n = !1 }) {
|
|
1887
|
+
const [, s] = Ks(!Ht(e)), i = ft(void 0);
|
|
1888
|
+
if (!Ht(e)) {
|
|
1883
1889
|
const { renderer: r, ...o } = e;
|
|
1884
|
-
i.current = r,
|
|
1890
|
+
i.current = r, on(o);
|
|
1885
1891
|
}
|
|
1886
|
-
return
|
|
1887
|
-
|
|
1888
|
-
|
|
1892
|
+
return de(() => {
|
|
1893
|
+
Ht(e) && e().then(({ renderer: r, ...o }) => {
|
|
1894
|
+
on(o), i.current = r, s(!0);
|
|
1889
1895
|
});
|
|
1890
|
-
}, []), R(
|
|
1896
|
+
}, []), R(Ce.Provider, { value: { renderer: i.current, strict: n }, children: t });
|
|
1891
1897
|
}
|
|
1892
|
-
function
|
|
1898
|
+
function Ht(t) {
|
|
1893
1899
|
return typeof t == "function";
|
|
1894
1900
|
}
|
|
1895
|
-
const
|
|
1901
|
+
const Zr = /* @__PURE__ */ new Set([
|
|
1896
1902
|
"animate",
|
|
1897
1903
|
"exit",
|
|
1898
1904
|
"variants",
|
|
@@ -1924,32 +1930,32 @@ const zr = /* @__PURE__ */ new Set([
|
|
|
1924
1930
|
"ignoreStrict",
|
|
1925
1931
|
"viewport"
|
|
1926
1932
|
]);
|
|
1927
|
-
function
|
|
1928
|
-
return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") ||
|
|
1933
|
+
function Rt(t) {
|
|
1934
|
+
return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || Zr.has(t);
|
|
1929
1935
|
}
|
|
1930
|
-
let
|
|
1931
|
-
function
|
|
1932
|
-
typeof t == "function" && (
|
|
1936
|
+
let cs = (t) => !Rt(t);
|
|
1937
|
+
function Jr(t) {
|
|
1938
|
+
typeof t == "function" && (cs = (e) => e.startsWith("on") ? !Rt(e) : t(e));
|
|
1933
1939
|
}
|
|
1934
1940
|
try {
|
|
1935
|
-
|
|
1941
|
+
Jr(require("@emotion/is-prop-valid").default);
|
|
1936
1942
|
} catch {
|
|
1937
1943
|
}
|
|
1938
|
-
function
|
|
1944
|
+
function Qr(t, e, n) {
|
|
1939
1945
|
const s = {};
|
|
1940
1946
|
for (const i in t)
|
|
1941
|
-
i === "values" && typeof t.values == "object" || (
|
|
1947
|
+
i === "values" && typeof t.values == "object" || (cs(i) || n === !0 && Rt(i) || !e && !Rt(i) || // If trying to use native HTML drag events, forward drag listeners
|
|
1942
1948
|
t.draggable && i.startsWith("onDrag")) && (s[i] = t[i]);
|
|
1943
1949
|
return s;
|
|
1944
1950
|
}
|
|
1945
|
-
const
|
|
1946
|
-
function
|
|
1951
|
+
const Lt = /* @__PURE__ */ nt({});
|
|
1952
|
+
function Bt(t) {
|
|
1947
1953
|
return t !== null && typeof t == "object" && typeof t.start == "function";
|
|
1948
1954
|
}
|
|
1949
|
-
function
|
|
1955
|
+
function gt(t) {
|
|
1950
1956
|
return typeof t == "string" || Array.isArray(t);
|
|
1951
1957
|
}
|
|
1952
|
-
const
|
|
1958
|
+
const Pe = [
|
|
1953
1959
|
"animate",
|
|
1954
1960
|
"whileInView",
|
|
1955
1961
|
"whileFocus",
|
|
@@ -1957,158 +1963,52 @@ const xe = [
|
|
|
1957
1963
|
"whileTap",
|
|
1958
1964
|
"whileDrag",
|
|
1959
1965
|
"exit"
|
|
1960
|
-
],
|
|
1961
|
-
function
|
|
1962
|
-
return
|
|
1966
|
+
], Fe = ["initial", ...Pe];
|
|
1967
|
+
function Kt(t) {
|
|
1968
|
+
return Bt(t.animate) || Fe.some((e) => gt(t[e]));
|
|
1963
1969
|
}
|
|
1964
|
-
function
|
|
1965
|
-
return !!(
|
|
1970
|
+
function ls(t) {
|
|
1971
|
+
return !!(Kt(t) || t.variants);
|
|
1966
1972
|
}
|
|
1967
|
-
function
|
|
1968
|
-
if (
|
|
1973
|
+
function to(t, e) {
|
|
1974
|
+
if (Kt(t)) {
|
|
1969
1975
|
const { initial: n, animate: s } = t;
|
|
1970
1976
|
return {
|
|
1971
|
-
initial: n === !1 ||
|
|
1972
|
-
animate:
|
|
1977
|
+
initial: n === !1 || gt(n) ? n : void 0,
|
|
1978
|
+
animate: gt(s) ? s : void 0
|
|
1973
1979
|
};
|
|
1974
1980
|
}
|
|
1975
1981
|
return t.inherit !== !1 ? e : {};
|
|
1976
1982
|
}
|
|
1977
|
-
function
|
|
1978
|
-
const { initial: e, animate: n } =
|
|
1979
|
-
return
|
|
1983
|
+
function eo(t) {
|
|
1984
|
+
const { initial: e, animate: n } = to(t, k(Lt));
|
|
1985
|
+
return Et(() => ({ initial: e, animate: n }), [an(e), an(n)]);
|
|
1980
1986
|
}
|
|
1981
|
-
function
|
|
1987
|
+
function an(t) {
|
|
1982
1988
|
return Array.isArray(t) ? t.join(" ") : t;
|
|
1983
1989
|
}
|
|
1984
|
-
const
|
|
1985
|
-
function
|
|
1986
|
-
return t
|
|
1987
|
-
}
|
|
1988
|
-
function Qr(t, e, n) {
|
|
1989
|
-
return Ls(
|
|
1990
|
-
(s) => {
|
|
1991
|
-
s && t.onMount && t.onMount(s), e && (s ? e.mount(s) : e.unmount()), n && (typeof n == "function" ? n(s) : ls(n) && (n.current = s));
|
|
1992
|
-
},
|
|
1993
|
-
/**
|
|
1994
|
-
* Only pass a new ref callback to React if we've received a visual element
|
|
1995
|
-
* factory. Otherwise we'll be mounting/remounting every time externalRef
|
|
1996
|
-
* or other dependencies change.
|
|
1997
|
-
*/
|
|
1998
|
-
[e]
|
|
1999
|
-
);
|
|
2000
|
-
}
|
|
2001
|
-
const Ce = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), to = "framerAppearId", fs = "data-" + Ce(to), eo = Q({});
|
|
2002
|
-
function no(t, e, n, s, i) {
|
|
2003
|
-
var b, v;
|
|
2004
|
-
const { visualElement: r } = k(kt), o = k(Ae), a = k(mn), c = k(as).reducedMotion, l = ut(null);
|
|
2005
|
-
s = s || o.renderer, !l.current && s && (l.current = s(t, {
|
|
2006
|
-
visualState: e,
|
|
2007
|
-
parent: r,
|
|
2008
|
-
props: n,
|
|
2009
|
-
presenceContext: a,
|
|
2010
|
-
blockInitialAnimation: a ? a.initial === !1 : !1,
|
|
2011
|
-
reducedMotionConfig: c
|
|
2012
|
-
}));
|
|
2013
|
-
const u = l.current, d = k(eo);
|
|
2014
|
-
u && !u.projection && i && (u.type === "html" || u.type === "svg") && so(l.current, n, i, d);
|
|
2015
|
-
const f = ut(!1);
|
|
2016
|
-
Bs(() => {
|
|
2017
|
-
u && f.current && u.update(n, a);
|
|
2018
|
-
});
|
|
2019
|
-
const h = n[fs], y = ut(!!h && !((b = window.MotionHandoffIsComplete) != null && b.call(window, h)) && ((v = window.MotionHasOptimisedAnimation) == null ? void 0 : v.call(window, h)));
|
|
2020
|
-
return _s(() => {
|
|
2021
|
-
u && (f.current = !0, window.MotionIsMounted = !0, u.updateFeatures(), kr.render(u.render), y.current && u.animationState && u.animationState.animateChanges());
|
|
2022
|
-
}), ce(() => {
|
|
2023
|
-
u && (!y.current && u.animationState && u.animationState.animateChanges(), y.current && (queueMicrotask(() => {
|
|
2024
|
-
var p;
|
|
2025
|
-
(p = window.MotionHandoffMarkAsComplete) == null || p.call(window, h);
|
|
2026
|
-
}), y.current = !1));
|
|
2027
|
-
}), u;
|
|
2028
|
-
}
|
|
2029
|
-
function so(t, e, n, s) {
|
|
2030
|
-
const { layoutId: i, layout: r, drag: o, dragConstraints: a, layoutScroll: c, layoutRoot: l, layoutCrossfade: u } = e;
|
|
2031
|
-
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : ds(t.parent)), t.projection.setOptions({
|
|
2032
|
-
layoutId: i,
|
|
2033
|
-
layout: r,
|
|
2034
|
-
alwaysMeasureLayout: !!o || a && ls(a),
|
|
2035
|
-
visualElement: t,
|
|
2036
|
-
/**
|
|
2037
|
-
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
2038
|
-
* to update by the time layout animations run.
|
|
2039
|
-
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
|
|
2040
|
-
* ensuring it gets called if there's no potential layout animations.
|
|
2041
|
-
*
|
|
2042
|
-
*/
|
|
2043
|
-
animationType: typeof r == "string" ? r : "both",
|
|
2044
|
-
initialPromotionConfig: s,
|
|
2045
|
-
crossfade: u,
|
|
2046
|
-
layoutScroll: c,
|
|
2047
|
-
layoutRoot: l
|
|
2048
|
-
});
|
|
2049
|
-
}
|
|
2050
|
-
function ds(t) {
|
|
2051
|
-
if (t)
|
|
2052
|
-
return t.options.allowProjection !== !1 ? t.projection : ds(t.parent);
|
|
2053
|
-
}
|
|
2054
|
-
function io({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: s, Component: i }) {
|
|
2055
|
-
function r(a, c) {
|
|
2056
|
-
let l;
|
|
2057
|
-
const u = {
|
|
2058
|
-
...k(as),
|
|
2059
|
-
...a,
|
|
2060
|
-
layoutId: ro(a)
|
|
2061
|
-
}, { isStatic: d } = u, f = Zr(a), h = s(a, d);
|
|
2062
|
-
if (!d && le) {
|
|
2063
|
-
oo(u, t);
|
|
2064
|
-
const y = ao(u);
|
|
2065
|
-
l = y.MeasureLayout, f.visualElement = no(i, h, u, e, y.ProjectionNode);
|
|
2066
|
-
}
|
|
2067
|
-
return hn(kt.Provider, { value: f, children: [l && f.visualElement ? R(l, { visualElement: f.visualElement, ...u }) : null, n(i, a, Qr(h, f.visualElement, c), h, d, f.visualElement)] });
|
|
2068
|
-
}
|
|
2069
|
-
r.displayName = `motion.${typeof i == "string" ? i : `create(${i.displayName ?? i.name ?? ""})`}`;
|
|
2070
|
-
const o = Ks(r);
|
|
2071
|
-
return o[Jr] = i, o;
|
|
2072
|
-
}
|
|
2073
|
-
function ro({ layoutId: t }) {
|
|
2074
|
-
const e = k($s).id;
|
|
2075
|
-
return e && t !== void 0 ? e + "-" + t : t;
|
|
2076
|
-
}
|
|
2077
|
-
function oo(t, e) {
|
|
2078
|
-
k(Ae).strict, process.env.NODE_ENV;
|
|
2079
|
-
}
|
|
2080
|
-
function ao(t) {
|
|
2081
|
-
const { drag: e, layout: n } = J;
|
|
2082
|
-
if (!e && !n)
|
|
2083
|
-
return {};
|
|
2084
|
-
const s = { ...e, ...n };
|
|
2085
|
-
return {
|
|
2086
|
-
MeasureLayout: e != null && e.isEnabled(t) || n != null && n.isEnabled(t) ? s.MeasureLayout : void 0,
|
|
2087
|
-
ProjectionNode: s.ProjectionNode
|
|
2088
|
-
};
|
|
2089
|
-
}
|
|
2090
|
-
const uo = {};
|
|
2091
|
-
function hs(t, { layout: e, layoutId: n }) {
|
|
2092
|
-
return it.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!uo[t] || t === "opacity");
|
|
1990
|
+
const no = {};
|
|
1991
|
+
function fs(t, { layout: e, layoutId: n }) {
|
|
1992
|
+
return at.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!no[t] || t === "opacity");
|
|
2093
1993
|
}
|
|
2094
|
-
const
|
|
1994
|
+
const so = {
|
|
2095
1995
|
x: "translateX",
|
|
2096
1996
|
y: "translateY",
|
|
2097
1997
|
z: "translateZ",
|
|
2098
1998
|
transformPerspective: "perspective"
|
|
2099
|
-
},
|
|
2100
|
-
function
|
|
1999
|
+
}, io = ot.length;
|
|
2000
|
+
function ro(t, e, n) {
|
|
2101
2001
|
let s = "", i = !0;
|
|
2102
|
-
for (let r = 0; r <
|
|
2103
|
-
const o =
|
|
2002
|
+
for (let r = 0; r < io; r++) {
|
|
2003
|
+
const o = ot[r], a = t[o];
|
|
2104
2004
|
if (a === void 0)
|
|
2105
2005
|
continue;
|
|
2106
2006
|
let c = !0;
|
|
2107
2007
|
if (typeof a == "number" ? c = a === (o.startsWith("scale") ? 1 : 0) : c = parseFloat(a) === 0, !c || n) {
|
|
2108
|
-
const l =
|
|
2008
|
+
const l = rs(a, Me[o]);
|
|
2109
2009
|
if (!c) {
|
|
2110
2010
|
i = !1;
|
|
2111
|
-
const u =
|
|
2011
|
+
const u = so[o] || o;
|
|
2112
2012
|
s += `${u}(${l}) `;
|
|
2113
2013
|
}
|
|
2114
2014
|
n && (e[o] = l);
|
|
@@ -2116,66 +2016,66 @@ function fo(t, e, n) {
|
|
|
2116
2016
|
}
|
|
2117
2017
|
return s = s.trim(), n ? s = n(e, i ? "" : s) : i && (s = "none"), s;
|
|
2118
2018
|
}
|
|
2119
|
-
function
|
|
2019
|
+
function Oe(t, e, n) {
|
|
2120
2020
|
const { style: s, vars: i, transformOrigin: r } = t;
|
|
2121
2021
|
let o = !1, a = !1;
|
|
2122
2022
|
for (const c in e) {
|
|
2123
2023
|
const l = e[c];
|
|
2124
|
-
if (
|
|
2024
|
+
if (at.has(c)) {
|
|
2125
2025
|
o = !0;
|
|
2126
2026
|
continue;
|
|
2127
|
-
} else if (
|
|
2027
|
+
} else if (kn(c)) {
|
|
2128
2028
|
i[c] = l;
|
|
2129
2029
|
continue;
|
|
2130
2030
|
} else {
|
|
2131
|
-
const u =
|
|
2031
|
+
const u = rs(l, Me[c]);
|
|
2132
2032
|
c.startsWith("origin") ? (a = !0, r[c] = u) : s[c] = u;
|
|
2133
2033
|
}
|
|
2134
2034
|
}
|
|
2135
|
-
if (e.transform || (o || n ? s.transform =
|
|
2035
|
+
if (e.transform || (o || n ? s.transform = ro(e, t.transform, n) : s.transform && (s.transform = "none")), a) {
|
|
2136
2036
|
const { originX: c = "50%", originY: l = "50%", originZ: u = 0 } = r;
|
|
2137
2037
|
s.transformOrigin = `${c} ${l} ${u}`;
|
|
2138
2038
|
}
|
|
2139
2039
|
}
|
|
2140
|
-
const
|
|
2040
|
+
const De = () => ({
|
|
2141
2041
|
style: {},
|
|
2142
2042
|
transform: {},
|
|
2143
2043
|
transformOrigin: {},
|
|
2144
2044
|
vars: {}
|
|
2145
2045
|
});
|
|
2146
|
-
function
|
|
2046
|
+
function ds(t, e, n) {
|
|
2147
2047
|
for (const s in e)
|
|
2148
|
-
!I(e[s]) && !
|
|
2048
|
+
!I(e[s]) && !fs(s, n) && (t[s] = e[s]);
|
|
2149
2049
|
}
|
|
2150
|
-
function
|
|
2151
|
-
return
|
|
2152
|
-
const n =
|
|
2153
|
-
return
|
|
2050
|
+
function oo({ transformTemplate: t }, e) {
|
|
2051
|
+
return Et(() => {
|
|
2052
|
+
const n = De();
|
|
2053
|
+
return Oe(n, e, t), Object.assign({}, n.vars, n.style);
|
|
2154
2054
|
}, [e]);
|
|
2155
2055
|
}
|
|
2156
|
-
function
|
|
2056
|
+
function ao(t, e) {
|
|
2157
2057
|
const n = t.style || {}, s = {};
|
|
2158
|
-
return
|
|
2058
|
+
return ds(s, n, t), Object.assign(s, oo(t, e)), s;
|
|
2159
2059
|
}
|
|
2160
|
-
function
|
|
2161
|
-
const n = {}, s =
|
|
2060
|
+
function uo(t, e) {
|
|
2061
|
+
const n = {}, s = ao(t, e);
|
|
2162
2062
|
return t.drag && t.dragListener !== !1 && (n.draggable = !1, s.userSelect = s.WebkitUserSelect = s.WebkitTouchCallout = "none", s.touchAction = t.drag === !0 ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = s, n;
|
|
2163
2063
|
}
|
|
2164
|
-
const
|
|
2064
|
+
const co = {
|
|
2165
2065
|
offset: "stroke-dashoffset",
|
|
2166
2066
|
array: "stroke-dasharray"
|
|
2167
|
-
},
|
|
2067
|
+
}, lo = {
|
|
2168
2068
|
offset: "strokeDashoffset",
|
|
2169
2069
|
array: "strokeDasharray"
|
|
2170
2070
|
};
|
|
2171
|
-
function
|
|
2071
|
+
function fo(t, e, n = 1, s = 0, i = !0) {
|
|
2172
2072
|
t.pathLength = 1;
|
|
2173
|
-
const r = i ?
|
|
2073
|
+
const r = i ? co : lo;
|
|
2174
2074
|
t[r.offset] = g.transform(-s);
|
|
2175
2075
|
const o = g.transform(e), a = g.transform(n);
|
|
2176
2076
|
t[r.array] = `${o} ${a}`;
|
|
2177
2077
|
}
|
|
2178
|
-
function
|
|
2078
|
+
function hs(t, {
|
|
2179
2079
|
attrX: e,
|
|
2180
2080
|
attrY: n,
|
|
2181
2081
|
attrScale: s,
|
|
@@ -2185,33 +2085,33 @@ function ms(t, {
|
|
|
2185
2085
|
// This is object creation, which we try to avoid per-frame.
|
|
2186
2086
|
...a
|
|
2187
2087
|
}, c, l, u) {
|
|
2188
|
-
if (
|
|
2088
|
+
if (Oe(t, a, l), c) {
|
|
2189
2089
|
t.style.viewBox && (t.attrs.viewBox = t.style.viewBox);
|
|
2190
2090
|
return;
|
|
2191
2091
|
}
|
|
2192
2092
|
t.attrs = t.style, t.style = {};
|
|
2193
|
-
const { attrs:
|
|
2194
|
-
|
|
2093
|
+
const { attrs: f, style: d } = t;
|
|
2094
|
+
f.transform && (d.transform = f.transform, delete f.transform), (d.transform || f.transformOrigin) && (d.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), d.transform && (d.transformBox = (u == null ? void 0 : u.transformBox) ?? "fill-box", delete f.transformBox), e !== void 0 && (f.x = e), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), i !== void 0 && fo(f, i, r, o, !1);
|
|
2195
2095
|
}
|
|
2196
|
-
const
|
|
2197
|
-
...
|
|
2096
|
+
const ps = () => ({
|
|
2097
|
+
...De(),
|
|
2198
2098
|
attrs: {}
|
|
2199
|
-
}),
|
|
2200
|
-
function
|
|
2201
|
-
const i =
|
|
2202
|
-
const r =
|
|
2203
|
-
return
|
|
2099
|
+
}), ms = (t) => typeof t == "string" && t.toLowerCase() === "svg";
|
|
2100
|
+
function ho(t, e, n, s) {
|
|
2101
|
+
const i = Et(() => {
|
|
2102
|
+
const r = ps();
|
|
2103
|
+
return hs(r, e, ms(s), t.transformTemplate, t.style), {
|
|
2204
2104
|
...r.attrs,
|
|
2205
2105
|
style: { ...r.style }
|
|
2206
2106
|
};
|
|
2207
2107
|
}, [e]);
|
|
2208
2108
|
if (t.style) {
|
|
2209
2109
|
const r = {};
|
|
2210
|
-
|
|
2110
|
+
ds(r, t.style, t), i.style = { ...r, ...i.style };
|
|
2211
2111
|
}
|
|
2212
2112
|
return i;
|
|
2213
2113
|
}
|
|
2214
|
-
const
|
|
2114
|
+
const po = [
|
|
2215
2115
|
"animate",
|
|
2216
2116
|
"circle",
|
|
2217
2117
|
"defs",
|
|
@@ -2238,7 +2138,7 @@ const vo = [
|
|
|
2238
2138
|
"use",
|
|
2239
2139
|
"view"
|
|
2240
2140
|
];
|
|
2241
|
-
function
|
|
2141
|
+
function Ie(t) {
|
|
2242
2142
|
return (
|
|
2243
2143
|
/**
|
|
2244
2144
|
* If it's not a string, it's a custom React component. Currently we only support
|
|
@@ -2251,66 +2151,60 @@ function Oe(t) {
|
|
|
2251
2151
|
/**
|
|
2252
2152
|
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
2253
2153
|
*/
|
|
2254
|
-
!!(
|
|
2154
|
+
!!(po.indexOf(t) > -1 || /**
|
|
2255
2155
|
* If it contains a capital letter, it's an SVG component
|
|
2256
2156
|
*/
|
|
2257
2157
|
/[A-Z]/u.test(t))
|
|
2258
2158
|
)
|
|
2259
2159
|
);
|
|
2260
2160
|
}
|
|
2261
|
-
function
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
});
|
|
2268
|
-
};
|
|
2161
|
+
function mo(t, e, n, { latestValues: s }, i, r = !1) {
|
|
2162
|
+
const a = (Ie(t) ? ho : uo)(e, s, i, t), c = Qr(e, typeof t == "string", r), l = t !== gn ? { ...c, ...a, ref: n } : {}, { children: u } = e, f = Et(() => I(u) ? u.get() : u, [u]);
|
|
2163
|
+
return Ws(t, {
|
|
2164
|
+
...l,
|
|
2165
|
+
children: f
|
|
2166
|
+
});
|
|
2269
2167
|
}
|
|
2270
|
-
function
|
|
2168
|
+
function un(t) {
|
|
2271
2169
|
const e = [{}, {}];
|
|
2272
2170
|
return t == null || t.values.forEach((n, s) => {
|
|
2273
2171
|
e[0][s] = n.get(), e[1][s] = n.getVelocity();
|
|
2274
2172
|
}), e;
|
|
2275
2173
|
}
|
|
2276
|
-
function
|
|
2174
|
+
function Re(t, e, n, s) {
|
|
2277
2175
|
if (typeof e == "function") {
|
|
2278
|
-
const [i, r] =
|
|
2176
|
+
const [i, r] = un(s);
|
|
2279
2177
|
e = e(n !== void 0 ? n : t.custom, i, r);
|
|
2280
2178
|
}
|
|
2281
2179
|
if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
|
|
2282
|
-
const [i, r] =
|
|
2180
|
+
const [i, r] = un(s);
|
|
2283
2181
|
e = e(n !== void 0 ? n : t.custom, i, r);
|
|
2284
2182
|
}
|
|
2285
2183
|
return e;
|
|
2286
2184
|
}
|
|
2287
|
-
function
|
|
2185
|
+
function go(t) {
|
|
2288
2186
|
return I(t) ? t.get() : t;
|
|
2289
2187
|
}
|
|
2290
|
-
function
|
|
2188
|
+
function yo({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, s, i) {
|
|
2291
2189
|
return {
|
|
2292
|
-
latestValues:
|
|
2190
|
+
latestValues: bo(n, s, i, t),
|
|
2293
2191
|
renderState: e()
|
|
2294
2192
|
};
|
|
2295
2193
|
}
|
|
2296
|
-
|
|
2297
|
-
const s = k(kt), i = k(mn), r = () => Vo(t, e, s, i);
|
|
2298
|
-
return n ? r() : js(r);
|
|
2299
|
-
};
|
|
2300
|
-
function Ao(t, e, n, s) {
|
|
2194
|
+
function bo(t, e, n, s) {
|
|
2301
2195
|
const i = {}, r = s(t, {});
|
|
2302
|
-
for (const
|
|
2303
|
-
i[
|
|
2196
|
+
for (const d in r)
|
|
2197
|
+
i[d] = go(r[d]);
|
|
2304
2198
|
let { initial: o, animate: a } = t;
|
|
2305
|
-
const c =
|
|
2199
|
+
const c = Kt(t), l = ls(t);
|
|
2306
2200
|
e && l && !c && t.inherit !== !1 && (o === void 0 && (o = e.initial), a === void 0 && (a = e.animate));
|
|
2307
2201
|
let u = n ? n.initial === !1 : !1;
|
|
2308
2202
|
u = u || o === !1;
|
|
2309
|
-
const
|
|
2310
|
-
if (
|
|
2311
|
-
const
|
|
2312
|
-
for (let h = 0; h <
|
|
2313
|
-
const y =
|
|
2203
|
+
const f = u ? a : o;
|
|
2204
|
+
if (f && typeof f != "boolean" && !Bt(f)) {
|
|
2205
|
+
const d = Array.isArray(f) ? f : [f];
|
|
2206
|
+
for (let h = 0; h < d.length; h++) {
|
|
2207
|
+
const y = Re(t, d[h]);
|
|
2314
2208
|
if (y) {
|
|
2315
2209
|
const { transitionEnd: b, transition: v, ...p } = y;
|
|
2316
2210
|
for (const S in p) {
|
|
@@ -2328,953 +2222,1071 @@ function Ao(t, e, n, s) {
|
|
|
2328
2222
|
}
|
|
2329
2223
|
return i;
|
|
2330
2224
|
}
|
|
2331
|
-
|
|
2225
|
+
const gs = (t) => (e, n) => {
|
|
2226
|
+
const s = k(Lt), i = k(yn), r = () => yo(t, e, s, i);
|
|
2227
|
+
return n ? r() : Hs(r);
|
|
2228
|
+
};
|
|
2229
|
+
function Ee(t, e, n) {
|
|
2332
2230
|
var r;
|
|
2333
2231
|
const { style: s } = t, i = {};
|
|
2334
2232
|
for (const o in s)
|
|
2335
|
-
(I(s[o]) || e.style && I(e.style[o]) ||
|
|
2233
|
+
(I(s[o]) || e.style && I(e.style[o]) || fs(o, t) || ((r = n == null ? void 0 : n.getValue(o)) == null ? void 0 : r.liveStyle) !== void 0) && (i[o] = s[o]);
|
|
2336
2234
|
return i;
|
|
2337
2235
|
}
|
|
2338
|
-
const
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
function Ts(t, e, n) {
|
|
2345
|
-
const s = Ie(t, e, n);
|
|
2236
|
+
const To = /* @__PURE__ */ gs({
|
|
2237
|
+
scrapeMotionValuesFromProps: Ee,
|
|
2238
|
+
createRenderState: De
|
|
2239
|
+
});
|
|
2240
|
+
function ys(t, e, n) {
|
|
2241
|
+
const s = Ee(t, e, n);
|
|
2346
2242
|
for (const i in t)
|
|
2347
2243
|
if (I(t[i]) || I(e[i])) {
|
|
2348
|
-
const r =
|
|
2244
|
+
const r = ot.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
|
|
2349
2245
|
s[r] = t[i];
|
|
2350
2246
|
}
|
|
2351
2247
|
return s;
|
|
2352
2248
|
}
|
|
2353
|
-
const
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
function Co(t, e) {
|
|
2360
|
-
return function(s, { forwardMotionProps: i } = { forwardMotionProps: !1 }) {
|
|
2361
|
-
const o = {
|
|
2362
|
-
...Oe(s) ? Mo : xo,
|
|
2363
|
-
preloadedFeatures: t,
|
|
2364
|
-
useRender: wo(i),
|
|
2365
|
-
createVisualElement: e,
|
|
2366
|
-
Component: s
|
|
2367
|
-
};
|
|
2368
|
-
return io(o);
|
|
2369
|
-
};
|
|
2370
|
-
}
|
|
2371
|
-
const Po = /* @__PURE__ */ Co();
|
|
2372
|
-
function pt(t, e, n) {
|
|
2373
|
-
const s = t.getProps();
|
|
2374
|
-
return De(s, e, n !== void 0 ? n : s.custom, t);
|
|
2249
|
+
const vo = /* @__PURE__ */ gs({
|
|
2250
|
+
scrapeMotionValuesFromProps: ys,
|
|
2251
|
+
createRenderState: ps
|
|
2252
|
+
}), wo = Symbol.for("motionComponentSymbol");
|
|
2253
|
+
function bs(t) {
|
|
2254
|
+
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
|
|
2375
2255
|
}
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2256
|
+
function So(t, e, n) {
|
|
2257
|
+
return $s(
|
|
2258
|
+
(s) => {
|
|
2259
|
+
s && t.onMount && t.onMount(s), e && (s ? e.mount(s) : e.unmount()), n && (typeof n == "function" ? n(s) : bs(n) && (n.current = s));
|
|
2260
|
+
},
|
|
2261
|
+
/**
|
|
2262
|
+
* Only pass a new ref callback to React if we've received a visual element
|
|
2263
|
+
* factory. Otherwise we'll be mounting/remounting every time externalRef
|
|
2264
|
+
* or other dependencies change.
|
|
2265
|
+
*/
|
|
2266
|
+
[e]
|
|
2267
|
+
);
|
|
2379
2268
|
}
|
|
2380
|
-
|
|
2381
|
-
|
|
2269
|
+
const ke = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Vo = "framerAppearId", Ts = "data-" + ke(Vo), Ao = nt({});
|
|
2270
|
+
function xo(t, e, n, s, i) {
|
|
2271
|
+
var b, v;
|
|
2272
|
+
const { visualElement: r } = k(Lt), o = k(Ce), a = k(yn), c = k(us).reducedMotion, l = ft(null);
|
|
2273
|
+
s = s || o.renderer, !l.current && s && (l.current = s(t, {
|
|
2274
|
+
visualState: e,
|
|
2275
|
+
parent: r,
|
|
2276
|
+
props: n,
|
|
2277
|
+
presenceContext: a,
|
|
2278
|
+
blockInitialAnimation: a ? a.initial === !1 : !1,
|
|
2279
|
+
reducedMotionConfig: c
|
|
2280
|
+
}));
|
|
2281
|
+
const u = l.current, f = k(Ao);
|
|
2282
|
+
u && !u.projection && i && (u.type === "html" || u.type === "svg") && Mo(l.current, n, i, f);
|
|
2283
|
+
const d = ft(!1);
|
|
2284
|
+
js(() => {
|
|
2285
|
+
u && d.current && u.update(n, a);
|
|
2286
|
+
});
|
|
2287
|
+
const h = n[Ts], y = ft(!!h && !((b = window.MotionHandoffIsComplete) != null && b.call(window, h)) && ((v = window.MotionHasOptimisedAnimation) == null ? void 0 : v.call(window, h)));
|
|
2288
|
+
return Us(() => {
|
|
2289
|
+
u && (d.current = !0, window.MotionIsMounted = !0, u.updateFeatures(), u.scheduleRenderMicrotask(), y.current && u.animationState && u.animationState.animateChanges());
|
|
2290
|
+
}), de(() => {
|
|
2291
|
+
u && (!y.current && u.animationState && u.animationState.animateChanges(), y.current && (queueMicrotask(() => {
|
|
2292
|
+
var p;
|
|
2293
|
+
(p = window.MotionHandoffMarkAsComplete) == null || p.call(window, h);
|
|
2294
|
+
}), y.current = !1), u.enteringChildren = void 0);
|
|
2295
|
+
}), u;
|
|
2382
2296
|
}
|
|
2383
|
-
function
|
|
2384
|
-
const
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2297
|
+
function Mo(t, e, n, s) {
|
|
2298
|
+
const { layoutId: i, layout: r, drag: o, dragConstraints: a, layoutScroll: c, layoutRoot: l, layoutCrossfade: u } = e;
|
|
2299
|
+
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : vs(t.parent)), t.projection.setOptions({
|
|
2300
|
+
layoutId: i,
|
|
2301
|
+
layout: r,
|
|
2302
|
+
alwaysMeasureLayout: !!o || a && bs(a),
|
|
2303
|
+
visualElement: t,
|
|
2304
|
+
/**
|
|
2305
|
+
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
2306
|
+
* to update by the time layout animations run.
|
|
2307
|
+
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
|
|
2308
|
+
* ensuring it gets called if there's no potential layout animations.
|
|
2309
|
+
*
|
|
2310
|
+
*/
|
|
2311
|
+
animationType: typeof r == "string" ? r : "both",
|
|
2312
|
+
initialPromotionConfig: s,
|
|
2313
|
+
crossfade: u,
|
|
2314
|
+
layoutScroll: c,
|
|
2315
|
+
layoutRoot: l
|
|
2316
|
+
});
|
|
2391
2317
|
}
|
|
2392
|
-
function
|
|
2393
|
-
|
|
2318
|
+
function vs(t) {
|
|
2319
|
+
if (t)
|
|
2320
|
+
return t.options.allowProjection !== !1 ? t.projection : vs(t.parent);
|
|
2394
2321
|
}
|
|
2395
|
-
function
|
|
2396
|
-
const
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2322
|
+
function Co(t, { forwardMotionProps: e = !1 } = {}, n, s) {
|
|
2323
|
+
const i = Ie(t) ? vo : To;
|
|
2324
|
+
function r(a, c) {
|
|
2325
|
+
let l;
|
|
2326
|
+
const u = {
|
|
2327
|
+
...k(us),
|
|
2328
|
+
...a,
|
|
2329
|
+
layoutId: Po(a)
|
|
2330
|
+
}, { isStatic: f } = u, d = eo(a), h = i(a, f);
|
|
2331
|
+
if (!f && he) {
|
|
2332
|
+
Fo(u, n);
|
|
2333
|
+
const y = Oo(u);
|
|
2334
|
+
l = y.MeasureLayout, d.visualElement = xo(t, h, u, s, y.ProjectionNode);
|
|
2335
|
+
}
|
|
2336
|
+
return mn(Lt.Provider, { value: d, children: [l && d.visualElement ? R(l, { visualElement: d.visualElement, ...u }) : null, mo(t, a, So(h, d.visualElement, c), h, f, e)] });
|
|
2402
2337
|
}
|
|
2338
|
+
r.displayName = `motion.${typeof t == "string" ? t : `create(${t.displayName ?? t.name ?? ""})`}`;
|
|
2339
|
+
const o = Gs(r);
|
|
2340
|
+
return o[wo] = t, o;
|
|
2403
2341
|
}
|
|
2404
|
-
function
|
|
2405
|
-
|
|
2342
|
+
function Po({ layoutId: t }) {
|
|
2343
|
+
const e = k(_s).id;
|
|
2344
|
+
return e && t !== void 0 ? e + "-" + t : t;
|
|
2406
2345
|
}
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
const i = t.filter(ko), r = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
|
|
2410
|
-
return i[r];
|
|
2346
|
+
function Fo(t, e) {
|
|
2347
|
+
k(Ce).strict, process.env.NODE_ENV;
|
|
2411
2348
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
restSpeed: 10
|
|
2422
|
-
}), Ko = {
|
|
2423
|
-
type: "keyframes",
|
|
2424
|
-
duration: 0.8
|
|
2425
|
-
}, Wo = {
|
|
2426
|
-
type: "keyframes",
|
|
2427
|
-
ease: [0.25, 0.1, 0.35, 1],
|
|
2428
|
-
duration: 0.3
|
|
2429
|
-
}, $o = (t, { keyframes: e }) => e.length > 2 ? Ko : it.has(t) ? t.startsWith("scale") ? Bo(e[1]) : Lo : Wo;
|
|
2430
|
-
function jo({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: c, elapsed: l, ...u }) {
|
|
2431
|
-
return !!Object.keys(u).length;
|
|
2349
|
+
function Oo(t) {
|
|
2350
|
+
const { drag: e, layout: n } = et;
|
|
2351
|
+
if (!e && !n)
|
|
2352
|
+
return {};
|
|
2353
|
+
const s = { ...e, ...n };
|
|
2354
|
+
return {
|
|
2355
|
+
MeasureLayout: e != null && e.isEnabled(t) || n != null && n.isEnabled(t) ? s.MeasureLayout : void 0,
|
|
2356
|
+
ProjectionNode: s.ProjectionNode
|
|
2357
|
+
};
|
|
2432
2358
|
}
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
const u = {
|
|
2438
|
-
keyframes: Array.isArray(n) ? n : [null, n],
|
|
2439
|
-
ease: "easeOut",
|
|
2440
|
-
velocity: e.getVelocity(),
|
|
2441
|
-
...a,
|
|
2442
|
-
delay: -l,
|
|
2443
|
-
onUpdate: (f) => {
|
|
2444
|
-
e.set(f), a.onUpdate && a.onUpdate(f);
|
|
2445
|
-
},
|
|
2446
|
-
onComplete: () => {
|
|
2447
|
-
o(), a.onComplete && a.onComplete();
|
|
2448
|
-
},
|
|
2449
|
-
name: t,
|
|
2450
|
-
motionValue: e,
|
|
2451
|
-
element: r ? void 0 : i
|
|
2359
|
+
function Do({ top: t, left: e, right: n, bottom: s }) {
|
|
2360
|
+
return {
|
|
2361
|
+
x: { min: e, max: n },
|
|
2362
|
+
y: { min: t, max: s }
|
|
2452
2363
|
};
|
|
2453
|
-
jo(a) || Object.assign(u, $o(t, u)), u.duration && (u.duration = /* @__PURE__ */ L(u.duration)), u.repeatDelay && (u.repeatDelay = /* @__PURE__ */ L(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
|
|
2454
|
-
let d = !1;
|
|
2455
|
-
if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (u.duration = 0, u.delay === 0 && (d = !0)), (W.instantAnimations || W.skipAnimations) && (d = !0, u.duration = 0, u.delay = 0), u.allowFlatten = !a.type && !a.ease, d && !r && e.get() !== void 0) {
|
|
2456
|
-
const f = No(u.keyframes, a);
|
|
2457
|
-
if (f !== void 0) {
|
|
2458
|
-
N.update(() => {
|
|
2459
|
-
u.onUpdate(f), u.onComplete();
|
|
2460
|
-
});
|
|
2461
|
-
return;
|
|
2462
|
-
}
|
|
2463
|
-
}
|
|
2464
|
-
return a.isSync ? new we(u) : new br(u);
|
|
2465
|
-
};
|
|
2466
|
-
function Go({ protectedKeys: t, needsAnimating: e }, n) {
|
|
2467
|
-
const s = t.hasOwnProperty(n) && e[n] !== !0;
|
|
2468
|
-
return e[n] = !1, s;
|
|
2469
2364
|
}
|
|
2470
|
-
function
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
const
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
...Jn(r || {}, u)
|
|
2481
|
-
}, y = d.get();
|
|
2482
|
-
if (y !== void 0 && !d.isAnimating && !Array.isArray(f) && f === y && !h.velocity)
|
|
2483
|
-
continue;
|
|
2484
|
-
let b = !1;
|
|
2485
|
-
if (window.MotionHandoffAnimation) {
|
|
2486
|
-
const p = Eo(t);
|
|
2487
|
-
if (p) {
|
|
2488
|
-
const S = window.MotionHandoffAnimation(p, u, N);
|
|
2489
|
-
S !== null && (h.startTime = S, b = !0);
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2492
|
-
Ro(t, u), d.start(_o(u, d, f, t.shouldReduceMotion && Qn.has(u) ? { type: !1 } : h, t, b));
|
|
2493
|
-
const v = d.animation;
|
|
2494
|
-
v && c.push(v);
|
|
2495
|
-
}
|
|
2496
|
-
return o && Promise.all(c).then(() => {
|
|
2497
|
-
N.update(() => {
|
|
2498
|
-
o && Do(t, o);
|
|
2499
|
-
});
|
|
2500
|
-
}), c;
|
|
2365
|
+
function Io(t, e) {
|
|
2366
|
+
if (!e)
|
|
2367
|
+
return t;
|
|
2368
|
+
const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
|
|
2369
|
+
return {
|
|
2370
|
+
top: n.y,
|
|
2371
|
+
left: n.x,
|
|
2372
|
+
bottom: s.y,
|
|
2373
|
+
right: s.x
|
|
2374
|
+
};
|
|
2501
2375
|
}
|
|
2502
|
-
function
|
|
2503
|
-
|
|
2504
|
-
const s = pt(t, e, n.type === "exit" ? (c = t.presenceContext) == null ? void 0 : c.custom : void 0);
|
|
2505
|
-
let { transition: i = t.getDefaultTransition() || {} } = s || {};
|
|
2506
|
-
n.transitionOverride && (i = n.transitionOverride);
|
|
2507
|
-
const r = s ? () => Promise.all(vs(t, s, n)) : () => Promise.resolve(), o = t.variantChildren && t.variantChildren.size ? (l = 0) => {
|
|
2508
|
-
const { delayChildren: u = 0, staggerChildren: d, staggerDirection: f } = i;
|
|
2509
|
-
return Uo(t, e, l, u, d, f, n);
|
|
2510
|
-
} : () => Promise.resolve(), { when: a } = i;
|
|
2511
|
-
if (a) {
|
|
2512
|
-
const [l, u] = a === "beforeChildren" ? [r, o] : [o, r];
|
|
2513
|
-
return l().then(() => u());
|
|
2514
|
-
} else
|
|
2515
|
-
return Promise.all([r(), o(n.delay)]);
|
|
2516
|
-
}
|
|
2517
|
-
function Uo(t, e, n = 0, s = 0, i = 0, r = 1, o) {
|
|
2518
|
-
const a = [], c = t.variantChildren.size, l = (c - 1) * i, u = typeof s == "function", d = u ? (f) => s(f, c) : (
|
|
2519
|
-
// Support deprecated staggerChildren
|
|
2520
|
-
r === 1 ? (f = 0) => f * i : (f = 0) => l - f * i
|
|
2521
|
-
);
|
|
2522
|
-
return Array.from(t.variantChildren).sort(Ho).forEach((f, h) => {
|
|
2523
|
-
f.notify("AnimationStart", e), a.push(oe(f, e, {
|
|
2524
|
-
...o,
|
|
2525
|
-
delay: n + (u ? 0 : s) + d(h)
|
|
2526
|
-
}).then(() => f.notify("AnimationComplete", e)));
|
|
2527
|
-
}), Promise.all(a);
|
|
2376
|
+
function Ro(t, e) {
|
|
2377
|
+
return Do(Io(t.getBoundingClientRect(), e));
|
|
2528
2378
|
}
|
|
2529
|
-
|
|
2530
|
-
|
|
2379
|
+
const cn = () => ({ min: 0, max: 0 }), ws = () => ({
|
|
2380
|
+
x: cn(),
|
|
2381
|
+
y: cn()
|
|
2382
|
+
}), ue = { current: null }, Ss = { current: !1 };
|
|
2383
|
+
function Eo() {
|
|
2384
|
+
if (Ss.current = !0, !!he)
|
|
2385
|
+
if (window.matchMedia) {
|
|
2386
|
+
const t = window.matchMedia("(prefers-reduced-motion)"), e = () => ue.current = t.matches;
|
|
2387
|
+
t.addEventListener("change", e), e();
|
|
2388
|
+
} else
|
|
2389
|
+
ue.current = !1;
|
|
2531
2390
|
}
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2391
|
+
const ko = /* @__PURE__ */ new WeakMap();
|
|
2392
|
+
function No(t, e, n) {
|
|
2393
|
+
for (const s in e) {
|
|
2394
|
+
const i = e[s], r = n[s];
|
|
2395
|
+
if (I(i))
|
|
2396
|
+
t.addValue(s, i);
|
|
2397
|
+
else if (I(r))
|
|
2398
|
+
t.addValue(s, It(i, { owner: t }));
|
|
2399
|
+
else if (r !== i)
|
|
2400
|
+
if (t.hasValue(s)) {
|
|
2401
|
+
const o = t.getValue(s);
|
|
2402
|
+
o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
|
|
2403
|
+
} else {
|
|
2404
|
+
const o = t.getStaticValue(s);
|
|
2405
|
+
t.addValue(s, It(o !== void 0 ? o : i, { owner: t }));
|
|
2406
|
+
}
|
|
2543
2407
|
}
|
|
2544
|
-
|
|
2545
|
-
t.
|
|
2546
|
-
|
|
2547
|
-
}
|
|
2548
|
-
function ws(t, e) {
|
|
2549
|
-
if (!Array.isArray(e))
|
|
2550
|
-
return !1;
|
|
2551
|
-
const n = e.length;
|
|
2552
|
-
if (n !== t.length)
|
|
2553
|
-
return !1;
|
|
2554
|
-
for (let s = 0; s < n; s++)
|
|
2555
|
-
if (e[s] !== t[s])
|
|
2556
|
-
return !1;
|
|
2557
|
-
return !0;
|
|
2408
|
+
for (const s in n)
|
|
2409
|
+
e[s] === void 0 && t.removeValue(s);
|
|
2410
|
+
return e;
|
|
2558
2411
|
}
|
|
2559
|
-
const
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2412
|
+
const ln = [
|
|
2413
|
+
"AnimationStart",
|
|
2414
|
+
"AnimationComplete",
|
|
2415
|
+
"Update",
|
|
2416
|
+
"BeforeLayoutMeasure",
|
|
2417
|
+
"LayoutMeasure",
|
|
2418
|
+
"LayoutAnimationStart",
|
|
2419
|
+
"LayoutAnimationComplete"
|
|
2420
|
+
];
|
|
2421
|
+
class Lo {
|
|
2422
|
+
/**
|
|
2423
|
+
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2424
|
+
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
2425
|
+
*
|
|
2426
|
+
* This isn't an abstract method as it needs calling in the constructor, but it is
|
|
2427
|
+
* intended to be one.
|
|
2428
|
+
*/
|
|
2429
|
+
scrapeMotionValuesFromProps(e, n, s) {
|
|
2430
|
+
return {};
|
|
2566
2431
|
}
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2432
|
+
constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: o }, a = {}) {
|
|
2433
|
+
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = xe, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
2434
|
+
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
2435
|
+
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
2436
|
+
const d = E.now();
|
|
2437
|
+
this.renderScheduledAt < d && (this.renderScheduledAt = d, N.render(this.render, !1, !0));
|
|
2438
|
+
};
|
|
2439
|
+
const { latestValues: c, renderState: l } = o;
|
|
2440
|
+
this.latestValues = c, this.baseTarget = { ...c }, this.initialValues = n.initial ? { ...c } : {}, this.renderState = l, 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 = Kt(n), this.isVariantNode = ls(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
2441
|
+
const { willChange: u, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
2442
|
+
for (const d in f) {
|
|
2443
|
+
const h = f[d];
|
|
2444
|
+
c[d] !== void 0 && I(h) && h.set(c[d]);
|
|
2445
|
+
}
|
|
2571
2446
|
}
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
const { transition: h, transitionEnd: y, ...b } = d;
|
|
2585
|
-
l = { ...l, ...b, ...y };
|
|
2447
|
+
mount(e) {
|
|
2448
|
+
var n;
|
|
2449
|
+
this.current = e, ko.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((s, i) => this.bindToMotionValue(i, s)), Ss.current || Eo(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : ue.current, process.env.NODE_ENV !== "production" && Vn(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), (n = this.parent) == null || n.addChild(this), this.update(this.props, this.presenceContext);
|
|
2450
|
+
}
|
|
2451
|
+
unmount() {
|
|
2452
|
+
var e;
|
|
2453
|
+
this.projection && this.projection.unmount(), Yt(this.notifyUpdate), Yt(this.render), this.valueSubscriptions.forEach((n) => n()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), (e = this.parent) == null || e.removeChild(this);
|
|
2454
|
+
for (const n in this.events)
|
|
2455
|
+
this.events[n].clear();
|
|
2456
|
+
for (const n in this.features) {
|
|
2457
|
+
const s = this.features[n];
|
|
2458
|
+
s && (s.unmount(), s.isMounted = !1);
|
|
2586
2459
|
}
|
|
2587
|
-
|
|
2588
|
-
};
|
|
2589
|
-
function r(c) {
|
|
2590
|
-
e = c(t);
|
|
2460
|
+
this.current = null;
|
|
2591
2461
|
}
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2462
|
+
addChild(e) {
|
|
2463
|
+
this.children.add(e), this.enteringChildren ?? (this.enteringChildren = /* @__PURE__ */ new Set()), this.enteringChildren.add(e);
|
|
2464
|
+
}
|
|
2465
|
+
removeChild(e) {
|
|
2466
|
+
this.children.delete(e), this.enteringChildren && this.enteringChildren.delete(e);
|
|
2467
|
+
}
|
|
2468
|
+
bindToMotionValue(e, n) {
|
|
2469
|
+
this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
|
|
2470
|
+
const s = at.has(e);
|
|
2471
|
+
s && this.onBindTransform && this.onBindTransform();
|
|
2472
|
+
const i = n.on("change", (o) => {
|
|
2473
|
+
this.latestValues[e] = o, this.props.onUpdate && N.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
|
|
2474
|
+
});
|
|
2475
|
+
let r;
|
|
2476
|
+
window.MotionCheckAppearSync && (r = window.MotionCheckAppearSync(this, e, n)), this.valueSubscriptions.set(e, () => {
|
|
2477
|
+
i(), r && r(), n.owner && n.stop();
|
|
2478
|
+
});
|
|
2479
|
+
}
|
|
2480
|
+
sortNodePosition(e) {
|
|
2481
|
+
return !this.current || !this.sortInstanceNodePosition || this.type !== e.type ? 0 : this.sortInstanceNodePosition(this.current, e.current);
|
|
2482
|
+
}
|
|
2483
|
+
updateFeatures() {
|
|
2484
|
+
let e = "animation";
|
|
2485
|
+
for (e in et) {
|
|
2486
|
+
const n = et[e];
|
|
2487
|
+
if (!n)
|
|
2603
2488
|
continue;
|
|
2604
|
-
const
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
const D = Array.isArray(m) ? m : [m];
|
|
2609
|
-
let B = D.reduce(i(p), {});
|
|
2610
|
-
T === !1 && (B = {});
|
|
2611
|
-
const { prevResolvedValues: bt = {} } = S, Tt = {
|
|
2612
|
-
...bt,
|
|
2613
|
-
...B
|
|
2614
|
-
}, vt = (P) => {
|
|
2615
|
-
w = !0, f.has(P) && (F = !0, f.delete(P)), S.needsAnimating[P] = !0;
|
|
2616
|
-
const O = t.getValue(P);
|
|
2617
|
-
O && (O.liveStyle = !1);
|
|
2618
|
-
};
|
|
2619
|
-
for (const P in Tt) {
|
|
2620
|
-
const O = B[P], wt = bt[P];
|
|
2621
|
-
if (h.hasOwnProperty(P))
|
|
2622
|
-
continue;
|
|
2623
|
-
let Bt = !1;
|
|
2624
|
-
re(O) && re(wt) ? Bt = !ws(O, wt) : Bt = O !== wt, Bt ? O != null ? vt(P) : f.add(P) : O !== void 0 && f.has(P) ? vt(P) : S.protectedKeys[P] = !0;
|
|
2625
|
-
}
|
|
2626
|
-
S.prevProp = m, S.prevResolvedValues = B, S.isActive && (h = { ...h, ...B }), s && t.blockInitialAnimation && (w = !1), w && (!(V && M) || F) && d.push(...D.map((P) => ({
|
|
2627
|
-
animation: P,
|
|
2628
|
-
options: { type: p }
|
|
2629
|
-
})));
|
|
2630
|
-
}
|
|
2631
|
-
if (f.size) {
|
|
2632
|
-
const v = {};
|
|
2633
|
-
if (typeof l.initial != "boolean") {
|
|
2634
|
-
const p = pt(t, Array.isArray(l.initial) ? l.initial[0] : l.initial);
|
|
2635
|
-
p && p.transition && (v.transition = p.transition);
|
|
2489
|
+
const { isEnabled: s, Feature: i } = n;
|
|
2490
|
+
if (!this.features[e] && i && s(this.props) && (this.features[e] = new i(this)), this.features[e]) {
|
|
2491
|
+
const r = this.features[e];
|
|
2492
|
+
r.isMounted ? r.update() : (r.mount(), r.isMounted = !0);
|
|
2636
2493
|
}
|
|
2637
|
-
f.forEach((p) => {
|
|
2638
|
-
const S = t.getBaseTarget(p), m = t.getValue(p);
|
|
2639
|
-
m && (m.liveStyle = !0), v[p] = S ?? null;
|
|
2640
|
-
}), d.push({ animation: v });
|
|
2641
2494
|
}
|
|
2642
|
-
let b = !!d.length;
|
|
2643
|
-
return s && (l.initial === !1 || l.initial === l.animate) && !t.manuallyAnimateOnMount && (b = !1), s = !1, b ? e(d) : Promise.resolve();
|
|
2644
2495
|
}
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
if (n[c].isActive === l)
|
|
2648
|
-
return Promise.resolve();
|
|
2649
|
-
(d = t.variantChildren) == null || d.forEach((f) => {
|
|
2650
|
-
var h;
|
|
2651
|
-
return (h = f.animationState) == null ? void 0 : h.setActive(c, l);
|
|
2652
|
-
}), n[c].isActive = l;
|
|
2653
|
-
const u = o(c);
|
|
2654
|
-
for (const f in n)
|
|
2655
|
-
n[f].protectedKeys = {};
|
|
2656
|
-
return u;
|
|
2496
|
+
triggerBuild() {
|
|
2497
|
+
this.build(this.renderState, this.latestValues, this.props);
|
|
2657
2498
|
}
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
}
|
|
2666
|
-
};
|
|
2667
|
-
}
|
|
2668
|
-
function Qo(t, e) {
|
|
2669
|
-
return typeof e == "string" ? e !== t : Array.isArray(e) ? !ws(e, t) : !1;
|
|
2670
|
-
}
|
|
2671
|
-
function j(t = !1) {
|
|
2672
|
-
return {
|
|
2673
|
-
isActive: t,
|
|
2674
|
-
protectedKeys: {},
|
|
2675
|
-
needsAnimating: {},
|
|
2676
|
-
prevResolvedValues: {}
|
|
2677
|
-
};
|
|
2678
|
-
}
|
|
2679
|
-
function an() {
|
|
2680
|
-
return {
|
|
2681
|
-
animate: j(!0),
|
|
2682
|
-
whileInView: j(),
|
|
2683
|
-
whileHover: j(),
|
|
2684
|
-
whileTap: j(),
|
|
2685
|
-
whileDrag: j(),
|
|
2686
|
-
whileFocus: j(),
|
|
2687
|
-
exit: j()
|
|
2688
|
-
};
|
|
2689
|
-
}
|
|
2690
|
-
class rt {
|
|
2691
|
-
constructor(e) {
|
|
2692
|
-
this.isMounted = !1, this.node = e;
|
|
2499
|
+
/**
|
|
2500
|
+
* Measure the current viewport box with or without transforms.
|
|
2501
|
+
* Only measures axis-aligned boxes, rotate and skew must be manually
|
|
2502
|
+
* removed with a re-render to work.
|
|
2503
|
+
*/
|
|
2504
|
+
measureViewportBox() {
|
|
2505
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : ws();
|
|
2693
2506
|
}
|
|
2694
|
-
|
|
2507
|
+
getStaticValue(e) {
|
|
2508
|
+
return this.latestValues[e];
|
|
2509
|
+
}
|
|
2510
|
+
setStaticValue(e, n) {
|
|
2511
|
+
this.latestValues[e] = n;
|
|
2695
2512
|
}
|
|
2696
|
-
}
|
|
2697
|
-
class ta extends rt {
|
|
2698
2513
|
/**
|
|
2699
|
-
*
|
|
2700
|
-
* to
|
|
2701
|
-
* so people can optionally code split it out using the `m` component.
|
|
2514
|
+
* Update the provided props. Ensure any newly-added motion values are
|
|
2515
|
+
* added to our map, old ones removed, and listeners updated.
|
|
2702
2516
|
*/
|
|
2703
|
-
|
|
2704
|
-
|
|
2517
|
+
update(e, n) {
|
|
2518
|
+
(e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
|
|
2519
|
+
for (let s = 0; s < ln.length; s++) {
|
|
2520
|
+
const i = ln[s];
|
|
2521
|
+
this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
|
|
2522
|
+
const r = "on" + i, o = e[r];
|
|
2523
|
+
o && (this.propEventSubscriptions[i] = this.on(i, o));
|
|
2524
|
+
}
|
|
2525
|
+
this.prevMotionValues = No(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
2705
2526
|
}
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
Nt(e) && (this.unmountControls = e.subscribe(this.node));
|
|
2527
|
+
getProps() {
|
|
2528
|
+
return this.props;
|
|
2709
2529
|
}
|
|
2710
2530
|
/**
|
|
2711
|
-
*
|
|
2531
|
+
* Returns the variant definition with a given name.
|
|
2712
2532
|
*/
|
|
2713
|
-
|
|
2714
|
-
this.
|
|
2533
|
+
getVariant(e) {
|
|
2534
|
+
return this.props.variants ? this.props.variants[e] : void 0;
|
|
2715
2535
|
}
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2536
|
+
/**
|
|
2537
|
+
* Returns the defined default transition on this component.
|
|
2538
|
+
*/
|
|
2539
|
+
getDefaultTransition() {
|
|
2540
|
+
return this.props.transition;
|
|
2719
2541
|
}
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
this.node.animationState.reset(), (e = this.unmountControls) == null || e.call(this);
|
|
2542
|
+
getTransformPagePoint() {
|
|
2543
|
+
return this.props.transformPagePoint;
|
|
2723
2544
|
}
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
class na extends rt {
|
|
2727
|
-
constructor() {
|
|
2728
|
-
super(...arguments), this.id = ea++;
|
|
2545
|
+
getClosestVariantNode() {
|
|
2546
|
+
return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
|
|
2729
2547
|
}
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
n && !e && i.then(() => {
|
|
2738
|
-
n(this.id);
|
|
2739
|
-
});
|
|
2548
|
+
/**
|
|
2549
|
+
* Add a child visual element to our set of children.
|
|
2550
|
+
*/
|
|
2551
|
+
addVariantChild(e) {
|
|
2552
|
+
const n = this.getClosestVariantNode();
|
|
2553
|
+
if (n)
|
|
2554
|
+
return n.variantChildren && n.variantChildren.add(e), () => n.variantChildren.delete(e);
|
|
2740
2555
|
}
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2556
|
+
/**
|
|
2557
|
+
* Add a motion value and bind it to this visual element.
|
|
2558
|
+
*/
|
|
2559
|
+
addValue(e, n) {
|
|
2560
|
+
const s = this.values.get(e);
|
|
2561
|
+
n !== s && (s && this.removeValue(e), this.bindToMotionValue(e, n), this.values.set(e, n), this.latestValues[e] = n.get());
|
|
2744
2562
|
}
|
|
2745
|
-
|
|
2563
|
+
/**
|
|
2564
|
+
* Remove a motion value and unbind any active subscriptions.
|
|
2565
|
+
*/
|
|
2566
|
+
removeValue(e) {
|
|
2567
|
+
this.values.delete(e);
|
|
2568
|
+
const n = this.valueSubscriptions.get(e);
|
|
2569
|
+
n && (n(), this.valueSubscriptions.delete(e)), delete this.latestValues[e], this.removeValueFromRenderState(e, this.renderState);
|
|
2746
2570
|
}
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
exit: {
|
|
2753
|
-
Feature: na
|
|
2571
|
+
/**
|
|
2572
|
+
* Check whether we have a motion value for this key
|
|
2573
|
+
*/
|
|
2574
|
+
hasValue(e) {
|
|
2575
|
+
return this.values.has(e);
|
|
2754
2576
|
}
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
return {
|
|
2761
|
-
point: {
|
|
2762
|
-
x: t.pageX,
|
|
2763
|
-
y: t.pageY
|
|
2764
|
-
}
|
|
2765
|
-
};
|
|
2766
|
-
}
|
|
2767
|
-
function ia({ top: t, left: e, right: n, bottom: s }) {
|
|
2768
|
-
return {
|
|
2769
|
-
x: { min: e, max: n },
|
|
2770
|
-
y: { min: t, max: s }
|
|
2771
|
-
};
|
|
2772
|
-
}
|
|
2773
|
-
function ra(t, e) {
|
|
2774
|
-
if (!e)
|
|
2775
|
-
return t;
|
|
2776
|
-
const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
|
|
2777
|
-
return {
|
|
2778
|
-
top: n.y,
|
|
2779
|
-
left: n.x,
|
|
2780
|
-
bottom: s.y,
|
|
2781
|
-
right: s.x
|
|
2782
|
-
};
|
|
2783
|
-
}
|
|
2784
|
-
const cn = () => ({ min: 0, max: 0 }), As = () => ({
|
|
2785
|
-
x: cn(),
|
|
2786
|
-
y: cn()
|
|
2787
|
-
});
|
|
2788
|
-
function oa(t, e) {
|
|
2789
|
-
return ia(ra(t.getBoundingClientRect(), e));
|
|
2790
|
-
}
|
|
2791
|
-
function ln(t, e, n) {
|
|
2792
|
-
const { props: s } = t;
|
|
2793
|
-
t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
2794
|
-
const i = "onHover" + n, r = s[i];
|
|
2795
|
-
r && N.postRender(() => r(e, Vs(e)));
|
|
2796
|
-
}
|
|
2797
|
-
class aa extends rt {
|
|
2798
|
-
mount() {
|
|
2799
|
-
const { current: e } = this.node;
|
|
2800
|
-
e && (this.unmount = Br(e, (n, s) => (ln(this.node, s, "Start"), (i) => ln(this.node, i, "End"))));
|
|
2577
|
+
getValue(e, n) {
|
|
2578
|
+
if (this.props.values && this.props.values[e])
|
|
2579
|
+
return this.props.values[e];
|
|
2580
|
+
let s = this.values.get(e);
|
|
2581
|
+
return s === void 0 && n !== void 0 && (s = It(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
|
|
2801
2582
|
}
|
|
2802
|
-
|
|
2583
|
+
/**
|
|
2584
|
+
* If we're trying to animate to a previously unencountered value,
|
|
2585
|
+
* we need to check for it in our state and as a last resort read it
|
|
2586
|
+
* directly from the instance (which might have performance implications).
|
|
2587
|
+
*/
|
|
2588
|
+
readValue(e, n) {
|
|
2589
|
+
let s = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : this.getBaseTargetFromProps(this.props, e) ?? this.readValueFromInstance(this.current, e, this.options);
|
|
2590
|
+
return s != null && (typeof s == "string" && (bn(s) || Tn(s)) ? s = parseFloat(s) : !Xr(s) && rt.test(n) && (s = is(e, n)), this.setBaseTarget(e, I(s) ? s.get() : s)), I(s) ? s.get() : s;
|
|
2803
2591
|
}
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2592
|
+
/**
|
|
2593
|
+
* Set the base target to later animate back to. This is currently
|
|
2594
|
+
* only hydrated on creation and when we first read a value.
|
|
2595
|
+
*/
|
|
2596
|
+
setBaseTarget(e, n) {
|
|
2597
|
+
this.baseTarget[e] = n;
|
|
2808
2598
|
}
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2599
|
+
/**
|
|
2600
|
+
* Find the base target for a value thats been removed from all animation
|
|
2601
|
+
* props.
|
|
2602
|
+
*/
|
|
2603
|
+
getBaseTarget(e) {
|
|
2604
|
+
var r;
|
|
2605
|
+
const { initial: n } = this.props;
|
|
2606
|
+
let s;
|
|
2607
|
+
if (typeof n == "string" || typeof n == "object") {
|
|
2608
|
+
const o = Re(this.props, n, (r = this.presenceContext) == null ? void 0 : r.custom);
|
|
2609
|
+
o && (s = o[e]);
|
|
2815
2610
|
}
|
|
2816
|
-
|
|
2611
|
+
if (n && s !== void 0)
|
|
2612
|
+
return s;
|
|
2613
|
+
const i = this.getBaseTargetFromProps(this.props, e);
|
|
2614
|
+
return i !== void 0 && !I(i) ? i : this.initialValues[e] !== void 0 && s === void 0 ? void 0 : this.baseTarget[e];
|
|
2817
2615
|
}
|
|
2818
|
-
|
|
2819
|
-
|
|
2616
|
+
on(e, n) {
|
|
2617
|
+
return this.events[e] || (this.events[e] = new wn()), this.events[e].add(n);
|
|
2820
2618
|
}
|
|
2821
|
-
|
|
2822
|
-
this.
|
|
2619
|
+
notify(e, ...n) {
|
|
2620
|
+
this.events[e] && this.events[e].notify(...n);
|
|
2823
2621
|
}
|
|
2824
|
-
|
|
2622
|
+
scheduleRenderMicrotask() {
|
|
2623
|
+
Kr.render(this.render);
|
|
2825
2624
|
}
|
|
2826
2625
|
}
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
return;
|
|
2831
|
-
t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
2832
|
-
const i = "onTap" + (n === "End" ? "" : n), r = s[i];
|
|
2833
|
-
r && N.postRender(() => r(e, Vs(e)));
|
|
2834
|
-
}
|
|
2835
|
-
class ca extends rt {
|
|
2836
|
-
mount() {
|
|
2837
|
-
const { current: e } = this.node;
|
|
2838
|
-
e && (this.unmount = _r(e, (n, s) => (fn(this.node, s, "Start"), (i, { success: r }) => fn(this.node, i, r ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
2626
|
+
class Vs extends Lo {
|
|
2627
|
+
constructor() {
|
|
2628
|
+
super(...arguments), this.KeyframeResolver = Er;
|
|
2839
2629
|
}
|
|
2840
|
-
|
|
2630
|
+
sortInstanceNodePosition(e, n) {
|
|
2631
|
+
return e.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
2632
|
+
}
|
|
2633
|
+
getBaseTargetFromProps(e, n) {
|
|
2634
|
+
return e.style ? e.style[n] : void 0;
|
|
2635
|
+
}
|
|
2636
|
+
removeValueFromRenderState(e, { vars: n, style: s }) {
|
|
2637
|
+
delete n[e], delete s[e];
|
|
2638
|
+
}
|
|
2639
|
+
handleChildMotionValue() {
|
|
2640
|
+
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
2641
|
+
const { children: e } = this.props;
|
|
2642
|
+
I(e) && (this.childSubscription = e.on("change", (n) => {
|
|
2643
|
+
this.current && (this.current.textContent = `${n}`);
|
|
2644
|
+
}));
|
|
2841
2645
|
}
|
|
2842
2646
|
}
|
|
2843
|
-
|
|
2844
|
-
const
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
Ut.has(n) || Ut.set(n, {});
|
|
2852
|
-
const s = Ut.get(n), i = JSON.stringify(e);
|
|
2853
|
-
return s[i] || (s[i] = new IntersectionObserver(fa, { root: t, ...e })), s[i];
|
|
2647
|
+
function As(t, { style: e, vars: n }, s, i) {
|
|
2648
|
+
const r = t.style;
|
|
2649
|
+
let o;
|
|
2650
|
+
for (o in e)
|
|
2651
|
+
r[o] = e[o];
|
|
2652
|
+
i == null || i.applyProjectionStyles(r, s);
|
|
2653
|
+
for (o in n)
|
|
2654
|
+
r.setProperty(o, n[o]);
|
|
2854
2655
|
}
|
|
2855
|
-
function
|
|
2856
|
-
|
|
2857
|
-
return ae.set(t, n), s.observe(t), () => {
|
|
2858
|
-
ae.delete(t), s.unobserve(t);
|
|
2859
|
-
};
|
|
2656
|
+
function Bo(t) {
|
|
2657
|
+
return window.getComputedStyle(t);
|
|
2860
2658
|
}
|
|
2861
|
-
|
|
2862
|
-
some: 0,
|
|
2863
|
-
all: 1
|
|
2864
|
-
};
|
|
2865
|
-
class ma extends rt {
|
|
2659
|
+
class Ko extends Vs {
|
|
2866
2660
|
constructor() {
|
|
2867
|
-
super(...arguments), this.
|
|
2661
|
+
super(...arguments), this.type = "html", this.renderInstance = As;
|
|
2868
2662
|
}
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
if (this.isInView === l || (this.isInView = l, r && !l && this.hasEnteredView))
|
|
2878
|
-
return;
|
|
2879
|
-
l && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", l);
|
|
2880
|
-
const { onViewportEnter: u, onViewportLeave: d } = this.node.getProps(), f = l ? u : d;
|
|
2881
|
-
f && f(c);
|
|
2882
|
-
};
|
|
2883
|
-
return ha(this.node.current, o, a);
|
|
2663
|
+
readValueFromInstance(e, n) {
|
|
2664
|
+
var s;
|
|
2665
|
+
if (at.has(n))
|
|
2666
|
+
return (s = this.projection) != null && s.isProjecting ? ee(n) : Ji(e, n);
|
|
2667
|
+
{
|
|
2668
|
+
const i = Bo(e), r = (kn(n) ? i.getPropertyValue(n) : i[n]) || 0;
|
|
2669
|
+
return typeof r == "string" ? r.trim() : r;
|
|
2670
|
+
}
|
|
2884
2671
|
}
|
|
2885
|
-
|
|
2886
|
-
|
|
2672
|
+
measureInstanceViewportBox(e, { transformPagePoint: n }) {
|
|
2673
|
+
return Ro(e, n);
|
|
2887
2674
|
}
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
return;
|
|
2891
|
-
const { props: e, prevProps: n } = this.node;
|
|
2892
|
-
["amount", "margin", "root"].some(ga(e, n)) && this.startObserver();
|
|
2675
|
+
build(e, n, s) {
|
|
2676
|
+
Oe(e, n, s.transformTemplate);
|
|
2893
2677
|
}
|
|
2894
|
-
|
|
2678
|
+
scrapeMotionValuesFromProps(e, n, s) {
|
|
2679
|
+
return Ee(e, n, s);
|
|
2895
2680
|
}
|
|
2896
2681
|
}
|
|
2897
|
-
|
|
2898
|
-
|
|
2682
|
+
const xs = /* @__PURE__ */ new Set([
|
|
2683
|
+
"baseFrequency",
|
|
2684
|
+
"diffuseConstant",
|
|
2685
|
+
"kernelMatrix",
|
|
2686
|
+
"kernelUnitLength",
|
|
2687
|
+
"keySplines",
|
|
2688
|
+
"keyTimes",
|
|
2689
|
+
"limitingConeAngle",
|
|
2690
|
+
"markerHeight",
|
|
2691
|
+
"markerWidth",
|
|
2692
|
+
"numOctaves",
|
|
2693
|
+
"targetX",
|
|
2694
|
+
"targetY",
|
|
2695
|
+
"surfaceScale",
|
|
2696
|
+
"specularConstant",
|
|
2697
|
+
"specularExponent",
|
|
2698
|
+
"stdDeviation",
|
|
2699
|
+
"tableValues",
|
|
2700
|
+
"viewBox",
|
|
2701
|
+
"gradientTransform",
|
|
2702
|
+
"pathLength",
|
|
2703
|
+
"startOffset",
|
|
2704
|
+
"textLength",
|
|
2705
|
+
"lengthAdjust"
|
|
2706
|
+
]);
|
|
2707
|
+
function Wo(t, e, n, s) {
|
|
2708
|
+
As(t, e, void 0, s);
|
|
2709
|
+
for (const i in e.attrs)
|
|
2710
|
+
t.setAttribute(xs.has(i) ? i : ke(i), e.attrs[i]);
|
|
2899
2711
|
}
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
},
|
|
2904
|
-
tap: {
|
|
2905
|
-
Feature: ca
|
|
2906
|
-
},
|
|
2907
|
-
focus: {
|
|
2908
|
-
Feature: ua
|
|
2909
|
-
},
|
|
2910
|
-
hover: {
|
|
2911
|
-
Feature: aa
|
|
2712
|
+
class $o extends Vs {
|
|
2713
|
+
constructor() {
|
|
2714
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = ws;
|
|
2912
2715
|
}
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
const Ta = /* @__PURE__ */ new WeakMap();
|
|
2923
|
-
function va(t, e, n) {
|
|
2924
|
-
for (const s in e) {
|
|
2925
|
-
const i = e[s], r = n[s];
|
|
2926
|
-
if (I(i))
|
|
2927
|
-
t.addValue(s, i);
|
|
2928
|
-
else if (I(r))
|
|
2929
|
-
t.addValue(s, Ot(i, { owner: t }));
|
|
2930
|
-
else if (r !== i)
|
|
2931
|
-
if (t.hasValue(s)) {
|
|
2932
|
-
const o = t.getValue(s);
|
|
2933
|
-
o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
|
|
2934
|
-
} else {
|
|
2935
|
-
const o = t.getStaticValue(s);
|
|
2936
|
-
t.addValue(s, Ot(o !== void 0 ? o : i, { owner: t }));
|
|
2937
|
-
}
|
|
2716
|
+
getBaseTargetFromProps(e, n) {
|
|
2717
|
+
return e[n];
|
|
2718
|
+
}
|
|
2719
|
+
readValueFromInstance(e, n) {
|
|
2720
|
+
if (at.has(n)) {
|
|
2721
|
+
const s = ss(n);
|
|
2722
|
+
return s && s.default || 0;
|
|
2723
|
+
}
|
|
2724
|
+
return n = xs.has(n) ? n : ke(n), e.getAttribute(n);
|
|
2938
2725
|
}
|
|
2939
|
-
for (const s in n)
|
|
2940
|
-
e[s] === void 0 && t.removeValue(s);
|
|
2941
|
-
return e;
|
|
2942
|
-
}
|
|
2943
|
-
const dn = [
|
|
2944
|
-
"AnimationStart",
|
|
2945
|
-
"AnimationComplete",
|
|
2946
|
-
"Update",
|
|
2947
|
-
"BeforeLayoutMeasure",
|
|
2948
|
-
"LayoutMeasure",
|
|
2949
|
-
"LayoutAnimationStart",
|
|
2950
|
-
"LayoutAnimationComplete"
|
|
2951
|
-
];
|
|
2952
|
-
class wa {
|
|
2953
|
-
/**
|
|
2954
|
-
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2955
|
-
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
2956
|
-
*
|
|
2957
|
-
* This isn't an abstract method as it needs calling in the constructor, but it is
|
|
2958
|
-
* intended to be one.
|
|
2959
|
-
*/
|
|
2960
2726
|
scrapeMotionValuesFromProps(e, n, s) {
|
|
2961
|
-
return
|
|
2727
|
+
return ys(e, n, s);
|
|
2962
2728
|
}
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
this.renderScheduledAt < f && (this.renderScheduledAt = f, N.render(this.render, !1, !0));
|
|
2969
|
-
};
|
|
2970
|
-
const { latestValues: c, renderState: l } = o;
|
|
2971
|
-
this.latestValues = c, this.baseTarget = { ...c }, this.initialValues = n.initial ? { ...c } : {}, this.renderState = l, 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 = Lt(n), this.isVariantNode = cs(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
2972
|
-
const { willChange: u, ...d } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
2973
|
-
for (const f in d) {
|
|
2974
|
-
const h = d[f];
|
|
2975
|
-
c[f] !== void 0 && I(h) && h.set(c[f], !1);
|
|
2976
|
-
}
|
|
2729
|
+
build(e, n, s) {
|
|
2730
|
+
hs(e, n, this.isSVGTag, s.transformTemplate, s.style);
|
|
2731
|
+
}
|
|
2732
|
+
renderInstance(e, n, s, i) {
|
|
2733
|
+
Wo(e, n, s, i);
|
|
2977
2734
|
}
|
|
2978
2735
|
mount(e) {
|
|
2979
|
-
this.
|
|
2736
|
+
this.isSVGTag = ms(e.tagName), super.mount(e);
|
|
2980
2737
|
}
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2738
|
+
}
|
|
2739
|
+
const jo = (t, e) => Ie(t) ? new $o(e) : new Ko(e, {
|
|
2740
|
+
allowProjection: t !== gn
|
|
2741
|
+
});
|
|
2742
|
+
function tt(t, e, n) {
|
|
2743
|
+
const s = t.getProps();
|
|
2744
|
+
return Re(s, e, n !== void 0 ? n : s.custom, t);
|
|
2745
|
+
}
|
|
2746
|
+
const ce = (t) => Array.isArray(t);
|
|
2747
|
+
function Go(t, e, n) {
|
|
2748
|
+
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, It(n));
|
|
2749
|
+
}
|
|
2750
|
+
function _o(t) {
|
|
2751
|
+
return ce(t) ? t[t.length - 1] || 0 : t;
|
|
2752
|
+
}
|
|
2753
|
+
function Ho(t, e) {
|
|
2754
|
+
const n = tt(t, e);
|
|
2755
|
+
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
|
|
2756
|
+
r = { ...r, ...s };
|
|
2757
|
+
for (const o in r) {
|
|
2758
|
+
const a = _o(r[o]);
|
|
2759
|
+
Go(t, o, a);
|
|
2990
2760
|
}
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
2761
|
+
}
|
|
2762
|
+
function Uo(t) {
|
|
2763
|
+
return !!(I(t) && t.add);
|
|
2764
|
+
}
|
|
2765
|
+
function zo(t, e) {
|
|
2766
|
+
const n = t.getValue("willChange");
|
|
2767
|
+
if (Uo(n))
|
|
2768
|
+
return n.add(e);
|
|
2769
|
+
if (!n && W.WillChange) {
|
|
2770
|
+
const s = new W.WillChange("auto");
|
|
2771
|
+
t.addValue("willChange", s), s.add(e);
|
|
3002
2772
|
}
|
|
3003
|
-
|
|
3004
|
-
|
|
2773
|
+
}
|
|
2774
|
+
function Yo(t) {
|
|
2775
|
+
return t.props[Ts];
|
|
2776
|
+
}
|
|
2777
|
+
const Xo = (t) => t !== null;
|
|
2778
|
+
function qo(t, { repeat: e, repeatType: n = "loop" }, s) {
|
|
2779
|
+
const i = t.filter(Xo), r = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
|
|
2780
|
+
return i[r];
|
|
2781
|
+
}
|
|
2782
|
+
const Zo = {
|
|
2783
|
+
type: "spring",
|
|
2784
|
+
stiffness: 500,
|
|
2785
|
+
damping: 25,
|
|
2786
|
+
restSpeed: 10
|
|
2787
|
+
}, Jo = (t) => ({
|
|
2788
|
+
type: "spring",
|
|
2789
|
+
stiffness: 550,
|
|
2790
|
+
damping: t === 0 ? 2 * Math.sqrt(550) : 30,
|
|
2791
|
+
restSpeed: 10
|
|
2792
|
+
}), Qo = {
|
|
2793
|
+
type: "keyframes",
|
|
2794
|
+
duration: 0.8
|
|
2795
|
+
}, ta = {
|
|
2796
|
+
type: "keyframes",
|
|
2797
|
+
ease: [0.25, 0.1, 0.35, 1],
|
|
2798
|
+
duration: 0.3
|
|
2799
|
+
}, ea = (t, { keyframes: e }) => e.length > 2 ? Qo : at.has(t) ? t.startsWith("scale") ? Jo(e[1]) : Zo : ta;
|
|
2800
|
+
function na({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: c, elapsed: l, ...u }) {
|
|
2801
|
+
return !!Object.keys(u).length;
|
|
2802
|
+
}
|
|
2803
|
+
const sa = (t, e, n, s = {}, i, r) => (o) => {
|
|
2804
|
+
const a = Qn(s, t) || {}, c = a.delay || s.delay || 0;
|
|
2805
|
+
let { elapsed: l = 0 } = s;
|
|
2806
|
+
l = l - /* @__PURE__ */ L(c);
|
|
2807
|
+
const u = {
|
|
2808
|
+
keyframes: Array.isArray(n) ? n : [null, n],
|
|
2809
|
+
ease: "easeOut",
|
|
2810
|
+
velocity: e.getVelocity(),
|
|
2811
|
+
...a,
|
|
2812
|
+
delay: -l,
|
|
2813
|
+
onUpdate: (d) => {
|
|
2814
|
+
e.set(d), a.onUpdate && a.onUpdate(d);
|
|
2815
|
+
},
|
|
2816
|
+
onComplete: () => {
|
|
2817
|
+
o(), a.onComplete && a.onComplete();
|
|
2818
|
+
},
|
|
2819
|
+
name: t,
|
|
2820
|
+
motionValue: e,
|
|
2821
|
+
element: r ? void 0 : i
|
|
2822
|
+
};
|
|
2823
|
+
na(a) || Object.assign(u, ea(t, u)), u.duration && (u.duration = /* @__PURE__ */ L(u.duration)), u.repeatDelay && (u.repeatDelay = /* @__PURE__ */ L(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
|
|
2824
|
+
let f = !1;
|
|
2825
|
+
if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (oe(u), u.delay === 0 && (f = !0)), (W.instantAnimations || W.skipAnimations) && (f = !0, oe(u), u.delay = 0), u.allowFlatten = !a.type && !a.ease, f && !r && e.get() !== void 0) {
|
|
2826
|
+
const d = qo(u.keyframes, a);
|
|
2827
|
+
if (d !== void 0) {
|
|
2828
|
+
N.update(() => {
|
|
2829
|
+
u.onUpdate(d), u.onComplete();
|
|
2830
|
+
});
|
|
2831
|
+
return;
|
|
2832
|
+
}
|
|
3005
2833
|
}
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
2834
|
+
return a.isSync ? new Ae(u) : new wr(u);
|
|
2835
|
+
};
|
|
2836
|
+
function ia({ protectedKeys: t, needsAnimating: e }, n) {
|
|
2837
|
+
const s = t.hasOwnProperty(n) && e[n] !== !0;
|
|
2838
|
+
return e[n] = !1, s;
|
|
2839
|
+
}
|
|
2840
|
+
function Ms(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
2841
|
+
let { transition: r = t.getDefaultTransition(), transitionEnd: o, ...a } = e;
|
|
2842
|
+
s && (r = s);
|
|
2843
|
+
const c = [], l = i && t.animationState && t.animationState.getState()[i];
|
|
2844
|
+
for (const u in a) {
|
|
2845
|
+
const f = t.getValue(u, t.latestValues[u] ?? null), d = a[u];
|
|
2846
|
+
if (d === void 0 || l && ia(l, u))
|
|
2847
|
+
continue;
|
|
2848
|
+
const h = {
|
|
2849
|
+
delay: n,
|
|
2850
|
+
...Qn(r || {}, u)
|
|
2851
|
+
}, y = f.get();
|
|
2852
|
+
if (y !== void 0 && !f.isAnimating && !Array.isArray(d) && d === y && !h.velocity)
|
|
2853
|
+
continue;
|
|
2854
|
+
let b = !1;
|
|
2855
|
+
if (window.MotionHandoffAnimation) {
|
|
2856
|
+
const p = Yo(t);
|
|
2857
|
+
if (p) {
|
|
2858
|
+
const S = window.MotionHandoffAnimation(p, u, N);
|
|
2859
|
+
S !== null && (h.startTime = S, b = !0);
|
|
3016
2860
|
}
|
|
3017
2861
|
}
|
|
2862
|
+
zo(t, u), f.start(sa(u, f, d, t.shouldReduceMotion && ts.has(u) ? { type: !1 } : h, t, b));
|
|
2863
|
+
const v = f.animation;
|
|
2864
|
+
v && c.push(v);
|
|
3018
2865
|
}
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
2866
|
+
return o && Promise.all(c).then(() => {
|
|
2867
|
+
N.update(() => {
|
|
2868
|
+
o && Ho(t, o);
|
|
2869
|
+
});
|
|
2870
|
+
}), c;
|
|
2871
|
+
}
|
|
2872
|
+
function Cs(t, e, n, s = 0, i = 1) {
|
|
2873
|
+
const r = Array.from(t).sort((l, u) => l.sortNodePosition(u)).indexOf(e), o = t.size, a = (o - 1) * s;
|
|
2874
|
+
return typeof n == "function" ? n(r, o) : i === 1 ? r * s : a - r * s;
|
|
2875
|
+
}
|
|
2876
|
+
function le(t, e, n = {}) {
|
|
2877
|
+
var c;
|
|
2878
|
+
const s = tt(t, e, n.type === "exit" ? (c = t.presenceContext) == null ? void 0 : c.custom : void 0);
|
|
2879
|
+
let { transition: i = t.getDefaultTransition() || {} } = s || {};
|
|
2880
|
+
n.transitionOverride && (i = n.transitionOverride);
|
|
2881
|
+
const r = s ? () => Promise.all(Ms(t, s, n)) : () => Promise.resolve(), o = t.variantChildren && t.variantChildren.size ? (l = 0) => {
|
|
2882
|
+
const { delayChildren: u = 0, staggerChildren: f, staggerDirection: d } = i;
|
|
2883
|
+
return ra(t, e, l, u, f, d, n);
|
|
2884
|
+
} : () => Promise.resolve(), { when: a } = i;
|
|
2885
|
+
if (a) {
|
|
2886
|
+
const [l, u] = a === "beforeChildren" ? [r, o] : [o, r];
|
|
2887
|
+
return l().then(() => u());
|
|
2888
|
+
} else
|
|
2889
|
+
return Promise.all([r(), o(n.delay)]);
|
|
2890
|
+
}
|
|
2891
|
+
function ra(t, e, n = 0, s = 0, i = 0, r = 1, o) {
|
|
2892
|
+
const a = [];
|
|
2893
|
+
for (const c of t.variantChildren)
|
|
2894
|
+
c.notify("AnimationStart", e), a.push(le(c, e, {
|
|
2895
|
+
...o,
|
|
2896
|
+
delay: n + (typeof s == "function" ? 0 : s) + Cs(t.variantChildren, c, s, i, r)
|
|
2897
|
+
}).then(() => c.notify("AnimationComplete", e)));
|
|
2898
|
+
return Promise.all(a);
|
|
2899
|
+
}
|
|
2900
|
+
function oa(t, e, n = {}) {
|
|
2901
|
+
t.notify("AnimationStart", e);
|
|
2902
|
+
let s;
|
|
2903
|
+
if (Array.isArray(e)) {
|
|
2904
|
+
const i = e.map((r) => le(t, r, n));
|
|
2905
|
+
s = Promise.all(i);
|
|
2906
|
+
} else if (typeof e == "string")
|
|
2907
|
+
s = le(t, e, n);
|
|
2908
|
+
else {
|
|
2909
|
+
const i = typeof e == "function" ? tt(t, e, n.custom) : e;
|
|
2910
|
+
s = Promise.all(Ms(t, i, n));
|
|
3029
2911
|
}
|
|
3030
|
-
|
|
3031
|
-
|
|
2912
|
+
return s.then(() => {
|
|
2913
|
+
t.notify("AnimationComplete", e);
|
|
2914
|
+
});
|
|
2915
|
+
}
|
|
2916
|
+
function Ps(t, e) {
|
|
2917
|
+
if (!Array.isArray(e))
|
|
2918
|
+
return !1;
|
|
2919
|
+
const n = e.length;
|
|
2920
|
+
if (n !== t.length)
|
|
2921
|
+
return !1;
|
|
2922
|
+
for (let s = 0; s < n; s++)
|
|
2923
|
+
if (e[s] !== t[s])
|
|
2924
|
+
return !1;
|
|
2925
|
+
return !0;
|
|
2926
|
+
}
|
|
2927
|
+
const aa = Fe.length;
|
|
2928
|
+
function Fs(t) {
|
|
2929
|
+
if (!t)
|
|
2930
|
+
return;
|
|
2931
|
+
if (!t.isControllingVariants) {
|
|
2932
|
+
const n = t.parent ? Fs(t.parent) || {} : {};
|
|
2933
|
+
return t.props.initial !== void 0 && (n.initial = t.props.initial), n;
|
|
3032
2934
|
}
|
|
3033
|
-
|
|
3034
|
-
|
|
2935
|
+
const e = {};
|
|
2936
|
+
for (let n = 0; n < aa; n++) {
|
|
2937
|
+
const s = Fe[n], i = t.props[s];
|
|
2938
|
+
(gt(i) || i === !1) && (e[s] = i);
|
|
3035
2939
|
}
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
2940
|
+
return e;
|
|
2941
|
+
}
|
|
2942
|
+
const ua = [...Pe].reverse(), ca = Pe.length;
|
|
2943
|
+
function la(t) {
|
|
2944
|
+
return (e) => Promise.all(e.map(({ animation: n, options: s }) => oa(t, n, s)));
|
|
2945
|
+
}
|
|
2946
|
+
function fa(t) {
|
|
2947
|
+
let e = la(t), n = fn(), s = !0;
|
|
2948
|
+
const i = (c) => (l, u) => {
|
|
2949
|
+
var d;
|
|
2950
|
+
const f = tt(t, u, c === "exit" ? (d = t.presenceContext) == null ? void 0 : d.custom : void 0);
|
|
2951
|
+
if (f) {
|
|
2952
|
+
const { transition: h, transitionEnd: y, ...b } = f;
|
|
2953
|
+
l = { ...l, ...b, ...y };
|
|
3047
2954
|
}
|
|
3048
|
-
|
|
3049
|
-
}
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
}
|
|
3053
|
-
/**
|
|
3054
|
-
* Returns the variant definition with a given name.
|
|
3055
|
-
*/
|
|
3056
|
-
getVariant(e) {
|
|
3057
|
-
return this.props.variants ? this.props.variants[e] : void 0;
|
|
3058
|
-
}
|
|
3059
|
-
/**
|
|
3060
|
-
* Returns the defined default transition on this component.
|
|
3061
|
-
*/
|
|
3062
|
-
getDefaultTransition() {
|
|
3063
|
-
return this.props.transition;
|
|
3064
|
-
}
|
|
3065
|
-
getTransformPagePoint() {
|
|
3066
|
-
return this.props.transformPagePoint;
|
|
3067
|
-
}
|
|
3068
|
-
getClosestVariantNode() {
|
|
3069
|
-
return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
|
|
3070
|
-
}
|
|
3071
|
-
/**
|
|
3072
|
-
* Add a child visual element to our set of children.
|
|
3073
|
-
*/
|
|
3074
|
-
addVariantChild(e) {
|
|
3075
|
-
const n = this.getClosestVariantNode();
|
|
3076
|
-
if (n)
|
|
3077
|
-
return n.variantChildren && n.variantChildren.add(e), () => n.variantChildren.delete(e);
|
|
2955
|
+
return l;
|
|
2956
|
+
};
|
|
2957
|
+
function r(c) {
|
|
2958
|
+
e = c(t);
|
|
3078
2959
|
}
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
2960
|
+
function o(c) {
|
|
2961
|
+
const { props: l } = t, u = Fs(t.parent) || {}, f = [], d = /* @__PURE__ */ new Set();
|
|
2962
|
+
let h = {}, y = 1 / 0;
|
|
2963
|
+
for (let v = 0; v < ca; v++) {
|
|
2964
|
+
const p = ua[v], S = n[p], m = l[p] !== void 0 ? l[p] : u[p], A = gt(m), T = p === c ? S.isActive : null;
|
|
2965
|
+
T === !1 && (y = v);
|
|
2966
|
+
let V = m === u[p] && m !== l[p] && A;
|
|
2967
|
+
if (V && s && t.manuallyAnimateOnMount && (V = !1), S.protectedKeys = { ...h }, // If it isn't active and hasn't *just* been set as inactive
|
|
2968
|
+
!S.isActive && T === null || // If we didn't and don't have any defined prop for this animation type
|
|
2969
|
+
!m && !S.prevProp || // Or if the prop doesn't define an animation
|
|
2970
|
+
Bt(m) || typeof m == "boolean")
|
|
2971
|
+
continue;
|
|
2972
|
+
const M = da(S.prevProp, m);
|
|
2973
|
+
let w = M || // If we're making this variant active, we want to always make it active
|
|
2974
|
+
p === c && S.isActive && !V && A || // If we removed a higher-priority variant (i is in reverse order)
|
|
2975
|
+
v > y && A, O = !1;
|
|
2976
|
+
const D = Array.isArray(m) ? m : [m];
|
|
2977
|
+
let B = D.reduce(i(p), {});
|
|
2978
|
+
T === !1 && (B = {});
|
|
2979
|
+
const { prevResolvedValues: vt = {} } = S, wt = {
|
|
2980
|
+
...vt,
|
|
2981
|
+
...B
|
|
2982
|
+
}, St = (P) => {
|
|
2983
|
+
w = !0, d.has(P) && (O = !0, d.delete(P)), S.needsAnimating[P] = !0;
|
|
2984
|
+
const F = t.getValue(P);
|
|
2985
|
+
F && (F.liveStyle = !1);
|
|
2986
|
+
};
|
|
2987
|
+
for (const P in wt) {
|
|
2988
|
+
const F = B[P], $ = vt[P];
|
|
2989
|
+
if (h.hasOwnProperty(P))
|
|
2990
|
+
continue;
|
|
2991
|
+
let q = !1;
|
|
2992
|
+
ce(F) && ce($) ? q = !Ps(F, $) : q = F !== $, q ? F != null ? St(P) : d.add(P) : F !== void 0 && d.has(P) ? St(P) : S.protectedKeys[P] = !0;
|
|
2993
|
+
}
|
|
2994
|
+
S.prevProp = m, S.prevResolvedValues = B, S.isActive && (h = { ...h, ...B }), s && t.blockInitialAnimation && (w = !1);
|
|
2995
|
+
const Vt = V && M;
|
|
2996
|
+
w && (!Vt || O) && f.push(...D.map((P) => {
|
|
2997
|
+
const F = { type: p };
|
|
2998
|
+
if (typeof P == "string" && s && !Vt && t.manuallyAnimateOnMount && t.parent) {
|
|
2999
|
+
const { parent: $ } = t, q = tt($, P);
|
|
3000
|
+
if ($.enteringChildren && q) {
|
|
3001
|
+
const { delayChildren: Is } = q.transition || {};
|
|
3002
|
+
F.delay = Cs($.enteringChildren, t, Is);
|
|
3003
|
+
}
|
|
3004
|
+
}
|
|
3005
|
+
return {
|
|
3006
|
+
animation: P,
|
|
3007
|
+
options: F
|
|
3008
|
+
};
|
|
3009
|
+
}));
|
|
3010
|
+
}
|
|
3011
|
+
if (d.size) {
|
|
3012
|
+
const v = {};
|
|
3013
|
+
if (typeof l.initial != "boolean") {
|
|
3014
|
+
const p = tt(t, Array.isArray(l.initial) ? l.initial[0] : l.initial);
|
|
3015
|
+
p && p.transition && (v.transition = p.transition);
|
|
3016
|
+
}
|
|
3017
|
+
d.forEach((p) => {
|
|
3018
|
+
const S = t.getBaseTarget(p), m = t.getValue(p);
|
|
3019
|
+
m && (m.liveStyle = !0), v[p] = S ?? null;
|
|
3020
|
+
}), f.push({ animation: v });
|
|
3021
|
+
}
|
|
3022
|
+
let b = !!f.length;
|
|
3023
|
+
return s && (l.initial === !1 || l.initial === l.animate) && !t.manuallyAnimateOnMount && (b = !1), s = !1, b ? e(f) : Promise.resolve();
|
|
3085
3024
|
}
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3025
|
+
function a(c, l) {
|
|
3026
|
+
var f;
|
|
3027
|
+
if (n[c].isActive === l)
|
|
3028
|
+
return Promise.resolve();
|
|
3029
|
+
(f = t.variantChildren) == null || f.forEach((d) => {
|
|
3030
|
+
var h;
|
|
3031
|
+
return (h = d.animationState) == null ? void 0 : h.setActive(c, l);
|
|
3032
|
+
}), n[c].isActive = l;
|
|
3033
|
+
const u = o(c);
|
|
3034
|
+
for (const d in n)
|
|
3035
|
+
n[d].protectedKeys = {};
|
|
3036
|
+
return u;
|
|
3093
3037
|
}
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3038
|
+
return {
|
|
3039
|
+
animateChanges: o,
|
|
3040
|
+
setActive: a,
|
|
3041
|
+
setAnimateFunction: r,
|
|
3042
|
+
getState: () => n,
|
|
3043
|
+
reset: () => {
|
|
3044
|
+
n = fn(), s = !0;
|
|
3045
|
+
}
|
|
3046
|
+
};
|
|
3047
|
+
}
|
|
3048
|
+
function da(t, e) {
|
|
3049
|
+
return typeof e == "string" ? e !== t : Array.isArray(e) ? !Ps(e, t) : !1;
|
|
3050
|
+
}
|
|
3051
|
+
function G(t = !1) {
|
|
3052
|
+
return {
|
|
3053
|
+
isActive: t,
|
|
3054
|
+
protectedKeys: {},
|
|
3055
|
+
needsAnimating: {},
|
|
3056
|
+
prevResolvedValues: {}
|
|
3057
|
+
};
|
|
3058
|
+
}
|
|
3059
|
+
function fn() {
|
|
3060
|
+
return {
|
|
3061
|
+
animate: G(!0),
|
|
3062
|
+
whileInView: G(),
|
|
3063
|
+
whileHover: G(),
|
|
3064
|
+
whileTap: G(),
|
|
3065
|
+
whileDrag: G(),
|
|
3066
|
+
whileFocus: G(),
|
|
3067
|
+
exit: G()
|
|
3068
|
+
};
|
|
3069
|
+
}
|
|
3070
|
+
class ut {
|
|
3071
|
+
constructor(e) {
|
|
3072
|
+
this.isMounted = !1, this.node = e;
|
|
3099
3073
|
}
|
|
3100
|
-
|
|
3101
|
-
if (this.props.values && this.props.values[e])
|
|
3102
|
-
return this.props.values[e];
|
|
3103
|
-
let s = this.values.get(e);
|
|
3104
|
-
return s === void 0 && n !== void 0 && (s = Ot(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
|
|
3074
|
+
update() {
|
|
3105
3075
|
}
|
|
3076
|
+
}
|
|
3077
|
+
class ha extends ut {
|
|
3106
3078
|
/**
|
|
3107
|
-
*
|
|
3108
|
-
*
|
|
3109
|
-
*
|
|
3079
|
+
* We dynamically generate the AnimationState manager as it contains a reference
|
|
3080
|
+
* to the underlying animation library. We only want to load that if we load this,
|
|
3081
|
+
* so people can optionally code split it out using the `m` component.
|
|
3110
3082
|
*/
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
return s != null && (typeof s == "string" && (gn(s) || yn(s)) ? s = parseFloat(s) : !Ur(s) && nt.test(n) && (s = ss(e, n)), this.setBaseTarget(e, I(s) ? s.get() : s)), I(s) ? s.get() : s;
|
|
3083
|
+
constructor(e) {
|
|
3084
|
+
super(e), e.animationState || (e.animationState = fa(e));
|
|
3114
3085
|
}
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
*/
|
|
3119
|
-
setBaseTarget(e, n) {
|
|
3120
|
-
this.baseTarget[e] = n;
|
|
3086
|
+
updateAnimationControlsSubscription() {
|
|
3087
|
+
const { animate: e } = this.node.getProps();
|
|
3088
|
+
Bt(e) && (this.unmountControls = e.subscribe(this.node));
|
|
3121
3089
|
}
|
|
3122
3090
|
/**
|
|
3123
|
-
*
|
|
3124
|
-
* props.
|
|
3091
|
+
* Subscribe any provided AnimationControls to the component's VisualElement
|
|
3125
3092
|
*/
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
const { initial: n } = this.props;
|
|
3129
|
-
let s;
|
|
3130
|
-
if (typeof n == "string" || typeof n == "object") {
|
|
3131
|
-
const o = De(this.props, n, (r = this.presenceContext) == null ? void 0 : r.custom);
|
|
3132
|
-
o && (s = o[e]);
|
|
3133
|
-
}
|
|
3134
|
-
if (n && s !== void 0)
|
|
3135
|
-
return s;
|
|
3136
|
-
const i = this.getBaseTargetFromProps(this.props, e);
|
|
3137
|
-
return i !== void 0 && !I(i) ? i : this.initialValues[e] !== void 0 && s === void 0 ? void 0 : this.baseTarget[e];
|
|
3093
|
+
mount() {
|
|
3094
|
+
this.updateAnimationControlsSubscription();
|
|
3138
3095
|
}
|
|
3139
|
-
|
|
3140
|
-
|
|
3096
|
+
update() {
|
|
3097
|
+
const { animate: e } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
|
|
3098
|
+
e !== n && this.updateAnimationControlsSubscription();
|
|
3141
3099
|
}
|
|
3142
|
-
|
|
3143
|
-
|
|
3100
|
+
unmount() {
|
|
3101
|
+
var e;
|
|
3102
|
+
this.node.animationState.reset(), (e = this.unmountControls) == null || e.call(this);
|
|
3144
3103
|
}
|
|
3145
3104
|
}
|
|
3146
|
-
|
|
3105
|
+
let pa = 0;
|
|
3106
|
+
class ma extends ut {
|
|
3147
3107
|
constructor() {
|
|
3148
|
-
super(...arguments), this.
|
|
3108
|
+
super(...arguments), this.id = pa++;
|
|
3149
3109
|
}
|
|
3150
|
-
|
|
3151
|
-
|
|
3110
|
+
update() {
|
|
3111
|
+
if (!this.node.presenceContext)
|
|
3112
|
+
return;
|
|
3113
|
+
const { isPresent: e, onExitComplete: n } = this.node.presenceContext, { isPresent: s } = this.node.prevPresenceContext || {};
|
|
3114
|
+
if (!this.node.animationState || e === s)
|
|
3115
|
+
return;
|
|
3116
|
+
const i = this.node.animationState.setActive("exit", !e);
|
|
3117
|
+
n && !e && i.then(() => {
|
|
3118
|
+
n(this.id);
|
|
3119
|
+
});
|
|
3152
3120
|
}
|
|
3153
|
-
|
|
3154
|
-
|
|
3121
|
+
mount() {
|
|
3122
|
+
const { register: e, onExitComplete: n } = this.node.presenceContext || {};
|
|
3123
|
+
n && n(this.id), e && (this.unmount = e(this.id));
|
|
3155
3124
|
}
|
|
3156
|
-
|
|
3157
|
-
delete n[e], delete s[e];
|
|
3125
|
+
unmount() {
|
|
3158
3126
|
}
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3127
|
+
}
|
|
3128
|
+
const ga = {
|
|
3129
|
+
animation: {
|
|
3130
|
+
Feature: ha
|
|
3131
|
+
},
|
|
3132
|
+
exit: {
|
|
3133
|
+
Feature: ma
|
|
3165
3134
|
}
|
|
3135
|
+
};
|
|
3136
|
+
function dn(t, e, n, s = { passive: !0 }) {
|
|
3137
|
+
return t.addEventListener(e, n, s), () => t.removeEventListener(e, n);
|
|
3166
3138
|
}
|
|
3167
|
-
function
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
r.setProperty(o, n[o]);
|
|
3139
|
+
function Os(t) {
|
|
3140
|
+
return {
|
|
3141
|
+
point: {
|
|
3142
|
+
x: t.pageX,
|
|
3143
|
+
y: t.pageY
|
|
3144
|
+
}
|
|
3145
|
+
};
|
|
3175
3146
|
}
|
|
3176
|
-
function
|
|
3177
|
-
|
|
3147
|
+
function hn(t, e, n) {
|
|
3148
|
+
const { props: s } = t;
|
|
3149
|
+
t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
3150
|
+
const i = "onHover" + n, r = s[i];
|
|
3151
|
+
r && N.postRender(() => r(e, Os(e)));
|
|
3178
3152
|
}
|
|
3179
|
-
class
|
|
3153
|
+
class ya extends ut {
|
|
3154
|
+
mount() {
|
|
3155
|
+
const { current: e } = this.node;
|
|
3156
|
+
e && (this.unmount = jr(e, (n, s) => (hn(this.node, s, "Start"), (i) => hn(this.node, i, "End"))));
|
|
3157
|
+
}
|
|
3158
|
+
unmount() {
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
3161
|
+
class ba extends ut {
|
|
3180
3162
|
constructor() {
|
|
3181
|
-
super(...arguments), this.
|
|
3163
|
+
super(...arguments), this.isActive = !1;
|
|
3182
3164
|
}
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
{
|
|
3188
|
-
|
|
3189
|
-
return typeof r == "string" ? r.trim() : r;
|
|
3165
|
+
onFocus() {
|
|
3166
|
+
let e = !1;
|
|
3167
|
+
try {
|
|
3168
|
+
e = this.node.current.matches(":focus-visible");
|
|
3169
|
+
} catch {
|
|
3170
|
+
e = !0;
|
|
3190
3171
|
}
|
|
3172
|
+
!e || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
|
|
3191
3173
|
}
|
|
3192
|
-
|
|
3193
|
-
|
|
3174
|
+
onBlur() {
|
|
3175
|
+
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
3194
3176
|
}
|
|
3195
|
-
|
|
3196
|
-
|
|
3177
|
+
mount() {
|
|
3178
|
+
this.unmount = kt(dn(this.node.current, "focus", () => this.onFocus()), dn(this.node.current, "blur", () => this.onBlur()));
|
|
3197
3179
|
}
|
|
3198
|
-
|
|
3199
|
-
return Ie(e, n, s);
|
|
3180
|
+
unmount() {
|
|
3200
3181
|
}
|
|
3201
3182
|
}
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
"
|
|
3207
|
-
"
|
|
3208
|
-
|
|
3209
|
-
"limitingConeAngle",
|
|
3210
|
-
"markerHeight",
|
|
3211
|
-
"markerWidth",
|
|
3212
|
-
"numOctaves",
|
|
3213
|
-
"targetX",
|
|
3214
|
-
"targetY",
|
|
3215
|
-
"surfaceScale",
|
|
3216
|
-
"specularConstant",
|
|
3217
|
-
"specularExponent",
|
|
3218
|
-
"stdDeviation",
|
|
3219
|
-
"tableValues",
|
|
3220
|
-
"viewBox",
|
|
3221
|
-
"gradientTransform",
|
|
3222
|
-
"pathLength",
|
|
3223
|
-
"startOffset",
|
|
3224
|
-
"textLength",
|
|
3225
|
-
"lengthAdjust"
|
|
3226
|
-
]);
|
|
3227
|
-
function Aa(t, e, n, s) {
|
|
3228
|
-
Cs(t, e, void 0, s);
|
|
3229
|
-
for (const i in e.attrs)
|
|
3230
|
-
t.setAttribute(Ps.has(i) ? i : Ce(i), e.attrs[i]);
|
|
3183
|
+
function pn(t, e, n) {
|
|
3184
|
+
const { props: s } = t;
|
|
3185
|
+
if (t.current instanceof HTMLButtonElement && t.current.disabled)
|
|
3186
|
+
return;
|
|
3187
|
+
t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
3188
|
+
const i = "onTap" + (n === "End" ? "" : n), r = s[i];
|
|
3189
|
+
r && N.postRender(() => r(e, Os(e)));
|
|
3231
3190
|
}
|
|
3232
|
-
class
|
|
3233
|
-
|
|
3234
|
-
|
|
3191
|
+
class Ta extends ut {
|
|
3192
|
+
mount() {
|
|
3193
|
+
const { current: e } = this.node;
|
|
3194
|
+
e && (this.unmount = zr(e, (n, s) => (pn(this.node, s, "Start"), (i, { success: r }) => pn(this.node, i, r ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
3235
3195
|
}
|
|
3236
|
-
|
|
3237
|
-
return e[n];
|
|
3196
|
+
unmount() {
|
|
3238
3197
|
}
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3198
|
+
}
|
|
3199
|
+
const fe = /* @__PURE__ */ new WeakMap(), Ut = /* @__PURE__ */ new WeakMap(), va = (t) => {
|
|
3200
|
+
const e = fe.get(t.target);
|
|
3201
|
+
e && e(t);
|
|
3202
|
+
}, wa = (t) => {
|
|
3203
|
+
t.forEach(va);
|
|
3204
|
+
};
|
|
3205
|
+
function Sa({ root: t, ...e }) {
|
|
3206
|
+
const n = t || document;
|
|
3207
|
+
Ut.has(n) || Ut.set(n, {});
|
|
3208
|
+
const s = Ut.get(n), i = JSON.stringify(e);
|
|
3209
|
+
return s[i] || (s[i] = new IntersectionObserver(wa, { root: t, ...e })), s[i];
|
|
3210
|
+
}
|
|
3211
|
+
function Va(t, e, n) {
|
|
3212
|
+
const s = Sa(e);
|
|
3213
|
+
return fe.set(t, n), s.observe(t), () => {
|
|
3214
|
+
fe.delete(t), s.unobserve(t);
|
|
3215
|
+
};
|
|
3216
|
+
}
|
|
3217
|
+
const Aa = {
|
|
3218
|
+
some: 0,
|
|
3219
|
+
all: 1
|
|
3220
|
+
};
|
|
3221
|
+
class xa extends ut {
|
|
3222
|
+
constructor() {
|
|
3223
|
+
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
3245
3224
|
}
|
|
3246
|
-
|
|
3247
|
-
|
|
3225
|
+
startObserver() {
|
|
3226
|
+
this.unmount();
|
|
3227
|
+
const { viewport: e = {} } = this.node.getProps(), { root: n, margin: s, amount: i = "some", once: r } = e, o = {
|
|
3228
|
+
root: n ? n.current : void 0,
|
|
3229
|
+
rootMargin: s,
|
|
3230
|
+
threshold: typeof i == "number" ? i : Aa[i]
|
|
3231
|
+
}, a = (c) => {
|
|
3232
|
+
const { isIntersecting: l } = c;
|
|
3233
|
+
if (this.isInView === l || (this.isInView = l, r && !l && this.hasEnteredView))
|
|
3234
|
+
return;
|
|
3235
|
+
l && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", l);
|
|
3236
|
+
const { onViewportEnter: u, onViewportLeave: f } = this.node.getProps(), d = l ? u : f;
|
|
3237
|
+
d && d(c);
|
|
3238
|
+
};
|
|
3239
|
+
return Va(this.node.current, o, a);
|
|
3248
3240
|
}
|
|
3249
|
-
|
|
3250
|
-
|
|
3241
|
+
mount() {
|
|
3242
|
+
this.startObserver();
|
|
3251
3243
|
}
|
|
3252
|
-
|
|
3253
|
-
|
|
3244
|
+
update() {
|
|
3245
|
+
if (typeof IntersectionObserver > "u")
|
|
3246
|
+
return;
|
|
3247
|
+
const { props: e, prevProps: n } = this.node;
|
|
3248
|
+
["amount", "margin", "root"].some(Ma(e, n)) && this.startObserver();
|
|
3254
3249
|
}
|
|
3255
|
-
|
|
3256
|
-
|
|
3250
|
+
unmount() {
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
function Ma({ viewport: t = {} }, { viewport: e = {} } = {}) {
|
|
3254
|
+
return (n) => t[n] !== e[n];
|
|
3255
|
+
}
|
|
3256
|
+
const Ca = {
|
|
3257
|
+
inView: {
|
|
3258
|
+
Feature: xa
|
|
3259
|
+
},
|
|
3260
|
+
tap: {
|
|
3261
|
+
Feature: Ta
|
|
3262
|
+
},
|
|
3263
|
+
focus: {
|
|
3264
|
+
Feature: ba
|
|
3265
|
+
},
|
|
3266
|
+
hover: {
|
|
3267
|
+
Feature: ya
|
|
3257
3268
|
}
|
|
3269
|
+
}, Pa = {
|
|
3270
|
+
renderer: jo,
|
|
3271
|
+
...ga,
|
|
3272
|
+
...Ca
|
|
3273
|
+
};
|
|
3274
|
+
function Fa(t, e) {
|
|
3275
|
+
return Co(t, e);
|
|
3258
3276
|
}
|
|
3259
|
-
const
|
|
3260
|
-
allowProjection: t !== pn
|
|
3261
|
-
}), Ca = {
|
|
3262
|
-
renderer: Ma,
|
|
3263
|
-
...sa,
|
|
3264
|
-
...ya
|
|
3265
|
-
}, Pa = /* @__PURE__ */ Po("div"), Fa = {
|
|
3277
|
+
const Oa = /* @__PURE__ */ Fa("div"), Da = {
|
|
3266
3278
|
light: {
|
|
3267
3279
|
border: "px",
|
|
3268
3280
|
shadow: "2"
|
|
3269
3281
|
},
|
|
3270
3282
|
dark: {}
|
|
3271
|
-
},
|
|
3283
|
+
}, Ds = ht.createContext({
|
|
3272
3284
|
groupOpen: !1,
|
|
3273
3285
|
setGroupOpen: () => {
|
|
3274
3286
|
}
|
|
3275
|
-
}),
|
|
3276
|
-
const n =
|
|
3277
|
-
return
|
|
3287
|
+
}), Ia = ({ open: t, delay: e = 600 }) => {
|
|
3288
|
+
const n = ht.useContext(Ds);
|
|
3289
|
+
return ht.useEffect(() => {
|
|
3278
3290
|
let s = null;
|
|
3279
3291
|
return n.setGroupOpen && (t === !0 && n.setGroupOpen(!0), t === !1 && (s = setTimeout(() => {
|
|
3280
3292
|
n.setGroupOpen && n.setGroupOpen(!1);
|
|
@@ -3284,10 +3296,10 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3284
3296
|
}, [t, n, e]), {
|
|
3285
3297
|
groupOpen: n.groupOpen
|
|
3286
3298
|
};
|
|
3287
|
-
},
|
|
3288
|
-
const [e, n] =
|
|
3289
|
-
return /* @__PURE__ */ R(
|
|
3290
|
-
},
|
|
3299
|
+
}, Wa = ({ children: t }) => {
|
|
3300
|
+
const [e, n] = ht.useState(!1);
|
|
3301
|
+
return /* @__PURE__ */ R(Ds.Provider, { value: { groupOpen: e, setGroupOpen: n }, children: t });
|
|
3302
|
+
}, $a = ({
|
|
3291
3303
|
// Radix Tooltip Provider Props
|
|
3292
3304
|
delayDuration: t = 400,
|
|
3293
3305
|
skipDelayDuration: e,
|
|
@@ -3302,8 +3314,8 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3302
3314
|
onPointerDownOutside: c,
|
|
3303
3315
|
forceMount: l,
|
|
3304
3316
|
side: u = "bottom",
|
|
3305
|
-
sideOffset:
|
|
3306
|
-
align:
|
|
3317
|
+
sideOffset: f = 4,
|
|
3318
|
+
align: d = "center",
|
|
3307
3319
|
alignOffset: h,
|
|
3308
3320
|
avoidCollisions: y,
|
|
3309
3321
|
collisionBoundary: b,
|
|
@@ -3318,56 +3330,56 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3318
3330
|
// Telegraph Props
|
|
3319
3331
|
enabled: M = !0,
|
|
3320
3332
|
appearance: w = "dark",
|
|
3321
|
-
triggerRef:
|
|
3333
|
+
triggerRef: O,
|
|
3322
3334
|
children: D
|
|
3323
3335
|
}) => {
|
|
3324
|
-
const [B,
|
|
3336
|
+
const [B, vt] = Rs({
|
|
3325
3337
|
prop: i,
|
|
3326
3338
|
onChange: r,
|
|
3327
3339
|
defaultProp: s ?? !1
|
|
3328
|
-
}), { groupOpen:
|
|
3329
|
-
(
|
|
3330
|
-
),
|
|
3331
|
-
if (
|
|
3340
|
+
}), { groupOpen: wt } = Ia({ open: !!B, delay: t }), St = ht.Children.toArray(D).some(
|
|
3341
|
+
(F) => F.props.disabled
|
|
3342
|
+
), Vt = wt || St ? 0 : t, Ne = !wt, P = (F) => {
|
|
3343
|
+
if (F === "top")
|
|
3332
3344
|
return {
|
|
3333
3345
|
y: -5
|
|
3334
3346
|
};
|
|
3335
|
-
if (
|
|
3347
|
+
if (F === "bottom")
|
|
3336
3348
|
return {
|
|
3337
3349
|
y: 5
|
|
3338
3350
|
};
|
|
3339
|
-
if (
|
|
3351
|
+
if (F === "left")
|
|
3340
3352
|
return {
|
|
3341
3353
|
x: -5
|
|
3342
3354
|
};
|
|
3343
|
-
if (
|
|
3355
|
+
if (F === "right")
|
|
3344
3356
|
return {
|
|
3345
3357
|
x: 5
|
|
3346
3358
|
};
|
|
3347
3359
|
};
|
|
3348
|
-
return /* @__PURE__ */ R(
|
|
3349
|
-
|
|
3360
|
+
return /* @__PURE__ */ R(qr, { features: Pa, children: /* @__PURE__ */ R(
|
|
3361
|
+
ct.Provider,
|
|
3350
3362
|
{
|
|
3351
|
-
delayDuration:
|
|
3363
|
+
delayDuration: Vt,
|
|
3352
3364
|
skipDelayDuration: e,
|
|
3353
3365
|
disableHoverableContent: n,
|
|
3354
|
-
children: /* @__PURE__ */
|
|
3355
|
-
|
|
3366
|
+
children: /* @__PURE__ */ mn(
|
|
3367
|
+
ct.Root,
|
|
3356
3368
|
{
|
|
3357
3369
|
open: M === !1 ? !1 : B,
|
|
3358
|
-
onOpenChange:
|
|
3370
|
+
onOpenChange: vt,
|
|
3359
3371
|
children: [
|
|
3360
|
-
/* @__PURE__ */ R(
|
|
3361
|
-
/* @__PURE__ */ R(
|
|
3362
|
-
|
|
3372
|
+
/* @__PURE__ */ R(ct.Trigger, { asChild: !0, ref: O, children: /* @__PURE__ */ R(ks, { children: D }) }),
|
|
3373
|
+
/* @__PURE__ */ R(ct.Portal, { children: /* @__PURE__ */ R(
|
|
3374
|
+
ct.Content,
|
|
3363
3375
|
{
|
|
3364
3376
|
"aria-label": o,
|
|
3365
3377
|
onEscapeKeyDown: a,
|
|
3366
3378
|
onPointerDownOutside: c,
|
|
3367
3379
|
forceMount: l,
|
|
3368
3380
|
side: u,
|
|
3369
|
-
sideOffset:
|
|
3370
|
-
align:
|
|
3381
|
+
sideOffset: f,
|
|
3382
|
+
align: d,
|
|
3371
3383
|
alignOffset: h,
|
|
3372
3384
|
avoidCollisions: y,
|
|
3373
3385
|
collisionBoundary: b,
|
|
@@ -3378,12 +3390,12 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3378
3390
|
style: {
|
|
3379
3391
|
zIndex: "var(--tgph-zIndex-tooltip)"
|
|
3380
3392
|
},
|
|
3381
|
-
children: /* @__PURE__ */ R(
|
|
3382
|
-
|
|
3393
|
+
children: /* @__PURE__ */ R(Es, { appearance: w, asChild: !0, children: /* @__PURE__ */ R(
|
|
3394
|
+
Ns,
|
|
3383
3395
|
{
|
|
3384
|
-
as:
|
|
3396
|
+
as: Oa,
|
|
3385
3397
|
className: "tgph",
|
|
3386
|
-
initial:
|
|
3398
|
+
initial: Ne && !A ? {
|
|
3387
3399
|
opacity: 0,
|
|
3388
3400
|
scale: 0.5,
|
|
3389
3401
|
...P(u)
|
|
@@ -3409,8 +3421,8 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3409
3421
|
transformOrigin: "var(--radix-tooltip-content-transform-origin)"
|
|
3410
3422
|
},
|
|
3411
3423
|
...V ? { labelProps: V } : {},
|
|
3412
|
-
...
|
|
3413
|
-
children: typeof T == "string" ? /* @__PURE__ */ R(
|
|
3424
|
+
...Da[w],
|
|
3425
|
+
children: typeof T == "string" ? /* @__PURE__ */ R(Ls, { as: "span", size: "1", children: T }) : T
|
|
3414
3426
|
}
|
|
3415
3427
|
) })
|
|
3416
3428
|
}
|
|
@@ -3422,7 +3434,7 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3422
3434
|
) });
|
|
3423
3435
|
};
|
|
3424
3436
|
export {
|
|
3425
|
-
|
|
3426
|
-
|
|
3437
|
+
$a as Tooltip,
|
|
3438
|
+
Wa as TooltipGroupProvider
|
|
3427
3439
|
};
|
|
3428
3440
|
//# sourceMappingURL=index.mjs.map
|