@farm.js/core 0.1.21 → 0.1.23

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 (156) hide show
  1. package/dist/agent-runtime.d.mts +3 -2
  2. package/dist/agent-runtime.d.ts +3 -2
  3. package/dist/api/route-manager.cjs +3 -2
  4. package/dist/api/route-manager.d.mts +3 -2
  5. package/dist/api/route-manager.d.ts +3 -2
  6. package/dist/api/route-manager.mjs +2 -1
  7. package/dist/api.cjs +4 -3
  8. package/dist/api.d.mts +4 -3
  9. package/dist/api.d.ts +4 -3
  10. package/dist/api.mjs +3 -2
  11. package/dist/{app-DAyPE-gr.d.ts → app-BV-7wV5q.d.ts} +10 -3
  12. package/dist/{app-D_6nTit-.d.mts → app-BZDWwwFa.d.mts} +10 -3
  13. package/dist/app-markdown.d.mts +4 -3
  14. package/dist/app-markdown.d.ts +4 -3
  15. package/dist/chunk-2VQKKQ6D.mjs +51 -0
  16. package/dist/{chunk-EGJDUF4Q.mjs → chunk-3ATMYLLJ.mjs} +6 -12
  17. package/dist/{chunk-HSDL2AUR.mjs → chunk-47H7VENP.mjs} +20 -32
  18. package/dist/{chunk-RWXZKZXB.cjs → chunk-4DKZ6JR3.cjs} +302 -339
  19. package/dist/{chunk-PUCUVI7K.mjs → chunk-72VJRKJD.mjs} +1 -1
  20. package/dist/{chunk-5L6NBNHI.mjs → chunk-7LU4IOXQ.mjs} +156 -193
  21. package/dist/{chunk-RMIJFZU3.mjs → chunk-BDJNP7AQ.mjs} +10 -14
  22. package/dist/{chunk-OLYK7EAK.mjs → chunk-DAATZTKJ.mjs} +14 -0
  23. package/dist/{chunk-YP5JZ4LF.cjs → chunk-DNLQMFER.cjs} +15 -19
  24. package/dist/{chunk-XFFQSD2F.cjs → chunk-DW34V5SM.cjs} +7 -7
  25. package/dist/{chunk-PKO4FCTL.mjs → chunk-EHUZ2MKO.mjs} +1 -1
  26. package/dist/{chunk-3NM6SRI6.mjs → chunk-F3VB7ONA.mjs} +10 -8
  27. package/dist/{chunk-L7ARWZYT.cjs → chunk-III667SJ.cjs} +496 -303
  28. package/dist/chunk-IK6LVLKC.cjs +51 -0
  29. package/dist/{chunk-B3WK4DTX.cjs → chunk-IMBMOEWT.cjs} +5 -1
  30. package/dist/{chunk-IILNZK5G.mjs → chunk-JHWOVJ3M.mjs} +46 -62
  31. package/dist/{chunk-TKNSDBBN.cjs → chunk-K3F2E6GS.cjs} +20 -1
  32. package/dist/{chunk-RTHIVJ2G.cjs → chunk-KCMTCM6I.cjs} +7 -8
  33. package/dist/{chunk-ZE6ONQ5R.cjs → chunk-LQIRVSBY.cjs} +30 -40
  34. package/dist/chunk-LYLEZIG3.cjs +73 -0
  35. package/dist/{chunk-NBAHDVOJ.cjs → chunk-LYM7HY34.cjs} +20 -32
  36. package/dist/{chunk-K6FNHVDR.cjs → chunk-MPEYMSCF.cjs} +6 -12
  37. package/dist/{chunk-TFAXUHWX.cjs → chunk-PSV6XKPO.cjs} +15 -1
  38. package/dist/{chunk-BHJUZ64B.cjs → chunk-QTBEAKCJ.cjs} +7 -7
  39. package/dist/{chunk-J6JRB2ER.mjs → chunk-S67OYZU7.mjs} +1 -1
  40. package/dist/chunk-SFGWNC43.mjs +97 -0
  41. package/dist/{chunk-AYJR42WX.cjs → chunk-UFDV5N3C.cjs} +2 -2
  42. package/dist/chunk-UYIHRDE4.cjs +97 -0
  43. package/dist/{chunk-Y4YMF2NQ.cjs → chunk-VPTDD5XF.cjs} +46 -62
  44. package/dist/{chunk-53G3OLTA.mjs → chunk-VPY755R2.mjs} +256 -63
  45. package/dist/{chunk-NRS46D4L.mjs → chunk-VVJCWBIE.mjs} +3 -3
  46. package/dist/{chunk-Q2TUENW2.cjs → chunk-VXCA7RZP.cjs} +1 -1
  47. package/dist/{chunk-CQHFU55R.mjs → chunk-WNUBR4CA.mjs} +5 -1
  48. package/dist/{chunk-CIAGU2X4.cjs → chunk-XSIRSMAS.cjs} +10 -8
  49. package/dist/{chunk-W7MZXRXM.mjs → chunk-YGMK6ESJ.mjs} +20 -30
  50. package/dist/chunk-YOZYCI6Z.mjs +73 -0
  51. package/dist/{chunk-HLCDYJY7.mjs → chunk-YQVSHTMR.mjs} +20 -1
  52. package/dist/{chunk-F5D4XEAS.mjs → chunk-ZZSRYEYU.mjs} +7 -8
  53. package/dist/{client-plugins-CWrhb1ir.d.mts → client-plugins-B_XzCegf.d.mts} +11 -9
  54. package/dist/{client-plugins-DPf0qZey.d.ts → client-plugins-CKsXQfXY.d.ts} +11 -9
  55. package/dist/client-plugins.d.mts +3 -2
  56. package/dist/client-plugins.d.ts +3 -2
  57. package/dist/client.d.mts +7 -6
  58. package/dist/client.d.ts +7 -6
  59. package/dist/config.d.mts +3 -2
  60. package/dist/config.d.ts +3 -2
  61. package/dist/{devtools-MTB5SA2B.mjs → devtools-OY4SNU3P.mjs} +5 -4
  62. package/dist/{devtools-R6MDDAZK.cjs → devtools-UHRSZ7VA.cjs} +6 -5
  63. package/dist/docs.cjs +10 -7
  64. package/dist/docs.mjs +9 -6
  65. package/dist/index.cjs +24 -21
  66. package/dist/index.d.mts +14 -13
  67. package/dist/index.d.ts +14 -13
  68. package/dist/index.mjs +19 -16
  69. package/dist/instrumentation.cjs +3 -2
  70. package/dist/instrumentation.mjs +2 -1
  71. package/dist/integrations.d.mts +3 -2
  72. package/dist/integrations.d.ts +3 -2
  73. package/dist/internal/app-markdown-runtime.d.mts +3 -2
  74. package/dist/internal/app-markdown-runtime.d.ts +3 -2
  75. package/dist/internal/build-runtime.cjs +18 -15
  76. package/dist/internal/build-runtime.d.mts +5 -4
  77. package/dist/internal/build-runtime.d.ts +5 -4
  78. package/dist/internal/build-runtime.mjs +17 -14
  79. package/dist/internal/cli-runtime.cjs +11 -8
  80. package/dist/internal/cli-runtime.mjs +10 -7
  81. package/dist/internal/client-error-overlay.cjs +4 -4
  82. package/dist/internal/client-error-overlay.mjs +1 -1
  83. package/dist/internal/compression-runtime.d.mts +3 -2
  84. package/dist/internal/compression-runtime.d.ts +3 -2
  85. package/dist/internal/config-runtime.cjs +6 -5
  86. package/dist/internal/config-runtime.d.mts +4 -3
  87. package/dist/internal/config-runtime.d.ts +4 -3
  88. package/dist/internal/config-runtime.mjs +5 -4
  89. package/dist/internal/metadata-image-runtime.cjs +3 -2
  90. package/dist/internal/metadata-image-runtime.mjs +2 -1
  91. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  92. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  93. package/dist/internal/production-runtime.d.mts +9 -8
  94. package/dist/internal/production-runtime.d.ts +9 -8
  95. package/dist/layers-4PNE2HOY.cjs +18 -0
  96. package/dist/{layers-CJKSJGLN.mjs → layers-BRQF5ETU.mjs} +2 -1
  97. package/dist/{manager-NPG43N46.mjs → manager-RT733VRK.mjs} +2 -2
  98. package/dist/{manager-G4B2IPYE.cjs → manager-XZ5TX7AO.cjs} +3 -3
  99. package/dist/{metadata-CO9fRyyJ.d.mts → metadata-B08w4EYV.d.mts} +1 -1
  100. package/dist/{metadata-zY9wltwH.d.ts → metadata-IQEblkZp.d.ts} +1 -1
  101. package/dist/middleware.d.mts +5 -4
  102. package/dist/middleware.d.ts +5 -4
  103. package/dist/navigation.d.mts +6 -5
  104. package/dist/navigation.d.ts +6 -5
  105. package/dist/{nitro-TSGDUJMN.cjs → nitro-KQDU7CFE.cjs} +2 -2
  106. package/dist/{nitro-4LFVTT24.mjs → nitro-ZKLGOTVY.mjs} +1 -1
  107. package/dist/node-module-bundle-L5L7JCZ4.mjs +11 -0
  108. package/dist/node-module-bundle-VAFZOXMJ.cjs +11 -0
  109. package/dist/plugin.cjs +12 -10
  110. package/dist/plugin.d.mts +3 -2
  111. package/dist/plugin.d.ts +3 -2
  112. package/dist/plugin.mjs +11 -9
  113. package/dist/{production-runtime-CywsHwnG.d.mts → production-runtime-C3bGFEaM.d.mts} +1 -1
  114. package/dist/{production-runtime-lkfwujwK.d.ts → production-runtime-DRSOkc-d.d.ts} +1 -1
  115. package/dist/{render-plan-LVy6sGQe.d.mts → render-plan-B6CKNl4e.d.mts} +1 -1
  116. package/dist/{render-plan-DHF0GeWo.d.ts → render-plan-CCFuMLNS.d.ts} +1 -1
  117. package/dist/renderer-client.d.mts +5 -4
  118. package/dist/renderer-client.d.ts +5 -4
  119. package/dist/renderer.cjs +4 -2
  120. package/dist/renderer.d.mts +9 -1
  121. package/dist/renderer.d.ts +9 -1
  122. package/dist/renderer.mjs +3 -1
  123. package/dist/{request-6AkmhEYE.d.mts → request-DgD1XsTx.d.mts} +1 -1
  124. package/dist/{request-BYxlRqA9.d.ts → request-Dn6VURbE.d.ts} +1 -1
  125. package/dist/request.d.mts +4 -3
  126. package/dist/request.d.ts +4 -3
  127. package/dist/{route-rendering-Dd8Jmml7.d.mts → route-rendering-76A5I_kE.d.mts} +1 -1
  128. package/dist/{route-rendering-CWaKiUbS.d.ts → route-rendering-LAmQEdyG.d.ts} +1 -1
  129. package/dist/{router-B2m4fvve.d.ts → router-BSOOGya2.d.ts} +1 -1
  130. package/dist/{router-xwEE112q.d.mts → router-CnrRSa9d.d.mts} +1 -1
  131. package/dist/routes.d.mts +3 -2
  132. package/dist/routes.d.ts +3 -2
  133. package/dist/server-plugins.d.mts +4 -3
  134. package/dist/server-plugins.d.ts +4 -3
  135. package/dist/server.cjs +43 -36
  136. package/dist/server.d.mts +9 -8
  137. package/dist/server.d.ts +9 -8
  138. package/dist/server.mjs +27 -20
  139. package/dist/{spa-router-Y8rrXTVK.d.ts → spa-router-BMrSsG5b.d.ts} +2 -2
  140. package/dist/{spa-router-DVEHQnWo.d.mts → spa-router-DnYhWCvI.d.mts} +2 -2
  141. package/dist/testing.cjs +2 -1
  142. package/dist/testing.d.mts +3 -2
  143. package/dist/testing.d.ts +3 -2
  144. package/dist/testing.mjs +2 -1
  145. package/dist/{utils-DSPx34-A.d.mts → utils-ABkktwku.d.mts} +1 -1
  146. package/dist/{utils-Dvuny_08.d.ts → utils-C3GguS-Q.d.ts} +1 -1
  147. package/dist/version.cjs +2 -2
  148. package/dist/version.mjs +1 -1
  149. package/dist/vite.cjs +12 -10
  150. package/dist/vite.d.mts +3 -2
  151. package/dist/vite.d.ts +3 -2
  152. package/dist/vite.mjs +11 -9
  153. package/dist/workflows.cjs +2 -2
  154. package/dist/workflows.mjs +1 -1
  155. package/package.json +27 -13
  156. package/dist/layers-E4WPJNY5.cjs +0 -17
