@ssgoi/core 2.5.1 → 2.5.3

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.
Files changed (47) hide show
  1. package/dist/animator/animate.d.ts.map +1 -0
  2. package/dist/{animation-scheduler.d.ts → animator/animation-scheduler.d.ts} +1 -1
  3. package/dist/animator/animation-scheduler.d.ts.map +1 -0
  4. package/dist/{animator.d.ts → animator/index.d.ts} +2 -2
  5. package/dist/animator/index.d.ts.map +1 -0
  6. package/dist/animator/ticker.d.ts.map +1 -0
  7. package/dist/index.cjs +2 -2
  8. package/dist/index.d.ts +3 -3
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +275 -266
  11. package/dist/ssgoi-transition/create-context-manager.d.ts +18 -0
  12. package/dist/ssgoi-transition/create-context-manager.d.ts.map +1 -0
  13. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +46 -0
  14. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -0
  15. package/dist/ssgoi-transition/create-swipe-detector.d.ts +10 -0
  16. package/dist/ssgoi-transition/create-swipe-detector.d.ts.map +1 -0
  17. package/dist/ssgoi-transition/find-matching-transition.d.ts +24 -0
  18. package/dist/ssgoi-transition/find-matching-transition.d.ts.map +1 -0
  19. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts +7 -0
  20. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts.map +1 -0
  21. package/dist/ssgoi-transition/types.d.ts +8 -0
  22. package/dist/ssgoi-transition/types.d.ts.map +1 -0
  23. package/dist/{create-transition-callback.d.ts → transition/create-transition-callback.d.ts} +1 -1
  24. package/dist/transition/create-transition-callback.d.ts.map +1 -0
  25. package/dist/{transition-strategy.d.ts → transition/transition-strategy.d.ts} +1 -1
  26. package/dist/transition/transition-strategy.d.ts.map +1 -0
  27. package/dist/{transition.d.ts → transition/transition.d.ts} +1 -1
  28. package/dist/transition/transition.d.ts.map +1 -0
  29. package/dist/view-transitions/index.cjs +9 -9
  30. package/dist/view-transitions/index.d.ts +1 -0
  31. package/dist/view-transitions/index.d.ts.map +1 -1
  32. package/dist/view-transitions/index.js +543 -412
  33. package/dist/view-transitions/instagram.d.ts +8 -0
  34. package/dist/view-transitions/instagram.d.ts.map +1 -0
  35. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  36. package/package.json +13 -14
  37. package/dist/animate.d.ts.map +0 -1
  38. package/dist/animation-scheduler.d.ts.map +0 -1
  39. package/dist/animator.d.ts.map +0 -1
  40. package/dist/create-ssgoi-transition-context.d.ts +0 -15
  41. package/dist/create-ssgoi-transition-context.d.ts.map +0 -1
  42. package/dist/create-transition-callback.d.ts.map +0 -1
  43. package/dist/ticker.d.ts.map +0 -1
  44. package/dist/transition-strategy.d.ts.map +0 -1
  45. package/dist/transition.d.ts.map +0 -1
  46. /package/dist/{animate.d.ts → animator/animate.d.ts} +0 -0
  47. /package/dist/{ticker.d.ts → animator/ticker.d.ts} +0 -0
package/dist/index.js CHANGED
@@ -1,36 +1,36 @@
1
1
  var _ = Object.defineProperty;
