@ssgoi/core 7.0.0 → 7.0.1-beta.0

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