@farm.js/core 0.1.41 → 0.1.43

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 (237) hide show
  1. package/dist/{agent-mcp-BOqIxJLI.d.mts → agent-mcp-3KDz4hr9.d.mts} +1 -1
  2. package/dist/{agent-mcp-D0eZKfci.d.ts → agent-mcp-6yRebHk7.d.ts} +1 -1
  3. package/dist/agent-runtime.d.mts +1 -1
  4. package/dist/agent-runtime.d.ts +1 -1
  5. package/dist/api/route-manager.d.mts +3 -3
  6. package/dist/api/route-manager.d.ts +3 -3
  7. package/dist/api/runtime.d.mts +2 -2
  8. package/dist/api/runtime.d.ts +2 -2
  9. package/dist/api.cjs +2 -2
  10. package/dist/api.d.mts +8 -3
  11. package/dist/api.d.ts +8 -3
  12. package/dist/api.mjs +1 -1
  13. package/dist/{app-DM8e1z3G.d.ts → app-8Db1zR-2.d.ts} +8 -4
  14. package/dist/{app-CzTSMJaf.d.mts → app-DlTWv4cn.d.mts} +8 -4
  15. package/dist/app-manifest-TRzS7ZZ9.d.mts +120 -0
  16. package/dist/app-manifest-cO2jkG1F.d.ts +120 -0
  17. package/dist/app-markdown.d.mts +2 -2
  18. package/dist/app-markdown.d.ts +2 -2
  19. package/dist/{chunk-ECKF2BAM.cjs → chunk-2GVF3C2F.cjs} +255 -42
  20. package/dist/chunk-2NXO5SBY.mjs +57 -0
  21. package/dist/chunk-3BROEWFY.cjs +39 -0
  22. package/dist/{chunk-ENOBPDKZ.mjs → chunk-4MRQ5OKQ.mjs} +14 -9
  23. package/dist/{chunk-R65GCA6A.mjs → chunk-4OCEMK72.mjs} +260 -49
  24. package/dist/{chunk-6PKXK4TY.mjs → chunk-53ZV6K65.mjs} +1 -1
  25. package/dist/{chunk-LYIZHJTK.cjs → chunk-5LPHJZSI.cjs} +14 -14
  26. package/dist/chunk-5NIWBWDD.mjs +97 -0
  27. package/dist/{chunk-NRDBW4MP.mjs → chunk-7IQQIPRZ.mjs} +10 -0
  28. package/dist/{chunk-FJGIVDA5.mjs → chunk-7SCCY6SI.mjs} +80 -177
  29. package/dist/chunk-APDGOKKE.cjs +148 -0
  30. package/dist/chunk-AZBSVLRM.cjs +132 -0
  31. package/dist/{chunk-PN676AZF.cjs → chunk-BKPXWRTT.cjs} +6 -6
  32. package/dist/chunk-CEDPEDNW.cjs +98 -0
  33. package/dist/chunk-D5RFPV2H.mjs +148 -0
  34. package/dist/{chunk-BYQVROIP.mjs → chunk-DMRPN25V.mjs} +69 -0
  35. package/dist/{chunk-724JLMS4.mjs → chunk-F646BZ4Y.mjs} +4 -2
  36. package/dist/{chunk-C5KVWHIH.cjs → chunk-G2Z5DGMS.cjs} +5 -3
  37. package/dist/{chunk-L6HYACBE.cjs → chunk-GVNCWSQV.cjs} +145 -127
  38. package/dist/{chunk-24SP5TGU.mjs → chunk-H4LXPWI2.mjs} +2 -2
  39. package/dist/chunk-H7BLEEAE.cjs +57 -0
  40. package/dist/{chunk-JOTUZIM4.cjs → chunk-HUMEHX24.cjs} +2 -2
  41. package/dist/{chunk-BD3D7EZV.cjs → chunk-IXFOBGLQ.cjs} +9 -3
  42. package/dist/{chunk-3TB5QGUW.cjs → chunk-JAXDRRRC.cjs} +70 -1
  43. package/dist/{chunk-32TZ3QTP.cjs → chunk-JDJAPCR2.cjs} +421 -210
  44. package/dist/{chunk-MHN4UR5U.cjs → chunk-KFZZFZ7J.cjs} +7 -7
  45. package/dist/chunk-LRJRXXQZ.cjs +109 -0
  46. package/dist/{chunk-EX4MKHXN.cjs → chunk-LVABUXLA.cjs} +22 -17
  47. package/dist/{chunk-HCSVR4YZ.mjs → chunk-M3BXTWJM.mjs} +18 -0
  48. package/dist/{chunk-PYHPXPSW.mjs → chunk-NXO75WY4.mjs} +1 -1
  49. package/dist/{chunk-BGGWKZ2V.mjs → chunk-OYSGGV6O.mjs} +137 -167
  50. package/dist/{chunk-JR4QCLJY.cjs → chunk-PDU4P2IC.cjs} +19 -1
  51. package/dist/chunk-PJEHUSHA.mjs +229 -0
  52. package/dist/chunk-QGH2RQVF.mjs +132 -0
  53. package/dist/{chunk-YWMZUGIS.mjs → chunk-R3ZFQJEF.mjs} +247 -34
  54. package/dist/{chunk-ROQ4C4LJ.cjs → chunk-RACQTC7K.cjs} +274 -371
  55. package/dist/{chunk-WSOBCAYO.cjs → chunk-RQYTOFQM.cjs} +23 -23
  56. package/dist/chunk-S34OBRMZ.mjs +109 -0
  57. package/dist/{chunk-TS4JHGUJ.mjs → chunk-S3ZEMCE6.mjs} +9 -3
  58. package/dist/{chunk-WWFTAUFG.cjs → chunk-SBH2JLLF.cjs} +12 -2
  59. package/dist/{chunk-YSLWRWWP.cjs → chunk-SKK6UF5P.cjs} +200 -46
  60. package/dist/chunk-T7J7E63D.cjs +144 -0
  61. package/dist/{chunk-SVPGWJZF.mjs → chunk-TESO7EFU.mjs} +125 -107
  62. package/dist/{chunk-OQ4YXWH4.cjs → chunk-VIVQERJ5.cjs} +320 -351
  63. package/dist/{chunk-JIYYX7WU.mjs → chunk-VLXNGUKO.mjs} +1 -1
  64. package/dist/{chunk-OFZUJMCU.mjs → chunk-WPJQN64R.mjs} +195 -41
  65. package/dist/chunk-XARSG2TG.mjs +144 -0
  66. package/dist/chunk-XUGFRFD2.mjs +39 -0
  67. package/dist/{chunk-EH3464KF.cjs → chunk-YBDSTNMH.cjs} +1 -1
  68. package/dist/{chunk-VLPII2JJ.mjs → chunk-YGZH4T2X.mjs} +1 -1
  69. package/dist/chunk-YKUEJ3MG.cjs +229 -0
  70. package/dist/{chunk-4C7KTKX7.mjs → chunk-ZYWJIPKQ.mjs} +1 -1
  71. package/dist/{client-plugins-CkYwvDJ0.d.mts → client-plugins-Cv0OJtnM.d.mts} +98 -7
  72. package/dist/{client-plugins-DfeKd0sD.d.ts → client-plugins-kwQuZcWq.d.ts} +98 -7
  73. package/dist/client-plugins.d.mts +1 -1
  74. package/dist/client-plugins.d.ts +1 -1
  75. package/dist/client.cjs +4 -3
  76. package/dist/client.d.mts +5 -5
  77. package/dist/client.d.ts +5 -5
  78. package/dist/client.mjs +3 -2
  79. package/dist/config.d.mts +1 -1
  80. package/dist/config.d.ts +1 -1
  81. package/dist/{devtools-N3QLRIQU.mjs → devtools-M22FEFPK.mjs} +4 -4
  82. package/dist/{devtools-2YHAJYH6.cjs → devtools-MLB3JJMC.cjs} +5 -5
  83. package/dist/docs.cjs +6 -6
  84. package/dist/docs.d.mts +2 -2
  85. package/dist/docs.d.ts +2 -2
  86. package/dist/docs.mjs +5 -5
  87. package/dist/index-CQOp8EmB.d.mts +48 -0
  88. package/dist/index-DAl0QTZS.d.ts +48 -0
  89. package/dist/index.cjs +41 -24
  90. package/dist/index.d.mts +15 -14
  91. package/dist/index.d.ts +15 -14
  92. package/dist/index.mjs +46 -29
  93. package/dist/integrations.d.mts +1 -1
  94. package/dist/integrations.d.ts +1 -1
  95. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  96. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  97. package/dist/internal/build-runtime.cjs +29 -15
  98. package/dist/internal/build-runtime.d.mts +12 -16
  99. package/dist/internal/build-runtime.d.ts +12 -16
  100. package/dist/internal/build-runtime.mjs +28 -14
  101. package/dist/internal/cli-runtime.cjs +23 -11
  102. package/dist/internal/cli-runtime.mjs +23 -11
  103. package/dist/internal/client-error-overlay.cjs +4 -4
  104. package/dist/internal/client-error-overlay.mjs +1 -1
  105. package/dist/internal/client-runtime.cjs +5 -1
  106. package/dist/internal/client-runtime.d.mts +1 -0
  107. package/dist/internal/client-runtime.d.ts +1 -0
  108. package/dist/internal/client-runtime.mjs +4 -0
  109. package/dist/internal/compression-runtime.d.mts +1 -1
  110. package/dist/internal/compression-runtime.d.ts +1 -1
  111. package/dist/internal/config-runtime.cjs +5 -5
  112. package/dist/internal/config-runtime.d.mts +2 -2
  113. package/dist/internal/config-runtime.d.ts +2 -2
  114. package/dist/internal/config-runtime.mjs +4 -4
  115. package/dist/internal/form-actions-client.cjs +18 -0
  116. package/dist/internal/form-actions-client.d.mts +5 -0
  117. package/dist/internal/form-actions-client.d.ts +5 -0
  118. package/dist/internal/form-actions-client.mjs +18 -0
  119. package/dist/internal/form-actions.cjs +18 -0
  120. package/dist/internal/form-actions.d.mts +14 -0
  121. package/dist/internal/form-actions.d.ts +14 -0
  122. package/dist/internal/form-actions.mjs +18 -0
  123. package/dist/internal/island-codec.cjs +22 -0
  124. package/dist/internal/island-codec.d.mts +29 -0
  125. package/dist/internal/island-codec.d.ts +29 -0
  126. package/dist/internal/island-codec.mjs +22 -0
  127. package/dist/internal/island-value-store.cjs +13 -0
  128. package/dist/internal/island-value-store.d.mts +6 -0
  129. package/dist/internal/island-value-store.d.ts +6 -0
  130. package/dist/internal/island-value-store.mjs +13 -0
  131. package/dist/internal/islands-runtime.cjs +77 -0
  132. package/dist/internal/islands-runtime.d.mts +57 -0
  133. package/dist/internal/islands-runtime.d.ts +57 -0
  134. package/dist/internal/islands-runtime.mjs +77 -0
  135. package/dist/internal/islands-server.cjs +19 -0
  136. package/dist/internal/islands-server.d.mts +3 -0
  137. package/dist/internal/islands-server.d.ts +3 -0
  138. package/dist/internal/islands-server.mjs +19 -0
  139. package/dist/internal/islx-client.cjs +5 -0
  140. package/dist/internal/islx-client.d.mts +2 -0
  141. package/dist/internal/islx-client.d.ts +2 -0
  142. package/dist/internal/islx-client.mjs +3 -0
  143. package/dist/internal/islx-react.cjs +4 -0
  144. package/dist/internal/islx-react.d.mts +1 -0
  145. package/dist/internal/islx-react.d.ts +1 -0
  146. package/dist/internal/islx-react.mjs +2 -0
  147. package/dist/internal/islx-server.cjs +5 -0
  148. package/dist/internal/islx-server.d.mts +2 -0
  149. package/dist/internal/islx-server.d.ts +2 -0
  150. package/dist/internal/islx-server.mjs +3 -0
  151. package/dist/internal/isolated-boundary.cjs +4 -3
  152. package/dist/internal/isolated-boundary.d.mts +13 -1
  153. package/dist/internal/isolated-boundary.d.ts +13 -1
  154. package/dist/internal/isolated-boundary.mjs +3 -2
  155. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  156. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  157. package/dist/internal/production-runtime.cjs +24 -7
  158. package/dist/internal/production-runtime.d.mts +20 -127
  159. package/dist/internal/production-runtime.d.ts +20 -127
  160. package/dist/internal/production-runtime.mjs +24 -7
  161. package/dist/internal/server-tree.cjs +6 -3
  162. package/dist/internal/server-tree.d.mts +25 -2
  163. package/dist/internal/server-tree.d.ts +25 -2
  164. package/dist/internal/server-tree.mjs +7 -4
  165. package/dist/island-value-protocol-BRayRghM.d.mts +12 -0
  166. package/dist/island-value-protocol-BRayRghM.d.ts +12 -0
  167. package/dist/markdown.d.mts +1 -1
  168. package/dist/markdown.d.ts +1 -1
  169. package/dist/middleware.d.mts +3 -3
  170. package/dist/middleware.d.ts +3 -3
  171. package/dist/navigation.cjs +5 -4
  172. package/dist/navigation.d.mts +4 -4
  173. package/dist/navigation.d.ts +4 -4
  174. package/dist/navigation.mjs +4 -3
  175. package/dist/og.d.mts +5 -0
  176. package/dist/og.d.ts +5 -0
  177. package/dist/plugin.cjs +18 -12
  178. package/dist/plugin.d.mts +3 -3
  179. package/dist/plugin.d.ts +3 -3
  180. package/dist/plugin.mjs +17 -11
  181. package/dist/{production-runtime-DFC7pgbp.d.ts → production-runtime-5nArjFpn.d.ts} +1 -1
  182. package/dist/{production-runtime-BTkXQdYy.d.mts → production-runtime-BzsF2z5F.d.mts} +1 -1
  183. package/dist/query/client.cjs +6 -5
  184. package/dist/query/client.mjs +2 -1
  185. package/dist/{render-plan-5rFeWmk7.d.mts → render-plan-B9yQorV4.d.mts} +4 -2
  186. package/dist/{render-plan-BoAK9xFC.d.ts → render-plan-fg6E_HvL.d.ts} +4 -2
  187. package/dist/renderer/react/server.cjs +7 -6
  188. package/dist/renderer/react/server.d.mts +3 -1
  189. package/dist/renderer/react/server.d.ts +3 -1
  190. package/dist/renderer/react/server.mjs +5 -4
  191. package/dist/renderer-client.cjs +5 -4
  192. package/dist/renderer-client.d.mts +3 -3
  193. package/dist/renderer-client.d.ts +3 -3
  194. package/dist/renderer-client.mjs +2 -1
  195. package/dist/renderer.d.mts +3 -1
  196. package/dist/renderer.d.ts +3 -1
  197. package/dist/{request-BxBWigtl.d.mts → request-C4j_g-BH.d.mts} +1 -1
  198. package/dist/{request-fciwmd3n.d.ts → request-gz8vFK0n.d.ts} +1 -1
  199. package/dist/request.d.mts +2 -2
  200. package/dist/request.d.ts +2 -2
  201. package/dist/{route-rendering-BLZT0IP0.d.ts → route-rendering-DamyKVi3.d.ts} +1 -1
  202. package/dist/{route-rendering-BCM1QzEf.d.mts → route-rendering-iTTOwz1f.d.mts} +1 -1
  203. package/dist/{router-DyZJWc1_.d.mts → router-EoSzHlos.d.mts} +1 -1
  204. package/dist/{router-CkheNX3-.d.ts → router-OVjDqVo8.d.ts} +1 -1
  205. package/dist/routes.d.mts +1 -1
  206. package/dist/routes.d.ts +1 -1
  207. package/dist/rsc-pipeline-LK4K5JFK.mjs +77 -0
  208. package/dist/rsc-pipeline-YCDRJME4.cjs +77 -0
  209. package/dist/{runtime-DfU4sKa5.d.ts → runtime-CwiuozLd.d.ts} +1 -1
  210. package/dist/{runtime-wexvUN5J.d.mts → runtime-DDH4tiuF.d.mts} +1 -1
  211. package/dist/{schema-dev-notice-5JPE67AI.cjs → schema-dev-notice-77ZL23PL.cjs} +4 -4
  212. package/dist/{schema-dev-notice-WLPZ6WKU.mjs → schema-dev-notice-BLXOS6U2.mjs} +2 -2
  213. package/dist/server-plugins.d.mts +2 -2
  214. package/dist/server-plugins.d.ts +2 -2
  215. package/dist/server.cjs +56 -38
  216. package/dist/server.d.mts +15 -10
  217. package/dist/server.d.ts +15 -10
  218. package/dist/server.mjs +36 -18
  219. package/dist/{spa-router-DgsMXqfX.d.mts → spa-router-Br4qFCWf.d.mts} +8 -3
  220. package/dist/{spa-router-CcejECnG.d.ts → spa-router-BsWUKH73.d.ts} +8 -3
  221. package/dist/{ssg-1FGaFISl.d.ts → ssg-Csy2vwpi.d.ts} +2 -2
  222. package/dist/{ssg-Bg4bMMhM.d.mts → ssg-Donyfcxy.d.mts} +2 -2
  223. package/dist/testing.d.mts +1 -1
  224. package/dist/testing.d.ts +1 -1
  225. package/dist/{utils-Dxbh6Hgj.d.ts → utils-Luk72LXC.d.ts} +1 -1
  226. package/dist/{utils-8wtTYiH4.d.mts → utils-d_k1ZZw0.d.mts} +1 -1
  227. package/dist/version.cjs +2 -2
  228. package/dist/version.mjs +1 -1
  229. package/dist/vite.cjs +18 -12
  230. package/dist/vite.d.mts +6 -4
  231. package/dist/vite.d.ts +6 -4
  232. package/dist/vite.mjs +17 -11
  233. package/package.json +53 -1
  234. package/dist/{chunk-35WS7P2V.mjs → chunk-26CXZR6L.mjs} +3 -3
  235. package/dist/{chunk-QEILRWVV.cjs → chunk-3XEMGDBF.cjs} +2 -2
  236. package/dist/{chunk-BPOTSHDO.cjs → chunk-IOAUK4OI.cjs} +2 -2
  237. package/dist/{chunk-BYR3RQPB.mjs → chunk-T76H22WI.mjs} +4 -4
