@farm.js/core 0.1.80 → 0.1.81

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 (358) hide show
  1. package/dist/{agent-mcp.d-BPa5n0ld.d.ts → agent-mcp.d-Cxi3214_.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-DOP95Jxm.d.mts → agent-mcp.d-DMqOqnOA.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +2 -1
  4. package/dist/agent-runtime.d.ts +2 -1
  5. package/dist/analyzer-435DCIQ6.cjs +17 -0
  6. package/dist/{analyzer-F7CWE5VA.mjs → analyzer-IC66UJCU.mjs} +3 -2
  7. package/dist/api/client.cjs +1 -1
  8. package/dist/api/client.mjs +1 -1
  9. package/dist/api/client.native.cjs +1 -1
  10. package/dist/api/client.native.mjs +1 -1
  11. package/dist/api/node.cjs +1 -1
  12. package/dist/api/node.d.mts +4 -3
  13. package/dist/api/node.d.ts +4 -3
  14. package/dist/api/node.mjs +1 -1
  15. package/dist/api/route-manager.cjs +4 -4
  16. package/dist/api/route-manager.d.mts +4 -3
  17. package/dist/api/route-manager.d.ts +4 -3
  18. package/dist/api/route-manager.mjs +3 -3
  19. package/dist/api/runtime.cjs +1 -1
  20. package/dist/api/runtime.d.mts +3 -2
  21. package/dist/api/runtime.d.ts +3 -2
  22. package/dist/api/runtime.mjs +1 -1
  23. package/dist/api.cjs +5 -5
  24. package/dist/api.d.mts +5 -4
  25. package/dist/api.d.ts +5 -4
  26. package/dist/api.mjs +4 -4
  27. package/dist/{app-manifest.d-9UD6BznX.d.mts → app-manifest.d-Bbxp5kes.d.mts} +1 -1
  28. package/dist/{app-manifest.d-CO6Iu0Hx.d.ts → app-manifest.d-C8Cswd31.d.ts} +1 -1
  29. package/dist/app-markdown.cjs +3 -3
  30. package/dist/app-markdown.d.mts +5 -4
  31. package/dist/app-markdown.d.ts +5 -4
  32. package/dist/app-markdown.mjs +2 -2
  33. package/dist/{app.d-DXeRWZK7.d.mts → app.d-BJuSurgy.d.mts} +13 -4
  34. package/dist/{app.d-DwX1ePhs.d.ts → app.d-DGIoFt5D.d.ts} +13 -4
  35. package/dist/{chunk-Q4TRGTO7.cjs → chunk-26WP75W5.cjs} +32 -16
  36. package/dist/{chunk-GCRT6GJG.mjs → chunk-2HMSSPCZ.mjs} +26 -0
  37. package/dist/{chunk-7KDCVSTR.mjs → chunk-2PFGA6PB.mjs} +2 -2
  38. package/dist/chunk-2UYYXSUS.mjs +401 -0
  39. package/dist/{chunk-G4SZC2WH.cjs → chunk-2Y2HRZQY.cjs} +431 -332
  40. package/dist/{chunk-PL7MCYYD.mjs → chunk-3AV4DCXY.mjs} +58 -358
  41. package/dist/{chunk-3GNHJ3RN.cjs → chunk-3BTN3NP7.cjs} +2 -2
  42. package/dist/{chunk-ZVSQN7NC.cjs → chunk-46UV2E7I.cjs} +40 -43
  43. package/dist/{chunk-QMR2TUVZ.cjs → chunk-52Q4OB4A.cjs} +4 -4
  44. package/dist/chunk-5MMKNW7Q.cjs +54 -0
  45. package/dist/{chunk-XZBBKZGW.mjs → chunk-5N526T7Q.mjs} +64 -33
  46. package/dist/{chunk-XY5OZQF6.cjs → chunk-ADQ2LATR.cjs} +2 -2
  47. package/dist/{chunk-7DD5TNPS.cjs → chunk-AHVF5GI2.cjs} +2 -2
  48. package/dist/{chunk-MGKWYPE3.mjs → chunk-AYDVUCXD.mjs} +1 -0
  49. package/dist/chunk-B7L24VPX.cjs +401 -0
  50. package/dist/{chunk-5VDJEKGK.cjs → chunk-BBVLOEND.cjs} +1 -1
  51. package/dist/{chunk-XF7MJSUS.mjs → chunk-BCQIXH7L.mjs} +1 -1
  52. package/dist/{chunk-44G4XHEL.mjs → chunk-BJWJP5A4.mjs} +9 -9
  53. package/dist/{chunk-GBESKA76.cjs → chunk-BSX5OGSD.cjs} +1 -1
  54. package/dist/{chunk-CNDBLUKI.mjs → chunk-BVJUFVCU.mjs} +1 -1
  55. package/dist/chunk-C5QHZ626.cjs +85 -0
  56. package/dist/{chunk-X4TSMQWF.cjs → chunk-CL7BUGVB.cjs} +465 -360
  57. package/dist/{chunk-RLCOWWE5.cjs → chunk-CN2JOTRO.cjs} +7 -7
  58. package/dist/{chunk-AXA2BSX3.cjs → chunk-CPZZBCPO.cjs} +22 -21
  59. package/dist/chunk-D2VAANBS.mjs +48 -0
  60. package/dist/{chunk-JGEN2FIT.mjs → chunk-D77OGI6X.mjs} +1 -1
  61. package/dist/{chunk-4H4ZXUNB.cjs → chunk-DJ3PVHTW.cjs} +3 -3
  62. package/dist/{chunk-ZPEZXQTM.cjs → chunk-E3HBD2K3.cjs} +2 -2
  63. package/dist/{chunk-Q4YEAWUK.mjs → chunk-ECVSRE4Y.mjs} +3 -2
  64. package/dist/chunk-EZYKV24V.mjs +385 -0
  65. package/dist/{chunk-TVCFY3KK.cjs → chunk-FB4CWSC2.cjs} +12 -12
  66. package/dist/{chunk-IYFBLWXU.cjs → chunk-FULX5RYX.cjs} +61 -361
  67. package/dist/{chunk-5OAN7BG5.cjs → chunk-FYZD7DUS.cjs} +4 -4
  68. package/dist/{chunk-RQBGHHOQ.mjs → chunk-GY63XD6K.mjs} +1 -1
  69. package/dist/{chunk-HNUBRUFQ.cjs → chunk-HQEYZSF3.cjs} +4 -3
  70. package/dist/{chunk-MDEFTF63.mjs → chunk-HTNJ7A4D.mjs} +25 -28
  71. package/dist/chunk-I4WZRG73.mjs +54 -0
  72. package/dist/{chunk-MUZHULW2.mjs → chunk-ICOJ2BC6.mjs} +23 -7
  73. package/dist/{chunk-V73Y4UBL.mjs → chunk-IM3UINTZ.mjs} +1 -1
  74. package/dist/{chunk-MNIR7I7B.mjs → chunk-INKVDO42.mjs} +1 -1
  75. package/dist/{chunk-ZDYYZX73.mjs → chunk-IPG6B25T.mjs} +194 -89
  76. package/dist/{chunk-HEDGTXXB.cjs → chunk-JB4BHRFK.cjs} +17 -17
  77. package/dist/{chunk-XKUKWMGX.cjs → chunk-JCYDWJVO.cjs} +3 -3
  78. package/dist/{chunk-SVCUSOEF.mjs → chunk-KR5DF7WK.mjs} +1 -1
  79. package/dist/{chunk-COTFX4GT.mjs → chunk-LTOT5KVJ.mjs} +1 -1
  80. package/dist/{chunk-67MZTLTF.cjs → chunk-M6DAIE4T.cjs} +27 -1
  81. package/dist/{chunk-LVGB5PYK.cjs → chunk-MOGRRZMW.cjs} +17 -17
  82. package/dist/{chunk-MZ5QGWRW.mjs → chunk-N3VMHPIY.mjs} +2 -2
  83. package/dist/{chunk-GBW5DU7V.mjs → chunk-NOYKBGUK.mjs} +376 -277
  84. package/dist/{chunk-CCMP4JD2.cjs → chunk-NSLRK5DK.cjs} +1 -1
  85. package/dist/{chunk-WJ2O2MPP.cjs → chunk-OIWDEDUO.cjs} +394 -363
  86. package/dist/{chunk-K3XKEZR6.mjs → chunk-ONSZP5JK.mjs} +1 -1
  87. package/dist/{chunk-SDICLSQU.cjs → chunk-OUDNUFVR.cjs} +10 -10
  88. package/dist/{chunk-3XTRT3MB.mjs → chunk-PO5MZIWK.mjs} +1 -1
  89. package/dist/{chunk-EG5YBYHO.mjs → chunk-POL5RCVU.mjs} +1 -1
  90. package/dist/{chunk-ASYOWPSR.cjs → chunk-PWDBWXQI.cjs} +2 -1
  91. package/dist/{chunk-7YLDUB4R.cjs → chunk-QCKSYYXK.cjs} +7 -7
  92. package/dist/{chunk-57QAQU4F.mjs → chunk-QRNYSISP.mjs} +1 -1
  93. package/dist/{chunk-PRL7FXG4.cjs → chunk-RDNKQ5MK.cjs} +12 -13
  94. package/dist/{chunk-3JQBQG7K.mjs → chunk-RZ6XUEQS.mjs} +2 -2
  95. package/dist/{chunk-QHAISITM.mjs → chunk-S3IWDDQ3.mjs} +1 -1
  96. package/dist/{chunk-EGHPFXPZ.cjs → chunk-SAPG45RA.cjs} +23 -23
  97. package/dist/{chunk-YN3YMSKD.mjs → chunk-TLSGRK7E.mjs} +3 -3
  98. package/dist/chunk-UDMBUTJD.mjs +85 -0
  99. package/dist/{chunk-NJ4OASLP.mjs → chunk-UF4BNKKJ.mjs} +1 -1
  100. package/dist/{chunk-WHEQJN4G.cjs → chunk-UGD53SNO.cjs} +2 -2
  101. package/dist/{chunk-WBPVLCNE.mjs → chunk-VPGEYX5Y.mjs} +4 -4
  102. package/dist/chunk-VS7HLH4S.cjs +385 -0
  103. package/dist/{chunk-ANZLZNNX.cjs → chunk-W6C3LEXX.cjs} +3 -3
  104. package/dist/chunk-WMRGIQTA.cjs +48 -0
  105. package/dist/{chunk-52LTENRE.cjs → chunk-WOAXQ5MZ.cjs} +9 -9
  106. package/dist/{chunk-C6HGUTXB.mjs → chunk-XBSIGZ4J.mjs} +2 -3
  107. package/dist/{chunk-TS3ZHJN5.cjs → chunk-XOGCNKB7.cjs} +3 -3
  108. package/dist/{chunk-KEU55O2D.mjs → chunk-XOXCQGAF.mjs} +7 -6
  109. package/dist/{chunk-4MIDUSIX.mjs → chunk-YH7ENV3K.mjs} +14 -14
  110. package/dist/{chunk-2RRTOKRZ.mjs → chunk-YHM4PXJY.mjs} +1 -1
  111. package/dist/{chunk-A5D3UMLJ.mjs → chunk-YSU3WCW6.mjs} +1 -1
  112. package/dist/{chunk-4STJ6LGR.mjs → chunk-Z3RM3VA2.mjs} +1 -1
  113. package/dist/{chunk-DVHFIETW.cjs → chunk-ZIYJWJV2.cjs} +13 -13
  114. package/dist/{chunk-Z4SMFUZ7.cjs → chunk-ZKNXCRUQ.cjs} +7 -7
  115. package/dist/{cli-runtime.d-DPNTN-JV.d.mts → cli-runtime.d-D8O1v2_X.d.mts} +5 -5
  116. package/dist/{cli-runtime.d-8BhZy_wr.d.ts → cli-runtime.d-hf4L1MNP.d.ts} +5 -5
  117. package/dist/{client-component.d-CkDcob6D.d.ts → client-component.d-CX8UCQh-.d.ts} +1 -1
  118. package/dist/{client-component.d-CMCdyAr8.d.mts → client-component.d-DFwUHlOz.d.mts} +1 -1
  119. package/dist/{client-plugins.d-WcMwOZGZ.d.mts → client-plugins.d-BflSNO-b.d.mts} +2 -13
  120. package/dist/{client-plugins.d-BYIovYqX.d.ts → client-plugins.d-qWp8hNwd.d.ts} +2 -13
  121. package/dist/client-plugins.d.mts +2 -1
  122. package/dist/client-plugins.d.ts +2 -1
  123. package/dist/client.cjs +9 -8
  124. package/dist/client.d.mts +20 -151
  125. package/dist/client.d.ts +20 -151
  126. package/dist/client.mjs +8 -7
  127. package/dist/config.d.mts +2 -1
  128. package/dist/config.d.ts +2 -1
  129. package/dist/desktop.d.mts +3 -2
  130. package/dist/desktop.d.ts +3 -2
  131. package/dist/{devtools-JJOYTIMS.cjs → devtools-EI5N366Z.cjs} +9 -9
  132. package/dist/{devtools-F3FDFV26.mjs → devtools-XJHODO5H.mjs} +7 -7
  133. package/dist/docs.cjs +9 -9
  134. package/dist/docs.d.mts +4 -3
  135. package/dist/docs.d.ts +4 -3
  136. package/dist/docs.mjs +8 -8
  137. package/dist/environment/vite.cjs +7 -6
  138. package/dist/environment/vite.mjs +6 -5
  139. package/dist/{handler.d-BwdOyc9x.d.ts → handler.d-C2oRihfa.d.ts} +1 -1
  140. package/dist/{handler.d-s3IM6pbJ.d.mts → handler.d-DoH5Krkq.d.mts} +1 -1
  141. package/dist/{headers.d-BR-OXrqQ.d.mts → headers.d-BrX53wFQ.d.mts} +1 -1
  142. package/dist/{headers.d-CAW4wPey.d.ts → headers.d-Dj0mfYpb.d.ts} +1 -1
  143. package/dist/index.cjs +58 -56
  144. package/dist/{index.d-ah2c89Wu.d.ts → index.d-Dhc2scRl.d.ts} +1 -1
  145. package/dist/{index.d-BEVK61zS.d.mts → index.d-DzDHOttz.d.mts} +1 -1
  146. package/dist/index.d.mts +25 -23
  147. package/dist/index.d.ts +25 -23
  148. package/dist/index.mjs +62 -60
  149. package/dist/instrumentation.cjs +3 -3
  150. package/dist/instrumentation.mjs +2 -2
  151. package/dist/integrations/orm.d.mts +2 -1
  152. package/dist/integrations/orm.d.ts +2 -1
  153. package/dist/integrations.d.mts +2 -1
  154. package/dist/integrations.d.ts +2 -1
  155. package/dist/internal/app-markdown-runtime.cjs +2 -2
  156. package/dist/internal/app-markdown-runtime.d.mts +12 -5
  157. package/dist/internal/app-markdown-runtime.d.ts +12 -5
  158. package/dist/internal/app-markdown-runtime.mjs +1 -1
  159. package/dist/internal/build-runtime.cjs +41 -40
  160. package/dist/internal/build-runtime.d.mts +5 -4
  161. package/dist/internal/build-runtime.d.ts +5 -4
  162. package/dist/internal/build-runtime.mjs +40 -39
  163. package/dist/internal/cli-runtime.cjs +19 -19
  164. package/dist/internal/cli-runtime.d.mts +8 -7
  165. package/dist/internal/cli-runtime.d.ts +8 -7
  166. package/dist/internal/cli-runtime.mjs +20 -20
  167. package/dist/internal/client-error-overlay.cjs +4 -4
  168. package/dist/internal/client-error-overlay.mjs +1 -1
  169. package/dist/internal/client-runtime.cjs +76 -15
  170. package/dist/internal/client-runtime.d.mts +18 -7
  171. package/dist/internal/client-runtime.d.ts +18 -7
  172. package/dist/internal/client-runtime.mjs +67 -6
  173. package/dist/internal/compression-runtime.d.mts +2 -1
  174. package/dist/internal/compression-runtime.d.ts +2 -1
  175. package/dist/internal/config-runtime.cjs +9 -9
  176. package/dist/internal/config-runtime.d.mts +4 -3
  177. package/dist/internal/config-runtime.d.ts +4 -3
  178. package/dist/internal/config-runtime.mjs +8 -8
  179. package/dist/internal/docs-precompiled-runtime.cjs +1 -1
  180. package/dist/internal/docs-precompiled-runtime.mjs +1 -1
  181. package/dist/internal/form-actions.cjs +3 -3
  182. package/dist/internal/form-actions.mjs +2 -2
  183. package/dist/internal/infra-analytics-runtime.cjs +7 -7
  184. package/dist/internal/infra-analytics-runtime.mjs +5 -5
  185. package/dist/internal/island-codec.cjs +3 -3
  186. package/dist/internal/island-codec.mjs +2 -2
  187. package/dist/internal/island-value-store.d.mts +1 -1
  188. package/dist/internal/island-value-store.d.ts +1 -1
  189. package/dist/internal/islands-boot.cjs +9 -3
  190. package/dist/internal/islands-boot.mjs +9 -3
  191. package/dist/internal/islands-runtime.cjs +10 -56
  192. package/dist/internal/islands-runtime.mjs +6 -52
  193. package/dist/internal/islands-server.cjs +4 -4
  194. package/dist/internal/islands-server.mjs +3 -3
  195. package/dist/internal/islx-actions-client.cjs +36 -0
  196. package/dist/internal/islx-actions-client.d.mts +13 -0
  197. package/dist/internal/islx-actions-client.d.ts +13 -0
  198. package/dist/internal/islx-actions-client.mjs +36 -0
  199. package/dist/internal/islx-actions-server.cjs +8 -0
  200. package/dist/internal/islx-actions-server.d.mts +6 -0
  201. package/dist/internal/islx-actions-server.d.ts +6 -0
  202. package/dist/internal/islx-actions-server.mjs +8 -0
  203. package/dist/internal/islx-client.d.mts +0 -4
  204. package/dist/internal/islx-client.d.ts +0 -4
  205. package/dist/internal/isolated-boundary.cjs +3 -3
  206. package/dist/internal/isolated-boundary.d.mts +1 -1
  207. package/dist/internal/isolated-boundary.d.ts +1 -1
  208. package/dist/internal/isolated-boundary.mjs +2 -2
  209. package/dist/internal/metadata-image-runtime.cjs +4 -2
  210. package/dist/internal/metadata-image-runtime.d.mts +18 -2
  211. package/dist/internal/metadata-image-runtime.d.ts +18 -2
  212. package/dist/internal/metadata-image-runtime.mjs +5 -3
  213. package/dist/internal/native-server-fns.cjs +5 -4
  214. package/dist/internal/native-server-fns.mjs +4 -3
  215. package/dist/internal/navigation-neutral.cjs +36 -0
  216. package/dist/internal/navigation-neutral.d.mts +14 -0
  217. package/dist/internal/navigation-neutral.d.ts +14 -0
  218. package/dist/internal/navigation-neutral.mjs +36 -0
  219. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  220. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  221. package/dist/internal/production-runtime.cjs +24 -24
  222. package/dist/internal/production-runtime.d.mts +11 -10
  223. package/dist/internal/production-runtime.d.ts +11 -10
  224. package/dist/internal/production-runtime.mjs +29 -29
  225. package/dist/internal/server-tree.cjs +5 -4
  226. package/dist/internal/server-tree.d.mts +3 -4
  227. package/dist/internal/server-tree.d.ts +3 -4
  228. package/dist/internal/server-tree.mjs +4 -3
  229. package/dist/internal/spa-router.cjs +3 -3
  230. package/dist/internal/spa-router.d.mts +4 -3
  231. package/dist/internal/spa-router.d.ts +4 -3
  232. package/dist/internal/spa-router.mjs +2 -2
  233. package/dist/internal/start-manifest.d.mts +2 -1
  234. package/dist/internal/start-manifest.d.ts +2 -1
  235. package/dist/internal/vercel-edge-middleware.cjs +1 -1
  236. package/dist/internal/vercel-edge-middleware.mjs +1 -1
  237. package/dist/island-value-protocol.d-fEoc1m8e.d.mts +27 -0
  238. package/dist/island-value-protocol.d-fEoc1m8e.d.ts +27 -0
  239. package/dist/{layers-5ZD4764G.mjs → layers-744BBUY5.mjs} +2 -2
  240. package/dist/layers-XLOMMQP7.cjs +21 -0
  241. package/dist/markdown.d.mts +2 -1
  242. package/dist/markdown.d.ts +2 -1
  243. package/dist/middleware.cjs +5 -5
  244. package/dist/middleware.d.mts +2 -1
  245. package/dist/middleware.d.ts +2 -1
  246. package/dist/middleware.mjs +4 -4
  247. package/dist/{mount.d-Ylo-CmzK.d.mts → mount.d-DOaeUoWq.d.mts} +1 -1
  248. package/dist/{mount.d-DcoPFqv5.d.ts → mount.d-DwXjaOHY.d.ts} +1 -1
  249. package/dist/{native-server-fn-handler-TNVFEQW3.cjs → native-server-fn-handler-57TCQPSM.cjs} +4 -4
  250. package/dist/{native-server-fn-handler-OXFTI6V5.mjs → native-server-fn-handler-PYK65A46.mjs} +3 -3
  251. package/dist/{navigation-delegate.d-BA5h0fbE.d.mts → navigation-delegate.d-BElGUMgt.d.mts} +1 -1
  252. package/dist/{navigation-delegate.d-2MK4YSlL.d.ts → navigation-delegate.d-o3pPd9VI.d.ts} +1 -1
  253. package/dist/navigation-errors.d-DwHtoMyR.d.mts +13 -0
  254. package/dist/navigation-errors.d-DwHtoMyR.d.ts +13 -0
  255. package/dist/navigation.cjs +6 -6
  256. package/dist/navigation.d.mts +7 -6
  257. package/dist/navigation.d.ts +7 -6
  258. package/dist/navigation.mjs +5 -5
  259. package/dist/{nitro-6UOJXJZ6.cjs → nitro-XGIO6EQN.cjs} +2 -2
  260. package/dist/{nitro-C3MYDX7V.mjs → nitro-YLTGVGK4.mjs} +1 -1
  261. package/dist/node-module-bundle-TNSY5PAC.cjs +15 -0
  262. package/dist/{node-module-bundle-XPLBMXRD.mjs → node-module-bundle-ZWCQJCKA.mjs} +3 -1
  263. package/dist/plugin.cjs +32 -30
  264. package/dist/plugin.d.mts +6 -5
  265. package/dist/plugin.d.ts +6 -5
  266. package/dist/plugin.mjs +31 -29
  267. package/dist/query/client.cjs +10 -10
  268. package/dist/query/client.mjs +5 -5
  269. package/dist/{render-plan.d-2o-AG-ot.d.ts → render-plan.d-BD06tqFA.d.ts} +1 -1
  270. package/dist/{render-plan.d-ChYBMhLu.d.mts → render-plan.d-xWCRAJeR.d.mts} +1 -1
  271. package/dist/renderer/none/server.cjs +5 -1
  272. package/dist/renderer/none/server.d.mts +3 -1
  273. package/dist/renderer/none/server.d.ts +3 -1
  274. package/dist/renderer/none/server.mjs +4 -0
  275. package/dist/renderer/react/server.cjs +6 -6
  276. package/dist/renderer/react/server.mjs +3 -3
  277. package/dist/renderer-client.cjs +34 -15
  278. package/dist/renderer-client.d.mts +13 -97
  279. package/dist/renderer-client.d.ts +13 -97
  280. package/dist/renderer-client.mjs +23 -4
  281. package/dist/renderer.cjs +4 -2
  282. package/dist/renderer.d.mts +33 -5
  283. package/dist/renderer.d.ts +33 -5
  284. package/dist/renderer.mjs +3 -1
  285. package/dist/{request.d-CE0FIkiM.d.ts → request.d-DUMuWxSN.d.ts} +1 -1
  286. package/dist/{request.d-RCnCBuWq.d.mts → request.d-Dx82V8bz.d.mts} +1 -1
  287. package/dist/request.d.mts +3 -2
  288. package/dist/request.d.ts +3 -2
  289. package/dist/{route-rendering.d-BTPOM2nU.d.ts → route-rendering.d-BwBVpLtD.d.ts} +1 -1
  290. package/dist/{route-rendering.d-BZJnfKsp.d.mts → route-rendering.d-DJh6GauM.d.mts} +1 -1
  291. package/dist/{router.d-D8Vvwl4i.d.mts → router.d-BtkKDxUB.d.mts} +1 -1
  292. package/dist/{router.d-BU_WE6Ol.d.ts → router.d-CJBSG5jr.d.ts} +1 -1
  293. package/dist/routes.cjs +1 -1
  294. package/dist/routes.d.mts +2 -1
  295. package/dist/routes.d.ts +2 -1
  296. package/dist/routes.mjs +1 -1
  297. package/dist/{rsc-pipeline-JZWVSHOR.mjs → rsc-pipeline-GD6KLOIG.mjs} +13 -13
  298. package/dist/{rsc-pipeline-A3R4U26C.cjs → rsc-pipeline-H5AXQA7A.cjs} +14 -14
  299. package/dist/{runtime-SQFRHRGJ.mjs → runtime-OJ7FXFUI.mjs} +13 -13
  300. package/dist/{runtime-WZ3CHHGJ.cjs → runtime-YWQVBC3V.cjs} +15 -15
  301. package/dist/{runtime.d-DJ6IIKcF.d.ts → runtime.d-BQnD0cfC.d.ts} +1 -1
  302. package/dist/{runtime.d-BnmuOXVD.d.mts → runtime.d-C4SuZXf6.d.mts} +1 -1
  303. package/dist/server-action-security.cjs +1 -1
  304. package/dist/server-action-security.mjs +1 -1
  305. package/dist/{server-components-status.d-BzOg9M8g.d.mts → server-components-status.d-9rH7ZoEq.d.mts} +1 -1
  306. package/dist/{server-components-status.d-BeqSXcjM.d.ts → server-components-status.d-rfKOcE0N.d.ts} +1 -1
  307. package/dist/server-fn.cjs +3 -3
  308. package/dist/server-fn.mjs +2 -2
  309. package/dist/server-plugins.cjs +1 -1
  310. package/dist/server-plugins.d.mts +4 -3
  311. package/dist/server-plugins.d.ts +4 -3
  312. package/dist/server-plugins.mjs +1 -1
  313. package/dist/server-query.cjs +4 -4
  314. package/dist/server-query.mjs +3 -3
  315. package/dist/server.cjs +64 -59
  316. package/dist/server.d.mts +12 -11
  317. package/dist/server.d.ts +12 -11
  318. package/dist/server.mjs +45 -40
  319. package/dist/{spa-router.d-BOwuVkMl.d.ts → spa-router.d-DMKiBsHH.d.ts} +3 -3
  320. package/dist/{spa-router.d-CDpftSsk.d.mts → spa-router.d-V6XLSTCy.d.mts} +3 -3
  321. package/dist/{ssg.d-Bx_WFuwg.d.mts → ssg.d-BnCKPQL0.d.mts} +2 -2
  322. package/dist/{ssg.d-BTVqyq8T.d.ts → ssg.d-MNedvvMB.d.ts} +2 -2
  323. package/dist/store-core.d-Ad5biajo.d.ts +301 -0
  324. package/dist/store-core.d-BqJI1-ix.d.mts +301 -0
  325. package/dist/testing.cjs +3 -3
  326. package/dist/testing.d.mts +2 -1
  327. package/dist/testing.d.ts +2 -1
  328. package/dist/testing.mjs +3 -3
  329. package/dist/{utils.d-JkrpS-NJ.d.mts → utils.d-BEKLWa0Z.d.mts} +1 -1
  330. package/dist/{utils.d-_dvevm5s.d.ts → utils.d-BdjHKDuT.d.ts} +1 -1
  331. package/dist/version.cjs +2 -2
  332. package/dist/version.mjs +1 -1
  333. package/dist/vite.cjs +34 -30
  334. package/dist/vite.d.mts +18 -7
  335. package/dist/vite.d.ts +18 -7
  336. package/dist/vite.mjs +33 -29
  337. package/dist/workflows.cjs +2 -2
  338. package/dist/workflows.mjs +1 -1
  339. package/package.json +17 -2
  340. package/dist/analyzer-I7RBBQ65.cjs +0 -16
  341. package/dist/chunk-CQL5ZGFU.cjs +0 -50
  342. package/dist/chunk-HONTCUK6.mjs +0 -203
  343. package/dist/chunk-K6PGK7DC.cjs +0 -203
  344. package/dist/chunk-NBIVGHAT.mjs +0 -50
  345. package/dist/island-value-protocol.d-BRayRghM.d.mts +0 -12
  346. package/dist/island-value-protocol.d-BRayRghM.d.ts +0 -12
  347. package/dist/layers-HMEGUEXM.cjs +0 -21
  348. package/dist/node-module-bundle-M6BISE2P.cjs +0 -13
  349. package/dist/{chunk-EY7ED5UW.mjs → chunk-3RVLJTFZ.mjs} +3 -3
  350. package/dist/{chunk-KKVRWNDH.mjs → chunk-6WVRVGKC.mjs} +3 -3
  351. package/dist/{chunk-UJPE75GF.mjs → chunk-J2VUPCCR.mjs} +3 -3
  352. package/dist/{chunk-MQOHYV6L.cjs → chunk-LKIG5SM6.cjs} +2 -2
  353. package/dist/{chunk-UWOCYINY.cjs → chunk-OFVCWV2D.cjs} +2 -2
  354. package/dist/{chunk-3K2E55BJ.mjs → chunk-OO4GVGM3.mjs} +3 -3
  355. package/dist/{chunk-PBJ7MEOV.cjs → chunk-OZUINP2P.cjs} +2 -2
  356. package/dist/{chunk-7FQFK3OA.mjs → chunk-V7HNYR76.mjs} +3 -3
  357. package/dist/{chunk-2FK47RRZ.cjs → chunk-VGHDPEPQ.cjs} +2 -2
  358. package/dist/{chunk-CGIVCGH5.cjs → chunk-XOFJUSWC.cjs} +2 -2
@@ -32,7 +32,7 @@ var _chunkMHKPXX3Jcjs = require('./chunk-MHKPXX3J.cjs');
32
32
 
33
33
 
34
34
 
35
- var _chunkTS3ZHJN5cjs = require('./chunk-TS3ZHJN5.cjs');
35
+ var _chunkXOGCNKB7cjs = require('./chunk-XOGCNKB7.cjs');
36
36
 
37
37
 
38
38
 
@@ -41,7 +41,7 @@ var _chunkTS3ZHJN5cjs = require('./chunk-TS3ZHJN5.cjs');
41
41
 
42
42
 
43
43
 
44
- var _chunkZPEZXQTMcjs = require('./chunk-ZPEZXQTM.cjs');
44
+ var _chunkE3HBD2K3cjs = require('./chunk-E3HBD2K3.cjs');
45
45
 
46
46
 
47
47
 
@@ -65,7 +65,7 @@ var _chunkN3H7UPBMcjs = require('./chunk-N3H7UPBM.cjs');
65
65
  var _chunkYUQUGVSVcjs = require('./chunk-YUQUGVSV.cjs');
66
66
 
67
67
 
68
- var _chunkANZLZNNXcjs = require('./chunk-ANZLZNNX.cjs');
68
+ var _chunkW6C3LEXXcjs = require('./chunk-W6C3LEXX.cjs');
69
69
 
70
70
 
71
71
  var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
@@ -74,10 +74,10 @@ var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
74
74
 
75
75
 
76
76
 
77
- var _chunkLVGB5PYKcjs = require('./chunk-LVGB5PYK.cjs');
77
+ var _chunkMOGRRZMWcjs = require('./chunk-MOGRRZMW.cjs');
78
78
 
79
79
 
80
- var _chunk3GNHJ3RNcjs = require('./chunk-3GNHJ3RN.cjs');
80
+ var _chunk3BTN3NP7cjs = require('./chunk-3BTN3NP7.cjs');
81
81
 
82
82
 
83
83
  var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
@@ -117,7 +117,9 @@ var _chunkO4JYMU5Ncjs = require('./chunk-O4JYMU5N.cjs');
117
117
 
118
118
 
119
119
 
120
- var _chunkX4TSMQWFcjs = require('./chunk-X4TSMQWF.cjs');
120
+
121
+
122
+ var _chunkCL7BUGVBcjs = require('./chunk-CL7BUGVB.cjs');
121
123
 
122
124
 
123
125
 
@@ -133,7 +135,7 @@ var _chunkTCMRLW3Kcjs = require('./chunk-TCMRLW3K.cjs');
133
135
 
134
136
 
135
137
 
136
- var _chunkSDICLSQUcjs = require('./chunk-SDICLSQU.cjs');
138
+ var _chunkOUDNUFVRcjs = require('./chunk-OUDNUFVR.cjs');
137
139
 
138
140
 
139
141
 
@@ -146,7 +148,7 @@ var _chunkSDICLSQUcjs = require('./chunk-SDICLSQU.cjs');
146
148
 
147
149
 
148
150
 
149
- var _chunkUWOCYINYcjs = require('./chunk-UWOCYINY.cjs');
151
+ var _chunkOFVCWV2Dcjs = require('./chunk-OFVCWV2D.cjs');
150
152
 
151
153
 
152
154
  var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
@@ -160,7 +162,7 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
160
162
 
161
163
 
162
164
 
163
- var _chunk5OAN7BG5cjs = require('./chunk-5OAN7BG5.cjs');
165
+ var _chunkFYZD7DUScjs = require('./chunk-FYZD7DUS.cjs');
164
166
 
165
167
 
166
168
 
@@ -168,7 +170,7 @@ var _chunk5OAN7BG5cjs = require('./chunk-5OAN7BG5.cjs');
168
170
  var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
169
171
 
170
172
 
171
- var _chunkXY5OZQF6cjs = require('./chunk-XY5OZQF6.cjs');
173
+ var _chunkADQ2LATRcjs = require('./chunk-ADQ2LATR.cjs');
172
174
 
173
175
 
174
176
  var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
@@ -189,7 +191,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
189
191
 
190
192
 
191
193
 
192
- var _chunkZVSQN7NCcjs = require('./chunk-ZVSQN7NC.cjs');
194
+ var _chunk46UV2E7Icjs = require('./chunk-46UV2E7I.cjs');
193
195
 
194
196
 
195
197
 
@@ -211,6 +213,7 @@ var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
211
213
  var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
212
214
 
213
215
 
216
+ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
214
217
 
215
218
 
216
219
 
@@ -218,10 +221,9 @@ var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
218
221
 
219
222
 
220
223
 
221
- var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
222
224
 
223
225
 
224
- var _chunkQMR2TUVZcjs = require('./chunk-QMR2TUVZ.cjs');
226
+ var _chunkM6DAIE4Tcjs = require('./chunk-M6DAIE4T.cjs');
225
227
 
226
228
 
227
229
 
@@ -240,7 +242,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
240
242
 
241
243
 
242
244
 
243
- var _chunkQ4TRGTO7cjs = require('./chunk-Q4TRGTO7.cjs');
245
+ var _chunk26WP75W5cjs = require('./chunk-26WP75W5.cjs');
244
246
 
245
247
 
246
248
 
@@ -250,11 +252,11 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
250
252
  var _chunk2NOHVIJ3cjs = require('./chunk-2NOHVIJ3.cjs');
251
253
 
252
254
 
253
- var _chunkASYOWPSRcjs = require('./chunk-ASYOWPSR.cjs');
255
+ var _chunkPWDBWXQIcjs = require('./chunk-PWDBWXQI.cjs');
254
256
 
255
257
 
256
258
 
257
- var _chunkGBESKA76cjs = require('./chunk-GBESKA76.cjs');
259
+ var _chunkBSX5OGSDcjs = require('./chunk-BSX5OGSD.cjs');
258
260
 
259
261
 
260
262
 
@@ -272,7 +274,7 @@ var _chunkNW3DL2PMcjs = require('./chunk-NW3DL2PM.cjs');
272
274
  var _chunkSHDCKRP4cjs = require('./chunk-SHDCKRP4.cjs');
273
275
 
274
276
 
275
- var _chunkMQOHYV6Lcjs = require('./chunk-MQOHYV6L.cjs');
277
+ var _chunkLKIG5SM6cjs = require('./chunk-LKIG5SM6.cjs');
276
278
 
277
279
 
278
280
  var _chunkCYOTNHDFcjs = require('./chunk-CYOTNHDF.cjs');
@@ -300,7 +302,7 @@ var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
300
302
  var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
301
303
 
302
304
 
303
- var _chunkCCMP4JD2cjs = require('./chunk-CCMP4JD2.cjs');
305
+ var _chunkNSLRK5DKcjs = require('./chunk-NSLRK5DK.cjs');
304
306
 
305
307
 
306
308
  var _chunkY3DO7BIJcjs = require('./chunk-Y3DO7BIJ.cjs');
@@ -643,7 +645,7 @@ async function compileFarmDocsManifest(docs, options) {
643
645
  isPathGuarded: options.isPathGuarded,
644
646
  basePath
645
647
  });
