@voltro/cli 0.37.0 → 0.38.0

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 (104) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/dist/{apiBuild-DGsShRuF.js → apiBuild-CvacV4zA.js} +2 -2
  3. package/dist/apiBuild-ttSDDOGp.js +2 -0
  4. package/dist/bin.js +1 -1
  5. package/dist/bootRefusal-pgvDxlrU.js +7 -0
  6. package/dist/{build-CiFA-E19.js → build-_LoTC1s0.js} +30 -30
  7. package/dist/{checkCommand-CLPTzYqM.js → checkCommand-Pjk5sBl2.js} +2 -2
  8. package/dist/{checkCommand-CIPYyNyc.js → checkCommand-wibtQx-N.js} +1 -1
  9. package/dist/{codegenCommand-BxS3sCeJ.js → codegenCommand-C60m_LCp.js} +1 -1
  10. package/dist/{codemodRunner-cyqu5oxr.js → codemodRunner-CXgQ-ecJ.js} +314 -201
  11. package/dist/{commands-BwG9A9Vv.js → commands-DaZVi9wi.js} +20 -20
  12. package/dist/{dashboardCommand-C7U146xQ.js → dashboardCommand-Dxy_kmoW.js} +3 -3
  13. package/dist/{dataCommand-BOwd8_aJ.js → dataCommand-D6-Ha2lf.js} +1 -1
  14. package/dist/{dev-BV6XNYKf.js → dev-CAOoXOkc.js} +1 -1
  15. package/dist/{dev-bwDgSObH.js → dev-E7Eo5GHc.js} +261 -260
  16. package/dist/doctorCommand-Cjl8Yii8.js +2 -0
  17. package/dist/{doctorCommand-BXyrtN2l.js → doctorCommand-gmDyALFL.js} +10 -10
  18. package/dist/{dormancyCommand-BDdRRLsa.js → dormancyCommand-CE6wG8lj.js} +1 -1
  19. package/dist/{embeddingsCommand-CjWGcAE6.js → embeddingsCommand-C3uAuf6N.js} +1 -1
  20. package/dist/{envCommand-B_TeG297.js → envCommand-DzuWh8ya.js} +19 -19
  21. package/dist/{evolveCommand-D6N-WfA4.js → evolveCommand-DPLqcYb2.js} +2 -2
  22. package/dist/index.js +1 -1
  23. package/dist/{infoCommand-BHKTprrx.js → infoCommand-CmczGj_l.js} +1 -1
  24. package/dist/{runtimeTrace-WYV7qYvz.js → runtimeTrace-6jfznSzr.js} +1 -1
  25. package/dist/{sdkgen-TM5sSdf7.js → sdkgen-CEJZZQUA.js} +1 -1
  26. package/dist/serveCommand-DNRF2nDI.js +2 -0
  27. package/dist/{serveCommand-CyZsXL1l.js → serveCommand-DnY4VS3D.js} +541 -540
  28. package/dist/serveEntry.js +1 -1
  29. package/dist/{start-BgN62boB.js → start-CidwCcjl.js} +1 -1
  30. package/dist/{start-T4VesWiM.js → start-RCh6qKFe.js} +24 -24
  31. package/dist/startEntry.js +1 -1
  32. package/dist/startup.d.ts +40 -1
  33. package/dist/startup.js +2 -2
  34. package/dist/startupRunner-CEqQq7ax.js +108 -0
  35. package/dist/updateCommand-B0J_T9Vs.js +2 -0
  36. package/dist/{updateCommand-9GHHsmDf.js → updateCommand-CmksX7m_.js} +1 -1
  37. package/dist/{webDev-Dybxew86.js → webDev-BKdD7c_a.js} +689 -691
  38. package/dist/webDev-CcJfdSjl2.js +2 -0
  39. package/dist/{webhooksCommand-CHWSPk5z.js → webhooksCommand-BHeaF1ZJ.js} +1 -1
  40. package/package.json +29 -17
  41. package/templates/AGENTS.md +1 -1
  42. package/templates/agent-docs/_index.md +1 -1
  43. package/templates/agent-docs/plugins/audit.md +4 -0
  44. package/templates/agent-docs/plugins/auth.md +4 -6
  45. package/templates/agent-docs/reference.md +3 -2
  46. package/templates/agent-docs/whats-new.md +49 -47
  47. package/templates/apps/api-ai/package.json +7 -7
  48. package/templates/apps/api-auth/package.json +8 -8
  49. package/templates/apps/api-backend/package.json +7 -7
  50. package/templates/apps/api-backend-deactivation/package.json +7 -7
  51. package/templates/apps/api-backend-mail/package.json +8 -8
  52. package/templates/apps/api-backend-mariadb/package.json +9 -9
  53. package/templates/apps/api-backend-sqlite/package.json +8 -8
  54. package/templates/apps/api-backend-storage/package.json +8 -8
  55. package/templates/apps/api-cms/package.json +10 -10
  56. package/templates/apps/api-cms/tests/content.write.test.ts +16 -2
  57. package/templates/apps/api-collab/mutations/documents.setBody.mutation.server.ts +11 -5
  58. package/templates/apps/api-collab/package.json +8 -8
  59. package/templates/apps/api-collab/tests/documents.setBody.test.ts +8 -2
  60. package/templates/apps/api-data-advanced/package.json +8 -8
  61. package/templates/apps/api-durable/package.json +8 -8
  62. package/templates/apps/api-feature-flags/package.json +9 -9
  63. package/templates/apps/api-governance/package.json +8 -8
  64. package/templates/apps/api-kv/package.json +8 -8
  65. package/templates/apps/api-moderation/package.json +8 -8
  66. package/templates/apps/api-observability/package.json +8 -8
  67. package/templates/apps/api-ratelimit/package.json +8 -8
  68. package/templates/apps/api-rbac/package.json +8 -8
  69. package/templates/apps/api-rest/package.json +7 -7
  70. package/templates/apps/api-saas/package.json +11 -11
  71. package/templates/apps/api-saas-starter/package.json +10 -10
  72. package/templates/apps/api-search/package.json +8 -8
  73. package/templates/apps/api-status/package.json +8 -8
  74. package/templates/apps/api-versioning/mutations/documents.update.mutation.server.ts +7 -5
  75. package/templates/apps/api-versioning/package.json +8 -8
  76. package/templates/apps/api-webhooks/package.json +9 -9
  77. package/templates/apps/changelog/package.json +6 -6
  78. package/templates/apps/edge-functions/package.json +2 -2
  79. package/templates/apps/frontend-admin/package.json +8 -8
  80. package/templates/apps/frontend-app/package.json +9 -9
  81. package/templates/apps/frontend-auth/package.json +8 -8
  82. package/templates/apps/frontend-blank/package.json +7 -7
  83. package/templates/apps/frontend-cms/package.json +9 -9
  84. package/templates/apps/frontend-collab/package.json +10 -10
  85. package/templates/apps/frontend-contact/package.json +7 -7
  86. package/templates/apps/frontend-dashboard/package.json +7 -7
  87. package/templates/apps/frontend-docs/package.json +7 -7
  88. package/templates/apps/frontend-i18n/package.json +6 -6
  89. package/templates/apps/frontend-landing/package.json +7 -7
  90. package/templates/apps/frontend-portal/package.json +8 -8
  91. package/templates/apps/frontend-saas/package.json +8 -8
  92. package/templates/apps/frontend-spa/package.json +7 -7
  93. package/templates/apps/frontend-ssr/package.json +7 -7
  94. package/templates/apps/frontend-ssr-api/package.json +8 -8
  95. package/templates/apps/frontend-static-blog/package.json +6 -6
  96. package/templates/apps/frontend-status/package.json +8 -8
  97. package/templates/apps/mobile-app/package.json +3 -3
  98. package/templates/patches/@effect__cluster@0.60.0.patch +51 -3
  99. package/dist/apiBuild-D0f6hYbH.js +0 -2
  100. package/dist/doctorCommand-C4L61G_L.js +0 -2
  101. package/dist/serveCommand-qumm7jdF.js +0 -2
  102. package/dist/startupRunner-DPGFchOa.js +0 -71
  103. package/dist/updateCommand-BN0tkl9-.js +0 -2
  104. package/dist/webDev-BcykISYQ2.js +0 -2
@@ -1,39 +1,40 @@
1
1
  import { t as e } from "./nodeEnvironment-cGFAj1J8.js";
2
2
  import { n as t } from "./loadEnv-D9nEOClM.js";
3
- import { r as n } from "./appPort-B_HpJ_ck.js";
4
- import { h as r, m as i } from "./fileConventions-Cof68_BL.js";
5
- import { A as a, D as o, a as s, h as c, j as l, k as u } from "./inspect-CjTYzAs_.js";
6
- import { n as d } from "./agentsMd-mhQMF1bx.js";
7
- import { c as f, p, t as m } from "./renderModeScan-D7J1B7Kw.js";
8
- import { t as h } from "./pageConvention-cEiRxdab.js";
9
- import { i as g, n as _, r as v, t as y } from "./runtimeRegistry-DMeKfTHP.js";
10
- import { n as b } from "./logFileSink-C_D2wRN1.js";
11
- import { basename as x, dirname as S, join as C, relative as w, resolve as T } from "node:path";
12
- import { existsSync as E, promises as D, readFileSync as O, readdirSync as k, statSync as A, unwatchFile as j, watchFile as M } from "node:fs";
13
- import { fileURLToPath as N, pathToFileURL as P } from "node:url";
14
- import { addSink as F, createLogger as I, printReadyBlock as L } from "@voltro/logger";
15
- import { createRequire as R } from "node:module";
16
- import { homedir as ee } from "node:os";
17
- import { currentTraceContext as z, resolveSecret as B } from "@voltro/runtime";
18
- import { FRAMEWORK_ENV_CATALOG as V, appEnvEntries as te, checkEnvNaming as H, formatEnvErrors as ne, installEnvSnapshot as U, isEnvContract as re, pluginEnvEntries as W, renderDotEnvExample as ie, resolveEnv as ae } from "@voltro/env";
19
- import { __installPublicEnv as oe } from "@voltro/env/public";
20
- import { mkdir as G, writeFile as K } from "node:fs/promises";
21
- import { createHash as se } from "node:crypto";
22
- import { spawn as ce } from "node:child_process";
23
- import { createConnection as le } from "node:net";
24
- import { PassThrough as ue } from "node:stream";
3
+ import { t as n } from "./bootRefusal-pgvDxlrU.js";
4
+ import { r } from "./appPort-B_HpJ_ck.js";
5
+ import { h as i, m as a } from "./fileConventions-Cof68_BL.js";
6
+ import { A as o, D as s, a as c, h as l, j as u, k as d } from "./inspect-CjTYzAs_.js";
7
+ import { n as f } from "./agentsMd-mhQMF1bx.js";
8
+ import { c as p, p as m, t as h } from "./renderModeScan-D7J1B7Kw.js";
9
+ import { t as g } from "./pageConvention-cEiRxdab.js";
10
+ import { i as _, n as v, r as y, t as b } from "./runtimeRegistry-DMeKfTHP.js";
11
+ import { n as x } from "./logFileSink-C_D2wRN1.js";
12
+ import { basename as S, dirname as C, join as w, relative as T, resolve as E } from "node:path";
13
+ import { existsSync as D, promises as O, readFileSync as k, readdirSync as A, statSync as j, unwatchFile as M, watchFile as N } from "node:fs";
14
+ import { fileURLToPath as P, pathToFileURL as F } from "node:url";
15
+ import { addSink as I, createLogger as L, printReadyBlock as R } from "@voltro/logger";
16
+ import { createRequire as ee } from "node:module";
17
+ import { homedir as z } from "node:os";
18
+ import { currentTraceContext as B, resolveSecret as V } from "@voltro/runtime";
19
+ import { FRAMEWORK_ENV_CATALOG as te, appEnvEntries as H, checkEnvNaming as ne, formatEnvErrors as U, installEnvSnapshot as re, isEnvContract as W, pluginEnvEntries as ie, renderDotEnvExample as ae, resolveEnv as oe } from "@voltro/env";
20
+ import { __installPublicEnv as G } from "@voltro/env/public";
21
+ import { mkdir as se, writeFile as ce } from "node:fs/promises";
22
+ import { createHash as le } from "node:crypto";
23
+ import { spawn as ue } from "node:child_process";
24
+ import { createConnection as K } from "node:net";
25
+ import { PassThrough as de } from "node:stream";
25
26
  //#region src/buildToolImport.ts
26
- var de = (e) => {
27
+ var fe = (e) => {
27
28
  let t = e;
28
29
  return t?.code === "ERR_MODULE_NOT_FOUND" || /Cannot find (package|module)/.test(String(t?.message ?? ""));
29
- }, fe = async (e, t) => {
30
+ }, pe = async (e, t) => {
30
31
  try {
31
32
  return await t();
32
33
  } catch (t) {
33
- throw de(t) ? Error(`voltro: the build tool '${e}' is not installed.\n\nIt's an OPTIONAL dependency of @voltro/cli — needed by 'voltro dev' and 'voltro build', but excluded from a serve-only production install (that's how prod images stay lean). If you are building, reinstall WITHOUT '--no-optional' (e.g. 'pnpm install'). A production SERVE container does not need '${e}' — it boots from the precompiled bundle.`) : t;
34
+ throw fe(t) ? Error(`voltro: the build tool '${e}' is not installed.\n\nIt's an OPTIONAL dependency of @voltro/cli — needed by 'voltro dev' and 'voltro build', but excluded from a serve-only production install (that's how prod images stay lean). If you are building, reinstall WITHOUT '--no-optional' (e.g. 'pnpm install'). A production SERVE container does not need '${e}' — it boots from the precompiled bundle.`) : t;
34
35
  }
35
- }, pe = "// AUTO-GENERATED by Voltro — DO NOT EDIT.\n// Source: app.config.ts `env` (defineEnv). Regenerated on every `voltro dev` boot.\n", me = (e, t) => t ? `${e} | undefined` : e, q = (e, t) => Object.entries(e.vars).filter(([, e]) => t(e.access)).map(([e, t]) => `${t.description ? ` /** ${t.description} */\n` : ""} readonly ${e}: ${me(t.tsType, t.optional)}`).join("\n"), he = async (e, t) => {
36
- let n = q(t, () => !0), r = `${pe}
36
+ }, me = "// AUTO-GENERATED by Voltro — DO NOT EDIT.\n// Source: app.config.ts `env` (defineEnv). Regenerated on every `voltro dev` boot.\n", q = (e, t) => t ? `${e} | undefined` : e, he = (e, t) => Object.entries(e.vars).filter(([, e]) => t(e.access)).map(([e, t]) => `${t.description ? ` /** ${t.description} */\n` : ""} readonly ${e}: ${q(t.tsType, t.optional)}`).join("\n"), ge = async (e, t) => {
37
+ let n = he(t, () => !0), r = `${me}
37
38
  import '@voltro/env/server'
38
39
 
39
40
  declare module '@voltro/env/server' {
@@ -42,9 +43,9 @@ ${n.length > 0 ? n : " // (no variables declared)"}
42
43
  }
43
44
  }
44
45
  `;
45
- await K(C(e, "env.generated.d.ts"), r, "utf8");
46
- }, ge = async (e, t) => {
47
- let n = q(t, (e) => e === "public"), r = `${pe}
46
+ await ce(w(e, "env.generated.d.ts"), r, "utf8");
47
+ }, J = async (e, t) => {
48
+ let n = he(t, (e) => e === "public"), r = `${me}
48
49
  import '@voltro/env/public'
49
50
 
50
51
  declare module '@voltro/env/public' {
@@ -52,10 +53,10 @@ declare module '@voltro/env/public' {
52
53
  ${n.length > 0 ? n : " // (no public variables declared)"}
53
54
  }
54
55
  }
55
- `, i = C(e, "src");
56
- await G(i, { recursive: !0 }), await K(C(i, "voltro-env.d.ts"), r, "utf8");
57
- }, J = async (e, t) => {
58
- let n = `${pe}
56
+ `, i = w(e, "src");
57
+ await se(i, { recursive: !0 }), await ce(w(i, "voltro-env.d.ts"), r, "utf8");
58
+ }, _e = async (e, t) => {
59
+ let n = `${me}
59
60
  import { __installPublicEnv } from '@voltro/env/public'
60
61
 
61
62
  export const publicEnvValues = ${JSON.stringify(t, null, 2)} as const
@@ -63,14 +64,14 @@ export const publicEnvValues = ${JSON.stringify(t, null, 2)} as const
63
64
  // Set the browser/SSR-shared global the \`publicEnv\` accessor reads.
64
65
  __installPublicEnv(publicEnvValues)
65
66
  `;
66
- await G(e, { recursive: !0 }), await K(C(e, "env.public.ts"), n, "utf8");
67
- }, _e = async (e) => {
68
- let t = re(e.rawEnv) ? e.rawEnv : void 0, n = await ae({
67
+ await se(e, { recursive: !0 }), await ce(w(e, "env.public.ts"), n, "utf8");
68
+ }, ve = async (e) => {
69
+ let t = W(e.rawEnv) ? e.rawEnv : void 0, n = await oe({
69
70
  contract: t,
70
- resolveSecret: B
71
- }), r = [...n.errors, ...H(t, e.appType)];
72
- if (r.length > 0) throw Error(ne(r));
73
- U(n.values), e.appType === "web" && oe(n.publicValues);
71
+ resolveSecret: V
72
+ }), r = [...n.errors, ...ne(t, e.appType)];
73
+ if (r.length > 0) throw Error(U(r));
74
+ re(n.values), e.appType === "web" && G(n.publicValues);
74
75
  let i = t ? Object.keys(t.vars).length : 0;
75
76
  if (i > 0) {
76
77
  let r = Object.keys(n.publicValues).length;
@@ -82,20 +83,20 @@ __installPublicEnv(publicEnvValues)
82
83
  n.length > 0 && e.log.warn(`env: ${n.length} secret var(s) declared on a web app — secrets are reachable only from server-side render code and are NEVER bundled. Prefer declaring secrets on the api.`, { keys: n });
83
84
  }
84
85
  }
