vinext 0.0.30 → 0.0.31

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 (435) hide show
  1. package/README.md +12 -6
  2. package/dist/build/prerender.d.ts +188 -0
  3. package/dist/build/prerender.js +675 -0
  4. package/dist/build/prerender.js.map +1 -0
  5. package/dist/build/report.d.ts +45 -46
  6. package/dist/build/report.js +247 -276
  7. package/dist/build/report.js.map +1 -1
  8. package/dist/build/run-prerender.d.ts +62 -0
  9. package/dist/build/run-prerender.js +183 -0
  10. package/dist/build/run-prerender.js.map +1 -0
  11. package/dist/build/server-manifest.d.ts +19 -0
  12. package/dist/build/server-manifest.js +29 -0
  13. package/dist/build/server-manifest.js.map +1 -0
  14. package/dist/build/static-export.d.ts +51 -66
  15. package/dist/build/static-export.js +51 -545
  16. package/dist/build/static-export.js.map +1 -1
  17. package/dist/check.d.ts +26 -24
  18. package/dist/check.js +591 -571
  19. package/dist/check.js.map +1 -1
  20. package/dist/cli.d.ts +1 -15
  21. package/dist/cli.js +430 -491
  22. package/dist/cli.js.map +1 -1
  23. package/dist/client/entry.d.ts +1 -2
  24. package/dist/client/entry.js +49 -62
  25. package/dist/client/entry.js.map +1 -1
  26. package/dist/client/validate-module-path.d.ts +4 -1
  27. package/dist/client/validate-module-path.js +23 -28
  28. package/dist/client/validate-module-path.js.map +1 -1
  29. package/dist/client/vinext-next-data.d.ts +15 -20
  30. package/dist/client/vinext-next-data.js +0 -1
  31. package/dist/cloudflare/index.d.ts +3 -8
  32. package/dist/cloudflare/index.js +3 -8
  33. package/dist/cloudflare/kv-cache-handler.d.ts +95 -105
  34. package/dist/cloudflare/kv-cache-handler.js +354 -380
  35. package/dist/cloudflare/kv-cache-handler.js.map +1 -1
  36. package/dist/cloudflare/tpr.d.ts +36 -34
  37. package/dist/cloudflare/tpr.js +460 -603
  38. package/dist/cloudflare/tpr.js.map +1 -1
  39. package/dist/config/config-matchers.d.ts +31 -40
  40. package/dist/config/config-matchers.js +727 -936
  41. package/dist/config/config-matchers.js.map +1 -1
  42. package/dist/config/dotenv.d.ts +18 -11
  43. package/dist/config/dotenv.js +79 -84
  44. package/dist/config/dotenv.js.map +1 -1
  45. package/dist/config/next-config.d.ts +156 -146
  46. package/dist/config/next-config.js +374 -464
  47. package/dist/config/next-config.js.map +1 -1
  48. package/dist/deploy.d.ts +87 -96
  49. package/dist/deploy.js +490 -628
  50. package/dist/deploy.js.map +1 -1
  51. package/dist/entries/app-browser-entry.d.ts +4 -1
  52. package/dist/entries/app-browser-entry.js +12 -8
  53. package/dist/entries/app-browser-entry.js.map +1 -1
  54. package/dist/entries/app-rsc-entry.d.ts +33 -20
  55. package/dist/entries/app-rsc-entry.js +442 -211
  56. package/dist/entries/app-rsc-entry.js.map +1 -1
  57. package/dist/entries/app-ssr-entry.d.ts +9 -1
  58. package/dist/entries/app-ssr-entry.js +61 -28
  59. package/dist/entries/app-ssr-entry.js.map +1 -1
  60. package/dist/entries/pages-client-entry.d.ts +6 -2
  61. package/dist/entries/pages-client-entry.js +30 -33
  62. package/dist/entries/pages-client-entry.js.map +1 -1
  63. package/dist/entries/pages-entry-helpers.d.ts +5 -1
  64. package/dist/entries/pages-entry-helpers.js +17 -14
  65. package/dist/entries/pages-entry-helpers.js.map +1 -1
  66. package/dist/entries/pages-server-entry.d.ts +6 -2
  67. package/dist/entries/pages-server-entry.js +84 -113
  68. package/dist/entries/pages-server-entry.js.map +1 -1
  69. package/dist/index.d.ts +82 -62
  70. package/dist/index.js +2172 -3133
  71. package/dist/index.js.map +1 -1
  72. package/dist/init.d.ts +40 -37
  73. package/dist/init.js +201 -258
  74. package/dist/init.js.map +1 -1
  75. package/dist/plugins/async-hooks-stub.d.ts +7 -3
  76. package/dist/plugins/async-hooks-stub.js +39 -42
  77. package/dist/plugins/async-hooks-stub.js.map +1 -1
  78. package/dist/plugins/client-reference-dedup.d.ts +7 -3
  79. package/dist/plugins/client-reference-dedup.js +63 -88
  80. package/dist/plugins/client-reference-dedup.js.map +1 -1
  81. package/dist/routing/app-router.d.ts +100 -96
  82. package/dist/routing/app-router.js +560 -670
  83. package/dist/routing/app-router.js.map +1 -1
  84. package/dist/routing/file-matcher.d.ts +18 -15
  85. package/dist/routing/file-matcher.js +65 -65
  86. package/dist/routing/file-matcher.js.map +1 -1
  87. package/dist/routing/pages-router.d.ts +23 -24
  88. package/dist/routing/pages-router.js +147 -172
  89. package/dist/routing/pages-router.js.map +1 -1
  90. package/dist/routing/route-trie.d.ts +23 -20
  91. package/dist/routing/route-trie.js +131 -151
  92. package/dist/routing/route-trie.js.map +1 -1
  93. package/dist/routing/route-validation.d.ts +5 -2
  94. package/dist/routing/route-validation.js +98 -130
  95. package/dist/routing/route-validation.js.map +1 -1
  96. package/dist/routing/utils.d.ts +10 -7
  97. package/dist/routing/utils.js +75 -111
  98. package/dist/routing/utils.js.map +1 -1
  99. package/dist/server/api-handler.d.ts +8 -13
  100. package/dist/server/api-handler.js +161 -193
  101. package/dist/server/api-handler.js.map +1 -1
  102. package/dist/server/app-router-entry.d.ts +6 -16
  103. package/dist/server/app-router-entry.js +26 -54
  104. package/dist/server/app-router-entry.js.map +1 -1
  105. package/dist/server/dev-module-runner.d.ts +11 -64
  106. package/dist/server/dev-module-runner.js +89 -101
  107. package/dist/server/dev-module-runner.js.map +1 -1
  108. package/dist/server/dev-origin-check.d.ts +12 -10
  109. package/dist/server/dev-origin-check.js +98 -108
  110. package/dist/server/dev-origin-check.js.map +1 -1
  111. package/dist/server/dev-server.d.ts +17 -14
  112. package/dist/server/dev-server.js +542 -869
  113. package/dist/server/dev-server.js.map +1 -1
  114. package/dist/server/html.d.ts +4 -1
  115. package/dist/server/html.js +25 -26
  116. package/dist/server/html.js.map +1 -1
  117. package/dist/server/image-optimization.d.ts +31 -28
  118. package/dist/server/image-optimization.js +181 -210
  119. package/dist/server/image-optimization.js.map +1 -1
  120. package/dist/server/instrumentation.d.ts +25 -22
  121. package/dist/server/instrumentation.js +110 -122
  122. package/dist/server/instrumentation.js.map +1 -1
  123. package/dist/server/isr-cache.d.ts +16 -26
  124. package/dist/server/isr-cache.js +106 -128
  125. package/dist/server/isr-cache.js.map +1 -1
  126. package/dist/server/metadata-routes.d.ts +85 -88
  127. package/dist/server/metadata-routes.js +270 -317
  128. package/dist/server/metadata-routes.js.map +1 -1
  129. package/dist/server/middleware-codegen.d.ts +7 -4
  130. package/dist/server/middleware-codegen.js +61 -61
  131. package/dist/server/middleware-codegen.js.map +1 -1
  132. package/dist/server/middleware-request-headers.d.ts +8 -6
  133. package/dist/server/middleware-request-headers.js +47 -65
  134. package/dist/server/middleware-request-headers.js.map +1 -1
  135. package/dist/server/middleware.d.ts +31 -47
  136. package/dist/server/middleware.js +273 -404
  137. package/dist/server/middleware.js.map +1 -1
  138. package/dist/server/normalize-path.d.ts +4 -1
  139. package/dist/server/normalize-path.js +33 -47
  140. package/dist/server/normalize-path.js.map +1 -1
  141. package/dist/server/pages-i18n.d.ts +38 -30
  142. package/dist/server/pages-i18n.js +112 -139
  143. package/dist/server/pages-i18n.js.map +1 -1
  144. package/dist/server/prod-server.d.ts +19 -31
  145. package/dist/server/prod-server.js +714 -945
  146. package/dist/server/prod-server.js.map +1 -1
  147. package/dist/server/request-log.d.ts +18 -12
  148. package/dist/server/request-log.js +45 -52
  149. package/dist/server/request-log.js.map +1 -1
  150. package/dist/server/request-pipeline.d.ts +9 -17
  151. package/dist/server/request-pipeline.js +133 -184
  152. package/dist/server/request-pipeline.js.map +1 -1
  153. package/dist/server/worker-utils.d.ts +4 -1
  154. package/dist/server/worker-utils.js +31 -37
  155. package/dist/server/worker-utils.js.map +1 -1
  156. package/dist/shims/amp.d.ts +5 -2
  157. package/dist/shims/amp.js +19 -15
  158. package/dist/shims/amp.js.map +1 -1
  159. package/dist/shims/app.d.ts +8 -10
  160. package/dist/shims/app.js +0 -1
  161. package/dist/shims/cache-runtime.d.ts +20 -45
  162. package/dist/shims/cache-runtime.js +271 -422
  163. package/dist/shims/cache-runtime.js.map +1 -1
  164. package/dist/shims/cache.d.ts +130 -121
  165. package/dist/shims/cache.js +339 -427
  166. package/dist/shims/cache.js.map +1 -1
  167. package/dist/shims/client-only.d.ts +1 -18
  168. package/dist/shims/client-only.js +0 -17
  169. package/dist/shims/compat-router.d.ts +4 -1
  170. package/dist/shims/compat-router.js +23 -19
  171. package/dist/shims/compat-router.js.map +1 -1
  172. package/dist/shims/config.d.ts +7 -5
  173. package/dist/shims/config.js +16 -23
  174. package/dist/shims/config.js.map +1 -1
  175. package/dist/shims/constants.d.ts +119 -118
  176. package/dist/shims/constants.js +159 -164
  177. package/dist/shims/constants.js.map +1 -1
  178. package/dist/shims/document.d.ts +20 -16
  179. package/dist/shims/document.js +41 -22
  180. package/dist/shims/document.js.map +1 -1
  181. package/dist/shims/dynamic.d.ts +13 -22
  182. package/dist/shims/dynamic.js +122 -136
  183. package/dist/shims/dynamic.js.map +1 -1
  184. package/dist/shims/error-boundary.d.ts +22 -15
  185. package/dist/shims/error-boundary.js +81 -79
  186. package/dist/shims/error-boundary.js.map +1 -1
  187. package/dist/shims/error.d.ts +11 -12
  188. package/dist/shims/error.js +35 -39
  189. package/dist/shims/error.js.map +1 -1
  190. package/dist/shims/fetch-cache.d.ts +16 -14
  191. package/dist/shims/fetch-cache.js +437 -645
  192. package/dist/shims/fetch-cache.js.map +1 -1
  193. package/dist/shims/font-google-base.d.ts +28 -26
  194. package/dist/shims/font-google-base.js +238 -325
  195. package/dist/shims/font-google-base.js.map +1 -1
  196. package/dist/shims/font-google.d.ts +3 -3
  197. package/dist/shims/font-google.generated.d.ts +1928 -1924
  198. package/dist/shims/font-google.generated.js +1928 -2133
  199. package/dist/shims/font-google.generated.js.map +1 -1
  200. package/dist/shims/font-google.js +3 -3
  201. package/dist/shims/font-local.d.ts +28 -26
  202. package/dist/shims/font-local.js +204 -260
  203. package/dist/shims/font-local.js.map +1 -1
  204. package/dist/shims/form.d.ts +13 -27
  205. package/dist/shims/form.js +128 -180
  206. package/dist/shims/form.js.map +1 -1
  207. package/dist/shims/head-state.d.ts +8 -13
  208. package/dist/shims/head-state.js +25 -42
  209. package/dist/shims/head-state.js.map +1 -1
  210. package/dist/shims/head.d.ts +16 -20
  211. package/dist/shims/head.js +172 -250
  212. package/dist/shims/head.js.map +1 -1
  213. package/dist/shims/headers.d.ts +84 -78
  214. package/dist/shims/headers.js +447 -575
  215. package/dist/shims/headers.js.map +1 -1
  216. package/dist/shims/i18n-context.d.ts +16 -20
  217. package/dist/shims/i18n-context.js +35 -48
  218. package/dist/shims/i18n-context.js.map +1 -1
  219. package/dist/shims/i18n-state.d.ts +8 -14
  220. package/dist/shims/i18n-state.js +34 -42
  221. package/dist/shims/i18n-state.js.map +1 -1
  222. package/dist/shims/image-config.d.ts +11 -8
  223. package/dist/shims/image-config.js +50 -83
  224. package/dist/shims/image-config.js.map +1 -1
  225. package/dist/shims/image.d.ts +37 -46
  226. package/dist/shims/image.js +283 -308
  227. package/dist/shims/image.js.map +1 -1
  228. package/dist/shims/internal/api-utils.d.ts +7 -4
  229. package/dist/shims/internal/api-utils.js +0 -6
  230. package/dist/shims/internal/app-router-context.d.ts +22 -17
  231. package/dist/shims/internal/app-router-context.js +17 -13
  232. package/dist/shims/internal/app-router-context.js.map +1 -1
  233. package/dist/shims/internal/cookies.d.ts +2 -9
  234. package/dist/shims/internal/cookies.js +2 -9
  235. package/dist/shims/internal/parse-cookie-header.d.ts +4 -1
  236. package/dist/shims/internal/parse-cookie-header.js +29 -29
  237. package/dist/shims/internal/parse-cookie-header.js.map +1 -1
  238. package/dist/shims/internal/router-context.d.ts +6 -1
  239. package/dist/shims/internal/router-context.js +11 -7
  240. package/dist/shims/internal/router-context.js.map +1 -1
  241. package/dist/shims/internal/utils.d.ts +40 -37
  242. package/dist/shims/internal/utils.js +24 -30
  243. package/dist/shims/internal/utils.js.map +1 -1
  244. package/dist/shims/internal/work-unit-async-storage.d.ts +6 -10
  245. package/dist/shims/internal/work-unit-async-storage.js +14 -11
  246. package/dist/shims/internal/work-unit-async-storage.js.map +1 -1
  247. package/dist/shims/layout-segment-context.d.ts +11 -14
  248. package/dist/shims/layout-segment-context.js +24 -23
  249. package/dist/shims/layout-segment-context.js.map +1 -1
  250. package/dist/shims/legacy-image.d.ts +39 -46
  251. package/dist/shims/legacy-image.js +47 -42
  252. package/dist/shims/legacy-image.js.map +1 -1
  253. package/dist/shims/link.d.ts +32 -36
  254. package/dist/shims/link.js +255 -391
  255. package/dist/shims/link.js.map +1 -1
  256. package/dist/shims/metadata.d.ts +210 -202
  257. package/dist/shims/metadata.js +545 -546
  258. package/dist/shims/metadata.js.map +1 -1
  259. package/dist/shims/navigation-state.d.ts +10 -18
  260. package/dist/shims/navigation-state.js +66 -74
  261. package/dist/shims/navigation-state.js.map +1 -1
  262. package/dist/shims/navigation.d.ts +59 -63
  263. package/dist/shims/navigation.js +505 -704
  264. package/dist/shims/navigation.js.map +1 -1
  265. package/dist/shims/og.d.ts +2 -20
  266. package/dist/shims/og.js +2 -19
  267. package/dist/shims/readonly-url-search-params.d.ts +8 -5
  268. package/dist/shims/readonly-url-search-params.js +26 -22
  269. package/dist/shims/readonly-url-search-params.js.map +1 -1
  270. package/dist/shims/request-context.d.ts +8 -5
  271. package/dist/shims/request-context.js +50 -60
  272. package/dist/shims/request-context.js.map +1 -1
  273. package/dist/shims/request-state-types.d.ts +11 -11
  274. package/dist/shims/request-state-types.js +0 -1
  275. package/dist/shims/router-state.d.ts +13 -10
  276. package/dist/shims/router-state.js +34 -43
  277. package/dist/shims/router-state.js.map +1 -1
  278. package/dist/shims/router.d.ts +81 -85
  279. package/dist/shims/router.js +506 -628
  280. package/dist/shims/router.js.map +1 -1
  281. package/dist/shims/script.d.ts +39 -48
  282. package/dist/shims/script.js +107 -160
  283. package/dist/shims/script.js.map +1 -1
  284. package/dist/shims/server-only.d.ts +1 -19
  285. package/dist/shims/server-only.js +0 -18
  286. package/dist/shims/server.d.ts +175 -164
  287. package/dist/shims/server.js +462 -478
  288. package/dist/shims/server.js.map +1 -1
  289. package/dist/shims/unified-request-context.d.ts +20 -20
  290. package/dist/shims/unified-request-context.js +81 -99
  291. package/dist/shims/unified-request-context.js.map +1 -1
  292. package/dist/shims/url-safety.d.ts +4 -1
  293. package/dist/shims/url-safety.js +15 -11
  294. package/dist/shims/url-safety.js.map +1 -1
  295. package/dist/shims/url-utils.d.ts +8 -5
  296. package/dist/shims/url-utils.js +62 -93
  297. package/dist/shims/url-utils.js.map +1 -1
  298. package/dist/shims/web-vitals.d.ts +10 -8
  299. package/dist/shims/web-vitals.js +9 -15
  300. package/dist/shims/web-vitals.js.map +1 -1
  301. package/dist/utils/base-path.d.ts +5 -2
  302. package/dist/utils/base-path.js +21 -19
  303. package/dist/utils/base-path.js.map +1 -1
  304. package/dist/utils/domain-locale.d.ts +17 -9
  305. package/dist/utils/domain-locale.js +36 -56
  306. package/dist/utils/domain-locale.js.map +1 -1
  307. package/dist/utils/hash.d.ts +4 -1
  308. package/dist/utils/hash.js +19 -17
  309. package/dist/utils/hash.js.map +1 -1
  310. package/dist/utils/manifest-paths.d.ts +6 -3
  311. package/dist/utils/manifest-paths.js +15 -16
  312. package/dist/utils/manifest-paths.js.map +1 -1
  313. package/dist/utils/project.d.ts +13 -11
  314. package/dist/utils/project.js +169 -216
  315. package/dist/utils/project.js.map +1 -1
  316. package/dist/utils/query.d.ts +8 -6
  317. package/dist/utils/query.js +57 -67
  318. package/dist/utils/query.js.map +1 -1
  319. package/package.json +10 -9
  320. package/dist/build/report.d.ts.map +0 -1
  321. package/dist/build/static-export.d.ts.map +0 -1
  322. package/dist/check.d.ts.map +0 -1
  323. package/dist/cli.d.ts.map +0 -1
  324. package/dist/client/entry.d.ts.map +0 -1
  325. package/dist/client/validate-module-path.d.ts.map +0 -1
  326. package/dist/client/vinext-next-data.d.ts.map +0 -1
  327. package/dist/client/vinext-next-data.js.map +0 -1
  328. package/dist/cloudflare/index.d.ts.map +0 -1
  329. package/dist/cloudflare/index.js.map +0 -1
  330. package/dist/cloudflare/kv-cache-handler.d.ts.map +0 -1
  331. package/dist/cloudflare/tpr.d.ts.map +0 -1
  332. package/dist/config/config-matchers.d.ts.map +0 -1
  333. package/dist/config/dotenv.d.ts.map +0 -1
  334. package/dist/config/next-config.d.ts.map +0 -1
  335. package/dist/deploy.d.ts.map +0 -1
  336. package/dist/entries/app-browser-entry.d.ts.map +0 -1
  337. package/dist/entries/app-rsc-entry.d.ts.map +0 -1
  338. package/dist/entries/app-ssr-entry.d.ts.map +0 -1
  339. package/dist/entries/pages-client-entry.d.ts.map +0 -1
  340. package/dist/entries/pages-entry-helpers.d.ts.map +0 -1
  341. package/dist/entries/pages-server-entry.d.ts.map +0 -1
  342. package/dist/index.d.ts.map +0 -1
  343. package/dist/init.d.ts.map +0 -1
  344. package/dist/plugins/async-hooks-stub.d.ts.map +0 -1
  345. package/dist/plugins/client-reference-dedup.d.ts.map +0 -1
  346. package/dist/routing/app-router.d.ts.map +0 -1
  347. package/dist/routing/file-matcher.d.ts.map +0 -1
  348. package/dist/routing/pages-router.d.ts.map +0 -1
  349. package/dist/routing/route-trie.d.ts.map +0 -1
  350. package/dist/routing/route-validation.d.ts.map +0 -1
  351. package/dist/routing/utils.d.ts.map +0 -1
  352. package/dist/server/api-handler.d.ts.map +0 -1
  353. package/dist/server/app-router-entry.d.ts.map +0 -1
  354. package/dist/server/dev-module-runner.d.ts.map +0 -1
  355. package/dist/server/dev-origin-check.d.ts.map +0 -1
  356. package/dist/server/dev-server.d.ts.map +0 -1
  357. package/dist/server/html.d.ts.map +0 -1
  358. package/dist/server/image-optimization.d.ts.map +0 -1
  359. package/dist/server/instrumentation.d.ts.map +0 -1
  360. package/dist/server/isr-cache.d.ts.map +0 -1
  361. package/dist/server/metadata-routes.d.ts.map +0 -1
  362. package/dist/server/middleware-codegen.d.ts.map +0 -1
  363. package/dist/server/middleware-request-headers.d.ts.map +0 -1
  364. package/dist/server/middleware.d.ts.map +0 -1
  365. package/dist/server/normalize-path.d.ts.map +0 -1
  366. package/dist/server/pages-i18n.d.ts.map +0 -1
  367. package/dist/server/prod-server.d.ts.map +0 -1
  368. package/dist/server/request-log.d.ts.map +0 -1
  369. package/dist/server/request-pipeline.d.ts.map +0 -1
  370. package/dist/server/worker-utils.d.ts.map +0 -1
  371. package/dist/shims/amp.d.ts.map +0 -1
  372. package/dist/shims/app.d.ts.map +0 -1
  373. package/dist/shims/app.js.map +0 -1
  374. package/dist/shims/cache-runtime.d.ts.map +0 -1
  375. package/dist/shims/cache.d.ts.map +0 -1
  376. package/dist/shims/client-only.d.ts.map +0 -1
  377. package/dist/shims/client-only.js.map +0 -1
  378. package/dist/shims/compat-router.d.ts.map +0 -1
  379. package/dist/shims/config.d.ts.map +0 -1
  380. package/dist/shims/constants.d.ts.map +0 -1
  381. package/dist/shims/document.d.ts.map +0 -1
  382. package/dist/shims/dynamic.d.ts.map +0 -1
  383. package/dist/shims/error-boundary.d.ts.map +0 -1
  384. package/dist/shims/error.d.ts.map +0 -1
  385. package/dist/shims/fetch-cache.d.ts.map +0 -1
  386. package/dist/shims/font-google-base.d.ts.map +0 -1
  387. package/dist/shims/font-google.d.ts.map +0 -1
  388. package/dist/shims/font-google.generated.d.ts.map +0 -1
  389. package/dist/shims/font-google.js.map +0 -1
  390. package/dist/shims/font-local.d.ts.map +0 -1
  391. package/dist/shims/form.d.ts.map +0 -1
  392. package/dist/shims/head-state.d.ts.map +0 -1
  393. package/dist/shims/head.d.ts.map +0 -1
  394. package/dist/shims/headers.d.ts.map +0 -1
  395. package/dist/shims/i18n-context.d.ts.map +0 -1
  396. package/dist/shims/i18n-state.d.ts.map +0 -1
  397. package/dist/shims/image-config.d.ts.map +0 -1
  398. package/dist/shims/image.d.ts.map +0 -1
  399. package/dist/shims/internal/api-utils.d.ts.map +0 -1
  400. package/dist/shims/internal/api-utils.js.map +0 -1
  401. package/dist/shims/internal/app-router-context.d.ts.map +0 -1
  402. package/dist/shims/internal/cookies.d.ts.map +0 -1
  403. package/dist/shims/internal/cookies.js.map +0 -1
  404. package/dist/shims/internal/parse-cookie-header.d.ts.map +0 -1
  405. package/dist/shims/internal/router-context.d.ts.map +0 -1
  406. package/dist/shims/internal/utils.d.ts.map +0 -1
  407. package/dist/shims/internal/work-unit-async-storage.d.ts.map +0 -1
  408. package/dist/shims/layout-segment-context.d.ts.map +0 -1
  409. package/dist/shims/legacy-image.d.ts.map +0 -1
  410. package/dist/shims/link.d.ts.map +0 -1
  411. package/dist/shims/metadata.d.ts.map +0 -1
  412. package/dist/shims/navigation-state.d.ts.map +0 -1
  413. package/dist/shims/navigation.d.ts.map +0 -1
  414. package/dist/shims/og.d.ts.map +0 -1
  415. package/dist/shims/og.js.map +0 -1
  416. package/dist/shims/readonly-url-search-params.d.ts.map +0 -1
  417. package/dist/shims/request-context.d.ts.map +0 -1
  418. package/dist/shims/request-state-types.d.ts.map +0 -1
  419. package/dist/shims/request-state-types.js.map +0 -1
  420. package/dist/shims/router-state.d.ts.map +0 -1
  421. package/dist/shims/router.d.ts.map +0 -1
  422. package/dist/shims/script.d.ts.map +0 -1
  423. package/dist/shims/server-only.d.ts.map +0 -1
  424. package/dist/shims/server-only.js.map +0 -1
  425. package/dist/shims/server.d.ts.map +0 -1
  426. package/dist/shims/unified-request-context.d.ts.map +0 -1
  427. package/dist/shims/url-safety.d.ts.map +0 -1
  428. package/dist/shims/url-utils.d.ts.map +0 -1
  429. package/dist/shims/web-vitals.d.ts.map +0 -1
  430. package/dist/utils/base-path.d.ts.map +0 -1
  431. package/dist/utils/domain-locale.d.ts.map +0 -1
  432. package/dist/utils/hash.d.ts.map +0 -1
  433. package/dist/utils/manifest-paths.d.ts.map +0 -1
  434. package/dist/utils/project.d.ts.map +0 -1
  435. package/dist/utils/query.d.ts.map +0 -1
