void 1.3.0 → 1.5.0

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 (451) hide show
  1. package/README.md +1 -1
  2. package/dist/{account-cmd-B4i71m7k.mjs → account-cmd-ChVKPZ-w.mjs} +7 -8
  3. package/dist/{action-key-XZ9HkWAO.mjs → action-key-XtKKbbsi.mjs} +1 -2
  4. package/dist/{agents-CuNtT0D_.mjs → agents-DRo8gzni.mjs} +2 -3
  5. package/dist/{application-analysis-DYdVoMAY.mjs → application-analysis-2vGZrKzg.mjs} +27 -29
  6. package/dist/{application-routing-C8EqRDfv.mjs → application-routing-DnUQoOJD.mjs} +2 -3
  7. package/dist/{ast-CsZ_q_gc.mjs → ast-Cv0JwXqb.mjs} +1 -2
  8. package/dist/{ast-bindings-C3yaPs1y.mjs → ast-bindings-BkivMJIo.mjs} +6 -11
  9. package/dist/{atomic-write-Dq6R0BPN.mjs → atomic-write-DA6eD1Kp.mjs} +1 -2
  10. package/dist/auth-CH4PLAX1.d.mts +68 -0
  11. package/dist/{auth-Cbqi1iVX.mjs → auth-CL-p_rqV.mjs} +1 -1
  12. package/dist/{auth-B6iOCjKI.mjs → auth-Dy8svcqQ.mjs} +6 -7
  13. package/dist/{auth-3sGB0zJ1.mjs → auth-YVjBX5NY.mjs} +1 -2
  14. package/dist/{auth-client-Bawdj38n.d.mts → auth-client-6-Ft9i9T.d.mts} +0 -2
  15. package/dist/{auth-client-BWBT8HLp.mjs → auth-client-DwCdwKbw.mjs} +1 -2
  16. package/dist/{auth-client-react-CMLwT2xI.mjs → auth-client-react-CJdeErvM.mjs} +1 -2
  17. package/dist/{auth-client-react-7GFffu8R.d.mts → auth-client-react-DvQLe5Zb.d.mts} +0 -2
  18. package/dist/{auth-client-solid-UoreJWZG.mjs → auth-client-solid-BRvgvp6h.mjs} +1 -2
  19. package/dist/{auth-client-solid-DyTFL4cq.d.mts → auth-client-solid-P9pEtKGp.d.mts} +0 -2
  20. package/dist/{auth-client-svelte-zetW0KIH.d.mts → auth-client-svelte-B5j8irT6.d.mts} +0 -2
  21. package/dist/{auth-client-svelte-Cv_WvrRk.mjs → auth-client-svelte-BSqUCEed.mjs} +1 -2
  22. package/dist/{auth-client-vue-bChShbQP.d.mts → auth-client-vue-BEiAfavk.d.mts} +0 -2
  23. package/dist/{auth-client-vue-CFk7Xbv3.mjs → auth-client-vue-CPkbRtOO.mjs} +1 -2
  24. package/dist/{auth-link-BKwHPbdv.mjs → auth-link-D4uMdOsw.mjs} +7 -8
  25. package/dist/{auth-migrations-BO27GDNr.mjs → auth-migrations-DDeifS3v.mjs} +1 -2
  26. package/dist/{auth-router-DqLx8E0F.mjs → auth-router-62dna450.mjs} +14 -10
  27. package/dist/{base64-DVrOndmI.mjs → base64-ikl9yBy3.mjs} +1 -2
  28. package/dist/{better-auth-shared-DVk2DkTW.d.mts → better-auth-shared-BJyG2mH0.d.mts} +2 -6
  29. package/dist/{better-auth-shared-7FM3Uk2N.mjs → better-auth-shared-CiclgPde.mjs} +4 -5
  30. package/dist/{build-cmd-Dy4psnt1.mjs → build-cmd-D93K_4Sa.mjs} +7 -8
  31. package/dist/{cache-DV37S6dl.mjs → cache-CiIzEED4.mjs} +7 -8
  32. package/dist/{cancel-deploy-DMPyu1Vt.mjs → cancel-deploy-BNoGfn2e.mjs} +6 -7
  33. package/dist/{cf-access-CWP4avfP.mjs → cf-access-BmBT2h8_.mjs} +3 -4
  34. package/dist/{cf-access-BM9G0lhO.mjs → cf-access-pejlJmuy.mjs} +1 -2
  35. package/dist/{cf-build-output-Bapzc_8Z.mjs → cf-build-output-B1C8U83u.mjs} +60 -317
  36. package/dist/cf-build-output-CmDOcA7K.mjs +1 -0
  37. package/dist/{cf-command-values-ByHk0xg4.mjs → cf-command-values-Ccl-zRhl.mjs} +10 -7
  38. package/dist/cf-config-migrate-Dy8MrKgF.mjs +326 -0
  39. package/dist/{cf-worker-settings-BECvvTVd.mjs → cf-worker-settings-CARs4Wy9.mjs} +14 -10
  40. package/dist/cli/cli.mjs +66 -76
  41. package/dist/cli/cloudflare-operation-process.mjs +21 -19
  42. package/dist/cli/env-schema-probe.d.mts +1 -5
  43. package/dist/cli/env-schema-probe.mjs +4 -5
  44. package/dist/client-DVtAKeUm.mjs +1 -0
  45. package/dist/{client-BEMtySaV.mjs → client-Qayy9xEh.mjs} +10 -12
  46. package/dist/{cloudflare-auth-Byo_0_N9.mjs → cloudflare-auth-CEu-1Ps_.mjs} +3 -4
  47. package/dist/{cloudflare-cmd-BaqIigwI.mjs → cloudflare-cmd-DiFGaLow.mjs} +7 -8
  48. package/dist/{cloudflare-config-DchHxPTo.mjs → cloudflare-config-Chet188_.mjs} +25 -9
  49. package/dist/{cloudflare-connect-pNLQmr_e.mjs → cloudflare-connect-BdgAQBc7.mjs} +5 -6
  50. package/dist/{cloudflare-operations-vP3b5CQf.mjs → cloudflare-operations-CWA24vCh.mjs} +8 -9
  51. package/dist/{cloudflare-operations-PCM4wucv.mjs → cloudflare-operations-D8MoezuN.mjs} +1 -1
  52. package/dist/{cloudflare-process-8jEYIeim.mjs → cloudflare-process-DjJ638A-.mjs} +7 -9
  53. package/dist/{cloudflare-user-output-Q-k0QoNQ.mjs → cloudflare-user-output-zEwuGrEJ.mjs} +1 -2
  54. package/dist/collect-8i0wU63d.mjs +1 -0
  55. package/dist/{collect-Dew86qce.mjs → collect-C6Blu9yw.mjs} +2 -3
  56. package/dist/{config-BU6hMu1W.mjs → config-BszFVhpk.mjs} +1 -1
  57. package/dist/{config-BIaXIkkv.mjs → config-Bt4rw93x.mjs} +5 -6
  58. package/dist/{config-Du88-7Y8.d.mts → config-CzsNzGVH.d.mts} +4 -6
  59. package/dist/{config-DHgSEWT7.mjs → config-DkA9jYF2.mjs} +9 -8
  60. package/dist/config-WlvEcL82.mjs +86 -0
  61. package/dist/config-entry.d.mts +1 -3
  62. package/dist/config-entry.mjs +1 -2
  63. package/dist/{connect-DwVsBvVh.mjs → connect-b9mJbb6X.mjs} +10 -11
  64. package/dist/{create-project-CjzbBlTv.mjs → create-project-eomwm0wa.mjs} +9 -11
  65. package/dist/{create-project-CgrnvzyA.mjs → create-project-rnjum4_V.mjs} +1 -1
  66. package/dist/{database-provider-Cx525bwX.mjs → database-provider-DkZo4VwN.mjs} +1 -2
  67. package/dist/database-provider.d.mts +1 -3
  68. package/dist/database-provider.mjs +1 -1
  69. package/dist/{db-rvo64snS.mjs → db-UPWmiSk1.mjs} +52 -54
  70. package/dist/{db-types-NGxPwnlt.mjs → db-types-C_8amnB0.mjs} +3 -4
  71. package/dist/{delete-DWX6dP4M.mjs → delete-BeeYi1WO.mjs} +7 -8
  72. package/dist/deploy-CfU7CR-b.mjs +2 -0
  73. package/dist/{deploy-hRPvw8ci.mjs → deploy-CwmCcTlq.mjs} +321 -185
  74. package/dist/{deploy-managed-static-CDYA2p3L.mjs → deploy-managed-static-gPDxyp3v.mjs} +46 -46
  75. package/dist/{deploy-transport-JCxw7QDi.mjs → deploy-transport-L6zzPE9T.mjs} +17 -17
  76. package/dist/deploy.d.mts +3 -3
  77. package/dist/deploy.mjs +13 -12
  78. package/dist/{dev-inbox-D0jxye_D.mjs → dev-inbox-CwH5VuZj.mjs} +3 -4
  79. package/dist/discover-D4mQthao.mjs +1 -0
  80. package/dist/{discover-LaV0tbIu.mjs → discover-Dhkzxgdt.mjs} +3 -4
  81. package/dist/{dispatch-OVLeWW8K.mjs → dispatch-CiJ1Xrba.mjs} +13 -16
  82. package/dist/{dist-Cegxq8gs.mjs → dist-B6eN80gc.mjs} +199 -118
  83. package/dist/{dist-D15hFhP0.mjs → dist-BWNkVq50.mjs} +8 -15
  84. package/dist/{dist-Cor9XGoz.mjs → dist-D23AAMxT.mjs} +9 -16
  85. package/dist/{dist-ipQi0Q8y.mjs → dist-DMYe8CZJ.mjs} +1 -2
  86. package/dist/{dist-B1PLt4_8.mjs → dist-eV_Ep60B.mjs} +1 -1
  87. package/dist/{domain-CH5iBD9Y.mjs → domain-3xdH9p2L.mjs} +8 -9
  88. package/dist/{dotenv-CNazY3-w.mjs → dotenv-CEI8hapP.mjs} +1 -2
  89. package/dist/{drizzle-9TubSZvI.mjs → drizzle-C8MPqt5m.mjs} +1 -1
  90. package/dist/{drizzle-BQfyvQKX.mjs → drizzle-lFdzSEa9.mjs} +2 -3
  91. package/dist/{email-B9ayYQEG.mjs → email-BHY72ixO.mjs} +3 -4
  92. package/dist/{email-CbTO1l78.mjs → email-Du3YRnM5.mjs} +14 -15
  93. package/dist/{email-cloudflare-B8-pq_-W.mjs → email-cloudflare-CtD8qE13.mjs} +34 -24
  94. package/dist/{email-protocol-D9nTvhCp.mjs → email-protocol-DTs_TjCS.mjs} +1 -2
  95. package/dist/{entry-BEM8ZuGP.mjs → entry-CBZsCy3O.mjs} +5 -6
  96. package/dist/{env-BBdw236G.mjs → env-Cnvp0pGy.mjs} +10 -11
  97. package/dist/{env-BaMz0j7H.mjs → env-CuzZZyjB.mjs} +3 -4
  98. package/dist/{env-0jrMQJI_.mjs → env-DtKg5G26.mjs} +2 -3
  99. package/dist/{env-helpers--wFmQ_5Q.mjs → env-helpers-Dj_SIwPu.mjs} +1 -2
  100. package/dist/{env-helpers-CyKtOBpj.d.mts → env-helpers-U56xuFgL.d.mts} +1 -3
  101. package/dist/{env-public-6lqiSD2b.d.mts → env-public-CeNeO_AT.d.mts} +2 -4
  102. package/dist/{env-raw-D74P4ebM.mjs → env-raw-e8qgqAzQ.mjs} +1 -2
  103. package/dist/{env-types-BicfKBhV.mjs → env-types-DqzVBKnS.mjs} +4 -5
  104. package/dist/{env-validation-BfBVvBNe.mjs → env-validation-C8Cmvas0.mjs} +1 -1
  105. package/dist/{env-validation-XcukUlFM.mjs → env-validation-GV1oD4EV.mjs} +10 -10
  106. package/dist/error-pages-COVBnzK7.mjs +31 -0
  107. package/dist/{fetch-CUX0tB78.d.mts → fetch-B-gLGYVl.d.mts} +0 -4
  108. package/dist/{fetch-CtESUYWd.mjs → fetch-C8yhLoF3.mjs} +3 -4
  109. package/dist/{fetch-error-Bw0n-IY-.mjs → fetch-error-DmlRM6e4.mjs} +2 -4
  110. package/dist/{fetch-stream-BspOeTAI.mjs → fetch-stream-DafNtVJC.mjs} +4 -5
  111. package/dist/{fetch-stream-DfkAzZf-.d.mts → fetch-stream-DuwxWmBM.d.mts} +1 -3
  112. package/dist/{gen-CCx3t2Ju.mjs → gen-BvVmpZ5f.mjs} +12 -13
  113. package/dist/gen-i61rdQgg.mjs +1 -0
  114. package/dist/{generate-DkEb9rL-.mjs → generate-BOp1g1H_.mjs} +1 -1
  115. package/dist/{generate-B1m4Cm4n.mjs → generate-CWb8aOsm.mjs} +4 -5
  116. package/dist/{generated-wrangler-config-DeWj5F9Y.mjs → generated-wrangler-config-CoDaaFsA.mjs} +1 -2
  117. package/dist/{git-metadata-D-gurjzG.mjs → git-metadata-Cukp5kV5.mjs} +1 -2
  118. package/dist/{github-cmd-BzkRLkbg.mjs → github-cmd-X2GKiLi-.mjs} +8 -9
  119. package/dist/{handler-CQv5YDS0.d.mts → handler-Drm_lyrV.d.mts} +15 -26
  120. package/dist/{handler-BZ1t7-Rv.mjs → handler-xmzz0U38.mjs} +4 -5
  121. package/dist/{head-D2VF4ApL.mjs → head-5XPcnG-j.mjs} +1 -2
  122. package/dist/{head-C8K_iGe6.d.mts → head-MeF_5M_3.d.mts} +0 -2
  123. package/dist/{headers-D522zd0A.mjs → headers-DEUBAM6W.mjs} +4 -5
  124. package/dist/help-BcZDUcTw.mjs +1 -0
  125. package/dist/{help-CKbrhZha.mjs → help-EWDNxST-.mjs} +19 -11
  126. package/dist/{inbound-VrOLqwZY.mjs → inbound-DQfekMtz.mjs} +5 -6
  127. package/dist/{inbound-Da7XsjH3.d.mts → inbound-DSKSHDUj.d.mts} +0 -4
  128. package/dist/index.d.mts +23 -13
  129. package/dist/index.mjs +504 -225
  130. package/dist/{info-oBm8yK8J.mjs → info-jW8_d3VI.mjs} +6 -7
  131. package/dist/{init-CBp_uMve.mjs → init-jDQ5G9QC.mjs} +62 -64
  132. package/dist/{isr-config-fZaJJ8t7.mjs → isr-config-DhBkzCdY.mjs} +5 -9
  133. package/dist/{limits-D0vD1M9A.mjs → limits-CrHLm5Tk.mjs} +1 -2
  134. package/dist/{limits-CFsDKQvU.d.mts → limits-_xIf5z_P.d.mts} +0 -2
  135. package/dist/{link-Dt_QXmM4.mjs → link-DOyxX5Xs.mjs} +8 -9
  136. package/dist/{list-DF6asTdt.mjs → list-C9pTYDtl.mjs} +8 -9
  137. package/dist/{live-CXJ9yC98.d.mts → live-CDBHyYiR.d.mts} +2 -4
  138. package/dist/{live-BcHoTDFe.mjs → live-DF4HUl2m.mjs} +5 -7
  139. package/dist/{load-user-env-DD5qveNU.mjs → load-user-env-CSwdofj0.mjs} +1 -2
  140. package/dist/{local-d1-CUhH3qtj.mjs → local-d1-CKfek6Z4.mjs} +4 -5
  141. package/dist/{log-BMwmN5Ae.mjs → log-D9hwSySP.mjs} +3 -4
  142. package/dist/login-C0MiQrYs.mjs +1 -0
  143. package/dist/{login-BjSyhXlT.mjs → login-koQbjzPd.mjs} +6 -7
  144. package/dist/{logs-DmvBl6xA.mjs → logs-cTU5TsRW.mjs} +8 -9
  145. package/dist/migrate-BG09-KOv.mjs +1 -0
  146. package/dist/{migrate-BXRHpYwR.mjs → migrate-C62pGTfr.mjs} +22 -79
  147. package/dist/{migration-handler-CwlEQUoo.d.mts → migration-handler-D8mDx3Ew.d.mts} +0 -4
  148. package/dist/{migration-handler-Cg0Y4EPu.mjs → migration-handler-DCehTlWs.mjs} +1 -2
  149. package/dist/{mime-BAyHPskU.mjs → mime-DKkO7ZtA.mjs} +2 -3
  150. package/dist/{mysql-migration-sql-BIS5vbNk.mjs → mysql-migration-sql-CI9VTwjt.mjs} +3 -5
  151. package/dist/{neon-DTZr7Bu7.mjs → neon-CJzQSycr.mjs} +2 -3
  152. package/dist/nitro.d.mts +0 -2
  153. package/dist/nitro.mjs +6 -7
  154. package/dist/{node-DtD7ZiPf.mjs → node-BfAt2rz8.mjs} +9 -10
  155. package/dist/{operator-args-BsJIYXaT.mjs → operator-args-D79WQP70.mjs} +2 -3
  156. package/dist/{operator-auth-Cr2zCc-J.mjs → operator-auth-CfDcmzpo.mjs} +2 -3
  157. package/dist/{operator-client-C-ROjk1I.mjs → operator-client-BIY4-N_6.mjs} +3 -4
  158. package/dist/operator-cmd-BhHXIL2G.mjs +1 -0
  159. package/dist/{operator-cmd-DjZKGGgN.mjs → operator-cmd-CnAvSqJ5.mjs} +8 -9
  160. package/dist/{output-BpgYODYx.mjs → output-BCdLioKP.mjs} +4 -5
  161. package/dist/output-E6gecbbV.mjs +1 -0
  162. package/dist/{package-json-BjYqR-So.mjs → package-json-DvS6IFRv.mjs} +2 -3
  163. package/dist/pages/client.d.mts +22 -23
  164. package/dist/pages/client.mjs +51 -31
  165. package/dist/pages/head.d.mts +1 -1
  166. package/dist/pages/head.mjs +1 -1
  167. package/dist/pages/index.d.mts +18 -14
  168. package/dist/pages/index.mjs +99 -10
  169. package/dist/pages/islands-plugin.d.mts +29 -11
  170. package/dist/pages/islands-plugin.mjs +3 -4
  171. package/dist/pages/prefetch.d.mts +1 -1
  172. package/dist/pages/prefetch.mjs +1 -1
  173. package/dist/pages/protocol.d.mts +2 -2
  174. package/dist/pages/protocol.mjs +2 -2
  175. package/dist/pages/serialize.d.mts +1 -1
  176. package/dist/pages/serialize.mjs +1 -1
  177. package/dist/{pg-J2HbZIkX.mjs → pg-DoyPxa_X.mjs} +1 -2
  178. package/dist/{picocolors-BsDfhxIw.mjs → picocolors-D1NxSLw-.mjs} +2 -3
  179. package/dist/{plan-BhLO2p4w.mjs → plan-BOD70XGS.mjs} +1 -2
  180. package/dist/plan-CQ-N4gws.mjs +1 -0
  181. package/dist/{platform-args-BMD2gjc_.mjs → platform-args-Bv9hoLEL.mjs} +4 -7
  182. package/dist/platform-args-C1kqYUen.mjs +1 -0
  183. package/dist/{platform-auth-config-BgnuMbml.mjs → platform-auth-config-CLj0EvnB.mjs} +10 -11
  184. package/dist/{platform-auth-protection-NjRejttU.mjs → platform-auth-protection-DQDSxVhr.mjs} +10 -11
  185. package/dist/{platform-auth-recovery-Ug12d9W5.mjs → platform-auth-recovery-DD3oLerq.mjs} +9 -11
  186. package/dist/{platform-cmd-HByuZAO7.mjs → platform-cmd-PLNLg-2N.mjs} +12 -13
  187. package/dist/{platform-cmd-BYKLMPCn.mjs → platform-cmd-WnOmdLzR.mjs} +1 -1
  188. package/dist/{platform-discovery-CHhNs8Nn.mjs → platform-discovery-B0eZjZ3B.mjs} +2 -3
  189. package/dist/{platform-domain-DLSQ8GF8.mjs → platform-domain-Bnq0vg0q.mjs} +7 -8
  190. package/dist/{platform-lifecycle-3dwFJmnq.mjs → platform-lifecycle-BCsFg1Tl.mjs} +53 -88
  191. package/dist/{platform-lifecycle-BRqcxerG.mjs → platform-lifecycle-BQiN9HN5.mjs} +1 -1
  192. package/dist/{platform-management-ZK6XcbCo.mjs → platform-management-CMJR8Zi-.mjs} +1 -1
  193. package/dist/{platform-management-ZZ6bQM5j.mjs → platform-management-nzCDwtiN.mjs} +7 -9
  194. package/dist/{platform-plans-config-CeydDSj0.mjs → platform-plans-config-Dx1agneU.mjs} +5 -6
  195. package/dist/{platform-recovery-8vNE5dNN.mjs → platform-recovery-DBNoME3I.mjs} +5 -6
  196. package/dist/{platform-registry-B9mWX9LO.mjs → platform-registry-DZ_2Xuqd.mjs} +4 -6
  197. package/dist/{platform-setup-Ca53gtt0.mjs → platform-setup-VEcHu0Vq.mjs} +4 -5
  198. package/dist/{plugin-inference-CeiB6BG5.mjs → plugin-inference-DmwjC3y2.mjs} +16 -24
  199. package/dist/{prefetch-Ce6la4EI.d.mts → prefetch-CG0K6JPd.d.mts} +0 -2
  200. package/dist/{prefetch-Bsc_Pb6c.mjs → prefetch-L93_1Jk7.mjs} +1 -2
  201. package/dist/prepare-BJMmfq3W.mjs +1 -0
  202. package/dist/{prepare-5BR7Splm.mjs → prepare-BPsfLWaW.mjs} +4 -5
  203. package/dist/{prepare-Dseww74N.mjs → prepare-pfl2LIMy.mjs} +17 -14
  204. package/dist/{prerender-render-CaShbHJ3.mjs → prerender-render-RlAj6hh8.mjs} +2 -3
  205. package/dist/prerender-render.d.mts +1 -3
  206. package/dist/prerender-render.mjs +1 -1
  207. package/dist/{project-rqDnVsJN.mjs → project-CLwxcEdq.mjs} +3 -4
  208. package/dist/{project-zdB3fs9G.mjs → project-DVsTAWFh.mjs} +1 -1
  209. package/dist/{project-cmd-CjLNNxwe.mjs → project-cmd-5Izu4Pg3.mjs} +21 -23
  210. package/dist/{project-paths-DGu_QZ_Q.mjs → project-paths-CdGv9Tmi.mjs} +3 -5
  211. package/dist/project-slug-BUy0lmyR.mjs +1 -0
  212. package/dist/{project-slug-23TpquG4.mjs → project-slug-CO6ci9XG.mjs} +0 -1
  213. package/dist/{project-team-DE5drjcl.mjs → project-team-DSUyjZFh.mjs} +7 -8
  214. package/dist/{project-token-XEYEXfiJ.mjs → project-token-wj09YQSB.mjs} +7 -8
  215. package/dist/{project-tsconfig-Itv1f4WC.mjs → project-tsconfig-Cf2NFjlM.mjs} +28 -8
  216. package/dist/{project-zero-trust-6VPU8zmV.mjs → project-zero-trust-BMHf2YF0.mjs} +7 -8
  217. package/dist/{protocol-DimNxVRr.mjs → protocol-0-lp9ZYx.mjs} +6 -7
  218. package/dist/{protocol-BekmFxCI.d.mts → protocol-xdrl-In0.d.mts} +3 -5
  219. package/dist/{providers-BNKRacMr.d.mts → providers-D5P8j_8D.d.mts} +0 -2
  220. package/dist/{providers-BUHwJlmM.mjs → providers-ZARwX2cL.mjs} +1 -2
  221. package/dist/{provision-B7UFrBH7.mjs → provision-CRiNnlfE.mjs} +29 -14
  222. package/dist/{provision-Chq0NRAV.mjs → provision-CxHIGBIZ.mjs} +1 -1
  223. package/dist/{queues-BWKt1Xo4.d.mts → queues-DdM42xXW.d.mts} +0 -2
  224. package/dist/{r2-conditions-B8xUgJRc.mjs → r2-conditions-BqkQNt2n.mjs} +1 -2
  225. package/dist/{requests-CG-Pj8ze.mjs → requests-DicgB5jU.mjs} +6 -7
  226. package/dist/resolve-project-CgfjtOwz.mjs +1 -0
  227. package/dist/{resolve-project-Xoi6eTWY.mjs → resolve-project-D0YNnJfm.mjs} +4 -5
  228. package/dist/{resource-name-C7LVpcRm.mjs → resource-name-DlJ9QXzg.mjs} +1 -2
  229. package/dist/{response-Tn7rU0MV.mjs → response-HmNjB30w.mjs} +1 -2
  230. package/dist/{rollback-CIrm2txZ.mjs → rollback-DrDZOKNE.mjs} +7 -8
  231. package/dist/{rolldown-runtime-3h0WiCiA.mjs → rolldown-runtime-uD8oG6U2.mjs} +1 -2
  232. package/dist/{route-types--PAOzHlH.mjs → route-types-irZc1txT.mjs} +100 -7
  233. package/dist/route-url-BGOiyKNz.d.mts +24 -0
  234. package/dist/route-url-CRDF-I0I.mjs +57 -0
  235. package/dist/routes-stub.d.mts +4 -3
  236. package/dist/routes-stub.mjs +1 -1
  237. package/dist/{routing-assets-DdSFxoLp.mjs → routing-assets-DJIVOrCh.mjs} +1 -2
  238. package/dist/{runner-3uGC-oLF.mjs → runner-5MCSimKx.mjs} +5 -6
  239. package/dist/{runner-WCdfeI0q.mjs → runner-QMeOpScZ.mjs} +1 -1
  240. package/dist/{runner-mysql-BcHnLUuM.mjs → runner-mysql-0zVmB1JW.mjs} +1 -1
  241. package/dist/{runner-mysql-BWmbk5IE.mjs → runner-mysql-Bdmsp_x4.mjs} +3 -4
  242. package/dist/{runner-pg-Cgp-cr_p.mjs → runner-pg-2pjltt0t.mjs} +1 -1
  243. package/dist/{runner-pg-Cr3qrqi4.mjs → runner-pg-mYc75KfH.mjs} +2 -3
  244. package/dist/runtime/ai.d.mts +0 -4
  245. package/dist/runtime/ai.mjs +6 -8
  246. package/dist/runtime/auth-client-react.d.mts +1 -1
  247. package/dist/runtime/auth-client-react.mjs +1 -1
  248. package/dist/runtime/auth-client-solid.d.mts +1 -1
  249. package/dist/runtime/auth-client-solid.mjs +1 -1
  250. package/dist/runtime/auth-client-svelte.d.mts +1 -1
  251. package/dist/runtime/auth-client-svelte.mjs +1 -1
  252. package/dist/runtime/auth-client-vue.d.mts +1 -1
  253. package/dist/runtime/auth-client-vue.mjs +1 -1
  254. package/dist/runtime/auth-client.d.mts +1 -1
  255. package/dist/runtime/auth-client.mjs +1 -1
  256. package/dist/runtime/auth.d.mts +2 -2
  257. package/dist/runtime/auth.mjs +1 -1
  258. package/dist/runtime/better-auth-mysql.d.mts +2 -4
  259. package/dist/runtime/better-auth-mysql.mjs +3 -4
  260. package/dist/runtime/better-auth-pg.d.mts +2 -4
  261. package/dist/runtime/better-auth-pg.mjs +4 -5
  262. package/dist/runtime/better-auth.d.mts +2 -4
  263. package/dist/runtime/better-auth.mjs +3 -4
  264. package/dist/runtime/client-react.d.mts +4 -4
  265. package/dist/runtime/client-react.mjs +4 -4
  266. package/dist/runtime/client-solid.d.mts +4 -4
  267. package/dist/runtime/client-solid.mjs +4 -4
  268. package/dist/runtime/client-svelte.d.mts +4 -4
  269. package/dist/runtime/client-svelte.mjs +4 -4
  270. package/dist/runtime/client-vue.d.mts +4 -4
  271. package/dist/runtime/client-vue.mjs +4 -4
  272. package/dist/runtime/client.d.mts +4 -4
  273. package/dist/runtime/client.mjs +4 -4
  274. package/dist/runtime/db.d.mts +0 -2
  275. package/dist/runtime/db.mjs +2 -3
  276. package/dist/runtime/durable.d.mts +0 -2
  277. package/dist/runtime/durable.mjs +3 -4
  278. package/dist/runtime/email/testing.d.mts +1 -5
  279. package/dist/runtime/email/testing.mjs +5 -6
  280. package/dist/runtime/email-protocol.d.mts +0 -2
  281. package/dist/runtime/email-protocol.mjs +1 -1
  282. package/dist/runtime/email.d.mts +1 -5
  283. package/dist/runtime/email.mjs +6 -7
  284. package/dist/runtime/env-public-client.d.mts +1 -3
  285. package/dist/runtime/env-public-client.mjs +2 -3
  286. package/dist/runtime/env-public.d.mts +2 -2
  287. package/dist/runtime/env-public.mjs +5 -7
  288. package/dist/runtime/env.d.mts +0 -4
  289. package/dist/runtime/env.mjs +1 -1
  290. package/dist/runtime/fetch-server.d.mts +1 -3
  291. package/dist/runtime/fetch-server.mjs +3 -4
  292. package/dist/runtime/fetch-stream.d.mts +2 -2
  293. package/dist/runtime/fetch-stream.mjs +2 -2
  294. package/dist/runtime/fetch.d.mts +1 -1
  295. package/dist/runtime/fetch.mjs +2 -2
  296. package/dist/runtime/handler.d.mts +1 -1
  297. package/dist/runtime/handler.mjs +2 -2
  298. package/dist/runtime/isr.d.mts +1 -3
  299. package/dist/runtime/isr.mjs +2 -3
  300. package/dist/runtime/kv.d.mts +1 -3
  301. package/dist/runtime/kv.mjs +2 -3
  302. package/dist/runtime/limits.d.mts +1 -1
  303. package/dist/runtime/limits.mjs +1 -1
  304. package/dist/runtime/live-client.d.mts +1 -3
  305. package/dist/runtime/live-client.mjs +1 -2
  306. package/dist/runtime/live-server.d.mts +0 -2
  307. package/dist/runtime/live-server.mjs +3 -4
  308. package/dist/runtime/live.d.mts +1 -1
  309. package/dist/runtime/live.mjs +1 -1
  310. package/dist/runtime/log.d.mts +3 -3
  311. package/dist/runtime/log.mjs +26 -18
  312. package/dist/runtime/migration-handler-mysql.d.mts +2 -4
  313. package/dist/runtime/migration-handler-mysql.mjs +2 -3
  314. package/dist/runtime/migration-handler-pg.d.mts +2 -4
  315. package/dist/runtime/migration-handler-pg.mjs +2 -3
  316. package/dist/runtime/migration-handler.d.mts +1 -1
  317. package/dist/runtime/migration-handler.mjs +1 -1
  318. package/dist/runtime/queues.d.mts +1 -1
  319. package/dist/runtime/queues.mjs +2 -3
  320. package/dist/runtime/remote/binding-handler.d.mts +1 -3
  321. package/dist/runtime/remote/binding-handler.mjs +3 -4
  322. package/dist/runtime/remote/index.d.mts +1 -3
  323. package/dist/runtime/remote/index.mjs +8 -13
  324. package/dist/runtime/response.d.mts +1 -3
  325. package/dist/runtime/response.mjs +1 -1
  326. package/dist/runtime/route-url.d.mts +2 -2
  327. package/dist/runtime/route-url.mjs +1 -1
  328. package/dist/runtime/routing.d.mts +10 -12
  329. package/dist/runtime/routing.mjs +27 -88
  330. package/dist/runtime/sandbox-container.d.mts +1 -1
  331. package/dist/runtime/sandbox-container.mjs +1 -1
  332. package/dist/runtime/sandbox.d.mts +2 -2
  333. package/dist/runtime/sandbox.mjs +5 -6
  334. package/dist/runtime/seed.d.mts +0 -2
  335. package/dist/runtime/seed.mjs +1 -2
  336. package/dist/runtime/sse-client.d.mts +1 -3
  337. package/dist/runtime/sse-client.mjs +1 -2
  338. package/dist/runtime/sse.d.mts +1 -3
  339. package/dist/runtime/sse.mjs +1 -1
  340. package/dist/runtime/storage.d.mts +1 -3
  341. package/dist/runtime/storage.mjs +2 -3
  342. package/dist/runtime/validator.d.mts +1 -1
  343. package/dist/runtime/validator.mjs +1 -1
  344. package/dist/runtime/ws-server.d.mts +3 -5
  345. package/dist/runtime/ws-server.mjs +3 -4
  346. package/dist/runtime/ws.d.mts +1 -1
  347. package/dist/runtime/ws.mjs +7 -6
  348. package/dist/{sandbox-q3waMc2T.d.mts → sandbox-DE1WsxuB.d.mts} +2 -4
  349. package/dist/{sandbox-container-a9LRUtii.mjs → sandbox-container-BuxhwCgt.mjs} +1 -2
  350. package/dist/{sandbox-container-ChQRum-j.d.mts → sandbox-container-CZFZdMso.d.mts} +0 -2
  351. package/dist/{scan-N9WzdcAl.mjs → scan-DSQtH3oS.mjs} +31 -25
  352. package/dist/{secret-BL6g7mF5.mjs → secret-C_QtTzJG.mjs} +23 -24
  353. package/dist/{serialize-YHvlcG3Q.mjs → serialize-DUuYuaY3.mjs} +2 -4
  354. package/dist/{serialize-DtR8Vwa_.d.mts → serialize-I4EmS-Wf.d.mts} +0 -2
  355. package/dist/{skills-CrUO3PJ0.mjs → skills-D393E4lB.mjs} +4 -5
  356. package/dist/{sqlite-validation-BzKMWnO4.mjs → sqlite-validation-CLJXXN93.mjs} +1 -2
  357. package/dist/{sse-CMvCgjNk.mjs → sse-CxR30yMF.mjs} +1 -2
  358. package/dist/{standard-schema-Fo_vCAZh.d.mts → standard-schema-CuDawHOC.d.mts} +0 -2
  359. package/dist/{static-asset-marker-Btf-6oCD.mjs → static-asset-marker-NR1XS2z5.mjs} +1 -2
  360. package/dist/{subcommand-prompt-D9OhhbGG.mjs → subcommand-prompt-CxJXporl.mjs} +3 -4
  361. package/dist/sveltekit.d.mts +0 -2
  362. package/dist/sveltekit.mjs +2 -3
  363. package/dist/{terminal-log-text-D9ACPOuG.mjs → terminal-log-text-DNsWJREL.mjs} +1 -2
  364. package/dist/{types-w72dljaA.d.mts → types-agfx0alu.d.mts} +0 -4
  365. package/dist/validate-DY1U9rET.mjs +1 -0
  366. package/dist/{validate-CnZPMq4q.mjs → validate-Ddzl-IwT.mjs} +4 -5
  367. package/dist/{validation-error-Dg9Recn1.mjs → validation-error-rDVbUJet.mjs} +2 -4
  368. package/dist/{validator-BTOu0fB0.mjs → validator-CTfmzZYb.mjs} +2 -5
  369. package/dist/{version-metadata-DmaZNTYW.mjs → version-metadata-Blf5H9BQ.mjs} +5 -6
  370. package/dist/{worker-conditions-AWFRcFxR.mjs → worker-conditions-CBZ0RYsZ.mjs} +1 -2
  371. package/dist/wrangler-CPRX2d9A.mjs +1 -0
  372. package/dist/{wrangler-CDiEBCdS.mjs → wrangler-p-kLCJqF.mjs} +81 -15
  373. package/dist/{wrapper-CEiDeCqD.mjs → wrapper-iejSJDwL.mjs} +18 -15
  374. package/dist/{ws-D1zWiB_P.d.mts → ws-DzBD-NUj.d.mts} +4 -5
  375. package/dist/{yarn-pnp-DLbEFMT0.mjs → yarn-pnp-DgWbE7z5.mjs} +2 -3
  376. package/docs/guide/auth.md +1 -1
  377. package/docs/guide/database.md +4 -4
  378. package/docs/guide/deployment.md +1 -1
  379. package/docs/guide/edge/headers.md +2 -6
  380. package/docs/guide/edge/redirects.md +22 -0
  381. package/docs/guide/edge/static-assets.md +0 -10
  382. package/docs/guide/email/domains.md +3 -1
  383. package/docs/guide/email/receiving.md +3 -3
  384. package/docs/guide/email/sending.md +1 -1
  385. package/docs/guide/pages-routing/actions-and-forms.md +26 -5
  386. package/docs/guide/pages-routing/islands.md +2 -2
  387. package/docs/guide/pages-routing/loaders.md +3 -3
  388. package/docs/guide/pages-routing/markdown.md +6 -6
  389. package/docs/guide/pages-routing/overview.md +34 -27
  390. package/docs/guide/platform/administration/email.md +6 -8
  391. package/docs/guide/platform/installation/credentials.md +6 -6
  392. package/docs/guide/platform/installation/maintenance.md +10 -24
  393. package/docs/guide/platform/installation/prerequisites.md +1 -1
  394. package/docs/guide/platform/installation/setup.md +1 -1
  395. package/docs/guide/platform/installation/uninstall.md +1 -1
  396. package/docs/guide/queues.md +4 -8
  397. package/docs/guide/self-hosted-platform.md +3 -3
  398. package/docs/guide/server-routing.md +8 -6
  399. package/docs/guide/ssg.md +8 -0
  400. package/docs/guide/type-safety.md +42 -0
  401. package/docs/guide/typed-fetch.md +1 -1
  402. package/docs/guide/websockets.md +1 -1
  403. package/docs/integrations/cloudflare.md +17 -8
  404. package/docs/integrations/frameworks/analog.md +1 -1
  405. package/docs/integrations/frameworks/nuxt.md +1 -1
  406. package/docs/integrations/frameworks/sveltekit.md +1 -1
  407. package/docs/integrations/frameworks/tanstack-start.md +1 -1
  408. package/docs/integrations/hono.md +5 -5
  409. package/docs/reference/api/auth.md +6 -2
  410. package/docs/reference/api/deploy.md +15 -11
  411. package/docs/reference/api/pages.md +10 -0
  412. package/docs/reference/api/plugin.md +4 -4
  413. package/docs/reference/api/resources.md +4 -1
  414. package/docs/reference/api/rewrites.md +20 -2
  415. package/docs/reference/api/types.md +41 -0
  416. package/docs/reference/api.md +2 -2
  417. package/docs/reference/cli/database.md +15 -9
  418. package/docs/reference/cli/deploy.md +10 -9
  419. package/docs/reference/cli/email.md +4 -2
  420. package/docs/reference/cli/platform-installation.md +2 -2
  421. package/docs/reference/cli/project.md +2 -2
  422. package/docs/reference/cli/secrets.md +3 -1
  423. package/docs/reference/cli/setup.md +3 -3
  424. package/docs/reference/cli.md +1 -1
  425. package/docs/reference/config.md +12 -2
  426. package/package.json +35 -31
  427. package/sandbox.Dockerfile +1 -1
  428. package/schema.json +4 -0
  429. package/skills/void/SKILL.md +1 -1
  430. package/dist/auth-DkcFflXV.d.mts +0 -42
  431. package/dist/cf-build-output-DlBkWdNU.mjs +0 -1
  432. package/dist/client-DyxPQnF_.mjs +0 -1
  433. package/dist/collect-BWhkgtAn.mjs +0 -1
  434. package/dist/config-BTu1o3Dc.mjs +0 -49
  435. package/dist/deploy-CtHE2A3R.mjs +0 -2
  436. package/dist/discover-D4TPKo57.mjs +0 -1
  437. package/dist/gen-TgXy93Rr.mjs +0 -1
  438. package/dist/help-qOZr3wng.mjs +0 -1
  439. package/dist/login-Cdo8Aco1.mjs +0 -1
  440. package/dist/migrate-COPncCGx.mjs +0 -1
  441. package/dist/operator-cmd-DDiX7Y3f.mjs +0 -1
  442. package/dist/output-BW9uK099.mjs +0 -1
  443. package/dist/plan-CKX_jWnD.mjs +0 -1
  444. package/dist/platform-args-BC8_hsDj.mjs +0 -1
  445. package/dist/prepare-B3VrSF1Z.mjs +0 -1
  446. package/dist/project-slug-6cyz8E7k.mjs +0 -1
  447. package/dist/resolve-project-DD1vu8s9.mjs +0 -1
  448. package/dist/route-url-BgPja1GS.d.mts +0 -5
  449. package/dist/route-url-BjGv_KKY.mjs +0 -28
  450. package/dist/validate-D7Wn8PUX.mjs +0 -1
  451. package/dist/wrangler-DOPr4jyI.mjs +0 -1
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
1
+ // ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.6.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
2
2
  var comma = ",".charCodeAt(0);