@@ -1,5 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
+
4
+ var _chunkCEDPEDNWcjs = require('./chunk-CEDPEDNW.cjs');
5
+
6
+
3
7
  var _chunkKEXK442Icjs = require('./chunk-KEXK442I.cjs');
4
8
 
5
9
 
@@ -26,19 +30,20 @@ var _chunkKEXK442Icjs = require('./chunk-KEXK442I.cjs');
26
30
 
27
31
 
28
32
 
33
+ var _chunkRACQTC7Kcjs = require('./chunk-RACQTC7K.cjs');
29
34
 
30
35
 
36
+ var _chunk45QJHGZMcjs = require('./chunk-45QJHGZM.cjs');
31
37
 
32
38
 
39
+ var _chunkLRJRXXQZcjs = require('./chunk-LRJRXXQZ.cjs');
33
40
 
34
- var _chunkROQ4C4LJcjs = require('./chunk-ROQ4C4LJ.cjs');
35
41
 
36
42
 
37
- var _chunk45QJHGZMcjs = require('./chunk-45QJHGZM.cjs');
43
+ var _chunk3XEMGDBFcjs = require('./chunk-3XEMGDBF.cjs');
38
44
 
39
45
 
40
46
 
41
- var _chunkQEILRWVVcjs = require('./chunk-QEILRWVV.cjs');
42
47
 
43
48
 
44
49
 
@@ -53,7 +58,7 @@ var _chunkQEILRWVVcjs = require('./chunk-QEILRWVV.cjs');
53
58
 
54
59
 
55
60
 
56
- var _chunkL6HYACBEcjs = require('./chunk-L6HYACBE.cjs');
61
+ var _chunkGVNCWSQVcjs = require('./chunk-GVNCWSQV.cjs');
57
62
 
58
63
 
59
64
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
@@ -75,7 +80,8 @@ var _chunkCY2ZQ5C6cjs = require('./chunk-CY2ZQ5C6.cjs');
75
80
  var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
76
81
 
77
82
 
78
- var _chunkJR4QCLJYcjs = require('./chunk-JR4QCLJY.cjs');
83
+
84
+ var _chunkPDU4P2ICcjs = require('./chunk-PDU4P2IC.cjs');
79
85
 
80
86
 
81
87
 
@@ -94,7 +100,7 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
94
100
 
95
101
 
96
102
 
97
- var _chunk3TB5QGUWcjs = require('./chunk-3TB5QGUW.cjs');
103
+ var _chunkJAXDRRRCcjs = require('./chunk-JAXDRRRC.cjs');
98
104
 
99
105
 
100
106
  var _chunkD5IHNDHIcjs = require('./chunk-D5IHNDHI.cjs');
@@ -212,7 +218,7 @@ var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
212
218
  var _chunk5NAVKJCZcjs = require('./chunk-5NAVKJCZ.cjs');
213
219
 
214
220
 
215
- var _chunkEH3464KFcjs = require('./chunk-EH3464KF.cjs');
221
+ var _chunkYBDSTNMHcjs = require('./chunk-YBDSTNMH.cjs');
216
222
 
217
223
 
218
224
  var _chunkS3A45T7Fcjs = require('./chunk-S3A45T7F.cjs');
@@ -245,12 +251,34 @@ var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
245
251
 
246
252
 
247
253
 
248
-
249
254
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
250
255
 
256
+ // src/form-actions-transform.ts
257
+ var _crypto = require('crypto');
258
+ var _compiler = require('@farm.js/islx/compiler');
259
+ var _path = require('path'); var path2 = _interopRequireWildcard(_path); var path5 = _interopRequireWildcard(_path); var path3 = _interopRequireWildcard(_path);
260
+ function transformFarmFormActionModule(options) {
261
+ const result = _compiler.transformActions.call(void 0, {
262
+ code: options.code,
263
+ id: options.id,
264
+ root: options.root,
265
+ environment: options.ssr ? "server" : "client",
266
+ parse: options.parse,
267
+ runtime: {
268
+ server: "@farm.js/core/internal/islx-server",
269
+ client: "@farm.js/core/internal/islx-client"
270
+ }
271
+ });
272
+ return result ? result.code : null;
273
+ }
274
+ _chunkS3JO3N4Hcjs.__name.call(void 0, transformFarmFormActionModule, "transformFarmFormActionModule");
275
+
276
+ // src/vite.ts
277
+ var _vite = require('vite');
278
+
251
279
  // src/dev-preview-guard.ts
252
280
  var _fs = require('fs'); var fs2 = _interopRequireWildcard(_fs); var fs = _interopRequireWildcard(_fs);
253
- var _path = require('path'); var path = _interopRequireWildcard(_path); var path4 = _interopRequireWildcard(_path); var path2 = _interopRequireWildcard(_path);
281
+
254
282
  var FARM_PREVIEW_REQUEST_HEADER = "x-farm-preview";
255
283
  function isFarmPreviewTunnelRequest(headers) {
256
284
  return headers[FARM_PREVIEW_REQUEST_HEADER] !== void 0;
@@ -266,10 +294,10 @@ var VITE_DEFAULT_FS_DENY = [
266
294
  ];
267
295
  function getFarmDevFsDeny(userDeny, options) {
268
296
  const deny = ["**/.farm/**"];
269
- const root = path.resolve(options.root || process.cwd());
270
- const distDir = options.distDir ? path.resolve(root, options.distDir) : void 0;
271
- const relativeDistDir = distDir ? path.relative(root, distDir) : "";
272
- if (distDir && relativeDistDir && relativeDistDir !== ".farm" && relativeDistDir !== ".." && !relativeDistDir.startsWith(`..${path.sep}`) && !/[*?[\]{}()!+@]/.test(distDir)) {
297
+ const root = path2.resolve(options.root || process.cwd());
298
+ const distDir = options.distDir ? path2.resolve(root, options.distDir) : void 0;
299
+ const relativeDistDir = distDir ? path2.relative(root, distDir) : "";
300
+ if (distDir && relativeDistDir && relativeDistDir !== ".farm" && relativeDistDir !== ".." && !relativeDistDir.startsWith(`..${path2.sep}`) && !/[*?[\]{}()!+@]/.test(distDir)) {
273
301
  deny.push(`${distDir.replace(/\\/g, "/")}/**`);
274
302
  }
275
303
  return userDeny ? deny : [...VITE_DEFAULT_FS_DENY, ...deny];
@@ -315,7 +343,7 @@ async function isAllowedPreviewRequest(server, options, req) {
315
343
  const inClientGraph = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => Boolean(await _optionalChain([client, 'optionalAccess', _3 => _3.moduleGraph, 'access', _4 => _4.getModuleByUrl, 'call', _5 => _5(url)])), "inClientGraph");
316
344
  if (SOURCE_QUERY_FLAGS.some((flag) => query.has(flag))) return inClientGraph();
317
345
  if (await inClientGraph()) return true;
318
- if (file.split(path.sep).includes("node_modules")) return true;
346
+ if (file.split(path2.sep).includes("node_modules")) return true;
319
347
  if (server.config.publicDir && isInside(await realpathOr(server.config.publicDir), file)) {
320
348
  return true;
321
349
  }
@@ -323,8 +351,8 @@ async function isAllowedPreviewRequest(server, options, req) {
323
351
  if (!isModuleOrAsset) return false;
324
352
  for (const source of options.getSourceRoots()) {
325
353
  const sourceRoot = await realpathOr(source.root);
326
- const sourceDir = await realpathOr(path.resolve(source.root, source.srcDir));
327
- if (sourceRoot === sourceDir && path.dirname(file) === sourceDir) continue;
354
+ const sourceDir = await realpathOr(path2.resolve(source.root, source.srcDir));
355
+ if (sourceRoot === sourceDir && path2.dirname(file) === sourceDir) continue;
328
356
  if (isInside(sourceDir, file)) return true;
329
357
  }
330
358
  return false;
@@ -343,9 +371,9 @@ async function resolveRequestedFile(server, pathname) {
343
371
  }
344
372
  const resolved = await _optionalChain([server, 'access', _6 => _6.environments, 'optionalAccess', _7 => _7.client, 'optionalAccess', _8 => _8.pluginContainer, 'access', _9 => _9.resolveId, 'call', _10 => _10(id, void 0)]);
345
373
  const resolvedId = _optionalChain([resolved, 'optionalAccess', _11 => _11.id, 'access', _12 => _12.replace, 'call', _13 => _13(/[?#].*$/, "")]);
346
- if (resolvedId && path.isAbsolute(resolvedId)) candidate = resolvedId;
374
+ if (resolvedId && path2.isAbsolute(resolvedId)) candidate = resolvedId;
347
375
  else if (_optionalChain([resolvedId, 'optionalAccess', _14 => _14.startsWith, 'call', _15 => _15("\0")])) return void 0;
348
- else if (id.startsWith("/")) candidate = path.join(server.config.root, id);
376
+ else if (id.startsWith("/")) candidate = path2.join(server.config.root, id);
349
377
  }
350
378
  if (!candidate) return void 0;
351
379
  try {
@@ -360,13 +388,13 @@ async function realpathOr(directory) {
360
388
  try {
361
389
  return await _fs.promises.realpath(directory);
362
390
  } catch (e4) {
363
- return path.resolve(directory);
391
+ return path2.resolve(directory);
364
392
  }
365
393
  }
366
394
  _chunkS3JO3N4Hcjs.__name.call(void 0, realpathOr, "realpathOr");
367
395
  function isInside(directory, file) {
368
- const relative2 = path.relative(directory, file);
369
- return relative2 !== "" && relative2 !== ".." && !relative2.startsWith(`..${path.sep}`) && !path.isAbsolute(relative2);
396
+ const relative2 = path2.relative(directory, file);
397
+ return relative2 !== "" && relative2 !== ".." && !relative2.startsWith(`..${path2.sep}`) && !path2.isAbsolute(relative2);
370
398
  }
371
399
  _chunkS3JO3N4Hcjs.__name.call(void 0, isInside, "isInside");
372
400
 
@@ -424,9 +452,9 @@ function devServableFileExists(pathname, baseDirs) {
424
452
  if (!relativePathname) return false;
425
453
  for (const baseDir of baseDirs) {
426
454
  if (typeof baseDir !== "string" || baseDir.length === 0) continue;
427
- const resolvedBase = path2.resolve(baseDir);
428
- const candidate = path2.resolve(resolvedBase, relativePathname);
429
- if (!candidate.startsWith(resolvedBase + path2.sep)) continue;
455
+ const resolvedBase = path3.resolve(baseDir);
456
+ const candidate = path3.resolve(resolvedBase, relativePathname);
457
+ if (!candidate.startsWith(resolvedBase + path3.sep)) continue;
430
458
  try {
431
459
  if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) {
432
460
  return true;
@@ -640,90 +668,6 @@ async function createBlurDataURL(bytes) {
640
668
  }
641
669
  _chunkS3JO3N4Hcjs.__name.call(void 0, createBlurDataURL, "createBlurDataURL");
642
670
 
643
- // src/react-refresh.ts
644
- var _module = require('module');
645
-
646
- var REACT_REFRESH_PLUGIN = "vite:react-refresh";
647
- var FARM_REACT_REFRESH_PREAMBLE_ID = "/@farm/react-refresh-preamble";
648
- var FARM_OWNED = /* @__PURE__ */ Symbol.for("farm.react-refresh.owned");
649
- function isFarmReactRefreshActive(config) {
650
- return config.command === "serve" && !config.isProduction && config.server.hmr !== false && config.plugins.some((plugin) => plugin.name === REACT_REFRESH_PLUGIN);
651
- }
652
- _chunkS3JO3N4Hcjs.__name.call(void 0, isFarmReactRefreshActive, "isFarmReactRefreshActive");
653
- function isFarmClientEntryId(id) {
654
- const pathname = id.split("?", 1)[0];
655
- return pathname === "/@farm/client" || pathname === "/@farm/client.js";
656
- }
657
- _chunkS3JO3N4Hcjs.__name.call(void 0, isFarmClientEntryId, "isFarmClientEntryId");
658
- function hasAppReactPlugin(plugins) {
659
- const pending = [..._nullishCoalesce(plugins, () => ( []))];
660
- while (pending.length > 0) {
661
- const entry = pending.pop();
662
- if (Array.isArray(entry)) {
663
- pending.push(...entry);
664
- continue;
665
- }
666
- if (!entry || typeof entry !== "object" || "then" in entry) continue;
667
- if (entry.name === REACT_REFRESH_PLUGIN && !(FARM_OWNED in entry)) return true;
668
- }
669
- return false;
670
- }
671
- _chunkS3JO3N4Hcjs.__name.call(void 0, hasAppReactPlugin, "hasAppReactPlugin");
672
- function createFarmReactRefreshPreamblePlugin() {
673
- let active = false;
674
- return {
675
- name: "farm:react-refresh-preamble",
676
- apply: "serve",
677
- configResolved(config) {
678
- active = isFarmReactRefreshActive(config);
679
- },
680
- resolveId(id) {
681
- if (id === FARM_REACT_REFRESH_PREAMBLE_ID) return id;
682
- },
683
- load(id) {
684
- if (id !== FARM_REACT_REFRESH_PREAMBLE_ID) return;
685
- if (!active) return "";
686
- return `import RefreshRuntime from "/@react-refresh";
687
- RefreshRuntime.injectIntoGlobalHook(window);
688
- window.$RefreshReg$ = () => {};
689
- window.$RefreshSig$ = () => (type) => type;
690
- window.__vite_plugin_react_preamble_installed__ = true;
691
- `;
692
- },
693
- transform(code, id) {
694
- if (!active || _optionalChain([this, 'access', _39 => _39.environment, 'optionalAccess', _40 => _40.config, 'access', _41 => _41.consumer]) !== "client" || !isFarmClientEntryId(id)) {
695
- return;
696
- }
697
- return {
698
- code: `import ${JSON.stringify(FARM_REACT_REFRESH_PREAMBLE_ID)};
699
- ${code}`,
700
- map: null
701
- };
702
- }
703
- };
704
- }
705
- _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmReactRefreshPreamblePlugin, "createFarmReactRefreshPreamblePlugin");
706
- async function createFarmReactRefreshPlugins() {
707
- const entry = _module.createRequire.call(void 0,
708
- typeof __filename === "string" ? __filename : _chunkS3JO3N4Hcjs.define_import_meta_default.url
709
- ).resolve("@vitejs/plugin-react");
710
- const { default: react } = await import(
711
- /* @vite-ignore */
712
- _url.pathToFileURL.call(void 0, entry).href
713
- );
714
- const plugins = react().map(
715
- (plugin) => Object.assign(
716
- {
717
- ...plugin,
718
- apply: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (config, env) => env.command === "serve" && !hasAppReactPlugin(config.plugins), "apply")
719
- },
720
- { [FARM_OWNED]: true }
721
- )
722
- );
723
- return [...plugins, createFarmReactRefreshPreamblePlugin()];
724
- }
725
- _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmReactRefreshPlugins, "createFarmReactRefreshPlugins");
726
-
727
671
  // src/navigation/page-data-error.ts
728
672
  function resolveFarmPageDataFailure(error) {
729
673
  if (_chunkOX6O6WVAcjs.isFarmNotFoundError.call(void 0, error)) {
@@ -768,14 +712,14 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
768
712
  // src/vite.ts
769
713
  var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
770
714
  function farmLlmsTxtGeneratedPaths(config) {
771
- const llms = _chunkD5IHNDHIcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _42 => _42.agent, 'optionalAccess', _43 => _43.llmsTxt]));
715
+ const llms = _chunkD5IHNDHIcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _39 => _39.agent, 'optionalAccess', _40 => _40.llmsTxt]));
772
716
  if (!llms.enabled) return [];
773
717
  return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
774
718
  }
775
719
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
776
720
  function farmAgentGeneratedPaths(config) {
777
- const crawlers = _chunk3TB5QGUWcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _44 => _44.agent, 'optionalAccess', _45 => _45.crawlers]));
778
- const sitemap = _chunk3TB5QGUWcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _46 => _46.agent, 'optionalAccess', _47 => _47.sitemap]));
721
+ const crawlers = _chunkJAXDRRRCcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _41 => _41.agent, 'optionalAccess', _42 => _42.crawlers]));
722
+ const sitemap = _chunkJAXDRRRCcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _43 => _43.agent, 'optionalAccess', _44 => _44.sitemap]));
779
723
  return [
780
724
  ...farmLlmsTxtGeneratedPaths(config),
781
725
  ...sitemap.enabled ? ["/sitemap.xml"] : [],
@@ -825,7 +769,7 @@ function loadFarmWorkflowsDevRuntime() {
825
769
  }
826
770
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
827
771
  function loadFarmDevtoolsSnapshotRuntime() {
828
- return import("./devtools-2YHAJYH6.cjs");
772
+ return import("./devtools-MLB3JJMC.cjs");
829
773
  }
830
774
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
831
775
  function loadFarmDevtoolsUIRuntime() {
@@ -841,7 +785,7 @@ function farmI18nClientBridgePlugin() {
841
785
  name: "farm:i18n-client-bridge",
842
786
  enforce: "pre",
843
787
  resolveId(id, _importer, options) {
844
- if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _48 => _48.ssr])) {
788
+ if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _45 => _45.ssr])) {
845
789
  return FARM_I18N_CLIENT_BRIDGE_ID;
846
790
  }
