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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +2 -0
  2. package/dist/adapter/testing.d.ts +33 -0
  3. package/dist/adapter/testing.d.ts.map +1 -0
  4. package/dist/adapter/testing.js +251 -0
  5. package/dist/adapter/testing.js.map +1 -0
  6. package/dist/browser/file-router.d.ts.map +1 -1
  7. package/dist/chunks/document-shell-D1xo6cEA.js +35 -0
  8. package/dist/chunks/document-shell-D1xo6cEA.js.map +1 -0
  9. package/dist/chunks/image-codec-BGTx_t5K.js +141 -0
  10. package/dist/chunks/image-codec-BGTx_t5K.js.map +1 -0
  11. package/dist/chunks/images-B9MqcjSA.js +339 -0
  12. package/dist/chunks/images-B9MqcjSA.js.map +1 -0
  13. package/dist/chunks/request-metadata-D5NrT8ks.js +642 -0
  14. package/dist/chunks/request-metadata-D5NrT8ks.js.map +1 -0
  15. package/dist/chunks/streaming-BQ1bykDo.js +469 -0
  16. package/dist/chunks/streaming-BQ1bykDo.js.map +1 -0
  17. package/dist/chunks/{testing-DBjVCN5v.js → testing-B_iMFYz_.js} +768 -761
  18. package/dist/chunks/testing-B_iMFYz_.js.map +1 -0
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/cli.js +63 -54
  21. package/dist/cli.js.map +1 -1
  22. package/dist/document/deferred-scripts.d.ts +11 -0
  23. package/dist/document/deferred-scripts.d.ts.map +1 -0
  24. package/dist/document/index.d.ts +3 -1
  25. package/dist/document/index.d.ts.map +1 -1
  26. package/dist/document/render.d.ts.map +1 -1
  27. package/dist/document/scripts.d.ts +12 -1
  28. package/dist/document/scripts.d.ts.map +1 -1
  29. package/dist/edge/assets.d.ts +14 -0
  30. package/dist/edge/assets.d.ts.map +1 -0
  31. package/dist/edge/index.d.ts +19 -0
  32. package/dist/edge/index.d.ts.map +1 -0
  33. package/dist/edge/index.js +286 -0
  34. package/dist/edge/index.js.map +1 -0
  35. package/dist/edge/stores.d.ts +8 -0
  36. package/dist/edge/stores.d.ts.map +1 -0
  37. package/dist/edge/streaming.d.ts +7 -0
  38. package/dist/edge/streaming.d.ts.map +1 -0
  39. package/dist/index.d.ts +5 -5
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +423 -420
  42. package/dist/index.js.map +1 -1
  43. package/dist/internal/testing.js +9 -9
  44. package/dist/kv/index.d.ts +3 -0
  45. package/dist/kv/index.d.ts.map +1 -0
  46. package/dist/kv/index.js +103 -0
  47. package/dist/kv/index.js.map +1 -0
  48. package/dist/kv/store.d.ts +28 -0
  49. package/dist/kv/store.d.ts.map +1 -0
  50. package/dist/node/font.d.ts +5 -0
  51. package/dist/node/font.d.ts.map +1 -0
  52. package/dist/node/image.d.ts +15 -0
  53. package/dist/node/image.d.ts.map +1 -0
  54. package/dist/node/index.d.ts +4 -0
  55. package/dist/node/index.d.ts.map +1 -1
  56. package/dist/node/index.js +25 -23
  57. package/dist/node/index.js.map +1 -1
  58. package/dist/node/streaming.d.ts.map +1 -1
  59. package/dist/platform/analytics.d.ts +58 -5
  60. package/dist/platform/analytics.d.ts.map +1 -1
  61. package/dist/platform/font-assets.d.ts +19 -0
  62. package/dist/platform/font-assets.d.ts.map +1 -0
  63. package/dist/platform/fonts.d.ts +14 -4
  64. package/dist/platform/fonts.d.ts.map +1 -1
  65. package/dist/platform/image-codec.d.ts +15 -0
  66. package/dist/platform/image-codec.d.ts.map +1 -0
  67. package/dist/platform/image-url.d.ts +17 -0
  68. package/dist/platform/image-url.d.ts.map +1 -0
  69. package/dist/platform/image.d.ts +8 -0
  70. package/dist/platform/image.d.ts.map +1 -0
  71. package/dist/platform/images.d.ts +15 -0
  72. package/dist/platform/images.d.ts.map +1 -1
  73. package/dist/platform/index.d.ts +8 -5
  74. package/dist/platform/index.d.ts.map +1 -1
  75. package/dist/redis/index.d.ts +3 -0
  76. package/dist/redis/index.d.ts.map +1 -0
  77. package/dist/redis/index.js +171 -0
  78. package/dist/redis/index.js.map +1 -0
  79. package/dist/redis/store.d.ts +8 -0
  80. package/dist/redis/store.d.ts.map +1 -0
  81. package/dist/security/index.d.ts +1 -1
  82. package/dist/security/index.d.ts.map +1 -1
  83. package/dist/security/policy.d.ts +2 -27
  84. package/dist/security/policy.d.ts.map +1 -1
  85. package/dist/security/types.d.ts +10 -3
  86. package/dist/security/types.d.ts.map +1 -1
  87. package/dist/security/verification.d.ts.map +1 -1
  88. package/dist/server/document-shell.d.ts +12 -0
  89. package/dist/server/document-shell.d.ts.map +1 -0
  90. package/dist/static/images.d.ts +13 -0
  91. package/dist/static/images.d.ts.map +1 -0
  92. package/dist/static/index.d.ts +8 -0
  93. package/dist/static/index.d.ts.map +1 -1
  94. package/dist/static/index.js +421 -313
  95. package/dist/static/index.js.map +1 -1
  96. package/dist/static/vercel.d.ts +3 -0
  97. package/dist/static/vercel.d.ts.map +1 -1
  98. package/dist/vite/index.js +412 -387
  99. package/dist/vite/index.js.map +1 -1
  100. package/dist/vite/plugin.d.ts +7 -0
  101. package/dist/vite/plugin.d.ts.map +1 -1
  102. package/package.json +34 -3
  103. package/dist/chunks/request-metadata-DwEO1EAS.js +0 -477
  104. package/dist/chunks/request-metadata-DwEO1EAS.js.map +0 -1
  105. package/dist/chunks/streaming-Ci6vf3BB.js +0 -353
  106. package/dist/chunks/streaming-Ci6vf3BB.js.map +0 -1
  107. package/dist/chunks/testing-DBjVCN5v.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import { n as Dt, o as Je, w as Ke, e as Ye, p as $t, q as Nt, k as Ot, r as Lt } from "./request-metadata-DwEO1EAS.js";
2
- import { createElement as ue } from "react";
3
- import { renderToString as Ze } from "react-dom/server";
1
+ import { w as $t, v as kt, x as _e, y as Ve, e as Je, z as Dt, A as Nt, l as Ot, a as Lt } from "./request-metadata-D5NrT8ks.js";
2
+ import { createElement as fe } from "react";
3
+ import { renderToString as Ke } from "react-dom/server";
4
4
  import { jsxs as I, jsx as M } from "react/jsx-runtime";
