@farm.js/core 0.1.36 → 0.1.38

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 (272) hide show
  1. package/dist/{agent-mcp-BVExL8rZ.d.mts → agent-mcp-BwKlpnc7.d.mts} +1 -1
  2. package/dist/{agent-mcp-luzfXK-P.d.ts → agent-mcp-De1imoMS.d.ts} +1 -1
  3. package/dist/{agent-mcp-handler-SJAHFSPI.cjs → agent-mcp-handler-MRGP3WJ3.cjs} +5 -5
  4. package/dist/{agent-mcp-handler-LPJ2CADR.mjs → agent-mcp-handler-OLRMZONF.mjs} +4 -4
  5. package/dist/agent-runtime.cjs +3 -3
  6. package/dist/agent-runtime.d.mts +1 -1
  7. package/dist/agent-runtime.d.ts +1 -1
  8. package/dist/agent-runtime.mjs +2 -2
  9. package/dist/api/client.cjs +3 -3
  10. package/dist/api/client.mjs +2 -2
  11. package/dist/api/route-manager.cjs +6 -6
  12. package/dist/api/route-manager.d.mts +3 -3
  13. package/dist/api/route-manager.d.ts +3 -3
  14. package/dist/api/route-manager.mjs +5 -5
  15. package/dist/api/runtime.cjs +4 -4
  16. package/dist/api/runtime.d.mts +2 -2
  17. package/dist/api/runtime.d.ts +2 -2
  18. package/dist/api/runtime.mjs +3 -3
  19. package/dist/api.cjs +9 -8
  20. package/dist/api.d.mts +3 -3
  21. package/dist/api.d.ts +3 -3
  22. package/dist/api.mjs +8 -7
  23. package/dist/{app-BukwkFIu.d.mts → app-CFZt-srr.d.mts} +21 -3
  24. package/dist/{app-Yfa2dsFy.d.ts → app-kT_QXTdx.d.ts} +21 -3
  25. package/dist/app-markdown.cjs +6 -4
  26. package/dist/app-markdown.d.mts +3 -3
  27. package/dist/app-markdown.d.ts +3 -3
  28. package/dist/app-markdown.mjs +5 -3
  29. package/dist/{chunk-ADEA7PN3.cjs → chunk-2DD4JMQC.cjs} +113 -22
  30. package/dist/chunk-2ZYGC6SS.cjs +576 -0
  31. package/dist/{chunk-JZVADIOD.cjs → chunk-34UCJRQO.cjs} +2 -2
  32. package/dist/{chunk-D2BB47NB.cjs → chunk-3LOLJTFV.cjs} +6 -6
  33. package/dist/{chunk-KXWRO25S.cjs → chunk-472NCAZ7.cjs} +3 -3
  34. package/dist/chunk-4E5QXOCL.cjs +109 -0
  35. package/dist/{chunk-Z2HLU4IX.cjs → chunk-4GWRFP22.cjs} +23 -2
  36. package/dist/{chunk-VQLJWDVW.cjs → chunk-4IE345DM.cjs} +37 -19
  37. package/dist/{chunk-O6WAEAX3.mjs → chunk-5BWWFHR2.mjs} +70 -15
  38. package/dist/{chunk-JNUWCDTF.cjs → chunk-5D2JIPLH.cjs} +2 -2
  39. package/dist/{chunk-BO36SELV.cjs → chunk-5OKBARDN.cjs} +2 -2
  40. package/dist/{chunk-AO6RYU5N.cjs → chunk-5PWXMJOH.cjs} +30 -22
  41. package/dist/{chunk-AHGECQEW.mjs → chunk-666CKENS.mjs} +1 -1
  42. package/dist/chunk-6BK3K2GB.mjs +318 -0
  43. package/dist/{chunk-O6I6VWKK.mjs → chunk-6HB6V3R7.mjs} +1 -1
  44. package/dist/{chunk-UXFQ3UDA.cjs → chunk-6XWDE2P2.cjs} +61 -4
  45. package/dist/{chunk-VILIPRS6.mjs → chunk-7FPTZLKH.mjs} +1 -1
  46. package/dist/{chunk-SC2WYWPF.mjs → chunk-7PEP3BUT.mjs} +3 -3
  47. package/dist/{chunk-4E5AEDKY.mjs → chunk-A3EAIURZ.mjs} +25 -7
  48. package/dist/{chunk-YDQZGSDS.mjs → chunk-ARC7I3O2.mjs} +1 -1
  49. package/dist/{chunk-LSZAVSGY.mjs → chunk-B6G5CKMC.mjs} +101 -10
  50. package/dist/{chunk-3KZS4SUS.mjs → chunk-BZHXGVMA.mjs} +1 -1
  51. package/dist/{chunk-KN7K4VQN.mjs → chunk-CNNOLE4O.mjs} +1 -1
  52. package/dist/{chunk-4GLOOWKE.mjs → chunk-CQMVIOYP.mjs} +1 -1
  53. package/dist/{chunk-2ELDTQRN.mjs → chunk-CUM5NYL5.mjs} +1 -1
  54. package/dist/{chunk-HITLGIAO.cjs → chunk-CY2ZQ5C6.cjs} +7 -6
  55. package/dist/{chunk-PZNL3WEG.mjs → chunk-DMEPTZTI.mjs} +22 -11
  56. package/dist/{chunk-QORUJDIV.mjs → chunk-DRLKAXDM.mjs} +2 -2
  57. package/dist/{chunk-DQQOKWYA.cjs → chunk-EIPC3FDA.cjs} +12 -4
  58. package/dist/{chunk-HOXTWRGB.mjs → chunk-EKF7KDFD.mjs} +5 -2
  59. package/dist/{chunk-42NHY7HW.cjs → chunk-EKN7NSZO.cjs} +62 -14
  60. package/dist/{chunk-YKX5BK66.cjs → chunk-EMO6K4YY.cjs} +7 -7
  61. package/dist/{chunk-6SJ2KJTA.mjs → chunk-EPYU2EBL.mjs} +1 -1
  62. package/dist/{chunk-D227TIEN.cjs → chunk-FWE7LEQC.cjs} +13 -13
  63. package/dist/{chunk-PTZ2TVNE.cjs → chunk-H5CLOUZS.cjs} +5 -5
  64. package/dist/{chunk-DTSROJ5J.mjs → chunk-HD5CF3OE.mjs} +1 -1
  65. package/dist/{chunk-35GKZR22.mjs → chunk-HXRYZWTA.mjs} +1 -1
  66. package/dist/{chunk-JG6DJF5A.mjs → chunk-HZFM2LWQ.mjs} +22 -1
  67. package/dist/{chunk-MKYBIIAQ.mjs → chunk-IBUQWVYA.mjs} +17 -1
  68. package/dist/{chunk-F2SE2VDO.mjs → chunk-IHQIOZLC.mjs} +1 -1
  69. package/dist/{chunk-W7LF2J2S.mjs → chunk-INL3THCU.mjs} +1 -1
  70. package/dist/{chunk-WZ77PUAM.mjs → chunk-IVLZZZEI.mjs} +1 -1
  71. package/dist/{chunk-ENLZ4R3Y.mjs → chunk-J7K2NZD6.mjs} +7 -6
  72. package/dist/{chunk-BPOF5U4N.mjs → chunk-JCKYH4LG.mjs} +10 -7
  73. package/dist/{chunk-77GNHH2Z.cjs → chunk-JCYYXBAJ.cjs} +3 -3
  74. package/dist/{chunk-C4SPBWFM.cjs → chunk-JEZO6VUR.cjs} +10 -1
  75. package/dist/{chunk-ZWM5KGAA.cjs → chunk-KCQBAKIY.cjs} +23 -20
  76. package/dist/{chunk-OTC5BDGO.mjs → chunk-KHKLMNI5.mjs} +12 -7
  77. package/dist/{chunk-DZ5ZVB2K.cjs → chunk-KKSTAEMY.cjs} +1 -1
  78. package/dist/{chunk-N2NAS2AM.cjs → chunk-L4DD7ODZ.cjs} +2 -2
  79. package/dist/{chunk-YSCV4SJF.cjs → chunk-L5H2GSUC.cjs} +4 -4
  80. package/dist/{chunk-OO7GXVSR.mjs → chunk-LI2F57NI.mjs} +1 -1
  81. package/dist/{chunk-NRSN7G7E.mjs → chunk-MLY2RP5R.mjs} +10 -2
  82. package/dist/{chunk-BPMATOP2.cjs → chunk-N32CC42M.cjs} +25 -20
  83. package/dist/{chunk-FNO7A7CM.cjs → chunk-NBBEQLOK.cjs} +34 -16
  84. package/dist/{chunk-XCMCS4DA.mjs → chunk-ND2CWPOD.mjs} +2 -2
  85. package/dist/{chunk-GQRWBCWK.mjs → chunk-OAHTRMIC.mjs} +13 -5
  86. package/dist/{chunk-35WV46VL.mjs → chunk-OCIEZME4.mjs} +876 -685
  87. package/dist/{chunk-UH6QN5NL.mjs → chunk-P664ZVTV.mjs} +2 -2
  88. package/dist/{chunk-TE2G5ION.cjs → chunk-PGZDEPTM.cjs} +88 -33
  89. package/dist/{chunk-FDR64H6B.mjs → chunk-POSPE3IO.mjs} +59 -2
  90. package/dist/{chunk-UVW64BCB.cjs → chunk-Q3NXS4MU.cjs} +16 -14
  91. package/dist/{chunk-4WCZJQUO.mjs → chunk-QFW2IH5E.mjs} +57 -9
  92. package/dist/{chunk-5SJWVY6R.mjs → chunk-QHSH7IH4.mjs} +9 -0
  93. package/dist/chunk-QRKIMN7T.mjs +48 -0
  94. package/dist/chunk-QTXBII4Z.cjs +632 -0
  95. package/dist/{chunk-CI6E3UOH.cjs → chunk-RG4A6LB2.cjs} +7 -7
  96. package/dist/{chunk-BJPBQNIE.cjs → chunk-RW63BOV7.cjs} +2 -2
  97. package/dist/{chunk-FO427P6I.cjs → chunk-RWFLWR5J.cjs} +10 -10
  98. package/dist/{chunk-FFFW3OQ7.cjs → chunk-S6FJO323.cjs} +2 -2
  99. package/dist/{chunk-EUV4YR3V.cjs → chunk-SGBJ247Q.cjs} +18 -2
  100. package/dist/chunk-SGBZPZUW.mjs +75 -0
  101. package/dist/{chunk-2NNMOPDN.mjs → chunk-SKVTP5PR.mjs} +4 -1
  102. package/dist/{chunk-2YTDKNH3.cjs → chunk-TGFQVLLF.cjs} +956 -765
  103. package/dist/{chunk-IHNIDL6H.cjs → chunk-TO4GJ56K.cjs} +22 -11
  104. package/dist/{chunk-276VJSM6.mjs → chunk-TUBTR2OP.mjs} +250 -118
  105. package/dist/{chunk-GQ3Z3IZI.cjs → chunk-TYJALEHQ.cjs} +18 -18
  106. package/dist/chunk-TYMMBFN2.mjs +109 -0
  107. package/dist/chunk-U6QLDL3G.mjs +576 -0
  108. package/dist/{chunk-U4KT7QP3.cjs → chunk-ULASELLA.cjs} +26 -1
  109. package/dist/chunk-UXHS27O6.cjs +75 -0
  110. package/dist/{chunk-WWIKMBRN.mjs → chunk-VNGH5MLF.mjs} +17 -1
  111. package/dist/{chunk-EZDQRNQ7.mjs → chunk-VT4WFRHA.mjs} +23 -5
  112. package/dist/{chunk-CBJJH36A.cjs → chunk-VU6AAZVY.cjs} +20 -4
  113. package/dist/{chunk-27ZWSI3W.cjs → chunk-VXEEATVD.cjs} +2 -2
  114. package/dist/{chunk-EWET4D2Y.mjs → chunk-W36M2BQ4.mjs} +3 -3
  115. package/dist/{chunk-4WQ6PGSJ.cjs → chunk-WEW2JVA4.cjs} +4 -4
  116. package/dist/{chunk-4E5WBPEG.mjs → chunk-WFRT7JPX.mjs} +8 -533
  117. package/dist/{chunk-T4OGRVNS.mjs → chunk-WLL43JMO.mjs} +2 -2
  118. package/dist/chunk-WW46B6HA.cjs +318 -0
  119. package/dist/{chunk-TKSCR644.cjs → chunk-WXJLNP33.cjs} +2 -2
  120. package/dist/{chunk-S6VYG6XU.cjs → chunk-XKG2BLFN.cjs} +2 -2
  121. package/dist/{chunk-4NU4GGTC.cjs → chunk-XKVVMZP5.cjs} +6 -3
  122. package/dist/{chunk-NMHWYWDR.cjs → chunk-YR2VBEMO.cjs} +658 -526
  123. package/dist/{chunk-OHLSEQ57.mjs → chunk-ZJD2PN6Z.mjs} +10 -8
  124. package/dist/{chunk-3BU22U3M.cjs → chunk-ZXH4TS3F.cjs} +5 -2
  125. package/dist/{client-plugins-r1mOtSC1.d.ts → client-plugins-BvlNhGEB.d.ts} +54 -7
  126. package/dist/{client-plugins-C3mK9Pol.d.mts → client-plugins-DUrIYX9B.d.mts} +54 -7
  127. package/dist/client-plugins.d.mts +1 -1
  128. package/dist/client-plugins.d.ts +1 -1
  129. package/dist/client.cjs +8 -8
  130. package/dist/client.d.mts +5 -5
  131. package/dist/client.d.ts +5 -5
  132. package/dist/client.mjs +7 -7
  133. package/dist/config.d.mts +1 -1
  134. package/dist/config.d.ts +1 -1
  135. package/dist/{devtools-ERIKFEXX.mjs → devtools-JYJNOLPQ.mjs} +8 -6
  136. package/dist/{devtools-JZJJY5CK.cjs → devtools-VQWJANJV.cjs} +9 -7
  137. package/dist/docs.cjs +12 -10
  138. package/dist/docs.d.mts +20 -2
  139. package/dist/docs.d.ts +20 -2
  140. package/dist/docs.mjs +11 -9
  141. package/dist/headers.cjs +6 -4
  142. package/dist/headers.d.mts +11 -1
  143. package/dist/headers.d.ts +11 -1
  144. package/dist/headers.mjs +5 -3
  145. package/dist/i18n/client.cjs +11 -11
  146. package/dist/i18n/client.mjs +3 -3
  147. package/dist/index.cjs +62 -46
  148. package/dist/index.d.mts +16 -16
  149. package/dist/index.d.ts +16 -16
  150. package/dist/index.mjs +62 -46
  151. package/dist/integrations.cjs +5 -3
  152. package/dist/integrations.d.mts +1 -1
  153. package/dist/integrations.d.ts +1 -1
  154. package/dist/integrations.mjs +4 -2
  155. package/dist/internal/app-markdown-runtime.cjs +5 -3
  156. package/dist/internal/app-markdown-runtime.d.mts +19 -5
  157. package/dist/internal/app-markdown-runtime.d.ts +19 -5
  158. package/dist/internal/app-markdown-runtime.mjs +4 -2
  159. package/dist/internal/build-runtime.cjs +33 -30
  160. package/dist/internal/build-runtime.d.mts +3 -3
  161. package/dist/internal/build-runtime.d.ts +3 -3
  162. package/dist/internal/build-runtime.mjs +32 -29
  163. package/dist/internal/cli-runtime.cjs +14 -12
  164. package/dist/internal/cli-runtime.mjs +13 -11
  165. package/dist/internal/client-error-overlay.cjs +4 -4
  166. package/dist/internal/client-error-overlay.mjs +1 -1
  167. package/dist/internal/client-runtime.cjs +2 -2
  168. package/dist/internal/client-runtime.mjs +1 -1
  169. package/dist/internal/compression-runtime.d.mts +1 -1
  170. package/dist/internal/compression-runtime.d.ts +1 -1
  171. package/dist/internal/config-runtime.cjs +9 -7
  172. package/dist/internal/config-runtime.d.mts +2 -2
  173. package/dist/internal/config-runtime.d.ts +2 -2
  174. package/dist/internal/config-runtime.mjs +8 -6
  175. package/dist/internal/docs-precompiled-runtime.cjs +19 -13
  176. package/dist/internal/docs-precompiled-runtime.d.mts +5 -0
  177. package/dist/internal/docs-precompiled-runtime.d.ts +5 -0
  178. package/dist/internal/docs-precompiled-runtime.mjs +14 -8
  179. package/dist/internal/infra-analytics-runtime.cjs +5 -5
  180. package/dist/internal/infra-analytics-runtime.mjs +3 -3
  181. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  182. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  183. package/dist/internal/production-node-env.cjs +6 -2
  184. package/dist/internal/production-node-env.d.mts +10 -1
  185. package/dist/internal/production-node-env.d.ts +10 -1
  186. package/dist/internal/production-node-env.mjs +5 -1
  187. package/dist/internal/production-runtime.cjs +39 -54
  188. package/dist/internal/production-runtime.d.mts +51 -11
  189. package/dist/internal/production-runtime.d.ts +51 -11
  190. package/dist/internal/production-runtime.mjs +39 -54
  191. package/dist/markdown.cjs +8 -2
  192. package/dist/markdown.d.mts +1 -1
  193. package/dist/markdown.d.ts +1 -1
  194. package/dist/markdown.mjs +7 -1
  195. package/dist/middleware.cjs +10 -8
  196. package/dist/middleware.d.mts +27 -5
  197. package/dist/middleware.d.ts +27 -5
  198. package/dist/middleware.mjs +10 -8
  199. package/dist/navigation.cjs +7 -7
  200. package/dist/navigation.d.mts +4 -4
  201. package/dist/navigation.d.ts +4 -4
  202. package/dist/navigation.mjs +6 -6
  203. package/dist/plugin.cjs +25 -23
  204. package/dist/plugin.d.mts +1 -1
  205. package/dist/plugin.d.ts +1 -1
  206. package/dist/plugin.mjs +24 -22
  207. package/dist/{production-runtime-CCeVZXst.d.mts → production-runtime-BQ4_WLwQ.d.mts} +1 -1
  208. package/dist/{production-runtime-DPnsggY3.d.ts → production-runtime-D2aMyzjr.d.ts} +1 -1
  209. package/dist/query/client.cjs +9 -9
  210. package/dist/query/client.mjs +4 -4
  211. package/dist/{render-plan-Cw4f5E_R.d.ts → render-plan-25p4hrj4.d.ts} +1 -1
  212. package/dist/{render-plan-BuGaPFe6.d.mts → render-plan-DtkXMN8D.d.mts} +1 -1
  213. package/dist/renderer-client.cjs +12 -12
  214. package/dist/renderer-client.d.mts +3 -3
  215. package/dist/renderer-client.d.ts +3 -3
  216. package/dist/renderer-client.mjs +4 -4
  217. package/dist/renderer.d.mts +13 -4
  218. package/dist/renderer.d.ts +13 -4
  219. package/dist/{request-CsGARcAw.d.mts → request-DgCkIdcn.d.mts} +4 -2
  220. package/dist/{request-Bkg-hERy.d.ts → request-jF4jwx8f.d.ts} +4 -2
  221. package/dist/request.cjs +3 -3
  222. package/dist/request.d.mts +2 -2
  223. package/dist/request.d.ts +2 -2
  224. package/dist/request.mjs +2 -2
  225. package/dist/{route-rendering-BUZMH_64.d.ts → route-rendering-Bji6S6a_.d.ts} +1 -1
  226. package/dist/{route-rendering-f11yh5dp.d.mts → route-rendering-CSBF78Ya.d.mts} +1 -1
  227. package/dist/{router-Cp6yRE8A.d.mts → router-B09Ui3Qm.d.mts} +1 -1
  228. package/dist/{router-B8CR9GbD.d.ts → router-CPB9cXtG.d.ts} +1 -1
  229. package/dist/routes.cjs +2 -2
  230. package/dist/routes.d.mts +1 -1
  231. package/dist/routes.d.ts +1 -1
  232. package/dist/routes.mjs +1 -1
  233. package/dist/{runtime-CAEv36S_.d.mts → runtime-CM6E6yuI.d.mts} +1 -1
  234. package/dist/{runtime-CQVsT330.d.ts → runtime-EDMwLdjv.d.ts} +1 -1
  235. package/dist/server-fn.cjs +3 -3
  236. package/dist/server-fn.mjs +2 -2
  237. package/dist/server-plugins.cjs +5 -5
  238. package/dist/server-plugins.d.mts +2 -2
  239. package/dist/server-plugins.d.ts +2 -2
  240. package/dist/server-plugins.mjs +4 -4
  241. package/dist/server-query.cjs +4 -4
  242. package/dist/server-query.mjs +3 -3
  243. package/dist/server.cjs +51 -49
  244. package/dist/server.d.mts +7 -7
  245. package/dist/server.d.ts +7 -7
  246. package/dist/server.mjs +29 -27
  247. package/dist/{spa-router-BuciWGCZ.d.ts → spa-router-B_N8XgVu.d.ts} +2 -2
  248. package/dist/{spa-router-DwbqGkGj.d.mts → spa-router-Cgimzfbi.d.mts} +2 -2
  249. package/dist/testing.cjs +8 -8
  250. package/dist/testing.d.mts +1 -1
  251. package/dist/testing.d.ts +1 -1
  252. package/dist/testing.mjs +6 -6
  253. package/dist/theme/server.cjs +4 -4
  254. package/dist/theme/server.mjs +3 -3
  255. package/dist/{utils-CaoWKtYM.d.ts → utils-BNxAKAuT.d.ts} +1 -1
  256. package/dist/{utils-B9V0S_yL.d.mts → utils-DZciYXYl.d.mts} +1 -1
  257. package/dist/version.cjs +2 -2
  258. package/dist/version.mjs +1 -1
  259. package/dist/vite.cjs +25 -23
  260. package/dist/vite.d.mts +1 -1
  261. package/dist/vite.d.ts +1 -1
  262. package/dist/vite.mjs +24 -22
  263. package/package.json +1 -1
  264. package/types/middleware.d.ts +5 -1
  265. package/dist/chunk-655RLQQL.mjs +0 -43
  266. package/dist/chunk-FXEF4PPL.mjs +0 -47
  267. package/dist/chunk-IZY3V5XW.mjs +0 -23
  268. package/dist/chunk-MRMI32SN.cjs +0 -1157
  269. package/dist/chunk-MT763TDW.cjs +0 -43
  270. package/dist/chunk-XD32KALF.cjs +0 -47
  271. /package/dist/{chunk-SJNMVDDF.cjs → chunk-FUCSUGDM.cjs} +0 -0
  272. /package/dist/{chunk-UDNPLXW7.mjs → chunk-MYIZXDZA.mjs} +0 -0
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkJNUWCDTFcjs = require('./chunk-JNUWCDTF.cjs');
7
+ var _chunk5D2JIPLHcjs = require('./chunk-5D2JIPLH.cjs');
8
8
 
9
9
 
10
10
 
@@ -42,15 +42,17 @@ var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
42
42
 
43
43
 
44
44
 
45
- var _chunkADEA7PN3cjs = require('./chunk-ADEA7PN3.cjs');
46
45
 
47
46
 
47
+ var _chunk2DD4JMQCcjs = require('./chunk-2DD4JMQC.cjs');
48
48
 
49
49
 
50
50
 
51
51
 
52
52
 
53
- var _chunkPTZ2TVNEcjs = require('./chunk-PTZ2TVNE.cjs');
53
+
54
+
55
+ var _chunkH5CLOUZScjs = require('./chunk-H5CLOUZS.cjs');
54
56
 
55
57
 
56
58
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
@@ -73,12 +75,12 @@ var _chunk3SDFA7UFcjs = require('./chunk-3SDFA7UF.cjs');
73
75
 
74
76
 
75
77
 
76
- var _chunkKXWRO25Scjs = require('./chunk-KXWRO25S.cjs');
78
+ var _chunk472NCAZ7cjs = require('./chunk-472NCAZ7.cjs');
77
79
 
78
80
 
79
81
 
80
82
 
81
- var _chunkHITLGIAOcjs = require('./chunk-HITLGIAO.cjs');
83
+ var _chunkCY2ZQ5C6cjs = require('./chunk-CY2ZQ5C6.cjs');
82
84
 
83
85
 
84
86
 
@@ -124,19 +126,22 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
124
126
 
125
127
 
126
128
 
129
+ var _chunkQTXBII4Zcjs = require('./chunk-QTXBII4Z.cjs');
130
+
127
131
 
128
132
 
129
133
 
130
134
 
131
135
 
132
- var _chunkMRMI32SNcjs = require('./chunk-MRMI32SN.cjs');
136
+ var _chunkWEW2JVA4cjs = require('./chunk-WEW2JVA4.cjs');
133
137
 
134
138
 
135
139
 
136
140
 
137
141
 
138
142
 
139
- var _chunk4WQ6PGSJcjs = require('./chunk-4WQ6PGSJ.cjs');
143
+
144
+ var _chunk2ZYGC6SScjs = require('./chunk-2ZYGC6SS.cjs');
140
145
 
141
146
 
142
147
 
@@ -154,12 +159,12 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
154
159
 
155
160
 
156
161
 
157
- var _chunkJZVADIODcjs = require('./chunk-JZVADIOD.cjs');
162
+ var _chunk34UCJRQOcjs = require('./chunk-34UCJRQO.cjs');
158
163
 
159
164
 
160
165
 
161
166
 
162
- var _chunk42NHY7HWcjs = require('./chunk-42NHY7HW.cjs');
167
+ var _chunkEKN7NSZOcjs = require('./chunk-EKN7NSZO.cjs');
163
168
 
164
169
 
165
170
 
@@ -173,7 +178,9 @@ var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
173
178
 
174
179
 
175
180
 
176
- var _chunkEUV4YR3Vcjs = require('./chunk-EUV4YR3V.cjs');
181
+
182
+
183
+ var _chunkSGBJ247Qcjs = require('./chunk-SGBJ247Q.cjs');
177
184
 
178
185
 
179
186
  var _chunkSDOTRX3Vcjs = require('./chunk-SDOTRX3V.cjs');
@@ -196,10 +203,10 @@ var _chunk6QQDAAAZcjs = require('./chunk-6QQDAAAZ.cjs');
196
203
 
197
204
 
198
205
 
199
- var _chunkCBJJH36Acjs = require('./chunk-CBJJH36A.cjs');
206
+ var _chunkVU6AAZVYcjs = require('./chunk-VU6AAZVY.cjs');
200
207
 
201
208
 
202
- var _chunkZWM5KGAAcjs = require('./chunk-ZWM5KGAA.cjs');
209
+ var _chunkKCQBAKIYcjs = require('./chunk-KCQBAKIY.cjs');
203
210
 
204
211
 
205
212
 
@@ -209,7 +216,10 @@ var _chunkM7MKQXAFcjs = require('./chunk-M7MKQXAF.cjs');
209
216
 
210
217
 
211
218
 
212
- var _chunk3BU22U3Mcjs = require('./chunk-3BU22U3M.cjs');
219
+ var _chunkZXH4TS3Fcjs = require('./chunk-ZXH4TS3F.cjs');
220
+
221
+
222
+ var _chunkUXHS27O6cjs = require('./chunk-UXHS27O6.cjs');
213
223
 
214
224
 
215
225
  var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
@@ -218,11 +228,11 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
218
228
  var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
219
229
 
220
230
 
221
- var _chunkFO427P6Icjs = require('./chunk-FO427P6I.cjs');
231
+ var _chunkRWFLWR5Jcjs = require('./chunk-RWFLWR5J.cjs');
222
232
 
223
233
 
224
234
 
225
- var _chunkSJNMVDDFcjs = require('./chunk-SJNMVDDF.cjs');
235
+ var _chunkFUCSUGDMcjs = require('./chunk-FUCSUGDM.cjs');
226
236
 
227
237
 
228
238
 
@@ -237,7 +247,7 @@ var _chunkXJXBIP67cjs = require('./chunk-XJXBIP67.cjs');
237
247
  var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
238
248
 
239
249
 
240
- var _chunkS6VYG6XUcjs = require('./chunk-S6VYG6XU.cjs');
250
+ var _chunkXKG2BLFNcjs = require('./chunk-XKG2BLFN.cjs');
241
251
 
242
252
 
243
253
  var _chunk75RZHGLScjs = require('./chunk-75RZHGLS.cjs');
@@ -322,7 +332,7 @@ var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
322
332
  var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
323
333
 
324
334
 
325
- var _chunkDZ5ZVB2Kcjs = require('./chunk-DZ5ZVB2K.cjs');
335
+ var _chunkKKSTAEMYcjs = require('./chunk-KKSTAEMY.cjs');
326
336
 
327
337
 
328
338
 
@@ -360,7 +370,7 @@ var _chunkQBK2AA4Ucjs = require('./chunk-QBK2AA4U.cjs');
360
370
  var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
361
371
 
362
372
 
363
- var _chunk27ZWSI3Wcjs = require('./chunk-27ZWSI3W.cjs');
373
+ var _chunkVXEEATVDcjs = require('./chunk-VXEEATVD.cjs');
364
374
 
365
375
 
366
376
  var _chunkYX3DBN4Mcjs = require('./chunk-YX3DBN4M.cjs');
@@ -375,10 +385,12 @@ var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
375
385
 
376
386
 
377
387
 
378
- var _chunkUXFQ3UDAcjs = require('./chunk-UXFQ3UDA.cjs');
388
+
389
+ var _chunk6XWDE2P2cjs = require('./chunk-6XWDE2P2.cjs');
390
+
379
391
 
380
392
 
381
- var _chunkU4KT7QP3cjs = require('./chunk-U4KT7QP3.cjs');
393
+ var _chunkULASELLAcjs = require('./chunk-ULASELLA.cjs');
382
394
 
383
395
 
384
396
 
@@ -2043,8 +2055,8 @@ var _RouteManager = class _RouteManager {
2043
2055
  )
2044
2056
  );
2045
2057
  this.orderedLayouts = Array.from(this.layouts.values()).sort(
2046
- (left, right) => _chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, right.pattern)
2047
- ).map((entry) => ({ entry, groupScope: _chunkADEA7PN3cjs.getRouteGroupScope.call(void 0, entry.pattern) }));
2058
+ (left, right) => _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, right.pattern)
2059
+ ).map((entry) => ({ entry, groupScope: _chunk2DD4JMQCcjs.getRouteGroupScope.call(void 0, entry.pattern) }));
2048
2060
  for (const slot of this.routeSlots.values()) {
2049
2061
  if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
2050
2062
  this.routeSlotOwnerSegments.set(
@@ -2286,7 +2298,7 @@ var _RouteManager = class _RouteManager {
2286
2298
  }
2287
2299
  return absolutePath;
2288
2300
  }, "toUrlPath");
