@argon-router/core 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,176 +1,176 @@
1
- import { createEffect as P, createStore as O, createEvent as w, sample as g, split as V, attach as C, scopeBind as Q, withFactory as U } from "effector";
2
- import { spread as L } from "patronum";
3
- function B(t, n) {
4
- var e = Object.keys(t);
1
+ import { createEffect as R, createStore as E, createEvent as x, sample as F, split as fe, attach as V, scopeBind as ue, withFactory as le } from "effector";
2
+ import { spread as de } from "patronum";
3
+ function z(e, t) {
4
+ var r = Object.keys(e);
5
5
  if (Object.getOwnPropertySymbols) {
6
- var r = Object.getOwnPropertySymbols(t);
7
- n && (r = r.filter(function(s) {
8
- return Object.getOwnPropertyDescriptor(t, s).enumerable;
9
- })), e.push.apply(e, r);
6
+ var n = Object.getOwnPropertySymbols(e);
7
+ t && (n = n.filter(function(a) {
8
+ return Object.getOwnPropertyDescriptor(e, a).enumerable;
9
+ })), r.push.apply(r, n);
10
10
  }
11
- return e;
11
+ return r;
12
12
  }
13
- function T(t) {
14
- for (var n = 1; n < arguments.length; n++) {
15
- var e = arguments[n] != null ? arguments[n] : {};
16
- n % 2 ? B(Object(e), !0).forEach(function(r) {
17
- W(t, r, e[r]);
18
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : B(Object(e)).forEach(function(r) {
19
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(e, r));
13
+ function C(e) {
14
+ for (var t = 1; t < arguments.length; t++) {
15
+ var r = arguments[t] != null ? arguments[t] : {};
16
+ t % 2 ? z(Object(r), !0).forEach(function(n) {
17
+ pe(e, n, r[n]);
18
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : z(Object(r)).forEach(function(n) {
19
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
20
20
  });
21
21
  }
22
- return t;
22
+ return e;
23
23
  }
24
- function W(t, n, e) {
25
- return (n = G(n)) in t ? Object.defineProperty(t, n, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = e, t;
24
+ function pe(e, t, r) {
25
+ return (t = me(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
26
26
  }
27
- function G(t) {
28
- var n = X(t, "string");
29
- return typeof n == "symbol" ? n : n + "";
27
+ function me(e) {
28
+ var t = ye(e, "string");
29
+ return typeof t == "symbol" ? t : t + "";
30
30
  }
31
- function X(t, n) {
32
- if (typeof t != "object" || !t) return t;
33
- var e = t[Symbol.toPrimitive];
34
- if (e !== void 0) {
35
- var r = e.call(t, n || "default");
36
- if (typeof r != "object") return r;
31
+ function ye(e, t) {
32
+ if (typeof e != "object" || !e) return e;
33
+ var r = e[Symbol.toPrimitive];
34
+ if (r !== void 0) {
35
+ var n = r.call(e, t || "default");
36
+ if (typeof n != "object") return n;
37
37
  throw new TypeError("@@toPrimitive must return a primitive value.");
38
38
  }
39
- return (n === "string" ? String : Number)(t);
39
+ return (t === "string" ? String : Number)(e);
40
40
  }
41
- function we(t) {
42
- let n;
43
- const e = P(() => {
44
- var y;
45
- return (y = n) === null || y === void 0 ? void 0 : y();
41
+ function Qe(e) {
42
+ let t;
43
+ const r = R(() => {
44
+ var h;
45
+ return (h = t) === null || h === void 0 ? void 0 : h();
46
46
  }, {
47
47
  name: "waitForAsyncBundleFx",
48
48
  sid: "hl1gh5"
49
- }), r = P(async () => {
50
- for (const l of (y = t.beforeOpen) !== null && y !== void 0 ? y : []) {
51
- var y;
52
- await l();
49
+ }), n = R(async () => {
50
+ for (const u of (h = e.beforeOpen) !== null && h !== void 0 ? h : []) {
51
+ var h;
52
+ await u();
53
53
  }
54
54
  }, {
55
55
  name: "beforeOpenFx",
56
56
  sid: "jez0xa"
57
- }), s = P(async (y) => (await e(), await r(), t.parent && await t.parent.internal.openFx(T(T({}, y), {}, {
57
+ }), a = R(async (h) => (await r(), await n(), e.parent && await e.parent.internal.openFx(C(C({}, h), {}, {
58
58
  historyIgnore: !0
59
- })), y), {
59
+ })), h), {
60
60
  name: "openFx",
61
61
  sid: "-uafnek"
62
- }), o = O({}, {
62
+ }), s = E({}, {
63
63
  name: "$params",
64
64
  sid: "dlh2xl"
65
- }), a = O(!1, {
65
+ }), o = E(!1, {
66
66
  name: "$isOpened",
67
67
  sid: "lcu7f1"
68
- }), i = s.pending, u = w({
68
+ }), i = a.pending, c = x({
69
69
  name: "open",
70
70
  sid: "-qjaufd"
71
- }), c = w({
71
+ }), f = x({
72
72
  name: "close",
73
73
  sid: "-6cg68t"
74
- }), d = w({
74
+ }), m = x({
75
75
  name: "opened",
76
76
  sid: "-a2kpe7"
77
- }), p = w({
77
+ }), d = x({
78
78
  name: "openedOnServer",
79
79
  sid: "-u0yshs"
80
- }), h = w({
80
+ }), b = x({
81
81
  name: "openedOnClient",
82
82
  sid: "-u3faft"
83
- }), v = w({
83
+ }), w = x({
84
84
  name: "closed",
85
85
  sid: "-d6sqbp"
86
86
  });
87
- return g({
87
+ return F({
88
88
  and: [{
89
- clock: u,
90
- target: s
89
+ clock: c,
90
+ target: a
91
91
  }],
92
92
  or: {
93
93
  sid: "sre3h1"
94
94
  }
95
- }), V({
95
+ }), fe({
96
96
  and: [{
97
- source: s.doneData,
97
+ source: a.doneData,
98
98
  match: () => typeof window > "u" ? "server" : "client",
99
99
  cases: {
100
- server: p,
101
- client: h
100
+ server: d,
101
+ client: b
102
102
  }
103
103
  }],
104
104
  or: {
105
105
  sid: "t5oqwf"
106
106
  }
107
- }), g({
107
+ }), F({
108
108
  and: [{
109
- clock: [h, p],
110
- target: d
109
+ clock: [b, d],
110
+ target: m
111
111
  }],
112
112
  or: {
113
113
  sid: "tamw8o"
114
114
  }
115
- }), g({
115
+ }), F({
116
116
  and: [{
117
- clock: d,
117
+ clock: m,
118
118
  fn: () => !0,
119
- target: a
119
+ target: o
120
120
  }],
121
121
  or: {
122
122
  sid: "toxjo2"
123
123
  }
124
- }), g({
124
+ }), F({
125
125
  and: [{
126
- clock: c,
127
- target: v
126
+ clock: f,
127
+ target: w
128
128
  }],
129
129
  or: {
130
130
  sid: "u3rzot"
131
131
  }
132
- }), g({
132
+ }), F({
133
133
  and: [{
134
- clock: v,
134
+ clock: w,
135
135
  fn: () => !1,
136
- target: a
136
+ target: o
137
137
  }],
138
138
  or: {
139
139
  sid: "u6iynm"
140
140
  }
141
141
  }), {
142
- $params: o,
143
- $isOpened: a,
142
+ $params: s,
143
+ $isOpened: o,
144
144
  $isPending: i,
145
- open: u,
146
- closed: v,
147
- opened: d,
148
- openedOnClient: h,
149
- openedOnServer: p,
150
- internal: T({
145
+ open: c,
146
+ closed: w,
147
+ opened: m,
148
+ openedOnClient: b,
149
+ openedOnServer: d,
150
+ internal: C({
151
151
  index: !1,
152
- close: c,
153
- openFx: s,
154
- setAsyncImport: (y) => n = y
155
- }, t),
152
+ close: f,
153
+ openFx: a,
154
+ setAsyncImport: (h) => t = h
155
+ }, e),
156
156
  "@@unitShape": () => ({
157
- params: o,
157
+ params: s,
158
158
  isPending: i,
159
- isOpened: a,
160
- onOpen: u
159
+ isOpened: o,
160
+ onOpen: c
161
161
  })
162
162
  };
163
163
  }
164
- var k = {};
165
- Object.defineProperty(k, "__esModule", {
164
+ var j = {};
165
+ Object.defineProperty(j, "__esModule", {
166
166
  value: !0
167
167
  });
168
- k.TokenData = void 0;
169
- k.parse = N;
170
- var Y = k.compile = se, Z = k.match = ae;
171
- k.pathToRegexp = K;
172
- k.stringify = ue;
173
- const F = "/", I = (t) => t, J = /^[$_\p{ID_Start}]$/u, D = /^[$\u200c\u200d\p{ID_Continue}]$/u, A = "https://git.new/pathToRegexpError", ee = {
168
+ j.TokenData = void 0;
169
+ j.parse = L;
170
+ var he = j.compile = $e, ge = j.match = Oe;
171
+ j.pathToRegexp = Z;
172
+ j.stringify = Ae;
173
+ const _ = "/", v = (e) => e, X = /^[$_\p{ID_Start}]$/u, q = /^[$\u200c\u200d\p{ID_Continue}]$/u, I = "https://git.new/pathToRegexpError", be = {
174
174
  // Groups.
175
175
  "{": "{",
176
176
  "}": "}",
@@ -183,357 +183,357 @@ const F = "/", I = (t) => t, J = /^[$_\p{ID_Start}]$/u, D = /^[$\u200c\u200d\p{I
183
183
  "?": "?",
184
184
  "!": "!"
185
185
  };
186
- function te(t) {
187
- return t.replace(/[{}()\[\]+?!:*]/g, "\\$&");
188
- }
189
- function x(t) {
190
- return t.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
191
- }
192
- function* ne(t) {
193
- const n = [...t];
194
- let e = 0;
195
- function r() {
196
- let s = "";
197
- if (J.test(n[++e]))
198
- for (s += n[e]; D.test(n[++e]); )
199
- s += n[e];
200
- else if (n[e] === '"') {
201
- let o = e;
202
- for (; e < n.length; ) {
203
- if (n[++e] === '"') {
204
- e++, o = 0;
186
+ function we(e) {
187
+ return e.replace(/[{}()\[\]+?!:*]/g, "\\$&");
188
+ }
189
+ function $(e) {
190
+ return e.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
191
+ }
192
+ function* xe(e) {
193
+ const t = [...e];
194
+ let r = 0;
195
+ function n() {
196
+ let a = "";
197
+ if (X.test(t[++r]))
198
+ for (a += t[r]; q.test(t[++r]); )
199
+ a += t[r];
200
+ else if (t[r] === '"') {
201
+ let s = r;
202
+ for (; r < t.length; ) {
203
+ if (t[++r] === '"') {
204
+ r++, s = 0;
205
205
  break;
206
206
  }
207
- n[e] === "\\" ? s += n[++e] : s += n[e];
207
+ t[r] === "\\" ? a += t[++r] : a += t[r];
208
208
  }
209
- if (o)
210
- throw new TypeError(`Unterminated quote at ${o}: ${A}`);
209
+ if (s)
210
+ throw new TypeError(`Unterminated quote at ${s}: ${I}`);
211
211
  }
212
- if (!s)
213
- throw new TypeError(`Missing parameter name at ${e}: ${A}`);
214
- return s;
212
+ if (!a)
213
+ throw new TypeError(`Missing parameter name at ${r}: ${I}`);
214
+ return a;
215
215
  }
216
- for (; e < n.length; ) {
217
- const s = n[e], o = ee[s];
218
- if (o)
216
+ for (; r < t.length; ) {
217
+ const a = t[r], s = be[a];
218
+ if (s)
219
219
  yield {
220
- type: o,
221
- index: e++,
222
- value: s
220
+ type: s,
221
+ index: r++,
222
+ value: a
223
223
  };
224
- else if (s === "\\")
224
+ else if (a === "\\")
225
225
  yield {
226
226
  type: "ESCAPED",
227
- index: e++,
228
- value: n[e++]
227
+ index: r++,
228
+ value: t[r++]
229
229
  };
230
- else if (s === ":") {
231
- const a = r();
230
+ else if (a === ":") {
231
+ const o = n();
232
232
  yield {
233
233
  type: "PARAM",
234
- index: e,
235
- value: a
234
+ index: r,
235
+ value: o
236
236
  };
237
- } else if (s === "*") {
238
- const a = r();
237
+ } else if (a === "*") {
238
+ const o = n();
239
239
  yield {
240
240
  type: "WILDCARD",
241
- index: e,
242
- value: a
241
+ index: r,
242
+ value: o
243
243
  };
244
244
  } else
245
245
  yield {
246
246
  type: "CHAR",
247
- index: e,
248
- value: n[e++]
247
+ index: r,
248
+ value: t[r++]
249
249
  };
250
250
  }
251
251
  return {
252
252
  type: "END",
253
- index: e,
253
+ index: r,
254
254
  value: ""
255
255
  };
256
256
  }
257
- class re {
258
- constructor(n) {
259
- this.tokens = n;
257
+ class Fe {
258
+ constructor(t) {
259
+ this.tokens = t;
260
260
  }
261
261
  peek() {
262
262
  if (!this._peek) {
263
- const n = this.tokens.next();
264
- this._peek = n.value;
263
+ const t = this.tokens.next();
264
+ this._peek = t.value;
265
265
  }
266
266
  return this._peek;
267
267
  }
268
- tryConsume(n) {
269
- const e = this.peek();
270
- if (e.type === n)
271
- return this._peek = void 0, e.value;
268
+ tryConsume(t) {
269
+ const r = this.peek();
270
+ if (r.type === t)
271
+ return this._peek = void 0, r.value;
272
272
  }
273
- consume(n) {
274
- const e = this.tryConsume(n);
275
- if (e !== void 0) return e;
273
+ consume(t) {
274
+ const r = this.tryConsume(t);
275
+ if (r !== void 0) return r;
276
276
  const {
277
- type: r,
278
- index: s
277
+ type: n,
278
+ index: a
279
279
  } = this.peek();
280
- throw new TypeError(`Unexpected ${r} at ${s}, expected ${n}: ${A}`);
280
+ throw new TypeError(`Unexpected ${n} at ${a}, expected ${t}: ${I}`);
281
281
  }
282
282
  text() {
283
- let n = "", e;
284
- for (; e = this.tryConsume("CHAR") || this.tryConsume("ESCAPED"); )
285
- n += e;
286
- return n;
283
+ let t = "", r;
284
+ for (; r = this.tryConsume("CHAR") || this.tryConsume("ESCAPED"); )
285
+ t += r;
286
+ return t;
287
287
  }
288
288
  }
289
- class R {
290
- constructor(n) {
291
- this.tokens = n;
289
+ class P {
290
+ constructor(t) {
291
+ this.tokens = t;
292
292
  }
293
293
  }
294
- k.TokenData = R;
295
- function N(t, n = {}) {
294
+ j.TokenData = P;
295
+ function L(e, t = {}) {
296
296
  const {
297
- encodePath: e = I
298
- } = n, r = new re(ne(t));
299
- function s(a) {
297
+ encodePath: r = v
298
+ } = t, n = new Fe(xe(e));
299
+ function a(o) {
300
300
  const i = [];
301
301
  for (; ; ) {
302
- const u = r.text();
303
- u && i.push({
302
+ const c = n.text();
303
+ c && i.push({
304
304
  type: "text",
305
- value: e(u)
305
+ value: r(c)
306
306
  });
307
- const c = r.tryConsume("PARAM");
308
- if (c) {
307
+ const f = n.tryConsume("PARAM");
308
+ if (f) {
309
309
  i.push({
310
310
  type: "param",
311
- name: c
311
+ name: f
312
312
  });
313
313
  continue;
314
314
  }
315
- const d = r.tryConsume("WILDCARD");
316
- if (d) {
315
+ const m = n.tryConsume("WILDCARD");
316
+ if (m) {
317
317
  i.push({
318
318
  type: "wildcard",
319
- name: d
319
+ name: m
320
320
  });
321
321
  continue;
322
322
  }
323
- if (r.tryConsume("{")) {
323
+ if (n.tryConsume("{")) {
324
324
  i.push({
325
325
  type: "group",
326
- tokens: s("}")
326
+ tokens: a("}")
327
327
  });
328
328
  continue;
329
329
  }
330
- return r.consume(a), i;
330
+ return n.consume(o), i;
331
331
  }
332
332
  }
333
- const o = s("END");
334
- return new R(o);
333
+ const s = a("END");
334
+ return new P(s);
335
335
  }
336
- function se(t, n = {}) {
336
+ function $e(e, t = {}) {
337
337
  const {
338
- encode: e = encodeURIComponent,
339
- delimiter: r = F
340
- } = n, s = t instanceof R ? t : N(t, n), o = q(s.tokens, r, e);
338
+ encode: r = encodeURIComponent,
339
+ delimiter: n = _
340
+ } = t, a = e instanceof P ? e : L(e, t), s = Y(a.tokens, n, r);
341
341
  return function(i = {}) {
342
- const [u, ...c] = o(i);
343
- if (c.length)
344
- throw new TypeError(`Missing parameters: ${c.join(", ")}`);
345
- return u;
342
+ const [c, ...f] = s(i);
343
+ if (f.length)
344
+ throw new TypeError(`Missing parameters: ${f.join(", ")}`);
345
+ return c;
346
346
  };
347
347
  }
348
- function q(t, n, e) {
349
- const r = t.map((s) => oe(s, n, e));
350
- return (s) => {
351
- const o = [""];
352
- for (const a of r) {
353
- const [i, ...u] = a(s);
354
- o[0] += i, o.push(...u);
348
+ function Y(e, t, r) {
349
+ const n = e.map((a) => Se(a, t, r));
350
+ return (a) => {
351
+ const s = [""];
352
+ for (const o of n) {
353
+ const [i, ...c] = o(a);
354
+ s[0] += i, s.push(...c);
355
355
  }
356
- return o;
356
+ return s;
357
357
  };
358
358
  }
359
- function oe(t, n, e) {
360
- if (t.type === "text") return () => [t.value];
361
- if (t.type === "group") {
362
- const s = q(t.tokens, n, e);
363
- return (o) => {
364
- const [a, ...i] = s(o);
365
- return i.length ? [""] : [a];
359
+ function Se(e, t, r) {
360
+ if (e.type === "text") return () => [e.value];
361
+ if (e.type === "group") {
362
+ const a = Y(e.tokens, t, r);
363
+ return (s) => {
364
+ const [o, ...i] = a(s);
365
+ return i.length ? [""] : [o];
366
366
  };
367
367
  }
368
- const r = e || I;
369
- return t.type === "wildcard" && e !== !1 ? (s) => {
370
- const o = s[t.name];
371
- if (o == null) return ["", t.name];
372
- if (!Array.isArray(o) || o.length === 0)
373
- throw new TypeError(`Expected "${t.name}" to be a non-empty array`);
374
- return [o.map((a, i) => {
375
- if (typeof a != "string")
376
- throw new TypeError(`Expected "${t.name}/${i}" to be a string`);
377
- return r(a);
378
- }).join(n)];
379
- } : (s) => {
380
- const o = s[t.name];
381
- if (o == null) return ["", t.name];
382
- if (typeof o != "string")
383
- throw new TypeError(`Expected "${t.name}" to be a string`);
384
- return [r(o)];
368
+ const n = r || v;
369
+ return e.type === "wildcard" && r !== !1 ? (a) => {
370
+ const s = a[e.name];
371
+ if (s == null) return ["", e.name];
372
+ if (!Array.isArray(s) || s.length === 0)
373
+ throw new TypeError(`Expected "${e.name}" to be a non-empty array`);
374
+ return [s.map((o, i) => {
375
+ if (typeof o != "string")
376
+ throw new TypeError(`Expected "${e.name}/${i}" to be a string`);
377
+ return n(o);
378
+ }).join(t)];
379
+ } : (a) => {
380
+ const s = a[e.name];
381
+ if (s == null) return ["", e.name];
382
+ if (typeof s != "string")
383
+ throw new TypeError(`Expected "${e.name}" to be a string`);
384
+ return [n(s)];
385
385
  };
386
386
  }
387
- function ae(t, n = {}) {
387
+ function Oe(e, t = {}) {
388
388
  const {
389
- decode: e = decodeURIComponent,
390
- delimiter: r = F
391
- } = n, {
392
- regexp: s,
393
- keys: o
394
- } = K(t, n), a = o.map((i) => e === !1 ? I : i.type === "param" ? e : (u) => u.split(r).map(e));
395
- return function(u) {
396
- const c = s.exec(u);
397
- if (!c) return !1;
398
- const d = c[0], p = /* @__PURE__ */ Object.create(null);
399
- for (let h = 1; h < c.length; h++) {
400
- if (c[h] === void 0) continue;
401
- const v = o[h - 1], y = a[h - 1];
402
- p[v.name] = y(c[h]);
389
+ decode: r = decodeURIComponent,
390
+ delimiter: n = _
391
+ } = t, {
392
+ regexp: a,
393
+ keys: s
394
+ } = Z(e, t), o = s.map((i) => r === !1 ? v : i.type === "param" ? r : (c) => c.split(n).map(r));
395
+ return function(c) {
396
+ const f = a.exec(c);
397
+ if (!f) return !1;
398
+ const m = f[0], d = /* @__PURE__ */ Object.create(null);
399
+ for (let b = 1; b < f.length; b++) {
400
+ if (f[b] === void 0) continue;
401
+ const w = s[b - 1], h = o[b - 1];
402
+ d[w.name] = h(f[b]);
403
403
  }
404
404
  return {
405
- path: d,
406
- params: p
405
+ path: m,
406
+ params: d
407
407
  };
408
408
  };
409
409
  }
410
- function K(t, n = {}) {
410
+ function Z(e, t = {}) {
411
411
  const {
412
- delimiter: e = F,
413
- end: r = !0,
414
- sensitive: s = !1,
415
- trailing: o = !0
416
- } = n, a = [], i = [], u = s ? "" : "i", d = (Array.isArray(t) ? t : [t]).map((v) => v instanceof R ? v : N(v, n));
412
+ delimiter: r = _,
413
+ end: n = !0,
414
+ sensitive: a = !1,
415
+ trailing: s = !0
416
+ } = t, o = [], i = [], c = a ? "" : "i", m = (Array.isArray(e) ? e : [e]).map((w) => w instanceof P ? w : L(w, t));
417
417
  for (const {
418
- tokens: v
419
- } of d)
420
- for (const y of j(v, 0, [])) {
421
- const l = ie(y, e, a);
422
- i.push(l);
418
+ tokens: w
419
+ } of m)
420
+ for (const h of k(w, 0, [])) {
421
+ const u = je(h, r, o);
422
+ i.push(u);
423
423
  }
424
- let p = `^(?:${i.join("|")})`;
425
- return o && (p += `(?:${x(e)}$)?`), p += r ? "$" : `(?=${x(e)}|$)`, {
426
- regexp: new RegExp(p, u),
427
- keys: a
424
+ let d = `^(?:${i.join("|")})`;
425
+ return s && (d += `(?:${$(r)}$)?`), d += n ? "$" : `(?=${$(r)}|$)`, {
426
+ regexp: new RegExp(d, c),
427
+ keys: o
428
428
  };
429
429
  }
430
- function* j(t, n, e) {
431
- if (n === t.length)
432
- return yield e;
433
- const r = t[n];
434
- if (r.type === "group") {
435
- const s = e.slice();
436
- for (const o of j(r.tokens, 0, s))
437
- yield* j(t, n + 1, o);
430
+ function* k(e, t, r) {
431
+ if (t === e.length)
432
+ return yield r;
433
+ const n = e[t];
434
+ if (n.type === "group") {
435
+ const a = r.slice();
436
+ for (const s of k(n.tokens, 0, a))
437
+ yield* k(e, t + 1, s);
438
438
  } else
439
- e.push(r);
440
- yield* j(t, n + 1, e);
439
+ r.push(n);
440
+ yield* k(e, t + 1, r);
441
441
  }
442
- function ie(t, n, e) {
443
- let r = "", s = "", o = !0;
444
- for (let a = 0; a < t.length; a++) {
445
- const i = t[a];
442
+ function je(e, t, r) {
443
+ let n = "", a = "", s = !0;
444
+ for (let o = 0; o < e.length; o++) {
445
+ const i = e[o];
446
446
  if (i.type === "text") {
447
- r += x(i.value), s += i.value, o || (o = i.value.includes(n));
447
+ n += $(i.value), a += i.value, s || (s = i.value.includes(t));
448
448
  continue;
449
449
  }
450
450
  if (i.type === "param" || i.type === "wildcard") {
451
- if (!o && !s)
452
- throw new TypeError(`Missing text after "${i.name}": ${A}`);
453
- i.type === "param" ? r += `(${ce(n, o ? "" : s)}+)` : r += "([\\s\\S]+)", e.push(i), s = "", o = !1;
451
+ if (!s && !a)
452
+ throw new TypeError(`Missing text after "${i.name}": ${I}`);
453
+ i.type === "param" ? n += `(${Ee(t, s ? "" : a)}+)` : n += "([\\s\\S]+)", r.push(i), a = "", s = !1;
454
454
  continue;
455
455
  }
456
456
  }
457
- return r;
457
+ return n;
458
+ }
459
+ function Ee(e, t) {
460
+ return t.length < 2 ? e.length < 2 ? `[^${$(e + t)}]` : `(?:(?!${$(e)})[^${$(t)}])` : e.length < 2 ? `(?:(?!${$(t)})[^${$(e)}])` : `(?:(?!${$(t)}|${$(e)})[\\s\\S])`;
458
461
  }
459
- function ce(t, n) {
460
- return n.length < 2 ? t.length < 2 ? `[^${x(t + n)}]` : `(?:(?!${x(t)})[^${x(n)}])` : t.length < 2 ? `(?:(?!${x(n)})[^${x(t)}])` : `(?:(?!${x(n)}|${x(t)})[\\s\\S])`;
461
- }
462
- function ue(t) {
463
- return t.tokens.map(function n(e, r, s) {
464
- if (e.type === "text") return te(e.value);
465
- if (e.type === "group")
466
- return `{${e.tokens.map(n).join("")}}`;
467
- const a = le(e.name) && fe(s[r + 1]) ? e.name : JSON.stringify(e.name);
468
- if (e.type === "param") return `:${a}`;
469
- if (e.type === "wildcard") return `*${a}`;
470
- throw new TypeError(`Unexpected token: ${e}`);
462
+ function Ae(e) {
463
+ return e.tokens.map(function t(r, n, a) {
464
+ if (r.type === "text") return we(r.value);
465
+ if (r.type === "group")
466
+ return `{${r.tokens.map(t).join("")}}`;
467
+ const o = Ne(r.name) && Re(a[n + 1]) ? r.name : JSON.stringify(r.name);
468
+ if (r.type === "param") return `:${o}`;
469
+ if (r.type === "wildcard") return `*${o}`;
470
+ throw new TypeError(`Unexpected token: ${r}`);
471
471
  }).join("");
472
472
  }
473
- function le(t) {
474
- const [n, ...e] = t;
475
- return J.test(n) ? e.every((r) => D.test(r)) : !1;
473
+ function Ne(e) {
474
+ const [t, ...r] = e;
475
+ return X.test(t) ? r.every((n) => q.test(n)) : !1;
476
476
  }
477
- function fe(t) {
478
- return (t == null ? void 0 : t.type) !== "text" ? !0 : !D.test(t.value[0]);
477
+ function Re(e) {
478
+ return (e == null ? void 0 : e.type) !== "text" ? !0 : !q.test(e.value[0]);
479
479
  }
480
- const pe = Symbol("any"), de = Symbol("number"), ye = Symbol("string"), me = Symbol("array"), $ = {
481
- any: pe,
482
- number: de,
483
- string: ye,
484
- array: me
480
+ const ke = Symbol("any"), Ie = Symbol("number"), Pe = Symbol("string"), Ce = Symbol("array"), O = {
481
+ any: ke,
482
+ number: Ie,
483
+ string: Pe,
484
+ array: Ce
485
485
  };
486
- function H(t, n) {
487
- for (const e of t)
488
- if (!n.includes(e))
486
+ function K(e, t) {
487
+ for (const r of e)
488
+ if (!t.includes(r))
489
489
  return !1;
490
490
  return !0;
491
491
  }
492
- function M(t, n) {
493
- for (const e in n) {
494
- const r = n[e];
495
- if (Array.isArray(r) && (!t[e] || JSON.stringify(r) !== t[e]))
492
+ function J(e, t) {
493
+ for (const r in t) {
494
+ const n = t[r];
495
+ if (Array.isArray(n) && (!e[r] || JSON.stringify(n) !== e[r]))
496
496
  return !1;
497
- switch (typeof r) {
497
+ switch (typeof n) {
498
498
  case "number": {
499
- if (!t[e] || r.toString() !== t[e])
499
+ if (!e[r] || n.toString() !== e[r])
500
500
  return !1;
501
501
  break;
502
502
  }
503
503
  case "object": {
504
- if (!t[e] || JSON.stringify(r) !== t[e])
504
+ if (!e[r] || JSON.stringify(n) !== e[r])
505
505
  return !1;
506
506
  break;
507
507
  }
508
508
  case "string": {
509
- if (!t[e] || r !== t[e])
509
+ if (!e[r] || n !== e[r])
510
510
  return !1;
511
511
  break;
512
512
  }
513
513
  case "boolean": {
514
- if (!t[e] || !["0", "1", "false", "true"].includes(t[e]))
514
+ if (!e[r] || !["0", "1", "false", "true"].includes(e[r]))
515
515
  return !1;
516
516
  break;
517
517
  }
518
518
  }
519
- switch (r) {
520
- case $.any: {
521
- if (!t[e])
519
+ switch (n) {
520
+ case O.any: {
521
+ if (!e[r])
522
522
  return !1;
523
523
  break;
524
524
  }
525
- case $.string: {
526
- if (!t[e] || Array.isArray(t[e]))
525
+ case O.string: {
526
+ if (!e[r] || Array.isArray(e[r]))
527
527
  return !1;
528
528
  break;
529
529
  }
530
- case $.array: {
531
- if (!t[e] || !Array.isArray(t[e]))
530
+ case O.array: {
531
+ if (!e[r] || !Array.isArray(e[r]))
532
532
  return !1;
533
533
  break;
534
534
  }
535
- case $.number: {
536
- if (!t[e] || Array.isArray(t[e]) || isNaN(parseInt(t[e])) && isNaN(parseFloat(t[e])))
535
+ case O.number: {
536
+ if (!e[r] || Array.isArray(e[r]) || isNaN(parseInt(e[r])) && isNaN(parseFloat(e[r])))
537
537
  return !1;
538
538
  break;
539
539
  }
@@ -541,370 +541,668 @@ function M(t, n) {
541
541
  }
542
542
  return !0;
543
543
  }
544
- function he(t, n) {
545
- const e = {};
546
- for (const r in n) {
547
- const s = n[r], o = t[r];
548
- if (Array.isArray(s)) {
549
- e[r] = o === "1" || o === "true";
544
+ function Te(e, t) {
545
+ const r = {};
546
+ for (const n in t) {
547
+ const a = t[n], s = e[n];
548
+ if (Array.isArray(a)) {
549
+ r[n] = s === "1" || s === "true";
550
550
  continue;
551
551
  }
552
- switch (typeof s) {
552
+ switch (typeof a) {
553
553
  case "number": {
554
- const a = t[r];
555
- e[r] = isNaN(parseInt(a)) ? parseFloat(a) : parseInt(a);
554
+ const o = e[n];
555
+ r[n] = isNaN(parseInt(o)) ? parseFloat(o) : parseInt(o);
556
556
  break;
557
557
  }
558
558
  case "object": {
559
- e[r] = JSON.parse(o);
559
+ r[n] = JSON.parse(s);
560
560
  break;
561
561
  }
562
562
  case "string":
563
- e[r] = t[r];
563
+ r[n] = e[n];
564
564
  case "boolean": {
565
- const a = t[r];
566
- e[r] = a === "0" ? parseFloat(a) : parseInt(a);
565
+ const o = e[n];
566
+ r[n] = o === "0" ? parseFloat(o) : parseInt(o);
567
567
  break;
568
568
  }
569
569
  }
570
- switch (s) {
571
- case $.any:
572
- case $.string:
573
- case $.array: {
574
- e[r] = t[r];
570
+ switch (a) {
571
+ case O.any:
572
+ case O.string:
573
+ case O.array: {
574
+ r[n] = e[n];
575
575
  break;
576
576
  }
577
- case $.number: {
578
- const a = t[r];
579
- e[r] = isNaN(parseInt(a)) ? parseFloat(a) : parseInt(a);
577
+ case O.number: {
578
+ const o = e[n];
579
+ r[n] = isNaN(parseInt(o)) ? parseFloat(o) : parseInt(o);
580
580
  break;
581
581
  }
582
582
  }
583
583
  }
584
- return e;
584
+ return r;
585
585
  }
586
- function ge(t, n) {
587
- return (e) => {
586
+ function De(e, t) {
587
+ return (r) => {
588
588
  const {
589
- parameters: r,
590
- forRoutes: s
591
- } = e, o = w({
589
+ parameters: n,
590
+ forRoutes: a
591
+ } = r, s = x({
592
592
  name: "entered",
593
593
  sid: "-d3obu6"
594
- }), a = w({
594
+ }), o = x({
595
595
  name: "exited",
596
596
  sid: "-xofyk3"
597
- }), i = w({
597
+ }), i = x({
598
598
  name: "exit",
599
599
  sid: "-673d76"
600
600
  });
601
- return g({
601
+ return F({
602
602
  and: [{
603
603
  source: {
604
- activeRoutes: t,
605
- query: n
604
+ activeRoutes: e,
605
+ query: t
606
606
  },
607
- filter: (u) => {
607
+ filter: (c) => {
608
608
  let {
609
- activeRoutes: c,
610
- query: d
611
- } = u;
612
- return (!s || H(s, c)) && M(d, r);
609
+ activeRoutes: f,
610
+ query: m
611
+ } = c;
612
+ return (!a || K(a, f)) && J(m, n);
613
613
  },
614
- fn: (u) => {
614
+ fn: (c) => {
615
615
  let {
616
- query: c
617
- } = u;
618
- return he(c, r);
616
+ query: f
617
+ } = c;
618
+ return Te(f, n);
619
619
  }
620
620
  }],
621
621
  or: {
622
622
  sid: "-so0f9q"
623
623
  }
624
- }), g({
624
+ }), F({
625
625
  and: [{
626
626
  source: {
627
- activeRoutes: t,
628
- query: n
627
+ activeRoutes: e,
628
+ query: t
629
629
  },
630
- filter: (u) => {
630
+ filter: (c) => {
631
631
  let {
632
- activeRoutes: c,
633
- query: d
634
- } = u;
635
- return !((!s || H(s, c)) && M(d, r));
632
+ activeRoutes: f,
633
+ query: m
634
+ } = c;
635
+ return !((!a || K(a, f)) && J(m, n));
636
636
  },
637
- target: a
637
+ target: o
638
638
  }],
639
639
  or: {
640
640
  sid: "-s82e29"
641
641
  }
642
642
  }), {
643
- entered: o,
644
- exited: a,
643
+ entered: s,
644
+ exited: o,
645
645
  exit: i,
646
- getPayload: (u) => Object.entries(u).reduce((c, d) => {
647
- let [p, h] = d;
648
- return typeof r[p] == "symbol" ? c[p] = h : c[p] = r[p], c;
646
+ getPayload: (c) => Object.entries(c).reduce((f, m) => {
647
+ let [d, b] = m;
648
+ return typeof n[d] == "symbol" ? f[d] = b : f[d] = n[d], f;
649
649
  }, {})
650
650
  };
651
651
  };
652
652
  }
653
- function z(t) {
654
- const n = new URLSearchParams(t.search);
655
- return {
656
- path: t.pathname,
657
- query: [...n.keys()].reduce((e, r) => (e[r] ? e[r] = n.getAll(r) : e[r] = n.get(r), e), {})
653
+ const ee = "%[a-f0-9]{2}", Q = new RegExp("(" + ee + ")|([^%]+?)", "gi"), W = new RegExp("(" + ee + ")+", "gi");
654
+ function D(e, t) {
655
+ try {
656
+ return [decodeURIComponent(e.join(""))];
657
+ } catch {
658
+ }
659
+ if (e.length === 1)
660
+ return e;
661
+ t = t || 1;
662
+ const r = e.slice(0, t), n = e.slice(t);
663
+ return Array.prototype.concat.call([], D(r), D(n));
664
+ }
665
+ function Ue(e) {
666
+ try {
667
+ return decodeURIComponent(e);
668
+ } catch {
669
+ let t = e.match(Q) || [];
670
+ for (let r = 1; r < t.length; r++)
671
+ e = D(t, r).join(""), t = e.match(Q) || [];
672
+ return e;
673
+ }
674
+ }
675
+ function _e(e) {
676
+ const t = {
677
+ "%FE%FF": "��",
678
+ "%FF%FE": "��"
679
+ };
680
+ let r = W.exec(e);
681
+ for (; r; ) {
682
+ try {
683
+ t[r[0]] = decodeURIComponent(r[0]);
684
+ } catch {
685
+ const a = Ue(r[0]);
686
+ a !== r[0] && (t[r[0]] = a);
687
+ }
688
+ r = W.exec(e);
689
+ }
690
+ t["%C2"] = "�";
691
+ const n = Object.keys(t);
692
+ for (const a of n)
693
+ e = e.replace(new RegExp(a, "g"), t[a]);
694
+ return e;
695
+ }
696
+ function ve(e) {
697
+ if (typeof e != "string")
698
+ throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof e + "`");
699
+ try {
700
+ return decodeURIComponent(e);
701
+ } catch {
702
+ return _e(e);
703
+ }
704
+ }
705
+ function qe(e, t) {
706
+ const r = {};
707
+ if (Array.isArray(t))
708
+ for (const n of t) {
709
+ const a = Object.getOwnPropertyDescriptor(e, n);
710
+ a != null && a.enumerable && Object.defineProperty(r, n, a);
711
+ }
712
+ else
713
+ for (const n of Reflect.ownKeys(e)) {
714
+ const a = Object.getOwnPropertyDescriptor(e, n);
715
+ if (a.enumerable) {
716
+ const s = e[n];
717
+ t(n, s, e) && Object.defineProperty(r, n, a);
718
+ }
719
+ }
720
+ return r;
721
+ }
722
+ function re(e, t) {
723
+ if (!(typeof e == "string" && typeof t == "string"))
724
+ throw new TypeError("Expected the arguments to be of type `string`");
725
+ if (e === "" || t === "")
726
+ return [];
727
+ const r = e.indexOf(t);
728
+ return r === -1 ? [] : [e.slice(0, r), e.slice(r + t.length)];
729
+ }
730
+ const Le = (e) => e == null, Me = (e) => encodeURIComponent(e).replaceAll(/[!'()*]/g, (t) => `%${t.charCodeAt(0).toString(16).toUpperCase()}`), U = Symbol("encodeFragmentIdentifier");
731
+ function Be(e) {
732
+ switch (e.arrayFormat) {
733
+ case "index":
734
+ return (t) => (r, n) => {
735
+ const a = r.length;
736
+ return n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [p(t, e), "[", a, "]"].join("")] : [...r, [p(t, e), "[", p(a, e), "]=", p(n, e)].join("")];
737
+ };
738
+ case "bracket":
739
+ return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [p(t, e), "[]"].join("")] : [...r, [p(t, e), "[]=", p(n, e)].join("")];
740
+ case "colon-list-separator":
741
+ return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [p(t, e), ":list="].join("")] : [...r, [p(t, e), ":list=", p(n, e)].join("")];
742
+ case "comma":
743
+ case "separator":
744
+ case "bracket-separator": {
745
+ const t = e.arrayFormat === "bracket-separator" ? "[]=" : "=";
746
+ return (r) => (n, a) => a === void 0 || e.skipNull && a === null || e.skipEmptyString && a === "" ? n : (a = a === null ? "" : a, n.length === 0 ? [[p(r, e), t, p(a, e)].join("")] : [[n, p(a, e)].join(e.arrayFormatSeparator)]);
747
+ }
748
+ default:
749
+ return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, p(t, e)] : [...r, [p(t, e), "=", p(n, e)].join("")];
750
+ }
751
+ }
752
+ function He(e) {
753
+ let t;
754
+ switch (e.arrayFormat) {
755
+ case "index":
756
+ return (r, n, a) => {
757
+ if (t = /\[(\d*)]$/.exec(r), r = r.replace(/\[\d*]$/, ""), !t) {
758
+ a[r] = n;
759
+ return;
760
+ }
761
+ a[r] === void 0 && (a[r] = {}), a[r][t[1]] = n;
762
+ };
763
+ case "bracket":
764
+ return (r, n, a) => {
765
+ if (t = /(\[])$/.exec(r), r = r.replace(/\[]$/, ""), !t) {
766
+ a[r] = n;
767
+ return;
768
+ }
769
+ if (a[r] === void 0) {
770
+ a[r] = [n];
771
+ return;
772
+ }
773
+ a[r] = [...a[r], n];
774
+ };
775
+ case "colon-list-separator":
776
+ return (r, n, a) => {
777
+ if (t = /(:list)$/.exec(r), r = r.replace(/:list$/, ""), !t) {
778
+ a[r] = n;
779
+ return;
780
+ }
781
+ if (a[r] === void 0) {
782
+ a[r] = [n];
783
+ return;
784
+ }
785
+ a[r] = [...a[r], n];
786
+ };
787
+ case "comma":
788
+ case "separator":
789
+ return (r, n, a) => {
790
+ const s = typeof n == "string" && n.includes(e.arrayFormatSeparator), o = typeof n == "string" && !s && S(n, e).includes(e.arrayFormatSeparator);
791
+ n = o ? S(n, e) : n;
792
+ const i = s || o ? n.split(e.arrayFormatSeparator).map((c) => S(c, e)) : n === null ? n : S(n, e);
793
+ a[r] = i;
794
+ };
795
+ case "bracket-separator":
796
+ return (r, n, a) => {
797
+ const s = /(\[])$/.test(r);
798
+ if (r = r.replace(/\[]$/, ""), !s) {
799
+ a[r] = n && S(n, e);
800
+ return;
801
+ }
802
+ const o = n === null ? [] : S(n, e).split(e.arrayFormatSeparator);
803
+ if (a[r] === void 0) {
804
+ a[r] = o;
805
+ return;
806
+ }
807
+ a[r] = [...a[r], ...o];
808
+ };
809
+ default:
810
+ return (r, n, a) => {
811
+ if (a[r] === void 0) {
812
+ a[r] = n;
813
+ return;
814
+ }
815
+ a[r] = [...[a[r]].flat(), n];
816
+ };
817
+ }
818
+ }
819
+ function te(e) {
820
+ if (typeof e != "string" || e.length !== 1)
821
+ throw new TypeError("arrayFormatSeparator must be single character string");
822
+ }
823
+ function p(e, t) {
824
+ return t.encode ? t.strict ? Me(e) : encodeURIComponent(e) : e;
825
+ }
826
+ function S(e, t) {
827
+ return t.decode ? ve(e) : e;
828
+ }
829
+ function ne(e) {
830
+ return Array.isArray(e) ? e.sort() : typeof e == "object" ? ne(Object.keys(e)).sort((t, r) => Number(t) - Number(r)).map((t) => e[t]) : e;
831
+ }
832
+ function ae(e) {
833
+ const t = e.indexOf("#");
834
+ return t !== -1 && (e = e.slice(0, t)), e;
835
+ }
836
+ function Ve(e) {
837
+ let t = "";
838
+ const r = e.indexOf("#");
839
+ return r !== -1 && (t = e.slice(r)), t;
840
+ }
841
+ function G(e, t, r) {
842
+ return r === "string" && typeof e == "string" ? e : typeof r == "function" && typeof e == "string" ? r(e) : t.parseBooleans && e !== null && (e.toLowerCase() === "true" || e.toLowerCase() === "false") ? e.toLowerCase() === "true" : r === "number" && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" || t.parseNumbers && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" ? Number(e) : e;
843
+ }
844
+ function M(e) {
845
+ e = ae(e);
846
+ const t = e.indexOf("?");
847
+ return t === -1 ? "" : e.slice(t + 1);
848
+ }
849
+ function B(e, t) {
850
+ t = {
851
+ decode: !0,
852
+ sort: !0,
853
+ arrayFormat: "none",
854
+ arrayFormatSeparator: ",",
855
+ parseNumbers: !1,
856
+ parseBooleans: !1,
857
+ types: /* @__PURE__ */ Object.create(null),
858
+ ...t
859
+ }, te(t.arrayFormatSeparator);
860
+ const r = He(t), n = /* @__PURE__ */ Object.create(null);
861
+ if (typeof e != "string" || (e = e.trim().replace(/^[?#&]/, ""), !e))
862
+ return n;
863
+ for (const a of e.split("&")) {
864
+ if (a === "")
865
+ continue;
866
+ const s = t.decode ? a.replaceAll("+", " ") : a;
867
+ let [o, i] = re(s, "=");
868
+ o === void 0 && (o = s), i = i === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(t.arrayFormat) ? i : S(i, t), r(S(o, t), i, n);
869
+ }
870
+ for (const [a, s] of Object.entries(n))
871
+ if (typeof s == "object" && s !== null && t.types[a] !== "string")
872
+ for (const [o, i] of Object.entries(s)) {
873
+ const c = t.types[a] ? t.types[a].replace("[]", "") : void 0;
874
+ s[o] = G(i, t, c);
875
+ }
876
+ else typeof s == "object" && s !== null && t.types[a] === "string" ? n[a] = Object.values(s).join(t.arrayFormatSeparator) : n[a] = G(s, t, t.types[a]);
877
+ return t.sort === !1 ? n : (t.sort === !0 ? Object.keys(n).sort() : Object.keys(n).sort(t.sort)).reduce((a, s) => {
878
+ const o = n[s];
879
+ return a[s] = o && typeof o == "object" && !Array.isArray(o) ? ne(o) : o, a;
880
+ }, /* @__PURE__ */ Object.create(null));
881
+ }
882
+ function se(e, t) {
883
+ if (!e)
884
+ return "";
885
+ t = {
886
+ encode: !0,
887
+ strict: !0,
888
+ arrayFormat: "none",
889
+ arrayFormatSeparator: ",",
890
+ ...t
891
+ }, te(t.arrayFormatSeparator);
892
+ const r = (o) => t.skipNull && Le(e[o]) || t.skipEmptyString && e[o] === "", n = Be(t), a = {};
893
+ for (const [o, i] of Object.entries(e))
894
+ r(o) || (a[o] = i);
895
+ const s = Object.keys(a);
896
+ return t.sort !== !1 && s.sort(t.sort), s.map((o) => {
897
+ const i = e[o];
898
+ return i === void 0 ? "" : i === null ? p(o, t) : Array.isArray(i) ? i.length === 0 && t.arrayFormat === "bracket-separator" ? p(o, t) + "[]" : i.reduce(n(o), []).join("&") : p(o, t) + "=" + p(i, t);
899
+ }).filter((o) => o.length > 0).join("&");
900
+ }
901
+ function oe(e, t) {
902
+ var a;
903
+ t = {
904
+ decode: !0,
905
+ ...t
906
+ };
907
+ let [r, n] = re(e, "#");
908
+ return r === void 0 && (r = e), {
909
+ url: ((a = r == null ? void 0 : r.split("?")) == null ? void 0 : a[0]) ?? "",
910
+ query: B(M(e), t),
911
+ ...t && t.parseFragmentIdentifier && n ? {
912
+ fragmentIdentifier: S(n, t)
913
+ } : {}
914
+ };
915
+ }
916
+ function ie(e, t) {
917
+ t = {
918
+ encode: !0,
919
+ strict: !0,
920
+ [U]: !0,
921
+ ...t
922
+ };
923
+ const r = ae(e.url).split("?")[0] || "", n = M(e.url), a = {
924
+ ...B(n, {
925
+ sort: !1
926
+ }),
927
+ ...e.query
658
928
  };
929
+ let s = se(a, t);
930
+ s && (s = `?${s}`);
931
+ let o = Ve(e.url);
932
+ if (typeof e.fragmentIdentifier == "string") {
933
+ const i = new URL(r);
934
+ i.hash = e.fragmentIdentifier, o = t[U] ? i.hash : `#${e.fragmentIdentifier}`;
935
+ }
936
+ return `${r}${s}${o}`;
659
937
  }
660
- function xe(t) {
938
+ function ce(e, t, r) {
939
+ r = {
940
+ parseFragmentIdentifier: !0,
941
+ [U]: !1,
942
+ ...r
943
+ };
661
944
  const {
662
- base: n = "/",
663
- routes: e
664
- } = t, r = O({}, {
665
- name: "$query",
666
- sid: "uczasb"
667
- }), s = O(null, {
945
+ url: n,
946
+ query: a,
947
+ fragmentIdentifier: s
948
+ } = oe(e, r);
949
+ return ie({
950
+ url: n,
951
+ query: qe(a, t),
952
+ fragmentIdentifier: s
953
+ }, r);
954
+ }
955
+ function ze(e, t, r) {
956
+ const n = Array.isArray(t) ? (a) => !t.includes(a) : (a, s) => !t(a, s);
957
+ return ce(e, n, r);
958
+ }
959
+ const T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
960
+ __proto__: null,
961
+ exclude: ze,
962
+ extract: M,
963
+ parse: B,
964
+ parseUrl: oe,
965
+ pick: ce,
966
+ stringify: se,
967
+ stringifyUrl: ie
968
+ }, Symbol.toStringTag, { value: "Module" }));
969
+ function We(e) {
970
+ const {
971
+ base: t = "/",
972
+ routes: r
973
+ } = e, n = E(null, {
974
+ and: {
975
+ serialize: "ignore"
976
+ },
668
977
  name: "$history",
669
- sid: "ui8df0"
670
- }), o = O(null, {
671
- name: "$path",
672
- sid: "-m7ebm3"
673
- }), a = O([], {
978
+ sid: "31majq"
979
+ }), a = E([], {
980
+ and: {
981
+ serialize: "ignore"
982
+ },
674
983
  name: "$activeRoutes",
675
- sid: "-ksnj2s"
676
- }), i = w({
984
+ sid: "mastmv"
985
+ }), s = E({}, {
986
+ name: "$query",
987
+ sid: "4sjpht"
988
+ }), o = E(null, {
989
+ name: "$path",
990
+ sid: "wq6kyf"
991
+ }), i = x({
677
992
  name: "setHistory",
678
- sid: "-p3v4s1"
679
- }), u = w({
993
+ sid: "tco5ea"
994
+ }), c = x({
680
995
  name: "back",
681
- sid: "-tzn3h"
682
- }), c = w({
996
+ sid: "-hekewa"
997
+ }), f = x({
683
998
  name: "forward",
684
- sid: "afzyy9"
685
- }), d = w({
999
+ sid: "-64ksuk"
1000
+ }), m = x({
686
1001
  name: "locationUpdated",
687
- sid: "-ubw4ys"
688
- }), p = e.map((l) => {
689
- let b = l;
690
- const f = [];
691
- for (f.unshift(b.internal.path); b.internal.parent; )
692
- b = b.internal.parent, b.internal.path !== "/" && f.unshift(b.internal.path);
693
- const m = n === "/" ? f.join("") : [n, ...f].join("");
1002
+ sid: "e6p2xg"
1003
+ }), d = r.map((u) => {
1004
+ let y = u;
1005
+ const l = [];
1006
+ for (l.unshift(y.internal.path); y.internal.parent; )
1007
+ y = y.internal.parent, y.internal.path !== "/" && l.unshift(y.internal.path);
1008
+ const g = t === "/" ? l.join("") : [t, ...l].join("");
694
1009
  return {
695
- route: l,
696
- path: m,
697
- toPath: Y(m),
698
- fromPath: Z(m)
1010
+ route: u,
1011
+ path: g,
1012
+ toPath: he(g),
1013
+ fromPath: ge(g)
699
1014
  };
700
- }), h = C({
1015
+ }), b = V({
701
1016
  and: {
702
1017
  source: {
703
- history: s
1018
+ history: n
704
1019
  },
705
- effect: async (l, b) => {
1020
+ effect: async (u, y) => {
706
1021
  let {
707
- history: f
708
- } = l, {
709
- path: m,
710
- query: S,
711
- replace: E
712
- } = b;
713
- if (!f)
1022
+ history: l
1023
+ } = u, {
1024
+ path: g,
1025
+ query: A,
1026
+ replace: N
1027
+ } = y;
1028
+ if (!l)
714
1029
  throw new Error("history not found");
715
- const _ = {
716
- pathname: m,
717
- query: S
1030
+ const H = {
1031
+ pathname: g,
1032
+ search: "?".concat(T.stringify(A))
718
1033
  };
719
- E ? f.replace(_) : f.push(_.pathname);
1034
+ N ? l.replace(H) : l.push(H);
1035
+ }
1036
+ },
1037
+ or: {
1038
+ name: "navigateFx",
1039
+ sid: "dmi4v4"
1040
+ }
1041
+ }), w = R((u) => {
1042
+ const y = ue(m);
1043
+ if (y({
1044
+ pathname: u.location.pathname,
1045
+ query: T.parse(u.location.search)
1046
+ }), !u)
1047
+ throw new Error();
1048
+ u.listen((l) => {
1049
+ let {
1050
+ location: g
1051
+ } = l;
1052
+ y({
1053
+ pathname: g.pathname,
1054
+ query: T.parse(g.search)
1055
+ });
1056
+ });
1057
+ }, {
1058
+ name: "subscribeHistoryFx",
1059
+ sid: "h5gz6p"
1060
+ }), h = V({
1061
+ and: {
1062
+ source: {
1063
+ query: s,
1064
+ path: o
1065
+ },
1066
+ effect: async (u) => {
1067
+ let {
1068
+ query: y,
1069
+ path: l
1070
+ } = u;
1071
+ for (const {
1072
+ route: g,
1073
+ fromPath: A
1074
+ } of d) {
1075
+ const N = A(l);
1076
+ if (N)
1077
+ await g.internal.openFx({
1078
+ query: y,
1079
+ params: N.params,
1080
+ historyIgnore: !0
1081
+ });
1082
+ else {
1083
+ g.internal.close();
1084
+ continue;
1085
+ }
1086
+ }
720
1087
  }
721
1088
  },
722
1089
  or: {
723
- name: "updateHistoryFx",
724
- sid: "-oy8a4f"
1090
+ name: "openRoutesByPathFx",
1091
+ sid: "e04f3o"
725
1092
  }
726
1093
  });
727
1094
  for (const {
728
- route: l,
729
- toPath: b
730
- } of p)
731
- g({
1095
+ route: u,
1096
+ toPath: y
1097
+ } of d)
1098
+ F({
732
1099
  and: [{
733
- clock: l.opened,
1100
+ clock: u.opened,
734
1101
  source: a,
735
- filter: (f) => !f.includes(l),
736
- fn: (f) => [...f, l],
1102
+ filter: (l) => !l.includes(u),
1103
+ fn: (l) => [...l, u],
737
1104
  target: a
738
1105
  }],
739
1106
  or: {
740
- sid: "e1k4q5"
1107
+ sid: "fhsl3g"
741
1108
  }
742
- }), g({
1109
+ }), F({
743
1110
  and: [{
744
- clock: l.opened,
745
- filter: (f) => !f.historyIgnore,
1111
+ clock: u.opened,
1112
+ filter: (l) => !l.historyIgnore,
746
1113
  fn: function() {
747
1114
  let {
748
- params: f,
749
- query: m,
750
- replace: S
1115
+ params: l,
1116
+ query: g,
1117
+ replace: A
751
1118
  } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
752
1119
  params: {}
753
1120
  };
754
1121
  return {
755
- path: b(f),
756
- query: m ?? {},
757
- replace: S
1122
+ path: y(l),
1123
+ query: g ?? {},
1124
+ replace: A
758
1125
  };
759
1126
  },
760
- target: h
1127
+ target: b
761
1128
  }],
762
1129
  or: {
763
- sid: "ehi5xm"
1130
+ sid: "fxqmax"
764
1131
  }
765
- }), g({
1132
+ }), F({
766
1133
  and: [{
767
- clock: l.closed,
1134
+ clock: u.closed,
768
1135
  source: a,
769
- fn: (f) => f.filter((m) => m !== l),
1136
+ fn: (l) => l.filter((g) => g !== u),
770
1137
  target: a
771
1138
  }],
772
1139
  or: {
773
- sid: "ez3kx6"
1140
+ sid: "gfc1ah"
774
1141
  }
775
1142
  });
776
- g({
1143
+ return F({
777
1144
  and: [{
778
1145
  clock: i,
779
- target: s
1146
+ target: n
780
1147
  }],
781
1148
  or: {
782
- sid: "ff1m2x"
1149
+ sid: "gva2g8"
783
1150
  }
784
- });
785
- const v = P((l) => {
786
- const b = Q(d);
787
- if (!l)
788
- throw new Error();
789
- l.listen((f) => {
790
- let {
791
- location: m
792
- } = f;
793
- b(m);
794
- });
795
- }, {
796
- name: "subscribeHistoryFx",
797
- sid: "z6ijkf"
798
- }), y = C({
799
- and: {
800
- source: {
801
- query: r,
802
- path: o
803
- },
804
- effect: async (l) => {
805
- let {
806
- query: b,
807
- path: f
808
- } = l;
809
- for (const {
810
- route: m,
811
- fromPath: S
812
- } of p) {
813
- const E = S(f);
814
- if (E)
815
- await m.internal.openFx({
816
- query: b,
817
- params: E.params
818
- });
819
- else {
820
- m.internal.close();
821
- continue;
822
- }
823
- }
824
- }
825
- },
826
- or: {
827
- name: "openRoutesByPathFx",
828
- sid: "-1mpuqp"
829
- }
830
- });
831
- return g({
1151
+ }), F({
832
1152
  and: [{
833
- clock: s,
1153
+ clock: n,
834
1154
  filter: Boolean,
835
- target: v
1155
+ target: w
836
1156
  }],
837
1157
  or: {
838
- sid: "gvtv1l"
1158
+ sid: "h9kpvm"
839
1159
  }
840
- }), g({
1160
+ }), F({
841
1161
  and: [{
842
- clock: s,
843
- filter: Boolean,
844
- fn: (l) => z(l.location),
845
- target: U({
846
- sid: "suiy9c",
847
- fn: () => L({
848
- targets: {
849
- path: o,
850
- query: r
851
- }
852
- }),
853
- name: "target",
854
- method: "spread"
855
- })
856
- }],
857
- or: {
858
- sid: "haob2c"
859
- }
860
- }), g({
861
- and: [{
862
- clock: [d],
863
- fn: (l) => z(l),
864
- target: U({
865
- sid: "-r1573k",
866
- fn: () => L({
1162
+ clock: m,
1163
+ fn: (u) => {
1164
+ var y;
1165
+ return {
1166
+ path: u.pathname,
1167
+ query: (y = u.query) !== null && y !== void 0 ? y : {}
1168
+ };
1169
+ },
1170
+ target: [le({
1171
+ sid: "-382tqp",
1172
+ fn: () => de({
867
1173
  targets: {
868
1174
  path: o,
869
- query: r
1175
+ query: s
870
1176
  }
871
1177
  }),
872
1178
  name: "target",
873
1179
  method: "spread"
874
- })
875
- }],
876
- or: {
877
- sid: "hstin9"
878
- }
879
- }), g({
880
- and: [{
881
- clock: o,
882
- target: y
1180
+ }), h]
883
1181
  }],
884
1182
  or: {
885
- sid: "iaexmt"
1183
+ sid: "hcvhfs"
886
1184
  }
887
1185
  }), {
888
- $query: r,
1186
+ $query: s,
889
1187
  $path: o,
890
1188
  $activeRoutes: a,
891
- back: u,
892
- forward: c,
893
- routes: e,
1189
+ back: c,
1190
+ forward: f,
1191
+ routes: r,
894
1192
  setHistory: i,
895
- mappedRoutes: p,
896
- trackQuery: ge(a, r),
1193
+ mappedRoutes: d,
1194
+ trackQuery: De(a, s),
897
1195
  "@@unitShape": () => ({
898
- query: r,
1196
+ query: s,
899
1197
  path: o,
900
1198
  activeRoutes: a,
901
- onBack: u,
902
- onForward: c
1199
+ onBack: c,
1200
+ onForward: f
903
1201
  })
904
1202
  };
905
1203
  }
906
1204
  export {
907
- we as createRoute,
908
- xe as createRouter,
909
- $ as parameters
1205
+ Qe as createRoute,
1206
+ We as createRouter,
1207
+ O as parameters
910
1208
  };