847
791
  return null;
@@ -866,7 +810,7 @@ function farmServerOnlyEntriesPlugin() {
866
810
  resolveId(id, importer, options) {
867
811
  if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
868
812
  const importedBy = importer ? ` (imported by ${importer})` : "";
869
- if (!_optionalChain([options, 'optionalAccess', _49 => _49.ssr])) {
813
+ if (!_optionalChain([options, 'optionalAccess', _46 => _46.ssr])) {
870
814
  this.error(
871
815
  `${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
872
816
  );
@@ -912,11 +856,11 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
912
856
  if (!snapshot) return "";
913
857
  const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
914
858
  if (snapshot.routing === "none") return runtime;
915
- return `${_chunkL6HYACBEcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
859
+ return `${_chunkGVNCWSQVcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
916
860
  }
917
861
  _chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
918
862
  function getPublicEnvDefine(config) {
919
- const publicEnv = _optionalChain([config, 'access', _50 => _50.env, 'optionalAccess', _51 => _51.public]);
863
+ const publicEnv = _optionalChain([config, 'access', _47 => _47.env, 'optionalAccess', _48 => _48.public]);
920
864
  if (!isResolvedEnvScope(publicEnv)) {
921
865
  return {};
922
866
  }
@@ -957,7 +901,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request)
957
901
  return;
958
902
  }
959
903
  if (res.headersSent) {
960
- _optionalChain([res, 'access', _52 => _52.destroy, 'optionalCall', _53 => _53(error instanceof Error ? error : new Error(String(error)))]);
904
+ _optionalChain([res, 'access', _49 => _49.destroy, 'optionalCall', _50 => _50(error instanceof Error ? error : new Error(String(error)))]);
961
905
  return;
962
906
  }
963
907
  res.statusCode = 500;
@@ -1056,7 +1000,7 @@ function interceptFarmDevPageResponse(options) {
1056
1000
  const originalWrite = res.write.bind(res);
1057
1001
  const originalEnd = res.end.bind(res);
1058
1002
  const originalWriteHead = res.writeHead.bind(res);
1059
- const originalFlushHeaders = _optionalChain([res, 'access', _54 => _54.flushHeaders, 'optionalAccess', _55 => _55.bind, 'call', _56 => _56(res)]);
1003
+ const originalFlushHeaders = _optionalChain([res, 'access', _51 => _51.flushHeaders, 'optionalAccess', _52 => _52.bind, 'call', _53 => _53(res)]);
1060
1004
  let afterResponseCalled = false;
1061
1005
  let interceptedEnd = false;
1062
1006
  const htmlChunks = [];
@@ -1096,7 +1040,7 @@ function interceptFarmDevPageResponse(options) {
1096
1040
  const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
1097
1041
  if (shouldBufferResponse) {
1098
1042
  const callback = args.find((arg) => typeof arg === "function");
1099
- _optionalChain([callback, 'optionalCall', _57 => _57()]);
1043
+ _optionalChain([callback, 'optionalCall', _54 => _54()]);
1100
1044
  return true;
1101
1045
  }
1102
1046
  const writeResult = originalWrite(chunk, ...args);
@@ -1211,14 +1155,14 @@ function getEnvDefines(config, configEnv) {
1211
1155
  _chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images))
1212
1156
  )
1213
1157
  };
1214
- if (_optionalChain([configEnv, 'optionalAccess', _58 => _58.isSsrBuild])) {
1158
+ if (_optionalChain([configEnv, 'optionalAccess', _55 => _55.isSsrBuild])) {
1215
1159
  defines.__FARM_ENV__ = JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
1216
1160
  }
1217
1161
  return defines;
1218
1162
  }
1219
1163
  _chunkS3JO3N4Hcjs.__name.call(void 0, getEnvDefines, "getEnvDefines");
1220
1164
  function getFarmAPIBaseURLDefine(config) {
1221
- const baseURL = _optionalChain([config, 'access', _59 => _59.api, 'optionalAccess', _60 => _60.baseURL]);
1165
+ const baseURL = _optionalChain([config, 'access', _56 => _56.api, 'optionalAccess', _57 => _57.baseURL]);
1222
1166
  return typeof baseURL === "string" && baseURL ? baseURL : _chunkS3A45T7Fcjs.DEFAULT_FARM_API_BASE_PATH;
1223
1167
  }
1224
1168
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAPIBaseURLDefine, "getFarmAPIBaseURLDefine");
@@ -1248,7 +1192,7 @@ function fileContainsProgrammaticPageRoute(file) {
1248
1192
  _chunkS3JO3N4Hcjs.__name.call(void 0, fileContainsProgrammaticPageRoute, "fileContainsProgrammaticPageRoute");
1249
1193
  function rewriteEarlySsrRelativeImports(options) {
1250
1194
  const cleanId = options.id.split("?", 1)[0];
1251
- if (!path4.isAbsolute(cleanId) || cleanId.replace(/\\/g, "/").includes("/node_modules/")) {
1195
+ if (!path5.isAbsolute(cleanId) || cleanId.replace(/\\/g, "/").includes("/node_modules/")) {
1252
1196
  return null;
1253
1197
  }
1254
1198
  const replacements = [];
@@ -1268,7 +1212,7 @@ function rewriteEarlySsrRelativeImports(options) {
1268
1212
  const suffixIndex = source.value.search(/[?#]/);
1269
1213
  const sourcePath = suffixIndex === -1 ? source.value : source.value.slice(0, suffixIndex);
1270
1214
  const suffix = suffixIndex === -1 ? "" : source.value.slice(suffixIndex);
1271
- const resolvedPath = path4.resolve(path4.dirname(cleanId), sourcePath);
1215
+ const resolvedPath = path5.resolve(path5.dirname(cleanId), sourcePath);
1272
1216
  replacements.push({
1273
1217
  start: source.start,
1274
1218
  end: source.end,
@@ -1299,7 +1243,8 @@ function transformIsolatedClientBoundaryModule(options) {
1299
1243
  const safeName = exportName.replace(/[^A-Za-z0-9_$]/g, "_");
1300
1244
  const wrapperName = `__farm_isolated_boundary_${safeName || "default"}__`;
1301
1245
  wrapperStatements.push(
1302
- `const ${wrapperName} = __farm_create_isolated_boundary__(__farm_isolated_react__, ${localName}, ${JSON.stringify(options.moduleReference)}, ${JSON.stringify(exportName)}, ${JSON.stringify(options.islandStrategy)});`
1246
+ // Islands mode renders through islx; the older isolated hydration keeps Farm's boundary.
1247
+ options.slots ? `const ${wrapperName} = __farm_islx_island__(${localName}, ${JSON.stringify(options.moduleReference)}, ${JSON.stringify(exportName)}, ${JSON.stringify(options.islandStrategy)});` : `const ${wrapperName} = __farm_create_isolated_boundary__(__farm_isolated_react__, ${localName}, ${JSON.stringify(options.moduleReference)}, ${JSON.stringify(exportName)}, ${JSON.stringify(options.islandStrategy)});`
1303
1248
  );
1304
1249
  wrapperStatements.push(
1305
1250
  isDefault ? `export default ${wrapperName};` : `export { ${wrapperName} as ${exportName} };`
@@ -1308,9 +1253,9 @@ function transformIsolatedClientBoundaryModule(options) {
1308
1253
  transformedExports++;
1309
1254
  }, "addWrapper");
1310
1255
  for (const node of body) {
1311
- if (_optionalChain([node, 'optionalAccess', _61 => _61.type]) === "ExportDefaultDeclaration" && node.declaration) {
1256
+ if (_optionalChain([node, 'optionalAccess', _58 => _58.type]) === "ExportDefaultDeclaration" && node.declaration) {
1312
1257
  const declaration2 = node.declaration;
1313
- if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _62 => _62.id, 'optionalAccess', _63 => _63.name])) {
1258
+ if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _59 => _59.id, 'optionalAccess', _60 => _60.name])) {
1314
1259
  replacements.push({
1315
1260
  start: node.start,
1316
1261
  end: node.end,
@@ -1328,14 +1273,14 @@ function transformIsolatedClientBoundaryModule(options) {
1328
1273
  }
1329
1274
  continue;
1330
1275
  }
1331
- if (_optionalChain([node, 'optionalAccess', _64 => _64.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
1276
+ if (_optionalChain([node, 'optionalAccess', _61 => _61.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
1332
1277
  const declaration = node.declaration;
1333
1278
  const declaredNames = [];
1334
- if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _65 => _65.id, 'optionalAccess', _66 => _66.name])) {
1279
+ if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _62 => _62.id, 'optionalAccess', _63 => _63.name])) {
1335
1280
  declaredNames.push(declaration.id.name);
1336
1281
  } else if (declaration.type === "VariableDeclaration") {
1337
1282
  for (const declarator of declaration.declarations || []) {
1338
- if (_optionalChain([declarator, 'access', _67 => _67.id, 'optionalAccess', _68 => _68.type]) === "Identifier") declaredNames.push(declarator.id.name);
1283
+ if (_optionalChain([declarator, 'access', _64 => _64.id, 'optionalAccess', _65 => _65.type]) === "Identifier") declaredNames.push(declarator.id.name);
1339
1284
  }
1340
1285
  }
1341
1286
  const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
@@ -1355,8 +1300,9 @@ function transformIsolatedClientBoundaryModule(options) {
1355
1300
  for (const replacement of replacements.sort((left, right) => right.start - left.start)) {
1356
1301
  output = output.slice(0, replacement.start) + replacement.code + output.slice(replacement.end);
1357
1302
  }
1358
- return `import * as __farm_isolated_react__ from "react";
1359
- import { createFarmIsolatedClientBoundary as __farm_create_isolated_boundary__ } from "@farm.js/core/internal/isolated-boundary";
1303
+ const runtimeImport = options.slots ? `import { createIsland as __farm_islx_island__ } from "@farm.js/core/internal/islx-react";` : `import * as __farm_isolated_react__ from "react";
1304
+ import { createFarmIsolatedClientBoundary as __farm_create_isolated_boundary__ } from "@farm.js/core/internal/isolated-boundary";`;
1305
+ return `${runtimeImport}
1360
1306
  ${output}
1361
1307
  ${wrapperStatements.join("\n")}
1362
1308
  export const __farm_client_boundary_originals__ = Object.freeze({ ${originalEntries.join(", ")} });
@@ -1399,7 +1345,7 @@ function warnClientBoundaryOnce(context, id, code, config) {
1399
1345
  } catch (e11) {
1400
1346
  return;
1401
1347
  }
1402
- const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _69 => _69.env, 'optionalAccess', _70 => _70.public]), () => ( {}))));
1348
+ const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _66 => _66.env, 'optionalAccess', _67 => _67.public]), () => ( {}))));
1403
1349
  const findings = analyzeClientBoundary(program, publicKeys);
1404
1350
  if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
1405
1351
  return;
@@ -1422,7 +1368,7 @@ function hasViteAlias(alias, find) {
1422
1368
  _chunkS3JO3N4Hcjs.__name.call(void 0, hasViteAlias, "hasViteAlias");
1423
1369
  function farmPlugin(options = {}, initialPluginManager) {
1424
1370
  const imageImports = farmImageImportsPlugin();
1425
- const fontImports = _chunkROQ4C4LJcjs.farmFontImportsPlugin.call(void 0, {
1371
+ const fontImports = _chunkRACQTC7Kcjs.farmFontImportsPlugin.call(void 0, {
1426
1372
  root: options.root,
1427
1373
  basePath: options.basePath,
1428
1374
  publicDir: options.publicDir
@@ -1452,14 +1398,14 @@ function farmPlugin(options = {}, initialPluginManager) {
1452
1398
  ].join(" ");
1453
1399
  console.log(log);
1454
1400
  }, "logUpdate");
1455
- const getProgrammaticClientRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _71 => _71.getRouteManager, 'call', _72 => _72(), 'access', _73 => _73.getProgrammaticClientRoutes, 'call', _74 => _74()]))), "getProgrammaticClientRoutes");
1401
+ const getProgrammaticClientRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _68 => _68.getRouteManager, 'call', _69 => _69(), 'access', _70 => _70.getProgrammaticClientRoutes, 'call', _71 => _71()]))), "getProgrammaticClientRoutes");
1456
1402
  return {
1457
1403
  name: "farm",
1458
1404
  api: { getProgrammaticClientRoutes },
1459
1405
  config(userConfig, configEnv) {
1460
1406
  isBuild = configEnv.command === "build";
1461
1407
  const layerAliases = _chunkWBKEZXWEcjs.getFarmLayerAliases.call(void 0, options.layers);
1462
- const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _75 => _75.resolve, 'optionalAccess', _76 => _76.alias]), "@") ? {} : _chunkROQ4C4LJcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir);
1408
+ const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _72 => _72.resolve, 'optionalAccess', _73 => _73.alias]), "@") ? {} : _chunkRACQTC7Kcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir);
1463
1409
  const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
1464
1410
  return {
1465
1411
  // Honor Farm's publicDir so the dev server serves the same static
@@ -1474,8 +1420,8 @@ function farmPlugin(options = {}, initialPluginManager) {
1474
1420
  },
1475
1421
  server: {
1476
1422
  fs: {
1477
- ...layerRoots.length ? { allow: [path4.resolve(options.root || process.cwd()), ...layerRoots] } : {},
1478
- deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _77 => _77.server, 'optionalAccess', _78 => _78.fs, 'optionalAccess', _79 => _79.deny]), options)
1423
+ ...layerRoots.length ? { allow: [path5.resolve(options.root || process.cwd()), ...layerRoots] } : {},
1424
+ deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _74 => _74.server, 'optionalAccess', _75 => _75.fs, 'optionalAccess', _76 => _76.deny]), options)
1479
1425
  }
1480
1426
  }
1481
1427
  };
@@ -1487,8 +1433,8 @@ function farmPlugin(options = {}, initialPluginManager) {
1487
1433
  serverFnTransformActive = config.plugins.some(
1488
1434
  (plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
1489
1435
  );
1490
- reactRefreshActive = isFarmReactRefreshActive(config);
1491
- if (_optionalChain([options, 'access', _80 => _80.experimental, 'optionalAccess', _81 => _81.serverActions]) === true && !serverFnTransformActive) {
1436
+ reactRefreshActive = _chunkCEDPEDNWcjs.isFarmReactRefreshActive.call(void 0, config);
1437
+ if (_optionalChain([options, 'access', _77 => _77.experimental, 'optionalAccess', _78 => _78.serverActions]) === true && !serverFnTransformActive) {
1492
1438
  _chunk5QIKR7RRcjs.logger.warn(
1493
1439
  "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."
1494
1440
  );
@@ -1497,7 +1443,7 @@ function farmPlugin(options = {}, initialPluginManager) {
1497
1443
  async configureServer(viteServer) {
1498
1444
  viteServer.middlewares.use(
1499
1445
  createFarmDevPreviewGuard(viteServer, {
1500
- getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _82 => _82.getConfig, 'call', _83 => _83()]), () => ( options))), "getSourceRoots")
1446
+ getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _79 => _79.getConfig, 'call', _80 => _80()]), () => ( options))), "getSourceRoots")
1501
1447
  })
1502
1448
  );
1503
1449
  if (typeof fontImports.configureServer === "function") {
@@ -1512,7 +1458,7 @@ function farmPlugin(options = {}, initialPluginManager) {
1512
1458
  } catch (e12) {
1513
1459
  }
1514
1460
  }, "emitPluginError");
1515
- farmApp = new (0, _chunkROQ4C4LJcjs.FarmApp)(
1461
+ farmApp = new (0, _chunkRACQTC7Kcjs.FarmApp)(
1516
1462
  {
1517
1463
  ...options,
1518
1464
  root: resolveDevelopmentRoot(options.root, server.config.root)
@@ -1522,10 +1468,10 @@ function farmPlugin(options = {}, initialPluginManager) {
1522
1468
  await farmApp.initialize();
1523
1469
  const farmConfig = farmApp.getConfig();
1524
1470
  let farmAppPackages;
1525
- if (_optionalChain([farmConfig, 'access', _84 => _84.agent, 'optionalAccess', _85 => _85.noindexPreviews])) {
1471
+ if (_optionalChain([farmConfig, 'access', _81 => _81.agent, 'optionalAccess', _82 => _82.noindexPreviews])) {
1526
1472
  server.middlewares.use((_req, res, next) => {
1527
1473
  if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
1528
- res.setHeader("X-Robots-Tag", _chunk3TB5QGUWcjs.FARM_PREVIEW_ROBOTS_TAG);
1474
+ res.setHeader("X-Robots-Tag", _chunkJAXDRRRCcjs.FARM_PREVIEW_ROBOTS_TAG);
1529
1475
  }
1530
1476
  next();
1531
1477
  });
@@ -1542,7 +1488,7 @@ function farmPlugin(options = {}, initialPluginManager) {
1542
1488
  validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
1543
1489
  // Vite owns this address. Unlike request.url, it cannot be replaced by
1544
1490
  // a caller-controlled Host header.
1545
- trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _86 => _86.resolvedUrls, 'optionalAccess', _87 => _87.local, 'access', _88 => _88[0]]), "trustedLocalOrigin"),
1491
+ trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _83 => _83.resolvedUrls, 'optionalAccess', _84 => _84.local, 'access', _85 => _85[0]]), "trustedLocalOrigin"),
1546
1492
  onError(error) {
1547
1493
  _chunk5QIKR7RRcjs.logger.error(
1548
1494
  `Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
@@ -1551,7 +1497,7 @@ function farmPlugin(options = {}, initialPluginManager) {
1551
1497
  });
1552
1498
  }
1553
1499
  const sourceRoots = _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, farmConfig);
1554
- server.watcher.add(sourceRoots.map((source) => path4.join(source.root, source.srcDir)));
1500
+ server.watcher.add(sourceRoots.map((source) => path5.join(source.root, source.srcDir)));
1555
1501
  if (farmConfig.i18n.enabled) {
1556
1502
  server.watcher.add(
1557
1503
  farmConfig.i18n.locales.map(
@@ -1562,15 +1508,15 @@ function farmPlugin(options = {}, initialPluginManager) {
1562
1508
  const workflowConfig = farmConfig.workflows;
1563
1509
  const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
1564
1510
  const getExtraRouteTypes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => [
1565
- ..._optionalChain([options, 'access', _89 => _89.openapi, 'optionalAccess', _90 => _90.enabled]) && options.openapi.route ? [options.openapi.route] : [],
1566
- ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _91 => _91.getFarmDocsRouteTypeEntries, 'call', _92 => _92(farmConfig.docs)]), () => ( []))
1511
+ ..._optionalChain([options, 'access', _86 => _86.openapi, 'optionalAccess', _87 => _87.enabled]) && options.openapi.route ? [options.openapi.route] : [],
1512
+ ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _88 => _88.getFarmDocsRouteTypeEntries, 'call', _89 => _89(farmConfig.docs)]), () => ( []))
1567
1513
  ], "getExtraRouteTypes");
