struct-fakerator 2.6.9 → 2.7.9

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 (486) hide show
  1. package/README.md +140 -85
  2. package/dist/airline-BUwgrfsj.d.ts +26 -0
  3. package/dist/airline-C0ManYED.d.mts +26 -0
  4. package/dist/animal-arG64NM6.d.mts +53 -0
  5. package/dist/animal-erAZXs_d.d.ts +53 -0
  6. package/dist/{chunk-EMCK2BLM.js → chunk-25HDDMTE.js} +10 -10
  7. package/dist/{chunk-TXAOQHVV.mjs → chunk-266JLHQ7.mjs} +1 -1
  8. package/dist/{chunk-JGY3KVDU.mjs → chunk-266W7TLD.mjs} +1 -1
  9. package/dist/chunk-2FTPTSHD.mjs +1972 -0
  10. package/dist/chunk-2HHTDZ5W.mjs +27 -0
  11. package/dist/chunk-2P6DPKAW.js +35 -0
  12. package/dist/chunk-2QPSWN3J.js +24 -0
  13. package/dist/{chunk-GJSTX6ZS.mjs → chunk-2SF54GZN.mjs} +1 -1
  14. package/dist/chunk-2UAN3WRZ.js +51 -0
  15. package/dist/{chunk-MGR2M7BS.mjs → chunk-2VTSGFBK.mjs} +1 -1
  16. package/dist/chunk-2ZR6AR26.js +24 -0
  17. package/dist/chunk-3APOILUV.js +81 -0
  18. package/dist/chunk-3AXS7RA6.mjs +18 -0
  19. package/dist/chunk-3DIP4M5Y.mjs +36 -0
  20. package/dist/{chunk-PGSJJESY.js → chunk-3E2B272L.js} +4 -6
  21. package/dist/chunk-3FFGDXA5.mjs +48 -0
  22. package/dist/chunk-3HQMGDUF.js +98 -0
  23. package/dist/chunk-3MYH2PDS.js +24 -0
  24. package/dist/{chunk-UP2JIDGZ.js → chunk-3P4RJMMV.js} +20 -22
  25. package/dist/chunk-3PSJD6BF.js +67 -0
  26. package/dist/chunk-3SVV5GDL.js +22 -0
  27. package/dist/chunk-3WINWLTB.js +34 -0
  28. package/dist/chunk-42EKB2FX.js +74 -0
  29. package/dist/{chunk-WLKNXHFN.mjs → chunk-44Q7WXPL.mjs} +1 -1
  30. package/dist/chunk-474WFN7X.js +33 -0
  31. package/dist/chunk-4ESFUYHU.js +48 -0
  32. package/dist/chunk-4OB35J4Q.mjs +151 -0
  33. package/dist/chunk-4UGSTE5Q.js +1968 -0
  34. package/dist/{chunk-6HRHPVPM.js → chunk-4XEKUGKR.js} +6 -6
  35. package/dist/chunk-4XQBQAPC.mjs +33 -0
  36. package/dist/chunk-52ZOIHJM.js +26 -0
  37. package/dist/chunk-55HSOHNN.js +36 -0
  38. package/dist/{chunk-R2MQ3IW5.mjs → chunk-5A3HJWPX.mjs} +1 -1
  39. package/dist/chunk-5KKLW4SD.js +26 -0
  40. package/dist/chunk-5LCWZUVP.mjs +19 -0
  41. package/dist/chunk-5M3DUBFV.mjs +24 -0
  42. package/dist/{chunk-JB6NCVX3.mjs → chunk-5NC3JFHS.mjs} +1 -1
  43. package/dist/chunk-5PCIFPK7.js +15721 -0
  44. package/dist/{chunk-ET6EJB33.js → chunk-5TG43IWT.js} +7 -7
  45. package/dist/chunk-5UFZ4NET.mjs +26 -0
  46. package/dist/chunk-5VTJIH2Q.mjs +63 -0
  47. package/dist/chunk-5ZNSQDU5.js +81 -0
  48. package/dist/chunk-62MDIAG3.js +19 -0
  49. package/dist/chunk-62NUC6UZ.js +51 -0
  50. package/dist/chunk-6BWS3CLP.mjs +16 -0
  51. package/dist/chunk-6GXFVYK2.js +18 -0
  52. package/dist/{chunk-5PCDQHI5.mjs → chunk-6LNIYJMV.mjs} +1 -1
  53. package/dist/{chunk-TA725QXR.mjs → chunk-6OOU3BX5.mjs} +1 -1
  54. package/dist/{chunk-7VOPOQZO.js → chunk-6QXR4Q23.js} +10 -12
  55. package/dist/chunk-6QZF75LH.js +20 -0
  56. package/dist/chunk-6TGTIMX2.mjs +151 -0
  57. package/dist/{chunk-G43WDHZO.mjs → chunk-6UVWD65N.mjs} +1 -1
  58. package/dist/chunk-73BBBL26.js +49 -0
  59. package/dist/chunk-7C2MCLYX.mjs +15721 -0
  60. package/dist/chunk-7IQW6MWT.mjs +81 -0
  61. package/dist/chunk-7IWAOHPW.mjs +27 -0
  62. package/dist/{chunk-IL4E3ZNB.js → chunk-7LDYF5VW.js} +21 -21
  63. package/dist/chunk-7POVLKQR.mjs +20 -0
  64. package/dist/chunk-7QCNINQB.js +43 -0
  65. package/dist/chunk-7RP7F74O.js +49 -0
  66. package/dist/chunk-7TMD372Q.mjs +165 -0
  67. package/dist/chunk-7V3T6MQ3.mjs +21 -0
  68. package/dist/{chunk-Z5BNMPTX.mjs → chunk-7ZAVU2DI.mjs} +1 -1
  69. package/dist/chunk-A4QVPMYT.js +44 -0
  70. package/dist/chunk-A5YXOL6G.mjs +63 -0
  71. package/dist/chunk-ABZZ2Y2O.mjs +45 -0
  72. package/dist/chunk-AH3KD37M.js +45 -0
  73. package/dist/{chunk-NHYNERHW.js → chunk-AQWBYQGF.js} +13 -15
  74. package/dist/chunk-AT4FPDTE.mjs +51 -0
  75. package/dist/chunk-AWKBY27N.js +35 -0
  76. package/dist/chunk-B2NENAKV.mjs +34 -0
  77. package/dist/chunk-B3RA7BAM.mjs +30 -0
  78. package/dist/chunk-B7MK7WHV.mjs +21 -0
  79. package/dist/chunk-BGE4WZH7.js +27 -0
  80. package/dist/chunk-BMQ2NETL.js +63 -0
  81. package/dist/chunk-BNJUSXEO.js +27 -0
  82. package/dist/chunk-BNUCXH6Q.js +49 -0
  83. package/dist/chunk-BS7IEV74.mjs +1968 -0
  84. package/dist/chunk-BVGE5IMC.js +45 -0
  85. package/dist/chunk-C6FQYK5T.js +81 -0
  86. package/dist/chunk-C6IEYVWV.mjs +21 -0
  87. package/dist/chunk-CC255UJD.mjs +27 -0
  88. package/dist/chunk-CK65OFQQ.mjs +56 -0
  89. package/dist/chunk-CKNDI3RH.js +24 -0
  90. package/dist/{chunk-F4GVSNLH.js → chunk-CRW5Q4VB.js} +5 -5
  91. package/dist/chunk-CSOXFDKC.mjs +42 -0
  92. package/dist/chunk-D3DPNIYF.mjs +36 -0
  93. package/dist/chunk-D6QN54CO.js +46 -0
  94. package/dist/chunk-D74AUXZW.mjs +35 -0
  95. package/dist/chunk-DN6VWFMI.js +56 -0
  96. package/dist/chunk-DONFLQME.js +49 -0
  97. package/dist/{chunk-ZSR4TJQG.js → chunk-DQBTHPWE.js} +3 -3
  98. package/dist/chunk-DSDX7NOV.mjs +40 -0
  99. package/dist/chunk-DX6NQK6H.js +49 -0
  100. package/dist/{chunk-RD2SB2KT.js → chunk-DXVB5THL.js} +7 -7
  101. package/dist/chunk-DZCTAI2Q.js +49 -0
  102. package/dist/chunk-E3EZHXI2.mjs +45 -0
  103. package/dist/chunk-E3N3PWFI.js +45 -0
  104. package/dist/{chunk-RZPUHXXO.mjs → chunk-E7JW4TGQ.mjs} +1 -1
  105. package/dist/chunk-ECTLN5SO.mjs +63 -0
  106. package/dist/chunk-EGCGEPYD.mjs +24 -0
  107. package/dist/chunk-ELK6OOE6.js +55 -0
  108. package/dist/{chunk-YXGKUR3R.js → chunk-EPWKT75L.js} +16 -16
  109. package/dist/chunk-ES6I4JEP.js +24 -0
  110. package/dist/{chunk-7BIWHK77.js → chunk-ETS5PP3N.js} +9 -9
  111. package/dist/chunk-EXLV2IRM.mjs +26 -0
  112. package/dist/chunk-EZFWJGGR.js +28 -0
  113. package/dist/chunk-F4NIEPKF.mjs +48 -0
  114. package/dist/chunk-F4WSUHUB.js +27 -0
  115. package/dist/{chunk-SD3HVRQN.mjs → chunk-F54WJZPR.mjs} +1 -1
  116. package/dist/chunk-FDIHUTKO.mjs +34 -0
  117. package/dist/chunk-FG2O523S.js +48 -0
  118. package/dist/chunk-FGA73ALI.mjs +45 -0
  119. package/dist/chunk-FT5QWXEO.mjs +21 -0
  120. package/dist/{chunk-VG6JYCUC.mjs → chunk-FXTLAJTY.mjs} +1 -1
  121. package/dist/chunk-G73JPAKW.mjs +16831 -0
  122. package/dist/chunk-GAOFL72U.mjs +24 -0
  123. package/dist/chunk-GF4PSVJ7.js +81 -0
  124. package/dist/chunk-GL777PKT.js +21 -0
  125. package/dist/{chunk-IAR3DUKD.js → chunk-GLK5ZVJB.js} +10 -12
  126. package/dist/chunk-GMOMLI4W.js +56 -0
  127. package/dist/chunk-GNFZ7Z6V.mjs +28 -0
  128. package/dist/{chunk-JWCDEYMY.js → chunk-GNLLMLQX.js} +11 -11
  129. package/dist/chunk-GNPP2GGZ.js +16831 -0
  130. package/dist/chunk-GR5EJCJ2.js +24 -0
  131. package/dist/chunk-GSFJYUDA.js +63 -0
  132. package/dist/{chunk-QTVSUA5W.mjs → chunk-GUIYTTMP.mjs} +1 -1
  133. package/dist/chunk-HAIK2LXD.js +63 -0
  134. package/dist/chunk-HEHR64VN.js +1972 -0
  135. package/dist/chunk-HK4L636Y.mjs +49 -0
  136. package/dist/chunk-HLHMXAI2.js +21 -0
  137. package/dist/chunk-HMDAKHLF.js +151 -0
  138. package/dist/chunk-HMGGQ5ZJ.js +45 -0
  139. package/dist/chunk-HNCQJ5F3.js +56 -0
  140. package/dist/chunk-HVWSAC7Q.js +74 -0
  141. package/dist/chunk-I3BHVE4B.js +43 -0
  142. package/dist/chunk-IEYIHOHM.js +57 -0
  143. package/dist/chunk-IHDAERZ6.mjs +61 -0
  144. package/dist/chunk-IM5JST4B.js +76 -0
  145. package/dist/{chunk-5O3L5474.mjs → chunk-IN3R3ABZ.mjs} +1 -1
  146. package/dist/{chunk-6UFUX7X4.js → chunk-IOLQKV4S.js} +12 -12
  147. package/dist/chunk-IRHHL256.mjs +36 -0
  148. package/dist/chunk-IY4LBMAL.js +78 -0
  149. package/dist/chunk-IZVHA6FO.js +45 -0
  150. package/dist/chunk-JA2F23JA.mjs +79 -0
  151. package/dist/chunk-JC2FY5K5.mjs +42 -0
  152. package/dist/chunk-JFYN4RCQ.mjs +24 -0
  153. package/dist/chunk-JHNWL66I.mjs +47 -0
  154. package/dist/chunk-JIPBMHNL.mjs +63 -0
  155. package/dist/chunk-JIWCYW33.js +35 -0
  156. package/dist/chunk-JSZXNY5A.js +33 -0
  157. package/dist/chunk-JTURHVCR.mjs +67 -0
  158. package/dist/chunk-JUS3FQET.js +63 -0
  159. package/dist/chunk-JY2DLJQ7.js +74 -0
  160. package/dist/chunk-KB4QNLUX.js +30 -0
  161. package/dist/chunk-KDRX2A7A.mjs +45 -0
  162. package/dist/chunk-KDTNND32.js +63 -0
  163. package/dist/chunk-KESFLCJB.mjs +57 -0
  164. package/dist/chunk-KK4QURZV.mjs +63 -0
  165. package/dist/chunk-KKDNACGF.js +78 -0
  166. package/dist/chunk-KLYK2EDS.js +18 -0
  167. package/dist/chunk-KMAT3MEQ.mjs +24 -0
  168. package/dist/chunk-KMGBR4B7.mjs +49 -0
  169. package/dist/chunk-KO4BOJXG.mjs +18 -0
  170. package/dist/chunk-KSBJZ7PZ.mjs +48 -0
  171. package/dist/chunk-KUNWO6DB.js +20 -0
  172. package/dist/chunk-KVPPJDFE.mjs +63 -0
  173. package/dist/chunk-L55R55BM.mjs +24 -0
  174. package/dist/{chunk-HBJP434N.mjs → chunk-L5EOJC4C.mjs} +1 -1
  175. package/dist/chunk-L63CILKL.js +36 -0
  176. package/dist/chunk-L7SUBSOS.mjs +74 -0
  177. package/dist/chunk-LCQV5ZXR.js +63 -0
  178. package/dist/{chunk-MROZIQOV.mjs → chunk-LDVSCWU7.mjs} +1 -1
  179. package/dist/chunk-LGYUIU5L.js +33 -0
  180. package/dist/chunk-LKLQIBRC.mjs +18 -0
  181. package/dist/chunk-LPLLITHD.mjs +33 -0
  182. package/dist/{chunk-EYOBG3PQ.mjs → chunk-LSP4VVPM.mjs} +1 -1
  183. package/dist/chunk-LYYFKB5U.mjs +48 -0
  184. package/dist/chunk-M2ERA63H.mjs +20 -0
  185. package/dist/chunk-M3JRMFX2.js +36 -0
  186. package/dist/chunk-M7SBPX3E.mjs +45 -0
  187. package/dist/chunk-MCHBNMZ7.js +48 -0
  188. package/dist/chunk-MHBVLDC4.js +30 -0
  189. package/dist/chunk-MJWNNESP.js +57 -0
  190. package/dist/chunk-MKTV5ZCC.mjs +30 -0
  191. package/dist/chunk-MNRDBDJD.js +33 -0
  192. package/dist/chunk-MTNLYYS2.mjs +51 -0
  193. package/dist/chunk-MYNHKOPJ.js +34 -0
  194. package/dist/chunk-N2ZA6SQB.mjs +45 -0
  195. package/dist/{chunk-ES2CYGB7.js → chunk-NBUVTD24.js} +3 -3
  196. package/dist/{chunk-RDZI4CMI.mjs → chunk-NEFBZJ7G.mjs} +1 -1
  197. package/dist/{chunk-DGW666Q6.mjs → chunk-NGJNM6BX.mjs} +1 -1
  198. package/dist/chunk-NO44Z2RV.mjs +55 -0
  199. package/dist/chunk-NOD5QLN5.js +40 -0
  200. package/dist/chunk-NP7ZKTAA.js +36 -0
  201. package/dist/chunk-NPYKAZ5O.mjs +42 -0
  202. package/dist/chunk-NWVKBRLA.js +30 -0
  203. package/dist/chunk-O73LDQID.mjs +57 -0
  204. package/dist/chunk-OAPPDES4.js +51 -0
  205. package/dist/chunk-OCKZOACK.js +24 -0
  206. package/dist/chunk-OETKBS7R.mjs +63 -0
  207. package/dist/chunk-OFMBEI6Y.js +20 -0
  208. package/dist/chunk-OJRNPQVE.js +45 -0
  209. package/dist/chunk-OKDN5R6M.mjs +78 -0
  210. package/dist/chunk-OLSCXZ3D.mjs +98 -0
  211. package/dist/chunk-OTDJMFZE.js +36 -0
  212. package/dist/chunk-OYP22DDC.mjs +31 -0
  213. package/dist/{chunk-6ZK2LMFM.js → chunk-OZ5VJVBQ.js} +2 -2
  214. package/dist/chunk-OZ7Y3D4Z.js +48 -0
  215. package/dist/chunk-OZU24BQP.mjs +81 -0
  216. package/dist/chunk-P2NEBQQH.mjs +78 -0
  217. package/dist/chunk-PBOBMHB3.js +45 -0
  218. package/dist/chunk-PECDKT6F.js +76 -0
  219. package/dist/chunk-PEMTSFQT.mjs +36 -0
  220. package/dist/chunk-PFTS7XQK.js +27 -0
  221. package/dist/chunk-PFVCJYEK.js +46 -0
  222. package/dist/chunk-PLNNO4GL.js +36 -0
  223. package/dist/chunk-PPQIZT6A.mjs +48 -0
  224. package/dist/chunk-PS673ZMG.mjs +78 -0
  225. package/dist/chunk-PSTZXVEM.mjs +45 -0
  226. package/dist/chunk-PXVILWPC.js +51 -0
  227. package/dist/chunk-PXXIPMA2.mjs +17567 -0
  228. package/dist/chunk-PYIUSFN2.js +48 -0
  229. package/dist/chunk-Q4BXZB6O.mjs +35 -0
  230. package/dist/chunk-Q6CVTFPU.mjs +2022 -0
  231. package/dist/chunk-Q7THO24V.js +45 -0
  232. package/dist/chunk-QEVQSGOW.mjs +49 -0
  233. package/dist/chunk-QFG2B4XU.js +35 -0
  234. package/dist/{chunk-23I6D5SJ.js → chunk-QH2RT36U.js} +12 -12
  235. package/dist/chunk-QHW2YYKY.js +45 -0
  236. package/dist/chunk-QMNACCJG.mjs +30 -0
  237. package/dist/chunk-QN2KYEUJ.js +28 -0
  238. package/dist/chunk-QOATILWS.mjs +48 -0
  239. package/dist/chunk-QQWZ56UO.js +33 -0
  240. package/dist/chunk-QTT2TUDM.js +165 -0
  241. package/dist/chunk-R3MBRFOY.js +22 -0
  242. package/dist/chunk-R5U7XKVJ.js +16 -0
  243. package/dist/chunk-R7ZZJULR.js +61 -0
  244. package/dist/chunk-RA35MXTT.mjs +51 -0
  245. package/dist/chunk-RCDDW7NN.js +36 -0
  246. package/dist/chunk-RDATYKAG.mjs +58 -0
  247. package/dist/chunk-RDMAE6F2.js +17567 -0
  248. package/dist/chunk-RFTRP37B.mjs +74 -0
  249. package/dist/chunk-RIOEYYMH.mjs +30 -0
  250. package/dist/chunk-RJPUHGKC.mjs +54 -0
  251. package/dist/chunk-RM7GMMWN.mjs +49 -0
  252. package/dist/chunk-ROM4ZH2A.js +56 -0
  253. package/dist/{chunk-RTYV5XDU.mjs → chunk-RTENULN5.mjs} +1 -1
  254. package/dist/chunk-RUTM5ENW.js +57 -0
  255. package/dist/chunk-RUUOAMRF.mjs +43 -0
  256. package/dist/chunk-RW4IZD3J.js +74 -0
  257. package/dist/chunk-RWSXJDFQ.mjs +57 -0
  258. package/dist/chunk-S2AEEWWW.mjs +36 -0
  259. package/dist/chunk-SAYLPMKP.js +74 -0
  260. package/dist/chunk-SDPCOC7O.mjs +76 -0
  261. package/dist/chunk-SEUDYVHA.js +45 -0
  262. package/dist/chunk-SMIDTCUZ.mjs +56 -0
  263. package/dist/{chunk-62INTWCD.mjs → chunk-SN2ALAEI.mjs} +1 -1
  264. package/dist/chunk-SOFVWH6A.js +56 -0
  265. package/dist/chunk-SSFS7U3T.mjs +72 -0
  266. package/dist/{chunk-DTC7Q7P5.js → chunk-SSZ5GGDT.js} +10 -10
  267. package/dist/chunk-STKSA23M.mjs +33 -0
  268. package/dist/chunk-SVHWBNOB.mjs +61 -0
  269. package/dist/chunk-SVMTK42D.mjs +48 -0
  270. package/dist/chunk-SYIPILT6.mjs +35 -0
  271. package/dist/chunk-T4IVAGFU.mjs +48 -0
  272. package/dist/chunk-TKS2PTMF.mjs +18 -0
  273. package/dist/chunk-TLH73HQN.js +63 -0
  274. package/dist/chunk-TQIJQZBP.js +57 -0
  275. package/dist/chunk-TQTDHXR6.mjs +22 -0
  276. package/dist/chunk-TSDTKUIT.mjs +151 -0
  277. package/dist/chunk-TTPRXCNS.mjs +46 -0
  278. package/dist/chunk-TYWXW3FQ.mjs +46 -0
  279. package/dist/chunk-U3EACZZ3.js +18 -0
  280. package/dist/{chunk-VMSMHNPY.js → chunk-U3TS432W.js} +9 -9
  281. package/dist/chunk-U634RJNK.js +36 -0
  282. package/dist/chunk-UCRPFQYY.js +48 -0
  283. package/dist/chunk-UEXFND2J.mjs +56 -0
  284. package/dist/chunk-UJ5Q7MZB.js +78 -0
  285. package/dist/chunk-UOSN6FPU.js +42 -0
  286. package/dist/{chunk-5KF6D2RT.js → chunk-UOY5QUAW.js} +16 -16
  287. package/dist/chunk-UP3FJ7EK.mjs +44 -0
  288. package/dist/chunk-UQYEFGMG.mjs +43 -0
  289. package/dist/chunk-URX5VRVB.js +24 -0
  290. package/dist/chunk-UUIIGFUZ.js +33 -0
  291. package/dist/chunk-UX7CIOBD.js +61 -0
  292. package/dist/chunk-V4JFB4H6.mjs +45 -0
  293. package/dist/{chunk-GYF6YSNX.js → chunk-V4P2FTIC.js} +17 -19
  294. package/dist/chunk-VKKQV6UO.js +42 -0
  295. package/dist/chunk-VOMHZHCC.js +21 -0
  296. package/dist/chunk-VTSJ33HJ.js +18 -0
  297. package/dist/chunk-VVELSEXL.mjs +27 -0
  298. package/dist/chunk-VX346ARA.js +42 -0
  299. package/dist/chunk-VYV7BUJR.js +42 -0
  300. package/dist/chunk-W4CBCFMS.mjs +36 -0
  301. package/dist/chunk-W6QSJNDJ.js +58 -0
  302. package/dist/chunk-WDFGFSCS.js +63 -0
  303. package/dist/chunk-WGRAINAP.mjs +43 -0
  304. package/dist/chunk-WH4MHYUQ.mjs +33 -0
  305. package/dist/chunk-WJ6C635R.mjs +45 -0
  306. package/dist/chunk-WSYHZP5C.mjs +28 -0
  307. package/dist/chunk-X5WN73EF.js +48 -0
  308. package/dist/chunk-X7YFEBIL.mjs +28 -0
  309. package/dist/chunk-XB5AI72P.mjs +24 -0
  310. package/dist/chunk-XCCBDMTZ.mjs +22 -0
  311. package/dist/chunk-XG6RUZSI.mjs +16 -0
  312. package/dist/chunk-XI5L2ENL.js +28 -0
  313. package/dist/chunk-XIROUDIK.js +151 -0
  314. package/dist/chunk-XJ3B37LJ.js +45 -0
  315. package/dist/chunk-XJGSUINR.mjs +24 -0
  316. package/dist/chunk-XKWYGGIM.mjs +36 -0
  317. package/dist/chunk-XL5V4E3Z.js +16 -0
  318. package/dist/chunk-XMR5DWYS.mjs +74 -0
  319. package/dist/chunk-XN5RU4UY.js +27 -0
  320. package/dist/{chunk-VSZRD7CB.js → chunk-XR64DI5O.js} +6 -8
  321. package/dist/chunk-XUZOVQYC.mjs +42 -0
  322. package/dist/chunk-XVQOUXV6.js +48 -0
  323. package/dist/chunk-XYNVAWSB.mjs +45 -0
  324. package/dist/chunk-Y2G3CY4Q.mjs +51 -0
  325. package/dist/chunk-YHZKCAK6.mjs +49 -0
  326. package/dist/chunk-YJXRZ5WX.mjs +78 -0
  327. package/dist/chunk-YNT5L5UH.js +78 -0
  328. package/dist/chunk-YRB3F2AG.mjs +81 -0
  329. package/dist/chunk-YRRALMO4.mjs +36 -0
  330. package/dist/{chunk-4DDCMYY5.mjs → chunk-YUFVOYYX.mjs} +1 -1
  331. package/dist/chunk-YV3HYBCX.js +45 -0
  332. package/dist/chunk-YVASGALV.js +81 -0
  333. package/dist/chunk-YWFUY5A4.js +30 -0
  334. package/dist/chunk-YYSJWYK3.js +21 -0
  335. package/dist/chunk-YZNZHRY3.mjs +81 -0
  336. package/dist/chunk-Z46HCVNZ.js +151 -0
  337. package/dist/chunk-Z5HPFZ65.mjs +35 -0
  338. package/dist/chunk-ZADIRLZW.mjs +56 -0
  339. package/dist/chunk-ZAU43ZDI.mjs +74 -0
  340. package/dist/chunk-ZBU5LSC3.mjs +45 -0
  341. package/dist/chunk-ZDV7FI2F.js +45 -0
  342. package/dist/chunk-ZKVLWCGR.mjs +63 -0
  343. package/dist/chunk-ZN3MHVES.mjs +57 -0
  344. package/dist/chunk-ZPQ6LVKQ.mjs +20 -0
  345. package/dist/chunk-ZQYJPU4U.mjs +76 -0
  346. package/dist/chunk-ZSBGAX6X.js +2022 -0
  347. package/dist/chunk-ZT2QP4MD.mjs +25 -0
  348. package/dist/chunk-ZTUCFJLM.mjs +33 -0
  349. package/dist/chunk-ZXWWD74E.mjs +45 -0
  350. package/dist/color-BmTZnKiW.d.mts +61 -0
  351. package/dist/color-WFinq_Y4.d.ts +61 -0
  352. package/dist/commerce-Ch71_dd2.d.ts +40 -0
  353. package/dist/commerce-IGFkOXjQ.d.mts +40 -0
  354. package/dist/common-CbuXAeQ-.d.mts +11 -0
  355. package/dist/common-Kp8LaAzK.d.ts +11 -0
  356. package/dist/company---O1IwYo.d.ts +35 -0
  357. package/dist/company-D7Cc_hsx.d.mts +35 -0
  358. package/dist/create_config.d.mts +1 -1
  359. package/dist/create_config.d.ts +1 -1
  360. package/dist/create_generator_fn.js +2 -3
  361. package/dist/create_generator_fn.mjs +1 -2
  362. package/dist/create_generator_fn.test.js +23 -14
  363. package/dist/create_generator_fn.test.mjs +11 -2
  364. package/dist/database-B8Wr1oXH.d.mts +23 -0
  365. package/dist/database-Dnsy3cQb.d.ts +23 -0
  366. package/dist/datatype-CAu_sc1g.d.ts +13 -0
  367. package/dist/datatype-gjFHrdMj.d.mts +13 -0
  368. package/dist/datetime-BDgsnqq_.d.mts +78 -0
  369. package/dist/datetime-BkidbR1O.d.ts +78 -0
  370. package/dist/finance-BZEmlfNQ.d.mts +90 -0
  371. package/dist/finance-Cn3DFbX4.d.ts +90 -0
  372. package/dist/food-CfxZX81O.d.mts +35 -0
  373. package/dist/food-tr11e_Qp.d.ts +35 -0
  374. package/dist/generator_fn.js +3 -4
  375. package/dist/generator_fn.mjs +2 -3
  376. package/dist/git-DoCI9ZYT.d.ts +31 -0
  377. package/dist/git-Feo1ntKa.d.mts +31 -0
  378. package/dist/hacker-X3zBTMoE.d.ts +26 -0
  379. package/dist/hacker-mGVIO_wL.d.mts +26 -0
  380. package/dist/image-BeZbZlyo.d.ts +56 -0
  381. package/dist/image-govZ7HjA.d.mts +56 -0
  382. package/dist/index.js +3 -4
  383. package/dist/index.mjs +2 -3
  384. package/dist/internet-BWBjFZ1E.d.mts +101 -0
  385. package/dist/internet-CH_7YDHs.d.mts +106 -0
  386. package/dist/internet-CJEETk0v.d.mts +101 -0
  387. package/dist/internet-DLYaMWtd.d.ts +106 -0
  388. package/dist/internet-WmWuV39U.d.ts +101 -0
  389. package/dist/internet-jHHnqVJG.d.ts +101 -0
  390. package/dist/location-CTA_Bq7w.d.mts +80 -0
  391. package/dist/location-CsVekxIU.d.ts +80 -0
  392. package/dist/lorem-BE4n3dVs.d.mts +62 -0
  393. package/dist/lorem-Btv0fltY.d.ts +62 -0
  394. package/dist/magic-string.es-PQN52XPX.js +1288 -0
  395. package/dist/magic-string.es-X3ME2TR2.mjs +1288 -0
  396. package/dist/music-CQ3lnDvg.d.mts +20 -0
  397. package/dist/music-D3zj5REe.d.ts +20 -0
  398. package/dist/number-Bj9ydAOH.d.ts +47 -0
  399. package/dist/number-D9Wn_qjS.d.mts +47 -0
  400. package/dist/number-DomDs-l5.d.mts +47 -0
  401. package/dist/number-DvzbKHZR.d.ts +47 -0
  402. package/dist/person-LLleVozS.d.ts +58 -0
  403. package/dist/person-OKRyYmeX.d.mts +58 -0
  404. package/dist/phone-Bc8UXPF3.d.ts +16 -0
  405. package/dist/phone-QbHXAqVF.d.mts +16 -0
  406. package/dist/science-BgXAZ3YR.d.ts +15 -0
  407. package/dist/science-CSN41yUZ.d.mts +15 -0
  408. package/dist/string-9w976kVk.d.mts +87 -0
  409. package/dist/string-Cm9TczI6.d.ts +87 -0
  410. package/dist/system-DOyHjHxs.d.mts +55 -0
  411. package/dist/system-DipW6DYb.d.ts +55 -0
  412. package/dist/system-EuG0S2Xy.d.mts +55 -0
  413. package/dist/system-ZV2S9Qw2.d.ts +55 -0
  414. package/dist/test.js +4 -4
  415. package/dist/test.mjs +1 -1
  416. package/dist/type-C8Ny1fB6.d.mts +33 -0
  417. package/dist/type-C8Ny1fB6.d.ts +33 -0
  418. package/dist/type.d.mts +1 -1
  419. package/dist/type.d.ts +1 -1
  420. package/dist/utils/airline.js +2 -3
  421. package/dist/utils/airline.mjs +1 -2
  422. package/dist/utils/animal.js +2 -3
  423. package/dist/utils/animal.mjs +1 -2
  424. package/dist/utils/color.js +2 -3
  425. package/dist/utils/color.mjs +1 -2
  426. package/dist/utils/commerce.js +2 -3
  427. package/dist/utils/commerce.mjs +1 -2
  428. package/dist/utils/company.js +2 -3
  429. package/dist/utils/company.mjs +1 -2
  430. package/dist/utils/database.js +2 -3
  431. package/dist/utils/database.mjs +1 -2
  432. package/dist/utils/datatype.js +2 -3
  433. package/dist/utils/datatype.mjs +1 -2
  434. package/dist/utils/datetime.js +2 -3
  435. package/dist/utils/datetime.mjs +1 -2
  436. package/dist/utils/finance.js +2 -3
  437. package/dist/utils/finance.mjs +1 -2
  438. package/dist/utils/food.js +2 -3
  439. package/dist/utils/food.mjs +1 -2
  440. package/dist/utils/git.js +2 -3
  441. package/dist/utils/git.mjs +1 -2
  442. package/dist/utils/hacker.js +2 -3
  443. package/dist/utils/hacker.mjs +1 -2
  444. package/dist/utils/image.js +2 -3
  445. package/dist/utils/image.mjs +1 -2
  446. package/dist/utils/index.d.mts +1 -1
  447. package/dist/utils/index.d.ts +1 -1
  448. package/dist/utils/index.js +26 -27
  449. package/dist/utils/index.mjs +27 -28
  450. package/dist/utils/internet.d.mts +1 -1
  451. package/dist/utils/internet.d.ts +1 -1
  452. package/dist/utils/internet.js +2 -3
  453. package/dist/utils/internet.mjs +3 -4
  454. package/dist/utils/location.js +2 -3
  455. package/dist/utils/location.mjs +1 -2
  456. package/dist/utils/lorem.js +2 -3
  457. package/dist/utils/lorem.mjs +1 -2
  458. package/dist/utils/music.js +2 -3
  459. package/dist/utils/music.mjs +1 -2
  460. package/dist/utils/number.js +2 -3
  461. package/dist/utils/number.mjs +1 -2
  462. package/dist/utils/person.js +2 -3
  463. package/dist/utils/person.mjs +1 -2
  464. package/dist/utils/phone.js +2 -3
  465. package/dist/utils/phone.mjs +1 -2
  466. package/dist/utils/science.js +2 -3
  467. package/dist/utils/science.mjs +1 -2
  468. package/dist/utils/string.js +2 -3
  469. package/dist/utils/string.mjs +1 -2
  470. package/dist/utils/system.js +2 -3
  471. package/dist/utils/system.mjs +1 -2
  472. package/dist/utils/vehicle.js +2 -3
  473. package/dist/utils/vehicle.mjs +1 -2
  474. package/dist/utils/word.js +10 -12
  475. package/dist/utils/word.mjs +10 -12
  476. package/dist/utils-BiDlGzTl.d.mts +10 -0
  477. package/dist/utils-DinJc3Cq.d.ts +10 -0
  478. package/dist/vehicle-DmBDda98.d.mts +35 -0
  479. package/dist/vehicle-rnBz1Za2.d.ts +35 -0
  480. package/package.json +2 -26
  481. package/src/create_config.ts +1 -1
  482. package/src/create_generator_fn.test.ts +11 -0
  483. package/src/create_generator_fn.ts +5 -4
  484. package/src/type.ts +1 -1
  485. package/src/utils/internet.ts +1 -1
  486. package/src/test.ts +0 -10