2289
- const integrationProviders = _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
2301
+ const integrationProviders = _chunkVU6AAZVYcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
2290
2302
  (provider) => provider.component || provider.type === "clerk"
2291
2303
  );
2292
2304
  const unsupportedIntegrationProvider = integrationProviders.find(
@@ -2325,7 +2337,7 @@ var _RouteManager = class _RouteManager {
2325
2337
  );
2326
2338
  const routeEntries = Array.from(this.routes.values()).map((entry) => ({
2327
2339
  entry,
2328
- metadata: _chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
2340
+ metadata: _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
2329
2341
  entry.modulePath,
2330
2342
  normalizedProjectRoot,
2331
2343
  isolatedMode,
@@ -2333,7 +2345,7 @@ var _RouteManager = class _RouteManager {
2333
2345
  )
2334
2346
  }));
2335
2347
  const markdownFallback = routeEntries.find(
2336
- ({ entry, metadata }) => _chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
2348
+ ({ entry, metadata }) => _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
2337
2349
  );
2338
2350
  if (markdownFallback) {
2339
2351
  _chunk5QIKR7RRcjs.logger.warn(
@@ -2341,7 +2353,7 @@ var _RouteManager = class _RouteManager {
2341
2353
  );
2342
2354
  }
2343
2355
  const markdownStaticPackages = _optionalChain([routeEntries, 'access', _121 => _121.find, 'call', _122 => _122(
2344
- ({ entry, metadata }) => _chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
2356
+ ({ entry, metadata }) => _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
2345
2357
  ), 'optionalAccess', _123 => _123.metadata, 'access', _124 => _124.staticPackageBoundaries]);
2346
2358
  if (markdownStaticPackages) {
2347
2359
  _chunk5QIKR7RRcjs.logger.info(
@@ -2349,7 +2361,7 @@ var _RouteManager = class _RouteManager {
2349
2361
  );
2350
2362
  }
2351
2363
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
2352
- if (_chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
2364
+ if (_chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
2353
2365
  _chunk5QIKR7RRcjs.logger.info(
2354
2366
  `[Farm.js] ${entry.pattern} is async, so it renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
2355
2367
  );
@@ -2357,15 +2369,15 @@ var _RouteManager = class _RouteManager {
2357
2369
  enforceFarmIsolatedHydrationRouteBudget(
2358
2370
  layoutEntries.map(({ entry, metadata }) => ({
2359
2371
  pattern: entry.pattern,
2360
- depth: _chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
2372
+ depth: _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
2361
2373
  metadata
2362
2374
  })),
2363
2375
  routeEntries.map(({ entry, metadata }) => ({
2364
2376
  pattern: getRouteEntryDirectory(entry),
2365
- depth: _chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
2377
+ depth: _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
2366
2378
  metadata
2367
2379
  })),
2368
- _chunkADEA7PN3cjs.routeBoundaryCoversDirectory
2380
+ _chunk2DD4JMQCcjs.routeBoundaryCoversDirectory
2369
2381
  );
2370
2382
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
2371
2383
  if (!metadata.costGuardExceeded) continue;
@@ -2384,7 +2396,7 @@ var _RouteManager = class _RouteManager {
2384
2396
  const routes = routeEntries.map(({ entry, metadata }) => {
2385
2397
  const programmaticPage = this.programmaticPages.get(entry.modulePath);
2386
2398
  const layoutShouldHydrate = layoutEntries.some(
2387
- ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkADEA7PN3cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
2399
+ ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunk2DD4JMQCcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
2388
2400
  );
2389
2401
  return {
2390
2402
  pattern: entry.pattern,
@@ -2503,13 +2515,13 @@ var _RouteManager = class _RouteManager {
2503
2515
  const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
2504
2516
  return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
2505
2517
  }
2506
- if (_chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
2518
+ if (_chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
2507
2519
  const mdxConfig = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, this.config.mdx);
2508
- const components = await _chunkJZVADIODcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
2520
+ const components = await _chunk34UCJRQOcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
2509
2521
  root: this.config.root,
2510
2522
  loadModule: this.viteServer ? (componentModulePath) => _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
2511
2523
  });
2512
- return await _chunkJZVADIODcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
2524
+ return await _chunk34UCJRQOcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
2513
2525
  components,
2514
2526
  config: mdxConfig
2515
2527
  });
@@ -2559,7 +2571,7 @@ var _RouteManager = class _RouteManager {
2559
2571
  */
2560
2572
  createRoutePattern(route) {
2561
2573
  if (route.segments.length === 0) return "/";
2562
- return "/" + route.segments.map(_chunkADEA7PN3cjs.formatRouteSegment).join("/");
2574
+ return "/" + route.segments.map(_chunk2DD4JMQCcjs.formatRouteSegment).join("/");
2563
2575
  }
2564
2576
  registerPageRoute(entry) {
2565
2577
  _chunkNO3WWW3Ncjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
@@ -2610,8 +2622,8 @@ var _RouteManager = class _RouteManager {
2610
2622
  }
2611
2623
  }
2612
2624
  for (const [pattern, group] of canonicalPageGroups) {
2613
- const componentFiles = group.files.filter((file) => !_chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, file));
2614
- const markdownFiles = group.files.filter(_chunk42NHY7HWcjs.isFarmMarkdownPageFile);
2625
+ const componentFiles = group.files.filter((file) => !_chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, file));
2626
+ const markdownFiles = group.files.filter(_chunkEKN7NSZOcjs.isFarmMarkdownPageFile);
2615
2627
  if (componentFiles.length > 1) {
2616
2628
  throw new Error(
2617
2629
  `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path9.default.join(appDir, file)).join(" and ")}.`
@@ -2653,7 +2665,7 @@ var _RouteManager = class _RouteManager {
2653
2665
  for (const file of files) {
2654
2666
  const route = _chunk5QIKR7RRcjs.parseRoutePath.call(void 0, file);
2655
2667
  const modulePath = path9.default.join(appDir, file);
2656
- const pattern = _chunkADEA7PN3cjs.createRouteDirectoryPattern.call(void 0, route);
2668
+ const pattern = _chunk2DD4JMQCcjs.createRouteDirectoryPattern.call(void 0, route);
2657
2669
  const existing = target.get(pattern);
2658
2670
  if (_optionalChain([existing, 'optionalAccess', _129 => _129.sourceRoot]) === source.root) {
2659
2671
  throw new Error(
@@ -2675,7 +2687,7 @@ var _RouteManager = class _RouteManager {
2675
2687
  const modulePath = path9.default.join(appDir, file);
2676
2688
  const pattern = this.createRoutePattern(slot.route);
2677
2689
  const ownerPattern = this.createRoutePattern(slot.ownerRoute);
2678
- const ownerDirectory = _chunkADEA7PN3cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
2690
+ const ownerDirectory = _chunk2DD4JMQCcjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
2679
2691
  const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
2680
2692
  const existing = this.routeSlots.get(key);
2681
2693
  if (_optionalChain([existing, 'optionalAccess', _130 => _130.sourceRoot]) === source.root) {
@@ -2751,7 +2763,7 @@ var _RouteManager = class _RouteManager {
2751
2763
  }
2752
2764
  }
2753
2765
  async discoverProgrammaticRoutes(source) {
2754
- const manifests = await _chunkSJNMVDDFcjs.loadProgrammaticRouteManifests.call(void 0, {
2766
+ const manifests = await _chunkFUCSUGDMcjs.loadProgrammaticRouteManifests.call(void 0, {
2755
2767
  root: source.root,
2756
2768
  srcDir: source.srcDir,
2757
2769
  loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (filePath) => this.loadProgrammaticRoutesModule(filePath), "loadModule")
@@ -2780,7 +2792,7 @@ var _RouteManager = class _RouteManager {
2780
2792
  }
2781
2793
  if (definition.kind === "layout") {
2782
2794
  const route = _chunk6V4TDWECcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
2783
- const pattern = _chunkADEA7PN3cjs.createRouteDirectoryPattern.call(void 0, route);
2795
+ const pattern = _chunk2DD4JMQCcjs.createRouteDirectoryPattern.call(void 0, route);
2784
2796
  const existing = this.layouts.get(pattern);
2785
2797
  if (_optionalChain([existing, 'optionalAccess', _134 => _134.sourceRoot]) === source.root) {
2786
2798
  throw new Error(
@@ -2827,7 +2839,7 @@ var _RouteManager = class _RouteManager {
2827
2839
  const matchingLayouts = [];
2828
2840
  for (const { entry, groupScope } of this.orderedLayouts) {
2829
2841
  if (!_chunk5QIKR7RRcjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
2830
- if (groupScope !== null && !_chunkADEA7PN3cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
2842
+ if (groupScope !== null && !_chunk2DD4JMQCcjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
2831
2843
  continue;
2832
2844
  }
2833
2845
  matchingLayouts.push(entry);
@@ -2908,14 +2920,14 @@ var _RouteManager = class _RouteManager {
2908
2920
  let page = route;
2909
2921
  for (const boundaryEntry of boundaries.values()) {
2910
2922
  if (!_chunk5QIKR7RRcjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
2911
- const groupScope = _chunkADEA7PN3cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
2923
+ const groupScope = _chunk2DD4JMQCcjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
2912
2924
  if (groupScope !== null) {
2913
2925
  if (page === void 0) page = this.matchPageRoute(_chunk5QIKR7RRcjs.splitRoutePath.call(void 0, normalizedPath));
2914
- if (!_chunkADEA7PN3cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
2926
+ if (!_chunk2DD4JMQCcjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
2915
2927
  }
2916
2928
  const depth = boundaryEntry.route.segments.length;
2917
2929
  const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _138 => _138.route, 'access', _139 => _139.segments, 'access', _140 => _140.length]), () => ( -1));
2918
- if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkADEA7PN3cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
2930
+ if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
2919
2931
  bestMatch = boundaryEntry;
2920
2932
  }
2921
2933
  }
@@ -2952,7 +2964,7 @@ var _RouteManager = class _RouteManager {
2952
2964
  pattern: entry.pattern
2953
2965
  }));
2954
2966
  const i18n = this.getI18nConfig();
2955
- const result = await _chunkJNUWCDTFcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
2967
+ const result = await _chunk5D2JIPLHcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
2956
2968
  suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n)
2957
2969
  });
2958
2970
  if (!i18n) {
@@ -2997,7 +3009,7 @@ var _RouteManager = class _RouteManager {
2997
3009
  async isRouteSSG(modulePath) {
2998
3010
  try {
2999
3011
  const mod = await this.loadRouteModule(modulePath);
3000
- const rendering = await _chunkJNUWCDTFcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
3012
+ const rendering = await _chunk5D2JIPLHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
3001
3013
  return rendering.ssg;
3002
3014
  } catch (e10) {
3003
3015
  return false;
@@ -3009,7 +3021,7 @@ var _RouteManager = class _RouteManager {
3009
3021
  async hasRouteISR(modulePath) {
3010
3022
  try {
3011
3023
  const mod = await this.loadRouteModule(modulePath);
3012
- const rendering = await _chunkJNUWCDTFcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
3024
+ const rendering = await _chunk5D2JIPLHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
3013
3025
  return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
3014
3026
  } catch (e11) {
3015
3027
  return false;
@@ -3021,7 +3033,7 @@ var _RouteManager = class _RouteManager {
3021
3033
  async getRouteRevalidateInterval(modulePath) {
3022
3034
  try {
3023
3035
  const mod = await this.loadRouteModule(modulePath);
3024
- const rendering = await _chunkJNUWCDTFcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
3036
+ const rendering = await _chunk5D2JIPLHcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
3025
3037
  return rendering.revalidate;
3026
3038
  } catch (e12) {
3027
3039
  return void 0;
@@ -3031,7 +3043,7 @@ var _RouteManager = class _RouteManager {
3031
3043
  _chunkS3JO3N4Hcjs.__name.call(void 0, _RouteManager, "RouteManager");
3032
3044
  var RouteManager = _RouteManager;
3033
3045
  function getPageDirectoryField(route, pattern) {
3034
- const directory = _chunkADEA7PN3cjs.createRouteDirectoryPattern.call(void 0, route);
3046
+ const directory = _chunk2DD4JMQCcjs.createRouteDirectoryPattern.call(void 0, route);
3035
3047
  return directory === pattern ? {} : { directory };
3036
3048
  }
3037
3049
  _chunkS3JO3N4Hcjs.__name.call(void 0, getPageDirectoryField, "getPageDirectoryField");
@@ -4411,7 +4423,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
4411
4423
  let hasClerkProvider = false;
4412
4424
  renderedProviders.forEach((provider, index) => {
4413
4425
  let componentExpression = "null";
4414
- if (_chunkCBJJH36Acjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
4426
+ if (_chunkVU6AAZVYcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
4415
4427
  const namespace = `FarmIntegrationProviderModule${index}`;
4416
4428
  imports.push(
4417
4429
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -4470,7 +4482,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
4470
4482
  const entries = [];
4471
4483
  let needsMarkHelper = false;
4472
4484
  providers.forEach((provider, index) => {
4473
- if (!_chunkCBJJH36Acjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
4485
+ if (!_chunkVU6AAZVYcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
4474
4486
  const namespace = `FarmServerIntegrationProviderModule${index}`;
4475
4487
  imports.push(
4476
4488
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -4692,7 +4704,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, appendResponseVary, "appendResponseVary");
4692
4704
  function renderI18nAlternateLinks(requestPath, snapshot, options) {
4693
4705
  if (snapshot.routing === "none") return "";
4694
4706
  const url = new URL(requestPath, "http://farm.local");
4695
- return _chunkADEA7PN3cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
4707
+ return _chunk2DD4JMQCcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
4696
4708
  }
4697
4709
  _chunkS3JO3N4Hcjs.__name.call(void 0, renderI18nAlternateLinks, "renderI18nAlternateLinks");
4698
4710
  var PPR_REFRESH_MAX_ATTEMPTS = 3;
@@ -4705,6 +4717,11 @@ function createPreHydrationClickQueueScript() {
4705
4717
  return `<script>(function(){if(window.__FARM_PREHYDRATION_CLICK_QUEUE__)return;var queue=[];window.__FARM_PREHYDRATION_CLICK_QUEUE__=queue;window.__FARM_HYDRATED__=false;document.documentElement.dataset.farmHydrated="false";function isModified(event){return !!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}function inHydrated(node){return !!(node&&node.closest&&node.closest('[data-farm-island-hydrated="true"]'))}function closestQueuedTarget(target){while(target&&target!==document.documentElement){if(target.matches&&target.matches(${selector}))return target;target=target.parentElement}return null}function announce(target,kind){document.dispatchEvent(new CustomEvent("farm:island-interaction",{detail:{target:target,kind:kind||null}}))}function hold(event,target,kind){if(!queue.some(function(item){return item.target===target})){queue.push({target:target,kind:kind,createdAt:Date.now()});announce(target,kind)}event.preventDefault();event.stopImmediatePropagation()}document.addEventListener("click",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented||event.button!==0||isModified(event))return;var target=closestQueuedTarget(event.target);if(!target||target.closest&&target.closest("a[href]")||inHydrated(target))return;hold(event,target,"click")},true);document.addEventListener("submit",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented)return;var form=event.target;if(!form||form.nodeName!=="FORM"||inHydrated(form))return;hold(event,form,"submit")},true);function observe(event){if(window.__FARM_HYDRATED__)return;var target=event.target;if(!(target&&target.closest)||inHydrated(target))return;announce(target,null)}document.addEventListener("pointerdown",observe,true);document.addEventListener("focusin",observe,true);})();</script>`;
4706
4718
  }
4707
4719
  _chunkS3JO3N4Hcjs.__name.call(void 0, createPreHydrationClickQueueScript, "createPreHydrationClickQueueScript");
4720
+ function rendererRenderOptions() {
4721
+ const nonce = _chunkULASELLAcjs._resolveCurrentCspNonce.call(void 0, );
4722
+ return nonce ? { nonce } : void 0;
4723
+ }
4724
+ _chunkS3JO3N4Hcjs.__name.call(void 0, rendererRenderOptions, "rendererRenderOptions");
4708
4725
  function createDocumentFooter(options) {
4709
4726
  return `</div>
4710
4727
  ${options.suspenseRevealFallback}
@@ -4841,7 +4858,7 @@ var _ServerRenderer = class _ServerRenderer {
4841
4858
  this.routeManager = routeManager;
4842
4859
  this.i18nRuntime = i18nRuntime;
4843
4860
  this.viteServer = viteServer;
4844
- this.security = _chunkMRMI32SNcjs.resolveFarmSecurityConfig.call(void 0, config.security);
4861
+ this.security = _chunk2ZYGC6SScjs.resolveFarmSecurityConfig.call(void 0, config.security);
4845
4862
  this.loadSSGManifest();
4846
4863
  }
4847
4864
  async initialize() {
@@ -4958,22 +4975,27 @@ var _ServerRenderer = class _ServerRenderer {
4958
4975
  }
4959
4976
  return this.rendererRuntime.wrapClientGraph(element);
4960
4977
  }
4961
- async renderElementToCompleteHTML(element) {
4978
+ async renderElementToCompleteHTML(element, options = {}) {
4962
4979
  const streaming = _chunkPSV6XKPOcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
4963
4980
  const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
4964
4981
  if (renderToPipeableStream) {
4965
4982
  return await new Promise((resolve6, reject) => {
4966
4983
  const chunks = [];
4967
4984
  let started = false;
4985
+ let lateNavigation;
4968
4986
  const writable = new (0, _stream.Writable)({
4969
4987
  write(chunk, _encoding, callback) {
4970
4988
  chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
4971
4989
  callback();
4972
4990
  }
4973
4991
  });
4974
- writable.once("finish", () => resolve6(Buffer.concat(chunks).toString("utf8")));
4992
+ writable.once(
4993
+ "finish",
4994
+ () => lateNavigation === void 0 ? resolve6(Buffer.concat(chunks).toString("utf8")) : reject(lateNavigation)
4995
+ );
4975
4996
  writable.once("error", reject);
4976
4997
  const stream = renderToPipeableStream(element, {
4998
+ nonce: _chunkULASELLAcjs._resolveCurrentCspNonce.call(void 0, ),
4977
4999
  onShellReady() {
4978
5000
  started = true;
4979
5001
  stream.pipe(writable);
@@ -4983,26 +5005,35 @@ var _ServerRenderer = class _ServerRenderer {
4983
5005
  },
4984
5006
  onError(error) {
4985
5007
  if (!started) reject(error);
5008
+ else if (options.rejectLateNavigation && lateNavigation === void 0 && (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error) || _chunkOX6O6WVAcjs.isFarmNotFoundError.call(void 0, error))) {
5009
+ lateNavigation = error;
5010
+ }
4986
5011
  }
4987
5012
  });
4988
5013
  });
4989
5014
  }
4990
5015
  if (streaming.web && this.rendererRuntime.renderToReadableStream) {
4991
- const stream = await this.rendererRuntime.renderToReadableStream(element);
5016
+ const stream = await this.rendererRuntime.renderToReadableStream(
5017
+ element,
5018
+ rendererRenderOptions()
5019
+ );
4992
5020
  return await _chunkPSV6XKPOcjs.readFarmRendererWebStream.call(void 0, stream);
4993
5021
  }
4994
- return await this.rendererRuntime.renderToString(element);
5022
+ return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
4995
5023
  }
4996
5024
  /**
4997
5025
  * Buffered render carrying document-head markup for renderers that emit it
4998
5026
  * during render (e.g. <svelte:head>). Other renderers return an empty head.
4999
5027
  */
5000
- async renderElementToDocumentParts(element) {
5028
+ async renderElementToDocumentParts(element, options = {}) {
5001
5029
  if (this.rendererRuntime.renderToStringWithHead) {
5002
- const rendered = await this.rendererRuntime.renderToStringWithHead(element);
5030
+ const rendered = await this.rendererRuntime.renderToStringWithHead(
5031
+ element,
5032
+ rendererRenderOptions()
5033
+ );
5003
5034
  return { html: rendered.html, head: rendered.head || "" };
5004
5035
  }
5005
- return { html: await this.renderElementToCompleteHTML(element), head: "" };
5036
+ return { html: await this.renderElementToCompleteHTML(element, options), head: "" };
5006
5037
  }
5007
5038
  /**
5008
5039
  * Render the route tree used by client navigation without producing a second
@@ -5075,7 +5106,7 @@ var _ServerRenderer = class _ServerRenderer {
5075
5106
  return this.renderElementToCompleteHTML(await this.wrapWithIntegrationProviders(element));
5076
5107
  }
5077
5108
  async runWithRequestContext(request2, fn) {
5078
- return _chunkUXFQ3UDAcjs._runWithCurrentRequest.call(void 0,
5109
+ return _chunk6XWDE2P2cjs._runWithCurrentRequest.call(void 0,
5079
5110
  request2,
5080
5111
  () => _optionalChain([this, 'access', _162 => _162.i18nRuntime, 'optionalAccess', _163 => _163.config, 'access', _164 => _164.enabled]) ? _chunkXJXBIP67cjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
5081
5112
  redirect: false
@@ -5108,7 +5139,7 @@ var _ServerRenderer = class _ServerRenderer {
5108
5139
  * Check if a path should be served from SSG cache
5109
5140
  */
5110
5141
  async shouldServeSSG(pathname) {
5111
- const ssgPage = _chunkJNUWCDTFcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
5142
+ const ssgPage = _chunk5D2JIPLHcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
5112
5143
  if (!ssgPage) return null;
5113
5144
  const cached = await this.getCachedSSGPage(pathname);
5114
5145
  if (cached && await this.dataCache.isStaleAsync(cached)) {
@@ -5342,13 +5373,13 @@ var _ServerRenderer = class _ServerRenderer {
5342
5373
  if (this.viteServer) await this.applyRendererAppSetup();
5343
5374
  _chunkI57LW5VZcjs.setFarmBasePath.call(void 0, this.config.basePath);
5344
5375
  _chunkOYEUREB6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
5345
- const cspNonce = _chunkMRMI32SNcjs.createFarmCspNonce.call(void 0, this.security);
5376
+ const cspNonce = _chunk2ZYGC6SScjs.createFarmCspNonce.call(void 0, this.security);
5346
5377
  if (cspNonce) {
5347
5378
  req.__FARM_CSP_NONCE__ = cspNonce;
5348
- const header = _chunkMRMI32SNcjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
5379
+ const header = _chunk2ZYGC6SScjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
5349
5380
  res.setHeader(header.key, header.value);
5350
5381
  }
5351
- const request2 = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5382
+ const request2 = _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
5352
5383
  trustProxy: _optionalChain([this, 'access', _167 => _167.config, 'access', _168 => _168.server, 'optionalAccess', _169 => _169.trustProxy])
5353
5384
  });
5354
5385
  const runtime = this.i18nRuntime;
@@ -5371,7 +5402,10 @@ var _ServerRenderer = class _ServerRenderer {
5371
5402
  return;
5372
5403
  }
5373
5404
  }
5374
- return this.runWithRequestContext(request2, () => this.renderPageInContext(req, res));
5405
+ return _chunk6XWDE2P2cjs._runWithFarmCspNonce.call(void 0,
5406
+ cspNonce,
5407
+ () => this.runWithRequestContext(request2, () => this.renderPageInContext(req, res))
5408
+ );
5375
5409
  }
5376
5410
  async renderPageInContext(req, res) {
5377
5411
  const renderStartTime = Date.now();
@@ -5395,7 +5429,7 @@ var _ServerRenderer = class _ServerRenderer {
5395
5429
  });
5396
5430
  }, "completeRender");
5397
5431
  try {
5398
- const url = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _172 => _172.config, 'access', _173 => _173.server, 'optionalAccess', _174 => _174.trustProxy]) });
5432
+ const url = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _172 => _172.config, 'access', _173 => _173.server, 'optionalAccess', _174 => _174.trustProxy]) });
5399
5433
  pathname = url.pathname;
5400
5434
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
5401
5435
  searchParamsObject = _chunkQNPEUFHQcjs.searchParamsToObject.call(void 0, url.searchParams);
