@evoscientist/webui 0.2.5 → 0.2.7

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 (935) hide show
  1. package/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/build-manifest.json +13 -10
  3. package/dist/.next/prerender-manifest.json +18 -3
  4. package/dist/.next/required-server-files.json +27 -8
  5. package/dist/.next/server/app/_global-error/page/build-manifest.json +10 -7
  6. package/dist/.next/server/app/_global-error/page.js +6 -6
  7. package/dist/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/dist/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/dist/.next/server/app/_global-error.html +1 -1
  10. package/dist/.next/server/app/_global-error.meta +11 -4
  11. package/dist/.next/server/app/_global-error.rsc +9 -9
  12. package/dist/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +16 -2
  13. package/dist/.next/server/app/_global-error.segments/_full.segment.rsc +9 -9
  14. package/dist/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/dist/.next/server/app/_not-found/page/build-manifest.json +10 -7
  16. package/dist/.next/server/app/_not-found/page/next-font-manifest.json +1 -1
  17. package/dist/.next/server/app/_not-found/page.js +9 -10
  18. package/dist/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/dist/.next/server/app/_not-found.html +1 -1
  21. package/dist/.next/server/app/_not-found.meta +16 -5
  22. package/dist/.next/server/app/_not-found.rsc +16 -16
  23. package/dist/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
  24. package/dist/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +22 -2
  25. package/dist/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  26. package/dist/.next/server/app/api/evosci-config/route/build-manifest.json +4 -1
  27. package/dist/.next/server/app/api/evosci-config/route.js +3 -3
  28. package/dist/.next/server/app/api/evosci-config/route.js.nft.json +1 -1
  29. package/dist/.next/server/app/api/evosci-config/route_client-reference-manifest.js +1 -1
  30. package/dist/.next/server/app/api/memory/executions/route/build-manifest.json +4 -1
  31. package/dist/.next/server/app/api/memory/executions/route.js +4 -3
  32. package/dist/.next/server/app/api/memory/executions/route.js.nft.json +1 -1
  33. package/dist/.next/server/app/api/memory/executions/route_client-reference-manifest.js +1 -1
  34. package/dist/.next/server/app/api/memory/observations/route/build-manifest.json +4 -1
  35. package/dist/.next/server/app/api/memory/observations/route.js +4 -3
  36. package/dist/.next/server/app/api/memory/observations/route.js.nft.json +1 -1
  37. package/dist/.next/server/app/api/memory/observations/route_client-reference-manifest.js +1 -1
  38. package/dist/.next/server/app/api/memory/route/build-manifest.json +4 -1
  39. package/dist/.next/server/app/api/memory/route.js +4 -3
  40. package/dist/.next/server/app/api/memory/route.js.nft.json +1 -1
  41. package/dist/.next/server/app/api/memory/route_client-reference-manifest.js +1 -1
  42. package/dist/.next/server/app/api/skills/catalog/route/build-manifest.json +4 -1
  43. package/dist/.next/server/app/api/skills/catalog/route.js +3 -3
  44. package/dist/.next/server/app/api/skills/catalog/route.js.nft.json +1 -1
  45. package/dist/.next/server/app/api/skills/catalog/route_client-reference-manifest.js +1 -1
  46. package/dist/.next/server/app/api/skills/detail/route/build-manifest.json +4 -1
  47. package/dist/.next/server/app/api/skills/detail/route.js +3 -3
  48. package/dist/.next/server/app/api/skills/detail/route.js.nft.json +1 -1
  49. package/dist/.next/server/app/api/skills/detail/route_client-reference-manifest.js +1 -1
  50. package/dist/.next/server/app/api/skills/install/route/build-manifest.json +4 -1
  51. package/dist/.next/server/app/api/skills/install/route.js +3 -3
  52. package/dist/.next/server/app/api/skills/install/route.js.nft.json +1 -1
  53. package/dist/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
  54. package/dist/.next/server/app/api/skills/route/build-manifest.json +4 -1
  55. package/dist/.next/server/app/api/skills/route.js +4 -3
  56. package/dist/.next/server/app/api/skills/route.js.nft.json +1 -1
  57. package/dist/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  58. package/dist/.next/server/app/api/workspace/download/route/build-manifest.json +4 -1
  59. package/dist/.next/server/app/api/workspace/download/route.js +4 -3
  60. package/dist/.next/server/app/api/workspace/download/route.js.nft.json +1 -1
  61. package/dist/.next/server/app/api/workspace/download/route_client-reference-manifest.js +1 -1
  62. package/dist/.next/server/app/api/workspace/file/route/build-manifest.json +4 -1
  63. package/dist/.next/server/app/api/workspace/file/route.js +4 -4
  64. package/dist/.next/server/app/api/workspace/file/route.js.nft.json +1 -1
  65. package/dist/.next/server/app/api/workspace/file/route_client-reference-manifest.js +1 -1
  66. package/dist/.next/server/app/api/workspace/route/build-manifest.json +4 -1
  67. package/dist/.next/server/app/api/workspace/route.js +4 -3
  68. package/dist/.next/server/app/api/workspace/route.js.nft.json +1 -1
  69. package/dist/.next/server/app/api/workspace/route_client-reference-manifest.js +1 -1
  70. package/dist/.next/server/app/api/workspace/upload/route/build-manifest.json +4 -1
  71. package/dist/.next/server/app/api/workspace/upload/route.js +4 -3
  72. package/dist/.next/server/app/api/workspace/upload/route.js.nft.json +1 -1
  73. package/dist/.next/server/app/api/workspace/upload/route_client-reference-manifest.js +1 -1
  74. package/dist/.next/server/app/icon.png/route/build-manifest.json +4 -1
  75. package/dist/.next/server/app/icon.png/route.js +4 -4
  76. package/dist/.next/server/app/icon.png/route.js.nft.json +1 -1
  77. package/dist/.next/server/app/index.html +1 -1
  78. package/dist/.next/server/app/index.meta +11 -4
  79. package/dist/.next/server/app/index.rsc +17 -17
  80. package/dist/.next/server/app/index.segments/__PAGE__.segment.rsc +22 -5
  81. package/dist/.next/server/app/index.segments/_full.segment.rsc +17 -17
  82. package/dist/.next/server/app/index.segments/_tree.segment.rsc +3 -3
  83. package/dist/.next/server/app/page/build-manifest.json +10 -7
  84. package/dist/.next/server/app/page/next-font-manifest.json +1 -1
  85. package/dist/.next/server/app/page.js +10 -11
  86. package/dist/.next/server/app/page.js.nft.json +1 -1
  87. package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
  88. package/dist/.next/server/chunks/[externals]__0l8ei7u._.js +3 -0
  89. package/dist/.next/server/chunks/[root-of-the-server]__0239a1s._.js +3 -0
  90. package/dist/.next/server/chunks/[root-of-the-server]__0d2jr7j._.js +3 -0
  91. package/dist/.next/server/chunks/[root-of-the-server]__0jsq76h._.js +6 -0
  92. package/dist/.next/server/chunks/[root-of-the-server]__0k-rs5f._.js +6 -0
  93. package/dist/.next/server/chunks/[root-of-the-server]__0key-2n._.js +3 -0
  94. package/dist/.next/server/chunks/[root-of-the-server]__0l3yhx4._.js +160 -0
  95. package/dist/.next/server/chunks/[root-of-the-server]__0nn8czk._.js +6 -0
  96. package/dist/.next/server/chunks/[root-of-the-server]__0t923su._.js +3 -0
  97. package/dist/.next/server/chunks/[root-of-the-server]__0zqsdzd._.js +3 -0
  98. package/dist/.next/server/chunks/[root-of-the-server]__1alqt3_._.js +6 -0
  99. package/dist/.next/server/chunks/[turbopack]_runtime.js +97 -193
  100. package/dist/.next/server/chunks/_00r_7g_._.js +3 -0
  101. package/dist/.next/server/chunks/_042sj8j._.js +3 -0
  102. package/dist/.next/server/chunks/_0lp3ten._.js +3 -0
  103. package/dist/.next/server/chunks/_0m7b81h._.js +3 -0
  104. package/dist/.next/server/chunks/_13lro7d._.js +3 -0
  105. package/dist/.next/server/chunks/_154zcbx._.js +3 -0
  106. package/dist/.next/server/chunks/_1_oz68h._.js +3 -0
  107. package/dist/.next/server/chunks/_1lqtgjk._.js +3 -0
  108. package/dist/.next/server/chunks/{_next-internal_server_app_api_evosci-config_route_actions_0nka7fr.js → _next-internal_server_app_api_evosci-config_route_actions_13cf33i.js} +1 -1
  109. package/dist/.next/server/chunks/{_next-internal_server_app_api_memory_executions_route_actions_02b~_kt.js → _next-internal_server_app_api_memory_executions_route_actions_041n8x6.js} +1 -1
  110. package/dist/.next/server/chunks/{_next-internal_server_app_api_memory_observations_route_actions_0qhyoqo.js → _next-internal_server_app_api_memory_observations_route_actions_18ivi6u.js} +1 -1
  111. package/dist/.next/server/chunks/{_next-internal_server_app_api_memory_route_actions_0jf5z0q.js → _next-internal_server_app_api_memory_route_actions_0y2o7lg.js} +1 -1
  112. package/dist/.next/server/chunks/{_next-internal_server_app_api_skills_catalog_route_actions_0pp.pug.js → _next-internal_server_app_api_skills_catalog_route_actions_173mjj2.js} +1 -1
  113. package/dist/.next/server/chunks/{_next-internal_server_app_api_skills_detail_route_actions_02~v0so.js → _next-internal_server_app_api_skills_detail_route_actions_058ebza.js} +1 -1
  114. package/dist/.next/server/chunks/{_next-internal_server_app_api_skills_install_route_actions_03-v3ve.js → _next-internal_server_app_api_skills_install_route_actions_06zjol4.js} +1 -1
  115. package/dist/.next/server/chunks/{_next-internal_server_app_api_skills_route_actions_0kp0j6w.js → _next-internal_server_app_api_skills_route_actions_0_9y-ex.js} +1 -1
  116. package/dist/.next/server/chunks/{_next-internal_server_app_api_workspace_download_route_actions_0y83v2y.js → _next-internal_server_app_api_workspace_download_route_actions_1m4_t05.js} +1 -1
  117. package/dist/.next/server/chunks/{_next-internal_server_app_api_workspace_file_route_actions_06tfudj.js → _next-internal_server_app_api_workspace_file_route_actions_0bvzn6g.js} +1 -1
  118. package/dist/.next/server/chunks/{_next-internal_server_app_api_workspace_route_actions_0rc11bi.js → _next-internal_server_app_api_workspace_route_actions_19-xkal.js} +1 -1
  119. package/dist/.next/server/chunks/{_next-internal_server_app_api_workspace_upload_route_actions_070kzk5.js → _next-internal_server_app_api_workspace_upload_route_actions_0ccjxm_.js} +1 -1
  120. package/dist/.next/server/chunks/{_next-internal_server_app_icon_png_route_actions_12.gv.r.js → _next-internal_server_app_icon_png_route_actions_1-lsc8h.js} +1 -1
  121. package/dist/.next/server/chunks/ssr/{0t6k_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-NNHCCRGN_mjs_01.5gnv._.js → 1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-NNHCCRGN_mjs_03i6i8q._.js} +3 -3
  122. package/dist/.next/server/chunks/ssr/{0t6k_mermaid_dist_chunks_mermaid_core_mindmap-definition-RKZ34NQL_mjs_0ya3nf7._.js → 1daa_mermaid_dist_chunks_mermaid_core_mindmap-definition-RKZ34NQL_mjs_1m8bey3._.js} +1 -1
  123. package/dist/.next/server/chunks/ssr/{0t6k_mermaid_dist_chunks_mermaid_core_requirementDiagram-4Y6WPE33_mjs_07c4~j8._.js → 1daa_mermaid_dist_chunks_mermaid_core_requirementDiagram-4Y6WPE33_mjs_0cvy8c2._.js} +1 -1
  124. package/dist/.next/server/chunks/ssr/{0t6k_mermaid_dist_chunks_mermaid_core_timeline-definition-PNZ67QCA_mjs_0i6u~cs._.js → 1daa_mermaid_dist_chunks_mermaid_core_timeline-definition-PNZ67QCA_mjs_0vzw4gu._.js} +1 -1
  125. package/dist/.next/server/chunks/ssr/{0_lp_modules_mermaid_dist_chunks_mermaid_core_gitGraphDiagram-PVQCEYII_mjs_0xc8cuq._.js → 1q96_modules_mermaid_dist_chunks_mermaid_core_gitGraphDiagram-PVQCEYII_mjs_1kl1645._.js} +1 -1
  126. package/dist/.next/server/chunks/ssr/{0_lp_modules_mermaid_dist_chunks_mermaid_core_ishikawaDiagram-YF4QCWOH_mjs_12xi8w0._.js → 1q96_modules_mermaid_dist_chunks_mermaid_core_ishikawaDiagram-YF4QCWOH_mjs_1-btteu._.js} +1 -1
  127. package/dist/.next/server/chunks/ssr/{0_lp_modules_mermaid_dist_chunks_mermaid_core_journeyDiagram-JHISSGLW_mjs_0d.k2tv._.js → 1q96_modules_mermaid_dist_chunks_mermaid_core_journeyDiagram-JHISSGLW_mjs_0omhwqk._.js} +1 -1
  128. package/dist/.next/server/chunks/ssr/{0_lp_modules_mermaid_dist_chunks_mermaid_core_kanban-definition-UN3LZRKU_mjs_02zfksy._.js → 1q96_modules_mermaid_dist_chunks_mermaid_core_kanban-definition-UN3LZRKU_mjs_052rc5y._.js} +1 -1
  129. package/dist/.next/server/chunks/ssr/{0_lp_modules_mermaid_dist_chunks_mermaid_core_quadrantDiagram-W4KKPZXB_mjs_0c30c1e._.js → 1q96_modules_mermaid_dist_chunks_mermaid_core_quadrantDiagram-W4KKPZXB_mjs_0l8r0bx._.js} +1 -1
  130. package/dist/.next/server/chunks/ssr/{0_lp_modules_mermaid_dist_chunks_mermaid_core_sequenceDiagram-3UESZ5HK_mjs_07fd9jw._.js → 1q96_modules_mermaid_dist_chunks_mermaid_core_sequenceDiagram-3UESZ5HK_mjs_0c-9sj0._.js} +1 -1
  131. package/dist/.next/server/chunks/ssr/{0_lp_modules_mermaid_dist_chunks_mermaid_core_wardleyDiagram-YWT4CUSO_mjs_0a2sjhb._.js → 1q96_modules_mermaid_dist_chunks_mermaid_core_wardleyDiagram-YWT4CUSO_mjs_0hqmyh5._.js} +1 -1
  132. package/dist/.next/server/chunks/ssr/{0_lp_modules_mermaid_dist_chunks_mermaid_core_xychartDiagram-2RQKCTM6_mjs_0xpvx~c._.js → 1q96_modules_mermaid_dist_chunks_mermaid_core_xychartDiagram-2RQKCTM6_mjs_1l5rlhy._.js} +1 -1
  133. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0471z20._.js +3 -0
  134. package/dist/.next/server/chunks/ssr/{[root-of-the-server]__031lpnq._.js → [root-of-the-server]__05c-vrc._.js} +7 -7
  135. package/dist/.next/server/chunks/ssr/[root-of-the-server]__09pnxvp._.js +33 -0
  136. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0c75weq._.js +3 -0
  137. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0imtqxe._.js +3 -0
  138. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0nzxyl0._.js +3 -0
  139. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0o0ct70._.js +3 -0
  140. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0owaq8w._.js +12 -0
  141. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0xpcv9w._.js +14 -0
  142. package/dist/.next/server/chunks/ssr/[root-of-the-server]__1f4zvj-._.js +3 -0
  143. package/dist/.next/server/chunks/ssr/[root-of-the-server]__1io3bae._.js +33 -0
  144. package/dist/.next/server/chunks/ssr/[turbopack]_runtime.js +97 -193
  145. package/dist/.next/server/chunks/ssr/_05yvop-._.js +4 -0
  146. package/dist/.next/server/chunks/ssr/{_next-internal_server_app__global-error_page_actions_0k77kol.js → _next-internal_server_app__global-error_page_actions_0zi5s8-.js} +1 -1
  147. package/dist/.next/server/chunks/ssr/{_next-internal_server_app__not-found_page_actions_0eq97pa.js → _next-internal_server_app__not-found_page_actions_0pt47yr.js} +1 -1
  148. package/dist/.next/server/chunks/ssr/_next-internal_server_app_page_actions_0hhsz1j.js +3 -0
  149. package/dist/.next/server/chunks/ssr/{node_modules_0v29g77._.js → node_modules_0-n78w2._.js} +3 -3
  150. package/dist/.next/server/chunks/ssr/node_modules_00cex-8._.js +3 -0
  151. package/dist/.next/server/chunks/ssr/node_modules_0456qqx._.js +17 -0
  152. package/dist/.next/server/chunks/ssr/{node_modules_0po23em._.js → node_modules_07zdzg3._.js} +3 -3
  153. package/dist/.next/server/chunks/ssr/node_modules_082g_84._.js +31 -0
  154. package/dist/.next/server/chunks/ssr/node_modules_0_w_s0o._.js +3 -0
  155. package/dist/.next/server/chunks/ssr/node_modules_0chqc93._.js +11 -0
  156. package/dist/.next/server/chunks/ssr/{node_modules_09w7yel._.js → node_modules_0h91jdk._.js} +2 -2
  157. package/dist/.next/server/chunks/ssr/{node_modules_0x8-epl._.js → node_modules_0i3cah4._.js} +3 -3
  158. package/dist/.next/server/chunks/ssr/node_modules_0jx8vby._.js +3 -0
  159. package/dist/.next/server/chunks/ssr/node_modules_0kh3gaq._.js +45 -0
  160. package/dist/.next/server/chunks/ssr/node_modules_0oiuulr._.js +3 -0
  161. package/dist/.next/server/chunks/ssr/node_modules_0sud39z._.js +3 -0
  162. package/dist/.next/server/chunks/ssr/node_modules_0ty2qhi._.js +3 -0
  163. package/dist/.next/server/chunks/ssr/node_modules_0u1te_7._.js +3 -0
  164. package/dist/.next/server/chunks/ssr/node_modules_0uvms5m._.js +3 -0
  165. package/dist/.next/server/chunks/ssr/{node_modules_0hsalo_._.js → node_modules_0v4zc0t._.js} +2 -2
  166. package/dist/.next/server/chunks/ssr/{node_modules_0j48jbs._.js → node_modules_0xme7lg._.js} +2 -2
  167. package/dist/.next/server/chunks/ssr/node_modules_0z2foqi._.js +3 -0
  168. package/dist/.next/server/chunks/ssr/node_modules_0z4gniu._.js +17 -0
  169. package/dist/.next/server/chunks/ssr/{node_modules_0makin.._.js → node_modules_1-wfv6i._.js} +1 -1
  170. package/dist/.next/server/chunks/ssr/node_modules_111pp7w._.js +3 -0
  171. package/dist/.next/server/chunks/ssr/node_modules_15pczok._.js +3 -0
  172. package/dist/.next/server/chunks/ssr/node_modules_16l6ua_._.js +3 -0
  173. package/dist/.next/server/chunks/ssr/node_modules_16q2m8u._.js +3 -0
  174. package/dist/.next/server/chunks/ssr/node_modules_17rj81n._.js +3 -0
  175. package/dist/.next/server/chunks/ssr/node_modules_1831lye._.js +3 -0
  176. package/dist/.next/server/chunks/ssr/node_modules_19b6jde._.js +3 -0
  177. package/dist/.next/server/chunks/ssr/node_modules_1_jf-yx._.js +17 -0
  178. package/dist/.next/server/chunks/ssr/node_modules_1_v-pb8._.js +3 -0
  179. package/dist/.next/server/chunks/ssr/node_modules_1bmqmso._.js +3 -0
  180. package/dist/.next/server/chunks/ssr/node_modules_1jpcwgl._.js +151 -0
  181. package/dist/.next/server/chunks/ssr/node_modules_1lio4hi._.js +3 -0
  182. package/dist/.next/server/chunks/ssr/{node_modules_0~gyl9u._.js → node_modules_1nck62h._.js} +1 -1
  183. package/dist/.next/server/chunks/ssr/{node_modules_0z~-p3m._.js → node_modules_1p9b60w._.js} +2 -2
  184. package/dist/.next/server/chunks/ssr/node_modules_1tj6b0h._.js +3 -0
  185. package/dist/.next/server/chunks/ssr/{node_modules_0xheqa8._.js → node_modules_1z_uie6._.js} +2 -2
  186. package/dist/.next/server/chunks/ssr/node_modules_1zskgct._.js +26 -0
  187. package/dist/.next/server/chunks/ssr/{node_modules_13oabuj._.js → node_modules_20p8pl7._.js} +2 -2
  188. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_01lis5y._.js +3 -0
  189. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_07fm7s3._.js +3 -0
  190. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_0kitx9n._.js +3 -0
  191. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_0x5ivvr._.js +3 -0
  192. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_145f4t2._.js +3 -0
  193. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_1_o7dux._.js +3 -0
  194. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_1alyi8-._.js +3 -0
  195. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_1bxlr8e._.js +3 -0
  196. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_1grmhd9._.js +3 -0
  197. package/dist/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_00~7fbh._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_01pthdh._.js} +1 -1
  198. package/dist/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_01-g753._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_03fanqm._.js} +1 -1
  199. package/dist/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_02.ao_s._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0597f-k._.js} +1 -1
  200. package/dist/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0l0_~d-._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0__ix0y._.js} +1 -1
  201. package/dist/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0c.1f2e._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0muxjzn._.js} +1 -1
  202. package/dist/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0pjzhbh._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_16vf13h._.js} +1 -1
  203. package/dist/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0uq.qxy._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1fzbfn5._.js} +1 -1
  204. package/dist/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0_yd3ib._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1quf15b._.js} +1 -1
  205. package/dist/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0.ksprp._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1vi37xl._.js} +1 -1
  206. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_20vrei_._.js +3 -0
  207. package/dist/.next/server/chunks/ssr/{node_modules_cytoscape_dist_cytoscape_esm_mjs_0642y5z._.js → node_modules_cytoscape_dist_cytoscape_esm_mjs_0arohj6._.js} +2 -2
  208. package/dist/.next/server/chunks/ssr/node_modules_dagre-d3-es_src_dagre_index_0g66msq.js +3 -0
  209. package/dist/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_0oc7z2j._.js → node_modules_katex_dist_katex_mjs_04eh6b6._.js} +1 -1
  210. package/dist/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_0zuygmo._.js → node_modules_katex_dist_katex_mjs_1oxucd3._.js} +1 -1
  211. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_blockDiagram-GPEHLZMM_mjs_0bclh9~._.js → node_modules_mermaid_dist_chunks_mermaid_core_blockDiagram-GPEHLZMM_mjs_0jxv2ay._.js} +2 -2
  212. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_c4Diagram-AAUBKEIU_mjs_11i~hhk._.js → node_modules_mermaid_dist_chunks_mermaid_core_c4Diagram-AAUBKEIU_mjs_1yyt6ej._.js} +1 -1
  213. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_chunk-3OPIFGDE_mjs_0p4md.t._.js → node_modules_mermaid_dist_chunks_mermaid_core_chunk-3OPIFGDE_mjs_165ua5_._.js} +1 -1
  214. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_chunk-5ZQYHXKU_mjs_0p7as5d._.js → node_modules_mermaid_dist_chunks_mermaid_core_chunk-5ZQYHXKU_mjs_16ac76u._.js} +2 -2
  215. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_chunk-727SXJPM_mjs_05x94.y._.js → node_modules_mermaid_dist_chunks_mermaid_core_chunk-727SXJPM_mjs_0a9kagr._.js} +1 -1
  216. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_chunk-AQP2D5EJ_mjs_0_foecb._.js → node_modules_mermaid_dist_chunks_mermaid_core_chunk-AQP2D5EJ_mjs_1p-51mn._.js} +1 -1
  217. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_chunk-CSCIHK7Q_mjs_0g3lwf.._.js → node_modules_mermaid_dist_chunks_mermaid_core_chunk-CSCIHK7Q_mjs_0savw5-._.js} +1 -1
  218. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_chunk-KSCS5N6A_mjs_0.lzb4g._.js → node_modules_mermaid_dist_chunks_mermaid_core_chunk-KSCS5N6A_mjs_1vk17qr._.js} +1 -1
  219. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_chunk-O5CBEL6O_mjs_041viuq._.js → node_modules_mermaid_dist_chunks_mermaid_core_chunk-O5CBEL6O_mjs_074844c._.js} +1 -1
  220. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_chunk-XPW4576I_mjs_0h8ib.t._.js → node_modules_mermaid_dist_chunks_mermaid_core_chunk-XPW4576I_mjs_0u9wa-b._.js} +2 -2
  221. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_dagre-BM42HDAG_mjs_0itw5kh._.js → node_modules_mermaid_dist_chunks_mermaid_core_dagre-BM42HDAG_mjs_0w_brpy._.js} +1 -1
  222. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_diagram-OG6HWLK6_mjs_0et-fze._.js → node_modules_mermaid_dist_chunks_mermaid_core_diagram-OG6HWLK6_mjs_0pzbdul._.js} +1 -1
  223. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_erDiagram-TEJ5UH35_mjs_12bfcsi._.js → node_modules_mermaid_dist_chunks_mermaid_core_erDiagram-TEJ5UH35_mjs_1_cyy1q._.js} +1 -1
  224. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_flowDiagram-I6XJVG4X_mjs_0136c8y._.js → node_modules_mermaid_dist_chunks_mermaid_core_flowDiagram-I6XJVG4X_mjs_01y3363._.js} +1 -1
  225. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_sankeyDiagram-5OEKKPKP_mjs_0z55106._.js → node_modules_mermaid_dist_chunks_mermaid_core_sankeyDiagram-5OEKKPKP_mjs_1nsv0tt._.js} +1 -1
  226. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-AJRCARHV_mjs_0azazz~._.js → node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-AJRCARHV_mjs_0j4-fk2._.js} +1 -1
  227. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_chunks_mermaid_core_vennDiagram-CIIHVFJN_mjs_0wzofym._.js → node_modules_mermaid_dist_chunks_mermaid_core_vennDiagram-CIIHVFJN_mjs_1jvbrvq._.js} +1 -1
  228. package/dist/.next/server/chunks/ssr/{node_modules_mermaid_dist_mermaid_core_mjs_0rr2bb.._.js → node_modules_mermaid_dist_mermaid_core_mjs_1ao-jv5._.js} +1 -1
  229. package/dist/.next/server/chunks/ssr/node_modules_next_dist_1n3w9lb._.js +6 -0
  230. package/dist/.next/server/chunks/ssr/node_modules_next_dist_1vz8kh1._.js +3 -0
  231. package/dist/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j3._.js +3 -0
  232. package/dist/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js → node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js} +2 -2
  233. package/dist/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892.js +3 -0
  234. package/dist/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js → node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js} +2 -2
  235. package/dist/.next/server/chunks/ssr/{node_modules_roughjs_bundled_rough_esm_0opq-c5.js → node_modules_roughjs_bundled_rough_esm_15c9pcx.js} +1 -1
  236. package/dist/.next/server/middleware-build-manifest.js +13 -10
  237. package/dist/.next/server/next-font-manifest.js +1 -1
  238. package/dist/.next/server/next-font-manifest.json +2 -2
  239. package/dist/.next/server/pages/404.html +1 -1
  240. package/dist/.next/server/pages/500.html +1 -1
  241. package/dist/.next/server/prefetch-hints.json +34 -1
  242. package/dist/.next/server/server-reference-manifest.js +1 -1
  243. package/dist/.next/server/server-reference-manifest.json +1 -1
  244. package/dist/.next/static/chunks/{0wbhqz.-ey98b.js → 01nhrh-3r57wh.js} +1 -1
  245. package/dist/.next/static/chunks/02g89o135esk3.js +22 -0
  246. package/dist/.next/static/chunks/03regxjjibliy.js +29 -0
  247. package/dist/.next/static/chunks/{0n46g0ilh8wj..js → 05cl5ojgc4_ku.js} +6 -6
  248. package/dist/.next/static/chunks/0c4y7_xzemq6-.js +1 -0
  249. package/dist/.next/static/chunks/{0p9rfgg_duajn.js → 0dm2etancr7wp.js} +1 -1
  250. package/dist/.next/static/chunks/{0hq~c-~dp2g~1.js → 0l2v1ybx0rm07.js} +1 -1
  251. package/dist/.next/static/chunks/{104yvyc1ce3q5.js → 0o19535rrdg5j.js} +1 -1
  252. package/dist/.next/static/chunks/0piaur2yhvb4v.js +1 -0
  253. package/dist/.next/static/chunks/{0rhvismtjivza.js → 0s3geiy0as3cz.js} +5 -5
  254. package/dist/.next/static/chunks/12b5tf_04ca4i.js +10 -0
  255. package/dist/.next/static/chunks/{0qm2930z0c.8m.js → 15746zaz9af2k.js} +16 -16
  256. package/dist/.next/static/chunks/15m2ikcj71414.js +1 -0
  257. package/dist/.next/static/chunks/{07znaqalfuldz.js → 17y1ca1c2d1k0.js} +1 -1
  258. package/dist/.next/static/chunks/{187v8dzyf1l-f.js → 18dnd1yq8sjcm.js} +1 -1
  259. package/dist/.next/static/chunks/1h978hs06gqwr.js +1 -0
  260. package/dist/.next/static/chunks/1s8wltynx2kei.js +24 -0
  261. package/dist/.next/static/chunks/1vqrf8u3eyf8l.js +1 -0
  262. package/dist/.next/static/chunks/{11h85j-8~tny3.js → 1wsp3h55ims3-.js} +1 -1
  263. package/dist/.next/static/chunks/1x1nff_ltcu7m.js +1 -0
  264. package/dist/.next/static/chunks/1ztlt8o8gnas8.js +1 -0
  265. package/dist/.next/static/chunks/{0mo3-obfy2_6v.js → 2-tnv5f86ywqz.js} +2 -2
  266. package/dist/.next/static/chunks/20uqpnur2j1hn.js +1 -0
  267. package/dist/.next/static/chunks/{175hd_pl41_vh.js → 26t_0sbrej8uf.js} +2 -2
  268. package/dist/.next/static/chunks/28flaeabfo316.js +31 -0
  269. package/dist/.next/static/chunks/2ba37l0xctlco.js +1 -0
  270. package/dist/.next/static/chunks/2dmr54jagfdwa.css +3 -0
  271. package/dist/.next/static/chunks/2ia3pig2diart.js +43 -0
  272. package/dist/.next/static/chunks/{0ez8v7k1e7v4o.js → 2qe97b2xjvm_s.js} +1 -1
  273. package/dist/.next/static/chunks/2v_t22-0u_seu.js +1 -0
  274. package/dist/.next/static/chunks/2zf625u-tcwdn.js +1 -0
  275. package/dist/.next/static/chunks/{0cs_h74-ljzlt.js → 3-q38f64d_smq.js} +3 -3
  276. package/dist/.next/static/chunks/31ttnjt6g35a0.js +1 -0
  277. package/dist/.next/static/chunks/33t46atd3n2zd.js +1 -0
  278. package/dist/.next/static/chunks/{0dsde0n1co0l..js → 357a_3k2qrz6b.js} +1 -1
  279. package/dist/.next/static/chunks/383s4_f7pq0oz.js +1 -0
  280. package/dist/.next/static/chunks/3cnkwh7z04e3e.js +24 -0
  281. package/dist/.next/static/chunks/3s7at3o7ube_p.js +9 -0
  282. package/dist/.next/static/chunks/{16m14x8k2fnon.js → 3wb9uvu5ii1sy.js} +1 -1
  283. package/dist/.next/static/chunks/41ii5ld31fjk5.js +148 -0
  284. package/dist/.next/static/chunks/42yfqecr30v0q.js +10 -0
  285. package/dist/.next/static/chunks/turbopack-3cm-eevva8ksw.js +1 -0
  286. package/dist/node_modules/@img/sharp-darwin-arm64/index.cjs +2 -0
  287. package/dist/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64-0.35.3.node +0 -0
  288. package/dist/node_modules/@img/sharp-darwin-arm64/package.json +5 -4
  289. package/dist/node_modules/@img/sharp-libvips-darwin-arm64/README.md +15 -15
  290. package/dist/node_modules/@img/sharp-libvips-darwin-arm64/lib/glib-2.0/include/glibconfig.h +1 -3
  291. package/dist/node_modules/@img/sharp-libvips-darwin-arm64/lib/{libvips-cpp.8.17.3.dylib → libvips-cpp.8.18.3.dylib} +0 -0
  292. package/dist/node_modules/@img/sharp-libvips-darwin-arm64/package.json +3 -2
  293. package/dist/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +21 -21
  294. package/dist/node_modules/@next/env/dist/index.js +1 -1
  295. package/dist/node_modules/@next/env/package.json +8 -8
  296. package/dist/node_modules/@swc/helpers/esm/_interop_require_default.js +4 -0
  297. package/dist/node_modules/@swc/helpers/esm/_interop_require_wildcard.js +36 -0
  298. package/dist/node_modules/@swc/helpers/package.json +703 -469
  299. package/dist/node_modules/next/dist/build/define-env.js +10 -2
  300. package/dist/node_modules/next/dist/build/duration-to-string.js +2 -3
  301. package/dist/node_modules/next/dist/build/next-config-ts/transpile-config.js +3 -114
  302. package/dist/node_modules/next/dist/build/segment-config/app/app-segment-config.js +35 -19
  303. package/dist/node_modules/next/dist/build/segment-config/app/app-segments.js +11 -1
  304. package/dist/node_modules/next/dist/build/static-paths/app.js +66 -19
  305. package/dist/node_modules/next/dist/build/swc/index.js +84 -23
  306. package/dist/node_modules/next/dist/build/swc/jest-transformer.js +1 -0
  307. package/dist/node_modules/next/dist/build/swc/options.js +13 -5
  308. package/dist/node_modules/next/dist/build/utils.js +112 -70
  309. package/dist/node_modules/next/dist/cli/next-test.js +2 -1
  310. package/dist/node_modules/next/dist/client/components/app-router-headers.js +0 -10
  311. package/dist/node_modules/next/dist/client/components/app-router-instance.js +50 -40
  312. package/dist/node_modules/next/dist/client/components/app-router.js +9 -1
  313. package/dist/node_modules/next/dist/client/components/error-boundary.js +13 -9
  314. package/dist/node_modules/next/dist/client/components/handle-isr-error.js +3 -3
  315. package/dist/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js +2 -2
  316. package/dist/node_modules/next/dist/{server/app-render/instant-validation/instant-samples-client.js → client/components/instant-samples.js} +13 -7
  317. package/dist/node_modules/next/dist/client/components/links.js +25 -8
  318. package/dist/node_modules/next/dist/client/components/nav-failure-handler.js +1 -1
  319. package/dist/node_modules/next/dist/client/components/navigation-dynamic-rendering.js +38 -0
  320. package/dist/node_modules/next/dist/client/components/navigation-untracked.js +5 -3
  321. package/dist/node_modules/next/dist/client/components/navigation.js +30 -9
  322. package/dist/node_modules/next/dist/client/components/offline.js +172 -0
  323. package/dist/node_modules/next/dist/client/components/readonly-url-search-params.js +5 -0
  324. package/dist/node_modules/next/dist/client/components/redirect.js +2 -2
  325. package/dist/node_modules/next/dist/client/components/router-reducer/compute-changed-path.js +5 -1
  326. package/dist/node_modules/next/dist/client/components/router-reducer/create-initial-router-state.js +25 -17
  327. package/dist/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +196 -50
  328. package/dist/node_modules/next/dist/client/components/router-reducer/is-navigating-to-new-root-layout.js +30 -19
  329. package/dist/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js +235 -102
  330. package/dist/node_modules/next/dist/client/components/router-reducer/reducers/hmr-refresh-reducer.js +8 -2
  331. package/dist/node_modules/next/dist/client/components/router-reducer/reducers/refresh-reducer.js +12 -5
  332. package/dist/node_modules/next/dist/client/components/router-reducer/reducers/restore-reducer.js +15 -2
  333. package/dist/node_modules/next/dist/client/components/router-reducer/reducers/server-action-reducer.js +38 -9
  334. package/dist/node_modules/next/dist/client/components/router-reducer/reducers/server-patch-reducer.js +11 -2
  335. package/dist/node_modules/next/dist/client/components/router-reducer/router-reducer.js +10 -2
  336. package/dist/node_modules/next/dist/client/components/router-transition.js +135 -0
  337. package/dist/node_modules/next/dist/client/components/segment-cache/bfcache.js +9 -7
  338. package/dist/node_modules/next/dist/client/components/segment-cache/cache-key.js +31 -3
  339. package/dist/node_modules/next/dist/client/components/segment-cache/cache-map.js +33 -12
  340. package/dist/node_modules/next/dist/client/components/segment-cache/cache.js +1089 -338
  341. package/dist/node_modules/next/dist/client/components/segment-cache/fetch.js +37 -0
  342. package/dist/node_modules/next/dist/client/components/segment-cache/navigation-testing-lock.js +324 -103
  343. package/dist/node_modules/next/dist/client/components/segment-cache/navigation.js +218 -42
  344. package/dist/node_modules/next/dist/client/components/segment-cache/optimistic-routes.js +222 -117
  345. package/dist/node_modules/next/dist/client/components/segment-cache/prefetch.js +2 -1
  346. package/dist/node_modules/next/dist/client/components/segment-cache/scheduler.js +756 -235
  347. package/dist/node_modules/next/dist/client/components/segment-cache/types.js +19 -4
  348. package/dist/node_modules/next/dist/client/components/segment-cache/vary-path.js +50 -2
  349. package/dist/node_modules/next/dist/client/components/server-async-storage.js +43 -0
  350. package/dist/node_modules/next/dist/client/components/unstable-rethrow.js +15 -8
  351. package/dist/node_modules/next/dist/client/components/use-offline.js +68 -0
  352. package/dist/node_modules/next/dist/client/dev/debug-channel.js +367 -11
  353. package/dist/node_modules/next/dist/client/flight-data-helpers.js +4 -1
  354. package/dist/node_modules/next/dist/client/normalize-trailing-slash.js +2 -1
  355. package/dist/node_modules/next/dist/client/route-params.js +12 -10
  356. package/dist/node_modules/next/dist/compiled/@hapi/accept/index.js +1 -1
  357. package/dist/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/index.js +1 -1
  358. package/dist/node_modules/next/dist/compiled/@napi-rs/triples/index.js +1 -1
  359. package/dist/node_modules/next/dist/compiled/@opentelemetry/api/index.js +1 -1
  360. package/dist/node_modules/next/dist/compiled/@vercel/detect-agent/index.js +1 -0
  361. package/dist/node_modules/next/dist/compiled/@vercel/detect-agent/package.json +1 -0
  362. package/dist/node_modules/next/dist/compiled/async-retry/index.js +1 -1
  363. package/dist/node_modules/next/dist/compiled/async-sema/index.js +1 -1
  364. package/dist/node_modules/next/dist/compiled/busboy/index.js +1 -1
  365. package/dist/node_modules/next/dist/compiled/bytes/index.js +2 -2
  366. package/dist/node_modules/next/dist/compiled/ci-info/index.js +1 -1
  367. package/dist/node_modules/next/dist/compiled/commander/index.js +1 -1
  368. package/dist/node_modules/next/dist/compiled/comment-json/index.js +2 -2
  369. package/dist/node_modules/next/dist/compiled/compression/index.js +10 -10
  370. package/dist/node_modules/next/dist/compiled/conf/index.js +2 -14
  371. package/dist/node_modules/next/dist/compiled/content-disposition/index.js +2 -2
  372. package/dist/node_modules/next/dist/compiled/cross-spawn/index.js +1 -1
  373. package/dist/node_modules/next/dist/compiled/debug/index.js +1 -1
  374. package/dist/node_modules/next/dist/compiled/edge-runtime/index.js +1 -1
  375. package/dist/node_modules/next/dist/compiled/find-up/index.js +1 -1
  376. package/dist/node_modules/next/dist/compiled/fresh/index.js +2 -2
  377. package/dist/node_modules/next/dist/compiled/httpxy/index.js +1 -0
  378. package/dist/node_modules/next/dist/compiled/httpxy/package.json +1 -0
  379. package/dist/node_modules/next/dist/compiled/image-detector/detector.js +1 -1
  380. package/dist/node_modules/next/dist/compiled/image-size/index.js +1 -1
  381. package/dist/node_modules/next/dist/compiled/ipaddr.js/ipaddr.js +1 -1
  382. package/dist/node_modules/next/dist/compiled/is-animated/index.js +1 -1
  383. package/dist/node_modules/next/dist/compiled/is-docker/index.js +1 -1
  384. package/dist/node_modules/next/dist/compiled/is-wsl/index.js +1 -1
  385. package/dist/node_modules/next/dist/compiled/jsonwebtoken/index.js +3 -3
  386. package/dist/node_modules/next/dist/compiled/nanoid/index.cjs +1 -1
  387. package/dist/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +144 -15
  388. package/dist/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +144 -15
  389. package/dist/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +3 -3
  390. package/dist/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +12 -12
  391. package/dist/node_modules/next/dist/compiled/p-limit/index.js +1 -1
  392. package/dist/node_modules/next/dist/compiled/p-queue/index.js +1 -1
  393. package/dist/node_modules/next/dist/compiled/path-browserify/index.js +1 -1
  394. package/dist/node_modules/next/dist/compiled/picomatch/index.js +1 -1
  395. package/dist/node_modules/next/dist/compiled/react-is/package.json +3 -3
  396. package/dist/node_modules/next/dist/compiled/semver/index.js +1 -1
  397. package/dist/node_modules/next/dist/compiled/send/index.js +13 -13
  398. package/dist/node_modules/next/dist/compiled/source-map/source-map.js +1 -1
  399. package/dist/node_modules/next/dist/compiled/string-hash/index.js +1 -1
  400. package/dist/node_modules/next/dist/compiled/strip-ansi/index.js +1 -1
  401. package/dist/node_modules/next/dist/compiled/superstruct/index.cjs +1 -1
  402. package/dist/node_modules/next/dist/compiled/tar/index.min.js +1 -1
  403. package/dist/node_modules/next/dist/compiled/text-table/index.js +1 -1
  404. package/dist/node_modules/next/dist/compiled/watchpack/watchpack.js +1 -1
  405. package/dist/node_modules/next/dist/compiled/write-file-atomic/index.js +1 -0
  406. package/dist/node_modules/next/dist/compiled/write-file-atomic/package.json +1 -0
  407. package/dist/node_modules/next/dist/compiled/ws/index.js +1 -1
  408. package/dist/node_modules/next/dist/compiled/zod/index.cjs +1 -1
  409. package/dist/node_modules/next/dist/compiled/zod-validation-error/index.js +1 -1
  410. package/dist/node_modules/next/dist/experimental/testmode/fetch.js +8 -0
  411. package/dist/node_modules/next/dist/experimental/testmode/httpget.js +9 -2
  412. package/dist/node_modules/next/dist/experimental/testmode/server.js +11 -0
  413. package/dist/node_modules/next/dist/lib/bundler.js +72 -1
  414. package/dist/node_modules/next/dist/lib/create-client-router-filter.js +16 -0
  415. package/dist/node_modules/next/dist/lib/find-root.js +187 -33
  416. package/dist/node_modules/next/dist/lib/format-dynamic-import-path.js +23 -4
  417. package/dist/node_modules/next/dist/lib/git-worktree.js +74 -0
  418. package/dist/node_modules/next/dist/lib/helpers/get-pkg-manager.js +10 -8
  419. package/dist/node_modules/next/dist/lib/helpers/git.js +59 -0
  420. package/dist/node_modules/next/dist/lib/install-dependencies.js +1 -1
  421. package/dist/node_modules/next/dist/lib/is-serializable-props.js +5 -0
  422. package/dist/node_modules/next/dist/lib/metadata/get-metadata-route.js +54 -15
  423. package/dist/node_modules/next/dist/lib/metadata/metadata.js +20 -46
  424. package/dist/node_modules/next/dist/lib/metadata/resolve-metadata.js +14 -14
  425. package/dist/node_modules/next/dist/lib/needs-experimental-react.js +2 -2
  426. package/dist/node_modules/next/dist/lib/patch-incorrect-lockfile.js +5 -5
  427. package/dist/node_modules/next/dist/lib/profiles-dir.js +45 -0
  428. package/dist/node_modules/next/dist/lib/require-instrumentation-client.js +10 -4
  429. package/dist/node_modules/next/dist/lib/resolve-build-paths.js +38 -10
  430. package/dist/node_modules/next/dist/lib/turbopack-cache-seed.js +171 -0
  431. package/dist/node_modules/next/dist/lib/typescript/getTypeScriptConfiguration.js +4 -84
  432. package/dist/node_modules/next/dist/lib/typescript/loadTsConfig.js +181 -0
  433. package/dist/node_modules/next/dist/lib/typescript/missingDependencyError.js +2 -3
  434. package/dist/node_modules/next/dist/lib/typescript/runTypeCheckCli.js +53 -0
  435. package/dist/node_modules/next/dist/lib/typescript/runTypeScriptCli.js +256 -0
  436. package/dist/node_modules/next/dist/lib/typescript/writeAppTypeDeclarations.js +2 -0
  437. package/dist/node_modules/next/dist/lib/verify-partytown-setup.js +15 -26
  438. package/dist/node_modules/next/dist/lib/verify-typescript-setup.js +97 -56
  439. package/dist/node_modules/next/dist/server/after/after-context.js +55 -17
  440. package/dist/node_modules/next/dist/server/after/after.js +4 -2
  441. package/dist/node_modules/next/dist/server/api-utils/index.js +20 -4
  442. package/dist/node_modules/next/dist/server/api-utils/node/try-get-preview-data.js +5 -2
  443. package/dist/node_modules/next/dist/server/app-render/action-handler.js +162 -54
  444. package/dist/node_modules/next/dist/server/app-render/app-render-prerender-utils.js +176 -11
  445. package/dist/node_modules/next/dist/server/app-render/app-render.js +3249 -1275
  446. package/dist/node_modules/next/dist/server/app-render/blocking-route-messages.js +181 -0
  447. package/dist/node_modules/next/dist/server/app-render/collect-segment-data.js +531 -210
  448. package/dist/node_modules/next/dist/server/app-render/create-component-styles-and-scripts.js +9 -4
  449. package/dist/node_modules/next/dist/server/app-render/create-component-tree.js +13 -77
  450. package/dist/node_modules/next/dist/server/app-render/create-error-handler.js +19 -18
  451. package/dist/node_modules/next/dist/server/app-render/create-flight-router-state-from-loader-tree.js +78 -26
  452. package/dist/node_modules/next/dist/server/app-render/debug-channel-server.js +26 -9
  453. package/dist/node_modules/next/dist/server/app-render/debug-channel-server.node.js +60 -0
  454. package/dist/node_modules/next/dist/server/app-render/debug-channel-server.web.js +8 -19
  455. package/dist/node_modules/next/dist/server/app-render/dev-validation-error-delivery.js +37 -0
  456. package/dist/node_modules/next/dist/server/app-render/dev-validation-events.js +26 -0
  457. package/dist/node_modules/next/dist/server/app-render/dev-validation-scheduler.js +87 -0
  458. package/dist/node_modules/next/dist/server/app-render/dev-validation-worker-globals.js +41 -0
  459. package/dist/node_modules/next/dist/server/app-render/dev-validation-worker-snapshot.js +79 -0
  460. package/dist/node_modules/next/dist/server/app-render/dynamic-rendering.js +261 -204
  461. package/dist/node_modules/next/dist/server/app-render/encryption.js +11 -9
  462. package/dist/node_modules/next/dist/server/app-render/entry-base.js +25 -16
  463. package/dist/node_modules/next/dist/server/app-render/get-css-inlined-link-tags.js +2 -6
  464. package/dist/node_modules/next/dist/server/app-render/get-layer-assets.js +11 -7
  465. package/dist/node_modules/next/dist/server/app-render/instant-test-bootstrap.js +20 -0
  466. package/dist/node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js +21 -3
  467. package/dist/node_modules/next/dist/server/app-render/instant-validation/boundary-impl.js +25 -1
  468. package/dist/node_modules/next/dist/server/app-render/instant-validation/boundary-tracking.js +24 -4
  469. package/dist/node_modules/next/dist/server/app-render/instant-validation/instant-config.js +119 -59
  470. package/dist/node_modules/next/dist/server/app-render/instant-validation/instant-samples.js +10 -10
  471. package/dist/node_modules/next/dist/server/app-render/instant-validation/instant-validation.js +394 -173
  472. package/dist/node_modules/next/dist/server/app-render/make-get-server-inserted-html.js +3 -4
  473. package/dist/node_modules/next/dist/server/app-render/manifests-singleton.js +78 -15
  474. package/dist/node_modules/next/dist/server/app-render/module-loading/instrument-module-getter.js +32 -0
  475. package/dist/node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js +2 -6
  476. package/dist/node_modules/next/dist/server/app-render/postponed-state.js +78 -5
  477. package/dist/node_modules/next/dist/server/app-render/render-css-resource.js +20 -15
  478. package/dist/node_modules/next/dist/server/app-render/staged-rendering.js +182 -201
  479. package/dist/node_modules/next/dist/server/app-render/stale-time.js +0 -10
  480. package/dist/node_modules/next/dist/server/app-render/stream-ops.js +85 -36
  481. package/dist/node_modules/next/dist/server/app-render/stream-ops.node.js +842 -0
  482. package/dist/node_modules/next/dist/server/app-render/stream-ops.web.js +116 -30
  483. package/dist/node_modules/next/dist/server/app-render/sync-io-messages.js +67 -0
  484. package/dist/node_modules/next/dist/server/app-render/use-flight-response.js +11 -8
  485. package/dist/node_modules/next/dist/server/app-render/vary-params.js +113 -188
  486. package/dist/node_modules/next/dist/server/app-render/wait-for-response.js +36 -0
  487. package/dist/node_modules/next/dist/server/app-render/walk-tree-with-flight-router-state.js +11 -6
  488. package/dist/node_modules/next/dist/server/app-render/work-unit-async-storage.external.js +33 -63
  489. package/dist/node_modules/next/dist/server/async-storage/draft-mode-provider.js +2 -2
  490. package/dist/node_modules/next/dist/server/async-storage/request-store.js +84 -27
  491. package/dist/node_modules/next/dist/server/async-storage/work-store.js +7 -1
  492. package/dist/node_modules/next/dist/server/base-server.js +147 -72
  493. package/dist/node_modules/next/dist/server/body-streams.js +9 -1
  494. package/dist/node_modules/next/dist/server/client-component-renderer-logger.js +2 -2
  495. package/dist/node_modules/next/dist/server/config-schema.js +84 -10
  496. package/dist/node_modules/next/dist/server/config-shared.js +46 -20
  497. package/dist/node_modules/next/dist/server/config.js +343 -52
  498. package/dist/node_modules/next/dist/server/dev/browser-logs/file-logger.js +4 -4
  499. package/dist/node_modules/next/dist/server/dev/browser-logs/receive-logs.js +152 -100
  500. package/dist/node_modules/next/dist/server/dev/debug-channel.js +48 -23
  501. package/dist/node_modules/next/dist/server/dev/dev-validation-worker-pool.js +232 -0
  502. package/dist/node_modules/next/dist/server/dev/dev-validation-worker.js +308 -0
  503. package/dist/node_modules/next/dist/server/dev/hot-middleware.js +3 -1
  504. package/dist/node_modules/next/dist/server/dev/hot-reloader-rspack.js +1 -1
  505. package/dist/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +420 -144
  506. package/dist/node_modules/next/dist/server/dev/hot-reloader-types.js +2 -0
  507. package/dist/node_modules/next/dist/server/dev/hot-reloader-webpack.js +17 -23
  508. package/dist/node_modules/next/dist/server/dev/log-requests.js +3 -0
  509. package/dist/node_modules/next/dist/server/dev/middleware-turbopack.js +26 -7
  510. package/dist/node_modules/next/dist/server/dev/middleware-webpack.js +20 -8
  511. package/dist/node_modules/next/dist/server/dev/node-stack-frames.js +9 -0
  512. package/dist/node_modules/next/dist/server/dev/require-cache.js +33 -3
  513. package/dist/node_modules/next/dist/server/dev/serialized-errors.js +1 -1
  514. package/dist/node_modules/next/dist/server/dev/static-paths-worker.js +4 -3
  515. package/dist/node_modules/next/dist/server/dev/turbopack-utils.js +52 -12
  516. package/dist/node_modules/next/dist/server/dev/use-cache-probe-pool.js +177 -0
  517. package/dist/node_modules/next/dist/server/dev/use-cache-probe-worker.js +180 -0
  518. package/dist/node_modules/next/dist/server/dynamic-rendering-utils.js +200 -23
  519. package/dist/node_modules/next/dist/server/get-page-files.js +20 -3
  520. package/dist/node_modules/next/dist/server/image-optimizer.js +47 -39
  521. package/dist/node_modules/next/dist/server/lib/app-info-log.js +19 -16
  522. package/dist/node_modules/next/dist/server/lib/cache-handlers/default.js +41 -5
  523. package/dist/node_modules/next/dist/server/lib/cpu-profile.js +2 -5
  524. package/dist/node_modules/next/dist/server/lib/dev-bundler-service.js +17 -2
  525. package/dist/node_modules/next/dist/server/lib/encode-header-safe.js +44 -0
  526. package/dist/node_modules/next/dist/server/lib/generate-agent-files.js +180 -0
  527. package/dist/node_modules/next/dist/server/lib/implicit-tags.js +16 -6
  528. package/dist/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +17 -4
  529. package/dist/node_modules/next/dist/server/lib/incremental-cache/index.js +120 -74
  530. package/dist/node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js +13 -11
  531. package/dist/node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js +1 -1
  532. package/dist/node_modules/next/dist/server/lib/is-non-html-sec-fetch-dest.js +38 -0
  533. package/dist/node_modules/next/dist/server/lib/lazy-module.js +80 -0
  534. package/dist/node_modules/next/dist/server/lib/lru-cache.js +1 -1
  535. package/dist/node_modules/next/dist/server/lib/mock-request.js +1 -1
  536. package/dist/node_modules/next/dist/server/lib/params-utils.js +70 -0
  537. package/dist/node_modules/next/dist/server/lib/patch-fetch.js +66 -17
  538. package/dist/node_modules/next/dist/server/lib/release-compression-stream.js +24 -0
  539. package/dist/node_modules/next/dist/server/lib/render-server.js +3 -1
  540. package/dist/node_modules/next/dist/server/lib/router-server.js +70 -13
  541. package/dist/node_modules/next/dist/server/lib/router-utils/block-cross-site-dev.js +2 -2
  542. package/dist/node_modules/next/dist/server/lib/router-utils/cache-life-type-utils.js +1 -0
  543. package/dist/node_modules/next/dist/server/lib/router-utils/filesystem.js +31 -10
  544. package/dist/node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js +54 -36
  545. package/dist/node_modules/next/dist/server/lib/router-utils/proxy-request.js +19 -9
  546. package/dist/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +5 -2
  547. package/dist/node_modules/next/dist/server/lib/router-utils/root-params-type-utils.js +61 -0
  548. package/dist/node_modules/next/dist/server/lib/router-utils/route-types-utils.js +40 -0
  549. package/dist/node_modules/next/dist/server/lib/router-utils/typegen.js +55 -21
  550. package/dist/node_modules/next/dist/server/lib/source-maps.js +54 -9
  551. package/dist/node_modules/next/dist/server/lib/start-server.js +69 -23
  552. package/dist/node_modules/next/dist/server/lib/streaming-metadata.js +11 -22
  553. package/dist/node_modules/next/dist/server/lib/trace/constants.js +5 -0
  554. package/dist/node_modules/next/dist/server/lib/trace/local-span-recorder.js +385 -0
  555. package/dist/node_modules/next/dist/server/lib/trace/request-insights-identity.js +39 -0
  556. package/dist/node_modules/next/dist/server/lib/trace/request-insights.js +308 -0
  557. package/dist/node_modules/next/dist/server/lib/trace/span-store.js +69 -0
  558. package/dist/node_modules/next/dist/server/lib/trace/tracer.js +123 -11
  559. package/dist/node_modules/next/dist/server/lib/utils.js +14 -0
  560. package/dist/node_modules/next/dist/server/load-components.js +8 -2
  561. package/dist/node_modules/next/dist/server/mcp/get-or-create-mcp-server.js +10 -0
  562. package/dist/node_modules/next/dist/server/mcp/tools/compile-route.js +86 -0
  563. package/dist/node_modules/next/dist/server/mcp/tools/get-compilation-issues.js +68 -0
  564. package/dist/node_modules/next/dist/server/mcp/tools/get-request-insights.js +57 -0
  565. package/dist/node_modules/next/dist/server/mcp/tools/utils/format-compilation-issues.js +72 -0
  566. package/dist/node_modules/next/dist/server/mcp/tools/utils/resolve-path-to-route.js +49 -0
  567. package/dist/node_modules/next/dist/server/next-server.js +30 -16
  568. package/dist/node_modules/next/dist/server/next.js +42 -12
  569. package/dist/node_modules/next/dist/server/node-environment-extensions/io-utils.js +31 -124
  570. package/dist/node_modules/next/dist/server/node-environment-extensions/process-error-handlers.js +156 -77
  571. package/dist/node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js +12 -2
  572. package/dist/node_modules/next/dist/server/og/cache-image-response.js +341 -0
  573. package/dist/node_modules/next/dist/server/og/image-response.js +22 -3
  574. package/dist/node_modules/next/dist/server/patch-error-inspect.js +70 -16
  575. package/dist/node_modules/next/dist/server/pipe-readable.js +73 -1
  576. package/dist/node_modules/next/dist/server/render-result.js +42 -0
  577. package/dist/node_modules/next/dist/server/render.js +3 -1
  578. package/dist/node_modules/next/dist/server/request/connection.js +6 -4
  579. package/dist/node_modules/next/dist/server/request/cookies.js +18 -14
  580. package/dist/node_modules/next/dist/server/request/draft-mode.js +11 -3
  581. package/dist/node_modules/next/dist/server/request/fallback-params.js +1 -1
  582. package/dist/node_modules/next/dist/server/request/headers.js +16 -10
  583. package/dist/node_modules/next/dist/server/request/io.js +96 -0
  584. package/dist/node_modules/next/dist/server/request/params.js +191 -84
  585. package/dist/node_modules/next/dist/server/request/pathname.js +24 -2
  586. package/dist/node_modules/next/dist/server/request/root-params.js +9 -1
  587. package/dist/node_modules/next/dist/server/request/search-params.js +126 -70
  588. package/dist/node_modules/next/dist/server/request/utils.js +39 -6
  589. package/dist/node_modules/next/dist/server/response-cache/index.js +36 -24
  590. package/dist/node_modules/next/dist/server/resume-data-cache/cache-store.js +7 -2
  591. package/dist/node_modules/next/dist/server/resume-data-cache/resume-data-cache.js +25 -7
  592. package/dist/node_modules/next/dist/server/revalidation-utils.js +1 -2
  593. package/dist/node_modules/next/dist/server/route-modules/app-page/module.js +15 -1
  594. package/dist/node_modules/next/dist/server/route-modules/app-page/normalize-request-url.js +40 -3
  595. package/dist/node_modules/next/dist/server/route-modules/app-route/module.js +79 -46
  596. package/dist/node_modules/next/dist/server/route-modules/pages/pages-handler.js +270 -248
  597. package/dist/node_modules/next/dist/server/route-modules/route-module.js +45 -8
  598. package/dist/node_modules/next/dist/server/stream-utils/node-buffered-transform-stream.js +51 -0
  599. package/dist/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +90 -69
  600. package/dist/node_modules/next/dist/server/typescript/index.js +3 -3
  601. package/dist/node_modules/next/dist/server/typescript/rules/client-boundary.js +7 -4
  602. package/dist/node_modules/next/dist/server/typescript/rules/config.js +50 -28
  603. package/dist/node_modules/next/dist/server/use-cache/cache-life-profile.js +84 -0
  604. package/dist/node_modules/next/dist/server/use-cache/cache-life.js +4 -65
  605. package/dist/node_modules/next/dist/server/use-cache/clone-cache-entry.js +28 -0
  606. package/dist/node_modules/next/dist/server/use-cache/constants.js +24 -8
  607. package/dist/node_modules/next/dist/server/use-cache/handlers.js +166 -13
  608. package/dist/node_modules/next/dist/server/use-cache/tiered-cache-handler.js +145 -0
  609. package/dist/node_modules/next/dist/server/use-cache/use-cache-errors.js +34 -11
  610. package/dist/node_modules/next/dist/server/use-cache/use-cache-probe-globals.js +39 -0
  611. package/dist/node_modules/next/dist/server/use-cache/use-cache-probe-scheduler.js +117 -0
  612. package/dist/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +1475 -458
  613. package/dist/node_modules/next/dist/server/web/adapter.js +37 -4
  614. package/dist/node_modules/next/dist/server/web/edge-route-module-wrapper.js +14 -2
  615. package/dist/node_modules/next/dist/server/web/error.js +15 -0
  616. package/dist/node_modules/next/dist/server/web/sandbox/context.js +8 -2
  617. package/dist/node_modules/next/dist/server/web/sandbox/resource-managers.js +45 -10
  618. package/dist/node_modules/next/dist/server/web/spec-extension/adapters/headers.js +103 -2
  619. package/dist/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +15 -0
  620. package/dist/node_modules/next/dist/server/web/spec-extension/revalidate.js +18 -6
  621. package/dist/node_modules/next/dist/server/web/spec-extension/unstable-cache.js +35 -17
  622. package/dist/node_modules/next/dist/server/web/spec-extension/url-pattern.js +1 -2
  623. package/dist/node_modules/next/dist/shared/lib/app-router-types.js +125 -12
  624. package/dist/node_modules/next/dist/shared/lib/constants.js +5 -0
  625. package/dist/node_modules/next/dist/shared/lib/deployment-id.js +1 -1
  626. package/dist/node_modules/next/dist/shared/lib/errors/empty-generate-static-params-error.js +14 -7
  627. package/dist/node_modules/next/dist/shared/lib/errors/hard-deprecated-config-error.js +5 -0
  628. package/dist/node_modules/next/dist/shared/lib/head.js +5 -4
  629. package/dist/node_modules/next/dist/shared/lib/instant-messages.js +43 -0
  630. package/dist/node_modules/next/dist/shared/lib/invariant-error.js +5 -0
  631. package/dist/node_modules/next/dist/shared/lib/request-insights.js +30 -0
  632. package/dist/node_modules/next/dist/shared/lib/router/adapters.js +4 -1
  633. package/dist/node_modules/next/dist/shared/lib/router/routes/app.js +36 -12
  634. package/dist/node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js +1 -1
  635. package/dist/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +1 -1
  636. package/dist/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +2 -1
  637. package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +5 -4
  638. package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +1 -1
  639. package/dist/node_modules/next/dist/shared/lib/segment-cache/vary-params-decoding.js +46 -12
  640. package/dist/node_modules/next/dist/shared/lib/server-reference-info.js +12 -0
  641. package/dist/node_modules/next/dist/shared/lib/utils.js +10 -1
  642. package/dist/node_modules/next/dist/telemetry/agent-name.js +20 -0
  643. package/dist/node_modules/next/dist/telemetry/anonymous-meta.js +4 -2
  644. package/dist/node_modules/next/dist/telemetry/events/build.js +13 -0
  645. package/dist/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
  646. package/dist/node_modules/next/dist/telemetry/events/version.js +6 -4
  647. package/dist/node_modules/next/dist/telemetry/storage.js +6 -2
  648. package/dist/node_modules/next/dist/trace/report/to-json.js +7 -1
  649. package/dist/node_modules/next/package.json +16 -255
  650. package/dist/node_modules/semver/package.json +38 -0
  651. package/dist/node_modules/sharp/{lib/channel.js → dist/channel.cjs} +1 -1
  652. package/dist/node_modules/sharp/dist/channel.mjs +177 -0
  653. package/dist/node_modules/sharp/{lib/colour.js → dist/colour.cjs} +11 -7
  654. package/dist/node_modules/sharp/dist/colour.mjs +199 -0
  655. package/dist/node_modules/sharp/{lib/composite.js → dist/composite.cjs} +2 -1
  656. package/dist/node_modules/sharp/dist/composite.mjs +213 -0
  657. package/dist/node_modules/sharp/{lib/constructor.js → dist/constructor.cjs} +41 -29
  658. package/dist/node_modules/sharp/dist/constructor.mjs +511 -0
  659. package/dist/node_modules/sharp/dist/index.cjs +25 -0
  660. package/dist/node_modules/sharp/dist/index.d.cts +1999 -0
  661. package/dist/node_modules/sharp/dist/index.d.mts +2046 -0
  662. package/dist/node_modules/sharp/dist/index.mjs +25 -0
  663. package/dist/node_modules/sharp/{lib/input.js → dist/input.cjs} +27 -22
  664. package/dist/node_modules/sharp/dist/input.mjs +814 -0
  665. package/dist/node_modules/sharp/{lib/is.js → dist/is.cjs} +1 -1
  666. package/dist/node_modules/sharp/dist/is.mjs +143 -0
  667. package/dist/node_modules/sharp/{lib/libvips.js → dist/libvips.cjs} +35 -30
  668. package/dist/node_modules/sharp/dist/libvips.mjs +212 -0
  669. package/dist/node_modules/sharp/{lib/operation.js → dist/operation.cjs} +33 -51
  670. package/dist/node_modules/sharp/dist/operation.mjs +998 -0
  671. package/dist/node_modules/sharp/{lib/output.js → dist/output.cjs} +162 -40
  672. package/dist/node_modules/sharp/dist/output.mjs +1788 -0
  673. package/dist/node_modules/sharp/{lib/resize.js → dist/resize.cjs} +46 -24
  674. package/dist/node_modules/sharp/dist/resize.mjs +617 -0
  675. package/dist/node_modules/sharp/dist/sharp.cjs +174 -0
  676. package/dist/node_modules/sharp/dist/sharp.mjs +174 -0
  677. package/dist/node_modules/sharp/{lib/utility.js → dist/utility.cjs} +18 -8
  678. package/dist/node_modules/sharp/dist/utility.mjs +301 -0
  679. package/dist/node_modules/sharp/node_modules/semver/classes/range.js +17 -4
  680. package/dist/node_modules/sharp/node_modules/semver/classes/semver.js +19 -2
  681. package/dist/node_modules/sharp/node_modules/semver/functions/clean.js +8 -0
  682. package/dist/node_modules/sharp/node_modules/semver/functions/compare-build.js +9 -0
  683. package/dist/node_modules/sharp/node_modules/semver/functions/compare-loose.js +5 -0
  684. package/dist/node_modules/sharp/node_modules/semver/functions/diff.js +60 -0
  685. package/dist/node_modules/sharp/node_modules/semver/functions/inc.js +21 -0
  686. package/dist/node_modules/sharp/node_modules/semver/functions/major.js +5 -0
  687. package/dist/node_modules/sharp/node_modules/semver/functions/minor.js +5 -0
  688. package/dist/node_modules/sharp/node_modules/semver/functions/patch.js +5 -0
  689. package/dist/node_modules/sharp/node_modules/semver/functions/prerelease.js +8 -0
  690. package/dist/node_modules/sharp/node_modules/semver/functions/rcompare.js +5 -0
  691. package/dist/node_modules/sharp/node_modules/semver/functions/rsort.js +5 -0
  692. package/dist/node_modules/sharp/node_modules/semver/functions/sort.js +5 -0
  693. package/dist/node_modules/sharp/node_modules/semver/functions/truncate.js +48 -0
  694. package/dist/node_modules/sharp/node_modules/semver/functions/valid.js +8 -0
  695. package/dist/node_modules/sharp/node_modules/semver/index.js +93 -0
  696. package/dist/node_modules/sharp/node_modules/semver/package.json +2 -2
  697. package/dist/node_modules/sharp/node_modules/semver/ranges/gtr.js +6 -0
  698. package/dist/node_modules/sharp/node_modules/semver/ranges/intersects.js +9 -0
  699. package/dist/node_modules/sharp/node_modules/semver/ranges/ltr.js +6 -0
  700. package/dist/node_modules/sharp/node_modules/semver/ranges/max-satisfying.js +27 -0
  701. package/dist/node_modules/sharp/node_modules/semver/ranges/min-satisfying.js +26 -0
  702. package/dist/node_modules/sharp/node_modules/semver/ranges/min-version.js +63 -0
  703. package/dist/node_modules/sharp/node_modules/semver/ranges/outside.js +82 -0
  704. package/dist/node_modules/sharp/node_modules/semver/ranges/simplify.js +49 -0
  705. package/dist/node_modules/sharp/node_modules/semver/ranges/subset.js +249 -0
  706. package/dist/node_modules/sharp/node_modules/semver/ranges/to-comparators.js +10 -0
  707. package/dist/node_modules/sharp/node_modules/semver/ranges/valid.js +13 -0
  708. package/dist/node_modules/sharp/package.json +77 -52
  709. package/dist/package.json +2 -2
  710. package/dist/server.js +1 -1
  711. package/package.json +2 -2
  712. package/dist/.next/server/app/_global-error.segments/_head.segment.rsc +0 -5
  713. package/dist/.next/server/app/_global-error.segments/_index.segment.rsc +0 -5
  714. package/dist/.next/server/app/_not-found.segments/_head.segment.rsc +0 -6
  715. package/dist/.next/server/app/_not-found.segments/_index.segment.rsc +0 -8
  716. package/dist/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -5
  717. package/dist/.next/server/app/index.segments/_head.segment.rsc +0 -6
  718. package/dist/.next/server/app/index.segments/_index.segment.rsc +0 -8
  719. package/dist/.next/server/chunks/[externals]_next_dist_0arv.vj._.js +0 -3
  720. package/dist/.next/server/chunks/[root-of-the-server]__04y5ms7._.js +0 -6
  721. package/dist/.next/server/chunks/[root-of-the-server]__05vp2x.._.js +0 -3
  722. package/dist/.next/server/chunks/[root-of-the-server]__08kko28._.js +0 -3
  723. package/dist/.next/server/chunks/[root-of-the-server]__0bpxd~j._.js +0 -3
  724. package/dist/.next/server/chunks/[root-of-the-server]__0cnmh23._.js +0 -3
  725. package/dist/.next/server/chunks/[root-of-the-server]__0j8-xkl._.js +0 -13
  726. package/dist/.next/server/chunks/[root-of-the-server]__0nngqla._.js +0 -6
  727. package/dist/.next/server/chunks/[root-of-the-server]__0o.c5k_._.js +0 -3
  728. package/dist/.next/server/chunks/[root-of-the-server]__0pz~0wz._.js +0 -6
  729. package/dist/.next/server/chunks/[root-of-the-server]__0s6.s21._.js +0 -6
  730. package/dist/.next/server/chunks/[root-of-the-server]__0vunt~c._.js +0 -3
  731. package/dist/.next/server/chunks/[root-of-the-server]__0xoct7b._.js +0 -3
  732. package/dist/.next/server/chunks/[root-of-the-server]__0yvyeh4._.js +0 -3
  733. package/dist/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0dh.2jf.js +0 -3
  734. package/dist/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0qs61ly.js +0 -3
  735. package/dist/.next/server/chunks/ssr/[root-of-the-server]__01cqrhy._.js +0 -33
  736. package/dist/.next/server/chunks/ssr/[root-of-the-server]__098zro9._.js +0 -19
  737. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0cylknl._.js +0 -12
  738. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0e_kl3j._.js +0 -3
  739. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0e~coys._.js +0 -3
  740. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0lb9jwe._.js +0 -3
  741. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0tcyn68._.js +0 -33
  742. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0zi~h76._.js +0 -3
  743. package/dist/.next/server/chunks/ssr/[root-of-the-server]__1130a6w._.js +0 -3
  744. package/dist/.next/server/chunks/ssr/[root-of-the-server]__12~42ln._.js +0 -3
  745. package/dist/.next/server/chunks/ssr/_03eop86._.js +0 -4
  746. package/dist/.next/server/chunks/ssr/_next-internal_server_app_page_actions_09-gtaw.js +0 -3
  747. package/dist/.next/server/chunks/ssr/node_modules_0-9jf7s._.js +0 -3
  748. package/dist/.next/server/chunks/ssr/node_modules_0.l_o9k._.js +0 -26
  749. package/dist/.next/server/chunks/ssr/node_modules_00-o__w._.js +0 -45
  750. package/dist/.next/server/chunks/ssr/node_modules_00yk8df._.js +0 -3
  751. package/dist/.next/server/chunks/ssr/node_modules_01rqq7y._.js +0 -3
  752. package/dist/.next/server/chunks/ssr/node_modules_050o3~0._.js +0 -3
  753. package/dist/.next/server/chunks/ssr/node_modules_09x0yif._.js +0 -3
  754. package/dist/.next/server/chunks/ssr/node_modules_0_ce7g1._.js +0 -3
  755. package/dist/.next/server/chunks/ssr/node_modules_0a61e8g._.js +0 -3
  756. package/dist/.next/server/chunks/ssr/node_modules_0a9st_6._.js +0 -3
  757. package/dist/.next/server/chunks/ssr/node_modules_0cdeu-p._.js +0 -6
  758. package/dist/.next/server/chunks/ssr/node_modules_0d91z34._.js +0 -11
  759. package/dist/.next/server/chunks/ssr/node_modules_0exnvlg._.js +0 -17
  760. package/dist/.next/server/chunks/ssr/node_modules_0h3oz6o._.js +0 -3
  761. package/dist/.next/server/chunks/ssr/node_modules_0kf5axs._.js +0 -3
  762. package/dist/.next/server/chunks/ssr/node_modules_0k~wgzn._.js +0 -3
  763. package/dist/.next/server/chunks/ssr/node_modules_0l-2che._.js +0 -3
  764. package/dist/.next/server/chunks/ssr/node_modules_0m8d9.a._.js +0 -3
  765. package/dist/.next/server/chunks/ssr/node_modules_0p1ro75._.js +0 -3
  766. package/dist/.next/server/chunks/ssr/node_modules_0q8gl61._.js +0 -3
  767. package/dist/.next/server/chunks/ssr/node_modules_0s8hn7e._.js +0 -3
  768. package/dist/.next/server/chunks/ssr/node_modules_0skn4ke._.js +0 -3
  769. package/dist/.next/server/chunks/ssr/node_modules_0u1jua0._.js +0 -17
  770. package/dist/.next/server/chunks/ssr/node_modules_0ujy5r7._.js +0 -3
  771. package/dist/.next/server/chunks/ssr/node_modules_0xl3swb._.js +0 -17
  772. package/dist/.next/server/chunks/ssr/node_modules_0yx-7n5._.js +0 -31
  773. package/dist/.next/server/chunks/ssr/node_modules_11r29oo._.js +0 -3
  774. package/dist/.next/server/chunks/ssr/node_modules_12uy2-t._.js +0 -3
  775. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_00zox90._.js +0 -3
  776. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_048nvza._.js +0 -3
  777. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_0bqbkzr._.js +0 -3
  778. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_0iy4ann._.js +0 -3
  779. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_0n~wpy6._.js +0 -3
  780. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_0rp8krb._.js +0 -3
  781. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_0se--ys._.js +0 -3
  782. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_0v554rd._.js +0 -3
  783. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_12i5eeu._.js +0 -3
  784. package/dist/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_13s5vbm._.js +0 -3
  785. package/dist/.next/server/chunks/ssr/node_modules_dagre-d3-es_src_dagre_index_097t5l0.js +0 -3
  786. package/dist/.next/server/chunks/ssr/node_modules_next_dist_0xdsm99._.js +0 -6
  787. package/dist/.next/server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js +0 -3
  788. package/dist/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js +0 -3
  789. package/dist/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_00t_ate.js +0 -4
  790. package/dist/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_031v14j.js +0 -4
  791. package/dist/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0rc3ul_.js +0 -4
  792. package/dist/.next/static/chunks/0-.wbb-l7eg0y.js +0 -1
  793. package/dist/.next/static/chunks/0-6znc4v4kg4~.js +0 -1
  794. package/dist/.next/static/chunks/038jxymv2x4u-.js +0 -148
  795. package/dist/.next/static/chunks/08nzg~fbi7p-7.js +0 -1
  796. package/dist/.next/static/chunks/0aqpm5mabssqz.js +0 -1
  797. package/dist/.next/static/chunks/0dcu67gngfgpb.js +0 -4
  798. package/dist/.next/static/chunks/0do2sl_ugmstg.js +0 -10
  799. package/dist/.next/static/chunks/0e~yxiezknbzn.css +0 -3
  800. package/dist/.next/static/chunks/0ge0mq0ea60lx.js +0 -1
  801. package/dist/.next/static/chunks/0h-pxsp01miga.js +0 -1
  802. package/dist/.next/static/chunks/0i8pgzf~hu-3m.js +0 -24
  803. package/dist/.next/static/chunks/0icpvuwlmnlty.js +0 -43
  804. package/dist/.next/static/chunks/0ipk1er3w80bj.js +0 -24
  805. package/dist/.next/static/chunks/0lfej4svc~ist.js +0 -1
  806. package/dist/.next/static/chunks/0lmzx880lnpb..js +0 -1
  807. package/dist/.next/static/chunks/0luwdx.2p-x9e.js +0 -31
  808. package/dist/.next/static/chunks/0npm9l63~4j0v.js +0 -1
  809. package/dist/.next/static/chunks/0r~zu0c3j_b7p.js +0 -1
  810. package/dist/.next/static/chunks/0w57stq9f_irn.js +0 -10
  811. package/dist/.next/static/chunks/0~b.d.ay4u9zg.js +0 -2
  812. package/dist/.next/static/chunks/112qdnf547wz8.js +0 -1
  813. package/dist/.next/static/chunks/11uh-ttx4zin-.js +0 -9
  814. package/dist/.next/static/chunks/14i46k409qlt0.js +0 -1
  815. package/dist/.next/static/chunks/14j238ax8coge.js +0 -29
  816. package/dist/.next/static/chunks/14u7twut.vmn5.js +0 -1
  817. package/dist/.next/static/chunks/16k05wezoz4u0.js +0 -1
  818. package/dist/.next/static/chunks/turbopack-12mx7z-ex6m1h.js +0 -1
  819. package/dist/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  820. package/dist/node_modules/next/dist/client/components/unstable-rethrow.browser.js +0 -28
  821. package/dist/node_modules/next/dist/client/components/unstable-rethrow.server.js +0 -32
  822. package/dist/node_modules/next/dist/compiled/http-proxy/index.js +0 -34
  823. package/dist/node_modules/next/dist/compiled/http-proxy/package.json +0 -1
  824. package/dist/node_modules/next/dist/lib/fatal-error.js +0 -14
  825. package/dist/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +0 -39
  826. package/dist/node_modules/sharp/lib/index.js +0 -16
  827. package/dist/node_modules/sharp/lib/sharp.js +0 -121
  828. /package/dist/.next/static/{KtUBUvcK3Gu2PuRf9GGiJ → 0ElnbO3cxvcyCbDz0Tuqe}/_buildManifest.js +0 -0
  829. /package/dist/.next/static/{KtUBUvcK3Gu2PuRf9GGiJ → 0ElnbO3cxvcyCbDz0Tuqe}/_clientMiddlewareManifest.js +0 -0
  830. /package/dist/.next/static/{KtUBUvcK3Gu2PuRf9GGiJ → 0ElnbO3cxvcyCbDz0Tuqe}/_ssgManifest.js +0 -0
  831. /package/dist/.next/static/chunks/{01ontipw7_pn-.js → 059oqdb-4djh4.js} +0 -0
  832. /package/dist/.next/static/chunks/{03lth2le32c6r.js → 0bk3aw3m9c72a.js} +0 -0
  833. /package/dist/.next/static/chunks/{03l_lqxocp3uj.js → 0bko6sy3fi25l.js} +0 -0
  834. /package/dist/.next/static/chunks/{03v0v690_bw8u.js → 0catqiaei7kwh.js} +0 -0
  835. /package/dist/.next/static/chunks/{03yru4-m-450t.js → 0cm59yzmvnr6a.js} +0 -0
  836. /package/dist/.next/static/chunks/{03~yq9q893hmn.js → 0cz1d0mv5g_q7.js} +0 -0
  837. /package/dist/.next/static/chunks/{06o.rsm2b~dht.js → 0ll25xvc8tvc7.js} +0 -0
  838. /package/dist/.next/static/chunks/{08o5wsrurx9ux.js → 0r-qze3me8owo.js} +0 -0
  839. /package/dist/.next/static/chunks/{09~n7y-jkmjlj.js → 0wf_g68m1dyuq.js} +0 -0
  840. /package/dist/.next/static/chunks/{0awsj.h.eiuen.js → 0z7hf76h0cz39.js} +0 -0
  841. /package/dist/.next/static/chunks/{0axtn1ln1j35_.js → 0zao0i_njogzy.js} +0 -0
  842. /package/dist/.next/static/chunks/{0c5xj4q0jmdu0.js → 11jp13p4e7ycl.js} +0 -0
  843. /package/dist/.next/static/chunks/{0cu8k_dz43e4y.js → 13j02-7zvh70e.js} +0 -0
  844. /package/dist/.next/static/chunks/{0e4xdug~7dxzk.js → 17zvg7jc-nx5v.js} +0 -0
  845. /package/dist/.next/static/chunks/{0f8bbcvfh6x_j.js → 1bi4m489puezc.js} +0 -0
  846. /package/dist/.next/static/chunks/{0gq18q-ip0uh2.js → 1g6nbgmclpjgd.js} +0 -0
  847. /package/dist/.next/static/chunks/{0k9_1v72yx36d.js → 1rxbddx-dyypf.js} +0 -0
  848. /package/dist/.next/static/chunks/{0l3uvjh3oslhq.js → 1un-c368y76x-.js} +0 -0
  849. /package/dist/.next/static/chunks/{0lypu-.xpph9..js → 1x5foe7mtvd8m.js} +0 -0
  850. /package/dist/.next/static/chunks/{0ortphe030oky.js → 24c-6p_4lbozm.js} +0 -0
  851. /package/dist/.next/static/chunks/{0oufb2b491l23.js → 24l5e3uup8rxf.js} +0 -0
  852. /package/dist/.next/static/chunks/{0ps77yd96walr.js → 27n_wru0tprv5.js} +0 -0
  853. /package/dist/.next/static/chunks/{0qfu4h5g.k-yt.js → 29x7ecuc6vybp.js} +0 -0
  854. /package/dist/.next/static/chunks/{0rmt10l3458p_.js → 2dqeid-8xhwun.js} +0 -0
  855. /package/dist/.next/static/chunks/{0s0v8xobo-2ok.js → 2f6739bq5ewxz.js} +0 -0
  856. /package/dist/.next/static/chunks/{0s8nwq43gep9_.js → 2fuc_smcevit1.js} +0 -0
  857. /package/dist/.next/static/chunks/{0spswjguxbqfn.js → 2h7acwi-mfsrx.js} +0 -0
  858. /package/dist/.next/static/chunks/{0xxouzzjw_a6q.js → 2y3wq_x8yyu_b.js} +0 -0
  859. /package/dist/.next/static/chunks/{0ydl92ezt_ppz.js → 2zrfdnujo3u51.js} +0 -0
  860. /package/dist/.next/static/chunks/{16pzrphqjtyli.js → 3-t8rqn47mim5.js} +0 -0
  861. /package/dist/.next/static/chunks/{0~.e-m04zn5l_.js → 3cvv663zekq_n.js} +0 -0
  862. /package/dist/.next/static/chunks/{11luuvvu~stmv.js → 3l6bwn061vy22.js} +0 -0
  863. /package/dist/.next/static/chunks/{11_7qxlc92f5s.js → 3mcxvhb8ujk39.js} +0 -0
  864. /package/dist/.next/static/chunks/{13mjf5q.pema_.js → 3rru41488bc4e.js} +0 -0
  865. /package/dist/.next/static/chunks/{159151ghv9-cc.js → 3x5hww03ialmf.js} +0 -0
  866. /package/dist/.next/static/chunks/{15r_pfbdb2jhp.js → 3ypwau9uw-qzz.js} +0 -0
  867. /package/dist/.next/static/chunks/{182b_f_n0-cdr.js → 44dlrjamdw9zn.js} +0 -0
  868. /package/dist/.next/static/media/{1bffadaabf893a1e-s.16ipb6fqu393i.woff2 → 1bffadaabf893a1e-s.3-6t-g6q0vh0a.woff2} +0 -0
  869. /package/dist/.next/static/media/{2bbe8d2671613f1f-s.067x_6k0k23tk.woff2 → 2bbe8d2671613f1f-s.0k62hbripvv8p.woff2} +0 -0
  870. /package/dist/.next/static/media/{2c55a0e60120577a-s.0bjc5tiuqdqro.woff2 → 2c55a0e60120577a-s.0-dom-5bn10r2.woff2} +0 -0
  871. /package/dist/.next/static/media/{5476f68d60460930-s.0wxq9webf.ew4.woff2 → 5476f68d60460930-s.2uwcyprjm3xu3.woff2} +0 -0
  872. /package/dist/.next/static/media/{83afe278b6a6bb3c-s.p.0q-301v4kxxnr.woff2 → 83afe278b6a6bb3c-s.p.2bn3s6zvc0dyp.woff2} +0 -0
  873. /package/dist/.next/static/media/{9c72aa0f40e4eef8-s.0m6w47a4e5dy9.woff2 → 9c72aa0f40e4eef8-s.1y4-pdgsjb-pw.woff2} +0 -0
  874. /package/dist/.next/static/media/{KaTeX_AMS-Regular.0b~8ki5y928w2.woff → KaTeX_AMS-Regular.10y3kupq4t663.woff} +0 -0
  875. /package/dist/.next/static/media/{KaTeX_AMS-Regular.0p1vbqd84i2~o.woff2 → KaTeX_AMS-Regular.25ieegmnh38ts.woff2} +0 -0
  876. /package/dist/.next/static/media/{KaTeX_AMS-Regular.173t6ktr7uf-w.ttf → KaTeX_AMS-Regular.418dr7cz3fo2x.ttf} +0 -0
  877. /package/dist/.next/static/media/{KaTeX_Caligraphic-Bold.01-pzluls4zgb.woff2 → KaTeX_Caligraphic-Bold.06b-ya9t43ioz.woff2} +0 -0
  878. /package/dist/.next/static/media/{KaTeX_Caligraphic-Bold.0x2v1lwn~880f.woff → KaTeX_Caligraphic-Bold.2vmk2hva4ctha.woff} +0 -0
  879. /package/dist/.next/static/media/{KaTeX_Caligraphic-Bold.16zv5fax0h0ka.ttf → KaTeX_Caligraphic-Bold.40ltxhe834pns.ttf} +0 -0
  880. /package/dist/.next/static/media/{KaTeX_Caligraphic-Regular.02i3z7wig438t.ttf → KaTeX_Caligraphic-Regular.07-7u27-nhn_r.ttf} +0 -0
  881. /package/dist/.next/static/media/{KaTeX_Caligraphic-Regular.0rysu1t-ncjq8.woff2 → KaTeX_Caligraphic-Regular.2eph4dlhid_m9.woff2} +0 -0
  882. /package/dist/.next/static/media/{KaTeX_Caligraphic-Regular.10927swgekwun.woff → KaTeX_Caligraphic-Regular.3gxeetazf831f.woff} +0 -0
  883. /package/dist/.next/static/media/{KaTeX_Fraktur-Bold.0et27v~3~4uhe.ttf → KaTeX_Fraktur-Bold.19yqa_tc9d_gx.ttf} +0 -0
  884. /package/dist/.next/static/media/{KaTeX_Fraktur-Bold.0e-16u10iuyyf.woff → KaTeX_Fraktur-Bold.1alcy76__wdj2.woff} +0 -0
  885. /package/dist/.next/static/media/{KaTeX_Fraktur-Bold.0w23i72~hprpq.woff2 → KaTeX_Fraktur-Bold.2sasz-d-jtw8y.woff2} +0 -0
  886. /package/dist/.next/static/media/{KaTeX_Fraktur-Regular.0b.riegzdfue2.woff → KaTeX_Fraktur-Regular.110oo81prr9n5.woff} +0 -0
  887. /package/dist/.next/static/media/{KaTeX_Fraktur-Regular.0rekyoa-52fj_.woff2 → KaTeX_Fraktur-Regular.2d10y4xmjvzlf.woff2} +0 -0
  888. /package/dist/.next/static/media/{KaTeX_Fraktur-Regular.0vjwa15znhk~4.ttf → KaTeX_Fraktur-Regular.2qhy34r6a05dn.ttf} +0 -0
  889. /package/dist/.next/static/media/{KaTeX_Main-Bold.09i7~607shf-h.ttf → KaTeX_Main-Bold.0us_n0tnxlxu7.ttf} +0 -0
  890. /package/dist/.next/static/media/{KaTeX_Main-Bold.09lmynrorhcbw.woff → KaTeX_Main-Bold.0v1esh257kqpe.woff} +0 -0
  891. /package/dist/.next/static/media/{KaTeX_Main-Bold.16pfc63_du6mx.woff2 → KaTeX_Main-Bold.3-rowy8o6_4ky.woff2} +0 -0
  892. /package/dist/.next/static/media/{KaTeX_Main-BoldItalic.0cp37g7x1q8h6.woff → KaTeX_Main-BoldItalic.13355ck5zr48q.woff} +0 -0
  893. /package/dist/.next/static/media/{KaTeX_Main-BoldItalic.0d54rk08rx11s.woff2 → KaTeX_Main-BoldItalic.14r2naom8mrec.woff2} +0 -0
  894. /package/dist/.next/static/media/{KaTeX_Main-BoldItalic.15j6k~hix2t_0.ttf → KaTeX_Main-BoldItalic.3x_u9cepaced0.ttf} +0 -0
  895. /package/dist/.next/static/media/{KaTeX_Main-Italic.0382gqciexmbu.woff → KaTeX_Main-Italic.0afv392dj4w59.woff} +0 -0
  896. /package/dist/.next/static/media/{KaTeX_Main-Italic.06o5nq0_91v60.woff2 → KaTeX_Main-Italic.0lig0v9j0700p.woff2} +0 -0
  897. /package/dist/.next/static/media/{KaTeX_Main-Italic.0su4i6mm18-wo.ttf → KaTeX_Main-Italic.2hkw3230mfwcv.ttf} +0 -0
  898. /package/dist/.next/static/media/{KaTeX_Main-Regular.08zh8z.7shijf.ttf → KaTeX_Main-Regular.0symfa7dqj6jd.ttf} +0 -0
  899. /package/dist/.next/static/media/{KaTeX_Main-Regular.0diheg01zyoph.woff → KaTeX_Main-Regular.15u8r3b2y7fv4.woff} +0 -0
  900. /package/dist/.next/static/media/{KaTeX_Main-Regular.0kaf-ag2_wkm-.woff2 → KaTeX_Main-Regular.1ryvsdzh2w1_e.woff2} +0 -0
  901. /package/dist/.next/static/media/{KaTeX_Math-BoldItalic.0ajzxypnbx1h1.ttf → KaTeX_Math-BoldItalic.0y5w36a5aq__2.ttf} +0 -0
  902. /package/dist/.next/static/media/{KaTeX_Math-BoldItalic.0ck1myuerwyqw.woff → KaTeX_Math-BoldItalic.12pl58orkw9rg.woff} +0 -0
  903. /package/dist/.next/static/media/{KaTeX_Math-BoldItalic.0ja97dn.cpc87.woff2 → KaTeX_Math-BoldItalic.1oopuu636h4il.woff2} +0 -0
  904. /package/dist/.next/static/media/{KaTeX_Math-Italic.09xkhecjcn5r9.woff → KaTeX_Math-Italic.0w0b1ugh62cfr.woff} +0 -0
  905. /package/dist/.next/static/media/{KaTeX_Math-Italic.0x23a-bmp-5tg.ttf → KaTeX_Math-Italic.2vkekfblmz5nb.ttf} +0 -0
  906. /package/dist/.next/static/media/{KaTeX_Math-Italic.0zrha2c4sl2je.woff2 → KaTeX_Math-Italic.32405s1aq8vas.woff2} +0 -0
  907. /package/dist/.next/static/media/{KaTeX_SansSerif-Bold.05a9.pc1j_zx9.woff2 → KaTeX_SansSerif-Bold.0h3wi2z_eouyg.woff2} +0 -0
  908. /package/dist/.next/static/media/{KaTeX_SansSerif-Bold.0jcl-ayi1uun0.woff → KaTeX_SansSerif-Bold.1ovw5p-yjp56g.woff} +0 -0
  909. /package/dist/.next/static/media/{KaTeX_SansSerif-Bold.0re8y.dm7.mt5.ttf → KaTeX_SansSerif-Bold.2d03q85pwxpti.ttf} +0 -0
  910. /package/dist/.next/static/media/{KaTeX_SansSerif-Italic.0a0234dc3s62j.woff2 → KaTeX_SansSerif-Italic.0wkjc4dm2kcit.woff2} +0 -0
  911. /package/dist/.next/static/media/{KaTeX_SansSerif-Italic.0judofdln9731.woff → KaTeX_SansSerif-Italic.1qavw__2zz8gk.woff} +0 -0
  912. /package/dist/.next/static/media/{KaTeX_SansSerif-Italic.10z1iap9pfus8.ttf → KaTeX_SansSerif-Italic.3i-q087b23-m8.ttf} +0 -0
  913. /package/dist/.next/static/media/{KaTeX_SansSerif-Regular.0h9yjlugq4q_e.woff → KaTeX_SansSerif-Regular.1i4afx8nk8n4r.woff} +0 -0
  914. /package/dist/.next/static/media/{KaTeX_SansSerif-Regular.0v6gcj32-czft.woff2 → KaTeX_SansSerif-Regular.2peiewu59z3d-.woff2} +0 -0
  915. /package/dist/.next/static/media/{KaTeX_SansSerif-Regular.0zm18kga42ebc.ttf → KaTeX_SansSerif-Regular.31pbu25feko_c.ttf} +0 -0
  916. /package/dist/.next/static/media/{KaTeX_Script-Regular.0c4.h-mer83d_.woff2 → KaTeX_Script-Regular.11h14300o9pd0.woff2} +0 -0
  917. /package/dist/.next/static/media/{KaTeX_Script-Regular.0q14y6zkzlpob.ttf → KaTeX_Script-Regular.28p_x7iz71ofe.ttf} +0 -0
  918. /package/dist/.next/static/media/{KaTeX_Script-Regular.0ze6v4r_-99oy.woff → KaTeX_Script-Regular.3110jb9c-bxna.woff} +0 -0
  919. /package/dist/.next/static/media/{KaTeX_Size1-Regular.013x6a4ierotp.woff2 → KaTeX_Size1-Regular.03lhvx36ekcou.woff2} +0 -0
  920. /package/dist/.next/static/media/{KaTeX_Size1-Regular.0kidw0oi.m68o.woff → KaTeX_Size1-Regular.1slf4bh0hc6vm.woff} +0 -0
  921. /package/dist/.next/static/media/{KaTeX_Size1-Regular.0m6y-i6wfokni.ttf → KaTeX_Size1-Regular.1y57-ck23ey8c.ttf} +0 -0
  922. /package/dist/.next/static/media/{KaTeX_Size2-Regular.0blpmluwilgbg.woff → KaTeX_Size2-Regular.0-kwyvx03omo8.woff} +0 -0
  923. /package/dist/.next/static/media/{KaTeX_Size2-Regular.0d5inmyp-tyv3.woff2 → KaTeX_Size2-Regular.14s5gg-puz6h-.woff2} +0 -0
  924. /package/dist/.next/static/media/{KaTeX_Size2-Regular.0wnhnvj-.k9d5.ttf → KaTeX_Size2-Regular.2u0s-b07k2o9m.ttf} +0 -0
  925. /package/dist/.next/static/media/{KaTeX_Size3-Regular.01h0xm_sfctj3.woff → KaTeX_Size3-Regular.04o9a_02gu_e8.woff} +0 -0
  926. /package/dist/.next/static/media/{KaTeX_Size3-Regular.0iukctyhw5j56.woff2 → KaTeX_Size3-Regular.1n1rgzz84z8r9.woff2} +0 -0
  927. /package/dist/.next/static/media/{KaTeX_Size3-Regular.0jl8mqyf4gzpn.ttf → KaTeX_Size3-Regular.1pkn-dge4q0fv.ttf} +0 -0
  928. /package/dist/.next/static/media/{KaTeX_Size4-Regular.0w3.rb_c4stzk.woff2 → KaTeX_Size4-Regular.2sgotkdv3dcyv.woff2} +0 -0
  929. /package/dist/.next/static/media/{KaTeX_Size4-Regular.0wr_9l81-mu06.ttf → KaTeX_Size4-Regular.2uelkfk2yna5e.ttf} +0 -0
  930. /package/dist/.next/static/media/{KaTeX_Size4-Regular.12tvaesf3.zl3.woff → KaTeX_Size4-Regular.3p2r1l7xmebxv.woff} +0 -0
  931. /package/dist/.next/static/media/{KaTeX_Typewriter-Regular.0c4zdxz~8frhm.woff2 → KaTeX_Typewriter-Regular.11gr2d2wuwz77.woff2} +0 -0
  932. /package/dist/.next/static/media/{KaTeX_Typewriter-Regular.0cgrzn5l3kao5.woff → KaTeX_Typewriter-Regular.12f8myjij3617.woff} +0 -0
  933. /package/dist/.next/static/media/{KaTeX_Typewriter-Regular.128~qc3858otl.ttf → KaTeX_Typewriter-Regular.3nee9kjfy6nm8.ttf} +0 -0
  934. /package/dist/.next/static/media/{ad66f9afd8947f86-s.11u06r12fd6v_.woff2 → ad66f9afd8947f86-s.3lvt2whj97whp.woff2} +0 -0
  935. /package/dist/.next/static/media/{icon.0j1xc6-m~vsbh.png → icon.1n_rla2f79pbj.png} +0 -0
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  0 && (module.exports = {
6
6
  EntryStatus: null,
7
+ MetadataOnlyRequestTree: null,
7
8
  attemptToFulfillDynamicSegmentFromBFCache: null,
8
9
  attemptToUpgradeSegmentFromBFCache: null,
9
10
  canNewFetchStrategyProvideMoreContent: null,
@@ -12,15 +13,14 @@ Object.defineProperty(exports, "__esModule", {
12
13
  convertRouteTreeToFlightRouterState: null,
13
14
  createDetachedSegmentCacheEntry: null,
14
15
  createMetadataRouteTree: null,
16
+ createNonTaskyPrefetchResponseStream: null,
15
17
  deprecated_requestOptimisticRouteCacheEntry: null,
16
- fetchInlinedSegmentsOnCacheMiss: null,
17
18
  fetchRouteOnCacheMiss: null,
18
- fetchSegmentOnCacheMiss: null,
19
19
  fetchSegmentPrefetchesUsingDynamicRequest: null,
20
+ fetchSegmentsOnCacheMiss: null,
20
21
  fulfillRouteCacheEntry: null,
21
22
  getCurrentRouteCacheVersion: null,
22
23
  getCurrentSegmentCacheVersion: null,
23
- getStaleAt: null,
24
24
  getStaleTimeMs: null,
25
25
  invalidateEntirePrefetchCache: null,
26
26
  invalidateRouteCacheEntries: null,
@@ -33,14 +33,16 @@ Object.defineProperty(exports, "__esModule", {
33
33
  readOrCreateRouteCacheEntry: null,
34
34
  readOrCreateSegmentCacheEntry: null,
35
35
  readRouteCacheEntry: null,
36
- readSegmentCacheEntry: null,
36
+ readSegmentCacheEntryForNavigation: null,
37
+ resolveStaleAt: null,
38
+ segmentCacheMap: null,
37
39
  stripIsPartialByte: null,
38
40
  upgradeToPendingSegment: null,
39
41
  upsertSegmentEntry: null,
40
42
  waitForSegmentCacheEntry: null,
41
43
  writeDynamicRenderResponseIntoCache: null,
42
- writeRouteIntoCache: null,
43
- writeStaticStageResponseIntoCache: null
44
+ writePrerenderResponseIntoCache: null,
45
+ writeRouteIntoCache: null
44
46
  });
45
47
  function _export(target, all) {
46
48
  for(var name in all)Object.defineProperty(target, name, {
@@ -50,7 +52,10 @@ function _export(target, all) {
50
52
  }
51
53
  _export(exports, {
52
54
  EntryStatus: function() {
53
- return EntryStatus;
55
+ return _cachemap.EntryStatus;
56
+ },
57
+ MetadataOnlyRequestTree: function() {
58
+ return MetadataOnlyRequestTree;
54
59
  },
55
60
  attemptToFulfillDynamicSegmentFromBFCache: function() {
56
61
  return attemptToFulfillDynamicSegmentFromBFCache;
@@ -76,21 +81,21 @@ _export(exports, {
76
81
  createMetadataRouteTree: function() {
77
82
  return createMetadataRouteTree;
78
83
  },
84
+ createNonTaskyPrefetchResponseStream: function() {
85
+ return createNonTaskyPrefetchResponseStream;
86
+ },
79
87
  deprecated_requestOptimisticRouteCacheEntry: function() {
80
88
  return deprecated_requestOptimisticRouteCacheEntry;
81
89
  },
82
- fetchInlinedSegmentsOnCacheMiss: function() {
83
- return fetchInlinedSegmentsOnCacheMiss;
84
- },
85
90
  fetchRouteOnCacheMiss: function() {
86
91
  return fetchRouteOnCacheMiss;
87
92
  },
88
- fetchSegmentOnCacheMiss: function() {
89
- return fetchSegmentOnCacheMiss;
90
- },
91
93
  fetchSegmentPrefetchesUsingDynamicRequest: function() {
92
94
  return fetchSegmentPrefetchesUsingDynamicRequest;
93
95
  },
96
+ fetchSegmentsOnCacheMiss: function() {
97
+ return fetchSegmentsOnCacheMiss;
98
+ },
94
99
  fulfillRouteCacheEntry: function() {
95
100
  return fulfillRouteCacheEntry;
96
101
  },
@@ -100,9 +105,6 @@ _export(exports, {
100
105
  getCurrentSegmentCacheVersion: function() {
101
106
  return getCurrentSegmentCacheVersion;
102
107
  },
103
- getStaleAt: function() {
104
- return getStaleAt;
105
- },
106
108
  getStaleTimeMs: function() {
107
109
  return getStaleTimeMs;
108
110
  },
@@ -139,8 +141,14 @@ _export(exports, {
139
141
  readRouteCacheEntry: function() {
140
142
  return readRouteCacheEntry;
141
143
  },
142
- readSegmentCacheEntry: function() {
143
- return readSegmentCacheEntry;
144
+ readSegmentCacheEntryForNavigation: function() {
145
+ return readSegmentCacheEntryForNavigation;
146
+ },
147
+ resolveStaleAt: function() {
148
+ return resolveStaleAt;
149
+ },
150
+ segmentCacheMap: function() {
151
+ return segmentCacheMap;
144
152
  },
145
153
  stripIsPartialByte: function() {
146
154
  return stripIsPartialByte;
@@ -157,16 +165,18 @@ _export(exports, {
157
165
  writeDynamicRenderResponseIntoCache: function() {
158
166
  return writeDynamicRenderResponseIntoCache;
159
167
  },
168
+ writePrerenderResponseIntoCache: function() {
169
+ return writePrerenderResponseIntoCache;
170
+ },
160
171
  writeRouteIntoCache: function() {
161
172
  return writeRouteIntoCache;
162
- },
163
- writeStaticStageResponseIntoCache: function() {
164
- return writeStaticStageResponseIntoCache;
165
173
  }
166
174
  });
175
+ const _approutertypes = require("../../../shared/lib/app-router-types");
167
176
  const _varyparamsdecoding = require("../../../shared/lib/segment-cache/vary-params-decoding");
168
177
  const _approuterheaders = require("../app-router-headers");
169
178
  const _fetchserverresponse = require("../router-reducer/fetch-server-response");
179
+ const _fetch = require("./fetch");
170
180
  const _scheduler = require("./scheduler");
171
181
  const _varypath = require("./vary-path");
172
182
  const _createhreffromurl = require("../router-reducer/create-href-from-url");
@@ -188,13 +198,6 @@ const _constants = require("../../../lib/constants");
188
198
  function getStaleTimeMs(staleTimeSeconds) {
189
199
  return Math.max(staleTimeSeconds, 30) * 1000;
190
200
  }
191
- var EntryStatus = /*#__PURE__*/ function(EntryStatus) {
192
- EntryStatus[EntryStatus["Empty"] = 0] = "Empty";
193
- EntryStatus[EntryStatus["Pending"] = 1] = "Pending";
194
- EntryStatus[EntryStatus["Fulfilled"] = 2] = "Fulfilled";
195
- EntryStatus[EntryStatus["Rejected"] = 3] = "Rejected";
196
- return EntryStatus;
197
- }({});
198
201
  const isOutputExportMode = process.env.NODE_ENV === 'production' && process.env.__NEXT_CONFIG_OUTPUT === 'export';
199
202
  const MetadataOnlyRequestTree = [
200
203
  '',
@@ -202,8 +205,8 @@ const MetadataOnlyRequestTree = [
202
205
  null,
203
206
  'metadata-only'
204
207
  ];
205
- let routeCacheMap = (0, _cachemap.createCacheMap)();
206
- let segmentCacheMap = (0, _cachemap.createCacheMap)();
208
+ const routeCacheMap = (0, _cachemap.createCacheMap)();
209
+ const segmentCacheMap = (0, _cachemap.createCacheMap)();
207
210
  // All invalidation listeners for the whole cache are tracked in single set.
208
211
  // Since we don't yet support tag or path-based invalidation, there's no point
209
212
  // tracking them any more granularly than this. Once we add granular
@@ -291,24 +294,41 @@ function pingInvalidationListeners(nextUrl, tree) {
291
294
  function readRouteCacheEntry(now, key) {
292
295
  const varyPath = (0, _varypath.getRouteVaryPath)(key.pathname, key.search, key.nextUrl);
293
296
  const isRevalidation = false;
294
- const existingEntry = (0, _cachemap.getFromCacheMap)(now, getCurrentRouteCacheVersion(), routeCacheMap, varyPath, isRevalidation);
297
+ const existingEntry = (0, _cachemap.getFromCacheMap)(now, getCurrentRouteCacheVersion(), routeCacheMap, varyPath, isRevalidation, false);
295
298
  if (existingEntry !== null) {
296
299
  return existingEntry;
297
300
  }
298
301
  // No cache hit. Attempt to construct from template using the new
299
302
  // optimistic routing mechanism (pattern-based matching).
300
303
  if (process.env.__NEXT_OPTIMISTIC_ROUTING) {
301
- return (0, _optimisticroutes.matchKnownRoute)(key.pathname, key.search);
304
+ return (0, _optimisticroutes.matchKnownRoute)(now, key.pathname, key.search);
302
305
  }
303
306
  return null;
304
307
  }
305
- function readSegmentCacheEntry(now, varyPath) {
308
+ function readSegmentCacheEntryForNavigation(now, // The map the navigation is bound to: a locked navigation's driving-task
309
+ // map, or the shared map otherwise.
310
+ map, varyPath, restrictToShell = false) {
306
311
  const isRevalidation = false;
307
- return (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), segmentCacheMap, varyPath, isRevalidation);
312
+ let lookupVaryPath = varyPath;
313
+ if (process.env.__NEXT_EXPOSE_TESTING_API && restrictToShell) {
314
+ // Instant Navigation Testing API: we're navigating to a link that 1) has
315
+ // Partial Prefetching enabled, and 2) does not have a prefetch prop set.
316
+ // Only the shell may render, not anything that varies on concrete route
317
+ // params.
318
+ lookupVaryPath = (0, _varypath.getShellSegmentVaryPath)(varyPath);
319
+ }
320
+ // Prefer a Fulfilled entry (e.g. a cached shell) over a more-specific
321
+ // Pending/Rejected one so it renders immediately instead of blocking on an
322
+ // in-flight entry.
323
+ const fulfilled = (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, lookupVaryPath, isRevalidation, true);
324
+ if (fulfilled !== null) {
325
+ return fulfilled;
326
+ }
327
+ return (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, lookupVaryPath, isRevalidation, false);
308
328
  }
309
- function readRevalidatingSegmentCacheEntry(now, varyPath) {
329
+ function readRevalidatingSegmentCacheEntry(now, map, varyPath) {
310
330
  const isRevalidation = true;
311
- return (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), segmentCacheMap, varyPath, isRevalidation);
331
+ return (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, varyPath, isRevalidation, false);
312
332
  }
313
333
  function waitForSegmentCacheEntry(pendingEntry) {
314
334
  // Because the entry is pending, there's already a in-progress request.
@@ -324,7 +344,7 @@ function waitForSegmentCacheEntry(pendingEntry) {
324
344
  function createDetachedRouteCacheEntry() {
325
345
  return {
326
346
  canonicalUrl: null,
327
- status: 0,
347
+ status: _cachemap.EntryStatus.Empty,
328
348
  blockedTasks: null,
329
349
  tree: null,
330
350
  metadata: null,
@@ -334,6 +354,7 @@ function createDetachedRouteCacheEntry() {
334
354
  couldBeIntercepted: true,
335
355
  // Similarly, we don't yet know if the route supports PPR.
336
356
  supportsPerSegmentPrefetching: false,
357
+ hasDynamicRewrite: false,
337
358
  renderedSearch: null,
338
359
  // Map-related fields
339
360
  ref: null,
@@ -389,7 +410,7 @@ function deprecated_requestOptimisticRouteCacheEntry(now, requestedUrl, nextUrl)
389
410
  const urlWithoutSearchParams = new URL(requestedUrl);
390
411
  urlWithoutSearchParams.search = '';
391
412
  const routeWithNoSearchParams = readRouteCacheEntry(now, (0, _cachekey.createCacheKey)(urlWithoutSearchParams.href, nextUrl));
392
- if (routeWithNoSearchParams === null || routeWithNoSearchParams.status !== 2) {
413
+ if (routeWithNoSearchParams === null || routeWithNoSearchParams.status !== _cachemap.EntryStatus.Fulfilled) {
393
414
  // Bail out of constructing an optimistic route tree. This will result in
394
415
  // a blocking, unprefetched navigation.
395
416
  return null;
@@ -417,7 +438,7 @@ function deprecated_requestOptimisticRouteCacheEntry(now, requestedUrl, nextUrl)
417
438
  // optimistic values.
418
439
  const optimisticEntry = {
419
440
  canonicalUrl: optimisticCanonicalUrl,
420
- status: 2,
441
+ status: _cachemap.EntryStatus.Fulfilled,
421
442
  // This isn't cloned because it's instance-specific
422
443
  blockedTasks: null,
423
444
  tree: optimisticRouteTree,
@@ -443,17 +464,19 @@ function deprecated_createOptimisticRouteTree(tree, newRenderedSearch) {
443
464
  let clonedSlots = null;
444
465
  const originalSlots = tree.slots;
445
466
  if (originalSlots !== null) {
446
- clonedSlots = {};
447
- for(const parallelRouteKey in originalSlots){
448
- const childTree = originalSlots[parallelRouteKey];
449
- clonedSlots[parallelRouteKey] = deprecated_createOptimisticRouteTree(childTree, newRenderedSearch);
467
+ clonedSlots = new Map();
468
+ for (const [parallelRouteKey, childTree] of originalSlots){
469
+ clonedSlots.set(parallelRouteKey, deprecated_createOptimisticRouteTree(childTree, newRenderedSearch));
450
470
  }
451
471
  }
452
472
  // We only need to clone the vary path if the route is a page.
453
473
  if (tree.isPage) {
474
+ // The shell vary path Fallbacks search params, so it's unaffected by the
475
+ // new rendered search and can be reused as-is.
454
476
  return {
455
477
  requestKey: tree.requestKey,
456
478
  segment: tree.segment,
479
+ shellVaryPath: tree.shellVaryPath,
457
480
  refreshState: tree.refreshState,
458
481
  varyPath: (0, _varypath.clonePageVaryPathWithNewSearchParams)(tree.varyPath, newRenderedSearch),
459
482
  isPage: true,
@@ -464,6 +487,7 @@ function deprecated_createOptimisticRouteTree(tree, newRenderedSearch) {
464
487
  return {
465
488
  requestKey: tree.requestKey,
466
489
  segment: tree.segment,
490
+ shellVaryPath: tree.shellVaryPath,
467
491
  refreshState: tree.refreshState,
468
492
  varyPath: tree.varyPath,
469
493
  isPage: false,
@@ -471,21 +495,29 @@ function deprecated_createOptimisticRouteTree(tree, newRenderedSearch) {
471
495
  prefetchHints: tree.prefetchHints
472
496
  };
473
497
  }
474
- function readOrCreateSegmentCacheEntry(now, fetchStrategy, tree) {
475
- const existingEntry = readSegmentCacheEntry(now, tree.varyPath);
498
+ function readOrCreateSegmentCacheEntry(now, // The map the calling task operates in (`PrefetchTask.segmentCacheMap`,
499
+ // captured when the task was scheduled).
500
+ map, fetchStrategy, tree) {
501
+ const existingEntry = (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, tree.varyPath, false, false);
476
502
  if (existingEntry !== null) {
477
503
  return existingEntry;
478
504
  }
479
- // Create a pending entry and add it to the cache. The stale time is set to a
480
- // default value; the actual stale time will be set when the entry is
481
- // fulfilled with data from the server response.
505
+ return insertEmptySegmentCacheEntry(now, map, fetchStrategy, tree);
506
+ }
507
+ /**
508
+ * Creates an empty segment cache entry and inserts it into the cache, keyed
509
+ * at the vary path a request made with the given fetch strategy is stored
510
+ * under. The stale time is set to a default value; the actual stale time will
511
+ * be set when the entry is fulfilled with data from the server response.
512
+ */ function insertEmptySegmentCacheEntry(now, map, fetchStrategy, tree) {
482
513
  const varyPathForRequest = (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
483
- const pendingEntry = createDetachedSegmentCacheEntry(now);
514
+ const emptyEntry = createDetachedSegmentCacheEntry(now);
484
515
  const isRevalidation = false;
485
- (0, _cachemap.setInCacheMap)(segmentCacheMap, varyPathForRequest, pendingEntry, isRevalidation);
486
- return pendingEntry;
516
+ (0, _cachemap.setInCacheMap)(map, varyPathForRequest, emptyEntry, isRevalidation);
517
+ return emptyEntry;
487
518
  }
488
- function readOrCreateRevalidatingSegmentEntry(now, fetchStrategy, tree) {
519
+ function readOrCreateRevalidatingSegmentEntry(now, // The map the calling task operates in (`PrefetchTask.segmentCacheMap`).
520
+ map, fetchStrategy, tree) {
489
521
  // This function is called when we've already confirmed that a particular
490
522
  // segment is cached, but we want to perform another request anyway in case it
491
523
  // returns more complete and/or fresher data than we already have. The logic
@@ -512,7 +544,7 @@ function readOrCreateRevalidatingSegmentEntry(now, fetchStrategy, tree) {
512
544
  // return a less generic entry upon revalidation. For now, though, this isn't
513
545
  // a concern because the keypath is based solely on the prefetch strategy,
514
546
  // not on data contained in the response.
515
- const existingEntry = readRevalidatingSegmentCacheEntry(now, tree.varyPath);
547
+ const existingEntry = readRevalidatingSegmentCacheEntry(now, map, tree.varyPath);
516
548
  if (existingEntry !== null) {
517
549
  return existingEntry;
518
550
  }
@@ -522,10 +554,11 @@ function readOrCreateRevalidatingSegmentEntry(now, fetchStrategy, tree) {
522
554
  const varyPathForRequest = (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
523
555
  const pendingEntry = createDetachedSegmentCacheEntry(now);
524
556
  const isRevalidation = true;
525
- (0, _cachemap.setInCacheMap)(segmentCacheMap, varyPathForRequest, pendingEntry, isRevalidation);
557
+ (0, _cachemap.setInCacheMap)(map, varyPathForRequest, pendingEntry, isRevalidation);
526
558
  return pendingEntry;
527
559
  }
528
- function overwriteRevalidatingSegmentCacheEntry(now, fetchStrategy, tree) {
560
+ function overwriteRevalidatingSegmentCacheEntry(now, // The map the calling task operates in (`PrefetchTask.segmentCacheMap`).
561
+ map, fetchStrategy, tree) {
529
562
  // This function is called when we've already decided to replace an existing
530
563
  // revalidation entry. Create a new entry and write it into the cache,
531
564
  // overwriting the previous value. The stale time is set to a default value;
@@ -534,10 +567,42 @@ function overwriteRevalidatingSegmentCacheEntry(now, fetchStrategy, tree) {
534
567
  const varyPathForRequest = (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
535
568
  const pendingEntry = createDetachedSegmentCacheEntry(now);
536
569
  const isRevalidation = true;
537
- (0, _cachemap.setInCacheMap)(segmentCacheMap, varyPathForRequest, pendingEntry, isRevalidation);
570
+ (0, _cachemap.setInCacheMap)(map, varyPathForRequest, pendingEntry, isRevalidation);
538
571
  return pendingEntry;
539
572
  }
540
- function upsertSegmentEntry(now, varyPath, candidateEntry) {
573
+ /**
574
+ * Whether an existing cache entry is preferred over an incoming candidate —
575
+ * i.e. the candidate does NOT supersede it. (On an exact tie — same fetch
576
+ * strategy, same partialness — this returns false, so the candidate replaces
577
+ * the existing entry.) This is the precedence rule used both when deciding
578
+ * whether an upsert may replace the entry at its own keypath, and when
579
+ * deciding whether an entry at a more specific keypath may be evicted because
580
+ * it shadows a just-inserted candidate (see `evictShadowingSegmentEntries`).
581
+ *
582
+ * Note that "less/more specific" in the comments below refers to fetch
583
+ * strategy content tiers (how much content a strategy can produce), not the
584
+ * vary-path specificity the eviction docs are concerned with.
585
+ */ function isExistingSegmentEntryPreferred(existingEntry, candidateEntry) {
586
+ return(// We fetched the new segment using a different, less specific fetch
587
+ // strategy than the segment we already have in the cache, so it can't
588
+ // have more content.
589
+ candidateEntry.fetchStrategy !== existingEntry.fetchStrategy && !canNewFetchStrategyProvideMoreContent(existingEntry.fetchStrategy, candidateEntry.fetchStrategy) || // The existing entry isn't partial, but the new one is.
590
+ // (TODO: can this be true if `candidateEntry.fetchStrategy >= existingEntry.fetchStrategy`?)
591
+ !existingEntry.isPartial && candidateEntry.isPartial);
592
+ }
593
+ function upsertSegmentEntry(now, // The map the whole upsert (existing-entry read, insert, shadow eviction)
594
+ // operates in. Prefetch response-write paths pass the spawning task's map
595
+ // (`PrefetchTask.segmentCacheMap`), so a response that lands after a
596
+ // testing-lock scope boundary still writes into the map its entries
597
+ // live in.
598
+ map, varyPath, candidateEntry, // The fully concrete vary path a read for this segment position resolves
599
+ // against (all concrete param values, i.e. `tree.varyPath`) — the most
600
+ // specific path a read would use. Note this is the opposite of the
601
+ // generalized keying path that `getSegmentVaryPathForRequest` computes.
602
+ // Used to detect and evict stale entries at more specific keypaths that
603
+ // would otherwise shadow the candidate. Pass null when there's no request
604
+ // context; the shadow check is skipped.
605
+ lookupVaryPath) {
541
606
  // We have a new entry that has not yet been inserted into the cache. Before
542
607
  // we do so, we need to confirm whether it takes precedence over the existing
543
608
  // entry (if one exists).
@@ -548,44 +613,137 @@ function upsertSegmentEntry(now, varyPath, candidateEntry) {
548
613
  // The entry is expired. We cannot upsert it.
549
614
  return null;
550
615
  }
551
- const existingEntry = readSegmentCacheEntry(now, varyPath);
616
+ const existingEntry = (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, varyPath, false, false);
552
617
  if (existingEntry !== null) {
553
618
  // Don't replace a more specific segment with a less-specific one. A case where this
554
619
  // might happen is if the existing segment was fetched via
555
620
  // `<Link prefetch={true}>`.
556
- if (// We fetched the new segment using a different, less specific fetch strategy
557
- // than the segment we already have in the cache, so it can't have more content.
558
- candidateEntry.fetchStrategy !== existingEntry.fetchStrategy && !canNewFetchStrategyProvideMoreContent(existingEntry.fetchStrategy, candidateEntry.fetchStrategy) || // The existing entry isn't partial, but the new one is.
559
- // (TODO: can this be true if `candidateEntry.fetchStrategy >= existingEntry.fetchStrategy`?)
560
- !existingEntry.isPartial && candidateEntry.isPartial) {
561
- // We're going to leave revalidating entry in the cache so that it doesn't
562
- // get revalidated again unnecessarily. Downgrade the Fulfilled entry to
563
- // Rejected and null out the data so it can be garbage collected. We leave
564
- // `staleAt` intact to prevent subsequent revalidation attempts only until
565
- // the entry expires.
566
- const rejectedEntry = candidateEntry;
567
- rejectedEntry.status = 3;
568
- rejectedEntry.rsc = null;
621
+ if (isExistingSegmentEntryPreferred(existingEntry, candidateEntry)) {
622
+ // The candidate does not supersede the existing entry. Leave the
623
+ // existing entry in place and discard the candidate by not inserting it.
624
+ //
625
+ // We must not mutate the candidate here (e.g. downgrade it to Rejected or
626
+ // null out its `rsc`). The caller does not transfer exclusive ownership
627
+ // of it: it may already have been fulfilled, resolving its promise to a
628
+ // waiter that holds the entry and reads `rsc` off it later. A navigation
629
+ // seed is such a waiter, via `waitForSegmentCacheEntry`. Nulling `rsc`
630
+ // after the fact resolves that read to `null`, so the waiter loses the
631
+ // data it was about to render. Declining to insert it is enough: the
632
+ // existing entry stays canonical, and the candidate keeps its valid (if
633
+ // less complete) data for any waiter that already took it.
569
634
  return null;
570
635
  }
571
- // Evict the existing entry from the cache.
572
- (0, _cachemap.deleteFromCacheMap)(existingEntry);
636
+ // Ping any tasks blocked on the existing entry before replacing it so they
637
+ // re-run and pick up the new entry. Without this, tasks waiting on the
638
+ // existing Empty/Pending entry would be stranded — the new fulfilled
639
+ // candidate has no blockedTasks of its own.
640
+ if (existingEntry.status === _cachemap.EntryStatus.Empty || existingEntry.status === _cachemap.EntryStatus.Pending) {
641
+ pingBlockedTasks(existingEntry);
642
+ }
643
+ // Replace the existing entry by writing the candidate over its keypath
644
+ // below (the same mechanism `overwriteRevalidatingSegmentCacheEntry`
645
+ // uses). We intentionally do NOT call `deleteFromCacheMap` first: deleting
646
+ // vacates the canonical slot, and `deleteMapEntry` promotes a pending
647
+ // Revalidation-slot entry into the vacated slot — which the immediate
648
+ // insert below would then silently overwrite. The in-flight revalidation
649
+ // would vanish from the map, so the next scheduler pass would find an
650
+ // empty revalidation slot and spawn a duplicate request instead of
651
+ // deduping against it. Replacing in place never vacates the slot, so
652
+ // promotion never runs and the pending revalidating entry stays in its
653
+ // Revalidation slot where `readOrCreateRevalidatingSegmentEntry`'s dedupe
654
+ // finds it.
655
+ //
656
+ // The displaced entry's map/LRU accounting is handled by the replacement
657
+ // itself: `setMapEntryValue` drops the displaced value's `ref` and
658
+ // `updateLruSize` swaps its size for the candidate's, which is exactly
659
+ // what delete-then-insert did.
573
660
  }
574
661
  const isRevalidation = false;
575
- (0, _cachemap.setInCacheMap)(segmentCacheMap, varyPath, candidateEntry, isRevalidation);
662
+ (0, _cachemap.setInCacheMap)(map, varyPath, candidateEntry, isRevalidation);
663
+ if (lookupVaryPath !== null) {
664
+ evictShadowingSegmentEntries(now, map, lookupVaryPath, candidateEntry);
665
+ }
576
666
  return candidateEntry;
577
667
  }
668
+ /**
669
+ * Evicts stale entries at more specific keypaths that shadow a just-inserted
670
+ * candidate entry.
671
+ *
672
+ * A response can be written to the cache at a MORE GENERIC vary path than the
673
+ * path the request was issued against — for example, the server may report
674
+ * that a segment doesn't vary on a param, so the entry is re-keyed with that
675
+ * param as Fallback. Meanwhile, an older, less useful entry can exist at a
676
+ * more specific path within the same fallback chain — for example, a partial
677
+ * shell entry keyed with root params concrete (see
678
+ * `getShellSegmentVaryPath`). Because segment lookup is
679
+ * most-specific-match-wins, every subsequent read at the concrete request
680
+ * path keeps returning the stale specific entry, and the more complete
681
+ * generic entry is unreachable from that URL. That both wastes the completed
682
+ * request and can loop: a prefetch task that revalidated the segment reads
683
+ * back the same stale entry, decides it needs to revalidate again, and
684
+ * repeats forever.
685
+ *
686
+ * The upsert is the one moment we know the ordering between the two entries:
687
+ * the candidate was produced by a request for this segment position, and
688
+ * `lookupVaryPath` is the fully concrete path a read for that position
689
+ * resolves against, so any entry that a read at that path would return in the
690
+ * candidate's stead is directly comparable to it. If such an entry is settled
691
+ * and the candidate supersedes it — under the same precedence rules the
692
+ * upsert applies at its own keypath — we know we never want to match against
693
+ * it again, so delete it, making the candidate reachable.
694
+ *
695
+ * Non-settled entries are never evicted here: a Pending entry is owned by an
696
+ * in-flight request that will settle it, and an Empty entry is a placeholder
697
+ * that a scheduler pass may still claim and upgrade.
698
+ */ function evictShadowingSegmentEntries(now, map, lookupVaryPath, candidateEntry) {
699
+ // There can in principle be multiple shadowing entries at successively less
700
+ // specific keypaths, so loop until the read returns the candidate (or an
701
+ // entry we don't supersede). Each iteration re-reads and re-checks from
702
+ // scratch (in part because `deleteFromCacheMap` can promote a settled
703
+ // Revalidation-slot value into the just-vacated slot, surfacing a new entry
704
+ // at the same keypath). Each iteration deletes an entry from the map, so
705
+ // the loop terminates naturally; the bound is defensive, and 32 is far
706
+ // beyond any real fallback chain, which is bounded by the vary
707
+ // path's length.
708
+ for(let i = 0; i < 32; i++){
709
+ const shadowEntry = (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, lookupVaryPath, false, false);
710
+ if (shadowEntry === null || shadowEntry === candidateEntry) {
711
+ // The candidate is reachable from the lookup path (or the read missed
712
+ // entirely, e.g. because the candidate expired). Done.
713
+ return;
714
+ }
715
+ if (shadowEntry.status !== _cachemap.EntryStatus.Fulfilled && shadowEntry.status !== _cachemap.EntryStatus.Rejected) {
716
+ // Only settled entries may be evicted. A Pending entry is held by an
717
+ // in-flight request and will settle on its own.
718
+ return;
719
+ }
720
+ if (isExistingSegmentEntryPreferred(shadowEntry, candidateEntry)) {
721
+ // The shadowing entry is preferred over the candidate (e.g. it's a
722
+ // complete entry fetched with a more specific strategy). Leave it —
723
+ // reads at this path should keep matching it.
724
+ return;
725
+ }
726
+ // The candidate supersedes the shadowing entry. Evict it. Settled entries
727
+ // shouldn't have blocked tasks (Fulfilled always has `blockedTasks:
728
+ // null`, and Rejected entries were pinged at rejection), but ping
729
+ // defensively before deleting, matching the upsert-evict pattern above.
730
+ pingBlockedTasks(shadowEntry);
731
+ (0, _cachemap.deleteFromCacheMap)(shadowEntry);
732
+ }
733
+ }
578
734
  function createDetachedSegmentCacheEntry(now) {
579
735
  // Default stale time for pending segment cache entries. The actual stale time
580
736
  // is set when the entry is fulfilled with data from the server response.
581
737
  const staleAt = now + 30 * 1000;
582
738
  const emptyEntry = {
583
- status: 0,
739
+ status: _cachemap.EntryStatus.Empty,
740
+ blockedTasks: null,
584
741
  // Default to assuming the fetch strategy will be PPR. This will be updated
585
742
  // when a fetch is actually initiated.
586
743
  fetchStrategy: _types.FetchStrategy.PPR,
587
744
  rsc: null,
588
745
  isPartial: true,
746
+ isUpgradeableISRFallback: false,
589
747
  promise: null,
590
748
  // Map-related fields
591
749
  ref: null,
@@ -597,7 +755,7 @@ function createDetachedSegmentCacheEntry(now) {
597
755
  }
598
756
  function upgradeToPendingSegment(emptyEntry, fetchStrategy) {
599
757
  const pendingEntry = emptyEntry;
600
- pendingEntry.status = 1;
758
+ pendingEntry.status = _cachemap.EntryStatus.Pending;
601
759
  pendingEntry.fetchStrategy = fetchStrategy;
602
760
  if (fetchStrategy === _types.FetchStrategy.Full) {
603
761
  // We can assume the response will contain the full segment data. Set this
@@ -637,11 +795,13 @@ function attemptToFulfillDynamicSegmentFromBFCache(now, segment, tree) {
637
795
  }
638
796
  const pendingSegment = upgradeToPendingSegment(segment, _types.FetchStrategy.Full);
639
797
  const isPartial = false;
640
- return fulfillSegmentCacheEntry(pendingSegment, bfcacheEntry.rsc, dynamicPrefetchStaleAt, isPartial);
798
+ return fulfillSegmentCacheEntry(pendingSegment, bfcacheEntry.rsc, dynamicPrefetchStaleAt, isPartial, // bfcache data is concrete, never an ISR fallback.
799
+ false, _types.FetchStrategy.Full);
641
800
  }
642
801
  return null;
643
802
  }
644
- function attemptToUpgradeSegmentFromBFCache(now, tree) {
803
+ function attemptToUpgradeSegmentFromBFCache(now, // The map the calling task operates in (`PrefetchTask.segmentCacheMap`).
804
+ map, tree) {
645
805
  const varyPath = tree.varyPath;
646
806
  const bfcacheEntry = (0, _bfcache.readFromBFCache)(varyPath);
647
807
  if (bfcacheEntry !== null) {
@@ -651,10 +811,14 @@ function attemptToUpgradeSegmentFromBFCache(now, tree) {
651
811
  }
652
812
  const pendingSegment = upgradeToPendingSegment(createDetachedSegmentCacheEntry(now), _types.FetchStrategy.Full);
653
813
  const isPartial = false;
654
- const newEntry = fulfillSegmentCacheEntry(pendingSegment, bfcacheEntry.rsc, dynamicPrefetchStaleAt, isPartial);
814
+ const newEntry = fulfillSegmentCacheEntry(pendingSegment, bfcacheEntry.rsc, dynamicPrefetchStaleAt, isPartial, // bfcache data is concrete, never an ISR fallback.
815
+ false, _types.FetchStrategy.Full);
655
816
  const segmentVaryPath = (0, _varypath.getSegmentVaryPathForRequest)(_types.FetchStrategy.Full, tree);
656
- const upserted = upsertSegmentEntry(now, segmentVaryPath, newEntry);
657
- if (upserted !== null && upserted.status === 2) {
817
+ const upserted = upsertSegmentEntry(now, map, segmentVaryPath, newEntry, // The concrete lookup path this BFCache upgrade applies to. (In
818
+ // practice a Full request path is already fully concrete, so nothing
819
+ // can shadow the new entry and the shadow check is a no-op.)
820
+ tree.varyPath);
821
+ if (upserted !== null && upserted.status === _cachemap.EntryStatus.Fulfilled) {
658
822
  return upserted;
659
823
  }
660
824
  }
@@ -677,6 +841,7 @@ function createMetadataRouteTree(metadataVaryPath) {
677
841
  const metadata = {
678
842
  requestKey: _segmentvalueencoding.HEAD_REQUEST_KEY,
679
843
  segment: _segmentvalueencoding.HEAD_REQUEST_KEY,
844
+ shellVaryPath: (0, _varypath.getShellSegmentVaryPath)(metadataVaryPath),
680
845
  refreshState: null,
681
846
  varyPath: metadataVaryPath,
682
847
  // The metadata isn't really a "page" (though it isn't really a "segment"
@@ -692,14 +857,24 @@ function fulfillRouteCacheEntry(now, entry, tree, metadataVaryPath, couldBeInter
692
857
  // Get the rendered search from the vary path
693
858
  const renderedSearch = (0, _varypath.getRenderedSearchFromVaryPath)(metadataVaryPath) ?? '';
694
859
  const fulfilledEntry = entry;
695
- fulfilledEntry.status = 2;
860
+ fulfilledEntry.status = _cachemap.EntryStatus.Fulfilled;
696
861
  fulfilledEntry.tree = tree;
697
862
  fulfilledEntry.metadata = createMetadataRouteTree(metadataVaryPath);
698
863
  // Route structure is essentially static — it only changes on deploy.
699
864
  // Always use the static stale time.
700
865
  // NOTE: An exception is rewrites/redirects in middleware or proxy, which can
701
866
  // change routes dynamically. We have other strategies for handling those.
702
- fulfilledEntry.staleAt = now + _navigatereducer.STATIC_STALETIME_MS;
867
+ //
868
+ // If the route tree has stale inlining hints (e.g. the initial RSC payload
869
+ // for a build-time static page, generated before collectPrefetchHints ran),
870
+ // immediately expire the entry so it gets re-fetched with correct hints.
871
+ // The segment data itself is still valid — only the route tree (which
872
+ // contains the hint bits) needs to be re-fetched.
873
+ if (tree.prefetchHints & _approutertypes.PrefetchHint.InliningHintsStale) {
874
+ fulfilledEntry.staleAt = -1;
875
+ } else {
876
+ fulfilledEntry.staleAt = now + _navigatereducer.STATIC_STALETIME_MS;
877
+ }
703
878
  fulfilledEntry.couldBeIntercepted = couldBeIntercepted;
704
879
  fulfilledEntry.canonicalUrl = canonicalUrl;
705
880
  fulfilledEntry.renderedSearch = renderedSearch;
@@ -708,11 +883,10 @@ function fulfillRouteCacheEntry(now, entry, tree, metadataVaryPath, couldBeInter
708
883
  pingBlockedTasks(entry);
709
884
  return fulfilledEntry;
710
885
  }
711
- function writeRouteIntoCache(now, pathname, nextUrl, tree, metadataVaryPath, couldBeIntercepted, canonicalUrl, supportsPerSegmentPrefetching) {
886
+ function writeRouteIntoCache(now, pathname, search, nextUrl, tree, metadataVaryPath, couldBeIntercepted, canonicalUrl, supportsPerSegmentPrefetching) {
712
887
  const pendingEntry = createDetachedRouteCacheEntry();
713
888
  const fulfilledEntry = fulfillRouteCacheEntry(now, pendingEntry, tree, metadataVaryPath, couldBeIntercepted, canonicalUrl, supportsPerSegmentPrefetching);
714
- const renderedSearch = fulfilledEntry.renderedSearch;
715
- const varyPath = (0, _varypath.getFulfilledRouteVaryPath)(pathname, renderedSearch, nextUrl, couldBeIntercepted);
889
+ const varyPath = (0, _varypath.getFulfilledRouteVaryPath)(pathname, search, nextUrl, couldBeIntercepted);
716
890
  const isRevalidation = false;
717
891
  (0, _cachemap.setInCacheMap)(routeCacheMap, varyPath, fulfilledEntry, isRevalidation);
718
892
  return fulfilledEntry;
@@ -723,29 +897,46 @@ function markRouteEntryAsDynamicRewrite(entry) {
723
897
  // to invalidate other entries that may have been derived from this template
724
898
  // before we knew it had a dynamic rewrite.
725
899
  }
726
- function fulfillSegmentCacheEntry(segmentCacheEntry, rsc, staleAt, isPartial) {
900
+ function fulfillSegmentCacheEntry(segmentCacheEntry, rsc, staleAt, isPartial, // Only static (per-segment PPR) responses can be ISR fallbacks; all other
901
+ // callers pass false. Always assigned (even when false) so that re-fulfilling
902
+ // a previously-fallback entry with a concrete response clears the flag and
903
+ // ends the retry loop.
904
+ isUpgradeableISRFallback, // The strategy tier describing the CONTENT this entry is fulfilled with —
905
+ // which comes from the response, not the tier the entry was requested at.
906
+ // Usually the two agree, but when a response's shell payload IS the full
907
+ // response (no shell/full split), shell-spawned entries are fulfilled with
908
+ // full-tier content and recorded as such (see the promotion in
909
+ // writeSegmentBundleResponse). Always assigned, replacing
910
+ // the spawn-time strategy set by upgradeToPendingSegment; the write walks'
911
+ // matching and keying decisions all happen against the spawn-time
912
+ // strategy, before fulfillment, so they are unaffected. See
913
+ // SegmentCacheEntryShared['fetchStrategy'].
914
+ fetchStrategy) {
727
915
  const fulfilledEntry = segmentCacheEntry;
728
- fulfilledEntry.status = 2;
916
+ fulfilledEntry.status = _cachemap.EntryStatus.Fulfilled;
729
917
  fulfilledEntry.rsc = rsc;
730
918
  fulfilledEntry.staleAt = staleAt;
731
919
  fulfilledEntry.isPartial = isPartial;
920
+ fulfilledEntry.isUpgradeableISRFallback = isUpgradeableISRFallback;
921
+ fulfilledEntry.fetchStrategy = fetchStrategy;
732
922
  // Resolve any listeners that were waiting for this data.
733
923
  if (segmentCacheEntry.promise !== null) {
734
924
  segmentCacheEntry.promise.resolve(fulfilledEntry);
735
925
  // Free the promise for garbage collection.
736
926
  fulfilledEntry.promise = null;
737
927
  }
928
+ pingBlockedTasks(segmentCacheEntry);
738
929
  return fulfilledEntry;
739
930
  }
740
931
  function rejectRouteCacheEntry(entry, staleAt) {
741
932
  const rejectedEntry = entry;
742
- rejectedEntry.status = 3;
933
+ rejectedEntry.status = _cachemap.EntryStatus.Rejected;
743
934
  rejectedEntry.staleAt = staleAt;
744
935
  pingBlockedTasks(entry);
745
936
  }
746
937
  function rejectSegmentCacheEntry(entry, staleAt) {
747
938
  const rejectedEntry = entry;
748
- rejectedEntry.status = 3;
939
+ rejectedEntry.status = _cachemap.EntryStatus.Rejected;
749
940
  rejectedEntry.staleAt = staleAt;
750
941
  if (entry.promise !== null) {
751
942
  // NOTE: We don't currently propagate the reason the prefetch was canceled
@@ -753,10 +944,11 @@ function rejectSegmentCacheEntry(entry, staleAt) {
753
944
  entry.promise.resolve(null);
754
945
  entry.promise = null;
755
946
  }
947
+ pingBlockedTasks(entry);
756
948
  }
757
949
  function convertRootTreePrefetchToRouteTree(rootTree, renderedPathname, renderedSearch, acc) {
758
950
  // Remove trailing and leading slashes
759
- const pathnameParts = renderedPathname.split('/').filter((p)=>p !== '');
951
+ const pathnameParts = (0, _cachekey.splitPathnameIntoParts)(renderedPathname);
760
952
  const index = 0;
761
953
  const rootSegment = _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY;
762
954
  return convertTreePrefetchToRouteTree(rootTree.tree, rootSegment, null, _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY, pathnameParts, index, renderedSearch, acc);
@@ -774,7 +966,7 @@ function convertTreePrefetchToRouteTree(prefetch, segment, partialVaryPath, requ
774
966
  if (prefetchSlots !== null) {
775
967
  isPage = false;
776
968
  varyPath = (0, _varypath.finalizeLayoutVaryPath)(requestKey, partialVaryPath);
777
- slots = {};
969
+ slots = new Map();
778
970
  for(let parallelRouteKey in prefetchSlots){
779
971
  const childPrefetch = prefetchSlots[parallelRouteKey];
780
972
  const childSegmentName = childPrefetch.name;
@@ -797,7 +989,9 @@ function convertTreePrefetchToRouteTree(prefetch, segment, partialVaryPath, requ
797
989
  const childParamKey = // The server omits this field from the prefetch response when
798
990
  // cacheComponents is enabled.
799
991
  childParam.key !== null ? childParam.key : (0, _routeparams.getCacheKeyForDynamicParam)(childParamValue, '');
800
- childPartialVaryPath = (0, _varypath.appendLayoutVaryPath)(partialVaryPath, childParamKey, childSegmentName);
992
+ childPartialVaryPath = (0, _varypath.appendLayoutVaryPath)(partialVaryPath, childParamKey, childSegmentName, // The child's param is a root param iff the child segment is at or
993
+ // above the root layout, which the server marks directly.
994
+ (childPrefetch.prefetchHints & _approutertypes.PrefetchHint.IsRootLayoutOrAbove) !== 0);
801
995
  childSegment = [
802
996
  childSegmentName,
803
997
  childParamKey,
@@ -817,7 +1011,7 @@ function convertTreePrefetchToRouteTree(prefetch, segment, partialVaryPath, requ
817
1011
  const childPathnamePartsIndex = childDoesAppearInURL ? pathnamePartsIndex + 1 : pathnamePartsIndex;
818
1012
  const childRequestKeyPart = (0, _segmentvalueencoding.createSegmentRequestKeyPart)(childSegment);
819
1013
  const childRequestKey = (0, _segmentvalueencoding.appendSegmentRequestKeyPart)(requestKey, parallelRouteKey, childRequestKeyPart);
820
- slots[parallelRouteKey] = convertTreePrefetchToRouteTree(childPrefetch, childSegment, childPartialVaryPath, childRequestKey, pathnameParts, childPathnamePartsIndex, renderedSearch, acc);
1014
+ slots.set(parallelRouteKey, convertTreePrefetchToRouteTree(childPrefetch, childSegment, childPartialVaryPath, childRequestKey, pathnameParts, childPathnamePartsIndex, renderedSearch, acc));
821
1015
  }
822
1016
  } else {
823
1017
  if (requestKey.endsWith(_segment.PAGE_SEGMENT_KEY)) {
@@ -842,6 +1036,7 @@ function convertTreePrefetchToRouteTree(prefetch, segment, partialVaryPath, requ
842
1036
  return {
843
1037
  requestKey,
844
1038
  segment,
1039
+ shellVaryPath: (0, _varypath.getShellSegmentVaryPath)(varyPath),
845
1040
  refreshState: null,
846
1041
  // TODO: Cheating the type system here a bit because TypeScript can't tell
847
1042
  // that the type of isPage and varyPath are consistent. The fix would be to
@@ -874,6 +1069,9 @@ function convertReusedFlightRouterStateToRouteTree(parentRouteTree, parallelRout
874
1069
  }
875
1070
  function convertFlightRouterStateToRouteTree(flightRouterState, requestKey, parentPartialVaryPath, parentRenderedSearch, acc) {
876
1071
  const originalSegment = flightRouterState[0];
1072
+ // This segment's param (if any) is a root param iff the segment is at or
1073
+ // above the root layout, which the server marks directly.
1074
+ const isRootParam = ((flightRouterState[4] ?? 0) & _approutertypes.PrefetchHint.IsRootLayoutOrAbove) !== 0;
877
1075
  // If the FlightRouterState has a refresh state, then this segment is part of
878
1076
  // an inactive parallel route. It has a different rendered search query than
879
1077
  // the outer parent route. In order to construct the inactive route correctly,
@@ -892,7 +1090,7 @@ function convertFlightRouterStateToRouteTree(flightRouterState, requestKey, pare
892
1090
  isPage = false;
893
1091
  const paramCacheKey = originalSegment[1];
894
1092
  const paramName = originalSegment[0];
895
- partialVaryPath = (0, _varypath.appendLayoutVaryPath)(parentPartialVaryPath, paramCacheKey, paramName);
1093
+ partialVaryPath = (0, _varypath.appendLayoutVaryPath)(parentPartialVaryPath, paramCacheKey, paramName, isRootParam);
896
1094
  varyPath = (0, _varypath.finalizeLayoutVaryPath)(requestKey, partialVaryPath);
897
1095
  segment = originalSegment;
898
1096
  } else {
@@ -941,16 +1139,14 @@ function convertFlightRouterStateToRouteTree(flightRouterState, requestKey, pare
941
1139
  const childRequestKey = (0, _segmentvalueencoding.appendSegmentRequestKeyPart)(requestKey, parallelRouteKey, childRequestKeyPart);
942
1140
  const childTree = convertFlightRouterStateToRouteTree(childRouterState, childRequestKey, partialVaryPath, renderedSearch, acc);
943
1141
  if (slots === null) {
944
- slots = {
945
- [parallelRouteKey]: childTree
946
- };
947
- } else {
948
- slots[parallelRouteKey] = childTree;
1142
+ slots = new Map();
949
1143
  }
1144
+ slots.set(parallelRouteKey, childTree);
950
1145
  }
951
1146
  return {
952
1147
  requestKey,
953
1148
  segment,
1149
+ shellVaryPath: (0, _varypath.getShellSegmentVaryPath)(varyPath),
954
1150
  refreshState,
955
1151
  // TODO: Cheating the type system here a bit because TypeScript can't tell
956
1152
  // that the type of isPage and varyPath are consistent. The fix would be to
@@ -966,9 +1162,10 @@ function convertFlightRouterStateToRouteTree(flightRouterState, requestKey, pare
966
1162
  }
967
1163
  function convertRouteTreeToFlightRouterState(routeTree) {
968
1164
  const parallelRoutes = {};
969
- if (routeTree.slots !== null) {
970
- for(const parallelRouteKey in routeTree.slots){
971
- parallelRoutes[parallelRouteKey] = convertRouteTreeToFlightRouterState(routeTree.slots[parallelRouteKey]);
1165
+ const slots = routeTree.slots;
1166
+ if (slots !== null) {
1167
+ for (const [parallelRouteKey, childTree] of slots){
1168
+ parallelRoutes[parallelRouteKey] = convertRouteTreeToFlightRouterState(childTree);
972
1169
  }
973
1170
  }
974
1171
  const flightRouterState = [
@@ -977,9 +1174,14 @@ function convertRouteTreeToFlightRouterState(routeTree) {
977
1174
  null,
978
1175
  null
979
1176
  ];
1177
+ if (routeTree.prefetchHints !== 0) {
1178
+ flightRouterState[4] = routeTree.prefetchHints;
1179
+ }
980
1180
  return flightRouterState;
981
1181
  }
982
- async function fetchRouteOnCacheMiss(entry, key) {
1182
+ async function fetchRouteOnCacheMiss(entry, key, // The spawning task's `PrefetchTask.segmentCacheMap`, for the legacy
1183
+ // branch that writes segment data included in the tree response.
1184
+ map) {
983
1185
  // This function is allowed to use async/await because it contains the actual
984
1186
  // fetch that gets issued on a cache miss. Notice it writes the result to the
985
1187
  // cache entry directly, rather than return data that is then written by
@@ -996,9 +1198,6 @@ async function fetchRouteOnCacheMiss(entry, key) {
996
1198
  if (nextUrl !== null) {
997
1199
  headers[_approuterheaders.NEXT_URL] = nextUrl;
998
1200
  }
999
- // Tell the server to perform a static pre-render for the Instant Navigation
1000
- // Testing API. Static pre-renders don't normally happen during development.
1001
- addInstantPrefetchHeaderIfLocked(headers);
1002
1201
  try {
1003
1202
  const url = new URL(pathname + search, location.origin);
1004
1203
  let response;
@@ -1039,7 +1238,7 @@ async function fetchRouteOnCacheMiss(entry, key) {
1039
1238
  // NOTE: We could embed the route tree into the HTML document, to avoid
1040
1239
  // a second request. We're not doing that currently because it would make
1041
1240
  // the HTML document larger and affect normal page loads.
1042
- const headResponse = await fetch(url, {
1241
+ const headResponse = await (0, _fetch.fetch)(url, {
1043
1242
  method: 'HEAD'
1044
1243
  });
1045
1244
  if (headResponse.status < 200 || headResponse.status >= 400) {
@@ -1061,10 +1260,7 @@ async function fetchRouteOnCacheMiss(entry, key) {
1061
1260
  response = await fetchPrefetchResponse(url, headers);
1062
1261
  urlAfterRedirects = response !== null && response.redirected ? new URL(response.url) : url;
1063
1262
  }
1064
- if (!response || !response.ok || // 204 is a Cache miss. Though theoretically this shouldn't happen when
1065
- // PPR is enabled, because we always respond to route tree requests, even
1066
- // if it needs to be blockingly generated on demand.
1067
- response.status === 204 || !response.body) {
1263
+ if (!response || !response.ok || !response.body) {
1068
1264
  // Server responded with an error, or with a miss. We should still cache
1069
1265
  // the response, but we can try again after 10 seconds.
1070
1266
  rejectRouteCacheEntry(entry, Date.now() + 10 * 1000);
@@ -1127,7 +1323,8 @@ async function fetchRouteOnCacheMiss(entry, key) {
1127
1323
  // During this traversal, we accumulate additional data into this
1128
1324
  // "accumulator" object.
1129
1325
  const acc = {
1130
- metadataVaryPath: null
1326
+ metadataVaryPath: null,
1327
+ treeDivergedFromBase: false
1131
1328
  };
1132
1329
  const routeTree = convertRootTreePrefetchToRouteTree(serverData, renderedPathname, renderedSearch, acc);
1133
1330
  const metadataVaryPath = acc.metadataVaryPath;
@@ -1135,7 +1332,7 @@ async function fetchRouteOnCacheMiss(entry, key) {
1135
1332
  rejectRouteCacheEntry(entry, Date.now() + 10 * 1000);
1136
1333
  return null;
1137
1334
  }
1138
- (0, _optimisticroutes.discoverKnownRoute)(Date.now(), pathname, nextUrl, entry, routeTree, metadataVaryPath, couldBeIntercepted, canonicalUrl, routeIsPPREnabled, false // hasDynamicRewrite
1335
+ (0, _optimisticroutes.discoverKnownRoute)(Date.now(), pathname, search, nextUrl, entry, routeTree, metadataVaryPath, couldBeIntercepted, canonicalUrl, routeIsPPREnabled, false // hasDynamicRewrite
1139
1336
  );
1140
1337
  } else {
1141
1338
  // PPR is not enabled for this route. The server responds with a
@@ -1156,13 +1353,14 @@ async function fetchRouteOnCacheMiss(entry, key) {
1156
1353
  rejectRouteCacheEntry(entry, Date.now() + 10 * 1000);
1157
1354
  return null;
1158
1355
  }
1159
- // Read head vary params synchronously. Individual segments carry their
1160
- // own thenables in CacheNodeSeedData.
1161
- const headVaryParamsThenable = serverData.h;
1162
- const headVaryParams = headVaryParamsThenable !== null ? (0, _varyparamsdecoding.readVaryParams)(headVaryParamsThenable) : null;
1356
+ // Read head vary params synchronously (unioning in the response-level
1357
+ // root params). Individual segments carry their own iterables in
1358
+ // CacheNodeSeedData; the root iterable is threaded down so each segment
1359
+ // unions it too.
1360
+ const headVaryParams = (0, _varyparamsdecoding.readVaryParams)(serverData.h, serverData.r);
1163
1361
  writeDynamicTreeResponseIntoCache(Date.now(), // The non-PPR response format is what we'd get if we prefetched these segments
1164
1362
  // using the LoadingBoundary fetch strategy, so mark their cache entries accordingly.
1165
- _types.FetchStrategy.LoadingBoundary, response, serverData, entry, couldBeIntercepted, canonicalUrl, routeIsPPREnabled, headVaryParams, pathname, nextUrl);
1363
+ _types.FetchStrategy.LoadingBoundary, response, serverData, entry, couldBeIntercepted, canonicalUrl, routeIsPPREnabled, headVaryParams, serverData.r ?? null, pathname, search, nextUrl, map);
1166
1364
  }
1167
1365
  if (!couldBeIntercepted) {
1168
1366
  // This route will never be intercepted. So we can use this entry for all
@@ -1187,12 +1385,45 @@ async function fetchRouteOnCacheMiss(entry, key) {
1187
1385
  };
1188
1386
  } catch (error) {
1189
1387
  // Either the connection itself failed, or something bad happened while
1190
- // decoding the response.
1388
+ // decoding the response. If we're offline, reject with staleAt=-1 so the
1389
+ // entry immediately expires and gets retried once the scheduler is
1390
+ // re-pinged after connectivity is restored.
1391
+ if (process.env.__NEXT_USE_OFFLINE) {
1392
+ const { checkOfflineError } = require('../offline');
1393
+ if (checkOfflineError(error)) {
1394
+ // Unlike navigations and server actions, prefetches don't await
1395
+ // waitForConnection — they just reject the cache entry with an
1396
+ // immediate expiration so it gets retried once the scheduler is
1397
+ // re-pinged after connectivity is restored.
1398
+ rejectRouteCacheEntry(entry, -1);
1399
+ return null;
1400
+ }
1401
+ }
1191
1402
  rejectRouteCacheEntry(entry, Date.now() + 10 * 1000);
1192
1403
  return null;
1193
1404
  }
1194
1405
  }
1195
- async function fetchSegmentOnCacheMiss(route, segmentCacheEntry, routeKey, tree) {
1406
+ function rejectRemainingSegmentsInBundle(entries, staleAt) {
1407
+ let node = entries;
1408
+ while(node !== null){
1409
+ if (node.entry !== null && node.entry.status === _cachemap.EntryStatus.Pending) {
1410
+ rejectSegmentCacheEntry(node.entry, staleAt);
1411
+ }
1412
+ node = node.parent;
1413
+ }
1414
+ }
1415
+ // When a static (per-segment PPR) prefetch receives an upgradeable fallback
1416
+ // shell, the localized retry loop re-issues the same fetch after this delay to
1417
+ // pick up the concrete version once the server's background regeneration
1418
+ // finishes.
1419
+ const FALLBACK_RETRY_DELAY_MS = 2000;
1420
+ // Maximum number of fallback retries per task, to avoid looping indefinitely
1421
+ // if the server keeps returning a fallback (e.g. misconfiguration).
1422
+ const MAX_FALLBACK_RETRIES = 3;
1423
+ async function fetchSegmentsOnCacheMiss(task, route, routeKey, tree, segments, segmentCount, // Which walk spawned the bundle's entries. The request on the wire is
1424
+ // identical either way; this only decides which payload of the response
1425
+ // fulfills the entries.
1426
+ fetchStrategy) {
1196
1427
  // This function is allowed to use async/await because it contains the actual
1197
1428
  // fetch that gets issued on a cache miss. Notice it writes the result to the
1198
1429
  // cache entry directly, rather than return data that is then written by
@@ -1200,6 +1431,68 @@ async function fetchSegmentOnCacheMiss(route, segmentCacheEntry, routeKey, tree)
1200
1431
  //
1201
1432
  // Segment fetches are non-blocking so we don't need to ping the scheduler
1202
1433
  // on completion.
1434
+ let result;
1435
+ try {
1436
+ result = await fetchSegmentsOnCacheMissImpl(route, routeKey, tree);
1437
+ } catch (error) {
1438
+ // The connection failed, or the response couldn't be decoded. Reject the
1439
+ // pending entries so they don't stay Pending forever, and get retried once
1440
+ // the entry expires. If we're offline, expire immediately (-1) so the entry
1441
+ // is re-fetched once the scheduler is re-pinged on reconnect; otherwise
1442
+ // apply a 10s backoff. (Unlike navigations and server actions, prefetches
1443
+ // don't await `waitForConnection`.)
1444
+ let staleAt = Date.now() + 10 * 1000;
1445
+ if (process.env.__NEXT_USE_OFFLINE) {
1446
+ const { checkOfflineError } = require('../offline');
1447
+ if (checkOfflineError(error)) {
1448
+ staleAt = -1;
1449
+ }
1450
+ }
1451
+ rejectRemainingSegmentsInBundle(segments, staleAt);
1452
+ return null;
1453
+ }
1454
+ if (result === null) {
1455
+ // The response was fetched but isn't usable yet (server error/miss, empty
1456
+ // data, or a build-id mismatch — the server may be transiently unready).
1457
+ // Reject with a short backoff so the entries are retried soon.
1458
+ rejectRemainingSegmentsInBundle(segments, Date.now() + 10 * 1000);
1459
+ return null;
1460
+ }
1461
+ const { serverResponse, shellResponse, responseSize, closed } = result;
1462
+ const now = Date.now();
1463
+ writeSegmentBundleResponseVariants(task.segmentCacheMap, serverResponse, shellResponse, responseSize, segments, segmentCount, now, fetchStrategy);
1464
+ // If the server served an upgradeable fallback shell, drive a localized
1465
+ // retry loop to pick up the concrete version once the server's background
1466
+ // regeneration finishes. Only the first such response per task starts a loop
1467
+ // (`fallbackRetryStatus === Empty`); once it leaves Empty, no second loop is
1468
+ // started — sibling bundle responses that also got a fallback don't, and
1469
+ // neither does a re-hover.
1470
+ if (serverResponse.isUpgradeableISRFallback && task.fallbackRetryStatus === _cachemap.EntryStatus.Empty && !task.isCanceled) {
1471
+ task.fallbackRetryStatus = _cachemap.EntryStatus.Pending;
1472
+ // Fire-and-forget: the loop drives itself via timers and pings the task
1473
+ // on success.
1474
+ void retryUpgradeableFallbackPrefetch(task, route, routeKey, tree, segments, segmentCount, fetchStrategy);
1475
+ }
1476
+ return {
1477
+ value: null,
1478
+ closed
1479
+ };
1480
+ }
1481
+ /**
1482
+ * Issues a single segment-bundle prefetch request, validates it, and decodes
1483
+ * the response. Returns the decoded response (see the return type below)
1484
+ * on success, or `null` if the response was fetched but isn't usable yet
1485
+ * (server error/miss, empty data, or a build-id mismatch — the server may be
1486
+ * transiently unready, so it's worth retrying). THROWS if the connection failed
1487
+ * or the response couldn't be decoded; re-issuing the identical request won't
1488
+ * fix that, so callers should give up rather than retry.
1489
+ *
1490
+ * This deliberately does NOT touch the cache — it neither writes the decoded
1491
+ * segments nor rejects entries. The caller decides what to do with the result:
1492
+ * write it (`fetchSegmentsOnCacheMiss`) or ignore it and try again (the retry
1493
+ * loop). Calling this again with the same arguments reproduces the exact same
1494
+ * request.
1495
+ */ async function fetchSegmentsOnCacheMissImpl(route, routeKey, tree) {
1203
1496
  // Use the canonical URL to request the segment, not the original URL. These
1204
1497
  // are usually the same, but the canonical URL will be different if the route
1205
1498
  // tree response was redirected. To avoid an extra waterfall on every segment
@@ -1221,156 +1514,423 @@ async function fetchSegmentOnCacheMiss(route, segmentCacheEntry, routeKey, tree)
1221
1514
  if (nextUrl !== null) {
1222
1515
  headers[_approuterheaders.NEXT_URL] = nextUrl;
1223
1516
  }
1224
- // Tell the server to perform a static pre-render for the Instant Navigation
1225
- // Testing API. Static pre-renders don't normally happen during development.
1226
- addInstantPrefetchHeaderIfLocked(headers);
1227
1517
  const requestUrl = isOutputExportMode ? addSegmentPathToUrlInOutputExportMode(url, normalizedRequestKey) : url;
1228
- try {
1229
- const response = await fetchPrefetchResponse(requestUrl, headers);
1230
- if (!response || !response.ok || response.status === 204 || // Cache miss
1231
- // This checks whether the response was served from the per-segment cache,
1232
- // rather than the old prefetching flow. If it fails, it implies that PPR
1233
- // is disabled on this route. Theoretically this should never happen
1234
- // because we only issue requests for segments once we've verified that
1235
- // the route supports PPR.
1236
- response.headers.get(_approuterheaders.NEXT_DID_POSTPONE_HEADER) !== '2' && // In output: "export" mode, we can't rely on response headers. But if
1237
- // we receive a well-formed response, we can assume it's a static
1238
- // response, because all data is static in this mode.
1239
- !isOutputExportMode || !response.body) {
1240
- // Server responded with an error, or with a miss. We should still cache
1241
- // the response, but we can try again after 10 seconds.
1242
- rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000);
1243
- return null;
1244
- }
1245
- // See TODO in fetchRouteOnCacheMiss about removing `closed` for
1246
- // buffered prefetch paths.
1247
- const closed = (0, _promisewithresolvers.createPromiseWithResolvers)();
1248
- const { stream: prefetchStream, size: responseSize } = await createNonTaskyPrefetchResponseStream(response.body);
1249
- closed.resolve();
1250
- (0, _cachemap.setSizeInCacheMap)(segmentCacheEntry, responseSize);
1251
- const serverData = await (0, _fetchserverresponse.createFromNextReadableStream)(prefetchStream, headers, {
1252
- allowPartialStream: true
1253
- });
1254
- if ((response.headers.get(_constants.NEXT_NAV_DEPLOYMENT_ID_HEADER) ?? serverData.buildId) !== (0, _navigationbuildid.getNavigationBuildId)()) {
1255
- // The server build does not match the client. Treat as a 404. During
1256
- // an actual navigation, the router will trigger an MPA navigation.
1257
- rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000);
1258
- return null;
1259
- }
1260
- const now = Date.now();
1261
- const staleAt = now + getStaleTimeMs(serverData.staleTime);
1262
- const fulfilledEntry = fulfillSegmentCacheEntry(segmentCacheEntry, serverData.rsc, staleAt, serverData.isPartial);
1263
- // If the server tells us which params the segment varies by, we can re-key
1264
- // the entry to a more generic vary path. This allows the entry to be reused
1265
- // across different param values for params that the segment doesn't
1266
- // actually depend on.
1267
- const varyParams = serverData.varyParams;
1268
- const fulfilledVaryPath = process.env.__NEXT_VARY_PARAMS && varyParams !== null ? (0, _varypath.getFulfilledSegmentVaryPath)(tree.varyPath, varyParams) : (0, _varypath.getSegmentVaryPathForRequest)(segmentCacheEntry.fetchStrategy, tree);
1269
- // Re-key and upsert the entry at the fulfilled vary path. This ensures
1270
- // the entry is stored at the most generic path possible based on which
1271
- // params the segment actually depends on.
1272
- upsertSegmentEntry(now, fulfilledVaryPath, fulfilledEntry);
1273
- return {
1274
- value: fulfilledEntry,
1275
- // Return a promise that resolves when the network connection closes, so
1276
- // the scheduler can track the number of concurrent network connections.
1277
- closed: closed.promise
1278
- };
1279
- } catch (error) {
1280
- // Either the connection itself failed, or something bad happened while
1281
- // decoding the response.
1282
- rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000);
1518
+ const response = await fetchPrefetchResponse(requestUrl, headers);
1519
+ if (!response || !response.ok || // This checks whether the response was served from the per-segment cache,
1520
+ // rather than the old prefetching flow. If it fails, it implies that PPR
1521
+ // is disabled on this route. Theoretically this should never happen
1522
+ // because we only issue requests for segments once we've verified that
1523
+ // the route supports PPR.
1524
+ response.headers.get(_approuterheaders.NEXT_DID_POSTPONE_HEADER) !== '2' && // In output: "export" mode, we can't rely on response headers. But if
1525
+ // we receive a well-formed response, we can assume it's a static
1526
+ // response, because all data is static in this mode.
1527
+ !isOutputExportMode || !response.body) {
1528
+ // Server responded with an error or a miss — fetched but not usable.
1283
1529
  return null;
1284
1530
  }
1285
- }
1286
- async function fetchInlinedSegmentsOnCacheMiss(route, routeKey, tree, spawnedEntries) {
1287
- // When prefetch inlining is enabled, all segment data for a route is bundled
1288
- // into a single /_inlined response instead of individual per-segment
1289
- // requests. This function fetches that response and walks the tree to fill
1290
- // all segment cache entries at once.
1291
- const url = new URL(route.canonicalUrl, location.origin);
1292
- const nextUrl = routeKey.nextUrl;
1293
- const headers = {
1294
- [_approuterheaders.RSC_HEADER]: '1',
1295
- [_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER]: '1',
1296
- [_approuterheaders.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]: '/' + _segment.PAGE_SEGMENT_KEY
1297
- };
1298
- if (nextUrl !== null) {
1299
- headers[_approuterheaders.NEXT_URL] = nextUrl;
1531
+ // See TODO in fetchRouteOnCacheMiss about removing `closed` for
1532
+ // buffered prefetch paths.
1533
+ const closed = (0, _promisewithresolvers.createPromiseWithResolvers)();
1534
+ const { stream: prefetchStream, size: responseSize, buffer } = await createNonTaskyPrefetchResponseStream(response.body);
1535
+ closed.resolve();
1536
+ // Parse the response. Always a SegmentPrefetchResponse with a build ID and a
1537
+ // data array. A connection drop or malformed stream throws here, which
1538
+ // propagates to the caller as a non-retryable failure.
1539
+ const serverResponse = await (0, _fetchserverresponse.createFromNextReadableStream)(prefetchStream, headers, {
1540
+ allowPartialStream: true
1541
+ });
1542
+ if (serverResponse.data.length === 0) {
1543
+ return null;
1300
1544
  }
1301
- addInstantPrefetchHeaderIfLocked(headers);
1302
- try {
1303
- const response = await fetchPrefetchResponse(url, headers);
1304
- if (!response || !response.ok || response.status === 204 || response.headers.get(_approuterheaders.NEXT_DID_POSTPONE_HEADER) !== '2' && !isOutputExportMode || !response.body) {
1305
- rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000);
1306
- return null;
1545
+ if ((response.headers.get(_constants.NEXT_NAV_DEPLOYMENT_ID_HEADER) ?? serverResponse.buildId) !== (0, _navigationbuildid.getNavigationBuildId)()) {
1546
+ // The server build does not match the client. Treat as a 404. During
1547
+ // an actual navigation, the router will trigger an MPA navigation.
1548
+ return null;
1549
+ }
1550
+ // Extract the shell payload, if the response carries a distinct one
1551
+ // (positive shell byte offset): decode the buffered bytes a SECOND time,
1552
+ // truncated at the boundary. The truncation is what produces the shell
1553
+ // variant: each segment's param-dependent rows land past the boundary and
1554
+ // decode as still-pending, which renders as the param fallback. It also
1555
+ // rewinds the response's signals — `needsRuntimeRequest` and `isPartial`
1556
+ // fulfillments past the boundary read as pending in this decode, so a
1557
+ // post-shell runtime-data access doesn't mark the shell variant itself as
1558
+ // needing a runtime request.
1559
+ // (The offset is never legitimately pending or 0 in this decode: the full
1560
+ // buffer is present, and the server only ever emits a positive offset or
1561
+ // null. Reading 0 — the default for an unfulfilled `a` — therefore means a
1562
+ // bug in Next.js itself, and is handled like an error: the response is
1563
+ // treated as carrying no shell, and the scheduler skips the affected
1564
+ // segments rather than falling back to a runtime request — see the
1565
+ // `shellResponse === null` handling in writeSegmentBundleResponseVariants.
1566
+ // Failing in that direction costs a shell prefetch but never leaks
1567
+ // post-shell content into shell positions.)
1568
+ const shellOffset = readFulfilledValue(serverResponse.a, 0);
1569
+ let shellResponse;
1570
+ if (shellOffset === null) {
1571
+ shellResponse = serverResponse;
1572
+ } else if (shellOffset === 0) {
1573
+ shellResponse = null;
1574
+ } else {
1575
+ try {
1576
+ shellResponse = await (0, _fetchserverresponse.decodeBufferedStage)(buffer.subarray(0, shellOffset), headers);
1577
+ } catch {
1578
+ // The truncated prefix couldn't be decoded. Treat it as if no shell
1579
+ // exists; the full payload is still usable. (For a StaticShell-spawned
1580
+ // bundle this means the spawned entries are rejected — the scheduler
1581
+ // then skips them rather than issuing a runtime substitute; see the
1582
+ // no-shell branch in fetchSegmentsOnCacheMiss.)
1583
+ shellResponse = null;
1307
1584
  }
1308
- // See TODO in fetchRouteOnCacheMiss about removing `closed` for
1309
- // buffered prefetch paths.
1310
- const closed = (0, _promisewithresolvers.createPromiseWithResolvers)();
1311
- const { stream: prefetchStream } = await createNonTaskyPrefetchResponseStream(response.body);
1312
- closed.resolve();
1313
- const serverData = await (0, _fetchserverresponse.createFromNextReadableStream)(prefetchStream, headers, {
1314
- allowPartialStream: true
1315
- });
1316
- if ((response.headers.get(_constants.NEXT_NAV_DEPLOYMENT_ID_HEADER) ?? serverData.tree.segment.buildId) !== (0, _navigationbuildid.getNavigationBuildId)()) {
1317
- rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000);
1318
- return null;
1585
+ }
1586
+ return {
1587
+ serverResponse,
1588
+ responseSize,
1589
+ shellResponse,
1590
+ closed: closed.promise
1591
+ };
1592
+ }
1593
+ /**
1594
+ * Writes every payload of a parsed segment-bundle response into the cache.
1595
+ * The bundle's entries are fulfilled by the payload matching the walk that
1596
+ * spawned them; the other payload, when distinct, is written with a detached
1597
+ * copy of the bundle. The full payload is written first so the shell write's
1598
+ * shadow eviction sees the fresh concrete entry.
1599
+ *
1600
+ * Shared by the initial fetch (`fetchSegmentsOnCacheMiss`) and the localized
1601
+ * fallback-retry loop. The retry's bundle entries are already settled, so
1602
+ * for that caller every write is a detached upsert and the rejection below
1603
+ * is a no-op (it only touches Pending entries).
1604
+ */ function writeSegmentBundleResponseVariants(// The map the bundle's entries live in (pinned when the request was
1605
+ // spawned).
1606
+ map, serverResponse, shellResponse, responseSize, segments, segmentCount, now, // Which walk spawned the bundle's entries; decides which payload fulfills
1607
+ // them. See fetchSegmentsOnCacheMiss.
1608
+ fetchStrategy) {
1609
+ if (fetchStrategy === _types.FetchStrategy.StaticShell) {
1610
+ if (shellResponse !== serverResponse) {
1611
+ writeSegmentBundleResponse(map, serverResponse, responseSize, detachEntriesFromSegmentBundle(segments), segmentCount, now, _types.FetchStrategy.PPR, _types.FetchStrategy.PPR);
1319
1612
  }
1320
- const now = Date.now();
1321
- // Walk the inlined tree in parallel with the RouteTree and fill
1322
- // segment cache entries.
1323
- fillInlinedSegmentEntries(now, route, tree, serverData.tree, spawnedEntries);
1324
- // Fill the head entry.
1325
- const headStaleAt = now + getStaleTimeMs(serverData.head.staleTime);
1326
- const headKey = route.metadata.requestKey;
1327
- const ownedHeadEntry = spawnedEntries.get(headKey);
1328
- if (ownedHeadEntry !== undefined) {
1329
- fulfillSegmentCacheEntry(ownedHeadEntry, serverData.head.rsc, headStaleAt, serverData.head.isPartial);
1613
+ if (shellResponse === null) {
1614
+ // No shell exists. Reject the spawned entries so the task isn't
1615
+ // stranded blocking on them. Note the scheduler does NOT fall back to
1616
+ // a runtime request for rejected segments — it skips them outright (see
1617
+ // the Rejected case in pingSegmentBundle in scheduler.ts), so these
1618
+ // segments get no shell prefetch and no runtime substitute until the
1619
+ // rejection's backoff expires.
1620
+ rejectRemainingSegmentsInBundle(segments, now + 10 * 1000);
1330
1621
  } else {
1331
- // The head was already cached. Try to upsert if the entry is empty.
1332
- const existingEntry = readOrCreateSegmentCacheEntry(now, _types.FetchStrategy.PPR, route.metadata);
1333
- if (existingEntry.status === 0) {
1334
- fulfillSegmentCacheEntry(upgradeToPendingSegment(existingEntry, _types.FetchStrategy.PPR), serverData.head.rsc, headStaleAt, serverData.head.isPartial);
1622
+ writeSegmentBundleResponse(map, shellResponse, responseSize, segments, segmentCount, now, _types.FetchStrategy.StaticShell, // When the shell IS the full response (no shell/full split), the
1623
+ // entries this write fulfills carry full-tier content, so PPR is the
1624
+ // strategy that describes it.
1625
+ shellResponse === serverResponse ? _types.FetchStrategy.PPR : _types.FetchStrategy.StaticShell);
1626
+ }
1627
+ } else {
1628
+ writeSegmentBundleResponse(map, serverResponse, responseSize, segments, segmentCount, now, _types.FetchStrategy.PPR, _types.FetchStrategy.PPR);
1629
+ if (shellResponse !== null && shellResponse !== serverResponse) {
1630
+ writeSegmentBundleResponse(map, shellResponse, responseSize, detachEntriesFromSegmentBundle(segments), segmentCount, now, _types.FetchStrategy.StaticShell, _types.FetchStrategy.StaticShell);
1631
+ }
1632
+ }
1633
+ }
1634
+ /**
1635
+ * Writes one payload of a parsed segment-bundle response into the cache:
1636
+ * distributes the response size across the bundle, then walks the segments
1637
+ * list and the response's `data` array in parallel, fulfilling/upserting
1638
+ * each entry. Any segments the server didn't return are rejected so they
1639
+ * don't stay Pending forever.
1640
+ *
1641
+ * `fetchStrategy` says which of the response's payloads this call is
1642
+ * writing — StaticShell for the shell payload, PPR for the full payload —
1643
+ * which determines the vary paths the entries are keyed at.
1644
+ *
1645
+ * The walk fulfills any Pending entry in `segments`, so the caller must
1646
+ * pass the bundle only to the walk matching the entries' own strategy, and
1647
+ * a detached copy to the other. In particular, fulfilling a spawned
1648
+ * StaticShell entry with the concrete payload would leak param-dependent
1649
+ * content into shell positions: during a navigation, a pending entry can be
1650
+ * rendered as a promise that resolves to its eventual value.
1651
+ *
1652
+ * Shared by the initial fetch and the localized fallback-retry loop (which
1653
+ * re-issues the same request and upserts the upgraded result here).
1654
+ */ function writeSegmentBundleResponse(map, serverResponse, responseSize, segments, segmentCount, now, fetchStrategy, // The strategy tier that describes this payload's CONTENT, recorded on
1655
+ // the entries it fulfills. Differs from `fetchStrategy` (which drives
1656
+ // matching and keying) in one case: a StaticShell write whose payload IS
1657
+ // the full response (no shell/full split) records PPR — see
1658
+ // writeSegmentBundleResponseVariants.
1659
+ payloadFetchStrategy) {
1660
+ // Distribute the response size evenly across all segments in the bundle.
1661
+ // (When a response produces two payload writes, each write distributes the
1662
+ // full response size — intentionally double-charging the LRU for one wire
1663
+ // response, since it produced two live entries per segment.)
1664
+ const averageSize = responseSize / segmentCount;
1665
+ let sizeNode = segments;
1666
+ while(sizeNode !== null){
1667
+ if (sizeNode.entry !== null) {
1668
+ (0, _cachemap.setSizeInCacheMap)(sizeNode.entry, averageSize);
1669
+ }
1670
+ sizeNode = sizeNode.parent;
1671
+ }
1672
+ const serverDataArray = serverResponse.data;
1673
+ // True if the server served an upgradeable fallback shell (page not yet
1674
+ // prerendered with concrete params, but the route can be upgraded). Applies
1675
+ // to the whole response and is recorded on each fulfilled entry.
1676
+ const responseIsUpgradeableISRFallback = serverResponse.isUpgradeableISRFallback;
1677
+ // Whether the render that produced this payload accessed runtime data
1678
+ // (page-global; combined with each segment's `isPartial` below to decide
1679
+ // the tier each entry records). Read from THIS decode's thenable status,
1680
+ // which scopes it to the payload being written — see
1681
+ // `SegmentPrefetchResponse['needsRuntimeRequest']` for the encoding.
1682
+ //
1683
+ // Reading it from the same decode that produced the entry's data is what
1684
+ // makes the answer rewindable: a truncated shell decode reads a post-shell
1685
+ // runtime access as pending, i.e. `false`, because the shell variant itself
1686
+ // doesn't need that data.
1687
+ //
1688
+ // It is load-bearing in one direction only. A false `true` costs a wasted
1689
+ // runtime request; a false `false` would record too high a tier and skip a
1690
+ // runtime request that had more content.
1691
+ const responseNeedsRuntimeRequest = readFulfilledValue(serverResponse.needsRuntimeRequest, false);
1692
+ let node = segments;
1693
+ let dataIndex = 0;
1694
+ while(node !== null && dataIndex < serverDataArray.length){
1695
+ const data = serverDataArray[dataIndex];
1696
+ // Null data means this segment has prefetching disabled
1697
+ // (prefetch: 'force-disabled' — Partial Prefetching segments have static
1698
+ // data, so the server emits a real slot for them). Skip it without
1699
+ // creating a cache entry.
1700
+ if (data === null || node.tree === null) {
1701
+ // The server's and the client's prefetch-disabled hints normally agree,
1702
+ // so there shouldn't be a spawned entry for a segment the server
1703
+ // skipped. But if they disagree, a Pending entry that a task blocked on
1704
+ // would otherwise never settle, stranding the task forever. Settle
1705
+ // it defensively.
1706
+ if (node.entry !== null && node.entry.status === _cachemap.EntryStatus.Pending) {
1707
+ rejectSegmentCacheEntry(node.entry, now + 10 * 1000);
1335
1708
  }
1709
+ node = node.parent;
1710
+ dataIndex++;
1711
+ continue;
1336
1712
  }
1337
- // Reject any remaining entries that were not fulfilled by the response.
1338
- rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000);
1339
- return {
1340
- value: null,
1341
- closed: closed.promise
1713
+ // The segment's late-resolving metadata can be read synchronously
1714
+ // because the payload was fully buffered before it was decoded (and, for
1715
+ // a truncated shell decode, delivered as a single chunk).
1716
+ const entryStaleAt = readFulfilledStaleAt(now, data.staleTime);
1717
+ // Root params are emitted once at the top level of the response and
1718
+ // unioned into each segment's set here, same as for a route-level
1719
+ // response.
1720
+ const varyParams = (0, _varyparamsdecoding.readVaryParams)(data.varyParams, serverResponse.rootVaryParams);
1721
+ const isPartial = readFulfilledIsPartial(data.isPartial);
1722
+ // A runtime prefetch can only provide more content than this entry if the
1723
+ // render accessed runtime data AND this particular segment has holes — a
1724
+ // fully static segment gains nothing from a runtime request no matter
1725
+ // what the page accessed.
1726
+ const needsRuntimeRequest = responseNeedsRuntimeRequest && isPartial;
1727
+ // An entry records the tier of the content that actually satisfied it,
1728
+ // which spans both axes: shell-vs-concrete AND static-vs-runtime.
1729
+ //
1730
+ // When this payload fully satisfied the segment — no runtime request
1731
+ // needed — the content is as complete as a RUNTIME response of the same
1732
+ // variant would have been, so it records that runtime tier. That's what
1733
+ // lets the scheduler decide "would a runtime request return more?" by
1734
+ // comparing tiers alone, with no separate signal to consult.
1735
+ //
1736
+ // Otherwise the content is only as complete as the static tier it was
1737
+ // requested at, so a follow-up runtime request can still supersede it.
1738
+ const recordedFetchStrategy = !needsRuntimeRequest ? payloadFetchStrategy === _types.FetchStrategy.StaticShell ? _types.FetchStrategy.RuntimeShell : _types.FetchStrategy.PPRRuntime : fetchStrategy;
1739
+ // Key the entry by which params the server said this segment depends on.
1740
+ // Reusing one copy across param values is the point of the shell, but it
1741
+ // requires knowing the content doesn't depend on those params, and the
1742
+ // server's report is the direct evidence of that.
1743
+ //
1744
+ // Without that report, assume every param varies. The exception is a
1745
+ // shell variant, which reduces param-dependent content to param
1746
+ // fallbacks, so it really is good for any value of them.
1747
+ const payloadVaryPath = process.env.__NEXT_VARY_PARAMS && varyParams !== null ? (0, _varypath.getFulfilledSegmentVaryPath)(node.tree.varyPath, varyParams) : (0, _varypath.getSegmentVaryPathForRequest)(payloadFetchStrategy, node.tree);
1748
+ const nodeEntry = node.entry;
1749
+ if (nodeEntry !== null && nodeEntry.status === _cachemap.EntryStatus.Pending) {
1750
+ // We own this entry — fulfill it directly.
1751
+ const fulfilledEntry = fulfillSegmentCacheEntry(nodeEntry, data.rsc, entryStaleAt, isPartial, responseIsUpgradeableISRFallback, recordedFetchStrategy);
1752
+ // Move the entry to that key. This is load-bearing rather than a no-op:
1753
+ // a task spawns its entries before it knows what the response will
1754
+ // contain, so the key it guessed can be more reusable than the response
1755
+ // turned out to deserve.
1756
+ //
1757
+ // Pass the concrete lookup path — the most specific path a read for
1758
+ // this segment position would use — so that if the entry lands at a
1759
+ // more generic key, a stale entry at a more specific one can't shadow
1760
+ // it. See evictShadowingSegmentEntries. The upsert (rather than a bare
1761
+ // set) applies the usual precedence rules, so a concurrent task's more
1762
+ // complete response already in this slot isn't downgraded.
1763
+ upsertSegmentEntry(now, map, payloadVaryPath, fulfilledEntry, node.tree.varyPath);
1764
+ } else {
1765
+ // We don't own this entry. Create a detached entry and attempt to
1766
+ // upsert it into this payload's slot.
1767
+ const detachedEntry = createDetachedSegmentCacheEntry(now);
1768
+ const fulfilledEntry = fulfillSegmentCacheEntry(upgradeToPendingSegment(detachedEntry, fetchStrategy), data.rsc, entryStaleAt, isPartial, responseIsUpgradeableISRFallback, recordedFetchStrategy);
1769
+ upsertSegmentEntry(now, map, payloadVaryPath, fulfilledEntry, node.tree.varyPath);
1770
+ }
1771
+ node = node.parent;
1772
+ dataIndex++;
1773
+ }
1774
+ // If the server returned fewer segments than expected, reject any
1775
+ // remaining pending entries so they don't stay Pending forever.
1776
+ if (node !== null) {
1777
+ rejectRemainingSegmentsInBundle(node, now + 10 * 1000);
1778
+ }
1779
+ }
1780
+ /**
1781
+ * Clones a SegmentBundle chain with every `entry` removed, so a write walk
1782
+ * over it is pure detached upserts. Used for the payload that does NOT
1783
+ * match the bundle's spawned entries (see writeSegmentBundleResponse).
1784
+ */ function detachEntriesFromSegmentBundle(segments) {
1785
+ const head = {
1786
+ tree: segments.tree,
1787
+ entry: null,
1788
+ parent: null
1789
+ };
1790
+ let clonedTail = head;
1791
+ let node = segments.parent;
1792
+ while(node !== null){
1793
+ const clonedNode = {
1794
+ tree: node.tree,
1795
+ entry: null,
1796
+ parent: null
1342
1797
  };
1343
- } catch (error) {
1344
- rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000);
1345
- return null;
1798
+ clonedTail.parent = clonedNode;
1799
+ clonedTail = clonedNode;
1800
+ node = node.parent;
1346
1801
  }
1802
+ return head;
1347
1803
  }
1348
- function fillInlinedSegmentEntries(now, route, tree, inlinedNode, spawnedEntries) {
1349
- // Check if the spawned entries map has an entry for this segment's key.
1350
- const segment = inlinedNode.segment;
1351
- const staleAt = now + getStaleTimeMs(segment.staleTime);
1352
- const ownedEntry = spawnedEntries.get(tree.requestKey);
1353
- if (ownedEntry !== undefined) {
1354
- // We own this entry. Fulfill it directly.
1355
- fulfillSegmentCacheEntry(ownedEntry, segment.rsc, staleAt, segment.isPartial);
1356
- } else {
1357
- // Not owned by us — this is extra data from the inlined response for a
1358
- // segment that was already cached. Try to upsert if the entry is empty.
1359
- const existingEntry = readOrCreateSegmentCacheEntry(now, _types.FetchStrategy.PPR, tree);
1360
- if (existingEntry.status === 0) {
1361
- fulfillSegmentCacheEntry(upgradeToPendingSegment(existingEntry, _types.FetchStrategy.PPR), segment.rsc, staleAt, segment.isPartial);
1804
+ // TODO: Consolidate the read* helpers below with the ones in
1805
+ // vary-params-decoding — they all perform a version of the same synchronous
1806
+ // read of a buffered decode's late-resolving values.
1807
+ /**
1808
+ * Reads a segment's partialness from its `isPartial` promise. (Unlike the
1809
+ * values read via `readFulfilledValue` below, the fulfillment value here is
1810
+ * void — partialness is encoded as the ABSENCE of a fulfillment.) The server
1811
+ * fulfills it only for a fully-static segment and leaves it pending for a
1812
+ * partial one (see `SegmentPrefetch['isPartial']`), so partial == not
1813
+ * fulfilled. The read is synchronous because the response is fully buffered
1814
+ * before it's decoded, so a fulfillment is already visible on the thenable's
1815
+ * status — the same trick `readVaryParams` uses for the vary params iterables.
1816
+ */ function readFulfilledIsPartial(isPartial) {
1817
+ const thenable = isPartial;
1818
+ // Force Flight to unwrap a received-but-not-yet-settled row. A pending row,
1819
+ // or a truncated shell decode whose fulfillment landed past the boundary,
1820
+ // stays non-fulfilled — read as partial, which is correct either way.
1821
+ thenable.then(noop, noop);
1822
+ return thenable.status !== 'fulfilled';
1823
+ }
1824
+ /**
1825
+ * Reads a late-resolving value off a fully-buffered decode's thenable status,
1826
+ * using the same trick as above. Returns `valueIfUnresolved` for a row that
1827
+ * is pending or absent in this decode — e.g. one whose fulfillment landed
1828
+ * past a truncated shell decode's boundary. That's what scopes a response's
1829
+ * late-resolving signals to the payload being decoded.
1830
+ */ function readFulfilledValue(valueFromServer, valueIfUnresolved) {
1831
+ const thenable = valueFromServer;
1832
+ // Force Flight to unwrap a received-but-not-yet-settled row.
1833
+ thenable.then(noop, noop);
1834
+ if (thenable.status === 'fulfilled' && thenable.value !== undefined) {
1835
+ return thenable.value;
1836
+ }
1837
+ return valueIfUnresolved;
1838
+ }
1839
+ /**
1840
+ * Reads a stale-at time from the staleTime async iterable of a fully-buffered
1841
+ * response — segment bundles and stage decodes, which go through
1842
+ * `createNonTaskyPrefetchResponseStream`. Because the bytes are all present,
1843
+ * each yielded value is already visible on its chunk's thenable status (the
1844
+ * same trick `readVaryParams` uses), so this drains synchronously and takes
1845
+ * the last value (the final staleTime, as `resolveStaleAt` does for the
1846
+ * async case). A missing iterable, or a truncated shell decode whose value
1847
+ * landed past the boundary, reads as absent and falls back to the static
1848
+ * stale time.
1849
+ *
1850
+ * For the one response kind that isn't buffered when read — a dynamic `Full`
1851
+ * response (fetchStrategy.Full with Partial Prefetching disabled) — use
1852
+ * `resolveStaleAt` instead, since its values aren't materialized synchronously.
1853
+ */ function readFulfilledStaleAt(now, staleTime) {
1854
+ if (staleTime === undefined) {
1855
+ return now + _navigatereducer.STATIC_STALETIME_MS;
1856
+ }
1857
+ const iterator = staleTime[Symbol.asyncIterator]();
1858
+ let staleTimeSeconds;
1859
+ while(true){
1860
+ const chunk = iterator.next();
1861
+ chunk.then(noop, noop);
1862
+ if (chunk.status !== 'fulfilled' || chunk.value === undefined) {
1863
+ break;
1362
1864
  }
1865
+ if (chunk.value.done) {
1866
+ break;
1867
+ }
1868
+ staleTimeSeconds = chunk.value.value;
1363
1869
  }
1364
- // Recurse into children.
1365
- if (tree.slots !== null && inlinedNode.slots !== null) {
1366
- for(const parallelRouteKey in tree.slots){
1367
- const childTree = tree.slots[parallelRouteKey];
1368
- const childInlinedNode = inlinedNode.slots[parallelRouteKey];
1369
- if (childInlinedNode !== undefined) {
1370
- fillInlinedSegmentEntries(now, route, childTree, childInlinedNode, spawnedEntries);
1371
- }
1870
+ if (staleTimeSeconds === undefined || isNaN(staleTimeSeconds)) {
1871
+ return now + _navigatereducer.STATIC_STALETIME_MS;
1872
+ }
1873
+ return now + getStaleTimeMs(staleTimeSeconds);
1874
+ }
1875
+ const noop = ()=>{};
1876
+ /**
1877
+ * The localized retry loop for an upgradeable fallback shell. Re-issues the
1878
+ * exact same segment-bundle request (via `fetchSegmentsOnCacheMissImpl`) up to
1879
+ * MAX_FALLBACK_RETRIES times, FALLBACK_RETRY_DELAY_MS apart, until the server
1880
+ * returns the concrete (upgraded) version. On success it upserts the upgraded
1881
+ * segments (so they aren't re-fetched) and pings the task, so the task's
1882
+ * *other* fallback segments get re-attempted. If every attempt is still a
1883
+ * fallback (or fails), it gives up.
1884
+ *
1885
+ * A loop runs at most once per task, ever (the caller gates on
1886
+ * `fallbackRetryStatus === Empty`, set to `Pending` before this runs and never
1887
+ * reset to `Empty`). The sleep timer is never `clearTimeout`-ed, so the awaited
1888
+ * sleep always settles; the loop simply checks `isCanceled` after waking and
1889
+ * bails if the task was canceled in the meantime. On success the status becomes
1890
+ * `Fulfilled`; on any non-success exit (exhausted retries, fetch error, or
1891
+ * cancel) it becomes `Rejected`.
1892
+ */ async function retryUpgradeableFallbackPrefetch(task, route, routeKey, tree, segments, segmentCount, // The strategy the initial fetch wrote its payloads with; the upgraded
1893
+ // result is written through the same payload fork so the same cache slots
1894
+ // (including the shell paths) are upgraded.
1895
+ fetchStrategy) {
1896
+ for(let attempt = 0; attempt < MAX_FALLBACK_RETRIES; attempt++){
1897
+ await new Promise((resolve)=>setTimeout(resolve, FALLBACK_RETRY_DELAY_MS));
1898
+ if (task.isCanceled) {
1899
+ break;
1900
+ }
1901
+ let result;
1902
+ try {
1903
+ result = await fetchSegmentsOnCacheMissImpl(route, routeKey, tree);
1904
+ } catch {
1905
+ break;
1906
+ }
1907
+ if (task.isCanceled) {
1908
+ break;
1909
+ }
1910
+ if (result === null) {
1911
+ continue;
1372
1912
  }
1913
+ if (result.serverResponse.isUpgradeableISRFallback) {
1914
+ continue;
1915
+ }
1916
+ // Success: the server returned the concrete (upgraded) version. Write it
1917
+ // back through the same payload fork as the initial fetch, so every slot
1918
+ // the initial fetch wrote — including the shell paths, even when the
1919
+ // upgraded response is fully static (shell === full) — is upgraded. The
1920
+ // bundle's entries were already settled by the initial fetch, so every
1921
+ // write is a detached upsert that replaces the fallback. Mark the loop
1922
+ // fulfilled and ping the task; its other fallback segments are now
1923
+ // allowed to revalidate.
1924
+ const { serverResponse, shellResponse, responseSize } = result;
1925
+ const now = Date.now();
1926
+ writeSegmentBundleResponseVariants(task.segmentCacheMap, serverResponse, shellResponse, responseSize, segments, segmentCount, now, fetchStrategy);
1927
+ task.fallbackRetryStatus = _cachemap.EntryStatus.Fulfilled;
1928
+ (0, _scheduler.pingPrefetchTask)(task);
1929
+ return;
1373
1930
  }
1931
+ // The loop finished without success (exhausted its retries, broke out on a
1932
+ // fetch error, or the task was canceled). It won't run again for this task.
1933
+ task.fallbackRetryStatus = _cachemap.EntryStatus.Rejected;
1374
1934
  }
1375
1935
  async function fetchSegmentPrefetchesUsingDynamicRequest(task, route, fetchStrategy, dynamicRequestTree, spawnedEntries) {
1376
1936
  const key = task.key;
@@ -1379,6 +1939,9 @@ async function fetchSegmentPrefetchesUsingDynamicRequest(task, route, fetchStrat
1379
1939
  if (spawnedEntries.size === 1 && spawnedEntries.has(route.metadata.requestKey)) {
1380
1940
  // The only thing pending is the head. Instruct the server to
1381
1941
  // skip over everything else.
1942
+ // TODO: Lift this logic into the caller. Or perhaps unify the
1943
+ // "request tree" and the spawnedEntries into the same type so they are
1944
+ // guaranteed to always been in sync.
1382
1945
  dynamicRequestTree = MetadataOnlyRequestTree;
1383
1946
  }
1384
1947
  const headers = {
@@ -1398,6 +1961,11 @@ async function fetchSegmentPrefetchesUsingDynamicRequest(task, route, fetchStrat
1398
1961
  headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] = '2';
1399
1962
  break;
1400
1963
  }
1964
+ case _types.FetchStrategy.RuntimeShell:
1965
+ {
1966
+ headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] = '3';
1967
+ break;
1968
+ }
1401
1969
  case _types.FetchStrategy.LoadingBoundary:
1402
1970
  {
1403
1971
  headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] = '1';
@@ -1466,27 +2034,125 @@ async function fetchSegmentPrefetchesUsingDynamicRequest(task, route, fetchStrat
1466
2034
  }),
1467
2035
  response.cacheData
1468
2036
  ]);
1469
- // Read head vary params synchronously. Individual segments carry their
1470
- // own thenables in CacheNodeSeedData.
1471
- const headVaryParamsThenable = serverData.h;
1472
- const headVaryParams = headVaryParamsThenable !== null ? (0, _varyparamsdecoding.readVaryParams)(headVaryParamsThenable) : null;
1473
2037
  const now = Date.now();
1474
- const staleAt = await getStaleAt(now, serverData.s, response);
1475
- // PPRRuntime prefetches are partial when the server marks the response
1476
- // as '~' (Partial). Full/LoadingBoundary prefetches are always complete.
1477
- const isResponsePartial = fetchStrategy === _types.FetchStrategy.PPRRuntime && (cacheData?.isResponsePartial ?? false);
1478
- // Aside from writing the data into the cache, this function also returns
1479
- // the entries that were fulfilled, so we can streamingly update their sizes
1480
- // in the LRU as more data comes in.
2038
+ const staleAt = await resolveStaleAt(now, serverData.s, response);
1481
2039
  const buildId = response.headers.get(_constants.NEXT_NAV_DEPLOYMENT_ID_HEADER) ?? serverData.b;
1482
- const flightDatas = (0, _flightdatahelpers.normalizeFlightData)(serverData.f);
2040
+ // Check if a reusable App Shell can be extracted from the main response.
2041
+ let serverDataThatSatisfiesSpawnedEntries;
2042
+ // The shell and full response have independent stale times. Track the
2043
+ // staleAt that corresponds to whatever payload the spawned entries get
2044
+ // filled with below.
2045
+ let staleAtForSpawnedEntries = staleAt;
2046
+ if (cacheData === null) {
2047
+ // No shell can be extracted without cache metadata (only present when
2048
+ // Cached Navigations is enabled). For routes without a distinct App Shell
2049
+ // the extraction below is a no-op anyway (`resolveShellStageData` returns
2050
+ // null), so this just short-circuits that case.
2051
+ serverDataThatSatisfiesSpawnedEntries = serverData;
2052
+ } else {
2053
+ const shellStageData = await (0, _fetchserverresponse.resolveShellStageData)(cacheData, serverData, headers);
2054
+ if (shellStageData === null) {
2055
+ // No App Shell can be extracted. This usually means the entire response
2056
+ // _is_ the App Shell. The other possibility (for now, until the feature
2057
+ // is fully stabilized) is that App Shells are not yet enabled. Either
2058
+ // way, there's nothing extra for us to do: fulfill the pending entries
2059
+ // using the response from the server.
2060
+ serverDataThatSatisfiesSpawnedEntries = serverData;
2061
+ } else {
2062
+ // Successfully extracted an App Shell that is a subset of the main
2063
+ // response. Depending on the type of prefetch this is, we need to
2064
+ // decide whether to fulfill the pending entries with the shell or with
2065
+ // the entire response. In either scenario, we'll be inserting _both_
2066
+ // versions of the response into the cache; the extra logic is only
2067
+ // here so that we don't fulfill pending shell entries with something
2068
+ // that's more concrete than what they expect.
2069
+ // TODO: The only reason this matters is because during a navigation,
2070
+ // if a segment is still pending, we render a promise that resolves to
2071
+ // the eventual value of that segment. But that means we cannot
2072
+ // eventually resolve that segment to something more concrete than what
2073
+ // was already requested. Hence the extra logic here. A cleaner way to
2074
+ // model this, though, is whenever we render a promise that resolves to
2075
+ // the result of a pending entry, do one additional cache look-up right
2076
+ // after the promise resolves, to ensure we never get a mismatching
2077
+ // entry. Leaving this for a follow up.
2078
+ // shellStageData is a fully-buffered stage decode, so read staleTime
2079
+ // synchronously off the thenable status.
2080
+ const shellStaleAt = readFulfilledStaleAt(now, shellStageData.s);
2081
+ if (fetchStrategy === _types.FetchStrategy.RuntimeShell) {
2082
+ // This is a Shell prefetch, so the pending entries must be fulfilled
2083
+ // with the shell.
2084
+ serverDataThatSatisfiesSpawnedEntries = shellStageData;
2085
+ staleAtForSpawnedEntries = shellStaleAt;
2086
+ // Separately, we'll also cache the entire response, by upserting it
2087
+ // into the cache.
2088
+ writePrerenderResponseIntoCache(now, _types.FetchStrategy.PPR, serverData.f, buildId, serverData.h, serverData.r ?? null, staleAt, dynamicRequestTree, renderedSearch, cacheData.isResponsePartial, task.segmentCacheMap);
2089
+ } else {
2090
+ // This is _not_ a Shell prefetch, so the pending entries should be
2091
+ // fulfilled with the entire response.
2092
+ serverDataThatSatisfiesSpawnedEntries = serverData;
2093
+ // Additionally, we might as well upsert the extracted Shell into the
2094
+ // cache, too.
2095
+ // `shellStageData` is only provided in cases where the shell is
2096
+ // different from the main response. If they are equivalent, this
2097
+ // branch is skipped. So it follows that any shell data reaches
2098
+ // this path must be partial -- it does not represent the entire
2099
+ // UI of the target page.
2100
+ const isShellStagePartial = true;
2101
+ writePrerenderResponseIntoCache(now, _types.FetchStrategy.RuntimeShell, shellStageData.f, buildId, shellStageData.h, shellStageData.r ?? null, shellStaleAt, dynamicRequestTree, renderedSearch, isShellStagePartial, task.segmentCacheMap);
2102
+ }
2103
+ }
2104
+ }
2105
+ // Read head vary params synchronously (unioning in the response-level root
2106
+ // params). Individual segments carry their own iterables in
2107
+ // CacheNodeSeedData; the root iterable is threaded down so each segment
2108
+ // unions it too.
2109
+ const rootVaryParamsIterable = serverDataThatSatisfiesSpawnedEntries.r ?? null;
2110
+ const headVaryParams = (0, _varyparamsdecoding.readVaryParams)(serverDataThatSatisfiesSpawnedEntries.h, rootVaryParamsIterable);
2111
+ // PPRRuntime and RuntimeShell prefetches are partial when the server
2112
+ // marks the response as '~' (Partial). RuntimeShell additionally omits
2113
+ // every dynamic suspense boundary below the App Shell, so its segments
2114
+ // are always partial regardless of what the server marker says.
2115
+ // Full/LoadingBoundary prefetches are always complete.
2116
+ const isResponsePartial = fetchStrategy === _types.FetchStrategy.RuntimeShell || fetchStrategy === _types.FetchStrategy.PPRRuntime && (cacheData?.isResponsePartial ?? false);
2117
+ const flightDatas = (0, _flightdatahelpers.normalizeFlightData)(serverDataThatSatisfiesSpawnedEntries.f);
1483
2118
  if (typeof flightDatas === 'string') {
1484
2119
  rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000);
1485
2120
  return null;
1486
2121
  }
1487
2122
  const navigationSeed = (0, _navigation.convertServerPatchToFullTree)(now, dynamicRequestTree, flightDatas, renderedSearch, // Not needed for prefetch responses; pass unknown to use the default.
1488
2123
  _bfcache.UnknownDynamicStaleTime);
1489
- fulfilledEntries = writeDynamicRenderResponseIntoCache(now, fetchStrategy, flightDatas, buildId, isResponsePartial, headVaryParams, staleAt, navigationSeed, spawnedEntries);
2124
+ if (navigationSeed.treeDivergedFromBase && // A head-only request uses the MetadataOnlyRequestTree stub rather than
2125
+ // a tree derived from the route entry, so divergence from it carries
2126
+ // no signal.
2127
+ // TODO: This special case goes away once convertServerPatchToFullTree
2128
+ // diffs against the base RouteTree (route.tree) instead of the
2129
+ // request tree.
2130
+ dynamicRequestTree !== MetadataOnlyRequestTree) {
2131
+ // The server rendered a different route tree than the one we requested:
2132
+ // the URL has a rewrite that behaves dynamically, so the params baked
2133
+ // into the request are wrong and the server can never fulfill it. Mark
2134
+ // the route entry — which doubles as the stored prediction pattern, so
2135
+ // this also disables a bad prediction (see matchKnownRoute) that would
2136
+ // otherwise be re-derived on every retry — and invalidate entries that
2137
+ // were derived from it. This mirrors dispatchRetryDueToTreeMismatch on
2138
+ // the navigation path. It can't loop: the refetched route entry is
2139
+ // built from the server's response, so it only mismatches again if the
2140
+ // rewrite's behavior changes again.
2141
+ markRouteEntryAsDynamicRewrite(route);
2142
+ invalidateRouteCacheEntries(key.nextUrl, task.treeAtTimeOfPrefetch);
2143
+ // Reject with an immediate expiration instead of the usual backoff: the
2144
+ // invalidation above triggers a re-prefetch, which per the above does
2145
+ // not loop.
2146
+ // TODO: Consider also bounding retries with a counter on the task
2147
+ // object, so a prefetch that repeatedly fails to settle backs off
2148
+ // regardless of the reason.
2149
+ rejectSegmentEntriesIfStillPending(spawnedEntries, -1);
2150
+ return null;
2151
+ }
2152
+ // Aside from writing the data into the cache, this function also returns
2153
+ // the entries that were fulfilled, so we can streamingly update their sizes
2154
+ // in the LRU as more data comes in.
2155
+ fulfilledEntries = writeDynamicRenderResponseIntoCache(now, fetchStrategy, flightDatas, buildId, isResponsePartial, headVaryParams, rootVaryParamsIterable, staleAtForSpawnedEntries, navigationSeed, spawnedEntries, task.segmentCacheMap);
1490
2156
  // For buffered responses, update LRU sizes now that we know which
1491
2157
  // entries were fulfilled.
1492
2158
  if (bufferedResponseSize !== null && fulfilledEntries !== null && fulfilledEntries.length > 0) {
@@ -1502,11 +2168,23 @@ async function fetchSegmentPrefetchesUsingDynamicRequest(task, route, fetchStrat
1502
2168
  closed: closed.promise
1503
2169
  };
1504
2170
  } catch (error) {
2171
+ if (process.env.__NEXT_USE_OFFLINE) {
2172
+ const { checkOfflineError } = require('../offline');
2173
+ if (checkOfflineError(error)) {
2174
+ // Unlike navigations and server actions, prefetches don't await
2175
+ // waitForConnection — they just reject the cache entry with an
2176
+ // immediate expiration so it gets retried once the scheduler is
2177
+ // re-pinged after connectivity is restored.
2178
+ rejectSegmentEntriesIfStillPending(spawnedEntries, -1);
2179
+ return null;
2180
+ }
2181
+ }
1505
2182
  rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000);
1506
2183
  return null;
1507
2184
  }
1508
2185
  }
1509
- function writeDynamicTreeResponseIntoCache(now, fetchStrategy, response, serverData, entry, couldBeIntercepted, canonicalUrl, routeIsPPREnabled, headVaryParams, originalPathname, nextUrl) {
2186
+ function writeDynamicTreeResponseIntoCache(now, fetchStrategy, response, serverData, entry, couldBeIntercepted, canonicalUrl, routeIsPPREnabled, headVaryParams, rootVaryParamsIterable, originalPathname, originalSearch, nextUrl, // The spawning task's `PrefetchTask.segmentCacheMap`.
2187
+ map) {
1510
2188
  const renderedSearch = (0, _routeparams.getRenderedSearch)(response);
1511
2189
  const normalizedFlightDataResult = (0, _flightdatahelpers.normalizeFlightData)(serverData.f);
1512
2190
  if (// A string result means navigating to this route will result in an
@@ -1532,7 +2210,8 @@ function writeDynamicTreeResponseIntoCache(now, fetchStrategy, response, serverD
1532
2210
  // During this traversal, we accumulate additional data into this
1533
2211
  // "accumulator" object.
1534
2212
  const acc = {
1535
- metadataVaryPath: null
2213
+ metadataVaryPath: null,
2214
+ treeDivergedFromBase: false
1536
2215
  };
1537
2216
  const routeTree = convertRootFlightRouterStateToRouteTree(flightRouterState, renderedSearch, acc);
1538
2217
  const metadataVaryPath = acc.metadataVaryPath;
@@ -1540,7 +2219,7 @@ function writeDynamicTreeResponseIntoCache(now, fetchStrategy, response, serverD
1540
2219
  rejectRouteCacheEntry(entry, now + 10 * 1000);
1541
2220
  return;
1542
2221
  }
1543
- (0, _optimisticroutes.discoverKnownRoute)(now, originalPathname, nextUrl, entry, routeTree, metadataVaryPath, couldBeIntercepted, canonicalUrl, routeIsPPREnabled, false // hasDynamicRewrite
2222
+ (0, _optimisticroutes.discoverKnownRoute)(now, originalPathname, originalSearch, nextUrl, entry, routeTree, metadataVaryPath, couldBeIntercepted, canonicalUrl, routeIsPPREnabled, false // hasDynamicRewrite
1544
2223
  );
1545
2224
  // If the server sent segment data as part of the response, we should write
1546
2225
  // it into the cache to prevent a second, redundant prefetch request.
@@ -1549,20 +2228,25 @@ function writeDynamicTreeResponseIntoCache(now, fetchStrategy, response, serverD
1549
2228
  // can delete it. Leaving for a subsequent PR.
1550
2229
  const navigationSeed = (0, _navigation.convertServerPatchToFullTree)(now, flightRouterState, normalizedFlightDataResult, renderedSearch, _bfcache.UnknownDynamicStaleTime);
1551
2230
  const buildId = response.headers.get(_constants.NEXT_NAV_DEPLOYMENT_ID_HEADER) ?? serverData.b;
1552
- writeDynamicRenderResponseIntoCache(now, fetchStrategy, normalizedFlightDataResult, buildId, isResponsePartial, headVaryParams, getStaleAtFromHeader(now, response), navigationSeed, null);
2231
+ writeDynamicRenderResponseIntoCache(now, fetchStrategy, normalizedFlightDataResult, buildId, isResponsePartial, headVaryParams, rootVaryParamsIterable, getStaleAtFromHeader(now, response), navigationSeed, null, map);
1553
2232
  }
1554
2233
  function rejectSegmentEntriesIfStillPending(entries, staleAt) {
1555
2234
  const fulfilledEntries = [];
1556
2235
  for (const entry of entries.values()){
1557
- if (entry.status === 1) {
2236
+ if (entry.status === _cachemap.EntryStatus.Pending) {
1558
2237
  rejectSegmentCacheEntry(entry, staleAt);
1559
- } else if (entry.status === 2) {
2238
+ } else if (entry.status === _cachemap.EntryStatus.Fulfilled) {
1560
2239
  fulfilledEntries.push(entry);
1561
2240
  }
1562
2241
  }
1563
2242
  return fulfilledEntries;
1564
2243
  }
1565
- function writeDynamicRenderResponseIntoCache(now, fetchStrategy, flightDatas, buildId, isResponsePartial, headVaryParams, staleAt, navigationSeed, spawnedEntries) {
2244
+ function writeDynamicRenderResponseIntoCache(now, fetchStrategy, flightDatas, buildId, isResponsePartial, headVaryParams, rootVaryParamsIterable, staleAt, navigationSeed, spawnedEntries, // The map the work that spawned this response's request is bound to: the
2245
+ // spawning task's `PrefetchTask.segmentCacheMap` for prefetches, the
2246
+ // navigation's map for navigation-side writes. Binding the write to the
2247
+ // requesting work means a response that lands after a testing-lock scope
2248
+ // boundary still writes into the map its entries live in.
2249
+ map) {
1566
2250
  if (buildId && buildId !== (0, _navigationbuildid.getNavigationBuildId)()) {
1567
2251
  // The server build does not match the client. Treat as a 404. During
1568
2252
  // an actual navigation, the router will trigger an MPA navigation.
@@ -1587,8 +2271,9 @@ function writeDynamicRenderResponseIntoCache(now, fetchStrategy, flightDatas, bu
1587
2271
  let tree = routeTree;
1588
2272
  for(let i = 0; i < segmentPath.length; i += 2){
1589
2273
  const parallelRouteKey = segmentPath[i];
1590
- if (tree?.slots?.[parallelRouteKey] !== undefined) {
1591
- tree = tree.slots[parallelRouteKey];
2274
+ const childTree = tree?.slots?.get(parallelRouteKey);
2275
+ if (childTree !== undefined) {
2276
+ tree = childTree;
1592
2277
  } else {
1593
2278
  if (spawnedEntries !== null) {
1594
2279
  rejectSegmentEntriesIfStillPending(spawnedEntries, now + 10 * 1000);
@@ -1596,20 +2281,28 @@ function writeDynamicRenderResponseIntoCache(now, fetchStrategy, flightDatas, bu
1596
2281
  return null;
1597
2282
  }
1598
2283
  }
1599
- writeSeedDataIntoCache(now, fetchStrategy, tree, staleAt, seedData, isResponsePartial, spawnedEntries);
2284
+ writeSeedDataIntoCache(now, // A response write is bound to the map its entries live in (the
2285
+ // spawning task's `PrefetchTask.segmentCacheMap`).
2286
+ map, fetchStrategy, tree, staleAt, seedData, isResponsePartial, rootVaryParamsIterable, spawnedEntries);
1600
2287
  }
1601
2288
  const head = flightDataEntry.head;
1602
2289
  if (head !== null && metadataTree !== null) {
1603
- // When Cache Components is enabled, the server conservatively marks
1604
- // the head as partial during static generation (isPossiblyPartialHead
1605
- // in app-render.tsx), even for fully static pages where the head is
1606
- // actually complete. When the response is non-partial, we override
1607
- // this since the server confirmed no dynamic content exists.
2290
+ // When Cache Components is enabled, the server's `isHeadPartial` flag
2291
+ // (isPossiblyPartialHead in app-render.tsx) is unreliable: it's computed
2292
+ // before the head is serialized, so it's conservatively `true` for every
2293
+ // statically-generated PPR page — even pages whose head is actually
2294
+ // complete — and it's `false` for runtime/dynamic responses whose head is
2295
+ // actually partial (e.g. a route with an async `generateMetadata`). So we
2296
+ // ignore it and derive the head's partiality from whether the response
2297
+ // itself was partial, exactly as we do for segments (see
2298
+ // `writeSeedDataIntoCache`). A non-partial response carries a complete
2299
+ // head; a partial (postponed) one does not.
1608
2300
  //
1609
- // Without Cache Components, the server always sends the correct
1610
- // isHeadPartial value, so no override is needed.
1611
- const isHeadPartial = !isResponsePartial && process.env.__NEXT_CACHE_COMPONENTS ? false : flightDataEntry.isHeadPartial;
1612
- fulfillEntrySpawnedByRuntimePrefetch(now, fetchStrategy, head, isHeadPartial, staleAt, // For head entries, use the head-specific vary params passed as
2301
+ // Without Cache Components, the server sends the correct isHeadPartial.
2302
+ const isHeadPartial = process.env.__NEXT_CACHE_COMPONENTS ? isResponsePartial : flightDataEntry.isHeadPartial;
2303
+ fulfillEntrySpawnedByRuntimePrefetch(now, // A response write is bound to the map its entries live in (the
2304
+ // spawning task's `PrefetchTask.segmentCacheMap`).
2305
+ map, fetchStrategy, head, isHeadPartial, staleAt, // For head entries, use the head-specific vary params passed as
1613
2306
  // parameter.
1614
2307
  headVaryParams, metadataTree, spawnedEntries);
1615
2308
  }
@@ -1628,64 +2321,117 @@ function writeDynamicRenderResponseIntoCache(now, fetchStrategy, flightDatas, bu
1628
2321
  }
1629
2322
  return null;
1630
2323
  }
1631
- function writeSeedDataIntoCache(now, fetchStrategy, tree, staleAt, seedData, isResponsePartial, entriesOwnedByCurrentTask) {
2324
+ function writeSeedDataIntoCache(now, map, fetchStrategy, tree, staleAt, seedData, isResponsePartial, rootVaryParamsIterable, entriesOwnedByCurrentTask) {
1632
2325
  // This function is used to write the result of a runtime server request
1633
2326
  // (CacheNodeSeedData) into the prefetch cache.
1634
2327
  const rsc = seedData[0];
1635
2328
  const isPartial = rsc === null || isResponsePartial;
1636
- const varyParamsThenable = seedData[4];
1637
- // Each segment carries its own vary params thenable in the seed data. The
1638
- // thenable resolves to the set of params the segment accessed during render.
1639
- // A null thenable means tracking was not enabled (not a prerender).
1640
- const varyParams = varyParamsThenable !== null ? (0, _varyparamsdecoding.readVaryParams)(varyParamsThenable) : null;
1641
- fulfillEntrySpawnedByRuntimePrefetch(now, fetchStrategy, rsc, isPartial, staleAt, varyParams, tree, entriesOwnedByCurrentTask);
2329
+ // Each segment carries its own vary params iterable in the seed data, which
2330
+ // drains to the set of params the segment accessed during render. A null
2331
+ // iterable means tracking was not enabled (not a prerender). readVaryParams
2332
+ // unions in the response-level root params.
2333
+ const varyParams = (0, _varyparamsdecoding.readVaryParams)(seedData[4], rootVaryParamsIterable);
2334
+ fulfillEntrySpawnedByRuntimePrefetch(now, // A response write is bound to the map its entries live in (the spawning
2335
+ // task's `PrefetchTask.segmentCacheMap`).
2336
+ map, fetchStrategy, rsc, isPartial, staleAt, varyParams, tree, entriesOwnedByCurrentTask);
1642
2337
  // Recursively write the child data into the cache.
1643
2338
  const slots = tree.slots;
1644
2339
  if (slots !== null) {
1645
2340
  const seedDataChildren = seedData[1];
1646
- for(const parallelRouteKey in slots){
1647
- const childTree = slots[parallelRouteKey];
2341
+ for (const [parallelRouteKey, childTree] of slots){
1648
2342
  const childSeedData = seedDataChildren[parallelRouteKey];
1649
2343
  if (childSeedData !== null && childSeedData !== undefined) {
1650
- writeSeedDataIntoCache(now, fetchStrategy, childTree, staleAt, childSeedData, isResponsePartial, entriesOwnedByCurrentTask);
2344
+ writeSeedDataIntoCache(now, map, fetchStrategy, childTree, staleAt, childSeedData, isResponsePartial, rootVaryParamsIterable, entriesOwnedByCurrentTask);
1651
2345
  }
1652
2346
  }
1653
2347
  }
1654
2348
  }
1655
- function fulfillEntrySpawnedByRuntimePrefetch(now, fetchStrategy, rsc, isPartial, staleAt, segmentVaryParams, tree, entriesOwnedByCurrentTask) {
2349
+ function fulfillEntrySpawnedByRuntimePrefetch(now, map, fetchStrategy, rsc, isPartial, staleAt, segmentVaryParams, tree, entriesOwnedByCurrentTask) {
2350
+ // Decide whether to re-key the entry under a more generic vary path based on
2351
+ // which params the segment actually depends on.
2352
+ //
2353
+ // Skip re-keying for Full prefetches: as of today, `varyParams` tracking only
2354
+ // works within the static stage portion of a response. A Full prefetch
2355
+ // response covers all stages, and we can't track params during the dynamic
2356
+ // stage without dead-locking the Flight stream, so the server-reported set is
2357
+ // incomplete and can't be trusted for the full response. Re-keying with an
2358
+ // untrustworthy set could replace concrete params with Fallback and let
2359
+ // unrelated URLs read each other's content from the cache.
2360
+ //
2361
+ // For RuntimeShell prefetches, always re-key to the precomputed shell vary
2362
+ // path. A shell entry is spawned at a concrete param path but is reusable
2363
+ // across all of them; tree.shellVaryPath (root-param values kept, every other
2364
+ // param replaced with Fallback) is exactly the path that shell reads look it
2365
+ // up under.
2366
+ let fulfilledVaryPath = null;
2367
+ if (process.env.__NEXT_VARY_PARAMS) {
2368
+ if (fetchStrategy === _types.FetchStrategy.RuntimeShell) {
2369
+ fulfilledVaryPath = tree.shellVaryPath;
2370
+ } else if (fetchStrategy !== _types.FetchStrategy.Full && segmentVaryParams !== null) {
2371
+ fulfilledVaryPath = (0, _varypath.getFulfilledSegmentVaryPath)(tree.varyPath, segmentVaryParams);
2372
+ }
2373
+ }
1656
2374
  // We should only write into cache entries that are owned by us. Or create
1657
2375
  // a new one and write into that. We must never write over an entry that was
1658
2376
  // created by a different task, because that causes data races.
1659
2377
  const ownedEntry = entriesOwnedByCurrentTask !== null ? entriesOwnedByCurrentTask.get(tree.requestKey) : undefined;
1660
2378
  if (ownedEntry !== undefined) {
1661
- const fulfilledEntry = fulfillSegmentCacheEntry(ownedEntry, rsc, staleAt, isPartial);
1662
- // Re-key the entry based on which params the segment actually depends on.
1663
- if (process.env.__NEXT_VARY_PARAMS && segmentVaryParams !== null) {
1664
- const fulfilledVaryPath = (0, _varypath.getFulfilledSegmentVaryPath)(tree.varyPath, segmentVaryParams);
2379
+ const fulfilledEntry = fulfillSegmentCacheEntry(ownedEntry, rsc, staleAt, isPartial, // Dynamic-request (Full/Runtime) responses are not ISR fallbacks.
2380
+ false, fetchStrategy);
2381
+ // Re-key the entry at its canonical path. When `varyParams` produced a
2382
+ // generalized path above, use that; otherwise fall back to the request's
2383
+ // own keying (this is load-bearing for entries spawned as revalidations:
2384
+ // without the re-key they'd stay in their Revalidation slot forever,
2385
+ // invisible to canonical reads, and the partial entry that prompted the
2386
+ // revalidation would keep serving navigations). Full responses are
2387
+ // excluded, matching the varyParams re-key: they're spawned as canonical
2388
+ // entries at their final path, and their vary tracking can't be trusted
2389
+ // for re-keying (see the fulfilledVaryPath derivation above).
2390
+ const canonicalVaryPath = fulfilledVaryPath !== null ? fulfilledVaryPath : fetchStrategy !== _types.FetchStrategy.Full ? (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree) : null;
2391
+ if (canonicalVaryPath !== null) {
1665
2392
  const isRevalidation = false;
1666
- (0, _cachemap.setInCacheMap)(segmentCacheMap, fulfilledVaryPath, fulfilledEntry, isRevalidation);
2393
+ (0, _cachemap.setInCacheMap)(map, canonicalVaryPath, fulfilledEntry, isRevalidation);
2394
+ // The re-key moved the entry to a more generic path (and, for a spawned
2395
+ // revalidation, vacated its Revalidation slot). A stale settled entry
2396
+ // at a more specific path — e.g. the partial entry that prompted the
2397
+ // revalidation — would shadow every read at the concrete lookup path,
2398
+ // causing the scheduler to keep re-reading the stale entry and respawn
2399
+ // the revalidation forever. Evict it so the fulfilled entry is
2400
+ // reachable. See evictShadowingSegmentEntries.
2401
+ evictShadowingSegmentEntries(now, map, tree.varyPath, fulfilledEntry);
1667
2402
  }
1668
2403
  } else {
1669
2404
  // There's no matching entry. Attempt to create a new one.
1670
- const possiblyNewEntry = readOrCreateSegmentCacheEntry(now, fetchStrategy, tree);
1671
- if (possiblyNewEntry.status === 0) {
2405
+ let possiblyNewEntry = (0, _cachemap.getFromCacheMap)(now, getCurrentSegmentCacheVersion(), map, tree.varyPath, false, false);
2406
+ if (possiblyNewEntry === null) {
2407
+ possiblyNewEntry = insertEmptySegmentCacheEntry(now, map, fetchStrategy, tree);
2408
+ }
2409
+ if (possiblyNewEntry.status === _cachemap.EntryStatus.Empty) {
1672
2410
  // Confirmed this is a new entry. We can fulfill it.
1673
2411
  const newEntry = possiblyNewEntry;
1674
- const fulfilledEntry = fulfillSegmentCacheEntry(upgradeToPendingSegment(newEntry, fetchStrategy), rsc, staleAt, isPartial);
1675
- // Re-key the entry based on which params the segment actually depends on.
1676
- if (process.env.__NEXT_VARY_PARAMS && segmentVaryParams !== null) {
1677
- const fulfilledVaryPath = (0, _varypath.getFulfilledSegmentVaryPath)(tree.varyPath, segmentVaryParams);
2412
+ const fulfilledEntry = fulfillSegmentCacheEntry(upgradeToPendingSegment(newEntry, fetchStrategy), rsc, staleAt, isPartial, // Dynamic-request (Full/Runtime) responses are not ISR fallbacks.
2413
+ false, fetchStrategy);
2414
+ if (fulfilledVaryPath !== null) {
1678
2415
  const isRevalidation = false;
1679
- (0, _cachemap.setInCacheMap)(segmentCacheMap, fulfilledVaryPath, fulfilledEntry, isRevalidation);
2416
+ (0, _cachemap.setInCacheMap)(map, fulfilledVaryPath, fulfilledEntry, isRevalidation);
2417
+ // Same as the owned-entry re-key above. Usually the entry really is
2418
+ // new — the read a moment ago returned nothing at the concrete lookup
2419
+ // path, so nothing can shadow it and this is a no-op — but this
2420
+ // branch also claims a pre-existing Empty entry, and re-keying that
2421
+ // away can expose a stale settled entry at an intermediate path.
2422
+ evictShadowingSegmentEntries(now, map, tree.varyPath, fulfilledEntry);
1680
2423
  }
1681
2424
  } else {
1682
2425
  // There was already an entry in the cache. But we may be able to
1683
2426
  // replace it with the new one from the server.
1684
- const newEntry = fulfillSegmentCacheEntry(upgradeToPendingSegment(createDetachedSegmentCacheEntry(now), fetchStrategy), rsc, staleAt, isPartial);
1685
- // Use the fulfilled vary path if available, otherwise fall back to
1686
- // the request vary path.
1687
- const varyPath = process.env.__NEXT_VARY_PARAMS && segmentVaryParams !== null ? (0, _varypath.getFulfilledSegmentVaryPath)(tree.varyPath, segmentVaryParams) : (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
1688
- upsertSegmentEntry(now, varyPath, newEntry);
2427
+ const newEntry = fulfillSegmentCacheEntry(upgradeToPendingSegment(createDetachedSegmentCacheEntry(now), fetchStrategy), rsc, staleAt, isPartial, // Dynamic-request (Full/Runtime) responses are not ISR fallbacks.
2428
+ false, fetchStrategy);
2429
+ const varyPath = fulfilledVaryPath !== null ? fulfilledVaryPath : (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
2430
+ // Pass the concrete lookup path so that if the entry was re-keyed to
2431
+ // a more generic path, any stale settled entry at a more specific path
2432
+ // that would shadow it is evicted (the upsert handles this; the other
2433
+ // branches above call evictShadowingSegmentEntries themselves).
2434
+ upsertSegmentEntry(now, map, varyPath, newEntry, tree.varyPath);
1689
2435
  }
1690
2436
  }
1691
2437
  }
@@ -1715,7 +2461,7 @@ async function fetchPrefetchResponse(url, headers) {
1715
2461
  }
1716
2462
  return response;
1717
2463
  }
1718
- async function createNonTaskyPrefetchResponseStream(body) {
2464
+ async function createNonTaskyPrefetchResponseStream(body, byteLimit) {
1719
2465
  // Buffer the entire response before passing it to the Flight client. This
1720
2466
  // ensures that when Flight processes the stream, all model data is available
1721
2467
  // synchronously. This is important for readVaryParams, which synchronously
@@ -1727,13 +2473,22 @@ async function createNonTaskyPrefetchResponseStream(body) {
1727
2473
  // These could all be consolidated into a single transformation. Refactor
1728
2474
  // once the cached navigations experiment lands.
1729
2475
  //
1730
- // Read the entire response from the network.
2476
+ // Read the response from the network, optionally truncating at byteLimit.
1731
2477
  const reader = body.getReader();
1732
2478
  const chunks = [];
1733
2479
  let size = 0;
1734
2480
  while(true){
1735
2481
  const { done, value } = await reader.read();
1736
2482
  if (done) break;
2483
+ if (byteLimit !== undefined && size + value.byteLength >= byteLimit) {
2484
+ const remaining = byteLimit - size;
2485
+ if (remaining > 0) {
2486
+ chunks.push(value.byteLength > remaining ? value.subarray(0, remaining) : value);
2487
+ size += remaining;
2488
+ }
2489
+ reader.cancel();
2490
+ break;
2491
+ }
1737
2492
  chunks.push(value);
1738
2493
  size += value.byteLength;
1739
2494
  }
@@ -1767,7 +2522,8 @@ async function createNonTaskyPrefetchResponseStream(body) {
1767
2522
  });
1768
2523
  return {
1769
2524
  stream,
1770
- size
2525
+ size,
2526
+ buffer
1771
2527
  };
1772
2528
  }
1773
2529
  /**
@@ -1816,23 +2572,12 @@ function addSegmentPathToUrlInOutputExportMode(url, segmentPath) {
1816
2572
  function canNewFetchStrategyProvideMoreContent(currentStrategy, newStrategy) {
1817
2573
  return currentStrategy < newStrategy;
1818
2574
  }
1819
- /**
1820
- * Adds the instant prefetch header if the navigation lock is active.
1821
- * Uses a lazy require to ensure dead code elimination.
1822
- */ function addInstantPrefetchHeaderIfLocked(headers) {
1823
- if (process.env.__NEXT_EXPOSE_TESTING_API) {
1824
- const { isNavigationLocked } = require('./navigation-testing-lock');
1825
- if (isNavigationLocked()) {
1826
- headers[_approuterheaders.NEXT_INSTANT_PREFETCH_HEADER] = '1';
1827
- }
1828
- }
1829
- }
1830
2575
  function getStaleAtFromHeader(now, response) {
1831
2576
  const staleTimeSeconds = parseInt(response.headers.get(_approuterheaders.NEXT_ROUTER_STALE_TIME_HEADER) ?? '', 10);
1832
2577
  const staleTimeMs = !isNaN(staleTimeSeconds) ? getStaleTimeMs(staleTimeSeconds) : _navigatereducer.STATIC_STALETIME_MS;
1833
2578
  return now + staleTimeMs;
1834
2579
  }
1835
- async function getStaleAt(now, staleTimeIterable, response) {
2580
+ async function resolveStaleAt(now, staleTimeIterable, response) {
1836
2581
  if (staleTimeIterable !== undefined) {
1837
2582
  // Iterate the async iterable and take the last yielded value. The server
1838
2583
  // yields updated staleTime values during the render; the last one is the
@@ -1851,25 +2596,30 @@ async function getStaleAt(now, staleTimeIterable, response) {
1851
2596
  }
1852
2597
  return now + _navigatereducer.STATIC_STALETIME_MS;
1853
2598
  }
1854
- function writeStaticStageResponseIntoCache(now, flightData, buildId, headVaryParamsThenable, staleAt, baseTree, renderedSearch, isResponsePartial) {
1855
- const fetchStrategy = isResponsePartial ? _types.FetchStrategy.PPR : _types.FetchStrategy.Full;
1856
- const headVaryParams = headVaryParamsThenable !== null ? (0, _varyparamsdecoding.readVaryParams)(headVaryParamsThenable) : null;
2599
+ function writePrerenderResponseIntoCache(now, fetchStrategy, flightData, buildId, headVaryParamsIterable, rootVaryParamsIterable, staleAt, baseTree, renderedSearch, isResponsePartial, // The map the work that spawned this response's request is bound to. See
2600
+ // writeDynamicRenderResponseIntoCache.
2601
+ map) {
2602
+ // Root params are emitted once at the top level; readVaryParams unions them
2603
+ // into the head, and they're threaded down to each segment below.
2604
+ const headVaryParams = (0, _varyparamsdecoding.readVaryParams)(headVaryParamsIterable, rootVaryParamsIterable);
1857
2605
  const flightDatas = (0, _flightdatahelpers.normalizeFlightData)(flightData);
1858
2606
  if (typeof flightDatas === 'string') {
1859
2607
  return;
1860
2608
  }
1861
2609
  const navigationSeed = (0, _navigation.convertServerPatchToFullTree)(now, baseTree, flightDatas, renderedSearch, _bfcache.UnknownDynamicStaleTime);
1862
- writeDynamicRenderResponseIntoCache(now, fetchStrategy, flightDatas, buildId, isResponsePartial, headVaryParams, staleAt, navigationSeed, null // spawnedEntries — no pre-created entries; will create or upsert
1863
- );
2610
+ writeDynamicRenderResponseIntoCache(now, fetchStrategy, flightDatas, buildId, isResponsePartial, headVaryParams, rootVaryParamsIterable, staleAt, navigationSeed, null, map);
1864
2611
  }
1865
2612
  async function processRuntimePrefetchStream(now, runtimePrefetchStream, baseTree, renderedSearch) {
1866
2613
  const { stream, isPartial } = await stripIsPartialByte(runtimePrefetchStream);
1867
2614
  const serverData = await (0, _fetchserverresponse.createFromNextReadableStream)(stream, undefined, {
1868
2615
  allowPartialStream: true
1869
2616
  });
1870
- const headVaryParamsThenable = serverData.h;
1871
- const headVaryParams = headVaryParamsThenable !== null ? (0, _varyparamsdecoding.readVaryParams)(headVaryParamsThenable) : null;
1872
- const staleAt = await getStaleAt(now, serverData.s);
2617
+ // Root params are emitted once at the top level; readVaryParams unions them
2618
+ // into the head, and we return the iterable so the caller can union it into
2619
+ // each segment too.
2620
+ const rootVaryParamsIterable = serverData.r ?? null;
2621
+ const headVaryParams = (0, _varyparamsdecoding.readVaryParams)(serverData.h, rootVaryParamsIterable);
2622
+ const staleAt = await resolveStaleAt(now, serverData.s);
1873
2623
  const flightDatas = (0, _flightdatahelpers.normalizeFlightData)(serverData.f);
1874
2624
  if (typeof flightDatas === 'string') {
1875
2625
  return null;
@@ -1881,6 +2631,7 @@ async function processRuntimePrefetchStream(now, runtimePrefetchStream, baseTree
1881
2631
  buildId: serverData.b,
1882
2632
  isResponsePartial: isPartial,
1883
2633
  headVaryParams,
2634
+ rootVaryParamsIterable,
1884
2635
  staleAt
1885
2636
  };
1886
2637
  }