@farm.js/core 0.1.36 → 0.1.37

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 (234) hide show
  1. package/dist/{agent-mcp-BVExL8rZ.d.mts → agent-mcp-BC0bAGVF.d.mts} +1 -1
  2. package/dist/{agent-mcp-luzfXK-P.d.ts → agent-mcp-jyDHbQKe.d.ts} +1 -1
  3. package/dist/agent-runtime.cjs +3 -3
  4. package/dist/agent-runtime.d.mts +1 -1
  5. package/dist/agent-runtime.d.ts +1 -1
  6. package/dist/agent-runtime.mjs +2 -2
  7. package/dist/api/client.cjs +3 -3
  8. package/dist/api/client.mjs +2 -2
  9. package/dist/api/route-manager.cjs +6 -6
  10. package/dist/api/route-manager.d.mts +3 -3
  11. package/dist/api/route-manager.d.ts +3 -3
  12. package/dist/api/route-manager.mjs +5 -5
  13. package/dist/api/runtime.cjs +4 -4
  14. package/dist/api/runtime.d.mts +2 -2
  15. package/dist/api/runtime.d.ts +2 -2
  16. package/dist/api/runtime.mjs +3 -3
  17. package/dist/api.cjs +9 -8
  18. package/dist/api.d.mts +3 -3
  19. package/dist/api.d.ts +3 -3
  20. package/dist/api.mjs +8 -7
  21. package/dist/{app-Yfa2dsFy.d.ts → app-CKO3iN1c.d.ts} +3 -3
  22. package/dist/{app-BukwkFIu.d.mts → app-Cbkj9ufe.d.mts} +3 -3
  23. package/dist/app-markdown.cjs +5 -3
  24. package/dist/app-markdown.d.mts +3 -3
  25. package/dist/app-markdown.d.ts +3 -3
  26. package/dist/app-markdown.mjs +4 -2
  27. package/dist/{chunk-UVW64BCB.cjs → chunk-3A4KGQYI.cjs} +2 -2
  28. package/dist/{chunk-AO6RYU5N.cjs → chunk-3IP27TCG.cjs} +30 -22
  29. package/dist/{chunk-FDR64H6B.mjs → chunk-3KGDJLJK.mjs} +41 -2
  30. package/dist/{chunk-KXWRO25S.cjs → chunk-4GPOC4LN.cjs} +3 -3
  31. package/dist/{chunk-Z2HLU4IX.cjs → chunk-4GWRFP22.cjs} +23 -2
  32. package/dist/{chunk-276VJSM6.mjs → chunk-4P6ULFMD.mjs} +43 -30
  33. package/dist/{chunk-BPMATOP2.cjs → chunk-5BXGGEC7.cjs} +25 -20
  34. package/dist/{chunk-JNUWCDTF.cjs → chunk-5D2JIPLH.cjs} +2 -2
  35. package/dist/{chunk-AHGECQEW.mjs → chunk-666CKENS.mjs} +1 -1
  36. package/dist/{chunk-BO36SELV.cjs → chunk-6LGFV2CQ.cjs} +2 -2
  37. package/dist/{chunk-2YTDKNH3.cjs → chunk-6TJITR2B.cjs} +192 -120
  38. package/dist/{chunk-JZVADIOD.cjs → chunk-75X755YZ.cjs} +2 -2
  39. package/dist/{chunk-VQLJWDVW.cjs → chunk-7DWNJI73.cjs} +2 -2
  40. package/dist/{chunk-N2NAS2AM.cjs → chunk-7O5M4UKW.cjs} +2 -2
  41. package/dist/{chunk-BJPBQNIE.cjs → chunk-7SQ5SGYZ.cjs} +2 -2
  42. package/dist/{chunk-27ZWSI3W.cjs → chunk-ADOAUDQ6.cjs} +2 -2
  43. package/dist/{chunk-YKX5BK66.cjs → chunk-ATWHHSY2.cjs} +7 -7
  44. package/dist/{chunk-42NHY7HW.cjs → chunk-B5PFZLKV.cjs} +40 -9
  45. package/dist/{chunk-FNO7A7CM.cjs → chunk-BHY547NB.cjs} +34 -16
  46. package/dist/{chunk-4GLOOWKE.mjs → chunk-CQMVIOYP.mjs} +1 -1
  47. package/dist/{chunk-D2BB47NB.cjs → chunk-CVH2BXPY.cjs} +6 -6
  48. package/dist/{chunk-TKSCR644.cjs → chunk-D3C5LBQY.cjs} +2 -2
  49. package/dist/{chunk-PZNL3WEG.mjs → chunk-DMEPTZTI.mjs} +22 -11
  50. package/dist/{chunk-GQ3Z3IZI.cjs → chunk-EMMQ64QW.cjs} +18 -18
  51. package/dist/{chunk-OHLSEQ57.mjs → chunk-EXG5LD6B.mjs} +1 -1
  52. package/dist/{chunk-WZ77PUAM.mjs → chunk-FBOJ55OM.mjs} +1 -1
  53. package/dist/{chunk-OTC5BDGO.mjs → chunk-FGRYBX5X.mjs} +12 -7
  54. package/dist/{chunk-D227TIEN.cjs → chunk-FWE7LEQC.cjs} +13 -13
  55. package/dist/{chunk-3BU22U3M.cjs → chunk-G2TEB74S.cjs} +5 -2
  56. package/dist/{chunk-O6I6VWKK.mjs → chunk-HEVMCTSR.mjs} +1 -1
  57. package/dist/{chunk-W7LF2J2S.mjs → chunk-HMRSWN47.mjs} +1 -1
  58. package/dist/{chunk-JG6DJF5A.mjs → chunk-HZFM2LWQ.mjs} +22 -1
  59. package/dist/{chunk-35GKZR22.mjs → chunk-IAIYV4RZ.mjs} +1 -1
  60. package/dist/{chunk-F2SE2VDO.mjs → chunk-IHQIOZLC.mjs} +1 -1
  61. package/dist/{chunk-2NNMOPDN.mjs → chunk-J3ANCZKA.mjs} +4 -1
  62. package/dist/{chunk-C4SPBWFM.cjs → chunk-JEZO6VUR.cjs} +10 -1
  63. package/dist/{chunk-SC2WYWPF.mjs → chunk-JPNFPAZ4.mjs} +3 -3
  64. package/dist/{chunk-HOXTWRGB.mjs → chunk-K3SAEIM3.mjs} +5 -2
  65. package/dist/{chunk-35WV46VL.mjs → chunk-K4I4O5TS.mjs} +98 -26
  66. package/dist/{chunk-KN7K4VQN.mjs → chunk-KDTBF3UU.mjs} +1 -1
  67. package/dist/{chunk-QORUJDIV.mjs → chunk-KPFKMDM7.mjs} +2 -2
  68. package/dist/{chunk-YSCV4SJF.cjs → chunk-L5H2GSUC.cjs} +4 -4
  69. package/dist/{chunk-YDQZGSDS.mjs → chunk-LBDP3YT3.mjs} +1 -1
  70. package/dist/{chunk-LSZAVSGY.mjs → chunk-LBGILORX.mjs} +1 -1
  71. package/dist/{chunk-ADEA7PN3.cjs → chunk-LOFKRKO7.cjs} +2 -2
  72. package/dist/{chunk-ZWM5KGAA.cjs → chunk-LPFV45AY.cjs} +23 -20
  73. package/dist/{chunk-3KZS4SUS.mjs → chunk-MCIZVNOQ.mjs} +1 -1
  74. package/dist/{chunk-XCMCS4DA.mjs → chunk-ND2CWPOD.mjs} +2 -2
  75. package/dist/{chunk-S6VYG6XU.cjs → chunk-NDILNQ4L.cjs} +2 -2
  76. package/dist/{chunk-BPOF5U4N.mjs → chunk-NFMDCAOS.mjs} +10 -7
  77. package/dist/{chunk-UXFQ3UDA.cjs → chunk-NICDYKBS.cjs} +42 -3
  78. package/dist/{chunk-EZDQRNQ7.mjs → chunk-NNSAQX3U.mjs} +23 -5
  79. package/dist/{chunk-DZ5ZVB2K.cjs → chunk-NQ6QFZWD.cjs} +1 -1
  80. package/dist/{chunk-U4KT7QP3.cjs → chunk-OW67PDDS.cjs} +14 -1
  81. package/dist/{chunk-77GNHH2Z.cjs → chunk-PMQHMWZU.cjs} +3 -3
  82. package/dist/{chunk-NMHWYWDR.cjs → chunk-Q5FYSK45.cjs} +169 -156
  83. package/dist/{chunk-5SJWVY6R.mjs → chunk-QHSH7IH4.mjs} +9 -0
  84. package/dist/{chunk-EWET4D2Y.mjs → chunk-RRMVL6CJ.mjs} +3 -3
  85. package/dist/{chunk-IZY3V5XW.mjs → chunk-S3VWVTVA.mjs} +14 -1
  86. package/dist/{chunk-FFFW3OQ7.cjs → chunk-S6FJO323.cjs} +2 -2
  87. package/dist/chunk-SGBZPZUW.mjs +75 -0
  88. package/dist/{chunk-2ELDTQRN.mjs → chunk-TDNWPAVR.mjs} +1 -1
  89. package/dist/{chunk-IHNIDL6H.cjs → chunk-TO4GJ56K.cjs} +22 -11
  90. package/dist/{chunk-4WCZJQUO.mjs → chunk-TPLJVC7E.mjs} +37 -6
  91. package/dist/{chunk-NRSN7G7E.mjs → chunk-TW4GYDBJ.mjs} +1 -1
  92. package/dist/{chunk-FO427P6I.cjs → chunk-U6MPZ35Q.cjs} +10 -10
  93. package/dist/{chunk-CBJJH36A.cjs → chunk-UJZLSXUB.cjs} +3 -3
  94. package/dist/chunk-UXHS27O6.cjs +75 -0
  95. package/dist/{chunk-DQQOKWYA.cjs → chunk-VR4GD5I3.cjs} +3 -3
  96. package/dist/{chunk-T4OGRVNS.mjs → chunk-VXAWRDK7.mjs} +2 -2
  97. package/dist/{chunk-4NU4GGTC.cjs → chunk-W2YDNK66.cjs} +6 -3
  98. package/dist/{chunk-GQRWBCWK.mjs → chunk-WQ7T2263.mjs} +13 -5
  99. package/dist/chunk-WRPHYQVY.mjs +109 -0
  100. package/dist/chunk-WT4TGLXT.cjs +109 -0
  101. package/dist/{chunk-4E5AEDKY.mjs → chunk-XOPOIFTJ.mjs} +1 -1
  102. package/dist/{chunk-OO7GXVSR.mjs → chunk-YCKO6FRS.mjs} +1 -1
  103. package/dist/{chunk-MKYBIIAQ.mjs → chunk-Z5BEWYVO.mjs} +1 -1
  104. package/dist/{chunk-VILIPRS6.mjs → chunk-Z7LA7MHQ.mjs} +1 -1
  105. package/dist/{client-plugins-r1mOtSC1.d.ts → client-plugins-C8DjftDF.d.ts} +14 -0
  106. package/dist/{client-plugins-C3mK9Pol.d.mts → client-plugins-CV4eJ9De.d.mts} +14 -0
  107. package/dist/client-plugins.d.mts +1 -1
  108. package/dist/client-plugins.d.ts +1 -1
  109. package/dist/client.cjs +8 -8
  110. package/dist/client.d.mts +5 -5
  111. package/dist/client.d.ts +5 -5
  112. package/dist/client.mjs +7 -7
  113. package/dist/config.d.mts +1 -1
  114. package/dist/config.d.ts +1 -1
  115. package/dist/{devtools-JZJJY5CK.cjs → devtools-JXFQNWSH.cjs} +4 -4
  116. package/dist/{devtools-ERIKFEXX.mjs → devtools-KVOY2TCZ.mjs} +3 -3
  117. package/dist/docs.cjs +5 -5
  118. package/dist/docs.d.mts +2 -2
  119. package/dist/docs.d.ts +2 -2
  120. package/dist/docs.mjs +4 -4
  121. package/dist/headers.cjs +4 -4
  122. package/dist/headers.mjs +3 -3
  123. package/dist/i18n/client.cjs +11 -11
  124. package/dist/i18n/client.mjs +3 -3
  125. package/dist/index.cjs +42 -39
  126. package/dist/index.d.mts +14 -14
  127. package/dist/index.d.ts +14 -14
  128. package/dist/index.mjs +41 -38
  129. package/dist/integrations.cjs +3 -3
  130. package/dist/integrations.d.mts +1 -1
  131. package/dist/integrations.d.ts +1 -1
  132. package/dist/integrations.mjs +2 -2
  133. package/dist/internal/app-markdown-runtime.cjs +4 -2
  134. package/dist/internal/app-markdown-runtime.d.mts +19 -5
  135. package/dist/internal/app-markdown-runtime.d.ts +19 -5
  136. package/dist/internal/app-markdown-runtime.mjs +3 -1
  137. package/dist/internal/build-runtime.cjs +25 -23
  138. package/dist/internal/build-runtime.d.mts +3 -3
  139. package/dist/internal/build-runtime.d.ts +3 -3
  140. package/dist/internal/build-runtime.mjs +24 -22
  141. package/dist/internal/cli-runtime.cjs +8 -8
  142. package/dist/internal/cli-runtime.mjs +7 -7
  143. package/dist/internal/client-error-overlay.cjs +4 -4
  144. package/dist/internal/client-error-overlay.mjs +1 -1
  145. package/dist/internal/client-runtime.cjs +2 -2
  146. package/dist/internal/client-runtime.mjs +1 -1
  147. package/dist/internal/compression-runtime.d.mts +1 -1
  148. package/dist/internal/compression-runtime.d.ts +1 -1
  149. package/dist/internal/config-runtime.cjs +4 -4
  150. package/dist/internal/config-runtime.d.mts +2 -2
  151. package/dist/internal/config-runtime.d.ts +2 -2
  152. package/dist/internal/config-runtime.mjs +3 -3
  153. package/dist/internal/infra-analytics-runtime.cjs +5 -5
  154. package/dist/internal/infra-analytics-runtime.mjs +3 -3
  155. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  156. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  157. package/dist/internal/production-runtime.cjs +15 -50
  158. package/dist/internal/production-runtime.d.mts +8 -8
  159. package/dist/internal/production-runtime.d.ts +8 -8
  160. package/dist/internal/production-runtime.mjs +11 -46
  161. package/dist/markdown.d.mts +1 -1
  162. package/dist/markdown.d.ts +1 -1
  163. package/dist/middleware.cjs +8 -8
  164. package/dist/middleware.d.mts +6 -4
  165. package/dist/middleware.d.ts +6 -4
  166. package/dist/middleware.mjs +7 -7
  167. package/dist/navigation.cjs +7 -7
  168. package/dist/navigation.d.mts +4 -4
  169. package/dist/navigation.d.ts +4 -4
  170. package/dist/navigation.mjs +6 -6
  171. package/dist/plugin.cjs +19 -18
  172. package/dist/plugin.d.mts +1 -1
  173. package/dist/plugin.d.ts +1 -1
  174. package/dist/plugin.mjs +18 -17
  175. package/dist/{production-runtime-DPnsggY3.d.ts → production-runtime-C2kkrPVZ.d.ts} +1 -1
  176. package/dist/{production-runtime-CCeVZXst.d.mts → production-runtime-Du_FHb2-.d.mts} +1 -1
  177. package/dist/query/client.cjs +9 -9
  178. package/dist/query/client.mjs +4 -4
  179. package/dist/{render-plan-Cw4f5E_R.d.ts → render-plan-BnnPTpus.d.ts} +1 -1
  180. package/dist/{render-plan-BuGaPFe6.d.mts → render-plan-Cgx7v8tJ.d.mts} +1 -1
  181. package/dist/renderer-client.cjs +12 -12
  182. package/dist/renderer-client.d.mts +3 -3
  183. package/dist/renderer-client.d.ts +3 -3
  184. package/dist/renderer-client.mjs +4 -4
  185. package/dist/{request-Bkg-hERy.d.ts → request-BNWr7r5e.d.ts} +1 -1
  186. package/dist/{request-CsGARcAw.d.mts → request-sKayKcop.d.mts} +1 -1
  187. package/dist/request.cjs +3 -3
  188. package/dist/request.d.mts +2 -2
  189. package/dist/request.d.ts +2 -2
  190. package/dist/request.mjs +2 -2
  191. package/dist/{route-rendering-BUZMH_64.d.ts → route-rendering-Bx4Auw6Q.d.ts} +1 -1
  192. package/dist/{route-rendering-f11yh5dp.d.mts → route-rendering-DWFp3Yq4.d.mts} +1 -1
  193. package/dist/{router-Cp6yRE8A.d.mts → router-BK6K42Ij.d.mts} +1 -1
  194. package/dist/{router-B8CR9GbD.d.ts → router-DnW_2tQi.d.ts} +1 -1
  195. package/dist/routes.cjs +2 -2
  196. package/dist/routes.d.mts +1 -1
  197. package/dist/routes.d.ts +1 -1
  198. package/dist/routes.mjs +1 -1
  199. package/dist/{runtime-CQVsT330.d.ts → runtime-CA3Ei5k_.d.ts} +1 -1
  200. package/dist/{runtime-CAEv36S_.d.mts → runtime-DJDaCMd_.d.mts} +1 -1
  201. package/dist/server-fn.cjs +3 -3
  202. package/dist/server-fn.mjs +2 -2
  203. package/dist/server-plugins.cjs +5 -5
  204. package/dist/server-plugins.d.mts +2 -2
  205. package/dist/server-plugins.d.ts +2 -2
  206. package/dist/server-plugins.mjs +4 -4
  207. package/dist/server-query.cjs +4 -4
  208. package/dist/server-query.mjs +3 -3
  209. package/dist/server.cjs +45 -44
  210. package/dist/server.d.mts +7 -7
  211. package/dist/server.d.ts +7 -7
  212. package/dist/server.mjs +23 -22
  213. package/dist/{spa-router-DwbqGkGj.d.mts → spa-router-D6fUA4Rn.d.mts} +2 -2
  214. package/dist/{spa-router-BuciWGCZ.d.ts → spa-router-Mwbd7g2L.d.ts} +2 -2
  215. package/dist/testing.cjs +8 -8
  216. package/dist/testing.d.mts +1 -1
  217. package/dist/testing.d.ts +1 -1
  218. package/dist/testing.mjs +6 -6
  219. package/dist/theme/server.cjs +4 -4
  220. package/dist/theme/server.mjs +3 -3
  221. package/dist/{utils-CaoWKtYM.d.ts → utils-BwVcAfUR.d.ts} +1 -1
  222. package/dist/{utils-B9V0S_yL.d.mts → utils-p9Hs-jCc.d.mts} +1 -1
  223. package/dist/version.cjs +2 -2
  224. package/dist/version.mjs +1 -1
  225. package/dist/vite.cjs +19 -18
  226. package/dist/vite.d.mts +1 -1
  227. package/dist/vite.d.ts +1 -1
  228. package/dist/vite.mjs +18 -17
  229. package/package.json +1 -1
  230. package/types/middleware.d.ts +5 -1
  231. package/dist/chunk-FXEF4PPL.mjs +0 -47
  232. package/dist/chunk-XD32KALF.cjs +0 -47
  233. /package/dist/{chunk-SJNMVDDF.cjs → chunk-FUCSUGDM.cjs} +0 -0
  234. /package/dist/{chunk-UDNPLXW7.mjs → chunk-MYIZXDZA.mjs} +0 -0
