@farm.js/core 0.1.0-beta.5 → 0.1.0-beta.6

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 (424) hide show
  1. package/package.json +1 -1
  2. package/dist/after.cjs +0 -227
  3. package/dist/after.cjs.map +0 -1
  4. package/dist/after.d.mts +0 -25
  5. package/dist/after.d.ts +0 -25
  6. package/dist/after.mjs +0 -14
  7. package/dist/after.mjs.map +0 -1
  8. package/dist/agent-runtime.cjs +0 -2379
  9. package/dist/agent-runtime.cjs.map +0 -1
  10. package/dist/agent-runtime.d.mts +0 -94
  11. package/dist/agent-runtime.d.ts +0 -94
  12. package/dist/agent-runtime.mjs +0 -479
  13. package/dist/agent-runtime.mjs.map +0 -1
  14. package/dist/api/route-manager.d.mts +0 -66
  15. package/dist/api/route-manager.d.ts +0 -66
  16. package/dist/api/runtime.d.mts +0 -3
  17. package/dist/api/runtime.d.ts +0 -3
  18. package/dist/api.cjs +0 -4100
  19. package/dist/api.cjs.map +0 -1
  20. package/dist/api.d.mts +0 -48
  21. package/dist/api.d.ts +0 -48
  22. package/dist/api.mjs +0 -93
  23. package/dist/api.mjs.map +0 -1
  24. package/dist/app-BjN-da13.d.ts +0 -300
  25. package/dist/app-CakAr8Be.d.mts +0 -300
  26. package/dist/app-markdown.cjs +0 -220
  27. package/dist/app-markdown.cjs.map +0 -1
  28. package/dist/app-markdown.d.mts +0 -22
  29. package/dist/app-markdown.d.ts +0 -22
  30. package/dist/app-markdown.mjs +0 -26
  31. package/dist/app-markdown.mjs.map +0 -1
  32. package/dist/cache.cjs +0 -945
  33. package/dist/cache.cjs.map +0 -1
  34. package/dist/cache.d.mts +0 -192
  35. package/dist/cache.d.ts +0 -192
  36. package/dist/cache.mjs +0 -46
  37. package/dist/cache.mjs.map +0 -1
  38. package/dist/chunk-2CUKEMVR.mjs +0 -872
  39. package/dist/chunk-2CUKEMVR.mjs.map +0 -1
  40. package/dist/chunk-2ED5Q2GH.mjs +0 -422
  41. package/dist/chunk-2ED5Q2GH.mjs.map +0 -1
  42. package/dist/chunk-2NHCNRF6.mjs +0 -6241
  43. package/dist/chunk-2NHCNRF6.mjs.map +0 -1
  44. package/dist/chunk-32W4QEJP.mjs +0 -158
  45. package/dist/chunk-32W4QEJP.mjs.map +0 -1
  46. package/dist/chunk-3XNTL3FQ.mjs +0 -452
  47. package/dist/chunk-3XNTL3FQ.mjs.map +0 -1
  48. package/dist/chunk-44ZCFSKE.mjs +0 -84
  49. package/dist/chunk-44ZCFSKE.mjs.map +0 -1
  50. package/dist/chunk-4S3ORGFA.mjs +0 -44
  51. package/dist/chunk-4S3ORGFA.mjs.map +0 -1
  52. package/dist/chunk-5BY76U2M.mjs +0 -1
  53. package/dist/chunk-5BY76U2M.mjs.map +0 -1
  54. package/dist/chunk-5ZGPRGWV.mjs +0 -136
  55. package/dist/chunk-5ZGPRGWV.mjs.map +0 -1
  56. package/dist/chunk-65A7QIKI.mjs +0 -142
  57. package/dist/chunk-65A7QIKI.mjs.map +0 -1
  58. package/dist/chunk-74YTBPTY.mjs +0 -450
  59. package/dist/chunk-74YTBPTY.mjs.map +0 -1
  60. package/dist/chunk-7HO6AEOP.mjs +0 -74
  61. package/dist/chunk-7HO6AEOP.mjs.map +0 -1
  62. package/dist/chunk-7MABZJIM.mjs +0 -29
  63. package/dist/chunk-7MABZJIM.mjs.map +0 -1
  64. package/dist/chunk-7N62DNSO.mjs +0 -41
  65. package/dist/chunk-7N62DNSO.mjs.map +0 -1
  66. package/dist/chunk-7ZY5AIJO.mjs +0 -161
  67. package/dist/chunk-7ZY5AIJO.mjs.map +0 -1
  68. package/dist/chunk-A2LUXHD2.mjs +0 -7631
  69. package/dist/chunk-A2LUXHD2.mjs.map +0 -1
  70. package/dist/chunk-ALCLXXTY.mjs +0 -187
  71. package/dist/chunk-ALCLXXTY.mjs.map +0 -1
  72. package/dist/chunk-AZ7YUVNR.mjs +0 -65
  73. package/dist/chunk-AZ7YUVNR.mjs.map +0 -1
  74. package/dist/chunk-B232I2GP.mjs +0 -163
  75. package/dist/chunk-B232I2GP.mjs.map +0 -1
  76. package/dist/chunk-BHG3LVHH.mjs +0 -176
  77. package/dist/chunk-BHG3LVHH.mjs.map +0 -1
  78. package/dist/chunk-C2ROET2V.mjs +0 -718
  79. package/dist/chunk-C2ROET2V.mjs.map +0 -1
  80. package/dist/chunk-C3DLZMBU.mjs +0 -597
  81. package/dist/chunk-C3DLZMBU.mjs.map +0 -1
  82. package/dist/chunk-CGILA3WO.mjs +0 -14
  83. package/dist/chunk-CGILA3WO.mjs.map +0 -1
  84. package/dist/chunk-E2MPIBRE.mjs +0 -149
  85. package/dist/chunk-E2MPIBRE.mjs.map +0 -1
  86. package/dist/chunk-E6EPN5BT.mjs +0 -203
  87. package/dist/chunk-E6EPN5BT.mjs.map +0 -1
  88. package/dist/chunk-EEABSBKK.mjs +0 -10
  89. package/dist/chunk-EEABSBKK.mjs.map +0 -1
  90. package/dist/chunk-EJ7T4TPB.mjs +0 -622
  91. package/dist/chunk-EJ7T4TPB.mjs.map +0 -1
  92. package/dist/chunk-FQYDHKKU.mjs +0 -128
  93. package/dist/chunk-FQYDHKKU.mjs.map +0 -1
  94. package/dist/chunk-FRPWCMMG.mjs +0 -299
  95. package/dist/chunk-FRPWCMMG.mjs.map +0 -1
  96. package/dist/chunk-GN72QAIH.mjs +0 -146
  97. package/dist/chunk-GN72QAIH.mjs.map +0 -1
  98. package/dist/chunk-GQVGIUSN.mjs +0 -149
  99. package/dist/chunk-GQVGIUSN.mjs.map +0 -1
  100. package/dist/chunk-GS6K5OCM.mjs +0 -407
  101. package/dist/chunk-GS6K5OCM.mjs.map +0 -1
  102. package/dist/chunk-GXASWWJU.mjs +0 -364
  103. package/dist/chunk-GXASWWJU.mjs.map +0 -1
  104. package/dist/chunk-GY2STC2S.mjs +0 -180
  105. package/dist/chunk-GY2STC2S.mjs.map +0 -1
  106. package/dist/chunk-H2FA2SBS.mjs +0 -51
  107. package/dist/chunk-H2FA2SBS.mjs.map +0 -1
  108. package/dist/chunk-HNIQFZKB.mjs +0 -3550
  109. package/dist/chunk-HNIQFZKB.mjs.map +0 -1
  110. package/dist/chunk-ITN462YM.mjs +0 -98
  111. package/dist/chunk-ITN462YM.mjs.map +0 -1
  112. package/dist/chunk-J23HNLFY.mjs +0 -72
  113. package/dist/chunk-J23HNLFY.mjs.map +0 -1
  114. package/dist/chunk-J4FNJ5IU.mjs +0 -179
  115. package/dist/chunk-J4FNJ5IU.mjs.map +0 -1
  116. package/dist/chunk-J5YWQVI5.mjs +0 -211
  117. package/dist/chunk-J5YWQVI5.mjs.map +0 -1
  118. package/dist/chunk-JDEOUK5V.mjs +0 -427
  119. package/dist/chunk-JDEOUK5V.mjs.map +0 -1
  120. package/dist/chunk-JK25YEN6.mjs +0 -219
  121. package/dist/chunk-JK25YEN6.mjs.map +0 -1
  122. package/dist/chunk-K4667E2Q.mjs +0 -1916
  123. package/dist/chunk-K4667E2Q.mjs.map +0 -1
  124. package/dist/chunk-LGHEOHBU.mjs +0 -218
  125. package/dist/chunk-LGHEOHBU.mjs.map +0 -1
  126. package/dist/chunk-LLC7BNXW.mjs +0 -275
  127. package/dist/chunk-LLC7BNXW.mjs.map +0 -1
  128. package/dist/chunk-LM2YNO4U.mjs +0 -24
  129. package/dist/chunk-LM2YNO4U.mjs.map +0 -1
  130. package/dist/chunk-MIUW47JX.mjs +0 -639
  131. package/dist/chunk-MIUW47JX.mjs.map +0 -1
  132. package/dist/chunk-NM3CRAAL.mjs +0 -467
  133. package/dist/chunk-NM3CRAAL.mjs.map +0 -1
  134. package/dist/chunk-NNLCAVB6.mjs +0 -391
  135. package/dist/chunk-NNLCAVB6.mjs.map +0 -1
  136. package/dist/chunk-P7QDS5AT.mjs +0 -191
  137. package/dist/chunk-P7QDS5AT.mjs.map +0 -1
  138. package/dist/chunk-PFE6GMNE.mjs +0 -603
  139. package/dist/chunk-PFE6GMNE.mjs.map +0 -1
  140. package/dist/chunk-QGOHVJ6J.mjs +0 -63
  141. package/dist/chunk-QGOHVJ6J.mjs.map +0 -1
  142. package/dist/chunk-QGQX7SFC.mjs +0 -180
  143. package/dist/chunk-QGQX7SFC.mjs.map +0 -1
  144. package/dist/chunk-QKVUNGAH.mjs +0 -39
  145. package/dist/chunk-QKVUNGAH.mjs.map +0 -1
  146. package/dist/chunk-QM746KUO.mjs +0 -56
  147. package/dist/chunk-QM746KUO.mjs.map +0 -1
  148. package/dist/chunk-QTZZ2ISQ.mjs +0 -753
  149. package/dist/chunk-QTZZ2ISQ.mjs.map +0 -1
  150. package/dist/chunk-RBRLLZL5.mjs +0 -81
  151. package/dist/chunk-RBRLLZL5.mjs.map +0 -1
  152. package/dist/chunk-RHIFZZUI.mjs +0 -69
  153. package/dist/chunk-RHIFZZUI.mjs.map +0 -1
  154. package/dist/chunk-RSKVYESE.mjs +0 -187
  155. package/dist/chunk-RSKVYESE.mjs.map +0 -1
  156. package/dist/chunk-SCFX4UTD.mjs +0 -28
  157. package/dist/chunk-SCFX4UTD.mjs.map +0 -1
  158. package/dist/chunk-SL6HTIOK.mjs +0 -66
  159. package/dist/chunk-SL6HTIOK.mjs.map +0 -1
  160. package/dist/chunk-SPBBQLXI.mjs +0 -207
  161. package/dist/chunk-SPBBQLXI.mjs.map +0 -1
  162. package/dist/chunk-T4QJQK76.mjs +0 -459
  163. package/dist/chunk-T4QJQK76.mjs.map +0 -1
  164. package/dist/chunk-TQAEEJB4.mjs +0 -157
  165. package/dist/chunk-TQAEEJB4.mjs.map +0 -1
  166. package/dist/chunk-UB5UOSHB.mjs +0 -458
  167. package/dist/chunk-UB5UOSHB.mjs.map +0 -1
  168. package/dist/chunk-USWZZUEH.mjs +0 -25
  169. package/dist/chunk-USWZZUEH.mjs.map +0 -1
  170. package/dist/chunk-UVCIEUJC.mjs +0 -16
  171. package/dist/chunk-UVCIEUJC.mjs.map +0 -1
  172. package/dist/chunk-UXUAWNO5.mjs +0 -396
  173. package/dist/chunk-UXUAWNO5.mjs.map +0 -1
  174. package/dist/chunk-V3XURYJO.mjs +0 -756
  175. package/dist/chunk-V3XURYJO.mjs.map +0 -1
  176. package/dist/chunk-V6WE6JSZ.mjs +0 -352
  177. package/dist/chunk-V6WE6JSZ.mjs.map +0 -1
  178. package/dist/chunk-V7RBCSDJ.mjs +0 -170
  179. package/dist/chunk-V7RBCSDJ.mjs.map +0 -1
  180. package/dist/chunk-VCANOYFI.mjs +0 -588
  181. package/dist/chunk-VCANOYFI.mjs.map +0 -1
  182. package/dist/chunk-VY2UYN5R.mjs +0 -224
  183. package/dist/chunk-VY2UYN5R.mjs.map +0 -1
  184. package/dist/chunk-W2CRQFF6.mjs +0 -1352
  185. package/dist/chunk-W2CRQFF6.mjs.map +0 -1
  186. package/dist/chunk-WZ5QFROO.mjs +0 -23
  187. package/dist/chunk-WZ5QFROO.mjs.map +0 -1
  188. package/dist/chunk-XIVV5IWN.mjs +0 -541
  189. package/dist/chunk-XIVV5IWN.mjs.map +0 -1
  190. package/dist/chunk-YW7OBE6Q.mjs +0 -119
  191. package/dist/chunk-YW7OBE6Q.mjs.map +0 -1
  192. package/dist/chunk-Z5CQMP54.mjs +0 -365
  193. package/dist/chunk-Z5CQMP54.mjs.map +0 -1
  194. package/dist/chunk-ZBE6MLHL.mjs +0 -230
  195. package/dist/chunk-ZBE6MLHL.mjs.map +0 -1
  196. package/dist/chunk-ZZ57EH5Z.mjs +0 -173
  197. package/dist/chunk-ZZ57EH5Z.mjs.map +0 -1
  198. package/dist/client-BT1mFQas.d.mts +0 -447
  199. package/dist/client-Nn0q4eO4.d.ts +0 -447
  200. package/dist/client-cache-CIlyBlmx.d.ts +0 -6
  201. package/dist/client-cache-D-EZ7XVW.d.mts +0 -6
  202. package/dist/client-plugins-Cw4qUGsw.d.ts +0 -1855
  203. package/dist/client-plugins-DQQ1adXM.d.mts +0 -1855
  204. package/dist/client-plugins.cjs +0 -415
  205. package/dist/client-plugins.cjs.map +0 -1
  206. package/dist/client-plugins.d.mts +0 -22
  207. package/dist/client-plugins.d.ts +0 -22
  208. package/dist/client-plugins.mjs +0 -10
  209. package/dist/client-plugins.mjs.map +0 -1
  210. package/dist/client.cjs +0 -5402
  211. package/dist/client.cjs.map +0 -1
  212. package/dist/client.d.mts +0 -447
  213. package/dist/client.d.ts +0 -447
  214. package/dist/client.mjs +0 -110
  215. package/dist/client.mjs.map +0 -1
  216. package/dist/config.cjs +0 -38
  217. package/dist/config.cjs.map +0 -1
  218. package/dist/config.d.mts +0 -29
  219. package/dist/config.d.ts +0 -29
  220. package/dist/config.mjs +0 -10
  221. package/dist/config.mjs.map +0 -1
  222. package/dist/cron.cjs +0 -406
  223. package/dist/cron.cjs.map +0 -1
  224. package/dist/cron.d.mts +0 -78
  225. package/dist/cron.d.ts +0 -78
  226. package/dist/cron.mjs +0 -30
  227. package/dist/cron.mjs.map +0 -1
  228. package/dist/deferred.cjs +0 -438
  229. package/dist/deferred.cjs.map +0 -1
  230. package/dist/deferred.d.mts +0 -42
  231. package/dist/deferred.d.ts +0 -42
  232. package/dist/deferred.mjs +0 -28
  233. package/dist/deferred.mjs.map +0 -1
  234. package/dist/deployment.cjs +0 -199
  235. package/dist/deployment.cjs.map +0 -1
  236. package/dist/deployment.d.mts +0 -34
  237. package/dist/deployment.d.ts +0 -34
  238. package/dist/deployment.mjs +0 -38
  239. package/dist/deployment.mjs.map +0 -1
  240. package/dist/devtools-LVC3VB5P.mjs +0 -370
  241. package/dist/devtools-LVC3VB5P.mjs.map +0 -1
  242. package/dist/devtools-client-3XRTBND5.mjs +0 -216
  243. package/dist/devtools-client-3XRTBND5.mjs.map +0 -1
  244. package/dist/devtools-ui-NJKFORTG.mjs +0 -1349
  245. package/dist/devtools-ui-NJKFORTG.mjs.map +0 -1
  246. package/dist/docs.cjs +0 -5553
  247. package/dist/docs.cjs.map +0 -1
  248. package/dist/docs.d.mts +0 -69
  249. package/dist/docs.d.ts +0 -69
  250. package/dist/docs.mjs +0 -46
  251. package/dist/docs.mjs.map +0 -1
  252. package/dist/env-types.cjs +0 -223
  253. package/dist/env-types.cjs.map +0 -1
  254. package/dist/env-types.d.mts +0 -11
  255. package/dist/env-types.d.ts +0 -11
  256. package/dist/env-types.mjs +0 -9
  257. package/dist/env-types.mjs.map +0 -1
  258. package/dist/env.cjs +0 -215
  259. package/dist/env.cjs.map +0 -1
  260. package/dist/env.d.mts +0 -45
  261. package/dist/env.d.ts +0 -45
  262. package/dist/env.mjs +0 -22
  263. package/dist/env.mjs.map +0 -1
  264. package/dist/environment/vite.d.mts +0 -22
  265. package/dist/environment/vite.d.ts +0 -22
  266. package/dist/environment.cjs +0 -96
  267. package/dist/environment.cjs.map +0 -1
  268. package/dist/environment.d.mts +0 -18
  269. package/dist/environment.d.ts +0 -18
  270. package/dist/environment.mjs +0 -14
  271. package/dist/environment.mjs.map +0 -1
  272. package/dist/headers.cjs +0 -126
  273. package/dist/headers.cjs.map +0 -1
  274. package/dist/headers.d.mts +0 -22
  275. package/dist/headers.d.ts +0 -22
  276. package/dist/headers.mjs +0 -12
  277. package/dist/headers.mjs.map +0 -1
  278. package/dist/i18n/client.d.mts +0 -32
  279. package/dist/i18n/client.d.ts +0 -32
  280. package/dist/i18n/index.d.mts +0 -20
  281. package/dist/i18n/index.d.ts +0 -20
  282. package/dist/i18n/server.d.mts +0 -30
  283. package/dist/i18n/server.d.ts +0 -30
  284. package/dist/image/server.d.mts +0 -37
  285. package/dist/image/server.d.ts +0 -37
  286. package/dist/image/sharp.d.mts +0 -7
  287. package/dist/image/sharp.d.ts +0 -7
  288. package/dist/image-config-Duob7wER.d.mts +0 -50
  289. package/dist/image-config-Duob7wER.d.ts +0 -50
  290. package/dist/image.cjs +0 -209
  291. package/dist/image.cjs.map +0 -1
  292. package/dist/image.d.mts +0 -39
  293. package/dist/image.d.ts +0 -39
  294. package/dist/image.mjs +0 -165
  295. package/dist/image.mjs.map +0 -1
  296. package/dist/index.cjs +0 -41822
  297. package/dist/index.cjs.map +0 -1
  298. package/dist/index.d.mts +0 -451
  299. package/dist/index.d.ts +0 -451
  300. package/dist/index.mjs +0 -973
  301. package/dist/index.mjs.map +0 -1
  302. package/dist/integration-api-CHT2OKAf.d.mts +0 -93
  303. package/dist/integration-api-CHT2OKAf.d.ts +0 -93
  304. package/dist/integration-orm-GQLGU66X.mjs +0 -13
  305. package/dist/integration-orm-GQLGU66X.mjs.map +0 -1
  306. package/dist/integrations.cjs +0 -2820
  307. package/dist/integrations.cjs.map +0 -1
  308. package/dist/integrations.d.mts +0 -22
  309. package/dist/integrations.d.ts +0 -22
  310. package/dist/integrations.mjs +0 -51
  311. package/dist/integrations.mjs.map +0 -1
  312. package/dist/internal/build-runtime.d.mts +0 -39
  313. package/dist/internal/build-runtime.d.ts +0 -39
  314. package/dist/internal/client-runtime.d.mts +0 -2
  315. package/dist/internal/client-runtime.d.ts +0 -2
  316. package/dist/internal/config-runtime.d.mts +0 -39
  317. package/dist/internal/config-runtime.d.ts +0 -39
  318. package/dist/internal/production-node-env.d.mts +0 -12
  319. package/dist/internal/production-node-env.d.ts +0 -12
  320. package/dist/internal/production-runtime.d.mts +0 -39
  321. package/dist/internal/production-runtime.d.ts +0 -39
  322. package/dist/layers-VWVDTPUZ.mjs +0 -16
  323. package/dist/layers-VWVDTPUZ.mjs.map +0 -1
  324. package/dist/manager-THKFTOFE.mjs +0 -10
  325. package/dist/manager-THKFTOFE.mjs.map +0 -1
  326. package/dist/markdown.cjs +0 -299
  327. package/dist/markdown.cjs.map +0 -1
  328. package/dist/markdown.d.mts +0 -43
  329. package/dist/markdown.d.ts +0 -43
  330. package/dist/markdown.mjs +0 -14
  331. package/dist/markdown.mjs.map +0 -1
  332. package/dist/metadata-BAPg_Nmo.d.ts +0 -22
  333. package/dist/metadata-_6i9oFG3.d.mts +0 -22
  334. package/dist/middleware.cjs +0 -2148
  335. package/dist/middleware.cjs.map +0 -1
  336. package/dist/middleware.d.mts +0 -164
  337. package/dist/middleware.d.ts +0 -164
  338. package/dist/middleware.mjs +0 -49
  339. package/dist/middleware.mjs.map +0 -1
  340. package/dist/navigation-errors-Dvwpzaer.d.mts +0 -13
  341. package/dist/navigation-errors-Dvwpzaer.d.ts +0 -13
  342. package/dist/navigation.cjs +0 -1329
  343. package/dist/navigation.cjs.map +0 -1
  344. package/dist/navigation.d.mts +0 -14
  345. package/dist/navigation.d.ts +0 -14
  346. package/dist/navigation.mjs +0 -33
  347. package/dist/navigation.mjs.map +0 -1
  348. package/dist/nitro-QO5LV6QK.mjs +0 -689
  349. package/dist/nitro-QO5LV6QK.mjs.map +0 -1
  350. package/dist/observability.cjs +0 -186
  351. package/dist/observability.cjs.map +0 -1
  352. package/dist/observability.d.mts +0 -335
  353. package/dist/observability.d.ts +0 -335
  354. package/dist/observability.mjs +0 -16
  355. package/dist/observability.mjs.map +0 -1
  356. package/dist/params-BALtrRim.d.ts +0 -15
  357. package/dist/params-ry-lxqmy.d.mts +0 -15
  358. package/dist/plugin-BJDf43dc.d.mts +0 -165
  359. package/dist/plugin-BJDf43dc.d.ts +0 -165
  360. package/dist/plugin.cjs +0 -23225
  361. package/dist/plugin.d.mts +0 -22
  362. package/dist/plugin.d.ts +0 -22
  363. package/dist/production-runtime-BoJDc5mc.d.ts +0 -79
  364. package/dist/production-runtime-C_B79w2P.d.mts +0 -28
  365. package/dist/production-runtime-DDEM1D2q.d.ts +0 -28
  366. package/dist/production-runtime-DPfgMV9Y.d.mts +0 -79
  367. package/dist/query/client.d.mts +0 -61
  368. package/dist/query/client.d.ts +0 -61
  369. package/dist/query/index.d.mts +0 -90
  370. package/dist/query/index.d.ts +0 -90
  371. package/dist/query/parsers.d.mts +0 -25
  372. package/dist/query/parsers.d.ts +0 -25
  373. package/dist/query/server.d.mts +0 -55
  374. package/dist/query/server.d.ts +0 -55
  375. package/dist/request-BrFBuc8G.d.mts +0 -6
  376. package/dist/request-BslSZIRz.d.ts +0 -6
  377. package/dist/request.d.mts +0 -2
  378. package/dist/request.d.ts +0 -2
  379. package/dist/resolver-C6iecsDV.d.ts +0 -14
  380. package/dist/resolver-DlOPpjkB.d.mts +0 -14
  381. package/dist/route-runtime-DoOHzCAD.d.mts +0 -38
  382. package/dist/route-runtime-DoOHzCAD.d.ts +0 -38
  383. package/dist/router.d.mts +0 -36
  384. package/dist/router.d.ts +0 -36
  385. package/dist/routes.d.mts +0 -224
  386. package/dist/routes.d.ts +0 -224
  387. package/dist/runtime-9nQjVM7X.d.mts +0 -206
  388. package/dist/runtime-B6GvwDS1.d.ts +0 -27
  389. package/dist/runtime-DeAAZ6gO.d.mts +0 -27
  390. package/dist/runtime-DgeS2skB.d.ts +0 -206
  391. package/dist/server-action-security.d.mts +0 -43
  392. package/dist/server-action-security.d.ts +0 -43
  393. package/dist/server-fn-client.d.mts +0 -32
  394. package/dist/server-fn-client.d.ts +0 -32
  395. package/dist/server-fn.d.mts +0 -93
  396. package/dist/server-fn.d.ts +0 -93
  397. package/dist/server-plugins.d.mts +0 -55
  398. package/dist/server-plugins.d.ts +0 -55
  399. package/dist/server-query-client.d.mts +0 -50
  400. package/dist/server-query-client.d.ts +0 -50
  401. package/dist/server-query.d.mts +0 -36
  402. package/dist/server-query.d.ts +0 -36
  403. package/dist/server.d.mts +0 -48
  404. package/dist/server.d.ts +0 -48
  405. package/dist/storage.d.mts +0 -52
  406. package/dist/storage.d.ts +0 -52
  407. package/dist/testing.d.mts +0 -101
  408. package/dist/testing.d.ts +0 -101
  409. package/dist/transport-BmbGTXA5.d.mts +0 -49
  410. package/dist/transport-BmbGTXA5.d.ts +0 -49
  411. package/dist/types-BH1lhg5G.d.mts +0 -81
  412. package/dist/types-BH1lhg5G.d.ts +0 -81
  413. package/dist/types-C9N-nk5R.d.mts +0 -53
  414. package/dist/types-C9N-nk5R.d.ts +0 -53
  415. package/dist/types-D1A6-XvH.d.mts +0 -73
  416. package/dist/types-D1A6-XvH.d.ts +0 -73
  417. package/dist/utils-CHXlMDkg.d.mts +0 -23
  418. package/dist/utils-Drsyz1Vj.d.ts +0 -23
  419. package/dist/version.d.mts +0 -3
  420. package/dist/version.d.ts +0 -3
  421. package/dist/vite.d.mts +0 -22
  422. package/dist/vite.d.ts +0 -22
  423. package/dist/workflows.d.mts +0 -110
  424. package/dist/workflows.d.ts +0 -110
