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