5
- const ke = ["build", "private", "public"], It = {
5
+ const Ae = ["build", "private", "public"], It = {
6
6
  app: "demiurge-memory",
7
7
  environment: "local",
8
8
  schemaVersion: 1
9
9
  }, Mt = 1e4, Ut = 3e4;
10
- function ti(e) {
10
+ function ni(e) {
11
11
  return (...t) => ({
12
12
  fn: () => e.fn(...t),
13
13
  key: e.key(...t),
@@ -17,44 +17,44 @@ function ti(e) {
17
17
  ttl: e.ttl
18
18
  });
19
19
  }
20
- function ri(e) {
20
+ function si(e) {
21
21
  return { id: e };
22
22
  }
23
- function ni(e) {
23
+ function ii(e) {
24
24
  return e;
25
25
  }
26
- function Qe(e) {
27
- const t = e.now ?? Date.now, r = Wt(e.refreshLeaseTtl), n = Xe(e.namespace), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
26
+ function Ye(e) {
27
+ const t = e.now ?? Date.now, r = Wt(e.refreshLeaseTtl), n = Ze(e.namespace), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
28
28
  return {
29
29
  async get(o) {
30
30
  const a = o.scope ?? "request";
31
31
  if (a === "none")
32
32
  return await o.fn();
33
- const c = Ae(o.key);
33
+ const c = $e(o.key);
34
34
  if (a === "request")
35
35
  return await Ft(s, c, o, t);
36
- const u = De(n, a, c), f = (o.tags ?? []).map(
37
- (g) => $e(n, a, fe(g))
36
+ const u = ke(n, a, c), f = (o.tags ?? []).map(
37
+ (g) => De(n, a, le(g))
38
38
  ), l = await e.store.get(u);
39
39
  if (l && (l.expiresAt === null || l.expiresAt > t()))
40
40
  return l.value;
41
41
  if (l && qt(l, t())) {
42
- const g = zt(e.store), k = globalThis.crypto.randomUUID();
42
+ const g = zt(e.store), A = globalThis.crypto.randomUUID();
43
43
  if (await g.acquireRefreshLease(
44
44
  u,
45
- k,
45
+ A,
46
46
  t() + r
47
47
  )) {
48
- const ee = Bt({
48
+ const te = Bt({
49
49
  key: u,
50
50
  now: t,
51
51
  onBackgroundError: e.onBackgroundError,
52
52
  refreshStore: g,
53
53
  request: o,
54
54
  tags: f,
55
- token: k
55
+ token: A
56
56
  });
57
- e.waitUntil?.(ee);
57
+ e.waitUntil?.(te);
58
58
  }
59
59
  return l.value;
60
60
  }
@@ -63,44 +63,44 @@ function Qe(e) {
63
63
  if (m)
64
64
  return await m.promise;
65
65
  const d = { invalidated: !1 }, P = Promise.resolve().then(o.fn).then(async (g) => (d.invalidated || await e.store.set(u, {
66
- expiresAt: et(t(), o.ttl),
67
- staleUntil: tt(
66
+ expiresAt: Qe(t(), o.ttl),
67
+ staleUntil: Xe(
68
68
  t(),
69
69
  o.ttl,
70
70
  o.staleWhileRevalidate
71
71
  ),
72
72
  tags: f,
73
73
  value: g
74
- }), g)), A = {
74
+ }), g)), $ = {
75
75
  promise: P,
76
76
  state: d,
77
77
  tags: f
78
78
  };
79
- i.set(u, A);
79
+ i.set(u, $);
80
80
  try {
81
81
  return await P;
82
82
  } finally {
83
- i.get(u) === A && i.delete(u);
83
+ i.get(u) === $ && i.delete(u);
84
84
  }
85
85
  },
86
86
  async invalidateKey(o) {
87
- const a = Ae(o), c = s.delete(a);
87
+ const a = $e(o), c = s.delete(a);
88
88
  let u = !1;
89
89
  const f = await Promise.all(
90
- ke.map((l) => {
91
- const m = De(n, l, a), d = i.get(m);
90
+ Ae.map((l) => {
91
+ const m = ke(n, l, a), d = i.get(m);
92
92
  return d && (d.state.invalidated = !0, u = !0), e.store.delete(m);
93
93
  })
94
94
  );
95
95
  return c || u || f.some(Boolean);
96
96
  },
97
97
  async invalidateTags(o) {
98
- const a = o.map(fe), c = Gt(
98
+ const a = o.map(le), c = Gt(
99
99
  s,
100
100
  new Set(a)
101
101
  ), u = new Set(
102
- ke.flatMap(
103
- (m) => a.map((d) => $e(n, m, d))
102
+ Ae.flatMap(
103
+ (m) => a.map((d) => De(n, m, d))
104
104
  )
105
105
  );
106
106
  let f = 0;
@@ -113,7 +113,7 @@ function Qe(e) {
113
113
  }
114
114
  function ge(e = {}) {
115
115
  const t = e.now ?? Date.now;
116
- return Qe({
116
+ return Ye({
117
117
  namespace: It,
118
118
  now: t,
119
119
  onBackgroundError: e.onBackgroundError,
@@ -131,8 +131,8 @@ function Ht(e = {}) {
131
131
  throw new Error(
132
132
  "Demiurge memory cache maximumEntries must be a positive integer."
133
133
  );
134
- te(t, r, s()), jt(t, n);
135
- let i = re(t);
134
+ re(t, r, s()), jt(t, n);
135
+ let i = ne(t);
136
136
  return {
137
137
  acquireRefreshLease(o, a, c) {
138
138
  const u = s(), f = r.get(o);
@@ -142,7 +142,7 @@ function Ht(e = {}) {
142
142
  return r.delete(o), t.delete(o);
143
143
  },
144
144
  get(o) {
145
- return s() >= i && (te(t, r, s()), i = re(t)), t.get(o);
145
+ return s() >= i && (re(t, r, s()), i = ne(t)), t.get(o);
146
146
  },
147
147
  invalidateTags(o) {
148
148
  const a = new Set(o);
@@ -166,7 +166,7 @@ function Ht(e = {}) {
166
166
  },
167
167
  set(o, a) {
168
168
  const c = s();
169
- c >= i && (te(t, r, c), i = re(t)), r.delete(o), Ce(
169
+ c >= i && (re(t, r, c), i = ne(t)), r.delete(o), Ce(
170
170
  t,
171
171
  r,
172
172
  n,
@@ -176,7 +176,7 @@ function Ht(e = {}) {
176
176
  }
177
177
  };
178
178
  }
179
- function te(e, t, r) {
179
+ function re(e, t, r) {
180
180
  for (const [n, s] of e)
181
181
  s.staleUntil !== null && s.staleUntil <= r && (e.delete(n), t.delete(n));
182
182
  }
@@ -198,14 +198,14 @@ function jt(e, t) {
198
198
  e.delete(r);
199
199
  }
200
200
  }
201
- function re(e) {
201
+ function ne(e) {
202
202
  let t = Number.POSITIVE_INFINITY;
203
203
  for (const r of e.values())
204
204
  r.staleUntil !== null && (t = Math.min(t, r.staleUntil));
205
205
  return t;
206
206
  }
207
- function Xe(e) {
208
- const t = ne("app", e.app), r = ne(
207
+ function Ze(e) {
208
+ const t = se("app", e.app), r = se(
209
209
  "environment",
210
210
  e.environment
211
211
  );
@@ -213,13 +213,13 @@ function Xe(e) {
213
213
  throw new Error(
214
214
  "Demiurge cache namespace schemaVersion must be a non-negative integer or string."
215
215
  );
216
- const n = ne(
216
+ const n = se(
217
217
  "schemaVersion",
218
218
  String(e.schemaVersion)
219
219
  );
220
220
  return `${t}:${r}:${n}`;
221
221
  }
222
- function si(e) {
222
+ function oi(e) {
223
223
  return {
224
224
  async key(t) {
225
225
  return {
@@ -264,10 +264,10 @@ function U(e) {
264
264
  const r = Number(t[1]), n = t[2];
265
265
  return n === "h" ? r * 36e5 : n === "m" ? r * 6e4 : n === "s" ? r * 1e3 : r;
266
266
  }
267
- function Ae(e) {
268
- return le(e, /* @__PURE__ */ new Set());
267
+ function $e(e) {
268
+ return de(e, /* @__PURE__ */ new Set());
269
269
  }
270
- function fe(e) {
270
+ function le(e) {
271
271
  return e.id;
272
272
  }
273
273
  async function Ft(e, t, r, n) {
@@ -276,7 +276,7 @@ async function Ft(e, t, r, n) {
276
276
  return await s.value;
277
277
  const i = Promise.resolve().then(r.fn), o = {
278
278
  expiresAt: n() + U(r.ttl),
279
- tags: (r.tags ?? []).map(fe),
279
+ tags: (r.tags ?? []).map(le),
280
280
  value: i
281
281
  };
282
282
  e.set(t, o);
@@ -286,17 +286,17 @@ async function Ft(e, t, r, n) {
286
286
  throw e.get(t) === o && e.delete(t), a;
287
287
  }
288
288
  }
289
- function De(e, t, r) {
289
+ function ke(e, t, r) {
290
290
  return `${e}:${t}:key:${r}`;
291
291
  }
292
- function $e(e, t, r) {
292
+ function De(e, t, r) {
293
293
  return `${e}:${t}:tag:${r}`;
294
294
  }
295
- function et(e, t) {
295
+ function Qe(e, t) {
296
296
  const r = U(t);
297
297
  return Number.isFinite(r) ? e + r : null;
298
298
  }
299
- function tt(e, t, r) {
299
+ function Xe(e, t, r) {
300
300
  const n = U(t);
301
301
  if (!Number.isFinite(n)) {
302
302
  if (r !== void 0)
@@ -329,8 +329,8 @@ async function Bt(e) {
329
329
  try {
330
330
  const t = await e.request.fn(), r = e.now();
331
331
  await e.refreshStore.publishRefresh(e.key, e.token, {
332
- expiresAt: et(r, e.request.ttl),
333
- staleUntil: tt(
332
+ expiresAt: Qe(r, e.request.ttl),
333
+ staleUntil: Xe(
334
334
  r,
335
335
  e.request.ttl,
336
336
  e.request.staleWhileRevalidate
@@ -344,7 +344,7 @@ async function Bt(e) {
344
344
  await e.refreshStore.releaseRefreshLease(e.key, e.token);
345
345
  }
346
346
  }
347
- function ne(e, t) {
347
+ function se(e, t) {
348
348
  const r = [...t].some((n) => {
349
349
  const s = n.charCodeAt(0);
350
350
  return s <= 31 || s === 127;
@@ -361,7 +361,7 @@ function Gt(e, t) {
361
361
  s.tags.some((i) => t.has(i)) && (e.delete(n), r += 1);
362
362
  return r;
363
363
  }
364
- function le(e, t) {
364
+ function de(e, t) {
365
365
  if (e === null || typeof e == "boolean" || typeof e == "string")
366
366
  return JSON.stringify(e);
367
367
  if (typeof e == "number") {
@@ -389,7 +389,7 @@ function le(e, t) {
389
389
  throw t.delete(e), new Error(
390
390
  "Demiurge cache key arrays must be dense and cannot contain accessors or custom properties."
391
391
  );
392
- const c = `[${e.map((u) => le(u, t)).join(",")}]`;
392
+ const c = `[${e.map((u) => de(u, t)).join(",")}]`;
393
393
  return t.delete(e), c;
394
394
  }
395
395
  const r = Object.getPrototypeOf(e);
@@ -406,86 +406,26 @@ function le(e, t) {
406
406
  "Demiurge cache key objects require enumerable string data properties."
407
407
  );
408
408
  const s = e, i = `{${Object.keys(s).sort().map(
409
- (o) => `${JSON.stringify(o)}:${le(s[o], t)}`
409
+ (o) => `${JSON.stringify(o)}:${de(s[o], t)}`
410
410
  ).join(",")}}`;
411
411
  return t.delete(e), i;
412
412
  }
413
- function ii(e) {
413
+ function ai(e) {
414
414
  return e;
415
415
  }
416
- function oi(e, t = {}) {
417
- return {
418
- ...t,
419
- href: e,
420
- kind: "link",
421
- rel: "preconnect"
422
- };
423
- }
424
- function ai(e, t) {
425
- return {
426
- ...t,
427
- href: e,
428
- kind: "link",
429
- rel: "preload"
430
- };
431
- }
432
416
  function ci(e) {
433
- return {
434
- href: e,
435
- kind: "link",
436
- rel: "modulepreload"
437
- };
438
- }
439
- async function _t(e, t) {
440
- const r = [];
441
- for (const n of e) {
442
- if (!n)
443
- continue;
444
- const s = typeof n == "function" ? await n(t) : n;
445
- r.push(...s);
446
- }
447
- return Vt(r).sort(Jt);
448
- }
449
- function Vt(e) {
450
- const t = /* @__PURE__ */ new Map();
451
- for (const r of e)
452
- t.set(Ne(r), {
453
- ...t.get(Ne(r)),
454
- ...r
455
- });
456
- return [...t.values()];
457
- }
458
- function Ne(e) {
459
- return [
460
- e.rel,
461
- e.href,
462
- e.as ?? "",
463
- e.type ?? "",
464
- e.crossOrigin ?? ""
465
- ].join("\0");
466
- }
467
- function Jt(e, t) {
468
- return Oe(e.rel) - Oe(t.rel) || e.href.localeCompare(t.href);
469
- }
470
- function Oe(e) {
471
- return e === "preconnect" ? 0 : e === "preload" ? 1 : e === "modulepreload" ? 2 : 3;
472
- }
473
- function ui(e) {
474
- return e;
475
- }
476
- function fi(e) {
477
417
  return {
478
418
  ...e,
479
419
  kind: "meta"
480
420
  };
481
421
  }
482
- function li(e) {
422
+ function ui(e) {
483
423
  return {
484
424
  ...e,
485
425
  kind: "link"
486
426
  };
487
427
  }
488
- function di(e) {
428
+ function fi(e) {
489
429
  return {
490
430
  kind: "structured-data",
491
431
  value: e
@@ -497,8 +437,8 @@ function v(...e) {
497
437
  structuredData: []
498
438
  };
499
439
  for (const i of e)
500
- i && Kt(t, i);
501
- const r = Zt(t), n = t.description, s = Qt(t.openGraph, r, n);
440
+ i && _t(t, i);
441
+ const r = Jt(t), n = t.description, s = Kt(t.openGraph, r, n);
502
442
  return {
503
443
  canonical: t.canonical,
504
444
  charset: "utf-8",
@@ -511,8 +451,8 @@ function v(...e) {
511
451
  viewport: "width=device-width, initial-scale=1"
512
452
  };
513
453
  }
514
- function Kt(e, t) {
515
- Yt(e, t.title), t.description !== void 0 && (e.description = t.description), t.canonical !== void 0 && (e.canonical = t.canonical), t.robots && (e.robots = {
454
+ function _t(e, t) {
455
+ Vt(e, t.title), t.description !== void 0 && (e.description = t.description), t.canonical !== void 0 && (e.canonical = t.canonical), t.robots && (e.robots = {
516
456
  ...e.robots ?? {},
517
457
  ...t.robots
518
458
  }), t.openGraph && (e.openGraph = {
@@ -520,7 +460,7 @@ function Kt(e, t) {
520
460
  ...t.openGraph
521
461
  }), t.custom && e.custom.push(...t.custom), t.structuredData && e.structuredData.push(...t.structuredData);
522
462
  }
523
- function Yt(e, t) {
463
+ function Vt(e, t) {
524
464
  if (t !== void 0) {
525
465
  if (typeof t == "string") {
526
466
  e.title = t;
@@ -529,10 +469,10 @@ function Yt(e, t) {
529
469
  t.default !== void 0 && (e.titleDefault = t.default), t.format && (e.titleFormat = t.format);
530
470
  }
531
471
  }
532
- function Zt(e) {
472
+ function Jt(e) {
533
473
  return e.title === void 0 ? e.titleDefault : e.titleFormat ? e.titleFormat(e.title) : e.title;
534
474
  }
535
- function Qt(e, t, r) {
475
+ function Kt(e, t, r) {
536
476
  if (!(!e && !t && !r))
537
477
  return {
538
478
  ...t ? { title: t } : {},
@@ -540,7 +480,7 @@ function Qt(e, t, r) {
540
480
  ...e ?? {}
541
481
  };
542
482
  }
543
- function rt(e) {
483
+ function et(e) {
544
484
  const t = {
545
485
  fallbacks: {
546
486
  error: [],
@@ -612,11 +552,11 @@ function rt(e) {
612
552
  file: r,
613
553
  fileSegments: s,
614
554
  segments: R(s),
615
- score: pr(s),
555
+ score: dr(s),
616
556
  load: n
617
557
  });
618
558
  }
619
- return Xt(t.routes), t.routes.sort(rr), t.layouts.sort(
559
+ return Yt(t.routes), t.routes.sort(Xt), t.layouts.sort(
620
560
  (r, n) => r.fileSegments.length - n.fileSegments.length || r.file.localeCompare(n.file)
621
561
  ), t.policies.sort(
622
562
  (r, n) => r.fileSegments.length - n.fileSegments.length || r.file.localeCompare(n.file)
@@ -630,7 +570,7 @@ function rt(e) {
630
570
  (r, n) => r.fileSegments.length - n.fileSegments.length || r.file.localeCompare(n.file)
631
571
  ), t;
632
572
  }
633
- function Xt(e) {
573
+ function Yt(e) {
634
574
  const t = /* @__PURE__ */ new Map();
635
575
  for (const r of e) {
636
576
  const n = r.segments.findIndex(
@@ -640,37 +580,37 @@ function Xt(e) {
640
580
  throw new Error(
641
581
  `Catchall route segment in "${r.file}" must be the final URL segment.`
642
582
  );
643
- const s = r.segments.map(er).join("/"), i = t.get(s);
583
+ const s = r.segments.map(Zt).join("/"), i = t.get(s);
644
584
  if (i)
645
585
  throw new Error(
646
- `Ambiguous routes "${i.file}" and "${r.file}" have the same runtime shape and both match "${tr(r.segments)}".`
586
+ `Ambiguous routes "${i.file}" and "${r.file}" have the same runtime shape and both match "${Qt(r.segments)}".`
647
587
  );
648
588
  t.set(s, r);
649
589
  }
650
590
  }
651
- function er(e) {
591
+ function Zt(e) {
652
592
  return e.startsWith("*") ? "*" : e.startsWith(":") ? ":" : `=${e}`;
653
593
  }
654
- function tr(e) {
594
+ function Qt(e) {
655
595
  return e.length === 0 ? "/" : `/${e.map((t) => t.startsWith(":") || t.startsWith("*") ? "example" : t).join("/")}`;
656
596
  }
657
- function rr(e, t) {
597
+ function Xt(e, t) {
658
598
  const r = Math.max(e.segments.length, t.segments.length);
659
599
  for (let n = 0; n < r; n += 1) {
660
- const s = Le(t.segments[n]) - Le(e.segments[n]);
600
+ const s = Ne(t.segments[n]) - Ne(e.segments[n]);
661
601
  if (s !== 0)
662
602
  return s;
663
603
  }
664
604
  return e.file.localeCompare(t.file);
665
605
  }
666
- function Le(e) {
606
+ function Ne(e) {
667
607
  return e === void 0 ? 4 : e.startsWith("*") ? 1 : e.startsWith(":") ? 2 : 3;
668
608
  }
669
- async function nt(e, t, r = new Request(`http://demiurge.local${t}`), n, s = ge(), i = {}) {
670
- const o = i.documentContributions ?? !0, a = j(e.routes, t);
609
+ async function tt(e, t, r = new Request(`http://demiurge.local${t}`), n, s = ge(), i = {}) {
610
+ const o = i.documentContributions ?? !0, a = F(e.routes, t);
671
611
  if (!a)
672
612
  return {
673
- ...await de(e, t, {
613
+ ...await me(e, t, {
674
614
  documentContributions: o
675
615
  }),
676
616
  status: "not-found"
@@ -680,7 +620,7 @@ async function nt(e, t, r = new Request(`http://demiurge.local${t}`), n, s = ge(
680
620
  ), u = await a.route.load();
681
621
  if (!u.GET || u.GET.kind !== "page")
682
622
  return {
683
- ...await de(e, t, {
623
+ ...await me(e, t, {
684
624
  fallback: ye(
685
625
  e.fallbacks.notFound,
686
626
  a.route
@@ -703,8 +643,8 @@ async function nt(e, t, r = new Request(`http://demiurge.local${t}`), n, s = ge(
703
643
  status: "ready",
704
644
  match: {
705
645
  data: u.GET.data && !n?.hasData ? await u.GET.data(m) : n?.data,
706
- error: await st(e, a.route),
707
- links: o ? await _t(
646
+ error: await rt(e, a.route),
647
+ links: o ? await kt(
708
648
  [
709
649
  ...f.map((d) => d.links),
710
650
  u.links
@@ -722,7 +662,7 @@ async function nt(e, t, r = new Request(`http://demiurge.local${t}`), n, s = ge(
722
662
  path: a.path,
723
663
  pathname: t,
724
664
  render: u.GET.render,
725
- scripts: o ? await Dt(
665
+ scripts: o ? await $t(
726
666
  [
727
667
  ...f.map((d) => d.scripts),
728
668
  u.scripts
@@ -732,7 +672,7 @@ async function nt(e, t, r = new Request(`http://demiurge.local${t}`), n, s = ge(
732
672
  }
733
673
  };
734
674
  }
735
- async function mi(e, t = {}) {
675
+ async function li(e, t = {}) {
736
676
  const r = ge(), n = [];
737
677
  for (const s of e.routes) {
738
678
  const i = await s.load();
@@ -742,8 +682,8 @@ async function mi(e, t = {}) {
742
682
  throw new Error(
743
683
  `Page route "${s.file}" uses render mode "${i.GET.render.mode}" and cannot be emitted as static output. Set render: { mode: "static" } or deploy a runtime adapter.`
744
684
  );
745
- const o = ur(s.segments);
746
- if (lr(s.segments).length === 0) {
685
+ const o = or(s.segments);
686
+ if (cr(s.segments).length === 0) {
747
687
  n.push({
748
688
  file: s.file,
749
689
  path: {},
@@ -758,28 +698,28 @@ async function mi(e, t = {}) {
758
698
  );
759
699
  const c = await i.paths({ cache: r });
760
700
  for (const u of c) {
761
- const f = dr(s, o, u);
701
+ const f = ur(s, o, u);
762
702
  n.push({
763
703
  file: s.file,
764
704
  path: f,
765
705
  pattern: o,
766
- pathname: hr(s.segments, f)
706
+ pathname: lr(s.segments, f)
767
707
  });
768
708
  }
769
709
  }
770
710
  return n;
771
711
  }
772
- async function hi(e, t) {
773
- const r = j(e.routes, t);
712
+ async function di(e, t) {
713
+ const r = F(e.routes, t);
774
714
  if (r)
775
- return await ar(
715
+ return await sr(
776
716
  ye(e.fallbacks.loading, r.route)
777
717
  );
778
718
  }
779
- async function nr(e, t) {
719
+ async function er(e, t) {
780
720
  let r;
781
721
  try {
782
- r = j(e.routes, t);
722
+ r = F(e.routes, t);
783
723
  } catch (n) {
784
724
  if (!(n instanceof Ee)) throw n;
785
725
  return await Se(
@@ -788,20 +728,20 @@ async function nr(e, t) {
788
728
  )
789
729
  );
790
730
  }
791
- return r ? await st(e, r.route) : await sr(e, t);
731
+ return r ? await rt(e, r.route) : await tr(e, t);
792
732
  }
793
- async function st(e, t) {
733
+ async function rt(e, t) {
794
734
  return await Se(
795
735
  ye(e.fallbacks.error, t)
796
736
  );
797
737
  }
798
- async function sr(e, t) {
738
+ async function tr(e, t) {
799
739
  return await Se(
800
- it(e.fallbacks.error, t)
740
+ nt(e.fallbacks.error, t)
801
741
  );
802
742
  }
803
- async function de(e, t, r = {}) {
804
- const s = await (r.fallback ?? it(e.fallbacks.notFound, t))?.load(), i = s?.default, o = r.documentContributions ?? !0;
743
+ async function me(e, t, r = {}) {
744
+ const s = await (r.fallback ?? nt(e.fallbacks.notFound, t))?.load(), i = s?.default, o = r.documentContributions ?? !0;
805
745
  if (s?.layout === !1)
806
746
  return {
807
747
  layouts: [],
@@ -809,7 +749,7 @@ async function de(e, t, r = {}) {
809
749
  notFound: i,
810
750
  pathname: t
811
751
  };
812
- const a = r.layouts ?? ir(e, t);
752
+ const a = r.layouts ?? rr(e, t);
813
753
  try {
814
754
  const c = await Promise.all(
815
755
  a.map((u) => u.load())
@@ -834,16 +774,16 @@ async function de(e, t, r = {}) {
834
774
  };
835
775
  }
836
776
  }
837
- function ir(e, t) {
838
- const r = Q(t);
777
+ function rr(e, t) {
778
+ const r = X(t);
839
779
  return e.layouts.filter(
840
- (n) => !n.fileSegments.some(Z) && we(n.segments, r)
780
+ (n) => !n.fileSegments.some(Q) && we(n.segments, r)
841
781
  );
842
782
  }
843
- function or(e, t) {
844
- const r = Q(t);
783
+ function nr(e, t) {
784
+ const r = X(t);
845
785
  return e.policies.filter(
846
- (n) => !n.fileSegments.some(Z) && we(n.segments, r)
786
+ (n) => !n.fileSegments.some(Q) && we(n.segments, r)
847
787
  );
848
788
  }
849
789
  function ye(e, t) {
@@ -853,34 +793,34 @@ function ye(e, t) {
853
793
  return n;
854
794
  }
855
795
  }
856
- function it(e, t) {
857
- const r = Q(t);
796
+ function nt(e, t) {
797
+ const r = X(t);
858
798
  for (let n = e.length - 1; n >= 0; n -= 1) {
859
799
  const s = e[n];
860
- if (!s.fileSegments.some(Z) && we(s.segments, r))
800
+ if (!s.fileSegments.some(Q) && we(s.segments, r))
861
801
  return s;
862
802
  }
863
803
  }
864
804
  function we(e, t) {
865
805
  return e.every((r, n) => r.startsWith("*") ? t.length > n : r.startsWith(":") ? !!t[n] : t[n] === r);
866
806
  }
867
- async function ar(e) {
807
+ async function sr(e) {
868
808
  return e ? (await e.load()).default : void 0;
869
809
  }
870
810
  async function Se(e) {
871
811
  return e ? (await e.load()).default : void 0;
872
812
  }
873
- function j(e, t) {
874
- const r = Q(t);
813
+ function F(e, t) {
814
+ const r = X(t);
875
815
  for (const n of e) {
876
- const s = cr(n.segments, r);
816
+ const s = ir(n.segments, r);
877
817
  if (s)
878
818
  return { route: n, path: s };
879
819
  }
880
820
  return null;
881
821
  }
882
- const pi = nt, gi = j;
883
- function cr(e, t) {
822
+ const mi = tt, hi = F;
823
+ function ir(e, t) {
884
824
  const r = {};
885
825
  for (let n = 0; n < e.length; n += 1) {
886
826
  const s = e[n], i = t[n];
@@ -897,7 +837,7 @@ function cr(e, t) {
897
837
  }
898
838
  return e.length === t.length ? r : null;
899
839
  }
900
- function yi(e, t) {
840
+ function pi(e, t) {
901
841
  return e.every(
902
842
  (r, n) => t[n] === r
903
843
  );
@@ -908,21 +848,21 @@ function T(e, t) {
908
848
  );
909
849
  }
910
850
  function R(e) {
911
- return e.flatMap((t) => Z(t) ? [] : t === "index" ? [] : t.startsWith("[...") && t.endsWith("]") ? [`*${t.slice(4, -1)}`] : t.startsWith("[") && t.endsWith("]") ? [`:${t.slice(1, -1)}`] : [t]);
851
+ return e.flatMap((t) => Q(t) ? [] : t === "index" ? [] : t.startsWith("[...") && t.endsWith("]") ? [`*${t.slice(4, -1)}`] : t.startsWith("[") && t.endsWith("]") ? [`:${t.slice(1, -1)}`] : [t]);
912
852
  }
913
- function Z(e) {
853
+ function Q(e) {
914
854
  return e.startsWith("(") && e.endsWith(")");
915
855
  }
916
- function ur(e) {
917
- return e.length === 0 ? "/" : `/${e.map(fr).join("/")}`;
856
+ function or(e) {
857
+ return e.length === 0 ? "/" : `/${e.map(ar).join("/")}`;
918
858
  }
919
- function fr(e) {
859
+ function ar(e) {
920
860
  return e.startsWith("*") ? `[...${e.slice(1)}]` : e.startsWith(":") ? `[${e.slice(1)}]` : e;
921
861
  }
922
- function lr(e) {
862
+ function cr(e) {
923
863
  return e.flatMap((t) => t.startsWith(":") || t.startsWith("*") ? [t.slice(1)] : []);
924
864
  }
925
- function dr(e, t, r) {
865
+ function ur(e, t, r) {
926
866
  const n = {};
927
867
  for (const s of e.segments) {
928
868
  if (!s.startsWith(":") && !s.startsWith("*"))
@@ -932,7 +872,7 @@ function dr(e, t, r) {
932
872
  throw new Error(
933
873
  `Static paths for "${e.file}" must include "${i}" for "${t}".`
934
874
  );
935
- if (!mr(o))
875
+ if (!fr(o))
936
876
  throw new Error(
937
877
  `Static path "${i}" for "${e.file}" must be a string, number, or boolean.`
938
878
  );
@@ -940,16 +880,16 @@ function dr(e, t, r) {
940
880
  }
941
881
  return n;
942
882
  }
943
- function mr(e) {
883
+ function fr(e) {
944
884
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
945
885
  }
946
- function hr(e, t) {
886
+ function lr(e, t) {
947
887
  return `/${e.map((n) => n.startsWith("*") ? t[n.slice(1)].split("/").filter(Boolean).map(encodeURIComponent).join("/") : n.startsWith(":") ? encodeURIComponent(t[n.slice(1)]) : encodeURIComponent(n)).filter(Boolean).join("/")}`;
948
888
  }
949
- function pr(e) {
889
+ function dr(e) {
950
890
  return R(e).reduce((t, r) => r.startsWith("*") ? t : r.startsWith(":") ? t + 1 : t + 2, 0);
951
891
  }
952
- function Q(e) {
892
+ function X(e) {
953
893
  return e.replace(/^\/|\/$/g, "").split("/").filter(Boolean).map((t) => {
954
894
  try {
955
895
  return decodeURIComponent(t);
@@ -967,35 +907,35 @@ class Ee extends URIError {
967
907
  ), this.name = "MalformedPathnameError", this.pathname = t;
968
908
  }
969
909
  }
970
- const C = "x-demiurge-navigation", gr = "data", yr = "data", se = "error", Ie = "not-found";
971
- function ot(e) {
972
- return e.headers.get(C) === gr;
910
+ const C = "x-demiurge-navigation", mr = "data", hr = "data", ie = "error", Oe = "not-found";
911
+ function st(e) {
912
+ return e.headers.get(C) === mr;
973
913
  }
974
- function wr(e) {
914
+ function pr(e) {
975
915
  return Response.json(
976
916
  { data: e, hasData: !0 },
977
917
  {
978
918
  headers: {
979
919
  "cache-control": "no-store",
980
- [C]: yr,
920
+ [C]: hr,
981
921
  vary: C
982
922
  }
983
923
  }
984
924
  );
985
925
  }
986
- function q(e, t) {
926
+ function z(e, t) {
987
927
  return e.headers.set("cache-control", "no-store"), e.headers.set(C, t), e.headers.append("vary", C), e;
988
928
  }
989
- function Sr(e) {
929
+ function gr(e) {
990
930
  if (typeof e == "string")
991
931
  return e;
992
- const t = Er(br(
932
+ const t = yr(Er(
993
933
  e.to,
994
934
  "path" in e ? e.path : void 0
995
- )), r = e.search === void 0 ? t.search : Rr(e.search), n = e.hash === void 0 ? t.hash : e.hash ? e.hash.startsWith("#") ? e.hash : `#${e.hash}` : "";
935
+ )), r = e.search === void 0 ? t.search : wr(e.search), n = e.hash === void 0 ? t.hash : e.hash ? e.hash.startsWith("#") ? e.hash : `#${e.hash}` : "";
996
936
  return `${t.pathname}${r}${n}`;
997
937
  }
998
- function Er(e) {
938
+ function yr(e) {
999
939
  const t = e.indexOf("#"), r = t === -1 ? e : e.slice(0, t), n = r.indexOf("?");
1000
940
  return {
1001
941
  hash: t === -1 ? "" : e.slice(t),
@@ -1003,15 +943,15 @@ function Er(e) {
1003
943
  search: n === -1 ? "" : r.slice(n)
1004
944
  };
1005
945
  }
1006
- function Rr(e) {
946
+ function wr(e) {
1007
947
  if (!e)
1008
948
  return "";
1009
949
  if (typeof e == "string")
1010
950
  return e.startsWith("?") ? e : `?${e}`;
1011
- const r = (e instanceof URLSearchParams ? e : vr(e)).toString();
951
+ const r = (e instanceof URLSearchParams ? e : Sr(e)).toString();
1012
952
  return r ? `?${r}` : "";
1013
953
  }
1014
- function vr(e) {
954
+ function Sr(e) {
1015
955
  const t = new URLSearchParams();
1016
956
  for (const [r, n] of Object.entries(e)) {
1017
957
  const s = Array.isArray(n) ? n : [n];
@@ -1020,7 +960,7 @@ function vr(e) {
1020
960
  }
1021
961
  return t;
1022
962
  }
1023
- function br(e, t) {
963
+ function Er(e, t) {
1024
964
  return t ? e.replace(
1025
965
  /\[(\.\.\.)?([a-zA-Z_$][a-zA-Z0-9_$]*)\]/g,
1026
966
  (r, n, s) => {
@@ -1031,7 +971,7 @@ function br(e, t) {
1031
971
  }
1032
972
  ) : e;
1033
973
  }
1034
- function wi(e, t) {
974
+ function gi(e, t) {
1035
975
  return {
1036
976
  cors: t?.cors,
1037
977
  kind: "json",
@@ -1041,7 +981,7 @@ function wi(e, t) {
1041
981
  init: b(t)
1042
982
  };
1043
983
  }
1044
- function Si(e, t) {
984
+ function yi(e, t) {
1045
985
  return {
1046
986
  cors: t?.cors,
1047
987
  init: b(t),
@@ -1051,7 +991,7 @@ function Si(e, t) {
1051
991
  timing: S(t?.timing)
1052
992
  };
1053
993
  }
1054
- function Ei(e, t) {
994
+ function wi(e, t) {
1055
995
  return {
1056
996
  cors: t?.cors,
1057
997
  kind: "text",
@@ -1061,7 +1001,7 @@ function Ei(e, t) {
1061
1001
  init: b(t)
1062
1002
  };
1063
1003
  }
1064
- function Ri(e, t) {
1004
+ function Si(e, t) {
1065
1005
  return {
1066
1006
  cors: t?.cors,
1067
1007
  kind: "html",
@@ -1071,18 +1011,18 @@ function Ri(e, t) {
1071
1011
  init: b(t)
1072
1012
  };
1073
1013
  }
1074
- function vi(e, t) {
1014
+ function Ei(e, t) {
1075
1015
  const r = typeof t == "number" ? void 0 : t;
1076
1016
  return {
1077
1017
  cors: r?.cors,
1078
1018
  kind: "redirect",
1079
1019
  security: r?.security,
1080
1020
  timing: S(r?.timing),
1081
- to: Or(e) ? Sr(e) : e,
1021
+ to: kr(e) ? gr(e) : e,
1082
1022
  init: typeof t == "number" ? { status: t } : b(t)
1083
1023
  };
1084
1024
  }
1085
- function bi(e, t) {
1025
+ function Ri(e, t) {
1086
1026
  return {
1087
1027
  cors: t?.cors,
1088
1028
  kind: "not-found",
@@ -1092,7 +1032,7 @@ function bi(e, t) {
1092
1032
  init: b(t)
1093
1033
  };
1094
1034
  }
1095
- function Ti(e, t) {
1035
+ function vi(e, t) {
1096
1036
  return {
1097
1037
  cors: t?.cors,
1098
1038
  kind: "response",
@@ -1101,7 +1041,7 @@ function Ti(e, t) {
1101
1041
  timing: S(t?.timing)
1102
1042
  };
1103
1043
  }
1104
- function xi(e, t) {
1044
+ function bi(e, t) {
1105
1045
  return {
1106
1046
  body: e,
1107
1047
  cors: t?.cors,
@@ -1111,7 +1051,7 @@ function xi(e, t) {
1111
1051
  timing: S(t?.timing)
1112
1052
  };
1113
1053
  }
1114
- function Pi(e, t) {
1054
+ function Ti(e, t) {
1115
1055
  return {
1116
1056
  cors: t?.cors,
1117
1057
  events: e,
@@ -1121,15 +1061,15 @@ function Pi(e, t) {
1121
1061
  timing: S(t?.timing)
1122
1062
  };
1123
1063
  }
1124
- function ki(...e) {
1064
+ function xi(...e) {
1125
1065
  return e;
1126
1066
  }
1127
- async function Tr(e, t) {
1067
+ async function Rr(e, t) {
1128
1068
  switch (e.kind) {
1129
1069
  case "json":
1130
1070
  return new Response(JSON.stringify(await y(e.value, t)), {
1131
1071
  ...e.init,
1132
- headers: ie(
1072
+ headers: oe(
1133
1073
  e.init?.headers,
1134
1074
  "content-type",
1135
1075
  "application/json; charset=utf-8"
@@ -1137,10 +1077,10 @@ async function Tr(e, t) {
1137
1077
  });
1138
1078
  case "jsonl":
1139
1079
  return new Response(
1140
- Pr(await y(e.lines, t)),
1080
+ br(await y(e.lines, t)),
1141
1081
  {
1142
1082
  ...e.init,
1143
- headers: B(e.init?.headers, {
1083
+ headers: G(e.init?.headers, {
1144
1084
  "cache-control": "no-cache",
1145
1085
  "content-type": "application/x-ndjson; charset=utf-8",
1146
1086
  "x-accel-buffering": "no"
@@ -1150,7 +1090,7 @@ async function Tr(e, t) {
1150
1090
  case "text":
1151
1091
  return new Response(await y(e.value, t), {
1152
1092
  ...e.init,
1153
- headers: ie(
1093
+ headers: oe(
1154
1094
  e.init?.headers,
1155
1095
  "content-type",
1156
1096
  "text/plain; charset=utf-8"
@@ -1159,7 +1099,7 @@ async function Tr(e, t) {
1159
1099
  case "html":
1160
1100
  return new Response(await y(e.value, t), {
1161
1101
  ...e.init,
1162
- headers: ie(
1102
+ headers: oe(
1163
1103
  e.init?.headers,
1164
1104
  "content-type",
1165
1105
  "text/html; charset=utf-8"
@@ -1185,10 +1125,10 @@ async function Tr(e, t) {
1185
1125
  return await y(e.response, t);
1186
1126
  case "stream":
1187
1127
  return new Response(
1188
- kr(await y(e.body, t)),
1128
+ Tr(await y(e.body, t)),
1189
1129
  {
1190
1130
  ...e.init,
1191
- headers: B(e.init?.headers, {
1131
+ headers: G(e.init?.headers, {
1192
1132
  "content-type": "application/octet-stream",
1193
1133
  "x-accel-buffering": "no"
1194
1134
  })
@@ -1196,10 +1136,10 @@ async function Tr(e, t) {
1196
1136
  );
1197
1137
  case "sse":
1198
1138
  return new Response(
1199
- xr(await y(e.events, t)),
1139
+ vr(await y(e.events, t)),
1200
1140
  {
1201
1141
  ...e.init,
1202
- headers: B(e.init?.headers, {
1142
+ headers: G(e.init?.headers, {
1203
1143
  "cache-control": "no-cache",
1204
1144
  "content-type": "text/event-stream; charset=utf-8",
1205
1145
  "x-accel-buffering": "no"
@@ -1213,16 +1153,16 @@ async function y(e, t) {
1213
1153
  t
1214
1154
  );
1215
1155
  }
1216
- function ie(e, t, r) {
1217
- return B(e, { [t]: r });
1156
+ function oe(e, t, r) {
1157
+ return G(e, { [t]: r });
1218
1158
  }
1219
- function B(e, t) {
1159
+ function G(e, t) {
1220
1160
  const r = new Headers(e);
1221
1161
  for (const [n, s] of Object.entries(t))
1222
1162
  r.has(n) || r.set(n, s);
1223
1163
  return r;
1224
1164
  }
1225
- function xr(e) {
1165
+ function vr(e) {
1226
1166
  const t = new TextEncoder(), r = Re(e);
1227
1167
  return new ReadableStream({
1228
1168
  async pull(n) {
@@ -1231,14 +1171,14 @@ function xr(e) {
1231
1171
  n.close();
1232
1172
  return;
1233
1173
  }
1234
- n.enqueue(t.encode(Dr(s.value)));
1174
+ n.enqueue(t.encode(Ar(s.value)));
1235
1175
  },
1236
1176
  async cancel() {
1237
1177
  await r.return?.();
1238
1178
  }
1239
1179
  });
1240
1180
  }
1241
- function Pr(e) {
1181
+ function br(e) {
1242
1182
  const t = new TextEncoder(), r = Re(e);
1243
1183
  return new ReadableStream({
1244
1184
  async pull(n) {
@@ -1255,7 +1195,7 @@ function Pr(e) {
1255
1195
  }
1256
1196
  });
1257
1197
  }
1258
- function kr(e) {
1198
+ function Tr(e) {
1259
1199
  const t = new TextEncoder(), r = Re(e);
1260
1200
  return new ReadableStream({
1261
1201
  async pull(n) {
@@ -1264,14 +1204,14 @@ function kr(e) {
1264
1204
  n.close();
1265
1205
  return;
1266
1206
  }
1267
- n.enqueue(Cr(s.value, t));
1207
+ n.enqueue(xr(s.value, t));
1268
1208
  },
1269
1209
  async cancel() {
1270
1210
  await r.return?.();
1271
1211
  }
1272
1212
  });
1273
1213
  }
1274
- function Cr(e, t) {
1214
+ function xr(e, t) {
1275
1215
  return typeof e == "string" ? t.encode(e) : e;
1276
1216
  }
1277
1217
  function Re(e) {
@@ -1286,9 +1226,9 @@ function Re(e) {
1286
1226
  }
1287
1227
  };
1288
1228
  }
1289
- return Symbol.asyncIterator in e ? e[Symbol.asyncIterator]() : Ar(e[Symbol.iterator]());
1229
+ return Symbol.asyncIterator in e ? e[Symbol.asyncIterator]() : Pr(e[Symbol.iterator]());
1290
1230
  }
1291
- function Ar(e) {
1231
+ function Pr(e) {
1292
1232
  return {
1293
1233
  async next() {
1294
1234
  return e.next();
@@ -1298,21 +1238,21 @@ function Ar(e) {
1298
1238
  }
1299
1239
  };
1300
1240
  }
1301
- function Dr(e) {
1241
+ function Ar(e) {
1302
1242
  if (typeof e == "string")
1303
- return $r(e);
1243
+ return Cr(e);
1304
1244
  const t = [];
1305
1245
  if (e.comment !== void 0 && t.push(...N("", e.comment)), e.id !== void 0 && t.push(...N("id", e.id)), e.event !== void 0 && t.push(...N("event", e.event)), e.retry !== void 0) {
1306
1246
  if (!Number.isInteger(e.retry) || e.retry < 0)
1307
1247
  throw new Error("SSE retry must be a non-negative integer.");
1308
1248
  t.push(`retry: ${e.retry}`);
1309
1249
  }
1310
- return e.data !== void 0 && t.push(...N("data", Nr(e.data))), `${t.join(`
1250
+ return e.data !== void 0 && t.push(...N("data", $r(e.data))), `${t.join(`
1311
1251
  `)}
1312
1252
 
1313
1253
  `;
1314
1254
  }
1315
- function $r(e) {
1255
+ function Cr(e) {
1316
1256
  return `${N("data", e).join(`
1317
1257
  `)}
1318
1258
 
@@ -1323,10 +1263,10 @@ function N(e, t) {
1323
1263
  (r) => e ? `${e}: ${r}` : `: ${r}`
1324
1264
  );
1325
1265
  }
1326
- function Nr(e) {
1266
+ function $r(e) {
1327
1267
  return typeof e == "string" ? e : JSON.stringify(e);
1328
1268
  }
1329
- function Or(e) {
1269
+ function kr(e) {
1330
1270
  return typeof e == "object" && e !== null && !(e instanceof URL) && "to" in e;
1331
1271
  }
1332
1272
  function b(e) {
@@ -1340,10 +1280,10 @@ function b(e) {
1340
1280
  } = e;
1341
1281
  return s;
1342
1282
  }
1343
- function Lr(e, t) {
1283
+ function Dr(e, t) {
1344
1284
  if (!t?.length)
1345
1285
  return e;
1346
- const r = new Headers(e.headers), n = Ir(t), s = r.get("server-timing");
1286
+ const r = new Headers(e.headers), n = Nr(t), s = r.get("server-timing");
1347
1287
  return r.set(
1348
1288
  "server-timing",
1349
1289
  s ? `${s}, ${n}` : n
@@ -1353,15 +1293,15 @@ function Lr(e, t) {
1353
1293
  statusText: e.statusText
1354
1294
  });
1355
1295
  }
1356
- function Ir(e) {
1357
- return e.map(Mr).join(", ");
1296
+ function Nr(e) {
1297
+ return e.map(Or).join(", ");
1358
1298
  }
1359
1299
  function S(e) {
1360
1300
  if (e)
1361
1301
  return Array.isArray(e) ? e : [e];
1362
1302
  }
1363
- function Mr(e) {
1364
- if (!Ur(e.name))
1303
+ function Or(e) {
1304
+ if (!Lr(e.name))
1365
1305
  throw new Error(
1366
1306
  `Server-Timing metric name "${e.name}" is not a valid token.`
1367
1307
  );
@@ -1369,20 +1309,20 @@ function Mr(e) {
1369
1309
  if (e.duration !== void 0) {
1370
1310
  if (!Number.isFinite(e.duration) || e.duration < 0)
1371
1311
  throw new Error("Server-Timing metric duration must be a non-negative finite number.");
1372
- t.push(`dur=${Hr(e.duration)}`);
1312
+ t.push(`dur=${Ir(e.duration)}`);
1373
1313
  }
1374
- return e.description !== void 0 && t.push(`desc="${jr(e.description)}"`), t.join(";");
1314
+ return e.description !== void 0 && t.push(`desc="${Mr(e.description)}"`), t.join(";");
1375
1315
  }
1376
- function Ur(e) {
1316
+ function Lr(e) {
1377
1317
  return /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e);
1378
1318
  }
1379
- function Hr(e) {
1319
+ function Ir(e) {
1380
1320
  return Number.isInteger(e), String(e);
1381
1321
  }
1382
- function jr(e) {
1322
+ function Mr(e) {
1383
1323
  return e.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
1384
1324
  }
1385
- const Fr = [
1325
+ const Ur = [
1386
1326
  400,
1387
1327
  401,
1388
1328
  402,
@@ -1423,7 +1363,7 @@ const Fr = [
1423
1363
  508,
1424
1364
  510,
1425
1365
  511
1426
- ], Wr = {
1366
+ ], Hr = {
1427
1367
  400: "Bad Request",
1428
1368
  401: "Unauthorized",
1429
1369
  402: "Payment Required",
@@ -1464,8 +1404,8 @@ const Fr = [
1464
1404
  508: "Loop Detected",
1465
1405
  510: "Not Extended",
1466
1406
  511: "Network Authentication Required"
1467
- }, qr = new Set(Fr);
1468
- class at extends Error {
1407
+ }, jr = new Set(Ur);
1408
+ class it extends Error {
1469
1409
  detail;
1470
1410
  extensions;
1471
1411
  headers;
@@ -1473,29 +1413,29 @@ class at extends Error {
1473
1413
  title;
1474
1414
  type;
1475
1415
  constructor(t, r = {}, n = {}) {
1476
- zr(t);
1416
+ Fr(t);
1477
1417
  const s = typeof r == "string" ? { detail: r } : r, {
1478
1418
  detail: i,
1479
- title: o = Wr[t],
1419
+ title: o = Hr[t],
1480
1420
  type: a = "about:blank",
1481
1421
  ...c
1482
1422
  } = s;
1483
1423
  super(i ?? o, { cause: n.cause }), this.name = "HttpError", this.detail = i, this.extensions = Object.freeze({ ...c }), this.headers = new Headers(n.headers), this.status = t, this.title = o, this.type = a;
1484
1424
  }
1485
1425
  }
1486
- function Ci(e, t, r) {
1487
- return new at(e, t, r);
1426
+ function Pi(e, t, r) {
1427
+ return new it(e, t, r);
1488
1428
  }
1489
1429
  function ve(e) {
1490
- return e instanceof at;
1430
+ return e instanceof it;
1491
1431
  }
1492
- function zr(e) {
1493
- if (!qr.has(e))
1432
+ function Fr(e) {
1433
+ if (!jr.has(e))
1494
1434
  throw new RangeError(
1495
1435
  `HTTP error status must be a standard 4xx or 5xx status; received ${JSON.stringify(e)}.`
1496
1436
  );
1497
1437
  }
1498
- function Me({ pathname: e }) {
1438
+ function Le({ pathname: e }) {
1499
1439
  return /* @__PURE__ */ I("main", { children: [
1500
1440
  /* @__PURE__ */ M("h1", { children: "404" }),
1501
1441
  /* @__PURE__ */ I("p", { children: [
@@ -1505,14 +1445,14 @@ function Me({ pathname: e }) {
1505
1445
  ] })
1506
1446
  ] });
1507
1447
  }
1508
- function Ue({ status: e }) {
1448
+ function Ie({ status: e }) {
1509
1449
  return /* @__PURE__ */ I("main", { children: [
1510
1450
  /* @__PURE__ */ M("h1", { children: e }),
1511
1451
  /* @__PURE__ */ M("p", { children: "Something went wrong." })
1512
1452
  ] });
1513
1453
  }
1514
- function Br({ error: e, pathname: t, status: r }) {
1515
- const { message: n, name: s, stack: i } = ct(e);
1454
+ function Wr({ error: e, pathname: t, status: r }) {
1455
+ const { message: n, name: s, stack: i } = ot(e);
1516
1456
  return /* @__PURE__ */ I("main", { children: [
1517
1457
  /* @__PURE__ */ I("h1", { children: [
1518
1458
  r,
@@ -1525,7 +1465,7 @@ function Br({ error: e, pathname: t, status: r }) {
1525
1465
  i ? /* @__PURE__ */ M("pre", { children: i }) : null
1526
1466
  ] });
1527
1467
  }
1528
- function ct(e) {
1468
+ function ot(e) {
1529
1469
  return e instanceof Error ? {
1530
1470
  message: e.message,
1531
1471
  name: e.name,
@@ -1536,27 +1476,27 @@ function ct(e) {
1536
1476
  stack: void 0
1537
1477
  };
1538
1478
  }
1539
- const Gr = ["text/html", "application/xhtml+xml"];
1540
- function ut(e) {
1541
- return _r(e.headers.get("accept"));
1479
+ const qr = ["text/html", "application/xhtml+xml"];
1480
+ function at(e) {
1481
+ return zr(e.headers.get("accept"));
1542
1482
  }
1543
- function _r(e) {
1544
- return e ? Vr(e).some(
1545
- (t) => t.quality > 0 && Gr.includes(t.type)
1483
+ function zr(e) {
1484
+ return e ? Br(e).some(
1485
+ (t) => t.quality > 0 && qr.includes(t.type)
1546
1486
  ) : !1;
1547
1487
  }
1548
- function Vr(e) {
1488
+ function Br(e) {
1549
1489
  return e.split(",").flatMap((t) => {
1550
1490
  const [r, ...n] = t.split(";"), s = r.trim().toLowerCase();
1551
1491
  return s ? [
1552
1492
  {
1553
- quality: Jr(n),
1493
+ quality: Gr(n),
1554
1494
  type: s
1555
1495
  }
1556
1496
  ] : [];
1557
1497
  });
1558
1498
  }
1559
- function Jr(e) {
1499
+ function Gr(e) {
1560
1500
  for (const t of e) {
1561
1501
  const [r, n] = t.split("=");
1562
1502
  if (r?.trim().toLowerCase() !== "q")
@@ -1566,8 +1506,8 @@ function Jr(e) {
1566
1506
  }
1567
1507
  return 1;
1568
1508
  }
1569
- const Kr = "application/problem+json";
1570
- function Yr({
1509
+ const _r = "application/problem+json";
1510
+ function Vr({
1571
1511
  detail: e,
1572
1512
  instance: t,
1573
1513
  status: r,
@@ -1584,26 +1524,26 @@ function Yr({
1584
1524
  ...i
1585
1525
  };
1586
1526
  }
1587
- function V(e, t) {
1527
+ function J(e, t) {
1588
1528
  const r = new Headers(t?.headers);
1589
- return r.set("content-type", `${Kr}; charset=utf-8`), new Response(JSON.stringify(Yr(e)), {
1529
+ return r.set("content-type", `${_r}; charset=utf-8`), new Response(JSON.stringify(Vr(e)), {
1590
1530
  ...t,
1591
1531
  headers: r,
1592
1532
  status: e.status
1593
1533
  });
1594
1534
  }
1595
- const Zr = "Internal Server Error";
1596
- function ft(e) {
1535
+ const Jr = "Internal Server Error";
1536
+ function ct(e) {
1597
1537
  return e === !0 && process.env.NODE_ENV !== "production";
1598
1538
  }
1599
- async function G(e, t, r, n, s = {}) {
1539
+ async function _(e, t, r, n, s = {}) {
1600
1540
  s.onError?.(r, n);
1601
1541
  const i = new URL(t.url);
1602
- return n === "page" || n === "middleware" && ut(t) ? await Xr(e, i, r, s) : Qr(i, r, s);
1542
+ return n === "page" || n === "middleware" && at(t) ? await Yr(e, i, r, s) : Kr(i, r, s);
1603
1543
  }
1604
- function Qr(e, t, r = {}) {
1544
+ function Kr(e, t, r = {}) {
1605
1545
  if (ve(t))
1606
- return V(
1546
+ return J(
1607
1547
  {
1608
1548
  ...t.extensions,
1609
1549
  detail: t.detail,
@@ -1614,20 +1554,20 @@ function Qr(e, t, r = {}) {
1614
1554
  },
1615
1555
  { headers: t.headers }
1616
1556
  );
1617
- const { message: n } = ct(t);
1618
- return V({
1557
+ const { message: n } = ot(t);
1558
+ return J({
1619
1559
  // `detail` carries the thrown message, so it is dev only for the same
1620
1560
  // reason the stack is.
1621
- ...ft(r.dev) ? { detail: n } : {},
1561
+ ...ct(r.dev) ? { detail: n } : {},
1622
1562
  instance: `${e.pathname}${e.search}`,
1623
1563
  status: 500,
1624
1564
  title: "Internal Server Error"
1625
1565
  });
1626
1566
  }
1627
- async function Xr(e, t, r, n) {
1628
- const s = lt(r);
1567
+ async function Yr(e, t, r, n) {
1568
+ const s = ut(r);
1629
1569
  try {
1630
- const i = await tn(
1570
+ const i = await Qr(
1631
1571
  e,
1632
1572
  t.pathname,
1633
1573
  r,
@@ -1638,26 +1578,26 @@ async function Xr(e, t, r, n) {
1638
1578
  status: s
1639
1579
  });
1640
1580
  } catch (i) {
1641
- return n.onError?.(i, "page"), en();
1581
+ return n.onError?.(i, "page"), Zr();
1642
1582
  }
1643
1583
  }
1644
- function en() {
1645
- return new Response(Zr, {
1584
+ function Zr() {
1585
+ return new Response(Jr, {
1646
1586
  headers: { "content-type": "text/plain; charset=utf-8" },
1647
1587
  status: 500
1648
1588
  });
1649
1589
  }
1650
- async function tn(e, t, r, n) {
1651
- const s = await rn(e, t, n), i = Je({
1590
+ async function Qr(e, t, r, n) {
1591
+ const s = await Xr(e, t, n), i = _e({
1652
1592
  dev: n.dev,
1653
1593
  nonce: n.nonce
1654
- }), o = Ze(
1655
- Ke(
1594
+ }), o = Ke(
1595
+ Ve(
1656
1596
  i,
1657
- ue(s, { error: r, pathname: t, status: lt(r) })
1597
+ fe(s, { error: r, pathname: t, status: ut(r) })
1658
1598
  )
1659
1599
  );
1660
- return Ye({
1600
+ return Je({
1661
1601
  body: { data: void 0, html: o, navigation: n.navigation },
1662
1602
  entrySrc: n.clientEntry,
1663
1603
  lang: n.lang,
@@ -1667,19 +1607,19 @@ async function tn(e, t, r, n) {
1667
1607
  title: n.title
1668
1608
  });
1669
1609
  }
1670
- function lt(e) {
1610
+ function ut(e) {
1671
1611
  return ve(e) ? e.status : 500;
1672
1612
  }
1673
- async function rn(e, t, r) {
1674
- if (ft(r.dev))
1675
- return Br;
1613
+ async function Xr(e, t, r) {
1614
+ if (ct(r.dev))
1615
+ return Wr;
1676
1616
  try {
1677
- return await nr(e, t) ?? Ue;
1617
+ return await er(e, t) ?? Ie;
1678
1618
  } catch {
1679
- return Ue;
1619
+ return Ie;
1680
1620
  }
1681
1621
  }
1682
- const J = "{nonce}", He = `'nonce-${J}'`, dt = {
1622
+ const K = "{nonce}", Me = `'nonce-${K}'`, ft = {
1683
1623
  baseUri: ["'self'"],
1684
1624
  connectSrc: ["'self'"],
1685
1625
  defaultSrc: ["'self'"],
@@ -1688,14 +1628,14 @@ const J = "{nonce}", He = `'nonce-${J}'`, dt = {
1688
1628
  frameAncestors: ["'none'"],
1689
1629
  imgSrc: ["'self'", "data:", "blob:"],
1690
1630
  objectSrc: ["'none'"],
1691
- scriptSrc: [He, "'strict-dynamic'"],
1692
- styleSrc: ["'self'", He],
1631
+ scriptSrc: [Me, "'strict-dynamic'"],
1632
+ styleSrc: ["'self'", Me],
1693
1633
  upgradeInsecureRequests: !0
1694
- }, nn = {
1695
- ...dt,
1634
+ }, en = {
1635
+ ...ft,
1696
1636
  scriptSrc: ["'self'"],
1697
1637
  styleSrc: ["'self'"]
1698
- }, je = {
1638
+ }, Ue = {
1699
1639
  contentTypeOptions: "nosniff",
1700
1640
  crossOriginOpenerPolicy: "same-origin",
1701
1641
  crossOriginResourcePolicy: "same-origin",
@@ -1706,27 +1646,27 @@ const J = "{nonce}", He = `'nonce-${J}'`, dt = {
1706
1646
  maxAge: 31536e3,
1707
1647
  preload: !1
1708
1648
  }
1709
- }, sn = {
1649
+ }, tn = {
1710
1650
  contentTypeOptions: "nosniff",
1711
1651
  crossOriginResourcePolicy: "same-origin",
1712
1652
  referrerPolicy: "strict-origin-when-cross-origin"
1713
- }, $ = {
1653
+ }, D = {
1714
1654
  api(e = {}) {
1715
1655
  return O(
1716
1656
  {
1717
- headers: sn
1657
+ headers: tn
1718
1658
  },
1719
1659
  e
1720
1660
  );
1721
1661
  },
1722
1662
  preset(e, t = {}) {
1723
- return e === "api" ? $.api(t) : e === "cross-origin-isolated" ? $.crossOriginIsolated(t) : e === "static" ? $.static(t) : $.strict(t);
1663
+ return e === "api" ? D.api(t) : e === "cross-origin-isolated" ? D.crossOriginIsolated(t) : e === "static" ? D.static(t) : D.strict(t);
1724
1664
  },
1725
1665
  static(e = {}) {
1726
1666
  return O(
1727
1667
  {
1728
- csp: nn,
1729
- headers: je
1668
+ csp: en,
1669
+ headers: Ue
1730
1670
  },
1731
1671
  e
1732
1672
  );
@@ -1734,15 +1674,15 @@ const J = "{nonce}", He = `'nonce-${J}'`, dt = {
1734
1674
  strict(e = {}) {
1735
1675
  return O(
1736
1676
  {
1737
- csp: dt,
1738
- headers: je
1677
+ csp: ft,
1678
+ headers: Ue
1739
1679
  },
1740
1680
  e
1741
1681
  );
1742
1682
  },
1743
1683
  crossOriginIsolated(e = {}) {
1744
1684
  return O(
1745
- $.strict({
1685
+ D.strict({
1746
1686
  headers: {
1747
1687
  crossOriginEmbedderPolicy: "require-corp",
1748
1688
  crossOriginOpenerPolicy: "same-origin"
@@ -1755,138 +1695,154 @@ const J = "{nonce}", He = `'nonce-${J}'`, dt = {
1755
1695
  function Ai(e) {
1756
1696
  return e;
1757
1697
  }
1758
- function Di(e) {
1698
+ function Ci(e) {
1759
1699
  return e;
1760
1700
  }
1761
- function on(...e) {
1701
+ function rn(...e) {
1762
1702
  return e.reduce((t, r) => r ? O(t, r) : t, {});
1763
1703
  }
1764
- function K(...e) {
1704
+ function Y(...e) {
1765
1705
  const t = e.reduce((r, n) => n ? {
1766
- document: on(r.document, n.document),
1767
- security: an(r.security, n.security)
1706
+ document: rn(r.document, n.document),
1707
+ security: nn(r.security, n.security)
1768
1708
  } : r, {});
1769
1709
  return {
1770
1710
  ...t,
1771
- document: un(t.document, t.security?.needs?.script)
1711
+ document: on(t.document, t.security?.needs)
1772
1712
  };
1773
1713
  }
1774
- function an(...e) {
1714
+ function nn(...e) {
1775
1715
  return e.reduce((t, r) => r ? {
1776
1716
  csrf: r.csrf ?? t.csrf,
1777
- needs: cn(t.needs, r.needs),
1717
+ needs: sn(t.needs, r.needs),
1778
1718
  rateLimit: r.rateLimit ?? t.rateLimit,
1779
- request: ht(t.request, r.request)
1719
+ request: mt(t.request, r.request)
1780
1720
  } : t, {});
1781
1721
  }
1782
- function cn(e, t) {
1783
- const r = [.../* @__PURE__ */ new Set([
1784
- ...e?.script ?? [],
1785
- ...t?.script ?? []
1786
- ])];
1787
- return r.length > 0 ? { script: r } : void 0;
1722
+ const lt = [
1723
+ { directive: "connectSrc", need: "connect" },
1724
+ { directive: "imgSrc", need: "img" },
1725
+ { directive: "scriptSrc", need: "script" }
1726
+ ];
1727
+ function sn(e, t) {
1728
+ const r = {};
1729
+ for (const { need: n } of lt) {
1730
+ const s = [.../* @__PURE__ */ new Set([
1731
+ ...e?.[n] ?? [],
1732
+ ...t?.[n] ?? []
1733
+ ])];
1734
+ s.length > 0 && (r[n] = s);
1735
+ }
1736
+ return Object.keys(r).length > 0 ? r : void 0;
1788
1737
  }
1789
- function un(e, t) {
1790
- if (!e?.csp || !t || t.length === 0)
1738
+ function on(e, t) {
1739
+ if (!e?.csp || !t)
1791
1740
  return e;
1792
- if (e.csp.scriptSrc === !1)
1741
+ let r = e.csp;
1742
+ for (const { directive: n, need: s } of lt)
1743
+ r = an(r, n, s, t[s]);
1744
+ return r === e.csp ? e : { ...e, csp: r };
1745
+ }
1746
+ function an(e, t, r, n) {
1747
+ if (!n || n.length === 0)
1748
+ return e;
1749
+ if (e[t] === !1)
1793
1750
  throw new Error(
1794
- `A route policy declares security.needs.script and sets csp.scriptSrc to false. Set an explicit csp.scriptSrc that includes ${t.join(", ")}.`
1751
+ `A route policy declares security.needs.${r} and sets csp.${t} to false. Set an explicit csp.${t} that includes ${n.join(", ")}.`
1795
1752
  );
1796
- if (e.csp.scriptSrc === void 0 && e.csp.defaultSrc === void 0)
1753
+ if (e[t] === void 0 && e.defaultSrc === void 0)
1797
1754
  return e;
1798
- const r = e.csp.scriptSrc ?? e.csp.defaultSrc, n = x(r) ?? [];
1799
- return Array.isArray(n) ? {
1755
+ const s = x(
1756
+ e[t] ?? e.defaultSrc
1757
+ ) ?? [];
1758
+ return Array.isArray(s) ? {
1800
1759
  ...e,
1801
- csp: {
1802
- ...e.csp,
1803
- scriptSrc: [.../* @__PURE__ */ new Set([...n, ...t])]
1804
- }
1760
+ [t]: [.../* @__PURE__ */ new Set([...s, ...n])]
1805
1761
  } : e;
1806
1762
  }
1807
1763
  async function $i(e, t = "sha256") {
1808
1764
  const r = await globalThis.crypto.subtle.digest(
1809
- bn(t),
1765
+ Rn(t),
1810
1766
  new TextEncoder().encode(e)
1811
1767
  );
1812
- return `'${t}-${Tn(new Uint8Array(r))}'`;
1768
+ return `'${t}-${vn(new Uint8Array(r))}'`;
1813
1769
  }
1814
- function F(e, t = {}) {
1815
- e.csp && En(e.csp), Sn(e);
1816
- const r = new Headers(), n = e.csp !== !1 && e.csp ? gn(e.csp, t) : void 0, s = hn(e.trustedTypes), i = e.trustedTypes ? e.trustedTypes.mode === "report-only" : !1;
1770
+ function W(e, t = {}) {
1771
+ e.csp && wn(e.csp), yn(e);
1772
+ const r = new Headers(), n = e.csp !== !1 && e.csp ? hn(e.csp, t) : void 0, s = dn(e.trustedTypes), i = e.trustedTypes ? e.trustedTypes.mode === "report-only" : !1;
1817
1773
  return w(
1818
1774
  r,
1819
1775
  "content-security-policy",
1820
- Y(n, i ? void 0 : s)
1776
+ Z(n, i ? void 0 : s)
1821
1777
  ), w(
1822
1778
  r,
1823
1779
  "content-security-policy-report-only",
1824
- i ? Y(s, gt(e.csp)) : void 0
1825
- ), mn(r, e.headers, t), r;
1780
+ i ? Z(s, pt(e.csp)) : void 0
1781
+ ), ln(r, e.headers, t), r;
1826
1782
  }
1827
- function X(e) {
1828
- return !e || !e.csp ? !1 : W(e.csp).some(([, t]) => {
1783
+ function ee(e) {
1784
+ return !e || !e.csp ? !1 : q(e.csp).some(([, t]) => {
1829
1785
  const r = x(t);
1830
- return Array.isArray(r) && r.some((n) => n.includes(J));
1786
+ return Array.isArray(r) && r.some((n) => n.includes(K));
1831
1787
  });
1832
1788
  }
1833
- function mt() {
1789
+ function dt() {
1834
1790
  const e = new Uint8Array(16);
1835
1791
  return globalThis.crypto.getRandomValues(e), btoa(String.fromCharCode(...e));
1836
1792
  }
1837
1793
  function O(e, t) {
1838
1794
  return {
1839
- csp: ln(e.csp, t.csp),
1840
- headers: fn(e.headers, t.headers),
1795
+ csp: un(e.csp, t.csp),
1796
+ headers: cn(e.headers, t.headers),
1841
1797
  trustedTypes: t.trustedTypes ?? e.trustedTypes
1842
1798
  };
1843
1799
  }
1844
- function fn(e, t) {
1845
- const r = ht(e, t);
1800
+ function cn(e, t) {
1801
+ const r = mt(e, t);
1846
1802
  return !r || t?.reportingEndpoints === !1 || e?.reportingEndpoints && t?.reportingEndpoints && (r.reportingEndpoints = {
1847
1803
  ...e.reportingEndpoints,
1848
1804
  ...t.reportingEndpoints
1849
1805
  }), r;
1850
1806
  }
1851
- function ht(e, t) {
1807
+ function mt(e, t) {
1852
1808
  return t ? {
1853
1809
  ...e ?? {},
1854
1810
  ...t
1855
1811
  } : e;
1856
1812
  }
1857
- function ln(e, t) {
1813
+ function un(e, t) {
1858
1814
  if (t === !1)
1859
1815
  return !1;
1860
1816
  if (!t)
1861
1817
  return e;
1862
1818
  if (!e)
1863
- return oe(t);
1864
- const r = oe(e), n = oe(t), s = {
1819
+ return ae(t);
1820
+ const r = ae(e), n = ae(t), s = {
1865
1821
  ...r,
1866
1822
  ...n
1867
1823
  };
1868
- for (const [i, o] of W(t)) {
1824
+ for (const [i, o] of q(t)) {
1869
1825
  const a = x(
1870
1826
  r[i]
1871
1827
  );
1872
- !be(o) && Array.isArray(a) && Array.isArray(o) && pt(
1828
+ !be(o) && Array.isArray(a) && Array.isArray(o) && ht(
1873
1829
  s,
1874
1830
  i,
1875
- dn([...a, ...o])
1831
+ fn([...a, ...o])
1876
1832
  );
1877
1833
  }
1878
1834
  return s;
1879
1835
  }
1880
- function oe(e) {
1836
+ function ae(e) {
1881
1837
  const t = { ...e };
1882
- for (const [r, n] of W(e))
1883
- be(n) && pt(t, r, n.replace);
1838
+ for (const [r, n] of q(e))
1839
+ be(n) && ht(t, r, n.replace);
1884
1840
  return t;
1885
1841
  }
1886
- function dn(e) {
1842
+ function fn(e) {
1887
1843
  return [...new Set(e)];
1888
1844
  }
1889
- function pt(e, t, r) {
1845
+ function ht(e, t, r) {
1890
1846
  if (!(t === "reportTo" || t === "upgradeInsecureRequests")) {
1891
1847
  if (t === "reportUri") {
1892
1848
  e.reportUri = r;
@@ -1895,87 +1851,87 @@ function pt(e, t, r) {
1895
1851
  e[t] = r;
1896
1852
  }
1897
1853
  }
1898
- function mn(e, t, r) {
1854
+ function ln(e, t, r) {
1899
1855
  t && (w(e, "referrer-policy", t.referrerPolicy), w(e, "x-content-type-options", t.contentTypeOptions), w(e, "cross-origin-opener-policy", t.crossOriginOpenerPolicy), w(e, "cross-origin-embedder-policy", t.crossOriginEmbedderPolicy), w(e, "cross-origin-resource-policy", t.crossOriginResourcePolicy), w(e, "permissions-policy", t.permissionsPolicy), w(
1900
1856
  e,
1901
1857
  "reporting-endpoints",
1902
- yn(t.reportingEndpoints)
1858
+ pn(t.reportingEndpoints)
1903
1859
  ), t.strictTransportSecurity && (!r.request || new URL(r.request.url).protocol === "https:") && e.set(
1904
1860
  "strict-transport-security",
1905
- pn(t.strictTransportSecurity)
1861
+ mn(t.strictTransportSecurity)
1906
1862
  ));
1907
1863
  }
1908
- function hn(e) {
1864
+ function dn(e) {
1909
1865
  if (!e)
1910
1866
  return;
1911
1867
  const t = [];
1912
- return e.requireFor?.includes("script") && t.push("require-trusted-types-for 'script'"), e.policies.length > 0 && t.push(`trusted-types ${e.policies.join(" ")}`), Y(...t);
1868
+ return e.requireFor?.includes("script") && t.push("require-trusted-types-for 'script'"), e.policies.length > 0 && t.push(`trusted-types ${e.policies.join(" ")}`), Z(...t);
1913
1869
  }
1914
- function Y(...e) {
1870
+ function Z(...e) {
1915
1871
  const t = e.filter((r) => r);
1916
1872
  return t.length > 0 ? t.join("; ") : void 0;
1917
1873
  }
1918
1874
  function w(e, t, r) {
1919
1875
  r && e.set(t, r);
1920
1876
  }
1921
- function pn(e) {
1877
+ function mn(e) {
1922
1878
  const t = [`max-age=${e.maxAge}`];
1923
1879
  return e.includeSubDomains && t.push("includeSubDomains"), e.preload && t.push("preload"), t.join("; ");
1924
1880
  }
1925
- function gn(e, t) {
1881
+ function hn(e, t) {
1926
1882
  const r = [];
1927
- for (const [s, i] of W(e)) {
1883
+ for (const [s, i] of q(e)) {
1928
1884
  if (s === "reportTo" || s === "reportUri")
1929
1885
  continue;
1930
1886
  const o = x(i);
1931
1887
  if (o === !1 || o === void 0)
1932
1888
  continue;
1933
- const a = yt(s);
1889
+ const a = gt(s);
1934
1890
  if (o === !0) {
1935
1891
  r.push(a);
1936
1892
  continue;
1937
1893
  }
1938
1894
  r.push(
1939
- `${a} ${vn(o, t).join(" ")}`
1895
+ `${a} ${En(o, t).join(" ")}`
1940
1896
  );
1941
1897
  }
1942
- const n = gt(e);
1898
+ const n = pt(e);
1943
1899
  return n && r.push(n), r.join("; ");
1944
1900
  }
1945
- function gt(e) {
1901
+ function pt(e) {
1946
1902
  if (!e)
1947
1903
  return;
1948
1904
  const t = [], r = x(e.reportUri);
1949
- return Array.isArray(r) && r.length && t.push(`report-uri ${r.join(" ")}`), e.reportTo && t.push(`report-to ${e.reportTo}`), Y(...t);
1905
+ return Array.isArray(r) && r.length && t.push(`report-uri ${r.join(" ")}`), e.reportTo && t.push(`report-to ${e.reportTo}`), Z(...t);
1950
1906
  }
1951
- function yn(e) {
1907
+ function pn(e) {
1952
1908
  if (e)
1953
- return Object.entries(e).sort(([t], [r]) => t.localeCompare(r)).map(([t, r]) => `${t}="${wn(r)}"`).join(", ");
1909
+ return Object.entries(e).sort(([t], [r]) => t.localeCompare(r)).map(([t, r]) => `${t}="${gn(r)}"`).join(", ");
1954
1910
  }
1955
- function wn(e) {
1911
+ function gn(e) {
1956
1912
  return e.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
1957
1913
  }
1958
- function Sn(e) {
1914
+ function yn(e) {
1959
1915
  const t = e.headers?.reportingEndpoints;
1960
1916
  if (t) {
1961
1917
  const s = Object.entries(t);
1962
1918
  if (s.length === 0)
1963
1919
  throw new Error("Demiurge Reporting-Endpoints requires at least one endpoint.");
1964
1920
  for (const [i, o] of s)
1965
- Fe(i), We(o, `Reporting-Endpoints member ${JSON.stringify(i)}`);
1921
+ He(i), je(o, `Reporting-Endpoints member ${JSON.stringify(i)}`);
1966
1922
  }
1967
1923
  const r = e.csp || void 0;
1968
- if (r?.reportTo && (Fe(r.reportTo), !t || !(r.reportTo in t)))
1924
+ if (r?.reportTo && (He(r.reportTo), !t || !(r.reportTo in t)))
1969
1925
  throw new Error(
1970
1926
  `Demiurge CSP report-to group ${JSON.stringify(r.reportTo)} is not defined in headers.reportingEndpoints.`
1971
1927
  );
1972
1928
  const n = x(r?.reportUri);
1973
1929
  for (const s of Array.isArray(n) ? n : [])
1974
- We(s, "CSP report-uri target");
1930
+ je(s, "CSP report-uri target");
1975
1931
  }
1976
- function En(e) {
1977
- for (const [t, r] of W(e)) {
1978
- const n = yt(t);
1932
+ function wn(e) {
1933
+ for (const [t, r] of q(e)) {
1934
+ const n = gt(t);
1979
1935
  if (r === void 0)
1980
1936
  continue;
1981
1937
  if (t === "reportTo") {
@@ -2005,14 +1961,14 @@ function be(e) {
2005
1961
  function x(e) {
2006
1962
  return be(e) ? e.replace : e;
2007
1963
  }
2008
- function Fe(e) {
1964
+ function He(e) {
2009
1965
  if (!/^(?:[a-z]|\*)[a-z0-9_.*-]*$/.test(e))
2010
1966
  throw new Error(
2011
1967
  `Invalid reporting endpoint name ${JSON.stringify(e)}. Use a lowercase Structured Field key.`
2012
1968
  );
2013
1969
  }
2014
- function We(e, t) {
2015
- if (!Rn(e) || /[\s,;"\\]/.test(e) || !e.startsWith("/") && !e.startsWith("https://"))
1970
+ function je(e, t) {
1971
+ if (!Sn(e) || /[\s,;"\\]/.test(e) || !e.startsWith("/") && !e.startsWith("https://"))
2016
1972
  throw new Error(`${t} must be a same-origin path or an HTTPS URL.`);
2017
1973
  if (e.startsWith("//"))
2018
1974
  throw new Error(`${t} must not be a scheme-relative URL.`);
@@ -2025,39 +1981,39 @@ function We(e, t) {
2025
1981
  if (r.username || r.password || r.hash)
2026
1982
  throw new Error(`${t} must not contain credentials or a fragment.`);
2027
1983
  }
2028
- function Rn(e) {
1984
+ function Sn(e) {
2029
1985
  return /^[\x20-\x7e]+$/.test(e);
2030
1986
  }
2031
- function W(e) {
1987
+ function q(e) {
2032
1988
  return Object.entries(e);
2033
1989
  }
2034
- function vn(e, t) {
1990
+ function En(e, t) {
2035
1991
  return e.map((r) => {
2036
- if (!r.includes(J))
1992
+ if (!r.includes(K))
2037
1993
  return r;
2038
1994
  if (!t.nonce)
2039
1995
  throw new Error("Demiurge security policy requires a CSP nonce.");
2040
- return r.replaceAll(J, t.nonce);
1996
+ return r.replaceAll(K, t.nonce);
2041
1997
  });
2042
1998
  }
2043
- function yt(e) {
1999
+ function gt(e) {
2044
2000
  return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
2045
2001
  }
2046
- function bn(e) {
2002
+ function Rn(e) {
2047
2003
  return e === "sha384" ? "SHA-384" : e === "sha512" ? "SHA-512" : "SHA-256";
2048
2004
  }
2049
- function Tn(e) {
2005
+ function vn(e) {
2050
2006
  let t = "";
2051
2007
  for (const r of e)
2052
2008
  t += String.fromCharCode(r);
2053
2009
  return typeof btoa == "function" ? btoa(t) : Buffer.from(t, "binary").toString("base64");
2054
2010
  }
2055
- function wt(e, t, r = {}) {
2011
+ function yt(e, t, r = {}) {
2056
2012
  Te(e);
2057
2013
  const n = t.request.headers.get("origin"), s = new Headers();
2058
- if (e.origins !== "*" && St(s, "Origin"), !n)
2014
+ if (e.origins !== "*" && wt(s, "Origin"), !n)
2059
2015
  return s;
2060
- const i = kn(e, n);
2016
+ const i = xn(e, n);
2061
2017
  if (!i)
2062
2018
  return s;
2063
2019
  if (s.set("access-control-allow-origin", i), e.credentials && s.set("access-control-allow-credentials", "true"), e.exposeHeaders?.length && s.set("access-control-expose-headers", e.exposeHeaders.join(", ")), r.preflight) {
@@ -2069,26 +2025,26 @@ function wt(e, t, r = {}) {
2069
2025
  }
2070
2026
  return s;
2071
2027
  }
2072
- function _(e, t, r) {
2028
+ function V(e, t, r) {
2073
2029
  if (!t)
2074
2030
  return e;
2075
2031
  const n = new Headers(e.headers);
2076
- return Cn(n, wt(t, { request: r })), new Response(e.body, {
2032
+ return Pn(n, yt(t, { request: r })), new Response(e.body, {
2077
2033
  headers: n,
2078
2034
  status: e.status,
2079
2035
  statusText: e.statusText
2080
2036
  });
2081
2037
  }
2082
- function xn(e, t) {
2038
+ function bn(e, t) {
2083
2039
  const r = t.headers.get("access-control-request-method"), n = An(r);
2084
2040
  if (!n)
2085
2041
  return null;
2086
- const s = Et(e, n);
2042
+ const s = St(e, n);
2087
2043
  if (!s?.cors)
2088
2044
  return null;
2089
- const i = s.cors.methods ?? Dn(e);
2045
+ const i = s.cors.methods ?? Cn(e);
2090
2046
  return i.includes(n) ? new Response(null, {
2091
- headers: wt(
2047
+ headers: yt(
2092
2048
  s.cors,
2093
2049
  { request: t },
2094
2050
  {
@@ -2110,41 +2066,41 @@ function Te(e) {
2110
2066
  );
2111
2067
  if (e.origins !== "*")
2112
2068
  for (const t of e.origins)
2113
- Pn(t);
2069
+ Tn(t);
2114
2070
  if (e.maxAge !== void 0 && (!Number.isSafeInteger(e.maxAge) || e.maxAge < 0))
2115
2071
  throw new Error(
2116
2072
  "Demiurge CORS maxAge must be a non-negative integer number of seconds."
2117
2073
  );
2118
2074
  }
2119
- function Pn(e) {
2075
+ function Tn(e) {
2120
2076
  let t;
2121
2077
  try {
2122
2078
  t = new URL(e);
2123
2079
  } catch {
2124
- throw qe(e);
2080
+ throw Fe(e);
2125
2081
  }
2126
2082
  if (t.protocol !== "http:" && t.protocol !== "https:" || t.origin !== e)
2127
- throw qe(e);
2083
+ throw Fe(e);
2128
2084
  }
2129
- function qe(e) {
2085
+ function Fe(e) {
2130
2086
  return new Error(
2131
2087
  `Demiurge CORS origin ${JSON.stringify(e)} must be a canonical HTTP(S) origin without credentials, a path, query, or fragment.`
2132
2088
  );
2133
2089
  }
2134
- function kn(e, t) {
2090
+ function xn(e, t) {
2135
2091
  return e.origins === "*" ? "*" : e.origins.includes(t) ? t : null;
2136
2092
  }
2137
- function Cn(e, t) {
2093
+ function Pn(e, t) {
2138
2094
  t.forEach((r, n) => {
2139
2095
  if (n === "vary" && e.has("vary")) {
2140
2096
  for (const s of r.split(","))
2141
- St(e, s.trim());
2097
+ wt(e, s.trim());
2142
2098
  return;
2143
2099
  }
2144
2100
  e.set(n, r);
2145
2101
  });
2146
2102
  }
2147
- function St(e, t) {
2103
+ function wt(e, t) {
2148
2104
  if (!t)
2149
2105
  return;
2150
2106
  const r = e.get("vary")?.split(",").map((n) => n.trim()).filter(Boolean) ?? [];
@@ -2156,13 +2112,13 @@ function An(e) {
2156
2112
  const t = e.toUpperCase();
2157
2113
  return $n(t) ? t : null;
2158
2114
  }
2159
- function Et(e, t) {
2160
- return t === "HEAD" ? e.HEAD ?? ze(e.GET) : ze(e[t]);
2115
+ function St(e, t) {
2116
+ return t === "HEAD" ? e.HEAD ?? We(e.GET) : We(e[t]);
2161
2117
  }
2162
- function ze(e) {
2118
+ function We(e) {
2163
2119
  return e?.kind === "page" ? void 0 : e;
2164
2120
  }
2165
- function Dn(e) {
2121
+ function Cn(e) {
2166
2122
  return [
2167
2123
  "GET",
2168
2124
  "POST",
@@ -2171,25 +2127,25 @@ function Dn(e) {
2171
2127
  "DELETE",
2172
2128
  "OPTIONS",
2173
2129
  "HEAD"
2174
- ].filter((t) => Et(e, t));
2130
+ ].filter((t) => St(e, t));
2175
2131
  }
2176
2132
  function $n(e) {
2177
2133
  return e === "GET" || e === "POST" || e === "PUT" || e === "PATCH" || e === "DELETE" || e === "OPTIONS" || e === "HEAD";
2178
2134
  }
2179
- const Nn = /* @__PURE__ */ new Set(["DELETE", "PATCH", "POST", "PUT"]);
2180
- function On(e = {}) {
2181
- const t = [], r = e.document, n = r ? Mn(r.policy, r.headers, t) : {};
2182
- r && Ln(r.policy, t);
2183
- const s = e.route ? Gn(e.route, t) : void 0;
2184
- return r?.scripts && (Un(
2135
+ const kn = /* @__PURE__ */ new Set(["DELETE", "PATCH", "POST", "PUT"]);
2136
+ function Dn(e = {}) {
2137
+ const t = [], r = e.document, n = r ? Ln(r.policy, r.headers, t) : {};
2138
+ r && Nn(r.policy, t);
2139
+ const s = e.route ? zn(e.route, t) : void 0;
2140
+ return r?.scripts && (In(
2185
2141
  r.policy.csp,
2186
2142
  r.scripts,
2187
2143
  r.headers,
2188
2144
  t
2189
2145
  ), r.scriptDependencies && t.push(
2190
- ...In(
2146
+ ...On(
2191
2147
  r.scripts,
2192
- Hn(r.scriptDependencies)
2148
+ Mn(r.scriptDependencies)
2193
2149
  )
2194
2150
  )), {
2195
2151
  findings: t,
@@ -2197,20 +2153,20 @@ function On(e = {}) {
2197
2153
  route: s
2198
2154
  };
2199
2155
  }
2200
- function Ln(e, t) {
2156
+ function Nn(e, t) {
2201
2157
  if (!e.trustedTypes || e.trustedTypes.mode !== "report-only")
2202
2158
  return;
2203
- const r = e.csp || void 0, n = !!me(r?.reportUri)?.length, s = e.headers?.reportingEndpoints, i = !!(r?.reportTo && s && s[r.reportTo]);
2159
+ const r = e.csp || void 0, n = !!he(r?.reportUri)?.length, s = e.headers?.reportingEndpoints, i = !!(r?.reportTo && s && s[r.reportTo]);
2204
2160
  !n && !i && t.push({
2205
2161
  code: "report-only-target-missing",
2206
2162
  message: "Trusted Types report-only mode has no deliverable target. Configure CSP reportTo with a matching Reporting-Endpoints member, reportUri for compatibility, or both.",
2207
2163
  severity: "warning"
2208
2164
  });
2209
2165
  }
2210
- function In(e, t = {}) {
2166
+ function On(e, t = {}) {
2211
2167
  const r = t.requirePurpose ?? !0, n = [];
2212
2168
  for (const s of e) {
2213
- const i = Jn(s);
2169
+ const i = _n(s);
2214
2170
  i && (r && !s.purpose && n.push({
2215
2171
  code: "script-purpose-missing",
2216
2172
  message: `Third-party script ${s.src} should declare a purpose for audits and consent flows.`,
@@ -2223,7 +2179,7 @@ function In(e, t = {}) {
2223
2179
  code: "script-third-party-before-interactive",
2224
2180
  message: `Third-party script ${s.src} runs before the app is interactive and should be justified by policy.`,
2225
2181
  severity: "warning"
2226
- }), Kn(i) && n.push({
2182
+ }), Vn(i) && n.push({
2227
2183
  code: "script-gtm-wide-trust-boundary",
2228
2184
  message: "Google Tag Manager can load additional scripts at runtime and should be treated as a wide trust boundary.",
2229
2185
  severity: "warning"
@@ -2231,9 +2187,9 @@ function In(e, t = {}) {
2231
2187
  }
2232
2188
  return n;
2233
2189
  }
2234
- function Mn(e, t, r) {
2190
+ function Ln(e, t, r) {
2235
2191
  try {
2236
- return Object.fromEntries(F(e, t));
2192
+ return Object.fromEntries(W(e, t));
2237
2193
  } catch (n) {
2238
2194
  return r.push({
2239
2195
  code: "security-header-render-failed",
@@ -2242,12 +2198,12 @@ function Mn(e, t, r) {
2242
2198
  }), {};
2243
2199
  }
2244
2200
  }
2245
- function Un(e, t, r, n) {
2201
+ function In(e, t, r, n) {
2246
2202
  if (!e)
2247
2203
  return;
2248
- const s = jn(e);
2204
+ const s = Un(e);
2249
2205
  for (const i of t) {
2250
- if (Fn(s) && !i.nonce) {
2206
+ if (Hn(s) && !i.nonce) {
2251
2207
  n.push({
2252
2208
  code: "csp-script-missing-nonce",
2253
2209
  message: `Document script ${i.src} needs a nonce for the effective script-src policy.`,
@@ -2255,33 +2211,33 @@ function Un(e, t, r, n) {
2255
2211
  });
2256
2212
  continue;
2257
2213
  }
2258
- i.nonce && r?.nonce && i.nonce === r.nonce || Wn(s, i.src) || n.push({
2214
+ i.nonce && r?.nonce && i.nonce === r.nonce || jn(s, i.src) || n.push({
2259
2215
  code: "csp-script-src-blocked",
2260
2216
  message: `Document script ${i.src} is not allowed by the effective script-src policy.`,
2261
2217
  severity: "error"
2262
2218
  });
2263
2219
  }
2264
2220
  }
2265
- function Hn(e) {
2221
+ function Mn(e) {
2266
2222
  return typeof e == "boolean" ? {} : e;
2267
2223
  }
2268
- function jn(e) {
2269
- return me(e.scriptSrc) ?? me(e.defaultSrc) ?? [];
2224
+ function Un(e) {
2225
+ return he(e.scriptSrc) ?? he(e.defaultSrc) ?? [];
2270
2226
  }
2271
- function me(e) {
2227
+ function he(e) {
2272
2228
  if (e)
2273
2229
  return "replace" in e ? e.replace : e;
2274
2230
  }
2275
- function Fn(e) {
2231
+ function Hn(e) {
2276
2232
  return e.some((t) => t.includes("'nonce-{nonce}'"));
2277
2233
  }
2278
- function Wn(e, t) {
2279
- return Bn(e) ? !1 : e.includes("*") ? !0 : e.includes("'none'") || e.some((r) => r.startsWith("'nonce-")) ? !1 : e.includes("'self'") && qn(t) || t.startsWith("https:") && e.includes("https:") || t.startsWith("http:") && e.includes("http:") ? !0 : e.some((r) => zn(r, t));
2234
+ function jn(e, t) {
2235
+ return qn(e) ? !1 : e.includes("*") ? !0 : e.includes("'none'") || e.some((r) => r.startsWith("'nonce-")) ? !1 : e.includes("'self'") && Fn(t) || t.startsWith("https:") && e.includes("https:") || t.startsWith("http:") && e.includes("http:") ? !0 : e.some((r) => Wn(r, t));
2280
2236
  }
2281
- function qn(e) {
2237
+ function Fn(e) {
2282
2238
  return e.startsWith("/") && !e.startsWith("//");
2283
2239
  }
2284
- function zn(e, t) {
2240
+ function Wn(e, t) {
2285
2241
  if (e.startsWith("'"))
2286
2242
  return !1;
2287
2243
  try {
@@ -2291,19 +2247,19 @@ function zn(e, t) {
2291
2247
  return !1;
2292
2248
  }
2293
2249
  }
2294
- function Bn(e) {
2250
+ function qn(e) {
2295
2251
  return e.includes("'strict-dynamic'") && e.some(
2296
2252
  (t) => t.startsWith("'nonce-") || /^'sha(?:256|384|512)-/.test(t)
2297
2253
  );
2298
2254
  }
2299
- function Gn(e, t) {
2300
- return _n(e.cors, t), Vn(e.method, e.security, t), {
2255
+ function zn(e, t) {
2256
+ return Bn(e.cors, t), Gn(e.method, e.security, t), {
2301
2257
  cors: e.cors,
2302
2258
  method: e.method,
2303
2259
  security: e.security
2304
2260
  };
2305
2261
  }
2306
- function _n(e, t) {
2262
+ function Bn(e, t) {
2307
2263
  if (e)
2308
2264
  try {
2309
2265
  Te(e);
@@ -2315,8 +2271,8 @@ function _n(e, t) {
2315
2271
  });
2316
2272
  }
2317
2273
  }
2318
- function Vn(e, t, r) {
2319
- Nn.has(e) && (t?.csrf === !1 && r.push({
2274
+ function Gn(e, t, r) {
2275
+ kn.has(e) && (t?.csrf === !1 && r.push({
2320
2276
  code: "csrf-disabled",
2321
2277
  message: "CSRF protection is explicitly disabled for this unsafe route.",
2322
2278
  severity: "info"
@@ -2330,7 +2286,7 @@ function Vn(e, t, r) {
2330
2286
  severity: "warning"
2331
2287
  }));
2332
2288
  }
2333
- function Jn(e) {
2289
+ function _n(e) {
2334
2290
  try {
2335
2291
  const t = new URL(e.src);
2336
2292
  if (t.protocol === "http:" || t.protocol === "https:")
@@ -2340,17 +2296,17 @@ function Jn(e) {
2340
2296
  }
2341
2297
  return null;
2342
2298
  }
2343
- function Kn(e) {
2299
+ function Vn(e) {
2344
2300
  return e.hostname === "www.googletagmanager.com" && (e.pathname === "/gtm.js" || e.pathname === "/ns.html");
2345
2301
  }
2346
- const Yn = /* @__PURE__ */ new Set(["DELETE", "PATCH", "POST", "PUT"]), Zn = /^[!#$%&'*+\-.^_`|~A-Za-z0-9]+$/;
2347
- function Qn() {
2302
+ const Jn = /* @__PURE__ */ new Set(["DELETE", "PATCH", "POST", "PUT"]), Kn = /^[!#$%&'*+\-.^_`|~A-Za-z0-9]+$/;
2303
+ function Yn() {
2348
2304
  const e = new Uint8Array(32);
2349
2305
  return globalThis.crypto.getRandomValues(e), btoa(String.fromCharCode(...e)).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
2350
2306
  }
2351
- function Xn(e, t = {}) {
2307
+ function Zn(e, t = {}) {
2352
2308
  const r = t.cookie ?? "csrf-token";
2353
- if (!Zn.test(r))
2309
+ if (!Kn.test(r))
2354
2310
  throw new Error("Demiurge CSRF cookie name is invalid.");
2355
2311
  if (!e)
2356
2312
  throw new Error("Demiurge CSRF token must not be empty.");
@@ -2361,25 +2317,25 @@ function Xn(e, t = {}) {
2361
2317
  ];
2362
2318
  return (t.secure ?? !0) && n.push("Secure"), n.join("; ");
2363
2319
  }
2364
- function Ni(e = {}) {
2365
- const t = Qn();
2320
+ function ki(e = {}) {
2321
+ const t = Yn();
2366
2322
  return {
2367
- cookie: Xn(t, e),
2323
+ cookie: Zn(t, e),
2368
2324
  token: t
2369
2325
  };
2370
2326
  }
2371
- function es(e, t) {
2372
- if (!Yn.has(t.method.toUpperCase()) || e === !1)
2327
+ function Qn(e, t) {
2328
+ if (!Jn.has(t.method.toUpperCase()) || e === !1)
2373
2329
  return null;
2374
2330
  const r = t.headers.get("cookie");
2375
2331
  if (e === void 0 && !r?.trim())
2376
2332
  return null;
2377
- const n = rs(e ?? !0), i = ts(r).get(n.cookie), o = t.headers.get(n.header);
2378
- return !i || !o || !ss(i, o) ? new Response("Invalid CSRF token.", {
2333
+ const n = es(e ?? !0), i = Xn(r).get(n.cookie), o = t.headers.get(n.header);
2334
+ return !i || !o || !rs(i, o) ? new Response("Invalid CSRF token.", {
2379
2335
  status: 403
2380
2336
  }) : null;
2381
2337
  }
2382
- function ts(e) {
2338
+ function Xn(e) {
2383
2339
  const t = /* @__PURE__ */ new Map();
2384
2340
  if (!e)
2385
2341
  return t;
@@ -2388,11 +2344,11 @@ function ts(e) {
2388
2344
  if (n === -1)
2389
2345
  continue;
2390
2346
  const s = r.slice(0, n).trim(), i = r.slice(n + 1).trim();
2391
- s && t.set(s, ns(i));
2347
+ s && t.set(s, ts(i));
2392
2348
  }
2393
2349
  return t;
2394
2350
  }
2395
- function rs(e) {
2351
+ function es(e) {
2396
2352
  return e === !0 ? {
2397
2353
  cookie: "csrf-token",
2398
2354
  header: "x-csrf-token"
@@ -2401,27 +2357,27 @@ function rs(e) {
2401
2357
  header: e.header ?? "x-csrf-token"
2402
2358
  };
2403
2359
  }
2404
- function ns(e) {
2360
+ function ts(e) {
2405
2361
  try {
2406
2362
  return decodeURIComponent(e);
2407
2363
  } catch {
2408
2364
  return e;
2409
2365
  }
2410
2366
  }
2411
- function ss(e, t) {
2367
+ function rs(e, t) {
2412
2368
  let r = e.length ^ t.length;
2413
2369
  const n = Math.max(e.length, t.length);
2414
2370
  for (let s = 0; s < n; s += 1)
2415
2371
  r |= e.charCodeAt(s) ^ t.charCodeAt(s);
2416
2372
  return r === 0;
2417
2373
  }
2418
- const is = {
2374
+ const ns = {
2419
2375
  h: 3600 * 1e3,
2420
2376
  m: 60 * 1e3,
2421
2377
  s: 1e3
2422
- }, os = 1e4;
2423
- function Rt(e = {}) {
2424
- const t = e.maximumEntries ?? os;
2378
+ }, ss = 1e4;
2379
+ function Et(e = {}) {
2380
+ const t = e.maximumEntries ?? ss;
2425
2381
  if (!Number.isSafeInteger(t) || t <= 0)
2426
2382
  throw new Error(
2427
2383
  "Demiurge rate limit maximumEntries must be a positive integer."
@@ -2430,38 +2386,38 @@ function Rt(e = {}) {
2430
2386
  let n = Number.POSITIVE_INFINITY;
2431
2387
  return {
2432
2388
  increment(s, i, o) {
2433
- o >= n && (as(r, o), n = cs(r));
2389
+ o >= n && (is(r, o), n = os(r));
2434
2390
  const a = r.get(s);
2435
2391
  if (!a || a.resetAt <= o) {
2436
2392
  const c = {
2437
2393
  count: 1,
2438
2394
  resetAt: o + i
2439
2395
  };
2440
- return !a && r.size >= t && us(r), r.set(s, c), n = Math.min(n, c.resetAt), c;
2396
+ return !a && r.size >= t && as(r), r.set(s, c), n = Math.min(n, c.resetAt), c;
2441
2397
  }
2442
2398
  return a.count += 1, a;
2443
2399
  }
2444
2400
  };
2445
2401
  }
2446
- function as(e, t) {
2402
+ function is(e, t) {
2447
2403
  for (const [r, n] of e)
2448
2404
  n.resetAt <= t && e.delete(r);
2449
2405
  }
2450
- function cs(e) {
2406
+ function os(e) {
2451
2407
  let t = Number.POSITIVE_INFINITY;
2452
2408
  for (const r of e.values())
2453
2409
  t = Math.min(t, r.resetAt);
2454
2410
  return t;
2455
2411
  }
2456
- function us(e) {
2412
+ function as(e) {
2457
2413
  const t = e.keys().next().value;
2458
2414
  t !== void 0 && e.delete(t);
2459
2415
  }
2460
- function fs(e, t, r, n = Date.now()) {
2416
+ function cs(e, t, r, n = Date.now()) {
2461
2417
  if (!e)
2462
2418
  return null;
2463
2419
  xe(e);
2464
- const s = vt(e.window), i = ls(e, t), o = r.increment(i, s, n), a = Math.max(0, e.limit - o.count), c = new Headers({
2420
+ const s = Rt(e.window), i = us(e, t), o = r.increment(i, s, n), a = Math.max(0, e.limit - o.count), c = new Headers({
2465
2421
  "retry-after": String(Math.ceil(Math.max(0, o.resetAt - n) / 1e3)),
2466
2422
  "x-ratelimit-limit": String(e.limit),
2467
2423
  "x-ratelimit-remaining": String(a),
@@ -2472,7 +2428,7 @@ function fs(e, t, r, n = Date.now()) {
2472
2428
  status: 429
2473
2429
  }) : null;
2474
2430
  }
2475
- function vt(e) {
2431
+ function Rt(e) {
2476
2432
  if (typeof e == "number") {
2477
2433
  if (!Number.isSafeInteger(e) || e <= 0)
2478
2434
  throw new Error("Demiurge rate limit window must be a positive integer.");
@@ -2481,7 +2437,7 @@ function vt(e) {
2481
2437
  const t = /^(\d+)(s|m|h)$/i.exec(e.trim());
2482
2438
  if (!t)
2483
2439
  throw new Error("Demiurge rate limit window must use an s/m/h suffix.");
2484
- const r = Number(t[1]), n = t[2].toLowerCase(), s = r * is[n];
2440
+ const r = Number(t[1]), n = t[2].toLowerCase(), s = r * ns[n];
2485
2441
  if (!Number.isSafeInteger(s))
2486
2442
  throw new Error("Demiurge rate limit window is too large.");
2487
2443
  return s;
@@ -2489,28 +2445,28 @@ function vt(e) {
2489
2445
  function xe(e) {
2490
2446
  if (!Number.isSafeInteger(e.limit) || e.limit <= 0)
2491
2447
  throw new Error("Demiurge rate limit limit must be a positive integer.");
2492
- vt(e.window);
2448
+ Rt(e.window);
2493
2449
  }
2494
- function ls(e, t) {
2495
- return `${ds(e.key)}:${ms(e.key, t)}`;
2450
+ function us(e, t) {
2451
+ return `${fs(e.key)}:${ls(e.key, t)}`;
2496
2452
  }
2497
- function ds(e) {
2453
+ function fs(e) {
2498
2454
  return typeof e == "string" ? e : `header:${e.header.toLowerCase()}`;
2499
2455
  }
2500
- function ms(e, t) {
2501
- return e === "ip" ? hs(t) : t.headers.get(e.header) ?? "missing";
2456
+ function ls(e, t) {
2457
+ return e === "ip" ? ds(t) : t.headers.get(e.header) ?? "missing";
2502
2458
  }
2503
- function hs(e) {
2504
- return $t(e)?.clientIp ?? "unknown";
2459
+ function ds(e) {
2460
+ return Dt(e)?.clientIp ?? "unknown";
2505
2461
  }
2506
- const ps = {
2462
+ const ms = {
2507
2463
  b: 1,
2508
2464
  gb: 1024 ** 3,
2509
2465
  kb: 1024,
2510
2466
  mb: 1024 ** 2
2511
2467
  };
2512
- function gs(e, t, r) {
2513
- const n = ws(e, r);
2468
+ function hs(e, t, r) {
2469
+ const n = gs(e, r);
2514
2470
  if (n)
2515
2471
  return n;
2516
2472
  if (e?.maxBodySize === void 0)
@@ -2518,12 +2474,12 @@ function gs(e, t, r) {
2518
2474
  const s = t.headers.get("content-length");
2519
2475
  if (!s)
2520
2476
  return null;
2521
- const i = Ss(s);
2477
+ const i = ys(s);
2522
2478
  if (i === null)
2523
2479
  return new Response("Invalid Content-Length.", {
2524
2480
  status: 400
2525
2481
  });
2526
- const o = bt(e.maxBodySize);
2482
+ const o = vt(e.maxBodySize);
2527
2483
  return i > o ? new Response("Request body too large.", {
2528
2484
  status: 413
2529
2485
  }) : null;
@@ -2533,10 +2489,10 @@ class L extends Error {
2533
2489
  super("Demiurge request body exceeded maxBodySize while being read."), this.name = "RequestBodyTooLargeError";
2534
2490
  }
2535
2491
  }
2536
- function ys(e, t) {
2492
+ function ps(e, t) {
2537
2493
  if (e?.maxBodySize === void 0 || t.body === null)
2538
2494
  return t;
2539
- const r = bt(e.maxBodySize), n = t.body.getReader();
2495
+ const r = vt(e.maxBodySize), n = t.body.getReader();
2540
2496
  let s = 0;
2541
2497
  const i = new ReadableStream({
2542
2498
  async pull(a) {
@@ -2568,18 +2524,18 @@ function ys(e, t) {
2568
2524
  });
2569
2525
  return Nt(t, o), o;
2570
2526
  }
2571
- function z() {
2527
+ function B() {
2572
2528
  return new Response("Request body too large.", { status: 413 });
2573
2529
  }
2574
- function ws(e, t) {
2575
- return !e?.allowedMethods || Es(e.allowedMethods, t) ? null : new Response(null, {
2530
+ function gs(e, t) {
2531
+ return !e?.allowedMethods || ws(e.allowedMethods, t) ? null : new Response(null, {
2576
2532
  headers: {
2577
- allow: Rs(e.allowedMethods)
2533
+ allow: Ss(e.allowedMethods)
2578
2534
  },
2579
2535
  status: 405
2580
2536
  });
2581
2537
  }
2582
- function bt(e) {
2538
+ function vt(e) {
2583
2539
  if (typeof e == "number") {
2584
2540
  if (!Number.isSafeInteger(e) || e < 0)
2585
2541
  throw new Error("Demiurge request maxBodySize must be a non-negative integer.");
@@ -2590,25 +2546,25 @@ function bt(e) {
2590
2546
  throw new Error(
2591
2547
  "Demiurge request maxBodySize must use bytes or a b/kb/mb/gb suffix."
2592
2548
  );
2593
- const r = Number(t[1]), n = t[2].toLowerCase(), s = r * ps[n];
2549
+ const r = Number(t[1]), n = t[2].toLowerCase(), s = r * ms[n];
2594
2550
  if (!Number.isSafeInteger(s))
2595
2551
  throw new Error("Demiurge request maxBodySize is too large.");
2596
2552
  return s;
2597
2553
  }
2598
- function Ss(e) {
2554
+ function ys(e) {
2599
2555
  if (!/^\d+$/.test(e))
2600
2556
  return null;
2601
2557
  const t = Number(e);
2602
2558
  return Number.isSafeInteger(t) ? t : null;
2603
2559
  }
2604
- function Es(e, t) {
2560
+ function ws(e, t) {
2605
2561
  return e.includes(t) || t === "HEAD" && e.includes("GET");
2606
2562
  }
2607
- function Rs(e) {
2563
+ function Ss(e) {
2608
2564
  const t = [...e];
2609
2565
  return t.includes("GET") && !t.includes("HEAD") && t.push("HEAD"), t.join(", ");
2610
2566
  }
2611
- const vs = [
2567
+ const Es = [
2612
2568
  "GET",
2613
2569
  "POST",
2614
2570
  "PUT",
@@ -2617,15 +2573,15 @@ const vs = [
2617
2573
  "OPTIONS",
2618
2574
  "HEAD"
2619
2575
  ];
2620
- function bs(e, t = {}) {
2576
+ function Rs(e, t = {}) {
2621
2577
  for (const [n, s] of Object.entries(e)) {
2622
- Ts(n, s);
2623
- for (const i of vs) {
2578
+ vs(n, s);
2579
+ for (const i of Es) {
2624
2580
  const o = s[i];
2625
- !o || o.kind === "page" || xs(n, i, o, s);
2581
+ !o || o.kind === "page" || bs(n, i, o, s);
2626
2582
  }
2627
2583
  }
2628
- const r = rt(
2584
+ const r = et(
2629
2585
  Object.fromEntries(
2630
2586
  Object.entries(e).map(([n, s]) => [
2631
2587
  n,
@@ -2635,33 +2591,33 @@ function bs(e, t = {}) {
2635
2591
  );
2636
2592
  return As(r, e, t.adapter), r;
2637
2593
  }
2638
- function Ts(e, t) {
2594
+ function vs(e, t) {
2639
2595
  const r = t.policy?.security?.rateLimit;
2640
- r && H(e, "policy", "rate limit", () => {
2596
+ r && j(e, "policy", "rate limit", () => {
2641
2597
  xe(r);
2642
2598
  });
2643
2599
  }
2644
- function xs(e, t, r, n) {
2645
- r.cors && H(e, t, "CORS", () => {
2646
- Te(r.cors), Ps(e, t, r.cors.methods, n);
2647
- }), r.security?.rateLimit && H(e, t, "rate limit", () => {
2600
+ function bs(e, t, r, n) {
2601
+ r.cors && j(e, t, "CORS", () => {
2602
+ Te(r.cors), Ts(e, t, r.cors.methods, n);
2603
+ }), r.security?.rateLimit && j(e, t, "rate limit", () => {
2648
2604
  xe(r.security.rateLimit);
2649
2605
  });
2650
2606
  }
2651
- function Ps(e, t, r, n) {
2607
+ function Ts(e, t, r, n) {
2652
2608
  if (r) {
2653
2609
  for (const s of r)
2654
- if (s !== "OPTIONS" && !ks(n, s))
2610
+ if (s !== "OPTIONS" && !xs(n, s))
2655
2611
  throw new Error(
2656
2612
  `Route ${JSON.stringify(e)} export ${t} allows CORS method ${s}, but the route does not export that response capability.`
2657
2613
  );
2658
2614
  }
2659
2615
  }
2660
- function ks(e, t) {
2616
+ function xs(e, t) {
2661
2617
  const r = t === "HEAD" ? e.HEAD ?? e.GET : e[t];
2662
- return Cs(r) ? r : void 0;
2618
+ return Ps(r) ? r : void 0;
2663
2619
  }
2664
- function Cs(e) {
2620
+ function Ps(e) {
2665
2621
  return !!(e && e.kind !== "page");
2666
2622
  }
2667
2623
  function As(e, t, r) {
@@ -2669,17 +2625,17 @@ function As(e, t, r) {
2669
2625
  const i = t[s.file], o = i?.GET;
2670
2626
  if (!o || o.kind !== "page")
2671
2627
  continue;
2672
- const a = K(
2628
+ const a = Y(
2673
2629
  ...e.policies.filter(
2674
2630
  (c) => T(c.fileSegments, s.fileSegments)
2675
2631
  ).map((c) => t[c.file]?.policy),
2676
2632
  i.policy
2677
2633
  );
2678
- Be(s.file, "GET", a, r), $s(
2634
+ qe(s.file, "GET", a, r), Os(
2679
2635
  s.file,
2680
2636
  o.render.mode,
2681
2637
  a.document
2682
- ), Ds(
2638
+ ), Cs(
2683
2639
  s.file,
2684
2640
  "GET",
2685
2641
  a,
@@ -2697,13 +2653,13 @@ function As(e, t, r) {
2697
2653
  ...e.fallbacks.notFound
2698
2654
  ];
2699
2655
  for (const s of n) {
2700
- const i = K(
2656
+ const i = Y(
2701
2657
  ...e.policies.filter(
2702
2658
  (o) => T(o.fileSegments, s.fileSegments)
2703
2659
  ).map((o) => t[o.file]?.policy),
2704
2660
  t[s.file]?.policy
2705
2661
  );
2706
- Be(
2662
+ qe(
2707
2663
  s.file,
2708
2664
  "policy",
2709
2665
  i,
@@ -2711,47 +2667,103 @@ function As(e, t, r) {
2711
2667
  );
2712
2668
  }
2713
2669
  }
2714
- function Ds(e, t, r, n) {
2670
+ function Cs(e, t, r, n) {
2715
2671
  const s = n.flatMap(
2716
2672
  (l) => Array.isArray(l) ? l : []
2717
2673
  );
2718
2674
  if (s.length === 0 || !r.document)
2719
2675
  return;
2720
- const i = "startup-verification-nonce", a = On({
2676
+ const i = "startup-verification-nonce", a = Dn({
2721
2677
  document: {
2722
2678
  headers: { nonce: i },
2723
2679
  policy: r.document,
2724
2680
  scripts: s.map((l) => ({
2725
2681
  ...l,
2726
- nonce: X(r.document) ? i : l.nonce
2682
+ nonce: ee(r.document) ? i : l.nonce
2727
2683
  }))
2728
2684
  }
2729
2685
  }).findings.find(
2730
2686
  (l) => l.code === "csp-script-src-blocked"
2731
2687
  );
2732
- if (!a)
2688
+ if (!a) {
2689
+ ks(
2690
+ e,
2691
+ t,
2692
+ r.document.csp,
2693
+ s
2694
+ );
2733
2695
  return;
2696
+ }
2734
2697
  const c = s.find(
2735
2698
  (l) => a.message.includes(l.src)
2736
- ), f = (F(r.document, { nonce: i }).get("content-security-policy") ?? "").split("; ").find(
2699
+ ), f = (W(r.document, { nonce: i }).get("content-security-policy") ?? "").split("; ").find(
2737
2700
  (l) => l.startsWith("script-src ")
2738
2701
  ) ?? "default-src (script-src fallback)";
2739
2702
  throw new Error(
2740
2703
  `Route ${JSON.stringify(e)} export ${t} declares script ${JSON.stringify(c?.src)} that violates the effective ${f} policy.`
2741
2704
  );
2742
2705
  }
2743
- function Be(e, t, r, n) {
2744
- H(e, t, "effective document", () => {
2745
- F(r.document ?? {}, {
2706
+ const $s = [
2707
+ { directive: "connectSrc", name: "connect-src", need: "connect" },
2708
+ { directive: "imgSrc", name: "img-src", need: "img" }
2709
+ ];
2710
+ function ks(e, t, r, n) {
2711
+ if (r)
2712
+ for (const s of n)
2713
+ for (const { directive: i, name: o, need: a } of $s) {
2714
+ const c = s.needs?.[a] ?? [];
2715
+ if (c.length === 0)
2716
+ continue;
2717
+ const u = H(r[i]) ?? H(r.defaultSrc);
2718
+ if (u !== void 0) {
2719
+ for (const f of c)
2720
+ if (!(Array.isArray(u) && Ds(u, f)))
2721
+ throw new Error(
2722
+ `Route ${JSON.stringify(e)} export ${t} declares script ${JSON.stringify(s.src)} that needs ${o} ${f}, which the effective policy does not allow. Add ${f} to security.needs.${a} or to csp.${i} for this route.`
2723
+ );
2724
+ }
2725
+ }
2726
+ }
2727
+ function Ds(e, t) {
2728
+ return e.includes("'none'") ? !1 : e.includes("*") || e.includes(t) ? !0 : t.startsWith("'") ? !1 : e.some((r) => Ns(r, t));
2729
+ }
2730
+ function Ns(e, t) {
2731
+ if (e.startsWith("'"))
2732
+ return !1;
2733
+ let r;
2734
+ try {
2735
+ r = new URL(t);
2736
+ } catch {
2737
+ return !1;
2738
+ }
2739
+ if (e === `${r.protocol}`)
2740
+ return !0;
2741
+ let n;
2742
+ try {
2743
+ n = new URL(e);
2744
+ } catch {
2745
+ return !1;
2746
+ }
2747
+ if (n.protocol !== r.protocol || n.port !== r.port)
2748
+ return !1;
2749
+ if (n.hostname.startsWith("*.")) {
2750
+ const s = n.hostname.slice(1);
2751
+ return r.hostname.endsWith(s) && r.hostname !== n.hostname.slice(2);
2752
+ }
2753
+ return n.hostname === r.hostname;
2754
+ }
2755
+ function qe(e, t, r, n) {
2756
+ j(e, t, "effective document", () => {
2757
+ W(r.document ?? {}, {
2746
2758
  nonce: "startup-verification-nonce"
2747
2759
  });
2748
- }), !(!n || !X(r.document)) && H(e, t, "effective CSP", () => {
2760
+ }), !(!n || !ee(r.document)) && j(e, t, "effective CSP", () => {
2749
2761
  Ot(n, ["nonceInjection"]);
2750
2762
  });
2751
2763
  }
2752
- function $s(e, t, r) {
2764
+ function Os(e, t, r) {
2753
2765
  if (t === "static") {
2754
- const s = Ns(r?.csp);
2766
+ const s = Ls(r?.csp);
2755
2767
  if (s)
2756
2768
  throw new Error(
2757
2769
  `Route ${JSON.stringify(e)} uses render mode "static" with an effective ${s} directive that depends on a CSP nonce. Use security.static() for static output or remove the nonce source from the document policy.`
@@ -2760,49 +2772,49 @@ function $s(e, t, r) {
2760
2772
  }
2761
2773
  if (t !== "streaming")
2762
2774
  return;
2763
- const n = Os(r?.csp);
2764
- if (!(!n || Ls(n.sources)))
2775
+ const n = Is(r?.csp);
2776
+ if (!(!n || Ms(n.sources)))
2765
2777
  throw new Error(
2766
2778
  `Route ${JSON.stringify(e)} uses render mode "streaming" with an effective ${n.name} directive that does not allow React runtime inline payload scripts. Add a nonce placeholder or allow 'unsafe-inline' without nonce or hash sources.`
2767
2779
  );
2768
2780
  }
2769
- function Ns(e) {
2781
+ function Ls(e) {
2770
2782
  if (e)
2771
2783
  for (const [t, r] of Object.entries(e)) {
2772
- const n = he(r);
2773
- if (Array.isArray(n) && n.some((s) => Is(s)))
2774
- return Us(t);
2784
+ const n = H(r);
2785
+ if (Array.isArray(n) && n.some((s) => Us(s)))
2786
+ return js(t);
2775
2787
  }
2776
2788
  }
2777
- function Os(e) {
2789
+ function Is(e) {
2778
2790
  if (!e)
2779
2791
  return;
2780
- const t = he(e.scriptSrc);
2792
+ const t = H(e.scriptSrc);
2781
2793
  if (Array.isArray(t))
2782
2794
  return { name: "script-src", sources: t };
2783
- const r = he(e.defaultSrc);
2795
+ const r = H(e.defaultSrc);
2784
2796
  if (Array.isArray(r))
2785
2797
  return { name: "default-src", sources: r };
2786
2798
  }
2787
- function Ls(e) {
2788
- return e.some((t) => Tt(t)) ? !0 : e.includes("'unsafe-inline'") && !e.some((t) => Ms(t));
2799
+ function Ms(e) {
2800
+ return e.some((t) => bt(t)) ? !0 : e.includes("'unsafe-inline'") && !e.some((t) => Hs(t));
2789
2801
  }
2790
- function Is(e) {
2791
- return Tt(e) || /^'nonce-[^']*'$/i.test(e);
2802
+ function Us(e) {
2803
+ return bt(e) || /^'nonce-[^']*'$/i.test(e);
2792
2804
  }
2793
- function Tt(e) {
2805
+ function bt(e) {
2794
2806
  return e.includes("{nonce}");
2795
2807
  }
2796
- function Ms(e) {
2808
+ function Hs(e) {
2797
2809
  return /^'(?:nonce-|sha256-|sha384-|sha512-)/i.test(e);
2798
2810
  }
2799
- function he(e) {
2811
+ function H(e) {
2800
2812
  return e && typeof e == "object" && !Array.isArray(e) && "replace" in e ? e.replace : e;
2801
2813
  }
2802
- function Us(e) {
2814
+ function js(e) {
2803
2815
  return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
2804
2816
  }
2805
- function H(e, t, r, n) {
2817
+ function j(e, t, r, n) {
2806
2818
  try {
2807
2819
  n();
2808
2820
  } catch (s) {
@@ -2815,8 +2827,8 @@ function H(e, t, r, n) {
2815
2827
  );
2816
2828
  }
2817
2829
  }
2818
- function Hs(e) {
2819
- return V({
2830
+ function Fs(e) {
2831
+ return J({
2820
2832
  instance: `${e.pathname}${e.search}`,
2821
2833
  status: 404,
2822
2834
  title: "Not Found"
@@ -2824,11 +2836,11 @@ function Hs(e) {
2824
2836
  }
2825
2837
  async function pe(e, t, r = {}) {
2826
2838
  const n = new URL(t.url);
2827
- if (!ut(t))
2828
- return Hs(n);
2829
- const s = await de(e, n.pathname, {
2839
+ if (!at(t))
2840
+ return Fs(n);
2841
+ const s = await me(e, n.pathname, {
2830
2842
  onLayoutError: (u) => r.onError?.(u, "page")
2831
- }), i = await js(e, n.pathname), o = r.nonce ?? (X(i) ? mt() : void 0), a = Fs(s, { ...r, nonce: o }), c = F(i ?? {}, {
2843
+ }), i = await Ws(e, n.pathname), o = r.nonce ?? (ee(i) ? dt() : void 0), a = qs(s, { ...r, nonce: o }), c = W(i ?? {}, {
2832
2844
  nonce: o,
2833
2845
  request: t
2834
2846
  });
@@ -2840,43 +2852,43 @@ async function pe(e, t, r = {}) {
2840
2852
  }
2841
2853
  );
2842
2854
  }
2843
- async function js(e, t) {
2855
+ async function Ws(e, t) {
2844
2856
  const r = await Promise.all(
2845
- or(e, t).map((n) => n.load())
2857
+ nr(e, t).map((n) => n.load())
2846
2858
  );
2847
- return K(...r.map((n) => n.policy)).document;
2859
+ return Y(...r.map((n) => n.policy)).document;
2848
2860
  }
2849
- function Fs(e, t = {}) {
2850
- const r = e.notFound ?? Me;
2861
+ function qs(e, t = {}) {
2862
+ const r = e.notFound ?? Le;
2851
2863
  try {
2852
- return ae(e, r, e.layouts, t);
2864
+ return ce(e, r, e.layouts, t);
2853
2865
  } catch (n) {
2854
2866
  t.onError?.(n, "page");
2855
2867
  }
2856
2868
  try {
2857
- return ae(e, r, [], t);
2869
+ return ce(e, r, [], t);
2858
2870
  } catch (n) {
2859
2871
  t.onError?.(n, "page");
2860
2872
  }
2861
- return ae(e, Me, [], t);
2873
+ return ce(e, Le, [], t);
2862
2874
  }
2863
- function ae(e, t, r, n) {
2875
+ function ce(e, t, r, n) {
2864
2876
  const s = r.reduceRight(
2865
- (o, a) => ue(a, {
2877
+ (o, a) => fe(a, {
2866
2878
  children: o,
2867
2879
  path: {},
2868
2880
  pathname: e.pathname
2869
2881
  }),
2870
- ue(t, { pathname: e.pathname })
2871
- ), i = Je({
2882
+ fe(t, { pathname: e.pathname })
2883
+ ), i = _e({
2872
2884
  dev: n.dev,
2873
2885
  nonce: n.nonce
2874
2886
  });
2875
- return Ye({
2887
+ return Je({
2876
2888
  body: {
2877
2889
  data: void 0,
2878
2890
  fallback: "not-found",
2879
- html: Ze(Ke(i, s)),
2891
+ html: Ke(Ve(i, s)),
2880
2892
  navigation: n.navigation
2881
2893
  },
2882
2894
  entrySrc: n.clientEntry,
@@ -2888,7 +2900,7 @@ function ae(e, t, r, n) {
2888
2900
  title: n.title
2889
2901
  });
2890
2902
  }
2891
- const xt = [
2903
+ const Tt = [
2892
2904
  "GET",
2893
2905
  "POST",
2894
2906
  "PUT",
@@ -2896,12 +2908,12 @@ const xt = [
2896
2908
  "DELETE",
2897
2909
  "OPTIONS",
2898
2910
  "HEAD"
2899
- ], Pt = Rt();
2900
- function Oi(e) {
2901
- e.routeModules && bs(e.routeModules, { adapter: e.adapter });
2902
- const t = rt(e.routes), r = e.rateLimitStore ?? Rt();
2903
- return e.cacheStore && Xe(e.cacheStore.namespace), async function(s) {
2904
- return await Ws(t, s, {
2911
+ ], xt = Et();
2912
+ function Di(e) {
2913
+ e.routeModules && Rs(e.routeModules, { adapter: e.adapter });
2914
+ const t = et(e.routes), r = e.rateLimitStore ?? Et();
2915
+ return e.cacheStore && Ze(e.cacheStore.namespace), async function(s) {
2916
+ return await zs(t, s, {
2905
2917
  cacheStore: e.cacheStore,
2906
2918
  onError: e.onError,
2907
2919
  rateLimitStore: r,
@@ -2910,22 +2922,22 @@ function Oi(e) {
2910
2922
  });
2911
2923
  };
2912
2924
  }
2913
- async function Ws(e, t, r = {
2914
- rateLimitStore: Pt
2925
+ async function zs(e, t, r = {
2926
+ rateLimitStore: xt
2915
2927
  }) {
2916
- const n = new URL(t.url), s = Bs(n, r), i = ot(t);
2928
+ const n = new URL(t.url), s = _s(n, r), i = st(t);
2917
2929
  let o;
2918
2930
  try {
2919
- o = j(e.routes, n.pathname);
2931
+ o = F(e.routes, n.pathname);
2920
2932
  } catch (a) {
2921
2933
  if (!(a instanceof Ee))
2922
2934
  throw a;
2923
- const c = V({
2935
+ const c = J({
2924
2936
  instance: `${n.pathname}${n.search}`,
2925
2937
  status: 400,
2926
2938
  title: "Bad Request"
2927
2939
  });
2928
- return i ? q(c, se) : c;
2940
+ return i ? z(c, ie) : c;
2929
2941
  }
2930
2942
  if (!o)
2931
2943
  try {
@@ -2934,7 +2946,7 @@ async function Ws(e, t, r = {
2934
2946
  t,
2935
2947
  s
2936
2948
  );
2937
- return i ? q(a, Ie) : a;
2949
+ return i ? z(a, Oe) : a;
2938
2950
  } catch (a) {
2939
2951
  return s.onError(a, "page"), new Response("Not Found", {
2940
2952
  headers: { "content-type": "text/plain; charset=utf-8" },
@@ -2942,7 +2954,7 @@ async function Ws(e, t, r = {
2942
2954
  });
2943
2955
  }
2944
2956
  try {
2945
- const a = await qs(
2957
+ const a = await Bs(
2946
2958
  e,
2947
2959
  t,
2948
2960
  n,
@@ -2950,65 +2962,65 @@ async function Ws(e, t, r = {
2950
2962
  r,
2951
2963
  s
2952
2964
  );
2953
- return i && !a.headers.has(C) ? q(
2965
+ return i && !a.headers.has(C) ? z(
2954
2966
  a,
2955
- a.status === 404 ? Ie : se
2967
+ a.status === 404 ? Oe : ie
2956
2968
  ) : a;
2957
2969
  } catch (a) {
2958
- const c = await G(
2970
+ const c = await _(
2959
2971
  e,
2960
2972
  t,
2961
2973
  a,
2962
2974
  "middleware",
2963
2975
  s
2964
2976
  );
2965
- return i ? q(c, se) : c;
2977
+ return i ? z(c, ie) : c;
2966
2978
  }
2967
2979
  }
2968
- async function qs(e, t, r, n, s, i) {
2980
+ async function Bs(e, t, r, n, s, i) {
2969
2981
  const o = await n.route.load();
2970
2982
  if (t.method.toUpperCase() === "OPTIONS") {
2971
- const h = xn(o, t);
2983
+ const h = bn(o, t);
2972
2984
  if (h)
2973
2985
  return h;
2974
2986
  }
2975
- const a = Js(t.method);
2987
+ const a = Ys(t.method);
2976
2988
  if (!a)
2977
- return Ve(o);
2978
- const c = Ks(o, a);
2989
+ return Ge(o);
2990
+ const c = Zs(o, a);
2979
2991
  if (!c)
2980
- return Ve(o);
2981
- const u = await _s(
2992
+ return Ge(o);
2993
+ const u = await Js(
2982
2994
  e,
2983
2995
  n.route,
2984
2996
  o,
2985
2997
  c
2986
- ), f = u.security, l = es(f?.csrf, t);
2998
+ ), f = u.security, l = Qn(f?.csrf, t);
2987
2999
  if (l)
2988
- return _(l, ce(c), t);
2989
- const m = fs(
3000
+ return V(l, ue(c), t);
3001
+ const m = cs(
2990
3002
  f?.rateLimit,
2991
3003
  t,
2992
- s.rateLimitStore ?? Pt
3004
+ s.rateLimitStore ?? xt
2993
3005
  );
2994
3006
  if (m)
2995
- return _(
3007
+ return V(
2996
3008
  m,
2997
- ce(c),
3009
+ ue(c),
2998
3010
  t
2999
3011
  );
3000
- const d = gs(
3012
+ const d = hs(
3001
3013
  f?.request,
3002
3014
  t,
3003
3015
  a
3004
3016
  );
3005
3017
  if (d)
3006
- return _(
3018
+ return V(
3007
3019
  d,
3008
- ce(c),
3020
+ ue(c),
3009
3021
  t
3010
3022
  );
3011
- t = ys(f?.request, t);
3023
+ t = ps(f?.request, t);
3012
3024
  const P = {};
3013
3025
  if (c.kind === "page") {
3014
3026
  const h = {
@@ -3018,29 +3030,29 @@ async function qs(e, t, r, n, s, i) {
3018
3030
  context: P,
3019
3031
  search: r.searchParams,
3020
3032
  url: r
3021
- }, ee = await Ge(
3033
+ }, te = await ze(
3022
3034
  e,
3023
3035
  n.route
3024
- ), D = X(u.document) ? mt() : void 0, kt = zs(s.cacheStore);
3036
+ ), k = ee(u.document) ? dt() : void 0, Pt = Gs(s.cacheStore);
3025
3037
  let E;
3026
3038
  try {
3027
- E = await _e(ee, h, async () => {
3039
+ E = await Be(te, h, async () => {
3028
3040
  try {
3029
- const p = await nt(
3041
+ const p = await tt(
3030
3042
  e,
3031
3043
  r.pathname,
3032
3044
  t,
3033
3045
  void 0,
3034
- kt,
3046
+ Pt,
3035
3047
  { requestContext: P }
3036
3048
  );
3037
3049
  if (p.status !== "ready")
3038
3050
  return await pe(e, t, {
3039
3051
  ...i,
3040
- nonce: D
3052
+ nonce: k
3041
3053
  });
3042
- if (ot(t))
3043
- return wr(p.match.data);
3054
+ if (st(t))
3055
+ return pr(p.match.data);
3044
3056
  if (p.match.render.mode === "streaming" && !s.renderPage)
3045
3057
  throw new Error(
3046
3058
  "Streaming page routes require an adapter renderer. Pass renderNodePageResponse from @demiurgejs/core/node as createRequestHandler({ renderPage })."
@@ -3048,9 +3060,9 @@ async function qs(e, t, r, n, s, i) {
3048
3060
  return await (s.renderPage ?? Lt)(p.match, {
3049
3061
  ...s.ssr,
3050
3062
  dev: s.dev,
3051
- nonce: D,
3052
- onStreamError: (At) => {
3053
- s.onError?.(At, {
3063
+ nonce: k,
3064
+ onStreamError: (Ct) => {
3065
+ s.onError?.(Ct, {
3054
3066
  pathname: r.pathname,
3055
3067
  site: "page"
3056
3068
  });
@@ -3058,49 +3070,49 @@ async function qs(e, t, r, n, s, i) {
3058
3070
  signal: t.signal
3059
3071
  });
3060
3072
  } catch (p) {
3061
- return p instanceof L ? z() : await G(e, t, p, "page", {
3073
+ return p instanceof L ? B() : await _(e, t, p, "page", {
3062
3074
  ...i,
3063
- nonce: D
3075
+ nonce: k
3064
3076
  });
3065
3077
  }
3066
3078
  });
3067
3079
  } catch (p) {
3068
3080
  if (!(p instanceof L))
3069
3081
  throw p;
3070
- E = z();
3082
+ E = B();
3071
3083
  }
3072
- const Ct = F(u.document ?? {}, {
3073
- nonce: D,
3084
+ const At = W(u.document ?? {}, {
3085
+ nonce: k,
3074
3086
  request: t
3075
3087
  });
3076
- for (const [p, Pe] of Ct)
3088
+ for (const [p, Pe] of At)
3077
3089
  E.headers.set(p, Pe);
3078
- return D && E.headers.set("cache-control", "private, no-store"), a === "HEAD" ? (await E.body?.cancel(), new Response(null, {
3090
+ return k && E.headers.set("cache-control", "private, no-store"), a === "HEAD" ? (await E.body?.cancel(), new Response(null, {
3079
3091
  headers: E.headers,
3080
3092
  status: E.status
3081
3093
  })) : E;
3082
3094
  }
3083
- const A = {
3095
+ const $ = {
3084
3096
  path: n.path,
3085
3097
  pathname: r.pathname,
3086
3098
  request: t,
3087
3099
  context: P,
3088
3100
  search: r.searchParams,
3089
3101
  url: r
3090
- }, g = await Ge(
3102
+ }, g = await ze(
3091
3103
  e,
3092
3104
  n.route
3093
3105
  );
3094
- let k;
3106
+ let A;
3095
3107
  try {
3096
- k = await _e(g, A, async () => {
3108
+ A = await Be(g, $, async () => {
3097
3109
  try {
3098
- return c.kind === "not-found" && c.body === void 0 ? Gs(
3110
+ return c.kind === "not-found" && c.body === void 0 ? Vs(
3099
3111
  await pe(e, t, i),
3100
3112
  c.init
3101
- ) : await Tr(c, A);
3113
+ ) : await Rr(c, $);
3102
3114
  } catch (h) {
3103
- return h instanceof L ? z() : await G(
3115
+ return h instanceof L ? B() : await _(
3104
3116
  e,
3105
3117
  t,
3106
3118
  h,
@@ -3112,12 +3124,12 @@ async function qs(e, t, r, n, s, i) {
3112
3124
  } catch (h) {
3113
3125
  if (!(h instanceof L))
3114
3126
  throw h;
3115
- k = z();
3127
+ A = B();
3116
3128
  }
3117
3129
  try {
3118
- return Vs(k, c, t, a);
3130
+ return Ks(A, c, t, a);
3119
3131
  } catch (h) {
3120
- return await G(
3132
+ return await _(
3121
3133
  e,
3122
3134
  t,
3123
3135
  h,
@@ -3126,10 +3138,10 @@ async function qs(e, t, r, n, s, i) {
3126
3138
  );
3127
3139
  }
3128
3140
  }
3129
- function zs(e) {
3130
- return e ? Qe(e) : ge();
3141
+ function Gs(e) {
3142
+ return e ? Ye(e) : ge();
3131
3143
  }
3132
- function Bs(e, t) {
3144
+ function _s(e, t) {
3133
3145
  return {
3134
3146
  ...t.ssr,
3135
3147
  dev: t.dev,
@@ -3139,7 +3151,7 @@ function Bs(e, t) {
3139
3151
  transformDocument: t.transformDocument
3140
3152
  };
3141
3153
  }
3142
- function Gs(e, t) {
3154
+ function Vs(e, t) {
3143
3155
  if (!t)
3144
3156
  return e;
3145
3157
  const r = new Headers(e.headers), n = new Headers(t.headers);
@@ -3153,13 +3165,13 @@ function Gs(e, t) {
3153
3165
  statusText: t.statusText ?? e.statusText
3154
3166
  });
3155
3167
  }
3156
- async function _s(e, t, r, n) {
3168
+ async function Js(e, t, r, n) {
3157
3169
  const s = await Promise.all(
3158
3170
  e.policies.filter(
3159
3171
  (i) => T(i.fileSegments, t.fileSegments)
3160
3172
  ).map((i) => i.load())
3161
3173
  );
3162
- return K(
3174
+ return Y(
3163
3175
  ...s.map((i) => i.policy),
3164
3176
  r.policy,
3165
3177
  {
@@ -3167,7 +3179,7 @@ async function _s(e, t, r, n) {
3167
3179
  }
3168
3180
  );
3169
3181
  }
3170
- async function Ge(e, t) {
3182
+ async function ze(e, t) {
3171
3183
  return (await Promise.all(
3172
3184
  e.middlewares.filter(
3173
3185
  (n) => T(n.fileSegments, t.fileSegments)
@@ -3176,7 +3188,7 @@ async function Ge(e, t) {
3176
3188
  (n) => n.middleware ? [n.middleware] : []
3177
3189
  );
3178
3190
  }
3179
- async function _e(e, t, r) {
3191
+ async function Be(e, t, r) {
3180
3192
  let n = -1;
3181
3193
  async function s(i) {
3182
3194
  if (i <= n)
@@ -3187,9 +3199,9 @@ async function _e(e, t, r) {
3187
3199
  }
3188
3200
  return await s(0);
3189
3201
  }
3190
- function Vs(e, t, r, n) {
3191
- const s = Lr(
3192
- _(e, t.cors, r),
3202
+ function Ks(e, t, r, n) {
3203
+ const s = Dr(
3204
+ V(e, t.cors, r),
3193
3205
  t.timing
3194
3206
  );
3195
3207
  return n === "HEAD" ? new Response(null, {
@@ -3198,117 +3210,112 @@ function Vs(e, t, r, n) {
3198
3210
  statusText: s.statusText
3199
3211
  }) : s;
3200
3212
  }
3201
- function ce(e) {
3213
+ function ue(e) {
3202
3214
  return e.kind === "page" ? void 0 : e.cors;
3203
3215
  }
3204
- function Js(e) {
3216
+ function Ys(e) {
3205
3217
  const t = e.toUpperCase();
3206
- return xt.includes(t) ? t : null;
3218
+ return Tt.includes(t) ? t : null;
3207
3219
  }
3208
- function Ks(e, t) {
3220
+ function Zs(e, t) {
3209
3221
  return t === "HEAD" ? e.HEAD ?? e.GET : e[t];
3210
3222
  }
3211
- function Ve(e) {
3223
+ function Ge(e) {
3212
3224
  return new Response(null, {
3213
3225
  headers: {
3214
- allow: Ys(e).join(", ")
3226
+ allow: Qs(e).join(", ")
3215
3227
  },
3216
3228
  status: 405
3217
3229
  });
3218
3230
  }
3219
- function Ys(e) {
3220
- const t = xt.filter((r) => e[r]);
3231
+ function Qs(e) {
3232
+ const t = Tt.filter((r) => e[r]);
3221
3233
  return e.GET && !t.includes("HEAD") && t.push("HEAD"), t;
3222
3234
  }
3223
3235
  export {
3224
- fs as $,
3225
- Ie as A,
3226
- se as B,
3227
- Ci as C,
3228
- Me as D,
3229
- ve as E,
3230
- at as F,
3231
- In as G,
3232
- Fr as H,
3233
- Qe as I,
3234
- wt as J,
3235
- Xn as K,
3236
- Qn as L,
3237
- si as M,
3236
+ hs as $,
3237
+ hr as A,
3238
+ Oe as B,
3239
+ ie as C,
3240
+ Pi as D,
3241
+ Le as E,
3242
+ ve as F,
3243
+ it as G,
3244
+ Ur as H,
3245
+ On as I,
3246
+ Ye as J,
3247
+ yt as K,
3248
+ Zn as L,
3249
+ Yn as M,
3238
3250
  C as N,
3239
- ge as O,
3240
- Ht as P,
3241
- Oi as Q,
3251
+ oi as O,
3252
+ ge as P,
3253
+ Ht as Q,
3242
3254
  L as R,
3243
- On as S,
3244
- He as T,
3245
- ii as U,
3246
- ui as V,
3247
- Di as W,
3248
- Ai as X,
3249
- ni as Y,
3250
- ws as Z,
3251
- es as _,
3252
- Rt as a,
3253
- gs as a0,
3254
- Ri as a1,
3255
- Ni as a2,
3256
- wi as a3,
3257
- Si as a4,
3258
- li as a5,
3259
- K as a6,
3260
- an as a7,
3261
- fi as a8,
3262
- ci as a9,
3263
- bi as aa,
3264
- ts as ab,
3265
- vt as ac,
3266
- oi as ad,
3267
- ai as ae,
3268
- ti as af,
3269
- vi as ag,
3270
- _t as ah,
3271
- v as ai,
3272
- Xe as aj,
3273
- fe as ak,
3274
- ki as al,
3275
- Pi as am,
3276
- xi as an,
3277
- di as ao,
3278
- ri as ap,
3279
- Ei as aq,
3280
- gi as ar,
3281
- T as as,
3282
- yi as at,
3283
- pi as au,
3284
- cr as av,
3285
- pr as aw,
3286
- Q as ax,
3287
- R as ay,
3288
- $i as b,
3289
- mi as c,
3290
- F as d,
3291
- Te as e,
3292
- xe as f,
3293
- mt as g,
3294
- Ws as h,
3295
- j as i,
3296
- rt as j,
3297
- Ae as k,
3298
- Ti as l,
3299
- on as m,
3300
- ys as n,
3301
- bt as o,
3255
+ Dn as S,
3256
+ Me as T,
3257
+ ai as U,
3258
+ Ci as V,
3259
+ Ai as W,
3260
+ ii as X,
3261
+ gs as Y,
3262
+ Qn as Z,
3263
+ cs as _,
3264
+ Rs as a,
3265
+ Si as a0,
3266
+ ki as a1,
3267
+ gi as a2,
3268
+ yi as a3,
3269
+ ui as a4,
3270
+ Y as a5,
3271
+ nn as a6,
3272
+ ci as a7,
3273
+ Ri as a8,
3274
+ Xn as a9,
3275
+ Rt as aa,
3276
+ ni as ab,
3277
+ Ei as ac,
3278
+ v as ad,
3279
+ Ze as ae,
3280
+ le as af,
3281
+ xi as ag,
3282
+ Ti as ah,
3283
+ bi as ai,
3284
+ fi as aj,
3285
+ si as ak,
3286
+ wi as al,
3287
+ hi as am,
3288
+ T as an,
3289
+ pi as ao,
3290
+ mi as ap,
3291
+ ir as aq,
3292
+ dr as ar,
3293
+ X as as,
3294
+ R as at,
3295
+ li as b,
3296
+ Di as c,
3297
+ Et as d,
3298
+ $i as e,
3299
+ W as f,
3300
+ xe as g,
3301
+ zs as h,
3302
+ dt as i,
3303
+ F as j,
3304
+ et as k,
3305
+ $e as l,
3306
+ rn as m,
3307
+ vi as n,
3308
+ ps as o,
3302
3309
  U as p,
3303
- Sr as q,
3310
+ vt as q,
3304
3311
  pe as r,
3305
- $ as s,
3306
- Tr as t,
3307
- hi as u,
3308
- bs as v,
3309
- nt as w,
3310
- nr as x,
3311
- gr as y,
3312
- yr as z
3312
+ D as s,
3313
+ Rr as t,
3314
+ gr as u,
3315
+ Te as v,
3316
+ di as w,
3317
+ tt as x,
3318
+ er as y,
3319
+ mr as z
3313
3320
  };
3314
- //# sourceMappingURL=testing-DBjVCN5v.js.map
3321
+ //# sourceMappingURL=testing-B_iMFYz_.js.map