1568
1514
  const appDirSlugs = sourceRoots.map(
1569
- (source) => path4.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
1515
+ (source) => path5.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
1570
1516
  );
1571
1517
  const generateTypeArtifacts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
1572
1518
  try {
1573
- const result = await _chunkQEILRWVVcjs.generateFarmTypeArtifacts.call(void 0, {
1519
+ const result = await _chunk3XEMGDBFcjs.generateFarmTypeArtifacts.call(void 0, {
1574
1520
  root: farmConfig.root,
1575
1521
  srcDir: farmConfig.srcDir,
1576
1522
  layers: farmConfig.layers,
@@ -1607,10 +1553,10 @@ function farmPlugin(options = {}, initialPluginManager) {
1607
1553
  }, "generateTypeArtifacts");
1608
1554
  await generateTypeArtifacts("startup");
1609
1555
  const srcDirSlugs = sourceRoots.map(
1610
- (source) => path4.join(source.root, source.srcDir).replace(/\\/g, "/")
1556
+ (source) => path5.join(source.root, source.srcDir).replace(/\\/g, "/")
1611
1557
  );
1612
1558
  const layerConfigFiles = new Set(
1613
- farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _93 => _93.configFile, 'optionalAccess', _94 => _94.replace, 'call', _95 => _95(/\\/g, "/")])).filter((file) => Boolean(file))
1559
+ farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _90 => _90.configFile, 'optionalAccess', _91 => _91.replace, 'call', _92 => _92(/\\/g, "/")])).filter((file) => Boolean(file))
1614
1560
  );
1615
1561
  const routeModuleExtensions = /* @__PURE__ */ new Set([
1616
1562
  ..._chunkPSV6XKPOcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
@@ -1689,7 +1635,7 @@ function farmPlugin(options = {}, initialPluginManager) {
1689
1635
  scheduleTypeArtifactGen(file, ev, typeArtifacts);
1690
1636
  }
1691
1637
  if (isI18nCatalogFile(file)) {
1692
- _optionalChain([farmApp, 'optionalAccess', _96 => _96.getI18nRuntime, 'call', _97 => _97(), 'access', _98 => _98.reload, 'call', _99 => _99(), 'access', _100 => _100.then, 'call', _101 => _101(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _102 => _102.catch, 'call', _103 => _103((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
1638
+ _optionalChain([farmApp, 'optionalAccess', _93 => _93.getI18nRuntime, 'call', _94 => _94(), 'access', _95 => _95.reload, 'call', _96 => _96(), 'access', _97 => _97.then, 'call', _98 => _98(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _99 => _99.catch, 'call', _100 => _100((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
1693
1639
  }
1694
1640
  const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
1695
1641
  if (isRouteRefreshEvent) {
@@ -1702,8 +1648,8 @@ function farmPlugin(options = {}, initialPluginManager) {
1702
1648
  const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
1703
1649
  pendingRouteRefreshIncludesMiddleware = false;
1704
1650
  Promise.all([
1705
- _optionalChain([refreshRouteDiscovery, 'optionalCall', _104 => _104(`${ev} ${file}`)]),
1706
- reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _105 => _105.reload, 'call', _106 => _106()]) : void 0
1651
+ _optionalChain([refreshRouteDiscovery, 'optionalCall', _101 => _101(`${ev} ${file}`)]),
1652
+ reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _102 => _102.reload, 'call', _103 => _103()]) : void 0
1707
1653
  ]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunk5QIKR7RRcjs.logger.warn(`Route refresh failed: ${error.message}`));
1708
1654
  }, 50);
1709
1655
  }
@@ -1755,7 +1701,7 @@ function farmPlugin(options = {}, initialPluginManager) {
1755
1701
  farmApp.getServerRenderer().setAPIRouteLookup((routePath) => apiRouteManager.getRoutes().has(routePath));
1756
1702
  let discoveredWorkflows = [];
1757
1703
  const hasWorkflowDirectory = workflowConfig.enabled && workflowConfig.dirs.some(
1758
- (dir) => fs2.existsSync(path4.isAbsolute(dir) ? dir : path4.join(farmConfig.root, dir))
1704
+ (dir) => fs2.existsSync(path5.isAbsolute(dir) ? dir : path5.join(farmConfig.root, dir))
1759
1705
  );
1760
1706
  if (hasWorkflowDirectory) {
1761
1707
  const { createFarmWorkflowRequestHandler, discoverFarmWorkflows } = await loadFarmWorkflowsDevRuntime();
@@ -1805,11 +1751,11 @@ function farmPlugin(options = {}, initialPluginManager) {
1805
1751
  });
1806
1752
  }
1807
1753
  }
1808
- if (_optionalChain([options, 'access', _107 => _107.openapi, 'optionalAccess', _108 => _108.enabled])) {
1754
+ if (_optionalChain([options, 'access', _104 => _104.openapi, 'optionalAccess', _105 => _105.enabled])) {
1809
1755
  const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
1810
1756
  openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
1811
1757
  mode: "development",
1812
- apiBaseURL: typeof _optionalChain([options, 'access', _109 => _109.api, 'optionalAccess', _110 => _110.baseURL]) === "string" ? options.api.baseURL : void 0
1758
+ apiBaseURL: typeof _optionalChain([options, 'access', _106 => _106.api, 'optionalAccess', _107 => _107.baseURL]) === "string" ? options.api.baseURL : void 0
1813
1759
  });
1814
1760
  const spec = await openAPIManager.generateSpec();
1815
1761
  reportOpenAPIDevGenerationResult(spec);
@@ -1838,7 +1784,7 @@ function farmPlugin(options = {}, initialPluginManager) {
1838
1784
  return _chunkAMDMVWMIcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
1839
1785
  }, "resolveDocsLayoutFonts");
1840
1786
  releaseDocsMCPServers();
1841
- const isFarmDocsPathGuarded = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (href) => _chunkL6HYACBEcjs.farmPathGuardCoversPage.call(void 0,
1787
+ const isFarmDocsPathGuarded = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (href) => _chunkGVNCWSQVcjs.farmPathGuardCoversPage.call(void 0,
1842
1788
  {
1843
1789
  config: farmConfig,
1844
1790
  middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
@@ -1851,19 +1797,19 @@ function farmPlugin(options = {}, initialPluginManager) {
1851
1797
  clientEntry: "/@farm/client.js",
1852
1798
  resolveLayoutFonts: resolveDocsLayoutFonts,
1853
1799
  fontStylesheetHref: "/@farm/fonts.css",
1854
- globalStylesheetHref: _chunkROQ4C4LJcjs.resolveDevGlobalStylesheetHref.call(void 0,
1800
+ globalStylesheetHref: _chunkRACQTC7Kcjs.resolveDevGlobalStylesheetHref.call(void 0,
1855
1801
  farmConfig.root,
1856
1802
  farmConfig.srcDir
1857
1803
  ),
1858
1804
  loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (specifier) => {
1859
1805
  const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
1860
- if (specifier === _optionalChain([farmConfig, 'access', _111 => _111.docs, 'access', _112 => _112.adapter, 'optionalAccess', _113 => _113.server]) && _optionalChain([resolved, 'optionalAccess', _114 => _114.id])) {
1806
+ if (specifier === _optionalChain([farmConfig, 'access', _108 => _108.docs, 'access', _109 => _109.adapter, 'optionalAccess', _110 => _110.server]) && _optionalChain([resolved, 'optionalAccess', _111 => _111.id])) {
1861
1807
  return import(
1862
1808
  /* @vite-ignore */
1863
1809
  _url.pathToFileURL.call(void 0, resolved.id).href
1864
1810
  );
1865
1811
  }
1866
- return _chunkPJ42JESYcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _115 => _115.id]), () => ( specifier)));
1812
+ return _chunkPJ42JESYcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _112 => _112.id]), () => ( specifier)));
1867
1813
  }, "loadModule"),
1868
1814
  registerMCPServer: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (mcpServer) => {
1869
1815
  const dispose = _chunk75RZHGLScjs.registerFarmMCPServer.call(void 0, mcpServer);
@@ -1881,21 +1827,21 @@ function farmPlugin(options = {}, initialPluginManager) {
1881
1827
  fontAssets: _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
1882
1828
  resolveLayoutFonts: resolveDocsLayoutFonts,
1883
1829
  fontStylesheetHref: "/@farm/fonts.css",
1884
- globalStylesheetHref: _chunkROQ4C4LJcjs.resolveDevGlobalStylesheetHref.call(void 0,
1830
+ globalStylesheetHref: _chunkRACQTC7Kcjs.resolveDevGlobalStylesheetHref.call(void 0,
1885
1831
  farmConfig.root,
1886
1832
  farmConfig.srcDir
1887
1833
  ),
1888
1834
  isPathGuarded: isFarmDocsPathGuarded
1889
1835
  }) : null;
1890
1836
  const wrapFarmDocsResponseWithLayouts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request, response) => {
1891
- if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _116 => _116.headers, 'access', _117 => _117.get, 'call', _118 => _118("content-type"), 'optionalAccess', _119 => _119.toLowerCase, 'call', _120 => _120(), 'access', _121 => _121.includes, 'call', _122 => _122("text/html")])) {
1837
+ if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _113 => _113.headers, 'access', _114 => _114.get, 'call', _115 => _115("content-type"), 'optionalAccess', _116 => _116.toLowerCase, 'call', _117 => _117(), 'access', _118 => _118.includes, 'call', _119 => _119("text/html")])) {
1892
1838
  return response;
1893
1839
  }
1894
1840
  const pathname = new URL(request.url).pathname;
1895
1841
  const matchedRoute = routeManager.matchRoute(pathname);
1896
1842
  const layoutEntries = matchedRoute.layouts.map((layout) => ({
1897
1843
  ...layout,
1898
- metadata: _chunkROQ4C4LJcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
1844
+ metadata: _chunkRACQTC7Kcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
1899
1845
  }));
1900
1846
  if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
1901
1847
  return response;
@@ -1909,7 +1855,7 @@ function farmPlugin(options = {}, initialPluginManager) {
1909
1855
  headers: response.headers
1910
1856
  });
1911
1857
  }
