@voltro/web 0.30.0 → 0.30.2
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/CHANGELOG.md +119 -0
- package/dist/{defaultFallbacks-Fik_Gcjh.js → defaultFallbacks-B4Ak-R6R.js} +87 -87
- package/dist/{frameworkBoot-BkBY6M2s.js → frameworkBoot-Dm6UaRP-.js} +95 -92
- package/dist/frameworkBoot.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +57 -57
- package/dist/{mount-fDzFaIuf.js → mount-CXlKierJ.js} +1 -1
- package/dist/mount.js +1 -1
- package/dist/{serverContext-CV1ieZKF.js → serverContext-3i6Dr4ev.js} +171 -163
- package/dist/ssr.d.ts +15 -1
- package/dist/ssr.js +56 -52
- package/package.json +3 -3
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
import { t as e } from "./globalContext-d4A-ugDg.js";
|
|
2
|
-
import {
|
|
2
|
+
import { l as t, n, t as r } from "./defaultFallbacks-B4Ak-R6R.js";
|
|
3
3
|
import { f as i, i as a } from "./routerState-DAT472IC.js";
|
|
4
4
|
import { Component as o, useCallback as s, useContext as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
5
|
-
import { jsx as p, jsxs as
|
|
5
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
6
6
|
//#region src/routeEventBus.ts
|
|
7
|
-
var
|
|
7
|
+
var h = {
|
|
8
8
|
pathname: "/",
|
|
9
9
|
params: {},
|
|
10
10
|
loaderData: void 0
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
for (let e of
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
}),
|
|
11
|
+
}, g = /* @__PURE__ */ new Set(), ee = (e) => {
|
|
12
|
+
h = e;
|
|
13
|
+
for (let e of g) e();
|
|
14
|
+
}, te = () => h, _ = (e) => (g.add(e), () => {
|
|
15
|
+
g.delete(e);
|
|
16
|
+
}), v = class extends Error {
|
|
17
17
|
_voltroControl = "not-found";
|
|
18
18
|
constructor(e) {
|
|
19
19
|
super(e ? `Not found: ${e}` : "Not found"), this.name = "NotFoundError";
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, y = class extends Error {
|
|
22
22
|
_voltroControl = "redirect";
|
|
23
23
|
location;
|
|
24
24
|
status;
|
|
25
25
|
constructor(e, t) {
|
|
26
26
|
super(`Redirect: ${e}`), this.name = "RedirectError", this.location = e, this.status = t?.status ?? 303;
|
|
27
27
|
}
|
|
28
|
-
},
|
|
29
|
-
throw new
|
|
30
|
-
},
|
|
31
|
-
throw new
|
|
32
|
-
},
|
|
28
|
+
}, b = (e) => {
|
|
29
|
+
throw new v(e);
|
|
30
|
+
}, x = (e, t) => {
|
|
31
|
+
throw new y(e, t);
|
|
32
|
+
}, ne = (e) => e instanceof Error && e._voltroControl === "not-found", S = (e) => e instanceof Error && e._voltroControl === "redirect" && typeof e.location == "string", C = [
|
|
33
33
|
"static",
|
|
34
34
|
"spa",
|
|
35
35
|
"ssr",
|
|
36
36
|
"isr"
|
|
37
|
-
],
|
|
37
|
+
], w = 0, re = 1, T = 2, E = 3, D = (e) => e.startsWith("[[...") && e.endsWith("]]") ? {
|
|
38
38
|
source: "(.*)",
|
|
39
39
|
paramName: e.slice(5, -2),
|
|
40
|
-
weight:
|
|
40
|
+
weight: T
|
|
41
41
|
} : e.startsWith("[...") && e.endsWith("]") ? {
|
|
42
42
|
source: "(.+)",
|
|
43
43
|
paramName: e.slice(4, -1),
|
|
44
|
-
weight:
|
|
44
|
+
weight: E
|
|
45
45
|
} : e.startsWith("[") && e.endsWith("]") ? {
|
|
46
46
|
source: "([^/]+)",
|
|
47
47
|
paramName: e.slice(1, -1),
|
|
48
|
-
weight:
|
|
48
|
+
weight: re
|
|
49
49
|
} : {
|
|
50
50
|
source: e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"),
|
|
51
51
|
paramName: null,
|
|
52
|
-
weight:
|
|
53
|
-
},
|
|
54
|
-
let t = e.pattern.split("/").map(
|
|
52
|
+
weight: w
|
|
53
|
+
}, ie = (e) => {
|
|
54
|
+
let t = e.pattern.split("/").map(D);
|
|
55
55
|
for (let n = 0; n < t.length - 1; n++) {
|
|
56
56
|
let r = t[n];
|
|
57
|
-
if (r.weight ===
|
|
57
|
+
if (r.weight === E || r.weight === T) throw Error(`Route ${JSON.stringify(e.pattern)}: catch-all segment must be last. Anything after a catch-all is unreachable.`);
|
|
58
58
|
}
|
|
59
59
|
let n, r = t[t.length - 1];
|
|
60
|
-
n = r && r.weight ===
|
|
60
|
+
n = r && r.weight === T ? `${t.slice(0, -1).map((e) => e.source).join("/")}(?:/(.*))?` : t.map((e) => e.source).join("/");
|
|
61
61
|
let i = t.map((e) => e.paramName).filter((e) => e !== null), a = t.reduce((e, t) => e + t.weight, 0);
|
|
62
62
|
return {
|
|
63
63
|
...e,
|
|
@@ -65,11 +65,11 @@ var m = {
|
|
|
65
65
|
paramNames: i,
|
|
66
66
|
priority: a
|
|
67
67
|
};
|
|
68
|
-
},
|
|
68
|
+
}, ae = (e) => [...e].map((e, t) => ({
|
|
69
69
|
route: e,
|
|
70
70
|
index: t
|
|
71
|
-
})).sort((e, t) => e.route.priority === t.route.priority ? e.index - t.index : e.route.priority - t.route.priority).map(({ route: e }) => e),
|
|
72
|
-
let n =
|
|
71
|
+
})).sort((e, t) => e.route.priority === t.route.priority ? e.index - t.index : e.route.priority - t.route.priority).map(({ route: e }) => e), O = (e, t) => {
|
|
72
|
+
let n = ae(e);
|
|
73
73
|
for (let e of n) {
|
|
74
74
|
let n = e.regex.exec(t);
|
|
75
75
|
if (n) {
|
|
@@ -85,7 +85,7 @@ var m = {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
return null;
|
|
88
|
-
},
|
|
88
|
+
}, oe = (e, t, n) => k(`${e}__seg${t}`, n), k = (e, t) => `${e}\u0000${Object.entries(t).sort(([e], [t]) => e < t ? -1 : 1).map(([e, t]) => `${e}=${t}`).join("")}`, A = (e, t) => {
|
|
89
89
|
let n = e(t);
|
|
90
90
|
return n instanceof Promise ? n.then(i) : i(n);
|
|
91
91
|
}, se = (e, t, n, r) => e === void 0 ? null : typeof e == "function" ? e({
|
|
@@ -169,43 +169,43 @@ var m = {
|
|
|
169
169
|
kind: "spa",
|
|
170
170
|
to: s.pathname + s.search + s.hash
|
|
171
171
|
};
|
|
172
|
-
},
|
|
172
|
+
}, M = (e) => {
|
|
173
173
|
let t = e.replace(/^#/, "");
|
|
174
174
|
try {
|
|
175
175
|
return decodeURIComponent(t);
|
|
176
176
|
} catch {
|
|
177
177
|
return t;
|
|
178
178
|
}
|
|
179
|
-
},
|
|
180
|
-
let t =
|
|
179
|
+
}, N = (e) => {
|
|
180
|
+
let t = M(e);
|
|
181
181
|
return t ? document.getElementById(t) ?? document.getElementsByName(t)[0] ?? null : null;
|
|
182
|
-
},
|
|
182
|
+
}, fe = (e) => {
|
|
183
183
|
if (typeof window.requestAnimationFrame == "function") {
|
|
184
184
|
window.requestAnimationFrame(e);
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
187
|
window.setTimeout(e, 0);
|
|
188
|
-
},
|
|
188
|
+
}, pe = (e) => {
|
|
189
189
|
if (!e.hash) {
|
|
190
190
|
window.scrollTo(0, 0);
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
|
|
194
|
-
let t =
|
|
193
|
+
fe(() => {
|
|
194
|
+
let t = N(e.hash);
|
|
195
195
|
if (t) {
|
|
196
196
|
t.scrollIntoView();
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
199
|
window.scrollTo(0, 0);
|
|
200
200
|
});
|
|
201
|
-
},
|
|
201
|
+
}, P = 0, me = () => {
|
|
202
202
|
let e = typeof crypto < "u" ? crypto : void 0;
|
|
203
|
-
return e && typeof e.randomUUID == "function" ? e.randomUUID() : (
|
|
204
|
-
},
|
|
205
|
-
let e = c(
|
|
203
|
+
return e && typeof e.randomUUID == "function" ? e.randomUUID() : (P += 1, `k${Date.now().toString(36)}-${P}`);
|
|
204
|
+
}, F = e("router", null), I = () => {
|
|
205
|
+
let e = c(F);
|
|
206
206
|
if (!e) throw Error("Router hooks must be used inside <Router>.");
|
|
207
207
|
return e;
|
|
208
|
-
},
|
|
208
|
+
}, L = Symbol.for("@voltro/web/loaderData:absent"), R = e("loaderData", L), he = (e, t) => {
|
|
209
209
|
if (!e || e.pathname !== t) return;
|
|
210
210
|
let n = {};
|
|
211
211
|
for (let [t, r] of e.segments) n[t] = r;
|
|
@@ -213,16 +213,16 @@ var m = {
|
|
|
213
213
|
page: e.page,
|
|
214
214
|
segments: n
|
|
215
215
|
};
|
|
216
|
-
},
|
|
216
|
+
}, ge = (e, t) => {
|
|
217
217
|
if (e === t) return !0;
|
|
218
218
|
if (!e || !t || !Object.is(e.page, t.page)) return !1;
|
|
219
219
|
let n = Object.keys(e.segments), r = Object.keys(t.segments);
|
|
220
220
|
return n.length === r.length && n.every((n) => Object.is(e.segments[Number(n)], t.segments[Number(n)]));
|
|
221
|
-
},
|
|
221
|
+
}, _e = () => {
|
|
222
222
|
if (typeof document > "u") return;
|
|
223
223
|
let e = document.cookie.match(/(?:^|;\s*)voltro:locale=([^;]*)/);
|
|
224
224
|
return e ? decodeURIComponent(e[1]) : void 0;
|
|
225
|
-
},
|
|
225
|
+
}, ve = (e) => {
|
|
226
226
|
if (e === null || typeof document > "u") return () => {};
|
|
227
227
|
let t = document.title, n = [], r = [], i = [], a = [], o = [];
|
|
228
228
|
typeof e.title == "string" && (document.title = e.title);
|
|
@@ -257,7 +257,7 @@ var m = {
|
|
|
257
257
|
}
|
|
258
258
|
if (e.jsonLd) for (let t of e.jsonLd) {
|
|
259
259
|
let e = document.createElement("script");
|
|
260
|
-
e.type = "application/ld+json", e.setAttribute("data-voltro-page-jsonld", ""), e.textContent =
|
|
260
|
+
e.type = "application/ld+json", e.setAttribute("data-voltro-page-jsonld", ""), e.textContent = ye(t), document.head.appendChild(e), o.push(e);
|
|
261
261
|
}
|
|
262
262
|
return () => {
|
|
263
263
|
document.title = t;
|
|
@@ -267,7 +267,7 @@ var m = {
|
|
|
267
267
|
for (let { el: e, previous: t } of r) e.content = t;
|
|
268
268
|
for (let { el: e, previous: t } of a) e.href = t;
|
|
269
269
|
};
|
|
270
|
-
},
|
|
270
|
+
}, ye = (e) => JSON.stringify(e).replace(/<\/(script)/gi, "<\\/$1").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"), z = class extends o {
|
|
271
271
|
state = { error: null };
|
|
272
272
|
static getDerivedStateFromError(e) {
|
|
273
273
|
return { error: e };
|
|
@@ -291,10 +291,10 @@ var m = {
|
|
|
291
291
|
}
|
|
292
292
|
return this.props.children;
|
|
293
293
|
}
|
|
294
|
-
},
|
|
295
|
-
let [m, h] = f(() => window.location.pathname), [g,
|
|
294
|
+
}, B = "data-voltro-page-slot", be = () => /* @__PURE__ */ p("div", { [B]: "" }), V = ({ routes: e, notFounds: i = [], notFound: o = n, errorFallback: c = r }) => {
|
|
295
|
+
let [m, h] = f(() => window.location.pathname), [g, te] = f(() => window.location.pathname), [_, v] = f(() => window.location.search + window.location.hash), y = _.split("#")[0] ?? "", b = d(new ue()), x = d(/* @__PURE__ */ new Map()), [C, w] = f(null), re = s((e, t) => (x.current.set(e, t), () => {
|
|
296
296
|
x.current.delete(e);
|
|
297
|
-
}), []),
|
|
297
|
+
}), []), T = d(/* @__PURE__ */ new Map()), E = d(null), D = u(() => ae(e.map(ie)), [e]);
|
|
298
298
|
l(() => {
|
|
299
299
|
if (typeof window > "u") return;
|
|
300
300
|
let e = window.history.scrollRestoration;
|
|
@@ -303,18 +303,18 @@ var m = {
|
|
|
303
303
|
} catch {}
|
|
304
304
|
return window.history.state?.__vwebKey || window.history.replaceState({
|
|
305
305
|
...window.history.state,
|
|
306
|
-
__vwebKey:
|
|
306
|
+
__vwebKey: me()
|
|
307
307
|
}, ""), () => {
|
|
308
308
|
try {
|
|
309
309
|
window.history.scrollRestoration = e;
|
|
310
310
|
} catch {}
|
|
311
311
|
};
|
|
312
312
|
}, []);
|
|
313
|
-
let
|
|
313
|
+
let j = () => window.history.state?.__vwebKey ?? "initial";
|
|
314
314
|
l(() => {
|
|
315
315
|
let e = () => {
|
|
316
|
-
let e =
|
|
317
|
-
|
|
316
|
+
let e = T.current.get(j());
|
|
317
|
+
E.current = e ?? {
|
|
318
318
|
x: 0,
|
|
319
319
|
y: 0
|
|
320
320
|
}, h(window.location.pathname), v(window.location.search + window.location.hash);
|
|
@@ -322,12 +322,12 @@ var m = {
|
|
|
322
322
|
return window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e);
|
|
323
323
|
}, []);
|
|
324
324
|
let M = s((e, t, n) => {
|
|
325
|
-
|
|
325
|
+
T.current.set(j(), {
|
|
326
326
|
x: window.scrollX,
|
|
327
327
|
y: window.scrollY
|
|
328
328
|
});
|
|
329
|
-
let r = { __vwebKey:
|
|
330
|
-
n?.replace ? window.history.replaceState(r, "", e) : window.history.pushState(r, "", e), h(t.pathname), v(t.search + t.hash), n?.scroll !== !1 &&
|
|
329
|
+
let r = { __vwebKey: me() };
|
|
330
|
+
n?.replace ? window.history.replaceState(r, "", e) : window.history.pushState(r, "", e), h(t.pathname), v(t.search + t.hash), n?.scroll !== !1 && pe(t);
|
|
331
331
|
}, []), N = s((e, t) => {
|
|
332
332
|
let n = new URL(window.location.href), r = new URL(e, n);
|
|
333
333
|
if (!(r.pathname === n.pathname && r.search === n.search && r.hash === n.hash)) {
|
|
@@ -335,13 +335,13 @@ var m = {
|
|
|
335
335
|
to: e,
|
|
336
336
|
...t ? { opts: t } : {}
|
|
337
337
|
})) {
|
|
338
|
-
|
|
338
|
+
w({
|
|
339
339
|
to: e,
|
|
340
340
|
...t ? { opts: t } : {},
|
|
341
341
|
retry: () => {
|
|
342
|
-
|
|
342
|
+
w(null), M(e, r, t);
|
|
343
343
|
},
|
|
344
|
-
reset: () =>
|
|
344
|
+
reset: () => w(null)
|
|
345
345
|
});
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
@@ -356,42 +356,42 @@ var m = {
|
|
|
356
356
|
};
|
|
357
357
|
return document.addEventListener("click", e), () => document.removeEventListener("click", e);
|
|
358
358
|
}, [N]);
|
|
359
|
-
let
|
|
359
|
+
let P = u(() => O(D, m), [D, m]), F = d(/* @__PURE__ */ new Map()), [I, ye] = f(0);
|
|
360
360
|
l(() => {
|
|
361
|
-
let e =
|
|
362
|
-
if (!e?.load ||
|
|
361
|
+
let e = P?.route;
|
|
362
|
+
if (!e?.load || F.current.has(e.pattern)) return;
|
|
363
363
|
let t = !1;
|
|
364
364
|
return e.load().then((n) => {
|
|
365
|
-
t || (
|
|
365
|
+
t || (F.current.set(e.pattern, n), ye((e) => e + 1));
|
|
366
366
|
}).catch(() => {}), () => {
|
|
367
367
|
t = !0;
|
|
368
368
|
};
|
|
369
|
-
}, [
|
|
369
|
+
}, [P?.route.load ? P.route.pattern : null]);
|
|
370
370
|
let B = u(() => {
|
|
371
|
-
if (!
|
|
372
|
-
let e =
|
|
371
|
+
if (!P) return null;
|
|
372
|
+
let e = P.route;
|
|
373
373
|
if (!e.load) return e;
|
|
374
|
-
let t =
|
|
374
|
+
let t = F.current.get(e.pattern);
|
|
375
375
|
return t ? {
|
|
376
376
|
...e,
|
|
377
|
-
...
|
|
377
|
+
...Z(t),
|
|
378
378
|
load: void 0
|
|
379
379
|
} : null;
|
|
380
|
-
}, [
|
|
380
|
+
}, [P, I]), V = u(() => O(D, g), [D, g]), H = u(() => {
|
|
381
381
|
if (!V) return null;
|
|
382
382
|
let e = V.route;
|
|
383
383
|
if (!e.load) return e;
|
|
384
|
-
let t =
|
|
384
|
+
let t = F.current.get(e.pattern);
|
|
385
385
|
return t ? {
|
|
386
386
|
...e,
|
|
387
|
-
...
|
|
387
|
+
...Z(t),
|
|
388
388
|
load: void 0
|
|
389
389
|
} : null;
|
|
390
|
-
}, [V,
|
|
391
|
-
let t = new URL(e, window.location.origin), n = D
|
|
390
|
+
}, [V, I]), Se = s((e) => {
|
|
391
|
+
let t = new URL(e, window.location.origin), n = O(D, t.pathname);
|
|
392
392
|
if (!n) return;
|
|
393
393
|
let r = (e, r) => {
|
|
394
|
-
|
|
394
|
+
b.current.start(e, (e) => A(r, {
|
|
395
395
|
params: n.params,
|
|
396
396
|
pathname: t.pathname,
|
|
397
397
|
search: t.search,
|
|
@@ -399,39 +399,39 @@ var m = {
|
|
|
399
399
|
}));
|
|
400
400
|
};
|
|
401
401
|
n.route.loader && r(k(n.route.pattern, n.params), n.route.loader), n.route.chain?.forEach((e, t) => {
|
|
402
|
-
e.loader && r(
|
|
402
|
+
e.loader && r(oe(n.route.pattern, t, n.params), e.loader);
|
|
403
403
|
});
|
|
404
|
-
}, [
|
|
404
|
+
}, [D]), [U, W] = f({ status: "idle" }), G = d(void 0);
|
|
405
405
|
G.current === void 0 && (G.current = a());
|
|
406
|
-
let
|
|
406
|
+
let Te = d(!1), [Ee, De] = f(() => G.current?.pageClientOnly === !0 && G.current.pathname === m);
|
|
407
407
|
l(() => {
|
|
408
|
-
|
|
408
|
+
De(!1);
|
|
409
409
|
}, []);
|
|
410
|
-
let [K,
|
|
410
|
+
let [K, Oe] = f(() => ({
|
|
411
411
|
pathname: m,
|
|
412
|
-
data:
|
|
413
|
-
chain:
|
|
412
|
+
data: he(G.current ?? null, m),
|
|
413
|
+
chain: P?.route.chain
|
|
414
414
|
}));
|
|
415
415
|
l(() => {
|
|
416
416
|
let e = (e) => {
|
|
417
|
-
|
|
417
|
+
te(m), Oe((t) => t.pathname === m && ge(t.data, e) ? t : {
|
|
418
418
|
pathname: m,
|
|
419
419
|
data: e,
|
|
420
|
-
chain:
|
|
420
|
+
chain: P?.route.chain
|
|
421
421
|
});
|
|
422
422
|
};
|
|
423
|
-
if (!
|
|
423
|
+
if (!P) {
|
|
424
424
|
W({ status: "idle" }), e(void 0);
|
|
425
425
|
return;
|
|
426
426
|
}
|
|
427
427
|
if (!B) {
|
|
428
428
|
W({
|
|
429
429
|
status: "pending",
|
|
430
|
-
key: k(
|
|
430
|
+
key: k(P.route.pattern, P.params)
|
|
431
431
|
});
|
|
432
432
|
return;
|
|
433
433
|
}
|
|
434
|
-
let t = B, { params: n } =
|
|
434
|
+
let t = B, { params: n } = P, r = t.chain, i = (t.Pending ?? le(r, "Pending", r ? r.length - 1 : -1)) !== void 0, a = [];
|
|
435
435
|
if (t.loader) {
|
|
436
436
|
let e = t.loader;
|
|
437
437
|
a.push({
|
|
@@ -440,7 +440,7 @@ var m = {
|
|
|
440
440
|
run: (t) => A(e, {
|
|
441
441
|
params: n,
|
|
442
442
|
pathname: m,
|
|
443
|
-
search:
|
|
443
|
+
search: y,
|
|
444
444
|
signal: t
|
|
445
445
|
})
|
|
446
446
|
});
|
|
@@ -449,12 +449,12 @@ var m = {
|
|
|
449
449
|
if (e.loader) {
|
|
450
450
|
let i = e.loader;
|
|
451
451
|
a.push({
|
|
452
|
-
cacheKey:
|
|
452
|
+
cacheKey: oe(t.pattern, r, n),
|
|
453
453
|
target: r,
|
|
454
454
|
run: (e) => A(i, {
|
|
455
455
|
params: n,
|
|
456
456
|
pathname: m,
|
|
457
|
-
search:
|
|
457
|
+
search: y,
|
|
458
458
|
signal: e
|
|
459
459
|
})
|
|
460
460
|
});
|
|
@@ -464,17 +464,17 @@ var m = {
|
|
|
464
464
|
return;
|
|
465
465
|
}
|
|
466
466
|
let o = k(t.pattern, n), s = G.current;
|
|
467
|
-
if (s && !
|
|
468
|
-
|
|
469
|
-
for (let e of a) e.target === "page" ? s.pageRan &&
|
|
467
|
+
if (s && !Te.current && m === s.pathname) {
|
|
468
|
+
Te.current = !0;
|
|
469
|
+
for (let e of a) e.target === "page" ? s.pageRan && b.current.seed(e.cacheKey, s.page) : s.segments.has(e.target) && b.current.seed(e.cacheKey, s.segments.get(e.target));
|
|
470
470
|
}
|
|
471
471
|
let c = a.map((e) => ({
|
|
472
472
|
spec: e,
|
|
473
|
-
entry:
|
|
473
|
+
entry: b.current.start(e.cacheKey, e.run)
|
|
474
474
|
})), l = () => {
|
|
475
475
|
let e = {}, t;
|
|
476
476
|
for (let { spec: n } of c) {
|
|
477
|
-
let r =
|
|
477
|
+
let r = b.current.get(n.cacheKey);
|
|
478
478
|
if (!r || r.status === "pending") return null;
|
|
479
479
|
if (r.status === "error") return {
|
|
480
480
|
ok: !1,
|
|
@@ -499,13 +499,13 @@ var m = {
|
|
|
499
499
|
status: "error",
|
|
500
500
|
key: o,
|
|
501
501
|
error: u.error
|
|
502
|
-
}),
|
|
502
|
+
}), S(u.error) || e(void 0));
|
|
503
503
|
return;
|
|
504
504
|
}
|
|
505
505
|
W({
|
|
506
506
|
status: "pending",
|
|
507
507
|
key: o
|
|
508
|
-
}), i &&
|
|
508
|
+
}), i && te(m);
|
|
509
509
|
let d = !1, f = c.map(({ entry: e }) => e.status === "pending" ? e.promise : Promise.resolve());
|
|
510
510
|
return Promise.all(f).then(() => {
|
|
511
511
|
if (d) return;
|
|
@@ -518,56 +518,56 @@ var m = {
|
|
|
518
518
|
status: "error",
|
|
519
519
|
key: o,
|
|
520
520
|
error: t.error
|
|
521
|
-
}),
|
|
521
|
+
}), S(t.error) || e(void 0)));
|
|
522
522
|
}), () => {
|
|
523
523
|
d = !0;
|
|
524
524
|
};
|
|
525
525
|
}, [
|
|
526
|
-
|
|
526
|
+
P,
|
|
527
527
|
B,
|
|
528
528
|
m
|
|
529
529
|
]);
|
|
530
|
-
let q = K.data?.page, J = g === m,
|
|
530
|
+
let q = K.data?.page, J = g === m, ke = K.pathname === g, Ae = ke ? K.data?.page : void 0, je = H?.loader === void 0 ? L : Ae, Y = _e(), X = u(() => {
|
|
531
531
|
if (!V) return null;
|
|
532
|
-
let e = V.params.locale ??
|
|
532
|
+
let e = V.params.locale ?? Y;
|
|
533
533
|
return se(H?.meta, V.params, q, e);
|
|
534
534
|
}, [
|
|
535
535
|
V,
|
|
536
536
|
H,
|
|
537
537
|
q,
|
|
538
|
-
|
|
538
|
+
Y
|
|
539
539
|
]);
|
|
540
|
-
l(() =>
|
|
541
|
-
let [
|
|
540
|
+
l(() => ve(X), [X]);
|
|
541
|
+
let [Me, Ne] = f(""), Pe = d(!1), [Q, Fe] = f(!1);
|
|
542
542
|
l(() => {
|
|
543
543
|
if (!Pe.current) {
|
|
544
|
-
Pe.current = !0,
|
|
544
|
+
Pe.current = !0, Fe(!0);
|
|
545
545
|
return;
|
|
546
546
|
}
|
|
547
547
|
let e = X?.title ?? (typeof document < "u" ? document.title : "");
|
|
548
|
-
|
|
548
|
+
Ne(e && e.length > 0 ? e : g);
|
|
549
549
|
}, [g, X]), l(() => {
|
|
550
|
-
let e =
|
|
551
|
-
e && (
|
|
550
|
+
let e = E.current;
|
|
551
|
+
e && (E.current = null, fe(() => window.scrollTo(e.x, e.y)));
|
|
552
552
|
}, [g]);
|
|
553
|
-
let
|
|
553
|
+
let Ie = u(() => ({
|
|
554
554
|
pathname: g,
|
|
555
555
|
search: _,
|
|
556
556
|
navigate: N,
|
|
557
557
|
params: V?.params ?? {},
|
|
558
|
-
prefetch:
|
|
558
|
+
prefetch: Se,
|
|
559
559
|
loaderData: q,
|
|
560
|
-
registerBlocker:
|
|
561
|
-
blocked:
|
|
560
|
+
registerBlocker: re,
|
|
561
|
+
blocked: C
|
|
562
562
|
}), [
|
|
563
563
|
g,
|
|
564
564
|
_,
|
|
565
565
|
N,
|
|
566
566
|
V,
|
|
567
|
-
|
|
567
|
+
Se,
|
|
568
568
|
q,
|
|
569
|
-
|
|
570
|
-
|
|
569
|
+
re,
|
|
570
|
+
C
|
|
571
571
|
]);
|
|
572
572
|
l(() => {
|
|
573
573
|
if (typeof window > "u") return;
|
|
@@ -581,7 +581,7 @@ var m = {
|
|
|
581
581
|
};
|
|
582
582
|
return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
|
|
583
583
|
}, []), l(() => {
|
|
584
|
-
|
|
584
|
+
ee({
|
|
585
585
|
pathname: g,
|
|
586
586
|
params: V?.params ?? {},
|
|
587
587
|
loaderData: q
|
|
@@ -603,25 +603,25 @@ var m = {
|
|
|
603
603
|
label: "Loader failed"
|
|
604
604
|
});
|
|
605
605
|
}, [U.status]), l(() => {
|
|
606
|
-
U.status === "error" &&
|
|
606
|
+
U.status === "error" && S(U.error) && N(U.error.location, { replace: !0 });
|
|
607
607
|
}, [U, N]);
|
|
608
|
-
let
|
|
608
|
+
let Le = () => {
|
|
609
609
|
let e = ce(i, g);
|
|
610
610
|
if (e) {
|
|
611
611
|
let { Component: t, chain: n } = e;
|
|
612
612
|
return we(n, /* @__PURE__ */ p(t, {}), g, c);
|
|
613
613
|
}
|
|
614
614
|
return /* @__PURE__ */ p(o, {});
|
|
615
|
-
},
|
|
616
|
-
if (!V) $ =
|
|
617
|
-
else if (
|
|
615
|
+
}, Re = J && V && U.status === "error" ? U.error : void 0, $;
|
|
616
|
+
if (!V) $ = Le();
|
|
617
|
+
else if (ne(Re)) $ = Le();
|
|
618
618
|
else {
|
|
619
619
|
let e = V.route.chain, t = e ? e.length - 1 : -1, n = H?.ErrorBoundary ?? le(e, "Error", t) ?? c, r;
|
|
620
|
-
if (
|
|
621
|
-
else if (J && U.status === "error" && !
|
|
620
|
+
if (Ee) r = /* @__PURE__ */ p(be, {});
|
|
621
|
+
else if (J && U.status === "error" && !S(U.error)) r = /* @__PURE__ */ p(n, {
|
|
622
622
|
error: U.error,
|
|
623
623
|
reset: () => {
|
|
624
|
-
|
|
624
|
+
b.current.invalidate(V.route.pattern), h((e) => e), W({ status: "idle" });
|
|
625
625
|
}
|
|
626
626
|
});
|
|
627
627
|
else if (J && U.status === "pending") {
|
|
@@ -629,37 +629,45 @@ var m = {
|
|
|
629
629
|
if (i) r = /* @__PURE__ */ p(i, {});
|
|
630
630
|
else if (H?.Component) {
|
|
631
631
|
let e = H.Component;
|
|
632
|
-
r = /* @__PURE__ */ p(
|
|
632
|
+
r = /* @__PURE__ */ p(z, {
|
|
633
633
|
resetKey: g,
|
|
634
634
|
Fallback: n,
|
|
635
|
-
children: /* @__PURE__ */ p(
|
|
636
|
-
value:
|
|
635
|
+
children: /* @__PURE__ */ p(R.Provider, {
|
|
636
|
+
value: je,
|
|
637
637
|
children: /* @__PURE__ */ p(e, {})
|
|
638
638
|
})
|
|
639
639
|
});
|
|
640
640
|
} else r = null;
|
|
641
641
|
} else {
|
|
642
642
|
let e = H?.Component;
|
|
643
|
-
r = e ? /* @__PURE__ */ p(
|
|
643
|
+
r = e ? /* @__PURE__ */ p(z, {
|
|
644
644
|
resetKey: g,
|
|
645
645
|
Fallback: n,
|
|
646
|
-
children: /* @__PURE__ */ p(
|
|
647
|
-
value:
|
|
646
|
+
children: /* @__PURE__ */ p(R.Provider, {
|
|
647
|
+
value: je,
|
|
648
648
|
children: /* @__PURE__ */ p(e, {})
|
|
649
649
|
})
|
|
650
650
|
}) : null;
|
|
651
651
|
}
|
|
652
652
|
$ = we(e, r, g, c, (t) => {
|
|
653
|
-
if (
|
|
653
|
+
if (ke) return K.data?.segments[t];
|
|
654
654
|
let n = e?.[t]?.Layout;
|
|
655
655
|
return n !== void 0 && n === K.chain?.[t]?.Layout ? K.data?.segments[t] : void 0;
|
|
656
656
|
});
|
|
657
657
|
}
|
|
658
|
-
return /* @__PURE__ */
|
|
659
|
-
value:
|
|
660
|
-
|
|
658
|
+
return /* @__PURE__ */ p(xe, {
|
|
659
|
+
value: Ie,
|
|
660
|
+
announcer: Q ? /* @__PURE__ */ p(Ce, { message: Me }) : null,
|
|
661
|
+
children: $
|
|
661
662
|
});
|
|
662
|
-
},
|
|
663
|
+
}, xe = ({ value: e, announcer: t, children: n }) => /* @__PURE__ */ m(F.Provider, {
|
|
664
|
+
value: e,
|
|
665
|
+
children: [n, t]
|
|
666
|
+
}), H = (e, t) => /* @__PURE__ */ p(xe, {
|
|
667
|
+
value: e,
|
|
668
|
+
announcer: null,
|
|
669
|
+
children: t
|
|
670
|
+
}), Se = {
|
|
663
671
|
position: "absolute",
|
|
664
672
|
width: 1,
|
|
665
673
|
height: 1,
|
|
@@ -674,7 +682,7 @@ var m = {
|
|
|
674
682
|
role: "status",
|
|
675
683
|
"aria-live": "assertive",
|
|
676
684
|
"aria-atomic": "true",
|
|
677
|
-
style:
|
|
685
|
+
style: Se,
|
|
678
686
|
children: e
|
|
679
687
|
}), we = (e, t, n, r, i) => {
|
|
680
688
|
if (!e || e.length === 0) return t;
|
|
@@ -683,14 +691,14 @@ var m = {
|
|
|
683
691
|
let r = e[t];
|
|
684
692
|
if (r.Layout) {
|
|
685
693
|
let e = r.Layout;
|
|
686
|
-
a = /* @__PURE__ */ p(
|
|
687
|
-
value: r.loader === void 0 ?
|
|
694
|
+
a = /* @__PURE__ */ p(R.Provider, {
|
|
695
|
+
value: r.loader === void 0 ? L : i?.(t),
|
|
688
696
|
children: /* @__PURE__ */ p(e, { children: a })
|
|
689
697
|
});
|
|
690
698
|
}
|
|
691
699
|
if (r.Error) {
|
|
692
700
|
let e = r.Error;
|
|
693
|
-
a = /* @__PURE__ */ p(
|
|
701
|
+
a = /* @__PURE__ */ p(z, {
|
|
694
702
|
resetKey: n,
|
|
695
703
|
Fallback: e,
|
|
696
704
|
children: a
|
|
@@ -698,15 +706,15 @@ var m = {
|
|
|
698
706
|
}
|
|
699
707
|
}
|
|
700
708
|
return a;
|
|
701
|
-
},
|
|
702
|
-
let e = c(
|
|
703
|
-
if (e ===
|
|
709
|
+
}, U = () => I().pathname, W = () => I().navigate, G = () => I().params, Te = () => {
|
|
710
|
+
let e = c(R);
|
|
711
|
+
if (e === L) throw Error("useLoaderData() was called at a level that declares no `loader`. Export `loader` from this page/layout, or — if this component is shared between routes that have one and routes that do not — read it with `useOptionalLoaderData()`, which returns `undefined` here instead of throwing. The React component stack below names the component.");
|
|
704
712
|
return e;
|
|
705
|
-
},
|
|
706
|
-
let e = c(
|
|
707
|
-
return e ===
|
|
708
|
-
},
|
|
709
|
-
let { registerBlocker: t, blocked: n } =
|
|
713
|
+
}, Ee = () => {
|
|
714
|
+
let e = c(R);
|
|
715
|
+
return e === L ? void 0 : e;
|
|
716
|
+
}, De = () => I().prefetch, K = (e) => {
|
|
717
|
+
let { registerBlocker: t, blocked: n } = I(), r = d(Symbol("voltro:blocker")), i = d(e);
|
|
710
718
|
return i.current = e, l(() => {
|
|
711
719
|
let e = r.current;
|
|
712
720
|
return t(e, (e) => {
|
|
@@ -719,26 +727,26 @@ var m = {
|
|
|
719
727
|
retry: n.retry,
|
|
720
728
|
reset: n.reset
|
|
721
729
|
} : { blocked: !1 };
|
|
722
|
-
},
|
|
723
|
-
let { navigate: e } =
|
|
730
|
+
}, Oe = (e) => e instanceof URLSearchParams ? e : new URLSearchParams(e), q = () => {
|
|
731
|
+
let { navigate: e } = I();
|
|
724
732
|
return s((t, n) => {
|
|
725
|
-
let r = new URLSearchParams(typeof window < "u" ? window.location.search : ""), i =
|
|
733
|
+
let r = new URLSearchParams(typeof window < "u" ? window.location.search : ""), i = Oe(typeof t == "function" ? t(r) : t).toString(), a = typeof window < "u" ? window.location.pathname : "/", o = i ? `${a}?${i}` : a;
|
|
726
734
|
e(o, {
|
|
727
735
|
replace: !n?.push,
|
|
728
736
|
...n?.scroll === void 0 ? {} : { scroll: n.scroll }
|
|
729
737
|
});
|
|
730
738
|
}, [e]);
|
|
731
|
-
},
|
|
739
|
+
}, J = (e) => e, ke = (e, t) => {
|
|
732
740
|
let n = new URLSearchParams();
|
|
733
741
|
for (let [e, r] of Object.entries(t)) r !== void 0 && n.append(e, String(r));
|
|
734
742
|
let r = n.toString();
|
|
735
743
|
return r ? `${e}?${r}` : e;
|
|
736
|
-
},
|
|
737
|
-
let c =
|
|
744
|
+
}, Ae = (e, t) => `${e}#${t.replace(/^#/, "")}`, je = (e) => /^([a-z][a-z0-9+.-]*:|\/\/|#)/i.test(e), Y = ({ to: e, children: t, onClick: n, prefetch: r = !1, replace: i = !1, onMouseEnter: a, onFocus: o, ...s }) => {
|
|
745
|
+
let c = W(), l = De(), u = je(e), d = (t) => {
|
|
738
746
|
u || t.metaKey || t.ctrlKey || t.shiftKey || t.altKey || t.button !== 0 || (t.preventDefault(), n?.(t), c(e, i ? { replace: i } : void 0));
|
|
739
747
|
}, f = (t) => {
|
|
740
748
|
r && !u && l(e), a?.(t);
|
|
741
|
-
},
|
|
749
|
+
}, m = (t) => {
|
|
742
750
|
r && !u && l(e), o?.(t);
|
|
743
751
|
};
|
|
744
752
|
return /* @__PURE__ */ p("a", {
|
|
@@ -746,13 +754,13 @@ var m = {
|
|
|
746
754
|
href: e,
|
|
747
755
|
onClick: d,
|
|
748
756
|
onMouseEnter: f,
|
|
749
|
-
onFocus:
|
|
757
|
+
onFocus: m,
|
|
750
758
|
children: t
|
|
751
759
|
});
|
|
752
|
-
},
|
|
760
|
+
}, X = (e) => Y({
|
|
753
761
|
...e,
|
|
754
762
|
to: e.to
|
|
755
|
-
}),
|
|
763
|
+
}), Z = (e) => ({
|
|
756
764
|
Component: e.default,
|
|
757
765
|
meta: e.meta,
|
|
758
766
|
loader: e.loader,
|
|
@@ -762,28 +770,28 @@ var m = {
|
|
|
762
770
|
interactive: e.interactive
|
|
763
771
|
}), Me = (e, t, n = {}) => ({
|
|
764
772
|
pattern: e,
|
|
765
|
-
...
|
|
773
|
+
...Z(t),
|
|
766
774
|
chain: n.chain
|
|
767
775
|
}), Ne = (e, t, n = {}) => ({
|
|
768
776
|
pattern: e,
|
|
769
777
|
load: t,
|
|
770
778
|
chain: n.chain
|
|
771
|
-
}),
|
|
772
|
-
let n =
|
|
779
|
+
}), Pe = async (e, t) => {
|
|
780
|
+
let n = O(e.map(ie), t)?.route.load;
|
|
773
781
|
if (n) try {
|
|
774
782
|
await n();
|
|
775
783
|
} catch {}
|
|
776
|
-
},
|
|
777
|
-
let e =
|
|
784
|
+
}, Q = e("serverRequest", null), Fe = () => c(Q), Ie = () => {
|
|
785
|
+
let e = Fe();
|
|
778
786
|
if (e !== null) {
|
|
779
787
|
let t = e.url.indexOf("?");
|
|
780
788
|
return new URLSearchParams(t >= 0 ? e.url.slice(t + 1) : "");
|
|
781
789
|
}
|
|
782
790
|
return typeof window < "u" ? new URLSearchParams(window.location.search) : new URLSearchParams();
|
|
783
|
-
},
|
|
791
|
+
}, Le = ({ value: e, children: t }) => /* @__PURE__ */ p(Q.Provider, {
|
|
784
792
|
value: e,
|
|
785
793
|
children: t
|
|
786
|
-
}),
|
|
794
|
+
}), Re = (e) => {
|
|
787
795
|
let t = {};
|
|
788
796
|
if (!e) return t;
|
|
789
797
|
for (let n of e.split(";")) {
|
|
@@ -801,4 +809,4 @@ var m = {
|
|
|
801
809
|
return t;
|
|
802
810
|
};
|
|
803
811
|
//#endregion
|
|
804
|
-
export {
|
|
812
|
+
export { Te as A, y as B, Pe as C, oe as D, se as E, De as F, te as G, S as H, q as I, ee as K, Ae as L, W as M, Ee as N, ae as O, G as P, ke as R, Me as S, de as T, b as U, ne as V, x as W, J as _, Fe as a, k as b, R as c, be as d, X as f, ie as g, F as h, Ie as i, U as j, K as k, L as l, V as m, Le as n, Y as o, C as p, _ as q, Re as r, ue as s, Q as t, B as u, ce as v, H as w, O as x, Ne as y, v as z };
|