@@ -5458,7 +5492,7 @@ var _ServerRenderer = class _ServerRenderer {
5458
5492
  layouts = match.layouts;
5459
5493
  routeSlots = _nullishCoalesce(match.slots, () => ( []));
5460
5494
  if (!route) {
5461
- if (_chunkPTZ2TVNEcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
5495
+ if (_chunkH5CLOUZScjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
5462
5496
  await this.renderDefaultMCP(req, res);
5463
5497
  completeRender(res.statusCode || 200, pathname);
5464
5498
  return;
@@ -5481,7 +5515,7 @@ var _ServerRenderer = class _ServerRenderer {
5481
5515
  pluginExposedContext = _chunkKIIMAWOJcjs.getRequestContextSnapshot.call(void 0, req, {
5482
5516
  exposedOnly: true
5483
5517
  });
5484
- const currentRequest = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
5518
+ const currentRequest = _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
5485
5519
  trustProxy: _optionalChain([this, 'access', _175 => _175.config, 'access', _176 => _176.server, 'optionalAccess', _177 => _177.trustProxy])
5486
5520
  });
5487
5521
  const routeContext = await this.resolveRouteContext({
@@ -5536,7 +5570,7 @@ var _ServerRenderer = class _ServerRenderer {
5536
5570
  throw error;
5537
5571
  }
5538
5572
  }
5539
- const renderingConfig = await _chunkJNUWCDTFcjs.resolveRouteRenderingConfigFromFile.call(void 0,
5573
+ const renderingConfig = await _chunk5D2JIPLHcjs.resolveRouteRenderingConfigFromFile.call(void 0,
5540
5574
  routeModule,
5541
5575
  route.modulePath,
5542
5576
  { experimentalPPR: _optionalChain([this, 'access', _180 => _180.config, 'access', _181 => _181.experimental, 'optionalAccess', _182 => _182.ppr]) === true }
@@ -5596,8 +5630,8 @@ var _ServerRenderer = class _ServerRenderer {
5596
5630
  key: pprCacheKey
5597
5631
  });
5598
5632
  }
5599
- const outerRequest = _chunkU4KT7QP3cjs._resolveCurrentRequest.call(void 0, );
5600
- const countRequestReads = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => (outerRequest ? _chunkUXFQ3UDAcjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunkUXFQ3UDAcjs._getRequestReadCount.call(void 0, currentRequest), "countRequestReads");
5633
+ const outerRequest = _chunkULASELLAcjs._resolveCurrentRequest.call(void 0, );
5634
+ const countRequestReads = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => (outerRequest ? _chunk6XWDE2P2cjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunk6XWDE2P2cjs._getRequestReadCount.call(void 0, currentRequest), "countRequestReads");
5601
5635
  const requestReadsBeforeRender = countRequestReads();
5602
5636
  let LoadingFallbackComponent = null;
5603
5637
  if (loadingBoundaryEntry) {
@@ -5779,9 +5813,9 @@ var _ServerRenderer = class _ServerRenderer {
5779
5813
  });
5780
5814
  req.__FARM_METADATA__ = mergedMetadata;
5781
5815
  const middlewareDataForContext = middlewareMap;
5782
- await _chunk3BU22U3Mcjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
5783
- await _chunk3BU22U3Mcjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
5784
- await _chunkUXFQ3UDAcjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
5816
+ await _chunkZXH4TS3Fcjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
5817
+ await _chunkZXH4TS3Fcjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
5818
+ await _chunk6XWDE2P2cjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
5785
5819
  let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
5786
5820
  if (LoadingFallbackComponent) {
5787
5821
  const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
@@ -5868,8 +5902,8 @@ var _ServerRenderer = class _ServerRenderer {
5868
5902
  req,
5869
5903
  res,
5870
5904
  () => {
5871
- _chunk3BU22U3Mcjs._clearCurrentMiddlewareData.call(void 0, );
5872
- _chunk3BU22U3Mcjs._clearCurrentMiddlewareContext.call(void 0, );
5905
+ _chunkZXH4TS3Fcjs._clearCurrentMiddlewareData.call(void 0, );
5906
+ _chunkZXH4TS3Fcjs._clearCurrentMiddlewareContext.call(void 0, );
5873
5907
  },
5874
5908
  {
5875
5909
  responseHeaders: pprHeaders,
@@ -5959,7 +5993,7 @@ var _ServerRenderer = class _ServerRenderer {
5959
5993
  }
5960
5994
  }
5961
5995
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.error", route: pathname, error });
5962
- const errorStatus = _chunkADEA7PN3cjs.resolveDefaultErrorStatus.call(void 0, error);
5996
+ const errorStatus = _chunk2DD4JMQCcjs.resolveDefaultErrorStatus.call(void 0, error);
5963
5997
  if (pprRefreshRoute) {
5964
5998
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
5965
5999
  type: "ppr.refresh.error",
@@ -5995,7 +6029,7 @@ var _ServerRenderer = class _ServerRenderer {
5995
6029
  }
5996
6030
  }
5997
6031
  async wrapWithIntegrationProviders(element) {
5998
- const providers = _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, this.config.integrations);
6032
+ const providers = _chunkVU6AAZVYcjs.getIntegrationProviders.call(void 0, this.config.integrations);
5999
6033
  let wrapped = element;
6000
6034
  for (let i = providers.length - 1; i >= 0; i--) {
6001
6035
  const provider = providers[i];
@@ -6013,7 +6047,7 @@ var _ServerRenderer = class _ServerRenderer {
6013
6047
  }
6014
6048
  let ProviderComponent;
6015
6049
  let providerSourceModule;
6016
- if (_chunkCBJJH36Acjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
6050
+ if (_chunkVU6AAZVYcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
6017
6051
  providerSourceModule = provider.component.module;
6018
6052
  const providerModuleId = provider.component.module.startsWith(".") ? _chunk5QIKR7RRcjs.toViteModuleId.call(void 0,
6019
6053
  path9.resolve(this.config.root, provider.component.module),
@@ -6111,7 +6145,7 @@ var _ServerRenderer = class _ServerRenderer {
6111
6145
  );
6112
6146
  metadata = _chunkEK4QAEFZcjs.addMetadataMarkdownAlternate.call(void 0,
6113
6147
  metadata,
6114
- _chunkEUV4YR3Vcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkEUV4YR3Vcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
6148
+ _chunkSGBJ247Qcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkSGBJ247Qcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
6115
6149
  );
6116
6150
  return metadata;
6117
6151
  }
@@ -6168,7 +6202,7 @@ var _ServerRenderer = class _ServerRenderer {
6168
6202
  `Metadata route module ${match.metadata.modulePath} does not export a default value or handler`
6169
6203
  );
6170
6204
  }
6171
- const request2 = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
6205
+ const request2 = _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
6172
6206
  trustProxy: _optionalChain([this, 'access', _202 => _202.config, 'access', _203 => _203.server, 'optionalAccess', _204 => _204.trustProxy])
6173
6207
  });
6174
6208
  const url = new URL(request2.url);
@@ -6183,11 +6217,11 @@ var _ServerRenderer = class _ServerRenderer {
6183
6217
  path: match.routePath,
6184
6218
  ...llmsContext
6185
6219
  }) : routeModule.default;
6186
- const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunk4WQ6PGSJcjs.renderFarmLlmsFullTxt.call(void 0, value, {
6220
+ const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkWEW2JVA4cjs.renderFarmLlmsFullTxt.call(void 0, value, {
6187
6221
  origin: url.origin,
6188
6222
  readMarkdown: llmsContext.markdown
6189
6223
  }) : value;
6190
- const response = _chunkADEA7PN3cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
6224
+ const response = _chunk2DD4JMQCcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
6191
6225
  method,
6192
6226
  request: request2
6193
6227
  });
@@ -6205,25 +6239,25 @@ var _ServerRenderer = class _ServerRenderer {
6205
6239
  }
6206
6240
  /** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
6207
6241
  getGeneratedLlmsKind(pathname) {
6208
- const config = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _205 => _205.config, 'access', _206 => _206.agent, 'optionalAccess', _207 => _207.llmsTxt]));
6242
+ const config = _chunkWEW2JVA4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _205 => _205.config, 'access', _206 => _206.agent, 'optionalAccess', _207 => _207.llmsTxt]));
6209
6243
  if (!config.enabled) return null;
6210
6244
  if (pathname === "/llms.txt") return "llms";
6211
6245
  return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
6212
6246
  }
6213
6247
  async renderGeneratedLlmsTxt(req, res, kind) {
6214
6248
  try {
6215
- const request2 = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
6249
+ const request2 = _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
6216
6250
  trustProxy: _optionalChain([this, 'access', _208 => _208.config, 'access', _209 => _209.server, 'optionalAccess', _210 => _210.trustProxy])
6217
6251
  });
6218
- const config = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _211 => _211.config, 'access', _212 => _212.agent, 'optionalAccess', _213 => _213.llmsTxt]));
6252
+ const config = _chunkWEW2JVA4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _211 => _211.config, 'access', _212 => _212.agent, 'optionalAccess', _213 => _213.llmsTxt]));
6219
6253
  const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
6220
- const body = kind === "llms-full" ? await _chunk4WQ6PGSJcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
6254
+ const body = kind === "llms-full" ? await _chunkWEW2JVA4cjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
6221
6255
  origin: new URL(request2.url).origin,
6222
6256
  readMarkdown: context.markdown
6223
6257
  }) : context.defaults;
6224
6258
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6225
6259
  res,
6226
- _chunkADEA7PN3cjs.createFarmMetadataRouteResponse.call(void 0,
6260
+ _chunk2DD4JMQCcjs.createFarmMetadataRouteResponse.call(void 0,
6227
6261
  kind,
6228
6262
  body,
6229
6263
  { revalidate: config.revalidate },
@@ -6242,7 +6276,7 @@ var _ServerRenderer = class _ServerRenderer {
6242
6276
  }
6243
6277
  }
6244
6278
  getAgentCrawlers() {
6245
- return _chunkMRMI32SNcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _214 => _214.config, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.crawlers]));
6279
+ return _chunkQTXBII4Zcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _214 => _214.config, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.crawlers]));
6246
6280
  }
6247
6281
  /** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
6248
6282
  async renderGeneratedRobotsTxt(req, res) {
@@ -6250,7 +6284,7 @@ var _ServerRenderer = class _ServerRenderer {
6250
6284
  const sitemapPath = _optionalChain([this, 'access', _217 => _217.routeManager, 'access', _218 => _218.matchMetadataRoute, 'call', _219 => _219("/sitemap.xml"), 'optionalAccess', _220 => _220.metadata, 'access', _221 => _221.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
6251
6285
  const rootLayout = this.routeManager.getLayouts().get("/");
6252
6286
  const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6253
- const robots = _chunkMRMI32SNcjs.createFarmAgentRobots.call(void 0, {
6287
+ const robots = _chunkQTXBII4Zcjs.createFarmAgentRobots.call(void 0, {
6254
6288
  crawlers: this.getAgentCrawlers(),
6255
6289
  sitemapPath,
6256
6290
  metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _222 => _222.metadataBase]),
@@ -6258,7 +6292,7 @@ var _ServerRenderer = class _ServerRenderer {
6258
6292
  });
6259
6293
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6260
6294
  res,
6261
- _chunkADEA7PN3cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
6295
+ _chunk2DD4JMQCcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
6262
6296
  );
6263
6297
  } catch (error) {
6264
6298
  _chunk5QIKR7RRcjs.logger.error(`Generated robots.txt failed: ${error}`);
@@ -6272,16 +6306,16 @@ var _ServerRenderer = class _ServerRenderer {
6272
6306
  }
6273
6307
  }
6274
6308
  getAgentSitemap() {
6275
- return _chunkMRMI32SNcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _223 => _223.config, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.sitemap]));
6309
+ return _chunkQTXBII4Zcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _223 => _223.config, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.sitemap]));
6276
6310
  }
6277
6311
  /** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
6278
6312
  async renderGeneratedSitemap(req, res) {
6279
6313
  try {
6280
- const request2 = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
6314
+ const request2 = _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
6281
6315
  trustProxy: _optionalChain([this, 'access', _226 => _226.config, 'access', _227 => _227.server, 'optionalAccess', _228 => _228.trustProxy])
6282
6316
  });
6283
6317
  const sources = await Promise.all(
6284
- [...this.routeManager.getRoutes()].filter(([pattern]) => !pattern.includes("[")).map(async ([pattern, route]) => {
6318
+ this.getAgentListedRoutes().map(async ([pattern, route]) => {
6285
6319
  const [module, stat] = await Promise.all([
6286
6320
  this.routeManager.loadRouteModule(route.modulePath).catch((error) => {
6287
6321
  _chunk5QIKR7RRcjs.logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
@@ -6294,7 +6328,7 @@ var _ServerRenderer = class _ServerRenderer {
6294
6328
  );
6295
6329
  const rootLayout = this.routeManager.getLayouts().get("/");
6296
6330
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6297
- const sitemap = _chunkMRMI32SNcjs.createFarmDefaultSitemap.call(void 0, sources, {
6331
+ const sitemap = _chunkQTXBII4Zcjs.createFarmDefaultSitemap.call(void 0, sources, {
6298
6332
  origin: new URL(request2.url).origin,
6299
6333
  config: this.getAgentSitemap(),
6300
6334
  metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _232 => _232.metadataBase]),
@@ -6302,7 +6336,7 @@ var _ServerRenderer = class _ServerRenderer {
6302
6336
  });
6303
6337
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6304
6338
  res,
6305
- _chunkADEA7PN3cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
6339
+ _chunk2DD4JMQCcjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
6306
6340
  );
6307
6341
  } catch (error) {
6308
6342
  _chunk5QIKR7RRcjs.logger.error(`Generated sitemap.xml failed: ${error}`);
@@ -6319,43 +6353,58 @@ var _ServerRenderer = class _ServerRenderer {
6319
6353
  setAPIRouteLookup(exists) {
6320
6354
  this.apiRouteExists = exists;
6321
6355
  }
6356
+ /** The dev server's file middleware, so public page listings can leave guarded pages out. */
6357
+ setMiddlewareRouteLookup(routes) {
6358
+ this.middlewareRoutes = routes;
6359
+ }
6360
+ /**
6361
+ * The static pages sitemap.xml, llms.txt and the default MCP server may list: not one a
6362
+ * path-specific guard (non-root middleware.ts, a config or integration middleware
6363
+ * matcher) covers, as the production build decides.
6364
+ */
6365
+ getAgentListedRoutes() {
6366
+ const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _233 => _233.middlewareRoutes, 'optionalCall', _234 => _234()]), () => ( [])) };
6367
+ return [...this.routeManager.getRoutes()].filter(
6368
+ ([pattern]) => !pattern.includes("[") && !_chunk2DD4JMQCcjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
6369
+ );
6370
+ }
6322
6371
  /**
6323
6372
  * The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
6324
6373
  * server of its own: a route that answers /mcp, an API route at /api/mcp, `@farm.js/mcp`,
6325
6374
  * or a registered server such as the docs engine's. Production applies the same rules.
6326
6375
  */
6327
6376
  getDefaultMCPServer() {
6328
- if (_optionalChain([this, 'access', _233 => _233.config, 'access', _234 => _234.agent, 'optionalAccess', _235 => _235.mcp]) !== true || _chunkPTZ2TVNEcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
6329
- if (_optionalChain([this, 'access', _236 => _236.apiRouteExists, 'optionalCall', _237 => _237("/api/mcp")])) return void 0;
6330
- if (this.routeManager.matchRoute(_chunkPTZ2TVNEcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
6331
- _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkPTZ2TVNEcjs.createFarmDefaultMCPServer.call(void 0,
6377
+ if (_optionalChain([this, 'access', _235 => _235.config, 'access', _236 => _236.agent, 'optionalAccess', _237 => _237.mcp]) !== true || _chunkH5CLOUZScjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
6378
+ if (_optionalChain([this, 'access', _238 => _238.apiRouteExists, 'optionalCall', _239 => _239("/api/mcp")])) return void 0;
6379
+ if (this.routeManager.matchRoute(_chunkH5CLOUZScjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
6380
+ _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkH5CLOUZScjs.createFarmDefaultMCPServer.call(void 0,
6332
6381
  readAppPackageIdentity(this.config.root),
6333
- _chunkDZ5ZVB2Kcjs.FARM_VERSION
6382
+ _chunkKKSTAEMYcjs.FARM_VERSION
6334
6383
  ))));
6335
- return _chunkPTZ2TVNEcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
6384
+ return _chunkH5CLOUZScjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
6336
6385
  }
6337
6386
  async renderDefaultMCP(req, res) {
6338
6387
  const server = this.getDefaultMCPServer();
6339
- const request2 = _nullishCoalesce(_chunkUXFQ3UDAcjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _238 => _238.config, 'access', _239 => _239.server, 'optionalAccess', _240 => _240.trustProxy]) })));
6388
+ const request2 = _nullishCoalesce(_chunk6XWDE2P2cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _240 => _240.config, 'access', _241 => _241.server, 'optionalAccess', _242 => _242.trustProxy]) })));
6340
6389
  try {
6341
- const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-SJAHFSPI.cjs");
6390
+ const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-MRGP3WJ3.cjs");
6342
6391
  const origin = new URL(request2.url).origin;
6343
6392
  const response = await handleFarmDefaultMCPRequest(request2, {
6344
6393
  server,
6345
6394
  basePath: this.config.basePath,
6346
6395
  listPages: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
6347
6396
  const sources = await Promise.all(
6348
- [...this.routeManager.getRoutes()].filter(([pattern]) => !pattern.includes("[")).map(async ([pattern, route]) => ({
6397
+ this.getAgentListedRoutes().map(async ([pattern, route]) => ({
6349
6398
  pattern,
6350
6399
  // The page itself surfaces a load error. Without its module a guard cannot
6351
6400
  // be ruled out, so the page is left out.
6352
6401
  module: await this.routeManager.loadRouteModule(route.modulePath).catch(() => ({ __farmRouteGuard: true }))
6353
6402
  }))
6354
6403
  );
6355
- return _chunkPTZ2TVNEcjs.collectFarmDefaultMCPPages.call(void 0, sources, {
6404
+ return _chunkH5CLOUZScjs.collectFarmDefaultMCPPages.call(void 0, sources, {
6356
6405
  origin,
6357
6406
  basePath: this.config.basePath,
6358
- markdown: _chunkEUV4YR3Vcjs.resolveMarkdownConfig.call(void 0, this.config.md)
6407
+ markdown: _chunkSGBJ247Qcjs.resolveMarkdownConfig.call(void 0, this.config.md)
6359
6408
  });
6360
6409
  }, "listPages"),
6361
6410
  // Pages are read through this server's own socket, with no cookies, as llms-full.txt does.
@@ -6379,16 +6428,14 @@ var _ServerRenderer = class _ServerRenderer {
6379
6428
  }
6380
6429
  /** Same inputs the production server gives llms.txt: static pages and root metadata. */
6381
6430
  async createLlmsTxtContext(request2, options = {}) {
6382
- const config = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _241 => _241.config, 'access', _242 => _242.agent, 'optionalAccess', _243 => _243.llmsTxt]));
6431
+ const config = _chunkWEW2JVA4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _243 => _243.config, 'access', _244 => _244.agent, 'optionalAccess', _245 => _245.llmsTxt]));
6383
6432
  const origin = new URL(request2.url).origin;
6384
- const staticRoutes = [...this.routeManager.getRoutes()].filter(
6385
- ([pattern]) => !pattern.includes("[")
6386
- );
6387
6433
  const sources = await Promise.all(
6388
- staticRoutes.map(async ([pattern, route]) => {
6434
+ this.getAgentListedRoutes().map(async ([pattern, route]) => {
6389
6435
  try {
6390
- const metadata = (await this.routeManager.loadRouteModule(route.modulePath)).metadata;
6391
- return { pattern, metadata };
6436
+ const module = await this.routeManager.loadRouteModule(route.modulePath);
6437
+ if (module.__farmRouteGuard) return null;
6438
+ return { pattern, metadata: module.metadata };
6392
6439
  } catch (error) {
6393
6440
  _chunk5QIKR7RRcjs.logger.warn(`Could not read metadata for ${pattern} in llms.txt: ${error}`);
6394
6441
  return { pattern };
@@ -6397,21 +6444,24 @@ var _ServerRenderer = class _ServerRenderer {
6397
6444
  );
6398
6445
  const rootLayout = this.routeManager.getLayouts().get("/");
6399
6446
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6400
- const pages = _chunk4WQ6PGSJcjs.collectFarmLlmsTxtPages.call(void 0, sources, {
6401
- origin,
6402
- basePath: this.config.basePath,
6403
- markdown: _chunkEUV4YR3Vcjs.resolveMarkdownConfig.call(void 0, this.config.md),
6404
- include: config.include,
6405
- exclude: config.exclude
6406
- });
6447
+ const pages = _chunkWEW2JVA4cjs.collectFarmLlmsTxtPages.call(void 0,
6448
+ sources.filter((source) => source !== null),
6449
+ {
6450
+ origin,
6451
+ basePath: this.config.basePath,
6452
+ markdown: _chunkSGBJ247Qcjs.resolveMarkdownConfig.call(void 0, this.config.md),
6453
+ include: config.include,
6454
+ exclude: config.exclude
6455
+ }
6456
+ );
6407
6457
  return {
6408
6458
  pages,
6409
- defaults: _chunk4WQ6PGSJcjs.createFarmDefaultLlmsTxt.call(void 0, {
6459
+ defaults: _chunkWEW2JVA4cjs.createFarmDefaultLlmsTxt.call(void 0, {
6410
6460
  origin,
6411
6461
  pages,
6412
6462
  config,
6413
6463
  rootMetadata,
6414
- mcp: _optionalChain([this, 'access', _244 => _244.config, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.aiCatalog]) === false ? [] : _chunkADEA7PN3cjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
6464
+ mcp: _optionalChain([this, 'access', _246 => _246.config, 'access', _247 => _247.agent, 'optionalAccess', _248 => _248.aiCatalog]) === false ? [] : _chunk2DD4JMQCcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
6415
6465
  basePath: this.config.basePath,
6416
6466
  apiServerBasePath: _chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0,
6417
6467
  _chunkS3A45T7Fcjs.normalizeFarmAPIConfig.call(void 0,
@@ -6434,17 +6484,17 @@ var _ServerRenderer = class _ServerRenderer {
6434
6484
  * body is discarded.
6435
6485
  */
6436
6486
  createDevMarkdownReader(req) {
6437
- const socket = _optionalChain([req, 'optionalAccess', _247 => _247.socket]);
6438
- if (_optionalChain([req, 'optionalAccess', _248 => _248.method, 'optionalAccess', _249 => _249.toUpperCase, 'call', _250 => _250()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _251 => _251.localAddress]) || !socket.localPort) {
6487
+ const socket = _optionalChain([req, 'optionalAccess', _249 => _249.socket]);
6488
+ if (_optionalChain([req, 'optionalAccess', _250 => _250.method, 'optionalAccess', _251 => _251.toUpperCase, 'call', _252 => _252()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _253 => _253.localAddress]) || !socket.localPort) {
6439
6489
  return async () => null;
6440
6490
  }
6441
6491
  if (socket.encrypted) {
6442
6492
  const address = { host: socket.localAddress, port: socket.localPort };
6443
- return _chunk4WQ6PGSJcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
6493
+ return _chunkWEW2JVA4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
6444
6494
  }
6445
6495
  const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
6446
6496
  const localOrigin = `http://${host}:${socket.localPort}`;
6447
- const read = _chunk4WQ6PGSJcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
6497
+ const read = _chunkWEW2JVA4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
6448
6498
  return (url) => {
6449
6499
  const target = new URL(url);
6450
6500
  return read(`${localOrigin}${target.pathname}${target.search}`);
@@ -6499,8 +6549,8 @@ var _ServerRenderer = class _ServerRenderer {
6499
6549
  return;
6500
6550
  }
6501
6551
  const etag = `"${image.staticInfo.hash}"`;
6502
- const requestUrl = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
6503
- trustProxy: _optionalChain([this, 'access', _252 => _252.config, 'access', _253 => _253.server, 'optionalAccess', _254 => _254.trustProxy])
6552
+ const requestUrl = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
6553
+ trustProxy: _optionalChain([this, 'access', _254 => _254.config, 'access', _255 => _255.server, 'optionalAccess', _256 => _256.trustProxy])
6504
6554
  });
6505
6555
  const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
6506
6556
  res.setHeader("Content-Type", image.staticInfo.contentType);
@@ -6561,11 +6611,11 @@ var _ServerRenderer = class _ServerRenderer {
6561
6611
  });
6562
6612
  }
6563
6613
  wrapped = await this.wrapWithIntegrationProviders(wrapped);
6564
- const html = await _chunk3BU22U3Mcjs._runWithMiddlewareData.call(void 0,
6614
+ const html = await _chunkZXH4TS3Fcjs._runWithMiddlewareData.call(void 0,
6565
6615
  options.middlewareMap,
6566
- () => _chunk3BU22U3Mcjs._runWithMiddlewareContext.call(void 0,
6616
+ () => _chunkZXH4TS3Fcjs._runWithMiddlewareContext.call(void 0,
6567
6617
  options.middlewareContext,
6568
- () => this.rendererRuntime.renderToString(wrapped)
6618
+ () => this.rendererRuntime.renderToString(wrapped, rendererRenderOptions())
6569
6619
  )
6570
6620
  );
6571
6621
  res.statusCode = options.statusCode;
@@ -6655,7 +6705,8 @@ var _ServerRenderer = class _ServerRenderer {
6655
6705
  const pagePath = req.__FARM_PAGE_PATH__;
6656
6706
  const relativePath = pagePath ? _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
6657
6707
  const deploymentId = this.getDeploymentId();
6658
- const bootstrapScript = `<script data-farm-refresh-state>
6708
+ const farmScripts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (markup) => this.stampFarmScripts(req, markup), "farmScripts");
6709
+ const bootstrapScript = farmScripts(`<script data-farm-refresh-state>
6659
6710
  window.__FARM_PROPS__ = ${serializeInlineValue(deferredProps.data.page)};
6660
6711
  window.__FARM_ROUTE_SLOTS__ = ${serializeInlineValue(deferredProps.data.slots)};
6661
6712
  window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(deploymentId)};
@@ -6672,12 +6723,25 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
6672
6723
  window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
6673
6724
  window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
6674
6725
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
6675
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkCBJJH36Acjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6726
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkVU6AAZVYcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6676
6727
  window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
6677
- </script>`;
6678
- const deferredScript = createDeferredHydrationScript(deferredProps.records);
6679
- const rendererHydrationScript = _optionalChain([this, 'access', _255 => _255.rendererRuntime, 'access', _256 => _256.generateHydrationScript, 'optionalCall', _257 => _257()]) || "";
6680
- const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(element);
6728
+ </script>`);
6729
+ const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
6730
+ const rendererHydrationScript = farmScripts(
6731
+ _optionalChain([this, 'access', _257 => _257.rendererRuntime, 'access', _258 => _258.generateHydrationScript, 'optionalCall', _259 => _259()]) || ""
6732
+ );
6733
+ const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
6734
+ const farmClientScript = farmScripts(
6735
+ `<script type="module" src="/@farm/client.js"></script>`
6736
+ );
6737
+ const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
6738
+ element,
6739
+ {
6740
+ rejectLateNavigation: _chunkSGBJ247Qcjs._isFarmMarkdownPageCheck.call(void 0,
6741
+ _optionalChain([req, 'access', _260 => _260.headers, 'optionalAccess', _261 => _261[_chunkSGBJ247Qcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
6742
+ )
6743
+ }
6744
+ );
6681
6745
  const {
6682
6746
  title,
6683
6747
  tags: metaTags,
@@ -6686,7 +6750,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6686
6750
  viewport: viewportTags
6687
6751
  } = _chunkEK4QAEFZcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6688
6752
  pathname: getFarmMetadataPathname(req),
6689
- jsonLd: _optionalChain([this, 'access', _258 => _258.config, 'access', _259 => _259.agent, 'optionalAccess', _260 => _260.jsonLd])
6753
+ jsonLd: _optionalChain([this, 'access', _262 => _262.config, 'access', _263 => _263.agent, 'optionalAccess', _264 => _264.jsonLd])
6690
6754
  });
6691
6755
  const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
6692
6756
  const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
@@ -6696,18 +6760,19 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6696
6760
  i18nSnapshot,
6697
6761
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6698
6762
  ) : "";
6699
- const themeDocument = _chunkADEA7PN3cjs.createFarmThemeDocumentParts.call(void 0,
6763
+ const themeDocument = _chunk2DD4JMQCcjs.createFarmThemeDocumentParts.call(void 0,
6700
6764
  this.config.theme,
6701
6765
  this.config.basePath,
6702
- _chunkKXWRO25Scjs.getTheme.call(void 0, )
6766
+ _chunk472NCAZ7cjs.getTheme.call(void 0, )
6703
6767
  );
6704
- const fullDocument = _chunkADEA7PN3cjs.extractFarmFullDocument.call(void 0, content);
6768
+ themeDocument.head = farmScripts(themeDocument.head);
6769
+ const fullDocument = _chunk2DD4JMQCcjs.extractFarmFullDocument.call(void 0, content);
6705
6770
  let html;
6706
6771
  if (fullDocument) {
6707
6772
  const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
6708
- const documentHtml = shouldReplaceLayoutTitle ? _chunkADEA7PN3cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
6709
- const effectiveRendererHead = hasExplicitTitle ? _chunkADEA7PN3cjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
6710
- html = _chunkADEA7PN3cjs.composeFarmFullDocument.call(void 0, documentHtml, {
6773
+ const documentHtml = shouldReplaceLayoutTitle ? _chunk2DD4JMQCcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
6774
+ const effectiveRendererHead = hasExplicitTitle ? _chunk2DD4JMQCcjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
6775
+ html = _chunk2DD4JMQCcjs.composeFarmFullDocument.call(void 0, documentHtml, {
6711
6776
  fallbackIcon: !hasFavicon,
6712
6777
  viewport: viewportTags,
6713
6778
  htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
@@ -6725,15 +6790,15 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6725
6790
  renderFarmFontDevHead(this.config.root || process.cwd()),
6726
6791
  this.devGlobalStylesheetLink(),
6727
6792
  ...this.collectDevStyleLinks(),
6728
- `<script type="module" src="/@vite/client"></script>`,
6793
+ viteClientScript,
6729
6794
  rendererHydrationScript,
6730
6795
  bootstrapScript
6731
6796
  ].filter(Boolean).join("\n "),
6732
- bodyFooter: [deferredScript, `<script type="module" src="/@farm/client.js"></script>`].filter(Boolean).join("\n ")
6797
+ bodyFooter: [deferredScript, farmClientScript].filter(Boolean).join("\n ")
6733
6798
  });
6734
6799
  } else {
6735
6800
  html = `<!DOCTYPE html>
6736
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _261 => _261.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6801
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _265 => _265.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6737
6802
  <head>
6738
6803
  ${themeDocument.head}
6739
6804
  <meta charset="utf-8">
@@ -6745,14 +6810,14 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6745
6810
  ${renderFarmFontDevHead(this.config.root || process.cwd())}
6746
6811
  ${this.devGlobalStylesheetLink()}${this.collectDevStyleLinks().map((l) => `
6747
6812
  ${l}`).join("")}
6748
- <script type="module" src="/@vite/client"></script>
6813
+ ${viteClientScript}
6749
6814
  ${rendererHydrationScript}
6750
6815
  ${bootstrapScript}
6751
6816
  </head>
6752
6817
  <body class="">
6753
6818
  <div id="root">${content}</div>
6754
6819
  ${deferredScript}
6755
- <script type="module" src="/@farm/client.js"></script>
6820
+ ${farmClientScript}
6756
6821
  </body>
6757
6822
  </html>`;
6758
6823
  }
@@ -6764,7 +6829,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6764
6829
  const securedHtml = this.secureDocumentHTML(req, html);
6765
6830
  if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
6766
6831
  res.end();
6767
- if (!options.captureStaticShell) await _optionalChain([options, 'access', _262 => _262.onComplete, 'optionalCall', _263 => _263(securedHtml)]);
6832
+ if (!options.captureStaticShell) await _optionalChain([options, 'access', _266 => _266.onComplete, 'optionalCall', _267 => _267(securedHtml)]);
6768
6833
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
6769
6834
  type: "render.stream.complete",
6770
6835
  route,
@@ -6774,7 +6839,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6774
6839
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.error", route, error });
6775
6840
  throw error;
6776
6841
  } finally {
6777
- _optionalChain([clearMiddlewareData, 'optionalCall', _264 => _264()]);
6842
+ _optionalChain([clearMiddlewareData, 'optionalCall', _268 => _268()]);
6778
6843
  }
6779
6844
  }
6780
6845
  /**
@@ -6789,7 +6854,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6789
6854
  if (!rootLayout) return false;
6790
6855
  try {
6791
6856
  const Layout = (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).default;
6792
- if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _265 => _265.prototype, 'optionalAccess', _266 => _266.isReactComponent]) || _optionalChain([Layout, 'access', _267 => _267.constructor, 'optionalAccess', _268 => _268.name]) === "AsyncFunction") {
6857
+ if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _269 => _269.prototype, 'optionalAccess', _270 => _270.isReactComponent]) || _optionalChain([Layout, 'access', _271 => _271.constructor, 'optionalAccess', _272 => _272.name]) === "AsyncFunction") {
6793
6858
  return false;
6794
6859
  }
6795
6860
  const cached = documentLayouts.get(Layout);
@@ -6813,7 +6878,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6813
6878
  async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
6814
6879
  const renderToPipeableStream = this.rendererRuntime.renderToPipeableStream;
6815
6880
  const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
6816
- if (!renderToPipeableStream || fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument()) {
6881
+ if (!renderToPipeableStream || _chunkSGBJ247Qcjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _273 => _273.headers, 'optionalAccess', _274 => _274[_chunkSGBJ247Qcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument()) {
6817
6882
  return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
6818
6883
  }
6819
6884
  return new Promise((resolve6, reject) => {
@@ -6915,7 +6980,7 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
6915
6980
  req.__FARM_LOADING_MODULE_PATH__ || null
6916
6981
  )};
6917
6982
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
6918
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkCBJJH36Acjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6983
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkVU6AAZVYcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6919
6984
  window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
6920
6985
  </script>`;
6921
6986
  const hydrationClickQueueScript = isClientComponent || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true ? createPreHydrationClickQueueScript() : "";
@@ -6926,7 +6991,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6926
6991
  viewport: viewportTags
6927
6992
  } = _chunkEK4QAEFZcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6928
6993
  pathname: getFarmMetadataPathname(req),
6929
- jsonLd: _optionalChain([this, 'access', _269 => _269.config, 'access', _270 => _270.agent, 'optionalAccess', _271 => _271.jsonLd])
6994
+ jsonLd: _optionalChain([this, 'access', _275 => _275.config, 'access', _276 => _276.agent, 'optionalAccess', _277 => _277.jsonLd])
6930
6995
  });
6931
6996
  const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
6932
6997
  const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
@@ -6935,22 +7000,23 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6935
7000
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6936
7001
  ) : "";
6937
7002
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
6938
- const themeDocument = _chunkADEA7PN3cjs.createFarmThemeDocumentParts.call(void 0,
7003
+ const themeDocument = _chunk2DD4JMQCcjs.createFarmThemeDocumentParts.call(void 0,
6939
7004
  this.config.theme,
6940
7005
  this.config.basePath,
6941
- _chunkKXWRO25Scjs.getTheme.call(void 0, )
7006
+ _chunk472NCAZ7cjs.getTheme.call(void 0, )
6942
7007
  );
6943
7008
  const streamRoot = req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? element : this.rendererRuntime.createElement("div", { style: { display: "contents" } }, element);
6944
7009
  const devStyleLinks = this.collectDevStyleLinks();
6945
7010
  const globalStylesheetLink = this.devGlobalStylesheetLink(true);
6946
7011
  const cspNonce = this.getCspNonce(req);
6947
- const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunkMRMI32SNcjs.addFarmCspNonceToScriptTags.call(void 0, html, cspNonce) : html, "secureDocumentHTML");
7012
+ const stampDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => _chunk2ZYGC6SScjs.stampFarmCspNonce.call(void 0, html, cspNonce || ""), "stampDocumentHTML");
7013
+ const filterDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunk2ZYGC6SScjs.filterFarmCspNonces.call(void 0, html, cspNonce) : html, "filterDocumentHTML");
6948
7014
  const createLateNavigationRecovery = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (navigationError) => this.createLateNavigationRecoveryHTML(req, navigationError), "createLateNavigationRecovery");
6949
7015
  const { pipe, abort } = renderToPipeableStream(streamRoot, {
6950
7016
  nonce: cspNonce,
6951
7017
  onShellReady() {
6952
7018
  if (pendingNavigationError) {
6953
- _optionalChain([abort, 'optionalCall', _272 => _272(pendingNavigationError)]);
7019
+ _optionalChain([abort, 'optionalCall', _278 => _278(pendingNavigationError)]);
6954
7020
  if (clearMiddlewareData) {
6955
7021
  clearMiddlewareData();
6956
7022
  }
@@ -6968,7 +7034,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6968
7034
  console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
6969
7035
  }
6970
7036
  const shell = `<!DOCTYPE html>
6971
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _273 => _273.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7037
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _279 => _279.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6972
7038
  <head>
6973
7039
  ${themeDocument.head}
6974
7040
  <meta charset="utf-8">
@@ -6985,19 +7051,19 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6985
7051
  </head>
6986
7052
  <body class="">
6987
7053
  <div id="root">`;
6988
- const securedShell = secureDocumentHTML(shell);
7054
+ const securedShell = stampDocumentHTML(shell);
6989
7055
  htmlParts.push(securedShell);
6990
- _optionalChain([staticShellParts, 'optionalAccess', _274 => _274.push, 'call', _275 => _275(securedShell)]);
7056
+ _optionalChain([staticShellParts, 'optionalAccess', _280 => _280.push, 'call', _281 => _281(securedShell)]);
6991
7057
  let firstChunk = true;
6992
7058
  let checkedFullDocument = false;
6993
7059
  let documentPrefix = "";
6994
- const cspNonceRewriter = cspNonce ? _chunkMRMI32SNcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
7060
+ const cspNonceRewriter = cspNonce ? _chunk2ZYGC6SScjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
6995
7061
  const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
6996
7062
  const recordRenderedChunk = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (chunkText) => {
6997
7063
  if (!chunkText) return;
6998
7064
  if (!checkedFullDocument) {
6999
7065
  documentPrefix += chunkText;
7000
- const prefix = _chunkADEA7PN3cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
7066
+ const prefix = _chunk2DD4JMQCcjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
7001
7067
  if (prefix !== "pending") {
7002
7068
  checkedFullDocument = true;
7003
7069
  documentPrefix = "";
@@ -7014,7 +7080,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7014
7080
  staticShellClosed = true;
7015
7081
  if (!suspenseHoleEmitted) {
7016
7082
  suspenseHoleEmitted = true;
7017
- _optionalChain([options, 'access', _276 => _276.onSuspenseHoleDetected, 'optionalCall', _277 => _277()]);
7083
+ _optionalChain([options, 'access', _282 => _282.onSuspenseHoleDetected, 'optionalCall', _283 => _283()]);
7018
7084
  }
7019
7085
  } else {
7020
7086
  staticShellParts.push(chunkText);
@@ -7043,7 +7109,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7043
7109
  lateNavigationError = null;
7044
7110
  createLateNavigationRecovery(navigationError).then(
7045
7111
  (recovery) => {
7046
- const secured = secureDocumentHTML(recovery);
7112
+ const secured = filterDocumentHTML(recovery);
7047
7113
  htmlParts.push(secured);
7048
7114
  res.write(secured);
7049
7115
  finishStream(callback);
@@ -7065,7 +7131,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7065
7131
  if (tail) res.write(tail);
7066
7132
  }
7067
7133
  const suspenseRevealFallback = `<script>(function(){function moveFragment(srcId,placeholderId){var src=document.getElementById(srcId),ph=document.getElementById(placeholderId);if(!src||!ph||!ph.parentNode)return false;while(src.firstChild)ph.parentNode.insertBefore(src.firstChild,ph);ph.parentNode.removeChild(ph);if(src.parentNode)src.parentNode.removeChild(src);return true}function revealBoundary(boundaryId,sectionId){var boundary=document.getElementById(boundaryId),section=document.getElementById(sectionId);if(!boundary||!section||!boundary.parentNode)return false;var start=boundary.previousSibling;if(!start||start.nodeType!==8)return false;var parent=boundary.parentNode;var node=boundary;var depth=0;while(node){if(node.nodeType===8){var data=node.data;if(data==="/$"||data==="/&"){if(depth===0)break;depth--;}else if(data==="$"||data==="$?"||data==="$~"||data==="$!"||data==="&"){depth++;}}var next=node.nextSibling;parent.removeChild(node);node=next;}while(section.firstChild)parent.insertBefore(section.firstChild,node);if(section.parentNode)section.parentNode.removeChild(section);start.data="$";return true}var tries=0;var timer=setInterval(function(){var changed=false;document.querySelectorAll('div[id^="S:"]').forEach(function(section){var suffix=section.id.slice(2);changed=moveFragment('S:'+suffix,'P:'+suffix)||changed;});document.querySelectorAll('template[id^="B:"]').forEach(function(boundary){var suffix=boundary.id.slice(2);changed=revealBoundary('B:'+suffix,'S:'+suffix)||changed;});tries++;if(tries>80||(!document.querySelector('template[id^="B:"]')&&!document.querySelector('template[id^="P:"]'))){clearInterval(timer);}},50);})();</script>`;
7068
- const footer = secureDocumentHTML(
7134
+ const footer = stampDocumentHTML(
7069
7135
  createDocumentFooter({
7070
7136
  suspenseRevealFallback,
7071
7137
  deferredHydrationScript: createDeferredHydrationScript(deferredProps.records)
@@ -7171,7 +7237,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7171
7237
  return await this.routeManager.loadRouteModule(notFoundPath);
7172
7238
  }
7173
7239
  async loadNotFoundComponent() {
7174
- return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _278 => _278.default]), async () => ( null));
7240
+ return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _284 => _284.default]), async () => ( null));
7175
7241
  }
7176
7242
  /** The not-found document's head: layout and not-found metadata, as production renders it. */
7177
7243
  async notFoundMetadataHead(layoutModule, notFoundModule) {
@@ -7194,10 +7260,13 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7194
7260
  */
7195
7261
  async createLateNavigationRecoveryHTML(req, error) {
7196
7262
  if (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error)) {
7197
- return _chunkADEA7PN3cjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
7263
+ return _chunk2DD4JMQCcjs.createLateRedirectRecovery.call(void 0,
7264
+ this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url),
7265
+ this.getCspNonce(req) || ""
7266
+ );
7198
7267
  }
7199
- const pathname = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
7200
- trustProxy: _optionalChain([this, 'access', _279 => _279.config, 'access', _280 => _280.server, 'optionalAccess', _281 => _281.trustProxy])
7268
+ const pathname = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
7269
+ trustProxy: _optionalChain([this, 'access', _285 => _285.config, 'access', _286 => _286.server, 'optionalAccess', _287 => _287.trustProxy])
7201
7270
  }).pathname;
7202
7271
  let content = this.defaultNotFoundContent();
7203
7272
  const NotFoundComponent = await this.loadNotFoundComponent();
@@ -7206,26 +7275,27 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7206
7275
  content = await this.rendererRuntime.renderToString(
7207
7276
  await this.wrapWithIntegrationProviders(
7208
7277
  this.rendererRuntime.createElement(NotFoundComponent, { pathname })
7209
- )
7278
+ ),
7279
+ rendererRenderOptions()
7210
7280
  );
7211
7281
  } catch (error2) {
7212
7282
  _chunk5QIKR7RRcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
7213
7283
  }
7214
7284
  }
7215
- return _chunkADEA7PN3cjs.createLateNotFoundRecovery.call(void 0, content);
7285
+ return _chunk2DD4JMQCcjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
7216
7286
  }
7217
7287
  async render404(req, res) {
7218
7288
  res.statusCode = 404;
7219
- const pathname = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
7220
- trustProxy: _optionalChain([this, 'access', _282 => _282.config, 'access', _283 => _283.server, 'optionalAccess', _284 => _284.trustProxy])
7289
+ const pathname = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
7290
+ trustProxy: _optionalChain([this, 'access', _288 => _288.config, 'access', _289 => _289.server, 'optionalAccess', _290 => _290.trustProxy])
7221
7291
  }).pathname;
7222
7292
  const acceptHeader = req.headers.accept;
7223
7293
  const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
7224
- if (_chunkEUV4YR3Vcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
7225
- res.setHeader("Content-Type", _chunkEUV4YR3Vcjs.FARM_MARKDOWN_CONTENT_TYPE);
7294
+ if (_chunkSGBJ247Qcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
7295
+ res.setHeader("Content-Type", _chunkSGBJ247Qcjs.FARM_MARKDOWN_CONTENT_TYPE);
7226
7296
  res.setHeader("X-Farm-Markdown-Error", "404");
7227
7297
  res.setHeader("Cache-Control", "no-store");
7228
- res.end(_chunkEUV4YR3Vcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
7298
+ res.end(_chunkSGBJ247Qcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
7229
7299
  return;
7230
7300
  }
7231
7301
  const appDir = path9.join(this.config.root, this.config.srcDir, "app");
@@ -7245,9 +7315,9 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7245
7315
  );
7246
7316
  if (notFoundPath) {
7247
7317
  const notFoundModule = await this.loadNotFoundModule();
7248
- const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _285 => _285.default]), () => ( null));
7318
+ const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _291 => _291.default]), () => ( null));
7249
7319
  if (NotFoundComponent) {
7250
- const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _286 => _286.default]), () => ( null));
7320
+ const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _292 => _292.default]), () => ( null));
7251
7321
  let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
