@ssgoi/core 7.0.4 → 7.1.0-beta.0

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