85
- return e.generateTypes && t && (e.appType === "api" ? await he(e.root, t) : await ge(e.root, t)), {
86
+ return e.generateTypes && t && (e.appType === "api" ? await ge(e.root, t) : await J(e.root, t)), {
86
87
  resolved: n,
87
88
  contract: t
88
89
  };
89
- }, ve = (e) => {
90
- let t = te(e.contract), n = (e.plugins ?? []).flatMap((e) => W(e.name, e.declaredEnv)), r = e.includeFramework === !1 ? [] : V, i = /* @__PURE__ */ new Set(), a = [];
90
+ }, ye = (e) => {
91
+ let t = H(e.contract), n = (e.plugins ?? []).flatMap((e) => ie(e.name, e.declaredEnv)), r = e.includeFramework === !1 ? [] : te, i = /* @__PURE__ */ new Set(), a = [];
91
92
  for (let e of [
92
93
  ...t,
93
94
  ...n,
94
95
  ...r
95
96
  ]) i.has(e.key) || (i.add(e.key), a.push(e));
96
97
  return a;
97
- }, ye = (e, t, n = (e) => process.env[e]) => {
98
- let r = ve(t).map((e) => {
98
+ }, be = (e, t, n = (e) => process.env[e]) => {
99
+ let r = ye(t).map((e) => {
99
100
  let t = n(e.key) !== void 0;
100
101
  return {
101
102
  ...e,
@@ -112,30 +113,30 @@ __installPublicEnv(publicEnvValues)
112
113
  missingRequired: r.filter((e) => e.required && !e.isSet && e.default === void 0).length
113
114
  }
114
115
  };
115
- }, be = (e, t) => ie(ve({
116
+ }, xe = (e, t) => ae(ye({
116
117
  ...e,
117
118
  includeFramework: !1
118
119
  }), {
119
120
  includeFramework: e.includeFramework !== !1,
120
121
  ...t ? { header: t } : {}
121
- }), xe = async (e, t) => {
122
+ }), Se = async (e, t) => {
122
123
  let n = e;
123
124
  for (;;) {
124
- let e = C(n, "node_modules", t);
125
+ let e = w(n, "node_modules", t);
125
126
  try {
126
- if ((await D.stat(e)).isDirectory()) {
127
- let t = await D.realpath(e);
127
+ if ((await O.stat(e)).isDirectory()) {
128
+ let t = await O.realpath(e);
128
129
  return t.includes("/node_modules/") ? null : t;
129
130
  }
130
131
  } catch {}
131
- let r = S(n);
132
+ let r = C(n);
132
133
  if (r === n) return null;
133
134
  n = r;
134
135
  }
135
- }, Se = async (e) => {
136
+ }, Ce = async (e) => {
136
137
  let t;
137
138
  try {
138
- let n = await D.readFile(C(e, "package.json"), "utf8"), r = JSON.parse(n);
139
+ let n = await O.readFile(w(e, "package.json"), "utf8"), r = JSON.parse(n);
139
140
  t = Object.keys({
140
141
  ...r.dependencies,
141
142
  ...r.devDependencies
@@ -144,11 +145,11 @@ __installPublicEnv(publicEnvValues)
144
145
  return [];
145
146
  }
146
147
  return (await Promise.all(t.map(async (t) => {
147
- let n = await xe(e, t);
148
+ let n = await Se(e, t);
148
149
  if (n === null) return null;
149
- let r = C(n, "src");
150
+ let r = w(n, "src");
150
151
  try {
151
- if (!(await D.stat(r)).isDirectory()) return null;
152
+ if (!(await O.stat(r)).isDirectory()) return null;
152
153
  } catch {
153
154
  return null;
154
155
  }
@@ -157,11 +158,11 @@ __installPublicEnv(publicEnvValues)
157
158
  dir: r
158
159
  };
159
160
  }))).filter((e) => e !== null);
160
- }, Ce = 500, we = (e, t, n = {}) => {
161
+ }, we = 500, Te = (e, t, n = {}) => {
161
162
  if (e.length === 0) return () => {};
162
- let r = (e) => n.root ? w(n.root, e) : e, i = !1, a = (e) => {
163
+ let r = (e) => n.root ? T(n.root, e) : e, i = !1, a = (e) => {
163
164
  i || (i = !0, t.warn(`.env changed (${r(e)}) — hard-restarting: process.env is read once at boot, a reload would keep stale values`, { file: r(e) }), Promise.resolve().then(() => n.onBeforeRestart?.()).catch((e) => t.warn(".env restart: onBeforeRestart failed (continuing)", {}, e)).finally(() => {
164
- let e = ce(process.execPath, [...process.execArgv, ...process.argv.slice(1)], {
165
+ let e = ue(process.execPath, [...process.execArgv, ...process.argv.slice(1)], {
165
166
  stdio: "inherit",
166
167
  env: process.env,
167
168
  cwd: n.cwd ?? process.cwd()
@@ -175,25 +176,22 @@ __installPublicEnv(publicEnvValues)
175
176
  });
176
177
  }));
177
178
  };
178
- for (let t of e) M(t, { interval: Ce }, (e, n) => {
179
+ for (let t of e) N(t, { interval: we }, (e, n) => {
179
180
  e.mtimeMs !== n.mtimeMs && a(t);
180
181
  });
181
182
  return t.info("watching .env files for changes", {
182
183
  files: e.map(r),
183
- intervalMs: Ce
184
+ intervalMs: we
184
185
  }), () => {
185
- for (let t of e) j(t);
186
+ for (let t of e) M(t);
186
187
  };
187
- }, Te = "VoltroBootRefusal", Ee = (e) => {
188
- let t = Error(e);
189
- return t.name = Te, t;
190
- }, De = [{
188
+ }, Ee = [{
191
189
  host: "127.0.0.1",
192
190
  family: "IPv4"
193
191
  }, {
194
192
  host: "::1",
195
193
  family: "IPv6"
196
- }], Oe = (e, t, n) => new Promise((r) => {
194
+ }], De = (e, t, n) => new Promise((r) => {
197
195
  let i = !1, a = (e) => {
198
196
  if (!i) {
199
197
  i = !0;
@@ -202,15 +200,15 @@ __installPublicEnv(publicEnvValues)
202
200
  } catch {}
203
201
  r(e);
204
202
  }
205
- }, o = le({
203
+ }, o = K({
206
204
  host: e,
207
205
  port: t
208
206
  });
209
207
  o.once("connect", () => a(!0)), o.once("error", () => a(!1)), o.setTimeout(n, () => a(!1));
210
- }), ke = async (e, t = 400) => ({ families: (await Promise.all(De.map(async (n) => ({
208
+ }), Oe = async (e, t = 400) => ({ families: (await Promise.all(Ee.map(async (n) => ({
211
209
  family: n.family,
212
- taken: await Oe(n.host, e, t)
213
- })))).filter((e) => e.taken).map((e) => e.family) }), Ae = (e, t, n) => [
210
+ taken: await De(n.host, e, t)
211
+ })))).filter((e) => e.taken).map((e) => e.family) }), ke = (e, t, n) => [
214
212
  `${t}: port ${e} is already being served (${n.join(" + ")}).`,
215
213
  "",
216
214
  " Refusing to start. This is NOT a spurious check — a second listener can",
@@ -225,26 +223,26 @@ __installPublicEnv(publicEnvValues)
225
223
  "",
226
224
  " Then re-run. To use a different port instead, change `port` in",
227
225
  " app.config.ts."
228
- ].join("\n"), je = async (e, t) => {
229
- let { families: n } = await ke(e);
230
- if (n.length !== 0) throw Ee(Ae(e, t, n));
231
- }, Me = (e) => e === "effect" || e.startsWith("@effect/") || e.startsWith("@voltro/") || e === "react" || e === "react-dom", Ne = /(^|\/)(\.bin|\.cache|\.pnpm-store|dist|build)(\/|$)/, Pe = (e) => {
226
+ ].join("\n"), Ae = async (e, t) => {
227
+ let { families: r } = await Oe(e);
228
+ if (r.length !== 0) throw n(ke(e, t, r));
229
+ }, je = (e) => e === "effect" || e.startsWith("@effect/") || e.startsWith("@voltro/") || e === "react" || e === "react-dom", Me = /(^|\/)(\.bin|\.cache|\.pnpm-store|dist|build)(\/|$)/, Ne = (e) => {
232
230
  let t = [], n = e;
233
231
  for (let e = 0; e < 12; e++) {
234
- let e = C(n, "node_modules");
235
- E(e) && t.push(e);
236
- let r = S(n);
232
+ let e = w(n, "node_modules");
233
+ D(e) && t.push(e);
234
+ let r = C(n);
237
235
  if (r === n) break;
238
236
  n = r;
239
237
  }
240
238
  return t;
241
- }, Fe = (e) => {
239
+ }, Pe = (e) => {
242
240
  let t = /* @__PURE__ */ new Set([e]), n = e;
243
241
  for (let e = 0; e < 12; e++) {
244
242
  for (let e of ["pnpm-workspace.yaml", "pnpm-workspace.yml"]) {
245
243
  let r;
246
244
  try {
247
- r = O(C(n, e), "utf8");
245
+ r = k(w(n, e), "utf8");
248
246
  } catch {
249
247
  continue;
250
248
  }
@@ -255,38 +253,38 @@ __installPublicEnv(publicEnvValues)
255
253
  if (i === "" || i.includes("*")) continue;
256
254
  let a;
257
255
  try {
258
- a = k(C(n, i), { withFileTypes: !0 });
256
+ a = A(w(n, i), { withFileTypes: !0 });
259
257
  } catch {
260
258
  continue;
261
259
  }
262
- for (let e of a) e.isDirectory() && t.add(C(n, i, e.name));
260
+ for (let e of a) e.isDirectory() && t.add(w(n, i, e.name));
263
261
  }
264
262
  }
265
263
  for (let e of ["packages", "apps"]) {
266
264
  let r;
267
265
  try {
268
- r = k(C(n, e), { withFileTypes: !0 });
266
+ r = A(w(n, e), { withFileTypes: !0 });
269
267
  } catch {
270
268
  continue;
271
269
  }
272
- for (let i of r) i.isDirectory() && t.add(C(n, e, i.name));
270
+ for (let i of r) i.isDirectory() && t.add(w(n, e, i.name));
273
271
  }
274
- let e = S(n);
272
+ let e = C(n);
275
273
  if (e === n) break;
276
274
  n = e;
277
275
  }
278
276
  return [...t];
279
- }, Y = (e) => {
277
+ }, Fe = (e) => {
280
278
  let t = [];
281
- for (let n of Fe(e)) {
282
- let e = C(n, "node_modules", "@voltro"), r;
279
+ for (let n of Pe(e)) {
280
+ let e = w(n, "node_modules", "@voltro"), r;
283
281
  try {
284
- r = k(e);
282
+ r = A(e);
285
283
  } catch {
286
284
  continue;
287
285
  }
288
286
  for (let n of r) {
289
- let r = C(e, n), i = Ie(r);
287
+ let r = w(e, n), i = Y(r);
290
288
  i !== void 0 && t.push({
291
289
  pkg: `@voltro/${n}`,
292
290
  version: i,
@@ -295,38 +293,38 @@ __installPublicEnv(publicEnvValues)
295
293
  }
296
294
  }
297
295
  return t;
298
- }, Ie = (e) => {
296
+ }, Y = (e) => {
299
297
  try {
300
- let t = JSON.parse(O(C(e, "package.json"), "utf8"));
298
+ let t = JSON.parse(k(w(e, "package.json"), "utf8"));
301
299
  return typeof t.version == "string" ? t.version : void 0;
302
300
  } catch {
303
301
  return;
304
302
  }
305
- }, Le = (e) => {
303
+ }, Ie = (e) => {
306
304
  let t = [], n;
307
305
  try {
308
- n = k(e);
306
+ n = A(e);
309
307
  } catch {
310
308
  return t;
311
309
  }
312
310
  for (let r of n) {
313
- if (r.startsWith(".") || Ne.test(r)) continue;
314
- let n = C(e, r);
311
+ if (r.startsWith(".") || Me.test(r)) continue;
312
+ let n = w(e, r);
315
313
  if (r.startsWith("@")) {
316
314
  let e;
317
315
  try {
318
- e = k(n);
316
+ e = A(n);
319
317
  } catch {
320
318
  continue;
321
319
  }
322
320
  for (let i of e) t.push({
323
321
  pkg: `${r}/${i}`,
324
- dir: C(n, i)
322
+ dir: w(n, i)
325
323
  });
326
324
  continue;
327
325
  }
328
326
  try {
329
- if (!A(n).isDirectory()) continue;
327
+ if (!j(n).isDirectory()) continue;
330
328
  } catch {
331
329
  continue;
332
330
  }
@@ -336,25 +334,25 @@ __installPublicEnv(publicEnvValues)
336
334
  });
337
335
  }
338
336
  return t;
339
- }, Re = (e) => {
337
+ }, Le = (e) => {
340
338
  let t = /* @__PURE__ */ new Map(), n = (e, n, r) => {
341
- if (!Me(e)) return;
339
+ if (!je(e)) return;
342
340
  let i = t.get(e) ?? /* @__PURE__ */ new Map();
343
341
  i.has(n) || i.set(n, r), t.set(e, i);
344
342
  };
345
- for (let t of Pe(e)) for (let { pkg: e, dir: r } of Le(t)) {
346
- let t = Ie(r);
343
+ for (let t of Ne(e)) for (let { pkg: e, dir: r } of Ie(t)) {
344
+ let t = Y(r);
347
345
  t !== void 0 && n(e, t, r);
348
346
  }
349
- for (let { pkg: t, version: r, dir: i } of Y(e)) n(t, r, i);
347
+ for (let { pkg: t, version: r, dir: i } of Fe(e)) n(t, r, i);
350
348
  let r = [];
351
349
  for (let [n, i] of t) i.size < 2 || r.push({
352
350
  pkg: n,
353
351
  versions: [...i.keys()].sort(),
354
- paths: [...i.values()].map((t) => w(e, t)).sort()
352
+ paths: [...i.values()].map((t) => T(e, t)).sort()
355
353
  });
356
354
  return r.sort((e, t) => e.pkg.localeCompare(t.pkg));
357
- }, ze = (e) => {
355
+ }, Re = (e) => {
358
356
  if (e.length !== 0) return [
359
357
  `• ${e.length} package(s) resolved at more than one version:`,
360
358
  ...e.flatMap((e) => [` ${e.pkg} — ${e.versions.join(", ")}`, ...e.paths.map((e) => ` ${e}`)]),
@@ -372,11 +370,11 @@ __installPublicEnv(publicEnvValues)
372
370
  " instrument), then reinstall. Do not silence the generated file — it is where",
373
371
  " a genuine mistake in your own descriptors surfaces."
374
372
  ].join("\n");
375
- }, Be = (e) => {
373
+ }, ze = (e) => {
376
374
  let t = /* @__PURE__ */ new Map();
377
- for (let n of Pe(e)) for (let { pkg: e, dir: r } of Le(n)) {
375
+ for (let n of Ne(e)) for (let { pkg: e, dir: r } of Ie(n)) {
378
376
  if (!e.startsWith("@voltro/")) continue;
379
- let n = Ie(r);
377
+ let n = Y(r);
380
378
  n !== void 0 && !t.has(e) && t.set(e, n);
381
379
  }
382
380
  if (t.size < 2) return;
@@ -391,7 +389,7 @@ __installPublicEnv(publicEnvValues)
391
389
  version: t
392
390
  })).sort((e, t) => e.pkg.localeCompare(t.pkg))
393
391
  };
394
- }, Ve = (e) => {
392
+ }, Be = (e) => {
395
393
  if (e !== void 0) return [
396
394
  `• ${e.behind.length} @voltro/* package(s) are not on ${e.majority}:`,
397
395
  ...e.behind.map((e) => ` ${e.pkg} ${e.version}`),
@@ -409,59 +407,59 @@ __installPublicEnv(publicEnvValues)
409
407
  " its pattern: the one that produced this report was `@voltro/[a-z-]+`,",
410
408
  " which silently skips `@voltro/i18n` because the name contains digits."
411
409
  ].join("\n");
412
- }, He = (e, t) => {
413
- let n = Be(e);
410
+ }, Ve = (e, t) => {
411
+ let n = ze(e);
414
412
  n !== void 0 && t.warn?.(`@voltro/* version skew: ${n.behind.length} package(s) are not on ${n.majority}`, {
415
413
  majority: n.majority,
416
414
  behind: n.behind.map((e) => `${e.pkg}@${e.version}`),
417
415
  fix: "the framework ships in lockstep; bump the listed packages and reinstall"
418
416
  });
419
- }, Ue = I({ scope: "vite" }), We = /\x1b\[[0-9;]*m/g, Ge = /^\s*\[?vite\]?\s*(\([a-z-]+\)\s*)?/, Ke = (e) => e.replace(We, "").replace(Ge, "").trim(), qe = /proxy error/i, Je = [
417
+ }, He = L({ scope: "vite" }), Ue = /\x1b\[[0-9;]*m/g, We = /^\s*\[?vite\]?\s*(\([a-z-]+\)\s*)?/, Ge = (e) => e.replace(Ue, "").replace(We, "").trim(), Ke = /proxy error/i, qe = [
420
418
  "ECONNREFUSED",
421
419
  "ECONNRESET",
422
420
  "ECONNABORTED",
423
421
  "EPIPE",
424
422
  "ETIMEDOUT"
425
- ], Ye = (e, t = 0) => {
423
+ ], Je = (e, t = 0) => {
426
424
  if (e == null || t > 5) return !1;
427
425
  let n = e;
428
- return typeof n.code == "string" && Je.includes(n.code) || typeof n.message == "string" && Je.some((e) => n.message.includes(e)) || Array.isArray(n.errors) && n.errors.some((e) => Ye(e, t + 1)) ? !0 : Ye(n.cause, t + 1);
429
- }, Xe = 4e3, Ze = () => {
426
+ return typeof n.code == "string" && qe.includes(n.code) || typeof n.message == "string" && qe.some((e) => n.message.includes(e)) || Array.isArray(n.errors) && n.errors.some((e) => Je(e, t + 1)) ? !0 : Je(n.cause, t + 1);
427
+ }, Ye = 4e3, Xe = () => {
430
428
  let e = /* @__PURE__ */ new Set(), t = 0, n = {
431
429
  hasWarned: !1,
432
430
  info: (e) => {
433
- let t = Ke(e);
434
- t.length !== 0 && Ue.info(t);
431
+ let t = Ge(e);
432
+ t.length !== 0 && He.info(t);
435
433
  },
436
434
  warn: (e) => {
437
435
  n.hasWarned = !0;
438
- let t = Ke(e);
439
- t.length !== 0 && Ue.warn(t);
436
+ let t = Ge(e);
437
+ t.length !== 0 && He.warn(t);
440
438
  },
441
439
  warnOnce: (t) => {
442
- let r = Ke(t);
443
- e.has(r) || (e.add(r), n.hasWarned = !0, r.length !== 0 && Ue.warn(r));
440
+ let r = Ge(t);
441
+ e.has(r) || (e.add(r), n.hasWarned = !0, r.length !== 0 && He.warn(r));
444
442
  },
445
443
  error: (e, n) => {
446
- let r = Ke(e), i = n?.error;
444
+ let r = Ge(e), i = n?.error;
447
445
  if (r.length !== 0) {
448
- if (qe.test(r) && Ye(i)) {
446
+ if (Ke.test(r) && Je(i)) {
449
447
  let e = Date.now();
450
- e - t > Xe && (t = e, Ue.info("waiting for api — proxy upstream not accepting connections yet (still starting?)"));
448
+ e - t > Ye && (t = e, He.info("waiting for api — proxy upstream not accepting connections yet (still starting?)"));
451
449
  return;
452
450
  }
453
- Ue.error(r, {}, i);
451
+ He.error(r, {}, i);
454
452
  }
455
453
  },
456
454
  clearScreen: () => {},
457
455
  hasErrorLogged: (e) => !1
458
456
  };
459
457
  return n;
460
- }, Qe = (e) => e.replace(/\\"|"(?:[^"\\]|\\.)*"|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)/g, (e, t) => t ? "" : e), $e = (e) => {
458
+ }, Ze = (e) => e.replace(/\\"|"(?:[^"\\]|\\.)*"|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)/g, (e, t) => t ? "" : e), Qe = (e) => {
461
459
  try {
462
- let t = C(e, "tsconfig.json");
463
- if (!E(t)) return [];
464
- let n = JSON.parse(Qe(O(t, "utf8"))).compilerOptions ?? {}, r = n.paths ?? {}, i = T(e, n.baseUrl ?? "."), a = [];
460
+ let t = w(e, "tsconfig.json");
461
+ if (!D(t)) return [];
462
+ let n = JSON.parse(Ze(k(t, "utf8"))).compilerOptions ?? {}, r = n.paths ?? {}, i = E(e, n.baseUrl ?? "."), a = [];
465
463
  for (let [e, t] of Object.entries(r)) {
466
464
  let n = t[0];
467
465
  if (!n) continue;
@@ -470,23 +468,23 @@ __installPublicEnv(publicEnvValues)
470
468
  let t = e.slice(0, -2).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
471
469
  a.push({
472
470
  find: RegExp(`^${t}/(.*)$`),
473
- replacement: `${C(i, n.slice(0, -2))}/$1`
471
+ replacement: `${w(i, n.slice(0, -2))}/$1`
474
472
  });
475
473
  } else a.push({
476
474
  find: e,
477
- replacement: C(i, n)
475
+ replacement: w(i, n)
478
476
  });
479
477
  }
480
478
  return a;
481
479
  } catch {
482
480
  return [];
483
481
  }
484
- }, et = (e = process.env) => {
482
+ }, $e = (e = process.env) => {
485
483
  let t = e.VOLTRO_DEV_SSR_COMPILE_CONCURRENCY;
486
484
  if (t === void 0 || t.trim() === "") return 4;
487
485
  let n = Number(t);
488
486
  return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 4;
489
- }, tt = (e) => {
487
+ }, et = (e) => {
490
488
  let t = Math.max(1, Math.floor(e)), n = 0, r = [], i = () => n < t ? (n++, Promise.resolve()) : new Promise((e) => r.push(e)), a = () => {
491
489
  let e = r.shift();
492
490
  e ? e() : n--;
@@ -504,8 +502,8 @@ __installPublicEnv(publicEnvValues)
504
502
  return n;
505
503
  }
506
504
  };
507
- }, nt = (e) => {
508
- let t = tt(e.limit), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
505
+ }, tt = (e) => {
506
+ let t = et(e.limit), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
509
507
  return {
510
508
  load: (i, a) => {
511
509
  if (r.has(i)) return a();
@@ -535,7 +533,7 @@ __installPublicEnv(publicEnvValues)
535
533
  return r.size;
536
534
  }
537
535
  };
538
- }, rt = (e) => {
536
+ }, nt = (e) => {
539
537
  let t = [];
540
538
  for (let n of e.split("/").filter(Boolean)) n.startsWith("[[...") && n.endsWith("]]") ? t.push({
541
539
  name: n.slice(5, -2),
@@ -551,12 +549,12 @@ __installPublicEnv(publicEnvValues)
551
549
  optional: !1
552
550
  });
553
551
  return t;
554
- }, it = (e) => e.replace(/-([a-z0-9])/g, (e, t) => t.toUpperCase()), at = async (e) => {
555
- let t = T(e);
552
+ }, rt = (e) => e.replace(/-([a-z0-9])/g, (e, t) => t.toUpperCase()), it = async (e) => {
553
+ let t = E(e);
556
554
  for (let e = 0; e < 4; e++) {
557
- let e = C(t, "project.json");
558
- if (E(e)) try {
559
- let n = await D.readFile(e, "utf8");
555
+ let e = w(t, "project.json");
556
+ if (D(e)) try {
557
+ let n = await O.readFile(e, "utf8");
560
558
  return {
561
559
  projectDir: t,
562
560
  manifest: JSON.parse(n)
@@ -564,38 +562,38 @@ __installPublicEnv(publicEnvValues)
564
562
  } catch {
565
563
  return null;
566
564
  }
567
- let n = S(t);
565
+ let n = C(t);
568
566
  if (n === t) break;
569
567
  t = n;
570
568
  }
571
569
  return null;
572
- }, ot = async (e) => {
573
- let t = await at(e);
570
+ }, at = async (e) => {
571
+ let t = await it(e);
574
572
  if (!t) return [];
575
- let { projectDir: n, manifest: r } = t, i = x(e), a = r.apps ?? {}, o = [];
573
+ let { projectDir: n, manifest: r } = t, i = S(e), a = r.apps ?? {}, o = [];
576
574
  for (let [e, t] of Object.entries(a)) {
577
575
  if (e === i || t.kind !== "web" || typeof t.port != "number") continue;
578
- let r = C(C(n, t.path ?? e), "src", "pages");
579
- if (!E(r)) continue;
576
+ let r = w(w(n, t.path ?? e), "src", "pages");
577
+ if (!D(r)) continue;
580
578
  let a;
581
579
  try {
582
580
  let { pages: e } = await $(r);
583
581
  a = e.map((e) => ({
584
582
  pattern: e.pattern,
585
- params: rt(e.pattern)
583
+ params: nt(e.pattern)
586
584
  }));
587
585
  } catch {
588
586
  continue;
589
587
  }
590
588
  o.push({
591
- key: it(e),
589
+ key: rt(e),
592
590
  origin: `http://localhost:${t.port}`,
593
591
  ...typeof t.origin == "string" && t.origin.length > 0 ? { prodOrigin: t.origin } : {},
594
592
  routes: a
595
593
  });
596
594
  }
597
595
  return o;
598
- }, st = (e) => {
596
+ }, ot = (e) => {
599
597
  if (e.params.length === 0) return `'${e.pattern}'`;
600
598
  let t = e.pattern;
601
599
  for (let n of e.params) {
@@ -603,21 +601,21 @@ __installPublicEnv(publicEnvValues)
603
601
  t = t.replace(e, r);
604
602
  }
605
603
  return "`" + t + "`";
606
- }, ct = (e) => e.params.length === 0 ? "EmptyParams" : `{ ${e.params.map((e) => {
604
+ }, st = (e) => e.params.length === 0 ? "EmptyParams" : `{ ${e.params.map((e) => {
607
605
  let t = "string";
608
606
  return e.optional ? `readonly ${e.name}?: ${t}` : `readonly ${e.name}: ${t}`;
609
- }).join("; ")} }`, lt = (e, t, n) => {
610
- let r = ct(e), i = st(e), a = t ? "VoltroExternalUrl" : "VoltroRouteUrl", o = t && n ? `${n} + ` : "";
607
+ }).join("; ")} }`, ct = (e, t, n) => {
608
+ let r = st(e), i = ot(e), a = t ? "VoltroExternalUrl" : "VoltroRouteUrl", o = t && n ? `${n} + ` : "";
611
609
  return e.params.length === 0 ? `() => (${o}${i}) as ${a}` : `({ ${e.params.map((e) => e.name).join(", ")} }: ${r}) => (${o}${i}) as ${a}`;
612
- }, ut = (e) => `{\n${[...e].sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => ` ${JSON.stringify(e.pattern)}: ${lt(e, !1)},`).join("\n")}\n}`, dt = (e, t) => {
610
+ }, lt = (e) => `{\n${[...e].sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => ` ${JSON.stringify(e.pattern)}: ${ct(e, !1)},`).join("\n")}\n}`, ut = (e, t) => {
613
611
  if (e.routes.length === 0) return ` ${e.key}: {} as Record<string, never>,`;
614
- let n = [...e.routes].sort((e, t) => e.pattern.localeCompare(t.pattern)), r = t === "prod" && e.prodOrigin ? e.prodOrigin : e.origin, i = JSON.stringify(r), a = n.map((e) => ` ${JSON.stringify(e.pattern)}: ${lt(e, !0, i)},`);
612
+ let n = [...e.routes].sort((e, t) => e.pattern.localeCompare(t.pattern)), r = t === "prod" && e.prodOrigin ? e.prodOrigin : e.origin, i = JSON.stringify(r), a = n.map((e) => ` ${JSON.stringify(e.pattern)}: ${ct(e, !0, i)},`);
615
613
  return ` ${e.key}: {\n${a.join("\n")}\n },`;
616
- }, ft = async (e) => {
614
+ }, dt = async (e) => {
617
615
  let t = e.pages.map((e) => ({
618
616
  pattern: e.pattern,
619
- params: rt(e.pattern)
620
- })), n = await ot(e.appRoot), r = [
617
+ params: nt(e.pattern)
618
+ })), n = await at(e.appRoot), r = [
621
619
  "// THIS FILE IS GENERATED — DO NOT EDIT BY HAND.",
622
620
  "// Re-emitted by `voltro dev` whenever `src/pages/**` changes.",
623
621
  "// Type-safe route builders consumed by <Link to={...}>.",
@@ -626,50 +624,50 @@ __installPublicEnv(publicEnvValues)
626
624
  "",
627
625
  "type EmptyParams = Record<string, never>",
628
626
  ""
629
- ].join("\n"), i = e.mode ?? "dev", a = `${r}\n${`export const routes = ${ut(t)} as const\n`}\n${n.length === 0 ? "export const siblingApps = {} as Record<string, never>\n" : `export const siblingApps = {\n${n.map((e) => dt(e, i)).join("\n")}\n} as const\n`}`, o = C(e.appRoot, ".framework", "routes.generated.ts");
630
- await D.mkdir(S(o), { recursive: !0 });
627
+ ].join("\n"), i = e.mode ?? "dev", a = `${r}\n${`export const routes = ${lt(t)} as const\n`}\n${n.length === 0 ? "export const siblingApps = {} as Record<string, never>\n" : `export const siblingApps = {\n${n.map((e) => ut(e, i)).join("\n")}\n} as const\n`}`, o = w(e.appRoot, ".framework", "routes.generated.ts");
628
+ await O.mkdir(C(o), { recursive: !0 });
631
629
  let s = null;
632
630
  try {
633
- s = await D.readFile(o, "utf8");
631
+ s = await O.readFile(o, "utf8");
634
632
  } catch {}
635
633
  return s === a ? {
636
634
  path: o,
637
635
  wrote: !1
638
- } : (await D.writeFile(o, a, "utf8"), {
636
+ } : (await O.writeFile(o, a, "utf8"), {
639
637
  path: o,
640
638
  wrote: !0
641
639
  });
642
- }, pt = (e) => {
640
+ }, ft = (e) => {
643
641
  if (e === "" || e === "/") return "/";
644
642
  let t = e.startsWith("/") ? e : `/${e}`;
645
643
  return t.endsWith("/") ? t.slice(0, -1) : t;
646
- }, mt = (e, t) => {
647
- let n = e.endsWith("/") ? e.slice(0, -1) : e, r = pt(t);
644
+ }, pt = (e, t) => {
645
+ let n = e.endsWith("/") ? e.slice(0, -1) : e, r = ft(t);
648
646
  return r === "/" ? `${n}/` : `${n}${r}`;
649
- }, ht = (e, t, n) => {
650
- let r = pt(e);
647
+ }, mt = (e, t, n) => {
648
+ let r = ft(e);
651
649
  return t === n ? r : r === "/" ? `/${t}` : `/${t}${r}`;
652
- }, gt = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;"), _t = (e) => {
650
+ }, ht = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;"), gt = (e) => {
653
651
  let { siteUrl: t, entries: n } = e, r = e.locales && e.locales.length > 1 ? e.locales : void 0, i = e.defaultLocale ?? r?.[0] ?? "en", a = r !== void 0, o = /* @__PURE__ */ new Map(), s = (e) => {
654
652
  if (!r) return "";
655
- let n = r.map((n) => ` <xhtml:link rel="alternate" hreflang="${gt(n)}" href="${gt(mt(t, ht(e, n, i)))}" />`);
656
- return n.push(` <xhtml:link rel="alternate" hreflang="x-default" href="${gt(mt(t, ht(e, i, i)))}" />`), `\n${n.join("\n")}`;
653
+ let n = r.map((n) => ` <xhtml:link rel="alternate" hreflang="${ht(n)}" href="${ht(pt(t, mt(e, n, i)))}" />`);
654
+ return n.push(` <xhtml:link rel="alternate" hreflang="x-default" href="${ht(pt(t, mt(e, i, i)))}" />`), `\n${n.join("\n")}`;
657
655
  };
658
656
  for (let e of n) {
659
657
  let n = r ?? [i];
660
658
  for (let r of n) {
661
- let n = mt(t, ht(e.path, r, i)), a = e.lastmod ? `\n <lastmod>${gt(e.lastmod)}</lastmod>` : "";
662
- o.set(n, ` <url>\n <loc>${gt(n)}</loc>${a}${s(e.path)}\n </url>`);
659
+ let n = pt(t, mt(e.path, r, i)), a = e.lastmod ? `\n <lastmod>${ht(e.lastmod)}</lastmod>` : "";
660
+ o.set(n, ` <url>\n <loc>${ht(n)}</loc>${a}${s(e.path)}\n </url>`);
663
661
  }
664
662
  }
665
663
  let c = [...o.keys()].sort().map((e) => o.get(e)).join("\n");
666
664
  return `<?xml version="1.0" encoding="UTF-8"?>\n<urlset${a ? " xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"" : " xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\""}>\n${c}\n</urlset>\n`;
667
- }, vt = (e) => {
665
+ }, _t = (e) => {
668
666
  if (!e.indexable) return "User-agent: *\nDisallow: /\n";
669
667
  let t = ["User-agent: *", "Allow: /"];
670
- for (let n of e.disallow ?? []) t.push(`Disallow: ${pt(n)}`);
668
+ for (let n of e.disallow ?? []) t.push(`Disallow: ${ft(n)}`);
671
669
  return e.sitemapUrl && t.push("", `Sitemap: ${e.sitemapUrl}`), `${t.join("\n")}\n`;
672
- }, yt = 256, bt = (e = yt) => {
670
+ }, vt = 256, yt = (e = vt) => {
673
671
  let t = [], n = /* @__PURE__ */ new Set();
674
672
  return {
675
673
  emit(r, i) {
@@ -692,17 +690,17 @@ __installPublicEnv(publicEnvValues)
692
690
  return t.slice();
693
691
  }
694
692
  };
695
- }, xt = (e) => `event: ${e.channel}\ndata: ${JSON.stringify(e)}\n\n`, St = () => `: keep-alive ${Date.now()}\n\n`, Ct = 8e3, wt = (e, t = Ct) => {
696
- let n = Et(e);
693
+ }, bt = (e) => `event: ${e.channel}\ndata: ${JSON.stringify(e)}\n\n`, xt = () => `: keep-alive ${Date.now()}\n\n`, St = 8e3, Ct = (e, t = St) => {
694
+ let n = Tt(e);
697
695
  return n.length <= t ? n : `${n.slice(0, t)}\n… [voltro] truncated at ${t} chars (${n.length} total)`;
698
- }, Tt = 4, Et = (e, t = 0, n = /* @__PURE__ */ new Set()) => {
696
+ }, wt = 4, Tt = (e, t = 0, n = /* @__PURE__ */ new Set()) => {
699
697
  if (e instanceof Error) {
700
698
  let r = e.stack ?? `${e.name}: ${e.message}`;
701
699
  if (n.has(e)) return `${r}\n [cycle]`;
702
700
  n.add(e);
703
701
  let i = [];
704
- if (t < Tt) if (e instanceof AggregateError && Array.isArray(e.errors)) for (let [r, a] of e.errors.entries()) i.push(`\n [aggregate ${r}] ${Dt(Et(a, t + 1, n))}`);
705
- else e.cause !== void 0 && e.cause !== null && i.push(`\n [cause] ${Dt(Et(e.cause, t + 1, n))}`);
702
+ if (t < wt) if (e instanceof AggregateError && Array.isArray(e.errors)) for (let [r, a] of e.errors.entries()) i.push(`\n [aggregate ${r}] ${Et(Tt(a, t + 1, n))}`);
703
+ else e.cause !== void 0 && e.cause !== null && i.push(`\n [cause] ${Et(Tt(e.cause, t + 1, n))}`);
706
704
  return r + i.join("");
707
705
  }
708
706
  try {
@@ -710,30 +708,30 @@ __installPublicEnv(publicEnvValues)
710
708
  } catch {
711
709
  return "[unstringifiable thrown value]";
712
710
  }
713
- }, Dt = (e) => {
711
+ }, Et = (e) => {
714
712
  let t = e.split("\n");
715
713
  return t.length <= 3 ? e : `${t.slice(0, 3).join("\n")}\n …`;
716
- }, Ot = {
714
+ }, Dt = {
717
715
  trace: 0,
718
716
  debug: 1,
719
717
  info: 2,
720
718
  warn: 3,
721
719
  error: 4,
722
720
  fatal: 5
723
- }, kt = 2e3, At = 200, jt = class {
721
+ }, Ot = 2e3, kt = 200, At = class {
724
722
  capacity;
725
723
  buffer = [];
726
- constructor(e = kt) {
724
+ constructor(e = Ot) {
727
725
  this.capacity = e;
728
726
  }
729
727
  append(e) {
730
728
  this.buffer.push(e), this.buffer.length > this.capacity && this.buffer.shift();
731
729
  }
732
730
  query(e = {}) {
733
- let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? At, this.capacity), i = e.minLevel === void 0 ? Ot.trace : Ot[e.minLevel], a = e.scope?.toLowerCase(), o = e.source, s = e.filter?.toLowerCase(), c = e.traceId, l = [];
731
+ let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? kt, this.capacity), i = e.minLevel === void 0 ? Dt.trace : Dt[e.minLevel], a = e.scope?.toLowerCase(), o = e.source, s = e.filter?.toLowerCase(), c = e.traceId, l = [];
734
732
  for (let e = this.buffer.length - 1; e >= 0 && l.length < r; e--) {
735
733
  let r = this.buffer[e];
736
- r.ts < t || r.ts > n || Ot[r.level] < i || o !== void 0 && r.source !== o || a !== void 0 && (r.scope === void 0 || !r.scope.toLowerCase().includes(a)) || s !== void 0 && !r.message.toLowerCase().includes(s) || c !== void 0 && r.fields.traceId !== c || l.push(r);
734
+ r.ts < t || r.ts > n || Dt[r.level] < i || o !== void 0 && r.source !== o || a !== void 0 && (r.scope === void 0 || !r.scope.toLowerCase().includes(a)) || s !== void 0 && !r.message.toLowerCase().includes(s) || c !== void 0 && r.fields.traceId !== c || l.push(r);
737
735
  }
738
736
  return l.reverse();
739
737
  }
@@ -746,7 +744,7 @@ __installPublicEnv(publicEnvValues)
746
744
  clear() {
747
745
  this.buffer = [];
748
746
  }
749
- }, Mt = null, Nt = () => (Mt === null && (Mt = new jt()), Mt), Pt = (e) => {
747
+ }, jt = null, Mt = () => (jt === null && (jt = new At()), jt), Nt = (e) => {
750
748
  if (typeof e == "string") return e;
751
749
  if (e instanceof Error) return e.message;
752
750
  try {
@@ -754,28 +752,28 @@ __installPublicEnv(publicEnvValues)
754
752
  } catch {
755
753
  return String(e);
756
754
  }
757
- }, Ft = 8e3, It = (e) => typeof e == "string" ? e.length <= Ft ? e : `${e.slice(0, Ft)}… [voltro: truncated]` : typeof e != "object" || !e ? e : wt(e, Ft), Lt = (e, t) => {
755
+ }, Pt = 8e3, Ft = (e) => typeof e == "string" ? e.length <= Pt ? e : `${e.slice(0, Pt)}… [voltro: truncated]` : typeof e != "object" || !e ? e : Ct(e, Pt), It = (e, t) => {
758
756
  try {
759
757
  e(...t);
760
758
  } catch (n) {
761
759
  try {
762
- e(...t.map(It)), e(` ↑ [voltro] an argument above was too large for console formatting (${n?.message ?? "inspect failed"}) — printed bounded to ${Ft} chars per argument.`);
760
+ e(...t.map(Ft)), e(` ↑ [voltro] an argument above was too large for console formatting (${n?.message ?? "inspect failed"}) — printed bounded to ${Pt} chars per argument.`);
763
761
  } catch {
764
762
  e(`[voltro] a console.error argument could not be formatted at all (${t.length} arg(s)).`);
765
763
  }
766
764
  }
767
- }, Rt = (e) => {
765
+ }, Lt = (e) => {
768
766
  let t = {
769
767
  log: console.log.bind(console),
770
768
  info: console.info.bind(console),
771
769
  warn: console.warn.bind(console),
772
770
  error: console.error.bind(console),
773
771
  debug: console.debug.bind(console)
774
- }, n = Nt(), r = !1, i = (i) => (...a) => {
775
- if (Lt(t[i], a), !r) {
772
+ }, n = Mt(), r = !1, i = (i) => (...a) => {
773
+ if (It(t[i], a), !r) {
776
774
  r = !0;
777
775
  try {
778
- let t = a.length > 0 ? Pt(a[0]) : "", r = t.length > 500 ? t.slice(0, 500) + "…" : t, o = z();
776
+ let t = a.length > 0 ? Nt(a[0]) : "", r = t.length > 500 ? t.slice(0, 500) + "…" : t, o = B();
779
777
  e.emit("log", {
780
778
  level: i,
781
779
  message: r,
@@ -802,7 +800,7 @@ __installPublicEnv(publicEnvValues)
802
800
  }
803
801
  };
804
802
  console.log = i("log"), console.info = i("info"), console.warn = i("warn"), console.error = i("error"), console.debug = i("debug");
805
- let a = F((t) => {
803
+ let a = I((t) => {
806
804
  if (!r) {
807
805
  r = !0;
808
806
  try {
@@ -813,7 +811,7 @@ __installPublicEnv(publicEnvValues)
813
811
  argsCount: 1,
814
812
  ...t.scope === void 0 ? {} : { scope: t.scope }
815
813
  });
816
- let a = z(), o = a !== void 0 && t.fields.traceId === void 0 ? {
814
+ let a = B(), o = a !== void 0 && t.fields.traceId === void 0 ? {
817
815
  ...t.fields,
818
816
  traceId: a.traceId
819
817
  } : t.fields;
@@ -833,24 +831,24 @@ __installPublicEnv(publicEnvValues)
833
831
  return () => {
834
832
  console.log = t.log, console.info = t.info, console.warn = t.warn, console.error = t.error, console.debug = t.debug, a();
835
833
  };
836
- }, zt = 2e3, Bt = 8, Vt = 1e3, Ht = 200, X = (e, t) => e.length > t ? `${e.slice(0, t)}…` : e, Ut = (e) => {
834
+ }, Rt = 2e3, zt = 8, Bt = 1e3, Vt = 200, X = (e, t) => e.length > t ? `${e.slice(0, t)}…` : e, Ht = (e) => {
837
835
  switch (e) {
838
836
  case "error": return "error";
839
837
  case "warn": return "warn";
840
838
  case "debug": return "debug";
841
839
  default: return "info";
842
840
  }
843
- }, Wt = I({ scope: "client" }), Gt = (e, t) => {
841
+ }, Ut = L({ scope: "client" }), Wt = (e, t) => {
844
842
  let n;
845
843
  try {
846
844
  n = JSON.parse(e);
847
845
  } catch {
848
- return Kt(400, { error: "invalid JSON body" });
846
+ return Gt(400, { error: "invalid JSON body" });
849
847
  }
850
- if (typeof n != "object" || !n) return Kt(400, { error: "body must be a JSON object" });
848
+ if (typeof n != "object" || !n) return Gt(400, { error: "body must be a JSON object" });
851
849
  let r = n;
852
- if (!Array.isArray(r.entries)) return Kt(400, { error: "entries must be an array" });
853
- let i = typeof r.app == "string" ? X(r.app, 120) : void 0, a = typeof r.page == "string" ? X(r.page, 200) : void 0, o = typeof r.ua == "string" ? X(r.ua, 200) : void 0, s = r.entries.slice(0, Ht), c = 0;
850
+ if (!Array.isArray(r.entries)) return Gt(400, { error: "entries must be an array" });
851
+ let i = typeof r.app == "string" ? X(r.app, 120) : void 0, a = typeof r.page == "string" ? X(r.page, 200) : void 0, o = typeof r.ua == "string" ? X(r.ua, 200) : void 0, s = r.entries.slice(0, Vt), c = 0;
854
852
  for (let e of s) {
855
853
  if (typeof e != "object" || !e) continue;
856
854
  let n = e;
@@ -861,7 +859,7 @@ __installPublicEnv(publicEnvValues)
861
859
  "warn",
862
860
  "error",
863
861
  "debug"
864
- ].includes(n.level) ? n.level : "log", s = typeof n.ts == "number" && Number.isFinite(n.ts) ? n.ts : Date.now(), l = X(n.message, zt), u = Array.isArray(n.args) ? n.args.slice(0, Bt).filter((e) => typeof e == "string").map((e) => X(e, Vt)) : void 0, d = typeof n.stack == "string" ? X(n.stack, zt) : void 0;
862
+ ].includes(n.level) ? n.level : "log", s = typeof n.ts == "number" && Number.isFinite(n.ts) ? n.ts : Date.now(), l = X(n.message, Rt), u = Array.isArray(n.args) ? n.args.slice(0, zt).filter((e) => typeof e == "string").map((e) => X(e, Bt)) : void 0, d = typeof n.stack == "string" ? X(n.stack, Rt) : void 0;
865
863
  t.emit("clientLog", {
866
864
  ts: s,
867
865
  level: r,
@@ -876,41 +874,41 @@ __installPublicEnv(publicEnvValues)
876
874
  ...i === void 0 ? {} : { app: i },
877
875
  ...a === void 0 ? {} : { page: a },
878
876
  ...u !== void 0 && u.length > 0 ? { args: u } : {}
879
- }, p = Ut(r);
880
- (p === "error" || p === "warn") && d !== void 0 ? Wt[p](l, f, { stack: d }) : Wt[p](l, {
877
+ }, p = Ht(r);
878
+ (p === "error" || p === "warn") && d !== void 0 ? Ut[p](l, f, { stack: d }) : Ut[p](l, {
881
879
  ...f,
882
880
  ...d === void 0 ? {} : { stack: d }
883
881
  }), c++;
884
882
  }
885
- return Kt(202, {
883
+ return Gt(202, {
886
884
  accepted: c,
887
885
  dropped: r.entries.length - c
888
886
  });
889
- }, Kt = (e, t) => ({
887
+ }, Gt = (e, t) => ({
890
888
  status: e,
891
889
  contentType: "application/json; charset=utf-8",
892
890
  body: JSON.stringify(t)
893
- }), qt = "/_voltro/inspect/clientLog", Jt = [
891
+ }), Kt = "/_voltro/inspect/clientLog", qt = [
894
892
  "trace",
895
893
  "debug",
896
894
  "info",
897
895
  "warn",
898
896
  "error",
899
897
  "fatal"
900
- ], Yt = {
898
+ ], Jt = {
901
899
  trace: "TRACE",
902
900
  debug: "DEBUG",
903
901
  info: "INFO ",
904
902
  warn: "WARN ",
905
903
  error: "ERROR",
906
904
  fatal: "FATAL"
907
- }, Xt = (e) => Jt.includes(e), Zt = (e, t, n = {}) => {
908
- if (a()) return {
905
+ }, Yt = (e) => qt.includes(e), Xt = (e, t, n = {}) => {
906
+ if (o()) return {
909
907
  status: 503,
910
908
  contentType: "application/json",
911
909
  body: JSON.stringify({ error: "inspect disabled (VOLTRO_INSPECT=off)" })
912
910
  };
913
- let r = s(n, "GET");
911
+ let r = c(n, "GET");
914
912
  if (!r.ok) return {
915
913
  status: 401,
916
914
  contentType: "application/json",
@@ -919,36 +917,36 @@ __installPublicEnv(publicEnvValues)
919
917
  reason: r.reason
920
918
  })
921
919
  };
922
- let i = e.indexOf("?"), o = i === -1 ? new URLSearchParams() : new URLSearchParams(e.slice(i + 1)), c = {}, l = o.get("since");
920
+ let i = e.indexOf("?"), a = i === -1 ? new URLSearchParams() : new URLSearchParams(e.slice(i + 1)), s = {}, l = a.get("since");
923
921
  if (l !== null) {
924
922
  let e = Number(l);
925
- Number.isFinite(e) && (c.since = e);
923
+ Number.isFinite(e) && (s.since = e);
926
924
  }
927
- let u = o.get("until");
925
+ let u = a.get("until");
928
926
  if (u !== null) {
929
927
  let e = Number(u);
930
- Number.isFinite(e) && (c.until = e);
928
+ Number.isFinite(e) && (s.until = e);
931
929
  }
932
- let d = o.get("max");
930
+ let d = a.get("max");
933
931
  if (d !== null) {
934
932
  let e = Number(d);
935
- Number.isFinite(e) && e > 0 && (c.max = Math.floor(e));
936
- }
937
- let f = o.get("level");
938
- f !== null && Xt(f) && (c.minLevel = f);
939
- let p = o.get("source");
940
- (p === "server" || p === "client") && (c.source = p);
941
- let m = o.get("scope");
942
- m !== null && m.length > 0 && (c.scope = m);
943
- let h = o.get("filter");
944
- h !== null && h.length > 0 && (c.filter = h);
945
- let g = o.get("trace");
946
- g !== null && g.length > 0 && (c.traceId = g);
947
- let _ = t.query(c);
948
- if ((o.get("format") ?? "json") === "text") return {
933
+ Number.isFinite(e) && e > 0 && (s.max = Math.floor(e));
934
+ }
935
+ let f = a.get("level");
936
+ f !== null && Yt(f) && (s.minLevel = f);
937
+ let p = a.get("source");
938
+ (p === "server" || p === "client") && (s.source = p);
939
+ let m = a.get("scope");
940
+ m !== null && m.length > 0 && (s.scope = m);
941
+ let h = a.get("filter");
942
+ h !== null && h.length > 0 && (s.filter = h);
943
+ let g = a.get("trace");
944
+ g !== null && g.length > 0 && (s.traceId = g);
945
+ let _ = t.query(s);
946
+ if ((a.get("format") ?? "json") === "text") return {
949
947
  status: 200,
950
948
  contentType: "text/plain; charset=utf-8",
951
- body: _.map(Qt).join("\n") + (_.length > 0 ? "\n" : "")
949
+ body: _.map(Zt).join("\n") + (_.length > 0 ? "\n" : "")
952
950
  };
953
951
  let v = {
954
952
  capturedAt: Date.now(),
@@ -962,40 +960,40 @@ __installPublicEnv(publicEnvValues)
962
960
  contentType: "application/json; charset=utf-8",
963
961
  body: JSON.stringify(v)
964
962
  };
965
- }, Qt = (e) => {
966
- let t = new Date(e.ts), n = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), i = String(t.getSeconds()).padStart(2, "0"), a = String(t.getMilliseconds()).padStart(3, "0"), o = `[${e.scope ?? "?"}/${e.source}]`, s = en(e.fields);
967
- return `${n}:${r}:${i}.${a} ${Yt[e.level]} ${o} ${e.message}${s}`;
968
- }, $t = 80, en = (e) => {
963
+ }, Zt = (e) => {
964
+ let t = new Date(e.ts), n = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), i = String(t.getSeconds()).padStart(2, "0"), a = String(t.getMilliseconds()).padStart(3, "0"), o = `[${e.scope ?? "?"}/${e.source}]`, s = $t(e.fields);
965
+ return `${n}:${r}:${i}.${a} ${Jt[e.level]} ${o} ${e.message}${s}`;
966
+ }, Qt = 80, $t = (e) => {
969
967
  let t = Object.entries(e);
970
968
  if (t.length === 0) return "";
971
969
  let n = [];
972
970
  for (let [e, r] of t) {
973
971
  if (r === void 0) continue;
974
- let t = tn(r);
972
+ let t = en(r);
975
973
  n.push(`${e}=${t}`);
976
974
  }
977
975
  return n.length > 0 ? " " + n.join(" ") : "";
978
- }, tn = (e) => {
976
+ }, en = (e) => {
979
977
  if (typeof e == "string") {
980
- let t = e.length > $t ? e.slice(0, $t) + "…" : e;
978
+ let t = e.length > Qt ? e.slice(0, Qt) + "…" : e;
981
979
  return /[\s=]/.test(t) ? `"${t.replace(/"/g, "\\\"")}"` : t;
982
980
  }
983
981
  if (e === null) return "null";
984
982
  if (typeof e == "number" || typeof e == "boolean") return String(e);
985
983
  try {
986
984
  let t = JSON.stringify(e);
987
- return t.length > $t ? t.slice(0, $t) + "…" : t;
985
+ return t.length > Qt ? t.slice(0, Qt) + "…" : t;
988
986
  } catch {
989
987
  return "[unserialisable]";
990
988
  }
991
- }, nn = "/_voltro/inspect/logs", rn = (e, t, n) => {
989
+ }, tn = "/_voltro/inspect/logs", nn = (e, t, n) => {
992
990
  if (t.headers.authorization !== void 0) return !1;
993
991
  let { token: r } = n;
994
992
  if (r === void 0 || r === "" || !n.isLoopback(n.target)) return !1;
995
993
  e.setHeader("authorization", `Bearer ${r}`);
996
994
  let i = n.writeToken;
997
995
  return i !== void 0 && i !== "" && t.headers["x-voltro-inspect-write"] === void 0 && e.setHeader("x-voltro-inspect-write", i), !0;
998
- }, an = [{
996
+ }, rn = [{
999
997
  match: (e) => typeof e == "string" && e.startsWith("[BABEL] Note: The code generator has deoptimised"),
1000
998
  handle: (e, t) => {
1001
999
  let n = e[0], r = n.match(/deoptimised the styling of (.+?) as it exceeds the max of (\d+\w*B)\.?/);
@@ -1007,13 +1005,13 @@ __installPublicEnv(publicEnvValues)
1007
1005
  });
1008
1006
  } else t.info(n);
1009
1007
  }
1010
- }], on = () => {
1008
+ }], an = () => {
1011
1009
  let e = {
1012
1010
  warn: console.warn.bind(console),
1013
1011
  error: console.error.bind(console)
1014
- }, t = I({ scope: "babel" }), n = !1, r = (r) => (...i) => {
1012
+ }, t = L({ scope: "babel" }), n = !1, r = (r) => (...i) => {
1015
1013
  if (!n) {
1016
- for (let e of an) if (e.match(i[0])) {
1014
+ for (let e of rn) if (e.match(i[0])) {
1017
1015
  n = !0;
1018
1016
  try {
1019
1017
  e.handle(i, t);
@@ -1028,7 +1026,7 @@ __installPublicEnv(publicEnvValues)
1028
1026
  return console.warn = r("warn"), console.error = r("error"), () => {
1029
1027
  console.warn = e.warn, console.error = e.error;
1030
1028
  };
1031
- }, sn = {
1029
+ }, on = {
1032
1030
  loader: "it runs on the server, and the router caches its result per route + params",
1033
1031
  renderMode: "it picks the server render strategy",
1034
1032
  dynamic: "it picks the server render strategy",
@@ -1039,7 +1037,7 @@ __installPublicEnv(publicEnvValues)
1039
1037
  cacheInvalidatesOn: "it wires this page into the ISR cache invalidator",
1040
1038
  interactive: "it decides how much client JS the server ships",
1041
1039
  tenantAware: "it is part of the server-side cache key"
1042
- }, cn = Object.keys(sn), ln = "virtual:voltro-route-refresh", un = `\0${ln}`, dn = /(?:^|&)(raw|url|inline|worker|sharedworker|direct)(?:&|=|$)/, fn = () => `
1040
+ }, sn = Object.keys(on), cn = "virtual:voltro-route-refresh", ln = `\0${cn}`, un = /(?:^|&)(raw|url|inline|worker|sharedworker|direct)(?:&|=|$)/, dn = () => `
1043
1041
  // GENERATED by @voltro/cli — the \`voltro dev\` route Fast Refresh runtime.
1044
1042
 
1045
1043
  /** Mirrors react-refresh's own \`isLikelyComponentType\` closely enough for the
@@ -1068,11 +1066,11 @@ const stableForm = (value) => {
1068
1066
  * readers (\`build.ts\` prerender, \`webDev.ts\` dev SSR, \`start.ts\`). A change to
1069
1067
  * one of THESE cannot be hot-applied: the server already ran with the old
1070
1068
  * value. Everything else a page exports is plain client-side data. */
1071
- const serverRelevantExports = ${JSON.stringify(cn)}
1069
+ const serverRelevantExports = ${JSON.stringify(sn)}
1072
1070
 
1073
1071
  /** Name → the server step that already consumed it, so the reload message can
1074
1072
  * say WHY rather than just WHAT. Injected from the same single source. */
1075
- const serverExportEffect = ${JSON.stringify(sn)}
1073
+ const serverExportEffect = ${JSON.stringify(on)}
1076
1074
 
1077
1075
  /** The reason \`name\` forces a reload, for the console line. */
1078
1076
  export const serverEffectOf = (name) =>
@@ -1115,7 +1113,7 @@ export const routeUpdateNeedsReload = (prevExports, nextExports) => {
1115
1113
  const previousHook = globalThis.__getReactRefreshIgnoredExports
1116
1114
  globalThis.__getReactRefreshIgnoredExports = (args) =>
1117
1115
  ignoredExports.get(args.id) ?? previousHook?.(args) ?? []
1118
- `, pn = (e) => `
1116
+ `, fn = (e) => `
1119
1117
  if (import.meta.hot) {
1120
1118
  // Self-import to read our OWN exports, the same technique the react plugin
1121
1119
  // uses; the namespace is only complete after evaluation, hence the promise.
@@ -1142,97 +1140,97 @@ import {
1142
1140
  registerRouteModule as __voltro_registerRouteModule,
1143
1141
  routeUpdateNeedsReload as __voltro_routeUpdateNeedsReload,
1144
1142
  serverEffectOf as __voltro_serverEffect,
1145
- } from '${ln}'
1146
- `, mn = (e) => e.replace(/\\/g, "/"), hn = (e, t) => {
1147
- let [n = "", a] = mn(e).split("?");
1148
- if (!n.endsWith(".tsx") || a !== void 0 && dn.test(a)) return !1;
1149
- let o = mn(t).replace(/\/$/, "");
1150
- return n.startsWith(`${o}/`) ? i.test(n) || r.has(n.slice(n.lastIndexOf("/") + 1)) : !1;
1151
- }, gn = (e, t, n) => hn(t, n) ? `${e}${pn(mn(t).split("?")[0] ?? t)}` : null, _n = (e) => ({
1143
+ } from '${cn}'
1144
+ `, pn = (e) => e.replace(/\\/g, "/"), mn = (e, t) => {
1145
+ let [n = "", r] = pn(e).split("?");
1146
+ if (!n.endsWith(".tsx") || r !== void 0 && un.test(r)) return !1;
1147
+ let o = pn(t).replace(/\/$/, "");
1148
+ return n.startsWith(`${o}/`) ? a.test(n) || i.has(n.slice(n.lastIndexOf("/") + 1)) : !1;
1149
+ }, hn = (e, t, n) => mn(t, n) ? `${e}${fn(pn(t).split("?")[0] ?? t)}` : null, gn = (e) => ({
1152
1150
  name: "voltro:route-fast-refresh",
1153
1151
  enforce: "pre",
1154
- resolveId: (e) => e === "virtual:voltro-route-refresh" ? un : void 0,
1155
- load: (e) => e === un ? fn() : void 0,
1152
+ resolveId: (e) => e === "virtual:voltro-route-refresh" ? ln : void 0,
1153
+ load: (e) => e === ln ? dn() : void 0,
1156
1154
  transform: (t, n, r) => {
1157
1155
  if (r?.ssr === !0) return null;
1158
- let i = gn(t, n, e);
1156
+ let i = hn(t, n, e);
1159
1157
  return i === null ? null : {
1160
1158
  code: i,
1161
1159
  map: null
1162
1160
  };
1163
1161
  }
1164
- }), vn = I({ scope: "voltro:dashboard" }), yn = R(import.meta.url), bn = 5179, xn = (e) => {
1162
+ }), _n = L({ scope: "voltro:dashboard" }), vn = ee(import.meta.url), yn = 5179, bn = (e) => {
1165
1163
  let t = process.env.VOLTRO_DASHBOARD_PATH;
1166
- if (t && E(C(T(t), "app.config.ts"))) return T(t);
1164
+ if (t && D(w(E(t), "app.config.ts"))) return E(t);
1167
1165
  try {
1168
- let e = S(yn.resolve("@voltro/dashboard/package.json"));
1169
- if (E(C(e, "app.config.ts"))) return e;
1166
+ let e = C(vn.resolve("@voltro/dashboard/package.json"));
1167
+ if (D(w(e, "app.config.ts"))) return e;
1170
1168
  } catch {}
1171
- let n = C("voltro-devtools", "apps", "dashboard"), r = T(e);
1169
+ let n = w("voltro-devtools", "apps", "dashboard"), r = E(e);
1172
1170
  for (let e = 0; e < 10; e++) {
1173
- let e = C(r, n);
1174
- if (E(C(e, "app.config.ts"))) return e;
1175
- let t = S(r);
1171
+ let e = w(r, n);
1172
+ if (D(w(e, "app.config.ts"))) return e;
1173
+ let t = C(r);
1176
1174
  if (t === r) break;
1177
1175
  r = t;
1178
1176
  }
1179
1177
  return null;
1180
- }, Sn = "VOLTRO_IS_DASHBOARD", Cn = (e, t = "127.0.0.1", n = 250) => new Promise((r) => {
1181
- let i = le({
1178
+ }, xn = "VOLTRO_IS_DASHBOARD", Sn = (e, t = "127.0.0.1", n = 250) => new Promise((r) => {
1179
+ let i = K({
1182
1180
  port: e,
1183
1181
  host: t
1184
1182
  }), a = !1, o = (e) => {
1185
1183
  a || (a = !0, i.destroy(), r(e));
1186
1184
  };
1187
1185
  i.once("connect", () => o(!0)), i.once("error", () => o(!1)), setTimeout(() => o(!1), n);
1188
- }), wn = () => !!(process.env.VOLTRO_DASHBOARD === "off" || process.argv.includes("--disable-dashboard")), Tn = () => process.env[Sn] === "1", En = () => process.stdout.isTTY === !0, Dn = C(ee(), ".voltro", "dashboard-launch.lock"), On = 1e4, kn = async () => {
1186
+ }), Cn = () => !!(process.env.VOLTRO_DASHBOARD === "off" || process.argv.includes("--disable-dashboard")), wn = () => process.env[xn] === "1", Tn = () => process.stdout.isTTY === !0, En = w(z(), ".voltro", "dashboard-launch.lock"), Dn = 1e4, On = async () => {
1189
1187
  try {
1190
- await D.mkdir(S(Dn), { recursive: !0 });
1191
- let e = await D.open(Dn, "wx");
1188
+ await O.mkdir(C(En), { recursive: !0 });
1189
+ let e = await O.open(En, "wx");
1192
1190
  return await e.write(`${process.pid}\n${Date.now()}\n`), await e.close(), !0;
1193
1191
  } catch {
1194
1192
  try {
1195
- let e = await D.stat(Dn);
1196
- if (Date.now() - e.mtimeMs > On) return await D.unlink(Dn).catch(() => void 0), kn();
1193
+ let e = await O.stat(En);
1194
+ if (Date.now() - e.mtimeMs > Dn) return await O.unlink(En).catch(() => void 0), On();
1197
1195
  } catch {}
1198
1196
  return !1;
1199
1197
  }
1200
- }, An = async () => {
1198
+ }, kn = async () => {
1201
1199
  try {
1202
- await D.unlink(Dn);
1200
+ await O.unlink(En);
1203
1201
  } catch {}
1204
- }, jn = async (e) => {
1202
+ }, An = async (e) => {
1205
1203
  let t = e.port ?? 5179;
1206
- if (wn()) return {
1204
+ if (Cn()) return {
1207
1205
  status: "skipped",
1208
1206
  reason: "disabled by flag/env",
1209
1207
  port: t
1210
1208
  };
1211
- if (Tn()) return {
1209
+ if (wn()) return {
1212
1210
  status: "skipped",
1213
1211
  reason: "this process IS the dashboard",
1214
1212
  port: t
1215
1213
  };
1216
- if (!En()) return {
1214
+ if (!Tn()) return {
1217
1215
  status: "skipped",
1218
1216
  reason: "stdout is not a TTY (CI/smoke)",
1219
1217
  port: t
1220
1218
  };
1221
- if (!await kn()) return {
1219
+ if (!await On()) return {
1222
1220
  status: "skipped",
1223
1221
  reason: "another voltro process is currently launching the dashboard",
1224
1222
  port: t
1225
1223
  };
1226
- if (await Cn(t)) return await An(), {
1224
+ if (await Sn(t)) return await kn(), {
1227
1225
  status: "already-running",
1228
1226
  port: t
1229
1227
  };
1230
1228
  let n = e.voltroBin;
1231
1229
  if (!n) {
1232
1230
  let e = process.argv[1];
1233
- n = e && e.endsWith("/src/bin.ts") ? C(S(e), "..", "bin", "voltro.mjs") : e ?? "voltro";
1231
+ n = e && e.endsWith("/src/bin.ts") ? w(C(e), "..", "bin", "voltro.mjs") : e ?? "voltro";
1234
1232
  }
1235
- let r = E(C(e.dashboardAppPath, ".framework", "dist", "index.html")), i = r ? "start" : "dev", a = ce(process.execPath, [
1233
+ let r = D(w(e.dashboardAppPath, ".framework", "dist", "index.html")), i = r ? "start" : "dev", a = ue(process.execPath, [
1236
1234
  n,
1237
1235
  i,
1238
1236
  e.dashboardAppPath
@@ -1240,7 +1238,7 @@ import {
1240
1238
  stdio: "ignore",
1241
1239
  env: {
1242
1240
  ...process.env,
1243
- [Sn]: "1",
1241
+ [xn]: "1",
1244
1242
  VOLTRO_DASHBOARD_PORT: String(t)
1245
1243
  }
1246
1244
  });
@@ -1248,22 +1246,22 @@ import {
1248
1246
  if (a.exitCode === null && a.signalCode === null) try {
1249
1247
  a.kill("SIGTERM");
1250
1248
  } catch {}
1251
- }), vn.info(`auto-launching dashboard at http://localhost:${t}`, {
1249
+ }), _n.info(`auto-launching dashboard at http://localhost:${t}`, {
1252
1250
  port: t,
1253
1251
  mode: i,
1254
1252
  prebuilt: r
1255
- }), r || vn.debug("no pre-built dashboard — running `voltro dev`. Build with `cd voltro-devtools && pnpm build` for a fast prod boot."), vn.debug("disable via --disable-dashboard or VOLTRO_DASHBOARD=off"), setTimeout(() => {
1256
- An();
1253
+ }), r || _n.debug("no pre-built dashboard — running `voltro dev`. Build with `cd voltro-devtools && pnpm build` for a fast prod boot."), _n.debug("disable via --disable-dashboard or VOLTRO_DASHBOARD=off"), setTimeout(() => {
1254
+ kn();
1257
1255
  }, 4e3).unref(), {
1258
1256
  status: "launched",
1259
1257
  port: t
1260
1258
  };
1261
- }, Mn = class extends Error {
1259
+ }, jn = class extends Error {
1262
1260
  _voltroDeferral = !0;
1263
1261
  constructor(e) {
1264
1262
  super(e), this.name = "DeferralNotSupportedError";
1265
1263
  }
1266
- }, Nn = (e) => typeof e == "object" && !!e && e._voltroDeferral === !0, Pn = (e) => {
1264
+ }, Mn = (e) => typeof e == "object" && !!e && e._voltroDeferral === !0, Nn = (e) => {
1267
1265
  if (!(e instanceof Error)) return;
1268
1266
  let t = e._voltroControl;
1269
1267
  if (t === "redirect") {
@@ -1285,7 +1283,7 @@ import {
1285
1283
  },
1286
1284
  body: "not found"
1287
1285
  };
1288
- }, Fn = (e) => {
1286
+ }, Pn = (e) => {
1289
1287
  let { helpers: t } = e, n = t.prepareDeferredLoaderData(e.loaderData, "page"), r = {}, i = {}, a = {};
1290
1288
  for (let [n, o] of Object.entries(e.segmentLoaderData)) {
1291
1289
  let e = Number(n), s = t.prepareDeferredLoaderData(o, e);
@@ -1300,7 +1298,7 @@ import {
1300
1298
  ...e.layoutShell ? { layoutShell: e.layoutShell } : {}
1301
1299
  });
1302
1300
  } catch (e) {
1303
- throw new Mn(e instanceof Error ? e.message : String(e));
1301
+ throw new jn(e instanceof Error ? e.message : String(e));
1304
1302
  }
1305
1303
  return {
1306
1304
  loaderData: n.renderData,
@@ -1316,8 +1314,8 @@ import {
1316
1314
  ...Object.keys(a).length > 0 ? { deferredSegmentIds: a } : {}
1317
1315
  }
1318
1316
  };
1319
- }, In = (e) => {
1320
- let { helpers: t, renderInput: n } = e, r = Fn({
1317
+ }, Fn = (e) => {
1318
+ let { helpers: t, renderInput: n } = e, r = Pn({
1321
1319
  helpers: t,
1322
1320
  page: e.page,
1323
1321
  pathname: n.pathname,
@@ -1338,19 +1336,19 @@ import {
1338
1336
  stateScript: t.renderRouterStateScript(r.stateInput),
1339
1337
  hasDeferred: r.hasDeferred
1340
1338
  };
1341
- }, Ln = (e) => {
1339
+ }, In = (e) => {
1342
1340
  let { html: t, meta: n } = e.helpers.renderPageToHtml(e.prepared.renderInput);
1343
1341
  return {
1344
1342
  body: t,
1345
1343
  meta: n
1346
1344
  };
1347
- }, Rn = (e) => [
1345
+ }, Ln = (e) => [
1348
1346
  ...e.extra ?? [],
1349
1347
  e.helpers.renderMetaToHtml(e.meta),
1350
1348
  `<meta name="voltro-interactive" content="${e.interactive}" />`,
1351
1349
  ...e.prepared.hasDeferred ? [e.helpers.renderDeferredRegistryScript()] : [],
1352
1350
  e.prepared.stateScript
1353
- ].filter((e) => e.length > 0).join("\n "), zn = (e) => {
1351
+ ].filter((e) => e.length > 0).join("\n "), Rn = (e) => {
1354
1352
  let t = e.indexOf("?");
1355
1353
  return t === -1 ? {
1356
1354
  pathname: e || "/",
@@ -1359,9 +1357,9 @@ import {
1359
1357
  pathname: e.slice(0, t) || "/",
1360
1358
  search: e.slice(t)
1361
1359
  };
1362
- }, Bn = /Could not find required `intl` object/, Vn = "__voltro_i18n_instances__", Hn = (e = globalThis) => {
1360
+ }, zn = /Could not find required `intl` object/, Bn = "__voltro_i18n_instances__", Vn = (e = globalThis) => {
1363
1361
  try {
1364
- let t = e[Vn]?.records;
1362
+ let t = e[Bn]?.records;
1365
1363
  return t === void 0 || t.length === 0 ? void 0 : {
1366
1364
  instances: t.length,
1367
1365
  reactIntlCopies: new Set(t.map((e) => e.intlProvider)).size,
@@ -1370,7 +1368,7 @@ import {
1370
1368
  } catch {
1371
1369
  return;
1372
1370
  }
1373
- }, Un = (e, t) => [
1371
+ }, Hn = (e, t) => [
1374
1372
  "",
1375
1373
  "── voltro diagnosis ───────────────────────────────────────────────────",
1376
1374
  `${e} DID wrap this render in <I18nProvider>, and this process`,
@@ -1388,7 +1386,7 @@ import {
1388
1386
  " versions on disk; this counts instances in the running process, and one",
1389
1387
  " file loaded down two paths is two instances.",
1390
1388
  "───────────────────────────────────────────────────────────────────────"
1391
- ].join("\n"), Wn = (e, t) => [
1389
+ ].join("\n"), Un = (e, t) => [
1392
1390
  "",
1393
1391
  "── voltro diagnosis ───────────────────────────────────────────────────",
1394
1392
  `${e} DID wrap this render in <I18nProvider>, and this process`,
@@ -1404,7 +1402,7 @@ import {
1404
1402
  " direct import can land on a second copy that this count does not see —",
1405
1403
  " it counts what @voltro/i18n is bound to.",
1406
1404
  "───────────────────────────────────────────────────────────────────────"
1407
- ].join("\n"), Gn = (e) => [
1405
+ ].join("\n"), Wn = (e) => [
1408
1406
  "",
1409
1407
  "── voltro diagnosis ───────────────────────────────────────────────────",
1410
1408
  `${e} DID wrap this render in <I18nProvider> — the framework`,
@@ -1420,34 +1418,34 @@ import {
1420
1418
  " Do NOT use `pnpm ls` to rule that out: it lists versions on disk, and",
1421
1419
  " the duplication here is of module instances in one process.",
1422
1420
  "───────────────────────────────────────────────────────────────────────"
1423
- ].join("\n"), Kn = (e, t, n, r = Hn()) => {
1421
+ ].join("\n"), Gn = (e, t, n, r = Vn()) => {
1424
1422
  if (!t) return;
1425
1423
  let i = String(e?.message ?? e);
1426
- if (Bn.test(i)) return r === void 0 ? Gn(n) : r.reactIntlCopies > 1 || r.instances > 1 ? Un(n, r) : Wn(n, r);
1427
- }, qn = "<div id=\"root\"></div>", Jn = "<div id=\"root\">", Yn = "</div>", Xn = /<script\b[^>]*\btype=["']module["'][^>]*><\/script>[ \t]*\n?/gi, Zn = /\bsrc=["']([^"']+)["']/i, Qn = /<script(?![^>]*\basync\b)([^>]*\btype=["']module["'][^>]*)>/gi, $n = (e) => {
1428
- let t = e.keepScriptInHead ?? ((e) => e.startsWith("/@")), n = [], r = e.shell.replace(Xn, (e) => {
1429
- let r = Zn.exec(e)?.[1];
1424
+ if (zn.test(i)) return r === void 0 ? Wn(n) : r.reactIntlCopies > 1 || r.instances > 1 ? Hn(n, r) : Un(n, r);
1425
+ }, Kn = "<div id=\"root\"></div>", qn = "<div id=\"root\">", Jn = "</div>", Yn = /<script\b[^>]*\btype=["']module["'][^>]*><\/script>[ \t]*\n?/gi, Xn = /\bsrc=["']([^"']+)["']/i, Zn = /<script(?![^>]*\basync\b)([^>]*\btype=["']module["'][^>]*)>/gi, Qn = (e) => {
1426
+ let t = e.keepScriptInHead ?? ((e) => e.startsWith("/@")), n = [], r = e.shell.replace(Yn, (e) => {
1427
+ let r = Xn.exec(e)?.[1];
1430
1428
  return r === void 0 || t(r) ? e : (n.push(r), "");
1431
1429
  });
1432
- e.inlineModuleScriptsAsync && (r = r.replace(Qn, "<script async$1>"));
1433
- let i = r.indexOf(qn);
1434
- if (i === -1) throw Error(`[voltro] the generated shell has no \`${qn}\` element, so a streamed response cannot be split around the page body. This is a framework bug unless the app overrode \`.framework/index.html\` by hand.`);
1430
+ e.inlineModuleScriptsAsync && (r = r.replace(Zn, "<script async$1>"));
1431
+ let i = r.indexOf(Kn);
1432
+ if (i === -1) throw Error(`[voltro] the generated shell has no \`${Kn}\` element, so a streamed response cannot be split around the page body. This is a framework bug unless the app overrode \`.framework/index.html\` by hand.`);
1435
1433
  return {
1436
- head: `${r.slice(0, i)}${Jn}`,
1437
- tail: `${Yn}${r.slice(i + 21)}`,
1434
+ head: `${r.slice(0, i)}${qn}`,
1435
+ tail: `${Jn}${r.slice(i + 21)}`,
1438
1436
  bootstrapModules: n
1439
1437
  };
1440
- }, er = (e, t) => (/<title>/i.test(t) ? e.replace(/[^\S\n]*<title>[\s\S]*?<\/title>\n?/i, "") : e).replace("</head>", ` ${t}\n </head>`), tr = (e) => er(e.head, e.headInjection).replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${e.htmlLang}"`), nr = (e) => {
1438
+ }, $n = (e, t) => (/<title>/i.test(t) ? e.replace(/[^\S\n]*<title>[\s\S]*?<\/title>\n?/i, "") : e).replace("</head>", ` ${t}\n </head>`), er = (e) => $n(e.head, e.headInjection).replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${e.htmlLang}"`), tr = (e) => {
1441
1439
  let { res: t, shell: n, htmlLang: r, headInjection: i } = e, a = null, o = !1, s = !1, c = () => {
1442
1440
  if (s || !o || a === null) return;
1443
1441
  s = !0, t.statusCode = e.statusCode ?? 200;
1444
1442
  for (let [n, r] of Object.entries(e.headers ?? {})) t.setHeader(n, r);
1445
- t.flushHeaders?.(), t.write(tr({
1443
+ t.flushHeaders?.(), t.write(er({
1446
1444
  head: n.head,
1447
1445
  headInjection: i(a.meta),
1448
1446
  htmlLang: r
1449
1447
  }));
1450
- let c = new ue();
1448
+ let c = new de();
1451
1449
  c.pipe(t, { end: !1 }), c.on("end", () => {
1452
1450
  t.end(n.tail);
1453
1451
  }), a.stream.pipe(c);
@@ -1472,16 +1470,16 @@ import {
1472
1470
  return;
1473
1471
  }
1474
1472
  c();
1475
- }, rr = (e) => Array.isArray(e.preload) && e.preload.length > 0, ir = (e, t) => typeof e == "string" ? {
1473
+ }, nr = (e) => Array.isArray(e.preload) && e.preload.length > 0, rr = (e, t) => typeof e == "string" ? {
1476
1474
  tag: e,
1477
1475
  input: {}
1478
1476
  } : {
1479
1477
  tag: e.tag,
1480
1478
  input: e.input?.(t) ?? {}
1481
- }, ar = async (e) => {
1479
+ }, ir = async (e) => {
1482
1480
  let { pageMod: t, params: n, query: r, apiName: i, seed: a, onError: o } = e;
1483
- if (rr(t) && !(r === void 0 || i === void 0)) for (let e of t.preload) {
1484
- let { tag: t, input: s } = ir(e, n);
1481
+ if (nr(t) && !(r === void 0 || i === void 0)) for (let e of t.preload) {
1482
+ let { tag: t, input: s } = rr(e, n);
1485
1483
  try {
1486
1484
  a(i, t, s, await r(t, s));
1487
1485
  } catch (e) {
@@ -1491,23 +1489,23 @@ import {
1491
1489
  }, e);
1492
1490
  }
1493
1491
  }
1494
- }, Z = I({ scope: "voltro:dev:web" }), or = I({ scope: "vite" }), sr = await (async () => {
1492
+ }, Z = L({ scope: "voltro:dev:web" }), ar = L({ scope: "vite" }), or = await (async () => {
1495
1493
  try {
1496
- let e = C(S(N(import.meta.url)), "..", "package.json"), t = await D.readFile(e, "utf8");
1494
+ let e = w(C(P(import.meta.url)), "..", "package.json"), t = await O.readFile(e, "utf8");
1497
1495
  return JSON.parse(t).version ?? "0.0.0";
1498
1496
  } catch {
1499
1497
  return "0.0.0";
1500
1498
  }
1501
- })(), cr = async () => {
1499
+ })(), sr = async () => {
1502
1500
  try {
1503
- let e = S(N(import.meta.url)), t = T(e, "..", "..", "devtools");
1504
- if (E(C(t, "package.json"))) return t;
1505
- let n = T(e, "..", "..", "..", "devtools");
1506
- return E(C(n, "package.json")) ? n : null;
1501
+ let e = C(P(import.meta.url)), t = E(e, "..", "..", "devtools");
1502
+ if (D(w(t, "package.json"))) return t;
1503
+ let n = E(e, "..", "..", "..", "devtools");
1504
+ return D(w(n, "package.json")) ? n : null;
1507
1505
  } catch {
1508
1506
  return null;
1509
1507
  }
1510
- }, lr = (e, t) => e.disableDevtools || !t ? [] : [
1508
+ }, cr = (e, t) => e.disableDevtools || !t ? [] : [
1511
1509
  "",
1512
1510
  "// Dev-only in-page devtools overlay. The `import.meta.env.DEV` guard is a",
1513
1511
  "// compile-time constant, so prod builds strip this whole `if` block — the",
@@ -1517,67 +1515,67 @@ import {
1517
1515
  " await import('@voltro/devtools/styles.css')",
1518
1516
  " Devtools = (await import('@voltro/devtools')).VoltroDevtools",
1519
1517
  "}"
1520
- ], ur = (e, t) => e.disableDevtools || !t ? [] : [" ...(Devtools ? { Devtools } : {}),"], dr = (e) => e.sentry ? ["import { initSentryBrowser } from '@voltro/plugin-sentry/web'"] : [], fr = (e) => e.sentry ? [
1518
+ ], lr = (e, t) => e.disableDevtools || !t ? [] : [" ...(Devtools ? { Devtools } : {}),"], ur = (e) => e.sentry ? ["import { initSentryBrowser } from '@voltro/plugin-sentry/web'"] : [], dr = (e) => e.sentry ? [
1521
1519
  "",
1522
1520
  "// Browser-side Sentry (frontend half of the deep integration). Errors +",
1523
1521
  "// browser rpc spans flow to Sentry, sharing the server transactions' trace.",
1524
1522
  `await initSentryBrowser(${JSON.stringify(e.sentry)})`
1525
- ] : [], pr = (e) => e.env ? ["import './env.public'"] : [], mr = (e) => {
1526
- let t = [], n = T(e);
1523
+ ] : [], fr = (e) => e.env ? ["import './env.public'"] : [], pr = (e) => {
1524
+ let t = [], n = E(e);
1527
1525
  for (;;) {
1528
- E(C(n, "pnpm-workspace.yaml")) && t.push(n);
1529
- let e = S(n);
1526
+ D(w(n, "pnpm-workspace.yaml")) && t.push(n);
1527
+ let e = C(n);
1530
1528
  if (e === n) break;
1531
1529
  n = e;
1532
1530
  }
1533
1531
  return t;
1534
- }, hr = h, gr = (e) => {
1532
+ }, mr = g, hr = (e) => {
1535
1533
  if (/\/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(?:react|react-dom|scheduler)\//.test(e)) return "react";
1536
1534
  let t = /\/([^/]+)\.island\.tsx?$/.exec(e);
1537
1535
  if (t) return `island-${t[1]}`;
1538
- }, _r = /export\s+(?:async\s+)?(?:const|function|let|var)\s+loader\b/, vr = (e) => e.startsWith("(") && e.endsWith(")"), yr = (e) => e.filter((e) => !vr(e)), br = (e) => {
1539
- let t = e.replace(i, "").split("/").filter(Boolean).filter((e) => !vr(e));
1536
+ }, gr = /export\s+(?:async\s+)?(?:const|function|let|var)\s+loader\b/, _r = (e) => e.startsWith("(") && e.endsWith(")"), vr = (e) => e.filter((e) => !_r(e)), yr = (e) => {
1537
+ let t = e.replace(a, "").split("/").filter(Boolean).filter((e) => !_r(e));
1540
1538
  return t.length === 0 ? "/" : "/" + t.join("/");
1541
- }, xr = (e) => `${e.replace(i, "").split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Index"}Page`, Q = (e, t) => e === "" ? `Root${t}` : `${e.split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Root"}${t}`, $ = async (e) => {
1542
- let t = [], n = [], a = async (e, o) => {
1539
+ }, br = (e) => `${e.replace(a, "").split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Index"}Page`, Q = (e, t) => e === "" ? `Root${t}` : `${e.split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Root"}${t}`, $ = async (e) => {
1540
+ let t = [], n = [], r = async (e, o) => {
1543
1541
  let s = [];
1544
1542
  try {
1545
- s = await D.readdir(e, { withFileTypes: !0 });
1543
+ s = await O.readdir(e, { withFileTypes: !0 });
1546
1544
  } catch {
1547
1545
  return;
1548
1546
  }
1549
- let c = s.filter((e) => e.isDirectory()).map((e) => e.name).sort(), l = s.filter((e) => e.isFile() && e.name.endsWith(".tsx") && !hr(e.name)).map((e) => e.name).sort(), u = new Set(l), d = o.join("/");
1550
- if (l.some((e) => r.has(e))) {
1551
- let t = u.has("layout.tsx"), i = !1;
1547
+ let c = s.filter((e) => e.isDirectory()).map((e) => e.name).sort(), l = s.filter((e) => e.isFile() && e.name.endsWith(".tsx") && !mr(e.name)).map((e) => e.name).sort(), u = new Set(l), d = o.join("/");
1548
+ if (l.some((e) => i.has(e))) {
1549
+ let t = u.has("layout.tsx"), r = !1;
1552
1550
  if (t) try {
1553
- let t = await D.readFile(C(e, "layout.tsx"), "utf8");
1554
- i = _r.test(t);
1551
+ let t = await O.readFile(w(e, "layout.tsx"), "utf8");
1552
+ r = gr.test(t);
1555
1553
  } catch {}
1556
1554
  n.push({
1557
1555
  dir: d,
1558
1556
  chain: o,
1559
- contributesToUrl: o.length === 0 || !vr(o[o.length - 1]),
1557
+ contributesToUrl: o.length === 0 || !_r(o[o.length - 1]),
1560
1558
  hasLayout: t,
1561
- hasLayoutLoader: i,
1559
+ hasLayoutLoader: r,
1562
1560
  hasError: u.has("error.tsx"),
1563
1561
  hasPending: u.has("loading.tsx"),
1564
1562
  hasNotFound: u.has("not-found.tsx"),
1565
- specialFiles: l.filter((e) => r.has(e))
1563
+ specialFiles: l.filter((e) => i.has(e))
1566
1564
  });
1567
1565
  }
1568
1566
  for (let e of l) {
1569
- if (!i.test(e)) continue;
1567
+ if (!a.test(e)) continue;
1570
1568
  let n = d ? `${d}/${e}` : e;
1571
1569
  t.push({
1572
1570
  file: n,
1573
- pattern: br(n),
1574
- ident: xr(n),
1571
+ pattern: yr(n),
1572
+ ident: br(n),
1575
1573
  dirChain: o
1576
1574
  });
1577
1575
  }
1578
- for (let t of c) await a(C(e, t), [...o, t]);
1576
+ for (let t of c) await r(w(e, t), [...o, t]);
1579
1577
  };
1580
- await a(e, []), t.sort((e, t) => e.file < t.file ? -1 : 1);
1578
+ await r(e, []), t.sort((e, t) => e.file < t.file ? -1 : 1);
1581
1579
  let o = /* @__PURE__ */ new Set();
1582
1580
  for (let e of t) for (let t = e.dirChain.length; t >= 0; t--) o.add(e.dirChain.slice(0, t).join("/"));
1583
1581
  let s = [], c = [];
@@ -1590,14 +1588,14 @@ import {
1590
1588
  dirs: s,
1591
1589
  orphanedSpecials: c
1592
1590
  };
1593
- }, Sr = (e, t) => {
1591
+ }, xr = (e, t) => {
1594
1592
  let n = [];
1595
1593
  for (let r = 0; r <= t.length; r++) {
1596
1594
  let i = t.slice(0, r).join("/"), a = e.find((e) => e.dir === i);
1597
1595
  a && n.push(a);
1598
1596
  }
1599
1597
  return n;
1600
- }, Cr = async (e) => {
1598
+ }, Sr = async (e) => {
1601
1599
  let { entries: t, loadLayout: n, loadError: r, loadPending: i, ctx: a } = e, o = {};
1602
1600
  return {
1603
1601
  chain: await Promise.all(t.map(async (e, t) => {
@@ -1620,10 +1618,10 @@ import {
1620
1618
  })),
1621
1619
  segmentLoaderData: o
1622
1620
  };
1623
- }, wr = (e) => {
1624
- let t = yr(e);
1621
+ }, Cr = (e) => {
1622
+ let t = vr(e);
1625
1623
  return t.length === 0 ? "" : "/" + t.join("/");
1626
- }, Tr = [
1624
+ }, wr = [
1627
1625
  "// Hot-reload bridge: keep SSR-injected <link rel=\"stylesheet\"> tags",
1628
1626
  "// in sync with Vite's CSS HMR. Without this, edits to .css files",
1629
1627
  "// only update the JS-injected <style> overlay; the underlying <link>",
@@ -1716,7 +1714,7 @@ import {
1716
1714
  " _vdtErrorStart('Build error')",
1717
1715
  " })",
1718
1716
  "}"
1719
- ].join("\n"), Er = (e) => {
1717
+ ].join("\n"), Tr = (e) => {
1720
1718
  let t = [], n = 0, r = e.split("/").filter(Boolean), i = [];
1721
1719
  for (let e of r) e.startsWith("[[...") && e.endsWith("]]") ? (i.push("(.*)"), t.push(e.slice(5, -2)), n += 2) : e.startsWith("[...") && e.endsWith("]") ? (i.push("(.+)"), t.push(e.slice(4, -1)), n += 3) : e.startsWith("[") && e.endsWith("]") ? (i.push("([^/]+)"), t.push(e.slice(1, -1)), n += 1) : i.push(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
1722
1720
  let a = i.join("/");
@@ -1725,8 +1723,8 @@ import {
1725
1723
  paramNames: t,
1726
1724
  priority: n
1727
1725
  };
1728
- }, Dr = (e) => e.map((e) => {
1729
- let { regex: t, paramNames: n, priority: r } = Er(e.pattern);
1726
+ }, Er = (e) => e.map((e) => {
1727
+ let { regex: t, paramNames: n, priority: r } = Tr(e.pattern);
1730
1728
  return {
1731
1729
  pattern: e.pattern,
1732
1730
  file: e.file,
@@ -1735,7 +1733,7 @@ import {
1735
1733
  paramNames: n,
1736
1734
  priority: r
1737
1735
  };
1738
- }).slice().sort((e, t) => e.priority - t.priority), Or = (e, t) => {
1736
+ }).slice().sort((e, t) => e.priority - t.priority), Dr = (e, t) => {
1739
1737
  for (let n of t) {
1740
1738
  let t = n.regex.exec(e);
1741
1739
  if (!t) continue;
@@ -1747,11 +1745,11 @@ import {
1747
1745
  };
1748
1746
  }
1749
1747
  return null;
1750
- }, kr = xe, Ar = async (e) => {
1748
+ }, Or = Se, kr = async (e) => {
1751
1749
  try {
1752
- let t = await import(P(C(e, "app.config.ts")).href), r = t.default?.port, i = n({
1750
+ let t = await import(F(w(e, "app.config.ts")).href), n = t.default?.port, i = r({
1753
1751
  kind: "api",
1754
- configPort: typeof r == "number" ? r : void 0,
1752
+ configPort: typeof n == "number" ? n : void 0,
1755
1753
  env: {}
1756
1754
  }).port, a = t.default?.transport?.wsPath, o = typeof a == "string" && a.startsWith("/") ? a : void 0;
1757
1755
  return o ? {
@@ -1759,11 +1757,11 @@ import {
1759
1757
  wsPath: o
1760
1758
  } : { port: i };
1761
1759
  } catch {}
1762
- return { port: n({
1760
+ return { port: r({
1763
1761
  kind: "api",
1764
1762
  env: {}
1765
1763
  }).port };
1766
- }, jr = (e, t) => ({
1764
+ }, Ar = (e, t) => ({
1767
1765
  name: e,
1768
1766
  pkg: t.package,
1769
1767
  browserWsUrl: t.url,
@@ -1771,7 +1769,7 @@ import {
1771
1769
  ...t.serverUrl ? { serverOrigin: t.serverUrl } : {},
1772
1770
  ...t.headers ? { headers: t.headers } : {},
1773
1771
  ...t.authHeaders ? { hasAuthHeaders: !0 } : {}
1774
- }), Mr = (e, t, n) => {
1772
+ }), jr = (e, t, n) => {
1775
1773
  let r = t.transport?.wsPath ?? n.wsPath;
1776
1774
  return {
1777
1775
  name: e,
@@ -1783,7 +1781,7 @@ import {
1783
1781
  ...t.headers ? { headers: t.headers } : {},
1784
1782
  ...t.authHeaders ? { hasAuthHeaders: !0 } : {}
1785
1783
  };
1786
- }, Nr = (e) => {
1784
+ }, Mr = (e) => {
1787
1785
  let t = /* @__PURE__ */ new Map();
1788
1786
  for (let n of e) {
1789
1787
  if (n.proxyTarget === void 0) continue;
@@ -1791,43 +1789,43 @@ import {
1791
1789
  if (e) throw Error(`[voltro] api ${JSON.stringify(n.name)} and ${JSON.stringify(e)} both resolve the same-origin WS path ${JSON.stringify(n.browserWsUrl)}. A custom transport.wsPath must be unique per origin (one api per origin may use a fixed path). Give each a distinct wsPath, or drop the override to use the default /ws/<name>.`);
1792
1790
  t.set(n.browserWsUrl, n.name);
1793
1791
  }
1794
- }, Pr = async (e, t) => {
1792
+ }, Nr = async (e, t) => {
1795
1793
  let n = Object.entries(t.apis ?? {}), r = [];
1796
1794
  for (let [t, i] of n) {
1797
1795
  if (i.url) {
1798
- r.push(jr(t, i));
1796
+ r.push(Ar(t, i));
1799
1797
  continue;
1800
1798
  }
1801
- let n = await kr(e, i.package);
1799
+ let n = await Or(e, i.package);
1802
1800
  if (!n) throw Error(`[voltro dev] api ${JSON.stringify(t)} (package ${JSON.stringify(i.package)}) is not a workspace dep and has no \`url\` set in app.config.ts. External apis need an explicit \`url\` because the framework can't discover their dev port.`);
1803
- r.push(Mr(t, i, await Ar(n)));
1801
+ r.push(jr(t, i, await kr(n)));
1804
1802
  }
1805
- return Nr(r), r;
1806
- }, Fr = (e) => {
1803
+ return Mr(r), r;
1804
+ }, Pr = (e) => {
1807
1805
  if (!(!/^wss?:\/\//.test(e) && !/^https?:\/\//.test(e))) try {
1808
1806
  let t = new URL(e);
1809
1807
  return t.protocol = t.protocol === "wss:" || t.protocol === "https:" ? "https:" : "http:", `${t.protocol}//${t.host}`;
1810
1808
  } catch {
1811
1809
  return;
1812
1810
  }
1813
- }, Ir = (e) => `VOLTRO_API_ORIGIN_${e.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`, Lr = (e) => process.env[Ir(e)] ?? process.env.VOLTRO_API_ORIGIN, Rr = (e, t) => {
1811
+ }, Fr = (e) => `VOLTRO_API_ORIGIN_${e.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`, Ir = (e) => process.env[Fr(e)] ?? process.env.VOLTRO_API_ORIGIN, Lr = (e, t) => {
1814
1812
  if (!e) return;
1815
- let n = Lr(e.name) ?? e.serverOrigin;
1813
+ let n = Ir(e.name) ?? e.serverOrigin;
1816
1814
  if (n) {
1817
- let e = Fr(n);
1815
+ let e = Pr(n);
1818
1816
  if (e) return e;
1819
1817
  }
1820
1818
  if (t?.allowDevProxy && e.proxyTarget) {
1821
- let t = Fr(e.proxyTarget);
1819
+ let t = Pr(e.proxyTarget);
1822
1820
  if (t) return t;
1823
1821
  }
1824
- if (!e.proxyTarget && /^wss?:\/\//.test(e.browserWsUrl)) return Fr(e.browserWsUrl);
1825
- }, zr = (e, t, n) => {
1822
+ if (!e.proxyTarget && /^wss?:\/\//.test(e.browserWsUrl)) return Pr(e.browserWsUrl);
1823
+ }, Rr = (e, t, n) => {
1826
1824
  if (!e) {
1827
1825
  if (n?.apiName === void 0) return;
1828
1826
  let e = n.apiName;
1829
1827
  return async () => {
1830
- throw Error(`[loader.query] api '${e}' has no server-side origin for SSR. In a split web/api deployment the web pod reaches the api by internal DNS, not the browser's relative wsPath — set ${Ir(e)} (or VOLTRO_API_ORIGIN, or apis.${e}.serverUrl in app.config.ts) to the api's internal origin, e.g. http://api.<namespace>.svc.cluster.local. The browser transport is unaffected.`);
1828
+ throw Error(`[loader.query] api '${e}' has no server-side origin for SSR. In a split web/api deployment the web pod reaches the api by internal DNS, not the browser's relative wsPath — set ${Fr(e)} (or VOLTRO_API_ORIGIN, or apis.${e}.serverUrl in app.config.ts) to the api's internal origin, e.g. http://api.<namespace>.svc.cluster.local. The browser transport is unaffected.`);
1831
1829
  };
1832
1830
  }
1833
1831
  return async (r, i) => {
@@ -1849,7 +1847,7 @@ import {
1849
1847
  });
1850
1848
  } catch (t) {
1851
1849
  let i = t?.cause?.code ?? String(t?.message ?? t);
1852
- throw Error(`[loader.query] ${r}: could not reach the api at ${e}/rpc (${i}). ${n?.apiName ? `Set ${Ir(n.apiName)} / VOLTRO_API_ORIGIN` : "Set the api server origin"} to the api's SSR-reachable origin (internal cluster DNS in a split deployment).`, { cause: t });
1850
+ throw Error(`[loader.query] ${r}: could not reach the api at ${e}/rpc (${i}). ${n?.apiName ? `Set ${Fr(n.apiName)} / VOLTRO_API_ORIGIN` : "Set the api server origin"} to the api's SSR-reachable origin (internal cluster DNS in a split deployment).`, { cause: t });
1853
1851
  }
1854
1852
  if (!o.ok) throw Error(`[loader.query] ${r}: HTTP ${o.status} ${await o.text()}`);
1855
1853
  let s = await o.json();
@@ -1879,8 +1877,8 @@ import {
1879
1877
  }
1880
1878
  if (u) return l;
1881
1879
  };
1882
- }, Br = async (e, t, n, r = {}) => {
1883
- let i = t.title ?? t.name ?? "app", a = t.theme === "dark" ? " class=\"dark\"" : t.theme === "light" ? " class=\"light\"" : "", o = E(C(e, "node_modules", "@voltro", "devtools", "package.json")) || await cr() !== null, s = t.theme === "system" ? [
1880
+ }, zr = async (e, t, n, r = {}) => {
1881
+ let i = t.title ?? t.name ?? "app", a = t.theme === "dark" ? " class=\"dark\"" : t.theme === "light" ? " class=\"light\"" : "", o = D(w(e, "node_modules", "@voltro", "devtools", "package.json")) || await sr() !== null, s = t.theme === "system" ? [
1884
1882
  " <script>",
1885
1883
  " (function () {",
1886
1884
  " var root = document.documentElement",
@@ -1918,14 +1916,14 @@ import {
1918
1916
  " </body>",
1919
1917
  "</html>",
1920
1918
  ""
1921
- ].join("\n"), l = C(e, "src", "pages"), { pages: u, dirs: d, orphanedSpecials: f } = await $(l);
1922
- await m(l, u);
1919
+ ].join("\n"), l = w(e, "src", "pages"), { pages: u, dirs: d, orphanedSpecials: f } = await $(l);
1920
+ await h(l, u);
1923
1921
  for (let e of f) Z.warn(`src/pages/${e.dir || "."}/ contains ${e.files.join(", ")} but no page.tsx at or below it — ${e.files.length > 1 ? "those files are" : "that file is"} inert. A layout/error/loading/not-found file only applies to routes in its own directory tree; if this is an ordinary component, rename it so it does not read as a route boundary.`);
1924
- let p = (e) => `${e.replace(/[^a-zA-Z0-9]/g, "_")}AppGroup`, h = (e) => `${e.replace(/[^a-zA-Z0-9]/g, "_")}AppDescriptors`, g = n.map((e) => `import { appGroup as ${p(e.name)}, appDescriptors as ${h(e.name)} } from '${e.pkg}/rpcGroup'`);
1922
+ let p = (e) => `${e.replace(/[^a-zA-Z0-9]/g, "_")}AppGroup`, m = (e) => `${e.replace(/[^a-zA-Z0-9]/g, "_")}AppDescriptors`, g = n.map((e) => `import { appGroup as ${p(e.name)}, appDescriptors as ${m(e.name)} } from '${e.pkg}/rpcGroup'`);
1925
1923
  n.some((e) => e.hasAuthHeaders) && (g.push("import __voltroAppConfig from '../app.config'"), g.push("const __voltroAuthHeaders = (__voltroAppConfig as { readonly apis?: Record<string, { readonly authHeaders?: () => Record<string, string> | Promise<Record<string, string>> }> }).apis"));
1926
1924
  let _ = n.map((e) => {
1927
1925
  let t = [`group: ${p(e.name)}`];
1928
- return t.push(`descriptors: ${h(e.name)}`), t.push(`wsUrl: ${JSON.stringify(e.browserWsUrl)}`), e.hasAuthHeaders ? t.push(`headers: __voltroAuthHeaders?.[${JSON.stringify(e.name)}]?.authHeaders`) : e.headers && t.push(`headers: ${JSON.stringify(e.headers)}`), ` ${JSON.stringify(e.name)}: { ${t.join(", ")} },`;
1926
+ return t.push(`descriptors: ${m(e.name)}`), t.push(`wsUrl: ${JSON.stringify(e.browserWsUrl)}`), e.hasAuthHeaders ? t.push(`headers: __voltroAuthHeaders?.[${JSON.stringify(e.name)}]?.authHeaders`) : e.headers && t.push(`headers: ${JSON.stringify(e.headers)}`), ` ${JSON.stringify(e.name)}: { ${t.join(", ")} },`;
1929
1927
  }), v, y, b;
1930
1928
  if (u.length > 0) {
1931
1929
  let n = u.map((e) => ` ${JSON.stringify(e.pattern)}: () => import('../src/pages/${e.file}'),`), r = [];
@@ -1934,13 +1932,13 @@ import {
1934
1932
  e.hasLayout && e.hasLayoutLoader ? r.push(`import * as ${Q(e.dir, "Layout")}Mod from '${t}/layout.tsx'`) : e.hasLayout && r.push(`import ${Q(e.dir, "Layout")} from '${t}/layout.tsx'`), e.hasError && r.push(`import ${Q(e.dir, "Error")} from '${t}/error.tsx'`), e.hasPending && r.push(`import ${Q(e.dir, "Pending")} from '${t}/loading.tsx'`), e.hasNotFound && r.push(`import ${Q(e.dir, "NotFound")} from '${t}/not-found.tsx'`);
1935
1933
  }
1936
1934
  let i = u.map((e) => {
1937
- let t = Sr(d, e.dirChain).map((e) => {
1935
+ let t = xr(d, e.dirChain).map((e) => {
1938
1936
  let t = [`id: ${JSON.stringify(e.dir || "/")}`], n = JSON.stringify(e.dir);
1939
1937
  return e.hasLayout && t.push(`Layout: refs.layouts[${n}]`), e.hasLayoutLoader && t.push(`loader: refs.layoutLoaders[${n}]`), e.hasError && t.push(`Error: refs.errors[${n}]`), e.hasPending && t.push(`Pending: refs.pendings[${n}]`), ` { ${t.join(", ")} }`;
1940
1938
  }).join(",\n");
1941
1939
  return ` makePageRoute(${JSON.stringify(e.pattern)}, ${t.length > 0 ? `[\n${t},\n ]` : "undefined"}),`;
1942
1940
  }), a = d.filter((e) => e.hasNotFound).map((e) => {
1943
- let t = wr(e.chain), n = Sr(d, e.chain).map((e) => {
1941
+ let t = Cr(e.chain), n = xr(d, e.chain).map((e) => {
1944
1942
  let t = [`id: ${JSON.stringify(e.dir || "/")}`], n = JSON.stringify(e.dir);
1945
1943
  return e.hasLayout && t.push(`Layout: refs.layouts[${n}]`), e.hasError && t.push(`Error: refs.errors[${n}]`), ` { ${t.join(", ")} }`;
1946
1944
  }).join(",\n"), r = n.length > 0 ? `\n chain: [\n${n},\n ],` : "";
@@ -1978,8 +1976,8 @@ import {
1978
1976
  let h = s.map((e) => ` ${JSON.stringify(e.relPath)},`), x = s.map((e, t) => {
1979
1977
  let n = JSON.stringify(e.slotKey);
1980
1978
  return e.kind === "page" ? ` if (newMods[${t}] && refs.pages[${n}] !== undefined) { refs.pages[${n}] = newMods[${t}]; changed = true }` : ` if (newMods[${t}]?.default) { refs.${e.kind === "layout" ? "layouts" : e.kind === "error" ? "errors" : e.kind === "pending" ? "pendings" : "notFounds"}[${n}] = newMods[${t}].default;${e.kind === "layout" ? ` refs.layoutLoaders[${n}] = newMods[${t}].loader;` : ""} changed = true }`;
1981
- }), S = t.locales ?? [], w = S.length > 0 && S.every((t) => E(C(e, "src", "locales", `${t}.ts`)) || E(C(e, "src", "locales", `${t}.tsx`))), T = w, D = t.defaultLocale ?? S[0] ?? "en";
1982
- if (S.length > 0 && !w && Z.info(`i18n: locales [${S.join(", ")}] declared with no src/locales/<code>.ts — using them for <html lang> and the resolved locale only. Add the catalogs to get <I18nProvider> wired, or keep your own i18n stack.`), S.length > 0 && !S.includes(D)) throw Error(`[voltro dev] app.config.ts: defaultLocale '${D}' must be one of locales [${S.join(", ")}]`);
1979
+ }), S = t.locales ?? [], C = S.length > 0 && S.every((t) => D(w(e, "src", "locales", `${t}.ts`)) || D(w(e, "src", "locales", `${t}.tsx`))), T = C, E = t.defaultLocale ?? S[0] ?? "en";
1980
+ if (S.length > 0 && !C && Z.info(`i18n: locales [${S.join(", ")}] declared with no src/locales/<code>.ts — using them for <html lang> and the resolved locale only. Add the catalogs to get <I18nProvider> wired, or keep your own i18n stack.`), S.length > 0 && !S.includes(E)) throw Error(`[voltro dev] app.config.ts: defaultLocale '${E}' must be one of locales [${S.join(", ")}]`);
1983
1981
  let O = T ? [
1984
1982
  "import { I18nProvider } from '@voltro/i18n'",
1985
1983
  "import { resolveLocale } from '@voltro/i18n/server'",
@@ -2127,7 +2125,7 @@ import {
2127
2125
  ...S.map((e) => ` ${JSON.stringify(e)}: i18nCatalog_${e},`),
2128
2126
  "}",
2129
2127
  `const I18N_SUPPORTED: ReadonlyArray<string> = [${S.map((e) => JSON.stringify(e)).join(", ")}]`,
2130
- `const I18N_DEFAULT = ${JSON.stringify(D)}`,
2128
+ `const I18N_DEFAULT = ${JSON.stringify(E)}`,
2131
2129
  "",
2132
2130
  "const pickI18nLocale = (ssr: ReturnType<typeof useServerRequest>): string => {",
2133
2131
  " if (ssr) {",
@@ -2196,14 +2194,14 @@ import {
2196
2194
  "// resolved apis map. Side-effect only — no local component definitions —",
2197
2195
  "// so downstream invalidations (user page edits) terminate at app.tsx.",
2198
2196
  "",
2199
- ...pr(t),
2197
+ ...fr(t),
2200
2198
  "import { mount } from '@voltro/web'",
2201
2199
  ...g,
2202
2200
  "import { App } from './app'",
2203
2201
  "import { preloadCurrentRoute } from './routeTable'",
2202
+ ...ur(t),
2203
+ ...cr(t, o),
2204
2204
  ...dr(t),
2205
- ...lr(t, o),
2206
- ...fr(t),
2207
2205
  "",
2208
2206
  "// Preload the current route's page chunk BEFORE hydration so the first",
2209
2207
  "// client render matches the SSG/SSR-prerendered HTML. Without it, a lazy",
@@ -2220,10 +2218,10 @@ import {
2220
2218
  " apis: {",
2221
2219
  ..._,
2222
2220
  " },",
2223
- ...ur(t, o),
2221
+ ...lr(t, o),
2224
2222
  "})",
2225
2223
  "",
2226
- Tr
2224
+ wr
2227
2225
  ].join("\n");
2228
2226
  } else v = "", y = "", b = [
2229
2227
  "// GENERATED BY `voltro dev` — do not edit; will be overwritten on next boot.",
@@ -2231,43 +2229,43 @@ import {
2231
2229
  "// and calls mount(). Side-effect only, no component definitions, so the",
2232
2230
  "// user's component file remains the Fast Refresh boundary.",
2233
2231
  "",
2234
- ...pr(t),
2232
+ ...fr(t),
2235
2233
  "import { mount } from '@voltro/web'",
2236
2234
  ...g,
2237
2235
  "import App from '../src/App'",
2236
+ ...ur(t),
2237
+ ...cr(t, o),
2238
2238
  ...dr(t),
2239
- ...lr(t, o),
2240
- ...fr(t),
2241
2239
  "",
2242
2240
  "mount(App, {",
2243
2241
  " apis: {",
2244
2242
  ..._,
2245
2243
  " },",
2246
- ...ur(t, o),
2244
+ ...lr(t, o),
2247
2245
  "})",
2248
2246
  "",
2249
- Tr
2247
+ wr
2250
2248
  ].join("\n");
2251
- let x = C(e, ".framework");
2252
- await D.mkdir(x, { recursive: !0 }), t.env ? await J(x, r) : await D.rm(C(x, "env.public.ts"), { force: !0 }), await D.writeFile(C(x, "index.html"), c, "utf8"), await D.writeFile(C(x, "main.tsx"), b, "utf8"), v ? (await D.writeFile(C(x, "app.tsx"), v, "utf8"), await D.writeFile(C(x, "routeTable.ts"), y, "utf8")) : (await D.rm(C(x, "app.tsx"), { force: !0 }), await D.rm(C(x, "routeTable.ts"), { force: !0 }));
2253
- let S = C(e, ".gitignore"), w = "";
2249
+ let x = w(e, ".framework");
2250
+ await O.mkdir(x, { recursive: !0 }), t.env ? await _e(x, r) : await O.rm(w(x, "env.public.ts"), { force: !0 }), await O.writeFile(w(x, "index.html"), c, "utf8"), await O.writeFile(w(x, "main.tsx"), b, "utf8"), v ? (await O.writeFile(w(x, "app.tsx"), v, "utf8"), await O.writeFile(w(x, "routeTable.ts"), y, "utf8")) : (await O.rm(w(x, "app.tsx"), { force: !0 }), await O.rm(w(x, "routeTable.ts"), { force: !0 }));
2251
+ let S = w(e, ".gitignore"), C = "";
2254
2252
  try {
2255
- w = await D.readFile(S, "utf8");
2253
+ C = await O.readFile(S, "utf8");
2256
2254
  } catch {}
2257
- let T = ["/.framework/"], O = new Set(w.split("\n").map((e) => e.trim())), k = T.filter((e) => !O.has(e));
2255
+ let T = ["/.framework/"], E = new Set(C.split("\n").map((e) => e.trim())), k = T.filter((e) => !E.has(e));
2258
2256
  if (k.length > 0) {
2259
- let e = w === "" || w.endsWith("\n") ? "" : "\n";
2257
+ let e = C === "" || C.endsWith("\n") ? "" : "\n";
2260
2258
  try {
2261
- await D.appendFile(S, `${e}${k.join("\n")}\n`, "utf8");
2259
+ await O.appendFile(S, `${e}${k.join("\n")}\n`, "utf8");
2262
2260
  } catch (e) {
2263
2261
  Z.warn(`could not add ${k.join(", ")} to ${S} — add it by hand so the generated directory stays out of git. The build is unaffected.`, { reason: e?.message ?? String(e) });
2264
2262
  }
2265
2263
  }
2266
- }, Vr = async (e, t) => {
2264
+ }, Br = async (e, t) => {
2267
2265
  try {
2268
- let n = C(S(e), "project.json");
2269
- if (!E(n)) return;
2270
- let r = await D.readFile(n, "utf8"), i = JSON.parse(r).apps ?? {}, a = e.split("/").filter(Boolean).pop() ?? "", o = [];
2266
+ let n = w(C(e), "project.json");
2267
+ if (!D(n)) return;
2268
+ let r = await O.readFile(n, "utf8"), i = JSON.parse(r).apps ?? {}, a = e.split("/").filter(Boolean).pop() ?? "", o = [];
2271
2269
  for (let [e, n] of Object.entries(i)) e !== a && n.port === t && o.push(e);
2272
2270
  if (o.length === 0) return;
2273
2271
  Z.warn("sibling app(s) claim the same port — only one boots", {
@@ -2276,56 +2274,56 @@ import {
2276
2274
  projectJson: n
2277
2275
  });
2278
2276
  } catch {}
2279
- }, Hr = (e) => C(e, ".framework", "dist", "server", "appConfig.js"), Ur = async (e, t = {}) => {
2280
- let n = Hr(e), r = t.preferSource !== !0 && E(n) ? n : C(e, "app.config.ts");
2277
+ }, Vr = (e) => w(e, ".framework", "dist", "server", "appConfig.js"), Hr = async (e, t = {}) => {
2278
+ let n = Vr(e), r = t.preferSource !== !0 && D(n) ? n : w(e, "app.config.ts");
2281
2279
  try {
2282
- let e = (await import(P(r).href)).default;
2280
+ let e = (await import(F(r).href)).default;
2283
2281
  return typeof e == "object" && e && "type" in e && e.type === "web" ? e : null;
2284
2282
  } catch {
2285
2283
  return null;
2286
2284
  }
2287
- }, Wr = async (e) => {
2288
- let r = await Ur(e, { preferSource: !0 });
2289
- if (!r) return {
2285
+ }, Ur = async (e) => {
2286
+ let n = await Hr(e, { preferSource: !0 });
2287
+ if (!n) return {
2290
2288
  ran: !1,
2291
2289
  exitCode: 0
2292
2290
  };
2293
- on();
2294
- let i = bt();
2295
- Rt(i), Z.info("booting voltro dev (web)", { app: r.name ?? "(unnamed)" }), He(e, Z);
2296
- let m = await Pr(e, r);
2297
- for (let e of m) Z.info("api wired", {
2291
+ an();
2292
+ let i = yt();
2293
+ Lt(i), Z.info("booting voltro dev (web)", { app: n.name ?? "(unnamed)" }), Ve(e, Z);
2294
+ let a = await Nr(e, n);
2295
+ for (let e of a) Z.info("api wired", {
2298
2296
  name: e.name,
2299
2297
  pkg: e.pkg,
2300
2298
  ...e.proxyTarget ? { proxyTo: e.proxyTarget } : { directWs: e.browserWsUrl }
2301
2299
  });
2302
- d(e).then((e) => {
2300
+ f(e).then((e) => {
2303
2301
  for (let t of e.files) if (t.action === "created") {
2304
2302
  let e = t.path.split("/").pop() ?? t.path;
2305
2303
  Z.info(`${e} seeded`, { path: t.path });
2306
2304
  }
2307
2305
  }).catch(() => {});
2308
- let { resolved: h } = await _e({
2309
- rawEnv: r.env,
2306
+ let { resolved: h } = await ve({
2307
+ rawEnv: n.env,
2310
2308
  appType: "web",
2311
2309
  root: e,
2312
2310
  log: Z,
2313
2311
  generateTypes: !0
2314
- }), S = h.publicValues;
2315
- await Br(e, r, m, S), Z.debug("generated framework entry files", { files: [
2312
+ }), g = h.publicValues;
2313
+ await zr(e, n, a, g), Z.debug("generated framework entry files", { files: [
2316
2314
  "index.html",
2317
2315
  ".framework/main.tsx",
2318
- ...r.env ? [".framework/env.public.ts"] : []
2316
+ ...n.env ? [".framework/env.public.ts"] : []
2319
2317
  ] });
2320
- let O = n({
2318
+ let C = r({
2321
2319
  kind: "web",
2322
- configPort: r.port,
2320
+ configPort: n.port,
2323
2321
  env: process.env,
2324
- dashboardPin: process.env[Sn] === "1"
2322
+ dashboardPin: process.env[xn] === "1"
2325
2323
  });
2326
- for (let e of O.warnings) Z.warn(e);
2327
- let k = O.port, A = r.name ?? "unnamed", j = y("web", A, k), M = b(A);
2328
- await g({
2324
+ for (let e of C.warnings) Z.warn(e);
2325
+ let k = C.port, A = n.name ?? "unnamed", j = b("web", A, k), M = x(A);
2326
+ await _({
2329
2327
  id: j,
2330
2328
  name: A,
2331
2329
  kind: "web",
@@ -2333,22 +2331,22 @@ import {
2333
2331
  pid: process.pid,
2334
2332
  status: "booting",
2335
2333
  logFile: M.path
2336
- }).catch(() => {}), await Vr(e, k);
2337
- let { pages: N, dirs: P } = await $(C(e, "src", "pages")), F = {
2334
+ }).catch(() => {}), await Br(e, k);
2335
+ let { pages: N, dirs: P } = await $(w(e, "src", "pages")), F = {
2338
2336
  dirs: P,
2339
- ssrRoutes: Dr(N)
2337
+ ssrRoutes: Er(N)
2340
2338
  }, I = P.map((e) => ({
2341
2339
  dir: e.dir,
2342
2340
  hasLayout: e.hasLayout,
2343
2341
  hasError: e.hasError,
2344
2342
  hasPending: e.hasPending,
2345
2343
  hasNotFound: e.hasNotFound
2346
- })), R = await ft({
2344
+ })), L = await dt({
2347
2345
  appRoot: e,
2348
2346
  pages: N
2349
2347
  });
2350
- R.wrote && Z.debug("routes codegen wrote", { path: w(e, R.path) });
2351
- let ee = await fe("vite", () => import("vite")), z = (await import("@vitejs/plugin-react")).default, B = (await import("@tailwindcss/vite")).default, V = C(e, ".framework"), te = C(e, "src"), H = /* @__PURE__ */ new Set([
2348
+ L.wrote && Z.debug("routes codegen wrote", { path: T(e, L.path) });
2349
+ let ee = await pe("vite", () => import("vite")), z = (await import("@vitejs/plugin-react")).default, B = (await import("@tailwindcss/vite")).default, V = w(e, ".framework"), te = w(e, "src"), H = /* @__PURE__ */ new Set([
2352
2350
  ".framework",
2353
2351
  "node_modules",
2354
2352
  "dist",
@@ -2360,25 +2358,25 @@ import {
2360
2358
  name: "framework:watch-app-sources",
2361
2359
  async configureServer(t) {
2362
2360
  try {
2363
- let n = (await D.readdir(e, { withFileTypes: !0 })).filter((e) => e.isDirectory() && !H.has(e.name));
2364
- for (let r of n) t.watcher.add(C(e, r.name));
2361
+ let n = (await O.readdir(e, { withFileTypes: !0 })).filter((e) => e.isDirectory() && !H.has(e.name));
2362
+ for (let r of n) t.watcher.add(w(e, r.name));
2365
2363
  n.length === 0 && t.watcher.add(te);
2366
2364
  } catch {
2367
2365
  t.watcher.add(te);
2368
2366
  }
2369
- for (let n of await Se(e)) t.watcher.add(n.dir);
2367
+ for (let n of await Ce(e)) t.watcher.add(n.dir);
2370
2368
  }
2371
- }, U = C(e, "src", "pages"), W = (e) => e.endsWith(".tsx") && (e === U || e.startsWith(U + "/")), ie = (e) => e === U || e.startsWith(U + "/"), ae = async (t) => {
2369
+ }, U = w(e, "src", "pages"), re = (e) => e.endsWith(".tsx") && (e === U || e.startsWith(U + "/")), ie = (e) => e === U || e.startsWith(U + "/"), ae = async (t) => {
2372
2370
  try {
2373
- let n = Date.now();
2374
- await Br(e, r, m, S);
2375
- let { pages: i, dirs: a } = await $(U);
2376
- await ft({
2371
+ let r = Date.now();
2372
+ await zr(e, n, a, g);
2373
+ let { pages: i, dirs: o } = await $(U);
2374
+ await dt({
2377
2375
  appRoot: e,
2378
2376
  pages: i
2379
- }), F.dirs = a, F.ssrRoutes = Dr(i), Z.info("page tree regenerated", {
2377
+ }), F.dirs = o, F.ssrRoutes = Er(i), Z.info("page tree regenerated", {
2380
2378
  reason: t,
2381
- ms: Date.now() - n,
2379
+ ms: Date.now() - r,
2382
2380
  routes: F.ssrRoutes.length
2383
2381
  });
2384
2382
  } catch (e) {
@@ -2395,26 +2393,26 @@ import {
2395
2393
  }, 50);
2396
2394
  };
2397
2395
  t.watcher.on("add", (t) => {
2398
- W(t) && i(`add ${w(e, t)}`);
2396
+ re(t) && i(`add ${T(e, t)}`);
2399
2397
  }), t.watcher.on("unlink", (t) => {
2400
- W(t) && i(`unlink ${w(e, t)}`);
2398
+ re(t) && i(`unlink ${T(e, t)}`);
2401
2399
  }), t.watcher.on("addDir", (t) => {
2402
- ie(t) && i(`addDir ${w(e, t)}`);
2400
+ ie(t) && i(`addDir ${T(e, t)}`);
2403
2401
  }), t.watcher.on("unlinkDir", (t) => {
2404
- ie(t) && i(`unlinkDir ${w(e, t)}`);
2402
+ ie(t) && i(`unlinkDir ${T(e, t)}`);
2405
2403
  });
2406
2404
  }
2407
- }, G = C(e, "app.config.ts"), K = (e) => {
2408
- if (!re(e.env)) return "";
2405
+ }, G = w(e, "app.config.ts"), se = (e) => {
2406
+ if (!W(e.env)) return "";
2409
2407
  let t = Object.entries(e.env.vars).map(([e, t]) => `${e}:${t.access}`).sort();
2410
2408
  return `${String(e.env.publicPrefix)}|${t.join(",")}`;
2411
- }, le = (e, t) => {
2409
+ }, ce = (e, t) => {
2412
2410
  let n = [];
2413
- return e.port !== t.port && n.push(`port ${e.port ?? "(default)"} → ${t.port ?? "(default)"}`), JSON.stringify(e.proxies) !== JSON.stringify(t.proxies) && n.push("proxies"), JSON.stringify(e.allowedHosts) !== JSON.stringify(t.allowedHosts) && n.push("allowedHosts"), JSON.stringify(e.apis) !== JSON.stringify(t.apis) && n.push("apis"), K(e) !== K(t) && n.push("env"), n;
2414
- }, ue = r, de = T(G), pe = {
2411
+ return e.port !== t.port && n.push(`port ${e.port ?? "(default)"} → ${t.port ?? "(default)"}`), JSON.stringify(e.proxies) !== JSON.stringify(t.proxies) && n.push("proxies"), JSON.stringify(e.allowedHosts) !== JSON.stringify(t.allowedHosts) && n.push("allowedHosts"), JSON.stringify(e.apis) !== JSON.stringify(t.apis) && n.push("apis"), se(e) !== se(t) && n.push("env"), n;
2412
+ }, K = n, de = E(G), fe = {
2415
2413
  name: "framework:watch-app-config",
2416
2414
  async configureServer(n) {
2417
- n.watcher.add(G), Z.info("watching app.config.ts for changes", { path: w(e, G) });
2415
+ n.watcher.add(G), Z.info("watching app.config.ts for changes", { path: T(e, G) });
2418
2416
  let r = async () => {
2419
2417
  try {
2420
2418
  try {
@@ -2440,17 +2438,17 @@ import {
2440
2438
  theme: t.theme,
2441
2439
  port: t.port,
2442
2440
  name: t.name
2443
- }), JSON.stringify(t) === JSON.stringify(ue)) {
2441
+ }), JSON.stringify(t) === JSON.stringify(K)) {
2444
2442
  Z.info("app.config.ts onConfigChange: parsed config unchanged — skipping (no-op edit?)");
2445
2443
  return;
2446
2444
  }
2447
- let i = le(ue, t);
2445
+ let i = ce(K, t);
2448
2446
  if (i.length > 0) {
2449
2447
  Z.warn("app.config.ts changed — hard restart required", { fields: i });
2450
2448
  try {
2451
2449
  await n.close();
2452
2450
  } catch {}
2453
- let e = ce(process.execPath, [...process.execArgv, ...process.argv.slice(1)], {
2451
+ let e = ue(process.execPath, [...process.execArgv, ...process.argv.slice(1)], {
2454
2452
  stdio: "inherit",
2455
2453
  env: process.env,
2456
2454
  cwd: process.cwd()
@@ -2466,7 +2464,7 @@ import {
2466
2464
  }
2467
2465
  try {
2468
2466
  let r = Date.now();
2469
- await Br(e, t, await Pr(e, t)), ue = t, n.ws && n.ws.send({
2467
+ await zr(e, t, await Nr(e, t)), K = t, n.ws && n.ws.send({
2470
2468
  type: "full-reload",
2471
2469
  path: "*"
2472
2470
  }), Z.info("app.config.ts soft-regen", {
@@ -2476,7 +2474,7 @@ import {
2476
2474
  } catch (e) {
2477
2475
  Z.error("app.config.ts soft-regen failed", {}, e);
2478
2476
  }
2479
- }, s = (e) => x(e) === "app.config.ts" ? e === G || T(e) === de : !1;
2477
+ }, s = (e) => S(e) === "app.config.ts" ? e === G || E(e) === de : !1;
2480
2478
  n.watcher.on("change", (e) => {
2481
2479
  s(e) && (Z.info("app.config.ts change event (chokidar)", { file: e }), a());
2482
2480
  }), n.watcher.on("add", (e) => {
@@ -2490,7 +2488,7 @@ import {
2490
2488
  } catch (e) {
2491
2489
  Z.warn("app.config.ts polling watcher could not attach", {}, e);
2492
2490
  }
2493
- we(t, Z, {
2491
+ Te(t, Z, {
2494
2492
  root: e,
2495
2493
  onBeforeRestart: () => n.close()
2496
2494
  });
@@ -2504,13 +2502,13 @@ import {
2504
2502
  name: "framework:reoptimize-on-rpcgroup-change",
2505
2503
  async configureServer(t) {
2506
2504
  let n = /* @__PURE__ */ new Map();
2507
- for (let r of m) {
2505
+ for (let r of a) {
2508
2506
  if (!r.proxyTarget) continue;
2509
- let i = await kr(e, r.pkg);
2507
+ let i = await Or(e, r.pkg);
2510
2508
  if (!i) continue;
2511
- let a = C(i, "rpcGroup.generated.ts");
2509
+ let a = w(i, "rpcGroup.generated.ts");
2512
2510
  try {
2513
- n.set(a, await D.readFile(a, "utf8"));
2511
+ n.set(a, await O.readFile(a, "utf8"));
2514
2512
  } catch {
2515
2513
  n.set(a, "");
2516
2514
  }
@@ -2519,22 +2517,22 @@ import {
2519
2517
  } catch {}
2520
2518
  }
2521
2519
  if (n.size === 0) return;
2522
- let r = null, i = !1, a = async () => {
2520
+ let r = null, i = !1, o = async () => {
2523
2521
  if (i) return;
2524
2522
  let r = null;
2525
2523
  for (let [e, t] of n) {
2526
2524
  let i;
2527
2525
  try {
2528
- i = await D.readFile(e, "utf8");
2526
+ i = await O.readFile(e, "utf8");
2529
2527
  } catch {
2530
2528
  continue;
2531
2529
  }
2532
2530
  i !== t && (n.set(e, i), r = e);
2533
2531
  }
2534
2532
  if (r !== null) {
2535
- i = !0, Z.info(`rpcGroup changed (${w(e, r)}) — re-bundling the api client + reloading (descriptor edits propagate automatically; no manual restart needed)`);
2533
+ i = !0, Z.info(`rpcGroup changed (${T(e, r)}) — re-bundling the api client + reloading (descriptor edits propagate automatically; no manual restart needed)`);
2536
2534
  try {
2537
- await D.rm(C(V, ".vite", "deps"), {
2535
+ await O.rm(w(V, ".vite", "deps"), {
2538
2536
  recursive: !0,
2539
2537
  force: !0
2540
2538
  }), await t.restart(!0);
@@ -2542,24 +2540,24 @@ import {
2542
2540
  i = !1, Z.error("rpcGroup re-optimize failed", {}, e);
2543
2541
  }
2544
2542
  }
2545
- }, o = (e) => {
2546
- n.has(T(e)) && (r && clearTimeout(r), r = setTimeout(() => {
2547
- a();
2543
+ }, s = (e) => {
2544
+ n.has(E(e)) && (r && clearTimeout(r), r = setTimeout(() => {
2545
+ o();
2548
2546
  }, 120));
2549
2547
  };
2550
- t.watcher.on("change", o), t.watcher.on("add", o);
2548
+ t.watcher.on("change", s), t.watcher.on("add", s);
2551
2549
  }
2552
- }, J = {}, ve = (e) => (t) => {
2550
+ }, J = {}, _e = (e) => (t) => {
2553
2551
  t.on("proxyReq", (t, n) => {
2554
- rn(t, n, {
2552
+ nn(t, n, {
2555
2553
  target: e,
2556
2554
  token: process.env.VOLTRO_INSPECT_TOKEN,
2557
2555
  writeToken: process.env.VOLTRO_INSPECT_WRITE_TOKEN,
2558
- isLoopback: l
2556
+ isLoopback: u
2559
2557
  });
2560
2558
  });
2561
2559
  };
2562
- for (let e of m) {
2560
+ for (let e of a) {
2563
2561
  if (!e.proxyTarget) continue;
2564
2562
  J[e.browserWsUrl] = {
2565
2563
  target: e.proxyTarget,
@@ -2572,10 +2570,10 @@ import {
2572
2570
  target: t,
2573
2571
  changeOrigin: !0,
2574
2572
  rewrite: (t) => t.replace(RegExp(`^/_voltro/api/${e.name}`), ""),
2575
- configure: ve(t)
2573
+ configure: _e(t)
2576
2574
  };
2577
2575
  }
2578
- for (let [e, t] of Object.entries(r.proxies ?? {})) {
2576
+ for (let [e, t] of Object.entries(n.proxies ?? {})) {
2579
2577
  if (J[e]) {
2580
2578
  Z.warn("user proxy ignored — prefix already claimed by an api ws proxy", { prefix: e });
2581
2579
  continue;
@@ -2590,32 +2588,32 @@ import {
2590
2588
  ...t.rewrite === void 0 ? {} : { rewrite: t.rewrite }
2591
2589
  });
2592
2590
  }
2593
- let be = {
2591
+ let ye = {
2594
2592
  name: "framework:inspect",
2595
2593
  configureServer(t) {
2596
- let n = null, d = async () => {
2597
- if (n !== null) return n;
2598
- let r = [];
2599
- for (let n of N) try {
2600
- let i = await t.ssrLoadModule(C(e, "src", "pages", n.file));
2601
- r.push({
2602
- pattern: n.pattern,
2603
- file: n.file,
2604
- dirChain: n.dirChain,
2605
- renderMode: f(i, C("src", "pages", n.file)),
2594
+ let r = null, a = async () => {
2595
+ if (r !== null) return r;
2596
+ let n = [];
2597
+ for (let r of N) try {
2598
+ let i = await t.ssrLoadModule(w(e, "src", "pages", r.file));
2599
+ n.push({
2600
+ pattern: r.pattern,
2601
+ file: r.file,
2602
+ dirChain: r.dirChain,
2603
+ renderMode: p(i, w("src", "pages", r.file)),
2606
2604
  interactive: i.interactive ?? "full",
2607
2605
  tenantAware: i.tenantAware === !0,
2608
- revalidateMs: p(i.revalidate),
2609
- staleWhileRevalidateMs: p(i.staleWhileRevalidate) ?? 0,
2606
+ revalidateMs: m(i.revalidate),
2607
+ staleWhileRevalidateMs: m(i.staleWhileRevalidate) ?? 0,
2610
2608
  cacheInvalidatesOn: Array.isArray(i.cacheInvalidatesOn) ? i.cacheInvalidatesOn : [],
2611
2609
  hasLoader: typeof i.loader == "function",
2612
2610
  hasMeta: i.meta != null,
2613
2611
  hasGetStaticPaths: typeof i.getStaticPaths == "function"
2614
2612
  });
2615
2613
  } catch (e) {
2616
- Z.warn("inspect: failed to load page metadata", { pattern: n.pattern }, e);
2614
+ Z.warn("inspect: failed to load page metadata", { pattern: r.pattern }, e);
2617
2615
  }
2618
- return n = r, r;
2616
+ return r = n, n;
2619
2617
  };
2620
2618
  t.middlewares.use((e, t, n) => {
2621
2619
  let r = e.url ?? "/";
@@ -2633,10 +2631,10 @@ import {
2633
2631
  }), n();
2634
2632
  }), t.middlewares.use((t, n, r) => {
2635
2633
  if (t.method !== "GET" && t.method !== "HEAD") return r();
2636
- let { pathname: i } = zn(t.url ?? "/");
2637
- if (i !== "/robots.txt" || E(C(e, "public", "robots.txt"))) return r();
2638
- n.statusCode = 200, n.setHeader("Content-Type", "text/plain; charset=utf-8"), n.end(vt({ indexable: !1 }));
2639
- }), r.name === "voltroDashboard" && t.middlewares.use(async (e, t, n) => {
2634
+ let { pathname: i } = Rn(t.url ?? "/");
2635
+ if (i !== "/robots.txt" || D(w(e, "public", "robots.txt"))) return r();
2636
+ n.statusCode = 200, n.setHeader("Content-Type", "text/plain; charset=utf-8"), n.end(_t({ indexable: !1 }));
2637
+ }), n.name === "voltroDashboard" && t.middlewares.use(async (e, t, n) => {
2640
2638
  let r = e.url ?? "", i = r.split("?")[0];
2641
2639
  if (i === "/api/dashboard/proxy") {
2642
2640
  let n = new URL(r, "http://x").searchParams.get("target");
@@ -2644,13 +2642,13 @@ import {
2644
2642
  t.statusCode = 400, t.end("missing ?target=");
2645
2643
  return;
2646
2644
  }
2647
- if (!u(n)) {
2645
+ if (!d(n)) {
2648
2646
  t.statusCode = 400, t.end("target not allowed: must be loopback or an origin configured in VOLTRO_DASHBOARD_APPS");
2649
2647
  return;
2650
2648
  }
2651
2649
  try {
2652
2650
  let r = { accept: String(e.headers.accept ?? "application/json") };
2653
- e.headers.authorization ? r.authorization = String(e.headers.authorization) : l(n) && process.env.VOLTRO_INSPECT_TOKEN && (r.authorization = `Bearer ${process.env.VOLTRO_INSPECT_TOKEN}`);
2651
+ e.headers.authorization ? r.authorization = String(e.headers.authorization) : u(n) && process.env.VOLTRO_INSPECT_TOKEN && (r.authorization = `Bearer ${process.env.VOLTRO_INSPECT_TOKEN}`);
2654
2652
  let i;
2655
2653
  if (e.method && e.method !== "GET" && e.method !== "HEAD") {
2656
2654
  let t = [];
@@ -2677,7 +2675,7 @@ import {
2677
2675
  t.statusCode = 400, t.end("missing ?target=");
2678
2676
  return;
2679
2677
  }
2680
- if (!u(n)) {
2678
+ if (!d(n)) {
2681
2679
  t.statusCode = 400, t.end("target not allowed: must be loopback or an origin configured in VOLTRO_DASHBOARD_APPS");
2682
2680
  return;
2683
2681
  }
@@ -2689,7 +2687,7 @@ import {
2689
2687
  method: "GET",
2690
2688
  headers: {
2691
2689
  accept: "text/event-stream",
2692
- ...e.headers.authorization ? { authorization: String(e.headers.authorization) } : l(n) && process.env.VOLTRO_INSPECT_TOKEN ? { authorization: `Bearer ${process.env.VOLTRO_INSPECT_TOKEN}` } : {}
2690
+ ...e.headers.authorization ? { authorization: String(e.headers.authorization) } : u(n) && process.env.VOLTRO_INSPECT_TOKEN ? { authorization: `Bearer ${process.env.VOLTRO_INSPECT_TOKEN}` } : {}
2693
2691
  },
2694
2692
  signal: i.signal
2695
2693
  });
@@ -2719,22 +2717,22 @@ import {
2719
2717
  return;
2720
2718
  }
2721
2719
  n();
2722
- }), t.middlewares.use(async (e, t, n) => {
2723
- let l = e.url ?? "";
2724
- if (!l.startsWith("/_voltro/inspect")) return n();
2725
- let u = {};
2726
- for (let [t, n] of Object.entries(e.headers ?? {})) n !== void 0 && (u[String(t).toLowerCase()] = Array.isArray(n) ? n.join(", ") : String(n));
2727
- let f = l.split("?")[0];
2728
- if (e.method === "GET" && (f === "/_voltro/inspect/logs" || l.startsWith("/_voltro/inspect/logs?"))) {
2729
- let e = o(u.origin), n = Zt(l, Nt(), u);
2720
+ }), t.middlewares.use(async (e, t, r) => {
2721
+ let u = e.url ?? "";
2722
+ if (!u.startsWith("/_voltro/inspect")) return r();
2723
+ let d = {};
2724
+ for (let [t, n] of Object.entries(e.headers ?? {})) n !== void 0 && (d[String(t).toLowerCase()] = Array.isArray(n) ? n.join(", ") : String(n));
2725
+ let f = u.split("?")[0];
2726
+ if (e.method === "GET" && (f === "/_voltro/inspect/logs" || u.startsWith("/_voltro/inspect/logs?"))) {
2727
+ let e = s(d.origin), n = Xt(u, Mt(), d);
2730
2728
  t.statusCode = n.status, t.setHeader("content-type", n.contentType);
2731
2729
  for (let [n, r] of Object.entries(e)) t.setHeader(n, r);
2732
2730
  t.end(n.body);
2733
2731
  return;
2734
2732
  }
2735
2733
  if (e.method === "POST" && f === "/_voltro/inspect/clientLog") {
2736
- let n = o(u.origin);
2737
- if (a()) {
2734
+ let n = s(d.origin);
2735
+ if (o()) {
2738
2736
  t.statusCode = 503, t.setHeader("content-type", "application/json");
2739
2737
  for (let [e, r] of Object.entries(n)) t.setHeader(e, r);
2740
2738
  t.end(JSON.stringify({ error: "inspect disabled (VOLTRO_INSPECT=off)" }));
@@ -2744,7 +2742,7 @@ import {
2744
2742
  e.setEncoding("utf-8"), e.on("data", (e) => {
2745
2743
  r += e;
2746
2744
  }), e.on("end", () => {
2747
- let e = Gt(r, i);
2745
+ let e = Wt(r, i);
2748
2746
  t.statusCode = e.status, t.setHeader("content-type", e.contentType);
2749
2747
  for (let [e, r] of Object.entries(n)) t.setHeader(e, r);
2750
2748
  t.end(e.body);
@@ -2754,14 +2752,14 @@ import {
2754
2752
  return;
2755
2753
  }
2756
2754
  if (f === "/_voltro/inspect/stream") {
2757
- let n = o(u.origin);
2758
- if (a()) {
2755
+ let n = s(d.origin);
2756
+ if (o()) {
2759
2757
  t.statusCode = 503, t.setHeader("content-type", "application/json");
2760
2758
  for (let [e, r] of Object.entries(n)) t.setHeader(e, r);
2761
2759
  t.end(JSON.stringify({ error: "inspect disabled (VOLTRO_INSPECT=off)" }));
2762
2760
  return;
2763
2761
  }
2764
- let r = s(u, "GET");
2762
+ let r = c(d, "GET");
2765
2763
  if (!r.ok) {
2766
2764
  t.statusCode = 401, t.setHeader("content-type", "application/json");
2767
2765
  for (let [e, r] of Object.entries(n)) t.setHeader(e, r);
@@ -2774,31 +2772,31 @@ import {
2774
2772
  t.statusCode = 200, t.setHeader("content-type", "text/event-stream; charset=utf-8"), t.setHeader("cache-control", "no-cache, no-transform"), t.setHeader("connection", "keep-alive"), t.setHeader("x-accel-buffering", "no");
2775
2773
  for (let [e, r] of Object.entries(n)) t.setHeader(e, r);
2776
2774
  t.flushHeaders?.(), t.write("retry: 5000\n\n");
2777
- let c = l.indexOf("?");
2778
- if (!(c !== -1 && new URLSearchParams(l.slice(c + 1)).get("live") === "1")) for (let e of i.buffered()) t.write(xt(e));
2779
- let d = i.subscribe((e) => {
2775
+ let a = u.indexOf("?");
2776
+ if (!(a !== -1 && new URLSearchParams(u.slice(a + 1)).get("live") === "1")) for (let e of i.buffered()) t.write(bt(e));
2777
+ let l = i.subscribe((e) => {
2780
2778
  try {
2781
- t.write(xt(e));
2779
+ t.write(bt(e));
2782
2780
  } catch {}
2783
2781
  }), f = setInterval(() => {
2784
2782
  try {
2785
- t.write(St());
2783
+ t.write(xt());
2786
2784
  } catch {}
2787
2785
  }, 15e3), p = () => {
2788
- clearInterval(f), d();
2786
+ clearInterval(f), l();
2789
2787
  };
2790
2788
  e.on("close", p), t.on("close", p);
2791
2789
  return;
2792
2790
  }
2793
2791
  try {
2794
- let i = c(l, {
2792
+ let i = l(u, {
2795
2793
  kind: "web",
2796
2794
  meta: {
2797
- name: r.name ?? "(unnamed)",
2798
- voltroVersion: sr,
2795
+ name: n.name ?? "(unnamed)",
2796
+ voltroVersion: or,
2799
2797
  port: k,
2800
2798
  mode: "dev",
2801
- apis: Object.entries(r.apis ?? {}).map(([e, t]) => {
2799
+ apis: Object.entries(n.apis ?? {}).map(([e, t]) => {
2802
2800
  let n = {
2803
2801
  name: e,
2804
2802
  package: t.package
@@ -2806,16 +2804,16 @@ import {
2806
2804
  return t.url !== void 0 && (n.url = t.url), n;
2807
2805
  })
2808
2806
  },
2809
- routes: await d(),
2807
+ routes: await a(),
2810
2808
  dirs: I,
2811
2809
  cache: () => ({
2812
2810
  backend: "memory",
2813
2811
  size: 0,
2814
2812
  entries: []
2815
2813
  }),
2816
- env: () => ye(r.name ?? "app", { contract: re(r.env) ? r.env : void 0 })
2817
- }, u, { method: e.method ?? "GET" });
2818
- if (i === null) return n();
2814
+ env: () => be(n.name ?? "app", { contract: W(n.env) ? n.env : void 0 })
2815
+ }, d, { method: e.method ?? "GET" });
2816
+ if (i === null) return r();
2819
2817
  t.statusCode = i.status, t.setHeader("content-type", i.contentType);
2820
2818
  for (let [e, n] of Object.entries(i.headers ?? {})) t.setHeader(e, n);
2821
2819
  t.end(i.body);
@@ -2824,25 +2822,25 @@ import {
2824
2822
  }
2825
2823
  });
2826
2824
  }
2827
- }, xe = r.name === "voltroDashboard" ? {
2825
+ }, xe = n.name === "voltroDashboard" ? {
2828
2826
  name: "framework:dashboard-registry",
2829
2827
  configureServer(e) {
2830
2828
  e.middlewares.use(async (e, t, n) => {
2831
2829
  if (!(e.url ?? "").startsWith("/api/dashboard/registry")) return n();
2832
2830
  try {
2833
- let e = await _();
2831
+ let e = await v();
2834
2832
  t.statusCode = 200, t.setHeader("content-type", "application/json; charset=utf-8"), t.end(JSON.stringify(e));
2835
2833
  } catch (e) {
2836
2834
  t.statusCode = 500, t.setHeader("content-type", "text/plain"), t.end(`registry read error: ${e.message}`);
2837
2835
  }
2838
2836
  });
2839
2837
  }
2840
- } : null, Ce = /* @__PURE__ */ new Set(), Te = (e, t, n, r, i, a = !1) => {
2841
- let o = Kn(i, a, t) ?? "";
2838
+ } : null, Se = /* @__PURE__ */ new Set(), we = (e, t, n, r, i, a = !1) => {
2839
+ let o = Gn(i, a, t) ?? "";
2842
2840
  if (Z.error(`${t} render failed`, {
2843
2841
  pathname: n,
2844
2842
  pattern: r,
2845
- cause: wt(i) + o
2843
+ cause: Ct(i) + o
2846
2844
  }), e.headersSent) {
2847
2845
  e.end();
2848
2846
  return;
@@ -2853,8 +2851,8 @@ import {
2853
2851
  "x-voltro-ssr-generation": String(q)
2854
2852
  });
2855
2853
  let s = q === 0 ? "" : `\n[voltro] this process has absorbed ${q} hot update(s) since boot, so its SSR\nmodule graph may not match the files on disk. Before reporting this — to us or to\nyourself — restart \`voltro dev\` and measure once from a fresh boot.\n`;
2856
- e.end(`${t} render failed for ${n}\n\n${wt(i)}\n${o}\n${s}`);
2857
- }, Ee = et(), De = nt({
2854
+ e.end(`${t} render failed for ${n}\n\n${Ct(i)}\n${o}\n${s}`);
2855
+ }, Ee = $e(), De = tt({
2858
2856
  limit: Ee,
2859
2857
  onColdStart: (e) => Z.debug("ssr cold-compile start", { id: e }),
2860
2858
  onColdEnd: (e, { durationMs: t, failed: n }) => Z.debug(`ssr cold-compile ${n ? "FAILED" : "end"} ${t}ms`, {
@@ -2864,28 +2862,28 @@ import {
2864
2862
  })
2865
2863
  });
2866
2864
  Z.debug(`ssr cold-compile concurrency ${Ee}`, { concurrency: Ee });
2867
- let Oe = null, ke = async () => (Oe === null && (Oe = await D.readFile(C(e, ".framework", "index.html"), "utf8")), Oe), Ae = {
2865
+ let Oe = null, ke = async () => (Oe === null && (Oe = await O.readFile(w(e, ".framework", "index.html"), "utf8")), Oe), je = {
2868
2866
  name: "framework:ssr",
2869
2867
  configureServer(t) {
2870
- let n = (e) => De.load(e, async () => await t.ssrLoadModule(e)), i, a = !1, o = () => {
2868
+ let r = (e) => De.load(e, async () => await t.ssrLoadModule(e)), i, o = !1, s = () => {
2871
2869
  if (i !== void 0) return i;
2872
- let t = r.locales ?? [], o = r.defaultLocale ?? t[0] ?? "en";
2870
+ let t = n.locales ?? [], a = n.defaultLocale ?? t[0] ?? "en";
2873
2871
  return t.length === 0 ? (i = Promise.resolve(() => void 0), i) : (i = (async () => {
2874
- let [{ makeSsgWrap: r }, { makeSsrI18nResolver: i }] = await Promise.all([n("@voltro/i18n"), n("@voltro/i18n/server")]), s = {};
2875
- for (let i of t) if (E(C(e, "src", "locales", `${i}.ts`))) try {
2876
- let t = (await n(C(e, "src", "locales", `${i}.ts`))).default;
2877
- t !== void 0 && (s[i] = r(i, t, o));
2872
+ let [{ makeSsgWrap: n }, { makeSsrI18nResolver: i }] = await Promise.all([r("@voltro/i18n"), r("@voltro/i18n/server")]), s = {};
2873
+ for (let i of t) if (D(w(e, "src", "locales", `${i}.ts`))) try {
2874
+ let t = (await r(w(e, "src", "locales", `${i}.ts`))).default;
2875
+ t !== void 0 && (s[i] = n(i, t, a));
2878
2876
  } catch (e) {
2879
2877
  Z.warn("locale catalog failed to load for SSR", { locale: i }, e);
2880
2878
  }
2881
- if (a = Object.keys(s).length > 0, Object.keys(s).length === 0) {
2882
- let { resolveLocale: e } = await n("@voltro/i18n/server");
2879
+ if (o = Object.keys(s).length > 0, Object.keys(s).length === 0) {
2880
+ let { resolveLocale: e } = await r("@voltro/i18n/server");
2883
2881
  return (n, r) => ({
2884
2882
  locale: e({
2885
2883
  cookieHeader: n ?? null,
2886
2884
  acceptLanguageHeader: r ?? null,
2887
2885
  supported: t,
2888
- defaultLocale: o
2886
+ defaultLocale: a
2889
2887
  }),
2890
2888
  outerWrap: (e) => e
2891
2889
  });
@@ -2893,22 +2891,22 @@ import {
2893
2891
  return i({
2894
2892
  wraps: s,
2895
2893
  supported: t,
2896
- defaultLocale: o
2894
+ defaultLocale: a
2897
2895
  });
2898
2896
  })(), i);
2899
2897
  };
2900
- t.middlewares.use(async (i, s, c) => {
2901
- if (i.method !== "GET" && i.method !== "HEAD") return c();
2902
- let l = i.url ?? "/";
2903
- l.indexOf("?");
2904
- let { pathname: u, search: d } = zn(l);
2905
- if (u.startsWith("/@") || u.startsWith("/node_modules/") || u.startsWith("/.framework/") || u.startsWith("/_voltro/") || u === "/main.tsx" || u === "/index.html" || u === "/sw.js" || u === "/favicon.ico" || u === "/robots.txt" || /\.[a-z0-9]+$/i.test(u)) return c();
2906
- let p = Or(u, F.ssrRoutes);
2907
- if (!p) return c();
2908
- let h = !Ce.has(p.route.pattern), g = Date.now();
2909
- h && Z.info(`ssr compiling ${p.route.pattern}`, {
2910
- pattern: p.route.pattern,
2911
- pathname: u
2898
+ t.middlewares.use(async (i, c, l) => {
2899
+ if (i.method !== "GET" && i.method !== "HEAD") return l();
2900
+ let u = i.url ?? "/";
2901
+ u.indexOf("?");
2902
+ let { pathname: d, search: f } = Rn(u);
2903
+ if (d.startsWith("/@") || d.startsWith("/node_modules/") || d.startsWith("/.framework/") || d.startsWith("/_voltro/") || d === "/main.tsx" || d === "/index.html" || d === "/sw.js" || d === "/favicon.ico" || d === "/robots.txt" || /\.[a-z0-9]+$/i.test(d)) return l();
2904
+ let m = Dr(d, F.ssrRoutes);
2905
+ if (!m) return l();
2906
+ let h = !Se.has(m.route.pattern), g = Date.now();
2907
+ h && Z.info(`ssr compiling ${m.route.pattern}`, {
2908
+ pattern: m.route.pattern,
2909
+ pathname: d
2912
2910
  });
2913
2911
  let _ = {}, v = async (e, t) => {
2914
2912
  let n = Date.now(), r = await t();
@@ -2925,23 +2923,23 @@ import {
2925
2923
  }
2926
2924
  }, b = !1;
2927
2925
  try {
2928
- let x = await v("loadPage", async () => await n(C(e, "src", "pages", p.route.file))), S = f(x, C("src", "pages", p.route.file)), w = Sr(F.dirs, p.route.dirChain), T = S === "spa" && w.some((e) => e.hasLayout);
2929
- if (S !== "ssr" && S !== "isr" && !T) return c();
2926
+ let x = await v("loadPage", async () => await r(w(e, "src", "pages", m.route.file))), S = p(x, w("src", "pages", m.route.file)), C = xr(F.dirs, m.route.dirChain), T = S === "spa" && C.some((e) => e.hasLayout);
2927
+ if (S !== "ssr" && S !== "isr" && !T) return l();
2930
2928
  let E = {};
2931
2929
  for (let [e, t] of Object.entries(i.headers ?? {})) typeof t == "string" ? E[e] = t : Array.isArray(t) && (E[e] = t.join(", "));
2932
- let D = zr(Rr(m[0], { allowDevProxy: !0 }), E.cookie, { apiName: m[0]?.name }), O = new AbortController(), k = () => O.abort();
2933
- s.once("close", k);
2930
+ let D = Rr(Lr(a[0], { allowDevProxy: !0 }), E.cookie, { apiName: a[0]?.name }), O = new AbortController(), k = () => O.abort();
2931
+ c.once("close", k);
2934
2932
  let A = null, j = [], M = {};
2935
2933
  try {
2936
- (await n("@voltro/web/ssr")).beginStoreSeeds(), {chain: j, segmentLoaderData: M} = await v("loadChain", () => Cr({
2937
- entries: w,
2938
- loadLayout: (t) => n(C(e, "src", "pages", t.dir, "layout.tsx")),
2939
- loadError: (t) => n(C(e, "src", "pages", t.dir, "error.tsx")),
2940
- loadPending: (t) => n(C(e, "src", "pages", t.dir, "loading.tsx")),
2934
+ (await r("@voltro/web/ssr")).beginStoreSeeds(), {chain: j, segmentLoaderData: M} = await v("loadChain", () => Sr({
2935
+ entries: C,
2936
+ loadLayout: (t) => r(w(e, "src", "pages", t.dir, "layout.tsx")),
2937
+ loadError: (t) => r(w(e, "src", "pages", t.dir, "error.tsx")),
2938
+ loadPending: (t) => r(w(e, "src", "pages", t.dir, "loading.tsx")),
2941
2939
  ctx: {
2942
- params: p.params,
2943
- pathname: u,
2944
- search: d,
2940
+ params: m.params,
2941
+ pathname: d,
2942
+ search: f,
2945
2943
  signal: O.signal,
2946
2944
  headers: E,
2947
2945
  query: D
@@ -2949,31 +2947,31 @@ import {
2949
2947
  }));
2950
2948
  let t = x.loader;
2951
2949
  typeof t == "function" && !T && (A = await v("loader", () => t({
2952
- params: p.params,
2953
- pathname: u,
2954
- search: d,
2950
+ params: m.params,
2951
+ pathname: d,
2952
+ search: f,
2955
2953
  signal: O.signal,
2956
2954
  headers: E,
2957
2955
  query: D
2958
2956
  })));
2959
2957
  } finally {
2960
- s.off("close", k);
2958
+ c.off("close", k);
2961
2959
  }
2962
- let N = await v("loadSsrHelpers", async () => await n("@voltro/web/ssr"));
2963
- T || await ar({
2960
+ let N = await v("loadSsrHelpers", async () => await r("@voltro/web/ssr"));
2961
+ T || await ir({
2964
2962
  pageMod: x,
2965
- params: p.params,
2963
+ params: m.params,
2966
2964
  query: D,
2967
- apiName: m[0]?.name,
2965
+ apiName: a[0]?.name,
2968
2966
  seed: N.seedPreloadedSubscription,
2969
2967
  onError: ({ tag: e, apiName: t }, n) => Z.warn("preload seed failed", {
2970
2968
  tag: e,
2971
2969
  apiName: t,
2972
- pathname: u
2970
+ pathname: d
2973
2971
  }, n)
2974
2972
  });
2975
2973
  let P = {
2976
- pattern: p.route.pattern,
2974
+ pattern: m.route.pattern,
2977
2975
  Component: x.default,
2978
2976
  meta: x.meta,
2979
2977
  loader: x.loader,
@@ -2984,30 +2982,30 @@ import {
2984
2982
  }, I = {
2985
2983
  cookies: N.parseCookieHeader(E.cookie),
2986
2984
  headers: E,
2987
- url: l
2988
- }, L = x.interactive ?? "full", R = (await o())(E.cookie, E["accept-language"]);
2989
- b = R !== void 0 && a;
2985
+ url: u
2986
+ }, L = x.interactive ?? "full", R = (await s())(E.cookie, E["accept-language"]);
2987
+ b = R !== void 0 && o;
2990
2988
  let ee = R ? {
2991
2989
  outerWrap: R.outerWrap,
2992
2990
  locale: R.locale
2993
- } : {}, z = T ? In({
2991
+ } : {}, z = T ? Fn({
2994
2992
  helpers: N,
2995
- page: `src/pages/${p.route.file}`,
2993
+ page: `src/pages/${m.route.file}`,
2996
2994
  interactive: L,
2997
2995
  delivery: "stream",
2998
2996
  renderInput: {
2999
2997
  descriptor: P,
3000
- params: p.params,
3001
- pathname: u,
3002
- search: d,
2998
+ params: m.params,
2999
+ pathname: d,
3000
+ search: f,
3003
3001
  segmentLoaderData: M,
3004
3002
  requestContext: I,
3005
3003
  ...ee
3006
3004
  }
3007
- }) : null, B = T ? null : Fn({
3005
+ }) : null, B = T ? null : Pn({
3008
3006
  helpers: N,
3009
- page: `src/pages/${p.route.file}`,
3010
- pathname: u,
3007
+ page: `src/pages/${m.route.file}`,
3008
+ pathname: d,
3011
3009
  renderMode: S,
3012
3010
  interactive: L,
3013
3011
  loaderData: A,
@@ -3016,28 +3014,28 @@ import {
3016
3014
  }), V = [];
3017
3015
  await v("collectCss", async () => {
3018
3016
  let t = /* @__PURE__ */ new Set(), n = [
3019
- C(e, "src", "pages", p.route.file),
3020
- ...w.flatMap((t) => [
3021
- ...t.hasLayout ? [C(e, "src", "pages", t.dir, "layout.tsx")] : [],
3022
- ...t.hasError ? [C(e, "src", "pages", t.dir, "error.tsx")] : [],
3023
- ...t.hasPending ? [C(e, "src", "pages", t.dir, "loading.tsx")] : []
3017
+ w(e, "src", "pages", m.route.file),
3018
+ ...C.flatMap((t) => [
3019
+ ...t.hasLayout ? [w(e, "src", "pages", t.dir, "layout.tsx")] : [],
3020
+ ...t.hasError ? [w(e, "src", "pages", t.dir, "error.tsx")] : [],
3021
+ ...t.hasPending ? [w(e, "src", "pages", t.dir, "loading.tsx")] : []
3024
3022
  ]),
3025
- C(e, ".framework", "main.tsx")
3023
+ w(e, ".framework", "main.tsx")
3026
3024
  ];
3027
3025
  for (let e of n) await y(e, t, V);
3028
3026
  });
3029
- let te = await v("readShell", ke), H = await v("transformShell", () => t.transformIndexHtml(l, te)), ne = V.map((e) => `<link rel="stylesheet" href="${e}?direct" />`).join("\n "), U = R?.locale ?? I.cookies["voltro:locale"] ?? r.defaultLocale ?? (r.locales ?? [])[0] ?? "en", re = Date.now();
3027
+ let te = await v("readShell", ke), H = await v("transformShell", () => t.transformIndexHtml(u, te)), ne = V.map((e) => `<link rel="stylesheet" href="${e}?direct" />`).join("\n "), U = R?.locale ?? I.cookies["voltro:locale"] ?? n.defaultLocale ?? (n.locales ?? [])[0] ?? "en", re = Date.now();
3030
3028
  if (z) {
3031
- let e = (e) => Rn({
3029
+ let e = (e) => Ln({
3032
3030
  helpers: N,
3033
3031
  prepared: z,
3034
3032
  meta: e,
3035
3033
  interactive: L,
3036
3034
  extra: [ne]
3037
3035
  });
3038
- if (z.hasDeferred) nr({
3039
- res: s,
3040
- shell: $n({
3036
+ if (z.hasDeferred) tr({
3037
+ res: c,
3038
+ shell: Qn({
3041
3039
  shell: H,
3042
3040
  inlineModuleScriptsAsync: !0
3043
3041
  }),
@@ -3052,15 +3050,15 @@ import {
3052
3050
  ...e
3053
3051
  }),
3054
3052
  onShellError: (e) => {
3055
- Te(s, "spa-shell-dev", u, p.route.pattern, e, b);
3053
+ we(c, "spa-shell-dev", d, m.route.pattern, e, b);
3056
3054
  }
3057
3055
  });
3058
3056
  else {
3059
- let t = Ln({
3057
+ let t = In({
3060
3058
  helpers: N,
3061
3059
  prepared: z
3062
3060
  }), n = H.replace("<div id=\"root\"></div>", `<div id="root">${t.body}</div>`).replace("</head>", ` ${e(t.meta)}\n </head>`).replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${U}"`);
3063
- s.statusCode = 200, s.setHeader("content-type", "text/html; charset=utf-8"), s.setHeader("x-voltro-rendered-by", "spa-shell-dev"), s.end(n);
3061
+ c.statusCode = 200, c.setHeader("content-type", "text/html; charset=utf-8"), c.setHeader("x-voltro-rendered-by", "spa-shell-dev"), c.end(n);
3064
3062
  }
3065
3063
  } else if (B) {
3066
3064
  let e = (e) => [
@@ -3071,17 +3069,17 @@ import {
3071
3069
  N.renderRouterStateScript(B.stateInput)
3072
3070
  ].filter((e) => e.length > 0).join("\n "), t = {
3073
3071
  descriptor: P,
3074
- params: p.params,
3075
- pathname: u,
3076
- search: d,
3072
+ params: m.params,
3073
+ pathname: d,
3074
+ search: f,
3077
3075
  loaderData: B.loaderData,
3078
3076
  segmentLoaderData: B.segmentLoaderData,
3079
3077
  requestContext: I,
3080
3078
  ...ee
3081
3079
  };
3082
- if (S === "ssr" && L === "full") nr({
3083
- res: s,
3084
- shell: $n({
3080
+ if (S === "ssr" && L === "full") tr({
3081
+ res: c,
3082
+ shell: Qn({
3085
3083
  shell: H,
3086
3084
  inlineModuleScriptsAsync: !0
3087
3085
  }),
@@ -3096,71 +3094,71 @@ import {
3096
3094
  ...e
3097
3095
  }),
3098
3096
  onShellError: (e) => {
3099
- Te(s, "ssr-dev", u, p.route.pattern, e, b);
3097
+ we(c, "ssr-dev", d, m.route.pattern, e, b);
3100
3098
  }
3101
3099
  });
3102
3100
  else {
3103
3101
  let { html: n, meta: r } = N.renderPageToHtml(t), i = H.replace("<div id=\"root\"></div>", `<div id="root">${n}</div>`).replace("</head>", ` ${e(r)}\n </head>`).replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${U}"`);
3104
- s.statusCode = 200, s.setHeader("content-type", "text/html; charset=utf-8"), s.setHeader("x-voltro-rendered-by", "ssr-dev"), s.end(i);
3102
+ c.statusCode = 200, c.setHeader("content-type", "text/html; charset=utf-8"), c.setHeader("x-voltro-rendered-by", "ssr-dev"), c.end(i);
3105
3103
  }
3106
3104
  }
3107
3105
  _.render = Date.now() - re;
3108
3106
  let W = Date.now() - g;
3109
- h ? (Ce.add(p.route.pattern), Z.info(`ssr compiled ${p.route.pattern} in ${W}ms`, {
3110
- pattern: p.route.pattern,
3111
- pathname: u,
3107
+ h ? (Se.add(m.route.pattern), Z.info(`ssr compiled ${m.route.pattern} in ${W}ms`, {
3108
+ pattern: m.route.pattern,
3109
+ pathname: d,
3112
3110
  elapsedMs: W,
3113
3111
  cold: !0,
3114
3112
  phases: _
3115
- })) : W > 200 && Z.info(`ssr rendered ${u} in ${W}ms`, {
3116
- pattern: p.route.pattern,
3117
- pathname: u,
3113
+ })) : W > 200 && Z.info(`ssr rendered ${d} in ${W}ms`, {
3114
+ pattern: m.route.pattern,
3115
+ pathname: d,
3118
3116
  elapsedMs: W,
3119
3117
  cold: !1,
3120
3118
  phases: _
3121
3119
  });
3122
3120
  } catch (e) {
3123
- if (Nn(e)) {
3121
+ if (Mn(e)) {
3124
3122
  Z.error("ssr-dev render refused", {
3125
- pathname: u,
3126
- pattern: p.route.pattern
3127
- }, e), s.statusCode = 500, s.setHeader("content-type", "text/plain; charset=utf-8"), s.end(e.message);
3123
+ pathname: d,
3124
+ pattern: m.route.pattern
3125
+ }, e), c.statusCode = 500, c.setHeader("content-type", "text/plain; charset=utf-8"), c.end(e.message);
3128
3126
  return;
3129
3127
  }
3130
- let t = Pn(e);
3128
+ let t = Nn(e);
3131
3129
  if (t) {
3132
- s.statusCode = t.status;
3133
- for (let [e, n] of Object.entries(t.headers)) s.setHeader(e, String(n));
3134
- s.end(t.body);
3130
+ c.statusCode = t.status;
3131
+ for (let [e, n] of Object.entries(t.headers)) c.setHeader(e, String(n));
3132
+ c.end(t.body);
3135
3133
  return;
3136
3134
  }
3137
- Te(s, "ssr-dev", u, p.route.pattern, e, b);
3135
+ we(c, "ssr-dev", d, m.route.pattern, e, b);
3138
3136
  }
3139
3137
  });
3140
3138
  }
3141
- }, Me = Date.now(), Ne = ee.version ?? "?", Pe = await cr(), Fe = C(e, "node_modules", "@voltro", "ui-shadcn"), Y = E(C(Fe, "package.json")) ? Fe : null, Ie = [], Le = await (async () => {
3139
+ }, Me = Date.now(), Ne = ee.version ?? "?", Pe = await sr(), Fe = w(e, "node_modules", "@voltro", "ui-shadcn"), Y = D(w(Fe, "package.json")) ? Fe : null, Ie = [], Le = await (async () => {
3142
3140
  let t = [];
3143
- for (let n of m) {
3141
+ for (let n of a) {
3144
3142
  if (!n.proxyTarget) continue;
3145
- let r = await kr(e, n.pkg);
3143
+ let r = await Or(e, n.pkg);
3146
3144
  if (r) try {
3147
- t.push(await D.readFile(C(r, "rpcGroup.generated.ts"), "utf8"));
3145
+ t.push(await O.readFile(w(r, "rpcGroup.generated.ts"), "utf8"));
3148
3146
  } catch {}
3149
3147
  }
3150
3148
  if (t.length === 0) return !1;
3151
- let n = se("sha1").update(t.join("\0")).digest("hex"), r = C(V, ".voltro-rpcgroup-optimize"), i = "";
3149
+ let n = le("sha1").update(t.join("\0")).digest("hex"), r = w(V, ".voltro-rpcgroup-optimize"), i = "";
3152
3150
  try {
3153
- i = (await D.readFile(r, "utf8")).trim();
3151
+ i = (await O.readFile(r, "utf8")).trim();
3154
3152
  } catch {}
3155
3153
  if (i === n) return !1;
3156
3154
  try {
3157
- await D.writeFile(r, n);
3155
+ await O.writeFile(r, n);
3158
3156
  } catch {}
3159
3157
  return !0;
3160
3158
  })();
3161
3159
  Le && Z.info("rpcGroup changed since last boot — forcing a dep re-optimize so the browser loads the current api client");
3162
3160
  try {
3163
- await je(k, "voltro dev (web)");
3161
+ await Ae(k, "voltro dev (web)");
3164
3162
  } catch (e) {
3165
3163
  Z.error(String(e.message ?? e)), process.exit(1);
3166
3164
  }
@@ -3178,74 +3176,74 @@ import {
3178
3176
  alias: [
3179
3177
  ...Pe ? [{
3180
3178
  find: "@voltro/devtools/styles.css",
3181
- replacement: C(Pe, "src/styles.css")
3179
+ replacement: w(Pe, "src/styles.css")
3182
3180
  }, {
3183
3181
  find: "@voltro/devtools",
3184
- replacement: C(Pe, "src/index.ts")
3182
+ replacement: w(Pe, "src/index.ts")
3185
3183
  }] : [],
3186
3184
  ...Y ? [
3187
3185
  {
3188
3186
  find: "@voltro/ui-shadcn/tokens.css",
3189
- replacement: C(Y, "src/tokens.css")
3187
+ replacement: w(Y, "src/tokens.css")
3190
3188
  },
3191
3189
  {
3192
3190
  find: "@voltro/ui-shadcn/cn",
3193
- replacement: C(Y, "src/cn.ts")
3191
+ replacement: w(Y, "src/cn.ts")
3194
3192
  },
3195
3193
  {
3196
3194
  find: "@voltro/ui-shadcn/brand",
3197
- replacement: C(Y, "src/brand/voltroLogo.tsx")
3195
+ replacement: w(Y, "src/brand/voltroLogo.tsx")
3198
3196
  },
3199
3197
  {
3200
3198
  find: "@voltro/ui-shadcn",
3201
- replacement: C(Y, "src/index.ts")
3199
+ replacement: w(Y, "src/index.ts")
3202
3200
  }
3203
3201
  ] : [],
3204
- ...$e(e)
3202
+ ...Qe(e)
3205
3203
  ]
3206
3204
  },
3207
3205
  optimizeDeps: {
3208
- include: [...m.map((e) => `${e.pkg}/rpcGroup`), ...Ie],
3206
+ include: [...a.map((e) => `${e.pkg}/rpcGroup`), ...Ie],
3209
3207
  force: Le
3210
3208
  },
3211
- customLogger: Ze(),
3209
+ customLogger: Xe(),
3212
3210
  plugins: [
3213
- _n(C(e, "src", "pages")),
3211
+ gn(w(e, "src", "pages")),
3214
3212
  z(),
3215
3213
  B(),
3216
3214
  ne,
3217
3215
  oe,
3218
- pe,
3216
+ fe,
3219
3217
  he,
3220
3218
  ge,
3221
- be,
3222
- Ae,
3219
+ ye,
3220
+ je,
3223
3221
  ...xe ? [xe] : []
3224
3222
  ],
3225
3223
  server: {
3226
3224
  port: k,
3227
3225
  strictPort: !0,
3228
3226
  host: !0,
3229
- allowedHosts: r.allowedHosts === !0 || [...r.allowedHosts ?? []],
3227
+ allowedHosts: n.allowedHosts === !0 || [...n.allowedHosts ?? []],
3230
3228
  proxy: J,
3231
- fs: { allow: [e, ...mr(e)] }
3229
+ fs: { allow: [e, ...pr(e)] }
3232
3230
  },
3233
3231
  appType: "spa",
3234
- cacheDir: C(V, ".vite"),
3235
- publicDir: C(e, "public")
3236
- })).listen(), or.info(`v${Ne} ready in ${Date.now() - Me}ms`, {
3232
+ cacheDir: w(V, ".vite"),
3233
+ publicDir: w(e, "public")
3234
+ })).listen(), ar.info(`v${Ne} ready in ${Date.now() - Me}ms`, {
3237
3235
  version: Ne,
3238
3236
  bootMs: Date.now() - Me
3239
3237
  }), Z.info(`listening on http://localhost:${k}`, {
3240
3238
  port: k,
3241
- app: r.name ?? "(unnamed)"
3239
+ app: n.name ?? "(unnamed)"
3242
3240
  });
3243
- for (let e of m) e.proxyTarget && (Z.info(`proxy /ws/${e.name} → ${e.proxyTarget}`, {
3241
+ for (let e of a) e.proxyTarget && (Z.info(`proxy /ws/${e.name} → ${e.proxyTarget}`, {
3244
3242
  api: e.name,
3245
3243
  target: e.proxyTarget
3246
3244
  }), Z.info(`proxy /_voltro/api/${e.name} → ${e.proxyTarget.replace(/^ws/, "http")}/_voltro/inspect`, { api: e.name }));
3247
3245
  try {
3248
- await g({
3246
+ await _({
3249
3247
  id: j,
3250
3248
  name: A,
3251
3249
  kind: "web",
@@ -3254,13 +3252,13 @@ import {
3254
3252
  status: "live",
3255
3253
  logFile: M.path
3256
3254
  });
3257
- let t = xn(e);
3255
+ let t = bn(e);
3258
3256
  if (t) {
3259
- let e = await jn({ dashboardAppPath: t });
3257
+ let e = await An({ dashboardAppPath: t });
3260
3258
  e.status === "launched" ? Z.info(`dashboard launched at http://localhost:${e.port}`, { port: e.port }) : e.status === "already-running" && Z.debug(`dashboard already running on :${e.port}`, { port: e.port });
3261
3259
  }
3262
3260
  setInterval(() => {
3263
- g({
3261
+ _({
3264
3262
  id: j,
3265
3263
  name: A,
3266
3264
  kind: "web",
@@ -3271,50 +3269,50 @@ import {
3271
3269
  }).catch(() => {});
3272
3270
  }, 1e4).unref();
3273
3271
  let n = () => {
3274
- v(j), M.dispose();
3272
+ y(j), M.dispose();
3275
3273
  };
3276
3274
  process.on("SIGINT", n), process.on("SIGTERM", n);
3277
3275
  } catch (e) {
3278
3276
  Z.warn("runtime-registry write failed", {}, e);
3279
3277
  }
3280
- return L({
3281
- app: r.name ?? "unnamed",
3278
+ return R({
3279
+ app: n.name ?? "unnamed",
3282
3280
  kind: "web",
3283
3281
  url: `http://localhost:${k}`,
3284
3282
  bootMs: Date.now() - Me
3285
3283
  }), new Promise(() => {});
3286
- }, Gr = async (t) => {
3284
+ }, Wr = async (t) => {
3287
3285
  e("serve");
3288
- let r = await Ur(t);
3289
- if (!r) return {
3286
+ let n = await Hr(t);
3287
+ if (!n) return {
3290
3288
  ran: !1,
3291
3289
  exitCode: 0
3292
3290
  };
3293
3291
  let i = Date.now(), a = Z.child("serve");
3294
- a.info("booting voltro serve (preview)", { app: r.name ?? "(unnamed)" });
3295
- let o = await Pr(t, r);
3292
+ a.info("booting voltro serve (preview)", { app: n.name ?? "(unnamed)" });
3293
+ let o = await Nr(t, n);
3296
3294
  for (let e of o) a.info("api wired", {
3297
3295
  name: e.name,
3298
3296
  pkg: e.pkg
3299
3297
  });
3300
- await Br(t, r, o);
3298
+ await zr(t, n, o);
3301
3299
  {
3302
- let { pages: e } = await $(C(t, "src", "pages"));
3303
- await ft({
3300
+ let { pages: e } = await $(w(t, "src", "pages"));
3301
+ await dt({
3304
3302
  appRoot: t,
3305
3303
  pages: e
3306
3304
  });
3307
3305
  }
3308
- let s = n({
3306
+ let s = r({
3309
3307
  kind: "web",
3310
- configPort: r.port,
3308
+ configPort: n.port,
3311
3309
  env: process.env
3312
- }).port, c = await fe("vite", () => import("vite")), l = (await import("@vitejs/plugin-react")).default, u = C(t, ".framework");
3310
+ }).port, c = await pe("vite", () => import("vite")), l = (await import("@vitejs/plugin-react")).default, u = w(t, ".framework");
3313
3311
  Z.info("running production build"), await c.build({
3314
3312
  root: u,
3315
3313
  envPrefix: "__VOLTRO_VITE_ENV_DISABLED__",
3316
3314
  plugins: [l()],
3317
- customLogger: Ze(),
3315
+ customLogger: Xe(),
3318
3316
  resolve: { dedupe: [
3319
3317
  "react",
3320
3318
  "react-dom",
@@ -3323,9 +3321,9 @@ import {
3323
3321
  ] },
3324
3322
  build: {
3325
3323
  outDir: "dist",
3326
- rollupOptions: { output: { manualChunks: gr } }
3324
+ rollupOptions: { output: { manualChunks: hr } }
3327
3325
  },
3328
- publicDir: C(t, "public")
3326
+ publicDir: w(t, "public")
3329
3327
  });
3330
3328
  let d = (await c.preview({
3331
3329
  root: u,
@@ -3336,8 +3334,8 @@ import {
3336
3334
  label: "Local",
3337
3335
  url: e
3338
3336
  })) ?? [];
3339
- return L({
3340
- app: r.name ?? "unnamed",
3337
+ return R({
3338
+ app: n.name ?? "unnamed",
3341
3339
  kind: "preview",
3342
3340
  url: f,
3343
3341
  extras: p,
@@ -3345,4 +3343,4 @@ import {
3345
3343
  }), new Promise(() => {});
3346
3344
  };
3347
3345
  //#endregion
3348
- export { Ve as $, zn as A, Nt as B, $n as C, In as D, Fn as E, nn as F, _t as G, bt as H, Zt as I, et as J, ft as K, qt as L, bn as M, jn as N, Ln as O, xn as P, ze as Q, Gt as R, er as S, Nn as T, St as U, xt as V, vt as W, Re as X, $e as Y, Be as Z, Gr as _, Cr as a, ye as at, Br as b, br as c, ge as ct, Ur as d, He as et, Pr as f, Wr as g, Ir as h, zr as i, Se as it, Sn as j, Rn as k, Q as l, he as lt, Mr as m, Rr as n, Ee as nt, Hr as o, be as ot, jr as p, nt as q, Nr as r, we as rt, Sr as s, _e as st, _r as t, je as tt, xr as u, fe as ut, gr as v, nr as w, ar as x, $ as y, Rt as z };
3346
+ export { Be as $, Rn as A, Mt as B, Qn as C, Fn as D, Pn as E, tn as F, gt as G, yt as H, Xt as I, $e as J, dt as K, Kt as L, yn as M, An as N, In as O, bn as P, Re as Q, Wt as R, $n as S, Mn as T, xt as U, bt as V, _t as W, Le as X, Qe as Y, ze as Z, Wr as _, Sr as a, xe as at, zr as b, yr as c, ge as ct, Hr as d, Ve as et, Nr as f, Ur as g, Fr as h, Rr as i, be as it, xn as j, Ln as k, Q as l, pe as lt, jr as m, Lr as n, Te as nt, Vr as o, ve as ot, Ar as p, tt as q, Mr as r, Ce as rt, xr as s, J as st, gr as t, Ae as tt, br as u, hr as v, tr as w, ir as x, $ as y, Lt as z };