@ssgoi/core 6.7.0-beta.1 → 7.0.0-beta.1

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 (100) hide show
  1. package/README.md +80 -230
  2. package/dist/animation/animation.d.ts +2 -2
  3. package/dist/animation/frame-scheduler.d.ts +36 -0
  4. package/dist/animation/frame-scheduler.d.ts.map +1 -0
  5. package/dist/animation/multi-animation.d.ts +3 -2
  6. package/dist/animation/multi-animation.d.ts.map +1 -1
  7. package/dist/animation/web-animation.d.ts +16 -4
  8. package/dist/animation/web-animation.d.ts.map +1 -1
  9. package/dist/index.cjs +15 -15
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1282 -1125
  13. package/dist/internal.cjs +1 -1
  14. package/dist/internal.d.ts +1 -1
  15. package/dist/internal.d.ts.map +1 -1
  16. package/dist/internal.js +692 -521
  17. package/dist/multi-animation-6124HEke.cjs +1 -0
  18. package/dist/multi-animation-ZFZBDBGr.js +439 -0
  19. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
  20. package/dist/ssgoi-transition/navigation-detector-strategy.d.ts +24 -9
  21. package/dist/ssgoi-transition/navigation-detector-strategy.d.ts.map +1 -1
  22. package/dist/ssgoi-transition/navigation-direction.d.ts +13 -0
  23. package/dist/ssgoi-transition/navigation-direction.d.ts.map +1 -0
  24. package/dist/ssgoi-transition/observe-ssgoi-transitions.d.ts +1 -0
  25. package/dist/ssgoi-transition/observe-ssgoi-transitions.d.ts.map +1 -1
  26. package/dist/ssgoi-transition/path-pattern.d.ts +15 -0
  27. package/dist/ssgoi-transition/path-pattern.d.ts.map +1 -0
  28. package/dist/ssgoi-transition/resolve-transition-rule.d.ts +16 -0
  29. package/dist/ssgoi-transition/resolve-transition-rule.d.ts.map +1 -0
  30. package/dist/ssgoi-transition/unmount-observer.d.ts +11 -2
  31. package/dist/ssgoi-transition/unmount-observer.d.ts.map +1 -1
  32. package/dist/transitions/axis/index.d.ts +5 -7
  33. package/dist/transitions/axis/index.d.ts.map +1 -1
  34. package/dist/transitions/axis/types.d.ts +0 -1
  35. package/dist/transitions/axis/types.d.ts.map +1 -1
  36. package/dist/transitions/blind/index.d.ts +2 -3
  37. package/dist/transitions/blind/index.d.ts.map +1 -1
  38. package/dist/transitions/drill/index.d.ts +6 -7
  39. package/dist/transitions/drill/index.d.ts.map +1 -1
  40. package/dist/transitions/drill/provider/crossfade.d.ts.map +1 -1
  41. package/dist/transitions/drill/provider/parallax.d.ts.map +1 -1
  42. package/dist/transitions/drill/transition.d.ts.map +1 -1
  43. package/dist/transitions/drill/types.d.ts +0 -1
  44. package/dist/transitions/drill/types.d.ts.map +1 -1
  45. package/dist/transitions/fade/index.d.ts +3 -5
  46. package/dist/transitions/fade/index.d.ts.map +1 -1
  47. package/dist/transitions/film/index.d.ts +3 -5
  48. package/dist/transitions/film/index.d.ts.map +1 -1
  49. package/dist/transitions/hero/fit.d.ts +5 -0
  50. package/dist/transitions/hero/fit.d.ts.map +1 -0
  51. package/dist/transitions/hero/index.d.ts +3 -5
  52. package/dist/transitions/hero/index.d.ts.map +1 -1
  53. package/dist/transitions/hero/transition.d.ts +12 -1
  54. package/dist/transitions/hero/transition.d.ts.map +1 -1
  55. package/dist/transitions/hero/types.d.ts +2 -1
  56. package/dist/transitions/hero/types.d.ts.map +1 -1
  57. package/dist/transitions/jaemin/index.d.ts +3 -5
  58. package/dist/transitions/jaemin/index.d.ts.map +1 -1
  59. package/dist/transitions/media-geometry.d.ts +55 -0
  60. package/dist/transitions/media-geometry.d.ts.map +1 -0
  61. package/dist/transitions/rotate/index.d.ts +3 -5
  62. package/dist/transitions/rotate/index.d.ts.map +1 -1
  63. package/dist/transitions/scroll/index.d.ts +4 -5
  64. package/dist/transitions/scroll/index.d.ts.map +1 -1
  65. package/dist/transitions/scroll/transition.d.ts +1 -1
  66. package/dist/transitions/scroll/transition.d.ts.map +1 -1
  67. package/dist/transitions/sheet/index.d.ts +6 -7
  68. package/dist/transitions/sheet/index.d.ts.map +1 -1
  69. package/dist/transitions/sheet/provider/static.d.ts.map +1 -1
  70. package/dist/transitions/sheet/transition.d.ts.map +1 -1
  71. package/dist/transitions/sheet/types.d.ts +0 -1
  72. package/dist/transitions/sheet/types.d.ts.map +1 -1
  73. package/dist/transitions/slide/index.d.ts +3 -5
  74. package/dist/transitions/slide/index.d.ts.map +1 -1
  75. package/dist/transitions/slide/transition.d.ts +0 -1
  76. package/dist/transitions/slide/transition.d.ts.map +1 -1
  77. package/dist/transitions/strip/index.d.ts +3 -5
  78. package/dist/transitions/strip/index.d.ts.map +1 -1
  79. package/dist/transitions/utils.d.ts +3 -21
  80. package/dist/transitions/utils.d.ts.map +1 -1
  81. package/dist/transitions/zoom/index.d.ts +3 -4
  82. package/dist/transitions/zoom/index.d.ts.map +1 -1
  83. package/dist/transitions/zoom/provider/blur.d.ts.map +1 -1
  84. package/dist/transitions/zoom/transition.d.ts +6 -1
  85. package/dist/transitions/zoom/transition.d.ts.map +1 -1
  86. package/dist/transitions/zoom/types.d.ts +5 -0
  87. package/dist/transitions/zoom/types.d.ts.map +1 -1
  88. package/dist/transitions/zoom/zoom-element.d.ts +2 -2
  89. package/dist/transitions/zoom/zoom-element.d.ts.map +1 -1
  90. package/dist/types/index.d.ts +66 -10
  91. package/dist/types/index.d.ts.map +1 -1
  92. package/dist/utils/wait-paint.d.ts +8 -7
  93. package/dist/utils/wait-paint.d.ts.map +1 -1
  94. package/package.json +13 -14
  95. package/dist/multi-animation-1FueEz2Q.js +0 -367
  96. package/dist/multi-animation-qtH1IKNG.cjs +0 -1
  97. package/dist/ssgoi-transition/find-matching-transition.d.ts +0 -30
  98. package/dist/ssgoi-transition/find-matching-transition.d.ts.map +0 -1
  99. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts +0 -7
  100. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts.map +0 -1