7252
7322
  if (LayoutComponent) {
7253
7323
  element = this.rendererRuntime.createElement(LayoutComponent, {
@@ -7255,7 +7325,10 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7255
7325
  });
7256
7326
  }
7257
7327
  element = await this.wrapWithIntegrationProviders(element);
7258
- const content = await this.rendererRuntime.renderToString(element);
7328
+ const content = await this.rendererRuntime.renderToString(
7329
+ element,
7330
+ rendererRenderOptions()
7331
+ );
7259
7332
  const { head: head2, metadata: metadata2 } = await this.notFoundMetadataHead(layoutModule, notFoundModule);
7260
7333
  const html2 = this.createFullHTML(content, false, pathname, head2, { req, metadata: metadata2 });
7261
7334
  res.setHeader("Content-Type", "text/html; charset=utf-8");
@@ -7283,25 +7356,28 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7283
7356
  }
7284
7357
  res.statusCode = statusCode;
7285
7358
  const isDev = process.env.NODE_ENV === "development";
7286
- const requestUrl = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
7287
- trustProxy: _optionalChain([this, 'access', _287 => _287.config, 'access', _288 => _288.server, 'optionalAccess', _289 => _289.trustProxy])
7359
+ const requestUrl = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
7360
+ trustProxy: _optionalChain([this, 'access', _293 => _293.config, 'access', _294 => _294.server, 'optionalAccess', _295 => _295.trustProxy])
7288
7361
  });
7289
7362
  const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
7290
- const statusText = _chunkADEA7PN3cjs.getDefaultErrorStatusText.call(void 0, statusCode);
7291
- const content = _chunkADEA7PN3cjs.createDefaultErrorMarkup.call(void 0, {
7292
- statusCode,
7293
- statusText,
7294
- requestPath: requestUrl.pathname,
7295
- method: req.method || "GET",
7296
- message: _optionalChain([diagnostics, 'optionalAccess', _290 => _290.message]),
7297
- errorName: _optionalChain([diagnostics, 'optionalAccess', _291 => _291.name]),
7298
- stack: _optionalChain([diagnostics, 'optionalAccess', _292 => _292.stack]),
7299
- sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _293 => _293.sourceFrame]),
7300
- development: isDev,
7301
- farmVersion: _chunkDZ5ZVB2Kcjs.FARM_VERSION,
7302
- nodeVersion: process.version,
7303
- mode: isDev ? "development" : "production"
7304
- });
7363
+ const statusText = _chunk2DD4JMQCcjs.getDefaultErrorStatusText.call(void 0, statusCode);
7364
+ const content = this.stampFarmScripts(
7365
+ req,
7366
+ _chunk2DD4JMQCcjs.createDefaultErrorMarkup.call(void 0, {
7367
+ statusCode,
7368
+ statusText,
7369
+ requestPath: requestUrl.pathname,
7370
+ method: req.method || "GET",
7371
+ message: _optionalChain([diagnostics, 'optionalAccess', _296 => _296.message]),
7372
+ errorName: _optionalChain([diagnostics, 'optionalAccess', _297 => _297.name]),
7373
+ stack: _optionalChain([diagnostics, 'optionalAccess', _298 => _298.stack]),
7374
+ sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _299 => _299.sourceFrame]),
7375
+ development: isDev,
7376
+ farmVersion: _chunkKKSTAEMYcjs.FARM_VERSION,
7377
+ nodeVersion: process.version,
7378
+ mode: isDev ? "development" : "production"
7379
+ })
7380
+ );
7305
7381
  const html = this.createFullHTML(
7306
7382
  content,
7307
7383
  false,
@@ -7323,35 +7399,40 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7323
7399
  */
7324
7400
  getI18nAlternateOptions(req, metadata) {
7325
7401
  return {
7326
- metadataBase: _optionalChain([metadata, 'optionalAccess', _294 => _294.metadataBase]),
7327
- origin: req ? _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _295 => _295.config, 'access', _296 => _296.server, 'optionalAccess', _297 => _297.trustProxy]) }).origin : void 0
7402
+ metadataBase: _optionalChain([metadata, 'optionalAccess', _300 => _300.metadataBase]),
7403
+ origin: req ? _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _301 => _301.config, 'access', _302 => _302.server, 'optionalAccess', _303 => _303.trustProxy]) }).origin : void 0
7328
7404
  };
7329
7405
  }
7330
7406
  createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
7331
7407
  const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
7332
- const clientScript = isClientComponent ? ` <script type="module" src="/@farm/client.js"></script>` : "";
7333
- const integrationManifestScript = `<script>
7408
+ const farmScripts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => this.stampFarmScripts(alternates.req, html), "farmScripts");
7409
+ const clientScript = isClientComponent ? ` ${farmScripts(`<script type="module" src="/@farm/client.js"></script>`)}` : "";
7410
+ const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
7411
+ const integrationManifestScript = farmScripts(`<script>
7334
7412
  window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
7335
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkCBJJH36Acjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
7413
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkVU6AAZVYcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
7336
7414
  ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
7337
- </script>`;
7415
+ </script>`);
7338
7416
  const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
7339
7417
  requestPath,
7340
7418
  i18nSnapshot,
7341
7419
  this.getI18nAlternateOptions(alternates.req, alternates.metadata)
7342
7420
  ) : "";
7343
7421
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
7344
- const themeDocument = _chunkADEA7PN3cjs.createFarmThemeDocumentParts.call(void 0,
7422
+ const themeDocument = _chunk2DD4JMQCcjs.createFarmThemeDocumentParts.call(void 0,
7345
7423
  this.config.theme,
7346
7424
  this.config.basePath,
7347
- _chunkKXWRO25Scjs.getTheme.call(void 0, )
7425
+ _chunk472NCAZ7cjs.getTheme.call(void 0, )
7348
7426
  );
7349
- const rendererHydrationScript = _optionalChain([this, 'access', _298 => _298.rendererRuntime, 'access', _299 => _299.generateHydrationScript, 'optionalCall', _300 => _300()]) || "";
7350
- const viewportTags = _chunkEK4QAEFZcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _301 => _301.metadata, 'optionalAccess', _302 => _302.viewport]));
7351
- const fullDocument = _chunkADEA7PN3cjs.extractFarmFullDocument.call(void 0, content);
7427
+ themeDocument.head = farmScripts(themeDocument.head);
7428
+ const rendererHydrationScript = farmScripts(
7429
+ _optionalChain([this, 'access', _304 => _304.rendererRuntime, 'access', _305 => _305.generateHydrationScript, 'optionalCall', _306 => _306()]) || ""
7430
+ );
7431
+ const viewportTags = _chunkEK4QAEFZcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _307 => _307.metadata, 'optionalAccess', _308 => _308.viewport]));
7432
+ const fullDocument = _chunk2DD4JMQCcjs.extractFarmFullDocument.call(void 0, content);
7352
7433
  if (fullDocument) {
7353
- return _chunkADEA7PN3cjs.composeFarmFullDocument.call(void 0,
7354
- metadataHead ? _chunkADEA7PN3cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
7434
+ return _chunk2DD4JMQCcjs.composeFarmFullDocument.call(void 0,
7435
+ metadataHead ? _chunk2DD4JMQCcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
7355
7436
  {
7356
7437
  fallbackIcon: !metadataHead,
7357
7438
  viewport: viewportTags,
@@ -7368,7 +7449,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7368
7449
  fontHead,
7369
7450
  this.devGlobalStylesheetLink(true),
7370
7451
  ...this.collectDevStyleLinks(),
7371
- `<script type="module" src="/@vite/client"></script>`,
7452
+ viteClientScript,
7372
7453
  rendererHydrationScript,
7373
7454
  integrationManifestScript
7374
7455
  ].filter(Boolean).join("\n "),
@@ -7377,7 +7458,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7377
7458
  );
7378
7459
  }
7379
7460
  return `<!DOCTYPE html>
7380
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _303 => _303.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7461
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _309 => _309.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7381
7462
  <head>
7382
7463
  ${themeDocument.head}
7383
7464
  <meta charset="utf-8">
@@ -7387,7 +7468,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7387
7468
  ${fontHead}
7388
7469
  ${this.devGlobalStylesheetLink(true)}${this.collectDevStyleLinks().map((l) => `
7389
7470
  ${l}`).join("")}
7390
- <script type="module" src="/@vite/client"></script>
7471
+ ${viteClientScript}
7391
7472
  ${rendererHydrationScript}
7392
7473
  ${integrationManifestScript}
7393
7474
  </head>
@@ -7401,16 +7482,25 @@ ${clientScript}
7401
7482
  const value = req.__FARM_CSP_NONCE__;
7402
7483
  return typeof value === "string" ? value : void 0;
7403
7484
  }
7485
+ /** Stamp the response nonce on markup Farm generates (never on rendered app output). */
7486
+ stampFarmScripts(req, html) {
7487
+ return _chunk2ZYGC6SScjs.stampFarmCspNonce.call(void 0, html, req && this.getCspNonce(req) || "");
7488
+ }
7489
+ /**
7490
+ * The last pass over a document that holds rendered app output: scripts
7491
+ * keep the response nonce only when Farm or the app (through getCspNonce())
7492
+ * gave it to them.
7493
+ */
7404
7494
  secureDocumentHTML(req, html) {
7405
7495
  const nonce = this.getCspNonce(req);
7406
- return nonce ? _chunkMRMI32SNcjs.addFarmCspNonceToScriptTags.call(void 0, html, nonce) : html;
7496
+ return nonce ? _chunk2ZYGC6SScjs.filterFarmCspNonces.call(void 0, html, nonce) : html;
7407
7497
  }
7408
7498
  applyDeploymentHeaders(req, res) {
7409
7499
  const deploymentId = this.getDeploymentId();
7410
7500
  res.setHeader(_chunkC5GUTBZKcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
7411
7501
  if ((req.method || "GET").toUpperCase() !== "GET") return;
7412
7502
  const forwardedProto = req.headers["x-forwarded-proto"];
7413
- const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _304 => _304.split, 'call', _305 => _305(","), 'access', _306 => _306[0], 'optionalAccess', _307 => _307.trim, 'call', _308 => _308()]) === "https" || Boolean(_optionalChain([req, 'access', _309 => _309.socket, 'optionalAccess', _310 => _310.encrypted]));
7503
+ const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _310 => _310.split, 'call', _311 => _311(","), 'access', _312 => _312[0], 'optionalAccess', _313 => _313.trim, 'call', _314 => _314()]) === "https" || Boolean(_optionalChain([req, 'access', _315 => _315.socket, 'optionalAccess', _316 => _316.encrypted]));
7414
7504
  const cookie = _chunkC5GUTBZKcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
7415
7505
  const existing = res.getHeader("Set-Cookie");
7416
7506
  if (Array.isArray(existing)) {
@@ -7443,7 +7533,7 @@ var _FarmApp = class _FarmApp {
7443
7533
  constructor(config = {}, viteServer) {
7444
7534
  this.config = this.normalizeConfig(config);
7445
7535
  _chunkE3UK5IIBcjs.configureFarmObservability.call(void 0, this.config.observability);
7446
- _chunkKXWRO25Scjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
7536
+ _chunk472NCAZ7cjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
7447
7537
  this.i18nRuntime = _chunkXJXBIP67cjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
7448
7538
  _chunkXJXBIP67cjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
7449
7539
  this.viteServer = viteServer;
@@ -7511,9 +7601,9 @@ var _FarmApp = class _FarmApp {
7511
7601
  context: config.context || (() => void 0),
7512
7602
  server: _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, config.server),
7513
7603
  serverActions: _chunkT5OJPTVNcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
7514
- security: _chunkMRMI32SNcjs.resolveFarmSecurityConfig.call(void 0, config.security),
7604
+ security: _chunk2ZYGC6SScjs.resolveFarmSecurityConfig.call(void 0, config.security),
7515
7605
  images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images),
7516
- performance: _chunkMRMI32SNcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
7606
+ performance: _chunkQTXBII4Zcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
7517
7607
  theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
7518
7608
  i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkHLJ6MBUZcjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
7519
7609
  root,
@@ -7525,7 +7615,7 @@ var _FarmApp = class _FarmApp {
7525
7615
  serverRuntimeConfig: config.serverRuntimeConfig || {},
7526
7616
  publicRuntimeConfig: config.publicRuntimeConfig || {},
7527
7617
  docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
7528
- md: _chunkEUV4YR3Vcjs.resolveMarkdownConfig.call(void 0, config.md),
7618
+ md: _chunkSGBJ247Qcjs.resolveMarkdownConfig.call(void 0, config.md),
7529
7619
  mdx: _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx),
7530
7620
  observability: _nullishCoalesce(config.observability, () => ( false)),
7531
7621
  telemetry: config.telemetry !== false,
@@ -7541,10 +7631,10 @@ var _FarmApp = class _FarmApp {
7541
7631
  env: config.env || { server: {}, public: {} },
7542
7632
  suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
7543
7633
  experimental: {
7544
- serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _311 => _311.experimental, 'optionalAccess', _312 => _312.serverComponents]), () => ( false)),
7545
- serverActions: _nullishCoalesce(_optionalChain([config, 'access', _313 => _313.experimental, 'optionalAccess', _314 => _314.serverActions]), () => ( false)),
7546
- isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _315 => _315.experimental, 'optionalAccess', _316 => _316.isolatedClientHydration]), () => ( "off")),
7547
- ppr: _nullishCoalesce(_optionalChain([config, 'access', _317 => _317.experimental, 'optionalAccess', _318 => _318.ppr]), () => ( false)),
7634
+ serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _317 => _317.experimental, 'optionalAccess', _318 => _318.serverComponents]), () => ( false)),
7635
+ serverActions: _nullishCoalesce(_optionalChain([config, 'access', _319 => _319.experimental, 'optionalAccess', _320 => _320.serverActions]), () => ( false)),
7636
+ isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _321 => _321.experimental, 'optionalAccess', _322 => _322.isolatedClientHydration]), () => ( "off")),
7637
+ ppr: _nullishCoalesce(_optionalChain([config, 'access', _323 => _323.experimental, 'optionalAccess', _324 => _324.ppr]), () => ( false)),
7548
7638
  ...config.experimental
7549
7639
  },
7550
7640
  agent: _nullishCoalesce(config.agent, () => ( {})),
@@ -7558,7 +7648,7 @@ var _FarmApp = class _FarmApp {
7558
7648
  );
7559
7649
  if (!hasAppDirectory) {
7560
7650
  const routeFiles = _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
7561
- (source) => _chunkSJNMVDDFcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
7651
+ (source) => _chunkFUCSUGDMcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
7562
7652
  );
7563
7653
  if (routeFiles.length > 0) {
7564
7654
  return;
@@ -7595,7 +7685,7 @@ function isResolvedAuthConfig(value) {
7595
7685
  }
7596
7686
  _chunkS3JO3N4Hcjs.__name.call(void 0, isResolvedAuthConfig, "isResolvedAuthConfig");
7597
7687
  function normalizeFarmAppAPIConfig(config) {
7598
- if (typeof _optionalChain([config, 'optionalAccess', _319 => _319.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _320 => _320.basePath]) === "function") {
7688
+ if (typeof _optionalChain([config, 'optionalAccess', _325 => _325.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _326 => _326.basePath]) === "function") {
7599
7689
  throw new Error(
7600
7690
  "Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
7601
7691
  );
@@ -7621,7 +7711,7 @@ function adaptPluginOption(pluginOption) {
7621
7711
  if (Array.isArray(pluginOption)) return pluginOption.map(adaptPluginOption);
7622
7712
  if (!pluginOption || typeof pluginOption !== "object") return pluginOption;
7623
7713
  const plugin = pluginOption;
7624
- if (!_optionalChain([plugin, 'access', _321 => _321.name, 'optionalAccess', _322 => _322.startsWith, 'call', _323 => _323("@tailwindcss/vite:generate:")])) return pluginOption;
7714
+ if (!_optionalChain([plugin, 'access', _327 => _327.name, 'optionalAccess', _328 => _328.startsWith, 'call', _329 => _329("@tailwindcss/vite:generate:")])) return pluginOption;
7625
7715
  if (isVitePluginHook(plugin.transform)) {
7626
7716
  return {
7627
7717
  ...plugin,
@@ -7707,7 +7797,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createMissingTailwindPlugin, "createMissin
7707
7797
  var SHARP_INSTALL_HINT = _chunkLYLEZIG3cjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
7708
7798
  var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
7709
7799
  function resolveFarmImageProviderForRuntime(images, options) {
7710
- const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _324 => _324.provider]), () => ( "auto"));
7800
+ const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _330 => _330.provider]), () => ( "auto"));
7711
7801
  if (provider === "none") return images;
7712
7802
  const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
7713
7803
  if (!usesSharp || _chunkLYLEZIG3cjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
@@ -7732,7 +7822,7 @@ function validateSchemaSteps(owner, schema, steps) {
7732
7822
  const models = _chunkJSROZYYOcjs.resolveSchemaModels.call(void 0, owner, schema);
7733
7823
  const ids = /* @__PURE__ */ new Set();
7734
7824
  for (const step of steps) {
7735
- const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _325 => _325.id])}"`;
7825
+ const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _331 => _331.id])}"`;
7736
7826
  if (!step || typeof step.id !== "string" || step.id.trim() === "") {
7737
7827
  throw new TypeError(`${owner}: every migration step needs a non-empty \`id\`.`);
7738
7828
  }
