@ssgoi/core 7.3.0-beta.1 → 7.3.0-beta.2

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.
@@ -2,7 +2,7 @@ var ht = Object.defineProperty;
2
2
  var ct = (s, r, t) => r in s ? ht(s, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[r] = t;
3
3
  var h = (s, r, t) => ct(s, typeof r != "symbol" ? r + "" : r, t);
4
4
  import { A as ut, c as K, a as dt, r as pt, i as ft, s as mt, I as gt } from "./provider-BLf6XeXT.js";
5
- const D = {
5
+ const j = {
6
6
  reason: "finished",
7
7
  owns: () => !0
8
8
  };
@@ -60,15 +60,6 @@ class st extends ut {
60
60
  throw new Error("This animation does not support replacing its integrator");
61
61
  }
62
62
  }
63
- function yt(s) {
64
- return new Promise((r) => {
65
- requestAnimationFrame(() => {
66
- requestAnimationFrame(() => {
67
- r();
68
- });
69
- });
70
- });
71
- }
72
63
  const H = [1, 0, 0, 1, 0, 0], it = (s, r) => [
73
64
  s[0] * r[0] + s[2] * r[1],
74
65
  s[1] * r[0] + s[3] * r[1],
@@ -89,13 +80,13 @@ function G(s) {
89
80
  ];
90
81
  }
91
82
  const I = (s, r) => [1, 0, 0, 1, s, r], U = (s, r) => [s, 0, 0, r, 0, 0];
92
- function vt(s, r, t) {
83
+ function yt(s, r, t) {
93
84
  if (!s || s === "none") return [...H];
94
85
  let e = [...H];
95
86
  const i = /([a-zA-Z][a-zA-Z0-9]*)\(([^()]*)\)/g;
96
- let o = "";
87
+ let a = "";
97
88
  for (const c of s.matchAll(i)) {
98
- o += c[0];
89
+ a += c[0];
99
90
  const d = c[1].toLowerCase(), u = c[2].trim().split(/\s*,\s*|\s+/);
100
91
  if (u.some(
101
92
  (n) => !/^[-+]?(?:\d*\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?(?:px|%|deg|rad|turn)?$/i.test(
@@ -103,38 +94,38 @@ function vt(s, r, t) {
103
94
  )
104
95
  ))
105
96
  return null;
106
- const p = u.map(Number.parseFloat);
107
- if (p.some((n) => !Number.isFinite(n))) return null;
97
+ const m = u.map(Number.parseFloat);
98
+ if (m.some((n) => !Number.isFinite(n))) return null;
108
99
  const g = (n, y) => {
109
- var l;
110
- return p[n] * ((l = u[n]) != null && l.endsWith("%") ? y / 100 : 1);
111
- }, f = (n) => {
112
- var y, l;
113
- return p[n] * ((y = u[n]) != null && y.endsWith("rad") ? 1 : (l = u[n]) != null && l.endsWith("turn") ? 2 * Math.PI : Math.PI / 180);
100
+ var o;
101
+ return m[n] * ((o = u[n]) != null && o.endsWith("%") ? y / 100 : 1);
102
+ }, p = (n) => {
103
+ var y, o;
104
+ return m[n] * ((y = u[n]) != null && y.endsWith("rad") ? 1 : (o = u[n]) != null && o.endsWith("turn") ? 2 * Math.PI : Math.PI / 180);
114
105
  };
115
- let a;
116
- if (d === "matrix" && p.length === 6) a = p;
106
+ let l;
107
+ if (d === "matrix" && m.length === 6) l = m;
117
108
  else if (d === "translate" || d === "translate3d") {
118
- if (d === "translate3d" && p[2] !== 0) return null;
119
- a = I(g(0, r), u[1] ? g(1, t) : 0);
120
- } else if (d === "translatex") a = I(g(0, r), 0);
121
- else if (d === "translatey") a = I(0, g(0, t));
122
- else if (d === "translatez" && p[0] === 0) a = [...H];
123
- else if (d === "scale") a = U(p[0], p[1] ?? p[0]);
124
- else if (d === "scalex") a = U(p[0], 1);
125
- else if (d === "scaley") a = U(1, p[0]);
109
+ if (d === "translate3d" && m[2] !== 0) return null;
110
+ l = I(g(0, r), u[1] ? g(1, t) : 0);
111
+ } else if (d === "translatex") l = I(g(0, r), 0);
112
+ else if (d === "translatey") l = I(0, g(0, t));
113
+ else if (d === "translatez" && m[0] === 0) l = [...H];
114
+ else if (d === "scale") l = U(m[0], m[1] ?? m[0]);
115
+ else if (d === "scalex") l = U(m[0], 1);
116
+ else if (d === "scaley") l = U(1, m[0]);
126
117
  else if (d === "rotate" || d === "rotatez") {
127
- const n = f(0);
128
- a = [Math.cos(n), Math.sin(n), -Math.sin(n), Math.cos(n), 0, 0];
118
+ const n = p(0);
119
+ l = [Math.cos(n), Math.sin(n), -Math.sin(n), Math.cos(n), 0, 0];
129
120
  } else return null;
130
- e = it(e, a);
121
+ e = it(e, l);
131
122
  }
132
- return o.replace(/\s/g, "") === s.replace(/\s/g, "") ? e : null;
123
+ return a.replace(/\s/g, "") === s.replace(/\s/g, "") ? e : null;
133
124
  }
134
125
  function J(s, r) {
135
126
  return { schema: s, value: r, velocity: r.map(() => 0) };
136
127
  }
137
- const Q = /[-+]?(?:\d*\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/gi, A = (s) => [
128
+ const Q = /[-+]?(?:\d*\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/gi, M = (s) => [
138
129
  s[0],
139
130
  s[2],
140
131
  s[4],
@@ -147,92 +138,92 @@ const Q = /[-+]?(?:\d*\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/gi, A = (s) => [
147
138
  ];
148
139
  function B(s, r) {
149
140
  return Array.from({ length: 9 }, (t, e) => {
150
- const i = Math.floor(e / 3), o = e % 3;
151
- return s[i * 3] * r[o] + s[i * 3 + 1] * r[o + 3] + s[i * 3 + 2] * r[o + 6];
141
+ const i = Math.floor(e / 3), a = e % 3;
142
+ return s[i * 3] * r[a] + s[i * 3 + 1] * r[a + 3] + s[i * 3 + 2] * r[a + 6];
152
143
  });
153
144
  }
154
145
  function rt(s) {
155
146
  return Math.abs(s[8]) < 1e-8 || !s.every(Number.isFinite) ? null : s.map((r) => r / s[8]);
156
147
  }
157
148
  function tt(s, r, t) {
158
- const e = vt(s, r, t);
159
- if (e) return A(e);
149
+ const e = yt(s, r, t);
150
+ if (e) return M(e);
160
151
  if (typeof DOMMatrix > "u") return null;
161
152
  const i = s.replace(
162
153
  /(translate(?:3d|X|Y)?)\(([^()]*)\)/gi,
163
- (o, c, d) => {
164
- const u = d.split(/\s*,\s*|\s+/).map((p, g) => {
165
- if (!p.endsWith("%")) return p;
166
- const f = c.toLowerCase() === "translatey" || g === 1 ? t : r;
167
- return `${Number.parseFloat(p) * f / 100}px`;
154
+ (a, c, d) => {
155
+ const u = d.split(/\s*,\s*|\s+/).map((m, g) => {
156
+ if (!m.endsWith("%")) return m;
157
+ const p = c.toLowerCase() === "translatey" || g === 1 ? t : r;
158
+ return `${Number.parseFloat(m) * p / 100}px`;
168
159
  });
169
160
  return `${c}(${u.join(",")})`;
170
161
  }
171
162
  );
172
163
  try {
173
- const o = new DOMMatrix(i);
164
+ const a = new DOMMatrix(i);
174
165
  return rt([
175
- o.m11,
176
- o.m21,
177
- o.m41,
178
- o.m12,
179
- o.m22,
180
- o.m42,
181
- o.m14,
182
- o.m24,
183
- o.m44
166
+ a.m11,
167
+ a.m21,
168
+ a.m41,
169
+ a.m12,
170
+ a.m22,
171
+ a.m42,
172
+ a.m14,
173
+ a.m24,
174
+ a.m44
184
175
  ]);
185
176
  } catch {
186
177
  return null;
187
178
  }
188
179
  }
189
180
  const et = "viewport-plane-v1";
190
- function L(s) {
191
- var C;
192
- const r = s.offsetWidth || 1, t = s.offsetHeight || 1, e = typeof getComputedStyle == "function" ? getComputedStyle(s) : null, i = ((e == null ? void 0 : e.transformOrigin) || `${r / 2}px ${t / 2}px`).split(" "), o = Number.parseFloat(i[0]) || 0, c = Number.parseFloat(i[1]) || 0;
181
+ function $(s) {
182
+ var w;
183
+ const r = s.offsetWidth || 1, t = s.offsetHeight || 1, e = typeof getComputedStyle == "function" ? getComputedStyle(s) : null, i = ((e == null ? void 0 : e.transformOrigin) || `${r / 2}px ${t / 2}px`).split(" "), a = Number.parseFloat(i[0]) || 0, c = Number.parseFloat(i[1]) || 0;
193
184
  let d = !0;
194
185
  if (typeof getComputedStyle == "function")
195
- for (let w = s.parentElement; w; w = w.parentElement) {
196
- const S = getComputedStyle(w);
186
+ for (let C = s.parentElement; C; C = C.parentElement) {
187
+ const S = getComputedStyle(C);
197
188
  if (S.transform && S.transform !== "none" || S.perspective && S.perspective !== "none") {
198
189
  d = !1;
199
190
  break;
200
191
  }
201
192
  }
202
- const u = (C = s.getBoundingClientRect) == null ? void 0 : C.call(s), p = tt((e == null ? void 0 : e.transform) || "", r, t) ?? A(H), g = B(
203
- B(A(I(o, c)), p),
204
- A(I(-o, -c))
205
- ), f = [
193
+ const u = (w = s.getBoundingClientRect) == null ? void 0 : w.call(s), m = tt((e == null ? void 0 : e.transform) || "", r, t) ?? M(H), g = B(
194
+ B(M(I(a, c)), m),
195
+ M(I(-a, -c))
196
+ ), p = [
206
197
  [0, 0],
207
198
  [r, 0],
208
199
  [0, t],
209
200
  [r, t]
210
- ].map(([w, S]) => {
211
- const F = g[6] * w + g[7] * S + g[8];
201
+ ].map(([C, S]) => {
202
+ const F = g[6] * C + g[7] * S + g[8];
212
203
  return [
213
- (g[0] * w + g[1] * S + g[2]) / F,
214
- (g[3] * w + g[4] * S + g[5]) / F
204
+ (g[0] * C + g[1] * S + g[2]) / F,
205
+ (g[3] * C + g[4] * S + g[5]) / F
215
206
  ];
216
- }), a = ((u == null ? void 0 : u.left) ?? 0) - Math.min(...f.map((w) => w[0])), n = ((u == null ? void 0 : u.top) ?? 0) - Math.min(...f.map((w) => w[1])), y = I(a + o, n + c), l = it(I(-o, -c), U(r, t)), m = A(G(y)), b = A(G(l));
207
+ }), l = ((u == null ? void 0 : u.left) ?? 0) - Math.min(...p.map((C) => C[0])), n = ((u == null ? void 0 : u.top) ?? 0) - Math.min(...p.map((C) => C[1])), y = I(l + a, n + c), o = it(I(-a, -c), U(r, t)), f = M(G(y)), b = M(G(o));
217
208
  return {
218
- frame: d ? { left: a, top: n, width: r, height: t } : void 0,
219
- read(w) {
209
+ frame: d ? { left: l, top: n, width: r, height: t } : void 0,
210
+ read(C) {
220
211
  const S = {};
221
- for (const [F, M] of Object.entries(w)) {
222
- const k = String(M);
212
+ for (const [F, A] of Object.entries(C)) {
213
+ const k = String(A);
223
214
  if (F === "transform") {
224
215
  if (!d) continue;
225
- const R = tt(k, r, t), x = R && rt(B(B(A(y), R), A(l)));
216
+ const R = tt(k, r, t), x = R && rt(B(B(M(y), R), M(o)));
226
217
  if (x) {
227
- const [q, j, T, O, V, P, E, v] = x, W = q - T * E, N = O - P * E, Z = j - T * v, Y = V - P * v, z = Math.hypot(W, N);
228
- if (z > 1e-8) {
218
+ const [q, N, T, O, V, P, E, v] = x, W = q - T * E, z = O - P * E, Z = N - T * v, Y = V - P * v, L = Math.hypot(W, z);
219
+ if (L > 1e-8) {
229
220
  S[F] = J(et, [
230
221
  T,
231
222
  P,
232
- Math.atan2(N, W),
233
- z,
234
- (W * Y - N * Z) / z,
235
- (W * Z + N * Y) / z,
223
+ Math.atan2(z, W),
224
+ L,
225
+ (W * Y - z * Z) / L,
226
+ (W * Z + z * Y) / L,
236
227
  E,
237
228
  v
238
229
  ]);
@@ -250,32 +241,32 @@ function L(s) {
250
241
  }
251
242
  return S;
252
243
  },
253
- write(w) {
244
+ write(C) {
254
245
  const S = {};
255
- for (const [F, M] of Object.entries(w))
256
- if (F === "transform" && M.schema === et) {
257
- const [k, _, R, x, q, j, T, O] = M.value, V = Math.cos(R), P = Math.sin(R), E = [
246
+ for (const [F, A] of Object.entries(C))
247
+ if (F === "transform" && A.schema === et) {
248
+ const [k, _, R, x, q, N, T, O] = A.value, V = Math.cos(R), P = Math.sin(R), E = [
258
249
  V * x + k * T,
259
- V * j - P * q + k * O,
250
+ V * N - P * q + k * O,
260
251
  k,
261
252
  P * x + _ * T,
262
- P * j + V * q + _ * O,
253
+ P * N + V * q + _ * O,
263
254
  _,
264
255
  T,
265
256
  O,
266
257
  1
267
- ], v = B(B(m, E), b);
258
+ ], v = B(B(f, E), b);
268
259
  Math.abs(v[6]) + Math.abs(v[7]) < 1e-10 && Math.abs(v[8] - 1) < 1e-10 ? S[F] = `matrix(${[v[0], v[3], v[1], v[4], v[2], v[5]].join(",")})` : S[F] = `matrix3d(${[v[0], v[3], 0, v[6], v[1], v[4], 0, v[7], 0, 0, 1, 0, v[2], v[5], 0, v[8]].join(",")})`;
269
- } else if (M.schema.startsWith("css:")) {
260
+ } else if (A.schema.startsWith("css:")) {
270
261
  let k = 0;
271
- S[F] = M.schema.slice(4).replace(/#/g, () => String(M.value[k++]));
262
+ S[F] = A.schema.slice(4).replace(/#/g, () => String(A.value[k++]));
272
263
  }
273
264
  return S;
274
265
  }
275
266
  };
276
267
  }
277
- const bt = 1e3 / 60, nt = 1e3 / 30, St = nt + 1;
278
- class wt {
268
+ const vt = 1e3 / 60, nt = 1e3 / 30, bt = nt + 1;
269
+ class St {
279
270
  constructor() {
280
271
  h(this, "drivers", /* @__PURE__ */ new Set());
281
272
  h(this, "observers", /* @__PURE__ */ new Set());
@@ -283,7 +274,7 @@ class wt {
283
274
  h(this, "previousTimestamp", null);
284
275
  h(this, "tick", (r) => {
285
276
  this.frameRequest = null;
286
- const t = this.previousTimestamp === null ? bt : Math.max(0, r - this.previousTimestamp);
277
+ const t = this.previousTimestamp === null ? vt : Math.max(0, r - this.previousTimestamp);
287
278
  this.previousTimestamp = r;
288
279
  const e = {
289
280
  delta: Math.min(t, nt),
@@ -312,7 +303,7 @@ class wt {
312
303
  this.hasCallbacks() || (this.frameRequest !== null && typeof cancelAnimationFrame < "u" && cancelAnimationFrame(this.frameRequest), this.frameRequest = null, this.previousTimestamp = null);
313
304
  }
314
305
  }
315
- const at = new wt(), Ct = 2;
306
+ const at = new St(), Ct = 2;
316
307
  class ot extends st {
317
308
  constructor(t) {
318
309
  super();
@@ -430,8 +421,8 @@ class ot extends st {
430
421
  }
431
422
  }
432
423
  finish() {
433
- var t, e, i, o;
434
- this.presentationTime = ((t = this.frames[this.frames.length - 1]) == null ? void 0 : t.time) ?? 0, this.solverState = void 0, (e = this.hold) == null || e.cancel(), this.hold = null, this.applyStyleAt(this.currentValue), this.clearWaapi(), (i = this.fallbackCopy) == null || i.cancel({ reason: "disposed", owns: () => !0 }), this.fallbackCopy = null, this.deferDisposal || this.disposeResources(D), (o = this.onComplete) == null || o.call(this);
424
+ var t, e, i, a;
425
+ this.presentationTime = ((t = this.frames[this.frames.length - 1]) == null ? void 0 : t.time) ?? 0, this.solverState = void 0, (e = this.hold) == null || e.cancel(), this.hold = null, this.applyStyleAt(this.currentValue), this.clearWaapi(), (i = this.fallbackCopy) == null || i.cancel({ reason: "disposed", owns: () => !0 }), this.fallbackCopy = null, this.deferDisposal || this.disposeResources(j), (a = this.onComplete) == null || a.call(this);
435
426
  }
436
427
  get motionIdentity() {
437
428
  return {
@@ -444,16 +435,16 @@ class ot extends st {
444
435
  }
445
436
  /** Final output, including any earlier residual, is the next handoff's source. */
446
437
  getMotionSnapshot() {
447
- var o, c;
438
+ var a, c;
448
439
  this.running && this.captureLiveState();
449
440
  const t = this.samplePresentation(
450
- $(this.waapi) ?? this.presentationTime
451
- ), e = this.paused || this.waitingForStart && !$(this.waapi) ? 0 : this.playbackRate, i = {
441
+ D(this.waapi) ?? this.presentationTime
442
+ ), e = this.paused || this.waitingForStart && !D(this.waapi) ? 0 : this.playbackRate, i = {
452
443
  ...this.styleFn(
453
444
  this.currentValue,
454
445
  this.lowerBound + this.upperBound - this.currentValue
455
446
  ),
456
- ...(o = this.codec) == null ? void 0 : o.write(t)
447
+ ...(a = this.codec) == null ? void 0 : a.write(t)
457
448
  };
458
449
  return {
459
450
  ...this.motionIdentity,
@@ -465,15 +456,15 @@ class ot extends st {
465
456
  d,
466
457
  {
467
458
  ...u,
468
- velocity: u.velocity.map((p) => p * e)
459
+ velocity: u.velocity.map((m) => m * e)
469
460
  }
470
461
  ])
471
462
  )
472
463
  };
473
464
  }
474
465
  adopt(t) {
475
- var d, u, p, g, f;
476
- this.codec ?? (this.codec = this.motion.codec ?? L(this.element)), this.adopted = t;
466
+ var d, u, m, g, p;
467
+ this.codec ?? (this.codec = this.motion.codec ?? $(this.element)), this.adopted = t;
477
468
  const e = this.codec.read({
478
469
  transform: "none",
479
470
  opacity: 1,
@@ -486,50 +477,50 @@ class ot extends st {
486
477
  const i = this.styleFn(
487
478
  this.currentValue,
488
479
  this.lowerBound + this.upperBound - this.currentValue
489
- ), o = t.displayStyle;
490
- for (const [a, n] of Object.entries(o ?? {}))
491
- a in i && String(n) !== String(i[a]) && (!t.channels[a] || !e[a]) && this.fallbackChannels.add(a);
492
- for (const [a, n] of Object.entries(t.channels)) {
493
- const y = e[a];
494
- y && !K(n, y) && this.fallbackChannels.add(a);
480
+ ), a = t.displayStyle;
481
+ for (const [l, n] of Object.entries(a ?? {}))
482
+ l in i && String(n) !== String(i[l]) && (!t.channels[l] || !e[l]) && this.fallbackChannels.add(l);
483
+ for (const [l, n] of Object.entries(t.channels)) {
484
+ const y = e[l];
485
+ y && !K(n, y) && this.fallbackChannels.add(l);
495
486
  }
496
487
  if (this.fallbackChannels.size && (this.fallbackMode = "finish"), this.fallbackChannels.size && this.motion.fallback !== "finish") {
497
- const a = t;
498
- if (a.frame && a.displayStyle && t.target.cloneNode && t.target.parentElement && !t.target.shadowRoot && !((u = (d = t.target).matches) != null && u.call(
488
+ const l = t;
489
+ if (l.frame && l.displayStyle && t.target.cloneNode && t.target.parentElement && !t.target.shadowRoot && !((u = (d = t.target).matches) != null && u.call(
499
490
  d,
500
491
  "canvas, video, audio, iframe, object, embed"
501
- )) && !((g = (p = t.target).querySelector) != null && g.call(
502
- p,
492
+ )) && !((g = (m = t.target).querySelector) != null && g.call(
493
+ m,
503
494
  "canvas, video, audio, iframe, object, embed"
504
495
  ))) {
505
496
  this.fallbackMode = "crossfade";
506
497
  const n = t.target.cloneNode(!0);
507
498
  n.removeAttribute("id"), n.removeAttribute("data-ssgoi-transition");
508
- for (const l of n.querySelectorAll(
499
+ for (const o of n.querySelectorAll(
509
500
  "[id], [data-ssgoi-transition]"
510
501
  ))
511
- l.removeAttribute("id"), l.removeAttribute("data-ssgoi-transition");
512
- n.style.cssText = a.inlineStyle ?? "", Object.assign(n.style, a.displayStyle, {
502
+ o.removeAttribute("id"), o.removeAttribute("data-ssgoi-transition");
503
+ n.style.cssText = l.inlineStyle ?? "", Object.assign(n.style, l.displayStyle, {
513
504
  position: "fixed",
514
- left: `${a.frame.left}px`,
515
- top: `${a.frame.top}px`,
516
- width: `${a.frame.width}px`,
517
- height: `${a.frame.height}px`,
505
+ left: `${l.frame.left}px`,
506
+ top: `${l.frame.top}px`,
507
+ width: `${l.frame.width}px`,
508
+ height: `${l.frame.height}px`,
518
509
  margin: "0",
519
510
  pointerEvents: "none",
520
511
  zIndex: "2147483646"
521
512
  }), n.setAttribute("aria-hidden", "true"), n.inert = !0, t.target.parentElement.appendChild(n);
522
- const y = Number(a.displayStyle.opacity ?? 1);
513
+ const y = Number(l.displayStyle.opacity ?? 1);
523
514
  this.fallbackCopy = new ot({
524
515
  element: n,
525
516
  integrator: {
526
- step: (l, m, b) => ({
527
- position: Math.min(m, l.position + b / 0.18),
517
+ step: (o, f, b) => ({
518
+ position: Math.min(f, o.position + b / 0.18),
528
519
  velocity: 0
529
520
  }),
530
- isSettled: (l, m) => l.position >= m
521
+ isSettled: (o, f) => o.position >= f
531
522
  },
532
- style: (l, m) => ({ opacity: y * m }),
523
+ style: (o, f) => ({ opacity: y * f }),
533
524
  onDispose: () => n.remove()
534
525
  }), this.adopted = {
535
526
  ...t,
@@ -541,7 +532,7 @@ class ot extends st {
541
532
  }
542
533
  }
543
534
  const c = this.codec.write(this.adopted.channels);
544
- (f = this.hold) == null || f.cancel(), Object.keys(c).length && (this.hold = this.element.animate([c], {
535
+ (p = this.hold) == null || p.cancel(), Object.keys(c).length && (this.hold = this.element.animate([c], {
545
536
  duration: 1,
546
537
  fill: "both"
547
538
  }), this.hold.pause(), this.hold.currentTime = 0);
@@ -551,7 +542,7 @@ class ot extends st {
551
542
  const e = this.presentationFrames[t];
552
543
  if (e) return e.channels;
553
544
  const i = this.frames[t];
554
- return this.codec ?? (this.codec = this.motion.codec ?? L(this.element)), this.codec.read({
545
+ return this.codec ?? (this.codec = this.motion.codec ?? $(this.element)), this.codec.read({
555
546
  transform: "none",
556
547
  opacity: 1,
557
548
  ...this.styleFn(
@@ -563,7 +554,7 @@ class ot extends st {
563
554
  samplePresentation(t) {
564
555
  const e = this.frames;
565
556
  if (!e.length)
566
- return this.adopted ? { ...this.adopted.channels } : (this.codec ?? (this.codec = this.motion.codec ?? L(this.element)), this.codec.read({
557
+ return this.adopted ? { ...this.adopted.channels } : (this.codec ?? (this.codec = this.motion.codec ?? $(this.element)), this.codec.read({
567
558
  transform: "none",
568
559
  opacity: 1,
569
560
  ...this.styleFn(
@@ -573,22 +564,22 @@ class ot extends st {
573
564
  }));
574
565
  let i = e.findIndex((n) => n.time > t);
575
566
  i < 0 && (i = e.length - 1);
576
- const o = Math.max(0, i - 1), c = e[o], d = e[i], u = this.channelsAt(o), p = o === i ? u : this.channelsAt(i), g = (d.time - c.time) / 1e3, f = g ? Math.max(0, Math.min(1, (t - c.time) / (g * 1e3))) : 0, a = {};
567
+ const a = Math.max(0, i - 1), c = e[a], d = e[i], u = this.channelsAt(a), m = a === i ? u : this.channelsAt(i), g = (d.time - c.time) / 1e3, p = g ? Math.max(0, Math.min(1, (t - c.time) / (g * 1e3))) : 0, l = {};
577
568
  for (const [n, y] of Object.entries(u)) {
578
- const l = p[n];
579
- if (!l || !K(y, l)) {
580
- a[n] = y;
569
+ const o = m[n];
570
+ if (!o || !K(y, o)) {
571
+ l[n] = y;
581
572
  continue;
582
573
  }
583
- a[n] = {
574
+ l[n] = {
584
575
  schema: y.schema,
585
- value: y.value.map((m, b) => m + (l.value[b] - m) * f),
576
+ value: y.value.map((f, b) => f + (o.value[b] - f) * p),
586
577
  velocity: y.value.map(
587
- (m, b) => t >= e[e.length - 1].time || !g ? 0 : (l.value[b] - m) / g
578
+ (f, b) => t >= e[e.length - 1].time || !g ? 0 : (o.value[b] - f) / g
588
579
  )
589
580
  };
590
581
  }
591
- return a;
582
+ return l;
592
583
  }
593
584
  /**
594
585
  * Drop the WAAPI forwards-fill after the run has settled, letting inline
@@ -644,12 +635,12 @@ class ot extends st {
644
635
  }
645
636
  getTimeline() {
646
637
  const t = this.frames.map((e, i) => {
647
- const o = e.position, c = this.lowerBound + this.upperBound - o;
638
+ const a = e.position, c = this.lowerBound + this.upperBound - a;
648
639
  return {
649
640
  time: e.time,
650
641
  value: e.position,
651
642
  velocity: e.velocity,
652
- style: this.renderedStyles[i] ?? this.styleFn(o, c)
643
+ style: this.renderedStyles[i] ?? this.styleFn(a, c)
653
644
  };
654
645
  });
655
646
  return [{ element: this._element, frames: t }];
@@ -660,10 +651,10 @@ class ot extends st {
660
651
  }
661
652
  /* ───────────────────────────────────────────────────────── private */
662
653
  runToward(t) {
663
- var g, f;
654
+ var m, g;
664
655
  if (this.validate(), this.running || this.paused) {
665
- const a = this.getMotionSnapshot();
666
- this.captureLiveState(), this.adopted = a;
656
+ const p = this.getMotionSnapshot();
657
+ this.captureLiveState(), this.adopted = p;
667
658
  }
668
659
  if (this.clearWaapi(), this.running = !1, this.paused = !1, this.settled = !1, this.disposed = !1, this.presentationTime = 0, this.presentationFrames = [], this.solverTarget = t, this.frames = dt(
669
660
  this._integrator,
@@ -676,17 +667,19 @@ class ot extends st {
676
667
  this.currentValue = t, this.currentVelocity = 0, this.applyStyleAt(t), this.settled = !0, this.finish();
677
668
  return;
678
669
  }
679
- const e = (a) => this.styleFn(a.position, this.lowerBound + this.upperBound - a.position), i = this.adopted ? this.bridgeKeyframes(e) : this.frames.map((a) => e(a));
670
+ const e = (p) => this.styleFn(p.position, this.lowerBound + this.upperBound - p.position), i = this.adopted ? this.bridgeKeyframes(e) : this.frames.map((p) => e(p));
680
671
  this.renderedStyles = i, this.adopted = void 0;
681
- const o = i[0], c = this.frames[this.frames.length - 1], d = c.time, u = ++this.runId, p = this._element.animate(i, {
672
+ const a = i[0], c = this.frames[this.frames.length - 1], d = c.time;
673
+ this.runId++;
674
+ const u = this._element.animate(i, {
682
675
  duration: d,
683
676
  fill: "both",
684
677
  easing: "linear",
685
678
  composite: "replace"
686
679
  });
687
- p.playbackRate = this.playbackRate, p.currentTime = 0, p.pause(), this.waapi = p, (g = this.fallbackCopy) == null || g.play(), (f = this.hold) == null || f.cancel(), this.hold = null, this.waitingForStart = !0, this.startReady = !1, this.pendingFirstFrame = o, this.running = !0, p.onfinish = () => {
688
- !this.running || this.waapi !== p || (this.running = !1, this.settled = !0, this.currentValue = c.position, this.currentVelocity = 0, this.finish());
689
- }, this.startWhenReady(p, u);
680
+ u.playbackRate = this.playbackRate, u.currentTime = 0, u.pause(), this.waapi = u, (m = this.fallbackCopy) == null || m.play(), (g = this.hold) == null || g.cancel(), this.hold = null, this.waitingForStart = !0, this.startReady = !0, this.pendingFirstFrame = a, this.running = !0, u.onfinish = () => {
681
+ !this.running || this.waapi !== u || (this.running = !1, this.settled = !0, this.currentValue = c.position, this.currentVelocity = 0, this.finish());
682
+ }, this.startFramePacedPlayback(u);
690
683
  }
691
684
  /**
692
685
  * Bake the residual correction into the keyframes: each authored frame is
@@ -696,69 +689,69 @@ class ot extends st {
696
689
  */
697
690
  bridgeKeyframes(t) {
698
691
  var g;
699
- this.codec = this.motion.codec ?? L(this.element);
700
- const e = this.codec, i = Math.max(16, this.motion.handoffDuration ?? 280), o = this.frames[this.frames.length - 1];
701
- for (let f = o.time + 1e3 / 60; f < i + 1e3 / 60; f += 1e3 / 60)
702
- this.frames.push({ time: f, position: o.position, velocity: 0 });
692
+ this.codec = this.motion.codec ?? $(this.element);
693
+ const e = this.codec, i = Math.max(16, this.motion.handoffDuration ?? 280), a = this.frames[this.frames.length - 1];
694
+ for (let p = a.time + 1e3 / 60; p < i + 1e3 / 60; p += 1e3 / 60)
695
+ this.frames.push({ time: p, position: a.position, velocity: 0 });
703
696
  const c = this.frames.map(
704
- (f) => e.read({ transform: "none", opacity: 1, ...t(f) })
697
+ (p) => e.read({ transform: "none", opacity: 1, ...t(p) })
705
698
  );
706
- for (let f = 1; f < c.length; f++) {
707
- const a = c[f - 1].transform, n = c[f].transform;
708
- if ((a == null ? void 0 : a.schema) === "viewport-plane-v1" && (n == null ? void 0 : n.schema) === a.schema) {
699
+ for (let p = 1; p < c.length; p++) {
700
+ const l = c[p - 1].transform, n = c[p].transform;
701
+ if ((l == null ? void 0 : l.schema) === "viewport-plane-v1" && (n == null ? void 0 : n.schema) === l.schema) {
709
702
  const y = [...n.value];
710
- y[2] = a.value[2] + Math.atan2(
711
- Math.sin(y[2] - a.value[2]),
712
- Math.cos(y[2] - a.value[2])
713
- ), c[f].transform = { ...n, value: y };
703
+ y[2] = l.value[2] + Math.atan2(
704
+ Math.sin(y[2] - l.value[2]),
705
+ Math.cos(y[2] - l.value[2])
706
+ ), c[p].transform = { ...n, value: y };
714
707
  }
715
708
  }
716
- const d = c[0], u = c[1] ?? d, p = {};
717
- for (const [f, a] of Object.entries(
709
+ const d = c[0], u = c[1] ?? d, m = {};
710
+ for (const [p, l] of Object.entries(
718
711
  ((g = this.adopted) == null ? void 0 : g.channels) ?? {}
719
712
  )) {
720
- let n = d[f];
713
+ let n = d[p];
721
714
  if (!n) {
722
- const l = f === "transform" ? { transform: "none" } : f === "opacity" ? { opacity: 1 } : {};
723
- if (n = e.read(l)[f], n)
724
- for (const m of c) m[f] = n;
715
+ const o = p === "transform" ? { transform: "none" } : p === "opacity" ? { opacity: 1 } : {};
716
+ if (n = e.read(o)[p], n)
717
+ for (const f of c) f[p] = n;
725
718
  }
726
- if (!n || !K(a, n)) continue;
727
- const y = u[f] ?? n;
728
- p[f] = {
729
- offset: a.value.map((l, m) => {
730
- let b = l - n.value[m];
731
- return f === "transform" && a.schema === "viewport-plane-v1" && m === 2 && (b = Math.atan2(Math.sin(b), Math.cos(b))), b;
719
+ if (!n || !K(l, n)) continue;
720
+ const y = u[p] ?? n;
721
+ m[p] = {
722
+ offset: l.value.map((o, f) => {
723
+ let b = o - n.value[f];
724
+ return p === "transform" && l.schema === "viewport-plane-v1" && f === 2 && (b = Math.atan2(Math.sin(b), Math.cos(b))), b;
732
725
  }),
733
- velocity: a.velocity.map(
734
- (l, m) => l / Math.max(Math.abs(this.playbackRate), 1e-4) - (y.value[m] - n.value[m]) * 60
726
+ velocity: l.velocity.map(
727
+ (o, f) => o / Math.max(Math.abs(this.playbackRate), 1e-4) - (y.value[f] - n.value[f]) * 60
735
728
  )
736
729
  };
737
730
  }
738
- return this.presentationFrames = this.frames.map((f, a) => {
739
- const n = { ...c[a] };
740
- for (const [y, l] of Object.entries(p)) {
741
- const m = n[y];
731
+ return this.presentationFrames = this.frames.map((p, l) => {
732
+ const n = { ...c[l] };
733
+ for (const [y, o] of Object.entries(m)) {
734
+ const f = n[y];
742
735
  n[y] = {
743
- ...m,
744
- value: m.value.map(
745
- (b, C) => b + pt(
746
- l.offset[C],
747
- l.velocity[C],
748
- f.time / 1e3,
736
+ ...f,
737
+ value: f.value.map(
738
+ (b, w) => b + pt(
739
+ o.offset[w],
740
+ o.velocity[w],
741
+ p.time / 1e3,
749
742
  i / 1e3
750
743
  ).value
751
744
  )
752
745
  };
753
746
  }
754
- return { time: f.time, channels: n };
755
- }), this.frames.map((f, a) => {
756
- const n = this.presentationFrames[a].channels;
747
+ return { time: p.time, channels: n };
748
+ }), this.frames.map((p, l) => {
749
+ const n = this.presentationFrames[l].channels;
757
750
  return {
758
- ...t(f),
751
+ ...t(p),
759
752
  ...e.write(
760
753
  Object.fromEntries(
761
- Object.keys(p).map((y) => [y, n[y]])
754
+ Object.keys(m).map((y) => [y, n[y]])
762
755
  )
763
756
  )
764
757
  };
@@ -770,7 +763,7 @@ class ot extends st {
770
763
  }
771
764
  captureLiveState() {
772
765
  if (this.frames.length === 0) return;
773
- const t = $(this.waapi);
766
+ const t = D(this.waapi);
774
767
  if (t === null) return;
775
768
  this.presentationTime = t;
776
769
  const { position: e, velocity: i } = ft(this.frames, t);
@@ -781,21 +774,10 @@ class ot extends st {
781
774
  this.solverTarget
782
775
  );
783
776
  }
784
- async startWhenReady(t, e) {
785
- try {
786
- await t.ready, typeof requestAnimationFrame < "u" && await yt(this._element);
787
- } catch {
788
- return;
789
- }
790
- this.runId !== e || this.waapi !== t || (this.startReady = !0, !(!this.running || this.paused) && this.startFramePacedPlayback(t));
791
- }
792
777
  startFramePacedPlayback(t) {
793
778
  if (!(this.waapi !== t || !this.waitingForStart || !this.startReady || this.stopStartupClock)) {
794
- if (this.pendingFirstFrame)
795
- for (const e of Object.keys(this.pendingFirstFrame))
796
- this._element.style[e] = "";
797
- if (this.pendingFirstFrame = void 0, typeof requestAnimationFrame > "u" || this.playbackRate < 0) {
798
- this.handOffToWaapi(t);
779
+ if (typeof requestAnimationFrame > "u" || this.playbackRate < 0) {
780
+ this.clearStartStyles(), this.handOffToWaapi(t);
799
781
  return;
800
782
  }
801
783
  this.startupStableFrames = 0, this.stopStartupClock = at.subscribe((e) => {
@@ -803,24 +785,43 @@ class ot extends st {
803
785
  });
804
786
  }
805
787
  }
788
+ /**
789
+ * Inline start styles are cleared in the same rendering update as the first
790
+ * seek, after the paused 0 ms WAAPI frame has had its own frame. Clearing
791
+ * earlier can expose the underlying, unanimated style while the animation is
792
+ * still pending.
793
+ */
794
+ clearStartStyles() {
795
+ if (this.pendingFirstFrame)
796
+ for (const t of Object.keys(this.pendingFirstFrame))
797
+ this._element.style[t] = "";
798
+ this.pendingFirstFrame = void 0;
799
+ }
806
800
  advanceFramePacedStartup(t, e) {
807
801
  if (this.waapi !== t || !this.running || this.paused || !this.waitingForStart)
808
802
  return;
809
803
  const i = this.frames[this.frames.length - 1];
810
804
  if (!i) return;
811
- const o = $(t) ?? 0, c = Math.min(
805
+ const a = D(t) ?? 0, c = Math.min(
812
806
  i.time,
813
- o + e.delta * Math.max(0, this.playbackRate)
807
+ a + e.delta * Math.max(0, this.playbackRate)
814
808
  );
815
- if (t.currentTime = c, this.captureLiveState(), c >= i.time) {
809
+ if (t.currentTime = c, this.clearStartStyles(), this.captureLiveState(), c >= i.time) {
816
810
  this.finishFramePacedRun(t, i);
817
811
  return;
818
812
  }
819
- e.rawDelta <= St ? this.startupStableFrames++ : this.startupStableFrames = 0, !(this.startupStableFrames < Ct) && this.handOffToWaapi(t);
813
+ e.rawDelta <= bt ? this.startupStableFrames++ : this.startupStableFrames = 0, !(this.startupStableFrames < Ct) && this.handOffToWaapi(t);
820
814
  }
821
815
  handOffToWaapi(t) {
822
- var e;
823
- this.waapi !== t || !this.running || this.paused || ((e = this.stopStartupClock) == null || e.call(this), this.stopStartupClock = null, this.waitingForStart = !1, this.startReady = !1, this.startupStableFrames = 0, t.play());
816
+ var c, d;
817
+ if (this.waapi !== t || !this.running || this.paused) return;
818
+ (c = this.stopStartupClock) == null || c.call(this), this.stopStartupClock = null, this.waitingForStart = !1, this.startReady = !1, this.startupStableFrames = 0;
819
+ const e = (d = t.timeline) == null ? void 0 : d.currentTime, i = D(t), a = this.playbackRate;
820
+ if (typeof e == "number" && i !== null && a !== 0) {
821
+ t.startTime = e - i / a;
822
+ return;
823
+ }
824
+ t.play();
824
825
  }
825
826
  finishFramePacedRun(t, e) {
826
827
  var i;
@@ -828,15 +829,15 @@ class ot extends st {
828
829
  }
829
830
  applyStyleAt(t) {
830
831
  const e = this.lowerBound + this.upperBound - t, i = this.styleFn(t, e);
831
- for (const [o, c] of Object.entries(i))
832
- this._element.style[o] = typeof c == "number" ? String(c) : c;
832
+ for (const [a, c] of Object.entries(i))
833
+ this._element.style[a] = typeof c == "number" ? String(c) : c;
833
834
  }
834
835
  }
835
- function $(s) {
836
+ function D(s) {
836
837
  const r = s == null ? void 0 : s.currentTime;
837
838
  return typeof r == "number" ? r : null;
838
839
  }
839
- function Ft(s) {
840
+ function wt(s) {
840
841
  return typeof s.step == "function" ? s : gt.from(s);
841
842
  }
842
843
  class lt extends st {
@@ -862,7 +863,7 @@ class lt extends st {
862
863
  for (const i of this._children) i.deferDisposal = !0;
863
864
  this.progressChildren = this._children.filter(
864
865
  (i) => !(i instanceof lt) || i.progressChildren.length > 0
865
- ), (e.mode ?? "parallel") === "sequence" ? this._startAt = this._children.map((i, o) => o === 0 ? 0 : 1) : this._startAt = e.startAt ?? [];
866
+ ), (e.mode ?? "parallel") === "sequence" ? this._startAt = this._children.map((i, a) => a === 0 ? 0 : 1) : this._startAt = e.startAt ?? [];
866
867
  }
867
868
  /** Child animations in play order. */
868
869
  get children() {
@@ -898,7 +899,7 @@ class lt extends st {
898
899
  set(t, e) {
899
900
  if (typeof t == "string") {
900
901
  const i = this.select(t);
901
- return (e == null ? void 0 : e.integrator) !== void 0 && i.set({ integrator: Ft(e.integrator) }), this;
902
+ return (e == null ? void 0 : e.integrator) !== void 0 && i.set({ integrator: wt(e.integrator) }), this;
902
903
  }
903
904
  return super.set(t);
904
905
  }
@@ -922,8 +923,8 @@ class lt extends st {
922
923
  this.settled = !0, this.running = !1, this.clearPendingStartObservers(), this.restoreCompletionHandlers();
923
924
  for (const e of this._children) e.complete();
924
925
  if (!this.deferDisposal) {
925
- for (const e of this._children) e.cancel(D);
926
- this.disposeResources(D);
926
+ for (const e of this._children) e.cancel(j);
927
+ this.disposeResources(j);
927
928
  }
928
929
  (t = this.onComplete) == null || t.call(this);
929
930
  }
@@ -987,62 +988,62 @@ class lt extends st {
987
988
  }
988
989
  /* ───────────────────────────────────────────────────────── private */
989
990
  startRun(t) {
990
- const e = this.buildDependencies(), i = this.pausedRun && t === this.lastMethod, o = t !== this.lastMethod, c = new Set(this.startedChildren), d = new Set(
991
- this._children.filter((l) => l.isComplete)
992
- ), u = t === "reverse" && c.size ? this._children.filter((l) => c.has(l)) : [...this._children], p = t === "reverse" ? [...u].reverse() : u, g = /* @__PURE__ */ new Map();
991
+ const e = this.buildDependencies(), i = this.pausedRun && t === this.lastMethod, a = t !== this.lastMethod, c = new Set(this.startedChildren), d = new Set(
992
+ this._children.filter((o) => o.isComplete)
993
+ ), u = t === "reverse" && c.size ? this._children.filter((o) => c.has(o)) : [...this._children], m = t === "reverse" ? [...u].reverse() : u, g = /* @__PURE__ */ new Map();
993
994
  if (t === "reverse")
994
- for (const [l, m] of e) {
995
- if (!u.includes(l) || !u.includes(m.after))
995
+ for (const [o, f] of e) {
996
+ if (!u.includes(o) || !u.includes(f.after))
996
997
  continue;
997
- const b = g.get(m.after) ?? [];
998
+ const b = g.get(f.after) ?? [];
998
999
  b.push({
999
- after: l,
1000
- at: m.at === "settled" ? "settled" : 1 - m.at
1001
- }), g.set(m.after, b);
1000
+ after: o,
1001
+ at: f.at === "settled" ? "settled" : 1 - f.at
1002
+ }), g.set(f.after, b);
1002
1003
  }
1003
1004
  else
1004
- for (const [l, m] of e)
1005
- g.set(l, [m]);
1006
- if (o || i)
1007
- for (const l of c)
1008
- d.has(l) || g.delete(l);
1005
+ for (const [o, f] of e)
1006
+ g.set(o, [f]);
1007
+ if (a || i)
1008
+ for (const o of c)
1009
+ d.has(o) || g.delete(o);
1009
1010
  this.running && this.pause(), this.restoreCompletionHandlers();
1010
- const f = ++this.runId;
1011
- if (this.running = !0, this.pausedRun = !1, this.lastMethod = t, this.disposed = !1, this.settled = !1, this.pendingComplete = u.length, !i && !o && this.startedChildren.clear(), this.pendingComplete === 0) {
1011
+ const p = ++this.runId;
1012
+ if (this.running = !0, this.pausedRun = !1, this.lastMethod = t, this.disposed = !1, this.settled = !1, this.pendingComplete = u.length, !i && !a && this.startedChildren.clear(), this.pendingComplete === 0) {
1012
1013
  this.handleFinished();
1013
1014
  return;
1014
1015
  }
1015
- const a = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
1016
+ const l = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
1016
1017
  if (i)
1017
- for (const l of u)
1018
- c.has(l) && d.has(l) && (n.add(l), a.add(l), this.pendingComplete--);
1019
- for (const l of u) {
1020
- const m = l.onComplete, b = () => {
1021
- if (!(this.runId !== f || !this.running || a.has(l))) {
1018
+ for (const o of u)
1019
+ c.has(o) && d.has(o) && (n.add(o), l.add(o), this.pendingComplete--);
1020
+ for (const o of u) {
1021
+ const f = o.onComplete, b = () => {
1022
+ if (!(this.runId !== p || !this.running || l.has(o))) {
1022
1023
  try {
1023
- m == null || m();
1024
- } catch (C) {
1025
- console.error("[ssgoi] animation completion failed", C);
1024
+ f == null || f();
1025
+ } catch (w) {
1026
+ console.error("[ssgoi] animation completion failed", w);
1026
1027
  }
1027
- a.add(l), --this.pendingComplete === 0 && this.handleFinished();
1028
+ l.add(o), --this.pendingComplete === 0 && this.handleFinished();
1028
1029
  }
1029
1030
  };
1030
- l.onComplete = b, this.restoreChildCallbacks.push(() => {
1031
- l.onComplete === b && (l.onComplete = m);
1031
+ o.onComplete = b, this.restoreChildCallbacks.push(() => {
1032
+ o.onComplete === b && (o.onComplete = f);
1032
1033
  });
1033
1034
  }
1034
1035
  const y = () => {
1035
- let l = !0;
1036
- for (; this.running && this.runId === f && l; ) {
1037
- l = !1;
1038
- for (const m of p)
1039
- !this.running || n.has(m) || (g.get(m) ?? []).some(
1040
- (C) => !n.has(C.after) || !this.hasReachedThreshold(
1041
- C.after,
1042
- C.at,
1036
+ let o = !0;
1037
+ for (; this.running && this.runId === p && o; ) {
1038
+ o = !1;
1039
+ for (const f of m)
1040
+ !this.running || n.has(f) || (g.get(f) ?? []).some(
1041
+ (w) => !n.has(w.after) || !this.hasReachedThreshold(
1042
+ w.after,
1043
+ w.at,
1043
1044
  t
1044
1045
  )
1045
- ) || (n.add(m), this.startedChildren.add(m), m[t](), l = !0);
1046
+ ) || (n.add(f), this.startedChildren.add(f), f[t](), o = !0);
1046
1047
  }
1047
1048
  n.size === u.length && this.clearPendingStartObservers();
1048
1049
  };
@@ -1057,25 +1058,25 @@ class lt extends st {
1057
1058
  "Each child animation must occur once in a MultiAnimation"
1058
1059
  );
1059
1060
  this._children.forEach((d, u) => {
1060
- const p = d.startCondition;
1061
- if (p) {
1062
- if (!e.has(p.after))
1061
+ const m = d.startCondition;
1062
+ if (m) {
1063
+ if (!e.has(m.after))
1063
1064
  throw new Error(
1064
1065
  "startAt.after must reference a sibling in the same MultiAnimation"
1065
1066
  );
1066
- t.set(d, { ...p });
1067
+ t.set(d, { ...m });
1067
1068
  } else u > 0 && this._startAt.some((g) => g > 0) && t.set(d, {
1068
1069
  after: this._children[u - 1],
1069
1070
  at: this._startAt[u] ?? 0
1070
1071
  });
1071
1072
  });
1072
- const i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), c = (d) => {
1073
- if (o.has(d))
1073
+ const i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), c = (d) => {
1074
+ if (a.has(d))
1074
1075
  throw new Error("Animation startAt dependencies form a cycle");
1075
1076
  if (i.has(d)) return;
1076
- o.add(d);
1077
+ a.add(d);
1077
1078
  const u = t.get(d);
1078
- u && c(u.after), o.delete(d), i.add(d);
1079
+ u && c(u.after), a.delete(d), i.add(d);
1079
1080
  };
1080
1081
  return this._children.forEach(c), t;
1081
1082
  }
@@ -1094,8 +1095,8 @@ class lt extends st {
1094
1095
  var t;
1095
1096
  if (this.running) {
1096
1097
  if (this.running = !1, this.settled = !0, this.clearPendingStartObservers(), this.restoreCompletionHandlers(), !this.deferDisposal) {
1097
- for (const e of this._children) e.cancel(D);
1098
- this.disposeResources(D);
1098
+ for (const e of this._children) e.cancel(j);
1099
+ this.disposeResources(j);
1099
1100
  }
1100
1101
  (t = this.onComplete) == null || t.call(this);
1101
1102
  }
@@ -1122,8 +1123,8 @@ function Mt(s) {
1122
1123
  restore: () => {
1123
1124
  if (!e) {
1124
1125
  if (e = !0, r.users.delete(t), r.users.size > 0) {
1125
- const i = Array.from(r.users), o = i[i.length - 1];
1126
- (o == null ? void 0 : o.value) !== void 0 && (s.style.opacity = String(o.value));
1126
+ const i = Array.from(r.users), a = i[i.length - 1];
1127
+ (a == null ? void 0 : a.value) !== void 0 && (s.style.opacity = String(a.value));
1127
1128
  return;
1128
1129
  }
1129
1130
  r.value ? s.style.setProperty("opacity", r.value, r.priority) : s.style.removeProperty("opacity"), X.delete(s);
@@ -1135,7 +1136,7 @@ export {
1135
1136
  st as A,
1136
1137
  lt as M,
1137
1138
  ot as W,
1138
- L as c,
1139
- D as f,
1139
+ $ as c,
1140
+ j as f,
1140
1141
  Mt as r
1141
1142
  };