@@ -7,7 +7,7 @@ var _chunkMT763TDWcjs = require('./chunk-MT763TDW.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkZE6ONQ5Rcjs = require('./chunk-ZE6ONQ5R.cjs');
10
+ var _chunkLQIRVSBYcjs = require('./chunk-LQIRVSBY.cjs');
11
11
 
12
12
 
13
13
 
@@ -17,7 +17,7 @@ var _chunkZE6ONQ5Rcjs = require('./chunk-ZE6ONQ5R.cjs');
17
17
 
18
18
 
19
19
 
20
- var _chunkNBAHDVOJcjs = require('./chunk-NBAHDVOJ.cjs');
20
+ var _chunkLYM7HY34cjs = require('./chunk-LYM7HY34.cjs');
21
21
 
22
22
 
23
23
 
@@ -28,13 +28,16 @@ var _chunkMWWVKDW3cjs = require('./chunk-MWWVKDW3.cjs');
28
28
  var _chunkYA6LLTIJcjs = require('./chunk-YA6LLTIJ.cjs');
29
29
 
30
30
 
31
+ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
31
32
 
32
33
 
33
34
 
34
- var _chunkYP5JZ4LFcjs = require('./chunk-YP5JZ4LF.cjs');
35
35
 
36
36
 
37
- var _chunkRTHIVJ2Gcjs = require('./chunk-RTHIVJ2G.cjs');
37
+ var _chunkDNLQMFERcjs = require('./chunk-DNLQMFER.cjs');
38
+
39
+
40
+ var _chunkKCMTCM6Icjs = require('./chunk-KCMTCM6I.cjs');
38
41
 
39
42
 
40
43
  var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
@@ -63,13 +66,16 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
63
66
 
64
67
 
65
68
 
66
- var _chunkL7ARWZYTcjs = require('./chunk-L7ARWZYT.cjs');
69
+
70
+
71
+
72
+ var _chunkIII667SJcjs = require('./chunk-III667SJ.cjs');
67
73
 
68
74
 
69
75
 
70
76
 
71
77
 
72
- var _chunkXFFQSD2Fcjs = require('./chunk-XFFQSD2F.cjs');
78
+ var _chunkDW34V5SMcjs = require('./chunk-DW34V5SM.cjs');
73
79
 
74
80
 
75
81
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
@@ -89,7 +95,7 @@ var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
89
95
  var _chunkQ5B3KJBPcjs = require('./chunk-Q5B3KJBP.cjs');
90
96
 
91
97
 
92
- var _chunkY4YMF2NQcjs = require('./chunk-Y4YMF2NQ.cjs');
98
+ var _chunkVPTDD5XFcjs = require('./chunk-VPTDD5XF.cjs');
93
99
 
94
100
 
95
101
 
@@ -97,7 +103,8 @@ var _chunkY4YMF2NQcjs = require('./chunk-Y4YMF2NQ.cjs');
97
103
 
98
104
 
99
105
 
100
- var _chunkTFAXUHWXcjs = require('./chunk-TFAXUHWX.cjs');
106
+
107
+ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
101
108
 
102
109
 
103
110
  var _chunkISTFC3MZcjs = require('./chunk-ISTFC3MZ.cjs');
@@ -120,7 +127,7 @@ var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
120
127
 
121
128
 
122
129
 
123
- var _chunkK6FNHVDRcjs = require('./chunk-K6FNHVDR.cjs');
130
+ var _chunkMPEYMSCFcjs = require('./chunk-MPEYMSCF.cjs');
124
131
 
125
132
 
126
133
 
@@ -130,12 +137,15 @@ var _chunkZ5HIWVDPcjs = require('./chunk-Z5HIWVDP.cjs');
130
137
  var _chunkWM6HL7E7cjs = require('./chunk-WM6HL7E7.cjs');
131
138
 
132
139
 
133
- var _chunkB3WK4DTXcjs = require('./chunk-B3WK4DTX.cjs');
140
+ var _chunkIMBMOEWTcjs = require('./chunk-IMBMOEWT.cjs');
134
141
 
135
142
 
136
143
  var _chunkIQXFRNY2cjs = require('./chunk-IQXFRNY2.cjs');
137
144
 
138
145
 
146
+ var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
147
+
148
+
139
149
 
140
150
  var _chunkWPYFSQKKcjs = require('./chunk-WPYFSQKK.cjs');
141
151
 
@@ -261,7 +271,7 @@ function getDocsTitle(docs) {
261
271
  }
262
272
  _chunkS3JO3N4Hcjs.__name.call(void 0, getDocsTitle, "getDocsTitle");
263
273
  function loadPages(contentDir, docs) {
264
- return _chunkNBAHDVOJcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkNBAHDVOJcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
274
+ return _chunkLYM7HY34cjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkLYM7HY34cjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
265
275
  }
266
276
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadPages, "loadPages");
267
277
  function findSocialImagePath(html) {
@@ -282,14 +292,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
282
292
  }
283
293
  _chunkS3JO3N4Hcjs.__name.call(void 0, addHandlerRoute, "addHandlerRoute");
