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