@@ -6,11 +6,12 @@ var _chunkA6WIQH5Zcjs = require('./chunk-A6WIQH5Z.cjs');
6
6
  var _chunkMT763TDWcjs = require('./chunk-MT763TDW.cjs');
7
7
 
8
8
 
9
- var _chunkXD32KALFcjs = require('./chunk-XD32KALF.cjs');
10
9
 
10
+ var _chunkWT4TGLXTcjs = require('./chunk-WT4TGLXT.cjs');
11
11
 
12
12
 
13
- var _chunkVQLJWDVWcjs = require('./chunk-VQLJWDVW.cjs');
13
+
14
+ var _chunk7DWNJI73cjs = require('./chunk-7DWNJI73.cjs');
14
15
 
15
16
 
16
17
 
@@ -28,7 +29,7 @@ var _chunkTE2G5IONcjs = require('./chunk-TE2G5ION.cjs');
28
29
  var _chunkMWWVKDW3cjs = require('./chunk-MWWVKDW3.cjs');
29
30
 
30
31
 
31
- var _chunkTKSCR644cjs = require('./chunk-TKSCR644.cjs');
32
+ var _chunkD3C5LBQYcjs = require('./chunk-D3C5LBQY.cjs');
32
33
 
33
34
 
34
35
  var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