@@ -7821,7 +7911,7 @@ ${lines.join("\n")}`);
7821
7911
  _chunkS3JO3N4Hcjs.__name.call(void 0, _FarmPluginOptionsError, "FarmPluginOptionsError");
7822
7912
  var FarmPluginOptionsError = _FarmPluginOptionsError;
7823
7913
  function formatIssuePath(path22) {
7824
- if (!_optionalChain([path22, 'optionalAccess', _326 => _326.length])) return "";
7914
+ if (!_optionalChain([path22, 'optionalAccess', _332 => _332.length])) return "";
7825
7915
  return path22.map((segment) => {
7826
7916
  const key = typeof segment === "object" && segment !== null ? segment.key : segment;
7827
7917
  return typeof key === "symbol" ? key.toString() : String(key);
@@ -7835,11 +7925,11 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isPromiseLike, "isPromiseLike");
7835
7925
  function isPluginOptionsSchema(value) {
7836
7926
  if (typeof value !== "object" && typeof value !== "function" || value === null) return false;
7837
7927
  const standard = value["~standard"];
7838
- return typeof _optionalChain([standard, 'optionalAccess', _327 => _327.validate]) === "function";
7928
+ return typeof _optionalChain([standard, 'optionalAccess', _333 => _333.validate]) === "function";
7839
7929
  }
7840
7930
  _chunkS3JO3N4Hcjs.__name.call(void 0, isPluginOptionsSchema, "isPluginOptionsSchema");
7841
7931
  function parsePluginOptions(schema, options) {
7842
- const standard = _optionalChain([schema, 'optionalAccess', _328 => _328["~standard"]]);
7932
+ const standard = _optionalChain([schema, 'optionalAccess', _334 => _334["~standard"]]);
7843
7933
  if (!standard || typeof standard.validate !== "function") {
7844
7934
  throw new TypeError(
7845
7935
  "A plugin's `options` needs a Standard Schema, such as a Zod, Valibot, or ArkType schema."
@@ -7899,9 +7989,9 @@ function normalizeRuntimeEndpointRequestPath(pathname) {
7899
7989
  _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeRuntimeEndpointRequestPath, "normalizeRuntimeEndpointRequestPath");
7900
7990
  function farmPluginMayAffectRuntimePath(plugin, pathname) {
7901
7991
  const runtime = plugin.runtime;
7902
- const endpoints = _optionalChain([runtime, 'optionalAccess', _329 => _329.endpoints]);
7992
+ const endpoints = _optionalChain([runtime, 'optionalAccess', _335 => _335.endpoints]);
7903
7993
  const hasUnscopedRequestHooks = Boolean(
7904
- plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _330 => _330.context]) || _optionalChain([runtime, 'optionalAccess', _331 => _331.before]) || _optionalChain([runtime, 'optionalAccess', _332 => _332.after]) || _optionalChain([runtime, 'optionalAccess', _333 => _333.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
7994
+ plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _336 => _336.context]) || _optionalChain([runtime, 'optionalAccess', _337 => _337.before]) || _optionalChain([runtime, 'optionalAccess', _338 => _338.after]) || _optionalChain([runtime, 'optionalAccess', _339 => _339.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
7905
7995
  );
7906
7996
  if (hasUnscopedRequestHooks) return true;
7907
7997
  if (Array.isArray(endpoints) && endpoints.length > 0) {
@@ -7913,7 +8003,7 @@ function farmPluginMayAffectRuntimePath(plugin, pathname) {
7913
8003
  ) === normalizedPathname
7914
8004
  );
7915
8005
  }
7916
- return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _334 => _334.start]) || _optionalChain([runtime, 'optionalAccess', _335 => _335.close]));
8006
+ return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _340 => _340.start]) || _optionalChain([runtime, 'optionalAccess', _341 => _341.close]));
7917
8007
  }
7918
8008
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmPluginMayAffectRuntimePath, "farmPluginMayAffectRuntimePath");
7919
8009
 
@@ -7993,7 +8083,7 @@ var _PluginManager = class _PluginManager {
7993
8083
  };
7994
8084
  }
7995
8085
  createPluginHookContext(plugin, context = this.context) {
7996
- const integration = _chunkCBJJH36Acjs.getFarmPluginIntegrationContext.call(void 0, plugin);
8086
+ const integration = _chunkVU6AAZVYcjs.getFarmPluginIntegrationContext.call(void 0, plugin);
7997
8087
  return integration ? { ...context, integration } : context;
7998
8088
  }
7999
8089
  createRequestHookContext(target, plugin) {
@@ -8047,7 +8137,7 @@ var _PluginManager = class _PluginManager {
8047
8137
  const endpoints = [];
8048
8138
  const owners = /* @__PURE__ */ new Map();
8049
8139
  for (const plugin of this.getSortedPlugins()) {
8050
- const configured = _optionalChain([plugin, 'access', _336 => _336.runtime, 'optionalAccess', _337 => _337.endpoints]);
8140
+ const configured = _optionalChain([plugin, 'access', _342 => _342.runtime, 'optionalAccess', _343 => _343.endpoints]);
8051
8141
  if (configured === void 0) continue;
8052
8142
  if (!Array.isArray(configured)) {
8053
8143
  throw new TypeError(`Farm plugin "${plugin.name}" runtime.endpoints must be an array`);
@@ -8118,7 +8208,7 @@ var _PluginManager = class _PluginManager {
8118
8208
  const values = {};
8119
8209
  const owners = /* @__PURE__ */ new Map();
8120
8210
  for (const plugin of this.getSortedPlugins()) {
8121
- const createContext = _optionalChain([plugin, 'access', _338 => _338.runtime, 'optionalAccess', _339 => _339.context]);
8211
+ const createContext = _optionalChain([plugin, 'access', _344 => _344.runtime, 'optionalAccess', _345 => _345.context]);
8122
8212
  if (!createContext) continue;
8123
8213
  const result = await createContext(
8124
8214
  this.createRuntimeBaseEvent(plugin, request2, options, waitUntil)
@@ -8144,7 +8234,7 @@ var _PluginManager = class _PluginManager {
8144
8234
  }
8145
8235
  async runRuntimeErrorHooks(request2, error, ctx, durationMs, options, waitUntil) {
8146
8236
  for (const plugin of this.getSortedPlugins()) {
8147
- const onError = _optionalChain([plugin, 'access', _340 => _340.runtime, 'optionalAccess', _341 => _341.error]);
8237
+ const onError = _optionalChain([plugin, 'access', _346 => _346.runtime, 'optionalAccess', _347 => _347.error]);
8148
8238
  if (!onError) continue;
8149
8239
  try {
8150
8240
  await onError({
@@ -8188,19 +8278,19 @@ var _PluginManager = class _PluginManager {
8188
8278
  case "config":
8189
8279
  if (plugin.configure) {
8190
8280
  hooks.push(
8191
- (config, context) => _optionalChain([plugin, 'access', _342 => _342.configure, 'optionalCall', _343 => _343(config, context)])
8281
+ (config, context) => _optionalChain([plugin, 'access', _348 => _348.configure, 'optionalCall', _349 => _349(config, context)])
8192
8282
  );
8193
8283
  }
8194
8284
  break;
8195
8285
  case "ready":
8196
- if (_optionalChain([plugin, 'access', _344 => _344.runtime, 'optionalAccess', _345 => _345.start])) {
8197
- hooks.push((context) => _optionalChain([plugin, 'access', _346 => _346.runtime, 'optionalAccess', _347 => _347.start, 'optionalCall', _348 => _348(withState(context))]));
8286
+ if (_optionalChain([plugin, 'access', _350 => _350.runtime, 'optionalAccess', _351 => _351.start])) {
8287
+ hooks.push((context) => _optionalChain([plugin, 'access', _352 => _352.runtime, 'optionalAccess', _353 => _353.start, 'optionalCall', _354 => _354(withState(context))]));
8198
8288
  }
8199
8289
  break;
8200
8290
  case "shutdown":
8201
- if (_optionalChain([plugin, 'access', _349 => _349.runtime, 'optionalAccess', _350 => _350.close])) {
8291
+ if (_optionalChain([plugin, 'access', _355 => _355.runtime, 'optionalAccess', _356 => _356.close])) {
8202
8292
  hooks.push(
8203
- (payload, context) => _optionalChain([plugin, 'access', _351 => _351.runtime, 'optionalAccess', _352 => _352.close, 'optionalCall', _353 => _353({
8293
+ (payload, context) => _optionalChain([plugin, 'access', _357 => _357.runtime, 'optionalAccess', _358 => _358.close, 'optionalCall', _359 => _359({
8204
8294
  ...withState(context),
8205
8295
  reason: payload.reason
8206
8296
  })])
@@ -8208,93 +8298,93 @@ var _PluginManager = class _PluginManager {
8208
8298
  }
8209
8299
  break;
8210
8300
  case "routeDiscovered":
8211
- if (_optionalChain([plugin, 'access', _354 => _354.router, 'optionalAccess', _355 => _355.discovered])) {
8301
+ if (_optionalChain([plugin, 'access', _360 => _360.router, 'optionalAccess', _361 => _361.discovered])) {
8212
8302
  hooks.push(
8213
- (route, context) => _optionalChain([plugin, 'access', _356 => _356.router, 'optionalAccess', _357 => _357.discovered, 'optionalCall', _358 => _358(route, withState(context))])
8303
+ (route, context) => _optionalChain([plugin, 'access', _362 => _362.router, 'optionalAccess', _363 => _363.discovered, 'optionalCall', _364 => _364(route, withState(context))])
8214
8304
  );
8215
8305
  }
8216
8306
  break;
8217
8307
  case "middlewareDiscovered":
8218
- if (_optionalChain([plugin, 'access', _359 => _359.router, 'optionalAccess', _360 => _360.discovered])) {
8308
+ if (_optionalChain([plugin, 'access', _365 => _365.router, 'optionalAccess', _366 => _366.discovered])) {
8219
8309
  hooks.push(
8220
- (route, context) => _optionalChain([plugin, 'access', _361 => _361.router, 'optionalAccess', _362 => _362.discovered, 'optionalCall', _363 => _363({ kind: "middleware", ...route }, withState(context))])
8310
+ (route, context) => _optionalChain([plugin, 'access', _367 => _367.router, 'optionalAccess', _368 => _368.discovered, 'optionalCall', _369 => _369({ kind: "middleware", ...route }, withState(context))])
8221
8311
  );
8222
8312
  }
8223
8313
  break;
8224
8314
  case "apiRouteDiscovered":
8225
- if (_optionalChain([plugin, 'access', _364 => _364.router, 'optionalAccess', _365 => _365.discovered])) {
8315
+ if (_optionalChain([plugin, 'access', _370 => _370.router, 'optionalAccess', _371 => _371.discovered])) {
8226
8316
  hooks.push(
8227
- (route, context) => _optionalChain([plugin, 'access', _366 => _366.router, 'optionalAccess', _367 => _367.discovered, 'optionalCall', _368 => _368({ kind: "api", ...route }, withState(context))])
8317
+ (route, context) => _optionalChain([plugin, 'access', _372 => _372.router, 'optionalAccess', _373 => _373.discovered, 'optionalCall', _374 => _374({ kind: "api", ...route }, withState(context))])
8228
8318
  );
8229
8319
  }
8230
8320
  break;
8231
8321
  case "routesGenerated":
8232
- if (_optionalChain([plugin, 'access', _369 => _369.router, 'optionalAccess', _370 => _370.generated])) {
8322
+ if (_optionalChain([plugin, 'access', _375 => _375.router, 'optionalAccess', _376 => _376.generated])) {
8233
8323
  hooks.push(
8234
- (routes, context) => _optionalChain([plugin, 'access', _371 => _371.router, 'optionalAccess', _372 => _372.generated, 'optionalCall', _373 => _373(routes, withState(context))])
8324
+ (routes, context) => _optionalChain([plugin, 'access', _377 => _377.router, 'optionalAccess', _378 => _378.generated, 'optionalCall', _379 => _379(routes, withState(context))])
8235
8325
  );
8236
8326
  }
8237
8327
  break;
8238
8328
  case "beforeRouteMatch":
8239
- if (_optionalChain([plugin, 'access', _374 => _374.router, 'optionalAccess', _375 => _375.before])) {
8329
+ if (_optionalChain([plugin, 'access', _380 => _380.router, 'optionalAccess', _381 => _381.before])) {
8240
8330
  hooks.push(
8241
- (route, context) => _optionalChain([plugin, 'access', _376 => _376.router, 'optionalAccess', _377 => _377.before, 'optionalCall', _378 => _378(route, withState(context))])
8331
+ (route, context) => _optionalChain([plugin, 'access', _382 => _382.router, 'optionalAccess', _383 => _383.before, 'optionalCall', _384 => _384(route, withState(context))])
8242
8332
  );
8243
8333
  }
8244
8334
  break;
8245
8335
  case "afterRouteMatch":
8246
- if (_optionalChain([plugin, 'access', _379 => _379.router, 'optionalAccess', _380 => _380.after])) {
8336
+ if (_optionalChain([plugin, 'access', _385 => _385.router, 'optionalAccess', _386 => _386.after])) {
8247
8337
  hooks.push(
8248
- (result, context) => _optionalChain([plugin, 'access', _381 => _381.router, 'optionalAccess', _382 => _382.after, 'optionalCall', _383 => _383(result, withState(context))])
8338
+ (result, context) => _optionalChain([plugin, 'access', _387 => _387.router, 'optionalAccess', _388 => _388.after, 'optionalCall', _389 => _389(result, withState(context))])
8249
8339
  );
8250
8340
  }
8251
8341
  break;
8252
8342
  case "beforeRender":
8253
- if (_optionalChain([plugin, 'access', _384 => _384.render, 'optionalAccess', _385 => _385.before])) {
8343
+ if (_optionalChain([plugin, 'access', _390 => _390.render, 'optionalAccess', _391 => _391.before])) {
8254
8344
  hooks.push(
8255
- (render, context) => _optionalChain([plugin, 'access', _386 => _386.render, 'optionalAccess', _387 => _387.before, 'optionalCall', _388 => _388(render, withState(context))])
8345
+ (render, context) => _optionalChain([plugin, 'access', _392 => _392.render, 'optionalAccess', _393 => _393.before, 'optionalCall', _394 => _394(render, withState(context))])
8256
8346
  );
8257
8347
  }
8258
8348
  break;
8259
8349
  case "afterRender":
8260
- if (_optionalChain([plugin, 'access', _389 => _389.render, 'optionalAccess', _390 => _390.html])) {
8350
+ if (_optionalChain([plugin, 'access', _395 => _395.render, 'optionalAccess', _396 => _396.html])) {
8261
8351
  hooks.push(
8262
- (html, render, context) => _optionalChain([plugin, 'access', _391 => _391.render, 'optionalAccess', _392 => _392.html, 'optionalCall', _393 => _393(html, render, withState(context))])
8352
+ (html, render, context) => _optionalChain([plugin, 'access', _397 => _397.render, 'optionalAccess', _398 => _398.html, 'optionalCall', _399 => _399(html, render, withState(context))])
8263
8353
  );
8264
8354
  }
8265
8355
  break;
8266
8356
  case "beforeBundle":
8267
- if (_optionalChain([plugin, 'access', _394 => _394.build, 'optionalAccess', _395 => _395.before])) {
8357
+ if (_optionalChain([plugin, 'access', _400 => _400.build, 'optionalAccess', _401 => _401.before])) {
8268
8358
  hooks.push(
8269
- (bundle, context) => _optionalChain([plugin, 'access', _396 => _396.build, 'optionalAccess', _397 => _397.before, 'optionalCall', _398 => _398(bundle, withState(context))])
8359
+ (bundle, context) => _optionalChain([plugin, 'access', _402 => _402.build, 'optionalAccess', _403 => _403.before, 'optionalCall', _404 => _404(bundle, withState(context))])
8270
8360
  );
8271
8361
  }
8272
8362
  break;
8273
8363
  case "beforeNitroBuild":
8274
- if (_optionalChain([plugin, 'access', _399 => _399.build, 'optionalAccess', _400 => _400.configure])) {
8364
+ if (_optionalChain([plugin, 'access', _405 => _405.build, 'optionalAccess', _406 => _406.configure])) {
8275
8365
  hooks.push(
8276
- (buildConfig, context) => _optionalChain([plugin, 'access', _401 => _401.build, 'optionalAccess', _402 => _402.configure, 'optionalCall', _403 => _403(buildConfig, withState(context))])
8366
+ (buildConfig, context) => _optionalChain([plugin, 'access', _407 => _407.build, 'optionalAccess', _408 => _408.configure, 'optionalCall', _409 => _409(buildConfig, withState(context))])
8277
8367
  );
8278
8368
  }
8279
8369
  break;
8280
8370
  case "afterBundle":
8281
- if (_optionalChain([plugin, 'access', _404 => _404.build, 'optionalAccess', _405 => _405.after])) {
8371
+ if (_optionalChain([plugin, 'access', _410 => _410.build, 'optionalAccess', _411 => _411.after])) {
8282
8372
  hooks.push(
8283
- (result, context) => _optionalChain([plugin, 'access', _406 => _406.build, 'optionalAccess', _407 => _407.after, 'optionalCall', _408 => _408(result, withState(context))])
8373
+ (result, context) => _optionalChain([plugin, 'access', _412 => _412.build, 'optionalAccess', _413 => _413.after, 'optionalCall', _414 => _414(result, withState(context))])
8284
8374
  );
8285
8375
  }
8286
8376
  break;
8287
8377
  case "devServerCreated":
8288
- if (_optionalChain([plugin, 'access', _409 => _409.dev, 'optionalAccess', _410 => _410.server])) {
8378
+ if (_optionalChain([plugin, 'access', _415 => _415.dev, 'optionalAccess', _416 => _416.server])) {
8289
8379
  hooks.push(
8290
- (server, context) => _optionalChain([plugin, 'access', _411 => _411.dev, 'optionalAccess', _412 => _412.server, 'optionalCall', _413 => _413(server, withState(context))])
8380
+ (server, context) => _optionalChain([plugin, 'access', _417 => _417.dev, 'optionalAccess', _418 => _418.server, 'optionalCall', _419 => _419(server, withState(context))])
8291
8381
  );
8292
8382
  }
8293
8383
  break;
8294
8384
  case "hmrUpdate":
8295
- if (_optionalChain([plugin, 'access', _414 => _414.dev, 'optionalAccess', _415 => _415.update])) {
8385
+ if (_optionalChain([plugin, 'access', _420 => _420.dev, 'optionalAccess', _421 => _421.update])) {
8296
8386
  hooks.push(
8297
- (update, context) => _optionalChain([plugin, 'access', _416 => _416.dev, 'optionalAccess', _417 => _417.update, 'optionalCall', _418 => _418(update, withState(context))])
8387
+ (update, context) => _optionalChain([plugin, 'access', _422 => _422.dev, 'optionalAccess', _423 => _423.update, 'optionalCall', _424 => _424(update, withState(context))])
8298
8388
  );
8299
8389
  }
8300
8390
  break;
@@ -8340,7 +8430,7 @@ var _PluginManager = class _PluginManager {
8340
8430
  hasRuntimeHook(hookName) {
8341
8431
  const cached = this.runtimeHookPresence.get(hookName);
8342
8432
  if (cached !== void 0) return cached;
8343
- const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _419 => _419.runtime, 'optionalAccess', _420 => _420[hookName]]) === "function");
8433
+ const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _425 => _425.runtime, 'optionalAccess', _426 => _426[hookName]]) === "function");
8344
8434
  this.runtimeHookPresence.set(hookName, present);
8345
8435
  return present;
8346
8436
  }
@@ -8419,7 +8509,7 @@ var _PluginManager = class _PluginManager {
8419
8509
  async beginRuntimeRequest(request2, options = {}) {
8420
8510
  await this.startRuntime();
8421
8511
  const startedAt = Date.now();
8422
- const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _421 => _421.waitUntil, 'optionalCall', _422 => _422(Promise.resolve(promise))]) : (promise) => {
8512
+ const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _427 => _427.waitUntil, 'optionalCall', _428 => _428(Promise.resolve(promise))]) : (promise) => {
8423
8513
  void Promise.resolve(promise).catch(() => {
8424
8514
  });
8425
8515
  };
@@ -8452,7 +8542,7 @@ var _PluginManager = class _PluginManager {
8452
8542
  );
8453
8543
  let response;
8454
8544
  for (const plugin of this.getSortedPlugins()) {
8455
- const before = _optionalChain([plugin, 'access', _423 => _423.runtime, 'optionalAccess', _424 => _424.before]);
8545
+ const before = _optionalChain([plugin, 'access', _429 => _429.runtime, 'optionalAccess', _430 => _430.before]);
8456
8546
  if (!before) continue;
8457
8547
  const result = await before({
8458
8548
  ...this.createRuntimeBaseEvent(plugin, activeRequest, activeOptions, waitUntil),
@@ -8498,7 +8588,7 @@ var _PluginManager = class _PluginManager {
8498
8588
  let response = initialResponse;
8499
8589
  try {
8500
8590
  for (const plugin of this.getSortedPlugins()) {
8501
- const after = _optionalChain([plugin, 'access', _425 => _425.runtime, 'optionalAccess', _426 => _426.after]);
8591
+ const after = _optionalChain([plugin, 'access', _431 => _431.runtime, 'optionalAccess', _432 => _432.after]);
8502
8592
  if (!after) continue;
8503
8593
  const result = await after({
8504
8594
  ...this.createRuntimeBaseEvent(
@@ -8587,7 +8677,7 @@ var _PluginManager = class _PluginManager {
8587
8677
  /** @internal Runs hooks for only the plugins selected by the runtime adapter. */
8588
8678
  async runHookParallelFiltered(hookName, include, ...args) {
8589
8679
  if (hookName === "shutdown" && !this.runtimeShutdownHooksRunning) {
8590
- await this.closeRuntime(_optionalChain([args, 'access', _427 => _427[0], 'optionalAccess', _428 => _428.reason]));
8680
+ await this.closeRuntime(_optionalChain([args, 'access', _433 => _433[0], 'optionalAccess', _434 => _434.reason]));
8591
8681
  return false;
8592
8682
  }
8593
8683
  const plugins = this.getSortedPlugins().filter(include);
@@ -8700,7 +8790,7 @@ function createPluginFactory(definition) {
8700
8790
  configure: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (config, context) => configure(config, { ...context, options }), "configure")
8701
8791
  } : {},
8702
8792
  setup(context) {
8703
- const state = _optionalChain([setup, 'optionalCall', _429 => _429({ ...context, options })]);
8793
+ const state = _optionalChain([setup, 'optionalCall', _435 => _435({ ...context, options })]);
8704
8794
  return state instanceof Promise ? state.then(resolveState) : resolveState(state);
8705
8795
  }
8706
8796
  });
@@ -8741,10 +8831,10 @@ function declarePluginSchema(plugin) {
8741
8831
  models: Object.keys(models).filter((key) => !models[key].external),
8742
8832
  ...plugin.dependsOn ? { dependsOn: plugin.dependsOn.map(_chunk6MVFL3R5cjs.pluginShortName) } : {},
8743
8833
  ...plugin.version ? { version: plugin.version } : {},
8744
- ..._optionalChain([plugin, 'access', _430 => _430.migrations, 'optionalAccess', _431 => _431.length]) ? { migrations: plugin.migrations } : {},
8745
- dialect: _optionalChain([database, 'optionalAccess', _432 => _432.dialect]),
8834
+ ..._optionalChain([plugin, 'access', _436 => _436.migrations, 'optionalAccess', _437 => _437.length]) ? { migrations: plugin.migrations } : {},
8835
+ dialect: _optionalChain([database, 'optionalAccess', _438 => _438.dialect]),
8746
8836
  resolveClient: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (config) => {
8747
- if (_optionalChain([database, 'optionalAccess', _433 => _433.client]) !== void 0 && database.client !== null) {
8837
+ if (_optionalChain([database, 'optionalAccess', _439 => _439.client]) !== void 0 && database.client !== null) {
8748
8838
  const client2 = typeof database.client === "function" ? await database.client() : database.client;
8749
8839
  if (client2 === void 0 || client2 === null) {
8750
8840
  throw new Error(`The ${name} plugin's \`database.client\` returned no connection.`);
@@ -8798,7 +8888,7 @@ function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
8798
8888
  }
8799
8889
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAppClientEntry, "resolveFarmAppClientEntry");
8800
8890
  function resolveFarmClientPlugins(plugins, _root) {
8801
- if (!_optionalChain([plugins, 'optionalAccess', _434 => _434.length])) return [];
8891
+ if (!_optionalChain([plugins, 'optionalAccess', _440 => _440.length])) return [];
8802
8892
  return plugins.flatMap((plugin) => {
8803
8893
  if (!plugin.client) return [];
8804
8894
  assertClientLifecycle(plugin.client, plugin.name);
@@ -8878,7 +8968,7 @@ function assertLifecycleObject(value, pluginName, location, allowedKeys) {
8878
8968
  throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
8879
8969
  }
8880
8970
  const descriptor = Object.getOwnPropertyDescriptor(value, key);
8881
- if (!_optionalChain([descriptor, 'optionalAccess', _435 => _435.enumerable])) {
8971
+ if (!_optionalChain([descriptor, 'optionalAccess', _441 => _441.enumerable])) {
8882
8972
  throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
8883
8973
  }
8884
8974
  if (!("value" in descriptor)) {
@@ -9002,7 +9092,7 @@ function assertPublicData(value, pluginName) {
9002
9092
  throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
9003
9093
  }
9004
9094
  const descriptor = Object.getOwnPropertyDescriptor(current, key);
9005
- if (!_optionalChain([descriptor, 'optionalAccess', _436 => _436.enumerable])) {
9095
+ if (!_optionalChain([descriptor, 'optionalAccess', _442 => _442.enumerable])) {
9006
9096
  throwPublicDataError(
9007
9097
  pluginName,
9008
9098
  [...pathSegments, key],
@@ -9048,8 +9138,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isArrayIndex, "isArrayIndex");
9048
9138
 
9049
9139
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
9050
9140
  function resolveFarmClientCacheAdapterEntry(root, cache2) {
9051
- const client = _optionalChain([cache2, 'optionalAccess', _437 => _437.client]);
9052
- const adapter = _optionalChain([client, 'optionalAccess', _438 => _438.adapter]);
9141
+ const client = _optionalChain([cache2, 'optionalAccess', _443 => _443.client]);
9142
+ const adapter = _optionalChain([client, 'optionalAccess', _444 => _444.adapter]);
9053
9143
  if (adapter === void 0) return void 0;
9054
9144
  if (typeof adapter !== "string" || adapter.trim().length === 0) {
9055
9145
  throw new Error(
@@ -9064,8 +9154,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
9064
9154
  );
9065
9155
  }
9066
9156
  const options = {};
9067
- if (_optionalChain([client, 'optionalAccess', _439 => _439.version]) !== void 0) options.version = client.version;
9068
- if (_optionalChain([client, 'optionalAccess', _440 => _440.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
9157
+ if (_optionalChain([client, 'optionalAccess', _445 => _445.version]) !== void 0) options.version = client.version;
9158
+ if (_optionalChain([client, 'optionalAccess', _446 => _446.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
9069
9159
  return { importPath: found.replace(/\\/g, "/"), options };
9070
9160
  }
9071
9161
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmClientCacheAdapterEntry, "resolveFarmClientCacheAdapterEntry");
@@ -9194,9 +9284,9 @@ function staticValue(node) {
9194
9284
  }
9195
9285
  _chunkS3JO3N4Hcjs.__name.call(void 0, staticValue, "staticValue");
9196
9286
  function property(object, name) {
9197
- return _optionalChain([object, 'access', _441 => _441.properties, 'access', _442 => _442.find, 'call', _443 => _443(
9287
+ return _optionalChain([object, 'access', _447 => _447.properties, 'access', _448 => _448.find, 'call', _449 => _449(
9198
9288
  (entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
9199
- ), 'optionalAccess', _444 => _444.value]);
9289
+ ), 'optionalAccess', _450 => _450.value]);
9200
9290
  }
9201
9291
  _chunkS3JO3N4Hcjs.__name.call(void 0, property, "property");
9202
9292
  function toolFromObject(object) {
@@ -9244,7 +9334,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
9244
9334
  if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
9245
9335
  continue;
9246
9336
  for (const specifier of statement.specifiers) {
9247
- const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _445 => _445.imported, 'optionalAccess', _446 => _446.name]), () => ( _optionalChain([specifier, 'access', _447 => _447.imported, 'optionalAccess', _448 => _448.value])));
9337
+ const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _451 => _451.imported, 'optionalAccess', _452 => _452.name]), () => ( _optionalChain([specifier, 'access', _453 => _453.imported, 'optionalAccess', _454 => _454.value])));
9248
9338
  if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
9249
9339
  locals.set(specifier.local.name, imported);
9250
9340
  }
@@ -9260,7 +9350,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
9260
9350
  const [argument] = current.arguments;
9261
9351
  if (definer && argument) {
9262
9352
  const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
9263
- (element) => _optionalChain([element, 'optionalAccess', _449 => _449.type]) === "ObjectExpression"
9353
+ (element) => _optionalChain([element, 'optionalAccess', _455 => _455.type]) === "ObjectExpression"
9264
9354
  ) : [] : argument.type === "ObjectExpression" ? [argument] : [];
9265
9355
  for (const object of objects) {
9266
9356
  const tool = toolFromObject(object);
@@ -9347,19 +9437,23 @@ function unwrapFarmDocumentElement(node) {
9347
9437
  });
9348
9438
  }
9349
9439
 
9440
+ function farmLayoutBoundaryElement(pattern, content) {
9441
+ return React.createElement(
9442
+ "div",
9443
+ {
9444
+ "data-farm-layout-boundary": "true",
9445
+ "data-farm-layout-pattern": pattern,
9446
+ style: { display: "contents" },
9447
+ },
9448
+ content,
9449
+ );
9450
+ }
9451
+
9350
9452
  function FarmLayoutBoundary(props) {
9351
9453
  const Component = props.component;
9352
9454
  const layoutProps = { children: props.children, params: props.params };
9353
9455
  const boundary = function (content) {
9354
- return React.createElement(
9355
- "div",
9356
- {
9357
- "data-farm-layout-boundary": "true",
9358
- "data-farm-layout-pattern": props.pattern,
9359
- style: { display: "contents" },
9360
- },
9361
- content,
9362
- );
9456
+ return farmLayoutBoundaryElement(props.pattern, content);
9363
9457
  };
9364
9458
  const isPlainFunction =
9365
9459
  typeof Component === "function" &&
@@ -9375,6 +9469,12 @@ function FarmLayoutBoundary(props) {
9375
9469
  }
9376
9470
 
9377
9471
  function createFarmLayoutElement(Component, pattern, children, params) {
9472
+ if (typeof React.markFunctionComponent === "function") {
9473
+ return farmLayoutBoundaryElement(
9474
+ pattern,
9475
+ React.createElement(Component, { children: children, params: params }),
9476
+ );
9477
+ }
9378
9478
  return React.createElement(
9379
9479
  FarmLayoutBoundary,
9380
9480
  { key: farmLayoutComponentKey(Component), component: Component, pattern: pattern, params: params },
@@ -9446,8 +9546,8 @@ async function isAllowedPreviewRequest(server, options, req) {
9446
9546
  if (method !== "GET" && method !== "HEAD") return true;
9447
9547
  const file = await resolveRequestedFile(server, pathname);
9448
9548
  if (!file) return true;
9449
- const client = _optionalChain([server, 'access', _450 => _450.environments, 'optionalAccess', _451 => _451.client]);
9450
- const inClientGraph = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => Boolean(await _optionalChain([client, 'optionalAccess', _452 => _452.moduleGraph, 'access', _453 => _453.getModuleByUrl, 'call', _454 => _454(url)])), "inClientGraph");
9549
+ const client = _optionalChain([server, 'access', _456 => _456.environments, 'optionalAccess', _457 => _457.client]);
9550
+ const inClientGraph = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => Boolean(await _optionalChain([client, 'optionalAccess', _458 => _458.moduleGraph, 'access', _459 => _459.getModuleByUrl, 'call', _460 => _460(url)])), "inClientGraph");
9451
9551
  if (SOURCE_QUERY_FLAGS.some((flag) => query.has(flag))) return inClientGraph();
9452
9552
  if (await inClientGraph()) return true;
9453
9553
  if (file.split(path16.sep).includes("node_modules")) return true;
@@ -9476,10 +9576,10 @@ async function resolveRequestedFile(server, pathname) {
9476
9576
  id = id.slice("/@id/".length).replace(/^__x00__/, "\0");
9477
9577
  if (id.startsWith("\0")) return void 0;
9478
9578
  }
9479
- const resolved = await _optionalChain([server, 'access', _455 => _455.environments, 'optionalAccess', _456 => _456.client, 'optionalAccess', _457 => _457.pluginContainer, 'access', _458 => _458.resolveId, 'call', _459 => _459(id, void 0)]);
9480
- const resolvedId = _optionalChain([resolved, 'optionalAccess', _460 => _460.id, 'access', _461 => _461.replace, 'call', _462 => _462(/[?#].*$/, "")]);
9579
+ const resolved = await _optionalChain([server, 'access', _461 => _461.environments, 'optionalAccess', _462 => _462.client, 'optionalAccess', _463 => _463.pluginContainer, 'access', _464 => _464.resolveId, 'call', _465 => _465(id, void 0)]);
9580
+ const resolvedId = _optionalChain([resolved, 'optionalAccess', _466 => _466.id, 'access', _467 => _467.replace, 'call', _468 => _468(/[?#].*$/, "")]);
9481
9581
  if (resolvedId && path16.isAbsolute(resolvedId)) candidate = resolvedId;
9482
- else if (_optionalChain([resolvedId, 'optionalAccess', _463 => _463.startsWith, 'call', _464 => _464("\0")])) return void 0;
9582
+ else if (_optionalChain([resolvedId, 'optionalAccess', _469 => _469.startsWith, 'call', _470 => _470("\0")])) return void 0;
9483
9583
  else if (id.startsWith("/")) candidate = path16.join(server.config.root, id);
9484
9584
  }
9485
9585
  if (!candidate) return void 0;
@@ -9516,7 +9616,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isInside, "isInside");
9516
9616
  function shouldBypassFarmRouterForDottedPath(pathname, routeManager, baseDirs, generatedPaths = []) {
9517
9617
  if (!pathname.includes(".") || pathname.endsWith(".html")) return false;
9518
9618
  const matchesAppRoute = Boolean(
9519
- _optionalChain([routeManager, 'optionalAccess', _465 => _465.matchRoute, 'call', _466 => _466(pathname), 'optionalAccess', _467 => _467.route]) || _optionalChain([routeManager, 'optionalAccess', _468 => _468.matchMetadataRoute, 'call', _469 => _469(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _470 => _470.matchMetadataImage, 'call', _471 => _471(pathname)]) || generatedPaths.includes(pathname)
9619
+ _optionalChain([routeManager, 'optionalAccess', _471 => _471.matchRoute, 'call', _472 => _472(pathname), 'optionalAccess', _473 => _473.route]) || _optionalChain([routeManager, 'optionalAccess', _474 => _474.matchMetadataRoute, 'call', _475 => _475(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _476 => _476.matchMetadataImage, 'call', _477 => _477(pathname)]) || generatedPaths.includes(pathname)
9520
9620
  );
9521
9621
  return !matchesAppRoute || devServableFileExists(pathname, baseDirs);
9522
9622
  }
@@ -9545,7 +9645,7 @@ var DOCS_ENGINE_APP_OWNABLE_PATHS = /* @__PURE__ */ new Set([
9545
9645
  ]);
9546
9646
  function farmAppOwnsDocsEnginePath(pathname, options) {
9547
9647
  if (!DOCS_ENGINE_APP_OWNABLE_PATHS.has(pathname)) return false;
9548
- return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _472 => _472.routeManager, 'optionalAccess', _473 => _473.matchMetadataRoute, 'call', _474 => _474(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
9648
+ return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _478 => _478.routeManager, 'optionalAccess', _479 => _479.matchMetadataRoute, 'call', _480 => _480(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
9549
9649
  }
9550
9650
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmAppOwnsDocsEnginePath, "farmAppOwnsDocsEnginePath");
9551
9651
  function devServableFileExists(pathname, baseDirs) {
@@ -9652,14 +9752,14 @@ function analyzeClientBoundary(program, publicKeys) {
9652
9752
  _chunkS3JO3N4Hcjs.__name.call(void 0, analyzeClientBoundary, "analyzeClientBoundary");
9653
9753
  function readNodeBuiltinSource(node) {
9654
9754
  if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ImportExpression") {
9655
- const value = _optionalChain([node, 'access', _475 => _475.source, 'optionalAccess', _476 => _476.value]);
9755
+ const value = _optionalChain([node, 'access', _481 => _481.source, 'optionalAccess', _482 => _482.value]);
9656
9756
  return typeof value === "string" && value.startsWith("node:") ? value : void 0;
9657
9757
  }
9658
9758
  if (node.type === "CallExpression") {
9659
9759
  const callee = node.callee;
9660
- if (_optionalChain([callee, 'optionalAccess', _477 => _477.type]) === "Identifier" && callee.name === "require") {
9661
- const arg = _optionalChain([node, 'access', _478 => _478.arguments, 'optionalAccess', _479 => _479[0]]);
9662
- const value = _optionalChain([arg, 'optionalAccess', _480 => _480.type]) === "Literal" ? arg.value : void 0;
9760
+ if (_optionalChain([callee, 'optionalAccess', _483 => _483.type]) === "Identifier" && callee.name === "require") {
9761
+ const arg = _optionalChain([node, 'access', _484 => _484.arguments, 'optionalAccess', _485 => _485[0]]);
9762
+ const value = _optionalChain([arg, 'optionalAccess', _486 => _486.type]) === "Literal" ? arg.value : void 0;
9663
9763
  return typeof value === "string" && value.startsWith("node:") ? value : void 0;
9664
9764
  }
9665
9765
  }
@@ -9669,7 +9769,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, readNodeBuiltinSource, "readNodeBuiltinSou
9669
9769
  function readProcessEnvKey(node) {
9670
9770
  if (node.type !== "MemberExpression") return void 0;
9671
9771
  const object = node.object;
9672
- if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _481 => _481.object, 'optionalAccess', _482 => _482.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _483 => _483.property, 'optionalAccess', _484 => _484.name]) !== "env") {
9772
+ if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _487 => _487.object, 'optionalAccess', _488 => _488.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _489 => _489.property, 'optionalAccess', _490 => _490.name]) !== "env") {
9673
9773
  return void 0;
9674
9774
  }
9675
9775
  const property2 = node.property;
@@ -9734,7 +9834,7 @@ function farmImageImportsPlugin() {
9734
9834
  async transform(code, id) {
9735
9835
  const filePath = id.split("?", 1)[0];
9736
9836
  if (id.includes("?") || !STATIC_IMAGE_RE.test(filePath)) return null;
9737
- const defaultExport = _optionalChain([code, 'access', _485 => _485.match, 'call', _486 => _486(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _487 => _487[1]]);
9837
+ const defaultExport = _optionalChain([code, 'access', _491 => _491.match, 'call', _492 => _492(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _493 => _493[1]]);
9738
9838
  if (!defaultExport) return null;
9739
9839
  return createStaticImageModule(filePath, `const src = ${defaultExport};`);
9740
9840
  }
@@ -9795,7 +9895,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
9795
9895
  ];
9796
9896
  function getFarmClientOptimizeDepsInclude(renderer) {
9797
9897
  return Array.from(
9798
- /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _488 => _488.optimizeDeps]) || []])
9898
+ /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _494 => _494.optimizeDeps]) || []])
9799
9899
  );
9800
9900
  }
9801
9901
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmClientOptimizeDepsInclude, "getFarmClientOptimizeDepsInclude");
@@ -9820,7 +9920,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
9820
9920
  // Farm's HTML boots through a virtual module and imports route UI lazily.
9821
9921
  // Explicit entries let Vite finish that crawl before a navigation can
9822
9922
  // rotate the optimizer hash underneath a hydrated React runtime.
9823
- ..._optionalChain([entries, 'optionalAccess', _489 => _489.length]) ? { entries: [...entries] } : {}
9923
+ ..._optionalChain([entries, 'optionalAccess', _495 => _495.length]) ? { entries: [...entries] } : {}
9824
9924
  };
9825
9925
  }
9826
9926
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmClientOptimizeDepsConfig, "createFarmClientOptimizeDepsConfig");
@@ -9850,8 +9950,8 @@ function mergeAlias(farmValue, userValue) {
9850
9950
  }
9851
9951
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeAlias, "mergeAlias");
9852
9952
  function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9853
- const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _490 => _490.optimizeDeps, 'optionalAccess', _491 => _491.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _492 => _492.optimizeDeps, 'optionalAccess', _493 => _493.noDiscovery])));
9854
- const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _494 => _494.optimizeDeps, 'optionalAccess', _495 => _495.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _496 => _496.optimizeDeps, 'optionalAccess', _497 => _497.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _498 => _498.optimizeDeps, 'optionalAccess', _499 => _499.holdUntilCrawlEnd]))));
9953
+ const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _496 => _496.optimizeDeps, 'optionalAccess', _497 => _497.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _498 => _498.optimizeDeps, 'optionalAccess', _499 => _499.noDiscovery])));
9954
+ const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _500 => _500.optimizeDeps, 'optionalAccess', _501 => _501.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _502 => _502.optimizeDeps, 'optionalAccess', _503 => _503.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _504 => _504.optimizeDeps, 'optionalAccess', _505 => _505.holdUntilCrawlEnd]))));
9855
9955
  return {
9856
9956
  ...farmConfig,
9857
9957
  ...userConfig,
@@ -9863,9 +9963,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9863
9963
  resolve: {
9864
9964
  ...farmConfig.resolve,
9865
9965
  ...userConfig.resolve,
9866
- alias: mergeAlias(_optionalChain([farmConfig, 'access', _500 => _500.resolve, 'optionalAccess', _501 => _501.alias]), _optionalChain([userConfig, 'access', _502 => _502.resolve, 'optionalAccess', _503 => _503.alias])),
9966
+ alias: mergeAlias(_optionalChain([farmConfig, 'access', _506 => _506.resolve, 'optionalAccess', _507 => _507.alias]), _optionalChain([userConfig, 'access', _508 => _508.resolve, 'optionalAccess', _509 => _509.alias])),
9867
9967
  dedupe: Array.from(
9868
- /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _504 => _504.resolve, 'optionalAccess', _505 => _505.dedupe]) || [], ..._optionalChain([userConfig, 'access', _506 => _506.resolve, 'optionalAccess', _507 => _507.dedupe]) || []])
9968
+ /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _510 => _510.resolve, 'optionalAccess', _511 => _511.dedupe]) || [], ..._optionalChain([userConfig, 'access', _512 => _512.resolve, 'optionalAccess', _513 => _513.dedupe]) || []])
9869
9969
  )