1912
- const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _123 => _123.getConfig, 'call', _124 => _124()]), () => ( options))).renderer);
1858
+ const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _120 => _120.getConfig, 'call', _121 => _121()]), () => ( options))).renderer);
1913
1859
  const [rendererRuntime, layoutModules] = await Promise.all([
1914
1860
  _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkPJ42JESYcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
1915
1861
  Promise.all(
@@ -1938,7 +1884,7 @@ function farmPlugin(options = {}, initialPluginManager) {
1938
1884
  ])
1939
1885
  );
1940
1886
  const inlineValue = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e"), "inlineValue");
1941
- const pageModulePath = _optionalChain([matchedRoute, 'access', _125 => _125.route, 'optionalAccess', _126 => _126.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
1887
+ const pageModulePath = _optionalChain([matchedRoute, 'access', _122 => _122.route, 'optionalAccess', _123 => _123.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
1942
1888
  const bootstrapScript = `<script>
1943
1889
  window.__FARM_PROPS__ = ${inlineValue({ params })};
1944
1890
  window.__FARM_ROUTE_SLOTS__ = [];
@@ -2034,7 +1980,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2034
1980
  }, "dispatch")
2035
1981
  },
2036
1982
  (request) => {
2037
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _127 => _127.getConfig, 'call', _128 => _128()]), () => ( options));
1983
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _124 => _124.getConfig, 'call', _125 => _125()]), () => ( options));
2038
1984
  const currentServerConfig = _chunk5NAVKJCZcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
2039
1985
  return _chunkZTP3BJG6cjs.resolveFarmRequestURL.call(void 0, request, {
2040
1986
  trustProxy: currentServerConfig.trustProxy
@@ -2045,7 +1991,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2045
1991
  withAPIRequestTracing(async (req, res, next) => {
2046
1992
  const requestUrl = req.url || "/";
2047
1993
  const requestMethod = req.method || "GET";
2048
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _129 => _129.getConfig, 'call', _130 => _130()]), () => ( options));
1994
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _126 => _126.getConfig, 'call', _127 => _127()]), () => ( options));
2049
1995
  const currentServerConfig = _chunk5NAVKJCZcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
2050
1996
  const parsedRequestUrl = _chunkZTP3BJG6cjs.resolveFarmRequestURL.call(void 0, req, {
2051
1997
  trustProxy: currentServerConfig.trustProxy
@@ -2113,7 +2059,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2113
2059
  openapi: options.openapi
2114
2060
  },
2115
2061
  workflows: discoveredWorkflows,
2116
- plugins: _optionalChain([pm, 'optionalAccess', _131 => _131.getSortedPlugins, 'call', _132 => _132()])
2062
+ plugins: _optionalChain([pm, 'optionalAccess', _128 => _128.getSortedPlugins, 'call', _129 => _129()])
2117
2063
  });
2118
2064
  res.statusCode = 200;
2119
2065
  res.setHeader(
@@ -2136,7 +2082,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2136
2082
  return;
2137
2083
  }
2138
2084
  const runAppMiddlewareForContentRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
2139
- if (!_optionalChain([middlewareManager, 'optionalAccess', _133 => _133.hasMiddleware, 'call', _134 => _134()])) return false;
2085
+ if (!_optionalChain([middlewareManager, 'optionalAccess', _130 => _130.hasMiddleware, 'call', _131 => _131()])) return false;
2140
2086
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
2141
2087
  return runFarmMiddlewareWithNavigation(
2142
2088
  farmApp.getServerRenderer(),
@@ -2151,11 +2097,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2151
2097
  computed
2152
2098
  } = {}) => {
2153
2099
  const discard = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
2154
- await _optionalChain([computed, 'optionalAccess', _135 => _135.body, 'optionalAccess', _136 => _136.cancel, 'call', _137 => _137(), 'access', _138 => _138.catch, 'call', _139 => _139(() => {
2100
+ await _optionalChain([computed, 'optionalAccess', _132 => _132.body, 'optionalAccess', _133 => _133.cancel, 'call', _134 => _134(), 'access', _135 => _135.catch, 'call', _136 => _136(() => {
2155
2101
  })]);
2156
2102
  }, "discard");
2157
2103
  let runtimeSession2;
2158
- if (_optionalChain([pm, 'optionalAccess', _140 => _140.hasRuntimeRequestHooks, 'call', _141 => _141()])) {
2104
+ if (_optionalChain([pm, 'optionalAccess', _137 => _137.hasRuntimeRequestHooks, 'call', _138 => _138()])) {
2159
2105
  try {
2160
2106
  runtimeSession2 = await pm.beginRuntimeRequest(
2161
2107
  createRequestFromNodeRequest(req, new URL(fullUrl)),
@@ -2187,7 +2133,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2187
2133
  let response;
2188
2134
  try {
2189
2135
  response = await respond(
2190
- _nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _142 => _142.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
2136
+ _nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _139 => _139.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
2191
2137
  );
2192
2138
  } catch (error) {
2193
2139
  if (runtimeSession2) await pm.failRuntimeRequest(runtimeSession2, error);
@@ -2200,7 +2146,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2200
2146
  );
2201
2147
  }, "serveBuiltInRoute");
2202
2148
  const openAPIRequestPathname = openAPIManager ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
2203
- if (openAPIManager && _optionalChain([options, 'access', _143 => _143.openapi, 'optionalAccess', _144 => _144.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
2149
+ if (openAPIManager && _optionalChain([options, 'access', _140 => _140.openapi, 'optionalAccess', _141 => _141.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
2204
2150
  const specManager = openAPIManager;
2205
2151
  await serveBuiltInRoute(async () => {
2206
2152
  if (requestMethod !== "GET" && requestMethod !== "HEAD") {
@@ -2220,7 +2166,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2220
2166
  });
2221
2167
  return;
2222
2168
  }
2223
- if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _145 => _145.openapi, 'optionalAccess', _146 => _146.route])) {
2169
+ if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _142 => _142.openapi, 'optionalAccess', _143 => _143.route])) {
2224
2170
  const docsManager = openAPIManager;
2225
2171
  await serveBuiltInRoute(
2226
2172
  async () => {
@@ -2231,33 +2177,29 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2231
2177
  );
2232
2178
  return;
2233
2179
  }
2234
- if (_optionalChain([options, 'access', _147 => _147.agent, 'optionalAccess', _148 => _148.manifest]) !== false && _chunkL6HYACBEcjs.isFarmAppManifestPath.call(void 0, _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
2180
+ if (_optionalChain([options, 'access', _144 => _144.agent, 'optionalAccess', _145 => _145.manifest]) !== false && _chunkGVNCWSQVcjs.isFarmAppManifestPath.call(void 0, _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
2235
2181
  await serveBuiltInRoute(async () => {
2236
- _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkROQ4C4LJcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
2237
- const header = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (name) => String(_nullishCoalesce(req.headers[name], () => ( ""))), "header");
2238
- const manifest = await _chunkL6HYACBEcjs.createFarmAppManifestResponse.call(void 0,
2182
+ _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkRACQTC7Kcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
2183
+ const manifest = await _chunkGVNCWSQVcjs.createFarmAppManifestResponse.call(void 0,
2239
2184
  new Request(parsedRequestUrl, {
2240
2185
  method: requestMethod,
2241
- headers: {
2242
- "if-none-match": header("if-none-match"),
2243
- [_chunkL6HYACBEcjs.FARM_INFRA_SIGNATURE_HEADER]: header(_chunkL6HYACBEcjs.FARM_INFRA_SIGNATURE_HEADER)
2244
- }
2186
+ headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
2245
2187
  }),
2246
2188
  {
2247
- ..._chunkL6HYACBEcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
2189
+ ..._chunkGVNCWSQVcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
2248
2190
  build: "development",
2249
2191
  packages: farmAppPackages,
2250
2192
  // Read again on each request; unchanged files come from a cache.
2251
- webmcpTools: _optionalChain([farmConfig, 'access', _149 => _149.plugins, 'optionalAccess', _150 => _150.some, 'call', _151 => _151(({ name }) => name === "farm:webmcp")]) ? _chunkROQ4C4LJcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
2193
+ webmcpTools: _optionalChain([farmConfig, 'access', _146 => _146.plugins, 'optionalAccess', _147 => _147.some, 'call', _148 => _148(({ name }) => name === "farm:webmcp")]) ? _chunkRACQTC7Kcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
2252
2194
  }),
2253
2195
  defaultMCP: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => farmApp.getServerRenderer().getDefaultMCPServer(), "defaultMCP"),
2254
2196
  // A guard written for an MCP server's path keeps its tools out of the public view.
2255
- guardCoversPath: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (path5) => _chunkL6HYACBEcjs.farmPathGuardCoversEndpoint.call(void 0,
2197
+ guardCoversPath: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (path6) => _chunkGVNCWSQVcjs.farmPathGuardCoversEndpoint.call(void 0,
2256
2198
  {
2257
2199
  config: farmConfig,
2258
2200
  middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
2259
2201
  },
2260
- path5,
2202
+ path6,
2261
2203
  apiServerBasePath
2262
2204
  ), "guardCoversPath")
2263
2205
  }
@@ -2266,11 +2208,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2266
2208
  });
2267
2209
  return;
2268
2210
  }
2269
- if (_optionalChain([options, 'access', _152 => _152.agent, 'optionalAccess', _153 => _153.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkL6HYACBEcjs.FARM_API_CATALOG_PATH) {
2211
+ if (_optionalChain([options, 'access', _149 => _149.agent, 'optionalAccess', _150 => _150.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkGVNCWSQVcjs.FARM_API_CATALOG_PATH) {
2270
2212
  await serveBuiltInRoute(
2271
- () => _chunkL6HYACBEcjs.createFarmApiCatalogResponse.call(void 0,
2213
+ () => _chunkGVNCWSQVcjs.createFarmApiCatalogResponse.call(void 0,
2272
2214
  requestMethod,
2273
- _chunkL6HYACBEcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
2215
+ _chunkGVNCWSQVcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
2274
2216
  new Request(parsedRequestUrl, {
2275
2217
  headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
2276
2218
  })
@@ -2278,8 +2220,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2278
2220
  );
2279
2221
  return;
2280
2222
  }
2281
- if (_optionalChain([options, 'access', _154 => _154.agent, 'optionalAccess', _155 => _155.aiCatalog]) !== false) {
2282
- const aiCatalog = _chunkL6HYACBEcjs.createFarmAiCatalogResponse.call(void 0,
2223
+ if (_optionalChain([options, 'access', _151 => _151.agent, 'optionalAccess', _152 => _152.aiCatalog]) !== false) {
2224
+ const aiCatalog = _chunkGVNCWSQVcjs.createFarmAiCatalogResponse.call(void 0,
2283
2225
  new Request(parsedRequestUrl, {
2284
2226
  method: requestMethod,
2285
2227
  headers: {
@@ -2333,7 +2275,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2333
2275
  config: farmApp.getConfig().mdx,
2334
2276
  resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
2335
2277
  const match = farmApp.getRouteManager().matchRoute(pathname2);
2336
- const sourcePath = _optionalChain([match, 'access', _156 => _156.route, 'optionalAccess', _157 => _157.markdownSourcePath]) || (match.route && _chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
2278
+ const sourcePath = _optionalChain([match, 'access', _153 => _153.route, 'optionalAccess', _154 => _154.markdownSourcePath]) || (match.route && _chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
2337
2279
  if (!sourcePath) {
2338
2280
  return null;
2339
2281
  }
@@ -2469,7 +2411,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2469
2411
  "beforeRequest",
2470
2412
  (plugin) => {
2471
2413
  const owner = _chunkRHGK2JENcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
2472
- return plugin.name !== _chunkNFG4PUPIcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _158 => _158.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
2414
+ return plugin.name !== _chunkNFG4PUPIcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _155 => _155.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
2473
2415
  },
2474
2416
  req,
2475
2417
  res
@@ -2505,7 +2447,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2505
2447
  isProd: false
2506
2448
  },
2507
2449
  request,
2508
- { clientAddress: _optionalChain([req, 'access', _159 => _159.socket, 'optionalAccess', _160 => _160.remoteAddress]) }
2450
+ { clientAddress: _optionalChain([req, 'access', _156 => _156.socket, 'optionalAccess', _157 => _157.remoteAddress]) }
2509
2451
  );
2510
2452
  if (!result) {
2511
2453
  throw new Error(`Matched integration route did not return a response`);
@@ -2600,7 +2542,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2600
2542
  const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
2601
2543
  const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
2602
2544
  if (apiHandler && hasExplicitAPIRoute) {
2603
- const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _161 => _161.route, 'access', _162 => _162.path]) || _optionalChain([apiRouteManager, 'access', _163 => _163.matchRoute, 'call', _164 => _164(pathname2), 'optionalAccess', _165 => _165.route, 'access', _166 => _166.path]) || urlPath2;
2545
+ const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _158 => _158.route, 'access', _159 => _159.path]) || _optionalChain([apiRouteManager, 'access', _160 => _160.matchRoute, 'call', _161 => _161(pathname2), 'optionalAccess', _162 => _162.route, 'access', _163 => _163.path]) || urlPath2;
2604
2546
  _chunkGS3WR5HXcjs.emitFarmEvent.call(void 0, {
2605
2547
  type: "route.matched",
2606
2548
  pathname: pathname2,
@@ -2690,7 +2632,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2690
2632
  return;
2691
2633
  }
2692
2634
  }
2693
- if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _167 => _167.isFarmDocsAPIRequest, 'call', _168 => _168(pathname2)])) {
2635
+ if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _164 => _164.isFarmDocsAPIRequest, 'call', _165 => _165(pathname2)])) {
2694
2636
  try {
2695
2637
  const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
2696
2638
  const headers = new Headers();
@@ -2763,18 +2705,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2763
2705
  res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
2764
2706
  return;
2765
2707
  }
2766
- if (_optionalChain([req, 'access', _169 => _169.url, 'optionalAccess', _170 => _170.startsWith, 'call', _171 => _171("/@")]) || _optionalChain([req, 'access', _172 => _172.url, 'optionalAccess', _173 => _173.startsWith, 'call', _174 => _174("/node_modules")])) {
2708
+ if (_optionalChain([req, 'access', _166 => _166.url, 'optionalAccess', _167 => _167.startsWith, 'call', _168 => _168("/@")]) || _optionalChain([req, 'access', _169 => _169.url, 'optionalAccess', _170 => _170.startsWith, 'call', _171 => _171("/node_modules")])) {
2767
2709
  return next();
2768
2710
  }
2769
2711
  if (shouldBypassFarmRouterForDottedPath(
2770
2712
  requestPathname,
2771
- _optionalChain([farmApp, 'optionalAccess', _175 => _175.getRouteManager, 'call', _176 => _176()]),
2713
+ _optionalChain([farmApp, 'optionalAccess', _172 => _172.getRouteManager, 'call', _173 => _173()]),
2772
2714
  [server.config.publicDir, server.config.root],
2773
2715
  farmAgentGeneratedPaths(farmConfig)
2774
2716
  )) {
2775
2717
  return next();
2776
2718
  }
2777
- if (_optionalChain([req, 'access', _177 => _177.url, 'optionalAccess', _178 => _178.startsWith, 'call', _179 => _179("/__farm/page-data")])) {
2719
+ if (_optionalChain([req, 'access', _174 => _174.url, 'optionalAccess', _175 => _175.startsWith, 'call', _176 => _176("/__farm/page-data")])) {
2778
2720
  const urlObj = parsedRequestUrl;
2779
2721
  const targetPath = urlObj.searchParams.get("path") || "/";
2780
2722
  try {
@@ -2802,7 +2744,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2802
2744
  });
2803
2745
  let middlewareMap = /* @__PURE__ */ new Map();
2804
2746
  let middlewareContext = /* @__PURE__ */ new Map();
2805
- if (_optionalChain([middlewareManager, 'optionalAccess', _180 => _180.hasMiddleware, 'call', _181 => _181()])) {
2747
+ if (_optionalChain([middlewareManager, 'optionalAccess', _177 => _177.hasMiddleware, 'call', _178 => _178()])) {
2806
2748
  const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
2807
2749
  const handled = await runFarmMiddlewareWithNavigation(
2808
2750
  farmApp.getServerRenderer(),
@@ -2830,10 +2772,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2830
2772
  if (pm) {
2831
2773
  await pm.runHookParallel("afterRouteMatch", {
2832
2774
  pathname: targetPath,
2833
- matched: !!_optionalChain([match, 'optionalAccess', _182 => _182.route]),
2834
- routePattern: _optionalChain([match, 'optionalAccess', _183 => _183.route, 'optionalAccess', _184 => _184.pattern]) || null,
2835
- params: _optionalChain([match, 'optionalAccess', _185 => _185.params]) || {},
2836
- layoutPatterns: (_optionalChain([match, 'optionalAccess', _186 => _186.layouts]) || []).map((l) => l.pattern)
2775
+ matched: !!_optionalChain([match, 'optionalAccess', _179 => _179.route]),
2776
+ routePattern: _optionalChain([match, 'optionalAccess', _180 => _180.route, 'optionalAccess', _181 => _181.pattern]) || null,
2777
+ params: _optionalChain([match, 'optionalAccess', _182 => _182.params]) || {},
2778
+ layoutPatterns: (_optionalChain([match, 'optionalAccess', _183 => _183.layouts]) || []).map((l) => l.pattern)
2837
2779
  });
2838
2780
  }
2839
2781
  if (!match) {
@@ -2856,7 +2798,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2856
2798
  );
2857
2799
  const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
2858
2800
  const navigationManifest = routeManager3.generateClientManifest(server.config.root);
2859
- const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkROQ4C4LJcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
2801
+ const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkRACQTC7Kcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
2860
2802
  const isClientComponent = moduleMetadata.isClientComponent;
2861
2803
  const shouldHydrate = moduleMetadata.shouldHydrate;
2862
2804
  let mergedMetadata = {};
@@ -2864,7 +2806,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2864
2806
  layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
2865
2807
  );
2866
2808
  const layoutHydrationMetadata = layouts.map(
2867
- (layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkROQ4C4LJcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
2809
+ (layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkRACQTC7Kcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
2868
2810
  );
2869
2811
  const shouldHydrateLayout = layoutHydrationMetadata.some(
2870
2812
  (metadata) => metadata.shouldHydrate
@@ -2928,7 +2870,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2928
2870
  const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
2929
2871
  const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
2930
2872
  (entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
2931
- ), () => ( _chunkROQ4C4LJcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
2873
+ ), () => ( _chunkRACQTC7Kcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
2932
2874
  const slotContext = await _chunk6QQDAAAZcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
2933
2875
  request: targetRequest,
2934
2876
  params: slot.params,
@@ -2974,15 +2916,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2974
2916
  );
2975
2917
  const projectRoot = server.config.root;
2976
2918
  const toUrlPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (absolutePath) => _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, absolutePath, projectRoot), "toUrlPath");
2977
- const renderPlan = _chunkROQ4C4LJcjs.createFarmRouteRenderPlan.call(void 0, {
2919
+ const renderPlan = _chunkGVNCWSQVcjs.createFarmRouteRenderPlan.call(void 0, {
2978
2920
  pageShouldHydrate: shouldHydrate,
2979
2921
  layoutShouldHydrate: shouldHydrateLayout,
2980
2922
  islandStrategy: hydrationIslandStrategy,
2981
- rendering: _chunkQEILRWVVcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
2923
+ rendering: _chunk3XEMGDBFcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
2982
2924
  });
2983
2925
  const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
2984
- const layoutStartIndex = _chunkROQ4C4LJcjs.getSharedLayoutPrefixLength.call(void 0,
2985
- _chunkROQ4C4LJcjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
2926
+ const layoutStartIndex = _chunkGVNCWSQVcjs.getSharedLayoutPrefixLength.call(void 0,
2927
+ _chunkGVNCWSQVcjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
2986
2928
  destinationLayoutPatterns
2987
2929
  );
2988
2930
  const renderer = farmApp.getServerRenderer();
@@ -2992,7 +2934,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2992
2934
  middlewareContext,
2993
2935
  () => renderer.renderNavigationFragment({
2994
2936
  PageComponent: routeModule.default,
2995
- LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _187 => _187.default]),
2937
+ LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _184 => _184.default]),
2996
2938
  pageProps: routeProps,
2997
2939
  params,
2998
2940
  layouts: layouts.map((layout, index) => ({
@@ -3063,7 +3005,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3063
3005
  {
3064
3006
  status: 200,
3065
3007
  headers: {
3066
- "Cache-Control": _chunkROQ4C4LJcjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
3008
+ "Cache-Control": _chunkGVNCWSQVcjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
3067
3009
  "X-Farm-Navigation": "html-fragment",
3068
3010
  Vary: "X-Farm-Layout-Chain",
3069
3011
  [_chunkC5GUTBZKcjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
@@ -3100,14 +3042,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3100
3042
  trustProxy: currentServerConfig.trustProxy
3101
3043
  }).pathname;
3102
3044
  const routeManager2 = farmApp.getRouteManager();
3103
- const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _188 => _188.hasHook, 'call', _189 => _189("beforeRouteMatch")]), () => ( false));
3104
- const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _190 => _190.hasHook, 'call', _191 => _191("afterRouteMatch")]), () => ( false));
3105
- const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _192 => _192.hasHook, 'call', _193 => _193("beforeRequest")]), () => ( false));
3106
- const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _194 => _194.hasHook, 'call', _195 => _195("beforeRender")]), () => ( false));
3107
- const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _196 => _196.hasHook, 'call', _197 => _197("afterResponse")]), () => ( false));
3108
- const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _198 => _198.hasHook, 'call', _199 => _199("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _200 => _200.hasHook, 'call', _201 => _201("afterRender")]), () => ( false)));
3109
- const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _202 => _202.hasRuntimeRequestHooks, 'call', _203 => _203()]), () => ( false));
3110
- const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _204 => _204.hasRuntimeHook, 'call', _205 => _205("after")]), () => ( false));
3045
+ const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _185 => _185.hasHook, 'call', _186 => _186("beforeRouteMatch")]), () => ( false));
3046
+ const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _187 => _187.hasHook, 'call', _188 => _188("afterRouteMatch")]), () => ( false));
3047
+ const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _189 => _189.hasHook, 'call', _190 => _190("beforeRequest")]), () => ( false));
3048
+ const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _191 => _191.hasHook, 'call', _192 => _192("beforeRender")]), () => ( false));
3049
+ const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _193 => _193.hasHook, 'call', _194 => _194("afterResponse")]), () => ( false));
3050
+ const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _195 => _195.hasHook, 'call', _196 => _196("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _197 => _197.hasHook, 'call', _198 => _198("afterRender")]), () => ( false)));
3051
+ const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _199 => _199.hasRuntimeRequestHooks, 'call', _200 => _200()]), () => ( false));
3052
+ const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _201 => _201.hasRuntimeHook, 'call', _202 => _202("after")]), () => ( false));
3111
3053
  const requestedMatch = routeManager2.matchRoute(requestedPathname);
3112
3054
  let runtimeSession;
3113
3055
  if (pm && hasRuntimeRequestHooks) {
@@ -3118,8 +3060,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3118
3060
  kind: "page",
3119
3061
  route: {
3120
3062
  pathname: requestedPathname,
3121
- pattern: _optionalChain([requestedMatch, 'optionalAccess', _206 => _206.route, 'optionalAccess', _207 => _207.pattern]) || null,
3122
- params: _optionalChain([requestedMatch, 'optionalAccess', _208 => _208.params]) || {}
3063
+ pattern: _optionalChain([requestedMatch, 'optionalAccess', _203 => _203.route, 'optionalAccess', _204 => _204.pattern]) || null,
3064
+ params: _optionalChain([requestedMatch, 'optionalAccess', _205 => _205.params]) || {}
3123
3065
  }
3124
3066
  }
3125
3067
  );
@@ -3152,17 +3094,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3152
3094
  if (pm && hasAfterRouteMatchHook) {
3153
3095
  await pm.runHookParallel("afterRouteMatch", {
3154
3096
  pathname,
3155
- matched: !!_optionalChain([routeMatch, 'optionalAccess', _209 => _209.route]),
3156
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _210 => _210.route, 'optionalAccess', _211 => _211.pattern]) || null,
3157
- params: _optionalChain([routeMatch, 'optionalAccess', _212 => _212.params]) || {},
3158
- layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _213 => _213.layouts]) || []).map((l) => l.pattern)
3097
+ matched: !!_optionalChain([routeMatch, 'optionalAccess', _206 => _206.route]),
3098
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _207 => _207.route, 'optionalAccess', _208 => _208.pattern]) || null,
3099
+ params: _optionalChain([routeMatch, 'optionalAccess', _209 => _209.params]) || {},
3100
+ layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _210 => _210.layouts]) || []).map((l) => l.pattern)
3159
3101
  });
3160
3102
  }
3161
3103
  const renderPayload = {
3162
3104
  pathname,
3163
3105
  method,
3164
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _214 => _214.route, 'optionalAccess', _215 => _215.pattern]) || null,
3165
- params: _optionalChain([routeMatch, 'optionalAccess', _216 => _216.params]) || {}
3106
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _211 => _211.route, 'optionalAccess', _212 => _212.pattern]) || null,
3107
+ params: _optionalChain([routeMatch, 'optionalAccess', _213 => _213.params]) || {}
3166
3108
  };
3167
3109
  const shouldInterceptResponse = Boolean(
3168
3110
  pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
@@ -3184,7 +3126,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3184
3126
  emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
3185
3127
  }) : void 0;
3186
3128
  try {
3187
- if (_optionalChain([middlewareManager, 'optionalAccess', _217 => _217.hasMiddleware, 'call', _218 => _218()])) {
3129
+ if (_optionalChain([middlewareManager, 'optionalAccess', _214 => _214.hasMiddleware, 'call', _215 => _215()])) {
3188
3130
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
3189
3131
  const handled = await runFarmMiddlewareWithNavigation(
3190
3132
  farmApp.getServerRenderer(),
@@ -3194,7 +3136,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3194
3136
  () => middlewareManager.execute(req, res)
3195
3137
  );
3196
3138
  if (handled) {
3197
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _219 => _219.isEnded, 'call', _220 => _220()])) {
3139
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _216 => _216.isEnded, 'call', _217 => _217()])) {
3198
3140
  const duration = Date.now() - startTime;
3199
3141
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
3200
3142
  }
@@ -3207,14 +3149,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3207
3149
  req.url || "/",
3208
3150
  `http://${req.headers.host || "localhost:3000"}`
3209
3151
  ).pathname;
3210
- const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _221 => _221.matchRoute, 'call', _222 => _222(currentPathname), 'optionalAccess', _223 => _223.route]));
3152
+ const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _218 => _218.matchRoute, 'call', _219 => _219(currentPathname), 'optionalAccess', _220 => _220.route]));
3211
3153
  await pm.runHookParallelFiltered(
3212
3154
  "beforeRequest",
3213
3155
  (plugin) => !hasLocalPageRoute || plugin.name !== _chunkNFG4PUPIcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
3214
3156
  req,
3215
3157
  res
3216
3158
  );