@@ -1,872 +0,0 @@
1
- import {
2
- getAPIRouteRefMetadata,
3
- isAPIRouteRef
4
- } from "./chunk-W2CRQFF6.mjs";
5
- import {
6
- isFarmLocaleChangeHref,
7
- localizeActiveFarmHref
8
- } from "./chunk-ITN462YM.mjs";
9
- import {
10
- buildFarmRoutePath
11
- } from "./chunk-ZBE6MLHL.mjs";
12
- import {
13
- __name
14
- } from "./chunk-CGILA3WO.mjs";
15
-
16
- // src/mutation-client.ts
17
- import { useCallback, useMemo, useRef, useState } from "react";
18
- function useMutation(target, options = {}) {
19
- const initialData = options.initialData ?? null;
20
- const optionsRef = useRef(options);
21
- const targetRef = useRef(target);
22
- const requestIdRef = useRef(0);
23
- const initialState = {
24
- pendingCount: 0,
25
- status: "idle",
26
- data: initialData,
27
- error: null,
28
- variables: void 0
29
- };
30
- const stateRef = useRef(initialState);
31
- const [state, setState] = useState(initialState);
32
- optionsRef.current = options;
33
- targetRef.current = target;
34
- const setMutationState = useCallback(
35
- (value) => {
36
- setState((current) => {
37
- const next = typeof value === "function" ? value(current) : value;
38
- stateRef.current = next;
39
- return next;
40
- });
41
- },
42
- []
43
- );
44
- const mutateAsync = useCallback(
45
- async (variables) => {
46
- const requestId = ++requestIdRef.current;
47
- const currentOptions = optionsRef.current;
48
- const previousData = stateRef.current.data;
49
- const optimisticData = currentOptions.optimistic?.({
50
- variables,
51
- current: previousData
52
- });
53
- const hasOptimisticData = optimisticData !== void 0;
54
- setMutationState((current) => ({
55
- pendingCount: current.pendingCount + 1,
56
- status: "pending",
57
- data: hasOptimisticData ? optimisticData : currentOptions.resetOnMutate === false ? current.data : null,
58
- error: null,
59
- variables
60
- }));
61
- try {
62
- const mutationTarget = targetRef.current;
63
- const rawResult = isAPIRouteRef(mutationTarget) ? await mutationTarget(variables, currentOptions.request) : await mutationTarget(variables);
64
- const data = unwrapMutationResult(rawResult, isAPIRouteRef(mutationTarget));
65
- const isLatestRequest = requestId === requestIdRef.current;
66
- setMutationState((current) => {
67
- const pendingCount = Math.max(0, current.pendingCount - 1);
68
- if (!isLatestRequest) {
69
- return {
70
- ...current,
71
- pendingCount,
72
- status: pendingCount > 0 ? "pending" : current.status
73
- };
74
- }
75
- return {
76
- pendingCount,
77
- status: "success",
78
- data,
79
- error: null,
80
- variables
81
- };
82
- });
83
- if (isLatestRequest) {
84
- currentOptions.onSuccess?.(data, variables);
85
- currentOptions.onSettled?.(data, null, variables);
86
- }
87
- return data;
88
- } catch (cause) {
89
- const error = normalizeMutationError(cause);
90
- const isLatestRequest = requestId === requestIdRef.current;
91
- setMutationState((current) => {
92
- const pendingCount = Math.max(0, current.pendingCount - 1);
93
- if (!isLatestRequest) {
94
- return {
95
- ...current,
96
- pendingCount,
97
- status: pendingCount > 0 ? "pending" : current.status
98
- };
99
- }
100
- return {
101
- pendingCount,
102
- status: "error",
103
- data: hasOptimisticData && currentOptions.rollbackOnError ? previousData : currentOptions.resetOnMutate === false ? current.data : null,
104
- error,
105
- variables
106
- };
107
- });
108
- if (isLatestRequest) {
109
- currentOptions.onError?.(error, variables);
110
- currentOptions.onSettled?.(null, error, variables);
111
- }
112
- throw error;
113
- }
114
- },
115
- [setMutationState]
116
- );
117
- const mutate = useCallback(
118
- (variables) => {
119
- void mutateAsync(variables).catch(() => {
120
- });
121
- },
122
- [mutateAsync]
123
- );
124
- const reset = useCallback(() => {
125
- requestIdRef.current += 1;
126
- setMutationState({
127
- pendingCount: 0,
128
- status: "idle",
129
- data: optionsRef.current.initialData ?? null,
130
- error: null,
131
- variables: void 0
132
- });
133
- }, [setMutationState]);
134
- return useMemo(
135
- () => ({
136
- pending: state.pendingCount > 0,
137
- status: state.status,
138
- data: state.data,
139
- error: state.error,
140
- variables: state.variables,
141
- mutate,
142
- mutateAsync,
143
- reset
144
- }),
145
- [
146
- mutate,
147
- mutateAsync,
148
- reset,
149
- state.data,
150
- state.error,
151
- state.pendingCount,
152
- state.status,
153
- state.variables
154
- ]
155
- );
156
- }
157
- __name(useMutation, "useMutation");
158
- function unwrapMutationResult(result, apiRoute) {
159
- if (!apiRoute) return result;
160
- const apiResult = result;
161
- if (apiResult.error) {
162
- throw apiResult.error;
163
- }
164
- return apiResult.data;
165
- }
166
- __name(unwrapMutationResult, "unwrapMutationResult");
167
- function normalizeMutationError(error) {
168
- if (error instanceof Error) return error;
169
- const normalized = new Error(typeof error === "string" ? error : "Mutation failed");
170
- normalized.cause = error;
171
- return normalized;
172
- }
173
- __name(normalizeMutationError, "normalizeMutationError");
174
-
175
- // src/fetcher-client.tsx
176
- import {
177
- createElement,
178
- useCallback as useCallback2,
179
- useMemo as useMemo2,
180
- useRef as useRef2,
181
- useState as useState2
182
- } from "react";
183
- var formDataContexts = /* @__PURE__ */ new WeakMap();
184
- function useFetcher(target, options = {}) {
185
- const targetRef = useRef2(target);
186
- const optionsRef = useRef2(options);
187
- const submissionIdRef = useRef2(0);
188
- const [formData, setFormData] = useState2(null);
189
- const mutation = useMutation(target, options);
190
- targetRef.current = target;
191
- optionsRef.current = options;
192
- const submitAsync = useCallback2(
193
- async (input) => {
194
- const submissionId = ++submissionIdRef.current;
195
- const submittedFormData = isFormData(input) ? input : null;
196
- setFormData(submittedFormData);
197
- try {
198
- const variables = submittedFormData ? mapFetcherFormData(targetRef.current, submittedFormData, optionsRef.current) : input;
199
- return await mutation.mutateAsync(variables);
200
- } finally {
201
- if (submissionId === submissionIdRef.current) {
202
- setFormData(null);
203
- }
204
- }
205
- },
206
- [mutation.mutateAsync]
207
- );
208
- const submit = useCallback2(
209
- (input) => {
210
- void submitAsync(input).catch(() => {
211
- });
212
- },
213
- [submitAsync]
214
- );
215
- const Form = useMemo2(() => {
216
- const FetcherForm = /* @__PURE__ */ __name(({ action, method, encType, onSubmit, ...props }) => {
217
- const targetValue = targetRef.current;
218
- const metadata = getAPIRouteRefMetadata(targetValue);
219
- const nativeAction = action ?? resolveFetcherFormAction(targetValue, metadata);
220
- const nativeMethod = method ?? (metadata && (metadata.method === "GET" || metadata.method === "POST") ? metadata.method.toLowerCase() : metadata ? "post" : void 0);
221
- const functionAction = typeof nativeAction === "function";
222
- const handleSubmit = /* @__PURE__ */ __name((event) => {
223
- onSubmit?.(event);
224
- if (event.defaultPrevented) return;
225
- event.preventDefault();
226
- const submitter = getSubmitter(event);
227
- const nextFormData = createSubmitterFormData(event.currentTarget, submitter);
228
- formDataContexts.set(nextFormData, {
229
- form: event.currentTarget,
230
- submitter
231
- });
232
- void submitAsync(nextFormData).catch(() => {
233
- });
234
- }, "handleSubmit");
235
- return createElement("form", {
236
- ...props,
237
- action: nativeAction,
238
- method: functionAction ? void 0 : nativeMethod,
239
- encType: functionAction ? void 0 : encType,
240
- onSubmit: handleSubmit
241
- });
242
- }, "FetcherForm");
243
- FetcherForm.displayName = "FetcherForm";
244
- return FetcherForm;
245
- }, [submitAsync]);
246
- const reset = useCallback2(() => {
247
- submissionIdRef.current += 1;
248
- setFormData(null);
249
- mutation.reset();
250
- }, [mutation.reset]);
251
- return useMemo2(
252
- () => ({
253
- state: mutation.pending ? "submitting" : "idle",
254
- status: mutation.status,
255
- pending: mutation.pending,
256
- data: mutation.data,
257
- error: mutation.error,
258
- variables: mutation.variables,
259
- formData,
260
- submit,
261
- submitAsync,
262
- Form,
263
- reset
264
- }),
265
- [
266
- Form,
267
- formData,
268
- mutation.data,
269
- mutation.error,
270
- mutation.pending,
271
- mutation.status,
272
- mutation.variables,
273
- reset,
274
- submit,
275
- submitAsync
276
- ]
277
- );
278
- }
279
- __name(useFetcher, "useFetcher");
280
- function mapFetcherFormData(target, formData, options) {
281
- const context = formDataContexts.get(formData) ?? { form: null, submitter: null };
282
- if (options.mapFormData) {
283
- return options.mapFormData(formData, context);
284
- }
285
- if (!isAPIRouteRef(target)) {
286
- return formData;
287
- }
288
- const values = formDataToObject(formData);
289
- const method = getAPIRouteRefMetadata(target)?.method;
290
- return method === "GET" || method === "HEAD" ? { query: values } : { body: values };
291
- }
292
- __name(mapFetcherFormData, "mapFetcherFormData");
293
- function resolveFetcherFormAction(target, metadata) {
294
- if (!metadata) return isProgressiveFormAction(target) ? target : void 0;
295
- if (metadata.sameOrigin) return metadata.path;
296
- return new URL(metadata.path, metadata.baseURL).href;
297
- }
298
- __name(resolveFetcherFormAction, "resolveFetcherFormAction");
299
- function formDataToObject(formData) {
300
- const output = /* @__PURE__ */ Object.create(null);
301
- for (const [key, value] of formData.entries()) {
302
- if (key === "__proto__" || key === "constructor" || key === "prototype") continue;
303
- const current = output[key];
304
- if (current === void 0) {
305
- output[key] = value;
306
- } else if (Array.isArray(current)) {
307
- current.push(value);
308
- } else {
309
- output[key] = [current, value];
310
- }
311
- }
312
- return output;
313
- }
314
- __name(formDataToObject, "formDataToObject");
315
- function createSubmitterFormData(form, submitter) {
316
- try {
317
- return new FormData(form, submitter);
318
- } catch {
319
- const formData = new FormData(form);
320
- const candidate = submitter;
321
- if (candidate && !candidate.disabled && candidate.name) {
322
- formData.append(candidate.name, candidate.value ?? "");
323
- }
324
- return formData;
325
- }
326
- }
327
- __name(createSubmitterFormData, "createSubmitterFormData");
328
- function getSubmitter(event) {
329
- const nativeEvent = event.nativeEvent;
330
- return nativeEvent.submitter instanceof HTMLElement ? nativeEvent.submitter : null;
331
- }
332
- __name(getSubmitter, "getSubmitter");
333
- function isProgressiveFormAction(target) {
334
- const candidate = target;
335
- return candidate.__farmServerFn === true || typeof candidate.$$FORM_ACTION === "function" || candidate.$$typeof === /* @__PURE__ */ Symbol.for("react.server.reference");
336
- }
337
- __name(isProgressiveFormAction, "isProgressiveFormAction");
338
- function isFormData(value) {
339
- if (!value || typeof value !== "object") return false;
340
- return typeof FormData !== "undefined" && value instanceof FormData || Object.prototype.toString.call(value) === "[object FormData]" && typeof value.entries === "function";
341
- }
342
- __name(isFormData, "isFormData");
343
-
344
- // src/store.ts
345
- import { useSyncExternalStore } from "react";
346
- var RESERVED_STORE_KEYS = /* @__PURE__ */ new Set([
347
- "use",
348
- "get",
349
- "set",
350
- "replace",
351
- "reset",
352
- "subscribe"
353
- ]);
354
- function cloneState(state) {
355
- return { ...state };
356
- }
357
- __name(cloneState, "cloneState");
358
- function pickState(state, keys) {
359
- const slice = {};
360
- for (const key of keys) {
361
- slice[key] = state[key];
362
- }
363
- return slice;
364
- }
365
- __name(pickState, "pickState");
366
- function getChangedKeys(state, previousState) {
367
- const keys = /* @__PURE__ */ new Set([
368
- ...Object.keys(state),
369
- ...Object.keys(previousState)
370
- ]);
371
- return [...keys].filter((key) => !Object.is(state[key], previousState[key]));
372
- }
373
- __name(getChangedKeys, "getChangedKeys");
374
- function normalizeKeys(keys) {
375
- return Array.from(new Set(keys));
376
- }
377
- __name(normalizeKeys, "normalizeKeys");
378
- function resolveValue(value, previousValue) {
379
- return typeof value === "function" ? value(previousValue) : value;
380
- }
381
- __name(resolveValue, "resolveValue");
382
- function isStoreKey(value) {
383
- return typeof value === "string" || typeof value === "number" || typeof value === "symbol";
384
- }
385
- __name(isStoreKey, "isStoreKey");
386
- function createStore(initialState, extend) {
387
- const initialSnapshot = cloneState(initialState);
388
- let state = cloneState(initialState);
389
- const subscriptions = /* @__PURE__ */ new Set();
390
- const addSubscription = /* @__PURE__ */ __name((keys, notify) => {
391
- const subscription = { keys, notify };
392
- subscriptions.add(subscription);
393
- return () => {
394
- subscriptions.delete(subscription);
395
- };
396
- }, "addSubscription");
397
- const emit = /* @__PURE__ */ __name((nextState, previousState) => {
398
- const changedKeys = getChangedKeys(nextState, previousState);
399
- if (changedKeys.length === 0) {
400
- return;
401
- }
402
- const changedKeySet = new Set(changedKeys);
403
- for (const subscription of subscriptions) {
404
- if (subscription.keys === null || subscription.keys.some((key) => changedKeySet.has(key))) {
405
- subscription.notify(nextState, previousState);
406
- }
407
- }
408
- }, "emit");
409
- const getState = /* @__PURE__ */ __name((key) => {
410
- return key === void 0 ? state : state[key];
411
- }, "getState");
412
- const replaceState2 = /* @__PURE__ */ __name((nextState) => {
413
- const previousState = state;
414
- const resolvedState = typeof nextState === "function" ? nextState(previousState) : nextState;
415
- state = resolvedState;
416
- emit(state, previousState);
417
- return state;
418
- }, "replaceState");
419
- const setState = /* @__PURE__ */ __name((keyOrPatch, value) => {
420
- const previousState = state;
421
- let nextState;
422
- if (isStoreKey(keyOrPatch)) {
423
- const key = keyOrPatch;
424
- const nextValue = resolveValue(value, previousState[key]);
425
- if (Object.is(previousState[key], nextValue)) {
426
- return nextValue;
427
- }
428
- nextState = {
429
- ...previousState,
430
- [key]: nextValue
431
- };
432
- state = nextState;
433
- emit(nextState, previousState);
434
- return nextValue;
435
- }
436
- const patch = typeof keyOrPatch === "function" ? keyOrPatch(previousState) : keyOrPatch;
437
- nextState = {
438
- ...previousState,
439
- ...patch
440
- };
441
- state = nextState;
442
- emit(nextState, previousState);
443
- return nextState;
444
- }, "setState");
445
- const subscribeState = /* @__PURE__ */ __name((keyOrListener, listener) => {
446
- if (typeof keyOrListener === "function") {
447
- return addSubscription(null, (nextState, previousState) => {
448
- keyOrListener(nextState, previousState);
449
- });
450
- }
451
- if (Array.isArray(keyOrListener)) {
452
- const keys = normalizeKeys(keyOrListener);
453
- return addSubscription(keys, (nextState, previousState) => {
454
- listener(
455
- pickState(nextState, keys),
456
- pickState(previousState, keys)
457
- );
458
- });
459
- }
460
- const key = keyOrListener;
461
- return addSubscription([key], (nextState, previousState) => {
462
- listener(nextState[key], previousState[key]);
463
- });
464
- }, "subscribeState");
465
- const useStateValue = /* @__PURE__ */ __name((keyOrKeys) => {
466
- if (Array.isArray(keyOrKeys)) {
467
- const keys = normalizeKeys(keyOrKeys);
468
- let lastState = state;
469
- let lastSlice = pickState(state, keys);
470
- const getSnapshot = /* @__PURE__ */ __name(() => {
471
- if (lastState !== state) {
472
- lastState = state;
473
- lastSlice = pickState(state, keys);
474
- }
475
- return lastSlice;
476
- }, "getSnapshot");
477
- return useSyncExternalStore(
478
- (notify) => addSubscription(keys, () => notify()),
479
- getSnapshot,
480
- getSnapshot
481
- );
482
- }
483
- if (typeof keyOrKeys === "string") {
484
- return useSyncExternalStore(
485
- (notify) => addSubscription([keyOrKeys], () => notify()),
486
- () => state[keyOrKeys],
487
- () => state[keyOrKeys]
488
- );
489
- }
490
- return useSyncExternalStore(
491
- (notify) => addSubscription(null, () => notify()),
492
- () => state,
493
- () => state
494
- );
495
- }, "useStateValue");
496
- const store = {
497
- use: useStateValue,
498
- get: getState,
499
- set: setState,
500
- replace: replaceState2,
501
- reset: /* @__PURE__ */ __name(() => replaceState2(cloneState(initialSnapshot)), "reset"),
502
- subscribe: subscribeState
503
- };
504
- for (const key of Object.keys(initialSnapshot)) {
505
- if (RESERVED_STORE_KEYS.has(key)) {
506
- throw new Error(
507
- `createStore does not allow the reserved key "${String(key)}" in the initial state.`
508
- );
509
- }
510
- const field = /* @__PURE__ */ __name((() => useStateValue(key)), "field");
511
- field.get = () => state[key];
512
- field.set = (value) => setState(key, value);
513
- field.subscribe = (listener) => subscribeState(key, listener);
514
- Object.defineProperty(store, key, {
515
- configurable: false,
516
- enumerable: true,
517
- value: field,
518
- writable: false
519
- });
520
- }
521
- if (extend) {
522
- const methods = extend(store);
523
- for (const [name, method] of Object.entries(methods)) {
524
- if (name in store) {
525
- throw new Error(
526
- `createStore cannot attach the method "${name}" because it already exists.`
527
- );
528
- }
529
- Object.defineProperty(store, name, {
530
- configurable: false,
531
- enumerable: true,
532
- value: method,
533
- writable: false
534
- });
535
- }
536
- }
537
- return store;
538
- }
539
- __name(createStore, "createStore");
540
-
541
- // src/client/link.tsx
542
- import { forwardRef, useEffect, useRef as useRef3, useCallback as useCallback3 } from "react";
543
- import { jsx } from "react/jsx-runtime";
544
- function isModifierEvent(e) {
545
- return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
546
- }
547
- __name(isModifierEvent, "isModifierEvent");
548
- function isExternalUrl(href) {
549
- return href.startsWith("http://") || href.startsWith("https://") || href.startsWith("//");
550
- }
551
- __name(isExternalUrl, "isExternalUrl");
552
- function getRouter() {
553
- if (typeof window !== "undefined" && window.__FARM_SPA_ROUTER__) {
554
- return window.__FARM_SPA_ROUTER__;
555
- }
556
- return null;
557
- }
558
- __name(getRouter, "getRouter");
559
- function normalizePrefetch(prefetch2) {
560
- if (prefetch2 === false || prefetch2 === "none") {
561
- return { intent: false, viewport: false, render: false };
562
- }
563
- if (prefetch2 === true) {
564
- return { intent: true, viewport: true, render: false };
565
- }
566
- if (prefetch2 === "hover") {
567
- return { intent: true, viewport: false, render: false };
568
- }
569
- if (prefetch2 === "intent") {
570
- return { intent: true, viewport: false, render: false };
571
- }
572
- if (prefetch2 === "viewport") {
573
- return { intent: false, viewport: true, render: false };
574
- }
575
- if (prefetch2 === "render") {
576
- return { intent: false, viewport: false, render: true };
577
- }
578
- return { intent: false, viewport: false, render: false };
579
- }
580
- __name(normalizePrefetch, "normalizePrefetch");
581
- function LinkInner({
582
- href,
583
- params,
584
- query,
585
- hash,
586
- trailingSlash,
587
- prefetch: prefetch2 = true,
588
- prefetchDelay = 50,
589
- replace = false,
590
- scroll = true,
591
- viewTransition = false,
592
- locale,
593
- onClick,
594
- target,
595
- onMouseEnter,
596
- onMouseLeave,
597
- onFocus,
598
- onBlur,
599
- onTouchStart,
600
- ...props
601
- }, ref) {
602
- const elementRef = useRef3(null);
603
- const intentTimeoutRef = useRef3(null);
604
- const hasPrefetched = useRef3(false);
605
- const { intent, viewport, render } = normalizePrefetch(prefetch2);
606
- const baseHref = resolveLinkHref(href, params, {
607
- query,
608
- hash,
609
- trailingSlash
610
- });
611
- const resolvedHref = localizeActiveFarmHref(baseHref, locale);
612
- const isExternal = isExternalUrl(resolvedHref);
613
- const doPrefetch = useCallback3(() => {
614
- if (isExternal || hasPrefetched.current) return;
615
- const router = getRouter();
616
- if (!router) return;
617
- hasPrefetched.current = true;
618
- router.prefetch(resolvedHref);
619
- }, [resolvedHref, isExternal]);
620
- useEffect(() => {
621
- hasPrefetched.current = false;
622
- }, [resolvedHref]);
623
- useEffect(() => {
624
- const element = elementRef.current;
625
- if (!element || isExternal) return;
626
- const router = getRouter();
627
- if (!router) return;
628
- if (viewport) {
629
- router.observeForPrefetch(element);
630
- return () => router.unobserveForPrefetch(element);
631
- }
632
- }, [resolvedHref, viewport, isExternal]);
633
- useEffect(() => {
634
- if (!render || isExternal) return;
635
- let cancelled = false;
636
- let timeoutId = null;
637
- const tryRenderPrefetch = /* @__PURE__ */ __name(() => {
638
- if (cancelled || hasPrefetched.current) return;
639
- const router = getRouter();
640
- if (!router) {
641
- timeoutId = setTimeout(tryRenderPrefetch, 30);
642
- return;
643
- }
644
- hasPrefetched.current = true;
645
- router.prefetch(resolvedHref);
646
- }, "tryRenderPrefetch");
647
- tryRenderPrefetch();
648
- return () => {
649
- cancelled = true;
650
- if (timeoutId) {
651
- clearTimeout(timeoutId);
652
- }
653
- };
654
- }, [render, isExternal, resolvedHref]);
655
- useEffect(() => {
656
- return () => {
657
- if (intentTimeoutRef.current) {
658
- clearTimeout(intentTimeoutRef.current);
659
- intentTimeoutRef.current = null;
660
- }
661
- };
662
- }, []);
663
- const cancelIntent = useCallback3(() => {
664
- if (intentTimeoutRef.current) {
665
- clearTimeout(intentTimeoutRef.current);
666
- intentTimeoutRef.current = null;
667
- }
668
- }, []);
669
- const scheduleIntentPrefetch = useCallback3(() => {
670
- if (isExternal || !intent || hasPrefetched.current) return;
671
- cancelIntent();
672
- intentTimeoutRef.current = setTimeout(() => {
673
- intentTimeoutRef.current = null;
674
- doPrefetch();
675
- }, prefetchDelay);
676
- }, [intent, isExternal, prefetchDelay, doPrefetch, cancelIntent]);
677
- const handleMouseEnter = useCallback3(
678
- (event) => {
679
- onMouseEnter?.(event);
680
- scheduleIntentPrefetch();
681
- },
682
- [onMouseEnter, scheduleIntentPrefetch]
683
- );
684
- const handleMouseLeave = useCallback3(
685
- (event) => {
686
- onMouseLeave?.(event);
687
- cancelIntent();
688
- },
689
- [onMouseLeave, cancelIntent]
690
- );
691
- const handleTouchStart = useCallback3(
692
- (event) => {
693
- onTouchStart?.(event);
694
- scheduleIntentPrefetch();
695
- },
696
- [onTouchStart, scheduleIntentPrefetch]
697
- );
698
- const handleFocus = useCallback3(
699
- (event) => {
700
- onFocus?.(event);
701
- scheduleIntentPrefetch();
702
- },
703
- [onFocus, scheduleIntentPrefetch]
704
- );
705
- const handleBlur = useCallback3(
706
- (event) => {
707
- onBlur?.(event);
708
- cancelIntent();
709
- },
710
- [onBlur, cancelIntent]
711
- );
712
- const handleClick = useCallback3(
713
- (event) => {
714
- onClick?.(event);
715
- if (event.defaultPrevented) return;
716
- if (isExternal) return;
717
- if (target && target !== "_self") return;
718
- if (isModifierEvent(event)) return;
719
- if (event.button !== 0) return;
720
- if (typeof window !== "undefined") {
721
- event.preventDefault();
722
- if (isFarmLocaleChangeHref(resolvedHref)) {
723
- window.location.assign(resolvedHref);
724
- return;
725
- }
726
- const router = getRouter();
727
- if (router) {
728
- router.navigate(resolvedHref, { replace, scroll, viewTransition });
729
- } else {
730
- if (replace) window.location.replace(resolvedHref);
731
- else window.location.href = resolvedHref;
732
- }
733
- }
734
- },
735
- [resolvedHref, replace, scroll, viewTransition, target, isExternal, onClick]
736
- );
737
- const setRefs = useCallback3(
738
- (node) => {
739
- elementRef.current = node;
740
- if (typeof ref === "function") ref(node);
741
- else if (ref) ref.current = node;
742
- },
743
- [ref]
744
- );
745
- return /* @__PURE__ */ jsx(
746
- "a",
747
- {
748
- ref: setRefs,
749
- href: resolvedHref,
750
- target,
751
- onClick: handleClick,
752
- onMouseEnter: handleMouseEnter,
753
- onMouseLeave: handleMouseLeave,
754
- onFocus: handleFocus,
755
- onBlur: handleBlur,
756
- onTouchStart: handleTouchStart,
757
- ...props,
758
- "data-farm-link": "",
759
- "data-replace": replace ? "" : void 0,
760
- "data-no-scroll": !scroll ? "" : void 0,
761
- "data-view-transition": viewTransition === "auto" ? "auto" : viewTransition ? "true" : void 0
762
- }
763
- );
764
- }
765
- __name(LinkInner, "LinkInner");
766
- var LinkWithRef = forwardRef(LinkInner);
767
- LinkWithRef.displayName = "Link";
768
- var Link = LinkWithRef;
769
- function resolveLinkHref(href, params, options) {
770
- if (isExternalUrl(href)) return href;
771
- const { pathname, query, hash } = splitInternalHref(href);
772
- const resolvedHref = buildFarmRoutePath(pathname, params, {
773
- query: mergeQueryParams(query, options.query),
774
- hash: options.hash ?? hash,
775
- trailingSlash: options.trailingSlash
776
- });
777
- return applyPreservedSearchParams(resolvedHref);
778
- }
779
- __name(resolveLinkHref, "resolveLinkHref");
780
- function splitInternalHref(href) {
781
- try {
782
- const url = new URL(href, "http://farm.local");
783
- return {
784
- pathname: url.pathname || "/",
785
- query: url.searchParams,
786
- hash: url.hash ? url.hash.slice(1) : void 0
787
- };
788
- } catch {
789
- const [withoutHash, rawHash] = href.split("#", 2);
790
- const [pathname, rawQuery] = withoutHash.split("?", 2);
791
- return {
792
- pathname: pathname || "/",
793
- query: new URLSearchParams(rawQuery || ""),
794
- hash: rawHash
795
- };
796
- }
797
- }
798
- __name(splitInternalHref, "splitInternalHref");
799
- function mergeQueryParams(current, next) {
800
- const merged = new URLSearchParams(current);
801
- if (next instanceof URLSearchParams) {
802
- for (const [key, value] of next.entries()) {
803
- merged.append(key, value);
804
- }
805
- } else if (next) {
806
- for (const [key, value] of Object.entries(next)) {
807
- const values = Array.isArray(value) ? value : [value];
808
- for (const item of values) {
809
- if (item == null) continue;
810
- merged.append(key, String(item));
811
- }
812
- }
813
- }
814
- return merged.toString() ? merged : void 0;
815
- }
816
- __name(mergeQueryParams, "mergeQueryParams");
817
- function applyPreservedSearchParams(href) {
818
- if (typeof window === "undefined") return href;
819
- const manifest = window.__FARM_MANIFEST__;
820
- const routes = manifest?.routes && typeof manifest.routes === "object" ? Object.values(manifest.routes) : [];
821
- if (routes.length === 0) return href;
822
- const url = new URL(href, window.location.origin);
823
- const route = routes.find((candidate) => matchManifestRoute(url.pathname, candidate));
824
- const preserve = Array.isArray(route?.search?.preserve) ? route.search.preserve : [];
825
- if (preserve.length === 0) return href;
826
- const current = new URLSearchParams(window.location.search);
827
- let changed = false;
828
- for (const key of preserve) {
829
- if (url.searchParams.has(key) || !current.has(key)) continue;
830
- for (const value of current.getAll(key)) {
831
- url.searchParams.append(key, value);
832
- changed = true;
833
- }
834
- }
835
- if (!changed) return href;
836
- return `${url.pathname}${url.search}${url.hash}`;
837
- }
838
- __name(applyPreservedSearchParams, "applyPreservedSearchParams");
839
- function matchManifestRoute(pathname, route) {
840
- if (!route || !Array.isArray(route.segments)) return false;
841
- const routeSegments = route.segments;
842
- const normalized = pathname === "/" ? "" : pathname.replace(/^\/+/, "").replace(/\/+$/, "");
843
- const pathSegments = normalized ? normalized.split("/") : [];
844
- const hasCatchAll = routeSegments.some((segment) => segment.isCatchAll);
845
- if (!hasCatchAll && pathSegments.length !== routeSegments.length) {
846
- return false;
847
- }
848
- for (let index = 0; index < routeSegments.length; index++) {
849
- const routeSegment = routeSegments[index];
850
- const pathSegment = pathSegments[index];
851
- if (routeSegment.isCatchAll) {
852
- return true;
853
- }
854
- if (pathSegment === void 0) {
855
- if (routeSegment.isOptional) continue;
856
- return false;
857
- }
858
- if (!routeSegment.isDynamic && routeSegment.segment !== pathSegment) {
859
- return false;
860
- }
861
- }
862
- return pathSegments.length === routeSegments.length || hasCatchAll;
863
- }
864
- __name(matchManifestRoute, "matchManifestRoute");
865
-
866
- export {
867
- useMutation,
868
- useFetcher,
869
- createStore,
870
- Link
871
- };
872
- //# sourceMappingURL=chunk-2CUKEMVR.mjs.map