9870
9970
  },
9871
9971
  optimizeDeps: {
@@ -9875,21 +9975,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9875
9975
  holdUntilCrawlEnd,
9876
9976
  include: Array.from(
9877
9977
  /* @__PURE__ */ new Set([
9878
- ..._optionalChain([farmConfig, 'access', _508 => _508.optimizeDeps, 'optionalAccess', _509 => _509.include]) || [],
9879
- ..._optionalChain([userConfig, 'access', _510 => _510.optimizeDeps, 'optionalAccess', _511 => _511.include]) || []
9978
+ ..._optionalChain([farmConfig, 'access', _514 => _514.optimizeDeps, 'optionalAccess', _515 => _515.include]) || [],
9979
+ ..._optionalChain([userConfig, 'access', _516 => _516.optimizeDeps, 'optionalAccess', _517 => _517.include]) || []
9880
9980
  ])
9881
9981
  ),
9882
9982
  exclude: Array.from(
9883
9983
  /* @__PURE__ */ new Set([
9884
- ..._optionalChain([farmConfig, 'access', _512 => _512.optimizeDeps, 'optionalAccess', _513 => _513.exclude]) || [],
9885
- ..._optionalChain([userConfig, 'access', _514 => _514.optimizeDeps, 'optionalAccess', _515 => _515.exclude]) || []
9984
+ ..._optionalChain([farmConfig, 'access', _518 => _518.optimizeDeps, 'optionalAccess', _519 => _519.exclude]) || [],
9985
+ ..._optionalChain([userConfig, 'access', _520 => _520.optimizeDeps, 'optionalAccess', _521 => _521.exclude]) || []
9886
9986
  ])
9887
9987
  )
9888
9988
  },
9889
9989
  ssr: {
9890
9990
  ...farmConfig.ssr,
9891
9991
  ...userConfig.ssr,
9892
- noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _516 => _516.ssr, 'optionalAccess', _517 => _517.noExternal]), _optionalChain([userConfig, 'access', _518 => _518.ssr, 'optionalAccess', _519 => _519.noExternal]))
9992
+ noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _522 => _522.ssr, 'optionalAccess', _523 => _523.noExternal]), _optionalChain([userConfig, 'access', _524 => _524.ssr, 'optionalAccess', _525 => _525.noExternal]))
9893
9993
  }
9894
9994
  };
9895
9995
  }
@@ -9943,7 +10043,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
9943
10043
  ...farmConfig.build,
9944
10044
  rollupOptions: {
9945
10045
  ...userBundlerOptions,
9946
- ..._optionalChain([farmConfig, 'access', _520 => _520.build, 'optionalAccess', _521 => _521.rollupOptions])
10046
+ ..._optionalChain([farmConfig, 'access', _526 => _526.build, 'optionalAccess', _527 => _527.rollupOptions])
9947
10047
  }
9948
10048
  },
9949
10049
  css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
@@ -9951,7 +10051,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
9951
10051
  esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
9952
10052
  ssr: {
9953
10053
  ...merged.ssr,
9954
- external: mergeExternal(_optionalChain([farmConfig, 'access', _522 => _522.ssr, 'optionalAccess', _523 => _523.external]), _optionalChain([userConfig, 'access', _524 => _524.ssr, 'optionalAccess', _525 => _525.external]))
10054
+ external: mergeExternal(_optionalChain([farmConfig, 'access', _528 => _528.ssr, 'optionalAccess', _529 => _529.external]), _optionalChain([userConfig, 'access', _530 => _530.ssr, 'optionalAccess', _531 => _531.external]))
9955
10055
  }
9956
10056
  };
9957
10057
  }
@@ -9988,8 +10088,8 @@ function redactFarmDocsClientConfig(code, filename) {
9988
10088
  const current = node;
9989
10089
  if (current.type === "Property") {
9990
10090
  const name = propertyKeyName(current);
9991
- const valueType = _optionalChain([current, 'access', _526 => _526.value, 'optionalAccess', _527 => _527.type]);
9992
- const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkHITLGIAOcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
10091
+ const valueType = _optionalChain([current, 'access', _532 => _532.value, 'optionalAccess', _533 => _533.type]);
10092
+ const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkCY2ZQ5C6cjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
9993
10093
  if (name && credential) {
9994
10094
  edits.push(
9995
10095
  current.shorthand || current.method || current.kind !== "init" ? { start: current.start, end: current.end, text: `${JSON.stringify(name)}: undefined` } : {
@@ -10030,7 +10130,7 @@ function farmDocsClientConfigPlugin(configModule) {
10030
10130
  name: "farm:docs-client-config",
10031
10131
  enforce: "pre",
10032
10132
  transform(code, id, options) {
10033
- if (_optionalChain([options, 'optionalAccess', _528 => _528.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
10133
+ if (_optionalChain([options, 'optionalAccess', _534 => _534.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
10034
10134
  const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
10035
10135
  return redacted === null ? null : { code: redacted, map: null };
10036
10136
  }
@@ -10105,14 +10205,14 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
10105
10205
  // src/vite.ts
10106
10206
  var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
10107
10207
  function farmLlmsTxtGeneratedPaths(config) {
10108
- const llms = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _529 => _529.agent, 'optionalAccess', _530 => _530.llmsTxt]));
10208
+ const llms = _chunkWEW2JVA4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _535 => _535.agent, 'optionalAccess', _536 => _536.llmsTxt]));
10109
10209
  if (!llms.enabled) return [];
10110
10210
  return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
10111
10211
  }
10112
10212
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
10113
10213
  function farmAgentGeneratedPaths(config) {
10114
- const crawlers = _chunkMRMI32SNcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _531 => _531.agent, 'optionalAccess', _532 => _532.crawlers]));
10115
- const sitemap = _chunkMRMI32SNcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _533 => _533.agent, 'optionalAccess', _534 => _534.sitemap]));
10214
+ const crawlers = _chunkQTXBII4Zcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _537 => _537.agent, 'optionalAccess', _538 => _538.crawlers]));
10215
+ const sitemap = _chunkQTXBII4Zcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _539 => _539.agent, 'optionalAccess', _540 => _540.sitemap]));
10116
10216
  return [
10117
10217
  ...farmLlmsTxtGeneratedPaths(config),
10118
10218
  ...sitemap.enabled ? ["/sitemap.xml"] : [],
@@ -10162,7 +10262,7 @@ function loadFarmWorkflowsDevRuntime() {
10162
10262
  }
10163
10263
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
10164
10264
  function loadFarmDevtoolsSnapshotRuntime() {
10165
- return import("./devtools-JZJJY5CK.cjs");
10265
+ return import("./devtools-VQWJANJV.cjs");
10166
10266
  }
10167
10267
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
10168
10268
  function loadFarmDevtoolsUIRuntime() {
@@ -10178,7 +10278,7 @@ function farmI18nClientBridgePlugin() {
10178
10278
  name: "farm:i18n-client-bridge",
10179
10279
  enforce: "pre",
10180
10280
  resolveId(id, _importer, options) {
10181
- if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _535 => _535.ssr])) {
10281
+ if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _541 => _541.ssr])) {
10182
10282
  return FARM_I18N_CLIENT_BRIDGE_ID;
10183
10283
  }
10184
10284
  return null;
@@ -10203,7 +10303,7 @@ function farmServerOnlyEntriesPlugin() {
10203
10303
  resolveId(id, importer, options) {
10204
10304
  if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
10205
10305
  const importedBy = importer ? ` (imported by ${importer})` : "";
10206
- if (!_optionalChain([options, 'optionalAccess', _536 => _536.ssr])) {
10306
+ if (!_optionalChain([options, 'optionalAccess', _542 => _542.ssr])) {
10207
10307
  this.error(
10208
10308
  `${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
10209
10309
  );
@@ -10249,11 +10349,11 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
10249
10349
  if (!snapshot) return "";
10250
10350
  const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
10251
10351
  if (snapshot.routing === "none") return runtime;
10252
- return `${_chunkADEA7PN3cjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
10352
+ return `${_chunk2DD4JMQCcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
10253
10353
  }
10254
10354
  _chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
10255
10355
  function getPublicEnvDefine(config) {
10256
- const publicEnv = _optionalChain([config, 'access', _537 => _537.env, 'optionalAccess', _538 => _538.public]);
10356
+ const publicEnv = _optionalChain([config, 'access', _543 => _543.env, 'optionalAccess', _544 => _544.public]);
10257
10357
  if (!isResolvedEnvScope(publicEnv)) {
10258
10358
  return {};
10259
10359
  }
@@ -10276,7 +10376,7 @@ function createRequestFromNodeRequest(req, url, signal) {
10276
10376
  });
10277
10377
  }
10278
10378
  _chunkS3JO3N4Hcjs.__name.call(void 0, createRequestFromNodeRequest, "createRequestFromNodeRequest");
10279
- function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2) => _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, request2)) {
10379
+ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2) => _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, request2)) {
10280
10380
  const middleware = _chunkMQ3H6LT5cjs._withAfterNodeMiddleware.call(void 0, handler);
10281
10381
  return (req, res, next) => {
10282
10382
  const traceUrl = resolveTraceUrl(req);
@@ -10294,7 +10394,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2
10294
10394
  return;
10295
10395
  }
10296
10396
  if (res.headersSent) {
10297
- _optionalChain([res, 'access', _539 => _539.destroy, 'optionalCall', _540 => _540(error instanceof Error ? error : new Error(String(error)))]);
10397
+ _optionalChain([res, 'access', _545 => _545.destroy, 'optionalCall', _546 => _546(error instanceof Error ? error : new Error(String(error)))]);
10298
10398
  return;
10299
10399
  }
10300
10400
  res.statusCode = 500;
@@ -10393,7 +10493,7 @@ function interceptFarmDevPageResponse(options) {
10393
10493
  const originalWrite = res.write.bind(res);
10394
10494
  const originalEnd = res.end.bind(res);
10395
10495
  const originalWriteHead = res.writeHead.bind(res);
10396
- const originalFlushHeaders = _optionalChain([res, 'access', _541 => _541.flushHeaders, 'optionalAccess', _542 => _542.bind, 'call', _543 => _543(res)]);
10496
+ const originalFlushHeaders = _optionalChain([res, 'access', _547 => _547.flushHeaders, 'optionalAccess', _548 => _548.bind, 'call', _549 => _549(res)]);
10397
10497
  let afterResponseCalled = false;
10398
10498
  let interceptedEnd = false;
10399
10499
  const htmlChunks = [];
@@ -10433,7 +10533,7 @@ function interceptFarmDevPageResponse(options) {
10433
10533
  const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
10434
10534
  if (shouldBufferResponse) {
10435
10535
  const callback = args.find((arg) => typeof arg === "function");
10436
- _optionalChain([callback, 'optionalCall', _544 => _544()]);
10536
+ _optionalChain([callback, 'optionalCall', _550 => _550()]);
10437
10537
  return true;
10438
10538
  }
10439
10539
  const writeResult = originalWrite(chunk, ...args);
@@ -10548,14 +10648,14 @@ function getEnvDefines(config, configEnv) {
10548
10648
  _chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images))
10549
10649
  )
10550
10650
  };
10551
- if (_optionalChain([configEnv, 'optionalAccess', _545 => _545.isSsrBuild])) {
10651
+ if (_optionalChain([configEnv, 'optionalAccess', _551 => _551.isSsrBuild])) {
10552
10652
  defines.__FARM_ENV__ = JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
10553
10653
  }
10554
10654
  return defines;
10555
10655
  }
10556
10656
  _chunkS3JO3N4Hcjs.__name.call(void 0, getEnvDefines, "getEnvDefines");
10557
10657
  function getFarmAPIBaseURLDefine(config) {
10558
- const baseURL = _optionalChain([config, 'access', _546 => _546.api, 'optionalAccess', _547 => _547.baseURL]);
10658
+ const baseURL = _optionalChain([config, 'access', _552 => _552.api, 'optionalAccess', _553 => _553.baseURL]);
10559
10659
  return typeof baseURL === "string" && baseURL ? baseURL : _chunkS3A45T7Fcjs.DEFAULT_FARM_API_BASE_PATH;
10560
10660
  }
10561
10661
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAPIBaseURLDefine, "getFarmAPIBaseURLDefine");
@@ -10645,9 +10745,9 @@ function transformIsolatedClientBoundaryModule(options) {
10645
10745
  transformedExports++;
10646
10746
  }, "addWrapper");
10647
10747
  for (const node of body) {
10648
- if (_optionalChain([node, 'optionalAccess', _548 => _548.type]) === "ExportDefaultDeclaration" && node.declaration) {
10748
+ if (_optionalChain([node, 'optionalAccess', _554 => _554.type]) === "ExportDefaultDeclaration" && node.declaration) {
10649
10749
  const declaration2 = node.declaration;
10650
- if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _549 => _549.id, 'optionalAccess', _550 => _550.name])) {
10750
+ if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _555 => _555.id, 'optionalAccess', _556 => _556.name])) {
10651
10751
  replacements.push({
10652
10752
  start: node.start,
10653
10753
  end: node.end,
@@ -10665,14 +10765,14 @@ function transformIsolatedClientBoundaryModule(options) {
10665
10765
  }
10666
10766
  continue;
10667
10767
  }
10668
- if (_optionalChain([node, 'optionalAccess', _551 => _551.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
10768
+ if (_optionalChain([node, 'optionalAccess', _557 => _557.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
10669
10769
  const declaration = node.declaration;
10670
10770
  const declaredNames = [];
10671
- if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _552 => _552.id, 'optionalAccess', _553 => _553.name])) {
10771
+ if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _558 => _558.id, 'optionalAccess', _559 => _559.name])) {
10672
10772
  declaredNames.push(declaration.id.name);
10673
10773
  } else if (declaration.type === "VariableDeclaration") {
10674
10774
  for (const declarator of declaration.declarations || []) {
10675
- if (_optionalChain([declarator, 'access', _554 => _554.id, 'optionalAccess', _555 => _555.type]) === "Identifier") declaredNames.push(declarator.id.name);
10775
+ if (_optionalChain([declarator, 'access', _560 => _560.id, 'optionalAccess', _561 => _561.type]) === "Identifier") declaredNames.push(declarator.id.name);
10676
10776
  }
10677
10777
  }
10678
10778
  const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
@@ -10736,7 +10836,7 @@ function warnClientBoundaryOnce(context, id, code, config) {
10736
10836
  } catch (e38) {
10737
10837
  return;
10738
10838
  }
10739
- const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _556 => _556.env, 'optionalAccess', _557 => _557.public]), () => ( {}))));
10839
+ const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _562 => _562.env, 'optionalAccess', _563 => _563.public]), () => ( {}))));
10740
10840
  const findings = analyzeClientBoundary(program, publicKeys);
10741
10841
  if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
10742
10842
  return;
@@ -10793,7 +10893,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10793
10893
  config(userConfig, configEnv) {
10794
10894
  isBuild = configEnv.command === "build";
10795
10895
  const layerAliases = _chunkWBKEZXWEcjs.getFarmLayerAliases.call(void 0, options.layers);
10796
- const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _558 => _558.resolve, 'optionalAccess', _559 => _559.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
10896
+ const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _564 => _564.resolve, 'optionalAccess', _565 => _565.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
10797
10897
  const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
10798
10898
  return {
10799
10899
  // Honor Farm's publicDir so the dev server serves the same static
@@ -10809,7 +10909,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10809
10909
  server: {
10810
10910
  fs: {
10811
10911
  ...layerRoots.length ? { allow: [path21.resolve(options.root || process.cwd()), ...layerRoots] } : {},
10812
- deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _560 => _560.server, 'optionalAccess', _561 => _561.fs, 'optionalAccess', _562 => _562.deny]), options)
10912
+ deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _566 => _566.server, 'optionalAccess', _567 => _567.fs, 'optionalAccess', _568 => _568.deny]), options)
10813
10913
  }
10814
10914
  }
10815
10915
  };
@@ -10821,7 +10921,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10821
10921
  serverFnTransformActive = config.plugins.some(
10822
10922
  (plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
10823
10923
  );
10824
- if (_optionalChain([options, 'access', _563 => _563.experimental, 'optionalAccess', _564 => _564.serverActions]) === true && !serverFnTransformActive) {
10924
+ if (_optionalChain([options, 'access', _569 => _569.experimental, 'optionalAccess', _570 => _570.serverActions]) === true && !serverFnTransformActive) {
10825
10925
  _chunk5QIKR7RRcjs.logger.warn(
10826
10926
  "experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
10827
10927
  );
@@ -10830,7 +10930,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10830
10930
  async configureServer(viteServer) {
10831
10931
  viteServer.middlewares.use(
10832
10932
  createFarmDevPreviewGuard(viteServer, {
10833
- getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _565 => _565.getConfig, 'call', _566 => _566()]), () => ( options))), "getSourceRoots")
10933
+ getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _571 => _571.getConfig, 'call', _572 => _572()]), () => ( options))), "getSourceRoots")
10834
10934
  })
10835
10935
  );
10836
10936
  if (typeof fontImports.configureServer === "function") {
@@ -10855,10 +10955,10 @@ function farmPlugin(options = {}, initialPluginManager) {
10855
10955
  await farmApp.initialize();
10856
10956
  const farmConfig = farmApp.getConfig();
10857
10957
  let farmAppPackages;
10858
- if (_optionalChain([farmConfig, 'access', _567 => _567.agent, 'optionalAccess', _568 => _568.noindexPreviews])) {
10958
+ if (_optionalChain([farmConfig, 'access', _573 => _573.agent, 'optionalAccess', _574 => _574.noindexPreviews])) {
10859
10959
  server.middlewares.use((_req, res, next) => {
10860
10960
  if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
10861
- res.setHeader("X-Robots-Tag", _chunkMRMI32SNcjs.FARM_PREVIEW_ROBOTS_TAG);
10961
+ res.setHeader("X-Robots-Tag", _chunkQTXBII4Zcjs.FARM_PREVIEW_ROBOTS_TAG);
10862
10962
  }
10863
10963
  next();
10864
10964
  });
@@ -10875,7 +10975,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10875
10975
  validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
10876
10976
  // Vite owns this address. Unlike request.url, it cannot be replaced by
10877
10977
  // a caller-controlled Host header.
10878
- trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _569 => _569.resolvedUrls, 'optionalAccess', _570 => _570.local, 'access', _571 => _571[0]]), "trustedLocalOrigin"),
10978
+ trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _575 => _575.resolvedUrls, 'optionalAccess', _576 => _576.local, 'access', _577 => _577[0]]), "trustedLocalOrigin"),
10879
10979
  onError(error) {
10880
10980
  _chunk5QIKR7RRcjs.logger.error(
10881
10981
  `Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
@@ -10895,15 +10995,15 @@ function farmPlugin(options = {}, initialPluginManager) {
10895
10995
  const workflowConfig = farmConfig.workflows;
10896
10996
  const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
10897
10997
  const getExtraRouteTypes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => [
10898
- ..._optionalChain([options, 'access', _572 => _572.openapi, 'optionalAccess', _573 => _573.enabled]) && options.openapi.route ? [options.openapi.route] : [],
10899
- ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _574 => _574.getFarmDocsRouteTypeEntries, 'call', _575 => _575(farmConfig.docs)]), () => ( []))
10998
+ ..._optionalChain([options, 'access', _578 => _578.openapi, 'optionalAccess', _579 => _579.enabled]) && options.openapi.route ? [options.openapi.route] : [],
10999
+ ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _580 => _580.getFarmDocsRouteTypeEntries, 'call', _581 => _581(farmConfig.docs)]), () => ( []))
10900
11000
  ], "getExtraRouteTypes");
10901
11001
  const appDirSlugs = sourceRoots.map(
10902
11002
  (source) => path21.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
10903
11003
  );
10904
11004
  const generateTypeArtifacts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
10905
11005
  try {
10906
- const result = await _chunkJNUWCDTFcjs.generateFarmTypeArtifacts.call(void 0, {
11006
+ const result = await _chunk5D2JIPLHcjs.generateFarmTypeArtifacts.call(void 0, {
10907
11007
  root: farmConfig.root,
10908
11008
  srcDir: farmConfig.srcDir,
10909
11009
  layers: farmConfig.layers,
@@ -10943,7 +11043,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10943
11043
  (source) => path21.join(source.root, source.srcDir).replace(/\\/g, "/")
10944
11044
  );
10945
11045
  const layerConfigFiles = new Set(
10946
- farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _576 => _576.configFile, 'optionalAccess', _577 => _577.replace, 'call', _578 => _578(/\\/g, "/")])).filter((file) => Boolean(file))
11046
+ farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _582 => _582.configFile, 'optionalAccess', _583 => _583.replace, 'call', _584 => _584(/\\/g, "/")])).filter((file) => Boolean(file))
10947
11047
  );
