@wix/motion 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/motion.js CHANGED
@@ -1,94 +1,104 @@
1
- class A {
1
+ class O {
2
2
  animations;
3
3
  options;
4
4
  ready;
5
5
  isCSS;
6
- constructor(t, n) {
7
- this.animations = t, this.options = n, this.ready = n?.measured || Promise.resolve(), this.isCSS = t[0] instanceof CSSAnimation;
6
+ constructor(e, n) {
7
+ this.animations = e, this.options = n, this.ready = n?.measured || Promise.resolve(), this.isCSS = e[0] instanceof CSSAnimation;
8
8
  }
9
9
  getProgress() {
10
10
  return this.animations[0]?.effect?.getComputedTiming().progress || 0;
11
11
  }
12
- async play(t) {
12
+ async play(e) {
13
13
  await this.ready;
14
14
  for (const n of this.animations)
15
15
  n.play();
16
- await Promise.all(this.animations.map((n) => n.ready)), t && t();
16
+ await Promise.all(this.animations.map((n) => n.ready)), e && e();
17
17
  }
18
18
  pause() {
19
- for (const t of this.animations)
20
- t.pause();
19
+ for (const e of this.animations)
20
+ e.pause();
21
21
  }
22
- async reverse(t) {
22
+ async reverse(e) {
23
23
  await this.ready;
24
24
  for (const n of this.animations)
25
25
  n.reverse();
26
- await Promise.all(this.animations.map((n) => n.ready)), t && t();
26
+ await Promise.all(this.animations.map((n) => n.ready)), e && e();
27
27
  }
28
- progress(t) {
28
+ progress(e) {
29
29
  for (const n of this.animations) {
30
- const { delay: i, duration: a, iterations: r } = n.effect.getTiming(), f = (Number.isFinite(a) ? a : 0) * (Number.isFinite(r) ? r : 1);
31
- n.currentTime = ((i || 0) + f) * t;
30
+ const { delay: i, duration: s, iterations: r } = n.effect.getTiming(), u = (Number.isFinite(s) ? s : 0) * (Number.isFinite(r) ? r : 1);
31
+ n.currentTime = ((i || 0) + u) * e;
32
32
  }
33
33
  }
34
34
  cancel() {
35
- for (const t of this.animations)
36
- t.cancel();
35
+ for (const e of this.animations)
36
+ e.cancel();
37
37
  }
38
- setPlaybackRate(t) {
38
+ setPlaybackRate(e) {
39
39
  for (const n of this.animations)
40
- n.playbackRate = t;
40
+ n.playbackRate = e;
41
41
  }
42
- async onFinish(t) {
42
+ async onFinish(e) {
43
43
  try {
44
44
  await Promise.all(this.animations.map((i) => i.finished));
45
45
  const n = this.animations[0];
46
46
  if (n && !this.isCSS) {
47
47
  const i = n.effect?.target;
48
48
  if (i) {
49
- const a = new Event("animationend");
50
- i.dispatchEvent(a);
49
+ const s = new Event("animationend");
50
+ i.dispatchEvent(s);
51
51
  }
52
52
  }
53
- t();
53
+ e();
54
54
  } catch (n) {
55
55
  console.warn("animation was interrupted - aborting onFinish callback - ", n);
56
56
  }
57
57
  }
58
58
  get finished() {
59
- return Promise.all(this.animations.map((t) => t.finished));
59
+ return Promise.all(this.animations.map((e) => e.finished));
60
60
  }
61
61
  get playState() {
62
62
  return this.animations[0]?.playState;
63
63
  }
64
+ getTimingOptions() {
65
+ return this.animations.map((e) => {
66
+ const n = e.effect?.getTiming(), i = n?.delay ?? 0, s = Number(n?.duration) || 0, r = n?.iterations ?? 1;
67
+ return {
68
+ delay: i,
69
+ duration: s,
70
+ iterations: r
71
+ };
72
+ });
73
+ }
64
74
  }
65
- const H = (e) => e, V = (e) => 1 - Math.cos(e * Math.PI / 2), W = (e) => Math.sin(e * Math.PI / 2), K = (e) => -(Math.cos(Math.PI * e) - 1) / 2, G = (e) => e ** 2, B = (e) => 1 - (1 - e) ** 2, J = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, U = (e) => e ** 3, Q = (e) => 1 - (1 - e) ** 3, X = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, Y = (e) => e ** 4, Z = (e) => 1 - (1 - e) ** 4, ee = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, te = (e) => e ** 5, ne = (e) => 1 - (1 - e) ** 5, ie = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, se = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), re = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), ae = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, oe = (e) => 1 - Math.sqrt(1 - e ** 2), ce = (e) => Math.sqrt(1 - (e - 1) ** 2), ue = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, fe = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, me = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, le = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, de = {
66
- linear: H,
67
- sineIn: V,
68
- sineOut: W,
75
+ const D = (t) => t, W = (t) => 1 - Math.cos(t * Math.PI / 2), B = (t) => Math.sin(t * Math.PI / 2), K = (t) => -(Math.cos(Math.PI * t) - 1) / 2, X = (t) => t ** 2, J = (t) => 1 - (1 - t) ** 2, U = (t) => t < 0.5 ? 2 * t ** 2 : 1 - (-2 * t + 2) ** 2 / 2, Y = (t) => t ** 3, Q = (t) => 1 - (1 - t) ** 3, Z = (t) => t < 0.5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2, tt = (t) => t ** 4, et = (t) => 1 - (1 - t) ** 4, nt = (t) => t < 0.5 ? 8 * t ** 4 : 1 - (-2 * t + 2) ** 4 / 2, it = (t) => t ** 5, st = (t) => 1 - (1 - t) ** 5, rt = (t) => t < 0.5 ? 16 * t ** 5 : 1 - (-2 * t + 2) ** 5 / 2, ot = (t) => t === 0 ? 0 : 2 ** (10 * t - 10), at = (t) => t === 1 ? 1 : 1 - 2 ** (-10 * t), ct = (t) => t === 0 ? 0 : t === 1 ? 1 : t < 0.5 ? 2 ** (20 * t - 10) / 2 : (2 - 2 ** (-20 * t + 10)) / 2, ut = (t) => 1 - Math.sqrt(1 - t ** 2), ft = (t) => Math.sqrt(1 - (t - 1) ** 2), lt = (t) => t < 0.5 ? (1 - Math.sqrt(1 - 4 * t ** 2)) / 2 : (Math.sqrt(-(2 * t - 3) * (2 * t - 1)) + 1) / 2, mt = (t) => 2.70158 * t ** 3 - 1.70158 * t ** 2, dt = (t) => 1 + 2.70158 * (t - 1) ** 3 + 1.70158 * (t - 1) ** 2, ht = (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, z = {
76
+ linear: D,
77
+ sineIn: W,
78
+ sineOut: B,
69
79
  sineInOut: K,
70
- quadIn: G,
71
- quadOut: B,
72
- quadInOut: J,
73
- cubicIn: U,
80
+ quadIn: X,
81
+ quadOut: J,
82
+ quadInOut: U,
83
+ cubicIn: Y,
74
84
  cubicOut: Q,
75
- cubicInOut: X,
76
- quartIn: Y,
77
- quartOut: Z,
78
- quartInOut: ee,
79
- quintIn: te,
80
- quintOut: ne,
81
- quintInOut: ie,
82
- expoIn: se,
83
- expoOut: re,
84
- expoInOut: ae,
85
- circIn: oe,
86
- circOut: ce,
87
- circInOut: ue,
88
- backIn: fe,
89
- backOut: me,
90
- backInOut: le
91
- }, z = {
85
+ cubicInOut: Z,
86
+ quartIn: tt,
87
+ quartOut: et,
88
+ quartInOut: nt,
89
+ quintIn: it,
90
+ quintOut: st,
91
+ quintInOut: rt,
92
+ expoIn: ot,
93
+ expoOut: at,
94
+ expoInOut: ct,
95
+ circIn: ut,
96
+ circOut: ft,
97
+ circInOut: lt,
98
+ backIn: mt,
99
+ backOut: dt,
100
+ backInOut: ht
101
+ }, F = {
92
102
  linear: "linear",
93
103
  ease: "ease",
94
104
  easeIn: "ease-in",
@@ -119,40 +129,197 @@ const H = (e) => e, V = (e) => 1 - Math.cos(e * Math.PI / 2), W = (e) => Math.si
119
129
  backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
120
130
  backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
121
131
  };
122
- function he(e) {
123
- return e === "percentage" ? "%" : e || "px";
132
+ function pt(t) {
133
+ return t === "percentage" ? "%" : t || "px";
134
+ }
135
+ function gt(t) {
136
+ return t ? F[t] || t : F.linear;
137
+ }
138
+ function bt(t, e, n, i) {
139
+ const s = 3 * t, r = 3 * (n - t) - s, u = 1 - s - r, a = 3 * e, l = 3 * (i - e) - a, m = 1 - a - l, o = (d) => ((u * d + r) * d + s) * d, c = (d) => ((m * d + l) * d + a) * d, f = (d) => (3 * u * d + 2 * r) * d + s;
140
+ function p(d) {
141
+ let h = d;
142
+ for (let b = 0; b < 8; b++) {
143
+ const y = o(h) - d;
144
+ if (Math.abs(y) < 1e-7) return h;
145
+ const _ = f(h);
146
+ if (Math.abs(_) < 1e-6) break;
147
+ h -= y / _;
148
+ }
149
+ let v = 0, g = 1;
150
+ for (h = (v + g) / 2; g - v > 1e-7; ) {
151
+ const b = o(h);
152
+ if (Math.abs(b - d) < 1e-7) return h;
153
+ d > b ? v = h : g = h, h = (v + g) / 2;
154
+ }
155
+ return h;
156
+ }
157
+ return (d) => d <= 0 ? 0 : d >= 1 ? 1 : c(p(d));
158
+ }
159
+ function yt(t) {
160
+ const e = t.match(
161
+ /^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/
162
+ );
163
+ if (!e) return;
164
+ const n = parseFloat(e[1]), i = parseFloat(e[2]), s = parseFloat(e[3]), r = parseFloat(e[4]);
165
+ if (![n, i, s, r].some(isNaN))
166
+ return bt(n, i, s, r);
167
+ }
168
+ function vt(t) {
169
+ const e = t.match(/^linear\((.+)\)$/);
170
+ if (!e) return;
171
+ const n = e[1].split(",").map((u) => u.trim()).filter(Boolean);
172
+ if (n.length === 0) return;
173
+ const i = [];
174
+ for (const u of n) {
175
+ const a = u.split(/\s+/), l = parseFloat(a[0]);
176
+ if (isNaN(l)) return;
177
+ const m = [];
178
+ for (let o = 1; o < a.length; o++)
179
+ if (a[o].endsWith("%")) {
180
+ const c = parseFloat(a[o]) / 100;
181
+ if (isNaN(c)) return;
182
+ m.push(c);
183
+ }
184
+ m.length === 0 ? i.push({ output: l, pos: null }) : m.length === 1 ? i.push({ output: l, pos: m[0] }) : (i.push({ output: l, pos: m[0] }), i.push({ output: l, pos: m[1] }));
185
+ }
186
+ if (i.length === 0) return;
187
+ i[0].pos === null && (i[0].pos = 0), i[i.length - 1].pos === null && (i[i.length - 1].pos = 1);
188
+ let s = 0;
189
+ for (; s < i.length; )
190
+ if (i[s].pos === null) {
191
+ const u = s - 1;
192
+ let a = s;
193
+ for (; a < i.length && i[a].pos === null; ) a++;
194
+ const l = i[u].pos, m = i[a].pos, o = a - u;
195
+ for (let c = u + 1; c < a; c++)
196
+ i[c].pos = l + (m - l) * (c - u) / o;
197
+ s = a + 1;
198
+ } else
199
+ s++;
200
+ for (let u = 1; u < i.length; u++)
201
+ i[u].pos < i[u - 1].pos && (i[u].pos = i[u - 1].pos);
202
+ const r = i;
203
+ return (u) => {
204
+ if (u <= r[0].pos) return r[0].output;
205
+ const a = r[r.length - 1];
206
+ if (u >= a.pos) return a.output;
207
+ let l = 0, m = r.length - 1;
208
+ for (; l < m - 1; ) {
209
+ const f = l + m >>> 1;
210
+ r[f].pos <= u ? l = f : m = f;
211
+ }
212
+ const o = r[l], c = r[m];
213
+ return c.pos === o.pos ? c.output : o.output + (c.output - o.output) * (u - o.pos) / (c.pos - o.pos);
214
+ };
124
215
  }
125
- function ge(e) {
126
- return e ? z[e] || e : z.linear;
216
+ function R(t) {
217
+ if (!t) return;
218
+ const e = z[t];
219
+ return e || (yt(t) ?? vt(t) ?? z.linear);
127
220
  }
128
- function be(e) {
129
- return e ? de[e] : void 0;
221
+ class Et extends O {
222
+ animationGroups;
223
+ delay;
224
+ offset;
225
+ offsetEasing;
226
+ timingOptions;
227
+ constructor(e, n = {}) {
228
+ const i = e.flatMap((s) => [...s.animations]);
229
+ super(i), this.animationGroups = e, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : R(n.offsetEasing) ?? D, this.timingOptions = this.animationGroups.map((s) => s.getTimingOptions().map(({ delay: r, duration: u, iterations: a }) => ({
230
+ delay: r,
231
+ duration: Number.isFinite(u) ? u : 0,
232
+ iterations: Number.isFinite(a) ? a : 1
233
+ }))), this.applyOffsets(), this.ready = Promise.all(e.map((s) => s.ready)).then(() => {
234
+ });
235
+ }
236
+ /**
237
+ * Calculates stagger delay offsets for each animation group using the formula:
238
+ * easing(i / last) * last * offset
239
+ * where i is the group index and last is the index of the final group.
240
+ */
241
+ calculateOffsets() {
242
+ const e = this.animationGroups.length;
243
+ if (e <= 1) return [0];
244
+ const n = e - 1;
245
+ return Array.from(
246
+ { length: e },
247
+ (i, s) => this.offsetEasing(s / n) * n * this.offset | 0
248
+ );
249
+ }
250
+ applyOffsets() {
251
+ const e = this.calculateOffsets(), n = this.getSequenceActiveDuration(e);
252
+ this.animationGroups.forEach((i, s) => {
253
+ i.animations.forEach((r, u) => {
254
+ const a = r.effect;
255
+ if (!a) return;
256
+ const { delay: l, duration: m, iterations: o } = this.timingOptions[s][u], c = l + e[s], f = n - (c + m * o);
257
+ a.updateTiming({ delay: c + this.delay, endDelay: f });
258
+ });
259
+ });
260
+ }
261
+ getSequenceActiveDuration(e) {
262
+ const n = [];
263
+ for (let i = 0; i < this.timingOptions.length; i++) {
264
+ const s = this.timingOptions[i].reduce((r, u) => {
265
+ if (!u) return r;
266
+ const { delay: a, duration: l, iterations: m } = u;
267
+ return Math.max(r, a + l * m);
268
+ }, 0);
269
+ n.push(e[i] + s);
270
+ }
271
+ return Math.max(...n);
272
+ }
273
+ /**
274
+ * Inserts new AnimationGroups at specified indices, then recalculates
275
+ * stagger offsets for all groups. Each entry specifies the target index
276
+ * in the animationGroups array where the group should be inserted.
277
+ */
278
+ addGroups(e) {
279
+ if (e.length === 0) return;
280
+ const n = [...e].sort((i, s) => s.index - i.index);
281
+ for (const { index: i, group: s } of n) {
282
+ const r = Math.min(i, this.animationGroups.length);
283
+ this.animationGroups.splice(r, 0, s), this.timingOptions.splice(r, 0, s.getTimingOptions());
284
+ const u = [...s.animations], a = this.animationGroups.slice(0, r).reduce((l, m) => l + m.animations.length, 0);
285
+ this.animations.splice(a, 0, ...u);
286
+ }
287
+ this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((i) => i.ready)).then(() => {
288
+ });
289
+ }
290
+ async onFinish(e) {
291
+ try {
292
+ await Promise.all(this.animationGroups.map((n) => n.finished)), e();
293
+ } catch (n) {
294
+ console.warn("animation was interrupted - aborting onFinish callback - ", n);
295
+ }
296
+ }
130
297
  }
131
- class pe {
298
+ class _t {
132
299
  _animation;
133
300
  customEffect;
134
301
  progress;
135
302
  _tickCbId;
136
303
  _finishHandler;
137
- constructor(t, n, i, a) {
304
+ constructor(e, n, i, s) {
138
305
  const r = new KeyframeEffect(n, [], {
139
306
  ...i,
140
307
  composite: "add"
141
- }), { timeline: f } = a;
142
- this._animation = new Animation(r, f), this._tickCbId = null, this.progress = null, this.customEffect = (u) => t(r.target, u), this._finishHandler = (u) => {
143
- this.effect.target?.getAnimations().find((m) => m === this._animation) || this.cancel();
308
+ }), { timeline: u } = s;
309
+ this._animation = new Animation(r, u), this._tickCbId = null, this.progress = null, this.customEffect = (a) => e(r.target, a), this._finishHandler = (a) => {
310
+ this.effect.target?.getAnimations().find((l) => l === this._animation) || this.cancel();
144
311
  }, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
145
312
  }
146
313
  // private tick method for customEffect loop implementation
147
314
  _tick() {
148
315
  try {
149
- const t = this.effect?.getComputedTiming().progress ?? null;
150
- t !== this.progress && (this.customEffect?.(t), this.progress = t), this._tickCbId = requestAnimationFrame(() => {
316
+ const e = this.effect?.getComputedTiming().progress ?? null;
317
+ e !== this.progress && (this.customEffect?.(e), this.progress = e), this._tickCbId = requestAnimationFrame(() => {
151
318
  this._tick();
152
319
  });
153
- } catch (t) {
320
+ } catch (e) {
154
321
  this._tickCbId = null, console.error(
155
- `failed to run customEffect! effectId: ${this.id}, error: ${t instanceof Error ? t.message : t}`
322
+ `failed to run customEffect! effectId: ${this.id}, error: ${e instanceof Error ? e.message : e}`
156
323
  );
157
324
  }
158
325
  }
@@ -160,39 +327,39 @@ class pe {
160
327
  get currentTime() {
161
328
  return this._animation.currentTime;
162
329
  }
163
- set currentTime(t) {
164
- this._animation.currentTime = t;
330
+ set currentTime(e) {
331
+ this._animation.currentTime = e;
165
332
  }
166
333
  get startTime() {
167
334
  return this._animation.startTime;
168
335
  }
169
- set startTime(t) {
170
- this._animation.startTime = t;
336
+ set startTime(e) {
337
+ this._animation.startTime = e;
171
338
  }
172
339
  get playbackRate() {
173
340
  return this._animation.playbackRate;
174
341
  }
175
- set playbackRate(t) {
176
- this._animation.playbackRate = t;
342
+ set playbackRate(e) {
343
+ this._animation.playbackRate = e;
177
344
  }
178
345
  // Animation basic properties
179
346
  get id() {
180
347
  return this._animation.id;
181
348
  }
182
- set id(t) {
183
- this._animation.id = t;
349
+ set id(e) {
350
+ this._animation.id = e;
184
351
  }
185
352
  get effect() {
186
353
  return this._animation.effect;
187
354
  }
188
- set effect(t) {
189
- this._animation.effect = t;
355
+ set effect(e) {
356
+ this._animation.effect = e;
190
357
  }
191
358
  get timeline() {
192
359
  return this._animation.timeline;
193
360
  }
194
- set timeline(t) {
195
- this._animation.timeline = t;
361
+ set timeline(e) {
362
+ this._animation.timeline = e;
196
363
  }
197
364
  // Animation readonly state properties
198
365
  get finished() {
@@ -214,20 +381,20 @@ class pe {
214
381
  get oncancel() {
215
382
  return this._animation.oncancel;
216
383
  }
217
- set oncancel(t) {
218
- this._animation.oncancel = t;
384
+ set oncancel(e) {
385
+ this._animation.oncancel = e;
219
386
  }
220
387
  get onfinish() {
221
388
  return this._animation.onfinish;
222
389
  }
223
- set onfinish(t) {
224
- this._animation.onfinish = t;
390
+ set onfinish(e) {
391
+ this._animation.onfinish = e;
225
392
  }
226
393
  get onremove() {
227
394
  return this._animation.onremove;
228
395
  }
229
- set onremove(t) {
230
- this._animation.onremove = t;
396
+ set onremove(e) {
397
+ this._animation.onremove = e;
231
398
  }
232
399
  // CustomAnimation overridden methods
233
400
  play() {
@@ -254,37 +421,37 @@ class pe {
254
421
  reverse() {
255
422
  this._animation.reverse();
256
423
  }
257
- updatePlaybackRate(t) {
258
- this._animation.updatePlaybackRate(t);
424
+ updatePlaybackRate(e) {
425
+ this._animation.updatePlaybackRate(e);
259
426
  }
260
427
  // Animation events API
261
- addEventListener(t, n, i) {
262
- this._animation.addEventListener(t, n, i);
428
+ addEventListener(e, n, i) {
429
+ this._animation.addEventListener(e, n, i);
263
430
  }
264
- removeEventListener(t, n, i) {
265
- this._animation.removeEventListener(t, n, i);
431
+ removeEventListener(e, n, i) {
432
+ this._animation.removeEventListener(e, n, i);
266
433
  }
267
- dispatchEvent(t) {
268
- return this._animation.dispatchEvent(t);
434
+ dispatchEvent(e) {
435
+ return this._animation.dispatchEvent(e);
269
436
  }
270
437
  }
271
- function ye(e) {
272
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
438
+ function wt(t) {
439
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
273
440
  }
274
- var I = { exports: {} }, C = I.exports, x;
275
- function ve() {
276
- return x || (x = 1, (function(e) {
277
- (function(t) {
441
+ var A = { exports: {} }, C = A.exports, x;
442
+ function It() {
443
+ return x || (x = 1, (function(t) {
444
+ (function(e) {
278
445
  var n = function() {
279
- }, i = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(s) {
280
- return setTimeout(s, 16);
446
+ }, i = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.msRequestAnimationFrame || function(o) {
447
+ return setTimeout(o, 16);
281
448
  };
282
- function a() {
283
- var s = this;
284
- s.reads = [], s.writes = [], s.raf = i.bind(t);
449
+ function s() {
450
+ var o = this;
451
+ o.reads = [], o.writes = [], o.raf = i.bind(e);
285
452
  }
286
- a.prototype = {
287
- constructor: a,
453
+ s.prototype = {
454
+ constructor: s,
288
455
  /**
289
456
  * We run this inside a try catch
290
457
  * so that if any jobs error, we
@@ -293,8 +460,8 @@ function ve() {
293
460
  *
294
461
  * @param {Array} tasks
295
462
  */
296
- runTasks: function(s) {
297
- for (var o; o = s.shift(); ) o();
463
+ runTasks: function(o) {
464
+ for (var c; c = o.shift(); ) c();
298
465
  },
299
466
  /**
300
467
  * Adds a job to the read batch and
@@ -304,9 +471,9 @@ function ve() {
304
471
  * @param {Object} ctx the context to be bound to `fn` (optional).
305
472
  * @public
306
473
  */
307
- measure: function(s, o) {
308
- var c = o ? s.bind(o) : s;
309
- return this.reads.push(c), r(this), c;
474
+ measure: function(o, c) {
475
+ var f = c ? o.bind(c) : o;
476
+ return this.reads.push(f), r(this), f;
310
477
  },
311
478
  /**
312
479
  * Adds a job to the
@@ -317,9 +484,9 @@ function ve() {
317
484
  * @param {Object} ctx the context to be bound to `fn` (optional).
318
485
  * @public
319
486
  */
320
- mutate: function(s, o) {
321
- var c = o ? s.bind(o) : s;
322
- return this.writes.push(c), r(this), c;
487
+ mutate: function(o, c) {
488
+ var f = c ? o.bind(c) : o;
489
+ return this.writes.push(f), r(this), f;
323
490
  },
324
491
  /**
325
492
  * Clears a scheduled 'read' or 'write' task.
@@ -328,8 +495,8 @@ function ve() {
328
495
  * @return {Boolean} success
329
496
  * @public
330
497
  */
331
- clear: function(s) {
332
- return u(this.reads, s) || u(this.writes, s);
498
+ clear: function(o) {
499
+ return a(this.reads, o) || a(this.writes, o);
333
500
  },
334
501
  /**
335
502
  * Extend this FastDom with some
@@ -365,385 +532,410 @@ function ve() {
365
532
  * @param {Object} props properties to mixin
366
533
  * @return {FastDom}
367
534
  */
368
- extend: function(s) {
369
- if (typeof s != "object") throw new Error("expected object");
370
- var o = Object.create(this);
371
- return m(o, s), o.fastdom = this, o.initialize && o.initialize(), o;
535
+ extend: function(o) {
536
+ if (typeof o != "object") throw new Error("expected object");
537
+ var c = Object.create(this);
538
+ return l(c, o), c.fastdom = this, c.initialize && c.initialize(), c;
372
539
  },
373
540
  // override this with a function
374
541
  // to prevent Errors in console
375
542
  // when tasks throw
376
543
  catch: null
377
544
  };
378
- function r(s) {
379
- s.scheduled || (s.scheduled = !0, s.raf(f.bind(null, s)));
545
+ function r(o) {
546
+ o.scheduled || (o.scheduled = !0, o.raf(u.bind(null, o)));
380
547
  }
381
- function f(s) {
382
- var o = s.writes, c = s.reads, d;
548
+ function u(o) {
549
+ var c = o.writes, f = o.reads, p;
383
550
  try {
384
- n("flushing reads", c.length), s.runTasks(c), n("flushing writes", o.length), s.runTasks(o);
385
- } catch (h) {
386
- d = h;
551
+ n("flushing reads", f.length), o.runTasks(f), n("flushing writes", c.length), o.runTasks(c);
552
+ } catch (d) {
553
+ p = d;
387
554
  }
388
- if (s.scheduled = !1, (c.length || o.length) && r(s), d)
389
- if (n("task errored", d.message), s.catch) s.catch(d);
390
- else throw d;
555
+ if (o.scheduled = !1, (f.length || c.length) && r(o), p)
556
+ if (n("task errored", p.message), o.catch) o.catch(p);
557
+ else throw p;
391
558
  }
392
- function u(s, o) {
393
- var c = s.indexOf(o);
394
- return !!~c && !!s.splice(c, 1);
559
+ function a(o, c) {
560
+ var f = o.indexOf(c);
561
+ return !!~f && !!o.splice(f, 1);
395
562
  }
396
- function m(s, o) {
397
- for (var c in o)
398
- o.hasOwnProperty(c) && (s[c] = o[c]);
563
+ function l(o, c) {
564
+ for (var f in c)
565
+ c.hasOwnProperty(f) && (o[f] = c[f]);
399
566
  }
400
- var l = t.fastdom = t.fastdom || new a();
401
- e.exports = l;
567
+ var m = e.fastdom = e.fastdom || new s();
568
+ t.exports = m;
402
569
  })(typeof window < "u" ? window : typeof C < "u" ? C : globalThis);
403
- })(I)), I.exports;
570
+ })(A)), A.exports;
404
571
  }
405
- var _e = ve();
406
- const g = /* @__PURE__ */ ye(_e), T = {};
407
- function Se(e) {
408
- Object.assign(T, e);
572
+ var Ot = It();
573
+ const E = /* @__PURE__ */ wt(Ot), $ = {};
574
+ function Nt(t) {
575
+ Object.assign($, t);
409
576
  }
410
- function Ee(e) {
411
- return e in T ? T[e] : (console.warn(
412
- `${e} not found in registry. Please make sure to import and register the preset.`
577
+ function At(t) {
578
+ return t in $ ? $[t] : (console.warn(
579
+ `${t} not found in registry. Please make sure to import and register the preset.`
413
580
  ), null);
414
581
  }
415
- function y(e, t) {
416
- return e ? (t || document).getElementById(e) : null;
582
+ function w(t, e) {
583
+ return t ? (e || document).getElementById(t) : null;
417
584
  }
418
- function Ie(e, t) {
419
- return e?.matches(`[data-motion-part~="${t}"]`) ? e : e?.querySelector(`[data-motion-part~="${t}"]`);
585
+ function kt(t, e) {
586
+ return t?.matches(`[data-motion-part~="${e}"]`) ? t : t?.querySelector(`[data-motion-part~="${e}"]`);
420
587
  }
421
- function we(e) {
422
- const t = e.alternate ? "alternate" : "";
423
- return e.reversed ? `${t ? `${t}-` : ""}reverse` : t || "normal";
588
+ function Tt(t) {
589
+ const e = t.alternate ? "alternate" : "";
590
+ return t.reversed ? `${e ? `${e}-` : ""}reverse` : e || "normal";
424
591
  }
425
- function O(e) {
426
- return `${e.value}${he(e.unit)}`;
592
+ function T(t) {
593
+ return `${t.value}${pt(t.unit)}`;
427
594
  }
428
- function F(e, t, n) {
429
- return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${O(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${O(e.offset)} + ${t})` : O(e.offset)}`;
595
+ function M(t, e, n) {
596
+ return `${t.name || "cover"} ${n && t.offset.unit !== "percentage" ? `calc(100% + ${T(t.offset)}${e ? ` + ${e}` : ""})` : e ? `calc(${T(t.offset)} + ${e})` : T(t.offset)}`;
430
597
  }
431
- function R(e) {
598
+ function G(t) {
432
599
  return {
433
- start: F(e.startOffset, e.startOffsetAdd),
434
- end: F(e.endOffset, e.endOffsetAdd, !0)
600
+ start: M(t.startOffset, t.startOffsetAdd),
601
+ end: M(t.endOffset, t.endOffsetAdd, !0)
435
602
  };
436
603
  }
437
- function N(e) {
438
- return (t) => g.measure(() => t(e));
604
+ function L(t) {
605
+ return (e) => E.measure(() => e(t));
439
606
  }
440
- function L(e) {
441
- return (t) => g.mutate(() => t(e));
607
+ function j(t) {
608
+ return (e) => E.mutate(() => e(t));
442
609
  }
443
- function E(e) {
444
- if (e.namedEffect) {
445
- const t = e.namedEffect.type;
446
- return typeof t == "string" ? Ee(t) : null;
447
- } else if (e.keyframeEffect) {
448
- const t = (i) => {
449
- const { name: a, keyframes: r } = i.keyframeEffect;
450
- return [{ ...i, name: a, keyframes: r }];
610
+ function I(t) {
611
+ if (t.namedEffect) {
612
+ const e = t.namedEffect.type;
613
+ return typeof e == "string" ? At(e) : null;
614
+ } else if (t.keyframeEffect) {
615
+ const e = (i) => {
616
+ const { name: s, keyframes: r } = i.keyframeEffect;
617
+ return [{ ...i, name: s, keyframes: r }];
451
618
  };
452
- return { web: t, style: t, getNames: (i) => {
453
- const { effectId: a } = i, { name: r } = i.keyframeEffect, f = r || a;
454
- return f ? [f] : [];
619
+ return { web: e, style: e, getNames: (i) => {
620
+ const { effectId: s } = i, { name: r } = i.keyframeEffect, u = r || s;
621
+ return u ? [u] : [];
455
622
  } };
456
- } else if (e.customEffect)
457
- return (t) => [{ ...t, keyframes: [] }];
623
+ } else if (t.customEffect)
624
+ return (e) => [{ ...e, keyframes: [] }];
458
625
  return null;
459
626
  }
460
- function D(e, t, n) {
461
- return e.map((i, a) => {
627
+ function H(t, e, n) {
628
+ return t.map((i, s) => {
462
629
  const r = {
463
630
  fill: i.fill,
464
- easing: ge(i.easing),
631
+ easing: gt(i.easing),
465
632
  iterations: i.iterations === 0 ? 1 / 0 : i.iterations || 1,
466
633
  composite: i.composite,
467
- direction: we(i)
634
+ direction: Tt(i)
468
635
  };
469
- return q(t) ? (r.duration = i.duration, r.delay = i.delay || 0) : window.ViewTimeline && t?.trigger === "view-progress" ? r.duration = "auto" : (r.duration = 99.99, r.delay = 0.01), {
636
+ return q(e) ? (r.duration = i.duration, r.delay = i.delay || 0) : window.ViewTimeline && e?.trigger === "view-progress" ? r.duration = "auto" : (r.duration = 99.99, r.delay = 0.01), {
470
637
  effect: i,
471
638
  options: r,
472
- id: n && `${n}-${a + 1}`,
639
+ id: n && `${n}-${s + 1}`,
473
640
  part: i.part
474
641
  };
475
642
  });
476
643
  }
477
- function q(e) {
478
- return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
644
+ function q(t) {
645
+ return !t || t.trigger !== "pointer-move" && t.trigger !== "view-progress";
479
646
  }
480
- function M(e, t, n, i, a) {
481
- if (e) {
482
- if (q(i) && (t.duration = t.duration || 1, a?.reducedMotion))
483
- if (t.iterations === 1 || t.iterations == null)
484
- t = { ...t, duration: 1 };
647
+ function N(t, e, n, i, s) {
648
+ if (t) {
649
+ if (q(i) && (e.duration = e.duration || 1, s?.reducedMotion))
650
+ if (e.iterations === 1 || e.iterations == null)
651
+ e = { ...e, duration: 1 };
485
652
  else
486
653
  return [];
487
654
  let r;
488
- return n instanceof HTMLElement && (r = { measure: N(n), mutate: L(n) }), e.web ? e.web(t, r, a) : e(t, r, a);
655
+ return n instanceof HTMLElement && (r = { measure: L(n), mutate: j(n) }), t.web ? t.web(e, r, s) : t(e, r, s);
489
656
  }
490
657
  return [];
491
658
  }
492
- function j(e, t, n, i, a) {
493
- const r = e instanceof HTMLElement ? e : y(e, a);
494
- if (n?.trigger === "pointer-move" && !t.keyframeEffect) {
495
- let c = t;
496
- t.customEffect && (c = {
497
- ...t,
659
+ function V(t, e, n, i, s) {
660
+ const r = t instanceof HTMLElement ? t : w(t, s);
661
+ if (n?.trigger === "pointer-move" && !e.keyframeEffect) {
662
+ let f = e;
663
+ e.customEffect && (f = {
664
+ ...e,
498
665
  namedEffect: { id: "", type: "CustomMouse" }
499
666
  });
500
- const d = E(
501
- c
502
- ), h = M(
503
- d,
504
- t,
667
+ const p = I(
668
+ f
669
+ ), d = N(
670
+ p,
671
+ e,
505
672
  r,
506
673
  n,
507
674
  i
508
675
  );
509
- return typeof h != "function" ? null : h(r);
676
+ return typeof d != "function" ? null : d(r);
510
677
  }
511
- const f = E(t), u = M(
512
- f,
513
- t,
678
+ const u = I(e), a = N(
679
+ u,
680
+ e,
514
681
  r,
515
682
  n,
516
683
  i
517
684
  );
518
- if (!u || u.length === 0)
685
+ if (!a || a.length === 0)
519
686
  return null;
520
- const m = D(u, n, t.effectId);
521
- let l;
522
- const s = n?.trigger === "view-progress";
523
- s && window.ViewTimeline && (l = new ViewTimeline({
524
- subject: n.element || y(n.componentId)
687
+ const l = H(a, n, e.effectId);
688
+ let m;
689
+ const o = n?.trigger === "view-progress";
690
+ o && window.ViewTimeline && (m = new ViewTimeline({
691
+ subject: n.element || w(n.componentId)
525
692
  }));
526
- const o = m.map(({ effect: c, options: d, id: h, part: v }) => {
527
- const w = v ? Ie(r, v) : r, b = new KeyframeEffect(w || null, [], d);
528
- g.mutate(() => {
529
- "timing" in c && b.updateTiming(c.timing), b.setKeyframes(c.keyframes);
693
+ const c = l.map(({ effect: f, options: p, id: d, part: h }) => {
694
+ const v = h ? kt(r, h) : r, g = new KeyframeEffect(v || null, [], p);
695
+ E.mutate(() => {
696
+ "timing" in f && g.updateTiming(f.timing), g.setKeyframes(f.keyframes);
530
697
  });
531
- const _ = s && l ? { timeline: l } : {}, p = typeof c.customEffect == "function" ? new pe(
532
- c.customEffect,
533
- w || null,
534
- d,
535
- _
536
- ) : new Animation(b, _.timeline);
537
- if (s)
538
- if (l)
539
- g.mutate(() => {
540
- const { start: $, end: k } = R(c);
541
- p.rangeStart = $, p.rangeEnd = k, p.play();
698
+ const b = o && m ? { timeline: m } : {}, y = typeof f.customEffect == "function" ? new _t(
699
+ f.customEffect,
700
+ v || null,
701
+ p,
702
+ b
703
+ ) : new Animation(g, b.timeline);
704
+ if (o)
705
+ if (m)
706
+ E.mutate(() => {
707
+ const { start: _, end: k } = G(f);
708
+ y.rangeStart = _, y.rangeEnd = k, y.play();
542
709
  });
543
710
  else {
544
- const { startOffset: $, endOffset: k } = t;
545
- g.mutate(() => {
546
- const S = c.startOffset || $, P = c.endOffset || k;
547
- Object.assign(p, {
711
+ const { startOffset: _, endOffset: k } = e;
712
+ E.mutate(() => {
713
+ const S = f.startOffset || _, P = f.endOffset || k;
714
+ Object.assign(y, {
548
715
  start: {
549
716
  name: S.name,
550
717
  offset: S.offset?.value,
551
- add: c.startOffsetAdd
718
+ add: f.startOffsetAdd
552
719
  },
553
720
  end: {
554
721
  name: P.name,
555
722
  offset: P.offset?.value,
556
- add: c.endOffsetAdd
723
+ add: f.endOffsetAdd
557
724
  }
558
725
  });
559
726
  });
560
727
  }
561
- return h && (p.id = h), p;
728
+ return d && (y.id = d), y;
562
729
  });
563
- return new A(o, {
564
- ...t,
730
+ return new O(c, {
731
+ ...e,
565
732
  trigger: { ...n || {} },
566
733
  // make sure the group is ready after all animation targets are measured and mutated
567
- measured: new Promise((c) => g.mutate(c))
734
+ measured: new Promise((f) => E.mutate(f))
568
735
  });
569
736
  }
570
- function $e(e, t) {
571
- return e ? `#${e}${t ? `[data-motion-part~="${t}"]` : ""}` : "";
737
+ function $t(t, e) {
738
+ return t ? `#${t}${e ? `[data-motion-part~="${e}"]` : ""}` : "";
572
739
  }
573
- function ke(e, t) {
574
- const { duration: n, delay: i, iterations: a = 1, fill: r, easing: f = "linear", direction: u } = e.options, m = e.effect.name, l = n === "auto";
575
- return `${m} ${l ? "auto" : `${n}ms`}${l ? " " : ` ${i || 1}ms `}${f}${r && r !== "none" ? ` ${r}` : ""} ${!a || a === 1 / 0 ? "infinite" : a}${u === "normal" ? "" : ` ${u}`} ${t ? "" : "paused"}`;
740
+ function qt(t, e) {
741
+ const { duration: n, delay: i, iterations: s = 1, fill: r, easing: u = "linear", direction: a } = t.options, l = t.effect.name, m = n === "auto";
742
+ return `${l} ${m ? "auto" : `${n}ms`}${m ? " " : ` ${i || 1}ms `}${u}${r && r !== "none" ? ` ${r}` : ""} ${!s || s === 1 / 0 ? "infinite" : s}${a === "normal" ? "" : ` ${a}`} ${e ? "" : "paused"}`;
576
743
  }
577
- function Oe(e, t, n) {
578
- return e?.style ? (q(n) && (t.duration = t.duration || 1), e.style(t)) : [];
744
+ function St(t, e, n) {
745
+ return t?.style ? (q(n) && (e.duration = e.duration || 1), t.style(e)) : [];
579
746
  }
580
- function Pe(e, t, n) {
581
- const i = E(t), a = Oe(i, t), r = D(a, n, t.effectId), f = n?.trigger === "view-progress";
582
- return r.map((u, m) => {
583
- const { start: l, end: s } = f ? R(u.effect) : {};
747
+ function Dt(t, e, n) {
748
+ const i = I(e), s = St(i, e), r = H(s, n, e.effectId), u = n?.trigger === "view-progress";
749
+ return r.map((a, l) => {
750
+ const { start: m, end: o } = u ? G(a.effect) : {};
584
751
  return {
585
- target: $e(e, u.part),
586
- animation: ke(u, f),
587
- composition: u.options.composite,
588
- custom: u.effect.custom,
589
- name: u.effect.name,
590
- keyframes: u.effect.keyframes,
591
- id: u.id && `${u.id}-${m + 1}`,
592
- animationTimeline: f ? `--${n?.id}` : "",
593
- animationRange: l || s ? `${l} ${s}` : ""
752
+ target: $t(t, a.part),
753
+ animation: qt(a, u),
754
+ composition: a.options.composite,
755
+ custom: a.effect.custom,
756
+ name: a.effect.name,
757
+ keyframes: a.effect.keyframes,
758
+ id: a.id && `${a.id}-${l + 1}`,
759
+ animationTimeline: u ? `--${n?.id}` : "",
760
+ animationRange: m || o ? `${m} ${o}` : ""
594
761
  };
595
762
  });
596
763
  }
597
- function Te(e, t, n) {
598
- const i = E(t), a = e instanceof HTMLElement ? e : y(e);
599
- if (i && i.prepare && a) {
600
- const r = { measure: N(a), mutate: L(a) };
601
- i.prepare(t, r);
764
+ function Pt(t, e, n) {
765
+ const i = I(e), s = t instanceof HTMLElement ? t : w(t);
766
+ if (i && i.prepare && s) {
767
+ const r = { measure: L(s), mutate: j(s) };
768
+ i.prepare(e, r);
602
769
  }
603
- n && g.mutate(n);
770
+ n && E.mutate(n);
604
771
  }
605
- function Ae(e, t) {
606
- const n = E(t);
772
+ function zt(t, e) {
773
+ const n = I(e);
607
774
  if (!n)
608
775
  return null;
609
776
  if (!n.style)
610
- return t.effectId && e ? qe(e, t.effectId) : null;
611
- const i = n.getNames(t), r = (typeof e == "string" ? y(e) : e)?.getAnimations(), f = r?.map((m) => m.animationName) || [], u = [];
612
- return i.forEach((m) => {
613
- f.includes(m) && u.push(
614
- r?.find((l) => l.animationName === m)
777
+ return e.effectId && t ? Ft(t, e.effectId) : null;
778
+ const i = n.getNames(e), r = (typeof t == "string" ? w(t) : t)?.getAnimations(), u = r?.map((l) => l.animationName) || [], a = [];
779
+ return i.forEach((l) => {
780
+ u.includes(l) && a.push(
781
+ r?.find((m) => m.animationName === l)
615
782
  );
616
- }), u?.length ? new A(u) : null;
783
+ }), a?.length ? new O(a) : null;
617
784
  }
618
- function qe(e, t) {
619
- const i = (typeof e == "string" ? y(e) : e)?.getAnimations().filter((a) => {
620
- const r = a.id || a.animationName;
621
- return r ? r.startsWith(t) : !0;
785
+ function Ft(t, e) {
786
+ const i = (typeof t == "string" ? w(t) : t)?.getAnimations().filter((s) => {
787
+ const r = s.id || s.animationName;
788
+ return r ? r.startsWith(e) : !0;
622
789
  });
623
- return i?.length ? new A(i) : null;
790
+ return i?.length ? new O(i) : null;
624
791
  }
625
- function ze(e, t, n, i = {}) {
626
- const { disabled: a, allowActiveEvent: r, ...f } = i, u = j(e, t, n, f);
627
- if (!u)
792
+ function Rt(t, e, n, i = {}) {
793
+ const { disabled: s, allowActiveEvent: r, ...u } = i, a = V(t, e, n, u);
794
+ if (!a)
628
795
  return null;
629
- let m = {};
796
+ let l = {};
630
797
  if (n.trigger === "view-progress" && !window.ViewTimeline) {
631
- const l = n.element || y(n.componentId), { ready: s } = u;
632
- return u.animations.map((o) => ({
798
+ const m = n.element || w(n.componentId), { ready: o } = a;
799
+ return a.animations.map((c) => ({
633
800
  /* we use getters for start and end in order to access the animation's start and end
634
801
  only when initializing the scrub scene rather than immediately */
635
802
  get start() {
636
- return o.start;
803
+ return c.start;
637
804
  },
638
805
  get end() {
639
- return o.end;
806
+ return c.end;
640
807
  },
641
- viewSource: l,
642
- ready: s,
808
+ viewSource: m,
809
+ ready: o,
643
810
  getProgress() {
644
- return u.getProgress();
811
+ return a.getProgress();
645
812
  },
646
- effect(c, d) {
647
- const { activeDuration: h } = o.effect.getComputedTiming(), { delay: v } = o.effect.getTiming();
648
- o.currentTime = ((v || 0) + (h || 0)) * d;
813
+ effect(f, p) {
814
+ const { activeDuration: d } = c.effect.getComputedTiming(), { delay: h } = c.effect.getTiming();
815
+ c.currentTime = ((h || 0) + (d || 0)) * p;
649
816
  },
650
- disabled: a,
817
+ disabled: s,
651
818
  destroy() {
652
- o.cancel();
819
+ c.cancel();
653
820
  }
654
821
  }));
655
822
  } else if (n.trigger === "pointer-move") {
656
- const l = t, { centeredToTarget: s, transitionDuration: o, transitionEasing: c } = l, d = n.axis;
657
- if (l.keyframeEffect) {
658
- const h = u;
659
- return h.animations?.length === 0 ? null : {
823
+ const m = e, { centeredToTarget: o, transitionDuration: c, transitionEasing: f } = m, p = n.axis;
824
+ if (m.keyframeEffect) {
825
+ const d = a;
826
+ return d.animations?.length === 0 ? null : {
660
827
  target: void 0,
661
- centeredToTarget: s,
662
- ready: h.ready,
828
+ centeredToTarget: o,
829
+ ready: d.ready,
663
830
  _currentProgress: 0,
664
831
  getProgress() {
665
832
  return this._currentProgress;
666
833
  },
667
- effect(w, b) {
668
- const _ = d === "x" ? b.x : b.y;
669
- this._currentProgress = _, h.progress(_);
834
+ effect(v, g) {
835
+ const b = p === "x" ? g.x : g.y;
836
+ this._currentProgress = b, d.progress(b);
670
837
  },
671
- disabled: a ?? !1,
838
+ disabled: s ?? !1,
672
839
  destroy() {
673
- h.cancel();
840
+ d.cancel();
674
841
  }
675
842
  };
676
843
  }
677
- m = {
678
- centeredToTarget: s,
844
+ l = {
845
+ centeredToTarget: o,
679
846
  allowActiveEvent: r
680
- }, t.customEffect && o && (m.transitionDuration = o, m.transitionEasing = be(c)), m.target = u.target;
847
+ }, e.customEffect && c && (l.transitionDuration = c, l.transitionEasing = R(f)), l.target = a.target;
681
848
  }
682
849
  return {
683
- ...m,
850
+ ...l,
684
851
  getProgress() {
685
- return u.getProgress();
852
+ return a.getProgress();
686
853
  },
687
- effect(l, s, o, c) {
688
- u.progress(
689
- o ? {
854
+ effect(m, o, c, f) {
855
+ a.progress(
856
+ c ? {
690
857
  // @ts-expect-error spread error on p
691
- ...s,
692
- v: o,
693
- active: c
694
- } : s
858
+ ...o,
859
+ v: c,
860
+ active: f
861
+ } : o
695
862
  );
696
863
  },
697
- disabled: a,
864
+ disabled: s,
698
865
  destroy() {
699
- u.cancel();
866
+ a.cancel();
700
867
  }
701
868
  };
702
869
  }
703
- function Ce(e, t, n, i = !1) {
704
- const a = Ae(e, t);
705
- return a ? (a.ready = new Promise((r) => {
706
- Te(e, t, r);
707
- }), a) : j(e, t, n, { reducedMotion: i });
870
+ function Ct(t, e, n, i = !1) {
871
+ const s = zt(t, e);
872
+ return s ? (s.ready = new Promise((r) => {
873
+ Pt(t, e, r);
874
+ }), s) : V(t, e, n, { reducedMotion: i });
875
+ }
876
+ function xt(t) {
877
+ return t === null ? [null] : typeof t == "string" ? Array.from(document.querySelectorAll(t)) : Array.isArray(t) ? t : [t];
878
+ }
879
+ function Mt(t, e) {
880
+ const n = [];
881
+ for (const { target: i, options: s } of t) {
882
+ const r = xt(i);
883
+ for (const u of r) {
884
+ const a = Ct(
885
+ u,
886
+ s,
887
+ void 0,
888
+ e?.reducedMotion
889
+ );
890
+ a instanceof O && n.push(a);
891
+ }
892
+ }
893
+ return n;
894
+ }
895
+ function Gt(t, e, n) {
896
+ const i = Mt(e, n);
897
+ return new Et(i, t);
708
898
  }
709
899
  export {
710
- fe as backIn,
711
- le as backInOut,
712
- me as backOut,
713
- oe as circIn,
714
- ue as circInOut,
715
- ce as circOut,
716
- z as cssEasings,
717
- U as cubicIn,
718
- X as cubicInOut,
900
+ mt as backIn,
901
+ ht as backInOut,
902
+ dt as backOut,
903
+ ut as circIn,
904
+ lt as circInOut,
905
+ ft as circOut,
906
+ Mt as createAnimationGroups,
907
+ F as cssEasings,
908
+ Y as cubicIn,
909
+ Z as cubicInOut,
719
910
  Q as cubicOut,
720
- se as expoIn,
721
- ae as expoInOut,
722
- re as expoOut,
723
- Ce as getAnimation,
724
- Pe as getCSSAnimation,
725
- he as getCssUnits,
726
- ge as getEasing,
727
- qe as getElementAnimation,
728
- Ae as getElementCSSAnimation,
729
- be as getJsEasing,
730
- ze as getScrubScene,
731
- j as getWebAnimation,
732
- de as jsEasings,
733
- H as linear,
734
- Te as prepareAnimation,
735
- G as quadIn,
736
- J as quadInOut,
737
- B as quadOut,
738
- Y as quartIn,
739
- ee as quartInOut,
740
- Z as quartOut,
741
- te as quintIn,
742
- ie as quintInOut,
743
- ne as quintOut,
744
- Se as registerEffects,
745
- V as sineIn,
911
+ ot as expoIn,
912
+ ct as expoInOut,
913
+ at as expoOut,
914
+ Ct as getAnimation,
915
+ Dt as getCSSAnimation,
916
+ pt as getCssUnits,
917
+ gt as getEasing,
918
+ Ft as getElementAnimation,
919
+ zt as getElementCSSAnimation,
920
+ R as getJsEasing,
921
+ Rt as getScrubScene,
922
+ Gt as getSequence,
923
+ V as getWebAnimation,
924
+ z as jsEasings,
925
+ D as linear,
926
+ Pt as prepareAnimation,
927
+ X as quadIn,
928
+ U as quadInOut,
929
+ J as quadOut,
930
+ tt as quartIn,
931
+ nt as quartInOut,
932
+ et as quartOut,
933
+ it as quintIn,
934
+ rt as quintInOut,
935
+ st as quintOut,
936
+ Nt as registerEffects,
937
+ W as sineIn,
746
938
  K as sineInOut,
747
- W as sineOut
939
+ B as sineOut
748
940
  };
749
941
  //# sourceMappingURL=motion.js.map