package/dist/internal.js CHANGED
@@ -1,52 +1,52 @@
1
- var Nt = Object.defineProperty;
2
- var kt = (t, n, e) => n in t ? Nt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
- var F = (t, n, e) => kt(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { A as It } from "./multi-animation-1FueEz2Q.js";
5
- import { M as Ee, W as we } from "./multi-animation-1FueEz2Q.js";
6
- class Ht extends It {
1
+ var Ht = Object.defineProperty;
2
+ var Wt = (t, e, n) => e in t ? Ht(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var U = (t, e, n) => Wt(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { A as Bt } from "./multi-animation-ZFZBDBGr.js";
5
+ import { M as Me, W as Ae } from "./multi-animation-ZFZBDBGr.js";
6
+ class Ft extends Bt {
7
7
  constructor() {
8
8
  super(...arguments);
9
- F(this, "child", null);
10
- F(this, "_state", "idle");
11
- F(this, "_settled", !1);
12
- F(this, "listeners", /* @__PURE__ */ new Set());
9
+ U(this, "child", null);
10
+ U(this, "_state", "idle");
11
+ U(this, "_settled", !1);
12
+ U(this, "listeners", /* @__PURE__ */ new Set());
13
13
  }
14
- attach(e) {
15
- const s = this.child;
16
- if (this.child = e, this._settled = !1, s) {
17
- const l = s.getPose();
18
- s.complete(), e.matchInto(l);
14
+ attach(n) {
15
+ const o = this.child;
16
+ if (this.child = n, this._settled = !1, o) {
17
+ const a = o.getPose();
18
+ o.complete(), n.matchInto(a);
19
19
  }
20
- e.playbackRate = this.playbackRate;
21
- const o = e.onComplete;
22
- e.onComplete = () => {
23
- o == null || o(), this.child === e && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
20
+ n.playbackRate = this.playbackRate;
21
+ const s = n.onComplete;
22
+ n.onComplete = () => {
23
+ s == null || s(), this.child === n && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
24
24
  };
25
- const a = e.onUpdate;
26
- e.onUpdate = (l) => {
27
- var u;
28
- a == null || a(l), (u = this.onUpdate) == null || u.call(this, l), this.notify();
29
- }, this._state === "paused" ? e.pause() : this._state === "reversing" ? e.reverse() : (this._state = "playing", e.play()), this.notify();
25
+ const i = n.onUpdate;
26
+ n.onUpdate = (a) => {
27
+ var l;
28
+ i == null || i(a), (l = this.onUpdate) == null || l.call(this, a), this.notify();
29
+ }, this._state === "paused" ? n.pause() : this._state === "reversing" ? n.reverse() : (this._state = "playing", n.play()), this.notify();
30
30
  }
31
31
  play() {
32
- var e;
33
- this._state = "playing", this._settled = !1, (e = this.child) == null || e.play(), this.notify();
32
+ var n;
33
+ this._state = "playing", this._settled = !1, (n = this.child) == null || n.play(), this.notify();
34
34
  }
35
35
  reverse() {
36
- var e;
37
- this._state = "reversing", this._settled = !1, (e = this.child) == null || e.reverse(), this.notify();
36
+ var n;
37
+ this._state = "reversing", this._settled = !1, (n = this.child) == null || n.reverse(), this.notify();
38
38
  }
39
39
  pause() {
40
- var e;
41
- this._state = "paused", (e = this.child) == null || e.pause(), this.notify();
40
+ var n;
41
+ this._state = "paused", (n = this.child) == null || n.pause(), this.notify();
42
42
  }
43
43
  complete() {
44
- var e;
45
- (e = this.child) == null || e.complete(), this.notify();
44
+ var n;
45
+ (n = this.child) == null || n.complete(), this.notify();
46
46
  }
47
47
  get isAnimating() {
48
- var e;
49
- return ((e = this.child) == null ? void 0 : e.isAnimating) ?? !1;
48
+ var n;
49
+ return ((n = this.child) == null ? void 0 : n.isAnimating) ?? !1;
50
50
  }
51
51
  get isPaused() {
52
52
  return this._state === "paused";
@@ -55,687 +55,858 @@ class Ht extends It {
55
55
  return this._settled && !this.child;
56
56
  }
57
57
  get isReversing() {
58
- var e;
59
- return ((e = this.child) == null ? void 0 : e.isReversing) ?? this._state === "reversing";
58
+ var n;
59
+ return ((n = this.child) == null ? void 0 : n.isReversing) ?? this._state === "reversing";
60
60
  }
61
61
  get progress() {
62
- var e;
63
- return ((e = this.child) == null ? void 0 : e.progress) ?? 0;
62
+ var n;
63
+ return ((n = this.child) == null ? void 0 : n.progress) ?? 0;
64
64
  }
65
- findTimeForProgress(e) {
66
- var s;
67
- return ((s = this.child) == null ? void 0 : s.findTimeForProgress(e)) ?? null;
65
+ findTimeForProgress(n) {
66
+ var o;
67
+ return ((o = this.child) == null ? void 0 : o.findTimeForProgress(n)) ?? null;
68
68
  }
69
69
  get playbackRate() {
70
70
  return super.playbackRate;
71
71
  }
72
- set playbackRate(e) {
73
- super.playbackRate = e, this.child && (this.child.playbackRate = e), this.notify();
72
+ set playbackRate(n) {
73
+ super.playbackRate = n, this.child && (this.child.playbackRate = n), this.notify();
74
74
  }
75
75
  getPose() {
76
- var e;
77
- return ((e = this.child) == null ? void 0 : e.getPose()) ?? [];
76
+ var n;
77
+ return ((n = this.child) == null ? void 0 : n.getPose()) ?? [];
78
78
  }
79
79
  getTimeline() {
80
- var e;
81
- return ((e = this.child) == null ? void 0 : e.getTimeline()) ?? [];
80
+ var n;
81
+ return ((n = this.child) == null ? void 0 : n.getTimeline()) ?? [];
82
82
  }
83
- matchInto(e) {
84
- var s;
85
- (s = this.child) == null || s.matchInto(e);
83
+ matchInto(n) {
84
+ var o;
85
+ (o = this.child) == null || o.matchInto(n);
86
86
  }
87
87
  /** Currently attached child, or null when nothing is playing. */
88
88
  get activeChild() {
89
89
  return this.child;
90
90
  }
91
91
  /** Subscribe to host state changes. Returns an unsubscribe fn. */
92
- subscribe(e) {
93
- return this.listeners.add(e), () => {
94
- this.listeners.delete(e);
92
+ subscribe(n) {
93
+ return this.listeners.add(n), () => {
94
+ this.listeners.delete(n);
95
95
  };
96
96
  }
97
97
  notify() {
98
- for (const e of this.listeners) e();
98
+ for (const n of this.listeners) n();
99
99
  }
100
100
  }
101
- const Wt = (t, n) => {
102
- var e;
103
- t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((e = n == null ? void 0 : n.scrollOffset) == null ? void 0 : e.y) ?? 0)}px`, t.style.left = "0";
104
- }, gt = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), zt = (t) => {
105
- let n = t.parentElement;
106
- for (; n && n !== document.body; ) {
107
- const e = window.getComputedStyle(n);
108
- if (gt.has(e.overflowY) || gt.has(e.overflowX))
109
- return n;
110
- n = n.parentElement;
101
+ const zt = (t, e) => {
102
+ var n;
103
+ t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((n = e == null ? void 0 : e.scrollOffset) == null ? void 0 : n.y) ?? 0)}px`, t.style.left = "0";
104
+ }, vt = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), Kt = (t) => {
105
+ let e = t.parentElement;
106
+ for (; e && e !== document.body; ) {
107
+ const n = window.getComputedStyle(e);
108
+ if (vt.has(n.overflowY) || vt.has(n.overflowX))
109
+ return e;
110
+ e = e.parentElement;
111
111
  }
112
112
  return document.documentElement;
113
- }, Bt = (t) => {
114
- let n = t.parentElement;
115
- for (; n && n !== document.body; ) {
116
- const e = window.getComputedStyle(n).position;
117
- if (e === "relative" || e === "absolute" || e === "fixed" || e === "sticky")
118
- return n;
119
- n = n.parentElement;
113
+ }, Xt = (t) => {
114
+ let e = t.parentElement;
115
+ for (; e && e !== document.body; ) {
116
+ const n = window.getComputedStyle(e).position;
117
+ if (n === "relative" || n === "absolute" || n === "fixed" || n === "sticky")
118
+ return e;
119
+ e = e.parentElement;
120
120
  }
121
121
  return document.body;
122
122
  };
123
- function Ft(t) {
124
- const n = Object.keys(t);
125
- return Promise.all(n.map((e) => t[e])).then((e) => {
126
- const s = {};
127
- return n.forEach((o, a) => {
128
- s[o] = e[a];
129
- }), s;
123
+ function $t(t) {
124
+ const e = Object.keys(t);
125
+ return Promise.all(e.map((n) => t[n])).then((n) => {
126
+ const o = {};
127
+ return e.forEach((s, i) => {
128
+ o[s] = n[i];
129
+ }), o;
130
130
  });
131
131
  }
132
- function Kt(t) {
133
- const n = t.filter((e) => e.symmetric).map((e) => ({
134
- from: e.to,
135
- to: e.from,
136
- transition: e.transition
137
- }));
138
- return [...t, ...n];
139
- }
140
- const Xt = 1e6, vt = 100, $t = 10;
141
- function Ut(t) {
142
- const n = t.trim(), e = n.indexOf("#"), s = n.indexOf("?"), o = [e, s].filter((a) => a >= 0).reduce((a, l) => Math.min(a, l), n.length);
143
- return n.slice(0, o);
132
+ const Gt = 1e6, Et = 100, Ut = 10, qt = 1;
133
+ function Vt(t) {
134
+ const e = t.trim(), n = e.indexOf("#"), o = e.indexOf("?"), s = [n, o].filter((i) => i >= 0).reduce((i, a) => Math.min(i, a), e.length);
135
+ return e.slice(0, s);
144
136
  }
145
- function at(t) {
146
- const n = Ut(t);
137
+ function V(t) {
138
+ const e = Vt(t);
147
139
  try {
148
- if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))
149
- return at(new URL(n).pathname);
140
+ if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e))
141
+ return V(new URL(e).pathname);
150
142
  } catch {
151
143
  }
152
- const s = (n.startsWith("/") ? n : `/${n}`).replace(/\/+/g, "/");
153
- return (s.length > 1 ? s.replace(/\/+$/g, "") : s) || "/";
144
+ const o = (e.startsWith("/") ? e : `/${e}`).replace(/\/+/g, "/");
145
+ return (o.length > 1 ? o.replace(/\/+$/g, "") : o) || "/";
154
146
  }
155
- function qt(t) {
156
- const n = t.trim();
157
- return n === "*" ? "*" : at(n);
147
+ function Yt(t) {
148
+ const e = t.trim();
149
+ return e === "*" ? "/**" : V(e);
158
150
  }
159
- function ot(t) {
151
+ function at(t) {
160
152
  return t === "/" ? [] : t.slice(1).split("/");
161
153
  }
162
- function Vt(t) {
154
+ function Zt(t) {
163
155
  return t.startsWith(":") || t.startsWith("[") && t.endsWith("]") || t.startsWith("{") && t.endsWith("}");
164
156
  }
165
- function rt(t, n) {
166
- const e = at(t), s = qt(n);
167
- if (s === "*")
168
- return { matched: !0, specificity: 0 };
169
- if (e === s)
157
+ function At(t, e) {
158
+ const n = V(t), o = Yt(e);
159
+ if (n === o)
170
160
  return {
171
161
  matched: !0,
172
- specificity: Xt + ot(s).length * vt
162
+ specificity: Gt + at(o).length * Et,
163
+ pattern: e
173
164
  };
174
- const o = ot(e), a = ot(s);
175
- let l = 0;
176
- for (let u = 0; u < a.length; u++) {
177
- const g = a[u], b = o[u], _ = u === a.length - 1;
178
- if (g === void 0)
179
- return { matched: !1, specificity: 0 };
180
- if ((g === "*" || g === "**") && _)
165
+ const s = at(n), i = at(o);
166
+ let a = 0;
167
+ for (let l = 0; l < i.length; l++) {
168
+ const f = i[l], u = s[l], y = l === i.length - 1;
169
+ if (f === "**")
181
170
  return {
182
- matched: g === "**" ? o.length >= u : o.length > u,
183
- specificity: l
171
+ matched: y && s.length >= l,
172
+ specificity: a,
173
+ pattern: e
184
174
  };
185
- if (b === void 0)
186
- return { matched: !1, specificity: 0 };
187
- if (g === "*" || Vt(g)) {
188
- l += $t;
175
+ if (u === void 0 || f === void 0)
176
+ return { matched: !1, specificity: 0, pattern: e };
177
+ if (f === "*") {
178
+ a += qt;
179
+ continue;
180
+ }
181
+ if (Zt(f)) {
182
+ a += Ut;
189
183
  continue;
190
184
  }
191
- if (g !== b)
192
- return { matched: !1, specificity: 0 };
193
- l += vt;
185
+ if (f !== u)
186
+ return { matched: !1, specificity: 0, pattern: e };
187
+ a += Et;
194
188
  }
195
189
  return {
196
- matched: o.length === a.length,
197
- specificity: l
190
+ matched: s.length === i.length,
191
+ specificity: a,
192
+ pattern: e
198
193
  };
199
194
  }
200
- function Gt(t, n) {
201
- return rt(t, n).matched;
202
- }
203
- function Yt(t, n, e) {
204
- let s;
205
- for (const o of e) {
206
- const a = rt(t, o.from);
207
- if (!a.matched) continue;
208
- const l = rt(n, o.to);
209
- if (!l.matched) continue;
210
- const u = a.specificity + l.specificity;
211
- (!s || u > s.specificity) && (s = { transition: o.transition, specificity: u });
195
+ function N(t, e) {
196
+ const n = typeof e == "string" ? [e] : e;
197
+ let o = null;
198
+ for (const s of n) {
199
+ const i = At(t, s);
200
+ i.matched && (!o || i.specificity > o.specificity) && (o = i);
212
201
  }
213
- return (s == null ? void 0 : s.transition) ?? null;
202
+ return o;
214
203
  }
215
- const Zt = 768, Qt = 10, jt = 10;
216
- function Jt(t = {}) {
204
+ function Qt(t, e) {
205
+ return At(t, e).matched;
206
+ }
207
+ const jt = 768, Jt = 10, te = 10;
208
+ function ee(t = {}) {
217
209
  const {
218
- preserveScroll: n = (f) => f,
219
- resolvePath: e = (f) => f
220
- } = t, s = typeof n == "function" ? n : () => n;
221
- let o = null, a = !1, l = !1;
222
- const u = () => {
223
- const f = (o == null ? void 0 : o.clientWidth) ?? 0, d = f > 0 ? f : typeof window < "u" ? window.innerWidth : 0;
224
- return d > 0 && d < Zt;
225
- }, g = () => (l || (a = u(), l = !0), a), b = (f) => {
226
- var A;
227
- const d = e(f), y = s(g());
228
- if (y === !1)
229
- return { preserves: !1, shared: !1, storageKey: `path:${d}` };
230
- if (y === !0)
231
- return { preserves: !0, shared: !1, storageKey: `path:${d}` };
232
- const E = ((A = y.exclude) == null ? void 0 : A.some((C) => Gt(d, C))) ?? !1, P = !E && !!y.key;
210
+ preserveScroll: e = (v) => v,
211
+ resolvePath: n = (v) => v
212
+ } = t, o = typeof e == "function" ? e : () => e;
213
+ let s = null, i = !1, a = !1;
214
+ const l = () => {
215
+ const v = (s == null ? void 0 : s.clientWidth) ?? 0, g = v > 0 ? v : typeof window < "u" ? window.innerWidth : 0;
216
+ return g > 0 && g < jt;
217
+ }, f = () => (a || (i = l(), a = !0), i), u = (v) => {
218
+ var _;
219
+ const g = n(v), b = o(f());
220
+ if (b === !1)
221
+ return { preserves: !1, shared: !1, storageKey: `path:${g}` };
222
+ if (b === !0)
223
+ return { preserves: !0, shared: !1, storageKey: `path:${g}` };
224
+ const P = ((_ = b.exclude) == null ? void 0 : _.some((D) => Qt(g, D))) ?? !1, C = !P && !!b.key;
233
225
  return {
234
- preserves: !E,
235
- shared: P,
236
- storageKey: P ? `shared:${y.key}` : `path:${d}`
226
+ preserves: !P,
227
+ shared: C,
228
+ storageKey: C ? `shared:${b.key}` : `path:${g}`
237
229
  };
238
- }, _ = (f) => b(f).preserves;
239
- let L = null;
240
- const w = /* @__PURE__ */ new Map();
241
- let O = null, k = !1, W = 0;
242
- const $ = () => {
243
- o && O && !k && w.set(b(O).storageKey, {
244
- x: o.scrollLeft,
245
- y: o.scrollTop
230
+ }, y = (v) => u(v).preserves;
231
+ let h = null;
232
+ const p = /* @__PURE__ */ new Map();
233
+ let S = null, R = !1, A = 0;
234
+ const L = () => {
235
+ s && S && !R && p.set(u(S).storageKey, {
236
+ x: s.scrollLeft,
237
+ y: s.scrollTop
246
238
  });
247
- }, z = (f) => {
248
- if (!o) return;
249
- const d = b(f);
250
- if (d.preserves && d.shared && !w.has(d.storageKey))
239
+ }, K = (v) => {
240
+ if (!s) return;
241
+ const g = u(v);
242
+ if (g.preserves && g.shared && !p.has(g.storageKey))
251
243
  return;
252
- const y = d.preserves && w.has(d.storageKey) ? w.get(d.storageKey) : { x: 0, y: 0 };
253
- let E = 0;
254
- const P = () => {
255
- if (!o) return;
256
- o.scrollTo({
257
- top: y.y,
258
- left: y.x
259
- }), !(Math.abs(o.scrollTop - y.y) < 1 && Math.abs(o.scrollLeft - y.x) < 1) && E < Qt && (E++, requestAnimationFrame(P));
244
+ const b = g.preserves && p.has(g.storageKey) ? p.get(g.storageKey) : { x: 0, y: 0 };
245
+ let P = 0;
246
+ const C = () => {
247
+ if (!s) return;
248
+ s.scrollTo({
249
+ top: b.y,
250
+ left: b.x
251
+ }), !(Math.abs(s.scrollTop - b.y) < 1 && Math.abs(s.scrollLeft - b.x) < 1) && P < Jt && (P++, requestAnimationFrame(C));
260
252
  };
261
- requestAnimationFrame(P);
253
+ requestAnimationFrame(C);
262
254
  };
263
255
  return {
264
- initializeContext: (f, d) => {
265
- k = !0;
266
- const y = ++W;
267
- L = f, o || (o = zt(f), a = u(), l = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
268
- a = u();
269
- }).observe(o), (o === document.documentElement ? window : o).addEventListener("scroll", $, {
256
+ initializeContext: (v, g) => {
257
+ R = !0;
258
+ const b = ++A;
259
+ h = v, s || (s = Kt(v), i = l(), a = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
260
+ i = l();
261
+ }).observe(s), (s === document.documentElement ? window : s).addEventListener("scroll", L, {
270
262
  passive: !0
271
- })), O = d, z(d);
272
- let E = 0;
273
- const P = () => {
274
- y === W && (E++, E >= jt ? k = !1 : requestAnimationFrame(P));
263
+ })), S = g, K(g);
264
+ let P = 0;
265
+ const C = () => {
266
+ b === A && (P++, P >= te ? R = !1 : requestAnimationFrame(C));
275
267
  };
276
- requestAnimationFrame(P);
268
+ requestAnimationFrame(C);
277
269
  },
278
- calculateScrollOffset: (f, d) => {
279
- const y = f ? b(f).storageKey : null, E = y && w.has(y) ? w.get(y) : { x: 0, y: 0 }, P = d ? b(d) : null, A = P != null && P.preserves ? P.storageKey : null, C = A && w.has(A) ? w.get(A) : { x: 0, y: 0 };
270
+ calculateScrollOffset: (v, g) => {
271
+ const b = v ? u(v).storageKey : null, P = b && p.has(b) ? p.get(b) : { x: 0, y: 0 }, C = g ? u(g) : null, _ = C != null && C.preserves ? C.storageKey : null, D = _ && p.has(_) ? p.get(_) : { x: 0, y: 0 };
280
272
  return {
281
- x: -C.x + E.x,
282
- y: -C.y + E.y
273
+ x: -D.x + P.x,
274
+ y: -D.y + P.y
283
275
  };
284
276
  },
285
- evictScrollPosition: (f) => {
286
- w.delete(b(f).storageKey);
277
+ evictScrollPosition: (v) => {
278
+ p.delete(u(v).storageKey);
287
279
  },
288
- shouldPreserve: _,
289
- getScrollContainer: () => o,
290
- getPositionedParentElement: () => L ? Bt(L) : document.body,
291
- getScrollPosition: (f) => {
292
- const d = f ? b(f).storageKey : null;
293
- return d && w.has(d) ? w.get(d) : { x: 0, y: 0 };
280
+ shouldPreserve: y,
281
+ getScrollContainer: () => s,
282
+ getPositionedParentElement: () => h ? Xt(h) : document.body,
283
+ getScrollPosition: (v) => {
284
+ const g = v ? u(v).storageKey : null;
285
+ return g && p.has(g) ? p.get(g) : { x: 0, y: 0 };
294
286
  },
295
287
  // Same measurement that drives `preserveScroll`'s `isMobile`, exposed so a
296
288
  // functional `transitions` config can branch on it too.
297
- getIsMobile: g
289
+ getIsMobile: f
298
290
  };
299
291
  }
300
- const bt = 30, St = 8, Et = 1.2, wt = 30, te = 600;
301
- function ee() {
302
- let t = null, n = !1, e = !1, s = null, o = null, a = !1;
303
- const l = (h, v) => {
304
- for (let S = 0; S < h.length; S++) {
305
- const m = h.item(S);
306
- if (m && m.identifier === v) return m;
292
+ const bt = 30, wt = 8, St = 1.2, Tt = 30, ne = 600;
293
+ function ie() {
294
+ let t = null, e = !1, n = !1, o = null, s = null, i = !1;
295
+ const a = (E, w) => {
296
+ for (let T = 0; T < E.length; T++) {
297
+ const k = E.item(T);
298
+ if (k && k.identifier === w) return k;
307
299
  }
308
300
  return null;
309
- }, u = () => {
310
- s !== null && (clearTimeout(s), s = null);
311
- }, g = () => {
301
+ }, l = () => {
312
302
  o !== null && (clearTimeout(o), o = null);
313
- }, b = () => {
314
- n = !0, e = !0, u(), g(), s = setTimeout(() => {
315
- n = !1, e = !1, s = null;
316
- }, te);
317
- }, _ = (h) => {
318
- if (h.touches.length !== 1) {
303
+ }, f = () => {
304
+ s !== null && (clearTimeout(s), s = null);
305
+ }, u = () => {
306
+ e = !0, n = !0, l(), f(), o = setTimeout(() => {
307
+ e = !1, n = !1, o = null;
308
+ }, ne);
309
+ }, y = (E) => {
310
+ if (E.touches.length !== 1) {
319
311
  t = null;
320
312
  return;
321
313
  }
322
- const v = h.touches.item(0);
323
- if (!v) {
314
+ const w = E.touches.item(0);
315
+ if (!w) {
324
316
  t = null;
325
317
  return;
326
318
  }
327
- const S = window.innerWidth, m = v.clientX <= bt, T = v.clientX >= S - bt;
328
- if (!m && !T) {
319
+ const T = window.innerWidth, k = w.clientX <= bt, W = w.clientX >= T - bt;
320
+ if (!k && !W) {
329
321
  t = null;
330
322
  return;
331
323
  }
332
324
  t = {
333
- identifier: v.identifier,
334
- startX: v.clientX,
335
- startY: v.clientY,
336
- fromLeftEdge: m,
325
+ identifier: w.identifier,
326
+ startX: w.clientX,
327
+ startY: w.clientY,
328
+ fromLeftEdge: k,
337
329
  moved: !1
338
330
  };
339
- }, L = (h) => {
331
+ }, h = (E) => {
340
332
  if (!t) return;
341
- if (h.touches.length !== 1) {
333
+ if (E.touches.length !== 1) {
342
334
  t = null;
343
335
  return;
344
336
  }
345
- const v = l(h.touches, t.identifier);
346
- if (!v) {
337
+ const w = a(E.touches, t.identifier);
338
+ if (!w) {
347
339
  t = null;
348
340
  return;
349
341
  }
350
- const S = v.clientX - t.startX, m = v.clientY - t.startY, T = Math.abs(S), I = Math.abs(m);
351
- if (I > St && I > T * Et) {
342
+ const T = w.clientX - t.startX, k = w.clientY - t.startY, W = Math.abs(T), F = Math.abs(k);
343
+ if (F > wt && F > W * St) {
352
344
  t = null;
353
345
  return;
354
346
  }
355
- const f = t.fromLeftEdge ? S > 0 : S < 0;
356
- T > St && T > I * Et && f && (t.moved = !0);
357
- }, w = (h) => {
347
+ const v = t.fromLeftEdge ? T > 0 : T < 0;
348
+ W > wt && W > F * St && v && (t.moved = !0);
349
+ }, p = (E) => {
358
350
  if (!t) return;
359
- const v = l(h.changedTouches, t.identifier);
360
- if (!v) {
351
+ const w = a(E.changedTouches, t.identifier);
352
+ if (!w) {
361
353
  t = null;
362
354
  return;
363
355
  }
364
- const S = v.clientX - t.startX, m = t.fromLeftEdge ? S > 0 : S < 0;
365
- if (t.moved && m && Math.abs(S) >= wt) {
366
- b(), t = null;
356
+ const T = w.clientX - t.startX, k = t.fromLeftEdge ? T > 0 : T < 0;
357
+ if (t.moved && k && Math.abs(T) >= Tt) {
358
+ u(), t = null;
367
359
  return;
368
360
  }
369
- t.moved && Math.abs(S) >= wt && b(), t = null;
370
- }, O = () => {
371
- t && (t.moved && b(), t = null);
361
+ t.moved && Math.abs(T) >= Tt && u(), t = null;
362
+ }, S = () => {
363
+ t && (t.moved && u(), t = null);
372
364
  };
373
365
  return { initialize: () => {
374
- if (typeof window > "u" || a) return;
375
- a = !0;
376
- const h = { passive: !0, capture: !0 };
377
- window.addEventListener("touchstart", _, h), window.addEventListener("touchmove", L, h), window.addEventListener("touchend", w, h), window.addEventListener("touchcancel", O, h);
366
+ if (typeof window > "u" || i) return;
367
+ i = !0;
368
+ const E = { passive: !0, capture: !0 };
369
+ window.addEventListener("touchstart", y, E), window.addEventListener("touchmove", h, E), window.addEventListener("touchend", p, E), window.addEventListener("touchcancel", S, E);
378
370
  }, destroy: () => {
379
- if (typeof window > "u" || !a) return;
380
- a = !1;
381
- const h = { capture: !0 };
382
- window.removeEventListener("touchstart", _, h), window.removeEventListener("touchmove", L, h), window.removeEventListener("touchend", w, h), window.removeEventListener("touchcancel", O, h), u(), g(), t = null, n = !1, e = !1;
371
+ if (typeof window > "u" || !i) return;
372
+ i = !1;
373
+ const E = { capture: !0 };
374
+ window.removeEventListener("touchstart", y, E), window.removeEventListener("touchmove", h, E), window.removeEventListener("touchend", p, E), window.removeEventListener("touchcancel", S, E), l(), f(), t = null, e = !1, n = !1;
383
375
  }, isSwipeBack: () => {
384
- const h = n || e;
385
- return h && u(), h;
376
+ const E = e || n;
377
+ return E && l(), E;
386
378
  }, onPageEnter: () => {
387
- n = !1, u(), g(), o = setTimeout(() => {
388
- e = !1, o = null;
379
+ e = !1, l(), f(), s = setTimeout(() => {
380
+ n = !1, s = null;
389
381
  }, 0);
390
382
  } };
391
383
  }
392
- function ne() {
393
- let t = null;
384
+ function se(t, e) {
385
+ return e ? t.priority !== e.priority ? t.priority > e.priority : t.specificity !== e.specificity ? t.specificity > e.specificity : t.ruleIndex < e.ruleIndex : !0;
386
+ }
387
+ function oe(t, e, n, o) {
388
+ let s = null;
389
+ return n.forEach((i, a) => {
390
+ const l = i.priority ?? 0;
391
+ let f = null;
392
+ if (i.on !== void 0) {
393
+ const u = i.except !== void 0 && N(t, i.except) !== null, y = i.except !== void 0 && N(e, i.except) !== null, h = u ? null : N(t, i.on), p = y ? null : N(e, i.on);
394
+ if (h || p) {
395
+ const S = !h && p ? "forward" : h && !p ? "backward" : o;
396
+ f = {
397
+ transition: i.transition,
398
+ direction: S,
399
+ ruleIndex: a,
400
+ priority: l,
401
+ specificity: Math.max(
402
+ (h == null ? void 0 : h.specificity) ?? 0,
403
+ (p == null ? void 0 : p.specificity) ?? 0
404
+ ),
405
+ reason: !h && p ? "on-enter" : h && !p ? "on-leave" : "on-history"
406
+ };
407
+ }
408
+ } else if (i.ordered !== void 0) {
409
+ let u = -1, y = -1, h = -1, p = -1;
410
+ i.ordered.forEach((S, R) => {
411
+ const A = N(t, S);
412
+ A && A.specificity > h && (u = R, h = A.specificity);
413
+ const L = N(e, S);
414
+ L && L.specificity > p && (y = R, p = L.specificity);
415
+ }), u >= 0 && y >= 0 && u !== y && (f = {
416
+ transition: i.transition,
417
+ direction: u < y ? "forward" : "backward",
418
+ ruleIndex: a,
419
+ priority: l,
420
+ specificity: h + p,
421
+ reason: "ordered"
422
+ });
423
+ } else {
424
+ const u = N(t, i.from), y = N(e, i.to), h = i.bidirectional === !1 ? null : N(t, i.to), p = i.bidirectional === !1 ? null : N(e, i.from), S = u && y, R = h && p;
425
+ if (S || R) {
426
+ const A = S ? u.specificity + y.specificity : -1, L = R ? h.specificity + p.specificity : -1, K = S && R && A === L ? o : A >= L ? "forward" : "backward";
427
+ f = {
428
+ transition: i.transition,
429
+ direction: K,
430
+ ruleIndex: a,
431
+ priority: l,
432
+ specificity: Math.max(A, L),
433
+ reason: "pair"
434
+ };
435
+ }
436
+ }
437
+ f && se(f, s) && (s = f);
438
+ }), s;
439
+ }
440
+ function re() {
441
+ const t = [];
442
+ let e = !1;
443
+ const n = () => {
444
+ e = !0;
445
+ };
446
+ return typeof window < "u" && window.addEventListener("popstate", n), {
447
+ resolve(o, s) {
448
+ const i = V(o), a = V(s);
449
+ if (t.length === 0)
450
+ t.push(i);
451
+ else if (t[t.length - 1] !== i) {
452
+ const u = t.lastIndexOf(i);
453
+ u >= 0 ? t.splice(u + 1) : t.push(i);
454
+ }
455
+ const l = t[t.length - 2], f = e || l === a ? "backward" : "forward";
456
+ if (e = !1, f === "backward") {
457
+ const u = t.lastIndexOf(a);
458
+ u >= 0 ? t.splice(u + 1) : t.push(a);
459
+ } else t[t.length - 1] !== a && t.push(a);
460
+ return f;
461
+ },
462
+ dispose() {
463
+ typeof window < "u" && window.removeEventListener("popstate", n);
464
+ }
465
+ };
466
+ }
467
+ function ce(t = {}) {
468
+ let e = null;
394
469
  function n() {
395
- var s, o;
396
- t && ((s = t.outResolve) == null || s.call(t, null), (o = t.inResolve) == null || o.call(t, null), t = null);
470
+ var s, i;
471
+ e && ((s = e.out) == null || s.resolve(null), (i = e.in) == null || i.resolve(null), e = null);
397
472
  }
398
- function e() {
399
- if (t != null && t.from && (t != null && t.to) && (t != null && t.outResolve) && (t != null && t.inResolve)) {
400
- if (t.from === t.to) {
473
+ function o() {
474
+ if (e != null && e.out && e.in) {
475
+ if (e.out.path === e.in.path) {
401
476
  n();
402
477
  return;
403
478
  }
404
- const s = { from: t.from, to: t.to };
405
- t.outResolve(s), t.inResolve(s), t = null;
479
+ const s = {
480
+ from: e.out.path,
481
+ to: e.in.path,
482
+ out: e.out.payload,
483
+ in: e.in.payload
484
+ };
485
+ e.out.resolve(s), e.in.resolve(s), e = null;
406
486
  }
407
487
  }
408
488
  return {
409
- trigger(s, o) {
410
- var l;
411
- o === "out" && (t == null ? void 0 : t.to) === s && !t.from && ((l = t.inResolve) == null || l.call(t, null), t = {}), t && (o === "out" && t.from && t.from !== s || o === "in" && t.to && t.to !== s) && n(), t || (t = {}), o === "out" ? t.from = s : t.to = s;
412
- },
413
- get(s) {
414
- return new Promise((o) => {
415
- t || (t = {}), s === "out" ? t.outResolve = o : t.inResolve = o, e();
489
+ arrive(s, i, a) {
490
+ return new Promise((l) => {
491
+ var y, h;
492
+ i === "out" && ((y = e == null ? void 0 : e.in) == null ? void 0 : y.path) === s && !e.out && (e.in.resolve(null), e.in = void 0);
493
+ const f = e == null ? void 0 : e[i];
494
+ f && f.path !== s && n(), e || (e = {});
495
+ const u = e[i];
496
+ if (u) {
497
+ if (((h = t.keepCurrent) == null ? void 0 : h.call(t, {
498
+ type: i,
499
+ path: s,
500
+ current: u.payload,
501
+ next: a
502
+ })) ?? !1) {
503
+ l(null);
504
+ return;
505
+ }
506
+ u.resolve(null);
507
+ }
508
+ e[i] = { path: s, payload: a, resolve: l }, o();
416
509
  });
510
+ },
511
+ cancel(s) {
512
+ (e != null && e.out && s(e.out.payload) || e != null && e.in && s(e.in.payload)) && n();
417
513
  }
418
514
  };
419
515
  }
420
- const X = /* @__PURE__ */ new Map();
421
- let Y = null, Tt = !1;
422
- function Mt(t, n) {
423
- if (t instanceof HTMLElement && X.has(t) && !t.isConnected) {
424
- const e = X.get(t);
425
- X.delete(t), queueMicrotask(() => e(n));
516
+ const le = {}, $ = /* @__PURE__ */ new Map();
517
+ let J = null, Pt = !1;
518
+ function kt(t, e, n) {
519
+ t instanceof HTMLElement && $.has(t) && !t.isConnected && n.set(t, { entry: $.get(t), anchor: e });
520
+ for (const o of Array.from(t.childNodes))
521
+ kt(o, e, n);
522
+ }
523
+ function ae(t) {
524
+ const e = new Set(
525
+ Array.from(t.values(), ({ entry: n }) => n)
526
+ );
527
+ for (const [n, { entry: o, anchor: s }] of t) {
528
+ $.delete(n);
529
+ let i = o.parent, a = !1;
530
+ for (; i; ) {
531
+ if (i.group === o.group && e.has(i)) {
532
+ a = !0;
533
+ break;
534
+ }
535
+ i = i.parent;
536
+ }
537
+ queueMicrotask(() => o.callback(s, { emit: !a }));
426
538
  }
427
- for (const e of Array.from(t.childNodes))
428
- Mt(e, n);
429
539
  }
430
- function se() {
431
- if (Tt || typeof document > "u") return;
432
- Tt = !0, Y = new MutationObserver((n) => {
433
- for (const e of n) {
540
+ function ue() {
541
+ if (Pt || typeof document > "u") return;
542
+ Pt = !0, J = new MutationObserver((e) => {
543
+ const n = /* @__PURE__ */ new Map();
544
+ for (const o of e) {
434
545
  const s = {
435
- parent: e.target,
436
- nextSibling: e.nextSibling
546
+ parent: o.target,
547
+ nextSibling: o.nextSibling
437
548
  };
438
- for (const o of Array.from(e.removedNodes))
439
- Mt(o, s);
549
+ for (const i of Array.from(o.removedNodes))
550
+ kt(i, s, n);
440
551
  }
552
+ ae(n);
441
553
  });
442
554
  const t = () => {
443
- Y == null || Y.observe(document.body, { childList: !0, subtree: !0 });
555
+ J == null || J.observe(document.body, { childList: !0, subtree: !0 });
444
556
  };
445
557
  document.body ? t() : document.addEventListener("DOMContentLoaded", t, { once: !0 });
446
558
  }
447
- function ie(t, n) {
448
- return se(), X.set(t, n), () => {
449
- X.delete(t);
559
+ function de(t, e, n = le) {
560
+ ue();
561
+ let o = t.parentElement, s = null;
562
+ for (; o; ) {
563
+ const i = $.get(o);
564
+ if ((i == null ? void 0 : i.group) === n) {
565
+ s = i;
566
+ break;
567
+ }
568
+ o = o.parentElement;
569
+ }
570
+ return $.set(t, {
571
+ element: t,
572
+ callback: e,
573
+ group: n,
574
+ parent: s
575
+ }), () => {
576
+ $.delete(t);
450
577
  };
451
578
  }
452
- const ct = /* @__PURE__ */ new WeakMap();
453
- let Z = null;
454
- const Q = "none !important";
455
- function K(t) {
456
- const n = t.style.getPropertyValue("display");
457
- return t.style.getPropertyPriority("display") ? `${n} !important` : n;
579
+ const ut = /* @__PURE__ */ new WeakMap();
580
+ let tt = null;
581
+ const et = "none !important";
582
+ function q(t) {
583
+ const e = t.style.getPropertyValue("display");
584
+ return t.style.getPropertyPriority("display") ? `${e} !important` : e;
458
585
  }
459
- function oe() {
460
- return Z || (Z = new MutationObserver((t) => {
461
- for (const n of t) {
462
- const e = n.target, s = ct.get(e);
463
- if (!s) continue;
464
- const o = K(e);
465
- o !== s.accounted && (s.accounted = o, o === Q ? (s.reactHidden = !0, s.onHide()) : o !== "none" && s.reactHidden && (s.reactHidden = !1, s.onShow()));
586
+ function fe() {
587
+ return tt || (tt = new MutationObserver((t) => {
588
+ for (const e of t) {
589
+ const n = e.target, o = ut.get(n);
590
+ if (!o) continue;
591
+ const s = q(n);
592
+ s !== o.accounted && (o.accounted = s, s === et ? (o.reactHidden = !0, o.onHide()) : s !== "none" && o.reactHidden && (o.reactHidden = !1, o.onShow()));
466
593
  }
467
- }), Z);
594
+ }), tt);
468
595
  }
469
- function re(t, n) {
470
- const e = K(t), s = {
471
- accounted: e,
472
- reactHidden: e === Q,
473
- onHide: n.onHide,
474
- onShow: n.onShow
596
+ function he(t, e) {
597
+ const n = q(t), o = {
598
+ accounted: n,
599
+ reactHidden: n === et,
600
+ onHide: e.onHide,
601
+ onShow: e.onShow
475
602
  };
476
- return ct.set(t, s), oe().observe(t, {
603
+ return ut.set(t, o), fe().observe(t, {
477
604
  attributes: !0,
478
605
  attributeFilter: ["style"]
479
606
  }), {
480
607
  get isHidden() {
481
- return K(t) === Q;
608
+ return q(t) === et;
482
609
  },
483
- setDisplay(o, a = !1) {
484
- o === null ? t.style.removeProperty("display") : t.style.setProperty(
610
+ setDisplay(s, i = !1) {
611
+ s === null ? t.style.removeProperty("display") : t.style.setProperty(
485
612
  "display",
486
- o,
487
- a ? "important" : ""
488
- ), s.accounted = K(t);
613
+ s,
614
+ i ? "important" : ""
615
+ ), o.accounted = q(t);
489
616
  },
490
617
  sync() {
491
- s.accounted = K(t), s.reactHidden = s.accounted === Q;
618
+ o.accounted = q(t), o.reactHidden = o.accounted === et;
492
619
  },
493
620
  stop() {
494
- ct.delete(t);
621
+ ut.delete(t);
495
622
  }
496
623
  };
497
624
  }
498
- function ce(t) {
499
- return Array.isArray(t);
500
- }
501
- function Rt(t) {
502
- const n = [];
503
- for (const e of t)
504
- ce(e) ? n.push(...Rt(e)) : n.push(e);
505
- return n;
506
- }
507
- function ge(t, n = {}) {
625
+ function Te(t, e = {}) {
508
626
  const {
509
- transitions: e = [],
510
- middleware: s = (i, r) => ({ from: i, to: r }),
511
- preserveScroll: o = (i) => i
512
- } = t, a = n.host ?? new Ht(), l = ne(), u = typeof e == "function" ? e : () => e, g = ee();
513
- g.initialize();
514
- const b = /* @__PURE__ */ new Map(), _ = (i) => {
515
- let r = b.get(i);
516
- return r === void 0 && (r = s(i, i).from, b.set(i, r)), r;
627
+ transitions: n = [],
628
+ middleware: o = (r, c) => ({ from: r, to: c }),
629
+ preserveScroll: s = (r) => r
630
+ } = t, i = e.host ?? new Ft(), a = {}, l = ce({
631
+ // Nested boundaries can be discovered in separate MutationObserver
632
+ // batches (notably when Suspense reveals a child later). When the same
633
+ // side/path repeats before pairing, the outermost DOM boundary owns it.
634
+ keepCurrent: ({ current: r, next: c }) => r.element.contains(c.element)
635
+ }), f = re(), u = typeof n == "function" ? n : () => n, y = ie();
636
+ y.initialize();
637
+ const h = /* @__PURE__ */ new Map(), p = (r) => {
638
+ let c = h.get(r);
639
+ return c === void 0 && (c = o(r, r).from, h.set(r, c)), c;
517
640
  }, {
518
- initializeContext: L,
519
- calculateScrollOffset: w,
520
- evictScrollPosition: O,
521
- shouldPreserve: k,
522
- getScrollContainer: W,
523
- getPositionedParentElement: $,
524
- getScrollPosition: z,
525
- getIsMobile: h
526
- } = Jt({ preserveScroll: o, resolvePath: _ }), v = /* @__PURE__ */ new Map(), S = () => {
527
- const i = h();
528
- let r = v.get(i);
529
- return r || (r = Kt(
530
- Rt(u({ isMobile: i }))
531
- ), v.set(i, r)), r;
532
- };
533
- let m = null, T = null;
534
- const I = /* @__PURE__ */ new WeakMap(), f = (i) => {
535
- I.set(i, {
536
- parent: i.parentNode,
537
- nextSibling: i.nextSibling
641
+ initializeContext: S,
642
+ calculateScrollOffset: R,
643
+ evictScrollPosition: A,
644
+ shouldPreserve: L,
645
+ getScrollContainer: K,
646
+ getPositionedParentElement: E,
647
+ getScrollPosition: w,
648
+ getIsMobile: T
649
+ } = ee({ preserveScroll: s, resolvePath: p }), k = /* @__PURE__ */ new Map(), W = () => {
650
+ const r = T();
651
+ let c = k.get(r);
652
+ return c || (c = u({ isMobile: r }), k.set(r, c)), c;
653
+ }, F = /* @__PURE__ */ new WeakMap(), v = (r) => {
654
+ F.set(r, {
655
+ parent: r.parentNode,
656
+ nextSibling: r.nextSibling
538
657
  });
539
- }, d = (i) => {
540
- const r = I.get(i);
541
- return r || {
542
- parent: i.parentNode,
543
- nextSibling: i.nextSibling
658
+ }, g = (r) => {
659
+ const c = F.get(r);
660
+ return c || {
661
+ parent: r.parentNode,
662
+ nextSibling: r.nextSibling
544
663
  };
545
- }, y = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap();
546
- let P = 0;
547
- const A = (i) => {
548
- const r = typeof getComputedStyle < "u" ? getComputedStyle(i).display : "";
549
- return r && r !== "none" ? r : "block";
550
- }, C = (i, r) => {
551
- r.visibleDisplay = i.style.getPropertyValue("display"), r.computedDisplay = A(i);
552
- }, ut = (i, r) => {
553
- if (E.get(i) !== r) return;
554
- E.delete(i);
555
- const c = y.get(i);
556
- c && (c.savedCss !== null && (i.style.cssText = c.savedCss, c.savedCss = null), c.intent === "hidden" ? c.vis.setDisplay("none", !0) : c.visibleDisplay ? (c.vis.setDisplay(c.visibleDisplay, !1), C(i, c)) : (c.vis.setDisplay(null), C(i, c)));
557
- }, Ct = (i, r, c, p, M) => {
558
- const R = p.element, D = M.element, N = (p.mode ?? "unmount") === "hidden", { parent: q, nextSibling: J } = p.parent ? { parent: p.parent, nextSibling: p.nextSibling } : d(R), V = w(r, c), tt = {
559
- scrollOffset: V,
560
- from: { scroll: z(r) },
561
- to: { scroll: z(c) },
664
+ }, b = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap();
665
+ let C = 0;
666
+ const _ = (r) => {
667
+ const c = typeof getComputedStyle < "u" ? getComputedStyle(r).display : "";
668
+ return c && c !== "none" ? c : "block";
669
+ }, D = (r, c) => {
670
+ c.visibleDisplay = r.style.getPropertyValue("display"), c.computedDisplay = _(r);
671
+ }, dt = (r, c) => {
672
+ if (P.get(r) !== c) return;
673
+ P.delete(r);
674
+ const d = b.get(r);
675
+ d && (d.savedCss !== null && (r.style.cssText = d.savedCss, d.savedCss = null), d.intent === "hidden" ? d.vis.setDisplay("none", !0) : d.visibleDisplay ? (d.vis.setDisplay(d.visibleDisplay, !1), D(r, d)) : (d.vis.setDisplay(null), D(r, d)));
676
+ }, Lt = (r, c, d, M, m, O) => {
677
+ const x = m.element, H = O.element, B = (m.mode ?? "unmount") === "hidden", { parent: Z, nextSibling: it } = m.parent ? { parent: m.parent, nextSibling: m.nextSibling } : g(x), Q = R(d, M), st = {
678
+ direction: c,
679
+ scrollOffset: Q,
680
+ from: { scroll: w(d) },
681
+ to: { scroll: w(M) },
562
682
  get scrollingElement() {
563
- return W() || document.documentElement;
683
+ return K() || document.documentElement;
564
684
  },
565
685
  get positionedParent() {
566
- return $();
686
+ return E();
567
687
  }
568
688
  };
569
- let x;
570
- if (N) {
571
- x = R, x.style.top = `${-1 * ((V == null ? void 0 : V.y) ?? 0)}px`;
572
- const H = y.get(D);
573
- H && H.savedCss === null && (H.savedCss = D.style.cssText);
689
+ let I;
690
+ if (B) {
691
+ I = x, I.style.top = `${-1 * ((Q == null ? void 0 : Q.y) ?? 0)}px`;
692
+ const z = b.get(H);
693
+ z && z.savedCss === null && (z.savedCss = H.style.cssText);
574
694
  } else
575
- x = R, Wt(x, tt);
576
- k(r) || O(r);
577
- const G = N ? ++P : 0;
578
- N && (E.set(D, G), E.set(R, G));
579
- const pt = Promise.resolve(x), yt = Promise.resolve(D), mt = [], _t = {
580
- from: pt,
581
- to: yt,
582
- context: tt,
583
- createElement: ((H, et = "div") => {
584
- const B = document.createElement(et);
585
- return B.setAttribute("data-ssgoi-id", H), mt.push(B), B;
695
+ I = x, zt(I, st);
696
+ L(d) || A(d);
697
+ const j = B ? ++C : 0;
698
+ B && (P.set(H, j), P.set(x, j));
699
+ const yt = Promise.resolve(I), mt = Promise.resolve(H), gt = [], It = {
700
+ from: yt,
701
+ to: mt,
702
+ context: st,
703
+ createElement: ((z, ot = "div") => {
704
+ const G = document.createElement(ot);
705
+ return G.setAttribute("data-ssgoi-id", z), gt.push(G), G;
586
706
  })
587
- }, Dt = Promise.resolve(
588
- i.prepare ? i.prepare(_t) : {}
707
+ }, Nt = Promise.resolve(
708
+ r.prepare ? r.prepare(It) : {}
589
709
  );
590
- Ft({
591
- from: pt,
592
- to: yt,
593
- extras: Dt
594
- }).then(({ from: H, to: et, extras: B }) => {
595
- !N && q && (J && q.contains(J) ? q.insertBefore(x, J) : q.appendChild(x));
596
- const nt = i.animation({
597
- from: H,
598
- to: et,
599
- context: tt,
600
- ...B
601
- }), st = nt.onComplete;
602
- nt.onComplete = () => {
603
- st == null || st(), N ? (ut(R, G), ut(D, G)) : x.parentNode && x.parentNode.removeChild(x);
604
- for (const it of mt)
605
- it.parentNode && it.parentNode.removeChild(it);
606
- }, a.attach(nt);
710
+ $t({
711
+ from: yt,
712
+ to: mt,
713
+ extras: Nt
714
+ }).then(({ from: z, to: ot, extras: G }) => {
715
+ !B && Z && (it && Z.contains(it) ? Z.insertBefore(I, it) : Z.appendChild(I));
716
+ const rt = r.animation({
717
+ from: z,
718
+ to: ot,
719
+ context: st,
720
+ ...G
721
+ }), ct = rt.onComplete;
722
+ rt.onComplete = () => {
723
+ ct == null || ct(), B ? (dt(x, j), dt(H, j)) : I.parentNode && I.parentNode.removeChild(I);
724
+ for (const lt of gt)
725
+ lt.parentNode && lt.parentNode.removeChild(lt);
726
+ }, i.attach(rt);
607
727
  });
608
- }, U = (i, r) => {
609
- const c = g.isSwipeBack();
610
- l.trigger(i, r), l.get(r).then((p) => {
611
- if (r === "in" && g.onPageEnter(), !p) return;
612
- if (c) {
613
- r === "out" && p.from && !k(p.from) && O(p.from), m = null, T = null;
728
+ }, Y = (r, c, d) => {
729
+ const M = y.isSwipeBack();
730
+ l.arrive(r, c, d).then((m) => {
731
+ if (c === "in" && y.onPageEnter(), !m) return;
732
+ if (M && c === "in") {
733
+ const B = o(m.from, m.to);
734
+ f.resolve(B.from, B.to);
735
+ }
736
+ if (M) {
737
+ c === "out" && m.from && !L(m.from) && A(m.from);
614
738
  return;
615
739
  }
616
- if (r !== "in") return;
617
- const { from: M, to: R } = s(
618
- p.from,
619
- p.to
620
- ), D = Yt(
621
- M,
622
- R,
623
- S()
624
- ), j = m, N = T;
625
- m = null, T = null, !(!D || !j || !N) && Ct(D, p.from, p.to, j, N);
740
+ if (c !== "in") return;
741
+ const { from: O, to: x } = o(
742
+ m.from,
743
+ m.to
744
+ ), H = f.resolve(
745
+ O,
746
+ x
747
+ ), X = oe(
748
+ O,
749
+ x,
750
+ W(),
751
+ H
752
+ );
753
+ X && Lt(
754
+ X.transition,
755
+ X.direction,
756
+ m.from,
757
+ m.to,
758
+ m.out,
759
+ m.in
760
+ );
626
761
  });
627
- }, xt = (i, r) => {
628
- const c = y.get(i);
629
- if (!c) return;
630
- const p = c.intent === "hidden";
631
- if (c.intent = "hidden", c.savedCss === null && (c.savedCss = i.style.cssText), c.vis.setDisplay(c.computedDisplay || "block", !0), i.style.position = "absolute", i.style.width = "100%", i.style.left = "0", p) return;
632
- const M = d(i);
633
- m = {
634
- element: i,
635
- parent: M.parent,
636
- nextSibling: M.nextSibling,
762
+ }, Ot = (r, c) => {
763
+ const d = b.get(r);
764
+ if (!d) return;
765
+ const M = d.intent === "hidden";
766
+ if (d.intent = "hidden", d.savedCss === null && (d.savedCss = r.style.cssText), d.vis.setDisplay(d.computedDisplay || "block", !0), r.style.position = "absolute", r.style.width = "100%", r.style.left = "0", M) return;
767
+ const m = g(r), O = {
768
+ element: r,
769
+ parent: m.parent,
770
+ nextSibling: m.nextSibling,
637
771
  mode: "hidden"
638
- };
639
- const R = i.getAttribute("data-ssgoi-transition") ?? r;
640
- U(R, "out");
641
- }, Lt = (i, r) => {
642
- const c = y.get(i);
643
- if (!c || c.intent === "visible") return;
644
- c.intent = "visible", C(i, c), c.savedCss !== null && (i.style.cssText = c.savedCss, c.visibleDisplay ? c.vis.setDisplay(c.visibleDisplay, !1) : c.vis.setDisplay(null)), L(i, r), T = {
645
- element: i,
646
- parent: i.parentElement,
647
- nextSibling: i.nextElementSibling
648
- };
649
- const p = i.getAttribute("data-ssgoi-transition") ?? r;
650
- U(p, "in");
651
- }, Ot = (i, r, c) => {
652
- const p = y.get(i);
653
- if (p && (p.vis.stop(), y.delete(i), E.delete(i), p.intent === "hidden")) {
654
- (m == null ? void 0 : m.element) === i && (m = null), (T == null ? void 0 : T.element) === i && (T = null);
772
+ }, x = r.getAttribute("data-ssgoi-transition") ?? c;
773
+ Y(x, "out", O);
774
+ }, _t = (r, c) => {
775
+ const d = b.get(r);
776
+ if (!d || d.intent === "visible") return;
777
+ d.intent = "visible", D(r, d), d.savedCss !== null && (r.style.cssText = d.savedCss, d.visibleDisplay ? d.vis.setDisplay(d.visibleDisplay, !1) : d.vis.setDisplay(null)), S(r, c);
778
+ const M = {
779
+ element: r,
780
+ parent: r.parentElement,
781
+ nextSibling: r.nextElementSibling
782
+ }, m = r.getAttribute("data-ssgoi-transition") ?? c;
783
+ Y(m, "in", M);
784
+ }, Dt = (r, c, d, M = !0) => {
785
+ const m = b.get(r);
786
+ if (m && (m.vis.stop(), b.delete(r), P.delete(r), m.intent === "hidden")) {
787
+ l.cancel((X) => X.element === r);
655
788
  return;
656
789
  }
657
- const M = c ?? d(i);
658
- m = {
659
- element: i,
660
- parent: M.parent,
661
- nextSibling: M.nextSibling,
790
+ if (!M) return;
791
+ const O = d ?? g(r), x = {
792
+ element: r,
793
+ parent: O.parent,
794
+ nextSibling: O.nextSibling,
662
795
  mode: "unmount"
663
- };
664
- const R = i.getAttribute("data-ssgoi-transition") ?? r;
665
- U(R, "out");
666
- }, dt = /* @__PURE__ */ new WeakSet(), ft = (i, r) => {
667
- if (dt.has(r)) return;
668
- dt.add(r), f(r);
669
- const c = re(r, {
670
- onHide: () => xt(r, i),
671
- onShow: () => Lt(r, i)
672
- }), p = {
673
- vis: c,
796
+ }, H = r.getAttribute("data-ssgoi-transition") ?? c;
797
+ Y(H, "out", x);
798
+ }, ft = /* @__PURE__ */ new WeakSet(), ht = (r, c, { enter: d = !0 } = {}) => {
799
+ if (ft.has(c)) return;
800
+ ft.add(c), v(c);
801
+ const M = he(c, {
802
+ onHide: () => Ot(c, r),
803
+ onShow: () => _t(c, r)
804
+ }), m = {
805
+ vis: M,
674
806
  savedCss: null,
675
- intent: c.isHidden ? "hidden" : "visible",
807
+ intent: M.isHidden ? "hidden" : "visible",
676
808
  visibleDisplay: "",
677
809
  computedDisplay: "block"
678
810
  };
679
- y.set(r, p), c.isHidden || (C(r, p), L(r, i), T = {
680
- element: r,
681
- parent: r.parentElement,
682
- nextSibling: r.nextElementSibling
683
- }, U(i, "in")), ie(r, (M) => Ot(r, i, M));
684
- }, ht = /* @__PURE__ */ new Map();
685
- return { register: ft, refFor: (i) => {
686
- let r = ht.get(i);
687
- return r || (r = (c) => {
688
- c && ft(i, c);
689
- }, ht.set(i, r)), r;
811
+ if (b.set(c, m), !M.isHidden && (D(c, m), d)) {
812
+ S(c, r);
813
+ const O = {
814
+ element: c,
815
+ parent: c.parentElement,
816
+ nextSibling: c.nextElementSibling
817
+ };
818
+ Y(r, "in", O);
819
+ }
820
+ de(
821
+ c,
822
+ (O, x) => Dt(c, r, O, (x == null ? void 0 : x.emit) ?? !0),
823
+ a
824
+ );
825
+ }, pt = /* @__PURE__ */ new Map();
826
+ return { register: ht, refFor: (r) => {
827
+ let c = pt.get(r);
828
+ return c || (c = (d) => {
829
+ d && ht(r, d);
830
+ }, pt.set(r, c)), c;
690
831
  } };
691
832
  }
692
- const At = "data-ssgoi-root", le = `[${At}]`, lt = "data-ssgoi-transition", Pt = `[${lt}]`, ae = "[data-ssgoi-clone]";
693
- function ue() {
833
+ const Rt = "data-ssgoi-root", pe = `[${Rt}]`, nt = "data-ssgoi-transition", xt = `[${nt}]`, ye = "[data-ssgoi-clone]";
834
+ function me() {
694
835
  return typeof MutationObserver < "u" && typeof HTMLElement < "u" && typeof Node < "u";
695
836
  }
696
- function de(t) {
837
+ function ge(t) {
697
838
  return t.nodeType === Node.ELEMENT_NODE;
698
839
  }
699
- function fe(t) {
840
+ function ve(t) {
700
841
  return t instanceof HTMLElement;
701
842
  }
702
- function ve(t, n) {
703
- if (!ue()) return () => {
843
+ function Ct(t) {
844
+ let e = 0, n = t.parentElement;
845
+ for (; n; )
846
+ e++, n = n.parentElement;
847
+ return e;
848
+ }
849
+ function Mt(t, e, n = t) {
850
+ const o = Array.from(t).sort(
851
+ (s, i) => Ct(s) - Ct(i)
852
+ );
853
+ for (const s of o) {
854
+ const i = s.getAttribute(nt);
855
+ if (i === null) continue;
856
+ let a = s.parentElement, l = !1;
857
+ for (; a; ) {
858
+ if (n.has(a)) {
859
+ l = !0;
860
+ break;
861
+ }
862
+ a = a.parentElement;
863
+ }
864
+ e.register(i, s, { enter: !l });
865
+ }
866
+ }
867
+ function Pe(t, e) {
868
+ if (!me()) return () => {
704
869
  };
705
- t.setAttribute(At, "");
706
- const e = (l) => l.closest(le) === t, s = (l) => {
707
- if (!fe(l) || !e(l) || l.closest(ae))
708
- return;
709
- const u = l.getAttribute(lt);
710
- u !== null && n.register(u, l);
711
- }, o = (l) => {
712
- if (de(l)) {
713
- l.matches(Pt) && s(l);
714
- for (const u of l.querySelectorAll(Pt))
715
- s(u);
870
+ t.setAttribute(Rt, "");
871
+ const n = (l) => l.closest(pe) === t, o = (l) => !ve(l) || !n(l) || l.closest(ye) || l.getAttribute(nt) === null ? null : l, s = (l, f) => {
872
+ if (ge(l)) {
873
+ if (l.matches(xt)) {
874
+ const u = o(l);
875
+ u && f.add(u);
876
+ }
877
+ for (const u of l.querySelectorAll(xt)) {
878
+ const y = o(u);
879
+ y && f.add(y);
880
+ }
716
881
  }
717
- }, a = new MutationObserver((l) => {
718
- for (const u of l) {
719
- if (u.type === "attributes") {
720
- s(u.target);
882
+ }, i = new MutationObserver((l) => {
883
+ const f = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
884
+ for (const y of l) {
885
+ if (y.type === "attributes") {
886
+ const h = o(y.target);
887
+ h && f.add(h);
721
888
  continue;
722
889
  }
723
- for (const g of u.addedNodes)
724
- o(g);
890
+ for (const h of y.addedNodes)
891
+ s(h, u);
725
892
  }
893
+ for (const y of u) f.add(y);
894
+ Mt(f, e, u);
726
895
  });
727
- return a.observe(t, {
896
+ i.observe(t, {
728
897
  childList: !0,
729
898
  subtree: !0,
730
899
  attributes: !0,
731
- attributeFilter: [lt]
732
- }), o(t), () => a.disconnect();
900
+ attributeFilter: [nt]
901
+ });
902
+ const a = /* @__PURE__ */ new Set();
903
+ return s(t, a), Mt(a, e), () => i.disconnect();
733
904
  }
734
905
  export {
735
- It as Animation,
736
- Ht as HostAnimation,
737
- Ee as MultiAnimation,
738
- we as WebAnimation,
739
- ge as createSggoiTransitionContext,
740
- ve as observeSsgoiTransitions
906
+ Bt as Animation,
907
+ Ft as HostAnimation,
908
+ Me as MultiAnimation,
909
+ Ae as WebAnimation,
910
+ Te as createSggoiTransitionContext,
911
+ Pe as observeSsgoiTransitions
741
912
  };