@demiurgejs/core 0.2.0-beta.5 → 0.2.0-beta.7
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/README.md +14 -0
- package/bin/demiurge.mjs +6 -0
- package/dist/browser/file-router.d.ts +1 -0
- package/dist/browser/file-router.d.ts.map +1 -1
- package/dist/chunks/{document-shell-9GPwtcTt.js → document-shell-C0aPrkhd.js} +2 -2
- package/dist/chunks/{document-shell-9GPwtcTt.js.map → document-shell-C0aPrkhd.js.map} +1 -1
- package/dist/chunks/image-CRerJ5BY.js +145 -0
- package/dist/chunks/image-CRerJ5BY.js.map +1 -0
- package/dist/chunks/{image-codec-Dh1POFhE.js → image-codec-CQ8Cwxwb.js} +2 -2
- package/dist/chunks/{image-codec-Dh1POFhE.js.map → image-codec-CQ8Cwxwb.js.map} +1 -1
- package/dist/chunks/{images-CG7ZzayG.js → images-QgdmLyQ3.js} +11 -11
- package/dist/chunks/{images-CG7ZzayG.js.map → images-QgdmLyQ3.js.map} +1 -1
- package/dist/chunks/{index-0MNiR_wo.js → index-LYve1rQp.js} +286 -351
- package/dist/chunks/index-LYve1rQp.js.map +1 -0
- package/dist/chunks/links-iU22QkCE.js +68 -0
- package/dist/chunks/links-iU22QkCE.js.map +1 -0
- package/dist/chunks/{plugin-BZauDxRY.js → plugin-bkP6WwrS.js} +13 -12
- package/dist/chunks/{plugin-BZauDxRY.js.map → plugin-bkP6WwrS.js.map} +1 -1
- package/dist/chunks/runtime-BH519j2t.js +294 -0
- package/dist/chunks/runtime-BH519j2t.js.map +1 -0
- package/dist/chunks/streaming-BlKlC3nw.js +427 -0
- package/dist/chunks/streaming-BlKlC3nw.js.map +1 -0
- package/dist/chunks/{testing-CUwGj2ie.js → testing-BEW1nchS.js} +645 -630
- package/dist/chunks/testing-BEW1nchS.js.map +1 -0
- package/dist/chunks/{vite-QoqrGl6f.js → vite-BADZA8Fl.js} +73 -70
- package/dist/chunks/vite-BADZA8Fl.js.map +1 -0
- package/dist/cli.d.ts +8 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +186 -122
- package/dist/cli.js.map +1 -1
- package/dist/config/index.js +2 -2
- package/dist/config/types.d.ts +3 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/validate.d.ts.map +1 -1
- package/dist/data/cache.d.ts +5 -0
- package/dist/data/cache.d.ts.map +1 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/testing.d.ts.map +1 -1
- package/dist/data/testing.js +101 -67
- package/dist/data/testing.js.map +1 -1
- package/dist/data/tiered.d.ts.map +1 -1
- package/dist/edge/index.js +27 -26
- package/dist/edge/index.js.map +1 -1
- package/dist/edge/stores.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +910 -891
- package/dist/index.js.map +1 -1
- package/dist/internal/testing.js +2 -2
- package/dist/kv/index.js +7 -6
- package/dist/kv/index.js.map +1 -1
- package/dist/kv/store.d.ts.map +1 -1
- package/dist/node/http.d.ts +2 -0
- package/dist/node/http.d.ts.map +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +12 -11
- package/dist/node/index.js.map +1 -1
- package/dist/node/serve.d.ts +4 -0
- package/dist/node/serve.d.ts.map +1 -1
- package/dist/redis/index.js +29 -28
- package/dist/redis/index.js.map +1 -1
- package/dist/redis/store.d.ts.map +1 -1
- package/dist/route/serialization.d.ts +4 -4
- package/dist/route/serialization.d.ts.map +1 -1
- package/dist/static/index.d.ts.map +1 -1
- package/dist/static/index.js +255 -255
- package/dist/static/index.js.map +1 -1
- package/dist/static/testing.d.ts +26 -0
- package/dist/static/testing.d.ts.map +1 -0
- package/dist/static/testing.js +76 -0
- package/dist/static/testing.js.map +1 -0
- package/dist/testing/index.d.ts +47 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +99 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/vercel/build.d.ts +31 -0
- package/dist/vercel/build.d.ts.map +1 -0
- package/dist/vercel/config.d.ts +15 -0
- package/dist/vercel/config.d.ts.map +1 -0
- package/dist/vercel/index.d.ts +7 -0
- package/dist/vercel/index.d.ts.map +1 -0
- package/dist/vercel/index.js +11 -0
- package/dist/vercel/index.js.map +1 -0
- package/dist/vercel/runtime.d.ts +29 -0
- package/dist/vercel/runtime.d.ts.map +1 -0
- package/dist/vite/index.js +1 -1
- package/package.json +13 -1
- package/dist/chunks/index-0MNiR_wo.js.map +0 -1
- package/dist/chunks/streaming-GYIsVTQH.js +0 -560
- package/dist/chunks/streaming-GYIsVTQH.js.map +0 -1
- package/dist/chunks/testing-CUwGj2ie.js.map +0 -1
- package/dist/chunks/vite-QoqrGl6f.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { I as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { d as
|
|
11
|
-
import {
|
|
1
|
+
import { jsx as kt } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as Ge, useCallback as Rt, createElement as R, useContext as Ye, useRef as k, useMemo as ce, useActionState as ar, useId as sr, useLayoutEffect as ie, useState as U, useEffect as X, Fragment as Ce, Component as cr } from "react";
|
|
3
|
+
import { flushSync as ur } from "react-dom";
|
|
4
|
+
import { g as lr, h as ct, i as dr, H as fr, j as ut, k as hr, l as pr, m as $e } from "./chunks/index-LYve1rQp.js";
|
|
5
|
+
import { F as li, n as di, o as fi, p as hi, q as pi, d as mi, t as yi, u as gi, v as wi, a as vi, w as bi } from "./chunks/index-LYve1rQp.js";
|
|
6
|
+
import { O as lt, J as mr, P as Ze, i as re, Q as yr, R as gr, s as Xe, S as Qe, T as et, U as wr, V as Tt, W as vr, l as tt, L as Mt, X as ze, Y as br, r as Sr, z as Ct, Z as Er, _ as dt, $ as Ar, a0 as xr, a1 as kr, a2 as Rr, a3 as Tr, a4 as Mr, a5 as Cr, a6 as $r } from "./chunks/testing-BEW1nchS.js";
|
|
7
|
+
import { a7 as Ei, D as Ai, a8 as xi, a9 as ki, aa as Ri, ab as Ti, ac as Mi, ad as Ci, ae as $i, af as Ni, ag as Li, ah as Ii, ai as Di, aj as Pi, ak as Oi, al as _i, am as Fi, an as Ui, H as Bi, ao as Hi, e as zi, c as Vi, G as ji, n as qi, k as Ki, ap as Wi, aq as Ji, ar as Gi, f as Yi, as as Zi, at as Xi, au as Qi, av as ea, aw as ta, ax as ra, ay as na, az as oa, aA as ia, aB as aa, aC as sa, q as ca, aD as ua, aE as la, h as da, aF as fa, aG as ha, x as pa, aH as ma, aI as ya, aJ as ga, aK as wa, j as va, aL as ba, aM as Sa, aN as Ea, m as Aa, aO as xa, aP as ka, aQ as Ra, aR as Ta, aS as Ma, aT as Ca, aU as $a, aV as Na, aW as La, p as Ia, aX as Da, u as Pa, aY as Oa, aZ as _a, a_ as Fa, w as Ua, a$ as Ba, I as Ha, K as za, b0 as Va, b1 as ja, b2 as qa, b3 as Ka, b4 as Wa, b5 as Ja, b6 as Ga, b7 as Ya, N as Za, v as Xa, b8 as Qa, o as es, b as ts } from "./chunks/testing-BEW1nchS.js";
|
|
8
|
+
import { I as Nr } from "./chunks/static-files-ehaD1kE7.js";
|
|
9
|
+
import { D as ns, c as os, i as is } from "./chunks/static-files-ehaD1kE7.js";
|
|
10
|
+
import { d as ss, m as cs, a as us, p as ls, r as ds } from "./chunks/links-iU22QkCE.js";
|
|
11
|
+
import { k as Lr } from "./chunks/images-QgdmLyQ3.js";
|
|
12
|
+
import { d as hs, l as ps, m as ms, n as ys, f as gs, o as ws, q as vs, b as bs, s as Ss, t as Es, c as As, i as xs, p as ks, r as Rs } from "./chunks/images-QgdmLyQ3.js";
|
|
13
|
+
import { c as Ms, s as Cs } from "./chunks/session-store-ChModVcq.js";
|
|
12
14
|
import "react-dom/server";
|
|
13
|
-
function
|
|
15
|
+
function $o(e) {
|
|
14
16
|
return {
|
|
15
17
|
entries: e.map((t) => ({
|
|
16
18
|
...t,
|
|
17
|
-
alternates:
|
|
19
|
+
alternates: Ir(t.alternates ?? [])
|
|
18
20
|
}))
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
|
-
function
|
|
23
|
+
function Ir(e) {
|
|
22
24
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
23
25
|
for (const n of e) {
|
|
24
26
|
const o = n.hrefLang.toLowerCase();
|
|
@@ -39,67 +41,67 @@ function Cr(e) {
|
|
|
39
41
|
}
|
|
40
42
|
return [...t].map(([n, o]) => ({ href: o, hrefLang: n }));
|
|
41
43
|
}
|
|
42
|
-
function
|
|
44
|
+
function No(e) {
|
|
43
45
|
return [
|
|
44
46
|
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
45
47
|
`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.entries.some((r) => r.alternates?.length) ? ' xmlns:xhtml="http://www.w3.org/1999/xhtml"' : ""}>`,
|
|
46
|
-
...e.entries.map(
|
|
48
|
+
...e.entries.map(Pr),
|
|
47
49
|
"</urlset>",
|
|
48
50
|
""
|
|
49
51
|
].join(`
|
|
50
52
|
`);
|
|
51
53
|
}
|
|
52
|
-
function
|
|
54
|
+
function Lo(e) {
|
|
53
55
|
return e;
|
|
54
56
|
}
|
|
55
|
-
function
|
|
57
|
+
function Io(e) {
|
|
56
58
|
return e;
|
|
57
59
|
}
|
|
58
|
-
function
|
|
60
|
+
function Do(e) {
|
|
59
61
|
const t = [];
|
|
60
62
|
for (const r of e.rules ?? []) {
|
|
61
|
-
for (const n of
|
|
63
|
+
for (const n of he(r.userAgent))
|
|
62
64
|
t.push(`User-agent: ${n}`);
|
|
63
|
-
for (const n of
|
|
65
|
+
for (const n of he(r.allow))
|
|
64
66
|
t.push(`Allow: ${n}`);
|
|
65
|
-
for (const n of
|
|
67
|
+
for (const n of he(r.disallow))
|
|
66
68
|
t.push(`Disallow: ${n}`);
|
|
67
69
|
t.push("");
|
|
68
70
|
}
|
|
69
71
|
e.host && t.push(`Host: ${e.host}`);
|
|
70
|
-
for (const r of
|
|
72
|
+
for (const r of he(e.sitemap))
|
|
71
73
|
t.push(`Sitemap: ${r}`);
|
|
72
74
|
return `${t.join(`
|
|
73
75
|
`).replace(/\n+$/, "")}
|
|
74
76
|
`;
|
|
75
77
|
}
|
|
76
|
-
function
|
|
77
|
-
const t = e.width ?? 1200, r = e.height ?? 630, n = e.background ?? "#101820", o = e.foreground ?? "#ffffff", i =
|
|
78
|
-
return
|
|
78
|
+
function Dr(e) {
|
|
79
|
+
const t = e.width ?? 1200, r = e.height ?? 630, n = e.background ?? "#101820", o = e.foreground ?? "#ffffff", i = Ne(e.title, 120), s = e.subtitle ? Ne(e.subtitle, 160) : void 0, a = e.brand ? Ne(e.brand, 80) : void 0;
|
|
80
|
+
return Fr(t, r), [
|
|
79
81
|
`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${r}" viewBox="0 0 ${t} ${r}" role="img" aria-label="${j(i)}">`,
|
|
80
82
|
` <rect width="100%" height="100%" fill="${j(n)}" />`,
|
|
81
|
-
a ? ` <text x="72" y="96" fill="${j(o)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="32" font-weight="700">${
|
|
82
|
-
` <text x="72" y="${s ? 300 : 340}" fill="${j(o)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="76" font-weight="800">${
|
|
83
|
-
s ? ` <text x="72" y="392" fill="${j(o)}" fill-opacity="0.78" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="38" font-weight="500">${
|
|
83
|
+
a ? ` <text x="72" y="96" fill="${j(o)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="32" font-weight="700">${ee(a)}</text>` : null,
|
|
84
|
+
` <text x="72" y="${s ? 300 : 340}" fill="${j(o)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="76" font-weight="800">${ee(i)}</text>`,
|
|
85
|
+
s ? ` <text x="72" y="392" fill="${j(o)}" fill-opacity="0.78" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="38" font-weight="500">${ee(s)}</text>` : null,
|
|
84
86
|
"</svg>"
|
|
85
|
-
].filter((
|
|
87
|
+
].filter((l) => !!l).join(`
|
|
86
88
|
`);
|
|
87
89
|
}
|
|
88
|
-
function
|
|
89
|
-
return new Response(
|
|
90
|
+
function Po(e) {
|
|
91
|
+
return new Response(Dr(e), {
|
|
90
92
|
headers: {
|
|
91
|
-
"cache-control":
|
|
93
|
+
"cache-control": Nr,
|
|
92
94
|
"content-type": "image/svg+xml; charset=utf-8"
|
|
93
95
|
}
|
|
94
96
|
});
|
|
95
97
|
}
|
|
96
|
-
function
|
|
98
|
+
function Pr(e) {
|
|
97
99
|
return [
|
|
98
100
|
" <url>",
|
|
99
|
-
` <loc>${
|
|
100
|
-
e.lastModified ? ` <lastmod>${
|
|
101
|
+
` <loc>${ee(e.url)}</loc>`,
|
|
102
|
+
e.lastModified ? ` <lastmod>${ee(Or(e.lastModified))}</lastmod>` : null,
|
|
101
103
|
e.changeFrequency ? ` <changefreq>${e.changeFrequency}</changefreq>` : null,
|
|
102
|
-
e.priority !== void 0 ? ` <priority>${
|
|
104
|
+
e.priority !== void 0 ? ` <priority>${_r(e.priority)}</priority>` : null,
|
|
103
105
|
...(e.alternates ?? []).map(
|
|
104
106
|
(t) => ` <xhtml:link rel="alternate" hreflang="${j(t.hrefLang)}" href="${j(t.href)}" />`
|
|
105
107
|
),
|
|
@@ -107,57 +109,57 @@ function Nr(e) {
|
|
|
107
109
|
].filter((t) => !!t).join(`
|
|
108
110
|
`);
|
|
109
111
|
}
|
|
110
|
-
function
|
|
112
|
+
function Or(e) {
|
|
111
113
|
return e instanceof Date ? e.toISOString() : e;
|
|
112
114
|
}
|
|
113
|
-
function
|
|
115
|
+
function _r(e) {
|
|
114
116
|
if (e < 0 || e > 1)
|
|
115
117
|
throw new Error("Sitemap entry priority must be between 0 and 1.");
|
|
116
118
|
return String(e);
|
|
117
119
|
}
|
|
118
|
-
function
|
|
120
|
+
function he(e) {
|
|
119
121
|
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
120
122
|
}
|
|
121
|
-
function
|
|
123
|
+
function ee(e) {
|
|
122
124
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
123
125
|
}
|
|
124
126
|
function j(e) {
|
|
125
|
-
return
|
|
127
|
+
return ee(e).replaceAll('"', """).replaceAll("'", "'");
|
|
126
128
|
}
|
|
127
|
-
function
|
|
129
|
+
function Ne(e, t) {
|
|
128
130
|
return e.length > t ? `${e.slice(0, t - 3)}...` : e;
|
|
129
131
|
}
|
|
130
|
-
function
|
|
132
|
+
function Fr(e, t) {
|
|
131
133
|
if (!Number.isSafeInteger(e) || e <= 0)
|
|
132
134
|
throw new Error("OG image width must be a positive integer.");
|
|
133
135
|
if (!Number.isSafeInteger(t) || t <= 0)
|
|
134
136
|
throw new Error("OG image height must be a positive integer.");
|
|
135
137
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
138
|
-
const t = e.now ?? Date.now, r = e.defaultTtl ??
|
|
138
|
+
const Ur = "24h", Br = 1e4;
|
|
139
|
+
function Oo(e = {}) {
|
|
140
|
+
const t = e.now ?? Date.now, r = e.defaultTtl ?? Ur, n = e.maximumEntries ?? Br;
|
|
139
141
|
if (!Number.isSafeInteger(n) || n <= 0)
|
|
140
142
|
throw new Error(
|
|
141
143
|
"Demiurge idempotency maximumEntries must be a positive integer."
|
|
142
144
|
);
|
|
143
|
-
const o =
|
|
145
|
+
const o = lt(r);
|
|
144
146
|
if (!Number.isFinite(o))
|
|
145
147
|
throw new Error("Demiurge idempotency defaultTtl must be finite.");
|
|
146
148
|
const i = /* @__PURE__ */ new Map();
|
|
147
149
|
return {
|
|
148
150
|
async run(s) {
|
|
149
|
-
const a =
|
|
150
|
-
|
|
151
|
+
const a = mr(s.key), l = t();
|
|
152
|
+
Hr(i, l);
|
|
151
153
|
const d = i.get(a);
|
|
152
|
-
if (d && (d.pending || d.expiresAt >
|
|
154
|
+
if (d && (d.pending || d.expiresAt > l)) {
|
|
153
155
|
const h = await d.value;
|
|
154
156
|
return {
|
|
155
157
|
key: a,
|
|
156
158
|
replayed: !0,
|
|
157
|
-
value:
|
|
159
|
+
value: ft(h)
|
|
158
160
|
};
|
|
159
161
|
}
|
|
160
|
-
if (i.size >= n &&
|
|
162
|
+
if (i.size >= n && zr(i), i.size >= n)
|
|
161
163
|
throw new Error(
|
|
162
164
|
"Demiurge idempotency store is at capacity with in-flight mutations."
|
|
163
165
|
);
|
|
@@ -169,10 +171,10 @@ function $o(e = {}) {
|
|
|
169
171
|
i.set(a, A);
|
|
170
172
|
try {
|
|
171
173
|
const h = await v;
|
|
172
|
-
return A.pending = !1, A.expiresAt = t() +
|
|
174
|
+
return A.pending = !1, A.expiresAt = t() + lt(s.ttl ?? r), {
|
|
173
175
|
key: a,
|
|
174
176
|
replayed: !1,
|
|
175
|
-
value:
|
|
177
|
+
value: ft(h)
|
|
176
178
|
};
|
|
177
179
|
} catch (h) {
|
|
178
180
|
throw i.get(a) === A && i.delete(a), h;
|
|
@@ -180,24 +182,24 @@ function $o(e = {}) {
|
|
|
180
182
|
}
|
|
181
183
|
};
|
|
182
184
|
}
|
|
183
|
-
function
|
|
185
|
+
function ft(e) {
|
|
184
186
|
return e instanceof Response ? e.clone() : e;
|
|
185
187
|
}
|
|
186
|
-
function
|
|
188
|
+
function Hr(e, t) {
|
|
187
189
|
for (const [r, n] of e)
|
|
188
190
|
!n.pending && n.expiresAt <= t && e.delete(r);
|
|
189
191
|
}
|
|
190
|
-
function
|
|
192
|
+
function zr(e) {
|
|
191
193
|
for (const [t, r] of e)
|
|
192
194
|
if (!r.pending) {
|
|
193
195
|
e.delete(t);
|
|
194
196
|
return;
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
|
-
function
|
|
199
|
+
function _o(e, t) {
|
|
198
200
|
return e.run(t);
|
|
199
201
|
}
|
|
200
|
-
function
|
|
202
|
+
function Fo(e) {
|
|
201
203
|
return typeof e == "function" ? {
|
|
202
204
|
kind: "page",
|
|
203
205
|
render: { mode: "ssr" },
|
|
@@ -210,10 +212,10 @@ function Lo(e) {
|
|
|
210
212
|
view: e.view
|
|
211
213
|
};
|
|
212
214
|
}
|
|
213
|
-
function
|
|
215
|
+
function Uo(e) {
|
|
214
216
|
return e;
|
|
215
217
|
}
|
|
216
|
-
const
|
|
218
|
+
const Bo = {
|
|
217
219
|
hmac(e) {
|
|
218
220
|
return {
|
|
219
221
|
kind: "response",
|
|
@@ -221,7 +223,7 @@ const Do = {
|
|
|
221
223
|
const r = new Uint8Array(await t.request.arrayBuffer()), n = t.request.headers.get(
|
|
222
224
|
e.header ?? "x-webhook-signature"
|
|
223
225
|
);
|
|
224
|
-
return n ? await
|
|
226
|
+
return n ? await Vr(r, n, e) ? await e.handler({
|
|
225
227
|
...t,
|
|
226
228
|
rawBody: r,
|
|
227
229
|
text: () => new TextDecoder().decode(r)
|
|
@@ -245,12 +247,12 @@ const Do = {
|
|
|
245
247
|
};
|
|
246
248
|
}
|
|
247
249
|
};
|
|
248
|
-
async function
|
|
249
|
-
const n = r.algorithm ?? "SHA-256", o = r.encoding ?? "hex", i =
|
|
250
|
+
async function Vr(e, t, r) {
|
|
251
|
+
const n = r.algorithm ?? "SHA-256", o = r.encoding ?? "hex", i = jr(
|
|
250
252
|
t,
|
|
251
253
|
n,
|
|
252
254
|
r.prefix
|
|
253
|
-
), s =
|
|
255
|
+
), s = qr(i, o);
|
|
254
256
|
if (!s)
|
|
255
257
|
return !1;
|
|
256
258
|
const a = await globalThis.crypto.subtle.importKey(
|
|
@@ -270,11 +272,11 @@ async function Ur(e, t, r) {
|
|
|
270
272
|
Uint8Array.from(e).buffer
|
|
271
273
|
);
|
|
272
274
|
}
|
|
273
|
-
function
|
|
275
|
+
function jr(e, t, r) {
|
|
274
276
|
const n = e.trim(), o = r === void 0 ? `${t.toLowerCase().replace("-", "")}=` : r;
|
|
275
277
|
return o !== !1 && n.startsWith(o) ? n.slice(o.length).trim() : n;
|
|
276
278
|
}
|
|
277
|
-
function
|
|
279
|
+
function qr(e, t) {
|
|
278
280
|
if (t === "hex")
|
|
279
281
|
return /^(?:[0-9a-f]{2})+$/i.test(e) ? Uint8Array.from(
|
|
280
282
|
e.match(/.{2}/g) ?? [],
|
|
@@ -291,19 +293,19 @@ function Hr(e, t) {
|
|
|
291
293
|
return null;
|
|
292
294
|
}
|
|
293
295
|
}
|
|
294
|
-
const
|
|
296
|
+
const Kr = /^[!#$%&'*+\-.^_`|~A-Za-z0-9]+$/, Wr = {
|
|
295
297
|
host: "__Host-",
|
|
296
298
|
none: "",
|
|
297
299
|
secure: "__Secure-"
|
|
298
|
-
},
|
|
299
|
-
function
|
|
300
|
-
return `${
|
|
300
|
+
}, ht = 4096;
|
|
301
|
+
function le(e, t = "host") {
|
|
302
|
+
return `${Wr[t]}${e}`;
|
|
301
303
|
}
|
|
302
|
-
function
|
|
303
|
-
const t = e.scope ?? "host", r =
|
|
304
|
+
function Jr(e) {
|
|
305
|
+
const t = e.scope ?? "host", r = le(e.name, t), n = [], o = (i, s) => {
|
|
304
306
|
n.push({ code: i, message: s, name: r });
|
|
305
307
|
};
|
|
306
|
-
if (
|
|
308
|
+
if (Kr.test(e.name) || o(
|
|
307
309
|
"cookie-name-invalid",
|
|
308
310
|
`Cookie name ${JSON.stringify(e.name)} contains a character that a cookie name cannot hold. Use letters, digits, or the token characters that RFC 6265 allows.`
|
|
309
311
|
), (e.name.startsWith("__Host-") || e.name.startsWith("__Secure-")) && o(
|
|
@@ -325,63 +327,63 @@ function Vr(e) {
|
|
|
325
327
|
"cookie-max-age-invalid",
|
|
326
328
|
`Cookie ${r} declares maxAge ${JSON.stringify(e.maxAge)}. Use a whole number of seconds that is zero or greater.`
|
|
327
329
|
), n.length === 0) {
|
|
328
|
-
const i = new TextEncoder().encode(
|
|
329
|
-
i >
|
|
330
|
+
const i = new TextEncoder().encode($t(e, t, r)).length;
|
|
331
|
+
i > ht && o(
|
|
330
332
|
"cookie-too-large",
|
|
331
|
-
`Cookie ${r} serializes to ${i} bytes, and a browser drops a cookie above ${
|
|
333
|
+
`Cookie ${r} serializes to ${i} bytes, and a browser drops a cookie above ${ht} bytes. Store the payload on the server and keep an identifier in the cookie.`
|
|
332
334
|
);
|
|
333
335
|
}
|
|
334
336
|
return n;
|
|
335
337
|
}
|
|
336
|
-
function
|
|
338
|
+
function Ho(e, t = "host") {
|
|
337
339
|
if (typeof document > "u")
|
|
338
340
|
return;
|
|
339
341
|
const r = typeof e == "string" ? { name: e, scope: t } : e;
|
|
340
|
-
return
|
|
341
|
-
|
|
342
|
+
return Ze(document.cookie).get(
|
|
343
|
+
le(r.name, r.scope ?? "host")
|
|
342
344
|
);
|
|
343
345
|
}
|
|
344
|
-
function
|
|
345
|
-
const t =
|
|
346
|
+
function Ae(e) {
|
|
347
|
+
const t = Jr(e);
|
|
346
348
|
if (t.length > 0)
|
|
347
349
|
throw new Error(
|
|
348
350
|
`Demiurge rejected a cookie declaration. ${t.map((n) => n.message).join(" ")}`
|
|
349
351
|
);
|
|
350
352
|
const r = e.scope ?? "host";
|
|
351
|
-
return
|
|
353
|
+
return $t(e, r, le(e.name, r));
|
|
352
354
|
}
|
|
353
|
-
function
|
|
355
|
+
function $t(e, t, r) {
|
|
354
356
|
const n = [`${r}=${encodeURIComponent(e.value)}`], o = t === "host" ? "/" : e.path ?? "/";
|
|
355
357
|
return n.push(`Path=${o}`), t !== "host" && e.domain !== void 0 && n.push(`Domain=${e.domain}`), e.expires && n.push(`Expires=${e.expires.toUTCString()}`), e.maxAge !== void 0 && n.push(`Max-Age=${e.maxAge}`), n.push(`SameSite=${e.sameSite ?? "Lax"}`), (e.httpOnly ?? !0) && n.push("HttpOnly"), (t !== "none" || (e.secure ?? !0)) && n.push("Secure"), n.join("; ");
|
|
356
358
|
}
|
|
357
|
-
const
|
|
358
|
-
function
|
|
359
|
-
const t =
|
|
360
|
-
return
|
|
359
|
+
const Gr = 10080 * 60 * 1e3, Yr = 1440 * 60 * 1e3, pt = 32;
|
|
360
|
+
function zo(e) {
|
|
361
|
+
const t = Lt(e);
|
|
362
|
+
return Nt(t, Xr(t.keys));
|
|
361
363
|
}
|
|
362
|
-
function
|
|
363
|
-
const t =
|
|
364
|
+
function Vo(e) {
|
|
365
|
+
const t = Lt(e);
|
|
364
366
|
for (const r of t.keys)
|
|
365
367
|
if (r.value.byteLength !== 32)
|
|
366
368
|
throw new Error(
|
|
367
369
|
`Demiurge encrypted cookie session key ${JSON.stringify(r.id)} must contain exactly 32 bytes for AES-256-GCM.`
|
|
368
370
|
);
|
|
369
|
-
return
|
|
371
|
+
return Nt(
|
|
370
372
|
t,
|
|
371
|
-
|
|
373
|
+
Qr(t.keys, t.randomBytes)
|
|
372
374
|
);
|
|
373
375
|
}
|
|
374
|
-
function
|
|
375
|
-
const r =
|
|
376
|
+
function Nt(e, t) {
|
|
377
|
+
const r = le(
|
|
376
378
|
e.cookie.name,
|
|
377
379
|
e.cookie.scope ?? "host"
|
|
378
380
|
);
|
|
379
381
|
return {
|
|
380
382
|
cookieName: r,
|
|
381
383
|
async open(n) {
|
|
382
|
-
const o =
|
|
383
|
-
let a = s?.record,
|
|
384
|
-
a &&
|
|
384
|
+
const o = Ze(n.headers.get("cookie") ?? "").get(r), i = e.now(), s = o ? await t.decode(o) : void 0;
|
|
385
|
+
let a = s?.record, l = !!(o && !s), d = !!(s && !s.currentKey);
|
|
386
|
+
a && tn(a, i) ? (a = void 0, l = !0, d = !1) : a && e.renewal && e.idleExpirationMs !== !1 && a.idleExpiresAt !== void 0 && a.idleExpiresAt - i <= e.idleExpirationMs / 4 && (a = {
|
|
385
387
|
...a,
|
|
386
388
|
idleExpiresAt: Math.min(
|
|
387
389
|
a.expiresAt,
|
|
@@ -395,10 +397,10 @@ function Mt(e, t) {
|
|
|
395
397
|
"Demiurge cannot change a session that does not exist. Create the session first."
|
|
396
398
|
);
|
|
397
399
|
return a;
|
|
398
|
-
}, A = (h) => (a =
|
|
400
|
+
}, A = (h) => (a = De(h), l = !1, d = !0, De(h));
|
|
399
401
|
return {
|
|
400
402
|
async commit() {
|
|
401
|
-
return
|
|
403
|
+
return l ? [rn(e.cookie)] : !a || !d ? [] : [Ae({
|
|
402
404
|
...e.cookie,
|
|
403
405
|
expires: new Date(a.expiresAt),
|
|
404
406
|
value: await t.encode(a)
|
|
@@ -409,18 +411,18 @@ function Mt(e, t) {
|
|
|
409
411
|
throw new Error(
|
|
410
412
|
"Demiurge cannot create a session when one already exists. Rotate or update the current session."
|
|
411
413
|
);
|
|
412
|
-
const E = e.now(), g =
|
|
414
|
+
const E = e.now(), g = rt(
|
|
413
415
|
"absoluteExpirationMs",
|
|
414
416
|
p.absoluteExpirationMs ?? e.absoluteExpirationMs
|
|
415
|
-
), b = p.idleExpirationMs === void 0 ? e.idleExpirationMs :
|
|
417
|
+
), b = p.idleExpirationMs === void 0 ? e.idleExpirationMs : It(p.idleExpirationMs), y = E + g;
|
|
416
418
|
return A({
|
|
417
419
|
createdAt: E,
|
|
418
|
-
data:
|
|
419
|
-
expiresAt:
|
|
420
|
-
id:
|
|
420
|
+
data: Ie(h),
|
|
421
|
+
expiresAt: y,
|
|
422
|
+
id: yt(e.randomBytes),
|
|
421
423
|
...b === !1 ? {} : {
|
|
422
424
|
idleExpiresAt: Math.min(
|
|
423
|
-
|
|
425
|
+
y,
|
|
424
426
|
E + b
|
|
425
427
|
)
|
|
426
428
|
},
|
|
@@ -428,17 +430,17 @@ function Mt(e, t) {
|
|
|
428
430
|
});
|
|
429
431
|
},
|
|
430
432
|
destroy() {
|
|
431
|
-
a = void 0,
|
|
433
|
+
a = void 0, l = !0, d = !1;
|
|
432
434
|
},
|
|
433
435
|
get() {
|
|
434
|
-
return a ?
|
|
436
|
+
return a ? De(a) : void 0;
|
|
435
437
|
},
|
|
436
438
|
rotate(h) {
|
|
437
439
|
const p = v();
|
|
438
440
|
return A({
|
|
439
441
|
...p,
|
|
440
|
-
data: h === void 0 ? p.data :
|
|
441
|
-
id:
|
|
442
|
+
data: h === void 0 ? p.data : Ie(h),
|
|
443
|
+
id: yt(e.randomBytes),
|
|
442
444
|
version: p.version + 1
|
|
443
445
|
});
|
|
444
446
|
},
|
|
@@ -446,7 +448,7 @@ function Mt(e, t) {
|
|
|
446
448
|
const p = v();
|
|
447
449
|
return A({
|
|
448
450
|
...p,
|
|
449
|
-
data:
|
|
451
|
+
data: Ie(h),
|
|
450
452
|
version: p.version + 1
|
|
451
453
|
});
|
|
452
454
|
}
|
|
@@ -454,12 +456,12 @@ function Mt(e, t) {
|
|
|
454
456
|
}
|
|
455
457
|
};
|
|
456
458
|
}
|
|
457
|
-
function
|
|
458
|
-
const t =
|
|
459
|
+
function Lt(e) {
|
|
460
|
+
const t = Zr(e.keys), r = rt(
|
|
459
461
|
"absoluteExpirationMs",
|
|
460
|
-
e.absoluteExpirationMs ??
|
|
461
|
-
), n =
|
|
462
|
-
e.idleExpirationMs ??
|
|
462
|
+
e.absoluteExpirationMs ?? Gr
|
|
463
|
+
), n = It(
|
|
464
|
+
e.idleExpirationMs ?? Yr
|
|
463
465
|
);
|
|
464
466
|
return {
|
|
465
467
|
absoluteExpirationMs: r,
|
|
@@ -467,11 +469,11 @@ function Ct(e) {
|
|
|
467
469
|
idleExpirationMs: n,
|
|
468
470
|
keys: t,
|
|
469
471
|
now: e.now ?? Date.now,
|
|
470
|
-
randomBytes: e.randomBytes ??
|
|
472
|
+
randomBytes: e.randomBytes ?? nn,
|
|
471
473
|
renewal: e.renewal ?? !0
|
|
472
474
|
};
|
|
473
475
|
}
|
|
474
|
-
function
|
|
476
|
+
function Zr(e) {
|
|
475
477
|
if (e.length === 0)
|
|
476
478
|
throw new Error(
|
|
477
479
|
"Demiurge cookie sessions require at least one key. Put the current key first."
|
|
@@ -494,28 +496,28 @@ function Wr(e) {
|
|
|
494
496
|
}
|
|
495
497
|
return [...e];
|
|
496
498
|
}
|
|
497
|
-
function
|
|
499
|
+
function rt(e, t) {
|
|
498
500
|
if (!Number.isSafeInteger(t) || t <= 0)
|
|
499
501
|
throw new Error(
|
|
500
502
|
`Demiurge cookie session ${e} must be a positive whole number of milliseconds.`
|
|
501
503
|
);
|
|
502
504
|
return t;
|
|
503
505
|
}
|
|
504
|
-
function
|
|
505
|
-
return e === !1 ? !1 :
|
|
506
|
+
function It(e) {
|
|
507
|
+
return e === !1 ? !1 : rt("idleExpirationMs", e);
|
|
506
508
|
}
|
|
507
|
-
function
|
|
509
|
+
function Xr(e) {
|
|
508
510
|
return {
|
|
509
511
|
async decode(t) {
|
|
510
512
|
const r = t.split(".");
|
|
511
513
|
if (r.length !== 4 || r[0] !== "s1")
|
|
512
514
|
return;
|
|
513
|
-
const n = e.findIndex((v) => v.id === r[1]), o = e[n], i =
|
|
515
|
+
const n = e.findIndex((v) => v.id === r[1]), o = e[n], i = Ee(r[2]), s = Ee(r[3]);
|
|
514
516
|
if (!o || !i || !s)
|
|
515
517
|
return;
|
|
516
518
|
const a = await crypto.subtle.importKey(
|
|
517
519
|
"raw",
|
|
518
|
-
|
|
520
|
+
L(o.value),
|
|
519
521
|
{ hash: "SHA-256", name: "HMAC" },
|
|
520
522
|
!1,
|
|
521
523
|
["verify"]
|
|
@@ -523,47 +525,47 @@ function Jr(e) {
|
|
|
523
525
|
if (!await crypto.subtle.verify(
|
|
524
526
|
"HMAC",
|
|
525
527
|
a,
|
|
526
|
-
|
|
527
|
-
|
|
528
|
+
L(s),
|
|
529
|
+
L(te(`s1.${o.id}.${r[2]}`))
|
|
528
530
|
))
|
|
529
531
|
return;
|
|
530
|
-
const d =
|
|
532
|
+
const d = Dt(i);
|
|
531
533
|
return d ? { currentKey: n === 0, record: d } : void 0;
|
|
532
534
|
},
|
|
533
535
|
async encode(t) {
|
|
534
|
-
const r = e[0], n =
|
|
536
|
+
const r = e[0], n = ue(te(JSON.stringify(t))), o = `s1.${r.id}.${n}`, i = await crypto.subtle.importKey(
|
|
535
537
|
"raw",
|
|
536
|
-
|
|
538
|
+
L(r.value),
|
|
537
539
|
{ hash: "SHA-256", name: "HMAC" },
|
|
538
540
|
!1,
|
|
539
541
|
["sign"]
|
|
540
542
|
), s = await crypto.subtle.sign(
|
|
541
543
|
"HMAC",
|
|
542
544
|
i,
|
|
543
|
-
|
|
545
|
+
L(te(o))
|
|
544
546
|
);
|
|
545
|
-
return `${o}.${
|
|
547
|
+
return `${o}.${ue(new Uint8Array(s))}`;
|
|
546
548
|
}
|
|
547
549
|
};
|
|
548
550
|
}
|
|
549
|
-
function
|
|
551
|
+
function Qr(e, t) {
|
|
550
552
|
return {
|
|
551
553
|
async decode(r) {
|
|
552
554
|
const n = r.split(".");
|
|
553
555
|
if (n.length !== 4 || n[0] !== "e1")
|
|
554
556
|
return;
|
|
555
|
-
const o = e.findIndex((
|
|
557
|
+
const o = e.findIndex((l) => l.id === n[1]), i = e[o], s = Ee(n[2]), a = Ee(n[3]);
|
|
556
558
|
if (!(!i || s?.byteLength !== 12 || !a))
|
|
557
559
|
try {
|
|
558
|
-
const
|
|
560
|
+
const l = await mt(i), d = await crypto.subtle.decrypt(
|
|
559
561
|
{
|
|
560
|
-
additionalData:
|
|
561
|
-
iv:
|
|
562
|
+
additionalData: L(te(`e1.${i.id}`)),
|
|
563
|
+
iv: L(s),
|
|
562
564
|
name: "AES-GCM"
|
|
563
565
|
},
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
), v =
|
|
566
|
+
l,
|
|
567
|
+
L(a)
|
|
568
|
+
), v = Dt(new Uint8Array(d));
|
|
567
569
|
return v ? { currentKey: o === 0, record: v } : void 0;
|
|
568
570
|
} catch {
|
|
569
571
|
return;
|
|
@@ -575,90 +577,90 @@ function Gr(e, t) {
|
|
|
575
577
|
throw new Error(
|
|
576
578
|
"Demiurge cookie session randomBytes returned an incorrect byte count."
|
|
577
579
|
);
|
|
578
|
-
const i = await
|
|
580
|
+
const i = await mt(n), s = await crypto.subtle.encrypt(
|
|
579
581
|
{
|
|
580
|
-
additionalData:
|
|
581
|
-
iv:
|
|
582
|
+
additionalData: L(te(`e1.${n.id}`)),
|
|
583
|
+
iv: L(o),
|
|
582
584
|
name: "AES-GCM"
|
|
583
585
|
},
|
|
584
586
|
i,
|
|
585
|
-
|
|
587
|
+
L(te(JSON.stringify(r)))
|
|
586
588
|
);
|
|
587
|
-
return `e1.${n.id}.${
|
|
589
|
+
return `e1.${n.id}.${ue(o)}.${ue(new Uint8Array(s))}`;
|
|
588
590
|
}
|
|
589
591
|
};
|
|
590
592
|
}
|
|
591
|
-
async function
|
|
593
|
+
async function mt(e) {
|
|
592
594
|
return await crypto.subtle.importKey(
|
|
593
595
|
"raw",
|
|
594
|
-
|
|
596
|
+
L(e.value),
|
|
595
597
|
"AES-GCM",
|
|
596
598
|
!1,
|
|
597
599
|
["decrypt", "encrypt"]
|
|
598
600
|
);
|
|
599
601
|
}
|
|
600
|
-
function
|
|
602
|
+
function Dt(e) {
|
|
601
603
|
try {
|
|
602
604
|
const t = JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(e));
|
|
603
|
-
return !
|
|
605
|
+
return !re(t) || !Le(t.createdAt) || !Le(t.expiresAt) || typeof t.id != "string" || !/^[A-Za-z0-9_-]{43}$/.test(t.id) || !en(t.version) || t.idleExpiresAt !== void 0 && !Le(t.idleExpiresAt) || !Se(t.data) ? void 0 : t;
|
|
604
606
|
} catch {
|
|
605
607
|
return;
|
|
606
608
|
}
|
|
607
609
|
}
|
|
608
|
-
function
|
|
610
|
+
function Le(e) {
|
|
609
611
|
return typeof e == "number" && Number.isSafeInteger(e) && e >= 0;
|
|
610
612
|
}
|
|
611
|
-
function
|
|
613
|
+
function en(e) {
|
|
612
614
|
return typeof e == "number" && Number.isSafeInteger(e) && e >= 0;
|
|
613
615
|
}
|
|
614
|
-
function
|
|
615
|
-
return e === null || typeof e == "boolean" || typeof e == "string" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(
|
|
616
|
+
function Se(e) {
|
|
617
|
+
return e === null || typeof e == "boolean" || typeof e == "string" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(Se) : re(e) && Object.values(e).every(Se);
|
|
616
618
|
}
|
|
617
|
-
function
|
|
619
|
+
function tn(e, t) {
|
|
618
620
|
return e.expiresAt <= t || e.idleExpiresAt !== void 0 && e.idleExpiresAt <= t;
|
|
619
621
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
622
|
+
function rn(e) {
|
|
623
|
+
return Ae({
|
|
622
624
|
...e,
|
|
623
625
|
expires: /* @__PURE__ */ new Date(0),
|
|
624
626
|
maxAge: 0,
|
|
625
627
|
value: ""
|
|
626
628
|
});
|
|
627
629
|
}
|
|
628
|
-
function
|
|
629
|
-
const t = e(
|
|
630
|
-
if (t.byteLength !==
|
|
630
|
+
function yt(e) {
|
|
631
|
+
const t = e(pt);
|
|
632
|
+
if (t.byteLength !== pt)
|
|
631
633
|
throw new Error(
|
|
632
634
|
"Demiurge cookie session randomBytes returned an incorrect byte count."
|
|
633
635
|
);
|
|
634
|
-
return
|
|
636
|
+
return ue(t);
|
|
635
637
|
}
|
|
636
|
-
function
|
|
638
|
+
function nn(e) {
|
|
637
639
|
return crypto.getRandomValues(new Uint8Array(e));
|
|
638
640
|
}
|
|
639
|
-
function
|
|
640
|
-
if (!
|
|
641
|
+
function Ie(e) {
|
|
642
|
+
if (!Se(e))
|
|
641
643
|
throw new Error(
|
|
642
644
|
"Demiurge session data must contain only finite JSON values."
|
|
643
645
|
);
|
|
644
646
|
return structuredClone(e);
|
|
645
647
|
}
|
|
646
|
-
function
|
|
648
|
+
function De(e) {
|
|
647
649
|
return structuredClone(e);
|
|
648
650
|
}
|
|
649
|
-
function
|
|
651
|
+
function te(e) {
|
|
650
652
|
return new TextEncoder().encode(e);
|
|
651
653
|
}
|
|
652
|
-
function
|
|
654
|
+
function L(e) {
|
|
653
655
|
return Uint8Array.from(e).buffer;
|
|
654
656
|
}
|
|
655
|
-
function
|
|
657
|
+
function ue(e) {
|
|
656
658
|
let t = "";
|
|
657
659
|
for (const r of e)
|
|
658
660
|
t += String.fromCharCode(r);
|
|
659
661
|
return btoa(t).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
|
|
660
662
|
}
|
|
661
|
-
function
|
|
663
|
+
function Ee(e) {
|
|
662
664
|
if (/^[A-Za-z0-9_-]+$/.test(e))
|
|
663
665
|
try {
|
|
664
666
|
const t = "=".repeat((4 - e.length % 4) % 4), r = atob(e.replaceAll("-", "+").replaceAll("_", "/") + t);
|
|
@@ -667,34 +669,34 @@ function be(e) {
|
|
|
667
669
|
return;
|
|
668
670
|
}
|
|
669
671
|
}
|
|
670
|
-
const
|
|
671
|
-
class
|
|
672
|
+
const on = 10080 * 60 * 1e3, an = 1440 * 60 * 1e3;
|
|
673
|
+
class sn extends Error {
|
|
672
674
|
constructor(t) {
|
|
673
675
|
super(
|
|
674
676
|
`Demiurge session ${t} conflicted with another request. Load the current session before another lifecycle operation.`
|
|
675
677
|
), this.name = "SessionStoreConflictError";
|
|
676
678
|
}
|
|
677
679
|
}
|
|
678
|
-
class
|
|
680
|
+
class gt extends Error {
|
|
679
681
|
constructor(t) {
|
|
680
682
|
super(
|
|
681
683
|
`Demiurge session ${t} failed because the session store is unavailable.`
|
|
682
684
|
), this.name = "SessionStoreUnavailableError";
|
|
683
685
|
}
|
|
684
686
|
}
|
|
685
|
-
function
|
|
686
|
-
const t =
|
|
687
|
+
function jo(e) {
|
|
688
|
+
const t = cn(e), r = le(
|
|
687
689
|
t.cookie.name,
|
|
688
690
|
t.cookie.scope ?? "host"
|
|
689
691
|
);
|
|
690
692
|
return {
|
|
691
693
|
cookieName: r,
|
|
692
694
|
async open(n) {
|
|
693
|
-
const o =
|
|
694
|
-
let a = i ? await t.store.read(i.id, s) : void 0,
|
|
695
|
+
const o = Ze(n.headers.get("cookie") ?? "").get(r), i = o ? await dn(o, t.keys) : void 0, s = t.now();
|
|
696
|
+
let a = i ? await t.store.read(i.id, s) : void 0, l = !!(o && (!i || !a)), d = !!(a && i && !i.currentKey);
|
|
695
697
|
if (a && t.renewal && t.idleExpirationMs !== !1 && a.idleExpiresAt !== void 0 && a.idleExpiresAt - s <= t.idleExpirationMs / 4) {
|
|
696
698
|
const h = await t.store.update({
|
|
697
|
-
...
|
|
699
|
+
...Pe(a),
|
|
698
700
|
idleExpiresAt: Math.min(
|
|
699
701
|
a.expiresAt,
|
|
700
702
|
s + t.idleExpirationMs
|
|
@@ -703,9 +705,9 @@ function Fo(e) {
|
|
|
703
705
|
if (h.status === "stored")
|
|
704
706
|
a = h.record, d = !0;
|
|
705
707
|
else if (h.status === "conflict")
|
|
706
|
-
a = await t.store.read(a.id, s),
|
|
708
|
+
a = await t.store.read(a.id, s), l = !a;
|
|
707
709
|
else
|
|
708
|
-
throw new
|
|
710
|
+
throw new gt("renewal");
|
|
709
711
|
}
|
|
710
712
|
const v = () => {
|
|
711
713
|
if (!a)
|
|
@@ -715,17 +717,17 @@ function Fo(e) {
|
|
|
715
717
|
return a;
|
|
716
718
|
}, A = (h, p) => {
|
|
717
719
|
if (h.status === "conflict")
|
|
718
|
-
throw new
|
|
720
|
+
throw new sn(p);
|
|
719
721
|
if (h.status === "unavailable")
|
|
720
|
-
throw new
|
|
721
|
-
return a =
|
|
722
|
+
throw new gt(p);
|
|
723
|
+
return a = _e(h.record), l = !1, d = !0, _e(h.record);
|
|
722
724
|
};
|
|
723
725
|
return {
|
|
724
726
|
async commit() {
|
|
725
|
-
return
|
|
727
|
+
return l ? [fn(t.cookie)] : !a || !d ? [] : [Ae({
|
|
726
728
|
...t.cookie,
|
|
727
729
|
expires: new Date(a.expiresAt),
|
|
728
|
-
value: await
|
|
730
|
+
value: await ln(a.id, t.keys[0])
|
|
729
731
|
})];
|
|
730
732
|
},
|
|
731
733
|
async create(h, p = {}) {
|
|
@@ -733,17 +735,17 @@ function Fo(e) {
|
|
|
733
735
|
throw new Error(
|
|
734
736
|
"Demiurge cannot create a session when one already exists. Rotate or update the current session."
|
|
735
737
|
);
|
|
736
|
-
const E = t.now(), g =
|
|
738
|
+
const E = t.now(), g = nt(
|
|
737
739
|
"absoluteExpirationMs",
|
|
738
740
|
p.absoluteExpirationMs ?? t.absoluteExpirationMs
|
|
739
|
-
), b = p.idleExpirationMs === void 0 ? t.idleExpirationMs :
|
|
741
|
+
), b = p.idleExpirationMs === void 0 ? t.idleExpirationMs : Pt(p.idleExpirationMs), y = E + g, T = {
|
|
740
742
|
createdAt: E,
|
|
741
|
-
data:
|
|
742
|
-
expiresAt:
|
|
743
|
-
id:
|
|
743
|
+
data: Oe(h),
|
|
744
|
+
expiresAt: y,
|
|
745
|
+
id: wt(t.randomBytes),
|
|
744
746
|
...b === !1 ? {} : {
|
|
745
747
|
idleExpiresAt: Math.min(
|
|
746
|
-
|
|
748
|
+
y,
|
|
747
749
|
E + b
|
|
748
750
|
)
|
|
749
751
|
}
|
|
@@ -751,16 +753,16 @@ function Fo(e) {
|
|
|
751
753
|
return A(await t.store.create(T), "creation");
|
|
752
754
|
},
|
|
753
755
|
async destroy() {
|
|
754
|
-
a && await t.store.destroy(a.id), a = void 0,
|
|
756
|
+
a && await t.store.destroy(a.id), a = void 0, l = !0, d = !1;
|
|
755
757
|
},
|
|
756
758
|
get() {
|
|
757
|
-
return a ?
|
|
759
|
+
return a ? _e(a) : void 0;
|
|
758
760
|
},
|
|
759
761
|
async rotate(h) {
|
|
760
762
|
const p = v(), E = {
|
|
761
|
-
...
|
|
762
|
-
data: h === void 0 ? p.data :
|
|
763
|
-
id:
|
|
763
|
+
...Pe(p),
|
|
764
|
+
data: h === void 0 ? p.data : Oe(h),
|
|
765
|
+
id: wt(t.randomBytes)
|
|
764
766
|
};
|
|
765
767
|
return A(
|
|
766
768
|
await t.store.rotate(p.id, E, p.version),
|
|
@@ -771,8 +773,8 @@ function Fo(e) {
|
|
|
771
773
|
const p = v();
|
|
772
774
|
return A(
|
|
773
775
|
await t.store.update({
|
|
774
|
-
...
|
|
775
|
-
data:
|
|
776
|
+
...Pe(p),
|
|
777
|
+
data: Oe(h)
|
|
776
778
|
}, p.version),
|
|
777
779
|
"update"
|
|
778
780
|
);
|
|
@@ -781,29 +783,29 @@ function Fo(e) {
|
|
|
781
783
|
}
|
|
782
784
|
};
|
|
783
785
|
}
|
|
784
|
-
function
|
|
786
|
+
function cn(e) {
|
|
785
787
|
if (!e.store || typeof e.store.read != "function")
|
|
786
788
|
throw new Error(
|
|
787
789
|
"Demiurge session manager requires a SessionStore implementation."
|
|
788
790
|
);
|
|
789
|
-
const t =
|
|
791
|
+
const t = un(e.keys);
|
|
790
792
|
return {
|
|
791
|
-
absoluteExpirationMs:
|
|
793
|
+
absoluteExpirationMs: nt(
|
|
792
794
|
"absoluteExpirationMs",
|
|
793
|
-
e.absoluteExpirationMs ??
|
|
795
|
+
e.absoluteExpirationMs ?? on
|
|
794
796
|
),
|
|
795
797
|
cookie: { ...e.cookie, name: e.cookie?.name ?? "session" },
|
|
796
|
-
idleExpirationMs:
|
|
797
|
-
e.idleExpirationMs ??
|
|
798
|
+
idleExpirationMs: Pt(
|
|
799
|
+
e.idleExpirationMs ?? an
|
|
798
800
|
),
|
|
799
801
|
keys: t,
|
|
800
802
|
now: e.now ?? Date.now,
|
|
801
|
-
randomBytes: e.randomBytes ??
|
|
803
|
+
randomBytes: e.randomBytes ?? hn,
|
|
802
804
|
renewal: e.renewal ?? !0,
|
|
803
805
|
store: e.store
|
|
804
806
|
};
|
|
805
807
|
}
|
|
806
|
-
function
|
|
808
|
+
function un(e) {
|
|
807
809
|
if (e.length === 0)
|
|
808
810
|
throw new Error(
|
|
809
811
|
"Demiurge session manager requires at least one key. Put the current key first."
|
|
@@ -822,30 +824,30 @@ function on(e) {
|
|
|
822
824
|
}
|
|
823
825
|
return [...e];
|
|
824
826
|
}
|
|
825
|
-
async function
|
|
827
|
+
async function ln(e, t) {
|
|
826
828
|
const r = `i1.${t.id}.${e}`, n = await crypto.subtle.importKey(
|
|
827
829
|
"raw",
|
|
828
|
-
|
|
830
|
+
ae(t.value),
|
|
829
831
|
{ hash: "SHA-256", name: "HMAC" },
|
|
830
832
|
!1,
|
|
831
833
|
["sign"]
|
|
832
834
|
), o = await crypto.subtle.sign(
|
|
833
835
|
"HMAC",
|
|
834
836
|
n,
|
|
835
|
-
|
|
837
|
+
ae(new TextEncoder().encode(r))
|
|
836
838
|
);
|
|
837
|
-
return `${r}.${
|
|
839
|
+
return `${r}.${Ot(new Uint8Array(o))}`;
|
|
838
840
|
}
|
|
839
|
-
async function
|
|
841
|
+
async function dn(e, t) {
|
|
840
842
|
const r = e.split(".");
|
|
841
843
|
if (r.length !== 4 || r[0] !== "i1" || !/^[A-Za-z0-9_-]{43}$/.test(r[2]))
|
|
842
844
|
return;
|
|
843
|
-
const n = t.findIndex((
|
|
845
|
+
const n = t.findIndex((l) => l.id === r[1]), o = t[n], i = pn(r[3]);
|
|
844
846
|
if (!o || !i)
|
|
845
847
|
return;
|
|
846
848
|
const s = await crypto.subtle.importKey(
|
|
847
849
|
"raw",
|
|
848
|
-
|
|
850
|
+
ae(o.value),
|
|
849
851
|
{ hash: "SHA-256", name: "HMAC" },
|
|
850
852
|
!1,
|
|
851
853
|
["verify"]
|
|
@@ -853,63 +855,63 @@ async function sn(e, t) {
|
|
|
853
855
|
return await crypto.subtle.verify(
|
|
854
856
|
"HMAC",
|
|
855
857
|
s,
|
|
856
|
-
|
|
857
|
-
|
|
858
|
+
ae(i),
|
|
859
|
+
ae(new TextEncoder().encode(r.slice(0, 3).join(".")))
|
|
858
860
|
) ? { currentKey: n === 0, id: r[2] } : void 0;
|
|
859
861
|
}
|
|
860
|
-
function
|
|
862
|
+
function Pe(e) {
|
|
861
863
|
const { version: t, ...r } = e;
|
|
862
864
|
return r;
|
|
863
865
|
}
|
|
864
|
-
function
|
|
865
|
-
return
|
|
866
|
+
function fn(e) {
|
|
867
|
+
return Ae({
|
|
866
868
|
...e,
|
|
867
869
|
expires: /* @__PURE__ */ new Date(0),
|
|
868
870
|
maxAge: 0,
|
|
869
871
|
value: ""
|
|
870
872
|
});
|
|
871
873
|
}
|
|
872
|
-
function
|
|
874
|
+
function nt(e, t) {
|
|
873
875
|
if (!Number.isSafeInteger(t) || t <= 0)
|
|
874
876
|
throw new Error(
|
|
875
877
|
`Demiurge session manager ${e} must be a positive whole number of milliseconds.`
|
|
876
878
|
);
|
|
877
879
|
return t;
|
|
878
880
|
}
|
|
879
|
-
function
|
|
880
|
-
return e === !1 ? !1 :
|
|
881
|
+
function Pt(e) {
|
|
882
|
+
return e === !1 ? !1 : nt("idleExpirationMs", e);
|
|
881
883
|
}
|
|
882
|
-
function
|
|
884
|
+
function wt(e) {
|
|
883
885
|
const t = e(32);
|
|
884
886
|
if (t.byteLength !== 32)
|
|
885
887
|
throw new Error(
|
|
886
888
|
"Demiurge session manager randomBytes returned an incorrect byte count."
|
|
887
889
|
);
|
|
888
|
-
return
|
|
890
|
+
return Ot(t);
|
|
889
891
|
}
|
|
890
|
-
function
|
|
892
|
+
function hn(e) {
|
|
891
893
|
return crypto.getRandomValues(new Uint8Array(e));
|
|
892
894
|
}
|
|
893
|
-
function
|
|
894
|
-
if (!
|
|
895
|
+
function Oe(e) {
|
|
896
|
+
if (!Ve(e))
|
|
895
897
|
throw new Error(
|
|
896
898
|
"Demiurge session data must contain only finite JSON values."
|
|
897
899
|
);
|
|
898
900
|
return structuredClone(e);
|
|
899
901
|
}
|
|
900
|
-
function
|
|
901
|
-
return e === null || typeof e == "boolean" || typeof e == "string" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(
|
|
902
|
+
function Ve(e) {
|
|
903
|
+
return e === null || typeof e == "boolean" || typeof e == "string" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(Ve) : typeof e == "object" && e !== null && Object.values(e).every(Ve);
|
|
902
904
|
}
|
|
903
|
-
function
|
|
905
|
+
function _e(e) {
|
|
904
906
|
return structuredClone(e);
|
|
905
907
|
}
|
|
906
|
-
function
|
|
908
|
+
function Ot(e) {
|
|
907
909
|
let t = "";
|
|
908
910
|
for (const r of e)
|
|
909
911
|
t += String.fromCharCode(r);
|
|
910
912
|
return btoa(t).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
|
|
911
913
|
}
|
|
912
|
-
function
|
|
914
|
+
function pn(e) {
|
|
913
915
|
if (/^[A-Za-z0-9_-]+$/.test(e))
|
|
914
916
|
try {
|
|
915
917
|
const t = "=".repeat((4 - e.length % 4) % 4), r = atob(e.replaceAll("-", "+").replaceAll("_", "/") + t);
|
|
@@ -918,10 +920,10 @@ function ln(e) {
|
|
|
918
920
|
return;
|
|
919
921
|
}
|
|
920
922
|
}
|
|
921
|
-
function
|
|
923
|
+
function ae(e) {
|
|
922
924
|
return Uint8Array.from(e).buffer;
|
|
923
925
|
}
|
|
924
|
-
function
|
|
926
|
+
function qo(e = {}) {
|
|
925
927
|
return async function(r) {
|
|
926
928
|
if (r.method.toUpperCase() !== "POST")
|
|
927
929
|
return new Response(null, {
|
|
@@ -930,22 +932,22 @@ function Uo(e = {}) {
|
|
|
930
932
|
},
|
|
931
933
|
status: 405
|
|
932
934
|
});
|
|
933
|
-
const n =
|
|
935
|
+
const n = yn(r);
|
|
934
936
|
if (n)
|
|
935
937
|
return n;
|
|
936
|
-
const o =
|
|
938
|
+
const o = gn(e, r);
|
|
937
939
|
if (o)
|
|
938
940
|
return o;
|
|
939
|
-
e.maxBodySize !== void 0 && (r =
|
|
941
|
+
e.maxBodySize !== void 0 && (r = yr({ maxBodySize: e.maxBodySize }, r));
|
|
940
942
|
let i;
|
|
941
943
|
try {
|
|
942
944
|
i = await r.json();
|
|
943
945
|
} catch (a) {
|
|
944
|
-
return a instanceof
|
|
946
|
+
return a instanceof gr ? new Response("Security report body too large.", { status: 413 }) : new Response("Invalid security report JSON.", {
|
|
945
947
|
status: 400
|
|
946
948
|
});
|
|
947
949
|
}
|
|
948
|
-
const s =
|
|
950
|
+
const s = wn(i);
|
|
949
951
|
for (let a = 0; a < s.length; a += 1)
|
|
950
952
|
await e.onReport?.(s[a], {
|
|
951
953
|
index: a,
|
|
@@ -956,20 +958,20 @@ function Uo(e = {}) {
|
|
|
956
958
|
});
|
|
957
959
|
};
|
|
958
960
|
}
|
|
959
|
-
const
|
|
961
|
+
const mn = /* @__PURE__ */ new Set([
|
|
960
962
|
"application/csp-report",
|
|
961
963
|
"application/reports+json"
|
|
962
964
|
]);
|
|
963
|
-
function
|
|
965
|
+
function yn(e) {
|
|
964
966
|
const t = e.headers.get("content-type");
|
|
965
967
|
if (!t)
|
|
966
968
|
return null;
|
|
967
969
|
const r = t.split(";", 1)[0]?.trim().toLowerCase();
|
|
968
|
-
return r &&
|
|
970
|
+
return r && mn.has(r) ? null : new Response("Unsupported security report Content-Type.", {
|
|
969
971
|
status: 415
|
|
970
972
|
});
|
|
971
973
|
}
|
|
972
|
-
function
|
|
974
|
+
function gn(e, t) {
|
|
973
975
|
if (e.maxBodySize === void 0)
|
|
974
976
|
return null;
|
|
975
977
|
const r = t.headers.get("content-length");
|
|
@@ -980,29 +982,29 @@ function hn(e, t) {
|
|
|
980
982
|
status: 400
|
|
981
983
|
});
|
|
982
984
|
const n = Number(r);
|
|
983
|
-
return Number.isSafeInteger(n) ? n >
|
|
985
|
+
return Number.isSafeInteger(n) ? n > Xe(e.maxBodySize) ? new Response("Security report body too large.", {
|
|
984
986
|
status: 413
|
|
985
987
|
}) : null : new Response("Invalid Content-Length.", {
|
|
986
988
|
status: 400
|
|
987
989
|
});
|
|
988
990
|
}
|
|
989
|
-
function
|
|
990
|
-
return Array.isArray(e) ? e :
|
|
991
|
+
function wn(e) {
|
|
992
|
+
return Array.isArray(e) ? e : Qe(e) && "csp-report" in e ? [e["csp-report"]] : [e];
|
|
991
993
|
}
|
|
992
|
-
function
|
|
994
|
+
function Ko(e, t) {
|
|
993
995
|
const r = {}, n = [];
|
|
994
996
|
let o = 0;
|
|
995
997
|
for (const [i, s] of Object.entries(t.files)) {
|
|
996
|
-
const a = e.getAll(i).filter(
|
|
998
|
+
const a = e.getAll(i).filter(Sn);
|
|
997
999
|
r[i] = a, s.required && a.length === 0 && n.push({
|
|
998
1000
|
code: "file-missing",
|
|
999
1001
|
field: i,
|
|
1000
1002
|
message: `Upload field ${i} requires at least one file.`
|
|
1001
1003
|
});
|
|
1002
|
-
for (const
|
|
1003
|
-
o +=
|
|
1004
|
+
for (const l of a)
|
|
1005
|
+
o += l.size, vn(i, l, s, n);
|
|
1004
1006
|
}
|
|
1005
|
-
return t.maxTotalSize !== void 0 && o >
|
|
1007
|
+
return t.maxTotalSize !== void 0 && o > Xe(t.maxTotalSize) && n.push({
|
|
1006
1008
|
code: "total-upload-too-large",
|
|
1007
1009
|
field: "*",
|
|
1008
1010
|
message: `Uploaded files exceed the maximum total size of ${t.maxTotalSize}.`
|
|
@@ -1013,24 +1015,24 @@ function Bo(e, t) {
|
|
|
1013
1015
|
totalSize: o
|
|
1014
1016
|
};
|
|
1015
1017
|
}
|
|
1016
|
-
function
|
|
1017
|
-
r.maxSize !== void 0 && t.size >
|
|
1018
|
+
function vn(e, t, r, n) {
|
|
1019
|
+
r.maxSize !== void 0 && t.size > Xe(r.maxSize) && n.push({
|
|
1018
1020
|
code: "file-too-large",
|
|
1019
1021
|
field: e,
|
|
1020
1022
|
message: `Upload field ${e} contains ${t.name || "a file"} larger than ${r.maxSize}.`
|
|
1021
|
-
}), r.types?.length && !
|
|
1023
|
+
}), r.types?.length && !bn(t.type, r.types) && n.push({
|
|
1022
1024
|
code: "file-type-not-allowed",
|
|
1023
1025
|
field: e,
|
|
1024
1026
|
message: `Upload field ${e} contains ${t.name || "a file"} with disallowed type ${t.type || "unknown"}.`
|
|
1025
1027
|
});
|
|
1026
1028
|
}
|
|
1027
|
-
function
|
|
1029
|
+
function bn(e, t) {
|
|
1028
1030
|
return t.some((r) => r.endsWith("/*") ? e.startsWith(r.slice(0, -1)) : e === r);
|
|
1029
1031
|
}
|
|
1030
|
-
function
|
|
1032
|
+
function Sn(e) {
|
|
1031
1033
|
return e instanceof File;
|
|
1032
1034
|
}
|
|
1033
|
-
function
|
|
1035
|
+
function En(e, t) {
|
|
1034
1036
|
const r = t.headers.get("origin");
|
|
1035
1037
|
if (!r)
|
|
1036
1038
|
return {
|
|
@@ -1039,7 +1041,7 @@ function wn(e, t) {
|
|
|
1039
1041
|
origin: r,
|
|
1040
1042
|
reason: e.allowMissingOrigin ? void 0 : "missing-origin"
|
|
1041
1043
|
};
|
|
1042
|
-
const n =
|
|
1044
|
+
const n = _t(r);
|
|
1043
1045
|
if (!n)
|
|
1044
1046
|
return {
|
|
1045
1047
|
allowed: !1,
|
|
@@ -1047,7 +1049,7 @@ function wn(e, t) {
|
|
|
1047
1049
|
origin: r,
|
|
1048
1050
|
reason: "invalid-origin"
|
|
1049
1051
|
};
|
|
1050
|
-
const o =
|
|
1052
|
+
const o = An(e, n, t);
|
|
1051
1053
|
return {
|
|
1052
1054
|
allowed: o,
|
|
1053
1055
|
expected: e.origins,
|
|
@@ -1055,20 +1057,20 @@ function wn(e, t) {
|
|
|
1055
1057
|
reason: o ? void 0 : "origin-not-allowed"
|
|
1056
1058
|
};
|
|
1057
1059
|
}
|
|
1058
|
-
function
|
|
1059
|
-
return !e ||
|
|
1060
|
+
function Wo(e, t) {
|
|
1061
|
+
return !e || En(e, t).allowed ? null : new Response("WebSocket origin not allowed.", {
|
|
1060
1062
|
status: 403
|
|
1061
1063
|
});
|
|
1062
1064
|
}
|
|
1063
|
-
function
|
|
1065
|
+
function An(e, t, r) {
|
|
1064
1066
|
return e.origins === "same-origin" ? t === new URL(r.url).origin : e.origins.some(
|
|
1065
|
-
(n) =>
|
|
1067
|
+
(n) => xn(n, t)
|
|
1066
1068
|
);
|
|
1067
1069
|
}
|
|
1068
|
-
function
|
|
1069
|
-
return e === "null" ? t === "null" :
|
|
1070
|
+
function xn(e, t) {
|
|
1071
|
+
return e === "null" ? t === "null" : _t(e) === t;
|
|
1070
1072
|
}
|
|
1071
|
-
function
|
|
1073
|
+
function _t(e) {
|
|
1072
1074
|
if (e === "null")
|
|
1073
1075
|
return e;
|
|
1074
1076
|
try {
|
|
@@ -1086,27 +1088,27 @@ function Dt(e) {
|
|
|
1086
1088
|
return null;
|
|
1087
1089
|
}
|
|
1088
1090
|
}
|
|
1089
|
-
const
|
|
1091
|
+
const Ft = Ge({
|
|
1090
1092
|
register: () => () => {
|
|
1091
1093
|
},
|
|
1092
1094
|
focus: () => !1
|
|
1093
1095
|
});
|
|
1094
|
-
function
|
|
1095
|
-
const e =
|
|
1096
|
+
function kn() {
|
|
1097
|
+
const e = Ye(Ft), t = k(void 0), r = Rt((n) => {
|
|
1096
1098
|
t.current?.(), t.current = void 0, n && (t.current = e.register(n));
|
|
1097
1099
|
}, [e]);
|
|
1098
|
-
return
|
|
1100
|
+
return ce(() => ({
|
|
1099
1101
|
ref: r,
|
|
1100
1102
|
tabIndex: -1
|
|
1101
1103
|
}), [r]);
|
|
1102
1104
|
}
|
|
1103
|
-
function
|
|
1104
|
-
const { as: t, children: r, ref: n, ...o } = e, i =
|
|
1105
|
+
function Jo(e) {
|
|
1106
|
+
const { as: t, children: r, ref: n, ...o } = e, i = kn(), s = Rt((a) => {
|
|
1105
1107
|
if (a) {
|
|
1106
|
-
i.ref(a),
|
|
1108
|
+
i.ref(a), vt(n, a);
|
|
1107
1109
|
return;
|
|
1108
1110
|
}
|
|
1109
|
-
|
|
1111
|
+
vt(n, null), i.ref(null);
|
|
1110
1112
|
}, [i.ref, n]);
|
|
1111
1113
|
return R(t ?? "div", {
|
|
1112
1114
|
...o,
|
|
@@ -1115,22 +1117,22 @@ function zo(e) {
|
|
|
1115
1117
|
children: r
|
|
1116
1118
|
});
|
|
1117
1119
|
}
|
|
1118
|
-
function
|
|
1120
|
+
function vt(e, t) {
|
|
1119
1121
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
1120
1122
|
}
|
|
1121
|
-
const
|
|
1122
|
-
let
|
|
1123
|
-
const
|
|
1124
|
-
function
|
|
1125
|
-
return
|
|
1126
|
-
|
|
1123
|
+
const Ut = Symbol("Demiurge mutation form action");
|
|
1124
|
+
let se;
|
|
1125
|
+
const je = /* @__PURE__ */ new Set();
|
|
1126
|
+
function Rn(e) {
|
|
1127
|
+
return se = e, () => {
|
|
1128
|
+
se === e && (se = void 0);
|
|
1127
1129
|
};
|
|
1128
1130
|
}
|
|
1129
|
-
function
|
|
1130
|
-
for (const t of
|
|
1131
|
+
function qe(e) {
|
|
1132
|
+
for (const t of je)
|
|
1131
1133
|
t !== e && t.abort();
|
|
1132
1134
|
}
|
|
1133
|
-
function
|
|
1135
|
+
function Tn(e) {
|
|
1134
1136
|
let t;
|
|
1135
1137
|
return (r, n) => {
|
|
1136
1138
|
t?.controller.abort();
|
|
@@ -1139,77 +1141,77 @@ function An(e) {
|
|
|
1139
1141
|
// TYPE-EVIDENCE: the function assigns the promise before it exposes the invocation.
|
|
1140
1142
|
promise: void 0
|
|
1141
1143
|
};
|
|
1142
|
-
|
|
1143
|
-
const s =
|
|
1144
|
+
je.add(o);
|
|
1145
|
+
const s = et({
|
|
1144
1146
|
to: e.route,
|
|
1145
1147
|
...e.path === void 0 ? {} : { path: e.path }
|
|
1146
|
-
}), a =
|
|
1148
|
+
}), a = Mn({
|
|
1147
1149
|
body: n,
|
|
1148
1150
|
method: e.method,
|
|
1149
1151
|
signal: o.signal,
|
|
1150
1152
|
url: s
|
|
1151
1153
|
});
|
|
1152
|
-
return i.promise = a.then(async (
|
|
1154
|
+
return i.promise = a.then(async (l) => {
|
|
1153
1155
|
if (t !== i) return await t.promise;
|
|
1154
|
-
if (
|
|
1155
|
-
const d =
|
|
1156
|
-
if (!d) return
|
|
1157
|
-
|
|
1158
|
-
} else
|
|
1159
|
-
return o.signal.aborted ? r ??
|
|
1160
|
-
}).catch(async (
|
|
1156
|
+
if (l.status === "redirect") {
|
|
1157
|
+
const d = zt(l.location);
|
|
1158
|
+
if (!d) return Fe("The mutation returned an unsafe redirect.");
|
|
1159
|
+
qe(o), se?.redirect(d, l.history, o);
|
|
1160
|
+
} else l.status === "success" && l.revalidate && await se?.refresh();
|
|
1161
|
+
return o.signal.aborted ? r ?? Fe("The mutation was cancelled.") : t === i ? l : await t.promise;
|
|
1162
|
+
}).catch(async (l) => {
|
|
1161
1163
|
if (t !== i) return await t.promise;
|
|
1162
1164
|
if (o.signal.aborted && r) return r;
|
|
1163
|
-
if (o.signal.aborted) return
|
|
1164
|
-
throw
|
|
1165
|
+
if (o.signal.aborted) return Fe("The mutation was cancelled.");
|
|
1166
|
+
throw l;
|
|
1165
1167
|
}).finally(() => {
|
|
1166
|
-
|
|
1168
|
+
je.delete(o);
|
|
1167
1169
|
}), t = i, i.promise;
|
|
1168
1170
|
};
|
|
1169
1171
|
}
|
|
1170
|
-
function
|
|
1171
|
-
const r =
|
|
1172
|
+
function Go(e, t) {
|
|
1173
|
+
const r = et({
|
|
1172
1174
|
to: e.route,
|
|
1173
1175
|
...e.path === void 0 ? {} : { path: e.path }
|
|
1174
|
-
}), n =
|
|
1175
|
-
() =>
|
|
1176
|
+
}), n = ce(
|
|
1177
|
+
() => Tn(e),
|
|
1176
1178
|
[e.method, r]
|
|
1177
|
-
), [o, i, s] =
|
|
1178
|
-
const
|
|
1179
|
-
return Object.defineProperty(
|
|
1179
|
+
), [o, i, s] = ar(n, t), a = ce(() => {
|
|
1180
|
+
const l = (d) => i(d);
|
|
1181
|
+
return Object.defineProperty(l, Ut, {
|
|
1180
1182
|
value: { method: "POST", url: r }
|
|
1181
|
-
}),
|
|
1183
|
+
}), l;
|
|
1182
1184
|
}, [i, r]);
|
|
1183
1185
|
return [o, a, s];
|
|
1184
1186
|
}
|
|
1185
|
-
function
|
|
1186
|
-
return e[
|
|
1187
|
+
function Bt(e) {
|
|
1188
|
+
return e[Ut];
|
|
1187
1189
|
}
|
|
1188
|
-
async function
|
|
1189
|
-
const { result: t } = await
|
|
1190
|
+
async function Mn(e) {
|
|
1191
|
+
const { result: t } = await Ht(e);
|
|
1190
1192
|
if (!t)
|
|
1191
1193
|
throw new Error("Demiurge expected a versioned mutation result.");
|
|
1192
1194
|
return t;
|
|
1193
1195
|
}
|
|
1194
|
-
async function
|
|
1196
|
+
async function Ht(e) {
|
|
1195
1197
|
const t = await fetch(e.url, {
|
|
1196
1198
|
body: e.body,
|
|
1197
1199
|
credentials: "same-origin",
|
|
1198
1200
|
headers: {
|
|
1199
|
-
accept:
|
|
1200
|
-
[
|
|
1201
|
+
accept: Tt,
|
|
1202
|
+
[vr]: wr,
|
|
1201
1203
|
...e.contentType ? { "content-type": e.contentType } : {}
|
|
1202
1204
|
},
|
|
1203
1205
|
method: e.method,
|
|
1204
1206
|
redirect: "manual",
|
|
1205
1207
|
signal: e.signal
|
|
1206
1208
|
});
|
|
1207
|
-
return { response: t, result: await
|
|
1209
|
+
return { response: t, result: await Cn(t) };
|
|
1208
1210
|
}
|
|
1209
|
-
async function
|
|
1211
|
+
async function Cn(e) {
|
|
1210
1212
|
const t = e.headers.get("content-type");
|
|
1211
1213
|
if (!t) return;
|
|
1212
|
-
const [r, ...n] = t?.split(";").map((s) => s.trim().toLowerCase()) ?? [], o =
|
|
1214
|
+
const [r, ...n] = t?.split(";").map((s) => s.trim().toLowerCase()) ?? [], o = Tt.split(";")[0];
|
|
1213
1215
|
if (r !== o) return;
|
|
1214
1216
|
if (n.length !== 1 || n[0] !== "v=1")
|
|
1215
1217
|
throw new Error("Demiurge received a malformed versioned mutation result.");
|
|
@@ -1219,25 +1221,25 @@ async function kn(e) {
|
|
|
1219
1221
|
} catch {
|
|
1220
1222
|
throw new Error("Demiurge received a malformed versioned mutation result.");
|
|
1221
1223
|
}
|
|
1222
|
-
if (!
|
|
1224
|
+
if (!re(i) || i.version !== 1 || typeof i.status != "string")
|
|
1223
1225
|
throw new Error("Demiurge received a malformed versioned mutation result.");
|
|
1224
1226
|
if (i.status === "success") {
|
|
1225
|
-
if (!
|
|
1227
|
+
if (!Q(i, ["data", "revalidate", "status", "version"]) || i.revalidate !== void 0 && typeof i.revalidate != "boolean" || "data" in i && !Ke(i.data)) throw pe();
|
|
1226
1228
|
return { version: 1, status: "success", ...i.data === void 0 ? {} : { data: i.data }, ...i.revalidate === void 0 ? {} : { revalidate: i.revalidate } };
|
|
1227
1229
|
}
|
|
1228
1230
|
if (i.status === "invalid") {
|
|
1229
|
-
if (!
|
|
1231
|
+
if (!Q(i, ["status", "validation", "version"]) || !$n(i.validation)) throw pe();
|
|
1230
1232
|
return { version: 1, status: "invalid", validation: i.validation };
|
|
1231
1233
|
}
|
|
1232
1234
|
if (i.status === "failed") {
|
|
1233
|
-
if (!
|
|
1235
|
+
if (!Q(i, ["message", "status", "version"]) || i.message !== void 0 && typeof i.message != "string") throw pe();
|
|
1234
1236
|
return { version: 1, status: "failed", ...i.message === void 0 ? {} : { message: i.message } };
|
|
1235
1237
|
}
|
|
1236
|
-
if (i.status === "redirect" && typeof i.location == "string" && (i.history === "push" || i.history === "replace") &&
|
|
1238
|
+
if (i.status === "redirect" && typeof i.location == "string" && (i.history === "push" || i.history === "replace") && Q(i, ["history", "location", "status", "version"]))
|
|
1237
1239
|
return { version: 1, status: "redirect", location: i.location, history: i.history };
|
|
1238
|
-
throw
|
|
1240
|
+
throw pe();
|
|
1239
1241
|
}
|
|
1240
|
-
function
|
|
1242
|
+
function zt(e) {
|
|
1241
1243
|
try {
|
|
1242
1244
|
const t = new URL(e, window.location.href);
|
|
1243
1245
|
return t.protocol !== window.location.protocol || t.origin !== window.location.origin || t.username || t.password ? void 0 : `${t.pathname}${t.search}${t.hash}`;
|
|
@@ -1245,51 +1247,51 @@ function Ut(e) {
|
|
|
1245
1247
|
return;
|
|
1246
1248
|
}
|
|
1247
1249
|
}
|
|
1248
|
-
function
|
|
1250
|
+
function Fe(e) {
|
|
1249
1251
|
return { version: 1, status: "failed", message: e };
|
|
1250
1252
|
}
|
|
1251
|
-
function
|
|
1253
|
+
function pe() {
|
|
1252
1254
|
return new Error("Demiurge received a malformed mutation result.");
|
|
1253
1255
|
}
|
|
1254
|
-
function
|
|
1256
|
+
function Q(e, t) {
|
|
1255
1257
|
return Object.keys(e).every((r) => t.includes(r));
|
|
1256
1258
|
}
|
|
1257
|
-
function
|
|
1258
|
-
return
|
|
1259
|
+
function $n(e) {
|
|
1260
|
+
return re(e) && Q(e, ["issues"]) && Array.isArray(e.issues) && e.issues.every(Nn);
|
|
1259
1261
|
}
|
|
1260
|
-
function
|
|
1261
|
-
return
|
|
1262
|
+
function Nn(e) {
|
|
1263
|
+
return re(e) && Q(e, ["code", "message", "path"]) && typeof e.code == "string" && typeof e.message == "string" && Array.isArray(e.path) && (e.path.length === 0 || typeof e.path[0] == "string") && e.path.every((t) => typeof t == "string" || typeof t == "number");
|
|
1262
1264
|
}
|
|
1263
|
-
function
|
|
1264
|
-
return e === null || typeof e == "string" || typeof e == "boolean" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(
|
|
1265
|
+
function Ke(e) {
|
|
1266
|
+
return e === null || typeof e == "string" || typeof e == "boolean" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(Ke) : re(e) && Object.values(e).every(Ke);
|
|
1265
1267
|
}
|
|
1266
|
-
function
|
|
1267
|
-
const t =
|
|
1268
|
+
function Ln(e) {
|
|
1269
|
+
const t = Mt(e.routes), r = e.loadNavigationData ?? Gt;
|
|
1268
1270
|
return function() {
|
|
1269
|
-
const [o, i] = U(() => F()), [s, a] = U(e.locale),
|
|
1271
|
+
const [o, i] = U(() => F()), [s, a] = U(e.locale), l = ze(o.pathname, e.locales), d = k(o), [v, A] = U(
|
|
1270
1272
|
() => e.initialMatch ?? { status: "loading" }
|
|
1271
|
-
), h = k(!!e.initialMatch), p = k(!0), E = k(0), g = k(void 0), b = k("navigation"),
|
|
1272
|
-
|
|
1273
|
-
const
|
|
1274
|
-
function
|
|
1275
|
-
const c =
|
|
1276
|
-
c &&
|
|
1273
|
+
), h = k(!!e.initialMatch), p = k(!0), E = k(0), g = k(void 0), b = k("navigation"), y = k(/* @__PURE__ */ new Map()), T = k(/* @__PURE__ */ new Map()), [H, w] = U(0), [$, C] = U(0), q = k(/* @__PURE__ */ new Set()), [rr, ot] = U(0), O = k("push"), z = k(!1), [de, ke] = U(null), [K, Re] = U(null), it = k(null);
|
|
1274
|
+
it.current = de;
|
|
1275
|
+
const W = k(void 0), Te = k(void 0), D = k(void 0), J = k(!1), at = k(/* @__PURE__ */ new Map()), G = k([]), nr = k(0);
|
|
1276
|
+
function Y() {
|
|
1277
|
+
const c = D.current, u = Jt();
|
|
1278
|
+
c && at.current.set(c, u), Bn(c, u);
|
|
1277
1279
|
}
|
|
1278
|
-
const
|
|
1280
|
+
const Me = ce(() => ({
|
|
1279
1281
|
register(c) {
|
|
1280
|
-
const
|
|
1282
|
+
const u = {
|
|
1281
1283
|
element: c,
|
|
1282
|
-
order:
|
|
1284
|
+
order: nr.current++
|
|
1283
1285
|
};
|
|
1284
|
-
return
|
|
1286
|
+
return G.current.length > 0 && typeof process < "u" && process.env.NODE_ENV !== "production" && console.warn(
|
|
1285
1287
|
"Demiurge found more than one RouteFocusBoundary. The first boundary remains active."
|
|
1286
|
-
),
|
|
1287
|
-
const f =
|
|
1288
|
-
f !== -1 &&
|
|
1288
|
+
), G.current.push(u), () => {
|
|
1289
|
+
const f = G.current.indexOf(u);
|
|
1290
|
+
f !== -1 && G.current.splice(f, 1);
|
|
1289
1291
|
};
|
|
1290
1292
|
},
|
|
1291
1293
|
focus() {
|
|
1292
|
-
const c =
|
|
1294
|
+
const c = G.current.slice().sort((u, f) => u.order - f.order)[0]?.element;
|
|
1293
1295
|
if (!c || !c.isConnected || typeof c.focus != "function")
|
|
1294
1296
|
return !1;
|
|
1295
1297
|
try {
|
|
@@ -1300,202 +1302,205 @@ function Mn(e) {
|
|
|
1300
1302
|
return !0;
|
|
1301
1303
|
}
|
|
1302
1304
|
}), []);
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
}), [e.navigation]),
|
|
1306
|
-
|
|
1307
|
-
for (const c of
|
|
1308
|
-
|
|
1309
|
-
for (const c of
|
|
1310
|
-
|
|
1305
|
+
ie(() => (e.navigation !== "document" && lr(), () => {
|
|
1306
|
+
G.current = [];
|
|
1307
|
+
}), [e.navigation]), X(() => () => {
|
|
1308
|
+
qe();
|
|
1309
|
+
for (const c of q.current) c();
|
|
1310
|
+
q.current.clear();
|
|
1311
|
+
for (const c of y.current.values()) c.abort();
|
|
1312
|
+
y.current.clear(), T.current.clear();
|
|
1311
1313
|
}, []);
|
|
1312
|
-
function
|
|
1313
|
-
|
|
1314
|
-
let
|
|
1315
|
-
for (const [f,
|
|
1316
|
-
if (
|
|
1317
|
-
|
|
1314
|
+
function ne(c) {
|
|
1315
|
+
qe(c);
|
|
1316
|
+
let u = !1;
|
|
1317
|
+
for (const [f, m] of y.current) {
|
|
1318
|
+
if (m === c) continue;
|
|
1319
|
+
m.abort(), y.current.delete(f);
|
|
1318
1320
|
const S = T.current.get(f);
|
|
1319
1321
|
(S?.state === "submitting" || S?.state === "loading") && T.current.set(f, {
|
|
1320
1322
|
state: "idle",
|
|
1321
1323
|
form: S.form,
|
|
1322
1324
|
submissionKey: S.submissionKey,
|
|
1323
1325
|
...S.state === "loading" && S.result ? { result: S.result } : {}
|
|
1324
|
-
}),
|
|
1326
|
+
}), u = !0;
|
|
1325
1327
|
}
|
|
1326
|
-
|
|
1328
|
+
u && w((f) => f + 1);
|
|
1327
1329
|
}
|
|
1328
|
-
function
|
|
1330
|
+
function V() {
|
|
1329
1331
|
E.current++, g.current?.abort(), g.current = void 0;
|
|
1330
1332
|
}
|
|
1331
|
-
|
|
1333
|
+
X(() => {
|
|
1332
1334
|
if (e.navigation === "document")
|
|
1333
1335
|
return;
|
|
1334
1336
|
const c = window.history.scrollRestoration;
|
|
1335
|
-
window.history.scrollRestoration = "manual",
|
|
1336
|
-
const
|
|
1337
|
-
|
|
1337
|
+
window.history.scrollRestoration = "manual", D.current = bt(), Y();
|
|
1338
|
+
const u = () => {
|
|
1339
|
+
J.current || Y();
|
|
1338
1340
|
};
|
|
1339
|
-
return window.addEventListener("scroll",
|
|
1340
|
-
window.removeEventListener("scroll",
|
|
1341
|
+
return window.addEventListener("scroll", u, { passive: !0 }), () => {
|
|
1342
|
+
window.removeEventListener("scroll", u), window.history.scrollRestoration = c;
|
|
1341
1343
|
};
|
|
1342
|
-
}, [e.navigation]),
|
|
1344
|
+
}, [e.navigation]), X(() => {
|
|
1343
1345
|
function c() {
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
) ??
|
|
1347
|
-
const
|
|
1348
|
-
(f.pathname !==
|
|
1346
|
+
ne(), z.current = !1, O.current = "pop", J.current = !0, D.current = bt(), Te.current = at.current.get(
|
|
1347
|
+
D.current
|
|
1348
|
+
) ?? Hn();
|
|
1349
|
+
const u = F(), f = d.current;
|
|
1350
|
+
(f.pathname !== u.pathname || f.search !== u.search) && (V(), b.current = "navigation"), d.current = u, e.navigation !== "document" && f.pathname === u.pathname && f.search === u.search && f.hash !== u.hash && ye(u.hash), i(u);
|
|
1349
1351
|
}
|
|
1350
1352
|
return window.addEventListener("popstate", c), () => window.removeEventListener("popstate", c);
|
|
1351
|
-
}, []),
|
|
1352
|
-
let c = !1,
|
|
1353
|
-
const f = ++E.current,
|
|
1354
|
-
g.current =
|
|
1355
|
-
const S = b.current,
|
|
1356
|
-
if (
|
|
1353
|
+
}, []), X(() => {
|
|
1354
|
+
let c = !1, u = !1;
|
|
1355
|
+
const f = ++E.current, m = new AbortController();
|
|
1356
|
+
g.current = m;
|
|
1357
|
+
const S = b.current, I = () => !c && f === E.current;
|
|
1358
|
+
if (ke(null), Re(null), h.current && Dn(e.initialMatch) === l)
|
|
1357
1359
|
return h.current = !1, p.current = !1, () => {
|
|
1358
|
-
c = !0,
|
|
1360
|
+
c = !0, m.abort(), g.current === m && (g.current = void 0);
|
|
1359
1361
|
};
|
|
1360
1362
|
const _ = p.current;
|
|
1361
|
-
p.current = !1, S !== "refresh" && e.navigation !== "document" && !_ && (
|
|
1363
|
+
p.current = !1, S !== "refresh" && e.navigation !== "document" && !_ && (W.current = {
|
|
1362
1364
|
navigation: O.current,
|
|
1363
|
-
position: O.current === "pop" ?
|
|
1364
|
-
},
|
|
1365
|
-
|
|
1365
|
+
position: O.current === "pop" ? Te.current : void 0
|
|
1366
|
+
}, Te.current = void 0), S !== "refresh" && !z.current && (A({ status: "loading" }), br(t, l).then((x) => {
|
|
1367
|
+
I() && !u && x && A({ loading: x, status: "loading" });
|
|
1366
1368
|
}).catch(() => {
|
|
1367
1369
|
}));
|
|
1368
|
-
const
|
|
1369
|
-
return Promise.resolve(r(
|
|
1370
|
+
const oe = new Request(o.href, { signal: m.signal });
|
|
1371
|
+
return Promise.resolve(r(oe)).then(async (x) => {
|
|
1370
1372
|
const N = x.url ? new URL(x.url, o.href) : new URL(o.href);
|
|
1371
1373
|
N.hash || (N.hash = o.hash);
|
|
1372
|
-
const M = x.locale ?? (e.locales ?
|
|
1374
|
+
const M = x.locale ?? (e.locales ? Sr(new Request(N), e.locales).locale : s);
|
|
1373
1375
|
return {
|
|
1374
1376
|
initialData: x,
|
|
1375
1377
|
responseUrl: N,
|
|
1376
|
-
nextMatch: await
|
|
1378
|
+
nextMatch: await Ct(
|
|
1377
1379
|
t,
|
|
1378
|
-
|
|
1379
|
-
new Request(N.href, { signal:
|
|
1380
|
+
ze(N.pathname, e.locales),
|
|
1381
|
+
new Request(N.href, { signal: m.signal }),
|
|
1380
1382
|
x,
|
|
1381
1383
|
void 0,
|
|
1382
1384
|
{ documentContributions: !1, locale: M }
|
|
1383
1385
|
)
|
|
1384
1386
|
};
|
|
1385
1387
|
}).then(({ initialData: x, nextMatch: N, responseUrl: M }) => {
|
|
1386
|
-
if (
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1388
|
+
if (u = !0, I()) {
|
|
1389
|
+
const P = () => {
|
|
1390
|
+
if (x.document && ct(x.document), "locale" in x && x.locale && a(x.locale), M.href !== o.href) {
|
|
1391
|
+
window.history.replaceState(window.history.state, "", M);
|
|
1392
|
+
const fe = F();
|
|
1393
|
+
d.current = fe, i(fe);
|
|
1394
|
+
}
|
|
1395
|
+
A(N), ot((fe) => fe + 1), S !== "refresh" && ke({
|
|
1396
|
+
kind: O.current,
|
|
1397
|
+
outcome: N.status === "not-found" ? "not-found" : "ready",
|
|
1398
|
+
title: document.title || "Demiurge App",
|
|
1399
|
+
url: new URL(o.href)
|
|
1400
|
+
});
|
|
1401
|
+
}, Z = z.current;
|
|
1402
|
+
z.current = !1, Z ? Gn(P) : P();
|
|
1398
1403
|
}
|
|
1399
1404
|
}).catch(async (x) => {
|
|
1400
|
-
if (
|
|
1405
|
+
if (u = !0, !I() || m.signal.aborted)
|
|
1401
1406
|
return;
|
|
1402
|
-
const N = await
|
|
1407
|
+
const N = await Er(
|
|
1403
1408
|
t,
|
|
1404
|
-
|
|
1409
|
+
l
|
|
1405
1410
|
);
|
|
1406
|
-
if (
|
|
1407
|
-
const M = typeof x == "object" && x ?
|
|
1408
|
-
M &&
|
|
1411
|
+
if (I()) {
|
|
1412
|
+
const M = typeof x == "object" && x ? Yt.get(x) : void 0;
|
|
1413
|
+
M && ct(M), A({
|
|
1409
1414
|
Error: N,
|
|
1410
1415
|
error: x,
|
|
1411
1416
|
locale: s,
|
|
1412
|
-
pathname:
|
|
1417
|
+
pathname: l,
|
|
1413
1418
|
status: "error"
|
|
1414
|
-
}),
|
|
1419
|
+
}), ke(S === "refresh" ? null : {
|
|
1415
1420
|
kind: O.current,
|
|
1416
1421
|
outcome: "error",
|
|
1417
1422
|
title: M?.title ?? "Navigation failed",
|
|
1418
1423
|
url: new URL(o.href)
|
|
1419
|
-
}),
|
|
1424
|
+
}), ot((P) => P + 1);
|
|
1420
1425
|
}
|
|
1421
1426
|
}), () => {
|
|
1422
|
-
c = !0,
|
|
1427
|
+
c = !0, m.abort(), g.current === m && (g.current = void 0);
|
|
1423
1428
|
};
|
|
1424
|
-
}, [
|
|
1425
|
-
if (!(!
|
|
1426
|
-
if (
|
|
1427
|
-
|
|
1429
|
+
}, [l, o.pathname, o.search, $]), ie(() => {
|
|
1430
|
+
if (!(!K || e.navigation === "document")) {
|
|
1431
|
+
if (K.url.hash) {
|
|
1432
|
+
W.current && (W.current = void 0, ye(K.url.hash)), J.current = !1;
|
|
1428
1433
|
return;
|
|
1429
1434
|
}
|
|
1430
|
-
if (
|
|
1431
|
-
const c =
|
|
1432
|
-
|
|
1433
|
-
...
|
|
1435
|
+
if (Me.focus(), W.current) {
|
|
1436
|
+
const c = W.current;
|
|
1437
|
+
W.current = void 0, zn(e.navigationScroll, {
|
|
1438
|
+
...K,
|
|
1434
1439
|
kind: c.navigation,
|
|
1435
1440
|
navigation: c.navigation,
|
|
1436
1441
|
position: c.position
|
|
1437
1442
|
});
|
|
1438
1443
|
}
|
|
1439
|
-
|
|
1444
|
+
J.current = !1, Wn(K, e.navigationAccessibility);
|
|
1440
1445
|
}
|
|
1441
1446
|
}, [
|
|
1442
|
-
|
|
1443
|
-
|
|
1447
|
+
K,
|
|
1448
|
+
Me,
|
|
1444
1449
|
e.navigation,
|
|
1445
1450
|
e.navigationAccessibility,
|
|
1446
1451
|
e.navigationScroll
|
|
1447
1452
|
]);
|
|
1448
|
-
function B(c,
|
|
1449
|
-
T.current.set(c,
|
|
1453
|
+
function B(c, u) {
|
|
1454
|
+
T.current.set(c, u), w((f) => f + 1);
|
|
1450
1455
|
}
|
|
1451
|
-
function
|
|
1452
|
-
const f =
|
|
1453
|
-
|
|
1456
|
+
function or(c, u) {
|
|
1457
|
+
const f = Be(c, u), m = T.current.get(f);
|
|
1458
|
+
m?.form === c && (m.state === "loading" && m.result || (y.current.get(f)?.abort(), y.current.delete(f), T.current.delete(f), w((S) => S + 1)));
|
|
1454
1459
|
}
|
|
1455
|
-
const
|
|
1460
|
+
const ir = ce(
|
|
1456
1461
|
() => ({
|
|
1457
1462
|
navigation: e.navigation ?? "server",
|
|
1458
1463
|
locale: s,
|
|
1459
1464
|
locales: e.locales,
|
|
1460
1465
|
submissionVersion: H,
|
|
1461
|
-
getMutationNavigation(c,
|
|
1462
|
-
const f =
|
|
1466
|
+
getMutationNavigation(c, u) {
|
|
1467
|
+
const f = Be(c, u);
|
|
1463
1468
|
return T.current.get(f) ?? {
|
|
1464
1469
|
state: "idle",
|
|
1465
1470
|
form: c,
|
|
1466
|
-
submissionKey:
|
|
1471
|
+
submissionKey: u
|
|
1467
1472
|
};
|
|
1468
1473
|
},
|
|
1469
|
-
releaseMutationNavigation:
|
|
1474
|
+
releaseMutationNavigation: or,
|
|
1470
1475
|
push(c) {
|
|
1471
|
-
|
|
1472
|
-
const
|
|
1473
|
-
O.current = "push", e.navigation !== "document" &&
|
|
1474
|
-
const f =
|
|
1475
|
-
window.history.pushState(f.state, "", c),
|
|
1476
|
-
const
|
|
1477
|
-
(
|
|
1476
|
+
ne(), J.current = !1;
|
|
1477
|
+
const u = F();
|
|
1478
|
+
O.current = "push", e.navigation !== "document" && Y();
|
|
1479
|
+
const f = ve();
|
|
1480
|
+
window.history.pushState(f.state, "", c), D.current = f.key;
|
|
1481
|
+
const m = F();
|
|
1482
|
+
z.current = At(e.viewTransitions) && (u.pathname !== m.pathname || u.search !== m.search), (u.pathname !== m.pathname || u.search !== m.search) && (V(), b.current = "navigation"), d.current = m, i(m), u.pathname === m.pathname && u.search === m.search && u.hash !== m.hash && ye(m.hash);
|
|
1478
1483
|
},
|
|
1479
1484
|
replace(c) {
|
|
1480
|
-
|
|
1481
|
-
const
|
|
1482
|
-
O.current = "replace", e.navigation !== "document" &&
|
|
1483
|
-
|
|
1485
|
+
ne(), J.current = !1;
|
|
1486
|
+
const u = F();
|
|
1487
|
+
O.current = "replace", e.navigation !== "document" && Y(), window.history.replaceState(
|
|
1488
|
+
be(window.history.state, D.current),
|
|
1484
1489
|
"",
|
|
1485
1490
|
c
|
|
1486
1491
|
);
|
|
1487
1492
|
const f = F();
|
|
1488
|
-
(
|
|
1493
|
+
z.current = At(e.viewTransitions) && (u.pathname !== f.pathname || u.search !== f.search), (u.pathname !== f.pathname || u.search !== f.search) && (V(), b.current = "navigation"), d.current = f, i(f), e.navigation !== "document" && u.pathname === f.pathname && u.search === f.search && u.hash !== f.hash && ye(f.hash);
|
|
1489
1494
|
},
|
|
1490
|
-
async submitMutation(c,
|
|
1495
|
+
async submitMutation(c, u, f) {
|
|
1491
1496
|
if ((e.navigation ?? "server") !== "server") return;
|
|
1492
|
-
const
|
|
1493
|
-
if (!
|
|
1494
|
-
const S =
|
|
1495
|
-
|
|
1496
|
-
const
|
|
1497
|
-
|
|
1498
|
-
const _ =
|
|
1497
|
+
const m = jn(c, u);
|
|
1498
|
+
if (!m) return;
|
|
1499
|
+
const S = Be(c, f);
|
|
1500
|
+
y.current.get(S)?.abort();
|
|
1501
|
+
const I = new AbortController();
|
|
1502
|
+
y.current.set(S, I);
|
|
1503
|
+
const _ = m.formData, oe = () => !I.signal.aborted && y.current.get(S) === I;
|
|
1499
1504
|
B(S, {
|
|
1500
1505
|
state: "submitting",
|
|
1501
1506
|
form: c,
|
|
@@ -1504,129 +1509,129 @@ function Mn(e) {
|
|
|
1504
1509
|
});
|
|
1505
1510
|
let x;
|
|
1506
1511
|
try {
|
|
1507
|
-
const N = await
|
|
1508
|
-
body:
|
|
1509
|
-
contentType:
|
|
1510
|
-
method:
|
|
1511
|
-
signal:
|
|
1512
|
-
url:
|
|
1512
|
+
const N = await Ht({
|
|
1513
|
+
body: m.body,
|
|
1514
|
+
contentType: m.contentType,
|
|
1515
|
+
method: m.method,
|
|
1516
|
+
signal: I.signal,
|
|
1517
|
+
url: m.url
|
|
1513
1518
|
});
|
|
1514
|
-
if (x = N.response, !
|
|
1519
|
+
if (x = N.response, !oe()) return;
|
|
1515
1520
|
const M = N.result;
|
|
1516
|
-
if (!
|
|
1521
|
+
if (!oe()) return;
|
|
1517
1522
|
if (M?.status === "invalid") {
|
|
1518
1523
|
B(S, { state: "invalid", form: c, submissionKey: f, formData: _, result: M });
|
|
1519
1524
|
return;
|
|
1520
1525
|
}
|
|
1521
1526
|
if (M?.status === "redirect") {
|
|
1522
|
-
const
|
|
1523
|
-
if (!
|
|
1527
|
+
const P = zt(M.location);
|
|
1528
|
+
if (!P) {
|
|
1524
1529
|
B(S, { state: "error", form: c, submissionKey: f, formData: _, response: x });
|
|
1525
1530
|
return;
|
|
1526
1531
|
}
|
|
1527
|
-
if (
|
|
1532
|
+
if (V(), ne(I), b.current = "navigation", B(S, { state: "loading", form: c, submissionKey: f, formData: _ }), Y(), M.history === "replace")
|
|
1528
1533
|
window.history.replaceState(
|
|
1529
|
-
|
|
1534
|
+
be(null, D.current),
|
|
1530
1535
|
"",
|
|
1531
|
-
|
|
1536
|
+
P
|
|
1532
1537
|
);
|
|
1533
1538
|
else {
|
|
1534
|
-
const
|
|
1535
|
-
window.history.pushState(
|
|
1539
|
+
const Z = ve();
|
|
1540
|
+
window.history.pushState(Z.state, "", P), D.current = Z.key;
|
|
1536
1541
|
}
|
|
1537
|
-
O.current = M.history, d.current = F(), i(d.current), C((
|
|
1542
|
+
O.current = M.history, d.current = F(), i(d.current), C((Z) => Z + 1);
|
|
1538
1543
|
return;
|
|
1539
1544
|
}
|
|
1540
1545
|
if (M?.status === "failed" || !x.ok) {
|
|
1541
1546
|
B(S, { state: "error", form: c, submissionKey: f, formData: _, response: x });
|
|
1542
1547
|
return;
|
|
1543
1548
|
}
|
|
1544
|
-
M?.status === "success" && M.revalidate ? (B(S, { state: "loading", form: c, submissionKey: f, formData: _, result: M }),
|
|
1549
|
+
M?.status === "success" && M.revalidate ? (B(S, { state: "loading", form: c, submissionKey: f, formData: _, result: M }), V(), b.current = "refresh", C((P) => P + 1)) : B(S, { state: "idle", form: c, submissionKey: f, result: M });
|
|
1545
1550
|
} catch {
|
|
1546
|
-
|
|
1551
|
+
oe() && B(S, { state: "error", form: c, submissionKey: f, formData: _, response: x });
|
|
1547
1552
|
} finally {
|
|
1548
|
-
|
|
1553
|
+
y.current.get(S) === I && y.current.delete(S);
|
|
1549
1554
|
}
|
|
1550
1555
|
}
|
|
1551
1556
|
}),
|
|
1552
1557
|
[H]
|
|
1553
1558
|
);
|
|
1554
|
-
return
|
|
1555
|
-
redirect(c,
|
|
1556
|
-
if (
|
|
1559
|
+
return ie(() => Rn({
|
|
1560
|
+
redirect(c, u, f) {
|
|
1561
|
+
if (V(), ne(f), z.current = !1, b.current = "navigation", Y(), u === "replace")
|
|
1557
1562
|
window.history.replaceState(
|
|
1558
|
-
|
|
1563
|
+
be(null, D.current),
|
|
1559
1564
|
"",
|
|
1560
1565
|
c
|
|
1561
1566
|
);
|
|
1562
1567
|
else {
|
|
1563
|
-
const
|
|
1564
|
-
window.history.pushState(
|
|
1568
|
+
const m = ve();
|
|
1569
|
+
window.history.pushState(m.state, "", c), D.current = m.key;
|
|
1565
1570
|
}
|
|
1566
|
-
O.current =
|
|
1571
|
+
O.current = u, d.current = F(), i(d.current), C((m) => m + 1);
|
|
1567
1572
|
},
|
|
1568
1573
|
refresh() {
|
|
1569
1574
|
return new Promise((c) => {
|
|
1570
|
-
|
|
1575
|
+
V(), b.current = "refresh", q.current.add(c), C((u) => u + 1);
|
|
1571
1576
|
});
|
|
1572
1577
|
}
|
|
1573
|
-
}), [s, e.locales, e.navigation]), R(
|
|
1574
|
-
value:
|
|
1575
|
-
children: R(
|
|
1576
|
-
value:
|
|
1577
|
-
children: R(
|
|
1578
|
+
}), [s, e.locales, e.navigation]), R(Qt.Provider, {
|
|
1579
|
+
value: ir,
|
|
1580
|
+
children: R(Ft.Provider, {
|
|
1581
|
+
value: Me,
|
|
1582
|
+
children: R(Fn, {
|
|
1578
1583
|
key: `${o.pathname}${o.search}`,
|
|
1579
1584
|
Loading: e.loading,
|
|
1580
1585
|
NotFound: e.notFound,
|
|
1581
1586
|
match: v,
|
|
1582
|
-
pendingCommit:
|
|
1583
|
-
resolvedRouteVersion:
|
|
1587
|
+
pendingCommit: de,
|
|
1588
|
+
resolvedRouteVersion: rr,
|
|
1584
1589
|
onCommitted: (c) => {
|
|
1585
|
-
|
|
1590
|
+
it.current === c && Re(c);
|
|
1586
1591
|
},
|
|
1587
1592
|
onRenderError: () => {
|
|
1588
|
-
|
|
1593
|
+
Re(de ? { ...de, outcome: "error", title: "Navigation failed" } : null), st();
|
|
1589
1594
|
},
|
|
1590
|
-
onRouteCommitted:
|
|
1595
|
+
onRouteCommitted: st
|
|
1591
1596
|
})
|
|
1592
1597
|
})
|
|
1593
1598
|
});
|
|
1594
|
-
function
|
|
1595
|
-
for (const c of
|
|
1596
|
-
|
|
1597
|
-
for (const [c,
|
|
1598
|
-
|
|
1599
|
+
function st() {
|
|
1600
|
+
for (const c of q.current) c();
|
|
1601
|
+
q.current.clear();
|
|
1602
|
+
for (const [c, u] of T.current)
|
|
1603
|
+
u.state === "loading" && T.current.set(c, {
|
|
1599
1604
|
state: "idle",
|
|
1600
|
-
form:
|
|
1601
|
-
submissionKey:
|
|
1602
|
-
result:
|
|
1605
|
+
form: u.form,
|
|
1606
|
+
submissionKey: u.submissionKey,
|
|
1607
|
+
result: u.result
|
|
1603
1608
|
});
|
|
1604
1609
|
w((c) => c + 1);
|
|
1605
1610
|
}
|
|
1606
1611
|
};
|
|
1607
1612
|
}
|
|
1608
|
-
function
|
|
1609
|
-
const r = t.getAttribute(
|
|
1613
|
+
function In(e, t) {
|
|
1614
|
+
const r = t.getAttribute(hr);
|
|
1610
1615
|
return e.status === "not-found" ? r === "not-found" : e.status === "ready" && r === null;
|
|
1611
1616
|
}
|
|
1612
|
-
function
|
|
1617
|
+
function Dn(e) {
|
|
1613
1618
|
if (e)
|
|
1614
1619
|
return e.status === "ready" ? e.match.pathname : e.status === "loading" ? void 0 : e.pathname;
|
|
1615
1620
|
}
|
|
1616
|
-
async function
|
|
1621
|
+
async function Yo(e) {
|
|
1617
1622
|
const t = e.root ?? document.getElementById("root");
|
|
1618
1623
|
if (!t)
|
|
1619
1624
|
throw new Error(
|
|
1620
1625
|
"Demiurge expected a #root element in the framework document."
|
|
1621
1626
|
);
|
|
1622
|
-
const r =
|
|
1627
|
+
const r = Mt(e.routes), n = e.loadNavigationData ?? Gt, o = e.initialData ?? dr(document), i = await Ct(
|
|
1623
1628
|
r,
|
|
1624
|
-
|
|
1629
|
+
ze(window.location.pathname, e.locales),
|
|
1625
1630
|
new Request(window.location.href),
|
|
1626
1631
|
o ?? await n(new Request(window.location.href)),
|
|
1627
1632
|
void 0,
|
|
1628
1633
|
{ documentContributions: !1, locale: o?.locale ?? e.locale }
|
|
1629
|
-
), s =
|
|
1634
|
+
), s = In(i, t), a = Ln(
|
|
1630
1635
|
s ? {
|
|
1631
1636
|
...e,
|
|
1632
1637
|
locale: o?.locale ?? e.locale,
|
|
@@ -1638,16 +1643,16 @@ async function Vo(e) {
|
|
|
1638
1643
|
loadNavigationData: n,
|
|
1639
1644
|
navigation: o?.navigation ?? e.navigation
|
|
1640
1645
|
}
|
|
1641
|
-
), { createRoot:
|
|
1646
|
+
), { createRoot: l, hydrateRoot: d } = Pn(
|
|
1642
1647
|
await import("react-dom/client")
|
|
1643
1648
|
);
|
|
1644
|
-
if (s && t.hasAttribute(
|
|
1645
|
-
d(t, R(a)),
|
|
1649
|
+
if (s && t.hasAttribute(fr)) {
|
|
1650
|
+
d(t, R(a)), ut();
|
|
1646
1651
|
return;
|
|
1647
1652
|
}
|
|
1648
|
-
t.replaceChildren(),
|
|
1653
|
+
t.replaceChildren(), l(t).render(R(a)), ut();
|
|
1649
1654
|
}
|
|
1650
|
-
function
|
|
1655
|
+
function Pn(e) {
|
|
1651
1656
|
const t = typeof e.createRoot == "function" && typeof e.hydrateRoot == "function" ? e : e.default;
|
|
1652
1657
|
if (!t || typeof t.createRoot != "function" || typeof t.hydrateRoot != "function")
|
|
1653
1658
|
throw new Error(
|
|
@@ -1655,65 +1660,65 @@ function Nn(e) {
|
|
|
1655
1660
|
);
|
|
1656
1661
|
return t;
|
|
1657
1662
|
}
|
|
1658
|
-
function
|
|
1659
|
-
const r =
|
|
1663
|
+
function On(e, t) {
|
|
1664
|
+
const r = xe(), {
|
|
1660
1665
|
children: n,
|
|
1661
1666
|
download: o,
|
|
1662
1667
|
hash: i,
|
|
1663
1668
|
locale: s,
|
|
1664
1669
|
onClick: a,
|
|
1665
|
-
path:
|
|
1670
|
+
path: l,
|
|
1666
1671
|
reloadDocument: d,
|
|
1667
1672
|
replace: v,
|
|
1668
1673
|
search: A,
|
|
1669
1674
|
target: h,
|
|
1670
1675
|
to: p,
|
|
1671
1676
|
...E
|
|
1672
|
-
} = e, g =
|
|
1677
|
+
} = e, g = et(e), b = s, y = r.locales && (b ?? r.locale) ? tt(
|
|
1673
1678
|
g,
|
|
1674
1679
|
b ?? r.locale,
|
|
1675
1680
|
r.locales,
|
|
1676
1681
|
typeof window > "u" ? "http://demiurge.local" : window.location.href
|
|
1677
1682
|
) : g;
|
|
1678
|
-
return /* @__PURE__ */
|
|
1683
|
+
return /* @__PURE__ */ kt(
|
|
1679
1684
|
"a",
|
|
1680
1685
|
{
|
|
1681
1686
|
...E,
|
|
1682
1687
|
download: o,
|
|
1683
|
-
href:
|
|
1688
|
+
href: y,
|
|
1684
1689
|
ref: t,
|
|
1685
1690
|
target: h,
|
|
1686
1691
|
onClick: (T) => {
|
|
1687
|
-
a?.(T), r.navigation === "server" && !d &&
|
|
1692
|
+
a?.(T), r.navigation === "server" && !d && Kn(T, { download: o, target: h, to: y }) && (T.preventDefault(), v ? r.replace(y) : r.push(y));
|
|
1688
1693
|
},
|
|
1689
1694
|
children: n
|
|
1690
1695
|
}
|
|
1691
1696
|
);
|
|
1692
1697
|
}
|
|
1693
|
-
function
|
|
1694
|
-
return
|
|
1698
|
+
function Zo(e) {
|
|
1699
|
+
return On(e, e.ref ?? null);
|
|
1695
1700
|
}
|
|
1696
|
-
const
|
|
1697
|
-
function
|
|
1698
|
-
const t =
|
|
1701
|
+
const Vt = Ge(void 0);
|
|
1702
|
+
function Xo(e) {
|
|
1703
|
+
const t = xe(), r = k(t);
|
|
1699
1704
|
r.current = t;
|
|
1700
|
-
const n =
|
|
1701
|
-
|
|
1705
|
+
const n = sr(), o = e.submissionKey ?? n, i = k(null), s = jt(), a = typeof e.action == "function" ? e.action : void 0, l = a ? Bt(a) : void 0, d = !!(a && s && t.navigation === "server");
|
|
1706
|
+
ie(() => () => {
|
|
1702
1707
|
i.current && r.current.releaseMutationNavigation(i.current, o);
|
|
1703
1708
|
}, [o]);
|
|
1704
1709
|
function v(g) {
|
|
1705
1710
|
const b = e.onSubmit;
|
|
1706
1711
|
if (b?.(g), a || g.defaultPrevented || t.navigation !== "server") return;
|
|
1707
|
-
const
|
|
1708
|
-
|
|
1712
|
+
const y = g.nativeEvent.submitter;
|
|
1713
|
+
Zt(g.currentTarget, y) && (g.preventDefault(), t.submitMutation(
|
|
1709
1714
|
g.currentTarget,
|
|
1710
|
-
|
|
1715
|
+
y,
|
|
1711
1716
|
o
|
|
1712
1717
|
));
|
|
1713
1718
|
}
|
|
1714
|
-
const { submissionKey: A, ...h } = e, p = a ? d ? a :
|
|
1719
|
+
const { submissionKey: A, ...h } = e, p = a ? d ? a : l?.url : h.action, E = typeof p == "string" && t.locales && (e.locale ?? t.locale) ? tt(p, e.locale ?? t.locale, t.locales, typeof window > "u" ? "http://demiurge.local" : window.location.href) : p;
|
|
1715
1720
|
return R(
|
|
1716
|
-
|
|
1721
|
+
Vt.Provider,
|
|
1717
1722
|
{
|
|
1718
1723
|
value: o,
|
|
1719
1724
|
children: R("form", {
|
|
@@ -1732,8 +1737,8 @@ function Ko(e) {
|
|
|
1732
1737
|
}
|
|
1733
1738
|
);
|
|
1734
1739
|
}
|
|
1735
|
-
function
|
|
1736
|
-
const t =
|
|
1740
|
+
function Qo(e) {
|
|
1741
|
+
const t = xe(), r = jt(), n = Bt(e.formAction), o = r && t.navigation === "server", i = t.locales && (e.locale ?? t.locale) ? tt(n.url, e.locale ?? t.locale, t.locales, typeof window > "u" ? "http://demiurge.local" : window.location.href) : n.url;
|
|
1737
1742
|
return R("button", {
|
|
1738
1743
|
...e,
|
|
1739
1744
|
locale: void 0,
|
|
@@ -1741,18 +1746,18 @@ function Wo(e) {
|
|
|
1741
1746
|
formMethod: o ? void 0 : "post"
|
|
1742
1747
|
});
|
|
1743
1748
|
}
|
|
1744
|
-
function
|
|
1749
|
+
function jt() {
|
|
1745
1750
|
const [e, t] = U(!1);
|
|
1746
|
-
return
|
|
1751
|
+
return X(() => t(!0), []), e;
|
|
1747
1752
|
}
|
|
1748
|
-
function
|
|
1749
|
-
const t =
|
|
1750
|
-
return
|
|
1753
|
+
function _n(e) {
|
|
1754
|
+
const t = Ye(Vt);
|
|
1755
|
+
return xe().getMutationNavigation(e?.form, e?.submissionKey ?? t);
|
|
1751
1756
|
}
|
|
1752
|
-
function
|
|
1753
|
-
return
|
|
1757
|
+
function ei(e) {
|
|
1758
|
+
return _n({ submissionKey: e });
|
|
1754
1759
|
}
|
|
1755
|
-
function
|
|
1760
|
+
function Fn({
|
|
1756
1761
|
Loading: e,
|
|
1757
1762
|
NotFound: t,
|
|
1758
1763
|
match: r,
|
|
@@ -1763,51 +1768,51 @@ function Dn({
|
|
|
1763
1768
|
onRouteCommitted: a
|
|
1764
1769
|
}) {
|
|
1765
1770
|
if (r.status === "loading") {
|
|
1766
|
-
const
|
|
1767
|
-
return
|
|
1771
|
+
const y = r.loading ?? e;
|
|
1772
|
+
return y ? R(y) : null;
|
|
1768
1773
|
}
|
|
1769
1774
|
if (r.status === "not-found") {
|
|
1770
|
-
const
|
|
1771
|
-
return R(
|
|
1775
|
+
const y = r.notFound ?? t ?? Cr;
|
|
1776
|
+
return R(Ce, null, r.layouts.reduceRight(
|
|
1772
1777
|
(T, H) => R(H, {
|
|
1773
1778
|
children: T,
|
|
1774
1779
|
locale: r.locale,
|
|
1775
1780
|
path: {},
|
|
1776
1781
|
pathname: r.pathname
|
|
1777
1782
|
}),
|
|
1778
|
-
R(
|
|
1779
|
-
), R(
|
|
1783
|
+
R(y, { locale: r.locale, pathname: r.pathname })
|
|
1784
|
+
), R(Ue, { commit: i, onCommit: o, onRouteCommitted: a, resolvedRouteVersion: s }));
|
|
1780
1785
|
}
|
|
1781
1786
|
if (r.status === "error")
|
|
1782
|
-
return R(
|
|
1787
|
+
return R(Ce, null, r.Error ? R(r.Error, {
|
|
1783
1788
|
error: r.error,
|
|
1784
1789
|
locale: "locale" in r ? r.locale : void 0,
|
|
1785
1790
|
pathname: r.pathname,
|
|
1786
|
-
status:
|
|
1787
|
-
}) : null, R(
|
|
1788
|
-
const { data:
|
|
1789
|
-
(
|
|
1791
|
+
status: qt(r.error)
|
|
1792
|
+
}) : null, R(Ue, { commit: i, onCommit: o, onRouteCommitted: a, resolvedRouteVersion: s }));
|
|
1793
|
+
const { data: l, error: d, locale: v, page: A, layouts: h, path: p, pathname: E } = r.match, g = R(A, { data: l, locale: v, path: p, pathname: E }), b = h.reduceRight(
|
|
1794
|
+
(y, T) => R(T, { path: p, pathname: E, locale: v, children: y }),
|
|
1790
1795
|
g
|
|
1791
1796
|
);
|
|
1792
|
-
return R(
|
|
1797
|
+
return R(Un, {
|
|
1793
1798
|
Error: d,
|
|
1794
|
-
children: R(
|
|
1799
|
+
children: R(Ce, null, b, R(Ue, { commit: i, onCommit: o, onRouteCommitted: a, resolvedRouteVersion: s })),
|
|
1795
1800
|
onError: n,
|
|
1796
1801
|
pathname: E
|
|
1797
1802
|
});
|
|
1798
1803
|
}
|
|
1799
|
-
function
|
|
1804
|
+
function Ue({
|
|
1800
1805
|
commit: e,
|
|
1801
1806
|
onCommit: t,
|
|
1802
1807
|
onRouteCommitted: r,
|
|
1803
1808
|
resolvedRouteVersion: n
|
|
1804
1809
|
}) {
|
|
1805
1810
|
const o = k(null), i = k(0);
|
|
1806
|
-
return
|
|
1811
|
+
return ie(() => {
|
|
1807
1812
|
n > i.current && (i.current = n, r()), e && o.current !== e && (o.current = e, t(e));
|
|
1808
1813
|
}, [e, t, r, n]), null;
|
|
1809
1814
|
}
|
|
1810
|
-
class
|
|
1815
|
+
class Un extends cr {
|
|
1811
1816
|
static getDerivedStateFromError(t) {
|
|
1812
1817
|
return { error: t };
|
|
1813
1818
|
}
|
|
@@ -1822,12 +1827,12 @@ class Pn extends ir {
|
|
|
1822
1827
|
return this.state.error !== void 0 ? this.props.Error ? R(this.props.Error, {
|
|
1823
1828
|
error: this.state.error,
|
|
1824
1829
|
pathname: this.props.pathname,
|
|
1825
|
-
status:
|
|
1830
|
+
status: qt(this.state.error)
|
|
1826
1831
|
}) : null : this.props.children;
|
|
1827
1832
|
}
|
|
1828
1833
|
}
|
|
1829
|
-
function
|
|
1830
|
-
return
|
|
1834
|
+
function qt(e) {
|
|
1835
|
+
return $r(e) ? e.status : 500;
|
|
1831
1836
|
}
|
|
1832
1837
|
function F() {
|
|
1833
1838
|
return {
|
|
@@ -1837,43 +1842,43 @@ function F() {
|
|
|
1837
1842
|
search: window.location.search
|
|
1838
1843
|
};
|
|
1839
1844
|
}
|
|
1840
|
-
const
|
|
1841
|
-
let
|
|
1842
|
-
function
|
|
1843
|
-
const e =
|
|
1845
|
+
const We = "__demiurge_scroll", Je = "__demiurge_history_entry";
|
|
1846
|
+
let Kt = 0;
|
|
1847
|
+
function bt() {
|
|
1848
|
+
const e = Wt(window.history.state);
|
|
1844
1849
|
if (e) return e;
|
|
1845
|
-
const t =
|
|
1850
|
+
const t = ve(window.history.state);
|
|
1846
1851
|
return window.history.replaceState(t.state, "", window.location.href), t.key;
|
|
1847
1852
|
}
|
|
1848
|
-
function
|
|
1849
|
-
const t = `entry:${++
|
|
1850
|
-
return { key: t, state:
|
|
1853
|
+
function ve(e) {
|
|
1854
|
+
const t = `entry:${++Kt}`;
|
|
1855
|
+
return { key: t, state: be(e, t) };
|
|
1851
1856
|
}
|
|
1852
|
-
function
|
|
1853
|
-
return e && typeof e == "object" ? { ...e, [
|
|
1857
|
+
function be(e, t = `entry:${++Kt}`) {
|
|
1858
|
+
return e && typeof e == "object" ? { ...e, [Je]: t } : { [Je]: t };
|
|
1854
1859
|
}
|
|
1855
|
-
function
|
|
1860
|
+
function Wt(e) {
|
|
1856
1861
|
if (!e || typeof e != "object") return;
|
|
1857
|
-
const t = Reflect.get(e,
|
|
1862
|
+
const t = Reflect.get(e, Je);
|
|
1858
1863
|
return typeof t == "string" ? t : void 0;
|
|
1859
1864
|
}
|
|
1860
|
-
function
|
|
1865
|
+
function Jt() {
|
|
1861
1866
|
return { x: window.scrollX, y: window.scrollY };
|
|
1862
1867
|
}
|
|
1863
|
-
function
|
|
1868
|
+
function Bn(e, t = Jt()) {
|
|
1864
1869
|
const r = window.history.state;
|
|
1865
|
-
if (e &&
|
|
1866
|
-
const n = r && typeof r == "object" ? { ...r, [
|
|
1870
|
+
if (e && Wt(r) !== e) return;
|
|
1871
|
+
const n = r && typeof r == "object" ? { ...r, [We]: t } : { [We]: t };
|
|
1867
1872
|
try {
|
|
1868
1873
|
window.history.replaceState(n, "", window.location.href);
|
|
1869
1874
|
} catch {
|
|
1870
1875
|
}
|
|
1871
1876
|
}
|
|
1872
|
-
function
|
|
1873
|
-
const e = window.history.state?.[
|
|
1877
|
+
function Hn() {
|
|
1878
|
+
const e = window.history.state?.[We];
|
|
1874
1879
|
return e && typeof e == "object" && typeof e.x == "number" && typeof e.y == "number" ? { x: e.x, y: e.y } : void 0;
|
|
1875
1880
|
}
|
|
1876
|
-
function
|
|
1881
|
+
function zn(e, t) {
|
|
1877
1882
|
if (t.kind === "pop" && t.url.hash || e === !1)
|
|
1878
1883
|
return;
|
|
1879
1884
|
if (typeof e == "function") {
|
|
@@ -1886,14 +1891,14 @@ function Fn(e, t) {
|
|
|
1886
1891
|
const r = t.kind === "pop" ? t.position?.x ?? 0 : 0, n = t.kind === "pop" ? t.position?.y ?? 0 : 0;
|
|
1887
1892
|
window.scrollTo?.(r, n);
|
|
1888
1893
|
}
|
|
1889
|
-
async function
|
|
1894
|
+
async function Gt(e) {
|
|
1890
1895
|
const t = new Headers(e.headers);
|
|
1891
|
-
t.set("accept", "application/json"), t.set(
|
|
1896
|
+
t.set("accept", "application/json"), t.set(dt, Ar);
|
|
1892
1897
|
const r = await fetch(new Request(e, {
|
|
1893
1898
|
credentials: "same-origin",
|
|
1894
1899
|
headers: t
|
|
1895
|
-
})), n = r.headers.get(
|
|
1896
|
-
if (n ===
|
|
1900
|
+
})), n = r.headers.get(dt);
|
|
1901
|
+
if (n === xr) {
|
|
1897
1902
|
const o = await r.json();
|
|
1898
1903
|
if (o.hasData !== !0)
|
|
1899
1904
|
throw new Error("Demiurge received malformed navigation route data.");
|
|
@@ -1905,8 +1910,8 @@ async function Kt(e) {
|
|
|
1905
1910
|
url: r.url
|
|
1906
1911
|
};
|
|
1907
1912
|
}
|
|
1908
|
-
if (n ===
|
|
1909
|
-
const o = await
|
|
1913
|
+
if (n === kr) {
|
|
1914
|
+
const o = await St(r);
|
|
1910
1915
|
return {
|
|
1911
1916
|
document: o?.document,
|
|
1912
1917
|
hasData: !0,
|
|
@@ -1914,21 +1919,21 @@ async function Kt(e) {
|
|
|
1914
1919
|
url: r.url
|
|
1915
1920
|
};
|
|
1916
1921
|
}
|
|
1917
|
-
if (n ===
|
|
1918
|
-
const o = await
|
|
1922
|
+
if (n === Rr || !r.ok) {
|
|
1923
|
+
const o = await St(r), i = Tr.includes(
|
|
1919
1924
|
r.status
|
|
1920
|
-
) ? r.status : 500, s =
|
|
1925
|
+
) ? r.status : 500, s = Mr(i, {
|
|
1921
1926
|
detail: o?.error?.detail,
|
|
1922
1927
|
title: o?.error?.title
|
|
1923
1928
|
});
|
|
1924
|
-
throw o?.document &&
|
|
1929
|
+
throw o?.document && Yt.set(s, o.document), s;
|
|
1925
1930
|
}
|
|
1926
1931
|
throw new Error(
|
|
1927
1932
|
"Demiurge expected a navigation data response from the application server."
|
|
1928
1933
|
);
|
|
1929
1934
|
}
|
|
1930
|
-
const
|
|
1931
|
-
async function
|
|
1935
|
+
const Yt = /* @__PURE__ */ new WeakMap();
|
|
1936
|
+
async function St(e) {
|
|
1932
1937
|
try {
|
|
1933
1938
|
return await e.json();
|
|
1934
1939
|
} catch (t) {
|
|
@@ -1936,16 +1941,16 @@ async function vt(e) {
|
|
|
1936
1941
|
return;
|
|
1937
1942
|
}
|
|
1938
1943
|
}
|
|
1939
|
-
function
|
|
1944
|
+
function Be(e, t) {
|
|
1940
1945
|
if (t) return t;
|
|
1941
1946
|
if (!e) return "default";
|
|
1942
|
-
let r =
|
|
1943
|
-
return r || (r = `form:${
|
|
1947
|
+
let r = Et.get(e);
|
|
1948
|
+
return r || (r = `form:${Vn++}`, Et.set(e, r)), r;
|
|
1944
1949
|
}
|
|
1945
|
-
const
|
|
1946
|
-
let
|
|
1947
|
-
function
|
|
1948
|
-
const r =
|
|
1950
|
+
const Et = /* @__PURE__ */ new WeakMap();
|
|
1951
|
+
let Vn = 1;
|
|
1952
|
+
function Zt(e, t) {
|
|
1953
|
+
const r = Xt(e, t);
|
|
1949
1954
|
if (!r) return !1;
|
|
1950
1955
|
const { action: n, enctype: o, method: i, target: s } = r;
|
|
1951
1956
|
if (!["POST", "PUT", "PATCH", "DELETE"].includes(i) || s && s.toLowerCase() !== "_self") return !1;
|
|
@@ -1956,15 +1961,15 @@ function Jt(e, t) {
|
|
|
1956
1961
|
}
|
|
1957
1962
|
return ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"].includes(o);
|
|
1958
1963
|
}
|
|
1959
|
-
function
|
|
1960
|
-
if (!
|
|
1961
|
-
const { action: r, enctype: n, method: o } =
|
|
1964
|
+
function jn(e, t) {
|
|
1965
|
+
if (!Zt(e, t)) return;
|
|
1966
|
+
const { action: r, enctype: n, method: o } = Xt(e, t), i = t ? new FormData(e, t) : new FormData(e);
|
|
1962
1967
|
if (n === "multipart/form-data")
|
|
1963
1968
|
return { body: i, contentType: void 0, formData: i, method: o, url: r };
|
|
1964
1969
|
if (n === "application/x-www-form-urlencoded") {
|
|
1965
1970
|
const a = new URLSearchParams();
|
|
1966
|
-
for (const [
|
|
1967
|
-
typeof d == "string" ? a.append(
|
|
1971
|
+
for (const [l, d] of i)
|
|
1972
|
+
typeof d == "string" ? a.append(l, d) : a.append(l, d.name);
|
|
1968
1973
|
return {
|
|
1969
1974
|
body: a,
|
|
1970
1975
|
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
|
|
@@ -1974,8 +1979,8 @@ function Bn(e, t) {
|
|
|
1974
1979
|
};
|
|
1975
1980
|
}
|
|
1976
1981
|
const s = [];
|
|
1977
|
-
for (const [a,
|
|
1978
|
-
s.push(`${a}=${typeof
|
|
1982
|
+
for (const [a, l] of i)
|
|
1983
|
+
s.push(`${a}=${typeof l == "string" ? l : l.name}`);
|
|
1979
1984
|
return {
|
|
1980
1985
|
body: `${s.join(`\r
|
|
1981
1986
|
`)}\r
|
|
@@ -1986,23 +1991,23 @@ function Bn(e, t) {
|
|
|
1986
1991
|
url: r
|
|
1987
1992
|
};
|
|
1988
1993
|
}
|
|
1989
|
-
function
|
|
1990
|
-
if (!
|
|
1994
|
+
function Xt(e, t) {
|
|
1995
|
+
if (!qn(t)) return;
|
|
1991
1996
|
const r = t instanceof HTMLButtonElement || t instanceof HTMLInputElement ? t : void 0;
|
|
1992
1997
|
return {
|
|
1993
|
-
action: (
|
|
1994
|
-
enctype: ((
|
|
1995
|
-
method: ((
|
|
1996
|
-
target:
|
|
1998
|
+
action: (me(r, "formaction") ?? e.action) || window.location.href,
|
|
1999
|
+
enctype: ((me(r, "formenctype") ?? e.enctype) || "application/x-www-form-urlencoded").toLowerCase(),
|
|
2000
|
+
method: ((me(r, "formmethod") ?? e.method) || "get").toUpperCase(),
|
|
2001
|
+
target: me(r, "formtarget") ?? e.target
|
|
1997
2002
|
};
|
|
1998
2003
|
}
|
|
1999
|
-
function
|
|
2004
|
+
function me(e, t) {
|
|
2000
2005
|
return e?.hasAttribute(t) ? e.getAttribute(t) ?? "" : void 0;
|
|
2001
2006
|
}
|
|
2002
|
-
function
|
|
2007
|
+
function qn(e) {
|
|
2003
2008
|
return e ? e instanceof HTMLButtonElement ? !e.disabled && e.type === "submit" : e instanceof HTMLInputElement && !e.disabled && e.type === "submit" : !0;
|
|
2004
2009
|
}
|
|
2005
|
-
function
|
|
2010
|
+
function ye(e) {
|
|
2006
2011
|
queueMicrotask(() => {
|
|
2007
2012
|
if (!e) {
|
|
2008
2013
|
window.scrollTo?.(0, 0);
|
|
@@ -2017,13 +2022,13 @@ function pe(e) {
|
|
|
2017
2022
|
document.getElementById(t)?.scrollIntoView?.();
|
|
2018
2023
|
});
|
|
2019
2024
|
}
|
|
2020
|
-
function
|
|
2025
|
+
function Kn(e, t) {
|
|
2021
2026
|
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.altKey || e.ctrlKey || e.shiftKey || t.download !== void 0 && t.download !== !1 || t.target !== void 0 && t.target.toLowerCase() !== "_self")
|
|
2022
2027
|
return !1;
|
|
2023
2028
|
const r = new URL(t.to, window.location.href);
|
|
2024
2029
|
return (r.protocol === "http:" || r.protocol === "https:") && r.origin === window.location.origin;
|
|
2025
2030
|
}
|
|
2026
|
-
function
|
|
2031
|
+
function Wn(e, t) {
|
|
2027
2032
|
const r = t?.announce ?? "title";
|
|
2028
2033
|
if (r === !1) return;
|
|
2029
2034
|
let n;
|
|
@@ -2032,12 +2037,26 @@ function jn(e, t) {
|
|
|
2032
2037
|
} catch {
|
|
2033
2038
|
return;
|
|
2034
2039
|
}
|
|
2035
|
-
n &&
|
|
2040
|
+
n && Jn(n);
|
|
2041
|
+
}
|
|
2042
|
+
function Jn(e) {
|
|
2043
|
+
pr(e);
|
|
2036
2044
|
}
|
|
2037
|
-
function
|
|
2038
|
-
|
|
2045
|
+
function At(e) {
|
|
2046
|
+
return e === !0 && !window.matchMedia?.("(prefers-reduced-motion: reduce)").matches && typeof document.startViewTransition == "function";
|
|
2039
2047
|
}
|
|
2040
|
-
|
|
2048
|
+
function Gn(e) {
|
|
2049
|
+
if (typeof document.startViewTransition != "function") {
|
|
2050
|
+
e();
|
|
2051
|
+
return;
|
|
2052
|
+
}
|
|
2053
|
+
try {
|
|
2054
|
+
document.startViewTransition(() => ur(e));
|
|
2055
|
+
} catch {
|
|
2056
|
+
e();
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
const Qt = Ge({
|
|
2041
2060
|
navigation: "document",
|
|
2042
2061
|
submissionVersion: 0,
|
|
2043
2062
|
push(e) {
|
|
@@ -2055,12 +2074,12 @@ const Yt = We({
|
|
|
2055
2074
|
window.location.replace(e);
|
|
2056
2075
|
}
|
|
2057
2076
|
});
|
|
2058
|
-
function
|
|
2059
|
-
return
|
|
2077
|
+
function xe() {
|
|
2078
|
+
return Ye(Qt);
|
|
2060
2079
|
}
|
|
2061
|
-
function
|
|
2062
|
-
const o =
|
|
2063
|
-
return /* @__PURE__ */
|
|
2080
|
+
function ti({ className: e, id: t, policy: r, ...n }) {
|
|
2081
|
+
const o = Lr(n, r);
|
|
2082
|
+
return /* @__PURE__ */ kt(
|
|
2064
2083
|
"img",
|
|
2065
2084
|
{
|
|
2066
2085
|
alt: o.alt,
|
|
@@ -2077,14 +2096,14 @@ function Go({ className: e, id: t, policy: r, ...n }) {
|
|
|
2077
2096
|
}
|
|
2078
2097
|
);
|
|
2079
2098
|
}
|
|
2080
|
-
const
|
|
2099
|
+
const Yn = "https://js.sentry-cdn.com", ri = {
|
|
2081
2100
|
/**
|
|
2082
2101
|
* Plausible loads one script and posts events to its own API. The snippet
|
|
2083
2102
|
* carries configuration in `data-domain`, so no inline code is involved.
|
|
2084
2103
|
* `endpoint` accepts a same-origin path prefix for a proxied deployment.
|
|
2085
2104
|
*/
|
|
2086
2105
|
plausible(e) {
|
|
2087
|
-
const t =
|
|
2106
|
+
const t = Zn(e.domain), r = xt(e.endpoint ?? "https://plausible.io");
|
|
2088
2107
|
return {
|
|
2089
2108
|
consent: e.consent ?? !1,
|
|
2090
2109
|
domain: t,
|
|
@@ -2095,7 +2114,7 @@ const qn = "https://js.sentry-cdn.com", Yo = {
|
|
|
2095
2114
|
},
|
|
2096
2115
|
provider: "plausible",
|
|
2097
2116
|
scripts: [
|
|
2098
|
-
|
|
2117
|
+
$e({
|
|
2099
2118
|
dataApi: `${r.base}/api/event`,
|
|
2100
2119
|
dataDomain: t,
|
|
2101
2120
|
defer: !0,
|
|
@@ -2113,8 +2132,8 @@ const qn = "https://js.sentry-cdn.com", Yo = {
|
|
|
2113
2132
|
* why the integration also declares a `connect-src` need.
|
|
2114
2133
|
*/
|
|
2115
2134
|
sentry(e) {
|
|
2116
|
-
const t =
|
|
2117
|
-
e.loaderHost ??
|
|
2135
|
+
const t = eo(e.dsn), r = Qn(
|
|
2136
|
+
e.loaderHost ?? Yn,
|
|
2118
2137
|
"Sentry loader host"
|
|
2119
2138
|
);
|
|
2120
2139
|
return {
|
|
@@ -2128,7 +2147,7 @@ const qn = "https://js.sentry-cdn.com", Yo = {
|
|
|
2128
2147
|
projectId: t.projectId,
|
|
2129
2148
|
provider: "sentry",
|
|
2130
2149
|
scripts: [
|
|
2131
|
-
|
|
2150
|
+
$e({
|
|
2132
2151
|
crossOrigin: "anonymous",
|
|
2133
2152
|
needs: { connect: [t.origin] },
|
|
2134
2153
|
purpose: "error-monitoring",
|
|
@@ -2147,7 +2166,7 @@ const qn = "https://js.sentry-cdn.com", Yo = {
|
|
|
2147
2166
|
* to, and an optional same-origin entry script that starts the SDK.
|
|
2148
2167
|
*/
|
|
2149
2168
|
openTelemetry(e) {
|
|
2150
|
-
const t =
|
|
2169
|
+
const t = xt(e.endpoint), r = e.script;
|
|
2151
2170
|
if (r !== void 0 && !r.startsWith("/"))
|
|
2152
2171
|
throw new Error(
|
|
2153
2172
|
"OpenTelemetry browser instrumentation must be a same-origin script path."
|
|
@@ -2159,7 +2178,7 @@ const qn = "https://js.sentry-cdn.com", Yo = {
|
|
|
2159
2178
|
needs: r ? { connect: [t.source], script: ["'self'"] } : { connect: [t.source] },
|
|
2160
2179
|
provider: "opentelemetry",
|
|
2161
2180
|
scripts: r ? [
|
|
2162
|
-
|
|
2181
|
+
$e({
|
|
2163
2182
|
needs: { connect: [t.source] },
|
|
2164
2183
|
purpose: "observability",
|
|
2165
2184
|
src: r,
|
|
@@ -2183,13 +2202,13 @@ const qn = "https://js.sentry-cdn.com", Yo = {
|
|
|
2183
2202
|
return e.flatMap((t) => [...t.scripts]);
|
|
2184
2203
|
}
|
|
2185
2204
|
};
|
|
2186
|
-
function
|
|
2205
|
+
function Zn(e) {
|
|
2187
2206
|
const t = e.trim();
|
|
2188
2207
|
if (!t || t.includes("/") || t.includes(" "))
|
|
2189
2208
|
throw new Error("Analytics domain must be a hostname without a path.");
|
|
2190
2209
|
return t;
|
|
2191
2210
|
}
|
|
2192
|
-
function
|
|
2211
|
+
function xt(e) {
|
|
2193
2212
|
if (e.startsWith("/")) {
|
|
2194
2213
|
if (e.startsWith("//"))
|
|
2195
2214
|
throw new Error("Analytics endpoint must not be a scheme-relative URL.");
|
|
@@ -2198,10 +2217,10 @@ function St(e) {
|
|
|
2198
2217
|
source: "'self'"
|
|
2199
2218
|
};
|
|
2200
2219
|
}
|
|
2201
|
-
const t =
|
|
2220
|
+
const t = Xn(e);
|
|
2202
2221
|
return { base: t.origin, source: t.origin };
|
|
2203
2222
|
}
|
|
2204
|
-
function
|
|
2223
|
+
function Xn(e) {
|
|
2205
2224
|
let t;
|
|
2206
2225
|
try {
|
|
2207
2226
|
t = new URL(e);
|
|
@@ -2212,7 +2231,7 @@ function Wn(e) {
|
|
|
2212
2231
|
throw new Error("Analytics endpoint must use HTTPS.");
|
|
2213
2232
|
return t;
|
|
2214
2233
|
}
|
|
2215
|
-
function
|
|
2234
|
+
function Qn(e, t) {
|
|
2216
2235
|
let r;
|
|
2217
2236
|
try {
|
|
2218
2237
|
r = new URL(e);
|
|
@@ -2223,7 +2242,7 @@ function Jn(e, t) {
|
|
|
2223
2242
|
throw new Error(`${t} must use HTTPS.`);
|
|
2224
2243
|
return r.origin;
|
|
2225
2244
|
}
|
|
2226
|
-
function
|
|
2245
|
+
function eo(e) {
|
|
2227
2246
|
let t;
|
|
2228
2247
|
try {
|
|
2229
2248
|
t = new URL(e);
|
|
@@ -2245,60 +2264,60 @@ function Gn(e) {
|
|
|
2245
2264
|
publicKey: t.username
|
|
2246
2265
|
};
|
|
2247
2266
|
}
|
|
2248
|
-
function
|
|
2267
|
+
function ni(e = {}) {
|
|
2249
2268
|
return {
|
|
2250
2269
|
async request(t) {
|
|
2251
|
-
await
|
|
2270
|
+
await ge({ kind: "request", signal: t }, e);
|
|
2252
2271
|
},
|
|
2253
2272
|
async serverStart(t = {}) {
|
|
2254
|
-
await
|
|
2273
|
+
await ge({ kind: "server-start", signal: t }, e);
|
|
2255
2274
|
},
|
|
2256
2275
|
async trace(t) {
|
|
2257
|
-
await
|
|
2276
|
+
await ge({ kind: "trace", signal: t }, e);
|
|
2258
2277
|
},
|
|
2259
2278
|
async reportWebVitals(t) {
|
|
2260
|
-
await
|
|
2279
|
+
await ge({ kind: "web-vital", signal: t }, e);
|
|
2261
2280
|
}
|
|
2262
2281
|
};
|
|
2263
2282
|
}
|
|
2264
|
-
async function
|
|
2283
|
+
async function ge(e, t) {
|
|
2265
2284
|
await t.onEvent?.(e), e.kind === "request" ? await t.request?.(e.signal) : e.kind === "server-start" ? await t.serverStart?.(e.signal) : e.kind === "trace" ? await t.trace?.(e.signal) : await t.webVitals?.(e.signal);
|
|
2266
2285
|
}
|
|
2267
|
-
const
|
|
2286
|
+
const to = [
|
|
2268
2287
|
"CLS",
|
|
2269
2288
|
"FCP",
|
|
2270
2289
|
"FID",
|
|
2271
2290
|
"INP",
|
|
2272
2291
|
"LCP",
|
|
2273
2292
|
"TTFB"
|
|
2274
|
-
],
|
|
2293
|
+
], He = [
|
|
2275
2294
|
"CLS",
|
|
2276
2295
|
"FCP",
|
|
2277
2296
|
"INP",
|
|
2278
2297
|
"LCP",
|
|
2279
2298
|
"TTFB"
|
|
2280
|
-
],
|
|
2299
|
+
], ro = new Set(to), no = /* @__PURE__ */ new Set([
|
|
2281
2300
|
"back-forward",
|
|
2282
2301
|
"back-forward-cache",
|
|
2283
2302
|
"navigate",
|
|
2284
2303
|
"prerender",
|
|
2285
2304
|
"reload",
|
|
2286
2305
|
"restore"
|
|
2287
|
-
]),
|
|
2306
|
+
]), oo = /* @__PURE__ */ new Set([
|
|
2288
2307
|
"good",
|
|
2289
2308
|
"needs-improvement",
|
|
2290
2309
|
"poor"
|
|
2291
2310
|
]);
|
|
2292
|
-
function
|
|
2293
|
-
return typeof e == "string" &&
|
|
2311
|
+
function io(e) {
|
|
2312
|
+
return typeof e == "string" && ro.has(e);
|
|
2294
2313
|
}
|
|
2295
|
-
function
|
|
2296
|
-
return typeof e == "string" &&
|
|
2314
|
+
function ao(e) {
|
|
2315
|
+
return typeof e == "string" && no.has(e);
|
|
2297
2316
|
}
|
|
2298
|
-
function
|
|
2299
|
-
return typeof e == "string" &&
|
|
2317
|
+
function so(e) {
|
|
2318
|
+
return typeof e == "string" && oo.has(e);
|
|
2300
2319
|
}
|
|
2301
|
-
const
|
|
2320
|
+
const co = {
|
|
2302
2321
|
CLS: { good: 0.1, poor: 0.25 },
|
|
2303
2322
|
FCP: { good: 1800, poor: 3e3 },
|
|
2304
2323
|
FID: { good: 100, poor: 300 },
|
|
@@ -2306,13 +2325,13 @@ const no = {
|
|
|
2306
2325
|
LCP: { good: 2500, poor: 4e3 },
|
|
2307
2326
|
TTFB: { good: 800, poor: 1800 }
|
|
2308
2327
|
};
|
|
2309
|
-
function
|
|
2310
|
-
const r =
|
|
2328
|
+
function uo(e, t) {
|
|
2329
|
+
const r = co[e];
|
|
2311
2330
|
return t <= r.good ? "good" : t > r.poor ? "poor" : "needs-improvement";
|
|
2312
2331
|
}
|
|
2313
|
-
const
|
|
2314
|
-
function
|
|
2315
|
-
const t =
|
|
2332
|
+
const er = 32;
|
|
2333
|
+
function oi(e) {
|
|
2334
|
+
const t = ho(e.endpoint), r = po(e.metrics), n = mo(e.sampleRate);
|
|
2316
2335
|
return {
|
|
2317
2336
|
endpoint: t.url,
|
|
2318
2337
|
kind: "web-vitals",
|
|
@@ -2321,45 +2340,45 @@ function Xo(e) {
|
|
|
2321
2340
|
sampleRate: n
|
|
2322
2341
|
};
|
|
2323
2342
|
}
|
|
2324
|
-
function
|
|
2343
|
+
function ii(...e) {
|
|
2325
2344
|
const t = /* @__PURE__ */ new Set();
|
|
2326
2345
|
for (const r of e)
|
|
2327
2346
|
for (const n of r.needs.connect ?? [])
|
|
2328
2347
|
t.add(n);
|
|
2329
2348
|
return t.size === 0 ? { security: { needs: {} } } : { security: { needs: { connect: [...t] } } };
|
|
2330
2349
|
}
|
|
2331
|
-
async function
|
|
2332
|
-
const r = t.maxMetrics ??
|
|
2350
|
+
async function ai(e, t = {}) {
|
|
2351
|
+
const r = t.maxMetrics ?? er;
|
|
2333
2352
|
let n;
|
|
2334
2353
|
try {
|
|
2335
2354
|
n = await e.json();
|
|
2336
2355
|
} catch {
|
|
2337
2356
|
return { ok: !1, reason: "unreadable-body" };
|
|
2338
2357
|
}
|
|
2339
|
-
return
|
|
2358
|
+
return lo(n, r);
|
|
2340
2359
|
}
|
|
2341
|
-
function
|
|
2342
|
-
if (!
|
|
2360
|
+
function lo(e, t = er) {
|
|
2361
|
+
if (!Qe(e) || !Array.isArray(e.metrics))
|
|
2343
2362
|
return { ok: !1, reason: "invalid-payload" };
|
|
2344
2363
|
if (e.metrics.length > t)
|
|
2345
2364
|
return { ok: !1, reason: "too-many-metrics" };
|
|
2346
2365
|
const r = [];
|
|
2347
2366
|
for (const n of e.metrics) {
|
|
2348
|
-
const o =
|
|
2367
|
+
const o = fo(n);
|
|
2349
2368
|
if (!o)
|
|
2350
2369
|
return { ok: !1, reason: "invalid-payload" };
|
|
2351
2370
|
r.push(o);
|
|
2352
2371
|
}
|
|
2353
2372
|
return { metrics: r, ok: !0 };
|
|
2354
2373
|
}
|
|
2355
|
-
function
|
|
2356
|
-
if (!
|
|
2374
|
+
function fo(e) {
|
|
2375
|
+
if (!Qe(e))
|
|
2357
2376
|
return;
|
|
2358
2377
|
const { id: t, name: r, navigationType: n, rating: o, url: i, value: s } = e;
|
|
2359
|
-
if (!(typeof t != "string" || t.length === 0 || t.length > 128) && !(!
|
|
2378
|
+
if (!(typeof t != "string" || t.length === 0 || t.length > 128) && !(!io(r) || !ao(n)) && so(o) && !(typeof i != "string" || i.length === 0 || i.length > 2048) && !(typeof s != "number" || !Number.isFinite(s) || s < 0))
|
|
2360
2379
|
return { id: t, name: r, navigationType: n, rating: o, url: i, value: s };
|
|
2361
2380
|
}
|
|
2362
|
-
function
|
|
2381
|
+
function ho(e) {
|
|
2363
2382
|
if (e.startsWith("/")) {
|
|
2364
2383
|
if (e.startsWith("//"))
|
|
2365
2384
|
throw new Error(
|
|
@@ -2379,14 +2398,14 @@ function so(e) {
|
|
|
2379
2398
|
throw new Error("The web vitals endpoint must use HTTPS.");
|
|
2380
2399
|
return { source: t.origin, url: t.href };
|
|
2381
2400
|
}
|
|
2382
|
-
function
|
|
2401
|
+
function po(e) {
|
|
2383
2402
|
if (!e)
|
|
2384
|
-
return
|
|
2403
|
+
return He;
|
|
2385
2404
|
const t = [];
|
|
2386
2405
|
for (const r of e) {
|
|
2387
|
-
if (!
|
|
2406
|
+
if (!He.includes(r))
|
|
2388
2407
|
throw new Error(
|
|
2389
|
-
`The browser collector does not measure ${JSON.stringify(r)}. Demiurge collects ${
|
|
2408
|
+
`The browser collector does not measure ${JSON.stringify(r)}. Demiurge collects ${He.join(", ")}.`
|
|
2390
2409
|
);
|
|
2391
2410
|
t.includes(r) || t.push(r);
|
|
2392
2411
|
}
|
|
@@ -2394,15 +2413,15 @@ function co(e) {
|
|
|
2394
2413
|
throw new Error("A web vitals integration must collect one metric or more.");
|
|
2395
2414
|
return t;
|
|
2396
2415
|
}
|
|
2397
|
-
function
|
|
2416
|
+
function mo(e) {
|
|
2398
2417
|
if (e === void 0)
|
|
2399
2418
|
return 1;
|
|
2400
2419
|
if (!Number.isFinite(e) || e < 0 || e > 1)
|
|
2401
2420
|
throw new Error("The web vitals sample rate must be between 0 and 1.");
|
|
2402
2421
|
return e;
|
|
2403
2422
|
}
|
|
2404
|
-
const
|
|
2405
|
-
function
|
|
2423
|
+
const yo = 1e3, go = 5e3, wo = 40;
|
|
2424
|
+
function vo(e, t = {}) {
|
|
2406
2425
|
if (typeof window > "u" || typeof PerformanceObserver > "u")
|
|
2407
2426
|
return () => {
|
|
2408
2427
|
};
|
|
@@ -2410,8 +2429,8 @@ function po(e, t = {}) {
|
|
|
2410
2429
|
if (e.sampleRate < 1 && r() >= e.sampleRate)
|
|
2411
2430
|
return () => {
|
|
2412
2431
|
};
|
|
2413
|
-
const n = t.transport ??
|
|
2414
|
-
let
|
|
2432
|
+
const n = t.transport ?? bo, o = new Set(e.metrics), i = [], s = [], a = /* @__PURE__ */ new Set();
|
|
2433
|
+
let l = So(), d = 0, v = 0, A = 0, h = 0, p, E, g = !1;
|
|
2415
2434
|
const b = (w, $) => {
|
|
2416
2435
|
if (g || a.has(w))
|
|
2417
2436
|
return;
|
|
@@ -2419,68 +2438,68 @@ function po(e, t = {}) {
|
|
|
2419
2438
|
const C = {
|
|
2420
2439
|
id: `${w}-${Date.now()}-${Math.floor(r() * 1e9)}`,
|
|
2421
2440
|
name: w,
|
|
2422
|
-
navigationType:
|
|
2423
|
-
rating:
|
|
2441
|
+
navigationType: l,
|
|
2442
|
+
rating: uo(w, $),
|
|
2424
2443
|
url: window.location.href,
|
|
2425
2444
|
value: Math.round($ * 1e3) / 1e3
|
|
2426
2445
|
};
|
|
2427
2446
|
s.push(C), t.onReport?.(C);
|
|
2428
|
-
},
|
|
2447
|
+
}, y = () => {
|
|
2429
2448
|
if (g || (p !== void 0 && b("LCP", p), E !== void 0 && b("INP", E), o.has("CLS") && b("CLS", d), s.length === 0))
|
|
2430
2449
|
return;
|
|
2431
2450
|
const w = s.splice(0, s.length);
|
|
2432
2451
|
n(e.endpoint, { metrics: w });
|
|
2433
2452
|
}, T = () => {
|
|
2434
|
-
document.visibilityState === "hidden" &&
|
|
2453
|
+
document.visibilityState === "hidden" && y();
|
|
2435
2454
|
}, H = (w) => {
|
|
2436
|
-
w.persisted && (
|
|
2455
|
+
w.persisted && (l = "back-forward-cache", a.clear(), d = 0, v = 0, A = 0, h = 0, p = void 0, E = void 0, o.has("FCP") && b("FCP", performance.now() - w.timeStamp));
|
|
2437
2456
|
};
|
|
2438
2457
|
if (o.has("TTFB")) {
|
|
2439
|
-
const w =
|
|
2458
|
+
const w = tr();
|
|
2440
2459
|
w && w.responseStart > 0 && b("TTFB", w.responseStart);
|
|
2441
2460
|
}
|
|
2442
|
-
return o.has("FCP") &&
|
|
2461
|
+
return o.has("FCP") && we(i, { buffered: !0, type: "paint" }, (w) => {
|
|
2443
2462
|
for (const $ of w)
|
|
2444
2463
|
$.name === "first-contentful-paint" && b("FCP", $.startTime);
|
|
2445
|
-
}), o.has("LCP") &&
|
|
2464
|
+
}), o.has("LCP") && we(
|
|
2446
2465
|
i,
|
|
2447
2466
|
{ buffered: !0, type: "largest-contentful-paint" },
|
|
2448
2467
|
(w) => {
|
|
2449
2468
|
const $ = w.at(-1);
|
|
2450
2469
|
$ && (p = $.startTime);
|
|
2451
2470
|
}
|
|
2452
|
-
), o.has("CLS") &&
|
|
2471
|
+
), o.has("CLS") && we(i, { buffered: !0, type: "layout-shift" }, (w) => {
|
|
2453
2472
|
for (const $ of w) {
|
|
2454
2473
|
const C = $;
|
|
2455
2474
|
if (C.hadRecentInput)
|
|
2456
2475
|
continue;
|
|
2457
|
-
v > 0 && C.startTime - h <
|
|
2476
|
+
v > 0 && C.startTime - h < yo && C.startTime - A < go ? v += C.value : (v = C.value, A = C.startTime), h = C.startTime, d = Math.max(d, v);
|
|
2458
2477
|
}
|
|
2459
|
-
}), o.has("INP") &&
|
|
2478
|
+
}), o.has("INP") && we(
|
|
2460
2479
|
i,
|
|
2461
2480
|
{
|
|
2462
2481
|
buffered: !0,
|
|
2463
|
-
durationThreshold:
|
|
2482
|
+
durationThreshold: wo,
|
|
2464
2483
|
type: "event"
|
|
2465
2484
|
},
|
|
2466
2485
|
(w) => {
|
|
2467
2486
|
for (const $ of w)
|
|
2468
2487
|
E = Math.max(E ?? 0, $.duration);
|
|
2469
2488
|
}
|
|
2470
|
-
), document.addEventListener("visibilitychange", T), window.addEventListener("pagehide",
|
|
2471
|
-
|
|
2489
|
+
), document.addEventListener("visibilitychange", T), window.addEventListener("pagehide", y), window.addEventListener("pageshow", H), () => {
|
|
2490
|
+
y(), g = !0;
|
|
2472
2491
|
for (const w of i)
|
|
2473
2492
|
w.disconnect();
|
|
2474
|
-
document.removeEventListener("visibilitychange", T), window.removeEventListener("pagehide",
|
|
2493
|
+
document.removeEventListener("visibilitychange", T), window.removeEventListener("pagehide", y), window.removeEventListener("pageshow", H);
|
|
2475
2494
|
};
|
|
2476
2495
|
}
|
|
2477
|
-
function
|
|
2478
|
-
return
|
|
2479
|
-
() =>
|
|
2496
|
+
function si({ integration: e, onReport: t, transport: r }) {
|
|
2497
|
+
return X(
|
|
2498
|
+
() => vo(e, { onReport: t, transport: r }),
|
|
2480
2499
|
[e, t, r]
|
|
2481
2500
|
), null;
|
|
2482
2501
|
}
|
|
2483
|
-
function
|
|
2502
|
+
function bo(e, t) {
|
|
2484
2503
|
const r = JSON.stringify(t);
|
|
2485
2504
|
if (typeof navigator < "u" && typeof navigator.sendBeacon == "function") {
|
|
2486
2505
|
const n = new Blob([r], { type: "application/json" });
|
|
@@ -2495,7 +2514,7 @@ function mo(e, t) {
|
|
|
2495
2514
|
}).catch(() => {
|
|
2496
2515
|
});
|
|
2497
2516
|
}
|
|
2498
|
-
function
|
|
2517
|
+
function we(e, t, r) {
|
|
2499
2518
|
try {
|
|
2500
2519
|
const n = new PerformanceObserver((o) => r(o.getEntries()));
|
|
2501
2520
|
n.observe(t), e.push(n);
|
|
@@ -2503,204 +2522,204 @@ function ye(e, t, r) {
|
|
|
2503
2522
|
return;
|
|
2504
2523
|
}
|
|
2505
2524
|
}
|
|
2506
|
-
function
|
|
2525
|
+
function tr() {
|
|
2507
2526
|
if (!(typeof performance > "u"))
|
|
2508
2527
|
return performance.getEntriesByType("navigation")[0];
|
|
2509
2528
|
}
|
|
2510
|
-
function
|
|
2511
|
-
const e =
|
|
2529
|
+
function So() {
|
|
2530
|
+
const e = tr();
|
|
2512
2531
|
return e?.type === "back_forward" ? "back-forward" : e?.type === "reload" || e?.type === "prerender" ? e.type : "navigate";
|
|
2513
2532
|
}
|
|
2514
2533
|
export {
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2534
|
+
He as COLLECTED_WEB_VITAL_NAMES,
|
|
2535
|
+
Ei as CacheNotFoundError,
|
|
2536
|
+
ns as DEFAULT_CONTENT_TYPE,
|
|
2537
|
+
Ai as DEFAULT_MAX_BODY_SIZE,
|
|
2538
|
+
xi as EnvValidationError,
|
|
2539
|
+
li as FRAMEWORK_TRUSTED_TYPES_POLICY,
|
|
2540
|
+
Xo as Form,
|
|
2541
|
+
Tr as HTTP_ERROR_STATUSES,
|
|
2542
|
+
ki as HttpError,
|
|
2543
|
+
ti as Image,
|
|
2544
|
+
Zo as Link,
|
|
2545
|
+
vr as MUTATION_REQUEST_HEADER,
|
|
2546
|
+
wr as MUTATION_REQUEST_VALUE,
|
|
2547
|
+
Tt as MUTATION_RESPONSE_MEDIA_TYPE,
|
|
2548
|
+
Qo as MutationSubmit,
|
|
2549
|
+
Ri as MutationValidationError,
|
|
2550
|
+
Jo as RouteFocusBoundary,
|
|
2551
|
+
Ti as RouteSerializationError,
|
|
2552
|
+
di as Script,
|
|
2553
|
+
sn as SessionStoreConflictError,
|
|
2554
|
+
gt as SessionStoreUnavailableError,
|
|
2555
|
+
to as WEB_VITAL_NAMES,
|
|
2556
|
+
co as WEB_VITAL_THRESHOLDS,
|
|
2557
|
+
si as WebVitals,
|
|
2558
|
+
ri as analytics,
|
|
2559
|
+
ze as applicationPathname,
|
|
2560
|
+
Mi as applyFetchMetadataVary,
|
|
2561
|
+
Ci as applyLocalizedMetadata,
|
|
2562
|
+
fi as assertAdapterCapabilities,
|
|
2563
|
+
$i as attachExceptionSource,
|
|
2564
|
+
Ni as auditScriptDependencies,
|
|
2565
|
+
Li as authorizeRoute,
|
|
2566
|
+
Ii as cacheNotFound,
|
|
2567
|
+
hi as checkAdapterCapabilities,
|
|
2568
|
+
Di as checkFetchMetadata,
|
|
2569
|
+
En as checkWebSocketOrigin,
|
|
2570
|
+
vo as collectWebVitals,
|
|
2571
|
+
os as contentTypeForExtension,
|
|
2572
|
+
Pi as createCache,
|
|
2573
|
+
Oi as createCorsHeaders,
|
|
2574
|
+
_i as createCsrfCookie,
|
|
2575
|
+
Fi as createCsrfToken,
|
|
2576
|
+
Vo as createEncryptedCookieSession,
|
|
2577
|
+
Ln as createFileRouter,
|
|
2578
|
+
pi as createFrameworkScriptUrl,
|
|
2579
|
+
Ui as createInvalidation,
|
|
2580
|
+
Bi as createMemoryCache,
|
|
2581
|
+
Hi as createMemoryCacheStore,
|
|
2582
|
+
Oo as createMemoryIdempotencyStore,
|
|
2583
|
+
zi as createMemoryRateLimitStore,
|
|
2584
|
+
Ms as createMemorySessionStore,
|
|
2585
|
+
Tn as createMutationAction,
|
|
2586
|
+
Vi as createRequestHandler,
|
|
2587
|
+
Ae as createSecureCookie,
|
|
2569
2588
|
ji as createSecurityAudit,
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2589
|
+
qi as createSecurityHeaders,
|
|
2590
|
+
qo as createSecurityReportHandler,
|
|
2591
|
+
jo as createSessionManager,
|
|
2592
|
+
zo as createSignedCookieSession,
|
|
2593
|
+
Ki as cspHash,
|
|
2594
|
+
Wi as cspNonce,
|
|
2595
|
+
hs as defaultFontPath,
|
|
2596
|
+
mi as defineAdapter,
|
|
2597
|
+
Ji as defineAuthorization,
|
|
2598
|
+
Gi as defineEnvSchema,
|
|
2599
|
+
ps as defineFonts,
|
|
2600
|
+
ms as defineImages,
|
|
2601
|
+
ni as defineInstrumentation,
|
|
2602
|
+
ss as defineLinks,
|
|
2603
|
+
Yi as defineLocales,
|
|
2604
|
+
Zi as defineMetadata,
|
|
2605
|
+
Uo as defineMiddleware,
|
|
2606
|
+
Io as defineOgImage,
|
|
2607
|
+
Lo as defineRobots,
|
|
2608
|
+
Xi as defineRoutePolicy,
|
|
2609
|
+
yi as defineScripts,
|
|
2610
|
+
Qi as defineSecurityPolicy,
|
|
2611
|
+
$o as defineSitemap,
|
|
2612
|
+
ea as defineTags,
|
|
2613
|
+
oi as defineWebVitals,
|
|
2614
|
+
ta as deserializeEnvSchema,
|
|
2615
|
+
ra as enforceAllowedMethods,
|
|
2616
|
+
na as enforceCsrfProtection,
|
|
2617
|
+
oa as enforceFetchMetadataPolicy,
|
|
2618
|
+
ia as enforceRateLimit,
|
|
2619
|
+
aa as enforceRequestSecurity,
|
|
2620
|
+
Wo as enforceWebSocketOrigin,
|
|
2621
|
+
sa as env,
|
|
2622
|
+
ys as font,
|
|
2623
|
+
gs as fontAssetFileName,
|
|
2624
|
+
ws as fontAssetUrl,
|
|
2625
|
+
vs as fontLinks,
|
|
2626
|
+
bs as fontMediaType,
|
|
2627
|
+
Ss as fontPreloadLinks,
|
|
2628
|
+
Es as fontSources,
|
|
2629
|
+
As as fontStylesheetUrl,
|
|
2630
|
+
ca as getBodySizeException,
|
|
2631
|
+
ua as getCspException,
|
|
2632
|
+
la as getCsrfException,
|
|
2633
|
+
gi as getRequestClientAddress,
|
|
2634
|
+
wi as getScriptWorker,
|
|
2635
|
+
da as handleRequestWithManifest,
|
|
2636
|
+
et as href,
|
|
2637
|
+
fa as html,
|
|
2638
|
+
Mr as httpError,
|
|
2639
|
+
Yo as hydrateFileRouter,
|
|
2640
|
+
xs as isAllowedImageSource,
|
|
2641
|
+
ha as isCacheNotFoundError,
|
|
2642
|
+
is as isContentHashedFileName,
|
|
2643
|
+
$r as isHttpError,
|
|
2644
|
+
pa as isSecurityException,
|
|
2645
|
+
ma as issueCsrfToken,
|
|
2646
|
+
ya as json,
|
|
2647
|
+
ga as jsonl,
|
|
2648
|
+
wa as link,
|
|
2649
|
+
va as localeDirection,
|
|
2650
|
+
tt as localizeHref,
|
|
2651
|
+
ba as mergeRouteAccess,
|
|
2652
|
+
Sa as mergeRoutePolicies,
|
|
2653
|
+
Ea as mergeRouteSecurityPolicies,
|
|
2654
|
+
Aa as mergeSecurityPolicies,
|
|
2655
|
+
xa as meta,
|
|
2656
|
+
cs as modulePreload,
|
|
2657
|
+
ka as mutation,
|
|
2658
|
+
Ra as mutationInput,
|
|
2659
|
+
Ta as notFound,
|
|
2660
|
+
Fo as page,
|
|
2661
|
+
Xe as parseBodySize,
|
|
2662
|
+
lt as parseCacheDuration,
|
|
2663
|
+
Ze as parseCookieHeader,
|
|
2664
|
+
ks as parseImageOptimizerRequest,
|
|
2665
|
+
Ma as parseRateLimitWindow,
|
|
2666
|
+
lo as parseWebVitalsBeacon,
|
|
2667
|
+
Ca as permitsRequest,
|
|
2668
|
+
Lr as planImageTransform,
|
|
2669
|
+
us as preconnect,
|
|
2670
|
+
ls as preload,
|
|
2671
|
+
$a as query,
|
|
2672
|
+
Na as readEnv,
|
|
2673
|
+
Ho as readSecureCookie,
|
|
2674
|
+
ai as readWebVitalsBeacon,
|
|
2675
|
+
La as redirect,
|
|
2676
|
+
Rs as renderFontFaceCss,
|
|
2677
|
+
Po as renderOgImageResponse,
|
|
2678
|
+
Dr as renderOgImageSvg,
|
|
2679
|
+
vi as renderPageResponse,
|
|
2680
|
+
Do as renderRobots,
|
|
2681
|
+
No as renderSitemap,
|
|
2682
|
+
Ia as resolveCsp,
|
|
2683
|
+
Da as resolveCsrf,
|
|
2684
|
+
ds as resolveLinks,
|
|
2685
|
+
Sr as resolveLocale,
|
|
2686
|
+
Pa as resolveMaxBodySize,
|
|
2687
|
+
Oa as resolveMetadata,
|
|
2688
|
+
_a as resolveRouteAccess,
|
|
2689
|
+
bi as resolveScripts,
|
|
2690
|
+
Fa as response,
|
|
2691
|
+
_o as runIdempotentMutation,
|
|
2692
|
+
$e as script,
|
|
2693
|
+
le as secureCookieName,
|
|
2694
|
+
Ua as security,
|
|
2695
|
+
bo as sendWebVitalsBeacon,
|
|
2696
|
+
mr as serializeCacheKey,
|
|
2697
|
+
Ba as serializeCacheNamespace,
|
|
2698
|
+
Ha as serializeCacheTag,
|
|
2699
|
+
za as serializeEnvSchema,
|
|
2700
|
+
Cs as serializeSessionNamespace,
|
|
2701
|
+
Va as serverTiming,
|
|
2683
2702
|
ja as sse,
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2703
|
+
ut as startDeferredScripts,
|
|
2704
|
+
qa as stream,
|
|
2705
|
+
Ka as structuredData,
|
|
2706
|
+
Wa as tag,
|
|
2707
|
+
Ja as text,
|
|
2708
|
+
Ga as toResponse,
|
|
2709
|
+
Ya as unstable_resetEnvironment,
|
|
2710
|
+
Za as unstable_startEnvironment,
|
|
2711
|
+
ei as useFormNavigation,
|
|
2712
|
+
Go as useMutationAction,
|
|
2713
|
+
_n as useNavigation,
|
|
2714
|
+
kn as useRouteFocusBoundary,
|
|
2715
|
+
Xa as validateCorsPolicy,
|
|
2716
|
+
Qa as validateEnv,
|
|
2717
|
+
es as validateRateLimitPolicy,
|
|
2718
|
+
ts as validateRouteModules,
|
|
2719
|
+
Jr as validateSecureCookie,
|
|
2720
|
+
Ko as validateUploads,
|
|
2721
|
+
uo as webVitalRating,
|
|
2722
|
+
ii as webVitalsPolicy,
|
|
2723
|
+
Bo as webhook
|
|
2705
2724
|
};
|
|
2706
2725
|
//# sourceMappingURL=index.js.map
|