@wix/interact 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +325 -246
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/react.js +1 -1
  4. package/dist/cjs/web.js +1 -1
  5. package/dist/es/index.js +1 -1
  6. package/dist/es/react.js +2 -2
  7. package/dist/es/web.js +2 -2
  8. package/dist/{index-CBaynReP.mjs → index-C79XXItl.mjs} +529 -487
  9. package/dist/index-C79XXItl.mjs.map +1 -0
  10. package/dist/index-CVJ6Iq9s.js +21 -0
  11. package/dist/index-CVJ6Iq9s.js.map +1 -0
  12. package/dist/tsconfig.build.tsbuildinfo +1 -1
  13. package/dist/types/core/add.d.ts.map +1 -1
  14. package/dist/types/core/css.d.ts.map +1 -1
  15. package/dist/types/core/cssUtils.d.ts.map +1 -1
  16. package/dist/types/core/resolvers.d.ts.map +1 -1
  17. package/dist/types/handlers/animationEnd.d.ts +1 -1
  18. package/dist/types/handlers/animationEnd.d.ts.map +1 -1
  19. package/dist/types/handlers/index.d.ts.map +1 -1
  20. package/dist/types/types/config.d.ts +1 -1
  21. package/dist/types/types/config.d.ts.map +1 -1
  22. package/dist/types/types/css.d.ts +1 -1
  23. package/dist/types/types/css.d.ts.map +1 -1
  24. package/dist/types/types/external.d.ts +1 -1
  25. package/dist/types/types/external.d.ts.map +1 -1
  26. package/dist/types/types/handlers.d.ts +2 -2
  27. package/dist/types/types/handlers.d.ts.map +1 -1
  28. package/dist/types/types/triggers.d.ts +1 -1
  29. package/dist/types/types/triggers.d.ts.map +1 -1
  30. package/docs/README.md +1 -0
  31. package/docs/api/README.md +7 -0
  32. package/docs/api/functions.md +2 -2
  33. package/docs/api/types.md +2 -3
  34. package/docs/guides/README.md +1 -1
  35. package/docs/guides/configuration-structure.md +1 -1
  36. package/docs/guides/state-management.md +0 -41
  37. package/package.json +4 -2
  38. package/rules/full-lean.md +3 -3
  39. package/rules/integration.md +2 -2
  40. package/rules/validate.md +271 -0
  41. package/dist/index-B9B40HvU.js +0 -21
  42. package/dist/index-B9B40HvU.js.map +0 -1
  43. package/dist/index-CBaynReP.mjs.map +0 -1
@@ -16,7 +16,7 @@ function G(t) {
16
16
  const { key: e, listContainer: n, listItemSelector: s, selector: i } = t;
17
17
  return `${e}\0${n || ""}\0${s || ""}\0${i || ""}`;
18
18
  }