@@ -37,7 +38,7 @@ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
37
38
 
38
39
 
39
40
 
40
- var _chunkUVW64BCBcjs = require('./chunk-UVW64BCB.cjs');
41
+ var _chunk3A4KGQYIcjs = require('./chunk-3A4KGQYI.cjs');
41
42
 
42
43
 
43
44
  var _chunkKCMTCM6Icjs = require('./chunk-KCMTCM6I.cjs');
@@ -76,13 +77,13 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
76
77
 
77
78
 
78
79
 
79
- var _chunkNMHWYWDRcjs = require('./chunk-NMHWYWDR.cjs');
80
+ var _chunkQ5FYSK45cjs = require('./chunk-Q5FYSK45.cjs');
80
81
 
81
82
 
82
83
 
83
84
 
84
85
 
85
- var _chunkJNUWCDTFcjs = require('./chunk-JNUWCDTF.cjs');
86
+ var _chunk5D2JIPLHcjs = require('./chunk-5D2JIPLH.cjs');
86
87
 
87
88
 
88
89
 
@@ -94,7 +95,7 @@ var _chunkJNUWCDTFcjs = require('./chunk-JNUWCDTF.cjs');
94
95
 
95
96
 
96
97
 
97
- var _chunkADEA7PN3cjs = require('./chunk-ADEA7PN3.cjs');
98
+ var _chunkLOFKRKO7cjs = require('./chunk-LOFKRKO7.cjs');
98
99
 
99
100
 
100
101
 
@@ -143,7 +144,7 @@ var _chunk6EXBPJ24cjs = require('./chunk-6EXBPJ24.cjs');
143
144
  var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
144
145
 
145
146
 
146
- var _chunk42NHY7HWcjs = require('./chunk-42NHY7HW.cjs');
147
+ var _chunkB5PFZLKVcjs = require('./chunk-B5PFZLKV.cjs');
147
148
 
148
149
 
149
150
 
@@ -159,20 +160,20 @@ var _chunkSDOTRX3Vcjs = require('./chunk-SDOTRX3V.cjs');
159
160
 
160
161
 
161
162
 
162
- var _chunkCBJJH36Acjs = require('./chunk-CBJJH36A.cjs');
163
+ var _chunkUJZLSXUBcjs = require('./chunk-UJZLSXUB.cjs');
163
164
 
164
165
 
165
166
 
166
167
 
167
- var _chunkZWM5KGAAcjs = require('./chunk-ZWM5KGAA.cjs');
168
+ var _chunkLPFV45AYcjs = require('./chunk-LPFV45AY.cjs');
168
169
 
169
170
 
170
171
 
171
172
 
172
- var _chunkZ2HLU4IXcjs = require('./chunk-Z2HLU4IX.cjs');
173
+ var _chunk4GWRFP22cjs = require('./chunk-4GWRFP22.cjs');
173
174
 
174
175
 
175
- var _chunkFO427P6Icjs = require('./chunk-FO427P6I.cjs');
176
+ var _chunkU6MPZ35Qcjs = require('./chunk-U6MPZ35Q.cjs');
176
177
 
177
178
 
178
179
  var _chunkUFDAAQFXcjs = require('./chunk-UFDAAQFX.cjs');
@@ -199,7 +200,7 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
199
200
  var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
200
201
 
201
202
 
202
- var _chunkDZ5ZVB2Kcjs = require('./chunk-DZ5ZVB2K.cjs');
203
+ var _chunkNQ6QFZWDcjs = require('./chunk-NQ6QFZWD.cjs');
203
204
 
204
205
 
205
206
  var _chunkC5GUTBZKcjs = require('./chunk-C5GUTBZK.cjs');
@@ -345,7 +346,7 @@ async function compileFarmDocsManifest(docs, options) {
345
346
  fontStylesheetHref: options.fontStylesheetHref,
346
347
  globalStylesheetHref: options.globalStylesheetHref
347
348
  });