3217
- if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access', _224 => _224.url, 'optionalAccess', _225 => _225.startsWith, 'call', _226 => _226("/")]) && !res.writableEnded) {
3159
+ if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access', _221 => _221.url, 'optionalAccess', _222 => _222.startsWith, 'call', _223 => _223("/")]) && !res.writableEnded) {
3218
3160
  const destinationUrl = new URL(req.url, fullUrl);
3219
3161
  const destinationMatch = routeManager2.matchRoute(destinationUrl.pathname);
3220
3162
  const guarded = await pm.runRuntimeBeforeForRewrite(
@@ -3224,8 +3166,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3224
3166
  kind: "page",
3225
3167
  route: {
3226
3168
  pathname: destinationUrl.pathname,
3227
- pattern: _optionalChain([destinationMatch, 'optionalAccess', _227 => _227.route, 'optionalAccess', _228 => _228.pattern]) || null,
3228
- params: _optionalChain([destinationMatch, 'optionalAccess', _229 => _229.params]) || {}
3169
+ pattern: _optionalChain([destinationMatch, 'optionalAccess', _224 => _224.route, 'optionalAccess', _225 => _225.pattern]) || null,
3170
+ params: _optionalChain([destinationMatch, 'optionalAccess', _226 => _226.params]) || {}
3229
3171
  }
3230
3172
  }
3231
3173
  );
@@ -3237,8 +3179,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3237
3179
  }
3238
3180
  }
3239
3181
  }
3240
- if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _230 => _230.isEnded, 'call', _231 => _231()])) {
3241
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _232 => _232.isEnded, 'call', _233 => _233()])) {
3182
+ if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _227 => _227.isEnded, 'call', _228 => _228()])) {
3183
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _229 => _229.isEnded, 'call', _230 => _230()])) {
3242
3184
  const duration = Date.now() - startTime;
3243
3185
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
3244
3186
  }
@@ -3296,8 +3238,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3296
3238
  if (imageModule) return imageModule;
3297
3239
  }
3298
3240
  if (_chunkCGVPXIRNcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
3299
- const renderer = _optionalChain([farmApp, 'optionalAccess', _234 => _234.getConfig, 'call', _235 => _235(), 'access', _236 => _236.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
3300
- const root = _optionalChain([server, 'optionalAccess', _237 => _237.config, 'access', _238 => _238.root]) || options.root;
3241
+ const renderer = _optionalChain([farmApp, 'optionalAccess', _231 => _231.getConfig, 'call', _232 => _232(), 'access', _233 => _233.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
3242
+ const root = _optionalChain([server, 'optionalAccess', _234 => _234.config, 'access', _235 => _235.root]) || options.root;
3301
3243
  if (isClientEnvironment(this, loadOptions)) {
3302
3244
  return generateProgrammaticClientRouteModuleForId(
3303
3245
  id,
@@ -3310,32 +3252,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3310
3252
  return generateProgrammaticRouteModule(id, root, renderer);
3311
3253
  }
3312
3254
  if (isFarmClientVirtualId(id)) {
3313
- const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _239 => _239.getConfig, 'call', _240 => _240()]);
3314
- const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _241 => _241.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
3315
- const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _242 => _242.integrations]) || options.integrations;
3316
- const root = _optionalChain([resolvedConfig, 'optionalAccess', _243 => _243.root]) || _optionalChain([server, 'optionalAccess', _244 => _244.config, 'access', _245 => _245.root]) || process.cwd();
3317
- const docs = _optionalChain([resolvedConfig, 'optionalAccess', _246 => _246.docs]);
3255
+ const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _236 => _236.getConfig, 'call', _237 => _237()]);
3256
+ const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _238 => _238.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
3257
+ const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _239 => _239.integrations]) || options.integrations;
3258
+ const root = _optionalChain([resolvedConfig, 'optionalAccess', _240 => _240.root]) || _optionalChain([server, 'optionalAccess', _241 => _241.config, 'access', _242 => _242.root]) || process.cwd();
3259
+ const docs = _optionalChain([resolvedConfig, 'optionalAccess', _243 => _243.docs]);
3318
3260
  const adapterOwnsDocsRuntime = Boolean(
3319
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _247 => _247.adapter, 'optionalAccess', _248 => _248.server]) && docs.adapter.react
3261
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _244 => _244.adapter, 'optionalAccess', _245 => _245.server]) && docs.adapter.react
3320
3262
  );
3321
- const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _249 => _249.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
3263
+ const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _246 => _246.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
3322
3264
  const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
3323
- _optionalChain([docs, 'optionalAccess', _250 => _250.enabled]) ? loadFarmDocsDevRuntime() : null,
3324
- _optionalChain([docs, 'optionalAccess', _251 => _251.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
3265
+ _optionalChain([docs, 'optionalAccess', _247 => _247.enabled]) ? loadFarmDocsDevRuntime() : null,
3266
+ _optionalChain([docs, 'optionalAccess', _248 => _248.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
3325
3267
  devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
3326
3268
  ]);
3327
- const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _252 => _252.isFarmDocsSearchEnabled, 'call', _253 => _253(docs)]), () => ( false));
3269
+ const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _249 => _249.isFarmDocsSearchEnabled, 'call', _250 => _250(docs)]), () => ( false));
3328
3270
  const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
3329
3271
  docsSearchEnabled,
3330
3272
  docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
3331
3273
  ) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
3332
3274
  const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
3333
- const generatedDevIndicatorsClientRuntime = farmApp ? _chunkJR4QCLJYcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
3275
+ const generatedDevIndicatorsClientRuntime = farmApp ? _chunkPDU4P2ICcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
3334
3276
  const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, integrations) : [];
3335
- const isolatedHydrationMode = _chunkROQ4C4LJcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
3336
- _optionalChain([resolvedConfig, 'optionalAccess', _254 => _254.experimental, 'optionalAccess', _255 => _255.isolatedClientHydration]),
3277
+ const isolatedHydrationMode = _chunkRACQTC7Kcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
3278
+ _optionalChain([resolvedConfig, 'optionalAccess', _251 => _251.experimental, 'optionalAccess', _252 => _252.isolatedClientHydration]),
3337
3279
  {
3338
- serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _256 => _256.experimental, 'optionalAccess', _257 => _257.serverComponents]) === true,
3280
+ serverComponents: _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _253 => _253.experimental, 'optionalAccess', _254 => _254.serverComponents])) === "rsc",
3339
3281
  hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
3340
3282
  }
3341
3283
  );
@@ -3343,31 +3285,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3343
3285
  integrationProviders,
3344
3286
  [
3345
3287
  ..._chunkRHGK2JENcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
3346
- ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _258 => _258.getFarmDocsDocumentNavigationMatchers, 'call', _259 => _259(docs)]), () => ( []))
3288
+ ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _255 => _255.getFarmDocsDocumentNavigationMatchers, 'call', _256 => _256(docs)]), () => ( []))
3347
3289
  ],
3348
3290
  generatedDocsSearchRuntime,
3349
3291
  `${generatedDevtoolsClientRuntime}
3350
3292
  ${generatedDevIndicatorsClientRuntime}`,
3351
- _optionalChain([resolvedConfig, 'optionalAccess', _260 => _260.plugins]) || [],
3293
+ _optionalChain([resolvedConfig, 'optionalAccess', _257 => _257.plugins]) || [],
3352
3294
  root,
3353
- _optionalChain([resolvedConfig, 'optionalAccess', _261 => _261.srcDir]) || options.srcDir || "src",
3354
- _optionalChain([resolvedConfig, 'optionalAccess', _262 => _262.publicRuntimeConfig]) || options.publicRuntimeConfig,
3355
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _263 => _263.adapter, 'optionalAccess', _264 => _264.react]) : void 0,
3295
+ _optionalChain([resolvedConfig, 'optionalAccess', _258 => _258.srcDir]) || options.srcDir || "src",
3296
+ _optionalChain([resolvedConfig, 'optionalAccess', _259 => _259.publicRuntimeConfig]) || options.publicRuntimeConfig,
3297
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _260 => _260.adapter, 'optionalAccess', _261 => _261.react]) : void 0,
3356
3298
  renderer,
3357
- isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _265 => _265.getRouteManager, 'call', _266 => _266(), 'access', _267 => _267.getIsolatedClientBoundaryModules, 'call', _268 => _268(root)])))), 'optionalAccess', _269 => _269.size]) > 0,
3358
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _270 => _270.trailingSlash]), () => ( false)),
3359
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _271 => _271.basePath]), () => ( "/")),
3360
- _chunkROQ4C4LJcjs.generateClientCachePersistenceCode.call(void 0,
3361
- _chunkROQ4C4LJcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _272 => _272.cache]))
3299
+ isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _262 => _262.getRouteManager, 'call', _263 => _263(), 'access', _264 => _264.getIsolatedClientBoundaryModules, 'call', _265 => _265(root)])))), 'optionalAccess', _266 => _266.size]) > 0,
3300
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _267 => _267.trailingSlash]), () => ( false)),
3301
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _268 => _268.basePath]), () => ( "/")),
3302
+ _chunkRACQTC7Kcjs.generateClientCachePersistenceCode.call(void 0,
3303
+ _chunkRACQTC7Kcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _269 => _269.cache]))
3362
3304
  ),
3363
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
3305
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
3306
+ _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _270 => _270.experimental, 'optionalAccess', _271 => _271.serverComponents])) === "islands"
3364
3307
  );
3365
3308
  }
3366
3309
  if (id === "/@farm/server") {
3367
3310
  return generateServerCode();
3368
3311
  }
3369
3312
  if (id === "/@farm/manifest") {
3370
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _273 => _273.getRouteManager, 'call', _274 => _274()]);
3313
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _272 => _272.getRouteManager, 'call', _273 => _273()]);
3371
3314
  if (!routeManager) {
3372
3315
  return `
3373
3316
  export const getManifest = () => ({
@@ -3380,9 +3323,9 @@ export const getManifest = () => ({
3380
3323
  `;
3381
3324
  }
3382
3325
  const manifest = routeManager.generateClientManifest(server.config.root);
3383
- const globalStylesheetHref = _chunkROQ4C4LJcjs.resolveDevGlobalStylesheetHref.call(void 0,
3326
+ const globalStylesheetHref = _chunkRACQTC7Kcjs.resolveDevGlobalStylesheetHref.call(void 0,
3384
3327
  server.config.root,
3385
- _optionalChain([farmApp, 'optionalAccess', _275 => _275.getConfig, 'call', _276 => _276(), 'access', _277 => _277.srcDir])
3328
+ _optionalChain([farmApp, 'optionalAccess', _274 => _274.getConfig, 'call', _275 => _275(), 'access', _276 => _276.srcDir])
3386
3329
  );
3387
3330
  const fullManifest = {
3388
3331
  clientEntry: "/@farm/client.js",
@@ -3408,11 +3351,11 @@ export const getManifest = () => ({
3408
3351
  };
3409
3352
  }
3410
3353
  for (const layout of manifest.layouts) {
3411
- const groupScope = _chunkL6HYACBEcjs.getRouteGroupScope.call(void 0, layout.pattern);
3354
+ const groupScope = _chunkGVNCWSQVcjs.getRouteGroupScope.call(void 0, layout.pattern);
3412
3355
  fullManifest.layouts[layout.pattern] = {
3413
3356
  modulePath: layout.modulePath,
3414
3357
  pattern: layout.pattern,
3415
- ...groupScope ? { urlPattern: _chunkL6HYACBEcjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
3358
+ ...groupScope ? { urlPattern: _chunkGVNCWSQVcjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
3416
3359
  shouldHydrate: layout.shouldHydrate,
3417
3360
  islandStrategy: layout.islandStrategy,
3418
3361
  preloads: [layout.modulePath],
@@ -3436,24 +3379,37 @@ export const manifest = getManifest();
3436
3379
  }
3437
3380
  },
3438
3381
  async transform(code, id, transformOptions) {
3439
- if (!_optionalChain([transformOptions, 'optionalAccess', _278 => _278.ssr])) {
3440
- const docsConfigModule = _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _279 => _279.getConfig, 'call', _280 => _280(), 'optionalAccess', _281 => _281.docs]));
3441
- if (_chunkROQ4C4LJcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
3442
- const redacted = _chunkROQ4C4LJcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
3382
+ const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _277 => _277.getConfig, 'call', _278 => _278()]), () => ( options));
3383
+ if (_chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _279 => _279.experimental, 'optionalAccess', _280 => _280.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
3384
+ const file = id.split("?", 1)[0];
3385
+ const actionModule = transformFarmFormActionModule({
3386
+ code,
3387
+ id,
3388
+ root: actionConfig.root || _optionalChain([server, 'optionalAccess', _281 => _281.config, 'access', _282 => _282.root]) || process.cwd(),
3389
+ ssr: _optionalChain([transformOptions, 'optionalAccess', _283 => _283.ssr]) === true,
3390
+ // Parsed by file type: page components are TSX.
3391
+ parse: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (source) => _vite.parseSync.call(void 0, file, source).program, "parse")
3392
+ });
3393
+ if (actionModule) return { code: actionModule, map: null };
3394
+ }
3395
+ if (!_optionalChain([transformOptions, 'optionalAccess', _284 => _284.ssr])) {
3396
+ const docsConfigModule = _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _285 => _285.getConfig, 'call', _286 => _286(), 'optionalAccess', _287 => _287.docs]));
3397
+ if (_chunkRACQTC7Kcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
3398
+ const redacted = _chunkRACQTC7Kcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
3443
3399
  if (redacted !== null) return { code: redacted, map: null };
3444
3400
  }
