@ssgoi/core 2.5.3 → 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
86
  const y = 0.05, S = (T) => {
85
87
  if (!a) return;
86
- const b = Math.min(T, 0.033), v = -2 * b * c * p * u, A = b * p * p * (e - h);
87
- u += v + A, h += b * u;
88
- const E = Math.abs(e - h), C = Math.abs(u);
89
- if (E < g && C < w) {
90
- if (f += b, f >= y) {
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;
90
+ const E = Math.abs(e - h), A = Math.abs(u);
91
+ if (E < g && A < w) {
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, T, b;
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)
@@ -736,8 +738,8 @@ function W(n, t) {
736
738
  const E = new j({
737
739
  ...c,
738
740
  onEnd: () => {
739
- var C;
740
- e = null, (C = c.onEnd) == null || C.call(c);
741
+ var A;
742
+ e = null, (A = c.onEnd) == null || A.call(c);
741
743
  }
742
744
  });
743
745
  e = {
@@ -756,7 +758,7 @@ function W(n, t) {
756
758
  console.error("Unexpected MultiSpringConfig in single-spring path");
757
759
  return;
758
760
  }
759
- (b = (T = f.config).prepare) == null || b.call(T, 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,
@@ -764,13 +766,13 @@ function W(n, t) {
764
766
  onStart: f.config.onStart,
765
767
  onUpdate: f.config.tick,
766
768
  onComplete: () => {
767
- var v, A;
768
- e = null, (A = (v = f.config) == null ? void 0 : v.onEnd) == null || A.call(v);
769
+ var v, b;
770
+ e = null, (b = (v = f.config) == null ? void 0 : v.onEnd) == null || b.call(v);
769
771
  }
770
772
  });
771
773
  e = { controller: y, direction: "in" }, f.direction === "forward" ? y.forward() : y.backward();
772
774
  }, h = async (a) => {
773
- var S, T, b;
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 C, x;
793
- (C = c.onEnd) == null || C.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
- (b = (T = w.config).prepare) == null || b.call(T, 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,
@@ -818,20 +820,23 @@ function W(n, t) {
818
820
  onStart: w.config.onStart,
819
821
  onUpdate: w.config.tick,
820
822
  onComplete: () => {
821
- var v, A, E;
822
- (A = (v = w.config) == null ? void 0 : v.onEnd) == null || A.call(v), i && (i.remove(), i = null), e = null, (E = t == null ? void 0 : t.onCleanupEnd) == null || E.call(t);
823
+ var v, b, E;
824
+ (b = (v = w.config) == null ? void 0 : v.onEnd) == null || b.call(v), i && (i.remove(), i = null), e = null, (E = t == null ? void 0 : t.onCleanupEnd) == null || E.call(t);
823
825
  }
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), () => {
833
- const p = a.cloneNode(!0);
834
- h(p);
834
+ return r = a.parentElement, o = a.nextElementSibling, l(a), () => {
835
+ if (a.isConnected) {
836
+ const p = a.cloneNode(!0);
837
+ h(p);
838
+ } else
839
+ h(a);
835
840
  };
836
841
  };
837
842
  }
@@ -840,11 +845,11 @@ const Y = 3, X = (n) => {
840
845
  const t = n.split(`
841
846
  `).map((e) => e.trim());
842
847
  for (let e = Y; e < Math.min(t.length, 6); e++) {
843
- const i = t[e], o = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
844
- if (!o)
848
+ const i = t[e], r = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
849
+ if (!r)
845
850
  continue;
846
- const r = o[1] ?? "", s = o[2] ?? "0", d = o[3] ?? "0";
847
- 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 };
848
853
  }
849
854
  return null;
850
855
  }, M = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
@@ -853,36 +858,36 @@ function B(n, t, e) {
853
858
  let i = R.get(n);
854
859
  return i || (i = W(
855
860
  () => {
856
- const o = M.get(n);
857
- 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`), {});
858
863
  },
859
864
  {
860
865
  strategy: e,
861
- onCleanupEnd: () => D(n)
866
+ onCleanupEnd: () => z(n)
862
867
  }
863
868
  ), R.set(n, i), i);
864
869
  }
865
- function D(n) {
870
+ function z(n) {
866
871
  M.delete(n), R.delete(n);
867
872
  }
868
873
  function K() {
869
874
  const n = X(new Error().stack);
870
875
  return n ? `auto_${n.file}_${n.line}_${n.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
871
876
  }
872
- const L = globalThis.FinalizationRegistry, U = L ? (
877
+ const D = globalThis.FinalizationRegistry, L = D ? (
873
878
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
874
- new L((n) => {
879
+ new D((n) => {
875
880
  try {
876
- D(n);
881
+ z(n);
877
882
  } catch {
878
883
  }
879
884
  })
880
885
  ) : void 0;
881
886
  function nt(n) {
882
887
  const t = n.key ?? K();
883
- if (n.ref && U)
888
+ if (n.ref && L)
884
889
  try {
885
- U.register(n.ref, t);
890
+ L.register(n.ref, t);
886
891
  } catch {
887
892
  }
888
893
  return B(
@@ -891,7 +896,7 @@ function nt(n) {
891
896
  in: n.in,
892
897
  out: n.out
893
898
  },
894
- n[z]
899
+ n[U]
895
900
  );
896
901
  }
897
902
  function q(n) {
@@ -903,21 +908,21 @@ function q(n) {
903
908
  return [...n, ...t];
904
909
  }
905
910
  function G(n) {
906
- let t = !1, e = 0, i = 0, o = !1;
907
- 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) => {
908
913
  if (!n) return;
909
914
  const g = c.touches[0];
910
- 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));
911
916
  }, l = (c) => {
912
- if (!n || !o || t) return;
917
+ if (!n || !r || t) return;
913
918
  const g = c.touches[0];
914
919
  if (!g) return;
915
920
  const w = g.clientX - e, f = g.clientY - i;
916
- w > r && Math.abs(w) > Math.abs(f) && (t = !0, setTimeout(() => {
921
+ w > o && Math.abs(w) > Math.abs(f) && (t = !0, setTimeout(() => {
917
922
  t = !1;
918
923
  }, 500));
919
924
  }, h = () => {
920
- n && (o = !1, e = 0, i = 0);
925
+ n && (r = !1, e = 0, i = 0);
921
926
  };
922
927
  return {
923
928
  initialize: () => {
@@ -952,7 +957,7 @@ function Z() {
952
957
  let n = null, t = null;
953
958
  const e = /* @__PURE__ */ new Map();
954
959
  let i = null;
955
- const o = () => {
960
+ const r = () => {
956
961
  n && i && e.set(i, {
957
962
  x: n.scrollLeft,
958
963
  y: n.scrollTop
@@ -960,7 +965,7 @@ function Z() {
960
965
  };
961
966
  return {
962
967
  initializeContext: (u, a) => {
963
- 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, {
964
969
  passive: !0
965
970
  })), i = a;
966
971
  },
@@ -976,7 +981,7 @@ function Z() {
976
981
  getScrollPosition: (u) => u && e.has(u) ? e.get(u) : { x: 0, y: 0 }
977
982
  };
978
983
  }
979
- function P(n, t) {
984
+ function x(n, t) {
980
985
  if (t === "*")
981
986
  return !0;
982
987
  if (t.endsWith("/*")) {
@@ -987,10 +992,10 @@ function P(n, t) {
987
992
  }
988
993
  function tt(n, t, e) {
989
994
  for (const i of e)
990
- if (P(n, i.from) && P(t, i.to))
995
+ if (x(n, i.from) && x(t, i.to))
991
996
  return i.transition;
992
997
  for (const i of e)
993
- 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)))
994
999
  return i.transition;
995
1000
  return null;
996
1001
  }
@@ -1000,43 +1005,43 @@ function ot(n) {
1000
1005
  defaultTransition: e,
1001
1006
  middleware: i = (f, y) => ({ from: f, to: y }),
1002
1007
  // Identity function as default
1003
- skipOnIosSwipe: o = !0
1008
+ skipOnIosSwipe: r = !0
1004
1009
  // Default to true - skip animations on iOS swipe
1005
1010
  } = n;
1006
- let r = null;
1011
+ let o = null;
1007
1012
  const s = q(t), {
1008
1013
  initializeContext: d,
1009
1014
  calculateScrollOffset: l,
1010
1015
  getScrollContainer: h,
1011
1016
  getPositionedParentElement: u,
1012
1017
  getScrollPosition: a
1013
- } = Z(), p = G(o);
1018
+ } = Z(), p = G(r);
1014
1019
  p.initialize();
1015
1020
  function c() {
1016
- if (r != null && r.from && (r != null && r.to)) {
1021
+ if (o != null && o.from && (o != null && o.to)) {
1017
1022
  const { from: f, to: y } = i(
1018
- r.from,
1019
- r.to
1023
+ o.from,
1024
+ o.to
1020
1025
  ), T = tt(
1021
1026
  f,
1022
1027
  y,
1023
1028
  s
1024
- ) || e, b = l(
1025
- r.from,
1026
- r.to
1029
+ ) || e, C = l(
1030
+ o.from,
1031
+ o.to
1027
1032
  ), v = {
1028
- scrollOffset: b,
1029
- scroll: a(r.from),
1033
+ scrollOffset: C,
1034
+ scroll: a(o.from),
1030
1035
  get scrollingElement() {
1031
1036
  return h() || document.documentElement;
1032
1037
  },
1033
1038
  get positionedParent() {
1034
1039
  return u();
1035
1040
  }
1036
- }, A = {
1037
- scrollOffset: b,
1041
+ }, b = {
1042
+ scrollOffset: C,
1038
1043
  get scroll() {
1039
- return r ? a(r.to) : { x: 0, y: 0 };
1044
+ return o ? a(o.to) : { x: 0, y: 0 };
1040
1045
  },
1041
1046
  get scrollingElement() {
1042
1047
  return h() || document.documentElement;
@@ -1045,29 +1050,29 @@ function ot(n) {
1045
1050
  return u();
1046
1051
  }
1047
1052
  };
1048
- T && (T.out && r.outResolve && r.outResolve(
1053
+ T && (T.out && o.outResolve && o.outResolve(
1049
1054
  (E) => T.out(E, v)
1050
- ), T.in && r.inResolve && r.inResolve(
1051
- (E) => T.in(E, A)
1052
- )), r = null;
1055
+ ), T.in && o.inResolve && o.inResolve(
1056
+ (E) => T.in(E, b)
1057
+ )), o = null;
1053
1058
  }
1054
1059
  }
1055
- const g = async (f, y) => p.isSwipePending() ? () => ({}) : y === "in" && (!r || !r.from) ? () => ({}) : (r || (r = {}), y === "out" ? (r.from = f, new Promise((S) => {
1056
- r.outResolve = S, c();
1057
- })) : (r.to = f, new Promise((S) => {
1058
- 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();
1059
1064
  })));
1060
1065
  return (f) => ({
1061
1066
  key: f,
1062
1067
  in: async (y) => (d(y, f), (await g(f, "in"))(y)),
1063
1068
  out: async (y) => (await g(f, "out"))(y),
1064
1069
  // Add page transition strategy for page-level transitions
1065
- [z]: N
1070
+ [U]: N
1066
1071
  });
1067
1072
  }
1068
1073
  export {
1069
- z as TRANSITION_STRATEGY,
1070
- F as createDefaultStrategy,
1074
+ U as TRANSITION_STRATEGY,
1075
+ H as createDefaultStrategy,
1071
1076
  N as createPageTransitionStrategy,
1072
1077
  ot as createSggoiTransitionContext,
1073
1078
  K as generateAutoKey,