@farm.js/core 0.1.71 → 0.1.72

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 (222) hide show
  1. package/dist/agent-mcp-handler-KE4J3W7S.cjs +1 -1
  2. package/dist/agent-mcp-handler-VIT4GOSR.mjs +1 -1
  3. package/dist/{agent-mcp.d-BzNw6JI8.d.ts → agent-mcp.d-BO3rZXEM.d.ts} +2 -2
  4. package/dist/{agent-mcp.d-CgFen3EH.d.mts → agent-mcp.d-Cwff7lcA.d.mts} +2 -2
  5. package/dist/agent-runtime.d.mts +3 -3
  6. package/dist/agent-runtime.d.ts +3 -3
  7. package/dist/{analyzer-VK3BAOFI.mjs → analyzer-5Q75LTIL.mjs} +2 -2
  8. package/dist/analyzer-UJG4MIZW.cjs +16 -0
  9. package/dist/api/node.d.mts +5 -5
  10. package/dist/api/node.d.ts +5 -5
  11. package/dist/api/route-manager.cjs +7 -6
  12. package/dist/api/route-manager.d.mts +7 -7
  13. package/dist/api/route-manager.d.ts +7 -7
  14. package/dist/api/route-manager.mjs +6 -5
  15. package/dist/api/runtime.d.mts +4 -4
  16. package/dist/api/runtime.d.ts +4 -4
  17. package/dist/api.cjs +8 -7
  18. package/dist/api.d.mts +8 -8
  19. package/dist/api.d.ts +8 -8
  20. package/dist/api.mjs +7 -6
  21. package/dist/{app-manifest.d-DY4JfJxi.d.ts → app-manifest.d-DwjGkYlP.d.ts} +1 -1
  22. package/dist/{app-manifest.d-DpDK_B1k.d.mts → app-manifest.d-USD_IbFd.d.mts} +1 -1
  23. package/dist/app-markdown.d.mts +4 -4
  24. package/dist/app-markdown.d.ts +4 -4
  25. package/dist/{app.d-BeK6bb1c.d.ts → app.d-DAmF2MAk.d.ts} +48 -6
  26. package/dist/{app.d-D-5UNrFd.d.mts → app.d-fW06_h8h.d.mts} +48 -6
  27. package/dist/{chunk-7A3URI2F.mjs → chunk-2EVESLP3.mjs} +8 -1
  28. package/dist/{chunk-X7LGLF33.mjs → chunk-3JN5M3T5.mjs} +259 -61
  29. package/dist/{chunk-KEB7AGS6.cjs → chunk-3WG7GJQL.cjs} +7 -2
  30. package/dist/{chunk-K66JILV3.cjs → chunk-5LOARKDP.cjs} +2 -2
  31. package/dist/{chunk-UISZLYKY.cjs → chunk-5R4Q5FN7.cjs} +2 -2
  32. package/dist/{chunk-3BQ7QHUH.cjs → chunk-5X6OHJEE.cjs} +15 -3
  33. package/dist/{chunk-GUU3IZSM.mjs → chunk-5XFKWHZD.mjs} +234 -47
  34. package/dist/{chunk-MITIAOUQ.mjs → chunk-645ENY7W.mjs} +2 -2
  35. package/dist/{chunk-RJUCNO7R.mjs → chunk-77VNYVVX.mjs} +1 -1
  36. package/dist/{chunk-PLXD2MJV.cjs → chunk-7QCJDYZQ.cjs} +2 -2
  37. package/dist/{chunk-V25GSH43.mjs → chunk-AUAMXI6N.mjs} +1 -1
  38. package/dist/{chunk-2IFT2CSA.cjs → chunk-BE7AQXJB.cjs} +346 -148
  39. package/dist/{chunk-7BUE2GM6.mjs → chunk-BSXKZPFE.mjs} +70 -19
  40. package/dist/{chunk-2MR4MABG.cjs → chunk-C5AM2XDN.cjs} +54 -4
  41. package/dist/{chunk-KWST2O22.cjs → chunk-CBLRSZQL.cjs} +488 -301
  42. package/dist/{chunk-BBPDJGCU.cjs → chunk-CYOTNHDF.cjs} +2 -2
  43. package/dist/{chunk-W2T6NDNP.mjs → chunk-DGNMXL2O.mjs} +1 -1
  44. package/dist/{chunk-QUFENL7Q.mjs → chunk-DS7JGFW5.mjs} +13 -1
  45. package/dist/{chunk-IGXS54GC.mjs → chunk-E2V7RRFL.mjs} +1 -1
  46. package/dist/{chunk-CSQPMV3Q.cjs → chunk-E3LE6EZH.cjs} +4 -4
  47. package/dist/{chunk-JVA4PIYN.cjs → chunk-ET6WW3FY.cjs} +338 -171
  48. package/dist/{chunk-VXB5CMNC.cjs → chunk-EXN4DTVF.cjs} +2 -2
  49. package/dist/{chunk-SXMWVP2L.cjs → chunk-FSSONJRV.cjs} +4 -4
  50. package/dist/{chunk-Y2SZVIVH.cjs → chunk-GPICBTDV.cjs} +8 -1
  51. package/dist/{chunk-7OHJWFLB.cjs → chunk-HLMUWKAP.cjs} +333 -282
  52. package/dist/{chunk-ZPUAOKHV.cjs → chunk-IWCYRDRQ.cjs} +3 -3
  53. package/dist/{chunk-2AM26UGI.cjs → chunk-NLBK37HI.cjs} +5 -4
  54. package/dist/{chunk-NA77GEIU.mjs → chunk-NV26EGMC.mjs} +51 -1
  55. package/dist/{chunk-DPYBVVL3.cjs → chunk-OSEQL34Q.cjs} +2 -2
  56. package/dist/{chunk-IYDJNCR7.mjs → chunk-OSMUE5ST.mjs} +7 -2
  57. package/dist/{chunk-UQUOSNRN.mjs → chunk-QUYAGU65.mjs} +214 -47
  58. package/dist/{chunk-DPIGYXSV.mjs → chunk-RFWWXEIF.mjs} +1 -1
  59. package/dist/{chunk-E77IA5IF.mjs → chunk-RLFGKJQ6.mjs} +1 -1
  60. package/dist/{chunk-3AUINHFG.mjs → chunk-TNYC3TYP.mjs} +3 -2
  61. package/dist/{chunk-4OD2LXF2.mjs → chunk-VAWDGGW3.mjs} +1 -1
  62. package/dist/{chunk-MU5V7XHL.mjs → chunk-VJSXPN3W.mjs} +3 -0
  63. package/dist/{chunk-DU4VHHPJ.mjs → chunk-VO55MMBX.mjs} +1 -1
  64. package/dist/{chunk-LDVJIBGN.mjs → chunk-VT25ERQK.mjs} +1 -1
  65. package/dist/{chunk-2CQC5CMD.mjs → chunk-WIJF3PBM.mjs} +1 -1
  66. package/dist/{chunk-FILXOEWD.cjs → chunk-YXIQYWOK.cjs} +2 -2
  67. package/dist/{chunk-THG2TVDH.mjs → chunk-YZLEOMMA.mjs} +3 -3
  68. package/dist/{chunk-MEJCP2LX.cjs → chunk-ZDZUFD67.cjs} +1 -1
  69. package/dist/{chunk-Q5HMVGR5.cjs → chunk-ZFEJ2SF2.cjs} +13 -13
  70. package/dist/{chunk-LNVGXUL3.cjs → chunk-ZMSVKVI3.cjs} +3 -0
  71. package/dist/{client-component.d-fYupugbZ.d.ts → client-component.d-9J7CkTWW.d.ts} +2 -2
  72. package/dist/{client-component.d-DwpH251K.d.mts → client-component.d-ciHeCxr-.d.mts} +2 -2
  73. package/dist/{client-plugins.d-BxqFfHpM.d.ts → client-plugins.d-CUOhfapO.d.ts} +4 -3
  74. package/dist/{client-plugins.d-k3bOT5gz.d.mts → client-plugins.d-JnRz5a1o.d.mts} +4 -3
  75. package/dist/client-plugins.d.mts +3 -3
  76. package/dist/client-plugins.d.ts +3 -3
  77. package/dist/client.cjs +1 -1
  78. package/dist/client.d.mts +8 -8
  79. package/dist/client.d.ts +8 -8
  80. package/dist/client.mjs +1 -1
  81. package/dist/config.d.mts +3 -3
  82. package/dist/config.d.ts +3 -3
  83. package/dist/desktop.d.mts +4 -4
  84. package/dist/desktop.d.ts +4 -4
  85. package/dist/{devtools-6MXPFPNJ.mjs → devtools-7JPQMSTQ.mjs} +3 -3
  86. package/dist/{devtools-O5625KCK.cjs → devtools-IZFUYWPG.cjs} +4 -4
  87. package/dist/docs.cjs +5 -5
  88. package/dist/docs.d.mts +4 -4
  89. package/dist/docs.d.ts +4 -4
  90. package/dist/docs.mjs +4 -4
  91. package/dist/environment/vite.cjs +3 -3
  92. package/dist/environment/vite.mjs +2 -2
  93. package/dist/{headers.d-DalIGbVO.d.ts → headers.d-CqpTL_fZ.d.ts} +2 -2
  94. package/dist/{headers.d-sNT7ZQiU.d.mts → headers.d-rbbTKGaN.d.mts} +2 -2
  95. package/dist/i18n/client.cjs +3 -2
  96. package/dist/i18n/client.d.mts +2 -2
  97. package/dist/i18n/client.d.ts +2 -2
  98. package/dist/i18n/client.mjs +2 -1
  99. package/dist/i18n/index.cjs +3 -2
  100. package/dist/i18n/index.d.mts +3 -3
  101. package/dist/i18n/index.d.ts +3 -3
  102. package/dist/i18n/index.mjs +2 -1
  103. package/dist/i18n/server.cjs +6 -5
  104. package/dist/i18n/server.d.mts +5 -5
  105. package/dist/i18n/server.d.ts +5 -5
  106. package/dist/i18n/server.mjs +5 -4
  107. package/dist/index.cjs +22 -22
  108. package/dist/{index.d-BcA-secm.d.ts → index.d-CMKvzHLW.d.ts} +1 -1
  109. package/dist/{index.d-DDHHAv7j.d.mts → index.d-D_B2D9Il.d.mts} +1 -1
  110. package/dist/index.d.mts +23 -23
  111. package/dist/index.d.ts +23 -23
  112. package/dist/index.mjs +21 -21
  113. package/dist/integrations/orm.d.mts +3 -3
  114. package/dist/integrations/orm.d.ts +3 -3
  115. package/dist/integrations.d.mts +3 -3
  116. package/dist/integrations.d.ts +3 -3
  117. package/dist/internal/app-markdown-runtime.d.mts +4 -4
  118. package/dist/internal/app-markdown-runtime.d.ts +4 -4
  119. package/dist/internal/build-runtime.cjs +21 -21
  120. package/dist/internal/build-runtime.d.mts +5 -5
  121. package/dist/internal/build-runtime.d.ts +5 -5
  122. package/dist/internal/build-runtime.mjs +20 -20
  123. package/dist/internal/cli-runtime.cjs +6 -6
  124. package/dist/internal/cli-runtime.mjs +5 -5
  125. package/dist/internal/client-error-overlay.cjs +4 -4
  126. package/dist/internal/client-error-overlay.mjs +1 -1
  127. package/dist/internal/client-runtime.cjs +2 -2
  128. package/dist/internal/client-runtime.d.mts +6 -6
  129. package/dist/internal/client-runtime.d.ts +6 -6
  130. package/dist/internal/client-runtime.mjs +3 -3
  131. package/dist/internal/compression-runtime.d.mts +3 -3
  132. package/dist/internal/compression-runtime.d.ts +3 -3
  133. package/dist/internal/config-runtime.cjs +5 -5
  134. package/dist/internal/config-runtime.d.mts +6 -6
  135. package/dist/internal/config-runtime.d.ts +6 -6
  136. package/dist/internal/config-runtime.mjs +4 -4
  137. package/dist/internal/infra-analytics-runtime.cjs +7 -7
  138. package/dist/internal/infra-analytics-runtime.mjs +5 -5
  139. package/dist/internal/native-server-fns.cjs +4 -4
  140. package/dist/internal/native-server-fns.mjs +3 -3
  141. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  142. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  143. package/dist/internal/production-runtime.cjs +13 -13
  144. package/dist/internal/production-runtime.d.mts +36 -24
  145. package/dist/internal/production-runtime.d.ts +36 -24
  146. package/dist/internal/production-runtime.mjs +12 -12
  147. package/dist/internal/vercel-edge-middleware.d.mts +2 -2
  148. package/dist/internal/vercel-edge-middleware.d.ts +2 -2
  149. package/dist/markdown.d.mts +3 -3
  150. package/dist/markdown.d.ts +3 -3
  151. package/dist/middleware.cjs +3 -3
  152. package/dist/middleware.d.mts +4 -4
  153. package/dist/middleware.d.ts +4 -4
  154. package/dist/middleware.mjs +2 -2
  155. package/dist/mobile.d.mts +3 -3
  156. package/dist/mobile.d.ts +3 -3
  157. package/dist/{mount.d-D3JOux2V.d.ts → mount.d-B0XMxDRh.d.ts} +1 -1
  158. package/dist/{mount.d-C1PONsEe.d.mts → mount.d-ImEO7q8a.d.mts} +1 -1
  159. package/dist/{navigation-delegate.d-CJQQHboA.d.mts → navigation-delegate.d-83Q7ksf7.d.mts} +1 -1
  160. package/dist/{navigation-delegate.d-CQQPbdkE.d.ts → navigation-delegate.d-RRx1CSlb.d.ts} +1 -1
  161. package/dist/navigation.d.mts +6 -6
  162. package/dist/navigation.d.ts +6 -6
  163. package/dist/plugin.cjs +15 -15
  164. package/dist/plugin.d.mts +6 -6
  165. package/dist/plugin.d.ts +6 -6
  166. package/dist/plugin.mjs +14 -14
  167. package/dist/{production-runtime.d-B0IeWWyO.d.mts → production-runtime.d-Bcu37SCo.d.mts} +1 -1
  168. package/dist/{production-runtime.d-q3aHIv5Y.d.ts → production-runtime.d-qPj3XRET.d.ts} +1 -1
  169. package/dist/{render-plan.d-DHuJMJRP.d.ts → render-plan.d-Ds2sXJ5m.d.ts} +1 -1
  170. package/dist/{render-plan.d-CiUj0rq5.d.mts → render-plan.d-wP8nTeRV.d.mts} +1 -1
  171. package/dist/renderer-client.cjs +3 -2
  172. package/dist/renderer-client.d.mts +6 -6
  173. package/dist/renderer-client.d.ts +6 -6
  174. package/dist/renderer-client.mjs +2 -1
  175. package/dist/{request.d-D-F7o7tb.d.mts → request.d-F3h7K37m.d.mts} +1 -1
  176. package/dist/{request.d-DRUbOmYD.d.ts → request.d-zpSn6pu_.d.ts} +1 -1
  177. package/dist/request.d.mts +4 -4
  178. package/dist/request.d.ts +4 -4
  179. package/dist/{resolver.d-9iKC79CU.d.mts → resolver.d-DJgzbdsp.d.mts} +1 -1
  180. package/dist/{resolver.d-CY6mEa_F.d.ts → resolver.d-yaHcGCCG.d.ts} +1 -1
  181. package/dist/{route-rendering.d-KwqM_mlK.d.ts → route-rendering.d-BL0_AdKj.d.ts} +1 -1
  182. package/dist/{route-rendering.d-6smgwT2t.d.mts → route-rendering.d-Mw0ZKG2e.d.mts} +1 -1
  183. package/dist/{router.d-B6sesMRD.d.ts → router.d-BwXigemZ.d.ts} +1 -1
  184. package/dist/{router.d-BYmDeDlp.d.mts → router.d-NGVsU11T.d.mts} +1 -1
  185. package/dist/{routes.d-D3aJw1H5.d.mts → routes.d-CCccJRrp.d.mts} +1 -1
  186. package/dist/{routes.d-K-Qg79AA.d.ts → routes.d-b7khoRoU.d.ts} +1 -1
  187. package/dist/routes.d.mts +3 -3
  188. package/dist/routes.d.ts +3 -3
  189. package/dist/{routing.d-DwSUVZbF.d.mts → routing.d-BhPgtN_S.d.ts} +2 -1
  190. package/dist/{routing.d-BxOZ2YWc.d.ts → routing.d-D67HQmnv.d.mts} +2 -1
  191. package/dist/{rsc-pipeline-P4PCWDO2.cjs → rsc-pipeline-BNXYMG4G.cjs} +5 -5
  192. package/dist/{rsc-pipeline-R2GOKIMU.mjs → rsc-pipeline-DHYZLWSF.mjs} +4 -4
  193. package/dist/{runtime-WA2Q4SLG.cjs → runtime-IWOT6ZVC.cjs} +6 -6
  194. package/dist/{runtime-DP5DYGW5.mjs → runtime-XPYKUNL3.mjs} +4 -4
  195. package/dist/{runtime.d-BFSJf-ww.d.mts → runtime.d-BA3MzhXz.d.mts} +1 -1
  196. package/dist/{runtime.d-nUz0HAL4.d.mts → runtime.d-CTAXWZby.d.mts} +2 -2
  197. package/dist/{runtime.d-CbdMI0Oy.d.ts → runtime.d-OBIZWpx1.d.ts} +1 -1
  198. package/dist/{runtime.d-B_uPfMjA.d.ts → runtime.d-PUA5qBnd.d.ts} +2 -2
  199. package/dist/server-plugins.d.mts +5 -5
  200. package/dist/server-plugins.d.ts +5 -5
  201. package/dist/server.cjs +33 -33
  202. package/dist/server.d.mts +14 -14
  203. package/dist/server.d.ts +14 -14
  204. package/dist/server.mjs +17 -17
  205. package/dist/{spa-router.d-D4EDwR20.d.mts → spa-router.d-BG2XzE5p.d.mts} +3 -3
  206. package/dist/{spa-router.d-mC1D5cTN.d.ts → spa-router.d-DrYT944-.d.ts} +3 -3
  207. package/dist/testing.cjs +6 -5
  208. package/dist/testing.d.mts +3 -3
  209. package/dist/testing.d.ts +3 -3
  210. package/dist/testing.mjs +6 -5
  211. package/dist/{types.d-wVRlLtBf.d.ts → types.d-euATAbE4.d.mts} +4 -0
  212. package/dist/{types.d-wVRlLtBf.d.mts → types.d-euATAbE4.d.ts} +4 -0
  213. package/dist/{utils.d-DxMzteqE.d.mts → utils.d-C1k9BJeD.d.mts} +1 -1
  214. package/dist/{utils.d-A2X3a6z_.d.ts → utils.d-DcF4wxey.d.ts} +1 -1
  215. package/dist/version.cjs +2 -2
  216. package/dist/version.mjs +1 -1
  217. package/dist/vite.cjs +15 -15
  218. package/dist/vite.d.mts +7 -7
  219. package/dist/vite.d.ts +7 -7
  220. package/dist/vite.mjs +14 -14
  221. package/package.json +1 -1
  222. package/dist/analyzer-LPIVRSTJ.cjs +0 -16
