@wix/interact 2.5.13 → 2.5.14

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.
@@ -1,30 +1,22 @@
1
- function _t(e) {
1
+ function At(e) {
2
2
  return [...e.matchAll(/\[([-\w]+)]/g)].map(([t, n]) => n);
3
3
  }
4
- function _(e, t) {
5
- const n = _t(t);
4
+ function q(e, t) {
5
+ const n = At(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 kt(e, t) {
13
- return e.trigger === "viewEnter" && t.triggerType === "once" && V(e) === V(t);
12
+ function qt(e, t) {
13
+ return e.trigger === "viewEnter" && t.triggerType === "once" && ue(e) === ue(t);
14
14
  }
15
- function V(e) {
15
+ function ue(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
- function Ye(e) {
20
- let t = 0, n = 0;
21
- for (let s = 0; s < e.length; s++) {
22
- const i = e.charCodeAt(s);
23
- t = (t << 5) - t + i | 0, n = n << 3 ^ n >>> 2 ^ i | 0;
24
- }
25
- return ((t >>> 0) * 1048576 + (n >>> 0) % 1048576).toString(36);
26
- }
27
- class K {
19
+ class Q {
28
20
  animations;
29
21
  options;
30
22
  ready;
@@ -60,8 +52,8 @@ class K {
60
52
  }
61
53
  progress(t) {
62
54
  for (const n of this.animations) {
63
- const { delay: s, duration: i, iterations: r } = n.effect.getTiming(), o = (Number.isFinite(i) ? i : 0) * (Number.isFinite(r) ? r : 1);
64
- n.currentTime = ((s || 0) + o) * t;
55
+ const { delay: s, duration: i, iterations: o } = n.effect.getTiming(), r = (Number.isFinite(i) ? i : 0) * (Number.isFinite(o) ? o : 1);
56
+ n.currentTime = ((s || 0) + r) * t;
65
57
  }
66
58
  }
67
59
  cancel() {
@@ -79,8 +71,8 @@ class K {
79
71
  if (n && !this.isCSS) {
80
72
  const s = n.effect?.target;
81
73
  if (s) {
82
- const i = this.options?.effectId || n.id, r = new CustomEvent("animationend", { detail: { effectId: i } });
83
- s.dispatchEvent(r);
74
+ const i = this.options?.effectId || n.id, o = new CustomEvent("animationend", { detail: { effectId: i } });
75
+ s.dispatchEvent(o);
84
76
  }
85
77
  }
86
78
  t();
@@ -97,8 +89,8 @@ class K {
97
89
  if (s && !this.isCSS) {
98
90
  const i = s.effect?.target;
99
91
  if (i) {
100
- const r = new Event("animationcancel");
101
- i.dispatchEvent(r);
92
+ const o = new Event("animationcancel");
93
+ i.dispatchEvent(o);
102
94
  }
103
95
  }
104
96
  t();
@@ -119,73 +111,73 @@ class K {
119
111
  }
120
112
  getTimingOptions() {
121
113
  return this.animations.map((t) => {
122
- const n = t.effect?.getTiming(), s = n?.delay ?? 0, i = Number(n?.duration) || 0, r = n?.iterations ?? 1;
114
+ const n = t.effect?.getTiming(), s = n?.delay ?? 0, i = Number(n?.duration) || 0, o = n?.iterations ?? 1;
123
115
  return {
124
116
  delay: s,
125
117
  duration: i,
126
- iterations: r
118
+ iterations: o
127
119
  };
128
120
  });
129
121
  }
130
122
  }
131
- const Be = (e) => e, Pt = (e) => 1 - Math.cos(e * Math.PI / 2), Mt = (e) => Math.sin(e * Math.PI / 2), xt = (e) => -(Math.cos(Math.PI * e) - 1) / 2, Lt = (e) => e ** 2, Ft = (e) => 1 - (1 - e) ** 2, Rt = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, Nt = (e) => e ** 3, zt = (e) => 1 - (1 - e) ** 3, jt = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, Dt = (e) => e ** 4, Gt = (e) => 1 - (1 - e) ** 4, Ht = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, Wt = (e) => e ** 5, Vt = (e) => 1 - (1 - e) ** 5, Yt = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, Bt = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), Kt = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), Ut = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, Qt = (e) => 1 - Math.sqrt(1 - e ** 2), Xt = (e) => Math.sqrt(1 - (e - 1) ** 2), Zt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Jt = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, en = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, tn = (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, qe = {
132
- linear: Be,
133
- sineIn: Pt,
123
+ const Qe = (e) => e, kt = (e) => 1 - Math.cos(e * Math.PI / 2), Mt = (e) => Math.sin(e * Math.PI / 2), Pt = (e) => -(Math.cos(Math.PI * e) - 1) / 2, xt = (e) => e ** 2, Lt = (e) => 1 - (1 - e) ** 2, Ft = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, Rt = (e) => e ** 3, Nt = (e) => 1 - (1 - e) ** 3, zt = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, jt = (e) => e ** 4, Dt = (e) => 1 - (1 - e) ** 4, Ht = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, Gt = (e) => e ** 5, Wt = (e) => 1 - (1 - e) ** 5, Vt = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, Yt = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), Kt = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), Bt = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, Ut = (e) => 1 - Math.sqrt(1 - e ** 2), Qt = (e) => Math.sqrt(1 - (e - 1) ** 2), Xt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Zt = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, Jt = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, en = (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, Pe = {
124
+ linear: Qe,
125
+ sineIn: kt,
134
126
  sineOut: Mt,
135
- sineInOut: xt,
136
- quadIn: Lt,
137
- quadOut: Ft,
138
- quadInOut: Rt,
139
- cubicIn: Nt,
140
- cubicOut: zt,
141
- cubicInOut: jt,
142
- quartIn: Dt,
143
- quartOut: Gt,
127
+ sineInOut: Pt,
128
+ quadIn: xt,
129
+ quadOut: Lt,
130
+ quadInOut: Ft,
131
+ cubicIn: Rt,
132
+ cubicOut: Nt,
133
+ cubicInOut: zt,
134
+ quartIn: jt,
135
+ quartOut: Dt,
144
136
  quartInOut: Ht,
145
- quintIn: Wt,
146
- quintOut: Vt,
147
- quintInOut: Yt,
148
- expoIn: Bt,
137
+ quintIn: Gt,
138
+ quintOut: Wt,
139
+ quintInOut: Vt,
140
+ expoIn: Yt,
149
141
  expoOut: Kt,
150
- expoInOut: Ut,
151
- circIn: Qt,
152
- circOut: Xt,
153
- circInOut: Zt,
154
- backIn: Jt,
155
- backOut: en,
156
- backInOut: tn
157
- }, j = (e, t, n, s, i) => {
158
- const r = 3 * t, o = 3 * (s - 2 * t), c = 1 - 3 * s + 3 * t, a = 3 * n, f = 3 * (i - 2 * n), u = 1 - 3 * i + 3 * n;
142
+ expoInOut: Bt,
143
+ circIn: Ut,
144
+ circOut: Qt,
145
+ circInOut: Xt,
146
+ backIn: Zt,
147
+ backOut: Jt,
148
+ backInOut: en
149
+ }, G = (e, t, n, s, i) => {
150
+ const o = 3 * t, r = 3 * (s - 2 * t), a = 1 - 3 * s + 3 * t, c = 3 * n, f = 3 * (i - 2 * n), u = 1 - 3 * i + 3 * n;
159
151
  let l;
160
- if (c === 0)
161
- l = o === 0 ? `(${e} / ${r})` : `((sqrt(max(0, ${r * r} + ${4 * o} * ${e})) - ${r}) / ${2 * o})`;
152
+ if (a === 0)
153
+ l = r === 0 ? `(${e} / ${o})` : `((sqrt(max(0, ${o * o} + ${4 * r} * ${e})) - ${o}) / ${2 * r})`;
162
154
  else {
163
- const d = o / (3 * c), v = 2 * Math.pow(o, 3) - 9 * r * o * c, h = 54 * Math.pow(c, 3), m = (3 * c * r - o * o) / (9 * c * c), p = `((${v} - ${27 * c * c} * ${e}) / ${h})`;
164
- if (m < 0) {
165
- const g = 2 * Math.sqrt(-m);
166
- let E = 0;
167
- for (const w of [0, 1, 2])
155
+ const d = r / (3 * a), m = 2 * Math.pow(r, 3) - 9 * o * r * a, h = 54 * Math.pow(a, 3), p = (3 * a * o - r * r) / (9 * a * a), g = `((${m} - ${27 * a * a} * ${e}) / ${h})`;
156
+ if (p < 0) {
157
+ const v = 2 * Math.sqrt(-p);
158
+ let y = 0;
159
+ for (const $ of [0, 1, 2])
168
160
  [0, 0.25, 0.5, 0.75, 1].every((S) => {
169
161
  const I = Math.min(
170
- Math.max(2 * (v - 27 * c * c * S) / (h * m * g), -1),
162
+ Math.max(2 * (m - 27 * a * a * S) / (h * p * v), -1),
171
163
  1
172
- ), T = g * Math.cos((Math.acos(I) - w * 2 * Math.PI) / 3) - d;
173
- return T >= -1e-6 && T <= 1.000001;
174
- }) && (E = w);
175
- const y = `(acos(clamp(-1, ${2 / (m * g)} * ${p}, 1)) - ${360 * E}deg) / 3`;
176
- l = `(${g} * cos(${y}) - ${d})`;
164
+ ), O = v * Math.cos((Math.acos(I) - $ * 2 * Math.PI) / 3) - d;
165
+ return O >= -1e-6 && O <= 1.000001;
166
+ }) && (y = $);
167
+ const E = `(acos(clamp(-1, ${2 / (p * v)} * ${g}, 1)) - ${360 * y}deg) / 3`;
168
+ l = `(${v} * cos(${E}) - ${d})`;
177
169
  } else {
178
- const g = `sqrt(pow(${p}, 2) + ${Math.pow(m, 3)})`;
179
- l = `(pow(${g} - ${p}, 1 / 3) - pow(${g} + ${p}, 1 / 3) - ${d})`;
170
+ const v = `sqrt(pow(${g}, 2) + ${Math.pow(p, 3)})`;
171
+ l = `(pow(${v} - ${g}, 1 / 3) - pow(${v} + ${g}, 1 / 3) - ${d})`;
180
172
  }
181
173
  }
182
- return `(${u} * pow(${l}, 3) + ${f} * pow(${l}, 2) + ${a} * ${l})`;
183
- }, _e = {
174
+ return `(${u} * pow(${l}, 3) + ${f} * pow(${l}, 2) + ${c} * ${l})`;
175
+ }, xe = {
184
176
  linear: (e) => e,
185
- ease: (e) => j(e, 0.25, 0.1, 0.25, 1),
186
- easeIn: (e) => j(e, 0.42, 0, 1, 1),
187
- easeOut: (e) => j(e, 0, 0, 0.58, 1),
188
- easeInOut: (e) => j(e, 0.42, 0, 0.58, 1),
177
+ ease: (e) => G(e, 0.25, 0.1, 0.25, 1),
178
+ easeIn: (e) => G(e, 0.42, 0, 1, 1),
179
+ easeOut: (e) => G(e, 0, 0, 0.58, 1),
180
+ easeInOut: (e) => G(e, 0.42, 0, 0.58, 1),
189
181
  sineIn: (e) => `(1 - cos(${e} * 90deg))`,
190
182
  sineOut: (e) => `(sin(${e} * 90deg))`,
191
183
  sineInOut: (e) => `((1 - cos(${e} * 180deg)) / 2)`,
@@ -210,7 +202,7 @@ const Be = (e) => e, Pt = (e) => 1 - Math.cos(e * Math.PI / 2), Mt = (e) => Math
210
202
  backIn: (e) => `(2.70158 * pow(${e}, 3) - 1.70158 * ${e} * ${e})`,
211
203
  backOut: (e) => `(1 + 2.70158 * pow(${e} - 1, 3) + 1.70158 * (${e} - 1) * (${e} - 1))`,
212
204
  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)`
213
- }, ke = {
205
+ }, Le = {
214
206
  linear: "linear",
215
207
  ease: "ease",
216
208
  easeIn: "ease-in",
@@ -241,26 +233,26 @@ const Be = (e) => e, Pt = (e) => 1 - Math.cos(e * Math.PI / 2), Mt = (e) => Math
241
233
  backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
242
234
  backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
243
235
  };
244
- function nn(e) {
236
+ function tn(e) {
245
237
  return e === "percentage" ? "%" : e || "px";
246
238
  }
247
- const sn = /^(webkit|moz|ms|o)(?=[A-Z])/, rn = Object.assign(/* @__PURE__ */ Object.create(null), {
239
+ const nn = /^(webkit|moz|ms|o)(?=[A-Z])/, sn = Object.assign(/* @__PURE__ */ Object.create(null), {
248
240
  float: "cssFloat",
249
241
  "animation-timing-function": "easing",
250
242
  "animation-composition": "composite"
251
243
  });
252
- function ue(e) {
253
- return e.startsWith("--") ? e : (sn.test(e) ? `-${e}` : e).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
244
+ function fe(e) {
245
+ return e.startsWith("--") ? e : (nn.test(e) ? `-${e}` : e).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
254
246
  }
255
247
  function on(e) {
256
248
  return e.startsWith("--") || !e.includes("-") ? e : e.replace(/^-/, "").replace(/-([a-z])/g, (t, n) => n.toUpperCase());
257
249
  }
258
- function Ke(e) {
259
- return rn[e] || on(e);
250
+ function Xe(e) {
251
+ return sn[e] || on(e);
260
252
  }
261
- function cn(e) {
253
+ function rn(e) {
262
254
  for (const t in e)
263
- if (Object.hasOwn(e, t) && Ke(t) !== t)
255
+ if (Object.hasOwn(e, t) && Xe(t) !== t)
264
256
  return !0;
265
257
  return !1;
266
258
  }
@@ -269,138 +261,138 @@ function an(e) {
269
261
  return e;
270
262
  let t;
271
263
  return e.forEach((n, s) => {
272
- if (!n || typeof n != "object" || !cn(n))
264
+ if (!n || typeof n != "object" || !rn(n))
273
265
  return;
274
266
  t ??= e.slice();
275
267
  const i = {};
276
- for (const r in n)
277
- Object.hasOwn(n, r) && (i[Ke(r)] = n[r]);
268
+ for (const o in n)
269
+ Object.hasOwn(n, o) && (i[Xe(o)] = n[o]);
278
270
  t[s] = i;
279
271
  }), t || e;
280
272
  }
281
- function se(e) {
282
- return e ? ke[e] || e : ke.linear;
283
- }
284
- function un(e, t, n, s) {
285
- const i = 3 * e, r = 3 * (n - e) - i, o = 1 - i - r, c = 3 * t, a = 3 * (s - t) - c, f = 1 - c - a, u = (h) => ((o * h + r) * h + i) * h, l = (h) => ((f * h + a) * h + c) * h, d = (h) => (3 * o * h + 2 * r) * h + i;
286
- function v(h) {
287
- let m = h;
288
- for (let E = 0; E < 8; E++) {
289
- const y = u(m) - h;
290
- if (Math.abs(y) < 1e-7) return m;
291
- const w = d(m);
292
- if (Math.abs(w) < 1e-6) break;
293
- m -= y / w;
273
+ function oe(e) {
274
+ return e ? Le[e] || e : Le.linear;
275
+ }
276
+ function cn(e, t, n, s) {
277
+ const i = 3 * e, o = 3 * (n - e) - i, r = 1 - i - o, a = 3 * t, c = 3 * (s - t) - a, f = 1 - a - c, u = (h) => ((r * h + o) * h + i) * h, l = (h) => ((f * h + c) * h + a) * h, d = (h) => (3 * r * h + 2 * o) * h + i;
278
+ function m(h) {
279
+ let p = h;
280
+ for (let y = 0; y < 8; y++) {
281
+ const E = u(p) - h;
282
+ if (Math.abs(E) < 1e-7) return p;
283
+ const $ = d(p);
284
+ if (Math.abs($) < 1e-6) break;
285
+ p -= E / $;
294
286
  }
295
- let p = 0, g = 1;
296
- for (m = (p + g) / 2; g - p > 1e-7; ) {
297
- const E = u(m);
298
- if (Math.abs(E - h) < 1e-7) return m;
299
- h > E ? p = m : g = m, m = (p + g) / 2;
287
+ let g = 0, v = 1;
288
+ for (p = (g + v) / 2; v - g > 1e-7; ) {
289
+ const y = u(p);
290
+ if (Math.abs(y - h) < 1e-7) return p;
291
+ h > y ? g = p : v = p, p = (g + v) / 2;
300
292
  }
301
- return m;
293
+ return p;
302
294
  }
303
- return (h) => h <= 0 ? 0 : h >= 1 ? 1 : l(v(h));
295
+ return (h) => h <= 0 ? 0 : h >= 1 ? 1 : l(m(h));
304
296
  }
305
- function Ue(e) {
297
+ function Ze(e) {
306
298
  const t = e.match(
307
299
  /^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/
308
300
  );
309
301
  if (!t) return;
310
- const n = parseFloat(t[1]), s = parseFloat(t[2]), i = parseFloat(t[3]), r = parseFloat(t[4]);
311
- if (![n, s, i, r].some(isNaN))
312
- return [n, s, i, r];
302
+ const n = parseFloat(t[1]), s = parseFloat(t[2]), i = parseFloat(t[3]), o = parseFloat(t[4]);
303
+ if (![n, s, i, o].some(isNaN))
304
+ return [n, s, i, o];
313
305
  }
314
- function fn(e) {
315
- const t = Ue(e);
306
+ function un(e) {
307
+ const t = Ze(e);
316
308
  if (!(!t || t.some(isNaN)))
317
- return un(...t);
309
+ return cn(...t);
318
310
  }
319
- function ln(e) {
320
- const t = Ue(e);
311
+ function fn(e) {
312
+ const t = Ze(e);
321
313
  if (!(!t || t.some(isNaN)))
322
- return (n) => j(n, ...t);
314
+ return (n) => G(n, ...t);
323
315
  }
324
- function Qe(e) {
316
+ function Je(e) {
325
317
  const t = e.match(/^linear\((.+)\)$/);
326
318
  if (!t) return;
327
- const n = t[1].split(",").map((r) => r.trim()).filter(Boolean);
319
+ const n = t[1].split(",").map((o) => o.trim()).filter(Boolean);
328
320
  if (n.length === 0) return;
329
321
  const s = [];
330
- for (const r of n) {
331
- const o = r.split(/\s+/), c = parseFloat(o[0]);
332
- if (isNaN(c)) return;
333
- const a = [];
334
- for (let f = 1; f < o.length; f++)
335
- if (o[f].endsWith("%")) {
336
- const u = parseFloat(o[f]) / 100;
322
+ for (const o of n) {
323
+ const r = o.split(/\s+/), a = parseFloat(r[0]);
324
+ if (isNaN(a)) return;
325
+ const c = [];
326
+ for (let f = 1; f < r.length; f++)
327
+ if (r[f].endsWith("%")) {
328
+ const u = parseFloat(r[f]) / 100;
337
329
  if (isNaN(u)) return;
338
- a.push(u);
330
+ c.push(u);
339
331
  }
340
- a.length === 0 ? s.push({ output: c, pos: null }) : a.length === 1 ? s.push({ output: c, pos: a[0] }) : (s.push({ output: c, pos: a[0] }), s.push({ output: c, pos: a[1] }));
332
+ c.length === 0 ? s.push({ output: a, pos: null }) : c.length === 1 ? s.push({ output: a, pos: c[0] }) : (s.push({ output: a, pos: c[0] }), s.push({ output: a, pos: c[1] }));
341
333
  }
342
334
  if (s.length === 0) return;
343
335
  s[0].pos === null && (s[0].pos = 0), s[s.length - 1].pos === null && (s[s.length - 1].pos = 1);
344
336
  let i = 0;
345
337
  for (; i < s.length; )
346
338
  if (s[i].pos === null) {
347
- const r = i - 1;
348
- let o = i;
349
- for (; o < s.length && s[o].pos === null; ) o++;
350
- const c = s[r].pos, a = s[o].pos, f = o - r;
351
- for (let u = r + 1; u < o; u++)
352
- s[u].pos = c + (a - c) * (u - r) / f;
353
- i = o + 1;
339
+ const o = i - 1;
340
+ let r = i;
341
+ for (; r < s.length && s[r].pos === null; ) r++;
342
+ const a = s[o].pos, c = s[r].pos, f = r - o;
343
+ for (let u = o + 1; u < r; u++)
344
+ s[u].pos = a + (c - a) * (u - o) / f;
345
+ i = r + 1;
354
346
  } else
355
347
  i++;
356
- for (let r = 1; r < s.length; r++)
357
- s[r].pos < s[r - 1].pos && (s[r].pos = s[r - 1].pos);
348
+ for (let o = 1; o < s.length; o++)
349
+ s[o].pos < s[o - 1].pos && (s[o].pos = s[o - 1].pos);
358
350
  return s;
359
351
  }
360
- function dn(e) {
361
- const t = Qe(e);
352
+ function ln(e) {
353
+ const t = Je(e);
362
354
  if (t)
363
355
  return (n) => {
364
356
  if (n <= t[0].pos) return t[0].output;
365
357
  const s = t[t.length - 1];
366
358
  if (n >= s.pos) return s.output;
367
- let i = 0, r = t.length - 1;
368
- for (; i < r - 1; ) {
369
- const a = i + r >>> 1;
370
- t[a].pos <= n ? i = a : r = a;
359
+ let i = 0, o = t.length - 1;
360
+ for (; i < o - 1; ) {
361
+ const c = i + o >>> 1;
362
+ t[c].pos <= n ? i = c : o = c;
371
363
  }
372
- const o = t[i], c = t[r];
373
- return c.pos === o.pos ? c.output : o.output + (c.output - o.output) * (n - o.pos) / (c.pos - o.pos);
364
+ const r = t[i], a = t[o];
365
+ return a.pos === r.pos ? a.output : r.output + (a.output - r.output) * (n - r.pos) / (a.pos - r.pos);
374
366
  };
375
367
  }
376
- function hn(e) {
377
- const t = Qe(e);
368
+ function dn(e) {
369
+ const t = Je(e);
378
370
  if (t)
379
371
  return (n) => {
380
372
  const s = [`${t[0].output}`];
381
373
  for (let i = 1; i < t.length; i++) {
382
- const r = t[i].pos - t[i - 1].pos, o = t[i].output - t[i - 1].output;
383
- if (r === 0 && t[i - 1].pos === 0)
384
- s.push(`${o}`);
374
+ const o = t[i].pos - t[i - 1].pos, r = t[i].output - t[i - 1].output;
375
+ if (o === 0 && t[i - 1].pos === 0)
376
+ s.push(`${r}`);
385
377
  else {
386
- const c = r === 0 ? `round(${n} / ${2 * t[i - 1].pos})` : `(${n} - ${t[i - 1].pos}) / ${r}`;
387
- s.push(`clamp(0, ${c}, 1) * ${o}`);
378
+ const a = o === 0 ? `round(${n} / ${2 * t[i - 1].pos})` : `(${n} - ${t[i - 1].pos}) / ${o}`;
379
+ s.push(`clamp(0, ${a}, 1) * ${r}`);
388
380
  }
389
381
  }
390
382
  return `(${s.join(" + ")})`;
391
383
  };
392
384
  }
393
- function Xe(e) {
385
+ function et(e) {
394
386
  if (!e) return;
395
- const t = qe[e];
396
- return t || (fn(e) ?? dn(e) ?? qe.linear);
387
+ const t = Pe[e];
388
+ return t || (un(e) ?? ln(e) ?? Pe.linear);
397
389
  }
398
- function mn(e) {
390
+ function hn(e) {
399
391
  if (!e) return;
400
- const t = _e[e];
401
- return t || (ln(e) ?? hn(e) ?? _e.linear);
392
+ const t = xe[e];
393
+ return t || (fn(e) ?? dn(e) ?? xe.linear);
402
394
  }
403
- class pn extends K {
395
+ class mn extends Q {
404
396
  animationGroups;
405
397
  delay;
406
398
  offset;
@@ -409,10 +401,10 @@ class pn extends K {
409
401
  timingOptions;
410
402
  constructor(t, n = {}) {
411
403
  const s = t.flatMap((i) => [...i.animations]);
412
- 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) ?? Be, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: r, duration: o, iterations: c }) => ({
413
- delay: r,
414
- duration: Number.isFinite(o) ? o : 0,
415
- iterations: Number.isFinite(c) ? c : 1
404
+ 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 : et(n.offsetEasing) ?? Qe, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: o, duration: r, iterations: a }) => ({
405
+ delay: o,
406
+ duration: Number.isFinite(r) ? r : 0,
407
+ iterations: Number.isFinite(a) ? a : 1
416
408
  }))), this.applyOffsets(), this.ready = Promise.all(t.map((i) => i.ready)).then(() => {
417
409
  });
418
410
  }
@@ -433,26 +425,26 @@ class pn extends K {
433
425
  applyOffsets() {
434
426
  if (this.animationGroups.length === 0 || this.animations.length === 0) return;
435
427
  const t = this.calculateOffsets(), n = this.getSequenceActiveDuration(t), s = this.animationGroups.length - 1;
436
- this.animationGroups.forEach((i, r) => {
437
- i.animations.forEach((o, c) => {
438
- const a = o.effect;
439
- if (!a) return;
440
- const { delay: f, duration: u, iterations: l } = this.timingOptions[r][c], d = f + t[r], v = n - (d + u * l);
428
+ this.animationGroups.forEach((i, o) => {
429
+ i.animations.forEach((r, a) => {
430
+ const c = r.effect;
431
+ if (!c) return;
432
+ const { delay: f, duration: u, iterations: l } = this.timingOptions[o][a], d = f + t[o], m = n - (d + u * l);
441
433
  if (i.isCSS && this.sequenceId) {
442
- const { target: h } = a;
443
- h instanceof HTMLElement && (h.style.setProperty(`--motion-${this.sequenceId}-index`, `${r}`), h.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)), a.updateTiming({ endDelay: v });
434
+ const { target: h } = c;
435
+ h instanceof HTMLElement && (h.style.setProperty(`--motion-${this.sequenceId}-index`, `${o}`), h.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)), c.updateTiming({ endDelay: m });
444
436
  } else
445
- a.updateTiming({ delay: d + this.delay, endDelay: v });
437
+ c.updateTiming({ delay: d + this.delay, endDelay: m });
446
438
  });
447
439
  });
448
440
  }
449
441
  getSequenceActiveDuration(t) {
450
442
  const n = [];
451
443
  for (let s = 0; s < this.timingOptions.length; s++) {
452
- const i = this.timingOptions[s].reduce((r, o) => {
453
- if (!o) return r;
454
- const { delay: c, duration: a, iterations: f } = o;
455
- return Math.max(r, c + a * f);
444
+ const i = this.timingOptions[s].reduce((o, r) => {
445
+ if (!r) return o;
446
+ const { delay: a, duration: c, iterations: f } = r;
447
+ return Math.max(o, a + c * f);
456
448
  }, 0);
457
449
  n.push(t[s] + i);
458
450
  }
@@ -467,10 +459,10 @@ class pn extends K {
467
459
  if (t.length === 0) return;
468
460
  const n = [...t].sort((s, i) => i.index - s.index);
469
461
  for (const { index: s, group: i } of n) {
470
- const r = Math.min(s, this.animationGroups.length);
471
- this.animationGroups.splice(r, 0, i), this.timingOptions.splice(r, 0, i.getTimingOptions());
472
- const o = [...i.animations], c = this.animationGroups.slice(0, r).reduce((a, f) => a + f.animations.length, 0);
473
- this.animations.splice(c, 0, ...o);
462
+ const o = Math.min(s, this.animationGroups.length);
463
+ this.animationGroups.splice(o, 0, i), this.timingOptions.splice(o, 0, i.getTimingOptions());
464
+ const r = [...i.animations], a = this.animationGroups.slice(0, o).reduce((c, f) => c + f.animations.length, 0);
465
+ this.animations.splice(a, 0, ...r);
474
466
  }
475
467
  this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
476
468
  });
@@ -482,12 +474,12 @@ class pn extends K {
482
474
  */
483
475
  removeGroups(t) {
484
476
  const n = [], s = [], i = [];
485
- for (let r = 0; r < this.animationGroups.length; r++)
486
- t(this.animationGroups[r]) ? n.push(this.animationGroups[r]) : (s.push(this.animationGroups[r]), i.push(this.timingOptions[r]));
477
+ for (let o = 0; o < this.animationGroups.length; o++)
478
+ t(this.animationGroups[o]) ? n.push(this.animationGroups[o]) : (s.push(this.animationGroups[o]), i.push(this.timingOptions[o]));
487
479
  if (n.length === 0) return n;
488
- for (const r of n)
489
- r.cancel();
490
- return this.animationGroups = s, this.timingOptions = i, this.animations = s.flatMap((r) => [...r.animations]), this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((r) => r.ready)).then(() => {
480
+ for (const o of n)
481
+ o.cancel();
482
+ return this.animationGroups = s, this.timingOptions = i, this.animations = s.flatMap((o) => [...o.animations]), this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((o) => o.ready)).then(() => {
491
483
  }), n;
492
484
  }
493
485
  async onFinish(t) {
@@ -498,19 +490,19 @@ class pn extends K {
498
490
  }
499
491
  }
500
492
  }
501
- class gn {
493
+ class pn {
502
494
  _animation;
503
495
  customEffect;
504
496
  progress;
505
497
  _tickCbId;
506
498
  _finishHandler;
507
499
  constructor(t, n, s, i) {
508
- const r = new KeyframeEffect(n, [], {
500
+ const o = new KeyframeEffect(n, [], {
509
501
  ...s,
510
502
  composite: "add"
511
- }), { timeline: o } = i;
512
- this._animation = new Animation(r, o), this._tickCbId = null, this.progress = null, this.customEffect = (c) => t(r.target, c), this._finishHandler = (c) => {
513
- this.effect.target?.getAnimations().find((a) => a === this._animation) || this.cancel();
503
+ }), { timeline: r } = i;
504
+ this._animation = new Animation(o, r), this._tickCbId = null, this.progress = null, this.customEffect = (a) => t(o.target, a), this._finishHandler = (a) => {
505
+ this.effect.target?.getAnimations().find((c) => c === this._animation) || this.cancel();
514
506
  }, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
515
507
  }
516
508
  // private tick method for customEffect loop implementation
@@ -638,12 +630,12 @@ class gn {
638
630
  return this._animation.dispatchEvent(t);
639
631
  }
640
632
  }
641
- function vn(e) {
633
+ function gn(e) {
642
634
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
643
635
  }
644
- var ie = { exports: {} }, Pe = ie.exports, Me;
645
- function yn() {
646
- return Me || (Me = 1, (function(e) {
636
+ var re = { exports: {} }, Fe = re.exports, Re;
637
+ function vn() {
638
+ return Re || (Re = 1, (function(e) {
647
639
  (function(t) {
648
640
  var n = function() {
649
641
  }, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(u) {
@@ -676,7 +668,7 @@ function yn() {
676
668
  */
677
669
  measure: function(u, l) {
678
670
  var d = l ? u.bind(l) : u;
679
- return this.reads.push(d), r(this), d;
671
+ return this.reads.push(d), o(this), d;
680
672
  },
681
673
  /**
682
674
  * Adds a job to the
@@ -689,7 +681,7 @@ function yn() {
689
681
  */
690
682
  mutate: function(u, l) {
691
683
  var d = l ? u.bind(l) : u;
692
- return this.writes.push(d), r(this), d;
684
+ return this.writes.push(d), o(this), d;
693
685
  },
694
686
  /**
695
687
  * Clears a scheduled 'read' or 'write' task.
@@ -699,7 +691,7 @@ function yn() {
699
691
  * @public
700
692
  */
701
693
  clear: function(u) {
702
- return c(this.reads, u) || c(this.writes, u);
694
+ return a(this.reads, u) || a(this.writes, u);
703
695
  },
704
696
  /**
705
697
  * Extend this FastDom with some
@@ -738,185 +730,185 @@ function yn() {
738
730
  extend: function(u) {
739
731
  if (typeof u != "object") throw new Error("expected object");
740
732
  var l = Object.create(this);
741
- return a(l, u), l.fastdom = this, l.initialize && l.initialize(), l;
733
+ return c(l, u), l.fastdom = this, l.initialize && l.initialize(), l;
742
734
  },
743
735
  // override this with a function
744
736
  // to prevent Errors in console
745
737
  // when tasks throw
746
738
  catch: null
747
739
  };
748
- function r(u) {
749
- u.scheduled || (u.scheduled = !0, u.raf(o.bind(null, u)));
750
- }
751
740
  function o(u) {
752
- var l = u.writes, d = u.reads, v;
741
+ u.scheduled || (u.scheduled = !0, u.raf(r.bind(null, u)));
742
+ }
743
+ function r(u) {
744
+ var l = u.writes, d = u.reads, m;
753
745
  try {
754
746
  n("flushing reads", d.length), u.runTasks(d), n("flushing writes", l.length), u.runTasks(l);
755
747
  } catch (h) {
756
- v = h;
748
+ m = h;
757
749
  }
758
- if (u.scheduled = !1, (d.length || l.length) && r(u), v)
759
- if (n("task errored", v.message), u.catch) u.catch(v);
760
- else throw v;
750
+ if (u.scheduled = !1, (d.length || l.length) && o(u), m)
751
+ if (n("task errored", m.message), u.catch) u.catch(m);
752
+ else throw m;
761
753
  }
762
- function c(u, l) {
754
+ function a(u, l) {
763
755
  var d = u.indexOf(l);
764
756
  return !!~d && !!u.splice(d, 1);
765
757
  }
766
- function a(u, l) {
758
+ function c(u, l) {
767
759
  for (var d in l)
768
760
  l.hasOwnProperty(d) && (u[d] = l[d]);
769
761
  }
770
762
  var f = t.fastdom = t.fastdom || new i();
771
763
  e.exports = f;
772
- })(typeof window < "u" ? window : typeof Pe < "u" ? Pe : globalThis);
773
- })(ie)), ie.exports;
764
+ })(typeof window < "u" ? window : typeof Fe < "u" ? Fe : globalThis);
765
+ })(re)), re.exports;
774
766
  }
775
- var En = yn();
776
- const O = /* @__PURE__ */ vn(En), Ee = {};
777
- function wn(e) {
778
- Object.assign(Ee, e);
767
+ var yn = vn();
768
+ const C = /* @__PURE__ */ gn(yn), $e = {};
769
+ function En(e) {
770
+ Object.assign($e, e);
779
771
  }
780
- function bn(e) {
781
- return e in Ee ? Ee[e] : (console.warn(
772
+ function wn(e) {
773
+ return e in $e ? $e[e] : (console.warn(
782
774
  `${e} not found in registry. Please make sure to import and register the preset.`
783
775
  ), null);
784
776
  }
785
- function z(e, t) {
777
+ function H(e, t) {
786
778
  return e ? (t || document).getElementById(e) : null;
787
779
  }
788
780
  function $n(e, t) {
789
781
  return e?.matches(`[data-motion-part~="${t}"]`) ? e : e?.querySelector(`[data-motion-part~="${t}"]`);
790
782
  }
791
- function Sn(e) {
783
+ function bn(e) {
792
784
  const t = e.alternate ? "alternate" : "";
793
785
  return e.reversed ? `${t ? `${t}-` : ""}reverse` : t || "normal";
794
786
  }
795
- function pe(e) {
796
- return `${e.value}${nn(e.unit)}`;
787
+ function ve(e) {
788
+ return `${e.value}${tn(e.unit)}`;
797
789
  }
798
- function xe(e, t, n) {
799
- return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${pe(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${pe(e.offset)} + ${t})` : pe(e.offset)}`;
790
+ function Ne(e, t, n) {
791
+ return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${ve(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${ve(e.offset)} + ${t})` : ve(e.offset)}`;
800
792
  }
801
- function Ze(e) {
793
+ function tt(e) {
802
794
  return {
803
- start: xe(e.startOffset, e.startOffsetAdd),
804
- end: xe(e.endOffset, e.endOffsetAdd, !0)
795
+ start: Ne(e.startOffset, e.startOffsetAdd),
796
+ end: Ne(e.endOffset, e.endOffsetAdd, !0)
805
797
  };
806
798
  }
807
- function Je(e) {
808
- return (t) => O.measure(() => t(e));
799
+ function nt(e) {
800
+ return (t) => C.measure(() => t(e));
809
801
  }
810
- function et(e) {
811
- return (t) => O.mutate(() => t(e));
802
+ function st(e) {
803
+ return (t) => C.mutate(() => t(e));
812
804
  }
813
- function Y(e) {
805
+ function B(e) {
814
806
  if (e.namedEffect) {
815
807
  const t = e.namedEffect.type;
816
- return typeof t == "string" ? bn(t) : null;
808
+ return typeof t == "string" ? wn(t) : null;
817
809
  } else if (e.keyframeEffect) {
818
810
  const t = (s) => {
819
- const { name: i, keyframes: r } = s.keyframeEffect;
820
- return [{ ...s, name: i, keyframes: r }];
811
+ const { name: i, keyframes: o } = s.keyframeEffect;
812
+ return [{ ...s, name: i, keyframes: o }];
821
813
  };
822
814
  return { web: t, style: t, getNames: (s) => {
823
- const { effectId: i } = s, { name: r } = s.keyframeEffect, o = r || i;
824
- return o ? [o] : [];
815
+ const { effectId: i } = s, { name: o } = s.keyframeEffect, r = o || i;
816
+ return r ? [r] : [];
825
817
  } };
826
818
  } else if (e.customEffect)
827
819
  return (t) => [{ ...t, keyframes: [] }];
828
820
  return null;
829
821
  }
830
- function tt(e, t, n, s) {
831
- return e.map((i, r) => {
832
- const o = {
822
+ function it(e, t, n, s) {
823
+ return e.map((i, o) => {
824
+ const r = {
833
825
  fill: i.fill,
834
- easing: se(i.easing),
826
+ easing: oe(i.easing),
835
827
  iterations: i.iterations === 0 ? 1 / 0 : i.iterations || 1,
836
828
  composite: i.composite,
837
- direction: Sn(i)
829
+ direction: bn(i)
838
830
  };
839
- Ae(t) ? (o.duration = i.duration, o.delay = i.delay || 0) : t?.trigger === "view-progress" && (s || window.ViewTimeline) ? o.duration = "auto" : (o.duration = 99.99, o.delay = 0.01);
840
- const c = an(i.keyframes);
831
+ qe(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);
832
+ const a = an(i.keyframes);
841
833
  return {
842
- effect: c === i.keyframes ? i : { ...i, keyframes: c },
843
- options: o,
844
- id: n && `${n}-${r + 1}`,
834
+ effect: a === i.keyframes ? i : { ...i, keyframes: a },
835
+ options: r,
836
+ id: n && `${n}-${o + 1}`,
845
837
  part: i.part
846
838
  };
847
839
  });
848
840
  }
849
- function Ae(e) {
841
+ function qe(e) {
850
842
  return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
851
843
  }
852
- function Le(e, t, n, s, i) {
844
+ function ze(e, t, n, s, i) {
853
845
  if (e) {
854
- if (Ae(s) && (t.duration = t.duration || 1, i?.reducedMotion))
846
+ if (qe(s) && (t.duration = t.duration || 1, i?.reducedMotion))
855
847
  if (t.iterations === 1 || t.iterations == null)
856
848
  t = { ...t, duration: 1 };
857
849
  else
858
850
  return [];
859
- let r;
860
- return n instanceof HTMLElement && (r = { measure: Je(n), mutate: et(n) }), e.web ? e.web(t, r, i) : e(t, r, i);
851
+ let o;
852
+ return n instanceof HTMLElement && (o = { measure: nt(n), mutate: st(n) }), e.web ? e.web(t, o, i) : e(t, o, i);
861
853
  }
862
854
  return [];
863
855
  }
864
- function nt(e, t, n, s, i) {
865
- const r = typeof e == "string" ? z(e, i) : e;
856
+ function ot(e, t, n, s, i) {
857
+ const o = typeof e == "string" ? H(e, i) : e;
866
858
  if (n?.trigger === "pointer-move" && !t.keyframeEffect) {
867
859
  let d = t;
868
860
  t.customEffect && (d = {
869
861
  ...t,
870
862
  namedEffect: { id: "", type: "CustomMouse" }
871
863
  });
872
- const v = Y(
864
+ const m = B(
873
865
  d
874
- ), h = Le(
875
- v,
866
+ ), h = ze(
867
+ m,
876
868
  t,
877
- r,
869
+ o,
878
870
  n,
879
871
  s
880
872
  );
881
- return typeof h != "function" ? null : h(r);
873
+ return typeof h != "function" ? null : h(o);
882
874
  }
883
- const o = Y(t), c = Le(
884
- o,
885
- t,
875
+ const r = B(t), a = ze(
886
876
  r,
877
+ t,
878
+ o,
887
879
  n,
888
880
  s
889
881
  );
890
- if (!c || c.length === 0)
882
+ if (!a || a.length === 0)
891
883
  return null;
892
- const a = tt(c, n, t.effectId);
884
+ const c = it(a, n, t.effectId);
893
885
  let f;
894
886
  const u = n?.trigger === "view-progress";
895
887
  u && window.ViewTimeline && (f = new ViewTimeline({
896
- subject: n.element || z(n.componentId)
888
+ subject: n.element || H(n.componentId)
897
889
  }));
898
- const l = a.map(({ effect: d, options: v, id: h, part: m }) => {
899
- const p = m ? $n(r, m) : r, g = new KeyframeEffect(p || null, [], v);
900
- O.mutate(() => {
901
- "timing" in d && g.updateTiming(d.timing), g.setKeyframes(d.keyframes);
890
+ const l = c.map(({ effect: d, options: m, id: h, part: p }) => {
891
+ const g = p ? $n(o, p) : o, v = new KeyframeEffect(g || null, [], m);
892
+ C.mutate(() => {
893
+ "timing" in d && v.updateTiming(d.timing), v.setKeyframes(d.keyframes);
902
894
  });
903
- const E = u && f ? { timeline: f } : {}, y = typeof d.customEffect == "function" ? new gn(
895
+ const y = u && f ? { timeline: f } : {}, E = typeof d.customEffect == "function" ? new pn(
904
896
  d.customEffect,
905
- p || null,
906
- v,
907
- E
908
- ) : new Animation(g, E.timeline);
897
+ g || null,
898
+ m,
899
+ y
900
+ ) : new Animation(v, y.timeline);
909
901
  if (u)
910
902
  if (f)
911
- O.mutate(() => {
912
- const { start: w, end: $ } = Ze(d);
913
- y.rangeStart = w, y.rangeEnd = $, y.play();
903
+ C.mutate(() => {
904
+ const { start: $, end: b } = tt(d);
905
+ E.rangeStart = $, E.rangeEnd = b, E.play();
914
906
  });
915
907
  else {
916
- const { startOffset: w, endOffset: $ } = t;
917
- O.mutate(() => {
918
- const S = d.startOffset || w, I = d.endOffset || $;
919
- Object.assign(y, {
908
+ const { startOffset: $, endOffset: b } = t;
909
+ C.mutate(() => {
910
+ const S = d.startOffset || $, I = d.endOffset || b;
911
+ Object.assign(E, {
920
912
  start: {
921
913
  name: S.name,
922
914
  offset: S.offset?.value,
@@ -930,92 +922,92 @@ function nt(e, t, n, s, i) {
930
922
  });
931
923
  });
932
924
  }
933
- return h && (y.id = h), y;
925
+ return h && (E.id = h), E;
934
926
  });
935
- return new K(l, {
927
+ return new Q(l, {
936
928
  ...t,
937
929
  trigger: { ...n || {} },
938
930
  // make sure the group is ready after all animation targets are measured and mutated
939
- measured: new Promise((d) => O.mutate(d))
931
+ measured: new Promise((d) => C.mutate(d))
940
932
  });
941
933
  }
942
- function In(e, t) {
934
+ function Sn(e, t) {
943
935
  return e ? `#${e}${t ? `[data-motion-part~="${t}"]` : ""}` : "";
944
936
  }
945
- function Tn(e, t, n) {
946
- const { duration: s, delay: i, iterations: r = 1, fill: o, easing: c = "linear", direction: a } = e.options, f = e.effect.name, u = s === "auto", { sequenceId: l, delay: d, offset: v, offsetEasing: h = "linear" } = n || {};
947
- let m = `${i ?? 0}ms`;
937
+ function In(e, t, n) {
938
+ const { duration: s, delay: i, iterations: o = 1, fill: r, easing: a = "linear", direction: c } = e.options, f = e.effect.name, u = s === "auto", { sequenceId: l, delay: d, offset: m, offsetEasing: h = "linear" } = n || {};
939
+ let p = `${i ?? 0}ms`;
948
940
  if (l && typeof h == "string") {
949
- const p = mn(h);
950
- if (p) {
951
- const g = (i ?? 0) + (d ?? 0);
952
- if (v) {
953
- const E = p(
941
+ const g = hn(h);
942
+ if (g) {
943
+ const v = (i ?? 0) + (d ?? 0);
944
+ if (m) {
945
+ const y = g(
954
946
  `(var(--motion-${l}-index, 0) / var(--motion-${l}-last, 1))`
955
947
  );
956
- m = `calc(${`(${g} + ${E} * ${v} * var(--motion-${l}-last, 1))`} * 1ms)`;
948
+ p = `calc(${`(${v} + ${y} * ${m} * var(--motion-${l}-last, 1))`} * 1ms)`;
957
949
  } else
958
- m = `${g}ms`;
950
+ p = `${v}ms`;
959
951
  }
960
952
  }
961
- return `${f} ${u ? "auto" : `${s}ms`}${u ? " " : ` ${m} `}${c}${o && o !== "none" ? ` ${o}` : ""} ${!r || r === 1 / 0 ? "infinite" : r}${a === "normal" ? "" : ` ${a}`} ${t ? "" : "paused"}`;
953
+ return `${f} ${u ? "auto" : `${s}ms`}${u ? " " : ` ${p} `}${a}${r && r !== "none" ? ` ${r}` : ""} ${!o || o === 1 / 0 ? "infinite" : o}${c === "normal" ? "" : ` ${c}`} ${t ? "" : "paused"}`;
962
954
  }
963
- function On(e, t, n) {
964
- return e?.style ? (Ae(n) && (t.duration = t.duration || 1), e.style(t)) : [];
955
+ function Tn(e, t, n) {
956
+ return e?.style ? (qe(n) && (t.duration = t.duration || 1), e.style(t)) : [];
965
957
  }
966
958
  function Cn(e, t, n, s) {
967
- const i = Y(t), r = On(i, t), o = tt(r, n, t.effectId, !0), c = n?.trigger === "view-progress";
968
- return o.map((a, f) => {
969
- const { start: u, end: l } = c ? Ze(a.effect) : {};
959
+ const i = B(t), o = Tn(i, t), r = it(o, n, t.effectId, !0), a = n?.trigger === "view-progress";
960
+ return r.map((c, f) => {
961
+ const { start: u, end: l } = a ? tt(c.effect) : {};
970
962
  return {
971
- target: In(e, a.part),
972
- animation: Tn(a, c, s),
973
- composition: a.options.composite,
974
- custom: a.effect.custom,
975
- name: a.effect.name,
976
- keyframes: a.effect.keyframes,
977
- id: a.id && `${a.id}-${f + 1}`,
978
- animationTimeline: c ? `--${n?.id}` : "",
963
+ target: Sn(e, c.part),
964
+ animation: In(c, a, s),
965
+ composition: c.options.composite,
966
+ custom: c.effect.custom,
967
+ name: c.effect.name,
968
+ keyframes: c.effect.keyframes,
969
+ id: c.id && `${c.id}-${f + 1}`,
970
+ animationTimeline: a ? `--${n?.id}` : "",
979
971
  animationRange: u || l ? `${u} ${l}` : ""
980
972
  };
981
973
  });
982
974
  }
983
- function An(e, t, n) {
984
- const s = Y(t), i = e instanceof HTMLElement ? e : z(e);
975
+ function On(e, t, n) {
976
+ const s = B(t), i = e instanceof HTMLElement ? e : H(e);
985
977
  if (s && s.prepare && i) {
986
- const r = { measure: Je(i), mutate: et(i) };
987
- s.prepare(t, r);
978
+ const o = { measure: nt(i), mutate: st(i) };
979
+ s.prepare(t, o);
988
980
  }
989
- n && O.mutate(n);
981
+ n && C.mutate(n);
990
982
  }
991
- function st(e, t) {
992
- const n = Y(t);
983
+ function rt(e, t) {
984
+ const n = B(t);
993
985
  if (!n)
994
986
  return null;
995
987
  if (!n.style)
996
- return t.effectId && e ? qn(e, t.effectId) : null;
997
- const s = n.getNames(t), r = (typeof e == "string" ? z(e) : e)?.getAnimations(), o = r?.map((a) => a.animationName) || [], c = [];
998
- return s.forEach((a) => {
999
- o.includes(a) && c.push(
1000
- r?.find((f) => f.animationName === a)
988
+ return t.effectId && e ? _n(e, t.effectId) : null;
989
+ const s = n.getNames(t), o = (typeof e == "string" ? H(e) : e)?.getAnimations(), r = o?.map((c) => c.animationName) || [], a = [];
990
+ return s.forEach((c) => {
991
+ r.includes(c) && a.push(
992
+ o?.find((f) => f.animationName === c)
1001
993
  );
1002
- }), c?.length ? new K(c) : null;
994
+ }), a?.length ? new Q(a) : null;
1003
995
  }
1004
- function qn(e, t) {
1005
- const s = (typeof e == "string" ? z(e) : e)?.getAnimations().filter((i) => {
1006
- const r = i.id || i.animationName;
1007
- return r ? r.startsWith(t) : !0;
996
+ function _n(e, t) {
997
+ const s = (typeof e == "string" ? H(e) : e)?.getAnimations().filter((i) => {
998
+ const o = i.id || i.animationName;
999
+ return o ? o.startsWith(t) : !0;
1008
1000
  });
1009
- return s?.length ? new K(s) : null;
1001
+ return s?.length ? new Q(s) : null;
1010
1002
  }
1011
- function it(e, t, n, s = {}) {
1012
- const { disabled: i, allowActiveEvent: r, ...o } = s, c = nt(e, t, n, o);
1013
- if (!c)
1003
+ function at(e, t, n, s = {}) {
1004
+ const { disabled: i, allowActiveEvent: o, ...r } = s, a = ot(e, t, n, r);
1005
+ if (!a)
1014
1006
  return null;
1015
- let a = {};
1007
+ let c = {};
1016
1008
  if (n.trigger === "view-progress" && !window.ViewTimeline) {
1017
- const f = n.element || z(n.componentId), { ready: u } = c;
1018
- return c.animations.map((l) => ({
1009
+ const f = n.element || H(n.componentId), { ready: u } = a;
1010
+ return a.animations.map((l) => ({
1019
1011
  /* we use getters for start and end in order to access the animation's start and end
1020
1012
  only when initializing the scrub scene rather than immediately */
1021
1013
  get start() {
@@ -1027,11 +1019,11 @@ function it(e, t, n, s = {}) {
1027
1019
  viewSource: f,
1028
1020
  ready: u,
1029
1021
  getProgress() {
1030
- return c.getProgress();
1022
+ return a.getProgress();
1031
1023
  },
1032
- effect(d, v) {
1033
- const { activeDuration: h } = l.effect.getComputedTiming(), { delay: m } = l.effect.getTiming();
1034
- l.currentTime = ((m || 0) + (h || 0)) * v;
1024
+ effect(d, m) {
1025
+ const { activeDuration: h } = l.effect.getComputedTiming(), { delay: p } = l.effect.getTiming();
1026
+ l.currentTime = ((p || 0) + (h || 0)) * m;
1035
1027
  },
1036
1028
  disabled: i,
1037
1029
  destroy() {
@@ -1039,9 +1031,9 @@ function it(e, t, n, s = {}) {
1039
1031
  }
1040
1032
  }));
1041
1033
  } else if (n.trigger === "pointer-move") {
1042
- const f = t, { centeredToTarget: u, transitionDuration: l, transitionEasing: d } = f, v = n.axis;
1034
+ const f = t, { centeredToTarget: u, transitionDuration: l, transitionEasing: d } = f, m = n.axis;
1043
1035
  if (f.keyframeEffect) {
1044
- const h = c;
1036
+ const h = a;
1045
1037
  return h.animations?.length === 0 ? null : {
1046
1038
  target: void 0,
1047
1039
  centeredToTarget: u,
@@ -1050,9 +1042,9 @@ function it(e, t, n, s = {}) {
1050
1042
  getProgress() {
1051
1043
  return this._currentProgress;
1052
1044
  },
1053
- effect(p, g) {
1054
- const E = v === "x" ? g.x : g.y;
1055
- this._currentProgress = E, h.progress(E);
1045
+ effect(g, v) {
1046
+ const y = m === "x" ? v.x : v.y;
1047
+ this._currentProgress = y, h.progress(y);
1056
1048
  },
1057
1049
  disabled: i ?? !1,
1058
1050
  destroy() {
@@ -1060,18 +1052,18 @@ function it(e, t, n, s = {}) {
1060
1052
  }
1061
1053
  };
1062
1054
  }
1063
- a = {
1055
+ c = {
1064
1056
  centeredToTarget: u,
1065
- allowActiveEvent: r
1066
- }, t.customEffect && l && (a.transitionDuration = l, a.transitionEasing = Xe(d)), a.target = c.target;
1057
+ allowActiveEvent: o
1058
+ }, t.customEffect && l && (c.transitionDuration = l, c.transitionEasing = et(d)), c.target = a.target;
1067
1059
  }
1068
1060
  return {
1069
- ...a,
1061
+ ...c,
1070
1062
  getProgress() {
1071
- return c.getProgress();
1063
+ return a.getProgress();
1072
1064
  },
1073
1065
  effect(f, u, l, d) {
1074
- c.progress(
1066
+ a.progress(
1075
1067
  l ? {
1076
1068
  // @ts-expect-error spread error on p
1077
1069
  ...u,
@@ -1082,203 +1074,203 @@ function it(e, t, n, s = {}) {
1082
1074
  },
1083
1075
  disabled: i,
1084
1076
  destroy() {
1085
- c.cancel();
1077
+ a.cancel();
1086
1078
  }
1087
1079
  };
1088
1080
  }
1089
- function U(e, t, n, s = !1) {
1090
- const i = st(e, t);
1091
- return i ? (i.ready = new Promise((r) => {
1092
- An(e, t, r);
1093
- }), i) : nt(e, t, n, { reducedMotion: s });
1081
+ function X(e, t, n, s = !1) {
1082
+ const i = rt(e, t);
1083
+ return i ? (i.ready = new Promise((o) => {
1084
+ On(e, t, o);
1085
+ }), i) : ot(e, t, n, { reducedMotion: s });
1094
1086
  }
1095
- function _n(e) {
1087
+ function An(e) {
1096
1088
  return e === null ? [null] : typeof e == "string" ? Array.from(document.querySelectorAll(e)) : Array.isArray(e) ? e : [e];
1097
1089
  }
1098
- function rt(e, t) {
1090
+ function ct(e, t) {
1099
1091
  const n = [];
1100
1092
  for (const { target: s, options: i } of e) {
1101
- const r = _n(s);
1102
- for (const o of r) {
1103
- const c = U(
1104
- o,
1093
+ const o = An(s);
1094
+ for (const r of o) {
1095
+ const a = X(
1096
+ r,
1105
1097
  i,
1106
1098
  void 0,
1107
1099
  t?.reducedMotion
1108
1100
  );
1109
- c instanceof K && n.push(c);
1101
+ a instanceof Q && n.push(a);
1110
1102
  }
1111
1103
  }
1112
1104
  return n;
1113
1105
  }
1114
- function kn(e, t, n) {
1115
- const s = rt(t, n);
1116
- return new pn(s, e);
1106
+ function qn(e, t, n) {
1107
+ const s = ct(t, n);
1108
+ return new mn(s, e);
1117
1109
  }
1118
- const Z = {
1110
+ const ee = {
1119
1111
  rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
1120
1112
  rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
1121
1113
  };
1122
- function Pn(e, t) {
1123
- const n = e?.name ?? Z.rangeStart.name, s = t?.name ?? e?.name ?? Z.rangeEnd.name, i = {
1114
+ function kn(e, t) {
1115
+ const n = e?.name ?? ee.rangeStart.name, s = t?.name ?? e?.name ?? ee.rangeEnd.name, i = {
1124
1116
  name: n,
1125
- offset: e?.offset || Z.rangeStart.offset
1126
- }, r = {
1117
+ offset: e?.offset || ee.rangeStart.offset
1118
+ }, o = {
1127
1119
  name: s,
1128
- offset: t?.offset || Z.rangeEnd.offset
1120
+ offset: t?.offset || ee.rangeEnd.offset
1129
1121
  };
1130
- return { startOffset: i, endOffset: r };
1122
+ return { startOffset: i, endOffset: o };
1131
1123
  }
1132
- function M(e) {
1124
+ function P(e) {
1133
1125
  if ("keyframeEffect" in e && !e.keyframeEffect.name && "effectId" in e && (e.keyframeEffect.name = e.effectId), "duration" in e)
1134
1126
  return {
1135
1127
  id: "",
1136
1128
  ...e
1137
1129
  };
1138
- const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: r } = Pn(t, n);
1130
+ const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } = kn(t, n);
1139
1131
  return {
1140
1132
  id: "",
1141
1133
  startOffset: i,
1142
- endOffset: r,
1134
+ endOffset: o,
1143
1135
  ...s
1144
1136
  };
1145
1137
  }
1146
- function q(e, t, n) {
1138
+ function A(e, t, n) {
1147
1139
  let s = e.get(t);
1148
1140
  s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), s.add(n);
1149
1141
  }
1150
- function Q(e, t) {
1142
+ function Z(e, t) {
1151
1143
  e.get(t)?.forEach((s) => {
1152
- const { source: i, target: r, cleanup: o } = s;
1153
- o();
1154
- const c = i === t ? r : i;
1155
- e.get(c)?.delete(s);
1144
+ const { source: i, target: o, cleanup: r } = s;
1145
+ r();
1146
+ const a = i === t ? o : i;
1147
+ e.get(a)?.delete(s);
1156
1148
  }), e.delete(t);
1157
1149
  }
1158
1150
  const Mn = {
1159
1151
  root: null,
1160
1152
  rootMargin: "0px 0px -10% 0px",
1161
1153
  threshold: [0]
1162
- }, xn = {
1154
+ }, Pn = {
1163
1155
  root: null,
1164
1156
  rootMargin: "0px",
1165
1157
  threshold: [0]
1166
- }, Ln = 0.2;
1167
- function Fn(e) {
1168
- const t = e.trim().split(/\s+/), n = t[0], s = t.length > 1 ? t[1] : t[0], i = (r) => r.startsWith("-") ? r.slice(1) : parseFloat(r) ? `-${r}` : r;
1158
+ }, xn = 0.2;
1159
+ function Ln(e) {
1160
+ 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;
1169
1161
  return `${i(n)} 0px ${i(s)}`;
1170
1162
  }
1171
- const W = {}, x = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakSet(), D = /* @__PURE__ */ new WeakMap();
1172
- let ot = {}, G = null;
1173
- function Rn(e) {
1174
- ot = e;
1163
+ const K = {}, L = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakSet(), W = /* @__PURE__ */ new WeakMap();
1164
+ let ut = {}, V = null;
1165
+ function Fn(e) {
1166
+ ut = e;
1175
1167
  }
1176
- function ct(e, t, n) {
1177
- x.get(e)?.forEach(({ source: i, handler: r }) => {
1178
- i === e && r(t, n);
1168
+ function ft(e, t, n) {
1169
+ L.get(e)?.forEach(({ source: i, handler: o }) => {
1170
+ i === e && o(t, n);
1179
1171
  });
1180
1172
  }
1181
- function Fe() {
1182
- return G || (G = new IntersectionObserver((e) => {
1173
+ function je() {
1174
+ return V || (V = new IntersectionObserver((e) => {
1183
1175
  e.forEach((t) => {
1184
1176
  const n = t.target;
1185
- t.isIntersecting || ct(n, !1, !0);
1177
+ t.isIntersecting || ft(n, !1, !0);
1186
1178
  });
1187
- }, xn), G);
1179
+ }, Pn), V);
1188
1180
  }
1189
- function at(e, t = !1) {
1181
+ function lt(e, t = !1) {
1190
1182
  const n = JSON.stringify({ ...e, isSafeMode: t });
1191
- if (W[n])
1192
- return W[n];
1193
- const s = e.threshold ?? Ln, i = t ? Mn : {
1183
+ if (K[n])
1184
+ return K[n];
1185
+ const s = e.threshold ?? xn, i = t ? Mn : {
1194
1186
  root: null,
1195
- rootMargin: e.inset ? Fn(e.inset) : "0px",
1187
+ rootMargin: e.inset ? Ln(e.inset) : "0px",
1196
1188
  threshold: s
1197
- }, r = new IntersectionObserver((o) => {
1198
- o.forEach((c) => {
1199
- const a = c.target, f = !fe.has(a);
1200
- if (f && (fe.add(a), e.useSafeViewEnter && !c.isIntersecting)) {
1201
- O.measure(() => {
1202
- const u = c.boundingClientRect.height, l = c.rootBounds?.height;
1189
+ }, o = new IntersectionObserver((r) => {
1190
+ r.forEach((a) => {
1191
+ const c = a.target, f = !le.has(c);
1192
+ if (f && (le.add(c), e.useSafeViewEnter && !a.isIntersecting)) {
1193
+ C.measure(() => {
1194
+ const u = a.boundingClientRect.height, l = a.rootBounds?.height;
1203
1195
  if (!l)
1204
1196
  return;
1205
1197
  const d = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
1206
- d && u * d > l && O.mutate(() => {
1207
- r.unobserve(a);
1208
- const h = at(e, !0);
1209
- D.set(a, h), h.observe(a);
1198
+ d && u * d > l && C.mutate(() => {
1199
+ o.unobserve(c);
1200
+ const h = lt(e, !0);
1201
+ W.set(c, h), h.observe(c);
1210
1202
  });
1211
1203
  });
1212
1204
  return;
1213
1205
  }
1214
- (c.isIntersecting || !f) && ct(a, c.isIntersecting);
1206
+ (a.isIntersecting || !f) && ft(c, a.isIntersecting);
1215
1207
  });
1216
1208
  }, i);
1217
- return W[n] = r, r;
1209
+ return K[n] = o, o;
1218
1210
  }
1219
- function Nn(e, t, n, s = {}, { reducedMotion: i, selectorCondition: r, animation: o } = {}) {
1220
- const c = { ...ot, ...s }, a = n.triggerType || "once", f = o || U(
1211
+ function Rn(e, t, n, s = {}, { reducedMotion: i, selectorCondition: o, animation: r } = {}) {
1212
+ const a = { ...ut, ...s }, c = n.triggerType || "once", f = r || X(
1221
1213
  t,
1222
- M(n),
1214
+ P(n),
1223
1215
  void 0,
1224
1216
  i
1225
1217
  );
1226
1218
  if (!f)
1227
1219
  return;
1228
- const u = at(c);
1229
- a !== "once" && f.persist?.();
1230
- let l = !0, d = !1, v;
1231
- v = { source: e, target: t, handler: (p, g) => {
1232
- if (!(r && !t.matches(r)))
1233
- if (a === "once") {
1234
- if (p && !d) {
1235
- d = !0, x.get(e)?.delete(v), x.get(t)?.delete(v);
1236
- const E = x.get(e);
1237
- (!E || E.size === 0) && ((D.get(e) || u).unobserve(e), fe.delete(e)), f.play(() => {
1238
- const y = () => {
1220
+ const u = lt(a);
1221
+ c !== "once" && f.persist?.();
1222
+ let l = !0, d = !1, m;
1223
+ m = { source: e, target: t, handler: (g, v) => {
1224
+ if (!(o && !t.matches(o)))
1225
+ if (c === "once") {
1226
+ if (g && !d) {
1227
+ d = !0, L.get(e)?.delete(m), L.get(t)?.delete(m);
1228
+ const y = L.get(e);
1229
+ (!y || y.size === 0) && ((W.get(e) || u).unobserve(e), le.delete(e)), f.play(() => {
1230
+ const E = () => {
1239
1231
  t.dataset.interactEnter = "start";
1240
1232
  };
1241
1233
  if (f.isCSS) {
1242
- O.mutate(() => {
1243
- requestAnimationFrame(y);
1234
+ C.mutate(() => {
1235
+ requestAnimationFrame(E);
1244
1236
  });
1245
- const w = () => {
1246
- O.mutate(() => {
1237
+ const $ = () => {
1238
+ C.mutate(() => {
1247
1239
  t.dataset.interactEnter = "done";
1248
1240
  });
1249
1241
  };
1250
- f.onFinish(w), f.onAbort(w);
1242
+ f.onFinish($), f.onAbort($);
1251
1243
  } else
1252
- O.mutate(y);
1244
+ C.mutate(E);
1253
1245
  });
1254
1246
  }
1255
- } else a === "alternate" ? l && p ? (l = !1, f.play()) : l || f.reverse() : a === "repeat" ? p ? (f.progress(0), f.play()) : g && (f.pause(), f.progress(0)) : a === "state" && (p ? f.play() : g && f.pause());
1247
+ } else c === "alternate" ? l && g ? (l = !1, f.play()) : l || f.reverse() : c === "repeat" ? g ? (f.progress(0), f.play()) : v && (f.pause(), f.progress(0)) : c === "state" && (g ? f.play() : v && f.pause());
1256
1248
  }, cleanup: () => {
1257
- (D.get(e) || u).unobserve(e), (a === "repeat" || a === "state") && Fe().unobserve(e), f.cancel(), fe.delete(e), D.delete(e);
1258
- } }, q(x, e, v), q(x, t, v), D.set(e, u), u.observe(e), (a === "repeat" || a === "state") && Fe().observe(e);
1249
+ (W.get(e) || u).unobserve(e), (c === "repeat" || c === "state") && je().unobserve(e), f.cancel(), le.delete(e), W.delete(e);
1250
+ } }, A(L, e, m), A(L, t, m), W.set(e, u), u.observe(e), (c === "repeat" || c === "state") && je().observe(e);
1259
1251
  }
1260
- function zn(e) {
1261
- Q(x, e);
1252
+ function Nn(e) {
1253
+ Z(L, e);
1262
1254
  }
1263
- function jn() {
1264
- G = null, Object.keys(W).forEach((e) => delete W[e]);
1255
+ function zn() {
1256
+ V = null, Object.keys(K).forEach((e) => delete K[e]);
1265
1257
  }
1266
- const Dn = {
1267
- add: Nn,
1268
- remove: zn,
1269
- setOptions: Rn,
1270
- reset: jn
1258
+ const jn = {
1259
+ add: Rn,
1260
+ remove: Nn,
1261
+ setOptions: Fn,
1262
+ reset: zn
1271
1263
  };
1272
- function ut(e, t) {
1264
+ function dt(e, t) {
1273
1265
  return Object.assign(Object.create(t), e);
1274
1266
  }
1275
- function Gn(e, t, n, s) {
1267
+ function Dn(e, t, n, s) {
1276
1268
  let i = e * (1 - n) + t * n;
1277
1269
  if (s) {
1278
- const r = i - e;
1279
- Math.abs(r) < s && (i = e + s * Math.sign(r));
1280
- const o = t - i;
1281
- if (Math.abs(o) < s)
1270
+ const o = i - e;
1271
+ Math.abs(o) < s && (i = e + s * Math.sign(o));
1272
+ const r = t - i;
1273
+ if (Math.abs(r) < s)
1282
1274
  return t;
1283
1275
  }
1284
1276
  return i;
@@ -1291,7 +1283,7 @@ function Hn(e) {
1291
1283
  }));
1292
1284
  };
1293
1285
  }
1294
- function Re(e, t) {
1286
+ function De(e, t) {
1295
1287
  let n = 0;
1296
1288
  return function() {
1297
1289
  n && window.clearTimeout(n), n = window.setTimeout(() => {
@@ -1299,112 +1291,112 @@ function Re(e, t) {
1299
1291
  }, t);
1300
1292
  };
1301
1293
  }
1302
- function Wn(e, t) {
1294
+ function Gn(e, t) {
1303
1295
  const n = e.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);
1304
- return le(n[1], t) + le(n[6], t);
1296
+ return de(n[1], t) + de(n[6], t);
1305
1297
  }
1306
- function le(e, t) {
1307
- 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) ? Wn(e, t) : parseInt(e) || 0 : 0;
1298
+ function de(e, t) {
1299
+ 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) ? Gn(e, t) : parseInt(e) || 0 : 0;
1308
1300
  }
1309
- function F(e, t, n) {
1310
- const { name: s, offset: i = 0 } = e, { start: r, end: o } = n, c = o - r, a = i / 100;
1301
+ function R(e, t, n) {
1302
+ const { name: s, offset: i = 0 } = e, { start: o, end: r } = n, a = r - o, c = i / 100;
1311
1303
  let f, u;
1312
- return s === "entry" ? (f = r - t, u = Math.min(t, c)) : s === "entry-crossing" ? (f = r - t, u = c) : s === "contain" ? (f = Math.min(o - t, r), u = Math.abs(t - c)) : s === "exit" ? (f = Math.max(r, o - t), u = Math.min(t, c)) : s === "exit-crossing" ? (f = r, u = c) : s === "cover" && (f = r - t, u = c + t), f + a * u | 0;
1313
- }
1314
- function ge(e, t, n, s, i) {
1315
- let r = 0;
1316
- const o = { start: t, end: n };
1317
- return e.forEach((c, a) => {
1318
- r += c.offset;
1319
- const f = c.sticky;
1304
+ return s === "entry" ? (f = o - t, u = Math.min(t, a)) : s === "entry-crossing" ? (f = o - t, u = a) : s === "contain" ? (f = Math.min(r - t, o), u = Math.abs(t - a)) : s === "exit" ? (f = Math.max(o, r - t), u = Math.min(t, a)) : s === "exit-crossing" ? (f = o, u = a) : s === "cover" && (f = o - t, u = a + t), f + c * u | 0;
1305
+ }
1306
+ function ye(e, t, n, s, i) {
1307
+ let o = 0;
1308
+ const r = { start: t, end: n };
1309
+ return e.forEach((a, c) => {
1310
+ o += a.offset;
1311
+ const f = a.sticky;
1320
1312
  if (f) {
1321
- if ("end" in f && e[a - 1]?.element) {
1322
- const d = ((i ? c.element.offsetWidth : c.element.offsetHeight) || 0) + f.end - s, v = r + d - c.offset, h = v < o.start, m = !h && v <= n;
1323
- let p = 0;
1324
- (h || m) && (p = c.offset, o.end += p), h && (o.start += p);
1313
+ if ("end" in f && e[c - 1]?.element) {
1314
+ const d = ((i ? a.element.offsetWidth : a.element.offsetHeight) || 0) + f.end - s, m = o + d - a.offset, h = m < r.start, p = !h && m <= n;
1315
+ let g = 0;
1316
+ (h || p) && (g = a.offset, r.end += g), h && (r.start += g);
1325
1317
  }
1326
1318
  if ("start" in f) {
1327
- const u = r - f.start, l = u < o.start, d = !l && u <= o.end;
1328
- let v = 0;
1329
- const h = e[a - 1]?.element;
1319
+ const u = o - f.start, l = u < r.start, d = !l && u <= r.end;
1320
+ let m = 0;
1321
+ const h = e[c - 1]?.element;
1330
1322
  if (h) {
1331
1323
  if (l || d) {
1332
- const m = (i ? h.offsetWidth : h.offsetHeight) || 0, p = c.offset, g = (i ? c.element.offsetWidth : c.element.offsetHeight) || 0;
1333
- v = m - (p + g), r += v, o.end += v;
1324
+ const p = (i ? h.offsetWidth : h.offsetHeight) || 0, g = a.offset, v = (i ? a.element.offsetWidth : a.element.offsetHeight) || 0;
1325
+ m = p - (g + v), o += m, r.end += m;
1334
1326
  }
1335
- l && (o.start += v);
1327
+ l && (r.start += m);
1336
1328
  }
1337
1329
  }
1338
1330
  }
1339
- }), o;
1340
- }
1341
- function Vn(e, t, n, s, i, r) {
1342
- const { start: o, end: c, duration: a } = e;
1343
- let f = o, u = c, l = e.startRange, d = e.endRange, v;
1344
- if (typeof a == "string") {
1345
- l = { name: a, offset: 0 }, d = { name: a, offset: 100 }, f = F(l, n, t), u = F(d, n, t), v = u - f;
1346
- const h = ge(r, f, u, n, s);
1331
+ }), r;
1332
+ }
1333
+ function Wn(e, t, n, s, i, o) {
1334
+ const { start: r, end: a, duration: c } = e;
1335
+ let f = r, u = a, l = e.startRange, d = e.endRange, m;
1336
+ if (typeof c == "string") {
1337
+ l = { name: c, offset: 0 }, d = { name: c, offset: 100 }, f = R(l, n, t), u = R(d, n, t), m = u - f;
1338
+ const h = ye(o, f, u, n, s);
1347
1339
  f = h.start, u = h.end;
1348
1340
  } else {
1349
- if (l || o?.name) {
1350
- l = l || o;
1351
- const h = le(l.add, i), m = F({ ...l, offset: 0 }, n, t), p = F({ ...l, offset: 100 }, n, t), g = ge(r, m, p, n, s);
1352
- f = g.start + l.offset / 100 * (g.end - g.start) + h;
1341
+ if (l || r?.name) {
1342
+ l = l || r;
1343
+ const h = de(l.add, i), p = R({ ...l, offset: 0 }, n, t), g = R({ ...l, offset: 100 }, n, t), v = ye(o, p, g, n, s);
1344
+ f = v.start + l.offset / 100 * (v.end - v.start) + h;
1353
1345
  }
1354
- if (d || c?.name) {
1355
- d = d || c;
1356
- const h = le(d.add, i), m = F({ ...d, offset: 0 }, n, t), p = F({ ...d, offset: 100 }, n, t), g = ge(r, m, p, n, s);
1357
- u = g.start + d.offset / 100 * (g.end - g.start) + h;
1358
- } else typeof a == "number" && (u = f + a);
1346
+ if (d || a?.name) {
1347
+ d = d || a;
1348
+ const h = de(d.add, i), p = R({ ...d, offset: 0 }, n, t), g = R({ ...d, offset: 100 }, n, t), v = ye(o, p, g, n, s);
1349
+ u = v.start + d.offset / 100 * (v.end - v.start) + h;
1350
+ } else typeof c == "number" && (u = f + c);
1359
1351
  }
1360
- return !v && !a && (v = u - f), { ...e, start: f, end: u, startRange: l, endRange: d, duration: v || a };
1352
+ return !m && !c && (m = u - f), { ...e, start: f, end: u, startRange: l, endRange: d, duration: m || c };
1361
1353
  }
1362
- function Yn(e) {
1354
+ function Vn(e) {
1363
1355
  return e.position === "sticky";
1364
1356
  }
1365
- function Bn(e, t, n) {
1357
+ function Yn(e, t, n) {
1366
1358
  return e.position === "fixed" && (!t || t === window.document.body || t === n);
1367
1359
  }
1368
1360
  function Kn(e, t) {
1369
1361
  return parseInt(t ? e.left : e.top);
1370
1362
  }
1371
- function Un(e, t) {
1363
+ function Bn(e, t) {
1372
1364
  return parseInt(t ? e.right : e.bottom);
1373
1365
  }
1374
- function Qn(e, t, n) {
1366
+ function Un(e, t, n) {
1375
1367
  n && (e.style.position = "static");
1376
1368
  const s = (t ? e.offsetLeft : e.offsetTop) || 0;
1377
1369
  return n && (e.style.position = null), s;
1378
1370
  }
1379
- function Xn(e, t) {
1371
+ function Qn(e, t) {
1380
1372
  let n;
1381
- const s = Kn(e, t), i = Un(e, t), r = !isNaN(s), o = !isNaN(i);
1382
- return (r || o) && (n = {}, r && (n.start = s), o && (n.end = i)), n;
1373
+ const s = Kn(e, t), i = Bn(e, t), o = !isNaN(s), r = !isNaN(i);
1374
+ return (o || r) && (n = {}, o && (n.start = s), r && (n.end = i)), n;
1383
1375
  }
1384
- function J(e, t, n, s, i) {
1385
- const r = e[0].viewSource, o = [];
1386
- let c = (s ? r.offsetWidth : r.offsetHeight) || 0, a = 0, f = r;
1376
+ function te(e, t, n, s, i) {
1377
+ const o = e[0].viewSource, r = [];
1378
+ let a = (s ? o.offsetWidth : o.offsetHeight) || 0, c = 0, f = o;
1387
1379
  for (; f; ) {
1388
- const l = window.getComputedStyle(f), d = Yn(l), v = d ? Xn(l, s) : void 0, h = Qn(f, s, d);
1389
- if ((!v || !("end" in v)) && (a += h), o.push({ element: f, offset: h, sticky: v }), f = f.offsetParent, Bn(l, f, t))
1380
+ const l = window.getComputedStyle(f), d = Vn(l), m = d ? Qn(l, s) : void 0, h = Un(f, s, d);
1381
+ if ((!m || !("end" in m)) && (c += h), r.push({ element: f, offset: h, sticky: m }), f = f.offsetParent, Yn(l, f, t))
1390
1382
  break;
1391
1383
  if (f === t) {
1392
- o.push({ element: f, offset: 0 });
1384
+ r.push({ element: f, offset: 0 });
1393
1385
  break;
1394
1386
  }
1395
1387
  }
1396
- return o.reverse(), e.map((l) => ({
1397
- ...Vn(
1388
+ return r.reverse(), e.map((l) => ({
1389
+ ...Wn(
1398
1390
  l,
1399
- { start: a, end: a + c },
1391
+ { start: c, end: c + a },
1400
1392
  n,
1401
1393
  s,
1402
1394
  i,
1403
- o
1395
+ r
1404
1396
  )
1405
1397
  }));
1406
1398
  }
1407
- const Ne = 100, Zn = {
1399
+ const He = 100, Xn = {
1408
1400
  horizontal: !1,
1409
1401
  observeViewportEntry: !0,
1410
1402
  viewportRootMargin: "7% 7%",
@@ -1412,116 +1404,116 @@ const Ne = 100, Zn = {
1412
1404
  observeSourcesResize: !1,
1413
1405
  observeContentResize: !1
1414
1406
  };
1415
- function Jn(e, t, n, s) {
1407
+ function Zn(e, t, n, s) {
1416
1408
  let i = 0;
1417
1409
  return e >= t && e <= n ? i = s ? (e - t) / s : 1 : e > n && (i = 1), i;
1418
1410
  }
1419
- function ze(e, t) {
1411
+ function Ge(e, t) {
1420
1412
  return e === window ? t ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : t ? e.clientWidth : e.clientHeight;
1421
1413
  }
1422
- function es() {
1414
+ function Jn() {
1423
1415
  return {
1424
1416
  viewportWidth: window.document.documentElement.clientWidth,
1425
1417
  viewportHeight: window.document.documentElement.clientHeight
1426
1418
  };
1427
1419
  }
1428
- function ts(e) {
1429
- const t = ut(e, Zn), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
1430
- let r = ze(n, s), o, c, a, f, u;
1431
- const l = [], d = es();
1420
+ function es(e) {
1421
+ const t = dt(e, Xn), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
1422
+ let o = Ge(n, s), r, a, c, f, u;
1423
+ const l = [], d = Jn();
1432
1424
  if (t.scenes = Object.values(
1433
1425
  // TODO(ameerf): find a polyfill and use groupBy instead of following reduce
1434
1426
  e.scenes.reduce(
1435
- (m, p, g) => {
1436
- const E = p.groupId ? `group-${p.groupId}` : String(g);
1437
- return m[E] ? m[E].push(p) : m[E] = [p], m;
1427
+ (p, g, v) => {
1428
+ const y = g.groupId ? `group-${g.groupId}` : String(v);
1429
+ return p[y] ? p[y].push(g) : p[y] = [g], p;
1438
1430
  },
1439
1431
  {}
1440
1432
  )
1441
- ).flatMap((m) => (m.every((p) => p.viewSource && (typeof p.duration == "string" || p.start?.name)) ? (m = J(m, n, r, s, d), (t.observeSourcesResize || t.observeContentResize) && l.push(m)) : m.forEach((p) => {
1442
- p.end == null && (p.end = p.start + p.duration), p.duration == null && (p.duration = p.end - p.start);
1443
- }), m)), t.scenes.forEach((m, p) => {
1444
- m.index = p;
1433
+ ).flatMap((p) => (p.every((g) => g.viewSource && (typeof g.duration == "string" || g.start?.name)) ? (p = te(p, n, o, s, d), (t.observeSourcesResize || t.observeContentResize) && l.push(p)) : p.forEach((g) => {
1434
+ g.end == null && (g.end = g.start + g.duration), g.duration == null && (g.duration = g.end - g.start);
1435
+ }), p)), t.scenes.forEach((p, g) => {
1436
+ p.index = g;
1445
1437
  }), l.length) {
1446
- const m = /* @__PURE__ */ new Map();
1447
- window.ResizeObserver && (a = new window.ResizeObserver(function(p) {
1448
- p.forEach((g) => {
1449
- const E = m.get(g.target), y = J(E, n, r, s, d);
1450
- y.forEach((w, $) => {
1451
- t.scenes[w.index] = y[$];
1452
- }), l.splice(l.indexOf(E), 1, y);
1438
+ const p = /* @__PURE__ */ new Map();
1439
+ window.ResizeObserver && (c = new window.ResizeObserver(function(g) {
1440
+ g.forEach((v) => {
1441
+ const y = p.get(v.target), E = te(y, n, o, s, d);
1442
+ E.forEach(($, b) => {
1443
+ t.scenes[$.index] = E[b];
1444
+ }), l.splice(l.indexOf(y), 1, E);
1453
1445
  });
1454
- }), l.forEach((p) => {
1455
- a.observe(p[0].viewSource, { box: "border-box" }), m.set(p[0].viewSource, p);
1456
- }), t.observeContentResize && t.contentRoot && new window.ResizeObserver(Re(() => {
1457
- const g = l.map((E) => {
1458
- const y = J(E, n, r, s, d);
1459
- return y.forEach((w, $) => {
1460
- t.scenes[w.index] = y[$];
1461
- }), y;
1446
+ }), l.forEach((g) => {
1447
+ c.observe(g[0].viewSource, { box: "border-box" }), p.set(g[0].viewSource, g);
1448
+ }), t.observeContentResize && t.contentRoot && new window.ResizeObserver(De(() => {
1449
+ const v = l.map((y) => {
1450
+ const E = te(y, n, o, s, d);
1451
+ return E.forEach(($, b) => {
1452
+ t.scenes[$.index] = E[b];
1453
+ }), E;
1462
1454
  });
1463
- l.length = 0, l.push(...g), l.forEach((E) => {
1464
- m.set(E[0].viewSource, E);
1455
+ l.length = 0, l.push(...v), l.forEach((y) => {
1456
+ p.set(y[0].viewSource, y);
1465
1457
  });
1466
- }, Ne)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (f = Re(function() {
1467
- r = ze(n, s);
1468
- const p = l.map((g) => {
1469
- const E = J(g, n, r, s, d);
1470
- return E.forEach((y, w) => {
1471
- t.scenes[y.index] = E[w];
1472
- }), E;
1458
+ }, He)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (f = De(function() {
1459
+ o = Ge(n, s);
1460
+ const g = l.map((v) => {
1461
+ const y = te(v, n, o, s, d);
1462
+ return y.forEach((E, $) => {
1463
+ t.scenes[E.index] = y[$];
1464
+ }), y;
1473
1465
  });
1474
- l.length = 0, l.push(...p), l.forEach((g) => {
1475
- m.set(g[0].viewSource, g);
1466
+ l.length = 0, l.push(...g), l.forEach((v) => {
1467
+ p.set(v[0].viewSource, v);
1476
1468
  });
1477
- }, Ne), n === window ? window.addEventListener("resize", f) : window.ResizeObserver && (u = new window.ResizeObserver(f), u.observe(n, { box: "border-box" })));
1469
+ }, He), n === window ? window.addEventListener("resize", f) : window.ResizeObserver && (u = new window.ResizeObserver(f), u.observe(n, { box: "border-box" })));
1478
1470
  }
1479
- t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(m) {
1480
- m.forEach((p) => {
1481
- (i.get(p.target) || []).forEach((g) => {
1482
- g.disabled = !p.isIntersecting;
1471
+ t.observeViewportEntry && window.IntersectionObserver && (a = new window.IntersectionObserver(function(p) {
1472
+ p.forEach((g) => {
1473
+ (i.get(g.target) || []).forEach((v) => {
1474
+ v.disabled = !g.isIntersecting;
1483
1475
  });
1484
1476
  });
1485
1477
  }, {
1486
1478
  root: n === window ? window.document : n,
1487
1479
  rootMargin: t.viewportRootMargin,
1488
1480
  threshold: 0
1489
- }), t.scenes.forEach((m) => {
1490
- if (m.viewSource) {
1491
- let p = i.get(m.viewSource);
1492
- p || (p = [], i.set(m.viewSource, p), c.observe(m.viewSource)), p.push(m);
1481
+ }), t.scenes.forEach((p) => {
1482
+ if (p.viewSource) {
1483
+ let g = i.get(p.viewSource);
1484
+ g || (g = [], i.set(p.viewSource, g), a.observe(p.viewSource)), g.push(p);
1493
1485
  }
1494
1486
  }));
1495
- function v({ p: m, vp: p }) {
1496
- m = +m.toFixed(1);
1497
- const g = +p.toFixed(4);
1498
- if (m !== o) {
1499
- for (let E of t.scenes)
1500
- if (!E.disabled) {
1501
- const { start: y, end: w, duration: $ } = E, S = Jn(m, y, w, $);
1502
- E.effect(E, S, g);
1487
+ function m({ p, vp: g }) {
1488
+ p = +p.toFixed(1);
1489
+ const v = +g.toFixed(4);
1490
+ if (p !== r) {
1491
+ for (let y of t.scenes)
1492
+ if (!y.disabled) {
1493
+ const { start: E, end: $, duration: b } = y, S = Zn(p, E, $, b);
1494
+ y.effect(y, S, v);
1503
1495
  }
1504
- o = m;
1496
+ r = p;
1505
1497
  }
1506
1498
  }
1507
1499
  function h() {
1508
- t.scenes.forEach((m) => m.destroy?.()), c && (c.disconnect(), c = null), a && (a.disconnect(), a = null), f && (u ? (u.disconnect(), u = null) : window.removeEventListener("resize", f));
1500
+ t.scenes.forEach((p) => p.destroy?.()), a && (a.disconnect(), a = null), c && (c.disconnect(), c = null), f && (u ? (u.disconnect(), u = null) : window.removeEventListener("resize", f));
1509
1501
  }
1510
1502
  return {
1511
- tick: v,
1503
+ tick: m,
1512
1504
  destroy: h
1513
1505
  };
1514
1506
  }
1515
- const ns = {
1507
+ const ts = {
1516
1508
  transitionActive: !1,
1517
1509
  transitionFriction: 0.9,
1518
1510
  transitionEpsilon: 1,
1519
1511
  velocityActive: !1,
1520
1512
  velocityMax: 1
1521
1513
  };
1522
- class ss {
1514
+ class ns {
1523
1515
  constructor(t = {}) {
1524
- this.config = ut(t, ns), this.progress = {
1516
+ this.config = dt(t, ts), this.progress = {
1525
1517
  p: 0,
1526
1518
  prevP: 0,
1527
1519
  vp: 0
@@ -1558,8 +1550,8 @@ class ss {
1558
1550
  * @param {number} [scrollPosition.y]
1559
1551
  */
1560
1552
  resetProgress(t = {}) {
1561
- const n = this.config.root, s = t.x || t.x === 0 ? t.x : n.scrollX || n.scrollLeft || 0, i = t.y || t.y === 0 ? t.y : n.scrollY || n.scrollTop || 0, r = this.config.horizontal ? s : i;
1562
- this.progress.p = r, this.progress.prevP = r, this.progress.vp = 0, this.config.transitionActive && (this.currentProgress.p = r, this.currentProgress.prevP = r, this.currentProgress.vp = 0), t && this.config.root.scrollTo(s, i);
1553
+ const n = this.config.root, s = t.x || t.x === 0 ? t.x : n.scrollX || n.scrollLeft || 0, i = t.y || t.y === 0 ? t.y : n.scrollY || n.scrollTop || 0, o = this.config.horizontal ? s : i;
1554
+ this.progress.p = o, this.progress.prevP = o, this.progress.vp = 0, this.config.transitionActive && (this.currentProgress.p = o, this.currentProgress.prevP = o, this.currentProgress.vp = 0), t && this.config.root.scrollTo(s, i);
1563
1555
  }
1564
1556
  /**
1565
1557
  * Handle animation frame work.
@@ -1571,8 +1563,8 @@ class ss {
1571
1563
  n && this.lerp();
1572
1564
  const s = n ? this.currentProgress : this.progress;
1573
1565
  if (this.config.velocityActive) {
1574
- const i = s.p - s.prevP, r = i < 0 ? -1 : 1;
1575
- s.vp = Math.min(this.config.velocityMax, Math.abs(i)) / this.config.velocityMax * r;
1566
+ const i = s.p - s.prevP, o = i < 0 ? -1 : 1;
1567
+ s.vp = Math.min(this.config.velocityMax, Math.abs(i)) / this.config.velocityMax * o;
1576
1568
  }
1577
1569
  this.effect.tick(s), n && s.p !== this.progress.p && (t && this._lerpFrameId && window.cancelAnimationFrame(this._lerpFrameId), this._lerpFrameId = window.requestAnimationFrame(() => this.tick())), s.prevP = s.p;
1578
1570
  }
@@ -1580,7 +1572,7 @@ class ss {
1580
1572
  * Calculate current progress.
1581
1573
  */
1582
1574
  lerp() {
1583
- this.currentProgress.p = Gn(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
1575
+ this.currentProgress.p = Dn(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
1584
1576
  }
1585
1577
  /**
1586
1578
  * Stop the event and effect, and remove all DOM side-effects.
@@ -1604,7 +1596,7 @@ class ss {
1604
1596
  * Reset registered effect.
1605
1597
  */
1606
1598
  setupEffect() {
1607
- this.removeEffect(), this.effect = ts(this.config);
1599
+ this.removeEffect(), this.effect = es(this.config);
1608
1600
  }
1609
1601
  /**
1610
1602
  * Remove registered effect.
@@ -1613,43 +1605,43 @@ class ss {
1613
1605
  this.effect && this.effect.destroy(), this.effect = null;
1614
1606
  }
1615
1607
  }
1616
- const we = /* @__PURE__ */ new WeakMap();
1617
- let ft = () => ({});
1618
- function is(e) {
1619
- ft = e;
1608
+ const be = /* @__PURE__ */ new WeakMap();
1609
+ let ht = () => ({});
1610
+ function ss(e) {
1611
+ ht = e;
1620
1612
  }
1621
- function rs(e, t, n, s, { reducedMotion: i }) {
1613
+ function is(e, t, n, s, { reducedMotion: i }) {
1622
1614
  if (i)
1623
1615
  return;
1624
- const r = {
1616
+ const o = {
1625
1617
  trigger: "view-progress",
1626
1618
  element: e
1627
- }, o = M(n);
1628
- let c;
1619
+ }, r = P(n);
1620
+ let a;
1629
1621
  if ("ViewTimeline" in window) {
1630
- const f = U(
1622
+ const f = X(
1631
1623
  t,
1632
- o,
1633
- r
1624
+ r,
1625
+ o
1634
1626
  );
1635
- f && !f.isCSS && (f.play(), c = () => {
1627
+ f && !f.isCSS && (f.play(), a = () => {
1636
1628
  f.ready.then(() => {
1637
1629
  f.cancel();
1638
1630
  });
1639
1631
  });
1640
1632
  } else {
1641
- const f = it(t, o, r);
1633
+ const f = at(t, r, o);
1642
1634
  if (f) {
1643
- const u = Array.isArray(f) ? f : [f], l = new ss({
1635
+ const u = Array.isArray(f) ? f : [f], l = new ns({
1644
1636
  viewSource: e,
1645
1637
  scenes: u,
1646
1638
  observeViewportEntry: !1,
1647
1639
  observeViewportResize: !1,
1648
1640
  observeSourcesResize: !0,
1649
1641
  root: document.body,
1650
- ...ft()
1642
+ ...ht()
1651
1643
  });
1652
- c = () => {
1644
+ a = () => {
1653
1645
  l.destroy();
1654
1646
  }, Promise.all(u.map((d) => d.ready || Promise.resolve())).then(
1655
1647
  () => {
@@ -1658,22 +1650,22 @@ function rs(e, t, n, s, { reducedMotion: i }) {
1658
1650
  );
1659
1651
  }
1660
1652
  }
1661
- if (!c) return;
1662
- const a = { source: e, target: t, cleanup: c };
1663
- q(we, e, a), q(we, t, a);
1653
+ if (!a) return;
1654
+ const c = { source: e, target: t, cleanup: a };
1655
+ A(be, e, c), A(be, t, c);
1664
1656
  }
1665
1657
  function os(e) {
1666
- Q(we, e);
1658
+ Z(be, e);
1667
1659
  }
1668
- const cs = {
1669
- add: rs,
1660
+ const rs = {
1661
+ add: is,
1670
1662
  remove: os,
1671
- registerOptionsGetter: is
1663
+ registerOptionsGetter: ss
1672
1664
  };
1673
- function je(e, t, n) {
1665
+ function We(e, t, n) {
1674
1666
  return Math.min(Math.max(e, n), t);
1675
1667
  }
1676
- function De(e) {
1668
+ function Ve(e) {
1677
1669
  let t = !1;
1678
1670
  return function() {
1679
1671
  if (!t)
@@ -1695,7 +1687,7 @@ function as(e) {
1695
1687
  height: e.offsetHeight
1696
1688
  };
1697
1689
  }
1698
- function us() {
1690
+ function cs() {
1699
1691
  const e = window.devicePixelRatio;
1700
1692
  let t = !1;
1701
1693
  if (e === 1)
@@ -1708,79 +1700,79 @@ function us() {
1708
1700
  });
1709
1701
  return document.body.dispatchEvent(n), t;
1710
1702
  }
1711
- function fs() {
1703
+ function us() {
1712
1704
  return new Promise((e) => {
1713
1705
  const t = window.scrollY;
1714
1706
  let n = !1, s;
1715
1707
  function i() {
1716
- document.body.addEventListener("pointerdown", (c) => {
1717
- s === void 0 ? s = c.offsetY : n = c.offsetY === s;
1708
+ document.body.addEventListener("pointerdown", (a) => {
1709
+ s === void 0 ? s = a.offsetY : n = a.offsetY === s;
1718
1710
  }, { once: !0 });
1719
- const o = new PointerEvent("pointerdown", {
1711
+ const r = new PointerEvent("pointerdown", {
1720
1712
  clientY: 500
1721
1713
  });
1722
- document.body.dispatchEvent(o);
1714
+ document.body.dispatchEvent(r);
1723
1715
  }
1724
- function r() {
1725
- window.scrollY !== t && (window.removeEventListener("scroll", r), i(), e(n));
1716
+ function o() {
1717
+ window.scrollY !== t && (window.removeEventListener("scroll", o), i(), e(n));
1726
1718
  }
1727
- i(), window.addEventListener("scroll", r), window.scrollY > 0 && window.scrollBy(0, -1);
1719
+ i(), window.addEventListener("scroll", o), window.scrollY > 0 && window.scrollBy(0, -1);
1728
1720
  });
1729
1721
  }
1730
- function ls(e) {
1731
- fs().then((t) => {
1722
+ function fs(e) {
1723
+ us().then((t) => {
1732
1724
  e.fixRequired = t, t && (window.addEventListener("scroll", e.scrollHandler), e.scrollHandler());
1733
1725
  });
1734
1726
  }
1735
- let ee = 0;
1736
- const re = /* @__PURE__ */ new Set();
1737
- function ds() {
1727
+ let ne = 0;
1728
+ const ae = /* @__PURE__ */ new Set();
1729
+ function ls() {
1738
1730
  const e = (n) => {
1739
1731
  for (let s of n.changedTouches)
1740
- re.add(s.identifier);
1732
+ ae.add(s.identifier);
1741
1733
  }, t = (n) => {
1742
1734
  for (let s of n.changedTouches)
1743
- re.delete(s.identifier);
1735
+ ae.delete(s.identifier);
1744
1736
  };
1745
1737
  return document.addEventListener("touchstart", e, { passive: !0 }), document.addEventListener("touchend", t, { passive: !0 }), function() {
1746
- re.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
1738
+ ae.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
1747
1739
  };
1748
1740
  }
1749
- function hs(e, t) {
1741
+ function ds(e, t) {
1750
1742
  if ("onscrollend" in window)
1751
1743
  return e.addEventListener("scrollend", t), function() {
1752
1744
  e.removeEventListener("scrollend", t);
1753
1745
  };
1754
1746
  let n = 0, s;
1755
- ee || (s = ds()), ee += 1;
1756
- function i(r) {
1747
+ ne || (s = ls()), ne += 1;
1748
+ function i(o) {
1757
1749
  clearTimeout(n), n = setTimeout(() => {
1758
- re.size ? setTimeout(i, 100) : (t(r), n = 0);
1750
+ ae.size ? setTimeout(i, 100) : (t(o), n = 0);
1759
1751
  }, 100);
1760
1752
  }
1761
1753
  return e.addEventListener("scroll", i), function() {
1762
- e.removeEventListener("scroll", i), ee -= 1, ee || s();
1754
+ e.removeEventListener("scroll", i), ne -= 1, ne || s();
1763
1755
  };
1764
1756
  }
1765
- function ms(e, t, n) {
1757
+ function hs(e, t, n) {
1766
1758
  return {
1767
1759
  x(s) {
1768
- const i = e.left - n.x + e.width / 2, r = i >= t.width / 2, o = (r ? i : t.width - i) * 2, c = r ? 0 : i - o / 2;
1769
- return (s - c) / o;
1760
+ 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;
1761
+ return (s - a) / r;
1770
1762
  },
1771
1763
  y(s) {
1772
- const i = e.top - n.y + e.height / 2, r = i >= t.height / 2, o = (r ? i : t.height - i) * 2, c = r ? 0 : i - o / 2;
1773
- return (s - c) / o;
1764
+ 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;
1765
+ return (s - a) / r;
1774
1766
  }
1775
1767
  };
1776
1768
  }
1777
- function ps(e, t) {
1769
+ function ms(e, t) {
1778
1770
  this.x = window.scrollX, this.y = window.scrollY, requestAnimationFrame(() => e && e(t));
1779
1771
  }
1780
- function gs(e) {
1772
+ function ps(e) {
1781
1773
  e.rect.width = window.document.documentElement.clientWidth, e.rect.height = window.document.documentElement.clientHeight;
1782
1774
  }
1783
- function vs(e) {
1775
+ function gs(e) {
1784
1776
  const t = new ResizeObserver((n) => {
1785
1777
  n.forEach((s) => {
1786
1778
  e.rect.width = s.borderBoxSize[0].inlineSize, e.rect.height = s.borderBoxSize[0].blockSize;
@@ -1788,38 +1780,38 @@ function vs(e) {
1788
1780
  });
1789
1781
  return t.observe(e.root, { box: "border-box" }), t;
1790
1782
  }
1791
- function ys(e) {
1792
- let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, i, r, o, c;
1793
- const a = { x: 0, y: 0 };
1783
+ function vs(e) {
1784
+ let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, i, o, r, a;
1785
+ const c = { x: 0, y: 0 };
1794
1786
  e.scenes.forEach((u) => {
1795
- u.target && u.centeredToTarget && (u.transform = ms(as(u.target), e.rect, a), t = !0), e.root ? i = vs(e) : (r = gs.bind(null, e), window.addEventListener("resize", r));
1787
+ u.target && u.centeredToTarget && (u.transform = hs(as(u.target), e.rect, c), t = !0), e.root ? i = gs(e) : (o = ps.bind(null, e), window.addEventListener("resize", o));
1796
1788
  }), s = function(u) {
1797
1789
  for (let l of e.scenes)
1798
1790
  if (!l.disabled) {
1799
- const d = l.transform?.x(u.x) || u.x / e.rect.width, v = l.transform?.y(u.y) || u.y / e.rect.height, h = +je(0, 1, d).toPrecision(4), m = +je(0, 1, v).toPrecision(4), p = { x: u.vx, y: u.vy };
1800
- e.allowActiveEvent && (u.active = d <= 1 && v <= 1 && d >= 0 && v >= 0), l.effect(l, { x: h, y: m }, p, u.active);
1791
+ const d = l.transform?.x(u.x) || u.x / e.rect.width, m = l.transform?.y(u.y) || u.y / e.rect.height, h = +We(0, 1, d).toPrecision(4), p = +We(0, 1, m).toPrecision(4), g = { x: u.vx, y: u.vy };
1792
+ e.allowActiveEvent && (u.active = d <= 1 && m <= 1 && d >= 0 && m >= 0), l.effect(l, { x: h, y: p }, g, u.active);
1801
1793
  }
1802
1794
  Object.assign(n, u);
1803
- }, t && (o = ps.bind(a, s, n), c = hs(document, o));
1795
+ }, t && (r = ms.bind(c, s, n), a = ds(document, r));
1804
1796
  function f() {
1805
- e.scenes.forEach((u) => u.destroy?.()), c?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", r), r = null), s = null, n = null;
1797
+ e.scenes.forEach((u) => u.destroy?.()), a?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", o), o = null), s = null, n = null;
1806
1798
  }
1807
1799
  return {
1808
1800
  tick: s,
1809
1801
  destroy: f
1810
1802
  };
1811
1803
  }
1812
- const Es = 1e3 / 60 * 3;
1813
- let te;
1814
- function ws() {
1815
- R.x = window.scrollX, R.y = window.scrollY;
1804
+ const ys = 1e3 / 60 * 3;
1805
+ let se;
1806
+ function Es() {
1807
+ N.x = window.scrollX, N.y = window.scrollY;
1816
1808
  }
1817
- const R = { x: 0, y: 0, scrollHandler: ws, fixRequired: void 0 };
1818
- class bs {
1809
+ const N = { x: 0, y: 0, scrollHandler: Es, fixRequired: void 0 };
1810
+ class ws {
1819
1811
  constructor(t = {}) {
1820
1812
  this.config = { ...t }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
1821
1813
  let n;
1822
- this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : De(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : De(() => {
1814
+ this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : Ve(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : Ve(() => {
1823
1815
  this.tick();
1824
1816
  }), this.config.rect = this.config.root ? {
1825
1817
  width: this.config.root.offsetWidth,
@@ -1834,27 +1826,27 @@ class bs {
1834
1826
  vy: 0
1835
1827
  }, this.previousProgress = { ...this.progress }, this.currentProgress = null;
1836
1828
  const s = (i) => {
1837
- const r = this.config.root ? i.offsetX : i.x, o = this.config.root ? i.offsetY : i.y;
1838
- this.progress.vx = r - this.progress.x, this.progress.vy = o - this.progress.y, this.progress.x = r, this.progress.y = o, this._nextTick = n();
1829
+ const o = this.config.root ? i.offsetX : i.x, r = this.config.root ? i.offsetY : i.y;
1830
+ this.progress.vx = o - this.progress.x, this.progress.vy = r - this.progress.y, this.progress.x = o, this.progress.y = r, this._nextTick = n();
1839
1831
  };
1840
1832
  if (this._pointerLeave = () => {
1841
1833
  this.progress.active = !1, this.progress.vx = 0, this.progress.vy = 0, this._nextTick = n();
1842
1834
  }, this._pointerEnter = () => {
1843
1835
  this.progress.active = !0, this._nextTick = n();
1844
1836
  }, this.config.root) {
1845
- te = typeof te == "boolean" ? te : us();
1846
- const i = te ? window.devicePixelRatio : 1;
1847
- typeof R.fixRequired > "u" && ls(R), this._measure = (r) => {
1848
- if (r.target !== this.config.root) {
1849
- const o = new PointerEvent("pointermove", {
1837
+ se = typeof se == "boolean" ? se : cs();
1838
+ const i = se ? window.devicePixelRatio : 1;
1839
+ typeof N.fixRequired > "u" && fs(N), this._measure = (o) => {
1840
+ if (o.target !== this.config.root) {
1841
+ const r = new PointerEvent("pointermove", {
1850
1842
  bubbles: !0,
1851
1843
  cancelable: !0,
1852
- clientX: r.x * i + R.x,
1853
- clientY: r.y * i + R.y
1844
+ clientX: o.x * i + N.x,
1845
+ clientY: o.y * i + N.y
1854
1846
  });
1855
- r.stopPropagation(), this.config.root.dispatchEvent(o);
1847
+ o.stopPropagation(), this.config.root.dispatchEvent(r);
1856
1848
  } else
1857
- s(r);
1849
+ s(o);
1858
1850
  };
1859
1851
  } else
1860
1852
  this._measure = s;
@@ -1883,13 +1875,13 @@ class bs {
1883
1875
  * @returns {number} the requestAnimationFrame id for the transition tick.
1884
1876
  */
1885
1877
  transition() {
1886
- const t = this.config.transitionDuration, n = this.config.transitionEasing || ((o) => o), s = performance.now();
1878
+ const t = this.config.transitionDuration, n = this.config.transitionEasing || ((r) => r), s = performance.now();
1887
1879
  let i = !1;
1888
- const r = (o) => {
1889
- const c = (o - this._startTime) / t, a = n(Math.min(1, c));
1890
- i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((f, [u, l]) => (u === "active" ? f[u] = l : f[u] = this.previousProgress[u] + (l - this.previousProgress[u]) * a, f), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(r), i = o - this._startTime > Es), this.effect.tick(this.currentProgress);
1880
+ const o = (r) => {
1881
+ const a = (r - this._startTime) / t, c = n(Math.min(1, a));
1882
+ i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((f, [u, l]) => (u === "active" ? f[u] = l : f[u] = this.previousProgress[u] + (l - this.previousProgress[u]) * c, f), this.currentProgress || {}), a < 1 && (this._nextTransitionTick = requestAnimationFrame(o), i = r - this._startTime > ys), this.effect.tick(this.currentProgress);
1891
1883
  };
1892
- return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, r(s)) : this._startTime = s, this._nextTransitionTick;
1884
+ return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, o(s)) : this._startTime = s, this._nextTransitionTick;
1893
1885
  }
1894
1886
  /**
1895
1887
  * Stop the event and effect, and remove all DOM side effects.
@@ -1916,7 +1908,7 @@ class bs {
1916
1908
  * Reset registered effect.
1917
1909
  */
1918
1910
  setupEffect() {
1919
- this.removeEffect(), this.effect = ys(this.config);
1911
+ this.removeEffect(), this.effect = vs(this.config);
1920
1912
  }
1921
1913
  /**
1922
1914
  * Remove registered effect.
@@ -1925,233 +1917,233 @@ class bs {
1925
1917
  this.effect && this.effect.destroy(), this.effect = null;
1926
1918
  }
1927
1919
  }
1928
- const be = /* @__PURE__ */ new WeakMap();
1929
- let lt = () => ({});
1920
+ const Se = /* @__PURE__ */ new WeakMap();
1921
+ let mt = () => ({});
1930
1922
  function $s(e) {
1931
- lt = e;
1923
+ mt = e;
1932
1924
  }
1933
- function Ss(e, t, n, s = {}, { reducedMotion: i }) {
1925
+ function bs(e, t, n, s = {}, { reducedMotion: i }) {
1934
1926
  if (i)
1935
1927
  return;
1936
- const r = {
1928
+ const o = {
1937
1929
  trigger: "pointer-move",
1938
1930
  element: e,
1939
1931
  axis: s.axis ?? "y"
1940
- }, o = it(t, M(n), r);
1941
- if (o) {
1942
- const c = Array.isArray(o) ? o : [o], a = new bs({
1932
+ }, r = at(t, P(n), o);
1933
+ if (r) {
1934
+ const a = Array.isArray(r) ? r : [r], c = new ws({
1943
1935
  root: s.hitArea === "self" ? e : void 0,
1944
- scenes: c,
1945
- ...lt()
1936
+ scenes: a,
1937
+ ...mt()
1946
1938
  }), u = { source: e, target: t, cleanup: () => {
1947
- a.destroy();
1939
+ c.destroy();
1948
1940
  } };
1949
- q(be, e, u), q(be, t, u), Promise.all(
1950
- c.map((l) => l.ready || Promise.resolve())
1941
+ A(Se, e, u), A(Se, t, u), Promise.all(
1942
+ a.map((l) => l.ready || Promise.resolve())
1951
1943
  ).then(() => {
1952
- a.start();
1944
+ c.start();
1953
1945
  });
1954
1946
  }
1955
1947
  }
1956
- function Is(e) {
1957
- Q(be, e);
1948
+ function Ss(e) {
1949
+ Z(Se, e);
1958
1950
  }
1959
- const Ts = {
1960
- add: Ss,
1961
- remove: Is,
1951
+ const Is = {
1952
+ add: bs,
1953
+ remove: Ss,
1962
1954
  registerOptionsGetter: $s
1963
- }, $e = /* @__PURE__ */ new WeakMap();
1964
- function Os(e, t, n, s, {
1955
+ }, Ie = /* @__PURE__ */ new WeakMap();
1956
+ function Ts(e, t, n, s, {
1965
1957
  reducedMotion: i,
1966
- selectorCondition: r,
1967
- animation: o,
1968
- sourceAnimationOptions: c
1958
+ selectorCondition: o,
1959
+ animation: r,
1960
+ sourceAnimationOptions: a
1969
1961
  }) {
1970
- const a = o || U(
1962
+ const c = r || X(
1971
1963
  t,
1972
- M(n),
1964
+ P(n),
1973
1965
  void 0,
1974
1966
  i
1975
1967
  );
1976
- if (!a)
1968
+ if (!c)
1977
1969
  return;
1978
- const { effectId: f } = s, u = (v) => {
1979
- if (r && !t.matches(r)) return;
1980
- const h = v.animationName, m = v.detail?.effectId, p = c ? st(e, c) : null;
1981
- if (p) {
1982
- if (p.playState === "running" || h && !p.hasAnimationName(h))
1970
+ const { effectId: f } = s, u = (m) => {
1971
+ if (o && !t.matches(o)) return;
1972
+ const h = m.animationName, p = m.detail?.effectId, g = a ? rt(e, a) : null;
1973
+ if (g) {
1974
+ if (g.playState === "running" || h && !g.hasAnimationName(h))
1983
1975
  return;
1984
- if (m && m !== f && !p.hasAnimationId(m))
1976
+ if (p && p !== f && !g.hasAnimationId(p))
1985
1977
  return;
1986
1978
  }
1987
- a.play();
1979
+ c.play();
1988
1980
  }, d = { source: e, target: t, cleanup: () => {
1989
- a.cancel(), e.removeEventListener("animationend", u);
1981
+ c.cancel(), e.removeEventListener("animationend", u);
1990
1982
  } };
1991
- q($e, e, d), q($e, t, d), e.addEventListener("animationend", u);
1983
+ A(Ie, e, d), A(Ie, t, d), e.addEventListener("animationend", u);
1992
1984
  }
1993
1985
  function Cs(e) {
1994
- Q($e, e);
1986
+ Z(Ie, e);
1995
1987
  }
1996
- const As = {
1997
- add: Os,
1988
+ const Os = {
1989
+ add: Ts,
1998
1990
  remove: Cs
1999
1991
  };
2000
- function qs(e, t, n = !1, s, i, r) {
2001
- const o = r || U(
1992
+ function _s(e, t, n = !1, s, i, o) {
1993
+ const r = o || X(
2002
1994
  e,
2003
- M(t),
1995
+ P(t),
2004
1996
  void 0,
2005
1997
  n
2006
1998
  );
2007
- if (!o)
1999
+ if (!r)
2008
2000
  return null;
2009
- let c = !0;
2010
- const a = t.triggerType || "alternate";
2001
+ let a = !0;
2002
+ const c = t.triggerType || "alternate";
2011
2003
  return (f) => {
2012
2004
  if (s && !e.matches(s)) return;
2013
2005
  const u = !i, l = i?.enter?.includes(f.type), d = i?.leave?.includes(f.type);
2014
2006
  if (l || u) {
2015
- if (a === "alternate" || a === "state")
2016
- c ? (c = !1, o.play()) : a === "alternate" ? o.reverse() : a === "state" && (o.playState === "running" ? o.pause() : o.playState !== "finished" && o.play());
2007
+ if (c === "alternate" || c === "state")
2008
+ a ? (a = !1, r.play()) : c === "alternate" ? r.reverse() : c === "state" && (r.playState === "running" ? r.pause() : r.playState !== "finished" && r.play());
2017
2009
  else {
2018
- if (o.progress(0), delete e.dataset.interactEnter, o.isCSS) {
2019
- const v = () => {
2020
- O.mutate(() => {
2010
+ if (r.progress(0), delete e.dataset.interactEnter, r.isCSS) {
2011
+ const m = () => {
2012
+ C.mutate(() => {
2021
2013
  e.dataset.interactEnter = "done";
2022
2014
  });
2023
2015
  };
2024
- o.onFinish(v), o.onAbort(v);
2016
+ r.onFinish(m), r.onAbort(m);
2025
2017
  }
2026
- o.play();
2018
+ r.play();
2027
2019
  }
2028
2020
  return;
2029
2021
  }
2030
- d && (a === "alternate" ? o.reverse() : a === "repeat" ? (o.cancel(), O.mutate(() => {
2022
+ d && (c === "alternate" ? r.reverse() : c === "repeat" ? (r.cancel(), C.mutate(() => {
2031
2023
  delete e.dataset.interactEnter;
2032
- })) : a === "state" && o.playState === "running" && o.pause());
2024
+ })) : c === "state" && r.playState === "running" && r.pause());
2033
2025
  };
2034
2026
  }
2035
- function _s(e, t, {
2027
+ function As(e, t, {
2036
2028
  effectId: n,
2037
2029
  listContainer: s,
2038
2030
  listItemSelector: i,
2039
- stateAction: r
2040
- }, o, c) {
2041
- const a = !!s, f = r ?? "toggle", u = f === "toggle";
2031
+ stateAction: o
2032
+ }, r, a) {
2033
+ const c = !!s, f = o ?? "toggle", u = f === "toggle";
2042
2034
  return (l) => {
2043
- if (o && !e.matches(o)) return;
2044
- const d = a ? e.closest(
2035
+ if (r && !e.matches(r)) return;
2036
+ const d = c ? e.closest(
2045
2037
  `${s} > ${i || ""}:has(:scope)`
2046
- ) : void 0, v = !c, h = c?.enter?.includes(l.type), m = c?.leave?.includes(l.type);
2047
- v ? t.toggleEffect(n, f, d) : (h && t.toggleEffect(n, u ? "add" : f, d), m && u && t.toggleEffect(n, "remove", d));
2038
+ ) : void 0, m = !a, h = a?.enter?.includes(l.type), p = a?.leave?.includes(l.type);
2039
+ m ? t.toggleEffect(n, f, d) : (h && t.toggleEffect(n, u ? "add" : f, d), p && u && t.toggleEffect(n, "remove", d));
2048
2040
  };
2049
2041
  }
2050
- const Se = /* @__PURE__ */ new WeakMap();
2051
- function Ge(e, t) {
2042
+ const Te = /* @__PURE__ */ new WeakMap();
2043
+ function Ye(e, t) {
2052
2044
  return (n) => {
2053
2045
  const s = n;
2054
2046
  e.contains(s.relatedTarget) || t(s);
2055
2047
  };
2056
2048
  }
2057
- function ks(e) {
2049
+ function qs(e) {
2058
2050
  return (t) => {
2059
2051
  const n = t;
2060
2052
  n.pointerType && e(n);
2061
2053
  };
2062
2054
  }
2063
- function Ps(e) {
2055
+ function ks(e) {
2064
2056
  return (t) => {
2065
2057
  const n = t;
2066
2058
  n.code === "Space" ? (n.preventDefault(), e(n)) : n.code === "Enter" && e(n);
2067
2059
  };
2068
2060
  }
2069
2061
  const Ms = {
2070
- focusin: (e, t) => Ge(e, t),
2071
- focusout: (e, t) => Ge(e, t),
2072
- click: (e, t) => ks(t),
2073
- keydown: (e, t) => Ps(t)
2062
+ focusin: (e, t) => Ye(e, t),
2063
+ focusout: (e, t) => Ye(e, t),
2064
+ click: (e, t) => qs(t),
2065
+ keydown: (e, t) => ks(t)
2074
2066
  };
2075
- function xs(e, t, n) {
2067
+ function Ps(e, t, n) {
2076
2068
  const s = Ms[e];
2077
2069
  return s ? s(t, n) : (i) => n(i);
2078
2070
  }
2079
- function Ls(e) {
2071
+ function xs(e) {
2080
2072
  return typeof e == "object" && !Array.isArray(e) && ("enter" in e || "leave" in e);
2081
2073
  }
2082
- function Fs(e) {
2074
+ function Ls(e) {
2083
2075
  if (typeof e == "string")
2084
2076
  return { toggle: [e] };
2085
2077
  if (Array.isArray(e))
2086
2078
  return { toggle: [...e] };
2087
- if (Ls(e)) {
2079
+ if (xs(e)) {
2088
2080
  const t = e.enter ? [...e.enter] : [], n = e.leave ? [...e.leave] : [];
2089
2081
  return { enter: t, leave: n };
2090
2082
  }
2091
2083
  return {};
2092
2084
  }
2093
- function Rs(e) {
2085
+ function Fs(e) {
2094
2086
  return !!(e.enter?.length || e.leave?.length);
2095
2087
  }
2096
- function Ns(e) {
2097
- return Rs(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
2088
+ function Rs(e) {
2089
+ return Fs(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
2098
2090
  }
2099
- function zs(e, t, n, s, {
2091
+ function Ns(e, t, n, s, {
2100
2092
  reducedMotion: i,
2101
- targetController: r,
2102
- selectorCondition: o,
2103
- animation: c
2093
+ targetController: o,
2094
+ selectorCondition: r,
2095
+ animation: a
2104
2096
  }) {
2105
- const a = Fs(s.eventConfig), f = n.transition || n.transitionProperties, u = Ns(a);
2097
+ const c = Ls(s.eventConfig), f = n.transition || n.transitionProperties, u = Rs(c);
2106
2098
  let l, d = !1;
2107
- if (f ? l = _s(
2099
+ if (f ? l = As(
2108
2100
  t,
2109
- r,
2110
- n,
2111
2101
  o,
2102
+ n,
2103
+ r,
2112
2104
  u
2113
- ) : (l = qs(
2105
+ ) : (l = _s(
2114
2106
  t,
2115
2107
  n,
2116
2108
  i,
2117
- o,
2109
+ r,
2118
2110
  u,
2119
- c
2111
+ a
2120
2112
  ), d = n.triggerType === "once"), !l)
2121
2113
  return;
2122
- const v = l, h = new AbortController();
2123
- function m(E, y, w) {
2124
- const $ = xs(y, e, v);
2125
- E.addEventListener(y, $, { ...w, signal: h.signal });
2114
+ const m = l, h = new AbortController();
2115
+ function p(y, E, $) {
2116
+ const b = Ps(E, e, m);
2117
+ y.addEventListener(E, b, { ...$, signal: h.signal });
2126
2118
  }
2127
- const g = { source: e, target: t, cleanup: () => {
2119
+ const v = { source: e, target: t, cleanup: () => {
2128
2120
  h.abort();
2129
2121
  } };
2130
- if (q(Se, e, g), q(Se, t, g), u) {
2131
- const E = a.enter, y = a.leave;
2132
- E.forEach((S) => {
2133
- S === "focusin" && (e.tabIndex = 0), m(e, S, { passive: !0, once: d });
2122
+ if (A(Te, e, v), A(Te, t, v), u) {
2123
+ const y = c.enter, E = c.leave;
2124
+ y.forEach((S) => {
2125
+ S === "focusin" && (e.tabIndex = 0), p(e, S, { passive: !0, once: d });
2134
2126
  });
2135
- const w = !n.stateAction || n.stateAction === "toggle";
2136
- (f ? w : n.triggerType !== "once") && y.forEach((S) => {
2127
+ const $ = !n.stateAction || n.stateAction === "toggle";
2128
+ (f ? $ : n.triggerType !== "once") && E.forEach((S) => {
2137
2129
  if (S === "focusout") {
2138
- m(e, S, { once: d });
2130
+ p(e, S, { once: d });
2139
2131
  return;
2140
2132
  }
2141
- m(e, S, { passive: !0 });
2133
+ p(e, S, { passive: !0 });
2142
2134
  });
2143
2135
  } else
2144
- (a.toggle ?? []).forEach((y) => {
2145
- m(e, y, { once: d, passive: y !== "keydown" });
2136
+ (c.toggle ?? []).forEach((E) => {
2137
+ p(e, E, { once: d, passive: E !== "keydown" });
2146
2138
  });
2147
2139
  }
2148
- function js(e) {
2149
- Q(Se, e);
2140
+ function zs(e) {
2141
+ Z(Te, e);
2150
2142
  }
2151
- const H = {
2152
- add: zs,
2153
- remove: js
2154
- }, Ie = {
2143
+ const Y = {
2144
+ add: Ns,
2145
+ remove: zs
2146
+ }, Ce = {
2155
2147
  click: ["click"],
2156
2148
  activate: ["click", "keydown"],
2157
2149
  hover: { enter: ["mouseenter"], leave: ["mouseleave"] },
@@ -2159,43 +2151,43 @@ const H = {
2159
2151
  enter: ["mouseenter", "focusin"],
2160
2152
  leave: ["mouseleave", "focusout"]
2161
2153
  }
2162
- }, He = {
2163
- click: Ie.activate,
2164
- hover: Ie.interest
2154
+ }, Ke = {
2155
+ click: Ce.activate,
2156
+ hover: Ce.interest
2165
2157
  };
2166
- function ne(e) {
2167
- const t = Ie[e];
2168
- return (n, s, i, r, o) => {
2169
- const c = o?.allowA11yTriggers && e in He ? He[e] : t;
2170
- H.add(n, s, i, { eventConfig: c }, o ?? {});
2158
+ function ie(e) {
2159
+ const t = Ce[e];
2160
+ return (n, s, i, o, r) => {
2161
+ const a = r?.allowA11yTriggers && e in Ke ? Ke[e] : t;
2162
+ Y.add(n, s, i, { eventConfig: a }, r ?? {});
2171
2163
  };
2172
2164
  }
2173
- const N = {
2174
- viewEnter: Dn,
2165
+ const j = {
2166
+ viewEnter: jn,
2175
2167
  hover: {
2176
- add: ne("hover"),
2177
- remove: H.remove
2168
+ add: ie("hover"),
2169
+ remove: Y.remove
2178
2170
  },
2179
2171
  click: {
2180
- add: ne("click"),
2181
- remove: H.remove
2172
+ add: ie("click"),
2173
+ remove: Y.remove
2182
2174
  },
2183
- animationEnd: As,
2184
- viewProgress: cs,
2185
- pointerMove: Ts,
2175
+ animationEnd: Os,
2176
+ viewProgress: rs,
2177
+ pointerMove: Is,
2186
2178
  activate: {
2187
- add: ne("activate"),
2188
- remove: H.remove
2179
+ add: ie("activate"),
2180
+ remove: Y.remove
2189
2181
  },
2190
2182
  interest: {
2191
- add: ne("interest"),
2192
- remove: H.remove
2183
+ add: ie("interest"),
2184
+ remove: Y.remove
2193
2185
  }
2194
2186
  };
2195
- function Ds(e) {
2187
+ function js(e) {
2196
2188
  return e.replace(/\[([-\w]+)]/g, "[]");
2197
2189
  }
2198
- class b {
2190
+ class w {
2199
2191
  static defineInteractElement;
2200
2192
  dataCache;
2201
2193
  addedInteractions;
@@ -2215,13 +2207,13 @@ class b {
2215
2207
  init(t, n) {
2216
2208
  if (typeof window > "u" || !window.customElements)
2217
2209
  return;
2218
- const s = n?.useCustomElement ?? !!b.defineInteractElement;
2210
+ const s = n?.useCustomElement ?? !!w.defineInteractElement;
2219
2211
  this.dataCache = Hs(t, s);
2220
- const i = b.defineInteractElement?.();
2221
- s && i === !1 ? document.querySelectorAll("interact-element").forEach((r) => {
2222
- r.connect();
2223
- }) : b.controllerCache.forEach(
2224
- (r, o) => r.connect(o)
2212
+ const i = w.defineInteractElement?.();
2213
+ s && i === !1 ? document.querySelectorAll("interact-element").forEach((o) => {
2214
+ o.connect();
2215
+ }) : w.controllerCache.forEach(
2216
+ (o, r) => o.connect(r)
2225
2217
  );
2226
2218
  }
2227
2219
  destroy({ clearCache: t = !1 } = {}) {
@@ -2229,20 +2221,20 @@ class b {
2229
2221
  n.disconnect({ removeFromCache: t });
2230
2222
  for (const [, n] of this.mediaQueryListeners.entries())
2231
2223
  n.mql.removeEventListener("change", n.handler);
2232
- this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, b.instances.splice(b.instances.indexOf(this), 1);
2224
+ this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, w.instances.splice(w.instances.indexOf(this), 1);
2233
2225
  }
2234
2226
  setController(t, n) {
2235
- this.controllers.add(n), b.setController(t, n);
2227
+ this.controllers.add(n), w.setController(t, n);
2236
2228
  }
2237
2229
  deleteController(t, n = !1) {
2238
- const s = b.controllerCache.get(t);
2239
- this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), b.deleteController(t));
2230
+ const s = w.controllerCache.get(t);
2231
+ this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), w.deleteController(t));
2240
2232
  }
2241
2233
  has(t) {
2242
2234
  return !!this.get(t);
2243
2235
  }
2244
2236
  get(t) {
2245
- const n = Ds(t);
2237
+ const n = js(t);
2246
2238
  return this.dataCache.interactions[n];
2247
2239
  }
2248
2240
  clearMediaQueryListenersForKey(t) {
@@ -2251,12 +2243,12 @@ class b {
2251
2243
  }
2252
2244
  clearInteractionStateForKey(t) {
2253
2245
  (this.get(t)?.interactionIds || []).forEach((i) => {
2254
- const r = _(i, t);
2255
- delete this.addedInteractions[r];
2246
+ const o = q(i, t);
2247
+ delete this.addedInteractions[o];
2256
2248
  });
2257
2249
  const s = `${t}::seq::`;
2258
- for (const i of b.sequenceCache.keys())
2259
- i.startsWith(s) && (b.sequenceCache.delete(i), delete this.addedInteractions[i]);
2250
+ for (const i of w.sequenceCache.keys())
2251
+ i.startsWith(s) && (w.sequenceCache.delete(i), delete this.addedInteractions[i]);
2260
2252
  }
2261
2253
  setupMediaQueryListener(t, n, s, i) {
2262
2254
  this.mediaQueryListeners.has(t) || (n.addEventListener("change", i), this.mediaQueryListeners.set(t, {
@@ -2266,91 +2258,91 @@ class b {
2266
2258
  }));
2267
2259
  }
2268
2260
  static create(t, n) {
2269
- const s = new b();
2270
- return b.instances.push(s), s.init(t, n), s;
2261
+ const s = new w();
2262
+ return w.instances.push(s), s.init(t, n), s;
2271
2263
  }
2272
2264
  static destroy() {
2273
- b.controllerCache.forEach((t) => {
2265
+ w.controllerCache.forEach((t) => {
2274
2266
  t.disconnect();
2275
- }), b.instances.length = 0, b.controllerCache.clear(), b.sequenceCache.clear(), b.elementSequenceMap = /* @__PURE__ */ new WeakMap();
2267
+ }), w.instances.length = 0, w.controllerCache.clear(), w.sequenceCache.clear(), w.elementSequenceMap = /* @__PURE__ */ new WeakMap();
2276
2268
  }
2277
2269
  static setup(t) {
2278
- t.scrollOptionsGetter && N.viewProgress.registerOptionsGetter?.(
2270
+ t.scrollOptionsGetter && j.viewProgress.registerOptionsGetter?.(
2279
2271
  t.scrollOptionsGetter
2280
- ), t.pointerOptionsGetter && N.pointerMove.registerOptionsGetter?.(
2272
+ ), t.pointerOptionsGetter && j.pointerMove.registerOptionsGetter?.(
2281
2273
  t.pointerOptionsGetter
2282
- ), t.viewEnter && N.viewEnter.setOptions(
2274
+ ), t.viewEnter && j.viewEnter.setOptions(
2283
2275
  t.viewEnter
2284
- ), t.allowA11yTriggers !== void 0 && (b.allowA11yTriggers = t.allowA11yTriggers);
2276
+ ), t.allowA11yTriggers !== void 0 && (w.allowA11yTriggers = t.allowA11yTriggers);
2285
2277
  }
2286
2278
  static getInstance(t) {
2287
- const n = b.instances.find((s) => s.has(t));
2279
+ const n = w.instances.find((s) => s.has(t));
2288
2280
  return n || console.warn(`Interact: Instance for key "${t}" not found`), n;
2289
2281
  }
2290
2282
  static getController(t) {
2291
- const n = t ? b.controllerCache.get(t) : void 0;
2283
+ const n = t ? w.controllerCache.get(t) : void 0;
2292
2284
  return n || console.warn(`Interact: Controller for key "${t}" not found`), n;
2293
2285
  }
2294
2286
  static setController(t, n) {
2295
- b.controllerCache.set(t, n);
2287
+ w.controllerCache.set(t, n);
2296
2288
  }
2297
2289
  static deleteController(t) {
2298
- b.controllerCache.delete(t);
2290
+ w.controllerCache.delete(t);
2299
2291
  }
2300
- static registerEffects = wn;
2292
+ static registerEffects = En;
2301
2293
  /**
2302
2294
  * Registers a plugin under a name. When the config carries a plugin field (e.g. `$splitText`) with a matching key
2303
2295
  * (on an interaction or effect), Interact invokes the plugin with the field's value and a
2304
2296
  * context. Interact is agnostic to what the plugin does — see the `InteractPlugin` type.
2305
2297
  */
2306
2298
  static use(t, n) {
2307
- b.plugins.set(t, n);
2299
+ w.plugins.set(t, n);
2308
2300
  }
2309
2301
  static getPlugin(t) {
2310
- return b.plugins.get(t);
2302
+ return w.plugins.get(t);
2311
2303
  }
2312
2304
  static getPluginsNames() {
2313
- return new Set(b.plugins.keys());
2305
+ return new Set(w.plugins.keys());
2314
2306
  }
2315
2307
  static getSequence(t, n, s, i) {
2316
- const r = b.sequenceCache.get(t);
2317
- if (r) return r;
2318
- const o = kn(n, s, i);
2319
- return b.sequenceCache.set(t, o), b._registerSequenceElements(s, o), o;
2308
+ const o = w.sequenceCache.get(t);
2309
+ if (o) return o;
2310
+ const r = qn(n, s, i);
2311
+ return w.sequenceCache.set(t, r), w._registerSequenceElements(s, r), r;
2320
2312
  }
2321
2313
  static addToSequence(t, n, s, i) {
2322
- const r = b.sequenceCache.get(t);
2323
- if (!r) return !1;
2324
- const c = rt(n, i).map((a, f) => ({
2325
- index: s[f] ?? r.animationGroups.length,
2326
- group: a
2314
+ const o = w.sequenceCache.get(t);
2315
+ if (!o) return !1;
2316
+ const a = ct(n, i).map((c, f) => ({
2317
+ index: s[f] ?? o.animationGroups.length,
2318
+ group: c
2327
2319
  }));
2328
- return r.addGroups(c), b._registerSequenceElements(n, r), !0;
2320
+ return o.addGroups(a), w._registerSequenceElements(n, o), !0;
2329
2321
  }
2330
2322
  static _registerSequenceElements(t, n) {
2331
2323
  for (const { target: s } of t) {
2332
2324
  const i = Array.isArray(s) ? s : s instanceof HTMLElement ? [s] : [];
2333
- for (const r of i) {
2334
- let o = b.elementSequenceMap.get(r);
2335
- o || (o = /* @__PURE__ */ new Set(), b.elementSequenceMap.set(r, o)), o.add(n);
2325
+ for (const o of i) {
2326
+ let r = w.elementSequenceMap.get(o);
2327
+ r || (r = /* @__PURE__ */ new Set(), w.elementSequenceMap.set(o, r)), r.add(n);
2336
2328
  }
2337
2329
  }
2338
2330
  }
2339
2331
  static removeFromSequences(t) {
2340
2332
  for (const n of t) {
2341
- const s = b.elementSequenceMap.get(n);
2333
+ const s = w.elementSequenceMap.get(n);
2342
2334
  if (s) {
2343
2335
  for (const i of s)
2344
2336
  i.removeGroups(
2345
- (r) => r.animations.some((o) => o.effect?.target === n)
2337
+ (o) => o.animations.some((r) => r.effect?.target === n)
2346
2338
  );
2347
- b.elementSequenceMap.delete(n);
2339
+ w.elementSequenceMap.delete(n);
2348
2340
  }
2349
2341
  }
2350
2342
  }
2351
2343
  }
2352
- let Gs = 0;
2353
- function L(e, {
2344
+ let Ds = 0;
2345
+ function D(e, {
2354
2346
  asCombinator: t = !1,
2355
2347
  addItemFilter: n = !1,
2356
2348
  useFirstChild: s = !1
@@ -2362,10 +2354,10 @@ function L(e, {
2362
2354
  return e.selector;
2363
2355
  return s ? t ? "> :first-child" : ":scope > :first-child" : "";
2364
2356
  }
2365
- function We(e) {
2357
+ function Be(e) {
2366
2358
  return "sequenceId" in e && !("effects" in e);
2367
2359
  }
2368
- function ve(e, t) {
2360
+ function Ee(e, t) {
2369
2361
  return e[t] || (e[t] = {
2370
2362
  triggers: [],
2371
2363
  effects: {},
@@ -2375,65 +2367,65 @@ function ve(e, t) {
2375
2367
  }), e[t];
2376
2368
  }
2377
2369
  function Hs(e, t = !1) {
2378
- const { effects: n = {}, sequences: s = {}, conditions: i = {} } = e, r = {};
2379
- return e.interactions?.forEach((o, c) => {
2380
- const a = o.key, f = ++Gs, { effects: u, sequences: l, ...d } = o;
2381
- if (!a) {
2370
+ const { effects: n = {}, sequences: s = {}, conditions: i = {} } = e, o = {};
2371
+ return e.interactions?.forEach((r, a) => {
2372
+ const c = r.key, f = ++Ds, { effects: u, sequences: l, ...d } = r;
2373
+ if (!c) {
2382
2374
  console.error(`Interaction ${f} is missing a key for source element.`);
2383
2375
  return;
2384
2376
  }
2385
- ve(r, a);
2386
- const v = u ? Array.from(u) : [];
2387
- v.reverse();
2388
- const h = l?.map((g, E) => {
2389
- if (We(g)) {
2390
- const w = s[g.sequenceId];
2391
- return w ? { ...w, ...g } : (console.warn(`Interact: Sequence "${g.sequenceId}" not found in config`), g);
2377
+ Ee(o, c);
2378
+ const m = u ? Array.from(u) : [];
2379
+ m.reverse();
2380
+ const h = l?.map((v, y) => {
2381
+ if (Be(v)) {
2382
+ const $ = s[v.sequenceId];
2383
+ return $ ? { ...$, ...v } : (console.warn(`Interact: Sequence "${v.sequenceId}" not found in config`), v);
2392
2384
  }
2393
- const y = g;
2394
- return y.sequenceId || (y.sequenceId = `seq-${c}-${E}`), y;
2395
- }), m = {
2385
+ const E = v;
2386
+ return E.sequenceId || (E.sequenceId = `seq-${a}-${y}`), E;
2387
+ }), p = {
2396
2388
  ...d,
2397
- effects: v.length > 0 ? v : void 0,
2389
+ effects: m.length > 0 ? m : void 0,
2398
2390
  sequences: h
2399
2391
  };
2400
- r[a].triggers.push(m), r[a].selectors.add(
2401
- L(m, { useFirstChild: t })
2392
+ o[c].triggers.push(p), o[c].selectors.add(
2393
+ D(p, { useFirstChild: t })
2402
2394
  );
2403
- const p = m.listContainer;
2404
- v.forEach((g, E) => {
2405
- let y = g.key;
2406
- if (!y && g.effectId) {
2407
- const I = n[g.effectId];
2408
- I && (y = I.key);
2395
+ const g = p.listContainer;
2396
+ m.forEach((v, y) => {
2397
+ let E = v.key;
2398
+ if (!E && v.effectId) {
2399
+ const I = n[v.effectId];
2400
+ I && (E = I.key);
2409
2401
  }
2410
- g.effectId || (g.effectId = `eff-${c}-${v.length - 1 - E}`), y = y || a, g.key = y;
2411
- const w = g.effectId;
2412
- if (p && g.listContainer && (y !== a || g.listContainer !== p))
2402
+ v.effectId || (v.effectId = `eff-${a}-${m.length - 1 - y}`), E = E || c, v.key = E;
2403
+ const $ = v.effectId;
2404
+ if (g && v.listContainer && (E !== c || v.listContainer !== g))
2413
2405
  return;
2414
- const $ = `${a}::${y}::${w}::${f}`;
2415
- if (g.interactionId = $, r[a].interactionIds.add($), y === a)
2406
+ const b = `${c}::${E}::${$}::${f}`;
2407
+ if (v.interactionId = b, o[c].interactionIds.add(b), E === c)
2416
2408
  return;
2417
- const S = ve(r, y);
2418
- S.effects[$] || (S.effects[$] = [], S.interactionIds.add($)), S.effects[$].push({ ...d, effect: g }), S.selectors.add(L(g, { useFirstChild: t }));
2419
- }), h?.forEach((g) => {
2420
- if (!g || We(g)) return;
2421
- const E = g, y = E.sequenceId;
2422
- E.effects.forEach(($, S) => {
2423
- $.effectId || ($.effectId = `eff-${y}-${S}`);
2424
- let I = $.key;
2425
- if (!I && $.effectId) {
2426
- const C = n[$.effectId];
2427
- C && (I = C.key);
2409
+ const S = Ee(o, E);
2410
+ S.effects[b] || (S.effects[b] = [], S.interactionIds.add(b)), S.effects[b].push({ ...d, effect: v }), S.selectors.add(D(v, { useFirstChild: t }));
2411
+ }), h?.forEach((v) => {
2412
+ if (!v || Be(v)) return;
2413
+ const y = v, E = y.sequenceId;
2414
+ y.effects.forEach((b, S) => {
2415
+ b.effectId || (b.effectId = `eff-${E}-${S}`);
2416
+ let I = b.key;
2417
+ if (!I && b.effectId) {
2418
+ const T = n[b.effectId];
2419
+ T && (I = T.key);
2428
2420
  }
2429
- I = I || a;
2430
- const T = L($, { useFirstChild: t });
2431
- if (T && r[a].selectors.add(T), I !== a) {
2432
- const C = ve(r, I), A = `${I}::seq::${y}::${f}`;
2433
- C.sequences[A] || (C.sequences[A] = [], C.interactionIds.add(A)), C.sequences[A].push({
2421
+ I = I || c;
2422
+ const O = D(b, { useFirstChild: t });
2423
+ if (O && o[c].selectors.add(O), I !== c) {
2424
+ const T = Ee(o, I), _ = `${I}::seq::${E}::${f}`;
2425
+ T.sequences[_] || (T.sequences[_] = [], T.interactionIds.add(_)), T.sequences[_].push({
2434
2426
  ...d,
2435
- sequence: E
2436
- }), C.selectors.add(T);
2427
+ sequence: y
2428
+ }), T.selectors.add(O);
2437
2429
  }
2438
2430
  });
2439
2431
  });
@@ -2441,26 +2433,23 @@ function Hs(e, t = !1) {
2441
2433
  effects: n,
2442
2434
  sequences: s,
2443
2435
  conditions: i,
2444
- interactions: r
2436
+ interactions: o
2445
2437
  };
2446
2438
  }
2447
- const dt = "$";
2448
- function Ws(e, t = 2) {
2439
+ const pt = "$";
2440
+ function Gs(e, t = 2) {
2449
2441
  return parseFloat(e.toFixed(t));
2450
2442
  }
2451
- function Vs(e) {
2443
+ function Ws(e) {
2452
2444
  return /\[]/g.test(e);
2453
2445
  }
2454
- function Ys(e) {
2455
- return `--${e.join("-")}`;
2456
- }
2457
- function Bs(e) {
2446
+ function Vs(e) {
2458
2447
  return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
2459
2448
  }
2460
- function oe(e, t) {
2449
+ function ce(e, t) {
2461
2450
  return t.includes("&") ? t.replace(/&/g, e) : `${e}${t}`;
2462
2451
  }
2463
- function B() {
2452
+ function U() {
2464
2453
  return "wi-12343210".replace(
2465
2454
  /\d/g,
2466
2455
  (e) => String.fromCharCode(
@@ -2469,89 +2458,89 @@ function B() {
2469
2458
  // 97 for "a"
2470
2459
  );
2471
2460
  }
2472
- function ht(e) {
2461
+ function gt(e) {
2473
2462
  const { transition: t, transitionProperties: n } = e;
2474
2463
  return (t?.styleProperties || n || []).map((i) => ({
2475
2464
  ...i,
2476
- name: ue(i.name)
2465
+ name: fe(i.name)
2477
2466
  }));
2478
2467
  }
2479
- function mt(e) {
2468
+ function vt(e) {
2480
2469
  let { transition: t, transitionProperties: n } = e, s = [];
2481
2470
  if (t?.styleProperties) {
2482
- const { duration: i, easing: r, delay: o } = t;
2471
+ const { duration: i, easing: o, delay: r } = t;
2483
2472
  i && (t.styleProperties.some(
2484
- (a) => a.name.startsWith("--")
2473
+ (c) => c.name.startsWith("--")
2485
2474
  ) ? s = [
2486
- `all ${i}ms ${se(r || "ease")}${o ? ` ${o}ms` : ""}`,
2475
+ `all ${i}ms ${oe(o || "ease")}${r ? ` ${r}ms` : ""}`,
2487
2476
  "visibility 0s"
2488
2477
  ] : s = t.styleProperties.map(
2489
- (a) => `${ue(a.name)} ${i}ms ${se(
2490
- r || "ease"
2491
- )}${o ? ` ${o}ms` : ""}`
2478
+ (c) => `${fe(c.name)} ${i}ms ${oe(
2479
+ o || "ease"
2480
+ )}${r ? ` ${r}ms` : ""}`
2492
2481
  ));
2493
2482
  } else
2494
2483
  s = n?.filter((i) => i.duration).map(
2495
- (i) => `${ue(i.name)} ${i.duration}ms ${se(i.easing) || "ease"}${i.delay ? ` ${i.delay}ms` : ""}`
2484
+ (i) => `${fe(i.name)} ${i.duration}ms ${oe(i.easing) || "ease"}${i.delay ? ` ${i.delay}ms` : ""}`
2496
2485
  ) || [];
2497
2486
  return s;
2498
2487
  }
2499
- function Ks({
2488
+ function Ys({
2500
2489
  key: e,
2501
2490
  effectId: t,
2502
2491
  transition: n,
2503
2492
  transitionProperties: s,
2504
2493
  childSelector: i = "> :first-child",
2505
- selectorCondition: r
2494
+ selectorCondition: o
2506
2495
  }) {
2507
- const o = mt({
2496
+ const r = vt({
2508
2497
  transition: n,
2509
2498
  transitionProperties: s
2510
- }), c = ht({ transition: n, transitionProperties: s }).map(
2499
+ }), a = gt({ transition: n, transitionProperties: s }).map(
2511
2500
  (h) => `${h.name}: ${h.value};`
2512
- ), a = e.replace(/"/g, "'"), f = `:is(:state(${t}), :--${t}) ${i}`, u = `[data-interact-effect~="${t}"] ${i}`, l = r ? oe(f, r) : f, d = r ? oe(u, r) : u, v = [
2501
+ ), c = e.replace(/"/g, "'"), f = `:is(:state(${t}), :--${t}) ${i}`, u = `[data-interact-effect~="${t}"] ${i}`, l = o ? ce(f, o) : f, d = o ? ce(u, o) : u, m = [
2513
2502
  `${l},
2514
2503
  ${d} {
2515
- ${c.join(`
2504
+ ${a.join(`
2516
2505
  `)}
2517
2506
  }`
2518
2507
  ];
2519
- if (o.length) {
2520
- const h = `[data-interact-key="${a}"] ${i}`, m = r ? oe(h, r) : h;
2521
- v.push(`@media (prefers-reduced-motion: no-preference) { ${m} {
2522
- transition: ${o.join(", ")};
2508
+ if (r.length) {
2509
+ const h = `[data-interact-key="${c}"] ${i}`, p = o ? ce(h, o) : h;
2510
+ m.push(`@media (prefers-reduced-motion: no-preference) { ${p} {
2511
+ transition: ${r.join(", ")};
2523
2512
  } }`);
2524
2513
  }
2525
- return v;
2514
+ return m;
2526
2515
  }
2527
- function X(e, t, n) {
2516
+ function J(e, t, n) {
2528
2517
  const s = (e || []).filter((i) => t[i]?.type === n && t[i].predicate).map((i) => t[i].predicate).join(") and (");
2529
2518
  return s && `(${s})`;
2530
2519
  }
2531
2520
  function k(e, t) {
2532
- const n = X(e, t, "media");
2521
+ const n = J(e, t, "media");
2533
2522
  return n && window.matchMedia(n);
2534
2523
  }
2535
- function P(e, t) {
2524
+ function M(e, t) {
2536
2525
  return (e || []).filter((n) => t[n]?.type === "selector" && t[n].predicate).map((n) => `:is(${t[n].predicate})`).join("");
2537
2526
  }
2538
- function me(e, t, n, s, i) {
2539
- const r = b.getPluginsNames();
2540
- for (const o of r) {
2541
- const c = `${dt}${o}`;
2542
- if (!(c in n))
2527
+ function ge(e, t, n, s, i) {
2528
+ const o = w.getPluginsNames();
2529
+ for (const r of o) {
2530
+ const a = `${pt}${r}`;
2531
+ if (!(a in n))
2543
2532
  continue;
2544
- const a = n[c];
2545
- if (a !== null && typeof a == "object") {
2546
- if (e._appliedPlugins.has(a))
2533
+ const c = n[a];
2534
+ if (c !== null && typeof c == "object") {
2535
+ if (e._appliedPlugins.has(c))
2547
2536
  continue;
2548
- e._appliedPlugins.add(a);
2537
+ e._appliedPlugins.add(c);
2549
2538
  }
2550
- const u = b.getPlugin(o)(a, { root: t, key: s, scope: i, config: n });
2539
+ const u = w.getPlugin(r)(c, { root: t, key: s, scope: i, config: n });
2551
2540
  typeof u == "function" && e._pluginCleanups.push(u);
2552
2541
  }
2553
2542
  }
2554
- function de(e, t, n) {
2543
+ function he(e, t, n) {
2555
2544
  if (e.listContainer) {
2556
2545
  const s = t.querySelector(e.listContainer);
2557
2546
  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}"`), []);
@@ -2564,75 +2553,75 @@ function de(e, t, n) {
2564
2553
  }
2565
2554
  return n ? t.firstElementChild : t;
2566
2555
  }
2567
- function he(e, t) {
2556
+ function me(e, t) {
2568
2557
  return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
2569
2558
  }
2570
- function pt(e, t, n, s, i, r, o, c) {
2559
+ function yt(e, t, n, s, i, o, r, a) {
2571
2560
  return [
2572
- o ? he(e, o) : de(e, n, s),
2573
- c ? he(t, c) : de(t, i, r)
2561
+ r ? me(e, r) : he(e, n, s),
2562
+ a ? me(t, a) : he(t, i, o)
2574
2563
  ];
2575
2564
  }
2576
- function gt(e, t, n, s, i, r, o, c) {
2577
- const a = Array.isArray(s), f = Array.isArray(i);
2578
- a ? s.forEach((u, l) => {
2565
+ function Et(e, t, n, s, i, o, r, a) {
2566
+ const c = Array.isArray(s), f = Array.isArray(i);
2567
+ c ? s.forEach((u, l) => {
2579
2568
  const d = f ? i[l] : i;
2580
- d && Ve(
2569
+ d && Ue(
2581
2570
  e,
2582
2571
  u,
2583
2572
  t.trigger,
2584
2573
  d,
2585
2574
  n,
2586
2575
  t.params,
2587
- r,
2588
2576
  o,
2589
- c
2577
+ r,
2578
+ a
2590
2579
  );
2591
2580
  }) : (f ? i : [i]).forEach((l) => {
2592
- Ve(
2581
+ Ue(
2593
2582
  e,
2594
2583
  s,
2595
2584
  t.trigger,
2596
2585
  l,
2597
2586
  n,
2598
2587
  t.params,
2599
- r,
2600
2588
  o,
2601
- c
2589
+ r,
2590
+ a
2602
2591
  );
2603
2592
  });
2604
2593
  }
2605
- function vt(e, t, n, s, i) {
2606
- const r = {}, o = [];
2607
- (s.effects || []).forEach((c) => {
2608
- const a = c.effectId, f = {
2609
- ...n.dataCache.effects[a] || {},
2610
- ...c,
2611
- effectId: a
2612
- }, u = f.key, l = _(c.interactionId, e);
2613
- if (r[l] || n.addedInteractions[l] && !i)
2594
+ function wt(e, t, n, s, i) {
2595
+ const o = {}, r = [];
2596
+ (s.effects || []).forEach((a) => {
2597
+ const c = a.effectId, f = {
2598
+ ...n.dataCache.effects[c] || {},
2599
+ ...a,
2600
+ effectId: c
2601
+ }, u = f.key, l = q(a.interactionId, e);
2602
+ if (o[l] || n.addedInteractions[l] && !i)
2614
2603
  return;
2615
2604
  const d = k(f.conditions || [], n.dataCache.conditions);
2616
2605
  if (d && n.setupMediaQueryListener(l, d, e, () => {
2617
2606
  t.update();
2618
2607
  }), !d || d.matches) {
2619
- r[l] = !0;
2620
- const v = u && _(u, e);
2608
+ o[l] = !0;
2609
+ const m = u && q(u, e);
2621
2610
  let h;
2622
- if (v) {
2623
- if (h = b.getController(v), !h)
2611
+ if (m) {
2612
+ if (h = w.getController(m), !h)
2624
2613
  return;
2625
2614
  f.listContainer && h.watchChildList(f.listContainer);
2626
2615
  } else
2627
2616
  h = t;
2628
- me(
2617
+ ge(
2629
2618
  h,
2630
2619
  h.element,
2631
2620
  f,
2632
- v || s.key,
2621
+ m || s.key,
2633
2622
  "effect"
2634
2623
  );
2635
- const [m, p] = pt(
2624
+ const [p, g] = yt(
2636
2625
  s,
2637
2626
  f,
2638
2627
  t.element,
@@ -2641,122 +2630,122 @@ function vt(e, t, n, s, i) {
2641
2630
  h.useFirstChild,
2642
2631
  i
2643
2632
  );
2644
- if (!m || !p)
2633
+ if (!p || !g)
2645
2634
  return;
2646
2635
  n.addedInteractions[l] = !0;
2647
- const g = v || s.key, E = P(
2636
+ const v = m || s.key, y = M(
2648
2637
  f.conditions || [],
2649
2638
  n.dataCache.conditions
2650
2639
  );
2651
- o.push([
2652
- g,
2640
+ r.push([
2641
+ v,
2653
2642
  s,
2654
2643
  f,
2655
- m,
2656
2644
  p,
2657
- E,
2645
+ g,
2646
+ y,
2658
2647
  h.useFirstChild,
2659
2648
  e
2660
2649
  ]);
2661
2650
  }
2662
- }), o.reverse().forEach((c) => {
2663
- gt(...c);
2664
- }), Qs(e, t, n, s, i);
2651
+ }), r.reverse().forEach((a) => {
2652
+ Et(...a);
2653
+ }), Bs(e, t, n, s, i);
2665
2654
  }
2666
- function Us(e) {
2655
+ function Ks(e) {
2667
2656
  return "sequenceId" in e && !("effects" in e);
2668
2657
  }
2669
- function yt(e, t, n, s, i, r, o) {
2670
- const c = k(e.conditions || [], i.dataCache.conditions);
2671
- if (c && i.setupMediaQueryListener(t, c, r.updateKey, r.onUpdate), c && !c.matches) return null;
2672
- const a = e.effects || [], f = [];
2658
+ function $t(e, t, n, s, i, o, r) {
2659
+ const a = k(e.conditions || [], i.dataCache.conditions);
2660
+ if (a && i.setupMediaQueryListener(t, a, o.updateKey, o.onUpdate), a && !a.matches) return null;
2661
+ const c = e.effects || [], f = [];
2673
2662
  let u = !1;
2674
- for (const l of a) {
2663
+ for (const l of c) {
2675
2664
  const d = l.effectId, h = {
2676
2665
  ...d ? i.dataCache.effects[d] || {} : {},
2677
2666
  ...l
2678
- }, m = k(h.conditions || [], i.dataCache.conditions);
2679
- if (m) {
2667
+ }, p = k(h.conditions || [], i.dataCache.conditions);
2668
+ if (p) {
2680
2669
  const S = `${t}::${d || "eff"}`;
2681
2670
  i.setupMediaQueryListener(
2682
2671
  S,
2683
- m,
2684
- r.updateKey,
2685
- r.onUpdate
2672
+ p,
2673
+ o.updateKey,
2674
+ o.onUpdate
2686
2675
  );
2687
2676
  }
2688
- if (m && !m.matches) continue;
2689
- const p = h.key, g = p && _(p, n);
2690
- let E;
2691
- if (g) {
2692
- if (E = b.getController(g), !E) return null;
2677
+ if (p && !p.matches) continue;
2678
+ const g = h.key, v = g && q(g, n);
2679
+ let y;
2680
+ if (v) {
2681
+ if (y = w.getController(v), !y) return null;
2693
2682
  } else
2694
- E = s;
2695
- const y = g || n;
2696
- me(
2697
- E,
2698
- E.element,
2699
- h,
2683
+ y = s;
2684
+ const E = v || n;
2685
+ ge(
2700
2686
  y,
2687
+ y.element,
2688
+ h,
2689
+ E,
2701
2690
  "effect"
2702
2691
  );
2703
- let w;
2704
- if (o && y === o.controllerKey && h.listContainer === o.listContainer ? (w = he(h, o.elements), w.length > 0 && (u = !0)) : w = de(
2692
+ let $;
2693
+ if (r && E === r.controllerKey && h.listContainer === r.listContainer ? ($ = me(h, r.elements), $.length > 0 && (u = !0)) : $ = he(
2705
2694
  h,
2706
- E.element,
2707
- E.useFirstChild
2708
- ), !w || Array.isArray(w) && w.length === 0) return null;
2709
- const $ = M(h);
2710
- f.push({ target: w, options: $ });
2695
+ y.element,
2696
+ y.useFirstChild
2697
+ ), !$ || Array.isArray($) && $.length === 0) return null;
2698
+ const b = P(h);
2699
+ f.push({ target: $, options: b });
2711
2700
  }
2712
- return o && !u ? null : f.length > 0 ? f : null;
2701
+ return r && !u ? null : f.length > 0 ? f : null;
2713
2702
  }
2714
- function Te(e, t, n) {
2715
- const s = n ? he(e, n) : de(e, t.element, t.useFirstChild);
2703
+ function Oe(e, t, n) {
2704
+ const s = n ? me(e, n) : he(e, t.element, t.useFirstChild);
2716
2705
  return Array.isArray(s) && s.length === 0 ? null : s;
2717
2706
  }
2718
- function Oe(e, t, n, s, i) {
2719
- (Array.isArray(n) ? n : [n]).forEach((o) => {
2720
- N[e.trigger]?.add(
2721
- o,
2722
- o,
2707
+ function _e(e, t, n, s, i) {
2708
+ (Array.isArray(n) ? n : [n]).forEach((r) => {
2709
+ j[e.trigger]?.add(
2710
+ r,
2711
+ r,
2723
2712
  { triggerType: t.triggerType },
2724
2713
  e.params || {},
2725
2714
  {
2726
- reducedMotion: b.forceReducedMotion,
2715
+ reducedMotion: w.forceReducedMotion,
2727
2716
  selectorCondition: i,
2728
2717
  animation: s,
2729
- allowA11yTriggers: b.allowA11yTriggers
2718
+ allowA11yTriggers: w.allowA11yTriggers
2730
2719
  }
2731
2720
  );
2732
2721
  });
2733
2722
  }
2734
- function Et(e, t, n) {
2735
- const r = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
2736
- if (!r) return n.map((c, a) => a);
2737
- const o = Array.from(r.children);
2738
- return n.map((c) => {
2739
- const a = o.indexOf(c);
2740
- return a >= 0 ? a : o.length;
2723
+ function bt(e, t, n) {
2724
+ const o = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
2725
+ if (!o) return n.map((a, c) => c);
2726
+ const r = Array.from(o.children);
2727
+ return n.map((a) => {
2728
+ const c = r.indexOf(a);
2729
+ return c >= 0 ? c : r.length;
2741
2730
  });
2742
2731
  }
2743
- function Qs(e, t, n, s, i) {
2744
- s.sequences?.forEach((r) => {
2745
- let o;
2746
- if (Us(r)) {
2747
- const h = n.dataCache.sequences[r.sequenceId];
2732
+ function Bs(e, t, n, s, i) {
2733
+ s.sequences?.forEach((o) => {
2734
+ let r;
2735
+ if (Ks(o)) {
2736
+ const h = n.dataCache.sequences[o.sequenceId];
2748
2737
  if (!h) {
2749
- console.warn(`Interact: Sequence "${r.sequenceId}" not found in cache`);
2738
+ console.warn(`Interact: Sequence "${o.sequenceId}" not found in cache`);
2750
2739
  return;
2751
2740
  }
2752
- o = { ...h, ...r };
2741
+ r = { ...h, ...o };
2753
2742
  } else
2754
- o = r;
2755
- const c = o.sequenceId || B(), a = _(`${e}::seq::${c}`, e);
2756
- if (n.addedInteractions[a] && !i) return;
2757
- const f = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, u = yt(
2758
- o,
2759
- a,
2743
+ r = o;
2744
+ const a = r.sequenceId || U(), c = q(`${e}::seq::${a}`, e);
2745
+ if (n.addedInteractions[c] && !i) return;
2746
+ const f = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, u = $t(
2747
+ r,
2748
+ c,
2760
2749
  e,
2761
2750
  t,
2762
2751
  n,
@@ -2764,164 +2753,164 @@ function Qs(e, t, n, s, i) {
2764
2753
  f
2765
2754
  );
2766
2755
  if (!u) return;
2767
- if (i && n.addedInteractions[a]) {
2768
- const h = Et(
2756
+ if (i && n.addedInteractions[c]) {
2757
+ const h = bt(
2769
2758
  t,
2770
2759
  s.listContainer,
2771
2760
  i
2772
2761
  );
2773
- b.addToSequence(a, u, h, {
2774
- reducedMotion: b.forceReducedMotion
2762
+ w.addToSequence(c, u, h, {
2763
+ reducedMotion: w.forceReducedMotion
2775
2764
  });
2776
- const m = b.getSequence(a, o, u, {
2777
- reducedMotion: b.forceReducedMotion
2778
- }), p = P(
2765
+ const p = w.getSequence(c, r, u, {
2766
+ reducedMotion: w.forceReducedMotion
2767
+ }), g = M(
2779
2768
  s.conditions || [],
2780
2769
  n.dataCache.conditions
2781
- ), g = Te(s, t, i);
2782
- g && Oe(
2770
+ ), v = Oe(s, t, i);
2771
+ v && _e(
2783
2772
  s,
2784
- o,
2785
- g,
2786
- m,
2787
- p
2773
+ r,
2774
+ v,
2775
+ p,
2776
+ g
2788
2777
  );
2789
2778
  return;
2790
2779
  }
2791
- const l = b.getSequence(a, o, u, {
2792
- reducedMotion: b.forceReducedMotion
2793
- }), d = P(
2780
+ const l = w.getSequence(c, r, u, {
2781
+ reducedMotion: w.forceReducedMotion
2782
+ }), d = M(
2794
2783
  s.conditions || [],
2795
2784
  n.dataCache.conditions
2796
- ), v = Te(s, t, i);
2797
- v && (n.addedInteractions[a] = !0, Oe(
2785
+ ), m = Oe(s, t, i);
2786
+ m && (n.addedInteractions[c] = !0, _e(
2798
2787
  s,
2799
- o,
2800
- v,
2788
+ r,
2789
+ m,
2801
2790
  l,
2802
2791
  d
2803
2792
  ));
2804
2793
  });
2805
2794
  }
2806
- function Xs(e, t, n, s, i) {
2807
- const r = n.get(e)?.sequences || {};
2808
- Object.keys(r).forEach((c) => {
2809
- r[c].some(({ sequence: f, ...u }) => {
2795
+ function Us(e, t, n, s, i) {
2796
+ const o = n.get(e)?.sequences || {};
2797
+ Object.keys(o).forEach((a) => {
2798
+ o[a].some(({ sequence: f, ...u }) => {
2810
2799
  const l = k(
2811
2800
  u.conditions || [],
2812
2801
  n.dataCache.conditions
2813
2802
  );
2814
2803
  if (l && !l.matches)
2815
2804
  return !1;
2816
- const d = u.key && _(u.key, e), v = b.getController(d);
2817
- if (!v)
2805
+ const d = u.key && q(u.key, e), m = w.getController(d);
2806
+ if (!m)
2818
2807
  return !0;
2819
- const h = f.sequenceId || B(), m = _(`${d}::seq::${h}`, d);
2820
- if (n.addedInteractions[m] && !i)
2808
+ const h = f.sequenceId || U(), p = q(`${d}::seq::${h}`, d);
2809
+ if (n.addedInteractions[p] && !i)
2821
2810
  return !0;
2822
- const g = yt(
2811
+ const v = $t(
2823
2812
  f,
2824
- m,
2813
+ p,
2825
2814
  d,
2826
- v,
2815
+ m,
2827
2816
  n,
2828
2817
  { updateKey: e, onUpdate: () => t.update() },
2829
2818
  i && s ? { controllerKey: e, listContainer: s, elements: i } : void 0
2830
2819
  );
2831
- if (!g) return !0;
2832
- if (i && n.addedInteractions[m]) {
2833
- const $ = Et(t, s, i);
2834
- return b.addToSequence(m, g, $, {
2835
- reducedMotion: b.forceReducedMotion
2820
+ if (!v) return !0;
2821
+ if (i && n.addedInteractions[p]) {
2822
+ const b = bt(t, s, i);
2823
+ return w.addToSequence(p, v, b, {
2824
+ reducedMotion: w.forceReducedMotion
2836
2825
  }), !0;
2837
2826
  }
2838
- const E = b.getSequence(m, f, g, {
2839
- reducedMotion: b.forceReducedMotion
2840
- }), y = P(
2827
+ const y = w.getSequence(p, f, v, {
2828
+ reducedMotion: w.forceReducedMotion
2829
+ }), E = M(
2841
2830
  u.conditions || [],
2842
2831
  n.dataCache.conditions
2843
- ), w = Te(u, v);
2844
- return w && (n.addedInteractions[m] = !0, Oe(
2832
+ ), $ = Oe(u, m);
2833
+ return $ && (n.addedInteractions[p] = !0, _e(
2845
2834
  u,
2846
2835
  f,
2847
- w,
2848
- E,
2849
- y
2836
+ $,
2837
+ y,
2838
+ E
2850
2839
  )), !0;
2851
2840
  });
2852
2841
  });
2853
2842
  }
2854
- function wt(e, t, n, s, i) {
2855
- const r = n.get(e), o = r?.effects || {}, c = Object.keys(o), a = [];
2856
- c.forEach((u) => {
2857
- const l = _(u, e);
2843
+ function St(e, t, n, s, i) {
2844
+ const o = n.get(e), r = o?.effects || {}, a = Object.keys(r), c = [];
2845
+ a.forEach((u) => {
2846
+ const l = q(u, e);
2858
2847
  if (n.addedInteractions[l] && !i)
2859
2848
  return;
2860
- o[u].some(({ effect: v, ...h }) => {
2861
- const m = k(
2849
+ r[u].some(({ effect: m, ...h }) => {
2850
+ const p = k(
2862
2851
  h.conditions || [],
2863
2852
  n.dataCache.conditions
2864
2853
  );
2865
- if (m && !m.matches)
2854
+ if (p && !p.matches)
2866
2855
  return !1;
2867
- const p = v.effectId, g = {
2868
- ...n.dataCache.effects[p] || {},
2869
- ...v,
2870
- effectId: p
2856
+ const g = m.effectId, v = {
2857
+ ...n.dataCache.effects[g] || {},
2858
+ ...m,
2859
+ effectId: g
2871
2860
  };
2872
- if (s && g.listContainer !== s)
2861
+ if (s && v.listContainer !== s)
2873
2862
  return !1;
2874
- const E = k(g.conditions || [], n.dataCache.conditions);
2875
- if (E && n.setupMediaQueryListener(l, E, e, () => {
2863
+ const y = k(v.conditions || [], n.dataCache.conditions);
2864
+ if (y && n.setupMediaQueryListener(l, y, e, () => {
2876
2865
  t.update();
2877
- }), !E || E.matches) {
2878
- const y = h.key && _(h.key, e), w = b.getController(y);
2879
- if (!w)
2866
+ }), !y || y.matches) {
2867
+ const E = h.key && q(h.key, e), $ = w.getController(E);
2868
+ if (!$)
2880
2869
  return !0;
2881
- me(
2870
+ ge(
2882
2871
  t,
2883
2872
  t.element,
2884
- g,
2873
+ v,
2885
2874
  e,
2886
2875
  "effect"
2887
- ), g.listContainer && t.watchChildList(g.listContainer);
2888
- const [$, S] = pt(
2876
+ ), v.listContainer && t.watchChildList(v.listContainer);
2877
+ const [b, S] = yt(
2889
2878
  h,
2890
- g,
2891
- w.element,
2892
- w.useFirstChild,
2879
+ v,
2880
+ $.element,
2881
+ $.useFirstChild,
2893
2882
  t.element,
2894
2883
  t.useFirstChild,
2895
2884
  void 0,
2896
2885
  i
2897
2886
  );
2898
- if (!$ || !S)
2887
+ if (!b || !S)
2899
2888
  return !0;
2900
2889
  n.addedInteractions[l] = !0;
2901
- const I = P(
2902
- g.conditions || [],
2890
+ const I = M(
2891
+ v.conditions || [],
2903
2892
  n.dataCache.conditions
2904
2893
  );
2905
- return a.push([
2894
+ return c.push([
2906
2895
  e,
2907
2896
  h,
2908
- g,
2909
- $,
2897
+ v,
2898
+ b,
2910
2899
  S,
2911
2900
  I,
2912
2901
  t.useFirstChild,
2913
- y || void 0
2902
+ E || void 0
2914
2903
  ]), !0;
2915
2904
  }
2916
2905
  return !1;
2917
2906
  });
2918
- }), a.reverse().forEach((u) => {
2919
- gt(...u);
2920
- }), Xs(e, t, n, s, i);
2921
- const f = Object.keys(r?.sequences || {}).length > 0;
2922
- return c.length > 0 || f;
2907
+ }), c.reverse().forEach((u) => {
2908
+ Et(...u);
2909
+ }), Us(e, t, n, s, i);
2910
+ const f = Object.keys(o?.sequences || {}).length > 0;
2911
+ return a.length > 0 || f;
2923
2912
  }
2924
- function Ve(e, t, n, s, i, r, o, c, a) {
2913
+ function Ue(e, t, n, s, i, o, r, a, c) {
2925
2914
  let f;
2926
2915
  if (i.transition || i.transitionProperties) {
2927
2916
  const l = {
@@ -2929,83 +2918,83 @@ function Ve(e, t, n, s, i, r, o, c, a) {
2929
2918
  effectId: i.effectId,
2930
2919
  transition: i.transition,
2931
2920
  transitionProperties: i.transitionProperties,
2932
- childSelector: L(i, {
2921
+ childSelector: D(i, {
2933
2922
  asCombinator: !0,
2934
2923
  addItemFilter: !0,
2935
- useFirstChild: c
2924
+ useFirstChild: a
2936
2925
  }),
2937
- selectorCondition: o
2926
+ selectorCondition: r
2938
2927
  };
2939
- if (f = b.getController(e), !f)
2928
+ if (f = w.getController(e), !f)
2940
2929
  return;
2941
- f.renderStyle(Ks(l));
2930
+ f.renderStyle(Ys(l));
2942
2931
  }
2943
2932
  let u;
2944
2933
  if (n === "animationEnd") {
2945
- const l = r.effectId, v = (a ? b.getInstance(a) : void 0)?.dataCache.effects[l];
2946
- v && (u = M(v));
2934
+ const l = o.effectId, m = (c ? w.getInstance(c) : void 0)?.dataCache.effects[l];
2935
+ m && (u = P(m));
2947
2936
  }
2948
- N[n]?.add(t, s, i, r, {
2949
- reducedMotion: b.forceReducedMotion,
2937
+ j[n]?.add(t, s, i, o, {
2938
+ reducedMotion: w.forceReducedMotion,
2950
2939
  targetController: f,
2951
- selectorCondition: o,
2952
- allowA11yTriggers: b.allowA11yTriggers,
2940
+ selectorCondition: r,
2941
+ allowA11yTriggers: w.allowA11yTriggers,
2953
2942
  sourceAnimationOptions: u
2954
2943
  });
2955
2944
  }
2956
- function Zs(e) {
2957
- const t = e.key, n = b.getInstance(t);
2945
+ function Qs(e) {
2946
+ const t = e.key, n = w.getInstance(t);
2958
2947
  if (!n)
2959
- return console.warn(`No instance found for key: ${t}`), b.setController(t, e), !1;
2948
+ return console.warn(`No instance found for key: ${t}`), w.setController(t, e), !1;
2960
2949
  const { triggers: s = [] } = n?.get(t) || {}, i = s.length > 0;
2961
- n.setController(t, e), s.forEach((o, c) => {
2962
- const a = k(o.conditions, n.dataCache.conditions);
2963
- if (a) {
2964
- const f = `${t}::trigger::${c}`;
2965
- n.setupMediaQueryListener(f, a, t, () => {
2950
+ n.setController(t, e), s.forEach((r, a) => {
2951
+ const c = k(r.conditions, n.dataCache.conditions);
2952
+ if (c) {
2953
+ const f = `${t}::trigger::${a}`;
2954
+ n.setupMediaQueryListener(f, c, t, () => {
2966
2955
  e.update();
2967
2956
  });
2968
2957
  }
2969
- (!a || a.matches) && (me(e, e.element, o, t, "interaction"), o.listContainer && e.watchChildList(o.listContainer), vt(t, e, n, o));
2958
+ (!c || c.matches) && (ge(e, e.element, r, t, "interaction"), r.listContainer && e.watchChildList(r.listContainer), wt(t, e, n, r));
2970
2959
  });
2971
- let r = !1;
2972
- return n && (r = wt(t, e, n)), i || r;
2960
+ let o = !1;
2961
+ return n && (o = St(t, e, n)), i || o;
2973
2962
  }
2974
- function Js(e, t, n) {
2975
- const s = e.key, i = b.getInstance(s);
2963
+ function Xs(e, t, n) {
2964
+ const s = e.key, i = w.getInstance(s);
2976
2965
  if (i) {
2977
- const { triggers: r = [] } = i?.get(s) || {};
2978
- r.forEach((o, c) => {
2979
- if (o.listContainer !== t)
2966
+ const { triggers: o = [] } = i?.get(s) || {};
2967
+ o.forEach((r, a) => {
2968
+ if (r.listContainer !== t)
2980
2969
  return;
2981
- const a = k(o.conditions, i.dataCache.conditions);
2982
- if (a) {
2983
- const f = `${s}::listTrigger::${t}::${c}`;
2984
- i.setupMediaQueryListener(f, a, s, () => {
2970
+ const c = k(r.conditions, i.dataCache.conditions);
2971
+ if (c) {
2972
+ const f = `${s}::listTrigger::${t}::${a}`;
2973
+ i.setupMediaQueryListener(f, c, s, () => {
2985
2974
  e.update();
2986
2975
  });
2987
2976
  }
2988
- (!a || a.matches) && vt(s, e, i, o, n);
2989
- }), wt(s, e, i, t, n);
2977
+ (!c || c.matches) && wt(s, e, i, r, n);
2978
+ }), St(s, e, i, t, n);
2990
2979
  }
2991
2980
  }
2992
- function ei(e, t = !1) {
2993
- const n = e.key, s = b.getInstance(n);
2981
+ function Zs(e, t = !1) {
2982
+ const n = e.key, s = w.getInstance(n);
2994
2983
  if (!s)
2995
2984
  return;
2996
2985
  const i = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
2997
- let r;
2998
- i ? (r = [...e.element.querySelectorAll(i)], e.useFirstChild || r.push(e.element)) : r = [e.element], bt(r), s.deleteController(n, t);
2986
+ let o;
2987
+ i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element], It(o), s.deleteController(n, t);
2999
2988
  }
3000
- function bt(e) {
3001
- const t = Object.values(N);
2989
+ function It(e) {
2990
+ const t = Object.values(j);
3002
2991
  for (const n of e)
3003
2992
  for (const s of t)
3004
2993
  s.remove(n);
3005
- b.removeFromSequences(e);
2994
+ w.removeFromSequences(e);
3006
2995
  }
3007
- const ye = "interactEffect";
3008
- class ti {
2996
+ const we = "interactEffect";
2997
+ class Js {
3009
2998
  element;
3010
2999
  key;
3011
3000
  connected;
@@ -3027,10 +3016,10 @@ class ti {
3027
3016
  }
3028
3017
  n !== t && (n && console.warn(
3029
3018
  `Interact: Key mismatch between element ${n} and parameter ${t}, updating element key`
3030
- ), this.element.dataset.interactKey = t), this.key = t, this.connected = Zs(this);
3019
+ ), this.element.dataset.interactKey = t), this.key = t, this.connected = Qs(this);
3031
3020
  }
3032
3021
  disconnect({ removeFromCache: t = !1 } = {}) {
3033
- if ((this.key || this.element.dataset.interactKey) && ei(this, t), this._pluginCleanups.length) {
3022
+ if ((this.key || this.element.dataset.interactKey) && Zs(this, t), this._pluginCleanups.length) {
3034
3023
  for (const s of this._pluginCleanups)
3035
3024
  try {
3036
3025
  s();
@@ -3042,7 +3031,7 @@ class ti {
3042
3031
  if (this._appliedPlugins = /* @__PURE__ */ new WeakSet(), this.sheet) {
3043
3032
  const s = this.element?.getRootNode(), i = s.host ? s : document;
3044
3033
  i.adoptedStyleSheets.indexOf(this.sheet) !== -1 && (i.adoptedStyleSheets = i.adoptedStyleSheets.filter(
3045
- (o) => o !== this.sheet
3034
+ (r) => r !== this.sheet
3046
3035
  ));
3047
3036
  }
3048
3037
  this._observers = /* @__PURE__ */ new WeakMap(), this.sheet = null, this.connected = !1;
@@ -3057,11 +3046,11 @@ class ti {
3057
3046
  `)), s.adoptedStyleSheets = [...s.adoptedStyleSheets || [], this.sheet];
3058
3047
  else {
3059
3048
  let i = this.sheet.cssRules.length;
3060
- for (const r of t)
3049
+ for (const o of t)
3061
3050
  try {
3062
- this.sheet.insertRule(r, i), i++;
3063
- } catch (o) {
3064
- console.error(o);
3051
+ this.sheet.insertRule(o, i), i++;
3052
+ } catch (r) {
3053
+ console.error(r);
3065
3054
  }
3066
3055
  }
3067
3056
  }
@@ -3072,13 +3061,13 @@ class ti {
3072
3061
  this.element.toggleEffect(t, n, s);
3073
3062
  return;
3074
3063
  }
3075
- const r = new Set(
3076
- this.element.dataset[ye]?.split(" ") || []
3064
+ const o = new Set(
3065
+ this.element.dataset[we]?.split(" ") || []
3077
3066
  );
3078
- n === "toggle" ? r.has(t) ? r.delete(t) : r.add(t) : n === "add" ? r.add(t) : n === "remove" ? r.delete(t) : n === "clear" && r.clear(), (s || this.element).dataset[ye] = Array.from(r).join(" ");
3067
+ 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[we] = Array.from(o).join(" ");
3079
3068
  }
3080
3069
  getActiveEffects() {
3081
- const n = (this.element.dataset[ye] || "").trim();
3070
+ const n = (this.element.dataset[we] || "").trim();
3082
3071
  return n ? n.split(/\s+/) : [];
3083
3072
  }
3084
3073
  watchChildList(t) {
@@ -3089,24 +3078,24 @@ class ti {
3089
3078
  }
3090
3079
  }
3091
3080
  _childListChangeHandler(t, n) {
3092
- const s = this.key || this.element.dataset.interactKey, i = [], r = [];
3093
- n.forEach((o) => {
3094
- o.removedNodes.forEach((c) => {
3095
- c instanceof HTMLElement && i.push(c);
3096
- }), o.addedNodes.forEach((c) => {
3097
- c instanceof HTMLElement && r.push(c);
3081
+ const s = this.key || this.element.dataset.interactKey, i = [], o = [];
3082
+ n.forEach((r) => {
3083
+ r.removedNodes.forEach((a) => {
3084
+ a instanceof HTMLElement && i.push(a);
3085
+ }), r.addedNodes.forEach((a) => {
3086
+ a instanceof HTMLElement && o.push(a);
3098
3087
  });
3099
- }), bt(i), s && Js(this, t, r);
3088
+ }), It(i), s && Xs(this, t, o);
3100
3089
  }
3101
3090
  }
3102
- function yi(e, t) {
3103
- new ti(e, t).connect();
3091
+ function Ti(e, t) {
3092
+ new Js(e, t).connect();
3104
3093
  }
3105
- function Ei(e) {
3106
- const t = b.getController(e);
3094
+ function Ci(e) {
3095
+ const t = w.getController(e);
3107
3096
  t && t.disconnect({ removeFromCache: !0 });
3108
3097
  }
3109
- const $t = /* @__PURE__ */ new Map([
3098
+ const Tt = /* @__PURE__ */ new Map([
3110
3099
  ["viewEnter", "once"],
3111
3100
  ["animationEnd", "once"],
3112
3101
  ["hover", "alternate"],
@@ -3114,70 +3103,75 @@ const $t = /* @__PURE__ */ new Map([
3114
3103
  ["activate", "alternate"],
3115
3104
  ["interest", "alternate"]
3116
3105
  ]);
3117
- function St(e, t, n, s) {
3118
- const { effects: i = {}, conditions: r = {} } = n, { key: o, trigger: c } = t, a = c === "pointerMove";
3119
- e.effectId || (e.effectId = s || B());
3106
+ function Ct(e, t, n, s) {
3107
+ const { effects: i = {}, conditions: o = {} } = n, { key: r, trigger: a } = t, c = a === "pointerMove";
3108
+ e.effectId || (e.effectId = s || U());
3120
3109
  const { effectId: f } = e, u = { ...i[f] || {}, ...e };
3121
- let { key: l, conditions: d, triggerType: v } = u;
3110
+ let { key: l, conditions: d, triggerType: m } = u;
3122
3111
  if (!l) {
3123
- if (!o)
3112
+ if (!r)
3124
3113
  return null;
3125
- l = o;
3114
+ l = r;
3126
3115
  }
3127
- if (Vs(l))
3116
+ if (Ws(l))
3128
3117
  return null;
3129
3118
  d = [
3130
- ...new Set((d || []).filter(($) => r[$]))
3131
- ], v || (v = $t.get(c));
3132
- const { namedEffect: h, customEffect: m, keyframeEffect: p, transition: g, transitionProperties: E, ...y } = {
3119
+ ...new Set((d || []).filter((b) => o[b]))
3120
+ ], m || (m = Tt.get(a));
3121
+ const { namedEffect: h, customEffect: p, keyframeEffect: g, transition: v, transitionProperties: y, ...E } = {
3133
3122
  ...u,
3134
3123
  key: l,
3135
3124
  conditions: d,
3136
3125
  effectId: f,
3137
- triggerType: v
3138
- }, w = kt(t, y);
3126
+ triggerType: m
3127
+ }, $ = qt(t, E);
3139
3128
  if (h)
3140
- return a || !h.type ? null : { namedEffect: h, initial: w, ...y };
3141
- if (p) {
3142
- if (!p.name) {
3143
- const $ = f && !(i[f] && "keyframeEffect" in e);
3144
- p.name = $ ? f : B();
3129
+ return c || !h.type ? null : { namedEffect: h, initial: $, ...E };
3130
+ if (g) {
3131
+ if (!g.name) {
3132
+ const b = f && !(i[f] && "keyframeEffect" in e);
3133
+ g.name = b ? f : U();
3145
3134
  }
3146
- return { keyframeEffect: p, initial: w, ...y };
3147
- } else return m ? a ? null : { initial: w, ...y } : g ? { transition: g, initial: w, ...y } : E ? { transitionProperties: E, initial: w, ...y } : { initial: w, ...y };
3135
+ return { keyframeEffect: g, initial: $, ...E };
3136
+ } else return p ? c ? null : { initial: $, ...E } : v ? { transition: v, initial: $, ...E } : y ? { transitionProperties: y, initial: $, ...E } : { initial: $, ...E };
3148
3137
  }
3149
- function ni(e, t, n, s) {
3150
- const { sequences: i = {}, conditions: r = {} } = n;
3151
- e.sequenceId || (e.sequenceId = s || B());
3152
- const { sequenceId: o } = e, c = { ...i[o] || {}, ...e };
3138
+ function ei(e, t, n, s) {
3139
+ const { sequences: i = {}, conditions: o = {} } = n;
3140
+ e.sequenceId || (e.sequenceId = s || U());
3141
+ const { sequenceId: r } = e, a = { ...i[r] || {}, ...e };
3153
3142
  let {
3154
- effects: a,
3143
+ effects: c,
3155
3144
  conditions: f,
3156
3145
  triggerType: u,
3157
3146
  delay: l = 0,
3158
3147
  offset: d = 0,
3159
- offsetEasing: v = "linear"
3160
- } = c;
3161
- if (typeof v == "function")
3148
+ offsetEasing: m = "linear"
3149
+ } = a;
3150
+ if (typeof m == "function")
3162
3151
  return null;
3163
- u || (u = $t.get(t.trigger)), f = [
3164
- ...new Set((f || []).filter((p) => r[p]))
3152
+ u || (u = Tt.get(t.trigger)), f = [
3153
+ ...new Set((f || []).filter((g) => o[g]))
3165
3154
  ];
3166
- const m = a.map((p) => (p.conditions ? p.conditions.push(...f) : p.conditions = [...f], St({ ...p, triggerType: u }, t, n))).filter((p) => p !== null);
3167
- return m.length ? {
3168
- sequenceId: o,
3155
+ const p = c.map((g, v) => (g.conditions ? g.conditions.push(...f) : g.conditions = [...f], Ct(
3156
+ { ...g, triggerType: u },
3157
+ t,
3158
+ n,
3159
+ `${r}-eff-${v}`
3160
+ ))).filter((g) => g !== null);
3161
+ return p.length ? {
3162
+ sequenceId: r,
3169
3163
  triggerType: u,
3170
3164
  conditions: f,
3171
3165
  delay: l,
3172
3166
  offset: d,
3173
- offsetEasing: v,
3174
- effects: m
3167
+ offsetEasing: m,
3168
+ effects: p
3175
3169
  } : null;
3176
3170
  }
3177
- function si(e) {
3178
- return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : ue(e);
3171
+ function ti(e) {
3172
+ return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : fe(e);
3179
3173
  }
3180
- function ii(e) {
3174
+ function ni(e) {
3181
3175
  if (!e.length)
3182
3176
  return [];
3183
3177
  const t = e.map((i) => ({ ...i }));
@@ -3185,132 +3179,221 @@ function ii(e) {
3185
3179
  let n = 0, s = t[0].offset;
3186
3180
  for (let i = 1; i < t.length; i++)
3187
3181
  if (t[i].offset !== void 0) {
3188
- const r = t[i].offset;
3189
- if (r < s)
3182
+ const o = t[i].offset;
3183
+ if (o < s)
3190
3184
  return console.error("Offsets must be monotonically non-decreasing"), [];
3191
- if (r > 1)
3185
+ if (o > 1)
3192
3186
  return console.error("Offsets must be in the range [0,1]"), [];
3193
- const o = i - n;
3194
- for (let c = n + 1; c < i; c++) {
3195
- const a = (c - n) / o;
3196
- t[c].offset = s + (r - s) * a;
3187
+ const r = i - n;
3188
+ for (let a = n + 1; a < i; a++) {
3189
+ const c = (a - n) / r;
3190
+ t[a].offset = s + (o - s) * c;
3197
3191
  }
3198
- n = i, s = r;
3192
+ n = i, s = o;
3199
3193
  }
3200
3194
  return t;
3201
3195
  }
3202
- function ri(e, t) {
3203
- const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${si(s)}: ${i};`).join(`
3204
- `);
3196
+ function si(e, t) {
3197
+ const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${ti(s)}: ${i};`).join(`
3198
+ `);
3205
3199
  return `${t}% {
3206
- ${n}
3207
- }`;
3200
+ ${n}
3201
+ }`;
3208
3202
  }
3209
- function oi(e, t) {
3210
- const n = ii(t);
3203
+ function ii(e, t) {
3204
+ const n = ni(t);
3211
3205
  if (!n.length)
3212
3206
  return "";
3213
3207
  let s = n.map((i) => {
3214
- const r = i.offset, o = Ws(r * 100);
3215
- return ri(i, o);
3208
+ const o = i.offset, r = Gs(o * 100);
3209
+ return si(i, r);
3216
3210
  }).join(`
3217
- `);
3211
+ `);
3218
3212
  return `@keyframes ${e} {
3219
- ${s}
3213
+ ${s}
3220
3214
  }`;
3221
3215
  }
3222
- function ci(e) {
3223
- const { key: t, childSelector: n, declarations: s, media: i, states: r, selectorCondition: o, selectorSuffix: c } = e;
3216
+ function oi(e) {
3217
+ const { key: t, childSelector: n, declarations: s, media: i, states: o, selectorCondition: r, selectorSuffix: a } = e;
3224
3218
  if (!s.length)
3225
3219
  return "";
3226
- let a = `[data-interact-key="${t}"]`;
3227
- if (r && r.length) {
3228
- const l = r.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
3229
- a = `${a}:is(${l})`;
3230
- }
3231
- n && (a = `${a} ${n}`), c && (a = `${a}${c}`), o && (a = oe(a, o));
3232
- const f = s.map(({ name: l, value: d, important: v }) => `${l}: ${d}${v ? " !important" : ""};`).join(`
3233
- `), u = `${a} {
3234
- ${f}
3220
+ let c = `[data-interact-key="${t}"]`;
3221
+ if (o && o.length) {
3222
+ const l = o.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
3223
+ c = `${c}:is(${l})`;
3224
+ }
3225
+ n && (c = `${c} ${n}`), a && (c = `${c}${a}`), r && (c = ce(c, r));
3226
+ const f = s.map(({ name: l, value: d, important: m }) => `${l}: ${d}${m ? " !important" : ""};`).join(`
3227
+ `), u = `${c} {
3228
+ ${f}
3235
3229
  }`;
3236
3230
  return i ? `@media ${i} {
3237
3231
  ${u}
3238
3232
  }` : u;
3239
3233
  }
3240
- function It(e, t, n, s) {
3241
- const { key: i, childSelector: r, properties: o } = e, c = Object.entries(o).filter(
3242
- (f) => f[1] && f[1].varNames.length
3243
- ).map(([f, { fallback: u, varNames: l }]) => ({
3244
- name: f,
3245
- value: l.map((d) => `var(${d}, ${u})`).join(", ")
3246
- })), a = { key: i, childSelector: r, declarations: c };
3247
- return t && a.declarations.forEach((f) => {
3248
- f.name = t[f.name];
3249
- }), n && (a.media = X(n, s || {}, "media"), a.selectorCondition = P(n, s || {})), a;
3250
- }
3251
- const ai = [
3252
- { name: "visibility", value: "hidden" },
3253
- { name: "transform", value: "none", important: !0 },
3254
- { name: "translate", value: "none", important: !0 },
3255
- { name: "scale", value: "none", important: !0 },
3256
- { name: "rotate", value: "none", important: !0 }
3257
- ], ce = [
3234
+ const pe = [
3258
3235
  "animation",
3259
3236
  "animation-composition",
3260
3237
  "animation-timeline",
3261
3238
  "animation-range"
3262
- ], Ce = ["transition", ...ce], ui = {
3263
- animation: "animation",
3264
- "animation-composition": "composition",
3265
- "animation-timeline": "animationTimeline",
3266
- "animation-range": "animationRange"
3267
- }, ae = {
3239
+ ], ke = [
3240
+ ...pe,
3241
+ "transition"
3242
+ ], Me = ["animation", "transition"];
3243
+ function Ae(e) {
3244
+ return e === "transition" ? "transition" : "animation";
3245
+ }
3246
+ const z = {
3247
+ transition: "_",
3268
3248
  animation: "none",
3269
3249
  "animation-composition": "replace",
3270
- transition: "_",
3271
3250
  "animation-timeline": "auto",
3272
3251
  "animation-range": "normal"
3273
3252
  };
3274
- function Tt(e, t, n) {
3275
- const s = e.get(t);
3276
- s ? n.forEach((i) => s.add(i)) : e.set(t, new Set(n));
3277
- }
3278
- function Ot(e, t, n, s) {
3279
- const { key: i, childSelector: r } = n, o = s ? Ce.filter((a) => s.has(a)) : Ce;
3280
- e.has(t) || e.set(t, { key: i, childSelector: r, properties: {} });
3281
- const { properties: c } = e.get(t);
3282
- for (const a of o)
3283
- c[a] || (c[a] = { fallback: ae[a], varNames: [] }), c[a].varNames.push(n[a]);
3284
- }
3285
- function Ct(e, t) {
3286
- return Ce.reduce(
3287
- (n, s) => (n[s] = Ys([s, ...e, t]), n),
3288
- {}
3253
+ function F(e, t, n = !1) {
3254
+ return `--${e.replace(new RegExp("(?<!(^|-))([aeiou]|tion)", "g"), "")}${n ? "-slot" : ""}-${t}`;
3255
+ }
3256
+ function ri(e, t, n, s) {
3257
+ return ke.flatMap((i) => [
3258
+ ...Array.from(
3259
+ { length: i === "transition" ? t : e },
3260
+ (o, r) => `@property ${F(i, r)} { syntax: "*"; inherits: false; initial-value: ${z[i]}; }`
3261
+ ),
3262
+ ...Array.from(
3263
+ { length: i === "transition" ? s : n },
3264
+ (o, r) => `@property ${F(i, r, !0)} { syntax: "*"; inherits: false; initial-value: ${z[i]}; }`
3265
+ )
3266
+ ]);
3267
+ }
3268
+ function ai(e, t, n) {
3269
+ const s = ke.filter(
3270
+ (r) => e[Ae(r)].slotsInSequence > 0
3289
3271
  );
3272
+ if (s.length === 0)
3273
+ return null;
3274
+ const i = s.map((r) => {
3275
+ const { listIndex: a, slotCursor: c, slotsInSequence: f } = e[Ae(r)];
3276
+ return {
3277
+ name: F(r, a),
3278
+ value: Array.from(
3279
+ { length: f },
3280
+ (u, l) => `var(${F(r, c + l, !0)})`
3281
+ ).join(", ")
3282
+ };
3283
+ }), o = { key: e.key, childSelector: e.childSelector, declarations: i };
3284
+ return t && (o.media = J(t, n || {}, "media"), o.selectorCondition = M(t, n || {})), o;
3290
3285
  }
3291
- function fi(e, t, n, s, i) {
3292
- return s.has(e) || s.set(e, {
3293
- key: t,
3294
- childSelector: i,
3295
- ...Ct([n], Ye(e))
3296
- }), s.get(e);
3286
+ function ci(e, t, n) {
3287
+ if (e.length === 0)
3288
+ return "";
3289
+ const s = [
3290
+ ...t <= 0 ? [] : pe,
3291
+ ...n <= 0 ? [] : ["transition"]
3292
+ ];
3293
+ if (s.length === 0)
3294
+ return "";
3295
+ const i = s.map((r) => ({
3296
+ name: r,
3297
+ value: Array.from(
3298
+ { length: r === "transition" ? n : t },
3299
+ // TODO: maybe add `-intrct` to names? --anm-0 or --trns-0 could collide with user-defined names
3300
+ (a, c) => `var(${F(r, c)})`
3301
+ ).join(", ")
3302
+ }));
3303
+ return `${e.map(
3304
+ ({ key: r, childSelector: a }) => `[data-interact-key="${r}"]${a ? ` ${a}` : ""}`
3305
+ ).join(", ")} {
3306
+ ${i.map(({ name: r, value: a }) => ` ${r}: ${a};`).join(`
3307
+ `)}
3308
+ }`;
3297
3309
  }
3298
- function li(e, t, n) {
3299
- return Ct([t, n], Ye(e));
3310
+ const ui = [
3311
+ { name: "visibility", value: "hidden" },
3312
+ { name: "transform", value: "none", important: !0 },
3313
+ { name: "translate", value: "none", important: !0 },
3314
+ { name: "scale", value: "none", important: !0 },
3315
+ { name: "rotate", value: "none", important: !0 }
3316
+ ], fi = { animation: !1, transition: !1 };
3317
+ function li(e, t) {
3318
+ const n = () => ({
3319
+ listIndex: 0,
3320
+ slotCursor: 0,
3321
+ slotsInInteraction: 0,
3322
+ slotsInSequence: 0,
3323
+ touched: !1
3324
+ });
3325
+ return {
3326
+ key: e,
3327
+ childSelector: t,
3328
+ assigned: /* @__PURE__ */ new Set(),
3329
+ animation: n(),
3330
+ transition: n()
3331
+ };
3300
3332
  }
3301
- function di(e, t, n, s = !0) {
3302
- const { key: i, conditions: r } = e, o = X(r, t, "media"), c = P(r, t), a = L(e, {
3333
+ function di(e, t) {
3334
+ return Object.fromEntries(
3335
+ ke.map((n) => {
3336
+ const s = Ae(n), { listIndex: i, slotCursor: o, slotsInSequence: r } = e[s];
3337
+ return [
3338
+ n,
3339
+ t[s] ? F(n, o + r, !0) : F(n, i)
3340
+ ];
3341
+ })
3342
+ );
3343
+ }
3344
+ function hi(e, t, n) {
3345
+ Me.forEach((s) => {
3346
+ t[s] && (e[s].touched = !0, n[s] && (e[s].slotsInSequence += 1));
3347
+ });
3348
+ }
3349
+ function mi(e) {
3350
+ const { namedEffect: t, keyframeEffect: n, transition: s, transitionProperties: i } = e;
3351
+ return t || n ? "animation" : s || i ? "transition" : null;
3352
+ }
3353
+ function pi(e) {
3354
+ const t = /* @__PURE__ */ new Map();
3355
+ return e.effects.forEach((n) => {
3356
+ const s = mi(n);
3357
+ if (!s)
3358
+ return;
3359
+ const i = ue(n), o = t.get(i) || { animation: 0, transition: 0 };
3360
+ o[s] += 1, t.set(i, o);
3361
+ }), new Map(
3362
+ [...t].map(([n, { animation: s, transition: i }]) => [
3363
+ n,
3364
+ { animation: s > 1, transition: i > 1 }
3365
+ ])
3366
+ );
3367
+ }
3368
+ function gi(e) {
3369
+ Me.forEach((t) => {
3370
+ const n = e[t];
3371
+ n.slotsInInteraction = Math.max(n.slotsInInteraction, n.slotsInSequence), n.slotsInSequence = 0;
3372
+ });
3373
+ }
3374
+ function vi(e) {
3375
+ Me.forEach((t) => {
3376
+ const n = e[t];
3377
+ n.listIndex += n.touched ? 1 : 0, n.slotCursor += n.slotsInInteraction, n.slotsInInteraction = 0, n.touched = !1;
3378
+ });
3379
+ }
3380
+ const yi = {
3381
+ animation: "animation",
3382
+ "animation-composition": "composition",
3383
+ "animation-timeline": "animationTimeline",
3384
+ "animation-range": "animationRange"
3385
+ };
3386
+ function Ei(e, t, n) {
3387
+ const { key: s, conditions: i } = t, o = J(i, e.configConditions, "media"), r = M(i, e.configConditions), a = D(t, {
3303
3388
  asCombinator: !0,
3304
- useFirstChild: s,
3389
+ useFirstChild: e.useFirstChild,
3305
3390
  addItemFilter: !0
3306
3391
  });
3307
3392
  return {
3308
- key: i,
3393
+ key: s,
3309
3394
  media: o,
3310
- selectorCondition: c,
3395
+ selectorCondition: r,
3311
3396
  childSelector: a,
3312
- // invalidating earlier cascaded custom properties affected from earlier transitionEffects
3313
- // to implement same-interaction-cascade
3314
3397
  declarations: [
3315
3398
  {
3316
3399
  name: "view-timeline",
@@ -3319,247 +3402,203 @@ function di(e, t, n, s = !0) {
3319
3402
  ]
3320
3403
  };
3321
3404
  }
3322
- function At(e, t, n, s, i) {
3323
- const r = [];
3324
- for (const o of Object.keys(i)) {
3325
- const c = `${dt}${o}`;
3326
- c in t && r.push(
3327
- ...i[o](t[c], {
3405
+ function Ot(e, t, n, s, i) {
3406
+ const o = [];
3407
+ for (const r of Object.keys(i)) {
3408
+ const a = `${pt}${r}`;
3409
+ a in t && o.push(
3410
+ ...i[r](t[a], {
3328
3411
  key: n,
3329
3412
  scope: e,
3330
3413
  config: t
3331
- }).map((a) => ({ ...a, key: n, media: s }))
3414
+ }).map((c) => ({ ...c, key: n, media: s }))
3332
3415
  );
3333
3416
  }
3334
- return r;
3335
- }
3336
- function hi(e, t, n, s, i, r, o) {
3337
- const {
3338
- key: c,
3339
- effectId: a,
3340
- conditions: f,
3341
- namedEffect: u,
3342
- keyframeEffect: l,
3343
- transition: d,
3344
- transitionProperties: v,
3345
- initial: h
3346
- } = e, m = X(f, t, "media"), p = P(f, t), g = [
3417
+ return o;
3418
+ }
3419
+ function wi(e, t, n, s, i, o) {
3420
+ const { assigned: r, childSelector: a } = n, c = { animation: !1, transition: !1 }, {
3421
+ key: f,
3422
+ effectId: u,
3423
+ conditions: l,
3424
+ namedEffect: d,
3425
+ keyframeEffect: m,
3426
+ transition: h,
3427
+ transitionProperties: p,
3428
+ initial: g
3429
+ } = t, v = J(l, e.configConditions, "media"), y = M(l, e.configConditions), E = [
3347
3430
  {
3348
- key: c,
3349
- media: m,
3350
- selectorCondition: p,
3351
- childSelector: i,
3431
+ key: f,
3432
+ media: v,
3433
+ selectorCondition: y,
3434
+ childSelector: a,
3352
3435
  declarations: []
3353
3436
  }
3354
3437
  ];
3355
- let E = [];
3356
- const { declarations: y } = g[0];
3357
- let w = [];
3358
- if (r && g.push(...At("effect", e, c, m, r)), u || l) {
3359
- w = [...ce];
3360
- const $ = M(e), S = Cn(null, $, s, o).filter(
3438
+ let $ = [];
3439
+ const { declarations: b } = E[0];
3440
+ if (e.plugins && E.push(...Ot("effect", t, f, v, e.plugins)), d || m) {
3441
+ const S = P(t), I = Cn(null, S, s, o).filter(
3361
3442
  (T) => T.name
3362
3443
  );
3363
- E = S.map((T) => ({
3444
+ $ = I.map((T) => ({
3364
3445
  name: T.name,
3365
3446
  keyframes: T.keyframes
3366
- })), y.push(
3367
- ...S.flatMap(
3368
- ({ custom: T }) => Object.entries(T || {}).filter(([C, A]) => A !== void 0).map(([C, A]) => ({ name: C, value: A }))
3447
+ })), b.push(
3448
+ ...I.flatMap(
3449
+ ({ custom: T }) => Object.entries(T || {}).filter(([_, x]) => x !== void 0).map(([_, x]) => ({ name: _, value: x }))
3369
3450
  )
3370
3451
  );
3371
- const I = ce.map((T) => ({
3372
- name: n[T],
3373
- value: S.map((C) => {
3374
- const A = ui[T];
3375
- return C[A];
3376
- }).join(", ") || ae[T]
3377
- }));
3378
- h ? (g.push({
3379
- key: c,
3380
- media: m,
3381
- selectorCondition: p,
3382
- childSelector: i,
3383
- declarations: ai,
3452
+ const O = pe.map((T) => ({
3453
+ _listPropertyName: T,
3454
+ name: i[T],
3455
+ value: I.map((_) => {
3456
+ const x = yi[T];
3457
+ return _[x] || z[T];
3458
+ }).join(", ")
3459
+ })).filter(
3460
+ ({ _listPropertyName: T, name: _, value: x }) => x !== z[T] || r.has(_)
3461
+ );
3462
+ O.forEach(({ name: T }) => r.add(T)), c.animation = O.length > 0, g ? (E.push({
3463
+ key: f,
3464
+ media: v,
3465
+ selectorCondition: y,
3466
+ childSelector: a,
3467
+ declarations: ui,
3384
3468
  selectorSuffix: ":not([data-interact-enter])"
3385
- }), g.push({
3386
- key: c,
3387
- media: m,
3388
- selectorCondition: p,
3389
- childSelector: i,
3390
- declarations: I,
3469
+ }), E.push({
3470
+ key: f,
3471
+ media: v,
3472
+ selectorCondition: y,
3473
+ childSelector: a,
3474
+ declarations: O,
3391
3475
  selectorSuffix: ':not([data-interact-enter="done"])'
3392
- })) : y.push(...I);
3393
- } else if (d || v) {
3394
- w = ["transition"];
3395
- const $ = ht(e), S = mt(e);
3396
- y.push({
3397
- name: n.transition,
3398
- value: S.join(", ") || ae.transition
3399
- }), g.push({
3400
- key: c,
3401
- media: m,
3402
- selectorCondition: p,
3403
- childSelector: i,
3404
- states: [a],
3405
- declarations: $
3476
+ })) : b.push(...O);
3477
+ } else if (h || p) {
3478
+ const S = gt(t), I = vt(t);
3479
+ (I.length || r.has(i.transition)) && (b.push({
3480
+ name: i.transition,
3481
+ value: I.join(", ") || z.transition
3482
+ }), r.add(i.transition), c.transition = !0), E.push({
3483
+ key: f,
3484
+ media: v,
3485
+ selectorCondition: y,
3486
+ childSelector: a,
3487
+ states: [u],
3488
+ declarations: S
3406
3489
  });
3407
3490
  } else
3408
- y.push(
3409
- ...ce.map(($) => ({
3410
- name: n[$],
3411
- value: ae[$]
3491
+ b.push(
3492
+ ...pe.filter(
3493
+ (S) => r.has(i[S])
3494
+ ).map((S) => ({
3495
+ name: i[S],
3496
+ value: z[S]
3412
3497
  }))
3413
3498
  );
3414
- return { rules: g.filter(($) => $.declarations.length), keyframes: E, usedProperties: w };
3499
+ return { rules: E.filter((S) => S.declarations.length), keyframes: $, wrote: c };
3415
3500
  }
3416
- function qt(e, t, n, s, i, r, o = !0, c, a, f, u) {
3417
- const { key: l } = n, d = f ?? V(n), v = L(n, {
3418
- asCombinator: !0,
3419
- useFirstChild: o,
3420
- addItemFilter: !0
3421
- }), m = { ...fi(
3422
- d,
3423
- l,
3501
+ function _t(e, t, n, s, i, o) {
3502
+ const r = ue(t), a = e.targetsMap.get(r) || li(
3503
+ t.key,
3504
+ D(t, {
3505
+ asCombinator: !0,
3506
+ useFirstChild: e.useFirstChild,
3507
+ addItemFilter: !0
3508
+ })
3509
+ );
3510
+ s.add(r);
3511
+ const c = o?.get(r) || fi, f = di(a, c), { rules: u, keyframes: l, wrote: d } = wi(
3512
+ e,
3424
3513
  t,
3425
- s,
3426
- v
3427
- ) };
3428
- a && Object.assign(m, a);
3429
- const { rules: p, keyframes: g, usedProperties: E } = hi(
3514
+ a,
3430
3515
  n,
3431
- e,
3432
- m,
3433
- r,
3434
- v,
3435
- c,
3436
- u
3516
+ f,
3517
+ i
3437
3518
  );
3438
- return g.forEach(({ name: y, keyframes: w }) => i.set(y, w)), { rules: p, usedProperties: E };
3519
+ return l.forEach(({ name: m, keyframes: h }) => e.keyframesMap.set(m, h)), hi(a, d, c), e.targetsMap.set(r, a), u;
3439
3520
  }
3440
- function mi(e, t, n, s, i, r, o = !0, c, a) {
3441
- const f = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), l = [];
3442
- for (const v of n.effects) {
3443
- const h = V(v), { key: m } = v, p = L(v, {
3444
- asCombinator: !0,
3445
- useFirstChild: o,
3446
- addItemFilter: !0
3447
- }), g = u.get(h) || 0;
3448
- u.set(h, g + 1);
3449
- const E = li(h, t, g), { rules: y, usedProperties: w } = qt(
3450
- e,
3451
- t,
3452
- v,
3453
- s,
3454
- i,
3455
- r,
3456
- o,
3457
- a,
3458
- E,
3459
- h,
3460
- n
3461
- );
3462
- l.push(...y);
3463
- const $ = new Set(w);
3464
- Ot(
3465
- f,
3466
- h,
3467
- { key: m, childSelector: p, ...E },
3468
- $
3469
- ), c && Tt(c, h, w);
3470
- }
3471
- const { conditions: d } = n;
3472
- return f.forEach((v, h) => {
3473
- const m = s.get(h);
3474
- l.push(It(v, m, d, e));
3475
- }), l;
3476
- }
3477
- function pi(e, t, n, s, i, r = !0, o) {
3478
- const { key: c, conditions: a, effects: f = [], sequences: u = [] } = t, l = e.conditions || {}, d = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), h = f.map(
3479
- (y, w) => St(y, t, e, `eff-${n}-${w}`)
3480
- ).filter((y) => y !== null), m = o ? At(
3521
+ function $i(e, t, n, s) {
3522
+ const i = [], o = /* @__PURE__ */ new Set(), r = pi(t);
3523
+ i.push(
3524
+ ...t.effects.flatMap(
3525
+ (c) => _t(e, c, n, o, t, r)
3526
+ )
3527
+ );
3528
+ const { conditions: a } = t;
3529
+ return o.forEach((c) => {
3530
+ s.add(c);
3531
+ const f = e.targetsMap.get(c), u = ai(f, a, e.configConditions);
3532
+ u && (u.declarations.forEach(({ name: l }) => f.assigned.add(l)), i.push(u)), gi(f);
3533
+ }), i;
3534
+ }
3535
+ function bi(e, t, n) {
3536
+ const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, a = e.plugins ? Ot(
3481
3537
  "interaction",
3482
3538
  t,
3483
- c,
3484
- X(a, l, "media"),
3485
- o
3486
- ) : [], { trigger: p } = t, g = {
3487
- trigger: Bs(p),
3539
+ s,
3540
+ J(i, e.configConditions, "media"),
3541
+ e.plugins
3542
+ ) : [], { trigger: c } = t, f = {
3543
+ trigger: Vs(c),
3488
3544
  id: ["trigger", n].join("-")
3489
3545
  };
3490
- p === "viewProgress" && m.push(di(t, l, g.id, r));
3491
- for (const y of h) {
3492
- const w = V(y), { rules: $, usedProperties: S } = qt(
3493
- l,
3494
- n,
3495
- y,
3496
- d,
3497
- i,
3498
- g,
3499
- r,
3500
- o
3501
- );
3502
- m.push(...$), Tt(v, w, S);
3503
- }
3504
- const E = u.map(
3505
- (y, w) => ni(y, t, e, `seq-${n}-${w}`)
3506
- ).filter((y) => y !== null);
3507
- return m.push(
3508
- ...E.flatMap(
3509
- (y) => mi(
3510
- l,
3511
- n,
3512
- y,
3513
- d,
3514
- i,
3515
- g,
3516
- r,
3517
- v,
3518
- o
3519
- )
3546
+ c === "viewProgress" && a.push(Ei(e, t, f.id));
3547
+ const u = /* @__PURE__ */ new Set(), l = o.map(
3548
+ (m, h) => Ct(m, t, e.config, `eff-${n}-${h}`)
3549
+ ).filter((m) => m !== null);
3550
+ a.push(
3551
+ ...l.flatMap((m) => _t(e, m, f, u))
3552
+ );
3553
+ const d = r.map(
3554
+ (m, h) => ei(m, t, e.config, `seq-${n}-${h}`)
3555
+ ).filter((m) => m !== null);
3556
+ return a.push(
3557
+ ...d.flatMap(
3558
+ (m) => $i(e, m, f, u)
3520
3559
  )
3521
- ), d.forEach((y, w) => {
3522
- Ot(
3523
- s,
3524
- w,
3525
- y,
3526
- v.get(w)
3527
- );
3528
- }), m;
3560
+ ), u.forEach((m) => vi(e.targetsMap.get(m))), a;
3529
3561
  }
3530
- function gi(e = {}) {
3562
+ function Si(e = {}) {
3531
3563
  const { useFirstChild: t = !0, plugins: n } = typeof e == "boolean" ? { useFirstChild: e, plugins: void 0 } : e;
3532
3564
  return { useFirstChild: t, plugins: n };
3533
3565
  }
3534
- function vi(e, t) {
3535
- const { useFirstChild: n, plugins: s } = gi(t), i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = e.interactions.flatMap(
3536
- (c, a) => pi(
3537
- e,
3538
- c,
3539
- a,
3540
- i,
3541
- r,
3542
- n,
3543
- s
3544
- )
3566
+ function Ii(e, t) {
3567
+ const { useFirstChild: n, plugins: s } = Si(t), i = {
3568
+ config: e,
3569
+ configConditions: e.conditions || {},
3570
+ targetsMap: /* @__PURE__ */ new Map(),
3571
+ keyframesMap: /* @__PURE__ */ new Map(),
3572
+ useFirstChild: n,
3573
+ plugins: s
3574
+ }, o = e.interactions.flatMap(
3575
+ (m, h) => bi(i, m, h)
3576
+ ), r = [...i.targetsMap.values()], a = Math.max(0, ...r.map(({ animation: m }) => m.listIndex)), c = Math.max(0, ...r.map(({ transition: m }) => m.listIndex)), f = ci(r, a, c), u = Math.max(0, ...r.map(({ animation: m }) => m.slotCursor)), l = Math.max(
3577
+ 0,
3578
+ ...r.map(({ transition: m }) => m.slotCursor)
3579
+ ), d = ri(
3580
+ a,
3581
+ c,
3582
+ u,
3583
+ l
3545
3584
  );
3546
- return i.forEach((c) => {
3547
- o.push(It(c));
3548
- }), { keyframes: r, cssRules: o };
3585
+ return { keyframes: i.keyframesMap, atProperty: d, cssRules: o, listsRule: f };
3549
3586
  }
3550
- function wi(e, t) {
3551
- const { cssRules: n, keyframes: s } = vi(e, t);
3587
+ function Oi(e, t) {
3588
+ const { cssRules: n, keyframes: s, atProperty: i, listsRule: o } = Ii(e, t);
3552
3589
  return [
3553
- ...[...s.entries()].map(([r, o]) => oi(r, o)),
3554
- ...n.map(ci)
3555
- ].join(`
3590
+ ...i,
3591
+ ...[...s.entries()].map(([a, c]) => ii(a, c)),
3592
+ ...n.map(oi),
3593
+ o
3594
+ ].filter((a) => a).join(`
3556
3595
  `);
3557
3596
  }
3558
3597
  export {
3559
- ti as I,
3560
- b as a,
3561
- yi as b,
3562
- wi as g,
3563
- Ei as r
3598
+ Js as I,
3599
+ w as a,
3600
+ Ti as b,
3601
+ Oi as g,
3602
+ Ci as r
3564
3603
  };
3565
- //# sourceMappingURL=index-Cy5DK4f-.mjs.map
3604
+ //# sourceMappingURL=index-CuQphuiv.mjs.map