3445
3401
  }
3446
- if (!_optionalChain([transformOptions, 'optionalAccess', _282 => _282.ssr])) {
3447
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _283 => _283.getConfig, 'call', _284 => _284()]), () => ( options));
3448
- if (_optionalChain([currentConfig, 'access', _285 => _285.experimental, 'optionalAccess', _286 => _286.serverActions]) !== true || !serverFnTransformActive) {
3402
+ if (!_optionalChain([transformOptions, 'optionalAccess', _288 => _288.ssr])) {
3403
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _289 => _289.getConfig, 'call', _290 => _290()]), () => ( options));
3404
+ if (_optionalChain([currentConfig, 'access', _291 => _291.experimental, 'optionalAccess', _292 => _292.serverActions]) !== true || !serverFnTransformActive) {
3449
3405
  const violation = findClientServerFnViolation(code, id);
3450
3406
  if (violation) {
3451
3407
  this.error(formatServerFnBoundaryError(violation, id));
3452
3408
  }
3453
3409
  }
3454
3410
  }
3455
- if (!_optionalChain([transformOptions, 'optionalAccess', _287 => _287.ssr]) && shouldInspectClientBoundary(id, code)) {
3456
- warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _288 => _288.getConfig, 'call', _289 => _289()]), () => ( options)));
3411
+ if (!_optionalChain([transformOptions, 'optionalAccess', _293 => _293.ssr]) && shouldInspectClientBoundary(id, code)) {
3412
+ warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _294 => _294.getConfig, 'call', _295 => _295()]), () => ( options)));
3457
3413
  }
3458
3414
  if (typeof imageImports.transform === "function") {
3459
3415
  const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
@@ -3468,13 +3424,13 @@ export const manifest = getManifest();
3468
3424
  id,
3469
3425
  transformOptions
3470
3426
  );
3471
- const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _290 => _290.code, 'optionalAccess', _291 => _291.toString, 'call', _292 => _292()]);
3427
+ const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _296 => _296.code, 'optionalAccess', _297 => _297.toString, 'call', _298 => _298()]);
3472
3428
  if (fontCode) {
3473
3429
  transformedCode = fontCode;
3474
3430
  transformed = true;
3475
3431
  }
3476
3432
  }
3477
- if (_optionalChain([transformOptions, 'optionalAccess', _293 => _293.ssr]) && server) {
3433
+ if (_optionalChain([transformOptions, 'optionalAccess', _299 => _299.ssr]) && server) {
3478
3434
  const rewrittenImports = rewriteEarlySsrRelativeImports({
3479
3435
  code: transformedCode,
3480
3436
  id,
@@ -3486,27 +3442,28 @@ export const manifest = getManifest();
3486
3442
  transformed = true;
3487
3443
  }
3488
3444
  }
3489
- if (_chunkROQ4C4LJcjs.hasUseClientDirective.call(void 0, transformedCode)) {
3445
+ if (_chunkRACQTC7Kcjs.hasUseClientDirective.call(void 0, transformedCode)) {
3490
3446
  const clientBoundarySource = transformedCode;
3491
3447
  const moduleInfo = this.getModuleInfo(id);
3492
3448
  if (moduleInfo) {
3493
3449
  moduleInfo.isClientComponent = true;
3494
3450
  }
3495
- transformedCode = _chunkROQ4C4LJcjs.stripUseClientDirective.call(void 0, transformedCode);
3451
+ transformedCode = _chunkRACQTC7Kcjs.stripUseClientDirective.call(void 0, transformedCode);
3496
3452
  transformed = true;
3497
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _294 => _294.getConfig, 'call', _295 => _295()]), () => ( options));
3453
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _300 => _300.getConfig, 'call', _301 => _301()]), () => ( options));
3498
3454
  let isolatedModuleReference = null;
3499
- const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _296 => _296.config, 'access', _297 => _297.root]) || process.cwd();
3455
+ const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _302 => _302.config, 'access', _303 => _303.root]) || process.cwd();
3500
3456
  const cleanId = id.split("?", 1)[0];
3501
- const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _298 => _298.getRouteManager, 'call', _299 => _299(), 'access', _300 => _300.getIsolatedClientBoundaryModules, 'call', _301 => _301(root)])));
3502
- const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _302 => _302.has, 'call', _303 => _303(path4.resolve(cleanId))]) === true;
3503
- if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && _chunkROQ4C4LJcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource)) {
3457
+ const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _304 => _304.getRouteManager, 'call', _305 => _305(), 'access', _306 => _306.getIsolatedClientBoundaryModules, 'call', _307 => _307(root)])));
3458
+ const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _308 => _308.has, 'call', _309 => _309(path5.resolve(cleanId))]) === true;
3459
+ if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && _chunkRACQTC7Kcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource)) {
3504
3460
  isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
3505
3461
  const transformedBoundary = transformIsolatedClientBoundaryModule({
3506
3462
  code: transformedCode,
3507
3463
  moduleReference: isolatedModuleReference,
3508
- islandStrategy: _nullishCoalesce(_chunkROQ4C4LJcjs.getIslandStrategyExport.call(void 0, clientBoundarySource), () => ( "load")),
3509
- parse: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (source) => this.parse(source), "parse")
3464
+ islandStrategy: _nullishCoalesce(_chunkRACQTC7Kcjs.getIslandStrategyExport.call(void 0, clientBoundarySource), () => ( "load")),
3465
+ parse: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (source) => this.parse(source), "parse"),
3466
+ slots: _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _310 => _310.experimental, 'optionalAccess', _311 => _311.serverComponents])) === "islands"
3510
3467
  });
3511
3468
  if (!transformedBoundary) {
3512
3469
  this.error(
@@ -3536,7 +3493,7 @@ export const manifest = getManifest();
3536
3493
  );
3537
3494
  return;
3538
3495
  }` : "";
3539
- const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _304 => _304.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
3496
+ const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _312 => _312.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
3540
3497
  if (import.meta.hot) {
3541
3498
  import.meta.hot.accept((newModule) => {
3542
3499
  ${isolatedHmrUpdate}
@@ -3591,14 +3548,14 @@ if (import.meta.hot) {
3591
3548
  }
3592
3549
  _chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
3593
3550
  _chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
3594
- const outDir = path4.join(_optionalChain([server, 'optionalAccess', _305 => _305.config, 'access', _306 => _306.root]) || process.cwd(), options.outDir || "dist");
3595
- const clientDir = path4.join(outDir, "client");
3551
+ const outDir = path5.join(_optionalChain([server, 'optionalAccess', _313 => _313.config, 'access', _314 => _314.root]) || process.cwd(), options.outDir || "dist");
3552
+ const clientDir = path5.join(outDir, "client");
3596
3553
  for (const page of ssgPages) {
3597
3554
  try {
3598
3555
  const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
3599
3556
  await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
3600
3557
  const mod = await routeManager.loadRouteModule(page.filePath);
3601
- if (!_optionalChain([mod, 'optionalAccess', _307 => _307.default])) return;
3558
+ if (!_optionalChain([mod, 'optionalAccess', _315 => _315.default])) return;
3602
3559
  const { layouts } = routeManager.matchRoute(page.urlPath);
3603
3560
  const layoutModules = await Promise.all(
3604
3561
  layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
@@ -3630,7 +3587,7 @@ if (import.meta.hot) {
3630
3587
  const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
3631
3588
  const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
3632
3589
  const fullHtml = `<!DOCTYPE html>
3633
- <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _308 => _308.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
3590
+ <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _316 => _316.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
3634
3591
  <head>
3635
3592
  <meta charset="utf-8">