3
3
  var semicolon = ";".charCodeAt(0);
4
4
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -92,8 +92,7 @@ function encode(decoded) {
92
92
  }
93
93
  return writer.flush();
94
94
  }
95
- //#endregion
96
- //#region ../../node_modules/.pnpm/magic-string@1.4.3/node_modules/magic-string/dist/index.mjs
95
+ // ../../node_modules/.pnpm/magic-string@1.4.5/node_modules/magic-string/dist/index.mjs
97
96
  var BitSet = class BitSet {
98
97
  constructor(arg) {
99
98
  this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
@@ -104,6 +103,17 @@ var BitSet = class BitSet {
104
103
  has(n) {
105
104
  return !!(this.bits[n >> 5] & 1 << (n & 31));
106
105
  }
106
+ forEach(fn) {
107
+ const bits = this.bits;
108
+ for (let w = 0; w < bits.length; w++) {
109
+ let word = bits[w];
110
+ while (word) {
111
+ const lowest = word & -word;
112
+ fn((w << 5) + 31 - Math.clz32(lowest));
113
+ word ^= lowest;
114
+ }
115
+ }
116
+ }
107
117
  };
108
118
  var Chunk = class Chunk {
109
119
  constructor(start, end, content) {
@@ -115,6 +125,8 @@ var Chunk = class Chunk {
115
125
  this.content = content;
116
126
  this.storeName = false;
117
127
  this.edited = false;
128
+ this.replacesUntil = -1;
129
+ this.replacedFrom = -1;
118
130
  this.previous = null;
119
131
  this.next = null;
120
132
  }
@@ -131,6 +143,8 @@ var Chunk = class Chunk {
131
143
  chunk.content = this.content;
132
144
  chunk.storeName = this.storeName;
133
145
  chunk.edited = this.edited;
146
+ chunk.replacesUntil = this.replacesUntil;
147
+ chunk.replacedFrom = this.replacedFrom;
134
148
  return chunk;
135
149
  }
136
150
  contains(index) {
@@ -171,6 +185,8 @@ var Chunk = class Chunk {
171
185
  reset() {
172
186
  this.intro = "";
173
187
  this.outro = "";
188
+ this.replacesUntil = -1;
189
+ this.replacedFrom = -1;
174
190
  if (this.edited) {
175
191
  this.content = this.original;
176
192
  this.storeName = false;
@@ -188,7 +204,7 @@ var Chunk = class Chunk {
188
204
  this.end = index;
189
205
  if (this.edited) {
190
206
  newChunk.edit("", false, true);
191
- this.content = "";
207
+ newChunk.replacedFrom = this.replacedFrom;
192
208
  } else this.content = originalBefore;
193
209
  newChunk.next = this.next;
194
210
  if (newChunk.next) newChunk.next.previous = newChunk;
@@ -438,8 +454,8 @@ var Mappings = class {
438
454
  this.generatedCodeColumn = 0;
439
455
  this.raw = [];
440
456
  this.rawSegments = this.raw[this.generatedCodeLine] = [];
441
- this.rawRangeMappings = [];
442
- this.rawRangeMappingsIndices = this.rawRangeMappings[this.generatedCodeLine] = [];
457
+ this.rawRangeMappingsIndices = [];
458
+ this.rawRangeMappings = hires === "experimental-range" ? [this.rawRangeMappingsIndices] : void 0;
443
459
  this.encoder = encoder;
444
460
  }
445
461
  nextLine() {
@@ -452,7 +468,28 @@ var Mappings = class {
452
468
  this.generatedCodeLine += 1;
453
469
  }
454
470
  this.generatedCodeColumn = 0;
455
- this.rawRangeMappings[this.generatedCodeLine] = this.rawRangeMappingsIndices = [];
471
+ if (this.rawRangeMappings) this.rawRangeMappings[this.generatedCodeLine] = this.rawRangeMappingsIndices = [];
472
+ }
473
+ /**
474
+ * Emits the mappings for one MagicString: its intro, every chunk (with the
475
+ * chunk's own intro/outro) and its outro. `sourceIndex === -1` means the
476
+ * string has no source of its own, so its content only advances the
477
+ * generated position without mapping anything.
478
+ */
479
+ addMagicString(magicString, sourceIndex, nameIndex) {
480
+ const { original } = magicString;
481
+ const locate = getLocator(original);
482
+ if (magicString.intro) this.advance(magicString.intro);
483
+ magicString.firstChunk.eachNext((chunk) => {
484
+ if (chunk.intro.length) this.advance(chunk.intro);
485
+ if (sourceIndex === -1) this.advance(chunk.content);
486
+ else if (chunk.edited) {
487
+ const name = chunk.storeName ? nameIndex.get(original.slice(chunk.start, chunk.replacesUntil)) : void 0;
488
+ this.addEdit(sourceIndex, chunk.content, locate(chunk.start), name ?? -1);
489
+ } else this.addUneditedChunk(sourceIndex, chunk, original, locate(chunk.start), magicString.sourcemapLocations);
490
+ if (chunk.outro.length) this.advance(chunk.outro);
491
+ });
492
+ if (magicString.outro) this.advance(magicString.outro);
456
493
  }
457
494
  addEdit(sourceIndex, content, loc, nameIndex) {
458
495
  if (content.length) {
@@ -665,6 +702,9 @@ function expandReplacement(replacement, matched, position, str, captures, namedC
665
702
  return result;
666
703
  }
667
704
  var MagicString = class MagicString {
705
+ /**
706
+ * Wraps `string` for editing; every index passed to the editing methods refers to this original string.
707
+ */
668
708
  constructor(string, options = {}) {
669
709
  const chunk = new Chunk(0, string.length, string);
670
710
  Object.defineProperties(this, {
@@ -714,7 +754,7 @@ var MagicString = class MagicString {
714
754
  },
715
755
  storedNames: {
716
756
  writable: true,
717
- value: {}
757
+ value: /* @__PURE__ */ new Set()
718
758
  },
719
759
  indentStr: {
720
760
  writable: true,
@@ -754,7 +794,8 @@ var MagicString = class MagicString {
754
794
  * See also `s.prependLeft(...)`.
755
795
  */
756
796
  appendLeft(index, content) {
757
- index = index + this.offset;
797
+ index = this._resolveIndex(index);
798
+ if (index < 0 || index > this.original.length) throw new MagicStringError(`index ${index} is out of bounds`);
758
799
  if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
759
800
  this._split(index);
760
801
  const chunk = this.byEnd.get(index);
@@ -768,7 +809,8 @@ var MagicString = class MagicString {
768
809
  * See also `s.prependRight(...)`.
769
810
  */
770
811
  appendRight(index, content) {
771
- index = index + this.offset;
812
+ index = this._resolveIndex(index);
813
+ if (index < 0 || index > this.original.length) throw new MagicStringError(`index ${index} is out of bounds`);
772
814
  if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
773
815
  this._split(index);
774
816
  const chunk = this.byStart.get(index);
@@ -777,7 +819,10 @@ var MagicString = class MagicString {
777
819
  return this;
778
820
  }
779
821
  /**
780
- * Does what you'd expect.
822
+ * Returns an independent copy: the chunk list, string-level intro/outro,
823
+ * sourcemap locations, stored names, indent exclusion ranges, `offset`,
824
+ * `filename` and `ignoreList` are all copied; later edits to either string
825
+ * do not affect the other.
781
826
  */
782
827
  clone() {
783
828
  const cloned = new MagicString(this.original, {
@@ -802,7 +847,7 @@ var MagicString = class MagicString {
802
847
  cloned.lastChunk = clonedChunk;
803
848
  if (this.indentExclusionRanges) cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
804
849
  cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
805
- cloned.storedNames = { ...this.storedNames };
850
+ cloned.storedNames = new Set(this.storedNames);
806
851
  cloned.intro = this.intro;
807
852
  cloned.outro = this.outro;
808
853
  cloned.hasMovedChunks = this.hasMovedChunks;
@@ -838,18 +883,8 @@ var MagicString = class MagicString {
838
883
  }
839
884
  /** @internal */
840
885
  _generateMappings(mappings) {
841
- const sourceIndex = 0;
842
- const names = Object.keys(this.storedNames);
843
- const locate = getLocator(this.original);
844
- if (this.intro) mappings.advance(this.intro);
845
- this.firstChunk.eachNext((chunk) => {
846
- const loc = locate(chunk.start);
847
- if (chunk.intro.length) mappings.advance(chunk.intro);
848
- if (chunk.edited) mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1);
849
- else mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
850
- if (chunk.outro.length) mappings.advance(chunk.outro);
851
- });
852
- if (this.outro) mappings.advance(this.outro);
886
+ const names = [...this.storedNames];
887
+ mappings.addMagicString(this, 0, new Map(names.map((name, i) => [name, i])));
853
888
  return names;
854
889
  }
855
890
  /** @internal */
@@ -871,9 +906,13 @@ var MagicString = class MagicString {
871
906
  this._ensureindentStr();
872
907
  return this.indentStr;
873
908
  }
909
+ /**
910
+ * Returns the indentation string guessed from the original content, falling back to a single tab character.
911
+ * This is the value `s.indent()` uses when no prefix is supplied.
912
+ */
874
913
  getIndentString() {
875
914
  this._ensureindentStr();
876
- return this.indentStr === null ? " " : this.indentStr;
915
+ return this.indentStr ?? " ";
877
916
  }
878
917
  indent(indentStr, options) {
879
918
  const pattern = /^[^\r\n]/gm;
@@ -888,9 +927,9 @@ var MagicString = class MagicString {
888
927
  if (indentStr === "") return this;
889
928
  const resolvedIndentStr = indentStr;
890
929
  options = options || {};
891
- const isExcluded = {};
930
+ const isExcluded = new BitSet();
892
931
  if (options.exclude) (typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude).forEach((exclusion) => {
893
- for (let i = exclusion[0]; i < exclusion[1]; i += 1) isExcluded[i] = true;
932
+ for (let i = exclusion[0]; i < exclusion[1]; i += 1) isExcluded.add(i);
894
933
  });
895
934
  let shouldIndentNextCharacter = options.indentStart !== false;
896
935
  const indentPiece = (str) => {
@@ -913,13 +952,14 @@ var MagicString = class MagicString {
913
952
  };
914
953
  while (chunk) {
915
954
  const end = chunk.end;
916
- if (!isExcluded[chunk.start]) chunk.intro = indentPiece(chunk.intro);
955
+ if (!isExcluded.has(chunk.start)) chunk.intro = indentPiece(chunk.intro);
917
956
  if (chunk.edited) {
918
- if (!isExcluded[charIndex]) chunk.content = indentPiece(chunk.content);
957
+ if (!isExcluded.has(chunk.start)) chunk.content = indentPiece(chunk.content);
958
+ else if (chunk.content) shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
919
959
  } else if (options.exclude) {
920
960
  charIndex = chunk.start;
921
961
  while (charIndex < end) {
922
- if (!isExcluded[charIndex]) {
962
+ if (!isExcluded.has(charIndex)) {
923
963
  const char = this.original.charCodeAt(charIndex);
924
964
  if (char === NEWLINE_CHAR) shouldIndentNextCharacter = true;
925
965
  else if (char !== CR_CHAR && shouldIndentNextCharacter) indentAt(charIndex);
@@ -945,7 +985,7 @@ var MagicString = class MagicString {
945
985
  charIndex += 1;
946
986
  }
947
987
  }
948
- if (!isExcluded[chunk.end - 1]) chunk.outro = indentPiece(chunk.outro);
988
+ if (!isExcluded.has(chunk.end - 1)) chunk.outro = indentPiece(chunk.outro);
949
989
  charIndex = chunk.end;
950
990
  chunk = chunk.next;
951
991
  }
@@ -982,16 +1022,19 @@ var MagicString = class MagicString {
982
1022
  * mirroring the `appendLeft`/`appendRight` distinction.
983
1023
  */
984
1024
  move(start, end, index, affinity = "right") {
985
- start = start + this.offset;
986
- end = end + this.offset;
987
- index = index + this.offset;
1025
+ start = this._resolveIndex(start);
1026
+ end = this._resolveIndex(end);
1027
+ index = this._resolveIndex(index);
988
1028
  if (start === end) return this;
1029
+ if (start < 0 || end > this.original.length || index < 0 || index > this.original.length) throw new MagicStringError(`range ${start}–${end} is out of bounds`);
1030
+ if (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);
989
1031
  if (index >= start && index <= end) throw new MagicStringError("cannot move a selection inside itself");
990
1032
  this._split(start);
991
1033
  this._split(end);
992
1034
  this._split(index);
993
1035
  const first = this.byStart.get(start);
994
1036
  const last = this.byEnd.get(end);
1037
+ if (!first || !last) throw new MagicStringError(`range ${start}–${end} is out of bounds`);
995
1038
  if (this.hasMovedChunks) {
996
1039
  let cursor = first;
997
1040
  while (cursor !== last) {
@@ -1026,9 +1069,9 @@ var MagicString = class MagicString {
1026
1069
  if (oldRight) oldRight.previous = oldLeft;
1027
1070
  if (newLeft) newLeft.next = first;
1028
1071
  if (newRight) newRight.previous = last;
1029
- if (!first.previous) this.firstChunk = last.next;
1030
- if (!last.next) {
1031
- this.lastChunk = first.previous;
1072
+ if (!oldLeft) this.firstChunk = oldRight;
1073
+ if (!oldRight) {
1074
+ this.lastChunk = oldLeft;
1032
1075
  this.lastChunk.next = null;
1033
1076
  }
1034
1077
  first.previous = newLeft;
@@ -1049,6 +1092,16 @@ var MagicString = class MagicString {
1049
1092
  * It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content.
1050
1093
  */
1051
1094
  overwrite(start, end, content, options) {
1095
+ if (options === true) {
1096
+ if (!warned.storeName) {
1097
+ console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");
1098
+ warned.storeName = true;
1099
+ }
1100
+ return this.update(start, end, content, {
1101
+ storeName: true,
1102
+ overwrite: true
1103
+ });
1104
+ }
1052
1105
  const optionObject = typeof options === "object" && options ? options : {};
1053
1106
  return this.update(start, end, content, {
1054
1107
  ...optionObject,
@@ -1063,13 +1116,9 @@ var MagicString = class MagicString {
1063
1116
  * the content is overwritten, or anything that was appended/prepended to the range as well.
1064
1117
  */
1065
1118
  update(start, end, content, options) {
1066
- start = start + this.offset;
1067
- end = end + this.offset;
1119
+ start = this._resolveIndex(start);
1120
+ end = this._resolveIndex(end);
1068
1121
  if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
1069
- if (this.original.length !== 0) {
1070
- if (start < 0) start = Math.max(0, start + this.original.length);
1071
- if (end < 0) end = Math.max(0, end + this.original.length);
1072
- }
1073
1122
  if (start < 0) throw new MagicStringError(`start ${start} is out of bounds`);
1074
1123
  if (end > this.original.length) throw new MagicStringError(`end ${end} is out of bounds`);
1075
1124
  if (start === end) throw new MagicStringError(`cannot overwrite a zero-length range at ${start}, use appendLeft() or prependRight()`);
@@ -1086,30 +1135,21 @@ var MagicString = class MagicString {
1086
1135
  const optionObject = typeof options === "object" && options ? options : {};
1087
1136
  const storeName = optionObject.storeName || false;
1088
1137
  const overwrite = optionObject.overwrite || false;
1089
- if (storeName) {
1090
- const original = this.original.slice(start, end);
1091
- Object.defineProperty(this.storedNames, original, {
1092
- writable: true,
1093
- value: true,
1094
- enumerable: true
1095
- });
1096
- }
1138
+ if (storeName) this.storedNames.add(this.original.slice(start, end));
1097
1139
  const first = this.byStart.get(start);
1098
- const last = this.byEnd.get(end);
1099
- /* v8 ignore else -- unreachable: a valid start/end always yields a `first` chunk */
1100
- if (first) {
1101
- let chunk = first;
1102
- while (chunk !== last) {
1103
- if (chunk.next !== this.byStart.get(chunk.end)) throw new MagicStringError("cannot overwrite across a split point");
1104
- chunk = chunk.next;
1105
- chunk.edit("", false, !overwrite);
1106
- }
1107
- first.edit(content, storeName, !overwrite);
1108
- } else {
1109
- const newChunk = new Chunk(start, end, "").edit(content, storeName);
1110
- last.next = newChunk;
1111
- newChunk.previous = last;
1140
+ for (let chunk = first; chunk.end < end;) {
1141
+ const next = chunk.next;
1142
+ if (next === null || next !== this.byStart.get(chunk.end)) throw new MagicStringError("cannot overwrite across a split point");
1143
+ chunk = next;
1112
1144
  }
1145
+ for (let chunk = first.next; chunk !== null && chunk.start < end; chunk = chunk.next) {
1146
+ chunk.edit("", false, !overwrite);
1147
+ chunk.replacesUntil = -1;
1148
+ chunk.replacedFrom = start;
1149
+ }
1150
+ first.edit(content, storeName, !overwrite);
1151
+ first.replacesUntil = end;
1152
+ first.replacedFrom = -1;
1113
1153
  return this;
1114
1154
  }
1115
1155
  /**
@@ -1124,7 +1164,8 @@ var MagicString = class MagicString {
1124
1164
  * Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index
1125
1165
  */
1126
1166
  prependLeft(index, content) {
1127
- index = index + this.offset;
1167
+ index = this._resolveIndex(index);
1168
+ if (index < 0 || index > this.original.length) throw new MagicStringError(`index ${index} is out of bounds`);
1128
1169
  if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
1129
1170
  this._split(index);
1130
1171
  const chunk = this.byEnd.get(index);
@@ -1136,7 +1177,8 @@ var MagicString = class MagicString {
1136
1177
  * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index`
1137
1178
  */
1138
1179
  prependRight(index, content) {
1139
- index = index + this.offset;
1180
+ index = this._resolveIndex(index);
1181
+ if (index < 0 || index > this.original.length) throw new MagicStringError(`index ${index} is out of bounds`);
1140
1182
  if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
1141
1183
  this._split(index);
1142
1184
  const chunk = this.byStart.get(index);
@@ -1152,12 +1194,8 @@ var MagicString = class MagicString {
1152
1194
  * Repeated removals and removals with partially overlapping ranges are allowed.
1153
1195
  */
1154
1196
  remove(start, end) {
1155
- start = start + this.offset;
1156
- end = end + this.offset;
1157
- if (this.original.length !== 0) {
1158
- if (start < 0) start = Math.max(0, start + this.original.length);
1159
- if (end < 0) end = Math.max(0, end + this.original.length);
1160
- }
1197
+ start = this._resolveIndex(start);
1198
+ end = this._resolveIndex(end);
1161
1199
  if (start === end) return this;
1162
1200
  if (start < 0 || end > this.original.length) throw new MagicStringError(`range ${start}–${end} is out of bounds`);
1163
1201
  if (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);
@@ -1168,7 +1206,9 @@ var MagicString = class MagicString {
1168
1206
  if (chunk.start > start) chunk.intro = "";
1169
1207
  if (chunk.end < end) chunk.outro = "";
1170
1208
  chunk.edit("", false, true);
1171
- chunk = end > chunk.end ? this.byStart.get(chunk.end) : null;
1209
+ chunk.replacesUntil = -1;
1210
+ chunk.replacedFrom = -1;
1211
+ chunk = end > chunk.end ? this.byStart.get(chunk.end) : void 0;
1172
1212
  }
1173
1213
  return this;
1174
1214
  }
@@ -1176,12 +1216,8 @@ var MagicString = class MagicString {
1176
1216
  * Reset the modified characters from `start` to `end` (of the original string, **not** the generated string).
1177
1217
  */
1178
1218
  reset(start, end) {
1179
- start = start + this.offset;
1180
- end = end + this.offset;
1181
- if (this.original.length !== 0) {
1182
- if (start < 0) start = Math.max(0, start + this.original.length);
1183
- if (end < 0) end = Math.max(0, end + this.original.length);
1184
- }
1219
+ start = this._resolveIndex(start);
1220
+ end = this._resolveIndex(end);
1185
1221
  if (start === end) return this;
1186
1222
  if (start < 0 || end > this.original.length) throw new MagicStringError(`range ${start}–${end} is out of bounds`);
1187
1223
  if (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);
@@ -1190,10 +1226,13 @@ var MagicString = class MagicString {
1190
1226
  let chunk = this.byStart.get(start);
1191
1227
  while (chunk) {
1192
1228
  chunk.reset();
1193
- chunk = end > chunk.end ? this.byStart.get(chunk.end) : null;
1229
+ chunk = end > chunk.end ? this.byStart.get(chunk.end) : void 0;
1194
1230
  }
1195
1231
  return this;
1196
1232
  }
1233
+ /**
1234
+ * Returns the last character of the generated string, or `''` if it is empty.
1235
+ */
1197
1236
  lastChar() {
1198
1237
  if (this.outro.length) return this.outro[this.outro.length - 1];
1199
1238
  let chunk = this.lastChunk;
@@ -1206,49 +1245,57 @@ var MagicString = class MagicString {
1206
1245
  if (this.intro.length) return this.intro[this.intro.length - 1];
1207
1246
  return "";
1208
1247
  }
1248
+ /**
1249
+ * Returns everything after the last newline in the generated string, or the whole string if there is no newline.
1250
+ */
1209
1251
  lastLine() {
1210
1252
  let lineIndex = this.outro.lastIndexOf(n);
1211
- if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
1253
+ if (lineIndex !== -1) return this.outro.slice(lineIndex + 1);
1212
1254
  let lineStr = this.outro;
1213
1255
  let chunk = this.lastChunk;
1214
1256
  while (chunk) {
1215
1257
  if (chunk.outro.length > 0) {
1216
1258
  lineIndex = chunk.outro.lastIndexOf(n);
1217
- if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
1259
+ if (lineIndex !== -1) return chunk.outro.slice(lineIndex + 1) + lineStr;
1218
1260
  lineStr = chunk.outro + lineStr;
1219
1261
  }
1220
1262
  if (chunk.content.length > 0) {
1221
1263
  lineIndex = chunk.content.lastIndexOf(n);
1222
- if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
1264
+ if (lineIndex !== -1) return chunk.content.slice(lineIndex + 1) + lineStr;
1223
1265
  lineStr = chunk.content + lineStr;
1224
1266
  }
1225
1267
  if (chunk.intro.length > 0) {
1226
1268
  lineIndex = chunk.intro.lastIndexOf(n);
1227
- if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
1269
+ if (lineIndex !== -1) return chunk.intro.slice(lineIndex + 1) + lineStr;
1228
1270
  lineStr = chunk.intro + lineStr;
1229
1271
  }
1230
1272
  chunk = chunk.previous;
1231
1273
  }
1232
1274
  lineIndex = this.intro.lastIndexOf(n);
1233
- if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
1275
+ if (lineIndex !== -1) return this.intro.slice(lineIndex + 1) + lineStr;
1234
1276
  return this.intro + lineStr;
1235
1277
  }
1236
1278
  /**
1237
- * Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string.
1238
- * Throws error if the indices are for characters that were already removed.
1279
+ * Returns the content of the generated string that corresponds to the slice
1280
+ * between `start` and `end` of the original string, walking the generated
1281
+ * string from the chunk holding `start` to the chunk holding `end`. Throws
1282
+ * if either index falls inside replaced content. After `move()`, a range
1283
+ * whose end now comes before its start in the output yields `''`.
1239
1284
  */
1240
1285
  slice(start = 0, end = this.original.length - this.offset) {
1241
- start = start + this.offset;
1242
- end = end + this.offset;
1243
- if (this.original.length !== 0) {
1244
- if (start < 0) start = Math.max(0, start + this.original.length);
1245
- if (end < 0) end = Math.max(0, end + this.original.length);
1246
- }
1286
+ start = this._resolveIndex(start);
1287
+ end = this._resolveIndex(end);
1247
1288
  let result = "";
1248
- let chunk = this.firstChunk;
1249
- while (chunk && (chunk.start > start || chunk.end <= start)) {
1250
- if (chunk.start < end && chunk.end >= end || end === 0 && chunk.start === 0) return result;
1251
- chunk = chunk.next;
1289
+ let chunk;
1290
+ if (this.hasMovedChunks) {
1291
+ chunk = this.firstChunk;
1292
+ while (chunk && (chunk.start > start || chunk.end <= start)) {
1293
+ if (chunk.start < end && chunk.end >= end || end === 0 && chunk.start === 0) return result;
1294
+ chunk = chunk.next;
1295
+ }
1296
+ } else {
1297
+ if (start >= end) return result;
1298
+ chunk = this._chunkAt(start);
1252
1299
  }
1253
1300
  if (chunk && chunk.edited && chunk.start !== start) throw new MagicStringError(`cannot use edited character ${start} as slice start anchor`);
1254
1301
  const startChunk = chunk;
@@ -1271,10 +1318,39 @@ var MagicString = class MagicString {
1271
1318
  */
1272
1319
  snip(start, end) {
1273
1320
  const clone = this.clone();
1274
- clone.remove(0, start);
1275
- clone.remove(end, clone.original.length);
1321
+ clone.remove(-clone.offset, start);
1322
+ clone.remove(end, clone.original.length - clone.offset);
1276
1323
  return clone;
1277
1324
  }
1325
+ /**
1326
+ * Applies `offset`, resolves a negative index from the end of `original` as
1327
+ * `update`/`remove` always have, and rejects anything that is not an integer.
1328
+ * Bounds are checked by the caller, because the methods report them differently.
1329
+ *
1330
+ * @internal
1331
+ */
1332
+ _resolveIndex(index) {
1333
+ const resolved = index + this.offset;
1334
+ if (!Number.isInteger(resolved)) throw new MagicStringError(`index must be an integer, got ${index}`);
1335
+ if (resolved < 0 && this.original.length !== 0) return Math.max(0, resolved + this.original.length);
1336
+ return resolved;
1337
+ }
1338
+ /**
1339
+ * The chunk whose original range holds `index` (`chunk.start <= index < chunk.end`),
1340
+ * or `undefined` when `index` is at or past the end. Searches from the last
1341
+ * visited chunk so that scans over nearby indices stay cheap.
1342
+ *
1343
+ * @internal
1344
+ */
1345
+ _chunkAt(index) {
1346
+ let chunk = this.byStart.get(index);
1347
+ if (chunk) return chunk;
1348
+ chunk = this.lastSearchedChunk;
1349
+ const searchForward = index >= chunk.end;
1350
+ while (chunk && !chunk.contains(index)) chunk = searchForward ? this.byStart.get(chunk.end) : this.byEnd.get(chunk.start);
1351
+ if (chunk) this.lastSearchedChunk = chunk;
1352
+ return chunk;
1353
+ }
1278
1354
  /** @internal */
1279
1355
  _split(index) {
1280
1356
  if (this.byStart.get(index) || this.byEnd.get(index)) return;
@@ -1327,6 +1403,11 @@ var MagicString = class MagicString {
1327
1403
  if (this.outro.length && this.outro.trim()) return false;
1328
1404
  return true;
1329
1405
  }
1406
+ /**
1407
+ * Returns the length of the generated string, counting only content attached to the original characters.
1408
+ * Content outside the string body (`s.prepend()`/`s.append()`, and inserts before the first or after the last
1409
+ * character) is not counted, so this can differ from `s.toString().length`.
1410
+ */
1330
1411
  length() {
1331
1412
  let chunk = this.firstChunk;
1332
1413
  let length = 0;
@@ -1358,10 +1439,11 @@ var MagicString = class MagicString {
1358
1439
  const end = chunk.end;
1359
1440
  const aborted = chunk.trimEnd(rx);
1360
1441
  if (chunk.end !== end) {
1361
- if (this.lastChunk === chunk) this.lastChunk = chunk.next;
1442
+ const next = chunk.next;
1443
+ if (this.lastChunk === chunk) this.lastChunk = next;
1362
1444
  this.byEnd.set(chunk.end, chunk);
1363
- this.byStart.set(chunk.next.start, chunk.next);
1364
- this.byEnd.set(chunk.next.end, chunk.next);
1445
+ this.byStart.set(next.start, next);
1446
+ this.byEnd.set(next.end, next);
1365
1447
  }
1366
1448
  if (aborted) return true;
1367
1449
  chunk = chunk.previous;
@@ -1386,10 +1468,11 @@ var MagicString = class MagicString {
1386
1468
  const end = chunk.end;
1387
1469
  const aborted = chunk.trimStart(rx);
1388
1470
  if (chunk.end !== end) {
1389
- if (chunk === this.lastChunk) this.lastChunk = chunk.next;
1471
+ const next = chunk.next;
1472
+ if (chunk === this.lastChunk) this.lastChunk = next;
1390
1473
  this.byEnd.set(chunk.end, chunk);
1391
- this.byStart.set(chunk.next.start, chunk.next);
1392
- this.byEnd.set(chunk.next.end, chunk.next);
1474
+ this.byStart.set(next.start, next);
1475
+ this.byEnd.set(next.end, next);
1393
1476
  }
1394
1477
  if (aborted) return true;
1395
1478
  chunk = chunk.next;
@@ -1431,30 +1514,29 @@ var MagicString = class MagicString {
1431
1514
  * @internal
1432
1515
  */
1433
1516
  _hasRemovedContent(start, end) {
1434
- let chunk = this.byStart.get(start);
1435
- if (!chunk) {
1436
- chunk = this.lastSearchedChunk;
1437
- const searchForward = start >= chunk.end;
1438
- while (chunk && !chunk.contains(start)) chunk = searchForward ? this.byStart.get(chunk.end) : this.byEnd.get(chunk.start);
1439
- if (chunk) this.lastSearchedChunk = chunk;
1517
+ const atBoundary = this.byStart.get(start);
1518
+ if (atBoundary && start === end) {
1519
+ const previous = this.byEnd.get(start);
1520
+ return !!previous && previous.content === "" && atBoundary.content === "";
1440
1521
  }
1522
+ let chunk = this._chunkAt(start);
1441
1523
  while (chunk && chunk.start < end) {
1442
- if (chunk.content === "") return true;
1524
+ if (chunk.content === "" && (chunk.replacedFrom < start || this.byStart.get(chunk.replacedFrom).replacesUntil < chunk.end)) return true;
1443
1525
  chunk = this.byStart.get(chunk.end);
1444
1526
  }
1445
1527
  return false;
1446
1528
  }
1447
1529
  /** @internal */
1448
1530
  _replaceRegexp(searchValue, replacement) {
1449
- function getReplacement(match, str) {
1450
- if (typeof replacement === "string") return expandReplacement(replacement, match[0], match.index, str, match.slice(1), match.groups);
1451
- else return match.groups === void 0 ? replacement(match[0], ...match.slice(1), match.index, str) : replacement(match[0], ...match.slice(1), match.index, str, match.groups);
1531
+ function getReplacement(match, index, str) {
1532
+ if (typeof replacement === "string") return expandReplacement(replacement, match[0], index, str, match.slice(1), match.groups);
1533
+ else return match.groups === void 0 ? replacement(match[0], ...match.slice(1), index, str) : replacement(match[0], ...match.slice(1), index, str, match.groups);
1452
1534
  }
1453
1535
  const replaceMatch = (match) => {
1454
1536
  /* v8 ignore next 2 -- `match.index` is always defined for matches from `matchAll` */
1455
1537
  if (match.index == null) return false;
1456
1538
  if (this._hasRemovedContent(match.index, match.index + match[0].length)) return false;
1457
- const replacement = getReplacement(match, this.original);
1539
+ const replacement = getReplacement(match, match.index, this.original);
1458
1540
  if (replacement === match[0]) return true;
1459
1541
  if (match[0].length === 0) this.appendRight(match.index - this.offset, replacement);
1460
1542
  else this.overwrite(match.index - this.offset, match.index + match[0].length - this.offset, replacement);
@@ -1527,5 +1609,4 @@ var MagicString = class MagicString {
1527
1609
  return this._replaceRegexp(searchValue, replacement);
1528
1610
  }
1529
1611
  };
1530
- //#endregion
1531
1612
  export { MagicString as t };