646
- const apiHandler = _chunkZPEZXQTMcjs.createFarmDocsAPIHandler.call(void 0, {
648
+ const apiHandler = _chunkE3HBD2K3cjs.createFarmDocsAPIHandler.call(void 0, {
647
649
  rootDir: options.root,
648
650
  srcDir: options.srcDir,
649
651
  docs,
@@ -1020,7 +1022,7 @@ async function createFarmRouteRuntimeManifest(options) {
1020
1022
  const routes = [];
1021
1023
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
1022
1024
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
1023
- const rendering = await _chunkSDICLSQUcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
1025
+ const rendering = await _chunkOUDNUFVRcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
1024
1026
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
1025
1027
  routes.push({
1026
1028
  kind: "page",
@@ -1633,7 +1635,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
1633
1635
  // removed block used (`readFileSync` for a version, say).
1634
1636
  enforce: "pre",
1635
1637
  transform: {
1636
- filter: { id: _chunkX4TSMQWFcjs.fileNamePattern.call(void 0, configFiles) },
1638
+ filter: { id: _chunkCL7BUGVBcjs.fileNamePattern.call(void 0, configFiles) },
1637
1639
  async handler(code, id) {
1638
1640
  const file = id.split("?", 1)[0];
1639
1641
  if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
@@ -1734,6 +1736,42 @@ function createFarmPrivateClientSourcemapsPlugin(options) {
1734
1736
  };
1735
1737
  }
1736
1738
 
1739
+ // src/nitro/client-brotli-assets.ts
1740
+
1741
+
1742
+
1743
+
1744
+ var _zlib = require('zlib');
1745
+ var compress = _util.promisify.call(void 0, _zlib.brotliCompress);
1746
+ var SCRIPT_OR_STYLESHEET = /\.(?:m?js|css)$/;
1747
+ var MIN_COMPRESSED_BYTES = 1024;
1748
+ async function writeFarmClientBrotliAssets(clientOutputDir) {
1749
+ const entries = await _promises.readdir.call(void 0, clientOutputDir, { recursive: true, withFileTypes: true });
1750
+ const files = new Set(
1751
+ entries.filter((entry) => entry.isFile()).map((entry) => _path2.default.join(entry.parentPath, entry.name))
1752
+ );
1753
+ const pending = [...files].filter(
1754
+ (file) => SCRIPT_OR_STYLESHEET.test(file) && !files.has(`${file}.br`)
1755
+ );
1756
+ const next = async () => {
1757
+ const file = pending.pop();
1758
+ if (file === void 0) return;
1759
+ const source = await _promises.readFile.call(void 0, file);
1760
+ if (source.length >= MIN_COMPRESSED_BYTES) {
1761
+ const compressed = await compress(source, {
1762
+ params: {
1763
+ [_zlib.constants.BROTLI_PARAM_MODE]: _zlib.constants.BROTLI_MODE_TEXT,
1764
+ [_zlib.constants.BROTLI_PARAM_QUALITY]: _zlib.constants.BROTLI_MAX_QUALITY,
1765
+ [_zlib.constants.BROTLI_PARAM_SIZE_HINT]: source.length
1766
+ }
1767
+ });
1768
+ await _promises.writeFile.call(void 0, `${file}.br`, compressed);
1769
+ }
1770
+ return next();
1771
+ };
1772
+ await Promise.all(Array.from({ length: _os.availableParallelism.call(void 0, ) }, next));
1773
+ }
1774
+
1737
1775
  // src/middleware/static-config.ts
1738
1776
  function literalMatcher(node) {
1739
1777
  if (!node) return void 0;
@@ -1799,8 +1837,8 @@ function readStaticMiddlewareConfig(program) {
1799
1837
  }
1800
1838
  async function readMiddlewareFileConfig(filePath) {
1801
1839
  try {
1802
- const [{ readFile }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
1803
- const parsed = vite.parseSync(filePath, await readFile(filePath, "utf8"));
1840
+ const [{ readFile: readFile2 }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
1841
+ const parsed = vite.parseSync(filePath, await readFile2(filePath, "utf8"));
1804
1842
  if (_optionalChain([parsed, 'access', _45 => _45.errors, 'optionalAccess', _46 => _46.length])) return "unknown";
1805
1843
  return readStaticMiddlewareConfig(parsed.program);
1806
1844
  } catch (e13) {
@@ -1811,7 +1849,7 @@ async function readMiddlewareFileConfig(filePath) {
1811
1849
  // src/nitro/vercel-edge-middleware.ts
1812
1850
 
1813
1851
 
1814
- var _zlib = require('zlib');
1852
+
1815
1853
  var FARM_VERCEL_EDGE_MIDDLEWARE_FUNCTION = "_farm_middleware";
1816
1854
  var FARM_VERCEL_EDGE_NOT_FOUND_PATH = "/__farm/not-found";
1817
1855
  var EDGE_NODE_MODULES = /* @__PURE__ */ new Set(["async_hooks", "events", "buffer", "assert", "util"]);
@@ -1916,7 +1954,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
1916
1954
  logLevel: "silent",
1917
1955
  plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
1918
1956
  resolve: {
1919
- alias: _chunkX4TSMQWFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
1957
+ alias: _chunkCL7BUGVBcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
1920
1958
  conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
1921
1959
  },
1922
1960
  transform: {
@@ -1935,7 +1973,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
1935
1973
  await bundle.close();
1936
1974
  }
1937
1975
  } catch (error) {
1938
- throw _chunkASYOWPSRcjs.withPlainDiagnostics.call(void 0, error);
1976
+ throw _chunkPWDBWXQIcjs.withPlainDiagnostics.call(void 0, error);
1939
1977
  } finally {
1940
1978
  await fs5.rm(entryPath, { force: true });
1941
1979
  }
@@ -2138,7 +2176,7 @@ function createPrerenderMarkdownPagesPlugin(pages) {
2138
2176
  const compiled = await pages;
2139
2177
  if (compiled.size === 0) return "";
2140
2178
  return `globalThis[Symbol.for(${JSON.stringify(
2141
- _chunkQ4TRGTO7cjs.FARM_MARKDOWN_PRECOMPILED_PAGES.description
2179
+ _chunk26WP75W5cjs.FARM_MARKDOWN_PRECOMPILED_PAGES.description
2142
2180
  )})] = new Map(${JSON.stringify([...compiled])});`;
2143
2181
  }
2144
2182
  };
@@ -2276,7 +2314,7 @@ function hasReactDomEdgeServerBuild(root) {
2276
2314
  }
2277
2315
  }
2278
2316
  function shouldAliasReactServerToWebBuild(renderer, preset) {
2279
- return _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
2317
+ return _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
2280
2318
  }
2281
2319
  function isCloudflareImagePreset(preset) {
2282
2320
  return preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module";
@@ -2318,7 +2356,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
2318
2356
  return {
2319
2357
  name: "farm-omitted-metadata-image-runtime",
2320
2358
  resolveId: {
2321
- filter: { id: _chunkX4TSMQWFcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
2359
+ filter: { id: _chunkCL7BUGVBcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
2322
2360
  handler(source, importer) {
2323
2361
  if (source !== "@vercel/og") return null;
2324
2362
  const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
@@ -2327,7 +2365,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
2327
2365
  }
2328
2366
  },
2329
2367
  load: {
2330
- filter: { id: _chunkX4TSMQWFcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
2368
+ filter: { id: _chunkCL7BUGVBcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
2331
2369
  handler(id) {
2332
2370
  if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
2333
2371
  return `
@@ -2739,7 +2777,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
2739
2777
  routeManager.getSearchPreserveRoutes().map((route) => [route.pattern, route])
2740
2778
  );
2741
2779
  for (const [pattern, entry] of routeManager.getRoutes()) {
2742
- const markdownSourcePath = entry.markdownSourcePath || (_chunkQ4TRGTO7cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
2780
+ const markdownSourcePath = entry.markdownSourcePath || (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
2743
2781
  const searchPreserve = searchPreserveRoutes.get(entry.pattern);
2744
2782
  pageRoutes.push({
2745
2783
  pattern,
@@ -2796,7 +2834,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2796
2834
  const productionVite = productionViteResult.value;
2797
2835
  _chunk7U4XF76Rcjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
2798
2836
  const mobileClient = shouldBuildFarmMobileClient(config);
2799
- const rendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
2837
+ const rendererDisabled = _chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, config.renderer);
2800
2838
  const buildClientBundle = async () => {
2801
2839
  if (rendererDisabled) {
2802
2840
  await fs5.rm(clientOutputDir, { recursive: true, force: true });
@@ -2945,10 +2983,10 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2945
2983
  function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
2946
2984
  const bodies = [];
2947
2985
  for (const route of pageRoutes) {
2948
- if (route.source === void 0 || !_chunkQ4TRGTO7cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
2949
- const { body } = _chunkQ4TRGTO7cjs.parseMarkdownFrontmatter.call(void 0, route.source);
2950
- const rendering = _chunkSDICLSQUcjs.resolveRouteRenderingConfig.call(void 0,
2951
- _chunkQ4TRGTO7cjs.readFarmMarkdownRouteConfig.call(void 0, body),
2986
+ if (route.source === void 0 || !_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
2987
+ const { body } = _chunk26WP75W5cjs.parseMarkdownFrontmatter.call(void 0, route.source);
2988
+ const rendering = _chunkOUDNUFVRcjs.resolveRouteRenderingConfig.call(void 0,
2989
+ _chunk26WP75W5cjs.readFarmMarkdownRouteConfig.call(void 0, body),
2952
2990
  route.source
2953
2991
  );
2954
2992
  if (rendering.ssg && rendering.revalidate === void 0) bodies.push(body);
@@ -2991,7 +3029,7 @@ async function writeFarmVideoPlayerToClient(outputDir) {
2991
3029
  const filePath = _path2.default.join(outputDir, _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH.slice(1));
2992
3030
  await fs5.mkdir(_path2.default.dirname(filePath), { recursive: true });
2993
3031
  try {
2994
- await fs5.writeFile(filePath, _chunkX4TSMQWFcjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
3032
+ await fs5.writeFile(filePath, _chunkCL7BUGVBcjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
2995
3033
  } catch (error) {
2996
3034
  if (error.code !== "EEXIST") throw error;
2997
3035
  }
@@ -3025,7 +3063,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
3025
3063
  }
3026
3064
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
3027
3065
  await fs5.writeFile(fontCssPath, normalizedFontCss);
3028
- await fs5.writeFile(clientCssPath, _chunkX4TSMQWFcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
3066
+ await fs5.writeFile(clientCssPath, _chunkCL7BUGVBcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
3029
3067
  }
3030
3068
  function importsFarmClientBlockedPackage(id, packageName) {
3031
3069
  return id === packageName || id.startsWith(`${packageName}/`);
@@ -3075,10 +3113,10 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
3075
3113
  }
3076
3114
  }
3077
3115
  function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, options = {}) {
3078
- const key = _chunkZVSQN7NCcjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
3116
+ const key = _chunk46UV2E7Icjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
3079
3117
  let plan = cache.get(key);
3080
3118
  if (!plan) {
3081
- plan = _chunkZVSQN7NCcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
3119
+ plan = _chunk46UV2E7Icjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
3082
3120
  cache.set(key, plan);
3083
3121
  }
3084
3122
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -3086,7 +3124,12 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
3086
3124
  async function buildClient(productionVite, config, root, srcDir, outputDir, pageRoutes, layoutRoutes = [], routeSlots = [], isolatedClientBoundaryModules = /* @__PURE__ */ new Set(), hydrationPlanCache = /* @__PURE__ */ new Map(), rendererBuildLifetime, programmaticClientRoutes, mobile = false, sourceSnapshot) {
3087
3125
  if (!mobile) await _chunkE5UN4OWXcjs.removeFarmMobileClientManifest.call(void 0, _path2.default.dirname(outputDir));
3088
3126
  const viteBuild = productionVite.build;
3089
- const { farmIslandContainersPlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
3127
+ const {
3128
+ farmIslandContainersPlugin,
3129
+ farmNavigationPlugin,
3130
+ farmPlugin,
3131
+ farmServerOnlyEntriesPlugin
3132
+ } = await import("./vite.cjs");
3090
3133
  const { PluginManager: PluginManager2 } = await import("./plugin-LN3JBZRR.cjs");
3091
3134
  const fs5 = await import("fs/promises");
3092
3135
  const pluginManager = new PluginManager2({
@@ -3107,14 +3150,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3107
3150
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
3108
3151
  );
3109
3152
  }
3110
- const isolatedMode = _chunkZVSQN7NCcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
3153
+ const isolatedMode = _chunk46UV2E7Icjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
3111
3154
  _optionalChain([config, 'access', _95 => _95.experimental, 'optionalAccess', _96 => _96.isolatedClientHydration]),
3112
3155
  {
3113
3156
  serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _97 => _97.experimental, 'optionalAccess', _98 => _98.serverComponents])) === "rsc",
3114
3157
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
3115
3158
  }
3116
3159
  );
3117
- const planOptions = _chunkZVSQN7NCcjs.getFarmClientHydrationPlanOptions.call(void 0,
3160
+ const planOptions = _chunk46UV2E7Icjs.getFarmClientHydrationPlanOptions.call(void 0,
3118
3161
  config.renderer,
3119
3162
  Boolean(unsupportedIntegrationProvider)
3120
3163
  );
@@ -3126,11 +3169,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3126
3169
  ...planOptions,
3127
3170
  serverTreeLayouts: pagePlanOptions.serverOwners
3128
3171
  };
3129
- const layoutAppliesToRoute = _chunkUWOCYINYcjs.routeBoundaryCoversDirectory;
3172
+ const layoutAppliesToRoute = _chunkOFVCWV2Dcjs.routeBoundaryCoversDirectory;
3130
3173
  const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
3131
3174
  const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _101 => _101.experimental, 'optionalAccess', _102 => _102.serverComponents])) === "islands";
3132
3175
  const adapterOwnsDocsRuntime = Boolean(
3133
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled]) && _optionalChain([config, 'access', _105 => _105.docs, 'access', _106 => _106.adapter, 'optionalAccess', _107 => _107.server]) && config.docs.adapter.react
3176
+ _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled]) && _optionalChain([config, 'access', _105 => _105.docs, 'access', _106 => _106.adapter, 'optionalAccess', _107 => _107.server]) && config.docs.adapter.react
3134
3177
  );
3135
3178
  const docsEntries = _optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) ? _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).map(
3136
3179
  (docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
@@ -3141,7 +3184,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3141
3184
  );
3142
3185
  const syntheticDocsEntry = _optionalChain([config, 'access', _110 => _110.docs, 'optionalAccess', _111 => _111.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
3143
3186
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
3144
- const plan = (operation) => sourceSnapshot ? _chunkZVSQN7NCcjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunkZVSQN7NCcjs.withFarmSourceSnapshot.call(void 0, operation);
3187
+ const plan = (operation) => sourceSnapshot ? _chunk46UV2E7Icjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunk46UV2E7Icjs.withFarmSourceSnapshot.call(void 0, operation);
3145
3188
  const { clientLayouts, clientRouteSlots } = plan(() => {
3146
3189
  const clientLayouts2 = layoutRoutes.map((layout) => {
3147
3190
  try {
@@ -3188,7 +3231,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3188
3231
  };
3189
3232
  }
3190
3233
  });
3191
- const markdownPagePlan = _chunkZVSQN7NCcjs.createMarkdownPageHydrationPlanner.call(void 0,
3234
+ const markdownPagePlan = _chunk46UV2E7Icjs.createMarkdownPageHydrationPlanner.call(void 0,
3192
3235
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
3193
3236
  root,
3194
3237
  isolatedMode,
@@ -3196,7 +3239,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3196
3239
  );
3197
3240
  const routePlans = pageRoutes.map((route) => ({
3198
3241
  route,
3199
- metadata: _chunkQ4TRGTO7cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
3242
+ metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
3200
3243
  route.modulePath,
3201
3244
  root,
3202
3245
  isolatedMode,
@@ -3204,7 +3247,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3204
3247
  pagePlanOptions
3205
3248
  )
3206
3249
  }));
3207
- _chunkZVSQN7NCcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
3250
+ _chunk46UV2E7Icjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
3208
3251
  clientLayouts2.map((layout) => ({
3209
3252
  pattern: layout.pattern,
3210
3253
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -3213,7 +3256,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3213
3256
  [
3214
3257
  ...routePlans.map(({ route, metadata }) => ({
3215
3258
  pattern: routeDirectory(route),
3216
- depth: _chunkUWOCYINYcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
3259
+ depth: _chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
3217
3260
  metadata
3218
3261
  })),
3219
3262
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -3238,7 +3281,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3238
3281
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
3239
3282
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
3240
3283
  _chunk7U4XF76Rcjs.logger.warn(
3241
- `\u26A0\uFE0F ${_chunkZVSQN7NCcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
3284
+ `\u26A0\uFE0F ${_chunk46UV2E7Icjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
3242
3285
  );
3243
3286
  }
3244
3287
  }
@@ -3273,7 +3316,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3273
3316
  );
3274
3317
  if (metadata.suppressedAsyncHydration) {
3275
3318
  _chunk7U4XF76Rcjs.logger.warn(
3276
- `\u26A0\uFE0F ${_chunkZVSQN7NCcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
3319
+ `\u26A0\uFE0F ${_chunk46UV2E7Icjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
3277
3320
  );
3278
3321
  }
3279
3322
  const slotBoundaries = serverSlotPlans.filter(
@@ -3281,7 +3324,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3281
3324
  ).flatMap(({ plan: plan2 }) => plan2.isolatedBoundaries);
3282
3325
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
3283
3326
  const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
3284
- const islandStrategy = _chunkX4TSMQWFcjs.resolveFarmRouteRootStrategy.call(void 0,
3327
+ const islandStrategy = _chunkCL7BUGVBcjs.resolveFarmRouteRootStrategy.call(void 0,
3285
3328
  route,
3286
3329
  metadata,
3287
3330
  clientLayouts2,
@@ -3300,7 +3343,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3300
3343
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
3301
3344
  ],
3302
3345
  // The server renders a server tree only below a hydrating layout.
3303
- ..._chunkZVSQN7NCcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
3346
+ ..._chunk46UV2E7Icjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
3304
3347
  });
3305
3348
  _chunk7U4XF76Rcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
3306
3349
  }
@@ -3337,7 +3380,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3337
3380
  }
3338
3381
  const clientRouteSlots2 = routeSlots.filter((slot) => {
3339
3382
  try {
3340
- const metadata = _chunkZVSQN7NCcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
3383
+ const metadata = _chunk46UV2E7Icjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
3341
3384
  return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
3342
3385
  } catch (error) {
3343
3386
  _chunk7U4XF76Rcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
@@ -3390,11 +3433,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3390
3433
  config.trailingSlash,
3391
3434
  _chunkWGWWRV2Mcjs.getIntegrationProviders.call(void 0, config.integrations),
3392
3435
  config.basePath,
3393
- _chunkX4TSMQWFcjs.generateClientCachePersistenceCode.call(void 0, _chunkX4TSMQWFcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
3436
+ _chunkCL7BUGVBcjs.generateClientCachePersistenceCode.call(void 0, _chunkCL7BUGVBcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
3394
3437
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
3395
3438
  _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _117 => _117.experimental, 'optionalAccess', _118 => _118.serverComponents])) === "islands",
3396
3439
  platform,
3397
- islandsMode ? _chunkZVSQN7NCcjs.collectFarmServerStylesheets.call(void 0,
3440
+ islandsMode ? _chunk46UV2E7Icjs.collectFarmServerStylesheets.call(void 0,
3398
3441
  [
3399
3442
  ...layoutRoutes.map((layout) => layout.modulePath),
3400
3443
  ...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
@@ -3413,7 +3456,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3413
3456
  await fs5.writeFile(_path2.default.join(clientEntryDir, "farm-client-router.tsx"), clientEntry.router);
3414
3457
  }
3415
3458
  const clientInput = { [entryName]: clientEntryPath };
3416
- if (platform === "web" && _chunkX4TSMQWFcjs.canBootFarmIslandsClient.call(void 0, config)) {
3459
+ if (platform === "web" && _chunkCL7BUGVBcjs.canBootFarmIslandsClient.call(void 0, config)) {
3417
3460
  const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
3418
3461
  await fs5.writeFile(
3419
3462
  clientBootPath,
@@ -3424,7 +3467,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3424
3467
  const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
3425
3468
  let postcssSearchPath;
3426
3469
  let tailwindVitePlugin = void 0;
3427
- const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
3470
+ const rendererVitePlugins = await _chunkM6DAIE4Tcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
3428
3471
  ssr: false,
3429
3472
  buildLifetime: rendererBuildLifetime
3430
3473
  });
@@ -3488,7 +3531,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3488
3531
  }
3489
3532
  },
3490
3533
  plugins: [
3491
- _chunkX4TSMQWFcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
3534
+ _chunkCL7BUGVBcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
3492
3535
  createFarmPrivateClientSourcemapsPlugin({
3493
3536
  outDir: _path2.default.join(
3494
3537
  _path2.default.dirname(outputDir),
@@ -3508,8 +3551,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3508
3551
  _path2.default.join(clientEntryDir, `${FARM_CLIENT_ROUTE_TABLE_MODULE}.tsx`)
3509
3552
  ],
3510
3553
  // What the islands entry loads with its first render or hydration (RFC 0010).
3511
- ...islandsMode && _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? {
3554
+ ...islandsMode && _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? {
3512
3555
  rendererImports: [
3556
+ "react",
3513
3557
  "react-dom/client",
3514
3558
  "@farm.js/core/internal/islands-runtime"
3515
3559
  ],
@@ -3532,7 +3576,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3532
3576
  ...rendererVitePlugins,
3533
3577
  ...config.vite.plugins || [],
3534
3578
  farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
3535
- _chunkX4TSMQWFcjs.farmDocsClientConfigPlugin.call(void 0,
3579
+ farmNavigationPlugin(config.renderer),
3580
+ _chunkCL7BUGVBcjs.farmDocsClientConfigPlugin.call(void 0,
3536
3581
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
3537
3582
  ),
3538
3583
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -3565,7 +3610,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3565
3610
  },
3566
3611
  load: {
3567
3612
  filter: {
3568
- id: _chunkX4TSMQWFcjs.exactIdPattern.call(void 0, [
3613
+ id: _chunkCL7BUGVBcjs.exactIdPattern.call(void 0, [
3569
3614
  "\0empty-module",
3570
3615
  "\0empty-api-route",
3571
3616
  "\0farm-i18n-client-bridge",
@@ -3603,7 +3648,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3603
3648
  { ...config, isolatedClientBoundaryModules, programmaticClientRoutes, sourceSnapshot },
3604
3649
  pluginManager
3605
3650
  ),
3606
- _chunkZVSQN7NCcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
3651
+ _chunk46UV2E7Icjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
3607
3652
  ],
3608
3653
  mode: "production",
3609
3654
  css: postcssSearchPath ? {
@@ -3611,7 +3656,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3611
3656
  } : void 0,
3612
3657
  // Ensure React is bundled for client
3613
3658
  resolve: {
3614
- alias: _chunkX4TSMQWFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
3659
+ alias: _chunkCL7BUGVBcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
3615
3660
  dedupe: [...config.renderer.dedupe || []]
3616
3661
  },
3617
3662
  // Optimize dependencies - exclude server-side code from client bundle
@@ -3625,7 +3670,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3625
3670
  }
3626
3671
  };
3627
3672
  await viteBuild(
3628
- _chunkX4TSMQWFcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
3673
+ _chunkCL7BUGVBcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
3629
3674
  );
3630
3675
  if (platform === "mobile") {
3631
3676
  await fs5.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
@@ -3719,9 +3764,9 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
3719
3764
  return response;
3720
3765
  }
3721
3766
 
3722
- ${streamNavigations ? `${_chunkX4TSMQWFcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
3767
+ ${streamNavigations ? `${_chunkCL7BUGVBcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
3723
3768
 
3724
- ${_chunkX4TSMQWFcjs.FARM_EARLY_NAVIGATION_SOURCE}` : ""}
3769
+ ${_chunkCL7BUGVBcjs.FARM_EARLY_NAVIGATION_SOURCE}` : ""}
3725
3770
 
3726
3771
  function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
3727
3772
  if (error?.name === "FarmDeploymentMismatchError") {
@@ -4450,9 +4495,9 @@ ${streamNavigations ? ` // A streamed navigation swaps in the page's shell; its
4450
4495
  const response = await fetchFarmNavigationDocument(url, {
4451
4496
  "Accept": "text/html",
4452
4497
  ...(interceptFrom ? { "X-Farm-Intercept-From": interceptFrom } : {}),
4453
- // Islands mode: the server leaves out island values this browser holds, and the
4454
- // layouts it shows.
4455
- ...getFarmIslandValueHeaders(),
4498
+ // Islands mode: the server leaves out island values this browser holds (the swap keeps
4499
+ // the ones only the page holds, keepFarmIslandValues), and the layouts it shows.
4500
+ ...getFarmIslandValueHeaders(${streamNavigations ? 'document.getElementById("root") || document.body' : ""}),
4456
4501
  ...partialHeaders,
4457
4502
  ...(streamShell ? { "F-Stream": "flush" } : {}),
4458
4503
  }, recover, signal);
@@ -4872,7 +4917,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
4872
4917
  secure: false
4873
4918
  },
4874
4919
  direction: {}
4875
- }, plugins = [], renderer = _chunk67MZTLTFcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
4920
+ }, plugins = [], renderer = _chunkM6DAIE4Tcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
4876
4921
  const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
4877
4922
  const clientPluginEntry = _chunkZ5BANEQDcjs.generateFarmClientPluginEntryCode.call(void 0,
4878
4923
  plugins,
@@ -4881,10 +4926,9 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
4881
4926
  publicRuntimeConfig,
4882
4927
  platform
4883
4928
  );
4884
- const appSetupPath = _chunk67MZTLTFcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
4885
- const lazyRenderer = islandValues && platform !== "mobile" && _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && clientRouteSlots.length === 0;
4886
- const rendererClientImports = lazyRenderer ? `import React from "react";
4887
- import { holdFarmIslandInteractions, restorePagePosition } from "@farm.js/core/internal/client-runtime";` : _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
4929
+ const appSetupPath = _chunkM6DAIE4Tcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
4930
+ const lazyRenderer = islandValues && platform !== "mobile" && _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) && clientRouteSlots.length === 0;
4931
+ const rendererClientImports = lazyRenderer ? `import { holdFarmIslandInteractions, restorePagePosition, watchFarmIslandTriggers } from "@farm.js/core/internal/client-runtime";` : _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
4888
4932
  import { createRoot, hydrateRoot } from "react-dom/client";
4889
4933
  import { restorePagePosition } from "@farm.js/core/internal/client-runtime";` : (
4890
4934
  // Named exports only, as the server entry and the development client read them. A copy
@@ -4897,7 +4941,7 @@ __farmConfigureApp(__farmAppSetup);` : `import * as __farmRendererClient from ${
4897
4941
  import { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};
4898
4942
  const React = { ...__farmRendererClient };`
4899
4943
  );
4900
- const providerClientCode = _chunkX4TSMQWFcjs.generateFarmIntegrationProviderClientCode.call(void 0,
4944
+ const providerClientCode = _chunkCL7BUGVBcjs.generateFarmIntegrationProviderClientCode.call(void 0,
4901
4945
  integrationProviders,
4902
4946
  root,
4903
4947
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -4920,18 +4964,18 @@ const React = { ...__farmRendererClient };`
4920
4964
  const layoutImportStatements = [];
4921
4965
  const layoutRegistrations = [];
4922
4966
  const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
4923
- const treeLayoutPatterns = islandValues ? _chunkUWOCYINYcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
4967
+ const treeLayoutPatterns = islandValues ? _chunkOFVCWV2Dcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
4924
4968
  layoutRoutes.forEach((layout, index) => {
4925
4969
  const relativePath = toImportPath(layout.modulePath);
4926
4970
  const treeLayout = treeLayoutPatterns.has(layout.pattern);
4927
4971
  const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
4928
- (pattern) => _chunkUWOCYINYcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
4972
+ (pattern) => _chunkOFVCWV2Dcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
4929
4973
  );
4930
4974
  if (rendersOnClient && !treeLayout) {
4931
4975
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
4932
4976
  }
4933
- const groupScope = _chunkUWOCYINYcjs.getRouteGroupScope.call(void 0, layout.pattern);
4934
- const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkUWOCYINYcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
4977
+ const groupScope = _chunkOFVCWV2Dcjs.getRouteGroupScope.call(void 0, layout.pattern);
4978
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkOFVCWV2Dcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
4935
4979
  layoutRegistrations.push(
4936
4980
  ` { 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" : ""} }`
4937
4981
  );
@@ -5018,7 +5062,7 @@ mountFarmDocsSearch();
5018
5062
 
5019
5063
  ${generateUniversalRouterStateRuntime()}
5020
5064
 
5021
- ${_chunkX4TSMQWFcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
5065
+ ${_chunkCL7BUGVBcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
5022
5066
 
5023
5067
  // SPA Router for server-rendered pages (HTML swap)
5024
5068
  const spaRouter = {
@@ -5327,7 +5371,8 @@ installFarmLinkPrefetch();
5327
5371
  ...serverTreeEnabled ? ["createFarmServerTreeElement"] : [],
5328
5372
  ...hasServerTreeLayouts ? ["createFarmServerTreeLayout"] : []
5329
5373
  ].join(", ");
5330
- const lazyRendererRuntime = lazyRenderer ? `// React DOM${isolatedHydrationEnabled ? " and islx" : ""} load with the first render or hydration (RFC 0010).
5374
+ const lazyRendererRuntime = lazyRenderer ? `// React, React DOM${isolatedHydrationEnabled ? " and islx" : ""} load with the first render or hydration (RFC 0010).
5375
+ let React;
5331
5376
  let createRoot;
5332
5377
  let hydrateRoot;
5333
5378
  let farmRendererLoading = null;
@@ -5337,14 +5382,16 @@ let farmRendererLoaded = false;${isolatedHydrationEnabled ? `
5337
5382
  const releaseFarmIslandInteractions = holdFarmIslandInteractions("f-island");` : ""}
5338
5383
  function loadFarmRenderer() {
5339
5384
  return farmRendererLoading || (farmRendererLoading = Promise.all([
5385
+ import("react"),
5340
5386
  import("react-dom/client"),${isolatedHydrationEnabled ? `
5341
5387
  // Named here, so the build keeps only these of islx's exports.
5342
5388
  import("@farm.js/core/internal/islands-runtime").then(function({ ${islandsRuntimeExports} }) {
5343
5389
  return { ${islandsRuntimeExports} };
5344
5390
  }),` : ""}
5345
5391
  ]).then(function(modules) {
5346
- createRoot = modules[0].createRoot;
5347
- hydrateRoot = modules[0].hydrateRoot;${isolatedHydrationEnabled ? "\n startFarmIslandsRuntime(modules[1]);\n releaseFarmIslandInteractions();" : ""}
5392
+ React = modules[0].default;
5393
+ createRoot = modules[1].createRoot;
5394
+ hydrateRoot = modules[1].hydrateRoot;${isolatedHydrationEnabled ? "\n startFarmIslandsRuntime(modules[2]);\n releaseFarmIslandInteractions();\n runFarmIslandsWaiting();" : ""}
5348
5395
  farmRendererLoaded = true;
5349
5396
  }, function(error) {${isolatedHydrationEnabled ? `
5350
5397
  // Without islx a held click would never replay: the page acts natively again.
@@ -5381,26 +5428,55 @@ function startFarmIslandsRuntime(islands) {
5381
5428
  // A hydrating layout keeps a non-hydrating page as server HTML; this wrapper runs its islands.
5382
5429
  FarmServerPage = islands.createFarmServerPageBoundary(React, farmIslandsRuntime);
5383
5430
  }
5384
- // Nothing hydrates before islx loads. Until then, calls wait for it in the order they were made,
5385
- // behind the hydration that loads it; one that fails reports itself to whoever awaited it.
5386
- function whenFarmIslandsRuntime(call) {
5431
+ // islx loads with the first island that is due, as the boot decides on a first load: at once for
5432
+ // one that hydrates at load, else on its trigger. A page or navigation of islands that wait loads
5433
+ // none of it. Until it loads, calls wait here in the order they were made and run with it.
5434
+ const farmIslandsWaiting = [];
5435
+ function runFarmIslandsWaiting() {
5436
+ for (const entry of farmIslandsWaiting.splice(0)) {
5437
+ if (entry.stop) entry.stop();
5438
+ entry.run(farmIslandsRuntime);
5439
+ }
5440
+ }
5441
+ // Behind a load under way, calls wait for it; one that fails reports itself to whoever awaited it.
5442
+ function whenFarmIslandsRuntime(scope, call) {
5387
5443
  if (farmIslandsRuntime) call(farmIslandsRuntime);
5388
5444
  else if (farmRendererLoading) farmRendererLoading.then(function() { call(farmIslandsRuntime); }, function() {});
5445
+ else farmIslandsWaiting.push({ scope: scope, run: call });
5389
5446
  }
5390
5447
  const farmIsolatedHydrationRuntime = {
5391
5448
  hydrate: function(scope, signal) {
5392
5449
  if (farmIslandsRuntime) return farmIslandsRuntime.hydrate(scope, signal);
5393
- return loadFarmRenderer().then(function() { return farmIslandsRuntime.hydrate(scope, signal); });
5450
+ const stop = farmRendererLoading
5451
+ ? null
5452
+ : watchFarmIslandTriggers(scope, "f-island", function() { void loadFarmRenderer(); });
5453
+ if (!stop) return loadFarmRenderer().then(function() { return farmIslandsRuntime.hydrate(scope, signal); });
5454
+ farmIslandsWaiting.push({
5455
+ scope: scope,
5456
+ stop: stop,
5457
+ run: function(runtime) {
5458
+ if (!signal || !signal.aborted) void runtime.hydrate(scope, signal);
5459
+ },
5460
+ });
5461
+ return Promise.resolve();
5394
5462
  },
5395
5463
  dispose: function(scope) {
5396
- whenFarmIslandsRuntime(function(runtime) { runtime.dispose(scope); });
5464
+ if (farmIslandsRuntime) return farmIslandsRuntime.dispose(scope);
5465
+ // Nothing has hydrated yet: what removed DOM waits for goes with it.
5466
+ for (let index = farmIslandsWaiting.length - 1; index >= 0; index--) {
5467
+ const entry = farmIslandsWaiting[index];
5468
+ if (!scope.contains(entry.scope)) continue;
5469
+ farmIslandsWaiting.splice(index, 1);
5470
+ if (entry.stop) entry.stop();
5471
+ }
5472
+ if (farmRendererLoading) farmRendererLoading.then(function() { farmIslandsRuntime.dispose(scope); }, function() {});
5397
5473
  },
5398
5474
  // Only a hydrated island has state to carry over.
5399
5475
  carryOver: function(from, to) {
5400
5476
  if (farmIslandsRuntime) farmIslandsRuntime.carryOver(from, to);
5401
5477
  },
5402
5478
  endStream: function(root) {
5403
- whenFarmIslandsRuntime(function(runtime) { runtime.endStream(root); });
5479
+ whenFarmIslandsRuntime(root, function(runtime) { runtime.endStream(root); });
5404
5480
  },
5405
5481
  };` : `const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
5406
5482
  ReactRuntime: React,
@@ -5458,7 +5534,7 @@ ${layoutImports}
5458
5534
  ${rendererClientImports}
5459
5535
  ${isolatedHydrationImport}
5460
5536
  ${providerClientCode.imports}
5461
- import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
5537
+ import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, keepFarmIslandValues, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
5462
5538
  import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
5463
5539
  import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
5464
5540
  ${clientPluginEntry.imports}
@@ -5537,7 +5613,7 @@ function hasHydratableLayout(pathname) {
5537
5613
  });
5538
5614
  }
5539
5615
 
5540
- ${_chunkX4TSMQWFcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
5616
+ ${_chunkCL7BUGVBcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
5541
5617
  // Wrap a page element with applicable layouts
5542
5618
  function wrapWithLayouts(pageElement, pathname, params) {
5543
5619
  const layouts = getApplicableLayouts(pathname);
@@ -5572,7 +5648,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
5572
5648
  return React.createElement("div", props, pageElement);
5573
5649
  }
5574
5650
  let farmLastRouteState = null;
5575
- ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkX4TSMQWFcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
5651
+ ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkCL7BUGVBcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
5576
5652
  function farmTreeLayoutsOf(pathname) {
5577
5653
  return getApplicableLayouts(pathname).filter(function(layout) {
5578
5654
  return layout.serverTree === true;
@@ -5693,7 +5769,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, navi
5693
5769
 
5694
5770
  if (!pageElement) return null;
5695
5771
  if (!hydrateLayouts) {
5696
- ${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? "if (hydrationContainer) pageElement = restorePagePosition(React, hydrationContainer, pageElement);" : ""}
5772
+ ${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) ? "if (hydrationContainer) pageElement = restorePagePosition(React, hydrationContainer, pageElement);" : ""}
5697
5773
  return createFarmRouteState(pageElement, pathname, params, false);
5698
5774
  }
5699
5775
  if (matched.route.pageShouldHydrate) {
@@ -5722,7 +5798,7 @@ function createFarmRouteState(page, pathname, params, includeLayouts) {
5722
5798
 
5723
5799
  function hydrateFarmRoute(container, route) {
5724
5800
  farmLastRouteState = route;
5725
- ${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);"}
5801
+ ${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);"}
5726
5802
  }
5727
5803
 
5728
5804
  function renderFarmRoute(root, route) {
@@ -6161,7 +6237,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
6161
6237
  return true;
6162
6238
  }` : ""}
6163
6239
 
6164
- ${_chunkX4TSMQWFcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
6240
+ ${_chunkCL7BUGVBcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
6165
6241
 
6166
6242
  function activateNavigationScripts(root) {
6167
6243
  for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
@@ -6264,7 +6340,7 @@ function getLayoutShell(root, patterns, index) {
6264
6340
  return shell.innerHTML;
6265
6341
  }
6266
6342
 
6267
- ${islandValues ? _chunkX4TSMQWFcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
6343
+ ${islandValues ? _chunkCL7BUGVBcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
6268
6344
  // A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
6269
6345
  if (refresh) revealFarmStreamedContent(nextRoot);
6270
6346
  const currentPatterns = getLayoutPatterns(currentRoot);
@@ -6695,6 +6771,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
6695
6771
 
6696
6772
  ${islandValues ? `// A payload-only page renders only in a React root that rebuilds it.
6697
6773
  if (nextPage?.querySelector('script[type="f/tree"][partial]')) return "segment-mismatch";` : ""}
6774
+ ${islandValues ? "const keepValues = keepFarmIslandValues(currentRoot);" : ""}
6698
6775
  const rootWasReactOwned = reactRootContainer === currentRoot;
6699
6776
  resetReactRoot();
6700
6777
  resetRouteSlotRoots();
@@ -6711,6 +6788,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
6711
6788
  activateNavigationScripts(currentRoot);
6712
6789
  isolatedHydrationScope = currentRoot;
6713
6790
  }
6791
+ ${islandValues ? "keepValues();" : ""}
6714
6792
  window.__FARM_ROUTE_SLOTS__ = nextRouteSlots;
6715
6793
  hydrateInitialRouteSlots();
6716
6794
 
@@ -6912,7 +6990,12 @@ void hydrate();
6912
6990
  }
6913
6991
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime, sourceSnapshot) {
6914
6992
  const viteBuild = productionVite.build;
6915
- const { farmIslandContainersPlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
6993
+ const {
6994
+ farmIslandContainersPlugin,
6995
+ farmNavigationPlugin,
6996
+ farmPlugin,
6997
+ farmServerOnlyEntriesPlugin
6998
+ } = await import("./vite.cjs");
6916
6999
  const { PluginManager: PluginManager2 } = await import("./plugin-LN3JBZRR.cjs");
6917
7000
  const fs5 = await import("fs/promises");
6918
7001
  const pluginManager = new PluginManager2({
@@ -6924,7 +7007,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6924
7007
  const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
6925
7008
  let postcssConfigDir;
6926
7009
  let tailwindVitePlugin = void 0;
6927
- const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
7010
+ const rendererVitePlugins = await _chunkM6DAIE4Tcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
6928
7011
  ssr: true,
6929
7012
  buildLifetime: rendererBuildLifetime
6930
7013
  });
@@ -7013,7 +7096,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7013
7096
  modulePath: entry.modulePath
7014
7097
  })) : [];
7015
7098
  const i18nCatalogs = config.i18n.enabled ? (await _chunkCYOTNHDFcjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
7016
- const appDirs = _chunkQMR2TUVZcjs.getFarmAppDirectories.call(void 0, config);
7099
+ const appDirs = _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config);
7017
7100
  let openAPIReference = null;
7018
7101
  if (config.openapi.enabled && config.openapi.route) {
7019
7102
  const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-PX4QN4HK.cjs");
@@ -7040,8 +7123,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7040
7123
  config: await readMiddlewareFileConfig(route.filePath)
7041
7124
  }))
7042
7125
  );
7043
- const instrumentationPath = _chunk3GNHJ3RNcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
7044
- const notFoundPath = _chunkX4TSMQWFcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
7126
+ const instrumentationPath = _chunk3BTN3NP7cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
7127
+ const notFoundPath = _chunkCL7BUGVBcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
7045
7128
  if (notFoundPath) _chunk7U4XF76Rcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
7046
7129
  layoutRoutes.sort((a, b) => {
7047
7130
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -7063,8 +7146,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7063
7146
  );
7064
7147
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
7065
7148
  const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _136 => _136.mdx, 'optionalAccess', _137 => _137.components]));
7066
- const hasMiddlewareConfig = _chunkUWOCYINYcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
7067
- const hasRouteContextConfig = _chunkLVGB5PYKcjs.hasCustomFarmRouteContext.call(void 0, config);
7149
+ const hasMiddlewareConfig = _chunkOFVCWV2Dcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
7150
+ const hasRouteContextConfig = _chunkMOGRRZMWcjs.hasCustomFarmRouteContext.call(void 0, config);
7068
7151
  const hasServerRuntimePlugins = _chunkZ5BANEQDcjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
7069
7152
  const hasPluginRoutes = hasFarmPluginRoutes(config);
7070
7153
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
@@ -7074,9 +7157,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7074
7157
  const hasConfiguredRuntimePlugins = Boolean(
7075
7158
  hasRuntimeConfigModule && (config.plugins || []).length > 0
7076
7159
  );
7077
- if (_chunkZPEZXQTMcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
7160
+ if (_chunkE3HBD2K3cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
7078
7161
  const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
7079
- _chunkZPEZXQTMcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
7162
+ _chunkE3HBD2K3cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
7080
7163
  config.docs,
7081
7164
  { root, srcDir: config.srcDir },
7082
7165
  (pathname) => adapterGuardedPaths.has(pathname),
@@ -7086,7 +7169,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7086
7169
  const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
7087
7170
  const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _138 => _138.docs, 'optionalAccess', _139 => _139.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunk2RSVYJT6cjs._runWithFarmCspNonce.call(void 0,
7088
7171
  farmDocsCspNonceMarker,
7089
- async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await _chunkZPEZXQTMcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
7172
+ async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await _chunkE3HBD2K3cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
7090
7173
  root,
7091
7174
  srcDir: config.srcDir,
7092
7175
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -7146,7 +7229,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7146
7229
  (image) => image.sourceType === "module"
7147
7230
  );
7148
7231
  const externalMetadataImageRuntime = useExternalMetadataImageRuntime && !omitCoreMetadataImageRuntime ? ["@vercel/og"] : [];
7149
- const rendererOptionalExternals = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
7232
+ const rendererOptionalExternals = _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
7150
7233
  "react",
7151
7234
  "react/jsx-runtime",
7152
7235
  "react/jsx-dev-runtime",
@@ -7253,7 +7336,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7253
7336
  __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _148 => _148.env, 'optionalAccess', _149 => _149.public]) || {})
7254
7337
  },
7255
7338
  plugins: [
7256
- _chunkX4TSMQWFcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
7339
+ _chunkCL7BUGVBcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
7257
7340
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
7258
7341
  ...rendererVitePlugins,
7259
7342
  ...config.vite.plugins || [],
@@ -7275,6 +7358,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7275
7358
  ] : [],
7276
7359
  { ..._chunkNG2EZ6QScjs.createReactProductionModePlugin.call(void 0, ), enforce: "pre" },
7277
7360
  farmServerOnlyEntriesPlugin({ distDir: config.distDir || ".farm" }),
7361
+ farmNavigationPlugin(config.renderer),
7278
7362
  farmIslandContainersPlugin(config),
7279
7363
  farmPlugin(
7280
7364
  {
@@ -7284,7 +7368,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7284
7368
  },
7285
7369
  pluginManager
7286
7370
  ),
7287
- _chunkZVSQN7NCcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
7371
+ _chunk46UV2E7Icjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
7288
7372
  ...hasRuntimeConfigModule ? [
7289
7373
  farmStripPlatformConfigPlugin(
7290
7374
  [
@@ -7296,7 +7380,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7296
7380
  {
7297
7381
  name: "farm-virtual-ssr-entry",
7298
7382
  resolveId: {
7299
- filter: { id: _chunkX4TSMQWFcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
7383
+ filter: { id: _chunkCL7BUGVBcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
7300
7384
  handler(id) {
7301
7385
  if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
7302
7386
  return virtualEntryId;
@@ -7305,7 +7389,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7305
7389
  }
7306
7390
  },
7307
7391
  load: {
7308
- filter: { id: _chunkX4TSMQWFcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
7392
+ filter: { id: _chunkCL7BUGVBcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
7309
7393
  handler(id) {
7310
7394
  if (id === virtualEntryId) {
7311
7395
  return virtualEntryCode;
@@ -7337,7 +7421,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7337
7421
  resolve: {
7338
7422
  alias: [
7339
7423
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
7340
- ...Object.entries(_chunkX4TSMQWFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
7424
+ ...Object.entries(_chunkCL7BUGVBcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
7341
7425
  ([find, replacement]) => ({ find, replacement })
7342
7426
  )
7343
7427
  ],
@@ -7345,7 +7429,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7345
7429
  dedupe: [...config.renderer.dedupe || []]
7346
7430
  }
7347
7431
  };
7348
- await viteBuild(_chunkX4TSMQWFcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
7432
+ await viteBuild(_chunkCL7BUGVBcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
7349
7433
  } finally {
7350
7434
  if (postcssConfigDir) {
7351
7435
  try {
@@ -7389,7 +7473,7 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
7389
7473
  };
7390
7474
  return _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
7391
7475
  (docsRoot) => _chunkHR5GU4UUcjs.discoverFarmDocsPages.call(void 0, _chunkHR5GU4UUcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
7392
- ).flatMap((page) => [page.href, _chunkHR5GU4UUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkUWOCYINYcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
7476
+ ).flatMap((page) => [page.href, _chunkHR5GU4UUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkOFVCWV2Dcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
7393
7477
  }
7394
7478
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
7395
7479
  const llmsTxt = _optionalChain([agent, 'optionalAccess', _152 => _152.llmsTxt]);
@@ -7779,7 +7863,7 @@ async function applyFarmPreloadBudget(response, pathname, request) {
7779
7863
  `.trim();
7780
7864
  }
7781
7865
  function generateFarmRendererAppSetupServerCode(config) {
7782
- const appSetupPath = _chunk67MZTLTFcjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
7866
+ const appSetupPath = _chunkM6DAIE4Tcjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
7783
7867
  if (!appSetupPath) return "";
7784
7868
  return `
7785
7869
  import __farmAppSetup from ${JSON.stringify(_chunk7U4XF76Rcjs.toPosixPath.call(void 0, appSetupPath))};
@@ -7789,13 +7873,14 @@ if (typeof ReactDOMServer.configureApp !== "function") {
7789
7873
  ReactDOMServer.configureApp(__farmAppSetup);`;
7790
7874
  }
7791
7875
  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 = []) {
7792
- const farmRendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
7876
+ const farmRendererDisabled = _chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, config.renderer);
7793
7877
  const searchPreserveRoutes = pageRoutes.flatMap(
7794
7878
  (route) => route.searchPreserve ? [route.searchPreserve] : []
7795
7879
  );
7796
7880
  const searchPreserveRoutesSource = searchPreserveRoutes.length > 0 ? JSON.stringify(searchPreserveRoutes) : "";
7797
7881
  const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _166 => _166.experimental, 'optionalAccess', _167 => _167.serverComponents])) === "islands";
7798
- const farmClientBoot = _chunkX4TSMQWFcjs.canBootFarmIslandsClient.call(void 0, config);
7882
+ const farmRendererActions = _chunkCL7BUGVBcjs.resolveFarmIslxActionsMode.call(void 0, config) === "renderer";
7883
+ const farmClientBoot = _chunkCL7BUGVBcjs.canBootFarmIslandsClient.call(void 0, config);
7799
7884
  const farmMobileClient = shouldBuildFarmMobileClient(config);
7800
7885
  const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
7801
7886
  const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
@@ -7811,7 +7896,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
7811
7896
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
7812
7897
  const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
7813
7898
  const adapterOwnsDocsRuntime = Boolean(
7814
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _178 => _178.docs, 'optionalAccess', _179 => _179.enabled]) && _optionalChain([config, 'access', _180 => _180.docs, 'access', _181 => _181.adapter, 'optionalAccess', _182 => _182.server]) && config.docs.adapter.react
7899
+ _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _178 => _178.docs, 'optionalAccess', _179 => _179.enabled]) && _optionalChain([config, 'access', _180 => _180.docs, 'access', _181 => _181.adapter, 'optionalAccess', _182 => _182.server]) && config.docs.adapter.react
7815
7900
  );
7816
7901
  if (_optionalChain([config, 'access', _183 => _183.docs, 'optionalAccess', _184 => _184.enabled]) && _optionalChain([config, 'access', _185 => _185.docs, 'access', _186 => _186.roots, 'optionalAccess', _187 => _187.length]) && !adapterOwnsDocsRuntime) {
7817
7902
  throw new Error(
@@ -7820,13 +7905,13 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
7820
7905
  }
7821
7906
  const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
7822
7907
  const adapterHandler = generateFarmDocsAdapterHandlerArguments(config.docs, docsConfigModulePath);
7823
- const hasIsolatedClientGraphRuntime = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
7824
- const rendererStreamingCapabilities = _chunk67MZTLTFcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
7908
+ const hasIsolatedClientGraphRuntime = _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
7909
+ const rendererStreamingCapabilities = _chunkM6DAIE4Tcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
7825
7910
  config.renderer,
7826
7911
  _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset)
7827
7912
  );
7828
- const hasReactSyncRender = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer);
7829
- const rendererServerImports = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
7913
+ const hasReactSyncRender = _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer);
7914
+ const rendererServerImports = _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
7830
7915
  import * as ReactDOMServer from "react-dom/server";
7831
7916
  import { markPagePosition, markLayoutPosition } from "@farm.js/core/internal/production-runtime";${hasIsolatedClientGraphRuntime ? farmIslandsMode ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph, renderFarmServerTreePage, renderFarmServerTreeLayout, withFarmIslandsRender } from "@farm.js/core/internal/islands-runtime";' : '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : (
7832
7917
  // The renderer contract is the server module's named exports, which the development
@@ -7872,18 +7957,18 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7872
7957
  (image) => image.sourceType === "module"
7873
7958
  );
7874
7959
  const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
7875
- const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkUWOCYINYcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
7960
+ const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkOFVCWV2Dcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
7876
7961
  const farmDocsFontAssets = _optionalChain([config, 'access', _188 => _188.docs, 'optionalAccess', _189 => _189.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
7877
7962
  const integrationProviders = _chunkWGWWRV2Mcjs.getIntegrationProviders.call(void 0, config.integrations);
7878
7963
  const renderedIntegrationProviders = integrationProviders.filter(
7879
7964
  (provider) => provider.component || provider.type === "clerk"
7880
7965
  );
7881
- if (renderedIntegrationProviders.length > 0 && !_chunk67MZTLTFcjs.getFarmRendererCapabilities.call(void 0, config.renderer).functionComponents) {
7966
+ if (renderedIntegrationProviders.length > 0 && !_chunkM6DAIE4Tcjs.getFarmRendererCapabilities.call(void 0, config.renderer).functionComponents) {
7882
7967
  throw new Error(
7883
7968
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
7884
7969
  );
7885
7970
  }
7886
- const providerServerModules = _chunkX4TSMQWFcjs.generateFarmIntegrationProviderServerModules.call(void 0,
7971
+ const providerServerModules = _chunkCL7BUGVBcjs.generateFarmIntegrationProviderServerModules.call(void 0,
7887
7972
  renderedIntegrationProviders,
7888
7973
  config.root,
7889
7974
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
@@ -7903,14 +7988,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7903
7988
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
7904
7989
  (provider) => provider.supportsIsolatedHydration !== true
7905
7990
  );
7906
- const isolatedHydrationMode = _chunkZVSQN7NCcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
7991
+ const isolatedHydrationMode = _chunk46UV2E7Icjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
7907
7992
  _optionalChain([config, 'access', _192 => _192.experimental, 'optionalAccess', _193 => _193.isolatedClientHydration]),
7908
7993
  {
7909
7994
  serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _194 => _194.experimental, 'optionalAccess', _195 => _195.serverComponents])) === "rsc",
7910
7995
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
7911
7996
  }
7912
7997
  );
7913
- const hydrationPlanOptions = _chunkZVSQN7NCcjs.getFarmClientHydrationPlanOptions.call(void 0,
7998
+ const hydrationPlanOptions = _chunk46UV2E7Icjs.getFarmClientHydrationPlanOptions.call(void 0,
7914
7999
  config.renderer,
7915
8000
  Boolean(unsupportedIntegrationProvider)
7916
8001
  );
@@ -7918,7 +8003,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7918
8003
  ...hydrationPlanOptions,
7919
8004
  serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _196 => _196.experimental, 'optionalAccess', _197 => _197.serverComponents])) === "islands"
7920
8005
  };
7921
- const { layoutHydrationPlans, pageHydrationPlans } = _chunkZVSQN7NCcjs.withFarmSourceSnapshot.call(void 0, () => {
8006
+ const { layoutHydrationPlans, pageHydrationPlans } = _chunk46UV2E7Icjs.withFarmSourceSnapshot.call(void 0, () => {
7922
8007
  const layoutHydrationPlans2 = layoutRoutes.map((layout) => ({
7923
8008
  ...layout,
7924
8009
  hydration: getCachedClientModuleHydrationPlan(
@@ -7929,7 +8014,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7929
8014
  { ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
7930
8015
  )
7931
8016
  }));
7932
- const markdownPagePlan = _chunkZVSQN7NCcjs.createMarkdownPageHydrationPlanner.call(void 0,
8017
+ const markdownPagePlan = _chunk46UV2E7Icjs.createMarkdownPageHydrationPlanner.call(void 0,
7933
8018
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
7934
8019
  config.root,
7935
8020
  isolatedHydrationMode,
@@ -7938,7 +8023,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7938
8023
  const pageHydrationPlans2 = new Map(
7939
8024
  pageRoutes.map((route) => [
7940
8025
  route.modulePath,
7941
- _chunkQ4TRGTO7cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
8026
+ _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
7942
8027
  route.modulePath,
7943
8028
  config.root,
7944
8029
  isolatedHydrationMode,
@@ -7949,7 +8034,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7949
8034
  );
7950
8035
  return { layoutHydrationPlans: layoutHydrationPlans2, pageHydrationPlans: pageHydrationPlans2 };
7951
8036
  });
7952
- _chunkZVSQN7NCcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
8037
+ _chunk46UV2E7Icjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
7953
8038
  layoutHydrationPlans.map((layout) => ({
7954
8039
  pattern: layout.pattern,
7955
8040
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -7958,10 +8043,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7958
8043
  pageRoutes.map((route) => ({
7959
8044
  // Compared by directory so a grouped layout applies only inside its group.
7960
8045
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
7961
- depth: _chunkUWOCYINYcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
8046
+ depth: _chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
7962
8047
  metadata: pageHydrationPlans.get(route.modulePath)
7963
8048
  })),
7964
- _chunkUWOCYINYcjs.routeBoundaryCoversDirectory,
8049
+ _chunkOFVCWV2Dcjs.routeBoundaryCoversDirectory,
7965
8050
  { serverOwners: pageHydrationPlanOptions.serverOwners }
7966
8051
  );
7967
8052
  const providerServerImports = [
@@ -7992,9 +8077,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7992
8077
  }).map(({ route }) => route);
7993
8078
  orderedPageRoutes.forEach((route, index) => {
7994
8079
  const varName = `pageRoute${index}`;
7995
- if (_chunkQ4TRGTO7cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
7996
- const renderingDirective2 = _chunkSDICLSQUcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7997
- const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkZVSQN7NCcjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
8080
+ if (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
8081
+ const renderingDirective2 = _chunkOUDNUFVRcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
8082
+ const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunk46UV2E7Icjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
7998
8083
  pageRegistrations.push(`
7999
8084
  {
8000
8085
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -8002,14 +8087,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8002
8087
  rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
8003
8088
  module: createFarmMarkdownRouteModule({
8004
8089
  source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
8005
- filePath: ${JSON.stringify(_chunkX4TSMQWFcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
8090
+ filePath: ${JSON.stringify(_chunkCL7BUGVBcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
8006
8091
  components: farmMdxComponents,
8007
- config: farmMdxConfig,
8092
+ config: farmMdxConfig,${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: React,"}
8008
8093
  }),
8009
8094
  markdownSource: {
8010
8095
  source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
8011
8096
  filePath: ${JSON.stringify(
8012
- _chunkX4TSMQWFcjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
8097
+ _chunkCL7BUGVBcjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
8013
8098
  )},
8014
8099
  },
8015
8100
  }`);
@@ -8019,7 +8104,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8019
8104
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
8020
8105
  );
8021
8106
  const clientMetadata = pageHydrationPlans.get(route.modulePath);
8022
- const renderingDirective = _chunkSDICLSQUcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
8107
+ const renderingDirective = _chunkOUDNUFVRcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
8023
8108
  pageRegistrations.push(`
8024
8109
  {
8025
8110
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -8027,8 +8112,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8027
8112
  module: ${varName},
8028
8113
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
8029
8114
  clientModule: ${JSON.stringify(_chunk7U4XF76Rcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
8030
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkZVSQN7NCcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
8031
- const rootStrategy = _chunkX4TSMQWFcjs.resolveFarmRouteRootStrategy.call(void 0,
8115
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunk46UV2E7Icjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
8116
+ const rootStrategy = _chunkCL7BUGVBcjs.resolveFarmRouteRootStrategy.call(void 0,
8032
8117
  route,
8033
8118
  clientMetadata,
8034
8119
  layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
@@ -8041,13 +8126,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8041
8126
  rendering: ${JSON.stringify(renderingDirective)},` : ""}
8042
8127
  ${route.source !== void 0 ? `markdownSource: {
8043
8128
  source: ${JSON.stringify(route.source)},
8044
- filePath: ${JSON.stringify(_chunkX4TSMQWFcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
8129
+ filePath: ${JSON.stringify(_chunkCL7BUGVBcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
8045
8130
  },` : ""}
8046
8131
  }`);
8047
8132
  });
8048
8133
  const layoutImports = [];
8049
8134
  const layoutRegistrations = [];
8050
- const treeLayoutPatterns = farmIslandsMode ? _chunkUWOCYINYcjs.getFarmServerTreeLayoutPatterns.call(void 0,
8135
+ const treeLayoutPatterns = farmIslandsMode ? _chunkOFVCWV2Dcjs.getFarmServerTreeLayoutPatterns.call(void 0,
8051
8136
  layoutHydrationPlans.map((layout) => ({
8052
8137
  pattern: layout.pattern,
8053
8138
  shouldHydrate: layout.hydration.shouldHydrate,
@@ -8065,7 +8150,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8065
8150
  pattern: ${JSON.stringify(layout.pattern)},
8066
8151
  module: ${varName},
8067
8152
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
8068
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunkX4TSMQWFcjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
8153
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunkCL7BUGVBcjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
8069
8154
  // isolatedClientHydration, or an async layout): it wraps a docs page as an app page.
8070
8155
  clientMetadata.hasIsolatedClientBoundaries ? "\n islands: true," : ""}
8071
8156
  }`);
@@ -8093,7 +8178,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8093
8178
  containerId: ${JSON.stringify(slot.containerId)},
8094
8179
  interception: ${JSON.stringify(slot.interception)},
8095
8180
  fallback: ${JSON.stringify(slot.fallback)},
8096
- hydrates: ${!farmIslandsMode || _chunkZVSQN7NCcjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
8181
+ hydrates: ${!farmIslandsMode || _chunk46UV2E7Icjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
8097
8182
  module: ${varName},
8098
8183
  }`);
8099
8184
  });
@@ -8104,12 +8189,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8104
8189
  errorImports.push(
8105
8190
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
8106
8191
  );
8107
- const groupScope = _chunkUWOCYINYcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
8192
+ const groupScope = _chunkOFVCWV2Dcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
8108
8193
  errorRegistrations.push(`
8109
8194
  {
8110
- pattern: ${JSON.stringify(_chunkUWOCYINYcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
8195
+ pattern: ${JSON.stringify(_chunkOFVCWV2Dcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
8111
8196
  groupScope: ${JSON.stringify(groupScope)},
8112
- directoryDepth: ${_chunkUWOCYINYcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
8197
+ directoryDepth: ${_chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
8113
8198
  module: ${varName},
8114
8199
  }`);
8115
8200
  });
@@ -8121,12 +8206,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8121
8206
  loadingImports.push(
8122
8207
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
8123
8208
  );
8124
- const groupScope = _chunkUWOCYINYcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
8209
+ const groupScope = _chunkOFVCWV2Dcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
8125
8210
  loadingRegistrations.push(`
8126
8211
  {
8127
- pattern: ${JSON.stringify(_chunkUWOCYINYcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
8212
+ pattern: ${JSON.stringify(_chunkOFVCWV2Dcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
8128
8213
  groupScope: ${JSON.stringify(groupScope)},
8129
- directoryDepth: ${_chunkUWOCYINYcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
8214
+ directoryDepth: ${_chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
8130
8215
  module: ${varName},
8131
8216
  }`);
8132
8217
  });
@@ -8139,12 +8224,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8139
8224
  metadataImageImports.push(
8140
8225
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(image.modulePath)};`
8141
8226
  );
8227
+ const component = !_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) && _chunkCL7BUGVBcjs.isRendererCompiledComponent.call(void 0, image.modulePath, _nullishCoalesce(_optionalChain([config, 'access', _201 => _201.renderer, 'optionalAccess', _202 => _202.componentExtensions]), () => ( [])));
8142
8228
  metadataImageRegistrations.push(`
8143
8229
  {
8144
8230
  pattern: ${JSON.stringify(image.pattern)},
8145
8231
  kind: ${JSON.stringify(image.kind)},
8146
8232
  fileName: ${JSON.stringify(image.fileName)},
8147
- sourceType: "module",
8233
+ sourceType: "module",${component ? "\n component: true," : ""}
8148
8234
  module: ${varName},
8149
8235
  }`);
8150
8236
  return;
@@ -8213,7 +8299,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8213
8299
  createDefaultErrorMarkup,
8214
8300
  createFarmInstrumentationLifecycle,
8215
8301
  createFarmLayoutSelector,
8216
- createFarmLayoutBoundary,${_optionalChain([config, 'access', _201 => _201.docs, 'optionalAccess', _202 => _202.enabled]) ? "\n createFarmDocsLayoutTree,\n farmDocsLayoutsWrapPage,\n placeFarmDocsLayoutRoot," : ""}
8302
+ createFarmLayoutBoundary,${_optionalChain([config, 'access', _203 => _203.docs, 'optionalAccess', _204 => _204.enabled]) ? "\n createFarmDocsLayoutTree,\n farmDocsLayoutsWrapPage,\n placeFarmDocsLayoutRoot," : ""}
8217
8303
  isInFarmRouteGroupScope,
8218
8304
  routeBoundaryCoversDirectory,
8219
8305
  createFarmCacheKey,
@@ -8296,7 +8382,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8296
8382
  createFarmDeploymentMismatchResponse,
8297
8383
  FARM_DEPLOYMENT_ID_HEADER,
8298
8384
  getFarmDeploymentMismatch,
8299
- withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _203 => _203.md, 'optionalAccess', _204 => _204.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}${searchPreserveRoutesSource ? "\n _setFarmSearchPreserveRoutes," : ""}
8385
+ withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _205 => _205.md, 'optionalAccess', _206 => _206.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}${searchPreserveRoutesSource ? "\n _setFarmSearchPreserveRoutes," : ""}
8300
8386
  } from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
8301
8387
  import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
8302
8388
  // The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
@@ -8355,35 +8441,38 @@ import { installFarmIslandsServer } from "@farm.js/core/internal/islands-server"
8355
8441
  installFarmIslandsServer();
8356
8442
  const farmFormActionsConfig = ${JSON.stringify(_chunkXRFGOYXGcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
8357
8443
  installFarmIslandValues();
8358
- ${islandsActionKeyCode()}
8359
- ${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : `
8444
+ ${islandsActionKeyCode("@farm.js/core/internal/islx-server")}
8445
+ ${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : `${farmRendererActions ? `
8446
+ import { handleFarmFormActionRequest } from "@farm.js/core/internal/production-runtime";
8447
+ const farmFormActionsConfig = ${JSON.stringify(_chunkXRFGOYXGcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
8448
+ ${islandsActionKeyCode("@farm.js/core/internal/islx-actions-server")}` : ""}
8360
8449
  function farmFormState() { return undefined; }
8361
8450
  function farmFormStateScript() { return ""; }`}`;
8362
8451
  const productionSiteTelemetryImport = config.telemetry ? `import { createFarmProductionSiteReporter } from "@farm.js/core/internal/product-telemetry-runtime";` : "";
8363
- const metadataImageRuntimeImport = hasGeneratedMetadataImages ? `import { createFarmMetadataImageResponse } from "@farm.js/core/internal/metadata-image-runtime";` : "";
8452
+ const metadataImageRuntimeImport = hasGeneratedMetadataImages ? `import { createFarmMetadataImageResponse, resolveFarmMetadataImageValue } from "@farm.js/core/internal/metadata-image-runtime";` : "";
8364
8453
  const pluginRuntimeImport = hasPluginRuntime ? `import { PluginManager } from "@farm.js/core/plugin";` : "";
8365
8454
  const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
8366
8455
  const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
8367
8456
  const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
8368
- const docsHandlerImport = _optionalChain([config, 'access', _205 => _205.docs, 'optionalAccess', _206 => _206.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
8457
+ const docsHandlerImport = _optionalChain([config, 'access', _207 => _207.docs, 'optionalAccess', _208 => _208.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
8369
8458
  const isFarmDocsAPIRequest = (requestOrPathname) => {
8370
8459
  const pathname = typeof requestOrPathname === "string"
8371
8460
  ? requestOrPathname
8372
8461
  : new URL(requestOrPathname.url).pathname;
8373
- const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _207 => _207.apiPath]) || "/api/docs")};
8462
+ const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _209 => _209.apiPath]) || "/api/docs")};
8374
8463
  return pathname === apiPath || pathname.startsWith(apiPath + "/");
8375
8464
  };` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
8376
- import { ${_optionalChain([config, 'access', _208 => _208.docs, 'access', _209 => _209.roots, 'optionalAccess', _210 => _210.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
8465
+ import { ${_optionalChain([config, 'access', _210 => _210.docs, 'access', _211 => _211.roots, 'optionalAccess', _212 => _212.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
8377
8466
  import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
8378
8467
  import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
8379
- const docsFontImport = _optionalChain([config, 'access', _211 => _211.docs, 'optionalAccess', _212 => _212.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
8380
- const docsRuntimeImport = _optionalChain([config, 'access', _213 => _213.docs, 'optionalAccess', _214 => _214.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
8468
+ const docsFontImport = _optionalChain([config, 'access', _213 => _213.docs, 'optionalAccess', _214 => _214.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
8469
+ const docsRuntimeImport = _optionalChain([config, 'access', _215 => _215.docs, 'optionalAccess', _216 => _216.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
8381
8470
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
8382
8471
  import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
8383
- const markdownHandlerImport = _optionalChain([config, 'access', _215 => _215.md, 'optionalAccess', _216 => _216.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
8472
+ const markdownHandlerImport = _optionalChain([config, 'access', _217 => _217.md, 'optionalAccess', _218 => _218.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
8384
8473
  const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
8385
8474
  const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
8386
- const mdxComponentsPath = typeof _optionalChain([config, 'access', _217 => _217.mdx, 'optionalAccess', _218 => _218.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
8475
+ const mdxComponentsPath = typeof _optionalChain([config, 'access', _219 => _219.mdx, 'optionalAccess', _220 => _220.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
8387
8476
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
8388
8477
  const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
8389
8478
  const layerConfigImports = layerConfigPaths.map(
@@ -8403,14 +8492,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
8403
8492
  const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
8404
8493
  const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
8405
8494
  const mobileSession = (config.plugins || []).some(
8406
- (plugin) => _optionalChain([plugin, 'optionalAccess', _219 => _219.name]) === _chunkMHKPXX3Jcjs.FARM_MOBILE_SESSION_PLUGIN
8495
+ (plugin) => _optionalChain([plugin, 'optionalAccess', _221 => _221.name]) === _chunkMHKPXX3Jcjs.FARM_MOBILE_SESSION_PLUGIN
8407
8496
  );
8408
8497
  const nativeServerFns = (config.plugins || []).some(
8409
- (plugin) => _optionalChain([plugin, 'optionalAccess', _220 => _220.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
8410
- ) ? _chunkTS3ZHJN5cjs.collectFarmNativeServerFns.call(void 0, {
8498
+ (plugin) => _optionalChain([plugin, 'optionalAccess', _222 => _222.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
8499
+ ) ? _chunkXOGCNKB7cjs.collectFarmNativeServerFns.call(void 0, {
8411
8500
  root: config.root,
8412
8501
  srcDir: config.srcDir,
8413
- entries: _chunkTS3ZHJN5cjs.findFarmNativeScreenFiles.call(void 0, _chunkQMR2TUVZcjs.getFarmAppDirectories.call(void 0, config))
8502
+ entries: _chunkXOGCNKB7cjs.findFarmNativeScreenFiles.call(void 0, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config))
8414
8503
  }) : void 0;
8415
8504
  const integrationImports = `
8416
8505
  ${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
@@ -8425,7 +8514,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
8425
8514
  ${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
8426
8515
  });` : ""}
8427
8516
  `;
8428
- const imageRuntime = _chunkX4TSMQWFcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
8517
+ const imageRuntime = _chunkCL7BUGVBcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
8429
8518
  const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
8430
8519
  const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
8431
8520
  const apiHandlerCode = apiRoutes.length > 0 ? `
@@ -8607,7 +8696,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
8607
8696
 
8608
8697
  function renderFarmDefault404Page() {
8609
8698
  return React.createElement(React.Fragment, null,
8610
- React.createElement("style", null, ${JSON.stringify(_chunkX4TSMQWFcjs.DEFAULT_NOT_FOUND_STYLES)}),
8699
+ React.createElement("style", null, ${JSON.stringify(_chunkCL7BUGVBcjs.DEFAULT_NOT_FOUND_STYLES)}),
8611
8700
  React.createElement("main", {
8612
8701
  className: "farm-default-not-found",
8613
8702
  "aria-labelledby": "farm-default-not-found-title",
@@ -8750,24 +8839,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
8750
8839
  validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
8751
8840
  onError(error) { console.error("[Farm Image]", error); },
8752
8841
  })`};
8753
- const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _221 => _221.md, 'optionalAccess', _222 => _222.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
8842
+ const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _223 => _223.md, 'optionalAccess', _224 => _224.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
8754
8843
  // A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
8755
8844
  // ('/about/'), so the trailing-slash 308 never answers in its place.
8756
8845
  const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
8757
8846
  const toFarmMarkdownPageRequest = (request) => request;` : ""}
8758
- const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _223 => _223.agent, 'optionalAccess', _224 => _224.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
8759
- ${_optionalChain([config, 'access', _225 => _225.agent, 'optionalAccess', _226 => _226.llmsTxt, 'optionalAccess', _227 => _227.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
8847
+ const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _225 => _225.agent, 'optionalAccess', _226 => _226.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
8848
+ ${_optionalChain([config, 'access', _227 => _227.agent, 'optionalAccess', _228 => _228.llmsTxt, 'optionalAccess', _229 => _229.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
8760
8849
  const farmMdxConfig = ${JSON.stringify({
8761
8850
  ...config.mdx,
8762
- components: typeof _optionalChain([config, 'access', _228 => _228.mdx, 'optionalAccess', _229 => _229.components]) === "string" ? config.mdx.components : void 0
8851
+ components: typeof _optionalChain([config, 'access', _230 => _230.mdx, 'optionalAccess', _231 => _231.components]) === "string" ? config.mdx.components : void 0
8763
8852
  })};
8764
8853
  const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
8765
- ${_optionalChain([config, 'access', _230 => _230.agent, 'optionalAccess', _231 => _231.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
8854
+ ${_optionalChain([config, 'access', _232 => _232.agent, 'optionalAccess', _233 => _233.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
8766
8855
  // environment this was built in, since Netlify exposes its deploy context only
8767
8856
  // to the build.
8768
8857
  const farmNoindexPreview = resolveFarmPreviewDeployment(
8769
8858
  globalThis.process?.env,
8770
- ${JSON.stringify(_chunkXY5OZQF6cjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
8859
+ ${JSON.stringify(_chunkADQ2LATRcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
8771
8860
  );` : ""}
8772
8861
  const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
8773
8862
  const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
@@ -8813,7 +8902,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
8813
8902
  });
8814
8903
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
8815
8904
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
8816
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _232 => _232.docs, 'optionalAccess', _233 => _233.enabled]) && !hasPrecompiledDocs ? `(() => {
8905
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _234 => _234.docs, 'optionalAccess', _235 => _235.enabled]) && !hasPrecompiledDocs ? `(() => {
8817
8906
  try {
8818
8907
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
8819
8908
  const candidates = [
@@ -8825,7 +8914,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _232 => _2
8825
8914
  } catch {
8826
8915
  return null;
8827
8916
  }
8828
- })()` : "null"};${_optionalChain([config, 'access', _234 => _234.docs, 'optionalAccess', _235 => _235.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _236 => _236.docs, 'access', _237 => _237.roots, 'optionalAccess', _238 => _238.length]) ? `
8917
+ })()` : "null"};${_optionalChain([config, 'access', _236 => _236.docs, 'optionalAccess', _237 => _237.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _238 => _238.docs, 'access', _239 => _239.roots, 'optionalAccess', _240 => _240.length]) ? `
8829
8918
  const farmDocsBundledRootsDir = (() => {
8830
8919
  try {
8831
8920
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
@@ -8877,7 +8966,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
8877
8966
  ),
8878
8967
  }
8879
8968
  : undefined;
8880
- const farmDocsHandler = ${_optionalChain([config, 'access', _239 => _239.docs, 'optionalAccess', _240 => _240.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
8969
+ const farmDocsHandler = ${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
8881
8970
  rootDir: farmDocsRuntimeRoot,
8882
8971
  // A production build's content cannot change, so the adapter reads its
8883
8972
  // navigation once instead of scanning the content directory per request.
@@ -8898,7 +8987,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _239 => _239.docs, '
8898
8987
  registerMCPServer: registerFarmMCPServer,
8899
8988
  // A page built with this keeps its HTML string, so the preload budget and the response
8900
8989
  // writer use it instead of reading and re-encoding the body. Older adapters ignore it.
8901
- createHtmlResponse: farmOwnedHtmlResponse,${_chunkZPEZXQTMcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
8990
+ createHtmlResponse: farmOwnedHtmlResponse,${_chunkE3HBD2K3cjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
8902
8991
  // The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
8903
8992
  // asks about any path its own content lists, so the guards decide here, not a page list.
8904
8993
  isPathGuarded: (pathname) =>
@@ -8924,11 +9013,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _239 => _239.docs, '
8924
9013
  isPathGuarded: isFarmDocsPathGuarded,
8925
9014
  basePath: ${JSON.stringify(config.basePath)},
8926
9015
  })` : "null"};
8927
- const farmDocsAPIHandler = ${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
9016
+ const farmDocsAPIHandler = ${_optionalChain([config, 'access', _243 => _243.docs, 'optionalAccess', _244 => _244.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
8928
9017
 
8929
9018
  // API routes bundled at build time
8930
9019
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
8931
- ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path18, methods }) => ({ path: path18, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
9020
+ ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path19, methods }) => ({ path: path19, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
8932
9021
  // A plugin calling an app endpoint (an MCP tool, say) goes through the whole
8933
9022
  // pipeline, so the endpoint's middleware and integration guards run for it.
8934
9023
  function dispatchFarmPluginAPIRequest(request) {
@@ -8959,12 +9048,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
8959
9048
  // runtime request.
8960
9049
  const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
8961
9050
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
8962
- ${_optionalChain([config, 'access', _243 => _243.agent, 'optionalAccess', _244 => _244.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunk5OAN7BG5cjs.resolveFarmApiCatalogInput.call(void 0, config))};
8963
- ` : ""}${_optionalChain([config, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
8964
- _chunk5OAN7BG5cjs.resolveFarmAppManifestInput.call(void 0, config, {
9051
+ ${_optionalChain([config, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkFYZD7DUScjs.resolveFarmApiCatalogInput.call(void 0, config))};
9052
+ ` : ""}${_optionalChain([config, 'access', _247 => _247.agent, 'optionalAccess', _248 => _248.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
9053
+ _chunkFYZD7DUScjs.resolveFarmAppManifestInput.call(void 0, config, {
8965
9054
  build: config.deploymentId,
8966
- packages: _chunkX4TSMQWFcjs.resolveFarmAppPackages.call(void 0, config.root),
8967
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkX4TSMQWFcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
9055
+ packages: _chunkCL7BUGVBcjs.resolveFarmAppPackages.call(void 0, config.root),
9056
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkCL7BUGVBcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
8968
9057
  })
8969
9058
  )};
8970
9059
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
@@ -8977,7 +9066,7 @@ farmAppManifestInput.guardCoversPath = (path) =>
8977
9066
  path,
8978
9067
  farmLocalAPIBasePath,
8979
9068
  );
8980
- ${_optionalChain([config, 'access', _247 => _247.docs, 'optionalAccess', _248 => _248.enabled]) ? `// A docs runtime's MCP server lists its tools when asked over MCP, in process. A build
9069
+ ${_optionalChain([config, 'access', _249 => _249.docs, 'optionalAccess', _250 => _250.enabled]) ? `// A docs runtime's MCP server lists its tools when asked over MCP, in process. A build
8981
9070
  // can't change them, so they are read once.
8982
9071
  if (farmDocsHandler) {
8983
9072
  farmAppManifestInput.registeredMCP = (request) =>
@@ -9071,7 +9160,10 @@ function serializeFarmInlineValue(value) {
9071
9160
  .replace(/\\u2029/g, "\\\\u2029");
9072
9161
  }
9073
9162
 
9074
- function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, pageProps, routePathname) {
9163
+ // \`statusDocument\`: the not-found or error page, which renders without the route's layout
9164
+ // boundaries and page segment. It names no route for its URL, so the client hydrates none over it
9165
+ // (development writes no hydration flags for it either); its links still navigate.
9166
+ function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, pageProps, routePathname, statusDocument) {
9075
9167
  const integrationManifest = ${hasRuntimeIntegrationConfig ? "getRegisteredIntegrationAPIManifest()" : "{}"};
9076
9168
  const serializedRouteSlots = serializeFarmInlineValue(selectedRouteSlots || []);
9077
9169
  const serializedPageProps = serializeFarmInlineValue(pageProps || {});
@@ -9082,11 +9174,13 @@ function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, page
9082
9174
  ';window.__FARM_DEPLOYMENT_ID__=' + serializeFarmInlineValue(farmDeploymentId) + ';'${searchPreserveRoutesSource ? ` +
9083
9175
  'window[Symbol.for("farm.searchPreserveRoutes")]=' + serializeFarmInlineValue(farmSearchPreserveRoutes) + ';'` : ""};
9084
9176
  // The client boots at the canonical path when the script below moves it there.
9085
- const bootRoutes = getFarmClientBootRoutes(
9086
- typeof canonicalPath === "string" && canonicalPath.startsWith("/")
9087
- ? getFarmRoutePathname(canonicalPath.split(/[?#]/)[0])
9088
- : routePathname
9089
- );
9177
+ const bootRoutes = statusDocument
9178
+ ? typeof routePathname === "string" ? { path: routePathname, routes: [] } : undefined
9179
+ : getFarmClientBootRoutes(
9180
+ typeof canonicalPath === "string" && canonicalPath.startsWith("/")
9181
+ ? getFarmRoutePathname(canonicalPath.split(/[?#]/)[0])
9182
+ : routePathname
9183
+ );
9090
9184
  if (bootRoutes) source += 'window.__FARM_CLIENT_ROUTES__=' + serializeFarmInlineValue(bootRoutes) + ';';
9091
9185
  if (typeof canonicalPath === "string" && canonicalPath.startsWith("/")) {
9092
9186
  const serializedPath = serializeFarmInlineValue(canonicalPath);
@@ -9747,7 +9841,7 @@ function peelFarmDocumentPrefix(markup) {
9747
9841
  let inner = markup.replace(/^\\s+/, "");
9748
9842
  let hoisted = "";
9749
9843
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
9750
- const hoistable = /${_chunkUWOCYINYcjs.HOISTED_HEAD_ELEMENT.source}/i;
9844
+ const hoistable = /${_chunkOFVCWV2Dcjs.HOISTED_HEAD_ELEMENT.source}/i;
9751
9845
  let match;
9752
9846
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
9753
9847
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -9776,7 +9870,7 @@ function opensFarmFullDocument(markup) {
9776
9870
  // them: its own head takes them. Matches the dev renderer's takeFarmHoistedHead.
9777
9871
  function takeFarmHoistedHead(markup) {
9778
9872
  if (opensFarmFullDocument(markup)) return { head: "", body: markup };
9779
- const hoistable = /${_chunkUWOCYINYcjs.HOISTED_HEAD_ELEMENT.source}/i;
9873
+ const hoistable = /${_chunkOFVCWV2Dcjs.HOISTED_HEAD_ELEMENT.source}/i;
9780
9874
  let head = "";
9781
9875
  let body = markup;
9782
9876
  let match;
@@ -9874,7 +9968,7 @@ function addFarmFallbackIcon(markup, hasFavicon) {
9874
9968
  return markup.replace(/<\\/head>/i, function() { return ' <link rel="icon" href="data:,">\\n</head>'; });
9875
9969
  }
9876
9970
 
9877
- function createFarmErrorDocument(html, title) {
9971
+ function createFarmErrorDocument(html, title, routePathname) {
9878
9972
  const escapedTitle = escapeFarmHtmlAttribute(title || "Application Error");
9879
9973
  const fullDocument = extractFarmFullDocument(html);
9880
9974
  const hasFullDocument = fullDocument !== null;
@@ -9889,7 +9983,7 @@ function createFarmErrorDocument(html, title) {
9889
9983
  renderFarmRendererHydrationScript() + '\\n' +
9890
9984
  '</head>\\n<body>\\n' +
9891
9985
  ' <div id="root">' + html + '</div>\\n' +
9892
- ' ' + renderFarmClientBootstrapScript() + '\\n' +
9986
+ ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true) + '\\n' +
9893
9987
  ' ' + renderFarmClientEntryScript() + '\\n' +
9894
9988
  '</body>\\n</html>';
9895
9989
  }
@@ -9908,7 +10002,7 @@ function createFarmErrorDocument(html, title) {
9908
10002
  .replace(
9909
10003
  /<\\/body>/i,
9910
10004
  function() {
9911
- return ' ' + renderFarmClientBootstrapScript() + '\\n' +
10005
+ return ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true) + '\\n' +
9912
10006
  ' ' + renderFarmClientEntryScript() + '\\n</body>';
9913
10007
  },
9914
10008
  );
@@ -10261,13 +10355,11 @@ async function handleMetadataImageRequest(request, routePathname) {
10261
10355
  searchParams: createFarmSearchParams(searchParams),
10262
10356
  path: match.pagePath,
10263
10357
  };
10264
- const value = typeof imageModule.default === "function"
10265
- ? await imageModule.default(props)
10266
- : imageModule.default;
10267
10358
 
10268
- ${hasGeneratedMetadataImages ? `return createFarmMetadataImageResponse(value, imageModule, {
10359
+ ${hasGeneratedMetadataImages ? `const value = await resolveFarmMetadataImageValue(imageModule, props${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? "" : ", {\n renderer: ReactDOMServer,\n component: image.component === true,\n }"});
10360
+ return createFarmMetadataImageResponse(value, imageModule, {
10269
10361
  method,
10270
- ifNoneMatch: request.headers.get("if-none-match"),${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: ReactDOMServer,"}
10362
+ ifNoneMatch: request.headers.get("if-none-match"),${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: ReactDOMServer,"}
10271
10363
  });` : 'throw new Error("Generated metadata image runtime is unavailable");'}
10272
10364
  } catch (error) {
10273
10365
  console.error("Metadata image render failed:", error);
@@ -10346,7 +10438,7 @@ function createFarmAgentRobotsResponse(request) {
10346
10438
  // its nearest layout's.
10347
10439
  const farmAgentGuardedPages = new Set(${JSON.stringify(
10348
10440
  pageRoutes.map((route) => route.pattern).filter(
10349
- (pattern) => !pattern.includes("[") && _chunkUWOCYINYcjs.farmPathGuardCoversPage.call(void 0,
10441
+ (pattern) => !pattern.includes("[") && _chunkOFVCWV2Dcjs.farmPathGuardCoversPage.call(void 0,
10350
10442
  {
10351
10443
  config: { middleware: config.middleware, integrations: config.integrations },
10352
10444
  middlewareRoutes
@@ -10401,7 +10493,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
10401
10493
  // aside for a page route that answers /mcp and for any MCP server published or
10402
10494
  // registered at runtime, such as the docs engine's.
10403
10495
  const farmDefaultMCPServer = ${JSON.stringify(
10404
- _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkCCMP4JD2cjs.FARM_VERSION)
10496
+ _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkNSLRK5DKcjs.FARM_VERSION)
10405
10497
  )};
10406
10498
  let farmDefaultMCPRouteFree;
10407
10499
  function getFarmDefaultMCPServer() {
@@ -10595,7 +10687,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
10595
10687
  // middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
10596
10688
  const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
10597
10689
  const farmPrerendering =
10598
- typeof process !== "undefined" && process.env?.${_chunkANZLZNNXcjs.FARM_PRERENDER_ENV} === "1";
10690
+ typeof process !== "undefined" && process.env?.${_chunkW6C3LEXXcjs.FARM_PRERENDER_ENV} === "1";
10599
10691
  ` : ""}
10600
10692
  const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
10601
10693
  config: farmMiddlewareConfig,
@@ -10739,7 +10831,7 @@ function hasLocalRequestRoute(request, routePathname) {
10739
10831
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
10740
10832
  return true;
10741
10833
  }
10742
- ${_optionalChain([config, 'access', _249 => _249.docs, 'optionalAccess', _250 => _250.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
10834
+ ${_optionalChain([config, 'access', _251 => _251.docs, 'optionalAccess', _252 => _252.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
10743
10835
  // The docs answer below the basePath; their API stays at /api/docs, as API routes do.
10744
10836
  const docsRoutePathname = stripFarmBasePath(pathname);
10745
10837
  if (
@@ -10767,7 +10859,7 @@ function getFarmPluginRequestOptions(request) {
10767
10859
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
10768
10860
  };
10769
10861
  }
10770
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _251 => _251.docs, 'optionalAccess', _252 => _252.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
10862
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _253 => _253.docs, 'optionalAccess', _254 => _254.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
10771
10863
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
10772
10864
  pathname,
10773
10865
  method: request.method,
@@ -10851,7 +10943,7 @@ ${hasInfraAnalyticsRuntime ? `
10851
10943
  // endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
10852
10944
  // labeled here; route.pattern keeps meaning the matched app route for plugins.
10853
10945
  const farmBuiltInRoutePaths = new Set(${JSON.stringify(
10854
- _chunk5OAN7BG5cjs.listFarmBuiltInRoutePaths.call(void 0, {
10946
+ _chunkFYZD7DUScjs.listFarmBuiltInRoutePaths.call(void 0, {
10855
10947
  agent: {
10856
10948
  ...config.agent,
10857
10949
  aiCatalog: servesAiCatalog,
@@ -10862,9 +10954,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
10862
10954
  openapi: openAPIReference
10863
10955
  })
10864
10956
  )});
10865
- ${_optionalChain([config, 'access', _253 => _253.docs, 'optionalAccess', _254 => _254.enabled]) ? `const farmDocsRouteLabelInput = {
10957
+ ${_optionalChain([config, 'access', _255 => _255.docs, 'optionalAccess', _256 => _256.enabled]) ? `const farmDocsRouteLabelInput = {
10866
10958
  path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
10867
- apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _255 => _255.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _256 => _256.docs, 'access', _257 => _257.roots, 'optionalAccess', _258 => _258.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
10959
+ apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _257 => _257.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _258 => _258.docs, 'access', _259 => _259.roots, 'optionalAccess', _260 => _260.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
10868
10960
  pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
10869
10961
  };
10870
10962
  ` : ""}// The request's route payload, for a handler that learns what answered while it handles.
@@ -10880,11 +10972,11 @@ function labelFarmRequestOptions(options) {
10880
10972
  setFarmRouteLabel(options.route, mcpLabel);
10881
10973
  return options;
10882
10974
  }
10883
- ${_optionalChain([config, 'access', _259 => _259.docs, 'optionalAccess', _260 => _260.enabled]) ? `if (options.kind === "docs") {
10975
+ ${_optionalChain([config, 'access', _261 => _261.docs, 'optionalAccess', _262 => _262.enabled]) ? `if (options.kind === "docs") {
10884
10976
  setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
10885
10977
  return options;
10886
10978
  }` : ""}
10887
- ${_optionalChain([config, 'access', _261 => _261.md, 'optionalAccess', _262 => _262.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
10979
+ ${_optionalChain([config, 'access', _263 => _263.md, 'optionalAccess', _264 => _264.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
10888
10980
  routePathname,
10889
10981
  (page) => matchPageRoute(page)?.route.pattern,
10890
10982
  );
@@ -10919,7 +11011,7 @@ function getApplicableLayouts(pathname, directory) {
10919
11011
  return applicable;
10920
11012
  }
10921
11013
 
10922
- ${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 => _264.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
11014
+ ${_optionalChain([config, 'access', _265 => _265.docs, 'optionalAccess', _266 => _266.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
10923
11015
  if (request.method === "HEAD") return response;
10924
11016
  if (response.headers.get("x-farm-docs-adapter")) return response;
10925
11017
 
@@ -11025,7 +11117,7 @@ ${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 =>
11025
11117
 
11026
11118
  // Shells keep their own LRU so query-string variants never evict app cache entries.
11027
11119
  const pprShellCache = getFarmDataCache().pprShellCache;
11028
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _265 => _265.experimental, 'optionalAccess', _266 => _266.ppr]) === true)};
11120
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _267 => _267.experimental, 'optionalAccess', _268 => _268.ppr]) === true)};
11029
11121
 
11030
11122
  function resolveRouteRenderingView(route) {
11031
11123
  // The same merge development uses: baked directive config under the
@@ -11145,7 +11237,7 @@ async function handleFarmRequest(request, adapterContext) {
11145
11237
  },
11146
11238
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
11147
11239
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
11148
- ${_optionalChain([config, 'access', _267 => _267.md, 'optionalAccess', _268 => _268.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
11240
+ ${_optionalChain([config, 'access', _269 => _269.md, 'optionalAccess', _270 => _270.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
11149
11241
  if (matchPageRoute(pathname)) {
11150
11242
  // The Link header advertises the public .md URL, like the head alternate.
11151
11243
  return applyMarkdownNegotiationHeaders(response, {
@@ -11362,7 +11454,7 @@ ${hasServerRuntimeIntegrations ? `
11362
11454
  return renderFarmErrorJSONResponse();` : `
11363
11455
  if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
11364
11456
  // No page was selected, so only the root error boundary and layouts apply.
11365
- const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _269 => _269.md, 'optionalAccess', _270 => _270.enabled]) ? `
11457
+ const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _271 => _271.md, 'optionalAccess', _272 => _272.enabled]) ? `
11366
11458
  // An agent asking for Markdown reads the error document as Markdown, as it
11367
11459
  // does when a page throws. The helper answers null when Markdown is off.
11368
11460
  const markdownErrorResponse = await createMarkdownMirrorResponse({
@@ -11404,7 +11496,7 @@ ${hasServerRuntimeIntegrations ? `
11404
11496
  }
11405
11497
  ` : ""}
11406
11498
 
11407
- ${_optionalChain([config, 'access', _271 => _271.docs, 'optionalAccess', _272 => _272.enabled]) ? `
11499
+ ${_optionalChain([config, 'access', _273 => _273.docs, 'optionalAccess', _274 => _274.enabled]) ? `
11408
11500
  // Docs responses are served after app middleware so route guards and
11409
11501
  // middleware headers apply to the docs engine like any other page content.
11410
11502
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -11520,7 +11612,7 @@ ${hasServerRuntimeIntegrations ? `
11520
11612
  }
11521
11613
  ` : ""}
11522
11614
 
11523
- ${_optionalChain([config, 'access', _273 => _273.md, 'optionalAccess', _274 => _274.enabled]) ? `
11615
+ ${_optionalChain([config, 'access', _275 => _275.md, 'optionalAccess', _276 => _276.enabled]) ? `
11524
11616
  if (farmMarkdownConfig?.enabled) {
11525
11617
  const markdownResponse = await createMarkdownMirrorResponse({
11526
11618
  // The mirror helper only reads metadata and creates its own GET request.
@@ -11624,11 +11716,11 @@ ${hasServerRuntimeIntegrations ? `
11624
11716
  return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
11625
11717
  }
11626
11718
  ` : ""}
11627
- ${_optionalChain([config, 'access', _275 => _275.agent, 'optionalAccess', _276 => _276.manifest]) !== false ? `
11719
+ ${_optionalChain([config, 'access', _277 => _277.agent, 'optionalAccess', _278 => _278.manifest]) !== false ? `
11628
11720
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
11629
11721
  // public manifest, the same document for every request.
11630
11722
  if (
11631
- [${JSON.stringify(_chunk5OAN7BG5cjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunk5OAN7BG5cjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
11723
+ [${JSON.stringify(_chunkFYZD7DUScjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkFYZD7DUScjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
11632
11724
  normalizeRuntimePath(routePathname),
11633
11725
  )
11634
11726
  ) {
@@ -11638,9 +11730,9 @@ ${hasServerRuntimeIntegrations ? `
11638
11730
  );
11639
11731
  }
11640
11732
  ` : ""}
11641
- ${_optionalChain([config, 'access', _277 => _277.agent, 'optionalAccess', _278 => _278.apiCatalog]) ? `
11733
+ ${_optionalChain([config, 'access', _279 => _279.agent, 'optionalAccess', _280 => _280.apiCatalog]) ? `
11642
11734
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
11643
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunk5OAN7BG5cjs.FARM_API_CATALOG_PATH)}) {
11735
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkFYZD7DUScjs.FARM_API_CATALOG_PATH)}) {
11644
11736
  return applyProductionMiddlewareHeaders(
11645
11737
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
11646
11738
  middlewareHeaders,
@@ -11665,11 +11757,11 @@ ${hasServerRuntimeIntegrations ? `
11665
11757
  );
11666
11758
  }
11667
11759
  ` : ""}
11668
- ${_optionalChain([config, 'access', _279 => _279.agent, 'optionalAccess', _280 => _280.llmsTxt, 'optionalAccess', _281 => _281.enabled]) ? `
11760
+ ${_optionalChain([config, 'access', _281 => _281.agent, 'optionalAccess', _282 => _282.llmsTxt, 'optionalAccess', _283 => _283.enabled]) ? `
11669
11761
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
11670
11762
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
11671
11763
  ? "llms"
11672
- : ${_optionalChain([config, 'access', _282 => _282.agent, 'optionalAccess', _283 => _283.llmsTxt, 'optionalAccess', _284 => _284.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
11764
+ : ${_optionalChain([config, 'access', _284 => _284.agent, 'optionalAccess', _285 => _285.llmsTxt, 'optionalAccess', _286 => _286.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
11673
11765
  if (farmGeneratedLlmsKind) {
11674
11766
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
11675
11767
  // Renders are shared per origin the request reached, which is where pages are read.
@@ -11705,7 +11797,7 @@ ${hasServerRuntimeIntegrations ? `
11705
11797
  }
11706
11798
  ` : ""}
11707
11799
 
11708
- ${_optionalChain([config, 'access', _285 => _285.docs, 'optionalAccess', _286 => _286.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
11800
+ ${_optionalChain([config, 'access', _287 => _287.docs, 'optionalAccess', _288 => _288.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
11709
11801
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
11710
11802
  if (docsAPIResponse) {
11711
11803
  return applyProductionMiddlewareHeaders(
@@ -11734,7 +11826,7 @@ ${hasServerRuntimeIntegrations ? `
11734
11826
  if (farmDeploymentMismatch) return createFarmDeploymentMismatchResponse(farmDeploymentMismatch);
11735
11827
  farmCacheGuard.deploymentPage = true;
11736
11828
  }
11737
- ${farmIslandsMode ? `// Islands mode: a form or client component posting a server action to this page.
11829
+ ${farmIslandsMode || farmRendererActions ? `// A form or client component posting a server action to this page.
11738
11830
  if (matchedRoute && request.method === "POST") {
11739
11831
  const actionResponse = await _runWithMiddlewareData(middlewareData || {}, () =>
11740
11832
  _runWithMiddlewareContext(middlewareContext || {}, () =>
@@ -12164,11 +12256,11 @@ ${hasServerRuntimeIntegrations ? `
12164
12256
  // outer request handler exactly like sync render errors.
12165
12257
  if (typeof PageComponent === "function" && PageComponent.constructor.name === "AsyncFunction") {
12166
12258
  const result = await PageComponent(pageProps);
12167
- if (React.isValidElement(result)) {
12168
- pageElement = result;
12169
- } else {
12170
- pageElement = React.createElement("div", null, String(result));
12171
- }
12259
+ // Anything else (text, a number, null) renders as the renderer renders a child,
12260
+ // as in development.
12261
+ pageElement = React.isValidElement(result)
12262
+ ? result
12263
+ : React.createElement(React.Fragment, null, result);
12172
12264
  } else {
12173
12265
  // Sync component - create element directly
12174
12266
  pageElement = React.createElement(PageComponent, pageProps);
@@ -12200,7 +12292,7 @@ ${hasServerRuntimeIntegrations ? `
12200
12292
  pageElement,
12201
12293
  );
12202
12294
 
12203
- ${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) pageElement = markPagePosition(React, pageElement);" : ""}
12295
+ ${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) pageElement = markPagePosition(React, pageElement);" : ""}
12204
12296
  // Wrap with layouts (from innermost to outermost)
12205
12297
  // Layouts are sorted by depth (root first), so we process in reverse
12206
12298
  let wrappedElement = pageElement;
@@ -12272,7 +12364,7 @@ ${hasServerRuntimeIntegrations ? `
12272
12364
  wrappedElement = wrapFarmRouteClientGraph(wrappedElement);
12273
12365
  }
12274
12366
 
12275
- ${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) wrappedElement = markLayoutPosition(React, wrappedElement);" : ""}
12367
+ ${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) wrappedElement = markLayoutPosition(React, wrappedElement);" : ""}
12276
12368
  wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
12277
12369
  return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern, farmFlushToken);
12278
12370
  };
@@ -12343,7 +12435,7 @@ ${hasServerRuntimeIntegrations ? `
12343
12435
  );
12344
12436
  }
12345
12437
  }
12346
- ${_optionalChain([config, 'access', _287 => _287.md, 'optionalAccess', _288 => _288.enabled]) ? `
12438
+ ${_optionalChain([config, 'access', _289 => _289.md, 'optionalAccess', _290 => _290.enabled]) ? `
12347
12439
  // Advertise the Markdown mirror in the head as well as the Link header,
12348
12440
  // using the public path the .md request will be resolved against.
12349
12441
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -12372,7 +12464,7 @@ ${hasServerRuntimeIntegrations ? `
12372
12464
  emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "cookie" });
12373
12465
  }
12374
12466
 
12375
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _289 => _289.agent, 'optionalAccess', _290 => _290.jsonLd]), () => ( false)))} });
12467
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _291 => _291.agent, 'optionalAccess', _292 => _292.jsonLd]), () => ( false)))} });
12376
12468
  const title = renderedMetadata.title;
12377
12469
  const metaTags = renderedMetadata.tags;
12378
12470
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -12893,7 +12985,7 @@ ${servesDefaultMCP ? `
12893
12985
  )` : "await renderErrorElement()"};
12894
12986
  const errorDocument = applyFarmThemeDocument(
12895
12987
  applyFarmI18nDocument(
12896
- createFarmErrorDocument(errorHtml, "Application Error"),
12988
+ createFarmErrorDocument(errorHtml, "Application Error", routePathname),
12897
12989
  pathname,
12898
12990
  getFarmI18nSnapshot(),
12899
12991
  request
@@ -12934,7 +13026,8 @@ ${servesDefaultMCP ? `
12934
13026
  applyFarmI18nDocument(
12935
13027
  createFarmErrorDocument(
12936
13028
  fallbackHtml,
12937
- errorStatus + " - " + errorStatusText
13029
+ errorStatus + " - " + errorStatusText,
13030
+ routePathname
12938
13031
  ),
12939
13032
  pathname,
12940
13033
  getFarmI18nSnapshot(),
@@ -13057,7 +13150,7 @@ ${farmRendererDisabled ? `
13057
13150
  .replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n</head>')
13058
13151
  .replace(
13059
13152
  /<\\/body>/i,
13060
- () => ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname) + '\\n' +
13153
+ () => ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true) + '\\n' +
13061
13154
  ' ' + renderFarmClientEntryScript() + '\\n</body>',
13062
13155
  );
13063
13156
  fullHtml = ensureFarmDocumentMeta(fullHtml, notFoundMetadata.viewport);
@@ -13077,7 +13170,7 @@ ${farmRendererDisabled ? `
13077
13170
  </head>
13078
13171
  <body>
13079
13172
  <div id="root">\${html}</div>
13080
- \${renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname)}
13173
+ \${renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true)}
13081
13174
  \${renderFarmClientEntryScript()}
13082
13175
  </body>
13083
13176
  </html>\`;
@@ -13205,11 +13298,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
13205
13298
  export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
13206
13299
  // The image optimizer's fetch of a local source is not a loopback visitor.
13207
13300
  context = _withFarmImageSourceClientAddress(request, context);`}
13208
- ${_optionalChain([config, 'access', _291 => _291.agent, 'optionalAccess', _292 => _292.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
13301
+ ${_optionalChain([config, 'access', _293 => _293.agent, 'optionalAccess', _294 => _294.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
13209
13302
  basePath: farmLocalAPIBasePath,
13210
13303
  dispatch: async (localRequest) =>
13211
13304
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
13212
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _293 => _293.agent, 'optionalAccess', _294 => _294.noindexPreviews]) ? `
13305
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _295 => _295.agent, 'optionalAccess', _296 => _296.noindexPreviews]) ? `
13213
13306
  // Keep every response of a preview deployment out of search indexes.
13214
13307
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
13215
13308
  }
@@ -13419,7 +13512,7 @@ function getManifestPageEntry(manifest, pathname) {
13419
13512
  })).sort((left, right) => _chunkML4TOUZPcjs.compareRouteSpecificity.call(void 0, left.specificity, right.specificity)).map(({ entry, matches }) => ({ entry, matches }));
13420
13513
  manifestPageMatchers.set(manifest.routes, pages);
13421
13514
  }
13422
- return _optionalChain([pages, 'access', _295 => _295.find, 'call', _296 => _296((page) => page.matches(pathname)), 'optionalAccess', _297 => _297.entry]);
13515
+ return _optionalChain([pages, 'access', _297 => _297.find, 'call', _298 => _298((page) => page.matches(pathname)), 'optionalAccess', _299 => _299.entry]);
13423
13516
  }
13424
13517
  function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
13425
13518
  if (!edgeGuarded) return headers;
@@ -13456,13 +13549,13 @@ function getPhysicalPrerenderBypassReason(options) {
13456
13549
  if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
13457
13550
  return "rewrite";
13458
13551
  }
13459
- if (_chunkUWOCYINYcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
13460
- if (_chunkUWOCYINYcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
13461
- if (_chunkLVGB5PYKcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
13552
+ if (_chunkOFVCWV2Dcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
13553
+ if (_chunkOFVCWV2Dcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
13554
+ if (_chunkMOGRRZMWcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
13462
13555
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
13463
13556
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
13464
- if (_optionalChain([manifestEntry, 'optionalAccess', _298 => _298.rendering]) === "dynamic") return "dynamic runtime manifest";
13465
- if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _299 => _299.regions, 'optionalAccess', _300 => _300.length])) || manifestEntry.maxDuration !== void 0)) {
13557
+ if (_optionalChain([manifestEntry, 'optionalAccess', _300 => _300.rendering]) === "dynamic") return "dynamic runtime manifest";
13558
+ if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _301 => _301.regions, 'optionalAccess', _302 => _302.length])) || manifestEntry.maxDuration !== void 0)) {
13466
13559
  return "route runtime controls";
13467
13560
  }
13468
13561
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -13475,14 +13568,14 @@ function getPhysicalPrerenderBypassReason(options) {
13475
13568
  return void 0;
13476
13569
  }
13477
13570
  async function getFarmDocsPrerenderPages(config, root, preset) {
13478
- if (!_optionalChain([config, 'access', _301 => _301.docs, 'optionalAccess', _302 => _302.enabled]) || !config.docs.prerender) return [];
13571
+ if (!_optionalChain([config, 'access', _303 => _303.docs, 'optionalAccess', _304 => _304.enabled]) || !config.docs.prerender) return [];
13479
13572
  if (_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
13480
13573
  _chunk7U4XF76Rcjs.logger.info(
13481
13574
  `\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
13482
13575
  );
13483
13576
  return [];
13484
13577
  }
13485
- if (!_chunkZPEZXQTMcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
13578
+ if (!_chunkE3HBD2K3cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
13486
13579
  const { pages: pages2, originDependent } = _chunkHR5GU4UUcjs.listFarmDocsBuiltInPrerenderPages.call(void 0, config.docs, {
13487
13580
  root,
13488
13581
  srcDir: config.srcDir
@@ -13494,13 +13587,13 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
13494
13587
  }
13495
13588
  return pages2;
13496
13589
  }
13497
- if (!_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer)) {
13590
+ if (!_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer)) {
13498
13591
  _chunk7U4XF76Rcjs.logger.warn(
13499
13592
  `The docs adapter ${JSON.stringify(config.docs.adapter.id)} renders with React; docs.prerender keeps its pages rendering on request with the "${config.renderer.name}" renderer.`
13500
13593
  );
13501
13594
  return [];
13502
13595
  }
13503
- const pages = await _chunkZPEZXQTMcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
13596
+ const pages = await _chunkE3HBD2K3cjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
13504
13597
  if (!pages) {
13505
13598
  _chunk7U4XF76Rcjs.logger.warn(
13506
13599
  `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.`
@@ -13510,14 +13603,14 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
13510
13603
  return pages;
13511
13604
  }
13512
13605
  async function listFarmDocsAnalyticsPages(config, root, preset) {
13513
- if (!_optionalChain([config, 'access', _303 => _303.docs, 'optionalAccess', _304 => _304.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
13606
+ if (!_optionalChain([config, 'access', _305 => _305.docs, 'optionalAccess', _306 => _306.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
13514
13607
  return [];
13515
13608
  }
13516
13609
  try {
13517
- return await _chunkZPEZXQTMcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
13610
+ return await _chunkE3HBD2K3cjs.listFarmDocsPagePaths.call(void 0, config.docs, {
13518
13611
  root,
13519
13612
  srcDir: config.srcDir,
13520
- adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunkZPEZXQTMcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
13613
+ adapter: _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) && _chunkE3HBD2K3cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
13521
13614
  });
13522
13615
  } catch (error) {
13523
13616
  _chunk7U4XF76Rcjs.logger.warn(
@@ -13528,9 +13621,9 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
13528
13621
  }
13529
13622
  function hasFarmNitroCacheRouteRule(routeRules) {
13530
13623
  return Object.values(routeRules || {}).some((rule) => {
13531
- const swr = _optionalChain([rule, 'optionalAccess', _305 => _305.swr]);
13532
- const cache = _optionalChain([rule, 'optionalAccess', _306 => _306.cache]);
13533
- const headers = _optionalChain([rule, 'optionalAccess', _307 => _307.headers]);
13624
+ const swr = _optionalChain([rule, 'optionalAccess', _307 => _307.swr]);
13625
+ const cache = _optionalChain([rule, 'optionalAccess', _308 => _308.cache]);
13626
+ const headers = _optionalChain([rule, 'optionalAccess', _309 => _309.headers]);
13534
13627
  return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
13535
13628
  });
13536
13629
  }
@@ -13543,10 +13636,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
13543
13636
  const nitroBuilder = nitroBuilderResult.value;
13544
13637
  const isVercel = preset === "vercel";
13545
13638
  const isCloudflareWorker = preset === "cloudflare-module";
13546
- const outputDir = _chunkLVGB5PYKcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
13639
+ const outputDir = _chunkMOGRRZMWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
13547
13640
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
13548
13641
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
13549
- const imageRuntime = _chunkX4TSMQWFcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
13642
+ const imageRuntime = _chunkCL7BUGVBcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
13550
13643
  const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
13551
13644
  (image) => image.sourceType === "module"
13552
13645
  );
@@ -13568,10 +13661,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
13568
13661
  _chunk7U4XF76Rcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
13569
13662
  _chunk7U4XF76Rcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
13570
13663
  const ssgCollectionPromise = routeManager.collectSSGPages();
13571
- const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkQMR2TUVZcjs.getFarmAppDirectories.call(void 0, config));
13664
+ const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config));
13572
13665
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
13573
13666
  const docsPrerenderPagesPromise = getFarmDocsPrerenderPages(config, root, preset);
13574
- const farmWorkflows = await _chunkGBESKA76cjs.prepareFarmWorkflowsForNitro.call(void 0, config);
13667
+ const farmWorkflows = await _chunkBSX5OGSDcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
13575
13668
  const farmCron = await _chunk5ZHC6QGDcjs.prepareFarmCronForNitro.call(void 0, config);
13576
13669
  const [
13577
13670
  { ssg: ssgPages },
@@ -13602,7 +13695,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
13602
13695
  const edgeGuardedPrerenderRoutes = [];
13603
13696
  const addPrerenderRoute = (pathname) => {
13604
13697
  prerenderRoutes.push(pathname);
13605
- if (_chunkUWOCYINYcjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
13698
+ if (_chunkOFVCWV2Dcjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
13606
13699
  edgeGuardedPrerenderRoutes.push(pathname);
13607
13700
  }
13608
13701
  };
@@ -13693,7 +13786,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
13693
13786
  webEntry: clientJsSrc,
13694
13787
  webBoot: clientBootSrc,
13695
13788
  stylesheet: clientCssHref,
13696
- webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _308 => _308.files]), () => ( []))
13789
+ webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _310 => _310.files]), () => ( []))
13697
13790
  })
13698
13791
  ) : null;
13699
13792
  for (const output of Object.values(ssrBundle)) {
@@ -14016,7 +14109,7 @@ function toFarmNodeResponse(request, response) {
14016
14109
  varyFarmNitroCacheRules(_chunkIIHZ2BEEcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
14017
14110
  ...config.md.enabled ? ["accept"] : [],
14018
14111
  ...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : [],
14019
- ..._chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _309 => _309.experimental, 'optionalAccess', _310 => _310.serverComponents])) === "islands" ? ["f-layouts"] : []
14112
+ ..._chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _311 => _311.experimental, 'optionalAccess', _312 => _312.serverComponents])) === "islands" ? ["f-layouts"] : []
14020
14113
  ]),
14021
14114
  config.basePath,
14022
14115
  _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
@@ -14044,6 +14137,7 @@ function toFarmNodeResponse(request, response) {
14044
14137
  ];
14045
14138
  })
14046
14139
  );
14140
+ if (preset === "node-server") await writeFarmClientBrotliAssets(clientOutputDir);
14047
14141
  const immutableAssets = isVercel ? { publicAssets: [], routeRules: {} } : planFarmImmutableAssets({
14048
14142
  clientOutputDir,
14049
14143
  files: await listFarmClientOutputFiles(clientOutputDir),
@@ -14077,11 +14171,13 @@ function toFarmNodeResponse(request, response) {
14077
14171
  // Nitro gives the root directory no Cache-Control on any preset (it falls through to the
14078
14172
  // app), so public files keep revalidating; the hashed directories carry their own maxAge.
14079
14173
  publicAssets: [{ dir: clientOutputDir, baseURL: "/" }, ...immutableAssets.publicAssets],
14080
- // A self-hosted Node server sends static files itself, so precompress them
14081
- // with gzip and let Nitro serve that by Accept-Encoding. Brotli at Nitro's
14082
- // fixed top quality cost a docs app ~20 s of build CPU for a small further
14083
- // saving. Serverless and edge targets sit behind a CDN that compresses.
14084
- ...preset === "node-server" ? { compressPublicAssets: { gzip: true } } : {},
14174
+ // A self-hosted Node or Bun server sends static files itself, so precompress
14175
+ // them with gzip and let Nitro serve that by Accept-Encoding. Brotli at Nitro's
14176
+ // fixed top quality on every file cost a docs app ~20 s of build CPU, so only
14177
+ // client scripts and stylesheets get a brotli copy, on node-server
14178
+ // (writeFarmClientBrotliAssets). Serverless and edge targets sit behind a CDN
14179
+ // that compresses.
14180
+ ...preset === "node-server" || preset === "bun" ? { compressPublicAssets: { gzip: true } } : {},
14085
14181
  // Nitro gzips every server output file at level 9, node_modules included, to
14086
14182
  // print sizes after the build. A self-hosted server is never shipped compressed,
14087
14183
  // so list plain sizes; zipped serverless and edge bundles keep the gzip column.
@@ -14177,22 +14273,22 @@ function toFarmNodeResponse(request, response) {
14177
14273
  snapshotSSRRebundleOptions(nitroConfig)
14178
14274
  );
14179
14275
  const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
14180
- const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _311 => _311.rollupConfig, 'optionalAccess', _312 => _312.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _313 => _313.rollupConfig, 'optionalAccess', _314 => _314.plugins])) && customRollupKeys.length === 0 && Boolean(
14181
- _optionalChain([nitroConfig, 'access', _315 => _315.handlers, 'optionalAccess', _316 => _316.some, 'call', _317 => _317(
14182
- (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _318 => _318.handler]) || "") === nitroEntryPath
14276
+ const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _313 => _313.rollupConfig, 'optionalAccess', _314 => _314.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _315 => _315.rollupConfig, 'optionalAccess', _316 => _316.plugins])) && customRollupKeys.length === 0 && Boolean(
14277
+ _optionalChain([nitroConfig, 'access', _317 => _317.handlers, 'optionalAccess', _318 => _318.some, 'call', _319 => _319(
14278
+ (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _320 => _320.handler]) || "") === nitroEntryPath
14183
14279
  )])
14184
14280
  );
14185
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _319 => _319.output, 'optionalAccess', _320 => _320.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
14281
+ const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _321 => _321.output, 'optionalAccess', _322 => _322.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
14186
14282
  const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
14187
14283
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
14188
14284
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
14189
14285
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
14190
14286
  const shouldMinify = nitroConfig.minify !== false;
14191
- const keepServerNames = !(_optionalChain([config, 'access', _321 => _321.docs, 'optionalAccess', _322 => _322.enabled]) && _optionalChain([config, 'access', _323 => _323.docs, 'access', _324 => _324.adapter, 'optionalAccess', _325 => _325.server]));
14287
+ const keepServerNames = !(_optionalChain([config, 'access', _323 => _323.docs, 'optionalAccess', _324 => _324.enabled]) && _optionalChain([config, 'access', _325 => _325.docs, 'access', _326 => _326.adapter, 'optionalAccess', _327 => _327.server]));
14192
14288
  const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
14193
14289
  const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
14194
14290
  const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
14195
- const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _326 => _326.rollupConfig, 'optionalAccess', _327 => _327.plugins]);
14291
+ const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _328 => _328.rollupConfig, 'optionalAccess', _329 => _329.plugins]);
14196
14292
  nitroConfig.rollupConfig = {
14197
14293
  ...nitroConfig.rollupConfig,
14198
14294
  plugins: [
@@ -14231,7 +14327,7 @@ function toFarmNodeResponse(request, response) {
14231
14327
  let skippedNonHtmlPrerenderRoute = false;
14232
14328
  nitroInstance.hooks.hook("prerender:generate", (route) => {
14233
14329
  if (route.error || !prerenderPagePaths.has(route.route)) return;
14234
- if (_optionalChain([route, 'access', _328 => _328.contentType, 'optionalAccess', _329 => _329.toLowerCase, 'call', _330 => _330(), 'access', _331 => _331.includes, 'call', _332 => _332("html")])) return;
14330
+ if (_optionalChain([route, 'access', _330 => _330.contentType, 'optionalAccess', _331 => _331.toLowerCase, 'call', _332 => _332(), 'access', _333 => _333.includes, 'call', _334 => _334("html")])) return;
14235
14331
  route.skip = true;
14236
14332
  skippedNonHtmlPrerenderRoute = true;
14237
14333
  const configuredRule = configuredNitroRouteRules[route.route];
@@ -14242,9 +14338,9 @@ function toFarmNodeResponse(request, response) {
14242
14338
  nitroInstance.hooks.hook("prerender:done", () => {
14243
14339
  if (skippedNonHtmlPrerenderRoute) nitroInstance.routing.sync();
14244
14340
  });
14245
- if (_optionalChain([config, 'access', _333 => _333.md, 'optionalAccess', _334 => _334.enabled])) {
14341
+ if (_optionalChain([config, 'access', _335 => _335.md, 'optionalAccess', _336 => _336.enabled])) {
14246
14342
  nitroInstance.hooks.hook("prerender:generate", (route) => {
14247
- if (!route.contents || !_optionalChain([route, 'access', _335 => _335.contentType, 'optionalAccess', _336 => _336.toLowerCase, 'call', _337 => _337(), 'access', _338 => _338.includes, 'call', _339 => _339("html")])) return;
14343
+ if (!route.contents || !_optionalChain([route, 'access', _337 => _337.contentType, 'optionalAccess', _338 => _338.toLowerCase, 'call', _339 => _339(), 'access', _340 => _340.includes, 'call', _341 => _341("html")])) return;
14248
14344
  const alternatePath = _chunk2NOHVIJ3cjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
14249
14345
  routePathname: (pathname) => routeManager.toRoutePathname(pathname)
14250
14346
  });
@@ -14267,7 +14363,7 @@ function toFarmNodeResponse(request, response) {
14267
14363
  }
14268
14364
  if (config.security.csp && config.security.csp.nonce) {
14269
14365
  nitroInstance.hooks.hook("prerender:generate", async (route) => {
14270
- if (!route.contents || !_optionalChain([route, 'access', _340 => _340.contentType, 'optionalAccess', _341 => _341.toLowerCase, 'call', _342 => _342(), 'access', _343 => _343.includes, 'call', _344 => _344("html")])) return;
14366
+ if (!route.contents || !_optionalChain([route, 'access', _342 => _342.contentType, 'optionalAccess', _343 => _343.toLowerCase, 'call', _344 => _344(), 'access', _345 => _345.includes, 'call', _346 => _346("html")])) return;
14271
14367
  const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
14272
14368
  if (!staticCsp) return;
14273
14369
  route.contents = staticCsp.html;
@@ -14303,7 +14399,7 @@ function toFarmNodeResponse(request, response) {
14303
14399
  await nitroBuilder.copyPublicAssets(nitroInstance);
14304
14400
  if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
14305
14401
  nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
14306
- const configuredPlugins = _optionalChain([prerendererConfig, 'access', _345 => _345.rollupConfig, 'optionalAccess', _346 => _346.plugins]);
14402
+ const configuredPlugins = _optionalChain([prerendererConfig, 'access', _347 => _347.rollupConfig, 'optionalAccess', _348 => _348.plugins]);
14307
14403
  const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
14308
14404
  prerendererConfig.rollupConfig = {
14309
14405
  ...prerendererConfig.rollupConfig,
@@ -14360,13 +14456,13 @@ function toFarmNodeResponse(request, response) {
14360
14456
  }
14361
14457
  if (prerenderRoutes.length > 0) {
14362
14458
  _chunk7U4XF76Rcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
14363
- const previousPrerender = process.env[_chunkANZLZNNXcjs.FARM_PRERENDER_ENV];
14364
- process.env[_chunkANZLZNNXcjs.FARM_PRERENDER_ENV] = "1";
14459
+ const previousPrerender = process.env[_chunkW6C3LEXXcjs.FARM_PRERENDER_ENV];
14460
+ process.env[_chunkW6C3LEXXcjs.FARM_PRERENDER_ENV] = "1";
14365
14461
  try {
14366
14462
  await nitroBuilder.prerender(nitroInstance);
14367
14463
  } finally {
14368
- if (previousPrerender === void 0) delete process.env[_chunkANZLZNNXcjs.FARM_PRERENDER_ENV];
14369
- else process.env[_chunkANZLZNNXcjs.FARM_PRERENDER_ENV] = previousPrerender;
14464
+ if (previousPrerender === void 0) delete process.env[_chunkW6C3LEXXcjs.FARM_PRERENDER_ENV];
14465
+ else process.env[_chunkW6C3LEXXcjs.FARM_PRERENDER_ENV] = previousPrerender;
14370
14466
  }
14371
14467
  }
14372
14468
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs5, preset) : Promise.resolve(null);
@@ -14543,7 +14639,7 @@ async function moveVercelOutputPath(src, dest, fs5) {
14543
14639
  await fs5.rename(src, dest);
14544
14640
  return;
14545
14641
  } catch (error) {
14546
- const code = _optionalChain([error, 'optionalAccess', _347 => _347.code]);
14642
+ const code = _optionalChain([error, 'optionalAccess', _349 => _349.code]);
14547
14643
  if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
14548
14644
  throw error;
14549
14645
  }
@@ -14569,7 +14665,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
14569
14665
  try {
14570
14666
  await moveVercelOutputPath(publicDir, staticDir, fs5);
14571
14667
  } catch (error) {
14572
- if (_optionalChain([error, 'optionalAccess', _348 => _348.code]) !== "ENOENT") throw error;
14668
+ if (_optionalChain([error, 'optionalAccess', _350 => _350.code]) !== "ENOENT") throw error;
14573
14669
  }
14574
14670
  await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5);
14575
14671
  await copyPrismaClientForVercel(root, nitroFuncDir, fs5);
@@ -14583,7 +14679,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
14583
14679
  config.basePath
14584
14680
  );
14585
14681
  const edgeMiddlewareRoutes = edgeMiddleware.middlewareRoutes.filter(
14586
- (route) => edgeMiddleware.guardedPages.some((pathname) => _chunkUWOCYINYcjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
14682
+ (route) => edgeMiddleware.guardedPages.some((pathname) => _chunkOFVCWV2Dcjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
14587
14683
  );
14588
14684
  if (edgeMiddlewareRoutes.length > 0) {
14589
14685
  await writeFarmVercelEdgeMiddlewareFunction({
@@ -14602,7 +14698,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
14602
14698
  middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? createFarmVercelEdgeMiddlewareRoutes(edgeMiddleware.guardedPages, config.basePath) : [],
14603
14699
  canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages)
14604
14700
  });
14605
- const vercelConfigWithWorkflowCrons = _chunkGBESKA76cjs.applyFarmWorkflowVercelCrons.call(void 0,
14701
+ const vercelConfigWithWorkflowCrons = _chunkBSX5OGSDcjs.applyFarmWorkflowVercelCrons.call(void 0,
14606
14702
  vercelConfig,
14607
14703
  farmWorkflows.workflows
14608
14704
  );
@@ -14611,7 +14707,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
14611
14707
  _chunk7U4XF76Rcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
14612
14708
  }
14613
14709
  async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5) {
14614
- if (!_optionalChain([config, 'access', _349 => _349.docs, 'optionalAccess', _350 => _350.enabled])) return;
14710
+ if (!_optionalChain([config, 'access', _351 => _351.docs, 'optionalAccess', _352 => _352.enabled])) return;
14615
14711
  const [mainRoot, ...extraRoots] = _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs);
14616
14712
  await copyFarmDocsRootContent(
14617
14713
  mainRoot,
@@ -14636,7 +14732,7 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
14636
14732
  const lastModifiedManifest = _chunkHR5GU4UUcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
14637
14733
  fallback: "now"
14638
14734
  });
14639
- const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _351 => _351.unknown, 'optionalAccess', _352 => _352.length]), () => ( 0));
14735
+ const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _353 => _353.unknown, 'optionalAccess', _354 => _354.length]), () => ( 0));
14640
14736
  if (undatedPages > 0) {
14641
14737
  _chunk7U4XF76Rcjs.logger.warn(
14642
14738
  `${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
@@ -14721,7 +14817,7 @@ async function stageSharpRuntime(config, root, distDir, fs5, preset) {
14721
14817
  try {
14722
14818
  await copyPackage("sharp", sharpRequire);
14723
14819
  if (!copiedPackages.has("sharp")) {
14724
- throw new Error(`Farm image optimization requires sharp. ${_chunkX4TSMQWFcjs.SHARP_INSTALL_HINT}`);
14820
+ throw new Error(`Farm image optimization requires sharp. ${_chunkCL7BUGVBcjs.SHARP_INSTALL_HINT}`);
14725
14821
  }
14726
14822
  } catch (error) {
14727
14823
  await fs5.rm(stageDir, { recursive: true, force: true });
@@ -14922,9 +15018,9 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs5) {
14922
15018
  };
14923
15019
  await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs5);
14924
15020
  }
14925
- function islandsActionKeyCode() {
15021
+ function islandsActionKeyCode(runtimeModule) {
14926
15022
  const key = _crypto.randomBytes.call(void 0, 32).toString("base64url");
14927
- return `import { setBuildDefaults as __farmIslxBuildDefaults } from "@farm.js/core/internal/islx-server";
15023
+ return `import { setBuildDefaults as __farmIslxBuildDefaults } from ${JSON.stringify(runtimeModule)};
14928
15024
  __farmIslxBuildDefaults({ key: ${JSON.stringify(key)} });`;
14929
15025
  }
14930
15026
 
@@ -14954,7 +15050,7 @@ async function createFarmProjectModuleSsrEnvironment() {
14954
15050
  // src/build/index.ts
14955
15051
  async function build(config, options = {}) {
14956
15052
  return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
14957
- () => _chunkZVSQN7NCcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
15053
+ () => _chunk46UV2E7Icjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
14958
15054
  );
14959
15055
  }
14960
15056
  function createBuildTargetBaseline(config) {
@@ -14965,7 +15061,7 @@ function createBuildTargetBaseline(config) {
14965
15061
  preset,
14966
15062
  distDir,
14967
15063
  outputDir,
14968
- outputWasDerived: outputDir === _chunkLVGB5PYKcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
15064
+ outputWasDerived: outputDir === _chunkMOGRRZMWcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
14969
15065
  };
14970
15066
  }
14971
15067
  function resolveBuildTargets(config, options, baseline) {
@@ -14974,8 +15070,8 @@ function resolveBuildTargets(config, options, baseline) {
14974
15070
  const distDir = config.distDir || ".farm";
14975
15071
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
14976
15072
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
14977
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkLVGB5PYKcjs.getDeployTargetForPreset.call(void 0, preset);
14978
- const outputDir = shouldRefreshDerivedOutput ? _chunkLVGB5PYKcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
15073
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkMOGRRZMWcjs.getDeployTargetForPreset.call(void 0, preset);
15074
+ const outputDir = shouldRefreshDerivedOutput ? _chunkMOGRRZMWcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
14979
15075
  return {
14980
15076
  root,
14981
15077
  preset,
@@ -14983,7 +15079,7 @@ function resolveBuildTargets(config, options, baseline) {
14983
15079
  distDir,
14984
15080
  deployTarget,
14985
15081
  outputDir,
14986
- deployOutputDir: _chunkLVGB5PYKcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
15082
+ deployOutputDir: _chunkMOGRRZMWcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
14987
15083
  };
14988
15084
  }
14989
15085
  async function buildWithProductionNodeEnv(inputConfig, options) {
@@ -15020,15 +15116,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
15020
15116
  };
15021
15117
  config = {
15022
15118
  ...config,
15023
- images: _chunkX4TSMQWFcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
15119
+ images: _chunkCL7BUGVBcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
15024
15120
  root: targets.root,
15025
15121
  preset: targets.preset
15026
15122
  })
15027
15123
  };
15028
- if (_optionalChain([config, 'access', _353 => _353.docs, 'optionalAccess', _354 => _354.enabled])) await _chunkNDOE76QCcjs.loadFarmDocsEngine.call(void 0, );
15124
+ if (_optionalChain([config, 'access', _355 => _355.docs, 'optionalAccess', _356 => _356.enabled])) await _chunkNDOE76QCcjs.loadFarmDocsEngine.call(void 0, );
15029
15125
  pluginManager.updateContext({ config });
15030
15126
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
15031
- _chunkZVSQN7NCcjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkZVSQN7NCcjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
15127
+ _chunk46UV2E7Icjs.usePackageClientBoundaryCacheFile.call(void 0, _chunk46UV2E7Icjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
15032
15128
  _chunk7U4XF76Rcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
15033
15129
  await pluginManager.setupPlugins();
15034
15130
  await pluginManager.runHookParallel("beforeBundle", {
@@ -15040,8 +15136,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
15040
15136
  });
15041
15137
  _chunk7U4XF76Rcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
15042
15138
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
15043
- if (_optionalChain([productionViteResult, 'optionalAccess', _355 => _355.status]) === "rejected") throw productionViteResult.reason;
15044
- const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _356 => _356.value]);
15139
+ if (_optionalChain([productionViteResult, 'optionalAccess', _357 => _357.status]) === "rejected") throw productionViteResult.reason;
15140
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _358 => _358.value]);
15045
15141
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
15046
15142
  projectModuleServer = await createProjectModuleServer(
15047
15143
  createViteServer,
@@ -15049,19 +15145,19 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
15049
15145
  root,
15050
15146
  rendererBuild.signal
15051
15147
  );
15052
- const farmApp = _chunkX4TSMQWFcjs.createFarmApp.call(void 0, config, projectModuleServer);
15148
+ const farmApp = _chunkCL7BUGVBcjs.createFarmApp.call(void 0, config, projectModuleServer);
15053
15149
  if (options.universal !== false) farmApp.getRouteManager().keepBuildSourceSnapshot();
15054
15150
  await farmApp.initialize();
15055
15151
  const routeManager = farmApp.getRouteManager();
15056
15152
  const serverRenderer = farmApp.getServerRenderer();
15057
- const typeArtifacts = _chunkSDICLSQUcjs.generateFarmTypeArtifacts.call(void 0, {
15153
+ const typeArtifacts = _chunkOUDNUFVRcjs.generateFarmTypeArtifacts.call(void 0, {
15058
15154
  root,
15059
15155
  srcDir,
15060
15156
  layers: config.layers,
15061
15157
  storage: config.storage,
15062
15158
  plugins: config.plugins,
15063
15159
  extraRoutes: [
15064
- ..._optionalChain([config, 'access', _357 => _357.openapi, 'optionalAccess', _358 => _358.enabled]) && config.openapi.route ? [config.openapi.route] : [],
15160
+ ..._optionalChain([config, 'access', _359 => _359.openapi, 'optionalAccess', _360 => _360.enabled]) && config.openapi.route ? [config.openapi.route] : [],
15065
15161
  ..._chunkHR5GU4UUcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
15066
15162
  ],
15067
15163
  suppressLintOnLink: config.suppressLintOnLink,
@@ -15071,8 +15167,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
15071
15167
  const message = error instanceof Error ? error.message : String(error);
15072
15168
  _chunk7U4XF76Rcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
15073
15169
  });
15074
- const apiRouteManager = new (0, _chunkMQOHYV6Lcjs.APIRouteManager)(
15075
- _chunkQMR2TUVZcjs.getFarmAppDirectories.call(void 0, config),
15170
+ const apiRouteManager = new (0, _chunkLKIG5SM6cjs.APIRouteManager)(
15171
+ _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config),
15076
15172
  projectModuleServer,
15077
15173
  {
15078
15174
  throwOnLoadError: true,
@@ -15146,19 +15242,19 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
15146
15242
  throw error;
15147
15243
  } finally {
15148
15244
  try {
15149
- await _optionalChain([projectModuleServer, 'optionalAccess', _359 => _359.close, 'call', _360 => _360()]);
15245
+ await _optionalChain([projectModuleServer, 'optionalAccess', _361 => _361.close, 'call', _362 => _362()]);
15150
15246
  } finally {
15151
15247
  rendererBuild.abort();
15152
15248
  }
15153
15249
  }
15154
15250
  }
15155
15251
  async function createProjectModuleServer(createViteServer, config, root, buildLifetime) {
15156
- const { farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
15157
- const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
15252
+ const { farmNavigationPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
15253
+ const rendererVitePlugins = await _chunkM6DAIE4Tcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
15158
15254
  ssr: true,
15159
15255
  buildLifetime
15160
15256
  });
15161
- const viteConfig = _chunkX4TSMQWFcjs.mergeFarmViteConfig.call(void 0,
15257
+ const viteConfig = _chunkCL7BUGVBcjs.mergeFarmViteConfig.call(void 0,
15162
15258
  {
15163
15259
  root,
15164
15260
  appType: "custom",
@@ -15170,12 +15266,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
15170
15266
  },
15171
15267
  plugins: [
15172
15268
  ...rendererVitePlugins,
15173
- _chunkX4TSMQWFcjs.farmFontImportsPlugin.call(void 0, {
15269
+ _chunkCL7BUGVBcjs.farmFontImportsPlugin.call(void 0, {
15174
15270
  root,
15175
15271
  basePath: config.basePath,
15176
15272
  publicDir: config.publicDir
15177
15273
  }),
15178
- _chunkZVSQN7NCcjs.farmEnvironmentFunctionsPlugin.call(void 0, { renderer: config.renderer }),
15274
+ _chunk46UV2E7Icjs.farmEnvironmentFunctionsPlugin.call(void 0, { renderer: config.renderer }),
15179
15275
  // Route modules load here at build time (rendering config, prerendering): `server-only`
15180
15276
  // resolves as it does in the server build. Module-entry packages load pre-bundled, as in
15181
15277
  // `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
@@ -15183,14 +15279,15 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
15183
15279
  farmServerOnlyEntriesPlugin({
15184
15280
  prebundleServerPackages: true,
15185
15281
  distDir: config.distDir || ".farm"
15186
- })
15282
+ }),
15283
+ farmNavigationPlugin(config.renderer)
15187
15284
  ],
15188
15285
  server: {
15189
15286
  middlewareMode: true,
15190
15287
  hmr: false
15191
15288
  },
15192
15289
  resolve: {
15193
- alias: _chunkX4TSMQWFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
15290
+ alias: _chunkCL7BUGVBcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
15194
15291
  dedupe: [...config.renderer.dedupe || []]
15195
15292
  },
15196
15293
  optimizeDeps: {
@@ -15229,10 +15326,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
15229
15326
  noDiscovery: true
15230
15327
  },
15231
15328
  // An app or plugin that brings its own SSR environment keeps it.
15232
- environments: _optionalChain([viteConfig, 'access', _361 => _361.environments, 'optionalAccess', _362 => _362.ssr, 'optionalAccess', _363 => _363.dev, 'optionalAccess', _364 => _364.createEnvironment]) ? viteConfig.environments : {
15329
+ environments: _optionalChain([viteConfig, 'access', _363 => _363.environments, 'optionalAccess', _364 => _364.ssr, 'optionalAccess', _365 => _365.dev, 'optionalAccess', _366 => _366.createEnvironment]) ? viteConfig.environments : {
15233
15330
  ...viteConfig.environments,
15234
15331
  ssr: {
15235
- ..._optionalChain([viteConfig, 'access', _365 => _365.environments, 'optionalAccess', _366 => _366.ssr]),
15332
+ ..._optionalChain([viteConfig, 'access', _367 => _367.environments, 'optionalAccess', _368 => _368.ssr]),
15236
15333
  ...await createFarmProjectModuleSsrEnvironment()
15237
15334
  }
15238
15335
  }
@@ -15242,6 +15339,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
15242
15339
  const {
15243
15340
  farmI18nClientBridgePlugin,
15244
15341
  farmIslandContainersPlugin,
15342
+ farmNavigationPlugin,
15245
15343
  farmPlugin,
15246
15344
  farmServerOnlyEntriesPlugin
15247
15345
  } = await import("./vite.cjs");
@@ -15264,9 +15362,10 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
15264
15362
  plugins: [
15265
15363
  farmI18nClientBridgePlugin(),
15266
15364
  farmServerOnlyEntriesPlugin({ distDir: config.distDir || ".farm" }),
15365
+ farmNavigationPlugin(config.renderer),
15267
15366
  farmIslandContainersPlugin(config),
15268
15367
  farmPlugin(config, pluginManager),
15269
- _chunkZVSQN7NCcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
15368
+ _chunk46UV2E7Icjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
15270
15369
  ],
15271
15370
  mode: "production"
15272
15371
  });
@@ -15294,20 +15393,20 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
15294
15393
  define: {
15295
15394
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
15296
15395
  __FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
15297
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _367 => _367.env, 'optionalAccess', _368 => _368.public]) || {})
15396
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _369 => _369.env, 'optionalAccess', _370 => _370.public]) || {})
15298
15397
  },
15299
15398
  plugins: [
15300
15399
  farmI18nClientBridgePlugin(),
15301
15400
  farmIslandContainersPlugin(config),
15302
15401
  farmPlugin(config, pluginManager),
15303
- _chunkZVSQN7NCcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
15402
+ _chunk46UV2E7Icjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
15304
15403
  ],
15305
15404
  mode: "production"
15306
15405
  });
15307
15406
  }
15308
15407
  function resolveLegacyPageEntry(config, root, srcDir) {
15309
15408
  const appDir = _path2.default.join(root, srcDir, "app");
15310
- for (const extension of _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer)) {
15409
+ for (const extension of _chunkM6DAIE4Tcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer)) {
15311
15410
  const candidate = _path2.default.join(appDir, `page${extension}`);
15312
15411
  if (_fs.existsSync.call(void 0, candidate)) return candidate;
15313
15412
  }
@@ -15315,7 +15414,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
15315
15414
  }
15316
15415
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
15317
15416
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
15318
- import("./nitro-6UOJXJZ6.cjs"),
15417
+ import("./nitro-XGIO6EQN.cjs"),
15319
15418
  import("nitro/builder")
15320
15419
  ]);
15321
15420
  let nitroConfig = await createNitroConfig(
@@ -15328,7 +15427,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
15328
15427
  if (pluginManager) {
15329
15428
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
15330
15429
  }
15331
- const outputDir = _chunkLVGB5PYKcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
15430
+ const outputDir = _chunkMOGRRZMWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
15332
15431
  const serverOutputDir = _path2.default.join(outputDir, "server");
15333
15432
  const publicOutputDir = _path2.default.join(outputDir, "public");
15334
15433
  const { mkdir, cp } = await import("fs/promises");
@@ -15384,8 +15483,8 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
15384
15483
  farmRegistry.routePaths = routePaths;
15385
15484
  try {
15386
15485
  const clientManifestPath = _path2.default.join(root, distDir, "client", "farm-client-manifest.json");
15387
- const { readFile } = await import("fs/promises");
15388
- const manifestContent = await readFile(clientManifestPath, "utf-8");
15486
+ const { readFile: readFile2 } = await import("fs/promises");
15487
+ const manifestContent = await readFile2(clientManifestPath, "utf-8");
15389
15488
  farmRegistry.clientManifest = JSON.parse(manifestContent);
15390
15489
  } catch (e47) {
15391
15490
  farmRegistry.clientManifest = {};
@@ -15399,7 +15498,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
15399
15498
  root,
15400
15499
  preset,
15401
15500
  distDir,
15402
- outputDir: _chunkLVGB5PYKcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
15501
+ outputDir: _chunkMOGRRZMWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
15403
15502
  });
15404
15503
  }
15405
15504
  }