2
2
  var $ = (n, t, e) => t in n ? _(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var d = (n, t, e) => $(n, typeof t != "symbol" ? t + "" : t, e);
4
- import { isMultiSpring as R } from "./types.js";
3
+ var m = (n, t, e) => $(n, typeof t != "symbol" ? t + "" : t, e);
4
+ import { isMultiSpring as V } from "./types.js";
5
5
  import { isSingleSpring as at } from "./types.js";
6
6
  import { j as lt } from "./jaemin-BAi8PTrj.js";
7
- class F {
7
+ class H {
8
8
  constructor() {
9
- d(this, "listeners", /* @__PURE__ */ new Set());
10
- d(this, "rafId", null);
11
- d(this, "isRunning", !1);
9
+ m(this, "listeners", /* @__PURE__ */ new Set());
10
+ m(this, "rafId", null);
11
+ m(this, "isRunning", !1);
12
12
  // Timing
13
- d(this, "startTime", Date.now());
14
- d(this, "lastUpdate", this.startTime);
15
- d(this, "elapsed", 0);
13
+ m(this, "startTime", Date.now());
14
+ m(this, "lastUpdate", this.startTime);
15
+ m(this, "elapsed", 0);
16
16
  // Lag smoothing (mobile optimization)
17
- d(this, "lagThreshold", 500);
17
+ m(this, "lagThreshold", 500);
18
18
  // ms - detect tab switches, backgrounding
19
- d(this, "adjustedLag", 33);
19
+ m(this, "adjustedLag", 33);
20
20
  // ms - max time jump to prevent animation skip
21
21
  // FPS throttling
22
- d(this, "gap", 1e3 / 240);
22
+ m(this, "gap", 1e3 / 240);
23
23
  // max 240fps
24
- d(this, "nextTime", this.gap);
25
- d(this, "tick", () => {
24
+ m(this, "nextTime", this.gap);
25
+ m(this, "tick", () => {
26
26
  const t = Date.now();
27
27
  let e = t - this.lastUpdate;
28
28
  (e > this.lagThreshold || e < 0) && (this.startTime += e - this.adjustedLag, e = this.adjustedLag), this.lastUpdate = t;
29
- const i = t - this.startTime, r = i - this.nextTime;
30
- if (r > 0) {
31
- const o = e / 1e3;
32
- this.elapsed = i / 1e3, this.nextTime += r + (r >= this.gap ? 4 : this.gap - r), this.listeners.forEach((s) => {
33
- s(o, this.elapsed);
29
+ const i = t - this.startTime, o = i - this.nextTime;
30
+ 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);
34
34
  });
35
35
  }
36
36
  this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
@@ -66,72 +66,72 @@ class F {
66
66
  return this.elapsed;
67
67
  }
68
68
  }
69
- const I = new F();
69
+ const I = new H();
70
70
  function k(n) {
71
71
  const {
72
72
  from: t,
73
73
  to: e,
74
74
  stiffness: i,
75
- damping: r,
76
- mass: o,
75
+ damping: o,
76
+ mass: r,
77
77
  velocity: s = 0,
78
- onUpdate: m,
78
+ onUpdate: d,
79
79
  onComplete: l
80
80
  } = n;
81
81
  let h = t, u = s, a = !0;
82
- const p = Math.sqrt(i / o), c = r / (2 * Math.sqrt(i * o)), S = 0.01, w = 0.01;
82
+ const p = Math.sqrt(i / r), c = o / (2 * Math.sqrt(i * r)), g = 0.01, w = 0.01;
83
83
  let f = 0;
84
- const g = 0.05, v = (A) => {
84
+ const y = 0.05, S = (T) => {
85
85
  if (!a) return;
86
- const C = Math.min(A, 0.033), y = -2 * C * c * p * u, b = C * p * p * (e - h);
87
- u += y + b, h += C * u;
88
- const E = Math.abs(e - h), T = Math.abs(u);
89
- if (E < S && T < w) {
90
- if (f += C, f >= g) {
91
- h = e, u = 0, a = !1, m(h), I.unsubscribe(v), l();
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) {
91
+ h = e, u = 0, a = !1, d(h), I.unsubscribe(S), l();
92
92
  return;
93
93
  }
94
94
  } else
95
95
  f = 0;
96
- m(h);
96
+ d(h);
97
97
  };
98
- return I.subscribe(v), {
98
+ return I.subscribe(S), {
99
99
  stop: () => {
100
- a && (a = !1, I.unsubscribe(v));
100
+ a && (a = !1, I.unsubscribe(S));
101
101
  }
102
102
  };
103
103
  }
104
104
  class O {
105
105
  constructor(t) {
106
- d(this, "options");
107
- d(this, "currentValue");
108
- d(this, "velocity");
109
- d(this, "isAnimating", !1);
110
- d(this, "controls", null);
106
+ m(this, "options");
107
+ m(this, "currentValue");
108
+ m(this, "velocity");
109
+ m(this, "isAnimating", !1);
110
+ m(this, "controls", null);
111
111
  // For object animations
112
- d(this, "animationMap", null);
113
- d(this, "activeAnimations", /* @__PURE__ */ new Set());
114
- d(this, "completedAnimations", /* @__PURE__ */ new Set());
115
- d(this, "updatedProperties", /* @__PURE__ */ new Set());
116
- d(this, "animate", (t = !1) => {
112
+ m(this, "animationMap", null);
113
+ m(this, "activeAnimations", /* @__PURE__ */ new Set());
114
+ m(this, "completedAnimations", /* @__PURE__ */ new Set());
115
+ m(this, "updatedProperties", /* @__PURE__ */ new Set());
116
+ m(this, "animate", (t = !1) => {
117
117
  !this.isAnimating && this.options.onStart && this.options.onStart(), this.isAnimating = !0;
118
118
  const e = t ? this.options.from : this.options.to;
119
119
  if (typeof this.currentValue == "object" && this.currentValue !== null) {
120
120
  this.animateObject(e);
121
121
  return;
122
122
  }
123
- let i = this.currentValue, r = performance.now();
124
- const o = {
123
+ let i = this.currentValue, o = performance.now();
124
+ const r = {
125
125
  from: this.currentValue,
126
126
  to: e,
127
127
  stiffness: this.options.spring.stiffness,
128
128
  damping: this.options.spring.damping,
129
129
  mass: 1
130
130
  };
131
- typeof this.velocity == "number" && (o.velocity = this.velocity * 1e3), this.controls = k({
132
- ...o,
131
+ typeof this.velocity == "number" && (r.velocity = this.velocity * 1e3), this.controls = k({
132
+ ...r,
133
133
  onUpdate: (s) => {
134
- const m = performance.now(), l = (m - r) / 1e3;
134
+ const d = performance.now(), l = (d - o) / 1e3;
135
135
  if (l > 0) {
136
136
  if (typeof s == "number" && typeof i == "number") {
137
137
  const h = (s - i) / l;
@@ -146,7 +146,7 @@ class O {
146
146
  }
147
147
  }), this.velocity = h;
148
148
  }
149
- i = s, r = m;
149
+ i = s, o = d;
150
150
  }
151
151
  this.currentValue = s, this.options.onUpdate(s);
152
152
  },
@@ -157,27 +157,27 @@ class O {
157
157
  }
158
158
  });
159
159
  });
160
- d(this, "animateObject", (t) => {
160
+ m(this, "animateObject", (t) => {
161
161
  const e = this.currentValue, i = Object.keys(e);
162
162
  this.animationMap = /* @__PURE__ */ new Map(), this.activeAnimations.clear(), this.completedAnimations.clear(), this.updatedProperties.clear();
163
- const r = { ...e }, o = {};
163
+ const o = { ...e }, r = {};
164
164
  let s = !1;
165
- const m = () => {
165
+ const d = () => {
166
166
  const l = i.filter((u) => !this.completedAnimations.has(u));
167
167
  if (l.every(
168
168
  (u) => this.updatedProperties.has(u)
169
169
  ) && l.length > 0) {
170
170
  if (typeof this.velocity == "object" && this.velocity) {
171
171
  const u = performance.now();
172
- Object.keys(r).forEach((a) => {
173
- if (o[a]) {
174
- const p = (u - o[a]) / 1e3, c = this.currentValue[a], S = r[a];
175
- typeof c == "number" && typeof S == "number" && p > 0 && (this.velocity[a] = (S - c) / p / 1e3);
172
+ Object.keys(o).forEach((a) => {
173
+ if (r[a]) {
174
+ const p = (u - r[a]) / 1e3, c = this.currentValue[a], g = o[a];
175
+ typeof c == "number" && typeof g == "number" && p > 0 && (this.velocity[a] = (g - c) / p / 1e3);
176
176
  }
177
- o[a] = u;
177
+ r[a] = u;
178
178
  });
179
179
  }
180
- this.currentValue = { ...r }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !s && this.options.onStart && (s = !0, this.options.onStart());
180
+ this.currentValue = { ...o }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !s && this.options.onStart && (s = !0, this.options.onStart());
181
181
  }
182
182
  };
183
183
  i.forEach((l) => {
@@ -193,7 +193,7 @@ class O {
193
193
  const u = k({
194
194
  ...h,
195
195
  onUpdate: (a) => {
196
- r[l] = a, this.updatedProperties.add(l), m();
196
+ o[l] = a, this.updatedProperties.add(l), d();
197
197
  },
198
198
  onComplete: () => {
199
199
  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) => {
@@ -284,14 +284,14 @@ class O {
284
284
  }
285
285
  class j {
286
286
  constructor(t) {
287
- d(this, "config");
288
- d(this, "animators", /* @__PURE__ */ new Map());
289
- d(this, "springOrder", []);
290
- d(this, "completedCount", 0);
291
- d(this, "completedAnimators", /* @__PURE__ */ new Set());
292
- d(this, "direction", "forward");
293
- d(this, "idCounter", 0);
294
- d(this, "timeoutIds", []);
287
+ m(this, "config");
288
+ m(this, "animators", /* @__PURE__ */ new Map());
289
+ m(this, "springOrder", []);
290
+ m(this, "completedCount", 0);
291
+ m(this, "completedAnimators", /* @__PURE__ */ new Set());
292
+ m(this, "direction", "forward");
293
+ m(this, "idCounter", 0);
294
+ m(this, "timeoutIds", []);
295
295
  this.config = t, this.initializeAnimators();
296
296
  }
297
297
  generateId() {
@@ -323,9 +323,9 @@ class j {
323
323
  */
324
324
  normalizeSchedule(t) {
325
325
  const e = this.config.schedule ?? "overlap";
326
- return this.springOrder.map((i, r) => {
327
- const o = this.animators.get(i);
328
- if (!o)
326
+ return this.springOrder.map((i, o) => {
327
+ const r = this.animators.get(i);
328
+ if (!r)
329
329
  throw new Error(
330
330
  `AnimationScheduler: animator with id "${i}" not found during normalization`
331
331
  );
@@ -336,11 +336,11 @@ class j {
336
336
  delay: 0
337
337
  };
338
338
  if (e === "wait")
339
- return t === "forward" && r === 0 ? {
339
+ return t === "forward" && o === 0 ? {
340
340
  type: "offset",
341
341
  id: i,
342
342
  delay: 0
343
- } : t === "backward" && r === this.springOrder.length - 1 ? {
343
+ } : t === "backward" && o === this.springOrder.length - 1 ? {
344
344
  type: "offset",
345
345
  id: i,
346
346
  delay: 0
@@ -348,14 +348,14 @@ class j {
348
348
  type: "wait",
349
349
  id: i
350
350
  };
351
- const s = o.item.offset ?? 0;
351
+ const s = r.item.offset ?? 0;
352
352
  if (t === "forward")
353
353
  return {
354
354
  type: "offset",
355
355
  id: i,
356
356
  delay: s
357
357
  };
358
- const m = this.animators.size === 0 ? 0 : Math.max(
358
+ const d = this.animators.size === 0 ? 0 : Math.max(
359
359
  ...Array.from(this.animators.values()).map(
360
360
  (l) => l.item.offset ?? 0
361
361
  )
@@ -363,12 +363,12 @@ class j {
363
363
  return {
364
364
  type: "offset",
365
365
  id: i,
366
- delay: m - s
366
+ delay: d - s
367
367
  };
368
368
  });
369
369
  }
370
370
  onAnimatorComplete(t) {
371
- var i, r, o, s, m, l;
371
+ var i, o, r, s, d, l;
372
372
  const e = this.animators.get(t);
373
373
  if (!e) {
374
374
  console.warn(
@@ -376,7 +376,7 @@ class j {
376
376
  );
377
377
  return;
378
378
  }
379
- 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 = (m = this.config).onEnd) == null || l.call(m)));
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)));
380
380
  }
381
381
  /**
382
382
  * Handle wait mode chaining: start next/previous spring after completion
@@ -386,18 +386,18 @@ class j {
386
386
  return;
387
387
  const e = this.springOrder.indexOf(t);
388
388
  if (this.direction === "forward") {
389
- const o = this.springOrder[e + 1];
390
- if (!o)
389
+ const r = this.springOrder[e + 1];
390
+ if (!r)
391
391
  return;
392
- const s = this.animators.get(o);
393
- s && s.startTime === null && this.startAnimator(o);
392
+ const s = this.animators.get(r);
393
+ s && s.startTime === null && this.startAnimator(r);
394
394
  return;
395
395
  }
396
396
  const i = this.springOrder[e - 1];
397
397
  if (!i)
398
398
  return;
399
- const r = this.animators.get(i);
400
- r && r.startTime === null && this.startBackwardAnimator(i);
399
+ const o = this.animators.get(i);
400
+ o && o.startTime === null && this.startBackwardAnimator(i);
401
401
  }
402
402
  startAnimator(t) {
403
403
  const e = this.animators.get(t);
@@ -433,34 +433,34 @@ class j {
433
433
  }
434
434
  forward() {
435
435
  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((r) => {
437
- if (r.type === "wait")
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
438
  return;
439
- if (r.delay === 0) {
440
- this.startAnimator(r.id);
439
+ if (o.delay === 0) {
440
+ this.startAnimator(o.id);
441
441
  return;
442
442
  }
443
- const o = window.setTimeout(
444
- () => this.startAnimator(r.id),
445
- r.delay
443
+ const r = window.setTimeout(
444
+ () => this.startAnimator(o.id),
445
+ o.delay
446
446
  );
447
- this.timeoutIds.push(o);
447
+ this.timeoutIds.push(r);
448
448
  });
449
449
  }
450
450
  backward() {
451
451
  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((r) => {
453
- if (r.type === "wait")
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
454
  return;
455
- if (r.delay === 0) {
456
- this.startBackwardAnimator(r.id);
455
+ if (o.delay === 0) {
456
+ this.startBackwardAnimator(o.id);
457
457
  return;
458
458
  }
459
- const o = window.setTimeout(
460
- () => this.startBackwardAnimator(r.id),
461
- r.delay
459
+ const r = window.setTimeout(
460
+ () => this.startBackwardAnimator(o.id),
461
+ o.delay
462
462
  );
463
- this.timeoutIds.push(o);
463
+ this.timeoutIds.push(r);
464
464
  });
465
465
  }
466
466
  stop() {
@@ -474,10 +474,10 @@ class j {
474
474
  ), this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((i) => {
475
475
  if (i.startTime === null)
476
476
  return;
477
- const r = i.animator.getCurrentState();
478
- if (r.type !== "single")
477
+ const o = i.animator.getCurrentState();
478
+ if (o.type !== "single")
479
479
  return;
480
- if (r.position === r.to) {
480
+ if (o.position === o.to) {
481
481
  const s = O.fromState(
482
482
  {
483
483
  position: 1,
@@ -507,7 +507,7 @@ class j {
507
507
  };
508
508
  }
509
509
  }
510
- const L = Symbol.for("TRANSITION_STRATEGY"), N = (n) => ({
510
+ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
511
511
  runIn: async (t) => {
512
512
  const { currentAnimation: e } = n;
513
513
  if (e && e.direction === "out") {
@@ -523,9 +523,9 @@ const L = Symbol.for("TRANSITION_STRATEGY"), N = (n) => ({
523
523
  direction: "forward"
524
524
  };
525
525
  if (t.out) {
526
- const m = await t.out, { from: l = 1, to: h = 0 } = m;
526
+ const d = await t.out, { from: l = 1, to: h = 0 } = d;
527
527
  return {
528
- config: m,
528
+ config: d,
529
529
  state: {
530
530
  position: s.position,
531
531
  velocity: s.velocity
@@ -561,15 +561,15 @@ const L = Symbol.for("TRANSITION_STRATEGY"), N = (n) => ({
561
561
  to: 1,
562
562
  direction: "forward"
563
563
  };
564
- const { from: r = 0, to: o = 1 } = i;
564
+ const { from: o = 0, to: r = 1 } = i;
565
565
  return {
566
566
  config: i,
567
567
  state: {
568
- position: r,
568
+ position: o,
569
569
  velocity: 0
570
570
  },
571
- from: r,
572
- to: o,
571
+ from: o,
572
+ to: r,
573
573
  direction: "forward"
574
574
  };
575
575
  },
@@ -588,9 +588,9 @@ const L = Symbol.for("TRANSITION_STRATEGY"), N = (n) => ({
588
588
  direction: "forward"
589
589
  };
590
590
  if (t.in) {
591
- const m = await t.in, { from: l = 0, to: h = 1 } = m;
591
+ const d = await t.in, { from: l = 0, to: h = 1 } = d;
592
592
  return {
593
- config: m,
593
+ config: d,
594
594
  state: {
595
595
  position: s.position,
596
596
  velocity: s.velocity
@@ -626,19 +626,19 @@ const L = Symbol.for("TRANSITION_STRATEGY"), N = (n) => ({
626
626
  to: 0,
627
627
  direction: "forward"
628
628
  };
629
- const { from: r = 1, to: o = 0 } = i;
629
+ const { from: o = 1, to: r = 0 } = i;
630
630
  return {
631
631
  config: i,
632
632
  state: {
633
- position: r,
633
+ position: o,
634
634
  velocity: 0
635
635
  },
636
- from: r,
637
- to: o,
636
+ from: o,
637
+ to: r,
638
638
  direction: "forward"
639
639
  };
640
640
  }
641
- }), H = () => ({
641
+ }), N = () => ({
642
642
  runIn: async (n) => {
643
643
  const t = await n.in;
644
644
  if (!t)
@@ -712,32 +712,32 @@ const L = Symbol.for("TRANSITION_STRATEGY"), N = (n) => ({
712
712
  });
713
713
  function W(n, t) {
714
714
  var u;
715
- let e = null, i = null, r = null, o = null;
715
+ let e = null, i = null, o = null, r = null;
716
716
  const s = {
717
717
  get currentAnimation() {
718
718
  return e;
719
719
  }
720
- }, m = ((u = t == null ? void 0 : t.strategy) == null ? void 0 : u.call(t, s)) || N(s), l = async (a) => {
721
- var v, A, C;
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
722
  i && (i.remove(), i = null);
723
- const p = n(), c = p.in && await p.in(a), S = !(t != null && t.strategy) && p.out ? await p.out(a) : void 0;
723
+ const p = n(), c = p.in && await p.in(a), g = !(t != null && t.strategy) && p.out ? p.out(a) : void 0;
724
724
  if (!c)
725
725
  return;
726
- if (R(c)) {
727
- const y = {
726
+ if (V(c)) {
727
+ const v = {
728
728
  in: Promise.resolve(c),
729
- out: S && Promise.resolve(S)
729
+ out: g && Promise.resolve(g)
730
730
  };
731
- if (!(await m.runIn(y)).config) {
731
+ if (!(await d.runIn(v)).config) {
732
732
  e && (e.direction = "in");
733
733
  return;
734
734
  }
735
- (v = c.prepare) == null || v.call(c, a), c.wait && await c.wait();
735
+ (S = c.prepare) == null || S.call(c, a), c.wait && await c.wait();
736
736
  const E = new j({
737
737
  ...c,
738
738
  onEnd: () => {
739
- var T;
740
- e = null, (T = c.onEnd) == null || T.call(c);
739
+ var C;
740
+ e = null, (C = c.onEnd) == null || C.call(c);
741
741
  }
742
742
  });
743
743
  e = {
@@ -748,49 +748,49 @@ function W(n, t) {
748
748
  }
749
749
  const w = {
750
750
  in: Promise.resolve(c),
751
- out: S && Promise.resolve(S)
752
- }, f = await m.runIn(w);
751
+ out: g && Promise.resolve(g)
752
+ }, f = await d.runIn(w);
753
753
  if (!f.config)
754
754
  return;
755
755
  if ("springs" in f.config) {
756
756
  console.error("Unexpected MultiSpringConfig in single-spring path");
757
757
  return;
758
758
  }
759
- (C = (A = f.config).prepare) == null || C.call(A, a), f.config.wait && await f.config.wait();
760
- const g = O.fromState(f.state, {
759
+ (b = (T = f.config).prepare) == null || b.call(T, a), f.config.wait && await f.config.wait();
760
+ const y = O.fromState(f.state, {
761
761
  from: f.from,
762
762
  to: f.to,
763
763
  spring: f.config.spring,
764
764
  onStart: f.config.onStart,
765
765
  onUpdate: f.config.tick,
766
766
  onComplete: () => {
767
- var y, b;
768
- e = null, (b = (y = f.config) == null ? void 0 : y.onEnd) == null || b.call(y);
767
+ var v, A;
768
+ e = null, (A = (v = f.config) == null ? void 0 : v.onEnd) == null || A.call(v);
769
769
  }
770
770
  });
771
- e = { controller: g, direction: "in" }, f.direction === "forward" ? g.forward() : g.backward();
771
+ e = { controller: y, direction: "in" }, f.direction === "forward" ? y.forward() : y.backward();
772
772
  }, h = async (a) => {
773
- var v, A, C;
773
+ var S, T, b;
774
774
  i = a;
775
775
  const p = n(), c = p.out && await p.out(a);
776
776
  if (!c)
777
777
  return;
778
- if (R(c)) {
779
- const y = {
778
+ if (V(c)) {
779
+ const v = {
780
780
  in: void 0,
781
781
  // Don't fetch IN config for exit transitions
782
782
  out: Promise.resolve(c)
783
783
  };
784
- if (!(await m.runOut(y)).config) {
784
+ if (!(await d.runOut(v)).config) {
785
785
  e && (e.direction = "out"), i && (i.remove(), i = null);
786
786
  return;
787
787
  }
788
- (v = c.prepare) == null || v.call(c, a), g(), c.wait && await c.wait();
788
+ (S = c.prepare) == null || S.call(c, a), y(), c.wait && await c.wait();
789
789
  const E = new j({
790
790
  ...c,
791
791
  onEnd: () => {
792
- var T, x;
793
- (T = c.onEnd) == null || T.call(c), i && (i.remove(), i = null), e = null, (x = t == null ? void 0 : t.onCleanupEnd) == null || x.call(t);
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
794
  }
795
795
  });
796
796
  e = {
@@ -799,18 +799,18 @@ function W(n, t) {
799
799
  }, E.forward();
800
800
  return;
801
801
  }
802
- const S = {
802
+ const g = {
803
803
  in: void 0,
804
804
  // Don't fetch IN config for exit transitions
805
805
  out: Promise.resolve(c)
806
- }, w = await m.runOut(S);
806
+ }, w = await d.runOut(g);
807
807
  if (!w.config)
808
808
  return;
809
809
  if ("springs" in w.config) {
810
810
  console.error("Unexpected MultiSpringConfig in single-spring path");
811
811
  return;
812
812
  }
813
- (C = (A = w.config).prepare) == null || C.call(A, a), g(), w.config.wait && await w.config.wait();
813
+ (b = (T = w.config).prepare) == null || b.call(T, a), y(), w.config.wait && await w.config.wait();
814
814
  const f = O.fromState(w.state, {
815
815
  from: w.from,
816
816
  to: w.to,
@@ -818,99 +818,83 @@ function W(n, t) {
818
818
  onStart: w.config.onStart,
819
819
  onUpdate: w.config.tick,
820
820
  onComplete: () => {
821
- var y, b, E;
822
- (b = (y = w.config) == null ? void 0 : y.onEnd) == null || b.call(y), i && (i.remove(), i = null), e = null, (E = t == null ? void 0 : t.onCleanupEnd) == null || E.call(t);
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
823
  }
824
824
  });
825
825
  e = { controller: f, direction: "out" }, w.direction === "forward" ? f.forward() : f.backward();
826
- function g() {
827
- !r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
826
+ function y() {
827
+ !o || !i || (r && o.contains(r) ? o.insertBefore(i, r) : o.appendChild(i));
828
828
  }
829
829
  };
830
830
  return (a) => {
831
831
  if (a)
832
- return r = a.parentElement, o = a.nextElementSibling, l(a), () => {
832
+ return o = a.parentElement, r = a.nextElementSibling, l(a), () => {
833
833
  const p = a.cloneNode(!0);
834
834
  h(p);
835
835
  };
836
836
  };
837
837
  }
838
- const B = 3, K = (n) => {
838
+ const Y = 3, X = (n) => {
839
839
  if (!n) return null;
840
840
  const t = n.split(`
841
841
  `).map((e) => e.trim());
842
- for (let e = B; e < Math.min(t.length, 6); e++) {
843
- const i = t[e], r = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
844
- if (!r)
842
+ 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)
845
845
  continue;
846
- const o = r[1] ?? "", s = r[2] ?? "0", m = r[3] ?? "0";
847
- return { file: o.split(/[\\/]/).pop() || o, line: s, column: m };
846
+ const r = o[1] ?? "", s = o[2] ?? "0", d = o[3] ?? "0";
847
+ return { file: r.split(/[\\/]/).pop() || r, line: s, column: d };
848
848
  }
849
849
  return null;
850
- }, V = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
851
- function q(n, t, e) {
852
- V.set(n, t);
853
- let i = M.get(n);
850
+ }, M = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
851
+ function B(n, t, e) {
852
+ M.set(n, t);
853
+ let i = R.get(n);
854
854
  return i || (i = W(
855
855
  () => {
856
- const r = V.get(n);
857
- return r || (console.warn(`Transition "${String(n)}" not found`), {});
856
+ const o = M.get(n);
857
+ return o || (console.warn(`Transition "${String(n)}" not found`), {});
858
858
  },
859
859
  {
860
860
  strategy: e,
861
861
  onCleanupEnd: () => D(n)
862
862
  }
863
- ), M.set(n, i), i);
863
+ ), R.set(n, i), i);
864
864
  }
865
865
  function D(n) {
866
- V.delete(n), M.delete(n);
866
+ M.delete(n), R.delete(n);
867
867
  }
868
- function Y() {
869
- const n = K(new Error().stack);
868
+ function K() {
869
+ const n = X(new Error().stack);
870
870
  return n ? `auto_${n.file}_${n.line}_${n.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
871
871
  }
872
- const U = globalThis.FinalizationRegistry, z = U ? new U((n) => {
873
- try {
874
- D(n);
875
- } catch {
876
- }
877
- }) : void 0;
872
+ const L = globalThis.FinalizationRegistry, U = L ? (
873
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
874
+ new L((n) => {
875
+ try {
876
+ D(n);
877
+ } catch {
878
+ }
879
+ })
880
+ ) : void 0;
878
881
  function nt(n) {
879
- const t = n.key ?? Y();
880
- if (n.ref && z)
882
+ const t = n.key ?? K();
883
+ if (n.ref && U)
881
884
  try {
882
- z.register(n.ref, t);
885
+ U.register(n.ref, t);
883
886
  } catch {
884
887
  }
885
- return q(
888
+ return B(
886
889
  t,
887
890
  {
888
891
  in: n.in,
889
892
  out: n.out
890
893
  },
891
- n[L]
894
+ n[z]
892
895
  );
893
896
  }
894
- const X = (n) => {
895
- let t = n.parentElement;
896
- for (; t && t !== document.body; ) {
897
- const e = window.getComputedStyle(t), i = e.overflow + e.overflowY + e.overflowX;
898
- if (i.includes("auto") || i.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
899
- return t;
900
- t = t.parentElement;
901
- }
902
- return document.documentElement;
903
- }, G = (n) => {
904
- let t = n.parentElement;
905
- for (; t && t !== document.body; ) {
906
- const e = window.getComputedStyle(t).position;
907
- if (e === "relative" || e === "absolute" || e === "fixed" || e === "sticky")
908
- return t;
909
- t = t.parentElement;
910
- }
911
- return document.body;
912
- };
913
- function J(n) {
897
+ function q(n) {
914
898
  const t = n.filter((e) => e.symmetric).map((e) => ({
915
899
  from: e.to,
916
900
  to: e.from,
@@ -918,32 +902,57 @@ function J(n) {
918
902
  }));
919
903
  return [...n, ...t];
920
904
  }
921
- function Q(n) {
922
- let t = !1, e = !1;
923
- const i = (l) => {
905
+ function G(n) {
906
+ let t = !1, e = 0, i = 0, o = !1;
907
+ const r = 50, s = 50, d = (c) => {
924
908
  if (!n) return;
925
- const h = l.touches[0];
926
- h && (e = h.clientX < 50);
927
- }, r = () => {
928
- n && (e && (t = !0, setTimeout(() => {
909
+ const g = c.touches[0];
910
+ g && (o = g.clientX < s, o && (e = g.clientX, i = g.clientY));
911
+ }, l = (c) => {
912
+ if (!n || !o || t) return;
913
+ const g = c.touches[0];
914
+ if (!g) return;
915
+ const w = g.clientX - e, f = g.clientY - i;
916
+ w > r && Math.abs(w) > Math.abs(f) && (t = !0, setTimeout(() => {
929
917
  t = !1;
930
- }, 500)), e = !1);
918
+ }, 500));
919
+ }, h = () => {
920
+ n && (o = !1, e = 0, i = 0);
931
921
  };
932
922
  return {
933
923
  initialize: () => {
934
- typeof window > "u" || n && (window.addEventListener("touchstart", i, { passive: !0 }), window.addEventListener("touchend", r, { passive: !0 }));
924
+ typeof window > "u" || n && (window.addEventListener("touchstart", d, { passive: !0 }), window.addEventListener("touchmove", l, { passive: !0 }), window.addEventListener("touchend", h, { passive: !0 }));
935
925
  },
936
926
  cleanup: () => {
937
- typeof window > "u" || (window.removeEventListener("touchstart", i), window.removeEventListener("touchend", r));
927
+ typeof window > "u" || (window.removeEventListener("touchstart", d), window.removeEventListener("touchmove", l), window.removeEventListener("touchend", h));
938
928
  },
939
929
  isSwipePending: () => t
940
930
  };
941
931
  }
932
+ const J = (n) => {
933
+ let t = n.parentElement;
934
+ for (; t && t !== document.body; ) {
935
+ const e = window.getComputedStyle(t), i = e.overflow + e.overflowY + e.overflowX;
936
+ if (i.includes("auto") || i.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
937
+ return t;
938
+ t = t.parentElement;
939
+ }
940
+ return document.documentElement;
941
+ }, Q = (n) => {
942
+ let t = n.parentElement;
943
+ for (; t && t !== document.body; ) {
944
+ const e = window.getComputedStyle(t).position;
945
+ if (e === "relative" || e === "absolute" || e === "fixed" || e === "sticky")
946
+ return t;
947
+ t = t.parentElement;
948
+ }
949
+ return document.body;
950
+ };
942
951
  function Z() {
943
952
  let n = null, t = null;
944
953
  const e = /* @__PURE__ */ new Map();
945
954
  let i = null;
946
- const r = () => {
955
+ const o = () => {
947
956
  n && i && e.set(i, {
948
957
  x: n.scrollLeft,
949
958
  y: n.scrollTop
@@ -951,7 +960,7 @@ function Z() {
951
960
  };
952
961
  return {
953
962
  initializeContext: (u, a) => {
954
- t = u, n || (n = X(u), (n === document.documentElement ? window : n).addEventListener("scroll", r, {
963
+ t = u, n || (n = J(u), (n === document.documentElement ? window : n).addEventListener("scroll", o, {
955
964
  passive: !0
956
965
  })), i = a;
957
966
  },
@@ -963,53 +972,71 @@ function Z() {
963
972
  };
964
973
  },
965
974
  getScrollContainer: () => n,
966
- getPositionedParentElement: () => t ? G(t) : document.body,
975
+ getPositionedParentElement: () => t ? Q(t) : document.body,
967
976
  getScrollPosition: (u) => u && e.has(u) ? e.get(u) : { x: 0, y: 0 }
968
977
  };
969
978
  }
979
+ function P(n, t) {
980
+ if (t === "*")
981
+ return !0;
982
+ if (t.endsWith("/*")) {
983
+ const e = t.slice(0, -2);
984
+ return n === e || n.startsWith(e + "/");
985
+ }
986
+ return n === t;
987
+ }
988
+ function tt(n, t, e) {
989
+ for (const i of e)
990
+ if (P(n, i.from) && P(t, i.to))
991
+ return i.transition;
992
+ for (const i of e)
993
+ if ((i.from === "*" || P(n, i.from)) && (i.to === "*" || P(t, i.to)))
994
+ return i.transition;
995
+ return null;
996
+ }
970
997
  function ot(n) {
971
998
  const {
972
999
  transitions: t = [],
973
1000
  defaultTransition: e,
974
- middleware: i = (f, g) => ({ from: f, to: g }),
1001
+ middleware: i = (f, y) => ({ from: f, to: y }),
975
1002
  // Identity function as default
976
- skipOnIosSwipe: r = !1
1003
+ skipOnIosSwipe: o = !0
977
1004
  // Default to true - skip animations on iOS swipe
978
1005
  } = n;
979
- let o = null;
980
- const s = J(t), {
981
- initializeContext: m,
1006
+ let r = null;
1007
+ const s = q(t), {
1008
+ initializeContext: d,
982
1009
  calculateScrollOffset: l,
983
1010
  getScrollContainer: h,
984
1011
  getPositionedParentElement: u,
985
1012
  getScrollPosition: a
986
- } = Z(), p = Q(r);
1013
+ } = Z(), p = G(o);
987
1014
  p.initialize();
988
1015
  function c() {
989
- if (o != null && o.from && (o != null && o.to)) {
990
- const { from: f, to: g } = i(
991
- o.from,
992
- o.to
993
- ), A = tt(
1016
+ if (r != null && r.from && (r != null && r.to)) {
1017
+ const { from: f, to: y } = i(
1018
+ r.from,
1019
+ r.to
1020
+ ), T = tt(
994
1021
  f,
995
- g,
1022
+ y,
996
1023
  s
997
- ) || e, C = l(
998
- o.from,
999
- o.to
1000
- ), y = {
1001
- scrollOffset: C,
1002
- scroll: a(o.from),
1024
+ ) || e, b = l(
1025
+ r.from,
1026
+ r.to
1027
+ ), v = {
1028
+ scrollOffset: b,
1029
+ scroll: a(r.from),
1003
1030
  get scrollingElement() {
1004
1031
  return h() || document.documentElement;
1005
1032
  },
1006
1033
  get positionedParent() {
1007
1034
  return u();
1008
1035
  }
1009
- }, b = {
1010
- scrollOffset: C,
1036
+ }, A = {
1037
+ scrollOffset: b,
1011
1038
  get scroll() {
1012
- return o ? a(o.to) : { x: 0, y: 0 };
1039
+ return r ? a(r.to) : { x: 0, y: 0 };
1013
1040
  },
1014
1041
  get scrollingElement() {
1015
1042
  return h() || document.documentElement;
@@ -1018,51 +1045,33 @@ function ot(n) {
1018
1045
  return u();
1019
1046
  }
1020
1047
  };
1021
- A && (A.out && o.outResolve && o.outResolve(
1022
- (E) => A.out(E, y)
1023
- ), A.in && o.inResolve && o.inResolve(
1024
- (E) => A.in(E, b)
1025
- )), o = null;
1048
+ T && (T.out && r.outResolve && r.outResolve(
1049
+ (E) => T.out(E, v)
1050
+ ), T.in && r.inResolve && r.inResolve(
1051
+ (E) => T.in(E, A)
1052
+ )), r = null;
1026
1053
  }
1027
1054
  }
1028
- const S = async (f, g) => p.isSwipePending() ? () => ({}) : g === "in" && (!o || !o.from) ? () => ({}) : (o || (o = {}), g === "out" ? (o.from = f, new Promise((v) => {
1029
- o.outResolve = v, c();
1030
- })) : (o.to = f, new Promise((v) => {
1031
- o.inResolve = v, c();
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();
1032
1059
  })));
1033
1060
  return (f) => ({
1034
1061
  key: f,
1035
- in: async (g) => (m(g, f), (await S(f, "in"))(g)),
1036
- out: async (g) => (await S(f, "out"))(g),
1062
+ in: async (y) => (d(y, f), (await g(f, "in"))(y)),
1063
+ out: async (y) => (await g(f, "out"))(y),
1037
1064
  // Add page transition strategy for page-level transitions
1038
- [L]: H
1065
+ [z]: N
1039
1066
  });
1040
1067
  }
1041
- function tt(n, t, e) {
1042
- for (const i of e)
1043
- if (P(n, i.from) && P(t, i.to))
1044
- return i.transition;
1045
- for (const i of e)
1046
- if ((i.from === "*" || P(n, i.from)) && (i.to === "*" || P(t, i.to)))
1047
- return i.transition;
1048
- return null;
1049
- }
1050
- function P(n, t) {
1051
- if (t === "*")
1052
- return !0;
1053
- if (t.endsWith("/*")) {
1054
- const e = t.slice(0, -2);
1055
- return n === e || n.startsWith(e + "/");
1056
- }
1057
- return n === t;
1058
- }
1059
1068
  export {
1060
- L as TRANSITION_STRATEGY,
1061
- N as createDefaultStrategy,
1062
- H as createPageTransitionStrategy,
1069
+ z as TRANSITION_STRATEGY,
1070
+ F as createDefaultStrategy,
1071
+ N as createPageTransitionStrategy,
1063
1072
  ot as createSggoiTransitionContext,
1064
- Y as generateAutoKey,
1065
- R as isMultiSpring,
1073
+ K as generateAutoKey,
1074
+ V as isMultiSpring,
1066
1075
  at as isSingleSpring,
1067
1076
  lt as jaeminInternal,
1068
1077
  nt as transition