@ssgoi/core 7.1.3-beta.3 → 7.1.3-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/internal.js CHANGED
@@ -1,23 +1,23 @@
1
- var We = Object.defineProperty;
2
- var Be = (n, t, e) => t in n ? We(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var Y = (n, t, e) => Be(n, typeof t != "symbol" ? t + "" : t, e);
4
- import { n as be, r as Fe } from "./resolve-transition-rule-DbkMu0rm.js";
5
- import { A as ze } from "./multi-animation-Du9W3ZS_.js";
6
- import { M as Tt, W as kt } from "./multi-animation-Du9W3ZS_.js";
7
- import { s as Rt } from "./provider-Cea0Pfm1.js";
8
- class Xe extends ze {
1
+ var Ze = Object.defineProperty;
2
+ var Je = (t, n, e) => n in t ? Ze(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
+ var J = (t, n, e) => Je(t, typeof n != "symbol" ? n + "" : n, e);
4
+ import { n as Ae, r as Qe } from "./resolve-transition-rule-DbkMu0rm.js";
5
+ import { A as et } from "./multi-animation-Du9W3ZS_.js";
6
+ import { M as Bt, W as Ft } from "./multi-animation-Du9W3ZS_.js";
7
+ import { s as Kt } from "./provider-Cea0Pfm1.js";
8
+ class tt extends et {
9
9
  constructor() {
10
10
  super(...arguments);
11
- Y(this, "child", null);
12
- Y(this, "_state", "idle");
13
- Y(this, "_settled", !1);
14
- Y(this, "listeners", /* @__PURE__ */ new Set());
11
+ J(this, "child", null);
12
+ J(this, "_state", "idle");
13
+ J(this, "_settled", !1);
14
+ J(this, "listeners", /* @__PURE__ */ new Set());
15
15
  }
16
16
  attach(e) {
17
17
  const o = this.child;
18
18
  if (this.child = e, this._settled = !1, o) {
19
- const p = o.getPose();
20
- o.complete(), e.matchInto(p);
19
+ const u = o.getPose();
20
+ o.complete(), e.matchInto(u);
21
21
  }
22
22
  e.playbackRate = this.playbackRate;
23
23
  const c = e.onComplete;
@@ -25,9 +25,9 @@ class Xe extends ze {
25
25
  c == null || c(), this.child === e && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
26
26
  };
27
27
  const s = e.onUpdate;
28
- e.onUpdate = (p) => {
28
+ e.onUpdate = (u) => {
29
29
  var i;
30
- s == null || s(p), (i = this.onUpdate) == null || i.call(this, p), this.notify();
30
+ s == null || s(u), (i = this.onUpdate) == null || i.call(this, u), this.notify();
31
31
  }, this._state === "paused" ? e.pause() : this._state === "reversing" ? e.reverse() : (this._state = "playing", e.play()), this.notify();
32
32
  }
33
33
  play() {
@@ -100,831 +100,957 @@ class Xe extends ze {
100
100
  for (const e of this.listeners) e();
101
101
  }
102
102
  }
103
- const $e = (n, t) => {
103
+ const nt = (t, n) => {
104
104
  var e;
105
- n.style.position = "absolute", n.style.width = "100%", n.style.top = `${-1 * (((e = t == null ? void 0 : t.scrollOffset) == null ? void 0 : e.y) ?? 0)}px`, n.style.left = "0";
106
- }, we = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), qe = (n) => {
107
- let t = n.parentElement;
108
- for (; t && t !== document.body; ) {
109
- const e = window.getComputedStyle(t);
110
- if (we.has(e.overflowY) || we.has(e.overflowX))
111
- return t;
112
- t = t.parentElement;
105
+ 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";
106
+ }, Le = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), ot = (t) => {
107
+ let n = t.parentElement;
108
+ for (; n && n !== document.body; ) {
109
+ const e = window.getComputedStyle(n);
110
+ if (Le.has(e.overflowY) || Le.has(e.overflowX))
111
+ return n;
112
+ n = n.parentElement;
113
113
  }
114
114
  return document.documentElement;
115
- }, Ge = (n) => {
116
- let t = n.parentElement;
117
- for (; t && t !== document.body; ) {
118
- const e = window.getComputedStyle(t).position;
115
+ }, rt = (t) => {
116
+ let n = t.parentElement;
117
+ for (; n && n !== document.body; ) {
118
+ const e = window.getComputedStyle(n).position;
119
119
  if (e === "relative" || e === "absolute" || e === "fixed" || e === "sticky")
120
- return t;
121
- t = t.parentElement;
120
+ return n;
121
+ n = n.parentElement;
122
122
  }
123
123
  return document.body;
124
124
  };
125
- function Ke(n) {
126
- const t = Object.keys(n);
127
- return Promise.all(t.map((e) => n[e])).then((e) => {
125
+ function st(t) {
126
+ const n = Object.keys(t);
127
+ return Promise.all(n.map((e) => t[e])).then((e) => {
128
128
  const o = {};
129
- return t.forEach((c, s) => {
129
+ return n.forEach((c, s) => {
130
130
  o[c] = e[s];
131
131
  }), o;
132
132
  });
133
133
  }
134
- const Ue = 768, Ve = 10, Ye = 10;
135
- function je(n = {}) {
136
- const { resolvePath: t = (b) => b } = n;
137
- let e = null, o = !1, c = !1;
138
- const s = () => {
139
- const b = (e == null ? void 0 : e.clientWidth) ?? 0, w = b > 0 ? b : typeof window < "u" ? window.innerWidth : 0;
140
- return w > 0 && w < Ue;
141
- }, p = () => (c || (o = s(), c = !0), o), i = (b) => `path:${t(b)}`;
142
- let y = null;
143
- const u = /* @__PURE__ */ new Map();
144
- let m = null, h = !1, P = 0, C = 0, L = 0;
145
- const z = () => {
146
- e && m && !h && u.set(i(m), {
134
+ const we = /* @__PURE__ */ new WeakMap();
135
+ function it(t) {
136
+ let n = we.get(t);
137
+ if (!n) {
138
+ const o = t.ownerDocument, s = t === o.documentElement || t === o.scrollingElement ? o : t, u = (f) => {
139
+ f.type === "wheel" && f.ctrlKey || f.type === "touchmove" && f.touches.length > 1 || f.cancelable && f.preventDefault();
140
+ }, i = { passive: !1, capture: !0 };
141
+ s.addEventListener("wheel", u, i), s.addEventListener("touchmove", u, i);
142
+ const y = /* @__PURE__ */ new Set([
143
+ "ArrowUp",
144
+ "ArrowDown",
145
+ "ArrowLeft",
146
+ "ArrowRight",
147
+ "PageUp",
148
+ "PageDown",
149
+ "Home",
150
+ "End",
151
+ " "
152
+ ]), h = (f) => {
153
+ var g, R;
154
+ const d = f;
155
+ if (!(d.defaultPrevented || d.altKey || !y.has(d.key))) {
156
+ for (const I of d.composedPath()) {
157
+ const x = I;
158
+ if (x.isContentEditable || (g = x.matches) != null && g.call(
159
+ x,
160
+ "input, textarea, select, [role=slider], [role=spinbutton], [role=listbox], [role=menu], [role=tablist]"
161
+ ) || d.key === " " && ((R = x.matches) != null && R.call(x, "button, [role=button]"))) return;
162
+ }
163
+ d.cancelable && d.preventDefault();
164
+ }
165
+ };
166
+ s.addEventListener("keydown", h, { capture: !0 }), n = {
167
+ owners: 0,
168
+ restore() {
169
+ s.removeEventListener("wheel", u, { capture: !0 }), s.removeEventListener("touchmove", u, {
170
+ capture: !0
171
+ }), s.removeEventListener("keydown", h, {
172
+ capture: !0
173
+ });
174
+ }
175
+ }, we.set(t, n);
176
+ }
177
+ n.owners++;
178
+ let e = !1;
179
+ return () => {
180
+ e || (e = !0, --n.owners === 0 && (we.delete(t), n.restore()));
181
+ };
182
+ }
183
+ const lt = 768, ct = 10, at = 10;
184
+ function ut(t = {}) {
185
+ const { resolvePath: n = (m) => m } = t;
186
+ let e = null, o = null;
187
+ const c = /* @__PURE__ */ new Set(), s = (m) => {
188
+ const S = m && e ? it(e) : () => {
189
+ }, O = () => {
190
+ c.delete(O) && S();
191
+ };
192
+ return c.add(O), O;
193
+ };
194
+ let u = !1, i = !1;
195
+ const y = () => {
196
+ const m = (e == null ? void 0 : e.clientWidth) ?? 0, S = m > 0 ? m : typeof window < "u" ? window.innerWidth : 0;
197
+ return S > 0 && S < lt;
198
+ }, h = () => (i || (u = y(), i = !0), u), f = (m) => `path:${n(m)}`;
199
+ let d = null;
200
+ const g = /* @__PURE__ */ new Map();
201
+ let R = null, I = !1, x = 0, B = 0, w = 0;
202
+ const p = () => {
203
+ e && R && !I && !c.size && g.set(f(R), {
147
204
  x: e.scrollLeft,
148
205
  y: e.scrollTop
149
206
  });
150
- }, X = (b, w, x) => {
207
+ }, b = (m, S, O) => {
151
208
  if (!e) return;
152
- const O = ++C, N = i(b), R = w && u.has(N) ? u.get(N) : { x: 0, y: 0 };
153
- let _ = 0;
154
- const W = () => {
155
- if (!e || x !== P || O !== C)
209
+ const D = ++B, N = f(m), L = S && g.has(N) ? g.get(N) : { x: 0, y: 0 };
210
+ let H = 0;
211
+ const K = () => {
212
+ if (!e || O !== x || D !== B)
156
213
  return;
157
- w || u.set(N, R), e.scrollTo({
158
- top: R.y,
159
- left: R.x
160
- }), !(Math.abs(e.scrollTop - R.y) < 1 && Math.abs(e.scrollLeft - R.x) < 1) && _ < Ve && (_++, requestAnimationFrame(W));
214
+ S || g.set(N, L), e.scrollTo({
215
+ top: L.y,
216
+ left: L.x,
217
+ behavior: "instant"
218
+ }), !(Math.abs(e.scrollTop - L.y) < 1 && Math.abs(e.scrollLeft - L.x) < 1) && H < ct && (H++, requestAnimationFrame(K));
161
219
  };
162
- requestAnimationFrame(W);
220
+ requestAnimationFrame(K);
163
221
  };
164
222
  return {
165
- initializeContext: (b, w, x) => {
166
- h = !0;
167
- const O = m === w ? P : ++P;
168
- y = b, e || (e = qe(b), o = s(), c = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
169
- o = s();
170
- }).observe(e), (e === document.documentElement ? window : e).addEventListener("scroll", z, {
223
+ beginTransition: s,
224
+ disconnect() {
225
+ ++x, ++B;
226
+ for (const m of c) m();
227
+ e && (e === document.documentElement ? window : e).removeEventListener("scroll", p), o == null || o.disconnect(), o = null, e = null, d = null, R = null, i = !1;
228
+ },
229
+ initializeContext: (m, S, O) => {
230
+ I = !0;
231
+ const D = R === S ? x : ++x;
232
+ d = m, e || (e = ot(m), u = y(), i = !0, typeof ResizeObserver < "u" && (o = new ResizeObserver(() => {
233
+ u = y();
234
+ }), o.observe(e)), (e === document.documentElement ? window : e).addEventListener("scroll", p, {
171
235
  passive: !0
172
- })), m = w;
173
- const N = i(w), R = u.get(N), _ = (B) => {
174
- O === P && (L = O, B && R && u.set(N, R), X(w, B, O));
236
+ })), R = S;
237
+ const N = f(S), L = g.get(N), H = (U) => {
238
+ D === x && (w = D, U && L && g.set(N, L), b(S, U, D));
175
239
  };
176
- x !== void 0 ? _(x) : requestAnimationFrame(() => {
177
- L !== O && O === P && _(!1);
240
+ O !== void 0 ? H(O) : requestAnimationFrame(() => {
241
+ w !== D && D === x && H(!1);
178
242
  });
179
- let W = 0;
180
- const K = () => {
181
- O === P && (W++, W >= Ye ? h = !1 : requestAnimationFrame(K));
243
+ let K = 0;
244
+ const M = () => {
245
+ D === x && (K++, K >= at ? I = !1 : requestAnimationFrame(M));
182
246
  };
183
- return requestAnimationFrame(K), _;
247
+ return requestAnimationFrame(M), H;
184
248
  },
185
- calculateScrollOffset: (b, w, x = !1) => {
186
- const O = b ? i(b) : null, N = O && u.has(O) ? u.get(O) : { x: 0, y: 0 }, R = w && x ? i(w) : null, _ = R && u.has(R) ? u.get(R) : { x: 0, y: 0 };
249
+ calculateScrollOffset: (m, S, O = !1) => {
250
+ const D = m ? f(m) : null, N = D && g.has(D) ? g.get(D) : { x: 0, y: 0 }, L = S && O ? f(S) : null, H = L && g.has(L) ? g.get(L) : { x: 0, y: 0 };
187
251
  return {
188
- x: -_.x + N.x,
189
- y: -_.y + N.y
252
+ x: -H.x + N.x,
253
+ y: -H.y + N.y
190
254
  };
191
255
  },
192
- evictScrollPosition: (b) => {
193
- u.delete(i(b));
256
+ evictScrollPosition: (m) => {
257
+ g.delete(f(m));
194
258
  },
195
259
  getScrollContainer: () => e,
196
- getPositionedParentElement: () => y ? Ge(y) : document.body,
197
- getScrollPosition: (b, w = !0) => {
198
- if (!w) return { x: 0, y: 0 };
199
- const x = b ? i(b) : null;
200
- return x && u.has(x) ? u.get(x) : { x: 0, y: 0 };
260
+ getPositionedParentElement: () => d ? rt(d) : document.body,
261
+ getScrollPosition: (m, S = !0) => {
262
+ if (!S) return { x: 0, y: 0 };
263
+ const O = m ? f(m) : null;
264
+ return O && g.has(O) ? g.get(O) : { x: 0, y: 0 };
201
265
  },
202
266
  // Exposed so a functional `transitions` config can branch on device class.
203
- getIsMobile: p
267
+ getIsMobile: h
204
268
  };
205
269
  }
206
- const Ee = 30, Se = 8, Pe = 1.2, Te = 30, Ze = 600;
207
- function Je() {
208
- let n = null, t = !1, e = !1, o = null, c = null, s = !1;
209
- const p = (f, g) => {
210
- for (let E = 0; E < f.length; E++) {
211
- const M = f.item(E);
212
- if (M && M.identifier === g) return M;
270
+ const Ce = 30, _e = 8, De = 1.2, Ne = 30, dt = 600;
271
+ function ft() {
272
+ let t = null, n = !1, e = !1, o = null, c = null, s = !1;
273
+ const u = (p, b) => {
274
+ for (let k = 0; k < p.length; k++) {
275
+ const A = p.item(k);
276
+ if (A && A.identifier === b) return A;
213
277
  }
214
278
  return null;
215
279
  }, i = () => {
216
280
  o !== null && (clearTimeout(o), o = null);
217
281
  }, y = () => {
218
282
  c !== null && (clearTimeout(c), c = null);
219
- }, u = () => {
220
- t = !0, e = !0, i(), y(), o = setTimeout(() => {
221
- t = !1, e = !1, o = null;
222
- }, Ze);
223
- }, m = (f) => {
224
- if (f.touches.length !== 1) {
225
- n = null;
283
+ }, h = () => {
284
+ n = !0, e = !0, i(), y(), o = setTimeout(() => {
285
+ n = !1, e = !1, o = null;
286
+ }, dt);
287
+ }, f = (p) => {
288
+ if (p.touches.length !== 1) {
289
+ t = null;
226
290
  return;
227
291
  }
228
- const g = f.touches.item(0);
229
- if (!g) {
230
- n = null;
292
+ const b = p.touches.item(0);
293
+ if (!b) {
294
+ t = null;
231
295
  return;
232
296
  }
233
- const E = window.innerWidth, M = g.clientX <= Ee, D = g.clientX >= E - Ee;
234
- if (!M && !D) {
235
- n = null;
297
+ const k = window.innerWidth, A = b.clientX <= Ce, F = b.clientX >= k - Ce;
298
+ if (!A && !F) {
299
+ t = null;
236
300
  return;
237
301
  }
238
- n = {
239
- identifier: g.identifier,
240
- startX: g.clientX,
241
- startY: g.clientY,
242
- fromLeftEdge: M,
302
+ t = {
303
+ identifier: b.identifier,
304
+ startX: b.clientX,
305
+ startY: b.clientY,
306
+ fromLeftEdge: A,
243
307
  moved: !1
244
308
  };
245
- }, h = (f) => {
246
- if (!n) return;
247
- if (f.touches.length !== 1) {
248
- n = null;
309
+ }, d = (p) => {
310
+ if (!t) return;
311
+ if (p.touches.length !== 1) {
312
+ t = null;
249
313
  return;
250
314
  }
251
- const g = p(f.touches, n.identifier);
252
- if (!g) {
253
- n = null;
315
+ const b = u(p.touches, t.identifier);
316
+ if (!b) {
317
+ t = null;
254
318
  return;
255
319
  }
256
- const E = g.clientX - n.startX, M = g.clientY - n.startY, D = Math.abs(E), b = Math.abs(M);
257
- if (b > Se && b > D * Pe) {
258
- n = null;
320
+ const k = b.clientX - t.startX, A = b.clientY - t.startY, F = Math.abs(k), G = Math.abs(A);
321
+ if (G > _e && G > F * De) {
322
+ t = null;
259
323
  return;
260
324
  }
261
- const w = n.fromLeftEdge ? E > 0 : E < 0;
262
- D > Se && D > b * Pe && w && (n.moved = !0);
263
- }, P = (f) => {
264
- if (!n) return;
265
- const g = p(f.changedTouches, n.identifier);
266
- if (!g) {
267
- n = null;
325
+ const ee = t.fromLeftEdge ? k > 0 : k < 0;
326
+ F > _e && F > G * De && ee && (t.moved = !0);
327
+ }, g = (p) => {
328
+ if (!t) return;
329
+ const b = u(p.changedTouches, t.identifier);
330
+ if (!b) {
331
+ t = null;
268
332
  return;
269
333
  }
270
- const E = g.clientX - n.startX, M = n.fromLeftEdge ? E > 0 : E < 0;
271
- if (n.moved && M && Math.abs(E) >= Te) {
272
- u(), n = null;
334
+ const k = b.clientX - t.startX, A = t.fromLeftEdge ? k > 0 : k < 0;
335
+ if (t.moved && A && Math.abs(k) >= Ne) {
336
+ h(), t = null;
273
337
  return;
274
338
  }
275
- n.moved && Math.abs(E) >= Te && u(), n = null;
276
- }, C = () => {
277
- n && (n.moved && u(), n = null);
339
+ t.moved && Math.abs(k) >= Ne && h(), t = null;
340
+ }, R = () => {
341
+ t && (t.moved && h(), t = null);
278
342
  };
279
343
  return { initialize: () => {
280
344
  if (typeof window > "u" || s) return;
281
345
  s = !0;
282
- const f = { passive: !0, capture: !0 };
283
- window.addEventListener("touchstart", m, f), window.addEventListener("touchmove", h, f), window.addEventListener("touchend", P, f), window.addEventListener("touchcancel", C, f);
346
+ const p = { passive: !0, capture: !0 };
347
+ window.addEventListener("touchstart", f, p), window.addEventListener("touchmove", d, p), window.addEventListener("touchend", g, p), window.addEventListener("touchcancel", R, p);
284
348
  }, destroy: () => {
285
349
  if (typeof window > "u" || !s) return;
286
350
  s = !1;
287
- const f = { capture: !0 };
288
- window.removeEventListener("touchstart", m, f), window.removeEventListener("touchmove", h, f), window.removeEventListener("touchend", P, f), window.removeEventListener("touchcancel", C, f), i(), y(), n = null, t = !1, e = !1;
351
+ const p = { capture: !0 };
352
+ window.removeEventListener("touchstart", f, p), window.removeEventListener("touchmove", d, p), window.removeEventListener("touchend", g, p), window.removeEventListener("touchcancel", R, p), i(), y(), t = null, n = !1, e = !1;
289
353
  }, isSwipeBack: () => {
290
- const f = t || e;
291
- return f && i(), f;
354
+ const p = n || e;
355
+ return p && i(), p;
292
356
  }, onPageEnter: () => {
293
- t = !1, i(), y(), c = setTimeout(() => {
357
+ n = !1, i(), y(), c = setTimeout(() => {
294
358
  e = !1, c = null;
295
359
  }, 0);
296
360
  } };
297
361
  }
298
- const ke = "__ssgoi_entry_v1", ae = /* @__PURE__ */ new WeakMap(), Ae = {
362
+ const He = "__ssgoi_entry_v1", be = /* @__PURE__ */ new WeakMap(), Ke = {
299
363
  read: () => null,
300
364
  previous: () => null,
301
365
  dispose() {
302
366
  }
303
367
  };
304
- function Qe() {
305
- if (typeof window > "u") return Ae;
306
- const n = window.navigation, t = window;
307
- let e = ae.get(t);
308
- e || (e = et(t, n), ae.set(t, e)), e.users++;
368
+ function pt() {
369
+ if (typeof window > "u") return Ke;
370
+ const t = window.navigation, n = window;
371
+ let e = be.get(n);
372
+ e || (e = ht(n, t), be.set(n, e)), e.users++;
309
373
  const o = e;
310
374
  let c = !1;
311
375
  return {
312
376
  read: o.read,
313
377
  previous: o.previous,
314
378
  dispose() {
315
- c || (c = !0, --o.users === 0 && (o.dispose(), ae.delete(t)));
379
+ c || (c = !0, --o.users === 0 && (o.dispose(), be.delete(n)));
316
380
  }
317
381
  };
318
382
  }
319
- function xe(n) {
320
- return n && typeof n.key == "string" && typeof n.url == "string" && Number.isSafeInteger(n.index) && n.index >= 0 ? { key: n.key, index: n.index, url: n.url } : null;
383
+ function Ie(t) {
384
+ return t && typeof t.key == "string" && typeof t.url == "string" && Number.isSafeInteger(t.index) && t.index >= 0 ? { key: t.key, index: t.index, url: t.url } : null;
321
385
  }
322
- function ue(n) {
323
- return n !== null && typeof n == "object" && Object.getPrototypeOf(n) === Object.prototype;
386
+ function Ee(t) {
387
+ return t !== null && typeof t == "object" && Object.getPrototypeOf(t) === Object.prototype;
324
388
  }
325
- function et(n, t) {
326
- var X;
327
- const e = n.history, o = e.pushState, c = e.replaceState, s = `${Date.now()}-${Math.random().toString(36).slice(2)}-`;
328
- let p = 0, i = !0, y = null, u = null;
329
- const m = () => {
330
- const v = xe(t == null ? void 0 : t.currentEntry);
331
- return (v == null ? void 0 : v.url) === n.location.href ? v : null;
332
- }, h = () => {
333
- const v = e.state, f = ue(v) ? v[ke] : null;
334
- return !ue(f) || typeof f.key != "string" || !f.key.startsWith(s) || !Number.isSafeInteger(f.index) ? m() : {
335
- key: f.key,
336
- index: f.index,
337
- url: n.location.href
389
+ function ht(t, n) {
390
+ var B;
391
+ const e = t.history, o = e.pushState, c = e.replaceState, s = `${Date.now()}-${Math.random().toString(36).slice(2)}-`;
392
+ let u = 0, i = !0, y = null, h = null;
393
+ const f = () => {
394
+ const w = Ie(n == null ? void 0 : n.currentEntry);
395
+ return (w == null ? void 0 : w.url) === t.location.href ? w : null;
396
+ }, d = () => {
397
+ const w = e.state, p = Ee(w) ? w[He] : null;
398
+ return !Ee(p) || typeof p.key != "string" || !p.key.startsWith(s) || !Number.isSafeInteger(p.index) ? f() : {
399
+ key: p.key,
400
+ index: p.index,
401
+ url: t.location.href
338
402
  };
339
- }, P = (v, f) => v !== null && !ue(v) ? v : { ...v, [ke]: f }, C = (v) => ({ key: `${s}${++p}`, index: v });
403
+ }, g = (w, p) => w !== null && !Ee(w) ? w : { ...w, [He]: p }, R = (w) => ({ key: `${s}${++u}`, index: w });
340
404
  try {
341
405
  c.call(
342
406
  e,
343
- P(e.state, C(((X = m()) == null ? void 0 : X.index) ?? 0)),
407
+ g(e.state, R(((B = f()) == null ? void 0 : B.index) ?? 0)),
344
408
  ""
345
409
  );
346
410
  } catch {
347
- return { ...Ae, read: m, users: 0 };
411
+ return { ...Ke, read: f, users: 0 };
348
412
  }
349
- const L = function(v, f, g) {
350
- var D;
351
- if (!i) return o.call(this, v, f, g);
352
- const E = h(), M = C(((E == null ? void 0 : E.index) ?? 0) + 1);
353
- o.call(this, P(v, M), f, g), y = E, u = ((D = h()) == null ? void 0 : D.key) ?? null;
354
- }, z = function(v, f, g) {
355
- if (!i) return c.call(this, v, f, g);
356
- const E = h();
357
- c.call(this, P(v, E ?? C(0)), f, g);
413
+ const I = function(w, p, b) {
414
+ var F;
415
+ if (!i) return o.call(this, w, p, b);
416
+ const k = d(), A = R(((k == null ? void 0 : k.index) ?? 0) + 1);
417
+ o.call(this, g(w, A), p, b), y = k, h = ((F = d()) == null ? void 0 : F.key) ?? null;
418
+ }, x = function(w, p, b) {
419
+ if (!i) return c.call(this, w, p, b);
420
+ const k = d();
421
+ c.call(this, g(w, k ?? R(0)), p, b);
358
422
  };
359
- return e.pushState = L, e.replaceState = z, {
423
+ return e.pushState = I, e.replaceState = x, {
360
424
  users: 0,
361
- read: h,
425
+ read: d,
362
426
  previous: () => {
363
- var f;
364
- if (((f = h()) == null ? void 0 : f.key) === u) return y;
365
- const v = m();
366
- return v ? xe(
367
- t == null ? void 0 : t.entries().find((g) => g.index === v.index - 1)
427
+ var p;
428
+ if (((p = d()) == null ? void 0 : p.key) === h) return y;
429
+ const w = f();
430
+ return w ? Ie(
431
+ n == null ? void 0 : n.entries().find((b) => b.index === w.index - 1)
368
432
  ) : null;
369
433
  },
370
434
  dispose() {
371
- i = !1, e.pushState === L && (e.pushState = o), e.replaceState === z && (e.replaceState = c);
435
+ i = !1, e.pushState === I && (e.pushState = o), e.replaceState === x && (e.replaceState = c);
372
436
  }
373
437
  };
374
438
  }
375
- function tt() {
376
- let n = null, t = null;
439
+ function yt() {
440
+ let t = null, n = null;
377
441
  const e = /* @__PURE__ */ new Set(), o = (s) => {
378
442
  s && e.add(s.key), e.size > 200 && e.delete(e.values().next().value);
379
443
  }, c = () => {
380
- n || (n = Qe(), t = n.read(), o(t));
444
+ t || (t = pt(), n = t.read(), o(n));
381
445
  };
382
446
  return {
383
447
  connect: c,
384
- resolve(s, p) {
448
+ resolve(s, u) {
385
449
  c();
386
- const i = n.read();
387
- let y = t, u = "unknown";
388
- if (y && i && (i.key === y.key || i.index === y.index ? u = "replace" : i.index < y.index ? u = "back" : u = e.has(i.key) ? "forward" : "push"), u === "push") {
389
- const m = n.previous();
390
- m && m.index === i.index - 1 && be(new URL(m.url).pathname) === be(s) && (y = m);
450
+ const i = t.read();
451
+ let y = n, h = "unknown";
452
+ if (y && i && (i.key === y.key || i.index === y.index ? h = "replace" : i.index < y.index ? h = "back" : h = e.has(i.key) ? "forward" : "push"), h === "push") {
453
+ const f = t.previous();
454
+ f && f.index === i.index - 1 && Ae(new URL(f.url).pathname) === Ae(s) && (y = f);
391
455
  }
392
- return t = i, o(y), o(i), {
393
- kind: u,
394
- direction: u === "back" ? "backward" : "forward",
456
+ return n = i, o(y), o(i), {
457
+ kind: h,
458
+ direction: h === "back" ? "backward" : "forward",
395
459
  from: y,
396
460
  to: i
397
461
  };
398
462
  },
399
463
  dispose() {
400
- n == null || n.dispose(), n = null, t = null, e.clear();
464
+ t == null || t.dispose(), t = null, n = null, e.clear();
401
465
  }
402
466
  };
403
467
  }
404
- function nt() {
405
- const n = tt(), t = /* @__PURE__ */ new Map();
468
+ function mt() {
469
+ const t = yt(), n = /* @__PURE__ */ new Map();
406
470
  return {
407
- connect: n.connect,
471
+ connect: t.connect,
408
472
  resolve(e, o, c) {
409
- var u, m;
410
- const s = n.resolve(e, o), p = (u = s.from) == null ? void 0 : u.key, i = (m = s.to) == null ? void 0 : m.key;
411
- if (s.kind === "back" && p && i) {
412
- const h = t.get(p);
413
- if ((h == null ? void 0 : h.source) === i && h.from === o && h.to === e)
414
- return h.rule ? {
415
- ...h.rule,
416
- direction: h.rule.direction === "forward" ? "backward" : "forward",
473
+ var h, f;
474
+ const s = t.resolve(e, o), u = (h = s.from) == null ? void 0 : h.key, i = (f = s.to) == null ? void 0 : f.key;
475
+ if (s.kind === "back" && u && i) {
476
+ const d = n.get(u);
477
+ if ((d == null ? void 0 : d.source) === i && d.from === o && d.to === e)
478
+ return d.rule ? {
479
+ ...d.rule,
480
+ direction: d.rule.direction === "forward" ? "backward" : "forward",
417
481
  preserveScroll: {
418
- from: h.rule.preserveScroll.to,
419
- to: h.rule.preserveScroll.from
482
+ from: d.rule.preserveScroll.to,
483
+ to: d.rule.preserveScroll.from
420
484
  }
421
485
  } : null;
422
486
  }
423
- if (s.kind === "forward" && p && i) {
424
- const h = t.get(i);
425
- if ((h == null ? void 0 : h.source) === p && h.from === e && h.to === o)
426
- return h.rule;
487
+ if (s.kind === "forward" && u && i) {
488
+ const d = n.get(i);
489
+ if ((d == null ? void 0 : d.source) === u && d.from === e && d.to === o)
490
+ return d.rule;
427
491
  }
428
492
  const y = c(s.direction);
429
- if (i && s.kind === "replace" && t.delete(i), i && p && s.kind === "push") {
430
- for (const [h, P] of t)
431
- P.index >= s.to.index && t.delete(h);
432
- t.set(i, {
433
- source: p,
493
+ if (i && s.kind === "replace" && n.delete(i), i && u && s.kind === "push") {
494
+ for (const [d, g] of n)
495
+ g.index >= s.to.index && n.delete(d);
496
+ n.set(i, {
497
+ source: u,
434
498
  index: s.to.index,
435
499
  from: e,
436
500
  to: o,
437
501
  rule: y ? { ...y, preserveScroll: { ...y.preserveScroll } } : null
438
- }), t.size > 100 && t.delete(t.keys().next().value);
502
+ }), n.size > 100 && n.delete(n.keys().next().value);
439
503
  }
440
504
  return y;
441
505
  },
442
506
  dispose() {
443
- n.dispose(), t.clear();
507
+ t.dispose(), n.clear();
444
508
  }
445
509
  };
446
510
  }
447
- function ot(n = {}) {
448
- let t = null, e = null;
511
+ function vt(t = {}) {
512
+ let n = null, e = null;
449
513
  function o() {
450
- var s, p;
451
- t && ((s = t.out) == null || s.resolve(null), (p = t.in) == null || p.resolve(null), t = null);
514
+ var s, u;
515
+ n && ((s = n.out) == null || s.resolve(null), (u = n.in) == null || u.resolve(null), n = null);
452
516
  }
453
517
  function c() {
454
- if (t != null && t.out && t.in) {
455
- if (t.out.path === t.in.path) {
518
+ if (n != null && n.out && n.in) {
519
+ if (n.out.path === n.in.path) {
456
520
  o();
457
521
  return;
458
522
  }
459
523
  const s = {
460
- from: t.out.path,
461
- to: t.in.path,
462
- out: t.out.payload,
463
- in: t.in.payload
524
+ from: n.out.path,
525
+ to: n.in.path,
526
+ out: n.out.payload,
527
+ in: n.in.payload
464
528
  };
465
- e = s, t.out.resolve(s), t.in.resolve(s), t = null;
529
+ e = s, n.out.resolve(s), n.in.resolve(s), n = null;
466
530
  }
467
531
  }
468
532
  return {
469
- arrive(s, p, i) {
533
+ arrive(s, u, i) {
470
534
  return new Promise((y) => {
471
- var P, C;
472
- const u = e === null ? null : p === "out" ? { path: e.from, payload: e.out } : { path: e.to, payload: e.in };
473
- if ((u == null ? void 0 : u.path) === s) {
535
+ var g, R;
536
+ const h = e === null ? null : u === "out" ? { path: e.from, payload: e.out } : { path: e.to, payload: e.in };
537
+ if ((h == null ? void 0 : h.path) === s) {
474
538
  y(null);
475
539
  return;
476
540
  }
477
- p === "out" && ((P = t == null ? void 0 : t.in) == null ? void 0 : P.path) === s && !t.out && (t.in.resolve(null), t.in = void 0);
478
- const m = t == null ? void 0 : t[p];
479
- m && m.path !== s && o(), t || (t = {});
480
- const h = t[p];
481
- if (h) {
482
- if (((C = n.keepCurrent) == null ? void 0 : C.call(n, {
483
- type: p,
541
+ u === "out" && ((g = n == null ? void 0 : n.in) == null ? void 0 : g.path) === s && !n.out && (n.in.resolve(null), n.in = void 0);
542
+ const f = n == null ? void 0 : n[u];
543
+ f && f.path !== s && o(), n || (n = {});
544
+ const d = n[u];
545
+ if (d) {
546
+ if (((R = t.keepCurrent) == null ? void 0 : R.call(t, {
547
+ type: u,
484
548
  path: s,
485
- current: h.payload,
549
+ current: d.payload,
486
550
  next: i
487
551
  })) ?? !1) {
488
552
  y(null);
489
553
  return;
490
554
  }
491
- h.resolve(null);
555
+ d.resolve(null);
492
556
  }
493
- t[p] = { path: s, payload: i, resolve: y }, c();
557
+ n[u] = { path: s, payload: i, resolve: y }, c();
494
558
  });
495
559
  },
496
560
  cancel(s) {
497
- (t != null && t.out && s(t.out.payload) || t != null && t.in && s(t.in.payload)) && o(), (e && s(e.out) || e && s(e.in)) && (e = null);
561
+ (n != null && n.out && s(n.out.payload) || n != null && n.in && s(n.in.payload)) && o(), (e && s(e.out) || e && s(e.in)) && (e = null);
498
562
  }
499
563
  };
500
564
  }
501
- const rt = {}, G = /* @__PURE__ */ new Map();
502
- let Q = null, Re = !1;
503
- function _e(n, t, e) {
504
- n instanceof HTMLElement && G.has(n) && !n.isConnected && e.set(n, { entry: G.get(n), anchor: t });
505
- for (const o of Array.from(n.childNodes))
506
- _e(o, t, e);
565
+ const gt = {}, j = /* @__PURE__ */ new Map();
566
+ let le = null, We = !1;
567
+ function Ue(t, n, e) {
568
+ t instanceof HTMLElement && j.has(t) && !t.isConnected && e.set(t, { entry: j.get(t), anchor: n });
569
+ for (const o of Array.from(t.childNodes))
570
+ Ue(o, n, e);
507
571
  }
508
- function st(n) {
509
- const t = new Set(
510
- Array.from(n.values(), ({ entry: e }) => e)
572
+ function wt(t) {
573
+ const n = new Set(
574
+ Array.from(t.values(), ({ entry: e }) => e)
511
575
  );
512
- for (const [e, { entry: o, anchor: c }] of n) {
513
- G.delete(e);
514
- let s = o.parent, p = !1;
576
+ for (const [e, { entry: o, anchor: c }] of t) {
577
+ j.delete(e);
578
+ let s = o.parent, u = !1;
515
579
  for (; s; ) {
516
- if (s.group === o.group && t.has(s)) {
517
- p = !0;
580
+ if (s.group === o.group && n.has(s)) {
581
+ u = !0;
518
582
  break;
519
583
  }
520
584
  s = s.parent;
521
585
  }
522
- queueMicrotask(() => o.callback(c, { emit: !p }));
586
+ queueMicrotask(() => o.callback(c, { emit: !u }));
523
587
  }
524
588
  }
525
- function it() {
526
- if (Re || typeof document > "u") return;
527
- Re = !0, Q = new MutationObserver((t) => {
589
+ function bt() {
590
+ if (We || typeof document > "u") return;
591
+ We = !0, le = new MutationObserver((n) => {
528
592
  const e = /* @__PURE__ */ new Map();
529
- for (const o of t) {
593
+ for (const o of n) {
530
594
  const c = {
531
595
  parent: o.target,
532
596
  nextSibling: o.nextSibling
533
597
  };
534
598
  for (const s of Array.from(o.removedNodes))
535
- _e(s, c, e);
599
+ Ue(s, c, e);
536
600
  }
537
- st(e);
601
+ wt(e);
538
602
  });
539
- const n = () => {
540
- Q == null || Q.observe(document.body, { childList: !0, subtree: !0 });
603
+ const t = () => {
604
+ le == null || le.observe(document.body, { childList: !0, subtree: !0 });
541
605
  };
542
- document.body ? n() : document.addEventListener("DOMContentLoaded", n, { once: !0 });
606
+ document.body ? t() : document.addEventListener("DOMContentLoaded", t, { once: !0 });
543
607
  }
544
- function lt(n, t, e = rt) {
545
- it();
546
- let o = n.parentElement, c = null;
608
+ function Et(t, n, e = gt) {
609
+ bt();
610
+ let o = t.parentElement, c = null;
547
611
  for (; o; ) {
548
- const s = G.get(o);
612
+ const s = j.get(o);
549
613
  if ((s == null ? void 0 : s.group) === e) {
550
614
  c = s;
551
615
  break;
552
616
  }
553
617
  o = o.parentElement;
554
618
  }
555
- return G.set(n, {
556
- element: n,
557
- callback: t,
619
+ return j.set(t, {
620
+ element: t,
621
+ callback: n,
558
622
  group: e,
559
623
  parent: c
560
624
  }), () => {
561
- G.delete(n);
625
+ j.delete(t);
562
626
  };
563
627
  }
564
- const de = /* @__PURE__ */ new WeakMap();
565
- let ee = null;
566
- const te = "none !important";
567
- function j(n) {
568
- const t = n.style.getPropertyValue("display");
569
- return n.style.getPropertyPriority("display") ? `${t} !important` : t;
628
+ const Se = /* @__PURE__ */ new WeakMap();
629
+ let ce = null;
630
+ const ae = "none !important";
631
+ function Q(t) {
632
+ const n = t.style.getPropertyValue("display");
633
+ return t.style.getPropertyPriority("display") ? `${n} !important` : n;
570
634
  }
571
- function ct() {
572
- return ee || (ee = new MutationObserver((n) => {
573
- for (const t of n) {
574
- const e = t.target, o = de.get(e);
635
+ function St() {
636
+ return ce || (ce = new MutationObserver((t) => {
637
+ for (const n of t) {
638
+ const e = n.target, o = Se.get(e);
575
639
  if (!o) continue;
576
- const c = j(e);
577
- c !== o.accounted && (o.accounted = c, c === te ? (o.reactHidden = !0, o.onHide()) : c !== "none" && o.reactHidden && (o.reactHidden = !1, o.onShow()));
640
+ const c = Q(e);
641
+ c !== o.accounted && (o.accounted = c, c === ae ? (o.reactHidden = !0, o.onHide()) : c !== "none" && o.reactHidden && (o.reactHidden = !1, o.onShow()));
578
642
  }
579
- }), ee);
643
+ }), ce);
580
644
  }
581
- function at(n, t) {
582
- const e = j(n), o = {
645
+ function kt(t, n) {
646
+ const e = Q(t), o = {
583
647
  accounted: e,
584
- reactHidden: e === te,
585
- onHide: t.onHide,
586
- onShow: t.onShow
648
+ reactHidden: e === ae,
649
+ onHide: n.onHide,
650
+ onShow: n.onShow
587
651
  };
588
- return de.set(n, o), ct().observe(n, {
652
+ return Se.set(t, o), St().observe(t, {
589
653
  attributes: !0,
590
654
  attributeFilter: ["style"]
591
655
  }), {
592
656
  get isHidden() {
593
- return j(n) === te;
657
+ return Q(t) === ae;
594
658
  },
595
659
  setDisplay(c, s = !1) {
596
- c === null ? n.style.removeProperty("display") : n.style.setProperty(
660
+ c === null ? t.style.removeProperty("display") : t.style.setProperty(
597
661
  "display",
598
662
  c,
599
663
  s ? "important" : ""
600
- ), o.accounted = j(n);
664
+ ), o.accounted = Q(t);
601
665
  },
602
666
  sync() {
603
- o.accounted = j(n), o.reactHidden = o.accounted === te;
667
+ o.accounted = Q(t), o.reactHidden = o.accounted === ae;
604
668
  },
605
669
  stop() {
606
- de.delete(n);
670
+ Se.delete(t);
607
671
  }
608
672
  };
609
673
  }
610
- function wt(n, t = {}) {
611
- const { transitions: e = [], middleware: o = (r, l) => ({ from: r, to: l }) } = n, c = t.host ?? new Xe(), s = {}, p = ot({
674
+ const Tt = 5e3;
675
+ function Nt(t, n = {}) {
676
+ const { transitions: e = [], middleware: o = (r, l) => ({ from: r, to: l }) } = t, c = n.host ?? new tt(), s = {}, u = vt({
612
677
  // Nested boundaries can be discovered in separate MutationObserver
613
678
  // batches (notably when Suspense reveals a child later). When the same
614
679
  // side/path repeats before pairing, the outermost DOM boundary owns it.
615
680
  keepCurrent: ({ current: r, next: l }) => r.element.contains(l.element)
616
- }), i = nt(), y = typeof e == "function" ? e : () => e, u = Je();
617
- u.initialize();
618
- const m = /* @__PURE__ */ new Map(), h = (r) => {
619
- let l = m.get(r);
620
- return l === void 0 && (l = o(r, r).from, m.set(r, l)), l;
681
+ }), i = mt(), y = typeof e == "function" ? e : () => e, h = ft();
682
+ h.initialize();
683
+ const f = /* @__PURE__ */ new Map(), d = (r) => {
684
+ let l = f.get(r);
685
+ return l === void 0 && (l = o(r, r).from, f.set(r, l)), l;
621
686
  }, {
622
- initializeContext: P,
623
- calculateScrollOffset: C,
624
- evictScrollPosition: L,
625
- getScrollContainer: z,
626
- getPositionedParentElement: X,
627
- getScrollPosition: v,
628
- getIsMobile: f
629
- } = je({ resolvePath: h }), g = /* @__PURE__ */ new Map(), E = () => {
630
- const r = f();
631
- let l = g.get(r);
632
- return l || (l = y({ isMobile: r }), g.set(r, l)), l;
633
- }, M = /* @__PURE__ */ new WeakMap(), D = (r) => {
634
- M.set(r, {
687
+ initializeContext: g,
688
+ beginTransition: R,
689
+ disconnect: I,
690
+ calculateScrollOffset: x,
691
+ evictScrollPosition: B,
692
+ getScrollContainer: w,
693
+ getPositionedParentElement: p,
694
+ getScrollPosition: b,
695
+ getIsMobile: k
696
+ } = ut({ resolvePath: d }), A = /* @__PURE__ */ new Map(), F = () => {
697
+ const r = k();
698
+ let l = A.get(r);
699
+ return l || (l = y({ isMobile: r }), A.set(r, l)), l;
700
+ }, G = /* @__PURE__ */ new WeakMap(), ee = (r) => {
701
+ G.set(r, {
635
702
  parent: r.parentNode,
636
703
  nextSibling: r.nextSibling
637
704
  });
638
- }, b = (r) => {
639
- const l = M.get(r);
705
+ }, te = (r) => {
706
+ const l = G.get(r);
640
707
  return l || {
641
708
  parent: r.parentNode,
642
709
  nextSibling: r.nextSibling
643
710
  };
644
- }, w = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap();
711
+ }, m = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap();
645
712
  let O = 0;
646
- const N = (r) => {
713
+ const D = (r) => {
647
714
  const l = typeof getComputedStyle < "u" ? getComputedStyle(r).display : "";
648
715
  return l && l !== "none" ? l : "block";
649
- }, R = (r, l) => {
650
- l.visibleDisplay = r.style.getPropertyValue("display"), l.computedDisplay = N(r);
651
- }, _ = (r, l) => {
652
- if (x.get(r) !== l) return;
653
- x.delete(r);
654
- const a = w.get(r);
655
- a && (a.savedCss !== null && (r.style.cssText = a.savedCss, a.savedCss = null), a.intent === "hidden" ? a.vis.setDisplay("none", !0) : a.visibleDisplay ? (a.vis.setDisplay(a.visibleDisplay, !1), R(r, a)) : (a.vis.setDisplay(null), R(r, a)));
656
- }, W = (r, l) => {
716
+ }, N = (r, l) => {
717
+ l.visibleDisplay = r.style.getPropertyValue("display"), l.computedDisplay = D(r);
718
+ }, L = (r, l) => {
719
+ if (S.get(r) !== l) return;
720
+ S.delete(r);
721
+ const a = m.get(r);
722
+ a && (a.savedCss !== null && (r.style.cssText = a.savedCss, a.savedCss = null), a.intent === "hidden" ? a.vis.setDisplay("none", !0) : a.visibleDisplay ? (a.vis.setDisplay(a.visibleDisplay, !1), N(r, a)) : (a.vis.setDisplay(null), N(r, a)));
723
+ }, H = (r, l) => {
657
724
  if (r.mode !== "hidden") return;
658
725
  const a = Array.from(
659
726
  new Set([r.element, l == null ? void 0 : l.element].filter(Boolean))
660
- ), T = ++O;
661
- for (const d of a) x.set(d, T);
727
+ ), C = ++O;
728
+ for (const v of a) S.set(v, C);
662
729
  c.complete();
663
- for (const d of a) _(d, T);
664
- }, K = (r, l, a, T, d, S, k) => {
665
- const A = d.element, H = S.element, F = (d.mode ?? "unmount") === "hidden", { parent: $, nextSibling: U } = d.parent ? { parent: d.parent, nextSibling: d.nextSibling } : b(A), Z = C(
730
+ for (const v of a) L(v, C);
731
+ }, K = /* @__PURE__ */ new Set();
732
+ let M, U = 0, ne = !1;
733
+ const Ge = (r, l, a, C, v, E, W) => {
734
+ const T = v.element, P = E.element, X = (v.mode ?? "unmount") === "hidden", { parent: $, nextSibling: V } = v.parent ? { parent: v.parent, nextSibling: v.nextSibling } : te(T), Y = x(
666
735
  a,
667
- T,
668
- k.to
669
- ), re = {
736
+ C,
737
+ W.to
738
+ ), pe = {
670
739
  direction: l,
671
- scrollOffset: Z,
672
- from: { scroll: v(a) },
740
+ scrollOffset: Y,
741
+ from: { scroll: b(a) },
673
742
  to: {
674
- scroll: v(T, k.to)
743
+ scroll: b(C, W.to)
675
744
  },
676
745
  get scrollingElement() {
677
- return z() || document.documentElement;
746
+ return w() || document.documentElement;
678
747
  },
679
748
  get positionedParent() {
680
- return X();
749
+ return p();
681
750
  }
682
751
  };
683
- let I;
684
- if (F) {
685
- I = A, I.style.top = `${-1 * ((Z == null ? void 0 : Z.y) ?? 0)}px`;
686
- const q = w.get(H);
687
- q && q.savedCss === null && (q.savedCss = H.style.cssText);
752
+ let z;
753
+ if (X) {
754
+ z = T, z.style.top = `${-1 * ((Y == null ? void 0 : Y.y) ?? 0)}px`;
755
+ const _ = m.get(P);
756
+ _ && _.savedCss === null && (_.savedCss = P.style.cssText);
688
757
  } else
689
- I = A, $e(I, re);
690
- k.from || L(a);
691
- const J = F ? ++O : 0;
692
- F && (x.set(H, J), x.set(A, J));
693
- const me = Promise.resolve(I), ve = Promise.resolve(H), ge = [], He = {
694
- from: me,
695
- to: ve,
696
- context: re,
697
- createElement: ((q, se = "div") => {
698
- const V = document.createElement(se);
699
- return V.setAttribute("data-ssgoi-id", q), ge.push(V), V;
758
+ z = T, nt(z, pe);
759
+ W.from || B(a);
760
+ const ie = X ? ++O : 0;
761
+ X && (S.set(P, ie), S.set(T, ie));
762
+ const Pe = Promise.resolve(z), xe = Promise.resolve(P), Re = [], Ye = {
763
+ from: Pe,
764
+ to: xe,
765
+ context: pe,
766
+ createElement: ((_, me = "div") => {
767
+ const Z = document.createElement(me);
768
+ return Z.setAttribute("data-ssgoi-id", _), Re.push(Z), Z;
700
769
  })
701
- }, Ie = Promise.resolve(
702
- r.prepare ? r.prepare(He) : {}
703
- );
704
- Ke({
705
- from: me,
706
- to: ve,
707
- extras: Ie
708
- }).then(({ from: q, to: se, extras: V }) => {
709
- !F && $ && (U && $.contains(U) ? $.insertBefore(I, U) : $.appendChild(I));
710
- const ie = r.animation({
711
- from: q,
712
- to: se,
713
- context: re,
714
- ...V
715
- }), le = ie.onComplete;
716
- ie.onComplete = () => {
717
- le == null || le(), F ? (_(A, J), _(H, J)) : I.parentNode && I.parentNode.removeChild(I);
718
- for (const ce of ge)
719
- ce.parentNode && ce.parentNode.removeChild(ce);
720
- }, c.attach(ie);
721
- });
722
- }, B = (r, l, a) => {
723
- const T = u.isSwipeBack();
724
- p.arrive(r, l, a).then((d) => {
725
- var H, oe, F, $;
726
- if (l === "in" && u.onPageEnter(), !d) {
727
- l === "out" && W(a);
770
+ }, je = R(t.scrollLock !== !1);
771
+ let he = !1;
772
+ const q = () => {
773
+ if (!he) {
774
+ he = !0, clearTimeout(Me), K.delete(q), M === q && (M = void 0);
775
+ try {
776
+ X ? (L(T, ie), L(P, ie)) : z.parentNode && z.parentNode.removeChild(z);
777
+ for (const _ of Re)
778
+ _.parentNode && _.parentNode.removeChild(_);
779
+ } finally {
780
+ je();
781
+ }
782
+ }
783
+ };
784
+ K.add(q), M == null || M(), M = q;
785
+ const ye = (_) => {
786
+ q(), console.error("[SSGOI] Page transition failed", _);
787
+ }, Me = setTimeout(() => {
788
+ ye(new Error("Page transition preparation timed out"));
789
+ }, Tt);
790
+ let Oe;
791
+ try {
792
+ Oe = Promise.resolve(
793
+ r.prepare ? r.prepare(Ye) : {}
794
+ );
795
+ } catch (_) {
796
+ ye(_);
797
+ return;
798
+ }
799
+ st({
800
+ from: Pe,
801
+ to: xe,
802
+ extras: Oe
803
+ }).then(({ from: _, to: me, extras: Z }) => {
804
+ if (he) return;
805
+ clearTimeout(Me), M === q && (M = void 0), !X && $ && (V && $.contains(V) ? $.insertBefore(z, V) : $.appendChild(z));
806
+ const ve = r.animation({
807
+ from: _,
808
+ to: me,
809
+ context: pe,
810
+ ...Z
811
+ }), ge = ve.onComplete;
812
+ ve.onComplete = () => {
813
+ try {
814
+ ge == null || ge();
815
+ } finally {
816
+ q();
817
+ }
818
+ }, c.attach(ve);
819
+ }).catch(ye);
820
+ }, oe = (r, l, a) => {
821
+ if (ne) return;
822
+ const C = U, v = h.isSwipeBack();
823
+ u.arrive(r, l, a).then((E) => {
824
+ var fe, X, $, V;
825
+ if (ne || C !== U) return;
826
+ if (l === "in" && h.onPageEnter(), !E) {
827
+ l === "out" && H(a);
728
828
  return;
729
829
  }
730
830
  if (l !== "in") return;
731
- const { from: S, to: k } = o(
732
- d.from,
733
- d.to
734
- ), A = i.resolve(
735
- d.from,
736
- d.to,
737
- (U) => Fe(
738
- S,
739
- k,
740
- E(),
741
- U
831
+ const { from: W, to: T } = o(
832
+ E.from,
833
+ E.to
834
+ ), P = i.resolve(
835
+ E.from,
836
+ E.to,
837
+ (Y) => Qe(
838
+ W,
839
+ T,
840
+ F(),
841
+ Y
742
842
  )
743
843
  );
744
- if (!A) {
745
- (oe = (H = d.in).applyScrollPolicy) == null || oe.call(H, !1), L(d.from), W(d.out, d.in);
844
+ if (!P) {
845
+ (X = (fe = E.in).applyScrollPolicy) == null || X.call(fe, !1), B(E.from), H(E.out, E.in), M == null || M(), c.complete();
746
846
  return;
747
847
  }
748
- if (($ = (F = d.in).applyScrollPolicy) == null || $.call(F, A.preserveScroll.to), T) {
749
- A.preserveScroll.from || L(d.from), W(d.out, d.in);
848
+ if ((V = ($ = E.in).applyScrollPolicy) == null || V.call($, P.preserveScroll.to), v) {
849
+ P.preserveScroll.from || B(E.from), H(E.out, E.in), M == null || M(), c.complete();
750
850
  return;
751
851
  }
752
- K(
753
- A.transition,
754
- A.direction,
755
- d.from,
756
- d.to,
757
- d.out,
758
- d.in,
759
- A.preserveScroll
852
+ Ge(
853
+ P.transition,
854
+ P.direction,
855
+ E.from,
856
+ E.to,
857
+ E.out,
858
+ E.in,
859
+ P.preserveScroll
760
860
  );
761
861
  });
762
- }, fe = (r, l) => {
763
- const a = w.get(r);
862
+ }, $e = (r, l) => {
863
+ const a = m.get(r);
764
864
  if (!a) return;
765
- const T = a.intent === "hidden";
766
- if (a.intent = "hidden", a.savedCss === null && (a.savedCss = r.style.cssText), a.vis.setDisplay(a.computedDisplay || "block", !0), r.style.position = "absolute", r.style.width = "100%", r.style.left = "0", T) return;
767
- const d = b(r), S = {
865
+ const C = a.intent === "hidden";
866
+ if (a.intent = "hidden", a.savedCss === null && (a.savedCss = r.style.cssText), a.vis.setDisplay(a.computedDisplay || "block", !0), r.style.position = "absolute", r.style.width = "100%", r.style.left = "0", C) return;
867
+ const v = te(r), E = {
768
868
  element: r,
769
- parent: d.parent,
770
- nextSibling: d.nextSibling,
869
+ parent: v.parent,
870
+ nextSibling: v.nextSibling,
771
871
  mode: "hidden"
772
- }, k = a.pendingOutPath ?? a.currentPath ?? l;
773
- a.pendingOutPath = null, B(k, "out", S);
774
- }, De = (r, l) => {
775
- const a = w.get(r);
872
+ }, W = a.pendingOutPath ?? a.currentPath ?? l;
873
+ a.pendingOutPath = null, oe(W, "out", E);
874
+ }, qe = (r, l) => {
875
+ const a = m.get(r);
776
876
  if (!a || a.intent === "visible") return;
777
- a.intent = "visible", a.currentPath = r.getAttribute("data-ssgoi-transition") ?? a.currentPath ?? l, a.pendingOutPath = null, a.pathRevision++, R(r, a), a.savedCss !== null && (r.style.cssText = a.savedCss, a.visibleDisplay ? a.vis.setDisplay(a.visibleDisplay, !1) : a.vis.setDisplay(null));
778
- const T = a.currentPath, d = P(r, T), S = {
877
+ a.intent = "visible", a.currentPath = r.getAttribute("data-ssgoi-transition") ?? a.currentPath ?? l, a.pendingOutPath = null, a.pathRevision++, N(r, a), a.savedCss !== null && (r.style.cssText = a.savedCss, a.visibleDisplay ? a.vis.setDisplay(a.visibleDisplay, !1) : a.vis.setDisplay(null));
878
+ const C = a.currentPath, v = g(r, C), E = {
779
879
  element: r,
780
880
  parent: r.parentElement,
781
881
  nextSibling: r.nextElementSibling,
782
- applyScrollPolicy: d
882
+ applyScrollPolicy: v
783
883
  };
784
- B(T, "in", S);
785
- }, Ne = (r, l, a, T = !0) => {
786
- const d = w.get(r), S = (d == null ? void 0 : d.pendingOutPath) ?? (d == null ? void 0 : d.currentPath) ?? l;
787
- if (d && (d.vis.stop(), w.delete(r), x.delete(r), d.intent === "hidden")) {
788
- p.cancel((H) => H.element === r);
884
+ oe(C, "in", E);
885
+ }, Ve = (r, l, a, C = !0) => {
886
+ const v = m.get(r);
887
+ se.delete(r);
888
+ const E = (v == null ? void 0 : v.pendingOutPath) ?? (v == null ? void 0 : v.currentPath) ?? l;
889
+ if (v && (v.vis.stop(), re.delete(v.vis), m.delete(r), S.delete(r), v.intent === "hidden")) {
890
+ u.cancel((P) => P.element === r);
789
891
  return;
790
892
  }
791
- if (!T) return;
792
- const k = a ?? b(r), A = {
893
+ if (!C) return;
894
+ const W = a ?? te(r), T = {
793
895
  element: r,
794
- parent: k.parent,
795
- nextSibling: k.nextSibling,
896
+ parent: W.parent,
897
+ nextSibling: W.nextSibling,
796
898
  mode: "unmount"
797
899
  };
798
- B(S, "out", A);
799
- }, pe = /* @__PURE__ */ new WeakSet(), he = (r, l, { enter: a = !0 } = {}) => {
800
- if (i.connect(), pe.has(l)) {
801
- const S = w.get(l);
802
- if (S && S.currentPath !== r) {
803
- S.intent === "visible" && S.pendingOutPath === null && (S.pendingOutPath = S.currentPath), S.currentPath = r;
804
- const k = ++S.pathRevision;
900
+ oe(E, "out", T);
901
+ };
902
+ let de = /* @__PURE__ */ new WeakSet();
903
+ const re = /* @__PURE__ */ new Set(), se = /* @__PURE__ */ new Map(), ke = (r, l, { enter: a = !0 } = {}) => {
904
+ if (ne = !1, i.connect(), h.initialize(), de.has(l)) {
905
+ const T = m.get(l);
906
+ if (T && T.currentPath !== r) {
907
+ T.intent === "visible" && T.pendingOutPath === null && (T.pendingOutPath = T.currentPath), T.currentPath = r;
908
+ const P = ++T.pathRevision;
805
909
  queueMicrotask(() => {
806
- S.pathRevision === k && (S.pendingOutPath = null);
910
+ T.pathRevision === P && (T.pendingOutPath = null);
807
911
  });
808
912
  }
809
913
  return;
810
914
  }
811
- pe.add(l), D(l);
812
- const T = at(l, {
813
- onHide: () => fe(l, r),
814
- onShow: () => De(l, r)
815
- }), d = {
816
- vis: T,
915
+ de.add(l);
916
+ const C = U;
917
+ ee(l);
918
+ const v = kt(l, {
919
+ onHide: () => $e(l, r),
920
+ onShow: () => qe(l, r)
921
+ });
922
+ re.add(v);
923
+ const E = {
924
+ vis: v,
817
925
  savedCss: null,
818
- intent: T.isHidden ? "hidden" : "visible",
926
+ intent: v.isHidden ? "hidden" : "visible",
819
927
  visibleDisplay: "",
820
928
  computedDisplay: "block",
821
929
  currentPath: r,
822
930
  pendingOutPath: null,
823
931
  pathRevision: 0
824
932
  };
825
- if (w.set(l, d), !T.isHidden && (R(l, d), a)) {
826
- const S = P(l, r), k = {
933
+ if (m.set(l, E), !v.isHidden && (N(l, E), a)) {
934
+ const T = g(l, r), P = {
827
935
  element: l,
828
936
  parent: l.parentElement,
829
937
  nextSibling: l.nextElementSibling,
830
- applyScrollPolicy: S
938
+ applyScrollPolicy: T
831
939
  };
832
- B(r, "in", k);
940
+ oe(r, "in", P);
833
941
  }
834
- lt(
942
+ const W = Et(
835
943
  l,
836
- (S, k) => Ne(l, r, S, (k == null ? void 0 : k.emit) ?? !0),
944
+ (T, P) => {
945
+ C === U && Ve(l, r, T, (P == null ? void 0 : P.emit) ?? !0);
946
+ },
837
947
  s
838
948
  );
839
- }, ye = /* @__PURE__ */ new Map();
840
- return { register: he, refFor: (r) => {
841
- let l = ye.get(r);
842
- return l || (l = (a) => {
843
- a && he(r, a);
844
- }, ye.set(r, l)), l;
845
- }, disconnect: i.dispose };
949
+ se.set(l, W);
950
+ }, Te = /* @__PURE__ */ new Map();
951
+ return {
952
+ register: ke,
953
+ refFor: (r) => {
954
+ let l = Te.get(r);
955
+ return l || (l = (a) => {
956
+ a && ke(r, a);
957
+ }, Te.set(r, l)), l;
958
+ },
959
+ disconnect() {
960
+ ne = !0, U++, u.cancel(() => !0);
961
+ try {
962
+ c.complete();
963
+ } finally {
964
+ for (const r of K) r();
965
+ for (const r of re) r.stop();
966
+ re.clear();
967
+ for (const r of se.values()) r();
968
+ se.clear(), de = /* @__PURE__ */ new WeakSet(), I(), h.destroy(), i.dispose();
969
+ }
970
+ }
971
+ };
846
972
  }
847
- const Le = "data-ssgoi-root", ut = `[${Le}]`, ne = "data-ssgoi-transition", Me = `[${ne}]`, dt = "[data-ssgoi-clone]";
848
- function ft() {
973
+ const Xe = "data-ssgoi-root", Pt = `[${Xe}]`, ue = "data-ssgoi-transition", Be = `[${ue}]`, xt = "[data-ssgoi-clone]";
974
+ function Rt() {
849
975
  return typeof MutationObserver < "u" && typeof HTMLElement < "u" && typeof Node < "u";
850
976
  }
851
- function pt(n) {
852
- return n.nodeType === Node.ELEMENT_NODE;
977
+ function Mt(t) {
978
+ return t.nodeType === Node.ELEMENT_NODE;
853
979
  }
854
- function ht(n) {
855
- return n instanceof HTMLElement;
980
+ function Ot(t) {
981
+ return t instanceof HTMLElement;
856
982
  }
857
- function Oe(n) {
858
- let t = 0, e = n.parentElement;
983
+ function Fe(t) {
984
+ let n = 0, e = t.parentElement;
859
985
  for (; e; )
860
- t++, e = e.parentElement;
861
- return t;
986
+ n++, e = e.parentElement;
987
+ return n;
862
988
  }
863
- function Ce(n, t, e = n) {
864
- const o = Array.from(n).sort(
865
- (c, s) => Oe(c) - Oe(s)
989
+ function ze(t, n, e = t) {
990
+ const o = Array.from(t).sort(
991
+ (c, s) => Fe(c) - Fe(s)
866
992
  );
867
993
  for (const c of o) {
868
- const s = c.getAttribute(ne);
994
+ const s = c.getAttribute(ue);
869
995
  if (s === null) continue;
870
- let p = c.parentElement, i = !1;
871
- for (; p; ) {
872
- if (e.has(p)) {
996
+ let u = c.parentElement, i = !1;
997
+ for (; u; ) {
998
+ if (e.has(u)) {
873
999
  i = !0;
874
1000
  break;
875
1001
  }
876
- p = p.parentElement;
1002
+ u = u.parentElement;
877
1003
  }
878
- t.register(s, c, { enter: !i });
1004
+ n.register(s, c, { enter: !i });
879
1005
  }
880
1006
  }
881
- function Et(n, t) {
882
- if (!ft()) return () => {
1007
+ function Ht(t, n) {
1008
+ if (!Rt()) return () => {
883
1009
  };
884
- n.setAttribute(Le, "");
885
- const e = (i) => i.closest(ut) === n, o = (i) => !ht(i) || !e(i) || i.closest(dt) || i.getAttribute(ne) === null ? null : i, c = (i, y) => {
886
- if (pt(i)) {
887
- if (i.matches(Me)) {
888
- const u = o(i);
889
- u && y.add(u);
1010
+ t.setAttribute(Xe, "");
1011
+ const e = (i) => i.closest(Pt) === t, o = (i) => !Ot(i) || !e(i) || i.closest(xt) || i.getAttribute(ue) === null ? null : i, c = (i, y) => {
1012
+ if (Mt(i)) {
1013
+ if (i.matches(Be)) {
1014
+ const h = o(i);
1015
+ h && y.add(h);
890
1016
  }
891
- for (const u of i.querySelectorAll(Me)) {
892
- const m = o(u);
893
- m && y.add(m);
1017
+ for (const h of i.querySelectorAll(Be)) {
1018
+ const f = o(h);
1019
+ f && y.add(f);
894
1020
  }
895
1021
  }
896
1022
  }, s = new MutationObserver((i) => {
897
- const y = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
898
- for (const m of i) {
899
- if (m.type === "attributes") {
900
- const h = o(m.target);
901
- h && y.add(h);
1023
+ const y = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set();
1024
+ for (const f of i) {
1025
+ if (f.type === "attributes") {
1026
+ const d = o(f.target);
1027
+ d && y.add(d);
902
1028
  continue;
903
1029
  }
904
- for (const h of m.addedNodes)
905
- c(h, u);
1030
+ for (const d of f.addedNodes)
1031
+ c(d, h);
906
1032
  }
907
- for (const m of u) y.add(m);
908
- Ce(y, t, u);
1033
+ for (const f of h) y.add(f);
1034
+ ze(y, n, h);
909
1035
  });
910
- s.observe(n, {
1036
+ s.observe(t, {
911
1037
  childList: !0,
912
1038
  subtree: !0,
913
1039
  attributes: !0,
914
- attributeFilter: [ne]
1040
+ attributeFilter: [ue]
915
1041
  });
916
- const p = /* @__PURE__ */ new Set();
917
- return c(n, p), Ce(p, t), () => {
1042
+ const u = /* @__PURE__ */ new Set();
1043
+ return c(t, u), ze(u, n), () => {
918
1044
  var i;
919
- s.disconnect(), (i = t.disconnect) == null || i.call(t);
1045
+ s.disconnect(), (i = n.disconnect) == null || i.call(n);
920
1046
  };
921
1047
  }
922
1048
  export {
923
- ze as Animation,
924
- Xe as HostAnimation,
925
- Tt as MultiAnimation,
926
- kt as WebAnimation,
927
- wt as createSggoiTransitionContext,
928
- Et as observeSsgoiTransitions,
929
- Rt as simulate
1049
+ et as Animation,
1050
+ tt as HostAnimation,
1051
+ Bt as MultiAnimation,
1052
+ Ft as WebAnimation,
1053
+ Nt as createSggoiTransitionContext,
1054
+ Ht as observeSsgoiTransitions,
1055
+ Kt as simulate
930
1056
  };