@wix/interact 2.8.3 → 2.8.5
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/dist/cjs/index.js +1 -1
- package/dist/cjs/react.js +1 -1
- package/dist/cjs/web.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/react.js +2 -2
- package/dist/es/web.js +2 -2
- package/dist/index-D8zv4Q-3.js +29 -0
- package/dist/index-D8zv4Q-3.js.map +1 -0
- package/dist/{index-CXd-XY1L.mjs → index-DSREj0qw.mjs} +1631 -1432
- package/dist/index-DSREj0qw.mjs.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/core/Interact.d.ts +2 -2
- package/dist/types/core/Interact.d.ts.map +1 -1
- package/dist/types/core/InteractionController.d.ts +6 -1
- package/dist/types/core/InteractionController.d.ts.map +1 -1
- package/dist/types/core/add.d.ts.map +1 -1
- package/dist/types/handlers/animationEnd.d.ts +15 -0
- package/dist/types/handlers/animationEnd.d.ts.map +1 -1
- package/dist/types/handlers/viewEnter.d.ts +8 -0
- package/dist/types/handlers/viewEnter.d.ts.map +1 -1
- package/dist/types/react/Interaction.d.ts +1 -1
- package/dist/types/types/controller.d.ts +15 -2
- package/dist/types/types/controller.d.ts.map +1 -1
- package/dist/types/types/handlers.d.ts +18 -0
- package/dist/types/types/handlers.d.ts.map +1 -1
- package/dist/types/types/internal.d.ts +2 -0
- package/dist/types/types/internal.d.ts.map +1 -1
- package/dist/types/types/plugins.d.ts +12 -4
- package/dist/types/types/plugins.d.ts.map +1 -1
- package/docs/api/interact-class.md +1 -1
- package/docs/api/types.md +3 -1
- package/docs/guides/plugins.md +28 -3
- package/package.json +2 -2
- package/rules/full-lean.md +2 -1
- package/rules/plugins.md +5 -1
- package/dist/index-CXd-XY1L.mjs.map +0 -1
- package/dist/index-CeIuoLxG.js +0 -29
- package/dist/index-CeIuoLxG.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
function
|
|
1
|
+
function In(e) {
|
|
2
2
|
return [...e.matchAll(/\[([^\]]+)]/g)].map(([t, n]) => n);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
const n =
|
|
4
|
+
function R(e, t) {
|
|
5
|
+
const n = In(t);
|
|
6
6
|
let s = 0;
|
|
7
7
|
return n.length ? e.replace(/\[]/g, () => {
|
|
8
8
|
const i = n[s++];
|
|
9
9
|
return i !== void 0 ? `[${i}]` : "[]";
|
|
10
10
|
}) : e;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function _n(e, t) {
|
|
13
13
|
return e.trigger === "viewEnter" && t.triggerType === "once" && B(e) === B(t);
|
|
14
14
|
}
|
|
15
15
|
function B(e) {
|
|
16
16
|
const { key: t, listContainer: n, listItemSelector: s, selector: i } = e;
|
|
17
17
|
return `${t}\0${n || ""}\0${s || ""}\0${i || ""}`;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
class
|
|
19
|
+
const Xe = "$";
|
|
20
|
+
class ce {
|
|
21
21
|
animations;
|
|
22
22
|
options;
|
|
23
23
|
ready;
|
|
@@ -121,64 +121,64 @@ class ie {
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
const
|
|
125
|
-
linear:
|
|
126
|
-
sineIn:
|
|
127
|
-
sineOut:
|
|
128
|
-
sineInOut:
|
|
129
|
-
quadIn:
|
|
130
|
-
quadOut:
|
|
131
|
-
quadInOut:
|
|
132
|
-
cubicIn:
|
|
133
|
-
cubicOut:
|
|
134
|
-
cubicInOut:
|
|
135
|
-
quartIn:
|
|
136
|
-
quartOut:
|
|
137
|
-
quartInOut:
|
|
138
|
-
quintIn:
|
|
139
|
-
quintOut:
|
|
140
|
-
quintInOut:
|
|
141
|
-
expoIn:
|
|
142
|
-
expoOut:
|
|
143
|
-
expoInOut:
|
|
144
|
-
circIn:
|
|
145
|
-
circOut:
|
|
146
|
-
circInOut:
|
|
147
|
-
backIn:
|
|
148
|
-
backOut:
|
|
149
|
-
backInOut:
|
|
150
|
-
},
|
|
151
|
-
const o = 3 * t, r = 3 * (s - 2 * t), a = 1 - 3 * s + 3 * t,
|
|
152
|
-
let
|
|
124
|
+
const Pt = (e) => e, Tn = (e) => 1 - Math.cos(e * Math.PI / 2), Mn = (e) => Math.sin(e * Math.PI / 2), On = (e) => -(Math.cos(Math.PI * e) - 1) / 2, Pn = (e) => e ** 2, Cn = (e) => 1 - (1 - e) ** 2, An = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, kn = (e) => e ** 3, qn = (e) => 1 - (1 - e) ** 3, Rn = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, Ln = (e) => e ** 4, Fn = (e) => 1 - (1 - e) ** 4, xn = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, Nn = (e) => e ** 5, Dn = (e) => 1 - (1 - e) ** 5, jn = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, zn = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), Hn = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), Gn = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, Wn = (e) => 1 - Math.sqrt(1 - e ** 2), Vn = (e) => Math.sqrt(1 - (e - 1) ** 2), Bn = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Yn = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, Un = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, Kn = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, at = {
|
|
125
|
+
linear: Pt,
|
|
126
|
+
sineIn: Tn,
|
|
127
|
+
sineOut: Mn,
|
|
128
|
+
sineInOut: On,
|
|
129
|
+
quadIn: Pn,
|
|
130
|
+
quadOut: Cn,
|
|
131
|
+
quadInOut: An,
|
|
132
|
+
cubicIn: kn,
|
|
133
|
+
cubicOut: qn,
|
|
134
|
+
cubicInOut: Rn,
|
|
135
|
+
quartIn: Ln,
|
|
136
|
+
quartOut: Fn,
|
|
137
|
+
quartInOut: xn,
|
|
138
|
+
quintIn: Nn,
|
|
139
|
+
quintOut: Dn,
|
|
140
|
+
quintInOut: jn,
|
|
141
|
+
expoIn: zn,
|
|
142
|
+
expoOut: Hn,
|
|
143
|
+
expoInOut: Gn,
|
|
144
|
+
circIn: Wn,
|
|
145
|
+
circOut: Vn,
|
|
146
|
+
circInOut: Bn,
|
|
147
|
+
backIn: Yn,
|
|
148
|
+
backOut: Un,
|
|
149
|
+
backInOut: Kn
|
|
150
|
+
}, Q = (e, t, n, s, i) => {
|
|
151
|
+
const o = 3 * t, r = 3 * (s - 2 * t), a = 1 - 3 * s + 3 * t, c = 3 * n, u = 3 * (i - 2 * n), f = 1 - 3 * i + 3 * n;
|
|
152
|
+
let l;
|
|
153
153
|
if (a === 0)
|
|
154
|
-
|
|
154
|
+
l = r === 0 ? `(${e} / ${o})` : `((sqrt(max(0, ${o * o} + ${4 * r} * ${e})) - ${o}) / ${2 * r})`;
|
|
155
155
|
else {
|
|
156
|
-
const d = r / (3 * a),
|
|
157
|
-
if (
|
|
158
|
-
const v = 2 * Math.sqrt(-
|
|
156
|
+
const d = r / (3 * a), h = 2 * Math.pow(r, 3) - 9 * o * r * a, p = 54 * Math.pow(a, 3), m = (3 * a * o - r * r) / (9 * a * a), g = `((${h} - ${27 * a * a} * ${e}) / ${p})`;
|
|
157
|
+
if (m < 0) {
|
|
158
|
+
const v = 2 * Math.sqrt(-m);
|
|
159
159
|
let y = 0;
|
|
160
160
|
for (const E of [0, 1, 2])
|
|
161
|
-
[0, 0.25, 0.5, 0.75, 1].every((
|
|
162
|
-
const
|
|
163
|
-
Math.max(2 * (
|
|
161
|
+
[0, 0.25, 0.5, 0.75, 1].every(($) => {
|
|
162
|
+
const _ = Math.min(
|
|
163
|
+
Math.max(2 * (h - 27 * a * a * $) / (p * m * v), -1),
|
|
164
164
|
1
|
|
165
|
-
), I = v * Math.cos((Math.acos(
|
|
165
|
+
), I = v * Math.cos((Math.acos(_) - E * 2 * Math.PI) / 3) - d;
|
|
166
166
|
return I >= -1e-6 && I <= 1.000001;
|
|
167
167
|
}) && (y = E);
|
|
168
|
-
const
|
|
169
|
-
|
|
168
|
+
const b = `(acos(clamp(-1, ${2 / (m * v)} * ${g}, 1)) - ${360 * y}deg) / 3`;
|
|
169
|
+
l = `(${v} * cos(${b}) - ${d})`;
|
|
170
170
|
} else {
|
|
171
|
-
const v = `sqrt(pow(${g}, 2) + ${Math.pow(
|
|
172
|
-
|
|
171
|
+
const v = `sqrt(pow(${g}, 2) + ${Math.pow(m, 3)})`;
|
|
172
|
+
l = `(pow(${v} - ${g}, 1 / 3) - pow(${v} + ${g}, 1 / 3) - ${d})`;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
return `(${
|
|
176
|
-
},
|
|
175
|
+
return `(${f} * pow(${l}, 3) + ${u} * pow(${l}, 2) + ${c} * ${l})`;
|
|
176
|
+
}, ct = {
|
|
177
177
|
linear: (e) => e,
|
|
178
|
-
ease: (e) =>
|
|
179
|
-
easeIn: (e) =>
|
|
180
|
-
easeOut: (e) =>
|
|
181
|
-
easeInOut: (e) =>
|
|
178
|
+
ease: (e) => Q(e, 0.25, 0.1, 0.25, 1),
|
|
179
|
+
easeIn: (e) => Q(e, 0.42, 0, 1, 1),
|
|
180
|
+
easeOut: (e) => Q(e, 0, 0, 0.58, 1),
|
|
181
|
+
easeInOut: (e) => Q(e, 0.42, 0, 0.58, 1),
|
|
182
182
|
sineIn: (e) => `(1 - cos(${e} * 90deg))`,
|
|
183
183
|
sineOut: (e) => `(sin(${e} * 90deg))`,
|
|
184
184
|
sineInOut: (e) => `((1 - cos(${e} * 180deg)) / 2)`,
|
|
@@ -203,7 +203,7 @@ const $t = (e) => e, pn = (e) => 1 - Math.cos(e * Math.PI / 2), gn = (e) => Math
|
|
|
203
203
|
backIn: (e) => `(2.70158 * pow(${e}, 3) - 1.70158 * ${e} * ${e})`,
|
|
204
204
|
backOut: (e) => `(1 + 2.70158 * pow(${e} - 1, 3) + 1.70158 * (${e} - 1) * (${e} - 1))`,
|
|
205
205
|
backInOut: (e) => `((round(${e}) * (2 + (2 * ${e} - 2) * (2 * ${e} - 2) * (2.5949095 + 3.5949095 * (2 * ${e} - 2))) + (1 - round(${e})) * 4 * ${e} * ${e} * (3.5949095 * 2 * ${e} - 2.5949095)) / 2)`
|
|
206
|
-
},
|
|
206
|
+
}, ft = {
|
|
207
207
|
linear: "linear",
|
|
208
208
|
ease: "ease",
|
|
209
209
|
easeIn: "ease-in",
|
|
@@ -234,68 +234,68 @@ const $t = (e) => e, pn = (e) => 1 - Math.cos(e * Math.PI / 2), gn = (e) => Math
|
|
|
234
234
|
backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
235
235
|
backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
|
|
236
236
|
};
|
|
237
|
-
function
|
|
237
|
+
function Xn(e) {
|
|
238
238
|
return e === "percentage" ? "%" : e || "px";
|
|
239
239
|
}
|
|
240
|
-
const
|
|
240
|
+
const Qn = /^(webkit|moz|ms|o)(?=[A-Z])/, Zn = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
241
241
|
float: "cssFloat",
|
|
242
242
|
"animation-timing-function": "easing",
|
|
243
243
|
"animation-composition": "composite"
|
|
244
244
|
});
|
|
245
|
-
function
|
|
246
|
-
return e.startsWith("--") ? e : (
|
|
245
|
+
function $e(e) {
|
|
246
|
+
return e.startsWith("--") ? e : (Qn.test(e) ? `-${e}` : e).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function Jn(e) {
|
|
249
249
|
return e.startsWith("--") || !e.includes("-") ? e : e.replace(/^-/, "").replace(/-([a-z])/g, (t, n) => n.toUpperCase());
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
return
|
|
251
|
+
function Ct(e) {
|
|
252
|
+
return Zn[e] || Jn(e);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function es(e) {
|
|
255
255
|
for (const t in e)
|
|
256
|
-
if (Object.hasOwn(e, t) &&
|
|
256
|
+
if (Object.hasOwn(e, t) && Ct(t) !== t)
|
|
257
257
|
return !0;
|
|
258
258
|
return !1;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function At(e) {
|
|
261
261
|
if (!Array.isArray(e))
|
|
262
262
|
return e;
|
|
263
263
|
let t;
|
|
264
264
|
return e.forEach((n, s) => {
|
|
265
|
-
if (!n || typeof n != "object" || !
|
|
265
|
+
if (!n || typeof n != "object" || !es(n))
|
|
266
266
|
return;
|
|
267
267
|
t ??= e.slice();
|
|
268
268
|
const i = {};
|
|
269
269
|
for (const o in n)
|
|
270
|
-
Object.hasOwn(n, o) && (i[
|
|
270
|
+
Object.hasOwn(n, o) && (i[Ct(o)] = n[o]);
|
|
271
271
|
t[s] = i;
|
|
272
272
|
}), t || e;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
return e ?
|
|
274
|
+
function ye(e) {
|
|
275
|
+
return e ? ft[e] || e : ft.linear;
|
|
276
276
|
}
|
|
277
|
-
function
|
|
278
|
-
const i = 3 * e, o = 3 * (n - e) - i, r = 1 - i - o, a = 3 * t,
|
|
279
|
-
function
|
|
280
|
-
let
|
|
277
|
+
function ts(e, t, n, s) {
|
|
278
|
+
const i = 3 * e, o = 3 * (n - e) - i, r = 1 - i - o, a = 3 * t, c = 3 * (s - t) - a, u = 1 - a - c, f = (p) => ((r * p + o) * p + i) * p, l = (p) => ((u * p + c) * p + a) * p, d = (p) => (3 * r * p + 2 * o) * p + i;
|
|
279
|
+
function h(p) {
|
|
280
|
+
let m = p;
|
|
281
281
|
for (let y = 0; y < 8; y++) {
|
|
282
|
-
const
|
|
283
|
-
if (Math.abs(
|
|
284
|
-
const E = d(
|
|
282
|
+
const b = f(m) - p;
|
|
283
|
+
if (Math.abs(b) < 1e-7) return m;
|
|
284
|
+
const E = d(m);
|
|
285
285
|
if (Math.abs(E) < 1e-6) break;
|
|
286
|
-
|
|
286
|
+
m -= b / E;
|
|
287
287
|
}
|
|
288
288
|
let g = 0, v = 1;
|
|
289
|
-
for (
|
|
290
|
-
const y =
|
|
291
|
-
if (Math.abs(y - p) < 1e-7) return
|
|
292
|
-
p > y ? g =
|
|
289
|
+
for (m = (g + v) / 2; v - g > 1e-7; ) {
|
|
290
|
+
const y = f(m);
|
|
291
|
+
if (Math.abs(y - p) < 1e-7) return m;
|
|
292
|
+
p > y ? g = m : v = m, m = (g + v) / 2;
|
|
293
293
|
}
|
|
294
|
-
return
|
|
294
|
+
return m;
|
|
295
295
|
}
|
|
296
|
-
return (p) => p <= 0 ? 0 : p >= 1 ? 1 :
|
|
296
|
+
return (p) => p <= 0 ? 0 : p >= 1 ? 1 : l(h(p));
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function kt(e) {
|
|
299
299
|
const t = e.match(
|
|
300
300
|
/^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/
|
|
301
301
|
);
|
|
@@ -304,17 +304,17 @@ function It(e) {
|
|
|
304
304
|
if (![n, s, i, o].some(isNaN))
|
|
305
305
|
return [n, s, i, o];
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
const t =
|
|
307
|
+
function ns(e) {
|
|
308
|
+
const t = kt(e);
|
|
309
309
|
if (!(!t || t.some(isNaN)))
|
|
310
|
-
return
|
|
310
|
+
return ts(...t);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
const t =
|
|
312
|
+
function ss(e) {
|
|
313
|
+
const t = kt(e);
|
|
314
314
|
if (!(!t || t.some(isNaN)))
|
|
315
|
-
return (n) =>
|
|
315
|
+
return (n) => Q(n, ...t);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function qt(e) {
|
|
318
318
|
const t = e.match(/^linear\((.+)\)$/);
|
|
319
319
|
if (!t) return;
|
|
320
320
|
const n = t[1].split(",").map((o) => o.trim()).filter(Boolean);
|
|
@@ -323,14 +323,14 @@ function Tt(e) {
|
|
|
323
323
|
for (const o of n) {
|
|
324
324
|
const r = o.split(/\s+/), a = parseFloat(r[0]);
|
|
325
325
|
if (isNaN(a)) return;
|
|
326
|
-
const
|
|
326
|
+
const c = [];
|
|
327
327
|
for (let u = 1; u < r.length; u++)
|
|
328
328
|
if (r[u].endsWith("%")) {
|
|
329
|
-
const
|
|
330
|
-
if (isNaN(
|
|
331
|
-
|
|
329
|
+
const f = parseFloat(r[u]) / 100;
|
|
330
|
+
if (isNaN(f)) return;
|
|
331
|
+
c.push(f);
|
|
332
332
|
}
|
|
333
|
-
|
|
333
|
+
c.length === 0 ? s.push({ output: a, pos: null }) : c.length === 1 ? s.push({ output: a, pos: c[0] }) : (s.push({ output: a, pos: c[0] }), s.push({ output: a, pos: c[1] }));
|
|
334
334
|
}
|
|
335
335
|
if (s.length === 0) return;
|
|
336
336
|
s[0].pos === null && (s[0].pos = 0), s[s.length - 1].pos === null && (s[s.length - 1].pos = 1);
|
|
@@ -340,9 +340,9 @@ function Tt(e) {
|
|
|
340
340
|
const o = i - 1;
|
|
341
341
|
let r = i;
|
|
342
342
|
for (; r < s.length && s[r].pos === null; ) r++;
|
|
343
|
-
const a = s[o].pos,
|
|
344
|
-
for (let
|
|
345
|
-
s[
|
|
343
|
+
const a = s[o].pos, c = s[r].pos, u = r - o;
|
|
344
|
+
for (let f = o + 1; f < r; f++)
|
|
345
|
+
s[f].pos = a + (c - a) * (f - o) / u;
|
|
346
346
|
i = r + 1;
|
|
347
347
|
} else
|
|
348
348
|
i++;
|
|
@@ -350,8 +350,8 @@ function Tt(e) {
|
|
|
350
350
|
s[o].pos < s[o - 1].pos && (s[o].pos = s[o - 1].pos);
|
|
351
351
|
return s;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
const t =
|
|
353
|
+
function is(e) {
|
|
354
|
+
const t = qt(e);
|
|
355
355
|
if (t)
|
|
356
356
|
return (n) => {
|
|
357
357
|
if (n <= t[0].pos) return t[0].output;
|
|
@@ -359,15 +359,15 @@ function Yn(e) {
|
|
|
359
359
|
if (n >= s.pos) return s.output;
|
|
360
360
|
let i = 0, o = t.length - 1;
|
|
361
361
|
for (; i < o - 1; ) {
|
|
362
|
-
const
|
|
363
|
-
t[
|
|
362
|
+
const c = i + o >>> 1;
|
|
363
|
+
t[c].pos <= n ? i = c : o = c;
|
|
364
364
|
}
|
|
365
365
|
const r = t[i], a = t[o];
|
|
366
366
|
return a.pos === r.pos ? a.output : r.output + (a.output - r.output) * (n - r.pos) / (a.pos - r.pos);
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
const t =
|
|
369
|
+
function os(e) {
|
|
370
|
+
const t = qt(e);
|
|
371
371
|
if (t)
|
|
372
372
|
return (n) => {
|
|
373
373
|
const s = [`${t[0].output}`];
|
|
@@ -383,17 +383,17 @@ function Un(e) {
|
|
|
383
383
|
return `(${s.join(" + ")})`;
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function Qe(e) {
|
|
387
387
|
if (!e) return;
|
|
388
|
-
const t =
|
|
389
|
-
return t || (
|
|
388
|
+
const t = at[e];
|
|
389
|
+
return t || (ns(e) ?? is(e) ?? at.linear);
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function rs(e) {
|
|
392
392
|
if (!e) return;
|
|
393
|
-
const t =
|
|
394
|
-
return t || (
|
|
393
|
+
const t = ct[e];
|
|
394
|
+
return t || (ss(e) ?? os(e) ?? ct.linear);
|
|
395
395
|
}
|
|
396
|
-
class
|
|
396
|
+
class as extends ce {
|
|
397
397
|
animationGroups;
|
|
398
398
|
delay;
|
|
399
399
|
offset;
|
|
@@ -402,7 +402,7 @@ class Xn extends ie {
|
|
|
402
402
|
timingOptions;
|
|
403
403
|
constructor(t, n = {}) {
|
|
404
404
|
const s = t.flatMap((i) => [...i.animations]);
|
|
405
|
-
super(s), this.animationGroups = t, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.sequenceId = n.sequenceId, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing :
|
|
405
|
+
super(s), this.animationGroups = t, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.sequenceId = n.sequenceId, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : Qe(n.offsetEasing) ?? Pt, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: o, duration: r, iterations: a }) => ({
|
|
406
406
|
delay: o,
|
|
407
407
|
duration: Number.isFinite(r) ? r : 0,
|
|
408
408
|
iterations: Number.isFinite(a) ? a : 1
|
|
@@ -428,14 +428,14 @@ class Xn extends ie {
|
|
|
428
428
|
const t = this.calculateOffsets(), n = this.getSequenceActiveDuration(t), s = this.animationGroups.length - 1;
|
|
429
429
|
this.animationGroups.forEach((i, o) => {
|
|
430
430
|
i.animations.forEach((r, a) => {
|
|
431
|
-
const
|
|
432
|
-
if (!
|
|
433
|
-
const { delay: u, duration:
|
|
431
|
+
const c = r.effect;
|
|
432
|
+
if (!c) return;
|
|
433
|
+
const { delay: u, duration: f, iterations: l } = this.timingOptions[o][a], d = u + t[o], h = n - (d + f * l);
|
|
434
434
|
if (i.isCSS && this.sequenceId) {
|
|
435
|
-
const { target: p } =
|
|
436
|
-
p instanceof HTMLElement && (p.style.setProperty(`--motion-${this.sequenceId}-index`, `${o}`), p.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)),
|
|
435
|
+
const { target: p } = c;
|
|
436
|
+
p instanceof HTMLElement && (p.style.setProperty(`--motion-${this.sequenceId}-index`, `${o}`), p.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)), c.updateTiming({ endDelay: h });
|
|
437
437
|
} else
|
|
438
|
-
|
|
438
|
+
c.updateTiming({ delay: d + this.delay, endDelay: h });
|
|
439
439
|
});
|
|
440
440
|
});
|
|
441
441
|
}
|
|
@@ -444,8 +444,8 @@ class Xn extends ie {
|
|
|
444
444
|
for (let s = 0; s < this.timingOptions.length; s++) {
|
|
445
445
|
const i = this.timingOptions[s].reduce((o, r) => {
|
|
446
446
|
if (!r) return o;
|
|
447
|
-
const { delay: a, duration:
|
|
448
|
-
return Math.max(o, a +
|
|
447
|
+
const { delay: a, duration: c, iterations: u } = r;
|
|
448
|
+
return Math.max(o, a + c * u);
|
|
449
449
|
}, 0);
|
|
450
450
|
n.push(t[s] + i);
|
|
451
451
|
}
|
|
@@ -462,7 +462,7 @@ class Xn extends ie {
|
|
|
462
462
|
for (const { index: s, group: i } of n) {
|
|
463
463
|
const o = Math.min(s, this.animationGroups.length);
|
|
464
464
|
this.animationGroups.splice(o, 0, i), this.timingOptions.splice(o, 0, i.getTimingOptions());
|
|
465
|
-
const r = [...i.animations], a = this.animationGroups.slice(0, o).reduce((
|
|
465
|
+
const r = [...i.animations], a = this.animationGroups.slice(0, o).reduce((c, u) => c + u.animations.length, 0);
|
|
466
466
|
this.animations.splice(a, 0, ...r);
|
|
467
467
|
}
|
|
468
468
|
this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
|
|
@@ -491,7 +491,7 @@ class Xn extends ie {
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
class
|
|
494
|
+
class cs {
|
|
495
495
|
_animation;
|
|
496
496
|
customEffect;
|
|
497
497
|
progress;
|
|
@@ -503,7 +503,7 @@ class Qn {
|
|
|
503
503
|
composite: "add"
|
|
504
504
|
}), { timeline: r } = i;
|
|
505
505
|
this._animation = new Animation(o, r), this._tickCbId = null, this.progress = null, this.customEffect = (a) => t(o.target, a), this._finishHandler = (a) => {
|
|
506
|
-
this.effect.target?.getAnimations().find((
|
|
506
|
+
this.effect.target?.getAnimations().find((c) => c === this._animation) || this.cancel();
|
|
507
507
|
}, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
|
|
508
508
|
}
|
|
509
509
|
// private tick method for customEffect loop implementation
|
|
@@ -631,20 +631,20 @@ class Qn {
|
|
|
631
631
|
return this._animation.dispatchEvent(t);
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function fs(e) {
|
|
635
635
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
636
636
|
}
|
|
637
|
-
var
|
|
638
|
-
function
|
|
639
|
-
return
|
|
637
|
+
var Ee = { exports: {} }, ut = Ee.exports, lt;
|
|
638
|
+
function us() {
|
|
639
|
+
return lt || (lt = 1, (function(e) {
|
|
640
640
|
(function(t) {
|
|
641
641
|
var n = function() {
|
|
642
|
-
}, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(
|
|
643
|
-
return setTimeout(
|
|
642
|
+
}, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(f) {
|
|
643
|
+
return setTimeout(f, 16);
|
|
644
644
|
};
|
|
645
645
|
function i() {
|
|
646
|
-
var
|
|
647
|
-
|
|
646
|
+
var f = this;
|
|
647
|
+
f.reads = [], f.writes = [], f.raf = s.bind(t);
|
|
648
648
|
}
|
|
649
649
|
i.prototype = {
|
|
650
650
|
constructor: i,
|
|
@@ -656,8 +656,8 @@ function Jn() {
|
|
|
656
656
|
*
|
|
657
657
|
* @param {Array} tasks
|
|
658
658
|
*/
|
|
659
|
-
runTasks: function(
|
|
660
|
-
for (var
|
|
659
|
+
runTasks: function(f) {
|
|
660
|
+
for (var l; l = f.shift(); ) l();
|
|
661
661
|
},
|
|
662
662
|
/**
|
|
663
663
|
* Adds a job to the read batch and
|
|
@@ -667,8 +667,8 @@ function Jn() {
|
|
|
667
667
|
* @param {Object} ctx the context to be bound to `fn` (optional).
|
|
668
668
|
* @public
|
|
669
669
|
*/
|
|
670
|
-
measure: function(
|
|
671
|
-
var d =
|
|
670
|
+
measure: function(f, l) {
|
|
671
|
+
var d = l ? f.bind(l) : f;
|
|
672
672
|
return this.reads.push(d), o(this), d;
|
|
673
673
|
},
|
|
674
674
|
/**
|
|
@@ -680,8 +680,8 @@ function Jn() {
|
|
|
680
680
|
* @param {Object} ctx the context to be bound to `fn` (optional).
|
|
681
681
|
* @public
|
|
682
682
|
*/
|
|
683
|
-
mutate: function(
|
|
684
|
-
var d =
|
|
683
|
+
mutate: function(f, l) {
|
|
684
|
+
var d = l ? f.bind(l) : f;
|
|
685
685
|
return this.writes.push(d), o(this), d;
|
|
686
686
|
},
|
|
687
687
|
/**
|
|
@@ -691,8 +691,8 @@ function Jn() {
|
|
|
691
691
|
* @return {Boolean} success
|
|
692
692
|
* @public
|
|
693
693
|
*/
|
|
694
|
-
clear: function(
|
|
695
|
-
return a(this.reads,
|
|
694
|
+
clear: function(f) {
|
|
695
|
+
return a(this.reads, f) || a(this.writes, f);
|
|
696
696
|
},
|
|
697
697
|
/**
|
|
698
698
|
* Extend this FastDom with some
|
|
@@ -728,89 +728,89 @@ function Jn() {
|
|
|
728
728
|
* @param {Object} props properties to mixin
|
|
729
729
|
* @return {FastDom}
|
|
730
730
|
*/
|
|
731
|
-
extend: function(
|
|
732
|
-
if (typeof
|
|
733
|
-
var
|
|
734
|
-
return l
|
|
731
|
+
extend: function(f) {
|
|
732
|
+
if (typeof f != "object") throw new Error("expected object");
|
|
733
|
+
var l = Object.create(this);
|
|
734
|
+
return c(l, f), l.fastdom = this, l.initialize && l.initialize(), l;
|
|
735
735
|
},
|
|
736
736
|
// override this with a function
|
|
737
737
|
// to prevent Errors in console
|
|
738
738
|
// when tasks throw
|
|
739
739
|
catch: null
|
|
740
740
|
};
|
|
741
|
-
function o(
|
|
742
|
-
|
|
741
|
+
function o(f) {
|
|
742
|
+
f.scheduled || (f.scheduled = !0, f.raf(r.bind(null, f)));
|
|
743
743
|
}
|
|
744
|
-
function r(
|
|
745
|
-
var
|
|
744
|
+
function r(f) {
|
|
745
|
+
var l = f.writes, d = f.reads, h;
|
|
746
746
|
try {
|
|
747
|
-
n("flushing reads", d.length),
|
|
747
|
+
n("flushing reads", d.length), f.runTasks(d), n("flushing writes", l.length), f.runTasks(l);
|
|
748
748
|
} catch (p) {
|
|
749
|
-
|
|
749
|
+
h = p;
|
|
750
750
|
}
|
|
751
|
-
if (
|
|
752
|
-
if (n("task errored",
|
|
753
|
-
else throw
|
|
751
|
+
if (f.scheduled = !1, (d.length || l.length) && o(f), h)
|
|
752
|
+
if (n("task errored", h.message), f.catch) f.catch(h);
|
|
753
|
+
else throw h;
|
|
754
754
|
}
|
|
755
|
-
function a(
|
|
756
|
-
var d =
|
|
757
|
-
return !!~d && !!
|
|
755
|
+
function a(f, l) {
|
|
756
|
+
var d = f.indexOf(l);
|
|
757
|
+
return !!~d && !!f.splice(d, 1);
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
for (var d in
|
|
761
|
-
|
|
759
|
+
function c(f, l) {
|
|
760
|
+
for (var d in l)
|
|
761
|
+
l.hasOwnProperty(d) && (f[d] = l[d]);
|
|
762
762
|
}
|
|
763
763
|
var u = t.fastdom = t.fastdom || new i();
|
|
764
764
|
e.exports = u;
|
|
765
|
-
})(typeof window < "u" ? window : typeof
|
|
766
|
-
})(
|
|
765
|
+
})(typeof window < "u" ? window : typeof ut < "u" ? ut : globalThis);
|
|
766
|
+
})(Ee)), Ee.exports;
|
|
767
767
|
}
|
|
768
|
-
var
|
|
769
|
-
const
|
|
770
|
-
function
|
|
771
|
-
Object.assign(
|
|
768
|
+
var ls = us();
|
|
769
|
+
const A = /* @__PURE__ */ fs(ls), De = {};
|
|
770
|
+
function ds(e) {
|
|
771
|
+
Object.assign(De, e);
|
|
772
772
|
}
|
|
773
|
-
function
|
|
774
|
-
return e in
|
|
773
|
+
function Ze(e, t = !0) {
|
|
774
|
+
return e in De ? De[e] : (t && console.warn(
|
|
775
775
|
`${e} not found in registry. Please make sure to import and register the preset.`
|
|
776
776
|
), null);
|
|
777
777
|
}
|
|
778
778
|
function Y(e, t) {
|
|
779
779
|
return e ? (t || document).getElementById(e) : null;
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function Rt(e, t) {
|
|
782
782
|
return e?.matches(`[data-motion-part~="${t}"]`) ? e : e?.querySelector(`[data-motion-part~="${t}"]`);
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function Lt(e, t) {
|
|
785
785
|
const n = typeof e == "string" ? Y(e) : e;
|
|
786
|
-
return t?.length ? t.map((s) =>
|
|
786
|
+
return t?.length ? t.map((s) => Rt(n, s)).filter(Boolean) : n ? [n] : [];
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function hs(e) {
|
|
789
789
|
const t = e.alternate ? "alternate" : "";
|
|
790
790
|
return e.reversed ? `${t ? `${t}-` : ""}reverse` : t || "normal";
|
|
791
791
|
}
|
|
792
|
-
function
|
|
793
|
-
return `${e.value}${
|
|
792
|
+
function Le(e) {
|
|
793
|
+
return `${e.value}${Xn(e.unit)}`;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${
|
|
795
|
+
function dt(e, t, n) {
|
|
796
|
+
return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${Le(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${Le(e.offset)} + ${t})` : Le(e.offset)}`;
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function Ft(e) {
|
|
799
799
|
return {
|
|
800
|
-
start:
|
|
801
|
-
end:
|
|
800
|
+
start: dt(e.startOffset, e.startOffsetAdd),
|
|
801
|
+
end: dt(e.endOffset, e.endOffsetAdd, !0)
|
|
802
802
|
};
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
return (t) =>
|
|
804
|
+
function xt(e) {
|
|
805
|
+
return (t) => A.measure(() => t(e));
|
|
806
806
|
}
|
|
807
|
-
function
|
|
808
|
-
return (t) =>
|
|
807
|
+
function Nt(e) {
|
|
808
|
+
return (t) => A.mutate(() => t(e));
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function se(e) {
|
|
811
811
|
if (e.namedEffect) {
|
|
812
812
|
const t = e.namedEffect.type;
|
|
813
|
-
return typeof t == "string" ?
|
|
813
|
+
return typeof t == "string" ? Ze(t) : null;
|
|
814
814
|
} else if (e.keyframeEffect) {
|
|
815
815
|
const t = (s) => {
|
|
816
816
|
const { name: i, keyframes: o } = s.keyframeEffect;
|
|
@@ -824,16 +824,16 @@ function te(e) {
|
|
|
824
824
|
return (t) => [{ ...t, keyframes: [] }];
|
|
825
825
|
return null;
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function Dt(e, t, n, s) {
|
|
828
828
|
return e.map((i, o) => {
|
|
829
829
|
const r = {
|
|
830
830
|
fill: i.fill,
|
|
831
|
-
easing:
|
|
831
|
+
easing: ye(i.easing),
|
|
832
832
|
iterations: i.iterations === 0 ? 1 / 0 : i.iterations || 1,
|
|
833
833
|
composite: i.composite,
|
|
834
|
-
direction:
|
|
834
|
+
direction: hs(i)
|
|
835
835
|
};
|
|
836
|
-
return
|
|
836
|
+
return Je(t) ? (r.duration = i.duration, r.delay = i.delay || 0) : t?.trigger === "view-progress" && (s || window.ViewTimeline) ? r.duration = "auto" : (r.duration = 99.99, r.delay = 0.01), {
|
|
837
837
|
// pass the preset's object as is - its keyframes and ranges may be getters
|
|
838
838
|
// that must only be read after its measure() callbacks ran
|
|
839
839
|
effect: i,
|
|
@@ -843,22 +843,22 @@ function kt(e, t, n, s) {
|
|
|
843
843
|
};
|
|
844
844
|
});
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function Je(e) {
|
|
847
847
|
return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function ht(e, t, n, s, i) {
|
|
850
850
|
if (e) {
|
|
851
|
-
if (
|
|
851
|
+
if (Je(s) && (t.duration = t.duration || 1, i?.reducedMotion))
|
|
852
852
|
if (t.iterations === 1 || t.iterations == null)
|
|
853
853
|
t = { ...t, duration: 1 };
|
|
854
854
|
else
|
|
855
855
|
return [];
|
|
856
856
|
let o;
|
|
857
|
-
return n instanceof HTMLElement && (o = { measure:
|
|
857
|
+
return n instanceof HTMLElement && (o = { measure: xt(n), mutate: Nt(n) }), e.web ? e.web(t, o, i) : e(t, o, i);
|
|
858
858
|
}
|
|
859
859
|
return [];
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function jt(e, t, n, s, i) {
|
|
862
862
|
const o = typeof e == "string" ? Y(e, i) : e;
|
|
863
863
|
if (n?.trigger === "pointer-move" && !t.keyframeEffect) {
|
|
864
864
|
let d = t;
|
|
@@ -866,10 +866,10 @@ function At(e, t, n, s, i) {
|
|
|
866
866
|
...t,
|
|
867
867
|
namedEffect: { id: "", type: "CustomMouse" }
|
|
868
868
|
});
|
|
869
|
-
const
|
|
869
|
+
const h = se(
|
|
870
870
|
d
|
|
871
|
-
), p =
|
|
872
|
-
|
|
871
|
+
), p = ht(
|
|
872
|
+
h,
|
|
873
873
|
t,
|
|
874
874
|
o,
|
|
875
875
|
n,
|
|
@@ -877,7 +877,7 @@ function At(e, t, n, s, i) {
|
|
|
877
877
|
);
|
|
878
878
|
return typeof p != "function" ? null : p(o);
|
|
879
879
|
}
|
|
880
|
-
const r =
|
|
880
|
+
const r = se(t), a = ht(
|
|
881
881
|
r,
|
|
882
882
|
t,
|
|
883
883
|
o,
|
|
@@ -886,169 +886,169 @@ function At(e, t, n, s, i) {
|
|
|
886
886
|
);
|
|
887
887
|
if (!a || a.length === 0)
|
|
888
888
|
return null;
|
|
889
|
-
const
|
|
889
|
+
const c = Dt(a, n, t.effectId);
|
|
890
890
|
let u;
|
|
891
|
-
const
|
|
892
|
-
|
|
891
|
+
const f = n?.trigger === "view-progress";
|
|
892
|
+
f && window.ViewTimeline && (u = new ViewTimeline({
|
|
893
893
|
subject: n.element || Y(n.componentId)
|
|
894
894
|
}));
|
|
895
|
-
const
|
|
896
|
-
const g =
|
|
897
|
-
|
|
898
|
-
"timing" in d && v.updateTiming(d.timing), v.setKeyframes(
|
|
895
|
+
const l = c.map(({ effect: d, options: h, id: p, part: m }) => {
|
|
896
|
+
const g = m ? Rt(o, m) : o, v = new KeyframeEffect(g || null, [], h);
|
|
897
|
+
A.mutate(() => {
|
|
898
|
+
"timing" in d && v.updateTiming(d.timing), v.setKeyframes(At(d.keyframes));
|
|
899
899
|
});
|
|
900
|
-
const y =
|
|
900
|
+
const y = f && u ? { timeline: u } : {}, b = typeof d.customEffect == "function" ? new cs(
|
|
901
901
|
d.customEffect,
|
|
902
902
|
g || null,
|
|
903
|
-
|
|
903
|
+
h,
|
|
904
904
|
y
|
|
905
905
|
) : new Animation(v, y.timeline);
|
|
906
|
-
if (
|
|
906
|
+
if (f)
|
|
907
907
|
if (u)
|
|
908
|
-
|
|
908
|
+
A.mutate(() => {
|
|
909
909
|
if (g) {
|
|
910
|
-
const { start: E, end:
|
|
911
|
-
|
|
910
|
+
const { start: E, end: S } = Ft(d);
|
|
911
|
+
b.rangeStart = E, b.rangeEnd = S;
|
|
912
912
|
}
|
|
913
|
-
|
|
913
|
+
b.play();
|
|
914
914
|
});
|
|
915
915
|
else {
|
|
916
|
-
const { startOffset: E, endOffset:
|
|
917
|
-
|
|
918
|
-
const
|
|
919
|
-
Object.assign(
|
|
916
|
+
const { startOffset: E, endOffset: S } = t;
|
|
917
|
+
A.mutate(() => {
|
|
918
|
+
const $ = d.startOffset || E, _ = d.endOffset || S;
|
|
919
|
+
Object.assign(b, {
|
|
920
920
|
start: {
|
|
921
|
-
name:
|
|
922
|
-
offset:
|
|
921
|
+
name: $.name,
|
|
922
|
+
offset: $.offset?.value,
|
|
923
923
|
add: d.startOffsetAdd
|
|
924
924
|
},
|
|
925
925
|
end: {
|
|
926
|
-
name:
|
|
927
|
-
offset:
|
|
926
|
+
name: _.name,
|
|
927
|
+
offset: _.offset?.value,
|
|
928
928
|
add: d.endOffsetAdd
|
|
929
929
|
}
|
|
930
930
|
});
|
|
931
931
|
});
|
|
932
932
|
}
|
|
933
|
-
return p && (
|
|
933
|
+
return p && (b.id = p), b;
|
|
934
934
|
});
|
|
935
|
-
return
|
|
935
|
+
return l.length > 1 && l.forEach((d) => d.persist?.()), new ce(l, {
|
|
936
936
|
...t,
|
|
937
937
|
trigger: { ...n || {} },
|
|
938
938
|
// make sure the group is ready after all animation targets are measured and mutated
|
|
939
|
-
measured: new Promise((d) =>
|
|
939
|
+
measured: new Promise((d) => A.mutate(d))
|
|
940
940
|
});
|
|
941
941
|
}
|
|
942
|
-
function
|
|
943
|
-
const { duration: s, delay: i, iterations: o = 1, fill: r, easing: a = "linear", direction:
|
|
944
|
-
let
|
|
945
|
-
if (
|
|
946
|
-
const g =
|
|
942
|
+
function ms(e, t, n) {
|
|
943
|
+
const { duration: s, delay: i, iterations: o = 1, fill: r, easing: a = "linear", direction: c } = e.options, u = e.effect.name, f = s === "auto", { sequenceId: l, delay: d, offset: h, offsetEasing: p = "linear" } = n || {};
|
|
944
|
+
let m = `${i ?? 0}ms`;
|
|
945
|
+
if (l && typeof p == "string") {
|
|
946
|
+
const g = rs(p);
|
|
947
947
|
if (g) {
|
|
948
948
|
const v = (i ?? 0) + (d ?? 0);
|
|
949
|
-
if (
|
|
949
|
+
if (h) {
|
|
950
950
|
const y = g(
|
|
951
|
-
`(var(--motion-${
|
|
951
|
+
`(var(--motion-${l}-index, 0) / var(--motion-${l}-last, 1))`
|
|
952
952
|
);
|
|
953
|
-
|
|
953
|
+
m = `calc(${`(${v} + ${y} * ${h} * var(--motion-${l}-last, 1))`} * 1ms)`;
|
|
954
954
|
} else
|
|
955
|
-
|
|
955
|
+
m = `${v}ms`;
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
|
-
return `${u} ${
|
|
958
|
+
return `${u} ${f ? "auto" : `${s}ms`}${f ? " " : ` ${m} `}${a}${r && r !== "none" ? ` ${r}` : ""} ${!o || o === 1 / 0 ? "infinite" : o}${c === "normal" ? "" : ` ${c}`} ${t ? "" : "paused"}`;
|
|
959
959
|
}
|
|
960
|
-
function
|
|
961
|
-
return e?.style ? (
|
|
960
|
+
function ps(e, t, n) {
|
|
961
|
+
return e?.style ? (Je(n) && (t.duration = t.duration || 1), e.style(t)) : [];
|
|
962
962
|
}
|
|
963
|
-
function
|
|
964
|
-
const i =
|
|
965
|
-
return r.map((
|
|
966
|
-
const { start:
|
|
963
|
+
function gs(e, t, n, s) {
|
|
964
|
+
const i = se(t), o = ps(i, t), r = Dt(o, n, t.effectId, !0), a = n?.trigger === "view-progress";
|
|
965
|
+
return r.map((c, u) => {
|
|
966
|
+
const { start: f, end: l } = a ? Ft(c.effect) : {};
|
|
967
967
|
return {
|
|
968
|
-
part:
|
|
969
|
-
animation:
|
|
970
|
-
composition:
|
|
971
|
-
custom:
|
|
972
|
-
name:
|
|
973
|
-
keyframes:
|
|
974
|
-
id:
|
|
968
|
+
part: c.part,
|
|
969
|
+
animation: ms(c, a, s),
|
|
970
|
+
composition: c.options.composite,
|
|
971
|
+
custom: c.effect.custom,
|
|
972
|
+
name: c.effect.name,
|
|
973
|
+
keyframes: At(c.effect.keyframes),
|
|
974
|
+
id: c.id && `${c.id}-${u + 1}`,
|
|
975
975
|
animationTimeline: a ? `--${n?.id}` : "",
|
|
976
|
-
animationRange:
|
|
976
|
+
animationRange: f || l ? `${f} ${l}` : ""
|
|
977
977
|
};
|
|
978
978
|
});
|
|
979
979
|
}
|
|
980
|
-
function
|
|
981
|
-
const s =
|
|
980
|
+
function vs(e, t, n) {
|
|
981
|
+
const s = se(t), i = e instanceof HTMLElement ? e : Y(e);
|
|
982
982
|
if (s && s.prepare && i) {
|
|
983
|
-
const o = { measure:
|
|
983
|
+
const o = { measure: xt(i), mutate: Nt(i) };
|
|
984
984
|
s.prepare(t, o);
|
|
985
985
|
}
|
|
986
|
-
n &&
|
|
986
|
+
n && A.mutate(n);
|
|
987
987
|
}
|
|
988
|
-
function
|
|
989
|
-
const n =
|
|
988
|
+
function zt(e, t) {
|
|
989
|
+
const n = se(t);
|
|
990
990
|
if (!n)
|
|
991
991
|
return null;
|
|
992
992
|
if (!n.style)
|
|
993
|
-
return t.effectId && e ?
|
|
994
|
-
const s = n.getNames(t), o =
|
|
995
|
-
return s.forEach((
|
|
996
|
-
r.includes(
|
|
997
|
-
o?.find((u) => u.animationName ===
|
|
993
|
+
return t.effectId && e ? ys(e, t.effectId, n.parts) : null;
|
|
994
|
+
const s = n.getNames(t), o = Lt(e, n.parts)?.flatMap((c) => c.getAnimations()), r = o?.map((c) => c.animationName) || [], a = [];
|
|
995
|
+
return s.forEach((c) => {
|
|
996
|
+
r.includes(c) && a.push(
|
|
997
|
+
o?.find((u) => u.animationName === c)
|
|
998
998
|
);
|
|
999
|
-
}), a?.length ? new
|
|
999
|
+
}), a?.length ? new ce(a) : null;
|
|
1000
1000
|
}
|
|
1001
|
-
function
|
|
1002
|
-
const i =
|
|
1001
|
+
function ys(e, t, n) {
|
|
1002
|
+
const i = Lt(e, n)?.flatMap((o) => o.getAnimations()).filter((o) => {
|
|
1003
1003
|
const r = o.id || o.animationName;
|
|
1004
1004
|
return r ? r.startsWith(t) : !0;
|
|
1005
1005
|
});
|
|
1006
|
-
return i?.length ? new
|
|
1006
|
+
return i?.length ? new ce(i) : null;
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1009
|
-
const { disabled: i, allowActiveEvent: o, ...r } = s, a =
|
|
1008
|
+
function Ht(e, t, n, s = {}) {
|
|
1009
|
+
const { disabled: i, allowActiveEvent: o, ...r } = s, a = jt(e, t, n, r);
|
|
1010
1010
|
if (!a)
|
|
1011
1011
|
return null;
|
|
1012
|
-
let
|
|
1012
|
+
let c = {};
|
|
1013
1013
|
if (n.trigger === "view-progress" && !window.ViewTimeline) {
|
|
1014
|
-
const u = n.element || Y(n.componentId), { ready:
|
|
1015
|
-
return a.animations.map((
|
|
1014
|
+
const u = n.element || Y(n.componentId), { ready: f } = a;
|
|
1015
|
+
return a.animations.map((l) => ({
|
|
1016
1016
|
/* we use getters for start and end in order to access the animation's start and end
|
|
1017
1017
|
only when initializing the scrub scene rather than immediately */
|
|
1018
1018
|
get start() {
|
|
1019
|
-
return
|
|
1019
|
+
return l.start;
|
|
1020
1020
|
},
|
|
1021
1021
|
get end() {
|
|
1022
|
-
return
|
|
1022
|
+
return l.end;
|
|
1023
1023
|
},
|
|
1024
1024
|
viewSource: u,
|
|
1025
|
-
ready:
|
|
1025
|
+
ready: f,
|
|
1026
1026
|
getProgress() {
|
|
1027
1027
|
return a.getProgress();
|
|
1028
1028
|
},
|
|
1029
|
-
effect(d,
|
|
1030
|
-
const { activeDuration: p } =
|
|
1031
|
-
|
|
1029
|
+
effect(d, h) {
|
|
1030
|
+
const { activeDuration: p } = l.effect.getComputedTiming(), { delay: m } = l.effect.getTiming();
|
|
1031
|
+
l.currentTime = ((m || 0) + (p || 0)) * h;
|
|
1032
1032
|
},
|
|
1033
1033
|
disabled: i,
|
|
1034
1034
|
destroy() {
|
|
1035
|
-
|
|
1035
|
+
l.cancel();
|
|
1036
1036
|
}
|
|
1037
1037
|
}));
|
|
1038
1038
|
} else if (n.trigger === "pointer-move") {
|
|
1039
|
-
const u = t, { centeredToTarget:
|
|
1039
|
+
const u = t, { centeredToTarget: f, transitionDuration: l, transitionEasing: d } = u, h = n.axis;
|
|
1040
1040
|
if (u.keyframeEffect) {
|
|
1041
1041
|
const p = a;
|
|
1042
1042
|
return p.animations?.length === 0 ? null : {
|
|
1043
1043
|
target: (typeof e == "string" ? Y(e) : e) ?? void 0,
|
|
1044
|
-
centeredToTarget:
|
|
1044
|
+
centeredToTarget: f,
|
|
1045
1045
|
ready: p.ready,
|
|
1046
1046
|
_currentProgress: 0,
|
|
1047
1047
|
getProgress() {
|
|
1048
1048
|
return this._currentProgress;
|
|
1049
1049
|
},
|
|
1050
1050
|
effect(g, v) {
|
|
1051
|
-
const y =
|
|
1051
|
+
const y = h === "x" ? v.x : v.y;
|
|
1052
1052
|
this._currentProgress = y, p.progress(y);
|
|
1053
1053
|
},
|
|
1054
1054
|
disabled: i ?? !1,
|
|
@@ -1057,24 +1057,24 @@ function Rt(e, t, n, s = {}) {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
};
|
|
1059
1059
|
}
|
|
1060
|
-
|
|
1061
|
-
centeredToTarget:
|
|
1060
|
+
c = {
|
|
1061
|
+
centeredToTarget: f,
|
|
1062
1062
|
allowActiveEvent: o
|
|
1063
|
-
}, t.customEffect &&
|
|
1063
|
+
}, t.customEffect && l && (c.transitionDuration = l, c.transitionEasing = Qe(d)), c.target = a.target;
|
|
1064
1064
|
}
|
|
1065
1065
|
return {
|
|
1066
|
-
...
|
|
1066
|
+
...c,
|
|
1067
1067
|
getProgress() {
|
|
1068
1068
|
return a.getProgress();
|
|
1069
1069
|
},
|
|
1070
|
-
effect(u,
|
|
1070
|
+
effect(u, f, l, d) {
|
|
1071
1071
|
a.progress(
|
|
1072
|
-
|
|
1072
|
+
l ? {
|
|
1073
1073
|
// @ts-expect-error spread error on p
|
|
1074
|
-
...
|
|
1075
|
-
v:
|
|
1074
|
+
...f,
|
|
1075
|
+
v: l,
|
|
1076
1076
|
active: d
|
|
1077
|
-
} :
|
|
1077
|
+
} : f
|
|
1078
1078
|
);
|
|
1079
1079
|
},
|
|
1080
1080
|
disabled: i,
|
|
@@ -1083,48 +1083,48 @@ function Rt(e, t, n, s = {}) {
|
|
|
1083
1083
|
}
|
|
1084
1084
|
};
|
|
1085
1085
|
}
|
|
1086
|
-
function
|
|
1087
|
-
const i =
|
|
1086
|
+
function fe(e, t, n, s = !1) {
|
|
1087
|
+
const i = zt(e, t);
|
|
1088
1088
|
return i ? (i.ready = new Promise((o) => {
|
|
1089
|
-
|
|
1090
|
-
}), i) :
|
|
1089
|
+
vs(e, t, o);
|
|
1090
|
+
}), i) : jt(e, t, n, { reducedMotion: s });
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function Es(e) {
|
|
1093
1093
|
return e === null ? [null] : typeof e == "string" ? Array.from(document.querySelectorAll(e)) : Array.isArray(e) ? e : [e];
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function Gt(e, t) {
|
|
1096
1096
|
const n = [];
|
|
1097
1097
|
for (const { target: s, options: i } of e) {
|
|
1098
|
-
const o =
|
|
1098
|
+
const o = Es(s);
|
|
1099
1099
|
for (const r of o) {
|
|
1100
|
-
const a =
|
|
1100
|
+
const a = fe(
|
|
1101
1101
|
r,
|
|
1102
1102
|
i,
|
|
1103
1103
|
void 0,
|
|
1104
1104
|
t?.reducedMotion
|
|
1105
1105
|
);
|
|
1106
|
-
a instanceof
|
|
1106
|
+
a instanceof ce && n.push(a);
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
1109
|
return n;
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const s =
|
|
1113
|
-
return new
|
|
1111
|
+
function ws(e, t, n) {
|
|
1112
|
+
const s = Gt(t, n);
|
|
1113
|
+
return new as(s, e);
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function bs(e, t = 2) {
|
|
1116
1116
|
return parseFloat(e.toFixed(t));
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1118
|
+
function $s(e) {
|
|
1119
1119
|
return /\[]/g.test(e);
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function Ss(e) {
|
|
1122
1122
|
return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function we(e, t) {
|
|
1125
1125
|
return t.includes("&") ? t.replace(/&/g, e) : `${e}${t}`;
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1127
|
+
function ie() {
|
|
1128
1128
|
return "wi-12343210".replace(
|
|
1129
1129
|
/\d/g,
|
|
1130
1130
|
(e) => String.fromCharCode(
|
|
@@ -1133,37 +1133,37 @@ function ne() {
|
|
|
1133
1133
|
// 97 for "a"
|
|
1134
1134
|
);
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function Wt(e) {
|
|
1137
1137
|
return !!(e.transition || e.transitionProperties);
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function Vt(e) {
|
|
1140
1140
|
const { transition: t, transitionProperties: n } = e;
|
|
1141
1141
|
return (t?.styleProperties || n || []).map((i) => ({
|
|
1142
1142
|
...i,
|
|
1143
|
-
name:
|
|
1143
|
+
name: $e(i.name)
|
|
1144
1144
|
}));
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function Bt(e) {
|
|
1147
1147
|
let { transition: t, transitionProperties: n } = e, s = [];
|
|
1148
1148
|
if (t?.styleProperties) {
|
|
1149
1149
|
const { duration: i, easing: o, delay: r } = t;
|
|
1150
1150
|
(i || r) && (t.styleProperties.some(
|
|
1151
|
-
(
|
|
1151
|
+
(c) => c.name.startsWith("--")
|
|
1152
1152
|
) ? s = [
|
|
1153
|
-
`all ${i || 0}ms ${
|
|
1153
|
+
`all ${i || 0}ms ${ye(o || "ease")}${r ? ` ${r}ms` : ""}`,
|
|
1154
1154
|
"visibility 0s"
|
|
1155
1155
|
] : s = t.styleProperties.map(
|
|
1156
|
-
(
|
|
1156
|
+
(c) => `${$e(c.name)} ${i || 0}ms ${ye(
|
|
1157
1157
|
o || "ease"
|
|
1158
1158
|
)}${r ? ` ${r}ms` : ""}`
|
|
1159
1159
|
));
|
|
1160
1160
|
} else
|
|
1161
1161
|
s = n?.filter((i) => i.duration || i.delay).map(
|
|
1162
|
-
(i) => `${
|
|
1162
|
+
(i) => `${$e(i.name)} ${i.duration || 0}ms ${ye(i.easing) || "ease"}${i.delay ? ` ${i.delay}ms` : ""}`
|
|
1163
1163
|
) || [];
|
|
1164
1164
|
return s;
|
|
1165
1165
|
}
|
|
1166
|
-
function
|
|
1166
|
+
function Is({
|
|
1167
1167
|
key: e,
|
|
1168
1168
|
effectId: t,
|
|
1169
1169
|
transition: n,
|
|
@@ -1171,44 +1171,44 @@ function hs({
|
|
|
1171
1171
|
childSelector: i = "> :first-child",
|
|
1172
1172
|
selectorCondition: o
|
|
1173
1173
|
}) {
|
|
1174
|
-
const r =
|
|
1174
|
+
const r = Bt({
|
|
1175
1175
|
transition: n,
|
|
1176
1176
|
transitionProperties: s
|
|
1177
|
-
}), a =
|
|
1177
|
+
}), a = Vt({ transition: n, transitionProperties: s }).map(
|
|
1178
1178
|
(p) => `${p.name}: ${p.value};`
|
|
1179
|
-
),
|
|
1180
|
-
`${
|
|
1179
|
+
), c = e.replace(/"/g, "'"), u = `:is(:state(${t}), :--${t}) ${i}`, f = `[data-interact-effect~="${t}"] ${i}`, l = o ? we(u, o) : u, d = o ? we(f, o) : f, h = [
|
|
1180
|
+
`${l},
|
|
1181
1181
|
${d} {
|
|
1182
1182
|
${a.join(`
|
|
1183
1183
|
`)}
|
|
1184
1184
|
}`
|
|
1185
1185
|
];
|
|
1186
1186
|
if (r.length) {
|
|
1187
|
-
const p = `[data-interact-key="${
|
|
1188
|
-
|
|
1187
|
+
const p = `[data-interact-key="${c}"] ${i}`, m = o ? we(p, o) : p;
|
|
1188
|
+
h.push(`${m} {
|
|
1189
1189
|
transition: ${r.join(", ")};
|
|
1190
1190
|
}`);
|
|
1191
1191
|
}
|
|
1192
|
-
return
|
|
1192
|
+
return h;
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1194
|
+
function ue(e, t, n) {
|
|
1195
1195
|
const s = (e || []).filter((i) => t[i]?.type === n && t[i].predicate).map((i) => t[i].predicate).join(") and (");
|
|
1196
1196
|
return s && `(${s})`;
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1199
|
-
const n =
|
|
1198
|
+
function H(e, t) {
|
|
1199
|
+
const n = ue(e, t, "media");
|
|
1200
1200
|
return n && window.matchMedia(n);
|
|
1201
1201
|
}
|
|
1202
|
-
function
|
|
1202
|
+
function U(e, t) {
|
|
1203
1203
|
return (e || []).filter((n) => t[n]?.type === "selector" && t[n].predicate).map((n) => `:is(${t[n].predicate})`).join("");
|
|
1204
1204
|
}
|
|
1205
|
-
const
|
|
1206
|
-
[
|
|
1207
|
-
[
|
|
1205
|
+
const Oe = "__rm-reduce", Yt = "__rm-no-preference", _s = {
|
|
1206
|
+
[Oe]: { type: "media", predicate: "prefers-reduced-motion: reduce" },
|
|
1207
|
+
[Yt]: {
|
|
1208
1208
|
type: "media",
|
|
1209
1209
|
predicate: "prefers-reduced-motion: no-preference"
|
|
1210
1210
|
}
|
|
1211
|
-
},
|
|
1211
|
+
}, Ts = /* @__PURE__ */ new Set([
|
|
1212
1212
|
"namedEffect",
|
|
1213
1213
|
"keyframeEffect",
|
|
1214
1214
|
"customEffect",
|
|
@@ -1228,17 +1228,17 @@ const Ie = "__rm-reduce", Dt = "__rm-no-preference", ms = {
|
|
|
1228
1228
|
"transitionDuration",
|
|
1229
1229
|
"transitionEasing"
|
|
1230
1230
|
]);
|
|
1231
|
-
function
|
|
1232
|
-
return { ...e, ...
|
|
1231
|
+
function Ut(e = {}) {
|
|
1232
|
+
return { ...e, ..._s };
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1234
|
+
function Pe(...e) {
|
|
1235
1235
|
return e.find(Boolean) ?? "collapse";
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1238
|
-
return
|
|
1237
|
+
function je(e) {
|
|
1238
|
+
return Wt(e) ? "state" : "duration" in e ? "time" : "scrub";
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1241
|
-
const t =
|
|
1240
|
+
function mt(e) {
|
|
1241
|
+
const t = je(e);
|
|
1242
1242
|
if (t === "state") {
|
|
1243
1243
|
const { transition: s, transitionProperties: i } = e;
|
|
1244
1244
|
return {
|
|
@@ -1255,8 +1255,8 @@ function rt(e) {
|
|
|
1255
1255
|
const { iterations: n = 1 } = e;
|
|
1256
1256
|
return t === "scrub" || !n || n === 1 / 0 ? null : { ...e, duration: 0 };
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1259
|
-
const s = ([o]) =>
|
|
1258
|
+
function Ms(e, t, n) {
|
|
1259
|
+
const s = ([o]) => Ts.has(o), { keyframeEffect: i } = n;
|
|
1260
1260
|
return {
|
|
1261
1261
|
...Object.fromEntries(Object.entries(e).filter((o) => !s(o))),
|
|
1262
1262
|
...Object.fromEntries(Object.entries(n).filter(s)),
|
|
@@ -1266,39 +1266,39 @@ function gs(e, t, n) {
|
|
|
1266
1266
|
}
|
|
1267
1267
|
};
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1269
|
+
function Os(e, t, n) {
|
|
1270
1270
|
switch (t) {
|
|
1271
1271
|
case "ignore":
|
|
1272
1272
|
return e;
|
|
1273
1273
|
case "cancel":
|
|
1274
1274
|
return null;
|
|
1275
1275
|
case "collapse":
|
|
1276
|
-
return
|
|
1276
|
+
return mt(e);
|
|
1277
1277
|
default: {
|
|
1278
1278
|
const s = n[t];
|
|
1279
|
-
return s &&
|
|
1279
|
+
return s && je(s) === je(e) ? Ms(e, t, s) : mt(e);
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
1283
|
-
function
|
|
1283
|
+
function pt(e, t) {
|
|
1284
1284
|
return {
|
|
1285
1285
|
...e,
|
|
1286
1286
|
conditions: [...e.conditions || [], t]
|
|
1287
1287
|
};
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1290
|
-
return !!e.conditions?.includes(
|
|
1289
|
+
function Ps(e) {
|
|
1290
|
+
return !!e.conditions?.includes(Oe);
|
|
1291
1291
|
}
|
|
1292
|
-
function
|
|
1293
|
-
const o =
|
|
1292
|
+
function Kt(e, t, { effects: n, force: s, collapsesStagger: i }) {
|
|
1293
|
+
const o = Os(e, t, n);
|
|
1294
1294
|
if (s)
|
|
1295
1295
|
return o ? [o] : [];
|
|
1296
1296
|
if (o === e && !i)
|
|
1297
1297
|
return [e];
|
|
1298
|
-
const r =
|
|
1299
|
-
return o ? [r,
|
|
1298
|
+
const r = pt(e, Yt);
|
|
1299
|
+
return o ? [r, pt(o, Oe)] : [r];
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1301
|
+
const Xt = /* @__PURE__ */ new Map([
|
|
1302
1302
|
["viewEnter", "once"],
|
|
1303
1303
|
["animationEnd", "once"],
|
|
1304
1304
|
["hover", "alternate"],
|
|
@@ -1306,108 +1306,108 @@ const Ht = /* @__PURE__ */ new Map([
|
|
|
1306
1306
|
["activate", "alternate"],
|
|
1307
1307
|
["interest", "alternate"]
|
|
1308
1308
|
]);
|
|
1309
|
-
function
|
|
1309
|
+
function Cs({ namedEffect: e, keyframeEffect: t, customEffect: n }, s) {
|
|
1310
1310
|
return e ? !s && !!e.type : !!t || !(n && s);
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1312
|
+
function gt(e, t) {
|
|
1313
1313
|
const { namedEffect: n, customEffect: s, keyframeEffect: i, transition: o, transitionProperties: r, ...a } = e;
|
|
1314
1314
|
return n ? t || !n.type ? a : { namedEffect: n, ...a } : i ? { keyframeEffect: i, ...a } : s ? a : o ? { transition: o, ...a } : r ? { transitionProperties: r, ...a } : a;
|
|
1315
1315
|
}
|
|
1316
|
-
function
|
|
1317
|
-
const { effects: o = {}, conditions: r = {} } = n, { key: a, trigger:
|
|
1318
|
-
e.effectId || (e.effectId = s ||
|
|
1319
|
-
const { effectId:
|
|
1320
|
-
let { key:
|
|
1321
|
-
if (!
|
|
1316
|
+
function Qt(e, t, n, s, i = {}) {
|
|
1317
|
+
const { effects: o = {}, conditions: r = {} } = n, { key: a, trigger: c, conditions: u = [] } = t, f = c === "pointerMove";
|
|
1318
|
+
e.effectId || (e.effectId = s || ie());
|
|
1319
|
+
const { effectId: l } = e, d = { ...o[l] || {}, ...e };
|
|
1320
|
+
let { key: h, conditions: p, triggerType: m } = d;
|
|
1321
|
+
if (!h) {
|
|
1322
1322
|
if (!a)
|
|
1323
1323
|
return null;
|
|
1324
|
-
|
|
1324
|
+
h = a;
|
|
1325
1325
|
}
|
|
1326
|
-
if (
|
|
1326
|
+
if ($s(h))
|
|
1327
1327
|
return null;
|
|
1328
1328
|
const g = u.filter(
|
|
1329
|
-
(
|
|
1329
|
+
($) => r[$].type === "media"
|
|
1330
1330
|
);
|
|
1331
1331
|
p = [
|
|
1332
1332
|
...new Set(
|
|
1333
1333
|
[...p || [], ...g].filter(
|
|
1334
|
-
(
|
|
1334
|
+
($) => r[$]
|
|
1335
1335
|
)
|
|
1336
1336
|
)
|
|
1337
|
-
],
|
|
1337
|
+
], m || (m = Xt.get(c));
|
|
1338
1338
|
const { namedEffect: v, keyframeEffect: y } = d;
|
|
1339
1339
|
if (!v && y && !y.name) {
|
|
1340
|
-
const
|
|
1341
|
-
y.name =
|
|
1340
|
+
const $ = l && !(o[l] && "keyframeEffect" in e);
|
|
1341
|
+
y.name = $ ? l : ie();
|
|
1342
1342
|
}
|
|
1343
|
-
if (!
|
|
1343
|
+
if (!Cs(d, f))
|
|
1344
1344
|
return null;
|
|
1345
|
-
const
|
|
1345
|
+
const b = { ...d, key: h, conditions: p, effectId: l, triggerType: m }, E = { ...b, initial: _n(t, b) }, S = Kt(
|
|
1346
1346
|
E,
|
|
1347
|
-
|
|
1347
|
+
Pe(
|
|
1348
1348
|
d.reducedMotionPolicy,
|
|
1349
1349
|
i.policy,
|
|
1350
1350
|
t.reducedMotionPolicy,
|
|
1351
1351
|
i.defaultPolicy
|
|
1352
1352
|
),
|
|
1353
1353
|
{ effects: o, force: i.force, collapsesStagger: i.collapsesStagger }
|
|
1354
|
-
).map((
|
|
1355
|
-
return
|
|
1356
|
-
}
|
|
1357
|
-
function
|
|
1358
|
-
const { sequences: r = {}, conditions: a = {} } = n, { trigger:
|
|
1359
|
-
e.sequenceId || (e.sequenceId = s ||
|
|
1360
|
-
const { sequenceId:
|
|
1361
|
-
|
|
1354
|
+
).map(($) => gt($, f));
|
|
1355
|
+
return S.length ? { ...gt(E, f), variants: S } : null;
|
|
1356
|
+
}
|
|
1357
|
+
function As(e, t, n, s, i, o = {}) {
|
|
1358
|
+
const { sequences: r = {}, conditions: a = {} } = n, { trigger: c, conditions: u = [] } = t;
|
|
1359
|
+
e.sequenceId || (e.sequenceId = s || ie());
|
|
1360
|
+
const { sequenceId: f } = e, l = { ...r[f] || {}, ...e }, d = Pe(
|
|
1361
|
+
l.reducedMotionPolicy,
|
|
1362
1362
|
t.reducedMotionPolicy,
|
|
1363
1363
|
o.defaultPolicy
|
|
1364
1364
|
);
|
|
1365
1365
|
let {
|
|
1366
|
-
effects:
|
|
1366
|
+
effects: h,
|
|
1367
1367
|
conditions: p,
|
|
1368
|
-
triggerType:
|
|
1368
|
+
triggerType: m,
|
|
1369
1369
|
delay: g = 0,
|
|
1370
1370
|
offset: v = 0,
|
|
1371
1371
|
offsetEasing: y = "linear"
|
|
1372
|
-
} =
|
|
1373
|
-
if (typeof y == "function" || !
|
|
1372
|
+
} = l;
|
|
1373
|
+
if (typeof y == "function" || !h)
|
|
1374
1374
|
return null;
|
|
1375
|
-
|
|
1376
|
-
const
|
|
1377
|
-
(
|
|
1375
|
+
m || (m = Xt.get(c));
|
|
1376
|
+
const b = u.filter(
|
|
1377
|
+
($) => a[$].type === "media"
|
|
1378
1378
|
);
|
|
1379
1379
|
p = [
|
|
1380
1380
|
...new Set(
|
|
1381
|
-
[...p || [],
|
|
1382
|
-
(
|
|
1381
|
+
[...p || [], ...b].filter(
|
|
1382
|
+
($) => a[$]
|
|
1383
1383
|
)
|
|
1384
1384
|
)
|
|
1385
1385
|
];
|
|
1386
|
-
const
|
|
1387
|
-
const I =
|
|
1388
|
-
{
|
|
1386
|
+
const S = h.map(($, _) => {
|
|
1387
|
+
const I = Qt(
|
|
1388
|
+
{ ...$, triggerType: m, conditions: [...$.conditions || [], ...p] },
|
|
1389
1389
|
t,
|
|
1390
1390
|
n,
|
|
1391
|
-
`${
|
|
1391
|
+
`${f}-eff-${_}`,
|
|
1392
1392
|
{ ...o, policy: d, collapsesStagger: d !== "ignore" }
|
|
1393
1393
|
);
|
|
1394
|
-
return I && Object.assign(I, { slotKey: i?.(
|
|
1395
|
-
}).filter((
|
|
1396
|
-
return
|
|
1397
|
-
sequenceId:
|
|
1398
|
-
triggerType:
|
|
1394
|
+
return I && Object.assign(I, { slotKey: i?.(_) });
|
|
1395
|
+
}).filter(($) => $ !== null);
|
|
1396
|
+
return S.length ? {
|
|
1397
|
+
sequenceId: f,
|
|
1398
|
+
triggerType: m,
|
|
1399
1399
|
conditions: p,
|
|
1400
1400
|
delay: g,
|
|
1401
1401
|
offset: v,
|
|
1402
1402
|
offsetEasing: y,
|
|
1403
1403
|
reducedMotionPolicy: d,
|
|
1404
|
-
effects:
|
|
1404
|
+
effects: S
|
|
1405
1405
|
} : null;
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1408
|
-
return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" :
|
|
1407
|
+
function ks(e) {
|
|
1408
|
+
return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : $e(e);
|
|
1409
1409
|
}
|
|
1410
|
-
function
|
|
1410
|
+
function qs(e) {
|
|
1411
1411
|
if (!e.length)
|
|
1412
1412
|
return [];
|
|
1413
1413
|
const t = e.map((i) => ({ ...i }));
|
|
@@ -1422,65 +1422,65 @@ function Ss(e) {
|
|
|
1422
1422
|
return console.error("Offsets must be in the range [0,1]"), [];
|
|
1423
1423
|
const r = i - n;
|
|
1424
1424
|
for (let a = n + 1; a < i; a++) {
|
|
1425
|
-
const
|
|
1426
|
-
t[a].offset = s + (o - s) *
|
|
1425
|
+
const c = (a - n) / r;
|
|
1426
|
+
t[a].offset = s + (o - s) * c;
|
|
1427
1427
|
}
|
|
1428
1428
|
n = i, s = o;
|
|
1429
1429
|
}
|
|
1430
1430
|
return t;
|
|
1431
1431
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${
|
|
1432
|
+
function Rs(e, t) {
|
|
1433
|
+
const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${ks(s)}: ${i};`).join(`
|
|
1434
1434
|
`);
|
|
1435
1435
|
return `${t}% {
|
|
1436
1436
|
${n}
|
|
1437
1437
|
}`;
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1440
|
-
const n =
|
|
1439
|
+
function Ls(e, t) {
|
|
1440
|
+
const n = qs(t);
|
|
1441
1441
|
if (!n.length)
|
|
1442
1442
|
return "";
|
|
1443
1443
|
let s = n.map((i) => {
|
|
1444
|
-
const o = i.offset, r =
|
|
1445
|
-
return
|
|
1444
|
+
const o = i.offset, r = bs(o * 100);
|
|
1445
|
+
return Rs(i, r);
|
|
1446
1446
|
}).join(`
|
|
1447
1447
|
`);
|
|
1448
1448
|
return `@keyframes ${e} {
|
|
1449
1449
|
${s}
|
|
1450
1450
|
}`;
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function Fs(e) {
|
|
1453
1453
|
const { key: t, childSelector: n, declarations: s, media: i, states: o, selectorCondition: r, selectorSuffix: a } = e;
|
|
1454
1454
|
if (!s.length)
|
|
1455
1455
|
return "";
|
|
1456
|
-
let
|
|
1456
|
+
let c = `[data-interact-key="${t}"]`;
|
|
1457
1457
|
if (o && o.length) {
|
|
1458
|
-
const
|
|
1459
|
-
|
|
1458
|
+
const l = o.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
|
|
1459
|
+
c = `${c}:is(${l})`;
|
|
1460
1460
|
}
|
|
1461
|
-
n && (
|
|
1462
|
-
const u = s.map(({ name:
|
|
1463
|
-
`),
|
|
1461
|
+
n && (c = `${c} ${n}`), a && (c = `${c}${a}`), r && (c = we(c, r));
|
|
1462
|
+
const u = s.map(({ name: l, value: d, important: h }) => `${l}: ${d}${h ? " !important" : ""};`).join(`
|
|
1463
|
+
`), f = `${c} {
|
|
1464
1464
|
${u}
|
|
1465
1465
|
}`;
|
|
1466
1466
|
return i ? `@media ${i} {
|
|
1467
|
-
${
|
|
1468
|
-
}` :
|
|
1467
|
+
${f}
|
|
1468
|
+
}` : f;
|
|
1469
1469
|
}
|
|
1470
|
-
const
|
|
1470
|
+
const ze = [
|
|
1471
1471
|
"animation",
|
|
1472
1472
|
"animation-composition",
|
|
1473
1473
|
"animation-timeline",
|
|
1474
1474
|
"animation-range"
|
|
1475
|
-
],
|
|
1476
|
-
...
|
|
1475
|
+
], Ce = [
|
|
1476
|
+
...ze,
|
|
1477
1477
|
"transition",
|
|
1478
1478
|
"view-timeline"
|
|
1479
|
-
],
|
|
1480
|
-
function
|
|
1479
|
+
], Ae = ["animation", "transition", "timeline"];
|
|
1480
|
+
function F(e) {
|
|
1481
1481
|
return e === "transition" ? "transition" : e === "view-timeline" ? "timeline" : "animation";
|
|
1482
1482
|
}
|
|
1483
|
-
const
|
|
1483
|
+
const Z = {
|
|
1484
1484
|
transition: "_",
|
|
1485
1485
|
animation: "none",
|
|
1486
1486
|
"animation-composition": "replace",
|
|
@@ -1488,23 +1488,23 @@ const K = {
|
|
|
1488
1488
|
"animation-range": "normal",
|
|
1489
1489
|
"view-timeline": "none"
|
|
1490
1490
|
};
|
|
1491
|
-
function
|
|
1491
|
+
function Zt(e) {
|
|
1492
1492
|
return e.replace(new RegExp("(?<!(^|-))([aeiou]|tion)", "g"), "");
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1494
|
+
function z(e, t, n = !1, s) {
|
|
1495
1495
|
const i = s === void 0 ? "" : `-c${s}`;
|
|
1496
|
-
return `--${
|
|
1496
|
+
return `--${Zt(e)}${i}${n ? "-slot" : ""}-${t}`;
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1499
|
-
return `--${
|
|
1498
|
+
function oe(e, t) {
|
|
1499
|
+
return `--${Zt(e)}-c${t}`;
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1501
|
+
function xs(e, t) {
|
|
1502
1502
|
return Array.from(
|
|
1503
1503
|
{ length: t + 1 },
|
|
1504
|
-
(n, s) => `var(${
|
|
1504
|
+
(n, s) => `var(${oe(e, s)})`
|
|
1505
1505
|
).join(", ");
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1507
|
+
function Ns(e, t, n, s, i = 0, o) {
|
|
1508
1508
|
const r = {
|
|
1509
1509
|
animation: e,
|
|
1510
1510
|
transition: t,
|
|
@@ -1513,70 +1513,70 @@ function Cs(e, t, n, s, i = 0, o) {
|
|
|
1513
1513
|
animation: n,
|
|
1514
1514
|
transition: s,
|
|
1515
1515
|
timeline: 0
|
|
1516
|
-
},
|
|
1517
|
-
return
|
|
1516
|
+
}, c = (u, f) => `@property ${f} { syntax: "*"; inherits: false; initial-value: ${Z[u]}; }`;
|
|
1517
|
+
return Ce.flatMap((u) => [
|
|
1518
1518
|
...Array.from(
|
|
1519
|
-
{ length: r[
|
|
1520
|
-
(
|
|
1519
|
+
{ length: r[F(u)] },
|
|
1520
|
+
(f, l) => c(u, z(u, l, !1, o))
|
|
1521
1521
|
),
|
|
1522
1522
|
...Array.from(
|
|
1523
|
-
{ length: a[
|
|
1524
|
-
(
|
|
1523
|
+
{ length: a[F(u)] },
|
|
1524
|
+
(f, l) => c(u, z(u, l, !0, o))
|
|
1525
1525
|
),
|
|
1526
1526
|
// registers the lists of the configs before it too, for elements they don't target
|
|
1527
1527
|
...Array.from(
|
|
1528
|
-
{ length: o !== void 0 && r[
|
|
1529
|
-
(
|
|
1528
|
+
{ length: o !== void 0 && r[F(u)] ? o + 1 : 0 },
|
|
1529
|
+
(f, l) => c(u, oe(u, l))
|
|
1530
1530
|
)
|
|
1531
1531
|
]);
|
|
1532
1532
|
}
|
|
1533
|
-
function
|
|
1534
|
-
const i =
|
|
1535
|
-
(a) => e[
|
|
1533
|
+
function Ds(e, t, n, s) {
|
|
1534
|
+
const i = Ce.filter(
|
|
1535
|
+
(a) => e[F(a)].slotsInSequence > 0
|
|
1536
1536
|
);
|
|
1537
1537
|
if (i.length === 0)
|
|
1538
1538
|
return null;
|
|
1539
1539
|
const o = i.map((a) => {
|
|
1540
|
-
const { listIndex:
|
|
1540
|
+
const { listIndex: c, slotCursor: u, slotsInSequence: f } = e[F(a)];
|
|
1541
1541
|
return {
|
|
1542
|
-
name:
|
|
1542
|
+
name: z(a, c, !1, s),
|
|
1543
1543
|
value: Array.from(
|
|
1544
|
-
{ length:
|
|
1545
|
-
(
|
|
1544
|
+
{ length: f },
|
|
1545
|
+
(l, d) => `var(${z(a, u + d, !0, s)})`
|
|
1546
1546
|
).join(", ")
|
|
1547
1547
|
};
|
|
1548
1548
|
}), r = { key: e.key, childSelector: e.childSelector, declarations: o };
|
|
1549
|
-
return t && (r.media =
|
|
1549
|
+
return t && (r.media = ue(t, n || {}, "media"), r.selectorCondition = U(t, n || {})), r;
|
|
1550
1550
|
}
|
|
1551
|
-
function
|
|
1551
|
+
function js(e, t, n, s = 0, i) {
|
|
1552
1552
|
if (e.length === 0)
|
|
1553
1553
|
return "";
|
|
1554
1554
|
const o = {
|
|
1555
1555
|
animation: t,
|
|
1556
1556
|
transition: n,
|
|
1557
1557
|
timeline: s
|
|
1558
|
-
}, r =
|
|
1558
|
+
}, r = Ce.filter((u) => o[F(u)] > 0);
|
|
1559
1559
|
if (r.length === 0)
|
|
1560
1560
|
return "";
|
|
1561
1561
|
const a = r.flatMap((u) => {
|
|
1562
|
-
const
|
|
1563
|
-
{ length: o[
|
|
1562
|
+
const f = Array.from(
|
|
1563
|
+
{ length: o[F(u)] },
|
|
1564
1564
|
// TODO: maybe add `-intrct` to names? --anm-0 or --trns-0 could collide with user-defined names
|
|
1565
|
-
(
|
|
1565
|
+
(l, d) => `var(${z(u, d, !1, i)})`
|
|
1566
1566
|
).join(", ");
|
|
1567
|
-
return i === void 0 ? [{ name: u, value:
|
|
1568
|
-
{ name:
|
|
1569
|
-
{ name: u, value:
|
|
1567
|
+
return i === void 0 ? [{ name: u, value: f }] : [
|
|
1568
|
+
{ name: oe(u, i), value: f },
|
|
1569
|
+
{ name: u, value: xs(u, i) }
|
|
1570
1570
|
];
|
|
1571
1571
|
});
|
|
1572
1572
|
return `${e.map(
|
|
1573
|
-
({ key: u, childSelector:
|
|
1573
|
+
({ key: u, childSelector: f }) => `[data-interact-key="${u}"]${f ? ` ${f}` : ""}`
|
|
1574
1574
|
).join(", ")} {
|
|
1575
|
-
${a.map(({ name: u, value:
|
|
1575
|
+
${a.map(({ name: u, value: f }) => ` ${u}: ${f};`).join(`
|
|
1576
1576
|
`)}
|
|
1577
1577
|
}`;
|
|
1578
1578
|
}
|
|
1579
|
-
function
|
|
1579
|
+
function zs(e, t) {
|
|
1580
1580
|
if (e.length === 0)
|
|
1581
1581
|
return "";
|
|
1582
1582
|
if (t === void 0)
|
|
@@ -1585,34 +1585,34 @@ function Ps(e, t) {
|
|
|
1585
1585
|
}`;
|
|
1586
1586
|
const n = Array.from(
|
|
1587
1587
|
{ length: t + 1 },
|
|
1588
|
-
(s, i) => `var(${
|
|
1588
|
+
(s, i) => `var(${oe("timeline-scope", i)}, --_)`
|
|
1589
1589
|
).join(", ");
|
|
1590
1590
|
return `:root {
|
|
1591
|
-
${
|
|
1591
|
+
${oe("timeline-scope", t)}: ${e.join(", ")};
|
|
1592
1592
|
timeline-scope: ${n};
|
|
1593
1593
|
}`;
|
|
1594
1594
|
}
|
|
1595
|
-
const
|
|
1595
|
+
const he = {
|
|
1596
1596
|
rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
|
|
1597
1597
|
rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
|
|
1598
1598
|
};
|
|
1599
|
-
function
|
|
1600
|
-
const n = e?.name ??
|
|
1599
|
+
function Hs(e, t) {
|
|
1600
|
+
const n = e?.name ?? he.rangeStart.name, s = t?.name ?? e?.name ?? he.rangeEnd.name, i = {
|
|
1601
1601
|
name: n,
|
|
1602
|
-
offset: e?.offset ||
|
|
1602
|
+
offset: e?.offset || he.rangeStart.offset
|
|
1603
1603
|
}, o = {
|
|
1604
1604
|
name: s,
|
|
1605
|
-
offset: t?.offset ||
|
|
1605
|
+
offset: t?.offset || he.rangeEnd.offset
|
|
1606
1606
|
};
|
|
1607
1607
|
return { startOffset: i, endOffset: o };
|
|
1608
1608
|
}
|
|
1609
|
-
function
|
|
1609
|
+
function x(e) {
|
|
1610
1610
|
if ("keyframeEffect" in e && !e.keyframeEffect.name && "effectId" in e && (e.keyframeEffect.name = e.effectId), "duration" in e)
|
|
1611
1611
|
return {
|
|
1612
1612
|
id: "",
|
|
1613
1613
|
...e
|
|
1614
1614
|
};
|
|
1615
|
-
const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } =
|
|
1615
|
+
const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } = Hs(t, n);
|
|
1616
1616
|
return {
|
|
1617
1617
|
id: "",
|
|
1618
1618
|
startOffset: i,
|
|
@@ -1620,11 +1620,11 @@ function N(e) {
|
|
|
1620
1620
|
...s
|
|
1621
1621
|
};
|
|
1622
1622
|
}
|
|
1623
|
-
function
|
|
1623
|
+
function k(e, t, n) {
|
|
1624
1624
|
let s = e.get(t);
|
|
1625
1625
|
s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), s.add(n);
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1627
|
+
function le(e, t) {
|
|
1628
1628
|
e.get(t)?.forEach((s) => {
|
|
1629
1629
|
const { source: i, target: o, cleanup: r } = s;
|
|
1630
1630
|
r();
|
|
@@ -1632,15 +1632,15 @@ function ae(e, t) {
|
|
|
1632
1632
|
e.get(a)?.delete(s);
|
|
1633
1633
|
}), e.delete(t);
|
|
1634
1634
|
}
|
|
1635
|
-
const
|
|
1635
|
+
const vt = [
|
|
1636
1636
|
{ name: "visibility", value: "hidden" },
|
|
1637
1637
|
{ name: "clip-path", value: "none", important: !0 },
|
|
1638
1638
|
{ name: "transform", value: "none", important: !0 },
|
|
1639
1639
|
{ name: "translate", value: "none", important: !0 },
|
|
1640
1640
|
{ name: "scale", value: "none", important: !0 },
|
|
1641
1641
|
{ name: "rotate", value: "none", important: !0 }
|
|
1642
|
-
],
|
|
1643
|
-
function
|
|
1642
|
+
], He = { animation: !1, transition: !1, timeline: !1 };
|
|
1643
|
+
function Jt(e, t) {
|
|
1644
1644
|
const n = () => ({
|
|
1645
1645
|
listIndex: 0,
|
|
1646
1646
|
slotCursor: 0,
|
|
@@ -1659,33 +1659,33 @@ function Vt(e, t) {
|
|
|
1659
1659
|
keyframeEntries: /* @__PURE__ */ new Map()
|
|
1660
1660
|
};
|
|
1661
1661
|
}
|
|
1662
|
-
function
|
|
1662
|
+
function en(e, t, n) {
|
|
1663
1663
|
return Object.fromEntries(
|
|
1664
|
-
|
|
1665
|
-
const i =
|
|
1664
|
+
Ce.map((s) => {
|
|
1665
|
+
const i = F(s), { listIndex: o, slotCursor: r, slotsInSequence: a } = e[i];
|
|
1666
1666
|
return [
|
|
1667
1667
|
s,
|
|
1668
|
-
t[i] ?
|
|
1668
|
+
t[i] ? z(s, r + a, !0, n) : z(s, o, !1, n)
|
|
1669
1669
|
];
|
|
1670
1670
|
})
|
|
1671
1671
|
);
|
|
1672
1672
|
}
|
|
1673
|
-
function
|
|
1674
|
-
|
|
1673
|
+
function Ge(e, t, n) {
|
|
1674
|
+
Ae.forEach((s) => {
|
|
1675
1675
|
t[s] && (e[s].touched = !0, n[s] && (e[s].slotsInSequence += 1));
|
|
1676
1676
|
});
|
|
1677
1677
|
}
|
|
1678
|
-
function
|
|
1678
|
+
function Gs(e) {
|
|
1679
1679
|
const { namedEffect: t, keyframeEffect: n, transition: s, transitionProperties: i } = e;
|
|
1680
1680
|
return t || n ? "animation" : s || i ? "transition" : null;
|
|
1681
1681
|
}
|
|
1682
|
-
function
|
|
1683
|
-
return (e.variants || [e]).map(
|
|
1682
|
+
function tn(e) {
|
|
1683
|
+
return (e.variants || [e]).map(Gs).find(Boolean) || null;
|
|
1684
1684
|
}
|
|
1685
|
-
function
|
|
1685
|
+
function Ws(e) {
|
|
1686
1686
|
const t = /* @__PURE__ */ new Map();
|
|
1687
1687
|
return e.effects.forEach((n) => {
|
|
1688
|
-
const s =
|
|
1688
|
+
const s = tn(n);
|
|
1689
1689
|
if (!s)
|
|
1690
1690
|
return;
|
|
1691
1691
|
const i = B(n), o = t.get(i) || { animation: 0, transition: 0, timeline: 0 };
|
|
@@ -1697,162 +1697,162 @@ function qs(e) {
|
|
|
1697
1697
|
])
|
|
1698
1698
|
);
|
|
1699
1699
|
}
|
|
1700
|
-
function
|
|
1701
|
-
|
|
1700
|
+
function Vs(e) {
|
|
1701
|
+
Ae.forEach((t) => {
|
|
1702
1702
|
const n = e[t];
|
|
1703
1703
|
n.slotsInInteraction = Math.max(n.slotsInInteraction, n.slotsInSequence), n.slotsInSequence = 0;
|
|
1704
1704
|
});
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1707
|
-
|
|
1706
|
+
function Bs(e) {
|
|
1707
|
+
Ae.forEach((t) => {
|
|
1708
1708
|
const n = e[t];
|
|
1709
1709
|
n.listIndex += n.touched ? 1 : 0, n.slotCursor += n.slotsInInteraction, n.slotsInInteraction = 0, n.touched = !1;
|
|
1710
1710
|
});
|
|
1711
1711
|
}
|
|
1712
|
-
const
|
|
1712
|
+
const Ys = {
|
|
1713
1713
|
animation: "animation",
|
|
1714
1714
|
"animation-composition": "composition",
|
|
1715
1715
|
"animation-timeline": "animationTimeline",
|
|
1716
1716
|
"animation-range": "animationRange"
|
|
1717
1717
|
};
|
|
1718
|
-
function
|
|
1719
|
-
const { key: i, conditions: o } = t, r =
|
|
1718
|
+
function Us(e, t, n, s) {
|
|
1719
|
+
const { key: i, conditions: o } = t, r = ue(o, e.configConditions, "media"), a = U(o, e.configConditions), c = j(t, {
|
|
1720
1720
|
asCombinator: !0,
|
|
1721
1721
|
useFirstChild: e.useFirstChild,
|
|
1722
1722
|
addItemFilter: !0
|
|
1723
|
-
}), u = B(t),
|
|
1724
|
-
return
|
|
1723
|
+
}), u = B(t), f = e.targetsMap.get(u) || Jt(i, c), l = en(f, He, e.configIndex)["view-timeline"];
|
|
1724
|
+
return Ge(f, { animation: !1, transition: !1, timeline: !0 }, He), e.targetsMap.set(u, f), s.add(u), {
|
|
1725
1725
|
key: i,
|
|
1726
1726
|
media: r,
|
|
1727
1727
|
selectorCondition: a,
|
|
1728
|
-
childSelector:
|
|
1728
|
+
childSelector: c,
|
|
1729
1729
|
declarations: [
|
|
1730
1730
|
{
|
|
1731
|
-
name:
|
|
1731
|
+
name: l,
|
|
1732
1732
|
value: `--${n}`
|
|
1733
1733
|
}
|
|
1734
1734
|
]
|
|
1735
1735
|
};
|
|
1736
1736
|
}
|
|
1737
|
-
function
|
|
1737
|
+
function nn(e, t, n, s, i) {
|
|
1738
1738
|
const o = [];
|
|
1739
1739
|
for (const r of Object.keys(i)) {
|
|
1740
|
-
const a = `${
|
|
1740
|
+
const a = `${Xe}${r}`;
|
|
1741
1741
|
a in t && o.push(
|
|
1742
1742
|
...i[r](t[a], {
|
|
1743
1743
|
key: n,
|
|
1744
1744
|
scope: e,
|
|
1745
1745
|
config: t
|
|
1746
|
-
}).map((
|
|
1746
|
+
}).map((c) => ({ ...c, key: n, media: s }))
|
|
1747
1747
|
);
|
|
1748
1748
|
}
|
|
1749
1749
|
return o;
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1752
|
-
const { assigned: r, childSelector: a, partSelectors:
|
|
1753
|
-
key:
|
|
1754
|
-
effectId:
|
|
1751
|
+
function Ks(e, t, n, s, i, o) {
|
|
1752
|
+
const { assigned: r, childSelector: a, partSelectors: c } = n, u = { animation: !1, transition: !1, timeline: !1 }, {
|
|
1753
|
+
key: f,
|
|
1754
|
+
effectId: l,
|
|
1755
1755
|
conditions: d,
|
|
1756
|
-
namedEffect:
|
|
1756
|
+
namedEffect: h,
|
|
1757
1757
|
keyframeEffect: p,
|
|
1758
|
-
transition:
|
|
1758
|
+
transition: m,
|
|
1759
1759
|
transitionProperties: g,
|
|
1760
1760
|
initial: v
|
|
1761
|
-
} = t, y =
|
|
1761
|
+
} = t, y = ue(d, e.configConditions, "media"), b = U(d, e.configConditions), E = [
|
|
1762
1762
|
{
|
|
1763
|
-
key:
|
|
1763
|
+
key: f,
|
|
1764
1764
|
media: y,
|
|
1765
|
-
selectorCondition:
|
|
1765
|
+
selectorCondition: b,
|
|
1766
1766
|
childSelector: a,
|
|
1767
1767
|
declarations: []
|
|
1768
1768
|
}
|
|
1769
1769
|
];
|
|
1770
|
-
let
|
|
1771
|
-
const { declarations:
|
|
1772
|
-
e.plugins && E.push(...
|
|
1773
|
-
const
|
|
1774
|
-
if ((
|
|
1775
|
-
const I =
|
|
1776
|
-
(
|
|
1777
|
-
),
|
|
1778
|
-
|
|
1779
|
-
const
|
|
1780
|
-
(
|
|
1781
|
-
}),
|
|
1782
|
-
name:
|
|
1783
|
-
keyframes:
|
|
1784
|
-
})),
|
|
1785
|
-
...
|
|
1786
|
-
({ custom:
|
|
1770
|
+
let S = [];
|
|
1771
|
+
const { declarations: $ } = E[0];
|
|
1772
|
+
e.plugins && E.push(...nn("effect", t, f, y, e.plugins));
|
|
1773
|
+
const _ = v && t.duration === 0;
|
|
1774
|
+
if ((h || p) && !_) {
|
|
1775
|
+
const I = x(t), O = gs(null, I, s, o).filter(
|
|
1776
|
+
(T) => T.name
|
|
1777
|
+
), C = O.length ? {} : { "": [] };
|
|
1778
|
+
O.forEach((T) => {
|
|
1779
|
+
const M = T.part || "";
|
|
1780
|
+
(C[M] ||= []).push(T);
|
|
1781
|
+
}), S = O.map((T) => ({
|
|
1782
|
+
name: T.name,
|
|
1783
|
+
keyframes: T.keyframes
|
|
1784
|
+
})), $.push(
|
|
1785
|
+
...O.flatMap(
|
|
1786
|
+
({ custom: T }) => Object.entries(T || {}).filter(([M, P]) => P !== void 0).map(([M, P]) => ({ name: M, value: P }))
|
|
1787
1787
|
)
|
|
1788
|
-
), Object.entries(
|
|
1789
|
-
const
|
|
1790
|
-
_listPropertyName:
|
|
1791
|
-
name: i[
|
|
1792
|
-
value:
|
|
1793
|
-
const
|
|
1794
|
-
return
|
|
1788
|
+
), Object.entries(C).forEach(([T, M]) => {
|
|
1789
|
+
const P = ze.map((L) => ({
|
|
1790
|
+
_listPropertyName: L,
|
|
1791
|
+
name: i[L],
|
|
1792
|
+
value: M.map((qe) => {
|
|
1793
|
+
const Re = Ys[L];
|
|
1794
|
+
return qe[Re] || Z[L];
|
|
1795
1795
|
}).join(", ")
|
|
1796
1796
|
})).filter(
|
|
1797
|
-
({ _listPropertyName:
|
|
1797
|
+
({ _listPropertyName: L, name: qe, value: Re }) => Re !== Z[L] || r.has(qe)
|
|
1798
1798
|
);
|
|
1799
|
-
|
|
1800
|
-
const
|
|
1801
|
-
|
|
1802
|
-
key:
|
|
1799
|
+
P.forEach(({ name: L }) => r.add(L)), u.animation = u.animation || P.length > 0;
|
|
1800
|
+
const de = T ? `[data-motion-part~="${T}"]` : a;
|
|
1801
|
+
T && P.length && c.add(de), v ? (E.push({
|
|
1802
|
+
key: f,
|
|
1803
1803
|
media: y,
|
|
1804
|
-
selectorCondition:
|
|
1805
|
-
childSelector:
|
|
1806
|
-
declarations:
|
|
1804
|
+
selectorCondition: b,
|
|
1805
|
+
childSelector: de,
|
|
1806
|
+
declarations: vt,
|
|
1807
1807
|
selectorSuffix: ":not([data-interact-enter])"
|
|
1808
1808
|
}), E.push({
|
|
1809
|
-
key:
|
|
1809
|
+
key: f,
|
|
1810
1810
|
media: y,
|
|
1811
|
-
selectorCondition:
|
|
1812
|
-
childSelector:
|
|
1813
|
-
declarations:
|
|
1811
|
+
selectorCondition: b,
|
|
1812
|
+
childSelector: de,
|
|
1813
|
+
declarations: P,
|
|
1814
1814
|
selectorSuffix: ':not([data-interact-enter="done"])'
|
|
1815
|
-
})) :
|
|
1816
|
-
key:
|
|
1815
|
+
})) : T ? E.push({
|
|
1816
|
+
key: f,
|
|
1817
1817
|
media: y,
|
|
1818
|
-
selectorCondition:
|
|
1819
|
-
childSelector:
|
|
1820
|
-
declarations:
|
|
1821
|
-
}) :
|
|
1818
|
+
selectorCondition: b,
|
|
1819
|
+
childSelector: de,
|
|
1820
|
+
declarations: P
|
|
1821
|
+
}) : $.push(...P);
|
|
1822
1822
|
});
|
|
1823
|
-
} else if (
|
|
1824
|
-
const I =
|
|
1825
|
-
(
|
|
1823
|
+
} else if (m || g) {
|
|
1824
|
+
const I = Vt(t), O = Bt(t);
|
|
1825
|
+
(O.length || r.has(i.transition)) && ($.push({
|
|
1826
1826
|
name: i.transition,
|
|
1827
|
-
value:
|
|
1827
|
+
value: O.join(", ") || Z.transition
|
|
1828
1828
|
}), r.add(i.transition), u.transition = !0), E.push({
|
|
1829
|
-
key:
|
|
1829
|
+
key: f,
|
|
1830
1830
|
media: y,
|
|
1831
|
-
selectorCondition:
|
|
1831
|
+
selectorCondition: b,
|
|
1832
1832
|
childSelector: a,
|
|
1833
|
-
states: [
|
|
1833
|
+
states: [l],
|
|
1834
1834
|
declarations: I
|
|
1835
1835
|
});
|
|
1836
1836
|
} else
|
|
1837
|
-
|
|
1838
|
-
key:
|
|
1837
|
+
_ && E.push({
|
|
1838
|
+
key: f,
|
|
1839
1839
|
media: y,
|
|
1840
|
-
selectorCondition:
|
|
1840
|
+
selectorCondition: b,
|
|
1841
1841
|
childSelector: a,
|
|
1842
|
-
declarations:
|
|
1842
|
+
declarations: vt,
|
|
1843
1843
|
selectorSuffix: ":not([data-interact-enter])"
|
|
1844
|
-
}),
|
|
1845
|
-
...
|
|
1844
|
+
}), $.push(
|
|
1845
|
+
...ze.filter(
|
|
1846
1846
|
(I) => r.has(i[I])
|
|
1847
1847
|
).map((I) => ({
|
|
1848
1848
|
name: i[I],
|
|
1849
|
-
value:
|
|
1849
|
+
value: Z[I]
|
|
1850
1850
|
}))
|
|
1851
1851
|
);
|
|
1852
|
-
return { rules: E.filter((I) => I.declarations.length), keyframes:
|
|
1852
|
+
return { rules: E.filter((I) => I.declarations.length), keyframes: S, wrote: u };
|
|
1853
1853
|
}
|
|
1854
|
-
function
|
|
1855
|
-
const i = t.namedEffect &&
|
|
1854
|
+
function Xs(e, t, n, s) {
|
|
1855
|
+
const i = t.namedEffect && Ze(t.namedEffect.type, !1);
|
|
1856
1856
|
if (!i?.getNames)
|
|
1857
1857
|
return;
|
|
1858
1858
|
const o = (a) => i.getNames({ ...t, suffix: a });
|
|
@@ -1861,107 +1861,107 @@ function Ds(e, t, n, s) {
|
|
|
1861
1861
|
const r = e.keyframeEntries.get(n) || [];
|
|
1862
1862
|
e.keyframeEntries.set(n, [...r, { slotKey: s, getNames: o }]);
|
|
1863
1863
|
}
|
|
1864
|
-
function
|
|
1865
|
-
const s = e.forceReducedMotion ||
|
|
1864
|
+
function Qs(e, t, n) {
|
|
1865
|
+
const s = e.forceReducedMotion || Ps(t);
|
|
1866
1866
|
return n && s && n.reducedMotionPolicy !== "ignore" ? { ...n, offset: 0 } : n;
|
|
1867
1867
|
}
|
|
1868
|
-
function
|
|
1869
|
-
const r = B(t), a = e.targetsMap.get(r) ||
|
|
1868
|
+
function sn(e, t, n, s, i, o) {
|
|
1869
|
+
const r = B(t), a = e.targetsMap.get(r) || Jt(
|
|
1870
1870
|
t.key,
|
|
1871
|
-
|
|
1871
|
+
j(t, {
|
|
1872
1872
|
asCombinator: !0,
|
|
1873
1873
|
useFirstChild: e.useFirstChild,
|
|
1874
1874
|
addItemFilter: !0
|
|
1875
1875
|
})
|
|
1876
1876
|
);
|
|
1877
1877
|
s.add(r);
|
|
1878
|
-
const
|
|
1878
|
+
const c = o?.get(r) || He, u = en(a, c, e.configIndex), f = t.variants || [t], l = tn(t);
|
|
1879
1879
|
if (e.collectSlots)
|
|
1880
|
-
return
|
|
1881
|
-
(
|
|
1882
|
-
),
|
|
1880
|
+
return f.forEach(
|
|
1881
|
+
(m) => Xs(a, m, u.animation, t.slotKey)
|
|
1882
|
+
), Ge(
|
|
1883
1883
|
a,
|
|
1884
|
-
{ animation:
|
|
1885
|
-
|
|
1884
|
+
{ animation: l === "animation", transition: l === "transition", timeline: !1 },
|
|
1885
|
+
c
|
|
1886
1886
|
), e.targetsMap.set(r, a), [];
|
|
1887
|
-
const d = a.assigned,
|
|
1888
|
-
...
|
|
1887
|
+
const d = a.assigned, h = f.map((m) => (m.namedEffect && (m.suffix = e.keyframeSlots.get(t.slotKey)), a.assigned = new Set(d), {
|
|
1888
|
+
...Ks(
|
|
1889
1889
|
e,
|
|
1890
|
-
|
|
1890
|
+
m,
|
|
1891
1891
|
a,
|
|
1892
1892
|
n,
|
|
1893
1893
|
u,
|
|
1894
|
-
|
|
1894
|
+
Qs(e, m, i)
|
|
1895
1895
|
),
|
|
1896
1896
|
assigned: a.assigned
|
|
1897
1897
|
}));
|
|
1898
|
-
a.assigned = new Set(
|
|
1899
|
-
({ keyframes:
|
|
1898
|
+
a.assigned = new Set(h.flatMap((m) => [...m.assigned])), h.forEach(
|
|
1899
|
+
({ keyframes: m }) => m.forEach(({ name: g, keyframes: v }) => e.keyframesMap.set(g, v))
|
|
1900
1900
|
);
|
|
1901
1901
|
const p = Object.fromEntries(
|
|
1902
|
-
|
|
1902
|
+
Ae.map((m) => [m, h.some((g) => g.wrote[m])])
|
|
1903
1903
|
);
|
|
1904
|
-
return
|
|
1904
|
+
return Ge(a, p, c), e.targetsMap.set(r, a), h.flatMap(({ rules: m }) => m);
|
|
1905
1905
|
}
|
|
1906
|
-
function
|
|
1907
|
-
const i = [], o = /* @__PURE__ */ new Set(), r =
|
|
1906
|
+
function Zs(e, t, n, s) {
|
|
1907
|
+
const i = [], o = /* @__PURE__ */ new Set(), r = Ws(t);
|
|
1908
1908
|
i.push(
|
|
1909
1909
|
...t.effects.flatMap(
|
|
1910
|
-
(
|
|
1910
|
+
(c) => sn(e, c, n, o, t, r)
|
|
1911
1911
|
)
|
|
1912
1912
|
);
|
|
1913
1913
|
const { conditions: a } = t;
|
|
1914
|
-
return o.forEach((
|
|
1915
|
-
s.add(
|
|
1916
|
-
const u = e.targetsMap.get(
|
|
1917
|
-
|
|
1914
|
+
return o.forEach((c) => {
|
|
1915
|
+
s.add(c);
|
|
1916
|
+
const u = e.targetsMap.get(c), f = Ds(u, a, e.configConditions, e.configIndex);
|
|
1917
|
+
f && (f.declarations.forEach(({ name: l }) => u.assigned.add(l)), i.push(f)), Vs(u);
|
|
1918
1918
|
}), i;
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1921
|
-
const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, a = e.plugins ?
|
|
1920
|
+
function Js(e, t, n) {
|
|
1921
|
+
const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, a = e.plugins ? nn(
|
|
1922
1922
|
"interaction",
|
|
1923
1923
|
t,
|
|
1924
1924
|
s,
|
|
1925
|
-
|
|
1925
|
+
ue(i, e.configConditions, "media"),
|
|
1926
1926
|
e.plugins
|
|
1927
|
-
) : [], { trigger:
|
|
1928
|
-
trigger:
|
|
1929
|
-
id:
|
|
1930
|
-
},
|
|
1931
|
-
|
|
1932
|
-
const
|
|
1933
|
-
const
|
|
1934
|
-
|
|
1927
|
+
) : [], { trigger: c } = t, u = {
|
|
1928
|
+
trigger: Ss(c),
|
|
1929
|
+
id: te("trigger", [n], e.configIndex)
|
|
1930
|
+
}, f = /* @__PURE__ */ new Set();
|
|
1931
|
+
c === "viewProgress" && a.push(Us(e, t, u.id, f));
|
|
1932
|
+
const l = o.map((h, p) => {
|
|
1933
|
+
const m = Qt(
|
|
1934
|
+
h,
|
|
1935
1935
|
t,
|
|
1936
1936
|
e.config,
|
|
1937
|
-
|
|
1937
|
+
te("eff", [n, p], e.configIndex),
|
|
1938
1938
|
{ force: e.forceReducedMotion, defaultPolicy: e.reducedMotionPolicy }
|
|
1939
1939
|
);
|
|
1940
|
-
return
|
|
1941
|
-
}).filter((
|
|
1940
|
+
return m && Object.assign(m, { slotKey: Se(n, p) });
|
|
1941
|
+
}).filter((h) => h !== null);
|
|
1942
1942
|
a.push(
|
|
1943
|
-
...
|
|
1943
|
+
...l.flatMap((h) => sn(e, h, u, f))
|
|
1944
1944
|
);
|
|
1945
1945
|
const d = r.map(
|
|
1946
|
-
(
|
|
1947
|
-
|
|
1946
|
+
(h, p) => As(
|
|
1947
|
+
h,
|
|
1948
1948
|
t,
|
|
1949
1949
|
e.config,
|
|
1950
|
-
|
|
1951
|
-
(
|
|
1950
|
+
te("seq", [n, p], e.configIndex),
|
|
1951
|
+
(m) => Se(n, m, p),
|
|
1952
1952
|
{ force: e.forceReducedMotion, defaultPolicy: e.reducedMotionPolicy }
|
|
1953
1953
|
)
|
|
1954
|
-
).filter((
|
|
1954
|
+
).filter((h) => h !== null);
|
|
1955
1955
|
return a.push(
|
|
1956
1956
|
...d.flatMap(
|
|
1957
|
-
(
|
|
1957
|
+
(h) => Zs(e, h, u, f)
|
|
1958
1958
|
)
|
|
1959
|
-
),
|
|
1959
|
+
), c === "viewProgress" && f.size > 1 && e.scopedTimelines.push(`--${u.id}`), f.forEach((h) => Bs(e.targetsMap.get(h))), a;
|
|
1960
1960
|
}
|
|
1961
|
-
function
|
|
1961
|
+
function ei(e = {}) {
|
|
1962
1962
|
return typeof e == "boolean" ? { useFirstChild: e } : e;
|
|
1963
1963
|
}
|
|
1964
|
-
function
|
|
1964
|
+
function on(e, t) {
|
|
1965
1965
|
const {
|
|
1966
1966
|
useFirstChild: n = !0,
|
|
1967
1967
|
plugins: s,
|
|
@@ -1969,12 +1969,12 @@ function Xt(e, t) {
|
|
|
1969
1969
|
collectSlots: o = !1,
|
|
1970
1970
|
forceReducedMotion: r = w.forceReducedMotion,
|
|
1971
1971
|
reducedMotionPolicy: a = w.reducedMotionPolicy
|
|
1972
|
-
} = t,
|
|
1972
|
+
} = t, c = {
|
|
1973
1973
|
config: e,
|
|
1974
|
-
configConditions:
|
|
1974
|
+
configConditions: Ut(e.conditions),
|
|
1975
1975
|
targetsMap: /* @__PURE__ */ new Map(),
|
|
1976
1976
|
keyframesMap: /* @__PURE__ */ new Map(),
|
|
1977
|
-
keyframeSlots: o ? /* @__PURE__ */ new Map() :
|
|
1977
|
+
keyframeSlots: o ? /* @__PURE__ */ new Map() : rn(e, { configIndex: i, forceReducedMotion: r, reducedMotionPolicy: a }),
|
|
1978
1978
|
scopedTimelines: [],
|
|
1979
1979
|
collectSlots: o,
|
|
1980
1980
|
useFirstChild: n,
|
|
@@ -1983,176 +1983,204 @@ function Xt(e, t) {
|
|
|
1983
1983
|
plugins: s,
|
|
1984
1984
|
configIndex: i
|
|
1985
1985
|
}, u = e.interactions.flatMap(
|
|
1986
|
-
(
|
|
1986
|
+
(f, l) => Js(c, f, l)
|
|
1987
1987
|
);
|
|
1988
|
-
return { ctx:
|
|
1988
|
+
return { ctx: c, cssRules: u };
|
|
1989
1989
|
}
|
|
1990
|
-
function
|
|
1990
|
+
function te(e, t, n) {
|
|
1991
1991
|
return [e, ...n === void 0 ? [] : [`c${n}`], ...t].join("-");
|
|
1992
1992
|
}
|
|
1993
|
-
function
|
|
1993
|
+
function Se(e, t, n) {
|
|
1994
1994
|
return [e, n, t].filter((s) => s !== void 0).join(":");
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1997
|
-
const { ctx: n } =
|
|
1996
|
+
function rn(e, t = {}) {
|
|
1997
|
+
const { ctx: n } = on(e, { ...t, collectSlots: !0 }), s = /* @__PURE__ */ new Map(), i = (o) => o ? `-${o}` : void 0;
|
|
1998
1998
|
return n.targetsMap.forEach(({ keyframeEntries: o }) => {
|
|
1999
1999
|
const r = /* @__PURE__ */ new Set();
|
|
2000
2000
|
o.forEach((a) => {
|
|
2001
|
-
const
|
|
2002
|
-
let u = 0,
|
|
2003
|
-
for (;
|
|
2004
|
-
|
|
2005
|
-
|
|
2001
|
+
const c = (l) => a.flatMap(({ getNames: d }) => d(i(l)));
|
|
2002
|
+
let u = 0, f = c(u);
|
|
2003
|
+
for (; f.some((l) => r.has(l)); )
|
|
2004
|
+
f = c(++u);
|
|
2005
|
+
f.forEach((l) => r.add(l)), u && a.forEach(({ slotKey: l }) => s.set(l, i(u)));
|
|
2006
2006
|
});
|
|
2007
2007
|
}), s;
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2010
|
-
const { ctx: n, cssRules: s } =
|
|
2011
|
-
i.flatMap((
|
|
2012
|
-
|
|
2013
|
-
...[...
|
|
2009
|
+
function ti(e, t) {
|
|
2010
|
+
const { ctx: n, cssRules: s } = on(e, ei(t)), i = [...n.targetsMap.values()], o = Math.max(0, ...i.map(({ animation: h }) => h.listIndex)), r = Math.max(0, ...i.map(({ transition: h }) => h.listIndex)), a = Math.max(0, ...i.map(({ timeline: h }) => h.listIndex)), c = js(
|
|
2011
|
+
i.flatMap((h) => [
|
|
2012
|
+
h,
|
|
2013
|
+
...[...h.partSelectors].map((p) => ({ key: h.key, childSelector: p }))
|
|
2014
2014
|
]),
|
|
2015
2015
|
o,
|
|
2016
2016
|
r,
|
|
2017
2017
|
a,
|
|
2018
2018
|
n.configIndex
|
|
2019
|
-
), u = Math.max(0, ...i.map(({ animation:
|
|
2019
|
+
), u = Math.max(0, ...i.map(({ animation: h }) => h.slotCursor)), f = Math.max(
|
|
2020
2020
|
0,
|
|
2021
|
-
...i.map(({ transition:
|
|
2022
|
-
),
|
|
2021
|
+
...i.map(({ transition: h }) => h.slotCursor)
|
|
2022
|
+
), l = Ns(
|
|
2023
2023
|
o,
|
|
2024
2024
|
r,
|
|
2025
2025
|
u,
|
|
2026
|
-
|
|
2026
|
+
f,
|
|
2027
2027
|
a,
|
|
2028
2028
|
n.configIndex
|
|
2029
|
-
), d =
|
|
2030
|
-
return { keyframes: n.keyframesMap, atProperty:
|
|
2029
|
+
), d = zs(n.scopedTimelines, n.configIndex);
|
|
2030
|
+
return { keyframes: n.keyframesMap, atProperty: l, cssRules: s, listsRule: c, timelineScopeRule: d };
|
|
2031
2031
|
}
|
|
2032
|
-
function
|
|
2033
|
-
const { cssRules: n, keyframes: s, atProperty: i, listsRule: o, timelineScopeRule: r } =
|
|
2032
|
+
function qo(e, t) {
|
|
2033
|
+
const { cssRules: n, keyframes: s, atProperty: i, listsRule: o, timelineScopeRule: r } = ti(
|
|
2034
2034
|
e,
|
|
2035
2035
|
t
|
|
2036
2036
|
);
|
|
2037
2037
|
return [
|
|
2038
2038
|
...i,
|
|
2039
|
-
...[...s.entries()].map(([
|
|
2040
|
-
...n.map(
|
|
2039
|
+
...[...s.entries()].map(([c, u]) => Ls(c, u)),
|
|
2040
|
+
...n.map(Fs),
|
|
2041
2041
|
o,
|
|
2042
2042
|
r
|
|
2043
|
-
].filter((
|
|
2043
|
+
].filter((c) => c).join(`
|
|
2044
2044
|
`);
|
|
2045
2045
|
}
|
|
2046
|
-
const
|
|
2046
|
+
const ni = {
|
|
2047
2047
|
root: null,
|
|
2048
2048
|
rootMargin: "0px 0px -10% 0px",
|
|
2049
2049
|
threshold: [0]
|
|
2050
|
-
},
|
|
2050
|
+
}, si = {
|
|
2051
2051
|
root: null,
|
|
2052
2052
|
rootMargin: "0px",
|
|
2053
2053
|
threshold: [0]
|
|
2054
|
-
},
|
|
2055
|
-
function
|
|
2054
|
+
}, ii = 0.2;
|
|
2055
|
+
function oi(e) {
|
|
2056
2056
|
const t = e.trim().split(/\s+/), n = t[0], s = t.length > 1 ? t[1] : t[0], i = (o) => o.startsWith("-") ? o.slice(1) : parseFloat(o) ? `-${o}` : o;
|
|
2057
2057
|
return `${i(n)} 0px ${i(s)}`;
|
|
2058
2058
|
}
|
|
2059
|
-
const
|
|
2060
|
-
let
|
|
2061
|
-
function
|
|
2062
|
-
|
|
2059
|
+
const ne = {}, q = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakSet(), re = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap();
|
|
2060
|
+
let et = {}, J = null;
|
|
2061
|
+
function Ie(e, t, n) {
|
|
2062
|
+
(re.get(e) || t).unobserve(e), We.delete(e), n && re.delete(e);
|
|
2063
2063
|
}
|
|
2064
|
-
function
|
|
2065
|
-
|
|
2064
|
+
function ri(e) {
|
|
2065
|
+
et = e;
|
|
2066
|
+
}
|
|
2067
|
+
function an(e, t, n) {
|
|
2068
|
+
q.get(e)?.forEach(({ source: i, handler: o }) => {
|
|
2066
2069
|
i === e && o(t, n);
|
|
2067
2070
|
});
|
|
2068
2071
|
}
|
|
2069
|
-
function
|
|
2070
|
-
return
|
|
2072
|
+
function yt() {
|
|
2073
|
+
return J || (J = new IntersectionObserver((e) => {
|
|
2071
2074
|
e.forEach((t) => {
|
|
2072
2075
|
const n = t.target;
|
|
2073
|
-
t.isIntersecting ||
|
|
2076
|
+
t.isIntersecting || an(n, !1, !0);
|
|
2074
2077
|
});
|
|
2075
|
-
},
|
|
2078
|
+
}, si), J);
|
|
2079
|
+
}
|
|
2080
|
+
function tt(e, t = !1) {
|
|
2081
|
+
return JSON.stringify({ ...e, isSafeMode: t });
|
|
2076
2082
|
}
|
|
2077
|
-
function
|
|
2078
|
-
const n =
|
|
2079
|
-
if (
|
|
2080
|
-
return
|
|
2081
|
-
const s = e.threshold ??
|
|
2083
|
+
function nt(e, t = !1) {
|
|
2084
|
+
const n = tt(e, t);
|
|
2085
|
+
if (ne[n])
|
|
2086
|
+
return ne[n];
|
|
2087
|
+
const s = e.threshold ?? ii, i = t ? ni : {
|
|
2082
2088
|
root: null,
|
|
2083
|
-
rootMargin: e.inset ?
|
|
2089
|
+
rootMargin: e.inset ? oi(e.inset) : "0px",
|
|
2084
2090
|
threshold: s
|
|
2085
2091
|
}, o = new IntersectionObserver((r) => {
|
|
2086
2092
|
r.forEach((a) => {
|
|
2087
|
-
const
|
|
2088
|
-
if (u && (
|
|
2089
|
-
|
|
2090
|
-
const
|
|
2091
|
-
if (!
|
|
2093
|
+
const c = a.target, u = !We.has(c);
|
|
2094
|
+
if (u && (We.add(c), e.useSafeViewEnter && !a.isIntersecting)) {
|
|
2095
|
+
A.measure(() => {
|
|
2096
|
+
const f = a.boundingClientRect.height, l = a.rootBounds?.height;
|
|
2097
|
+
if (!l)
|
|
2092
2098
|
return;
|
|
2093
2099
|
const d = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
|
|
2094
|
-
d &&
|
|
2095
|
-
o.unobserve(
|
|
2096
|
-
const p =
|
|
2097
|
-
|
|
2100
|
+
d && f * d > l && A.mutate(() => {
|
|
2101
|
+
o.unobserve(c);
|
|
2102
|
+
const p = nt(e, !0);
|
|
2103
|
+
re.set(c, p), p.observe(c);
|
|
2098
2104
|
});
|
|
2099
2105
|
});
|
|
2100
2106
|
return;
|
|
2101
2107
|
}
|
|
2102
|
-
(a.isIntersecting || !u) &&
|
|
2108
|
+
(a.isIntersecting || !u) && an(c, a.isIntersecting);
|
|
2103
2109
|
});
|
|
2104
2110
|
}, i);
|
|
2105
|
-
return
|
|
2111
|
+
return ne[n] = o, o;
|
|
2106
2112
|
}
|
|
2107
|
-
function
|
|
2108
|
-
const r = { ...
|
|
2109
|
-
if (!
|
|
2113
|
+
function ai(e, t, n, s = {}, { selectorCondition: i, animation: o } = {}) {
|
|
2114
|
+
const r = { ...et, ...s }, a = n.triggerType || "once", c = o || fe(t, x(n));
|
|
2115
|
+
if (!c)
|
|
2110
2116
|
return;
|
|
2111
|
-
const u =
|
|
2112
|
-
a !== "once" &&
|
|
2113
|
-
let
|
|
2114
|
-
|
|
2117
|
+
const u = nt(r);
|
|
2118
|
+
a !== "once" && c.persist?.();
|
|
2119
|
+
let f = !0, l = !1, d;
|
|
2120
|
+
const h = (m, g) => {
|
|
2115
2121
|
if (!(i && !t.matches(i)))
|
|
2116
2122
|
if (a === "once") {
|
|
2117
|
-
if (
|
|
2118
|
-
|
|
2119
|
-
const v =
|
|
2120
|
-
(!v || v.size === 0 || v.size === 1 && v.has(d)) && (
|
|
2121
|
-
|
|
2122
|
-
}),
|
|
2123
|
+
if (m && !l) {
|
|
2124
|
+
l = !0;
|
|
2125
|
+
const v = q.get(e);
|
|
2126
|
+
(!v || v.size === 0 || v.size === 1 && v.has(d)) && Ie(e, u), c.onFinish(() => {
|
|
2127
|
+
q.get(e)?.delete(d), q.get(t)?.delete(d);
|
|
2128
|
+
}), c.play(() => {
|
|
2123
2129
|
const y = () => {
|
|
2124
2130
|
t.dataset.interactEnter = "start";
|
|
2125
|
-
},
|
|
2126
|
-
|
|
2131
|
+
}, b = () => {
|
|
2132
|
+
A.mutate(() => {
|
|
2127
2133
|
t.dataset.interactEnter = "done";
|
|
2128
2134
|
});
|
|
2129
2135
|
};
|
|
2130
|
-
|
|
2136
|
+
c.isCSS ? (A.mutate(() => {
|
|
2131
2137
|
requestAnimationFrame(y);
|
|
2132
|
-
}),
|
|
2138
|
+
}), c.onFinish(b), c.onAbort(b)) : (A.mutate(y), c.onFinish(b));
|
|
2133
2139
|
});
|
|
2134
2140
|
}
|
|
2135
|
-
} else a === "alternate" ?
|
|
2136
|
-
}
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
}
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
}
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2141
|
+
} else a === "alternate" ? f && m ? (f = !1, c.play()) : f || c.reverse() : a === "repeat" ? m ? (c.progress(0), c.play()) : g && (c.pause(), c.progress(0)) : a === "state" && (m ? c.play() : g && c.pause());
|
|
2142
|
+
};
|
|
2143
|
+
d = { source: e, target: t, handler: h, cleanup: () => {
|
|
2144
|
+
Ie(e, u, !0), (a === "repeat" || a === "state") && yt().unobserve(e), c.cancel();
|
|
2145
|
+
} }, k(q, e, d), k(q, t, d), re.set(e, u), u.observe(e), (a === "repeat" || a === "state") && yt().observe(e), a === "once" && W.get(e)?.get(tt(r)) && h(!0);
|
|
2146
|
+
}
|
|
2147
|
+
function ci(e, t = {}) {
|
|
2148
|
+
const n = { ...et, ...t }, s = tt(n);
|
|
2149
|
+
let i = W.get(e);
|
|
2150
|
+
if (i || (i = /* @__PURE__ */ new Map(), W.set(e, i)), i.has(s))
|
|
2151
|
+
return;
|
|
2152
|
+
i.set(s, !1);
|
|
2153
|
+
const o = nt(n);
|
|
2154
|
+
let r;
|
|
2155
|
+
const a = (u) => {
|
|
2156
|
+
if (!u) return;
|
|
2157
|
+
i.set(s, !0);
|
|
2158
|
+
const f = q.get(e);
|
|
2159
|
+
f?.delete(r), (!f || f.size === 0) && Ie(e, o);
|
|
2160
|
+
}, c = () => Ie(e, o, !0);
|
|
2161
|
+
return r = { source: e, target: e, handler: a, cleanup: c }, k(q, e, r), re.set(e, o), o.observe(e), () => {
|
|
2162
|
+
i.delete(s), !i.size && W.get(e) === i && W.delete(e);
|
|
2163
|
+
const u = q.get(e);
|
|
2164
|
+
u?.delete(r) && u.size === 0 && c();
|
|
2165
|
+
};
|
|
2166
|
+
}
|
|
2167
|
+
function fi(e) {
|
|
2168
|
+
le(q, e), W.delete(e);
|
|
2169
|
+
}
|
|
2170
|
+
function ui() {
|
|
2171
|
+
J = null, Object.keys(ne).forEach((e) => delete ne[e]);
|
|
2172
|
+
}
|
|
2173
|
+
const li = {
|
|
2174
|
+
add: ai,
|
|
2175
|
+
remove: fi,
|
|
2176
|
+
latch: ci,
|
|
2177
|
+
setOptions: ri,
|
|
2178
|
+
reset: ui
|
|
2151
2179
|
};
|
|
2152
|
-
function
|
|
2180
|
+
function cn(e, t) {
|
|
2153
2181
|
return Object.assign(Object.create(t), e);
|
|
2154
2182
|
}
|
|
2155
|
-
function
|
|
2183
|
+
function di(e, t, n, s) {
|
|
2156
2184
|
let i = e * (1 - n) + t * n;
|
|
2157
2185
|
if (s) {
|
|
2158
2186
|
const o = i - e;
|
|
@@ -2163,7 +2191,7 @@ function ei(e, t, n, s) {
|
|
|
2163
2191
|
}
|
|
2164
2192
|
return i;
|
|
2165
2193
|
}
|
|
2166
|
-
function
|
|
2194
|
+
function hi(e) {
|
|
2167
2195
|
let t = !1;
|
|
2168
2196
|
return function() {
|
|
2169
2197
|
t || (t = !0, window.requestAnimationFrame(() => {
|
|
@@ -2171,7 +2199,7 @@ function ti(e) {
|
|
|
2171
2199
|
}));
|
|
2172
2200
|
};
|
|
2173
2201
|
}
|
|
2174
|
-
function
|
|
2202
|
+
function Et(e, t) {
|
|
2175
2203
|
let n = 0;
|
|
2176
2204
|
return function() {
|
|
2177
2205
|
n && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
@@ -2179,104 +2207,104 @@ function ft(e, t) {
|
|
|
2179
2207
|
}, t);
|
|
2180
2208
|
};
|
|
2181
2209
|
}
|
|
2182
|
-
function
|
|
2210
|
+
function mi(e, t) {
|
|
2183
2211
|
const n = e.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);
|
|
2184
|
-
return
|
|
2212
|
+
return _e(n[1], t) + _e(n[6], t);
|
|
2185
2213
|
}
|
|
2186
|
-
function
|
|
2187
|
-
return e ? /^-?\d+px$/.test(e) ? parseInt(e) : /^-?\d+[lsd]?vh$/.test(e) ? parseInt(e) * t.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(e) ? parseInt(e) * t.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(e) ?
|
|
2214
|
+
function _e(e, t) {
|
|
2215
|
+
return e ? /^-?\d+px$/.test(e) ? parseInt(e) : /^-?\d+[lsd]?vh$/.test(e) ? parseInt(e) * t.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(e) ? parseInt(e) * t.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(e) ? mi(e, t) : parseInt(e) || 0 : 0;
|
|
2188
2216
|
}
|
|
2189
|
-
function
|
|
2190
|
-
const { name: s, offset: i = 0 } = e, { start: o, end: r } = n, a = r - o,
|
|
2191
|
-
let u,
|
|
2192
|
-
return s === "entry" ? (u = o - t,
|
|
2217
|
+
function G(e, t, n) {
|
|
2218
|
+
const { name: s, offset: i = 0 } = e, { start: o, end: r } = n, a = r - o, c = i / 100;
|
|
2219
|
+
let u, f;
|
|
2220
|
+
return s === "entry" ? (u = o - t, f = Math.min(t, a)) : s === "entry-crossing" ? (u = o - t, f = a) : s === "contain" ? (u = Math.min(r - t, o), f = Math.abs(t - a)) : s === "exit" ? (u = Math.max(o, r - t), f = Math.min(t, a)) : s === "exit-crossing" ? (u = o, f = a) : s === "cover" && (u = o - t, f = a + t), u + c * f | 0;
|
|
2193
2221
|
}
|
|
2194
|
-
function
|
|
2222
|
+
function Fe(e, t, n, s, i) {
|
|
2195
2223
|
let o = 0;
|
|
2196
2224
|
const r = { start: t, end: n };
|
|
2197
|
-
return e.forEach((a,
|
|
2225
|
+
return e.forEach((a, c) => {
|
|
2198
2226
|
o += a.offset;
|
|
2199
2227
|
const u = a.sticky;
|
|
2200
2228
|
if (u) {
|
|
2201
|
-
if ("end" in u && e[
|
|
2202
|
-
const d = ((i ? a.element.offsetWidth : a.element.offsetHeight) || 0) + u.end - s,
|
|
2229
|
+
if ("end" in u && e[c - 1]?.element) {
|
|
2230
|
+
const d = ((i ? a.element.offsetWidth : a.element.offsetHeight) || 0) + u.end - s, h = o + d - a.offset, p = h < r.start, m = !p && h <= n;
|
|
2203
2231
|
let g = 0;
|
|
2204
|
-
(p ||
|
|
2232
|
+
(p || m) && (g = a.offset, r.end += g), p && (r.start += g);
|
|
2205
2233
|
}
|
|
2206
2234
|
if ("start" in u) {
|
|
2207
|
-
const
|
|
2208
|
-
let
|
|
2209
|
-
const p = e[
|
|
2235
|
+
const f = o - u.start, l = f < r.start, d = !l && f <= r.end;
|
|
2236
|
+
let h = 0;
|
|
2237
|
+
const p = e[c - 1]?.element;
|
|
2210
2238
|
if (p) {
|
|
2211
|
-
if (
|
|
2212
|
-
const
|
|
2213
|
-
|
|
2239
|
+
if (l || d) {
|
|
2240
|
+
const m = (i ? p.offsetWidth : p.offsetHeight) || 0, g = a.offset, v = (i ? a.element.offsetWidth : a.element.offsetHeight) || 0;
|
|
2241
|
+
h = m - (g + v), o += h, r.end += h;
|
|
2214
2242
|
}
|
|
2215
|
-
|
|
2243
|
+
l && (r.start += h);
|
|
2216
2244
|
}
|
|
2217
2245
|
}
|
|
2218
2246
|
}
|
|
2219
2247
|
}), r;
|
|
2220
2248
|
}
|
|
2221
|
-
function
|
|
2222
|
-
const { start: r, end: a, duration:
|
|
2223
|
-
let u = r,
|
|
2224
|
-
if (typeof
|
|
2225
|
-
|
|
2226
|
-
const p =
|
|
2227
|
-
u = p.start,
|
|
2249
|
+
function pi(e, t, n, s, i, o) {
|
|
2250
|
+
const { start: r, end: a, duration: c } = e;
|
|
2251
|
+
let u = r, f = a, l = e.startRange, d = e.endRange, h;
|
|
2252
|
+
if (typeof c == "string") {
|
|
2253
|
+
l = { name: c, offset: 0 }, d = { name: c, offset: 100 }, u = G(l, n, t), f = G(d, n, t), h = f - u;
|
|
2254
|
+
const p = Fe(o, u, f, n, s);
|
|
2255
|
+
u = p.start, f = p.end;
|
|
2228
2256
|
} else {
|
|
2229
|
-
if (
|
|
2230
|
-
|
|
2231
|
-
const p =
|
|
2232
|
-
u = v.start +
|
|
2257
|
+
if (l || r?.name) {
|
|
2258
|
+
l = l || r;
|
|
2259
|
+
const p = _e(l.add, i), m = G({ ...l, offset: 0 }, n, t), g = G({ ...l, offset: 100 }, n, t), v = Fe(o, m, g, n, s);
|
|
2260
|
+
u = v.start + l.offset / 100 * (v.end - v.start) + p;
|
|
2233
2261
|
}
|
|
2234
2262
|
if (d || a?.name) {
|
|
2235
2263
|
d = d || a;
|
|
2236
|
-
const p =
|
|
2237
|
-
|
|
2238
|
-
} else typeof
|
|
2264
|
+
const p = _e(d.add, i), m = G({ ...d, offset: 0 }, n, t), g = G({ ...d, offset: 100 }, n, t), v = Fe(o, m, g, n, s);
|
|
2265
|
+
f = v.start + d.offset / 100 * (v.end - v.start) + p;
|
|
2266
|
+
} else typeof c == "number" && (f = u + c);
|
|
2239
2267
|
}
|
|
2240
|
-
return !
|
|
2268
|
+
return !h && !c && (h = f - u), { ...e, start: u, end: f, startRange: l, endRange: d, duration: h || c };
|
|
2241
2269
|
}
|
|
2242
|
-
function
|
|
2270
|
+
function gi(e) {
|
|
2243
2271
|
return e.position === "sticky";
|
|
2244
2272
|
}
|
|
2245
|
-
function
|
|
2273
|
+
function vi(e, t, n) {
|
|
2246
2274
|
return e.position === "fixed" && (!t || t === window.document.body || t === n);
|
|
2247
2275
|
}
|
|
2248
|
-
function
|
|
2276
|
+
function yi(e, t) {
|
|
2249
2277
|
return parseInt(t ? e.left : e.top);
|
|
2250
2278
|
}
|
|
2251
|
-
function
|
|
2279
|
+
function Ei(e, t) {
|
|
2252
2280
|
return parseInt(t ? e.right : e.bottom);
|
|
2253
2281
|
}
|
|
2254
|
-
function
|
|
2282
|
+
function wi(e, t, n) {
|
|
2255
2283
|
n && (e.style.position = "static");
|
|
2256
2284
|
const s = (t ? e.offsetLeft : e.offsetTop) || 0;
|
|
2257
2285
|
return n && (e.style.position = null), s;
|
|
2258
2286
|
}
|
|
2259
|
-
function
|
|
2287
|
+
function bi(e, t) {
|
|
2260
2288
|
let n;
|
|
2261
|
-
const s =
|
|
2289
|
+
const s = yi(e, t), i = Ei(e, t), o = !isNaN(s), r = !isNaN(i);
|
|
2262
2290
|
return (o || r) && (n = {}, o && (n.start = s), r && (n.end = i)), n;
|
|
2263
2291
|
}
|
|
2264
|
-
function
|
|
2292
|
+
function me(e, t, n, s, i) {
|
|
2265
2293
|
const o = e[0].viewSource, r = [];
|
|
2266
|
-
let a = (s ? o.offsetWidth : o.offsetHeight) || 0,
|
|
2294
|
+
let a = (s ? o.offsetWidth : o.offsetHeight) || 0, c = 0, u = o;
|
|
2267
2295
|
for (; u; ) {
|
|
2268
|
-
const
|
|
2269
|
-
if ((!
|
|
2296
|
+
const l = window.getComputedStyle(u), d = gi(l), h = d ? bi(l, s) : void 0, p = wi(u, s, d);
|
|
2297
|
+
if ((!h || !("end" in h)) && (c += p), r.push({ element: u, offset: p, sticky: h }), u = u.offsetParent, vi(l, u, t))
|
|
2270
2298
|
break;
|
|
2271
2299
|
if (u === t) {
|
|
2272
2300
|
r.push({ element: u, offset: 0 });
|
|
2273
2301
|
break;
|
|
2274
2302
|
}
|
|
2275
2303
|
}
|
|
2276
|
-
return r.reverse(), e.map((
|
|
2277
|
-
...
|
|
2278
|
-
|
|
2279
|
-
{ start:
|
|
2304
|
+
return r.reverse(), e.map((l) => ({
|
|
2305
|
+
...pi(
|
|
2306
|
+
l,
|
|
2307
|
+
{ start: c, end: c + a },
|
|
2280
2308
|
n,
|
|
2281
2309
|
s,
|
|
2282
2310
|
i,
|
|
@@ -2284,7 +2312,7 @@ function ue(e, t, n, s, i) {
|
|
|
2284
2312
|
)
|
|
2285
2313
|
}));
|
|
2286
2314
|
}
|
|
2287
|
-
const
|
|
2315
|
+
const wt = 100, $i = {
|
|
2288
2316
|
horizontal: !1,
|
|
2289
2317
|
observeViewportEntry: !0,
|
|
2290
2318
|
viewportRootMargin: "7% 7%",
|
|
@@ -2292,72 +2320,72 @@ const dt = 100, ui = {
|
|
|
2292
2320
|
observeSourcesResize: !1,
|
|
2293
2321
|
observeContentResize: !1
|
|
2294
2322
|
};
|
|
2295
|
-
function
|
|
2323
|
+
function Si(e, t, n, s) {
|
|
2296
2324
|
let i = 0;
|
|
2297
2325
|
return e >= t && e <= n ? i = s ? (e - t) / s : 1 : e > n && (i = 1), i;
|
|
2298
2326
|
}
|
|
2299
|
-
function
|
|
2327
|
+
function bt(e, t) {
|
|
2300
2328
|
return e === window ? t ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : t ? e.clientWidth : e.clientHeight;
|
|
2301
2329
|
}
|
|
2302
|
-
function
|
|
2330
|
+
function Ii() {
|
|
2303
2331
|
return {
|
|
2304
2332
|
viewportWidth: window.document.documentElement.clientWidth,
|
|
2305
2333
|
viewportHeight: window.document.documentElement.clientHeight
|
|
2306
2334
|
};
|
|
2307
2335
|
}
|
|
2308
|
-
function
|
|
2309
|
-
const t =
|
|
2310
|
-
let o =
|
|
2311
|
-
const
|
|
2336
|
+
function _i(e) {
|
|
2337
|
+
const t = cn(e, $i), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
|
|
2338
|
+
let o = bt(n, s), r, a, c, u, f;
|
|
2339
|
+
const l = [], d = Ii();
|
|
2312
2340
|
if (t.scenes = Object.values(
|
|
2313
2341
|
// TODO(ameerf): find a polyfill and use groupBy instead of following reduce
|
|
2314
2342
|
e.scenes.reduce(
|
|
2315
|
-
(
|
|
2343
|
+
(m, g, v) => {
|
|
2316
2344
|
const y = g.groupId ? `group-${g.groupId}` : String(v);
|
|
2317
|
-
return
|
|
2345
|
+
return m[y] ? m[y].push(g) : m[y] = [g], m;
|
|
2318
2346
|
},
|
|
2319
2347
|
{}
|
|
2320
2348
|
)
|
|
2321
|
-
).flatMap((
|
|
2349
|
+
).flatMap((m) => (m.every((g) => g.viewSource && (typeof g.duration == "string" || g.start?.name)) ? (m = me(m, n, o, s, d), (t.observeSourcesResize || t.observeContentResize) && l.push(m)) : m.forEach((g) => {
|
|
2322
2350
|
g.end == null && (g.end = g.start + g.duration), g.duration == null && (g.duration = g.end - g.start);
|
|
2323
|
-
}),
|
|
2324
|
-
|
|
2325
|
-
}),
|
|
2326
|
-
const
|
|
2327
|
-
window.ResizeObserver && (
|
|
2351
|
+
}), m)), t.scenes.forEach((m, g) => {
|
|
2352
|
+
m.index = g;
|
|
2353
|
+
}), l.length) {
|
|
2354
|
+
const m = /* @__PURE__ */ new Map();
|
|
2355
|
+
window.ResizeObserver && (c = new window.ResizeObserver(function(g) {
|
|
2328
2356
|
g.forEach((v) => {
|
|
2329
|
-
const y =
|
|
2330
|
-
|
|
2331
|
-
t.scenes[E.index] =
|
|
2332
|
-
}),
|
|
2357
|
+
const y = m.get(v.target), b = me(y, n, o, s, d);
|
|
2358
|
+
b.forEach((E, S) => {
|
|
2359
|
+
t.scenes[E.index] = b[S];
|
|
2360
|
+
}), l.splice(l.indexOf(y), 1, b);
|
|
2333
2361
|
});
|
|
2334
|
-
}),
|
|
2335
|
-
|
|
2336
|
-
}), t.observeContentResize && t.contentRoot && new window.ResizeObserver(
|
|
2337
|
-
const v =
|
|
2338
|
-
const
|
|
2339
|
-
return
|
|
2340
|
-
t.scenes[E.index] =
|
|
2341
|
-
}),
|
|
2362
|
+
}), l.forEach((g) => {
|
|
2363
|
+
c.observe(g[0].viewSource, { box: "border-box" }), m.set(g[0].viewSource, g);
|
|
2364
|
+
}), t.observeContentResize && t.contentRoot && new window.ResizeObserver(Et(() => {
|
|
2365
|
+
const v = l.map((y) => {
|
|
2366
|
+
const b = me(y, n, o, s, d);
|
|
2367
|
+
return b.forEach((E, S) => {
|
|
2368
|
+
t.scenes[E.index] = b[S];
|
|
2369
|
+
}), b;
|
|
2342
2370
|
});
|
|
2343
|
-
|
|
2344
|
-
|
|
2371
|
+
l.length = 0, l.push(...v), l.forEach((y) => {
|
|
2372
|
+
m.set(y[0].viewSource, y);
|
|
2345
2373
|
});
|
|
2346
|
-
},
|
|
2347
|
-
o =
|
|
2348
|
-
const g =
|
|
2349
|
-
const y =
|
|
2350
|
-
return y.forEach((
|
|
2351
|
-
t.scenes[
|
|
2374
|
+
}, wt)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (u = Et(function() {
|
|
2375
|
+
o = bt(n, s);
|
|
2376
|
+
const g = l.map((v) => {
|
|
2377
|
+
const y = me(v, n, o, s, d);
|
|
2378
|
+
return y.forEach((b, E) => {
|
|
2379
|
+
t.scenes[b.index] = y[E];
|
|
2352
2380
|
}), y;
|
|
2353
2381
|
});
|
|
2354
|
-
|
|
2355
|
-
|
|
2382
|
+
l.length = 0, l.push(...g), l.forEach((v) => {
|
|
2383
|
+
m.set(v[0].viewSource, v);
|
|
2356
2384
|
});
|
|
2357
|
-
},
|
|
2385
|
+
}, wt), n === window ? window.addEventListener("resize", u) : window.ResizeObserver && (f = new window.ResizeObserver(u), f.observe(n, { box: "border-box" })));
|
|
2358
2386
|
}
|
|
2359
|
-
t.observeViewportEntry && window.IntersectionObserver && (a = new window.IntersectionObserver(function(
|
|
2360
|
-
|
|
2387
|
+
t.observeViewportEntry && window.IntersectionObserver && (a = new window.IntersectionObserver(function(m) {
|
|
2388
|
+
m.forEach((g) => {
|
|
2361
2389
|
(i.get(g.target) || []).forEach((v) => {
|
|
2362
2390
|
v.disabled = !g.isIntersecting;
|
|
2363
2391
|
});
|
|
@@ -2366,42 +2394,42 @@ function hi(e) {
|
|
|
2366
2394
|
root: n === window ? window.document : n,
|
|
2367
2395
|
rootMargin: t.viewportRootMargin,
|
|
2368
2396
|
threshold: 0
|
|
2369
|
-
}), t.scenes.forEach((
|
|
2370
|
-
if (
|
|
2371
|
-
let g = i.get(
|
|
2372
|
-
g || (g = [], i.set(
|
|
2397
|
+
}), t.scenes.forEach((m) => {
|
|
2398
|
+
if (m.viewSource) {
|
|
2399
|
+
let g = i.get(m.viewSource);
|
|
2400
|
+
g || (g = [], i.set(m.viewSource, g), a.observe(m.viewSource)), g.push(m);
|
|
2373
2401
|
}
|
|
2374
2402
|
}));
|
|
2375
|
-
function
|
|
2376
|
-
|
|
2403
|
+
function h({ p: m, vp: g }) {
|
|
2404
|
+
m = +m.toFixed(1);
|
|
2377
2405
|
const v = +g.toFixed(4);
|
|
2378
|
-
if (
|
|
2406
|
+
if (m !== r) {
|
|
2379
2407
|
for (let y of t.scenes)
|
|
2380
2408
|
if (!y.disabled) {
|
|
2381
|
-
const { start:
|
|
2382
|
-
y.effect(y,
|
|
2409
|
+
const { start: b, end: E, duration: S } = y, $ = Si(m, b, E, S);
|
|
2410
|
+
y.effect(y, $, v);
|
|
2383
2411
|
}
|
|
2384
|
-
r =
|
|
2412
|
+
r = m;
|
|
2385
2413
|
}
|
|
2386
2414
|
}
|
|
2387
2415
|
function p() {
|
|
2388
|
-
t.scenes.forEach((
|
|
2416
|
+
t.scenes.forEach((m) => m.destroy?.()), a && (a.disconnect(), a = null), c && (c.disconnect(), c = null), u && (f ? (f.disconnect(), f = null) : window.removeEventListener("resize", u));
|
|
2389
2417
|
}
|
|
2390
2418
|
return {
|
|
2391
|
-
tick:
|
|
2419
|
+
tick: h,
|
|
2392
2420
|
destroy: p
|
|
2393
2421
|
};
|
|
2394
2422
|
}
|
|
2395
|
-
const
|
|
2423
|
+
const Ti = {
|
|
2396
2424
|
transitionActive: !1,
|
|
2397
2425
|
transitionFriction: 0.9,
|
|
2398
2426
|
transitionEpsilon: 1,
|
|
2399
2427
|
velocityActive: !1,
|
|
2400
2428
|
velocityMax: 1
|
|
2401
2429
|
};
|
|
2402
|
-
class
|
|
2430
|
+
class Mi {
|
|
2403
2431
|
constructor(t = {}) {
|
|
2404
|
-
this.config =
|
|
2432
|
+
this.config = cn(t, Ti), this.progress = {
|
|
2405
2433
|
p: 0,
|
|
2406
2434
|
prevP: 0,
|
|
2407
2435
|
vp: 0
|
|
@@ -2414,7 +2442,7 @@ class pi {
|
|
|
2414
2442
|
this.config.root = n ? window : this.config.root, this.config.contentRoot = this.config.contentRoot || (n ? window.document.body : this.config.root.firstElementChild), this.config.resetProgress = this.config.resetProgress || this.resetProgress.bind(this), this._measure = this.config.measure || (() => {
|
|
2415
2443
|
const s = this.config.root;
|
|
2416
2444
|
this.progress.p = this.config.horizontal ? s.scrollX || s.scrollLeft || 0 : s.scrollY || s.scrollTop || 0;
|
|
2417
|
-
}), this._trigger =
|
|
2445
|
+
}), this._trigger = hi(() => {
|
|
2418
2446
|
this._measure?.(), this.tick(!0);
|
|
2419
2447
|
});
|
|
2420
2448
|
}
|
|
@@ -2460,7 +2488,7 @@ class pi {
|
|
|
2460
2488
|
* Calculate current progress.
|
|
2461
2489
|
*/
|
|
2462
2490
|
lerp() {
|
|
2463
|
-
this.currentProgress.p =
|
|
2491
|
+
this.currentProgress.p = di(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
|
|
2464
2492
|
}
|
|
2465
2493
|
/**
|
|
2466
2494
|
* Stop the event and effect, and remove all DOM side-effects.
|
|
@@ -2484,7 +2512,7 @@ class pi {
|
|
|
2484
2512
|
* Reset registered effect.
|
|
2485
2513
|
*/
|
|
2486
2514
|
setupEffect() {
|
|
2487
|
-
this.removeEffect(), this.effect =
|
|
2515
|
+
this.removeEffect(), this.effect = _i(this.config);
|
|
2488
2516
|
}
|
|
2489
2517
|
/**
|
|
2490
2518
|
* Remove registered effect.
|
|
@@ -2493,20 +2521,20 @@ class pi {
|
|
|
2493
2521
|
this.effect && this.effect.destroy(), this.effect = null;
|
|
2494
2522
|
}
|
|
2495
2523
|
}
|
|
2496
|
-
const
|
|
2497
|
-
let
|
|
2498
|
-
function
|
|
2499
|
-
|
|
2524
|
+
const Ve = /* @__PURE__ */ new WeakMap();
|
|
2525
|
+
let fn = () => ({});
|
|
2526
|
+
function Oi(e) {
|
|
2527
|
+
fn = e;
|
|
2500
2528
|
}
|
|
2501
|
-
function
|
|
2529
|
+
function Pi(e, t, n, s, { selectorCondition: i }) {
|
|
2502
2530
|
if (i && !t.matches(i)) return;
|
|
2503
2531
|
const o = {
|
|
2504
2532
|
trigger: "view-progress",
|
|
2505
2533
|
element: e
|
|
2506
|
-
}, r =
|
|
2534
|
+
}, r = x(n);
|
|
2507
2535
|
let a;
|
|
2508
2536
|
if ("ViewTimeline" in window) {
|
|
2509
|
-
const u =
|
|
2537
|
+
const u = fe(
|
|
2510
2538
|
t,
|
|
2511
2539
|
r,
|
|
2512
2540
|
o
|
|
@@ -2517,42 +2545,42 @@ function vi(e, t, n, s, { selectorCondition: i }) {
|
|
|
2517
2545
|
});
|
|
2518
2546
|
});
|
|
2519
2547
|
} else {
|
|
2520
|
-
const u =
|
|
2548
|
+
const u = Ht(t, r, o);
|
|
2521
2549
|
if (u) {
|
|
2522
|
-
const
|
|
2550
|
+
const f = Array.isArray(u) ? u : [u], l = new Mi({
|
|
2523
2551
|
viewSource: e,
|
|
2524
|
-
scenes:
|
|
2552
|
+
scenes: f,
|
|
2525
2553
|
observeViewportEntry: !1,
|
|
2526
2554
|
observeViewportResize: !1,
|
|
2527
2555
|
observeSourcesResize: !0,
|
|
2528
2556
|
root: document.body,
|
|
2529
|
-
...
|
|
2557
|
+
...fn()
|
|
2530
2558
|
});
|
|
2531
2559
|
a = () => {
|
|
2532
|
-
|
|
2533
|
-
}, Promise.all(
|
|
2560
|
+
l.destroy();
|
|
2561
|
+
}, Promise.all(f.map((d) => d.ready || Promise.resolve())).then(
|
|
2534
2562
|
() => {
|
|
2535
|
-
|
|
2563
|
+
l.start();
|
|
2536
2564
|
}
|
|
2537
2565
|
);
|
|
2538
2566
|
}
|
|
2539
2567
|
}
|
|
2540
2568
|
if (!a) return;
|
|
2541
|
-
const
|
|
2542
|
-
|
|
2569
|
+
const c = { source: e, target: t, cleanup: a };
|
|
2570
|
+
k(Ve, e, c), k(Ve, t, c);
|
|
2543
2571
|
}
|
|
2544
|
-
function
|
|
2545
|
-
|
|
2572
|
+
function Ci(e) {
|
|
2573
|
+
le(Ve, e);
|
|
2546
2574
|
}
|
|
2547
|
-
const
|
|
2548
|
-
add:
|
|
2549
|
-
remove:
|
|
2550
|
-
registerOptionsGetter:
|
|
2575
|
+
const Ai = {
|
|
2576
|
+
add: Pi,
|
|
2577
|
+
remove: Ci,
|
|
2578
|
+
registerOptionsGetter: Oi
|
|
2551
2579
|
};
|
|
2552
|
-
function
|
|
2580
|
+
function $t(e, t, n) {
|
|
2553
2581
|
return Math.min(Math.max(e, n), t);
|
|
2554
2582
|
}
|
|
2555
|
-
function
|
|
2583
|
+
function St(e) {
|
|
2556
2584
|
let t = !1;
|
|
2557
2585
|
return function() {
|
|
2558
2586
|
if (!t)
|
|
@@ -2561,7 +2589,7 @@ function pt(e) {
|
|
|
2561
2589
|
});
|
|
2562
2590
|
};
|
|
2563
2591
|
}
|
|
2564
|
-
function
|
|
2592
|
+
function ki(e) {
|
|
2565
2593
|
let t = e, n = 0, s = 0;
|
|
2566
2594
|
if (t.offsetParent)
|
|
2567
2595
|
do
|
|
@@ -2574,7 +2602,7 @@ function wi(e) {
|
|
|
2574
2602
|
height: e.offsetHeight
|
|
2575
2603
|
};
|
|
2576
2604
|
}
|
|
2577
|
-
function
|
|
2605
|
+
function qi() {
|
|
2578
2606
|
const e = window.devicePixelRatio;
|
|
2579
2607
|
let t = !1;
|
|
2580
2608
|
if (e === 1)
|
|
@@ -2587,7 +2615,7 @@ function $i() {
|
|
|
2587
2615
|
});
|
|
2588
2616
|
return document.body.dispatchEvent(n), t;
|
|
2589
2617
|
}
|
|
2590
|
-
function
|
|
2618
|
+
function Ri() {
|
|
2591
2619
|
return new Promise((e) => {
|
|
2592
2620
|
const t = window.scrollY;
|
|
2593
2621
|
let n = !1, s;
|
|
@@ -2606,42 +2634,42 @@ function Si() {
|
|
|
2606
2634
|
i(), window.addEventListener("scroll", o), window.scrollY > 0 && window.scrollBy(0, -1);
|
|
2607
2635
|
});
|
|
2608
2636
|
}
|
|
2609
|
-
function
|
|
2610
|
-
|
|
2637
|
+
function Li(e) {
|
|
2638
|
+
Ri().then((t) => {
|
|
2611
2639
|
e.fixRequired = t, t && (window.addEventListener("scroll", e.scrollHandler), e.scrollHandler());
|
|
2612
2640
|
});
|
|
2613
2641
|
}
|
|
2614
|
-
let
|
|
2615
|
-
const
|
|
2616
|
-
function
|
|
2642
|
+
let pe = 0;
|
|
2643
|
+
const be = /* @__PURE__ */ new Set();
|
|
2644
|
+
function Fi() {
|
|
2617
2645
|
const e = (n) => {
|
|
2618
2646
|
for (let s of n.changedTouches)
|
|
2619
|
-
|
|
2647
|
+
be.add(s.identifier);
|
|
2620
2648
|
}, t = (n) => {
|
|
2621
2649
|
for (let s of n.changedTouches)
|
|
2622
|
-
|
|
2650
|
+
be.delete(s.identifier);
|
|
2623
2651
|
};
|
|
2624
2652
|
return document.addEventListener("touchstart", e, { passive: !0 }), document.addEventListener("touchend", t, { passive: !0 }), function() {
|
|
2625
|
-
|
|
2653
|
+
be.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
|
|
2626
2654
|
};
|
|
2627
2655
|
}
|
|
2628
|
-
function
|
|
2656
|
+
function xi(e, t) {
|
|
2629
2657
|
if ("onscrollend" in window)
|
|
2630
2658
|
return e.addEventListener("scrollend", t), function() {
|
|
2631
2659
|
e.removeEventListener("scrollend", t);
|
|
2632
2660
|
};
|
|
2633
2661
|
let n = 0, s;
|
|
2634
|
-
|
|
2662
|
+
pe || (s = Fi()), pe += 1;
|
|
2635
2663
|
function i(o) {
|
|
2636
2664
|
clearTimeout(n), n = setTimeout(() => {
|
|
2637
|
-
|
|
2665
|
+
be.size ? setTimeout(i, 100) : (t(o), n = 0);
|
|
2638
2666
|
}, 100);
|
|
2639
2667
|
}
|
|
2640
2668
|
return e.addEventListener("scroll", i), function() {
|
|
2641
|
-
e.removeEventListener("scroll", i),
|
|
2669
|
+
e.removeEventListener("scroll", i), pe -= 1, pe || s();
|
|
2642
2670
|
};
|
|
2643
2671
|
}
|
|
2644
|
-
function
|
|
2672
|
+
function Ni(e, t, n) {
|
|
2645
2673
|
return {
|
|
2646
2674
|
x(s) {
|
|
2647
2675
|
const i = e.left - n.x + e.width / 2, o = i >= t.width / 2, r = (o ? i : t.width - i) * 2, a = o ? 0 : i - r / 2;
|
|
@@ -2653,13 +2681,13 @@ function Oi(e, t, n) {
|
|
|
2653
2681
|
}
|
|
2654
2682
|
};
|
|
2655
2683
|
}
|
|
2656
|
-
function
|
|
2684
|
+
function Di(e, t) {
|
|
2657
2685
|
this.x = window.scrollX, this.y = window.scrollY, requestAnimationFrame(() => e && e(t));
|
|
2658
2686
|
}
|
|
2659
|
-
function
|
|
2687
|
+
function ji(e) {
|
|
2660
2688
|
e.rect.width = window.document.documentElement.clientWidth, e.rect.height = window.document.documentElement.clientHeight;
|
|
2661
2689
|
}
|
|
2662
|
-
function
|
|
2690
|
+
function zi(e) {
|
|
2663
2691
|
const t = new ResizeObserver((n) => {
|
|
2664
2692
|
n.forEach((s) => {
|
|
2665
2693
|
e.rect.width = s.borderBoxSize[0].inlineSize, e.rect.height = s.borderBoxSize[0].blockSize;
|
|
@@ -2667,38 +2695,38 @@ function _i(e) {
|
|
|
2667
2695
|
});
|
|
2668
2696
|
return t.observe(e.root, { box: "border-box" }), t;
|
|
2669
2697
|
}
|
|
2670
|
-
function
|
|
2698
|
+
function Hi(e) {
|
|
2671
2699
|
let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, i, o, r, a;
|
|
2672
|
-
const
|
|
2673
|
-
e.scenes.forEach((
|
|
2674
|
-
|
|
2675
|
-
}), s = function(
|
|
2676
|
-
for (let
|
|
2677
|
-
if (!
|
|
2678
|
-
const d =
|
|
2679
|
-
e.allowActiveEvent && (
|
|
2700
|
+
const c = { x: 0, y: 0 };
|
|
2701
|
+
e.scenes.forEach((f) => {
|
|
2702
|
+
f.target && f.centeredToTarget && (f.transform = Ni(ki(f.target), e.rect, c), t = !0), e.root ? i = zi(e) : (o = ji.bind(null, e), window.addEventListener("resize", o));
|
|
2703
|
+
}), s = function(f) {
|
|
2704
|
+
for (let l of e.scenes)
|
|
2705
|
+
if (!l.disabled) {
|
|
2706
|
+
const d = l.transform?.x(f.x) || f.x / e.rect.width, h = l.transform?.y(f.y) || f.y / e.rect.height, p = +$t(0, 1, d).toPrecision(4), m = +$t(0, 1, h).toPrecision(4), g = { x: f.vx, y: f.vy };
|
|
2707
|
+
e.allowActiveEvent && (f.active = d <= 1 && h <= 1 && d >= 0 && h >= 0), l.effect(l, { x: p, y: m }, g, f.active);
|
|
2680
2708
|
}
|
|
2681
|
-
Object.assign(n,
|
|
2682
|
-
}, t && (r =
|
|
2709
|
+
Object.assign(n, f);
|
|
2710
|
+
}, t && (r = Di.bind(c, s, n), a = xi(document, r));
|
|
2683
2711
|
function u() {
|
|
2684
|
-
e.scenes.forEach((
|
|
2712
|
+
e.scenes.forEach((f) => f.destroy?.()), a?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", o), o = null), s = null, n = null;
|
|
2685
2713
|
}
|
|
2686
2714
|
return {
|
|
2687
2715
|
tick: s,
|
|
2688
2716
|
destroy: u
|
|
2689
2717
|
};
|
|
2690
2718
|
}
|
|
2691
|
-
const
|
|
2692
|
-
let
|
|
2693
|
-
function
|
|
2694
|
-
|
|
2719
|
+
const Gi = 1e3 / 60 * 3;
|
|
2720
|
+
let ge;
|
|
2721
|
+
function Wi() {
|
|
2722
|
+
V.x = window.scrollX, V.y = window.scrollY;
|
|
2695
2723
|
}
|
|
2696
|
-
const
|
|
2697
|
-
class
|
|
2724
|
+
const V = { x: 0, y: 0, scrollHandler: Wi, fixRequired: void 0 };
|
|
2725
|
+
class Vi {
|
|
2698
2726
|
constructor(t = {}) {
|
|
2699
2727
|
this.config = { ...t }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
|
|
2700
2728
|
let n;
|
|
2701
|
-
this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() :
|
|
2729
|
+
this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : St(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : St(() => {
|
|
2702
2730
|
this.tick();
|
|
2703
2731
|
}), this.config.rect = this.config.root ? {
|
|
2704
2732
|
width: this.config.root.offsetWidth,
|
|
@@ -2721,15 +2749,15 @@ class qi {
|
|
|
2721
2749
|
}, this._pointerEnter = () => {
|
|
2722
2750
|
this.progress.active = !0, this._nextTick = n();
|
|
2723
2751
|
}, this.config.root) {
|
|
2724
|
-
|
|
2725
|
-
const i =
|
|
2726
|
-
typeof
|
|
2752
|
+
ge = typeof ge == "boolean" ? ge : qi();
|
|
2753
|
+
const i = ge ? window.devicePixelRatio : 1;
|
|
2754
|
+
typeof V.fixRequired > "u" && Li(V), this._measure = (o) => {
|
|
2727
2755
|
if (o.target !== this.config.root) {
|
|
2728
2756
|
const r = new PointerEvent("pointermove", {
|
|
2729
2757
|
bubbles: !0,
|
|
2730
2758
|
cancelable: !0,
|
|
2731
|
-
clientX: o.x * i +
|
|
2732
|
-
clientY: o.y * i +
|
|
2759
|
+
clientX: o.x * i + V.x,
|
|
2760
|
+
clientY: o.y * i + V.y
|
|
2733
2761
|
});
|
|
2734
2762
|
o.stopPropagation(), this.config.root.dispatchEvent(r);
|
|
2735
2763
|
} else
|
|
@@ -2765,8 +2793,8 @@ class qi {
|
|
|
2765
2793
|
const t = this.config.transitionDuration, n = this.config.transitionEasing || ((r) => r), s = performance.now();
|
|
2766
2794
|
let i = !1;
|
|
2767
2795
|
const o = (r) => {
|
|
2768
|
-
const a = (r - this._startTime) / t,
|
|
2769
|
-
i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((u, [
|
|
2796
|
+
const a = (r - this._startTime) / t, c = n(Math.min(1, a));
|
|
2797
|
+
i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((u, [f, l]) => (f === "active" ? u[f] = l : u[f] = this.previousProgress[f] + (l - this.previousProgress[f]) * c, u), this.currentProgress || {}), a < 1 && (this._nextTransitionTick = requestAnimationFrame(o), i = r - this._startTime > Gi), this.effect.tick(this.currentProgress);
|
|
2770
2798
|
};
|
|
2771
2799
|
return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, o(s)) : this._startTime = s, this._nextTransitionTick;
|
|
2772
2800
|
}
|
|
@@ -2795,7 +2823,7 @@ class qi {
|
|
|
2795
2823
|
* Reset registered effect.
|
|
2796
2824
|
*/
|
|
2797
2825
|
setupEffect() {
|
|
2798
|
-
this.removeEffect(), this.effect =
|
|
2826
|
+
this.removeEffect(), this.effect = Hi(this.config);
|
|
2799
2827
|
}
|
|
2800
2828
|
/**
|
|
2801
2829
|
* Remove registered effect.
|
|
@@ -2804,76 +2832,124 @@ class qi {
|
|
|
2804
2832
|
this.effect && this.effect.destroy(), this.effect = null;
|
|
2805
2833
|
}
|
|
2806
2834
|
}
|
|
2807
|
-
const
|
|
2808
|
-
let
|
|
2809
|
-
function
|
|
2810
|
-
|
|
2835
|
+
const Be = /* @__PURE__ */ new WeakMap();
|
|
2836
|
+
let un = () => ({});
|
|
2837
|
+
function Bi(e) {
|
|
2838
|
+
un = e;
|
|
2811
2839
|
}
|
|
2812
|
-
function
|
|
2840
|
+
function Yi(e) {
|
|
2813
2841
|
return !("keyframeEffect" in e || "customEffect" in e) || !e.transitionDuration ? {} : {
|
|
2814
2842
|
transitionDuration: e.transitionDuration,
|
|
2815
|
-
transitionEasing:
|
|
2843
|
+
transitionEasing: Qe(e.transitionEasing)
|
|
2816
2844
|
};
|
|
2817
2845
|
}
|
|
2818
|
-
function
|
|
2846
|
+
function Ui(e, t, n, s = {}, { selectorCondition: i }) {
|
|
2819
2847
|
if (i && !t.matches(i)) return;
|
|
2820
2848
|
const o = {
|
|
2821
2849
|
trigger: "pointer-move",
|
|
2822
2850
|
element: e,
|
|
2823
2851
|
axis: s.axis ?? "y"
|
|
2824
|
-
}, r =
|
|
2852
|
+
}, r = Ht(t, x(n), o);
|
|
2825
2853
|
if (r) {
|
|
2826
|
-
const a = Array.isArray(r) ? r : [r],
|
|
2854
|
+
const a = Array.isArray(r) ? r : [r], c = new Vi({
|
|
2827
2855
|
root: s.hitArea === "self" ? e : void 0,
|
|
2828
2856
|
scenes: a,
|
|
2829
|
-
...
|
|
2830
|
-
...
|
|
2831
|
-
}),
|
|
2832
|
-
|
|
2857
|
+
...un(),
|
|
2858
|
+
...Yi(n)
|
|
2859
|
+
}), f = { source: e, target: t, cleanup: () => {
|
|
2860
|
+
c.destroy();
|
|
2833
2861
|
} };
|
|
2834
|
-
|
|
2835
|
-
a.map((
|
|
2862
|
+
k(Be, e, f), k(Be, t, f), Promise.all(
|
|
2863
|
+
a.map((l) => l.ready || Promise.resolve())
|
|
2836
2864
|
).then(() => {
|
|
2837
|
-
|
|
2865
|
+
c.start();
|
|
2838
2866
|
});
|
|
2839
2867
|
}
|
|
2840
2868
|
}
|
|
2841
|
-
function
|
|
2842
|
-
|
|
2869
|
+
function Ki(e) {
|
|
2870
|
+
le(Be, e);
|
|
2871
|
+
}
|
|
2872
|
+
const Xi = {
|
|
2873
|
+
add: Ui,
|
|
2874
|
+
remove: Ki,
|
|
2875
|
+
registerOptionsGetter: Bi
|
|
2876
|
+
}, Ye = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap();
|
|
2877
|
+
function ln(e, t) {
|
|
2878
|
+
return Array.from(e.querySelectorAll(t));
|
|
2879
|
+
}
|
|
2880
|
+
function Qi(e) {
|
|
2881
|
+
return e.animationName || `#${e.detail?.effectId}`;
|
|
2882
|
+
}
|
|
2883
|
+
function Zi(e) {
|
|
2884
|
+
const t = [];
|
|
2885
|
+
for (let n = e; n; n = n.parentElement)
|
|
2886
|
+
N.get(n)?.forEach(({ sourceSelector: s, events: i }) => {
|
|
2887
|
+
(s ? !ln(n, s).includes(e) : n !== e) || i.forEach((o, r) => {
|
|
2888
|
+
o.forEach((a) => {
|
|
2889
|
+
(r === e || a.bubbles && e.contains(r)) && t.push(a);
|
|
2890
|
+
});
|
|
2891
|
+
});
|
|
2892
|
+
});
|
|
2893
|
+
return t;
|
|
2894
|
+
}
|
|
2895
|
+
function Ji(e) {
|
|
2896
|
+
N.get(e)?.forEach(({ cleanup: t }) => t()), N.delete(e);
|
|
2843
2897
|
}
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
remove: xi,
|
|
2847
|
-
registerOptionsGetter: Ri
|
|
2848
|
-
}, Ge = /* @__PURE__ */ new WeakMap();
|
|
2849
|
-
function Di(e, t, n, s, { selectorCondition: i, animation: o, sourceAnimationOptions: r }) {
|
|
2850
|
-
const a = o || oe(t, N(n));
|
|
2898
|
+
function eo(e, t, n, s, { selectorCondition: i, animation: o, sourceAnimationOptions: r }) {
|
|
2899
|
+
const a = o || fe(t, x(n));
|
|
2851
2900
|
if (!a)
|
|
2852
2901
|
return;
|
|
2853
|
-
const { effectId:
|
|
2854
|
-
if (i && !t.matches(i)) return;
|
|
2855
|
-
const
|
|
2856
|
-
if (
|
|
2857
|
-
if (
|
|
2858
|
-
return;
|
|
2859
|
-
if (
|
|
2860
|
-
return;
|
|
2902
|
+
const { effectId: c } = s, u = (h) => {
|
|
2903
|
+
if (i && !t.matches(i)) return !1;
|
|
2904
|
+
const p = h.animationName, m = h.detail?.effectId, g = r ? zt(e, r) : null;
|
|
2905
|
+
if (g) {
|
|
2906
|
+
if (g.playState === "running" || p && !g.hasAnimationName(p))
|
|
2907
|
+
return !1;
|
|
2908
|
+
if (m && m !== c && !g.hasAnimationId(m))
|
|
2909
|
+
return !1;
|
|
2861
2910
|
}
|
|
2862
|
-
|
|
2863
|
-
}, f =
|
|
2864
|
-
|
|
2911
|
+
return !0;
|
|
2912
|
+
}, f = (h) => {
|
|
2913
|
+
u(h) && a.play();
|
|
2914
|
+
}, d = { source: e, target: t, cleanup: () => {
|
|
2915
|
+
a.cancel(), e.removeEventListener("animationend", f);
|
|
2865
2916
|
} };
|
|
2866
|
-
|
|
2917
|
+
k(Ye, e, d), k(Ye, t, d), e.addEventListener("animationend", f), Zi(e).some(u) && a.play();
|
|
2867
2918
|
}
|
|
2868
|
-
function
|
|
2869
|
-
|
|
2919
|
+
function to(e, t, n) {
|
|
2920
|
+
let s = N.get(e);
|
|
2921
|
+
if (s?.some((a) => a.sourceSelector === n))
|
|
2922
|
+
return;
|
|
2923
|
+
s || (s = [], N.set(e, s));
|
|
2924
|
+
const i = /* @__PURE__ */ new Map(), o = (a) => {
|
|
2925
|
+
const c = a.target;
|
|
2926
|
+
if (n && !ln(e, n).some(
|
|
2927
|
+
(l) => l === c || a.bubbles && l.contains(c)
|
|
2928
|
+
))
|
|
2929
|
+
return;
|
|
2930
|
+
let u = i.get(c);
|
|
2931
|
+
u || (u = /* @__PURE__ */ new Map(), i.set(c, u)), u.set(Qi(a), a);
|
|
2932
|
+
}, r = {
|
|
2933
|
+
sourceSelector: n,
|
|
2934
|
+
events: i,
|
|
2935
|
+
cleanup: () => e.removeEventListener("animationend", o, !0)
|
|
2936
|
+
};
|
|
2937
|
+
return e.addEventListener("animationend", o, !0), s.push(r), () => {
|
|
2938
|
+
const a = N.get(e), c = a ? a.indexOf(r) : -1;
|
|
2939
|
+
c !== -1 && (r.cleanup(), a.splice(c, 1), a.length || N.delete(e));
|
|
2940
|
+
};
|
|
2941
|
+
}
|
|
2942
|
+
function no(e) {
|
|
2943
|
+
le(Ye, e), Ji(e);
|
|
2870
2944
|
}
|
|
2871
|
-
const
|
|
2872
|
-
add:
|
|
2873
|
-
remove:
|
|
2945
|
+
const so = {
|
|
2946
|
+
add: eo,
|
|
2947
|
+
remove: no,
|
|
2948
|
+
latch: to,
|
|
2949
|
+
latchesSubtree: !0
|
|
2874
2950
|
};
|
|
2875
|
-
function
|
|
2876
|
-
const o = i ||
|
|
2951
|
+
function io(e, t, n, s, i) {
|
|
2952
|
+
const o = i || fe(e, x(t));
|
|
2877
2953
|
if (!o)
|
|
2878
2954
|
return null;
|
|
2879
2955
|
let r = !0;
|
|
@@ -2881,99 +2957,99 @@ function Hi(e, t, n, s, i) {
|
|
|
2881
2957
|
return {
|
|
2882
2958
|
handler: (u) => {
|
|
2883
2959
|
if (n && !e.matches(n)) return;
|
|
2884
|
-
const
|
|
2885
|
-
if (
|
|
2960
|
+
const f = !s, l = s?.enter?.includes(u.type), d = s?.leave?.includes(u.type);
|
|
2961
|
+
if (l || f) {
|
|
2886
2962
|
if (a === "alternate" || a === "state")
|
|
2887
2963
|
r ? (r = !1, o.play()) : a === "alternate" ? o.reverse() : a === "state" && (o.playState === "running" ? o.pause() : o.playState !== "finished" && o.play());
|
|
2888
2964
|
else {
|
|
2889
2965
|
if (o.progress(0), delete e.dataset.interactEnter, o.isCSS) {
|
|
2890
|
-
const
|
|
2891
|
-
|
|
2966
|
+
const h = () => {
|
|
2967
|
+
A.mutate(() => {
|
|
2892
2968
|
e.dataset.interactEnter = "done";
|
|
2893
2969
|
});
|
|
2894
2970
|
};
|
|
2895
|
-
o.onFinish(
|
|
2971
|
+
o.onFinish(h), o.onAbort(h);
|
|
2896
2972
|
}
|
|
2897
2973
|
o.play();
|
|
2898
2974
|
}
|
|
2899
2975
|
return;
|
|
2900
2976
|
}
|
|
2901
|
-
d && (a === "alternate" ? o.reverse() : a === "repeat" ? (o.cancel(),
|
|
2977
|
+
d && (a === "alternate" ? o.reverse() : a === "repeat" ? (o.cancel(), A.mutate(() => {
|
|
2902
2978
|
delete e.dataset.interactEnter;
|
|
2903
2979
|
})) : a === "state" && o.playState === "running" && o.pause());
|
|
2904
2980
|
},
|
|
2905
2981
|
cleanup: () => o.cancel()
|
|
2906
2982
|
};
|
|
2907
2983
|
}
|
|
2908
|
-
function
|
|
2984
|
+
function oo(e, t, {
|
|
2909
2985
|
effectId: n,
|
|
2910
2986
|
listContainer: s,
|
|
2911
2987
|
listItemSelector: i,
|
|
2912
2988
|
stateAction: o
|
|
2913
2989
|
}, r, a) {
|
|
2914
|
-
const
|
|
2915
|
-
return (
|
|
2990
|
+
const c = !!s, u = o ?? "toggle", f = u === "toggle";
|
|
2991
|
+
return (l) => {
|
|
2916
2992
|
if (r && !e.matches(r)) return;
|
|
2917
|
-
const d =
|
|
2993
|
+
const d = c ? e.closest(
|
|
2918
2994
|
`${s} > ${i || ""}:has(:scope)`
|
|
2919
|
-
) : void 0,
|
|
2920
|
-
|
|
2995
|
+
) : void 0, h = !a, p = a?.enter?.includes(l.type), m = a?.leave?.includes(l.type);
|
|
2996
|
+
h ? t.toggleEffect(n, u, d) : (p && t.toggleEffect(n, f ? "add" : u, d), m && f && t.toggleEffect(n, "remove", d));
|
|
2921
2997
|
};
|
|
2922
2998
|
}
|
|
2923
|
-
const
|
|
2924
|
-
function
|
|
2999
|
+
const Ue = /* @__PURE__ */ new WeakMap();
|
|
3000
|
+
function It(e, t) {
|
|
2925
3001
|
return (n) => {
|
|
2926
3002
|
const s = n;
|
|
2927
3003
|
e.contains(s.relatedTarget) || t(s);
|
|
2928
3004
|
};
|
|
2929
3005
|
}
|
|
2930
|
-
function
|
|
3006
|
+
function ro(e) {
|
|
2931
3007
|
return (t) => {
|
|
2932
3008
|
const n = t;
|
|
2933
3009
|
(n.pointerType || n.detail > 0) && e(n);
|
|
2934
3010
|
};
|
|
2935
3011
|
}
|
|
2936
|
-
function
|
|
3012
|
+
function ao(e) {
|
|
2937
3013
|
return (t) => {
|
|
2938
3014
|
const n = t;
|
|
2939
3015
|
n.code === "Space" ? (n.preventDefault(), e(n)) : n.code === "Enter" && e(n);
|
|
2940
3016
|
};
|
|
2941
3017
|
}
|
|
2942
|
-
const
|
|
2943
|
-
focusin: (e, t) =>
|
|
2944
|
-
focusout: (e, t) =>
|
|
2945
|
-
click: (e, t) =>
|
|
2946
|
-
keydown: (e, t) =>
|
|
3018
|
+
const co = {
|
|
3019
|
+
focusin: (e, t) => It(e, t),
|
|
3020
|
+
focusout: (e, t) => It(e, t),
|
|
3021
|
+
click: (e, t) => ro(t),
|
|
3022
|
+
keydown: (e, t) => ao(t)
|
|
2947
3023
|
};
|
|
2948
|
-
function
|
|
2949
|
-
const s =
|
|
3024
|
+
function fo(e, t, n) {
|
|
3025
|
+
const s = co[e];
|
|
2950
3026
|
return s ? s(t, n) : (i) => n(i);
|
|
2951
3027
|
}
|
|
2952
|
-
function
|
|
3028
|
+
function uo(e) {
|
|
2953
3029
|
return typeof e == "object" && !Array.isArray(e) && ("enter" in e || "leave" in e);
|
|
2954
3030
|
}
|
|
2955
|
-
function
|
|
3031
|
+
function lo(e) {
|
|
2956
3032
|
if (typeof e == "string")
|
|
2957
3033
|
return { toggle: [e] };
|
|
2958
3034
|
if (Array.isArray(e))
|
|
2959
3035
|
return { toggle: [...e] };
|
|
2960
|
-
if (
|
|
3036
|
+
if (uo(e)) {
|
|
2961
3037
|
const t = e.enter ? [...e.enter] : [], n = e.leave ? [...e.leave] : [];
|
|
2962
3038
|
return { enter: t, leave: n };
|
|
2963
3039
|
}
|
|
2964
3040
|
return {};
|
|
2965
3041
|
}
|
|
2966
|
-
function
|
|
3042
|
+
function ho(e) {
|
|
2967
3043
|
return !!(e.enter?.length || e.leave?.length);
|
|
2968
3044
|
}
|
|
2969
|
-
function
|
|
2970
|
-
return
|
|
3045
|
+
function mo(e) {
|
|
3046
|
+
return ho(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
|
|
2971
3047
|
}
|
|
2972
|
-
function
|
|
2973
|
-
const a =
|
|
2974
|
-
let
|
|
2975
|
-
if (
|
|
2976
|
-
|
|
3048
|
+
function po(e, t, n, s, { targetController: i, selectorCondition: o, animation: r }) {
|
|
3049
|
+
const a = lo(s.eventConfig), c = n.transition || n.transitionProperties, u = mo(a);
|
|
3050
|
+
let f, l, d = !1;
|
|
3051
|
+
if (c)
|
|
3052
|
+
f = oo(
|
|
2977
3053
|
t,
|
|
2978
3054
|
i,
|
|
2979
3055
|
n,
|
|
@@ -2981,50 +3057,50 @@ function Zi(e, t, n, s, { targetController: i, selectorCondition: o, animation:
|
|
|
2981
3057
|
u
|
|
2982
3058
|
);
|
|
2983
3059
|
else {
|
|
2984
|
-
const y =
|
|
3060
|
+
const y = io(
|
|
2985
3061
|
t,
|
|
2986
3062
|
n,
|
|
2987
3063
|
o,
|
|
2988
3064
|
u,
|
|
2989
3065
|
r
|
|
2990
3066
|
);
|
|
2991
|
-
|
|
3067
|
+
f = y?.handler ?? null, l = y?.cleanup, d = n.triggerType === "once";
|
|
2992
3068
|
}
|
|
2993
|
-
if (!
|
|
3069
|
+
if (!f)
|
|
2994
3070
|
return;
|
|
2995
|
-
const
|
|
2996
|
-
function
|
|
2997
|
-
const
|
|
2998
|
-
y.addEventListener(
|
|
3071
|
+
const h = f, p = new AbortController();
|
|
3072
|
+
function m(y, b, E) {
|
|
3073
|
+
const S = fo(b, e, h);
|
|
3074
|
+
y.addEventListener(b, S, { ...E, signal: p.signal });
|
|
2999
3075
|
}
|
|
3000
3076
|
const v = { source: e, target: t, cleanup: () => {
|
|
3001
|
-
p.abort(),
|
|
3077
|
+
p.abort(), l?.();
|
|
3002
3078
|
} };
|
|
3003
|
-
if (
|
|
3004
|
-
const y = a.enter,
|
|
3005
|
-
y.forEach((
|
|
3006
|
-
|
|
3079
|
+
if (k(Ue, e, v), k(Ue, t, v), u) {
|
|
3080
|
+
const y = a.enter, b = a.leave;
|
|
3081
|
+
y.forEach(($) => {
|
|
3082
|
+
$ === "focusin" && (e.tabIndex = 0), m(e, $, { passive: !0, once: d });
|
|
3007
3083
|
});
|
|
3008
3084
|
const E = !n.stateAction || n.stateAction === "toggle";
|
|
3009
|
-
(
|
|
3010
|
-
if (
|
|
3011
|
-
|
|
3085
|
+
(c ? E : n.triggerType !== "once") && b.forEach(($) => {
|
|
3086
|
+
if ($ === "focusout") {
|
|
3087
|
+
m(e, $, { once: d });
|
|
3012
3088
|
return;
|
|
3013
3089
|
}
|
|
3014
|
-
|
|
3090
|
+
m(e, $, { passive: !0 });
|
|
3015
3091
|
});
|
|
3016
3092
|
} else
|
|
3017
|
-
(a.toggle ?? []).forEach((
|
|
3018
|
-
|
|
3093
|
+
(a.toggle ?? []).forEach((b) => {
|
|
3094
|
+
m(e, b, { once: d, passive: b !== "keydown" });
|
|
3019
3095
|
});
|
|
3020
3096
|
}
|
|
3021
|
-
function
|
|
3022
|
-
|
|
3097
|
+
function go(e) {
|
|
3098
|
+
le(Ue, e);
|
|
3023
3099
|
}
|
|
3024
|
-
const
|
|
3025
|
-
add:
|
|
3026
|
-
remove:
|
|
3027
|
-
},
|
|
3100
|
+
const ee = {
|
|
3101
|
+
add: po,
|
|
3102
|
+
remove: go
|
|
3103
|
+
}, Ke = {
|
|
3028
3104
|
click: ["click"],
|
|
3029
3105
|
activate: ["click", "keydown"],
|
|
3030
3106
|
hover: { enter: ["mouseenter"], leave: ["mouseleave"] },
|
|
@@ -3032,40 +3108,40 @@ const Z = {
|
|
|
3032
3108
|
enter: ["mouseenter", "focusin"],
|
|
3033
3109
|
leave: ["mouseleave", "focusout"]
|
|
3034
3110
|
}
|
|
3035
|
-
},
|
|
3036
|
-
click:
|
|
3037
|
-
hover:
|
|
3111
|
+
}, _t = {
|
|
3112
|
+
click: Ke.activate,
|
|
3113
|
+
hover: Ke.interest
|
|
3038
3114
|
};
|
|
3039
|
-
function
|
|
3040
|
-
const t =
|
|
3115
|
+
function ve(e) {
|
|
3116
|
+
const t = Ke[e];
|
|
3041
3117
|
return (n, s, i, o, r) => {
|
|
3042
|
-
const a = r?.allowA11yTriggers && e in
|
|
3043
|
-
|
|
3118
|
+
const a = r?.allowA11yTriggers && e in _t ? _t[e] : t;
|
|
3119
|
+
ee.add(n, s, i, { eventConfig: a }, r ?? {});
|
|
3044
3120
|
};
|
|
3045
3121
|
}
|
|
3046
|
-
const
|
|
3047
|
-
viewEnter:
|
|
3122
|
+
const D = {
|
|
3123
|
+
viewEnter: li,
|
|
3048
3124
|
hover: {
|
|
3049
|
-
add:
|
|
3050
|
-
remove:
|
|
3125
|
+
add: ve("hover"),
|
|
3126
|
+
remove: ee.remove
|
|
3051
3127
|
},
|
|
3052
3128
|
click: {
|
|
3053
|
-
add:
|
|
3054
|
-
remove:
|
|
3129
|
+
add: ve("click"),
|
|
3130
|
+
remove: ee.remove
|
|
3055
3131
|
},
|
|
3056
|
-
animationEnd:
|
|
3057
|
-
viewProgress:
|
|
3058
|
-
pointerMove:
|
|
3132
|
+
animationEnd: so,
|
|
3133
|
+
viewProgress: Ai,
|
|
3134
|
+
pointerMove: Xi,
|
|
3059
3135
|
activate: {
|
|
3060
|
-
add:
|
|
3061
|
-
remove:
|
|
3136
|
+
add: ve("activate"),
|
|
3137
|
+
remove: ee.remove
|
|
3062
3138
|
},
|
|
3063
3139
|
interest: {
|
|
3064
|
-
add:
|
|
3065
|
-
remove:
|
|
3140
|
+
add: ve("interest"),
|
|
3141
|
+
remove: ee.remove
|
|
3066
3142
|
}
|
|
3067
3143
|
};
|
|
3068
|
-
function
|
|
3144
|
+
function vo(e) {
|
|
3069
3145
|
return e.replace(/\[[^\]]+]/g, "[]");
|
|
3070
3146
|
}
|
|
3071
3147
|
class w {
|
|
@@ -3093,7 +3169,7 @@ class w {
|
|
|
3093
3169
|
if (typeof window > "u" || !window.customElements)
|
|
3094
3170
|
return;
|
|
3095
3171
|
const s = n?.useCustomElement ?? !!w.defineInteractElement;
|
|
3096
|
-
this.dataCache =
|
|
3172
|
+
this.dataCache = wo(t, s, {
|
|
3097
3173
|
configIndex: n?.configIndex,
|
|
3098
3174
|
forceReducedMotion: n?.forceReducedMotion ?? w.forceReducedMotion,
|
|
3099
3175
|
reducedMotionPolicy: n?.reducedMotionPolicy ?? w.reducedMotionPolicy
|
|
@@ -3123,7 +3199,7 @@ class w {
|
|
|
3123
3199
|
return !!this.get(t);
|
|
3124
3200
|
}
|
|
3125
3201
|
get(t) {
|
|
3126
|
-
const n =
|
|
3202
|
+
const n = vo(t);
|
|
3127
3203
|
return this.dataCache.interactions[n];
|
|
3128
3204
|
}
|
|
3129
3205
|
clearMediaQueryListenersForKey(t) {
|
|
@@ -3132,7 +3208,7 @@ class w {
|
|
|
3132
3208
|
}
|
|
3133
3209
|
clearInteractionStateForKey(t) {
|
|
3134
3210
|
(this.get(t)?.interactionIds || []).forEach((i) => {
|
|
3135
|
-
const o =
|
|
3211
|
+
const o = R(i, t);
|
|
3136
3212
|
delete this.addedInteractions[o];
|
|
3137
3213
|
});
|
|
3138
3214
|
const s = `${t}::seq::`;
|
|
@@ -3156,21 +3232,19 @@ class w {
|
|
|
3156
3232
|
}), w.instances.length = 0, w.controllerCache.clear(), w.sequenceCache.clear(), w.elementSequenceMap = /* @__PURE__ */ new WeakMap(), w._released.clear();
|
|
3157
3233
|
}
|
|
3158
3234
|
static setup(t) {
|
|
3159
|
-
t.scrollOptionsGetter &&
|
|
3235
|
+
t.scrollOptionsGetter && D.viewProgress.registerOptionsGetter?.(
|
|
3160
3236
|
t.scrollOptionsGetter
|
|
3161
|
-
), t.pointerOptionsGetter &&
|
|
3237
|
+
), t.pointerOptionsGetter && D.pointerMove.registerOptionsGetter?.(
|
|
3162
3238
|
t.pointerOptionsGetter
|
|
3163
|
-
), t.viewEnter &&
|
|
3239
|
+
), t.viewEnter && D.viewEnter.setOptions(
|
|
3164
3240
|
t.viewEnter
|
|
3165
3241
|
), t.allowA11yTriggers !== void 0 && (w.allowA11yTriggers = t.allowA11yTriggers), t.forceReducedMotion !== void 0 && (w.forceReducedMotion = t.forceReducedMotion), t.reducedMotionPolicy !== void 0 && (w.reducedMotionPolicy = t.reducedMotionPolicy);
|
|
3166
3242
|
}
|
|
3167
3243
|
static getInstance(t) {
|
|
3168
|
-
|
|
3169
|
-
return n || console.warn(`Interact: Instance for key "${t}" not found`), n;
|
|
3244
|
+
return w.instances.find((n) => n.has(t));
|
|
3170
3245
|
}
|
|
3171
3246
|
static getController(t) {
|
|
3172
|
-
|
|
3173
|
-
return n || console.warn(`Interact: Controller for key "${t}" not found`), n;
|
|
3247
|
+
return t ? w.controllerCache.get(t) : void 0;
|
|
3174
3248
|
}
|
|
3175
3249
|
static setController(t, n) {
|
|
3176
3250
|
w.controllerCache.set(t, n);
|
|
@@ -3178,15 +3252,15 @@ class w {
|
|
|
3178
3252
|
static deleteController(t) {
|
|
3179
3253
|
w.controllerCache.delete(t);
|
|
3180
3254
|
}
|
|
3181
|
-
static registerEffects =
|
|
3182
|
-
static getRegisteredEffect =
|
|
3255
|
+
static registerEffects = ds;
|
|
3256
|
+
static getRegisteredEffect = Ze;
|
|
3183
3257
|
/**
|
|
3184
3258
|
* Registers a plugin under a name. When the config carries a plugin field (e.g. `$splitText`) with a matching key
|
|
3185
3259
|
* (on an interaction or effect), Interact invokes the plugin with the field's value and a
|
|
3186
3260
|
* context. Interact is agnostic to what the plugin does — see the `InteractPlugin` type.
|
|
3187
3261
|
*
|
|
3188
|
-
* With `options.defer`, the plugin — and every interaction
|
|
3189
|
-
*
|
|
3262
|
+
* With `options.defer`, the plugin — and every interaction carrying its field, on itself or on
|
|
3263
|
+
* one of its effects or sequences — is deferred until each named event is released via `Interact.ready()`.
|
|
3190
3264
|
*/
|
|
3191
3265
|
static use(t, n, s) {
|
|
3192
3266
|
w.plugins.set(t, n);
|
|
@@ -3215,14 +3289,14 @@ class w {
|
|
|
3215
3289
|
static getSequence(t, n, s) {
|
|
3216
3290
|
const i = w.sequenceCache.get(t);
|
|
3217
3291
|
if (i) return i;
|
|
3218
|
-
const o =
|
|
3292
|
+
const o = ws(n, s);
|
|
3219
3293
|
return w.sequenceCache.set(t, o), w._registerSequenceElements(s, o), o;
|
|
3220
3294
|
}
|
|
3221
3295
|
static addToSequence(t, n, s) {
|
|
3222
3296
|
const i = w.sequenceCache.get(t);
|
|
3223
3297
|
if (!i) return !1;
|
|
3224
|
-
const r =
|
|
3225
|
-
index: s[
|
|
3298
|
+
const r = Gt(n).map((a, c) => ({
|
|
3299
|
+
index: s[c] ?? i.animationGroups.length,
|
|
3226
3300
|
group: a
|
|
3227
3301
|
}));
|
|
3228
3302
|
return i.addGroups(r), w._registerSequenceElements(n, i), !0;
|
|
@@ -3249,8 +3323,8 @@ class w {
|
|
|
3249
3323
|
}
|
|
3250
3324
|
}
|
|
3251
3325
|
}
|
|
3252
|
-
let
|
|
3253
|
-
function
|
|
3326
|
+
let yo = 0;
|
|
3327
|
+
function j(e, {
|
|
3254
3328
|
asCombinator: t = !1,
|
|
3255
3329
|
addItemFilter: n = !1,
|
|
3256
3330
|
useFirstChild: s = !1
|
|
@@ -3262,10 +3336,10 @@ function V(e, {
|
|
|
3262
3336
|
return e.selector;
|
|
3263
3337
|
return s ? t ? "> :first-child" : ":scope > :first-child" : "";
|
|
3264
3338
|
}
|
|
3265
|
-
function
|
|
3339
|
+
function Tt(e) {
|
|
3266
3340
|
return "sequenceId" in e && !("effects" in e);
|
|
3267
3341
|
}
|
|
3268
|
-
function
|
|
3342
|
+
function xe(e, t) {
|
|
3269
3343
|
return e[t] || (e[t] = {
|
|
3270
3344
|
triggers: [],
|
|
3271
3345
|
effects: {},
|
|
@@ -3274,7 +3348,7 @@ function Re(e, t) {
|
|
|
3274
3348
|
selectors: /* @__PURE__ */ new Set()
|
|
3275
3349
|
}), e[t];
|
|
3276
3350
|
}
|
|
3277
|
-
function
|
|
3351
|
+
function Eo(e, t, n) {
|
|
3278
3352
|
const { effects: s = [] } = e;
|
|
3279
3353
|
return s.some((i, o) => n.has(t(o))) ? {
|
|
3280
3354
|
...e,
|
|
@@ -3284,154 +3358,211 @@ function no(e, t, n) {
|
|
|
3284
3358
|
})
|
|
3285
3359
|
} : e;
|
|
3286
3360
|
}
|
|
3287
|
-
function
|
|
3288
|
-
const { configIndex: s } = n, { effects: i = {}, sequences: o = {}, conditions: r = {} } = e, a = {},
|
|
3289
|
-
return e.interactions?.forEach((u,
|
|
3290
|
-
const
|
|
3291
|
-
if (!
|
|
3361
|
+
function wo(e, t, n) {
|
|
3362
|
+
const { configIndex: s } = n, { effects: i = {}, sequences: o = {}, conditions: r = {} } = e, a = {}, c = e.interactions ? rn(e, n) : /* @__PURE__ */ new Map();
|
|
3363
|
+
return e.interactions?.forEach((u, f) => {
|
|
3364
|
+
const l = u.key, d = ++yo, { effects: h, sequences: p, ...m } = u;
|
|
3365
|
+
if (!l) {
|
|
3292
3366
|
console.error(`Interaction ${d} is missing a key for source element.`);
|
|
3293
3367
|
return;
|
|
3294
3368
|
}
|
|
3295
|
-
|
|
3296
|
-
const g =
|
|
3369
|
+
xe(a, l);
|
|
3370
|
+
const g = h ? Array.from(h) : [];
|
|
3297
3371
|
g.reverse();
|
|
3298
|
-
const v = p?.map((E,
|
|
3299
|
-
if (
|
|
3300
|
-
const
|
|
3301
|
-
return
|
|
3372
|
+
const v = p?.map((E, S) => {
|
|
3373
|
+
if (Tt(E)) {
|
|
3374
|
+
const _ = o[E.sequenceId];
|
|
3375
|
+
return _ ? { ..._, ...E } : (console.warn(`Interact: Sequence "${E.sequenceId}" not found in config`), E);
|
|
3302
3376
|
}
|
|
3303
|
-
const
|
|
3304
|
-
return
|
|
3377
|
+
const $ = E;
|
|
3378
|
+
return $.sequenceId || ($.sequenceId = te("seq", [f, S], s)), $;
|
|
3305
3379
|
}), y = {
|
|
3306
|
-
...
|
|
3380
|
+
...m,
|
|
3307
3381
|
effects: g.length > 0 ? g : void 0,
|
|
3308
3382
|
sequences: v?.map(
|
|
3309
|
-
(E,
|
|
3383
|
+
(E, S) => Eo(
|
|
3310
3384
|
E,
|
|
3311
|
-
(
|
|
3312
|
-
|
|
3385
|
+
($) => Se(f, $, S),
|
|
3386
|
+
c
|
|
3313
3387
|
)
|
|
3314
3388
|
)
|
|
3315
3389
|
};
|
|
3316
|
-
a[
|
|
3317
|
-
|
|
3390
|
+
a[l].triggers.push(y), a[l].selectors.add(
|
|
3391
|
+
j(y, { useFirstChild: t })
|
|
3318
3392
|
);
|
|
3319
|
-
const
|
|
3320
|
-
g.forEach((E,
|
|
3321
|
-
const
|
|
3322
|
-
let
|
|
3323
|
-
const I = g.length - 1 -
|
|
3324
|
-
E.effectId || (E.effectId =
|
|
3393
|
+
const b = y.listContainer;
|
|
3394
|
+
g.forEach((E, S) => {
|
|
3395
|
+
const $ = E.effectId ? i[E.effectId] : void 0;
|
|
3396
|
+
let _ = E.key || $?.key;
|
|
3397
|
+
const I = g.length - 1 - S;
|
|
3398
|
+
E.effectId || (E.effectId = te(
|
|
3325
3399
|
"eff",
|
|
3326
|
-
[
|
|
3400
|
+
[f, I],
|
|
3327
3401
|
s
|
|
3328
3402
|
));
|
|
3329
|
-
const
|
|
3330
|
-
if (
|
|
3403
|
+
const O = c.get(Se(f, I));
|
|
3404
|
+
if (O && (E.suffix = O), _ = _ || l, E.key = _, b && E.listContainer && (_ !== l || E.listContainer !== b))
|
|
3331
3405
|
return;
|
|
3332
|
-
const
|
|
3333
|
-
if (E.interactionId =
|
|
3406
|
+
const C = B({ ...$, ...E, key: _ }), T = `${l}::${C}::${d}`;
|
|
3407
|
+
if (E.interactionId = T, a[l].interactionIds.add(T), _ === l)
|
|
3334
3408
|
return;
|
|
3335
|
-
const
|
|
3336
|
-
|
|
3409
|
+
const M = xe(a, _);
|
|
3410
|
+
M.effects[T] || (M.effects[T] = [], M.interactionIds.add(T)), M.effects[T].push({ ...m, effect: E, owner: y }), M.selectors.add(j(E, { useFirstChild: t }));
|
|
3337
3411
|
}), v?.forEach((E) => {
|
|
3338
|
-
if (!E ||
|
|
3339
|
-
const
|
|
3340
|
-
|
|
3341
|
-
I.effectId || (I.effectId = `eff-${
|
|
3342
|
-
let
|
|
3343
|
-
if (!
|
|
3344
|
-
const
|
|
3345
|
-
|
|
3412
|
+
if (!E || Tt(E)) return;
|
|
3413
|
+
const S = E, $ = S.sequenceId;
|
|
3414
|
+
S.effects.forEach((I, O) => {
|
|
3415
|
+
I.effectId || (I.effectId = `eff-${$}-${O}`);
|
|
3416
|
+
let C = I.key;
|
|
3417
|
+
if (!C && I.effectId) {
|
|
3418
|
+
const M = i[I.effectId];
|
|
3419
|
+
M && (C = M.key);
|
|
3346
3420
|
}
|
|
3347
|
-
|
|
3348
|
-
const
|
|
3349
|
-
if (
|
|
3350
|
-
const
|
|
3351
|
-
|
|
3352
|
-
...
|
|
3353
|
-
sequence:
|
|
3354
|
-
|
|
3421
|
+
C = C || l;
|
|
3422
|
+
const T = j(I, { useFirstChild: t });
|
|
3423
|
+
if (T && a[l].selectors.add(T), C !== l) {
|
|
3424
|
+
const M = xe(a, C), P = `${C}::seq::${$}::${d}`;
|
|
3425
|
+
M.sequences[P] || (M.sequences[P] = [], M.interactionIds.add(P)), M.sequences[P].push({
|
|
3426
|
+
...m,
|
|
3427
|
+
sequence: S,
|
|
3428
|
+
owner: y
|
|
3429
|
+
}), M.selectors.add(T);
|
|
3355
3430
|
}
|
|
3356
3431
|
});
|
|
3357
3432
|
});
|
|
3358
3433
|
}), {
|
|
3359
3434
|
effects: i,
|
|
3360
3435
|
sequences: o,
|
|
3361
|
-
conditions:
|
|
3436
|
+
conditions: Ut(r),
|
|
3362
3437
|
reducedMotionPolicy: n.reducedMotionPolicy,
|
|
3363
3438
|
forceReducedMotion: n.forceReducedMotion,
|
|
3364
3439
|
interactions: a
|
|
3365
3440
|
};
|
|
3366
3441
|
}
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
const a = `${Ke}${r}`;
|
|
3371
|
-
if (!(a in n))
|
|
3372
|
-
continue;
|
|
3373
|
-
const l = n[a];
|
|
3374
|
-
if (l !== null && typeof l == "object") {
|
|
3375
|
-
if (e._appliedPlugins.has(l))
|
|
3376
|
-
continue;
|
|
3377
|
-
e._appliedPlugins.add(l);
|
|
3378
|
-
}
|
|
3379
|
-
const c = w.getPlugin(r)(l, { root: t, key: s, scope: i, config: n });
|
|
3380
|
-
typeof c == "function" && e._pluginCleanups.push(c);
|
|
3381
|
-
}
|
|
3442
|
+
const Te = /* @__PURE__ */ new WeakMap();
|
|
3443
|
+
function st(e) {
|
|
3444
|
+
return e !== null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
3382
3445
|
}
|
|
3383
|
-
function
|
|
3446
|
+
function it(e, t) {
|
|
3384
3447
|
for (const n of w.getPluginsNames())
|
|
3385
|
-
if (`${
|
|
3448
|
+
if (`${Xe}${n}` in t && !w._isPluginReleased(n, e))
|
|
3386
3449
|
return !0;
|
|
3387
3450
|
return !1;
|
|
3388
3451
|
}
|
|
3389
|
-
function
|
|
3452
|
+
function K(e, t, n, s, i, o = !0) {
|
|
3453
|
+
if (it(s, n))
|
|
3454
|
+
return !1;
|
|
3455
|
+
const r = [];
|
|
3456
|
+
for (const a of w.getPluginsNames()) {
|
|
3457
|
+
const c = `${Xe}${a}`;
|
|
3458
|
+
if (!(c in n))
|
|
3459
|
+
continue;
|
|
3460
|
+
const u = n[c], f = u !== null && typeof u == "object", l = f ? e._appliedPlugins.get(u) : void 0;
|
|
3461
|
+
if (l === !0)
|
|
3462
|
+
continue;
|
|
3463
|
+
if (l) {
|
|
3464
|
+
r.push(l);
|
|
3465
|
+
continue;
|
|
3466
|
+
}
|
|
3467
|
+
if (!o)
|
|
3468
|
+
continue;
|
|
3469
|
+
f && e._appliedPlugins.set(u, !0);
|
|
3470
|
+
const h = w.getPlugin(a)(u, { root: t, key: s, scope: i, config: n });
|
|
3471
|
+
if (st(h)) {
|
|
3472
|
+
const p = e._connectId, m = Promise.resolve(h).then(
|
|
3473
|
+
(g) => {
|
|
3474
|
+
if (e._connectId !== p) {
|
|
3475
|
+
try {
|
|
3476
|
+
typeof g == "function" && g();
|
|
3477
|
+
} catch (v) {
|
|
3478
|
+
console.error(v);
|
|
3479
|
+
}
|
|
3480
|
+
return;
|
|
3481
|
+
}
|
|
3482
|
+
typeof g == "function" && e._pluginCleanups.push(g), f && e._appliedPlugins.set(u, !0);
|
|
3483
|
+
},
|
|
3484
|
+
(g) => {
|
|
3485
|
+
console.error(g), f && e._connectId === p && e._appliedPlugins.set(u, !0);
|
|
3486
|
+
}
|
|
3487
|
+
);
|
|
3488
|
+
f && (e._appliedPlugins.set(u, m), r.push(m));
|
|
3489
|
+
} else typeof h == "function" && e._pluginCleanups.push(h);
|
|
3490
|
+
}
|
|
3491
|
+
return ot(...r);
|
|
3492
|
+
}
|
|
3493
|
+
function X(e, t, n, s, i, o) {
|
|
3494
|
+
if (st(e)) {
|
|
3495
|
+
const f = s._connectId, l = t._connectId, d = Te.get(t);
|
|
3496
|
+
e.then(() => {
|
|
3497
|
+
s.connected && s._connectId === f && t._connectId === l && Te.get(t) === d && t.resume();
|
|
3498
|
+
});
|
|
3499
|
+
}
|
|
3500
|
+
const r = D[n.trigger], a = r?.latch;
|
|
3501
|
+
if (!a)
|
|
3502
|
+
return;
|
|
3503
|
+
let c, u;
|
|
3504
|
+
i ? c = En(n, s, o) : r.latchesSubtree && (n.selector || n.listContainer) ? (c = s.element, u = j(n)) : c = ae(
|
|
3505
|
+
n,
|
|
3506
|
+
s.element,
|
|
3507
|
+
s.useFirstChild,
|
|
3508
|
+
!1
|
|
3509
|
+
), c && (Array.isArray(c) ? c : [c]).forEach((f) => {
|
|
3510
|
+
const l = a(f, n.params, u);
|
|
3511
|
+
l && s._latches.push({ element: f, release: l });
|
|
3512
|
+
});
|
|
3513
|
+
}
|
|
3514
|
+
function bo(e) {
|
|
3515
|
+
e._latches = e._latches.filter(({ element: t, release: n }) => e.element.contains(t) ? !0 : (n(), !1));
|
|
3516
|
+
}
|
|
3517
|
+
function ot(...e) {
|
|
3518
|
+
const t = e.filter(st);
|
|
3519
|
+
return t.length ? Promise.all(t).then(() => {
|
|
3520
|
+
}) : e.every(Boolean);
|
|
3521
|
+
}
|
|
3522
|
+
function ae(e, t, n, s = !0) {
|
|
3390
3523
|
if (e.listContainer) {
|
|
3391
|
-
const
|
|
3392
|
-
return
|
|
3524
|
+
const i = t.querySelector(e.listContainer);
|
|
3525
|
+
return i ? e.selector ? Array.from(i.querySelectorAll(e.selector)) : Array.from(i.children) : (s && console.warn(`Interact: No container found for list container "${e.listContainer}"`), []);
|
|
3393
3526
|
}
|
|
3394
3527
|
if (e.selector) {
|
|
3395
|
-
const
|
|
3396
|
-
|
|
3397
|
-
return Array.from(s);
|
|
3398
|
-
console.warn(`Interact: No elements found for selector "${e.selector}"`);
|
|
3528
|
+
const i = t.querySelectorAll(e.selector);
|
|
3529
|
+
return i.length > 0 ? Array.from(i) : (s && console.warn(`Interact: No elements found for selector "${e.selector}"`), null);
|
|
3399
3530
|
}
|
|
3400
3531
|
return n ? t.firstElementChild : t;
|
|
3401
3532
|
}
|
|
3402
|
-
function
|
|
3533
|
+
function Me(e, t) {
|
|
3403
3534
|
return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
|
|
3404
3535
|
}
|
|
3405
|
-
function
|
|
3406
|
-
const { effects: i, conditions: o, reducedMotionPolicy: r, forceReducedMotion: a } = t.dataCache,
|
|
3536
|
+
function ke(e, t, n, s = {}) {
|
|
3537
|
+
const { effects: i, conditions: o, reducedMotionPolicy: r, forceReducedMotion: a } = t.dataCache, c = Kt(
|
|
3407
3538
|
e,
|
|
3408
|
-
|
|
3539
|
+
Pe(e.reducedMotionPolicy, s.policy, r),
|
|
3409
3540
|
{ effects: i, force: a, collapsesStagger: s.collapsesStagger }
|
|
3410
3541
|
);
|
|
3411
3542
|
let u;
|
|
3412
|
-
return
|
|
3413
|
-
const d =
|
|
3543
|
+
return c.forEach((f, l) => {
|
|
3544
|
+
const d = H(f.conditions || [], o);
|
|
3414
3545
|
d && t.setupMediaQueryListener(
|
|
3415
|
-
|
|
3546
|
+
l ? `${n.id}::rm${l}` : n.id,
|
|
3416
3547
|
d,
|
|
3417
3548
|
n.key,
|
|
3418
3549
|
n.onUpdate
|
|
3419
|
-
), !u && (!d || d.matches) && (u =
|
|
3550
|
+
), !u && (!d || d.matches) && (u = f);
|
|
3420
3551
|
}), u;
|
|
3421
3552
|
}
|
|
3422
|
-
function
|
|
3553
|
+
function dn(e, t, n, s, i, o, r, a) {
|
|
3423
3554
|
return [
|
|
3424
|
-
r ?
|
|
3425
|
-
a ?
|
|
3555
|
+
r ? Me(e, r) : ae(e, n, s),
|
|
3556
|
+
a ? Me(t, a) : ae(t, i, o)
|
|
3426
3557
|
];
|
|
3427
3558
|
}
|
|
3428
|
-
function
|
|
3429
|
-
const
|
|
3430
|
-
|
|
3431
|
-
const d = u ? i[
|
|
3432
|
-
d &&
|
|
3559
|
+
function hn(e, t, n, s, i, o, r, a) {
|
|
3560
|
+
const c = Array.isArray(s), u = Array.isArray(i);
|
|
3561
|
+
c ? s.forEach((f, l) => {
|
|
3562
|
+
const d = u ? i[l] : i;
|
|
3563
|
+
d && Mt(
|
|
3433
3564
|
e,
|
|
3434
|
-
|
|
3565
|
+
f,
|
|
3435
3566
|
t.trigger,
|
|
3436
3567
|
d,
|
|
3437
3568
|
n,
|
|
@@ -3440,12 +3571,12 @@ function rn(e, t, n, s, i, o, r, a) {
|
|
|
3440
3571
|
r,
|
|
3441
3572
|
a
|
|
3442
3573
|
);
|
|
3443
|
-
}) : (u ? i : [i]).forEach((
|
|
3444
|
-
|
|
3574
|
+
}) : (u ? i : [i]).forEach((l) => {
|
|
3575
|
+
Mt(
|
|
3445
3576
|
e,
|
|
3446
3577
|
s,
|
|
3447
3578
|
t.trigger,
|
|
3448
|
-
|
|
3579
|
+
l,
|
|
3449
3580
|
n,
|
|
3450
3581
|
t.params,
|
|
3451
3582
|
o,
|
|
@@ -3454,21 +3585,21 @@ function rn(e, t, n, s, i, o, r, a) {
|
|
|
3454
3585
|
);
|
|
3455
3586
|
});
|
|
3456
3587
|
}
|
|
3457
|
-
function
|
|
3588
|
+
function $o(e, t, n, s, i) {
|
|
3458
3589
|
const o = {}, r = [];
|
|
3459
|
-
(s.effects || []).forEach((a,
|
|
3460
|
-
const u = a.effectId,
|
|
3590
|
+
return (s.effects || []).forEach((a, c) => {
|
|
3591
|
+
const u = a.effectId, f = {
|
|
3461
3592
|
...n.dataCache.effects[u] || {},
|
|
3462
3593
|
...a,
|
|
3463
3594
|
effectId: u
|
|
3464
|
-
},
|
|
3595
|
+
}, l = f.key, d = R(a.interactionId, e);
|
|
3465
3596
|
if (o[d] || n.addedInteractions[d] && !i)
|
|
3466
3597
|
return;
|
|
3467
|
-
const
|
|
3468
|
-
|
|
3598
|
+
const h = ke(
|
|
3599
|
+
f,
|
|
3469
3600
|
n,
|
|
3470
3601
|
{
|
|
3471
|
-
id: `${d}::${
|
|
3602
|
+
id: `${d}::${c}`,
|
|
3472
3603
|
key: e,
|
|
3473
3604
|
onUpdate: () => {
|
|
3474
3605
|
t.update();
|
|
@@ -3476,130 +3607,202 @@ function an(e, t, n, s, i) {
|
|
|
3476
3607
|
},
|
|
3477
3608
|
{ policy: s.reducedMotionPolicy }
|
|
3478
3609
|
);
|
|
3479
|
-
if (
|
|
3610
|
+
if (h) {
|
|
3480
3611
|
o[d] = !0;
|
|
3481
|
-
const p =
|
|
3482
|
-
let
|
|
3483
|
-
|
|
3484
|
-
if (h = w.getController(p), !h)
|
|
3485
|
-
return;
|
|
3486
|
-
m.listContainer && h.watchChildList(m.listContainer);
|
|
3487
|
-
} else
|
|
3488
|
-
h = t;
|
|
3489
|
-
if (z(p || s.key, m))
|
|
3490
|
-
return;
|
|
3491
|
-
Me(
|
|
3492
|
-
h,
|
|
3493
|
-
h.element,
|
|
3494
|
-
m,
|
|
3495
|
-
p || s.key,
|
|
3496
|
-
"effect"
|
|
3497
|
-
);
|
|
3498
|
-
const [g, v] = on(
|
|
3499
|
-
s,
|
|
3500
|
-
m,
|
|
3501
|
-
t.element,
|
|
3502
|
-
t.useFirstChild,
|
|
3503
|
-
h.element,
|
|
3504
|
-
h.useFirstChild,
|
|
3505
|
-
i
|
|
3506
|
-
);
|
|
3507
|
-
if (!g || !v)
|
|
3508
|
-
return;
|
|
3509
|
-
n.addedInteractions[d] = !0;
|
|
3510
|
-
const y = p || s.key, $ = x(
|
|
3511
|
-
m.conditions || [],
|
|
3512
|
-
n.dataCache.conditions
|
|
3513
|
-
);
|
|
3514
|
-
r.push([
|
|
3515
|
-
y,
|
|
3516
|
-
s,
|
|
3517
|
-
m,
|
|
3518
|
-
g,
|
|
3519
|
-
v,
|
|
3520
|
-
$,
|
|
3521
|
-
h.useFirstChild,
|
|
3522
|
-
e
|
|
3523
|
-
]);
|
|
3612
|
+
const p = l && R(l, e);
|
|
3613
|
+
let m;
|
|
3614
|
+
p ? (m = w.getController(p), m && h.listContainer && m.watchChildList(h.listContainer)) : m = t, r.push({ interactionId: d, effectOptions: h, target: p, targetController: m });
|
|
3524
3615
|
}
|
|
3525
|
-
}), r
|
|
3526
|
-
|
|
3527
|
-
|
|
3616
|
+
}), r;
|
|
3617
|
+
}
|
|
3618
|
+
function So(e, t, n, s, i) {
|
|
3619
|
+
const o = [];
|
|
3620
|
+
return s.sequences?.forEach((r) => {
|
|
3621
|
+
let a;
|
|
3622
|
+
if (To(r)) {
|
|
3623
|
+
const d = n.dataCache.sequences[r.sequenceId];
|
|
3624
|
+
if (!d) {
|
|
3625
|
+
console.warn(`Interact: Sequence "${r.sequenceId}" not found in cache`);
|
|
3626
|
+
return;
|
|
3627
|
+
}
|
|
3628
|
+
a = { ...d, ...r };
|
|
3629
|
+
} else
|
|
3630
|
+
a = r;
|
|
3631
|
+
const c = a.sequenceId || ie(), u = R(`${e}::seq::${c}`, e);
|
|
3632
|
+
if (n.addedInteractions[u] && !i) return;
|
|
3633
|
+
const f = pn(
|
|
3634
|
+
a,
|
|
3635
|
+
s,
|
|
3636
|
+
u,
|
|
3637
|
+
e,
|
|
3638
|
+
n,
|
|
3639
|
+
{
|
|
3640
|
+
updateKey: e,
|
|
3641
|
+
onUpdate: () => t.update()
|
|
3642
|
+
}
|
|
3643
|
+
);
|
|
3644
|
+
if (!f) return;
|
|
3645
|
+
const l = i && s.listContainer && n.addedInteractions[u] ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0;
|
|
3646
|
+
o.push({ sequenceConfig: a, cacheKey: u, listElements: l, effects: f });
|
|
3647
|
+
}), o;
|
|
3648
|
+
}
|
|
3649
|
+
function Io(e, t, n, s, i) {
|
|
3650
|
+
const o = $o(e, t, n, s, i), r = So(e, t, n, s, i);
|
|
3651
|
+
if (o.some(
|
|
3652
|
+
({ effectOptions: l, target: d }) => it(d || s.key, l)
|
|
3653
|
+
) || r.some((l) => gn(l.effects, e)))
|
|
3654
|
+
return { readiness: !1, effects: [], sequences: [] };
|
|
3655
|
+
const c = o.filter(
|
|
3656
|
+
(l) => !!l.targetController
|
|
3657
|
+
), u = c.map(
|
|
3658
|
+
({ effectOptions: l, target: d, targetController: h }) => K(
|
|
3659
|
+
h,
|
|
3660
|
+
h.element,
|
|
3661
|
+
l,
|
|
3662
|
+
d || s.key,
|
|
3663
|
+
"effect"
|
|
3664
|
+
)
|
|
3665
|
+
), f = [];
|
|
3666
|
+
return r.forEach((l) => {
|
|
3667
|
+
const d = vn(l.effects, e, t);
|
|
3668
|
+
d && (f.push({ ...l, effects: d }), u.push(...d.map((h) => h.readiness)));
|
|
3669
|
+
}), {
|
|
3670
|
+
readiness: ot(...u),
|
|
3671
|
+
effects: c,
|
|
3672
|
+
sequences: f
|
|
3673
|
+
};
|
|
3528
3674
|
}
|
|
3529
|
-
function
|
|
3530
|
-
|
|
3675
|
+
function rt(e, t, n, s, i, o = t) {
|
|
3676
|
+
const r = Io(
|
|
3677
|
+
e,
|
|
3678
|
+
t,
|
|
3679
|
+
n,
|
|
3680
|
+
s,
|
|
3681
|
+
i
|
|
3682
|
+
);
|
|
3683
|
+
if (r.readiness !== !0) {
|
|
3684
|
+
X(r.readiness, o, s, t, !0, i);
|
|
3685
|
+
return;
|
|
3686
|
+
}
|
|
3687
|
+
const a = [];
|
|
3688
|
+
r.effects.forEach(({ interactionId: c, effectOptions: u, target: f, targetController: l }) => {
|
|
3689
|
+
const [d, h] = dn(
|
|
3690
|
+
s,
|
|
3691
|
+
u,
|
|
3692
|
+
t.element,
|
|
3693
|
+
t.useFirstChild,
|
|
3694
|
+
l.element,
|
|
3695
|
+
l.useFirstChild,
|
|
3696
|
+
// An item pass only extends an attached effect. Until then it attaches to every item at once —
|
|
3697
|
+
// marking it added for the new items alone would make the full pass skip the others (e.g. the
|
|
3698
|
+
// one about to resume once an async plugin settled).
|
|
3699
|
+
n.addedInteractions[c] ? i : void 0
|
|
3700
|
+
);
|
|
3701
|
+
if (!d || !h)
|
|
3702
|
+
return;
|
|
3703
|
+
n.addedInteractions[c] = !0;
|
|
3704
|
+
const p = f || s.key, m = U(
|
|
3705
|
+
u.conditions || [],
|
|
3706
|
+
n.dataCache.conditions
|
|
3707
|
+
);
|
|
3708
|
+
a.push([
|
|
3709
|
+
p,
|
|
3710
|
+
s,
|
|
3711
|
+
u,
|
|
3712
|
+
d,
|
|
3713
|
+
h,
|
|
3714
|
+
m,
|
|
3715
|
+
l.useFirstChild,
|
|
3716
|
+
e
|
|
3717
|
+
]);
|
|
3718
|
+
}), a.reverse().forEach((c) => {
|
|
3719
|
+
hn(...c);
|
|
3720
|
+
}), Oo(t, n, s, r.sequences, i);
|
|
3721
|
+
}
|
|
3722
|
+
function mn(e, t, n) {
|
|
3723
|
+
return Pe(
|
|
3531
3724
|
e.reducedMotionPolicy,
|
|
3532
3725
|
t.reducedMotionPolicy,
|
|
3533
3726
|
n.dataCache.reducedMotionPolicy
|
|
3534
3727
|
);
|
|
3535
3728
|
}
|
|
3536
|
-
function
|
|
3537
|
-
const { forceReducedMotion: s, conditions: i } = n.dataCache, o =
|
|
3538
|
-
return (s || !!(o && o.matches)) &&
|
|
3729
|
+
function _o(e, t, n) {
|
|
3730
|
+
const { forceReducedMotion: s, conditions: i } = n.dataCache, o = H([Oe], i);
|
|
3731
|
+
return (s || !!(o && o.matches)) && mn(e, t, n) !== "ignore" ? { ...e, offset: 0 } : e;
|
|
3539
3732
|
}
|
|
3540
|
-
function
|
|
3733
|
+
function To(e) {
|
|
3541
3734
|
return "sequenceId" in e && !("effects" in e);
|
|
3542
3735
|
}
|
|
3543
|
-
function
|
|
3544
|
-
const
|
|
3545
|
-
if (
|
|
3546
|
-
const
|
|
3547
|
-
const
|
|
3548
|
-
return { ...
|
|
3549
|
-
};
|
|
3550
|
-
|
|
3551
|
-
const
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
return z(y || s, g);
|
|
3555
|
-
}))
|
|
3556
|
-
return null;
|
|
3557
|
-
const d = [], m = cn(e, t, o);
|
|
3558
|
-
let p = !1;
|
|
3559
|
-
for (const h of u) {
|
|
3560
|
-
const g = h.effectId, v = _e(
|
|
3561
|
-
c(h),
|
|
3562
|
-
o,
|
|
3736
|
+
function pn(e, t, n, s, i, o) {
|
|
3737
|
+
const r = H(e.conditions || [], i.dataCache.conditions);
|
|
3738
|
+
if (r && i.setupMediaQueryListener(n, r, o.updateKey, o.onUpdate), r && !r.matches) return null;
|
|
3739
|
+
const a = e.effects || [], c = (l) => {
|
|
3740
|
+
const d = l.effectId;
|
|
3741
|
+
return { ...d ? i.dataCache.effects[d] || {} : {}, ...l };
|
|
3742
|
+
}, u = mn(e, t, i), f = [];
|
|
3743
|
+
for (const l of a) {
|
|
3744
|
+
const d = l.effectId, h = ke(
|
|
3745
|
+
c(l),
|
|
3746
|
+
i,
|
|
3563
3747
|
{
|
|
3564
|
-
id: `${n}::${
|
|
3565
|
-
key:
|
|
3566
|
-
onUpdate:
|
|
3748
|
+
id: `${n}::${d || "eff"}`,
|
|
3749
|
+
key: o.updateKey,
|
|
3750
|
+
onUpdate: o.onUpdate
|
|
3567
3751
|
},
|
|
3568
|
-
{ policy:
|
|
3752
|
+
{ policy: u, collapsesStagger: u !== "ignore" }
|
|
3569
3753
|
);
|
|
3570
|
-
if (!
|
|
3571
|
-
const
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3754
|
+
if (!h) continue;
|
|
3755
|
+
const p = h.key && R(h.key, s);
|
|
3756
|
+
f.push({ effectOptions: h, target: p });
|
|
3757
|
+
}
|
|
3758
|
+
return f;
|
|
3759
|
+
}
|
|
3760
|
+
function gn(e, t) {
|
|
3761
|
+
return e.some(
|
|
3762
|
+
({ effectOptions: n, target: s }) => it(s || t, n)
|
|
3763
|
+
);
|
|
3764
|
+
}
|
|
3765
|
+
function vn(e, t, n) {
|
|
3766
|
+
const s = [];
|
|
3767
|
+
for (const { effectOptions: i, target: o } of e) {
|
|
3768
|
+
let r;
|
|
3769
|
+
if (o) {
|
|
3770
|
+
if (r = w.getController(o), !r) return null;
|
|
3575
3771
|
} else
|
|
3576
|
-
|
|
3577
|
-
const
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
b,
|
|
3772
|
+
r = n;
|
|
3773
|
+
const a = o || t, c = K(
|
|
3774
|
+
r,
|
|
3775
|
+
r.element,
|
|
3776
|
+
i,
|
|
3777
|
+
a,
|
|
3583
3778
|
"effect"
|
|
3584
3779
|
);
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3780
|
+
s.push({ effectOptions: i, targetController: r, resolvedTargetKey: a, readiness: c });
|
|
3781
|
+
}
|
|
3782
|
+
return s;
|
|
3783
|
+
}
|
|
3784
|
+
function yn(e, t) {
|
|
3785
|
+
const n = [];
|
|
3786
|
+
let s = !1;
|
|
3787
|
+
for (const { effectOptions: i, targetController: o, resolvedTargetKey: r } of e) {
|
|
3788
|
+
let a;
|
|
3789
|
+
if (t && r === t.controllerKey && i.listContainer === t.listContainer ? (a = Me(i, t.elements), a.length > 0 && (s = !0)) : a = ae(
|
|
3790
|
+
i,
|
|
3791
|
+
o.element,
|
|
3792
|
+
o.useFirstChild
|
|
3793
|
+
), !a || Array.isArray(a) && a.length === 0) return null;
|
|
3794
|
+
const c = x(i);
|
|
3795
|
+
n.push({ target: a, options: c });
|
|
3796
|
+
}
|
|
3797
|
+
return t && !s ? null : n.length > 0 ? n : null;
|
|
3798
|
+
}
|
|
3799
|
+
function En(e, t, n) {
|
|
3800
|
+
const s = n ? Me(e, n) : ae(e, t.element, t.useFirstChild);
|
|
3598
3801
|
return Array.isArray(s) && s.length === 0 ? null : s;
|
|
3599
3802
|
}
|
|
3600
|
-
function
|
|
3803
|
+
function Mo(e, t, n, s, i) {
|
|
3601
3804
|
(Array.isArray(n) ? n : [n]).forEach((r) => {
|
|
3602
|
-
|
|
3805
|
+
D[e.trigger]?.add(
|
|
3603
3806
|
r,
|
|
3604
3807
|
r,
|
|
3605
3808
|
{ triggerType: t.triggerType },
|
|
@@ -3612,224 +3815,196 @@ function Ue(e, t, n, s, i) {
|
|
|
3612
3815
|
);
|
|
3613
3816
|
});
|
|
3614
3817
|
}
|
|
3615
|
-
function
|
|
3818
|
+
function wn(e, t, n) {
|
|
3616
3819
|
const o = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
|
|
3617
|
-
if (!o) return n.map((a,
|
|
3820
|
+
if (!o) return n.map((a, c) => c);
|
|
3618
3821
|
const r = Array.from(o.children);
|
|
3619
3822
|
return n.map((a) => {
|
|
3620
|
-
const
|
|
3621
|
-
return
|
|
3823
|
+
const c = r.indexOf(a);
|
|
3824
|
+
return c >= 0 ? c : r.length;
|
|
3622
3825
|
});
|
|
3623
3826
|
}
|
|
3624
|
-
function
|
|
3625
|
-
s.
|
|
3626
|
-
|
|
3627
|
-
if (
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
} else
|
|
3635
|
-
r = o;
|
|
3636
|
-
const a = r.sequenceId || ne(), l = A(`${e}::seq::${a}`, e);
|
|
3637
|
-
if (n.addedInteractions[l] && !i) return;
|
|
3638
|
-
const u = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, c = ln(
|
|
3827
|
+
function Oo(e, t, n, s, i) {
|
|
3828
|
+
s.forEach(({ sequenceConfig: o, cacheKey: r, listElements: a, effects: c }) => {
|
|
3829
|
+
const u = yn(c, a);
|
|
3830
|
+
if (!u) return;
|
|
3831
|
+
const f = t.addedInteractions[r] ? i : void 0;
|
|
3832
|
+
if (f) {
|
|
3833
|
+
const p = wn(e, n.listContainer, f);
|
|
3834
|
+
w.addToSequence(r, u, p);
|
|
3835
|
+
}
|
|
3836
|
+
const l = w.getSequence(
|
|
3639
3837
|
r,
|
|
3640
|
-
|
|
3641
|
-
l,
|
|
3642
|
-
e,
|
|
3643
|
-
t,
|
|
3644
|
-
n,
|
|
3645
|
-
{
|
|
3646
|
-
updateKey: e,
|
|
3647
|
-
onUpdate: () => t.update()
|
|
3648
|
-
},
|
|
3838
|
+
_o(o, n, t),
|
|
3649
3839
|
u
|
|
3650
|
-
)
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
w.addToSequence(l, c, p);
|
|
3659
|
-
const h = w.getSequence(
|
|
3660
|
-
l,
|
|
3661
|
-
Be(r, s, n),
|
|
3662
|
-
c
|
|
3663
|
-
), g = x(
|
|
3664
|
-
s.conditions || [],
|
|
3665
|
-
n.dataCache.conditions
|
|
3666
|
-
), v = Ye(s, t, i);
|
|
3667
|
-
v && Ue(
|
|
3668
|
-
s,
|
|
3669
|
-
r,
|
|
3670
|
-
v,
|
|
3671
|
-
h,
|
|
3672
|
-
g
|
|
3673
|
-
);
|
|
3674
|
-
return;
|
|
3675
|
-
}
|
|
3676
|
-
const f = w.getSequence(
|
|
3840
|
+
), d = U(
|
|
3841
|
+
n.conditions || [],
|
|
3842
|
+
t.dataCache.conditions
|
|
3843
|
+
), h = En(n, e, f);
|
|
3844
|
+
h && (t.addedInteractions[r] = !0, Mo(
|
|
3845
|
+
n,
|
|
3846
|
+
o,
|
|
3847
|
+
h,
|
|
3677
3848
|
l,
|
|
3678
|
-
Be(r, s, n),
|
|
3679
|
-
c
|
|
3680
|
-
), d = x(
|
|
3681
|
-
s.conditions || [],
|
|
3682
|
-
n.dataCache.conditions
|
|
3683
|
-
), m = Ye(s, t, i);
|
|
3684
|
-
m && (n.addedInteractions[l] = !0, Ue(
|
|
3685
|
-
s,
|
|
3686
|
-
r,
|
|
3687
|
-
m,
|
|
3688
|
-
f,
|
|
3689
3849
|
d
|
|
3690
3850
|
));
|
|
3691
3851
|
});
|
|
3692
3852
|
}
|
|
3693
|
-
function
|
|
3853
|
+
function bn(e, t, n, s, i, o) {
|
|
3854
|
+
const r = K(
|
|
3855
|
+
s,
|
|
3856
|
+
s.element,
|
|
3857
|
+
t,
|
|
3858
|
+
n,
|
|
3859
|
+
"interaction"
|
|
3860
|
+
);
|
|
3861
|
+
return r !== !0 ? (X(r, i, t, s, !1), !1) : o.addedInteractions[e] ? !0 : (rt(n, s, o, t, void 0, i), !1);
|
|
3862
|
+
}
|
|
3863
|
+
function Po(e, t, n, s, i) {
|
|
3694
3864
|
const o = n.get(e)?.sequences || {};
|
|
3695
3865
|
Object.keys(o).forEach((a) => {
|
|
3696
|
-
o[a].some(({ sequence: u, ...
|
|
3697
|
-
const
|
|
3698
|
-
|
|
3866
|
+
o[a].some(({ sequence: u, owner: f, ...l }) => {
|
|
3867
|
+
const d = H(
|
|
3868
|
+
l.conditions || [],
|
|
3699
3869
|
n.dataCache.conditions
|
|
3700
3870
|
);
|
|
3701
|
-
if (
|
|
3871
|
+
if (d && !d.matches)
|
|
3702
3872
|
return !1;
|
|
3703
|
-
const
|
|
3704
|
-
if (!
|
|
3873
|
+
const h = l.key && R(l.key, e), p = w.getController(h);
|
|
3874
|
+
if (!p)
|
|
3705
3875
|
return !0;
|
|
3706
|
-
const
|
|
3707
|
-
if (n.addedInteractions[
|
|
3876
|
+
const m = u.sequenceId || ie(), g = R(`${h}::seq::${m}`, h);
|
|
3877
|
+
if (n.addedInteractions[g] && !i || !bn(
|
|
3878
|
+
g,
|
|
3879
|
+
f,
|
|
3880
|
+
h,
|
|
3881
|
+
p,
|
|
3882
|
+
t,
|
|
3883
|
+
n
|
|
3884
|
+
))
|
|
3708
3885
|
return !0;
|
|
3709
|
-
const v =
|
|
3886
|
+
const v = pn(
|
|
3710
3887
|
u,
|
|
3711
|
-
|
|
3888
|
+
l,
|
|
3889
|
+
g,
|
|
3712
3890
|
h,
|
|
3713
|
-
d,
|
|
3714
|
-
m,
|
|
3715
3891
|
n,
|
|
3716
|
-
{
|
|
3717
|
-
updateKey: e,
|
|
3718
|
-
onUpdate: () => t.update()
|
|
3719
|
-
},
|
|
3720
|
-
i && s ? { controllerKey: e, listContainer: s, elements: i } : void 0
|
|
3892
|
+
{ updateKey: e, onUpdate: () => t.update() }
|
|
3721
3893
|
);
|
|
3722
3894
|
if (!v) return !0;
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
return
|
|
3895
|
+
const y = gn(v, h) ? null : vn(v, h, p), b = y ? ot(...y.map((S) => S.readiness)) : !1;
|
|
3896
|
+
if (b !== !0)
|
|
3897
|
+
return X(b, t, l, p, !0), !0;
|
|
3898
|
+
const E = yn(y, {
|
|
3899
|
+
controllerKey: e,
|
|
3900
|
+
listContainer: s,
|
|
3901
|
+
elements: i
|
|
3902
|
+
});
|
|
3903
|
+
if (E) {
|
|
3904
|
+
const S = wn(t, s, i);
|
|
3905
|
+
w.addToSequence(g, E, S);
|
|
3726
3906
|
}
|
|
3727
|
-
|
|
3728
|
-
h,
|
|
3729
|
-
Be(u, c, n),
|
|
3730
|
-
v
|
|
3731
|
-
), $ = x(
|
|
3732
|
-
c.conditions || [],
|
|
3733
|
-
n.dataCache.conditions
|
|
3734
|
-
), E = Ye(c, m);
|
|
3735
|
-
return E && (n.addedInteractions[h] = !0, Ue(
|
|
3736
|
-
c,
|
|
3737
|
-
u,
|
|
3738
|
-
E,
|
|
3739
|
-
y,
|
|
3740
|
-
$
|
|
3741
|
-
)), !0;
|
|
3907
|
+
return !0;
|
|
3742
3908
|
});
|
|
3743
3909
|
});
|
|
3744
3910
|
}
|
|
3745
|
-
function
|
|
3746
|
-
const o = n.get(e), r = o?.effects || {}, a = Object.keys(r),
|
|
3747
|
-
a.forEach((
|
|
3748
|
-
const
|
|
3749
|
-
if (n.addedInteractions[
|
|
3911
|
+
function $n(e, t, n, s, i) {
|
|
3912
|
+
const o = n.get(e), r = o?.effects || {}, a = Object.keys(r), c = [];
|
|
3913
|
+
a.forEach((f) => {
|
|
3914
|
+
const l = R(f, e);
|
|
3915
|
+
if (n.addedInteractions[l] && !i)
|
|
3750
3916
|
return;
|
|
3751
|
-
r[
|
|
3752
|
-
const
|
|
3753
|
-
|
|
3917
|
+
r[f].some(({ effect: h, owner: p, ...m }, g) => {
|
|
3918
|
+
const v = H(
|
|
3919
|
+
m.conditions || [],
|
|
3754
3920
|
n.dataCache.conditions
|
|
3755
3921
|
);
|
|
3756
|
-
if (
|
|
3922
|
+
if (v && !v.matches)
|
|
3757
3923
|
return !1;
|
|
3758
|
-
const
|
|
3759
|
-
...n.dataCache.effects[
|
|
3760
|
-
...
|
|
3761
|
-
effectId:
|
|
3924
|
+
const y = h.effectId, b = {
|
|
3925
|
+
...n.dataCache.effects[y] || {},
|
|
3926
|
+
...h,
|
|
3927
|
+
effectId: y
|
|
3762
3928
|
};
|
|
3763
|
-
if (s &&
|
|
3929
|
+
if (s && b.listContainer !== s)
|
|
3764
3930
|
return !1;
|
|
3765
|
-
const
|
|
3766
|
-
|
|
3931
|
+
const E = ke(
|
|
3932
|
+
b,
|
|
3767
3933
|
n,
|
|
3768
3934
|
{
|
|
3769
|
-
id: `${
|
|
3935
|
+
id: `${l}::${g}`,
|
|
3770
3936
|
key: e,
|
|
3771
3937
|
onUpdate: () => {
|
|
3772
3938
|
t.update();
|
|
3773
3939
|
}
|
|
3774
3940
|
},
|
|
3775
|
-
{ policy:
|
|
3941
|
+
{ policy: m.reducedMotionPolicy }
|
|
3776
3942
|
);
|
|
3777
|
-
if (
|
|
3778
|
-
const
|
|
3779
|
-
if (
|
|
3943
|
+
if (E) {
|
|
3944
|
+
const S = m.key && R(m.key, e), $ = w.getController(S);
|
|
3945
|
+
if (!$ || !bn(
|
|
3946
|
+
l,
|
|
3947
|
+
p,
|
|
3948
|
+
S,
|
|
3949
|
+
$,
|
|
3950
|
+
t,
|
|
3951
|
+
n
|
|
3952
|
+
))
|
|
3780
3953
|
return !0;
|
|
3781
|
-
|
|
3954
|
+
const _ = K(
|
|
3782
3955
|
t,
|
|
3783
3956
|
t.element,
|
|
3784
|
-
|
|
3957
|
+
E,
|
|
3785
3958
|
e,
|
|
3786
3959
|
"effect"
|
|
3787
|
-
)
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3960
|
+
);
|
|
3961
|
+
if (_ !== !0)
|
|
3962
|
+
return X(_, t, m, $, !0), !0;
|
|
3963
|
+
E.listContainer && t.watchChildList(E.listContainer);
|
|
3964
|
+
const [I, O] = dn(
|
|
3965
|
+
m,
|
|
3966
|
+
E,
|
|
3967
|
+
$.element,
|
|
3968
|
+
$.useFirstChild,
|
|
3793
3969
|
t.element,
|
|
3794
3970
|
t.useFirstChild,
|
|
3795
3971
|
void 0,
|
|
3796
3972
|
i
|
|
3797
3973
|
);
|
|
3798
|
-
if (!
|
|
3974
|
+
if (!I || !O)
|
|
3799
3975
|
return !0;
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
$.conditions || [],
|
|
3976
|
+
const C = U(
|
|
3977
|
+
E.conditions || [],
|
|
3803
3978
|
n.dataCache.conditions
|
|
3804
3979
|
);
|
|
3805
|
-
return
|
|
3980
|
+
return c.push([
|
|
3806
3981
|
e,
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
S,
|
|
3810
|
-
T,
|
|
3982
|
+
m,
|
|
3983
|
+
E,
|
|
3811
3984
|
I,
|
|
3985
|
+
O,
|
|
3986
|
+
C,
|
|
3812
3987
|
t.useFirstChild,
|
|
3813
|
-
|
|
3988
|
+
S || void 0
|
|
3814
3989
|
]), !0;
|
|
3815
3990
|
}
|
|
3816
3991
|
return !1;
|
|
3817
3992
|
});
|
|
3818
|
-
}),
|
|
3819
|
-
|
|
3820
|
-
}),
|
|
3993
|
+
}), c.reverse().forEach((f) => {
|
|
3994
|
+
hn(...f);
|
|
3995
|
+
}), Po(e, t, n, s, i);
|
|
3821
3996
|
const u = Object.keys(o?.sequences || {}).length > 0;
|
|
3822
3997
|
return a.length > 0 || u;
|
|
3823
3998
|
}
|
|
3824
|
-
function
|
|
3999
|
+
function Mt(e, t, n, s, i, o, r, a, c) {
|
|
3825
4000
|
let u;
|
|
3826
|
-
if (
|
|
3827
|
-
const
|
|
4001
|
+
if (Wt(i)) {
|
|
4002
|
+
const l = {
|
|
3828
4003
|
key: e,
|
|
3829
4004
|
effectId: i.effectId,
|
|
3830
4005
|
transition: i.transition,
|
|
3831
4006
|
transitionProperties: i.transitionProperties,
|
|
3832
|
-
childSelector:
|
|
4007
|
+
childSelector: j(i, {
|
|
3833
4008
|
asCombinator: !0,
|
|
3834
4009
|
addItemFilter: !0,
|
|
3835
4010
|
useFirstChild: a
|
|
@@ -3838,87 +4013,106 @@ function Et(e, t, n, s, i, o, r, a, l) {
|
|
|
3838
4013
|
};
|
|
3839
4014
|
if (u = w.getController(e), !u)
|
|
3840
4015
|
return;
|
|
3841
|
-
u.renderStyle(
|
|
4016
|
+
u.renderStyle(Is(l));
|
|
3842
4017
|
}
|
|
3843
|
-
let
|
|
4018
|
+
let f;
|
|
3844
4019
|
if (n === "animationEnd") {
|
|
3845
|
-
const
|
|
3846
|
-
id: `${
|
|
3847
|
-
key:
|
|
4020
|
+
const l = o.effectId, d = c ? w.getInstance(c) : void 0, h = d?.dataCache.effects[l], p = h && ke(h, d, {
|
|
4021
|
+
id: `${c}::animationEnd::${l}`,
|
|
4022
|
+
key: c,
|
|
3848
4023
|
onUpdate: () => {
|
|
3849
|
-
w.getController(
|
|
4024
|
+
w.getController(c)?.update();
|
|
3850
4025
|
}
|
|
3851
4026
|
});
|
|
3852
|
-
p && (
|
|
4027
|
+
p && (f = x(p));
|
|
3853
4028
|
}
|
|
3854
|
-
|
|
4029
|
+
D[n]?.add(t, s, i, o, {
|
|
3855
4030
|
targetController: u,
|
|
3856
4031
|
selectorCondition: r,
|
|
3857
4032
|
allowA11yTriggers: w.allowA11yTriggers,
|
|
3858
|
-
sourceAnimationOptions:
|
|
4033
|
+
sourceAnimationOptions: f
|
|
3859
4034
|
});
|
|
3860
4035
|
}
|
|
3861
|
-
function
|
|
4036
|
+
function Ot(e) {
|
|
3862
4037
|
const t = e.key, n = w.getInstance(t);
|
|
3863
4038
|
if (!n)
|
|
3864
|
-
return
|
|
4039
|
+
return w.setController(t, e), !1;
|
|
3865
4040
|
const { triggers: s = [] } = n?.get(t) || {}, i = s.length > 0;
|
|
3866
|
-
n.setController(t, e), s.forEach((r, a) => {
|
|
3867
|
-
const
|
|
3868
|
-
if (
|
|
4041
|
+
n.setController(t, e), Te.set(e, (Te.get(e) || 0) + 1), bo(e), s.forEach((r, a) => {
|
|
4042
|
+
const c = H(r.conditions, n.dataCache.conditions);
|
|
4043
|
+
if (c) {
|
|
3869
4044
|
const u = `${t}::trigger::${a}`;
|
|
3870
|
-
n.setupMediaQueryListener(u,
|
|
4045
|
+
n.setupMediaQueryListener(u, c, t, () => {
|
|
3871
4046
|
e.update();
|
|
3872
4047
|
});
|
|
3873
4048
|
}
|
|
3874
|
-
if (!
|
|
3875
|
-
|
|
4049
|
+
if (!c || c.matches) {
|
|
4050
|
+
const u = K(
|
|
4051
|
+
e,
|
|
4052
|
+
e.element,
|
|
4053
|
+
r,
|
|
4054
|
+
t,
|
|
4055
|
+
"interaction"
|
|
4056
|
+
);
|
|
4057
|
+
if (u !== !0) {
|
|
4058
|
+
X(u, e, r, e, !1);
|
|
3876
4059
|
return;
|
|
3877
|
-
|
|
4060
|
+
}
|
|
4061
|
+
r.listContainer && e.watchChildList(r.listContainer), rt(t, e, n, r);
|
|
3878
4062
|
}
|
|
3879
4063
|
});
|
|
3880
4064
|
let o = !1;
|
|
3881
|
-
return n && (o =
|
|
4065
|
+
return n && (o = $n(t, e, n)), i || o;
|
|
3882
4066
|
}
|
|
3883
|
-
function
|
|
4067
|
+
function Co(e, t, n) {
|
|
3884
4068
|
const s = e.key, i = w.getInstance(s);
|
|
3885
4069
|
if (i) {
|
|
3886
4070
|
const { triggers: o = [] } = i?.get(s) || {};
|
|
3887
4071
|
o.forEach((r, a) => {
|
|
3888
4072
|
if (r.listContainer !== t)
|
|
3889
4073
|
return;
|
|
3890
|
-
const
|
|
3891
|
-
if (
|
|
4074
|
+
const c = H(r.conditions, i.dataCache.conditions);
|
|
4075
|
+
if (c) {
|
|
3892
4076
|
const u = `${s}::listTrigger::${t}::${a}`;
|
|
3893
|
-
i.setupMediaQueryListener(u,
|
|
4077
|
+
i.setupMediaQueryListener(u, c, s, () => {
|
|
3894
4078
|
e.update();
|
|
3895
4079
|
});
|
|
3896
4080
|
}
|
|
3897
|
-
if (!
|
|
3898
|
-
|
|
4081
|
+
if (!c || c.matches) {
|
|
4082
|
+
const u = K(
|
|
4083
|
+
e,
|
|
4084
|
+
e.element,
|
|
4085
|
+
r,
|
|
4086
|
+
s,
|
|
4087
|
+
"interaction",
|
|
4088
|
+
!1
|
|
4089
|
+
);
|
|
4090
|
+
if (u !== !0) {
|
|
4091
|
+
X(u, e, r, e, !1);
|
|
3899
4092
|
return;
|
|
3900
|
-
|
|
4093
|
+
}
|
|
4094
|
+
rt(s, e, i, r, n);
|
|
3901
4095
|
}
|
|
3902
|
-
}),
|
|
4096
|
+
}), $n(s, e, i, t, n);
|
|
3903
4097
|
}
|
|
3904
4098
|
}
|
|
3905
|
-
function
|
|
4099
|
+
function Ao(e, t = !1) {
|
|
3906
4100
|
const n = e.key, s = w.getInstance(n);
|
|
3907
4101
|
if (!s)
|
|
3908
4102
|
return;
|
|
3909
4103
|
const i = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
|
|
3910
4104
|
let o;
|
|
3911
|
-
i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element],
|
|
4105
|
+
i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element], Sn(o), s.deleteController(n, t);
|
|
3912
4106
|
}
|
|
3913
|
-
function
|
|
3914
|
-
const t = Object.values(
|
|
4107
|
+
function Sn(e) {
|
|
4108
|
+
const t = Object.values(D);
|
|
3915
4109
|
for (const n of e)
|
|
3916
4110
|
for (const s of t)
|
|
3917
4111
|
s.remove(n);
|
|
3918
4112
|
w.removeFromSequences(e);
|
|
3919
4113
|
}
|
|
3920
|
-
const
|
|
3921
|
-
class
|
|
4114
|
+
const Ne = "interactEffect";
|
|
4115
|
+
class ko {
|
|
3922
4116
|
element;
|
|
3923
4117
|
key;
|
|
3924
4118
|
connected;
|
|
@@ -3927,8 +4121,10 @@ class lo {
|
|
|
3927
4121
|
_observers;
|
|
3928
4122
|
_pluginCleanups;
|
|
3929
4123
|
_appliedPlugins;
|
|
4124
|
+
_connectId;
|
|
4125
|
+
_latches;
|
|
3930
4126
|
constructor(t, n, s) {
|
|
3931
|
-
this.element = t, this.key = n, this.connected = !1, this.sheet = null, this._observers = /* @__PURE__ */ new WeakMap(), this._pluginCleanups = [], this._appliedPlugins = /* @__PURE__ */ new
|
|
4127
|
+
this.element = t, this.key = n, this.connected = !1, this.sheet = null, this._observers = /* @__PURE__ */ new WeakMap(), this._pluginCleanups = [], this._appliedPlugins = /* @__PURE__ */ new WeakMap(), this._connectId = 0, this._latches = [], this.useFirstChild = s?.useFirstChild ?? !1;
|
|
3932
4128
|
}
|
|
3933
4129
|
connect(t) {
|
|
3934
4130
|
if (this.connected)
|
|
@@ -3940,10 +4136,13 @@ class lo {
|
|
|
3940
4136
|
}
|
|
3941
4137
|
n !== t && (n && console.warn(
|
|
3942
4138
|
`Interact: Key mismatch between element ${n} and parameter ${t}, updating element key`
|
|
3943
|
-
), this.element.dataset.interactKey = t), this.key = t, this.connected =
|
|
4139
|
+
), this.element.dataset.interactKey = t), this.key = t, this.connected = Ot(this);
|
|
3944
4140
|
}
|
|
3945
4141
|
disconnect({ removeFromCache: t = !1 } = {}) {
|
|
3946
|
-
|
|
4142
|
+
this._connectId++, (this.key || this.element.dataset.interactKey) && Ao(this, t);
|
|
4143
|
+
for (const { release: s } of this._latches)
|
|
4144
|
+
s();
|
|
4145
|
+
if (this._latches.length = 0, this._pluginCleanups.length) {
|
|
3947
4146
|
for (const s of this._pluginCleanups)
|
|
3948
4147
|
try {
|
|
3949
4148
|
s();
|
|
@@ -3952,7 +4151,7 @@ class lo {
|
|
|
3952
4151
|
}
|
|
3953
4152
|
this._pluginCleanups.length = 0;
|
|
3954
4153
|
}
|
|
3955
|
-
if (this._appliedPlugins = /* @__PURE__ */ new
|
|
4154
|
+
if (this._appliedPlugins = /* @__PURE__ */ new WeakMap(), this.sheet) {
|
|
3956
4155
|
const s = this.element?.getRootNode(), i = s.host ? s : document;
|
|
3957
4156
|
i.adoptedStyleSheets.indexOf(this.sheet) !== -1 && (i.adoptedStyleSheets = i.adoptedStyleSheets.filter(
|
|
3958
4157
|
(r) => r !== this.sheet
|
|
@@ -3964,7 +4163,7 @@ class lo {
|
|
|
3964
4163
|
this.disconnect(), this.connect();
|
|
3965
4164
|
}
|
|
3966
4165
|
resume() {
|
|
3967
|
-
this.connected &&
|
|
4166
|
+
this.connected && Ot(this);
|
|
3968
4167
|
}
|
|
3969
4168
|
renderStyle(t) {
|
|
3970
4169
|
const n = this.element?.getRootNode(), s = n.host ? n : document;
|
|
@@ -3989,12 +4188,12 @@ class lo {
|
|
|
3989
4188
|
return;
|
|
3990
4189
|
}
|
|
3991
4190
|
const o = new Set(
|
|
3992
|
-
this.element.dataset[
|
|
4191
|
+
this.element.dataset[Ne]?.split(" ") || []
|
|
3993
4192
|
);
|
|
3994
|
-
n === "toggle" ? o.has(t) ? o.delete(t) : o.add(t) : n === "add" ? o.add(t) : n === "remove" ? o.delete(t) : n === "clear" && o.clear(), (s || this.element).dataset[
|
|
4193
|
+
n === "toggle" ? o.has(t) ? o.delete(t) : o.add(t) : n === "add" ? o.add(t) : n === "remove" ? o.delete(t) : n === "clear" && o.clear(), (s || this.element).dataset[Ne] = Array.from(o).join(" ");
|
|
3995
4194
|
}
|
|
3996
4195
|
getActiveEffects() {
|
|
3997
|
-
const n = (this.element.dataset[
|
|
4196
|
+
const n = (this.element.dataset[Ne] || "").trim();
|
|
3998
4197
|
return n ? n.split(/\s+/) : [];
|
|
3999
4198
|
}
|
|
4000
4199
|
watchChildList(t) {
|
|
@@ -4012,21 +4211,21 @@ class lo {
|
|
|
4012
4211
|
}), r.addedNodes.forEach((a) => {
|
|
4013
4212
|
a instanceof HTMLElement && o.push(a);
|
|
4014
4213
|
});
|
|
4015
|
-
}),
|
|
4214
|
+
}), Sn(i), s && Co(this, t, o);
|
|
4016
4215
|
}
|
|
4017
4216
|
}
|
|
4018
|
-
function
|
|
4019
|
-
new
|
|
4217
|
+
function Ro(e, t) {
|
|
4218
|
+
new ko(e, t).connect();
|
|
4020
4219
|
}
|
|
4021
|
-
function
|
|
4220
|
+
function Lo(e) {
|
|
4022
4221
|
const t = w.getController(e);
|
|
4023
4222
|
t && t.disconnect({ removeFromCache: !0 });
|
|
4024
4223
|
}
|
|
4025
4224
|
export {
|
|
4026
|
-
|
|
4225
|
+
ko as I,
|
|
4027
4226
|
w as a,
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4227
|
+
Ro as b,
|
|
4228
|
+
qo as g,
|
|
4229
|
+
Lo as r
|
|
4031
4230
|
};
|
|
4032
|
-
//# sourceMappingURL=index-
|
|
4231
|
+
//# sourceMappingURL=index-DSREj0qw.mjs.map
|