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