348
- const apiHandler = _chunkVQLJWDVWcjs.createFarmDocsAPIHandler.call(void 0, {
349
+ const apiHandler = _chunk7DWNJI73cjs.createFarmDocsAPIHandler.call(void 0, {
349
350
  rootDir: options.root,
350
351
  srcDir: options.srcDir,
351
352
  docs
@@ -457,7 +458,7 @@ async function createFarmRouteRuntimeManifest(options) {
457
458
  const routes = [];
458
459
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
459
460
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
460
- const rendering = await _chunkJNUWCDTFcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
461
+ const rendering = await _chunk5D2JIPLHcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
461
462
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
462
463
  routes.push({
463
464
  kind: "page",
@@ -760,15 +761,32 @@ function createFarmNetlifyEntry(options) {
760
761
  import nitroNetlifyHandler from ${JSON.stringify(options.nitroNetlifyEntry)};
761
762
 
762
763
  const PRIVATE_CACHE_DIRECTIVE = /(?:^|,)\\s*(?:private|no-store)\\s*(?:[,=]|$)/i;
764
+ const CREDENTIAL_VARY = /(?:^|,)\\s*(?:\\*|cookie|authorization)\\s*(?:,|$)/i;
765
+ // What Nitro's entry sets when the response has no Cache-Control of its own.
766
+ const NITRO_DEFAULT_CACHE_CONTROL = "public, max-age=0, must-revalidate";
767
+
768
+ function isSharedCacheable(request, response) {
769
+ return (
770
+ response.status === 200 &&
771
+ !request.headers.has("cookie") &&
772
+ !request.headers.has("authorization") &&
773
+ !response.headers.has("set-cookie") &&
774
+ !PRIVATE_CACHE_DIRECTIVE.test(response.headers.get("cache-control") || "") &&
775
+ !CREDENTIAL_VARY.test(response.headers.get("vary") || "")
776
+ );
777
+ }
763
778
 
764
779
  export default async function farmNetlifyHandler(request, context) {
765
780
  const response = await nitroNetlifyHandler(request, context);
766
781
  if (
767
782
  response &&
768
783
  response.headers.has("netlify-cdn-cache-control") &&
769
- PRIVATE_CACHE_DIRECTIVE.test(response.headers.get("cache-control") || "")
784
+ !isSharedCacheable(request, response)
770
785
  ) {
771
786
  response.headers.delete("netlify-cdn-cache-control");
787
+ if (response.headers.get("cache-control") === NITRO_DEFAULT_CACHE_CONTROL) {
788
+ response.headers.set("cache-control", "private, no-store");
789
+ }
772
790
  }
773
791
  return response;
774
792
  }
@@ -1600,7 +1618,7 @@ function hasFarmMiddlewareConfig(config) {
1600
1618
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmMiddlewareConfig, "hasFarmMiddlewareConfig");
1601
1619
  function hasFarmServerRuntimePlugins(config) {
1602
1620
  return (config.plugins || []).some((plugin) => {
1603
- if (_chunkCBJJH36Acjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1621
+ if (_chunkUJZLSXUBcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1604
1622
  return Boolean(
1605
1623
  plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
1606
1624
  );
@@ -1613,7 +1631,7 @@ function hasFarmPluginRoutes(config) {
1613
1631
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmPluginRoutes, "hasFarmPluginRoutes");
1614
1632
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
1615
1633
  return (config.plugins || []).some(
1616
- (plugin) => _chunkCBJJH36Acjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkNMHWYWDRcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1634
+ (plugin) => _chunkUJZLSXUBcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunkQ5FYSK45cjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1617
1635
  );
1618
1636
  }
1619
1637
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmServerRuntimePluginsMayHandlePath, "farmServerRuntimePluginsMayHandlePath");
@@ -1644,8 +1662,8 @@ async function discoverMiddlewareRoutes(appDir) {
1644
1662
  }
1645
1663
  await walk(
1646
1664
  _path2.default.join(dir, entry.name),
1647
- _chunkZWM5KGAAcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1648
- _chunkZWM5KGAAcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1665
+ _chunkLPFV45AYcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1666
+ _chunkLPFV45AYcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1649
1667
  discovered
1650
1668
  );
1651
1669
  }
@@ -1658,7 +1676,7 @@ async function discoverMiddlewareRoutes(appDir) {
1658
1676
  routes.set(route.directory, route);
1659
1677
  }
1660
1678
  }
1661
- return Array.from(routes.values()).sort(_chunkZWM5KGAAcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1679
+ return Array.from(routes.values()).sort(_chunkLPFV45AYcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1662
1680
  }
1663
1681
  _chunkS3JO3N4Hcjs.__name.call(void 0, discoverMiddlewareRoutes, "discoverMiddlewareRoutes");
1664
1682
  function assertFarmDocsRuntimeSupported(config, preset) {
@@ -1676,7 +1694,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1676
1694
  assertFarmDocsRuntimeSupported(config, preset);
1677
1695
  const srcDir = config.srcDir || "src";
1678
1696
  const distDir = config.distDir || ".farm";
1679
- const deployOutputDir = _chunkUVW64BCBcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1697
+ const deployOutputDir = _chunk3A4KGQYIcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1680
1698
  const lifecyclePluginManager = options.pluginManager;
1681
1699
  const productionViteResultPromise = Promise.allSettled([
1682
1700
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))
@@ -1695,7 +1713,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1695
1713
  const routeRuntimeManifestResultPromise = Promise.allSettled([routeRuntimeManifestPromise]);
1696
1714
  const pageRoutes = [];
1697
1715
  for (const [pattern, entry] of routeManager.getRoutes()) {
1698
- const markdownSourcePath = entry.markdownSourcePath || (_chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1716
+ const markdownSourcePath = entry.markdownSourcePath || (_chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
1699
1717
  pageRoutes.push({
1700
1718
  pattern,
1701
1719
  ...entry.directory ? { directory: entry.directory } : {},
@@ -1926,7 +1944,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
1926
1944
  }
1927
1945
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
1928
1946
  await fs.writeFile(fontCssPath, normalizedFontCss);
1929
- await fs.writeFile(clientCssPath, _chunkNMHWYWDRcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1947
+ await fs.writeFile(clientCssPath, _chunkQ5FYSK45cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1930
1948
  }
1931
1949
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
1932
1950
  var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
@@ -1976,7 +1994,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
1976
1994
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${_path2.default.resolve(modulePath)}`;
1977
1995
  let plan = cache.get(key);
1978
1996
  if (!plan) {
1979
- plan = _chunkNMHWYWDRcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1997
+ plan = _chunkQ5FYSK45cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
1980
1998
  cache.set(key, plan);
1981
1999
  }
1982
2000
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -1994,7 +2012,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
1994
2012
  });
1995
2013
  pluginManager.addPlugins(config.plugins || []);
1996
2014
  const clientPages = [];
1997
- const integrationProviders = _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, config.integrations).filter(
2015
+ const integrationProviders = _chunkUJZLSXUBcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
1998
2016
  (provider) => provider.component || provider.type === "clerk"
1999
2017
  );
2000
2018
  const unsupportedIntegrationProvider = integrationProviders.find(
@@ -2005,14 +2023,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2005
2023
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
2006
2024
  );
2007
2025
  }
2008
- const isolatedMode = _chunkNMHWYWDRcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2026
+ const isolatedMode = _chunkQ5FYSK45cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2009
2027
  _optionalChain([config, 'access', _35 => _35.experimental, 'optionalAccess', _36 => _36.isolatedClientHydration]),
2010
2028
  {
2011
2029
  serverComponents: _optionalChain([config, 'access', _37 => _37.experimental, 'optionalAccess', _38 => _38.serverComponents]) === true,
2012
2030
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
2013
2031
  }
2014
2032
  );
2015
- const planOptions = _chunkNMHWYWDRcjs.getFarmClientHydrationPlanOptions.call(void 0,
2033
+ const planOptions = _chunkQ5FYSK45cjs.getFarmClientHydrationPlanOptions.call(void 0,
2016
2034
  config.renderer,
2017
2035
  Boolean(unsupportedIntegrationProvider)
2018
2036
  );
@@ -2059,7 +2077,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2059
2077
  };
2060
2078
  }
2061
2079
  });
2062
- const layoutAppliesToRoute = _chunkADEA7PN3cjs.routeBoundaryCoversDirectory;
2080
+ const layoutAppliesToRoute = _chunkLOFKRKO7cjs.routeBoundaryCoversDirectory;
2063
2081
  const routeDirectory = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (route) => _nullishCoalesce(route.directory, () => ( route.pattern)), "routeDirectory");
2064
2082
  const adapterOwnsDocsRuntime = Boolean(
2065
2083
  _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _39 => _39.docs, 'optionalAccess', _40 => _40.enabled]) && _optionalChain([config, 'access', _41 => _41.docs, 'access', _42 => _42.adapter, 'optionalAccess', _43 => _43.server]) && config.docs.adapter.react
@@ -2070,7 +2088,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2070
2088
  ), "isAdapterDocsRoute");
2071
2089
  const syntheticDocsEntry = _optionalChain([config, 'access', _46 => _46.docs, 'optionalAccess', _47 => _47.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2072
2090
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
2073
- const markdownPagePlan = _chunkNMHWYWDRcjs.createMarkdownPageHydrationPlanner.call(void 0,
2091
+ const markdownPagePlan = _chunkQ5FYSK45cjs.createMarkdownPageHydrationPlanner.call(void 0,
2074
2092
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
2075
2093
  root,
2076
2094
  isolatedMode,
@@ -2078,7 +2096,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2078
2096
  );
2079
2097
  const routePlans = pageRoutes.map((route) => ({
2080
2098
  route,
2081
- metadata: _chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2099
+ metadata: _chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
2082
2100
  route.modulePath,
2083
2101
  root,
2084
2102
  isolatedMode,
@@ -2086,7 +2104,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2086
2104
  planOptions
2087
2105
  )
2088
2106
  }));
2089
- _chunkNMHWYWDRcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2107
+ _chunkQ5FYSK45cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2090
2108
  clientLayouts.map((layout) => ({
2091
2109
  pattern: layout.pattern,
2092
2110
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2095,7 +2113,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2095
2113
  [
2096
2114
  ...routePlans.map(({ route, metadata }) => ({
2097
2115
  pattern: routeDirectory(route),
2098
- depth: _chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2116
+ depth: _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2099
2117
  metadata
2100
2118
  })),
2101
2119
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -2118,7 +2136,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2118
2136
  for (const layout of clientLayouts) {
2119
2137
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
2120
2138
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2121
- _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkNMHWYWDRcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2139
+ _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkQ5FYSK45cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2122
2140
  }
2123
2141
  }
2124
2142
  if (isolatedMode === "analyze") {
@@ -2142,7 +2160,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2142
2160
  );
2143
2161
  if (metadata.suppressedAsyncHydration) {
2144
2162
  _chunk5QIKR7RRcjs.logger.warn(
2145
- `\u26A0\uFE0F ${_chunkNMHWYWDRcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2163
+ `\u26A0\uFE0F ${_chunkQ5FYSK45cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2146
2164
  );
2147
2165
  }
2148
2166
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
@@ -2167,7 +2185,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2167
2185
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries).flatMap((layout) => layout.isolatedBoundaries)
2168
2186
  ],
2169
2187
  // The server renders a server tree only below a hydrating layout.
2170
- ..._chunkNMHWYWDRcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2188
+ ..._chunkQ5FYSK45cjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2171
2189
  });
2172
2190
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2173
2191
  }
@@ -2203,7 +2221,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2203
2221
  }
2204
2222
  const clientRouteSlots = routeSlots.filter((slot) => {
2205
2223
  try {
2206
- return _chunkNMHWYWDRcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2224
+ return _chunkQ5FYSK45cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2207
2225
  } catch (error) {
2208
2226
  _chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2209
2227
  return false;
@@ -2231,9 +2249,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2231
2249
  config.renderer,
2232
2250
  config.publicRuntimeConfig,
2233
2251
  config.trailingSlash,
2234
- _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, config.integrations),
2252
+ _chunkUJZLSXUBcjs.getIntegrationProviders.call(void 0, config.integrations),
2235
2253
  config.basePath,
2236
- _chunkNMHWYWDRcjs.generateClientCachePersistenceCode.call(void 0, _chunkNMHWYWDRcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2254
+ _chunkQ5FYSK45cjs.generateClientCachePersistenceCode.call(void 0, _chunkQ5FYSK45cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2237
2255
  adapterOwnsDocsRuntime ? _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2238
2256
  );
2239
2257
  await fs.writeFile(clientEntryPath, clientHydrationCode);
@@ -2250,7 +2268,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2250
2268
  const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
2251
2269
  await fs.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2252
2270
  postcssSearchPath = clientEntryDir;
2253
- tailwindVitePlugin = await _chunkNMHWYWDRcjs.loadTailwindVitePlugin.call(void 0, {
2271
+ tailwindVitePlugin = await _chunkQ5FYSK45cjs.loadTailwindVitePlugin.call(void 0, {
2254
2272
  builder: productionVite.builder,
2255
2273
  announce: true
2256
2274
  });
@@ -2319,12 +2337,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2319
2337
  }
2320
2338
  },
2321
2339
  plugins: [
2322
- _chunkNMHWYWDRcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2340
+ _chunkQ5FYSK45cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2323
2341
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
2324
2342
  ...rendererVitePlugins,
2325
2343
  ...config.vite.plugins || [],
2326
2344
  farmServerOnlyEntriesPlugin(),
2327
- _chunkNMHWYWDRcjs.farmDocsClientConfigPlugin.call(void 0,
2345
+ _chunkQ5FYSK45cjs.farmDocsClientConfigPlugin.call(void 0,
2328
2346
  adapterOwnsDocsRuntime ? _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2329
2347
  ),
2330
2348
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -2383,7 +2401,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2383
2401
  } : void 0,
2384
2402
  // Ensure React is bundled for client
2385
2403
  resolve: {
2386
- alias: _chunkNMHWYWDRcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2404
+ alias: _chunkQ5FYSK45cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2387
2405
  dedupe: [...config.renderer.dedupe || []]
2388
2406
  },
2389
2407
  // Optimize dependencies - exclude server-side code from client bundle
@@ -2396,7 +2414,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2396
2414
  ]
2397
2415
  }
2398
2416
  };
2399
- await viteBuild(_chunkNMHWYWDRcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2417
+ await viteBuild(_chunkQ5FYSK45cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2400
2418
  await mergeBuiltFontCss(outputDir);
2401
2419
  await validateClientBuildOutput(root, srcDir, outputDir);
2402
2420
  } finally {
@@ -3155,7 +3173,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3155
3173
  direction: {}
3156
3174
  }, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
3157
3175
  const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
3158
- const clientPluginEntry = _chunkNMHWYWDRcjs.generateFarmClientPluginEntryCode.call(void 0,
3176
+ const clientPluginEntry = _chunkQ5FYSK45cjs.generateFarmClientPluginEntryCode.call(void 0,
3159
3177
  plugins,
3160
3178
  root,
3161
3179
  srcDir,
@@ -3166,7 +3184,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3166
3184
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
3167
3185
  import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
3168
3186
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3169
- const providerClientCode = _chunkNMHWYWDRcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3187
+ const providerClientCode = _chunkQ5FYSK45cjs.generateFarmIntegrationProviderClientCode.call(void 0,
3170
3188
  integrationProviders,
3171
3189
  root,
3172
3190
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -3175,15 +3193,17 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
3175
3193
  const cssImport = _fs.existsSync.call(void 0, globalsCssPath) ? `import ${JSON.stringify(toImportPath(globalsCssPath))};` : "";
3176
3194
  const layoutImportStatements = [];
3177
3195
  const layoutRegistrations = [];
3196
+ const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
3178
3197
  layoutRoutes.forEach((layout, index) => {
3179
3198
  const relativePath = toImportPath(layout.modulePath);
3180
- if (!layout.hasIsolatedClientBoundaries) {
3199
+ const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) => _chunkWT4TGLXTcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern));
3200
+ if (rendersOnClient) {
3181
3201
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
3182
3202
  }
3183
- const groupScope = _chunkADEA7PN3cjs.getRouteGroupScope.call(void 0, layout.pattern);
3184
- const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkADEA7PN3cjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3203
+ const groupScope = _chunkLOFKRKO7cjs.getRouteGroupScope.call(void 0, layout.pattern);
3204
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkLOFKRKO7cjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3185
3205
  layoutRegistrations.push(
3186
- ` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${layout.hasIsolatedClientBoundaries ? "null" : `Layout${index}`}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)} }`
3206
+ ` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)} }`
3187
3207
  );
3188
3208
  });
3189
3209
  const layoutImports = layoutImportStatements.join("\n");
@@ -3684,7 +3704,7 @@ function hasHydratableLayout(pathname) {
3684
3704
  });
3685
3705
  }
3686
3706
 
3687
- ${_chunkNMHWYWDRcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3707
+ ${_chunkQ5FYSK45cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3688
3708
  // Wrap a page element with applicable layouts
3689
3709
  function wrapWithLayouts(pageElement, pathname, params) {
3690
3710
  const layouts = getApplicableLayouts(pathname);
@@ -4663,7 +4683,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4663
4683
  _path2.default.join(postcssConfigDir, "postcss.config.cjs"),
4664
4684
  "module.exports = { plugins: [] };\n"
4665
4685
  );
4666
- tailwindVitePlugin = await _chunkNMHWYWDRcjs.loadTailwindVitePlugin.call(void 0, {
4686
+ tailwindVitePlugin = await _chunkQ5FYSK45cjs.loadTailwindVitePlugin.call(void 0, {
4667
4687
  builder: productionVite.builder,
4668
4688
  label: "for SSR"
4669
4689
  });
@@ -4759,7 +4779,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4759
4779
  }
4760
4780
  const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
4761
4781
  const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
4762
- const notFoundPath = _chunkNMHWYWDRcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4782
+ const notFoundPath = _chunkQ5FYSK45cjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
4763
4783
  if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
4764
4784
  layoutRoutes.sort((a, b) => {
4765
4785
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -4776,13 +4796,13 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4776
4796
  const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
4777
4797
  (integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
4778
4798
  );
4779
- const hasIntegrationProviders = _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, config.integrations).some(
4799
+ const hasIntegrationProviders = _chunkUJZLSXUBcjs.getIntegrationProviders.call(void 0, config.integrations).some(
4780
4800
  (provider) => provider.component || provider.type === "clerk"
4781
4801
  );
4782
4802
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
4783
4803
  const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _56 => _56.mdx, 'optionalAccess', _57 => _57.components]));
4784
4804
  const hasMiddlewareConfig = hasFarmMiddlewareConfig(config.middleware);
4785
- const hasRouteContextConfig = _chunkUVW64BCBcjs.hasCustomFarmRouteContext.call(void 0, config);
4805
+ const hasRouteContextConfig = _chunk3A4KGQYIcjs.hasCustomFarmRouteContext.call(void 0, config);
4786
4806
  const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
4787
4807
  const hasPluginRoutes = hasFarmPluginRoutes(config);
4788
4808
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
@@ -4792,7 +4812,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4792
4812
  const hasConfiguredRuntimePlugins = Boolean(
4793
4813
  hasRuntimeConfigModule && (config.plugins || []).length > 0
4794
4814
  );
4795
- const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _60 => _60.docs, 'access', _61 => _61.adapter, 'optionalAccess', _62 => _62.server]) ? await _chunkVQLJWDVWcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4815
+ const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? _optionalChain([config, 'access', _60 => _60.docs, 'access', _61 => _61.adapter, 'optionalAccess', _62 => _62.server]) ? await _chunk7DWNJI73cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
4796
4816
  root,
4797
4817
  srcDir: config.srcDir,
4798
4818
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -4942,7 +4962,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4942
4962
  __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _68 => _68.env, 'optionalAccess', _69 => _69.public]) || {})
4943
4963
  },
4944
4964
  plugins: [
4945
- _chunkNMHWYWDRcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4965
+ _chunkQ5FYSK45cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
4946
4966
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
4947
4967
  ...rendererVitePlugins,
4948
4968
  ...config.vite.plugins || [],
@@ -4989,7 +5009,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4989
5009
  resolve: {
4990
5010
  alias: [
4991
5011
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
4992
- ...Object.entries(_chunkNMHWYWDRcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
5012
+ ...Object.entries(_chunkQ5FYSK45cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
4993
5013
  ([find, replacement]) => ({ find, replacement })
4994
5014
  )
4995
5015
  ],
@@ -4997,7 +5017,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
4997
5017
  dedupe: [...config.renderer.dedupe || []]
4998
5018
  }
4999
5019
  };
5000
- await viteBuild(_chunkNMHWYWDRcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5020
+ await viteBuild(_chunkQ5FYSK45cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5001
5021
  } finally {
5002
5022
  if (postcssConfigDir) {
5003
5023
  try {
@@ -5206,8 +5226,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateConfiguredResponseHeadersRuntimeSo
5206
5226
  function parseRouteRenderingDirectiveFromDisk(modulePath) {
5207
5227
  try {
5208
5228
  const source = _fs.readFileSync.call(void 0, modulePath, "utf8");
5209
- const directive = _chunkJNUWCDTFcjs.parseRouteRenderingDirective.call(void 0, source);
5210
- if (_chunkJNUWCDTFcjs.findRequestBoundSourceBlockers.call(void 0, source).length === 0) return directive;
5229
+ const directive = _chunk5D2JIPLHcjs.parseRouteRenderingDirective.call(void 0, source);
5230
+ if (_chunk5D2JIPLHcjs.findRequestBoundSourceBlockers.call(void 0, source).length === 0) return directive;
5211
5231
  return { ..._nullishCoalesce(directive, () => ( { ssg: false, ppr: false, directive: "" })), requestBound: true };
5212
5232
  } catch (e24) {
5213
5233
  return void 0;
@@ -5443,7 +5463,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5443
5463
  );
5444
5464
  const hasMiddlewareRuntime = middlewareRoutes.length > 0 || hasFarmMiddlewareConfig(config.middleware);
5445
5465
  const farmDocsFontAssets = _optionalChain([config, 'access', _93 => _93.docs, 'optionalAccess', _94 => _94.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5446
- const integrationProviders = _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, config.integrations);
5466
+ const integrationProviders = _chunkUJZLSXUBcjs.getIntegrationProviders.call(void 0, config.integrations);
5447
5467
  const renderedIntegrationProviders = integrationProviders.filter(
5448
5468
  (provider) => provider.component || provider.type === "clerk"
5449
5469
  );
@@ -5452,7 +5472,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5452
5472
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
5453
5473
  );
5454
5474
  }
5455
- const providerServerModules = _chunkNMHWYWDRcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5475
+ const providerServerModules = _chunkQ5FYSK45cjs.generateFarmIntegrationProviderServerModules.call(void 0,
5456
5476
  renderedIntegrationProviders,
5457
5477
  config.root,
5458
5478
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
@@ -5472,14 +5492,14 @@ function renderFarmRouteServerTree(element) { return element; }`;
5472
5492
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
5473
5493
  (provider) => provider.supportsIsolatedHydration !== true
5474
5494
  );
5475
- const isolatedHydrationMode = _chunkNMHWYWDRcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5495
+ const isolatedHydrationMode = _chunkQ5FYSK45cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5476
5496
  _optionalChain([config, 'access', _97 => _97.experimental, 'optionalAccess', _98 => _98.isolatedClientHydration]),
5477
5497
  {
5478
5498
  serverComponents: _optionalChain([config, 'access', _99 => _99.experimental, 'optionalAccess', _100 => _100.serverComponents]) === true,
5479
5499
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
5480
5500
  }
5481
5501
  );
5482
- const hydrationPlanOptions = _chunkNMHWYWDRcjs.getFarmClientHydrationPlanOptions.call(void 0,
5502
+ const hydrationPlanOptions = _chunkQ5FYSK45cjs.getFarmClientHydrationPlanOptions.call(void 0,
5483
5503
  config.renderer,
5484
5504
  Boolean(unsupportedIntegrationProvider)
5485
5505
  );
@@ -5493,7 +5513,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5493
5513
  hydrationPlanOptions
5494
5514
  )
5495
5515
  }));
5496
- const markdownPagePlan = _chunkNMHWYWDRcjs.createMarkdownPageHydrationPlanner.call(void 0,
5516
+ const markdownPagePlan = _chunkQ5FYSK45cjs.createMarkdownPageHydrationPlanner.call(void 0,
5497
5517
  _chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
5498
5518
  config.root,
5499
5519
  isolatedHydrationMode,
@@ -5502,7 +5522,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5502
5522
  const pageHydrationPlans = new Map(
5503
5523
  pageRoutes.map((route) => [
5504
5524
  route.modulePath,
5505
- _chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
5525
+ _chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
5506
5526
  route.modulePath,
5507
5527
  config.root,
5508
5528
  isolatedHydrationMode,
@@ -5511,7 +5531,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5511
5531
  )
5512
5532
  ])
5513
5533
  );
5514
- _chunkNMHWYWDRcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5534
+ _chunkQ5FYSK45cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5515
5535
  layoutHydrationPlans.map((layout) => ({
5516
5536
  pattern: layout.pattern,
5517
5537
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -5520,10 +5540,10 @@ function renderFarmRouteServerTree(element) { return element; }`;
5520
5540
  pageRoutes.map((route) => ({
5521
5541
  // Compared by directory so a grouped layout applies only inside its group.
5522
5542
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
5523
- depth: _chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
5543
+ depth: _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
5524
5544
  metadata: pageHydrationPlans.get(route.modulePath)
5525
5545
  })),
5526
- _chunkADEA7PN3cjs.routeBoundaryCoversDirectory
5546
+ _chunkLOFKRKO7cjs.routeBoundaryCoversDirectory
5527
5547
  );
5528
5548
  const providerServerImports = [
5529
5549
  providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
@@ -5553,7 +5573,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5553
5573
  }).map(({ route }) => route);
5554
5574
  orderedPageRoutes.forEach((route, index) => {
5555
5575
  const varName = `pageRoute${index}`;
5556
- if (_chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
5576
+ if (_chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
5557
5577
  pageRegistrations.push(`
5558
5578
  {
5559
5579
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -5584,7 +5604,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
5584
5604
  directory: ${JSON.stringify(route.directory)},` : ""}
5585
5605
  module: ${varName},
5586
5606
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
5587
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkNMHWYWDRcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
5607
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkQ5FYSK45cjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
5588
5608
  rendering: ${JSON.stringify(renderingDirective)},` : ""}
5589
5609
  ${route.source !== void 0 ? `markdownSource: {
5590
5610
  source: ${JSON.stringify(route.source)},
@@ -5641,12 +5661,12 @@ function renderFarmRouteServerTree(element) { return element; }`;
5641
5661
  errorImports.push(
5642
5662
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
5643
5663
  );
5644
- const groupScope = _chunkADEA7PN3cjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
5664
+ const groupScope = _chunkLOFKRKO7cjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
5645
5665
  errorRegistrations.push(`
5646
5666
  {
5647
- pattern: ${JSON.stringify(_chunkADEA7PN3cjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
5667
+ pattern: ${JSON.stringify(_chunkLOFKRKO7cjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
5648
5668
  groupScope: ${JSON.stringify(groupScope)},
5649
- directoryDepth: ${_chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
5669
+ directoryDepth: ${_chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
5650
5670
  module: ${varName},
5651
5671
  }`);
5652
5672
  });
@@ -5808,7 +5828,7 @@ import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfig
5808
5828
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
5809
5829
  import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
5810
5830
  const markdownHandlerImport = _optionalChain([config, 'access', _111 => _111.md, 'optionalAccess', _112 => _112.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
5811
- const appMarkdownImport = hasMarkdownPages ? `import { createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
5831
+ 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;";
5812
5832
  const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
5813
5833
  const mdxComponentsPath = typeof _optionalChain([config, 'access', _113 => _113.mdx, 'optionalAccess', _114 => _114.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
5814
5834
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
@@ -5828,7 +5848,7 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
5828
5848
  const integrationRuntimeImport = integrationRuntimeExports.length ? `import { ${integrationRuntimeExports.join(", ")} } from "@farm.js/core/integrations";` : "";
5829
5849
  const instrumentationImport = instrumentationPath ? `import * as FarmInstrumentationModule from ${toVirtualEntryImportSpecifier(instrumentationPath)};` : "";
5830
5850
  const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
5831
- const nativeMCP = _chunkXD32KALFcjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
5851
+ const nativeMCP = _chunkWT4TGLXTcjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
5832
5852
  const integrationImports = `
5833
5853
  ${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
5834
5854
  ${layerConfigImports}
@@ -6015,7 +6035,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
6015
6035
 
6016
6036
  function FarmDefault404Page() {
6017
6037
  return React.createElement(React.Fragment, null,
6018
- React.createElement("style", null, ${JSON.stringify(_chunkNMHWYWDRcjs.DEFAULT_NOT_FOUND_STYLES)}),
6038
+ React.createElement("style", null, ${JSON.stringify(_chunkQ5FYSK45cjs.DEFAULT_NOT_FOUND_STYLES)}),
6019
6039
  React.createElement("main", {
6020
6040
  className: "farm-default-not-found",
6021
6041
  "aria-labelledby": "farm-default-not-found-title",
@@ -6108,7 +6128,7 @@ const serverRuntimeIntegrations = Object.fromEntries(
6108
6128
  );
6109
6129
  const integrationRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs, {
6110
6130
  integrations: configuredIntegrations,
6111
- ${JSON.stringify(_chunkCBJJH36Acjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
6131
+ ${JSON.stringify(_chunkUJZLSXUBcjs.FARM_INTEGRATION_API_BASE_PATH_KEY)}: ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
6112
6132
  });
6113
6133
  const farmInfraAnalytics = ${hasInfraAnalyticsRuntime ? hasPluginRuntime ? "createFarmInfraAnalyticsPlugin()" : "createFarmInfraAnalyticsRecorder()" : "null"};
6114
6134
  const configuredPlugins = [
@@ -6263,16 +6283,27 @@ const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRe
6263
6283
  function dispatchFarmPluginAPIRequest(request) {
6264
6284
  const url = new URL(request.url);
6265
6285
  url.pathname = applyFarmBasePath(url.pathname);
6266
- return handleFarmRequest(url.href === request.url ? request : new Request(url, request));
6286
+ return fetchFarmInnerRequest(url.href === request.url ? request : new Request(url, request));
6287
+ }
6288
+ // A request the app makes to itself (a Markdown page check, a plugin's endpoint call) enters
6289
+ // through this module's outer \`fetch\`, as a direct request does: plugin runtime hooks run and
6290
+ // it gets its own request context, so \`cookies()\` and \`headers()\` are its own, never the
6291
+ // caller's. It asks for an identity body: the caller reads it, and the outer response is
6292
+ // compressed once.
6293
+ function fetchFarmInnerRequest(request, context) {
6294
+ if (!request.headers.has("accept-encoding")) return fetch(request, context);
6295
+ const headers = new Headers(request.headers);
6296
+ headers.delete("accept-encoding");
6297
+ return fetch(new Request(request, { headers }), context);
6267
6298
  }
6268
6299
  const farmLocalAPIBasePath = ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
6269
6300
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
6270
- ${_optionalChain([config, 'access', _130 => _130.agent, 'optionalAccess', _131 => _131.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkADEA7PN3cjs.resolveFarmApiCatalogInput.call(void 0, config))};
6301
+ ${_optionalChain([config, 'access', _130 => _130.agent, 'optionalAccess', _131 => _131.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkLOFKRKO7cjs.resolveFarmApiCatalogInput.call(void 0, config))};
6271
6302
  ` : ""}${_optionalChain([config, 'access', _132 => _132.agent, 'optionalAccess', _133 => _133.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
6272
- _chunkADEA7PN3cjs.resolveFarmAppManifestInput.call(void 0, config, {
6303
+ _chunkLOFKRKO7cjs.resolveFarmAppManifestInput.call(void 0, config, {
6273
6304
  build: config.deploymentId,
6274
- packages: _chunkNMHWYWDRcjs.resolveFarmAppPackages.call(void 0, config.root),
6275
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkNMHWYWDRcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6305
+ packages: _chunkQ5FYSK45cjs.resolveFarmAppPackages.call(void 0, config.root),
6306
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkQ5FYSK45cjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6276
6307
  })
6277
6308
  )};
6278
6309
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}` : ""}
@@ -6717,7 +6748,7 @@ function peelFarmDocumentPrefix(markup) {
6717
6748
  let inner = markup.replace(/^\\s+/, "");
6718
6749
  let hoisted = "";
6719
6750
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents["'][^>]*>/i;
6720
- const hoistable = /${_chunkADEA7PN3cjs.HOISTED_HEAD_ELEMENT.source}/i;
6751
+ const hoistable = /${_chunkLOFKRKO7cjs.HOISTED_HEAD_ELEMENT.source}/i;
6721
6752
  let match;
6722
6753
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
6723
6754
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -7207,7 +7238,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
7207
7238
  // aside for a page route that answers /mcp and for any MCP server published or
7208
7239
  // registered at runtime, such as the docs engine's.
7209
7240
  const farmDefaultMCPServer = ${JSON.stringify(
7210
- _chunkPTZ2TVNEcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkDZ5ZVB2Kcjs.FARM_VERSION)
7241
+ _chunkPTZ2TVNEcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkNQ6QFZWDcjs.FARM_VERSION)
7211
7242
  )};
7212
7243
  let farmDefaultMCPRouteFree;
7213
7244
  function getFarmDefaultMCPServer() {
@@ -7235,7 +7266,9 @@ async function handleFarmDefaultMCP(request) {
7235
7266
  },
7236
7267
  });
7237
7268
  }
7238
- const farmDefaultMCPReadMarkdown = createFarmLlmsMarkdownReader((page) => handleFarmRequest(page));
7269
+ // \`fetch\` is this module's outer request entry: plugin runtime hooks run and the page
7270
+ // gets its own request context, as for a direct request.
7271
+ const farmDefaultMCPReadMarkdown = createFarmLlmsMarkdownReader((page) => fetch(page));
7239
7272
  ` : ""}
7240
7273
  // Static pages and root metadata for llms.txt, built the same way as in development.
7241
7274
  function createFarmLlmsTxtContext(request, full) {
@@ -7262,14 +7295,15 @@ function createFarmLlmsTxtContext(request, full) {
7262
7295
  apiServerBasePath: farmLocalAPIBasePath,${servesDefaultMCP ? "\n defaultMCP: getFarmDefaultMCPServer," : ""}
7263
7296
  }),` : ""}
7264
7297
  }),
7265
- // llms-full.txt reads each page's .md mirror through this same handler,
7266
- // with a fresh request so the caller's cookies never shape its content.
7267
- // HEAD discards the body, so it reads nothing.
7298
+ // llms-full.txt reads each page's .md mirror through this module's outer
7299
+ // request entry, so plugin runtime hooks run and each read has a fresh request
7300
+ // context: the caller's cookies never shape its content. HEAD discards the
7301
+ // body, so it reads nothing.
7268
7302
  ...(full
7269
7303
  ? {
7270
7304
  markdown: request.method.toUpperCase() === "HEAD"
7271
7305
  ? async () => null
7272
- : createFarmLlmsMarkdownReader((page) => handleFarmRequest(page)),
7306
+ : createFarmLlmsMarkdownReader((page) => fetch(page)),
7273
7307
  }
7274
7308
  : {}),
7275
7309
  };
@@ -8059,7 +8093,13 @@ async function handleFarmRequestInContext(
8059
8093
  const match = matchPageRoute(getFarmRoutePathname(targetPathname));
8060
8094
  return match?.route?.markdownSource || null;
8061
8095
  },
8062
- renderPage: (targetRequest) => handleFarmRequest(targetRequest, adapterContext),
8096
+ clientAddress: adapterContext?.clientAddress,
8097
+ // An anonymous visitor's request: guards never see the caller's address.
8098
+ renderPage: (targetRequest) =>
8099
+ fetchFarmInnerRequest(targetRequest, {
8100
+ ...adapterContext,
8101
+ clientAddress: FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS,
8102
+ }),
8063
8103
  });
8064
8104
  if (markdownSourceResponse) {
8065
8105
  return isFarmMarkdownPublicSourceResponse(markdownSourceResponse)
@@ -8079,7 +8119,7 @@ async function handleFarmRequestInContext(
8079
8119
  config: farmMarkdownConfig,
8080
8120
  routeExists: (targetPathname) =>
8081
8121
  Boolean(matchPageRoute(getFarmRoutePathname(targetPathname))),
8082
- renderPage: (targetRequest) => handleFarmRequest(targetRequest, adapterContext),
8122
+ renderPage: (targetRequest) => fetchFarmInnerRequest(targetRequest, adapterContext),
8083
8123
  apiServerBasePath: farmLocalAPIBasePath,
8084
8124
  });
8085
8125
  if (markdownResponse) {
@@ -8171,7 +8211,7 @@ async function handleFarmRequestInContext(
8171
8211
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
8172
8212
  // public manifest; Farm Infra's signed request gets the full view.
8173
8213
  if (
8174
- [${JSON.stringify(_chunkADEA7PN3cjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkADEA7PN3cjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
8214
+ [${JSON.stringify(_chunkLOFKRKO7cjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkLOFKRKO7cjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
8175
8215
  normalizeRuntimePath(routePathname),
8176
8216
  )
8177
8217
  ) {
@@ -8183,7 +8223,7 @@ async function handleFarmRequestInContext(
8183
8223
  ` : ""}
8184
8224
  ${_optionalChain([config, 'access', _150 => _150.agent, 'optionalAccess', _151 => _151.apiCatalog]) ? `
8185
8225
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
8186
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkADEA7PN3cjs.FARM_API_CATALOG_PATH)}) {
8226
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkLOFKRKO7cjs.FARM_API_CATALOG_PATH)}) {
8187
8227
  return applyProductionMiddlewareHeaders(
8188
8228
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
8189
8229
  middlewareHeaders,
@@ -9512,13 +9552,13 @@ function configMiddlewareMayHandlePath(config, pathname) {
9512
9552
  typeof matcher === "function" ? () => true : matcher
9513
9553
  )
9514
9554
  ) : void 0;
9515
- const compiled = _chunkZ2HLU4IXcjs.compileMiddlewareConfig.call(void 0, { matcher: matchers, exclude: entry.exclude });
9516
- return _chunkZ2HLU4IXcjs.matchesCompiledMiddlewareConfig.call(void 0, pathname, compiled, {}).matched;
9555
+ const compiled = _chunk4GWRFP22cjs.compileMiddlewareConfig.call(void 0, { matcher: matchers, exclude: entry.exclude });
9556
+ return _chunk4GWRFP22cjs.matchesCompiledMiddlewareConfig.call(void 0, pathname, compiled, {}).matched;
9517
9557
  });
9518
9558
  }
9519
9559
  _chunkS3JO3N4Hcjs.__name.call(void 0, configMiddlewareMayHandlePath, "configMiddlewareMayHandlePath");
9520
9560
  function appMiddlewareMayHandlePath(middlewareRoutes, pathname) {
9521
- return middlewareRoutes.some((route) => _chunkZ2HLU4IXcjs.matchesMiddlewareRoute.call(void 0, pathname, route).matched);
9561
+ return middlewareRoutes.some((route) => _chunk4GWRFP22cjs.matchesMiddlewareRoute.call(void 0, pathname, route).matched);
9522
9562
  }
9523
9563
  _chunkS3JO3N4Hcjs.__name.call(void 0, appMiddlewareMayHandlePath, "appMiddlewareMayHandlePath");
9524
9564
  function routePatternSpecificity(pattern) {
@@ -9558,7 +9598,7 @@ function getPhysicalPrerenderBypassReason(options) {
9558
9598
  }
9559
9599
  if (appMiddlewareMayHandlePath(middlewareRoutes, pathname)) return "app middleware";
9560
9600
  if (configMiddlewareMayHandlePath(config.middleware, pathname)) return "configured middleware";
9561
- if (_chunkUVW64BCBcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
9601
+ if (_chunk3A4KGQYIcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
9562
9602
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
9563
9603
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
9564
9604
  if (_optionalChain([manifestEntry, 'optionalAccess', _168 => _168.rendering]) === "dynamic") return "dynamic runtime manifest";
@@ -9584,7 +9624,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
9584
9624
  const nitroBuilder = nitroBuilderResult.value;
9585
9625
  const isVercel = preset === "vercel" || preset === "vercel-edge";
9586
9626
  const isCloudflareWorker = preset === "cloudflare-module";
9587
- const outputDir = _chunkUVW64BCBcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
9627
+ const outputDir = _chunk3A4KGQYIcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
9588
9628
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
9589
9629
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
9590
9630
  const imageRuntime = resolveImageRuntime(config, preset);
@@ -10092,13 +10132,13 @@ function toFarmNodeResponse(request, response) {
10092
10132
  }
10093
10133
  if (prerenderRoutes.length > 0) {
10094
10134
  _chunk5QIKR7RRcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
10095
- const previousPrerender = process.env[_chunkTKSCR644cjs.FARM_PRERENDER_ENV];
10096
- process.env[_chunkTKSCR644cjs.FARM_PRERENDER_ENV] = "1";
10135
+ const previousPrerender = process.env[_chunkD3C5LBQYcjs.FARM_PRERENDER_ENV];
10136
+ process.env[_chunkD3C5LBQYcjs.FARM_PRERENDER_ENV] = "1";
10097
10137
  try {
10098
10138
  await nitroBuilder.prerender(nitroInstance);
10099
10139
  } finally {
10100
- if (previousPrerender === void 0) delete process.env[_chunkTKSCR644cjs.FARM_PRERENDER_ENV];
10101
- else process.env[_chunkTKSCR644cjs.FARM_PRERENDER_ENV] = previousPrerender;
10140
+ if (previousPrerender === void 0) delete process.env[_chunkD3C5LBQYcjs.FARM_PRERENDER_ENV];
10141
+ else process.env[_chunkD3C5LBQYcjs.FARM_PRERENDER_ENV] = previousPrerender;
10102
10142
  }
10103
10143
  }
10104
10144
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs, preset) : Promise.resolve(null);
@@ -10376,7 +10416,7 @@ async function stageSharpRuntime(config, root, distDir, fs, preset) {
10376
10416
  try {
10377
10417
  await copyPackage("sharp", sharpRequire);
10378
10418
  if (!copiedPackages.has("sharp")) {
10379
- throw new Error(`Farm image optimization requires sharp. ${_chunkNMHWYWDRcjs.SHARP_INSTALL_HINT}`);
10419
+ throw new Error(`Farm image optimization requires sharp. ${_chunkQ5FYSK45cjs.SHARP_INSTALL_HINT}`);
10380
10420
  }
10381
10421
  } catch (error) {
10382
10422
  await fs.rm(stageDir, { recursive: true, force: true });
@@ -10577,6 +10617,30 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs) {
10577
10617
  }
10578
10618
  _chunkS3JO3N4Hcjs.__name.call(void 0, copyPrismaClientForVercel, "copyPrismaClientForVercel");
10579
10619
 
10620
+ // src/build/project-module-runner.ts
10621
+ async function createFarmProjectModuleSsrEnvironment() {
10622
+ const vite = await import("vite");
10623
+ const { ModuleRunner, createNodeImportMeta } = await import("vite/module-runner");
10624
+ return {
10625
+ dev: {
10626
+ createEnvironment(name, config) {
10627
+ return vite.createRunnableDevEnvironment(name, config, {
10628
+ runner: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (environment) => new ModuleRunner({
10629
+ transport: {
10630
+ ...vite.createServerModuleRunnerTransport({ channel: environment.hot }),
10631
+ timeout: 0
10632
+ },
10633
+ hmr: false,
10634
+ createImportMeta: createNodeImportMeta,
10635
+ sourcemapInterceptor: "node"
10636
+ }), "runner")
10637
+ });
10638
+ }
10639
+ }
10640
+ };
10641
+ }
10642
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmProjectModuleSsrEnvironment, "createFarmProjectModuleSsrEnvironment");
10643
+
10580
10644
  // src/build/index.ts
10581
10645
  async function build(config, options = {}) {
10582
10646
  return _chunkMT763TDWcjs.withProductionNodeEnv.call(void 0, () => buildWithProductionNodeEnv(config, options));
@@ -10590,7 +10654,7 @@ function createBuildTargetBaseline(config) {
10590
10654
  preset,
10591
10655
  distDir,
10592
10656
  outputDir,
10593
- outputWasDerived: outputDir === _chunkUVW64BCBcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
10657
+ outputWasDerived: outputDir === _chunk3A4KGQYIcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
10594
10658
  };
10595
10659
  }
10596
10660
  _chunkS3JO3N4Hcjs.__name.call(void 0, createBuildTargetBaseline, "createBuildTargetBaseline");
@@ -10600,8 +10664,8 @@ function resolveBuildTargets(config, options, baseline) {
10600
10664
  const distDir = config.distDir || ".farm";
10601
10665
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
10602
10666
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
10603
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkUVW64BCBcjs.getDeployTargetForPreset.call(void 0, preset);
10604
- const outputDir = shouldRefreshDerivedOutput ? _chunkUVW64BCBcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
10667
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunk3A4KGQYIcjs.getDeployTargetForPreset.call(void 0, preset);
10668
+ const outputDir = shouldRefreshDerivedOutput ? _chunk3A4KGQYIcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
10605
10669
  return {
10606
10670
  root,
10607
10671
  preset,
@@ -10609,7 +10673,7 @@ function resolveBuildTargets(config, options, baseline) {
10609
10673
  distDir,
10610
10674
  deployTarget,
10611
10675
  outputDir,
10612
- deployOutputDir: _chunkUVW64BCBcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
10676
+ deployOutputDir: _chunk3A4KGQYIcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
10613
10677
  };
10614
10678
  }
10615
10679
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveBuildTargets, "resolveBuildTargets");
@@ -10618,7 +10682,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10618
10682
  const targetBaseline = createBuildTargetBaseline(config);
10619
10683
  let targets;
10620
10684
  const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))]);
10621
- const pluginManager = new (0, _chunkNMHWYWDRcjs.PluginManager)({
10685
+ const pluginManager = new (0, _chunkQ5FYSK45cjs.PluginManager)({
10622
10686
  config,
10623
10687
  isDev: false,
10624
10688
  isProd: true
@@ -10647,7 +10711,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10647
10711
  };
10648
10712
  config = {
10649
10713
  ...config,
10650
- images: _chunkNMHWYWDRcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
10714
+ images: _chunkQ5FYSK45cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
10651
10715
  root: targets.root,
10652
10716
  preset: targets.preset
10653
10717
  })
@@ -10675,11 +10739,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10675
10739
  root,
10676
10740
  rendererBuild.signal
10677
10741
  );
10678
- const farmApp = _chunkNMHWYWDRcjs.createFarmApp.call(void 0, config, projectModuleServer);
10742
+ const farmApp = _chunkQ5FYSK45cjs.createFarmApp.call(void 0, config, projectModuleServer);
10679
10743
  await farmApp.initialize();
10680
10744
  const routeManager = farmApp.getRouteManager();
10681
10745
  const serverRenderer = farmApp.getServerRenderer();
10682
- const typeArtifacts = _chunkJNUWCDTFcjs.generateFarmTypeArtifacts.call(void 0, {
10746
+ const typeArtifacts = _chunk5D2JIPLHcjs.generateFarmTypeArtifacts.call(void 0, {
10683
10747
  root,
10684
10748
  srcDir,
10685
10749
  layers: config.layers,
@@ -10695,7 +10759,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
10695
10759
  const message = error instanceof Error ? error.message : String(error);
10696
10760
  _chunk5QIKR7RRcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
10697
10761
  });
10698
- const apiRouteManager = new (0, _chunkFO427P6Icjs.APIRouteManager)(
10762
+ const apiRouteManager = new (0, _chunkU6MPZ35Qcjs.APIRouteManager)(
10699
10763
  _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, config),
10700
10764
  projectModuleServer,
10701
10765
  {
@@ -10782,7 +10846,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10782
10846
  ssr: true,
10783
10847
  buildLifetime
10784
10848
  });
10785
- const viteConfig = _chunkNMHWYWDRcjs.mergeFarmViteConfig.call(void 0,
10849
+ const viteConfig = _chunkQ5FYSK45cjs.mergeFarmViteConfig.call(void 0,
10786
10850
  {
10787
10851
  root,
10788
10852
  appType: "custom",
@@ -10794,7 +10858,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10794
10858
  },
10795
10859
  plugins: [
10796
10860
  ...rendererVitePlugins,
10797
- _chunkNMHWYWDRcjs.farmFontImportsPlugin.call(void 0, {
10861
+ _chunkQ5FYSK45cjs.farmFontImportsPlugin.call(void 0, {
10798
10862
  root,
10799
10863
  basePath: config.basePath,
10800
10864
  publicDir: config.publicDir
@@ -10806,7 +10870,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10806
10870
  hmr: false
10807
10871
  },
10808
10872
  resolve: {
10809
- alias: _chunkNMHWYWDRcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10873
+ alias: _chunkQ5FYSK45cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
10810
10874
  dedupe: [...config.renderer.dedupe || []]
10811
10875
  },
10812
10876
  optimizeDeps: {
@@ -10837,6 +10901,14 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
10837
10901
  optimizeDeps: {
10838
10902
  ...viteConfig.optimizeDeps,
10839
10903
  noDiscovery: true
10904
+ },
10905
+ // An app or plugin that brings its own SSR environment keeps it.
10906
+ environments: _optionalChain([viteConfig, 'access', _210 => _210.environments, 'optionalAccess', _211 => _211.ssr, 'optionalAccess', _212 => _212.dev, 'optionalAccess', _213 => _213.createEnvironment]) ? viteConfig.environments : {
10907
+ ...viteConfig.environments,
10908
+ ssr: {
10909
+ ..._optionalChain([viteConfig, 'access', _214 => _214.environments, 'optionalAccess', _215 => _215.ssr]),
10910
+ ...await createFarmProjectModuleSsrEnvironment()
10911
+ }
10840
10912
  }
10841
10913
  });
10842
10914
  }
@@ -10892,7 +10964,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
10892
10964
  define: {
10893
10965
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
10894
10966
  __FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
10895
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _210 => _210.env, 'optionalAccess', _211 => _211.public]) || {})
10967
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _216 => _216.env, 'optionalAccess', _217 => _217.public]) || {})
10896
10968
  },
10897
10969
  plugins: [
10898
10970
  farmI18nClientBridgePlugin(),
@@ -10927,7 +10999,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10927
10999
  if (pluginManager) {
10928
11000
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
10929
11001
  }
10930
- const outputDir = _chunkUVW64BCBcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
11002
+ const outputDir = _chunk3A4KGQYIcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10931
11003
  const serverOutputDir = _path2.default.join(outputDir, "server");
10932
11004
  const publicOutputDir = _path2.default.join(outputDir, "public");
10933
11005
  const { mkdir, cp } = await import("fs/promises");
@@ -10998,7 +11070,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
10998
11070
  root,
10999
11071
  preset,
11000
11072
  distDir,
11001
- outputDir: _chunkUVW64BCBcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
11073
+ outputDir: _chunk3A4KGQYIcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
11002
11074
  });
11003
11075
  }
11004
11076
  }