@@ -26,7 +26,7 @@ var _chunkNG2EZ6QScjs = require('./chunk-NG2EZ6QS.cjs');
26
26
 
27
27
 
28
28
 
29
- var _chunkZPUAOKHVcjs = require('./chunk-ZPUAOKHV.cjs');
29
+ var _chunkIWCYRDRQcjs = require('./chunk-IWCYRDRQ.cjs');
30
30
 
31
31
 
32
32
  var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
@@ -41,7 +41,7 @@ var _chunk4BS3HSY7cjs = require('./chunk-4BS3HSY7.cjs');
41
41
 
42
42
 
43
43
 
44
- var _chunkUISZLYKYcjs = require('./chunk-UISZLYKY.cjs');
44
+ var _chunk5R4Q5FN7cjs = require('./chunk-5R4Q5FN7.cjs');
45
45
 
46
46
 
47
47
 
@@ -65,7 +65,7 @@ var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
65
65
  var _chunkJWY66PIDcjs = require('./chunk-JWY66PID.cjs');
66
66
 
67
67
 
68
- var _chunk3BQ7QHUHcjs = require('./chunk-3BQ7QHUH.cjs');
68
+ var _chunk5X6OHJEEcjs = require('./chunk-5X6OHJEE.cjs');
69
69
 
70
70
 
71
71
  var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
@@ -74,7 +74,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
74
74
 
75
75
 
76
76
 
77
- var _chunkKEB7AGS6cjs = require('./chunk-KEB7AGS6.cjs');
77
+ var _chunk3WG7GJQLcjs = require('./chunk-3WG7GJQL.cjs');
78
78
 
79
79
 
80
80
  var _chunk3GNHJ3RNcjs = require('./chunk-3GNHJ3RN.cjs');
@@ -110,7 +110,7 @@ var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
110
110
 
111
111
 
112
112
 
113
- var _chunkKWST2O22cjs = require('./chunk-KWST2O22.cjs');
113
+ var _chunkCBLRSZQLcjs = require('./chunk-CBLRSZQL.cjs');
114
114
 
115
115
 
116
116
 
@@ -123,7 +123,7 @@ var _chunkPMU4U2W2cjs = require('./chunk-PMU4U2W2.cjs');
123
123
 
124
124
 
125
125
 
126
- var _chunkCSQPMV3Qcjs = require('./chunk-CSQPMV3Q.cjs');
126
+ var _chunkE3LE6EZHcjs = require('./chunk-E3LE6EZH.cjs');
127
127
 
128
128
 
129
129
 
@@ -136,7 +136,7 @@ var _chunkCSQPMV3Qcjs = require('./chunk-CSQPMV3Q.cjs');
136
136
 
137
137
 
138
138
 
139
- var _chunk2MR4MABGcjs = require('./chunk-2MR4MABG.cjs');
139
+ var _chunkC5AM2XDNcjs = require('./chunk-C5AM2XDN.cjs');
140
140
 
141
141
 
142
142
  var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
@@ -150,7 +150,7 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
150
150
 
151
151
 
152
152
 
153
- var _chunkSXMWVP2Lcjs = require('./chunk-SXMWVP2L.cjs');
153
+ var _chunkFSSONJRVcjs = require('./chunk-FSSONJRV.cjs');
154
154
 
155
155
 
156
156
 
@@ -158,7 +158,7 @@ var _chunkSXMWVP2Lcjs = require('./chunk-SXMWVP2L.cjs');
158
158
  var _chunkTP4RAV7Ycjs = require('./chunk-TP4RAV7Y.cjs');
159
159
 
160
160
 
161
- var _chunkDPYBVVL3cjs = require('./chunk-DPYBVVL3.cjs');
161
+ var _chunkOSEQL34Qcjs = require('./chunk-OSEQL34Q.cjs');
162
162
 
163
163
 
164
164
  var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
@@ -176,7 +176,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
176
176
 
177
177
 
178
178
 
179
- var _chunk2IFT2CSAcjs = require('./chunk-2IFT2CSA.cjs');
179
+ var _chunkBE7AQXJBcjs = require('./chunk-BE7AQXJB.cjs');
180
180
 
181
181
 
182
182
 
@@ -255,10 +255,10 @@ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
255
255
  var _chunkMHLNWRCJcjs = require('./chunk-MHLNWRCJ.cjs');
256
256
 
257
257
 
258
- var _chunkK66JILV3cjs = require('./chunk-K66JILV3.cjs');
258
+ var _chunk5LOARKDPcjs = require('./chunk-5LOARKDP.cjs');
259
259
 
260
260
 
261
- var _chunkBBPDJGCUcjs = require('./chunk-BBPDJGCU.cjs');
261
+ var _chunkCYOTNHDFcjs = require('./chunk-CYOTNHDF.cjs');
262
262
 