@@ -0,0 +1,1288 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-R5U7XKVJ.js');
2
+
3
+ // node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
4
+ var comma = ",".charCodeAt(0);
5
+ var semicolon = ";".charCodeAt(0);
6
+ var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
7
+ var intToChar = new Uint8Array(64);
8
+ var charToInt = new Uint8Array(128);
9
+ for (let i = 0; i < chars.length; i++) {
10
+ const c = chars.charCodeAt(i);
11
+ intToChar[i] = c;
12
+ charToInt[c] = i;
13
+ }
14
+ function encodeInteger(builder, num, relative) {
15
+ let delta = num - relative;
16
+ delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
17
+ do {
18
+ let clamped = delta & 31;
19
+ delta >>>= 5;
20
+ if (delta > 0)
21
+ clamped |= 32;
22
+ builder.write(intToChar[clamped]);
23
+ } while (delta > 0);
24
+ return num;
25
+ }
26
+ var bufLength = 1024 * 16;
27
+ var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
28
+ decode(buf) {
29
+ const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
30
+ return out.toString();
31
+ }
32
+ } : {
33
+ decode(buf) {
34
+ let out = "";
35
+ for (let i = 0; i < buf.length; i++) {
36
+ out += String.fromCharCode(buf[i]);
37
+ }
38
+ return out;
39
+ }
40
+ };
41
+ var StringWriter = class {
42
+ constructor() {
43
+ this.pos = 0;
44
+ this.out = "";
45
+ this.buffer = new Uint8Array(bufLength);
46
+ }
47
+ write(v) {
48
+ const { buffer } = this;
49
+ buffer[this.pos++] = v;
50
+ if (this.pos === bufLength) {
51
+ this.out += td.decode(buffer);
52
+ this.pos = 0;
53
+ }
54
+ }
55
+ flush() {
56
+ const { buffer, out, pos } = this;
57
+ return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
58
+ }
59
+ };
60
+ function encode(decoded) {
61
+ const writer = new StringWriter();
62
+ let sourcesIndex = 0;
63
+ let sourceLine = 0;
64
+ let sourceColumn = 0;
65
+ let namesIndex = 0;
66
+ for (let i = 0; i < decoded.length; i++) {
67
+ const line = decoded[i];
68
+ if (i > 0)
69
+ writer.write(semicolon);
70
+ if (line.length === 0)
71
+ continue;
72
+ let genColumn = 0;
73
+ for (let j = 0; j < line.length; j++) {
74
+ const segment = line[j];
75
+ if (j > 0)
76
+ writer.write(comma);
77
+ genColumn = encodeInteger(writer, segment[0], genColumn);
78
+ if (segment.length === 1)
79
+ continue;
80
+ sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
81
+ sourceLine = encodeInteger(writer, segment[2], sourceLine);
82
+ sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
83
+ if (segment.length === 4)
84
+ continue;
85
+ namesIndex = encodeInteger(writer, segment[4], namesIndex);
86
+ }
87
+ }
88
+ return writer.flush();
89
+ }
90
+
91
+ // node_modules/.pnpm/magic-string@0.30.11/node_modules/magic-string/dist/magic-string.es.mjs
92
+ var BitSet = class _BitSet {
93
+ constructor(arg) {
94
+ this.bits = arg instanceof _BitSet ? arg.bits.slice() : [];
95
+ }
96
+ add(n2) {
97
+ this.bits[n2 >> 5] |= 1 << (n2 & 31);
98
+ }
99
+ has(n2) {
100
+ return !!(this.bits[n2 >> 5] & 1 << (n2 & 31));
101
+ }
102
+ };
103
+ var Chunk = class _Chunk {
104
+ constructor(start, end, content) {
105
+ this.start = start;
106
+ this.end = end;
107
+ this.original = content;
108
+ this.intro = "";
109
+ this.outro = "";
110
+ this.content = content;
111
+ this.storeName = false;
112
+ this.edited = false;
113
+ {
114
+ this.previous = null;
115
+ this.next = null;
116
+ }
117
+ }
118
+ appendLeft(content) {
119
+ this.outro += content;
120
+ }
121
+ appendRight(content) {
122
+ this.intro = this.intro + content;
123
+ }
124
+ clone() {
125
+ const chunk = new _Chunk(this.start, this.end, this.original);
126
+ chunk.intro = this.intro;
127
+ chunk.outro = this.outro;
128
+ chunk.content = this.content;
129
+ chunk.storeName = this.storeName;
130
+ chunk.edited = this.edited;
131
+ return chunk;
132
+ }
133
+ contains(index) {
134
+ return this.start < index && index < this.end;
135
+ }
136
+ eachNext(fn) {
137
+ let chunk = this;
138
+ while (chunk) {
139
+ fn(chunk);
140
+ chunk = chunk.next;
141
+ }
142
+ }
143
+ eachPrevious(fn) {
144
+ let chunk = this;
145
+ while (chunk) {
146
+ fn(chunk);
147
+ chunk = chunk.previous;
148
+ }
149
+ }
150
+ edit(content, storeName, contentOnly) {
151
+ this.content = content;
152
+ if (!contentOnly) {
153
+ this.intro = "";
154
+ this.outro = "";
155
+ }
156
+ this.storeName = storeName;
157
+ this.edited = true;
158
+ return this;
159
+ }
160
+ prependLeft(content) {
161
+ this.outro = content + this.outro;
162
+ }
163
+ prependRight(content) {
164
+ this.intro = content + this.intro;
165
+ }
166
+ reset() {
167
+ this.intro = "";
168
+ this.outro = "";
169
+ if (this.edited) {
170
+ this.content = this.original;
171
+ this.storeName = false;
172
+ this.edited = false;
173
+ }
174
+ }
175
+ split(index) {
176
+ const sliceIndex = index - this.start;
177
+ const originalBefore = this.original.slice(0, sliceIndex);
178
+ const originalAfter = this.original.slice(sliceIndex);
179
+ this.original = originalBefore;
180
+ const newChunk = new _Chunk(index, this.end, originalAfter);
181
+ newChunk.outro = this.outro;
182
+ this.outro = "";
183
+ this.end = index;
184
+ if (this.edited) {
185
+ newChunk.edit("", false);
186
+ this.content = "";
187
+ } else {
188
+ this.content = originalBefore;
189
+ }
190
+ newChunk.next = this.next;
191
+ if (newChunk.next) newChunk.next.previous = newChunk;
192
+ newChunk.previous = this;
193
+ this.next = newChunk;
194
+ return newChunk;
195
+ }
196
+ toString() {
197
+ return this.intro + this.content + this.outro;
198
+ }
199
+ trimEnd(rx) {
200
+ this.outro = this.outro.replace(rx, "");
201
+ if (this.outro.length) return true;
202
+ const trimmed = this.content.replace(rx, "");
203
+ if (trimmed.length) {
204
+ if (trimmed !== this.content) {
205
+ this.split(this.start + trimmed.length).edit("", void 0, true);
206
+ if (this.edited) {
207
+ this.edit(trimmed, this.storeName, true);
208
+ }
209
+ }
210
+ return true;
211
+ } else {
212
+ this.edit("", void 0, true);
213
+ this.intro = this.intro.replace(rx, "");
214
+ if (this.intro.length) return true;
215
+ }
216
+ }
217
+ trimStart(rx) {
218
+ this.intro = this.intro.replace(rx, "");
219
+ if (this.intro.length) return true;
220
+ const trimmed = this.content.replace(rx, "");
221
+ if (trimmed.length) {
222
+ if (trimmed !== this.content) {
223
+ const newChunk = this.split(this.end - trimmed.length);
224
+ if (this.edited) {
225
+ newChunk.edit(trimmed, this.storeName, true);
226
+ }
227
+ this.edit("", void 0, true);
228
+ }
229
+ return true;
230
+ } else {
231
+ this.edit("", void 0, true);
232
+ this.outro = this.outro.replace(rx, "");
233
+ if (this.outro.length) return true;
234
+ }
235
+ }
236
+ };
237
+ function getBtoa() {
238
+ if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") {
239
+ return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
240
+ } else if (typeof Buffer === "function") {
241
+ return (str) => Buffer.from(str, "utf-8").toString("base64");
242
+ } else {
243
+ return () => {
244
+ throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
245
+ };
246
+ }
247
+ }
248
+ var btoa = /* @__PURE__ */ getBtoa();
249
+ var SourceMap = class {
250
+ constructor(properties) {
251
+ this.version = 3;
252
+ this.file = properties.file;
253
+ this.sources = properties.sources;
254
+ this.sourcesContent = properties.sourcesContent;
255
+ this.names = properties.names;
256
+ this.mappings = encode(properties.mappings);
257
+ if (typeof properties.x_google_ignoreList !== "undefined") {
258
+ this.x_google_ignoreList = properties.x_google_ignoreList;
259
+ }
260
+ }
261
+ toString() {
262
+ return JSON.stringify(this);
263
+ }
264
+ toUrl() {
265
+ return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
266
+ }
267
+ };
268
+ function guessIndent(code) {
269
+ const lines = code.split("\n");
270
+ const tabbed = lines.filter((line) => /^\t+/.test(line));
271
+ const spaced = lines.filter((line) => /^ {2,}/.test(line));
272
+ if (tabbed.length === 0 && spaced.length === 0) {
273
+ return null;
274
+ }
275
+ if (tabbed.length >= spaced.length) {
276
+ return " ";
277
+ }
278
+ const min = spaced.reduce((previous, current) => {
279
+ const numSpaces = /^ +/.exec(current)[0].length;
280
+ return Math.min(numSpaces, previous);
281
+ }, Infinity);
282
+ return new Array(min + 1).join(" ");
283
+ }
284
+ function getRelativePath(from, to) {
285
+ const fromParts = from.split(/[/\\]/);
286
+ const toParts = to.split(/[/\\]/);
287
+ fromParts.pop();
288
+ while (fromParts[0] === toParts[0]) {
289
+ fromParts.shift();
290
+ toParts.shift();
291
+ }
292
+ if (fromParts.length) {
293
+ let i = fromParts.length;
294
+ while (i--) fromParts[i] = "..";
295
+ }
296
+ return fromParts.concat(toParts).join("/");
297
+ }
298
+ var toString = Object.prototype.toString;
299
+ function isObject(thing) {
300
+ return toString.call(thing) === "[object Object]";
301
+ }
302
+ function getLocator(source) {
303
+ const originalLines = source.split("\n");
304
+ const lineOffsets = [];
305
+ for (let i = 0, pos = 0; i < originalLines.length; i++) {
306
+ lineOffsets.push(pos);
307
+ pos += originalLines[i].length + 1;
308
+ }
309
+ return function locate(index) {
310
+ let i = 0;
311
+ let j = lineOffsets.length;
312
+ while (i < j) {
313
+ const m = i + j >> 1;
314
+ if (index < lineOffsets[m]) {
315
+ j = m;
316
+ } else {
317
+ i = m + 1;
318
+ }
319
+ }
320
+ const line = i - 1;
321
+ const column = index - lineOffsets[line];
322
+ return { line, column };
323
+ };
324
+ }
325
+ var wordRegex = /\w/;
326
+ var Mappings = class {
327
+ constructor(hires) {
328
+ this.hires = hires;
329
+ this.generatedCodeLine = 0;
330
+ this.generatedCodeColumn = 0;
331
+ this.raw = [];
332
+ this.rawSegments = this.raw[this.generatedCodeLine] = [];
333
+ this.pending = null;
334
+ }
335
+ addEdit(sourceIndex, content, loc, nameIndex) {
336
+ if (content.length) {
337
+ const contentLengthMinusOne = content.length - 1;
338
+ let contentLineEnd = content.indexOf("\n", 0);
339
+ let previousContentLineEnd = -1;
340
+ while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
341
+ const segment2 = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
342
+ if (nameIndex >= 0) {
343
+ segment2.push(nameIndex);
344
+ }
345
+ this.rawSegments.push(segment2);
346
+ this.generatedCodeLine += 1;
347
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
348
+ this.generatedCodeColumn = 0;
349
+ previousContentLineEnd = contentLineEnd;
350
+ contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
351
+ }
352
+ const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
353
+ if (nameIndex >= 0) {
354
+ segment.push(nameIndex);
355
+ }
356
+ this.rawSegments.push(segment);
357
+ this.advance(content.slice(previousContentLineEnd + 1));
358
+ } else if (this.pending) {
359
+ this.rawSegments.push(this.pending);
360
+ this.advance(content);
361
+ }
362
+ this.pending = null;
363
+ }
364
+ addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
365
+ let originalCharIndex = chunk.start;
366
+ let first = true;
367
+ let charInHiresBoundary = false;
368
+ while (originalCharIndex < chunk.end) {
369
+ if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
370
+ const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
371
+ if (this.hires === "boundary") {
372
+ if (wordRegex.test(original[originalCharIndex])) {
373
+ if (!charInHiresBoundary) {
374
+ this.rawSegments.push(segment);
375
+ charInHiresBoundary = true;
376
+ }
377
+ } else {
378
+ this.rawSegments.push(segment);
379
+ charInHiresBoundary = false;
380
+ }
381
+ } else {
382
+ this.rawSegments.push(segment);
383
+ }
384
+ }
385
+ if (original[originalCharIndex] === "\n") {
386
+ loc.line += 1;
387
+ loc.column = 0;
388
+ this.generatedCodeLine += 1;
389
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
390
+ this.generatedCodeColumn = 0;
391
+ first = true;
392
+ } else {
393
+ loc.column += 1;
394
+ this.generatedCodeColumn += 1;
395
+ first = false;
396
+ }
397
+ originalCharIndex += 1;
398
+ }
399
+ this.pending = null;
400
+ }
401
+ advance(str) {
402
+ if (!str) return;
403
+ const lines = str.split("\n");
404
+ if (lines.length > 1) {
405
+ for (let i = 0; i < lines.length - 1; i++) {
406
+ this.generatedCodeLine++;
407
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
408
+ }
409
+ this.generatedCodeColumn = 0;
410
+ }
411
+ this.generatedCodeColumn += lines[lines.length - 1].length;
412
+ }
413
+ };
414
+ var n = "\n";
415
+ var warned = {
416
+ insertLeft: false,
417
+ insertRight: false,
418
+ storeName: false
419
+ };
420
+ var MagicString = class _MagicString {
421
+ constructor(string, options = {}) {
422
+ const chunk = new Chunk(0, string.length, string);
423
+ Object.defineProperties(this, {
424
+ original: { writable: true, value: string },
425
+ outro: { writable: true, value: "" },
426
+ intro: { writable: true, value: "" },
427
+ firstChunk: { writable: true, value: chunk },
428
+ lastChunk: { writable: true, value: chunk },
429
+ lastSearchedChunk: { writable: true, value: chunk },
430
+ byStart: { writable: true, value: {} },
431
+ byEnd: { writable: true, value: {} },
432
+ filename: { writable: true, value: options.filename },
433
+ indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
434
+ sourcemapLocations: { writable: true, value: new BitSet() },
435
+ storedNames: { writable: true, value: {} },
436
+ indentStr: { writable: true, value: void 0 },
437
+ ignoreList: { writable: true, value: options.ignoreList }
438
+ });
439
+ this.byStart[0] = chunk;
440
+ this.byEnd[string.length] = chunk;
441
+ }
442
+ addSourcemapLocation(char) {
443
+ this.sourcemapLocations.add(char);
444
+ }
445
+ append(content) {
446
+ if (typeof content !== "string") throw new TypeError("outro content must be a string");
447
+ this.outro += content;
448
+ return this;
449
+ }
450
+ appendLeft(index, content) {
451
+ if (typeof content !== "string") throw new TypeError("inserted content must be a string");
452
+ this._split(index);
453
+ const chunk = this.byEnd[index];
454
+ if (chunk) {
455
+ chunk.appendLeft(content);
456
+ } else {
457
+ this.intro += content;
458
+ }
459
+ return this;
460
+ }
461
+ appendRight(index, content) {
462
+ if (typeof content !== "string") throw new TypeError("inserted content must be a string");
463
+ this._split(index);
464
+ const chunk = this.byStart[index];
465
+ if (chunk) {
466
+ chunk.appendRight(content);
467
+ } else {
468
+ this.outro += content;
469
+ }
470
+ return this;
471
+ }
472
+ clone() {
473
+ const cloned = new _MagicString(this.original, { filename: this.filename });
474
+ let originalChunk = this.firstChunk;
475
+ let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
476
+ while (originalChunk) {
477
+ cloned.byStart[clonedChunk.start] = clonedChunk;
478
+ cloned.byEnd[clonedChunk.end] = clonedChunk;
479
+ const nextOriginalChunk = originalChunk.next;
480
+ const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
481
+ if (nextClonedChunk) {
482
+ clonedChunk.next = nextClonedChunk;
483
+ nextClonedChunk.previous = clonedChunk;
484
+ clonedChunk = nextClonedChunk;
485
+ }
486
+ originalChunk = nextOriginalChunk;
487
+ }
488
+ cloned.lastChunk = clonedChunk;
489
+ if (this.indentExclusionRanges) {
490
+ cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
491
+ }
492
+ cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
493
+ cloned.intro = this.intro;
494
+ cloned.outro = this.outro;
495
+ return cloned;
496
+ }
497
+ generateDecodedMap(options) {
498
+ options = options || {};
499
+ const sourceIndex = 0;
500
+ const names = Object.keys(this.storedNames);
501
+ const mappings = new Mappings(options.hires);
502
+ const locate = getLocator(this.original);
503
+ if (this.intro) {
504
+ mappings.advance(this.intro);
505
+ }
506
+ this.firstChunk.eachNext((chunk) => {
507
+ const loc = locate(chunk.start);
508
+ if (chunk.intro.length) mappings.advance(chunk.intro);
509
+ if (chunk.edited) {
510
+ mappings.addEdit(
511
+ sourceIndex,
512
+ chunk.content,
513
+ loc,
514
+ chunk.storeName ? names.indexOf(chunk.original) : -1
515
+ );
516
+ } else {
517
+ mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
518
+ }
519
+ if (chunk.outro.length) mappings.advance(chunk.outro);
520
+ });
521
+ return {
522
+ file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
523
+ sources: [
524
+ options.source ? getRelativePath(options.file || "", options.source) : options.file || ""
525
+ ],
526
+ sourcesContent: options.includeContent ? [this.original] : void 0,
527
+ names,
528
+ mappings: mappings.raw,
529
+ x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0
530
+ };
531
+ }
532
+ generateMap(options) {
533
+ return new SourceMap(this.generateDecodedMap(options));
534
+ }
535
+ _ensureindentStr() {
536
+ if (this.indentStr === void 0) {
537
+ this.indentStr = guessIndent(this.original);
538
+ }
539
+ }
540
+ _getRawIndentString() {
541
+ this._ensureindentStr();
542
+ return this.indentStr;
543
+ }
544
+ getIndentString() {
545
+ this._ensureindentStr();
546
+ return this.indentStr === null ? " " : this.indentStr;
547
+ }
548
+ indent(indentStr, options) {
549
+ const pattern = /^[^\r\n]/gm;
550
+ if (isObject(indentStr)) {
551
+ options = indentStr;
552
+ indentStr = void 0;
553
+ }
554
+ if (indentStr === void 0) {
555
+ this._ensureindentStr();
556
+ indentStr = this.indentStr || " ";
557
+ }
558
+ if (indentStr === "") return this;
559
+ options = options || {};
560
+ const isExcluded = {};
561
+ if (options.exclude) {
562
+ const exclusions = typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude;
563
+ exclusions.forEach((exclusion) => {
564
+ for (let i = exclusion[0]; i < exclusion[1]; i += 1) {
565
+ isExcluded[i] = true;
566
+ }
567
+ });
568
+ }
569
+ let shouldIndentNextCharacter = options.indentStart !== false;
570
+ const replacer = (match) => {
571
+ if (shouldIndentNextCharacter) return `${indentStr}${match}`;
572
+ shouldIndentNextCharacter = true;
573
+ return match;
574
+ };
575
+ this.intro = this.intro.replace(pattern, replacer);
576
+ let charIndex = 0;
577
+ let chunk = this.firstChunk;
578
+ while (chunk) {
579
+ const end = chunk.end;
580
+ if (chunk.edited) {
581
+ if (!isExcluded[charIndex]) {
582
+ chunk.content = chunk.content.replace(pattern, replacer);
583
+ if (chunk.content.length) {
584
+ shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
585
+ }
586
+ }
587
+ } else {
588
+ charIndex = chunk.start;
589
+ while (charIndex < end) {
590
+ if (!isExcluded[charIndex]) {
591
+ const char = this.original[charIndex];
592
+ if (char === "\n") {
593
+ shouldIndentNextCharacter = true;
594
+ } else if (char !== "\r" && shouldIndentNextCharacter) {
595
+ shouldIndentNextCharacter = false;
596
+ if (charIndex === chunk.start) {
597
+ chunk.prependRight(indentStr);
598
+ } else {
599
+ this._splitChunk(chunk, charIndex);
600
+ chunk = chunk.next;
601
+ chunk.prependRight(indentStr);
602
+ }
603
+ }
604
+ }
605
+ charIndex += 1;
606
+ }
607
+ }
608
+ charIndex = chunk.end;
609
+ chunk = chunk.next;
610
+ }
611
+ this.outro = this.outro.replace(pattern, replacer);
612
+ return this;
613
+ }
614
+ insert() {
615
+ throw new Error(
616
+ "magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)"
617
+ );
618
+ }
619
+ insertLeft(index, content) {
620
+ if (!warned.insertLeft) {
621
+ console.warn(
622
+ "magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
623
+ );
624
+ warned.insertLeft = true;
625
+ }
626
+ return this.appendLeft(index, content);
627
+ }
628
+ insertRight(index, content) {
629
+ if (!warned.insertRight) {
630
+ console.warn(
631
+ "magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
632
+ );
633
+ warned.insertRight = true;
634
+ }
635
+ return this.prependRight(index, content);
636
+ }
637
+ move(start, end, index) {
638
+ if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself");
639
+ this._split(start);
640
+ this._split(end);
641
+ this._split(index);
642
+ const first = this.byStart[start];
643
+ const last = this.byEnd[end];
644
+ const oldLeft = first.previous;
645
+ const oldRight = last.next;
646
+ const newRight = this.byStart[index];
647
+ if (!newRight && last === this.lastChunk) return this;
648
+ const newLeft = newRight ? newRight.previous : this.lastChunk;
649
+ if (oldLeft) oldLeft.next = oldRight;
650
+ if (oldRight) oldRight.previous = oldLeft;
651
+ if (newLeft) newLeft.next = first;
652
+ if (newRight) newRight.previous = last;
653
+ if (!first.previous) this.firstChunk = last.next;
654
+ if (!last.next) {
655
+ this.lastChunk = first.previous;
656
+ this.lastChunk.next = null;
657
+ }
658
+ first.previous = newLeft;
659
+ last.next = newRight || null;
660
+ if (!newLeft) this.firstChunk = first;
661
+ if (!newRight) this.lastChunk = last;
662
+ return this;
663
+ }
664
+ overwrite(start, end, content, options) {
665
+ options = options || {};
666
+ return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
667
+ }
668
+ update(start, end, content, options) {
669
+ if (typeof content !== "string") throw new TypeError("replacement content must be a string");
670
+ if (this.original.length !== 0) {
671
+ while (start < 0) start += this.original.length;
672
+ while (end < 0) end += this.original.length;
673
+ }
674
+ if (end > this.original.length) throw new Error("end is out of bounds");
675
+ if (start === end)
676
+ throw new Error(
677
+ "Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead"
678
+ );
679
+ this._split(start);
680
+ this._split(end);
681
+ if (options === true) {
682
+ if (!warned.storeName) {
683
+ console.warn(
684
+ "The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
685
+ );
686
+ warned.storeName = true;
687
+ }
688
+ options = { storeName: true };
689
+ }
690
+ const storeName = options !== void 0 ? options.storeName : false;
691
+ const overwrite = options !== void 0 ? options.overwrite : false;
692
+ if (storeName) {
693
+ const original = this.original.slice(start, end);
694
+ Object.defineProperty(this.storedNames, original, {
695
+ writable: true,
696
+ value: true,
697
+ enumerable: true
698
+ });
699
+ }
700
+ const first = this.byStart[start];
701
+ const last = this.byEnd[end];
702
+ if (first) {
703
+ let chunk = first;
704
+ while (chunk !== last) {
705
+ if (chunk.next !== this.byStart[chunk.end]) {
706
+ throw new Error("Cannot overwrite across a split point");
707
+ }
708
+ chunk = chunk.next;
709
+ chunk.edit("", false);
710
+ }
711
+ first.edit(content, storeName, !overwrite);
712
+ } else {
713
+ const newChunk = new Chunk(start, end, "").edit(content, storeName);
714
+ last.next = newChunk;
715
+ newChunk.previous = last;
716
+ }
717
+ return this;
718
+ }
719
+ prepend(content) {
720
+ if (typeof content !== "string") throw new TypeError("outro content must be a string");
721
+ this.intro = content + this.intro;
722
+ return this;
723
+ }
724
+ prependLeft(index, content) {
725
+ if (typeof content !== "string") throw new TypeError("inserted content must be a string");
726
+ this._split(index);
727
+ const chunk = this.byEnd[index];
728
+ if (chunk) {
729
+ chunk.prependLeft(content);
730
+ } else {
731
+ this.intro = content + this.intro;
732
+ }
733
+ return this;
734
+ }
735
+ prependRight(index, content) {
736
+ if (typeof content !== "string") throw new TypeError("inserted content must be a string");
737
+ this._split(index);
738
+ const chunk = this.byStart[index];
739
+ if (chunk) {
740
+ chunk.prependRight(content);
741
+ } else {
742
+ this.outro = content + this.outro;
743
+ }
744
+ return this;
745
+ }
746
+ remove(start, end) {
747
+ if (this.original.length !== 0) {
748
+ while (start < 0) start += this.original.length;
749
+ while (end < 0) end += this.original.length;
750
+ }
751
+ if (start === end) return this;
752
+ if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
753
+ if (start > end) throw new Error("end must be greater than start");
754
+ this._split(start);
755
+ this._split(end);
756
+ let chunk = this.byStart[start];
757
+ while (chunk) {
758
+ chunk.intro = "";
759
+ chunk.outro = "";
760
+ chunk.edit("");
761
+ chunk = end > chunk.end ? this.byStart[chunk.end] : null;
762
+ }
763
+ return this;
764
+ }
765
+ reset(start, end) {
766
+ if (this.original.length !== 0) {
767
+ while (start < 0) start += this.original.length;
768
+ while (end < 0) end += this.original.length;
769
+ }
770
+ if (start === end) return this;
771
+ if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
772
+ if (start > end) throw new Error("end must be greater than start");
773
+ this._split(start);
774
+ this._split(end);
775
+ let chunk = this.byStart[start];
776
+ while (chunk) {
777
+ chunk.reset();
778
+ chunk = end > chunk.end ? this.byStart[chunk.end] : null;
779
+ }
780
+ return this;
781
+ }
782
+ lastChar() {
783
+ if (this.outro.length) return this.outro[this.outro.length - 1];
784
+ let chunk = this.lastChunk;
785
+ do {
786
+ if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
787
+ if (chunk.content.length) return chunk.content[chunk.content.length - 1];
788
+ if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
789
+ } while (chunk = chunk.previous);
790
+ if (this.intro.length) return this.intro[this.intro.length - 1];
791
+ return "";
792
+ }
793
+ lastLine() {
794
+ let lineIndex = this.outro.lastIndexOf(n);
795
+ if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
796
+ let lineStr = this.outro;
797
+ let chunk = this.lastChunk;
798
+ do {
799
+ if (chunk.outro.length > 0) {
800
+ lineIndex = chunk.outro.lastIndexOf(n);
801
+ if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
802
+ lineStr = chunk.outro + lineStr;
803
+ }
804
+ if (chunk.content.length > 0) {
805
+ lineIndex = chunk.content.lastIndexOf(n);
806
+ if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
807
+ lineStr = chunk.content + lineStr;
808
+ }
809
+ if (chunk.intro.length > 0) {
810
+ lineIndex = chunk.intro.lastIndexOf(n);
811
+ if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
812
+ lineStr = chunk.intro + lineStr;
813
+ }
814
+ } while (chunk = chunk.previous);
815
+ lineIndex = this.intro.lastIndexOf(n);
816
+ if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
817
+ return this.intro + lineStr;
818
+ }
819
+ slice(start = 0, end = this.original.length) {
820
+ if (this.original.length !== 0) {
821
+ while (start < 0) start += this.original.length;
822
+ while (end < 0) end += this.original.length;
823
+ }
824
+ let result = "";
825
+ let chunk = this.firstChunk;
826
+ while (chunk && (chunk.start > start || chunk.end <= start)) {
827
+ if (chunk.start < end && chunk.end >= end) {
828
+ return result;
829
+ }
830
+ chunk = chunk.next;
831
+ }
832
+ if (chunk && chunk.edited && chunk.start !== start)
833
+ throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
834
+ const startChunk = chunk;
835
+ while (chunk) {
836
+ if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
837
+ result += chunk.intro;
838
+ }
839
+ const containsEnd = chunk.start < end && chunk.end >= end;
840
+ if (containsEnd && chunk.edited && chunk.end !== end)
841
+ throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
842
+ const sliceStart = startChunk === chunk ? start - chunk.start : 0;
843
+ const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
844
+ result += chunk.content.slice(sliceStart, sliceEnd);
845
+ if (chunk.outro && (!containsEnd || chunk.end === end)) {
846
+ result += chunk.outro;
847
+ }
848
+ if (containsEnd) {
849
+ break;
850
+ }
851
+ chunk = chunk.next;
852
+ }
853
+ return result;
854
+ }
855
+ // TODO deprecate this? not really very useful
856
+ snip(start, end) {
857
+ const clone = this.clone();
858
+ clone.remove(0, start);
859
+ clone.remove(end, clone.original.length);
860
+ return clone;
861
+ }
862
+ _split(index) {
863
+ if (this.byStart[index] || this.byEnd[index]) return;
864
+ let chunk = this.lastSearchedChunk;
865
+ const searchForward = index > chunk.end;
866
+ while (chunk) {
867
+ if (chunk.contains(index)) return this._splitChunk(chunk, index);
868
+ chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
869
+ }
870
+ }
871
+ _splitChunk(chunk, index) {
872
+ if (chunk.edited && chunk.content.length) {
873
+ const loc = getLocator(this.original)(index);
874
+ throw new Error(
875
+ `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} \u2013 "${chunk.original}")`
876
+ );
877
+ }
878
+ const newChunk = chunk.split(index);
879
+ this.byEnd[index] = chunk;
880
+ this.byStart[index] = newChunk;
881
+ this.byEnd[newChunk.end] = newChunk;
882
+ if (chunk === this.lastChunk) this.lastChunk = newChunk;
883
+ this.lastSearchedChunk = chunk;
884
+ return true;
885
+ }
886
+ toString() {
887
+ let str = this.intro;
888
+ let chunk = this.firstChunk;
889
+ while (chunk) {
890
+ str += chunk.toString();
891
+ chunk = chunk.next;
892
+ }
893
+ return str + this.outro;
894
+ }
895
+ isEmpty() {
896
+ let chunk = this.firstChunk;
897
+ do {
898
+ if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim())
899
+ return false;
900
+ } while (chunk = chunk.next);
901
+ return true;
902
+ }
903
+ length() {
904
+ let chunk = this.firstChunk;
905
+ let length = 0;
906
+ do {
907
+ length += chunk.intro.length + chunk.content.length + chunk.outro.length;
908
+ } while (chunk = chunk.next);
909
+ return length;
910
+ }
911
+ trimLines() {
912
+ return this.trim("[\\r\\n]");
913
+ }
914
+ trim(charType) {
915
+ return this.trimStart(charType).trimEnd(charType);
916
+ }
917
+ trimEndAborted(charType) {
918
+ const rx = new RegExp((charType || "\\s") + "+$");
919
+ this.outro = this.outro.replace(rx, "");
920
+ if (this.outro.length) return true;
921
+ let chunk = this.lastChunk;
922
+ do {
923
+ const end = chunk.end;
924
+ const aborted = chunk.trimEnd(rx);
925
+ if (chunk.end !== end) {
926
+ if (this.lastChunk === chunk) {
927
+ this.lastChunk = chunk.next;
928
+ }
929
+ this.byEnd[chunk.end] = chunk;
930
+ this.byStart[chunk.next.start] = chunk.next;
931
+ this.byEnd[chunk.next.end] = chunk.next;
932
+ }
933
+ if (aborted) return true;
934
+ chunk = chunk.previous;
935
+ } while (chunk);
936
+ return false;
937
+ }
938
+ trimEnd(charType) {
939
+ this.trimEndAborted(charType);
940
+ return this;
941
+ }
942
+ trimStartAborted(charType) {
943
+ const rx = new RegExp("^" + (charType || "\\s") + "+");
944
+ this.intro = this.intro.replace(rx, "");
945
+ if (this.intro.length) return true;
946
+ let chunk = this.firstChunk;
947
+ do {
948
+ const end = chunk.end;
949
+ const aborted = chunk.trimStart(rx);
950
+ if (chunk.end !== end) {
951
+ if (chunk === this.lastChunk) this.lastChunk = chunk.next;
952
+ this.byEnd[chunk.end] = chunk;
953
+ this.byStart[chunk.next.start] = chunk.next;
954
+ this.byEnd[chunk.next.end] = chunk.next;
955
+ }
956
+ if (aborted) return true;
957
+ chunk = chunk.next;
958
+ } while (chunk);
959
+ return false;
960
+ }
961
+ trimStart(charType) {
962
+ this.trimStartAborted(charType);
963
+ return this;
964
+ }
965
+ hasChanged() {
966
+ return this.original !== this.toString();
967
+ }
968
+ _replaceRegexp(searchValue, replacement) {
969
+ function getReplacement(match, str) {
970
+ if (typeof replacement === "string") {
971
+ return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
972
+ if (i === "$") return "$";
973
+ if (i === "&") return match[0];
974
+ const num = +i;
975
+ if (num < match.length) return match[+i];
976
+ return `$${i}`;
977
+ });
978
+ } else {
979
+ return replacement(...match, match.index, str, match.groups);
980
+ }
981
+ }
982
+ function matchAll(re, str) {
983
+ let match;
984
+ const matches = [];
985
+ while (match = re.exec(str)) {
986
+ matches.push(match);
987
+ }
988
+ return matches;
989
+ }
990
+ if (searchValue.global) {
991
+ const matches = matchAll(searchValue, this.original);
992
+ matches.forEach((match) => {
993
+ if (match.index != null) {
994
+ const replacement2 = getReplacement(match, this.original);
995
+ if (replacement2 !== match[0]) {
996
+ this.overwrite(
997
+ match.index,
998
+ match.index + match[0].length,
999
+ replacement2
1000
+ );
1001
+ }
1002
+ }
1003
+ });
1004
+ } else {
1005
+ const match = this.original.match(searchValue);
1006
+ if (match && match.index != null) {
1007
+ const replacement2 = getReplacement(match, this.original);
1008
+ if (replacement2 !== match[0]) {
1009
+ this.overwrite(
1010
+ match.index,
1011
+ match.index + match[0].length,
1012
+ replacement2
1013
+ );
1014
+ }
1015
+ }
1016
+ }
1017
+ return this;
1018
+ }
1019
+ _replaceString(string, replacement) {
1020
+ const { original } = this;
1021
+ const index = original.indexOf(string);
1022
+ if (index !== -1) {
1023
+ this.overwrite(index, index + string.length, replacement);
1024
+ }
1025
+ return this;
1026
+ }
1027
+ replace(searchValue, replacement) {
1028
+ if (typeof searchValue === "string") {
1029
+ return this._replaceString(searchValue, replacement);
1030
+ }
1031
+ return this._replaceRegexp(searchValue, replacement);
1032
+ }
1033
+ _replaceAllString(string, replacement) {
1034
+ const { original } = this;
1035
+ const stringLength = string.length;
1036
+ for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
1037
+ const previous = original.slice(index, index + stringLength);
1038
+ if (previous !== replacement)
1039
+ this.overwrite(index, index + stringLength, replacement);
1040
+ }
1041
+ return this;
1042
+ }
1043
+ replaceAll(searchValue, replacement) {
1044
+ if (typeof searchValue === "string") {
1045
+ return this._replaceAllString(searchValue, replacement);
1046
+ }
1047
+ if (!searchValue.global) {
1048
+ throw new TypeError(
1049
+ "MagicString.prototype.replaceAll called with a non-global RegExp argument"
1050
+ );
1051
+ }
1052
+ return this._replaceRegexp(searchValue, replacement);
1053
+ }
1054
+ };
1055
+ var hasOwnProp = Object.prototype.hasOwnProperty;
1056
+ var Bundle = class _Bundle {
1057
+ constructor(options = {}) {
1058
+ this.intro = options.intro || "";
1059
+ this.separator = options.separator !== void 0 ? options.separator : "\n";
1060
+ this.sources = [];
1061
+ this.uniqueSources = [];
1062
+ this.uniqueSourceIndexByFilename = {};
1063
+ }
1064
+ addSource(source) {
1065
+ if (source instanceof MagicString) {
1066
+ return this.addSource({
1067
+ content: source,
1068
+ filename: source.filename,
1069
+ separator: this.separator
1070
+ });
1071
+ }
1072
+ if (!isObject(source) || !source.content) {
1073
+ throw new Error(
1074
+ "bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`"
1075
+ );
1076
+ }
1077
+ ["filename", "ignoreList", "indentExclusionRanges", "separator"].forEach((option) => {
1078
+ if (!hasOwnProp.call(source, option)) source[option] = source.content[option];
1079
+ });
1080
+ if (source.separator === void 0) {
1081
+ source.separator = this.separator;
1082
+ }
1083
+ if (source.filename) {
1084
+ if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {
1085
+ this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;
1086
+ this.uniqueSources.push({ filename: source.filename, content: source.content.original });
1087
+ } else {
1088
+ const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];
1089
+ if (source.content.original !== uniqueSource.content) {
1090
+ throw new Error(`Illegal source: same filename (${source.filename}), different contents`);
1091
+ }
1092
+ }
1093
+ }
1094
+ this.sources.push(source);
1095
+ return this;
1096
+ }
1097
+ append(str, options) {
1098
+ this.addSource({
1099
+ content: new MagicString(str),
1100
+ separator: options && options.separator || ""
1101
+ });
1102
+ return this;
1103
+ }
1104
+ clone() {
1105
+ const bundle = new _Bundle({
1106
+ intro: this.intro,
1107
+ separator: this.separator
1108
+ });
1109
+ this.sources.forEach((source) => {
1110
+ bundle.addSource({
1111
+ filename: source.filename,
1112
+ content: source.content.clone(),
1113
+ separator: source.separator
1114
+ });
1115
+ });
1116
+ return bundle;
1117
+ }
1118
+ generateDecodedMap(options = {}) {
1119
+ const names = [];
1120
+ let x_google_ignoreList = void 0;
1121
+ this.sources.forEach((source) => {
1122
+ Object.keys(source.content.storedNames).forEach((name) => {
1123
+ if (!~names.indexOf(name)) names.push(name);
1124
+ });
1125
+ });
1126
+ const mappings = new Mappings(options.hires);
1127
+ if (this.intro) {
1128
+ mappings.advance(this.intro);
1129
+ }
1130
+ this.sources.forEach((source, i) => {
1131
+ if (i > 0) {
1132
+ mappings.advance(this.separator);
1133
+ }
1134
+ const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;
1135
+ const magicString = source.content;
1136
+ const locate = getLocator(magicString.original);
1137
+ if (magicString.intro) {
1138
+ mappings.advance(magicString.intro);
1139
+ }
1140
+ magicString.firstChunk.eachNext((chunk) => {
1141
+ const loc = locate(chunk.start);
1142
+ if (chunk.intro.length) mappings.advance(chunk.intro);
1143
+ if (source.filename) {
1144
+ if (chunk.edited) {
1145
+ mappings.addEdit(
1146
+ sourceIndex,
1147
+ chunk.content,
1148
+ loc,
1149
+ chunk.storeName ? names.indexOf(chunk.original) : -1
1150
+ );
1151
+ } else {
1152
+ mappings.addUneditedChunk(
1153
+ sourceIndex,
1154
+ chunk,
1155
+ magicString.original,
1156
+ loc,
1157
+ magicString.sourcemapLocations
1158
+ );
1159
+ }
1160
+ } else {
1161
+ mappings.advance(chunk.content);
1162
+ }
1163
+ if (chunk.outro.length) mappings.advance(chunk.outro);
1164
+ });
1165
+ if (magicString.outro) {
1166
+ mappings.advance(magicString.outro);
1167
+ }
1168
+ if (source.ignoreList && sourceIndex !== -1) {
1169
+ if (x_google_ignoreList === void 0) {
1170
+ x_google_ignoreList = [];
1171
+ }
1172
+ x_google_ignoreList.push(sourceIndex);
1173
+ }
1174
+ });
1175
+ return {
1176
+ file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
1177
+ sources: this.uniqueSources.map((source) => {
1178
+ return options.file ? getRelativePath(options.file, source.filename) : source.filename;
1179
+ }),
1180
+ sourcesContent: this.uniqueSources.map((source) => {
1181
+ return options.includeContent ? source.content : null;
1182
+ }),
1183
+ names,
1184
+ mappings: mappings.raw,
1185
+ x_google_ignoreList
1186
+ };
1187
+ }
1188
+ generateMap(options) {
1189
+ return new SourceMap(this.generateDecodedMap(options));
1190
+ }
1191
+ getIndentString() {
1192
+ const indentStringCounts = {};
1193
+ this.sources.forEach((source) => {
1194
+ const indentStr = source.content._getRawIndentString();
1195
+ if (indentStr === null) return;
1196
+ if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;
1197
+ indentStringCounts[indentStr] += 1;
1198
+ });
1199
+ return Object.keys(indentStringCounts).sort((a, b) => {
1200
+ return indentStringCounts[a] - indentStringCounts[b];
1201
+ })[0] || " ";
1202
+ }
1203
+ indent(indentStr) {
1204
+ if (!arguments.length) {
1205
+ indentStr = this.getIndentString();
1206
+ }
1207
+ if (indentStr === "") return this;
1208
+ let trailingNewline = !this.intro || this.intro.slice(-1) === "\n";
1209
+ this.sources.forEach((source, i) => {
1210
+ const separator = source.separator !== void 0 ? source.separator : this.separator;
1211
+ const indentStart = trailingNewline || i > 0 && /\r?\n$/.test(separator);
1212
+ source.content.indent(indentStr, {
1213
+ exclude: source.indentExclusionRanges,
1214
+ indentStart
1215
+ //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator )
1216
+ });
1217
+ trailingNewline = source.content.lastChar() === "\n";
1218
+ });
1219
+ if (this.intro) {
1220
+ this.intro = indentStr + this.intro.replace(/^[^\n]/gm, (match, index) => {
1221
+ return index > 0 ? indentStr + match : match;
1222
+ });
1223
+ }
1224
+ return this;
1225
+ }
1226
+ prepend(str) {
1227
+ this.intro = str + this.intro;
1228
+ return this;
1229
+ }
1230
+ toString() {
1231
+ const body = this.sources.map((source, i) => {
1232
+ const separator = source.separator !== void 0 ? source.separator : this.separator;
1233
+ const str = (i > 0 ? separator : "") + source.content.toString();
1234
+ return str;
1235
+ }).join("");
1236
+ return this.intro + body;
1237
+ }
1238
+ isEmpty() {
1239
+ if (this.intro.length && this.intro.trim()) return false;
1240
+ if (this.sources.some((source) => !source.content.isEmpty())) return false;
1241
+ return true;
1242
+ }
1243
+ length() {
1244
+ return this.sources.reduce(
1245
+ (length, source) => length + source.content.length(),
1246
+ this.intro.length
1247
+ );
1248
+ }
1249
+ trimLines() {
1250
+ return this.trim("[\\r\\n]");
1251
+ }
1252
+ trim(charType) {
1253
+ return this.trimStart(charType).trimEnd(charType);
1254
+ }
1255
+ trimStart(charType) {
1256
+ const rx = new RegExp("^" + (charType || "\\s") + "+");
1257
+ this.intro = this.intro.replace(rx, "");
1258
+ if (!this.intro) {
1259
+ let source;
1260
+ let i = 0;
1261
+ do {
1262
+ source = this.sources[i++];
1263
+ if (!source) {
1264
+ break;
1265
+ }
1266
+ } while (!source.content.trimStartAborted(charType));
1267
+ }
1268
+ return this;
1269
+ }
1270
+ trimEnd(charType) {
1271
+ const rx = new RegExp((charType || "\\s") + "+$");
1272
+ let source;
1273
+ let i = this.sources.length - 1;
1274
+ do {
1275
+ source = this.sources[i--];
1276
+ if (!source) {
1277
+ this.intro = this.intro.replace(rx, "");
1278
+ break;
1279
+ }
1280
+ } while (!source.content.trimEndAborted(charType));
1281
+ return this;
1282
+ }
1283
+ };
1284
+
1285
+
1286
+
1287
+
1288
+ exports.Bundle = Bundle; exports.SourceMap = SourceMap; exports.default = MagicString;