@wular/pnext 0.1.6 → 0.1.8

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 (337) hide show
  1. package/bin/pnext +9 -2
  2. package/dist/server/_chunks/aliases-pycbtjt1.js +46 -0
  3. package/dist/server/_chunks/analyze-4d9e00g9.js +449 -0
  4. package/dist/server/_chunks/boot-bhemypxz.js +38 -0
  5. package/dist/server/_chunks/build-c991dv65.js +86 -0
  6. package/dist/server/_chunks/build-kh5e3x48.js +3341 -0
  7. package/dist/server/_chunks/build-tier-0a96kmx3.js +2456 -0
  8. package/dist/server/_chunks/compile-040r79gj.js +22 -0
  9. package/dist/server/_chunks/config-0tvz03a6.js +24 -0
  10. package/dist/server/_chunks/config-27rj7830.js +36 -0
  11. package/dist/server/_chunks/create-9rvwshsp.js +135 -0
  12. package/dist/server/_chunks/dev-ex9exynt.js +220 -0
  13. package/dist/server/_chunks/esbuild-yyktfrtt.js +15 -0
  14. package/dist/server/_chunks/generate-myw9hef7.js +22 -0
  15. package/dist/server/_chunks/index-0r5eqfc7.js +279 -0
  16. package/dist/server/_chunks/index-0yjv5v47.js +105 -0
  17. package/dist/server/_chunks/index-11xpbfej.js +17 -0
  18. package/dist/server/_chunks/index-141vcwk6.js +109 -0
  19. package/dist/server/_chunks/index-1pzm1hdy.js +4130 -0
  20. package/dist/server/_chunks/index-29pq0kax.js +590 -0
  21. package/dist/server/_chunks/index-2vz0wzdn.js +59 -0
  22. package/dist/server/_chunks/index-2wfv4kvx.js +182 -0
  23. package/dist/server/_chunks/index-38xpdxwd.js +194 -0
  24. package/dist/server/_chunks/index-3e075kny.js +128 -0
  25. package/dist/server/_chunks/index-3ycf5ckv.js +472 -0
  26. package/dist/server/_chunks/index-4399bvd2.js +18 -0
  27. package/dist/server/_chunks/index-4da76t62.js +297 -0
  28. package/dist/server/_chunks/index-4t92hdxd.js +172 -0
  29. package/dist/server/_chunks/index-4zzebszd.js +10 -0
  30. package/dist/server/_chunks/index-52k54ykj.js +95 -0
  31. package/dist/server/_chunks/index-5hr4062s.js +70 -0
  32. package/dist/server/_chunks/index-68m3mwbd.js +84 -0
  33. package/dist/server/_chunks/index-6b009mt0.js +56 -0
  34. package/dist/server/_chunks/index-6gex3pfa.js +15 -0
  35. package/dist/server/_chunks/index-6kp9r0d9.js +11 -0
  36. package/dist/server/_chunks/index-6q7zvrap.js +134 -0
  37. package/dist/server/_chunks/index-71885zaq.js +284 -0
  38. package/dist/server/_chunks/index-73z4esab.js +38 -0
  39. package/dist/server/_chunks/index-79ngvam8.js +60 -0
  40. package/dist/server/_chunks/index-7wc9n8be.js +25 -0
  41. package/dist/server/_chunks/index-8ct7rqy3.js +198 -0
  42. package/dist/server/_chunks/index-8kcxdfya.js +206 -0
  43. package/dist/server/_chunks/index-9ch50vtq.js +18 -0
  44. package/dist/server/_chunks/index-9f49w76j.js +213 -0
  45. package/dist/server/_chunks/index-9hz3s0m8.js +851 -0
  46. package/dist/server/_chunks/index-akkrvjn6.js +535 -0
  47. package/dist/server/_chunks/index-b6wtkdp4.js +24 -0
  48. package/dist/server/_chunks/index-b7j671dj.js +207 -0
  49. package/dist/server/_chunks/index-bcws5eh2.js +35 -0
  50. package/dist/server/_chunks/index-bzd2ef7t.js +10 -0
  51. package/dist/server/_chunks/index-cjgqs13g.js +65 -0
  52. package/dist/server/_chunks/index-ckkdpht5.js +41 -0
  53. package/dist/server/_chunks/index-cn86z041.js +296 -0
  54. package/dist/server/_chunks/index-cvr4z22m.js +92 -0
  55. package/dist/server/_chunks/index-cyfednwb.js +87 -0
  56. package/dist/server/_chunks/index-d158y67j.js +152 -0
  57. package/dist/server/_chunks/index-d1jsmhhk.js +955 -0
  58. package/dist/server/_chunks/index-dg0f05zs.js +199 -0
  59. package/dist/server/_chunks/index-dgr390q7.js +9438 -0
  60. package/dist/server/_chunks/index-drwv61cc.js +185 -0
  61. package/dist/server/_chunks/index-e3a6yx84.js +18 -0
  62. package/dist/server/_chunks/index-e88tyv35.js +45 -0
  63. package/dist/server/_chunks/index-en7n9f7m.js +22 -0
  64. package/dist/server/_chunks/index-entm8bmz.js +28 -0
  65. package/dist/server/_chunks/index-evhd413j.js +57 -0
  66. package/dist/server/_chunks/index-ezgj0tr1.js +88 -0
  67. package/dist/server/_chunks/index-fjv96re1.js +5295 -0
  68. package/dist/server/_chunks/index-fn1chkkd.js +214 -0
  69. package/dist/server/_chunks/index-fp8r0sqs.js +64 -0
  70. package/dist/server/_chunks/index-gcmj16xy.js +92 -0
  71. package/dist/server/_chunks/index-gkndxkxf.js +736 -0
  72. package/dist/server/_chunks/index-grta8ap3.js +238 -0
  73. package/dist/server/_chunks/index-h2a70tg4.js +7 -0
  74. package/dist/server/_chunks/index-h4xy648y.js +51 -0
  75. package/dist/server/_chunks/index-hdbwtdv2.js +352 -0
  76. package/dist/server/_chunks/index-he6n2bvp.js +1270 -0
  77. package/dist/server/_chunks/index-j0m1jxqa.js +1253 -0
  78. package/dist/server/_chunks/index-j2zrcp1k.js +66 -0
  79. package/dist/server/_chunks/index-j681c48a.js +2530 -0
  80. package/dist/server/_chunks/index-jbj7ehef.js +50 -0
  81. package/dist/server/_chunks/index-jcsjq3d1.js +20 -0
  82. package/dist/server/_chunks/index-jks0x0a1.js +14 -0
  83. package/dist/server/_chunks/index-jn9rbhrx.js +1599 -0
  84. package/dist/server/_chunks/index-jt8e1pje.js +12 -0
  85. package/dist/server/_chunks/index-kdhxpwyq.js +483 -0
  86. package/dist/server/_chunks/index-knp0s912.js +7 -0
  87. package/dist/server/_chunks/index-kqyy1d4f.js +50 -0
  88. package/dist/server/_chunks/index-kresp2n8.js +445 -0
  89. package/dist/server/_chunks/index-m63czgq5.js +590 -0
  90. package/dist/server/_chunks/index-ms9v9tnx.js +31 -0
  91. package/dist/server/_chunks/index-n4hxpng2.js +11 -0
  92. package/dist/server/_chunks/index-n629dy38.js +1071 -0
  93. package/dist/server/_chunks/index-nf3df4jy.js +266 -0
  94. package/dist/server/_chunks/index-nqh3xhdc.js +57 -0
  95. package/dist/server/_chunks/index-pym1cezq.js +39 -0
  96. package/dist/server/_chunks/index-q3r9z8mq.js +213 -0
  97. package/dist/server/_chunks/index-q738kkhj.js +100 -0
  98. package/dist/server/_chunks/index-qcrvt6er.js +112 -0
  99. package/dist/server/_chunks/index-qjj6gddn.js +54 -0
  100. package/dist/server/_chunks/index-qpwsgt3a.js +158 -0
  101. package/dist/server/_chunks/index-r97ptz1q.js +97 -0
  102. package/dist/server/_chunks/index-ras0sdab.js +26 -0
  103. package/dist/server/_chunks/index-rcs322t1.js +19 -0
  104. package/dist/server/_chunks/index-rgj5mx84.js +101 -0
  105. package/dist/server/_chunks/index-rjegyfx4.js +1435 -0
  106. package/dist/server/_chunks/index-rt9qq1va.js +4 -0
  107. package/dist/server/_chunks/index-rthrsed5.js +356 -0
  108. package/dist/server/_chunks/index-sq3kvz3g.js +200 -0
  109. package/dist/server/_chunks/index-stbk3jhn.js +31 -0
  110. package/dist/server/_chunks/index-tf4j19ge.js +130 -0
  111. package/dist/server/_chunks/index-tgcakdxc.js +125 -0
  112. package/dist/server/_chunks/index-tgsfjmep.js +74 -0
  113. package/dist/server/_chunks/index-tq1f96v7.js +51 -0
  114. package/dist/server/_chunks/index-tq3b39a5.js +107 -0
  115. package/dist/server/_chunks/index-typcbcsv.js +819 -0
  116. package/dist/server/_chunks/index-v1ags1na.js +132 -0
  117. package/dist/server/_chunks/index-vmr35jjw.js +170 -0
  118. package/dist/server/_chunks/index-vvq7rqtn.js +329 -0
  119. package/dist/server/_chunks/index-vz0km5qk.js +33 -0
  120. package/dist/server/_chunks/index-w6h8m6vp.js +138 -0
  121. package/dist/server/_chunks/index-web361b8.js +138 -0
  122. package/dist/server/_chunks/index-wm36rj4v.js +311 -0
  123. package/dist/server/_chunks/index-x0y005nh.js +283 -0
  124. package/dist/server/_chunks/index-x2m17v9c.js +6166 -0
  125. package/dist/server/_chunks/index-x3yn4ywm.js +22 -0
  126. package/dist/server/_chunks/index-x9c55pzy.js +871 -0
  127. package/dist/server/_chunks/index-xh1nbk46.js +1299 -0
  128. package/dist/server/_chunks/index-xvj80c3a.js +30 -0
  129. package/dist/server/_chunks/index-xywjg2vc.js +100 -0
  130. package/dist/server/_chunks/index-y4d02znn.js +66 -0
  131. package/dist/server/_chunks/index-y7mzvq2q.js +110 -0
  132. package/dist/server/_chunks/index-ye9hmsvf.js +47 -0
  133. package/dist/server/_chunks/index-yhxkxghe.js +56 -0
  134. package/dist/server/_chunks/index-yrjkqtfj.js +86 -0
  135. package/dist/server/_chunks/index-z88qv16t.js +11 -0
  136. package/dist/server/_chunks/index-zfrwq472.js +154 -0
  137. package/dist/server/_chunks/index-zqpqyg8p.js +666 -0
  138. package/dist/server/_chunks/loader-5en7wpt5.js +80 -0
  139. package/dist/server/_chunks/modules-t92favpj.js +76 -0
  140. package/dist/server/_chunks/pipeline-4t9q43ht.js +836 -0
  141. package/dist/server/_chunks/production-385bw8df.js +55 -0
  142. package/dist/server/_chunks/proxy-config-60gprphe.js +23 -0
  143. package/dist/server/_chunks/proxy-gfhmktbk.js +35 -0
  144. package/dist/server/_chunks/router-xnrva921.js +501 -0
  145. package/dist/server/_chunks/routes-ht868pdc.js +66 -0
  146. package/dist/server/_chunks/run-d40d63ag.js +697 -0
  147. package/dist/server/_chunks/server-2p8fgqq2.js +1839 -0
  148. package/dist/server/_chunks/tsconfig-defaults-bcn34eqb.js +21 -0
  149. package/dist/server/_chunks/typegen-dvtcjtaw.js +37 -0
  150. package/dist/server/api/client-cache.js +14 -0
  151. package/dist/server/cli/index.js +375 -0
  152. package/dist/server/cli/start.js +158 -0
  153. package/dist/server/client/reference.js +16 -0
  154. package/dist/server/compat/next/cache.js +56 -0
  155. package/dist/server/compat/next/canonical-url.js +13 -0
  156. package/dist/server/compat/next/client-cache.js +57 -0
  157. package/dist/server/compat/next/client-navigation.js +232 -0
  158. package/dist/server/compat/next/client-only.js +1 -0
  159. package/dist/server/compat/next/client-script.js +178 -0
  160. package/dist/server/compat/next/client-server.js +34 -0
  161. package/dist/server/compat/next/config-headers.js +34 -0
  162. package/dist/server/compat/next/config-loader.js +25 -0
  163. package/dist/server/compat/next/config.js +10 -0
  164. package/dist/server/compat/next/constants.js +18 -0
  165. package/dist/server/compat/next/custom-server.js +10 -0
  166. package/dist/server/compat/next/dist/client/components/app-router-headers.js +48 -0
  167. package/dist/server/compat/next/dist/server/web/spec-extension/revalidate.js +27 -0
  168. package/dist/server/compat/next/dist/server/web/spec-extension/unstable-cache.js +25 -0
  169. package/dist/server/compat/next/dist/server/web/spec-extension/unstable-no-store.js +25 -0
  170. package/dist/server/compat/next/dynamic.js +21 -0
  171. package/dist/server/compat/next/error.js +112 -0
  172. package/dist/server/compat/next/font/cache.js +16 -0
  173. package/dist/server/compat/next/font/google.js +3 -0
  174. package/dist/server/compat/next/font/index.js +1 -0
  175. package/dist/server/compat/next/font/local.js +24 -0
  176. package/dist/server/compat/next/font/runtime-client.js +33 -0
  177. package/dist/server/compat/next/font/runtime.js +43 -0
  178. package/dist/server/compat/next/font/shared.js +22 -0
  179. package/dist/server/compat/next/form.js +129 -0
  180. package/dist/server/compat/next/head.js +10 -0
  181. package/dist/server/compat/next/headers.js +30 -0
  182. package/dist/server/compat/next/image/client.js +11 -0
  183. package/dist/server/compat/next/image/config.js +18 -0
  184. package/dist/server/compat/next/image/optimizer.js +25 -0
  185. package/dist/server/compat/next/image/patterns.js +12 -0
  186. package/dist/server/compat/next/image/props.js +16 -0
  187. package/dist/server/compat/next/image/shared.js +86 -0
  188. package/dist/server/compat/next/image/static-metadata.js +32 -0
  189. package/dist/server/compat/next/image/validate.js +8 -0
  190. package/dist/server/compat/next/image.js +59 -0
  191. package/dist/server/compat/next/index.js +1 -0
  192. package/dist/server/compat/next/legacy-image.js +78 -0
  193. package/dist/server/compat/next/legacy-request-apis.js +24 -0
  194. package/dist/server/compat/next/link-transform.js +15 -0
  195. package/dist/server/compat/next/link.js +14 -0
  196. package/dist/server/compat/next/navigation.js +191 -0
  197. package/dist/server/compat/next/offline.js +45 -0
  198. package/dist/server/compat/next/og.js +8 -0
  199. package/dist/server/compat/next/preferred-region.js +8 -0
  200. package/dist/server/compat/next/redirects.js +32 -0
  201. package/dist/server/compat/next/resource-hints.js +30 -0
  202. package/dist/server/compat/next/rewrites.js +43 -0
  203. package/dist/server/compat/next/root-params.js +121 -0
  204. package/dist/server/compat/next/route-state.js +23 -0
  205. package/dist/server/compat/next/router.js +103 -0
  206. package/dist/server/compat/next/script.js +37 -0
  207. package/dist/server/compat/next/server-only.js +1 -0
  208. package/dist/server/compat/next/server.js +131 -0
  209. package/dist/server/compat/next/svgr.js +14 -0
  210. package/dist/server/compat/next/telemetry.js +10 -0
  211. package/dist/server/compat/next/usage.js +13 -0
  212. package/dist/server/compat/next/user-agent.js +12 -0
  213. package/dist/server/compat/next/web-vitals.js +35 -0
  214. package/dist/server/compat/react/action-state.js +11 -0
  215. package/dist/server/compat/react/client-lite.js +83 -0
  216. package/dist/server/compat/react/client.js +131 -0
  217. package/dist/server/compat/react/compiler-runtime.js +42 -0
  218. package/dist/server/compat/react/dom-client.js +106 -0
  219. package/dist/server/compat/react/dom-react-server.js +37 -0
  220. package/dist/server/compat/react/dom-server.js +40 -0
  221. package/dist/server/compat/react/dom.js +52 -0
  222. package/dist/server/compat/react/hooks-extra.js +12 -0
  223. package/dist/server/compat/react/internals.js +14 -0
  224. package/dist/server/compat/react/parity.js +11 -0
  225. package/dist/server/compat/react/preact.js +113 -0
  226. package/dist/server/compat/react/react-server.js +133 -0
  227. package/dist/server/compat/react/router-shim.js +8 -0
  228. package/dist/server/compat/react/server-component-use.js +14 -0
  229. package/dist/server/compat/react/server-inserted-html.js +14 -0
  230. package/dist/server/compat/react/server.js +194 -0
  231. package/dist/server/compat/react/style-values.js +10 -0
  232. package/dist/server/compat/react/use.js +10 -0
  233. package/dist/server/compat/react/view-transition.js +12 -0
  234. package/dist/server/generation.json +1 -0
  235. package/package.json +4 -1
  236. package/reference/compat.md +1 -1
  237. package/reference/config.md +2 -2
  238. package/reference/dev.md +1 -1
  239. package/reference/getting-started.md +1 -1
  240. package/reference/rendering.md +4 -4
  241. package/src/api/dynamic.tsx +86 -4
  242. package/src/api/server.ts +24 -6
  243. package/src/cli/adapters/vercel-warm.ts +327 -62
  244. package/src/cli/adapters/vercel.ts +164 -1054
  245. package/src/cli/analyze.ts +3 -2
  246. package/src/cli/build/cache.ts +6 -6
  247. package/src/cli/build.ts +78 -45
  248. package/src/cli/index.ts +21 -3
  249. package/src/cli/serve/immutable.ts +31 -0
  250. package/src/cli/serve/pipeline.ts +97 -93
  251. package/src/cli/serve/standalone-worker.ts +8 -0
  252. package/src/cli/serve/standalone.ts +703 -0
  253. package/src/cli/start.ts +31 -8
  254. package/src/client/build.ts +1 -1
  255. package/src/client/chunk-fold.ts +19 -6
  256. package/src/client/react-tier.ts +3 -2
  257. package/src/client/reference-stub.ts +23 -36
  258. package/src/compat/actions/client-plugin.ts +4 -2
  259. package/src/compat/actions/config.ts +6 -5
  260. package/src/compat/actions/extensions.ts +5 -5
  261. package/src/compat/aliases.ts +8 -1
  262. package/src/compat/bundler/config.ts +88 -0
  263. package/src/compat/bundler/optimize-package-imports.ts +86 -26
  264. package/src/compat/bundler/relay-transform.ts +15 -3
  265. package/src/compat/bundler/require-context.ts +2 -1
  266. package/src/compat/bundler/webpack-loaders.ts +3 -2
  267. package/src/compat/bundler/worker.ts +2 -2
  268. package/src/compat/cache-control.ts +16 -8
  269. package/src/compat/css/inline-css.ts +1 -1
  270. package/src/compat/css/modules.ts +18 -5
  271. package/src/compat/export/build-complete.ts +1 -1
  272. package/src/compat/export/emit.ts +4 -4
  273. package/src/compat/export/standalone.ts +30 -65
  274. package/src/compat/image-optimizer/optimize.ts +1 -1
  275. package/src/compat/lifecycle/error-funnel.ts +1 -1
  276. package/src/compat/lifecycle/instrumentation-client.ts +4 -3
  277. package/src/compat/lifecycle/instrumentation.ts +117 -24
  278. package/src/compat/lifecycle/testmode.ts +3 -2
  279. package/src/compat/metadata-artifacts.ts +1 -1
  280. package/src/compat/next/config-loader.ts +140 -13
  281. package/src/compat/next/dynamic.tsx +10 -23
  282. package/src/compat/next/font/cache.ts +2 -1
  283. package/src/compat/next/font/runtime.ts +23 -3
  284. package/src/compat/next/og.ts +3 -3
  285. package/src/compat/next/usage.ts +3 -2
  286. package/src/compat/pages/api.ts +83 -14
  287. package/src/compat/pages/router.ts +30 -14
  288. package/src/compat/register/bundler.ts +3 -1
  289. package/src/compat/register/image.ts +1 -1
  290. package/src/compat/register/middleware.ts +1 -1
  291. package/src/compat/register/otel.ts +5 -9
  292. package/src/compat/register/render.ts +3 -1
  293. package/src/compat/register/use-cache.ts +3 -1
  294. package/src/compat/release.ts +46 -0
  295. package/src/compat/segment/serve.ts +1 -1
  296. package/src/compat/typecheck/check.ts +6 -4
  297. package/src/compat/validation/validate.ts +10 -7
  298. package/src/config.ts +76 -9
  299. package/src/css/assets.ts +213 -0
  300. package/src/css/build.ts +190 -247
  301. package/src/dev/client-chunk-store.ts +2 -1
  302. package/src/dev/restart/client-key.ts +2 -1
  303. package/src/dev/restart/global-css.ts +2 -1
  304. package/src/dev/restart/route-bundle-key.ts +2 -1
  305. package/src/dev/restart/route-facts.ts +2 -1
  306. package/src/dev/server.ts +34 -14
  307. package/src/extensions.ts +4 -0
  308. package/src/out-paths.ts +10 -0
  309. package/src/render/hooks.ts +13 -0
  310. package/src/render/renderer.ts +53 -33
  311. package/src/request/context.ts +9 -0
  312. package/src/resolve/dynamic.ts +7 -1
  313. package/src/resolve/engine.ts +2 -12
  314. package/src/resolve/imports.ts +12 -52
  315. package/src/resolve/package-json.ts +56 -0
  316. package/src/resolve/scan-facts.ts +250 -1
  317. package/src/routing/href.ts +10 -3
  318. package/src/routing/match.ts +287 -0
  319. package/src/routing/metadata-files.ts +20 -6
  320. package/src/routing/proxy-config.ts +137 -0
  321. package/src/routing/proxy.ts +35 -134
  322. package/src/routing/routes.ts +22 -281
  323. package/src/runtime/fingerprint.ts +23 -8
  324. package/src/runtime/load.ts +170 -0
  325. package/src/runtime/loader.ts +218 -44
  326. package/src/runtime/module-cache.ts +15 -1
  327. package/src/runtime/modules.ts +405 -82
  328. package/src/runtime/prebundle.ts +101 -0
  329. package/src/runtime/production.ts +456 -0
  330. package/src/runtime/release-graph.ts +342 -0
  331. package/src/runtime/vendor-build.ts +750 -17
  332. package/src/runtime/vendor.ts +16 -3
  333. package/src/types.ts +4 -3
  334. package/src/utils/directive.ts +40 -0
  335. package/src/utils/fs.ts +95 -4
  336. package/src/utils/resource-query.ts +12 -0
  337. package/src/cli/serve/entry.ts +0 -45
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ var __require = import.meta.require;
3
+
4
+ export { __require };
@@ -0,0 +1,356 @@
1
+ // @bun
2
+ // src/compat/next/image/props.ts
3
+ var DEFAULT_IMAGES_CONFIG = {
4
+ deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
5
+ imageSizes: [32, 48, 64, 96, 128, 256, 384],
6
+ allSizes: [32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
7
+ qualities: [75],
8
+ formats: ["image/webp"],
9
+ path: "/_next/image",
10
+ loader: "default",
11
+ loaderFile: "",
12
+ domains: [],
13
+ disableStaticImages: false,
14
+ minimumCacheTTL: 14400,
15
+ maximumRedirects: 3,
16
+ maximumResponseBody: 50000000,
17
+ dangerouslyAllowLocalIP: false,
18
+ dangerouslyAllowSVG: false,
19
+ contentSecurityPolicy: `script-src 'none'; frame-src 'none'; sandbox;`,
20
+ contentDispositionType: "attachment",
21
+ localPatterns: undefined,
22
+ remotePatterns: [],
23
+ unoptimized: false,
24
+ customCacheHandler: false
25
+ };
26
+ var INVALID_BACKGROUND_SIZE = new Set([
27
+ "-moz-initial",
28
+ "fill",
29
+ "none",
30
+ "scale-down",
31
+ undefined
32
+ ]);
33
+ function unwrapStaticImport(src) {
34
+ return "default" in src ? src.default : src;
35
+ }
36
+ function toNumber(value) {
37
+ if (value === undefined)
38
+ return;
39
+ if (typeof value === "number")
40
+ return value;
41
+ const n = parseInt(value, 10);
42
+ return Number.isNaN(n) ? undefined : n;
43
+ }
44
+ function getImagesConfig() {
45
+ return typeof __PNEXT_IMAGE_CONFIG_INLINED__ === "boolean" ? __PNEXT_IMAGE_CONFIG_INLINE__ : globalThis.__PNEXT_IMAGE_CONFIG__ ?? DEFAULT_IMAGES_CONFIG;
46
+ }
47
+ function defaultLoader(config, src, width, quality) {
48
+ const q = findClosestQuality(config, quality);
49
+ return `${config.path}?url=${encodeURIComponent(src)}&w=${width}&q=${q}`;
50
+ }
51
+ function findClosestQuality(config, quality) {
52
+ const qualities = config.qualities;
53
+ if (!qualities || qualities.length === 0)
54
+ return quality ?? 75;
55
+ if (quality === undefined)
56
+ return closest(qualities, 75);
57
+ return closest(qualities, quality);
58
+ }
59
+ function closest(values, target) {
60
+ let best = values[0];
61
+ let bestDelta = Math.abs(best - target);
62
+ for (const value of values) {
63
+ const delta = Math.abs(value - target);
64
+ if (delta < bestDelta) {
65
+ best = value;
66
+ bestDelta = delta;
67
+ }
68
+ }
69
+ return best;
70
+ }
71
+ function getWidths(config, width, sizes) {
72
+ const { deviceSizes, allSizes } = config;
73
+ if (sizes) {
74
+ const viewportWidthRe = /(^|\s)(1?\d?\d)vw/g;
75
+ const percentSizes = [];
76
+ for (let match;match = viewportWidthRe.exec(sizes); ) {
77
+ percentSizes.push(parseInt(match[2], 10));
78
+ }
79
+ if (percentSizes.length) {
80
+ const smallestRatio = Math.min(...percentSizes) * 0.01;
81
+ return {
82
+ widths: allSizes.filter((s) => s >= deviceSizes[0] * smallestRatio),
83
+ kind: "w"
84
+ };
85
+ }
86
+ return { widths: allSizes, kind: "w" };
87
+ }
88
+ if (typeof width !== "number")
89
+ return { widths: deviceSizes, kind: "w" };
90
+ const widths = [
91
+ ...new Set([width, width * 2].map((w) => allSizes.find((p) => p >= w) || allSizes[allSizes.length - 1]))
92
+ ];
93
+ return { widths, kind: "x" };
94
+ }
95
+ function generateImgAttrs(params) {
96
+ const { config, src, unoptimized, width, quality, sizes, loader } = params;
97
+ if (unoptimized)
98
+ return { src, srcSet: undefined, sizes: undefined };
99
+ const { widths, kind } = getWidths(config, width, sizes);
100
+ const last = widths.length - 1;
101
+ return {
102
+ sizes: !sizes && kind === "w" ? "100vw" : sizes,
103
+ srcSet: widths.map((w, i) => `${loader({ config, src, quality, width: w })} ${kind === "w" ? w : i + 1}${kind}`).join(", "),
104
+ src: loader({ config, src, quality, width: widths[last] })
105
+ };
106
+ }
107
+ function getImageBlurSvg(params) {
108
+ const { widthInt, heightInt, blurWidth, blurHeight, blurDataURL, objectFit } = params;
109
+ const std = 20;
110
+ const svgWidth = blurWidth ? blurWidth * 40 : widthInt;
111
+ const svgHeight = blurHeight ? blurHeight * 40 : heightInt;
112
+ const viewBox = svgWidth && svgHeight ? `viewBox='0 0 ${svgWidth} ${svgHeight}'` : "";
113
+ const preserveAspectRatio = viewBox ? "none" : objectFit === "contain" ? "xMidYMid" : objectFit === "cover" ? "xMidYMid slice" : "none";
114
+ return `%3Csvg xmlns='http://www.w3.org/2000/svg' ${viewBox}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='${std}'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='${std}'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${preserveAspectRatio}' style='filter: url(%23b);' href='${blurDataURL}'/%3E%3C/svg%3E`;
115
+ }
116
+ function getImageProps(imageProps) {
117
+ const resolved = resolveImageProps(imageProps, getImagesConfig());
118
+ return { props: resolved.props };
119
+ }
120
+ function unstable_getImgProps(imageProps) {
121
+ return getImageProps(imageProps);
122
+ }
123
+ function resolveImageProps(imageProps, config, blurComplete = false, showAltText = false) {
124
+ const {
125
+ src: rawSrc,
126
+ alt = "",
127
+ width: widthProp,
128
+ height: heightProp,
129
+ fill: fillProp = false,
130
+ loader,
131
+ quality: qualityProp,
132
+ priority = false,
133
+ preload = false,
134
+ loading,
135
+ placeholder = "empty",
136
+ blurDataURL: blurDataURLProp,
137
+ unoptimized: unoptimizedProp,
138
+ overrideSrc,
139
+ sizes: sizesProp,
140
+ fetchPriority,
141
+ decoding = "async",
142
+ style: styleProp,
143
+ layout,
144
+ objectFit,
145
+ objectPosition,
146
+ onLoad: _onLoad,
147
+ onError: _onError,
148
+ onLoadingComplete: _onLoadingComplete,
149
+ ...rest
150
+ } = imageProps;
151
+ let fill = fillProp;
152
+ let sizes = sizesProp;
153
+ let userStyle = normalizeStyle(styleProp);
154
+ if (layout) {
155
+ if (layout === "fill")
156
+ fill = true;
157
+ const layoutStyle = layout === "intrinsic" ? { maxWidth: "100%", height: "auto" } : layout === "responsive" ? { width: "100%", height: "auto" } : undefined;
158
+ if (layoutStyle)
159
+ userStyle = { ...userStyle, ...layoutStyle };
160
+ if (!sizes && (layout === "responsive" || layout === "fill"))
161
+ sizes = "100vw";
162
+ }
163
+ const staticData = rawSrc && typeof rawSrc !== "string" ? unwrapStaticImport(rawSrc) : undefined;
164
+ const src = typeof rawSrc === "string" ? rawSrc : staticData?.src ?? "";
165
+ let width = toNumber(widthProp);
166
+ let height = toNumber(heightProp);
167
+ if (staticData) {
168
+ if (width === undefined && height === undefined) {
169
+ width = staticData.width;
170
+ height = staticData.height;
171
+ } else if (width !== undefined && height === undefined) {
172
+ height = Math.round(staticData.height / staticData.width * width);
173
+ } else if (height !== undefined && width === undefined) {
174
+ width = Math.round(staticData.width / staticData.height * height);
175
+ }
176
+ }
177
+ const blurDataURL = blurDataURLProp ?? staticData?.blurDataURL;
178
+ const quality = toNumber(qualityProp);
179
+ let unoptimized = Boolean(unoptimizedProp ?? config.unoptimized);
180
+ if (!src || src.startsWith("data:") || src.startsWith("blob:"))
181
+ unoptimized = true;
182
+ const isDefaultLoader = !loader && !config.loaderFile;
183
+ if (isDefaultLoader && !config.dangerouslyAllowSVG && (src.split("?", 1)[0] ?? "").endsWith(".svg")) {
184
+ unoptimized = true;
185
+ }
186
+ if (!unoptimized)
187
+ validateLocalSrc(config, src);
188
+ const activeLoader = loader ? ({ src: s, width: w, quality: q }) => loader({ src: s, width: w, quality: q }) : ({ config: c, src: s, width: w, quality: q }) => defaultLoader(c, s, w, q);
189
+ const imgAttrs = generateImgAttrs({
190
+ config,
191
+ src,
192
+ unoptimized,
193
+ width: fill ? undefined : width,
194
+ quality,
195
+ sizes,
196
+ loader: activeLoader
197
+ });
198
+ const isBlur = placeholder === "blur" && Boolean(blurDataURL);
199
+ const imgStyle = {
200
+ ...fill ? { ...fillStyle(), objectFit, objectPosition } : {},
201
+ ...showAltText ? {} : { color: "transparent" },
202
+ ...userStyle
203
+ };
204
+ const objectFitVal = typeof imgStyle.objectFit === "string" ? imgStyle.objectFit : undefined;
205
+ const backgroundImage = !blurComplete && placeholder !== "empty" ? placeholder === "blur" ? (typeof __PNEXT_IMAGE_BLUR__ === "boolean" ? __PNEXT_IMAGE_BLUR__ : true) && blurDataURL ? `url("data:image/svg+xml;charset=utf-8,${getImageBlurSvg({
206
+ widthInt: fill ? undefined : width,
207
+ heightInt: fill ? undefined : height,
208
+ blurWidth: staticData?.blurWidth,
209
+ blurHeight: staticData?.blurHeight,
210
+ blurDataURL,
211
+ objectFit: objectFitVal
212
+ })}")` : undefined : `url("${placeholder}")` : undefined;
213
+ let backgroundSize = "cover";
214
+ if (objectFitVal === "fill")
215
+ backgroundSize = "100% 100%";
216
+ else if (objectFitVal && !INVALID_BACKGROUND_SIZE.has(objectFitVal))
217
+ backgroundSize = objectFitVal;
218
+ const placeholderStyle = backgroundImage ? {
219
+ backgroundSize,
220
+ backgroundPosition: imgStyle.objectPosition || "50% 50%",
221
+ backgroundRepeat: "no-repeat",
222
+ backgroundImage
223
+ } : {};
224
+ const style = serializeStyle({ ...imgStyle, ...placeholderStyle });
225
+ const resolvedSrc = (overrideSrc ?? imgAttrs.src) || undefined;
226
+ const props = {
227
+ ...rest,
228
+ alt,
229
+ ...resolvedSrc !== undefined ? { src: resolvedSrc } : {},
230
+ ...imgAttrs.srcSet ? { srcSet: imgAttrs.srcSet } : {},
231
+ ...imgAttrs.sizes ? { sizes: imgAttrs.sizes } : {},
232
+ decoding,
233
+ style
234
+ };
235
+ if (!fill) {
236
+ if (width !== undefined)
237
+ props.width = width;
238
+ if (height !== undefined)
239
+ props.height = height;
240
+ }
241
+ if (loading !== undefined)
242
+ props.loading = loading;
243
+ else if (!priority && !preload)
244
+ props.loading = "lazy";
245
+ if (fetchPriority !== undefined)
246
+ props.fetchpriority = fetchPriority;
247
+ return {
248
+ props,
249
+ meta: {
250
+ preload: preload || priority,
251
+ fill,
252
+ unoptimized,
253
+ placeholder: isBlur ? "blur" : String(placeholder),
254
+ imgAttributes: {
255
+ src: resolvedSrc ?? "",
256
+ ...imgAttrs.srcSet ? { srcSet: imgAttrs.srcSet } : {},
257
+ ...imgAttrs.sizes ? { sizes: imgAttrs.sizes } : {}
258
+ },
259
+ ...backgroundImage ? { loadedStyle: serializeStyle(imgStyle) } : {}
260
+ }
261
+ };
262
+ }
263
+ function normalizeStyle(style) {
264
+ if (!style)
265
+ return {};
266
+ if (typeof style !== "string")
267
+ return { ...style };
268
+ const out = {};
269
+ for (const decl of style.split(";")) {
270
+ const [k, v] = decl.split(":");
271
+ if (k && v)
272
+ out[camel(k.trim())] = v.trim();
273
+ }
274
+ return out;
275
+ }
276
+ function fillStyle() {
277
+ return {
278
+ position: "absolute",
279
+ height: "100%",
280
+ width: "100%",
281
+ left: "0",
282
+ top: "0",
283
+ right: "0",
284
+ bottom: "0"
285
+ };
286
+ }
287
+ function validateLocalSrc(config, src) {
288
+ if (!src.startsWith("/") || src.startsWith("//") || config.localPatterns !== undefined)
289
+ return;
290
+ const search = new URL(src, "http://n").search;
291
+ if (!search)
292
+ return;
293
+ throw new Error(`Image with src "${src}" is using a query string which is not configured in images.localPatterns.
294
+ Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`);
295
+ }
296
+ function camel(prop) {
297
+ return prop.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
298
+ }
299
+ var UNITLESS_STYLE_PROPS = new Set([
300
+ "animationIterationCount",
301
+ "aspectRatio",
302
+ "borderImageOutset",
303
+ "borderImageSlice",
304
+ "borderImageWidth",
305
+ "boxFlex",
306
+ "boxFlexGroup",
307
+ "boxOrdinalGroup",
308
+ "columnCount",
309
+ "columns",
310
+ "flex",
311
+ "flexGrow",
312
+ "flexPositive",
313
+ "flexShrink",
314
+ "flexNegative",
315
+ "flexOrder",
316
+ "gridArea",
317
+ "gridRow",
318
+ "gridRowEnd",
319
+ "gridRowSpan",
320
+ "gridRowStart",
321
+ "gridColumn",
322
+ "gridColumnEnd",
323
+ "gridColumnSpan",
324
+ "gridColumnStart",
325
+ "fontWeight",
326
+ "lineClamp",
327
+ "lineHeight",
328
+ "opacity",
329
+ "order",
330
+ "orphans",
331
+ "tabSize",
332
+ "widows",
333
+ "zIndex",
334
+ "zoom",
335
+ "fillOpacity",
336
+ "floodOpacity",
337
+ "stopOpacity",
338
+ "strokeDasharray",
339
+ "strokeDashoffset",
340
+ "strokeMiterlimit",
341
+ "strokeOpacity",
342
+ "strokeWidth"
343
+ ]);
344
+ function serializeStyle(style) {
345
+ return Object.entries(style).filter(([, v]) => v !== undefined && v !== "").map(([k, v]) => `${kebab(k)}:${cssValue(k, v)}`).join(";");
346
+ }
347
+ function cssValue(prop, value) {
348
+ if (typeof value === "number" && value !== 0 && !UNITLESS_STYLE_PROPS.has(prop))
349
+ return `${value}px`;
350
+ return String(value);
351
+ }
352
+ function kebab(prop) {
353
+ return prop.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
354
+ }
355
+
356
+ export { getImagesConfig, findClosestQuality, getImageProps, unstable_getImgProps, resolveImageProps };
@@ -0,0 +1,200 @@
1
+ // @bun
2
+ // src/compat/next/image/validate.ts
3
+ import fs from "fs";
4
+ import path from "path";
5
+ var LOADERS = ["default", "imgix", "cloudinary", "akamai", "custom"];
6
+ var FORMATS = ["image/avif", "image/webp"];
7
+ var DISPOSITIONS = ["inline", "attachment"];
8
+ var REMOTE_PATTERN_KEYS = new Set(["protocol", "hostname", "port", "pathname", "search"]);
9
+ var LOCAL_PATTERN_KEYS = new Set(["pathname", "search"]);
10
+ function hasDefaultExport(file) {
11
+ let source;
12
+ try {
13
+ source = fs.readFileSync(file, "utf8");
14
+ } catch {
15
+ return false;
16
+ }
17
+ return /\bexport\s+default\b/.test(source) || /\bmodule\.exports\s*=/.test(source);
18
+ }
19
+ function received(value) {
20
+ if (value === null)
21
+ return "null";
22
+ if (Array.isArray(value))
23
+ return "array";
24
+ return typeof value;
25
+ }
26
+ function quotedUnion(options) {
27
+ return options.map((option) => `'${option}'`).join(" | ");
28
+ }
29
+ function collectImagesConfigErrors(config, root) {
30
+ const errors = [];
31
+ const assetPrefix = config.assetPrefix;
32
+ if (typeof assetPrefix === "string" && assetPrefix !== "" && !assetPrefix.startsWith("/")) {
33
+ try {
34
+ new URL(assetPrefix);
35
+ } catch {
36
+ errors.push("Invalid assetPrefix provided. Original error: TypeError: Invalid URL");
37
+ }
38
+ }
39
+ const images = config.images;
40
+ if (images === undefined || images === null)
41
+ return errors;
42
+ if (typeof images !== "object" || Array.isArray(images)) {
43
+ errors.push(`Expected object, received ${received(images)} at "images"`);
44
+ return errors;
45
+ }
46
+ const img = images;
47
+ validateSizeArray(errors, img.deviceSizes, "images.deviceSizes");
48
+ validateSizeArray(errors, img.imageSizes, "images.imageSizes");
49
+ if (img.domains !== undefined) {
50
+ if (!Array.isArray(img.domains)) {
51
+ errors.push(`Expected array, received ${received(img.domains)} at "images.domains"`);
52
+ } else if (img.domains.length > 50) {
53
+ errors.push('Array must contain at most 50 element(s) at "images.domains"');
54
+ }
55
+ }
56
+ if (img.qualities !== undefined) {
57
+ if (!Array.isArray(img.qualities)) {
58
+ errors.push(`Expected array, received ${received(img.qualities)} at "images.qualities"`);
59
+ } else {
60
+ if (img.qualities.length < 1) {
61
+ errors.push('Array must contain at least 1 element(s) at "images.qualities"');
62
+ }
63
+ if (img.qualities.length > 20) {
64
+ errors.push('Array must contain at most 20 element(s) at "images.qualities"');
65
+ }
66
+ img.qualities.forEach((quality, index) => {
67
+ if (typeof quality !== "number") {
68
+ errors.push(`Expected number, received ${received(quality)} at "images.qualities[${index}]"`);
69
+ } else if (!Number.isInteger(quality)) {
70
+ errors.push(`Expected integer, received float at "images.qualities[${index}]"`);
71
+ } else if (quality < 1) {
72
+ errors.push(`Number must be greater than or equal to 1 at "images.qualities[${index}]"`);
73
+ } else if (quality > 100) {
74
+ errors.push(`Number must be less than or equal to 100 at "images.qualities[${index}]"`);
75
+ }
76
+ });
77
+ }
78
+ }
79
+ if (img.localPatterns !== undefined) {
80
+ if (!Array.isArray(img.localPatterns)) {
81
+ errors.push(`Expected array, received ${received(img.localPatterns)} at "images.localPatterns"`);
82
+ } else {
83
+ if (img.localPatterns.length > 25) {
84
+ errors.push('Array must contain at most 25 element(s) at "images.localPatterns"');
85
+ }
86
+ img.localPatterns.forEach((pattern, index) => {
87
+ if (!pattern || typeof pattern !== "object")
88
+ return;
89
+ const unknown = Object.keys(pattern).filter((key) => !LOCAL_PATTERN_KEYS.has(key));
90
+ if (unknown.length > 0) {
91
+ errors.push(`Unrecognized key(s) in object: ${unknown.map((key) => `'${key}'`).join(", ")} at "images.localPatterns[${index}]"`);
92
+ }
93
+ });
94
+ }
95
+ }
96
+ if (img.remotePatterns !== undefined) {
97
+ if (!Array.isArray(img.remotePatterns)) {
98
+ errors.push(`Expected array, received ${received(img.remotePatterns)} at "images.remotePatterns"`);
99
+ } else {
100
+ if (img.remotePatterns.length > 50) {
101
+ errors.push('Array must contain at most 50 element(s) at "images.remotePatterns"');
102
+ }
103
+ img.remotePatterns.forEach((pattern, index) => {
104
+ if (pattern instanceof URL) {
105
+ const protocol = pattern.protocol.replace(/:$/, "");
106
+ if (protocol !== "http" && protocol !== "https") {
107
+ errors.push(`Specified images.remotePatterns must have protocol "http" or "https" received "${protocol}"`);
108
+ }
109
+ return;
110
+ }
111
+ if (!pattern || typeof pattern !== "object") {
112
+ errors.push(`Expected object, received ${received(pattern)} at "images.remotePatterns[${index}]"`);
113
+ return;
114
+ }
115
+ const obj = pattern;
116
+ const unknown = Object.keys(obj).filter((key) => !REMOTE_PATTERN_KEYS.has(key));
117
+ if (unknown.length > 0) {
118
+ errors.push(`Unrecognized key(s) in object: ${unknown.map((key) => `'${key}'`).join(", ")} at "images.remotePatterns[${index}]"`);
119
+ }
120
+ if (typeof obj.hostname !== "string") {
121
+ errors.push(`"images.remotePatterns[${index}].hostname" is missing, expected string`);
122
+ }
123
+ });
124
+ }
125
+ }
126
+ if (img.loader !== undefined) {
127
+ if (typeof img.loader !== "string" || !LOADERS.includes(img.loader)) {
128
+ errors.push(`Expected ${quotedUnion(LOADERS)}, received '${received(img.loader) === "string" ? img.loader : received(img.loader)}' at "images.loader"`);
129
+ } else if (img.loader !== "default" && img.loader !== "custom") {
130
+ const loader = img.loader;
131
+ if (typeof img.path !== "string" || img.path === "" || img.path === "/_next/image") {
132
+ errors.push(`Specified images.loader property (${loader}) also requires images.path property to be assigned to a URL prefix.`);
133
+ }
134
+ if (typeof img.loaderFile === "string" && img.loaderFile !== "") {
135
+ errors.push(`Specified images.loader property (${loader}) cannot be used with images.loaderFile property. Please set images.loader to "custom".`);
136
+ }
137
+ }
138
+ }
139
+ if (typeof img.loaderFile === "string" && img.loaderFile !== "") {
140
+ const absolute = img.loaderFile.startsWith("/") ? path.join(root, img.loaderFile) : path.resolve(root, img.loaderFile);
141
+ if (!fs.existsSync(absolute)) {
142
+ errors.push(`Specified images.loaderFile does not exist at "${absolute}".`);
143
+ } else if (!hasDefaultExport(absolute)) {
144
+ errors.push(`images.loaderFile detected but the file is missing default export.
145
+ ` + "Read more: https://nextjs.org/docs/messages/invalid-images-config");
146
+ }
147
+ }
148
+ if (img.formats !== undefined) {
149
+ if (!Array.isArray(img.formats)) {
150
+ errors.push(`Expected array, received ${received(img.formats)} at "images.formats"`);
151
+ } else {
152
+ img.formats.forEach((format, index) => {
153
+ if (!FORMATS.includes(format)) {
154
+ errors.push(`Expected ${quotedUnion(FORMATS)}, received '${String(format)}' at "images.formats[${index}]"`);
155
+ }
156
+ });
157
+ }
158
+ }
159
+ if (img.contentDispositionType !== undefined && !DISPOSITIONS.includes(img.contentDispositionType)) {
160
+ errors.push(`Expected ${quotedUnion(DISPOSITIONS)}, received '${typeof img.contentDispositionType === "string" ? img.contentDispositionType : received(img.contentDispositionType)}' at "images.contentDispositionType"`);
161
+ }
162
+ if (img.contentSecurityPolicy !== undefined && typeof img.contentSecurityPolicy !== "string") {
163
+ errors.push(`Expected string, received ${received(img.contentSecurityPolicy)} at "images.contentSecurityPolicy"`);
164
+ }
165
+ if (img.minimumCacheTTL !== undefined) {
166
+ if (typeof img.minimumCacheTTL !== "number") {
167
+ errors.push(`Expected number, received ${received(img.minimumCacheTTL)} at "images.minimumCacheTTL"`);
168
+ } else if (img.minimumCacheTTL < 0) {
169
+ errors.push('Number must be greater than or equal to 0 at "images.minimumCacheTTL"');
170
+ }
171
+ }
172
+ for (const key of ["dangerouslyAllowSVG", "unoptimized", "disableStaticImages"]) {
173
+ if (img[key] !== undefined && typeof img[key] !== "boolean") {
174
+ errors.push(`Expected boolean, received ${received(img[key])} at "images.${key}"`);
175
+ }
176
+ }
177
+ return errors;
178
+ }
179
+ function validateSizeArray(errors, value, label) {
180
+ if (value === undefined)
181
+ return;
182
+ if (!Array.isArray(value)) {
183
+ errors.push(`Expected array, received ${received(value)} at "${label}"`);
184
+ return;
185
+ }
186
+ if (value.length > 25) {
187
+ errors.push(`Array must contain at most 25 element(s) at "${label}"`);
188
+ }
189
+ value.forEach((size, index) => {
190
+ if (typeof size !== "number") {
191
+ errors.push(`Expected number, received ${received(size)} at "${label}[${index}]"`);
192
+ } else if (size < 1) {
193
+ errors.push(`Number must be greater than or equal to 1 at "${label}[${index}]"`);
194
+ } else if (size > 1e4) {
195
+ errors.push(`Number must be less than or equal to 10000 at "${label}[${index}]"`);
196
+ }
197
+ });
198
+ }
199
+
200
+ export { collectImagesConfigErrors };
@@ -0,0 +1,31 @@
1
+ // @bun
2
+ // src/compat/next/dist/client/components/app-router-headers.ts
3
+ var RSC_HEADER = "rsc";
4
+ var ACTION_HEADER = "next-action";
5
+ var NEXT_ROUTER_STATE_TREE_HEADER = "next-router-state-tree";
6
+ var NEXT_ROUTER_PREFETCH_HEADER = "next-router-prefetch";
7
+ var NEXT_ROUTER_SEGMENT_PREFETCH_HEADER = "next-router-segment-prefetch";
8
+ var NEXT_HMR_REFRESH_HEADER = "next-hmr-refresh";
9
+ var NEXT_HMR_REFRESH_HASH_COOKIE = "__next_hmr_refresh_hash__";
10
+ var NEXT_URL = "next-url";
11
+ var RSC_CONTENT_TYPE_HEADER = "text/x-component";
12
+ var NEXT_INSTANT_TEST_COOKIE = "next-instant-navigation-testing";
13
+ var FLIGHT_HEADERS = [
14
+ RSC_HEADER,
15
+ NEXT_ROUTER_STATE_TREE_HEADER,
16
+ NEXT_ROUTER_PREFETCH_HEADER,
17
+ NEXT_HMR_REFRESH_HEADER,
18
+ NEXT_ROUTER_SEGMENT_PREFETCH_HEADER
19
+ ];
20
+ var NEXT_RSC_UNION_QUERY = "_rsc";
21
+ var NEXT_ROUTER_STALE_TIME_HEADER = "x-nextjs-stale-time";
22
+ var NEXT_DID_POSTPONE_HEADER = "x-nextjs-postponed";
23
+ var NEXT_REWRITTEN_PATH_HEADER = "x-nextjs-rewritten-path";
24
+ var NEXT_REWRITTEN_QUERY_HEADER = "x-nextjs-rewritten-query";
25
+ var NEXT_IS_PRERENDER_HEADER = "x-nextjs-prerender";
26
+ var NEXT_ACTION_NOT_FOUND_HEADER = "x-nextjs-action-not-found";
27
+ var NEXT_REQUEST_ID_HEADER = "x-nextjs-request-id";
28
+ var NEXT_HTML_REQUEST_ID_HEADER = "x-nextjs-html-request-id";
29
+ var NEXT_ACTION_REVALIDATED_HEADER = "x-action-revalidated";
30
+
31
+ export { RSC_HEADER, ACTION_HEADER, NEXT_ROUTER_STATE_TREE_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_ROUTER_SEGMENT_PREFETCH_HEADER, NEXT_HMR_REFRESH_HEADER, NEXT_HMR_REFRESH_HASH_COOKIE, NEXT_URL, RSC_CONTENT_TYPE_HEADER, NEXT_INSTANT_TEST_COOKIE, FLIGHT_HEADERS, NEXT_RSC_UNION_QUERY, NEXT_ROUTER_STALE_TIME_HEADER, NEXT_DID_POSTPONE_HEADER, NEXT_REWRITTEN_PATH_HEADER, NEXT_REWRITTEN_QUERY_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_ACTION_NOT_FOUND_HEADER, NEXT_REQUEST_ID_HEADER, NEXT_HTML_REQUEST_ID_HEADER, NEXT_ACTION_REVALIDATED_HEADER };