@react-motion-router/stack 2.0.0-beta.sha-20ff5ff → 2.0.0-beta.sha-112968d

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/build/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { NavigationBase as ht, resolveBaseURLFromPattern as dt, matchRoute as Y, ScreenBase as ft, RouterBase as vt, cloneAndInject as gt, includesRoute as pt, useNavigationBase as mt, useRouterBase as yt, useRouteBase as wt, useParamsBase as Et } from "@react-motion-router/core";
2
- import { createRef as Pt, startTransition as N, useDebugValue as j, useEffect as C, useState as St, useRef as $, useCallback as bt } from "react";
3
- import { GestureTimeline as Lt, springToLinear as _t, easingToLinear as A } from "web-animations-extension";
4
- import { jsx as ut } from "react/jsx-runtime";
5
- var g = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Tt = {}, T = {};
1
+ import { NavigationBase as gt, resolveBaseURLFromPattern as pt, matchRoute as X, LAST_INDEX as k, FIRST_INDEX as U, SINGLE_ELEMENT_LENGTH as R, ScreenBase as mt, RouterBase as yt, cloneAndInject as wt, useNavigationBase as Et, useRouterBase as Pt, useRouteBase as St, useParamsBase as bt } from "@react-motion-router/core";
2
+ import { createRef as _t, startTransition as $, useDebugValue as H, useEffect as j, useState as Lt, useRef as q, useCallback as dt } from "react";
3
+ import { GestureTimeline as Tt, springToLinear as Rt, easingToLinear as z } from "web-animations-extension";
4
+ import { jsx as ft } from "react/jsx-runtime";
5
+ var g = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, kt = {}, T = {};
6
6
  Object.defineProperty(T, "__esModule", { value: !0 });