263
263
 
264
264
  var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
@@ -283,14 +283,14 @@ var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
283
283
  var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
284
284
 
285
285
 
286
- var _chunkMEJCP2LXcjs = require('./chunk-MEJCP2LX.cjs');
286
+ var _chunkZDZUFD67cjs = require('./chunk-ZDZUFD67.cjs');
287
287
 
288
288
 
289
- var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
290
289
 
290
+ var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
291
291
 
292
292
 
293
- var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
293
+ var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
294
294
 
295
295
 
296
296
  var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
@@ -456,7 +456,7 @@ async function compileFarmDocsManifest(docs, options) {
456
456
  isPathGuarded: options.isPathGuarded,
457
457
  basePath
458
458
  });
459
- const apiHandler = _chunkUISZLYKYcjs.createFarmDocsAPIHandler.call(void 0, {
459
+ const apiHandler = _chunk5R4Q5FN7cjs.createFarmDocsAPIHandler.call(void 0, {
460
460
  rootDir: options.root,
461
461
  srcDir: options.srcDir,
462
462
  docs,
@@ -734,7 +734,7 @@ async function createFarmRouteRuntimeManifest(options) {
734
734
  const routes = [];
735
735
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
736
736
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
737
- const rendering = await _chunkCSQPMV3Qcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
737
+ const rendering = await _chunkE3LE6EZHcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
738
738
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
739
739
  routes.push({
740
740
  kind: "page",
@@ -1044,14 +1044,40 @@ function buildFarmVercelRoutes(options) {
1044
1044
  function escapeRegExp2(value) {
1045
1045
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1046
1046
  }
1047
+ var FARM_VERCEL_ROUTE_SOURCE_MAX_LENGTH = 4096;
1048
+ function groupFarmVercelRouteAlternatives(items, alternative) {
1049
+ const groups = [];
1050
+ let current = null;
1051
+ const frame = 6;
1052
+ for (const item of items) {
1053
+ const part = alternative(item);
1054
+ if (part.length + frame > FARM_VERCEL_ROUTE_SOURCE_MAX_LENGTH) {
1055
+ throw new Error(
1056
+ `Farm cannot route ${JSON.stringify(part.slice(0, 80))}\u2026 on Vercel: its pattern is longer than Vercel's ${FARM_VERCEL_ROUTE_SOURCE_MAX_LENGTH}-character limit for a route. Shorten the page's path.`
1057
+ );
1058
+ }
1059
+ if (current && current.length + 1 + part.length > FARM_VERCEL_ROUTE_SOURCE_MAX_LENGTH) {
1060
+ groups.push({ src: `^(?:${current.parts.join("|")})$`, items: current.items });
1061
+ current = null;
1062
+ }
1063
+ if (!current) current = { parts: [], items: [], length: frame - 1 };
1064
+ current.parts.push(part);
1065
+ current.items.push(item);
1066
+ current.length += 1 + part.length;
1067
+ }
1068
+ if (current) groups.push({ src: `^(?:${current.parts.join("|")})$`, items: current.items });
1069
+ return groups;
1070
+ }
1047
1071
  function createFarmVercelCanonicalSlashRoutes(publicPaths) {
1048
1072
  const otherSpellings = [
1049
1073
  ...new Set(
1050
1074
  publicPaths.filter((pathname) => pathname !== "/").map((pathname) => pathname.endsWith("/") ? pathname.replace(/\/+$/, "") : `${pathname}/`).filter((pathname) => pathname !== "")
1051
1075
  )
1052
1076
  ];
1053
- if (otherSpellings.length === 0) return [];
1054
- return [{ src: `^(?:${otherSpellings.map(escapeRegExp2).join("|")})$`, dest: "/__nitro" }];
1077
+ return groupFarmVercelRouteAlternatives(otherSpellings, escapeRegExp2).map((group) => ({
1078
+ src: group.src,
1079
+ dest: "/__nitro"
1080
+ }));
1055
1081
  }
1056
1082
 
1057
1083
  // src/nitro/ssr-public-assets.ts
@@ -1321,7 +1347,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
1321
1347
  // removed block used (`readFileSync` for a version, say).
1322
1348
  enforce: "pre",
1323
1349
  transform: {
1324
- filter: { id: _chunkKWST2O22cjs.fileNamePattern.call(void 0, configFiles) },
1350
+ filter: { id: _chunkCBLRSZQLcjs.fileNamePattern.call(void 0, configFiles) },
1325
1351
  async handler(code, id) {
1326
1352
  const file = id.split("?", 1)[0];
1327
1353
  if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
@@ -1462,18 +1488,17 @@ function toFarmVercelEdgeGuardedUrls(pathnames, basePath) {
1462
1488
  ...new Set(pathnames.flatMap((pathname) => [pathname, _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, pathname, basePath)]))
1463
1489
  ];
1464
1490
  }
1465
- function createFarmVercelEdgeMiddlewareRoute(pathnames, basePath = "/") {
1491
+ function createFarmVercelEdgeMiddlewareRoutes(pathnames, basePath = "/") {
1466
1492
  const publicPaths = toFarmVercelEdgeGuardedUrls(pathnames, basePath);
1467
- const alternatives = publicPaths.map((pathname) => {
1493
+ return groupFarmVercelRouteAlternatives(publicPaths, (pathname) => {
1468
1494
  const trimmed = pathname.replace(/\/+$/, "");
1469
1495
  return trimmed ? `${escapeRegExp3(trimmed)}(?:/|/index\\.html|\\.html)?` : "/(?:index\\.html)?";
1470
- });
1471
- return {
1472
- src: `^(?:${alternatives.join("|")})$`,
1496
+ }).map((group) => ({
1497
+ src: group.src,
1473
1498
  middlewarePath: FARM_VERCEL_EDGE_MIDDLEWARE_FUNCTION,
1474
- middlewareRawSrc: publicPaths,
1499
+ middlewareRawSrc: group.items,
1475
1500
  continue: true
1476
- };
1501
+ }));
1477
1502
  }
1478
1503
  function generateFarmVercelEdgeMiddlewareEntry(routes, config, guardedPages) {
1479
1504
  const imports = routes.map(
@@ -1549,7 +1574,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
1549
1574
  logLevel: "silent",
1550
1575
  plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
1551
1576
  resolve: {
1552
- alias: _chunkKWST2O22cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
1577
+ alias: _chunkCBLRSZQLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
1553
1578
  conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
1554
1579
  },
1555
1580
  transform: {
@@ -1938,7 +1963,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
1938
1963
  return {
1939
1964
  name: "farm-omitted-metadata-image-runtime",
1940
1965
  resolveId: {
1941
- filter: { id: _chunkKWST2O22cjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
1966
+ filter: { id: _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
1942
1967
  handler(source, importer) {
1943
1968
  if (source !== "@vercel/og") return null;
1944
1969
  const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
@@ -1947,7 +1972,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
1947
1972
  }
1948
1973
  },
1949
1974
  load: {
1950
- filter: { id: _chunkKWST2O22cjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
1975
+ filter: { id: _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
1951
1976
  handler(id) {
1952
1977
  if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
1953
1978
  return `
@@ -2619,7 +2644,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
2619
2644
  }
2620
2645
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
2621
2646
  await fs4.writeFile(fontCssPath, normalizedFontCss);
2622
- await fs4.writeFile(clientCssPath, _chunkKWST2O22cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2647
+ await fs4.writeFile(clientCssPath, _chunkCBLRSZQLcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2623
2648
  }
2624
2649
  function importsFarmClientBlockedPackage(id, packageName) {
2625
2650
  return id === packageName || id.startsWith(`${packageName}/`);
@@ -2672,7 +2697,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
2672
2697
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${_path2.default.resolve(modulePath)}`;
2673
2698
  let plan = cache.get(key);
2674
2699
  if (!plan) {
2675
- plan = _chunk2IFT2CSAcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2700
+ plan = _chunkBE7AQXJBcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2676
2701
  cache.set(key, plan);
2677
2702
  }
2678
2703
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -2701,14 +2726,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2701
2726
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
2702
2727
  );
2703
2728
  }
2704
- const isolatedMode = _chunk2IFT2CSAcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2729
+ const isolatedMode = _chunkBE7AQXJBcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2705
2730
  _optionalChain([config, 'access', _86 => _86.experimental, 'optionalAccess', _87 => _87.isolatedClientHydration]),
2706
2731
  {
2707
2732
  serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _88 => _88.experimental, 'optionalAccess', _89 => _89.serverComponents])) === "rsc",
2708
2733
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
2709
2734
  }
2710
2735
  );
2711
- const planOptions = _chunk2IFT2CSAcjs.getFarmClientHydrationPlanOptions.call(void 0,
2736
+ const planOptions = _chunkBE7AQXJBcjs.getFarmClientHydrationPlanOptions.call(void 0,
2712
2737
  config.renderer,
2713
2738
  Boolean(unsupportedIntegrationProvider)
2714
2739
  );
@@ -2765,7 +2790,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2765
2790
  };
2766
2791
  }
2767
2792
  });
2768
- const layoutAppliesToRoute = _chunk2MR4MABGcjs.routeBoundaryCoversDirectory;
2793
+ const layoutAppliesToRoute = _chunkC5AM2XDNcjs.routeBoundaryCoversDirectory;
2769
2794
  const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
2770
2795
  const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _92 => _92.experimental, 'optionalAccess', _93 => _93.serverComponents])) === "islands";
2771
2796
  const adapterOwnsDocsRuntime = Boolean(
@@ -2780,7 +2805,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2780
2805
  );
2781
2806
  const syntheticDocsEntry = _optionalChain([config, 'access', _101 => _101.docs, 'optionalAccess', _102 => _102.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2782
2807
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
2783
- const markdownPagePlan = _chunk2IFT2CSAcjs.createMarkdownPageHydrationPlanner.call(void 0,
2808
+ const markdownPagePlan = _chunkBE7AQXJBcjs.createMarkdownPageHydrationPlanner.call(void 0,
2784
2809
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
2785
2810
  root,
2786
2811
  isolatedMode,
@@ -2796,7 +2821,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2796
2821
  pagePlanOptions
2797
2822
  )
2798
2823
  }));
2799
- _chunk2IFT2CSAcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2824
+ _chunkBE7AQXJBcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2800
2825
  clientLayouts.map((layout) => ({
2801
2826
  pattern: layout.pattern,
2802
2827
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2805,7 +2830,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2805
2830
  [
2806
2831
  ...routePlans.map(({ route, metadata }) => ({
2807
2832
  pattern: routeDirectory(route),
2808
- depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2833
+ depth: _chunkC5AM2XDNcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2809
2834
  metadata
2810
2835
  })),
2811
2836
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -2829,7 +2854,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2829
2854
  for (const layout of clientLayouts) {
2830
2855
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
2831
2856
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2832
- _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunk2IFT2CSAcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2857
+ _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunkBE7AQXJBcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2833
2858
  }
2834
2859
  }
2835
2860
  if (isolatedMode === "analyze") {
@@ -2863,7 +2888,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2863
2888
  );
2864
2889
  if (metadata.suppressedAsyncHydration) {
2865
2890
  _chunkQMNWKQL4cjs.logger.warn(
2866
- `\u26A0\uFE0F ${_chunk2IFT2CSAcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2891
+ `\u26A0\uFE0F ${_chunkBE7AQXJBcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2867
2892
  );
2868
2893
  }
2869
2894
  const slotBoundaries = serverSlotPlans.filter(
@@ -2871,7 +2896,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2871
2896
  ).flatMap(({ plan }) => plan.isolatedBoundaries);
2872
2897
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
2873
2898
  const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
2874
- const islandStrategy = _chunkKWST2O22cjs.resolveFarmRouteRootStrategy.call(void 0,
2899
+ const islandStrategy = _chunkCBLRSZQLcjs.resolveFarmRouteRootStrategy.call(void 0,
2875
2900
  route,
2876
2901
  metadata,
2877
2902
  clientLayouts,
@@ -2890,7 +2915,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2890
2915
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
2891
2916
  ],
2892
2917
  // The server renders a server tree only below a hydrating layout.
2893
- ..._chunk2IFT2CSAcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2918
+ ..._chunkBE7AQXJBcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2894
2919
  });
2895
2920
  _chunkQMNWKQL4cjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2896
2921
  }
@@ -2927,7 +2952,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2927
2952
  }
2928
2953
  const clientRouteSlots = routeSlots.filter((slot) => {
2929
2954
  try {
2930
- const metadata = _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
2955
+ const metadata = _chunkBE7AQXJBcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
2931
2956
  return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
2932
2957
  } catch (error) {
2933
2958
  _chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
@@ -2959,11 +2984,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2959
2984
  config.trailingSlash,
2960
2985
  _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations),
2961
2986
  config.basePath,
2962
- _chunkKWST2O22cjs.generateClientCachePersistenceCode.call(void 0, _chunkKWST2O22cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2987
+ _chunkCBLRSZQLcjs.generateClientCachePersistenceCode.call(void 0, _chunkCBLRSZQLcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2963
2988
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
2964
2989
  _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _108 => _108.experimental, 'optionalAccess', _109 => _109.serverComponents])) === "islands",
2965
2990
  platform,
2966
- islandsMode ? _chunk2IFT2CSAcjs.collectFarmServerStylesheets.call(void 0,
2991
+ islandsMode ? _chunkBE7AQXJBcjs.collectFarmServerStylesheets.call(void 0,
2967
2992
  [
2968
2993
  ...layoutRoutes.map((layout) => layout.modulePath),
2969
2994
  ...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
@@ -2978,7 +3003,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2978
3003
  await fs4.writeFile(_path2.default.join(clientEntryDir, "farm-client-router.tsx"), clientEntry.router);
2979
3004
  }
2980
3005
  const clientInput = { [entryName]: clientEntryPath };
2981
- if (platform === "web" && _chunkKWST2O22cjs.canBootFarmIslandsClient.call(void 0, config)) {
3006
+ if (platform === "web" && _chunkCBLRSZQLcjs.canBootFarmIslandsClient.call(void 0, config)) {
2982
3007
  const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
2983
3008
  await fs4.writeFile(
2984
3009
  clientBootPath,
@@ -3050,7 +3075,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3050
3075
  }
3051
3076
  },
3052
3077
  plugins: [
3053
- _chunkKWST2O22cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
3078
+ _chunkCBLRSZQLcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
3054
3079
  createFarmPrivateClientSourcemapsPlugin({
3055
3080
  outDir: _path2.default.join(
3056
3081
  _path2.default.dirname(outputDir),
@@ -3082,7 +3107,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3082
3107
  ...rendererVitePlugins,
3083
3108
  ...config.vite.plugins || [],
3084
3109
  farmServerOnlyEntriesPlugin({ platform }),
3085
- _chunkKWST2O22cjs.farmDocsClientConfigPlugin.call(void 0,
3110
+ _chunkCBLRSZQLcjs.farmDocsClientConfigPlugin.call(void 0,
3086
3111
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
3087
3112
  ),
3088
3113
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -3115,7 +3140,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3115
3140
  },
3116
3141
  load: {
3117
3142
  filter: {
3118
- id: _chunkKWST2O22cjs.exactIdPattern.call(void 0, [
3143
+ id: _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, [
3119
3144
  "\0empty-module",
3120
3145
  "\0empty-api-route",
3121
3146
  "\0farm-i18n-client-bridge",
@@ -3152,7 +3177,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3152
3177
  { ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
3153
3178
  pluginManager
3154
3179
  ),
3155
- _chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
3180
+ _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
3156
3181
  ],
3157
3182
  mode: "production",
3158
3183
  css: postcssSearchPath ? {
@@ -3160,7 +3185,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3160
3185
  } : void 0,
3161
3186
  // Ensure React is bundled for client
3162
3187
  resolve: {
3163
- alias: _chunkKWST2O22cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
3188
+ alias: _chunkCBLRSZQLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
3164
3189
  dedupe: [...config.renderer.dedupe || []]
3165
3190
  },
3166
3191
  // Optimize dependencies - exclude server-side code from client bundle
@@ -3174,7 +3199,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3174
3199
  }
3175
3200
  };
3176
3201
  await viteBuild(
3177
- _chunkKWST2O22cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
3202
+ _chunkCBLRSZQLcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
3178
3203
  );
3179
3204
  if (platform === "mobile") {
3180
3205
  await fs4.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
@@ -3275,7 +3300,7 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
3275
3300
  return response;
3276
3301
  }
3277
3302
 
3278
- ${streamNavigations ? _chunkKWST2O22cjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
3303
+ ${streamNavigations ? _chunkCBLRSZQLcjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
3279
3304
 
3280
3305
  function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
3281
3306
  if (error?.name === "FarmDeploymentMismatchError") {
@@ -4244,7 +4269,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
4244
4269
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
4245
4270
  import __farmAppSetup from ${JSON.stringify(_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appSetupPath))};
4246
4271
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
4247
- const providerClientCode = _chunkKWST2O22cjs.generateFarmIntegrationProviderClientCode.call(void 0,
4272
+ const providerClientCode = _chunkCBLRSZQLcjs.generateFarmIntegrationProviderClientCode.call(void 0,
4248
4273
  integrationProviders,
4249
4274
  root,
4250
4275
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -4267,18 +4292,18 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
4267
4292
  const layoutImportStatements = [];
4268
4293
  const layoutRegistrations = [];
4269
4294
  const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
4270
- const treeLayoutPatterns = islandValues ? _chunk2MR4MABGcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
4295
+ const treeLayoutPatterns = islandValues ? _chunkC5AM2XDNcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
4271
4296
  layoutRoutes.forEach((layout, index) => {
4272
4297
  const relativePath = toImportPath(layout.modulePath);
4273
4298
  const treeLayout = treeLayoutPatterns.has(layout.pattern);
4274
4299
  const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
4275
- (pattern) => _chunk2MR4MABGcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
4300
+ (pattern) => _chunkC5AM2XDNcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
4276
4301
  );
4277
4302
  if (rendersOnClient && !treeLayout) {
4278
4303
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
4279
4304
  }
4280
- const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, layout.pattern);
4281
- const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
4305
+ const groupScope = _chunkC5AM2XDNcjs.getRouteGroupScope.call(void 0, layout.pattern);
4306
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkC5AM2XDNcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
4282
4307
  layoutRegistrations.push(
4283
4308
  ` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? treeLayout ? `getFarmTreeLayoutComponent(${JSON.stringify(layout.pattern)})` : `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)}${treeLayout ? ", serverTree: true" : ""} }`
4284
4309
  );
@@ -4365,7 +4390,7 @@ mountFarmDocsSearch();
4365
4390
 
4366
4391
  ${generateUniversalRouterStateRuntime()}
4367
4392
 
4368
- ${_chunkKWST2O22cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
4393
+ ${_chunkCBLRSZQLcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
4369
4394
 
4370
4395
  // SPA Router for server-rendered pages (HTML swap)
4371
4396
  const spaRouter = {
@@ -4429,7 +4454,8 @@ ${generateUniversalRouterStateProperties()}
4429
4454
  this.currentHistoryState = options.popState;
4430
4455
  }
4431
4456
 
4432
- this.saveScrollPosition(window.location.pathname + window.location.search);
4457
+ // Save under the page still on screen: on Back/Forward the URL already names the destination.
4458
+ this.saveScrollPosition(from);
4433
4459
  const navigation = this.startNavigation(from, url, action);
4434
4460
  let clientNavigation;
4435
4461
  try {
@@ -4802,7 +4828,7 @@ function hasHydratableLayout(pathname) {
4802
4828
  });
4803
4829
  }
4804
4830
 
4805
- ${_chunkKWST2O22cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
4831
+ ${_chunkCBLRSZQLcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
4806
4832
  // Wrap a page element with applicable layouts
4807
4833
  function wrapWithLayouts(pageElement, pathname, params) {
4808
4834
  const layouts = getApplicableLayouts(pathname);
@@ -4837,7 +4863,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
4837
4863
  return React.createElement("div", props, pageElement);
4838
4864
  }
4839
4865
  let farmLastRouteState = null;
4840
- ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkKWST2O22cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
4866
+ ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkCBLRSZQLcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
4841
4867
  function farmTreeLayoutsOf(pathname) {
4842
4868
  return getApplicableLayouts(pathname).filter(function(layout) {
4843
4869
  return layout.serverTree === true;
@@ -5401,7 +5427,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
5401
5427
  return true;
5402
5428
  }` : ""}
5403
5429
 
5404
- ${_chunkKWST2O22cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
5430
+ ${_chunkCBLRSZQLcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
5405
5431
 
5406
5432
  function activateNavigationScripts(root) {
5407
5433
  for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
@@ -5504,7 +5530,7 @@ function getLayoutShell(root, patterns, index) {
5504
5530
  return shell.innerHTML;
5505
5531
  }
5506
5532
 
5507
- ${islandValues ? _chunkKWST2O22cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
5533
+ ${islandValues ? _chunkCBLRSZQLcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
5508
5534
  // A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
5509
5535
  if (refresh) revealFarmStreamedContent(nextRoot);
5510
5536
  const currentPatterns = getLayoutPatterns(currentRoot);
@@ -5639,7 +5665,8 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
5639
5665
  // A route transition invalidates any trigger waiting on the previous DOM boundary.
5640
5666
  cancelPendingPageHydration();
5641
5667
  this.stopNavigationStream();
5642
- this.saveScrollPosition(window.location.pathname + window.location.search);
5668
+ // Save under the page still on screen: on Back/Forward the URL already names the destination.
5669
+ this.saveScrollPosition(from);
5643
5670
  const navigation = this.startNavigation(from, url, action);
5644
5671
  // A refresh keeps the islands still on the page (islands mode).
5645
5672
  navigation.refresh = options.refresh === true;
@@ -6185,7 +6212,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6185
6212
  pattern: entry.pattern,
6186
6213
  modulePath: entry.modulePath
6187
6214
  })) : [];
6188
- const i18nCatalogs = config.i18n.enabled ? (await _chunkBBPDJGCUcjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
6215
+ const i18nCatalogs = config.i18n.enabled ? (await _chunkCYOTNHDFcjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
6189
6216
  const appDirs = _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config);
6190
6217
  let openAPIReference = null;
6191
6218
  if (config.openapi.enabled && config.openapi.route) {
@@ -6206,15 +6233,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6206
6233
  specRoute: config.openapi.specRoute || null
6207
6234
  };
6208
6235
  }
6209
- const discoveredMiddlewareRoutes = await discoverMiddlewareRoutes(appDirs);
6210
- const middlewareRoutes = farmTargetRunsEdgeMiddleware(preset) ? await Promise.all(
6211
- discoveredMiddlewareRoutes.map(async (route) => ({
6236
+ const middlewareRoutes = await Promise.all(
6237
+ (await discoverMiddlewareRoutes(appDirs)).map(async (route) => ({
6212
6238
  ...route,
6213
6239
  config: await readMiddlewareFileConfig(route.filePath)
6214
6240
  }))
6215
- ) : discoveredMiddlewareRoutes;
6241
+ );
6216
6242
  const instrumentationPath = _chunk3GNHJ3RNcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
6217
- const notFoundPath = _chunkKWST2O22cjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
6243
+ const notFoundPath = _chunkCBLRSZQLcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
6218
6244
  if (notFoundPath) _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
6219
6245
  layoutRoutes.sort((a, b) => {
6220
6246
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -6236,8 +6262,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6236
6262
  );
6237
6263
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
6238
6264
  const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _119 => _119.mdx, 'optionalAccess', _120 => _120.components]));
6239
- const hasMiddlewareConfig = _chunk2MR4MABGcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6240
- const hasRouteContextConfig = _chunkKEB7AGS6cjs.hasCustomFarmRouteContext.call(void 0, config);
6265
+ const hasMiddlewareConfig = _chunkC5AM2XDNcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6266
+ const hasRouteContextConfig = _chunk3WG7GJQLcjs.hasCustomFarmRouteContext.call(void 0, config);
6241
6267
  const hasServerRuntimePlugins = _chunkDMXMIE2Ccjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
6242
6268
  const hasPluginRoutes = hasFarmPluginRoutes(config);
6243
6269
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
@@ -6247,9 +6273,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6247
6273
  const hasConfiguredRuntimePlugins = Boolean(
6248
6274
  hasRuntimeConfigModule && (config.plugins || []).length > 0
6249
6275
  );
6250
- if (_chunkUISZLYKYcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
6276
+ if (_chunk5R4Q5FN7cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
6251
6277
  const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
6252
- _chunkUISZLYKYcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
6278
+ _chunk5R4Q5FN7cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
6253
6279
  config.docs,
6254
6280
  { root, srcDir: config.srcDir },
6255
6281
  (pathname) => adapterGuardedPaths.has(pathname),
@@ -6259,7 +6285,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6259
6285
  const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
6260
6286
  const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _121 => _121.docs, 'optionalAccess', _122 => _122.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHDPT6OYEcjs._runWithFarmCspNonce.call(void 0,
6261
6287
  farmDocsCspNonceMarker,
6262
- async () => _optionalChain([config, 'access', _123 => _123.docs, 'access', _124 => _124.adapter, 'optionalAccess', _125 => _125.server]) ? await _chunkUISZLYKYcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
6288
+ async () => _optionalChain([config, 'access', _123 => _123.docs, 'access', _124 => _124.adapter, 'optionalAccess', _125 => _125.server]) ? await _chunk5R4Q5FN7cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
6263
6289
  root,
6264
6290
  srcDir: config.srcDir,
6265
6291
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -6426,7 +6452,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6426
6452
  __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _131 => _131.env, 'optionalAccess', _132 => _132.public]) || {})
6427
6453
  },
6428
6454
  plugins: [
6429
- _chunkKWST2O22cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
6455
+ _chunkCBLRSZQLcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
6430
6456
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
6431
6457
  ...rendererVitePlugins,
6432
6458
  ...config.vite.plugins || [],
@@ -6449,7 +6475,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6449
6475
  { ..._chunkNG2EZ6QScjs.createReactProductionModePlugin.call(void 0, ), enforce: "pre" },
6450
6476
  farmServerOnlyEntriesPlugin(),
6451
6477
  farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
6452
- _chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
6478
+ _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
6453
6479
  ...hasRuntimeConfigModule ? [
6454
6480
  farmStripPlatformConfigPlugin(
6455
6481
  [
@@ -6461,7 +6487,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6461
6487
  {
6462
6488
  name: "farm-virtual-ssr-entry",
6463
6489
  resolveId: {
6464
- filter: { id: _chunkKWST2O22cjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
6490
+ filter: { id: _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
6465
6491
  handler(id) {
6466
6492
  if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
6467
6493
  return virtualEntryId;
@@ -6470,7 +6496,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6470
6496
  }
6471
6497
  },
6472
6498
  load: {
6473
- filter: { id: _chunkKWST2O22cjs.exactIdPattern.call(void 0, [virtualEntryId]) },
6499
+ filter: { id: _chunkCBLRSZQLcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
6474
6500
  handler(id) {
6475
6501
  if (id === virtualEntryId) {
6476
6502
  return virtualEntryCode;
@@ -6502,7 +6528,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6502
6528
  resolve: {
6503
6529
  alias: [
6504
6530
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
6505
- ...Object.entries(_chunkKWST2O22cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
6531
+ ...Object.entries(_chunkCBLRSZQLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
6506
6532
  ([find, replacement]) => ({ find, replacement })
6507
6533
  )
6508
6534
  ],
@@ -6510,7 +6536,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6510
6536
  dedupe: [...config.renderer.dedupe || []]
6511
6537
  }
6512
6538
  };
6513
- await viteBuild(_chunkKWST2O22cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
6539
+ await viteBuild(_chunkCBLRSZQLcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
6514
6540
  } finally {
6515
6541
  if (postcssConfigDir) {
6516
6542
  try {
@@ -6554,7 +6580,7 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
6554
6580
  };
6555
6581
  return _chunkNAXKOTPPcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
6556
6582
  (docsRoot) => _chunkNAXKOTPPcjs.discoverFarmDocsPages.call(void 0, _chunkNAXKOTPPcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
6557
- ).flatMap((page) => [page.href, _chunkNAXKOTPPcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk2MR4MABGcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
6583
+ ).flatMap((page) => [page.href, _chunkNAXKOTPPcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkC5AM2XDNcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
6558
6584
  }
6559
6585
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
6560
6586
  const llmsTxt = _optionalChain([agent, 'optionalAccess', _135 => _135.llmsTxt]);
@@ -6951,7 +6977,7 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
6951
6977
  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, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
6952
6978
  const farmRendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
6953
6979
  const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _149 => _149.experimental, 'optionalAccess', _150 => _150.serverComponents])) === "islands";
6954
- const farmClientBoot = _chunkKWST2O22cjs.canBootFarmIslandsClient.call(void 0, config);
6980
+ const farmClientBoot = _chunkCBLRSZQLcjs.canBootFarmIslandsClient.call(void 0, config);
6955
6981
  const farmMobileClient = shouldBuildFarmMobileClient(config);
6956
6982
  const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
6957
6983
  const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
@@ -7019,7 +7045,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7019
7045
  (image) => image.sourceType === "module"
7020
7046
  );
7021
7047
  const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
7022
- const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk2MR4MABGcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
7048
+ const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkC5AM2XDNcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
7023
7049
  const farmDocsFontAssets = _optionalChain([config, 'access', _171 => _171.docs, 'optionalAccess', _172 => _172.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
7024
7050
  const integrationProviders = _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, config.integrations);
7025
7051
  const renderedIntegrationProviders = integrationProviders.filter(
@@ -7030,7 +7056,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7030
7056
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
7031
7057
  );
7032
7058
  }
7033
- const providerServerModules = _chunkKWST2O22cjs.generateFarmIntegrationProviderServerModules.call(void 0,
7059
+ const providerServerModules = _chunkCBLRSZQLcjs.generateFarmIntegrationProviderServerModules.call(void 0,
7034
7060
  renderedIntegrationProviders,
7035
7061
  config.root,
7036
7062
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
@@ -7050,14 +7076,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7050
7076
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
7051
7077
  (provider) => provider.supportsIsolatedHydration !== true
7052
7078
  );
7053
- const isolatedHydrationMode = _chunk2IFT2CSAcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
7079
+ const isolatedHydrationMode = _chunkBE7AQXJBcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
7054
7080
  _optionalChain([config, 'access', _175 => _175.experimental, 'optionalAccess', _176 => _176.isolatedClientHydration]),
7055
7081
  {
7056
7082
  serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _177 => _177.experimental, 'optionalAccess', _178 => _178.serverComponents])) === "rsc",
7057
7083
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
7058
7084
  }
7059
7085
  );
7060
- const hydrationPlanOptions = _chunk2IFT2CSAcjs.getFarmClientHydrationPlanOptions.call(void 0,
7086
+ const hydrationPlanOptions = _chunkBE7AQXJBcjs.getFarmClientHydrationPlanOptions.call(void 0,
7061
7087
  config.renderer,
7062
7088
  Boolean(unsupportedIntegrationProvider)
7063
7089
  );
@@ -7075,7 +7101,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7075
7101
  { ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
7076
7102
  )
7077
7103
  }));
7078
- const markdownPagePlan = _chunk2IFT2CSAcjs.createMarkdownPageHydrationPlanner.call(void 0,
7104
+ const markdownPagePlan = _chunkBE7AQXJBcjs.createMarkdownPageHydrationPlanner.call(void 0,
7079
7105
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
7080
7106
  config.root,
7081
7107
  isolatedHydrationMode,
@@ -7093,7 +7119,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7093
7119
  )
7094
7120
  ])
7095
7121
  );
7096
- _chunk2IFT2CSAcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
7122
+ _chunkBE7AQXJBcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
7097
7123
  layoutHydrationPlans.map((layout) => ({
7098
7124
  pattern: layout.pattern,
7099
7125
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -7102,10 +7128,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7102
7128
  pageRoutes.map((route) => ({
7103
7129
  // Compared by directory so a grouped layout applies only inside its group.
7104
7130
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
7105
- depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
7131
+ depth: _chunkC5AM2XDNcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
7106
7132
  metadata: pageHydrationPlans.get(route.modulePath)
7107
7133
  })),
7108
- _chunk2MR4MABGcjs.routeBoundaryCoversDirectory,
7134
+ _chunkC5AM2XDNcjs.routeBoundaryCoversDirectory,
7109
7135
  { serverOwners: pageHydrationPlanOptions.serverOwners }
7110
7136
  );
7111
7137
  const providerServerImports = [
@@ -7137,12 +7163,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7137
7163
  orderedPageRoutes.forEach((route, index) => {
7138
7164
  const varName = `pageRoute${index}`;
7139
7165
  if (_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
7140
- const renderingDirective2 = _chunkCSQPMV3Qcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7166
+ const renderingDirective2 = _chunkE3LE6EZHcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7167
+ const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkBE7AQXJBcjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
7141
7168
  pageRegistrations.push(`
7142
7169
  {
7143
7170
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
7144
7171
  directory: ${JSON.stringify(route.directory)},` : ""}${renderingDirective2 ? `
7145
- rendering: ${JSON.stringify(renderingDirective2)},` : ""}
7172
+ rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
7146
7173
  module: createFarmMarkdownRouteModule({
7147
7174
  source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
7148
7175
  filePath: ${JSON.stringify(toBakedMarkdownSourcePath(config.root, route.modulePath))},
@@ -7162,7 +7189,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7162
7189
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
7163
7190
  );
7164
7191
  const clientMetadata = pageHydrationPlans.get(route.modulePath);
7165
- const renderingDirective = _chunkCSQPMV3Qcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7192
+ const renderingDirective = _chunkE3LE6EZHcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7166
7193
  pageRegistrations.push(`
7167
7194
  {
7168
7195
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -7170,8 +7197,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7170
7197
  module: ${varName},
7171
7198
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
7172
7199
  clientModule: ${JSON.stringify(_chunkQMNWKQL4cjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
7173
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunk2IFT2CSAcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
7174
- const rootStrategy = _chunkKWST2O22cjs.resolveFarmRouteRootStrategy.call(void 0,
7200
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkBE7AQXJBcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
7201
+ const rootStrategy = _chunkCBLRSZQLcjs.resolveFarmRouteRootStrategy.call(void 0,
7175
7202
  route,
7176
7203
  clientMetadata,
7177
7204
  layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
@@ -7190,7 +7217,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7190
7217
  });
7191
7218
  const layoutImports = [];
7192
7219
  const layoutRegistrations = [];
7193
- const treeLayoutPatterns = farmIslandsMode ? _chunk2MR4MABGcjs.getFarmServerTreeLayoutPatterns.call(void 0,
7220
+ const treeLayoutPatterns = farmIslandsMode ? _chunkC5AM2XDNcjs.getFarmServerTreeLayoutPatterns.call(void 0,
7194
7221
  layoutHydrationPlans.map((layout) => ({
7195
7222
  pattern: layout.pattern,
7196
7223
  shouldHydrate: layout.hydration.shouldHydrate,
@@ -7234,7 +7261,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7234
7261
  containerId: ${JSON.stringify(slot.containerId)},
7235
7262
  interception: ${JSON.stringify(slot.interception)},
7236
7263
  fallback: ${JSON.stringify(slot.fallback)},
7237
- hydrates: ${!farmIslandsMode || _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
7264
+ hydrates: ${!farmIslandsMode || _chunkBE7AQXJBcjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
7238
7265
  module: ${varName},
7239
7266
  }`);
7240
7267
  });
@@ -7245,12 +7272,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7245
7272
  errorImports.push(
7246
7273
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
7247
7274
  );
7248
- const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
7275
+ const groupScope = _chunkC5AM2XDNcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
7249
7276
  errorRegistrations.push(`
7250
7277
  {
7251
- pattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
7278
+ pattern: ${JSON.stringify(_chunkC5AM2XDNcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
7252
7279
  groupScope: ${JSON.stringify(groupScope)},
7253
- directoryDepth: ${_chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
7280
+ directoryDepth: ${_chunkC5AM2XDNcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
7254
7281
  module: ${varName},
7255
7282
  }`);
7256
7283
  });
@@ -7262,12 +7289,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7262
7289
  loadingImports.push(
7263
7290
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
7264
7291
  );
7265
- const groupScope = _chunk2MR4MABGcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
7292
+ const groupScope = _chunkC5AM2XDNcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
7266
7293
  loadingRegistrations.push(`
7267
7294
  {
7268
- pattern: ${JSON.stringify(_chunk2MR4MABGcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
7295
+ pattern: ${JSON.stringify(_chunkC5AM2XDNcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
7269
7296
  groupScope: ${JSON.stringify(groupScope)},
7270
- directoryDepth: ${_chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
7297
+ directoryDepth: ${_chunkC5AM2XDNcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
7271
7298
  module: ${varName},
7272
7299
  }`);
7273
7300
  });
@@ -7541,10 +7568,10 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
7541
7568
  );
7542
7569
  const nativeServerFns = (config.plugins || []).some(
7543
7570
  (plugin) => _optionalChain([plugin, 'optionalAccess', _201 => _201.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
7544
- ) ? _chunkZPUAOKHVcjs.collectFarmNativeServerFns.call(void 0, {
7571
+ ) ? _chunkIWCYRDRQcjs.collectFarmNativeServerFns.call(void 0, {
7545
7572
  root: config.root,
7546
7573
  srcDir: config.srcDir,
7547
- entries: _chunkZPUAOKHVcjs.findFarmNativeScreenFiles.call(void 0, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config))
7574
+ entries: _chunkIWCYRDRQcjs.findFarmNativeScreenFiles.call(void 0, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config))
7548
7575
  }) : void 0;
7549
7576
  const integrationImports = `
7550
7577
  ${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
@@ -7559,7 +7586,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
7559
7586
  ${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
7560
7587
  });` : ""}
7561
7588
  `;
7562
- const imageRuntime = _chunkKWST2O22cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
7589
+ const imageRuntime = _chunkCBLRSZQLcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
7563
7590
  const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
7564
7591
  const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
7565
7592
  const apiHandlerCode = apiRoutes.length > 0 ? `
@@ -7741,7 +7768,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
7741
7768
 
7742
7769
  function FarmDefault404Page() {
7743
7770
  return React.createElement(React.Fragment, null,
7744
- React.createElement("style", null, ${JSON.stringify(_chunkKWST2O22cjs.DEFAULT_NOT_FOUND_STYLES)}),
7771
+ React.createElement("style", null, ${JSON.stringify(_chunkCBLRSZQLcjs.DEFAULT_NOT_FOUND_STYLES)}),
7745
7772
  React.createElement("main", {
7746
7773
  className: "farm-default-not-found",
7747
7774
  "aria-labelledby": "farm-default-not-found-title",
@@ -7895,7 +7922,7 @@ ${_optionalChain([config, 'access', _211 => _211.agent, 'optionalAccess', _212 =
7895
7922
  // to the build.
7896
7923
  const farmNoindexPreview = resolveFarmPreviewDeployment(
7897
7924
  globalThis.process?.env,
7898
- ${JSON.stringify(_chunkDPYBVVL3cjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
7925
+ ${JSON.stringify(_chunkOSEQL34Qcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
7899
7926
  );` : ""}
7900
7927
  const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
7901
7928
  const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
@@ -8026,7 +8053,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _220 => _220.docs, '
8026
8053
  registerMCPServer: registerFarmMCPServer,
8027
8054
  // A page built with this keeps its HTML string, so the preload budget and the response
8028
8055
  // writer use it instead of reading and re-encoding the body. Older adapters ignore it.
8029
- createHtmlResponse: farmOwnedHtmlResponse,${_chunkUISZLYKYcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
8056
+ createHtmlResponse: farmOwnedHtmlResponse,${_chunk5R4Q5FN7cjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
8030
8057
  // The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
8031
8058
  // asks about any path its own content lists, so the guards decide here, not a page list.
8032
8059
  isPathGuarded: (pathname) =>
@@ -8084,12 +8111,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
8084
8111
  // runtime request.
8085
8112
  const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
8086
8113
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
8087
- ${_optionalChain([config, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkSXMWVP2Lcjs.resolveFarmApiCatalogInput.call(void 0, config))};
8114
+ ${_optionalChain([config, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkFSSONJRVcjs.resolveFarmApiCatalogInput.call(void 0, config))};
8088
8115
  ` : ""}${_optionalChain([config, 'access', _226 => _226.agent, 'optionalAccess', _227 => _227.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
8089
- _chunkSXMWVP2Lcjs.resolveFarmAppManifestInput.call(void 0, config, {
8116
+ _chunkFSSONJRVcjs.resolveFarmAppManifestInput.call(void 0, config, {
8090
8117
  build: config.deploymentId,
8091
- packages: _chunkKWST2O22cjs.resolveFarmAppPackages.call(void 0, config.root),
8092
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkKWST2O22cjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
8118
+ packages: _chunkCBLRSZQLcjs.resolveFarmAppPackages.call(void 0, config.root),
8119
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkCBLRSZQLcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
8093
8120
  })
8094
8121
  )};
8095
8122
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
@@ -8593,12 +8620,98 @@ async function renderFarmElement(ReactDOMServer, element, routeKey, flushToken =
8593
8620
  return { html, head: "", shellHtml: html, streamErrors };
8594
8621
  }
8595
8622
 
8596
- async function renderFarmElementToString(ReactDOMServer, element) {
8597
- const rendered = await renderFarmElement(ReactDOMServer, element);
8598
- if (rendered.html !== undefined) return rendered.html;
8599
- const html = await new Response(rendered.stream).text();
8600
- if (rendered.streamErrors.length > 0) throw rendered.streamErrors[0];
8601
- return html;
8623
+ // The not-found and error documents go out whole, with their status, so they never stream.
8624
+ // renderToString renders a tree that does not suspend in one synchronous pass, but throws "A
8625
+ // component suspended while responding to synchronous input" when a lazy component or a use()
8626
+ // read suspends outside a Suspense boundary, and leaves a boundary that suspends inside one to
8627
+ // the client (<!--$!-->). Such a document renders with the streaming renderer instead, which
8628
+ // sends nothing until every boundary is done, so the output is the resolved markup without
8629
+ // fallbacks or reveal scripts. A document that suspended once keeps that renderer for the rest
8630
+ // of this server process, as a page route that suspends keeps streaming. As for pages, a
8631
+ // response with a CSP nonce or a posted form state renders with the stream, which takes them.
8632
+ // Renderers other than React wait for their own async content in renderToString.
8633
+ const farmSuspendingDocuments = new Set();
8634
+
8635
+ async function renderFarmCompleteDocument(ReactDOMServer, element, documentKey) {
8636
+ if (!farmReactSyncRender || !canRenderFarmElementWhenAllReady(ReactDOMServer)) {
8637
+ return await ReactDOMServer.renderToString(element, getFarmRendererRenderOptions());
8638
+ }
8639
+ if (!farmSuspendingDocuments.has(documentKey) &&
8640
+ !_resolveCurrentCspNonce() &&
8641
+ farmFormState() === undefined) {
8642
+ let html;
8643
+ try {
8644
+ html = ReactDOMServer.renderToString(element, getFarmRendererRenderOptions());
8645
+ } catch {
8646
+ // A real render error fails the streaming render the same way.
8647
+ }
8648
+ if (typeof html === "string" && !html.includes("<!--$!-->")) return html;
8649
+ farmSuspendingDocuments.add(documentKey);
8650
+ }
8651
+ return await renderFarmElementWhenAllReady(ReactDOMServer, element);
8652
+ }
8653
+
8654
+ function canRenderFarmElementWhenAllReady(ReactDOMServer) {
8655
+ return (farmRendererStreamingCapabilities.web &&
8656
+ typeof ReactDOMServer.renderToReadableStream === "function") ||
8657
+ (farmRendererStreamingCapabilities.node &&
8658
+ typeof ReactDOMServer.renderToPipeableStream === "function");
8659
+ }
8660
+
8661
+ async function renderFarmElementWhenAllReady(ReactDOMServer, element) {
8662
+ const onError = function(error) {
8663
+ // After the shell, a failed boundary is rendered by the client, as on a page.
8664
+ if (isFarmRedirectError(error) || isFarmNotFoundError(error)) return;
8665
+ console.error("[Farm SSR stream]", error);
8666
+ };
8667
+ // Completed boundaries larger than this would stream behind their fallback: keep them inline.
8668
+ const progressiveChunkSize = Number.MAX_SAFE_INTEGER;
8669
+ if (farmRendererStreamingCapabilities.web &&
8670
+ typeof ReactDOMServer.renderToReadableStream === "function") {
8671
+ const stream = await ReactDOMServer.renderToReadableStream(element, {
8672
+ nonce: _resolveCurrentCspNonce(),
8673
+ formState: farmFormState(),
8674
+ progressiveChunkSize,
8675
+ onError,
8676
+ });
8677
+ await stream.allReady;
8678
+ return await new Response(stream).text();
8679
+ }
8680
+ return await new Promise(function(resolve, reject) {
8681
+ const chunks = [];
8682
+ const decoder = new TextDecoder();
8683
+ const destination = {
8684
+ write(chunk) {
8685
+ chunks.push(typeof chunk === "string" ? chunk : decoder.decode(chunk, { stream: true }));
8686
+ return true;
8687
+ },
8688
+ flush() {},
8689
+ end() {
8690
+ chunks.push(decoder.decode());
8691
+ resolve(chunks.join(""));
8692
+ },
8693
+ on() {
8694
+ return destination;
8695
+ },
8696
+ destroy(error) {
8697
+ reject(error || new Error("React server render stream was destroyed"));
8698
+ },
8699
+ };
8700
+ const pipeableStream = ReactDOMServer.renderToPipeableStream(element, {
8701
+ nonce: _resolveCurrentCspNonce(),
8702
+ formState: farmFormState(),
8703
+ progressiveChunkSize,
8704
+ onAllReady() {
8705
+ try {
8706
+ pipeableStream.pipe(destination);
8707
+ } catch (error) {
8708
+ reject(error);
8709
+ }
8710
+ },
8711
+ onShellError: reject,
8712
+ onError,
8713
+ });
8714
+ });
8602
8715
  }
8603
8716
 
8604
8717
  // Most pages render without suspending. React's renderToString renders them in
@@ -8756,7 +8869,7 @@ function peelFarmDocumentPrefix(markup) {
8756
8869
  let inner = markup.replace(/^\\s+/, "");
8757
8870
  let hoisted = "";
8758
8871
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
8759
- const hoistable = /${_chunk2MR4MABGcjs.HOISTED_HEAD_ELEMENT.source}/i;
8872
+ const hoistable = /${_chunkC5AM2XDNcjs.HOISTED_HEAD_ELEMENT.source}/i;
8760
8873
  let match;
8761
8874
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
8762
8875
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -8780,6 +8893,50 @@ function opensFarmFullDocument(markup) {
8780
8893
  return /^<!doctype/i.test(inner) || /^<html[\\s>]/i.test(inner);
8781
8894
  }
8782
8895
 
8896
+ // The head elements a component renders (<meta>, <title>, preloads), which React writes ahead of
8897
+ // a render whose root is not <html>, split off for the document's head. A full document keeps
8898
+ // them: its own head takes them. Matches the dev renderer's takeFarmHoistedHead.
8899
+ function takeFarmHoistedHead(markup) {
8900
+ if (opensFarmFullDocument(markup)) return { head: "", body: markup };
8901
+ const hoistable = /${_chunkC5AM2XDNcjs.HOISTED_HEAD_ELEMENT.source}/i;
8902
+ let head = "";
8903
+ let body = markup;
8904
+ let match;
8905
+ while ((match = hoistable.exec(body.replace(/^\\s+/, "")))) {
8906
+ head += match[0];
8907
+ body = body.replace(/^\\s+/, "").slice(match[0].length);
8908
+ }
8909
+ return { head: head, body: body };
8910
+ }
8911
+
8912
+ // A rendered page with the head elements React wrote first moved to its head field, for Farm's shell to
8913
+ // put in the document's head. A streamed page's first chunk is its shellHtml: those bytes are
8914
+ // dropped from the stream.
8915
+ function takeFarmRenderedHead(rendered) {
8916
+ if (rendered.head) return rendered;
8917
+ if (rendered.html !== undefined) {
8918
+ const split = takeFarmHoistedHead(rendered.html);
8919
+ if (!split.head) return rendered;
8920
+ return Object.assign({}, rendered, { html: split.body, shellHtml: split.body, head: split.head });
8921
+ }
8922
+ const shell = rendered.shellHtml || "";
8923
+ const split = takeFarmHoistedHead(shell);
8924
+ if (!split.head) return rendered;
8925
+ let left = new TextEncoder().encode(shell.slice(0, shell.length - split.body.length)).byteLength;
8926
+ const stream = rendered.stream.pipeThrough(new TransformStream({
8927
+ transform(chunk, controller) {
8928
+ if (left > 0) {
8929
+ const dropped = Math.min(left, chunk.byteLength);
8930
+ left -= dropped;
8931
+ chunk = chunk.subarray(dropped);
8932
+ if (chunk.byteLength === 0) return;
8933
+ }
8934
+ controller.enqueue(chunk);
8935
+ },
8936
+ }));
8937
+ return Object.assign({}, rendered, { stream: stream, shellHtml: split.body, head: split.head });
8938
+ }
8939
+
8783
8940
  function extractFarmFullDocument(markup) {
8784
8941
  if (!opensFarmFullDocument(markup)) return null;
8785
8942
  const hoisted = peelFarmDocumentPrefix(markup).hoisted;
@@ -9265,7 +9422,7 @@ function createFarmAgentRobotsResponse(request) {
9265
9422
  // its nearest layout's.
9266
9423
  const farmAgentGuardedPages = new Set(${JSON.stringify(
9267
9424
  pageRoutes.map((route) => route.pattern).filter(
9268
- (pattern) => !pattern.includes("[") && _chunk2MR4MABGcjs.farmPathGuardCoversPage.call(void 0,
9425
+ (pattern) => !pattern.includes("[") && _chunkC5AM2XDNcjs.farmPathGuardCoversPage.call(void 0,
9269
9426
  {
9270
9427
  config: { middleware: config.middleware, integrations: config.integrations },
9271
9428
  middlewareRoutes
@@ -9320,7 +9477,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
9320
9477
  // aside for a page route that answers /mcp and for any MCP server published or
9321
9478
  // registered at runtime, such as the docs engine's.
9322
9479
  const farmDefaultMCPServer = ${JSON.stringify(
9323
- _chunkTP4RAV7Ycjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkMEJCP2LXcjs.FARM_VERSION)
9480
+ _chunkTP4RAV7Ycjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkZDZUFD67cjs.FARM_VERSION)
9324
9481
  )};
9325
9482
  let farmDefaultMCPRouteFree;
9326
9483
  function getFarmDefaultMCPServer() {
@@ -9514,7 +9671,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
9514
9671
  // middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
9515
9672
  const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
9516
9673
  const farmPrerendering =
9517
- typeof process !== "undefined" && process.env?.${_chunk3BQ7QHUHcjs.FARM_PRERENDER_ENV} === "1";
9674
+ typeof process !== "undefined" && process.env?.${_chunk5X6OHJEEcjs.FARM_PRERENDER_ENV} === "1";
9518
9675
  ` : ""}
9519
9676
  const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
9520
9677
  config: farmMiddlewareConfig,
@@ -9770,7 +9927,7 @@ ${hasInfraAnalyticsRuntime ? `
9770
9927
  // endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
9771
9928
  // labeled here; route.pattern keeps meaning the matched app route for plugins.
9772
9929
  const farmBuiltInRoutePaths = new Set(${JSON.stringify(
9773
- _chunkSXMWVP2Lcjs.listFarmBuiltInRoutePaths.call(void 0, {
9930
+ _chunkFSSONJRVcjs.listFarmBuiltInRoutePaths.call(void 0, {
9774
9931
  agent: {
9775
9932
  ...config.agent,
9776
9933
  aiCatalog: servesAiCatalog,
@@ -10539,7 +10696,7 @@ ${hasServerRuntimeIntegrations ? `
10539
10696
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
10540
10697
  // public manifest, the same document for every request.
10541
10698
  if (
10542
- [${JSON.stringify(_chunkSXMWVP2Lcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkSXMWVP2Lcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
10699
+ [${JSON.stringify(_chunkFSSONJRVcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkFSSONJRVcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
10543
10700
  normalizeRuntimePath(routePathname),
10544
10701
  )
10545
10702
  ) {
@@ -10551,7 +10708,7 @@ ${hasServerRuntimeIntegrations ? `
10551
10708
  ` : ""}
10552
10709
  ${_optionalChain([config, 'access', _256 => _256.agent, 'optionalAccess', _257 => _257.apiCatalog]) ? `
10553
10710
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
10554
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkSXMWVP2Lcjs.FARM_API_CATALOG_PATH)}) {
10711
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkFSSONJRVcjs.FARM_API_CATALOG_PATH)}) {
10555
10712
  return applyProductionMiddlewareHeaders(
10556
10713
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
10557
10714
  middlewareHeaders,
@@ -11155,9 +11312,10 @@ ${hasServerRuntimeIntegrations ? `
11155
11312
  wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
11156
11313
  return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern, farmFlushToken);
11157
11314
  };
11158
- const renderedPage = ${hasMiddlewareRuntime ? `await _runWithMiddlewareData(middlewareData, () =>
11315
+ // The head elements a component rendered go to the document's head (takeFarmRenderedHead).
11316
+ const renderedPage = takeFarmRenderedHead(${hasMiddlewareRuntime ? `await _runWithMiddlewareData(middlewareData, () =>
11159
11317
  _runWithMiddlewareContext(middlewareContext, renderPageElement)
11160
- )` : "await renderPageElement()"};
11318
+ )` : "await renderPageElement()"});
11161
11319
 
11162
11320
  // A completed document is not a reusable PPR shell: it already contains
11163
11321
  // the request's resolved Suspense content. Until the production runtime
@@ -11397,7 +11555,8 @@ ${hasServerRuntimeIntegrations ? `
11397
11555
  ' <meta charset="utf-8">\\n' +
11398
11556
  ' ' + viewportTags + '\\n' +
11399
11557
  (hasFavicon ? '' : ' <link rel="icon" href="data:,">\\n') +
11400
- ' <title>' + title + '</title>' + metaTags + '\\n' +
11558
+ (suppressDefaultTitle ? '' : ' <title>' + title + '</title>') + metaTags +
11559
+ (rendererHead ? '\\n ' + rendererHead : '') + '\\n' +
11401
11560
  ' <link rel="stylesheet" href="/__farm_client_css_href__">\\n' +
11402
11561
  ' <link rel="modulepreload" href="/__farm_client_js_src__">' + renderFarmClientModulePreloads(null, route.clientModule) + '\\n' +
11403
11562
  renderFarmRendererHydrationScript() + '\\n' +
@@ -11424,9 +11583,10 @@ ${hasServerRuntimeIntegrations ? `
11424
11583
  }
11425
11584
  try {
11426
11585
  return createLateNotFoundRecovery(
11427
- await ReactDOMServer.renderToString(
11586
+ await renderFarmCompleteDocument(
11587
+ ReactDOMServer,
11428
11588
  wrapWithFarmIntegrationProviders(createFarmNotFoundElement(pathname)),
11429
- getFarmRendererRenderOptions()
11589
+ "not-found-recovery"
11430
11590
  )
11431
11591
  );
11432
11592
  } catch (error) {
@@ -11584,7 +11744,9 @@ ${hasServerRuntimeIntegrations ? `
11584
11744
  pprCacheKey,
11585
11745
  { html: fullHtml },
11586
11746
  {
11587
- paths: [pathname],
11747
+ // revalidatePath() takes the route path ("/pricing"), as the docs show, while the
11748
+ // shell answers the public one ("/console/fr/pricing"): either clears it.
11749
+ paths: [...new Set([pathname, getFarmRoutePathname(pathname)])],
11588
11750
  tags: ["ppr"],
11589
11751
  revalidate: pprConfig.revalidate ?? false,
11590
11752
  }
@@ -11715,7 +11877,12 @@ ${servesDefaultMCP ? `
11715
11877
  errorElement = wrapWithFarmIntegrationProviders(errorElement);
11716
11878
 
11717
11879
  const renderErrorElement = () =>
11718
- renderFarmElementToString(ReactDOMServer, errorElement);
11880
+ renderFarmCompleteDocument(
11881
+ ReactDOMServer,
11882
+ // Islands mode: the error document writes its islands' values, as a page does.
11883
+ typeof farmIslandsRender === "function" ? farmIslandsRender(errorElement) : errorElement,
11884
+ "error:" + errorBoundaryMatch.route.pattern
11885
+ );
11719
11886
  const errorHtml = ${hasMiddlewareRuntime ? `await _runWithMiddlewareData(middlewareData, () =>
11720
11887
  _runWithMiddlewareContext(middlewareContext, renderErrorElement)
11721
11888
  )` : "await renderErrorElement()"};
@@ -11856,7 +12023,7 @@ ${farmRendererDisabled ? `
11856
12023
  }
11857
12024
  notFoundElement = wrapWithFarmIntegrationProviders(notFoundElement);
11858
12025
 
11859
- const html = await ReactDOMServer.renderToString(notFoundElement, getFarmRendererRenderOptions());
12026
+ const html = await renderFarmCompleteDocument(ReactDOMServer, notFoundElement, "not-found");
11860
12027
  // The layouts' and the not-found page's metadata, as the development renderer uses it.
11861
12028
  const notFoundMetadata = renderMetadataHead(
11862
12029
  await resolveFarmNotFoundMetadata(
@@ -12265,9 +12432,9 @@ function getPhysicalPrerenderBypassReason(options) {
12265
12432
  if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
12266
12433
  return "rewrite";
12267
12434
  }
12268
- if (_chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
12269
- if (_chunk2MR4MABGcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
12270
- if (_chunkKEB7AGS6cjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
12435
+ if (_chunkC5AM2XDNcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
12436
+ if (_chunkC5AM2XDNcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
12437
+ if (_chunk3WG7GJQLcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
12271
12438
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
12272
12439
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
12273
12440
  if (_optionalChain([manifestEntry, 'optionalAccess', _274 => _274.rendering]) === "dynamic") return "dynamic runtime manifest";
@@ -12291,7 +12458,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
12291
12458
  );
12292
12459
  return [];
12293
12460
  }
12294
- if (!_chunkUISZLYKYcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
12461
+ if (!_chunk5R4Q5FN7cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
12295
12462
  const { pages: pages2, originDependent } = _chunkNAXKOTPPcjs.listFarmDocsBuiltInPrerenderPages.call(void 0, config.docs, {
12296
12463
  root,
12297
12464
  srcDir: config.srcDir
@@ -12309,7 +12476,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
12309
12476
  );
12310
12477
  return [];
12311
12478
  }
12312
- const pages = await _chunkUISZLYKYcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
12479
+ const pages = await _chunk5R4Q5FN7cjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
12313
12480
  if (!pages) {
12314
12481
  _chunkQMNWKQL4cjs.logger.warn(
12315
12482
  `The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
@@ -12323,10 +12490,10 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
12323
12490
  return [];
12324
12491
  }
12325
12492
  try {
12326
- return await _chunkUISZLYKYcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
12493
+ return await _chunk5R4Q5FN7cjs.listFarmDocsPagePaths.call(void 0, config.docs, {
12327
12494
  root,
12328
12495
  srcDir: config.srcDir,
12329
- adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunkUISZLYKYcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
12496
+ adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunk5R4Q5FN7cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
12330
12497
  });
12331
12498
  } catch (error) {
12332
12499
  _chunkQMNWKQL4cjs.logger.warn(
@@ -12352,10 +12519,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
12352
12519
  const nitroBuilder = nitroBuilderResult.value;
12353
12520
  const isVercel = preset === "vercel";
12354
12521
  const isCloudflareWorker = preset === "cloudflare-module";
12355
- const outputDir = _chunkKEB7AGS6cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12522
+ const outputDir = _chunk3WG7GJQLcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12356
12523
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
12357
12524
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
12358
- const imageRuntime = _chunkKWST2O22cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
12525
+ const imageRuntime = _chunkCBLRSZQLcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
12359
12526
  const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
12360
12527
  (image) => image.sourceType === "module"
12361
12528
  );
@@ -12411,7 +12578,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
12411
12578
  const edgeGuardedPrerenderRoutes = [];
12412
12579
  const addPrerenderRoute = (pathname) => {
12413
12580
  prerenderRoutes.push(pathname);
12414
- if (_chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
12581
+ if (_chunkC5AM2XDNcjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
12415
12582
  edgeGuardedPrerenderRoutes.push(pathname);
12416
12583
  }
12417
12584
  };
@@ -13125,13 +13292,13 @@ function toFarmNodeResponse(request, response) {
13125
13292
  }
13126
13293
  if (prerenderRoutes.length > 0) {
13127
13294
  _chunkQMNWKQL4cjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
13128
- const previousPrerender = process.env[_chunk3BQ7QHUHcjs.FARM_PRERENDER_ENV];
13129
- process.env[_chunk3BQ7QHUHcjs.FARM_PRERENDER_ENV] = "1";
13295
+ const previousPrerender = process.env[_chunk5X6OHJEEcjs.FARM_PRERENDER_ENV];
13296
+ process.env[_chunk5X6OHJEEcjs.FARM_PRERENDER_ENV] = "1";
13130
13297
  try {
13131
13298
  await nitroBuilder.prerender(nitroInstance);
13132
13299
  } finally {
13133
- if (previousPrerender === void 0) delete process.env[_chunk3BQ7QHUHcjs.FARM_PRERENDER_ENV];
13134
- else process.env[_chunk3BQ7QHUHcjs.FARM_PRERENDER_ENV] = previousPrerender;
13300
+ if (previousPrerender === void 0) delete process.env[_chunk5X6OHJEEcjs.FARM_PRERENDER_ENV];
13301
+ else process.env[_chunk5X6OHJEEcjs.FARM_PRERENDER_ENV] = previousPrerender;
13135
13302
  }
13136
13303
  }
13137
13304
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
@@ -13347,7 +13514,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
13347
13514
  config.basePath
13348
13515
  );
13349
13516
  const edgeMiddlewareRoutes = edgeMiddleware.middlewareRoutes.filter(
13350
- (route) => edgeMiddleware.guardedPages.some((pathname) => _chunk2MR4MABGcjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
13517
+ (route) => edgeMiddleware.guardedPages.some((pathname) => _chunkC5AM2XDNcjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
13351
13518
  );
13352
13519
  if (edgeMiddlewareRoutes.length > 0) {
13353
13520
  await writeFarmVercelEdgeMiddlewareFunction({
@@ -13363,7 +13530,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
13363
13530
  vercelConfig.routes = buildFarmVercelRoutes({
13364
13531
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
13365
13532
  runtimeRoutes,
13366
- middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? [createFarmVercelEdgeMiddlewareRoute(edgeMiddleware.guardedPages, config.basePath)] : [],
13533
+ middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? createFarmVercelEdgeMiddlewareRoutes(edgeMiddleware.guardedPages, config.basePath) : [],
13367
13534
  canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages)
13368
13535
  });
13369
13536
  const vercelConfigWithWorkflowCrons = _chunkFSODPZRTcjs.applyFarmWorkflowVercelCrons.call(void 0,
@@ -13485,7 +13652,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
13485
13652
  try {
13486
13653
  await copyPackage("sharp", sharpRequire);
13487
13654
  if (!copiedPackages.has("sharp")) {
13488
- throw new Error(`Farm image optimization requires sharp. ${_chunkKWST2O22cjs.SHARP_INSTALL_HINT}`);
13655
+ throw new Error(`Farm image optimization requires sharp. ${_chunkCBLRSZQLcjs.SHARP_INSTALL_HINT}`);
13489
13656
  }
13490
13657
  } catch (error) {
13491
13658
  await fs4.rm(stageDir, { recursive: true, force: true });
@@ -13715,7 +13882,7 @@ async function createFarmProjectModuleSsrEnvironment() {
13715
13882
  // src/build/index.ts
13716
13883
  async function build(config, options = {}) {
13717
13884
  return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
13718
- () => _chunk2IFT2CSAcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
13885
+ () => _chunkBE7AQXJBcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
13719
13886
  );
13720
13887
  }
13721
13888
  function createBuildTargetBaseline(config) {
@@ -13726,7 +13893,7 @@ function createBuildTargetBaseline(config) {
13726
13893
  preset,
13727
13894
  distDir,
13728
13895
  outputDir,
13729
- outputWasDerived: outputDir === _chunkKEB7AGS6cjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
13896
+ outputWasDerived: outputDir === _chunk3WG7GJQLcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
13730
13897
  };
13731
13898
  }
13732
13899
  function resolveBuildTargets(config, options, baseline) {
@@ -13735,8 +13902,8 @@ function resolveBuildTargets(config, options, baseline) {
13735
13902
  const distDir = config.distDir || ".farm";
13736
13903
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
13737
13904
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
13738
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkKEB7AGS6cjs.getDeployTargetForPreset.call(void 0, preset);
13739
- const outputDir = shouldRefreshDerivedOutput ? _chunkKEB7AGS6cjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
13905
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunk3WG7GJQLcjs.getDeployTargetForPreset.call(void 0, preset);
13906
+ const outputDir = shouldRefreshDerivedOutput ? _chunk3WG7GJQLcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
13740
13907
  return {
13741
13908
  root,
13742
13909
  preset,
@@ -13744,7 +13911,7 @@ function resolveBuildTargets(config, options, baseline) {
13744
13911
  distDir,
13745
13912
  deployTarget,
13746
13913
  outputDir,
13747
- deployOutputDir: _chunkKEB7AGS6cjs.resolveDeployOutputPath.call(void 0, root, outputDir)
13914
+ deployOutputDir: _chunk3WG7GJQLcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
13748
13915
  };
13749
13916
  }
13750
13917
  async function buildWithProductionNodeEnv(inputConfig, options) {
@@ -13781,7 +13948,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13781
13948
  };
13782
13949
  config = {
13783
13950
  ...config,
13784
- images: _chunkKWST2O22cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
13951
+ images: _chunkCBLRSZQLcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
13785
13952
  root: targets.root,
13786
13953
  preset: targets.preset
13787
13954
  })
@@ -13789,7 +13956,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13789
13956
  if (_optionalChain([config, 'access', _324 => _324.docs, 'optionalAccess', _325 => _325.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
13790
13957
  pluginManager.updateContext({ config });
13791
13958
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
13792
- _chunk2IFT2CSAcjs.usePackageClientBoundaryCacheFile.call(void 0, _chunk2IFT2CSAcjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
13959
+ _chunkBE7AQXJBcjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkBE7AQXJBcjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
13793
13960
  _chunkQMNWKQL4cjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
13794
13961
  await pluginManager.setupPlugins();
13795
13962
  await pluginManager.runHookParallel("beforeBundle", {
@@ -13810,11 +13977,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13810
13977
  root,
13811
13978
  rendererBuild.signal
13812
13979
  );
13813
- const farmApp = _chunkKWST2O22cjs.createFarmApp.call(void 0, config, projectModuleServer);
13980
+ const farmApp = _chunkCBLRSZQLcjs.createFarmApp.call(void 0, config, projectModuleServer);
13814
13981
  await farmApp.initialize();
13815
13982
  const routeManager = farmApp.getRouteManager();
13816
13983
  const serverRenderer = farmApp.getServerRenderer();
13817
- const typeArtifacts = _chunkCSQPMV3Qcjs.generateFarmTypeArtifacts.call(void 0, {
13984
+ const typeArtifacts = _chunkE3LE6EZHcjs.generateFarmTypeArtifacts.call(void 0, {
13818
13985
  root,
13819
13986
  srcDir,
13820
13987
  layers: config.layers,
@@ -13830,7 +13997,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
13830
13997
  const message = error instanceof Error ? error.message : String(error);
13831
13998
  _chunkQMNWKQL4cjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
13832
13999
  });
13833
- const apiRouteManager = new (0, _chunkK66JILV3cjs.APIRouteManager)(
14000
+ const apiRouteManager = new (0, _chunk5LOARKDPcjs.APIRouteManager)(
13834
14001
  _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config),
13835
14002
  projectModuleServer,
13836
14003
  {
@@ -13917,7 +14084,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13917
14084
  ssr: true,
13918
14085
  buildLifetime
13919
14086
  });
13920
- const viteConfig = _chunkKWST2O22cjs.mergeFarmViteConfig.call(void 0,
14087
+ const viteConfig = _chunkCBLRSZQLcjs.mergeFarmViteConfig.call(void 0,
13921
14088
  {
13922
14089
  root,
13923
14090
  appType: "custom",
@@ -13929,12 +14096,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13929
14096
  },
13930
14097
  plugins: [
13931
14098
  ...rendererVitePlugins,
13932
- _chunkKWST2O22cjs.farmFontImportsPlugin.call(void 0, {
14099
+ _chunkCBLRSZQLcjs.farmFontImportsPlugin.call(void 0, {
13933
14100
  root,
13934
14101
  basePath: config.basePath,
13935
14102
  publicDir: config.publicDir
13936
14103
  }),
13937
- _chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
14104
+ _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
13938
14105
  // Route modules load here at build time (rendering config, prerendering): `server-only`
13939
14106
  // resolves as it does in the server build. Module-entry packages load pre-bundled, as in
13940
14107
  // `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
@@ -13946,7 +14113,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
13946
14113
  hmr: false
13947
14114
  },
13948
14115
  resolve: {
13949
- alias: _chunkKWST2O22cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
14116
+ alias: _chunkCBLRSZQLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
13950
14117
  dedupe: [...config.renderer.dedupe || []]
13951
14118
  },
13952
14119
  optimizeDeps: {
@@ -14016,7 +14183,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
14016
14183
  farmI18nClientBridgePlugin(),
14017
14184
  farmServerOnlyEntriesPlugin(),
14018
14185
  farmPlugin(config, pluginManager),
14019
- _chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
14186
+ _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
14020
14187
  ],
14021
14188
  mode: "production"
14022
14189
  });
@@ -14049,7 +14216,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
14049
14216
  plugins: [
14050
14217
  farmI18nClientBridgePlugin(),
14051
14218
  farmPlugin(config, pluginManager),
14052
- _chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
14219
+ _chunkBE7AQXJBcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
14053
14220
  ],
14054
14221
  mode: "production"
14055
14222
  });
@@ -14077,7 +14244,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
14077
14244
  if (pluginManager) {
14078
14245
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
14079
14246
  }
14080
- const outputDir = _chunkKEB7AGS6cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
14247
+ const outputDir = _chunk3WG7GJQLcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
14081
14248
  const serverOutputDir = _path2.default.join(outputDir, "server");
14082
14249
  const publicOutputDir = _path2.default.join(outputDir, "public");
14083
14250
  const { mkdir, cp } = await import("fs/promises");
@@ -14148,7 +14315,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
14148
14315
  root,
14149
14316
  preset,
14150
14317
  distDir,
14151
- outputDir: _chunkKEB7AGS6cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
14318
+ outputDir: _chunk3WG7GJQLcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
14152
14319
  });
14153
14320
  }
14154
14321
  }