3636
3593
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -3644,8 +3601,8 @@ if (import.meta.hot) {
3644
3601
  <script type="module" src="/assets/client.js"></script>
3645
3602
  </body>
3646
3603
  </html>`;
3647
- const outputPath = page.urlPath === "/" ? path4.join(clientDir, "index.html") : path4.join(clientDir, page.urlPath + ".html");
3648
- fs2.mkdirSync(path4.dirname(outputPath), { recursive: true });
3604
+ const outputPath = page.urlPath === "/" ? path5.join(clientDir, "index.html") : path5.join(clientDir, page.urlPath + ".html");
3605
+ fs2.mkdirSync(path5.dirname(outputPath), { recursive: true });
3649
3606
  fs2.writeFileSync(outputPath, fullHtml);
3650
3607
  const revalidateInfo = page.revalidate ? ` (revalidate: ${page.revalidate}s)` : "";
3651
3608
  _chunk5QIKR7RRcjs.logger.success(` \u2713 ${page.urlPath}${revalidateInfo}`);
@@ -3654,7 +3611,7 @@ if (import.meta.hot) {
3654
3611
  _chunk5QIKR7RRcjs.logger.error(` \u2717 ${page.urlPath}: ${error}`);
3655
3612
  }
3656
3613
  }
3657
- const manifestPath = path4.join(outDir, "__ssg_manifest.json");
3614
+ const manifestPath = path5.join(outDir, "__ssg_manifest.json");
3658
3615
  fs2.writeFileSync(
3659
3616
  manifestPath,
3660
3617
  JSON.stringify(
@@ -3688,23 +3645,23 @@ if (import.meta.hot) {
3688
3645
  });
3689
3646
  }
3690
3647
  }
3691
- const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _309 => _309.getConfig, 'call', _310 => _310()]);
3648
+ const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _317 => _317.getConfig, 'call', _318 => _318()]);
3692
3649
  const normalizedFile = file.replace(/\\/g, "/");
3693
3650
  if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
3694
3651
  (appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
3695
3652
  )) {
3696
3653
  for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
3697
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _311 => _311(`updated ${file}`)]);
3654
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _319 => _319(`updated ${file}`)]);
3698
3655
  server2.ws.send({ type: "full-reload", path: "*" });
3699
3656
  return [];
3700
3657
  }
3701
- const currentSrcRoot = currentFarmConfig ? _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path4.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
3658
+ const currentSrcRoot = currentFarmConfig ? _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path5.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
3702
3659
  if (currentSrcRoot && normalizedFile.startsWith(`${currentSrcRoot}/`) && _chunkCGVPXIRNcjs.isProgrammaticRoutesFileName.call(void 0, normalizedFile)) {
3703
- logUpdate("PAGE", `updated ${path4.basename(file)}`);
3660
+ logUpdate("PAGE", `updated ${path5.basename(file)}`);
3704
3661
  for (const mod of modules) {
3705
3662
  server2.moduleGraph.invalidateModule(mod);
3706
3663
  }
3707
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _312 => _312(`updated ${file}`)]);
3664
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _320 => _320(`updated ${file}`)]);
3708
3665
  server2.ws.send({
3709
3666
  type: "full-reload",
3710
3667
  path: "*"
@@ -3717,7 +3674,7 @@ if (import.meta.hot) {
3717
3674
  for (const mod of modules) {
3718
3675
  server2.moduleGraph.invalidateModule(mod);
3719
3676
  }
3720
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _313 => _313(`updated ${file}`)]);
3677
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _321 => _321(`updated ${file}`)]);
3721
3678
  server2.ws.send({
3722
3679
  type: "full-reload",
3723
3680
  path: "*"
@@ -3725,12 +3682,12 @@ if (import.meta.hot) {
3725
3682
  return [];
3726
3683
  }
3727
3684
  if (apiRouteManager && _chunkPJ42JESYcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
3728
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _314 => _314(`updated ${file}`)]);
3685
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _322 => _322(`updated ${file}`)]);
3729
3686
  }
3730
- const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _315 => _315.experimental, 'optionalAccess', _316 => _316.isolatedClientHydration]);
3731
- const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _317 => _317.getRouteManager, 'call', _318 => _318()]);
3687
+ const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _323 => _323.experimental, 'optionalAccess', _324 => _324.isolatedClientHydration]);
3688
+ const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _325 => _325.getRouteManager, 'call', _326 => _326()]);
3732
3689
  const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
3733
- const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _319 => _319.renderer])) && planRouteManager !== void 0;
3690
+ const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _327 => _327.renderer])) && planRouteManager !== void 0;
3734
3691
  if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
3735
3692
  const routeManager = planRouteManager;
3736
3693
  if (routeManager) {
@@ -3790,7 +3747,7 @@ if (import.meta.hot) {
3790
3747
  }
3791
3748
  return [];
3792
3749
  }
3793
- _optionalChain([farmApp, 'optionalAccess', _320 => _320.getRouteManager, 'call', _321 => _321(), 'access', _322 => _322.invalidateClientManifest, 'call', _323 => _323()]);
3750
+ _optionalChain([farmApp, 'optionalAccess', _328 => _328.getRouteManager, 'call', _329 => _329(), 'access', _330 => _330.invalidateClientManifest, 'call', _331 => _331()]);
3794
3751
  const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
3795
3752
  if (manifestModule) {
3796
3753
  server2.moduleGraph.invalidateModule(manifestModule);
@@ -3834,10 +3791,10 @@ function createPageDataMiddlewareRequest(req, target) {
3834
3791
  _chunkS3JO3N4Hcjs.__name.call(void 0, createPageDataMiddlewareRequest, "createPageDataMiddlewareRequest");
3835
3792
  function resolveDevelopmentRoot(farmRoot, viteRoot) {
3836
3793
  if (!farmRoot) return viteRoot;
3837
- if (path4.resolve(farmRoot) === path4.resolve(viteRoot)) return farmRoot;
3794
+ if (path5.resolve(farmRoot) === path5.resolve(viteRoot)) return farmRoot;
3838
3795
  try {
3839
3796
  if (fs2.realpathSync(farmRoot) === fs2.realpathSync(viteRoot)) {
3840
- return path4.resolve(viteRoot);
3797
+ return path5.resolve(viteRoot);
3841
3798
  }
3842
3799
  } catch (e14) {
3843
3800
  }
@@ -3851,13 +3808,13 @@ function isFarmClientVirtualId(id) {
3851
3808
  _chunkS3JO3N4Hcjs.__name.call(void 0, isFarmClientVirtualId, "isFarmClientVirtualId");
3852
3809
  function isClientEnvironment(context, loadOptions) {
3853
3810
  const environment = context.environment;
3854
- if (_optionalChain([environment, 'optionalAccess', _324 => _324.config, 'optionalAccess', _325 => _325.consumer])) return environment.config.consumer === "client";
3855
- if (_optionalChain([environment, 'optionalAccess', _326 => _326.name])) return environment.name === "client";
3856
- return _optionalChain([loadOptions, 'optionalAccess', _327 => _327.ssr]) !== true;
3811
+ if (_optionalChain([environment, 'optionalAccess', _332 => _332.config, 'optionalAccess', _333 => _333.consumer])) return environment.config.consumer === "client";
3812
+ if (_optionalChain([environment, 'optionalAccess', _334 => _334.name])) return environment.name === "client";
3813
+ return _optionalChain([loadOptions, 'optionalAccess', _335 => _335.ssr]) !== true;
3857
3814
  }
3858
3815
  _chunkS3JO3N4Hcjs.__name.call(void 0, isClientEnvironment, "isClientEnvironment");
3859
3816
  function invalidateProgrammaticClientRouteModules(server) {
3860
- const graph = _optionalChain([server, 'access', _328 => _328.environments, 'optionalAccess', _329 => _329.client, 'optionalAccess', _330 => _330.moduleGraph]);
3817
+ const graph = _optionalChain([server, 'access', _336 => _336.environments, 'optionalAccess', _337 => _337.client, 'optionalAccess', _338 => _338.moduleGraph]);
3861
3818
  if (!graph) return;
3862
3819
  for (const [id, module] of graph.idToModuleMap) {
3863
3820
  if (_chunkCGVPXIRNcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
@@ -3872,7 +3829,7 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
3872
3829
  kind: parsed.kind,
3873
3830
  routePath: parsed.routePath,
3874
3831
  routesFile,
3875
- route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _331 => _331.routes, 'access', _332 => _332.get, 'call', _333 => _333(
3832
+ route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _339 => _339.routes, 'access', _340 => _340.get, 'call', _341 => _341(
3876
3833
  _chunkVDRM36QBcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
3877
3834
  )]),
3878
3835
  rendererServer: renderer.server,
@@ -3881,7 +3838,7 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
3881
3838
  }
3882
3839
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateProgrammaticClientRouteModuleForId, "generateProgrammaticClientRouteModuleForId");
3883
3840
  function resolveRealModuleFile(filePath, root) {
3884
- const resolved = _nullishCoalesce(_chunkROQ4C4LJcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
3841
+ const resolved = _nullishCoalesce(_chunkRACQTC7Kcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
3885
3842
  try {
3886
3843
  return _chunk5QIKR7RRcjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
3887
3844
  } catch (e15) {
@@ -4199,12 +4156,12 @@ async function parseRouteModuleProps(routeModule, input) {
4199
4156
  }
4200
4157
  const schemas = routeModule.__farmRouteSchemas;
4201
4158
  const params = parseRouteModuleSchema(
4202
- _optionalChain([schemas, 'optionalAccess', _334 => _334.params]),
4159
+ _optionalChain([schemas, 'optionalAccess', _342 => _342.params]),
4203
4160
  input.props.params,
4204
4161
  "params",
4205
4162
  input.routePath
4206
4163
  );
4207
- const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _335 => _335.search]), input.search, "search", input.routePath);
4164
+ const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _343 => _343.search]), input.search, "search", input.routePath);
4208
4165
  return {
4209
4166
  ...input.props,
4210
4167
  params,
@@ -4225,13 +4182,13 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
4225
4182
  }
4226
4183
  }
4227
4184
  _chunkS3JO3N4Hcjs.__name.call(void 0, parseRouteModuleSchema, "parseRouteModuleSchema");
4228
- function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
4229
- const providerClientCode = _chunkROQ4C4LJcjs.generateFarmIntegrationProviderClientCode.call(void 0,
4185
+ function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
4186
+ const providerClientCode = _chunkRACQTC7Kcjs.generateFarmIntegrationProviderClientCode.call(void 0,
4230
4187
  integrationProviders,
4231
4188
  root,
4232
4189
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
4233
4190
  );
4234
- const clientPluginEntry = _chunkROQ4C4LJcjs.generateFarmClientPluginEntryCode.call(void 0,
4191
+ const clientPluginEntry = _chunkRACQTC7Kcjs.generateFarmClientPluginEntryCode.call(void 0,
4235
4192
  plugins,
4236
4193
  root,
4237
4194
  srcDir,
@@ -4242,8 +4199,7 @@ function generateClientCode(integrationProviders = [], documentNavigationMatcher
4242
4199
  import { hydrateRoot, createRoot } from 'react-dom/client'` : appSetupPath ? `import React, { hydrateRoot, createRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)}
4243
4200
  import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toViteModuleId.call(void 0, appSetupPath, root))}
4244
4201
  __farmConfigureApp(__farmAppSetup)` : `import React, { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}`;
4245
- const isolatedHydrationImport = isolatedHydrationEnabled ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'
4246
- import { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'` : "";
4202
+ const isolatedHydrationImport = isolatedHydrationEnabled ? `${islandValues ? "import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement } from '@farm.js/core/internal/islands-runtime'" : "import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'\nimport { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'"}` : "";
4247
4203
  const docsAdapterImportBlock = _chunkCY2ZQ5C6cjs.generateFarmDocsAdapterClientRuntime.call(void 0,
4248
4204
  docsAdapterReact,
4249
4205
  docsConfigModule
@@ -4251,7 +4207,7 @@ import { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'
4251
4207
  const isolatedHydrationRuntime = isolatedHydrationEnabled ? `const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
4252
4208
  ReactRuntime: React,
4253
4209
  hydrateRoot,
4254
- load: (reference) => import(/* @vite-ignore */ reference),
4210
+ load: (reference) => import(/* @vite-ignore */ farmModuleUrl(reference)),
4255
4211
  schedule: scheduleFarmIslandHydration,
4256
4212
  wrap: wrapWithIntegrationProviders,
4257
4213
  });
@@ -4271,7 +4227,7 @@ async function hydrateFarmIsolatedClientBoundaries(scope = document, signal) {
4271
4227
  async function createFarmServerTreePageElement(source, pathname) {
4272
4228
  try {
4273
4229
  return await createFarmServerTreeElement(React, source, {
4274
- load: (reference) => import(/* @vite-ignore */ reference),
4230
+ load: (reference) => import(/* @vite-ignore */ farmModuleUrl(reference)),
4275
4231
  ServerHtml: FarmServerPage,
4276
4232
  key: pathname,
4277
4233
  });
@@ -4295,6 +4251,18 @@ import {
4295
4251
  } from '@farm.js/core/deployment'
4296
4252
  ${providerClientCode.imports}
4297
4253
  ${clientPluginEntry.imports}
4254
+
4255
+ // Vite appends ?import to a dynamic import of a variable, and the browser keys that URL as a second
4256
+ // copy of a module other modules import statically: two React contexts, two stores. Vite leaves an
4257
+ // absolute URL alone. Other files (Markdown pages) need ?import to be served as JavaScript.
4258
+ function farmModuleUrl(reference) {
4259
+ return typeof reference === "string" &&
4260
+ reference[0] === "/" &&
4261
+ reference[1] !== "/" &&
4262
+ /\\.(?:[cm]?[jt]sx?|vue|svelte)(?:$|\\?)/.test(reference)
4263
+ ? new URL(reference, location.origin).href
4264
+ : reference;
4265
+ }
4298
4266
  ${clientCachePersistence.imports}
4299
4267
  ${docsSearchClientRuntime}
4300
4268
  ${devtoolsClientRuntime}
@@ -4578,7 +4546,7 @@ class LegacyManifestSPARouter {
4578
4546
  this.prefetchingUrls.add(pathname);
4579
4547
  try {
4580
4548
  // Prefetch by importing the module (Vite caches it)
4581
- const module = await import(/* @vite-ignore */ modulePath);
4549
+ const module = await import(/* @vite-ignore */ farmModuleUrl(modulePath));
4582
4550
  this.moduleCache.set(modulePath, module);
4583
4551
  pageModuleCache.set(modulePath, module);
4584
4552
  } catch (error) {
@@ -4826,7 +4794,7 @@ async function renderRouteSlot(slot, mode = 'render') {
4826
4794
 
4827
4795
  let slotModule = pageModuleCache.get(slot.modulePath);
4828
4796
  if (!slotModule) {
4829
- slotModule = await import(/* @vite-ignore */ slot.modulePath);
4797
+ slotModule = await import(/* @vite-ignore */ farmModuleUrl(slot.modulePath));
4830
4798
  pageModuleCache.set(slot.modulePath, slotModule);
4831
4799
  }
4832
4800
  const SlotComponent = slotModule?.default;
@@ -4991,7 +4959,7 @@ async function buildClientHydrationElement(
4991
4959
 
4992
4960
  if (loadingModulePath) {
4993
4961
  try {
4994
- const loadingModule = await import(/* @vite-ignore */ loadingModulePath);
4962
+ const loadingModule = await import(/* @vite-ignore */ farmModuleUrl(loadingModulePath));
4995
4963
  const LoadingComponent = loadingModule?.default;
4996
4964
  if (LoadingComponent) {
4997
4965
  const loadingFallback = React.createElement(LoadingComponent, {
@@ -5019,7 +4987,7 @@ async function loadLayoutComponents(layouts = []) {
5019
4987
  try {
5020
4988
  let LayoutComponent = layoutComponentCache.get(layout.modulePath);
5021
4989
  if (!LayoutComponent) {
5022
- const layoutModule = await import(/* @vite-ignore */ layout.modulePath);
4990
+ const layoutModule = await import(/* @vite-ignore */ farmModuleUrl(layout.modulePath));
5023
4991
  LayoutComponent = layoutModule.default;
5024
4992
  if (LayoutComponent) {
5025
4993
  layoutComponentCache.set(layout.modulePath, LayoutComponent);
@@ -5042,7 +5010,7 @@ async function loadLayoutComponents(layouts = []) {
5042
5010
  return loadedLayouts;
5043
5011
  }
5044
5012
 
5045
- ${_chunkROQ4C4LJcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
5013
+ ${_chunkRACQTC7Kcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
5046
5014
  function wrapWithLoadedLayouts(element, loadedLayouts, params) {
5047
5015
  let wrapped = element;
5048
5016
  for (let index = loadedLayouts.length - 1; index >= 0; index--) {
@@ -5181,7 +5149,7 @@ async function tryHydrateImportedPage(
5181
5149
  if (pageShouldHydrate) {
5182
5150
  let pageModule = pageModuleCache.get(modulePath);
5183
5151
  if (!pageModule) {
5184
- pageModule = await import(/* @vite-ignore */ modulePath);
5152
+ pageModule = await import(/* @vite-ignore */ farmModuleUrl(modulePath));
5185
5153
  pageModuleCache.set(modulePath, pageModule);
5186
5154
  }
5187
5155
  if (signal?.aborted || !container?.isConnected) return false;
@@ -5340,7 +5308,7 @@ function parseNavigationFragment(html) {
5340
5308
  return template.content;
5341
5309
  }
5342
5310
 
5343
- function replaceNavigationBoundary(container, fragment, currentPatterns, nextPatterns) {
5311
+ function replaceNavigationBoundary(container, fragment, currentPatterns, nextPatterns, refresh = false) {
5344
5312
  let sharedCount = 0;
5345
5313
  while (
5346
5314
  sharedCount < currentPatterns.length &&
@@ -5367,7 +5335,9 @@ function replaceNavigationBoundary(container, fragment, currentPatterns, nextPat
5367
5335
  return container;
5368
5336
  }
5369
5337
 
5370
- ${isolatedHydrationEnabled ? "disposeFarmIsolatedClientBoundaries(currentTarget);" : ""}
5338
+ ${isolatedHydrationEnabled ? `${islandValues ? `// A refresh keeps the islands still on the page, with their state and new props.
5339
+ if (refresh) farmIsolatedHydrationRuntime.carryOver(currentTarget, nextTarget);
5340
+ ` : ""}disposeFarmIsolatedClientBoundaries(currentTarget);` : ""}
5371
5341
  currentTarget.replaceWith(nextTarget);
5372
5342
  activateFragmentScripts(nextTarget);
5373
5343
  if (fragmentTreeRoot && fragmentTreeRoot !== nextTarget) fragmentTreeRoot.remove();
@@ -5391,7 +5361,7 @@ let activeLayoutShouldHydrate = window.__FARM_LAYOUT_SHOULD_HYDRATE__ === true;
5391
5361
 
5392
5362
  // ====== MANIFEST-DRIVEN HTML-FRAGMENT NAVIGATION ======
5393
5363
  // One page-data response carries both server HTML and the hydration plan.
5394
- async function renderPage(pageData) {
5364
+ async function renderPage(pageData, info) {
5395
5365
  const container = document.getElementById('root');
5396
5366
  if (!container) return;
5397
5367
  cancelPendingPageHydration();
@@ -5484,7 +5454,7 @@ async function renderPage(pageData) {
5484
5454
  const pageShouldHydrate = route.pageShouldHydrate || route.isClientComponent;
5485
5455
  const layoutShouldHydrate = route.layoutShouldHydrate;
5486
5456
  ${isolatedHydrationEnabled ? `const hasIsolatedClientBoundaries = Boolean(
5487
- fragment.querySelector('farm-client-boundary[data-farm-client-boundary]'),
5457
+ fragment.querySelector('f-island[src]'),
5488
5458
  );
5489
5459
  const shouldHydrate =
5490
5460
  pageShouldHydrate || layoutShouldHydrate || (route.shouldHydrate && !hasIsolatedClientBoundaries);` : "const shouldHydrate = route.shouldHydrate || pageShouldHydrate || layoutShouldHydrate;"}
@@ -5520,7 +5490,7 @@ async function renderPage(pageData) {
5520
5490
  if (appRoot) { try { appRoot.unmount(); } catch (error) {} appRoot = null; }
5521
5491
  if (reactRoot) { try { reactRoot.unmount(); } catch (error) {} reactRoot = null; }
5522
5492
  delete window.__FARM_REACT_ROOT__;
5523
- ${isolatedHydrationEnabled ? "isolatedHydrationScope = replaceNavigationBoundary(container, fragment, activeLayoutPatterns, layoutPatterns) || container;" : "replaceNavigationBoundary(container, fragment, activeLayoutPatterns, layoutPatterns);"}
5493
+ ${isolatedHydrationEnabled ? "isolatedHydrationScope = replaceNavigationBoundary(container, fragment, activeLayoutPatterns, layoutPatterns, info?.refresh === true) || container;" : "replaceNavigationBoundary(container, fragment, activeLayoutPatterns, layoutPatterns);"}
5524
5494
  }
5525
5495
 
5526
5496
  const hydrationController = new AbortController();
@@ -5617,7 +5587,7 @@ async function hydrate() {
5617
5587
  const modulePath = window.__FARM_PAGE_MODULE__;
5618
5588
  ${isolatedHydrationEnabled ? `const hasIsolatedClientBoundaries =
5619
5589
  window.__FARM_HAS_ISOLATED_CLIENT_BOUNDARIES__ === true ||
5620
- Boolean(rootContainer.querySelector('farm-client-boundary[data-farm-client-boundary]'));` : ""}
5590
+ Boolean(rootContainer.querySelector('f-island[src]'));` : ""}
5621
5591
 
5622
5592
  let pageProps = normalizeServerProps(window.__FARM_PROPS__);
5623
5593
  applyCanonicalPathFromProps(pageProps);
@@ -5863,9 +5833,9 @@ function generateClientManifest(bundle) {
5863
5833
  }
5864
5834
  _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientManifest");
5865
5835
  async function defineConfig(config = {}) {
5866
- const tailwindVitePlugin = await _chunkROQ4C4LJcjs.loadTailwindVitePlugin.call(void 0, );
5867
- const appRoot = path4.resolve(config.root || process.cwd());
5868
- if (_optionalChain([config, 'access', _336 => _336.extends, 'optionalAccess', _337 => _337.length])) {
5836
+ const tailwindVitePlugin = await _chunkLRJRXXQZcjs.loadTailwindVitePlugin.call(void 0, );
5837
+ const appRoot = path5.resolve(config.root || process.cwd());
5838
+ if (_optionalChain([config, 'access', _344 => _344.extends, 'optionalAccess', _345 => _345.length])) {
5869
5839
  const { config: layeredConfig } = await import("./layers-VUWIOFEO.cjs").then(
5870
5840
  ({ resolveFarmLayers }) => resolveFarmLayers(config, {
5871
5841
  root: appRoot,
@@ -5875,11 +5845,11 @@ async function defineConfig(config = {}) {
5875
5845
  config = layeredConfig;
5876
5846
  }
5877
5847
  config.renderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, config.renderer);
5878
- config.images = _chunkROQ4C4LJcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
5848
+ config.images = _chunkRACQTC7Kcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
5879
5849
  const rendererVitePlugins = await _chunkPSV6XKPOcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
5880
5850
  ssr: true
5881
5851
  });
5882
- const reactRefreshPlugins = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) ? await createFarmReactRefreshPlugins() : [];
5852
+ const reactRefreshPlugins = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) ? await _chunkCEDPEDNWcjs.createFarmReactRefreshPlugins.call(void 0, ) : [];
5883
5853
  const nodeBuiltinStubs = {
5884
5854
  "node:string_decoder": "data:text/javascript,export class StringDecoder { write(buf) { return ''; } end() { return ''; } }; export default StringDecoder;",
5885
5855
  "node:buffer": "data:text/javascript,export const Buffer = { from: () => ({}), alloc: () => ({}), isBuffer: () => false }; export default { Buffer };",
@@ -5967,13 +5937,13 @@ async function defineConfig(config = {}) {
5967
5937
  if (!serverStarted) {
5968
5938
  serverStarted = true;
5969
5939
  const elapsed = Date.now() - startTime;
5970
- const address = _optionalChain([server, 'access', _338 => _338.httpServer, 'optionalAccess', _339 => _339.address, 'call', _340 => _340()]);
5940
+ const address = _optionalChain([server, 'access', _346 => _346.httpServer, 'optionalAccess', _347 => _347.address, 'call', _348 => _348()]);
5971
5941
  const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
5972
5942
  const hostConfig = server.config.server.host;
5973
5943
  const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
5974
5944
  console.log("");
5975
5945
  console.log(
5976
- ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkEH3464KFcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
5946
+ ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkYBDSTNMHcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
5977
5947
  );
5978
5948
  console.log("");
5979
5949
  console.log(
@@ -6005,7 +5975,7 @@ async function defineConfig(config = {}) {
6005
5975
  };
6006
5976
  return {
6007
5977
  plugins: [
6008
- _chunkROQ4C4LJcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
5978
+ _chunkRACQTC7Kcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
6009
5979
  tailwindVitePlugin,
6010
5980
  ...rendererVitePlugins,
6011
5981
  ...reactRefreshPlugins,
@@ -6019,8 +5989,8 @@ async function defineConfig(config = {}) {
6019
5989
  customLogger: farmLogger,
6020
5990
  clearScreen: false,
6021
5991
  optimizeDeps: {
6022
- ..._chunkROQ4C4LJcjs.createFarmClientOptimizeDepsConfig.call(void 0,
6023
- _chunkROQ4C4LJcjs.createFarmClientOptimizeDepsEntries.call(void 0,
5992
+ ..._chunkRACQTC7Kcjs.createFarmClientOptimizeDepsConfig.call(void 0,
5993
+ _chunkRACQTC7Kcjs.createFarmClientOptimizeDepsEntries.call(void 0,
6024
5994
  appRoot,
6025
5995
  _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
6026
5996
  ),
@@ -6063,7 +6033,7 @@ async function defineConfig(config = {}) {
6063
6033
  // Stub out problematic server-only modules during dev mode
6064
6034
  alias: {
6065
6035
  ..._chunkWBKEZXWEcjs.getFarmLayerAliases.call(void 0, config.layers),
6066
- ..._chunkROQ4C4LJcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
6036
+ ..._chunkRACQTC7Kcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
6067
6037
  // Nitro internals that should not be resolved in browser
6068
6038
  "supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
6069
6039
  "@poppinss/dumper": "data:text/javascript,export default {};",
@@ -6093,5 +6063,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, defineConfig, "defineConfig");
6093
6063
 
6094
6064
 
6095
6065
 
6096
-
6097
- exports.farmImageImportsPlugin = farmImageImportsPlugin; exports.createFarmReactRefreshPlugins = createFarmReactRefreshPlugins; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig;
6066
+ exports.farmImageImportsPlugin = farmImageImportsPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig;