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