@ssgoi/core 6.5.0-beta.1 → 6.5.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.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var Mt = Object.defineProperty;
2
2
  var Ut = (e, t, n) => t in e ? Mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var $ = (e, t, n) => Ut(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { P as K, V as Dt, W as g, M as C, S as Vt } from "./multi-animation-CnxqLEka.js";
5
- import { A as Fs } from "./multi-animation-CnxqLEka.js";
4
+ import { P as K, V as Dt, W as m, M as C, S as Rt } from "./multi-animation-Ch5rI3rB.js";
5
+ import { A as Fs } from "./multi-animation-Ch5rI3rB.js";
6
6
  function v(e, t) {
7
7
  const n = [];
8
8
  for (let s = 0; s < e.length; s++)
@@ -74,7 +74,7 @@ class k {
74
74
  return s < this.restDelta && o < this.restSpeed;
75
75
  }
76
76
  }
77
- class Rt {
77
+ class Vt {
78
78
  constructor(t) {
79
79
  $(this, "leader");
80
80
  $(this, "follower");
@@ -153,7 +153,7 @@ class Bt {
153
153
  return Math.abs(n - t.position) < this.restDelta;
154
154
  }
155
155
  }
156
- class m {
156
+ class g {
157
157
  /**
158
158
  * Create an Integrator from physics config
159
159
  *
@@ -184,7 +184,7 @@ class m {
184
184
  return typeof s == "number" ? o = s : typeof s == "object" && (o = {
185
185
  stiffness: s.stiffness,
186
186
  damping: s.damping
187
- }), new Rt({
187
+ }), new Vt({
188
188
  stiffness: n.stiffness,
189
189
  damping: n.damping,
190
190
  follower: o,
@@ -204,7 +204,7 @@ class m {
204
204
  * @deprecated Use from({ spring: config }) instead
205
205
  */
206
206
  static fromSpring(t) {
207
- return m.from({ spring: t });
207
+ return g.from({ spring: t });
208
208
  }
209
209
  }
210
210
  class Wt {
@@ -239,6 +239,15 @@ function J(e, t) {
239
239
  o.height
240
240
  );
241
241
  }
242
+ function tt(e, t) {
243
+ const n = e.getBoundingClientRect(), s = t.getBoundingClientRect(), o = e.offsetWidth > 0 ? n.width / e.offsetWidth : 1, i = e.offsetHeight > 0 ? n.height / e.offsetHeight : 1;
244
+ return new DOMRect(
245
+ (s.left - n.left) / o,
246
+ (s.top - n.top) / i,
247
+ s.width / o,
248
+ s.height / i
249
+ );
250
+ }
242
251
  function I(e, t) {
243
252
  const { scrollingElement: n, positionedParent: s } = e, o = n !== s && n.contains(s) ? J(n, s).top : 0;
244
253
  return {
@@ -248,7 +257,7 @@ function I(e, t) {
248
257
  height: n.clientHeight - o
249
258
  };
250
259
  }
251
- const tt = 8, et = {
260
+ const et = 8, nt = {
252
261
  spring: {
253
262
  stiffness: 1e3,
254
263
  damping: 40,
@@ -260,7 +269,7 @@ const tt = 8, et = {
260
269
  function Zt({
261
270
  direction: e
262
271
  }) {
263
- const t = e === "forward" ? tt : -tt;
272
+ const t = e === "forward" ? et : -et;
264
273
  return {
265
274
  out: {
266
275
  willChange: "transform, opacity",
@@ -284,15 +293,15 @@ function Zt({
284
293
  }
285
294
  function qt() {
286
295
  return {
287
- outPhysics: et,
288
- inPhysics: et,
296
+ outPhysics: nt,
297
+ inPhysics: nt,
289
298
  // Both sides run together — the cross-fade is the whole point of the
290
299
  // snappy feel. (fluid's sibling uses staggered fade-through.)
291
300
  composition: { mode: "parallel", startAt: [0, 0] },
292
301
  build: Zt
293
302
  };
294
303
  }
295
- const nt = 30, jt = {
304
+ const st = 30, jt = {
296
305
  inertia: { acceleration: 150, resistance: 1.5, restDelta: 0.1 }
297
306
  }, Kt = {
298
307
  spring: { stiffness: 180, damping: 34, restDelta: 0.1, restSpeed: 0.1 }
@@ -300,7 +309,7 @@ const nt = 30, jt = {
300
309
  function Gt({
301
310
  direction: e
302
311
  }) {
303
- const t = e === "forward" ? 1 : -1, n = -nt * t, s = nt * t;
312
+ const t = e === "forward" ? 1 : -1, n = -st * t, s = st * t;
304
313
  return {
305
314
  out: {
306
315
  willChange: "transform, opacity",
@@ -337,7 +346,7 @@ function Jt() {
337
346
  const Qt = {
338
347
  snappy: qt(),
339
348
  fluid: Jt()
340
- }, st = 8, te = {
349
+ }, ot = 8, te = {
341
350
  inertia: { acceleration: 150, resistance: 1.5, restDelta: 0.1 }
342
351
  }, ee = {
343
352
  spring: { stiffness: 180, damping: 34, restDelta: 0.1, restSpeed: 0.1 }
@@ -345,7 +354,7 @@ const Qt = {
345
354
  function ne({
346
355
  direction: e
347
356
  }) {
348
- const t = e === "forward" ? 1 : -1, n = -st * t, s = st * t;
357
+ const t = e === "forward" ? 1 : -1, n = -ot * t, s = ot * t;
349
358
  return {
350
359
  out: {
351
360
  willChange: "transform, opacity",
@@ -412,13 +421,13 @@ function le() {
412
421
  build: ae
413
422
  };
414
423
  }
415
- const ot = se(), ce = {
416
- snappy: ot,
417
- directional: ot,
424
+ const it = se(), ce = {
425
+ snappy: it,
426
+ directional: it,
418
427
  "non-directional": le()
419
- }, it = {
428
+ }, rt = {
420
429
  spring: { stiffness: 280, damping: 30, restDelta: 0.1, restSpeed: 0.1 }
421
- }, M = 0.1, U = 1 / 3, rt = (e) => Math.max(0, Math.min(1, e));
430
+ }, M = 0.1, U = 1 / 3, at = (e) => Math.max(0, Math.min(1, e));
422
431
  function pe({
423
432
  direction: e
424
433
  }) {
@@ -429,7 +438,7 @@ function pe({
429
438
  startStyle: {},
430
439
  animate: (s) => ({
431
440
  transform: `scale(${1 + t * s * M})`,
432
- opacity: `${rt(1 - s / U)}`
441
+ opacity: `${at(1 - s / U)}`
433
442
  })
434
443
  },
435
444
  in: {
@@ -440,57 +449,57 @@ function pe({
440
449
  },
441
450
  animate: (s) => ({
442
451
  transform: `scale(${n + t * s * M})`,
443
- opacity: `${rt((s - U) / (1 - U))}`
452
+ opacity: `${at((s - U) / (1 - U))}`
444
453
  })
445
454
  }
446
455
  };
447
456
  }
448
457
  function de() {
449
458
  return {
450
- outPhysics: it,
451
- inPhysics: it,
459
+ outPhysics: rt,
460
+ inPhysics: rt,
452
461
  // Scale must move together on both sides; fade-through is encoded inside
453
462
  // each tick (piecewise), not via composition staggering — so parallel.
454
463
  composition: { mode: "parallel" },
455
464
  build: pe
456
465
  };
457
466
  }
458
- const at = {
467
+ const lt = {
459
468
  spring: { stiffness: 280, damping: 30, restDelta: 0.1, restSpeed: 0.1 }
460
- }, V = 0.1, R = 1 / 3, lt = (e) => Math.max(0, Math.min(1, e));
469
+ }, R = 0.1, V = 1 / 3, ct = (e) => Math.max(0, Math.min(1, e));
461
470
  function fe() {
462
471
  return {
463
472
  out: {
464
473
  willChange: "opacity",
465
474
  startStyle: {},
466
475
  animate: (e) => ({
467
- opacity: `${lt(1 - e / R)}`
476
+ opacity: `${ct(1 - e / V)}`
468
477
  })
469
478
  },
470
479
  in: {
471
480
  willChange: "transform, opacity",
472
481
  startStyle: {
473
- transform: `scale(${1 - V})`,
482
+ transform: `scale(${1 - R})`,
474
483
  opacity: "0"
475
484
  },
476
485
  animate: (e) => ({
477
- transform: `scale(${1 - V + e * V})`,
478
- opacity: `${lt((e - R) / (1 - R))}`
486
+ transform: `scale(${1 - R + e * R})`,
487
+ opacity: `${ct((e - V) / (1 - V))}`
479
488
  })
480
489
  }
481
490
  };
482
491
  }
483
492
  function ye() {
484
493
  return {
485
- outPhysics: at,
486
- inPhysics: at,
494
+ outPhysics: lt,
495
+ inPhysics: lt,
487
496
  composition: { mode: "parallel" },
488
497
  build: fe
489
498
  };
490
499
  }
491
- const ct = de(), he = {
492
- snappy: ct,
493
- directional: ct,
500
+ const pt = de(), he = {
501
+ snappy: pt,
502
+ directional: pt,
494
503
  "non-directional": ye()
495
504
  }, ue = {
496
505
  x: Qt,
@@ -502,7 +511,7 @@ function me(e, t) {
502
511
  return n[t] ?? n.snappy;
503
512
  }
504
513
  const ge = "x", we = "snappy";
505
- function pt(e, t) {
514
+ function dt(e, t) {
506
515
  e.style.willChange = t.willChange, e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint";
507
516
  for (const [n, s] of Object.entries(t.startStyle))
508
517
  e.style[n] = s;
@@ -517,27 +526,27 @@ const be = (e = {}) => {
517
526
  const t = e.direction ?? "forward", n = e.type ?? ge, s = e.feel ?? we, o = me(n, s), i = o.build({ direction: t });
518
527
  return {
519
528
  prepare: ({ from: r, to: l }) => (r.then((c) => {
520
- pt(c, i.out), c.style.pointerEvents = "none";
529
+ dt(c, i.out), c.style.pointerEvents = "none";
521
530
  }), l.then((c) => {
522
- pt(c, i.in);
531
+ dt(c, i.in);
523
532
  }), {}),
524
533
  animation: ({ from: r, to: l, context: c }) => {
525
534
  if (n === "z") {
526
535
  const d = I(c, "from"), f = I(c, "to");
527
536
  r.style.clipPath = `inset(${d.top}px 0 calc(100% - ${d.top + d.height}px) 0)`, l.style.clipPath = `inset(${f.top}px 0 calc(100% - ${f.top + f.height}px) 0)`;
528
537
  }
529
- const a = new g({
538
+ const a = new m({
530
539
  element: r,
531
- integrator: m.from(o.outPhysics),
540
+ integrator: g.from(o.outPhysics),
532
541
  style: (d) => i.out.animate(d),
533
542
  // Restore the reused from node's inline styles on complete. This
534
543
  // covers willChange/backfaceVisibility/contain/transform/opacity (from
535
544
  // applyStartStyle + the WAAPI final frame), pointerEvents (set in
536
545
  // prepare), and clipPath (set above for z; harmless no-op otherwise).
537
546
  onComplete: () => Se(r)
538
- }), p = new g({
547
+ }), p = new m({
539
548
  element: l,
540
- integrator: m.from(o.inPhysics),
549
+ integrator: g.from(o.inPhysics),
541
550
  style: (d) => i.in.animate(d),
542
551
  onComplete: () => It(l)
543
552
  });
@@ -559,7 +568,7 @@ function ws(e) {
559
568
  const Ce = {
560
569
  spring: { stiffness: 200, damping: 22 }
561
570
  }, Ee = 10, xe = "horizontal", Pe = "#000000";
562
- function dt(e, t, n, s, o, i) {
571
+ function ft(e, t, n, s, o, i) {
563
572
  window.getComputedStyle(e).position === "static" && (e.style.position = "relative");
564
573
  const l = document.createElement("div");
565
574
  l.style.cssText = `
@@ -612,7 +621,7 @@ const _e = (e = {}) => {
612
621
  prepare: async ({ from: i, to: r }) => {
613
622
  const l = await i, c = await r;
614
623
  l.style.zIndex = "1000";
615
- const a = dt(
624
+ const a = ft(
616
625
  l,
617
626
  t,
618
627
  n,
@@ -621,7 +630,7 @@ const _e = (e = {}) => {
621
630
  "left"
622
631
  );
623
632
  c.style.position = "relative", c.style.zIndex = "0";
624
- const p = dt(
633
+ const p = ft(
625
634
  c,
626
635
  t,
627
636
  n,
@@ -645,17 +654,17 @@ const _e = (e = {}) => {
645
654
  toContainer: a
646
655
  }) => {
647
656
  const p = r.map(
648
- (y) => new g({
657
+ (y) => new m({
649
658
  element: y,
650
- integrator: m.from(o),
659
+ integrator: g.from(o),
651
660
  style: (h) => ({
652
661
  transform: n === "horizontal" ? `scaleX(${h})` : `scaleY(${h})`
653
662
  })
654
663
  })
655
664
  ), d = c.map(
656
- (y, h) => new g({
665
+ (y, h) => new m({
657
666
  element: y,
658
- integrator: m.from(o),
667
+ integrator: g.from(o),
659
668
  style: (w, S) => ({
660
669
  transform: n === "horizontal" ? `scaleX(${S})` : `scaleY(${S})`
661
670
  }),
@@ -742,7 +751,7 @@ const Fe = {
742
751
  parallax: Ae(),
743
752
  crossfade: Ie()
744
753
  }, ke = "parallax";
745
- function ft(e, t) {
754
+ function yt(e, t) {
746
755
  e.style.willChange = t.willChange, e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint";
747
756
  for (const [n, s] of Object.entries(t.startStyle))
748
757
  e.style[n] = s;
@@ -751,14 +760,14 @@ const Ye = (e = {}) => {
751
760
  const t = e.direction ?? "enter", n = Fe[e.type ?? ke], s = n.physics, o = n.build(t);
752
761
  return {
753
762
  prepare: ({ from: i, to: r }) => (i.then((l) => {
754
- ft(l, o.out), l.style.pointerEvents = "none", l.style.zIndex = t === "enter" ? "-1" : "100";
763
+ yt(l, o.out), l.style.pointerEvents = "none", l.style.zIndex = t === "enter" ? "-1" : "100";
755
764
  }), r.then((l) => {
756
- ft(l, o.in);
765
+ yt(l, o.in);
757
766
  }), {}),
758
767
  animation: ({ from: i, to: r }) => {
759
- const l = new g({
768
+ const l = new m({
760
769
  element: i,
761
- integrator: m.from(s),
770
+ integrator: g.from(s),
762
771
  style: (a) => o.out.animate(a),
763
772
  // The outgoing node is the real, reused element (re-hidden on navigate),
764
773
  // so clear every inline style we set on it — mirroring the `to` cleanup,
@@ -766,9 +775,9 @@ const Ye = (e = {}) => {
766
775
  onComplete: () => {
767
776
  i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "", i.style.transform = "", i.style.opacity = "", i.style.pointerEvents = "", i.style.zIndex = "";
768
777
  }
769
- }), c = new g({
778
+ }), c = new m({
770
779
  element: r,
771
- integrator: m.from(s),
780
+ integrator: g.from(s),
772
781
  style: (a) => o.in.animate(a),
773
782
  onComplete: () => {
774
783
  r.style.willChange = "auto", r.style.backfaceVisibility = "", r.style.contain = "", r.style.transform = "", r.style.opacity = "";
@@ -799,18 +808,18 @@ const He = {
799
808
  o.style.opacity = "0", o.style.willChange = "opacity";
800
809
  }), {}),
801
810
  animation: ({ from: s, to: o }) => {
802
- const i = new g({
811
+ const i = new m({
803
812
  element: s,
804
- integrator: m.from(n),
813
+ integrator: g.from(n),
805
814
  // Default bounds (0, 1). `u` runs 1→0 as the animation moves
806
815
  // forward, mapping opacity from fully visible to invisible.
807
816
  style: (l, c) => ({ opacity: c }),
808
817
  onComplete: () => {
809
818
  s.style.willChange = "auto", s.style.opacity = "";
810
819
  }
811
- }), r = new g({
820
+ }), r = new m({
812
821
  element: o,
813
- integrator: m.from(t),
822
+ integrator: g.from(t),
814
823
  style: (l) => ({ opacity: l }),
815
824
  onComplete: () => {
816
825
  o.style.willChange = "auto", o.style.opacity = "";
@@ -832,9 +841,9 @@ const z = {
832
841
  scaleDown: 0,
833
842
  translate: 0.2,
834
843
  scaleUp: 0.8
835
- }, Ve = 0.8, Re = "white", yt = 1e3 / 60, ze = 600;
844
+ }, Re = 0.8, Ve = "white", ht = 1e3 / 60, ze = 600;
836
845
  function Ne(e) {
837
- const { items: t, from: n, to: s, recordFrame: o } = e, i = yt / 1e3, r = Math.abs(s - n), l = t.map((a) => ({
846
+ const { items: t, from: n, to: s, recordFrame: o } = e, i = ht / 1e3, r = Math.abs(s - n), l = t.map((a) => ({
838
847
  item: a,
839
848
  integrator: new k({
840
849
  stiffness: a.spring.stiffness,
@@ -850,10 +859,10 @@ function Ne(e) {
850
859
  o(0);
851
860
  let c = 0;
852
861
  for (let a = 1; a <= ze; a++) {
853
- const p = a * yt;
862
+ const p = a * ht;
854
863
  c = p;
855
864
  for (const d of l)
856
- !d.started || d.settled || (d.state = d.integrator.step(d.state, s, i), d.integrator.isSettled(d.state, s) ? (d.settleTime += i, d.settleTime >= Vt && (d.state = { position: s, velocity: 0 }, d.settled = !0)) : d.settleTime = 0, d.item.tick(d.state.position));
865
+ !d.started || d.settled || (d.state = d.integrator.step(d.state, s, i), d.integrator.isSettled(d.state, s) ? (d.settleTime += i, d.settleTime >= Rt && (d.state = { position: s, velocity: 0 }, d.settled = !0)) : d.settleTime = 0, d.item.tick(d.state.position));
857
866
  for (let d = 1; d < l.length; d++) {
858
867
  const f = l[d];
859
868
  if (f.started) continue;
@@ -871,7 +880,7 @@ function N(e, t) {
871
880
  damping: e.spring.damping
872
881
  } : t;
873
882
  }
874
- function ht(e) {
883
+ function ut(e) {
875
884
  const { rect: t, scale: n, direction: s, override: o } = e, i = s === "out" ? { scale: 1, translateY: -t.top } : { scale: n, translateY: -t.top + t.height }, r = N(o, z.scaleDown), l = N(o, z.translate), c = N(o, z.scaleUp), a = s === "out" ? 1 : 0, p = s === "out" ? 0 : 1, d = s === "out" ? [
876
885
  {
877
886
  spring: r,
@@ -1015,11 +1024,11 @@ function We(e, t) {
1015
1024
  )
1016
1025
  };
1017
1026
  }
1018
- function ut(e, t) {
1027
+ function mt(e, t) {
1019
1028
  const n = t.left + t.width / 2, s = t.top + t.height / 2;
1020
1029
  e.style.transformOrigin = `${n}px ${s}px`;
1021
1030
  }
1022
- function mt(e, t) {
1031
+ function gt(e, t) {
1023
1032
  e.style.clipPath = `polygon(
1024
1033
  ${t.left}px ${t.top}px,
1025
1034
  ${t.left + t.width}px ${t.top}px,
@@ -1029,7 +1038,7 @@ function mt(e, t) {
1029
1038
  }
1030
1039
  function X(e, t, n, s, o) {
1031
1040
  const i = n / 1e3;
1032
- return new g({
1041
+ return new m({
1033
1042
  element: e,
1034
1043
  integrator: new Wt({ durationSec: i }),
1035
1044
  lowerBound: 0,
@@ -1040,7 +1049,7 @@ function X(e, t, n, s, o) {
1040
1049
  }
1041
1050
  const Ze = (e = {}) => {
1042
1051
  var o;
1043
- const t = ((o = e.border) == null ? void 0 : o.color) ?? Re, n = Ve, s = e.physics;
1052
+ const t = ((o = e.border) == null ? void 0 : o.color) ?? Ve, n = Re, s = e.physics;
1044
1053
  return {
1045
1054
  prepare: ({ from: i, to: r, context: l }) => {
1046
1055
  const c = I(l, "from"), a = I(l, "to"), p = J(document.body, l.positionedParent), d = We(t, {
@@ -1055,18 +1064,18 @@ const Ze = (e = {}) => {
1055
1064
  ])
1056
1065
  l.positionedParent.appendChild(d[f]);
1057
1066
  return i.then((f) => {
1058
- ut(f, c), mt(f, c), f.style.transform = `translateY(${-c.top}px)`;
1067
+ mt(f, c), gt(f, c), f.style.transform = `translateY(${-c.top}px)`;
1059
1068
  }), r.then((f) => {
1060
- ut(f, a), mt(f, a), f.style.transform = `translateY(${-a.top + a.height}px) scale(${n})`;
1069
+ mt(f, a), gt(f, a), f.style.transform = `translateY(${-a.top + a.height}px) scale(${n})`;
1061
1070
  }), { borders: d, fromRect: c, toRect: a };
1062
1071
  },
1063
1072
  animation: ({ from: i, to: r, context: l, borders: c, fromRect: a, toRect: p }) => {
1064
- const d = ht({
1073
+ const d = ut({
1065
1074
  rect: a,
1066
1075
  scale: n,
1067
1076
  direction: "out",
1068
1077
  override: s
1069
- }), f = ht({
1078
+ }), f = ut({
1070
1079
  rect: p,
1071
1080
  scale: n,
1072
1081
  direction: "in",
@@ -1125,7 +1134,7 @@ function Cs(e) {
1125
1134
  const { paths: t, options: n } = e, s = (n == null ? void 0 : n.borderColor) !== void 0 ? { border: { color: n.borderColor } } : void 0;
1126
1135
  return v(t, () => Ze(s));
1127
1136
  }
1128
- const gt = "data-hero-enter-key", wt = "data-hero-exit-key", B = "data-hero-key";
1137
+ const wt = "data-hero-enter-key", St = "data-hero-exit-key", B = "data-hero-key";
1129
1138
  class qe {
1130
1139
  constructor() {
1131
1140
  $(this, "previousFromOpacity", "");
@@ -1148,14 +1157,14 @@ class Ke {
1148
1157
  return s.style.opacity = "0", n.style.willChange = "opacity", s.style.willChange = "opacity", i(() => {
1149
1158
  n.style.opacity = r, s.style.opacity = l, n.style.willChange = c, s.style.willChange = a;
1150
1159
  }), [
1151
- new g({
1160
+ new m({
1152
1161
  element: n,
1153
- integrator: m.from(o),
1162
+ integrator: g.from(o),
1154
1163
  style: (p, d) => ({ opacity: d })
1155
1164
  }),
1156
- new g({
1165
+ new m({
1157
1166
  element: s,
1158
- integrator: m.from(o),
1167
+ integrator: g.from(o),
1159
1168
  style: (p) => ({ opacity: p })
1160
1169
  })
1161
1170
  ];
@@ -1181,7 +1190,7 @@ function ln(e) {
1181
1190
  const t = parseFloat(e);
1182
1191
  return Number.isFinite(t) && t > 0 ? t : null;
1183
1192
  }
1184
- function St(e) {
1193
+ function bt(e) {
1185
1194
  const t = e.getAttribute(an);
1186
1195
  if (!t) return 0;
1187
1196
  const n = parseFloat(t);
@@ -1211,7 +1220,7 @@ function pn(e, t, n) {
1211
1220
  height: i
1212
1221
  };
1213
1222
  }
1214
- function bt(e, t, n) {
1223
+ function $t(e, t, n) {
1215
1224
  const s = J(e, t), o = ln(t.getAttribute(rn));
1216
1225
  if (o === null)
1217
1226
  return {
@@ -1246,7 +1255,7 @@ function A(e, t) {
1246
1255
  return n;
1247
1256
  }
1248
1257
  function fn(e, t) {
1249
- const n = [], s = A(t, gt), o = A(e, wt);
1258
+ const n = [], s = A(t, wt), o = A(e, St);
1250
1259
  for (const [l, c] of s) {
1251
1260
  const a = o.get(l);
1252
1261
  a && n.push({
@@ -1257,7 +1266,7 @@ function fn(e, t) {
1257
1266
  toFit: "contain"
1258
1267
  });
1259
1268
  }
1260
- const i = A(e, gt), r = A(t, wt);
1269
+ const i = A(e, wt), r = A(t, St);
1261
1270
  for (const [l, c] of i) {
1262
1271
  const a = r.get(l);
1263
1272
  a && n.push({
@@ -1295,7 +1304,7 @@ function hn(e, t) {
1295
1304
  return n.length > 0 ? n : yn(e, t);
1296
1305
  }
1297
1306
  function un(e, t, n) {
1298
- const { fromEl: s, toEl: o } = t, i = bt(e, s, t.fromFit), r = bt(e, o, t.toFit), l = i.content, c = i.window, a = r.content, p = r.window, d = r.clipInset, f = St(s), u = St(o);
1307
+ const { fromEl: s, toEl: o } = t, i = $t(e, s, t.fromFit), r = $t(e, o, t.toFit), l = i.content, c = i.window, a = r.content, p = r.window, d = r.clipInset, f = bt(s), u = bt(o);
1299
1308
  if (l.width === 0 || l.height === 0 || c.width === 0 || c.height === 0 || a.width === 0 || a.height === 0 || p.width === 0 || p.height === 0)
1300
1309
  return null;
1301
1310
  const y = Math.max(
@@ -1336,9 +1345,9 @@ class gn {
1336
1345
  a.style.opacity = "0", p.style.opacity = "0", r(() => {
1337
1346
  a.style.opacity = u, p.style.opacity = y, f.parentElement && f.parentElement.removeChild(f);
1338
1347
  }), l.push(
1339
- new g({
1348
+ new m({
1340
1349
  element: f,
1341
- integrator: m.from(s),
1350
+ integrator: g.from(s),
1342
1351
  style: d.styleFor
1343
1352
  })
1344
1353
  );
@@ -1420,9 +1429,9 @@ const bn = {
1420
1429
  c.style.transformOrigin = `${d}px ${f}px`, c.style.position = "fixed", c.style.top = `${a.top}px`, c.style.left = `${a.left}px`, c.style.width = `${a.width}px`, c.style.height = `${a.height}px`, c.style.zIndex = "1000", c.style.overflow = "hidden", c.style.transform = `rotate(${n}deg) scale(${s}) translateZ(0)`, c.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", c.style.opacity = "1";
1421
1430
  }), {}),
1422
1431
  animation: ({ from: i, to: r }) => {
1423
- const l = new g({
1432
+ const l = new m({
1424
1433
  element: i,
1425
- integrator: m.from($n),
1434
+ integrator: g.from($n),
1426
1435
  style: (a, p) => ({ opacity: p }),
1427
1436
  // The outgoing node is reused (re-hidden, shown again on the next
1428
1437
  // navigation), so reset every inline style we wrote to it — mirroring
@@ -1431,9 +1440,9 @@ const bn = {
1431
1440
  onComplete: () => {
1432
1441
  i.style.opacity = "";
1433
1442
  }
1434
- }), c = new g({
1443
+ }), c = new m({
1435
1444
  element: r,
1436
- integrator: m.from(t),
1445
+ integrator: g.from(t),
1437
1446
  style: (a) => {
1438
1447
  let p;
1439
1448
  if (a <= 0.05)
@@ -1488,9 +1497,9 @@ const En = {
1488
1497
  o.style.opacity = "0", o.style.transform = "rotate(-180deg)", o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
1489
1498
  }), {}),
1490
1499
  animation: ({ from: n, to: s }) => {
1491
- const o = new g({
1500
+ const o = new m({
1492
1501
  element: n,
1493
- integrator: m.from(t),
1502
+ integrator: g.from(t),
1494
1503
  style: (r) => ({
1495
1504
  transform: `rotate(${r * 180}deg)`,
1496
1505
  opacity: r < 0.5 ? 1 : 0
@@ -1501,9 +1510,9 @@ const En = {
1501
1510
  onComplete: () => {
1502
1511
  n.style.willChange = "auto", n.style.transform = "", n.style.transformOrigin = "", n.style.opacity = "";
1503
1512
  }
1504
- }), i = new g({
1513
+ }), i = new m({
1505
1514
  element: s,
1506
- integrator: m.from(t),
1515
+ integrator: g.from(t),
1507
1516
  // u runs 1→0, so -u*180 unwinds -180→0.
1508
1517
  style: (r, l) => ({
1509
1518
  transform: `rotate(${-l * 180}deg)`,
@@ -1529,7 +1538,7 @@ const Pn = {
1529
1538
  restDelta: 1e-3,
1530
1539
  restSpeed: 1e-3
1531
1540
  }
1532
- }, $t = (e = {}) => {
1541
+ }, Ct = (e = {}) => {
1533
1542
  const t = e.direction ?? "up", n = e.physics ?? Pn, s = t === "up";
1534
1543
  return {
1535
1544
  prepare: ({ from: o, to: i }) => (o.then((r) => {
@@ -1538,9 +1547,9 @@ const Pn = {
1538
1547
  r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint";
1539
1548
  }), {}),
1540
1549
  animation: ({ from: o, to: i }) => {
1541
- const r = o.offsetHeight, l = i.offsetHeight, c = window.innerHeight, a = Math.max(Math.min(r, l), c), p = new g({
1550
+ const r = o.offsetHeight, l = i.offsetHeight, c = window.innerHeight, a = Math.max(Math.min(r, l), c), p = new m({
1542
1551
  element: o,
1543
- integrator: m.from(n),
1552
+ integrator: g.from(n),
1544
1553
  style: (f) => ({ transform: `translate3d(0, ${s ? -a * f : a * f}px, 0)` }),
1545
1554
  // The outgoing node is the real, reused element (re-hidden then shown
1546
1555
  // again on the next navigation), so mirror the incoming cleanup and
@@ -1550,9 +1559,9 @@ const Pn = {
1550
1559
  onComplete: () => {
1551
1560
  o.style.willChange = "auto", o.style.backfaceVisibility = "", o.style.contain = "", o.style.transform = "", o.style.pointerEvents = "", o.style.zIndex = "";
1552
1561
  }
1553
- }), d = new g({
1562
+ }), d = new m({
1554
1563
  element: i,
1555
- integrator: m.from(n),
1564
+ integrator: g.from(n),
1556
1565
  style: (f, u) => ({ transform: `translate3d(0, ${s ? u * a : u * -a}px, 0)` }),
1557
1566
  onComplete: () => {
1558
1567
  i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "", i.style.transform = "";
@@ -1566,11 +1575,11 @@ function _s(e) {
1566
1575
  const { paths: t, type: n = "directional" } = e;
1567
1576
  return n === "non-directional" ? v(
1568
1577
  t,
1569
- () => $t({ direction: "up" })
1578
+ () => Ct({ direction: "up" })
1570
1579
  ) : G(
1571
1580
  t,
1572
1581
  { forward: "up", backward: "down" },
1573
- (s) => $t({ direction: s })
1582
+ (s) => Ct({ direction: s })
1574
1583
  );
1575
1584
  }
1576
1585
  const _n = {
@@ -1637,9 +1646,9 @@ const An = {
1637
1646
  transform: `translate3d(0, ${P * d.height}px, 0)`
1638
1647
  }) : (E) => ({
1639
1648
  transform: `translate3d(0, ${E * d.height}px, 0)`
1640
- }), y = new g({
1649
+ }), y = new m({
1641
1650
  element: a,
1642
- integrator: m.from(s),
1651
+ integrator: g.from(s),
1643
1652
  style: u,
1644
1653
  onComplete: () => {
1645
1654
  a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.clipPath = "", a.style.transform = "", f();
@@ -1652,9 +1661,9 @@ const An = {
1652
1661
  t === "enter" ? "from" : "to"
1653
1662
  ), w = h.left + h.width / 2, S = h.top + h.height / 2;
1654
1663
  p.style.clipPath = `inset(${h.top}px 0 calc(100% - ${h.top + h.height}px) 0)`, p.style.transformOrigin = `${w}px ${S}px`;
1655
- const b = t === "enter" ? (E, P) => o.enterStyle(E, P) : (E) => o.exitStyle(E), x = new g({
1664
+ const b = t === "enter" ? (E, P) => o.enterStyle(E, P) : (E) => o.exitStyle(E), x = new m({
1656
1665
  element: p,
1657
- integrator: m.from(s),
1666
+ integrator: g.from(s),
1658
1667
  style: b,
1659
1668
  // On `exit` the background is the incoming (`to`) node; on `enter` it is
1660
1669
  // the reused outgoing (`from`) node — in both cases its inline styles
@@ -1694,9 +1703,9 @@ const Hn = {
1694
1703
  r.style.transform = `translate3d(${l}%, 0, 0)`, r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint";
1695
1704
  }), {}),
1696
1705
  animation: ({ from: o, to: i }) => {
1697
- const r = new g({
1706
+ const r = new m({
1698
1707
  element: o,
1699
- integrator: m.from(n),
1708
+ integrator: g.from(n),
1700
1709
  style: (c) => ({ transform: `translate3d(${s ? -100 * c : 100 * c}%, 0, 0)` }),
1701
1710
  // The outgoing node is the real Activity page and gets reused on the
1702
1711
  // next navigation, so reset every inline style we wrote to it (mirror
@@ -1704,9 +1713,9 @@ const Hn = {
1704
1713
  onComplete: () => {
1705
1714
  o.style.willChange = "auto", o.style.backfaceVisibility = "", o.style.contain = "", o.style.transform = "", o.style.pointerEvents = "";
1706
1715
  }
1707
- }), l = new g({
1716
+ }), l = new m({
1708
1717
  element: i,
1709
- integrator: m.from(n),
1718
+ integrator: g.from(n),
1710
1719
  style: (c, a) => ({ transform: `translate3d(${s ? a * 100 : a * -100}%, 0, 0)` }),
1711
1720
  onComplete: () => {
1712
1721
  i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "", i.style.transform = "";
@@ -1726,7 +1735,7 @@ function vs(e) {
1726
1735
  }
1727
1736
  const Un = {
1728
1737
  spring: { stiffness: 17, damping: 6 }
1729
- }, Z = 20, F = 800, Vn = (e = {}) => {
1738
+ }, Z = 20, F = 800, Rn = (e = {}) => {
1730
1739
  const t = e.physics ?? Un;
1731
1740
  return {
1732
1741
  prepare: ({ from: n, to: s }) => (n.then((o) => {
@@ -1735,9 +1744,9 @@ const Un = {
1735
1744
  o.style.willChange = "transform", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint", o.style.transform = `perspective(${F}px) rotateY(${Z}deg) translate3d(-100%, 0, 0)`;
1736
1745
  }), {}),
1737
1746
  animation: ({ from: n, to: s }) => {
1738
- const o = new g({
1747
+ const o = new m({
1739
1748
  element: n,
1740
- integrator: m.from(t),
1749
+ integrator: g.from(t),
1741
1750
  style: (r) => {
1742
1751
  const l = -r * Z, c = r * 100;
1743
1752
  return {
@@ -1750,9 +1759,9 @@ const Un = {
1750
1759
  onComplete: () => {
1751
1760
  n.style.transform = "", n.style.willChange = "auto", n.style.backfaceVisibility = "", n.style.contain = "", n.style.pointerEvents = "";
1752
1761
  }
1753
- }), i = new g({
1762
+ }), i = new m({
1754
1763
  element: s,
1755
- integrator: m.from(t),
1764
+ integrator: g.from(t),
1756
1765
  style: (r, l) => {
1757
1766
  const c = l * Z, a = -l * 100;
1758
1767
  return {
@@ -1769,18 +1778,9 @@ const Un = {
1769
1778
  };
1770
1779
  function Is(e) {
1771
1780
  const { paths: t } = e;
1772
- return v(t, () => Vn());
1773
- }
1774
- function Ct(e, t) {
1775
- const n = e.getBoundingClientRect(), s = t.getBoundingClientRect();
1776
- return new DOMRect(
1777
- s.left - n.left,
1778
- s.top - n.top,
1779
- s.width,
1780
- s.height
1781
- );
1781
+ return v(t, () => Rn());
1782
1782
  }
1783
- function Rn({
1783
+ function Vn({
1784
1784
  enterRect: e,
1785
1785
  exitRect: t,
1786
1786
  pageRect: n,
@@ -1880,9 +1880,9 @@ class Zn {
1880
1880
  contribute(t) {
1881
1881
  const { from: n, to: s, resolved: o, physics: i } = t, r = o.mode === "enter", l = r ? n : s, c = r ? Bn() : Wn();
1882
1882
  return c && (l.style.transformOrigin = c.transformOrigin), [
1883
- new g({
1883
+ new m({
1884
1884
  element: l,
1885
- integrator: m.from(i),
1885
+ integrator: g.from(i),
1886
1886
  style: r ? (a, p) => c.animate(p) : (a) => c.animate(a)
1887
1887
  })
1888
1888
  ];
@@ -1896,9 +1896,9 @@ class qn {
1896
1896
  contribute(t) {
1897
1897
  const n = t.extras.overlay;
1898
1898
  return n ? (n.style.zIndex = t.resolved.mode === "enter" ? "-1" : "1", [
1899
- new g({
1899
+ new m({
1900
1900
  element: n,
1901
- integrator: m.from(t.physics),
1901
+ integrator: g.from(t.physics),
1902
1902
  style: (s) => q.style(t.resolved.mode, s)
1903
1903
  })
1904
1904
  ]) : [];
@@ -1950,9 +1950,9 @@ class Jn {
1950
1950
  contribute(t) {
1951
1951
  const { from: n, to: s, resolved: o, input: i, physics: r } = t, l = o.mode === "enter", c = l ? n : s, a = l ? Kn(i) : Gn(i);
1952
1952
  return a && (c.style.transformOrigin = a.transformOrigin), [
1953
- new g({
1953
+ new m({
1954
1954
  element: c,
1955
- integrator: m.from(r),
1955
+ integrator: g.from(r),
1956
1956
  style: l ? (p, d) => a.animate(d) : (p) => a.animate(p)
1957
1957
  })
1958
1958
  ];
@@ -2029,11 +2029,11 @@ function is(e, t) {
2029
2029
  }
2030
2030
  function rs(e, t, n, s) {
2031
2031
  return {
2032
- enterRect: Ct(
2032
+ enterRect: tt(
2033
2033
  e.mode === "enter" ? n : t,
2034
2034
  e.enterEl
2035
2035
  ),
2036
- exitRect: Ct(
2036
+ exitRect: tt(
2037
2037
  e.mode === "enter" ? t : n,
2038
2038
  e.exitEl
2039
2039
  ),
@@ -2050,15 +2050,15 @@ class as {
2050
2050
  });
2051
2051
  }
2052
2052
  contribute(t) {
2053
- const { from: n, to: s, resolved: o, input: i, physics: r, onComplete: l } = t, c = o.mode === "enter", a = c ? Rn(i) : zn(i), p = c ? s : n, d = c ? "t" : "u";
2053
+ const { from: n, to: s, resolved: o, input: i, physics: r, onComplete: l } = t, c = o.mode === "enter", a = c ? Vn(i) : zn(i), p = c ? s : n, d = c ? "t" : "u";
2054
2054
  a && (p.style.transformOrigin = a.transformOrigin);
2055
2055
  const f = c ? "-2" : "2", u = n.style.zIndex;
2056
2056
  return n.style.zIndex = f, l(() => {
2057
2057
  p.style.willChange = "auto", p.style.backfaceVisibility = "", p.style.transformOrigin = "", p.style.contain = "", n.style.zIndex = u, n.style.willChange = "auto", n.style.backfaceVisibility = "", n.style.transformOrigin = "", n.style.contain = "", n.style.transform = "", n.style.clipPath = "";
2058
2058
  }), [
2059
- new g({
2059
+ new m({
2060
2060
  element: p,
2061
- integrator: m.from(r),
2061
+ integrator: g.from(r),
2062
2062
  // Enter: tile expands as `t` (0 → 1). Exit: tile shrinks as `u` —
2063
2063
  // the legacy convention from v5's outAnim path. Either way, feed
2064
2064
  // the progress that matches the tileConfig's authored direction.
@@ -2080,9 +2080,9 @@ class ls {
2080
2080
  d && (d.style.opacity = a[p] ?? "");
2081
2081
  }
2082
2082
  }), c.map(
2083
- (p) => new g({
2083
+ (p) => new m({
2084
2084
  element: p,
2085
- integrator: m.from(s),
2085
+ integrator: g.from(s),
2086
2086
  style: (d, f) => ({
2087
2087
  opacity: n.mode === "enter" ? d : f
2088
2088
  })
@@ -2167,6 +2167,13 @@ const ys = (e) => {
2167
2167
  }
2168
2168
  };
2169
2169
  }
2170
+ for (const y of f) {
2171
+ if (!(y instanceof m)) continue;
2172
+ const h = y.onComplete;
2173
+ y.onComplete = () => {
2174
+ h == null || h(), y.releaseFill();
2175
+ };
2176
+ }
2170
2177
  return new C(f, { mode: "parallel" });
2171
2178
  }
2172
2179
  };
@@ -2185,7 +2192,7 @@ function Ts(e) {
2185
2192
  export {
2186
2193
  Fs as Animation,
2187
2194
  C as MultiAnimation,
2188
- g as WebAnimation,
2195
+ m as WebAnimation,
2189
2196
  ws as axis,
2190
2197
  Ss as blind,
2191
2198
  bs as drill,