@demiurgejs/core 0.2.0-beta.2 → 0.2.0-beta.3

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.
Files changed (106) hide show
  1. package/dist/adapter/testing.js.map +1 -1
  2. package/dist/browser/file-router.d.ts.map +1 -1
  3. package/dist/chunks/{document-shell-D1xo6cEA.js → document-shell-WoM8yZlR.js} +2 -2
  4. package/dist/chunks/{document-shell-D1xo6cEA.js.map → document-shell-WoM8yZlR.js.map} +1 -1
  5. package/dist/chunks/{image-codec-BGTx_t5K.js → image-codec-Di53WpcH.js} +2 -2
  6. package/dist/chunks/{image-codec-BGTx_t5K.js.map → image-codec-Di53WpcH.js.map} +1 -1
  7. package/dist/chunks/{images-B9MqcjSA.js → images-Edar3eU1.js} +2 -2
  8. package/dist/chunks/{images-B9MqcjSA.js.map → images-Edar3eU1.js.map} +1 -1
  9. package/dist/chunks/{request-metadata-D5NrT8ks.js → request-metadata-DaIYq4Ea.js} +214 -179
  10. package/dist/chunks/request-metadata-DaIYq4Ea.js.map +1 -0
  11. package/dist/chunks/{streaming-BQ1bykDo.js → streaming-D0fGAuiO.js} +5 -5
  12. package/dist/chunks/streaming-D0fGAuiO.js.map +1 -0
  13. package/dist/chunks/{testing-B_iMFYz_.js → testing-CRflAw4X.js} +1228 -1074
  14. package/dist/chunks/testing-CRflAw4X.js.map +1 -0
  15. package/dist/data/cache.d.ts +8 -0
  16. package/dist/data/cache.d.ts.map +1 -1
  17. package/dist/data/idempotency.d.ts.map +1 -1
  18. package/dist/data/index.d.ts +3 -1
  19. package/dist/data/index.d.ts.map +1 -1
  20. package/dist/data/testing.d.ts.map +1 -1
  21. package/dist/data/testing.js +94 -72
  22. package/dist/data/testing.js.map +1 -1
  23. package/dist/data/tiered.d.ts +7 -0
  24. package/dist/data/tiered.d.ts.map +1 -0
  25. package/dist/document/deferred-scripts.d.ts.map +1 -1
  26. package/dist/document/hydration.d.ts.map +1 -1
  27. package/dist/document/index.d.ts +1 -0
  28. package/dist/document/index.d.ts.map +1 -1
  29. package/dist/document/trusted-types.d.ts +10 -0
  30. package/dist/document/trusted-types.d.ts.map +1 -0
  31. package/dist/edge/index.js +3 -3
  32. package/dist/index.d.ts +6 -6
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +768 -432
  35. package/dist/index.js.map +1 -1
  36. package/dist/internal/testing.js +9 -9
  37. package/dist/kv/index.d.ts +2 -0
  38. package/dist/kv/index.d.ts.map +1 -1
  39. package/dist/kv/index.js +71 -48
  40. package/dist/kv/index.js.map +1 -1
  41. package/dist/kv/rate-limit-store.d.ts +8 -0
  42. package/dist/kv/rate-limit-store.d.ts.map +1 -0
  43. package/dist/kv/store.d.ts.map +1 -1
  44. package/dist/node/http.d.ts.map +1 -1
  45. package/dist/node/image.d.ts.map +1 -1
  46. package/dist/node/index.d.ts.map +1 -1
  47. package/dist/node/index.js +3 -3
  48. package/dist/node/index.js.map +1 -1
  49. package/dist/node/static.d.ts.map +1 -1
  50. package/dist/node/streaming.d.ts.map +1 -1
  51. package/dist/platform/images.d.ts.map +1 -1
  52. package/dist/platform/index.d.ts +5 -1
  53. package/dist/platform/index.d.ts.map +1 -1
  54. package/dist/platform/observability.d.ts +2 -1
  55. package/dist/platform/observability.d.ts.map +1 -1
  56. package/dist/platform/web-vitals-client.d.ts +32 -0
  57. package/dist/platform/web-vitals-client.d.ts.map +1 -0
  58. package/dist/platform/web-vitals.d.ts +78 -0
  59. package/dist/platform/web-vitals.d.ts.map +1 -0
  60. package/dist/redis/index.d.ts +2 -0
  61. package/dist/redis/index.d.ts.map +1 -1
  62. package/dist/redis/index.js +84 -46
  63. package/dist/redis/index.js.map +1 -1
  64. package/dist/redis/rate-limit-store.d.ts +8 -0
  65. package/dist/redis/rate-limit-store.d.ts.map +1 -0
  66. package/dist/redis/store.d.ts.map +1 -1
  67. package/dist/route/action.d.ts.map +1 -1
  68. package/dist/route/middleware.d.ts.map +1 -1
  69. package/dist/route/response.d.ts.map +1 -1
  70. package/dist/router/index.d.ts +1 -1
  71. package/dist/router/index.d.ts.map +1 -1
  72. package/dist/router/manifest.d.ts +1 -0
  73. package/dist/router/manifest.d.ts.map +1 -1
  74. package/dist/security/cookies.d.ts +26 -0
  75. package/dist/security/cookies.d.ts.map +1 -0
  76. package/dist/security/env.d.ts.map +1 -1
  77. package/dist/security/fetch-metadata.d.ts +29 -0
  78. package/dist/security/fetch-metadata.d.ts.map +1 -0
  79. package/dist/security/index.d.ts +5 -1
  80. package/dist/security/index.d.ts.map +1 -1
  81. package/dist/security/policy.d.ts.map +1 -1
  82. package/dist/security/rate-limit.d.ts +6 -3
  83. package/dist/security/rate-limit.d.ts.map +1 -1
  84. package/dist/security/request.d.ts.map +1 -1
  85. package/dist/security/types.d.ts +72 -3
  86. package/dist/security/types.d.ts.map +1 -1
  87. package/dist/server/index.d.ts +1 -1
  88. package/dist/server/index.d.ts.map +1 -1
  89. package/dist/server/request-handler.d.ts +6 -2
  90. package/dist/server/request-handler.d.ts.map +1 -1
  91. package/dist/static/index.d.ts.map +1 -1
  92. package/dist/static/index.js +4 -4
  93. package/dist/static/index.js.map +1 -1
  94. package/dist/vite/index.d.ts +3 -0
  95. package/dist/vite/index.d.ts.map +1 -1
  96. package/dist/vite/index.js +1030 -666
  97. package/dist/vite/index.js.map +1 -1
  98. package/dist/vite/plugin.d.ts +2 -0
  99. package/dist/vite/plugin.d.ts.map +1 -1
  100. package/dist/vite/policy-verification.d.ts.map +1 -1
  101. package/dist/vite/route-audit.d.ts +50 -0
  102. package/dist/vite/route-audit.d.ts.map +1 -0
  103. package/package.json +1 -1
  104. package/dist/chunks/request-metadata-D5NrT8ks.js.map +0 -1
  105. package/dist/chunks/streaming-BQ1bykDo.js.map +0 -1
  106. package/dist/chunks/testing-B_iMFYz_.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,186 +1,186 @@
1
- import { jsx as z } from "react/jsx-runtime";
2
- import { createContext as _, useState as T, useRef as I, useEffect as D, useMemo as V, createElement as f, useContext as W, Component as K } from "react";
3
- import { g as G, H as Z, h as N, i as Y, j as A } from "./chunks/request-metadata-D5NrT8ks.js";
4
- import { k as jt, l as Ft, m as Ht, d as Bt, n as qt, o as _t, q as Vt, t as Wt, u as Kt, p as Gt, a as Zt, v as Yt, w as Xt } from "./chunks/request-metadata-D5NrT8ks.js";
5
- import { p as C, l as X, n as J, t as Q, o as ee, R as te, q as $, u as re, k as M, w as ne, x as P, y as ae, N as O, z as ie, A as oe, B as se, C as ce, H as ue, D as le, E as fe, F as de } from "./chunks/testing-B_iMFYz_.js";
6
- import { G as Qt, I as er, J as tr, K as rr, L as nr, M as ar, O as ir, P as or, Q as sr, d as cr, c as ur, S as lr, f as fr, e as dr, T as mr, U as hr, V as pr, W as gr, X as wr, Y as yr, Z as vr, _ as br, $ as Sr, h as Er, a0 as Rr, a1 as Ar, a2 as xr, a3 as $r, a4 as kr, a5 as Tr, a6 as Ir, m as Dr, a7 as Nr, a8 as Cr, a9 as Or, aa as Lr, ab as zr, ac as Mr, ad as Pr, s as Ur, ae as jr, af as Fr, ag as Hr, ah as Br, ai as qr, aj as _r, ak as Vr, al as Wr, v as Kr, g as Gr, a as Zr } from "./chunks/testing-B_iMFYz_.js";
7
- import { k as me } from "./chunks/images-B9MqcjSA.js";
8
- import { d as Xr, l as Jr, m as Qr, n as en, f as tn, o as rn, q as nn, a as an, s as on, t as sn, b as cn, h as un, j as ln, r as fn } from "./chunks/images-B9MqcjSA.js";
1
+ import { jsx as V } from "react/jsx-runtime";
2
+ import { createContext as re, useState as F, useRef as z, useEffect as P, useMemo as ne, createElement as w, useContext as oe, Component as ae } from "react";
3
+ import { g as ie, H as se, h as U, i as ce, j as I } from "./chunks/request-metadata-DaIYq4Ea.js";
4
+ import { F as xr, k as Cr, l as Ir, m as Nr, n as Lr, d as Pr, o as Dr, q as Or, t as Mr, u as Fr, v as zr, p as Ur, a as Br, w as _r, x as jr } from "./chunks/request-metadata-DaIYq4Ea.js";
5
+ import { z as B, x as ue, A as le, B as fe, C as de, D as he, R as me, E as D, F as pe, y as W, G as ge, i as q, H as we, N as _, I as ye, J as ve, K as be, L as Se, O as Ee, P as Re, Q as Te, S as ke } from "./chunks/testing-CRflAw4X.js";
6
+ import { T as Vr, U as Wr, V as qr, W as Gr, X as Kr, Y as Jr, Z as Yr, _ as Zr, $ as Xr, a0 as Qr, a1 as en, u as tn, a2 as rn, d as nn, c as on, q as an, f as sn, e as cn, a3 as un, a4 as ln, a5 as fn, a6 as dn, a7 as hn, a8 as mn, a9 as pn, aa as gn, ab as wn, ac as yn, h as vn, ad as bn, ae as Sn, af as En, ag as Rn, ah as Tn, ai as kn, aj as An, ak as $n, m as xn, al as Cn, am as In, an as Nn, ao as Ln, ap as Pn, aq as Dn, s as On, ar as Mn, w as Fn, as as zn, at as Un, au as Bn, av as _n, aw as jn, ax as Hn, v as Vn, g as Wn, a as qn } from "./chunks/testing-CRflAw4X.js";
7
+ import { k as Ae } from "./chunks/images-Edar3eU1.js";
8
+ import { d as Kn, l as Jn, m as Yn, n as Zn, f as Xn, o as Qn, q as eo, a as to, s as ro, t as no, b as oo, h as ao, j as io, r as so } from "./chunks/images-Edar3eU1.js";
9
9
  import "react-dom/server";
10
- const he = "24h", pe = 1e4;
11
- function mt(e = {}) {
12
- const t = e.now ?? Date.now, r = e.defaultTtl ?? he, n = e.maximumEntries ?? pe;
10
+ const $e = "24h", xe = 1e4;
11
+ function Yt(e = {}) {
12
+ const t = e.now ?? Date.now, r = e.defaultTtl ?? $e, n = e.maximumEntries ?? xe;
13
13
  if (!Number.isSafeInteger(n) || n <= 0)
14
14
  throw new Error(
15
15
  "Demiurge idempotency maximumEntries must be a positive integer."
16
16
  );
17
- const a = C(r);
18
- if (!Number.isFinite(a))
17
+ const o = B(r);
18
+ if (!Number.isFinite(o))
19
19
  throw new Error("Demiurge idempotency defaultTtl must be finite.");
20
- const i = /* @__PURE__ */ new Map();
20
+ const a = /* @__PURE__ */ new Map();
21
21
  return {
22
- async run(s) {
23
- const o = X(s.key), u = t();
24
- ge(i, u);
25
- const d = i.get(o);
26
- if (d && (d.pending || d.expiresAt > u))
22
+ async run(i) {
23
+ const s = ue(i.key), l = t();
24
+ Ce(a, l);
25
+ const d = a.get(s);
26
+ if (d && (d.pending || d.expiresAt > l))
27
27
  return {
28
- key: o,
28
+ key: s,
29
29
  replayed: !0,
30
30
  value: await d.value
31
31
  };
32
- if (i.size >= n && we(i), i.size >= n)
32
+ if (a.size >= n && Ie(a), a.size >= n)
33
33
  throw new Error(
34
34
  "Demiurge idempotency store is at capacity with in-flight mutations."
35
35
  );
36
- const g = Promise.resolve().then(s.fn), c = {
36
+ const p = Promise.resolve().then(i.fn), c = {
37
37
  expiresAt: Number.POSITIVE_INFINITY,
38
38
  pending: !0,
39
- value: g
39
+ value: p
40
40
  };
41
- i.set(o, c);
41
+ a.set(s, c);
42
42
  try {
43
- const l = await g;
44
- return c.pending = !1, c.expiresAt = t() + C(s.ttl ?? r), {
45
- key: o,
43
+ const f = await p;
44
+ return c.pending = !1, c.expiresAt = t() + B(i.ttl ?? r), {
45
+ key: s,
46
46
  replayed: !1,
47
- value: l
47
+ value: f
48
48
  };
49
- } catch (l) {
50
- throw i.get(o) === c && i.delete(o), l;
49
+ } catch (f) {
50
+ throw a.get(s) === c && a.delete(s), f;
51
51
  }
52
52
  }
53
53
  };
54
54
  }
55
- function ge(e, t) {
55
+ function Ce(e, t) {
56
56
  for (const [r, n] of e)
57
57
  !n.pending && n.expiresAt <= t && e.delete(r);
58
58
  }
59
- function we(e) {
59
+ function Ie(e) {
60
60
  for (const [t, r] of e)
61
61
  if (!r.pending) {
62
62
  e.delete(t);
63
63
  return;
64
64
  }
65
65
  }
66
- function ht(e, t) {
66
+ function Zt(e, t) {
67
67
  return e.run(t);
68
68
  }
69
- function pt(e) {
69
+ function Xt(e) {
70
70
  return {
71
71
  entries: e
72
72
  };
73
73
  }
74
- function gt(e) {
74
+ function Qt(e) {
75
75
  return [
76
76
  '<?xml version="1.0" encoding="UTF-8"?>',
77
77
  `<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"' : ""}>`,
78
- ...e.entries.map(ve),
78
+ ...e.entries.map(Le),
79
79
  "</urlset>",
80
80
  ""
81
81
  ].join(`
82
82
  `);
83
83
  }
84
- function wt(e) {
84
+ function er(e) {
85
85
  return e;
86
86
  }
87
- function yt(e) {
87
+ function tr(e) {
88
88
  return e;
89
89
  }
90
- function vt(e) {
90
+ function rr(e) {
91
91
  const t = [];
92
92
  for (const r of e.rules ?? []) {
93
- for (const n of b(r.userAgent))
93
+ for (const n of A(r.userAgent))
94
94
  t.push(`User-agent: ${n}`);
95
- for (const n of b(r.allow))
95
+ for (const n of A(r.allow))
96
96
  t.push(`Allow: ${n}`);
97
- for (const n of b(r.disallow))
97
+ for (const n of A(r.disallow))
98
98
  t.push(`Disallow: ${n}`);
99
99
  t.push("");
100
100
  }
101
101
  e.host && t.push(`Host: ${e.host}`);
102
- for (const r of b(e.sitemap))
102
+ for (const r of A(e.sitemap))
103
103
  t.push(`Sitemap: ${r}`);
104
104
  return `${t.join(`
105
105
  `).replace(/\n+$/, "")}
106
106
  `;
107
107
  }
108
- function ye(e) {
109
- const t = e.width ?? 1200, r = e.height ?? 630, n = e.background ?? "#101820", a = e.foreground ?? "#ffffff", i = x(e.title, 120), s = e.subtitle ? x(e.subtitle, 160) : void 0, o = e.brand ? x(e.brand, 80) : void 0;
110
- return Ee(t, r), [
111
- `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${r}" viewBox="0 0 ${t} ${r}" role="img" aria-label="${p(i)}">`,
112
- ` <rect width="100%" height="100%" fill="${p(n)}" />`,
113
- o ? ` <text x="72" y="96" fill="${p(a)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="32" font-weight="700">${w(o)}</text>` : null,
114
- ` <text x="72" y="${s ? 300 : 340}" fill="${p(a)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="76" font-weight="800">${w(i)}</text>`,
115
- s ? ` <text x="72" y="392" fill="${p(a)}" fill-opacity="0.78" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="38" font-weight="500">${w(s)}</text>` : null,
108
+ function Ne(e) {
109
+ const t = e.width ?? 1200, r = e.height ?? 630, n = e.background ?? "#101820", o = e.foreground ?? "#ffffff", a = N(e.title, 120), i = e.subtitle ? N(e.subtitle, 160) : void 0, s = e.brand ? N(e.brand, 80) : void 0;
110
+ return Oe(t, r), [
111
+ `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${r}" viewBox="0 0 ${t} ${r}" role="img" aria-label="${E(a)}">`,
112
+ ` <rect width="100%" height="100%" fill="${E(n)}" />`,
113
+ s ? ` <text x="72" y="96" fill="${E(o)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="32" font-weight="700">${R(s)}</text>` : null,
114
+ ` <text x="72" y="${i ? 300 : 340}" fill="${E(o)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="76" font-weight="800">${R(a)}</text>`,
115
+ i ? ` <text x="72" y="392" fill="${E(o)}" fill-opacity="0.78" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="38" font-weight="500">${R(i)}</text>` : null,
116
116
  "</svg>"
117
- ].filter((u) => !!u).join(`
117
+ ].filter((l) => !!l).join(`
118
118
  `);
119
119
  }
120
- function bt(e) {
121
- return new Response(ye(e), {
120
+ function nr(e) {
121
+ return new Response(Ne(e), {
122
122
  headers: {
123
123
  "cache-control": "public, max-age=31536000, immutable",
124
124
  "content-type": "image/svg+xml; charset=utf-8"
125
125
  }
126
126
  });
127
127
  }
128
- function ve(e) {
128
+ function Le(e) {
129
129
  return [
130
130
  " <url>",
131
- ` <loc>${w(e.url)}</loc>`,
132
- e.lastModified ? ` <lastmod>${w(be(e.lastModified))}</lastmod>` : null,
131
+ ` <loc>${R(e.url)}</loc>`,
132
+ e.lastModified ? ` <lastmod>${R(Pe(e.lastModified))}</lastmod>` : null,
133
133
  e.changeFrequency ? ` <changefreq>${e.changeFrequency}</changefreq>` : null,
134
- e.priority !== void 0 ? ` <priority>${Se(e.priority)}</priority>` : null,
134
+ e.priority !== void 0 ? ` <priority>${De(e.priority)}</priority>` : null,
135
135
  ...(e.alternates ?? []).map(
136
- (t) => ` <xhtml:link rel="alternate" hreflang="${p(t.hrefLang)}" href="${p(t.href)}" />`
136
+ (t) => ` <xhtml:link rel="alternate" hreflang="${E(t.hrefLang)}" href="${E(t.href)}" />`
137
137
  ),
138
138
  " </url>"
139
139
  ].filter((t) => !!t).join(`
140
140
  `);
141
141
  }
142
- function be(e) {
142
+ function Pe(e) {
143
143
  return e instanceof Date ? e.toISOString() : e;
144
144
  }
145
- function Se(e) {
145
+ function De(e) {
146
146
  if (e < 0 || e > 1)
147
147
  throw new Error("Sitemap entry priority must be between 0 and 1.");
148
148
  return String(e);
149
149
  }
150
- function b(e) {
150
+ function A(e) {
151
151
  return e === void 0 ? [] : Array.isArray(e) ? e : [e];
152
152
  }
153
- function w(e) {
153
+ function R(e) {
154
154
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
155
155
  }
156
- function p(e) {
157
- return w(e).replaceAll('"', "&quot;").replaceAll("'", "&apos;");
156
+ function E(e) {
157
+ return R(e).replaceAll('"', "&quot;").replaceAll("'", "&apos;");
158
158
  }
159
- function x(e, t) {
159
+ function N(e, t) {
160
160
  return e.length > t ? `${e.slice(0, t - 3)}...` : e;
161
161
  }
162
- function Ee(e, t) {
162
+ function Oe(e, t) {
163
163
  if (!Number.isSafeInteger(e) || e <= 0)
164
164
  throw new Error("OG image width must be a positive integer.");
165
165
  if (!Number.isSafeInteger(t) || t <= 0)
166
166
  throw new Error("OG image height must be a positive integer.");
167
167
  }
168
- function St(e) {
169
- return J(
168
+ function or(e) {
169
+ return le(
170
170
  async (t) => {
171
171
  const r = e.input ? await e.input(t) : void 0, n = {
172
172
  ...t,
173
173
  input: r
174
- }, a = async () => await Re(
174
+ }, o = async () => await Me(
175
175
  await e.handler(n),
176
176
  t
177
177
  );
178
178
  if (!e.idempotency)
179
- return await a();
180
- const i = typeof e.idempotency.key == "function" ? e.idempotency.key(n) : e.idempotency.key;
179
+ return await o();
180
+ const a = typeof e.idempotency.key == "function" ? e.idempotency.key(n) : e.idempotency.key;
181
181
  return (await e.idempotency.store.run({
182
- fn: a,
183
- key: i,
182
+ fn: o,
183
+ key: a,
184
184
  ttl: e.idempotency.ttl
185
185
  })).value;
186
186
  },
@@ -191,7 +191,7 @@ function St(e) {
191
191
  }
192
192
  );
193
193
  }
194
- const Et = {
194
+ const ar = {
195
195
  async formData({ request: e }) {
196
196
  return await e.formData();
197
197
  },
@@ -202,10 +202,10 @@ const Et = {
202
202
  return await e.text();
203
203
  }
204
204
  };
205
- async function Re(e, t) {
206
- return e instanceof Response ? e : await Q(e, t);
205
+ async function Me(e, t) {
206
+ return e instanceof Response ? e : await fe(e, t);
207
207
  }
208
- function Rt(e) {
208
+ function ir(e) {
209
209
  return typeof e == "function" ? {
210
210
  kind: "page",
211
211
  render: { mode: "ssr" },
@@ -218,10 +218,10 @@ function Rt(e) {
218
218
  view: e.view
219
219
  };
220
220
  }
221
- function At(e) {
221
+ function sr(e) {
222
222
  return e;
223
223
  }
224
- const xt = {
224
+ const cr = {
225
225
  hmac(e) {
226
226
  return {
227
227
  kind: "response",
@@ -229,7 +229,7 @@ const xt = {
229
229
  const r = new Uint8Array(await t.request.arrayBuffer()), n = t.request.headers.get(
230
230
  e.header ?? "x-webhook-signature"
231
231
  );
232
- return n ? await Ae(r, n, e) ? await e.handler({
232
+ return n ? await Fe(r, n, e) ? await e.handler({
233
233
  ...t,
234
234
  rawBody: r,
235
235
  text: () => new TextDecoder().decode(r)
@@ -245,15 +245,15 @@ const xt = {
245
245
  };
246
246
  }
247
247
  };
248
- async function Ae(e, t, r) {
249
- const n = r.algorithm ?? "SHA-256", a = r.encoding ?? "hex", i = xe(
248
+ async function Fe(e, t, r) {
249
+ const n = r.algorithm ?? "SHA-256", o = r.encoding ?? "hex", a = ze(
250
250
  t,
251
251
  n,
252
252
  r.prefix
253
- ), s = $e(i, a);
254
- if (!s)
253
+ ), i = Ue(a, o);
254
+ if (!i)
255
255
  return !1;
256
- const o = await globalThis.crypto.subtle.importKey(
256
+ const s = await globalThis.crypto.subtle.importKey(
257
257
  "raw",
258
258
  new TextEncoder().encode(r.secret),
259
259
  {
@@ -265,16 +265,16 @@ async function Ae(e, t, r) {
265
265
  );
266
266
  return await globalThis.crypto.subtle.verify(
267
267
  "HMAC",
268
- o,
269
268
  s,
269
+ i,
270
270
  Uint8Array.from(e).buffer
271
271
  );
272
272
  }
273
- function xe(e, t, r) {
274
- const n = e.trim(), a = r === void 0 ? `${t.toLowerCase().replace("-", "")}=` : r;
275
- return a !== !1 && n.startsWith(a) ? n.slice(a.length).trim() : n;
273
+ function ze(e, t, r) {
274
+ const n = e.trim(), o = r === void 0 ? `${t.toLowerCase().replace("-", "")}=` : r;
275
+ return o !== !1 && n.startsWith(o) ? n.slice(o.length).trim() : n;
276
276
  }
277
- function $e(e, t) {
277
+ function Ue(e, t) {
278
278
  if (t === "hex")
279
279
  return /^(?:[0-9a-f]{2})+$/i.test(e) ? Uint8Array.from(
280
280
  e.match(/.{2}/g) ?? [],
@@ -291,47 +291,110 @@ function $e(e, t) {
291
291
  return null;
292
292
  }
293
293
  }
294
- class ke extends Error {
294
+ const Be = /^[!#$%&'*+\-.^_`|~A-Za-z0-9]+$/, _e = {
295
+ host: "__Host-",
296
+ none: "",
297
+ secure: "__Secure-"
298
+ }, j = 4096;
299
+ function O(e, t = "host") {
300
+ return `${_e[t]}${e}`;
301
+ }
302
+ function je(e) {
303
+ const t = e.scope ?? "host", r = O(e.name, t), n = [], o = (a, i) => {
304
+ n.push({ code: a, message: i, name: r });
305
+ };
306
+ if (Be.test(e.name) || o(
307
+ "cookie-name-invalid",
308
+ `Cookie name ${JSON.stringify(e.name)} contains a character that a cookie name cannot hold. Use letters, digits, or the token characters that RFC 6265 allows.`
309
+ ), (e.name.startsWith("__Host-") || e.name.startsWith("__Secure-")) && o(
310
+ "cookie-name-carries-prefix",
311
+ `Cookie name ${JSON.stringify(e.name)} already carries a prefix. Remove the prefix from name and declare scope ${JSON.stringify(t === "none" ? "host" : t)} instead.`
312
+ ), t !== "none" && e.secure === !1 && o(
313
+ "cookie-scope-requires-secure",
314
+ `Cookie ${r} uses scope ${JSON.stringify(t)}, so it requires Secure. Remove secure: false, or declare scope "none" for a cookie that a browser must accept over plain HTTP.`
315
+ ), t === "host" && e.domain !== void 0 && o(
316
+ "cookie-domain-not-allowed",
317
+ `Cookie ${r} uses scope "host", so it cannot carry a Domain attribute. Remove domain, or declare scope "secure" to share the cookie with subdomains.`
318
+ ), t === "host" && e.path !== void 0 && e.path !== "/" && o(
319
+ "cookie-path-not-allowed",
320
+ `Cookie ${r} uses scope "host", so it requires Path=/. Remove path, or declare scope "secure" for a cookie that a path must limit.`
321
+ ), e.sameSite === "None" && e.secure === !1 && o(
322
+ "cookie-same-site-none-requires-secure",
323
+ `Cookie ${r} declares SameSite=None, so it requires Secure. Remove secure: false, or declare a SameSite policy of "Lax" or "Strict".`
324
+ ), e.maxAge !== void 0 && (!Number.isInteger(e.maxAge) || e.maxAge < 0) && o(
325
+ "cookie-max-age-invalid",
326
+ `Cookie ${r} declares maxAge ${JSON.stringify(e.maxAge)}. Use a whole number of seconds that is zero or greater.`
327
+ ), n.length === 0) {
328
+ const a = new TextEncoder().encode(G(e, t, r)).length;
329
+ a > j && o(
330
+ "cookie-too-large",
331
+ `Cookie ${r} serializes to ${a} bytes, and a browser drops a cookie above ${j} bytes. Store the payload on the server and keep an identifier in the cookie.`
332
+ );
333
+ }
334
+ return n;
335
+ }
336
+ function ur(e, t = "host") {
337
+ if (typeof document > "u")
338
+ return;
339
+ const r = typeof e == "string" ? { name: e, scope: t } : e;
340
+ return de(document.cookie).get(
341
+ O(r.name, r.scope ?? "host")
342
+ );
343
+ }
344
+ function lr(e) {
345
+ const t = je(e);
346
+ if (t.length > 0)
347
+ throw new Error(
348
+ `Demiurge rejected a cookie declaration. ${t.map((n) => n.message).join(" ")}`
349
+ );
350
+ const r = e.scope ?? "host";
351
+ return G(e, r, O(e.name, r));
352
+ }
353
+ function G(e, t, r) {
354
+ const n = [`${r}=${encodeURIComponent(e.value)}`], o = t === "host" ? "/" : e.path ?? "/";
355
+ return n.push(`Path=${o}`), t !== "host" && e.domain !== void 0 && n.push(`Domain=${e.domain}`), e.expires && n.push(`Expires=${e.expires.toUTCString()}`), e.maxAge !== void 0 && n.push(`Max-Age=${e.maxAge}`), n.push(`SameSite=${e.sameSite ?? "Lax"}`), (e.httpOnly ?? !0) && n.push("HttpOnly"), (t !== "none" || (e.secure ?? !0)) && n.push("Secure"), n.join("; ");
356
+ }
357
+ class He extends Error {
295
358
  issues;
296
359
  constructor(t) {
297
- super(Le(t)), this.name = "EnvValidationError", this.issues = t;
360
+ super(Ye(t)), this.name = "EnvValidationError", this.issues = t;
298
361
  }
299
362
  }
300
- function $t(e) {
363
+ function fr(e) {
301
364
  return e;
302
365
  }
303
- function kt(e, t) {
366
+ function dr(e, t) {
304
367
  const r = [], n = {};
305
- for (const a of Object.keys(e)) {
306
- const i = e[a], s = t[String(a)];
307
- if (s === void 0 || s === "") {
308
- if (i.optional) {
309
- n[a] = void 0;
368
+ for (const o of Object.keys(e)) {
369
+ const a = e[o], i = t[String(o)];
370
+ if (i === void 0 || i === "") {
371
+ if (a.optional) {
372
+ n[o] = void 0;
310
373
  continue;
311
374
  }
312
375
  r.push({
313
376
  code: "missing",
314
- key: String(a),
315
- message: `Environment variable ${String(a)} is required.`
377
+ key: String(o),
378
+ message: `Environment variable ${String(o)} is required.`
316
379
  });
317
380
  continue;
318
381
  }
319
382
  try {
320
- n[a] = i.parse(String(a), s);
321
- } catch (o) {
383
+ n[o] = a.parse(String(o), i);
384
+ } catch (s) {
322
385
  r.push({
323
386
  code: "invalid",
324
- key: String(a),
325
- message: o instanceof Error ? o.message : `Environment variable ${String(a)} is invalid.`
387
+ key: String(o),
388
+ message: s instanceof Error ? s.message : `Environment variable ${String(o)} is invalid.`
326
389
  });
327
390
  }
328
391
  }
329
392
  if (r.length)
330
- throw new ke(r);
393
+ throw new He(r);
331
394
  return n;
332
395
  }
333
- function Te(e = {}) {
334
- return y(e, !1, (t, r) => {
396
+ function Ve(e = {}) {
397
+ return T(e, !1, (t, r) => {
335
398
  if (r === "true" || r === "1")
336
399
  return !0;
337
400
  if (r === "false" || r === "0")
@@ -339,8 +402,8 @@ function Te(e = {}) {
339
402
  throw new Error(`Environment variable ${t} must be true, false, 1, or 0.`);
340
403
  });
341
404
  }
342
- function Ie(e, t = {}) {
343
- return y(t, !1, (r, n) => {
405
+ function We(e, t = {}) {
406
+ return T(t, !1, (r, n) => {
344
407
  if (e.includes(n))
345
408
  return n;
346
409
  throw new Error(
@@ -348,8 +411,8 @@ function Ie(e, t = {}) {
348
411
  );
349
412
  });
350
413
  }
351
- function De(e = {}) {
352
- return y(e, !1, (t, r) => {
414
+ function qe(e = {}) {
415
+ return T(e, !1, (t, r) => {
353
416
  if (!/^-?\d+$/.test(r))
354
417
  throw new Error(`Environment variable ${t} must be an integer.`);
355
418
  const n = Number(r);
@@ -366,22 +429,22 @@ function De(e = {}) {
366
429
  return n;
367
430
  });
368
431
  }
369
- function Ne(e = {}) {
370
- return y(
432
+ function Ge(e = {}) {
433
+ return T(
371
434
  e,
372
435
  !0,
373
- (t, r) => U(t, r, e)
436
+ (t, r) => K(t, r, e)
374
437
  );
375
438
  }
376
- function Ce(e = {}) {
377
- return y(
439
+ function Ke(e = {}) {
440
+ return T(
378
441
  e,
379
442
  !1,
380
- (t, r) => U(t, r, e)
443
+ (t, r) => K(t, r, e)
381
444
  );
382
445
  }
383
- function Oe(e = {}) {
384
- return y(e, !1, (t, r) => {
446
+ function Je(e = {}) {
447
+ return T(e, !1, (t, r) => {
385
448
  let n;
386
449
  try {
387
450
  n = new URL(r);
@@ -395,32 +458,32 @@ function Oe(e = {}) {
395
458
  return n;
396
459
  });
397
460
  }
398
- const Tt = {
399
- boolean: Te,
400
- enum: Ie,
401
- integer: De,
402
- secret: Ne,
403
- string: Ce,
404
- url: Oe
461
+ const hr = {
462
+ boolean: Ve,
463
+ enum: We,
464
+ integer: qe,
465
+ secret: Ge,
466
+ string: Ke,
467
+ url: Je
405
468
  };
406
- function y(e, t, r) {
469
+ function T(e, t, r) {
407
470
  return {
408
471
  optional: e.optional ?? !1,
409
472
  parse: r,
410
473
  sensitive: t
411
474
  };
412
475
  }
413
- function U(e, t, r) {
476
+ function K(e, t, r) {
414
477
  if (r.minLength !== void 0 && t.length < r.minLength)
415
478
  throw new Error(
416
479
  `Environment variable ${e} must be at least ${r.minLength} characters.`
417
480
  );
418
481
  return t;
419
482
  }
420
- function Le(e) {
483
+ function Ye(e) {
421
484
  return e.length === 1 ? e[0].message : `Environment validation failed with ${e.length} issues.`;
422
485
  }
423
- function It(e = {}) {
486
+ function mr(e = {}) {
424
487
  return async function(r) {
425
488
  if (r.method.toUpperCase() !== "POST")
426
489
  return new Response(null, {
@@ -429,25 +492,25 @@ function It(e = {}) {
429
492
  },
430
493
  status: 405
431
494
  });
432
- const n = Me(r);
495
+ const n = Xe(r);
433
496
  if (n)
434
497
  return n;
435
- const a = Pe(e, r);
436
- if (a)
437
- return a;
438
- e.maxBodySize !== void 0 && (r = ee({ maxBodySize: e.maxBodySize }, r));
439
- let i;
498
+ const o = Qe(e, r);
499
+ if (o)
500
+ return o;
501
+ e.maxBodySize !== void 0 && (r = he({ maxBodySize: e.maxBodySize }, r));
502
+ let a;
440
503
  try {
441
- i = await r.json();
442
- } catch (o) {
443
- return o instanceof te ? new Response("Security report body too large.", { status: 413 }) : new Response("Invalid security report JSON.", {
504
+ a = await r.json();
505
+ } catch (s) {
506
+ return s instanceof me ? new Response("Security report body too large.", { status: 413 }) : new Response("Invalid security report JSON.", {
444
507
  status: 400
445
508
  });
446
509
  }
447
- const s = Ue(i);
448
- for (let o = 0; o < s.length; o += 1)
449
- await e.onReport?.(s[o], {
450
- index: o,
510
+ const i = et(a);
511
+ for (let s = 0; s < i.length; s += 1)
512
+ await e.onReport?.(i[s], {
513
+ index: s,
451
514
  request: r
452
515
  });
453
516
  return new Response(null, {
@@ -455,20 +518,20 @@ function It(e = {}) {
455
518
  });
456
519
  };
457
520
  }
458
- const ze = /* @__PURE__ */ new Set([
521
+ const Ze = /* @__PURE__ */ new Set([
459
522
  "application/csp-report",
460
523
  "application/reports+json"
461
524
  ]);
462
- function Me(e) {
525
+ function Xe(e) {
463
526
  const t = e.headers.get("content-type");
464
527
  if (!t)
465
528
  return null;
466
529
  const r = t.split(";", 1)[0]?.trim().toLowerCase();
467
- return r && ze.has(r) ? null : new Response("Unsupported security report Content-Type.", {
530
+ return r && Ze.has(r) ? null : new Response("Unsupported security report Content-Type.", {
468
531
  status: 415
469
532
  });
470
533
  }
471
- function Pe(e, t) {
534
+ function Qe(e, t) {
472
535
  if (e.maxBodySize === void 0)
473
536
  return null;
474
537
  const r = t.headers.get("content-length");
@@ -479,32 +542,32 @@ function Pe(e, t) {
479
542
  status: 400
480
543
  });
481
544
  const n = Number(r);
482
- return Number.isSafeInteger(n) ? n > $(e.maxBodySize) ? new Response("Security report body too large.", {
545
+ return Number.isSafeInteger(n) ? n > D(e.maxBodySize) ? new Response("Security report body too large.", {
483
546
  status: 413
484
547
  }) : null : new Response("Invalid Content-Length.", {
485
548
  status: 400
486
549
  });
487
550
  }
488
- function Ue(e) {
489
- return Array.isArray(e) ? e : je(e) && "csp-report" in e ? [e["csp-report"]] : [e];
551
+ function et(e) {
552
+ return Array.isArray(e) ? e : tt(e) && "csp-report" in e ? [e["csp-report"]] : [e];
490
553
  }
491
- function je(e) {
554
+ function tt(e) {
492
555
  return typeof e == "object" && e !== null;
493
556
  }
494
- function Dt(e, t) {
557
+ function pr(e, t) {
495
558
  const r = {}, n = [];
496
- let a = 0;
497
- for (const [i, s] of Object.entries(t.files)) {
498
- const o = e.getAll(i).filter(Be);
499
- r[i] = o, s.required && o.length === 0 && n.push({
559
+ let o = 0;
560
+ for (const [a, i] of Object.entries(t.files)) {
561
+ const s = e.getAll(a).filter(ot);
562
+ r[a] = s, i.required && s.length === 0 && n.push({
500
563
  code: "file-missing",
501
- field: i,
502
- message: `Upload field ${i} requires at least one file.`
564
+ field: a,
565
+ message: `Upload field ${a} requires at least one file.`
503
566
  });
504
- for (const u of o)
505
- a += u.size, Fe(i, u, s, n);
567
+ for (const l of s)
568
+ o += l.size, rt(a, l, i, n);
506
569
  }
507
- return t.maxTotalSize !== void 0 && a > $(t.maxTotalSize) && n.push({
570
+ return t.maxTotalSize !== void 0 && o > D(t.maxTotalSize) && n.push({
508
571
  code: "total-upload-too-large",
509
572
  field: "*",
510
573
  message: `Uploaded files exceed the maximum total size of ${t.maxTotalSize}.`
@@ -512,27 +575,27 @@ function Dt(e, t) {
512
575
  files: r,
513
576
  issues: n,
514
577
  ok: n.length === 0,
515
- totalSize: a
578
+ totalSize: o
516
579
  };
517
580
  }
518
- function Fe(e, t, r, n) {
519
- r.maxSize !== void 0 && t.size > $(r.maxSize) && n.push({
581
+ function rt(e, t, r, n) {
582
+ r.maxSize !== void 0 && t.size > D(r.maxSize) && n.push({
520
583
  code: "file-too-large",
521
584
  field: e,
522
585
  message: `Upload field ${e} contains ${t.name || "a file"} larger than ${r.maxSize}.`
523
- }), r.types?.length && !He(t.type, r.types) && n.push({
586
+ }), r.types?.length && !nt(t.type, r.types) && n.push({
524
587
  code: "file-type-not-allowed",
525
588
  field: e,
526
589
  message: `Upload field ${e} contains ${t.name || "a file"} with disallowed type ${t.type || "unknown"}.`
527
590
  });
528
591
  }
529
- function He(e, t) {
592
+ function nt(e, t) {
530
593
  return t.some((r) => r.endsWith("/*") ? e.startsWith(r.slice(0, -1)) : e === r);
531
594
  }
532
- function Be(e) {
595
+ function ot(e) {
533
596
  return e instanceof File;
534
597
  }
535
- function qe(e, t) {
598
+ function at(e, t) {
536
599
  const r = t.headers.get("origin");
537
600
  if (!r)
538
601
  return {
@@ -541,7 +604,7 @@ function qe(e, t) {
541
604
  origin: r,
542
605
  reason: e.allowMissingOrigin ? void 0 : "missing-origin"
543
606
  };
544
- const n = j(r);
607
+ const n = J(r);
545
608
  if (!n)
546
609
  return {
547
610
  allowed: !1,
@@ -549,28 +612,28 @@ function qe(e, t) {
549
612
  origin: r,
550
613
  reason: "invalid-origin"
551
614
  };
552
- const a = _e(e, n, t);
615
+ const o = it(e, n, t);
553
616
  return {
554
- allowed: a,
617
+ allowed: o,
555
618
  expected: e.origins,
556
619
  origin: n,
557
- reason: a ? void 0 : "origin-not-allowed"
620
+ reason: o ? void 0 : "origin-not-allowed"
558
621
  };
559
622
  }
560
- function Nt(e, t) {
561
- return !e || qe(e, t).allowed ? null : new Response("WebSocket origin not allowed.", {
623
+ function gr(e, t) {
624
+ return !e || at(e, t).allowed ? null : new Response("WebSocket origin not allowed.", {
562
625
  status: 403
563
626
  });
564
627
  }
565
- function _e(e, t, r) {
628
+ function it(e, t, r) {
566
629
  return e.origins === "same-origin" ? t === new URL(r.url).origin : e.origins.some(
567
- (n) => Ve(n, t)
630
+ (n) => st(n, t)
568
631
  );
569
632
  }
570
- function Ve(e, t) {
571
- return e === "null" ? t === "null" : j(e) === t;
633
+ function st(e, t) {
634
+ return e === "null" ? t === "null" : J(e) === t;
572
635
  }
573
- function j(e) {
636
+ function J(e) {
574
637
  if (e === "null")
575
638
  return e;
576
639
  try {
@@ -588,122 +651,122 @@ function j(e) {
588
651
  return null;
589
652
  }
590
653
  }
591
- function We(e) {
592
- const t = M(e.routes), r = e.loadNavigationData ?? H;
654
+ function ct(e) {
655
+ const t = W(e.routes), r = e.loadNavigationData ?? Z;
593
656
  return function() {
594
- const [a, i] = T(() => S()), [s, o] = T(
657
+ const [o, a] = F(() => $()), [i, s] = F(
595
658
  () => e.initialMatch ?? { status: "loading" }
596
- ), u = I(!!e.initialMatch), d = I(0);
597
- D(() => {
659
+ ), l = z(!!e.initialMatch), d = z(0);
660
+ P(() => {
598
661
  function c() {
599
- i(S());
662
+ a($());
600
663
  }
601
664
  return window.addEventListener("popstate", c), () => window.removeEventListener("popstate", c);
602
- }, []), D(() => {
603
- let c = !1, l = !1;
604
- const m = ++d.current, R = new AbortController(), v = () => !c && m === d.current;
605
- if (u.current && Ge(e.initialMatch) === a.pathname)
606
- return u.current = !1, () => {
665
+ }, []), P(() => {
666
+ let c = !1, f = !1;
667
+ const h = ++d.current, v = new AbortController(), S = () => !c && h === d.current;
668
+ if (l.current && lt(e.initialMatch) === o.pathname)
669
+ return l.current = !1, () => {
607
670
  c = !0;
608
671
  };
609
- o({ status: "loading" }), ne(t, a.pathname).then((h) => {
610
- v() && !l && h && o({ loading: h, status: "loading" });
672
+ s({ status: "loading" }), ge(t, o.pathname).then((m) => {
673
+ S() && !f && m && s({ loading: m, status: "loading" });
611
674
  }).catch(() => {
612
675
  });
613
- const k = new Request(a.href, { signal: R.signal });
614
- return Promise.resolve(r(k)).then(
615
- (h) => P(
676
+ const b = new Request(o.href, { signal: v.signal });
677
+ return Promise.resolve(r(b)).then(
678
+ (m) => q(
616
679
  t,
617
- a.pathname,
618
- k,
619
- h,
680
+ o.pathname,
681
+ b,
682
+ m,
620
683
  void 0,
621
684
  { documentContributions: !1 }
622
685
  )
623
- ).then((h) => {
624
- l = !0, v() && o(h);
625
- }).catch(async (h) => {
626
- if (l = !0, !v() || R.signal.aborted)
686
+ ).then((m) => {
687
+ f = !0, S() && s(m);
688
+ }).catch(async (m) => {
689
+ if (f = !0, !S() || v.signal.aborted)
627
690
  return;
628
- const q = await ae(
691
+ const k = await we(
629
692
  t,
630
- a.pathname
693
+ o.pathname
631
694
  );
632
- v() && o({
633
- Error: q,
634
- error: h,
635
- pathname: a.pathname,
695
+ S() && s({
696
+ Error: k,
697
+ error: m,
698
+ pathname: o.pathname,
636
699
  status: "error"
637
700
  });
638
701
  }), () => {
639
- c = !0, R.abort();
702
+ c = !0, v.abort();
640
703
  };
641
- }, [a.pathname, a.search]);
642
- const g = V(
704
+ }, [o.pathname, o.search]);
705
+ const p = ne(
643
706
  () => ({
644
707
  navigation: e.navigation ?? "server",
645
708
  push(c) {
646
- const l = S();
709
+ const f = $();
647
710
  window.history.pushState(null, "", c);
648
- const m = S();
649
- i(m), l.pathname === m.pathname && l.search === m.search && l.hash !== m.hash && Qe(m.hash);
711
+ const h = $();
712
+ a(h), f.pathname === h.pathname && f.search === h.search && f.hash !== h.hash && pt(h.hash);
650
713
  }
651
714
  }),
652
715
  []
653
716
  );
654
- return f(B.Provider, {
655
- value: g,
656
- children: f(Ye, {
657
- key: `${a.pathname}${a.search}`,
717
+ return w(X.Provider, {
718
+ value: p,
719
+ children: w(dt, {
720
+ key: `${o.pathname}${o.search}`,
658
721
  Loading: e.loading,
659
722
  NotFound: e.notFound,
660
- match: s
723
+ match: i
661
724
  })
662
725
  });
663
726
  };
664
727
  }
665
- function Ke(e, t) {
666
- const r = t.getAttribute(Y);
728
+ function ut(e, t) {
729
+ const r = t.getAttribute(ce);
667
730
  return e.status === "not-found" ? r === "not-found" : e.status === "ready" && r === null;
668
731
  }
669
- function Ge(e) {
732
+ function lt(e) {
670
733
  if (e)
671
734
  return e.status === "ready" ? e.match.pathname : e.status === "loading" ? void 0 : e.pathname;
672
735
  }
673
- async function Ct(e) {
736
+ async function wr(e) {
674
737
  const t = e.root ?? document.getElementById("root");
675
738
  if (!t)
676
739
  throw new Error(
677
740
  "Demiurge expected a #root element in the framework document."
678
741
  );
679
- const r = M(e.routes), n = e.loadNavigationData ?? H, a = e.initialData ?? G(document), i = await P(
742
+ const r = W(e.routes), n = e.loadNavigationData ?? Z, o = e.initialData ?? ie(document), a = await q(
680
743
  r,
681
744
  window.location.pathname,
682
745
  new Request(window.location.href),
683
- a ?? await n(new Request(window.location.href)),
746
+ o ?? await n(new Request(window.location.href)),
684
747
  void 0,
685
748
  { documentContributions: !1 }
686
- ), s = Ke(i, t), o = We(
687
- s ? {
749
+ ), i = ut(a, t), s = ct(
750
+ i ? {
688
751
  ...e,
689
- initialMatch: i,
752
+ initialMatch: a,
690
753
  loadNavigationData: n,
691
- navigation: a?.navigation ?? e.navigation
754
+ navigation: o?.navigation ?? e.navigation
692
755
  } : {
693
756
  ...e,
694
757
  loadNavigationData: n,
695
- navigation: a?.navigation ?? e.navigation
758
+ navigation: o?.navigation ?? e.navigation
696
759
  }
697
- ), { createRoot: u, hydrateRoot: d } = Ze(
760
+ ), { createRoot: l, hydrateRoot: d } = ft(
698
761
  await import("react-dom/client")
699
762
  );
700
- if (s && t.hasAttribute(Z)) {
701
- d(t, f(o)), N();
763
+ if (i && t.hasAttribute(se)) {
764
+ d(t, w(s)), U();
702
765
  return;
703
766
  }
704
- t.replaceChildren(), u(t).render(f(o)), N();
767
+ t.replaceChildren(), l(t).render(w(s)), U();
705
768
  }
706
- function Ze(e) {
769
+ function ft(e) {
707
770
  const t = typeof e.createRoot == "function" && typeof e.hydrateRoot == "function" ? e : e.default;
708
771
  if (!t || typeof t.createRoot != "function" || typeof t.hydrateRoot != "function")
709
772
  throw new Error(
@@ -711,57 +774,57 @@ function Ze(e) {
711
774
  );
712
775
  return t;
713
776
  }
714
- function Ot(e) {
715
- const t = tt(), r = re(e);
716
- return /* @__PURE__ */ z(
777
+ function yr(e) {
778
+ const t = wt(), r = pe(e);
779
+ return /* @__PURE__ */ V(
717
780
  "a",
718
781
  {
719
782
  className: e.className,
720
783
  href: r,
721
784
  onClick: (n) => {
722
- t.navigation === "server" && et(n) && (n.preventDefault(), t.push(r));
785
+ t.navigation === "server" && gt(n) && (n.preventDefault(), t.push(r));
723
786
  },
724
787
  children: e.children
725
788
  }
726
789
  );
727
790
  }
728
- function Ye({
791
+ function dt({
729
792
  Loading: e,
730
793
  NotFound: t,
731
794
  match: r
732
795
  }) {
733
796
  if (r.status === "loading") {
734
797
  const c = r.loading ?? e;
735
- return c ? f(c) : null;
798
+ return c ? w(c) : null;
736
799
  }
737
800
  if (r.status === "not-found") {
738
- const c = r.notFound ?? t ?? fe;
801
+ const c = r.notFound ?? t ?? Te;
739
802
  return r.layouts.reduceRight(
740
- (l, m) => f(m, {
741
- children: l,
803
+ (f, h) => w(h, {
804
+ children: f,
742
805
  path: {},
743
806
  pathname: r.pathname
744
807
  }),
745
- f(c, { pathname: r.pathname })
808
+ w(c, { pathname: r.pathname })
746
809
  );
747
810
  }
748
811
  if (r.status === "error")
749
- return r.Error ? f(r.Error, {
812
+ return r.Error ? w(r.Error, {
750
813
  error: r.error,
751
814
  pathname: r.pathname,
752
- status: F(r.error)
815
+ status: Y(r.error)
753
816
  }) : null;
754
- const { data: n, error: a, page: i, layouts: s, path: o, pathname: u } = r.match, d = f(i, { data: n, path: o, pathname: u }), g = s.reduceRight(
755
- (c, l) => f(l, { path: o, pathname: u, children: c }),
817
+ const { data: n, error: o, page: a, layouts: i, path: s, pathname: l } = r.match, d = w(a, { data: n, path: s, pathname: l }), p = i.reduceRight(
818
+ (c, f) => w(f, { path: s, pathname: l, children: c }),
756
819
  d
757
820
  );
758
- return f(Xe, {
759
- Error: a,
760
- children: g,
761
- pathname: u
821
+ return w(ht, {
822
+ Error: o,
823
+ children: p,
824
+ pathname: l
762
825
  });
763
826
  }
764
- class Xe extends K {
827
+ class ht extends ae {
765
828
  static getDerivedStateFromError(t) {
766
829
  return { error: t };
767
830
  }
@@ -770,17 +833,17 @@ class Xe extends K {
770
833
  this.state.error !== void 0 && t.pathname !== this.props.pathname && this.setState({ error: void 0 });
771
834
  }
772
835
  render() {
773
- return this.state.error !== void 0 ? this.props.Error ? f(this.props.Error, {
836
+ return this.state.error !== void 0 ? this.props.Error ? w(this.props.Error, {
774
837
  error: this.state.error,
775
838
  pathname: this.props.pathname,
776
- status: F(this.state.error)
839
+ status: Y(this.state.error)
777
840
  }) : null : this.props.children;
778
841
  }
779
842
  }
780
- function F(e) {
781
- return de(e) ? e.status : 500;
843
+ function Y(e) {
844
+ return ke(e) ? e.status : 500;
782
845
  }
783
- function S() {
846
+ function $() {
784
847
  return {
785
848
  hash: window.location.hash,
786
849
  href: window.location.href,
@@ -788,42 +851,42 @@ function S() {
788
851
  search: window.location.search
789
852
  };
790
853
  }
791
- async function H(e) {
854
+ async function Z(e) {
792
855
  const t = new Headers(e.headers);
793
- t.set("accept", "application/json"), t.set(O, ie);
856
+ t.set("accept", "application/json"), t.set(_, ye);
794
857
  const r = await fetch(new Request(e, {
795
858
  credentials: "same-origin",
796
859
  headers: t
797
- })), n = r.headers.get(O);
798
- if (n === oe) {
799
- const a = await r.json();
800
- if (a.hasData !== !0)
860
+ })), n = r.headers.get(_);
861
+ if (n === ve) {
862
+ const o = await r.json();
863
+ if (o.hasData !== !0)
801
864
  throw new Error("Demiurge received malformed navigation route data.");
802
- return { data: a.data, hasData: !0 };
865
+ return { data: o.data, hasData: !0 };
803
866
  }
804
- if (n === se)
867
+ if (n === be)
805
868
  return { hasData: !0 };
806
- if (n === ce || !r.ok) {
807
- const a = await Je(r), i = ue.includes(
869
+ if (n === Se || !r.ok) {
870
+ const o = await mt(r), a = Ee.includes(
808
871
  r.status
809
872
  ) ? r.status : 500;
810
- throw le(i, {
811
- detail: typeof a?.detail == "string" ? a.detail : void 0,
812
- title: typeof a?.title == "string" ? a.title : void 0
873
+ throw Re(a, {
874
+ detail: typeof o?.detail == "string" ? o.detail : void 0,
875
+ title: typeof o?.title == "string" ? o.title : void 0
813
876
  });
814
877
  }
815
878
  throw new Error(
816
879
  "Demiurge expected a navigation data response from the application server."
817
880
  );
818
881
  }
819
- async function Je(e) {
882
+ async function mt(e) {
820
883
  try {
821
884
  return await e.json();
822
885
  } catch {
823
886
  return;
824
887
  }
825
888
  }
826
- function Qe(e) {
889
+ function pt(e) {
827
890
  queueMicrotask(() => {
828
891
  if (!e) {
829
892
  window.scrollTo?.(0, 0);
@@ -838,45 +901,45 @@ function Qe(e) {
838
901
  document.getElementById(t)?.scrollIntoView?.();
839
902
  });
840
903
  }
841
- function et(e) {
904
+ function gt(e) {
842
905
  return e.button === 0 && !e.metaKey && !e.altKey && !e.ctrlKey && !e.shiftKey;
843
906
  }
844
- const B = _({
907
+ const X = re({
845
908
  navigation: "document",
846
909
  push(e) {
847
910
  window.location.href = e;
848
911
  }
849
912
  });
850
- function tt() {
851
- return W(B);
913
+ function wt() {
914
+ return oe(X);
852
915
  }
853
- function Lt({ className: e, id: t, policy: r, ...n }) {
854
- const a = me(n, r);
855
- return /* @__PURE__ */ z(
916
+ function vr({ className: e, id: t, policy: r, ...n }) {
917
+ const o = Ae(n, r);
918
+ return /* @__PURE__ */ V(
856
919
  "img",
857
920
  {
858
- alt: a.alt,
921
+ alt: o.alt,
859
922
  className: e,
860
- decoding: a.decoding,
861
- fetchPriority: a.fetchPriority,
862
- height: a.height,
923
+ decoding: o.decoding,
924
+ fetchPriority: o.fetchPriority,
925
+ height: o.height,
863
926
  id: t,
864
- loading: a.loading,
865
- sizes: a.sizes,
866
- src: a.src,
867
- srcSet: a.srcSet,
868
- width: a.width
927
+ loading: o.loading,
928
+ sizes: o.sizes,
929
+ src: o.src,
930
+ srcSet: o.srcSet,
931
+ width: o.width
869
932
  }
870
933
  );
871
934
  }
872
- const rt = "https://js.sentry-cdn.com", zt = {
935
+ const yt = "https://js.sentry-cdn.com", br = {
873
936
  /**
874
937
  * Plausible loads one script and posts events to its own API. The snippet
875
938
  * carries configuration in `data-domain`, so no inline code is involved.
876
939
  * `endpoint` accepts a same-origin path prefix for a proxied deployment.
877
940
  */
878
941
  plausible(e) {
879
- const t = nt(e.domain), r = L(e.endpoint ?? "https://plausible.io");
942
+ const t = vt(e.domain), r = H(e.endpoint ?? "https://plausible.io");
880
943
  return {
881
944
  consent: e.consent ?? !1,
882
945
  domain: t,
@@ -887,7 +950,7 @@ const rt = "https://js.sentry-cdn.com", zt = {
887
950
  },
888
951
  provider: "plausible",
889
952
  scripts: [
890
- A({
953
+ I({
891
954
  dataApi: `${r.base}/api/event`,
892
955
  dataDomain: t,
893
956
  defer: !0,
@@ -905,8 +968,8 @@ const rt = "https://js.sentry-cdn.com", zt = {
905
968
  * why the integration also declares a `connect-src` need.
906
969
  */
907
970
  sentry(e) {
908
- const t = ot(e.dsn), r = it(
909
- e.loaderHost ?? rt,
971
+ const t = Et(e.dsn), r = St(
972
+ e.loaderHost ?? yt,
910
973
  "Sentry loader host"
911
974
  );
912
975
  return {
@@ -920,7 +983,7 @@ const rt = "https://js.sentry-cdn.com", zt = {
920
983
  projectId: t.projectId,
921
984
  provider: "sentry",
922
985
  scripts: [
923
- A({
986
+ I({
924
987
  crossOrigin: "anonymous",
925
988
  needs: { connect: [t.origin] },
926
989
  purpose: "error-monitoring",
@@ -939,7 +1002,7 @@ const rt = "https://js.sentry-cdn.com", zt = {
939
1002
  * to, and an optional same-origin entry script that starts the SDK.
940
1003
  */
941
1004
  openTelemetry(e) {
942
- const t = L(e.endpoint), r = e.script;
1005
+ const t = H(e.endpoint), r = e.script;
943
1006
  if (r !== void 0 && !r.startsWith("/"))
944
1007
  throw new Error(
945
1008
  "OpenTelemetry browser instrumentation must be a same-origin script path."
@@ -951,7 +1014,7 @@ const rt = "https://js.sentry-cdn.com", zt = {
951
1014
  needs: r ? { connect: [t.source], script: ["'self'"] } : { connect: [t.source] },
952
1015
  provider: "opentelemetry",
953
1016
  scripts: r ? [
954
- A({
1017
+ I({
955
1018
  needs: { connect: [t.source] },
956
1019
  purpose: "observability",
957
1020
  src: r,
@@ -965,8 +1028,8 @@ const rt = "https://js.sentry-cdn.com", zt = {
965
1028
  const t = {};
966
1029
  for (const r of e)
967
1030
  for (const n of ["connect", "img", "script"]) {
968
- const a = r.needs[n];
969
- !a || a.length === 0 || (t[n] = [.../* @__PURE__ */ new Set([...t[n] ?? [], ...a])]);
1031
+ const o = r.needs[n];
1032
+ !o || o.length === 0 || (t[n] = [.../* @__PURE__ */ new Set([...t[n] ?? [], ...o])]);
970
1033
  }
971
1034
  return { security: { needs: t } };
972
1035
  },
@@ -975,13 +1038,13 @@ const rt = "https://js.sentry-cdn.com", zt = {
975
1038
  return e.flatMap((t) => [...t.scripts]);
976
1039
  }
977
1040
  };
978
- function nt(e) {
1041
+ function vt(e) {
979
1042
  const t = e.trim();
980
1043
  if (!t || t.includes("/") || t.includes(" "))
981
1044
  throw new Error("Analytics domain must be a hostname without a path.");
982
1045
  return t;
983
1046
  }
984
- function L(e) {
1047
+ function H(e) {
985
1048
  if (e.startsWith("/")) {
986
1049
  if (e.startsWith("//"))
987
1050
  throw new Error("Analytics endpoint must not be a scheme-relative URL.");
@@ -990,10 +1053,10 @@ function L(e) {
990
1053
  source: "'self'"
991
1054
  };
992
1055
  }
993
- const t = at(e);
1056
+ const t = bt(e);
994
1057
  return { base: t.origin, source: t.origin };
995
1058
  }
996
- function at(e) {
1059
+ function bt(e) {
997
1060
  let t;
998
1061
  try {
999
1062
  t = new URL(e);
@@ -1004,7 +1067,7 @@ function at(e) {
1004
1067
  throw new Error("Analytics endpoint must use HTTPS.");
1005
1068
  return t;
1006
1069
  }
1007
- function it(e, t) {
1070
+ function St(e, t) {
1008
1071
  let r;
1009
1072
  try {
1010
1073
  r = new URL(e);
@@ -1015,7 +1078,7 @@ function it(e, t) {
1015
1078
  throw new Error(`${t} must use HTTPS.`);
1016
1079
  return r.origin;
1017
1080
  }
1018
- function ot(e) {
1081
+ function Et(e) {
1019
1082
  let t;
1020
1083
  try {
1021
1084
  t = new URL(e);
@@ -1037,143 +1100,416 @@ function ot(e) {
1037
1100
  publicKey: t.username
1038
1101
  };
1039
1102
  }
1040
- function Mt(e = {}) {
1103
+ function Sr(e = {}) {
1041
1104
  return {
1042
1105
  async request(t) {
1043
- await E({ kind: "request", signal: t }, e);
1106
+ await x({ kind: "request", signal: t }, e);
1044
1107
  },
1045
1108
  async serverStart(t = {}) {
1046
- await E({ kind: "server-start", signal: t }, e);
1109
+ await x({ kind: "server-start", signal: t }, e);
1047
1110
  },
1048
1111
  async trace(t) {
1049
- await E({ kind: "trace", signal: t }, e);
1112
+ await x({ kind: "trace", signal: t }, e);
1050
1113
  },
1051
1114
  async reportWebVitals(t) {
1052
- await E({ kind: "web-vital", signal: t }, e);
1115
+ await x({ kind: "web-vital", signal: t }, e);
1053
1116
  }
1054
1117
  };
1055
1118
  }
1056
- async function E(e, t) {
1119
+ async function x(e, t) {
1057
1120
  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);
1058
1121
  }
1122
+ const Rt = [
1123
+ "CLS",
1124
+ "FCP",
1125
+ "FID",
1126
+ "INP",
1127
+ "LCP",
1128
+ "TTFB"
1129
+ ], L = [
1130
+ "CLS",
1131
+ "FCP",
1132
+ "INP",
1133
+ "LCP",
1134
+ "TTFB"
1135
+ ], Tt = new Set(Rt), kt = /* @__PURE__ */ new Set([
1136
+ "back-forward",
1137
+ "back-forward-cache",
1138
+ "navigate",
1139
+ "prerender",
1140
+ "reload",
1141
+ "restore"
1142
+ ]), At = /* @__PURE__ */ new Set([
1143
+ "good",
1144
+ "needs-improvement",
1145
+ "poor"
1146
+ ]);
1147
+ function $t(e) {
1148
+ return typeof e == "string" && Tt.has(e);
1149
+ }
1150
+ function xt(e) {
1151
+ return typeof e == "string" && kt.has(e);
1152
+ }
1153
+ function Ct(e) {
1154
+ return typeof e == "string" && At.has(e);
1155
+ }
1156
+ const It = {
1157
+ CLS: { good: 0.1, poor: 0.25 },
1158
+ FCP: { good: 1800, poor: 3e3 },
1159
+ FID: { good: 100, poor: 300 },
1160
+ INP: { good: 200, poor: 500 },
1161
+ LCP: { good: 2500, poor: 4e3 },
1162
+ TTFB: { good: 800, poor: 1800 }
1163
+ };
1164
+ function Nt(e, t) {
1165
+ const r = It[e];
1166
+ return t <= r.good ? "good" : t > r.poor ? "poor" : "needs-improvement";
1167
+ }
1168
+ const Q = 32;
1169
+ function Er(e) {
1170
+ const t = Dt(e.endpoint), r = Ot(e.metrics), n = Mt(e.sampleRate);
1171
+ return {
1172
+ endpoint: t.url,
1173
+ kind: "web-vitals",
1174
+ metrics: r,
1175
+ needs: { connect: [t.source] },
1176
+ sampleRate: n
1177
+ };
1178
+ }
1179
+ function Rr(...e) {
1180
+ const t = /* @__PURE__ */ new Set();
1181
+ for (const r of e)
1182
+ for (const n of r.needs.connect ?? [])
1183
+ t.add(n);
1184
+ return t.size === 0 ? { security: { needs: {} } } : { security: { needs: { connect: [...t] } } };
1185
+ }
1186
+ async function Tr(e, t = {}) {
1187
+ const r = t.maxMetrics ?? Q;
1188
+ let n;
1189
+ try {
1190
+ n = await e.json();
1191
+ } catch {
1192
+ return { ok: !1, reason: "unreadable-body" };
1193
+ }
1194
+ return Lt(n, r);
1195
+ }
1196
+ function Lt(e, t = Q) {
1197
+ if (!ee(e) || !Array.isArray(e.metrics))
1198
+ return { ok: !1, reason: "invalid-payload" };
1199
+ if (e.metrics.length > t)
1200
+ return { ok: !1, reason: "too-many-metrics" };
1201
+ const r = [];
1202
+ for (const n of e.metrics) {
1203
+ const o = Pt(n);
1204
+ if (!o)
1205
+ return { ok: !1, reason: "invalid-payload" };
1206
+ r.push(o);
1207
+ }
1208
+ return { metrics: r, ok: !0 };
1209
+ }
1210
+ function Pt(e) {
1211
+ if (!ee(e))
1212
+ return;
1213
+ const { id: t, name: r, navigationType: n, rating: o, url: a, value: i } = e;
1214
+ if (!(typeof t != "string" || t.length === 0 || t.length > 128) && !(!$t(r) || !xt(n)) && Ct(o) && !(typeof a != "string" || a.length === 0 || a.length > 2048) && !(typeof i != "number" || !Number.isFinite(i) || i < 0))
1215
+ return { id: t, name: r, navigationType: n, rating: o, url: a, value: i };
1216
+ }
1217
+ function ee(e) {
1218
+ return typeof e == "object" && e !== null;
1219
+ }
1220
+ function Dt(e) {
1221
+ if (e.startsWith("/")) {
1222
+ if (e.startsWith("//"))
1223
+ throw new Error(
1224
+ "The web vitals endpoint must not be a scheme-relative URL."
1225
+ );
1226
+ return { source: "'self'", url: e };
1227
+ }
1228
+ let t;
1229
+ try {
1230
+ t = new URL(e);
1231
+ } catch {
1232
+ throw new Error(
1233
+ "The web vitals endpoint must be a same-origin path or an absolute URL."
1234
+ );
1235
+ }
1236
+ if (t.protocol !== "https:")
1237
+ throw new Error("The web vitals endpoint must use HTTPS.");
1238
+ return { source: t.origin, url: t.href };
1239
+ }
1240
+ function Ot(e) {
1241
+ if (!e)
1242
+ return L;
1243
+ const t = [];
1244
+ for (const r of e) {
1245
+ if (!L.includes(r))
1246
+ throw new Error(
1247
+ `The browser collector does not measure ${JSON.stringify(r)}. Demiurge collects ${L.join(", ")}.`
1248
+ );
1249
+ t.includes(r) || t.push(r);
1250
+ }
1251
+ if (t.length === 0)
1252
+ throw new Error("A web vitals integration must collect one metric or more.");
1253
+ return t;
1254
+ }
1255
+ function Mt(e) {
1256
+ if (e === void 0)
1257
+ return 1;
1258
+ if (!Number.isFinite(e) || e < 0 || e > 1)
1259
+ throw new Error("The web vitals sample rate must be between 0 and 1.");
1260
+ return e;
1261
+ }
1262
+ const Ft = 1e3, zt = 5e3, Ut = 40;
1263
+ function Bt(e, t = {}) {
1264
+ if (typeof window > "u" || typeof PerformanceObserver > "u")
1265
+ return () => {
1266
+ };
1267
+ const r = t.random ?? Math.random;
1268
+ if (e.sampleRate < 1 && r() >= e.sampleRate)
1269
+ return () => {
1270
+ };
1271
+ const n = t.transport ?? _t, o = new Set(e.metrics), a = [], i = [], s = /* @__PURE__ */ new Set();
1272
+ let l = jt(), d = 0, p = 0, c = 0, f = 0, h, v, S = !1;
1273
+ const b = (u, g) => {
1274
+ if (S || s.has(u))
1275
+ return;
1276
+ s.add(u);
1277
+ const y = {
1278
+ id: `${u}-${Date.now()}-${Math.floor(r() * 1e9)}`,
1279
+ name: u,
1280
+ navigationType: l,
1281
+ rating: Nt(u, g),
1282
+ url: window.location.href,
1283
+ value: Math.round(g * 1e3) / 1e3
1284
+ };
1285
+ i.push(y), t.onReport?.(y);
1286
+ }, m = () => {
1287
+ if (S || (h !== void 0 && b("LCP", h), v !== void 0 && b("INP", v), o.has("CLS") && b("CLS", d), i.length === 0))
1288
+ return;
1289
+ const u = i.splice(0, i.length);
1290
+ n(e.endpoint, { metrics: u });
1291
+ }, k = () => {
1292
+ document.visibilityState === "hidden" && m();
1293
+ }, M = (u) => {
1294
+ u.persisted && (l = "back-forward-cache", s.clear(), d = 0, p = 0, c = 0, f = 0, h = void 0, v = void 0, o.has("FCP") && b("FCP", performance.now() - u.timeStamp));
1295
+ };
1296
+ if (o.has("TTFB")) {
1297
+ const u = te();
1298
+ u && u.responseStart > 0 && b("TTFB", u.responseStart);
1299
+ }
1300
+ return o.has("FCP") && C(a, { buffered: !0, type: "paint" }, (u) => {
1301
+ for (const g of u)
1302
+ g.name === "first-contentful-paint" && b("FCP", g.startTime);
1303
+ }), o.has("LCP") && C(
1304
+ a,
1305
+ { buffered: !0, type: "largest-contentful-paint" },
1306
+ (u) => {
1307
+ const g = u.at(-1);
1308
+ g && (h = g.startTime);
1309
+ }
1310
+ ), o.has("CLS") && C(a, { buffered: !0, type: "layout-shift" }, (u) => {
1311
+ for (const g of u) {
1312
+ const y = g;
1313
+ if (y.hadRecentInput)
1314
+ continue;
1315
+ p > 0 && y.startTime - f < Ft && y.startTime - c < zt ? p += y.value : (p = y.value, c = y.startTime), f = y.startTime, d = Math.max(d, p);
1316
+ }
1317
+ }), o.has("INP") && C(
1318
+ a,
1319
+ {
1320
+ buffered: !0,
1321
+ durationThreshold: Ut,
1322
+ type: "event"
1323
+ },
1324
+ (u) => {
1325
+ for (const g of u)
1326
+ v = Math.max(v ?? 0, g.duration);
1327
+ }
1328
+ ), document.addEventListener("visibilitychange", k), window.addEventListener("pagehide", m), window.addEventListener("pageshow", M), () => {
1329
+ m(), S = !0;
1330
+ for (const u of a)
1331
+ u.disconnect();
1332
+ document.removeEventListener("visibilitychange", k), window.removeEventListener("pagehide", m), window.removeEventListener("pageshow", M);
1333
+ };
1334
+ }
1335
+ function kr({ integration: e, onReport: t, transport: r }) {
1336
+ return P(
1337
+ () => Bt(e, { onReport: t, transport: r }),
1338
+ [e, t, r]
1339
+ ), null;
1340
+ }
1341
+ function _t(e, t) {
1342
+ const r = JSON.stringify(t);
1343
+ if (typeof navigator < "u" && typeof navigator.sendBeacon == "function") {
1344
+ const n = new Blob([r], { type: "application/json" });
1345
+ if (navigator.sendBeacon(e, n))
1346
+ return;
1347
+ }
1348
+ fetch(e, {
1349
+ body: r,
1350
+ headers: { "content-type": "application/json" },
1351
+ keepalive: !0,
1352
+ method: "POST"
1353
+ }).catch(() => {
1354
+ });
1355
+ }
1356
+ function C(e, t, r) {
1357
+ try {
1358
+ const n = new PerformanceObserver((o) => r(o.getEntries()));
1359
+ n.observe(t), e.push(n);
1360
+ } catch {
1361
+ return;
1362
+ }
1363
+ }
1364
+ function te() {
1365
+ if (!(typeof performance > "u"))
1366
+ return performance.getEntriesByType("navigation")[0];
1367
+ }
1368
+ function jt() {
1369
+ const e = te();
1370
+ return e?.type === "back_forward" ? "back-forward" : e?.type === "reload" || e?.type === "prerender" ? e.type : "navigate";
1371
+ }
1059
1372
  export {
1060
- ke as EnvValidationError,
1061
- ue as HTTP_ERROR_STATUSES,
1062
- Qt as HttpError,
1063
- Lt as Image,
1064
- Ot as Link,
1065
- jt as Script,
1066
- St as action,
1067
- Et as actionInput,
1068
- zt as analytics,
1069
- Ft as assertAdapterCapabilities,
1070
- er as auditScriptDependencies,
1071
- Ht as checkAdapterCapabilities,
1072
- qe as checkWebSocketOrigin,
1073
- tr as createCache,
1074
- rr as createCorsHeaders,
1075
- nr as createCsrfCookie,
1076
- ar as createCsrfToken,
1077
- We as createFileRouter,
1078
- ir as createInvalidation,
1079
- or as createMemoryCache,
1080
- sr as createMemoryCacheStore,
1081
- mt as createMemoryIdempotencyStore,
1082
- cr as createMemoryRateLimitStore,
1083
- ur as createRequestHandler,
1084
- lr as createSecurityAudit,
1085
- fr as createSecurityHeaders,
1086
- It as createSecurityReportHandler,
1087
- dr as cspHash,
1088
- mr as cspNonce,
1089
- Xr as defaultFontPath,
1090
- Bt as defineAdapter,
1091
- $t as defineEnvSchema,
1092
- Jr as defineFonts,
1093
- Qr as defineImages,
1094
- Mt as defineInstrumentation,
1095
- qt as defineLinks,
1096
- hr as defineMetadata,
1097
- At as defineMiddleware,
1098
- yt as defineOgImage,
1099
- wt as defineRobots,
1100
- pr as defineRoutePolicy,
1101
- _t as defineScripts,
1102
- gr as defineSecurityPolicy,
1103
- pt as defineSitemap,
1104
- wr as defineTags,
1105
- yr as enforceAllowedMethods,
1106
- vr as enforceCsrfProtection,
1107
- br as enforceRateLimit,
1108
- Sr as enforceRequestSecurity,
1109
- Nt as enforceWebSocketOrigin,
1110
- Tt as env,
1111
- en as font,
1112
- tn as fontAssetFileName,
1113
- rn as fontAssetUrl,
1114
- nn as fontLinks,
1115
- an as fontMediaType,
1116
- on as fontPreloadLinks,
1117
- sn as fontSources,
1118
- cn as fontStylesheetUrl,
1119
- Vt as getScriptWorker,
1120
- Er as handleRequestWithManifest,
1121
- re as href,
1122
- Rr as html,
1123
- le as httpError,
1124
- Ct as hydrateFileRouter,
1125
- un as isAllowedImageSource,
1126
- de as isHttpError,
1127
- Ar as issueCsrfToken,
1128
- xr as json,
1129
- $r as jsonl,
1130
- kr as link,
1131
- Tr as mergeRoutePolicies,
1132
- Ir as mergeRouteSecurityPolicies,
1133
- Dr as mergeSecurityPolicies,
1134
- Nr as meta,
1135
- Wt as modulePreload,
1136
- Cr as notFound,
1137
- Rt as page,
1138
- $ as parseBodySize,
1139
- C as parseCacheDuration,
1140
- Or as parseCookieHeader,
1141
- ln as parseImageOptimizerRequest,
1142
- Lr as parseRateLimitWindow,
1143
- me as planImageTransform,
1144
- Kt as preconnect,
1145
- Gt as preload,
1146
- zr as query,
1147
- Mr as redirect,
1148
- fn as renderFontFaceCss,
1149
- bt as renderOgImageResponse,
1150
- ye as renderOgImageSvg,
1151
- Zt as renderPageResponse,
1152
- vt as renderRobots,
1153
- gt as renderSitemap,
1154
- Yt as resolveLinks,
1155
- Pr as resolveMetadata,
1156
- Xt as resolveScripts,
1157
- J as response,
1158
- ht as runIdempotentMutation,
1159
- A as script,
1160
- Ur as security,
1161
- X as serializeCacheKey,
1162
- jr as serializeCacheNamespace,
1163
- Fr as serializeCacheTag,
1164
- Hr as serverTiming,
1165
- Br as sse,
1166
- N as startDeferredScripts,
1167
- qr as stream,
1168
- _r as structuredData,
1169
- Vr as tag,
1170
- Wr as text,
1171
- Q as toResponse,
1172
- Kr as validateCorsPolicy,
1173
- kt as validateEnv,
1174
- Gr as validateRateLimitPolicy,
1175
- Zr as validateRouteModules,
1176
- Dt as validateUploads,
1177
- xt as webhook
1373
+ L as COLLECTED_WEB_VITAL_NAMES,
1374
+ Vr as CacheNotFoundError,
1375
+ He as EnvValidationError,
1376
+ xr as FRAMEWORK_TRUSTED_TYPES_POLICY,
1377
+ Ee as HTTP_ERROR_STATUSES,
1378
+ Wr as HttpError,
1379
+ vr as Image,
1380
+ yr as Link,
1381
+ Cr as Script,
1382
+ Rt as WEB_VITAL_NAMES,
1383
+ It as WEB_VITAL_THRESHOLDS,
1384
+ kr as WebVitals,
1385
+ or as action,
1386
+ ar as actionInput,
1387
+ br as analytics,
1388
+ qr as applyFetchMetadataVary,
1389
+ Ir as assertAdapterCapabilities,
1390
+ Gr as auditScriptDependencies,
1391
+ Kr as cacheNotFound,
1392
+ Nr as checkAdapterCapabilities,
1393
+ Jr as checkFetchMetadata,
1394
+ at as checkWebSocketOrigin,
1395
+ Bt as collectWebVitals,
1396
+ Yr as createCache,
1397
+ Zr as createCorsHeaders,
1398
+ Xr as createCsrfCookie,
1399
+ Qr as createCsrfToken,
1400
+ ct as createFileRouter,
1401
+ Lr as createFrameworkScriptUrl,
1402
+ en as createInvalidation,
1403
+ tn as createMemoryCache,
1404
+ rn as createMemoryCacheStore,
1405
+ Yt as createMemoryIdempotencyStore,
1406
+ nn as createMemoryRateLimitStore,
1407
+ on as createRequestHandler,
1408
+ lr as createSecureCookie,
1409
+ an as createSecurityAudit,
1410
+ sn as createSecurityHeaders,
1411
+ mr as createSecurityReportHandler,
1412
+ cn as cspHash,
1413
+ un as cspNonce,
1414
+ Kn as defaultFontPath,
1415
+ Pr as defineAdapter,
1416
+ fr as defineEnvSchema,
1417
+ Jn as defineFonts,
1418
+ Yn as defineImages,
1419
+ Sr as defineInstrumentation,
1420
+ Dr as defineLinks,
1421
+ ln as defineMetadata,
1422
+ sr as defineMiddleware,
1423
+ tr as defineOgImage,
1424
+ er as defineRobots,
1425
+ fn as defineRoutePolicy,
1426
+ Or as defineScripts,
1427
+ dn as defineSecurityPolicy,
1428
+ Xt as defineSitemap,
1429
+ hn as defineTags,
1430
+ Er as defineWebVitals,
1431
+ mn as enforceAllowedMethods,
1432
+ pn as enforceCsrfProtection,
1433
+ gn as enforceFetchMetadataPolicy,
1434
+ wn as enforceRateLimit,
1435
+ yn as enforceRequestSecurity,
1436
+ gr as enforceWebSocketOrigin,
1437
+ hr as env,
1438
+ Zn as font,
1439
+ Xn as fontAssetFileName,
1440
+ Qn as fontAssetUrl,
1441
+ eo as fontLinks,
1442
+ to as fontMediaType,
1443
+ ro as fontPreloadLinks,
1444
+ no as fontSources,
1445
+ oo as fontStylesheetUrl,
1446
+ Mr as getScriptWorker,
1447
+ vn as handleRequestWithManifest,
1448
+ pe as href,
1449
+ bn as html,
1450
+ Re as httpError,
1451
+ wr as hydrateFileRouter,
1452
+ ao as isAllowedImageSource,
1453
+ Sn as isCacheNotFoundError,
1454
+ ke as isHttpError,
1455
+ En as issueCsrfToken,
1456
+ Rn as json,
1457
+ Tn as jsonl,
1458
+ kn as link,
1459
+ An as mergeRoutePolicies,
1460
+ $n as mergeRouteSecurityPolicies,
1461
+ xn as mergeSecurityPolicies,
1462
+ Cn as meta,
1463
+ Fr as modulePreload,
1464
+ In as notFound,
1465
+ ir as page,
1466
+ D as parseBodySize,
1467
+ B as parseCacheDuration,
1468
+ de as parseCookieHeader,
1469
+ io as parseImageOptimizerRequest,
1470
+ Nn as parseRateLimitWindow,
1471
+ Lt as parseWebVitalsBeacon,
1472
+ Ae as planImageTransform,
1473
+ zr as preconnect,
1474
+ Ur as preload,
1475
+ Ln as query,
1476
+ ur as readSecureCookie,
1477
+ Tr as readWebVitalsBeacon,
1478
+ Pn as redirect,
1479
+ so as renderFontFaceCss,
1480
+ nr as renderOgImageResponse,
1481
+ Ne as renderOgImageSvg,
1482
+ Br as renderPageResponse,
1483
+ rr as renderRobots,
1484
+ Qt as renderSitemap,
1485
+ _r as resolveLinks,
1486
+ Dn as resolveMetadata,
1487
+ jr as resolveScripts,
1488
+ le as response,
1489
+ Zt as runIdempotentMutation,
1490
+ I as script,
1491
+ O as secureCookieName,
1492
+ On as security,
1493
+ _t as sendWebVitalsBeacon,
1494
+ ue as serializeCacheKey,
1495
+ Mn as serializeCacheNamespace,
1496
+ Fn as serializeCacheTag,
1497
+ zn as serverTiming,
1498
+ Un as sse,
1499
+ U as startDeferredScripts,
1500
+ Bn as stream,
1501
+ _n as structuredData,
1502
+ jn as tag,
1503
+ Hn as text,
1504
+ fe as toResponse,
1505
+ Vn as validateCorsPolicy,
1506
+ dr as validateEnv,
1507
+ Wn as validateRateLimitPolicy,
1508
+ qn as validateRouteModules,
1509
+ je as validateSecureCookie,
1510
+ pr as validateUploads,
1511
+ Nt as webVitalRating,
1512
+ Rr as webVitalsPolicy,
1513
+ cr as webhook
1178
1514
  };
1179
1515
  //# sourceMappingURL=index.js.map