@telegraph/tooltip 0.0.52 → 0.0.53
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/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +284 -289
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as R, jsxs as hn } from "react/jsx-runtime";
|
|
2
|
+
import * as ot from "@radix-ui/react-tooltip";
|
|
3
3
|
import { useControllableState as Os } from "@radix-ui/react-use-controllable-state";
|
|
4
4
|
import { OverrideAppearance as Ds } from "@telegraph/appearance";
|
|
5
|
-
import { RefToTgphRef as
|
|
6
|
-
import { Stack as
|
|
5
|
+
import { RefToTgphRef as Is } from "@telegraph/helpers";
|
|
6
|
+
import { Stack as Rs } from "@telegraph/layout";
|
|
7
7
|
import { Text as Es } from "@telegraph/typography";
|
|
8
|
-
import
|
|
8
|
+
import lt, { createContext as Q, useRef as ut, useLayoutEffect as ks, useEffect as ce, useState as Ns, useContext as k, useMemo as It, useCallback as Ls, useInsertionEffect as Bs, forwardRef as Ks, Fragment as pn, createElement as Ws } from "react";
|
|
9
9
|
const $s = Q({});
|
|
10
10
|
function js(t) {
|
|
11
|
-
const e =
|
|
11
|
+
const e = ut(null);
|
|
12
12
|
return e.current === null && (e.current = t()), e.current;
|
|
13
13
|
}
|
|
14
|
-
const le = typeof window < "u",
|
|
15
|
-
function
|
|
14
|
+
const le = typeof window < "u", _s = le ? ks : ce, mn = /* @__PURE__ */ Q(null);
|
|
15
|
+
function Gs(t, e) {
|
|
16
16
|
t.indexOf(e) === -1 && t.push(e);
|
|
17
17
|
}
|
|
18
18
|
function Us(t, e) {
|
|
19
19
|
const n = t.indexOf(e);
|
|
20
20
|
n > -1 && t.splice(n, 1);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
let
|
|
24
|
-
},
|
|
22
|
+
const z = (t, e, n) => n > e ? e : n < t ? t : n;
|
|
23
|
+
let mt = () => {
|
|
24
|
+
}, Y = () => {
|
|
25
25
|
};
|
|
26
|
-
process.env.NODE_ENV !== "production" && (
|
|
26
|
+
process.env.NODE_ENV !== "production" && (mt = (t, e) => {
|
|
27
27
|
!t && typeof console < "u" && console.warn(e);
|
|
28
|
-
},
|
|
28
|
+
}, Y = (t, e) => {
|
|
29
29
|
if (!t)
|
|
30
30
|
throw new Error(e);
|
|
31
31
|
});
|
|
@@ -39,7 +39,7 @@ function fe(t) {
|
|
|
39
39
|
let e;
|
|
40
40
|
return () => (e === void 0 && (e = t()), e);
|
|
41
41
|
}
|
|
42
|
-
const
|
|
42
|
+
const tt = /* @__NO_SIDE_EFFECTS__ */ (t) => t, zs = (t, e) => (n) => e(t(n)), Rt = (...t) => t.reduce(zs), bn = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
|
|
43
43
|
const s = e - t;
|
|
44
44
|
return s === 0 ? 1 : (n - t) / s;
|
|
45
45
|
};
|
|
@@ -48,7 +48,7 @@ class Tn {
|
|
|
48
48
|
this.subscriptions = [];
|
|
49
49
|
}
|
|
50
50
|
add(e) {
|
|
51
|
-
return
|
|
51
|
+
return Gs(this.subscriptions, e), () => Us(this.subscriptions, e);
|
|
52
52
|
}
|
|
53
53
|
notify(e, n, s) {
|
|
54
54
|
const i = this.subscriptions.length;
|
|
@@ -86,12 +86,12 @@ function qs(t, e, n, s, i) {
|
|
|
86
86
|
}
|
|
87
87
|
function gt(t, e, n, s) {
|
|
88
88
|
if (t === e && n === s)
|
|
89
|
-
return
|
|
89
|
+
return tt;
|
|
90
90
|
const i = (r) => qs(r, 0, 1, t, n);
|
|
91
91
|
return (r) => r === 0 || r === 1 ? r : Sn(i(r), e, s);
|
|
92
92
|
}
|
|
93
93
|
const Vn = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, An = (t) => (e) => 1 - t(1 - e), xn = /* @__PURE__ */ gt(0.33, 1.53, 0.69, 0.99), de = /* @__PURE__ */ An(xn), Mn = /* @__PURE__ */ Vn(de), Cn = (t) => (t *= 2) < 1 ? 0.5 * de(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), he = (t) => 1 - Math.sin(Math.acos(t)), Zs = An(he), Pn = Vn(he), Js = /* @__PURE__ */ gt(0.42, 0, 1, 1), Qs = /* @__PURE__ */ gt(0, 0, 0.58, 1), Fn = /* @__PURE__ */ gt(0.42, 0, 0.58, 1), ti = (t) => Array.isArray(t) && typeof t[0] != "number", On = (t) => Array.isArray(t) && typeof t[0] == "number", Ne = {
|
|
94
|
-
linear:
|
|
94
|
+
linear: tt,
|
|
95
95
|
easeIn: Js,
|
|
96
96
|
easeInOut: Fn,
|
|
97
97
|
easeOut: Qs,
|
|
@@ -104,11 +104,11 @@ const Vn = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, An
|
|
|
104
104
|
anticipate: Cn
|
|
105
105
|
}, ei = (t) => typeof t == "string", Le = (t) => {
|
|
106
106
|
if (On(t)) {
|
|
107
|
-
|
|
107
|
+
Y(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
108
108
|
const [e, n, s, i] = t;
|
|
109
109
|
return gt(e, n, s, i);
|
|
110
110
|
} else if (ei(t))
|
|
111
|
-
return
|
|
111
|
+
return Y(Ne[t] !== void 0, `Invalid easing type '${t}'`), Ne[t];
|
|
112
112
|
return t;
|
|
113
113
|
}, St = [
|
|
114
114
|
"setup",
|
|
@@ -187,7 +187,7 @@ function Dn(t, e) {
|
|
|
187
187
|
o[St[A]].cancel(m);
|
|
188
188
|
}, state: i, steps: o };
|
|
189
189
|
}
|
|
190
|
-
const { schedule: N, cancel:
|
|
190
|
+
const { schedule: N, cancel: Ht, state: Mt } = /* @__PURE__ */ Dn(typeof requestAnimationFrame < "u" ? requestAnimationFrame : tt, !0);
|
|
191
191
|
let At;
|
|
192
192
|
function ii() {
|
|
193
193
|
At = void 0;
|
|
@@ -197,17 +197,17 @@ const E = {
|
|
|
197
197
|
set: (t) => {
|
|
198
198
|
At = t, queueMicrotask(ii);
|
|
199
199
|
}
|
|
200
|
-
},
|
|
200
|
+
}, In = (t) => (e) => typeof e == "string" && e.startsWith(t), Rn = /* @__PURE__ */ In("--"), ri = /* @__PURE__ */ In("var(--"), pe = (t) => ri(t) ? oi.test(t.split("/*")[0].trim()) : !1, oi = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, et = {
|
|
201
201
|
test: (t) => typeof t == "number",
|
|
202
202
|
parse: parseFloat,
|
|
203
203
|
transform: (t) => t
|
|
204
|
-
},
|
|
205
|
-
...
|
|
206
|
-
transform: (t) =>
|
|
204
|
+
}, ft = {
|
|
205
|
+
...et,
|
|
206
|
+
transform: (t) => z(0, 1, t)
|
|
207
207
|
}, Vt = {
|
|
208
|
-
...
|
|
208
|
+
...et,
|
|
209
209
|
default: 1
|
|
210
|
-
},
|
|
210
|
+
}, ct = (t) => Math.round(t * 1e5) / 1e5, me = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
211
211
|
function ai(t) {
|
|
212
212
|
return t == null;
|
|
213
213
|
}
|
|
@@ -221,13 +221,13 @@ const ui = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s
|
|
|
221
221
|
[n]: parseFloat(o),
|
|
222
222
|
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
223
223
|
};
|
|
224
|
-
}, ci = (t) =>
|
|
225
|
-
...
|
|
224
|
+
}, ci = (t) => z(0, 255, t), Kt = {
|
|
225
|
+
...et,
|
|
226
226
|
transform: (t) => Math.round(ci(t))
|
|
227
227
|
}, _ = {
|
|
228
228
|
test: /* @__PURE__ */ ge("rgb", "red"),
|
|
229
229
|
parse: /* @__PURE__ */ En("red", "green", "blue"),
|
|
230
|
-
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Kt.transform(t) + ", " + Kt.transform(e) + ", " + Kt.transform(n) + ", " +
|
|
230
|
+
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Kt.transform(t) + ", " + Kt.transform(e) + ", " + Kt.transform(n) + ", " + ct(ft.transform(s)) + ")"
|
|
231
231
|
};
|
|
232
232
|
function li(t) {
|
|
233
233
|
let e = "", n = "", s = "", i = "";
|
|
@@ -238,7 +238,7 @@ function li(t) {
|
|
|
238
238
|
alpha: i ? parseInt(i, 16) / 255 : 1
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const zt = {
|
|
242
242
|
test: /* @__PURE__ */ ge("#"),
|
|
243
243
|
parse: li,
|
|
244
244
|
transform: _.transform
|
|
@@ -253,10 +253,10 @@ const Ht = {
|
|
|
253
253
|
}, X = {
|
|
254
254
|
test: /* @__PURE__ */ ge("hsl", "hue"),
|
|
255
255
|
parse: /* @__PURE__ */ En("hue", "saturation", "lightness"),
|
|
256
|
-
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + Z.transform(
|
|
256
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + Z.transform(ct(e)) + ", " + Z.transform(ct(n)) + ", " + ct(ft.transform(s)) + ")"
|
|
257
257
|
}, C = {
|
|
258
|
-
test: (t) => _.test(t) ||
|
|
259
|
-
parse: (t) => _.test(t) ? _.parse(t) : X.test(t) ? X.parse(t) :
|
|
258
|
+
test: (t) => _.test(t) || zt.test(t) || X.test(t),
|
|
259
|
+
parse: (t) => _.test(t) ? _.parse(t) : X.test(t) ? X.parse(t) : zt.parse(t),
|
|
260
260
|
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? _.transform(t) : X.transform(t),
|
|
261
261
|
getAnimatableNone: (t) => {
|
|
262
262
|
const e = C.parse(t);
|
|
@@ -268,7 +268,7 @@ function pi(t) {
|
|
|
268
268
|
return isNaN(t) && typeof t == "string" && (((e = t.match(me)) == null ? void 0 : e.length) || 0) + (((n = t.match(hi)) == null ? void 0 : n.length) || 0) > 0;
|
|
269
269
|
}
|
|
270
270
|
const kn = "number", Nn = "color", mi = "var", gi = "var(", Ke = "${}", yi = /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;
|
|
271
|
-
function
|
|
271
|
+
function dt(t) {
|
|
272
272
|
const e = t.toString(), n = [], s = {
|
|
273
273
|
color: [],
|
|
274
274
|
number: [],
|
|
@@ -279,16 +279,16 @@ function ht(t) {
|
|
|
279
279
|
return { values: n, split: a, indexes: s, types: i };
|
|
280
280
|
}
|
|
281
281
|
function Ln(t) {
|
|
282
|
-
return
|
|
282
|
+
return dt(t).values;
|
|
283
283
|
}
|
|
284
284
|
function Bn(t) {
|
|
285
|
-
const { split: e, types: n } =
|
|
285
|
+
const { split: e, types: n } = dt(t), s = e.length;
|
|
286
286
|
return (i) => {
|
|
287
287
|
let r = "";
|
|
288
288
|
for (let o = 0; o < s; o++)
|
|
289
289
|
if (r += e[o], i[o] !== void 0) {
|
|
290
290
|
const a = n[o];
|
|
291
|
-
a === kn ? r +=
|
|
291
|
+
a === kn ? r += ct(i[o]) : a === Nn ? r += C.transform(i[o]) : r += i[o];
|
|
292
292
|
}
|
|
293
293
|
return r;
|
|
294
294
|
};
|
|
@@ -298,7 +298,7 @@ function Ti(t) {
|
|
|
298
298
|
const e = Ln(t);
|
|
299
299
|
return Bn(t)(e.map(bi));
|
|
300
300
|
}
|
|
301
|
-
const
|
|
301
|
+
const nt = {
|
|
302
302
|
test: pi,
|
|
303
303
|
parse: Ln,
|
|
304
304
|
createTransformer: Bn,
|
|
@@ -329,10 +329,10 @@ function Ct(t, e) {
|
|
|
329
329
|
const Et = (t, e, n) => t + (e - t) * n, $t = (t, e, n) => {
|
|
330
330
|
const s = t * t, i = n * (e * e - s) + s;
|
|
331
331
|
return i < 0 ? 0 : Math.sqrt(i);
|
|
332
|
-
}, wi = [
|
|
332
|
+
}, wi = [zt, _, X], Si = (t) => wi.find((e) => e.test(t));
|
|
333
333
|
function We(t) {
|
|
334
334
|
const e = Si(t);
|
|
335
|
-
if (
|
|
335
|
+
if (mt(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
336
336
|
return !1;
|
|
337
337
|
let n = e.parse(t);
|
|
338
338
|
return e === X && (n = vi(n)), n;
|
|
@@ -343,9 +343,9 @@ const $e = (t, e) => {
|
|
|
343
343
|
return Ct(t, e);
|
|
344
344
|
const i = { ...n };
|
|
345
345
|
return (r) => (i.red = $t(n.red, s.red, r), i.green = $t(n.green, s.green, r), i.blue = $t(n.blue, s.blue, r), i.alpha = Et(n.alpha, s.alpha, r), _.transform(i));
|
|
346
|
-
},
|
|
346
|
+
}, Yt = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
347
347
|
function Vi(t, e) {
|
|
348
|
-
return
|
|
348
|
+
return Yt.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
349
349
|
}
|
|
350
350
|
function Ai(t, e) {
|
|
351
351
|
return (n) => Et(t, e, n);
|
|
@@ -380,8 +380,8 @@ function Mi(t, e) {
|
|
|
380
380
|
return n;
|
|
381
381
|
}
|
|
382
382
|
const Ci = (t, e) => {
|
|
383
|
-
const n =
|
|
384
|
-
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ?
|
|
383
|
+
const n = nt.createTransformer(e), s = dt(t), i = dt(e);
|
|
384
|
+
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? Yt.has(t) && !i.values.length || Yt.has(e) && !s.values.length ? Vi(t, e) : Rt(Kn(Mi(s, i), i.values), n) : (mt(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), Ct(t, e));
|
|
385
385
|
};
|
|
386
386
|
function Wn(t, e, n) {
|
|
387
387
|
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? Et(t, e, n) : ye(t)(t, e);
|
|
@@ -390,7 +390,7 @@ const Pi = (t) => {
|
|
|
390
390
|
const e = ({ timestamp: n }) => t(n);
|
|
391
391
|
return {
|
|
392
392
|
start: (n = !0) => N.update(e, n),
|
|
393
|
-
stop: () =>
|
|
393
|
+
stop: () => Ht(e),
|
|
394
394
|
/**
|
|
395
395
|
* If we're processing this frame we can use the
|
|
396
396
|
* framelocked timestamp to keep things in sync.
|
|
@@ -453,25 +453,25 @@ const x = {
|
|
|
453
453
|
// in seconds
|
|
454
454
|
minDamping: 0.05,
|
|
455
455
|
maxDamping: 1
|
|
456
|
-
},
|
|
456
|
+
}, jt = 1e-3;
|
|
457
457
|
function Di({ duration: t = x.duration, bounce: e = x.bounce, velocity: n = x.velocity, mass: s = x.mass }) {
|
|
458
458
|
let i, r;
|
|
459
|
-
|
|
459
|
+
mt(t <= /* @__PURE__ */ L(x.maxDuration), "Spring duration must be 10 seconds or less");
|
|
460
460
|
let o = 1 - e;
|
|
461
|
-
o =
|
|
462
|
-
const u = l * o, d = u * t, f = u - n, h =
|
|
463
|
-
return
|
|
461
|
+
o = z(x.minDamping, x.maxDamping, o), t = z(x.minDuration, x.maxDuration, /* @__PURE__ */ K(t)), o < 1 ? (i = (l) => {
|
|
462
|
+
const u = l * o, d = u * t, f = u - n, h = Xt(l, o), y = Math.exp(-d);
|
|
463
|
+
return jt - f / h * y;
|
|
464
464
|
}, r = (l) => {
|
|
465
|
-
const d = l * o * t, f = d * n + n, h = Math.pow(o, 2) * Math.pow(l, 2) * t, y = Math.exp(-d), b =
|
|
466
|
-
return (-i(l) +
|
|
465
|
+
const d = l * o * t, f = d * n + n, h = Math.pow(o, 2) * Math.pow(l, 2) * t, y = Math.exp(-d), b = Xt(Math.pow(l, 2), o);
|
|
466
|
+
return (-i(l) + jt > 0 ? -1 : 1) * ((f - h) * y) / b;
|
|
467
467
|
}) : (i = (l) => {
|
|
468
468
|
const u = Math.exp(-l * t), d = (l - n) * t + 1;
|
|
469
|
-
return -
|
|
469
|
+
return -jt + u * d;
|
|
470
470
|
}, r = (l) => {
|
|
471
471
|
const u = Math.exp(-l * t), d = (n - l) * (t * t);
|
|
472
472
|
return u * d;
|
|
473
473
|
});
|
|
474
|
-
const a = 5 / t, c =
|
|
474
|
+
const a = 5 / t, c = Ri(i, r, a);
|
|
475
475
|
if (t = /* @__PURE__ */ L(t), isNaN(c))
|
|
476
476
|
return {
|
|
477
477
|
stiffness: x.stiffness,
|
|
@@ -487,18 +487,18 @@ function Di({ duration: t = x.duration, bounce: e = x.bounce, velocity: n = x.ve
|
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
const
|
|
491
|
-
function
|
|
490
|
+
const Ii = 12;
|
|
491
|
+
function Ri(t, e, n) {
|
|
492
492
|
let s = n;
|
|
493
|
-
for (let i = 1; i <
|
|
493
|
+
for (let i = 1; i < Ii; i++)
|
|
494
494
|
s = s - t(s) / e(s);
|
|
495
495
|
return s;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function Xt(t, e) {
|
|
498
498
|
return t * Math.sqrt(1 - e * e);
|
|
499
499
|
}
|
|
500
500
|
const Ei = ["duration", "bounce"], ki = ["stiffness", "damping", "mass"];
|
|
501
|
-
function
|
|
501
|
+
function je(t, e) {
|
|
502
502
|
return e.some((n) => t[n] !== void 0);
|
|
503
503
|
}
|
|
504
504
|
function Ni(t) {
|
|
@@ -510,9 +510,9 @@ function Ni(t) {
|
|
|
510
510
|
isResolvedFromDuration: !1,
|
|
511
511
|
...t
|
|
512
512
|
};
|
|
513
|
-
if (!
|
|
513
|
+
if (!je(t, ki) && je(t, Ei))
|
|
514
514
|
if (t.visualDuration) {
|
|
515
|
-
const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 *
|
|
515
|
+
const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * z(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(i);
|
|
516
516
|
e = {
|
|
517
517
|
...e,
|
|
518
518
|
mass: x.mass,
|
|
@@ -543,7 +543,7 @@ function Ft(t = x.visualDuration, e = x.bounce) {
|
|
|
543
543
|
s || (s = S ? x.restSpeed.granular : x.restSpeed.default), i || (i = S ? x.restDelta.granular : x.restDelta.default);
|
|
544
544
|
let m;
|
|
545
545
|
if (b < 1) {
|
|
546
|
-
const T =
|
|
546
|
+
const T = Xt(p, b);
|
|
547
547
|
m = (V) => {
|
|
548
548
|
const M = Math.exp(-b * p * V);
|
|
549
549
|
return o - M * ((y + b * p * v) / T * Math.sin(T * V) + v * Math.cos(T * V));
|
|
@@ -584,7 +584,7 @@ Ft.applyToOptions = (t) => {
|
|
|
584
584
|
const e = Fi(t, 100, Ft);
|
|
585
585
|
return t.ease = e.ease, t.duration = /* @__PURE__ */ L(e.duration), t.type = "keyframes", t;
|
|
586
586
|
};
|
|
587
|
-
function
|
|
587
|
+
function qt({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: c, restDelta: l = 0.5, restSpeed: u }) {
|
|
588
588
|
const d = t[0], f = {
|
|
589
589
|
done: !1,
|
|
590
590
|
value: d
|
|
@@ -621,8 +621,8 @@ function Li(t, e, n) {
|
|
|
621
621
|
for (let o = 0; o < r; o++) {
|
|
622
622
|
let a = i(t[o], t[o + 1]);
|
|
623
623
|
if (e) {
|
|
624
|
-
const c = Array.isArray(e) ? e[o] ||
|
|
625
|
-
a =
|
|
624
|
+
const c = Array.isArray(e) ? e[o] || tt : e;
|
|
625
|
+
a = Rt(c, a);
|
|
626
626
|
}
|
|
627
627
|
s.push(a);
|
|
628
628
|
}
|
|
@@ -630,7 +630,7 @@ function Li(t, e, n) {
|
|
|
630
630
|
}
|
|
631
631
|
function Bi(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
632
632
|
const r = t.length;
|
|
633
|
-
if (
|
|
633
|
+
if (Y(r === e.length, "Both input and output ranges must be the same length"), r === 1)
|
|
634
634
|
return () => e[0];
|
|
635
635
|
if (r === 2 && e[0] === e[1])
|
|
636
636
|
return () => e[1];
|
|
@@ -646,7 +646,7 @@ function Bi(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
|
646
646
|
const f = /* @__PURE__ */ bn(t[d], t[d + 1], u);
|
|
647
647
|
return a[d](f);
|
|
648
648
|
};
|
|
649
|
-
return n ? (u) => l(
|
|
649
|
+
return n ? (u) => l(z(t[0], t[r - 1], u)) : l;
|
|
650
650
|
}
|
|
651
651
|
function Ki(t, e) {
|
|
652
652
|
const n = t[t.length - 1];
|
|
@@ -682,20 +682,20 @@ function q({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" })
|
|
|
682
682
|
next: (c) => (r.value = a(c), r.done = c >= t, r)
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
|
-
const
|
|
685
|
+
const _i = (t) => t !== null;
|
|
686
686
|
function Te(t, { repeat: e, repeatType: n = "loop" }, s, i = 1) {
|
|
687
|
-
const r = t.filter(
|
|
687
|
+
const r = t.filter(_i), a = i < 0 || e && n !== "loop" && e % 2 === 1 ? 0 : r.length - 1;
|
|
688
688
|
return !a || s === void 0 ? r[a] : s;
|
|
689
689
|
}
|
|
690
|
-
const
|
|
691
|
-
decay:
|
|
692
|
-
inertia:
|
|
690
|
+
const Gi = {
|
|
691
|
+
decay: qt,
|
|
692
|
+
inertia: qt,
|
|
693
693
|
tween: q,
|
|
694
694
|
keyframes: q,
|
|
695
695
|
spring: Ft
|
|
696
696
|
};
|
|
697
|
-
function
|
|
698
|
-
typeof t.type == "string" && (t.type =
|
|
697
|
+
function _n(t) {
|
|
698
|
+
typeof t.type == "string" && (t.type = Gi[t.type]);
|
|
699
699
|
}
|
|
700
700
|
class ve {
|
|
701
701
|
constructor() {
|
|
@@ -732,11 +732,11 @@ class we extends ve {
|
|
|
732
732
|
}
|
|
733
733
|
initAnimation() {
|
|
734
734
|
const { options: e } = this;
|
|
735
|
-
|
|
735
|
+
_n(e);
|
|
736
736
|
const { type: n = q, repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = e;
|
|
737
737
|
let { keyframes: a } = e;
|
|
738
738
|
const c = n || q;
|
|
739
|
-
process.env.NODE_ENV !== "production" && c !== q &&
|
|
739
|
+
process.env.NODE_ENV !== "production" && c !== q && Y(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`), c !== q && typeof a[0] != "number" && (this.mixKeyframes = Rt(Ui, Wn(a[0], a[1])), a = [0, 100]);
|
|
740
740
|
const l = c({ ...e, keyframes: a });
|
|
741
741
|
r === "mirror" && (this.mirroredGenerator = c({
|
|
742
742
|
...e,
|
|
@@ -762,14 +762,14 @@ class we extends ve {
|
|
|
762
762
|
if (d) {
|
|
763
763
|
const w = Math.min(this.currentTime, i) / a;
|
|
764
764
|
let F = Math.floor(w), D = w % 1;
|
|
765
|
-
!D && w >= 1 && (D = 1), D === 1 && F--, F = Math.min(F, d + 1), !!(F % 2) && (f === "reverse" ? (D = 1 - D, h && (D -= h / a)) : f === "mirror" && (A = o)), m =
|
|
765
|
+
!D && w >= 1 && (D = 1), D === 1 && F--, F = Math.min(F, d + 1), !!(F % 2) && (f === "reverse" ? (D = 1 - D, h && (D -= h / a)) : f === "mirror" && (A = o)), m = z(0, 1, D) * a;
|
|
766
766
|
}
|
|
767
767
|
const T = S ? { done: !1, value: u[0] } : A.next(m);
|
|
768
768
|
r && (T.value = r(T.value));
|
|
769
769
|
let { done: V } = T;
|
|
770
770
|
!S && c !== null && (V = this.playbackSpeed >= 0 ? this.currentTime >= i : this.currentTime <= 0);
|
|
771
771
|
const M = this.holdTime === null && (this.state === "finished" || this.state === "running" && V);
|
|
772
|
-
return M && y !==
|
|
772
|
+
return M && y !== qt && (T.value = Te(u, this.options, v, this.speed)), b && b(T.value), M && this.finish(), T;
|
|
773
773
|
}
|
|
774
774
|
/**
|
|
775
775
|
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
@@ -838,9 +838,9 @@ function Hi(t) {
|
|
|
838
838
|
for (let e = 1; e < t.length; e++)
|
|
839
839
|
t[e] ?? (t[e] = t[e - 1]);
|
|
840
840
|
}
|
|
841
|
-
const
|
|
842
|
-
const e =
|
|
843
|
-
return
|
|
841
|
+
const G = (t) => t * 180 / Math.PI, Zt = (t) => {
|
|
842
|
+
const e = G(Math.atan2(t[1], t[0]));
|
|
843
|
+
return Jt(e);
|
|
844
844
|
}, zi = {
|
|
845
845
|
x: 4,
|
|
846
846
|
y: 5,
|
|
@@ -849,35 +849,35 @@ const U = (t) => t * 180 / Math.PI, qt = (t) => {
|
|
|
849
849
|
scaleX: 0,
|
|
850
850
|
scaleY: 3,
|
|
851
851
|
scale: (t) => (Math.abs(t[0]) + Math.abs(t[3])) / 2,
|
|
852
|
-
rotate:
|
|
853
|
-
rotateZ:
|
|
854
|
-
skewX: (t) =>
|
|
855
|
-
skewY: (t) =>
|
|
852
|
+
rotate: Zt,
|
|
853
|
+
rotateZ: Zt,
|
|
854
|
+
skewX: (t) => G(Math.atan(t[1])),
|
|
855
|
+
skewY: (t) => G(Math.atan(t[2])),
|
|
856
856
|
skew: (t) => (Math.abs(t[1]) + Math.abs(t[2])) / 2
|
|
857
|
-
},
|
|
857
|
+
}, Jt = (t) => (t = t % 360, t < 0 && (t += 360), t), _e = Zt, Ge = (t) => Math.sqrt(t[0] * t[0] + t[1] * t[1]), Ue = (t) => Math.sqrt(t[4] * t[4] + t[5] * t[5]), Yi = {
|
|
858
858
|
x: 12,
|
|
859
859
|
y: 13,
|
|
860
860
|
z: 14,
|
|
861
861
|
translateX: 12,
|
|
862
862
|
translateY: 13,
|
|
863
863
|
translateZ: 14,
|
|
864
|
-
scaleX:
|
|
865
|
-
scaleY:
|
|
866
|
-
scale: (t) => (
|
|
867
|
-
rotateX: (t) =>
|
|
868
|
-
rotateY: (t) =>
|
|
864
|
+
scaleX: Ge,
|
|
865
|
+
scaleY: Ue,
|
|
866
|
+
scale: (t) => (Ge(t) + Ue(t)) / 2,
|
|
867
|
+
rotateX: (t) => Jt(G(Math.atan2(t[6], t[5]))),
|
|
868
|
+
rotateY: (t) => Jt(G(Math.atan2(-t[2], t[0]))),
|
|
869
869
|
rotateZ: _e,
|
|
870
870
|
rotate: _e,
|
|
871
|
-
skewX: (t) =>
|
|
872
|
-
skewY: (t) =>
|
|
871
|
+
skewX: (t) => G(Math.atan(t[4])),
|
|
872
|
+
skewY: (t) => G(Math.atan(t[1])),
|
|
873
873
|
skew: (t) => (Math.abs(t[1]) + Math.abs(t[4])) / 2
|
|
874
874
|
};
|
|
875
|
-
function
|
|
875
|
+
function Qt(t) {
|
|
876
876
|
return t.includes("scale") ? 1 : 0;
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function te(t, e) {
|
|
879
879
|
if (!t || t === "none")
|
|
880
|
-
return
|
|
880
|
+
return Qt(e);
|
|
881
881
|
const n = t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
|
|
882
882
|
let s, i;
|
|
883
883
|
if (n)
|
|
@@ -887,18 +887,18 @@ function Qt(t, e) {
|
|
|
887
887
|
s = zi, i = a;
|
|
888
888
|
}
|
|
889
889
|
if (!i)
|
|
890
|
-
return
|
|
890
|
+
return Qt(e);
|
|
891
891
|
const r = s[e], o = i[1].split(",").map(qi);
|
|
892
892
|
return typeof r == "function" ? r(o) : o[r];
|
|
893
893
|
}
|
|
894
894
|
const Xi = (t, e) => {
|
|
895
895
|
const { transform: n = "none" } = getComputedStyle(t);
|
|
896
|
-
return
|
|
896
|
+
return te(n, e);
|
|
897
897
|
};
|
|
898
898
|
function qi(t) {
|
|
899
899
|
return parseFloat(t.trim());
|
|
900
900
|
}
|
|
901
|
-
const
|
|
901
|
+
const st = [
|
|
902
902
|
"transformPerspective",
|
|
903
903
|
"x",
|
|
904
904
|
"y",
|
|
@@ -916,7 +916,7 @@ const it = [
|
|
|
916
916
|
"skew",
|
|
917
917
|
"skewX",
|
|
918
918
|
"skewY"
|
|
919
|
-
],
|
|
919
|
+
], it = new Set(st), He = (t) => t === et || t === g, Zi = /* @__PURE__ */ new Set(["x", "y", "z"]), Ji = st.filter((t) => !Zi.has(t));
|
|
920
920
|
function Qi(t) {
|
|
921
921
|
const e = [];
|
|
922
922
|
return Ji.forEach((n) => {
|
|
@@ -924,7 +924,7 @@ function Qi(t) {
|
|
|
924
924
|
s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
925
925
|
}), e;
|
|
926
926
|
}
|
|
927
|
-
const
|
|
927
|
+
const U = {
|
|
928
928
|
// Dimensions
|
|
929
929
|
width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
930
930
|
height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
@@ -933,16 +933,16 @@ const H = {
|
|
|
933
933
|
bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
|
|
934
934
|
right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
|
|
935
935
|
// Transform
|
|
936
|
-
x: (t, { transform: e }) =>
|
|
937
|
-
y: (t, { transform: e }) =>
|
|
936
|
+
x: (t, { transform: e }) => te(e, "x"),
|
|
937
|
+
y: (t, { transform: e }) => te(e, "y")
|
|
938
938
|
};
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
const
|
|
942
|
-
let
|
|
943
|
-
function
|
|
944
|
-
if (
|
|
945
|
-
const t = Array.from(
|
|
939
|
+
U.translateX = U.x;
|
|
940
|
+
U.translateY = U.y;
|
|
941
|
+
const H = /* @__PURE__ */ new Set();
|
|
942
|
+
let ee = !1, ne = !1, se = !1;
|
|
943
|
+
function Gn() {
|
|
944
|
+
if (ne) {
|
|
945
|
+
const t = Array.from(H).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
946
946
|
e.forEach((s) => {
|
|
947
947
|
const i = Qi(s);
|
|
948
948
|
i.length && (n.set(s, i), s.render());
|
|
@@ -957,22 +957,22 @@ function _n() {
|
|
|
957
957
|
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
|
|
958
958
|
});
|
|
959
959
|
}
|
|
960
|
-
|
|
960
|
+
ne = !1, ee = !1, H.forEach((t) => t.complete(se)), H.clear();
|
|
961
961
|
}
|
|
962
962
|
function Un() {
|
|
963
|
-
|
|
964
|
-
t.readKeyframes(), t.needsMeasurement && (
|
|
963
|
+
H.forEach((t) => {
|
|
964
|
+
t.readKeyframes(), t.needsMeasurement && (ne = !0);
|
|
965
965
|
});
|
|
966
966
|
}
|
|
967
967
|
function tr() {
|
|
968
|
-
|
|
968
|
+
se = !0, Un(), Gn(), se = !1;
|
|
969
969
|
}
|
|
970
970
|
class Se {
|
|
971
971
|
constructor(e, n, s, i, r, o = !1) {
|
|
972
972
|
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = o;
|
|
973
973
|
}
|
|
974
974
|
scheduleResolve() {
|
|
975
|
-
this.state = "scheduled", this.isAsync ? (
|
|
975
|
+
this.state = "scheduled", this.isAsync ? (H.add(this), ee || (ee = !0, N.read(Un), N.resolveKeyframes(Gn))) : (this.readKeyframes(), this.complete());
|
|
976
976
|
}
|
|
977
977
|
readKeyframes() {
|
|
978
978
|
const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
|
|
@@ -997,10 +997,10 @@ class Se {
|
|
|
997
997
|
measureEndState() {
|
|
998
998
|
}
|
|
999
999
|
complete(e = !1) {
|
|
1000
|
-
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e),
|
|
1000
|
+
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e), H.delete(this);
|
|
1001
1001
|
}
|
|
1002
1002
|
cancel() {
|
|
1003
|
-
this.state === "scheduled" && (
|
|
1003
|
+
this.state === "scheduled" && (H.delete(this), this.state = "pending");
|
|
1004
1004
|
}
|
|
1005
1005
|
resume() {
|
|
1006
1006
|
this.state === "pending" && this.scheduleResolve();
|
|
@@ -1022,20 +1022,20 @@ const Hn = /* @__PURE__ */ rr(() => {
|
|
|
1022
1022
|
return !1;
|
|
1023
1023
|
}
|
|
1024
1024
|
return !0;
|
|
1025
|
-
}, "linearEasing"),
|
|
1025
|
+
}, "linearEasing"), at = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, ze = {
|
|
1026
1026
|
linear: "linear",
|
|
1027
1027
|
ease: "ease",
|
|
1028
1028
|
easeIn: "ease-in",
|
|
1029
1029
|
easeOut: "ease-out",
|
|
1030
1030
|
easeInOut: "ease-in-out",
|
|
1031
|
-
circIn: /* @__PURE__ */
|
|
1032
|
-
circOut: /* @__PURE__ */
|
|
1033
|
-
backIn: /* @__PURE__ */
|
|
1034
|
-
backOut: /* @__PURE__ */
|
|
1031
|
+
circIn: /* @__PURE__ */ at([0, 0.65, 0.55, 1]),
|
|
1032
|
+
circOut: /* @__PURE__ */ at([0.55, 0, 1, 0.45]),
|
|
1033
|
+
backIn: /* @__PURE__ */ at([0.31, 0.01, 0.66, -0.59]),
|
|
1034
|
+
backOut: /* @__PURE__ */ at([0.33, 1.53, 0.69, 0.99])
|
|
1035
1035
|
};
|
|
1036
1036
|
function zn(t, e) {
|
|
1037
1037
|
if (t)
|
|
1038
|
-
return typeof t == "function" ? Hn() ? $n(t, e) : "ease-out" : On(t) ?
|
|
1038
|
+
return typeof t == "function" ? Hn() ? $n(t, e) : "ease-out" : On(t) ? at(t) : Array.isArray(t) ? t.map((n) => zn(n, e) || ze.easeOut) : ze[t];
|
|
1039
1039
|
}
|
|
1040
1040
|
function or(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a = "easeOut", times: c } = {}, l = void 0) {
|
|
1041
1041
|
const u = {
|
|
@@ -1065,7 +1065,7 @@ class ur extends ve {
|
|
|
1065
1065
|
if (super(), this.finishedTime = null, this.isStopped = !1, !e)
|
|
1066
1066
|
return;
|
|
1067
1067
|
const { element: n, name: s, keyframes: i, pseudoElement: r, allowFlatten: o = !1, finalKeyframe: a, onComplete: c } = e;
|
|
1068
|
-
this.isPseudoElement = !!r, this.allowFlatten = o, this.options = e,
|
|
1068
|
+
this.isPseudoElement = !!r, this.allowFlatten = o, this.options = e, Y(typeof e.type != "string", `animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);
|
|
1069
1069
|
const l = ar(e);
|
|
1070
1070
|
this.animation = or(n, s, i, l, r), l.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
|
|
1071
1071
|
if (this.finishedTime = this.time, !r) {
|
|
@@ -1149,7 +1149,7 @@ class ur extends ve {
|
|
|
1149
1149
|
*/
|
|
1150
1150
|
attachTimeline({ timeline: e, observe: n }) {
|
|
1151
1151
|
var s;
|
|
1152
|
-
return this.allowFlatten && ((s = this.animation.effect) == null || s.updateTiming({ easing: "linear" })), this.animation.onfinish = null, e && sr() ? (this.animation.timeline = e,
|
|
1152
|
+
return this.allowFlatten && ((s = this.animation.effect) == null || s.updateTiming({ easing: "linear" })), this.animation.onfinish = null, e && sr() ? (this.animation.timeline = e, tt) : n(this);
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
1155
|
const Xn = {
|
|
@@ -1163,10 +1163,10 @@ function cr(t) {
|
|
|
1163
1163
|
function lr(t) {
|
|
1164
1164
|
typeof t.ease == "string" && cr(t.ease) && (t.ease = Xn[t.ease]);
|
|
1165
1165
|
}
|
|
1166
|
-
const
|
|
1166
|
+
const Ye = 10;
|
|
1167
1167
|
class fr extends ur {
|
|
1168
1168
|
constructor(e) {
|
|
1169
|
-
lr(e),
|
|
1169
|
+
lr(e), _n(e), super(e), e.startTime && (this.startTime = e.startTime), this.options = e;
|
|
1170
1170
|
}
|
|
1171
1171
|
/**
|
|
1172
1172
|
* WAAPI doesn't natively have any interruption capabilities.
|
|
@@ -1188,11 +1188,11 @@ class fr extends ur {
|
|
|
1188
1188
|
...o,
|
|
1189
1189
|
autoplay: !1
|
|
1190
1190
|
}), c = /* @__PURE__ */ L(this.finishedTime ?? this.time);
|
|
1191
|
-
n.setWithVelocity(a.sample(c -
|
|
1191
|
+
n.setWithVelocity(a.sample(c - Ye).value, a.sample(c).value, Ye), a.stop();
|
|
1192
1192
|
}
|
|
1193
1193
|
}
|
|
1194
|
-
const
|
|
1195
|
-
(
|
|
1194
|
+
const Xe = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
|
|
1195
|
+
(nt.test(t) || t === "0") && // And it contains numbers and/or colors
|
|
1196
1196
|
!t.startsWith("url("));
|
|
1197
1197
|
function dr(t) {
|
|
1198
1198
|
const e = t[0];
|
|
@@ -1208,8 +1208,8 @@ function hr(t, e, n, s) {
|
|
|
1208
1208
|
return !1;
|
|
1209
1209
|
if (e === "display" || e === "visibility")
|
|
1210
1210
|
return !0;
|
|
1211
|
-
const r = t[t.length - 1], o =
|
|
1212
|
-
return
|
|
1211
|
+
const r = t[t.length - 1], o = Xe(i, e), a = Xe(r, e);
|
|
1212
|
+
return mt(o === a, `You are trying to animate ${e} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`), !o || !a ? !1 : dr(t) || (n === "spring" || Yn(n)) && s;
|
|
1213
1213
|
}
|
|
1214
1214
|
function qn(t) {
|
|
1215
1215
|
return Hs(t) && "offsetHeight" in t;
|
|
@@ -1269,7 +1269,7 @@ class br extends ve {
|
|
|
1269
1269
|
...f,
|
|
1270
1270
|
element: f.motionValue.owner.current
|
|
1271
1271
|
}) : new we(f);
|
|
1272
|
-
h.finished.then(() => this.notifyFinished()).catch(
|
|
1272
|
+
h.finished.then(() => this.notifyFinished()).catch(tt), this.pendingTimeline && (this.stopTimeline = h.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = h;
|
|
1273
1273
|
}
|
|
1274
1274
|
get finished() {
|
|
1275
1275
|
return this._animation ? this.animation.finished : this._finished;
|
|
@@ -1333,7 +1333,7 @@ function vr(t) {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
const wr = 4;
|
|
1335
1335
|
function Zn(t, e, n = 1) {
|
|
1336
|
-
|
|
1336
|
+
Y(n <= wr, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
|
|
1337
1337
|
const [s, i] = vr(t);
|
|
1338
1338
|
if (!s)
|
|
1339
1339
|
return;
|
|
@@ -1354,11 +1354,11 @@ const Qn = /* @__PURE__ */ new Set([
|
|
|
1354
1354
|
"left",
|
|
1355
1355
|
"right",
|
|
1356
1356
|
"bottom",
|
|
1357
|
-
...
|
|
1357
|
+
...st
|
|
1358
1358
|
]), Sr = {
|
|
1359
1359
|
test: (t) => t === "auto",
|
|
1360
1360
|
parse: (t) => t
|
|
1361
|
-
}, ts = (t) => (e) => e.test(t), es = [
|
|
1361
|
+
}, ts = (t) => (e) => e.test(t), es = [et, g, Z, $, di, fi, Sr], qe = (t) => es.find(ts(t));
|
|
1362
1362
|
function Vr(t) {
|
|
1363
1363
|
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || yn(t) : !0;
|
|
1364
1364
|
}
|
|
@@ -1374,14 +1374,14 @@ function xr(t) {
|
|
|
1374
1374
|
let r = Ar.has(e) ? 1 : 0;
|
|
1375
1375
|
return s !== n && (r *= 100), e + "(" + r + i + ")";
|
|
1376
1376
|
}
|
|
1377
|
-
const Mr = /\b([a-z-]*)\(.*?\)/gu,
|
|
1378
|
-
...
|
|
1377
|
+
const Mr = /\b([a-z-]*)\(.*?\)/gu, ie = {
|
|
1378
|
+
...nt,
|
|
1379
1379
|
getAnimatableNone: (t) => {
|
|
1380
1380
|
const e = t.match(Mr);
|
|
1381
1381
|
return e ? e.map(xr).join(" ") : t;
|
|
1382
1382
|
}
|
|
1383
|
-
},
|
|
1384
|
-
...
|
|
1383
|
+
}, Ze = {
|
|
1384
|
+
...et,
|
|
1385
1385
|
transform: Math.round
|
|
1386
1386
|
}, Cr = {
|
|
1387
1387
|
rotate: $,
|
|
@@ -1404,7 +1404,7 @@ const Mr = /\b([a-z-]*)\(.*?\)/gu, se = {
|
|
|
1404
1404
|
z: g,
|
|
1405
1405
|
perspective: g,
|
|
1406
1406
|
transformPerspective: g,
|
|
1407
|
-
opacity:
|
|
1407
|
+
opacity: ft,
|
|
1408
1408
|
originX: Be,
|
|
1409
1409
|
originY: Be,
|
|
1410
1410
|
originZ: g
|
|
@@ -1445,11 +1445,11 @@ const Mr = /\b([a-z-]*)\(.*?\)/gu, se = {
|
|
|
1445
1445
|
backgroundPositionX: g,
|
|
1446
1446
|
backgroundPositionY: g,
|
|
1447
1447
|
...Cr,
|
|
1448
|
-
zIndex:
|
|
1448
|
+
zIndex: Ze,
|
|
1449
1449
|
// SVG
|
|
1450
|
-
fillOpacity:
|
|
1451
|
-
strokeOpacity:
|
|
1452
|
-
numOctaves:
|
|
1450
|
+
fillOpacity: ft,
|
|
1451
|
+
strokeOpacity: ft,
|
|
1452
|
+
numOctaves: Ze
|
|
1453
1453
|
}, Pr = {
|
|
1454
1454
|
...Ve,
|
|
1455
1455
|
// Color props
|
|
@@ -1464,19 +1464,19 @@ const Mr = /\b([a-z-]*)\(.*?\)/gu, se = {
|
|
|
1464
1464
|
borderRightColor: C,
|
|
1465
1465
|
borderBottomColor: C,
|
|
1466
1466
|
borderLeftColor: C,
|
|
1467
|
-
filter:
|
|
1468
|
-
WebkitFilter:
|
|
1467
|
+
filter: ie,
|
|
1468
|
+
WebkitFilter: ie
|
|
1469
1469
|
}, ns = (t) => Pr[t];
|
|
1470
1470
|
function ss(t, e) {
|
|
1471
1471
|
let n = ns(t);
|
|
1472
|
-
return n !==
|
|
1472
|
+
return n !== ie && (n = nt), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
1473
1473
|
}
|
|
1474
1474
|
const Fr = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
1475
1475
|
function Or(t, e, n) {
|
|
1476
1476
|
let s = 0, i;
|
|
1477
1477
|
for (; s < t.length && !i; ) {
|
|
1478
1478
|
const r = t[s];
|
|
1479
|
-
typeof r == "string" && !Fr.has(r) &&
|
|
1479
|
+
typeof r == "string" && !Fr.has(r) && dt(r).values.length && (i = t[s]), s++;
|
|
1480
1480
|
}
|
|
1481
1481
|
if (i && n)
|
|
1482
1482
|
for (const r of e)
|
|
@@ -1500,14 +1500,14 @@ class Dr extends Se {
|
|
|
1500
1500
|
}
|
|
1501
1501
|
if (this.resolveNoneKeyframes(), !Qn.has(s) || e.length !== 2)
|
|
1502
1502
|
return;
|
|
1503
|
-
const [i, r] = e, o =
|
|
1503
|
+
const [i, r] = e, o = qe(i), a = qe(r);
|
|
1504
1504
|
if (o !== a)
|
|
1505
|
-
if (
|
|
1505
|
+
if (He(o) && He(a))
|
|
1506
1506
|
for (let c = 0; c < e.length; c++) {
|
|
1507
1507
|
const l = e[c];
|
|
1508
1508
|
typeof l == "string" && (e[c] = parseFloat(l));
|
|
1509
1509
|
}
|
|
1510
|
-
else
|
|
1510
|
+
else U[s] && (this.needsMeasurement = !0);
|
|
1511
1511
|
}
|
|
1512
1512
|
resolveNoneKeyframes() {
|
|
1513
1513
|
const { unresolvedKeyframes: e, name: n } = this, s = [];
|
|
@@ -1519,7 +1519,7 @@ class Dr extends Se {
|
|
|
1519
1519
|
const { element: e, unresolvedKeyframes: n, name: s } = this;
|
|
1520
1520
|
if (!e || !e.current)
|
|
1521
1521
|
return;
|
|
1522
|
-
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin =
|
|
1522
|
+
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = U[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
|
|
1523
1523
|
const i = n[n.length - 1];
|
|
1524
1524
|
i !== void 0 && e.getValue(s, i).jump(i, !1);
|
|
1525
1525
|
}
|
|
@@ -1531,21 +1531,22 @@ class Dr extends Se {
|
|
|
1531
1531
|
const i = e.getValue(n);
|
|
1532
1532
|
i && i.jump(this.measuredOrigin, !1);
|
|
1533
1533
|
const r = s.length - 1, o = s[r];
|
|
1534
|
-
s[r] =
|
|
1534
|
+
s[r] = U[n](e.measureViewportBox(), window.getComputedStyle(e.current)), o !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = o), (a = this.removedTransforms) != null && a.length && this.removedTransforms.forEach(([c, l]) => {
|
|
1535
1535
|
e.getValue(c).set(l);
|
|
1536
1536
|
}), this.resolveNoneKeyframes();
|
|
1537
1537
|
}
|
|
1538
1538
|
}
|
|
1539
|
-
function
|
|
1539
|
+
function Ir(t, e, n) {
|
|
1540
1540
|
if (t instanceof EventTarget)
|
|
1541
1541
|
return [t];
|
|
1542
1542
|
if (typeof t == "string") {
|
|
1543
|
-
|
|
1543
|
+
let s = document;
|
|
1544
|
+
const i = (n == null ? void 0 : n[t]) ?? s.querySelectorAll(t);
|
|
1544
1545
|
return i ? Array.from(i) : [];
|
|
1545
1546
|
}
|
|
1546
1547
|
return Array.from(t);
|
|
1547
1548
|
}
|
|
1548
|
-
const is = (t, e) => e && typeof t == "number" ? e.transform(t) : t,
|
|
1549
|
+
const is = (t, e) => e && typeof t == "number" ? e.transform(t) : t, Je = 30, Rr = (t) => !isNaN(parseFloat(t));
|
|
1549
1550
|
class Er {
|
|
1550
1551
|
/**
|
|
1551
1552
|
* @param init - The initiating value
|
|
@@ -1564,7 +1565,7 @@ class Er {
|
|
|
1564
1565
|
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
|
|
1565
1566
|
}
|
|
1566
1567
|
setCurrent(e) {
|
|
1567
|
-
this.current = e, this.updatedAt = E.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity =
|
|
1568
|
+
this.current = e, this.updatedAt = E.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = Rr(this.current));
|
|
1568
1569
|
}
|
|
1569
1570
|
setPrevFrameValue(e = this.current) {
|
|
1570
1571
|
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -1694,9 +1695,9 @@ class Er {
|
|
|
1694
1695
|
*/
|
|
1695
1696
|
getVelocity() {
|
|
1696
1697
|
const e = E.now();
|
|
1697
|
-
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt >
|
|
1698
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Je)
|
|
1698
1699
|
return 0;
|
|
1699
|
-
const n = Math.min(this.updatedAt - this.prevUpdatedAt,
|
|
1700
|
+
const n = Math.min(this.updatedAt - this.prevUpdatedAt, Je);
|
|
1700
1701
|
return vn(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1701
1702
|
}
|
|
1702
1703
|
/**
|
|
@@ -1752,33 +1753,32 @@ class Er {
|
|
|
1752
1753
|
function Ot(t, e) {
|
|
1753
1754
|
return new Er(t, e);
|
|
1754
1755
|
}
|
|
1755
|
-
const { schedule: kr
|
|
1756
|
-
x: !1,
|
|
1756
|
+
const { schedule: kr } = /* @__PURE__ */ Dn(queueMicrotask, !1), Nr = {
|
|
1757
1757
|
y: !1
|
|
1758
1758
|
};
|
|
1759
1759
|
function Lr() {
|
|
1760
1760
|
return Nr.y;
|
|
1761
1761
|
}
|
|
1762
1762
|
function rs(t, e) {
|
|
1763
|
-
const n =
|
|
1763
|
+
const n = Ir(t), s = new AbortController(), i = {
|
|
1764
1764
|
passive: !0,
|
|
1765
1765
|
...e,
|
|
1766
1766
|
signal: s.signal
|
|
1767
1767
|
};
|
|
1768
1768
|
return [n, i, () => s.abort()];
|
|
1769
1769
|
}
|
|
1770
|
-
function
|
|
1770
|
+
function Qe(t) {
|
|
1771
1771
|
return !(t.pointerType === "touch" || Lr());
|
|
1772
1772
|
}
|
|
1773
1773
|
function Br(t, e, n = {}) {
|
|
1774
1774
|
const [s, i, r] = rs(t, n), o = (a) => {
|
|
1775
|
-
if (!
|
|
1775
|
+
if (!Qe(a))
|
|
1776
1776
|
return;
|
|
1777
1777
|
const { target: c } = a, l = e(c, a);
|
|
1778
1778
|
if (typeof l != "function" || !c)
|
|
1779
1779
|
return;
|
|
1780
1780
|
const u = (d) => {
|
|
1781
|
-
|
|
1781
|
+
Qe(d) && (l(d), c.removeEventListener("pointerleave", u));
|
|
1782
1782
|
};
|
|
1783
1783
|
c.addEventListener("pointerleave", u, i);
|
|
1784
1784
|
};
|
|
@@ -1797,40 +1797,40 @@ function $r(t) {
|
|
|
1797
1797
|
return Wr.has(t.tagName) || t.tabIndex !== -1;
|
|
1798
1798
|
}
|
|
1799
1799
|
const xt = /* @__PURE__ */ new WeakSet();
|
|
1800
|
-
function
|
|
1800
|
+
function tn(t) {
|
|
1801
1801
|
return (e) => {
|
|
1802
1802
|
e.key === "Enter" && t(e);
|
|
1803
1803
|
};
|
|
1804
1804
|
}
|
|
1805
|
-
function
|
|
1805
|
+
function _t(t, e) {
|
|
1806
1806
|
t.dispatchEvent(new PointerEvent("pointer" + e, { isPrimary: !0, bubbles: !0 }));
|
|
1807
1807
|
}
|
|
1808
1808
|
const jr = (t, e) => {
|
|
1809
1809
|
const n = t.currentTarget;
|
|
1810
1810
|
if (!n)
|
|
1811
1811
|
return;
|
|
1812
|
-
const s =
|
|
1812
|
+
const s = tn(() => {
|
|
1813
1813
|
if (xt.has(n))
|
|
1814
1814
|
return;
|
|
1815
|
-
|
|
1816
|
-
const i =
|
|
1817
|
-
|
|
1818
|
-
}), r = () =>
|
|
1815
|
+
_t(n, "down");
|
|
1816
|
+
const i = tn(() => {
|
|
1817
|
+
_t(n, "up");
|
|
1818
|
+
}), r = () => _t(n, "cancel");
|
|
1819
1819
|
n.addEventListener("keyup", i, e), n.addEventListener("blur", r, e);
|
|
1820
1820
|
});
|
|
1821
1821
|
n.addEventListener("keydown", s, e), n.addEventListener("blur", () => n.removeEventListener("keydown", s), e);
|
|
1822
1822
|
};
|
|
1823
|
-
function
|
|
1823
|
+
function en(t) {
|
|
1824
1824
|
return Kr(t) && !0;
|
|
1825
1825
|
}
|
|
1826
|
-
function
|
|
1826
|
+
function _r(t, e, n = {}) {
|
|
1827
1827
|
const [s, i, r] = rs(t, n), o = (a) => {
|
|
1828
1828
|
const c = a.currentTarget;
|
|
1829
|
-
if (!
|
|
1829
|
+
if (!en(a))
|
|
1830
1830
|
return;
|
|
1831
1831
|
xt.add(c);
|
|
1832
1832
|
const l = e(c, a), u = (h, y) => {
|
|
1833
|
-
window.removeEventListener("pointerup", d), window.removeEventListener("pointercancel", f), xt.has(c) && xt.delete(c),
|
|
1833
|
+
window.removeEventListener("pointerup", d), window.removeEventListener("pointercancel", f), xt.has(c) && xt.delete(c), en(h) && typeof l == "function" && l(h, { success: y });
|
|
1834
1834
|
}, d = (h) => {
|
|
1835
1835
|
u(h, c === window || c === document || n.useGlobalTarget || os(c, h.target));
|
|
1836
1836
|
}, f = (h) => {
|
|
@@ -1842,11 +1842,11 @@ function Gr(t, e, n = {}) {
|
|
|
1842
1842
|
(n.useGlobalTarget ? window : a).addEventListener("pointerdown", o, i), qn(a) && (a.addEventListener("focus", (l) => jr(l, i)), !$r(a) && !a.hasAttribute("tabindex") && (a.tabIndex = 0));
|
|
1843
1843
|
}), r;
|
|
1844
1844
|
}
|
|
1845
|
-
const
|
|
1845
|
+
const I = (t) => !!(t && t.getVelocity), Gr = [...es, C, nt], Ur = (t) => Gr.find(ts(t)), as = Q({
|
|
1846
1846
|
transformPagePoint: (t) => t,
|
|
1847
1847
|
isStatic: !1,
|
|
1848
1848
|
reducedMotion: "never"
|
|
1849
|
-
}), Ae = Q({ strict: !1 }),
|
|
1849
|
+
}), Ae = Q({ strict: !1 }), nn = {
|
|
1850
1850
|
animation: [
|
|
1851
1851
|
"animate",
|
|
1852
1852
|
"variants",
|
|
@@ -1866,11 +1866,11 @@ const R = (t) => !!(t && t.getVelocity), _r = [...es, C, st], Ur = (t) => _r.fin
|
|
|
1866
1866
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
1867
1867
|
layout: ["layout", "layoutId"]
|
|
1868
1868
|
}, J = {};
|
|
1869
|
-
for (const t in
|
|
1869
|
+
for (const t in nn)
|
|
1870
1870
|
J[t] = {
|
|
1871
|
-
isEnabled: (e) =>
|
|
1871
|
+
isEnabled: (e) => nn[t].some((n) => !!e[n])
|
|
1872
1872
|
};
|
|
1873
|
-
function
|
|
1873
|
+
function sn(t) {
|
|
1874
1874
|
for (const e in t)
|
|
1875
1875
|
J[e] = {
|
|
1876
1876
|
...J[e],
|
|
@@ -1878,16 +1878,16 @@ function ie(t) {
|
|
|
1878
1878
|
};
|
|
1879
1879
|
}
|
|
1880
1880
|
function Hr({ children: t, features: e, strict: n = !1 }) {
|
|
1881
|
-
const [, s] = Ns(!Gt(e)), i =
|
|
1881
|
+
const [, s] = Ns(!Gt(e)), i = ut(void 0);
|
|
1882
1882
|
if (!Gt(e)) {
|
|
1883
1883
|
const { renderer: r, ...o } = e;
|
|
1884
|
-
i.current = r,
|
|
1884
|
+
i.current = r, sn(o);
|
|
1885
1885
|
}
|
|
1886
1886
|
return ce(() => {
|
|
1887
1887
|
Gt(e) && e().then(({ renderer: r, ...o }) => {
|
|
1888
|
-
|
|
1888
|
+
sn(o), i.current = r, s(!0);
|
|
1889
1889
|
});
|
|
1890
|
-
}, []),
|
|
1890
|
+
}, []), R(Ae.Provider, { value: { renderer: i.current, strict: n }, children: t });
|
|
1891
1891
|
}
|
|
1892
1892
|
function Gt(t) {
|
|
1893
1893
|
return typeof t == "function";
|
|
@@ -1946,7 +1946,7 @@ const kt = /* @__PURE__ */ Q({});
|
|
|
1946
1946
|
function Nt(t) {
|
|
1947
1947
|
return t !== null && typeof t == "object" && typeof t.start == "function";
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1949
|
+
function ht(t) {
|
|
1950
1950
|
return typeof t == "string" || Array.isArray(t);
|
|
1951
1951
|
}
|
|
1952
1952
|
const xe = [
|
|
@@ -1959,7 +1959,7 @@ const xe = [
|
|
|
1959
1959
|
"exit"
|
|
1960
1960
|
], Me = ["initial", ...xe];
|
|
1961
1961
|
function Lt(t) {
|
|
1962
|
-
return Nt(t.animate) || Me.some((e) =>
|
|
1962
|
+
return Nt(t.animate) || Me.some((e) => ht(t[e]));
|
|
1963
1963
|
}
|
|
1964
1964
|
function cs(t) {
|
|
1965
1965
|
return !!(Lt(t) || t.variants);
|
|
@@ -1968,15 +1968,15 @@ function qr(t, e) {
|
|
|
1968
1968
|
if (Lt(t)) {
|
|
1969
1969
|
const { initial: n, animate: s } = t;
|
|
1970
1970
|
return {
|
|
1971
|
-
initial: n === !1 ||
|
|
1972
|
-
animate:
|
|
1971
|
+
initial: n === !1 || ht(n) ? n : void 0,
|
|
1972
|
+
animate: ht(s) ? s : void 0
|
|
1973
1973
|
};
|
|
1974
1974
|
}
|
|
1975
1975
|
return t.inherit !== !1 ? e : {};
|
|
1976
1976
|
}
|
|
1977
1977
|
function Zr(t) {
|
|
1978
1978
|
const { initial: e, animate: n } = qr(t, k(kt));
|
|
1979
|
-
return
|
|
1979
|
+
return It(() => ({ initial: e, animate: n }), [rn(e), rn(n)]);
|
|
1980
1980
|
}
|
|
1981
1981
|
function rn(t) {
|
|
1982
1982
|
return Array.isArray(t) ? t.join(" ") : t;
|
|
@@ -2001,7 +2001,7 @@ function Qr(t, e, n) {
|
|
|
2001
2001
|
const Ce = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), to = "framerAppearId", fs = "data-" + Ce(to), eo = Q({});
|
|
2002
2002
|
function no(t, e, n, s, i) {
|
|
2003
2003
|
var b, v;
|
|
2004
|
-
const { visualElement: r } = k(kt), o = k(Ae), a = k(mn), c = k(as).reducedMotion, l =
|
|
2004
|
+
const { visualElement: r } = k(kt), o = k(Ae), a = k(mn), c = k(as).reducedMotion, l = ut(null);
|
|
2005
2005
|
s = s || o.renderer, !l.current && s && (l.current = s(t, {
|
|
2006
2006
|
visualState: e,
|
|
2007
2007
|
parent: r,
|
|
@@ -2012,12 +2012,12 @@ function no(t, e, n, s, i) {
|
|
|
2012
2012
|
}));
|
|
2013
2013
|
const u = l.current, d = k(eo);
|
|
2014
2014
|
u && !u.projection && i && (u.type === "html" || u.type === "svg") && so(l.current, n, i, d);
|
|
2015
|
-
const f =
|
|
2015
|
+
const f = ut(!1);
|
|
2016
2016
|
Bs(() => {
|
|
2017
2017
|
u && f.current && u.update(n, a);
|
|
2018
2018
|
});
|
|
2019
|
-
const h = n[fs], y =
|
|
2020
|
-
return
|
|
2019
|
+
const h = n[fs], y = ut(!!h && !((b = window.MotionHandoffIsComplete) != null && b.call(window, h)) && ((v = window.MotionHasOptimisedAnimation) == null ? void 0 : v.call(window, h)));
|
|
2020
|
+
return _s(() => {
|
|
2021
2021
|
u && (f.current = !0, window.MotionIsMounted = !0, u.updateFeatures(), kr.render(u.render), y.current && u.animationState && u.animationState.animateChanges());
|
|
2022
2022
|
}), ce(() => {
|
|
2023
2023
|
u && (!y.current && u.animationState && u.animationState.animateChanges(), y.current && (queueMicrotask(() => {
|
|
@@ -2052,7 +2052,6 @@ function ds(t) {
|
|
|
2052
2052
|
return t.options.allowProjection !== !1 ? t.projection : ds(t.parent);
|
|
2053
2053
|
}
|
|
2054
2054
|
function io({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: s, Component: i }) {
|
|
2055
|
-
t && ie(t);
|
|
2056
2055
|
function r(a, c) {
|
|
2057
2056
|
let l;
|
|
2058
2057
|
const u = {
|
|
@@ -2065,7 +2064,7 @@ function io({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVis
|
|
|
2065
2064
|
const y = ao(u);
|
|
2066
2065
|
l = y.MeasureLayout, f.visualElement = no(i, h, u, e, y.ProjectionNode);
|
|
2067
2066
|
}
|
|
2068
|
-
return hn(kt.Provider, { value: f, children: [l && f.visualElement ?
|
|
2067
|
+
return hn(kt.Provider, { value: f, children: [l && f.visualElement ? R(l, { visualElement: f.visualElement, ...u }) : null, n(i, a, Qr(h, f.visualElement, c), h, d, f.visualElement)] });
|
|
2069
2068
|
}
|
|
2070
2069
|
r.displayName = `motion.${typeof i == "string" ? i : `create(${i.displayName ?? i.name ?? ""})`}`;
|
|
2071
2070
|
const o = Ks(r);
|
|
@@ -2076,11 +2075,7 @@ function ro({ layoutId: t }) {
|
|
|
2076
2075
|
return e && t !== void 0 ? e + "-" + t : t;
|
|
2077
2076
|
}
|
|
2078
2077
|
function oo(t, e) {
|
|
2079
|
-
|
|
2080
|
-
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
2081
|
-
const s = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
2082
|
-
t.ignoreStrict ? tt(!1, s) : j(!1, s);
|
|
2083
|
-
}
|
|
2078
|
+
k(Ae).strict, process.env.NODE_ENV;
|
|
2084
2079
|
}
|
|
2085
2080
|
function ao(t) {
|
|
2086
2081
|
const { drag: e, layout: n } = J;
|
|
@@ -2094,18 +2089,18 @@ function ao(t) {
|
|
|
2094
2089
|
}
|
|
2095
2090
|
const uo = {};
|
|
2096
2091
|
function hs(t, { layout: e, layoutId: n }) {
|
|
2097
|
-
return
|
|
2092
|
+
return it.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!uo[t] || t === "opacity");
|
|
2098
2093
|
}
|
|
2099
2094
|
const co = {
|
|
2100
2095
|
x: "translateX",
|
|
2101
2096
|
y: "translateY",
|
|
2102
2097
|
z: "translateZ",
|
|
2103
2098
|
transformPerspective: "perspective"
|
|
2104
|
-
}, lo =
|
|
2099
|
+
}, lo = st.length;
|
|
2105
2100
|
function fo(t, e, n) {
|
|
2106
2101
|
let s = "", i = !0;
|
|
2107
2102
|
for (let r = 0; r < lo; r++) {
|
|
2108
|
-
const o =
|
|
2103
|
+
const o = st[r], a = t[o];
|
|
2109
2104
|
if (a === void 0)
|
|
2110
2105
|
continue;
|
|
2111
2106
|
let c = !0;
|
|
@@ -2126,10 +2121,10 @@ function Pe(t, e, n) {
|
|
|
2126
2121
|
let o = !1, a = !1;
|
|
2127
2122
|
for (const c in e) {
|
|
2128
2123
|
const l = e[c];
|
|
2129
|
-
if (
|
|
2124
|
+
if (it.has(c)) {
|
|
2130
2125
|
o = !0;
|
|
2131
2126
|
continue;
|
|
2132
|
-
} else if (
|
|
2127
|
+
} else if (Rn(c)) {
|
|
2133
2128
|
i[c] = l;
|
|
2134
2129
|
continue;
|
|
2135
2130
|
} else {
|
|
@@ -2150,10 +2145,10 @@ const Fe = () => ({
|
|
|
2150
2145
|
});
|
|
2151
2146
|
function ps(t, e, n) {
|
|
2152
2147
|
for (const s in e)
|
|
2153
|
-
!
|
|
2148
|
+
!I(e[s]) && !hs(s, n) && (t[s] = e[s]);
|
|
2154
2149
|
}
|
|
2155
2150
|
function ho({ transformTemplate: t }, e) {
|
|
2156
|
-
return
|
|
2151
|
+
return It(() => {
|
|
2157
2152
|
const n = Fe();
|
|
2158
2153
|
return Pe(n, e, t), Object.assign({}, n.vars, n.style);
|
|
2159
2154
|
}, [e]);
|
|
@@ -2203,7 +2198,7 @@ const gs = () => ({
|
|
|
2203
2198
|
attrs: {}
|
|
2204
2199
|
}), ys = (t) => typeof t == "string" && t.toLowerCase() === "svg";
|
|
2205
2200
|
function To(t, e, n, s) {
|
|
2206
|
-
const i =
|
|
2201
|
+
const i = It(() => {
|
|
2207
2202
|
const r = gs();
|
|
2208
2203
|
return ms(r, e, ys(s), t.transformTemplate, t.style), {
|
|
2209
2204
|
...r.attrs,
|
|
@@ -2265,7 +2260,7 @@ function Oe(t) {
|
|
|
2265
2260
|
}
|
|
2266
2261
|
function wo(t = !1) {
|
|
2267
2262
|
return (n, s, i, { latestValues: r }, o) => {
|
|
2268
|
-
const c = (Oe(n) ? To : mo)(s, r, o, n), l = Xr(s, typeof n == "string", t), u = n !== pn ? { ...l, ...c, ref: i } : {}, { children: d } = s, f =
|
|
2263
|
+
const c = (Oe(n) ? To : mo)(s, r, o, n), l = Xr(s, typeof n == "string", t), u = n !== pn ? { ...l, ...c, ref: i } : {}, { children: d } = s, f = It(() => I(d) ? d.get() : d, [d]);
|
|
2269
2264
|
return Ws(n, {
|
|
2270
2265
|
...u,
|
|
2271
2266
|
children: f
|
|
@@ -2290,7 +2285,7 @@ function De(t, e, n, s) {
|
|
|
2290
2285
|
return e;
|
|
2291
2286
|
}
|
|
2292
2287
|
function So(t) {
|
|
2293
|
-
return
|
|
2288
|
+
return I(t) ? t.get() : t;
|
|
2294
2289
|
}
|
|
2295
2290
|
function Vo({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, s, i) {
|
|
2296
2291
|
return {
|
|
@@ -2333,24 +2328,24 @@ function Ao(t, e, n, s) {
|
|
|
2333
2328
|
}
|
|
2334
2329
|
return i;
|
|
2335
2330
|
}
|
|
2336
|
-
function
|
|
2331
|
+
function Ie(t, e, n) {
|
|
2337
2332
|
var r;
|
|
2338
2333
|
const { style: s } = t, i = {};
|
|
2339
2334
|
for (const o in s)
|
|
2340
|
-
(
|
|
2335
|
+
(I(s[o]) || e.style && I(e.style[o]) || hs(o, t) || ((r = n == null ? void 0 : n.getValue(o)) == null ? void 0 : r.liveStyle) !== void 0) && (i[o] = s[o]);
|
|
2341
2336
|
return i;
|
|
2342
2337
|
}
|
|
2343
2338
|
const xo = {
|
|
2344
2339
|
useVisualState: bs({
|
|
2345
|
-
scrapeMotionValuesFromProps:
|
|
2340
|
+
scrapeMotionValuesFromProps: Ie,
|
|
2346
2341
|
createRenderState: Fe
|
|
2347
2342
|
})
|
|
2348
2343
|
};
|
|
2349
2344
|
function Ts(t, e, n) {
|
|
2350
|
-
const s =
|
|
2345
|
+
const s = Ie(t, e, n);
|
|
2351
2346
|
for (const i in t)
|
|
2352
|
-
if (
|
|
2353
|
-
const r =
|
|
2347
|
+
if (I(t[i]) || I(e[i])) {
|
|
2348
|
+
const r = st.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
|
|
2354
2349
|
s[r] = t[i];
|
|
2355
2350
|
}
|
|
2356
2351
|
return s;
|
|
@@ -2374,7 +2369,7 @@ function Co(t, e) {
|
|
|
2374
2369
|
};
|
|
2375
2370
|
}
|
|
2376
2371
|
const Po = /* @__PURE__ */ Co();
|
|
2377
|
-
function
|
|
2372
|
+
function pt(t, e, n) {
|
|
2378
2373
|
const s = t.getProps();
|
|
2379
2374
|
return De(s, e, n !== void 0 ? n : s.custom, t);
|
|
2380
2375
|
}
|
|
@@ -2386,7 +2381,7 @@ function Oo(t) {
|
|
|
2386
2381
|
return re(t) ? t[t.length - 1] || 0 : t;
|
|
2387
2382
|
}
|
|
2388
2383
|
function Do(t, e) {
|
|
2389
|
-
const n =
|
|
2384
|
+
const n = pt(t, e);
|
|
2390
2385
|
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
|
|
2391
2386
|
r = { ...r, ...s };
|
|
2392
2387
|
for (const o in r) {
|
|
@@ -2394,12 +2389,12 @@ function Do(t, e) {
|
|
|
2394
2389
|
Fo(t, o, a);
|
|
2395
2390
|
}
|
|
2396
2391
|
}
|
|
2397
|
-
function
|
|
2398
|
-
return !!(
|
|
2392
|
+
function Io(t) {
|
|
2393
|
+
return !!(I(t) && t.add);
|
|
2399
2394
|
}
|
|
2400
|
-
function
|
|
2395
|
+
function Ro(t, e) {
|
|
2401
2396
|
const n = t.getValue("willChange");
|
|
2402
|
-
if (
|
|
2397
|
+
if (Io(n))
|
|
2403
2398
|
return n.add(e);
|
|
2404
2399
|
if (!n && W.WillChange) {
|
|
2405
2400
|
const s = new W.WillChange("auto");
|
|
@@ -2431,11 +2426,11 @@ const Lo = {
|
|
|
2431
2426
|
type: "keyframes",
|
|
2432
2427
|
ease: [0.25, 0.1, 0.35, 1],
|
|
2433
2428
|
duration: 0.3
|
|
2434
|
-
}, $o = (t, { keyframes: e }) => e.length > 2 ? Ko :
|
|
2429
|
+
}, $o = (t, { keyframes: e }) => e.length > 2 ? Ko : it.has(t) ? t.startsWith("scale") ? Bo(e[1]) : Lo : Wo;
|
|
2435
2430
|
function jo({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: c, elapsed: l, ...u }) {
|
|
2436
2431
|
return !!Object.keys(u).length;
|
|
2437
2432
|
}
|
|
2438
|
-
const
|
|
2433
|
+
const _o = (t, e, n, s = {}, i, r) => (o) => {
|
|
2439
2434
|
const a = Jn(s, t) || {}, c = a.delay || s.delay || 0;
|
|
2440
2435
|
let { elapsed: l = 0 } = s;
|
|
2441
2436
|
l = l - /* @__PURE__ */ L(c);
|
|
@@ -2468,7 +2463,7 @@ const Go = (t, e, n, s = {}, i, r) => (o) => {
|
|
|
2468
2463
|
}
|
|
2469
2464
|
return a.isSync ? new we(u) : new br(u);
|
|
2470
2465
|
};
|
|
2471
|
-
function
|
|
2466
|
+
function Go({ protectedKeys: t, needsAnimating: e }, n) {
|
|
2472
2467
|
const s = t.hasOwnProperty(n) && e[n] !== !0;
|
|
2473
2468
|
return e[n] = !1, s;
|
|
2474
2469
|
}
|
|
@@ -2478,7 +2473,7 @@ function vs(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
|
2478
2473
|
const c = [], l = i && t.animationState && t.animationState.getState()[i];
|
|
2479
2474
|
for (const u in a) {
|
|
2480
2475
|
const d = t.getValue(u, t.latestValues[u] ?? null), f = a[u];
|
|
2481
|
-
if (f === void 0 || l &&
|
|
2476
|
+
if (f === void 0 || l && Go(l, u))
|
|
2482
2477
|
continue;
|
|
2483
2478
|
const h = {
|
|
2484
2479
|
delay: n,
|
|
@@ -2494,7 +2489,7 @@ function vs(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
|
2494
2489
|
S !== null && (h.startTime = S, b = !0);
|
|
2495
2490
|
}
|
|
2496
2491
|
}
|
|
2497
|
-
|
|
2492
|
+
Ro(t, u), d.start(_o(u, d, f, t.shouldReduceMotion && Qn.has(u) ? { type: !1 } : h, t, b));
|
|
2498
2493
|
const v = d.animation;
|
|
2499
2494
|
v && c.push(v);
|
|
2500
2495
|
}
|
|
@@ -2506,7 +2501,7 @@ function vs(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
|
2506
2501
|
}
|
|
2507
2502
|
function oe(t, e, n = {}) {
|
|
2508
2503
|
var c;
|
|
2509
|
-
const s =
|
|
2504
|
+
const s = pt(t, e, n.type === "exit" ? (c = t.presenceContext) == null ? void 0 : c.custom : void 0);
|
|
2510
2505
|
let { transition: i = t.getDefaultTransition() || {} } = s || {};
|
|
2511
2506
|
n.transitionOverride && (i = n.transitionOverride);
|
|
2512
2507
|
const r = s ? () => Promise.all(vs(t, s, n)) : () => Promise.resolve(), o = t.variantChildren && t.variantChildren.size ? (l = 0) => {
|
|
@@ -2543,7 +2538,7 @@ function zo(t, e, n = {}) {
|
|
|
2543
2538
|
} else if (typeof e == "string")
|
|
2544
2539
|
s = oe(t, e, n);
|
|
2545
2540
|
else {
|
|
2546
|
-
const i = typeof e == "function" ?
|
|
2541
|
+
const i = typeof e == "function" ? pt(t, e, n.custom) : e;
|
|
2547
2542
|
s = Promise.all(vs(t, i, n));
|
|
2548
2543
|
}
|
|
2549
2544
|
return s.then(() => {
|
|
@@ -2572,7 +2567,7 @@ function Ss(t) {
|
|
|
2572
2567
|
const e = {};
|
|
2573
2568
|
for (let n = 0; n < Yo; n++) {
|
|
2574
2569
|
const s = Me[n], i = t.props[s];
|
|
2575
|
-
(
|
|
2570
|
+
(ht(i) || i === !1) && (e[s] = i);
|
|
2576
2571
|
}
|
|
2577
2572
|
return e;
|
|
2578
2573
|
}
|
|
@@ -2584,7 +2579,7 @@ function Jo(t) {
|
|
|
2584
2579
|
let e = Zo(t), n = an(), s = !0;
|
|
2585
2580
|
const i = (c) => (l, u) => {
|
|
2586
2581
|
var f;
|
|
2587
|
-
const d =
|
|
2582
|
+
const d = pt(t, u, c === "exit" ? (f = t.presenceContext) == null ? void 0 : f.custom : void 0);
|
|
2588
2583
|
if (d) {
|
|
2589
2584
|
const { transition: h, transitionEnd: y, ...b } = d;
|
|
2590
2585
|
l = { ...l, ...b, ...y };
|
|
@@ -2598,7 +2593,7 @@ function Jo(t) {
|
|
|
2598
2593
|
const { props: l } = t, u = Ss(t.parent) || {}, d = [], f = /* @__PURE__ */ new Set();
|
|
2599
2594
|
let h = {}, y = 1 / 0;
|
|
2600
2595
|
for (let v = 0; v < qo; v++) {
|
|
2601
|
-
const p = Xo[v], S = n[p], m = l[p] !== void 0 ? l[p] : u[p], A =
|
|
2596
|
+
const p = Xo[v], S = n[p], m = l[p] !== void 0 ? l[p] : u[p], A = ht(m), T = p === c ? S.isActive : null;
|
|
2602
2597
|
T === !1 && (y = v);
|
|
2603
2598
|
let V = m === u[p] && m !== l[p] && A;
|
|
2604
2599
|
if (V && s && t.manuallyAnimateOnMount && (V = !1), S.protectedKeys = { ...h }, // If it isn't active and hasn't *just* been set as inactive
|
|
@@ -2636,7 +2631,7 @@ function Jo(t) {
|
|
|
2636
2631
|
if (f.size) {
|
|
2637
2632
|
const v = {};
|
|
2638
2633
|
if (typeof l.initial != "boolean") {
|
|
2639
|
-
const p =
|
|
2634
|
+
const p = pt(t, Array.isArray(l.initial) ? l.initial[0] : l.initial);
|
|
2640
2635
|
p && p.transition && (v.transition = p.transition);
|
|
2641
2636
|
}
|
|
2642
2637
|
f.forEach((p) => {
|
|
@@ -2673,7 +2668,7 @@ function Jo(t) {
|
|
|
2673
2668
|
function Qo(t, e) {
|
|
2674
2669
|
return typeof e == "string" ? e !== t : Array.isArray(e) ? !ws(e, t) : !1;
|
|
2675
2670
|
}
|
|
2676
|
-
function
|
|
2671
|
+
function j(t = !1) {
|
|
2677
2672
|
return {
|
|
2678
2673
|
isActive: t,
|
|
2679
2674
|
protectedKeys: {},
|
|
@@ -2683,23 +2678,23 @@ function G(t = !1) {
|
|
|
2683
2678
|
}
|
|
2684
2679
|
function an() {
|
|
2685
2680
|
return {
|
|
2686
|
-
animate:
|
|
2687
|
-
whileInView:
|
|
2688
|
-
whileHover:
|
|
2689
|
-
whileTap:
|
|
2690
|
-
whileDrag:
|
|
2691
|
-
whileFocus:
|
|
2692
|
-
exit:
|
|
2681
|
+
animate: j(!0),
|
|
2682
|
+
whileInView: j(),
|
|
2683
|
+
whileHover: j(),
|
|
2684
|
+
whileTap: j(),
|
|
2685
|
+
whileDrag: j(),
|
|
2686
|
+
whileFocus: j(),
|
|
2687
|
+
exit: j()
|
|
2693
2688
|
};
|
|
2694
2689
|
}
|
|
2695
|
-
class
|
|
2690
|
+
class rt {
|
|
2696
2691
|
constructor(e) {
|
|
2697
2692
|
this.isMounted = !1, this.node = e;
|
|
2698
2693
|
}
|
|
2699
2694
|
update() {
|
|
2700
2695
|
}
|
|
2701
2696
|
}
|
|
2702
|
-
class ta extends
|
|
2697
|
+
class ta extends rt {
|
|
2703
2698
|
/**
|
|
2704
2699
|
* We dynamically generate the AnimationState manager as it contains a reference
|
|
2705
2700
|
* to the underlying animation library. We only want to load that if we load this,
|
|
@@ -2728,7 +2723,7 @@ class ta extends ot {
|
|
|
2728
2723
|
}
|
|
2729
2724
|
}
|
|
2730
2725
|
let ea = 0;
|
|
2731
|
-
class na extends
|
|
2726
|
+
class na extends rt {
|
|
2732
2727
|
constructor() {
|
|
2733
2728
|
super(...arguments), this.id = ea++;
|
|
2734
2729
|
}
|
|
@@ -2799,7 +2794,7 @@ function ln(t, e, n) {
|
|
|
2799
2794
|
const i = "onHover" + n, r = s[i];
|
|
2800
2795
|
r && N.postRender(() => r(e, Vs(e)));
|
|
2801
2796
|
}
|
|
2802
|
-
class aa extends
|
|
2797
|
+
class aa extends rt {
|
|
2803
2798
|
mount() {
|
|
2804
2799
|
const { current: e } = this.node;
|
|
2805
2800
|
e && (this.unmount = Br(e, (n, s) => (ln(this.node, s, "Start"), (i) => ln(this.node, i, "End"))));
|
|
@@ -2807,7 +2802,7 @@ class aa extends ot {
|
|
|
2807
2802
|
unmount() {
|
|
2808
2803
|
}
|
|
2809
2804
|
}
|
|
2810
|
-
class ua extends
|
|
2805
|
+
class ua extends rt {
|
|
2811
2806
|
constructor() {
|
|
2812
2807
|
super(...arguments), this.isActive = !1;
|
|
2813
2808
|
}
|
|
@@ -2824,7 +2819,7 @@ class ua extends ot {
|
|
|
2824
2819
|
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
2825
2820
|
}
|
|
2826
2821
|
mount() {
|
|
2827
|
-
this.unmount =
|
|
2822
|
+
this.unmount = Rt(un(this.node.current, "focus", () => this.onFocus()), un(this.node.current, "blur", () => this.onBlur()));
|
|
2828
2823
|
}
|
|
2829
2824
|
unmount() {
|
|
2830
2825
|
}
|
|
@@ -2837,15 +2832,15 @@ function fn(t, e, n) {
|
|
|
2837
2832
|
const i = "onTap" + (n === "End" ? "" : n), r = s[i];
|
|
2838
2833
|
r && N.postRender(() => r(e, Vs(e)));
|
|
2839
2834
|
}
|
|
2840
|
-
class ca extends
|
|
2835
|
+
class ca extends rt {
|
|
2841
2836
|
mount() {
|
|
2842
2837
|
const { current: e } = this.node;
|
|
2843
|
-
e && (this.unmount =
|
|
2838
|
+
e && (this.unmount = _r(e, (n, s) => (fn(this.node, s, "Start"), (i, { success: r }) => fn(this.node, i, r ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
2844
2839
|
}
|
|
2845
2840
|
unmount() {
|
|
2846
2841
|
}
|
|
2847
2842
|
}
|
|
2848
|
-
const ae = /* @__PURE__ */ new WeakMap(),
|
|
2843
|
+
const ae = /* @__PURE__ */ new WeakMap(), Ut = /* @__PURE__ */ new WeakMap(), la = (t) => {
|
|
2849
2844
|
const e = ae.get(t.target);
|
|
2850
2845
|
e && e(t);
|
|
2851
2846
|
}, fa = (t) => {
|
|
@@ -2853,8 +2848,8 @@ const ae = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ new WeakMap(), la
|
|
|
2853
2848
|
};
|
|
2854
2849
|
function da({ root: t, ...e }) {
|
|
2855
2850
|
const n = t || document;
|
|
2856
|
-
|
|
2857
|
-
const s =
|
|
2851
|
+
Ut.has(n) || Ut.set(n, {});
|
|
2852
|
+
const s = Ut.get(n), i = JSON.stringify(e);
|
|
2858
2853
|
return s[i] || (s[i] = new IntersectionObserver(fa, { root: t, ...e })), s[i];
|
|
2859
2854
|
}
|
|
2860
2855
|
function ha(t, e, n) {
|
|
@@ -2867,7 +2862,7 @@ const pa = {
|
|
|
2867
2862
|
some: 0,
|
|
2868
2863
|
all: 1
|
|
2869
2864
|
};
|
|
2870
|
-
class ma extends
|
|
2865
|
+
class ma extends rt {
|
|
2871
2866
|
constructor() {
|
|
2872
2867
|
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
2873
2868
|
}
|
|
@@ -2928,9 +2923,9 @@ const Ta = /* @__PURE__ */ new WeakMap();
|
|
|
2928
2923
|
function va(t, e, n) {
|
|
2929
2924
|
for (const s in e) {
|
|
2930
2925
|
const i = e[s], r = n[s];
|
|
2931
|
-
if (
|
|
2926
|
+
if (I(i))
|
|
2932
2927
|
t.addValue(s, i);
|
|
2933
|
-
else if (
|
|
2928
|
+
else if (I(r))
|
|
2934
2929
|
t.addValue(s, Ot(i, { owner: t }));
|
|
2935
2930
|
else if (r !== i)
|
|
2936
2931
|
if (t.hasValue(s)) {
|
|
@@ -2977,14 +2972,14 @@ class wa {
|
|
|
2977
2972
|
const { willChange: u, ...d } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
2978
2973
|
for (const f in d) {
|
|
2979
2974
|
const h = d[f];
|
|
2980
|
-
c[f] !== void 0 &&
|
|
2975
|
+
c[f] !== void 0 && I(h) && h.set(c[f], !1);
|
|
2981
2976
|
}
|
|
2982
2977
|
}
|
|
2983
2978
|
mount(e) {
|
|
2984
2979
|
this.current = e, Ta.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), xs.current || ba(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : ue.current, process.env.NODE_ENV !== "production" && wn(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
2985
2980
|
}
|
|
2986
2981
|
unmount() {
|
|
2987
|
-
this.projection && this.projection.unmount(),
|
|
2982
|
+
this.projection && this.projection.unmount(), Ht(this.notifyUpdate), Ht(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
2988
2983
|
for (const e in this.events)
|
|
2989
2984
|
this.events[e].clear();
|
|
2990
2985
|
for (const e in this.features) {
|
|
@@ -2995,7 +2990,7 @@ class wa {
|
|
|
2995
2990
|
}
|
|
2996
2991
|
bindToMotionValue(e, n) {
|
|
2997
2992
|
this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
|
|
2998
|
-
const s =
|
|
2993
|
+
const s = it.has(e);
|
|
2999
2994
|
s && this.onBindTransform && this.onBindTransform();
|
|
3000
2995
|
const i = n.on("change", (a) => {
|
|
3001
2996
|
this.latestValues[e] = a, this.props.onUpdate && N.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
|
|
@@ -3115,7 +3110,7 @@ class wa {
|
|
|
3115
3110
|
*/
|
|
3116
3111
|
readValue(e, n) {
|
|
3117
3112
|
let s = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : this.getBaseTargetFromProps(this.props, e) ?? this.readValueFromInstance(this.current, e, this.options);
|
|
3118
|
-
return s != null && (typeof s == "string" && (gn(s) || yn(s)) ? s = parseFloat(s) : !Ur(s) &&
|
|
3113
|
+
return s != null && (typeof s == "string" && (gn(s) || yn(s)) ? s = parseFloat(s) : !Ur(s) && nt.test(n) && (s = ss(e, n)), this.setBaseTarget(e, I(s) ? s.get() : s)), I(s) ? s.get() : s;
|
|
3119
3114
|
}
|
|
3120
3115
|
/**
|
|
3121
3116
|
* Set the base target to later animate back to. This is currently
|
|
@@ -3139,7 +3134,7 @@ class wa {
|
|
|
3139
3134
|
if (n && s !== void 0)
|
|
3140
3135
|
return s;
|
|
3141
3136
|
const i = this.getBaseTargetFromProps(this.props, e);
|
|
3142
|
-
return i !== void 0 && !
|
|
3137
|
+
return i !== void 0 && !I(i) ? i : this.initialValues[e] !== void 0 && s === void 0 ? void 0 : this.baseTarget[e];
|
|
3143
3138
|
}
|
|
3144
3139
|
on(e, n) {
|
|
3145
3140
|
return this.events[e] || (this.events[e] = new Tn()), this.events[e].add(n);
|
|
@@ -3164,7 +3159,7 @@ class Ms extends wa {
|
|
|
3164
3159
|
handleChildMotionValue() {
|
|
3165
3160
|
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
3166
3161
|
const { children: e } = this.props;
|
|
3167
|
-
|
|
3162
|
+
I(e) && (this.childSubscription = e.on("change", (n) => {
|
|
3168
3163
|
this.current && (this.current.textContent = `${n}`);
|
|
3169
3164
|
}));
|
|
3170
3165
|
}
|
|
@@ -3187,10 +3182,10 @@ class Va extends Ms {
|
|
|
3187
3182
|
}
|
|
3188
3183
|
readValueFromInstance(e, n) {
|
|
3189
3184
|
var s;
|
|
3190
|
-
if (
|
|
3191
|
-
return (s = this.projection) != null && s.isProjecting ?
|
|
3185
|
+
if (it.has(n))
|
|
3186
|
+
return (s = this.projection) != null && s.isProjecting ? Qt(n) : Xi(e, n);
|
|
3192
3187
|
{
|
|
3193
|
-
const i = Sa(e), r = (
|
|
3188
|
+
const i = Sa(e), r = (Rn(n) ? i.getPropertyValue(n) : i[n]) || 0;
|
|
3194
3189
|
return typeof r == "string" ? r.trim() : r;
|
|
3195
3190
|
}
|
|
3196
3191
|
}
|
|
@@ -3201,7 +3196,7 @@ class Va extends Ms {
|
|
|
3201
3196
|
Pe(e, n, s.transformTemplate);
|
|
3202
3197
|
}
|
|
3203
3198
|
scrapeMotionValuesFromProps(e, n, s) {
|
|
3204
|
-
return
|
|
3199
|
+
return Ie(e, n, s);
|
|
3205
3200
|
}
|
|
3206
3201
|
}
|
|
3207
3202
|
const Ps = /* @__PURE__ */ new Set([
|
|
@@ -3242,7 +3237,7 @@ class xa extends Ms {
|
|
|
3242
3237
|
return e[n];
|
|
3243
3238
|
}
|
|
3244
3239
|
readValueFromInstance(e, n) {
|
|
3245
|
-
if (
|
|
3240
|
+
if (it.has(n)) {
|
|
3246
3241
|
const s = ns(n);
|
|
3247
3242
|
return s && s.default || 0;
|
|
3248
3243
|
}
|
|
@@ -3273,13 +3268,13 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3273
3268
|
shadow: "2"
|
|
3274
3269
|
},
|
|
3275
3270
|
dark: {}
|
|
3276
|
-
}, Fs =
|
|
3271
|
+
}, Fs = lt.createContext({
|
|
3277
3272
|
groupOpen: !1,
|
|
3278
3273
|
setGroupOpen: () => {
|
|
3279
3274
|
}
|
|
3280
3275
|
}), Oa = ({ open: t, delay: e = 600 }) => {
|
|
3281
|
-
const n =
|
|
3282
|
-
return
|
|
3276
|
+
const n = lt.useContext(Fs);
|
|
3277
|
+
return lt.useEffect(() => {
|
|
3283
3278
|
let s = null;
|
|
3284
3279
|
return n.setGroupOpen && (t === !0 && n.setGroupOpen(!0), t === !1 && (s = setTimeout(() => {
|
|
3285
3280
|
n.setGroupOpen && n.setGroupOpen(!1);
|
|
@@ -3289,10 +3284,10 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3289
3284
|
}, [t, n, e]), {
|
|
3290
3285
|
groupOpen: n.groupOpen
|
|
3291
3286
|
};
|
|
3292
|
-
},
|
|
3293
|
-
const [e, n] =
|
|
3294
|
-
return /* @__PURE__ */
|
|
3295
|
-
},
|
|
3287
|
+
}, Ba = ({ children: t }) => {
|
|
3288
|
+
const [e, n] = lt.useState(!1);
|
|
3289
|
+
return /* @__PURE__ */ R(Fs.Provider, { value: { groupOpen: e, setGroupOpen: n }, children: t });
|
|
3290
|
+
}, Ka = ({
|
|
3296
3291
|
// Radix Tooltip Provider Props
|
|
3297
3292
|
delayDuration: t = 400,
|
|
3298
3293
|
skipDelayDuration: e,
|
|
@@ -3330,9 +3325,9 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3330
3325
|
prop: i,
|
|
3331
3326
|
onChange: r,
|
|
3332
3327
|
defaultProp: s ?? !1
|
|
3333
|
-
}), { groupOpen: Tt } = Oa({ open: !!B, delay: t }), vt =
|
|
3328
|
+
}), { groupOpen: Tt } = Oa({ open: !!B, delay: t }), vt = lt.Children.toArray(D).some(
|
|
3334
3329
|
(O) => O.props.disabled
|
|
3335
|
-
),
|
|
3330
|
+
), Re = Tt || vt ? 0 : t, Ee = !Tt, P = (O) => {
|
|
3336
3331
|
if (O === "top")
|
|
3337
3332
|
return {
|
|
3338
3333
|
y: -5
|
|
@@ -3350,21 +3345,21 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3350
3345
|
x: 5
|
|
3351
3346
|
};
|
|
3352
3347
|
};
|
|
3353
|
-
return /* @__PURE__ */
|
|
3354
|
-
|
|
3348
|
+
return /* @__PURE__ */ R(Hr, { features: Ca, children: /* @__PURE__ */ R(
|
|
3349
|
+
ot.Provider,
|
|
3355
3350
|
{
|
|
3356
|
-
delayDuration:
|
|
3351
|
+
delayDuration: Re,
|
|
3357
3352
|
skipDelayDuration: e,
|
|
3358
3353
|
disableHoverableContent: n,
|
|
3359
3354
|
children: /* @__PURE__ */ hn(
|
|
3360
|
-
|
|
3355
|
+
ot.Root,
|
|
3361
3356
|
{
|
|
3362
3357
|
open: M === !1 ? !1 : B,
|
|
3363
3358
|
onOpenChange: bt,
|
|
3364
3359
|
children: [
|
|
3365
|
-
/* @__PURE__ */
|
|
3366
|
-
/* @__PURE__ */
|
|
3367
|
-
|
|
3360
|
+
/* @__PURE__ */ R(ot.Trigger, { asChild: !0, ref: F, children: /* @__PURE__ */ R(Is, { children: D }) }),
|
|
3361
|
+
/* @__PURE__ */ R(ot.Portal, { children: /* @__PURE__ */ R(
|
|
3362
|
+
ot.Content,
|
|
3368
3363
|
{
|
|
3369
3364
|
"aria-label": o,
|
|
3370
3365
|
onEscapeKeyDown: a,
|
|
@@ -3383,8 +3378,8 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3383
3378
|
style: {
|
|
3384
3379
|
zIndex: "var(--tgph-zIndex-tooltip)"
|
|
3385
3380
|
},
|
|
3386
|
-
children: /* @__PURE__ */
|
|
3387
|
-
|
|
3381
|
+
children: /* @__PURE__ */ R(Ds, { appearance: w, asChild: !0, children: /* @__PURE__ */ R(
|
|
3382
|
+
Rs,
|
|
3388
3383
|
{
|
|
3389
3384
|
as: Pa,
|
|
3390
3385
|
className: "tgph",
|
|
@@ -3415,7 +3410,7 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3415
3410
|
},
|
|
3416
3411
|
...V ? { labelProps: V } : {},
|
|
3417
3412
|
...Fa[w],
|
|
3418
|
-
children: typeof T == "string" ? /* @__PURE__ */
|
|
3413
|
+
children: typeof T == "string" ? /* @__PURE__ */ R(Es, { as: "span", size: "1", children: T }) : T
|
|
3419
3414
|
}
|
|
3420
3415
|
) })
|
|
3421
3416
|
}
|
|
@@ -3427,7 +3422,7 @@ const Ma = (t, e) => Oe(t) ? new xa(e) : new Va(e, {
|
|
|
3427
3422
|
) });
|
|
3428
3423
|
};
|
|
3429
3424
|
export {
|
|
3430
|
-
|
|
3431
|
-
|
|
3425
|
+
Ka as Tooltip,
|
|
3426
|
+
Ba as TooltipGroupProvider
|
|
3432
3427
|
};
|
|
3433
3428
|
//# sourceMappingURL=index.mjs.map
|