@@ -1,105 +1,74 @@
1
- /**
2
- * Shared URL utilities for same-origin detection.
3
- *
4
- * Used by link.tsx, navigation.ts, and router.ts to normalize
5
- * same-origin absolute URLs to local paths for client-side navigation.
6
- */
7
1
  import { hasBasePath, stripBasePath } from "../utils/base-path.js";
2
+ //#region src/shims/url-utils.ts
3
+ /**
4
+ * Shared URL utilities for same-origin detection.
5
+ *
6
+ * Used by link.tsx, navigation.ts, and router.ts to normalize
7
+ * same-origin absolute URLs to local paths for client-side navigation.
8
+ */
8
9
  /**
9
- * If `url` is an absolute same-origin URL, return the local path
10
- * (pathname + search + hash). Returns null for truly external URLs
11
- * or on the server (where origin is unknown).
12
- */
13
- export function toSameOriginPath(url) {
14
- if (typeof window === "undefined")
15
- return null;
16
- try {
17
- const parsed = url.startsWith("//") ? new URL(url, window.location.origin) : new URL(url);
18
- if (parsed.origin === window.location.origin) {
19
- return parsed.pathname + parsed.search + parsed.hash;
20
- }
21
- }
22
- catch {
23
- // not a valid absolute URL — ignore
24
- }
25
- return null;
10
+ * If `url` is an absolute same-origin URL, return the local path
11
+ * (pathname + search + hash). Returns null for truly external URLs
12
+ * or on the server (where origin is unknown).
13
+ */
14
+ function toSameOriginPath(url) {
15
+ if (typeof window === "undefined") return null;
16
+ try {
17
+ const parsed = url.startsWith("//") ? new URL(url, window.location.origin) : new URL(url);
18
+ if (parsed.origin === window.location.origin) return parsed.pathname + parsed.search + parsed.hash;
19
+ } catch {}
20
+ return null;
26
21
  }
27
22
  /**
28
- * If `url` is an absolute same-origin URL, return the app-relative path
29
- * (basePath stripped from the pathname, if configured). Returns null for
30
- * truly external URLs or on the server.
31
- */
32
- export function toSameOriginAppPath(url, basePath) {
33
- const localPath = toSameOriginPath(url);
34
- if (localPath == null || !basePath)
35
- return localPath;
36
- try {
37
- const parsed = new URL(localPath, "http://vinext.local");
38
- if (!hasBasePath(parsed.pathname, basePath)) {
39
- return null;
40
- }
41
- const pathname = stripBasePath(parsed.pathname, basePath);
42
- return pathname + parsed.search + parsed.hash;
43
- }
44
- catch {
45
- return localPath;
46
- }
23
+ * If `url` is an absolute same-origin URL, return the app-relative path
24
+ * (basePath stripped from the pathname, if configured). Returns null for
25
+ * truly external URLs or on the server.
26
+ */
27
+ function toSameOriginAppPath(url, basePath) {
28
+ const localPath = toSameOriginPath(url);
29
+ if (localPath == null || !basePath) return localPath;
30
+ try {
31
+ const parsed = new URL(localPath, "http://vinext.local");
32
+ if (!hasBasePath(parsed.pathname, basePath)) return null;
33
+ return stripBasePath(parsed.pathname, basePath) + parsed.search + parsed.hash;
34
+ } catch {
35
+ return localPath;
36
+ }
47
37
  }
48
38
  /**
49
- * Prepend basePath to a local path for browser URLs / fetches.
50
- */
51
- export function withBasePath(path, basePath) {
52
- if (!basePath ||
53
- !path.startsWith("/") ||
54
- path.startsWith("http://") ||
55
- path.startsWith("https://") ||
56
- path.startsWith("//")) {
57
- return path;
58
- }
59
- return basePath + path;
39
+ * Prepend basePath to a local path for browser URLs / fetches.
40
+ */
41
+ function withBasePath(path, basePath) {
42
+ if (!basePath || !path.startsWith("/") || path.startsWith("http://") || path.startsWith("https://") || path.startsWith("//")) return path;
43
+ return basePath + path;
60
44
  }
61
45
  /**
62
- * Resolve a potentially relative href against the current URL.
63
- * Handles: "#hash", "?query", "?query#hash", and relative paths.
64
- */
65
- export function resolveRelativeHref(href, currentUrl, basePath = "") {
66
- const base = currentUrl ?? (typeof window !== "undefined" ? window.location.href : undefined);
67
- if (!base)
68
- return href;
69
- if (href.startsWith("/") ||
70
- href.startsWith("http://") ||
71
- href.startsWith("https://") ||
72
- href.startsWith("//")) {
73
- return href;
74
- }
75
- try {
76
- const resolved = new URL(href, base);
77
- const pathname = basePath && resolved.pathname === basePath
78
- ? ""
79
- : basePath
80
- ? stripBasePath(resolved.pathname, basePath)
81
- : resolved.pathname;
82
- return pathname + resolved.search + resolved.hash;
83
- }
84
- catch {
85
- return href;
86
- }
46
+ * Resolve a potentially relative href against the current URL.
47
+ * Handles: "#hash", "?query", "?query#hash", and relative paths.
48
+ */
49
+ function resolveRelativeHref(href, currentUrl, basePath = "") {
50
+ const base = currentUrl ?? (typeof window !== "undefined" ? window.location.href : void 0);
51
+ if (!base) return href;
52
+ if (href.startsWith("/") || href.startsWith("http://") || href.startsWith("https://") || href.startsWith("//")) return href;
53
+ try {
54
+ const resolved = new URL(href, base);
55
+ return (basePath && resolved.pathname === basePath ? "" : basePath ? stripBasePath(resolved.pathname, basePath) : resolved.pathname) + resolved.search + resolved.hash;
56
+ } catch {
57
+ return href;
58
+ }
87
59
  }
88
60
  /**
89
- * Convert a local navigation target into the browser URL that should be used
90
- * for history entries, fetches, and onNavigate callbacks.
91
- */
92
- export function toBrowserNavigationHref(href, currentUrl, basePath = "") {
93
- const resolved = resolveRelativeHref(href, currentUrl, basePath);
94
- if (!basePath) {
95
- return withBasePath(resolved, basePath);
96
- }
97
- if (resolved === "") {
98
- return basePath;
99
- }
100
- if (resolved.startsWith("?") || resolved.startsWith("#")) {
101
- return basePath + resolved;
102
- }
103
- return withBasePath(resolved, basePath);
61
+ * Convert a local navigation target into the browser URL that should be used
62
+ * for history entries, fetches, and onNavigate callbacks.
63
+ */
64
+ function toBrowserNavigationHref(href, currentUrl, basePath = "") {
65
+ const resolved = resolveRelativeHref(href, currentUrl, basePath);
66
+ if (!basePath) return withBasePath(resolved, basePath);
67
+ if (resolved === "") return basePath;
68
+ if (resolved.startsWith("?") || resolved.startsWith("#")) return basePath + resolved;
69
+ return withBasePath(resolved, basePath);
104
70
  }
71
+ //#endregion
72
+ export { resolveRelativeHref, toBrowserNavigationHref, toSameOriginAppPath, toSameOriginPath, withBasePath };
73
+
105
74
  //# sourceMappingURL=url-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"url-utils.js","sourceRoot":"","sources":["../../src/shims/url-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAC/C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,GAAG,C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Y,EAAE,UAAmB,EAAE,QAAQ,GAAG,EAAE;IACtF,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IAEjE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QACpB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACzD,OAAO,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED,OAAO,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/**\n * Shared URL utilities for same-origin detection.\n *\n * Used by link.tsx, navigation.ts, and router.ts to normalize\n * same-origin absolute URLs to local paths for client-side navigation.\n */\nimport { hasBasePath, stripBasePath } from \"../utils/base-path.js\";\n\n/**\n * If `url` is an absolute same-origin URL, return the local path\n * (pathname + search + hash). Returns null for truly external URLs\n * or on the server (where origin is unknown).\n */\nexport function toSameOriginPath(url: string): string | null {\n if (typeof window === \"undefined\") return null;\n try {\n const parsed = url.startsWith(\"//\") ? new URL(url, window.location.origin) : new URL(url);\n if (parsed.origin === window.location.origin) {\n return parsed.pathname + parsed.search + parsed.hash;\n }\n } catch {\n // not a valid absolute URL — ignore\n }\n return null;\n}\n\n/**\n * If `url` is an absolute same-origin URL, return the app-relative path\n * (basePath stripped from the pathname, if configured). Returns null for\n * truly external URLs or on the server.\n */\nexport function toSameOriginAppPath(url: string, basePath: string): string | null {\n const localPath = toSameOriginPath(url);\n if (localPath == null || !basePath) return localPath;\n\n try {\n const parsed = new URL(localPath, \"http://vinext.local\");\n if (!hasBasePath(parsed.pathname, basePath)) {\n return null;\n }\n const pathname = stripBasePath(parsed.pathname, basePath);\n return pathname + parsed.search + parsed.hash;\n } catch {\n return localPath;\n }\n}\n\n/**\n * Prepend basePath to a local path for browser URLs / fetches.\n */\nexport function withBasePath(path: string, basePath: string): string {\n if (\n !basePath ||\n !path.startsWith(\"/\") ||\n path.startsWith(\"http://\") ||\n path.startsWith(\"https://\") ||\n path.startsWith(\"//\")\n ) {\n return path;\n }\n\n return basePath + path;\n}\n\n/**\n * Resolve a potentially relative href against the current URL.\n * Handles: \"#hash\", \"?query\", \"?query#hash\", and relative paths.\n */\nexport function resolveRelativeHref(href: string, currentUrl?: string, basePath = \"\"): string {\n const base = currentUrl ?? (typeof window !== \"undefined\" ? window.location.href : undefined);\n\n if (!base) return href;\n\n if (\n href.startsWith(\"/\") ||\n href.startsWith(\"http://\") ||\n href.startsWith(\"https://\") ||\n href.startsWith(\"//\")\n ) {\n return href;\n }\n\n try {\n const resolved = new URL(href, base);\n const pathname =\n basePath && resolved.pathname === basePath\n ? \"\"\n : basePath\n ? stripBasePath(resolved.pathname, basePath)\n : resolved.pathname;\n return pathname + resolved.search + resolved.hash;\n } catch {\n return href;\n }\n}\n\n/**\n * Convert a local navigation target into the browser URL that should be used\n * for history entries, fetches, and onNavigate callbacks.\n */\nexport function toBrowserNavigationHref(href: string, currentUrl?: string, basePath = \"\"): string {\n const resolved = resolveRelativeHref(href, currentUrl, basePath);\n\n if (!basePath) {\n return withBasePath(resolved, basePath);\n }\n\n if (resolved === \"\") {\n return basePath;\n }\n\n if (resolved.startsWith(\"?\") || resolved.startsWith(\"#\")) {\n return basePath + resolved;\n }\n\n return withBasePath(resolved, basePath);\n}\n"]}
1
+ {"version":3,"file":"url-utils.js","names":[],"sources":["../../src/shims/url-utils.ts"],"sourcesContent":["/**\n * Shared URL utilities for same-origin detection.\n *\n * Used by link.tsx, navigation.ts, and router.ts to normalize\n * same-origin absolute URLs to local paths for client-side navigation.\n */\nimport { hasBasePath, stripBasePath } from \"../utils/base-path.js\";\n\n/**\n * If `url` is an absolute same-origin URL, return the local path\n * (pathname + search + hash). Returns null for truly external URLs\n * or on the server (where origin is unknown).\n */\nexport function toSameOriginPath(url: string): string | null {\n if (typeof window === \"undefined\") return null;\n try {\n const parsed = url.startsWith(\"//\") ? new URL(url, window.location.origin) : new URL(url);\n if (parsed.origin === window.location.origin) {\n return parsed.pathname + parsed.search + parsed.hash;\n }\n } catch {\n // not a valid absolute URL — ignore\n }\n return null;\n}\n\n/**\n * If `url` is an absolute same-origin URL, return the app-relative path\n * (basePath stripped from the pathname, if configured). Returns null for\n * truly external URLs or on the server.\n */\nexport function toSameOriginAppPath(url: string, basePath: string): string | null {\n const localPath = toSameOriginPath(url);\n if (localPath == null || !basePath) return localPath;\n\n try {\n const parsed = new URL(localPath, \"http://vinext.local\");\n if (!hasBasePath(parsed.pathname, basePath)) {\n return null;\n }\n const pathname = stripBasePath(parsed.pathname, basePath);\n return pathname + parsed.search + parsed.hash;\n } catch {\n return localPath;\n }\n}\n\n/**\n * Prepend basePath to a local path for browser URLs / fetches.\n */\nexport function withBasePath(path: string, basePath: string): string {\n if (\n !basePath ||\n !path.startsWith(\"/\") ||\n path.startsWith(\"http://\") ||\n path.startsWith(\"https://\") ||\n path.startsWith(\"//\")\n ) {\n return path;\n }\n\n return basePath + path;\n}\n\n/**\n * Resolve a potentially relative href against the current URL.\n * Handles: \"#hash\", \"?query\", \"?query#hash\", and relative paths.\n */\nexport function resolveRelativeHref(href: string, currentUrl?: string, basePath = \"\"): string {\n const base = currentUrl ?? (typeof window !== \"undefined\" ? window.location.href : undefined);\n\n if (!base) return href;\n\n if (\n href.startsWith(\"/\") ||\n href.startsWith(\"http://\") ||\n href.startsWith(\"https://\") ||\n href.startsWith(\"//\")\n ) {\n return href;\n }\n\n try {\n const resolved = new URL(href, base);\n const pathname =\n basePath && resolved.pathname === basePath\n ? \"\"\n : basePath\n ? stripBasePath(resolved.pathname, basePath)\n : resolved.pathname;\n return pathname + resolved.search + resolved.hash;\n } catch {\n return href;\n }\n}\n\n/**\n * Convert a local navigation target into the browser URL that should be used\n * for history entries, fetches, and onNavigate callbacks.\n */\nexport function toBrowserNavigationHref(href: string, currentUrl?: string, basePath = \"\"): string {\n const resolved = resolveRelativeHref(href, currentUrl, basePath);\n\n if (!basePath) {\n return withBasePath(resolved, basePath);\n }\n\n if (resolved === \"\") {\n return basePath;\n }\n\n if (resolved.startsWith(\"?\") || resolved.startsWith(\"#\")) {\n return basePath + resolved;\n }\n\n return withBasePath(resolved, basePath);\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,SAAgB,iBAAiB,KAA4B;AAC3D,KAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,KAAI;EACF,MAAM,SAAS,IAAI,WAAW,KAAK,GAAG,IAAI,IAAI,KAAK,OAAO,SAAS,OAAO,GAAG,IAAI,IAAI,IAAI;AACzF,MAAI,OAAO,WAAW,OAAO,SAAS,OACpC,QAAO,OAAO,WAAW,OAAO,SAAS,OAAO;SAE5C;AAGR,QAAO;;;;;;;AAQT,SAAgB,oBAAoB,KAAa,UAAiC;CAChF,MAAM,YAAY,iBAAiB,IAAI;AACvC,KAAI,aAAa,QAAQ,CAAC,SAAU,QAAO;AAE3C,KAAI;EACF,MAAM,SAAS,IAAI,IAAI,WAAW,sBAAsB;AACxD,MAAI,CAAC,YAAY,OAAO,UAAU,SAAS,CACzC,QAAO;AAGT,SADiB,cAAc,OAAO,UAAU,SAAS,GACvC,OAAO,SAAS,OAAO;SACnC;AACN,SAAO;;;;;;AAOX,SAAgB,aAAa,MAAc,UAA0B;AACnE,KACE,CAAC,YACD,CAAC,KAAK,WAAW,IAAI,IACrB,KAAK,WAAW,UAAU,IAC1B,KAAK,WAAW,WAAW,IAC3B,KAAK,WAAW,KAAK,CAErB,QAAO;AAGT,QAAO,WAAW;;;;;;AAOpB,SAAgB,oBAAoB,MAAc,YAAqB,WAAW,IAAY;CAC5F,MAAM,OAAO,eAAe,OAAO,WAAW,cAAc,OAAO,SAAS,OAAO,KAAA;AAEnF,KAAI,CAAC,KAAM,QAAO;AAElB,KACE,KAAK,WAAW,IAAI,IACpB,KAAK,WAAW,UAAU,IAC1B,KAAK,WAAW,WAAW,IAC3B,KAAK,WAAW,KAAK,CAErB,QAAO;AAGT,KAAI;EACF,MAAM,WAAW,IAAI,IAAI,MAAM,KAAK;AAOpC,UALE,YAAY,SAAS,aAAa,WAC9B,KACA,WACE,cAAc,SAAS,UAAU,SAAS,GAC1C,SAAS,YACC,SAAS,SAAS,SAAS;SACvC;AACN,SAAO;;;;;;;AAQX,SAAgB,wBAAwB,MAAc,YAAqB,WAAW,IAAY;CAChG,MAAM,WAAW,oBAAoB,MAAM,YAAY,SAAS;AAEhE,KAAI,CAAC,SACH,QAAO,aAAa,UAAU,SAAS;AAGzC,KAAI,aAAa,GACf,QAAO;AAGT,KAAI,SAAS,WAAW,IAAI,IAAI,SAAS,WAAW,IAAI,CACtD,QAAO,WAAW;AAGpB,QAAO,aAAa,UAAU,SAAS"}
@@ -1,3 +1,4 @@
1
+ //#region src/shims/web-vitals.d.ts
1
2
  /**
2
3
  * next/web-vitals shim
3
4
  *
@@ -6,12 +7,12 @@
6
7
  * Apps can use the web-vitals library directly instead.
7
8
  */
8
9
  interface WebVitalsMetric {
9
- id: string;
10
- name: string;
11
- value: number;
12
- rating?: "good" | "needs-improvement" | "poor";
13
- delta: number;
14
- navigationType?: "navigate" | "reload" | "back-forward" | "prerender";
10
+ id: string;
11
+ name: string;
12
+ value: number;
13
+ rating?: "good" | "needs-improvement" | "poor";
14
+ delta: number;
15
+ navigationType?: "navigate" | "reload" | "back-forward" | "prerender";
15
16
  }
16
17
  type ReportWebVitalsCallback = (metric: WebVitalsMetric) => void;
17
18
  /**
@@ -19,6 +20,7 @@ type ReportWebVitalsCallback = (metric: WebVitalsMetric) => void;
19
20
  * No-op in our implementation — use the `web-vitals` library directly
20
21
  * for production metrics collection.
21
22
  */
22
- export declare function useReportWebVitals(_callback: ReportWebVitalsCallback): void;
23
- export type { WebVitalsMetric, ReportWebVitalsCallback };
23
+ declare function useReportWebVitals(_callback: ReportWebVitalsCallback): void;
24
+ //#endregion
25
+ export { type ReportWebVitalsCallback, type WebVitalsMetric, useReportWebVitals };
24
26
  //# sourceMappingURL=web-vitals.d.ts.map
@@ -1,17 +1,11 @@
1
+ //#region src/shims/web-vitals.ts
1
2
  /**
2
- * next/web-vitals shim
3
- *
4
- * Provides useReportWebVitals() a no-op hook for compatibility.
5
- * In real Next.js, this sends Core Web Vitals to an analytics endpoint.
6
- * Apps can use the web-vitals library directly instead.
7
- */
8
- /**
9
- * Register a callback to receive Core Web Vitals metrics.
10
- * No-op in our implementation — use the `web-vitals` library directly
11
- * for production metrics collection.
12
- */
13
- export function useReportWebVitals(_callback) {
14
- // No-op — apps should use the web-vitals library directly
15
- // or their own analytics integration.
16
- }
3
+ * Register a callback to receive Core Web Vitals metrics.
4
+ * No-op in our implementation — use the `web-vitals` library directly
5
+ * for production metrics collection.
6
+ */
7
+ function useReportWebVitals(_callback) {}
8
+ //#endregion
9
+ export { useReportWebVitals };
10
+
17
11
  //# sourceMappingURL=web-vitals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-vitals.js","sourceRoot":"","sources":["../../src/shims/web-vitals.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAkC;IACnE,0DAA0D;IAC1D,sCAAsC;AACxC,CAAC","sourcesContent":["/**\n * next/web-vitals shim\n *\n * Provides useReportWebVitals() — a no-op hook for compatibility.\n * In real Next.js, this sends Core Web Vitals to an analytics endpoint.\n * Apps can use the web-vitals library directly instead.\n */\n\ninterface WebVitalsMetric {\n id: string;\n name: string;\n value: number;\n rating?: \"good\" | \"needs-improvement\" | \"poor\";\n delta: number;\n navigationType?: \"navigate\" | \"reload\" | \"back-forward\" | \"prerender\";\n}\n\ntype ReportWebVitalsCallback = (metric: WebVitalsMetric) => void;\n\n/**\n * Register a callback to receive Core Web Vitals metrics.\n * No-op in our implementation — use the `web-vitals` library directly\n * for production metrics collection.\n */\nexport function useReportWebVitals(_callback: ReportWebVitalsCallback): void {\n // No-op — apps should use the web-vitals library directly\n // or their own analytics integration.\n}\n\nexport type { WebVitalsMetric, ReportWebVitalsCallback };\n"]}
1
+ {"version":3,"file":"web-vitals.js","names":[],"sources":["../../src/shims/web-vitals.ts"],"sourcesContent":["/**\n * next/web-vitals shim\n *\n * Provides useReportWebVitals() — a no-op hook for compatibility.\n * In real Next.js, this sends Core Web Vitals to an analytics endpoint.\n * Apps can use the web-vitals library directly instead.\n */\n\ninterface WebVitalsMetric {\n id: string;\n name: string;\n value: number;\n rating?: \"good\" | \"needs-improvement\" | \"poor\";\n delta: number;\n navigationType?: \"navigate\" | \"reload\" | \"back-forward\" | \"prerender\";\n}\n\ntype ReportWebVitalsCallback = (metric: WebVitalsMetric) => void;\n\n/**\n * Register a callback to receive Core Web Vitals metrics.\n * No-op in our implementation — use the `web-vitals` library directly\n * for production metrics collection.\n */\nexport function useReportWebVitals(_callback: ReportWebVitalsCallback): void {\n // No-op — apps should use the web-vitals library directly\n // or their own analytics integration.\n}\n\nexport type { WebVitalsMetric, ReportWebVitalsCallback };\n"],"mappings":";;;;;;AAwBA,SAAgB,mBAAmB,WAA0C"}
@@ -1,3 +1,4 @@
1
+ //#region src/utils/base-path.d.ts
1
2
  /**
2
3
  * Shared basePath helpers.
3
4
  *
@@ -8,10 +9,12 @@
8
9
  /**
9
10
  * Check whether a pathname is inside the configured basePath.
10
11
  */
11
- export declare function hasBasePath(pathname: string, basePath: string): boolean;
12
+ declare function hasBasePath(pathname: string, basePath: string): boolean;
12
13
  /**
13
14
  * Strip the basePath prefix from a pathname when it matches on a segment
14
15
  * boundary. Returns the original pathname when it is outside the basePath.
15
16
  */
16
- export declare function stripBasePath(pathname: string, basePath: string): string;
17
+ declare function stripBasePath(pathname: string, basePath: string): string;
18
+ //#endregion
19
+ export { hasBasePath, stripBasePath };
17
20
  //# sourceMappingURL=base-path.d.ts.map
@@ -1,25 +1,27 @@
1
+ //#region src/utils/base-path.ts
1
2
  /**
2
- * Shared basePath helpers.
3
- *
4
- * Next.js only treats a pathname as being under basePath when it is an exact
5
- * match ("/app") or starts with the basePath followed by a path separator
6
- * ("/app/..."). Prefix-only matches like "/application" must be left intact.
7
- */
3
+ * Shared basePath helpers.
4
+ *
5
+ * Next.js only treats a pathname as being under basePath when it is an exact
6
+ * match ("/app") or starts with the basePath followed by a path separator
7
+ * ("/app/..."). Prefix-only matches like "/application" must be left intact.
8
+ */
8
9
  /**
9
- * Check whether a pathname is inside the configured basePath.
10
- */
11
- export function hasBasePath(pathname, basePath) {
12
- if (!basePath)
13
- return false;
14
- return pathname === basePath || pathname.startsWith(basePath + "/");
10
+ * Check whether a pathname is inside the configured basePath.
11
+ */
12
+ function hasBasePath(pathname, basePath) {
13
+ if (!basePath) return false;
14
+ return pathname === basePath || pathname.startsWith(basePath + "/");
15
15
  }
16
16
  /**
17
- * Strip the basePath prefix from a pathname when it matches on a segment
18
- * boundary. Returns the original pathname when it is outside the basePath.
19
- */
20
- export function stripBasePath(pathname, basePath) {
21
- if (!hasBasePath(pathname, basePath))
22
- return pathname;
23
- return pathname.slice(basePath.length) || "/";
17
+ * Strip the basePath prefix from a pathname when it matches on a segment
18
+ * boundary. Returns the original pathname when it is outside the basePath.
19
+ */
20
+ function stripBasePath(pathname, basePath) {
21
+ if (!hasBasePath(pathname, basePath)) return pathname;
22
+ return pathname.slice(basePath.length) || "/";
24
23
  }
24
+ //#endregion
25
+ export { hasBasePath, stripBasePath };
26
+
25
27
  //# sourceMappingURL=base-path.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-path.js","sourceRoot":"","sources":["../../src/utils/base-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB,EAAE,QAAgB;IAC5D,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB,EAAE,QAAgB;IAC9D,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IACtD,OAAO,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC;AAChD,CAAC","sourcesContent":["/**\n * Shared basePath helpers.\n *\n * Next.js only treats a pathname as being under basePath when it is an exact\n * match (\"/app\") or starts with the basePath followed by a path separator\n * (\"/app/...\"). Prefix-only matches like \"/application\" must be left intact.\n */\n\n/**\n * Check whether a pathname is inside the configured basePath.\n */\nexport function hasBasePath(pathname: string, basePath: string): boolean {\n if (!basePath) return false;\n return pathname === basePath || pathname.startsWith(basePath + \"/\");\n}\n\n/**\n * Strip the basePath prefix from a pathname when it matches on a segment\n * boundary. Returns the original pathname when it is outside the basePath.\n */\nexport function stripBasePath(pathname: string, basePath: string): string {\n if (!hasBasePath(pathname, basePath)) return pathname;\n return pathname.slice(basePath.length) || \"/\";\n}\n"]}
1
+ {"version":3,"file":"base-path.js","names":[],"sources":["../../src/utils/base-path.ts"],"sourcesContent":["/**\n * Shared basePath helpers.\n *\n * Next.js only treats a pathname as being under basePath when it is an exact\n * match (\"/app\") or starts with the basePath followed by a path separator\n * (\"/app/...\"). Prefix-only matches like \"/application\" must be left intact.\n */\n\n/**\n * Check whether a pathname is inside the configured basePath.\n */\nexport function hasBasePath(pathname: string, basePath: string): boolean {\n if (!basePath) return false;\n return pathname === basePath || pathname.startsWith(basePath + \"/\");\n}\n\n/**\n * Strip the basePath prefix from a pathname when it matches on a segment\n * boundary. Returns the original pathname when it is outside the basePath.\n */\nexport function stripBasePath(pathname: string, basePath: string): string {\n if (!hasBasePath(pathname, basePath)) return pathname;\n return pathname.slice(basePath.length) || \"/\";\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,YAAY,UAAkB,UAA2B;AACvE,KAAI,CAAC,SAAU,QAAO;AACtB,QAAO,aAAa,YAAY,SAAS,WAAW,WAAW,IAAI;;;;;;AAOrE,SAAgB,cAAc,UAAkB,UAA0B;AACxE,KAAI,CAAC,YAAY,UAAU,SAAS,CAAE,QAAO;AAC7C,QAAO,SAAS,MAAM,SAAS,OAAO,IAAI"}
@@ -1,6 +1,8 @@
1
- import type { NextI18nConfig } from "../config/next-config.js";
2
- export type DomainLocale = NonNullable<NextI18nConfig["domains"]>[number];
3
- export declare function normalizeDomainHostname(hostname: string | null | undefined): string | undefined;
1
+ import { NextI18nConfig } from "../config/next-config.js";
2
+
3
+ //#region src/utils/domain-locale.d.ts
4
+ type DomainLocale = NonNullable<NextI18nConfig["domains"]>[number];
5
+ declare function normalizeDomainHostname(hostname: string | null | undefined): string | undefined;
4
6
  /**
5
7
  * Match a configured domain either by hostname or locale.
6
8
  * When both are provided, the checks intentionally use OR semantics so the
@@ -8,11 +10,17 @@ export declare function normalizeDomainHostname(hostname: string | null | undefi
8
10
  * If both are passed, the first domain matching either input wins, so callers
9
11
  * should pass hostname or detectedLocale, not both.
10
12
  */
11
- export declare function detectDomainLocale(domainItems?: readonly DomainLocale[], hostname?: string, detectedLocale?: string): DomainLocale | undefined;
12
- export declare function addLocalePrefix(path: string, locale: string, localeDefault: string): string;
13
- export declare function getDomainLocaleUrl(url: string, locale: string, { basePath, currentHostname, domainItems, }: {
14
- basePath?: string;
15
- currentHostname?: string | null;
16
- domainItems?: readonly DomainLocale[];
13
+ declare function detectDomainLocale(domainItems?: readonly DomainLocale[], hostname?: string, detectedLocale?: string): DomainLocale | undefined;
14
+ declare function addLocalePrefix(path: string, locale: string, localeDefault: string): string;
15
+ declare function getDomainLocaleUrl(url: string, locale: string, {
16
+ basePath,
17
+ currentHostname,
18
+ domainItems
19
+ }: {
20
+ basePath?: string;
21
+ currentHostname?: string | null;
22
+ domainItems?: readonly DomainLocale[];
17
23
  }): string | undefined;
24
+ //#endregion
25
+ export { DomainLocale, addLocalePrefix, detectDomainLocale, getDomainLocaleUrl, normalizeDomainHostname };
18
26
  //# sourceMappingURL=domain-locale.d.ts.map
@@ -1,64 +1,44 @@
1
- export function normalizeDomainHostname(hostname) {
2
- if (!hostname)
3
- return undefined;
4
- return hostname.split(",", 1)[0]?.trim().split(":", 1)[0]?.toLowerCase() || undefined;
1
+ //#region src/utils/domain-locale.ts
2
+ function normalizeDomainHostname(hostname) {
3
+ if (!hostname) return void 0;
4
+ return hostname.split(",", 1)[0]?.trim().split(":", 1)[0]?.toLowerCase() || void 0;
5
5
  }
6
6
  /**
7
- * Match a configured domain either by hostname or locale.
8
- * When both are provided, the checks intentionally use OR semantics so the
9
- * same helper can cover Next.js's hostname lookup and preferred-locale lookup.
10
- * If both are passed, the first domain matching either input wins, so callers
11
- * should pass hostname or detectedLocale, not both.
12
- */
13
- export function detectDomainLocale(domainItems, hostname, detectedLocale) {
14
- if (!domainItems?.length)
15
- return undefined;
16
- const normalizedHostname = normalizeDomainHostname(hostname);
17
- const normalizedLocale = detectedLocale?.toLowerCase();
18
- for (const item of domainItems) {
19
- const domainHostname = normalizeDomainHostname(item.domain);
20
- if (normalizedHostname === domainHostname ||
21
- normalizedLocale === item.defaultLocale.toLowerCase() ||
22
- item.locales?.some((locale) => locale.toLowerCase() === normalizedLocale)) {
23
- return item;
24
- }
25
- }
26
- return undefined;
7
+ * Match a configured domain either by hostname or locale.
8
+ * When both are provided, the checks intentionally use OR semantics so the
9
+ * same helper can cover Next.js's hostname lookup and preferred-locale lookup.
10
+ * If both are passed, the first domain matching either input wins, so callers
11
+ * should pass hostname or detectedLocale, not both.
12
+ */
13
+ function detectDomainLocale(domainItems, hostname, detectedLocale) {
14
+ if (!domainItems?.length) return void 0;
15
+ const normalizedHostname = normalizeDomainHostname(hostname);
16
+ const normalizedLocale = detectedLocale?.toLowerCase();
17
+ for (const item of domainItems) if (normalizedHostname === normalizeDomainHostname(item.domain) || normalizedLocale === item.defaultLocale.toLowerCase() || item.locales?.some((locale) => locale.toLowerCase() === normalizedLocale)) return item;
27
18
  }
28
- export function addLocalePrefix(path, locale, localeDefault) {
29
- const normalizedLocale = locale.toLowerCase();
30
- if (normalizedLocale === localeDefault.toLowerCase())
31
- return path;
32
- const pathWithLeadingSlash = path.startsWith("/") ? path : `/${path}`;
33
- const pathname = pathWithLeadingSlash.split(/[?#]/, 1)[0] ?? pathWithLeadingSlash;
34
- const normalizedPathname = pathname.toLowerCase();
35
- const localePrefix = `/${normalizedLocale}`;
36
- if (normalizedPathname === localePrefix || normalizedPathname.startsWith(`${localePrefix}/`)) {
37
- return path.startsWith("/") ? path : pathWithLeadingSlash;
38
- }
39
- return `/${locale}${pathWithLeadingSlash}`;
19
+ function addLocalePrefix(path, locale, localeDefault) {
20
+ const normalizedLocale = locale.toLowerCase();
21
+ if (normalizedLocale === localeDefault.toLowerCase()) return path;
22
+ const pathWithLeadingSlash = path.startsWith("/") ? path : `/${path}`;
23
+ const normalizedPathname = (pathWithLeadingSlash.split(/[?#]/, 1)[0] ?? pathWithLeadingSlash).toLowerCase();
24
+ const localePrefix = `/${normalizedLocale}`;
25
+ if (normalizedPathname === localePrefix || normalizedPathname.startsWith(`${localePrefix}/`)) return path.startsWith("/") ? path : pathWithLeadingSlash;
26
+ return `/${locale}${pathWithLeadingSlash}`;
40
27
  }
41
28
  function withBasePath(path, basePath = "") {
42
- if (!basePath)
43
- return path;
44
- return basePath + path;
29
+ if (!basePath) return path;
30
+ return basePath + path;
45
31
  }
46
- export function getDomainLocaleUrl(url, locale, { basePath, currentHostname, domainItems, }) {
47
- if (!domainItems?.length)
48
- return undefined;
49
- const targetDomain = detectDomainLocale(domainItems, undefined, locale);
50
- if (!targetDomain)
51
- return undefined;
52
- const currentDomain = detectDomainLocale(domainItems, currentHostname ?? undefined);
53
- const localizedPath = addLocalePrefix(url, locale, targetDomain.defaultLocale);
54
- if (currentDomain &&
55
- normalizeDomainHostname(currentDomain.domain) === normalizeDomainHostname(targetDomain.domain)) {
56
- // Same-domain switches fall back to the caller's standard locale-prefix
57
- // logic. This relies on __VINEXT_DEFAULT_LOCALE__ matching the current
58
- // domain's defaultLocale, which the server entry keeps in sync.
59
- return undefined;
60
- }
61
- const scheme = `http${targetDomain.http ? "" : "s"}://`;
62
- return `${scheme}${targetDomain.domain}${withBasePath(localizedPath, basePath)}`;
32
+ function getDomainLocaleUrl(url, locale, { basePath, currentHostname, domainItems }) {
33
+ if (!domainItems?.length) return void 0;
34
+ const targetDomain = detectDomainLocale(domainItems, void 0, locale);
35
+ if (!targetDomain) return void 0;
36
+ const currentDomain = detectDomainLocale(domainItems, currentHostname ?? void 0);
37
+ const localizedPath = addLocalePrefix(url, locale, targetDomain.defaultLocale);
38
+ if (currentDomain && normalizeDomainHostname(currentDomain.domain) === normalizeDomainHostname(targetDomain.domain)) return;
39
+ return `${`http${targetDomain.http ? "" : "s"}://`}${targetDomain.domain}${withBasePath(localizedPath, basePath)}`;
63
40
  }
41
+ //#endregion
42
+ export { addLocalePrefix, detectDomainLocale, getDomainLocaleUrl, normalizeDomainHostname };
43
+
64
44
  //# sourceMappingURL=domain-locale.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"domain-locale.js","sourceRoot":"","sources":["../../src/utils/domain-locale.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,uBAAuB,CAAC,QAAmC;IACzE,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChC,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,SAAS,CAAC;AACxF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,WAAqC,EACrC,QAAiB,EACjB,cAAuB;IAEv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extI18nConfig } from \"../config/next-config.js\";\n\nexport type DomainLocale = NonNullable<NextI18nConfig[\"domains\"]>[number];\n\nexport function normalizeDomainHostname(hostname: string | null | undefined): string | undefined {\n if (!hostname) return undefined;\n return hostname.split(\",\", 1)[0]?.trim().split(\":\", 1)[0]?.toLowerCase() || undefined;\n}\n\n/**\n * Match a configured domain either by hostname or locale.\n * When both are provided, the checks intentionally use OR semantics so the\n * same helper can cover Next.js's hostname lookup and preferred-locale lookup.\n * If both are passed, the first domain matching either input wins, so callers\n * should pass hostname or detectedLocale, not both.\n */\nexport function detectDomainLocale(\n domainItems?: readonly DomainLocale[],\n hostname?: string,\n detectedLocale?: string,\n): DomainLocale | undefined {\n if (!domainItems?.length) return undefined;\n\n const normalizedHostname = normalizeDomainHostname(hostname);\n const normalizedLocale = detectedLocale?.toLowerCase();\n\n for (const item of domainItems) {\n const domainHostname = normalizeDomainHostname(item.domain);\n if (\n normalizedHostname === domainHostname ||\n normalizedLocale === item.defaultLocale.toLowerCase() ||\n item.locales?.some((locale) => locale.toLowerCase() === normalizedLocale)\n ) {\n return item;\n }\n }\n\n return undefined;\n}\n\nexport function addLocalePrefix(path: string, locale: string, localeDefault: string): string {\n const normalizedLocale = locale.toLowerCase();\n if (normalizedLocale === localeDefault.toLowerCase()) return path;\n\n const pathWithLeadingSlash = path.startsWith(\"/\") ? path : `/${path}`;\n const pathname = pathWithLeadingSlash.split(/[?#]/, 1)[0] ?? pathWithLeadingSlash;\n const normalizedPathname = pathname.toLowerCase();\n const localePrefix = `/${normalizedLocale}`;\n\n if (normalizedPathname === localePrefix || normalizedPathname.startsWith(`${localePrefix}/`)) {\n return path.startsWith(\"/\") ? path : pathWithLeadingSlash;\n }\n\n return `/${locale}${pathWithLeadingSlash}`;\n}\n\nfunction withBasePath(path: string, basePath = \"\"): string {\n if (!basePath) return path;\n return basePath + path;\n}\n\nexport function getDomainLocaleUrl(\n url: string,\n locale: string,\n {\n basePath,\n currentHostname,\n domainItems,\n }: {\n basePath?: string;\n currentHostname?: string | null;\n domainItems?: readonly DomainLocale[];\n },\n): string | undefined {\n if (!domainItems?.length) return undefined;\n\n const targetDomain = detectDomainLocale(domainItems, undefined, locale);\n if (!targetDomain) return undefined;\n\n const currentDomain = detectDomainLocale(domainItems, currentHostname ?? undefined);\n const localizedPath = addLocalePrefix(url, locale, targetDomain.defaultLocale);\n\n if (\n currentDomain &&\n normalizeDomainHostname(currentDomain.domain) === normalizeDomainHostname(targetDomain.domain)\n ) {\n // Same-domain switches fall back to the caller's standard locale-prefix\n // logic. This relies on __VINEXT_DEFAULT_LOCALE__ matching the current\n // domain's defaultLocale, which the server entry keeps in sync.\n return undefined;\n }\n\n const scheme = `http${targetDomain.http ? \"\" : \"s\"}://`;\n return `${scheme}${targetDomain.domain}${withBasePath(localizedPath, basePath)}`;\n}\n"]}
1
+ {"version":3,"file":"domain-locale.js","names":[],"sources":["../../src/utils/domain-locale.ts"],"sourcesContent":["import type { NextI18nConfig } from \"../config/next-config.js\";\n\nexport type DomainLocale = NonNullable<NextI18nConfig[\"domains\"]>[number];\n\nexport function normalizeDomainHostname(hostname: string | null | undefined): string | undefined {\n if (!hostname) return undefined;\n return hostname.split(\",\", 1)[0]?.trim().split(\":\", 1)[0]?.toLowerCase() || undefined;\n}\n\n/**\n * Match a configured domain either by hostname or locale.\n * When both are provided, the checks intentionally use OR semantics so the\n * same helper can cover Next.js's hostname lookup and preferred-locale lookup.\n * If both are passed, the first domain matching either input wins, so callers\n * should pass hostname or detectedLocale, not both.\n */\nexport function detectDomainLocale(\n domainItems?: readonly DomainLocale[],\n hostname?: string,\n detectedLocale?: string,\n): DomainLocale | undefined {\n if (!domainItems?.length) return undefined;\n\n const normalizedHostname = normalizeDomainHostname(hostname);\n const normalizedLocale = detectedLocale?.toLowerCase();\n\n for (const item of domainItems) {\n const domainHostname = normalizeDomainHostname(item.domain);\n if (\n normalizedHostname === domainHostname ||\n normalizedLocale === item.defaultLocale.toLowerCase() ||\n item.locales?.some((locale) => locale.toLowerCase() === normalizedLocale)\n ) {\n return item;\n }\n }\n\n return undefined;\n}\n\nexport function addLocalePrefix(path: string, locale: string, localeDefault: string): string {\n const normalizedLocale = locale.toLowerCase();\n if (normalizedLocale === localeDefault.toLowerCase()) return path;\n\n const pathWithLeadingSlash = path.startsWith(\"/\") ? path : `/${path}`;\n const pathname = pathWithLeadingSlash.split(/[?#]/, 1)[0] ?? pathWithLeadingSlash;\n const normalizedPathname = pathname.toLowerCase();\n const localePrefix = `/${normalizedLocale}`;\n\n if (normalizedPathname === localePrefix || normalizedPathname.startsWith(`${localePrefix}/`)) {\n return path.startsWith(\"/\") ? path : pathWithLeadingSlash;\n }\n\n return `/${locale}${pathWithLeadingSlash}`;\n}\n\nfunction withBasePath(path: string, basePath = \"\"): string {\n if (!basePath) return path;\n return basePath + path;\n}\n\nexport function getDomainLocaleUrl(\n url: string,\n locale: string,\n {\n basePath,\n currentHostname,\n domainItems,\n }: {\n basePath?: string;\n currentHostname?: string | null;\n domainItems?: readonly DomainLocale[];\n },\n): string | undefined {\n if (!domainItems?.length) return undefined;\n\n const targetDomain = detectDomainLocale(domainItems, undefined, locale);\n if (!targetDomain) return undefined;\n\n const currentDomain = detectDomainLocale(domainItems, currentHostname ?? undefined);\n const localizedPath = addLocalePrefix(url, locale, targetDomain.defaultLocale);\n\n if (\n currentDomain &&\n normalizeDomainHostname(currentDomain.domain) === normalizeDomainHostname(targetDomain.domain)\n ) {\n // Same-domain switches fall back to the caller's standard locale-prefix\n // logic. This relies on __VINEXT_DEFAULT_LOCALE__ matching the current\n // domain's defaultLocale, which the server entry keeps in sync.\n return undefined;\n }\n\n const scheme = `http${targetDomain.http ? \"\" : \"s\"}://`;\n return `${scheme}${targetDomain.domain}${withBasePath(localizedPath, basePath)}`;\n}\n"],"mappings":";AAIA,SAAgB,wBAAwB,UAAyD;AAC/F,KAAI,CAAC,SAAU,QAAO,KAAA;AACtB,QAAO,SAAS,MAAM,KAAK,EAAE,CAAC,IAAI,MAAM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B,aAAa,OAAO,CAK9F;AAIF,QAAO,GADQ,OAAO,aAAa,OAAO,KAAK,IAAI,OAChC,aAAa,SAAS,aAAa,eAAe,SAAS"}
@@ -1,6 +1,9 @@
1
+ //#region src/utils/hash.d.ts
1
2
  /**
2
3
  * FNV-1a hash producing a 64-bit result (two 32-bit rounds with different seeds).
3
4
  * Used for deterministic key generation where collisions must be rare.
4
5
  */
5
- export declare function fnv1a64(input: string): string;
6
+ declare function fnv1a64(input: string): string;
7
+ //#endregion
8
+ export { fnv1a64 };
6
9
  //# sourceMappingURL=hash.d.ts.map
@@ -1,20 +1,22 @@
1
+ //#region src/utils/hash.ts
1
2
  /**
2
- * FNV-1a hash producing a 64-bit result (two 32-bit rounds with different seeds).
3
- * Used for deterministic key generation where collisions must be rare.
4
- */
5
- export function fnv1a64(input) {
6
- // First 32-bit round with standard FNV offset basis
7
- let h1 = 0x811c9dc5;
8
- for (let i = 0; i < input.length; i++) {
9
- h1 ^= input.charCodeAt(i);
10
- h1 = (h1 * 0x01000193) >>> 0;
11
- }
12
- // Second 32-bit round with different seed
13
- let h2 = 0x050c5d1f;
14
- for (let i = 0; i < input.length; i++) {
15
- h2 ^= input.charCodeAt(i);
16
- h2 = (h2 * 0x01000193) >>> 0;
17
- }
18
- return h1.toString(36) + h2.toString(36);
3
+ * FNV-1a hash producing a 64-bit result (two 32-bit rounds with different seeds).
4
+ * Used for deterministic key generation where collisions must be rare.
5
+ */
6
+ function fnv1a64(input) {
7
+ let h1 = 2166136261;
8
+ for (let i = 0; i < input.length; i++) {
9
+ h1 ^= input.charCodeAt(i);
10
+ h1 = h1 * 16777619 >>> 0;
11
+ }
12
+ let h2 = 84696351;
13
+ for (let i = 0; i < input.length; i++) {
14
+ h2 ^= input.charCodeAt(i);
15
+ h2 = h2 * 16777619 >>> 0;
16
+ }
17
+ return h1.toString(36) + h2.toString(36);
19
18
  }
19
+ //#endregion
20
+ export { fnv1a64 };
21
+
20
22
  //# sourceMappingURL=hash.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/utils/hash.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,oDAAoD;IACpD,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC1B,EAAE,GAAG,CAAC,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,0CAA0C;IAC1C,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC1B,EAAE,GAAG,CAAC,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/**\n * FNV-1a hash producing a 64-bit result (two 32-bit rounds with different seeds).\n * Used for deterministic key generation where collisions must be rare.\n */\nexport function fnv1a64(input: string): string {\n // First 32-bit round with standard FNV offset basis\n let h1 = 0x811c9dc5;\n for (let i = 0; i < input.length; i++) {\n h1 ^= input.charCodeAt(i);\n h1 = (h1 * 0x01000193) >>> 0;\n }\n // Second 32-bit round with different seed\n let h2 = 0x050c5d1f;\n for (let i = 0; i < input.length; i++) {\n h2 ^= input.charCodeAt(i);\n h2 = (h2 * 0x01000193) >>> 0;\n }\n return h1.toString(36) + h2.toString(36);\n}\n"]}
1
+ {"version":3,"file":"hash.js","names":[],"sources":["../../src/utils/hash.ts"],"sourcesContent":["/**\n * FNV-1a hash producing a 64-bit result (two 32-bit rounds with different seeds).\n * Used for deterministic key generation where collisions must be rare.\n */\nexport function fnv1a64(input: string): string {\n // First 32-bit round with standard FNV offset basis\n let h1 = 0x811c9dc5;\n for (let i = 0; i < input.length; i++) {\n h1 ^= input.charCodeAt(i);\n h1 = (h1 * 0x01000193) >>> 0;\n }\n // Second 32-bit round with different seed\n let h2 = 0x050c5d1f;\n for (let i = 0; i < input.length; i++) {\n h2 ^= input.charCodeAt(i);\n h2 = (h2 * 0x01000193) >>> 0;\n }\n return h1.toString(36) + h2.toString(36);\n}\n"],"mappings":";;;;;AAIA,SAAgB,QAAQ,OAAuB;CAE7C,IAAI,KAAK;AACT,MAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,MAAM,WAAW,EAAE;AACzB,OAAM,KAAK,aAAgB;;CAG7B,IAAI,KAAK;AACT,MAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,MAAM,WAAW,EAAE;AACzB,OAAM,KAAK,aAAgB;;AAE7B,QAAO,GAAG,SAAS,GAAG,GAAG,GAAG,SAAS,GAAG"}
@@ -1,4 +1,7 @@
1
- export declare function normalizeManifestFile(file: string): string;
2
- export declare function manifestFileWithBase(file: string, base: string): string;
3
- export declare function manifestFilesWithBase(files: string[], base: string): string[];
1
+ //#region src/utils/manifest-paths.d.ts
2
+ declare function normalizeManifestFile(file: string): string;
3
+ declare function manifestFileWithBase(file: string, base: string): string;
4
+ declare function manifestFilesWithBase(files: string[], base: string): string[];
5
+ //#endregion
6
+ export { manifestFileWithBase, manifestFilesWithBase, normalizeManifestFile };
4
7
  //# sourceMappingURL=manifest-paths.d.ts.map
@@ -1,20 +1,19 @@
1
- export function normalizeManifestFile(file) {
2
- return file.startsWith("/") ? file.slice(1) : file;
1
+ //#region src/utils/manifest-paths.ts
2
+ function normalizeManifestFile(file) {
3
+ return file.startsWith("/") ? file.slice(1) : file;
3
4
  }
4
- export function manifestFileWithBase(file, base) {
5
- const normalizedFile = normalizeManifestFile(file);
6
- if (!base || base === "/")
7
- return normalizedFile;
8
- // Vite's SSR manifest stores base-prefixed paths without a leading slash,
9
- // e.g. "docs/assets/app.js" for base "/docs/".
10
- const normalizedBase = normalizeManifestFile(base).replace(/\/+$/, "");
11
- if (!normalizedBase)
12
- return normalizedFile;
13
- if (normalizedFile.startsWith(normalizedBase + "/"))
14
- return normalizedFile;
15
- return normalizedBase + "/" + normalizedFile;
5
+ function manifestFileWithBase(file, base) {
6
+ const normalizedFile = normalizeManifestFile(file);
7
+ if (!base || base === "/") return normalizedFile;
8
+ const normalizedBase = normalizeManifestFile(base).replace(/\/+$/, "");
9
+ if (!normalizedBase) return normalizedFile;
10
+ if (normalizedFile.startsWith(normalizedBase + "/")) return normalizedFile;
11
+ return normalizedBase + "/" + normalizedFile;
16
12
  }
17
- export function manifestFilesWithBase(files, base) {
18
- return files.map((file) => manifestFileWithBase(file, base));
13
+ function manifestFilesWithBase(files, base) {
14
+ return files.map((file) => manifestFileWithBase(file, base));
19
15
  }
16
+ //#endregion
17
+ export { manifestFileWithBase, manifestFilesWithBase, normalizeManifestFile };
18
+
20
19
  //# sourceMappingURL=manifest-paths.js.map