19
- function He(t) {
19
+ function ze(t) {
20
20
  let e = 0, n = 0;
21
21
  for (let s = 0; s < t.length; s++) {
22
22
  const i = t.charCodeAt(s);
@@ -79,8 +79,8 @@ class V {
79
79
  if (n && !this.isCSS) {
80
80
  const s = n.effect?.target;
81
81
  if (s) {
82
- const i = new Event("animationend");
83
- s.dispatchEvent(i);
82
+ const i = this.options?.effectId || n.id, r = new CustomEvent("animationend", { detail: { effectId: i } });
83
+ s.dispatchEvent(r);
84
84
  }
85
85
  }
86
86
  e();
@@ -109,7 +109,13 @@ class V {
109
109
  return Promise.all(this.animations.map((e) => e.finished));
110
110
  }
111
111
  get playState() {
112
- return this.animations[0]?.playState;
112
+ return this.animations.some((e) => e.playState === "running") ? "running" : this.animations[0]?.playState;
113
+ }
114
+ hasAnimationName(e) {
115
+ return this.animations.some((n) => n.animationName === e);
116
+ }
117
+ hasAnimationId(e) {
118
+ return this.animations.some((n) => n.id === e);
113
119
  }
114
120
  getTimingOptions() {
115
121
  return this.animations.map((e) => {
@@ -122,8 +128,8 @@ class V {
122
128
  });
123
129
  }
124
130
  }
125
- const je = (t) => t, yt = (t) => 1 - Math.cos(t * Math.PI / 2), Et = (t) => Math.sin(t * Math.PI / 2), wt = (t) => -(Math.cos(Math.PI * t) - 1) / 2, bt = (t) => t ** 2, St = (t) => 1 - (1 - t) ** 2, Tt = (t) => t < 0.5 ? 2 * t ** 2 : 1 - (-2 * t + 2) ** 2 / 2, It = (t) => t ** 3, Ot = (t) => 1 - (1 - t) ** 3, Ct = (t) => t < 0.5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2, kt = (t) => t ** 4, At = (t) => 1 - (1 - t) ** 4, $t = (t) => t < 0.5 ? 8 * t ** 4 : 1 - (-2 * t + 2) ** 4 / 2, _t = (t) => t ** 5, qt = (t) => 1 - (1 - t) ** 5, Mt = (t) => t < 0.5 ? 16 * t ** 5 : 1 - (-2 * t + 2) ** 5 / 2, xt = (t) => t === 0 ? 0 : 2 ** (10 * t - 10), Pt = (t) => t === 1 ? 1 : 1 - 2 ** (-10 * t), Lt = (t) => t === 0 ? 0 : t === 1 ? 1 : t < 0.5 ? 2 ** (20 * t - 10) / 2 : (2 - 2 ** (-20 * t + 10)) / 2, Rt = (t) => 1 - Math.sqrt(1 - t ** 2), Ft = (t) => Math.sqrt(1 - (t - 1) ** 2), Nt = (t) => t < 0.5 ? (1 - Math.sqrt(1 - 4 * t ** 2)) / 2 : (Math.sqrt(-(2 * t - 3) * (2 * t - 1)) + 1) / 2, zt = (t) => 2.70158 * t ** 3 - 1.70158 * t ** 2, Ht = (t) => 1 + 2.70158 * (t - 1) ** 3 + 1.70158 * (t - 1) ** 2, jt = (t, e = 1.70158 * 1.525) => t < 0.5 ? (2 * t) ** 2 * ((e + 1) * 2 * t - e) / 2 : ((2 * t - 2) ** 2 * ((e + 1) * (t * 2 - 2) + e) + 2) / 2, Te = {
126
- linear: je,
131
+ const He = (t) => t, yt = (t) => 1 - Math.cos(t * Math.PI / 2), Et = (t) => Math.sin(t * Math.PI / 2), wt = (t) => -(Math.cos(Math.PI * t) - 1) / 2, bt = (t) => t ** 2, St = (t) => 1 - (1 - t) ** 2, Tt = (t) => t < 0.5 ? 2 * t ** 2 : 1 - (-2 * t + 2) ** 2 / 2, It = (t) => t ** 3, Ot = (t) => 1 - (1 - t) ** 3, At = (t) => t < 0.5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2, Ct = (t) => t ** 4, kt = (t) => 1 - (1 - t) ** 4, $t = (t) => t < 0.5 ? 8 * t ** 4 : 1 - (-2 * t + 2) ** 4 / 2, _t = (t) => t ** 5, qt = (t) => 1 - (1 - t) ** 5, Mt = (t) => t < 0.5 ? 16 * t ** 5 : 1 - (-2 * t + 2) ** 5 / 2, xt = (t) => t === 0 ? 0 : 2 ** (10 * t - 10), Pt = (t) => t === 1 ? 1 : 1 - 2 ** (-10 * t), Lt = (t) => t === 0 ? 0 : t === 1 ? 1 : t < 0.5 ? 2 ** (20 * t - 10) / 2 : (2 - 2 ** (-20 * t + 10)) / 2, Rt = (t) => 1 - Math.sqrt(1 - t ** 2), Ft = (t) => Math.sqrt(1 - (t - 1) ** 2), Nt = (t) => t < 0.5 ? (1 - Math.sqrt(1 - 4 * t ** 2)) / 2 : (Math.sqrt(-(2 * t - 3) * (2 * t - 1)) + 1) / 2, zt = (t) => 2.70158 * t ** 3 - 1.70158 * t ** 2, Ht = (t) => 1 + 2.70158 * (t - 1) ** 3 + 1.70158 * (t - 1) ** 2, jt = (t, e = 1.70158 * 1.525) => t < 0.5 ? (2 * t) ** 2 * ((e + 1) * 2 * t - e) / 2 : ((2 * t - 2) ** 2 * ((e + 1) * (t * 2 - 2) + e) + 2) / 2, Te = {
132
+ linear: He,
127
133
  sineIn: yt,
128
134
  sineOut: Et,
129
135
  sineInOut: wt,
@@ -132,9 +138,9 @@ const je = (t) => t, yt = (t) => 1 - Math.cos(t * Math.PI / 2), Et = (t) => Math
132
138
  quadInOut: Tt,
133
139
  cubicIn: It,
134
140
  cubicOut: Ot,
135
- cubicInOut: Ct,
136
- quartIn: kt,
137
- quartOut: At,
141
+ cubicInOut: At,
142
+ quartIn: Ct,
143
+ quartOut: kt,
138
144
  quartInOut: $t,
139
145
  quintIn: _t,
140
146
  quintOut: qt,
@@ -186,7 +192,7 @@ function J(t) {
186
192
  return t ? Ie[t] || t : Ie.linear;
187
193
  }
188
194
  function Gt(t, e, n, s) {
189
- const i = 3 * t, r = 3 * (n - t) - i, o = 1 - i - r, c = 3 * e, a = 3 * (s - e) - c, l = 1 - c - a, f = (p) => ((o * p + r) * p + i) * p, u = (p) => ((l * p + a) * p + c) * p, d = (p) => (3 * o * p + 2 * r) * p + i;
195
+ const i = 3 * t, r = 3 * (n - t) - i, o = 1 - i - r, a = 3 * e, c = 3 * (s - e) - a, l = 1 - a - c, f = (p) => ((o * p + r) * p + i) * p, u = (p) => ((l * p + c) * p + a) * p, d = (p) => (3 * o * p + 2 * r) * p + i;
190
196
  function g(p) {
191
197
  let m = p;
192
198
  for (let y = 0; y < 8; y++) {
@@ -222,16 +228,16 @@ function Vt(t) {
222
228
  if (n.length === 0) return;
223
229
  const s = [];
224
230
  for (const o of n) {
225
- const c = o.split(/\s+/), a = parseFloat(c[0]);
226
- if (isNaN(a)) return;
231
+ const a = o.split(/\s+/), c = parseFloat(a[0]);
232
+ if (isNaN(c)) return;
227
233
  const l = [];
228
- for (let f = 1; f < c.length; f++)
229
- if (c[f].endsWith("%")) {
230
- const u = parseFloat(c[f]) / 100;
234
+ for (let f = 1; f < a.length; f++)
235
+ if (a[f].endsWith("%")) {
236
+ const u = parseFloat(a[f]) / 100;
231
237
  if (isNaN(u)) return;
232
238
  l.push(u);
233
239
  }
234
- l.length === 0 ? s.push({ output: a, pos: null }) : l.length === 1 ? s.push({ output: a, pos: l[0] }) : (s.push({ output: a, pos: l[0] }), s.push({ output: a, pos: l[1] }));
240
+ l.length === 0 ? s.push({ output: c, pos: null }) : l.length === 1 ? s.push({ output: c, pos: l[0] }) : (s.push({ output: c, pos: l[0] }), s.push({ output: c, pos: l[1] }));
235
241
  }
236
242
  if (s.length === 0) return;
237
243
  s[0].pos === null && (s[0].pos = 0), s[s.length - 1].pos === null && (s[s.length - 1].pos = 1);
@@ -239,12 +245,12 @@ function Vt(t) {
239
245
  for (; i < s.length; )
240
246
  if (s[i].pos === null) {
241
247
  const o = i - 1;
242
- let c = i;
243
- for (; c < s.length && s[c].pos === null; ) c++;
244
- const a = s[o].pos, l = s[c].pos, f = c - o;
245
- for (let u = o + 1; u < c; u++)
246
- s[u].pos = a + (l - a) * (u - o) / f;
247
- i = c + 1;
248
+ let a = i;
249
+ for (; a < s.length && s[a].pos === null; ) a++;
250
+ const c = s[o].pos, l = s[a].pos, f = a - o;
251
+ for (let u = o + 1; u < a; u++)
252
+ s[u].pos = c + (l - c) * (u - o) / f;
253
+ i = a + 1;
248
254
  } else
249
255
  i++;
250
256
  for (let o = 1; o < s.length; o++)
@@ -252,14 +258,14 @@ function Vt(t) {
252
258
  const r = s;
253
259
  return (o) => {
254
260
  if (o <= r[0].pos) return r[0].output;
255
- const c = r[r.length - 1];
256
- if (o >= c.pos) return c.output;
257
- let a = 0, l = r.length - 1;
258
- for (; a < l - 1; ) {
259
- const d = a + l >>> 1;
260
- r[d].pos <= o ? a = d : l = d;
261
+ const a = r[r.length - 1];
262
+ if (o >= a.pos) return a.output;
263
+ let c = 0, l = r.length - 1;
264
+ for (; c < l - 1; ) {
265
+ const d = c + l >>> 1;
266
+ r[d].pos <= o ? c = d : l = d;
261
267
  }
262
- const f = r[a], u = r[l];
268
+ const f = r[c], u = r[l];
263
269
  return u.pos === f.pos ? u.output : f.output + (u.output - f.output) * (o - f.pos) / (u.pos - f.pos);
264
270
  };
265
271
  }
@@ -276,10 +282,10 @@ class Yt extends V {
276
282
  timingOptions;
277
283
  constructor(e, n = {}) {
278
284
  const s = e.flatMap((i) => [...i.animations]);
279
- super(s), this.animationGroups = e, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : be(n.offsetEasing) ?? je, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: r, duration: o, iterations: c }) => ({
285
+ super(s), this.animationGroups = e, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : be(n.offsetEasing) ?? He, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: r, duration: o, iterations: a }) => ({
280
286
  delay: r,
281
287
  duration: Number.isFinite(o) ? o : 0,
282
- iterations: Number.isFinite(c) ? c : 1
288
+ iterations: Number.isFinite(a) ? a : 1
283
289
  }))), this.applyOffsets(), this.ready = Promise.all(e.map((i) => i.ready)).then(() => {
284
290
  });
285
291
  }
@@ -302,10 +308,10 @@ class Yt extends V {
302
308
  const e = this.calculateOffsets(), n = this.getSequenceActiveDuration(e);
303
309
  this.animationGroups.forEach((s, i) => {
304
310
  s.animations.forEach((r, o) => {
305
- const c = r.effect;
306
- if (!c) return;
307
- const { delay: a, duration: l, iterations: f } = this.timingOptions[i][o], u = a + e[i], d = n - (u + l * f);
308
- c.updateTiming({ delay: u + this.delay, endDelay: d });
311
+ const a = r.effect;
312
+ if (!a) return;
313
+ const { delay: c, duration: l, iterations: f } = this.timingOptions[i][o], u = c + e[i], d = n - (u + l * f);
314
+ a.updateTiming({ delay: u + this.delay, endDelay: d });
309
315
  });
310
316
  });
311
317
  }
@@ -314,8 +320,8 @@ class Yt extends V {
314
320
  for (let s = 0; s < this.timingOptions.length; s++) {
315
321
  const i = this.timingOptions[s].reduce((r, o) => {
316
322
  if (!o) return r;
317
- const { delay: c, duration: a, iterations: l } = o;
318
- return Math.max(r, c + a * l);
323
+ const { delay: a, duration: c, iterations: l } = o;
324
+ return Math.max(r, a + c * l);
319
325
  }, 0);
320
326
  n.push(e[s] + i);
321
327
  }
@@ -332,8 +338,8 @@ class Yt extends V {
332
338
  for (const { index: s, group: i } of n) {
333
339
  const r = Math.min(s, this.animationGroups.length);
334
340
  this.animationGroups.splice(r, 0, i), this.timingOptions.splice(r, 0, i.getTimingOptions());
335
- const o = [...i.animations], c = this.animationGroups.slice(0, r).reduce((a, l) => a + l.animations.length, 0);
336
- this.animations.splice(c, 0, ...o);
341
+ const o = [...i.animations], a = this.animationGroups.slice(0, r).reduce((c, l) => c + l.animations.length, 0);
342
+ this.animations.splice(a, 0, ...o);
337
343
  }
338
344
  this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
339
345
  });
@@ -361,7 +367,7 @@ class Yt extends V {
361
367
  }
362
368
  }
363
369
  }
364
- class Kt {
370
+ class Bt {
365
371
  _animation;
366
372
  customEffect;
367
373
  progress;
@@ -372,8 +378,8 @@ class Kt {
372
378
  ...s,
373
379
  composite: "add"
374
380
  }), { timeline: o } = i;
375
- this._animation = new Animation(r, o), this._tickCbId = null, this.progress = null, this.customEffect = (c) => e(r.target, c), this._finishHandler = (c) => {
376
- this.effect.target?.getAnimations().find((a) => a === this._animation) || this.cancel();
381
+ this._animation = new Animation(r, o), this._tickCbId = null, this.progress = null, this.customEffect = (a) => e(r.target, a), this._finishHandler = (a) => {
382
+ this.effect.target?.getAnimations().find((c) => c === this._animation) || this.cancel();
377
383
  }, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
378
384
  }
379
385
  // private tick method for customEffect loop implementation
@@ -501,12 +507,12 @@ class Kt {
501
507
  return this._animation.dispatchEvent(e);
502
508
  }
503
509
  }
504
- function Bt(t) {
510
+ function Kt(t) {
505
511
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
506
512
  }
507
- var ee = { exports: {} }, Oe = ee.exports, Ce;
513
+ var ee = { exports: {} }, Oe = ee.exports, Ae;
508
514
  function Qt() {
509
- return Ce || (Ce = 1, (function(t) {
515
+ return Ae || (Ae = 1, (function(t) {
510
516
  (function(e) {
511
517
  var n = function() {
512
518
  }, s = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.msRequestAnimationFrame || function(f) {
@@ -562,7 +568,7 @@ function Qt() {
562
568
  * @public
563
569
  */
564
570
  clear: function(f) {
565
- return c(this.reads, f) || c(this.writes, f);
571
+ return a(this.reads, f) || a(this.writes, f);
566
572
  },
567
573
  /**
568
574
  * Extend this FastDom with some
@@ -601,7 +607,7 @@ function Qt() {
601
607
  extend: function(f) {
602
608
  if (typeof f != "object") throw new Error("expected object");
603
609
  var u = Object.create(this);
604
- return a(u, f), u.fastdom = this, u.initialize && u.initialize(), u;
610
+ return c(u, f), u.fastdom = this, u.initialize && u.initialize(), u;
605
611
  },
606
612
  // override this with a function
607
613
  // to prevent Errors in console
@@ -622,11 +628,11 @@ function Qt() {
622
628
  if (n("task errored", g.message), f.catch) f.catch(g);
623
629
  else throw g;
624
630
  }
625
- function c(f, u) {
631
+ function a(f, u) {
626
632
  var d = f.indexOf(u);
627
633
  return !!~d && !!f.splice(d, 1);
628
634
  }
629
- function a(f, u) {
635
+ function c(f, u) {
630
636
  for (var d in u)
631
637
  u.hasOwnProperty(d) && (f[d] = u[d]);
632
638
  }
@@ -636,7 +642,7 @@ function Qt() {
636
642
  })(ee)), ee.exports;
637
643
  }
638
644
  var Ut = Qt();
639
- const O = /* @__PURE__ */ Bt(Ut), de = {};
645
+ const O = /* @__PURE__ */ Kt(Ut), de = {};
640
646
  function Xt(t) {
641
647
  Object.assign(de, t);
642
648
  }
@@ -655,22 +661,22 @@ function en(t) {
655
661
  const e = t.alternate ? "alternate" : "";
656
662
  return t.reversed ? `${e ? `${e}-` : ""}reverse` : e || "normal";
657
663
  }
658
- function ae(t) {
664
+ function ce(t) {
659
665
  return `${t.value}${Dt(t.unit)}`;
660
666
  }
661
- function ke(t, e, n) {
662
- return `${t.name || "cover"} ${n && t.offset.unit !== "percentage" ? `calc(100% + ${ae(t.offset)}${e ? ` + ${e}` : ""})` : e ? `calc(${ae(t.offset)} + ${e})` : ae(t.offset)}`;
667
+ function Ce(t, e, n) {
668
+ return `${t.name || "cover"} ${n && t.offset.unit !== "percentage" ? `calc(100% + ${ce(t.offset)}${e ? ` + ${e}` : ""})` : e ? `calc(${ce(t.offset)} + ${e})` : ce(t.offset)}`;
663
669
  }
664
- function De(t) {
670
+ function je(t) {
665
671
  return {
666
- start: ke(t.startOffset, t.startOffsetAdd),
667
- end: ke(t.endOffset, t.endOffsetAdd, !0)
672
+ start: Ce(t.startOffset, t.startOffsetAdd),
673
+ end: Ce(t.endOffset, t.endOffsetAdd, !0)
668
674
  };
669
675
  }
670
- function Ge(t) {
676
+ function De(t) {
671
677
  return (e) => O.measure(() => e(t));
672
678
  }
673
- function We(t) {
679
+ function Ge(t) {
674
680
  return (e) => O.mutate(() => e(t));
675
681
  }
676
682
  function W(t) {
@@ -690,7 +696,7 @@ function W(t) {
690
696
  return (e) => [{ ...e, keyframes: [] }];
691
697
  return null;
692
698
  }
693
- function Ve(t, e, n, s) {
699
+ function We(t, e, n, s) {
694
700
  return t.map((i, r) => {
695
701
  const o = {
696
702
  fill: i.fill,
@@ -710,7 +716,7 @@ function Ve(t, e, n, s) {
710
716
  function Se(t) {
711
717
  return !t || t.trigger !== "pointer-move" && t.trigger !== "view-progress";
712
718
  }
713
- function Ae(t, e, n, s, i) {
719
+ function ke(t, e, n, s, i) {
714
720
  if (t) {
715
721
  if (Se(s) && (e.duration = e.duration || 1, i?.reducedMotion))
716
722
  if (e.iterations === 1 || e.iterations == null)
@@ -718,11 +724,11 @@ function Ae(t, e, n, s, i) {
718
724
  else
719
725
  return [];
720
726
  let r;
721
- return n instanceof HTMLElement && (r = { measure: Ge(n), mutate: We(n) }), t.web ? t.web(e, r, i) : t(e, r, i);
727
+ return n instanceof HTMLElement && (r = { measure: De(n), mutate: Ge(n) }), t.web ? t.web(e, r, i) : t(e, r, i);
722
728
  }
723
729
  return [];
724
730
  }
725
- function Ye(t, e, n, s, i) {
731
+ function Ve(t, e, n, s, i) {
726
732
  const r = t instanceof HTMLElement ? t : N(t, i);
727
733
  if (n?.trigger === "pointer-move" && !e.keyframeEffect) {
728
734
  let d = e;
@@ -732,7 +738,7 @@ function Ye(t, e, n, s, i) {
732
738
  });
733
739
  const g = W(
734
740
  d
735
- ), p = Ae(
741
+ ), p = ke(
736
742
  g,
737
743
  e,
738
744
  r,
@@ -741,27 +747,27 @@ function Ye(t, e, n, s, i) {
741
747
  );
742
748
  return typeof p != "function" ? null : p(r);
743
749
  }
744
- const o = W(e), c = Ae(
750
+ const o = W(e), a = ke(
745
751
  o,
746
752
  e,
747
753
  r,
748
754
  n,
749
755
  s
750
756
  );
751
- if (!c || c.length === 0)
757
+ if (!a || a.length === 0)
752
758
  return null;
753
- const a = Ve(c, n, e.effectId);
759
+ const c = We(a, n, e.effectId);
754
760
  let l;
755
761
  const f = n?.trigger === "view-progress";
756
762
  f && window.ViewTimeline && (l = new ViewTimeline({
757
763
  subject: n.element || N(n.componentId)
758
764
  }));
759
- const u = a.map(({ effect: d, options: g, id: p, part: m }) => {
765
+ const u = c.map(({ effect: d, options: g, id: p, part: m }) => {
760
766
  const h = m ? Jt(r, m) : r, v = new KeyframeEffect(h || null, [], g);
761
767
  O.mutate(() => {
762
768
  "timing" in d && v.updateTiming(d.timing), v.setKeyframes(d.keyframes);
763
769
  });
764
- const y = f && l ? { timeline: l } : {}, E = typeof d.customEffect == "function" ? new Kt(
770
+ const y = f && l ? { timeline: l } : {}, E = typeof d.customEffect == "function" ? new Bt(
765
771
  d.customEffect,
766
772
  h || null,
767
773
  g,
@@ -770,7 +776,7 @@ function Ye(t, e, n, s, i) {
770
776
  if (f)
771
777
  if (l)
772
778
  O.mutate(() => {
773
- const { start: w, end: S } = De(d);
779
+ const { start: w, end: S } = je(d);
774
780
  E.rangeStart = w, E.rangeEnd = S, E.play();
775
781
  });
776
782
  else {
@@ -804,24 +810,24 @@ function tn(t, e) {
804
810
  return t ? `#${t}${e ? `[data-motion-part~="${e}"]` : ""}` : "";
805
811
  }
806
812
  function nn(t, e) {
807
- const { duration: n, delay: s, iterations: i = 1, fill: r, easing: o = "linear", direction: c } = t.options, a = t.effect.name, l = n === "auto";
808
- return `${a} ${l ? "auto" : `${n}ms`}${l ? " " : ` ${s || 1}ms `}${o}${r && r !== "none" ? ` ${r}` : ""} ${!i || i === 1 / 0 ? "infinite" : i}${c === "normal" ? "" : ` ${c}`} ${e ? "" : "paused"}`;
813
+ const { duration: n, delay: s, iterations: i = 1, fill: r, easing: o = "linear", direction: a } = t.options, c = t.effect.name, l = n === "auto";
814
+ return `${c} ${l ? "auto" : `${n}ms`}${l ? " " : ` ${s || 1}ms `}${o}${r && r !== "none" ? ` ${r}` : ""} ${!i || i === 1 / 0 ? "infinite" : i}${a === "normal" ? "" : ` ${a}`} ${e ? "" : "paused"}`;
809
815
  }
810
816
  function sn(t, e, n) {
811
817
  return t?.style ? (Se(n) && (e.duration = e.duration || 1), t.style(e)) : [];
812
818
  }
813
819
  function rn(t, e, n) {
814
- const s = W(e), i = sn(s, e), r = Ve(i, n, e.effectId, !0), o = n?.trigger === "view-progress";
815
- return r.map((c, a) => {
816
- const { start: l, end: f } = o ? De(c.effect) : {};
820
+ const s = W(e), i = sn(s, e), r = We(i, n, e.effectId, !0), o = n?.trigger === "view-progress";
821
+ return r.map((a, c) => {
822
+ const { start: l, end: f } = o ? je(a.effect) : {};
817
823
  return {
818
- target: tn(t, c.part),
819
- animation: nn(c, o),
820
- composition: c.options.composite,
821
- custom: c.effect.custom,
822
- name: c.effect.name,
823
- keyframes: c.effect.keyframes,
824
- id: c.id && `${c.id}-${a + 1}`,
824
+ target: tn(t, a.part),
825
+ animation: nn(a, o),
826
+ composition: a.options.composite,
827
+ custom: a.effect.custom,
828
+ name: a.effect.name,
829
+ keyframes: a.effect.keyframes,
830
+ id: a.id && `${a.id}-${c + 1}`,
825
831
  animationTimeline: o ? `--${n?.id}` : "",
826
832
  animationRange: l || f ? `${l} ${f}` : ""
827
833
  };
@@ -830,23 +836,23 @@ function rn(t, e, n) {
830
836
  function on(t, e, n) {
831
837
  const s = W(e), i = t instanceof HTMLElement ? t : N(t);
832
838
  if (s && s.prepare && i) {
833
- const r = { measure: Ge(i), mutate: We(i) };
839
+ const r = { measure: De(i), mutate: Ge(i) };
834
840
  s.prepare(e, r);
835
841
  }
836
842
  n && O.mutate(n);
837
843
  }
838
- function cn(t, e) {
844
+ function Ye(t, e) {
839
845
  const n = W(e);
840
846
  if (!n)
841
847
  return null;
842
848
  if (!n.style)
843
849
  return e.effectId && t ? an(t, e.effectId) : null;
844
- const s = n.getNames(e), r = (typeof t == "string" ? N(t) : t)?.getAnimations(), o = r?.map((a) => a.animationName) || [], c = [];
845
- return s.forEach((a) => {
846
- o.includes(a) && c.push(
847
- r?.find((l) => l.animationName === a)
850
+ const s = n.getNames(e), r = (typeof t == "string" ? N(t) : t)?.getAnimations(), o = r?.map((c) => c.animationName) || [], a = [];
851
+ return s.forEach((c) => {
852
+ o.includes(c) && a.push(
853
+ r?.find((l) => l.animationName === c)
848
854
  );
849
- }), c?.length ? new V(c) : null;
855
+ }), a?.length ? new V(a) : null;
850
856
  }
851
857
  function an(t, e) {
852
858
  const s = (typeof t == "string" ? N(t) : t)?.getAnimations().filter((i) => {
@@ -855,14 +861,14 @@ function an(t, e) {
855
861
  });
856
862
  return s?.length ? new V(s) : null;
857
863
  }
858
- function Ke(t, e, n, s = {}) {
859
- const { disabled: i, allowActiveEvent: r, ...o } = s, c = Ye(t, e, n, o);
860
- if (!c)
864
+ function Be(t, e, n, s = {}) {
865
+ const { disabled: i, allowActiveEvent: r, ...o } = s, a = Ve(t, e, n, o);
866
+ if (!a)
861
867
  return null;
862
- let a = {};
868
+ let c = {};
863
869
  if (n.trigger === "view-progress" && !window.ViewTimeline) {
864
- const l = n.element || N(n.componentId), { ready: f } = c;
865
- return c.animations.map((u) => ({
870
+ const l = n.element || N(n.componentId), { ready: f } = a;
871
+ return a.animations.map((u) => ({
866
872
  /* we use getters for start and end in order to access the animation's start and end
867
873
  only when initializing the scrub scene rather than immediately */
868
874
  get start() {
@@ -874,7 +880,7 @@ function Ke(t, e, n, s = {}) {
874
880
  viewSource: l,
875
881
  ready: f,
876
882
  getProgress() {
877
- return c.getProgress();
883
+ return a.getProgress();
878
884
  },
879
885
  effect(d, g) {
880
886
  const { activeDuration: p } = u.effect.getComputedTiming(), { delay: m } = u.effect.getTiming();
@@ -888,7 +894,7 @@ function Ke(t, e, n, s = {}) {
888
894
  } else if (n.trigger === "pointer-move") {
889
895
  const l = e, { centeredToTarget: f, transitionDuration: u, transitionEasing: d } = l, g = n.axis;
890
896
  if (l.keyframeEffect) {
891
- const p = c;
897
+ const p = a;
892
898
  return p.animations?.length === 0 ? null : {
893
899
  target: void 0,
894
900
  centeredToTarget: f,
@@ -907,18 +913,18 @@ function Ke(t, e, n, s = {}) {
907
913
  }
908
914
  };
909
915
  }
910
- a = {
916
+ c = {
911
917
  centeredToTarget: f,
912
918
  allowActiveEvent: r
913
- }, e.customEffect && u && (a.transitionDuration = u, a.transitionEasing = be(d)), a.target = c.target;
919
+ }, e.customEffect && u && (c.transitionDuration = u, c.transitionEasing = be(d)), c.target = a.target;
914
920
  }
915
921
  return {
916
- ...a,
922
+ ...c,
917
923
  getProgress() {
918
- return c.getProgress();
924
+ return a.getProgress();
919
925
  },
920
926
  effect(l, f, u, d) {
921
- c.progress(
927
+ a.progress(
922
928
  u ? {
923
929
  // @ts-expect-error spread error on p
924
930
  ...f,
@@ -929,64 +935,64 @@ function Ke(t, e, n, s = {}) {
929
935
  },
930
936
  disabled: i,
931
937
  destroy() {
932
- c.cancel();
938
+ a.cancel();
933
939
  }
934
940
  };
935
941
  }
936
942
  function Y(t, e, n, s = !1) {
937
- const i = cn(t, e);
943
+ const i = Ye(t, e);
938
944
  return i ? (i.ready = new Promise((r) => {
939
945
  on(t, e, r);
940
- }), i) : Ye(t, e, n, { reducedMotion: s });
946
+ }), i) : Ve(t, e, n, { reducedMotion: s });
941
947
  }
942
- function fn(t) {
948
+ function cn(t) {
943
949
  return t === null ? [null] : typeof t == "string" ? Array.from(document.querySelectorAll(t)) : Array.isArray(t) ? t : [t];
944
950
  }
945
- function Be(t, e) {
951
+ function Ke(t, e) {
946
952
  const n = [];
947
953
  for (const { target: s, options: i } of t) {
948
- const r = fn(s);
954
+ const r = cn(s);
949
955
  for (const o of r) {
950
- const c = Y(
956
+ const a = Y(
951
957
  o,
952
958
  i,
953
959
  void 0,
954
960
  e?.reducedMotion
955
961
  );
956
- c instanceof V && n.push(c);
962
+ a instanceof V && n.push(a);
957
963
  }
958
964
  }
959
965
  return n;
960
966
  }
961
- function ln(t, e, n) {
962
- const s = Be(e, n);
967
+ function fn(t, e, n) {
968
+ const s = Ke(e, n);
963
969
  return new Yt(s, t);
964
970
  }
965
- function un(t, e = 2) {
971
+ function ln(t, e = 2) {
966
972
  return parseFloat(t.toFixed(e));
967
973
  }
968
- function dn(t) {
974
+ function un(t) {
969
975
  return /\[]/g.test(t);
970
976
  }
971
- function hn(t) {
977
+ function dn(t) {
972
978
  return `--${t.join("-")}`;
973
979
  }
974
- function mn(t) {
980
+ function hn(t) {
975
981
  return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
976
982
  }
977
- function pn(t, e, n, s) {
983
+ function mn(t, e, n, s) {
978
984
  const i = t.length - 1;
979
985
  t.forEach((r, o) => {
980
986
  if (r) {
981
- const c = o ? s(o / i) * i * n | 0 : 0;
982
- r.delay = e + c + (r.delay || 0);
987
+ const a = o ? s(o / i) * i * n | 0 : 0;
988
+ r.delay = e + a + (r.delay || 0);
983
989
  }
984
990
  });
985
991
  }
986
992
  function te(t, e) {
987
993
  return e.includes("&") ? e.replace(/&/g, t) : `${t}${e}`;
988
994
  }
989
- function A() {
995
+ function k() {
990
996
  return "wi-12343210".replace(
991
997
  /\d/g,
992
998
  (t) => String.fromCharCode(
@@ -1000,12 +1006,12 @@ function Qe(t) {
1000
1006
  if (e?.styleProperties) {
1001
1007
  const { duration: i, easing: r, delay: o } = e;
1002
1008
  i && (e.styleProperties.some(
1003
- (a) => a.name.startsWith("--")
1009
+ (c) => c.name.startsWith("--")
1004
1010
  ) ? s = [
1005
1011
  `all ${i}ms ${J(r || "ease")}${o ? ` ${o}ms` : ""}`,
1006
1012
  "visibility 0s"
1007
1013
  ] : s = e.styleProperties.map(
1008
- (a) => `${a.name} ${i}ms ${J(
1014
+ (c) => `${c.name} ${i}ms ${J(
1009
1015
  r || "ease"
1010
1016
  )}${o ? ` ${o}ms` : ""}`
1011
1017
  ));
@@ -1015,7 +1021,7 @@ function Qe(t) {
1015
1021
  ) || [];
1016
1022
  return s;
1017
1023
  }
1018
- function gn({
1024
+ function pn({
1019
1025
  key: t,
1020
1026
  effectId: e,
1021
1027
  transition: n,
@@ -1026,55 +1032,55 @@ function gn({
1026
1032
  const o = Qe({
1027
1033
  transition: n,
1028
1034
  transitionProperties: s
1029
- }), c = (n?.styleProperties || s)?.map(
1035
+ }), a = (n?.styleProperties || s)?.map(
1030
1036
  (p) => `${p.name}: ${p.value};`
1031
- ) || [], a = t.replace(/"/g, "'"), l = `:is(:state(${e}), :--${e}) ${i}`, f = `[data-interact-effect~="${e}"] ${i}`, u = r ? te(l, r) : l, d = r ? te(f, r) : f, g = [
1037
+ ) || [], c = t.replace(/"/g, "'"), l = `:is(:state(${e}), :--${e}) ${i}`, f = `[data-interact-effect~="${e}"] ${i}`, u = r ? te(l, r) : l, d = r ? te(f, r) : f, g = [
1032
1038
  `${u},
1033
1039
  ${d} {
1034
- ${c.join(`
1040
+ ${a.join(`
1035
1041
  `)}
1036
1042
  }`
1037
1043
  ];
1038
1044
  if (o.length) {
1039
- const p = `[data-interact-key="${a}"] ${i}`, m = r ? te(p, r) : p;
1045
+ const p = `[data-interact-key="${c}"] ${i}`, m = r ? te(p, r) : p;
1040
1046
  g.push(`@media (prefers-reduced-motion: no-preference) { ${m} {
1041
1047
  transition: ${o.join(", ")};
1042
1048
  } }`);
1043
1049
  }
1044
1050
  return g;
1045
1051
  }
1046
- function ce(t, e, n) {
1052
+ function ae(t, e, n) {
1047
1053
  const s = (t || []).filter((i) => e[i]?.type === n && e[i].predicate).map((i) => e[i].predicate).join(") and (");
1048
1054
  return s && `(${s})`;
1049
1055
  }
1050
1056
  function _(t, e) {
1051
- const n = ce(t, e, "media");
1057
+ const n = ae(t, e, "media");
1052
1058
  return n && window.matchMedia(n);
1053
1059
  }
1054
- function P(t, e) {
1060
+ function L(t, e) {
1055
1061
  return (t || []).filter((n) => e[n]?.type === "selector" && e[n].predicate).map((n) => `:is(${e[n].predicate})`).join("");
1056
1062
  }
1057
- const B = {
1063
+ const K = {
1058
1064
  rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
1059
1065
  rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
1060
1066
  };
1061
- function vn(t, e) {
1062
- const n = t?.name ?? B.rangeStart.name, s = e?.name ?? t?.name ?? B.rangeEnd.name, i = {
1067
+ function gn(t, e) {
1068
+ const n = t?.name ?? K.rangeStart.name, s = e?.name ?? t?.name ?? K.rangeEnd.name, i = {
1063
1069
  name: n,
1064
- offset: t?.offset || B.rangeStart.offset
1070
+ offset: t?.offset || K.rangeStart.offset
1065
1071
  }, r = {
1066
1072
  name: s,
1067
- offset: e?.offset || B.rangeEnd.offset
1073
+ offset: e?.offset || K.rangeEnd.offset
1068
1074
  };
1069
1075
  return { startOffset: i, endOffset: r };
1070
1076
  }
1071
- function L(t) {
1077
+ function q(t) {
1072
1078
  if ("keyframeEffect" in t && !t.keyframeEffect.name && "effectId" in t && (t.keyframeEffect.name = t.effectId), "duration" in t)
1073
1079
  return {
1074
1080
  id: "",
1075
1081
  ...t
1076
1082
  };
1077
- const { rangeStart: e, rangeEnd: n, ...s } = t, { startOffset: i, endOffset: r } = vn(e, n);
1083
+ const { rangeStart: e, rangeEnd: n, ...s } = t, { startOffset: i, endOffset: r } = gn(e, n);
1078
1084
  return {
1079
1085
  id: "",
1080
1086
  startOffset: i,
@@ -1082,38 +1088,38 @@ function L(t) {
1082
1088
  ...s
1083
1089
  };
1084
1090
  }
1085
- function k(t, e, n) {
1091
+ function C(t, e, n) {
1086
1092
  let s = t.get(e);
1087
1093
  s || (s = /* @__PURE__ */ new Set(), t.set(e, s)), s.add(n);
1088
1094
  }
1089
- function K(t, e) {
1095
+ function B(t, e) {
1090
1096
  t.get(e)?.forEach((s) => {
1091
1097
  const { source: i, target: r, cleanup: o } = s;
1092
1098
  o();
1093
- const c = i === e ? r : i;
1094
- t.get(c)?.delete(s);
1099
+ const a = i === e ? r : i;
1100
+ t.get(a)?.delete(s);
1095
1101
  }), t.delete(e);
1096
1102
  }
1097
- const yn = {
1103
+ const vn = {
1098
1104
  root: null,
1099
1105
  rootMargin: "0px 0px -10% 0px",
1100
1106
  threshold: [0]
1101
- }, En = {
1107
+ }, yn = {
1102
1108
  root: null,
1103
1109
  rootMargin: "0px",
1104
1110
  threshold: [0]
1105
- }, wn = 0.2;
1106
- function bn(t) {
1111
+ }, En = 0.2;
1112
+ function wn(t) {
1107
1113
  const e = t.trim().split(/\s+/), n = e[0], s = e.length > 1 ? e[1] : e[0], i = (r) => r.startsWith("-") ? r.slice(1) : parseFloat(r) ? `-${r}` : r;
1108
1114
  return `${i(n)} 0px ${i(s)}`;
1109
1115
  }
1110
- const D = {}, q = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakSet(), z = /* @__PURE__ */ new WeakMap();
1116
+ const D = {}, M = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakSet(), z = /* @__PURE__ */ new WeakMap();
1111
1117
  let Ue = {}, H = null;
1112
- function Sn(t) {
1118
+ function bn(t) {
1113
1119
  Ue = t;
1114
1120
  }
1115
1121
  function Xe(t, e, n) {
1116
- q.get(t)?.forEach(({ source: i, handler: r }) => {
1122
+ M.get(t)?.forEach(({ source: i, handler: r }) => {
1117
1123
  i === t && r(e, n);
1118
1124
  });
1119
1125
  }
@@ -1123,56 +1129,56 @@ function $e() {
1123
1129
  const n = e.target;
1124
1130
  e.isIntersecting || Xe(n, !1, !0);
1125
1131
  });
1126
- }, En), H);
1132
+ }, yn), H);
1127
1133
  }
1128
1134
  function Ze(t, e = !1) {
1129
1135
  const n = JSON.stringify({ ...t, isSafeMode: e });
1130
1136
  if (D[n])
1131
1137
  return D[n];
1132
- const s = t.threshold ?? wn, i = e ? yn : {
1138
+ const s = t.threshold ?? En, i = e ? vn : {
1133
1139
  root: null,
1134
- rootMargin: t.inset ? bn(t.inset) : "0px",
1140
+ rootMargin: t.inset ? wn(t.inset) : "0px",
1135
1141
  threshold: s
1136
1142
  }, r = new IntersectionObserver((o) => {
1137
- o.forEach((c) => {
1138
- const a = c.target, l = !re.has(a);
1139
- if (l && (re.add(a), t.useSafeViewEnter && !c.isIntersecting)) {
1143
+ o.forEach((a) => {
1144
+ const c = a.target, l = !re.has(c);
1145
+ if (l && (re.add(c), t.useSafeViewEnter && !a.isIntersecting)) {
1140
1146
  O.measure(() => {
1141
- const f = c.boundingClientRect.height, u = c.rootBounds?.height;
1147
+ const f = a.boundingClientRect.height, u = a.rootBounds?.height;
1142
1148
  if (!u)
1143
1149
  return;
1144
1150
  const d = Array.isArray(t.threshold) ? Math.min(...t.threshold) : t.threshold;
1145
1151
  d && f * d > u && O.mutate(() => {
1146
- r.unobserve(a);
1152
+ r.unobserve(c);
1147
1153
  const p = Ze(t, !0);
1148
- z.set(a, p), p.observe(a);
1154
+ z.set(c, p), p.observe(c);
1149
1155
  });
1150
1156
  });
1151
1157
  return;
1152
1158
  }
1153
- (c.isIntersecting || !l) && Xe(a, c.isIntersecting);
1159
+ (a.isIntersecting || !l) && Xe(c, a.isIntersecting);
1154
1160
  });
1155
1161
  }, i);
1156
1162
  return D[n] = r, r;
1157
1163
  }
1158
- function Tn(t, e, n, s = {}, { reducedMotion: i, selectorCondition: r, animation: o } = {}) {
1159
- const c = { ...Ue, ...s }, a = n.triggerType || "once", l = o || Y(
1164
+ function Sn(t, e, n, s = {}, { reducedMotion: i, selectorCondition: r, animation: o } = {}) {
1165
+ const a = { ...Ue, ...s }, c = n.triggerType || "once", l = o || Y(
1160
1166
  e,
1161
- L(n),
1167
+ q(n),
1162
1168
  void 0,
1163
1169
  i
1164
1170
  );
1165
1171
  if (!l)
1166
1172
  return;
1167
- const f = Ze(c);
1168
- a !== "once" && l.persist?.();
1173
+ const f = Ze(a);
1174
+ c !== "once" && l.persist?.();
1169
1175
  let u = !0, d = !1, g;
1170
1176
  g = { source: t, target: e, handler: (h, v) => {
1171
1177
  if (!(r && !e.matches(r)))
1172
- if (a === "once") {
1178
+ if (c === "once") {
1173
1179
  if (h && !d) {
1174
- d = !0, q.get(t)?.delete(g), q.get(e)?.delete(g);
1175
- const y = q.get(t);
1180
+ d = !0, M.get(t)?.delete(g), M.get(e)?.delete(g);
1181
+ const y = M.get(t);
1176
1182
  (!y || y.size === 0) && ((z.get(t) || f).unobserve(t), re.delete(t)), l.play(() => {
1177
1183
  const E = () => {
1178
1184
  e.dataset.interactEnter = "start";
@@ -1191,27 +1197,27 @@ function Tn(t, e, n, s = {}, { reducedMotion: i, selectorCondition: r, animation
1191
1197
  O.mutate(E);
1192
1198
  });
1193
1199
  }
1194
- } else a === "alternate" ? u && h ? (u = !1, l.play()) : u || l.reverse() : a === "repeat" ? h ? (l.progress(0), l.play()) : v && (l.pause(), l.progress(0)) : a === "state" && (h ? l.play() : v && l.pause());
1200
+ } else c === "alternate" ? u && h ? (u = !1, l.play()) : u || l.reverse() : c === "repeat" ? h ? (l.progress(0), l.play()) : v && (l.pause(), l.progress(0)) : c === "state" && (h ? l.play() : v && l.pause());
1195
1201
  }, cleanup: () => {
1196
- (z.get(t) || f).unobserve(t), (a === "repeat" || a === "state") && $e().unobserve(t), l.cancel(), re.delete(t), z.delete(t);
1197
- } }, k(q, t, g), k(q, e, g), z.set(t, f), f.observe(t), (a === "repeat" || a === "state") && $e().observe(t);
1202
+ (z.get(t) || f).unobserve(t), (c === "repeat" || c === "state") && $e().unobserve(t), l.cancel(), re.delete(t), z.delete(t);
1203
+ } }, C(M, t, g), C(M, e, g), z.set(t, f), f.observe(t), (c === "repeat" || c === "state") && $e().observe(t);
1198
1204
  }
1199
- function In(t) {
1200
- K(q, t);
1205
+ function Tn(t) {
1206
+ B(M, t);
1201
1207
  }
1202
- function On() {
1208
+ function In() {
1203
1209
  H = null, Object.keys(D).forEach((t) => delete D[t]);
1204
1210
  }
1205
- const _e = {
1206
- add: Tn,
1207
- remove: In,
1208
- setOptions: Sn,
1209
- reset: On
1211
+ const On = {
1212
+ add: Sn,
1213
+ remove: Tn,
1214
+ setOptions: bn,
1215
+ reset: In
1210
1216
  };
1211
1217
  function Je(t, e) {
1212
1218
  return Object.assign(Object.create(e), t);
1213
1219
  }
1214
- function Cn(t, e, n, s) {
1220
+ function An(t, e, n, s) {
1215
1221
  let i = t * (1 - n) + e * n;
1216
1222
  if (s) {
1217
1223
  const r = i - t;
@@ -1222,7 +1228,7 @@ function Cn(t, e, n, s) {
1222
1228
  }
1223
1229
  return i;
1224
1230
  }
1225
- function kn(t) {
1231
+ function Cn(t) {
1226
1232
  let e = !1;
1227
1233
  return function() {
1228
1234
  e || (e = !0, window.requestAnimationFrame(() => {
@@ -1230,7 +1236,7 @@ function kn(t) {
1230
1236
  }));
1231
1237
  };
1232
1238
  }
1233
- function qe(t, e) {
1239
+ function _e(t, e) {
1234
1240
  let n = 0;
1235
1241
  return function() {
1236
1242
  n && window.clearTimeout(n), n = window.setTimeout(() => {
@@ -1238,37 +1244,37 @@ function qe(t, e) {
1238
1244
  }, e);
1239
1245
  };
1240
1246
  }
1241
- function An(t, e) {
1247
+ function kn(t, e) {
1242
1248
  const n = t.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);
1243
1249
  return oe(n[1], e) + oe(n[6], e);
1244
1250
  }
1245
1251
  function oe(t, e) {
1246
- return t ? /^-?\d+px$/.test(t) ? parseInt(t) : /^-?\d+[lsd]?vh$/.test(t) ? parseInt(t) * e.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(t) ? parseInt(t) * e.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(t) ? An(t, e) : parseInt(t) || 0 : 0;
1252
+ return t ? /^-?\d+px$/.test(t) ? parseInt(t) : /^-?\d+[lsd]?vh$/.test(t) ? parseInt(t) * e.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(t) ? parseInt(t) * e.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(t) ? kn(t, e) : parseInt(t) || 0 : 0;
1247
1253
  }
1248
1254
  function R(t, e, n) {
1249
- const { name: s, offset: i = 0 } = t, { start: r, end: o } = n, c = o - r, a = i / 100;
1255
+ const { name: s, offset: i = 0 } = t, { start: r, end: o } = n, a = o - r, c = i / 100;
1250
1256
  let l, f;
1251
- return s === "entry" ? (l = r - e, f = Math.min(e, c)) : s === "entry-crossing" ? (l = r - e, f = c) : s === "contain" ? (l = Math.min(o - e, r), f = Math.abs(e - c)) : s === "exit" ? (l = Math.max(r, o - e), f = Math.min(e, c)) : s === "exit-crossing" ? (l = r, f = c) : s === "cover" && (l = r - e, f = c + e), l + a * f | 0;
1257
+ return s === "entry" ? (l = r - e, f = Math.min(e, a)) : s === "entry-crossing" ? (l = r - e, f = a) : s === "contain" ? (l = Math.min(o - e, r), f = Math.abs(e - a)) : s === "exit" ? (l = Math.max(r, o - e), f = Math.min(e, a)) : s === "exit-crossing" ? (l = r, f = a) : s === "cover" && (l = r - e, f = a + e), l + c * f | 0;
1252
1258
  }
1253
1259
  function fe(t, e, n, s, i) {
1254
1260
  let r = 0;
1255
1261
  const o = { start: e, end: n };
1256
- return t.forEach((c, a) => {
1257
- r += c.offset;
1258
- const l = c.sticky;
1262
+ return t.forEach((a, c) => {
1263
+ r += a.offset;
1264
+ const l = a.sticky;
1259
1265
  if (l) {
1260
- if ("end" in l && t[a - 1]?.element) {
1261
- const d = ((i ? c.element.offsetWidth : c.element.offsetHeight) || 0) + l.end - s, g = r + d - c.offset, p = g < o.start, m = !p && g <= n;
1266
+ if ("end" in l && t[c - 1]?.element) {
1267
+ const d = ((i ? a.element.offsetWidth : a.element.offsetHeight) || 0) + l.end - s, g = r + d - a.offset, p = g < o.start, m = !p && g <= n;
1262
1268
  let h = 0;
1263
- (p || m) && (h = c.offset, o.end += h), p && (o.start += h);
1269
+ (p || m) && (h = a.offset, o.end += h), p && (o.start += h);
1264
1270
  }
1265
1271
  if ("start" in l) {
1266
1272
  const f = r - l.start, u = f < o.start, d = !u && f <= o.end;
1267
1273
  let g = 0;
1268
- const p = t[a - 1]?.element;
1274
+ const p = t[c - 1]?.element;
1269
1275
  if (p) {
1270
1276
  if (u || d) {
1271
- const m = (i ? p.offsetWidth : p.offsetHeight) || 0, h = c.offset, v = (i ? c.element.offsetWidth : c.element.offsetHeight) || 0;
1277
+ const m = (i ? p.offsetWidth : p.offsetHeight) || 0, h = a.offset, v = (i ? a.element.offsetWidth : a.element.offsetHeight) || 0;
1272
1278
  g = m - (h + v), r += g, o.end += g;
1273
1279
  }
1274
1280
  u && (o.start += g);
@@ -1278,10 +1284,10 @@ function fe(t, e, n, s, i) {
1278
1284
  }), o;
1279
1285
  }
1280
1286
  function $n(t, e, n, s, i, r) {
1281
- const { start: o, end: c, duration: a } = t;
1282
- let l = o, f = c, u = t.startRange, d = t.endRange, g;
1283
- if (typeof a == "string") {
1284
- u = { name: a, offset: 0 }, d = { name: a, offset: 100 }, l = R(u, n, e), f = R(d, n, e), g = f - l;
1287
+ const { start: o, end: a, duration: c } = t;
1288
+ let l = o, f = a, u = t.startRange, d = t.endRange, g;
1289
+ if (typeof c == "string") {
1290
+ u = { name: c, offset: 0 }, d = { name: c, offset: 100 }, l = R(u, n, e), f = R(d, n, e), g = f - l;
1285
1291
  const p = fe(r, l, f, n, s);
1286
1292
  l = p.start, f = p.end;
1287
1293
  } else {
@@ -1290,13 +1296,13 @@ function $n(t, e, n, s, i, r) {
1290
1296
  const p = oe(u.add, i), m = R({ ...u, offset: 0 }, n, e), h = R({ ...u, offset: 100 }, n, e), v = fe(r, m, h, n, s);
1291
1297
  l = v.start + u.offset / 100 * (v.end - v.start) + p;
1292
1298
  }
1293
- if (d || c?.name) {
1294
- d = d || c;
1299
+ if (d || a?.name) {
1300
+ d = d || a;
1295
1301
  const p = oe(d.add, i), m = R({ ...d, offset: 0 }, n, e), h = R({ ...d, offset: 100 }, n, e), v = fe(r, m, h, n, s);
1296
1302
  f = v.start + d.offset / 100 * (v.end - v.start) + p;
1297
- } else typeof a == "number" && (f = l + a);
1303
+ } else typeof c == "number" && (f = l + c);
1298
1304
  }
1299
- return !g && !a && (g = f - l), { ...t, start: l, end: f, startRange: u, endRange: d, duration: g || a };
1305
+ return !g && !c && (g = f - l), { ...t, start: l, end: f, startRange: u, endRange: d, duration: g || c };
1300
1306
  }
1301
1307
  function _n(t) {
1302
1308
  return t.position === "sticky";
@@ -1322,10 +1328,10 @@ function Ln(t, e) {
1322
1328
  }
1323
1329
  function Q(t, e, n, s, i) {
1324
1330
  const r = t[0].viewSource, o = [];
1325
- let c = (s ? r.offsetWidth : r.offsetHeight) || 0, a = 0, l = r;
1331
+ let a = (s ? r.offsetWidth : r.offsetHeight) || 0, c = 0, l = r;
1326
1332
  for (; l; ) {
1327
1333
  const u = window.getComputedStyle(l), d = _n(u), g = d ? Ln(u, s) : void 0, p = Pn(l, s, d);
1328
- if ((!g || !("end" in g)) && (a += p), o.push({ element: l, offset: p, sticky: g }), l = l.offsetParent, qn(u, l, e))
1334
+ if ((!g || !("end" in g)) && (c += p), o.push({ element: l, offset: p, sticky: g }), l = l.offsetParent, qn(u, l, e))
1329
1335
  break;
1330
1336
  if (l === e) {
1331
1337
  o.push({ element: l, offset: 0 });
@@ -1335,7 +1341,7 @@ function Q(t, e, n, s, i) {
1335
1341
  return o.reverse(), t.map((u) => ({
1336
1342
  ...$n(
1337
1343
  u,
1338
- { start: a, end: a + c },
1344
+ { start: c, end: c + a },
1339
1345
  n,
1340
1346
  s,
1341
1347
  i,
@@ -1343,7 +1349,7 @@ function Q(t, e, n, s, i) {
1343
1349
  )
1344
1350
  }));
1345
1351
  }
1346
- const Me = 100, Rn = {
1352
+ const qe = 100, Rn = {
1347
1353
  horizontal: !1,
1348
1354
  observeViewportEntry: !0,
1349
1355
  viewportRootMargin: "7% 7%",
@@ -1355,7 +1361,7 @@ function Fn(t, e, n, s) {
1355
1361
  let i = 0;
1356
1362
  return t >= e && t <= n ? i = s ? (t - e) / s : 1 : t > n && (i = 1), i;
1357
1363
  }
1358
- function xe(t, e) {
1364
+ function Me(t, e) {
1359
1365
  return t === window ? e ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : e ? t.clientWidth : t.clientHeight;
1360
1366
  }
1361
1367
  function Nn() {
@@ -1366,7 +1372,7 @@ function Nn() {
1366
1372
  }
1367
1373
  function zn(t) {
1368
1374
  const e = Je(t, Rn), n = e.root, s = e.horizontal, i = /* @__PURE__ */ new WeakMap();
1369
- let r = xe(n, s), o, c, a, l, f;
1375
+ let r = Me(n, s), o, a, c, l, f;
1370
1376
  const u = [], d = Nn();
1371
1377
  if (e.scenes = Object.values(
1372
1378
  // TODO(ameerf): find a polyfill and use groupBy instead of following reduce
@@ -1383,7 +1389,7 @@ function zn(t) {
1383
1389
  m.index = h;
1384
1390
  }), u.length) {
1385
1391
  const m = /* @__PURE__ */ new Map();
1386
- window.ResizeObserver && (a = new window.ResizeObserver(function(h) {
1392
+ window.ResizeObserver && (c = new window.ResizeObserver(function(h) {
1387
1393
  h.forEach((v) => {
1388
1394
  const y = m.get(v.target), E = Q(y, n, r, s, d);
1389
1395
  E.forEach((w, S) => {
@@ -1391,8 +1397,8 @@ function zn(t) {
1391
1397
  }), u.splice(u.indexOf(y), 1, E);
1392
1398
  });
1393
1399
  }), u.forEach((h) => {
1394
- a.observe(h[0].viewSource, { box: "border-box" }), m.set(h[0].viewSource, h);
1395
- }), e.observeContentResize && e.contentRoot && new window.ResizeObserver(qe(() => {
1400
+ c.observe(h[0].viewSource, { box: "border-box" }), m.set(h[0].viewSource, h);
1401
+ }), e.observeContentResize && e.contentRoot && new window.ResizeObserver(_e(() => {
1396
1402
  const v = u.map((y) => {
1397
1403
  const E = Q(y, n, r, s, d);
1398
1404
  return E.forEach((w, S) => {
@@ -1402,8 +1408,8 @@ function zn(t) {
1402
1408
  u.length = 0, u.push(...v), u.forEach((y) => {
1403
1409
  m.set(y[0].viewSource, y);
1404
1410
  });
1405
- }, Me)).observe(e.contentRoot, { box: "border-box" })), e.observeViewportResize && (l = qe(function() {
1406
- r = xe(n, s);
1411
+ }, qe)).observe(e.contentRoot, { box: "border-box" })), e.observeViewportResize && (l = _e(function() {
1412
+ r = Me(n, s);
1407
1413
  const h = u.map((v) => {
1408
1414
  const y = Q(v, n, r, s, d);
1409
1415
  return y.forEach((E, w) => {
@@ -1413,9 +1419,9 @@ function zn(t) {
1413
1419
  u.length = 0, u.push(...h), u.forEach((v) => {
1414
1420
  m.set(v[0].viewSource, v);
1415
1421
  });
1416
- }, Me), n === window ? window.addEventListener("resize", l) : window.ResizeObserver && (f = new window.ResizeObserver(l), f.observe(n, { box: "border-box" })));
1422
+ }, qe), n === window ? window.addEventListener("resize", l) : window.ResizeObserver && (f = new window.ResizeObserver(l), f.observe(n, { box: "border-box" })));
1417
1423
  }
1418
- e.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(m) {
1424
+ e.observeViewportEntry && window.IntersectionObserver && (a = new window.IntersectionObserver(function(m) {
1419
1425
  m.forEach((h) => {
1420
1426
  (i.get(h.target) || []).forEach((v) => {
1421
1427
  v.disabled = !h.isIntersecting;
@@ -1428,7 +1434,7 @@ function zn(t) {
1428
1434
  }), e.scenes.forEach((m) => {
1429
1435
  if (m.viewSource) {
1430
1436
  let h = i.get(m.viewSource);
1431
- h || (h = [], i.set(m.viewSource, h), c.observe(m.viewSource)), h.push(m);
1437
+ h || (h = [], i.set(m.viewSource, h), a.observe(m.viewSource)), h.push(m);
1432
1438
  }
1433
1439
  }));
1434
1440
  function g({ p: m, vp: h }) {
@@ -1444,7 +1450,7 @@ function zn(t) {
1444
1450
  }
1445
1451
  }
1446
1452
  function p() {
1447
- e.scenes.forEach((m) => m.destroy?.()), c && (c.disconnect(), c = null), a && (a.disconnect(), a = null), l && (f ? (f.disconnect(), f = null) : window.removeEventListener("resize", l));
1453
+ e.scenes.forEach((m) => m.destroy?.()), a && (a.disconnect(), a = null), c && (c.disconnect(), c = null), l && (f ? (f.disconnect(), f = null) : window.removeEventListener("resize", l));
1448
1454
  }
1449
1455
  return {
1450
1456
  tick: g,
@@ -1473,7 +1479,7 @@ class jn {
1473
1479
  this.config.root = n ? window : this.config.root, this.config.contentRoot = this.config.contentRoot || (n ? window.document.body : this.config.root.firstElementChild), this.config.resetProgress = this.config.resetProgress || this.resetProgress.bind(this), this._measure = this.config.measure || (() => {
1474
1480
  const s = this.config.root;
1475
1481
  this.progress.p = this.config.horizontal ? s.scrollX || s.scrollLeft || 0 : s.scrollY || s.scrollTop || 0;
1476
- }), this._trigger = kn(() => {
1482
+ }), this._trigger = Cn(() => {
1477
1483
  this._measure?.(), this.tick(!0);
1478
1484
  });
1479
1485
  }
@@ -1519,7 +1525,7 @@ class jn {
1519
1525
  * Calculate current progress.
1520
1526
  */
1521
1527
  lerp() {
1522
- this.currentProgress.p = Cn(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
1528
+ this.currentProgress.p = An(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
1523
1529
  }
1524
1530
  /**
1525
1531
  * Stop the event and effect, and remove all DOM side-effects.
@@ -1563,21 +1569,21 @@ function Gn(t, e, n, s, { reducedMotion: i }) {
1563
1569
  const r = {
1564
1570
  trigger: "view-progress",
1565
1571
  element: t
1566
- }, o = L(n);
1567
- let c;
1572
+ }, o = q(n);
1573
+ let a;
1568
1574
  if ("ViewTimeline" in window) {
1569
1575
  const l = Y(
1570
1576
  e,
1571
1577
  o,
1572
1578
  r
1573
1579
  );
1574
- l && !l.isCSS && (l.play(), c = () => {
1580
+ l && !l.isCSS && (l.play(), a = () => {
1575
1581
  l.ready.then(() => {
1576
1582
  l.cancel();
1577
1583
  });
1578
1584
  });
1579
1585
  } else {
1580
- const l = Ke(e, o, r);
1586
+ const l = Be(e, o, r);
1581
1587
  if (l) {
1582
1588
  const f = Array.isArray(l) ? l : [l], u = new jn({
1583
1589
  viewSource: t,
@@ -1588,7 +1594,7 @@ function Gn(t, e, n, s, { reducedMotion: i }) {
1588
1594
  root: document.body,
1589
1595
  ...et()
1590
1596
  });
1591
- c = () => {
1597
+ a = () => {
1592
1598
  u.destroy();
1593
1599
  }, Promise.all(f.map((d) => d.ready || Promise.resolve())).then(
1594
1600
  () => {
@@ -1597,22 +1603,22 @@ function Gn(t, e, n, s, { reducedMotion: i }) {
1597
1603
  );
1598
1604
  }
1599
1605
  }
1600
- if (!c) return;
1601
- const a = { source: t, target: e, cleanup: c };
1602
- k(he, t, a), k(he, e, a);
1606
+ if (!a) return;
1607
+ const c = { source: t, target: e, cleanup: a };
1608
+ C(he, t, c), C(he, e, c);
1603
1609
  }
1604
1610
  function Wn(t) {
1605
- K(he, t);
1611
+ B(he, t);
1606
1612
  }
1607
1613
  const Vn = {
1608
1614
  add: Gn,
1609
1615
  remove: Wn,
1610
1616
  registerOptionsGetter: Dn
1611
1617
  };
1612
- function Pe(t, e, n) {
1618
+ function xe(t, e, n) {
1613
1619
  return Math.min(Math.max(t, n), e);
1614
1620
  }
1615
- function Le(t) {
1621
+ function Pe(t) {
1616
1622
  let e = !1;
1617
1623
  return function() {
1618
1624
  if (!e)
@@ -1634,7 +1640,7 @@ function Yn(t) {
1634
1640
  height: t.offsetHeight
1635
1641
  };
1636
1642
  }
1637
- function Kn() {
1643
+ function Bn() {
1638
1644
  const t = window.devicePixelRatio;
1639
1645
  let e = !1;
1640
1646
  if (t === 1)
@@ -1647,13 +1653,13 @@ function Kn() {
1647
1653
  });
1648
1654
  return document.body.dispatchEvent(n), e;
1649
1655
  }
1650
- function Bn() {
1656
+ function Kn() {
1651
1657
  return new Promise((t) => {
1652
1658
  const e = window.scrollY;
1653
1659
  let n = !1, s;
1654
1660
  function i() {
1655
- document.body.addEventListener("pointerdown", (c) => {
1656
- s === void 0 ? s = c.offsetY : n = c.offsetY === s;
1661
+ document.body.addEventListener("pointerdown", (a) => {
1662
+ s === void 0 ? s = a.offsetY : n = a.offsetY === s;
1657
1663
  }, { once: !0 });
1658
1664
  const o = new PointerEvent("pointerdown", {
1659
1665
  clientY: 500
@@ -1667,7 +1673,7 @@ function Bn() {
1667
1673
  });
1668
1674
  }
1669
1675
  function Qn(t) {
1670
- Bn().then((e) => {
1676
+ Kn().then((e) => {
1671
1677
  t.fixRequired = e, e && (window.addEventListener("scroll", t.scrollHandler), t.scrollHandler());
1672
1678
  });
1673
1679
  }
@@ -1704,12 +1710,12 @@ function Xn(t, e) {
1704
1710
  function Zn(t, e, n) {
1705
1711
  return {
1706
1712
  x(s) {
1707
- const i = t.left - n.x + t.width / 2, r = i >= e.width / 2, o = (r ? i : e.width - i) * 2, c = r ? 0 : i - o / 2;
1708
- return (s - c) / o;
1713
+ const i = t.left - n.x + t.width / 2, r = i >= e.width / 2, o = (r ? i : e.width - i) * 2, a = r ? 0 : i - o / 2;
1714
+ return (s - a) / o;
1709
1715
  },
1710
1716
  y(s) {
1711
- const i = t.top - n.y + t.height / 2, r = i >= e.height / 2, o = (r ? i : e.height - i) * 2, c = r ? 0 : i - o / 2;
1712
- return (s - c) / o;
1717
+ const i = t.top - n.y + t.height / 2, r = i >= e.height / 2, o = (r ? i : e.height - i) * 2, a = r ? 0 : i - o / 2;
1718
+ return (s - a) / o;
1713
1719
  }
1714
1720
  };
1715
1721
  }
@@ -1728,20 +1734,20 @@ function ts(t) {
1728
1734
  return e.observe(t.root, { box: "border-box" }), e;
1729
1735
  }
1730
1736
  function ns(t) {
1731
- let e = !1, n = { x: t.rect.width / 2, y: t.rect.height / 2, vx: 0, vy: 0 }, s, i, r, o, c;
1732
- const a = { x: 0, y: 0 };
1737
+ let e = !1, n = { x: t.rect.width / 2, y: t.rect.height / 2, vx: 0, vy: 0 }, s, i, r, o, a;
1738
+ const c = { x: 0, y: 0 };
1733
1739
  t.scenes.forEach((f) => {
1734
- f.target && f.centeredToTarget && (f.transform = Zn(Yn(f.target), t.rect, a), e = !0), t.root ? i = ts(t) : (r = es.bind(null, t), window.addEventListener("resize", r));
1740
+ f.target && f.centeredToTarget && (f.transform = Zn(Yn(f.target), t.rect, c), e = !0), t.root ? i = ts(t) : (r = es.bind(null, t), window.addEventListener("resize", r));
1735
1741
  }), s = function(f) {
1736
1742
  for (let u of t.scenes)
1737
1743
  if (!u.disabled) {
1738
- const d = u.transform?.x(f.x) || f.x / t.rect.width, g = u.transform?.y(f.y) || f.y / t.rect.height, p = +Pe(0, 1, d).toPrecision(4), m = +Pe(0, 1, g).toPrecision(4), h = { x: f.vx, y: f.vy };
1744
+ const d = u.transform?.x(f.x) || f.x / t.rect.width, g = u.transform?.y(f.y) || f.y / t.rect.height, p = +xe(0, 1, d).toPrecision(4), m = +xe(0, 1, g).toPrecision(4), h = { x: f.vx, y: f.vy };
1739
1745
  t.allowActiveEvent && (f.active = d <= 1 && g <= 1 && d >= 0 && g >= 0), u.effect(u, { x: p, y: m }, h, f.active);
1740
1746
  }
1741
1747
  Object.assign(n, f);
1742
- }, e && (o = Jn.bind(a, s, n), c = Xn(document, o));
1748
+ }, e && (o = Jn.bind(c, s, n), a = Xn(document, o));
1743
1749
  function l() {
1744
- t.scenes.forEach((f) => f.destroy?.()), c?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", r), r = null), s = null, n = null;
1750
+ t.scenes.forEach((f) => f.destroy?.()), a?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", r), r = null), s = null, n = null;
1745
1751
  }
1746
1752
  return {
1747
1753
  tick: s,
@@ -1758,7 +1764,7 @@ class rs {
1758
1764
  constructor(e = {}) {
1759
1765
  this.config = { ...e }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
1760
1766
  let n;
1761
- this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : Le(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : Le(() => {
1767
+ this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : Pe(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : Pe(() => {
1762
1768
  this.tick();
1763
1769
  }), this.config.rect = this.config.root ? {
1764
1770
  width: this.config.root.offsetWidth,
@@ -1781,7 +1787,7 @@ class rs {
1781
1787
  }, this._pointerEnter = () => {
1782
1788
  this.progress.active = !0, this._nextTick = n();
1783
1789
  }, this.config.root) {
1784
- X = typeof X == "boolean" ? X : Kn();
1790
+ X = typeof X == "boolean" ? X : Bn();
1785
1791
  const i = X ? window.devicePixelRatio : 1;
1786
1792
  typeof F.fixRequired > "u" && Qn(F), this._measure = (r) => {
1787
1793
  if (r.target !== this.config.root) {
@@ -1825,8 +1831,8 @@ class rs {
1825
1831
  const e = this.config.transitionDuration, n = this.config.transitionEasing || ((o) => o), s = performance.now();
1826
1832
  let i = !1;
1827
1833
  const r = (o) => {
1828
- const c = (o - this._startTime) / e, a = n(Math.min(1, c));
1829
- i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((l, [f, u]) => (f === "active" ? l[f] = u : l[f] = this.previousProgress[f] + (u - this.previousProgress[f]) * a, l), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(r), i = o - this._startTime > ss), this.effect.tick(this.currentProgress);
1834
+ const a = (o - this._startTime) / e, c = n(Math.min(1, a));
1835
+ i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((l, [f, u]) => (f === "active" ? l[f] = u : l[f] = this.previousProgress[f] + (u - this.previousProgress[f]) * c, l), this.currentProgress || {}), a < 1 && (this._nextTransitionTick = requestAnimationFrame(r), i = o - this._startTime > ss), this.effect.tick(this.currentProgress);
1830
1836
  };
1831
1837
  return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, r(s)) : this._startTime = s, this._nextTransitionTick;
1832
1838
  }
@@ -1869,55 +1875,68 @@ let tt = () => ({});
1869
1875
  function os(t) {
1870
1876
  tt = t;
1871
1877
  }
1872
- function cs(t, e, n, s = {}, { reducedMotion: i }) {
1878
+ function as(t, e, n, s = {}, { reducedMotion: i }) {
1873
1879
  if (i)
1874
1880
  return;
1875
1881
  const r = {
1876
1882
  trigger: "pointer-move",
1877
1883
  element: t,
1878
1884
  axis: s.axis ?? "y"
1879
- }, o = Ke(e, L(n), r);
1885
+ }, o = Be(e, q(n), r);
1880
1886
  if (o) {
1881
- const c = Array.isArray(o) ? o : [o], a = new rs({
1887
+ const a = Array.isArray(o) ? o : [o], c = new rs({
1882
1888
  root: s.hitArea === "self" ? t : void 0,
1883
- scenes: c,
1889
+ scenes: a,
1884
1890
  ...tt()
1885
1891
  }), f = { source: t, target: e, cleanup: () => {
1886
- a.destroy();
1892
+ c.destroy();
1887
1893
  } };
1888
- k(me, t, f), k(me, e, f), Promise.all(
1889
- c.map((u) => u.ready || Promise.resolve())
1894
+ C(me, t, f), C(me, e, f), Promise.all(
1895
+ a.map((u) => u.ready || Promise.resolve())
1890
1896
  ).then(() => {
1891
- a.start();
1897
+ c.start();
1892
1898
  });
1893
1899
  }
1894
1900
  }
1895
- function as(t) {
1896
- K(me, t);
1901
+ function cs(t) {
1902
+ B(me, t);
1897
1903
  }
1898
1904
  const fs = {
1899
- add: cs,
1900
- remove: as,
1905
+ add: as,
1906
+ remove: cs,
1901
1907
  registerOptionsGetter: os
1902
1908
  }, pe = /* @__PURE__ */ new WeakMap();
1903
- function ls(t, e, n, s, { reducedMotion: i, selectorCondition: r, animation: o }) {
1909
+ function ls(t, e, n, s, {
1910
+ reducedMotion: i,
1911
+ selectorCondition: r,
1912
+ animation: o,
1913
+ sourceAnimationOptions: a
1914
+ }) {
1904
1915
  const c = o || Y(
1905
1916
  e,
1906
- L(n),
1917
+ q(n),
1907
1918
  void 0,
1908
1919
  i
1909
1920
  );
1910
1921
  if (!c)
1911
1922
  return;
1912
- const a = () => {
1913
- r && !e.matches(r) || c.play();
1914
- }, f = { source: t, target: e, cleanup: () => {
1915
- c.cancel(), t.removeEventListener("animationend", a);
1923
+ const { effectId: l } = s, f = (g) => {
1924
+ if (r && !e.matches(r)) return;
1925
+ const p = g.animationName, m = g.detail?.effectId, h = a ? Ye(t, a) : null;
1926
+ if (h) {
1927
+ if (h.playState === "running" || p && !h.hasAnimationName(p))
1928
+ return;
1929
+ if (m && m !== l && !h.hasAnimationId(m))
1930
+ return;
1931
+ }
1932
+ c.play();
1933
+ }, d = { source: t, target: e, cleanup: () => {
1934
+ c.cancel(), t.removeEventListener("animationend", f);
1916
1935
  } };
1917
- k(pe, t, f), k(pe, e, f), t.addEventListener("animationend", a);
1936
+ C(pe, t, d), C(pe, e, d), t.addEventListener("animationend", f);
1918
1937
  }
1919
1938
  function us(t) {
1920
- K(pe, t);
1939
+ B(pe, t);
1921
1940
  }
1922
1941
  const ds = {
1923
1942
  add: ls,
@@ -1926,20 +1945,20 @@ const ds = {
1926
1945
  function hs(t, e, n = !1, s, i, r) {
1927
1946
  const o = r || Y(
1928
1947
  t,
1929
- L(e),
1948
+ q(e),
1930
1949
  void 0,
1931
1950
  n
1932
1951
  );
1933
1952
  if (!o)
1934
1953
  return null;
1935
- let c = !0;
1936
- const a = e.triggerType || "alternate";
1954
+ let a = !0;
1955
+ const c = e.triggerType || "alternate";
1937
1956
  return (l) => {
1938
1957
  if (s && !t.matches(s)) return;
1939
1958
  const f = !i, u = i?.enter?.includes(l.type), d = i?.leave?.includes(l.type);
1940
1959
  if (u || f) {
1941
- if (a === "alternate" || a === "state")
1942
- c ? (c = !1, o.play()) : a === "alternate" ? o.reverse() : a === "state" && (o.playState === "running" ? o.pause() : o.playState !== "finished" && o.play());
1960
+ if (c === "alternate" || c === "state")
1961
+ a ? (a = !1, o.play()) : c === "alternate" ? o.reverse() : c === "state" && (o.playState === "running" ? o.pause() : o.playState !== "finished" && o.play());
1943
1962
  else {
1944
1963
  if (o.progress(0), delete t.dataset.interactEnter, o.isCSS) {
1945
1964
  const g = () => {
@@ -1953,9 +1972,9 @@ function hs(t, e, n = !1, s, i, r) {
1953
1972
  }
1954
1973
  return;
1955
1974
  }
1956
- d && (a === "alternate" ? o.reverse() : a === "repeat" ? (o.cancel(), O.mutate(() => {
1975
+ d && (c === "alternate" ? o.reverse() : c === "repeat" ? (o.cancel(), O.mutate(() => {
1957
1976
  delete t.dataset.interactEnter;
1958
- })) : a === "state" && o.playState === "running" && o.pause());
1977
+ })) : c === "state" && o.playState === "running" && o.pause());
1959
1978
  };
1960
1979
  }
1961
1980
  function ms(t, e, {
@@ -1963,18 +1982,18 @@ function ms(t, e, {
1963
1982
  listContainer: s,
1964
1983
  listItemSelector: i,
1965
1984
  stateAction: r
1966
- }, o, c) {
1967
- const a = !!s, l = r ?? "toggle", f = l === "toggle";
1985
+ }, o, a) {
1986
+ const c = !!s, l = r ?? "toggle", f = l === "toggle";
1968
1987
  return (u) => {
1969
1988
  if (o && !t.matches(o)) return;
1970
- const d = a ? t.closest(
1989
+ const d = c ? t.closest(
1971
1990
  `${s} > ${i || ""}:has(:scope)`
1972
- ) : void 0, g = !c, p = c?.enter?.includes(u.type), m = c?.leave?.includes(u.type);
1991
+ ) : void 0, g = !a, p = a?.enter?.includes(u.type), m = a?.leave?.includes(u.type);
1973
1992
  g ? e.toggleEffect(n, l, d) : (p && e.toggleEffect(n, f ? "add" : l, d), m && f && e.toggleEffect(n, "remove", d));
1974
1993
  };
1975
1994
  }
1976
1995
  const ge = /* @__PURE__ */ new WeakMap();
1977
- function Re(t, e) {
1996
+ function Le(t, e) {
1978
1997
  return (n) => {
1979
1998
  const s = n;
1980
1999
  t.contains(s.relatedTarget) || e(s);
@@ -1993,8 +2012,8 @@ function gs(t) {
1993
2012
  };
1994
2013
  }
1995
2014
  const vs = {
1996
- focusin: (t, e) => Re(t, e),
1997
- focusout: (t, e) => Re(t, e),
2015
+ focusin: (t, e) => Le(t, e),
2016
+ focusout: (t, e) => Le(t, e),
1998
2017
  click: (t, e) => ps(e),
1999
2018
  keydown: (t, e) => gs(e)
2000
2019
  };
@@ -2026,9 +2045,9 @@ function Ts(t, e, n, s, {
2026
2045
  reducedMotion: i,
2027
2046
  targetController: r,
2028
2047
  selectorCondition: o,
2029
- animation: c
2048
+ animation: a
2030
2049
  }) {
2031
- const a = ws(s.eventConfig), l = n.transition || n.transitionProperties, f = Ss(a);
2050
+ const c = ws(s.eventConfig), l = n.transition || n.transitionProperties, f = Ss(c);
2032
2051
  let u, d = !1;
2033
2052
  if (l ? u = ms(
2034
2053
  e,
@@ -2042,7 +2061,7 @@ function Ts(t, e, n, s, {
2042
2061
  i,
2043
2062
  o,
2044
2063
  f,
2045
- c
2064
+ a
2046
2065
  ), d = n.triggerType === "once"), !u)
2047
2066
  return;
2048
2067
  const g = u, p = new AbortController();
@@ -2053,8 +2072,8 @@ function Ts(t, e, n, s, {
2053
2072
  const v = { source: t, target: e, cleanup: () => {
2054
2073
  p.abort();
2055
2074
  } };
2056
- if (k(ge, t, v), k(ge, e, v), f) {
2057
- const y = a.enter, E = a.leave;
2075
+ if (C(ge, t, v), C(ge, e, v), f) {
2076
+ const y = c.enter, E = c.leave;
2058
2077
  y.forEach((T) => {
2059
2078
  T === "focusin" && (t.tabIndex = 0), m(t, T, { passive: !0, once: d });
2060
2079
  });
@@ -2067,12 +2086,12 @@ function Ts(t, e, n, s, {
2067
2086
  m(t, T, { passive: !0 });
2068
2087
  });
2069
2088
  } else
2070
- (a.toggle ?? []).forEach((E) => {
2089
+ (c.toggle ?? []).forEach((E) => {
2071
2090
  m(t, E, { once: d, passive: E !== "keydown" });
2072
2091
  });
2073
2092
  }
2074
2093
  function Is(t) {
2075
- K(ge, t);
2094
+ B(ge, t);
2076
2095
  }
2077
2096
  const j = {
2078
2097
  add: Ts,
@@ -2085,19 +2104,19 @@ const j = {
2085
2104
  enter: ["mouseenter", "focusin"],
2086
2105
  leave: ["mouseleave", "focusout"]
2087
2106
  }
2088
- }, Fe = {
2107
+ }, Re = {
2089
2108
  click: ve.activate,
2090
2109
  hover: ve.interest
2091
2110
  };
2092
2111
  function Z(t) {
2093
2112
  const e = ve[t];
2094
2113
  return (n, s, i, r, o) => {
2095
- const c = o?.allowA11yTriggers && t in Fe ? Fe[t] : e;
2096
- j.add(n, s, i, { eventConfig: c }, o ?? {});
2114
+ const a = o?.allowA11yTriggers && t in Re ? Re[t] : e;
2115
+ j.add(n, s, i, { eventConfig: a }, o ?? {});
2097
2116
  };
2098
2117
  }
2099
- const M = {
2100
- viewEnter: _e,
2118
+ const x = {
2119
+ viewEnter: On,
2101
2120
  hover: {
2102
2121
  add: Z("hover"),
2103
2122
  remove: j.remove
@@ -2106,7 +2125,6 @@ const M = {
2106
2125
  add: Z("click"),
2107
2126
  remove: j.remove
2108
2127
  },
2109
- pageVisible: _e,
2110
2128
  animationEnd: ds,
2111
2129
  viewProgress: Vn,
2112
2130
  pointerMove: fs,
@@ -2142,7 +2160,7 @@ class b {
2142
2160
  if (typeof window > "u" || !window.customElements)
2143
2161
  return;
2144
2162
  const s = n?.useCustomElement ?? !!b.defineInteractElement;
2145
- this.dataCache = ks(e, s);
2163
+ this.dataCache = Cs(e, s);
2146
2164
  const i = b.defineInteractElement?.();
2147
2165
  s && i === !1 ? document.querySelectorAll("interact-element").forEach((r) => {
2148
2166
  r.connect();
@@ -2201,11 +2219,11 @@ class b {
2201
2219
  }), b.instances.length = 0, b.controllerCache.clear(), b.sequenceCache.clear(), b.elementSequenceMap = /* @__PURE__ */ new WeakMap();
2202
2220
  }
2203
2221
  static setup(e) {
2204
- e.scrollOptionsGetter && M.viewProgress.registerOptionsGetter?.(
2222
+ e.scrollOptionsGetter && x.viewProgress.registerOptionsGetter?.(
2205
2223
  e.scrollOptionsGetter
2206
- ), e.pointerOptionsGetter && M.pointerMove.registerOptionsGetter?.(
2224
+ ), e.pointerOptionsGetter && x.pointerMove.registerOptionsGetter?.(
2207
2225
  e.pointerOptionsGetter
2208
- ), e.viewEnter && M.viewEnter.setOptions(
2226
+ ), e.viewEnter && x.viewEnter.setOptions(
2209
2227
  e.viewEnter
2210
2228
  ), e.allowA11yTriggers !== void 0 && (b.allowA11yTriggers = e.allowA11yTriggers);
2211
2229
  }
@@ -2227,17 +2245,17 @@ class b {
2227
2245
  static getSequence(e, n, s, i) {
2228
2246
  const r = b.sequenceCache.get(e);
2229
2247
  if (r) return r;
2230
- const o = ln(n, s, i);
2248
+ const o = fn(n, s, i);
2231
2249
  return b.sequenceCache.set(e, o), b._registerSequenceElements(s, o), o;
2232
2250
  }
2233
2251
  static addToSequence(e, n, s, i) {
2234
2252
  const r = b.sequenceCache.get(e);
2235
2253
  if (!r) return !1;
2236
- const c = Be(n, i).map((a, l) => ({
2254
+ const a = Ke(n, i).map((c, l) => ({
2237
2255
  index: s[l] ?? r.animationGroups.length,
2238
- group: a
2256
+ group: c
2239
2257
  }));
2240
- return r.addGroups(c), b._registerSequenceElements(n, r), !0;
2258
+ return r.addGroups(a), b._registerSequenceElements(n, r), !0;
2241
2259
  }
2242
2260
  static _registerSequenceElements(e, n) {
2243
2261
  for (const { target: s } of e) {
@@ -2261,8 +2279,8 @@ class b {
2261
2279
  }
2262
2280
  }
2263
2281
  }
2264
- let Cs = 0;
2265
- function x(t, {
2282
+ let As = 0;
2283
+ function P(t, {
2266
2284
  asCombinator: e = !1,
2267
2285
  addItemFilter: n = !1,
2268
2286
  useFirstChild: s = !1
@@ -2274,7 +2292,7 @@ function x(t, {
2274
2292
  return t.selector;
2275
2293
  return s ? e ? "> :first-child" : ":scope > :first-child" : "";
2276
2294
  }
2277
- function Ne(t) {
2295
+ function Fe(t) {
2278
2296
  return "sequenceId" in t && !("effects" in t);
2279
2297
  }
2280
2298
  function le(t, e) {
@@ -2286,31 +2304,31 @@ function le(t, e) {
2286
2304
  selectors: /* @__PURE__ */ new Set()
2287
2305
  }), t[e];
2288
2306
  }
2289
- function ks(t, e = !1) {
2307
+ function Cs(t, e = !1) {
2290
2308
  const { effects: n = {}, sequences: s = {}, conditions: i = {} } = t, r = {};
2291
2309
  return t.interactions?.forEach((o) => {
2292
- const c = o.key, a = ++Cs, { effects: l, sequences: f, ...u } = o;
2293
- if (!c) {
2294
- console.error(`Interaction ${a} is missing a key for source element.`);
2310
+ const a = o.key, c = ++As, { effects: l, sequences: f, ...u } = o;
2311
+ if (!a) {
2312
+ console.error(`Interaction ${c} is missing a key for source element.`);
2295
2313
  return;
2296
2314
  }
2297
- le(r, c);
2315
+ le(r, a);
2298
2316
  const d = l ? Array.from(l) : [];
2299
2317
  d.reverse();
2300
2318
  const g = f?.map((h) => {
2301
- if (Ne(h)) {
2319
+ if (Fe(h)) {
2302
2320
  const y = s[h.sequenceId];
2303
2321
  return y ? { ...y, ...h } : (console.warn(`Interact: Sequence "${h.sequenceId}" not found in config`), h);
2304
2322
  }
2305
2323
  const v = h;
2306
- return v.sequenceId || (v.sequenceId = A()), v;
2324
+ return v.sequenceId || (v.sequenceId = k()), v;
2307
2325
  }), p = {
2308
2326
  ...u,
2309
2327
  effects: d.length > 0 ? d : void 0,
2310
2328
  sequences: g
2311
2329
  };
2312
- r[c].triggers.push(p), r[c].selectors.add(
2313
- x(p, { useFirstChild: e })
2330
+ r[a].triggers.push(p), r[a].selectors.add(
2331
+ P(p, { useFirstChild: e })
2314
2332
  );
2315
2333
  const m = p.listContainer;
2316
2334
  d.forEach((h) => {
@@ -2319,30 +2337,30 @@ function ks(t, e = !1) {
2319
2337
  const S = n[h.effectId];
2320
2338
  S && (v = S.key);
2321
2339
  }
2322
- h.effectId || (h.effectId = A()), v = v || c, h.key = v;
2340
+ h.effectId || (h.effectId = k()), v = v || a, h.key = v;
2323
2341
  const y = h.effectId;
2324
- if (m && h.listContainer && (v !== c || h.listContainer !== m))
2342
+ if (m && h.listContainer && (v !== a || h.listContainer !== m))
2325
2343
  return;
2326
- const E = `${c}::${v}::${y}::${a}`;
2327
- if (h.interactionId = E, r[c].interactionIds.add(E), v === c)
2344
+ const E = `${a}::${v}::${y}::${c}`;
2345
+ if (h.interactionId = E, r[a].interactionIds.add(E), v === a)
2328
2346
  return;
2329
2347
  const w = le(r, v);
2330
- w.effects[E] || (w.effects[E] = [], w.interactionIds.add(E)), w.effects[E].push({ ...u, effect: h }), w.selectors.add(x(h, { useFirstChild: e }));
2348
+ w.effects[E] || (w.effects[E] = [], w.interactionIds.add(E)), w.effects[E].push({ ...u, effect: h }), w.selectors.add(P(h, { useFirstChild: e }));
2331
2349
  }), g?.forEach((h) => {
2332
- if (!h || Ne(h)) return;
2333
- const v = h, y = v.sequenceId || A(), E = v.effects;
2350
+ if (!h || Fe(h)) return;
2351
+ const v = h, y = v.sequenceId || k(), E = v.effects;
2334
2352
  for (const w of E) {
2335
- w.effectId || (w.effectId = A());
2353
+ w.effectId || (w.effectId = k());
2336
2354
  let S = w.key;
2337
2355
  if (!S && w.effectId) {
2338
2356
  const I = n[w.effectId];
2339
2357
  I && (S = I.key);
2340
2358
  }
2341
- S = S || c;
2342
- const T = x(w, { useFirstChild: e });
2343
- if (T && r[c].selectors.add(T), S !== c) {
2344
- const I = le(r, S), C = `${S}::seq::${y}::${a}`;
2345
- I.sequences[C] || (I.sequences[C] = [], I.interactionIds.add(C)), I.sequences[C].push({
2359
+ S = S || a;
2360
+ const T = P(w, { useFirstChild: e });
2361
+ if (T && r[a].selectors.add(T), S !== a) {
2362
+ const I = le(r, S), A = `${S}::seq::${y}::${c}`;
2363
+ I.sequences[A] || (I.sequences[A] = [], I.interactionIds.add(A)), I.sequences[A].push({
2346
2364
  ...u,
2347
2365
  sequence: v
2348
2366
  }), I.selectors.add(T);
@@ -2372,47 +2390,49 @@ function ye(t, e, n) {
2372
2390
  function Ee(t, e) {
2373
2391
  return e.map((n) => t.selector ? n.querySelector(t.selector) : n).filter(Boolean);
2374
2392
  }
2375
- function nt(t, e, n, s, i, r, o, c) {
2393
+ function nt(t, e, n, s, i, r, o, a) {
2376
2394
  return [
2377
2395
  o ? Ee(t, o) : ye(t, n, s),
2378
- c ? Ee(e, c) : ye(e, i, r)
2396
+ a ? Ee(e, a) : ye(e, i, r)
2379
2397
  ];
2380
2398
  }
2381
- function st(t, e, n, s, i, r, o) {
2382
- const c = Array.isArray(s), a = Array.isArray(i);
2383
- c ? s.forEach((l, f) => {
2384
- const u = a ? i[f] : i;
2385
- u && ze(
2399
+ function st(t, e, n, s, i, r, o, a) {
2400
+ const c = Array.isArray(s), l = Array.isArray(i);
2401
+ c ? s.forEach((f, u) => {
2402
+ const d = l ? i[u] : i;
2403
+ d && Ne(
2386
2404
  t,
2387
- l,
2405
+ f,
2388
2406
  e.trigger,
2389
- u,
2407
+ d,
2390
2408
  n,
2391
2409
  e.params,
2392
2410
  r,
2393
- o
2411
+ o,
2412
+ a
2394
2413
  );
2395
- }) : (a ? i : [i]).forEach((f) => {
2396
- ze(
2414
+ }) : (l ? i : [i]).forEach((u) => {
2415
+ Ne(
2397
2416
  t,
2398
2417
  s,
2399
2418
  e.trigger,
2400
- f,
2419
+ u,
2401
2420
  n,
2402
2421
  e.params,
2403
2422
  r,
2404
- o
2423
+ o,
2424
+ a
2405
2425
  );
2406
2426
  });
2407
2427
  }
2408
2428
  function it(t, e, n, s, i) {
2409
2429
  const r = {}, o = [];
2410
- (s.effects || []).forEach((c) => {
2411
- const a = c.effectId, l = {
2412
- ...n.dataCache.effects[a] || {},
2413
- ...c,
2414
- effectId: a
2415
- }, f = l.key, u = $(c.interactionId, t);
2430
+ (s.effects || []).forEach((a) => {
2431
+ const c = a.effectId, l = {
2432
+ ...n.dataCache.effects[c] || {},
2433
+ ...a,
2434
+ effectId: c
2435
+ }, f = l.key, u = $(a.interactionId, t);
2416
2436
  if (r[u] || n.addedInteractions[u] && !i)
2417
2437
  return;
2418
2438
  const d = _(l.conditions || [], n.dataCache.conditions);
@@ -2440,7 +2460,7 @@ function it(t, e, n, s, i) {
2440
2460
  if (!m || !h)
2441
2461
  return;
2442
2462
  n.addedInteractions[u] = !0;
2443
- const v = g || s.key, y = P(
2463
+ const v = g || s.key, y = L(
2444
2464
  l.conditions || [],
2445
2465
  n.dataCache.conditions
2446
2466
  );
@@ -2451,22 +2471,23 @@ function it(t, e, n, s, i) {
2451
2471
  m,
2452
2472
  h,
2453
2473
  y,
2454
- p.useFirstChild
2474
+ p.useFirstChild,
2475
+ t
2455
2476
  ]);
2456
2477
  }
2457
- }), o.reverse().forEach((c) => {
2458
- st(...c);
2478
+ }), o.reverse().forEach((a) => {
2479
+ st(...a);
2459
2480
  }), $s(t, e, n, s, i);
2460
2481
  }
2461
- function As(t) {
2482
+ function ks(t) {
2462
2483
  return "sequenceId" in t && !("effects" in t);
2463
2484
  }
2464
2485
  function rt(t, e, n, s, i, r, o) {
2465
- const c = _(t.conditions || [], i.dataCache.conditions);
2466
- if (c && i.setupMediaQueryListener(e, c, r.updateKey, r.onUpdate), c && !c.matches) return null;
2467
- const a = t.effects || [], l = [];
2486
+ const a = _(t.conditions || [], i.dataCache.conditions);
2487
+ if (a && i.setupMediaQueryListener(e, a, r.updateKey, r.onUpdate), a && !a.matches) return null;
2488
+ const c = t.effects || [], l = [];
2468
2489
  let f = !1;
2469
- for (const u of a) {
2490
+ for (const u of c) {
2470
2491
  const d = u.effectId, p = {
2471
2492
  ...d ? i.dataCache.effects[d] || {} : {},
2472
2493
  ...u
@@ -2494,24 +2515,24 @@ function rt(t, e, n, s, i, r, o) {
2494
2515
  y.element,
2495
2516
  y.useFirstChild
2496
2517
  ), !w || Array.isArray(w) && w.length === 0) return null;
2497
- const S = L(p);
2518
+ const S = q(p);
2498
2519
  l.push({ target: w, options: S });
2499
2520
  }
2500
2521
  return o && !f ? null : l.length > 0 ? l : null;
2501
2522
  }
2502
2523
  function ot(t, e, n) {
2503
2524
  const r = (t.useFirstChild ? t.element.firstElementChild : t.element)?.querySelector(e);
2504
- if (!r) return n.map((c, a) => a);
2525
+ if (!r) return n.map((a, c) => c);
2505
2526
  const o = Array.from(r.children);
2506
- return n.map((c) => {
2507
- const a = o.indexOf(c);
2508
- return a >= 0 ? a : o.length;
2527
+ return n.map((a) => {
2528
+ const c = o.indexOf(a);
2529
+ return c >= 0 ? c : o.length;
2509
2530
  });
2510
2531
  }
2511
2532
  function $s(t, e, n, s, i) {
2512
2533
  s.sequences?.forEach((r) => {
2513
2534
  let o;
2514
- if (As(r)) {
2535
+ if (ks(r)) {
2515
2536
  const g = n.dataCache.sequences[r.sequenceId];
2516
2537
  if (!g) {
2517
2538
  console.warn(`Interact: Sequence "${r.sequenceId}" not found in cache`);
@@ -2520,11 +2541,11 @@ function $s(t, e, n, s, i) {
2520
2541
  o = { ...g, ...r };
2521
2542
  } else
2522
2543
  o = r;
2523
- const c = o.sequenceId || A(), a = $(`${t}::seq::${c}`, t);
2524
- if (n.addedInteractions[a] && !i) return;
2544
+ const a = o.sequenceId || k(), c = $(`${t}::seq::${a}`, t);
2545
+ if (n.addedInteractions[c] && !i) return;
2525
2546
  const l = i && s.listContainer ? { controllerKey: t, listContainer: s.listContainer, elements: i } : void 0, f = rt(
2526
2547
  o,
2527
- a,
2548
+ c,
2528
2549
  t,
2529
2550
  e,
2530
2551
  n,
@@ -2532,26 +2553,26 @@ function $s(t, e, n, s, i) {
2532
2553
  l
2533
2554
  );
2534
2555
  if (!f) return;
2535
- if (i && n.addedInteractions[a]) {
2556
+ if (i && n.addedInteractions[c]) {
2536
2557
  const g = ot(
2537
2558
  e,
2538
2559
  s.listContainer,
2539
2560
  i
2540
2561
  );
2541
- b.addToSequence(a, f, g, {
2562
+ b.addToSequence(c, f, g, {
2542
2563
  reducedMotion: b.forceReducedMotion
2543
2564
  });
2544
2565
  return;
2545
2566
  }
2546
- const u = b.getSequence(a, o, f, {
2567
+ const u = b.getSequence(c, o, f, {
2547
2568
  reducedMotion: b.forceReducedMotion
2548
2569
  });
2549
- n.addedInteractions[a] = !0;
2550
- const d = P(
2570
+ n.addedInteractions[c] = !0;
2571
+ const d = L(
2551
2572
  s.conditions || [],
2552
2573
  n.dataCache.conditions
2553
2574
  );
2554
- M[s.trigger]?.add(
2575
+ x[s.trigger]?.add(
2555
2576
  e.element,
2556
2577
  e.element,
2557
2578
  { triggerType: o.triggerType },
@@ -2567,8 +2588,8 @@ function $s(t, e, n, s, i) {
2567
2588
  }
2568
2589
  function _s(t, e, n, s, i) {
2569
2590
  const r = n.get(t)?.sequences || {};
2570
- Object.keys(r).forEach((c) => {
2571
- r[c].some(({ sequence: l, ...f }) => {
2591
+ Object.keys(r).forEach((a) => {
2592
+ r[a].some(({ sequence: l, ...f }) => {
2572
2593
  const u = _(
2573
2594
  f.conditions || [],
2574
2595
  n.dataCache.conditions
@@ -2578,7 +2599,7 @@ function _s(t, e, n, s, i) {
2578
2599
  const d = f.key && $(f.key, t), g = b.getController(d);
2579
2600
  if (!g)
2580
2601
  return !0;
2581
- const p = l.sequenceId || A(), m = $(`${d}::seq::${p}`, d);
2602
+ const p = l.sequenceId || k(), m = $(`${d}::seq::${p}`, d);
2582
2603
  if (n.addedInteractions[m] && !i)
2583
2604
  return !0;
2584
2605
  const v = rt(
@@ -2601,11 +2622,11 @@ function _s(t, e, n, s, i) {
2601
2622
  reducedMotion: b.forceReducedMotion
2602
2623
  });
2603
2624
  n.addedInteractions[m] = !0;
2604
- const E = P(
2625
+ const E = L(
2605
2626
  f.conditions || [],
2606
2627
  n.dataCache.conditions
2607
2628
  );
2608
- return M[f.trigger]?.add(
2629
+ return x[f.trigger]?.add(
2609
2630
  g.element,
2610
2631
  g.element,
2611
2632
  { triggerType: l.triggerType },
@@ -2620,9 +2641,9 @@ function _s(t, e, n, s, i) {
2620
2641
  });
2621
2642
  });
2622
2643
  }
2623
- function ct(t, e, n, s, i) {
2624
- const r = n.get(t), o = r?.effects || {}, c = Object.keys(o), a = [];
2625
- c.forEach((f) => {
2644
+ function at(t, e, n, s, i) {
2645
+ const r = n.get(t), o = r?.effects || {}, a = Object.keys(o), c = [];
2646
+ a.forEach((f) => {
2626
2647
  const u = $(f, t);
2627
2648
  if (n.addedInteractions[u] && !i)
2628
2649
  return;
@@ -2661,52 +2682,59 @@ function ct(t, e, n, s, i) {
2661
2682
  if (!S || !T)
2662
2683
  return !0;
2663
2684
  n.addedInteractions[u] = !0;
2664
- const I = P(
2685
+ const I = L(
2665
2686
  v.conditions || [],
2666
2687
  n.dataCache.conditions
2667
2688
  );
2668
- return a.push([
2689
+ return c.push([
2669
2690
  t,
2670
2691
  p,
2671
2692
  v,
2672
2693
  S,
2673
2694
  T,
2674
2695
  I,
2675
- e.useFirstChild
2696
+ e.useFirstChild,
2697
+ E || void 0
2676
2698
  ]), !0;
2677
2699
  }
2678
2700
  return !1;
2679
2701
  });
2680
- }), a.reverse().forEach((f) => {
2702
+ }), c.reverse().forEach((f) => {
2681
2703
  st(...f);
2682
2704
  }), _s(t, e, n, s, i);
2683
2705
  const l = Object.keys(r?.sequences || {}).length > 0;
2684
- return c.length > 0 || l;
2706
+ return a.length > 0 || l;
2685
2707
  }
2686
- function ze(t, e, n, s, i, r, o, c) {
2687
- let a;
2708
+ function Ne(t, e, n, s, i, r, o, a, c) {
2709
+ let l;
2688
2710
  if (i.transition || i.transitionProperties) {
2689
- const l = {
2711
+ const u = {
2690
2712
  key: t,
2691
2713
  effectId: i.effectId,
2692
2714
  transition: i.transition,
2693
2715
  transitionProperties: i.transitionProperties,
2694
- childSelector: x(i, {
2716
+ childSelector: P(i, {
2695
2717
  asCombinator: !0,
2696
2718
  addItemFilter: !0,
2697
- useFirstChild: c
2719
+ useFirstChild: a
2698
2720
  }),
2699
2721
  selectorCondition: o
2700
2722
  };
2701
- if (a = b.getController(t), !a)
2723
+ if (l = b.getController(t), !l)
2702
2724
  return;
2703
- a.renderStyle(gn(l));
2725
+ l.renderStyle(pn(u));
2726
+ }
2727
+ let f;
2728
+ if (n === "animationEnd") {
2729
+ const u = r.effectId, g = (c ? b.getInstance(c) : void 0)?.dataCache.effects[u];
2730
+ g && (f = q(g));
2704
2731
  }
2705
- M[n]?.add(e, s, i, r, {
2732
+ x[n]?.add(e, s, i, r, {
2706
2733
  reducedMotion: b.forceReducedMotion,
2707
- targetController: a,
2734
+ targetController: l,
2708
2735
  selectorCondition: o,
2709
- allowA11yTriggers: b.allowA11yTriggers
2736
+ allowA11yTriggers: b.allowA11yTriggers,
2737
+ sourceAnimationOptions: f
2710
2738
  });
2711
2739
  }
2712
2740
  function qs(t) {
@@ -2714,35 +2742,35 @@ function qs(t) {
2714
2742
  if (!n)
2715
2743
  return console.warn(`No instance found for key: ${e}`), b.setController(e, t), !1;
2716
2744
  const { triggers: s = [] } = n?.get(e) || {}, i = s.length > 0;
2717
- n.setController(e, t), s.forEach((o, c) => {
2718
- const a = _(o.conditions, n.dataCache.conditions);
2719
- if (a) {
2720
- const l = `${e}::trigger::${c}`;
2721
- n.setupMediaQueryListener(l, a, e, () => {
2745
+ n.setController(e, t), s.forEach((o, a) => {
2746
+ const c = _(o.conditions, n.dataCache.conditions);
2747
+ if (c) {
2748
+ const l = `${e}::trigger::${a}`;
2749
+ n.setupMediaQueryListener(l, c, e, () => {
2722
2750
  t.update();
2723
2751
  });
2724
2752
  }
2725
- (!a || a.matches) && (o.listContainer && t.watchChildList(o.listContainer), it(e, t, n, o));
2753
+ (!c || c.matches) && (o.listContainer && t.watchChildList(o.listContainer), it(e, t, n, o));
2726
2754
  });
2727
2755
  let r = !1;
2728
- return n && (r = ct(e, t, n)), i || r;
2756
+ return n && (r = at(e, t, n)), i || r;
2729
2757
  }
2730
2758
  function Ms(t, e, n) {
2731
2759
  const s = t.key, i = b.getInstance(s);
2732
2760
  if (i) {
2733
2761
  const { triggers: r = [] } = i?.get(s) || {};
2734
- r.forEach((o, c) => {
2762
+ r.forEach((o, a) => {
2735
2763
  if (o.listContainer !== e)
2736
2764
  return;
2737
- const a = _(o.conditions, i.dataCache.conditions);
2738
- if (a) {
2739
- const l = `${s}::listTrigger::${e}::${c}`;
2740
- i.setupMediaQueryListener(l, a, s, () => {
2765
+ const c = _(o.conditions, i.dataCache.conditions);
2766
+ if (c) {
2767
+ const l = `${s}::listTrigger::${e}::${a}`;
2768
+ i.setupMediaQueryListener(l, c, s, () => {
2741
2769
  t.update();
2742
2770
  });
2743
2771
  }
2744
- (!a || a.matches) && it(s, t, i, o, n);
2745
- }), ct(s, t, i, e, n);
2772
+ (!c || c.matches) && it(s, t, i, o, n);
2773
+ }), at(s, t, i, e, n);
2746
2774
  }
2747
2775
  }
2748
2776
  function xs(t, e = !1) {
@@ -2751,10 +2779,10 @@ function xs(t, e = !1) {
2751
2779
  return;
2752
2780
  const i = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
2753
2781
  let r;
2754
- i ? (r = [...t.element.querySelectorAll(i)], t.useFirstChild || r.push(t.element)) : r = [t.element], at(r), s.deleteController(n, e);
2782
+ i ? (r = [...t.element.querySelectorAll(i)], t.useFirstChild || r.push(t.element)) : r = [t.element], ct(r), s.deleteController(n, e);
2755
2783
  }
2756
- function at(t) {
2757
- const e = Object.values(M);
2784
+ function ct(t) {
2785
+ const e = Object.values(x);
2758
2786
  for (const n of t)
2759
2787
  for (const s of e)
2760
2788
  s.remove(n);
@@ -2836,12 +2864,12 @@ class Ps {
2836
2864
  _childListChangeHandler(e, n) {
2837
2865
  const s = this.key || this.element.dataset.interactKey, i = [], r = [];
2838
2866
  n.forEach((o) => {
2839
- o.removedNodes.forEach((c) => {
2840
- c instanceof HTMLElement && i.push(c);
2841
- }), o.addedNodes.forEach((c) => {
2842
- c instanceof HTMLElement && r.push(c);
2867
+ o.removedNodes.forEach((a) => {
2868
+ a instanceof HTMLElement && i.push(a);
2869
+ }), o.addedNodes.forEach((a) => {
2870
+ a instanceof HTMLElement && r.push(a);
2843
2871
  });
2844
- }), at(i), s && Ms(this, e, r);
2872
+ }), ct(i), s && Ms(this, e, r);
2845
2873
  }
2846
2874
  }
2847
2875
  function Us(t, e) {
@@ -2853,7 +2881,6 @@ function Xs(t) {
2853
2881
  }
2854
2882
  const ft = /* @__PURE__ */ new Map([
2855
2883
  ["viewEnter", "once"],
2856
- ["pageVisible", "once"],
2857
2884
  ["animationEnd", "once"],
2858
2885
  ["hover", "alternate"],
2859
2886
  ["click", "alternate"],
@@ -2861,16 +2888,16 @@ const ft = /* @__PURE__ */ new Map([
2861
2888
  ["interest", "alternate"]
2862
2889
  ]);
2863
2890
  function lt(t, e, n) {
2864
- const { effects: s = {}, conditions: i = {} } = n, { key: r, trigger: o } = e, c = o === "pointerMove";
2865
- t.effectId || (t.effectId = A());
2866
- const { effectId: a } = t, l = { ...s[a] || {}, ...t };
2891
+ const { effects: s = {}, conditions: i = {} } = n, { key: r, trigger: o } = e, a = o === "pointerMove";
2892
+ t.effectId || (t.effectId = k());
2893
+ const { effectId: c } = t, l = { ...s[c] || {}, ...t };
2867
2894
  let { key: f, conditions: u, triggerType: d } = l;
2868
2895
  if (!f) {
2869
2896
  if (!r)
2870
2897
  return null;
2871
2898
  f = r;
2872
2899
  }
2873
- if (dn(f))
2900
+ if (un(f))
2874
2901
  return null;
2875
2902
  u = [
2876
2903
  ...new Set((u || []).filter((w) => i[w]))
@@ -2879,41 +2906,41 @@ function lt(t, e, n) {
2879
2906
  ...l,
2880
2907
  key: f,
2881
2908
  conditions: u,
2882
- effectId: a,
2909
+ effectId: c,
2883
2910
  triggerType: d
2884
2911
  }, E = vt(e, y);
2885
2912
  if (g)
2886
- return c || !g.type ? null : { namedEffect: g, initial: E, ...y };
2913
+ return a || !g.type ? null : { namedEffect: g, initial: E, ...y };
2887
2914
  if (m) {
2888
2915
  if (!m.name) {
2889
- const w = a && !(s[a] && "keyframeEffect" in t);
2890
- m.name = w ? a : A();
2916
+ const w = c && !(s[c] && "keyframeEffect" in t);
2917
+ m.name = w ? c : k();
2891
2918
  }
2892
2919
  return { keyframeEffect: m, initial: E, ...y };
2893
- } else return p ? c ? null : { initial: E, ...y } : h ? { transition: h, initial: E, ...y } : v ? { transitionProperties: v, initial: E, ...y } : { initial: E, ...y };
2920
+ } else return p ? a ? null : { initial: E, ...y } : h ? { transition: h, initial: E, ...y } : v ? { transitionProperties: v, initial: E, ...y } : { initial: E, ...y };
2894
2921
  }
2895
2922
  function Ls(t, e, n) {
2896
2923
  const { sequences: s = {}, conditions: i = {} } = n;
2897
- t.sequenceId || (t.sequenceId = A());
2924
+ t.sequenceId || (t.sequenceId = k());
2898
2925
  const { sequenceId: r } = t, o = { ...s[r] || {}, ...t };
2899
2926
  let {
2900
- effects: c,
2901
- conditions: a,
2927
+ effects: a,
2928
+ conditions: c,
2902
2929
  triggerType: l,
2903
2930
  delay: f = 0,
2904
2931
  offset: u = 0,
2905
2932
  offsetEasing: d = "linear"
2906
2933
  } = o;
2907
- l || (l = ft.get(e.trigger)), a = [
2908
- ...new Set((a || []).filter((m) => i[m]))
2934
+ l || (l = ft.get(e.trigger)), c = [
2935
+ ...new Set((c || []).filter((m) => i[m]))
2909
2936
  ];
2910
- const g = c.map((m) => (m.conditions ? m.conditions.push(...a) : m.conditions = [...a], lt({ ...m, triggerType: l }, e, n)));
2911
- typeof d != "function" && (d = be(d) || ((m) => m)), pn(g, f, u, d);
2937
+ const g = a.map((m) => (m.conditions ? m.conditions.push(...c) : m.conditions = [...c], lt({ ...m, triggerType: l }, e, n)));
2938
+ typeof d != "function" && (d = be(d) || ((m) => m)), mn(g, f, u, d);
2912
2939
  const p = g.filter((m) => m !== null);
2913
2940
  return p.length ? {
2914
2941
  sequenceId: r,
2915
2942
  triggerType: l,
2916
- conditions: a,
2943
+ conditions: c,
2917
2944
  delay: f,
2918
2945
  offset: u,
2919
2946
  offsetEasing: d,
@@ -2937,9 +2964,9 @@ function Fs(t) {
2937
2964
  if (r > 1)
2938
2965
  return console.error("Offsets must be in the range [0,1]"), [];
2939
2966
  const o = i - n;
2940
- for (let c = n + 1; c < i; c++) {
2941
- const a = (c - n) / o;
2942
- e[c].offset = s + (r - s) * a;
2967
+ for (let a = n + 1; a < i; a++) {
2968
+ const c = (a - n) / o;
2969
+ e[a].offset = s + (r - s) * c;
2943
2970
  }
2944
2971
  n = i, s = r;
2945
2972
  }
@@ -2957,7 +2984,7 @@ function zs(t, e) {
2957
2984
  if (!n.length)
2958
2985
  return "";
2959
2986
  let s = n.map((i) => {
2960
- const r = i.offset, o = un(r * 100);
2987
+ const r = i.offset, o = ln(r * 100);
2961
2988
  return Ns(i, o);
2962
2989
  }).join(`
2963
2990
  `);
@@ -2966,17 +2993,25 @@ ${s}
2966
2993
  }`;
2967
2994
  }
2968
2995
  function Hs(t) {
2969
- const { key: e, childSelector: n, declarations: s, media: i, states: r, selectorCondition: o, addInitialSelector: c } = t;
2996
+ const {
2997
+ key: e,
2998
+ childSelector: n,
2999
+ declarations: s,
3000
+ media: i,
3001
+ states: r,
3002
+ selectorCondition: o,
3003
+ dataInteractEnterSelector: a
3004
+ } = t;
2970
3005
  if (!s.length)
2971
3006
  return "";
2972
- let a = `[data-interact-key="${e}"]${c ? ":is(:not([data-interact-enter]))" : ""}`;
3007
+ let c = `[data-interact-key="${e}"]`;
2973
3008
  if (r && r.length) {
2974
3009
  const u = r.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
2975
- a = `${a}:is(${u})`;
3010
+ c = `${c}:is(${u})`;
2976
3011
  }
2977
- n && (a = `${a} ${n}`), o && (a = te(a, o));
3012
+ n && (c = `${c} ${n}`), a && (c = `${c}${a}`), o && (c = te(c, o));
2978
3013
  const l = s.map(({ name: u, value: d }) => `${u}: ${d};`).join(`
2979
- `), f = `${a} {
3014
+ `), f = `${c} {
2980
3015
  ${l}
2981
3016
  }`;
2982
3017
  return i ? `@media ${i} {
@@ -2984,15 +3019,15 @@ ${f}
2984
3019
  }` : f;
2985
3020
  }
2986
3021
  function ut(t, e, n, s) {
2987
- const { key: i, childSelector: r, properties: o } = t, c = Object.entries(o).filter(
3022
+ const { key: i, childSelector: r, properties: o } = t, a = Object.entries(o).filter(
2988
3023
  (l) => l[1] && l[1].varNames.length
2989
3024
  ).map(([l, { fallback: f, varNames: u }]) => ({
2990
3025
  name: l,
2991
3026
  value: u.map((d) => `var(${d}, ${f})`).join(", ")
2992
- })), a = { key: i, childSelector: r, declarations: c };
2993
- return e && a.declarations.forEach((l) => {
3027
+ })), c = { key: i, childSelector: r, declarations: a };
3028
+ return e && c.declarations.forEach((l) => {
2994
3029
  l.name = e[l.name];
2995
- }), n && (a.media = ce(n, s || {}, "media"), a.selectorCondition = P(n, s || {})), a;
3030
+ }), n && (c.media = ae(n, s || {}, "media"), c.selectorCondition = L(n, s || {})), c;
2996
3031
  }
2997
3032
  const js = [
2998
3033
  { name: "visibility", value: "hidden" },
@@ -3022,15 +3057,15 @@ function dt(t, e, n) {
3022
3057
  s ? n.forEach((i) => s.add(i)) : t.set(e, new Set(n));
3023
3058
  }
3024
3059
  function ht(t, e, n, s) {
3025
- const { key: i, childSelector: r } = n, o = s ? we.filter((a) => s.has(a)) : we;
3060
+ const { key: i, childSelector: r } = n, o = s ? we.filter((c) => s.has(c)) : we;
3026
3061
  t.has(e) || t.set(e, { key: i, childSelector: r, properties: {} });
3027
- const { properties: c } = t.get(e);
3028
- for (const a of o)
3029
- c[a] || (c[a] = { fallback: ie[a], varNames: [] }), c[a].varNames.push(n[a]);
3062
+ const { properties: a } = t.get(e);
3063
+ for (const c of o)
3064
+ a[c] || (a[c] = { fallback: ie[c], varNames: [] }), a[c].varNames.push(n[c]);
3030
3065
  }
3031
3066
  function mt(t, e) {
3032
3067
  return we.reduce(
3033
- (n, s) => (n[s] = hn([s, ...t, e]), n),
3068
+ (n, s) => (n[s] = dn([s, ...t, e]), n),
3034
3069
  {}
3035
3070
  );
3036
3071
  }
@@ -3038,14 +3073,14 @@ function Gs(t, e, n, s, i) {
3038
3073
  return s.has(t) || s.set(t, {
3039
3074
  key: e,
3040
3075
  childSelector: i,
3041
- ...mt([n], He(t))
3076
+ ...mt([n], ze(t))
3042
3077
  }), s.get(t);
3043
3078
  }
3044
3079
  function Ws(t, e, n) {
3045
- return mt([e, n], He(t));
3080
+ return mt([e, n], ze(t));
3046
3081
  }
3047
3082
  function Vs(t, e, n, s = !0) {
3048
- const { key: i, conditions: r } = t, o = ce(r, e, "media"), c = P(r, e), a = x(t, {
3083
+ const { key: i, conditions: r } = t, o = ae(r, e, "media"), a = L(r, e), c = P(t, {
3049
3084
  asCombinator: !0,
3050
3085
  useFirstChild: s,
3051
3086
  addItemFilter: !0
@@ -3053,8 +3088,8 @@ function Vs(t, e, n, s = !0) {
3053
3088
  return {
3054
3089
  key: i,
3055
3090
  media: o,
3056
- selectorCondition: c,
3057
- childSelector: a,
3091
+ selectorCondition: a,
3092
+ childSelector: c,
3058
3093
  // invalidating earlier cascaded custom properties affected from earlier transitionEffects
3059
3094
  // to implement same-interaction-cascade
3060
3095
  declarations: [
@@ -3069,13 +3104,13 @@ function Ys(t, e, n, s, i) {
3069
3104
  const {
3070
3105
  key: r,
3071
3106
  effectId: o,
3072
- conditions: c,
3073
- namedEffect: a,
3107
+ conditions: a,
3108
+ namedEffect: c,
3074
3109
  keyframeEffect: l,
3075
3110
  transition: f,
3076
3111
  transitionProperties: u,
3077
3112
  initial: d
3078
- } = t, g = ce(c, e, "media"), p = P(c, e), m = [
3113
+ } = t, g = ae(a, e, "media"), p = L(a, e), m = [
3079
3114
  {
3080
3115
  key: r,
3081
3116
  media: g,
@@ -3087,9 +3122,9 @@ function Ys(t, e, n, s, i) {
3087
3122
  let h = [];
3088
3123
  const { declarations: v } = m[0];
3089
3124
  let y = [];
3090
- if (a || l) {
3125
+ if (c || l) {
3091
3126
  y = [...se];
3092
- const E = L(t), w = rn(null, E, s).filter(
3127
+ const E = q(t), w = rn(null, E, s).filter(
3093
3128
  (T) => T.name
3094
3129
  );
3095
3130
  h = w.map((T) => ({
@@ -3097,24 +3132,31 @@ function Ys(t, e, n, s, i) {
3097
3132
  keyframes: T.keyframes
3098
3133
  })), v.push(
3099
3134
  ...w.flatMap(
3100
- ({ custom: T }) => Object.entries(T || {}).filter(([I, C]) => C !== void 0).map(([I, C]) => ({ name: I, value: C }))
3135
+ ({ custom: T }) => Object.entries(T || {}).filter(([I, A]) => A !== void 0).map(([I, A]) => ({ name: I, value: A }))
3101
3136
  )
3102
3137
  );
3103
3138
  const S = se.map((T) => ({
3104
3139
  name: n[T],
3105
3140
  value: w.map((I) => {
3106
- const C = Ds[T];
3107
- return I[C];
3141
+ const A = Ds[T];
3142
+ return I[A];
3108
3143
  }).join(", ") || ie[T]
3109
3144
  }));
3110
- d ? m.push({
3145
+ d ? (m.push({
3146
+ key: r,
3147
+ media: g,
3148
+ selectorCondition: p,
3149
+ childSelector: i,
3150
+ declarations: js,
3151
+ dataInteractEnterSelector: ":not([data-interact-enter])"
3152
+ }), m.push({
3111
3153
  key: r,
3112
3154
  media: g,
3113
3155
  selectorCondition: p,
3114
3156
  childSelector: i,
3115
- declarations: S.concat(js),
3116
- addInitialSelector: !0
3117
- }) : v.push(...S);
3157
+ declarations: S,
3158
+ dataInteractEnterSelector: ':not([data-interact-enter="done"])'
3159
+ })) : v.push(...S);
3118
3160
  } else if (f || u) {
3119
3161
  y = ["transition"];
3120
3162
  const E = f?.styleProperties || u || [], w = Qe(t);
@@ -3138,8 +3180,8 @@ function Ys(t, e, n, s, i) {
3138
3180
  );
3139
3181
  return { rules: m.filter((E) => E.declarations.length), keyframes: h, usedProperties: y };
3140
3182
  }
3141
- function pt(t, e, n, s, i, r, o = !0, c, a) {
3142
- const { key: l } = n, f = a ?? G(n), u = x(n, {
3183
+ function pt(t, e, n, s, i, r, o = !0, a, c) {
3184
+ const { key: l } = n, f = c ?? G(n), u = P(n, {
3143
3185
  asCombinator: !0,
3144
3186
  useFirstChild: o,
3145
3187
  addItemFilter: !0
@@ -3150,7 +3192,7 @@ function pt(t, e, n, s, i, r, o = !0, c, a) {
3150
3192
  s,
3151
3193
  u
3152
3194
  ) };
3153
- c && Object.assign(g, c);
3195
+ a && Object.assign(g, a);
3154
3196
  const { rules: p, keyframes: m, usedProperties: h } = Ys(
3155
3197
  n,
3156
3198
  t,
@@ -3160,10 +3202,10 @@ function pt(t, e, n, s, i, r, o = !0, c, a) {
3160
3202
  );
3161
3203
  return m.forEach(({ name: v, keyframes: y }) => i.set(v, y)), { rules: p, usedProperties: h };
3162
3204
  }
3163
- function Ks(t, e, n, s, i, r, o = !0, c) {
3164
- const a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), f = [];
3205
+ function Bs(t, e, n, s, i, r, o = !0, a) {
3206
+ const c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), f = [];
3165
3207
  for (const d of n.effects) {
3166
- const g = G(d), { key: p } = d, m = x(d, {
3208
+ const g = G(d), { key: p } = d, m = P(d, {
3167
3209
  asCombinator: !0,
3168
3210
  useFirstChild: o,
3169
3211
  addItemFilter: !0
@@ -3183,27 +3225,27 @@ function Ks(t, e, n, s, i, r, o = !0, c) {
3183
3225
  f.push(...y);
3184
3226
  const w = new Set(E);
3185
3227
  ht(
3186
- a,
3228
+ c,
3187
3229
  g,
3188
3230
  { key: p, childSelector: m, ...v },
3189
3231
  w
3190
- ), c && dt(c, g, E);
3232
+ ), a && dt(a, g, E);
3191
3233
  }
3192
3234
  const { conditions: u } = n;
3193
- return a.forEach((d, g) => {
3235
+ return c.forEach((d, g) => {
3194
3236
  const p = s.get(g);
3195
3237
  f.push(ut(d, p, u, t));
3196
3238
  }), f;
3197
3239
  }
3198
- function Bs(t, e, n, s, i, r = !0) {
3199
- const { effects: o = [], sequences: c = [] } = e, a = t.conditions || {}, l = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), u = o.map((h) => lt(h, e, t)).filter((h) => h !== null), d = [], { trigger: g } = e, p = {
3200
- trigger: mn(g),
3240
+ function Ks(t, e, n, s, i, r = !0) {
3241
+ const { effects: o = [], sequences: a = [] } = e, c = t.conditions || {}, l = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), u = o.map((h) => lt(h, e, t)).filter((h) => h !== null), d = [], { trigger: g } = e, p = {
3242
+ trigger: hn(g),
3201
3243
  id: ["trigger", n].join("-")
3202
3244
  };
3203
- g === "viewProgress" && d.push(Vs(e, a, p.id, r));
3245
+ g === "viewProgress" && d.push(Vs(e, c, p.id, r));
3204
3246
  for (const h of u) {
3205
3247
  const v = G(h), { rules: y, usedProperties: E } = pt(
3206
- a,
3248
+ c,
3207
3249
  n,
3208
3250
  h,
3209
3251
  l,
@@ -3213,11 +3255,11 @@ function Bs(t, e, n, s, i, r = !0) {
3213
3255
  );
3214
3256
  d.push(...y), dt(f, v, E);
3215
3257
  }
3216
- const m = c.map((h) => Ls(h, e, t)).filter((h) => h !== null);
3258
+ const m = a.map((h) => Ls(h, e, t)).filter((h) => h !== null);
3217
3259
  return d.push(
3218
3260
  ...m.flatMap(
3219
- (h) => Ks(
3220
- a,
3261
+ (h) => Bs(
3262
+ c,
3221
3263
  n,
3222
3264
  h,
3223
3265
  l,
@@ -3238,7 +3280,7 @@ function Bs(t, e, n, s, i, r = !0) {
3238
3280
  }
3239
3281
  function Qs(t, e = !0) {
3240
3282
  const n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = t.interactions.flatMap(
3241
- (r, o) => Bs(t, r, o, n, s, e)
3283
+ (r, o) => Ks(t, r, o, n, s, e)
3242
3284
  );
3243
3285
  return n.forEach((r) => {
3244
3286
  i.push(ut(r));
@@ -3259,4 +3301,4 @@ export {
3259
3301
  Zs as g,
3260
3302
  Xs as r
3261
3303
  };
3262
- //# sourceMappingURL=index-CBaynReP.mjs.map
3304
+ //# sourceMappingURL=index-C79XXItl.mjs.map