284
294
  async function compileFarmDocsManifest(docs, options) {
285
- const contentDir = _chunkNBAHDVOJcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
295
+ const contentDir = _chunkLYM7HY34cjs.resolveFarmDocsContentDir.call(void 0, docs, options);
286
296
  const pages = loadPages(contentDir, docs);
287
297
  const absolutePaths = [
288
298
  _path2.default.resolve(options.root),
289
299
  _path2.default.resolve(contentDir),
290
300
  docs.configPath || ""
291
301
  ];
292
- const handler = _chunkNBAHDVOJcjs.createFarmDocsHandler.call(void 0, docs, {
302
+ const handler = _chunkLYM7HY34cjs.createFarmDocsHandler.call(void 0, docs, {
293
303
  root: options.root,
294
304
  srcDir: options.srcDir,
295
305
  clientEntry: options.clientEntry,
@@ -297,7 +307,7 @@ async function compileFarmDocsManifest(docs, options) {
297
307
  fontStylesheetHref: options.fontStylesheetHref,
298
308
  globalStylesheetHref: options.globalStylesheetHref
299
309
  });
300
- const apiHandler = _chunkZE6ONQ5Rcjs.createFarmDocsAPIHandler.call(void 0, {
310
+ const apiHandler = _chunkLQIRVSBYcjs.createFarmDocsAPIHandler.call(void 0, {
301
311
  rootDir: options.root,
302
312
  srcDir: options.srcDir,
303
313
  docs
@@ -389,7 +399,7 @@ async function compileFarmDocsManifest(docs, options) {
389
399
  post: await compileResponse(postResponse, absolutePaths),
390
400
  search: {
391
401
  pages: pages.map((page) => ({
392
- ..._chunkNBAHDVOJcjs.toFarmDocsMarkdownPage.call(void 0, page),
402
+ ..._chunkLYM7HY34cjs.toFarmDocsMarkdownPage.call(void 0, page),
393
403
  sourcePath: `farm-docs:${page.slug || "index"}`
394
404
  })),
395
405
  search: _nullishCoalesce(searchConfig, () => ( true)),
@@ -409,7 +419,7 @@ async function createFarmRouteRuntimeManifest(options) {
409
419
  const routes = [];
410
420
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
411
421
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
412
- const rendering = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
422
+ const rendering = await _chunkDW34V5SMcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
413
423
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
414
424
  routes.push({
415
425
  kind: "page",
@@ -955,52 +965,6 @@ export default {};
955
965
  }
956
966
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmNodeServerEntry, "createFarmNodeServerEntry");
957
967
 
958
- // src/build/vite-plugin-compat.ts
959
- function adaptTailwindVitePlugin(pluginOption, builder) {
960
- if (builder !== "rolldown") return pluginOption;
961
- return adaptPluginOption(pluginOption);
962
- }
963
- _chunkS3JO3N4Hcjs.__name.call(void 0, adaptTailwindVitePlugin, "adaptTailwindVitePlugin");
964
- function adaptPluginOption(pluginOption) {
965
- if (Array.isArray(pluginOption)) return pluginOption.map(adaptPluginOption);
966
- if (!pluginOption || typeof pluginOption !== "object") return pluginOption;
967
- const plugin = pluginOption;
968
- if (!_optionalChain([plugin, 'access', _11 => _11.name, 'optionalAccess', _12 => _12.startsWith, 'call', _13 => _13("@tailwindcss/vite:generate:")])) return pluginOption;
969
- if (isVitePluginHook(plugin.transform)) {
970
- return {
971
- ...plugin,
972
- transform: withVite5TransformContext(plugin.transform)
973
- };
974
- }
975
- if (plugin.transform && typeof plugin.transform === "object" && "handler" in plugin.transform && isVitePluginHook(plugin.transform.handler)) {
976
- return {
977
- ...plugin,
978
- transform: {
979
- ...plugin.transform,
980
- handler: withVite5TransformContext(plugin.transform.handler)
981
- }
982
- };
983
- }
984
- return pluginOption;
985
- }
986
- _chunkS3JO3N4Hcjs.__name.call(void 0, adaptPluginOption, "adaptPluginOption");
987
- function isVitePluginHook(value) {
988
- return typeof value === "function";
989
- }
990
- _chunkS3JO3N4Hcjs.__name.call(void 0, isVitePluginHook, "isVitePluginHook");
991
- function withVite5TransformContext(handler) {
992
- return function(...args) {
993
- const context = new Proxy(this, {
994
- get(target, property, receiver) {
995
- if (property === "environment") return void 0;
996
- return Reflect.get(target, property, receiver);
997
- }
998
- });
999
- return handler.apply(context, args);
1000
- };
1001
- }
1002
- _chunkS3JO3N4Hcjs.__name.call(void 0, withVite5TransformContext, "withVite5TransformContext");
1003
-
1004
968
  // src/nitro/universal-build.ts
1005
969
  function preloadFarmNitroBuilder() {
1006
970
  return import("nitro/builder").then(
@@ -1118,6 +1082,9 @@ var NITRO_EXTERNAL_MODULES = /* @__PURE__ */ new Set([
1118
1082
  "fsevents",
1119
1083
  "esbuild",
1120
1084
  "lightningcss",
1085
+ "rolldown",
1086
+ "rolldown/experimental",
1087
+ "rolldown/utils",
1121
1088
  "rollup",
1122
1089
  "vite",
1123
1090
  "nitro",
@@ -1147,7 +1114,7 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
1147
1114
  return {
1148
1115
  name: "farm-prerender-runtime-resolver",
1149
1116
  async resolveId(id, _importer, options) {
1150
- if (_optionalChain([options, 'access', _14 => _14.custom, 'optionalAccess', _15 => _15.farmPrerenderRuntimeResolve])) return null;
1117
+ if (_optionalChain([options, 'access', _11 => _11.custom, 'optionalAccess', _12 => _12.farmPrerenderRuntimeResolve])) return null;
1151
1118
  if (id.startsWith("\0") || id.startsWith(".") || id.startsWith("#") || id.startsWith("virtual:") || _path2.default.isAbsolute(id) || NODE_BUILTIN_MODULES.has(id)) {
1152
1119
  return null;
1153
1120
  }
@@ -1252,7 +1219,7 @@ function hasReactDomEdgeServerBuild(root) {
1252
1219
  }
1253
1220
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasReactDomEdgeServerBuild, "hasReactDomEdgeServerBuild");
1254
1221
  function shouldAliasReactServerToWebBuild(renderer, preset) {
1255
- return _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
1222
+ return _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
1256
1223
  }
1257
1224
  _chunkS3JO3N4Hcjs.__name.call(void 0, shouldAliasReactServerToWebBuild, "shouldAliasReactServerToWebBuild");
1258
1225
  function isCloudflareImagePreset(preset) {
@@ -1285,7 +1252,7 @@ function createMetadataImageWasmPlugin() {
1285
1252
  return {
1286
1253
  name: "farm-metadata-image-wasm",
1287
1254
  resolveId(source, importer) {
1288
- if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _16 => _16.replace, 'call', _17 => _17(/\\/g, "/"), 'access', _18 => _18.includes, 'call', _19 => _19("/@vercel/og/")])) {
1255
+ if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _13 => _13.replace, 'call', _14 => _14(/\\/g, "/"), 'access', _15 => _15.includes, 'call', _16 => _16("/@vercel/og/")])) {
1289
1256
  return null;
1290
1257
  }
1291
1258
  const requestPath = source.slice(0, -"?module".length);
@@ -1358,75 +1325,76 @@ function hasFarmRuntimeConfigModule(config, configModulePath) {
1358
1325
  return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
1359
1326
  }
1360
1327
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmRuntimeConfigModule, "hasFarmRuntimeConfigModule");
1361
- function createEsbuildTransformOptions(configuredEsbuildOptions, minify, defaultTarget) {
1362
- const {
1363
- include: _include,
1364
- exclude: _exclude,
1365
- sourceMap: _sourceMap,
1366
- loaders: _loaders,
1367
- ...configuredTransformOptions
1368
- } = configuredEsbuildOptions;
1369
- const configuredTarget = Array.isArray(configuredTransformOptions.target) ? configuredTransformOptions.target.filter(
1370
- (target) => typeof target === "string"
1371
- ) : configuredTransformOptions.target;
1372
- const transformTarget = Array.isArray(configuredTarget) && configuredTarget.length === 0 ? defaultTarget : _nullishCoalesce(configuredTarget, () => ( defaultTarget));
1373
- const transformSupported = configuredTransformOptions.supported ? Object.fromEntries(
1374
- Object.entries(configuredTransformOptions.supported).filter(
1375
- (entry) => typeof entry[1] === "boolean"
1376
- )
1377
- ) : void 0;
1378
- return {
1379
- ...configuredTransformOptions,
1380
- format: "esm",
1381
- target: transformTarget,
1382
- loader: "js",
1383
- sourcemap: false,
1384
- minify,
1385
- keepNames: _nullishCoalesce(configuredTransformOptions.keepNames, () => ( true)),
1386
- legalComments: _nullishCoalesce(configuredTransformOptions.legalComments, () => ( "none")),
1387
- supported: transformSupported
1388
- };
1328
+ async function minifyFarmServerChunk(code, fileName, options) {
1329
+ const rolldownUtils = await import("rolldown/utils");
1330
+ const keepNames = { function: options.keepNames, class: options.keepNames };
1331
+ const result = await rolldownUtils.minify(fileName, code, {
1332
+ module: true,
1333
+ compress: { target: options.target, keepNames },
1334
+ mangle: { keepNames },
1335
+ codegen: { legalComments: "none", asciiOnly: true },
1336
+ sourcemap: false
1337
+ });
1338
+ if (result.errors.length > 0) {
1339
+ throw new Error(`Failed to minify ${fileName}: ${result.errors[0].message}`);
1340
+ }
1341
+ return restoreLiteralModuleSpecifiers(result.code, fileName, rolldownUtils);
1342
+ }
1343
+ _chunkS3JO3N4Hcjs.__name.call(void 0, minifyFarmServerChunk, "minifyFarmServerChunk");
1344
+ function restoreLiteralModuleSpecifiers(code, fileName, { parseSync, Visitor }) {
1345
+ if (!code.includes("import(`") && !code.includes("require(`")) return code;
1346
+ const parsed = parseSync(fileName, code, { lang: "js", sourceType: "module" });
1347
+ if (parsed.errors.length > 0) {
1348
+ throw new Error(`Failed to minify ${fileName}: ${parsed.errors[0].message}`);
1349
+ }
1350
+ const replacements = [];
1351
+ const restore = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (node) => {
1352
+ if (_optionalChain([node, 'optionalAccess', _17 => _17.type]) !== "TemplateLiteral") return;
1353
+ const template = node;
1354
+ const value = _optionalChain([template, 'access', _18 => _18.quasis, 'access', _19 => _19[0], 'optionalAccess', _20 => _20.value, 'access', _21 => _21.cooked]);
1355
+ if (template.expressions.length > 0 || typeof value !== "string") return;
1356
+ const text = JSON.stringify(value).replace(
1357
+ /[\u007f-￿]/g,
1358
+ (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`
1359
+ );
1360
+ replacements.push({ start: template.start, end: template.end, text });
1361
+ }, "restore");
1362
+ new Visitor({
1363
+ ImportExpression(node) {
1364
+ restore(node.source);
1365
+ },
1366
+ CallExpression(node) {
1367
+ if (node.callee.type === "Identifier" && node.callee.name === "require" && node.arguments.length === 1) {
1368
+ restore(node.arguments[0]);
1369
+ }
1370
+ }
1371
+ }).visit(parsed.program);
1372
+ let restored = "";
1373
+ let offset = 0;
1374
+ for (const { start, end, text } of replacements.sort((a, b) => a.start - b.start)) {
1375
+ restored += code.slice(offset, start) + text;
1376
+ offset = end;
1377
+ }
1378
+ return restored + code.slice(offset);
1389
1379
  }
1390
- _chunkS3JO3N4Hcjs.__name.call(void 0, createEsbuildTransformOptions, "createEsbuildTransformOptions");
1391
- function createEsbuildChunkMinifyPlugin(configuredEsbuildOptions) {
1392
- const configuredTransformOptions = createEsbuildTransformOptions(
1393
- configuredEsbuildOptions,
1394
- true,
1395
- "esnext"
1396
- );
1397
- const transformOptions = {
1398
- format: "esm",
1399
- target: configuredTransformOptions.target,
1400
- loader: "js",
1401
- sourcemap: false,
1402
- minify: true,
1403
- keepNames: configuredTransformOptions.keepNames,
1404
- legalComments: configuredTransformOptions.legalComments,
1405
- charset: configuredTransformOptions.charset
1406
- };
1380
+ _chunkS3JO3N4Hcjs.__name.call(void 0, restoreLiteralModuleSpecifiers, "restoreLiteralModuleSpecifiers");
1381
+ function createServerChunkMinifyPlugin(options) {
1407
1382
  return {
1408
- name: "farm-esbuild-minify",
1383
+ name: "farm-server-chunk-minify",
1409
1384
  async renderChunk(code, chunk) {
1410
- const { transform } = await import("esbuild");
1411
- const result = await transform(code, {
1412
- ...transformOptions,
1413
- sourcefile: chunk.fileName
1414
- });
1415
- if (!result.code) return null;
1416
- return {
1417
- code: result.code,
1418
- map: result.map || null
1419
- };
1385
+ const minified = await minifyFarmServerChunk(code, chunk.fileName, options);
1386
+ if (!minified) return null;
1387
+ return { code: minified, map: null };
1420
1388
  }
1421
1389
  };
1422
1390
  }
1423
- _chunkS3JO3N4Hcjs.__name.call(void 0, createEsbuildChunkMinifyPlugin, "createEsbuildChunkMinifyPlugin");
1391
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createServerChunkMinifyPlugin, "createServerChunkMinifyPlugin");
1424
1392
  function trimSlashes(value) {
1425
1393
  return value.replace(/^\/+|\/+$/g, "");
1426
1394
  }
1427
1395
  _chunkS3JO3N4Hcjs.__name.call(void 0, trimSlashes, "trimSlashes");
1428
1396
  function resolveBuildDocsContentDir(config, root) {
1429
- if (!_optionalChain([config, 'access', _20 => _20.docs, 'optionalAccess', _21 => _21.enabled])) return null;
1397
+ if (!_optionalChain([config, 'access', _22 => _22.docs, 'optionalAccess', _23 => _23.enabled])) return null;
1430
1398
  const configuredContentDir = config.docs.contentDir || config.docs.config.contentDir;
1431
1399
  if (typeof configuredContentDir === "string" && configuredContentDir.trim()) {
1432
1400
  const contentDir = _path2.default.isAbsolute(configuredContentDir) ? configuredContentDir : _path2.default.join(root, configuredContentDir);
@@ -1511,7 +1479,7 @@ function hasFarmPluginRoutes(config) {
1511
1479
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmPluginRoutes, "hasFarmPluginRoutes");
1512
1480
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
1513
1481
  return (config.plugins || []).some(
1514
- (plugin) => _chunkZ5HIWVDPcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkL7ARWZYTcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1482
+ (plugin) => _chunkZ5HIWVDPcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkIII667SJcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1515
1483
  );
1516
1484
  }
1517
1485
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmServerRuntimePluginsMayHandlePath, "farmServerRuntimePluginsMayHandlePath");
@@ -1559,7 +1527,7 @@ async function discoverMiddlewareRoutes(appDir) {
1559
1527
  }
1560
1528
  _chunkS3JO3N4Hcjs.__name.call(void 0, discoverMiddlewareRoutes, "discoverMiddlewareRoutes");
1561
1529
  function assertFarmDocsRuntimeSupported(config, preset) {
1562
- if (!_optionalChain([config, 'access', _22 => _22.docs, 'optionalAccess', _23 => _23.enabled]) || !_optionalChain([config, 'access', _24 => _24.docs, 'access', _25 => _25.adapter, 'optionalAccess', _26 => _26.server]) || _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
1530
+ if (!_optionalChain([config, 'access', _24 => _24.docs, 'optionalAccess', _25 => _25.enabled]) || !_optionalChain([config, 'access', _26 => _26.docs, 'access', _27 => _27.adapter, 'optionalAccess', _28 => _28.server]) || _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
1563
1531
  return;
1564
1532
  }
1565
1533
  throw new Error(
@@ -1573,7 +1541,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1573
1541
  assertFarmDocsRuntimeSupported(config, preset);
1574
1542
  const srcDir = config.srcDir || "src";
1575
1543
  const distDir = config.distDir || ".farm";
1576
- const deployOutputDir = _chunkYP5JZ4LFcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1544
+ const deployOutputDir = _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1577
1545
  const lifecyclePluginManager = options.pluginManager;
1578
1546
  const productionViteResultPromise = Promise.allSettled([
1579
1547
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))
@@ -1773,7 +1741,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1773
1741
  _chunk5QIKR7RRcjs.logger.error(`\u274C Build failed: ${error}`);
1774
1742
  throw error;
1775
1743
  } finally {
1776
- _optionalChain([rendererBuild, 'optionalAccess', _27 => _27.abort, 'call', _28 => _28()]);
1744
+ _optionalChain([rendererBuild, 'optionalAccess', _29 => _29.abort, 'call', _30 => _30()]);
1777
1745
  }
1778
1746
  }
1779
1747
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildUniversal, "buildUniversal");
@@ -1821,7 +1789,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
1821
1789
  }
1822
1790
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
1823
1791
  await fs.writeFile(fontCssPath, normalizedFontCss);
1824
- await fs.writeFile(clientCssPath, _chunkL7ARWZYTcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1792
+ await fs.writeFile(clientCssPath, _chunkIII667SJcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1825
1793
  }
1826
1794
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
1827
1795
  var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
@@ -1871,7 +1839,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
1871
1839
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${_path2.default.resolve(modulePath)}`;
1872
1840
  let plan = cache.get(key);
1873
1841
  if (!plan) {
1874
- plan = _chunkL7ARWZYTcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1842
+ plan = _chunkIII667SJcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1875
1843
  cache.set(key, plan);
1876
1844
  }
1877
1845
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -1895,19 +1863,19 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1895
1863
  const unsupportedIntegrationProvider = integrationProviders.find(
1896
1864
  (provider) => provider.supportsIsolatedHydration !== true
1897
1865
  );
1898
- if (_optionalChain([config, 'access', _29 => _29.experimental, 'optionalAccess', _30 => _30.isolatedClientHydration]) === "enabled" && _optionalChain([config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.serverComponents]) !== true && unsupportedIntegrationProvider) {
1866
+ if (_optionalChain([config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.isolatedClientHydration]) === "enabled" && _optionalChain([config, 'access', _33 => _33.experimental, 'optionalAccess', _34 => _34.serverComponents]) !== true && unsupportedIntegrationProvider) {
1899
1867
  _chunk5QIKR7RRcjs.logger.warn(
1900
1868
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
1901
1869
  );
1902
1870
  }
1903
- const isolatedMode = _chunkL7ARWZYTcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
1904
- _optionalChain([config, 'access', _33 => _33.experimental, 'optionalAccess', _34 => _34.isolatedClientHydration]),
1871
+ const isolatedMode = _chunkIII667SJcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
1872
+ _optionalChain([config, 'access', _35 => _35.experimental, 'optionalAccess', _36 => _36.isolatedClientHydration]),
1905
1873
  {
1906
- serverComponents: _optionalChain([config, 'access', _35 => _35.experimental, 'optionalAccess', _36 => _36.serverComponents]) === true,
1874
+ serverComponents: _optionalChain([config, 'access', _37 => _37.experimental, 'optionalAccess', _38 => _38.serverComponents]) === true,
1907
1875
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
1908
1876
  }
1909
1877
  );
1910
- const planOptions = _chunkL7ARWZYTcjs.getFarmClientHydrationPlanOptions.call(void 0,
1878
+ const planOptions = _chunkIII667SJcjs.getFarmClientHydrationPlanOptions.call(void 0,
1911
1879
  config.renderer,
1912
1880
  Boolean(unsupportedIntegrationProvider)
1913
1881
  );
@@ -1956,15 +1924,15 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1956
1924
  });
1957
1925
  const layoutAppliesToRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (layoutPattern, routePattern) => layoutPattern === "/" || routePattern === layoutPattern || routePattern.startsWith(`${layoutPattern}/`), "layoutAppliesToRoute");
1958
1926
  const adapterOwnsDocsRuntime = Boolean(
1959
- _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _37 => _37.docs, 'optionalAccess', _38 => _38.enabled]) && _optionalChain([config, 'access', _39 => _39.docs, 'access', _40 => _40.adapter, 'optionalAccess', _41 => _41.server]) && config.docs.adapter.react
1927
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _39 => _39.docs, 'optionalAccess', _40 => _40.enabled]) && _optionalChain([config, 'access', _41 => _41.docs, 'access', _42 => _42.adapter, 'optionalAccess', _43 => _43.server]) && config.docs.adapter.react
1960
1928
  );
1961
- const adapterDocsEntry = _optionalChain([config, 'access', _42 => _42.docs, 'optionalAccess', _43 => _43.enabled]) ? `/${config.docs.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/" : null;
1929
+ const adapterDocsEntry = _optionalChain([config, 'access', _44 => _44.docs, 'optionalAccess', _45 => _45.enabled]) ? `/${config.docs.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/" : null;
1962
1930
  const isAdapterDocsRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (routePattern) => Boolean(
1963
1931
  adapterOwnsDocsRuntime && adapterDocsEntry && (adapterDocsEntry === "/" || routePattern === adapterDocsEntry || routePattern.startsWith(`${adapterDocsEntry}/`))
1964
1932
  ), "isAdapterDocsRoute");
1965
- const syntheticDocsEntry = _optionalChain([config, 'access', _44 => _44.docs, 'optionalAccess', _45 => _45.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
1933
+ const syntheticDocsEntry = _optionalChain([config, 'access', _46 => _46.docs, 'optionalAccess', _47 => _47.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
1966
1934
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
1967
- const markdownPagePlan = _chunkL7ARWZYTcjs.createMarkdownPageHydrationPlanner.call(void 0,
1935
+ const markdownPagePlan = _chunkIII667SJcjs.createMarkdownPageHydrationPlanner.call(void 0,
1968
1936
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
1969
1937
  root,
1970
1938
  isolatedMode,
@@ -1980,7 +1948,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1980
1948
  planOptions
1981
1949
  )
1982
1950
  }));
1983
- _chunkL7ARWZYTcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
1951
+ _chunkIII667SJcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
1984
1952
  clientLayouts.map((layout) => ({
1985
1953
  pattern: layout.pattern,
1986
1954
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2012,7 +1980,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2012
1980
  for (const layout of clientLayouts) {
2013
1981
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, route.pattern)) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
2014
1982
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2015
- _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkL7ARWZYTcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
1983
+ _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkIII667SJcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2016
1984
  }
2017
1985
  }
2018
1986
  if (isolatedMode === "analyze") {
@@ -2036,7 +2004,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2036
2004
  );
2037
2005
  if (metadata.suppressedAsyncHydration) {
2038
2006
  _chunk5QIKR7RRcjs.logger.warn(
2039
- `\u26A0\uFE0F ${_chunkL7ARWZYTcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2007
+ `\u26A0\uFE0F ${_chunkIII667SJcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2040
2008
  );
2041
2009
  }
2042
2010
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
@@ -2095,7 +2063,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2095
2063
  }
2096
2064
  const clientRouteSlots = routeSlots.filter((slot) => {
2097
2065
  try {
2098
- return _chunkL7ARWZYTcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2066
+ return _chunkIII667SJcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2099
2067
  } catch (error) {
2100
2068
  _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2101
2069
  return false;
@@ -2116,8 +2084,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2116
2084
  srcDir,
2117
2085
  adapterOwnsDocsRuntime ? false : _chunkMWWVKDW3cjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
2118
2086
  adapterOwnsDocsRuntime ? void 0 : _chunkMWWVKDW3cjs.resolveFarmDocsSearchClientModule.call(void 0, root),
2119
- _optionalChain([config, 'access', _46 => _46.docs, 'optionalAccess', _47 => _47.enabled]) ? config.docs.entry : void 0,
2120
- adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _48 => _48.docs, 'access', _49 => _49.adapter, 'optionalAccess', _50 => _50.react]) : void 0,
2087
+ _optionalChain([config, 'access', _48 => _48.docs, 'optionalAccess', _49 => _49.enabled]) ? config.docs.entry : void 0,
2088
+ adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _50 => _50.docs, 'access', _51 => _51.adapter, 'optionalAccess', _52 => _52.react]) : void 0,
2121
2089
  config.i18n,
2122
2090
  config.plugins,
2123
2091
  config.renderer,
@@ -2125,14 +2093,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2125
2093
  config.trailingSlash,
2126
2094
  _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, config.integrations),
2127
2095
  config.basePath,
2128
- _chunkL7ARWZYTcjs.generateClientCachePersistenceCode.call(void 0, _chunkL7ARWZYTcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2096
+ _chunkIII667SJcjs.generateClientCachePersistenceCode.call(void 0, _chunkIII667SJcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2129
2097
  adapterOwnsDocsRuntime ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2130
2098
  );
2131
2099
  await fs.writeFile(clientEntryPath, clientHydrationCode);
2132
2100
  const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
2133
2101
  let postcssSearchPath;
2134
2102
  let tailwindVitePlugin = void 0;
2135
- const rendererVitePlugins = await _chunkTFAXUHWXcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
2103
+ const rendererVitePlugins = await _chunkPSV6XKPOcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
2136
2104
  ssr: false,
2137
2105
  buildLifetime: rendererBuildLifetime
2138
2106
  });
@@ -2142,15 +2110,10 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2142
2110
  const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
2143
2111
  await fs.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2144
2112
  postcssSearchPath = clientEntryDir;
2145
- try {
2146
- const tailwindVite = (await import("@tailwindcss/vite")).default;
2147
- tailwindVitePlugin = adaptTailwindVitePlugin(tailwindVite(), productionVite.builder);
2148
- _chunk5QIKR7RRcjs.logger.info("\u{1F4E6} Enabled built-in Tailwind support (@tailwindcss/vite)");
2149
- } catch (error) {
2150
- _chunk5QIKR7RRcjs.logger.warn(
2151
- `Tailwind plugin auto-enable failed; continuing without it: ${error.message}`
2152
- );
2153
- }
2113
+ tailwindVitePlugin = await _chunkIII667SJcjs.loadTailwindVitePlugin.call(void 0, {
2114
+ builder: productionVite.builder,
2115
+ announce: true
2116
+ });
2154
2117
  }
2155
2118
  try {
2156
2119
  const clientViteConfig = {
@@ -2180,7 +2143,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2180
2143
  hashCharacters: "hex",
2181
2144
  // Use predictable name for CSS so we can reference it in SSR HTML
2182
2145
  assetFileNames: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (assetInfo) => {
2183
- if (_optionalChain([assetInfo, 'access', _51 => _51.name, 'optionalAccess', _52 => _52.endsWith, 'call', _53 => _53(".css")])) {
2146
+ if (_optionalChain([assetInfo, 'access', _53 => _53.name, 'optionalAccess', _54 => _54.endsWith, 'call', _55 => _55(".css")])) {
2184
2147
  return "farm-client.css";
2185
2148
  }
2186
2149
  return "assets/[name]-h[hash][extname]";
@@ -2216,7 +2179,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2216
2179
  }
2217
2180
  },
2218
2181
  plugins: [
2219
- _chunkL7ARWZYTcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2182
+ _chunkIII667SJcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2220
2183
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
2221
2184
  ...rendererVitePlugins,
2222
2185
  ...config.vite.plugins || [],
@@ -2238,7 +2201,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2238
2201
  if (id.includes("/api/") && id.includes("/route")) {
2239
2202
  return { id: "\0empty-api-route", external: false };
2240
2203
  }
2241
- if (id === "fsevents" || id.includes("fsevents") || id.endsWith(".node") || id === "nitro" || id === "vite" || id === "esbuild" || id === "rollup" || id.startsWith("nitro/") || id.includes("node-pre-gyp") || id.includes("nf3")) {
2204
+ if (id === "fsevents" || id.includes("fsevents") || id.endsWith(".node") || id === "nitro" || id === "vite" || id === "esbuild" || id === "rolldown" || id.startsWith("rolldown/") || id === "rollup" || id.startsWith("nitro/") || id.includes("node-pre-gyp") || id.includes("nf3")) {
2242
2205
  return { id: "\0empty-module", external: false };
2243
2206
  }
2244
2207
  return null;
@@ -2277,7 +2240,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2277
2240
  } : void 0,
2278
2241
  // Ensure React is bundled for client
2279
2242
  resolve: {
2280
- alias: _chunkL7ARWZYTcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2243
+ alias: _chunkIII667SJcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2281
2244
  dedupe: [...config.renderer.dedupe || []]
2282
2245
  },
2283
2246
  // Optimize dependencies - exclude server-side code from client bundle
@@ -2290,7 +2253,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2290
2253
  ]
2291
2254
  }
2292
2255
  };
2293
- await viteBuild(_chunkL7ARWZYTcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2256
+ await viteBuild(_chunkIII667SJcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2294
2257
  await mergeBuiltFontCss(outputDir);
2295
2258
  await validateClientBuildOutput(root, srcDir, outputDir);
2296
2259
  } finally {
@@ -3047,17 +3010,20 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3047
3010
  secure: false
3048
3011
  },
3049
3012
  direction: {}
3050
- }, plugins = [], renderer = _chunkTFAXUHWXcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
3013
+ }, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
3051
3014
  const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
3052
- const clientPluginEntry = _chunkL7ARWZYTcjs.generateFarmClientPluginEntryCode.call(void 0,
3015
+ const clientPluginEntry = _chunkIII667SJcjs.generateFarmClientPluginEntryCode.call(void 0,
3053
3016
  plugins,
3054
3017
  root,
3055
3018
  srcDir,
3056
3019
  publicRuntimeConfig
3057
3020
  );
3058
- const rendererClientImports = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
3059
- import { createRoot, hydrateRoot } from "react-dom/client";` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3060
- const providerClientCode = _chunkL7ARWZYTcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3021
+ const appSetupPath = _chunkPSV6XKPOcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
3022
+ const rendererClientImports = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
3023
+ import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
3024
+ import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
3025
+ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3026
+ const providerClientCode = _chunkIII667SJcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3061
3027
  integrationProviders,
3062
3028
  root,
3063
3029
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -3542,7 +3508,7 @@ function hasHydratableLayout(pathname) {
3542
3508
  });
3543
3509
  }
3544
3510
 
3545
- ${_chunkL7ARWZYTcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3511
+ ${_chunkIII667SJcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3546
3512
  // Wrap a page element with applicable layouts
3547
3513
  function wrapWithLayouts(pageElement, pathname, params) {
3548
3514
  const layouts = getApplicableLayouts(pathname);
@@ -3643,7 +3609,7 @@ function createFarmRouteState(page, pathname, params, includeLayouts) {
3643
3609
  }
3644
3610
 
3645
3611
  function hydrateFarmRoute(container, route) {
3646
- ${_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);"}
3612
+ ${_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);"}
3647
3613
  }
3648
3614
 
3649
3615
  function renderFarmRoute(root, route) {
@@ -4435,7 +4401,7 @@ void hydrate();
4435
4401
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientHydrationEntry, "generateClientHydrationEntry");
4436
4402
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
4437
4403
  const viteBuild = productionVite.build;
4438
- const { farmPlugin } = await import("./vite.cjs");
4404
+ const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
4439
4405
  const { PluginManager: PluginManager2 } = await import("./plugin.cjs");
4440
4406
  const fs = await import("fs/promises");
4441
4407
  const pluginManager = new PluginManager2({
@@ -4447,7 +4413,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4447
4413
  const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
4448
4414
  let postcssConfigDir;
4449
4415
  let tailwindVitePlugin = void 0;
4450
- const rendererVitePlugins = await _chunkTFAXUHWXcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
4416
+ const rendererVitePlugins = await _chunkPSV6XKPOcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
4451
4417
  ssr: true,
4452
4418
  buildLifetime: rendererBuildLifetime
4453
4419
  });
@@ -4457,14 +4423,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4457
4423
  _path2.default.join(postcssConfigDir, "postcss.config.cjs"),
4458
4424
  "module.exports = { plugins: [] };\n"
4459
4425
  );
4460
- try {
4461
- const tailwindVite = (await import("@tailwindcss/vite")).default;
4462
- tailwindVitePlugin = adaptTailwindVitePlugin(tailwindVite(), productionVite.builder);
4463
- } catch (error) {
4464
- _chunk5QIKR7RRcjs.logger.warn(
4465
- `Tailwind plugin auto-enable failed for SSR; continuing without it: ${error.message}`
4466
- );
4467
- }
4426
+ tailwindVitePlugin = await _chunkIII667SJcjs.loadTailwindVitePlugin.call(void 0, {
4427
+ builder: productionVite.builder,
4428
+ label: "for SSR"
4429
+ });
4468
4430
  }
4469
4431
  let ssrBundle;
4470
4432
  let ssrEntryFile;
@@ -4495,6 +4457,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4495
4457
  modulePath: entry.modulePath
4496
4458
  });
4497
4459
  }
4460
+ assertMetadataImageRuntimeInstalled(root, metadataImageRoutes);
4498
4461
  const applicationMetadataRoutes = Array.from(
4499
4462
  routeManager.getMetadataRoutes().values(),
4500
4463
  (entry) => ({
@@ -4535,10 +4498,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4535
4498
  })
4536
4499
  );
4537
4500
  const i18nCatalogs = config.i18n.enabled ? (await _chunkIQXFRNY2cjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
4538
- const appDirs = _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, config);
4501
+ const appDirs = _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config);
4539
4502
  let openAPIReference = null;
4540
4503
  if (config.openapi.enabled && config.openapi.route) {
4541
- const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-G4B2IPYE.cjs");
4504
+ const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-XZ5TX7AO.cjs");
4542
4505
  const openAPIManager = new OpenAPIManager(appDirs, config.openapi, {
4543
4506
  mode: "production",
4544
4507
  apiBaseURL: config.api.baseURL
@@ -4555,8 +4518,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4555
4518
  };
4556
4519
  }
4557
4520
  const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
4558
- const instrumentationPath = _chunkRTHIVJ2Gcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
4559
- const notFoundPath = _chunkL7ARWZYTcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4521
+ const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
4522
+ const notFoundPath = _chunkIII667SJcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4560
4523
  if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
4561
4524
  layoutRoutes.sort((a, b) => {
4562
4525
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -4577,9 +4540,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4577
4540
  (provider) => provider.component || provider.type === "clerk"
4578
4541
  );
4579
4542
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
4580
- const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _54 => _54.mdx, 'optionalAccess', _55 => _55.components]));
4543
+ const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _56 => _56.mdx, 'optionalAccess', _57 => _57.components]));
4581
4544
  const hasMiddlewareConfig = hasFarmMiddlewareConfig(config.middleware);
4582
- const hasRouteContextConfig = _chunkYP5JZ4LFcjs.hasCustomFarmRouteContext.call(void 0, config);
4545
+ const hasRouteContextConfig = _chunkDNLQMFERcjs.hasCustomFarmRouteContext.call(void 0, config);
4583
4546
  const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
4584
4547
  const hasPluginRoutes = hasFarmPluginRoutes(config);
4585
4548
  const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
@@ -4588,7 +4551,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4588
4551
  const hasConfiguredRuntimePlugins = Boolean(
4589
4552
  hasRuntimeConfigModule && (config.plugins || []).length > 0
4590
4553
  );
4591
- const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _56 => _56.docs, 'optionalAccess', _57 => _57.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _58 => _58.docs, 'access', _59 => _59.adapter, 'optionalAccess', _60 => _60.server]) ? await _chunkZE6ONQ5Rcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4554
+ const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _60 => _60.docs, 'access', _61 => _61.adapter, 'optionalAccess', _62 => _62.server]) ? await _chunkLQIRVSBYcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4592
4555
  root,
4593
4556
  srcDir: config.srcDir,
4594
4557
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -4631,7 +4594,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4631
4594
  );
4632
4595
  const virtualEntryId = "\0virtual:farm-ssr-entry";
4633
4596
  const useExternalMetadataImageRuntime = shouldUseExternalMetadataImageRuntime(preset, true);
4634
- const rendererOptionalExternals = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
4597
+ const rendererOptionalExternals = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
4635
4598
  "react",
4636
4599
  "react/jsx-runtime",
4637
4600
  "react/jsx-dev-runtime",
@@ -4685,7 +4648,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4685
4648
  // Adapters can render provider scripts by serializing function source.
4686
4649
  // keepNames injects helper calls into those functions; after Nitro
4687
4650
  // minifies the server chunk the helper is no longer in script scope.
4688
- keepNames: !(_optionalChain([config, 'access', _61 => _61.docs, 'optionalAccess', _62 => _62.enabled]) && _optionalChain([config, 'access', _63 => _63.docs, 'access', _64 => _64.adapter, 'optionalAccess', _65 => _65.server])),
4651
+ keepNames: !(_optionalChain([config, 'access', _63 => _63.docs, 'optionalAccess', _64 => _64.enabled]) && _optionalChain([config, 'access', _65 => _65.docs, 'access', _66 => _66.adapter, 'optionalAccess', _67 => _67.server])),
4689
4652
  jsxDev: false
4690
4653
  },
4691
4654
  // SSR configuration to externalize problematic modules
@@ -4699,6 +4662,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4699
4662
  ...useExternalMetadataImageRuntime ? ["@vercel/og"] : [],
4700
4663
  "esbuild",
4701
4664
  "lightningcss",
4665
+ "rolldown",
4666
+ "rolldown/experimental",
4667
+ "rolldown/utils",
4702
4668
  "rollup",
4703
4669
  "@rollup/rollup-darwin-arm64",
4704
4670
  "@rollup/rollup-darwin-x64",
@@ -4732,10 +4698,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4732
4698
  define: {
4733
4699
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
4734
4700
  __FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
4735
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _66 => _66.env, 'optionalAccess', _67 => _67.public]) || {})
4701
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _68 => _68.env, 'optionalAccess', _69 => _69.public]) || {})
4736
4702
  },
4737
4703
  plugins: [
4738
- _chunkL7ARWZYTcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4704
+ _chunkIII667SJcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4739
4705
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
4740
4706
  ...rendererVitePlugins,
4741
4707
  ...config.vite.plugins || [],
@@ -4754,6 +4720,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4754
4720
  };
4755
4721
  }
4756
4722
  },
4723
+ farmServerOnlyEntriesPlugin(),
4757
4724
  farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
4758
4725
  _chunk22GUSVNJcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
4759
4726
  {
@@ -4794,7 +4761,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4794
4761
  resolve: {
4795
4762
  alias: [
4796
4763
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
4797
- ...Object.entries(_chunkL7ARWZYTcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4764
+ ...Object.entries(_chunkIII667SJcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4798
4765
  ([find, replacement]) => ({ find, replacement })
4799
4766
  )
4800
4767
  ],
@@ -4802,7 +4769,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4802
4769
  dedupe: [...config.renderer.dedupe || []]
4803
4770
  }
4804
4771
  };
4805
- await viteBuild(_chunkL7ARWZYTcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
4772
+ await viteBuild(_chunkIII667SJcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
4806
4773
  } finally {
4807
4774
  if (postcssConfigDir) {
4808
4775
  try {
@@ -4819,15 +4786,15 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4819
4786
  }
4820
4787
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildSSRInMemory, "buildSSRInMemory");
4821
4788
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
4822
- const llmsTxt = _optionalChain([agent, 'optionalAccess', _68 => _68.llmsTxt]);
4789
+ const llmsTxt = _optionalChain([agent, 'optionalAccess', _70 => _70.llmsTxt]);
4823
4790
  const ownedByFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (kind) => applicationMetadataRoutes.some(
4824
4791
  (metadata) => metadata.kind === kind && metadata.pattern === "/"
4825
4792
  ), "ownedByFile");
4826
4793
  return [
4827
- ..._optionalChain([llmsTxt, 'optionalAccess', _69 => _69.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
4828
- ..._optionalChain([llmsTxt, 'optionalAccess', _70 => _70.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
4794
+ ..._optionalChain([llmsTxt, 'optionalAccess', _71 => _71.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
4795
+ ..._optionalChain([llmsTxt, 'optionalAccess', _72 => _72.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
4829
4796
  ...ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
4830
- ..._optionalChain([agent, 'optionalAccess', _71 => _71.crawlers, 'optionalAccess', _72 => _72.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
4797
+ ..._optionalChain([agent, 'optionalAccess', _73 => _73.crawlers, 'optionalAccess', _74 => _74.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
4831
4798
  ];
4832
4799
  }
4833
4800
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAppOwnedDocsEnginePaths, "getFarmAppOwnedDocsEnginePaths");
@@ -4869,7 +4836,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
4869
4836
  }
4870
4837
  _chunkS3JO3N4Hcjs.__name.call(void 0, toVirtualEntryImportSpecifier, "toVirtualEntryImportSpecifier");
4871
4838
  function generateNativeAuthIntegrationSource(auth) {
4872
- if (_optionalChain([auth, 'optionalAccess', _73 => _73.enabled]) !== true) {
4839
+ if (_optionalChain([auth, 'optionalAccess', _75 => _75.enabled]) !== true) {
4873
4840
  return { importSource: "", registerSource: "" };
4874
4841
  }
4875
4842
  return {
@@ -4884,7 +4851,7 @@ function generateNativeAuthIntegrationSource(auth) {
4884
4851
  }
4885
4852
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateNativeAuthIntegrationSource, "generateNativeAuthIntegrationSource");
4886
4853
  function generateNativeMCPPluginSource(mcp) {
4887
- if (_optionalChain([mcp, 'optionalAccess', _74 => _74.enabled]) !== true) {
4854
+ if (_optionalChain([mcp, 'optionalAccess', _76 => _76.enabled]) !== true) {
4888
4855
  return { importSource: "", registerSource: "", pluginSource: "" };
4889
4856
  }
4890
4857
  return {
@@ -5013,8 +4980,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateConfiguredResponseHeadersRuntimeSo
5013
4980
  function parseRouteRenderingDirectiveFromDisk(modulePath) {
5014
4981
  try {
5015
4982
  const source = _fs.readFileSync.call(void 0, modulePath, "utf8");
5016
- const directive = _chunkXFFQSD2Fcjs.parseRouteRenderingDirective.call(void 0, source);
5017
- if (_chunkXFFQSD2Fcjs.findRequestBoundSourceBlockers.call(void 0, source).length === 0) return directive;
4983
+ const directive = _chunkDW34V5SMcjs.parseRouteRenderingDirective.call(void 0, source);
4984
+ if (_chunkDW34V5SMcjs.findRequestBoundSourceBlockers.call(void 0, source).length === 0) return directive;
5018
4985
  return { ..._nullishCoalesce(directive, () => ( { ssg: false, ppr: false, directive: "" })), requestBound: true };
5019
4986
  } catch (e22) {
5020
4987
  return void 0;
@@ -5124,25 +5091,36 @@ async function applyFarmPreloadBudget(response, pathname, request) {
5124
5091
  `.trim();
5125
5092
  }
5126
5093
  _chunkS3JO3N4Hcjs.__name.call(void 0, generatePreloadResponseRuntimeSource, "generatePreloadResponseRuntimeSource");
5094
+ function generateFarmRendererAppSetupServerCode(config) {
5095
+ const appSetupPath = _chunkPSV6XKPOcjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
5096
+ if (!appSetupPath) return "";
5097
+ return `
5098
+ import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
5099
+ if (typeof ReactDOMServer.configureApp !== "function") {
5100
+ throw new Error(${JSON.stringify(`Renderer \`${config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`)});
5101
+ }
5102
+ ReactDOMServer.configureApp(__farmAppSetup);`;
5103
+ }
5104
+ _chunkS3JO3N4Hcjs.__name.call(void 0, generateFarmRendererAppSetupServerCode, "generateFarmRendererAppSetupServerCode");
5127
5105
  function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache) {
5128
5106
  const hasCompressionRuntime = config.compress && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5129
- const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _75 => _75.agent, 'optionalAccess', _76 => _76.crawlers, 'optionalAccess', _77 => _77.enabled])) && !applicationMetadataRoutes.some(
5107
+ const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _77 => _77.agent, 'optionalAccess', _78 => _78.crawlers, 'optionalAccess', _79 => _79.enabled])) && !applicationMetadataRoutes.some(
5130
5108
  (metadata) => metadata.kind === "robots" && metadata.pattern === "/"
5131
5109
  );
5132
5110
  const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
5133
5111
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5134
5112
  const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
5135
5113
  const adapterOwnsDocsRuntime = Boolean(
5136
- _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _78 => _78.docs, 'optionalAccess', _79 => _79.enabled]) && _optionalChain([config, 'access', _80 => _80.docs, 'access', _81 => _81.adapter, 'optionalAccess', _82 => _82.server]) && config.docs.adapter.react
5114
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _80 => _80.docs, 'optionalAccess', _81 => _81.enabled]) && _optionalChain([config, 'access', _82 => _82.docs, 'access', _83 => _83.adapter, 'optionalAccess', _84 => _84.server]) && config.docs.adapter.react
5137
5115
  );
5138
5116
  const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
5139
- const hasIsolatedClientGraphRuntime = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
5140
- const rendererStreamingCapabilities = _chunkTFAXUHWXcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
5117
+ const hasIsolatedClientGraphRuntime = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
5118
+ const rendererStreamingCapabilities = _chunkPSV6XKPOcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
5141
5119
  config.renderer,
5142
5120
  _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset)
5143
5121
  );
5144
- const rendererServerImports = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
5145
- import * as ReactDOMServer from "react-dom/server";${hasIsolatedClientGraphRuntime ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";' : ""}` : `import React, * as ReactDOMServer from ${JSON.stringify(config.renderer.server)};`;
5122
+ const rendererServerImports = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
5123
+ import * as ReactDOMServer from "react-dom/server";${hasIsolatedClientGraphRuntime ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";' : ""}` : `import React, * as ReactDOMServer from ${JSON.stringify(config.renderer.server)};${generateFarmRendererAppSetupServerCode(config)}`;
5146
5124
  const routeClientGraphServerRuntime = hasIsolatedClientGraphRuntime ? `function wrapFarmRouteClientGraph(element) {
5147
5125
  return wrapFarmIsolatedClientGraph(React, element);
5148
5126
  }
@@ -5158,26 +5136,26 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5158
5136
  (image) => image.sourceType === "module"
5159
5137
  );
5160
5138
  const hasMiddlewareRuntime = middlewareRoutes.length > 0 || hasFarmMiddlewareConfig(config.middleware);
5161
- const farmDocsFontAssets = _optionalChain([config, 'access', _83 => _83.docs, 'optionalAccess', _84 => _84.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5139
+ const farmDocsFontAssets = _optionalChain([config, 'access', _85 => _85.docs, 'optionalAccess', _86 => _86.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5162
5140
  const integrationProviders = _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, config.integrations);
5163
5141
  const renderedIntegrationProviders = integrationProviders.filter(
5164
5142
  (provider) => provider.component || provider.type === "clerk"
5165
5143
  );
5166
- if (renderedIntegrationProviders.length > 0 && !_chunkTFAXUHWXcjs.getFarmRendererCapabilities.call(void 0, config.renderer).functionComponents) {
5144
+ if (renderedIntegrationProviders.length > 0 && !_chunkPSV6XKPOcjs.getFarmRendererCapabilities.call(void 0, config.renderer).functionComponents) {
5167
5145
  throw new Error(
5168
5146
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
5169
5147
  );
5170
5148
  }
5171
- const providerServerModules = _chunkL7ARWZYTcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5149
+ const providerServerModules = _chunkIII667SJcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5172
5150
  renderedIntegrationProviders,
5173
5151
  config.root,
5174
5152
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
5175
5153
  );
5176
5154
  const resolvedIntegrationProviderFallback = Object.fromEntries(
5177
5155
  Object.entries(config.integrations).flatMap(([name, integration]) => {
5178
- const configuredProviders = _optionalChain([integration, 'optionalAccess', _85 => _85.providers]);
5156
+ const configuredProviders = _optionalChain([integration, 'optionalAccess', _87 => _87.providers]);
5179
5157
  const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
5180
- if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _86 => _86.component]) === "function")) {
5158
+ if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _88 => _88.component]) === "function")) {
5181
5159
  throw new Error(
5182
5160
  `Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
5183
5161
  );
@@ -5188,14 +5166,14 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5188
5166
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
5189
5167
  (provider) => provider.supportsIsolatedHydration !== true
5190
5168
  );
5191
- const isolatedHydrationMode = _chunkL7ARWZYTcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5192
- _optionalChain([config, 'access', _87 => _87.experimental, 'optionalAccess', _88 => _88.isolatedClientHydration]),
5169
+ const isolatedHydrationMode = _chunkIII667SJcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5170
+ _optionalChain([config, 'access', _89 => _89.experimental, 'optionalAccess', _90 => _90.isolatedClientHydration]),
5193
5171
  {
5194
- serverComponents: _optionalChain([config, 'access', _89 => _89.experimental, 'optionalAccess', _90 => _90.serverComponents]) === true,
5172
+ serverComponents: _optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.serverComponents]) === true,
5195
5173
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
5196
5174
  }
5197
5175
  );
5198
- const hydrationPlanOptions = _chunkL7ARWZYTcjs.getFarmClientHydrationPlanOptions.call(void 0,
5176
+ const hydrationPlanOptions = _chunkIII667SJcjs.getFarmClientHydrationPlanOptions.call(void 0,
5199
5177
  config.renderer,
5200
5178
  Boolean(unsupportedIntegrationProvider)
5201
5179
  );
@@ -5210,7 +5188,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5210
5188
  hydrationPlanOptions
5211
5189
  )
5212
5190
  }));