7
- var rt;
7
+ var ot;
8
8
  (function(n) {
9
9
  n[n.tap = 0] = "tap", n[n.longpress = 1] = "longpress", n[n.pinchstart = 2] = "pinchstart", n[n.pinch = 3] = "pinch", n[n.pinchend = 4] = "pinchend", n[n.rotatestart = 5] = "rotatestart", n[n.rotate = 6] = "rotate", n[n.rotateend = 7] = "rotateend", n[n.swipestart = 8] = "swipestart", n[n.swipe = 9] = "swipe", n[n.swipeend = 10] = "swipeend", n[n.panstart = 11] = "panstart", n[n.pan = 12] = "pan", n[n.panend = 13] = "panend", n[n.doubletap = 14] = "doubletap";
10
- })(rt || (rt = {}));
11
- class Rt extends TouchEvent {
10
+ })(ot || (ot = {}));
11
+ class It extends TouchEvent {
12
12
  constructor(t, e) {
13
13
  if (super(t, {
14
14
  touches: Array.from(e.touches),
@@ -27,108 +27,108 @@ class Rt extends TouchEvent {
27
27
  this.gestureTarget = e.touches[0].target, this.x = e.touches[0].clientX, this.y = e.touches[0].clientY;
28
28
  }
29
29
  }
30
- T.default = Rt;
31
- var W = {}, kt = g && g.__importDefault || function(n) {
30
+ T.default = It;
31
+ var Z = {}, xt = g && g.__importDefault || function(n) {
32
32
  return n && n.__esModule ? n : { default: n };
33
33
  };
34
- Object.defineProperty(W, "__esModule", { value: !0 });
35
- const It = kt(T);
36
- class xt extends It.default {
34
+ Object.defineProperty(Z, "__esModule", { value: !0 });
35
+ const Ft = xt(T);
36
+ class Ot extends Ft.default {
37
37
  constructor(t, e) {
38
38
  super("longpress", t), this.duration = 0, this.duration = e;
39
39
  }
40
40
  }
41
- W.default = xt;
42
- var q = {}, Ft = g && g.__importDefault || function(n) {
41
+ Z.default = Ot;
42
+ var J = {}, Dt = g && g.__importDefault || function(n) {
43
43
  return n && n.__esModule ? n : { default: n };
44
44
  };
45
- Object.defineProperty(q, "__esModule", { value: !0 });
46
- const Ot = Ft(T);
47
- class Dt extends Ot.default {
45
+ Object.defineProperty(J, "__esModule", { value: !0 });
46
+ const Mt = Dt(T);
47
+ class Kt extends Mt.default {
48
48
  constructor(t) {
49
49
  super("tap", t), this.duration = 0;
50
50
  }
51
51
  }
52
- q.default = Dt;
53
- var G = {}, Kt = g && g.__importDefault || function(n) {
52
+ J.default = Kt;
53
+ var Q = {}, Bt = g && g.__importDefault || function(n) {
54
54
  return n && n.__esModule ? n : { default: n };
55
55
  };
56
- Object.defineProperty(G, "__esModule", { value: !0 });
57
- const Mt = Kt(T);
58
- class Bt extends Mt.default {
56
+ Object.defineProperty(Q, "__esModule", { value: !0 });
57
+ const Yt = Bt(T);
58
+ class Ct extends Yt.default {
59
59
  constructor(t) {
60
60
  super("doubletap", t);
61
61
  }
62
62
  }
63
- G.default = Bt;
64
- var F = {}, Yt = g && g.__importDefault || function(n) {
63
+ Q.default = Ct;
64
+ var D = {}, Xt = g && g.__importDefault || function(n) {
65
65
  return n && n.__esModule ? n : { default: n };
66
66
  };
67
- Object.defineProperty(F, "__esModule", { value: !0 });
68
- F.SwipeEndEvent = F.SwipeStartEvent = void 0;
69
- const Ct = Yt(T);
70
- var st;
67
+ Object.defineProperty(D, "__esModule", { value: !0 });
68
+ D.SwipeEndEvent = D.SwipeStartEvent = void 0;
69
+ const Ut = Xt(T);
70
+ var ct;
71
71
  (function(n) {
72
72
  n[n.start = 0] = "start", n[n.end = 1] = "end";
73
- })(st || (st = {}));
74
- class z extends Ct.default {
75
- constructor(t, e, r) {
76
- let s;
77
- switch (r) {
73
+ })(ct || (ct = {}));
74
+ class tt extends Ut.default {
75
+ constructor(t, e, s) {
76
+ let r;
77
+ switch (s) {
78
78
  case "start":
79
- s = "swipestart";
79
+ r = "swipestart";
80
80
  break;
81
81
  case "end":
82
- s = "swipeend";
82
+ r = "swipeend";
83
83
  break;
84
84
  default:
85
- s = "swipe";
85
+ r = "swipe";
86
86
  }
87
- super(s, t), this.velocity = e.velocity, this.direction = e.direction;
87
+ super(r, t), this.velocity = e.velocity, this.direction = e.direction;
88
88
  }
89
89
  }
90
- class Xt extends z {
90
+ class Nt extends tt {
91
91
  constructor(t, e) {
92
92
  super(t, e);
93
93
  }
94
94
  }
95
- F.default = Xt;
96
- class jt extends z {
95
+ D.default = Nt;
96
+ class jt extends tt {
97
97
  constructor(t, e) {
98
98
  super(t, e, "start");
99
99
  }
100
100
  }
101
- F.SwipeStartEvent = jt;
102
- class Ut extends z {
101
+ D.SwipeStartEvent = jt;
102
+ class Ht extends tt {
103
103
  constructor(t, e) {
104
104
  super(t, e, "end");
105
105
  }
106
106
  }
107
- F.SwipeEndEvent = Ut;
108
- var O = {}, Ht = g && g.__importDefault || function(n) {
107
+ D.SwipeEndEvent = Ht;
108
+ var M = {}, At = g && g.__importDefault || function(n) {
109
109
  return n && n.__esModule ? n : { default: n };
110
110
  };
111
- Object.defineProperty(O, "__esModule", { value: !0 });
112
- O.PanEndEvent = O.PanStartEvent = void 0;
113
- const Nt = Ht(T);
114
- var it;
111
+ Object.defineProperty(M, "__esModule", { value: !0 });
112
+ M.PanEndEvent = M.PanStartEvent = void 0;
113
+ const Vt = At(T);
114
+ var ut;
115
115
  (function(n) {
116
116
  n[n.start = 0] = "start", n[n.end = 1] = "end";
117
- })(it || (it = {}));
118
- class Z extends Nt.default {
119
- constructor(t, e, r) {
120
- let s;
121
- switch (r) {
117
+ })(ut || (ut = {}));
118
+ class et extends Vt.default {
119
+ constructor(t, e, s) {
120
+ let r;
121
+ switch (s) {
122
122
  case "start":
123
- s = "panstart";
123
+ r = "panstart";
124
124
  break;
125
125
  case "end":
126
- s = "panend";
126
+ r = "panend";
127
127
  break;
128
128
  default:
129
- s = "pan";
129
+ r = "pan";
130
130
  }
131
- super(s, t), this.velocity = e.velocity, this.translation = {
131
+ super(r, t), this.velocity = e.velocity, this.translation = {
132
132
  x: e.translation.x,
133
133
  y: e.translation.y,
134
134
  magnitude: e.translation.magnitude,
@@ -138,95 +138,95 @@ class Z extends Nt.default {
138
138
  };
139
139
  }
140
140
  }
141
- class Vt extends Z {
141
+ class $t extends et {
142
142
  constructor(t, e) {
143
143
  super(t, e);
144
144
  }
145
145
  }
146
- O.default = Vt;
147
- class $t extends Z {
146
+ M.default = $t;
147
+ class Wt extends et {
148
148
  constructor(t, e) {
149
149
  super(t, e, "start");
150
150
  }
151
151
  }
152
- O.PanStartEvent = $t;
153
- class At extends Z {
152
+ M.PanStartEvent = Wt;
153
+ class Gt extends et {
154
154
  constructor(t, e) {
155
155
  super(t, e, "end");
156
156
  }
157
157
  }
158
- O.PanEndEvent = At;
159
- var D = {}, Wt = g && g.__importDefault || function(n) {
158
+ M.PanEndEvent = Gt;
159
+ var K = {}, qt = g && g.__importDefault || function(n) {
160
160
  return n && n.__esModule ? n : { default: n };
161
161
  };
162
- Object.defineProperty(D, "__esModule", { value: !0 });
163
- D.PinchEndEvent = D.PinchStartEvent = void 0;
164
- const qt = Wt(T);
165
- var at;
162
+ Object.defineProperty(K, "__esModule", { value: !0 });
163
+ K.PinchEndEvent = K.PinchStartEvent = void 0;
164
+ const zt = qt(T);
165
+ var lt;
166
166
  (function(n) {
167
167
  n[n.start = 0] = "start", n[n.end = 1] = "end";
168
- })(at || (at = {}));
169
- class J extends qt.default {
170
- constructor(t, e, r) {
171
- let s;
172
- switch (r) {
168
+ })(lt || (lt = {}));
169
+ class nt extends zt.default {
170
+ constructor(t, e, s) {
171
+ let r;
172
+ switch (s) {
173
173
  case "start":
174
- s = "pinchstart";
174
+ r = "pinchstart";
175
175
  break;
176
176
  case "end":
177
- s = "pinchend";
177
+ r = "pinchend";
178
178
  break;
179
179
  default:
180
- s = "pinch";
180
+ r = "pinch";
181
181
  }
182
- super(s, t), Object.defineProperty(this, "scale", {
182
+ super(r, t), Object.defineProperty(this, "scale", {
183
183
  value: e.scale,
184
184
  writable: !1
185
185
  });
186
186
  }
187
187
  }
188
- class Gt extends J {
188
+ class Zt extends nt {
189
189
  constructor(t, e) {
190
190
  super(t, e);
191
191
  }
192
192
  }
193
- D.default = Gt;
194
- class zt extends J {
193
+ K.default = Zt;
194
+ class Jt extends nt {
195
195
  constructor(t, e) {
196
196
  super(t, e, "start");
197
197
  }
198
198
  }
199
- D.PinchStartEvent = zt;
200
- class Zt extends J {
199
+ K.PinchStartEvent = Jt;
200
+ class Qt extends nt {
201
201
  constructor(t, e) {
202
202
  super(t, e, "end");
203
203
  }
204
204
  }
205
- D.PinchEndEvent = Zt;
206
- var K = {}, Jt = g && g.__importDefault || function(n) {
205
+ K.PinchEndEvent = Qt;
206
+ var B = {}, te = g && g.__importDefault || function(n) {
207
207
  return n && n.__esModule ? n : { default: n };
208
208
  };
209
- Object.defineProperty(K, "__esModule", { value: !0 });
210
- K.RotateEndEvent = K.RotateStartEvent = void 0;
211
- const Qt = Jt(T);
212
- var ot;
209
+ Object.defineProperty(B, "__esModule", { value: !0 });
210
+ B.RotateEndEvent = B.RotateStartEvent = void 0;
211
+ const ee = te(T);
212
+ var ht;
213
213
  (function(n) {
214
214
  n[n.start = 0] = "start", n[n.end = 1] = "end";
215
- })(ot || (ot = {}));
216
- class Q extends Qt.default {
217
- constructor(t, e, r) {
218
- let s;
219
- switch (r) {
215
+ })(ht || (ht = {}));
216
+ class st extends ee.default {
217
+ constructor(t, e, s) {
218
+ let r;
219
+ switch (s) {
220
220
  case "start":
221
- s = "rotatestart";
221
+ r = "rotatestart";
222
222
  break;
223
223
  case "end":
224
- s = "rotateend";
224
+ r = "rotateend";
225
225
  break;
226
226
  default:
227
- s = "rotate";
227
+ r = "rotate";
228
228
  }
229
- super(s, t), this.anchor = {
229
+ super(r, t), this.anchor = {
230
230
  x: e.anchor.x,
231
231
  y: e.anchor.y,
232
232
  clientX: e.anchor.clientX,
@@ -237,33 +237,33 @@ class Q extends Qt.default {
237
237
  }), this.rotationDeg = e.rotationDeg;
238
238
  }
239
239
  }
240
- class te extends Q {
240
+ class ne extends st {
241
241
  constructor(t, e) {
242
242
  super(t, e);
243
243
  }
244
244
  }
245
- K.default = te;
246
- class ee extends Q {
245
+ B.default = ne;
246
+ class se extends st {
247
247
  constructor(t, e) {
248
248
  super(t, e, "start");
249
249
  }
250
250
  }
251
- K.RotateStartEvent = ee;
252
- class ne extends Q {
251
+ B.RotateStartEvent = se;
252
+ class re extends st {
253
253
  constructor(t, e) {
254
254
  super(t, e, "end");
255
255
  }
256
256
  }
257
- K.RotateEndEvent = ne;
258
- var R = {};
259
- Object.defineProperty(R, "__esModule", { value: !0 });
260
- R.closest = R.Vec2 = R.assert = void 0;
261
- function re(n, t) {
257
+ B.RotateEndEvent = re;
258
+ var I = {};
259
+ Object.defineProperty(I, "__esModule", { value: !0 });
260
+ I.closest = I.Vec2 = I.assert = void 0;
261
+ function ie(n, t) {
262
262
  if (!n)
263
263
  throw new Error(t);
264
264
  }
265
- R.assert = re;
266
- class se {
265
+ I.assert = ie;
266
+ class ae {
267
267
  constructor(t, e) {
268
268
  this._x = 0, this._y = 0, this._clientX = 0, this._clientY = 0, this._clientX = t, this._clientY = e, this._x = this.translateX(t), this._y = this.translateY(e);
269
269
  }
@@ -307,82 +307,82 @@ class se {
307
307
  return Math.sqrt(Math.pow(this._clientX, 2) + Math.pow(this._clientY, 2));
308
308
  }
309
309
  }
310
- R.Vec2 = se;
311
- function ie(n, t) {
312
- return t.reduce((e, r) => {
313
- let s = Math.abs(e - n), i = Math.abs(r - n);
314
- return s === i ? e > r ? e : r : i < s ? r : e;
310
+ I.Vec2 = ae;
311
+ function oe(n, t) {
312
+ return t.reduce((e, s) => {
313
+ let r = Math.abs(e - n), i = Math.abs(s - n);
314
+ return r === i ? e > s ? e : s : i < r ? s : e;
315
315
  });
316
316
  }
317
- R.closest = ie;
317
+ I.closest = oe;
318
318
  (function(n) {
319
- var t = g && g.__createBinding || (Object.create ? function(u, a, h, m) {
320
- m === void 0 && (m = h), Object.defineProperty(u, m, { enumerable: !0, get: function() {
321
- return a[h];
319
+ var t = g && g.__createBinding || (Object.create ? function(l, a, f, P) {
320
+ P === void 0 && (P = f), Object.defineProperty(l, P, { enumerable: !0, get: function() {
321
+ return a[f];
322
322
  } });
323
- } : function(u, a, h, m) {
324
- m === void 0 && (m = h), u[m] = a[h];
325
- }), e = g && g.__setModuleDefault || (Object.create ? function(u, a) {
326
- Object.defineProperty(u, "default", { enumerable: !0, value: a });
327
- } : function(u, a) {
328
- u.default = a;
329
- }), r = g && g.__importStar || function(u) {
330
- if (u && u.__esModule)
331
- return u;
323
+ } : function(l, a, f, P) {
324
+ P === void 0 && (P = f), l[P] = a[f];
325
+ }), e = g && g.__setModuleDefault || (Object.create ? function(l, a) {
326
+ Object.defineProperty(l, "default", { enumerable: !0, value: a });
327
+ } : function(l, a) {
328
+ l.default = a;
329
+ }), s = g && g.__importStar || function(l) {
330
+ if (l && l.__esModule)
331
+ return l;
332
332
  var a = {};
333
- if (u != null)
334
- for (var h in u)
335
- h !== "default" && Object.prototype.hasOwnProperty.call(u, h) && t(a, u, h);
336
- return e(a, u), a;
337
- }, s = g && g.__importDefault || function(u) {
338
- return u && u.__esModule ? u : { default: u };
333
+ if (l != null)
334
+ for (var f in l)
335
+ f !== "default" && Object.prototype.hasOwnProperty.call(l, f) && t(a, l, f);
336
+ return e(a, l), a;
337
+ }, r = g && g.__importDefault || function(l) {
338
+ return l && l.__esModule ? l : { default: l };
339
339
  };
340
340
  Object.defineProperty(n, "__esModule", { value: !0 }), n.RotateEndEvent = n.RotateEvent = n.RotateStartEvent = n.PinchEndEvent = n.PinchEvent = n.PinchStartEvent = n.PanEndEvent = n.PanEvent = n.PanStartEvent = n.SwipeEndEvent = n.SwipeEvent = n.SwipeStartEvent = n.DoubleTapEvent = n.LongPressEvent = n.GestureEvent = n.TapEvent = void 0;
341
- const i = s(T);
341
+ const i = r(T);
342
342
  n.GestureEvent = i.default;
343
- const o = s(W);
343
+ const o = r(Z);
344
344
  n.LongPressEvent = o.default;
345
- const c = s(q);
345
+ const c = r(J);
346
346
  n.TapEvent = c.default;
347
- const l = s(G);
348
- n.DoubleTapEvent = l.default;
349
- const f = r(F);
350
- n.SwipeEvent = f.default, Object.defineProperty(n, "SwipeEndEvent", { enumerable: !0, get: function() {
351
- return f.SwipeEndEvent;
347
+ const u = r(Q);
348
+ n.DoubleTapEvent = u.default;
349
+ const h = s(D);
350
+ n.SwipeEvent = h.default, Object.defineProperty(n, "SwipeEndEvent", { enumerable: !0, get: function() {
351
+ return h.SwipeEndEvent;
352
352
  } }), Object.defineProperty(n, "SwipeStartEvent", { enumerable: !0, get: function() {
353
- return f.SwipeStartEvent;
353
+ return h.SwipeStartEvent;
354
354
  } });
355
- const d = r(O);
355
+ const d = s(M);
356
356
  n.PanEvent = d.default, Object.defineProperty(n, "PanEndEvent", { enumerable: !0, get: function() {
357
357
  return d.PanEndEvent;
358
358
  } }), Object.defineProperty(n, "PanStartEvent", { enumerable: !0, get: function() {
359
359
  return d.PanStartEvent;
360
360
  } });
361
- const P = r(D);
362
- n.PinchEvent = P.default, Object.defineProperty(n, "PinchEndEvent", { enumerable: !0, get: function() {
363
- return P.PinchEndEvent;
361
+ const w = s(K);
362
+ n.PinchEvent = w.default, Object.defineProperty(n, "PinchEndEvent", { enumerable: !0, get: function() {
363
+ return w.PinchEndEvent;
364
364
  } }), Object.defineProperty(n, "PinchStartEvent", { enumerable: !0, get: function() {
365
- return P.PinchStartEvent;
365
+ return w.PinchStartEvent;
366
366
  } });
367
- const w = r(K);
368
- n.RotateEvent = w.default, Object.defineProperty(n, "RotateEndEvent", { enumerable: !0, get: function() {
369
- return w.RotateEndEvent;
367
+ const E = s(B);
368
+ n.RotateEvent = E.default, Object.defineProperty(n, "RotateEndEvent", { enumerable: !0, get: function() {
369
+ return E.RotateEndEvent;
370
370
  } }), Object.defineProperty(n, "RotateStartEvent", { enumerable: !0, get: function() {
371
- return w.RotateStartEvent;
371
+ return E.RotateStartEvent;
372
372
  } });
373
- const v = R;
373
+ const v = I;
374
374
  var p;
375
- (function(u) {
376
- u[u.right = 0] = "right", u[u.up = 1] = "up", u[u.left = 2] = "left", u[u.down = 3] = "down";
375
+ (function(l) {
376
+ l[l.right = 0] = "right", l[l.up = 1] = "up", l[l.left = 2] = "left", l[l.down = 3] = "down";
377
377
  })(p || (p = {}));
378
- class y {
378
+ class m {
379
379
  constructor() {
380
380
  this.touchStart = new TouchEvent("touchstart") || {}, this.touchMove = new TouchEvent("touchmove") || {}, this.touchEnd = new TouchEvent("touchend") || {}, this.touchCancel = new TouchEvent("touchcancel") || {}, this.velocity = 0, this.dxDy = new v.Vec2(0, 0), this.scale = 1, this.rotation = 0, this.rotationDeg = 0, this.anchor = new v.Vec2(0, 0), this.octant = 0, this.isPanning = !1, this.isPinching = !1, this.isSwiping = !1, this.isRotating = !1, this.touchStartTime = 0, this.touchEndTime = 0, this.lastTouchTime = 0, this.taps = 0, this.scaleBase = 0, this.touchMoved = !1, this.touchDown = !1, this.shouldFire = !1, this.pointers = 0, this.isLongPress = !1, this.longPressTimeout = 0, this.touchStartListener = this.onTouchStart.bind(this), this.touchMoveListener = this.onTouchMove.bind(this), this.touchEndListener = this.onTouchEnd.bind(this), this.touchCancelListener = this.onTouchCancel.bind(this), this.currentTarget = window, this.config = {
381
381
  longPressDuration: 500,
382
382
  tapDelay: 500,
383
383
  minPointers: 1,
384
384
  numberOfTaps: 0
385
- }, y.listening || (TouchEvent && window.addEventListener("touchstart", this.touchStartListener, !0), y.listening = !0);
385
+ }, m.listening || (TouchEvent && window.addEventListener("touchstart", this.touchStartListener, !0), m.listening = !0);
386
386
  }
387
387
  bind(a) {
388
388
  this.unbind(this.currentTarget), a.addEventListener("touchmove", this.touchMoveListener, !0), a.addEventListener("touchend", this.touchEndListener, !0), a.addEventListener("touchcancel", this.touchCancelListener, !0), this.currentTarget = a;
@@ -396,34 +396,34 @@ R.closest = ie;
396
396
  onPointerLeave(a) {
397
397
  if (!a.touches.length) {
398
398
  if (this.isSwiping) {
399
- const h = new f.SwipeEndEvent(a, {
399
+ const f = new h.SwipeEndEvent(a, {
400
400
  velocity: this.velocity,
401
401
  direction: p[(0, v.closest)(this.octant, [0, 1, 2, 3])]
402
402
  });
403
- this.dispatchEvent(h), this.isSwiping = !1;
403
+ this.dispatchEvent(f), this.isSwiping = !1;
404
404
  }
405
405
  if (this.isPanning) {
406
- const h = new d.PanEndEvent(a, {
406
+ const f = new d.PanEndEvent(a, {
407
407
  translation: this.dxDy,
408
408
  velocity: this.velocity
409
409
  });
410
- this.dispatchEvent(h), this.isPanning = !1;
410
+ this.dispatchEvent(f), this.isPanning = !1;
411
411
  }
412
412
  }
413
413
  if (a.touches.length === 1) {
414
414
  if (this.scaleBase = 0, this.isPinching) {
415
- const h = new P.PinchEndEvent(a, {
415
+ const f = new w.PinchEndEvent(a, {
416
416
  scale: this.scale
417
417
  });
418
- this.dispatchEvent(h), this.isPinching = !1;
418
+ this.dispatchEvent(f), this.isPinching = !1;
419
419
  }
420
420
  if (this.isRotating) {
421
- const h = new w.RotateEndEvent(a, {
421
+ const f = new E.RotateEndEvent(a, {
422
422
  rotation: this.rotation,
423
423
  rotationDeg: this.rotationDeg,
424
424
  anchor: this.anchor
425
425
  });
426
- this.dispatchEvent(h), this.isRotating = !1;
426
+ this.dispatchEvent(f), this.isRotating = !1;
427
427
  }
428
428
  }
429
429
  }
@@ -434,21 +434,21 @@ R.closest = ie;
434
434
  }
435
435
  onTouchStart(a) {
436
436
  this.currentTarget !== a.touches[0].target && (this.clean(), this.unbind(this.currentTarget), this.pointers = this.touchEnd.touches.length, this.taps = 0), this.touchStart = a;
437
- const h = parseInt(a.touches[0].target.dataset.minpointers || "0") || this.config.minPointers;
438
- if (this.touchStart.touches.length < h) {
437
+ const f = parseInt(a.touches[0].target.dataset.minpointers || "0") || this.config.minPointers;
438
+ if (this.touchStart.touches.length < f) {
439
439
  this.shouldFire = !1;
440
440
  return;
441
441
  }
442
442
  this.shouldFire = !0, this.touchStartTime = a.timeStamp, this.touchDown = !0, this.pointers || this.bind(a.touches[0].target), this.pointers = this.touchStart.touches.length;
443
- const m = parseFloat(this.currentTarget.dataset.longpressduration || "0") || this.config.longPressDuration;
443
+ const P = parseFloat(this.currentTarget.dataset.longpressduration || "0") || this.config.longPressDuration;
444
444
  if (this.longPressTimeout || (this.longPressTimeout = setTimeout(() => {
445
445
  if (!this.touchMoved && this.touchDown) {
446
- const E = Date.now() - this.touchStartTime, b = new o.default(this.touchStart, E);
446
+ const y = Date.now() - this.touchStartTime, b = new o.default(this.touchStart, y);
447
447
  this.dispatchEvent(b), this.isLongPress = !0, this.longPressTimeout = 0;
448
448
  }
449
- }, m)), this.touchStart.touches.length > 1) {
450
- const E = new v.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), b = new v.Vec2(this.touchStart.touches[1].clientX, this.touchStart.touches[1].clientY);
451
- this.scaleBase = E.substract(b).magnitude;
449
+ }, P)), this.touchStart.touches.length > 1) {
450
+ const y = new v.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), b = new v.Vec2(this.touchStart.touches[1].clientX, this.touchStart.touches[1].clientY);
451
+ this.scaleBase = y.substract(b).magnitude;
452
452
  } else
453
453
  this.scaleBase = 0;
454
454
  }
@@ -456,85 +456,85 @@ R.closest = ie;
456
456
  if (!this.shouldFire)
457
457
  return;
458
458
  if (this.touchMoved = !0, this.touchMove = a, a.touches.length > 1 && this.touchStart.touches.length > 1 && (a.touches[1].clientX !== this.touchStart.touches[1].clientX || a.touches[1].clientY !== this.touchStart.touches[1].clientY)) {
459
- const L = new v.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY), U = new v.Vec2(this.touchMove.touches[1].clientX, this.touchMove.touches[1].clientY), et = new v.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), nt = L.substract(U);
460
- if (this.scaleBase && Math.abs(this.scaleBase - nt.magnitude) > 10) {
461
- const I = nt.magnitude / this.scaleBase;
462
- if (this.scale = I, this.isPinching) {
463
- const H = new P.default(a, {
464
- scale: I
459
+ const _ = new v.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY), A = new v.Vec2(this.touchMove.touches[1].clientX, this.touchMove.touches[1].clientY), it = new v.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), at = _.substract(A);
460
+ if (this.scaleBase && Math.abs(this.scaleBase - at.magnitude) > 10) {
461
+ const F = at.magnitude / this.scaleBase;
462
+ if (this.scale = F, this.isPinching) {
463
+ const V = new w.default(a, {
464
+ scale: F
465
465
  });
466
- this.dispatchEvent(H);
466
+ this.dispatchEvent(V);
467
467
  } else {
468
- const H = new P.PinchStartEvent(a, {
469
- scale: I
468
+ const V = new w.PinchStartEvent(a, {
469
+ scale: F
470
470
  });
471
- this.dispatchEvent(H), this.isPinching = !0;
471
+ this.dispatchEvent(V), this.isPinching = !0;
472
472
  }
473
473
  }
474
- this.anchor = L;
475
- let B = Math.atan2(et.clientY - U.clientY, et.clientX - U.clientX);
476
- if (B < 0 ? B += 1.5708 : B -= 1.5708, this.rotation = B, this.rotationDeg = B * 180 / Math.PI, this.anchor = this.anchor, this.isRotating) {
477
- const I = new w.default(a, {
474
+ this.anchor = _;
475
+ let C = Math.atan2(it.clientY - A.clientY, it.clientX - A.clientX);
476
+ if (C < 0 ? C += 1.5708 : C -= 1.5708, this.rotation = C, this.rotationDeg = C * 180 / Math.PI, this.anchor = this.anchor, this.isRotating) {
477
+ const F = new E.default(a, {
478
478
  anchor: this.anchor,
479
479
  rotation: this.rotation,
480
480
  rotationDeg: this.rotationDeg
481
481
  });
482
- this.dispatchEvent(I);
482
+ this.dispatchEvent(F);
483
483
  } else {
484
- const I = new w.RotateStartEvent(a, {
484
+ const F = new E.RotateStartEvent(a, {
485
485
  anchor: this.anchor,
486
486
  rotation: this.rotation,
487
487
  rotationDeg: this.rotationDeg
488
488
  });
489
- this.dispatchEvent(I), this.isRotating = !0;
489
+ this.dispatchEvent(F), this.isRotating = !0;
490
490
  }
491
491
  }
492
- const h = new v.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), E = new v.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY).substract(h), b = E.magnitude, k = {
493
- x: E.x / b,
494
- y: E.y / b
495
- }, S = Math.atan2(k.y, k.x);
492
+ const f = new v.Vec2(this.touchStart.touches[0].clientX, this.touchStart.touches[0].clientY), y = new v.Vec2(this.touchMove.touches[0].clientX, this.touchMove.touches[0].clientY).substract(f), b = y.magnitude, x = {
493
+ x: y.x / b,
494
+ y: y.y / b
495
+ }, S = Math.atan2(x.y, x.x);
496
496
  this.octant = Math.round(4 * S / (2 * Math.PI) + 4) % 4;
497
- const X = (a.timeStamp - this.touchStart.timeStamp) / 1e3, M = E.magnitude / X;
497
+ const N = (a.timeStamp - this.touchStart.timeStamp) / 1e3, Y = y.magnitude / N;
498
498
  if (this.isSwiping) {
499
- const L = new f.default(a, {
499
+ const _ = new h.default(a, {
500
500
  direction: p[(0, v.closest)(this.octant, [0, 1, 2, 3])],
501
- velocity: M
501
+ velocity: Y
502
502
  });
503
- this.dispatchEvent(L);
503
+ this.dispatchEvent(_);
504
504
  } else {
505
- const L = new f.SwipeStartEvent(a, {
505
+ const _ = new h.SwipeStartEvent(a, {
506
506
  direction: p[(0, v.closest)(this.octant, [0, 1, 2, 3])],
507
- velocity: M
507
+ velocity: Y
508
508
  });
509
- this.dispatchEvent(L), this.isSwiping = !0;
509
+ this.dispatchEvent(_), this.isSwiping = !0;
510
510
  }
511
- if (this.dxDy = E, this.velocity = M, this.isPanning) {
512
- const L = new d.default(a, {
513
- translation: E,
514
- velocity: M
511
+ if (this.dxDy = y, this.velocity = Y, this.isPanning) {
512
+ const _ = new d.default(a, {
513
+ translation: y,
514
+ velocity: Y
515
515
  });
516
- this.dispatchEvent(L);
516
+ this.dispatchEvent(_);
517
517
  } else {
518
- const L = new d.PanStartEvent(a, {
519
- translation: E,
520
- velocity: M
518
+ const _ = new d.PanStartEvent(a, {
519
+ translation: y,
520
+ velocity: Y
521
521
  });
522
- this.dispatchEvent(L), this.isPanning = !0;
522
+ this.dispatchEvent(_), this.isPanning = !0;
523
523
  }
524
524
  }
525
525
  onTouchEnd(a) {
526
- const h = parseInt(this.currentTarget.dataset.numberoftaps || "0") || this.config.numberOfTaps;
527
- if (this.taps++, this.shouldFire = this.taps > h, this.shouldFire) {
526
+ const f = parseInt(this.currentTarget.dataset.numberoftaps || "0") || this.config.numberOfTaps;
527
+ if (this.taps++, this.shouldFire = this.taps > f, this.shouldFire) {
528
528
  this.touchEnd = a, this.touchEndTime = a.timeStamp;
529
- const m = parseFloat(this.currentTarget.dataset.tapdelay || "0") || this.config.tapDelay;
529
+ const P = parseFloat(this.currentTarget.dataset.tapdelay || "0") || this.config.tapDelay;
530
530
  if (!this.touchMoved && !this.isLongPress)
531
- if (this.taps === 1 || this.touchEndTime - this.lastTouchTime < m) {
532
- if (this.taps % 2 === h) {
533
- const b = new l.default(a);
531
+ if (this.taps === 1 || this.touchEndTime - this.lastTouchTime < P) {
532
+ if (this.taps % 2 === f) {
533
+ const b = new u.default(a);
534
534
  this.dispatchEvent(b), this.taps = 0;
535
535
  }
536
- const E = new c.default(a);
537
- this.dispatchEvent(E);
536
+ const y = new c.default(a);
537
+ this.dispatchEvent(y);
538
538
  } else
539
539
  this.taps = 0;
540
540
  }
@@ -544,9 +544,9 @@ R.closest = ie;
544
544
  this.shouldFire && (this.touchCancel = a, this.unbind(this.currentTarget), this.clean());
545
545
  }
546
546
  }
547
- n.default = y, y.listening = !1, TouchEvent && (window.gestureProvider = new y());
548
- })(Tt);
549
- class ae extends Event {
547
+ n.default = m, m.listening = !1, TouchEvent && (window.gestureProvider = new m());
548
+ })(kt);
549
+ class ce extends Event {
550
550
  routerId;
551
551
  route;
552
552
  props;
@@ -554,51 +554,51 @@ class ae extends Event {
554
554
  signal;
555
555
  committed;
556
556
  transition;
557
- constructor(t, e, r, s, i, o, c) {
558
- super("navigate"), this.routerId = t, this.route = e, this.props = r, this.navigationType = s ?? "push", this.signal = i, this.committed = o, this.transition = c;
557
+ constructor(t, e, s, r, i, o, c) {
558
+ super("navigate"), this.routerId = t, this.route = e, this.props = s, this.navigationType = r ?? "push", this.signal = i, this.committed = o, this.transition = c;
559
559
  }
560
560
  }
561
- class oe extends Event {
561
+ class ue extends Event {
562
562
  routerId;
563
563
  signal;
564
564
  committed;
565
565
  transition;
566
- constructor(t, e, r, s) {
567
- super("back"), this.routerId = t, this.signal = e, this.committed = r, this.transition = s;
566
+ constructor(t, e, s, r) {
567
+ super("back"), this.routerId = t, this.signal = e, this.committed = s, this.transition = r;
568
568
  }
569
569
  }
570
- class ce extends Event {
570
+ class le extends Event {
571
571
  routerId;
572
572
  signal;
573
573
  committed;
574
574
  transition;
575
- constructor(t, e, r, s) {
576
- super("forward"), this.routerId = t, this.signal = e, this.committed = r, this.transition = s;
575
+ constructor(t, e, s, r) {
576
+ super("forward"), this.routerId = t, this.signal = e, this.committed = s, this.transition = r;
577
577
  }
578
578
  }
579
- class ue extends Event {
579
+ class he extends Event {
580
580
  source;
581
581
  constructor(t) {
582
582
  super("gesture-start"), this.source = t;
583
583
  }
584
584
  }
585
- class le extends Event {
585
+ class de extends Event {
586
586
  source;
587
587
  constructor(t) {
588
588
  super("gesture-end"), this.source = t;
589
589
  }
590
590
  }
591
- class he extends Event {
591
+ class fe extends Event {
592
592
  constructor() {
593
593
  super("gesture-cancel");
594
594
  }
595
595
  }
596
- class de {
596
+ class ve {
597
597
  routerId;
598
598
  #t;
599
599
  index;
600
- constructor(t, e, r) {
601
- this.#t = t, this.routerId = e, this.index = r;
600
+ constructor(t, e, s) {
601
+ this.#t = t, this.routerId = e, this.index = s;
602
602
  }
603
603
  set ondispose(t) {
604
604
  this.#t.ondispose = t;
@@ -621,11 +621,11 @@ class de {
621
621
  get sameDocument() {
622
622
  return this.#t.sameDocument;
623
623
  }
624
- addEventListener(t, e, r) {
625
- return this.#t.addEventListener(t, e, r), () => this.#t.removeEventListener(t, e, r);
624
+ addEventListener(t, e, s) {
625
+ return this.#t.addEventListener(t, e, s), () => this.#t.removeEventListener(t, e, s);
626
626
  }
627
- removeEventListener(t, e, r) {
628
- this.#t.addEventListener(t, e, r);
627
+ removeEventListener(t, e, s) {
628
+ this.#t.addEventListener(t, e, s);
629
629
  }
630
630
  dispatchEvent(t) {
631
631
  return this.#t.dispatchEvent(t);
@@ -634,183 +634,398 @@ class de {
634
634
  return this.#t.getState();
635
635
  }
636
636
  }
637
- class fe extends ht {
638
- router;
637
+ class ge extends gt {
638
+ config;
639
639
  constructor(t) {
640
- super(), this.router = t;
640
+ super(t), this.config = t;
641
641
  }
642
- preload(t, e = {}, r = {}) {
643
- const { pathname: s } = new URL(t, this.baseURL);
644
- return this.router.preload(s, e, r);
642
+ preload(t, e = {}, s = {}) {
643
+ const { pathname: r } = new URL(t, this.baseURL);
644
+ return this.config.preload(r, e, s);
645
645
  }
646
- replace(t, e = {}, r = {}) {
647
- return this.navigate(t, e, { ...r, type: "replace" });
646
+ replace(t, e = {}, s = {}) {
647
+ return this.navigate(t, e, { ...s, type: "replace" });
648
648
  }
649
- push(t, e = {}, r = {}) {
650
- return this.navigate(t, e, { ...r, type: "push" });
649
+ push(t, e = {}, s = {}) {
650
+ return this.navigate(t, e, { ...s, type: "push" });
651
651
  }
652
652
  reload(t = {}) {
653
653
  return window.navigation.reload({ state: t });
654
654
  }
655
655
  traverseTo(t, e = {}) {
656
- const r = window.navigation.traverseTo(t), s = window.navigation.transition, i = s.from.index, o = window.navigation.entries().findIndex((f) => f.key === t), c = new AbortController();
657
- c.signal.addEventListener("abort", () => this.traverseTo(s.from.key), { once: !0 }), e.signal?.addEventListener("abort", c.abort, { once: !0 });
658
- let l;
659
- return i > o ? l = this.createBackEvent(c.signal, r.committed, s) : l = this.createForwardEvent(c.signal, r.committed, s), this.dispatchEvent?.(l), r;
660
- }
661
- navigate(t, e = {}, r = {}) {
662
- const { type: s = "push" } = r, i = new URL(t, this.baseURL), o = window.navigation.navigate(i.href, { history: s, state: e }), c = window.navigation.transition, l = new AbortController();
663
- l.signal.addEventListener("abort", () => this.goBack(), { once: !0 }), r.signal?.addEventListener("abort", l.abort, { once: !0 });
664
- const f = this.createNavigateEvent(t, e, s, l.signal, o.committed, c);
665
- return this.dispatchEvent?.(f), o;
656
+ const s = window.navigation.traverseTo(t), r = window.navigation.transition, i = r.from.index, o = window.navigation.entries().findIndex((h) => h.key === t), c = new AbortController();
657
+ c.signal.addEventListener(
658
+ "abort",
659
+ () => this.traverseTo(r.from.key),
660
+ { once: !0 }
661
+ ), e.signal?.addEventListener("abort", c.abort, { once: !0 });
662
+ let u;
663
+ return i > o ? u = this.createBackEvent(
664
+ c.signal,
665
+ s.committed,
666
+ r
667
+ ) : u = this.createForwardEvent(
668
+ c.signal,
669
+ s.committed,
670
+ r
671
+ ), this.dispatchEvent?.(u), s;
672
+ }
673
+ navigate(t, e = {}, s = {}) {
674
+ const { type: r = "push" } = s, i = new URL(t, this.baseURL), o = window.navigation.navigate(i.href, { history: r, state: e }), c = window.navigation.transition, u = new AbortController();
675
+ u.signal.addEventListener("abort", () => this.goBack(), { once: !0 }), s.signal?.addEventListener("abort", u.abort, { once: !0 });
676
+ const h = this.createNavigateEvent(
677
+ t,
678
+ e,
679
+ r,
680
+ u.signal,
681
+ o.committed,
682
+ c
683
+ );
684
+ return this.dispatchEvent?.(h), o;
666
685
  }
667
686
  goBack(t = {}) {
668
687
  if (!this.canGoBack())
669
688
  return;
670
- const e = window.navigation.traverseTo(this.previous.key), r = window.navigation.transition, s = new AbortController();
671
- s.signal.addEventListener("abort", () => this.goForward(), { once: !0 }), t.signal?.addEventListener("abort", s.abort, { once: !0 });
672
- const i = this.createBackEvent(s.signal, e.committed, r);
689
+ const e = window.navigation.traverseTo(this.previous.key), s = window.navigation.transition, r = new AbortController();
690
+ r.signal.addEventListener("abort", () => this.goForward(), { once: !0 }), t.signal?.addEventListener("abort", r.abort, { once: !0 });
691
+ const i = this.createBackEvent(
692
+ r.signal,
693
+ e.committed,
694
+ s
695
+ );
673
696
  return this.dispatchEvent?.(i), e;
674
697
  }
675
698
  goForward(t = {}) {
676
699
  if (!this.canGoForward())
677
700
  return;
678
- const e = window.navigation.traverseTo(this.next.key), r = window.navigation.transition, s = new AbortController();
679
- s.signal.addEventListener("abort", () => this.goBack(), { once: !0 }), t.signal?.addEventListener("abort", s.abort, { once: !0 });
680
- const i = this.createForwardEvent(s.signal, e.committed, r);
701
+ const e = window.navigation.traverseTo(this.next.key), s = window.navigation.transition, r = new AbortController();
702
+ r.signal.addEventListener("abort", () => this.goBack(), { once: !0 }), t.signal?.addEventListener("abort", r.abort, { once: !0 });
703
+ const i = this.createForwardEvent(
704
+ r.signal,
705
+ e.committed,
706
+ s
707
+ );
681
708
  return this.dispatchEvent?.(i), e;
682
709
  }
683
- createBackEvent(t, e, r) {
710
+ createBackEvent(t, e, s) {
684
711
  if (!this.routerId)
685
712
  throw new Error("Router ID is not set");
686
- return new oe(this.routerId, t, e, r);
713
+ return new ue(this.routerId, t, e, s);
687
714
  }
688
- createForwardEvent(t, e, r) {
715
+ createForwardEvent(t, e, s) {
689
716
  if (!this.routerId)
690
717
  throw new Error("Router ID is not set");
691
- return new ce(this.routerId, t, e, r);
718
+ return new le(this.routerId, t, e, s);
692
719
  }
693
- createNavigateEvent(t, e, r, s, i, o) {
720
+ createNavigateEvent(t, e, s, r, i, o) {
694
721
  if (!this.routerId)
695
722
  throw new Error("Router ID is not set");
696
- return new ae(
723
+ return new ce(
697
724
  this.routerId,
698
725
  t,
699
726
  e,
700
- r,
701
727
  s,
728
+ r,
702
729
  i,
703
730
  o
704
731
  );
705
732
  }
706
733
  get committed() {
707
- return this.router.committed;
734
+ return this.config.getCommitted();
708
735
  }
709
736
  get transition() {
710
- return this.router.state.transition;
737
+ return this.config.getTransition();
711
738
  }
712
739
  get globalEntries() {
713
740
  return window.navigation.entries();
714
741
  }
742
+ /**
743
+ * Returns the list of history entries **owned by this router**, derived from the
744
+ * browser’s global navigation history.
745
+ *
746
+ * ---
747
+ *
748
+ * ### Mental model
749
+ *
750
+ * The Web Navigation API exposes a **single, flat history list**.
751
+ * This router projects a **scoped, ordered view** of that list ensuring the
752
+ * router can only see entries it created.
753
+ *
754
+ * Each global entry is classified as one of:
755
+ *
756
+ * - **Owned by this router**
757
+ * - **Owned by a nested router**
758
+ * - **Owned by a different (foreign) router**
759
+ *
760
+ * The resulting entry list is built by iterating global history **from the
761
+ * beginning**, applying ownership rules, and stopping when ownership is lost.
762
+ *
763
+ * ---
764
+ *
765
+ * ### Ownership & contiguity rules
766
+ *
767
+ * 1. **Entries owned by this router**
768
+ * - Are included
769
+ * - Preserve global ordering
770
+ *
771
+ * 2. **Entries owned by nested routers**
772
+ * - Exactly **one entry is included** (the nested router’s mount point),
773
+ * because it must be rendered by the parent router
774
+ * - All subsequent entries belonging to that same nested scope are excluded
775
+ *
776
+ * 3. **Entries owned by a foreign router**
777
+ * - Are excluded
778
+ * - **Terminate entry collection** once at least one entry has been matched
779
+ *
780
+ * This means contiguity is enforced **only across routers that cannot be
781
+ * matched by this router at all**.
782
+ *
783
+ * ---
784
+ *
785
+ * ### Important invariants
786
+ *
787
+ * - Returned entries are always in **global history order**
788
+ * - Local indices are **stable and monotonic**
789
+ * - Nested router entries never leak into the parent router
790
+ * - Entry collection stops once navigation leaves this router’s ownership
791
+ * after it has begun
792
+ *
793
+ * ---
794
+ *
795
+ * ### Example
796
+ *
797
+ * Global history:
798
+ * ```
799
+ * 0: / (parent)
800
+ * 1: /world (parent)
801
+ * 2: /world/1 (nested mount point)
802
+ * 3: /world/2 (nested)
803
+ * 4: /about (parent)
804
+ * 5: /other-router/page (foreign)
805
+ * 6: / (parent)
806
+ * ```
807
+ *
808
+ * Parent router entries:
809
+ * ```
810
+ * /, /world, /world/1, /about
811
+ * ```
812
+ *
813
+ * Collection stops at index 5 because ownership is transferred to a
814
+ * foreign router.
815
+ *
816
+ *
817
+ * This approach balances correctness, simplicity, and predictable behavior
818
+ * without requiring global history rewriting or fragile index arithmetic.
819
+ */
715
820
  get entries() {
716
- const t = this.router.pathPatterns.filter(({ pattern: s }) => s.endsWith("**"));
717
- let e = null, r = !1;
718
- return this.globalEntries.filter((s) => {
719
- if (!s.url)
720
- return !1;
721
- const i = new URL(s.url), o = dt(this.baseURLPattern.pathname, i.pathname);
722
- if (!o)
821
+ const t = this.config.getPathPatterns().filter(({ pattern: i }) => i.endsWith("**"));
822
+ let e = null, s = k, r = !1;
823
+ return this.globalEntries.filter((i, o) => {
824
+ if (!i.url || r)
723
825
  return !1;
826
+ const c = new URL(i.url), u = pt(
827
+ this.baseURLPattern.pathname,
828
+ c.pathname
829
+ );
830
+ if (!u)
831
+ return s !== k && (r = !0), !1;
724
832
  if (e) {
725
- const c = new URLPattern(e.pattern, o.href);
726
- if (Y(
727
- i.pathname,
728
- i.pathname,
833
+ const h = new URLPattern(
834
+ e.pattern,
835
+ u.href
836
+ );
837
+ if (X(
838
+ c.pathname,
729
839
  c.pathname,
840
+ h.pathname,
730
841
  e.caseSensitive
731
- ) || r)
732
- return r = !0, !1;
842
+ ))
843
+ return !1;
733
844
  }
734
845
  return e = t.find(
735
- ({ pattern: c, caseSensitive: l }) => Y(
736
- c,
737
- i.pathname,
846
+ ({ pattern: h, caseSensitive: d }) => X(
847
+ h,
848
+ c.pathname,
738
849
  this.baseURLPattern.pathname,
739
- l
850
+ d
740
851
  )
741
- ) ?? null, !0;
742
- }).map((s, i) => new de(s, this.routerId, i));
743
- }
852
+ ) ?? null, s = o, !0;
853
+ }).map((i, o) => new ve(i, this.routerId, o));
854
+ }
855
+ /**
856
+ * Returns the **local history index** for this router, derived from the
857
+ * browser’s global navigation state.
858
+ *
859
+ * ---
860
+ *
861
+ * ### Problem this solves
862
+ *
863
+ * The Web Navigation API exposes a **single, flat history list**.
864
+ * This router exposes a **scoped history view** that:
865
+ *
866
+ * - filters out entries owned by nested routers
867
+ * - preserves global ordering
868
+ * - reindexes entries locally
869
+ *
870
+ * As a result, there is **no arithmetic relationship** between:
871
+ *
872
+ * - `window.navigation.currentEntry.index` (global)
873
+ * - this router’s local `index`
874
+ *
875
+ * This getter computes the local index **by identity**, not position.
876
+ *
877
+ * ---
878
+ *
879
+ * ### High-level behavior
880
+ *
881
+ * The returned index is:
882
+ *
883
+ * > the index of the **most recent local entry** that appears in the
884
+ * > browser’s global history **at or before** the current global entry.
885
+ *
886
+ * ---
887
+ *
888
+ * ### Resolution strategy
889
+ *
890
+ * 1. If the current global index is **before** this router’s first entry,
891
+ * the index resolves to `0`.
892
+ *
893
+ * 2. If the current global index is **after** this router’s last entry,
894
+ * the index resolves to `entries.length - 1`.
895
+ *
896
+ * 3. Otherwise:
897
+ * - A window of global history is sliced from the first local entry
898
+ * up to and including the current global entry.
899
+ * - Local entries are scanned **from newest to oldest**.
900
+ * - The first local entry whose `key` appears in that global slice
901
+ * determines the local index.
902
+ *
903
+ * Entry identity is determined by **history entry keys**, not URLs or
904
+ * global indices.
905
+ *
906
+ * ---
907
+ *
908
+ * ### Why key-based matching is required
909
+ *
910
+ * - Global indices are sparse once nested routers are involved
911
+ * - URLs may repeat or be replaced
912
+ * - History entries can be inserted between parent entries
913
+ *
914
+ * Keys provide the only stable identity that survives these cases.
915
+ *
916
+ * ---
917
+ *
918
+ * ### Invariant
919
+ *
920
+ * The returned index always satisfies:
921
+ *
922
+ * ```
923
+ * 0 ≤ index < entries.length
924
+ * ```
925
+ *
926
+ * and monotonically tracks navigation through global history.
927
+ *
928
+ * ---
929
+ *
930
+ * ### Example
931
+ *
932
+ * Global history:
933
+ * ```
934
+ * 0: /
935
+ * 1: /world
936
+ * 2: /world/1 (nested)
937
+ * 3: /about ← current
938
+ * ```
939
+ *
940
+ * Local router entries:
941
+ * ```
942
+ * / (index 0)
943
+ * /world (index 1)
944
+ * /about (index 2)
945
+ * ```
946
+ *
947
+ * Result:
948
+ * ```
949
+ * index === 2
950
+ * ```
951
+ */
744
952
  get index() {
745
- const t = window.navigation.currentEntry?.index ?? -1, e = this.entries.at(0)?.globalIndex ?? -1, r = this.entries.at(-1)?.globalIndex ?? -1;
953
+ const t = window.navigation.currentEntry?.index ?? k, e = this.entries.at(U)?.globalIndex ?? k, s = this.entries.at(k)?.globalIndex ?? k;
746
954
  if (t <= e)
747
- return 0;
748
- if (t >= r)
749
- return this.entries.length - 1;
955
+ return U;
956
+ if (t >= s)
957
+ return this.entries.length - R;
750
958
  {
751
- const s = this.globalEntries.slice(e, t + 1);
752
- return this.entries.findLastIndex((i) => s.findLastIndex((o) => i.key === o.key) > -1);
959
+ const r = this.globalEntries.slice(
960
+ e,
961
+ t + R
962
+ );
963
+ return this.entries.findLastIndex((i) => r.findLastIndex(
964
+ (o) => i.key === o.key
965
+ ) > k);
753
966
  }
754
967
  }
755
968
  get previous() {
756
- return this.entries[this.index - 1] ?? null;
969
+ return this.entries[this.index - R] ?? null;
757
970
  }
758
971
  get next() {
759
- return this.entries[this.index + 1] ?? null;
972
+ return this.entries[this.index + R] ?? null;
760
973
  }
761
974
  get current() {
762
975
  return this.entries[this.index];
763
976
  }
764
977
  canGoBack() {
765
- return !!this.previous?.sameDocument;
978
+ return this.previous?.url?.origin === globalThis.location.origin;
766
979
  }
767
980
  canGoForward() {
768
- return !!this.next?.sameDocument;
981
+ return this.next?.url?.origin === globalThis.location.origin;
769
982
  }
770
983
  }
771
- function ve(n) {
984
+ function pe(n) {
772
985
  return Object.fromEntries(n.entries());
773
986
  }
774
- function ge(n) {
987
+ function me(n) {
775
988
  return new URLSearchParams(n).toString();
776
989
  }
777
- function pe(n) {
990
+ function ye(n) {
778
991
  return n && typeof n == "object" && "gesture" in n ? !!n.gesture : !1;
779
992
  }
780
- function me(n) {
993
+ function we(n) {
781
994
  return n && typeof n == "object" && "rollback" in n ? !!n.rollback : !1;
782
995
  }
783
- function V(n, t) {
996
+ function W(n, t) {
784
997
  if (n === t)
785
998
  return !0;
786
999
  if (n === null || t === null || typeof n != "object" || typeof t != "object")
787
1000
  return !1;
788
- const e = Object.keys(n), r = Object.keys(t);
789
- if (e.length !== r.length)
1001
+ const e = Object.keys(n), s = Object.keys(t);
1002
+ if (e.length !== s.length)
790
1003
  return !1;
791
- for (let s of e)
792
- if (!r.includes(s) || !V(n[s], t[s]))
1004
+ for (const r of e)
1005
+ if (!s.includes(r) || !W(n[r], t[r]))
793
1006
  return !1;
794
1007
  return !0;
795
1008
  }
796
- class Je extends ft {
1009
+ class en extends mt {
797
1010
  #t;
798
1011
  constructor(t, e) {
799
1012
  super(t, e);
800
- const r = this.internalProps.id, s = e.navigation.entries.find((i) => i.key === r);
801
- if (!s)
802
- throw new Error(`No history entry found for: ${r}`);
803
- this.#t = s;
1013
+ const s = this.internalProps.id, r = e.navigation.entries.find((i) => i.key === s);
1014
+ if (!r)
1015
+ throw new Error(`No history entry found for: ${s}`);
1016
+ this.#t = r;
804
1017
  }
805
1018
  static getDerivedStateFromProps(t) {
806
1019
  return t.config?.presentation === "dialog" || t.config?.presentation === "modal" ? { elementType: "dialog" } : { elementType: "div" };
807
1020
  }
808
1021
  setParams(t) {
809
- super.setParams(t), this.setHistoryState(({ params: e }) => ({ params: { ...e, ...t } }));
1022
+ super.setParams(t), this.setHistoryState(
1023
+ ({ params: e }) => ({ params: { ...e, ...t } })
1024
+ );
810
1025
  }
811
1026
  setConfig(t) {
812
1027
  super.setConfig(t), this.setHistoryState(({ config: e }) => {
813
- const r = /* @__PURE__ */ new Set([
1028
+ const s = /* @__PURE__ */ new Set([
814
1029
  "footer",
815
1030
  "header",
816
1031
  "onEnter",
@@ -824,7 +1039,7 @@ class Je extends ft {
824
1039
  config: {
825
1040
  ...e,
826
1041
  ...Object.fromEntries(
827
- Object.entries(t).filter(([s]) => !r.has(s))
1042
+ Object.entries(t).filter(([r]) => !s.has(r))
828
1043
  )
829
1044
  }
830
1045
  };
@@ -842,7 +1057,7 @@ class Je extends ft {
842
1057
  get historyEntryState() {
843
1058
  const t = this.#t;
844
1059
  if (t?.url) {
845
- const e = t.getState() ?? {}, r = ve(t.url.searchParams), s = Y(
1060
+ const e = t.getState() ?? {}, s = pe(t.url.searchParams), r = X(
846
1061
  this.props.path,
847
1062
  t.url.pathname,
848
1063
  this.context.baseURLPattern.pathname,
@@ -850,8 +1065,8 @@ class Je extends ft {
850
1065
  )?.params;
851
1066
  return e.params = {
852
1067
  ...e.params,
853
- ...r,
854
- ...s
1068
+ ...s,
1069
+ ...r
855
1070
  }, e;
856
1071
  }
857
1072
  return {};
@@ -874,13 +1089,13 @@ class Je extends ft {
874
1089
  };
875
1090
  }
876
1091
  get routeProp() {
877
- const t = this.setParams.bind(this), e = this.setConfig.bind(this), { path: r } = this.props, { focused: s } = this.state, { params: i, config: o, resolvedPathname: c } = this;
1092
+ const t = this.setParams.bind(this), e = this.setConfig.bind(this), { path: s } = this.props, { focused: r } = this.state, { params: i, config: o, resolvedPathname: c } = this;
878
1093
  return {
879
1094
  setParams: t,
880
1095
  setConfig: e,
881
- path: r,
1096
+ path: s,
882
1097
  resolvedPathname: c,
883
- focused: s,
1098
+ focused: r,
884
1099
  params: i,
885
1100
  config: o
886
1101
  };
@@ -890,37 +1105,39 @@ class Je extends ft {
890
1105
  return;
891
1106
  const e = this.#t.getState() ?? {};
892
1107
  t instanceof Function && (t = t(e));
893
- const r = {
1108
+ const s = {
894
1109
  ...e ?? {},
895
1110
  ...t
896
1111
  };
897
- window.navigation.updateCurrentEntry({ state: r });
1112
+ window.navigation.updateCurrentEntry({ state: s });
898
1113
  }
899
1114
  onClickOutside(t) {
900
1115
  if (!this.transitionProvider.current?.ref.current)
901
1116
  return;
902
- const e = this.context?.navigation, r = this.transitionProvider.current.ref.current.getBoundingClientRect();
903
- r.top <= t.clientY && t.clientY <= r.top + r.height && r.left <= t.clientX && t.clientX <= r.left + r.width || e?.goBack();
1117
+ const e = this.context?.navigation;
1118
+ t.composedPath().includes(this.transitionProvider.current.ref.current) || e?.goBack();
904
1119
  }
905
1120
  onEnter(t) {
906
- if (this.transitionProvider.current?.ref.current instanceof HTMLDialogElement && this.transitionProvider.current.ref.current.open === !1) {
907
- const e = this.context?.navigation;
908
- this.props.config?.presentation === "modal" ? this.transitionProvider.current.ref.current.showModal() : this.transitionProvider.current.ref.current.show(), this.transitionProvider.current.ref.current.style.maxHeight = "unset", this.transitionProvider.current.ref.current.style.maxWidth = "unset", this.transitionProvider.current.ref.current.style.width = "max-content", this.transitionProvider.current.ref.current.style.height = "max-content";
1121
+ const e = this.transitionProvider.current?.ref;
1122
+ if (e?.current instanceof HTMLDialogElement && e.current.open === !1) {
1123
+ const s = this.context?.navigation;
1124
+ this.props.config?.presentation === "modal" ? e.current.showModal() : e.current.show(), e.current.style.maxHeight = "unset", e.current.style.maxWidth = "unset", e.current.style.width = "max-content", e.current.style.height = "max-content";
909
1125
  const r = this.onClickOutside.bind(this);
910
- this.transitionProvider.current?.ref.current.addEventListener("close", function() {
911
- this.returnValue !== "screen-exit" && (this.style.display = "block", e?.goBack()), e?.removeEventListener("click", r);
912
- }, { once: !0 }), e?.addEventListener("click", r);
1126
+ e.current.addEventListener("close", function() {
1127
+ this.returnValue !== "screen-exit" && (this.style.display = "block", s?.goBack()), s?.removeEventListener("click", r);
1128
+ }, { once: !0 }), s?.addEventListener("click", r);
913
1129
  }
914
1130
  return super.onEnter(t);
915
1131
  }
916
1132
  onExited(t) {
917
- return this.transitionProvider.current?.ref.current instanceof HTMLDialogElement && this.transitionProvider.current.ref.current.close("screen-exit"), super.onExited(t);
1133
+ const e = this.transitionProvider.current?.ref;
1134
+ return e?.current instanceof HTMLDialogElement && e.current.close("screen-exit"), super.onExited(t);
918
1135
  }
919
1136
  }
920
- function x(n) {
921
- return !!(n !== null && typeof n == "object" && n.hasOwnProperty("current"));
1137
+ function O(n) {
1138
+ return !!(n !== null && typeof n == "object" && Object.hasOwn(n, "current"));
922
1139
  }
923
- const ye = {
1140
+ const Ee = {
924
1141
  horizontal: ["left", "right"],
925
1142
  vertical: ["up", "down"],
926
1143
  up: ["up"],
@@ -928,57 +1145,70 @@ const ye = {
928
1145
  left: ["left"],
929
1146
  right: ["right"]
930
1147
  };
931
- function we(n, t) {
932
- return ye[t].includes(n);
1148
+ function Pe(n, t) {
1149
+ return Ee[t].includes(n);
933
1150
  }
934
- function Ee(n, { x: t, y: e }, r, s) {
935
- if (n === "right" && Math.abs(t - r.left) >= s || n === "left" && Math.abs(t - r.right) >= s || n === "down" && Math.abs(e - r.top) >= s || n === "up" && Math.abs(e - r.bottom) >= s)
1151
+ function Se(n, { x: t, y: e }, s, r) {
1152
+ if (n === "right" && Math.abs(t - s.left) >= r || n === "left" && Math.abs(t - s.right) >= r || n === "down" && Math.abs(e - s.top) >= r || n === "up" && Math.abs(e - s.bottom) >= r)
936
1153
  return !1;
937
1154
  }
938
- function Pe(n) {
1155
+ function be(n) {
939
1156
  return n === "left" || n === "right" || n === "horizontal";
940
1157
  }
941
- const _ = {
1158
+ const L = {
942
1159
  gestureHysteresis: 0.5,
943
1160
  gestureMinFlingVelocity: 400,
944
1161
  gestureAreaWidth: 100,
945
1162
  gestureDirection: "right",
946
1163
  gestureDisabled: !1
947
- }, Se = 0.5;
948
- class be {
1164
+ }, _e = 0.5, Le = 1;
1165
+ class Te {
949
1166
  promise;
950
1167
  state;
951
- nativeResolve;
952
- nativeReject;
1168
+ #t;
1169
+ #e;
953
1170
  constructor() {
954
- this.state = "pending", this.nativeResolve = this.nativeReject = null, this.promise = new Promise((t, e) => {
955
- this.nativeResolve = t, this.nativeReject = e;
1171
+ this.state = "pending", this.#t = this.#e = null, this.promise = new Promise((t, e) => {
1172
+ this.#t = t, this.#e = e;
956
1173
  });
957
1174
  }
958
1175
  resolve(t) {
959
- this.state = "resolved", this.nativeResolve?.(t);
1176
+ this.state = "resolved", this.#t?.(t);
960
1177
  }
961
1178
  reject(t) {
962
1179
  this.state = "rejected", this.promise.catch(() => {
963
- }), this.nativeReject?.(t);
1180
+ }), this.#e?.(t);
964
1181
  }
965
1182
  }
966
- class Qe extends vt {
967
- navigation = new fe(this);
1183
+ class nn extends yt {
1184
+ navigation;
968
1185
  #t = null;
969
1186
  constructor(t, e) {
970
- super(t, e);
1187
+ super(t, e), this.navigation = new ge({
1188
+ addEventListener: this.addEventListener.bind(this),
1189
+ removeEventListener: this.removeEventListener.bind(this),
1190
+ dispatchEvent: this.dispatchEvent.bind(this),
1191
+ parent: this.parent?.navigation ?? null,
1192
+ routerId: this.id,
1193
+ baseURL: this.baseURL,
1194
+ baseURLPattern: this.baseURLPattern,
1195
+ getCommitted: () => this.committed,
1196
+ getTransition: () => this.state.transition,
1197
+ getPathPatterns: () => this.pathPatterns,
1198
+ preload: this.preload.bind(this),
1199
+ getNavigatorById: (u) => this.getRouterById(u)?.navigation ?? null
1200
+ });
971
1201
  const {
972
- gestureAreaWidth: r = _.gestureAreaWidth,
973
- gestureDirection: s = _.gestureDirection,
974
- gestureDisabled: i = _.gestureDisabled,
975
- gestureHysteresis: o = _.gestureHysteresis,
976
- gestureMinFlingVelocity: c = _.gestureMinFlingVelocity
1202
+ gestureAreaWidth: s = L.gestureAreaWidth,
1203
+ gestureDirection: r = L.gestureDirection,
1204
+ gestureDisabled: i = L.gestureDisabled,
1205
+ gestureHysteresis: o = L.gestureHysteresis,
1206
+ gestureMinFlingVelocity: c = L.gestureMinFlingVelocity
977
1207
  } = t.config?.screenConfig ?? {};
978
1208
  this.state = {
979
1209
  screenStack: [],
980
- gestureDirection: s,
981
- gestureAreaWidth: r,
1210
+ gestureDirection: r,
1211
+ gestureAreaWidth: s,
982
1212
  gestureHysteresis: o,
983
1213
  gestureDisabled: i,
984
1214
  gestureMinFlingVelocity: c,
@@ -990,16 +1220,16 @@ class Qe extends vt {
990
1220
  };
991
1221
  }
992
1222
  static getDerivedStateFromProps(t, e) {
993
- const r = e.screenStack.find(
994
- (s) => x(s.ref) && s.ref.current?.focused
1223
+ const s = e.screenStack.find(
1224
+ (r) => O(r.ref) && r.ref.current?.focused
995
1225
  )?.props.config;
996
- return document.title = r?.title ?? document.title, {
997
- gestureDirection: r?.gestureDirection ?? _.gestureDirection,
998
- gestureAreaWidth: r?.gestureAreaWidth ?? _.gestureAreaWidth,
999
- gestureMinFlingVelocity: r?.gestureMinFlingVelocity ?? _.gestureMinFlingVelocity,
1000
- gestureHysteresis: r?.gestureHysteresis ?? _.gestureHysteresis,
1001
- gestureDisabled: r?.gestureDisabled ?? _.gestureDisabled,
1002
- documentTitle: r?.title
1226
+ return document.title = s?.title ?? document.title, {
1227
+ gestureDirection: s?.gestureDirection ?? L.gestureDirection,
1228
+ gestureAreaWidth: s?.gestureAreaWidth ?? L.gestureAreaWidth,
1229
+ gestureMinFlingVelocity: s?.gestureMinFlingVelocity ?? L.gestureMinFlingVelocity,
1230
+ gestureHysteresis: s?.gestureHysteresis ?? L.gestureHysteresis,
1231
+ gestureDisabled: s?.gestureDisabled ?? L.gestureDisabled,
1232
+ documentTitle: s?.title
1003
1233
  };
1004
1234
  }
1005
1235
  componentDidMount() {
@@ -1011,8 +1241,9 @@ class Qe extends vt {
1011
1241
  this.onNavigateSuccess
1012
1242
  ), window.navigation.addEventListener("navigateerror", this.onNavigateError);
1013
1243
  }
1244
+ // TODO: figure out how to remove this
1014
1245
  shouldComponentUpdate(t, e) {
1015
- return !V(this.props.config, t.config) || !V(this.state, e) || this.props.id !== t.id;
1246
+ return !W(this.props.config, t.config) || !W(this.state, e) || this.props.id !== t.id;
1016
1247
  }
1017
1248
  componentWillUnmount() {
1018
1249
  this.ref.current?.removeEventListener("swipestart", this.onSwipeStart), this.ref.current?.removeEventListener("swipeend", this.onSwipeEnd), window.navigation.removeEventListener(
@@ -1027,16 +1258,16 @@ class Qe extends vt {
1027
1258
  );
1028
1259
  }
1029
1260
  onNavigate = () => {
1030
- this.#t = new be();
1261
+ this.#t = new Te();
1031
1262
  };
1032
1263
  onCurrentEntryChange = () => {
1033
- this.#t?.nativeResolve?.(window.navigation.currentEntry);
1264
+ this.#t?.resolve?.(window.navigation.currentEntry);
1034
1265
  };
1035
1266
  onNavigateSuccess = () => {
1036
1267
  this.#t = null;
1037
1268
  };
1038
1269
  onNavigateError = ({ error: t }) => {
1039
- this.#t?.state === "pending" && this.#t.nativeReject?.(t), this.#t = null;
1270
+ this.#t?.state === "pending" && this.#t.reject?.(t), this.#t = null;
1040
1271
  };
1041
1272
  onGestureCancel = () => {
1042
1273
  if (!this.state.transition)
@@ -1048,34 +1279,34 @@ class Qe extends vt {
1048
1279
  canGestureNavigate(t) {
1049
1280
  if (!this.ref.current || this.state.gestureDisabled)
1050
1281
  return !1;
1051
- const e = this.ref.current.getBoundingClientRect(), { direction: r } = t;
1052
- return (r === "down" || r === "right") && !this.navigation.canGoBack() || (r === "up" || r === "left") && !this.navigation.canGoForward() || Ee(r, t, e, this.state.gestureAreaWidth) ? !1 : we(r, this.state.gestureDirection);
1282
+ const e = this.ref.current.getBoundingClientRect(), { direction: s } = t;
1283
+ return (s === "down" || s === "right") && !this.navigation.canGoBack() || (s === "up" || s === "left") && !this.navigation.canGoForward() || Se(s, t, e, this.state.gestureAreaWidth) ? !1 : Pe(s, this.state.gestureDirection);
1053
1284
  }
1054
1285
  onSwipeStart = (t) => {
1055
1286
  if (!this.canGestureNavigate(t) || !this.ref.current || !this.screenTransitionLayer.current)
1056
1287
  return;
1057
- const { direction: e } = t, r = Pe(e) ? "x" : "y";
1058
- let s, i;
1288
+ const { direction: e } = t, s = be(e) ? "x" : "y";
1289
+ let r, i;
1059
1290
  switch (e) {
1060
1291
  case "right":
1061
- s = 0, i = this.ref.current.clientWidth;
1292
+ r = 0, i = this.ref.current.clientWidth;
1062
1293
  break;
1063
1294
  case "left":
1064
- s = this.ref.current.clientWidth, i = 0;
1295
+ r = this.ref.current.clientWidth, i = 0;
1065
1296
  break;
1066
1297
  case "down":
1067
- s = 0, i = this.ref.current.clientHeight;
1298
+ r = 0, i = this.ref.current.clientHeight;
1068
1299
  break;
1069
1300
  case "up":
1070
- s = this.ref.current.clientHeight, i = 0;
1301
+ r = this.ref.current.clientHeight, i = 0;
1071
1302
  break;
1072
1303
  }
1073
- this.screenTransitionLayer.current.animation.timeline = new Lt(
1304
+ this.screenTransitionLayer.current.animation.timeline = new Tt(
1074
1305
  {
1075
1306
  source: this.ref.current,
1076
1307
  type: "swipe",
1077
- axis: r,
1078
- rangeStart: s,
1308
+ axis: s,
1309
+ rangeStart: r,
1079
1310
  rangeEnd: i
1080
1311
  }
1081
1312
  );
@@ -1084,16 +1315,16 @@ class Qe extends vt {
1084
1315
  info: { gesture: o }
1085
1316
  }) : window.navigation.traverseTo(this.navigation.next.key, {
1086
1317
  info: { gesture: o }
1087
- }), this.dispatchEvent(new ue(t));
1318
+ }), this.dispatchEvent(new he(t));
1088
1319
  };
1089
1320
  onSwipeEnd = (t) => {
1090
1321
  if (!this.screenTransitionLayer.current)
1091
1322
  return;
1092
- const e = this.screenTransitionLayer.current.animation.effect?.getComputedTiming().progress ?? 0, r = this.screenTransitionLayer.current.animation.playbackRate;
1323
+ const e = this.screenTransitionLayer.current.animation.effect?.getComputedTiming().progress ?? 0, s = this.screenTransitionLayer.current.animation.playbackRate;
1093
1324
  this.screenTransitionLayer.current.animation.timeline = document.timeline;
1094
- const s = r > 0 ? e > this.state.gestureHysteresis : e < this.state.gestureHysteresis;
1325
+ const r = s > 0 ? e > this.state.gestureHysteresis : e < this.state.gestureHysteresis;
1095
1326
  let i = !1;
1096
- t.velocity < this.state.gestureMinFlingVelocity && !s ? (i = !0, this.screenTransitionLayer.current.animation.reverse(), this.dispatchEvent(new he())) : this.dispatchEvent(new le(t)), i && this.screenTransitionLayer.current.animation.finished.then(() => {
1327
+ t.velocity < this.state.gestureMinFlingVelocity && !r ? (i = !0, this.screenTransitionLayer.current.animation.reverse(), this.dispatchEvent(new fe())) : this.dispatchEvent(new de(t)), i && this.screenTransitionLayer.current.animation.finished.then(() => {
1097
1328
  this.state.controller?.abort("gesture-cancel");
1098
1329
  });
1099
1330
  };
@@ -1102,41 +1333,41 @@ class Qe extends vt {
1102
1333
  }
1103
1334
  get backNavigating() {
1104
1335
  const t = this.state.screenStack.findIndex(
1105
- (r) => r.key === this.state.fromKey
1336
+ (s) => s.key === this.state.fromKey
1106
1337
  ), e = this.state.screenStack.findIndex(
1107
- (r) => r.key === this.state.destinationKey
1338
+ (s) => s.key === this.state.destinationKey
1108
1339
  );
1109
- return e >= 0 && e < t;
1340
+ return e >= U && e < t;
1110
1341
  }
1111
1342
  get screens() {
1112
1343
  const t = this.state.screenStack;
1113
- return t.filter((e, r) => {
1114
- const s = e.ref ?? null, i = t.at(r + 1)?.ref;
1115
- return x(s) && s.current?.config.keepAlive || x(i) && i.current?.config.presentation === "modal" || x(i) && i.current?.config.presentation === "dialog" || e.key === this.navigation.current?.key || e.key === this.state.fromKey || e.key === this.state.destinationKey;
1344
+ return t.filter((e, s) => {
1345
+ const r = e.ref ?? null, i = t.at(s + R)?.ref;
1346
+ return O(r) && r.current?.config.keepAlive || O(i) && i.current?.config.presentation === "modal" || O(i) && i.current?.config.presentation === "dialog" || e.key === this.navigation.current?.key || e.key === this.state.fromKey || e.key === this.state.destinationKey;
1116
1347
  });
1117
1348
  }
1118
- async preload(t, e = {}, r = {}) {
1119
- const { child: s, matchInfo: i } = this.screenChildFromPathname(t) ?? {};
1120
- if (!s)
1349
+ async preload(t, e = {}, s = {}) {
1350
+ const { child: r, matchInfo: i } = this.screenChildFromPathname(t) ?? {};
1351
+ if (!r)
1121
1352
  return Promise.resolve(!1);
1122
- const { navigation: o } = this, { signal: c } = r, { path: l } = s.props;
1353
+ const { navigation: o } = this, { signal: c } = s, { path: u } = r.props;
1123
1354
  return await Promise.all([
1124
- this.preloadScreen(s),
1125
- s.props.config?.onLoad?.({
1355
+ this.preloadScreen(r),
1356
+ r.props.config?.onLoad?.({
1126
1357
  navigation: o,
1127
1358
  signal: c,
1128
1359
  preloading: !0,
1129
1360
  route: {
1130
1361
  focused: !1,
1131
- path: l,
1362
+ path: u,
1132
1363
  resolvedPathname: t,
1133
1364
  config: {
1134
1365
  ...this.props.config?.screenConfig,
1135
- ...s.props.config,
1366
+ ...r.props.config,
1136
1367
  ...e.config
1137
1368
  },
1138
1369
  params: {
1139
- ...s.props.defaultParams,
1370
+ ...r.props.defaultParams,
1140
1371
  ...i?.params,
1141
1372
  ...e.params
1142
1373
  }
@@ -1145,28 +1376,28 @@ class Qe extends vt {
1145
1376
  ]), !0;
1146
1377
  }
1147
1378
  cloneScreenChildFromPathname(t, e) {
1148
- const { child: r } = this.screenChildFromPathname(t) ?? {};
1149
- return r ? (e ??= crypto.randomUUID(), gt(r, {
1379
+ const { child: s } = this.screenChildFromPathname(t) ?? {};
1380
+ return s ? (e ??= crypto.randomUUID(), wt(s, {
1150
1381
  config: {
1151
1382
  title: document.title,
1152
1383
  ...this.props.config?.screenConfig,
1153
- ...r.props.config
1384
+ ...s.props.config
1154
1385
  },
1155
1386
  id: e,
1156
1387
  resolvedPathname: t,
1157
1388
  key: e,
1158
- ref: Pt()
1389
+ ref: _t()
1159
1390
  })) : null;
1160
1391
  }
1161
1392
  getScreenRefByKey(t) {
1162
1393
  const e = this.state.screenStack.find(
1163
- (r) => r.key === t
1394
+ (s) => s.key === t
1164
1395
  )?.ref;
1165
- return x(e) ? e : null;
1396
+ return O(e) ? e : null;
1166
1397
  }
1167
1398
  canIntercept(t) {
1168
- const e = new URL(t.destination.url).pathname, r = this.baseURLPattern.pathname;
1169
- return this.mounted && this.shouldIntercept(t) && pt(this.pathPatterns, e, r);
1399
+ const e = new URL(t.destination.url).pathname, s = this.baseURLPattern.pathname;
1400
+ return this.mounted && this.shouldIntercept(t) && this.includesRoute(e, s);
1170
1401
  }
1171
1402
  shouldIntercept(t) {
1172
1403
  return t.canIntercept && !t.formData && !t.hashChange && !t.downloadRequest || !!this.props.config?.shouldIntercept?.(t);
@@ -1188,46 +1419,46 @@ class Qe extends vt {
1188
1419
  }
1189
1420
  handleLoad(t) {
1190
1421
  const e = () => {
1191
- const r = t.transition?.from?.key ?? null, s = t.destination.key, i = t.transition, o = [], c = this.navigation.entries;
1192
- return c.forEach((l) => {
1193
- if (!l.url)
1422
+ const s = t.transition?.from?.key ?? null, r = t.destination.key, i = t.transition, o = [], c = this.navigation.entries;
1423
+ return c.forEach((u) => {
1424
+ if (!u.url)
1194
1425
  return null;
1195
- const f = this.cloneScreenChildFromPathname(
1196
- l.url.pathname,
1197
- l.key
1426
+ const h = this.cloneScreenChildFromPathname(
1427
+ u.url.pathname,
1428
+ u.key
1198
1429
  );
1199
- if (!f)
1430
+ if (!h)
1200
1431
  return null;
1201
- o.push(f);
1432
+ o.push(h);
1202
1433
  }), new Promise(
1203
- (l, f) => N(() => {
1434
+ (u, h) => $(() => {
1204
1435
  this.setState(
1205
- { screenStack: o, fromKey: r, transition: i, destinationKey: s },
1436
+ { screenStack: o, fromKey: s, transition: i, destinationKey: r },
1206
1437
  async () => {
1207
- const { initialPathname: d } = this.props.config ?? {}, [P] = c;
1208
- if (d && c.length === 1 && P.url && !Y(
1438
+ const { initialPathname: d } = this.props.config ?? {}, [w] = c;
1439
+ if (d && c.length === R && w.url && !X(
1209
1440
  d,
1210
- P.url.pathname,
1441
+ w.url.pathname,
1211
1442
  this.baseURLPattern.pathname
1212
1443
  ))
1213
1444
  return (window.navigation.transition?.finished ?? Promise.resolve()).then(() => {
1214
1445
  this.navigation.replace(d).finished.then(() => {
1215
- const y = t.destination.getState() ?? {};
1216
- this.navigation.push(t.destination.url, y);
1446
+ const m = t.destination.getState() ?? {};
1447
+ this.navigation.push(t.destination.url, m);
1217
1448
  });
1218
- }), l();
1219
- const w = t.signal;
1220
- this.navigation.current?.key === void 0 && f(new Error("Current key is undefined"));
1449
+ }), u();
1450
+ const E = t.signal;
1451
+ this.navigation.current?.key === void 0 && h(new Error("Current key is undefined"));
1221
1452
  const v = this.getScreenRefByKey(
1222
1453
  this.navigation.current.key
1223
1454
  );
1224
1455
  await this.dispatchLifecycleHandlers(
1225
1456
  v,
1226
1457
  null,
1227
- w
1228
- ).catch(f), this.setState(
1458
+ E
1459
+ ).catch(h), this.setState(
1229
1460
  { destinationKey: null, fromKey: null, transition: null },
1230
- l
1461
+ u
1231
1462
  );
1232
1463
  }
1233
1464
  );
@@ -1237,38 +1468,33 @@ class Qe extends vt {
1237
1468
  t.intercept({ handler: e });
1238
1469
  }
1239
1470
  handleReplace(t) {
1240
- const e = this.state.screenStack, r = t.destination, s = new URL(r.url).pathname, i = window.navigation.currentEntry?.key ?? r.key, o = this.cloneScreenChildFromPathname(
1241
- s,
1471
+ const e = this.state.screenStack, s = t.destination, r = new URL(s.url).pathname, i = window.navigation.currentEntry?.key ?? s.key, o = this.cloneScreenChildFromPathname(
1472
+ r,
1242
1473
  i
1243
1474
  );
1244
1475
  if (!o)
1245
1476
  return t.preventDefault();
1246
1477
  const c = () => {
1247
- const l = this.state.transition !== null, f = this.state.transition ?? window.navigation.transition, d = f?.from?.key ?? null, P = e.findIndex(
1478
+ const u = this.state.transition ?? window.navigation.transition, h = u?.from?.key ?? null, d = e.findIndex(
1248
1479
  (w) => w.key === this.navigation.current?.key
1249
1480
  );
1250
- return e.splice(P, 1, o), new Promise(
1251
- (w, v) => N(() => {
1481
+ return e.splice(
1482
+ d,
1483
+ R,
1484
+ o
1485
+ ), new Promise(
1486
+ (w, E) => $(() => {
1252
1487
  this.setState(
1253
- { destinationKey: i, fromKey: d, transition: f, screenStack: e },
1488
+ { destinationKey: i, fromKey: h, transition: u, screenStack: e },
1254
1489
  async () => {
1255
- const p = t.signal, y = this.getScreenRefByKey(String(d)), u = this.getScreenRefByKey(
1490
+ const v = t.signal, p = this.getScreenRefByKey(
1256
1491
  String(i)
1257
- ), a = this.dispatchLifecycleHandlers(
1258
- u,
1492
+ );
1493
+ await this.dispatchLifecycleHandlers(
1494
+ p,
1259
1495
  null,
1260
- p
1261
- ).catch(v);
1262
- if (l) {
1263
- const h = this.screenTransitionLayer.current?.animation.currentTime ?? 0;
1264
- this.screenTransitionLayer.current?.animation.cancel(), await new Promise(requestAnimationFrame);
1265
- const m = this.screenTransition(
1266
- u,
1267
- y
1268
- );
1269
- m && (m.currentTime = h), m?.updatePlaybackRate(1), await m?.finished.catch(v);
1270
- }
1271
- await a, this.setState(
1496
+ v
1497
+ ).catch(E), this.setState(
1272
1498
  { destinationKey: null, fromKey: null, transition: null },
1273
1499
  w
1274
1500
  );
@@ -1280,57 +1506,57 @@ class Qe extends vt {
1280
1506
  t.intercept({ handler: c });
1281
1507
  }
1282
1508
  handleDefault(t) {
1283
- const e = this.state.screenStack, r = t.destination, s = new URL(r.url).pathname;
1284
- if (!this.screenChildFromPathname(s))
1509
+ const e = this.state.screenStack, s = t.destination, r = new URL(s.url).pathname;
1510
+ if (!this.screenChildFromPathname(r))
1285
1511
  return t.preventDefault();
1286
1512
  const i = () => {
1287
- if (me(t.info))
1513
+ if (we(t.info))
1288
1514
  return Promise.resolve();
1289
- const l = window.navigation.transition;
1290
- let f = e.findIndex(
1291
- (p) => p.key === l?.from.key
1515
+ const u = window.navigation.transition;
1516
+ let h = e.findIndex(
1517
+ (p) => p.key === u?.from.key
1292
1518
  );
1293
- f === -1 && t.navigationType === "traverse" && (f = e.findIndex((p) => l?.from.url ? Y(
1519
+ h === k && t.navigationType === "traverse" && (h = e.findIndex((p) => u?.from.url ? X(
1294
1520
  p.props.path,
1295
- new URL(l.from.url).pathname,
1521
+ new URL(u.from.url).pathname,
1296
1522
  this.baseURLPattern.pathname,
1297
1523
  p.props.caseSensitive
1298
1524
  ) : !1));
1299
- const d = (e[f]?.key || l?.from.key) ?? null, P = e.findIndex(
1525
+ const d = (e[h]?.key || u?.from.key) ?? null, w = e.findIndex(
1300
1526
  (p) => p.key === t.destination.key
1301
- ), w = (e[P]?.key || window.navigation.currentEntry?.key) ?? null;
1527
+ ), E = (e[w]?.key || window.navigation.currentEntry?.key) ?? null;
1302
1528
  if (t.navigationType === "push") {
1303
- const p = new URL(r.url).pathname, y = this.cloneScreenChildFromPathname(
1529
+ const p = new URL(s.url).pathname, m = this.cloneScreenChildFromPathname(
1304
1530
  p,
1305
- w
1531
+ E
1306
1532
  );
1307
- if (!y)
1533
+ if (!m)
1308
1534
  return Promise.resolve();
1309
1535
  e.splice(
1310
- f + 1,
1536
+ h + R,
1311
1537
  1 / 0,
1312
1538
  // Remove all screens after current
1313
- y
1539
+ m
1314
1540
  );
1315
1541
  }
1316
1542
  const v = new AbortController();
1317
1543
  return new Promise(
1318
- (p, y) => N(() => {
1544
+ (p, m) => $(() => {
1319
1545
  this.setState(
1320
- { controller: v, destinationKey: w, fromKey: d, transition: l, screenStack: e },
1546
+ { controller: v, destinationKey: E, fromKey: d, transition: u, screenStack: e },
1321
1547
  async () => {
1322
- v.signal.onabort = y;
1323
- const u = t.signal, a = this.getScreenRefByKey(String(d)), h = this.getScreenRefByKey(
1324
- String(w)
1325
- ), m = this.dispatchLifecycleHandlers(
1326
- h,
1548
+ v.signal.onabort = m;
1549
+ const l = t.signal, a = this.getScreenRefByKey(String(d)), f = this.getScreenRefByKey(
1550
+ String(E)
1551
+ ), P = this.dispatchLifecycleHandlers(
1552
+ f,
1327
1553
  a,
1328
- u
1329
- ).catch(y), E = this.screenTransition(
1330
- h,
1554
+ l
1555
+ ).catch(m), y = this.screenTransition(
1556
+ f,
1331
1557
  a
1332
1558
  );
1333
- E?.updatePlaybackRate(1), E?.finished.catch(y), await m, this.setState(
1559
+ y?.updatePlaybackRate(Le), y?.finished.catch(m), await P, this.setState(
1334
1560
  {
1335
1561
  destinationKey: null,
1336
1562
  fromKey: null,
@@ -1345,242 +1571,244 @@ class Qe extends vt {
1345
1571
  );
1346
1572
  };
1347
1573
  let o;
1348
- pe(t.info) ? (o = "after-transition", this.addEventListener("gesture-end", () => t.commit?.(), { once: !0 }), this.addEventListener("gesture-cancel", this.onGestureCancel, {
1574
+ ye(t.info) ? (o = "after-transition", this.addEventListener("gesture-end", () => t.commit?.(), { once: !0 }), this.addEventListener("gesture-cancel", this.onGestureCancel, {
1349
1575
  once: !0
1350
1576
  })) : o = "immediate";
1351
1577
  const c = { handler: i, commit: o };
1352
1578
  t.intercept(c);
1353
1579
  }
1354
- async dispatchLifecycleHandlers(t, e, r) {
1355
- let s = !1;
1356
- this.addEventListener("transition-start", () => s = !0, {
1580
+ async dispatchLifecycleHandlers(t, e, s) {
1581
+ let r = !1;
1582
+ this.addEventListener("transition-start", () => r = !0, {
1357
1583
  once: !0
1358
1584
  }), await Promise.all([
1359
- e?.current?.onExit(r),
1360
- t?.current?.onEnter(r),
1361
- t?.current?.load(r)
1362
- ]), s && await new Promise(
1585
+ e?.current?.onExit(s),
1586
+ t?.current?.onEnter(s),
1587
+ t?.current?.load(s)
1588
+ ]), r && await new Promise(
1363
1589
  (i) => this.addEventListener("transition-end", i, { once: !0 })
1364
1590
  ), !this.state.controller?.signal.aborted && await Promise.all([
1365
- e?.current?.onExited(r).then(() => e.current?.blur()),
1366
- t?.current?.onEntered(r).then(() => t.current?.focus())
1591
+ e?.current?.onExited(s).then(() => e.current?.blur()),
1592
+ t?.current?.onEntered(s).then(() => t.current?.focus())
1367
1593
  ]);
1368
1594
  }
1369
1595
  screenTransition(t, e) {
1370
- const { backNavigating: r } = this;
1371
- if (this.screenTransitionLayer.current && t && e) {
1372
- this.screenTransitionLayer.current.direction = r ? "reverse" : "normal", t.current?.transitionProvider.current && (t.current.transitionProvider.current.exiting = !1), e.current?.transitionProvider.current && (e.current.transitionProvider.current.exiting = !0), this.screenTransitionLayer.current.sharedElementTransitionLayer.current && (this.screenTransitionLayer.current.sharedElementTransitionLayer.current.outgoingScreen = e, this.screenTransitionLayer.current.sharedElementTransitionLayer.current.incomingScreen = t);
1373
- const s = this.screens.findIndex(
1374
- (i) => i.ref === (r ? e : t)
1596
+ const { backNavigating: s } = this, r = this.screenTransitionLayer.current;
1597
+ if (r && t && e) {
1598
+ r.direction = s ? "reverse" : "normal", t.current?.transitionProvider.current && (t.current.transitionProvider.current.exiting = !1), e.current?.transitionProvider.current && (e.current.transitionProvider.current.exiting = !0);
1599
+ const i = r.sharedElementTransitionLayer.current;
1600
+ i && (i.outgoingScreen = e, i.incomingScreen = t);
1601
+ const o = this.screens.findIndex(
1602
+ (c) => c.ref === (s ? e : t)
1375
1603
  );
1376
- return this.screenTransitionLayer.current.screens = this.screens.map((i, o) => (o = o - s + 1, x(i.ref) && i.ref.current?.transitionProvider.current ? (i.ref.current.transitionProvider.current.index = o, i.ref) : null)).filter(x), this.screenTransitionLayer.current.transition();
1604
+ return r.screens = this.screens.map((c, u) => (u = u - o + R, O(c.ref) && c.ref.current?.transitionProvider.current ? (c.ref.current.transitionProvider.current.index = u, c.ref) : null)).filter(O), r.transition();
1377
1605
  }
1378
1606
  }
1379
1607
  }
1380
- function Le() {
1381
- return j("Stack.Navigation"), mt();
1608
+ function Re() {
1609
+ return H("Stack.Navigation"), Et();
1610
+ }
1611
+ function sn() {
1612
+ return H("Stack.Router"), Pt();
1382
1613
  }
1383
- function tn() {
1384
- return j("Stack.Router"), yt();
1614
+ function rn() {
1615
+ return H("Stack.Route"), St();
1385
1616
  }
1386
- function en() {
1387
- return j("Stack.Route"), wt();
1617
+ function an(n, t) {
1618
+ return H("Stack.Params"), bt(n, t);
1388
1619
  }
1389
- function nn(n, t) {
1390
- return j("Stack.Params"), Et(n, t);
1620
+ function G(n, t, e, s) {
1621
+ j(() => {
1622
+ const r = n.current;
1623
+ if (r)
1624
+ return r.addEventListener(t, e, s), () => {
1625
+ r.removeEventListener(t, e, s);
1626
+ };
1627
+ }, [n, t, e, s]);
1391
1628
  }
1392
- function _e(n) {
1393
- const t = Le();
1629
+ function ke(n) {
1630
+ const t = Re();
1394
1631
  return n ?? t;
1395
1632
  }
1396
- function Te(n, t = {}) {
1397
- const e = $(null), r = bt(
1398
- (s) => {
1399
- s.forEach((i) => {
1633
+ function Ie(n, t = {}) {
1634
+ const e = q(null), s = dt(
1635
+ (r) => {
1636
+ r.forEach((i) => {
1400
1637
  i.isIntersecting && n(i);
1401
1638
  });
1402
1639
  },
1403
1640
  [n]
1404
1641
  );
1405
- return C(() => {
1406
- const s = new IntersectionObserver(r, t), i = e.current;
1407
- return i && s.observe(i), () => {
1408
- i && s.unobserve(i);
1642
+ return j(() => {
1643
+ const r = new IntersectionObserver(s, t), i = e.current;
1644
+ return i && r.observe(i), () => {
1645
+ i && r.unobserve(i);
1409
1646
  };
1410
- }, [r, t]), e;
1647
+ }, [s, t]), e;
1411
1648
  }
1412
- function ct(n, t, e, r) {
1413
- C(() => {
1414
- const s = n.current;
1415
- if (s)
1416
- return s.addEventListener(t, e, r), () => {
1417
- s.removeEventListener(t, e, r);
1418
- };
1419
- }, [n, t, e, r]);
1420
- }
1421
- function Re(n, { forceThreshold: t = Se } = {}) {
1422
- const e = $(null), r = () => n(!0), s = (i) => {
1649
+ function xe(n, { forceThreshold: t = _e } = {}) {
1650
+ const e = q(null), s = () => n(!0), r = (i) => {
1423
1651
  const o = i.touches[0];
1424
1652
  o && o.force >= t && n(!0);
1425
1653
  };
1426
- return ct(e, "mouseenter", r), ct(e, "touchstart", s), e;
1654
+ return G(e, "mouseenter", s), G(e, "touchstart", r), e;
1427
1655
  }
1428
- function rn({
1656
+ function on({
1429
1657
  preload: n,
1430
1658
  goBack: t,
1431
1659
  params: e = {},
1432
- type: r = "push",
1433
- href: s,
1660
+ type: s = "push",
1661
+ href: r,
1434
1662
  navigation: i,
1435
1663
  onClick: o,
1436
1664
  preloadBehaviour: c = {
1437
1665
  type: "onsight"
1438
1666
  },
1439
- children: l,
1440
- ...f
1667
+ children: u,
1668
+ ...h
1441
1669
  }) {
1442
- const d = _e(i), P = c?.type === "onsight", w = c?.type === "onhover", v = c?.type === "force", p = Te(
1670
+ const d = ke(i), w = c?.type === "onsight", E = c?.type === "onhover", v = c?.type === "force", p = Ie(
1443
1671
  (S) => {
1444
- !S.isIntersecting || !n || d.preload(s, { params: e });
1672
+ !S.isIntersecting || !n || d.preload(r, { params: e });
1445
1673
  },
1446
- P ? c : {}
1447
- ), y = Re(
1674
+ w ? c : {}
1675
+ ), m = xe(
1448
1676
  (S) => {
1449
- !S || !n || d.preload(s, { params: e });
1677
+ !S || !n || d.preload(r, { params: e });
1450
1678
  },
1451
- w ? c : {}
1679
+ E ? c : {}
1452
1680
  );
1453
- C(() => {
1454
- !n || !v || d.preload(s, { params: e });
1455
- }, [n, s, d, v, e]);
1456
- const [u, a] = St(void 0), h = d?.routerId, E = !u?.includes(window.location.origin) ? "noopener noreferrer" : t ? "prev" : "next";
1457
- C(() => {
1681
+ j(() => {
1682
+ !n || !v || d.preload(r, { params: e });
1683
+ }, [n, r, d, v, e]);
1684
+ const [l, a] = Lt(void 0), f = d?.routerId, y = !l?.includes(window.location.origin) ? "noopener noreferrer" : t ? "prev" : "next";
1685
+ j(() => {
1458
1686
  if (t && d.canGoBack())
1459
1687
  a(d.previous.url?.href);
1460
- else if (s) {
1461
- const S = ge(e), X = new URL(s, d.baseURL);
1462
- X.search = S, a(X.href);
1688
+ else if (r) {
1689
+ const S = me(e), N = new URL(r, d.baseURL);
1690
+ N.search = S, a(N.href);
1463
1691
  }
1464
- }, [s, e, d, t]);
1692
+ }, [r, e, d, t]);
1465
1693
  const b = (S) => {
1466
- t ? (S.preventDefault(), d.goBack()) : r === "replace" && s && (S.preventDefault(), d.replace(s)), o?.(S);
1694
+ t ? (S.preventDefault(), d.goBack()) : s === "replace" && r && (S.preventDefault(), d.replace(r)), o?.(S);
1467
1695
  };
1468
- let k;
1696
+ let x;
1469
1697
  switch (c?.type) {
1470
1698
  case "onhover":
1471
- k = y;
1699
+ x = m;
1472
1700
  break;
1473
1701
  case "onsight":
1474
- k = p;
1702
+ x = p;
1475
1703
  break;
1476
1704
  default:
1477
- k = null;
1705
+ x = null;
1478
1706
  }
1479
- return /* @__PURE__ */ ut(
1707
+ return /* @__PURE__ */ ft(
1480
1708
  "a",
1481
1709
  {
1482
- href: u,
1483
- "data-router-id": h,
1710
+ href: l,
1711
+ "data-router-id": f,
1484
1712
  onClick: b,
1485
- rel: E,
1486
- ref: k,
1487
- ...f,
1488
- children: l
1713
+ rel: y,
1714
+ ref: x,
1715
+ ...h,
1716
+ children: u
1489
1717
  }
1490
1718
  );
1491
1719
  }
1492
- const sn = [
1720
+ const cn = [
1493
1721
  {
1494
1722
  transform: "translateX(100vw)"
1495
1723
  },
1496
1724
  {
1497
1725
  transform: "translateX(0vw)"
1498
1726
  }
1499
- ], ke = [
1727
+ ], Fe = [
1500
1728
  {
1501
1729
  transform: "translateX(100vw)"
1502
1730
  },
1503
1731
  {
1504
1732
  transform: "translateX(0vw)"
1505
1733
  }
1506
- ], an = [
1734
+ ], un = [
1507
1735
  {
1508
1736
  transform: "translateX(0vw)"
1509
1737
  },
1510
1738
  {
1511
1739
  transform: "translateX(-50vw)"
1512
1740
  }
1513
- ], Ie = [
1741
+ ], Oe = [
1514
1742
  {
1515
1743
  transform: "translateX(0vw)"
1516
1744
  },
1517
1745
  {
1518
1746
  transform: "translateX(calc(100vw * -0.3))"
1519
1747
  }
1520
- ], on = [
1748
+ ], ln = [
1521
1749
  {
1522
1750
  transform: "translateX(-100vw)"
1523
1751
  },
1524
1752
  {
1525
1753
  transform: "translateX(0vw)"
1526
1754
  }
1527
- ], xe = [
1755
+ ], De = [
1528
1756
  {
1529
1757
  transform: "translateX(-100vw)"
1530
1758
  },
1531
1759
  {
1532
1760
  transform: "translateX(0vw)"
1533
1761
  }
1534
- ], cn = [
1762
+ ], hn = [
1535
1763
  {
1536
1764
  transform: "translateX(0vw)"
1537
1765
  },
1538
1766
  {
1539
1767
  transform: "translateX(50vw)"
1540
1768
  }
1541
- ], Fe = [
1769
+ ], Me = [
1542
1770
  {
1543
1771
  transform: "translateX(0vw)"
1544
1772
  },
1545
1773
  {
1546
1774
  transform: "translateX(calc(100vw * 0.3))"
1547
1775
  }
1548
- ], un = [
1776
+ ], dn = [
1549
1777
  {
1550
1778
  transform: "translateY(100vh)"
1551
1779
  },
1552
1780
  {
1553
1781
  transform: "translateY(0vh)"
1554
1782
  }
1555
- ], Oe = [
1783
+ ], Ke = [
1556
1784
  {
1557
1785
  transform: "translateY(100vh)"
1558
1786
  },
1559
1787
  {
1560
1788
  transform: "translateY(0vh)"
1561
1789
  }
1562
- ], ln = [
1790
+ ], fn = [
1563
1791
  {
1564
1792
  transform: "translateY(0vh)"
1565
1793
  },
1566
1794
  {
1567
1795
  transform: "translateY(-50vh)"
1568
1796
  }
1569
- ], hn = [
1797
+ ], vn = [
1570
1798
  {
1571
1799
  transform: "translateY(-100vh)"
1572
1800
  },
1573
1801
  {
1574
1802
  transform: "translateY(0vh)"
1575
1803
  }
1576
- ], dn = [
1804
+ ], gn = [
1577
1805
  {
1578
1806
  transform: "translateY(0vh)"
1579
1807
  },
1580
1808
  {
1581
1809
  transform: "translateY(50vh)"
1582
1810
  }
1583
- ], fn = [
1811
+ ], pn = [
1584
1812
  {
1585
1813
  transform: "scale(0.85)",
1586
1814
  opacity: 0
@@ -1589,7 +1817,7 @@ const sn = [
1589
1817
  transform: "scale(1)",
1590
1818
  opacity: 1
1591
1819
  }
1592
- ], vn = [
1820
+ ], mn = [
1593
1821
  {
1594
1822
  transform: "scale(1)",
1595
1823
  opacity: 1
@@ -1598,21 +1826,21 @@ const sn = [
1598
1826
  transform: "scale(1.15)",
1599
1827
  opacity: 0
1600
1828
  }
1601
- ], gn = [
1829
+ ], yn = [
1602
1830
  {
1603
1831
  opacity: 0
1604
1832
  },
1605
1833
  {
1606
1834
  opacity: 1
1607
1835
  }
1608
- ], pn = [
1836
+ ], wn = [
1609
1837
  {
1610
1838
  opacity: 1
1611
1839
  },
1612
1840
  {
1613
1841
  opacity: 0
1614
1842
  }
1615
- ], De = [
1843
+ ], Be = [
1616
1844
  {
1617
1845
  opacity: 0,
1618
1846
  transform: "translateY(calc(100vh * 0.08))"
@@ -1629,7 +1857,7 @@ const sn = [
1629
1857
  opacity: 1,
1630
1858
  transform: "translateY(0vh)"
1631
1859
  }
1632
- ], Ke = [
1860
+ ], Ye = [
1633
1861
  {
1634
1862
  opacity: 0,
1635
1863
  transform: "translateY(96vw)"
@@ -1638,7 +1866,7 @@ const sn = [
1638
1866
  opacity: 1,
1639
1867
  transform: "translateY(0vw)"
1640
1868
  }
1641
- ], Me = [
1869
+ ], Ce = [
1642
1870
  {
1643
1871
  opacity: 0,
1644
1872
  transform: "translateY(0vw)"
@@ -1647,21 +1875,21 @@ const sn = [
1647
1875
  opacity: 1,
1648
1876
  transform: "translateY(-96vw)"
1649
1877
  }
1650
- ], Be = [
1878
+ ], Xe = [
1651
1879
  {
1652
1880
  transform: "translateY(100vh)"
1653
1881
  },
1654
1882
  {
1655
1883
  transform: "translateY(0vh)"
1656
1884
  }
1657
- ], Ye = [
1885
+ ], Ue = [
1658
1886
  {
1659
1887
  transform: "translateY(0vh)"
1660
1888
  },
1661
1889
  {
1662
1890
  transform: "translateY(-2vh)"
1663
1891
  }
1664
- ], Ce = [
1892
+ ], Ne = [
1665
1893
  {
1666
1894
  transform: "scale(0.85)",
1667
1895
  opacity: 0
@@ -1678,7 +1906,7 @@ const sn = [
1678
1906
  transform: "scale(1)",
1679
1907
  opacity: 1
1680
1908
  }
1681
- ], Xe = [
1909
+ ], je = [
1682
1910
  {
1683
1911
  transform: "scale(1)",
1684
1912
  opacity: 1
@@ -1695,7 +1923,7 @@ const sn = [
1695
1923
  transform: "scale(1.075)",
1696
1924
  opacity: 0
1697
1925
  }
1698
- ], je = [
1926
+ ], He = [
1699
1927
  {
1700
1928
  transform: "translateY(calc(100vh * 0.8))",
1701
1929
  opacity: 0
@@ -1705,145 +1933,142 @@ const sn = [
1705
1933
  opacity: 1
1706
1934
  }
1707
1935
  ];
1708
- function Ue(n) {
1936
+ function Ae(n) {
1709
1937
  return (t) => 1 - n(1 - t);
1710
1938
  }
1711
- function He(n) {
1939
+ function Ve(n) {
1712
1940
  return (t) => Math.pow(t, n);
1713
1941
  }
1714
- const tt = {
1715
- ..._t({
1942
+ const rt = {
1943
+ ...Rt({
1716
1944
  mass: 3,
1717
1945
  stiffness: 1e3,
1718
1946
  damping: 500,
1719
1947
  velocity: 0,
1720
1948
  steps: 200
1721
1949
  })
1722
- }, lt = {
1950
+ }, vt = {
1723
1951
  duration: 350,
1724
- easing: A(Ue(He(5)))
1725
- }, Ne = {
1952
+ easing: z(Ae(Ve(5)))
1953
+ }, $e = {
1726
1954
  duration: 150,
1727
1955
  easing: "linear"
1728
- }, Ve = {
1956
+ }, We = {
1729
1957
  duration: 425,
1730
1958
  easing: "cubic-bezier(0.35, 0.45, 0, 1)"
1731
- }, $e = {
1959
+ }, Ge = {
1732
1960
  duration: 400,
1733
1961
  easing: "cubic-bezier(0.35, 0.45, 0, 1)"
1734
- }, Ae = {
1962
+ }, qe = {
1735
1963
  duration: 250,
1736
- easing: A((n) => Math.cos((n + 1) * Math.PI) / 2 + 0.5)
1737
- }, We = {
1964
+ easing: z((n) => Math.cos((n + 1) * Math.PI) / 2 + 0.5)
1965
+ }, ze = {
1738
1966
  duration: 200,
1739
- easing: A((n) => n === 1 ? 1 : Math.pow(n, 2))
1967
+ easing: z((n) => n === 1 ? 1 : Math.pow(n, 2))
1740
1968
  };
1741
- function mn({ ref: n, direction: t, playbackRate: e, index: r }) {
1969
+ function En({ ref: n, direction: t, playbackRate: e, index: s }) {
1742
1970
  let i = [
1743
- Ie,
1744
- ke
1745
- ][r];
1971
+ Oe,
1972
+ Fe
1973
+ ][s];
1746
1974
  const o = {
1747
1975
  playbackRate: e,
1748
1976
  fill: "forwards",
1749
- ...tt
1977
+ ...rt
1750
1978
  };
1751
1979
  return t === "reverse" && (i = i.toReversed()), new KeyframeEffect(n, i, o);
1752
1980
  }
1753
- function yn({ ref: n, direction: t, playbackRate: e, index: r }) {
1981
+ function Pn({ ref: n, direction: t, playbackRate: e, index: s }) {
1754
1982
  let i = [
1755
- Fe,
1756
- xe
1757
- ][r];
1983
+ Me,
1984
+ De
1985
+ ][s];
1758
1986
  const o = {
1759
1987
  playbackRate: e,
1760
1988
  fill: "forwards",
1761
- ...tt
1989
+ ...rt
1762
1990
  };
1763
1991
  return t === "reverse" && (i = i.toReversed()), new KeyframeEffect(n, i, o);
1764
1992
  }
1765
- function wn({ ref: n, direction: t, playbackRate: e }) {
1766
- let r = Oe;
1767
- const s = {
1993
+ function Sn({ ref: n, direction: t, playbackRate: e }) {
1994
+ let s = Ke;
1995
+ const r = {
1768
1996
  playbackRate: e,
1769
1997
  fill: "forwards",
1770
- ...tt
1998
+ ...rt
1771
1999
  };
1772
- return t === "reverse" && (r = r.toReversed()), new KeyframeEffect(n, r, s);
2000
+ return t === "reverse" && (s = s.toReversed()), new KeyframeEffect(n, s, r);
1773
2001
  }
1774
- function En({ ref: n, direction: t, playbackRate: e }) {
1775
- let r = De;
1776
- const s = {
2002
+ function bn({ ref: n, direction: t, playbackRate: e }) {
2003
+ let s = Be;
2004
+ const r = {
1777
2005
  playbackRate: e,
1778
2006
  fill: "forwards",
1779
- ...lt
2007
+ ...vt
1780
2008
  };
1781
- return t === "reverse" && (r = r.toReversed()), new KeyframeEffect(n, r, s);
2009
+ return t === "reverse" && (s = s.toReversed()), new KeyframeEffect(n, s, r);
1782
2010
  }
1783
- function Pn({ ref: n, direction: t, index: e, playbackRate: r }) {
1784
- let s = je, i;
1785
- e === 0 ? i = We : i = Ae;
2011
+ function _n({ ref: n, direction: t, index: e, playbackRate: s }) {
2012
+ let r = He, i;
2013
+ e === U ? i = ze : i = qe;
1786
2014
  const o = {
1787
- playbackRate: r,
2015
+ playbackRate: s,
1788
2016
  fill: "forwards",
1789
2017
  ...i
1790
2018
  };
1791
- return t === "reverse" && (s = s.toReversed()), new KeyframeEffect(n, s, o);
2019
+ return t === "reverse" && (r = r.toReversed()), new KeyframeEffect(n, r, o);
1792
2020
  }
1793
- function Sn({ ref: n, direction: t, index: e, playbackRate: r }) {
2021
+ function Ln({ ref: n, direction: t, index: e, playbackRate: s }) {
1794
2022
  const i = [
1795
- Ye,
1796
- Be
2023
+ Ue,
2024
+ Xe
1797
2025
  ][e], o = {
1798
2026
  direction: t,
1799
- playbackRate: r,
2027
+ playbackRate: s,
1800
2028
  fill: "forwards",
1801
- ...Ve
2029
+ ...We
1802
2030
  };
1803
2031
  return new KeyframeEffect(n, i, o);
1804
2032
  }
1805
- function bn({ ref: n, direction: t, index: e, playbackRate: r }) {
1806
- const s = [
1807
- Me,
1808
- Ke
2033
+ function Tn({ ref: n, direction: t, index: e, playbackRate: s }) {
2034
+ const r = [
2035
+ Ce,
2036
+ Ye
1809
2037
  ];
1810
2038
  let i;
1811
- e === 0 ? i = Ne : i = lt;
1812
- let o = s[e];
2039
+ e === U ? i = $e : i = vt;
2040
+ let o = r[e];
1813
2041
  const c = {
1814
- playbackRate: r,
2042
+ playbackRate: s,
1815
2043
  fill: "forwards",
1816
2044
  ...i
1817
2045
  };
1818
2046
  return t === "reverse" && (o = o.toReversed()), new KeyframeEffect(n, o, c);
1819
2047
  }
1820
- function Ln({ ref: n, direction: t, index: e, playbackRate: r }) {
2048
+ function Rn({ ref: n, direction: t, index: e, playbackRate: s }) {
1821
2049
  const i = [
1822
- Xe,
1823
- Ce
2050
+ je,
2051
+ Ne
1824
2052
  ][e], o = {
1825
2053
  direction: t,
1826
- playbackRate: r,
2054
+ playbackRate: s,
1827
2055
  fill: "forwards",
1828
- ...$e
2056
+ ...Ge
1829
2057
  };
1830
2058
  return new KeyframeEffect(n, i, o);
1831
2059
  }
1832
- function _n({ disabled: n, children: t, ...e }) {
1833
- const r = $(null);
1834
- return C(() => {
1835
- if (n)
1836
- return;
1837
- const s = (i) => {
1838
- i.stopPropagation(), i.preventDefault();
1839
- };
1840
- return r.current?.addEventListener("swipestart", s), () => {
1841
- r.current?.removeEventListener("swipestart", s);
1842
- };
1843
- }, [r, n]), /* @__PURE__ */ ut(
2060
+ function kn({ disabled: n, children: t, ...e }) {
2061
+ const s = q(null), r = dt((i) => {
2062
+ n || (i.stopPropagation(), i.preventDefault());
2063
+ }, [n]);
2064
+ return G(
2065
+ s,
2066
+ "swipestart",
2067
+ r
2068
+ ), /* @__PURE__ */ ft(
1844
2069
  "div",
1845
2070
  {
1846
- ref: r,
2071
+ ref: s,
1847
2072
  className: "gesture-region",
1848
2073
  "data-disabled": n,
1849
2074
  style: { display: "contents" },
@@ -1853,59 +2078,60 @@ function _n({ disabled: n, children: t, ...e }) {
1853
2078
  );
1854
2079
  }
1855
2080
  export {
1856
- rn as Anchor,
1857
- gn as FadeInKeyframes,
1858
- pn as FadeOutKeyframes,
1859
- _n as GestureRegion,
1860
- de as HistoryEntry,
1861
- fe as Navigation,
1862
- Qe as Router,
1863
- Je as Screen,
1864
- un as SlideInFromBottomKeyframes,
1865
- on as SlideInFromLeftKeyframes,
1866
- sn as SlideInFromRightKeyframes,
1867
- hn as SlideInFromTopKeyframes,
1868
- dn as SlideOutToBottomKeyframes,
1869
- an as SlideOutToLeftKeyframes,
1870
- cn as SlideOutToRightKeyframes,
1871
- ln as SlideOutToTopKeyframes,
1872
- fn as ZoomInKeyframes,
1873
- vn as ZoomOutKeyframes,
1874
- Ae as androidBottomSheetSlideInOptions,
1875
- We as androidBottomSheetSlideOutOptions,
1876
- Ye as androidConcealToBottomKeyframes,
1877
- En as androidFadeInFromBottom,
1878
- De as androidFadeInFromBottomKeyframes,
1879
- lt as androidFadeInFromBottomOptions,
1880
- Pn as androidFadeInFromBottomSheet,
1881
- je as androidFadeInFromBottomSheetKeyframes,
1882
- bn as androidFadeInFromRight,
1883
- Ke as androidFadeInFromRightKeyframes,
1884
- Ne as androidFadeOutToBottomOptions,
1885
- Me as androidFadeOutToLeftKeyframes,
1886
- Sn as androidRevealFromBottom,
1887
- Be as androidRevealFromBottomKeyframes,
1888
- Ve as androidRevealFromBottomOptions,
1889
- Ln as androidScaleFromCentre,
1890
- Ce as androidScaleFromCentreKeyframes,
1891
- $e as androidScaleFromCentreOptions,
1892
- Xe as androidScaleToCentreKeyframes,
1893
- tt as iOSKeyframeOptions,
1894
- wn as iOSSlideInFromBottom,
1895
- Oe as iOSSlideInFromBottomKeyframes,
1896
- yn as iOSSlideInFromLeft,
1897
- xe as iOSSlideInFromLeftKeyframes,
1898
- mn as iOSSlideInFromRight,
1899
- ke as iOSSlideInFromRightKeyframes,
1900
- Ie as iOSSlideOutToLeftKeyframes,
1901
- Fe as iOSSlideOutToRightKeyframes,
1902
- Pe as isHorizontalDirection,
1903
- Ee as isOutOfBounds,
1904
- x as isRefObject,
1905
- we as isSupportedDirection,
1906
- Le as useNavigation,
1907
- nn as useParams,
1908
- en as useRoute,
1909
- tn as useRouter
2081
+ on as Anchor,
2082
+ yn as FadeInKeyframes,
2083
+ wn as FadeOutKeyframes,
2084
+ kn as GestureRegion,
2085
+ ve as HistoryEntry,
2086
+ ge as Navigation,
2087
+ nn as Router,
2088
+ en as Screen,
2089
+ dn as SlideInFromBottomKeyframes,
2090
+ ln as SlideInFromLeftKeyframes,
2091
+ cn as SlideInFromRightKeyframes,
2092
+ vn as SlideInFromTopKeyframes,
2093
+ gn as SlideOutToBottomKeyframes,
2094
+ un as SlideOutToLeftKeyframes,
2095
+ hn as SlideOutToRightKeyframes,
2096
+ fn as SlideOutToTopKeyframes,
2097
+ pn as ZoomInKeyframes,
2098
+ mn as ZoomOutKeyframes,
2099
+ qe as androidBottomSheetSlideInOptions,
2100
+ ze as androidBottomSheetSlideOutOptions,
2101
+ Ue as androidConcealToBottomKeyframes,
2102
+ bn as androidFadeInFromBottom,
2103
+ Be as androidFadeInFromBottomKeyframes,
2104
+ vt as androidFadeInFromBottomOptions,
2105
+ _n as androidFadeInFromBottomSheet,
2106
+ He as androidFadeInFromBottomSheetKeyframes,
2107
+ Tn as androidFadeInFromRight,
2108
+ Ye as androidFadeInFromRightKeyframes,
2109
+ $e as androidFadeOutToBottomOptions,
2110
+ Ce as androidFadeOutToLeftKeyframes,
2111
+ Ln as androidRevealFromBottom,
2112
+ Xe as androidRevealFromBottomKeyframes,
2113
+ We as androidRevealFromBottomOptions,
2114
+ Rn as androidScaleFromCentre,
2115
+ Ne as androidScaleFromCentreKeyframes,
2116
+ Ge as androidScaleFromCentreOptions,
2117
+ je as androidScaleToCentreKeyframes,
2118
+ rt as iOSKeyframeOptions,
2119
+ Sn as iOSSlideInFromBottom,
2120
+ Ke as iOSSlideInFromBottomKeyframes,
2121
+ Pn as iOSSlideInFromLeft,
2122
+ De as iOSSlideInFromLeftKeyframes,
2123
+ En as iOSSlideInFromRight,
2124
+ Fe as iOSSlideInFromRightKeyframes,
2125
+ Oe as iOSSlideOutToLeftKeyframes,
2126
+ Me as iOSSlideOutToRightKeyframes,
2127
+ be as isHorizontalDirection,
2128
+ Se as isOutOfBounds,
2129
+ O as isRefObject,
2130
+ Pe as isSupportedDirection,
2131
+ G as useEventListener,
2132
+ Re as useNavigation,
2133
+ an as useParams,
2134
+ rn as useRoute,
2135
+ sn as useRouter
1910
2136
  };
1911
2137
  //# sourceMappingURL=index.js.map