10948
11048
  const routeModuleExtensions = /* @__PURE__ */ new Set([
10949
11049
  ..._chunkPSV6XKPOcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
@@ -11022,7 +11122,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11022
11122
  scheduleTypeArtifactGen(file, ev, typeArtifacts);
11023
11123
  }
11024
11124
  if (isI18nCatalogFile(file)) {
11025
- _optionalChain([farmApp, 'optionalAccess', _579 => _579.getI18nRuntime, 'call', _580 => _580(), 'access', _581 => _581.reload, 'call', _582 => _582(), 'access', _583 => _583.then, 'call', _584 => _584(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _585 => _585.catch, 'call', _586 => _586((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
11125
+ _optionalChain([farmApp, 'optionalAccess', _585 => _585.getI18nRuntime, 'call', _586 => _586(), 'access', _587 => _587.reload, 'call', _588 => _588(), 'access', _589 => _589.then, 'call', _590 => _590(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _591 => _591.catch, 'call', _592 => _592((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
11026
11126
  }
11027
11127
  const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile2(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
11028
11128
  if (isRouteRefreshEvent) {
@@ -11035,8 +11135,8 @@ function farmPlugin(options = {}, initialPluginManager) {
11035
11135
  const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
11036
11136
  pendingRouteRefreshIncludesMiddleware = false;
11037
11137
  Promise.all([
11038
- _optionalChain([refreshRouteDiscovery, 'optionalCall', _587 => _587(`${ev} ${file}`)]),
11039
- reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _588 => _588.reload, 'call', _589 => _589()]) : void 0
11138
+ _optionalChain([refreshRouteDiscovery, 'optionalCall', _593 => _593(`${ev} ${file}`)]),
11139
+ reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _594 => _594.reload, 'call', _595 => _595()]) : void 0
11040
11140
  ]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunk5QIKR7RRcjs.logger.warn(`Route refresh failed: ${error.message}`));
11041
11141
  }, 50);
11042
11142
  }
@@ -11070,7 +11170,8 @@ function farmPlugin(options = {}, initialPluginManager) {
11070
11170
  layoutCount: discoveredRoutes.filter((r) => r.kind === "layout").length
11071
11171
  });
11072
11172
  }
11073
- apiRouteManager = new (0, _chunkFO427P6Icjs.APIRouteManager)(appDirs, server, {
11173
+ const dispatchToDevServer = _chunkUXHS27O6cjs.createFarmDevServerDispatch.call(void 0, server);
11174
+ apiRouteManager = new (0, _chunkRWFLWR5Jcjs.APIRouteManager)(appDirs, server, {
11074
11175
  plugins: farmConfig.plugins,
11075
11176
  i18n: farmApp.getI18nRuntime(),
11076
11177
  bodySizeLimit: serverConfig.bodySizeLimit,
@@ -11080,7 +11181,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11080
11181
  dispatch: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (request2) => {
11081
11182
  const url = new URL(request2.url);
11082
11183
  url.pathname = _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, url.pathname, farmConfig.basePath);
11083
- return fetch(new Request(url, request2), { redirect: "manual" });
11184
+ return dispatchToDevServer(new Request(url, request2));
11084
11185
  }, "dispatch")
11085
11186
  });
11086
11187
  await apiRouteManager.discoverRoutes();
@@ -11116,7 +11217,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11116
11217
  });
11117
11218
  }
11118
11219
  }
11119
- middlewareManager = new (0, _chunkZWM5KGAAcjs.MiddlewareManager)(
11220
+ middlewareManager = new (0, _chunkKCQBAKIYcjs.MiddlewareManager)(
11120
11221
  appDirs,
11121
11222
  server,
11122
11223
  farmConfig.middleware,
@@ -11125,6 +11226,9 @@ function farmPlugin(options = {}, initialPluginManager) {
11125
11226
  apiServerBasePath
11126
11227
  );
11127
11228
  await middlewareManager.discover();
11229
+ farmApp.getServerRenderer().setMiddlewareRouteLookup(
11230
+ () => middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
11231
+ );
11128
11232
  if (pm) {
11129
11233
  for (const middleware of middlewareManager.getMiddlewares()) {
11130
11234
  await pm.runHookParallel("middlewareDiscovered", {
@@ -11134,11 +11238,11 @@ function farmPlugin(options = {}, initialPluginManager) {
11134
11238
  });
11135
11239
  }
11136
11240
  }
11137
- if (_optionalChain([options, 'access', _590 => _590.openapi, 'optionalAccess', _591 => _591.enabled])) {
11241
+ if (_optionalChain([options, 'access', _596 => _596.openapi, 'optionalAccess', _597 => _597.enabled])) {
11138
11242
  const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
11139
11243
  openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
11140
11244
  mode: "development",
11141
- apiBaseURL: typeof _optionalChain([options, 'access', _592 => _592.api, 'optionalAccess', _593 => _593.baseURL]) === "string" ? options.api.baseURL : void 0
11245
+ apiBaseURL: typeof _optionalChain([options, 'access', _598 => _598.api, 'optionalAccess', _599 => _599.baseURL]) === "string" ? options.api.baseURL : void 0
11142
11246
  });
11143
11247
  const spec = await openAPIManager.generateSpec();
11144
11248
  reportOpenAPIDevGenerationResult(spec);
@@ -11166,6 +11270,13 @@ function farmPlugin(options = {}, initialPluginManager) {
11166
11270
  return _chunkAMDMVWMIcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
11167
11271
  }, "resolveDocsLayoutFonts");
11168
11272
  releaseDocsMCPServers();
11273
+ const isFarmDocsPathGuarded = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (href) => _chunk2DD4JMQCcjs.farmPathGuardCoversPage.call(void 0,
11274
+ {
11275
+ config: farmConfig,
11276
+ middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
11277
+ },
11278
+ href
11279
+ ), "isFarmDocsPathGuarded");
11169
11280
  const farmDocsHandler = farmDocsDevRuntime ? farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs) ? await farmDocsDevRuntime.createFarmDocsAdapterHandler(farmConfig.docs, {
11170
11281
  root: farmConfig.root,
11171
11282
  srcDir: farmConfig.srcDir,
@@ -11178,13 +11289,13 @@ function farmPlugin(options = {}, initialPluginManager) {
11178
11289
  ),
11179
11290
  loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (specifier) => {
11180
11291
  const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
11181
- if (specifier === _optionalChain([farmConfig, 'access', _594 => _594.docs, 'access', _595 => _595.adapter, 'optionalAccess', _596 => _596.server]) && _optionalChain([resolved, 'optionalAccess', _597 => _597.id])) {
11292
+ if (specifier === _optionalChain([farmConfig, 'access', _600 => _600.docs, 'access', _601 => _601.adapter, 'optionalAccess', _602 => _602.server]) && _optionalChain([resolved, 'optionalAccess', _603 => _603.id])) {
11182
11293
  return import(
11183
11294
  /* @vite-ignore */
11184
11295
  _url.pathToFileURL.call(void 0, resolved.id).href
11185
11296
  );
11186
11297
  }
11187
- return _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _598 => _598.id]), () => ( specifier)));
11298
+ return _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _604 => _604.id]), () => ( specifier)));
11188
11299
  }, "loadModule"),
11189
11300
  registerMCPServer: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (mcpServer) => {
11190
11301
  const dispose = _chunk75RZHGLScjs.registerFarmMCPServer.call(void 0, mcpServer);
@@ -11193,7 +11304,8 @@ function farmPlugin(options = {}, initialPluginManager) {
11193
11304
  docsMCPServerDisposers.delete(dispose);
11194
11305
  dispose();
11195
11306
  };
11196
- }, "registerMCPServer")
11307
+ }, "registerMCPServer"),
11308
+ isPathGuarded: isFarmDocsPathGuarded
11197
11309
  }) : farmDocsDevRuntime.createFarmDocsHandler(farmConfig.docs, {
11198
11310
  root: farmConfig.root,
11199
11311
  srcDir: farmConfig.srcDir,
@@ -11204,10 +11316,11 @@ function farmPlugin(options = {}, initialPluginManager) {
11204
11316
  globalStylesheetHref: resolveDevGlobalStylesheetHref(
11205
11317
  farmConfig.root,
11206
11318
  farmConfig.srcDir
11207
- )
11319
+ ),
11320
+ isPathGuarded: isFarmDocsPathGuarded
11208
11321
  }) : null;
11209
11322
  const wrapFarmDocsResponseWithLayouts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2, response) => {
11210
- if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _599 => _599.headers, 'access', _600 => _600.get, 'call', _601 => _601("content-type"), 'optionalAccess', _602 => _602.toLowerCase, 'call', _603 => _603(), 'access', _604 => _604.includes, 'call', _605 => _605("text/html")])) {
11323
+ if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _605 => _605.headers, 'access', _606 => _606.get, 'call', _607 => _607("content-type"), 'optionalAccess', _608 => _608.toLowerCase, 'call', _609 => _609(), 'access', _610 => _610.includes, 'call', _611 => _611("text/html")])) {
11211
11324
  return response;
11212
11325
  }
11213
11326
  const pathname = new URL(request2.url).pathname;
@@ -11228,7 +11341,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11228
11341
  headers: response.headers
11229
11342
  });
11230
11343
  }
11231
- const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _606 => _606.getConfig, 'call', _607 => _607()]), () => ( options))).renderer);
11344
+ const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _612 => _612.getConfig, 'call', _613 => _613()]), () => ( options))).renderer);
11232
11345
  const [rendererRuntime, layoutModules] = await Promise.all([
11233
11346
  _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
11234
11347
  Promise.all(
@@ -11257,7 +11370,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11257
11370
  ])
11258
11371
  );
11259
11372
  const inlineValue = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e"), "inlineValue");
11260
- const pageModulePath = _optionalChain([matchedRoute, 'access', _608 => _608.route, 'optionalAccess', _609 => _609.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
11373
+ const pageModulePath = _optionalChain([matchedRoute, 'access', _614 => _614.route, 'optionalAccess', _615 => _615.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
11261
11374
  const bootstrapScript = `<script>
11262
11375
  window.__FARM_PROPS__ = ${inlineValue({ params })};
11263
11376
  window.__FARM_ROUTE_SLOTS__ = [];
@@ -11312,7 +11425,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11312
11425
  rootDir: farmConfig.root,
11313
11426
  srcDir: farmConfig.srcDir,
11314
11427
  docs: farmConfig.docs,
11315
- diagnostics: true
11428
+ diagnostics: true,
11429
+ isPathGuarded: isFarmDocsPathGuarded
11316
11430
  }) : null;
11317
11431
  const farmDocsFontAssets = new Map(
11318
11432
  farmDocsFontAssetList.map(({ url, sourcePath }) => [url, sourcePath])
@@ -11352,9 +11466,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11352
11466
  }, "dispatch")
11353
11467
  },
11354
11468
  (request2) => {
11355
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _610 => _610.getConfig, 'call', _611 => _611()]), () => ( options));
11469
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _616 => _616.getConfig, 'call', _617 => _617()]), () => ( options));
11356
11470
  const currentServerConfig = _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
11357
- return _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, request2, {
11471
+ return _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, request2, {
11358
11472
  trustProxy: currentServerConfig.trustProxy
11359
11473
  });
11360
11474
  }
@@ -11363,9 +11477,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11363
11477
  withAPIRequestTracing(async (req, res, next) => {
11364
11478
  const requestUrl = req.url || "/";
11365
11479
  const requestMethod = req.method || "GET";
11366
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _612 => _612.getConfig, 'call', _613 => _613()]), () => ( options));
11480
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _618 => _618.getConfig, 'call', _619 => _619()]), () => ( options));
11367
11481
  const currentServerConfig = _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
11368
- const parsedRequestUrl = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
11482
+ const parsedRequestUrl = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
11369
11483
  trustProxy: currentServerConfig.trustProxy
11370
11484
  });
11371
11485
  const fullUrl = parsedRequestUrl.toString();
@@ -11431,7 +11545,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11431
11545
  openapi: options.openapi
11432
11546
  },
11433
11547
  workflows: discoveredWorkflows,
11434
- plugins: _optionalChain([pm, 'optionalAccess', _614 => _614.getSortedPlugins, 'call', _615 => _615()])
11548
+ plugins: _optionalChain([pm, 'optionalAccess', _620 => _620.getSortedPlugins, 'call', _621 => _621()])
11435
11549
  });
11436
11550
  res.statusCode = 200;
11437
11551
  res.setHeader(
@@ -11454,7 +11568,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11454
11568
  return;
11455
11569
  }
11456
11570
  const runAppMiddlewareForContentRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
11457
- if (!_optionalChain([middlewareManager, 'optionalAccess', _616 => _616.hasMiddleware, 'call', _617 => _617()])) return false;
11571
+ if (!_optionalChain([middlewareManager, 'optionalAccess', _622 => _622.hasMiddleware, 'call', _623 => _623()])) return false;
11458
11572
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
11459
11573
  return runFarmMiddlewareWithNavigation(
11460
11574
  farmApp.getServerRenderer(),
@@ -11465,7 +11579,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11465
11579
  );
11466
11580
  }, "runAppMiddlewareForContentRoute");
11467
11581
  const openAPIRequestPathname = openAPIManager ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
11468
- if (openAPIManager && _optionalChain([options, 'access', _618 => _618.openapi, 'optionalAccess', _619 => _619.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
11582
+ if (openAPIManager && _optionalChain([options, 'access', _624 => _624.openapi, 'optionalAccess', _625 => _625.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
11469
11583
  if (await runAppMiddlewareForContentRoute()) return;
11470
11584
  if (requestMethod !== "GET" && requestMethod !== "HEAD") {
11471
11585
  res.statusCode = 405;
@@ -11482,43 +11596,52 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11482
11596
  res.end(requestMethod === "HEAD" ? void 0 : body);
11483
11597
  return;
11484
11598
  }
11485
- if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _620 => _620.openapi, 'optionalAccess', _621 => _621.route])) {
11599
+ if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _626 => _626.openapi, 'optionalAccess', _627 => _627.route])) {
11486
11600
  if (await runAppMiddlewareForContentRoute()) return;
11487
11601
  const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
11488
11602
  return docsHandler(req, res);
11489
11603
  }
11490
- if (_optionalChain([options, 'access', _622 => _622.agent, 'optionalAccess', _623 => _623.manifest]) !== false && _chunkADEA7PN3cjs.isFarmAppManifestPath.call(void 0, _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
11604
+ if (_optionalChain([options, 'access', _628 => _628.agent, 'optionalAccess', _629 => _629.manifest]) !== false && _chunk2DD4JMQCcjs.isFarmAppManifestPath.call(void 0, _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
11491
11605
  if (await runAppMiddlewareForContentRoute()) return;
11492
11606
  _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = resolveFarmAppPackages(_nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
11493
11607
  const header = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (name) => String(_nullishCoalesce(req.headers[name], () => ( ""))), "header");
11494
- const manifest = await _chunkADEA7PN3cjs.createFarmAppManifestResponse.call(void 0,
11608
+ const manifest = await _chunk2DD4JMQCcjs.createFarmAppManifestResponse.call(void 0,
11495
11609
  new Request(parsedRequestUrl, {
11496
11610
  method: requestMethod,
11497
11611
  headers: {
11498
11612
  "if-none-match": header("if-none-match"),
11499
- [_chunkADEA7PN3cjs.FARM_INFRA_SIGNATURE_HEADER]: header(_chunkADEA7PN3cjs.FARM_INFRA_SIGNATURE_HEADER)
11613
+ [_chunk2DD4JMQCcjs.FARM_INFRA_SIGNATURE_HEADER]: header(_chunk2DD4JMQCcjs.FARM_INFRA_SIGNATURE_HEADER)
11500
11614
  }
11501
11615
  }),
11502
11616
  {
11503
- ..._chunkADEA7PN3cjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
11617
+ ..._chunk2DD4JMQCcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
11504
11618
  build: "development",
11505
11619
  packages: farmAppPackages,
11506
11620
  // Read again on each request; unchanged files come from a cache.
11507
- webmcpTools: _optionalChain([farmConfig, 'access', _624 => _624.plugins, 'optionalAccess', _625 => _625.some, 'call', _626 => _626(({ name }) => name === "farm:webmcp")]) ? collectFarmWebMCPTools(_nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
11621
+ webmcpTools: _optionalChain([farmConfig, 'access', _630 => _630.plugins, 'optionalAccess', _631 => _631.some, 'call', _632 => _632(({ name }) => name === "farm:webmcp")]) ? collectFarmWebMCPTools(_nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
11508
11622
  }),
11509
- defaultMCP: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => farmApp.getServerRenderer().getDefaultMCPServer(), "defaultMCP")
11623
+ defaultMCP: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => farmApp.getServerRenderer().getDefaultMCPServer(), "defaultMCP"),
11624
+ // A guard written for an MCP server's path keeps its tools out of the public view.
11625
+ guardCoversPath: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (path22) => _chunk2DD4JMQCcjs.farmPathGuardCoversEndpoint.call(void 0,
11626
+ {
11627
+ config: farmConfig,
11628
+ middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
11629
+ },
11630
+ path22,
11631
+ apiServerBasePath
11632
+ ), "guardCoversPath")
11510
11633
  }
11511
11634
  );
11512
11635
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, manifest);
11513
11636
  return;
11514
11637
  }
11515
- if (_optionalChain([options, 'access', _627 => _627.agent, 'optionalAccess', _628 => _628.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkADEA7PN3cjs.FARM_API_CATALOG_PATH) {
11638
+ if (_optionalChain([options, 'access', _633 => _633.agent, 'optionalAccess', _634 => _634.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunk2DD4JMQCcjs.FARM_API_CATALOG_PATH) {
11516
11639
  if (await runAppMiddlewareForContentRoute()) return;
11517
11640
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
11518
11641
  res,
11519
- _chunkADEA7PN3cjs.createFarmApiCatalogResponse.call(void 0,
11642
+ _chunk2DD4JMQCcjs.createFarmApiCatalogResponse.call(void 0,
11520
11643
  requestMethod,
11521
- _chunkADEA7PN3cjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
11644
+ _chunk2DD4JMQCcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
11522
11645
  new Request(parsedRequestUrl, {
11523
11646
  headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
11524
11647
  })
@@ -11526,8 +11649,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11526
11649
  );
11527
11650
  return;
11528
11651
  }
11529
- if (_optionalChain([options, 'access', _629 => _629.agent, 'optionalAccess', _630 => _630.aiCatalog]) !== false) {
11530
- const aiCatalog = _chunkADEA7PN3cjs.createFarmAiCatalogResponse.call(void 0,
11652
+ if (_optionalChain([options, 'access', _635 => _635.agent, 'optionalAccess', _636 => _636.aiCatalog]) !== false) {
11653
+ const aiCatalog = _chunk2DD4JMQCcjs.createFarmAiCatalogResponse.call(void 0,
11531
11654
  new Request(parsedRequestUrl, {
11532
11655
  method: requestMethod,
11533
11656
  headers: {
@@ -11575,7 +11698,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11575
11698
  return;
11576
11699
  }
11577
11700
  }
11578
- const markdownSourceResponse = viteModuleRequest ? null : await _chunk42NHY7HWcjs.createFarmMarkdownSourceResponse.call(void 0, {
11701
+ const markdownSourceResponse = viteModuleRequest ? null : await _chunkEKN7NSZOcjs.createFarmMarkdownSourceResponse.call(void 0, {
11579
11702
  request: new Request(fullUrl, {
11580
11703
  method: requestMethod,
11581
11704
  headers: docsHeaders
@@ -11583,7 +11706,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11583
11706
  config: farmApp.getConfig().mdx,
11584
11707
  resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
11585
11708
  const match = farmApp.getRouteManager().matchRoute(pathname2);
11586
- const sourcePath = _optionalChain([match, 'access', _631 => _631.route, 'optionalAccess', _632 => _632.markdownSourcePath]) || (match.route && _chunk42NHY7HWcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
11709
+ const sourcePath = _optionalChain([match, 'access', _637 => _637.route, 'optionalAccess', _638 => _638.markdownSourcePath]) || (match.route && _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
11587
11710
  if (!sourcePath) {
11588
11711
  return null;
11589
11712
  }
@@ -11593,32 +11716,41 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11593
11716
  };
11594
11717
  }, "resolveSource"),
11595
11718
  // The anonymous check goes through this server, so its guards and
11596
- // middleware see the page's own path, as in production.
11597
- renderPage: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => fetch(request2, {
11598
- redirect: "manual",
11599
- signal: res.destroyed ? AbortSignal.abort() : _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11600
- }), "renderPage")
11719
+ // middleware see the page's own path, as in production. It connects to
11720
+ // this server's own listener, never the host the caller's Host names.
11721
+ renderPage: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => _chunkUXHS27O6cjs.createFarmDevServerDispatch.call(void 0, server)(
11722
+ new Request(request2, {
11723
+ signal: res.destroyed ? AbortSignal.abort() : _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11724
+ })
11725
+ ), "renderPage")
11601
11726
  });
11602
11727
  if (markdownSourceResponse) {
11603
11728
  if (await runAppMiddlewareForContentRoute()) return;
11604
11729
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownSourceResponse);
11605
11730
  return;
11606
11731
  }
11607
- const markdownResponse = viteModuleRequest ? null : await _chunkEUV4YR3Vcjs.createMarkdownMirrorResponse.call(void 0, {
11732
+ const markdownResponse = viteModuleRequest ? null : await _chunkSGBJ247Qcjs.createMarkdownMirrorResponse.call(void 0, {
11608
11733
  request: new Request(fullUrl, {
11609
11734
  method: requestMethod,
11610
11735
  headers: docsHeaders
11611
11736
  }),
11612
11737
  config: farmApp.getConfig().md,
11613
11738
  routeExists: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pathname2) => Boolean(farmApp.getRouteManager().matchRoute(pathname2).route), "routeExists"),
11614
- // Keep the page's own redirect (a sign-in gate, say) so the mirror
11615
- // answers with it, as production does, instead of the target page.
11616
- renderPage: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => fetch(request2, {
11617
- redirect: "manual",
11618
- // Only accepted mirrors need disconnect listeners. An earlier
11619
- // close (for example while the docs handler ran) must also abort.
11620
- signal: res.destroyed ? AbortSignal.abort() : _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11621
- }), "renderPage"),
11739
+ // The page is rendered by this server's own listener, never the host the
11740
+ // caller's Host names. Redirects are not followed, so the mirror answers with
11741
+ // the page's own (a sign-in gate, say), as production does.
11742
+ renderPage: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => {
11743
+ const headers = new Headers(request2.headers);
11744
+ headers.delete("accept-encoding");
11745
+ return _chunkUXHS27O6cjs.createFarmDevServerDispatch.call(void 0, server)(
11746
+ new Request(request2, {
11747
+ headers,
11748
+ // Only accepted mirrors need disconnect listeners. An earlier
11749
+ // close (for example while the docs handler ran) must also abort.
11750
+ signal: res.destroyed ? AbortSignal.abort() : _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11751
+ })
11752
+ );
11753
+ }, "renderPage"),
11622
11754
  apiServerBasePath
11623
11755
  });
11624
11756
  if (markdownResponse) {
@@ -11626,21 +11758,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11626
11758
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownResponse);
11627
11759
  return;
11628
11760
  }
11629
- if (!viteModuleRequest && _chunkEUV4YR3Vcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
11630
- const markdownRoute = farmApp.getRouteManager().matchRoute(_chunk42NHY7HWcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
11761
+ if (!viteModuleRequest && _chunkSGBJ247Qcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
11762
+ const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkEKN7NSZOcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
11631
11763
  if (!markdownRoute.route) {
11632
11764
  if (await runAppMiddlewareForContentRoute()) return;
11633
11765
  res.statusCode = 404;
11634
- res.setHeader("Content-Type", _chunkEUV4YR3Vcjs.FARM_MARKDOWN_CONTENT_TYPE);
11766
+ res.setHeader("Content-Type", _chunkSGBJ247Qcjs.FARM_MARKDOWN_CONTENT_TYPE);
11635
11767
  res.setHeader("X-Farm-Markdown-Error", "404");
11636
11768
  res.setHeader("Cache-Control", "no-store");
11637
11769
  res.end(
11638
- _chunkEUV4YR3Vcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/")
11770
+ _chunkSGBJ247Qcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/")
11639
11771
  );
11640
11772
  return;
11641
11773
  }
11642
11774
  }
11643
- const markdownPageTarget = _chunkEUV4YR3Vcjs.resolveMarkdownMirrorTarget.call(void 0,
11775
+ const markdownPageTarget = _chunkSGBJ247Qcjs.resolveMarkdownMirrorTarget.call(void 0,
11644
11776
  farmApp.getConfig().md,
11645
11777
  requestPathname,
11646
11778
  {
@@ -11653,7 +11785,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11653
11785
  if (!varyValues.some((value) => value.toLowerCase() === "accept")) {
11654
11786
  res.setHeader("Vary", [...varyValues, "Accept"].join(", "));
11655
11787
  }
11656
- const alternatePath = _chunkEUV4YR3Vcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
11788
+ const alternatePath = _chunkSGBJ247Qcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
11657
11789
  const alternateLink = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
11658
11790
  const currentLink = res.getHeader("Link");
11659
11791
  res.setHeader(
@@ -11691,7 +11823,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11691
11823
  }
11692
11824
  const configuredIntegrations = currentConfig.integrations;
11693
11825
  const tryConfiguredIntegrationRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
11694
- const matchedRoute = _chunkCBJJH36Acjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
11826
+ const matchedRoute = _chunkVU6AAZVYcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
11695
11827
  pathname: requestPathname,
11696
11828
  method: requestMethod
11697
11829
  });
@@ -11704,8 +11836,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11704
11836
  await pm.runHookParallelFiltered(
11705
11837
  "beforeRequest",
11706
11838
  (plugin) => {
11707
- const owner = _chunkCBJJH36Acjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
11708
- return plugin.name !== _chunk27ZWSI3Wcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _633 => _633.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
11839
+ const owner = _chunkVU6AAZVYcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
11840
+ return plugin.name !== _chunkVXEEATVDcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _639 => _639.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
11709
11841
  },
11710
11842
  req,
11711
11843
  res
@@ -11733,7 +11865,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11733
11865
  signal: _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11734
11866
  });
11735
11867
  const dispatchIntegration = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => {
11736
- const result = await _chunkCBJJH36Acjs.dispatchIntegrationRequest.call(void 0,
11868
+ const result = await _chunkVU6AAZVYcjs.dispatchIntegrationRequest.call(void 0,
11737
11869
  {
11738
11870
  integration: matchedRoute.integration,
11739
11871
  config: currentConfig,
@@ -11796,11 +11928,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11796
11928
  }
11797
11929
  const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
11798
11930
  const hasMatchedApiRoute = Boolean(matchedApiRoute);
11799
- if (hasMatchedApiRoute || _chunkS6VYG6XUcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
11931
+ if (hasMatchedApiRoute || _chunkXKG2BLFNcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
11800
11932
  const startTime2 = Date.now();
11801
11933
  const method2 = req.method || "GET";
11802
11934
  const urlPath2 = req.url || "/";
11803
- const pathname2 = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
11935
+ const pathname2 = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
11804
11936
  trustProxy: currentServerConfig.trustProxy
11805
11937
  }).pathname;
11806
11938
  try {
@@ -11808,7 +11940,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11808
11940
  if (hasMatchedApiRoute) {
11809
11941
  await pm.runHookParallelFiltered(
11810
11942
  "beforeRequest",
11811
- (plugin) => plugin.name !== _chunk27ZWSI3Wcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
11943
+ (plugin) => plugin.name !== _chunkVXEEATVDcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
11812
11944
  req,
11813
11945
  res
11814
11946
  );
@@ -11835,7 +11967,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11835
11967
  const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
11836
11968
  const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
11837
11969
  if (apiHandler && hasExplicitAPIRoute) {
11838
- const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _634 => _634.route, 'access', _635 => _635.path]) || _optionalChain([apiRouteManager, 'access', _636 => _636.matchRoute, 'call', _637 => _637(pathname2), 'optionalAccess', _638 => _638.route, 'access', _639 => _639.path]) || urlPath2;
11970
+ const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _640 => _640.route, 'access', _641 => _641.path]) || _optionalChain([apiRouteManager, 'access', _642 => _642.matchRoute, 'call', _643 => _643(pathname2), 'optionalAccess', _644 => _644.route, 'access', _645 => _645.path]) || urlPath2;
11839
11971
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
11840
11972
  type: "route.matched",
11841
11973
  pathname: pathname2,
@@ -11925,7 +12057,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11925
12057
  return;
11926
12058
  }
11927
12059
  }
11928
- if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _640 => _640.isFarmDocsAPIRequest, 'call', _641 => _641(pathname2)])) {
12060
+ if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _646 => _646.isFarmDocsAPIRequest, 'call', _647 => _647(pathname2)])) {
11929
12061
  try {
11930
12062
  const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
11931
12063
  const headers = new Headers();
@@ -11998,18 +12130,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11998
12130
  res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
11999
12131
  return;
12000
12132
  }
12001
- if (_optionalChain([req, 'access', _642 => _642.url, 'optionalAccess', _643 => _643.startsWith, 'call', _644 => _644("/@")]) || _optionalChain([req, 'access', _645 => _645.url, 'optionalAccess', _646 => _646.startsWith, 'call', _647 => _647("/node_modules")])) {
12133
+ if (_optionalChain([req, 'access', _648 => _648.url, 'optionalAccess', _649 => _649.startsWith, 'call', _650 => _650("/@")]) || _optionalChain([req, 'access', _651 => _651.url, 'optionalAccess', _652 => _652.startsWith, 'call', _653 => _653("/node_modules")])) {
12002
12134
  return next();
12003
12135
  }
12004
12136
  if (shouldBypassFarmRouterForDottedPath(
12005
12137
  requestPathname,
12006
- _optionalChain([farmApp, 'optionalAccess', _648 => _648.getRouteManager, 'call', _649 => _649()]),
12138
+ _optionalChain([farmApp, 'optionalAccess', _654 => _654.getRouteManager, 'call', _655 => _655()]),
12007
12139
  [server.config.publicDir, server.config.root],
12008
12140
  farmAgentGeneratedPaths(farmConfig)
12009
12141
  )) {
12010
12142
  return next();
12011
12143
  }
12012
- if (_optionalChain([req, 'access', _650 => _650.url, 'optionalAccess', _651 => _651.startsWith, 'call', _652 => _652("/__farm/page-data")])) {
12144
+ if (_optionalChain([req, 'access', _656 => _656.url, 'optionalAccess', _657 => _657.startsWith, 'call', _658 => _658("/__farm/page-data")])) {
12013
12145
  const urlObj = parsedRequestUrl;
12014
12146
  const targetPath = urlObj.searchParams.get("path") || "/";
12015
12147
  try {
@@ -12037,7 +12169,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12037
12169
  });
12038
12170
  let middlewareMap = /* @__PURE__ */ new Map();
12039
12171
  let middlewareContext = /* @__PURE__ */ new Map();
12040
- if (_optionalChain([middlewareManager, 'optionalAccess', _653 => _653.hasMiddleware, 'call', _654 => _654()])) {
12172
+ if (_optionalChain([middlewareManager, 'optionalAccess', _659 => _659.hasMiddleware, 'call', _660 => _660()])) {
12041
12173
  const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
12042
12174
  const handled = await runFarmMiddlewareWithNavigation(
12043
12175
  farmApp.getServerRenderer(),
@@ -12065,10 +12197,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12065
12197
  if (pm) {
12066
12198
  await pm.runHookParallel("afterRouteMatch", {
12067
12199
  pathname: targetPath,
12068
- matched: !!_optionalChain([match, 'optionalAccess', _655 => _655.route]),
12069
- routePattern: _optionalChain([match, 'optionalAccess', _656 => _656.route, 'optionalAccess', _657 => _657.pattern]) || null,
12070
- params: _optionalChain([match, 'optionalAccess', _658 => _658.params]) || {},
12071
- layoutPatterns: (_optionalChain([match, 'optionalAccess', _659 => _659.layouts]) || []).map((l) => l.pattern)
12200
+ matched: !!_optionalChain([match, 'optionalAccess', _661 => _661.route]),
12201
+ routePattern: _optionalChain([match, 'optionalAccess', _662 => _662.route, 'optionalAccess', _663 => _663.pattern]) || null,
12202
+ params: _optionalChain([match, 'optionalAccess', _664 => _664.params]) || {},
12203
+ layoutPatterns: (_optionalChain([match, 'optionalAccess', _665 => _665.layouts]) || []).map((l) => l.pattern)
12072
12204
  });
12073
12205
  }
12074
12206
  if (!match) {
@@ -12156,7 +12288,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12156
12288
  mergedMetadata = await _chunkEK4QAEFZcjs.mergeModuleViewport.call(void 0, mergedMetadata, routeModule, routeProps);
12157
12289
  mergedMetadata = _chunkEK4QAEFZcjs.addMetadataMarkdownAlternate.call(void 0,
12158
12290
  mergedMetadata,
12159
- _chunkEUV4YR3Vcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
12291
+ _chunkSGBJ247Qcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
12160
12292
  );
12161
12293
  const routeSlots = await Promise.all(
12162
12294
  slots.map(async (slot) => {
@@ -12213,7 +12345,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12213
12345
  pageShouldHydrate: shouldHydrate,
12214
12346
  layoutShouldHydrate: shouldHydrateLayout,
12215
12347
  islandStrategy: hydrationIslandStrategy,
12216
- rendering: _chunkJNUWCDTFcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
12348
+ rendering: _chunk5D2JIPLHcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
12217
12349
  });
12218
12350
  const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
12219
12351
  const layoutStartIndex = getSharedLayoutPrefixLength(
@@ -12221,13 +12353,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12221
12353
  destinationLayoutPatterns
12222
12354
  );
12223
12355
  const renderer = farmApp.getServerRenderer();
12224
- const fragmentHtml = await _chunk3BU22U3Mcjs._runWithMiddlewareData.call(void 0,
12356
+ const fragmentHtml = await _chunkZXH4TS3Fcjs._runWithMiddlewareData.call(void 0,
12225
12357
  middlewareMap,
12226
- () => _chunk3BU22U3Mcjs._runWithMiddlewareContext.call(void 0,
12358
+ () => _chunkZXH4TS3Fcjs._runWithMiddlewareContext.call(void 0,
12227
12359
  middlewareContext,
12228
12360
  () => renderer.renderNavigationFragment({
12229
12361
  PageComponent: routeModule.default,
12230
- LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _660 => _660.default]),
12362
+ LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _666 => _666.default]),
12231
12363
  pageProps: routeProps,
12232
12364
  params,
12233
12365
  layouts: layouts.map((layout, index) => ({
@@ -12331,18 +12463,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12331
12463
  const startTime = Date.now();
12332
12464
  const method = req.method || "GET";
12333
12465
  const urlPath = req.url || "/";
12334
- const requestedPathname = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
12466
+ const requestedPathname = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
12335
12467
  trustProxy: currentServerConfig.trustProxy
12336
12468
  }).pathname;
12337
12469
  const routeManager2 = farmApp.getRouteManager();
12338
- const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _661 => _661.hasHook, 'call', _662 => _662("beforeRouteMatch")]), () => ( false));
12339
- const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _663 => _663.hasHook, 'call', _664 => _664("afterRouteMatch")]), () => ( false));
12340
- const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _665 => _665.hasHook, 'call', _666 => _666("beforeRequest")]), () => ( false));
12341
- const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _667 => _667.hasHook, 'call', _668 => _668("beforeRender")]), () => ( false));
12342
- const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _669 => _669.hasHook, 'call', _670 => _670("afterResponse")]), () => ( false));
12343
- const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _671 => _671.hasHook, 'call', _672 => _672("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _673 => _673.hasHook, 'call', _674 => _674("afterRender")]), () => ( false)));
12344
- const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _675 => _675.hasRuntimeRequestHooks, 'call', _676 => _676()]), () => ( false));
12345
- const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _677 => _677.hasRuntimeHook, 'call', _678 => _678("after")]), () => ( false));
12470
+ const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _667 => _667.hasHook, 'call', _668 => _668("beforeRouteMatch")]), () => ( false));
12471
+ const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _669 => _669.hasHook, 'call', _670 => _670("afterRouteMatch")]), () => ( false));
12472
+ const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _671 => _671.hasHook, 'call', _672 => _672("beforeRequest")]), () => ( false));
12473
+ const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _673 => _673.hasHook, 'call', _674 => _674("beforeRender")]), () => ( false));
12474
+ const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _675 => _675.hasHook, 'call', _676 => _676("afterResponse")]), () => ( false));
12475
+ const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _677 => _677.hasHook, 'call', _678 => _678("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _679 => _679.hasHook, 'call', _680 => _680("afterRender")]), () => ( false)));
12476
+ const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _681 => _681.hasRuntimeRequestHooks, 'call', _682 => _682()]), () => ( false));
12477
+ const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _683 => _683.hasRuntimeHook, 'call', _684 => _684("after")]), () => ( false));
12346
12478
  const requestedMatch = routeManager2.matchRoute(requestedPathname);
12347
12479
  let runtimeSession;
12348
12480
  if (pm && hasRuntimeRequestHooks) {
@@ -12353,8 +12485,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12353
12485
  kind: "page",
12354
12486
  route: {
12355
12487
  pathname: requestedPathname,
12356
- pattern: _optionalChain([requestedMatch, 'optionalAccess', _679 => _679.route, 'optionalAccess', _680 => _680.pattern]) || null,
12357
- params: _optionalChain([requestedMatch, 'optionalAccess', _681 => _681.params]) || {}
12488
+ pattern: _optionalChain([requestedMatch, 'optionalAccess', _685 => _685.route, 'optionalAccess', _686 => _686.pattern]) || null,
12489
+ params: _optionalChain([requestedMatch, 'optionalAccess', _687 => _687.params]) || {}
12358
12490
  }
12359
12491
  }
12360
12492
  );
@@ -12387,17 +12519,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12387
12519
  if (pm && hasAfterRouteMatchHook) {
12388
12520
  await pm.runHookParallel("afterRouteMatch", {
12389
12521
  pathname,
12390
- matched: !!_optionalChain([routeMatch, 'optionalAccess', _682 => _682.route]),
12391
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _683 => _683.route, 'optionalAccess', _684 => _684.pattern]) || null,
12392
- params: _optionalChain([routeMatch, 'optionalAccess', _685 => _685.params]) || {},
12393
- layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _686 => _686.layouts]) || []).map((l) => l.pattern)
12522
+ matched: !!_optionalChain([routeMatch, 'optionalAccess', _688 => _688.route]),
12523
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _689 => _689.route, 'optionalAccess', _690 => _690.pattern]) || null,
12524
+ params: _optionalChain([routeMatch, 'optionalAccess', _691 => _691.params]) || {},
12525
+ layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _692 => _692.layouts]) || []).map((l) => l.pattern)
12394
12526
  });
12395
12527
  }
12396
12528
  const renderPayload = {
12397
12529
  pathname,
12398
12530
  method,
12399
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _687 => _687.route, 'optionalAccess', _688 => _688.pattern]) || null,
12400
- params: _optionalChain([routeMatch, 'optionalAccess', _689 => _689.params]) || {}
12531
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _693 => _693.route, 'optionalAccess', _694 => _694.pattern]) || null,
12532
+ params: _optionalChain([routeMatch, 'optionalAccess', _695 => _695.params]) || {}
12401
12533
  };
12402
12534
  const shouldInterceptResponse = Boolean(
12403
12535
  pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
@@ -12419,7 +12551,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12419
12551
  emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
12420
12552
  }) : void 0;
12421
12553
  try {
12422
- if (_optionalChain([middlewareManager, 'optionalAccess', _690 => _690.hasMiddleware, 'call', _691 => _691()])) {
12554
+ if (_optionalChain([middlewareManager, 'optionalAccess', _696 => _696.hasMiddleware, 'call', _697 => _697()])) {
12423
12555
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
12424
12556
  const handled = await runFarmMiddlewareWithNavigation(
12425
12557
  farmApp.getServerRenderer(),
@@ -12429,7 +12561,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12429
12561
  () => middlewareManager.execute(req, res)
12430
12562
  );
12431
12563
  if (handled) {
12432
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _692 => _692.isEnded, 'call', _693 => _693()])) {
12564
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _698 => _698.isEnded, 'call', _699 => _699()])) {
12433
12565
  const duration = Date.now() - startTime;
12434
12566
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
12435
12567
  }
@@ -12441,16 +12573,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12441
12573
  req.url || "/",
12442
12574
  `http://${req.headers.host || "localhost:3000"}`
12443
12575
  ).pathname;
12444
- const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _694 => _694.matchRoute, 'call', _695 => _695(currentPathname), 'optionalAccess', _696 => _696.route]));
12576
+ const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _700 => _700.matchRoute, 'call', _701 => _701(currentPathname), 'optionalAccess', _702 => _702.route]));
12445
12577
  await pm.runHookParallelFiltered(
12446
12578
  "beforeRequest",
12447
- (plugin) => !hasLocalPageRoute || plugin.name !== _chunk27ZWSI3Wcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
12579
+ (plugin) => !hasLocalPageRoute || plugin.name !== _chunkVXEEATVDcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
12448
12580
  req,
12449
12581
  res
12450
12582
  );
