@wix/interact 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-BcRbaJX2.mjs → index-76zNBcNy.mjs} +1145 -1091
- package/dist/index-76zNBcNy.mjs.map +1 -0
- package/dist/index-BMJFenGC.js +29 -0
- package/dist/index-BMJFenGC.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/core/Interact.d.ts +14 -2
- package/dist/types/core/Interact.d.ts.map +1 -1
- package/dist/types/core/InteractionController.d.ts +1 -0
- package/dist/types/core/InteractionController.d.ts.map +1 -1
- package/dist/types/core/add.d.ts.map +1 -1
- package/dist/types/types/controller.d.ts +5 -0
- package/dist/types/types/controller.d.ts.map +1 -1
- package/dist/types/types/external.d.ts +1 -1
- package/dist/types/types/external.d.ts.map +1 -1
- package/dist/types/types/plugins.d.ts +10 -0
- package/dist/types/types/plugins.d.ts.map +1 -1
- package/docs/api/interact-class.md +28 -2
- package/docs/api/types.md +12 -0
- package/docs/guides/plugins.md +36 -1
- package/package.json +1 -1
- package/rules/full-lean.md +3 -1
- package/rules/plugins.md +19 -1
- package/dist/index-BcRbaJX2.mjs.map +0 -1
- package/dist/index-sqvrGHLA.js +0 -29
- package/dist/index-sqvrGHLA.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Xt(e) {
|
|
2
2
|
return [...e.matchAll(/\[([^\]]+)]/g)].map(([t, n]) => n);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
const n =
|
|
4
|
+
function k(e, t) {
|
|
5
|
+
const n = Xt(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
|
|
13
|
-
return e.trigger === "viewEnter" && t.triggerType === "once" &&
|
|
12
|
+
function Zt(e, t) {
|
|
13
|
+
return e.trigger === "viewEnter" && t.triggerType === "once" && V(e) === V(t);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function V(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 He = "$";
|
|
20
|
+
class se {
|
|
21
21
|
animations;
|
|
22
22
|
options;
|
|
23
23
|
ready;
|
|
@@ -121,64 +121,64 @@ class ne {
|
|
|
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), c = 1 - 3 * s + 3 * t, l = 3 * n,
|
|
152
|
-
let
|
|
124
|
+
const ut = (e) => e, Jt = (e) => 1 - Math.cos(e * Math.PI / 2), en = (e) => Math.sin(e * Math.PI / 2), tn = (e) => -(Math.cos(Math.PI * e) - 1) / 2, nn = (e) => e ** 2, sn = (e) => 1 - (1 - e) ** 2, on = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, rn = (e) => e ** 3, an = (e) => 1 - (1 - e) ** 3, cn = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, ln = (e) => e ** 4, fn = (e) => 1 - (1 - e) ** 4, un = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, dn = (e) => e ** 5, hn = (e) => 1 - (1 - e) ** 5, mn = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, pn = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), gn = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), vn = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, yn = (e) => 1 - Math.sqrt(1 - e ** 2), En = (e) => Math.sqrt(1 - (e - 1) ** 2), wn = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, $n = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, bn = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, Sn = (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, Ye = {
|
|
125
|
+
linear: ut,
|
|
126
|
+
sineIn: Jt,
|
|
127
|
+
sineOut: en,
|
|
128
|
+
sineInOut: tn,
|
|
129
|
+
quadIn: nn,
|
|
130
|
+
quadOut: sn,
|
|
131
|
+
quadInOut: on,
|
|
132
|
+
cubicIn: rn,
|
|
133
|
+
cubicOut: an,
|
|
134
|
+
cubicInOut: cn,
|
|
135
|
+
quartIn: ln,
|
|
136
|
+
quartOut: fn,
|
|
137
|
+
quartInOut: un,
|
|
138
|
+
quintIn: dn,
|
|
139
|
+
quintOut: hn,
|
|
140
|
+
quintInOut: mn,
|
|
141
|
+
expoIn: pn,
|
|
142
|
+
expoOut: gn,
|
|
143
|
+
expoInOut: vn,
|
|
144
|
+
circIn: yn,
|
|
145
|
+
circOut: En,
|
|
146
|
+
circInOut: wn,
|
|
147
|
+
backIn: $n,
|
|
148
|
+
backOut: bn,
|
|
149
|
+
backInOut: Sn
|
|
150
|
+
}, Y = (e, t, n, s, i) => {
|
|
151
|
+
const o = 3 * t, r = 3 * (s - 2 * t), c = 1 - 3 * s + 3 * t, l = 3 * n, f = 3 * (i - 2 * n), a = 1 - 3 * i + 3 * n;
|
|
152
|
+
let u;
|
|
153
153
|
if (c === 0)
|
|
154
|
-
|
|
154
|
+
u = r === 0 ? `(${e} / ${o})` : `((sqrt(max(0, ${o * o} + ${4 * r} * ${e})) - ${o}) / ${2 * r})`;
|
|
155
155
|
else {
|
|
156
|
-
const d = r / (3 * c), h = 2 * Math.pow(r, 3) - 9 * o * r * c,
|
|
157
|
-
if (
|
|
158
|
-
const E = 2 * Math.sqrt(-
|
|
156
|
+
const d = r / (3 * c), h = 2 * Math.pow(r, 3) - 9 * o * r * c, p = 54 * Math.pow(c, 3), m = (3 * c * o - r * r) / (9 * c * c), g = `((${h} - ${27 * c * c} * ${e}) / ${p})`;
|
|
157
|
+
if (m < 0) {
|
|
158
|
+
const E = 2 * Math.sqrt(-m);
|
|
159
159
|
let y = 0;
|
|
160
|
-
for (const
|
|
160
|
+
for (const $ of [0, 1, 2])
|
|
161
161
|
[0, 0.25, 0.5, 0.75, 1].every((S) => {
|
|
162
162
|
const I = Math.min(
|
|
163
|
-
Math.max(2 * (h - 27 * c * c * S) / (
|
|
163
|
+
Math.max(2 * (h - 27 * c * c * S) / (p * m * E), -1),
|
|
164
164
|
1
|
|
165
|
-
), O = E * Math.cos((Math.acos(I) -
|
|
165
|
+
), O = E * Math.cos((Math.acos(I) - $ * 2 * Math.PI) / 3) - d;
|
|
166
166
|
return O >= -1e-6 && O <= 1.000001;
|
|
167
|
-
}) && (y =
|
|
168
|
-
const v = `(acos(clamp(-1, ${2 / (
|
|
169
|
-
|
|
167
|
+
}) && (y = $);
|
|
168
|
+
const v = `(acos(clamp(-1, ${2 / (m * E)} * ${g}, 1)) - ${360 * y}deg) / 3`;
|
|
169
|
+
u = `(${E} * cos(${v}) - ${d})`;
|
|
170
170
|
} else {
|
|
171
|
-
const E = `sqrt(pow(${g}, 2) + ${Math.pow(
|
|
172
|
-
|
|
171
|
+
const E = `sqrt(pow(${g}, 2) + ${Math.pow(m, 3)})`;
|
|
172
|
+
u = `(pow(${E} - ${g}, 1 / 3) - pow(${E} + ${g}, 1 / 3) - ${d})`;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
return `(${a} * pow(${
|
|
176
|
-
},
|
|
175
|
+
return `(${a} * pow(${u}, 3) + ${f} * pow(${u}, 2) + ${l} * ${u})`;
|
|
176
|
+
}, Be = {
|
|
177
177
|
linear: (e) => e,
|
|
178
|
-
ease: (e) =>
|
|
179
|
-
easeIn: (e) =>
|
|
180
|
-
easeOut: (e) =>
|
|
181
|
-
easeInOut: (e) =>
|
|
178
|
+
ease: (e) => Y(e, 0.25, 0.1, 0.25, 1),
|
|
179
|
+
easeIn: (e) => Y(e, 0.42, 0, 1, 1),
|
|
180
|
+
easeOut: (e) => Y(e, 0, 0, 0.58, 1),
|
|
181
|
+
easeInOut: (e) => Y(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 lt = (e) => e, Xt = (e) => 1 - Math.cos(e * Math.PI / 2), Zt = (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
|
+
}, Ue = {
|
|
207
207
|
linear: "linear",
|
|
208
208
|
ease: "ease",
|
|
209
209
|
easeIn: "ease-in",
|
|
@@ -234,68 +234,68 @@ const lt = (e) => e, Xt = (e) => 1 - Math.cos(e * Math.PI / 2), Zt = (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 In(e) {
|
|
238
238
|
return e === "percentage" ? "%" : e || "px";
|
|
239
239
|
}
|
|
240
|
-
const
|
|
240
|
+
const Tn = /^(webkit|moz|ms|o)(?=[A-Z])/, Cn = 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 ve(e) {
|
|
246
|
+
return e.startsWith("--") ? e : (Tn.test(e) ? `-${e}` : e).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function On(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 dt(e) {
|
|
252
|
+
return Cn[e] || On(e);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function _n(e) {
|
|
255
255
|
for (const t in e)
|
|
256
|
-
if (Object.hasOwn(e, t) &&
|
|
256
|
+
if (Object.hasOwn(e, t) && dt(t) !== t)
|
|
257
257
|
return !0;
|
|
258
258
|
return !1;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function ht(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" || !_n(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[dt(o)] = n[o]);
|
|
271
271
|
t[s] = i;
|
|
272
272
|
}), t || e;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
return e ?
|
|
274
|
+
function he(e) {
|
|
275
|
+
return e ? Ue[e] || e : Ue.linear;
|
|
276
276
|
}
|
|
277
|
-
function
|
|
278
|
-
const i = 3 * e, o = 3 * (n - e) - i, r = 1 - i - o, c = 3 * t, l = 3 * (s - t) - c,
|
|
279
|
-
function h(
|
|
280
|
-
let
|
|
277
|
+
function An(e, t, n, s) {
|
|
278
|
+
const i = 3 * e, o = 3 * (n - e) - i, r = 1 - i - o, c = 3 * t, l = 3 * (s - t) - c, f = 1 - c - l, a = (p) => ((r * p + o) * p + i) * p, u = (p) => ((f * p + l) * p + c) * 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 v = a(
|
|
283
|
-
if (Math.abs(v) < 1e-7) return
|
|
284
|
-
const
|
|
285
|
-
if (Math.abs(
|
|
286
|
-
|
|
282
|
+
const v = a(m) - p;
|
|
283
|
+
if (Math.abs(v) < 1e-7) return m;
|
|
284
|
+
const $ = d(m);
|
|
285
|
+
if (Math.abs($) < 1e-6) break;
|
|
286
|
+
m -= v / $;
|
|
287
287
|
}
|
|
288
288
|
let g = 0, E = 1;
|
|
289
|
-
for (
|
|
290
|
-
const y = a(
|
|
291
|
-
if (Math.abs(y -
|
|
292
|
-
|
|
289
|
+
for (m = (g + E) / 2; E - g > 1e-7; ) {
|
|
290
|
+
const y = a(m);
|
|
291
|
+
if (Math.abs(y - p) < 1e-7) return m;
|
|
292
|
+
p > y ? g = m : E = m, m = (g + E) / 2;
|
|
293
293
|
}
|
|
294
|
-
return
|
|
294
|
+
return m;
|
|
295
295
|
}
|
|
296
|
-
return (
|
|
296
|
+
return (p) => p <= 0 ? 0 : p >= 1 ? 1 : u(h(p));
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function mt(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 dt(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 Mn(e) {
|
|
308
|
+
const t = mt(e);
|
|
309
309
|
if (!(!t || t.some(isNaN)))
|
|
310
|
-
return
|
|
310
|
+
return An(...t);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
const t =
|
|
312
|
+
function kn(e) {
|
|
313
|
+
const t = mt(e);
|
|
314
314
|
if (!(!t || t.some(isNaN)))
|
|
315
|
-
return (n) =>
|
|
315
|
+
return (n) => Y(n, ...t);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function pt(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);
|
|
@@ -324,9 +324,9 @@ function ht(e) {
|
|
|
324
324
|
const r = o.split(/\s+/), c = parseFloat(r[0]);
|
|
325
325
|
if (isNaN(c)) return;
|
|
326
326
|
const l = [];
|
|
327
|
-
for (let
|
|
328
|
-
if (r[
|
|
329
|
-
const a = parseFloat(r[
|
|
327
|
+
for (let f = 1; f < r.length; f++)
|
|
328
|
+
if (r[f].endsWith("%")) {
|
|
329
|
+
const a = parseFloat(r[f]) / 100;
|
|
330
330
|
if (isNaN(a)) return;
|
|
331
331
|
l.push(a);
|
|
332
332
|
}
|
|
@@ -340,9 +340,9 @@ function ht(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 c = s[o].pos, l = s[r].pos,
|
|
343
|
+
const c = s[o].pos, l = s[r].pos, f = r - o;
|
|
344
344
|
for (let a = o + 1; a < r; a++)
|
|
345
|
-
s[a].pos = c + (l - c) * (a - o) /
|
|
345
|
+
s[a].pos = c + (l - c) * (a - o) / f;
|
|
346
346
|
i = r + 1;
|
|
347
347
|
} else
|
|
348
348
|
i++;
|
|
@@ -350,8 +350,8 @@ function ht(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 qn(e) {
|
|
354
|
+
const t = pt(e);
|
|
355
355
|
if (t)
|
|
356
356
|
return (n) => {
|
|
357
357
|
if (n <= t[0].pos) return t[0].output;
|
|
@@ -366,8 +366,8 @@ function Mn(e) {
|
|
|
366
366
|
return c.pos === r.pos ? c.output : r.output + (c.output - r.output) * (n - r.pos) / (c.pos - r.pos);
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
const t =
|
|
369
|
+
function Pn(e) {
|
|
370
|
+
const t = pt(e);
|
|
371
371
|
if (t)
|
|
372
372
|
return (n) => {
|
|
373
373
|
const s = [`${t[0].output}`];
|
|
@@ -383,17 +383,17 @@ function kn(e) {
|
|
|
383
383
|
return `(${s.join(" + ")})`;
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function Ge(e) {
|
|
387
387
|
if (!e) return;
|
|
388
|
-
const t =
|
|
389
|
-
return t || (
|
|
388
|
+
const t = Ye[e];
|
|
389
|
+
return t || (Mn(e) ?? qn(e) ?? Ye.linear);
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function Ln(e) {
|
|
392
392
|
if (!e) return;
|
|
393
|
-
const t =
|
|
394
|
-
return t || (
|
|
393
|
+
const t = Be[e];
|
|
394
|
+
return t || (kn(e) ?? Pn(e) ?? Be.linear);
|
|
395
395
|
}
|
|
396
|
-
class
|
|
396
|
+
class Fn extends se {
|
|
397
397
|
animationGroups;
|
|
398
398
|
delay;
|
|
399
399
|
offset;
|
|
@@ -402,7 +402,7 @@ class Pn extends ne {
|
|
|
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 : Ge(n.offsetEasing) ?? ut, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: o, duration: r, iterations: c }) => ({
|
|
406
406
|
delay: o,
|
|
407
407
|
duration: Number.isFinite(r) ? r : 0,
|
|
408
408
|
iterations: Number.isFinite(c) ? c : 1
|
|
@@ -430,10 +430,10 @@ class Pn extends ne {
|
|
|
430
430
|
i.animations.forEach((r, c) => {
|
|
431
431
|
const l = r.effect;
|
|
432
432
|
if (!l) return;
|
|
433
|
-
const { delay:
|
|
433
|
+
const { delay: f, duration: a, iterations: u } = this.timingOptions[o][c], d = f + t[o], h = n - (d + a * u);
|
|
434
434
|
if (i.isCSS && this.sequenceId) {
|
|
435
|
-
const { target:
|
|
436
|
-
|
|
435
|
+
const { target: p } = l;
|
|
436
|
+
p instanceof HTMLElement && (p.style.setProperty(`--motion-${this.sequenceId}-index`, `${o}`), p.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)), l.updateTiming({ endDelay: h });
|
|
437
437
|
} else
|
|
438
438
|
l.updateTiming({ delay: d + this.delay, endDelay: h });
|
|
439
439
|
});
|
|
@@ -444,8 +444,8 @@ class Pn extends ne {
|
|
|
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: c, duration: l, iterations:
|
|
448
|
-
return Math.max(o, c + l *
|
|
447
|
+
const { delay: c, duration: l, iterations: f } = r;
|
|
448
|
+
return Math.max(o, c + l * f);
|
|
449
449
|
}, 0);
|
|
450
450
|
n.push(t[s] + i);
|
|
451
451
|
}
|
|
@@ -462,7 +462,7 @@ class Pn extends ne {
|
|
|
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], c = this.animationGroups.slice(0, o).reduce((l,
|
|
465
|
+
const r = [...i.animations], c = this.animationGroups.slice(0, o).reduce((l, f) => l + f.animations.length, 0);
|
|
466
466
|
this.animations.splice(c, 0, ...r);
|
|
467
467
|
}
|
|
468
468
|
this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
|
|
@@ -491,7 +491,7 @@ class Pn extends ne {
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
class
|
|
494
|
+
class Rn {
|
|
495
495
|
_animation;
|
|
496
496
|
customEffect;
|
|
497
497
|
progress;
|
|
@@ -631,12 +631,12 @@ class Ln {
|
|
|
631
631
|
return this._animation.dispatchEvent(t);
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function xn(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 me = { exports: {} }, Qe = me.exports, Xe;
|
|
638
|
+
function Nn() {
|
|
639
|
+
return Xe || (Xe = 1, (function(e) {
|
|
640
640
|
(function(t) {
|
|
641
641
|
var n = function() {
|
|
642
642
|
}, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(a) {
|
|
@@ -657,7 +657,7 @@ function Rn() {
|
|
|
657
657
|
* @param {Array} tasks
|
|
658
658
|
*/
|
|
659
659
|
runTasks: function(a) {
|
|
660
|
-
for (var
|
|
660
|
+
for (var u; u = a.shift(); ) u();
|
|
661
661
|
},
|
|
662
662
|
/**
|
|
663
663
|
* Adds a job to the read batch and
|
|
@@ -667,8 +667,8 @@ function Rn() {
|
|
|
667
667
|
* @param {Object} ctx the context to be bound to `fn` (optional).
|
|
668
668
|
* @public
|
|
669
669
|
*/
|
|
670
|
-
measure: function(a,
|
|
671
|
-
var d =
|
|
670
|
+
measure: function(a, u) {
|
|
671
|
+
var d = u ? a.bind(u) : a;
|
|
672
672
|
return this.reads.push(d), o(this), d;
|
|
673
673
|
},
|
|
674
674
|
/**
|
|
@@ -680,8 +680,8 @@ function Rn() {
|
|
|
680
680
|
* @param {Object} ctx the context to be bound to `fn` (optional).
|
|
681
681
|
* @public
|
|
682
682
|
*/
|
|
683
|
-
mutate: function(a,
|
|
684
|
-
var d =
|
|
683
|
+
mutate: function(a, u) {
|
|
684
|
+
var d = u ? a.bind(u) : a;
|
|
685
685
|
return this.writes.push(d), o(this), d;
|
|
686
686
|
},
|
|
687
687
|
/**
|
|
@@ -730,8 +730,8 @@ function Rn() {
|
|
|
730
730
|
*/
|
|
731
731
|
extend: function(a) {
|
|
732
732
|
if (typeof a != "object") throw new Error("expected object");
|
|
733
|
-
var
|
|
734
|
-
return l(
|
|
733
|
+
var u = Object.create(this);
|
|
734
|
+
return l(u, a), u.fastdom = this, u.initialize && u.initialize(), u;
|
|
735
735
|
},
|
|
736
736
|
// override this with a function
|
|
737
737
|
// to prevent Errors in console
|
|
@@ -742,75 +742,75 @@ function Rn() {
|
|
|
742
742
|
a.scheduled || (a.scheduled = !0, a.raf(r.bind(null, a)));
|
|
743
743
|
}
|
|
744
744
|
function r(a) {
|
|
745
|
-
var
|
|
745
|
+
var u = a.writes, d = a.reads, h;
|
|
746
746
|
try {
|
|
747
|
-
n("flushing reads", d.length), a.runTasks(d), n("flushing writes",
|
|
748
|
-
} catch (
|
|
749
|
-
h =
|
|
747
|
+
n("flushing reads", d.length), a.runTasks(d), n("flushing writes", u.length), a.runTasks(u);
|
|
748
|
+
} catch (p) {
|
|
749
|
+
h = p;
|
|
750
750
|
}
|
|
751
|
-
if (a.scheduled = !1, (d.length ||
|
|
751
|
+
if (a.scheduled = !1, (d.length || u.length) && o(a), h)
|
|
752
752
|
if (n("task errored", h.message), a.catch) a.catch(h);
|
|
753
753
|
else throw h;
|
|
754
754
|
}
|
|
755
|
-
function c(a,
|
|
756
|
-
var d = a.indexOf(
|
|
755
|
+
function c(a, u) {
|
|
756
|
+
var d = a.indexOf(u);
|
|
757
757
|
return !!~d && !!a.splice(d, 1);
|
|
758
758
|
}
|
|
759
|
-
function l(a,
|
|
760
|
-
for (var d in
|
|
761
|
-
|
|
759
|
+
function l(a, u) {
|
|
760
|
+
for (var d in u)
|
|
761
|
+
u.hasOwnProperty(d) && (a[d] = u[d]);
|
|
762
762
|
}
|
|
763
|
-
var
|
|
764
|
-
e.exports =
|
|
765
|
-
})(typeof window < "u" ? window : typeof
|
|
766
|
-
})(
|
|
767
|
-
}
|
|
768
|
-
var
|
|
769
|
-
const A = /* @__PURE__ */
|
|
770
|
-
function
|
|
771
|
-
Object.assign(
|
|
772
|
-
}
|
|
773
|
-
function
|
|
774
|
-
return e in
|
|
763
|
+
var f = t.fastdom = t.fastdom || new i();
|
|
764
|
+
e.exports = f;
|
|
765
|
+
})(typeof window < "u" ? window : typeof Qe < "u" ? Qe : globalThis);
|
|
766
|
+
})(me)), me.exports;
|
|
767
|
+
}
|
|
768
|
+
var jn = Nn();
|
|
769
|
+
const A = /* @__PURE__ */ xn(jn), ke = {};
|
|
770
|
+
function Dn(e) {
|
|
771
|
+
Object.assign(ke, e);
|
|
772
|
+
}
|
|
773
|
+
function We(e, t = !0) {
|
|
774
|
+
return e in ke ? ke[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
|
-
function
|
|
778
|
+
function K(e, t) {
|
|
779
779
|
return e ? (t || document).getElementById(e) : null;
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function gt(e, t) {
|
|
782
782
|
return e?.matches(`[data-motion-part~="${t}"]`) ? e : e?.querySelector(`[data-motion-part~="${t}"]`);
|
|
783
783
|
}
|
|
784
|
-
function
|
|
785
|
-
const n = typeof e == "string" ?
|
|
786
|
-
return t?.length ? t.map((s) =>
|
|
784
|
+
function vt(e, t) {
|
|
785
|
+
const n = typeof e == "string" ? K(e) : e;
|
|
786
|
+
return t?.length ? t.map((s) => gt(n, s)).filter(Boolean) : n ? [n] : [];
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function zn(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 Oe(e) {
|
|
793
|
+
return `${e.value}${In(e.unit)}`;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${
|
|
795
|
+
function Ze(e, t, n) {
|
|
796
|
+
return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${Oe(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${Oe(e.offset)} + ${t})` : Oe(e.offset)}`;
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function yt(e) {
|
|
799
799
|
return {
|
|
800
|
-
start:
|
|
801
|
-
end:
|
|
800
|
+
start: Ze(e.startOffset, e.startOffsetAdd),
|
|
801
|
+
end: Ze(e.endOffset, e.endOffsetAdd, !0)
|
|
802
802
|
};
|
|
803
803
|
}
|
|
804
|
-
function
|
|
804
|
+
function Et(e) {
|
|
805
805
|
return (t) => A.measure(() => t(e));
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function wt(e) {
|
|
808
808
|
return (t) => A.mutate(() => t(e));
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function ee(e) {
|
|
811
811
|
if (e.namedEffect) {
|
|
812
812
|
const t = e.namedEffect.type;
|
|
813
|
-
return typeof t == "string" ?
|
|
813
|
+
return typeof t == "string" ? We(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 J(e) {
|
|
|
824
824
|
return (t) => [{ ...t, keyframes: [] }];
|
|
825
825
|
return null;
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function $t(e, t, n, s) {
|
|
828
828
|
return e.map((i, o) => {
|
|
829
829
|
const r = {
|
|
830
830
|
fill: i.fill,
|
|
831
|
-
easing:
|
|
831
|
+
easing: he(i.easing),
|
|
832
832
|
iterations: i.iterations === 0 ? 1 / 0 : i.iterations || 1,
|
|
833
833
|
composite: i.composite,
|
|
834
|
-
direction:
|
|
834
|
+
direction: zn(i)
|
|
835
835
|
};
|
|
836
|
-
return
|
|
836
|
+
return Ve(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,41 +843,41 @@ function Et(e, t, n, s) {
|
|
|
843
843
|
};
|
|
844
844
|
});
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function Ve(e) {
|
|
847
847
|
return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function Je(e, t, n, s, i) {
|
|
850
850
|
if (e) {
|
|
851
|
-
if (
|
|
851
|
+
if (Ve(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: Et(n), mutate: wt(n) }), e.web ? e.web(t, o, i) : e(t, o, i);
|
|
858
858
|
}
|
|
859
859
|
return [];
|
|
860
860
|
}
|
|
861
|
-
function
|
|
862
|
-
const o = typeof e == "string" ?
|
|
861
|
+
function bt(e, t, n, s, i) {
|
|
862
|
+
const o = typeof e == "string" ? K(e, i) : e;
|
|
863
863
|
if (n?.trigger === "pointer-move" && !t.keyframeEffect) {
|
|
864
864
|
let d = t;
|
|
865
865
|
t.customEffect && (d = {
|
|
866
866
|
...t,
|
|
867
867
|
namedEffect: { id: "", type: "CustomMouse" }
|
|
868
868
|
});
|
|
869
|
-
const h =
|
|
869
|
+
const h = ee(
|
|
870
870
|
d
|
|
871
|
-
),
|
|
871
|
+
), p = Je(
|
|
872
872
|
h,
|
|
873
873
|
t,
|
|
874
874
|
o,
|
|
875
875
|
n,
|
|
876
876
|
s
|
|
877
877
|
);
|
|
878
|
-
return typeof
|
|
878
|
+
return typeof p != "function" ? null : p(o);
|
|
879
879
|
}
|
|
880
|
-
const r =
|
|
880
|
+
const r = ee(t), c = Je(
|
|
881
881
|
r,
|
|
882
882
|
t,
|
|
883
883
|
o,
|
|
@@ -886,33 +886,33 @@ function wt(e, t, n, s, i) {
|
|
|
886
886
|
);
|
|
887
887
|
if (!c || c.length === 0)
|
|
888
888
|
return null;
|
|
889
|
-
const l =
|
|
890
|
-
let
|
|
889
|
+
const l = $t(c, n, t.effectId);
|
|
890
|
+
let f;
|
|
891
891
|
const a = n?.trigger === "view-progress";
|
|
892
|
-
a && window.ViewTimeline && (
|
|
893
|
-
subject: n.element ||
|
|
892
|
+
a && window.ViewTimeline && (f = new ViewTimeline({
|
|
893
|
+
subject: n.element || K(n.componentId)
|
|
894
894
|
}));
|
|
895
|
-
const
|
|
896
|
-
const g =
|
|
895
|
+
const u = l.map(({ effect: d, options: h, id: p, part: m }) => {
|
|
896
|
+
const g = m ? gt(o, m) : o, E = new KeyframeEffect(g || null, [], h);
|
|
897
897
|
A.mutate(() => {
|
|
898
|
-
"timing" in d && E.updateTiming(d.timing), E.setKeyframes(
|
|
898
|
+
"timing" in d && E.updateTiming(d.timing), E.setKeyframes(ht(d.keyframes));
|
|
899
899
|
});
|
|
900
|
-
const y = a &&
|
|
900
|
+
const y = a && f ? { timeline: f } : {}, v = typeof d.customEffect == "function" ? new Rn(
|
|
901
901
|
d.customEffect,
|
|
902
902
|
g || null,
|
|
903
903
|
h,
|
|
904
904
|
y
|
|
905
905
|
) : new Animation(E, y.timeline);
|
|
906
906
|
if (a)
|
|
907
|
-
if (
|
|
907
|
+
if (f)
|
|
908
908
|
A.mutate(() => {
|
|
909
|
-
const { start:
|
|
910
|
-
v.rangeStart =
|
|
909
|
+
const { start: $, end: b } = yt(d);
|
|
910
|
+
v.rangeStart = $, v.rangeEnd = b, v.play();
|
|
911
911
|
});
|
|
912
912
|
else {
|
|
913
|
-
const { startOffset:
|
|
913
|
+
const { startOffset: $, endOffset: b } = t;
|
|
914
914
|
A.mutate(() => {
|
|
915
|
-
const S = d.startOffset ||
|
|
915
|
+
const S = d.startOffset || $, I = d.endOffset || b;
|
|
916
916
|
Object.assign(v, {
|
|
917
917
|
start: {
|
|
918
918
|
name: S.name,
|
|
@@ -927,149 +927,149 @@ function wt(e, t, n, s, i) {
|
|
|
927
927
|
});
|
|
928
928
|
});
|
|
929
929
|
}
|
|
930
|
-
return
|
|
930
|
+
return p && (v.id = p), v;
|
|
931
931
|
});
|
|
932
|
-
return
|
|
932
|
+
return u.length > 1 && u.forEach((d) => d.persist?.()), new se(u, {
|
|
933
933
|
...t,
|
|
934
934
|
trigger: { ...n || {} },
|
|
935
935
|
// make sure the group is ready after all animation targets are measured and mutated
|
|
936
936
|
measured: new Promise((d) => A.mutate(d))
|
|
937
937
|
});
|
|
938
938
|
}
|
|
939
|
-
function
|
|
940
|
-
const { duration: s, delay: i, iterations: o = 1, fill: r, easing: c = "linear", direction: l } = e.options,
|
|
941
|
-
let
|
|
942
|
-
if (
|
|
943
|
-
const g =
|
|
939
|
+
function Hn(e, t, n) {
|
|
940
|
+
const { duration: s, delay: i, iterations: o = 1, fill: r, easing: c = "linear", direction: l } = e.options, f = e.effect.name, a = s === "auto", { sequenceId: u, delay: d, offset: h, offsetEasing: p = "linear" } = n || {};
|
|
941
|
+
let m = `${i ?? 0}ms`;
|
|
942
|
+
if (u && typeof p == "string") {
|
|
943
|
+
const g = Ln(p);
|
|
944
944
|
if (g) {
|
|
945
945
|
const E = (i ?? 0) + (d ?? 0);
|
|
946
946
|
if (h) {
|
|
947
947
|
const y = g(
|
|
948
|
-
`(var(--motion-${
|
|
948
|
+
`(var(--motion-${u}-index, 0) / var(--motion-${u}-last, 1))`
|
|
949
949
|
);
|
|
950
|
-
|
|
950
|
+
m = `calc(${`(${E} + ${y} * ${h} * var(--motion-${u}-last, 1))`} * 1ms)`;
|
|
951
951
|
} else
|
|
952
|
-
|
|
952
|
+
m = `${E}ms`;
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
|
-
return `${
|
|
955
|
+
return `${f} ${a ? "auto" : `${s}ms`}${a ? " " : ` ${m} `}${c}${r && r !== "none" ? ` ${r}` : ""} ${!o || o === 1 / 0 ? "infinite" : o}${l === "normal" ? "" : ` ${l}`} ${t ? "" : "paused"}`;
|
|
956
956
|
}
|
|
957
|
-
function
|
|
958
|
-
return e?.style ? (
|
|
957
|
+
function Gn(e, t, n) {
|
|
958
|
+
return e?.style ? (Ve(n) && (t.duration = t.duration || 1), e.style(t)) : [];
|
|
959
959
|
}
|
|
960
|
-
function
|
|
961
|
-
const i =
|
|
962
|
-
return r.map((l,
|
|
963
|
-
const { start: a, end:
|
|
960
|
+
function Wn(e, t, n, s) {
|
|
961
|
+
const i = ee(t), o = Gn(i, t), r = $t(o, n, t.effectId, !0), c = n?.trigger === "view-progress";
|
|
962
|
+
return r.map((l, f) => {
|
|
963
|
+
const { start: a, end: u } = c ? yt(l.effect) : {};
|
|
964
964
|
return {
|
|
965
965
|
part: l.part,
|
|
966
|
-
animation:
|
|
966
|
+
animation: Hn(l, c, s),
|
|
967
967
|
composition: l.options.composite,
|
|
968
968
|
custom: l.effect.custom,
|
|
969
969
|
name: l.effect.name,
|
|
970
|
-
keyframes:
|
|
971
|
-
id: l.id && `${l.id}-${
|
|
970
|
+
keyframes: ht(l.effect.keyframes),
|
|
971
|
+
id: l.id && `${l.id}-${f + 1}`,
|
|
972
972
|
animationTimeline: c ? `--${n?.id}` : "",
|
|
973
|
-
animationRange: a ||
|
|
973
|
+
animationRange: a || u ? `${a} ${u}` : ""
|
|
974
974
|
};
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
|
-
function
|
|
978
|
-
const s =
|
|
977
|
+
function Vn(e, t, n) {
|
|
978
|
+
const s = ee(t), i = e instanceof HTMLElement ? e : K(e);
|
|
979
979
|
if (s && s.prepare && i) {
|
|
980
|
-
const o = { measure:
|
|
980
|
+
const o = { measure: Et(i), mutate: wt(i) };
|
|
981
981
|
s.prepare(t, o);
|
|
982
982
|
}
|
|
983
983
|
n && A.mutate(n);
|
|
984
984
|
}
|
|
985
|
-
function
|
|
986
|
-
const n =
|
|
985
|
+
function St(e, t) {
|
|
986
|
+
const n = ee(t);
|
|
987
987
|
if (!n)
|
|
988
988
|
return null;
|
|
989
989
|
if (!n.style)
|
|
990
|
-
return t.effectId && e ?
|
|
991
|
-
const s = n.getNames(t), o =
|
|
990
|
+
return t.effectId && e ? Kn(e, t.effectId, n.parts) : null;
|
|
991
|
+
const s = n.getNames(t), o = vt(e, n.parts)?.flatMap((l) => l.getAnimations()), r = o?.map((l) => l.animationName) || [], c = [];
|
|
992
992
|
return s.forEach((l) => {
|
|
993
993
|
r.includes(l) && c.push(
|
|
994
|
-
o?.find((
|
|
994
|
+
o?.find((f) => f.animationName === l)
|
|
995
995
|
);
|
|
996
|
-
}), c?.length ? new
|
|
996
|
+
}), c?.length ? new se(c) : null;
|
|
997
997
|
}
|
|
998
|
-
function
|
|
999
|
-
const i =
|
|
998
|
+
function Kn(e, t, n) {
|
|
999
|
+
const i = vt(e, n)?.flatMap((o) => o.getAnimations()).filter((o) => {
|
|
1000
1000
|
const r = o.id || o.animationName;
|
|
1001
1001
|
return r ? r.startsWith(t) : !0;
|
|
1002
1002
|
});
|
|
1003
|
-
return i?.length ? new
|
|
1003
|
+
return i?.length ? new se(i) : null;
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1006
|
-
const { disabled: i, allowActiveEvent: o, ...r } = s, c =
|
|
1005
|
+
function It(e, t, n, s = {}) {
|
|
1006
|
+
const { disabled: i, allowActiveEvent: o, ...r } = s, c = bt(e, t, n, r);
|
|
1007
1007
|
if (!c)
|
|
1008
1008
|
return null;
|
|
1009
1009
|
let l = {};
|
|
1010
1010
|
if (n.trigger === "view-progress" && !window.ViewTimeline) {
|
|
1011
|
-
const
|
|
1012
|
-
return c.animations.map((
|
|
1011
|
+
const f = n.element || K(n.componentId), { ready: a } = c;
|
|
1012
|
+
return c.animations.map((u) => ({
|
|
1013
1013
|
/* we use getters for start and end in order to access the animation's start and end
|
|
1014
1014
|
only when initializing the scrub scene rather than immediately */
|
|
1015
1015
|
get start() {
|
|
1016
|
-
return
|
|
1016
|
+
return u.start;
|
|
1017
1017
|
},
|
|
1018
1018
|
get end() {
|
|
1019
|
-
return
|
|
1019
|
+
return u.end;
|
|
1020
1020
|
},
|
|
1021
|
-
viewSource:
|
|
1021
|
+
viewSource: f,
|
|
1022
1022
|
ready: a,
|
|
1023
1023
|
getProgress() {
|
|
1024
1024
|
return c.getProgress();
|
|
1025
1025
|
},
|
|
1026
1026
|
effect(d, h) {
|
|
1027
|
-
const { activeDuration:
|
|
1028
|
-
|
|
1027
|
+
const { activeDuration: p } = u.effect.getComputedTiming(), { delay: m } = u.effect.getTiming();
|
|
1028
|
+
u.currentTime = ((m || 0) + (p || 0)) * h;
|
|
1029
1029
|
},
|
|
1030
1030
|
disabled: i,
|
|
1031
1031
|
destroy() {
|
|
1032
|
-
|
|
1032
|
+
u.cancel();
|
|
1033
1033
|
}
|
|
1034
1034
|
}));
|
|
1035
1035
|
} else if (n.trigger === "pointer-move") {
|
|
1036
|
-
const
|
|
1037
|
-
if (
|
|
1038
|
-
const
|
|
1039
|
-
return
|
|
1040
|
-
target: (typeof e == "string" ?
|
|
1036
|
+
const f = t, { centeredToTarget: a, transitionDuration: u, transitionEasing: d } = f, h = n.axis;
|
|
1037
|
+
if (f.keyframeEffect) {
|
|
1038
|
+
const p = c;
|
|
1039
|
+
return p.animations?.length === 0 ? null : {
|
|
1040
|
+
target: (typeof e == "string" ? K(e) : e) ?? void 0,
|
|
1041
1041
|
centeredToTarget: a,
|
|
1042
|
-
ready:
|
|
1042
|
+
ready: p.ready,
|
|
1043
1043
|
_currentProgress: 0,
|
|
1044
1044
|
getProgress() {
|
|
1045
1045
|
return this._currentProgress;
|
|
1046
1046
|
},
|
|
1047
1047
|
effect(g, E) {
|
|
1048
1048
|
const y = h === "x" ? E.x : E.y;
|
|
1049
|
-
this._currentProgress = y,
|
|
1049
|
+
this._currentProgress = y, p.progress(y);
|
|
1050
1050
|
},
|
|
1051
1051
|
disabled: i ?? !1,
|
|
1052
1052
|
destroy() {
|
|
1053
|
-
|
|
1053
|
+
p.cancel();
|
|
1054
1054
|
}
|
|
1055
1055
|
};
|
|
1056
1056
|
}
|
|
1057
1057
|
l = {
|
|
1058
1058
|
centeredToTarget: a,
|
|
1059
1059
|
allowActiveEvent: o
|
|
1060
|
-
}, t.customEffect &&
|
|
1060
|
+
}, t.customEffect && u && (l.transitionDuration = u, l.transitionEasing = Ge(d)), l.target = c.target;
|
|
1061
1061
|
}
|
|
1062
1062
|
return {
|
|
1063
1063
|
...l,
|
|
1064
1064
|
getProgress() {
|
|
1065
1065
|
return c.getProgress();
|
|
1066
1066
|
},
|
|
1067
|
-
effect(
|
|
1067
|
+
effect(f, a, u, d) {
|
|
1068
1068
|
c.progress(
|
|
1069
|
-
|
|
1069
|
+
u ? {
|
|
1070
1070
|
// @ts-expect-error spread error on p
|
|
1071
1071
|
...a,
|
|
1072
|
-
v:
|
|
1072
|
+
v: u,
|
|
1073
1073
|
active: d
|
|
1074
1074
|
} : a
|
|
1075
1075
|
);
|
|
@@ -1080,48 +1080,48 @@ function bt(e, t, n, s = {}) {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
};
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1084
|
-
const i =
|
|
1083
|
+
function ie(e, t, n, s = !1) {
|
|
1084
|
+
const i = St(e, t);
|
|
1085
1085
|
return i ? (i.ready = new Promise((o) => {
|
|
1086
|
-
|
|
1087
|
-
}), i) :
|
|
1086
|
+
Vn(e, t, o);
|
|
1087
|
+
}), i) : bt(e, t, n, { reducedMotion: s });
|
|
1088
1088
|
}
|
|
1089
|
-
function
|
|
1089
|
+
function Yn(e) {
|
|
1090
1090
|
return e === null ? [null] : typeof e == "string" ? Array.from(document.querySelectorAll(e)) : Array.isArray(e) ? e : [e];
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function Tt(e, t) {
|
|
1093
1093
|
const n = [];
|
|
1094
1094
|
for (const { target: s, options: i } of e) {
|
|
1095
|
-
const o =
|
|
1095
|
+
const o = Yn(s);
|
|
1096
1096
|
for (const r of o) {
|
|
1097
|
-
const c =
|
|
1097
|
+
const c = ie(
|
|
1098
1098
|
r,
|
|
1099
1099
|
i,
|
|
1100
1100
|
void 0,
|
|
1101
1101
|
t?.reducedMotion
|
|
1102
1102
|
);
|
|
1103
|
-
c instanceof
|
|
1103
|
+
c instanceof se && n.push(c);
|
|
1104
1104
|
}
|
|
1105
1105
|
}
|
|
1106
1106
|
return n;
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1109
|
-
const s =
|
|
1110
|
-
return new
|
|
1108
|
+
function Bn(e, t, n) {
|
|
1109
|
+
const s = Tt(t, n);
|
|
1110
|
+
return new Fn(s, e);
|
|
1111
1111
|
}
|
|
1112
|
-
function
|
|
1112
|
+
function Un(e, t = 2) {
|
|
1113
1113
|
return parseFloat(e.toFixed(t));
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function Qn(e) {
|
|
1116
1116
|
return /\[]/g.test(e);
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1118
|
+
function Xn(e) {
|
|
1119
1119
|
return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function pe(e, t) {
|
|
1122
1122
|
return t.includes("&") ? t.replace(/&/g, e) : `${e}${t}`;
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function te() {
|
|
1125
1125
|
return "wi-12343210".replace(
|
|
1126
1126
|
/\d/g,
|
|
1127
1127
|
(e) => String.fromCharCode(
|
|
@@ -1130,34 +1130,34 @@ function ee() {
|
|
|
1130
1130
|
// 97 for "a"
|
|
1131
1131
|
);
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Ct(e) {
|
|
1134
1134
|
const { transition: t, transitionProperties: n } = e;
|
|
1135
1135
|
return (t?.styleProperties || n || []).map((i) => ({
|
|
1136
1136
|
...i,
|
|
1137
|
-
name:
|
|
1137
|
+
name: ve(i.name)
|
|
1138
1138
|
}));
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1140
|
+
function Ot(e) {
|
|
1141
1141
|
let { transition: t, transitionProperties: n } = e, s = [];
|
|
1142
1142
|
if (t?.styleProperties) {
|
|
1143
1143
|
const { duration: i, easing: o, delay: r } = t;
|
|
1144
1144
|
i && (t.styleProperties.some(
|
|
1145
1145
|
(l) => l.name.startsWith("--")
|
|
1146
1146
|
) ? s = [
|
|
1147
|
-
`all ${i}ms ${
|
|
1147
|
+
`all ${i}ms ${he(o || "ease")}${r ? ` ${r}ms` : ""}`,
|
|
1148
1148
|
"visibility 0s"
|
|
1149
1149
|
] : s = t.styleProperties.map(
|
|
1150
|
-
(l) => `${
|
|
1150
|
+
(l) => `${ve(l.name)} ${i}ms ${he(
|
|
1151
1151
|
o || "ease"
|
|
1152
1152
|
)}${r ? ` ${r}ms` : ""}`
|
|
1153
1153
|
));
|
|
1154
1154
|
} else
|
|
1155
1155
|
s = n?.filter((i) => i.duration).map(
|
|
1156
|
-
(i) => `${
|
|
1156
|
+
(i) => `${ve(i.name)} ${i.duration}ms ${he(i.easing) || "ease"}${i.delay ? ` ${i.delay}ms` : ""}`
|
|
1157
1157
|
) || [];
|
|
1158
1158
|
return s;
|
|
1159
1159
|
}
|
|
1160
|
-
function
|
|
1160
|
+
function Zn({
|
|
1161
1161
|
key: e,
|
|
1162
1162
|
effectId: t,
|
|
1163
1163
|
transition: n,
|
|
@@ -1165,38 +1165,38 @@ function Qn({
|
|
|
1165
1165
|
childSelector: i = "> :first-child",
|
|
1166
1166
|
selectorCondition: o
|
|
1167
1167
|
}) {
|
|
1168
|
-
const r =
|
|
1168
|
+
const r = Ot({
|
|
1169
1169
|
transition: n,
|
|
1170
1170
|
transitionProperties: s
|
|
1171
|
-
}), c =
|
|
1172
|
-
(
|
|
1173
|
-
), l = e.replace(/"/g, "'"),
|
|
1174
|
-
`${
|
|
1171
|
+
}), c = Ct({ transition: n, transitionProperties: s }).map(
|
|
1172
|
+
(p) => `${p.name}: ${p.value};`
|
|
1173
|
+
), l = e.replace(/"/g, "'"), f = `:is(:state(${t}), :--${t}) ${i}`, a = `[data-interact-effect~="${t}"] ${i}`, u = o ? pe(f, o) : f, d = o ? pe(a, o) : a, h = [
|
|
1174
|
+
`${u},
|
|
1175
1175
|
${d} {
|
|
1176
1176
|
${c.join(`
|
|
1177
1177
|
`)}
|
|
1178
1178
|
}`
|
|
1179
1179
|
];
|
|
1180
1180
|
if (r.length) {
|
|
1181
|
-
const
|
|
1182
|
-
h.push(`@media (prefers-reduced-motion: no-preference) { ${
|
|
1181
|
+
const p = `[data-interact-key="${l}"] ${i}`, m = o ? pe(p, o) : p;
|
|
1182
|
+
h.push(`@media (prefers-reduced-motion: no-preference) { ${m} {
|
|
1183
1183
|
transition: ${r.join(", ")};
|
|
1184
1184
|
} }`);
|
|
1185
1185
|
}
|
|
1186
1186
|
return h;
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function oe(e, t, n) {
|
|
1189
1189
|
const s = (e || []).filter((i) => t[i]?.type === n && t[i].predicate).map((i) => t[i].predicate).join(") and (");
|
|
1190
1190
|
return s && `(${s})`;
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1193
|
-
const n =
|
|
1192
|
+
function P(e, t) {
|
|
1193
|
+
const n = oe(e, t, "media");
|
|
1194
1194
|
return n && window.matchMedia(n);
|
|
1195
1195
|
}
|
|
1196
1196
|
function R(e, t) {
|
|
1197
1197
|
return (e || []).filter((n) => t[n]?.type === "selector" && t[n].predicate).map((n) => `:is(${t[n].predicate})`).join("");
|
|
1198
1198
|
}
|
|
1199
|
-
const
|
|
1199
|
+
const _t = /* @__PURE__ */ new Map([
|
|
1200
1200
|
["viewEnter", "once"],
|
|
1201
1201
|
["animationEnd", "once"],
|
|
1202
1202
|
["hover", "alternate"],
|
|
@@ -1204,93 +1204,93 @@ const Ct = /* @__PURE__ */ new Map([
|
|
|
1204
1204
|
["activate", "alternate"],
|
|
1205
1205
|
["interest", "alternate"]
|
|
1206
1206
|
]);
|
|
1207
|
-
function
|
|
1208
|
-
const { effects: i = {}, conditions: o = {} } = n, { key: r, trigger: c, conditions: l = [] } = t,
|
|
1209
|
-
e.effectId || (e.effectId = s ||
|
|
1210
|
-
const { effectId: a } = e,
|
|
1211
|
-
let { key: d, conditions: h, triggerType:
|
|
1207
|
+
function At(e, t, n, s) {
|
|
1208
|
+
const { effects: i = {}, conditions: o = {} } = n, { key: r, trigger: c, conditions: l = [] } = t, f = c === "pointerMove";
|
|
1209
|
+
e.effectId || (e.effectId = s || te());
|
|
1210
|
+
const { effectId: a } = e, u = { ...i[a] || {}, ...e };
|
|
1211
|
+
let { key: d, conditions: h, triggerType: p } = u;
|
|
1212
1212
|
if (!d) {
|
|
1213
1213
|
if (!r)
|
|
1214
1214
|
return null;
|
|
1215
1215
|
d = r;
|
|
1216
1216
|
}
|
|
1217
|
-
if (
|
|
1217
|
+
if (Qn(d))
|
|
1218
1218
|
return null;
|
|
1219
|
-
const
|
|
1219
|
+
const m = l.filter(
|
|
1220
1220
|
(I) => o[I].type === "media"
|
|
1221
1221
|
);
|
|
1222
1222
|
h = [
|
|
1223
1223
|
...new Set(
|
|
1224
|
-
[...h || [], ...
|
|
1224
|
+
[...h || [], ...m].filter(
|
|
1225
1225
|
(I) => o[I]
|
|
1226
1226
|
)
|
|
1227
1227
|
)
|
|
1228
|
-
],
|
|
1229
|
-
const { namedEffect: g, customEffect: E, keyframeEffect: y, transition: v, transitionProperties:
|
|
1230
|
-
...
|
|
1228
|
+
], p || (p = _t.get(c));
|
|
1229
|
+
const { namedEffect: g, customEffect: E, keyframeEffect: y, transition: v, transitionProperties: $, ...b } = {
|
|
1230
|
+
...u,
|
|
1231
1231
|
key: d,
|
|
1232
1232
|
conditions: h,
|
|
1233
1233
|
effectId: a,
|
|
1234
|
-
triggerType:
|
|
1235
|
-
}, S =
|
|
1234
|
+
triggerType: p
|
|
1235
|
+
}, S = Zt(t, b);
|
|
1236
1236
|
if (g)
|
|
1237
|
-
return
|
|
1237
|
+
return f || !g.type ? null : { namedEffect: g, initial: S, ...b };
|
|
1238
1238
|
if (y) {
|
|
1239
1239
|
if (!y.name) {
|
|
1240
1240
|
const I = a && !(i[a] && "keyframeEffect" in e);
|
|
1241
|
-
y.name = I ? a :
|
|
1241
|
+
y.name = I ? a : te();
|
|
1242
1242
|
}
|
|
1243
1243
|
return { keyframeEffect: y, initial: S, ...b };
|
|
1244
|
-
} else return E ?
|
|
1244
|
+
} else return E ? f ? null : { initial: S, ...b } : v ? { transition: v, initial: S, ...b } : $ ? { transitionProperties: $, initial: S, ...b } : { initial: S, ...b };
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1246
|
+
function Jn(e, t, n, s, i) {
|
|
1247
1247
|
const { sequences: o = {}, conditions: r = {} } = n, { trigger: c, conditions: l = [] } = t;
|
|
1248
|
-
e.sequenceId || (e.sequenceId = s ||
|
|
1249
|
-
const { sequenceId:
|
|
1248
|
+
e.sequenceId || (e.sequenceId = s || te());
|
|
1249
|
+
const { sequenceId: f } = e, a = { ...o[f] || {}, ...e };
|
|
1250
1250
|
let {
|
|
1251
|
-
effects:
|
|
1251
|
+
effects: u,
|
|
1252
1252
|
conditions: d,
|
|
1253
1253
|
triggerType: h,
|
|
1254
|
-
delay:
|
|
1255
|
-
offset:
|
|
1254
|
+
delay: p = 0,
|
|
1255
|
+
offset: m = 0,
|
|
1256
1256
|
offsetEasing: g = "linear"
|
|
1257
1257
|
} = a;
|
|
1258
|
-
if (typeof g == "function" || !
|
|
1258
|
+
if (typeof g == "function" || !u)
|
|
1259
1259
|
return null;
|
|
1260
|
-
h || (h =
|
|
1260
|
+
h || (h = _t.get(c));
|
|
1261
1261
|
const E = l.filter(
|
|
1262
|
-
(
|
|
1262
|
+
($) => r[$].type === "media"
|
|
1263
1263
|
);
|
|
1264
1264
|
d = [
|
|
1265
1265
|
...new Set(
|
|
1266
1266
|
[...d || [], ...E].filter(
|
|
1267
|
-
(
|
|
1267
|
+
($) => r[$]
|
|
1268
1268
|
)
|
|
1269
1269
|
)
|
|
1270
1270
|
];
|
|
1271
|
-
const v =
|
|
1272
|
-
const S =
|
|
1273
|
-
{
|
|
1271
|
+
const v = u.map(($, b) => {
|
|
1272
|
+
const S = At(
|
|
1273
|
+
{ ...$, triggerType: h, conditions: [...$.conditions || [], ...d] },
|
|
1274
1274
|
t,
|
|
1275
1275
|
n,
|
|
1276
|
-
`${
|
|
1276
|
+
`${f}-eff-${b}`
|
|
1277
1277
|
);
|
|
1278
1278
|
return S && Object.assign(S, { slotKey: i?.(b) });
|
|
1279
|
-
}).filter((
|
|
1279
|
+
}).filter(($) => $ !== null);
|
|
1280
1280
|
return v.length ? {
|
|
1281
|
-
sequenceId:
|
|
1281
|
+
sequenceId: f,
|
|
1282
1282
|
triggerType: h,
|
|
1283
1283
|
conditions: d,
|
|
1284
|
-
delay:
|
|
1285
|
-
offset:
|
|
1284
|
+
delay: p,
|
|
1285
|
+
offset: m,
|
|
1286
1286
|
offsetEasing: g,
|
|
1287
1287
|
effects: v
|
|
1288
1288
|
} : null;
|
|
1289
1289
|
}
|
|
1290
|
-
function
|
|
1291
|
-
return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" :
|
|
1290
|
+
function es(e) {
|
|
1291
|
+
return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : ve(e);
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1293
|
+
function ts(e) {
|
|
1294
1294
|
if (!e.length)
|
|
1295
1295
|
return [];
|
|
1296
1296
|
const t = e.map((i) => ({ ...i }));
|
|
@@ -1312,58 +1312,58 @@ function Jn(e) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
return t;
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1316
|
-
const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${
|
|
1315
|
+
function ns(e, t) {
|
|
1316
|
+
const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${es(s)}: ${i};`).join(`
|
|
1317
1317
|
`);
|
|
1318
1318
|
return `${t}% {
|
|
1319
1319
|
${n}
|
|
1320
1320
|
}`;
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1323
|
-
const n =
|
|
1322
|
+
function ss(e, t) {
|
|
1323
|
+
const n = ts(t);
|
|
1324
1324
|
if (!n.length)
|
|
1325
1325
|
return "";
|
|
1326
1326
|
let s = n.map((i) => {
|
|
1327
|
-
const o = i.offset, r =
|
|
1328
|
-
return
|
|
1327
|
+
const o = i.offset, r = Un(o * 100);
|
|
1328
|
+
return ns(i, r);
|
|
1329
1329
|
}).join(`
|
|
1330
1330
|
`);
|
|
1331
1331
|
return `@keyframes ${e} {
|
|
1332
1332
|
${s}
|
|
1333
1333
|
}`;
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function is(e) {
|
|
1336
1336
|
const { key: t, childSelector: n, declarations: s, media: i, states: o, selectorCondition: r, selectorSuffix: c } = e;
|
|
1337
1337
|
if (!s.length)
|
|
1338
1338
|
return "";
|
|
1339
1339
|
let l = `[data-interact-key="${t}"]`;
|
|
1340
1340
|
if (o && o.length) {
|
|
1341
|
-
const
|
|
1342
|
-
l = `${l}:is(${
|
|
1341
|
+
const u = o.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
|
|
1342
|
+
l = `${l}:is(${u})`;
|
|
1343
1343
|
}
|
|
1344
|
-
n && (l = `${l} ${n}`), c && (l = `${l}${c}`), r && (l =
|
|
1345
|
-
const
|
|
1344
|
+
n && (l = `${l} ${n}`), c && (l = `${l}${c}`), r && (l = pe(l, r));
|
|
1345
|
+
const f = s.map(({ name: u, value: d, important: h }) => `${u}: ${d}${h ? " !important" : ""};`).join(`
|
|
1346
1346
|
`), a = `${l} {
|
|
1347
|
-
${
|
|
1347
|
+
${f}
|
|
1348
1348
|
}`;
|
|
1349
1349
|
return i ? `@media ${i} {
|
|
1350
1350
|
${a}
|
|
1351
1351
|
}` : a;
|
|
1352
1352
|
}
|
|
1353
|
-
const
|
|
1353
|
+
const qe = [
|
|
1354
1354
|
"animation",
|
|
1355
1355
|
"animation-composition",
|
|
1356
1356
|
"animation-timeline",
|
|
1357
1357
|
"animation-range"
|
|
1358
|
-
],
|
|
1359
|
-
...
|
|
1358
|
+
], Se = [
|
|
1359
|
+
...qe,
|
|
1360
1360
|
"transition",
|
|
1361
1361
|
"view-timeline"
|
|
1362
|
-
],
|
|
1363
|
-
function
|
|
1362
|
+
], Ke = ["animation", "transition", "timeline"];
|
|
1363
|
+
function F(e) {
|
|
1364
1364
|
return e === "transition" ? "transition" : e === "view-timeline" ? "timeline" : "animation";
|
|
1365
1365
|
}
|
|
1366
|
-
const
|
|
1366
|
+
const B = {
|
|
1367
1367
|
transition: "_",
|
|
1368
1368
|
animation: "none",
|
|
1369
1369
|
"animation-composition": "replace",
|
|
@@ -1371,23 +1371,23 @@ const Y = {
|
|
|
1371
1371
|
"animation-range": "normal",
|
|
1372
1372
|
"view-timeline": "none"
|
|
1373
1373
|
};
|
|
1374
|
-
function
|
|
1374
|
+
function Mt(e) {
|
|
1375
1375
|
return e.replace(new RegExp("(?<!(^|-))([aeiou]|tion)", "g"), "");
|
|
1376
1376
|
}
|
|
1377
1377
|
function j(e, t, n = !1, s) {
|
|
1378
1378
|
const i = s === void 0 ? "" : `-c${s}`;
|
|
1379
|
-
return `--${
|
|
1379
|
+
return `--${Mt(e)}${i}${n ? "-slot" : ""}-${t}`;
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1382
|
-
return `--${
|
|
1381
|
+
function ne(e, t) {
|
|
1382
|
+
return `--${Mt(e)}-c${t}`;
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function os(e, t) {
|
|
1385
1385
|
return Array.from(
|
|
1386
1386
|
{ length: t + 1 },
|
|
1387
|
-
(n, s) => `var(${
|
|
1387
|
+
(n, s) => `var(${ne(e, s)})`
|
|
1388
1388
|
).join(", ");
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function rs(e, t, n, s, i = 0, o) {
|
|
1391
1391
|
const r = {
|
|
1392
1392
|
animation: e,
|
|
1393
1393
|
transition: t,
|
|
@@ -1396,70 +1396,70 @@ function is(e, t, n, s, i = 0, o) {
|
|
|
1396
1396
|
animation: n,
|
|
1397
1397
|
transition: s,
|
|
1398
1398
|
timeline: 0
|
|
1399
|
-
}, l = (
|
|
1400
|
-
return
|
|
1399
|
+
}, l = (f, a) => `@property ${a} { syntax: "*"; inherits: false; initial-value: ${B[f]}; }`;
|
|
1400
|
+
return Se.flatMap((f) => [
|
|
1401
1401
|
...Array.from(
|
|
1402
|
-
{ length: r[
|
|
1403
|
-
(a,
|
|
1402
|
+
{ length: r[F(f)] },
|
|
1403
|
+
(a, u) => l(f, j(f, u, !1, o))
|
|
1404
1404
|
),
|
|
1405
1405
|
...Array.from(
|
|
1406
|
-
{ length: c[
|
|
1407
|
-
(a,
|
|
1406
|
+
{ length: c[F(f)] },
|
|
1407
|
+
(a, u) => l(f, j(f, u, !0, o))
|
|
1408
1408
|
),
|
|
1409
1409
|
// registers the lists of the configs before it too, for elements they don't target
|
|
1410
1410
|
...Array.from(
|
|
1411
|
-
{ length: o !== void 0 && r[
|
|
1412
|
-
(a,
|
|
1411
|
+
{ length: o !== void 0 && r[F(f)] ? o + 1 : 0 },
|
|
1412
|
+
(a, u) => l(f, ne(f, u))
|
|
1413
1413
|
)
|
|
1414
1414
|
]);
|
|
1415
1415
|
}
|
|
1416
|
-
function
|
|
1417
|
-
const i =
|
|
1418
|
-
(c) => e[
|
|
1416
|
+
function as(e, t, n, s) {
|
|
1417
|
+
const i = Se.filter(
|
|
1418
|
+
(c) => e[F(c)].slotsInSequence > 0
|
|
1419
1419
|
);
|
|
1420
1420
|
if (i.length === 0)
|
|
1421
1421
|
return null;
|
|
1422
1422
|
const o = i.map((c) => {
|
|
1423
|
-
const { listIndex: l, slotCursor:
|
|
1423
|
+
const { listIndex: l, slotCursor: f, slotsInSequence: a } = e[F(c)];
|
|
1424
1424
|
return {
|
|
1425
1425
|
name: j(c, l, !1, s),
|
|
1426
1426
|
value: Array.from(
|
|
1427
1427
|
{ length: a },
|
|
1428
|
-
(
|
|
1428
|
+
(u, d) => `var(${j(c, f + d, !0, s)})`
|
|
1429
1429
|
).join(", ")
|
|
1430
1430
|
};
|
|
1431
1431
|
}), r = { key: e.key, childSelector: e.childSelector, declarations: o };
|
|
1432
|
-
return t && (r.media =
|
|
1432
|
+
return t && (r.media = oe(t, n || {}, "media"), r.selectorCondition = R(t, n || {})), r;
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1434
|
+
function cs(e, t, n, s = 0, i) {
|
|
1435
1435
|
if (e.length === 0)
|
|
1436
1436
|
return "";
|
|
1437
1437
|
const o = {
|
|
1438
1438
|
animation: t,
|
|
1439
1439
|
transition: n,
|
|
1440
1440
|
timeline: s
|
|
1441
|
-
}, r =
|
|
1441
|
+
}, r = Se.filter((f) => o[F(f)] > 0);
|
|
1442
1442
|
if (r.length === 0)
|
|
1443
1443
|
return "";
|
|
1444
|
-
const c = r.flatMap((
|
|
1444
|
+
const c = r.flatMap((f) => {
|
|
1445
1445
|
const a = Array.from(
|
|
1446
|
-
{ length: o[
|
|
1446
|
+
{ length: o[F(f)] },
|
|
1447
1447
|
// TODO: maybe add `-intrct` to names? --anm-0 or --trns-0 could collide with user-defined names
|
|
1448
|
-
(
|
|
1448
|
+
(u, d) => `var(${j(f, d, !1, i)})`
|
|
1449
1449
|
).join(", ");
|
|
1450
|
-
return i === void 0 ? [{ name:
|
|
1451
|
-
{ name:
|
|
1452
|
-
{ name:
|
|
1450
|
+
return i === void 0 ? [{ name: f, value: a }] : [
|
|
1451
|
+
{ name: ne(f, i), value: a },
|
|
1452
|
+
{ name: f, value: os(f, i) }
|
|
1453
1453
|
];
|
|
1454
1454
|
});
|
|
1455
1455
|
return `${e.map(
|
|
1456
|
-
({ key:
|
|
1456
|
+
({ key: f, childSelector: a }) => `[data-interact-key="${f}"]${a ? ` ${a}` : ""}`
|
|
1457
1457
|
).join(", ")} {
|
|
1458
|
-
${c.map(({ name:
|
|
1458
|
+
${c.map(({ name: f, value: a }) => ` ${f}: ${a};`).join(`
|
|
1459
1459
|
`)}
|
|
1460
1460
|
}`;
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1462
|
+
function ls(e, t) {
|
|
1463
1463
|
if (e.length === 0)
|
|
1464
1464
|
return "";
|
|
1465
1465
|
if (t === void 0)
|
|
@@ -1468,24 +1468,24 @@ function as(e, t) {
|
|
|
1468
1468
|
}`;
|
|
1469
1469
|
const n = Array.from(
|
|
1470
1470
|
{ length: t + 1 },
|
|
1471
|
-
(s, i) => `var(${
|
|
1471
|
+
(s, i) => `var(${ne("timeline-scope", i)}, --_)`
|
|
1472
1472
|
).join(", ");
|
|
1473
1473
|
return `:root {
|
|
1474
|
-
${
|
|
1474
|
+
${ne("timeline-scope", t)}: ${e.join(", ")};
|
|
1475
1475
|
timeline-scope: ${n};
|
|
1476
1476
|
}`;
|
|
1477
1477
|
}
|
|
1478
|
-
const
|
|
1478
|
+
const ce = {
|
|
1479
1479
|
rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
|
|
1480
1480
|
rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
|
|
1481
1481
|
};
|
|
1482
|
-
function
|
|
1483
|
-
const n = e?.name ??
|
|
1482
|
+
function fs(e, t) {
|
|
1483
|
+
const n = e?.name ?? ce.rangeStart.name, s = t?.name ?? e?.name ?? ce.rangeEnd.name, i = {
|
|
1484
1484
|
name: n,
|
|
1485
|
-
offset: e?.offset ||
|
|
1485
|
+
offset: e?.offset || ce.rangeStart.offset
|
|
1486
1486
|
}, o = {
|
|
1487
1487
|
name: s,
|
|
1488
|
-
offset: t?.offset ||
|
|
1488
|
+
offset: t?.offset || ce.rangeEnd.offset
|
|
1489
1489
|
};
|
|
1490
1490
|
return { startOffset: i, endOffset: o };
|
|
1491
1491
|
}
|
|
@@ -1495,7 +1495,7 @@ function x(e) {
|
|
|
1495
1495
|
id: "",
|
|
1496
1496
|
...e
|
|
1497
1497
|
};
|
|
1498
|
-
const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } =
|
|
1498
|
+
const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } = fs(t, n);
|
|
1499
1499
|
return {
|
|
1500
1500
|
id: "",
|
|
1501
1501
|
startOffset: i,
|
|
@@ -1503,11 +1503,11 @@ function x(e) {
|
|
|
1503
1503
|
...s
|
|
1504
1504
|
};
|
|
1505
1505
|
}
|
|
1506
|
-
function
|
|
1506
|
+
function q(e, t, n) {
|
|
1507
1507
|
let s = e.get(t);
|
|
1508
1508
|
s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), s.add(n);
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1510
|
+
function re(e, t) {
|
|
1511
1511
|
e.get(t)?.forEach((s) => {
|
|
1512
1512
|
const { source: i, target: o, cleanup: r } = s;
|
|
1513
1513
|
r();
|
|
@@ -1515,15 +1515,15 @@ function oe(e, t) {
|
|
|
1515
1515
|
e.get(c)?.delete(s);
|
|
1516
1516
|
}), e.delete(t);
|
|
1517
1517
|
}
|
|
1518
|
-
const
|
|
1518
|
+
const us = [
|
|
1519
1519
|
{ name: "visibility", value: "hidden" },
|
|
1520
1520
|
{ name: "clip-path", value: "none", important: !0 },
|
|
1521
1521
|
{ name: "transform", value: "none", important: !0 },
|
|
1522
1522
|
{ name: "translate", value: "none", important: !0 },
|
|
1523
1523
|
{ name: "scale", value: "none", important: !0 },
|
|
1524
1524
|
{ name: "rotate", value: "none", important: !0 }
|
|
1525
|
-
],
|
|
1526
|
-
function
|
|
1525
|
+
], Pe = { animation: !1, transition: !1, timeline: !1 };
|
|
1526
|
+
function kt(e, t) {
|
|
1527
1527
|
const n = () => ({
|
|
1528
1528
|
listIndex: 0,
|
|
1529
1529
|
slotCursor: 0,
|
|
@@ -1542,10 +1542,10 @@ function At(e, t) {
|
|
|
1542
1542
|
keyframeEntries: /* @__PURE__ */ new Map()
|
|
1543
1543
|
};
|
|
1544
1544
|
}
|
|
1545
|
-
function
|
|
1545
|
+
function qt(e, t, n) {
|
|
1546
1546
|
return Object.fromEntries(
|
|
1547
|
-
|
|
1548
|
-
const i =
|
|
1547
|
+
Se.map((s) => {
|
|
1548
|
+
const i = F(s), { listIndex: o, slotCursor: r, slotsInSequence: c } = e[i];
|
|
1549
1549
|
return [
|
|
1550
1550
|
s,
|
|
1551
1551
|
t[i] ? j(s, r + c, !0, n) : j(s, o, !1, n)
|
|
@@ -1553,22 +1553,22 @@ function Mt(e, t, n) {
|
|
|
1553
1553
|
})
|
|
1554
1554
|
);
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1557
|
-
|
|
1556
|
+
function Le(e, t, n) {
|
|
1557
|
+
Ke.forEach((s) => {
|
|
1558
1558
|
t[s] && (e[s].touched = !0, n[s] && (e[s].slotsInSequence += 1));
|
|
1559
1559
|
});
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1561
|
+
function Pt(e) {
|
|
1562
1562
|
const { namedEffect: t, keyframeEffect: n, transition: s, transitionProperties: i } = e;
|
|
1563
1563
|
return t || n ? "animation" : s || i ? "transition" : null;
|
|
1564
1564
|
}
|
|
1565
|
-
function
|
|
1565
|
+
function ds(e) {
|
|
1566
1566
|
const t = /* @__PURE__ */ new Map();
|
|
1567
1567
|
return e.effects.forEach((n) => {
|
|
1568
|
-
const s =
|
|
1568
|
+
const s = Pt(n);
|
|
1569
1569
|
if (!s)
|
|
1570
1570
|
return;
|
|
1571
|
-
const i =
|
|
1571
|
+
const i = V(n), o = t.get(i) || { animation: 0, transition: 0, timeline: 0 };
|
|
1572
1572
|
o[s] += 1, t.set(i, o);
|
|
1573
1573
|
}), new Map(
|
|
1574
1574
|
[...t].map(([n, { animation: s, transition: i }]) => [
|
|
@@ -1577,47 +1577,47 @@ function us(e) {
|
|
|
1577
1577
|
])
|
|
1578
1578
|
);
|
|
1579
1579
|
}
|
|
1580
|
-
function
|
|
1581
|
-
|
|
1580
|
+
function hs(e) {
|
|
1581
|
+
Ke.forEach((t) => {
|
|
1582
1582
|
const n = e[t];
|
|
1583
1583
|
n.slotsInInteraction = Math.max(n.slotsInInteraction, n.slotsInSequence), n.slotsInSequence = 0;
|
|
1584
1584
|
});
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1587
|
-
|
|
1586
|
+
function ms(e) {
|
|
1587
|
+
Ke.forEach((t) => {
|
|
1588
1588
|
const n = e[t];
|
|
1589
1589
|
n.listIndex += n.touched ? 1 : 0, n.slotCursor += n.slotsInInteraction, n.slotsInInteraction = 0, n.touched = !1;
|
|
1590
1590
|
});
|
|
1591
1591
|
}
|
|
1592
|
-
const
|
|
1592
|
+
const ps = {
|
|
1593
1593
|
animation: "animation",
|
|
1594
1594
|
"animation-composition": "composition",
|
|
1595
1595
|
"animation-timeline": "animationTimeline",
|
|
1596
1596
|
"animation-range": "animationRange"
|
|
1597
1597
|
};
|
|
1598
|
-
function
|
|
1599
|
-
const { key: i, conditions: o } = t, r =
|
|
1598
|
+
function gs(e, t, n, s) {
|
|
1599
|
+
const { key: i, conditions: o } = t, r = oe(o, e.configConditions, "media"), c = R(o, e.configConditions), l = W(t, {
|
|
1600
1600
|
asCombinator: !0,
|
|
1601
1601
|
useFirstChild: e.useFirstChild,
|
|
1602
1602
|
addItemFilter: !0
|
|
1603
|
-
}),
|
|
1604
|
-
return
|
|
1603
|
+
}), f = V(t), a = e.targetsMap.get(f) || kt(i, l), u = qt(a, Pe, e.configIndex)["view-timeline"];
|
|
1604
|
+
return Le(a, { animation: !1, transition: !1, timeline: !0 }, Pe), e.targetsMap.set(f, a), s.add(f), {
|
|
1605
1605
|
key: i,
|
|
1606
1606
|
media: r,
|
|
1607
1607
|
selectorCondition: c,
|
|
1608
1608
|
childSelector: l,
|
|
1609
1609
|
declarations: [
|
|
1610
1610
|
{
|
|
1611
|
-
name:
|
|
1611
|
+
name: u,
|
|
1612
1612
|
value: `--${n}`
|
|
1613
1613
|
}
|
|
1614
1614
|
]
|
|
1615
1615
|
};
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1617
|
+
function Lt(e, t, n, s, i) {
|
|
1618
1618
|
const o = [];
|
|
1619
1619
|
for (const r of Object.keys(i)) {
|
|
1620
|
-
const c = `${
|
|
1620
|
+
const c = `${He}${r}`;
|
|
1621
1621
|
c in t && o.push(
|
|
1622
1622
|
...i[r](t[c], {
|
|
1623
1623
|
key: n,
|
|
@@ -1628,17 +1628,17 @@ function qt(e, t, n, s, i) {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
return o;
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1632
|
-
const { assigned: r, childSelector: c, partSelectors: l } = n,
|
|
1631
|
+
function vs(e, t, n, s, i, o) {
|
|
1632
|
+
const { assigned: r, childSelector: c, partSelectors: l } = n, f = { animation: !1, transition: !1, timeline: !1 }, {
|
|
1633
1633
|
key: a,
|
|
1634
|
-
effectId:
|
|
1634
|
+
effectId: u,
|
|
1635
1635
|
conditions: d,
|
|
1636
1636
|
namedEffect: h,
|
|
1637
|
-
keyframeEffect:
|
|
1638
|
-
transition:
|
|
1637
|
+
keyframeEffect: p,
|
|
1638
|
+
transition: m,
|
|
1639
1639
|
transitionProperties: g,
|
|
1640
1640
|
initial: E
|
|
1641
|
-
} = t, y =
|
|
1641
|
+
} = t, y = oe(d, e.configConditions, "media"), v = R(d, e.configConditions), $ = [
|
|
1642
1642
|
{
|
|
1643
1643
|
key: a,
|
|
1644
1644
|
media: y,
|
|
@@ -1648,9 +1648,9 @@ function ps(e, t, n, s, i, o) {
|
|
|
1648
1648
|
}
|
|
1649
1649
|
];
|
|
1650
1650
|
let b = [];
|
|
1651
|
-
const { declarations: S } =
|
|
1652
|
-
if (e.plugins &&
|
|
1653
|
-
const I = x(t), O =
|
|
1651
|
+
const { declarations: S } = $[0];
|
|
1652
|
+
if (e.plugins && $.push(...Lt("effect", t, a, y, e.plugins)), h || p) {
|
|
1653
|
+
const I = x(t), O = Wn(null, I, s, o).filter(
|
|
1654
1654
|
(T) => T.name
|
|
1655
1655
|
), M = O.length ? {} : { "": [] };
|
|
1656
1656
|
O.forEach((T) => {
|
|
@@ -1664,66 +1664,66 @@ function ps(e, t, n, s, i, o) {
|
|
|
1664
1664
|
({ custom: T }) => Object.entries(T || {}).filter(([C, _]) => _ !== void 0).map(([C, _]) => ({ name: C, value: _ }))
|
|
1665
1665
|
)
|
|
1666
1666
|
), Object.entries(M).forEach(([T, C]) => {
|
|
1667
|
-
const _ =
|
|
1668
|
-
_listPropertyName:
|
|
1669
|
-
name: i[
|
|
1670
|
-
value: C.map((
|
|
1671
|
-
const
|
|
1672
|
-
return
|
|
1667
|
+
const _ = qe.map((L) => ({
|
|
1668
|
+
_listPropertyName: L,
|
|
1669
|
+
name: i[L],
|
|
1670
|
+
value: C.map((Te) => {
|
|
1671
|
+
const Ce = ps[L];
|
|
1672
|
+
return Te[Ce] || B[L];
|
|
1673
1673
|
}).join(", ")
|
|
1674
1674
|
})).filter(
|
|
1675
|
-
({ _listPropertyName:
|
|
1675
|
+
({ _listPropertyName: L, name: Te, value: Ce }) => Ce !== B[L] || r.has(Te)
|
|
1676
1676
|
);
|
|
1677
|
-
_.forEach(({ name:
|
|
1678
|
-
const
|
|
1679
|
-
T && _.length && l.add(
|
|
1677
|
+
_.forEach(({ name: L }) => r.add(L)), f.animation = f.animation || _.length > 0;
|
|
1678
|
+
const ae = T ? `[data-motion-part~="${T}"]` : c;
|
|
1679
|
+
T && _.length && l.add(ae), E ? ($.push({
|
|
1680
1680
|
key: a,
|
|
1681
1681
|
media: y,
|
|
1682
1682
|
selectorCondition: v,
|
|
1683
|
-
childSelector:
|
|
1684
|
-
declarations:
|
|
1683
|
+
childSelector: ae,
|
|
1684
|
+
declarations: us,
|
|
1685
1685
|
selectorSuffix: ":not([data-interact-enter])"
|
|
1686
|
-
}),
|
|
1686
|
+
}), $.push({
|
|
1687
1687
|
key: a,
|
|
1688
1688
|
media: y,
|
|
1689
1689
|
selectorCondition: v,
|
|
1690
|
-
childSelector:
|
|
1690
|
+
childSelector: ae,
|
|
1691
1691
|
declarations: _,
|
|
1692
1692
|
selectorSuffix: ':not([data-interact-enter="done"])'
|
|
1693
|
-
})) : T ?
|
|
1693
|
+
})) : T ? $.push({
|
|
1694
1694
|
key: a,
|
|
1695
1695
|
media: y,
|
|
1696
1696
|
selectorCondition: v,
|
|
1697
|
-
childSelector:
|
|
1697
|
+
childSelector: ae,
|
|
1698
1698
|
declarations: _
|
|
1699
1699
|
}) : S.push(..._);
|
|
1700
1700
|
});
|
|
1701
|
-
} else if (
|
|
1702
|
-
const I =
|
|
1701
|
+
} else if (m || g) {
|
|
1702
|
+
const I = Ct(t), O = Ot(t);
|
|
1703
1703
|
(O.length || r.has(i.transition)) && (S.push({
|
|
1704
1704
|
name: i.transition,
|
|
1705
|
-
value: O.join(", ") ||
|
|
1706
|
-
}), r.add(i.transition),
|
|
1705
|
+
value: O.join(", ") || B.transition
|
|
1706
|
+
}), r.add(i.transition), f.transition = !0), $.push({
|
|
1707
1707
|
key: a,
|
|
1708
1708
|
media: y,
|
|
1709
1709
|
selectorCondition: v,
|
|
1710
1710
|
childSelector: c,
|
|
1711
|
-
states: [
|
|
1711
|
+
states: [u],
|
|
1712
1712
|
declarations: I
|
|
1713
1713
|
});
|
|
1714
1714
|
} else
|
|
1715
1715
|
S.push(
|
|
1716
|
-
...
|
|
1716
|
+
...qe.filter(
|
|
1717
1717
|
(I) => r.has(i[I])
|
|
1718
1718
|
).map((I) => ({
|
|
1719
1719
|
name: i[I],
|
|
1720
|
-
value:
|
|
1720
|
+
value: B[I]
|
|
1721
1721
|
}))
|
|
1722
1722
|
);
|
|
1723
|
-
return { rules:
|
|
1723
|
+
return { rules: $.filter((I) => I.declarations.length), keyframes: b, wrote: f };
|
|
1724
1724
|
}
|
|
1725
|
-
function
|
|
1726
|
-
const s = t.namedEffect &&
|
|
1725
|
+
function ys(e, t, n) {
|
|
1726
|
+
const s = t.namedEffect && We(t.namedEffect.type, !1);
|
|
1727
1727
|
if (!s?.getNames)
|
|
1728
1728
|
return;
|
|
1729
1729
|
const i = (r) => s.getNames({ ...t, suffix: r });
|
|
@@ -1732,281 +1732,281 @@ function gs(e, t, n) {
|
|
|
1732
1732
|
const o = e.keyframeEntries.get(n) || [];
|
|
1733
1733
|
e.keyframeEntries.set(n, [...o, { slotKey: t.slotKey, getNames: i }]);
|
|
1734
1734
|
}
|
|
1735
|
-
function
|
|
1736
|
-
const r =
|
|
1735
|
+
function Ft(e, t, n, s, i, o) {
|
|
1736
|
+
const r = V(t), c = e.targetsMap.get(r) || kt(
|
|
1737
1737
|
t.key,
|
|
1738
|
-
|
|
1738
|
+
W(t, {
|
|
1739
1739
|
asCombinator: !0,
|
|
1740
1740
|
useFirstChild: e.useFirstChild,
|
|
1741
1741
|
addItemFilter: !0
|
|
1742
1742
|
})
|
|
1743
1743
|
);
|
|
1744
1744
|
s.add(r);
|
|
1745
|
-
const l = o?.get(r) ||
|
|
1745
|
+
const l = o?.get(r) || Pe, f = qt(c, l, e.configIndex);
|
|
1746
1746
|
if (e.collectSlots) {
|
|
1747
|
-
|
|
1748
|
-
const h =
|
|
1749
|
-
return
|
|
1747
|
+
ys(c, t, f.animation);
|
|
1748
|
+
const h = Pt(t);
|
|
1749
|
+
return Le(
|
|
1750
1750
|
c,
|
|
1751
1751
|
{ animation: h === "animation", transition: h === "transition", timeline: !1 },
|
|
1752
1752
|
l
|
|
1753
1753
|
), e.targetsMap.set(r, c), [];
|
|
1754
1754
|
}
|
|
1755
1755
|
t.namedEffect && (t.suffix = e.keyframeSlots.get(t.slotKey));
|
|
1756
|
-
const { rules: a, keyframes:
|
|
1756
|
+
const { rules: a, keyframes: u, wrote: d } = vs(
|
|
1757
1757
|
e,
|
|
1758
1758
|
t,
|
|
1759
1759
|
c,
|
|
1760
1760
|
n,
|
|
1761
|
-
|
|
1761
|
+
f,
|
|
1762
1762
|
i
|
|
1763
1763
|
);
|
|
1764
|
-
return
|
|
1764
|
+
return u.forEach(({ name: h, keyframes: p }) => e.keyframesMap.set(h, p)), Le(c, d, l), e.targetsMap.set(r, c), a;
|
|
1765
1765
|
}
|
|
1766
|
-
function
|
|
1767
|
-
const i = [], o = /* @__PURE__ */ new Set(), r =
|
|
1766
|
+
function Es(e, t, n, s) {
|
|
1767
|
+
const i = [], o = /* @__PURE__ */ new Set(), r = ds(t);
|
|
1768
1768
|
i.push(
|
|
1769
1769
|
...t.effects.flatMap(
|
|
1770
|
-
(l) =>
|
|
1770
|
+
(l) => Ft(e, l, n, o, t, r)
|
|
1771
1771
|
)
|
|
1772
1772
|
);
|
|
1773
1773
|
const { conditions: c } = t;
|
|
1774
1774
|
return o.forEach((l) => {
|
|
1775
1775
|
s.add(l);
|
|
1776
|
-
const
|
|
1777
|
-
a && (a.declarations.forEach(({ name:
|
|
1776
|
+
const f = e.targetsMap.get(l), a = as(f, c, e.configConditions, e.configIndex);
|
|
1777
|
+
a && (a.declarations.forEach(({ name: u }) => f.assigned.add(u)), i.push(a)), hs(f);
|
|
1778
1778
|
}), i;
|
|
1779
1779
|
}
|
|
1780
|
-
function
|
|
1781
|
-
const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, c = e.plugins ?
|
|
1780
|
+
function ws(e, t, n) {
|
|
1781
|
+
const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, c = e.plugins ? Lt(
|
|
1782
1782
|
"interaction",
|
|
1783
1783
|
t,
|
|
1784
1784
|
s,
|
|
1785
|
-
|
|
1785
|
+
oe(i, e.configConditions, "media"),
|
|
1786
1786
|
e.plugins
|
|
1787
|
-
) : [], { trigger: l } = t,
|
|
1788
|
-
trigger:
|
|
1789
|
-
id:
|
|
1787
|
+
) : [], { trigger: l } = t, f = {
|
|
1788
|
+
trigger: Xn(l),
|
|
1789
|
+
id: Z("trigger", [n], e.configIndex)
|
|
1790
1790
|
}, a = /* @__PURE__ */ new Set();
|
|
1791
|
-
l === "viewProgress" && c.push(
|
|
1792
|
-
const
|
|
1793
|
-
const
|
|
1791
|
+
l === "viewProgress" && c.push(gs(e, t, f.id, a));
|
|
1792
|
+
const u = o.map((h, p) => {
|
|
1793
|
+
const m = At(
|
|
1794
1794
|
h,
|
|
1795
1795
|
t,
|
|
1796
1796
|
e.config,
|
|
1797
|
-
|
|
1797
|
+
Z("eff", [n, p], e.configIndex)
|
|
1798
1798
|
);
|
|
1799
|
-
return
|
|
1799
|
+
return m && Object.assign(m, { slotKey: ye(n, p) });
|
|
1800
1800
|
}).filter((h) => h !== null);
|
|
1801
1801
|
c.push(
|
|
1802
|
-
...
|
|
1802
|
+
...u.flatMap((h) => Ft(e, h, f, a))
|
|
1803
1803
|
);
|
|
1804
1804
|
const d = r.map(
|
|
1805
|
-
(h,
|
|
1805
|
+
(h, p) => Jn(
|
|
1806
1806
|
h,
|
|
1807
1807
|
t,
|
|
1808
1808
|
e.config,
|
|
1809
|
-
|
|
1810
|
-
(
|
|
1809
|
+
Z("seq", [n, p], e.configIndex),
|
|
1810
|
+
(m) => ye(n, m, p)
|
|
1811
1811
|
)
|
|
1812
1812
|
).filter((h) => h !== null);
|
|
1813
1813
|
return c.push(
|
|
1814
1814
|
...d.flatMap(
|
|
1815
|
-
(h) =>
|
|
1815
|
+
(h) => Es(e, h, f, a)
|
|
1816
1816
|
)
|
|
1817
|
-
), l === "viewProgress" && a.size > 1 && e.scopedTimelines.push(`--${
|
|
1817
|
+
), l === "viewProgress" && a.size > 1 && e.scopedTimelines.push(`--${f.id}`), a.forEach((h) => ms(e.targetsMap.get(h))), c;
|
|
1818
1818
|
}
|
|
1819
|
-
function
|
|
1819
|
+
function $s(e = {}) {
|
|
1820
1820
|
return typeof e == "boolean" ? { useFirstChild: e } : e;
|
|
1821
1821
|
}
|
|
1822
|
-
function
|
|
1822
|
+
function Rt(e, t) {
|
|
1823
1823
|
const { useFirstChild: n = !0, plugins: s, configIndex: i, collectSlots: o = !1 } = t, r = {
|
|
1824
1824
|
config: e,
|
|
1825
1825
|
configConditions: e.conditions || {},
|
|
1826
1826
|
targetsMap: /* @__PURE__ */ new Map(),
|
|
1827
1827
|
keyframesMap: /* @__PURE__ */ new Map(),
|
|
1828
|
-
keyframeSlots: o ? /* @__PURE__ */ new Map() :
|
|
1828
|
+
keyframeSlots: o ? /* @__PURE__ */ new Map() : xt(e, i),
|
|
1829
1829
|
scopedTimelines: [],
|
|
1830
1830
|
collectSlots: o,
|
|
1831
1831
|
useFirstChild: n,
|
|
1832
1832
|
plugins: s,
|
|
1833
1833
|
configIndex: i
|
|
1834
1834
|
}, c = e.interactions.flatMap(
|
|
1835
|
-
(l,
|
|
1835
|
+
(l, f) => ws(r, l, f)
|
|
1836
1836
|
);
|
|
1837
1837
|
return { ctx: r, cssRules: c };
|
|
1838
1838
|
}
|
|
1839
|
-
function
|
|
1839
|
+
function Z(e, t, n) {
|
|
1840
1840
|
return [e, ...n === void 0 ? [] : [`c${n}`], ...t].join("-");
|
|
1841
1841
|
}
|
|
1842
|
-
function
|
|
1842
|
+
function ye(e, t, n) {
|
|
1843
1843
|
return [e, n, t].filter((s) => s !== void 0).join(":");
|
|
1844
1844
|
}
|
|
1845
|
-
function
|
|
1846
|
-
const { ctx: n } =
|
|
1845
|
+
function xt(e, t) {
|
|
1846
|
+
const { ctx: n } = Rt(e, { configIndex: t, collectSlots: !0 }), s = /* @__PURE__ */ new Map(), i = (o) => o ? `-${o}` : void 0;
|
|
1847
1847
|
return n.targetsMap.forEach(({ keyframeEntries: o }) => {
|
|
1848
1848
|
const r = /* @__PURE__ */ new Set();
|
|
1849
1849
|
o.forEach((c) => {
|
|
1850
|
-
const l = (
|
|
1851
|
-
let
|
|
1852
|
-
for (; a.some((
|
|
1853
|
-
a = l(++
|
|
1854
|
-
a.forEach((
|
|
1850
|
+
const l = (u) => c.flatMap(({ getNames: d }) => d(i(u)));
|
|
1851
|
+
let f = 0, a = l(f);
|
|
1852
|
+
for (; a.some((u) => r.has(u)); )
|
|
1853
|
+
a = l(++f);
|
|
1854
|
+
a.forEach((u) => r.add(u)), f && c.forEach(({ slotKey: u }) => s.set(u, i(f)));
|
|
1855
1855
|
});
|
|
1856
1856
|
}), s;
|
|
1857
1857
|
}
|
|
1858
|
-
function
|
|
1859
|
-
const { ctx: n, cssRules: s } =
|
|
1858
|
+
function bs(e, t) {
|
|
1859
|
+
const { ctx: n, cssRules: s } = Rt(e, $s(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)), c = Math.max(0, ...i.map(({ timeline: h }) => h.listIndex)), l = cs(
|
|
1860
1860
|
i.flatMap((h) => [
|
|
1861
1861
|
h,
|
|
1862
|
-
...[...h.partSelectors].map((
|
|
1862
|
+
...[...h.partSelectors].map((p) => ({ key: h.key, childSelector: p }))
|
|
1863
1863
|
]),
|
|
1864
1864
|
o,
|
|
1865
1865
|
r,
|
|
1866
1866
|
c,
|
|
1867
1867
|
n.configIndex
|
|
1868
|
-
),
|
|
1868
|
+
), f = Math.max(0, ...i.map(({ animation: h }) => h.slotCursor)), a = Math.max(
|
|
1869
1869
|
0,
|
|
1870
1870
|
...i.map(({ transition: h }) => h.slotCursor)
|
|
1871
|
-
),
|
|
1871
|
+
), u = rs(
|
|
1872
1872
|
o,
|
|
1873
1873
|
r,
|
|
1874
|
-
|
|
1874
|
+
f,
|
|
1875
1875
|
a,
|
|
1876
1876
|
c,
|
|
1877
1877
|
n.configIndex
|
|
1878
|
-
), d =
|
|
1879
|
-
return { keyframes: n.keyframesMap, atProperty:
|
|
1878
|
+
), d = ls(n.scopedTimelines, n.configIndex);
|
|
1879
|
+
return { keyframes: n.keyframesMap, atProperty: u, cssRules: s, listsRule: l, timelineScopeRule: d };
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1882
|
-
const { cssRules: n, keyframes: s, atProperty: i, listsRule: o, timelineScopeRule: r } =
|
|
1881
|
+
function Hi(e, t) {
|
|
1882
|
+
const { cssRules: n, keyframes: s, atProperty: i, listsRule: o, timelineScopeRule: r } = bs(
|
|
1883
1883
|
e,
|
|
1884
1884
|
t
|
|
1885
1885
|
);
|
|
1886
1886
|
return [
|
|
1887
1887
|
...i,
|
|
1888
|
-
...[...s.entries()].map(([l,
|
|
1889
|
-
...n.map(
|
|
1888
|
+
...[...s.entries()].map(([l, f]) => ss(l, f)),
|
|
1889
|
+
...n.map(is),
|
|
1890
1890
|
o,
|
|
1891
1891
|
r
|
|
1892
1892
|
].filter((l) => l).join(`
|
|
1893
1893
|
`);
|
|
1894
1894
|
}
|
|
1895
|
-
const
|
|
1895
|
+
const Ss = {
|
|
1896
1896
|
root: null,
|
|
1897
1897
|
rootMargin: "0px 0px -10% 0px",
|
|
1898
1898
|
threshold: [0]
|
|
1899
|
-
},
|
|
1899
|
+
}, Is = {
|
|
1900
1900
|
root: null,
|
|
1901
1901
|
rootMargin: "0px",
|
|
1902
1902
|
threshold: [0]
|
|
1903
|
-
},
|
|
1904
|
-
function
|
|
1903
|
+
}, Ts = 0.2;
|
|
1904
|
+
function Cs(e) {
|
|
1905
1905
|
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;
|
|
1906
1906
|
return `${i(n)} 0px ${i(s)}`;
|
|
1907
1907
|
}
|
|
1908
|
-
const
|
|
1909
|
-
let
|
|
1910
|
-
function
|
|
1911
|
-
|
|
1908
|
+
const J = {}, N = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakSet(), U = /* @__PURE__ */ new WeakMap();
|
|
1909
|
+
let Nt = {}, Q = null;
|
|
1910
|
+
function Os(e) {
|
|
1911
|
+
Nt = e;
|
|
1912
1912
|
}
|
|
1913
|
-
function
|
|
1913
|
+
function jt(e, t, n) {
|
|
1914
1914
|
N.get(e)?.forEach(({ source: i, handler: o }) => {
|
|
1915
1915
|
i === e && o(t, n);
|
|
1916
1916
|
});
|
|
1917
1917
|
}
|
|
1918
|
-
function
|
|
1919
|
-
return
|
|
1918
|
+
function et() {
|
|
1919
|
+
return Q || (Q = new IntersectionObserver((e) => {
|
|
1920
1920
|
e.forEach((t) => {
|
|
1921
1921
|
const n = t.target;
|
|
1922
|
-
t.isIntersecting ||
|
|
1922
|
+
t.isIntersecting || jt(n, !1, !0);
|
|
1923
1923
|
});
|
|
1924
|
-
},
|
|
1924
|
+
}, Is), Q);
|
|
1925
1925
|
}
|
|
1926
|
-
function
|
|
1926
|
+
function Dt(e, t = !1) {
|
|
1927
1927
|
const n = JSON.stringify({ ...e, isSafeMode: t });
|
|
1928
|
-
if (
|
|
1929
|
-
return
|
|
1930
|
-
const s = e.threshold ??
|
|
1928
|
+
if (J[n])
|
|
1929
|
+
return J[n];
|
|
1930
|
+
const s = e.threshold ?? Ts, i = t ? Ss : {
|
|
1931
1931
|
root: null,
|
|
1932
|
-
rootMargin: e.inset ?
|
|
1932
|
+
rootMargin: e.inset ? Cs(e.inset) : "0px",
|
|
1933
1933
|
threshold: s
|
|
1934
1934
|
}, o = new IntersectionObserver((r) => {
|
|
1935
1935
|
r.forEach((c) => {
|
|
1936
|
-
const l = c.target,
|
|
1937
|
-
if (
|
|
1936
|
+
const l = c.target, f = !Ee.has(l);
|
|
1937
|
+
if (f && (Ee.add(l), e.useSafeViewEnter && !c.isIntersecting)) {
|
|
1938
1938
|
A.measure(() => {
|
|
1939
|
-
const a = c.boundingClientRect.height,
|
|
1940
|
-
if (!
|
|
1939
|
+
const a = c.boundingClientRect.height, u = c.rootBounds?.height;
|
|
1940
|
+
if (!u)
|
|
1941
1941
|
return;
|
|
1942
1942
|
const d = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
|
|
1943
|
-
d && a * d >
|
|
1943
|
+
d && a * d > u && A.mutate(() => {
|
|
1944
1944
|
o.unobserve(l);
|
|
1945
|
-
const
|
|
1946
|
-
|
|
1945
|
+
const p = Dt(e, !0);
|
|
1946
|
+
U.set(l, p), p.observe(l);
|
|
1947
1947
|
});
|
|
1948
1948
|
});
|
|
1949
1949
|
return;
|
|
1950
1950
|
}
|
|
1951
|
-
(c.isIntersecting || !
|
|
1951
|
+
(c.isIntersecting || !f) && jt(l, c.isIntersecting);
|
|
1952
1952
|
});
|
|
1953
1953
|
}, i);
|
|
1954
|
-
return
|
|
1954
|
+
return J[n] = o, o;
|
|
1955
1955
|
}
|
|
1956
|
-
function
|
|
1957
|
-
const c = { ...
|
|
1956
|
+
function _s(e, t, n, s = {}, { reducedMotion: i, selectorCondition: o, animation: r } = {}) {
|
|
1957
|
+
const c = { ...Nt, ...s }, l = n.triggerType || "once", f = r || ie(
|
|
1958
1958
|
t,
|
|
1959
1959
|
x(n),
|
|
1960
1960
|
void 0,
|
|
1961
1961
|
i
|
|
1962
1962
|
);
|
|
1963
|
-
if (!
|
|
1963
|
+
if (!f)
|
|
1964
1964
|
return;
|
|
1965
|
-
const a =
|
|
1966
|
-
l !== "once" &&
|
|
1967
|
-
let
|
|
1965
|
+
const a = Dt(c);
|
|
1966
|
+
l !== "once" && f.persist?.();
|
|
1967
|
+
let u = !0, d = !1, h;
|
|
1968
1968
|
h = { source: e, target: t, handler: (g, E) => {
|
|
1969
1969
|
if (!(o && !t.matches(o)))
|
|
1970
1970
|
if (l === "once") {
|
|
1971
1971
|
if (g && !d) {
|
|
1972
1972
|
d = !0;
|
|
1973
1973
|
const y = N.get(e);
|
|
1974
|
-
(!y || y.size === 0 || y.size === 1 && y.has(h)) && ((
|
|
1974
|
+
(!y || y.size === 0 || y.size === 1 && y.has(h)) && ((U.get(e) || a).unobserve(e), Ee.delete(e)), f.onFinish(() => {
|
|
1975
1975
|
N.get(e)?.delete(h), N.get(t)?.delete(h);
|
|
1976
|
-
}),
|
|
1976
|
+
}), f.play(() => {
|
|
1977
1977
|
const v = () => {
|
|
1978
1978
|
t.dataset.interactEnter = "start";
|
|
1979
|
-
},
|
|
1979
|
+
}, $ = () => {
|
|
1980
1980
|
A.mutate(() => {
|
|
1981
1981
|
t.dataset.interactEnter = "done";
|
|
1982
1982
|
});
|
|
1983
1983
|
};
|
|
1984
|
-
|
|
1984
|
+
f.isCSS ? (A.mutate(() => {
|
|
1985
1985
|
requestAnimationFrame(v);
|
|
1986
|
-
}),
|
|
1986
|
+
}), f.onFinish($), f.onAbort($)) : (A.mutate(v), f.onFinish($));
|
|
1987
1987
|
});
|
|
1988
1988
|
}
|
|
1989
|
-
} else l === "alternate" ?
|
|
1989
|
+
} else l === "alternate" ? u && g ? (u = !1, f.play()) : u || f.reverse() : l === "repeat" ? g ? (f.progress(0), f.play()) : E && (f.pause(), f.progress(0)) : l === "state" && (g ? f.play() : E && f.pause());
|
|
1990
1990
|
}, cleanup: () => {
|
|
1991
|
-
(
|
|
1992
|
-
} },
|
|
1991
|
+
(U.get(e) || a).unobserve(e), (l === "repeat" || l === "state") && et().unobserve(e), f.cancel(), Ee.delete(e), U.delete(e);
|
|
1992
|
+
} }, q(N, e, h), q(N, t, h), U.set(e, a), a.observe(e), (l === "repeat" || l === "state") && et().observe(e);
|
|
1993
1993
|
}
|
|
1994
|
-
function
|
|
1995
|
-
|
|
1994
|
+
function As(e) {
|
|
1995
|
+
re(N, e);
|
|
1996
1996
|
}
|
|
1997
|
-
function
|
|
1998
|
-
|
|
1997
|
+
function Ms() {
|
|
1998
|
+
Q = null, Object.keys(J).forEach((e) => delete J[e]);
|
|
1999
1999
|
}
|
|
2000
|
-
const
|
|
2001
|
-
add:
|
|
2002
|
-
remove:
|
|
2003
|
-
setOptions:
|
|
2004
|
-
reset:
|
|
2000
|
+
const ks = {
|
|
2001
|
+
add: _s,
|
|
2002
|
+
remove: As,
|
|
2003
|
+
setOptions: Os,
|
|
2004
|
+
reset: Ms
|
|
2005
2005
|
};
|
|
2006
|
-
function
|
|
2006
|
+
function zt(e, t) {
|
|
2007
2007
|
return Object.assign(Object.create(t), e);
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2009
|
+
function qs(e, t, n, s) {
|
|
2010
2010
|
let i = e * (1 - n) + t * n;
|
|
2011
2011
|
if (s) {
|
|
2012
2012
|
const o = i - e;
|
|
@@ -2017,7 +2017,7 @@ function Ms(e, t, n, s) {
|
|
|
2017
2017
|
}
|
|
2018
2018
|
return i;
|
|
2019
2019
|
}
|
|
2020
|
-
function
|
|
2020
|
+
function Ps(e) {
|
|
2021
2021
|
let t = !1;
|
|
2022
2022
|
return function() {
|
|
2023
2023
|
t || (t = !0, window.requestAnimationFrame(() => {
|
|
@@ -2025,7 +2025,7 @@ function ks(e) {
|
|
|
2025
2025
|
}));
|
|
2026
2026
|
};
|
|
2027
2027
|
}
|
|
2028
|
-
function
|
|
2028
|
+
function tt(e, t) {
|
|
2029
2029
|
let n = 0;
|
|
2030
2030
|
return function() {
|
|
2031
2031
|
n && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
@@ -2033,103 +2033,103 @@ function Je(e, t) {
|
|
|
2033
2033
|
}, t);
|
|
2034
2034
|
};
|
|
2035
2035
|
}
|
|
2036
|
-
function
|
|
2036
|
+
function Ls(e, t) {
|
|
2037
2037
|
const n = e.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);
|
|
2038
|
-
return
|
|
2038
|
+
return we(n[1], t) + we(n[6], t);
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2041
|
-
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) ?
|
|
2040
|
+
function we(e, t) {
|
|
2041
|
+
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) ? Ls(e, t) : parseInt(e) || 0 : 0;
|
|
2042
2042
|
}
|
|
2043
2043
|
function z(e, t, n) {
|
|
2044
2044
|
const { name: s, offset: i = 0 } = e, { start: o, end: r } = n, c = r - o, l = i / 100;
|
|
2045
|
-
let
|
|
2046
|
-
return s === "entry" ? (
|
|
2045
|
+
let f, a;
|
|
2046
|
+
return s === "entry" ? (f = o - t, a = Math.min(t, c)) : s === "entry-crossing" ? (f = o - t, a = c) : s === "contain" ? (f = Math.min(r - t, o), a = Math.abs(t - c)) : s === "exit" ? (f = Math.max(o, r - t), a = Math.min(t, c)) : s === "exit-crossing" ? (f = o, a = c) : s === "cover" && (f = o - t, a = c + t), f + l * a | 0;
|
|
2047
2047
|
}
|
|
2048
|
-
function
|
|
2048
|
+
function _e(e, t, n, s, i) {
|
|
2049
2049
|
let o = 0;
|
|
2050
2050
|
const r = { start: t, end: n };
|
|
2051
2051
|
return e.forEach((c, l) => {
|
|
2052
2052
|
o += c.offset;
|
|
2053
|
-
const
|
|
2054
|
-
if (
|
|
2055
|
-
if ("end" in
|
|
2056
|
-
const d = ((i ? c.element.offsetWidth : c.element.offsetHeight) || 0) +
|
|
2053
|
+
const f = c.sticky;
|
|
2054
|
+
if (f) {
|
|
2055
|
+
if ("end" in f && e[l - 1]?.element) {
|
|
2056
|
+
const d = ((i ? c.element.offsetWidth : c.element.offsetHeight) || 0) + f.end - s, h = o + d - c.offset, p = h < r.start, m = !p && h <= n;
|
|
2057
2057
|
let g = 0;
|
|
2058
|
-
(
|
|
2058
|
+
(p || m) && (g = c.offset, r.end += g), p && (r.start += g);
|
|
2059
2059
|
}
|
|
2060
|
-
if ("start" in
|
|
2061
|
-
const a = o -
|
|
2060
|
+
if ("start" in f) {
|
|
2061
|
+
const a = o - f.start, u = a < r.start, d = !u && a <= r.end;
|
|
2062
2062
|
let h = 0;
|
|
2063
|
-
const
|
|
2064
|
-
if (
|
|
2065
|
-
if (
|
|
2066
|
-
const
|
|
2067
|
-
h =
|
|
2063
|
+
const p = e[l - 1]?.element;
|
|
2064
|
+
if (p) {
|
|
2065
|
+
if (u || d) {
|
|
2066
|
+
const m = (i ? p.offsetWidth : p.offsetHeight) || 0, g = c.offset, E = (i ? c.element.offsetWidth : c.element.offsetHeight) || 0;
|
|
2067
|
+
h = m - (g + E), o += h, r.end += h;
|
|
2068
2068
|
}
|
|
2069
|
-
|
|
2069
|
+
u && (r.start += h);
|
|
2070
2070
|
}
|
|
2071
2071
|
}
|
|
2072
2072
|
}
|
|
2073
2073
|
}), r;
|
|
2074
2074
|
}
|
|
2075
|
-
function
|
|
2075
|
+
function Fs(e, t, n, s, i, o) {
|
|
2076
2076
|
const { start: r, end: c, duration: l } = e;
|
|
2077
|
-
let
|
|
2077
|
+
let f = r, a = c, u = e.startRange, d = e.endRange, h;
|
|
2078
2078
|
if (typeof l == "string") {
|
|
2079
|
-
|
|
2080
|
-
const
|
|
2081
|
-
|
|
2079
|
+
u = { name: l, offset: 0 }, d = { name: l, offset: 100 }, f = z(u, n, t), a = z(d, n, t), h = a - f;
|
|
2080
|
+
const p = _e(o, f, a, n, s);
|
|
2081
|
+
f = p.start, a = p.end;
|
|
2082
2082
|
} else {
|
|
2083
|
-
if (
|
|
2084
|
-
|
|
2085
|
-
const
|
|
2086
|
-
|
|
2083
|
+
if (u || r?.name) {
|
|
2084
|
+
u = u || r;
|
|
2085
|
+
const p = we(u.add, i), m = z({ ...u, offset: 0 }, n, t), g = z({ ...u, offset: 100 }, n, t), E = _e(o, m, g, n, s);
|
|
2086
|
+
f = E.start + u.offset / 100 * (E.end - E.start) + p;
|
|
2087
2087
|
}
|
|
2088
2088
|
if (d || c?.name) {
|
|
2089
2089
|
d = d || c;
|
|
2090
|
-
const
|
|
2091
|
-
a = E.start + d.offset / 100 * (E.end - E.start) +
|
|
2092
|
-
} else typeof l == "number" && (a =
|
|
2090
|
+
const p = we(d.add, i), m = z({ ...d, offset: 0 }, n, t), g = z({ ...d, offset: 100 }, n, t), E = _e(o, m, g, n, s);
|
|
2091
|
+
a = E.start + d.offset / 100 * (E.end - E.start) + p;
|
|
2092
|
+
} else typeof l == "number" && (a = f + l);
|
|
2093
2093
|
}
|
|
2094
|
-
return !h && !l && (h = a -
|
|
2094
|
+
return !h && !l && (h = a - f), { ...e, start: f, end: a, startRange: u, endRange: d, duration: h || l };
|
|
2095
2095
|
}
|
|
2096
|
-
function
|
|
2096
|
+
function Rs(e) {
|
|
2097
2097
|
return e.position === "sticky";
|
|
2098
2098
|
}
|
|
2099
|
-
function
|
|
2099
|
+
function xs(e, t, n) {
|
|
2100
2100
|
return e.position === "fixed" && (!t || t === window.document.body || t === n);
|
|
2101
2101
|
}
|
|
2102
|
-
function
|
|
2102
|
+
function Ns(e, t) {
|
|
2103
2103
|
return parseInt(t ? e.left : e.top);
|
|
2104
2104
|
}
|
|
2105
|
-
function
|
|
2105
|
+
function js(e, t) {
|
|
2106
2106
|
return parseInt(t ? e.right : e.bottom);
|
|
2107
2107
|
}
|
|
2108
|
-
function
|
|
2108
|
+
function Ds(e, t, n) {
|
|
2109
2109
|
n && (e.style.position = "static");
|
|
2110
2110
|
const s = (t ? e.offsetLeft : e.offsetTop) || 0;
|
|
2111
2111
|
return n && (e.style.position = null), s;
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2113
|
+
function zs(e, t) {
|
|
2114
2114
|
let n;
|
|
2115
|
-
const s =
|
|
2115
|
+
const s = Ns(e, t), i = js(e, t), o = !isNaN(s), r = !isNaN(i);
|
|
2116
2116
|
return (o || r) && (n = {}, o && (n.start = s), r && (n.end = i)), n;
|
|
2117
2117
|
}
|
|
2118
|
-
function
|
|
2118
|
+
function le(e, t, n, s, i) {
|
|
2119
2119
|
const o = e[0].viewSource, r = [];
|
|
2120
|
-
let c = (s ? o.offsetWidth : o.offsetHeight) || 0, l = 0,
|
|
2121
|
-
for (;
|
|
2122
|
-
const
|
|
2123
|
-
if ((!h || !("end" in h)) && (l +=
|
|
2120
|
+
let c = (s ? o.offsetWidth : o.offsetHeight) || 0, l = 0, f = o;
|
|
2121
|
+
for (; f; ) {
|
|
2122
|
+
const u = window.getComputedStyle(f), d = Rs(u), h = d ? zs(u, s) : void 0, p = Ds(f, s, d);
|
|
2123
|
+
if ((!h || !("end" in h)) && (l += p), r.push({ element: f, offset: p, sticky: h }), f = f.offsetParent, xs(u, f, t))
|
|
2124
2124
|
break;
|
|
2125
|
-
if (
|
|
2126
|
-
r.push({ element:
|
|
2125
|
+
if (f === t) {
|
|
2126
|
+
r.push({ element: f, offset: 0 });
|
|
2127
2127
|
break;
|
|
2128
2128
|
}
|
|
2129
2129
|
}
|
|
2130
|
-
return r.reverse(), e.map((
|
|
2131
|
-
...
|
|
2132
|
-
|
|
2130
|
+
return r.reverse(), e.map((u) => ({
|
|
2131
|
+
...Fs(
|
|
2132
|
+
u,
|
|
2133
2133
|
{ start: l, end: l + c },
|
|
2134
2134
|
n,
|
|
2135
2135
|
s,
|
|
@@ -2138,7 +2138,7 @@ function ce(e, t, n, s, i) {
|
|
|
2138
2138
|
)
|
|
2139
2139
|
}));
|
|
2140
2140
|
}
|
|
2141
|
-
const
|
|
2141
|
+
const nt = 100, Hs = {
|
|
2142
2142
|
horizontal: !1,
|
|
2143
2143
|
observeViewportEntry: !0,
|
|
2144
2144
|
viewportRootMargin: "7% 7%",
|
|
@@ -2146,72 +2146,72 @@ const et = 100, zs = {
|
|
|
2146
2146
|
observeSourcesResize: !1,
|
|
2147
2147
|
observeContentResize: !1
|
|
2148
2148
|
};
|
|
2149
|
-
function
|
|
2149
|
+
function Gs(e, t, n, s) {
|
|
2150
2150
|
let i = 0;
|
|
2151
2151
|
return e >= t && e <= n ? i = s ? (e - t) / s : 1 : e > n && (i = 1), i;
|
|
2152
2152
|
}
|
|
2153
|
-
function
|
|
2153
|
+
function st(e, t) {
|
|
2154
2154
|
return e === window ? t ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : t ? e.clientWidth : e.clientHeight;
|
|
2155
2155
|
}
|
|
2156
|
-
function
|
|
2156
|
+
function Ws() {
|
|
2157
2157
|
return {
|
|
2158
2158
|
viewportWidth: window.document.documentElement.clientWidth,
|
|
2159
2159
|
viewportHeight: window.document.documentElement.clientHeight
|
|
2160
2160
|
};
|
|
2161
2161
|
}
|
|
2162
|
-
function
|
|
2163
|
-
const t =
|
|
2164
|
-
let o =
|
|
2165
|
-
const
|
|
2162
|
+
function Vs(e) {
|
|
2163
|
+
const t = zt(e, Hs), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
|
|
2164
|
+
let o = st(n, s), r, c, l, f, a;
|
|
2165
|
+
const u = [], d = Ws();
|
|
2166
2166
|
if (t.scenes = Object.values(
|
|
2167
2167
|
// TODO(ameerf): find a polyfill and use groupBy instead of following reduce
|
|
2168
2168
|
e.scenes.reduce(
|
|
2169
|
-
(
|
|
2169
|
+
(m, g, E) => {
|
|
2170
2170
|
const y = g.groupId ? `group-${g.groupId}` : String(E);
|
|
2171
|
-
return
|
|
2171
|
+
return m[y] ? m[y].push(g) : m[y] = [g], m;
|
|
2172
2172
|
},
|
|
2173
2173
|
{}
|
|
2174
2174
|
)
|
|
2175
|
-
).flatMap((
|
|
2175
|
+
).flatMap((m) => (m.every((g) => g.viewSource && (typeof g.duration == "string" || g.start?.name)) ? (m = le(m, n, o, s, d), (t.observeSourcesResize || t.observeContentResize) && u.push(m)) : m.forEach((g) => {
|
|
2176
2176
|
g.end == null && (g.end = g.start + g.duration), g.duration == null && (g.duration = g.end - g.start);
|
|
2177
|
-
}),
|
|
2178
|
-
|
|
2179
|
-
}),
|
|
2180
|
-
const
|
|
2177
|
+
}), m)), t.scenes.forEach((m, g) => {
|
|
2178
|
+
m.index = g;
|
|
2179
|
+
}), u.length) {
|
|
2180
|
+
const m = /* @__PURE__ */ new Map();
|
|
2181
2181
|
window.ResizeObserver && (l = new window.ResizeObserver(function(g) {
|
|
2182
2182
|
g.forEach((E) => {
|
|
2183
|
-
const y =
|
|
2184
|
-
v.forEach((
|
|
2185
|
-
t.scenes[
|
|
2186
|
-
}),
|
|
2183
|
+
const y = m.get(E.target), v = le(y, n, o, s, d);
|
|
2184
|
+
v.forEach(($, b) => {
|
|
2185
|
+
t.scenes[$.index] = v[b];
|
|
2186
|
+
}), u.splice(u.indexOf(y), 1, v);
|
|
2187
2187
|
});
|
|
2188
|
-
}),
|
|
2189
|
-
l.observe(g[0].viewSource, { box: "border-box" }),
|
|
2190
|
-
}), t.observeContentResize && t.contentRoot && new window.ResizeObserver(
|
|
2191
|
-
const E =
|
|
2192
|
-
const v =
|
|
2193
|
-
return v.forEach((
|
|
2194
|
-
t.scenes[
|
|
2188
|
+
}), u.forEach((g) => {
|
|
2189
|
+
l.observe(g[0].viewSource, { box: "border-box" }), m.set(g[0].viewSource, g);
|
|
2190
|
+
}), t.observeContentResize && t.contentRoot && new window.ResizeObserver(tt(() => {
|
|
2191
|
+
const E = u.map((y) => {
|
|
2192
|
+
const v = le(y, n, o, s, d);
|
|
2193
|
+
return v.forEach(($, b) => {
|
|
2194
|
+
t.scenes[$.index] = v[b];
|
|
2195
2195
|
}), v;
|
|
2196
2196
|
});
|
|
2197
|
-
|
|
2198
|
-
|
|
2197
|
+
u.length = 0, u.push(...E), u.forEach((y) => {
|
|
2198
|
+
m.set(y[0].viewSource, y);
|
|
2199
2199
|
});
|
|
2200
|
-
},
|
|
2201
|
-
o =
|
|
2202
|
-
const g =
|
|
2203
|
-
const y =
|
|
2204
|
-
return y.forEach((v,
|
|
2205
|
-
t.scenes[v.index] = y[
|
|
2200
|
+
}, nt)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (f = tt(function() {
|
|
2201
|
+
o = st(n, s);
|
|
2202
|
+
const g = u.map((E) => {
|
|
2203
|
+
const y = le(E, n, o, s, d);
|
|
2204
|
+
return y.forEach((v, $) => {
|
|
2205
|
+
t.scenes[v.index] = y[$];
|
|
2206
2206
|
}), y;
|
|
2207
2207
|
});
|
|
2208
|
-
|
|
2209
|
-
|
|
2208
|
+
u.length = 0, u.push(...g), u.forEach((E) => {
|
|
2209
|
+
m.set(E[0].viewSource, E);
|
|
2210
2210
|
});
|
|
2211
|
-
},
|
|
2211
|
+
}, nt), n === window ? window.addEventListener("resize", f) : window.ResizeObserver && (a = new window.ResizeObserver(f), a.observe(n, { box: "border-box" })));
|
|
2212
2212
|
}
|
|
2213
|
-
t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(
|
|
2214
|
-
|
|
2213
|
+
t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(m) {
|
|
2214
|
+
m.forEach((g) => {
|
|
2215
2215
|
(i.get(g.target) || []).forEach((E) => {
|
|
2216
2216
|
E.disabled = !g.isIntersecting;
|
|
2217
2217
|
});
|
|
@@ -2220,42 +2220,42 @@ function Gs(e) {
|
|
|
2220
2220
|
root: n === window ? window.document : n,
|
|
2221
2221
|
rootMargin: t.viewportRootMargin,
|
|
2222
2222
|
threshold: 0
|
|
2223
|
-
}), t.scenes.forEach((
|
|
2224
|
-
if (
|
|
2225
|
-
let g = i.get(
|
|
2226
|
-
g || (g = [], i.set(
|
|
2223
|
+
}), t.scenes.forEach((m) => {
|
|
2224
|
+
if (m.viewSource) {
|
|
2225
|
+
let g = i.get(m.viewSource);
|
|
2226
|
+
g || (g = [], i.set(m.viewSource, g), c.observe(m.viewSource)), g.push(m);
|
|
2227
2227
|
}
|
|
2228
2228
|
}));
|
|
2229
|
-
function h({ p, vp: g }) {
|
|
2230
|
-
|
|
2229
|
+
function h({ p: m, vp: g }) {
|
|
2230
|
+
m = +m.toFixed(1);
|
|
2231
2231
|
const E = +g.toFixed(4);
|
|
2232
|
-
if (
|
|
2232
|
+
if (m !== r) {
|
|
2233
2233
|
for (let y of t.scenes)
|
|
2234
2234
|
if (!y.disabled) {
|
|
2235
|
-
const { start: v, end:
|
|
2235
|
+
const { start: v, end: $, duration: b } = y, S = Gs(m, v, $, b);
|
|
2236
2236
|
y.effect(y, S, E);
|
|
2237
2237
|
}
|
|
2238
|
-
r =
|
|
2238
|
+
r = m;
|
|
2239
2239
|
}
|
|
2240
2240
|
}
|
|
2241
|
-
function
|
|
2242
|
-
t.scenes.forEach((
|
|
2241
|
+
function p() {
|
|
2242
|
+
t.scenes.forEach((m) => m.destroy?.()), c && (c.disconnect(), c = null), l && (l.disconnect(), l = null), f && (a ? (a.disconnect(), a = null) : window.removeEventListener("resize", f));
|
|
2243
2243
|
}
|
|
2244
2244
|
return {
|
|
2245
2245
|
tick: h,
|
|
2246
|
-
destroy:
|
|
2246
|
+
destroy: p
|
|
2247
2247
|
};
|
|
2248
2248
|
}
|
|
2249
|
-
const
|
|
2249
|
+
const Ks = {
|
|
2250
2250
|
transitionActive: !1,
|
|
2251
2251
|
transitionFriction: 0.9,
|
|
2252
2252
|
transitionEpsilon: 1,
|
|
2253
2253
|
velocityActive: !1,
|
|
2254
2254
|
velocityMax: 1
|
|
2255
2255
|
};
|
|
2256
|
-
class
|
|
2256
|
+
class Ys {
|
|
2257
2257
|
constructor(t = {}) {
|
|
2258
|
-
this.config =
|
|
2258
|
+
this.config = zt(t, Ks), this.progress = {
|
|
2259
2259
|
p: 0,
|
|
2260
2260
|
prevP: 0,
|
|
2261
2261
|
vp: 0
|
|
@@ -2268,7 +2268,7 @@ class Vs {
|
|
|
2268
2268
|
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 || (() => {
|
|
2269
2269
|
const s = this.config.root;
|
|
2270
2270
|
this.progress.p = this.config.horizontal ? s.scrollX || s.scrollLeft || 0 : s.scrollY || s.scrollTop || 0;
|
|
2271
|
-
}), this._trigger =
|
|
2271
|
+
}), this._trigger = Ps(() => {
|
|
2272
2272
|
this._measure?.(), this.tick(!0);
|
|
2273
2273
|
});
|
|
2274
2274
|
}
|
|
@@ -2314,7 +2314,7 @@ class Vs {
|
|
|
2314
2314
|
* Calculate current progress.
|
|
2315
2315
|
*/
|
|
2316
2316
|
lerp() {
|
|
2317
|
-
this.currentProgress.p =
|
|
2317
|
+
this.currentProgress.p = qs(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
|
|
2318
2318
|
}
|
|
2319
2319
|
/**
|
|
2320
2320
|
* Stop the event and effect, and remove all DOM side-effects.
|
|
@@ -2338,7 +2338,7 @@ class Vs {
|
|
|
2338
2338
|
* Reset registered effect.
|
|
2339
2339
|
*/
|
|
2340
2340
|
setupEffect() {
|
|
2341
|
-
this.removeEffect(), this.effect =
|
|
2341
|
+
this.removeEffect(), this.effect = Vs(this.config);
|
|
2342
2342
|
}
|
|
2343
2343
|
/**
|
|
2344
2344
|
* Remove registered effect.
|
|
@@ -2347,12 +2347,12 @@ class Vs {
|
|
|
2347
2347
|
this.effect && this.effect.destroy(), this.effect = null;
|
|
2348
2348
|
}
|
|
2349
2349
|
}
|
|
2350
|
-
const
|
|
2351
|
-
let
|
|
2352
|
-
function
|
|
2353
|
-
|
|
2350
|
+
const Fe = /* @__PURE__ */ new WeakMap();
|
|
2351
|
+
let Ht = () => ({});
|
|
2352
|
+
function Bs(e) {
|
|
2353
|
+
Ht = e;
|
|
2354
2354
|
}
|
|
2355
|
-
function
|
|
2355
|
+
function Us(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
|
|
2356
2356
|
if (i || o && !t.matches(o)) return;
|
|
2357
2357
|
const r = {
|
|
2358
2358
|
trigger: "view-progress",
|
|
@@ -2360,7 +2360,7 @@ function Ys(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
|
|
|
2360
2360
|
}, c = x(n);
|
|
2361
2361
|
let l;
|
|
2362
2362
|
if ("ViewTimeline" in window) {
|
|
2363
|
-
const a =
|
|
2363
|
+
const a = ie(
|
|
2364
2364
|
t,
|
|
2365
2365
|
c,
|
|
2366
2366
|
r
|
|
@@ -2371,20 +2371,20 @@ function Ys(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
|
|
|
2371
2371
|
});
|
|
2372
2372
|
});
|
|
2373
2373
|
} else {
|
|
2374
|
-
const a =
|
|
2374
|
+
const a = It(t, c, r);
|
|
2375
2375
|
if (a) {
|
|
2376
|
-
const
|
|
2376
|
+
const u = Array.isArray(a) ? a : [a], d = new Ys({
|
|
2377
2377
|
viewSource: e,
|
|
2378
|
-
scenes:
|
|
2378
|
+
scenes: u,
|
|
2379
2379
|
observeViewportEntry: !1,
|
|
2380
2380
|
observeViewportResize: !1,
|
|
2381
2381
|
observeSourcesResize: !0,
|
|
2382
2382
|
root: document.body,
|
|
2383
|
-
...
|
|
2383
|
+
...Ht()
|
|
2384
2384
|
});
|
|
2385
2385
|
l = () => {
|
|
2386
2386
|
d.destroy();
|
|
2387
|
-
}, Promise.all(
|
|
2387
|
+
}, Promise.all(u.map((h) => h.ready || Promise.resolve())).then(
|
|
2388
2388
|
() => {
|
|
2389
2389
|
d.start();
|
|
2390
2390
|
}
|
|
@@ -2392,21 +2392,21 @@ function Ys(e, t, n, s, { reducedMotion: i, selectorCondition: o }) {
|
|
|
2392
2392
|
}
|
|
2393
2393
|
}
|
|
2394
2394
|
if (!l) return;
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2395
|
+
const f = { source: e, target: t, cleanup: l };
|
|
2396
|
+
q(Fe, e, f), q(Fe, t, f);
|
|
2397
2397
|
}
|
|
2398
|
-
function
|
|
2399
|
-
|
|
2398
|
+
function Qs(e) {
|
|
2399
|
+
re(Fe, e);
|
|
2400
2400
|
}
|
|
2401
|
-
const
|
|
2402
|
-
add:
|
|
2403
|
-
remove:
|
|
2404
|
-
registerOptionsGetter:
|
|
2401
|
+
const Xs = {
|
|
2402
|
+
add: Us,
|
|
2403
|
+
remove: Qs,
|
|
2404
|
+
registerOptionsGetter: Bs
|
|
2405
2405
|
};
|
|
2406
|
-
function
|
|
2406
|
+
function it(e, t, n) {
|
|
2407
2407
|
return Math.min(Math.max(e, n), t);
|
|
2408
2408
|
}
|
|
2409
|
-
function
|
|
2409
|
+
function ot(e) {
|
|
2410
2410
|
let t = !1;
|
|
2411
2411
|
return function() {
|
|
2412
2412
|
if (!t)
|
|
@@ -2415,7 +2415,7 @@ function st(e) {
|
|
|
2415
2415
|
});
|
|
2416
2416
|
};
|
|
2417
2417
|
}
|
|
2418
|
-
function
|
|
2418
|
+
function Zs(e) {
|
|
2419
2419
|
let t = e, n = 0, s = 0;
|
|
2420
2420
|
if (t.offsetParent)
|
|
2421
2421
|
do
|
|
@@ -2428,7 +2428,7 @@ function Qs(e) {
|
|
|
2428
2428
|
height: e.offsetHeight
|
|
2429
2429
|
};
|
|
2430
2430
|
}
|
|
2431
|
-
function
|
|
2431
|
+
function Js() {
|
|
2432
2432
|
const e = window.devicePixelRatio;
|
|
2433
2433
|
let t = !1;
|
|
2434
2434
|
if (e === 1)
|
|
@@ -2441,7 +2441,7 @@ function Xs() {
|
|
|
2441
2441
|
});
|
|
2442
2442
|
return document.body.dispatchEvent(n), t;
|
|
2443
2443
|
}
|
|
2444
|
-
function
|
|
2444
|
+
function ei() {
|
|
2445
2445
|
return new Promise((e) => {
|
|
2446
2446
|
const t = window.scrollY;
|
|
2447
2447
|
let n = !1, s;
|
|
@@ -2460,42 +2460,42 @@ function Zs() {
|
|
|
2460
2460
|
i(), window.addEventListener("scroll", o), window.scrollY > 0 && window.scrollBy(0, -1);
|
|
2461
2461
|
});
|
|
2462
2462
|
}
|
|
2463
|
-
function
|
|
2464
|
-
|
|
2463
|
+
function ti(e) {
|
|
2464
|
+
ei().then((t) => {
|
|
2465
2465
|
e.fixRequired = t, t && (window.addEventListener("scroll", e.scrollHandler), e.scrollHandler());
|
|
2466
2466
|
});
|
|
2467
2467
|
}
|
|
2468
|
-
let
|
|
2469
|
-
const
|
|
2470
|
-
function
|
|
2468
|
+
let fe = 0;
|
|
2469
|
+
const ge = /* @__PURE__ */ new Set();
|
|
2470
|
+
function ni() {
|
|
2471
2471
|
const e = (n) => {
|
|
2472
2472
|
for (let s of n.changedTouches)
|
|
2473
|
-
|
|
2473
|
+
ge.add(s.identifier);
|
|
2474
2474
|
}, t = (n) => {
|
|
2475
2475
|
for (let s of n.changedTouches)
|
|
2476
|
-
|
|
2476
|
+
ge.delete(s.identifier);
|
|
2477
2477
|
};
|
|
2478
2478
|
return document.addEventListener("touchstart", e, { passive: !0 }), document.addEventListener("touchend", t, { passive: !0 }), function() {
|
|
2479
|
-
|
|
2479
|
+
ge.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
|
|
2480
2480
|
};
|
|
2481
2481
|
}
|
|
2482
|
-
function
|
|
2482
|
+
function si(e, t) {
|
|
2483
2483
|
if ("onscrollend" in window)
|
|
2484
2484
|
return e.addEventListener("scrollend", t), function() {
|
|
2485
2485
|
e.removeEventListener("scrollend", t);
|
|
2486
2486
|
};
|
|
2487
2487
|
let n = 0, s;
|
|
2488
|
-
|
|
2488
|
+
fe || (s = ni()), fe += 1;
|
|
2489
2489
|
function i(o) {
|
|
2490
2490
|
clearTimeout(n), n = setTimeout(() => {
|
|
2491
|
-
|
|
2491
|
+
ge.size ? setTimeout(i, 100) : (t(o), n = 0);
|
|
2492
2492
|
}, 100);
|
|
2493
2493
|
}
|
|
2494
2494
|
return e.addEventListener("scroll", i), function() {
|
|
2495
|
-
e.removeEventListener("scroll", i),
|
|
2495
|
+
e.removeEventListener("scroll", i), fe -= 1, fe || s();
|
|
2496
2496
|
};
|
|
2497
2497
|
}
|
|
2498
|
-
function
|
|
2498
|
+
function ii(e, t, n) {
|
|
2499
2499
|
return {
|
|
2500
2500
|
x(s) {
|
|
2501
2501
|
const i = e.left - n.x + e.width / 2, o = i >= t.width / 2, r = (o ? i : t.width - i) * 2, c = o ? 0 : i - r / 2;
|
|
@@ -2507,13 +2507,13 @@ function ni(e, t, n) {
|
|
|
2507
2507
|
}
|
|
2508
2508
|
};
|
|
2509
2509
|
}
|
|
2510
|
-
function
|
|
2510
|
+
function oi(e, t) {
|
|
2511
2511
|
this.x = window.scrollX, this.y = window.scrollY, requestAnimationFrame(() => e && e(t));
|
|
2512
2512
|
}
|
|
2513
|
-
function
|
|
2513
|
+
function ri(e) {
|
|
2514
2514
|
e.rect.width = window.document.documentElement.clientWidth, e.rect.height = window.document.documentElement.clientHeight;
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2516
|
+
function ai(e) {
|
|
2517
2517
|
const t = new ResizeObserver((n) => {
|
|
2518
2518
|
n.forEach((s) => {
|
|
2519
2519
|
e.rect.width = s.borderBoxSize[0].inlineSize, e.rect.height = s.borderBoxSize[0].blockSize;
|
|
@@ -2521,38 +2521,38 @@ function oi(e) {
|
|
|
2521
2521
|
});
|
|
2522
2522
|
return t.observe(e.root, { box: "border-box" }), t;
|
|
2523
2523
|
}
|
|
2524
|
-
function
|
|
2524
|
+
function ci(e) {
|
|
2525
2525
|
let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, i, o, r, c;
|
|
2526
2526
|
const l = { x: 0, y: 0 };
|
|
2527
2527
|
e.scenes.forEach((a) => {
|
|
2528
|
-
a.target && a.centeredToTarget && (a.transform =
|
|
2528
|
+
a.target && a.centeredToTarget && (a.transform = ii(Zs(a.target), e.rect, l), t = !0), e.root ? i = ai(e) : (o = ri.bind(null, e), window.addEventListener("resize", o));
|
|
2529
2529
|
}), s = function(a) {
|
|
2530
|
-
for (let
|
|
2531
|
-
if (!
|
|
2532
|
-
const d =
|
|
2533
|
-
e.allowActiveEvent && (a.active = d <= 1 && h <= 1 && d >= 0 && h >= 0),
|
|
2530
|
+
for (let u of e.scenes)
|
|
2531
|
+
if (!u.disabled) {
|
|
2532
|
+
const d = u.transform?.x(a.x) || a.x / e.rect.width, h = u.transform?.y(a.y) || a.y / e.rect.height, p = +it(0, 1, d).toPrecision(4), m = +it(0, 1, h).toPrecision(4), g = { x: a.vx, y: a.vy };
|
|
2533
|
+
e.allowActiveEvent && (a.active = d <= 1 && h <= 1 && d >= 0 && h >= 0), u.effect(u, { x: p, y: m }, g, a.active);
|
|
2534
2534
|
}
|
|
2535
2535
|
Object.assign(n, a);
|
|
2536
|
-
}, t && (r =
|
|
2537
|
-
function
|
|
2536
|
+
}, t && (r = oi.bind(l, s, n), c = si(document, r));
|
|
2537
|
+
function f() {
|
|
2538
2538
|
e.scenes.forEach((a) => a.destroy?.()), c?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", o), o = null), s = null, n = null;
|
|
2539
2539
|
}
|
|
2540
2540
|
return {
|
|
2541
2541
|
tick: s,
|
|
2542
|
-
destroy:
|
|
2542
|
+
destroy: f
|
|
2543
2543
|
};
|
|
2544
2544
|
}
|
|
2545
|
-
const
|
|
2545
|
+
const li = 1e3 / 60 * 3;
|
|
2546
2546
|
let ue;
|
|
2547
|
-
function
|
|
2548
|
-
|
|
2547
|
+
function fi() {
|
|
2548
|
+
H.x = window.scrollX, H.y = window.scrollY;
|
|
2549
2549
|
}
|
|
2550
|
-
const
|
|
2551
|
-
class
|
|
2550
|
+
const H = { x: 0, y: 0, scrollHandler: fi, fixRequired: void 0 };
|
|
2551
|
+
class ui {
|
|
2552
2552
|
constructor(t = {}) {
|
|
2553
2553
|
this.config = { ...t }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
|
|
2554
2554
|
let n;
|
|
2555
|
-
this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() :
|
|
2555
|
+
this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : ot(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : ot(() => {
|
|
2556
2556
|
this.tick();
|
|
2557
2557
|
}), this.config.rect = this.config.root ? {
|
|
2558
2558
|
width: this.config.root.offsetWidth,
|
|
@@ -2575,15 +2575,15 @@ class li {
|
|
|
2575
2575
|
}, this._pointerEnter = () => {
|
|
2576
2576
|
this.progress.active = !0, this._nextTick = n();
|
|
2577
2577
|
}, this.config.root) {
|
|
2578
|
-
ue = typeof ue == "boolean" ? ue :
|
|
2578
|
+
ue = typeof ue == "boolean" ? ue : Js();
|
|
2579
2579
|
const i = ue ? window.devicePixelRatio : 1;
|
|
2580
|
-
typeof
|
|
2580
|
+
typeof H.fixRequired > "u" && ti(H), this._measure = (o) => {
|
|
2581
2581
|
if (o.target !== this.config.root) {
|
|
2582
2582
|
const r = new PointerEvent("pointermove", {
|
|
2583
2583
|
bubbles: !0,
|
|
2584
2584
|
cancelable: !0,
|
|
2585
|
-
clientX: o.x * i +
|
|
2586
|
-
clientY: o.y * i +
|
|
2585
|
+
clientX: o.x * i + H.x,
|
|
2586
|
+
clientY: o.y * i + H.y
|
|
2587
2587
|
});
|
|
2588
2588
|
o.stopPropagation(), this.config.root.dispatchEvent(r);
|
|
2589
2589
|
} else
|
|
@@ -2620,7 +2620,7 @@ class li {
|
|
|
2620
2620
|
let i = !1;
|
|
2621
2621
|
const o = (r) => {
|
|
2622
2622
|
const c = (r - this._startTime) / t, l = n(Math.min(1, c));
|
|
2623
|
-
i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((
|
|
2623
|
+
i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((f, [a, u]) => (a === "active" ? f[a] = u : f[a] = this.previousProgress[a] + (u - this.previousProgress[a]) * l, f), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(o), i = r - this._startTime > li), this.effect.tick(this.currentProgress);
|
|
2624
2624
|
};
|
|
2625
2625
|
return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, o(s)) : this._startTime = s, this._nextTransitionTick;
|
|
2626
2626
|
}
|
|
@@ -2649,7 +2649,7 @@ class li {
|
|
|
2649
2649
|
* Reset registered effect.
|
|
2650
2650
|
*/
|
|
2651
2651
|
setupEffect() {
|
|
2652
|
-
this.removeEffect(), this.effect =
|
|
2652
|
+
this.removeEffect(), this.effect = ci(this.config);
|
|
2653
2653
|
}
|
|
2654
2654
|
/**
|
|
2655
2655
|
* Remove registered effect.
|
|
@@ -2658,55 +2658,55 @@ class li {
|
|
|
2658
2658
|
this.effect && this.effect.destroy(), this.effect = null;
|
|
2659
2659
|
}
|
|
2660
2660
|
}
|
|
2661
|
-
const
|
|
2662
|
-
let
|
|
2663
|
-
function
|
|
2664
|
-
|
|
2661
|
+
const Re = /* @__PURE__ */ new WeakMap();
|
|
2662
|
+
let Gt = () => ({});
|
|
2663
|
+
function di(e) {
|
|
2664
|
+
Gt = e;
|
|
2665
2665
|
}
|
|
2666
|
-
function
|
|
2666
|
+
function hi(e) {
|
|
2667
2667
|
return !("keyframeEffect" in e || "customEffect" in e) || !e.transitionDuration ? {} : {
|
|
2668
2668
|
transitionDuration: e.transitionDuration,
|
|
2669
|
-
transitionEasing:
|
|
2669
|
+
transitionEasing: Ge(e.transitionEasing)
|
|
2670
2670
|
};
|
|
2671
2671
|
}
|
|
2672
|
-
function
|
|
2672
|
+
function mi(e, t, n, s = {}, { reducedMotion: i, selectorCondition: o }) {
|
|
2673
2673
|
if (i || o && !t.matches(o)) return;
|
|
2674
2674
|
const r = {
|
|
2675
2675
|
trigger: "pointer-move",
|
|
2676
2676
|
element: e,
|
|
2677
2677
|
axis: s.axis ?? "y"
|
|
2678
|
-
}, c =
|
|
2678
|
+
}, c = It(t, x(n), r);
|
|
2679
2679
|
if (c) {
|
|
2680
|
-
const l = Array.isArray(c) ? c : [c],
|
|
2680
|
+
const l = Array.isArray(c) ? c : [c], f = new ui({
|
|
2681
2681
|
root: s.hitArea === "self" ? e : void 0,
|
|
2682
2682
|
scenes: l,
|
|
2683
|
-
...
|
|
2684
|
-
...
|
|
2685
|
-
}),
|
|
2686
|
-
|
|
2683
|
+
...Gt(),
|
|
2684
|
+
...hi(n)
|
|
2685
|
+
}), u = { source: e, target: t, cleanup: () => {
|
|
2686
|
+
f.destroy();
|
|
2687
2687
|
} };
|
|
2688
|
-
|
|
2688
|
+
q(Re, e, u), q(Re, t, u), Promise.all(
|
|
2689
2689
|
l.map((d) => d.ready || Promise.resolve())
|
|
2690
2690
|
).then(() => {
|
|
2691
|
-
|
|
2691
|
+
f.start();
|
|
2692
2692
|
});
|
|
2693
2693
|
}
|
|
2694
2694
|
}
|
|
2695
|
-
function
|
|
2696
|
-
|
|
2697
|
-
}
|
|
2698
|
-
const
|
|
2699
|
-
add:
|
|
2700
|
-
remove:
|
|
2701
|
-
registerOptionsGetter:
|
|
2702
|
-
},
|
|
2703
|
-
function
|
|
2695
|
+
function pi(e) {
|
|
2696
|
+
re(Re, e);
|
|
2697
|
+
}
|
|
2698
|
+
const gi = {
|
|
2699
|
+
add: mi,
|
|
2700
|
+
remove: pi,
|
|
2701
|
+
registerOptionsGetter: di
|
|
2702
|
+
}, xe = /* @__PURE__ */ new WeakMap();
|
|
2703
|
+
function vi(e, t, n, s, {
|
|
2704
2704
|
reducedMotion: i,
|
|
2705
2705
|
selectorCondition: o,
|
|
2706
2706
|
animation: r,
|
|
2707
2707
|
sourceAnimationOptions: c
|
|
2708
2708
|
}) {
|
|
2709
|
-
const l = r ||
|
|
2709
|
+
const l = r || ie(
|
|
2710
2710
|
t,
|
|
2711
2711
|
x(n),
|
|
2712
2712
|
void 0,
|
|
@@ -2714,30 +2714,30 @@ function pi(e, t, n, s, {
|
|
|
2714
2714
|
);
|
|
2715
2715
|
if (!l)
|
|
2716
2716
|
return;
|
|
2717
|
-
const { effectId:
|
|
2717
|
+
const { effectId: f } = s, a = (h) => {
|
|
2718
2718
|
if (o && !t.matches(o)) return;
|
|
2719
|
-
const
|
|
2719
|
+
const p = h.animationName, m = h.detail?.effectId, g = c ? St(e, c) : null;
|
|
2720
2720
|
if (g) {
|
|
2721
|
-
if (g.playState === "running" ||
|
|
2721
|
+
if (g.playState === "running" || p && !g.hasAnimationName(p))
|
|
2722
2722
|
return;
|
|
2723
|
-
if (
|
|
2723
|
+
if (m && m !== f && !g.hasAnimationId(m))
|
|
2724
2724
|
return;
|
|
2725
2725
|
}
|
|
2726
2726
|
l.play();
|
|
2727
2727
|
}, d = { source: e, target: t, cleanup: () => {
|
|
2728
2728
|
l.cancel(), e.removeEventListener("animationend", a);
|
|
2729
2729
|
} };
|
|
2730
|
-
|
|
2730
|
+
q(xe, e, d), q(xe, t, d), e.addEventListener("animationend", a);
|
|
2731
2731
|
}
|
|
2732
|
-
function
|
|
2733
|
-
|
|
2732
|
+
function yi(e) {
|
|
2733
|
+
re(xe, e);
|
|
2734
2734
|
}
|
|
2735
|
-
const
|
|
2736
|
-
add:
|
|
2737
|
-
remove:
|
|
2735
|
+
const Ei = {
|
|
2736
|
+
add: vi,
|
|
2737
|
+
remove: yi
|
|
2738
2738
|
};
|
|
2739
|
-
function
|
|
2740
|
-
const r = o ||
|
|
2739
|
+
function wi(e, t, n = !1, s, i, o) {
|
|
2740
|
+
const r = o || ie(
|
|
2741
2741
|
e,
|
|
2742
2742
|
x(t),
|
|
2743
2743
|
void 0,
|
|
@@ -2747,10 +2747,10 @@ function yi(e, t, n = !1, s, i, o) {
|
|
|
2747
2747
|
return null;
|
|
2748
2748
|
let c = !0;
|
|
2749
2749
|
const l = t.triggerType || "alternate";
|
|
2750
|
-
return (
|
|
2750
|
+
return (f) => {
|
|
2751
2751
|
if (s && !e.matches(s)) return;
|
|
2752
|
-
const a = !i,
|
|
2753
|
-
if (
|
|
2752
|
+
const a = !i, u = i?.enter?.includes(f.type), d = i?.leave?.includes(f.type);
|
|
2753
|
+
if (u || a) {
|
|
2754
2754
|
if (l === "alternate" || l === "state")
|
|
2755
2755
|
c ? (c = !1, r.play()) : l === "alternate" ? r.reverse() : l === "state" && (r.playState === "running" ? r.pause() : r.playState !== "finished" && r.play());
|
|
2756
2756
|
else {
|
|
@@ -2771,126 +2771,126 @@ function yi(e, t, n = !1, s, i, o) {
|
|
|
2771
2771
|
})) : l === "state" && r.playState === "running" && r.pause());
|
|
2772
2772
|
};
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2774
|
+
function $i(e, t, {
|
|
2775
2775
|
effectId: n,
|
|
2776
2776
|
listContainer: s,
|
|
2777
2777
|
listItemSelector: i,
|
|
2778
2778
|
stateAction: o
|
|
2779
2779
|
}, r, c) {
|
|
2780
|
-
const l = !!s,
|
|
2781
|
-
return (
|
|
2780
|
+
const l = !!s, f = o ?? "toggle", a = f === "toggle";
|
|
2781
|
+
return (u) => {
|
|
2782
2782
|
if (r && !e.matches(r)) return;
|
|
2783
2783
|
const d = l ? e.closest(
|
|
2784
2784
|
`${s} > ${i || ""}:has(:scope)`
|
|
2785
|
-
) : void 0, h = !c,
|
|
2786
|
-
h ? t.toggleEffect(n,
|
|
2785
|
+
) : void 0, h = !c, p = c?.enter?.includes(u.type), m = c?.leave?.includes(u.type);
|
|
2786
|
+
h ? t.toggleEffect(n, f, d) : (p && t.toggleEffect(n, a ? "add" : f, d), m && a && t.toggleEffect(n, "remove", d));
|
|
2787
2787
|
};
|
|
2788
2788
|
}
|
|
2789
|
-
const
|
|
2790
|
-
function
|
|
2789
|
+
const Ne = /* @__PURE__ */ new WeakMap();
|
|
2790
|
+
function rt(e, t) {
|
|
2791
2791
|
return (n) => {
|
|
2792
2792
|
const s = n;
|
|
2793
2793
|
e.contains(s.relatedTarget) || t(s);
|
|
2794
2794
|
};
|
|
2795
2795
|
}
|
|
2796
|
-
function
|
|
2796
|
+
function bi(e) {
|
|
2797
2797
|
return (t) => {
|
|
2798
2798
|
const n = t;
|
|
2799
2799
|
(n.pointerType || n.detail > 0) && e(n);
|
|
2800
2800
|
};
|
|
2801
2801
|
}
|
|
2802
|
-
function
|
|
2802
|
+
function Si(e) {
|
|
2803
2803
|
return (t) => {
|
|
2804
2804
|
const n = t;
|
|
2805
2805
|
n.code === "Space" ? (n.preventDefault(), e(n)) : n.code === "Enter" && e(n);
|
|
2806
2806
|
};
|
|
2807
2807
|
}
|
|
2808
|
-
const
|
|
2809
|
-
focusin: (e, t) =>
|
|
2810
|
-
focusout: (e, t) =>
|
|
2811
|
-
click: (e, t) =>
|
|
2812
|
-
keydown: (e, t) =>
|
|
2808
|
+
const Ii = {
|
|
2809
|
+
focusin: (e, t) => rt(e, t),
|
|
2810
|
+
focusout: (e, t) => rt(e, t),
|
|
2811
|
+
click: (e, t) => bi(t),
|
|
2812
|
+
keydown: (e, t) => Si(t)
|
|
2813
2813
|
};
|
|
2814
|
-
function
|
|
2815
|
-
const s =
|
|
2814
|
+
function Ti(e, t, n) {
|
|
2815
|
+
const s = Ii[e];
|
|
2816
2816
|
return s ? s(t, n) : (i) => n(i);
|
|
2817
2817
|
}
|
|
2818
|
-
function
|
|
2818
|
+
function Ci(e) {
|
|
2819
2819
|
return typeof e == "object" && !Array.isArray(e) && ("enter" in e || "leave" in e);
|
|
2820
2820
|
}
|
|
2821
|
-
function
|
|
2821
|
+
function Oi(e) {
|
|
2822
2822
|
if (typeof e == "string")
|
|
2823
2823
|
return { toggle: [e] };
|
|
2824
2824
|
if (Array.isArray(e))
|
|
2825
2825
|
return { toggle: [...e] };
|
|
2826
|
-
if (
|
|
2826
|
+
if (Ci(e)) {
|
|
2827
2827
|
const t = e.enter ? [...e.enter] : [], n = e.leave ? [...e.leave] : [];
|
|
2828
2828
|
return { enter: t, leave: n };
|
|
2829
2829
|
}
|
|
2830
2830
|
return {};
|
|
2831
2831
|
}
|
|
2832
|
-
function
|
|
2832
|
+
function _i(e) {
|
|
2833
2833
|
return !!(e.enter?.length || e.leave?.length);
|
|
2834
2834
|
}
|
|
2835
|
-
function
|
|
2836
|
-
return
|
|
2835
|
+
function Ai(e) {
|
|
2836
|
+
return _i(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
|
|
2837
2837
|
}
|
|
2838
|
-
function
|
|
2838
|
+
function Mi(e, t, n, s, {
|
|
2839
2839
|
reducedMotion: i,
|
|
2840
2840
|
targetController: o,
|
|
2841
2841
|
selectorCondition: r,
|
|
2842
2842
|
animation: c
|
|
2843
2843
|
}) {
|
|
2844
|
-
const l =
|
|
2845
|
-
let
|
|
2846
|
-
if (
|
|
2844
|
+
const l = Oi(s.eventConfig), f = n.transition || n.transitionProperties, a = Ai(l);
|
|
2845
|
+
let u, d = !1;
|
|
2846
|
+
if (f ? u = $i(
|
|
2847
2847
|
t,
|
|
2848
2848
|
o,
|
|
2849
2849
|
n,
|
|
2850
2850
|
r,
|
|
2851
2851
|
a
|
|
2852
|
-
) : (
|
|
2852
|
+
) : (u = wi(
|
|
2853
2853
|
t,
|
|
2854
2854
|
n,
|
|
2855
2855
|
i,
|
|
2856
2856
|
r,
|
|
2857
2857
|
a,
|
|
2858
2858
|
c
|
|
2859
|
-
), d = n.triggerType === "once"), !
|
|
2859
|
+
), d = n.triggerType === "once"), !u)
|
|
2860
2860
|
return;
|
|
2861
|
-
const h =
|
|
2862
|
-
function
|
|
2863
|
-
const b =
|
|
2864
|
-
y.addEventListener(v, b, {
|
|
2861
|
+
const h = u, p = new AbortController();
|
|
2862
|
+
function m(y, v, $) {
|
|
2863
|
+
const b = Ti(v, e, h);
|
|
2864
|
+
y.addEventListener(v, b, { ...$, signal: p.signal });
|
|
2865
2865
|
}
|
|
2866
2866
|
const E = { source: e, target: t, cleanup: () => {
|
|
2867
|
-
|
|
2867
|
+
p.abort();
|
|
2868
2868
|
} };
|
|
2869
|
-
if (
|
|
2869
|
+
if (q(Ne, e, E), q(Ne, t, E), a) {
|
|
2870
2870
|
const y = l.enter, v = l.leave;
|
|
2871
2871
|
y.forEach((S) => {
|
|
2872
|
-
S === "focusin" && (e.tabIndex = 0),
|
|
2872
|
+
S === "focusin" && (e.tabIndex = 0), m(e, S, { passive: !0, once: d });
|
|
2873
2873
|
});
|
|
2874
|
-
const
|
|
2875
|
-
(
|
|
2874
|
+
const $ = !n.stateAction || n.stateAction === "toggle";
|
|
2875
|
+
(f ? $ : n.triggerType !== "once") && v.forEach((S) => {
|
|
2876
2876
|
if (S === "focusout") {
|
|
2877
|
-
|
|
2877
|
+
m(e, S, { once: d });
|
|
2878
2878
|
return;
|
|
2879
2879
|
}
|
|
2880
|
-
|
|
2880
|
+
m(e, S, { passive: !0 });
|
|
2881
2881
|
});
|
|
2882
2882
|
} else
|
|
2883
2883
|
(l.toggle ?? []).forEach((v) => {
|
|
2884
|
-
|
|
2884
|
+
m(e, v, { once: d, passive: v !== "keydown" });
|
|
2885
2885
|
});
|
|
2886
2886
|
}
|
|
2887
|
-
function
|
|
2888
|
-
|
|
2887
|
+
function ki(e) {
|
|
2888
|
+
re(Ne, e);
|
|
2889
2889
|
}
|
|
2890
|
-
const
|
|
2891
|
-
add:
|
|
2892
|
-
remove:
|
|
2893
|
-
},
|
|
2890
|
+
const X = {
|
|
2891
|
+
add: Mi,
|
|
2892
|
+
remove: ki
|
|
2893
|
+
}, je = {
|
|
2894
2894
|
click: ["click"],
|
|
2895
2895
|
activate: ["click", "keydown"],
|
|
2896
2896
|
hover: { enter: ["mouseenter"], leave: ["mouseleave"] },
|
|
@@ -2898,43 +2898,43 @@ const Q = {
|
|
|
2898
2898
|
enter: ["mouseenter", "focusin"],
|
|
2899
2899
|
leave: ["mouseleave", "focusout"]
|
|
2900
2900
|
}
|
|
2901
|
-
},
|
|
2902
|
-
click:
|
|
2903
|
-
hover:
|
|
2901
|
+
}, at = {
|
|
2902
|
+
click: je.activate,
|
|
2903
|
+
hover: je.interest
|
|
2904
2904
|
};
|
|
2905
|
-
function
|
|
2906
|
-
const t =
|
|
2905
|
+
function de(e) {
|
|
2906
|
+
const t = je[e];
|
|
2907
2907
|
return (n, s, i, o, r) => {
|
|
2908
|
-
const c = r?.allowA11yTriggers && e in
|
|
2909
|
-
|
|
2908
|
+
const c = r?.allowA11yTriggers && e in at ? at[e] : t;
|
|
2909
|
+
X.add(n, s, i, { eventConfig: c }, r ?? {});
|
|
2910
2910
|
};
|
|
2911
2911
|
}
|
|
2912
|
-
const
|
|
2913
|
-
viewEnter:
|
|
2912
|
+
const G = {
|
|
2913
|
+
viewEnter: ks,
|
|
2914
2914
|
hover: {
|
|
2915
|
-
add:
|
|
2916
|
-
remove:
|
|
2915
|
+
add: de("hover"),
|
|
2916
|
+
remove: X.remove
|
|
2917
2917
|
},
|
|
2918
2918
|
click: {
|
|
2919
|
-
add:
|
|
2920
|
-
remove:
|
|
2919
|
+
add: de("click"),
|
|
2920
|
+
remove: X.remove
|
|
2921
2921
|
},
|
|
2922
|
-
animationEnd:
|
|
2923
|
-
viewProgress:
|
|
2924
|
-
pointerMove:
|
|
2922
|
+
animationEnd: Ei,
|
|
2923
|
+
viewProgress: Xs,
|
|
2924
|
+
pointerMove: gi,
|
|
2925
2925
|
activate: {
|
|
2926
|
-
add:
|
|
2927
|
-
remove:
|
|
2926
|
+
add: de("activate"),
|
|
2927
|
+
remove: X.remove
|
|
2928
2928
|
},
|
|
2929
2929
|
interest: {
|
|
2930
|
-
add:
|
|
2931
|
-
remove:
|
|
2930
|
+
add: de("interest"),
|
|
2931
|
+
remove: X.remove
|
|
2932
2932
|
}
|
|
2933
2933
|
};
|
|
2934
|
-
function
|
|
2934
|
+
function qi(e) {
|
|
2935
2935
|
return e.replace(/\[[^\]]+]/g, "[]");
|
|
2936
2936
|
}
|
|
2937
|
-
class
|
|
2937
|
+
class w {
|
|
2938
2938
|
static defineInteractElement;
|
|
2939
2939
|
dataCache;
|
|
2940
2940
|
addedInteractions;
|
|
@@ -2948,18 +2948,21 @@ class $ {
|
|
|
2948
2948
|
static sequenceCache = /* @__PURE__ */ new Map();
|
|
2949
2949
|
static elementSequenceMap = /* @__PURE__ */ new WeakMap();
|
|
2950
2950
|
static plugins = /* @__PURE__ */ new Map();
|
|
2951
|
+
static pluginDefers = /* @__PURE__ */ new Map();
|
|
2952
|
+
/** Released defer names: `name` (every key) or `name::key` (a single key). */
|
|
2953
|
+
static _released = /* @__PURE__ */ new Set();
|
|
2951
2954
|
constructor() {
|
|
2952
2955
|
this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, this.addedInteractions = {}, this.mediaQueryListeners = /* @__PURE__ */ new Map(), this.listInteractionsCache = {}, this.controllers = /* @__PURE__ */ new Set();
|
|
2953
2956
|
}
|
|
2954
2957
|
init(t, n) {
|
|
2955
2958
|
if (typeof window > "u" || !window.customElements)
|
|
2956
2959
|
return;
|
|
2957
|
-
const s = n?.useCustomElement ??
|
|
2958
|
-
this.dataCache =
|
|
2959
|
-
const i =
|
|
2960
|
+
const s = n?.useCustomElement ?? !!w.defineInteractElement;
|
|
2961
|
+
this.dataCache = Fi(t, s, n?.configIndex);
|
|
2962
|
+
const i = w.defineInteractElement?.();
|
|
2960
2963
|
s && i === !1 ? document.querySelectorAll("interact-element").forEach((o) => {
|
|
2961
2964
|
o.connect();
|
|
2962
|
-
}) :
|
|
2965
|
+
}) : w.controllerCache.forEach(
|
|
2963
2966
|
(o, r) => o.connect(r)
|
|
2964
2967
|
);
|
|
2965
2968
|
}
|
|
@@ -2968,20 +2971,20 @@ class $ {
|
|
|
2968
2971
|
n.disconnect({ removeFromCache: t });
|
|
2969
2972
|
for (const [, n] of this.mediaQueryListeners.entries())
|
|
2970
2973
|
n.mql.removeEventListener("change", n.handler);
|
|
2971
|
-
this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} },
|
|
2974
|
+
this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, w.instances.splice(w.instances.indexOf(this), 1);
|
|
2972
2975
|
}
|
|
2973
2976
|
setController(t, n) {
|
|
2974
|
-
this.controllers.add(n),
|
|
2977
|
+
this.controllers.add(n), w.setController(t, n);
|
|
2975
2978
|
}
|
|
2976
2979
|
deleteController(t, n = !1) {
|
|
2977
|
-
const s =
|
|
2978
|
-
this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s),
|
|
2980
|
+
const s = w.controllerCache.get(t);
|
|
2981
|
+
this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), w.deleteController(t));
|
|
2979
2982
|
}
|
|
2980
2983
|
has(t) {
|
|
2981
2984
|
return !!this.get(t);
|
|
2982
2985
|
}
|
|
2983
2986
|
get(t) {
|
|
2984
|
-
const n =
|
|
2987
|
+
const n = qi(t);
|
|
2985
2988
|
return this.dataCache.interactions[n];
|
|
2986
2989
|
}
|
|
2987
2990
|
clearMediaQueryListenersForKey(t) {
|
|
@@ -2990,12 +2993,12 @@ class $ {
|
|
|
2990
2993
|
}
|
|
2991
2994
|
clearInteractionStateForKey(t) {
|
|
2992
2995
|
(this.get(t)?.interactionIds || []).forEach((i) => {
|
|
2993
|
-
const o =
|
|
2996
|
+
const o = k(i, t);
|
|
2994
2997
|
delete this.addedInteractions[o];
|
|
2995
2998
|
});
|
|
2996
2999
|
const s = `${t}::seq::`;
|
|
2997
|
-
for (const i of
|
|
2998
|
-
i.startsWith(s) && (
|
|
3000
|
+
for (const i of w.sequenceCache.keys())
|
|
3001
|
+
i.startsWith(s) && (w.sequenceCache.delete(i), delete this.addedInteractions[i]);
|
|
2999
3002
|
}
|
|
3000
3003
|
setupMediaQueryListener(t, n, s, i) {
|
|
3001
3004
|
this.mediaQueryListeners.has(t) || (n.addEventListener("change", i), this.mediaQueryListeners.set(t, {
|
|
@@ -3005,92 +3008,110 @@ class $ {
|
|
|
3005
3008
|
}));
|
|
3006
3009
|
}
|
|
3007
3010
|
static create(t, n) {
|
|
3008
|
-
const s = new
|
|
3009
|
-
return
|
|
3011
|
+
const s = new w();
|
|
3012
|
+
return w.instances.push(s), s.init(t, n), s;
|
|
3010
3013
|
}
|
|
3011
3014
|
static destroy() {
|
|
3012
|
-
|
|
3015
|
+
w.controllerCache.forEach((t) => {
|
|
3013
3016
|
t.disconnect();
|
|
3014
|
-
}),
|
|
3017
|
+
}), w.instances.length = 0, w.controllerCache.clear(), w.sequenceCache.clear(), w.elementSequenceMap = /* @__PURE__ */ new WeakMap(), w._released.clear();
|
|
3015
3018
|
}
|
|
3016
3019
|
static setup(t) {
|
|
3017
|
-
t.scrollOptionsGetter &&
|
|
3020
|
+
t.scrollOptionsGetter && G.viewProgress.registerOptionsGetter?.(
|
|
3018
3021
|
t.scrollOptionsGetter
|
|
3019
|
-
), t.pointerOptionsGetter &&
|
|
3022
|
+
), t.pointerOptionsGetter && G.pointerMove.registerOptionsGetter?.(
|
|
3020
3023
|
t.pointerOptionsGetter
|
|
3021
|
-
), t.viewEnter &&
|
|
3024
|
+
), t.viewEnter && G.viewEnter.setOptions(
|
|
3022
3025
|
t.viewEnter
|
|
3023
|
-
), t.allowA11yTriggers !== void 0 && (
|
|
3026
|
+
), t.allowA11yTriggers !== void 0 && (w.allowA11yTriggers = t.allowA11yTriggers);
|
|
3024
3027
|
}
|
|
3025
3028
|
static getInstance(t) {
|
|
3026
|
-
const n =
|
|
3029
|
+
const n = w.instances.find((s) => s.has(t));
|
|
3027
3030
|
return n || console.warn(`Interact: Instance for key "${t}" not found`), n;
|
|
3028
3031
|
}
|
|
3029
3032
|
static getController(t) {
|
|
3030
|
-
const n = t ?
|
|
3033
|
+
const n = t ? w.controllerCache.get(t) : void 0;
|
|
3031
3034
|
return n || console.warn(`Interact: Controller for key "${t}" not found`), n;
|
|
3032
3035
|
}
|
|
3033
3036
|
static setController(t, n) {
|
|
3034
|
-
|
|
3037
|
+
w.controllerCache.set(t, n);
|
|
3035
3038
|
}
|
|
3036
3039
|
static deleteController(t) {
|
|
3037
|
-
|
|
3040
|
+
w.controllerCache.delete(t);
|
|
3038
3041
|
}
|
|
3039
|
-
static registerEffects =
|
|
3040
|
-
static getRegisteredEffect =
|
|
3042
|
+
static registerEffects = Dn;
|
|
3043
|
+
static getRegisteredEffect = We;
|
|
3041
3044
|
/**
|
|
3042
3045
|
* Registers a plugin under a name. When the config carries a plugin field (e.g. `$splitText`) with a matching key
|
|
3043
3046
|
* (on an interaction or effect), Interact invokes the plugin with the field's value and a
|
|
3044
3047
|
* context. Interact is agnostic to what the plugin does — see the `InteractPlugin` type.
|
|
3048
|
+
*
|
|
3049
|
+
* With `options.defer`, the plugin — and every interaction, effect, or sequence carrying its
|
|
3050
|
+
* field — is deferred until each named event is released via `Interact.ready()`.
|
|
3051
|
+
*/
|
|
3052
|
+
static use(t, n, s) {
|
|
3053
|
+
w.plugins.set(t, n);
|
|
3054
|
+
const i = s?.defer;
|
|
3055
|
+
i && i.length ? w.pluginDefers.set(t, Array.isArray(i) ? i : [i]) : w.pluginDefers.delete(t);
|
|
3056
|
+
}
|
|
3057
|
+
/**
|
|
3058
|
+
* Releases a defer name — for every key, or only for `key` — and applies everything that was
|
|
3059
|
+
* deferred on it (see the `defer` option of `Interact.use()`).
|
|
3045
3060
|
*/
|
|
3046
|
-
static
|
|
3047
|
-
|
|
3061
|
+
static ready(t, n) {
|
|
3062
|
+
w._released.add(n ? `${t}::${n}` : t), n ? w.controllerCache.get(n)?.resume() : w.controllerCache.forEach((s) => s.resume());
|
|
3063
|
+
}
|
|
3064
|
+
static _isPluginReleased(t, n) {
|
|
3065
|
+
const s = w.pluginDefers.get(t);
|
|
3066
|
+
return s ? s.every(
|
|
3067
|
+
(i) => w._released.has(i) || w._released.has(`${i}::${n}`)
|
|
3068
|
+
) : !0;
|
|
3048
3069
|
}
|
|
3049
3070
|
static getPlugin(t) {
|
|
3050
|
-
return
|
|
3071
|
+
return w.plugins.get(t);
|
|
3051
3072
|
}
|
|
3052
3073
|
static getPluginsNames() {
|
|
3053
|
-
return new Set(
|
|
3074
|
+
return new Set(w.plugins.keys());
|
|
3054
3075
|
}
|
|
3055
3076
|
static getSequence(t, n, s, i) {
|
|
3056
|
-
const o =
|
|
3077
|
+
const o = w.sequenceCache.get(t);
|
|
3057
3078
|
if (o) return o;
|
|
3058
|
-
const r =
|
|
3059
|
-
return
|
|
3079
|
+
const r = Bn(n, s, i);
|
|
3080
|
+
return w.sequenceCache.set(t, r), w._registerSequenceElements(s, r), r;
|
|
3060
3081
|
}
|
|
3061
3082
|
static addToSequence(t, n, s, i) {
|
|
3062
|
-
const o =
|
|
3083
|
+
const o = w.sequenceCache.get(t);
|
|
3063
3084
|
if (!o) return !1;
|
|
3064
|
-
const c =
|
|
3065
|
-
index: s[
|
|
3085
|
+
const c = Tt(n, i).map((l, f) => ({
|
|
3086
|
+
index: s[f] ?? o.animationGroups.length,
|
|
3066
3087
|
group: l
|
|
3067
3088
|
}));
|
|
3068
|
-
return o.addGroups(c),
|
|
3089
|
+
return o.addGroups(c), w._registerSequenceElements(n, o), !0;
|
|
3069
3090
|
}
|
|
3070
3091
|
static _registerSequenceElements(t, n) {
|
|
3071
3092
|
for (const { target: s } of t) {
|
|
3072
3093
|
const i = Array.isArray(s) ? s : s instanceof HTMLElement ? [s] : [];
|
|
3073
3094
|
for (const o of i) {
|
|
3074
|
-
let r =
|
|
3075
|
-
r || (r = /* @__PURE__ */ new Set(),
|
|
3095
|
+
let r = w.elementSequenceMap.get(o);
|
|
3096
|
+
r || (r = /* @__PURE__ */ new Set(), w.elementSequenceMap.set(o, r)), r.add(n);
|
|
3076
3097
|
}
|
|
3077
3098
|
}
|
|
3078
3099
|
}
|
|
3079
3100
|
static removeFromSequences(t) {
|
|
3080
3101
|
for (const n of t) {
|
|
3081
|
-
const s =
|
|
3102
|
+
const s = w.elementSequenceMap.get(n);
|
|
3082
3103
|
if (s) {
|
|
3083
3104
|
for (const i of s)
|
|
3084
3105
|
i.removeGroups(
|
|
3085
3106
|
(o) => o.animations.some((r) => r.effect?.target === n)
|
|
3086
3107
|
);
|
|
3087
|
-
|
|
3108
|
+
w.elementSequenceMap.delete(n);
|
|
3088
3109
|
}
|
|
3089
3110
|
}
|
|
3090
3111
|
}
|
|
3091
3112
|
}
|
|
3092
|
-
let
|
|
3093
|
-
function
|
|
3113
|
+
let Pi = 0;
|
|
3114
|
+
function W(e, {
|
|
3094
3115
|
asCombinator: t = !1,
|
|
3095
3116
|
addItemFilter: n = !1,
|
|
3096
3117
|
useFirstChild: s = !1
|
|
@@ -3102,10 +3123,10 @@ function G(e, {
|
|
|
3102
3123
|
return e.selector;
|
|
3103
3124
|
return s ? t ? "> :first-child" : ":scope > :first-child" : "";
|
|
3104
3125
|
}
|
|
3105
|
-
function
|
|
3126
|
+
function ct(e) {
|
|
3106
3127
|
return "sequenceId" in e && !("effects" in e);
|
|
3107
3128
|
}
|
|
3108
|
-
function
|
|
3129
|
+
function Ae(e, t) {
|
|
3109
3130
|
return e[t] || (e[t] = {
|
|
3110
3131
|
triggers: [],
|
|
3111
3132
|
effects: {},
|
|
@@ -3114,7 +3135,7 @@ function _e(e, t) {
|
|
|
3114
3135
|
selectors: /* @__PURE__ */ new Set()
|
|
3115
3136
|
}), e[t];
|
|
3116
3137
|
}
|
|
3117
|
-
function
|
|
3138
|
+
function Li(e, t, n) {
|
|
3118
3139
|
const { effects: s = [] } = e;
|
|
3119
3140
|
return s.some((i, o) => n.has(t(o))) ? {
|
|
3120
3141
|
...e,
|
|
@@ -3124,60 +3145,60 @@ function qi(e, t, n) {
|
|
|
3124
3145
|
})
|
|
3125
3146
|
} : e;
|
|
3126
3147
|
}
|
|
3127
|
-
function
|
|
3128
|
-
const { effects: s = {}, sequences: i = {}, conditions: o = {} } = e, r = {}, c = e.interactions ?
|
|
3129
|
-
return e.interactions?.forEach((l,
|
|
3130
|
-
const a = l.key,
|
|
3148
|
+
function Fi(e, t = !1, n) {
|
|
3149
|
+
const { effects: s = {}, sequences: i = {}, conditions: o = {} } = e, r = {}, c = e.interactions ? xt(e, n) : /* @__PURE__ */ new Map();
|
|
3150
|
+
return e.interactions?.forEach((l, f) => {
|
|
3151
|
+
const a = l.key, u = ++Pi, { effects: d, sequences: h, ...p } = l;
|
|
3131
3152
|
if (!a) {
|
|
3132
|
-
console.error(`Interaction ${
|
|
3153
|
+
console.error(`Interaction ${u} is missing a key for source element.`);
|
|
3133
3154
|
return;
|
|
3134
3155
|
}
|
|
3135
|
-
|
|
3136
|
-
const
|
|
3137
|
-
|
|
3138
|
-
const g = h?.map((v,
|
|
3139
|
-
if (
|
|
3156
|
+
Ae(r, a);
|
|
3157
|
+
const m = d ? Array.from(d) : [];
|
|
3158
|
+
m.reverse();
|
|
3159
|
+
const g = h?.map((v, $) => {
|
|
3160
|
+
if (ct(v)) {
|
|
3140
3161
|
const S = i[v.sequenceId];
|
|
3141
3162
|
return S ? { ...S, ...v } : (console.warn(`Interact: Sequence "${v.sequenceId}" not found in config`), v);
|
|
3142
3163
|
}
|
|
3143
3164
|
const b = v;
|
|
3144
|
-
return b.sequenceId || (b.sequenceId =
|
|
3165
|
+
return b.sequenceId || (b.sequenceId = Z("seq", [f, $], n)), b;
|
|
3145
3166
|
}), E = {
|
|
3146
|
-
...
|
|
3147
|
-
effects:
|
|
3167
|
+
...p,
|
|
3168
|
+
effects: m.length > 0 ? m : void 0,
|
|
3148
3169
|
sequences: g?.map(
|
|
3149
|
-
(v,
|
|
3170
|
+
(v, $) => Li(
|
|
3150
3171
|
v,
|
|
3151
|
-
(b) =>
|
|
3172
|
+
(b) => ye(f, b, $),
|
|
3152
3173
|
c
|
|
3153
3174
|
)
|
|
3154
3175
|
)
|
|
3155
3176
|
};
|
|
3156
3177
|
r[a].triggers.push(E), r[a].selectors.add(
|
|
3157
|
-
|
|
3178
|
+
W(E, { useFirstChild: t })
|
|
3158
3179
|
);
|
|
3159
3180
|
const y = E.listContainer;
|
|
3160
|
-
|
|
3181
|
+
m.forEach((v, $) => {
|
|
3161
3182
|
const b = v.effectId ? s[v.effectId] : void 0;
|
|
3162
3183
|
let S = v.key || b?.key;
|
|
3163
|
-
const I =
|
|
3164
|
-
v.effectId || (v.effectId =
|
|
3184
|
+
const I = m.length - 1 - $;
|
|
3185
|
+
v.effectId || (v.effectId = Z(
|
|
3165
3186
|
"eff",
|
|
3166
|
-
[
|
|
3187
|
+
[f, I],
|
|
3167
3188
|
n
|
|
3168
3189
|
));
|
|
3169
|
-
const O = c.get(
|
|
3190
|
+
const O = c.get(ye(f, I));
|
|
3170
3191
|
if (O && (v.suffix = O), S = S || a, v.key = S, y && v.listContainer && (S !== a || v.listContainer !== y))
|
|
3171
3192
|
return;
|
|
3172
|
-
const M =
|
|
3193
|
+
const M = V({ ...b, ...v, key: S }), T = `${a}::${M}::${u}`;
|
|
3173
3194
|
if (v.interactionId = T, r[a].interactionIds.add(T), S === a)
|
|
3174
3195
|
return;
|
|
3175
|
-
const C =
|
|
3176
|
-
C.effects[T] || (C.effects[T] = [], C.interactionIds.add(T)), C.effects[T].push({ ...
|
|
3196
|
+
const C = Ae(r, S);
|
|
3197
|
+
C.effects[T] || (C.effects[T] = [], C.interactionIds.add(T)), C.effects[T].push({ ...p, effect: v }), C.selectors.add(W(v, { useFirstChild: t }));
|
|
3177
3198
|
}), g?.forEach((v) => {
|
|
3178
|
-
if (!v ||
|
|
3179
|
-
const
|
|
3180
|
-
|
|
3199
|
+
if (!v || ct(v)) return;
|
|
3200
|
+
const $ = v, b = $.sequenceId;
|
|
3201
|
+
$.effects.forEach((I, O) => {
|
|
3181
3202
|
I.effectId || (I.effectId = `eff-${b}-${O}`);
|
|
3182
3203
|
let M = I.key;
|
|
3183
3204
|
if (!M && I.effectId) {
|
|
@@ -3185,12 +3206,12 @@ function Pi(e, t = !1, n) {
|
|
|
3185
3206
|
C && (M = C.key);
|
|
3186
3207
|
}
|
|
3187
3208
|
M = M || a;
|
|
3188
|
-
const T =
|
|
3209
|
+
const T = W(I, { useFirstChild: t });
|
|
3189
3210
|
if (T && r[a].selectors.add(T), M !== a) {
|
|
3190
|
-
const C =
|
|
3211
|
+
const C = Ae(r, M), _ = `${M}::seq::${b}::${u}`;
|
|
3191
3212
|
C.sequences[_] || (C.sequences[_] = [], C.interactionIds.add(_)), C.sequences[_].push({
|
|
3192
|
-
...
|
|
3193
|
-
sequence:
|
|
3213
|
+
...p,
|
|
3214
|
+
sequence: $
|
|
3194
3215
|
}), C.selectors.add(T);
|
|
3195
3216
|
}
|
|
3196
3217
|
});
|
|
@@ -3202,10 +3223,10 @@ function Pi(e, t = !1, n) {
|
|
|
3202
3223
|
interactions: r
|
|
3203
3224
|
};
|
|
3204
3225
|
}
|
|
3205
|
-
function
|
|
3206
|
-
const o =
|
|
3226
|
+
function Ie(e, t, n, s, i) {
|
|
3227
|
+
const o = w.getPluginsNames();
|
|
3207
3228
|
for (const r of o) {
|
|
3208
|
-
const c = `${
|
|
3229
|
+
const c = `${He}${r}`;
|
|
3209
3230
|
if (!(c in n))
|
|
3210
3231
|
continue;
|
|
3211
3232
|
const l = n[c];
|
|
@@ -3214,11 +3235,17 @@ function Se(e, t, n, s, i) {
|
|
|
3214
3235
|
continue;
|
|
3215
3236
|
e._appliedPlugins.add(l);
|
|
3216
3237
|
}
|
|
3217
|
-
const a =
|
|
3238
|
+
const a = w.getPlugin(r)(l, { root: t, key: s, scope: i, config: n });
|
|
3218
3239
|
typeof a == "function" && e._pluginCleanups.push(a);
|
|
3219
3240
|
}
|
|
3220
3241
|
}
|
|
3221
|
-
function
|
|
3242
|
+
function D(e, t) {
|
|
3243
|
+
for (const n of w.getPluginsNames())
|
|
3244
|
+
if (`${He}${n}` in t && !w._isPluginReleased(n, e))
|
|
3245
|
+
return !0;
|
|
3246
|
+
return !1;
|
|
3247
|
+
}
|
|
3248
|
+
function $e(e, t, n) {
|
|
3222
3249
|
if (e.listContainer) {
|
|
3223
3250
|
const s = t.querySelector(e.listContainer);
|
|
3224
3251
|
return s ? e.selector ? Array.from(s.querySelectorAll(e.selector)) : Array.from(s.children) : (console.warn(`Interact: No container found for list container "${e.listContainer}"`), []);
|
|
@@ -3231,20 +3258,20 @@ function we(e, t, n) {
|
|
|
3231
3258
|
}
|
|
3232
3259
|
return n ? t.firstElementChild : t;
|
|
3233
3260
|
}
|
|
3234
|
-
function
|
|
3261
|
+
function be(e, t) {
|
|
3235
3262
|
return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
|
|
3236
3263
|
}
|
|
3237
|
-
function
|
|
3264
|
+
function Wt(e, t, n, s, i, o, r, c) {
|
|
3238
3265
|
return [
|
|
3239
|
-
r ?
|
|
3240
|
-
c ?
|
|
3266
|
+
r ? be(e, r) : $e(e, n, s),
|
|
3267
|
+
c ? be(t, c) : $e(t, i, o)
|
|
3241
3268
|
];
|
|
3242
3269
|
}
|
|
3243
|
-
function
|
|
3244
|
-
const l = Array.isArray(s),
|
|
3245
|
-
l ? s.forEach((a,
|
|
3246
|
-
const d =
|
|
3247
|
-
d &&
|
|
3270
|
+
function Vt(e, t, n, s, i, o, r, c) {
|
|
3271
|
+
const l = Array.isArray(s), f = Array.isArray(i);
|
|
3272
|
+
l ? s.forEach((a, u) => {
|
|
3273
|
+
const d = f ? i[u] : i;
|
|
3274
|
+
d && lt(
|
|
3248
3275
|
e,
|
|
3249
3276
|
a,
|
|
3250
3277
|
t.trigger,
|
|
@@ -3255,12 +3282,12 @@ function Gt(e, t, n, s, i, o, r, c) {
|
|
|
3255
3282
|
r,
|
|
3256
3283
|
c
|
|
3257
3284
|
);
|
|
3258
|
-
}) : (
|
|
3259
|
-
|
|
3285
|
+
}) : (f ? i : [i]).forEach((u) => {
|
|
3286
|
+
lt(
|
|
3260
3287
|
e,
|
|
3261
3288
|
s,
|
|
3262
3289
|
t.trigger,
|
|
3263
|
-
|
|
3290
|
+
u,
|
|
3264
3291
|
n,
|
|
3265
3292
|
t.params,
|
|
3266
3293
|
o,
|
|
@@ -3269,49 +3296,51 @@ function Gt(e, t, n, s, i, o, r, c) {
|
|
|
3269
3296
|
);
|
|
3270
3297
|
});
|
|
3271
3298
|
}
|
|
3272
|
-
function
|
|
3299
|
+
function Kt(e, t, n, s, i) {
|
|
3273
3300
|
const o = {}, r = [];
|
|
3274
3301
|
(s.effects || []).forEach((c, l) => {
|
|
3275
|
-
const
|
|
3276
|
-
...n.dataCache.effects[
|
|
3302
|
+
const f = c.effectId, a = {
|
|
3303
|
+
...n.dataCache.effects[f] || {},
|
|
3277
3304
|
...c,
|
|
3278
|
-
effectId:
|
|
3279
|
-
},
|
|
3305
|
+
effectId: f
|
|
3306
|
+
}, u = a.key, d = k(c.interactionId, e);
|
|
3280
3307
|
if (o[d] || n.addedInteractions[d] && !i)
|
|
3281
3308
|
return;
|
|
3282
|
-
const h =
|
|
3309
|
+
const h = P(a.conditions || [], n.dataCache.conditions);
|
|
3283
3310
|
if (h && n.setupMediaQueryListener(`${d}::${l}`, h, e, () => {
|
|
3284
3311
|
t.update();
|
|
3285
3312
|
}), !h || h.matches) {
|
|
3286
3313
|
o[d] = !0;
|
|
3287
|
-
const
|
|
3288
|
-
let
|
|
3289
|
-
if (
|
|
3290
|
-
if (
|
|
3314
|
+
const p = u && k(u, e);
|
|
3315
|
+
let m;
|
|
3316
|
+
if (p) {
|
|
3317
|
+
if (m = w.getController(p), !m)
|
|
3291
3318
|
return;
|
|
3292
|
-
a.listContainer &&
|
|
3319
|
+
a.listContainer && m.watchChildList(a.listContainer);
|
|
3293
3320
|
} else
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3321
|
+
m = t;
|
|
3322
|
+
if (D(p || s.key, a))
|
|
3323
|
+
return;
|
|
3324
|
+
Ie(
|
|
3325
|
+
m,
|
|
3326
|
+
m.element,
|
|
3298
3327
|
a,
|
|
3299
|
-
|
|
3328
|
+
p || s.key,
|
|
3300
3329
|
"effect"
|
|
3301
3330
|
);
|
|
3302
|
-
const [g, E] =
|
|
3331
|
+
const [g, E] = Wt(
|
|
3303
3332
|
s,
|
|
3304
3333
|
a,
|
|
3305
3334
|
t.element,
|
|
3306
3335
|
t.useFirstChild,
|
|
3307
|
-
|
|
3308
|
-
|
|
3336
|
+
m.element,
|
|
3337
|
+
m.useFirstChild,
|
|
3309
3338
|
i
|
|
3310
3339
|
);
|
|
3311
3340
|
if (!g || !E)
|
|
3312
3341
|
return;
|
|
3313
3342
|
n.addedInteractions[d] = !0;
|
|
3314
|
-
const y =
|
|
3343
|
+
const y = p || s.key, v = R(
|
|
3315
3344
|
a.conditions || [],
|
|
3316
3345
|
n.dataCache.conditions
|
|
3317
3346
|
);
|
|
@@ -3322,83 +3351,91 @@ function Wt(e, t, n, s, i) {
|
|
|
3322
3351
|
g,
|
|
3323
3352
|
E,
|
|
3324
3353
|
v,
|
|
3325
|
-
|
|
3354
|
+
m.useFirstChild,
|
|
3326
3355
|
e
|
|
3327
3356
|
]);
|
|
3328
3357
|
}
|
|
3329
3358
|
}), r.reverse().forEach((c) => {
|
|
3330
|
-
|
|
3331
|
-
}),
|
|
3359
|
+
Vt(...c);
|
|
3360
|
+
}), xi(e, t, n, s, i);
|
|
3332
3361
|
}
|
|
3333
|
-
function
|
|
3362
|
+
function Ri(e) {
|
|
3334
3363
|
return "sequenceId" in e && !("effects" in e);
|
|
3335
3364
|
}
|
|
3336
|
-
function
|
|
3337
|
-
const c =
|
|
3365
|
+
function Yt(e, t, n, s, i, o, r) {
|
|
3366
|
+
const c = P(e.conditions || [], i.dataCache.conditions);
|
|
3338
3367
|
if (c && i.setupMediaQueryListener(t, c, o.updateKey, o.onUpdate), c && !c.matches) return null;
|
|
3339
|
-
const l = e.effects || [],
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3368
|
+
const l = e.effects || [], f = (h) => {
|
|
3369
|
+
const p = h.effectId;
|
|
3370
|
+
return { ...p ? i.dataCache.effects[p] || {} : {}, ...h };
|
|
3371
|
+
};
|
|
3372
|
+
if (l.some((h) => {
|
|
3373
|
+
const p = f(h), m = P(p.conditions || [], i.dataCache.conditions);
|
|
3374
|
+
if (m && !m.matches) return !1;
|
|
3375
|
+
const g = p.key && k(p.key, n);
|
|
3376
|
+
return D(g || n, p);
|
|
3377
|
+
}))
|
|
3378
|
+
return null;
|
|
3379
|
+
const u = [];
|
|
3380
|
+
let d = !1;
|
|
3381
|
+
for (const h of l) {
|
|
3382
|
+
const p = h.effectId, m = f(h), g = P(m.conditions || [], i.dataCache.conditions);
|
|
3383
|
+
if (g) {
|
|
3384
|
+
const I = `${t}::${p || "eff"}`;
|
|
3348
3385
|
i.setupMediaQueryListener(
|
|
3349
|
-
|
|
3350
|
-
|
|
3386
|
+
I,
|
|
3387
|
+
g,
|
|
3351
3388
|
o.updateKey,
|
|
3352
3389
|
o.onUpdate
|
|
3353
3390
|
);
|
|
3354
3391
|
}
|
|
3355
|
-
if (
|
|
3356
|
-
const
|
|
3357
|
-
let
|
|
3358
|
-
if (
|
|
3359
|
-
if (
|
|
3392
|
+
if (g && !g.matches) continue;
|
|
3393
|
+
const E = m.key, y = E && k(E, n);
|
|
3394
|
+
let v;
|
|
3395
|
+
if (y) {
|
|
3396
|
+
if (v = w.getController(y), !v) return null;
|
|
3360
3397
|
} else
|
|
3361
|
-
|
|
3362
|
-
const
|
|
3363
|
-
|
|
3364
|
-
y,
|
|
3365
|
-
y.element,
|
|
3366
|
-
m,
|
|
3398
|
+
v = s;
|
|
3399
|
+
const $ = y || n;
|
|
3400
|
+
Ie(
|
|
3367
3401
|
v,
|
|
3402
|
+
v.element,
|
|
3403
|
+
m,
|
|
3404
|
+
$,
|
|
3368
3405
|
"effect"
|
|
3369
3406
|
);
|
|
3370
|
-
let
|
|
3371
|
-
if (r &&
|
|
3407
|
+
let b;
|
|
3408
|
+
if (r && $ === r.controllerKey && m.listContainer === r.listContainer ? (b = be(m, r.elements), b.length > 0 && (d = !0)) : b = $e(
|
|
3372
3409
|
m,
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
), !
|
|
3376
|
-
const
|
|
3377
|
-
u.push({ target:
|
|
3410
|
+
v.element,
|
|
3411
|
+
v.useFirstChild
|
|
3412
|
+
), !b || Array.isArray(b) && b.length === 0) return null;
|
|
3413
|
+
const S = x(m);
|
|
3414
|
+
u.push({ target: b, options: S });
|
|
3378
3415
|
}
|
|
3379
|
-
return r && !
|
|
3416
|
+
return r && !d ? null : u.length > 0 ? u : null;
|
|
3380
3417
|
}
|
|
3381
|
-
function
|
|
3382
|
-
const s = n ?
|
|
3418
|
+
function De(e, t, n) {
|
|
3419
|
+
const s = n ? be(e, n) : $e(e, t.element, t.useFirstChild);
|
|
3383
3420
|
return Array.isArray(s) && s.length === 0 ? null : s;
|
|
3384
3421
|
}
|
|
3385
3422
|
function ze(e, t, n, s, i) {
|
|
3386
3423
|
(Array.isArray(n) ? n : [n]).forEach((r) => {
|
|
3387
|
-
|
|
3424
|
+
G[e.trigger]?.add(
|
|
3388
3425
|
r,
|
|
3389
3426
|
r,
|
|
3390
3427
|
{ triggerType: t.triggerType },
|
|
3391
3428
|
e.params || {},
|
|
3392
3429
|
{
|
|
3393
|
-
reducedMotion:
|
|
3430
|
+
reducedMotion: w.forceReducedMotion,
|
|
3394
3431
|
selectorCondition: i,
|
|
3395
3432
|
animation: s,
|
|
3396
|
-
allowA11yTriggers:
|
|
3433
|
+
allowA11yTriggers: w.allowA11yTriggers
|
|
3397
3434
|
}
|
|
3398
3435
|
);
|
|
3399
3436
|
});
|
|
3400
3437
|
}
|
|
3401
|
-
function
|
|
3438
|
+
function Bt(e, t, n) {
|
|
3402
3439
|
const o = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
|
|
3403
3440
|
if (!o) return n.map((c, l) => l);
|
|
3404
3441
|
const r = Array.from(o.children);
|
|
@@ -3407,126 +3444,132 @@ function Kt(e, t, n) {
|
|
|
3407
3444
|
return l >= 0 ? l : r.length;
|
|
3408
3445
|
});
|
|
3409
3446
|
}
|
|
3410
|
-
function
|
|
3447
|
+
function xi(e, t, n, s, i) {
|
|
3411
3448
|
s.sequences?.forEach((o) => {
|
|
3412
3449
|
let r;
|
|
3413
|
-
if (
|
|
3414
|
-
const
|
|
3415
|
-
if (!
|
|
3450
|
+
if (Ri(o)) {
|
|
3451
|
+
const p = n.dataCache.sequences[o.sequenceId];
|
|
3452
|
+
if (!p) {
|
|
3416
3453
|
console.warn(`Interact: Sequence "${o.sequenceId}" not found in cache`);
|
|
3417
3454
|
return;
|
|
3418
3455
|
}
|
|
3419
|
-
r = { ...
|
|
3456
|
+
r = { ...p, ...o };
|
|
3420
3457
|
} else
|
|
3421
3458
|
r = o;
|
|
3422
|
-
const c = r.sequenceId ||
|
|
3459
|
+
const c = r.sequenceId || te(), l = k(`${e}::seq::${c}`, e);
|
|
3423
3460
|
if (n.addedInteractions[l] && !i) return;
|
|
3424
|
-
const
|
|
3461
|
+
const f = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, a = Yt(
|
|
3425
3462
|
r,
|
|
3426
3463
|
l,
|
|
3427
3464
|
e,
|
|
3428
3465
|
t,
|
|
3429
3466
|
n,
|
|
3430
|
-
{
|
|
3431
|
-
|
|
3467
|
+
{
|
|
3468
|
+
updateKey: e,
|
|
3469
|
+
onUpdate: () => t.update()
|
|
3470
|
+
},
|
|
3471
|
+
f
|
|
3432
3472
|
);
|
|
3433
3473
|
if (!a) return;
|
|
3434
3474
|
if (i && n.addedInteractions[l]) {
|
|
3435
|
-
const
|
|
3475
|
+
const p = Bt(
|
|
3436
3476
|
t,
|
|
3437
3477
|
s.listContainer,
|
|
3438
3478
|
i
|
|
3439
3479
|
);
|
|
3440
|
-
|
|
3441
|
-
reducedMotion:
|
|
3480
|
+
w.addToSequence(l, a, p, {
|
|
3481
|
+
reducedMotion: w.forceReducedMotion
|
|
3442
3482
|
});
|
|
3443
|
-
const
|
|
3444
|
-
reducedMotion:
|
|
3483
|
+
const m = w.getSequence(l, r, a, {
|
|
3484
|
+
reducedMotion: w.forceReducedMotion
|
|
3445
3485
|
}), g = R(
|
|
3446
3486
|
s.conditions || [],
|
|
3447
3487
|
n.dataCache.conditions
|
|
3448
|
-
), E =
|
|
3488
|
+
), E = De(s, t, i);
|
|
3449
3489
|
E && ze(
|
|
3450
3490
|
s,
|
|
3451
3491
|
r,
|
|
3452
3492
|
E,
|
|
3453
|
-
|
|
3493
|
+
m,
|
|
3454
3494
|
g
|
|
3455
3495
|
);
|
|
3456
3496
|
return;
|
|
3457
3497
|
}
|
|
3458
|
-
const
|
|
3459
|
-
reducedMotion:
|
|
3498
|
+
const u = w.getSequence(l, r, a, {
|
|
3499
|
+
reducedMotion: w.forceReducedMotion
|
|
3460
3500
|
}), d = R(
|
|
3461
3501
|
s.conditions || [],
|
|
3462
3502
|
n.dataCache.conditions
|
|
3463
|
-
), h =
|
|
3503
|
+
), h = De(s, t, i);
|
|
3464
3504
|
h && (n.addedInteractions[l] = !0, ze(
|
|
3465
3505
|
s,
|
|
3466
3506
|
r,
|
|
3467
3507
|
h,
|
|
3468
|
-
|
|
3508
|
+
u,
|
|
3469
3509
|
d
|
|
3470
3510
|
));
|
|
3471
3511
|
});
|
|
3472
3512
|
}
|
|
3473
|
-
function
|
|
3513
|
+
function Ni(e, t, n, s, i) {
|
|
3474
3514
|
const o = n.get(e)?.sequences || {};
|
|
3475
3515
|
Object.keys(o).forEach((c) => {
|
|
3476
|
-
o[c].some(({ sequence:
|
|
3477
|
-
const
|
|
3516
|
+
o[c].some(({ sequence: f, ...a }) => {
|
|
3517
|
+
const u = P(
|
|
3478
3518
|
a.conditions || [],
|
|
3479
3519
|
n.dataCache.conditions
|
|
3480
3520
|
);
|
|
3481
|
-
if (
|
|
3521
|
+
if (u && !u.matches)
|
|
3482
3522
|
return !1;
|
|
3483
|
-
const d = a.key &&
|
|
3523
|
+
const d = a.key && k(a.key, e), h = w.getController(d);
|
|
3484
3524
|
if (!h)
|
|
3485
3525
|
return !0;
|
|
3486
|
-
const
|
|
3487
|
-
if (n.addedInteractions[
|
|
3526
|
+
const p = f.sequenceId || te(), m = k(`${d}::seq::${p}`, d);
|
|
3527
|
+
if (n.addedInteractions[m] && !i || D(d, a))
|
|
3488
3528
|
return !0;
|
|
3489
|
-
const E =
|
|
3490
|
-
|
|
3491
|
-
|
|
3529
|
+
const E = Yt(
|
|
3530
|
+
f,
|
|
3531
|
+
m,
|
|
3492
3532
|
d,
|
|
3493
3533
|
h,
|
|
3494
3534
|
n,
|
|
3495
|
-
{
|
|
3535
|
+
{
|
|
3536
|
+
updateKey: e,
|
|
3537
|
+
onUpdate: () => t.update()
|
|
3538
|
+
},
|
|
3496
3539
|
i && s ? { controllerKey: e, listContainer: s, elements: i } : void 0
|
|
3497
3540
|
);
|
|
3498
3541
|
if (!E) return !0;
|
|
3499
|
-
if (i && n.addedInteractions[
|
|
3500
|
-
const b =
|
|
3501
|
-
return
|
|
3502
|
-
reducedMotion:
|
|
3542
|
+
if (i && n.addedInteractions[m]) {
|
|
3543
|
+
const b = Bt(t, s, i);
|
|
3544
|
+
return w.addToSequence(m, E, b, {
|
|
3545
|
+
reducedMotion: w.forceReducedMotion
|
|
3503
3546
|
}), !0;
|
|
3504
3547
|
}
|
|
3505
|
-
const y =
|
|
3506
|
-
reducedMotion:
|
|
3548
|
+
const y = w.getSequence(m, f, E, {
|
|
3549
|
+
reducedMotion: w.forceReducedMotion
|
|
3507
3550
|
}), v = R(
|
|
3508
3551
|
a.conditions || [],
|
|
3509
3552
|
n.dataCache.conditions
|
|
3510
|
-
),
|
|
3511
|
-
return
|
|
3553
|
+
), $ = De(a, h);
|
|
3554
|
+
return $ && (n.addedInteractions[m] = !0, ze(
|
|
3512
3555
|
a,
|
|
3513
|
-
|
|
3514
|
-
|
|
3556
|
+
f,
|
|
3557
|
+
$,
|
|
3515
3558
|
y,
|
|
3516
3559
|
v
|
|
3517
3560
|
)), !0;
|
|
3518
3561
|
});
|
|
3519
3562
|
});
|
|
3520
3563
|
}
|
|
3521
|
-
function
|
|
3564
|
+
function Ut(e, t, n, s, i) {
|
|
3522
3565
|
const o = n.get(e), r = o?.effects || {}, c = Object.keys(r), l = [];
|
|
3523
3566
|
c.forEach((a) => {
|
|
3524
|
-
const
|
|
3525
|
-
if (n.addedInteractions[
|
|
3567
|
+
const u = k(a, e);
|
|
3568
|
+
if (n.addedInteractions[u] && !i)
|
|
3526
3569
|
return;
|
|
3527
|
-
r[a].some(({ effect: h, ...
|
|
3528
|
-
const g =
|
|
3529
|
-
|
|
3570
|
+
r[a].some(({ effect: h, ...p }, m) => {
|
|
3571
|
+
const g = P(
|
|
3572
|
+
p.conditions || [],
|
|
3530
3573
|
n.dataCache.conditions
|
|
3531
3574
|
);
|
|
3532
3575
|
if (g && !g.matches)
|
|
@@ -3538,27 +3581,27 @@ function Yt(e, t, n, s, i) {
|
|
|
3538
3581
|
};
|
|
3539
3582
|
if (s && y.listContainer !== s)
|
|
3540
3583
|
return !1;
|
|
3541
|
-
const v =
|
|
3584
|
+
const v = P(y.conditions || [], n.dataCache.conditions);
|
|
3542
3585
|
if (v && n.setupMediaQueryListener(
|
|
3543
|
-
`${
|
|
3586
|
+
`${u}::${m}`,
|
|
3544
3587
|
v,
|
|
3545
3588
|
e,
|
|
3546
3589
|
() => {
|
|
3547
3590
|
t.update();
|
|
3548
3591
|
}
|
|
3549
3592
|
), !v || v.matches) {
|
|
3550
|
-
const
|
|
3551
|
-
if (!b)
|
|
3593
|
+
const $ = p.key && k(p.key, e), b = w.getController($);
|
|
3594
|
+
if (!b || D($, p) || D(e, y))
|
|
3552
3595
|
return !0;
|
|
3553
|
-
|
|
3596
|
+
Ie(
|
|
3554
3597
|
t,
|
|
3555
3598
|
t.element,
|
|
3556
3599
|
y,
|
|
3557
3600
|
e,
|
|
3558
3601
|
"effect"
|
|
3559
3602
|
), y.listContainer && t.watchChildList(y.listContainer);
|
|
3560
|
-
const [S, I] =
|
|
3561
|
-
|
|
3603
|
+
const [S, I] = Wt(
|
|
3604
|
+
p,
|
|
3562
3605
|
y,
|
|
3563
3606
|
b.element,
|
|
3564
3607
|
b.useFirstChild,
|
|
@@ -3569,114 +3612,122 @@ function Yt(e, t, n, s, i) {
|
|
|
3569
3612
|
);
|
|
3570
3613
|
if (!S || !I)
|
|
3571
3614
|
return !0;
|
|
3572
|
-
n.addedInteractions[
|
|
3615
|
+
n.addedInteractions[u] = !0;
|
|
3573
3616
|
const O = R(
|
|
3574
3617
|
y.conditions || [],
|
|
3575
3618
|
n.dataCache.conditions
|
|
3576
3619
|
);
|
|
3577
3620
|
return l.push([
|
|
3578
3621
|
e,
|
|
3579
|
-
|
|
3622
|
+
p,
|
|
3580
3623
|
y,
|
|
3581
3624
|
S,
|
|
3582
3625
|
I,
|
|
3583
3626
|
O,
|
|
3584
3627
|
t.useFirstChild,
|
|
3585
|
-
|
|
3628
|
+
$ || void 0
|
|
3586
3629
|
]), !0;
|
|
3587
3630
|
}
|
|
3588
3631
|
return !1;
|
|
3589
3632
|
});
|
|
3590
3633
|
}), l.reverse().forEach((a) => {
|
|
3591
|
-
|
|
3592
|
-
}),
|
|
3593
|
-
const
|
|
3594
|
-
return c.length > 0 ||
|
|
3634
|
+
Vt(...a);
|
|
3635
|
+
}), Ni(e, t, n, s, i);
|
|
3636
|
+
const f = Object.keys(o?.sequences || {}).length > 0;
|
|
3637
|
+
return c.length > 0 || f;
|
|
3595
3638
|
}
|
|
3596
|
-
function
|
|
3597
|
-
let
|
|
3639
|
+
function lt(e, t, n, s, i, o, r, c, l) {
|
|
3640
|
+
let f;
|
|
3598
3641
|
if (i.transition || i.transitionProperties) {
|
|
3599
|
-
const
|
|
3642
|
+
const u = {
|
|
3600
3643
|
key: e,
|
|
3601
3644
|
effectId: i.effectId,
|
|
3602
3645
|
transition: i.transition,
|
|
3603
3646
|
transitionProperties: i.transitionProperties,
|
|
3604
|
-
childSelector:
|
|
3647
|
+
childSelector: W(i, {
|
|
3605
3648
|
asCombinator: !0,
|
|
3606
3649
|
addItemFilter: !0,
|
|
3607
3650
|
useFirstChild: c
|
|
3608
3651
|
}),
|
|
3609
3652
|
selectorCondition: r
|
|
3610
3653
|
};
|
|
3611
|
-
if (
|
|
3654
|
+
if (f = w.getController(e), !f)
|
|
3612
3655
|
return;
|
|
3613
|
-
|
|
3656
|
+
f.renderStyle(Zn(u));
|
|
3614
3657
|
}
|
|
3615
3658
|
let a;
|
|
3616
3659
|
if (n === "animationEnd") {
|
|
3617
|
-
const
|
|
3660
|
+
const u = o.effectId, h = (l ? w.getInstance(l) : void 0)?.dataCache.effects[u];
|
|
3618
3661
|
h && (a = x(h));
|
|
3619
3662
|
}
|
|
3620
|
-
|
|
3621
|
-
reducedMotion:
|
|
3622
|
-
targetController:
|
|
3663
|
+
G[n]?.add(t, s, i, o, {
|
|
3664
|
+
reducedMotion: w.forceReducedMotion,
|
|
3665
|
+
targetController: f,
|
|
3623
3666
|
selectorCondition: r,
|
|
3624
|
-
allowA11yTriggers:
|
|
3667
|
+
allowA11yTriggers: w.allowA11yTriggers,
|
|
3625
3668
|
sourceAnimationOptions: a
|
|
3626
3669
|
});
|
|
3627
3670
|
}
|
|
3628
|
-
function
|
|
3629
|
-
const t = e.key, n =
|
|
3671
|
+
function ft(e) {
|
|
3672
|
+
const t = e.key, n = w.getInstance(t);
|
|
3630
3673
|
if (!n)
|
|
3631
|
-
return console.warn(`No instance found for key: ${t}`),
|
|
3674
|
+
return console.warn(`No instance found for key: ${t}`), w.setController(t, e), !1;
|
|
3632
3675
|
const { triggers: s = [] } = n?.get(t) || {}, i = s.length > 0;
|
|
3633
3676
|
n.setController(t, e), s.forEach((r, c) => {
|
|
3634
|
-
const l =
|
|
3677
|
+
const l = P(r.conditions, n.dataCache.conditions);
|
|
3635
3678
|
if (l) {
|
|
3636
|
-
const
|
|
3637
|
-
n.setupMediaQueryListener(
|
|
3679
|
+
const f = `${t}::trigger::${c}`;
|
|
3680
|
+
n.setupMediaQueryListener(f, l, t, () => {
|
|
3638
3681
|
e.update();
|
|
3639
3682
|
});
|
|
3640
3683
|
}
|
|
3641
|
-
(!l || l.matches)
|
|
3684
|
+
if (!l || l.matches) {
|
|
3685
|
+
if (D(t, r))
|
|
3686
|
+
return;
|
|
3687
|
+
Ie(e, e.element, r, t, "interaction"), r.listContainer && e.watchChildList(r.listContainer), Kt(t, e, n, r);
|
|
3688
|
+
}
|
|
3642
3689
|
});
|
|
3643
3690
|
let o = !1;
|
|
3644
|
-
return n && (o =
|
|
3691
|
+
return n && (o = Ut(t, e, n)), i || o;
|
|
3645
3692
|
}
|
|
3646
|
-
function
|
|
3647
|
-
const s = e.key, i =
|
|
3693
|
+
function ji(e, t, n) {
|
|
3694
|
+
const s = e.key, i = w.getInstance(s);
|
|
3648
3695
|
if (i) {
|
|
3649
3696
|
const { triggers: o = [] } = i?.get(s) || {};
|
|
3650
3697
|
o.forEach((r, c) => {
|
|
3651
3698
|
if (r.listContainer !== t)
|
|
3652
3699
|
return;
|
|
3653
|
-
const l =
|
|
3700
|
+
const l = P(r.conditions, i.dataCache.conditions);
|
|
3654
3701
|
if (l) {
|
|
3655
|
-
const
|
|
3656
|
-
i.setupMediaQueryListener(
|
|
3702
|
+
const f = `${s}::listTrigger::${t}::${c}`;
|
|
3703
|
+
i.setupMediaQueryListener(f, l, s, () => {
|
|
3657
3704
|
e.update();
|
|
3658
3705
|
});
|
|
3659
3706
|
}
|
|
3660
|
-
(!l || l.matches)
|
|
3661
|
-
|
|
3707
|
+
if (!l || l.matches) {
|
|
3708
|
+
if (D(s, r))
|
|
3709
|
+
return;
|
|
3710
|
+
Kt(s, e, i, r, n);
|
|
3711
|
+
}
|
|
3712
|
+
}), Ut(s, e, i, t, n);
|
|
3662
3713
|
}
|
|
3663
3714
|
}
|
|
3664
|
-
function
|
|
3665
|
-
const n = e.key, s =
|
|
3715
|
+
function Di(e, t = !1) {
|
|
3716
|
+
const n = e.key, s = w.getInstance(n);
|
|
3666
3717
|
if (!s)
|
|
3667
3718
|
return;
|
|
3668
3719
|
const i = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
|
|
3669
3720
|
let o;
|
|
3670
|
-
i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element],
|
|
3721
|
+
i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element], Qt(o), s.deleteController(n, t);
|
|
3671
3722
|
}
|
|
3672
|
-
function
|
|
3673
|
-
const t = Object.values(
|
|
3723
|
+
function Qt(e) {
|
|
3724
|
+
const t = Object.values(G);
|
|
3674
3725
|
for (const n of e)
|
|
3675
3726
|
for (const s of t)
|
|
3676
3727
|
s.remove(n);
|
|
3677
|
-
|
|
3728
|
+
w.removeFromSequences(e);
|
|
3678
3729
|
}
|
|
3679
|
-
const
|
|
3730
|
+
const Me = "interactEffect";
|
|
3680
3731
|
class zi {
|
|
3681
3732
|
element;
|
|
3682
3733
|
key;
|
|
@@ -3699,10 +3750,10 @@ class zi {
|
|
|
3699
3750
|
}
|
|
3700
3751
|
n !== t && (n && console.warn(
|
|
3701
3752
|
`Interact: Key mismatch between element ${n} and parameter ${t}, updating element key`
|
|
3702
|
-
), this.element.dataset.interactKey = t), this.key = t, this.connected =
|
|
3753
|
+
), this.element.dataset.interactKey = t), this.key = t, this.connected = ft(this);
|
|
3703
3754
|
}
|
|
3704
3755
|
disconnect({ removeFromCache: t = !1 } = {}) {
|
|
3705
|
-
if ((this.key || this.element.dataset.interactKey) &&
|
|
3756
|
+
if ((this.key || this.element.dataset.interactKey) && Di(this, t), this._pluginCleanups.length) {
|
|
3706
3757
|
for (const s of this._pluginCleanups)
|
|
3707
3758
|
try {
|
|
3708
3759
|
s();
|
|
@@ -3722,6 +3773,9 @@ class zi {
|
|
|
3722
3773
|
update() {
|
|
3723
3774
|
this.disconnect(), this.connect();
|
|
3724
3775
|
}
|
|
3776
|
+
resume() {
|
|
3777
|
+
this.connected && ft(this);
|
|
3778
|
+
}
|
|
3725
3779
|
renderStyle(t) {
|
|
3726
3780
|
const n = this.element?.getRootNode(), s = n.host ? n : document;
|
|
3727
3781
|
if (!this.sheet)
|
|
@@ -3745,12 +3799,12 @@ class zi {
|
|
|
3745
3799
|
return;
|
|
3746
3800
|
}
|
|
3747
3801
|
const o = new Set(
|
|
3748
|
-
this.element.dataset[
|
|
3802
|
+
this.element.dataset[Me]?.split(" ") || []
|
|
3749
3803
|
);
|
|
3750
|
-
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[
|
|
3804
|
+
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[Me] = Array.from(o).join(" ");
|
|
3751
3805
|
}
|
|
3752
3806
|
getActiveEffects() {
|
|
3753
|
-
const n = (this.element.dataset[
|
|
3807
|
+
const n = (this.element.dataset[Me] || "").trim();
|
|
3754
3808
|
return n ? n.split(/\s+/) : [];
|
|
3755
3809
|
}
|
|
3756
3810
|
watchChildList(t) {
|
|
@@ -3768,21 +3822,21 @@ class zi {
|
|
|
3768
3822
|
}), r.addedNodes.forEach((c) => {
|
|
3769
3823
|
c instanceof HTMLElement && o.push(c);
|
|
3770
3824
|
});
|
|
3771
|
-
}),
|
|
3825
|
+
}), Qt(i), s && ji(this, t, o);
|
|
3772
3826
|
}
|
|
3773
3827
|
}
|
|
3774
|
-
function
|
|
3828
|
+
function Gi(e, t) {
|
|
3775
3829
|
new zi(e, t).connect();
|
|
3776
3830
|
}
|
|
3777
|
-
function
|
|
3778
|
-
const t =
|
|
3831
|
+
function Wi(e) {
|
|
3832
|
+
const t = w.getController(e);
|
|
3779
3833
|
t && t.disconnect({ removeFromCache: !0 });
|
|
3780
3834
|
}
|
|
3781
3835
|
export {
|
|
3782
3836
|
zi as I,
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3837
|
+
w as a,
|
|
3838
|
+
Gi as b,
|
|
3839
|
+
Hi as g,
|
|
3840
|
+
Wi as r
|
|
3787
3841
|
};
|
|
3788
|
-
//# sourceMappingURL=index-
|
|
3842
|
+
//# sourceMappingURL=index-76zNBcNy.mjs.map
|