@ssgoi/core 2.5.4 → 2.5.5

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,10 +1,10 @@
1
1
  var _ = Object.defineProperty;
2
- var $ = (n, t, e) => t in n ? _(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var m = (n, t, e) => $(n, typeof t != "symbol" ? t + "" : t, e);
2
+ var F = (n, t, e) => t in n ? _(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var m = (n, t, e) => F(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { isMultiSpring as V } from "./types.js";
5
5
  import { isSingleSpring as at } from "./types.js";
6
- import { j as lt } from "./jaemin-BAi8PTrj.js";
7
- class H {
6
+ import { j as lt } from "./jaemin-BWkrXq0V.js";
7
+ class $ {
8
8
  constructor() {
9
9
  m(this, "listeners", /* @__PURE__ */ new Set());
10
10
  m(this, "rafId", null);
@@ -18,19 +18,21 @@ class H {
18
18
  // ms - detect tab switches, backgrounding
19
19
  m(this, "adjustedLag", 33);
20
20
  // ms - max time jump to prevent animation skip
21
+ m(this, "maxDeltaTime", 33);
22
+ // ms - clamp for physics stability (30fps minimum)
21
23
  // FPS throttling
22
24
  m(this, "gap", 1e3 / 240);
23
25
  // max 240fps
24
26
  m(this, "nextTime", this.gap);
25
27
  m(this, "tick", () => {
26
28
  const t = Date.now();
27
- let e = t - this.lastUpdate;
28
- (e > this.lagThreshold || e < 0) && (this.startTime += e - this.adjustedLag, e = this.adjustedLag), this.lastUpdate = t;
29
- const i = t - this.startTime, o = i - this.nextTime;
29
+ let i = t - this.lastUpdate;
30
+ i > this.lagThreshold || i < 0 ? (this.startTime += i - this.adjustedLag, i = this.adjustedLag) : i > this.maxDeltaTime && (i = this.maxDeltaTime), this.lastUpdate = t;
31
+ const r = t - this.startTime, o = r - this.nextTime;
30
32
  if (o > 0) {
31
- const r = e / 1e3;
32
- this.elapsed = i / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((s) => {
33
- s(r, this.elapsed);
33
+ const s = i / 1e3;
34
+ this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((d) => {
35
+ d(s, this.elapsed);
34
36
  });
35
37
  }
36
38
  this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
@@ -66,28 +68,28 @@ class H {
66
68
  return this.elapsed;
67
69
  }
68
70
  }
69
- const I = new H();
71
+ const I = new $();
70
72
  function k(n) {
71
73
  const {
72
74
  from: t,
73
75
  to: e,
74
76
  stiffness: i,
75
- damping: o,
76
- mass: r,
77
+ damping: r,
78
+ mass: o,
77
79
  velocity: s = 0,
78
80
  onUpdate: d,
79
81
  onComplete: l
80
82
  } = n;
81
83
  let h = t, u = s, a = !0;
82
- const p = Math.sqrt(i / r), c = o / (2 * Math.sqrt(i * r)), g = 0.01, w = 0.01;
84
+ const p = Math.sqrt(i / o), c = r / (2 * Math.sqrt(i * o)), g = 0.01, w = 0.01;
83
85
  let f = 0;
84
- const y = 0.05, S = (C) => {
86
+ const y = 0.05, S = (T) => {
85
87
  if (!a) return;
86
- const T = Math.min(C, 0.033), v = -2 * T * c * p * u, b = T * p * p * (e - h);
87
- u += v + b, h += T * u;
88
+ const C = Math.min(T, 0.033), v = -2 * C * c * p * u, b = C * p * p * (e - h);
89
+ u += v + b, h += C * u;
88
90
  const E = Math.abs(e - h), A = Math.abs(u);
89
91
  if (E < g && A < w) {
90
- if (f += T, f >= y) {
92
+ if (f += C, f >= y) {
91
93
  h = e, u = 0, a = !1, d(h), I.unsubscribe(S), l();
92
94
  return;
93
95
  }
@@ -120,18 +122,18 @@ class O {
120
122
  this.animateObject(e);
121
123
  return;
122
124
  }
123
- let i = this.currentValue, o = performance.now();
124
- const r = {
125
+ let i = this.currentValue, r = performance.now();
126
+ const o = {
125
127
  from: this.currentValue,
126
128
  to: e,
127
129
  stiffness: this.options.spring.stiffness,
128
130
  damping: this.options.spring.damping,
129
131
  mass: 1
130
132
  };
131
- typeof this.velocity == "number" && (r.velocity = this.velocity * 1e3), this.controls = k({
132
- ...r,
133
+ typeof this.velocity == "number" && (o.velocity = this.velocity * 1e3), this.controls = k({
134
+ ...o,
133
135
  onUpdate: (s) => {
134
- const d = performance.now(), l = (d - o) / 1e3;
136
+ const d = performance.now(), l = (d - r) / 1e3;
135
137
  if (l > 0) {
136
138
  if (typeof s == "number" && typeof i == "number") {
137
139
  const h = (s - i) / l;
@@ -146,7 +148,7 @@ class O {
146
148
  }
147
149
  }), this.velocity = h;
148
150
  }
149
- i = s, o = d;
151
+ i = s, r = d;
150
152
  }
151
153
  this.currentValue = s, this.options.onUpdate(s);
152
154
  },
@@ -160,7 +162,7 @@ class O {
160
162
  m(this, "animateObject", (t) => {
161
163
  const e = this.currentValue, i = Object.keys(e);
162
164
  this.animationMap = /* @__PURE__ */ new Map(), this.activeAnimations.clear(), this.completedAnimations.clear(), this.updatedProperties.clear();
163
- const o = { ...e }, r = {};
165
+ const r = { ...e }, o = {};
164
166
  let s = !1;
165
167
  const d = () => {
166
168
  const l = i.filter((u) => !this.completedAnimations.has(u));
@@ -169,15 +171,15 @@ class O {
169
171
  ) && l.length > 0) {
170
172
  if (typeof this.velocity == "object" && this.velocity) {
171
173
  const u = performance.now();
172
- Object.keys(o).forEach((a) => {
173
- if (r[a]) {
174
- const p = (u - r[a]) / 1e3, c = this.currentValue[a], g = o[a];
174
+ Object.keys(r).forEach((a) => {
175
+ if (o[a]) {
176
+ const p = (u - o[a]) / 1e3, c = this.currentValue[a], g = r[a];
175
177
  typeof c == "number" && typeof g == "number" && p > 0 && (this.velocity[a] = (g - c) / p / 1e3);
176
178
  }
177
- r[a] = u;
179
+ o[a] = u;
178
180
  });
179
181
  }
180
- this.currentValue = { ...o }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !s && this.options.onStart && (s = !0, this.options.onStart());
182
+ this.currentValue = { ...r }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !s && this.options.onStart && (s = !0, this.options.onStart());
181
183
  }
182
184
  };
183
185
  i.forEach((l) => {
@@ -193,7 +195,7 @@ class O {
193
195
  const u = k({
194
196
  ...h,
195
197
  onUpdate: (a) => {
196
- o[l] = a, this.updatedProperties.add(l), d();
198
+ r[l] = a, this.updatedProperties.add(l), d();
197
199
  },
198
200
  onComplete: () => {
199
201
  this.completedAnimations.add(l), this.updatedProperties.delete(l), this.completedAnimations.size === i.length && (this.currentValue = t, this.isAnimating = !1, this.animationMap = null, typeof this.velocity == "object" && this.velocity && Object.keys(this.velocity).forEach((a) => {
@@ -323,9 +325,9 @@ class j {
323
325
  */
324
326
  normalizeSchedule(t) {
325
327
  const e = this.config.schedule ?? "overlap";
326
- return this.springOrder.map((i, o) => {
327
- const r = this.animators.get(i);
328
- if (!r)
328
+ return this.springOrder.map((i, r) => {
329
+ const o = this.animators.get(i);
330
+ if (!o)
329
331
  throw new Error(
330
332
  `AnimationScheduler: animator with id "${i}" not found during normalization`
331
333
  );
@@ -336,11 +338,11 @@ class j {
336
338
  delay: 0
337
339
  };
338
340
  if (e === "wait")
339
- return t === "forward" && o === 0 ? {
341
+ return t === "forward" && r === 0 ? {
340
342
  type: "offset",
341
343
  id: i,
342
344
  delay: 0
343
- } : t === "backward" && o === this.springOrder.length - 1 ? {
345
+ } : t === "backward" && r === this.springOrder.length - 1 ? {
344
346
  type: "offset",
345
347
  id: i,
346
348
  delay: 0
@@ -348,7 +350,7 @@ class j {
348
350
  type: "wait",
349
351
  id: i
350
352
  };
351
- const s = r.item.offset ?? 0;
353
+ const s = o.item.offset ?? 0;
352
354
  if (t === "forward")
353
355
  return {
354
356
  type: "offset",
@@ -368,7 +370,7 @@ class j {
368
370
  });
369
371
  }
370
372
  onAnimatorComplete(t) {
371
- var i, o, r, s, d, l;
373
+ var i, r, o, s, d, l;
372
374
  const e = this.animators.get(t);
373
375
  if (!e) {
374
376
  console.warn(
@@ -376,7 +378,7 @@ class j {
376
378
  );
377
379
  return;
378
380
  }
379
- this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (i = e.item).onComplete) == null || o.call(i), (s = (r = this.config).onProgress) == null || s.call(r, this.completedCount, this.config.springs.length), this.handleWaitModeChaining(t), this.completedCount === this.config.springs.length && ((l = (d = this.config).onEnd) == null || l.call(d)));
381
+ this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (r = (i = e.item).onComplete) == null || r.call(i), (s = (o = this.config).onProgress) == null || s.call(o, this.completedCount, this.config.springs.length), this.handleWaitModeChaining(t), this.completedCount === this.config.springs.length && ((l = (d = this.config).onEnd) == null || l.call(d)));
380
382
  }
381
383
  /**
382
384
  * Handle wait mode chaining: start next/previous spring after completion
@@ -386,18 +388,18 @@ class j {
386
388
  return;
387
389
  const e = this.springOrder.indexOf(t);
388
390
  if (this.direction === "forward") {
389
- const r = this.springOrder[e + 1];
390
- if (!r)
391
+ const o = this.springOrder[e + 1];
392
+ if (!o)
391
393
  return;
392
- const s = this.animators.get(r);
393
- s && s.startTime === null && this.startAnimator(r);
394
+ const s = this.animators.get(o);
395
+ s && s.startTime === null && this.startAnimator(o);
394
396
  return;
395
397
  }
396
398
  const i = this.springOrder[e - 1];
397
399
  if (!i)
398
400
  return;
399
- const o = this.animators.get(i);
400
- o && o.startTime === null && this.startBackwardAnimator(i);
401
+ const r = this.animators.get(i);
402
+ r && r.startTime === null && this.startBackwardAnimator(i);
401
403
  }
402
404
  startAnimator(t) {
403
405
  const e = this.animators.get(t);
@@ -433,34 +435,34 @@ class j {
433
435
  }
434
436
  forward() {
435
437
  var e, i;
436
- this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), (i = (e = this.config).onStart) == null || i.call(e), this.normalizeSchedule("forward").forEach((o) => {
437
- if (o.type === "wait")
438
+ this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), (i = (e = this.config).onStart) == null || i.call(e), this.normalizeSchedule("forward").forEach((r) => {
439
+ if (r.type === "wait")
438
440
  return;
439
- if (o.delay === 0) {
440
- this.startAnimator(o.id);
441
+ if (r.delay === 0) {
442
+ this.startAnimator(r.id);
441
443
  return;
442
444
  }
443
- const r = window.setTimeout(
444
- () => this.startAnimator(o.id),
445
- o.delay
445
+ const o = window.setTimeout(
446
+ () => this.startAnimator(r.id),
447
+ r.delay
446
448
  );
447
- this.timeoutIds.push(r);
449
+ this.timeoutIds.push(o);
448
450
  });
449
451
  }
450
452
  backward() {
451
453
  var e, i;
452
- this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), (i = (e = this.config).onStart) == null || i.call(e), this.normalizeSchedule("backward").forEach((o) => {
453
- if (o.type === "wait")
454
+ this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), (i = (e = this.config).onStart) == null || i.call(e), this.normalizeSchedule("backward").forEach((r) => {
455
+ if (r.type === "wait")
454
456
  return;
455
- if (o.delay === 0) {
456
- this.startBackwardAnimator(o.id);
457
+ if (r.delay === 0) {
458
+ this.startBackwardAnimator(r.id);
457
459
  return;
458
460
  }
459
- const r = window.setTimeout(
460
- () => this.startBackwardAnimator(o.id),
461
- o.delay
461
+ const o = window.setTimeout(
462
+ () => this.startBackwardAnimator(r.id),
463
+ r.delay
462
464
  );
463
- this.timeoutIds.push(r);
465
+ this.timeoutIds.push(o);
464
466
  });
465
467
  }
466
468
  stop() {
@@ -474,10 +476,10 @@ class j {
474
476
  ), this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((i) => {
475
477
  if (i.startTime === null)
476
478
  return;
477
- const o = i.animator.getCurrentState();
478
- if (o.type !== "single")
479
+ const r = i.animator.getCurrentState();
480
+ if (r.type !== "single")
479
481
  return;
480
- if (o.position === o.to) {
482
+ if (r.position === r.to) {
481
483
  const s = O.fromState(
482
484
  {
483
485
  position: 1,
@@ -507,7 +509,7 @@ class j {
507
509
  };
508
510
  }
509
511
  }
510
- const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
512
+ const U = Symbol.for("TRANSITION_STRATEGY"), H = (n) => ({
511
513
  runIn: async (t) => {
512
514
  const { currentAnimation: e } = n;
513
515
  if (e && e.direction === "out") {
@@ -561,15 +563,15 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
561
563
  to: 1,
562
564
  direction: "forward"
563
565
  };
564
- const { from: o = 0, to: r = 1 } = i;
566
+ const { from: r = 0, to: o = 1 } = i;
565
567
  return {
566
568
  config: i,
567
569
  state: {
568
- position: o,
570
+ position: r,
569
571
  velocity: 0
570
572
  },
571
- from: o,
572
- to: r,
573
+ from: r,
574
+ to: o,
573
575
  direction: "forward"
574
576
  };
575
577
  },
@@ -626,15 +628,15 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
626
628
  to: 0,
627
629
  direction: "forward"
628
630
  };
629
- const { from: o = 1, to: r = 0 } = i;
631
+ const { from: r = 1, to: o = 0 } = i;
630
632
  return {
631
633
  config: i,
632
634
  state: {
633
- position: o,
635
+ position: r,
634
636
  velocity: 0
635
637
  },
636
- from: o,
637
- to: r,
638
+ from: r,
639
+ to: o,
638
640
  direction: "forward"
639
641
  };
640
642
  }
@@ -712,13 +714,13 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
712
714
  });
713
715
  function W(n, t) {
714
716
  var u;
715
- let e = null, i = null, o = null, r = null;
717
+ let e = null, i = null, r = null, o = null;
716
718
  const s = {
717
719
  get currentAnimation() {
718
720
  return e;
719
721
  }
720
- }, d = ((u = t == null ? void 0 : t.strategy) == null ? void 0 : u.call(t, s)) || F(s), l = async (a) => {
721
- var S, C, T;
722
+ }, d = ((u = t == null ? void 0 : t.strategy) == null ? void 0 : u.call(t, s)) || H(s), l = async (a) => {
723
+ var S, T, C;
722
724
  i && (i.remove(), i = null);
723
725
  const p = n(), c = p.in && await p.in(a), g = !(t != null && t.strategy) && p.out ? p.out(a) : void 0;
724
726
  if (!c)
@@ -756,7 +758,7 @@ function W(n, t) {
756
758
  console.error("Unexpected MultiSpringConfig in single-spring path");
757
759
  return;
758
760
  }
759
- (T = (C = f.config).prepare) == null || T.call(C, a), f.config.wait && await f.config.wait();
761
+ (C = (T = f.config).prepare) == null || C.call(T, a), f.config.wait && await f.config.wait();
760
762
  const y = O.fromState(f.state, {
761
763
  from: f.from,
762
764
  to: f.to,
@@ -770,7 +772,7 @@ function W(n, t) {
770
772
  });
771
773
  e = { controller: y, direction: "in" }, f.direction === "forward" ? y.forward() : y.backward();
772
774
  }, h = async (a) => {
773
- var S, C, T;
775
+ var S, T, C;
774
776
  i = a;
775
777
  const p = n(), c = p.out && await p.out(a);
776
778
  if (!c)
@@ -789,8 +791,8 @@ function W(n, t) {
789
791
  const E = new j({
790
792
  ...c,
791
793
  onEnd: () => {
792
- var A, x;
793
- (A = c.onEnd) == null || A.call(c), i && (i.remove(), i = null), e = null, (x = t == null ? void 0 : t.onCleanupEnd) == null || x.call(t);
794
+ var A, P;
795
+ (A = c.onEnd) == null || A.call(c), i && (i.remove(), i = null), e = null, (P = t == null ? void 0 : t.onCleanupEnd) == null || P.call(t);
794
796
  }
795
797
  });
796
798
  e = {
@@ -810,7 +812,7 @@ function W(n, t) {
810
812
  console.error("Unexpected MultiSpringConfig in single-spring path");
811
813
  return;
812
814
  }
813
- (T = (C = w.config).prepare) == null || T.call(C, a), y(), w.config.wait && await w.config.wait();
815
+ (C = (T = w.config).prepare) == null || C.call(T, a), y(), w.config.wait && await w.config.wait();
814
816
  const f = O.fromState(w.state, {
815
817
  from: w.from,
816
818
  to: w.to,
@@ -824,12 +826,12 @@ function W(n, t) {
824
826
  });
825
827
  e = { controller: f, direction: "out" }, w.direction === "forward" ? f.forward() : f.backward();
826
828
  function y() {
827
- !o || !i || (r && o.contains(r) ? o.insertBefore(i, r) : o.appendChild(i));
829
+ !r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
828
830
  }
829
831
  };
830
832
  return (a) => {
831
833
  if (a)
832
- return o = a.parentElement, r = a.nextElementSibling, l(a), () => {
834
+ return r = a.parentElement, o = a.nextElementSibling, l(a), () => {
833
835
  if (a.isConnected) {
834
836
  const p = a.cloneNode(!0);
835
837
  h(p);
@@ -843,11 +845,11 @@ const Y = 3, X = (n) => {
843
845
  const t = n.split(`
844
846
  `).map((e) => e.trim());
845
847
  for (let e = Y; e < Math.min(t.length, 6); e++) {
846
- const i = t[e], o = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
847
- if (!o)
848
+ const i = t[e], r = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
849
+ if (!r)
848
850
  continue;
849
- const r = o[1] ?? "", s = o[2] ?? "0", d = o[3] ?? "0";
850
- return { file: r.split(/[\\/]/).pop() || r, line: s, column: d };
851
+ const o = r[1] ?? "", s = r[2] ?? "0", d = r[3] ?? "0";
852
+ return { file: o.split(/[\\/]/).pop() || o, line: s, column: d };
851
853
  }
852
854
  return null;
853
855
  }, M = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
@@ -856,36 +858,36 @@ function B(n, t, e) {
856
858
  let i = R.get(n);
857
859
  return i || (i = W(
858
860
  () => {
859
- const o = M.get(n);
860
- return o || (console.warn(`Transition "${String(n)}" not found`), {});
861
+ const r = M.get(n);
862
+ return r || (console.warn(`Transition "${String(n)}" not found`), {});
861
863
  },
862
864
  {
863
865
  strategy: e,
864
- onCleanupEnd: () => D(n)
866
+ onCleanupEnd: () => z(n)
865
867
  }
866
868
  ), R.set(n, i), i);
867
869
  }
868
- function D(n) {
870
+ function z(n) {
869
871
  M.delete(n), R.delete(n);
870
872
  }
871
873
  function K() {
872
874
  const n = X(new Error().stack);
873
875
  return n ? `auto_${n.file}_${n.line}_${n.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
874
876
  }
875
- const L = globalThis.FinalizationRegistry, U = L ? (
877
+ const D = globalThis.FinalizationRegistry, L = D ? (
876
878
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
877
- new L((n) => {
879
+ new D((n) => {
878
880
  try {
879
- D(n);
881
+ z(n);
880
882
  } catch {
881
883
  }
882
884
  })
883
885
  ) : void 0;
884
886
  function nt(n) {
885
887
  const t = n.key ?? K();
886
- if (n.ref && U)
888
+ if (n.ref && L)
887
889
  try {
888
- U.register(n.ref, t);
890
+ L.register(n.ref, t);
889
891
  } catch {
890
892
  }
891
893
  return B(
@@ -894,7 +896,7 @@ function nt(n) {
894
896
  in: n.in,
895
897
  out: n.out
896
898
  },
897
- n[z]
899
+ n[U]
898
900
  );
899
901
  }
900
902
  function q(n) {
@@ -906,21 +908,21 @@ function q(n) {
906
908
  return [...n, ...t];
907
909
  }
908
910
  function G(n) {
909
- let t = !1, e = 0, i = 0, o = !1;
910
- const r = 50, s = 50, d = (c) => {
911
+ let t = !1, e = 0, i = 0, r = !1;
912
+ const o = 50, s = 50, d = (c) => {
911
913
  if (!n) return;
912
914
  const g = c.touches[0];
913
- g && (o = g.clientX < s, o && (e = g.clientX, i = g.clientY));
915
+ g && (r = g.clientX < s, r && (e = g.clientX, i = g.clientY));
914
916
  }, l = (c) => {
915
- if (!n || !o || t) return;
917
+ if (!n || !r || t) return;
916
918
  const g = c.touches[0];
917
919
  if (!g) return;
918
920
  const w = g.clientX - e, f = g.clientY - i;
919
- w > r && Math.abs(w) > Math.abs(f) && (t = !0, setTimeout(() => {
921
+ w > o && Math.abs(w) > Math.abs(f) && (t = !0, setTimeout(() => {
920
922
  t = !1;
921
923
  }, 500));
922
924
  }, h = () => {
923
- n && (o = !1, e = 0, i = 0);
925
+ n && (r = !1, e = 0, i = 0);
924
926
  };
925
927
  return {
926
928
  initialize: () => {
@@ -955,7 +957,7 @@ function Z() {
955
957
  let n = null, t = null;
956
958
  const e = /* @__PURE__ */ new Map();
957
959
  let i = null;
958
- const o = () => {
960
+ const r = () => {
959
961
  n && i && e.set(i, {
960
962
  x: n.scrollLeft,
961
963
  y: n.scrollTop
@@ -963,7 +965,7 @@ function Z() {
963
965
  };
964
966
  return {
965
967
  initializeContext: (u, a) => {
966
- t = u, n || (n = J(u), (n === document.documentElement ? window : n).addEventListener("scroll", o, {
968
+ t = u, n || (n = J(u), (n === document.documentElement ? window : n).addEventListener("scroll", r, {
967
969
  passive: !0
968
970
  })), i = a;
969
971
  },
@@ -979,7 +981,7 @@ function Z() {
979
981
  getScrollPosition: (u) => u && e.has(u) ? e.get(u) : { x: 0, y: 0 }
980
982
  };
981
983
  }
982
- function P(n, t) {
984
+ function x(n, t) {
983
985
  if (t === "*")
984
986
  return !0;
985
987
  if (t.endsWith("/*")) {
@@ -990,10 +992,10 @@ function P(n, t) {
990
992
  }
991
993
  function tt(n, t, e) {
992
994
  for (const i of e)
993
- if (P(n, i.from) && P(t, i.to))
995
+ if (x(n, i.from) && x(t, i.to))
994
996
  return i.transition;
995
997
  for (const i of e)
996
- if ((i.from === "*" || P(n, i.from)) && (i.to === "*" || P(t, i.to)))
998
+ if ((i.from === "*" || x(n, i.from)) && (i.to === "*" || x(t, i.to)))
997
999
  return i.transition;
998
1000
  return null;
999
1001
  }
@@ -1003,33 +1005,33 @@ function ot(n) {
1003
1005
  defaultTransition: e,
1004
1006
  middleware: i = (f, y) => ({ from: f, to: y }),
1005
1007
  // Identity function as default
1006
- skipOnIosSwipe: o = !0
1008
+ skipOnIosSwipe: r = !0
1007
1009
  // Default to true - skip animations on iOS swipe
1008
1010
  } = n;
1009
- let r = null;
1011
+ let o = null;
1010
1012
  const s = q(t), {
1011
1013
  initializeContext: d,
1012
1014
  calculateScrollOffset: l,
1013
1015
  getScrollContainer: h,
1014
1016
  getPositionedParentElement: u,
1015
1017
  getScrollPosition: a
1016
- } = Z(), p = G(o);
1018
+ } = Z(), p = G(r);
1017
1019
  p.initialize();
1018
1020
  function c() {
1019
- if (r != null && r.from && (r != null && r.to)) {
1021
+ if (o != null && o.from && (o != null && o.to)) {
1020
1022
  const { from: f, to: y } = i(
1021
- r.from,
1022
- r.to
1023
- ), C = tt(
1023
+ o.from,
1024
+ o.to
1025
+ ), T = tt(
1024
1026
  f,
1025
1027
  y,
1026
1028
  s
1027
- ) || e, T = l(
1028
- r.from,
1029
- r.to
1029
+ ) || e, C = l(
1030
+ o.from,
1031
+ o.to
1030
1032
  ), v = {
1031
- scrollOffset: T,
1032
- scroll: a(r.from),
1033
+ scrollOffset: C,
1034
+ scroll: a(o.from),
1033
1035
  get scrollingElement() {
1034
1036
  return h() || document.documentElement;
1035
1037
  },
@@ -1037,9 +1039,9 @@ function ot(n) {
1037
1039
  return u();
1038
1040
  }
1039
1041
  }, b = {
1040
- scrollOffset: T,
1042
+ scrollOffset: C,
1041
1043
  get scroll() {
1042
- return r ? a(r.to) : { x: 0, y: 0 };
1044
+ return o ? a(o.to) : { x: 0, y: 0 };
1043
1045
  },
1044
1046
  get scrollingElement() {
1045
1047
  return h() || document.documentElement;
@@ -1048,29 +1050,29 @@ function ot(n) {
1048
1050
  return u();
1049
1051
  }
1050
1052
  };
1051
- C && (C.out && r.outResolve && r.outResolve(
1052
- (E) => C.out(E, v)
1053
- ), C.in && r.inResolve && r.inResolve(
1054
- (E) => C.in(E, b)
1055
- )), r = null;
1053
+ T && (T.out && o.outResolve && o.outResolve(
1054
+ (E) => T.out(E, v)
1055
+ ), T.in && o.inResolve && o.inResolve(
1056
+ (E) => T.in(E, b)
1057
+ )), o = null;
1056
1058
  }
1057
1059
  }
1058
- const g = async (f, y) => p.isSwipePending() ? () => ({}) : y === "in" && (!r || !r.from) ? () => ({}) : (r || (r = {}), y === "out" ? (r.from = f, new Promise((S) => {
1059
- r.outResolve = S, c();
1060
- })) : (r.to = f, new Promise((S) => {
1061
- r.inResolve = S, c();
1060
+ const g = async (f, y) => p.isSwipePending() ? () => ({}) : y === "in" && (!o || !o.from) ? () => ({}) : (o || (o = {}), y === "out" ? (o.from = f, new Promise((S) => {
1061
+ o.outResolve = S, c();
1062
+ })) : (o.to = f, new Promise((S) => {
1063
+ o.inResolve = S, c();
1062
1064
  })));
1063
1065
  return (f) => ({
1064
1066
  key: f,
1065
1067
  in: async (y) => (d(y, f), (await g(f, "in"))(y)),
1066
1068
  out: async (y) => (await g(f, "out"))(y),
1067
1069
  // Add page transition strategy for page-level transitions
1068
- [z]: N
1070
+ [U]: N
1069
1071
  });
1070
1072
  }
1071
1073
  export {
1072
- z as TRANSITION_STRATEGY,
1073
- F as createDefaultStrategy,
1074
+ U as TRANSITION_STRATEGY,
1075
+ H as createDefaultStrategy,
1074
1076
  N as createPageTransitionStrategy,
1075
1077
  ot as createSggoiTransitionContext,
1076
1078
  K as generateAutoKey,
@@ -0,0 +1 @@
1
+ "use strict";function b(i,a){function o(d){let l=0,y=0;const t=d.offsetWidth,g=d.offsetHeight;let s=d;for(;s;)l+=s.offsetTop,y+=s.offsetLeft,s=s.offsetParent;return l-=window.scrollY,y-=window.scrollX,{top:l,left:y,width:t,height:g}}const e=o(i),n=o(a);return new DOMRect(n.left-e.left,n.top-e.top,n.width,n.height)}const x=(i,a)=>{var o;i.style.position="absolute",i.style.width="100%",i.style.top=`${-1*(((o=a==null?void 0:a.scrollOffset)==null?void 0:o.y)??0)}px`,i.style.left="0"};function M(i,a="viewport"){if(a==="positioned-parent"){const o=i.positionedParent.getBoundingClientRect();return{top:o.top,left:o.left,width:o.width,height:o.height}}else{const o=b(document.body,i.positionedParent);return{top:i.scroll.y,left:0,width:o.width,height:window.innerHeight-o.top}}}const F=(i={})=>R(i),R=(i={})=>{var l,y;const a={stiffness:((l=i.spring)==null?void 0:l.stiffness)??50,damping:((y=i.spring)==null?void 0:y.damping)??30},o=i.initialRotation??45,e=i.initialScale??.01,n=i.rotationTriggerPoint??.8,d=i.containerMode??"viewport";return{out:async(t,g)=>{const s=t.style.opacity;return{spring:{stiffness:80,damping:25},from:1,to:0,prepare:()=>{x(t,g),t.style.opacity="1"},tick:w=>{t.style.opacity=String(w)},onEnd:()=>{t.style.opacity=s}}},in:async(t,g)=>{const s=M(g,d),w=t.style.transform,$=t.style.transformOrigin,O=t.style.position,v=t.style.zIndex;return{spring:a,from:0,to:1,prepare:()=>{const r=Math.min(s.width,s.height)*.4;if(t.style.setProperty("--max-border-radius",`${r}px`),t.style.setProperty("--border-radius-scale","1"),t.style.willChange="transform",t.style.backfaceVisibility="hidden",d==="positioned-parent")t.style.transformOrigin="50% 50%",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=`${s.width}px`,t.style.height=`${s.height}px`;else{const f=s.left+s.width/2,h=s.top+s.height/2;t.style.transformOrigin=`${f}px ${h}px`,t.style.position="fixed",t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.width=`${s.width}px`,t.style.height=`${s.height}px`}t.style.zIndex="1000",t.style.overflow="hidden",t.style.transform=`rotate(${o}deg) scale(${e}) translateZ(0)`,t.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",t.style.opacity="1"},tick:r=>{let f;if(r<=.05)f=e;else if(r<=n){const c=(r-.05)/(n-.05),u=Math.pow(c,9);f=e+(.8-e)*u}else{const c=(r-n)/(1-n);f=.8+.2*(1-Math.pow(1-c,3))}let h;const p=.7;if(r<=p)h=o;else{const c=(r-p)/(1-p),u=1-Math.pow(1-c,2);h=o*(1-u)}let P;if(r<=p)P=1;else{const c=(r-p)/(1-p);P=1-Math.pow(c,.5)}t.style.transform=`rotate(${h.toFixed(2)}deg) scale(${f.toFixed(4)}) translateZ(0)`,t.style.setProperty("--border-radius-scale",P.toFixed(4))},onEnd:()=>{t.style.willChange="",t.style.backfaceVisibility="",t.style.removeProperty("--max-border-radius"),t.style.removeProperty("--border-radius-scale"),t.style.transform=w,t.style.transformOrigin=$,t.style.position=O,t.style.zIndex=v,t.style.top="",t.style.left="",t.style.width="",t.style.height="",t.style.overflow="",t.style.borderRadius=""}}}}};exports.getRect=b;exports.jaemin=F;exports.jaeminInternal=R;exports.prepareOutgoing=x;