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