5213
- const markdownPagePlan = _chunkL7ARWZYTcjs.createMarkdownPageHydrationPlanner.call(void 0,
5191
+ const markdownPagePlan = _chunkIII667SJcjs.createMarkdownPageHydrationPlanner.call(void 0,
5214
5192
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
5215
5193
  config.root,
5216
5194
  isolatedHydrationMode,
@@ -5228,7 +5206,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5228
5206
  )
5229
5207
  ])
5230
5208
  );
5231
- _chunkL7ARWZYTcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5209
+ _chunkIII667SJcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5232
5210
  layoutHydrationPlans.map((layout) => ({
5233
5211
  pattern: layout.pattern,
5234
5212
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -5256,7 +5234,7 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5256
5234
  apiRegistrations.push(`
5257
5235
  {
5258
5236
  path: ${JSON.stringify(route.path)},
5259
- methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _91 => _91.pluginMethods, 'optionalAccess', _92 => _92.includes, 'call', _93 => _93(method)])))},
5237
+ methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _93 => _93.pluginMethods, 'optionalAccess', _94 => _94.includes, 'call', _95 => _95(method)])))},
5260
5238
  endpoints: ${varName},
5261
5239
  }`);
5262
5240
  });
@@ -5487,25 +5465,25 @@ function isolateFarmRouteServerPage(element) { return element; }`;
5487
5465
  const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
5488
5466
  const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
5489
5467
  const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
5490
- const docsHandlerImport = _optionalChain([config, 'access', _94 => _94.docs, 'optionalAccess', _95 => _95.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
5468
+ const docsHandlerImport = _optionalChain([config, 'access', _96 => _96.docs, 'optionalAccess', _97 => _97.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
5491
5469
  const isFarmDocsAPIRequest = (requestOrPathname) => {
5492
5470
  const pathname = typeof requestOrPathname === "string"
5493
5471
  ? requestOrPathname
5494
5472
  : new URL(requestOrPathname.url).pathname;
5495
- const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _96 => _96.apiPath]) || "/api/docs")};
5473
+ const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _98 => _98.apiPath]) || "/api/docs")};
5496
5474
  return pathname === apiPath || pathname.startsWith(apiPath + "/");
5497
5475
  };` : adapterOwnsDocsRuntime ? `import { isFarmDocsAPIRequest } from "@farm.js/core/docs";
5498
5476
  import { createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler } from ${JSON.stringify(config.docs.adapter.server)};
5499
5477
  import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
5500
5478
  import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
5501
- const docsFontImport = _optionalChain([config, 'access', _97 => _97.docs, 'optionalAccess', _98 => _98.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
5502
- const docsRuntimeImport = _optionalChain([config, 'access', _99 => _99.docs, 'optionalAccess', _100 => _100.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
5479
+ const docsFontImport = _optionalChain([config, 'access', _99 => _99.docs, 'optionalAccess', _100 => _100.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
5480
+ const docsRuntimeImport = _optionalChain([config, 'access', _101 => _101.docs, 'optionalAccess', _102 => _102.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
5503
5481
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
5504
5482
  import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
5505
- const markdownHandlerImport = _optionalChain([config, 'access', _101 => _101.md, 'optionalAccess', _102 => _102.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
5483
+ const markdownHandlerImport = _optionalChain([config, 'access', _103 => _103.md, 'optionalAccess', _104 => _104.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
5506
5484
  const appMarkdownImport = hasMarkdownPages ? `import { createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;";
5507
5485
  const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
5508
- const mdxComponentsPath = typeof _optionalChain([config, 'access', _103 => _103.mdx, 'optionalAccess', _104 => _104.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
5486
+ const mdxComponentsPath = typeof _optionalChain([config, 'access', _105 => _105.mdx, 'optionalAccess', _106 => _106.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
5509
5487
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
5510
5488
  const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
5511
5489
  const layerConfigImports = layerConfigPaths.map(
@@ -5709,7 +5687,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
5709
5687
 
5710
5688
  function FarmDefault404Page() {
5711
5689
  return React.createElement(React.Fragment, null,
5712
- React.createElement("style", null, ${JSON.stringify(_chunkL7ARWZYTcjs.DEFAULT_NOT_FOUND_STYLES)}),
5690
+ React.createElement("style", null, ${JSON.stringify(_chunkIII667SJcjs.DEFAULT_NOT_FOUND_STYLES)}),
5713
5691
  React.createElement("main", {
5714
5692
  className: "farm-default-not-found",
5715
5693
  "aria-labelledby": "farm-default-not-found-title",
@@ -5837,14 +5815,14 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
5837
5815
  onError(error) { console.error("[Farm Image]", error); },
5838
5816
  })`};
5839
5817
  const farmMarkdownConfig = ${JSON.stringify(config.md)};
5840
- const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _105 => _105.agent, 'optionalAccess', _106 => _106.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
5818
+ const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _107 => _107.agent, 'optionalAccess', _108 => _108.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
5841
5819
  ${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
5842
5820
  const farmMdxConfig = ${JSON.stringify({
5843
5821
  ...config.mdx,
5844
- components: typeof _optionalChain([config, 'access', _107 => _107.mdx, 'optionalAccess', _108 => _108.components]) === "string" ? config.mdx.components : void 0
5822
+ components: typeof _optionalChain([config, 'access', _109 => _109.mdx, 'optionalAccess', _110 => _110.components]) === "string" ? config.mdx.components : void 0
5845
5823
  })};
5846
5824
  const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
5847
- ${_optionalChain([config, 'access', _109 => _109.agent, 'optionalAccess', _110 => _110.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
5825
+ ${_optionalChain([config, 'access', _111 => _111.agent, 'optionalAccess', _112 => _112.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
5848
5826
  // environment this was built in, since Netlify exposes its deploy context only
5849
5827
  // to the build.
5850
5828
  const farmNoindexPreview = resolveFarmPreviewDeployment(
@@ -5892,7 +5870,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
5892
5870
  });
5893
5871
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
5894
5872
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
5895
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _111 => _111.docs, 'optionalAccess', _112 => _112.enabled]) && !hasPrecompiledDocs ? `(() => {
5873
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _113 => _113.docs, 'optionalAccess', _114 => _114.enabled]) && !hasPrecompiledDocs ? `(() => {
5896
5874
  try {
5897
5875
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
5898
5876
  const candidates = [
@@ -5913,7 +5891,7 @@ globalThis.__FARM_DOCS_RUNTIME_CONFIG__ = {
5913
5891
  docs: farmDocsResolvedConfig,
5914
5892
  };
5915
5893
  const farmDocsPrecompiledRuntime = ${hasPrecompiledDocs ? `createFarmDocsPrecompiledRuntime(${JSON.stringify(farmDocsPrecompiledManifest)})` : "null"};
5916
- const farmDocsHandler = ${_optionalChain([config, 'access', _113 => _113.docs, 'optionalAccess', _114 => _114.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
5894
+ const farmDocsHandler = ${_optionalChain([config, 'access', _115 => _115.docs, 'optionalAccess', _116 => _116.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
5917
5895
  ${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
5918
5896
  entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
5919
5897
  docsPath: farmDocsResolvedConfig.entry,
@@ -5941,7 +5919,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _113 => _113.docs, '
5941
5919
  fontStylesheetHref: "/farm-fonts.css",
5942
5920
  globalStylesheetHref: "/assets/globals.css",
5943
5921
  })` : "null"};
5944
- const farmDocsAPIHandler = ${_optionalChain([config, 'access', _115 => _115.docs, 'optionalAccess', _116 => _116.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig })` : "null"};
5922
+ const farmDocsAPIHandler = ${_optionalChain([config, 'access', _117 => _117.docs, 'optionalAccess', _118 => _118.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig })` : "null"};
5945
5923
 
5946
5924
  // API routes bundled at build time
5947
5925
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
@@ -7052,7 +7030,7 @@ function hasLocalRequestRoute(request, routePathname) {
7052
7030
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
7053
7031
  return true;
7054
7032
  }
7055
- ${_optionalChain([config, 'access', _117 => _117.docs, 'optionalAccess', _118 => _118.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7033
+ ${_optionalChain([config, 'access', _119 => _119.docs, 'optionalAccess', _120 => _120.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
7056
7034
  if (
7057
7035
  isFarmDocsAPIRequest(pathname) ||
7058
7036
  docsPath === "/" ||
@@ -7078,7 +7056,7 @@ function getFarmPluginRequestOptions(request) {
7078
7056
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
7079
7057
  };
7080
7058
  }
7081
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _119 => _119.docs, 'optionalAccess', _120 => _120.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7059
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _121 => _121.docs, 'optionalAccess', _122 => _122.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
7082
7060
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
7083
7061
  pathname,
7084
7062
  method: request.method,
@@ -7168,7 +7146,7 @@ function getApplicableLayouts(pathname) {
7168
7146
  return applicable;
7169
7147
  }
7170
7148
 
7171
- ${_optionalChain([config, 'access', _121 => _121.docs, 'optionalAccess', _122 => _122.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7149
+ ${_optionalChain([config, 'access', _123 => _123.docs, 'optionalAccess', _124 => _124.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
7172
7150
  if (request.method === "HEAD") return response;
7173
7151
  if (response.headers.get("x-farm-docs-adapter")) return response;
7174
7152
 
@@ -7275,7 +7253,7 @@ ${_optionalChain([config, 'access', _121 => _121.docs, 'optionalAccess', _122 =>
7275
7253
  }` : ""}
7276
7254
 
7277
7255
  const pprShellCache = getFarmDataCache();
7278
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _123 => _123.experimental, 'optionalAccess', _124 => _124.ppr]) === true)};
7256
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _125 => _125.experimental, 'optionalAccess', _126 => _126.ppr]) === true)};
7279
7257
 
7280
7258
  function resolveRouteRenderingView(route) {
7281
7259
  // The same merge development uses: baked directive config under the
@@ -7398,7 +7376,7 @@ async function handleFarmRequest(request, adapterContext) {
7398
7376
  },
7399
7377
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
7400
7378
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
7401
- ${_optionalChain([config, 'access', _125 => _125.md, 'optionalAccess', _126 => _126.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
7379
+ ${_optionalChain([config, 'access', _127 => _127.md, 'optionalAccess', _128 => _128.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
7402
7380
  if (matchPageRoute(pathname)) {
7403
7381
  // The Link header advertises the public .md URL, like the head alternate.
7404
7382
  return applyMarkdownNegotiationHeaders(response, {
@@ -7517,7 +7495,7 @@ async function handleFarmRequestInContext(
7517
7495
  const middlewareHeaders = ${hasServerRuntimeIntegrations ? "withFarmIntegrationSetCookies(undefined, farmIntegrationSetCookies)" : "undefined"};
7518
7496
  `}
7519
7497
 
7520
- ${_optionalChain([config, 'access', _127 => _127.docs, 'optionalAccess', _128 => _128.enabled]) ? `
7498
+ ${_optionalChain([config, 'access', _129 => _129.docs, 'optionalAccess', _130 => _130.enabled]) ? `
7521
7499
  // Docs responses are served after app middleware so route guards and
7522
7500
  // middleware headers apply to the docs engine like any other page content.
7523
7501
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -7562,7 +7540,7 @@ async function handleFarmRequestInContext(
7562
7540
  }
7563
7541
  ` : ""}
7564
7542
 
7565
- ${_optionalChain([config, 'access', _129 => _129.md, 'optionalAccess', _130 => _130.enabled]) ? `
7543
+ ${_optionalChain([config, 'access', _131 => _131.md, 'optionalAccess', _132 => _132.enabled]) ? `
7566
7544
  if (farmMarkdownConfig?.enabled) {
7567
7545
  const markdownResponse = await createMarkdownMirrorResponse({
7568
7546
  // The mirror helper only reads metadata and creates its own GET request.
@@ -7665,11 +7643,11 @@ async function handleFarmRequestInContext(
7665
7643
  );
7666
7644
  }
7667
7645
  ` : ""}
7668
- ${_optionalChain([config, 'access', _131 => _131.agent, 'optionalAccess', _132 => _132.llmsTxt, 'optionalAccess', _133 => _133.enabled]) ? `
7646
+ ${_optionalChain([config, 'access', _133 => _133.agent, 'optionalAccess', _134 => _134.llmsTxt, 'optionalAccess', _135 => _135.enabled]) ? `
7669
7647
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
7670
7648
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
7671
7649
  ? "llms"
7672
- : ${_optionalChain([config, 'access', _134 => _134.agent, 'optionalAccess', _135 => _135.llmsTxt, 'optionalAccess', _136 => _136.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
7650
+ : ${_optionalChain([config, 'access', _136 => _136.agent, 'optionalAccess', _137 => _137.llmsTxt, 'optionalAccess', _138 => _138.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
7673
7651
  if (farmGeneratedLlmsKind) {
7674
7652
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
7675
7653
  const llmsBody = farmGeneratedLlmsKind === "llms-full"
@@ -7690,7 +7668,7 @@ async function handleFarmRequestInContext(
7690
7668
  }
7691
7669
  ` : ""}
7692
7670
 
7693
- ${_optionalChain([config, 'access', _137 => _137.docs, 'optionalAccess', _138 => _138.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
7671
+ ${_optionalChain([config, 'access', _139 => _139.docs, 'optionalAccess', _140 => _140.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
7694
7672
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
7695
7673
  if (docsAPIResponse) {
7696
7674
  return applyProductionMiddlewareHeaders(docsAPIResponse, middlewareHeaders);
@@ -8125,7 +8103,7 @@ async function handleFarmRequestInContext(
8125
8103
  );
8126
8104
  }
8127
8105
  }
8128
- ${_optionalChain([config, 'access', _139 => _139.md, 'optionalAccess', _140 => _140.enabled]) ? `
8106
+ ${_optionalChain([config, 'access', _141 => _141.md, 'optionalAccess', _142 => _142.enabled]) ? `
8129
8107
  // Advertise the Markdown mirror in the head as well as the Link header,
8130
8108
  // using the public path the .md request will be resolved against.
8131
8109
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -8133,7 +8111,7 @@ async function handleFarmRequestInContext(
8133
8111
  getFarmMarkdownAlternatePath(farmMarkdownConfig, pathname),
8134
8112
  );` : ""}
8135
8113
 
8136
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _141 => _141.agent, 'optionalAccess', _142 => _142.jsonLd]), () => ( false)))} });
8114
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _143 => _143.agent, 'optionalAccess', _144 => _144.jsonLd]), () => ( false)))} });
8137
8115
  const title = renderedMetadata.title;
8138
8116
  const metaTags = renderedMetadata.tags;
8139
8117
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -8748,11 +8726,11 @@ ${generatePreloadResponseRuntimeSource()}
8748
8726
 
8749
8727
  // Export as Web Standard fetch API
8750
8728
  export async function fetch(request, context) {
8751
- ${_optionalChain([config, 'access', _143 => _143.agent, 'optionalAccess', _144 => _144.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
8729
+ ${_optionalChain([config, 'access', _145 => _145.agent, 'optionalAccess', _146 => _146.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
8752
8730
  basePath: farmLocalAPIBasePath,
8753
8731
  dispatch: async (localRequest) =>
8754
8732
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
8755
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _145 => _145.agent, 'optionalAccess', _146 => _146.noindexPreviews]) ? `
8733
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _147 => _147.agent, 'optionalAccess', _148 => _148.noindexPreviews]) ? `
8756
8734
  // Keep every response of a preview deployment out of search indexes.
8757
8735
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
8758
8736
  }
@@ -8895,7 +8873,7 @@ function configMiddlewareMayHandlePath(config, pathname) {
8895
8873
  if (!hasFarmMiddlewareConfig(config)) return false;
8896
8874
  const entries = Array.isArray(config) ? config : [config];
8897
8875
  return entries.some((entry) => {
8898
- if (_optionalChain([entry, 'access', _147 => _147.exclude, 'optionalAccess', _148 => _148.some, 'call', _149 => _149((pattern) => middlewarePatternMatches(pattern, pathname))])) {
8876
+ if (_optionalChain([entry, 'access', _149 => _149.exclude, 'optionalAccess', _150 => _150.some, 'call', _151 => _151((pattern) => middlewarePatternMatches(pattern, pathname))])) {
8899
8877
  return false;
8900
8878
  }
8901
8879
  if (!entry.matcher) return true;
@@ -8951,11 +8929,11 @@ function getPhysicalPrerenderBypassReason(options) {
8951
8929
  }
8952
8930
  if (appMiddlewareMayHandlePath(middlewareRoutes, pathname)) return "app middleware";
8953
8931
  if (configMiddlewareMayHandlePath(config.middleware, pathname)) return "configured middleware";
8954
- if (_chunkYP5JZ4LFcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
8932
+ if (_chunkDNLQMFERcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
8955
8933
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
8956
8934
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
8957
- if (_optionalChain([manifestEntry, 'optionalAccess', _150 => _150.rendering]) === "dynamic") return "dynamic runtime manifest";
8958
- if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _151 => _151.regions, 'optionalAccess', _152 => _152.length])) || manifestEntry.maxDuration !== void 0)) {
8935
+ if (_optionalChain([manifestEntry, 'optionalAccess', _152 => _152.rendering]) === "dynamic") return "dynamic runtime manifest";
8936
+ if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _153 => _153.regions, 'optionalAccess', _154 => _154.length])) || manifestEntry.maxDuration !== void 0)) {
8959
8937
  return "route runtime controls";
8960
8938
  }
8961
8939
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -8977,7 +8955,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
8977
8955
  const nitroBuilder = nitroBuilderResult.value;
8978
8956
  const isVercel = preset === "vercel" || preset === "vercel-edge";
8979
8957
  const isCloudflareWorker = preset === "cloudflare-module";
8980
- const outputDir = _chunkYP5JZ4LFcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
8958
+ const outputDir = _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
8981
8959
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
8982
8960
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
8983
8961
  const imageRuntime = resolveImageRuntime(config, preset);
@@ -8999,9 +8977,9 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
8999
8977
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
9000
8978
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
9001
8979
  const ssgCollectionPromise = routeManager.collectSSGPages();
9002
- const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, config));
8980
+ const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config));
9003
8981
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
9004
- const farmWorkflows = await _chunkK6FNHVDRcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
8982
+ const farmWorkflows = await _chunkMPEYMSCFcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
9005
8983
  const farmCron = await _chunk6EXBPJ24cjs.prepareFarmCronForNitro.call(void 0, config);
9006
8984
  const [{ ssg: ssgPages }, middlewareRoutes, [configuredRedirects, configuredRewrites]] = await Promise.all([
9007
8985
  ssgCollectionPromise,
@@ -9308,27 +9286,20 @@ export default async function farmNitroEventHandler(event) {
9308
9286
  snapshotSSRRebundleOptions(nitroConfig)
9309
9287
  );
9310
9288
  const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
9311
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _153 => _153.rollupConfig, 'optionalAccess', _154 => _154.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _155 => _155.rollupConfig, 'optionalAccess', _156 => _156.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _157 => _157.output, 'optionalAccess', _158 => _158.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
9312
- _optionalChain([nitroConfig, 'access', _159 => _159.handlers, 'optionalAccess', _160 => _160.some, 'call', _161 => _161(
9313
- (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _162 => _162.handler]) || "") === nitroEntryPath
9289
+ const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _155 => _155.rollupConfig, 'optionalAccess', _156 => _156.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _157 => _157.rollupConfig, 'optionalAccess', _158 => _158.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _159 => _159.output, 'optionalAccess', _160 => _160.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
9290
+ _optionalChain([nitroConfig, 'access', _161 => _161.handlers, 'optionalAccess', _162 => _162.some, 'call', _163 => _163(
9291
+ (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _164 => _164.handler]) || "") === nitroEntryPath
9314
9292
  )])
9315
9293
  );
9316
9294
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
9317
9295
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
9318
9296
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
9319
9297
  const shouldMinify = nitroConfig.minify !== false;
9320
- const configuredEsbuildOptions = {};
9321
- const resolvedEsbuildOptions = {
9322
- // Function-name helpers are unsafe for provider scripts that serialize a
9323
- // function with toString(); the helper is outside the emitted script scope.
9324
- keepNames: !(_optionalChain([config, 'access', _163 => _163.docs, 'optionalAccess', _164 => _164.enabled]) && _optionalChain([config, 'access', _165 => _165.docs, 'access', _166 => _166.adapter, 'optionalAccess', _167 => _167.server])),
9325
- legalComments: "none"
9326
- };
9327
- const prebuiltSSREsbuildOptions = _optionalChain([config, 'access', _168 => _168.docs, 'optionalAccess', _169 => _169.enabled]) && _optionalChain([config, 'access', _170 => _170.docs, 'access', _171 => _171.adapter, 'optionalAccess', _172 => _172.server]) ? resolvedEsbuildOptions : configuredEsbuildOptions;
9328
- const useFarmEsbuildMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
9329
- const esbuildChunkMinifier = useFarmEsbuildMinifier ? createEsbuildChunkMinifyPlugin(resolvedEsbuildOptions) : null;
9298
+ const keepServerNames = !(_optionalChain([config, 'access', _165 => _165.docs, 'optionalAccess', _166 => _166.enabled]) && _optionalChain([config, 'access', _167 => _167.docs, 'access', _168 => _168.adapter, 'optionalAccess', _169 => _169.server]));
9299
+ const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
9300
+ const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
9330
9301
  if (canReusePrebuiltSSR) {
9331
- const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _173 => _173.rollupConfig, 'optionalAccess', _174 => _174.plugins]);
9302
+ const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _170 => _170.rollupConfig, 'optionalAccess', _171 => _171.plugins]);
9332
9303
  nitroConfig.rollupConfig = {
9333
9304
  ...nitroConfig.rollupConfig,
9334
9305
  plugins: [
@@ -9337,11 +9308,11 @@ export default async function farmNitroEventHandler(event) {
9337
9308
  ]
9338
9309
  };
9339
9310
  }
9340
- nitroConfig.minify = useFarmEsbuildMinifier ? false : shouldMinify;
9311
+ nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
9341
9312
  const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
9342
9313
  if (config.security.csp && config.security.csp.nonce) {
9343
9314
  nitroInstance.hooks.hook("prerender:generate", async (route) => {
9344
- if (!route.contents || !_optionalChain([route, 'access', _175 => _175.contentType, 'optionalAccess', _176 => _176.toLowerCase, 'call', _177 => _177(), 'access', _178 => _178.includes, 'call', _179 => _179("html")])) return;
9315
+ if (!route.contents || !_optionalChain([route, 'access', _172 => _172.contentType, 'optionalAccess', _173 => _173.toLowerCase, 'call', _174 => _174(), 'access', _175 => _175.includes, 'call', _176 => _176("html")])) return;
9345
9316
  const staticCsp = await _chunkISTFC3MZcjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
9346
9317
  if (!staticCsp) return;
9347
9318
  route.contents = staticCsp.html;
@@ -9387,26 +9358,25 @@ export default async function farmNitroEventHandler(event) {
9387
9358
  await copyPrebuiltSSRBundle(
9388
9359
  ssrBundle,
9389
9360
  _path2.default.join(prerenderServerDir, FARM_SSR_OUTPUT_DIR),
9390
- {},
9391
- false,
9361
+ null,
9392
9362
  fs
9393
9363
  );
9394
9364
  await registerPrebuiltSSRPackageImport(prerenderServerDir, ssrEntryFile, fs);
9395
9365
  });
9396
9366
  });
9397
9367
  }
9398
- if (esbuildChunkMinifier || useRolldownBuilder) {
9368
+ if (serverChunkMinifier || useRolldownBuilder) {
9399
9369
  nitroInstance.hooks.hook("rollup:before", (_nitro, rollupConfig) => {
9400
9370
  if (useRolldownBuilder) {
9401
9371
  const rolldownConfig = rollupConfig;
9402
9372
  delete rolldownConfig.inject;
9403
9373
  delete rolldownConfig.jsx;
9404
9374
  }
9405
- if (esbuildChunkMinifier) {
9375
+ if (serverChunkMinifier) {
9406
9376
  const configuredPlugins = rollupConfig.plugins;
9407
9377
  rollupConfig.plugins = [
9408
9378
  ...Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [],
9409
- esbuildChunkMinifier
9379
+ serverChunkMinifier
9410
9380
  ];
9411
9381
  }
9412
9382
  });
@@ -9453,8 +9423,7 @@ export default async function farmNitroEventHandler(event) {
9453
9423
  canReusePrebuiltSSR ? copyPrebuiltSSRBundle(
9454
9424
  ssrBundle,
9455
9425
  _path2.default.join(outputDir, "server", FARM_SSR_OUTPUT_DIR),
9456
- prebuiltSSREsbuildOptions,
9457
- shouldMinify,
9426
+ shouldMinify ? { keepNames: keepServerNames, target: "node18" } : null,
9458
9427
  fs
9459
9428
  ) : Promise.resolve(),
9460
9429
  runtimeCopyPromise
@@ -9498,23 +9467,7 @@ function resolveFarmNitroOutputConfig(preset, outputDir) {
9498
9467
  };
9499
9468
  }
9500
9469
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmNitroOutputConfig, "resolveFarmNitroOutputConfig");
9501
- async function copyPrebuiltSSRBundle(ssrBundle, targetDir, configuredEsbuildOptions, minify, fs) {
9502
- const {
9503
- include: _include,
9504
- exclude: _exclude,
9505
- sourceMap: _sourceMap,
9506
- loaders: _loaders,
9507
- ...configuredTransformOptions
9508
- } = configuredEsbuildOptions;
9509
- const hasConfiguredTransforms = Object.keys(configuredTransformOptions).some(
9510
- (option) => option !== "minify"
9511
- );
9512
- const transformOptions = createEsbuildTransformOptions(
9513
- configuredEsbuildOptions,
9514
- minify,
9515
- "node18"
9516
- );
9517
- const transform = minify || hasConfiguredTransforms ? (await import("esbuild")).transform : null;
9470
+ async function copyPrebuiltSSRBundle(ssrBundle, targetDir, minifyOptions, fs) {
9518
9471
  await fs.rm(targetDir, { recursive: true, force: true });
9519
9472
  await Promise.all(
9520
9473
  Object.entries(ssrBundle).map(async ([fileName, output]) => {
@@ -9524,14 +9477,7 @@ async function copyPrebuiltSSRBundle(ssrBundle, targetDir, configuredEsbuildOpti
9524
9477
  await fs.writeFile(targetPath, output.source);
9525
9478
  return;
9526
9479
  }
9527
- let code = output.code;
9528
- if (transform) {
9529
- const result = await transform(code, {
9530
- ...transformOptions,
9531
- sourcefile: fileName
9532
- });
9533
- code = result.code;
9534
- }
9480
+ const code = minifyOptions ? await minifyFarmServerChunk(output.code, fileName, minifyOptions) : output.code;
9535
9481
  await fs.writeFile(targetPath, code);
9536
9482
  })
9537
9483
  );
@@ -9559,7 +9505,7 @@ async function moveVercelOutputPath(src, dest, fs) {
9559
9505
  await fs.rename(src, dest);
9560
9506
  return;
9561
9507
  } catch (error) {
9562
- const code = _optionalChain([error, 'optionalAccess', _180 => _180.code]);
9508
+ const code = _optionalChain([error, 'optionalAccess', _177 => _177.code]);
9563
9509
  if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
9564
9510
  throw error;
9565
9511
  }
@@ -9586,7 +9532,7 @@ async function postProcessVercelOutput(root, outputDir, fs, config, farmWorkflow
9586
9532
  try {
9587
9533
  await moveVercelOutputPath(publicDir, staticDir, fs);
9588
9534
  } catch (error) {
9589
- if (_optionalChain([error, 'optionalAccess', _181 => _181.code]) !== "ENOENT") throw error;
9535
+ if (_optionalChain([error, 'optionalAccess', _178 => _178.code]) !== "ENOENT") throw error;
9590
9536
  }
9591
9537
  await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs);
9592
9538
  await copyPrismaClientForVercel(root, nitroFuncDir, fs);
@@ -9603,7 +9549,7 @@ async function postProcessVercelOutput(root, outputDir, fs, config, farmWorkflow
9603
9549
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
9604
9550
  runtimeRoutes
9605
9551
  });
9606
- const vercelConfigWithWorkflowCrons = _chunkK6FNHVDRcjs.applyFarmWorkflowVercelCrons.call(void 0,
9552
+ const vercelConfigWithWorkflowCrons = _chunkMPEYMSCFcjs.applyFarmWorkflowVercelCrons.call(void 0,
9607
9553
  vercelConfig,
9608
9554
  farmWorkflows.workflows
9609
9555
  );
@@ -9619,7 +9565,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs) {
9619
9565
  const docsContentDir = resolveBuildDocsContentDir(config, root);
9620
9566
  if (!docsContentDir) return;
9621
9567
  const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
9622
- const lastModifiedManifest = _chunkNBAHDVOJcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
9568
+ const lastModifiedManifest = _chunkLYM7HY34cjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
9623
9569
  fallback: "now"
9624
9570
  });
9625
9571
  await fs.rm(bundledContentDir, { recursive: true, force: true });
@@ -9629,7 +9575,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs) {
9629
9575
  force: true
9630
9576
  });
9631
9577
  await fs.writeFile(
9632
- _path2.default.join(bundledContentDir, _chunkNBAHDVOJcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
9578
+ _path2.default.join(bundledContentDir, _chunkLYM7HY34cjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
9633
9579
  `${JSON.stringify(lastModifiedManifest, null, 2)}
9634
9580
  `
9635
9581
  );
@@ -9706,9 +9652,7 @@ async function stageSharpRuntime(config, root, distDir, fs, preset) {
9706
9652
  try {
9707
9653
  await copyPackage("sharp", sharpRequire);
9708
9654
  if (!copiedPackages.has("sharp")) {
9709
- throw new Error(
9710
- "Farm image optimization requires sharp. Reinstall dependencies without omitting optional packages."
9711
- );
9655
+ throw new Error(`Farm image optimization requires sharp. ${_chunkIII667SJcjs.SHARP_INSTALL_HINT}`);
9712
9656
  }
9713
9657
  } catch (error) {
9714
9658
  await fs.rm(stageDir, { recursive: true, force: true });
@@ -9780,20 +9724,31 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs) {
9780
9724
  );
9781
9725
  }
9782
9726
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeStagedDirectory, "mergeStagedDirectory");
9783
- async function copyMetadataImageRuntime(root, nitroFuncDir, fs) {
9727
+ function assertMetadataImageRuntimeInstalled(root, metadataImageRoutes) {
9728
+ const generated = metadataImageRoutes.find((image) => image.sourceType === "module");
9729
+ if (!generated || resolveMetadataImageRuntimePackageJson(root)) return;
9730
+ const file = generated.modulePath ? _chunk5QIKR7RRcjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
9731
+ throw new Error(
9732
+ `${file || "A generated metadata image"} renders with @vercel/og, which is not installed. ${_chunkLYLEZIG3cjs.VERCEL_OG_INSTALL_HINT}`
9733
+ );
9734
+ }
9735
+ _chunkS3JO3N4Hcjs.__name.call(void 0, assertMetadataImageRuntimeInstalled, "assertMetadataImageRuntimeInstalled");
9736
+ function resolveMetadataImageRuntimePackageJson(root) {
9784
9737
  const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
9785
- let runtimeRequire = projectRequire;
9786
- let packageJsonPath = resolvePackageJson(runtimeRequire, "@vercel/og");
9787
- if (!packageJsonPath) {
9788
- try {
9789
- runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
9790
- packageJsonPath = resolvePackageJson(runtimeRequire, "@vercel/og");
9791
- } catch (e24) {
9792
- }
9738
+ const packageJsonPath = resolvePackageJson(projectRequire, "@vercel/og");
9739
+ if (packageJsonPath) return packageJsonPath;
9740
+ try {
9741
+ return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
9742
+ } catch (e24) {
9743
+ return null;
9793
9744
  }
9745
+ }
9746
+ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveMetadataImageRuntimePackageJson, "resolveMetadataImageRuntimePackageJson");
9747
+ async function copyMetadataImageRuntime(root, nitroFuncDir, fs) {
9748
+ const packageJsonPath = resolveMetadataImageRuntimePackageJson(root);
9794
9749
  if (!packageJsonPath) {
9795
9750
  throw new Error(
9796
- "Generated metadata images require @vercel/og. Reinstall @farm.js/core with production dependencies."
9751
+ `The server output imports @vercel/og, which is not installed. ${_chunkLYLEZIG3cjs.VERCEL_OG_INSTALL_HINT}`
9797
9752
  );
9798
9753
  }
9799
9754
  const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf8"));
@@ -9915,7 +9870,7 @@ function createBuildTargetBaseline(config) {
9915
9870
  preset,
9916
9871
  distDir,
9917
9872
  outputDir,
9918
- outputWasDerived: outputDir === _chunkYP5JZ4LFcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
9873
+ outputWasDerived: outputDir === _chunkDNLQMFERcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
9919
9874
  };
9920
9875
  }
9921
9876
  _chunkS3JO3N4Hcjs.__name.call(void 0, createBuildTargetBaseline, "createBuildTargetBaseline");
@@ -9925,8 +9880,8 @@ function resolveBuildTargets(config, options, baseline) {
9925
9880
  const distDir = config.distDir || ".farm";
9926
9881
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
9927
9882
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
9928
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkYP5JZ4LFcjs.getDeployTargetForPreset.call(void 0, preset);
9929
- const outputDir = shouldRefreshDerivedOutput ? _chunkYP5JZ4LFcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
9883
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkDNLQMFERcjs.getDeployTargetForPreset.call(void 0, preset);
9884
+ const outputDir = shouldRefreshDerivedOutput ? _chunkDNLQMFERcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
9930
9885
  return {
9931
9886
  root,
9932
9887
  preset,
@@ -9934,7 +9889,7 @@ function resolveBuildTargets(config, options, baseline) {
9934
9889
  distDir,
9935
9890
  deployTarget,
9936
9891
  outputDir,
9937
- deployOutputDir: _chunkYP5JZ4LFcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
9892
+ deployOutputDir: _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
9938
9893
  };
9939
9894
  }
9940
9895
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveBuildTargets, "resolveBuildTargets");
@@ -9943,7 +9898,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9943
9898
  const targetBaseline = createBuildTargetBaseline(config);
9944
9899
  let targets;
9945
9900
  const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))]);
9946
- const pluginManager = new (0, _chunkL7ARWZYTcjs.PluginManager)({
9901
+ const pluginManager = new (0, _chunkIII667SJcjs.PluginManager)({
9947
9902
  config,
9948
9903
  isDev: false,
9949
9904
  isProd: true
@@ -9970,6 +9925,14 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9970
9925
  outputDir: targets.outputDir
9971
9926
  }
9972
9927
  };
9928
+ config = {
9929
+ ...config,
9930
+ images: _chunkIII667SJcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
9931
+ root: targets.root,
9932
+ preset: targets.preset
9933
+ })
9934
+ };
9935
+ if (_optionalChain([config, 'access', _179 => _179.docs, 'optionalAccess', _180 => _180.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
9973
9936
  pluginManager.updateContext({ config });
9974
9937
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
9975
9938
  _chunk5QIKR7RRcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
@@ -9983,8 +9946,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9983
9946
  });
9984
9947
  _chunk5QIKR7RRcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
9985
9948
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
9986
- if (_optionalChain([productionViteResult, 'optionalAccess', _182 => _182.status]) === "rejected") throw productionViteResult.reason;
9987
- const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _183 => _183.value]);
9949
+ if (_optionalChain([productionViteResult, 'optionalAccess', _181 => _181.status]) === "rejected") throw productionViteResult.reason;
9950
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _182 => _182.value]);
9988
9951
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
9989
9952
  projectModuleServer = await createProjectModuleServer(
9990
9953
  createViteServer,
@@ -9992,18 +9955,18 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
9992
9955
  root,
9993
9956
  rendererBuild.signal
9994
9957
  );
9995
- const farmApp = _chunkL7ARWZYTcjs.createFarmApp.call(void 0, config, projectModuleServer);
9958
+ const farmApp = _chunkIII667SJcjs.createFarmApp.call(void 0, config, projectModuleServer);
9996
9959
  await farmApp.initialize();
9997
9960
  const routeManager = farmApp.getRouteManager();
9998
9961
  const serverRenderer = farmApp.getServerRenderer();
9999
- const typeArtifacts = _chunkXFFQSD2Fcjs.generateFarmTypeArtifacts.call(void 0, {
9962
+ const typeArtifacts = _chunkDW34V5SMcjs.generateFarmTypeArtifacts.call(void 0, {
10000
9963
  root,
10001
9964
  srcDir,
10002
9965
  layers: config.layers,
10003
9966
  plugins: config.plugins,
10004
9967
  extraRoutes: [
10005
- ..._optionalChain([config, 'access', _184 => _184.openapi, 'optionalAccess', _185 => _185.enabled]) && config.openapi.route ? [config.openapi.route] : [],
10006
- ..._chunkNBAHDVOJcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
9968
+ ..._optionalChain([config, 'access', _183 => _183.openapi, 'optionalAccess', _184 => _184.enabled]) && config.openapi.route ? [config.openapi.route] : [],
9969
+ ..._chunkLYM7HY34cjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
10007
9970
  ],
10008
9971
  suppressLintOnLink: config.suppressLintOnLink,
10009
9972
  componentExtensions: config.renderer.componentExtensions,
@@ -10012,8 +9975,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10012
9975
  const message = error instanceof Error ? error.message : String(error);
10013
9976
  _chunk5QIKR7RRcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
10014
9977
  });
10015
- const apiRouteManager = new (0, _chunkB3WK4DTXcjs.APIRouteManager)(
10016
- _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, config),
9978
+ const apiRouteManager = new (0, _chunkIMBMOEWTcjs.APIRouteManager)(
9979
+ _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, config),
10017
9980
  projectModuleServer,
10018
9981
  {
10019
9982
  throwOnLoadError: true,
@@ -10087,7 +10050,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10087
10050
  throw error;
10088
10051
  } finally {
10089
10052
  try {
10090
- await _optionalChain([projectModuleServer, 'optionalAccess', _186 => _186.close, 'call', _187 => _187()]);
10053
+ await _optionalChain([projectModuleServer, 'optionalAccess', _185 => _185.close, 'call', _186 => _186()]);
10091
10054
  } finally {
10092
10055
  rendererBuild.abort();
10093
10056
  }
@@ -10095,11 +10058,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10095
10058
  }
10096
10059
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildWithProductionNodeEnv, "buildWithProductionNodeEnv");
10097
10060
  async function createProjectModuleServer(createViteServer, config, root, buildLifetime) {
10098
- const rendererVitePlugins = await _chunkTFAXUHWXcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
10061
+ const rendererVitePlugins = await _chunkPSV6XKPOcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
10099
10062
  ssr: true,
10100
10063
  buildLifetime
10101
10064
  });
10102
- const viteConfig = _chunkL7ARWZYTcjs.mergeFarmViteConfig.call(void 0,
10065
+ const viteConfig = _chunkIII667SJcjs.mergeFarmViteConfig.call(void 0,
10103
10066
  {
10104
10067
  root,
10105
10068
  appType: "custom",
@@ -10111,7 +10074,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10111
10074
  },
10112
10075
  plugins: [
10113
10076
  ...rendererVitePlugins,
10114
- _chunkL7ARWZYTcjs.farmFontImportsPlugin.call(void 0, {
10077
+ _chunkIII667SJcjs.farmFontImportsPlugin.call(void 0, {
10115
10078
  root,
10116
10079
  basePath: config.basePath,
10117
10080
  publicDir: config.publicDir
@@ -10123,7 +10086,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10123
10086
  hmr: false
10124
10087
  },
10125
10088
  resolve: {
10126
- alias: _chunkL7ARWZYTcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10089
+ alias: _chunkIII667SJcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10127
10090
  dedupe: [...config.renderer.dedupe || []]
10128
10091
  },
10129
10092
  optimizeDeps: {
@@ -10209,7 +10172,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
10209
10172
  define: {
10210
10173
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
10211
10174
  __FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
10212
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _188 => _188.env, 'optionalAccess', _189 => _189.public]) || {})
10175
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _187 => _187.env, 'optionalAccess', _188 => _188.public]) || {})
10213
10176
  },
10214
10177
  plugins: [
10215
10178
  farmI18nClientBridgePlugin(),
@@ -10222,7 +10185,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
10222
10185
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildSSR, "buildSSR");
10223
10186
  function resolveLegacyPageEntry(config, root, srcDir) {
10224
10187
  const appDir = _path2.default.join(root, srcDir, "app");
10225
- for (const extension of _chunkTFAXUHWXcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer)) {
10188
+ for (const extension of _chunkPSV6XKPOcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer)) {
10226
10189
  const candidate = _path2.default.join(appDir, `page${extension}`);
10227
10190
  if (_fs.existsSync.call(void 0, candidate)) return candidate;
10228
10191
  }
@@ -10231,7 +10194,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
10231
10194
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveLegacyPageEntry, "resolveLegacyPageEntry");
10232
10195
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
10233
10196
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
10234
- import("./nitro-TSGDUJMN.cjs"),
10197
+ import("./nitro-KQDU7CFE.cjs"),
10235
10198
  import("nitro/builder")
10236
10199
  ]);
10237
10200
  let nitroConfig = await createNitroConfig(
@@ -10244,7 +10207,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10244
10207
  if (pluginManager) {
10245
10208
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
10246
10209
  }
10247
- const outputDir = _chunkYP5JZ4LFcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10210
+ const outputDir = _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10248
10211
  const serverOutputDir = _path2.default.join(outputDir, "server");
10249
10212
  const publicOutputDir = _path2.default.join(outputDir, "public");
10250
10213
  const { mkdir, cp } = await import("fs/promises");
@@ -10315,7 +10278,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10315
10278
  root,
10316
10279
  preset,
10317
10280
  distDir,
10318
- outputDir: _chunkYP5JZ4LFcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
10281
+ outputDir: _chunkDNLQMFERcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
10319
10282
  });
10320
10283
  }
10321
10284
  }