12451
12583
  }
12452
- if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _697 => _697.isEnded, 'call', _698 => _698()])) {
12453
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _699 => _699.isEnded, 'call', _700 => _700()])) {
12584
+ if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _703 => _703.isEnded, 'call', _704 => _704()])) {
12585
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _705 => _705.isEnded, 'call', _706 => _706()])) {
12454
12586
  const duration = Date.now() - startTime;
12455
12587
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
12456
12588
  }
@@ -12508,68 +12640,68 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12508
12640
  if (imageModule) return imageModule;
12509
12641
  }
12510
12642
  if (_chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
12511
- const renderer = _optionalChain([farmApp, 'optionalAccess', _701 => _701.getConfig, 'call', _702 => _702(), 'access', _703 => _703.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12512
- return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _704 => _704.config, 'access', _705 => _705.root]) || options.root, renderer);
12643
+ const renderer = _optionalChain([farmApp, 'optionalAccess', _707 => _707.getConfig, 'call', _708 => _708(), 'access', _709 => _709.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12644
+ return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _710 => _710.config, 'access', _711 => _711.root]) || options.root, renderer);
12513
12645
  }
12514
12646
  if (isFarmClientVirtualId(id)) {
12515
- const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _706 => _706.getConfig, 'call', _707 => _707()]);
12516
- const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _708 => _708.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12517
- const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _709 => _709.integrations]) || options.integrations;
12518
- const root = _optionalChain([resolvedConfig, 'optionalAccess', _710 => _710.root]) || _optionalChain([server, 'optionalAccess', _711 => _711.config, 'access', _712 => _712.root]) || process.cwd();
12519
- const docs = _optionalChain([resolvedConfig, 'optionalAccess', _713 => _713.docs]);
12647
+ const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _712 => _712.getConfig, 'call', _713 => _713()]);
12648
+ const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _714 => _714.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12649
+ const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _715 => _715.integrations]) || options.integrations;
12650
+ const root = _optionalChain([resolvedConfig, 'optionalAccess', _716 => _716.root]) || _optionalChain([server, 'optionalAccess', _717 => _717.config, 'access', _718 => _718.root]) || process.cwd();
12651
+ const docs = _optionalChain([resolvedConfig, 'optionalAccess', _719 => _719.docs]);
12520
12652
  const adapterOwnsDocsRuntime = Boolean(
12521
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _714 => _714.adapter, 'optionalAccess', _715 => _715.server]) && docs.adapter.react
12653
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _720 => _720.adapter, 'optionalAccess', _721 => _721.server]) && docs.adapter.react
12522
12654
  );
12523
- const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _716 => _716.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
12655
+ const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _722 => _722.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
12524
12656
  const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
12525
- _optionalChain([docs, 'optionalAccess', _717 => _717.enabled]) ? loadFarmDocsDevRuntime() : null,
12526
- _optionalChain([docs, 'optionalAccess', _718 => _718.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
12657
+ _optionalChain([docs, 'optionalAccess', _723 => _723.enabled]) ? loadFarmDocsDevRuntime() : null,
12658
+ _optionalChain([docs, 'optionalAccess', _724 => _724.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
12527
12659
  devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
12528
12660
  ]);
12529
- const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _719 => _719.isFarmDocsSearchEnabled, 'call', _720 => _720(docs)]), () => ( false));
12661
+ const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _725 => _725.isFarmDocsSearchEnabled, 'call', _726 => _726(docs)]), () => ( false));
12530
12662
  const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
12531
12663
  docsSearchEnabled,
12532
12664
  docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
12533
12665
  ) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
12534
12666
  const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
12535
12667
  const generatedDevIndicatorsClientRuntime = farmApp ? _chunk6MVFL3R5cjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
12536
- const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkCBJJH36Acjs.getIntegrationProviders.call(void 0, integrations) : [];
12668
+ const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkVU6AAZVYcjs.getIntegrationProviders.call(void 0, integrations) : [];
12537
12669
  const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
12538
- _optionalChain([resolvedConfig, 'optionalAccess', _721 => _721.experimental, 'optionalAccess', _722 => _722.isolatedClientHydration]),
12670
+ _optionalChain([resolvedConfig, 'optionalAccess', _727 => _727.experimental, 'optionalAccess', _728 => _728.isolatedClientHydration]),
12539
12671
  {
12540
- serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _723 => _723.experimental, 'optionalAccess', _724 => _724.serverComponents]) === true,
12672
+ serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _729 => _729.experimental, 'optionalAccess', _730 => _730.serverComponents]) === true,
12541
12673
  hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
12542
12674
  }
12543
12675
  );
12544
12676
  return generateClientCode(
12545
12677
  integrationProviders,
12546
12678
  [
12547
- ..._chunkCBJJH36Acjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
12548
- ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _725 => _725.getFarmDocsDocumentNavigationMatchers, 'call', _726 => _726(docs)]), () => ( []))
12679
+ ..._chunkVU6AAZVYcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
12680
+ ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _731 => _731.getFarmDocsDocumentNavigationMatchers, 'call', _732 => _732(docs)]), () => ( []))
12549
12681
  ],
12550
12682
  generatedDocsSearchRuntime,
12551
12683
  `${generatedDevtoolsClientRuntime}
12552
12684
  ${generatedDevIndicatorsClientRuntime}`,
12553
- _optionalChain([resolvedConfig, 'optionalAccess', _727 => _727.plugins]) || [],
12685
+ _optionalChain([resolvedConfig, 'optionalAccess', _733 => _733.plugins]) || [],
12554
12686
  root,
12555
- _optionalChain([resolvedConfig, 'optionalAccess', _728 => _728.srcDir]) || options.srcDir || "src",
12556
- _optionalChain([resolvedConfig, 'optionalAccess', _729 => _729.publicRuntimeConfig]) || options.publicRuntimeConfig,
12557
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _730 => _730.adapter, 'optionalAccess', _731 => _731.react]) : void 0,
12687
+ _optionalChain([resolvedConfig, 'optionalAccess', _734 => _734.srcDir]) || options.srcDir || "src",
12688
+ _optionalChain([resolvedConfig, 'optionalAccess', _735 => _735.publicRuntimeConfig]) || options.publicRuntimeConfig,
12689
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _736 => _736.adapter, 'optionalAccess', _737 => _737.react]) : void 0,
12558
12690
  renderer,
12559
- isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _732 => _732.getRouteManager, 'call', _733 => _733(), 'access', _734 => _734.getIsolatedClientBoundaryModules, 'call', _735 => _735(root)])))), 'optionalAccess', _736 => _736.size]) > 0,
12560
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _737 => _737.trailingSlash]), () => ( false)),
12561
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _738 => _738.basePath]), () => ( "/")),
12691
+ isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _738 => _738.getRouteManager, 'call', _739 => _739(), 'access', _740 => _740.getIsolatedClientBoundaryModules, 'call', _741 => _741(root)])))), 'optionalAccess', _742 => _742.size]) > 0,
12692
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _743 => _743.trailingSlash]), () => ( false)),
12693
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _744 => _744.basePath]), () => ( "/")),
12562
12694
  generateClientCachePersistenceCode(
12563
- resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _739 => _739.cache]))
12695
+ resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _745 => _745.cache]))
12564
12696
  ),
12565
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
12697
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
12566
12698
  );
12567
12699
  }
12568
12700
  if (id === "/@farm/server") {
12569
12701
  return generateServerCode();
12570
12702
  }
12571
12703
  if (id === "/@farm/manifest") {
12572
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _740 => _740.getRouteManager, 'call', _741 => _741()]);
12704
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _746 => _746.getRouteManager, 'call', _747 => _747()]);
12573
12705
  if (!routeManager) {
12574
12706
  return `
12575
12707
  export const getManifest = () => ({
@@ -12584,7 +12716,7 @@ export const getManifest = () => ({
12584
12716
  const manifest = routeManager.generateClientManifest(server.config.root);
12585
12717
  const globalStylesheetHref = resolveDevGlobalStylesheetHref(
12586
12718
  server.config.root,
12587
- _optionalChain([farmApp, 'optionalAccess', _742 => _742.getConfig, 'call', _743 => _743(), 'access', _744 => _744.srcDir])
12719
+ _optionalChain([farmApp, 'optionalAccess', _748 => _748.getConfig, 'call', _749 => _749(), 'access', _750 => _750.srcDir])
12588
12720
  );
12589
12721
  const fullManifest = {
12590
12722
  clientEntry: "/@farm/client.js",
@@ -12610,11 +12742,11 @@ export const getManifest = () => ({
12610
12742
  };
12611
12743
  }
12612
12744
  for (const layout of manifest.layouts) {
12613
- const groupScope = _chunkADEA7PN3cjs.getRouteGroupScope.call(void 0, layout.pattern);
12745
+ const groupScope = _chunk2DD4JMQCcjs.getRouteGroupScope.call(void 0, layout.pattern);
12614
12746
  fullManifest.layouts[layout.pattern] = {
12615
12747
  modulePath: layout.modulePath,
12616
12748
  pattern: layout.pattern,
12617
- ...groupScope ? { urlPattern: _chunkADEA7PN3cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
12749
+ ...groupScope ? { urlPattern: _chunk2DD4JMQCcjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
12618
12750
  shouldHydrate: layout.shouldHydrate,
12619
12751
  islandStrategy: layout.islandStrategy,
12620
12752
  preloads: [layout.modulePath],
@@ -12638,24 +12770,24 @@ export const manifest = getManifest();
12638
12770
  }
12639
12771
  },
12640
12772
  async transform(code, id, transformOptions) {
12641
- if (!_optionalChain([transformOptions, 'optionalAccess', _745 => _745.ssr])) {
12642
- const docsConfigModule = _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _746 => _746.getConfig, 'call', _747 => _747(), 'optionalAccess', _748 => _748.docs]));
12773
+ if (!_optionalChain([transformOptions, 'optionalAccess', _751 => _751.ssr])) {
12774
+ const docsConfigModule = _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _752 => _752.getConfig, 'call', _753 => _753(), 'optionalAccess', _754 => _754.docs]));
12643
12775
  if (isFarmDocsClientConfigModule(id, docsConfigModule)) {
12644
12776
  const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
12645
12777
  if (redacted !== null) return { code: redacted, map: null };
12646
12778
  }
12647
12779
  }
12648
- if (!_optionalChain([transformOptions, 'optionalAccess', _749 => _749.ssr])) {
12649
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _750 => _750.getConfig, 'call', _751 => _751()]), () => ( options));
12650
- if (_optionalChain([currentConfig, 'access', _752 => _752.experimental, 'optionalAccess', _753 => _753.serverActions]) !== true || !serverFnTransformActive) {
12780
+ if (!_optionalChain([transformOptions, 'optionalAccess', _755 => _755.ssr])) {
12781
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _756 => _756.getConfig, 'call', _757 => _757()]), () => ( options));
12782
+ if (_optionalChain([currentConfig, 'access', _758 => _758.experimental, 'optionalAccess', _759 => _759.serverActions]) !== true || !serverFnTransformActive) {
12651
12783
  const violation = findClientServerFnViolation(code, id);
12652
12784
  if (violation) {
12653
12785
  this.error(formatServerFnBoundaryError(violation, id));
12654
12786
  }
12655
12787
  }
12656
12788
  }
12657
- if (!_optionalChain([transformOptions, 'optionalAccess', _754 => _754.ssr]) && shouldInspectClientBoundary(id, code)) {
12658
- warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _755 => _755.getConfig, 'call', _756 => _756()]), () => ( options)));
12789
+ if (!_optionalChain([transformOptions, 'optionalAccess', _760 => _760.ssr]) && shouldInspectClientBoundary(id, code)) {
12790
+ warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _761 => _761.getConfig, 'call', _762 => _762()]), () => ( options)));
12659
12791
  }
12660
12792
  if (typeof imageImports.transform === "function") {
12661
12793
  const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
@@ -12670,13 +12802,13 @@ export const manifest = getManifest();
12670
12802
  id,
12671
12803
  transformOptions
12672
12804
  );
12673
- const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _757 => _757.code, 'optionalAccess', _758 => _758.toString, 'call', _759 => _759()]);
12805
+ const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _763 => _763.code, 'optionalAccess', _764 => _764.toString, 'call', _765 => _765()]);
12674
12806
  if (fontCode) {
12675
12807
  transformedCode = fontCode;
12676
12808
  transformed = true;
12677
12809
  }
12678
12810
  }
12679
- if (_optionalChain([transformOptions, 'optionalAccess', _760 => _760.ssr]) && server) {
12811
+ if (_optionalChain([transformOptions, 'optionalAccess', _766 => _766.ssr]) && server) {
12680
12812
  const rewrittenImports = rewriteEarlySsrRelativeImports({
12681
12813
  code: transformedCode,
12682
12814
  id,
@@ -12696,12 +12828,12 @@ export const manifest = getManifest();
12696
12828
  }
12697
12829
  transformedCode = stripUseClientDirective(transformedCode);
12698
12830
  transformed = true;
12699
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _761 => _761.getConfig, 'call', _762 => _762()]), () => ( options));
12831
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _767 => _767.getConfig, 'call', _768 => _768()]), () => ( options));
12700
12832
  let isolatedModuleReference = null;
12701
- const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _763 => _763.config, 'access', _764 => _764.root]) || process.cwd();
12833
+ const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _769 => _769.config, 'access', _770 => _770.root]) || process.cwd();
12702
12834
  const cleanId = id.split("?", 1)[0];
12703
- const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _765 => _765.getRouteManager, 'call', _766 => _766(), 'access', _767 => _767.getIsolatedClientBoundaryModules, 'call', _768 => _768(root)])));
12704
- const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _769 => _769.has, 'call', _770 => _770(path21.resolve(cleanId))]) === true;
12835
+ const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _771 => _771.getRouteManager, 'call', _772 => _772(), 'access', _773 => _773.getIsolatedClientBoundaryModules, 'call', _774 => _774(root)])));
12836
+ const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _775 => _775.has, 'call', _776 => _776(path21.resolve(cleanId))]) === true;
12705
12837
  if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
12706
12838
  isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
12707
12839
  const transformedBoundary = transformIsolatedClientBoundaryModule({
@@ -12738,7 +12870,7 @@ export const manifest = getManifest();
12738
12870
  );
12739
12871
  return;
12740
12872
  }` : "";
12741
- const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _771 => _771.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
12873
+ const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _777 => _777.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
12742
12874
  if (import.meta.hot) {
12743
12875
  import.meta.hot.accept((newModule) => {
12744
12876
  ${isolatedHmrUpdate}
@@ -12793,14 +12925,14 @@ if (import.meta.hot) {
12793
12925
  }
12794
12926
  _chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
12795
12927
  _chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
12796
- const outDir = path21.join(_optionalChain([server, 'optionalAccess', _772 => _772.config, 'access', _773 => _773.root]) || process.cwd(), options.outDir || "dist");
12928
+ const outDir = path21.join(_optionalChain([server, 'optionalAccess', _778 => _778.config, 'access', _779 => _779.root]) || process.cwd(), options.outDir || "dist");
12797
12929
  const clientDir = path21.join(outDir, "client");
12798
12930
  for (const page of ssgPages) {
12799
12931
  try {
12800
12932
  const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
12801
12933
  await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
12802
12934
  const mod = await routeManager.loadRouteModule(page.filePath);
12803
- if (!_optionalChain([mod, 'optionalAccess', _774 => _774.default])) return;
12935
+ if (!_optionalChain([mod, 'optionalAccess', _780 => _780.default])) return;
12804
12936
  const { layouts } = routeManager.matchRoute(page.urlPath);
12805
12937
  const layoutModules = await Promise.all(
12806
12938
  layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
@@ -12832,7 +12964,7 @@ if (import.meta.hot) {
12832
12964
  const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
12833
12965
  const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
12834
12966
  const fullHtml = `<!DOCTYPE html>
12835
- <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _775 => _775.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
12967
+ <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _781 => _781.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
12836
12968
  <head>
12837
12969
  <meta charset="utf-8">
12838
12970
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -12890,13 +13022,13 @@ if (import.meta.hot) {
12890
13022
  });
12891
13023
  }
12892
13024
  }
12893
- const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _776 => _776.getConfig, 'call', _777 => _777()]);
13025
+ const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _782 => _782.getConfig, 'call', _783 => _783()]);
12894
13026
  const normalizedFile = file.replace(/\\/g, "/");
12895
13027
  if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
12896
13028
  (appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
12897
13029
  )) {
12898
13030
  for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
12899
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _778 => _778(`updated ${file}`)]);
13031
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _784 => _784(`updated ${file}`)]);
12900
13032
  server2.ws.send({ type: "full-reload", path: "*" });
12901
13033
  return [];
12902
13034
  }
@@ -12906,7 +13038,7 @@ if (import.meta.hot) {
12906
13038
  for (const mod of modules) {
12907
13039
  server2.moduleGraph.invalidateModule(mod);
12908
13040
  }
12909
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _779 => _779(`updated ${file}`)]);
13041
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _785 => _785(`updated ${file}`)]);
12910
13042
  server2.ws.send({
12911
13043
  type: "full-reload",
12912
13044
  path: "*"
@@ -12919,7 +13051,7 @@ if (import.meta.hot) {
12919
13051
  for (const mod of modules) {
12920
13052
  server2.moduleGraph.invalidateModule(mod);
12921
13053
  }
12922
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _780 => _780(`updated ${file}`)]);
13054
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _786 => _786(`updated ${file}`)]);
12923
13055
  server2.ws.send({
12924
13056
  type: "full-reload",
12925
13057
  path: "*"
@@ -12927,12 +13059,12 @@ if (import.meta.hot) {
12927
13059
  return [];
12928
13060
  }
12929
13061
  if (apiRouteManager && _chunkSHLXACIOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
12930
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _781 => _781(`updated ${file}`)]);
13062
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _787 => _787(`updated ${file}`)]);
12931
13063
  }
12932
- const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _782 => _782.experimental, 'optionalAccess', _783 => _783.isolatedClientHydration]);
12933
- const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _784 => _784.getRouteManager, 'call', _785 => _785()]);
13064
+ const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _788 => _788.experimental, 'optionalAccess', _789 => _789.isolatedClientHydration]);
13065
+ const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _790 => _790.getRouteManager, 'call', _791 => _791()]);
12934
13066
  const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
12935
- const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _786 => _786.renderer])) && planRouteManager !== void 0;
13067
+ const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _792 => _792.renderer])) && planRouteManager !== void 0;
12936
13068
  if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
12937
13069
  const routeManager = planRouteManager;
12938
13070
  if (routeManager) {
@@ -12992,7 +13124,7 @@ if (import.meta.hot) {
12992
13124
  }
12993
13125
  return [];
12994
13126
  }
12995
- _optionalChain([farmApp, 'optionalAccess', _787 => _787.getRouteManager, 'call', _788 => _788(), 'access', _789 => _789.invalidateClientManifest, 'call', _790 => _790()]);
13127
+ _optionalChain([farmApp, 'optionalAccess', _793 => _793.getRouteManager, 'call', _794 => _794(), 'access', _795 => _795.invalidateClientManifest, 'call', _796 => _796()]);
12996
13128
  const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
12997
13129
  if (manifestModule) {
12998
13130
  server2.moduleGraph.invalidateModule(manifestModule);
@@ -13361,12 +13493,12 @@ async function parseRouteModuleProps2(routeModule, input) {
13361
13493
  }
13362
13494
  const schemas = routeModule.__farmRouteSchemas;
13363
13495
  const params = parseRouteModuleSchema2(
13364
- _optionalChain([schemas, 'optionalAccess', _791 => _791.params]),
13496
+ _optionalChain([schemas, 'optionalAccess', _797 => _797.params]),
13365
13497
  input.props.params,
13366
13498
  "params",
13367
13499
  input.routePath
13368
13500
  );
13369
- const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _792 => _792.search]), input.search, "search", input.routePath);
13501
+ const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _798 => _798.search]), input.search, "search", input.routePath);
13370
13502
  return {
13371
13503
  ...input.props,
13372
13504
  params,
@@ -13406,7 +13538,7 @@ import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toViteModuleId.cal
13406
13538
  __farmConfigureApp(__farmAppSetup)` : `import React, { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}`;
13407
13539
  const isolatedHydrationImport = isolatedHydrationEnabled ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'
13408
13540
  import { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'` : "";
13409
- const docsAdapterImportBlock = _chunkHITLGIAOcjs.generateFarmDocsAdapterClientRuntime.call(void 0,
13541
+ const docsAdapterImportBlock = _chunkCY2ZQ5C6cjs.generateFarmDocsAdapterClientRuntime.call(void 0,
13410
13542
  docsAdapterReact,
13411
13543
  docsConfigModule
13412
13544
  );
@@ -15027,7 +15159,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientMan
15027
15159
  async function defineConfig(config = {}) {
15028
15160
  const tailwindVitePlugin = await loadTailwindVitePlugin();
15029
15161
  const appRoot = path21.resolve(config.root || process.cwd());
15030
- if (_optionalChain([config, 'access', _793 => _793.extends, 'optionalAccess', _794 => _794.length])) {
15162
+ if (_optionalChain([config, 'access', _799 => _799.extends, 'optionalAccess', _800 => _800.length])) {
15031
15163
  const { config: layeredConfig } = await import("./layers-VUWIOFEO.cjs").then(
15032
15164
  ({ resolveFarmLayers }) => resolveFarmLayers(config, {
15033
15165
  root: appRoot,
@@ -15128,13 +15260,13 @@ async function defineConfig(config = {}) {
15128
15260
  if (!serverStarted) {
15129
15261
  serverStarted = true;
15130
15262
  const elapsed = Date.now() - startTime;
15131
- const address = _optionalChain([server, 'access', _795 => _795.httpServer, 'optionalAccess', _796 => _796.address, 'call', _797 => _797()]);
15263
+ const address = _optionalChain([server, 'access', _801 => _801.httpServer, 'optionalAccess', _802 => _802.address, 'call', _803 => _803()]);
15132
15264
  const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
15133
15265
  const hostConfig = server.config.server.host;
15134
15266
  const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
15135
15267
  console.log("");
15136
15268
  console.log(
15137
- ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkDZ5ZVB2Kcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
15269
+ ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkKKSTAEMYcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
15138
15270
  );
15139
15271
  console.log("");
15140
15272
  console.log(