sandforge 1.85.0 → 1.86.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 (274) hide show
  1. package/README.md +1 -1
  2. package/lib/{chunk-THYQOG24.mjs → chunk-22L43JMK.mjs} +1 -1
  3. package/lib/{chunk-U4S27YRP.mjs → chunk-2LSGWTWX.mjs} +1 -1
  4. package/lib/{chunk-MRN72UEO.mjs → chunk-2YJJTQNC.mjs} +1 -1
  5. package/lib/chunk-34SMB5PA.mjs +10 -0
  6. package/lib/chunk-35B73566.mjs +7 -0
  7. package/lib/{chunk-YZKE6D3K.mjs → chunk-35IJ4WEU.mjs} +1 -1
  8. package/lib/chunk-3EHPAFKV.mjs +7 -0
  9. package/lib/{chunk-3OKDWZ32.mjs → chunk-3HAVVEXF.mjs} +1 -1
  10. package/lib/{chunk-32ZB5ICW.mjs → chunk-3I6FXFCN.mjs} +1 -1
  11. package/lib/{chunk-JFVY66BS.mjs → chunk-3KJCSYXY.mjs} +1 -1
  12. package/lib/{chunk-ULEYGOZU.mjs → chunk-3L6DVNCR.mjs} +1 -1
  13. package/lib/chunk-3LRFPGYZ.mjs +7 -0
  14. package/lib/{chunk-GHUA6OQQ.mjs → chunk-3MVWGL5A.mjs} +1 -1
  15. package/lib/{chunk-SF52ZSIV.mjs → chunk-4CSBZZAL.mjs} +1 -1
  16. package/lib/{chunk-FBYFCKPG.mjs → chunk-4NSXPONF.mjs} +1 -1
  17. package/lib/{chunk-A3QNSALB.mjs → chunk-4VLP6RHC.mjs} +1 -1
  18. package/lib/{chunk-TWYNQ2OO.mjs → chunk-4XROG5CT.mjs} +1 -1
  19. package/lib/chunk-54V4FVEY.mjs +7 -0
  20. package/lib/chunk-55OJJT2Q.mjs +7 -0
  21. package/lib/{chunk-JRI6A24G.mjs → chunk-5EHHQ5UX.mjs} +1 -1
  22. package/lib/{chunk-VPGX5Z5D.mjs → chunk-5JMQXHJ2.mjs} +1 -1
  23. package/lib/{chunk-CI2O7WBH.mjs → chunk-65AMXOQU.mjs} +1 -1
  24. package/lib/{chunk-5T3LFDJ5.mjs → chunk-6HHSAPIM.mjs} +1 -1
  25. package/lib/chunk-6KVBCFVS.mjs +7 -0
  26. package/lib/chunk-6NG7C2U3.mjs +476 -0
  27. package/lib/{chunk-F2424IKX.mjs → chunk-6ROL3KBM.mjs} +1 -1
  28. package/lib/{chunk-7ZYCRIHE.mjs → chunk-72AWCN7U.mjs} +1 -1
  29. package/lib/{chunk-MQLTEXB7.mjs → chunk-7KHA5UIQ.mjs} +1 -1
  30. package/lib/chunk-7O6EFNQS.mjs +10 -0
  31. package/lib/{chunk-73SLYGWD.mjs → chunk-A2CH2QGX.mjs} +1 -1
  32. package/lib/chunk-A2TXLAC3.mjs +276 -0
  33. package/lib/chunk-ALWVNR34.mjs +7 -0
  34. package/lib/{chunk-JBOGAUGH.mjs → chunk-ATBQIE2V.mjs} +1 -1
  35. package/lib/{chunk-C2MHMI7U.mjs → chunk-ATQML7ZK.mjs} +1 -1
  36. package/lib/chunk-AVY742BJ.mjs +7 -0
  37. package/lib/{chunk-VLAU5QQT.mjs → chunk-AXTB2HJS.mjs} +1 -1
  38. package/lib/chunk-BBZUGKBZ.mjs +10 -0
  39. package/lib/chunk-BIDXK7KA.mjs +7 -0
  40. package/lib/{chunk-KYLHS74X.mjs → chunk-BLMJ4WVI.mjs} +1 -1
  41. package/lib/{chunk-A7YP27GQ.mjs → chunk-BNHJCJJM.mjs} +1 -1
  42. package/lib/{chunk-ZDMSTL2L.mjs → chunk-BNPQEQXC.mjs} +1 -1
  43. package/lib/chunk-C5AUNG6T.mjs +37 -0
  44. package/lib/{chunk-LY6EPMIP.mjs → chunk-C5EQ7GFC.mjs} +1 -1
  45. package/lib/{chunk-LOO42EW5.mjs → chunk-C7CKDZMC.mjs} +62 -62
  46. package/lib/{chunk-ZP3WJGS3.mjs → chunk-CB4U22NR.mjs} +1 -1
  47. package/lib/chunk-CJAWKLAL.mjs +7 -0
  48. package/lib/chunk-CL75DEMQ.mjs +9 -0
  49. package/lib/{chunk-7L6FE5PP.mjs → chunk-CLUNF4FK.mjs} +1 -1
  50. package/lib/chunk-CSMGP53U.mjs +7 -0
  51. package/lib/{chunk-S6BMJSLD.mjs → chunk-CT324C7I.mjs} +1 -1
  52. package/lib/{chunk-YXOPKGDX.mjs → chunk-CZXDJXQP.mjs} +1 -1
  53. package/lib/{chunk-PGG4ULEW.mjs → chunk-D2X6U3MS.mjs} +1 -1
  54. package/lib/{chunk-FG4Y4ZVL.mjs → chunk-DAUX63UB.mjs} +1 -1
  55. package/lib/chunk-DB7JNALQ.mjs +10 -0
  56. package/lib/chunk-DDNCJVZ2.mjs +17 -0
  57. package/lib/{chunk-YGE4AUXG.mjs → chunk-DLSU66MY.mjs} +1 -1
  58. package/lib/{chunk-DCJBP3LE.mjs → chunk-DO6PSHQZ.mjs} +1 -1
  59. package/lib/{chunk-ROTDZKOE.mjs → chunk-DUBECLZV.mjs} +1 -1
  60. package/lib/{chunk-SES5HPBZ.mjs → chunk-DYHF6DNT.mjs} +1 -1
  61. package/lib/chunk-E5FSPXYH.mjs +930 -0
  62. package/lib/{chunk-QAXKUEJT.mjs → chunk-EGL3I3IX.mjs} +1 -1
  63. package/lib/chunk-EIYMQPMG.mjs +7 -0
  64. package/lib/{chunk-AX3YF7SC.mjs → chunk-EUIALBMX.mjs} +1 -1
  65. package/lib/{chunk-57QRXYAZ.mjs → chunk-FI3R5ZOQ.mjs} +1 -1
  66. package/lib/{chunk-FCZDWGQI.mjs → chunk-FM4QCTO7.mjs} +1 -1
  67. package/lib/{chunk-74HZ274R.mjs → chunk-FRSIEASH.mjs} +1 -1
  68. package/lib/{chunk-G6IYOZEH.mjs → chunk-FV6MOSHD.mjs} +1 -1
  69. package/lib/chunk-FYG47CNA.mjs +7 -0
  70. package/lib/chunk-GB6W4Q56.mjs +7 -0
  71. package/lib/chunk-GEV2DCMK.mjs +7 -0
  72. package/lib/{chunk-NZJXEULY.mjs → chunk-GFB2DNCB.mjs} +1 -1
  73. package/lib/chunk-GFGMGFSH.mjs +7 -0
  74. package/lib/{chunk-EFHDE7W4.mjs → chunk-GIFQXB2Q.mjs} +1 -1
  75. package/lib/{chunk-P6A22FMQ.mjs → chunk-GP5J3DGS.mjs} +1 -1
  76. package/lib/chunk-GQZEX7LH.mjs +231 -0
  77. package/lib/{chunk-BRN42U26.mjs → chunk-GYDTM62J.mjs} +1 -1
  78. package/lib/{chunk-GNCEHAJY.mjs → chunk-GYFIXUJG.mjs} +1 -1
  79. package/lib/chunk-GZW2GNFK.mjs +7 -0
  80. package/lib/chunk-H6BHWAX7.mjs +8 -0
  81. package/lib/{chunk-GUYEXPJ4.mjs → chunk-HDDJ3CVN.mjs} +1 -1
  82. package/lib/{chunk-3GATEVHC.mjs → chunk-HDWB4ZOG.mjs} +1 -1
  83. package/lib/chunk-HGVPBJR6.mjs +7 -0
  84. package/lib/{chunk-55VBV2WK.mjs → chunk-HLROVOR6.mjs} +1 -1
  85. package/lib/{chunk-HV3TDLFR.mjs → chunk-HUOR4M2L.mjs} +1 -1
  86. package/lib/chunk-HZCS6EED.mjs +8 -0
  87. package/lib/{chunk-WZX6VCIT.mjs → chunk-HZUI56KZ.mjs} +1 -1
  88. package/lib/chunk-IAB5H7WN.mjs +7 -0
  89. package/lib/{chunk-RY7WUJXH.mjs → chunk-IQ5UKRHU.mjs} +1 -1
  90. package/lib/{chunk-OUWR5M5G.mjs → chunk-IRQ4WANV.mjs} +1 -1
  91. package/lib/{chunk-F44EHXLI.mjs → chunk-IT3DGX37.mjs} +1 -1
  92. package/lib/chunk-J347SPU6.mjs +49 -0
  93. package/lib/{chunk-IZ2M2RGO.mjs → chunk-JANBNTR5.mjs} +1 -1
  94. package/lib/chunk-JFXQZPRY.mjs +9 -0
  95. package/lib/{chunk-VKA5OZBJ.mjs → chunk-JRLYWVF4.mjs} +1 -1
  96. package/lib/{chunk-FM5ESRH6.mjs → chunk-JSNMUTY6.mjs} +1 -1
  97. package/lib/chunk-JTNJKSAA.mjs +7 -0
  98. package/lib/{chunk-4D6OHSX3.mjs → chunk-JV2LAKWQ.mjs} +1 -1
  99. package/lib/{chunk-BY42YL4D.mjs → chunk-JV7K2ZHK.mjs} +1 -1
  100. package/lib/{chunk-A6IJUOLB.mjs → chunk-K4TQ7YHX.mjs} +1 -1
  101. package/lib/chunk-K5PUMHZU.mjs +7 -0
  102. package/lib/chunk-KH4KLCYG.mjs +7 -0
  103. package/lib/{chunk-FZF6FB65.mjs → chunk-KQVLZVOP.mjs} +1 -1
  104. package/lib/chunk-KWUS7UAV.mjs +19 -0
  105. package/lib/{chunk-2UUSF32M.mjs → chunk-L6G73FXM.mjs} +1 -1
  106. package/lib/{chunk-LUNGNCM3.mjs → chunk-LG466Q5H.mjs} +1 -1
  107. package/lib/{chunk-YTBM3TSW.mjs → chunk-LHNAR6FC.mjs} +1 -1
  108. package/lib/chunk-LT4GHEI2.mjs +7 -0
  109. package/lib/{chunk-P3OYE2FS.mjs → chunk-MR262Y3B.mjs} +1 -1
  110. package/lib/{chunk-TSTCHIBU.mjs → chunk-NCCHOV2N.mjs} +1 -1
  111. package/lib/chunk-NICRSGLS.mjs +7 -0
  112. package/lib/chunk-NV5QA2HY.mjs +7 -0
  113. package/lib/{chunk-6HAKOS6W.mjs → chunk-O3GIN5TU.mjs} +1 -1
  114. package/lib/chunk-O6FHK6NQ.mjs +13 -0
  115. package/lib/{chunk-OXIIKAUZ.mjs → chunk-O7YIEFG7.mjs} +1 -1
  116. package/lib/chunk-OCUVAA5E.mjs +7 -0
  117. package/lib/chunk-OLCS7JCT.mjs +14 -0
  118. package/lib/chunk-ON7Y63FK.mjs +9 -0
  119. package/lib/{chunk-K2WOT75I.mjs → chunk-OO2WY3UB.mjs} +1 -1
  120. package/lib/{chunk-3EOIAC2M.mjs → chunk-OT2NHL2V.mjs} +1 -1
  121. package/lib/{chunk-BK5SRDAD.mjs → chunk-P2M5ZXWU.mjs} +1 -1
  122. package/lib/{chunk-DCZYWMSA.mjs → chunk-P4YOHLZ4.mjs} +1 -1
  123. package/lib/chunk-PBHDPTT6.mjs +343 -0
  124. package/lib/chunk-PE7CHD2W.mjs +7 -0
  125. package/lib/{chunk-LU7M5URW.mjs → chunk-PIQ2I67B.mjs} +1 -1
  126. package/lib/chunk-PKYDNZJK.mjs +7 -0
  127. package/lib/chunk-PVZ72OOQ.mjs +7 -0
  128. package/lib/chunk-QACFTHJM.mjs +8 -0
  129. package/lib/{chunk-LNAZHI3J.mjs → chunk-QGVL5EW3.mjs} +1 -1
  130. package/lib/chunk-QHE2RUWX.mjs +7 -0
  131. package/lib/{chunk-4RNP65FV.mjs → chunk-RCW5BZNW.mjs} +1 -1
  132. package/lib/{chunk-OTKXTBTX.mjs → chunk-RJ6HHG7J.mjs} +1 -1
  133. package/lib/{chunk-IVDBVWKK.mjs → chunk-RPTEEI4R.mjs} +1 -1
  134. package/lib/chunk-RQW5S67A.mjs +7 -0
  135. package/lib/chunk-RTCMYMED.mjs +7 -0
  136. package/lib/chunk-RWVX7XSD.mjs +7 -0
  137. package/lib/{chunk-2UUS4IGB.mjs → chunk-RZOINFNL.mjs} +1 -1
  138. package/lib/chunk-SOOTWGMQ.mjs +7 -0
  139. package/lib/chunk-STQ2JMIZ.mjs +7 -0
  140. package/lib/{chunk-RC25QQVF.mjs → chunk-SUIPDW5O.mjs} +1 -1
  141. package/lib/{chunk-Z354SAEF.mjs → chunk-SZOJ7BEJ.mjs} +1 -1
  142. package/lib/{chunk-45375WT5.mjs → chunk-T542Z54E.mjs} +1 -1
  143. package/lib/chunk-TAN2CIRI.mjs +21 -0
  144. package/lib/{chunk-BGJBYDRW.mjs → chunk-TCNBINOG.mjs} +1 -1
  145. package/lib/chunk-TFDF3DBN.mjs +7 -0
  146. package/lib/{chunk-B5A4JHNN.mjs → chunk-TICZXC53.mjs} +1 -1
  147. package/lib/chunk-TLX45X5U.mjs +7 -0
  148. package/lib/{chunk-W6SLQZKQ.mjs → chunk-TMIV3IWH.mjs} +1 -1
  149. package/lib/chunk-TQ6HEJ73.mjs +11 -0
  150. package/lib/chunk-TTU5EQZ6.mjs +7 -0
  151. package/lib/chunk-TYUYPFDJ.mjs +7 -0
  152. package/lib/chunk-TZXYVMZC.mjs +7 -0
  153. package/lib/{chunk-4N425UJC.mjs → chunk-UCUFLFNK.mjs} +1 -1
  154. package/lib/chunk-UK3QLBHW.mjs +7 -0
  155. package/lib/{chunk-SKGAERV4.mjs → chunk-UM2B4GR7.mjs} +1 -1
  156. package/lib/chunk-UZFTTNOP.mjs +7 -0
  157. package/lib/chunk-V3AXSKSU.mjs +7 -0
  158. package/lib/chunk-VA6EEI6X.mjs +21 -0
  159. package/lib/{chunk-LSEM2BZH.mjs → chunk-VFKG2G37.mjs} +1 -1
  160. package/lib/chunk-VJNEW5MQ.mjs +7 -0
  161. package/lib/{chunk-EYFP3NA6.mjs → chunk-VKREON6Q.mjs} +1 -1
  162. package/lib/{chunk-TIVI2KGB.mjs → chunk-VNNDYPBL.mjs} +1 -1
  163. package/lib/{chunk-J3FJ3BWE.mjs → chunk-VRBETPHY.mjs} +1 -1
  164. package/lib/{chunk-UX4AOSMU.mjs → chunk-VT6P3X6R.mjs} +1 -1
  165. package/lib/{chunk-CUOWQMGW.mjs → chunk-VUTQY76O.mjs} +1 -1
  166. package/lib/chunk-WF5S4FW5.mjs +7 -0
  167. package/lib/{chunk-JHJDDQDE.mjs → chunk-WJGK6VGU.mjs} +1 -1
  168. package/lib/{chunk-IZREPWYQ.mjs → chunk-WJHMB3SL.mjs} +1 -1
  169. package/lib/{chunk-XZRON54U.mjs → chunk-WQCXOZEJ.mjs} +1 -1
  170. package/lib/{chunk-N2MXYD67.mjs → chunk-WVVFR4E3.mjs} +1 -1
  171. package/lib/{chunk-GG5I52UT.mjs → chunk-XBYXT74L.mjs} +1 -1
  172. package/lib/chunk-XJE3LJHP.mjs +7 -0
  173. package/lib/{chunk-3QCUSZIZ.mjs → chunk-XV4CVZYD.mjs} +1 -1
  174. package/lib/chunk-Y37ED7AS.mjs +7 -0
  175. package/lib/{chunk-MN3XBJPE.mjs → chunk-YGBNZYT4.mjs} +1 -1
  176. package/lib/{chunk-SBDF4AE5.mjs → chunk-YGTOX7IL.mjs} +1 -1
  177. package/lib/{chunk-SQM32AOQ.mjs → chunk-YJ27WHKR.mjs} +1 -1
  178. package/lib/chunk-YRULC27A.mjs +7 -0
  179. package/lib/{chunk-RMFU4BAL.mjs → chunk-YSVAHT4Q.mjs} +4 -4
  180. package/lib/chunk-YTOTMJTY.mjs +15 -0
  181. package/lib/{chunk-SU24AE3H.mjs → chunk-YZKZC62O.mjs} +1 -1
  182. package/lib/{chunk-LJNRN7MY.mjs → chunk-YZQN7BRB.mjs} +1 -1
  183. package/lib/{chunk-NMF55UBQ.mjs → chunk-Z5IUK2QO.mjs} +1 -1
  184. package/lib/{chunk-6ZWY36LK.mjs → chunk-ZEGSMW5A.mjs} +1 -1
  185. package/lib/{chunk-YV7JYHJP.mjs → chunk-ZIKLQZBG.mjs} +1 -1
  186. package/lib/chunk-ZVU7MD2S.mjs +7 -0
  187. package/lib/sandforge-autopilot.mjs +33 -27
  188. package/lib/sandforge-backup.mjs +19 -19
  189. package/lib/sandforge-checkpoint.mjs +1 -1
  190. package/lib/sandforge-cleanup.mjs +1 -1
  191. package/lib/sandforge-clone.mjs +1 -1
  192. package/lib/sandforge-compare.mjs +29 -16
  193. package/lib/sandforge-dataops.mjs +1 -1
  194. package/lib/sandforge-empty.mjs +11 -13
  195. package/lib/sandforge-env.mjs +105 -105
  196. package/lib/sandforge-frozen.mjs +1 -1
  197. package/lib/sandforge-mcp.mjs +2 -2
  198. package/lib/sandforge-monitor.mjs +1 -1
  199. package/lib/sandforge-pipeline.mjs +13 -13
  200. package/lib/sandforge-seed.mjs +1 -1
  201. package/lib/sandforge-sync.mjs +1 -1
  202. package/lib/sandforge-users.mjs +13 -15
  203. package/lib/sandforge.mjs +1 -1
  204. package/lib/sf/sandforge/dataops.mjs +2 -2
  205. package/lib/sfPlugin.mjs +1 -1
  206. package/oclif.manifest.json +1 -1
  207. package/package.json +1 -1
  208. package/lib/chunk-26EGXYZ4.mjs +0 -21
  209. package/lib/chunk-2JRVBXJL.mjs +0 -7
  210. package/lib/chunk-2METQHGG.mjs +0 -7
  211. package/lib/chunk-3XU7CEJQ.mjs +0 -7
  212. package/lib/chunk-4BQPAVMP.mjs +0 -14
  213. package/lib/chunk-4KMKOE77.mjs +0 -156
  214. package/lib/chunk-4RPA7Z52.mjs +0 -7
  215. package/lib/chunk-5C7LQXYS.mjs +0 -7
  216. package/lib/chunk-5EESNYE3.mjs +0 -8
  217. package/lib/chunk-6ZW6BLV5.mjs +0 -7
  218. package/lib/chunk-AAOMUI7S.mjs +0 -15
  219. package/lib/chunk-AIUAEBHR.mjs +0 -7
  220. package/lib/chunk-BD724WOH.mjs +0 -7
  221. package/lib/chunk-CRPLDXJU.mjs +0 -48
  222. package/lib/chunk-CSSOLHE3.mjs +0 -7
  223. package/lib/chunk-D63HEQ3B.mjs +0 -7
  224. package/lib/chunk-DN7YBILC.mjs +0 -21
  225. package/lib/chunk-DNE7JI3A.mjs +0 -11
  226. package/lib/chunk-EFHM2U4D.mjs +0 -7
  227. package/lib/chunk-EINEGS6E.mjs +0 -7
  228. package/lib/chunk-EM5EFMHA.mjs +0 -272
  229. package/lib/chunk-FH5UR35W.mjs +0 -7
  230. package/lib/chunk-FN7TOBJR.mjs +0 -7
  231. package/lib/chunk-HGJFATSI.mjs +0 -10
  232. package/lib/chunk-HOEE3PE5.mjs +0 -7
  233. package/lib/chunk-HV63UGL5.mjs +0 -7
  234. package/lib/chunk-JKFCGYJE.mjs +0 -7
  235. package/lib/chunk-KATBU46O.mjs +0 -7
  236. package/lib/chunk-LD34JNCC.mjs +0 -7
  237. package/lib/chunk-LPN4WYTP.mjs +0 -478
  238. package/lib/chunk-MAOUFJ47.mjs +0 -7
  239. package/lib/chunk-MB2DG66I.mjs +0 -13
  240. package/lib/chunk-NCASRA7L.mjs +0 -9
  241. package/lib/chunk-NEKNAILD.mjs +0 -7
  242. package/lib/chunk-NN2IO4WE.mjs +0 -7
  243. package/lib/chunk-O3ZQSWDN.mjs +0 -10
  244. package/lib/chunk-OFQOKSEW.mjs +0 -7
  245. package/lib/chunk-PP7PJXRJ.mjs +0 -341
  246. package/lib/chunk-PT2E2HFD.mjs +0 -7
  247. package/lib/chunk-PZBZ7MNC.mjs +0 -7
  248. package/lib/chunk-QBYK5XIT.mjs +0 -8
  249. package/lib/chunk-RFD6NPWJ.mjs +0 -8
  250. package/lib/chunk-RIIJJRGF.mjs +0 -7
  251. package/lib/chunk-RKTFFCNS.mjs +0 -7
  252. package/lib/chunk-RM5G4IP6.mjs +0 -19
  253. package/lib/chunk-RTPNK7OB.mjs +0 -7
  254. package/lib/chunk-RZXEO5IE.mjs +0 -7
  255. package/lib/chunk-SAHGDSZQ.mjs +0 -37
  256. package/lib/chunk-SRPWW4A2.mjs +0 -10
  257. package/lib/chunk-SVNSAHG3.mjs +0 -7
  258. package/lib/chunk-T63U4OZJ.mjs +0 -7
  259. package/lib/chunk-TE2W76II.mjs +0 -10
  260. package/lib/chunk-TEIBWMJM.mjs +0 -7
  261. package/lib/chunk-TFGJDZFE.mjs +0 -7
  262. package/lib/chunk-TG52WNGV.mjs +0 -10
  263. package/lib/chunk-TQONVFI3.mjs +0 -7
  264. package/lib/chunk-TW3N6W5Z.mjs +0 -7
  265. package/lib/chunk-UZMLPKW6.mjs +0 -7
  266. package/lib/chunk-WB2RIVO3.mjs +0 -7
  267. package/lib/chunk-WQO7RXEB.mjs +0 -926
  268. package/lib/chunk-X3MBY2RX.mjs +0 -7
  269. package/lib/chunk-XMJRXXUN.mjs +0 -7
  270. package/lib/chunk-YNMU5I7P.mjs +0 -7
  271. package/lib/chunk-YSQJKIO6.mjs +0 -7
  272. package/lib/chunk-YVVPJRZC.mjs +0 -7
  273. package/lib/chunk-ZLQHBI6V.mjs +0 -9
  274. package/lib/chunk-ZRUDYB7O.mjs +0 -7
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{i as u,j as f}from"./chunk-CRPLDXJU.mjs";var p=1e4,g=150,m=200,l=class{build(o){let t=o.relations??[],c=j(o.objects,t),i=S(c),r=b(c),n=r*g,s=i>p;return{objects:c.map(a=>({objectApiName:a.objectApiName,recordCount:a.recordCount,sampleRecords:C(a,3,u(a.objectApiName,t)),dependsOn:f(a,t)})),totalRecords:i,estimatedApiCalls:r,estimatedDuration:n,grappeRecommended:s}}};function S(e){return e.reduce((o,t)=>o+t.recordCount,0)}function b(e){return e.reduce((o,t)=>{let c=t.batchSize>0?t.batchSize:m;return o+Math.ceil(t.recordCount/c)},0)}function C(e,o,t){let c=Math.min(o,e.recordCount),i=[];for(let r=0;r<c;r++){let n={};for(let d of e.fieldRules)n[d.fieldApiName]=R(d,r);let s=e.rows?.[r];s&&(Object.assign(n,s.values),t?.distribution.mode==="byKey"&&s.parentKey!==void 0&&(n[t.lookupField]=`[key:${s.parentKey}]`)),i.push(n)}return i}function R(e,o){switch(e.ruleType){case"static":return e.config.staticValue??null;case"sequence":{let t=e.config.sequenceStart??1,c=e.config.sequenceStep??1;return`${e.config.sequencePrefix??""}${t+o*c}`}case"picklist_random":return e.config.picklistValues&&e.config.picklistValues.length>0?e.config.picklistValues[o%e.config.picklistValues.length]:null;case"reference":return`[ref:${e.config.referenceObject??"unknown"}]`;case"faker":return`[faker:${e.config.fakerMethod??"lorem"}]`;case"ai_generate":return`[ai:${e.config.aiPrompt??"generated"}]`;case"random":return`sample_${o}`;case"formula":return`[formula:${e.config.formula??""}]`;case"regex":return`[regex:${e.config.regexPattern??""}]`;case"from_csv":return`[csv:${e.config.csvColumn??""}]`;default:return null}}function j(e,o=[]){let t=new Map;for(let n of e)t.set(n.objectApiName,n);let c=new Set,i=[];function r(n){if(c.has(n))return;c.add(n);let s=t.get(n);if(!s)return;let d=f(s,o);for(let a of d)r(a);i.push(s)}for(let n of e)r(n.objectApiName);return i}export{l as a,j as b};
7
+ import{i as u,j as f}from"./chunk-J347SPU6.mjs";var p=1e4,g=150,m=200,l=class{build(o){let t=o.relations??[],c=j(o.objects,t),i=S(c),r=b(c),n=r*g,s=i>p;return{objects:c.map(a=>({objectApiName:a.objectApiName,recordCount:a.recordCount,sampleRecords:C(a,3,u(a.objectApiName,t)),dependsOn:f(a,t)})),totalRecords:i,estimatedApiCalls:r,estimatedDuration:n,grappeRecommended:s}}};function S(e){return e.reduce((o,t)=>o+t.recordCount,0)}function b(e){return e.reduce((o,t)=>{let c=t.batchSize>0?t.batchSize:m;return o+Math.ceil(t.recordCount/c)},0)}function C(e,o,t){let c=Math.min(o,e.recordCount),i=[];for(let r=0;r<c;r++){let n={};for(let d of e.fieldRules)n[d.fieldApiName]=R(d,r);let s=e.rows?.[r];s&&(Object.assign(n,s.values),t?.distribution.mode==="byKey"&&s.parentKey!==void 0&&(n[t.lookupField]=`[key:${s.parentKey}]`)),i.push(n)}return i}function R(e,o){switch(e.ruleType){case"static":return e.config.staticValue??null;case"sequence":{let t=e.config.sequenceStart??1,c=e.config.sequenceStep??1;return`${e.config.sequencePrefix??""}${t+o*c}`}case"picklist_random":return e.config.picklistValues&&e.config.picklistValues.length>0?e.config.picklistValues[o%e.config.picklistValues.length]:null;case"reference":return`[ref:${e.config.referenceObject??"unknown"}]`;case"faker":return`[faker:${e.config.fakerMethod??"lorem"}]`;case"ai_generate":return`[ai:${e.config.aiPrompt??"generated"}]`;case"random":return`sample_${o}`;case"formula":return`[formula:${e.config.formula??""}]`;case"regex":return`[regex:${e.config.regexPattern??""}]`;case"from_csv":return`[csv:${e.config.csvColumn??""}]`;default:return null}}function j(e,o=[]){let t=new Map;for(let n of e)t.set(n.objectApiName,n);let c=new Set,i=[];function r(n){if(c.has(n))return;c.add(n);let s=t.get(n);if(!s)return;let d=f(s,o);for(let a of d)r(a);i.push(s)}for(let n of e)r(n.objectApiName);return i}export{l as a,j as b};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{b as a,c as b,d as c}from"./chunk-IQ5UKRHU.mjs";import"./chunk-CSMGP53U.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-35B73566.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-ATBQIE2V.mjs";import"./chunk-UCUFLFNK.mjs";import"./chunk-SZOJ7BEJ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-22L43JMK.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{c as CycleFkPass,b as RecordsOwingAcrossParts,a as patchCycleFkUpdates};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{a as E,b as h,c as N}from"./chunk-TYUYPFDJ.mjs";var w="example.invalid",L="+3363998";var f={iban:"[IBAN]",card:"[CARD NUMBER]",ssn:"[SSN]",account:"[ACCOUNT NUMBER]"},I="[REDACTED]",$=new RegExp("[\\p{L}\\p{N}._%+-]+@[\\p{L}\\p{N}-]+(?:\\.[\\p{L}\\p{N}-]+)*\\.\\p{L}{2,}","gu"),_=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,b=new RegExp(`\\b${E}\\b`,"g");function*O(n){let t=new RegExp(b.source,"g");for(let r=t.exec(n);r!==null;r=t.exec(n)){let o=h(r[0]);if(o===void 0){t.lastIndex=r.index+1;continue}yield{index:r.index,length:o},t.lastIndex=r.index+o}}var K=/(?<![\p{L}\p{N}])[1-478] ?\d{2} ?(?:0[1-9]|1[0-2]|[2-9]\d) ?(?:\d{2}|2[AB]) ?\d{3} ?\d{3}(?: ?\d{2})?(?![\p{L}\p{N}])/gu,C=/(?<![\p{L}\p{N}+])(?:\+ ?)?(?:\(\d{1,4}\) ?)?\d(?:[ .-]?\d|[ .-]?\(\d{1,4}\)[ .-]?\d)*(?![\p{L}\p{N}])/gu,x=/\b(?:https?:\/\/|www\.)[^\s<>"']+/gi,R=[/^\d{4}[-./]\d{1,2}[-./]\d{1,2}$/,/^\d{1,2}[-./]\d{1,2}[-./]\d{2,4}$/,/^\d{4} ?- ?\d{4}$/],D=/^\d{3}-\d{2}-\d{4}$/,k=new RegExp("(?<!\\p{L})(?:account|acct|a\\/c|compte|konto|kontonummer|cuenta|conta|rib)(?!\\p{L})(?:\\s*(?:number|no\\.?|n[\xB0\xBA]\\.?|nr\\.?|num(?:ber|[e\xE9]ro)?\\.?|#))?\\s*[:#]?\\s*$","iu"),U=40,S=/<!--[\s\S]*?-->|<\/?[A-Za-z][^<>]*>/g,M=/(=\s*)(?:"([^"]*)"|'([^']*)')/g;function B(n){return typeof n.masked=="string"&&n.masked!==""?n.masked:I}function T(n){return n.slice(-8)}function A(n){return/^[\d\s+().-]+$/.test(n)&&n.replace(/\D/g,"").length>=8&&!R.some(t=>t.test(n.trim()))}function W(n){let t=n.trim();return _.test(t)||A(t)}function y(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function V(n){let t={emails:new Map,phones:new Map,words:[]};for(let r of n){let o=r.original.trim();if(o.length<2||o===r.masked)continue;let s=B(r);if(_.test(o))t.emails.set(o.toLowerCase(),s);else if(A(o))t.phones.set(T(o.replace(/\D/g,"")),s);else{let c=o.split(/\s+/).map(y).join("\\s+");t.words.push({pattern:new RegExp(`(?<![\\p{L}\\p{N}])${c}(?![\\p{L}\\p{N}])`,"giu"),replacement:s})}}return t}function*l(n,t){for(let r of t.matchAll(n))yield{index:r.index,found:r[0]}}function P(n,t,r,o){if(R.some(u=>u.test(n)))return;if(D.test(n))return f.ssn;let s=n.replace(/\D/g,"");if(s.length>=5&&k.test(t))return f.account;if(s.length<8)return;let c=r.phones.get(T(s));if(c!==void 0)return c;let a=n.startsWith("+")||/[ .()-]/.test(n);if(!n.startsWith("+")&&!n.includes("(")&&s.length>=13&&s.length<=19&&N(s))return f.card;if(s.length>15)return f.account;if(!a&&s.length<10)return;let m=parseInt(o(`redact:phone:${s}`).slice(0,8),16)%1e4;return`${L}${String(m).padStart(4,"0")}`}function p(n,t,r){if(n.trim()==="")return n;let o=[...l(x,n)].map(({index:e,found:i})=>[e,e+i.length]),s=e=>o.some(([i,d])=>e>=i&&e<d),c=[],a=(e,i,d,g)=>{c.push({start:e,end:e+i,rank:d,replacement:g})};for(let{index:e,found:i}of l($,n)){let d=i.toLowerCase();a(e,i.length,0,t.emails.get(d)??`redacted-${r(`redact:email:${d}`).slice(0,8)}@${w}`)}for(let{pattern:e,replacement:i}of t.words)for(let{index:d,found:g}of l(e,n))a(d,g.length,1,i);for(let{index:e,length:i}of O(n))s(e)||a(e,i,2,f.iban);for(let{index:e,found:i}of l(K,n))s(e)||a(e,i.length,3,f.ssn);for(let{index:e,found:i}of l(C,n)){if(s(e))continue;let d=n.slice(Math.max(0,e-U),e),g=P(i,d,t,r);g!==void 0&&a(e,i.length,4,g)}if(c.length===0)return n;c.sort((e,i)=>e.start-i.start||i.end-e.end||e.rank-i.rank);let m="",u=0;for(let e of c)e.start<u||(m+=n.slice(u,e.start)+e.replacement,u=e.end);return m+n.slice(u)}function X(n,t,r){return n.startsWith("<!--")?`<!--${p(n.slice(4,-3),t,r)}-->`:n.replace(M,(o,s,c,a)=>c!==void 0?`${s}"${p(c,t,r)}"`:`${s}'${p(a??"",t,r)}'`)}function G(n,t){let r=V(t.known??[]),o="",s=0;for(let{index:c,found:a}of l(S,n))o+=p(n.slice(s,c),r,t.digest)+X(a,r,t.digest),s=c+a.length;return o+=p(n.slice(s),r,t.digest),o===n?n:o}export{W as a,G as b};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{a as x,b as I}from"./chunk-JRLYWVF4.mjs";import{b as F}from"./chunk-VT6P3X6R.mjs";import{g as w}from"./chunk-KWUS7UAV.mjs";import{b as k,c as R}from"./chunk-K5PUMHZU.mjs";import{La as g,Oa as l,Vb as h}from"./chunk-J347SPU6.mjs";import{b as d,m as S,s as u,v as f}from"./chunk-WZQEK4WT.mjs";import{createHash as O}from"node:crypto";import{readFile as C,rename as P,writeFile as N}from"node:fs/promises";import*as a from"node:path";var A=w,E=d().regex(/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/,"A record id"),p=S({version:f(1),runId:d().min(1).max(200),packId:g,packFingerprint:d().regex(/^[0-9a-f]{64}$/,"A sha256, in lower-case hexadecimal"),compile:l.refine(e=>e.seed!==void 0,{message:"The seed the pack was compiled with is kept",path:["seed"]}),openCases:u(d().min(1).max(255),E),agent:h.optional()});function $(e){return O("sha256").update(m(e)).digest("hex")}function U(e){let r={};for(let n of e.compiled.tests){let i=n.openCase?.caseKey;if(i===void 0)continue;let t=e.caseIds[i];t!==void 0&&(r[i]=t)}return p.parse({version:1,runId:e.runId,packId:e.pack.id,packFingerprint:$(e.pack),compile:{...e.options,seed:e.compiled.seed},openCases:r})}function Z(e,r){return p.parse({...e,agent:r})}function K(e,r){if(r.id!==e.packId)return{ok:!1,message:`The run was seeded from the scenario ${e.packId}, not ${r.id}`};if($(r)!==e.packFingerprint)return{ok:!1,message:`The scenario ${r.id} has changed since the run: its tests would be about subjects and addresses no record of the run holds`};try{return{ok:!0,compiled:I(r,e.compile)}}catch(n){if(n instanceof x)return{ok:!1,message:n.message};throw n}}function L(){return{readFile:e=>C(e,"utf8"),writeFile:(e,r)=>N(e,r,{encoding:"utf8",mode:k}),rename:(e,r)=>P(e,r),mkdir:e=>R(e)}}function y(e,r){return a.join(e,F,`${r.replace(/[^A-Za-z0-9_-]/g,"_")}${A}`)}async function M(e,r,n){let i=p.parse(n),t=y(r,i.runId),o=`${t}.${process.pid}.tmp`;return await e.mkdir(a.dirname(t)),await e.writeFile(o,`${JSON.stringify(i,null,2)}
8
+ `),await e.rename(o,t),t}async function X(e,r,n){let i=y(r,n),t;try{t=await e.readFile(i)}catch(c){if(c.code==="ENOENT")return{kind:"absent"};throw c}let o;try{o=JSON.parse(t)}catch{return{kind:"invalid",message:`${a.basename(i)} is not JSON`}}let s=p.safeParse(o);if(!s.success){let c=s.error.issues[0];return{kind:"invalid",message:`${a.basename(i)}: ${c.path.join(".")||"the file"}: ${c.message}`}}return s.data.runId!==n?{kind:"invalid",message:`${a.basename(i)} is the companion of the run ${s.data.runId}, not ${n}`}:{kind:"read",sidecar:s.data}}function m(e){return Array.isArray(e)?`[${e.map(r=>m(r??null)).join(",")}]`:e!==null&&typeof e=="object"?`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>n<i?-1:n>i?1:0).map(([n,i])=>`${JSON.stringify(n)}:${m(i)}`).join(",")}}`:JSON.stringify(e??null)}export{A as a,p as b,$ as c,U as d,Z as e,K as f,L as g,y as h,M as i,X as j};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{a,b}from"./chunk-3OKDWZ32.mjs";import"./chunk-55VBV2WK.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-CRPLDXJU.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as FieldMapper,b as generateValue};
7
+ import{a,b}from"./chunk-3HAVVEXF.mjs";import"./chunk-HLROVOR6.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as FieldMapper,b as generateValue};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{e as R,f as y,i as A,j as _}from"./chunk-DDNCJVZ2.mjs";import{Qd as S}from"./chunk-J347SPU6.mjs";import{homedir as I}from"node:os";import{join as P,resolve as T}from"node:path";var Y="SANDFORGE_JOURNAL_DIR";function W(e=process.env){let n=e[Y];return n!==void 0&&n.trim()!==""?T(n):P(I(),".sandforge")}import{spawn as C}from"node:child_process";import{join as G}from"node:path";import{StringDecoder as J}from"node:string_decoder";function j(){return process.execArgv.filter(e=>!/^--inspect/.test(e))}function F(e){return G(__dirname,`${e}.mjs`)}var a="SANDFORGE_RELAYED_BY";function ee(e={}){let n=(e.platform??process.platform)==="win32",w=e.scriptPath??F;return(h,B,o,i={})=>new Promise((L,N)=>{let p=i.relayedBy??e.relayedBy,f={...process.env};delete f[S];let b={...f,...p!==void 0?{[a]:p}:{},[_]:n?"ipc":"signal"},r=C(process.execPath,[...j(),w(h),...B],{stdio:n?["ignore","pipe","pipe","ipc"]:["ignore","pipe","pipe"],env:b,detached:!n,windowsHide:!0}),u=[],l=[],m=i.onStderr!==void 0?new J("utf8"):void 0;r.stdout?.on("data",t=>u.push(t)),r.stderr?.on("data",t=>{l.push(t),process.stderr.write(t);let d=m?.write(t);d&&i.onStderr?.(d)});let s=()=>{if(!n||!r.connected){r.kill("SIGINT");return}r.send(A,t=>{t&&r.kill("SIGINT")})};o.aborted?s():o.addEventListener("abort",s,{once:!0}),r.on("error",t=>{o.removeEventListener("abort",s),N(t)}),r.on("close",(t,d)=>{o.removeEventListener("abort",s);let g=m?.end();g&&i.onStderr?.(g);let E=R.find(O=>O===d);L({code:t??(E!==void 0?y(E):1),stdout:Buffer.concat(u).toString("utf8"),stderr:Buffer.concat(l).toString("utf8")})})})}function c(){let e=process.env[a]?.trim();return e===void 0||e===""?void 0:e}function x(){return c()?.startsWith("sandforge env")===!0}function re(e,n){return x()?n:e}var V="sandforge mcp clone_org_plan",v="sandforge mcp clone_org",H=new Map([["sandforge env",["--sweep","--include-changed"]],["sandforge env, relayed by sandforge mcp",["--include-changed"]],["sandforge mcp",["--mute-automation","--leave-undeletable","--store","--include-changed","--preview"]],[V,["--max-total","--exclude-object","--exclude","--filter","--fit","--fit-within","--fit-seed","--fit-draw","--fit-parents","--fit-children","--fit-whole","--fit-floor","--anonymize","--accept-automation","--accept-emails","--mute-automation","--checkpoint-first"]],[v,[]]]);function oe(){return x()||c()===v}function M(e){let n=c();return n===void 0||H.get(n)?.includes(e)===!0}function ie(e,n){return M(e)?e:n===void 0?`this script's own ${e}`:`this script's own ${n} with ${e}`}export{W as a,a as b,ee as c,c as d,x as e,re as f,V as g,v as h,oe as i,M as j,ie as k};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{a as y,b as g}from"./chunk-VKA5OZBJ.mjs";import{a as S,b as f,c as p}from"./chunk-VPGX5Z5D.mjs";import{b as u}from"./chunk-CA5NAXSU.mjs";import{Ha as d}from"./chunk-CRPLDXJU.mjs";var h="SELECT ApiName, MasterLabel, IsClosed, IsDefault, SortOrder FROM CaseStatus ORDER BY SortOrder",w="SELECT MasterLabel, IsClosed, IsDefault, SortOrder FROM CaseStatus ORDER BY SortOrder",A="Closed";async function k(a){let e;try{e=await a(h)}catch{try{e=await a(w)}catch(t){return m(`the org would not read its case statuses: ${u(t)}`)}}let r=e.flatMap(t=>{let n=b(t.ApiName)??b(t.MasterLabel);return n===void 0?[]:[{value:n,closed:t.IsClosed===!0,isDefault:t.IsDefault===!0}]}),o=r.filter(t=>!t.closed),i=r.filter(t=>t.closed);return o.length===0||i.length===0?m(o.length===0?"the org has no case status that leaves a case open":"the org has no case status that closes a case"):{open:(o.find(t=>t.isDefault)??o[0]).value,closed:(i.find(t=>t.value===A)??i[0]).value,from:"org"}}function m(a){return{...d.caseStatus,from:"default",reason:a}}function b(a){return typeof a=="string"&&a.trim()!==""?a:void 0}var c=S;async function E(a,e){let r;try{r=await a(c)}catch{r={access:"createable"}}if(r.access==="absent")return{available:!1,reason:r.reason??`the org has no ${c}`};if(r.access==="readOnly")return{available:!1,reason:r.reason??`the user this seed runs as may read ${c} and not create it`};try{return{available:!0,bodyFields:f(await e(c))}}catch{return{available:!0,bodyFields:[]}}}var P=["Status","Origin","Priority","Type"];async function T(a){let e;try{e=(await a("Case")).fields}catch{return}let r={};for(let o of P){let t=(e.find(n=>n.name===o)?.picklistValues??[]).filter(n=>n.active!==!1).map(n=>n.value);t.length>0&&(r[o]=t)}return r}function v(a,e){let r=e.knowledge.available?e.knowledge.bodyFields:[],o=r.map(s=>s.name),i=e.articleBodyField===void 0?r[0]:r.find(s=>s.name===e.articleBodyField);if(e.articleBodyField!==void 0&&i===void 0)return{issues:[`options.articleBodyField: ${e.articleBodyField} is not a field of ${c} this org lets a body be written to`+(o.length>0?` (${o.join(", ")})`:"")]};let t=e.knowledge.available?{available:!0,bodyFields:o}:e.knowledge,n={seed:e.seed??d.seed,caseStatus:{open:e.caseStatus.open,closed:e.caseStatus.closed},...i!==void 0?p(i):{}},l;try{l=g(a,n)}catch(s){if(s instanceof y)return{issues:s.issues};throw s}return{preparation:{options:n,objects:[...l.template.objects].sort((s,C)=>s.insertOrder-C.insertOrder).map(s=>({objectApiName:s.objectApiName,recordCount:s.recordCount,...s.optional===!0?{optional:!0}:{}})),tests:l.tests.length,caseStatusFrom:e.caseStatus.from==="org"?{from:"org"}:{from:"default",reason:e.caseStatus.reason},knowledge:t}}}function D(a){return async e=>{let r=await a.query(e),o=[...r.records];for(;!r.done&&r.nextRecordsUrl;)r=await a.queryMore(r.nextRecordsUrl),o.push(...r.records);return o}}export{h as a,w as b,k as c,c as d,E as e,T as f,v as g,D as h};
7
+ import{a as y,b as g}from"./chunk-JRLYWVF4.mjs";import{a as S,b as f,c as p}from"./chunk-5JMQXHJ2.mjs";import{b as u}from"./chunk-CA5NAXSU.mjs";import{Ka as d}from"./chunk-J347SPU6.mjs";var h="SELECT ApiName, MasterLabel, IsClosed, IsDefault, SortOrder FROM CaseStatus ORDER BY SortOrder",w="SELECT MasterLabel, IsClosed, IsDefault, SortOrder FROM CaseStatus ORDER BY SortOrder",A="Closed";async function k(a){let e;try{e=await a(h)}catch{try{e=await a(w)}catch(t){return m(`the org would not read its case statuses: ${u(t)}`)}}let r=e.flatMap(t=>{let n=b(t.ApiName)??b(t.MasterLabel);return n===void 0?[]:[{value:n,closed:t.IsClosed===!0,isDefault:t.IsDefault===!0}]}),o=r.filter(t=>!t.closed),i=r.filter(t=>t.closed);return o.length===0||i.length===0?m(o.length===0?"the org has no case status that leaves a case open":"the org has no case status that closes a case"):{open:(o.find(t=>t.isDefault)??o[0]).value,closed:(i.find(t=>t.value===A)??i[0]).value,from:"org"}}function m(a){return{...d.caseStatus,from:"default",reason:a}}function b(a){return typeof a=="string"&&a.trim()!==""?a:void 0}var c=S;async function E(a,e){let r;try{r=await a(c)}catch{r={access:"createable"}}if(r.access==="absent")return{available:!1,reason:r.reason??`the org has no ${c}`};if(r.access==="readOnly")return{available:!1,reason:r.reason??`the user this seed runs as may read ${c} and not create it`};try{return{available:!0,bodyFields:f(await e(c))}}catch{return{available:!0,bodyFields:[]}}}var P=["Status","Origin","Priority","Type"];async function T(a){let e;try{e=(await a("Case")).fields}catch{return}let r={};for(let o of P){let t=(e.find(n=>n.name===o)?.picklistValues??[]).filter(n=>n.active!==!1).map(n=>n.value);t.length>0&&(r[o]=t)}return r}function v(a,e){let r=e.knowledge.available?e.knowledge.bodyFields:[],o=r.map(s=>s.name),i=e.articleBodyField===void 0?r[0]:r.find(s=>s.name===e.articleBodyField);if(e.articleBodyField!==void 0&&i===void 0)return{issues:[`options.articleBodyField: ${e.articleBodyField} is not a field of ${c} this org lets a body be written to`+(o.length>0?` (${o.join(", ")})`:"")]};let t=e.knowledge.available?{available:!0,bodyFields:o}:e.knowledge,n={seed:e.seed??d.seed,caseStatus:{open:e.caseStatus.open,closed:e.caseStatus.closed},...i!==void 0?p(i):{}},l;try{l=g(a,n)}catch(s){if(s instanceof y)return{issues:s.issues};throw s}return{preparation:{options:n,objects:[...l.template.objects].sort((s,C)=>s.insertOrder-C.insertOrder).map(s=>({objectApiName:s.objectApiName,recordCount:s.recordCount,...s.optional===!0?{optional:!0}:{}})),tests:l.tests.length,caseStatusFrom:e.caseStatus.from==="org"?{from:"org"}:{from:"default",reason:e.caseStatus.reason},knowledge:t}}}function D(a){return async e=>{let r=await a.query(e),o=[...r.records];for(;!r.done&&r.nextRecordsUrl;)r=await a.queryMore(r.nextRecordsUrl),o.push(...r.records);return o}}export{h as a,w as b,k as c,c as d,E as e,T as f,v as g,D as h};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{a,b,c,d,e,f,g}from"./chunk-45375WT5.mjs";import"./chunk-32ZB5ICW.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-CRPLDXJU.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{f as STANDARD_PRICEBOOK_MATCHED_NOTE,b as namesAPricebook,d as pricesHeldWithTheirs,e as pricesHeldWithTheirsNote,a as readStandardPricebooks,c as settleSyncPrices,g as withPricesSettled};
7
+ import{a,b,c,d,e,f,g}from"./chunk-T542Z54E.mjs";import"./chunk-3I6FXFCN.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{f as STANDARD_PRICEBOOK_MATCHED_NOTE,b as namesAPricebook,d as pricesHeldWithTheirs,e as pricesHeldWithTheirsNote,a as readStandardPricebooks,c as settleSyncPrices,g as withPricesSettled};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-SKGAERV4.mjs";import"./chunk-MRN72UEO.mjs";import"./chunk-A3QNSALB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-YGE4AUXG.mjs";import"./chunk-RFD6NPWJ.mjs";import"./chunk-SF52ZSIV.mjs";import"./chunk-TWYNQ2OO.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-FG4Y4ZVL.mjs";import"./chunk-Z354SAEF.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-THYQOG24.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-JFVY66BS.mjs";import"./chunk-GUYEXPJ4.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-CRPLDXJU.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{b as ARCHIVE_CHUNK_BYTES,a as ARCHIVE_EXTENSION,f as CheckpointExportError,d as archiveKeyText,h as exportCheckpointArchive,j as importCheckpointArchive,l as importReceivedArchive,c as newArchiveKey,e as parseArchiveKey,g as portableCheckpointOf,i as readArchiveHeader,k as receivedStoreRootOf};
7
+ import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-UM2B4GR7.mjs";import"./chunk-2YJJTQNC.mjs";import"./chunk-4VLP6RHC.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-DLSU66MY.mjs";import"./chunk-H6BHWAX7.mjs";import"./chunk-4CSBZZAL.mjs";import"./chunk-4XROG5CT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-DAUX63UB.mjs";import"./chunk-SZOJ7BEJ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-22L43JMK.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-3KJCSYXY.mjs";import"./chunk-HDDJ3CVN.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{b as ARCHIVE_CHUNK_BYTES,a as ARCHIVE_EXTENSION,f as CheckpointExportError,d as archiveKeyText,h as exportCheckpointArchive,j as importCheckpointArchive,l as importReceivedArchive,c as newArchiveKey,e as parseArchiveKey,g as portableCheckpointOf,i as readArchiveHeader,k as receivedStoreRootOf};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r}from"./chunk-ALWVNR34.mjs";import"./chunk-EGL3I3IX.mjs";import"./chunk-CSMGP53U.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-35B73566.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-TYUYPFDJ.mjs";import"./chunk-OLCS7JCT.mjs";import"./chunk-TQ6HEJ73.mjs";import"./chunk-65AMXOQU.mjs";import"./chunk-6HHSAPIM.mjs";import"./chunk-K5PUMHZU.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-EUIALBMX.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-ATBQIE2V.mjs";import"./chunk-UCUFLFNK.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-DAUX63UB.mjs";import"./chunk-SZOJ7BEJ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-22L43JMK.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{h as ACTIVE_DUPLICATE_RULES_SOQL,a as FORMULAS_BOUND,c as FORMULAS_IN_COMPOSITES_BOUND,b as FORMULA_REQUESTS_BOUND,o as TargetGapReader,i as bypassesOf,j as callsEstimateOf,f as fieldLabelsSoql,p as gapAnsweredBy,d as gapFieldOf,r as gapLines,q as gapsWithAnswers,l as readActiveValidationRules,m as readValidationRuleBypasses,k as toolingQueriesOver,n as toolingValidationRules,g as validationFormulaSoql,e as validationRulesSoql};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{a,b,c}from"./chunk-KQVLZVOP.mjs";import"./chunk-YZQN7BRB.mjs";import"./chunk-QACFTHJM.mjs";import"./chunk-H4OBZIX3.mjs";import"./chunk-JRLYWVF4.mjs";import"./chunk-HLROVOR6.mjs";import"./chunk-VT6P3X6R.mjs";import"./chunk-34SMB5PA.mjs";import"./chunk-KWUS7UAV.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-K5PUMHZU.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as DX_PROJECT_FILE,b as scenarioProjectOf,c as writeRunTestFile};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{a as Ee,b as K,g as Te,h as Ne,i as Ie,p as Be}from"./chunk-O6FHK6NQ.mjs";import{a as Se,c as x,d as Pe,e as De}from"./chunk-JFXQZPRY.mjs";import{b as Ae,e as je,i as ve,j as W,l as $}from"./chunk-BBZUGKBZ.mjs";import{b as Ce}from"./chunk-BLMJ4WVI.mjs";import{g as _,j as fe,l as L,m as pe,p as me}from"./chunk-CL75DEMQ.mjs";import{A as be,B as ke,D as he,F as ye,G as Re,H as Oe}from"./chunk-7O6EFNQS.mjs";import{j as ge}from"./chunk-DLSU66MY.mjs";import{A as we,x as C}from"./chunk-4CSBZZAL.mjs";import{e as G}from"./chunk-GP5J3DGS.mjs";import{c as ce}from"./chunk-ZVU7MD2S.mjs";import{o as le,p as ue}from"./chunk-OLCS7JCT.mjs";import{g as re,h as se,i as ae,q as de}from"./chunk-DAUX63UB.mjs";import{b as oe}from"./chunk-CA5NAXSU.mjs";import{le as ie}from"./chunk-J347SPU6.mjs";var Ue="No record would be read or written.";function ze(n,e){return{code:"RUN_WRITING",message:`${e.operation==="take"?`A checkpoint of ${n} is being taken`:e.operation==="rewind"?`A rewind is writing to ${n}`:e.operation==="undo"?`An undo is writing to ${n}`:e.operation==="empty"?`An emptying of its objects is writing to ${n}`:`SandForge is deleting checkpoints of ${n}`} (process ${e.pid} on ${e.host}): rewind once it has ended. ${Ue}`}}function He(n){return{query:e=>n.query(e),queryMore:e=>n.queryMore(e)}}function Je(n){let e=n.objects.find(r=>r.objectApiName===re);if(e===void 0)return 0;let i=e.toBringBack;return i.inBin+i.withParent+i.deletedWhileTaken}function Ve(n,e){return{objectsRead:[...n],objects:[],unread:["flows","triggers","processes","workflowRules"].map(i=>({part:i,reason:e})),conditionsNotRead:0,conditionsBound:0,requests:0}}function Ye(n,e){let i=new Map,r;return{bodies:i,global:()=>r,describeGlobal:()=>r??=n.describeGlobal(),reader:{lane:()=>e.lane(),tooling:o=>e.tooling(o),calls:()=>e.calls(),describe:async(o,u)=>{let m=await e.describe(o,u);return"body"in m&&i.set(o,m.body),m}}}}async function gt(n,e){let{org:i,signal:r}=n,{checkpoint:o,orgName:u}=e,m,k=await Ce(He(i),{act:"preview",orgName:u,registered:e.registered,username:e.username,organizationId:o.org.organizationId,customSettings:de(o)},{userId:async()=>m=await i.userId()});if(!k.allowed)return{previewed:!1,refusal:k.refusal};let h=await ye(i,u),f=Ye(i,ge(i,r)),Fe=await Ae({grants:k.grants,...m!==void 0?{userId:m}:{},username:e.username,checkpoint:o,reader:f.reader}),v=await i.serverTime(),y=we("pv",(n.now??(()=>new Date))()),d=await je({checkpoint:o,folder:e.folder,reader:f.reader,describeGlobal:f.describeGlobal,previewId:y,readAt:v,queryAllFiles:k.queryAllFiles,access:Fe,...r?{signal:r}:{}}),S=h.fileStorage;d.files!==void 0&&S!==void 0&&(d.files.storage.remaining=S.remaining*1048576),await Ee(i,d,C(e.folder,y),o.takenAt);let b=e.objects!==void 0?new Set(e.objects):void 0,c=ve(d,b),R=Se(c),U=b===void 0&&o.scope.mode==="picked"&&d.objects.some(t=>t.outside.length>0),Ge=U&&e.acceptOutside===!1,s;if(b!==void 0||Ge){s=await $({checkpoint:o,previewDir:C(e.folder,y),readAt:v,...b!==void 0?{objects:b}:{},acceptOutside:e.acceptOutside===!0,heldRows:W(o,e.folder),...r?{signal:r}:{}});for(let{objectApiName:t}of s.acts)R.includes(t)||R.push(t)}let a;if(R.length>0&&n.readAutomation)try{a=await n.readAutomation(R)}catch(t){a=Ve(R,oe(t))}let P,O=0,D=s?x(d,s):c,E=De(D),p=a&&e.muteAutomation===!0?le(a,ie(E)):void 0,g=a&&p&&p.plan.assign.length>0&&n.mute?await Be(n.mute,a,E):void 0,_e=g&&"refusal"in g?g.refusal:void 0,A=ue(g===void 0?p?.plan:"refusal"in g?g.plan:g.mute?.plan??p?.plan);if(a){let t=await me({act:"rewind",orgName:u,automation:a,steps:E,...p?{plan:p.plan}:{},accepted:!1,mayMute:p===void 0,read:()=>ce(i)});P=t.gate.deliverability,O=t.ofRun.read?.requests??0}let z=f.global(),T=z?new Set((await G({describeGlobal:()=>z})).keys()):void 0,H=new Set(o.objects.map(({objectApiName:t})=>t.toLowerCase()));if(o.files!==void 0)for(let t of[se,ae])H.add(t.toLowerCase());let j=new Map;for(let[t,l]of f.bodies)j.set(t,be(l,{inCheckpoint:H,...T?{worked:T}:{}}));let N=s!==void 0?Pe(d,s):[],I=s!==void 0?{...c,objects:[...c.objects,...N],withParentDeleted:s.acts.flatMap(({objectApiName:t,withParent:l})=>(l??0)>0?[{objectApiName:t,count:l??0}]:[])}:c,Le=new Map((I.withParentDeleted??[]).map(({objectApiName:t,count:l})=>[t,l])),We=new Map((s!==void 0?Me(s):[]).map(({objectApiName:t,count:l})=>[t,l])),J=new Map;for(let t of I.objects){let l=t.toDelete.createdSince+t.toDelete.broughtBackSince-(Le.get(t.objectApiName)??0)-(We.get(t.objectApiName)??0),ee=f.bodies.get(t.objectApiName),te=j.get(t.objectApiName);if(l<=Te||ee===void 0||te===void 0)continue;let xe=T??new Set((await G({describeGlobal:f.describeGlobal})).keys()),ne=await Ne(f.reader,ke(ee,xe),r);J.set(t.objectApiName,ne),j.set(t.objectApiName,{...te,pointing:ne})}await Ie(C(e.folder,y),J);let V=he({objects:o.objects,diff:I,...b!==void 0?{readDiff:d}:{},automationRequests:a?.requests??0,...O>0?{deliverabilityRequests:O}:{},...A>0?{muteRequests:A}:{},...K(c)>0&&!(o.scope.mode==="picked"&&e.acceptOutside===!1)?{duplicateSets:K(c)}:{},relationships:j,...e.reusesPreview===!0?{reusesPreview:!0}:{},...s!==void 0?{kept:Me(s)}:{},...N.length>0?{unpicked:N.map(({objectApiName:t})=>t)}:{}}),$e={...V,apiRequestsLeft:h.remaining},Y=_(D.objects,D.withParentDeleted),w=p?.automation??a,B=w?L(Y,w,h.emails):[],Q=w?fe(Y,w):void 0,M=U&&e.acceptOutside===void 0&&w?x(d,await $({checkpoint:o,previewDir:C(e.folder,y),readAt:v,acceptOutside:!1,heldRows:W(o,e.folder),...r?{signal:r}:{}})):void 0,X=M&&w?L(_(M.objects,M.withParentDeleted),w,h.emails):void 0,F=n.store.heldBy(o.org.organizationId),Z=F===void 0?await n.runWriting?.(k.org.id):void 0,q=F!==void 0?ze(u,F):Z!==void 0?{code:"RUN_WRITING",message:Z}:_e??Re("rewind",{run:V.apiRequests-O-A,deliverability:O,mute:A},h,u)??pe("rewind",B,u)??(c.files!==void 0?Oe("rewind",{files:Je(c),bytes:c.files.storage.bringBack},S?.remaining,u):void 0);return{previewed:!0,diff:d,...a?{automation:a}:{},...B.length>0?{emails:B}:{},...X?{emailsKeepingOutside:X}:{},...Q!==void 0?{emailsUncounted:Q}:{},...P?{deliverability:P}:{},estimate:$e,...q?{refusal:q}:{}}}var Qe=new Set(["outsideNotAccepted","holdsLeft","contactKept"]);function Me(n){let e=new Map;for(let{objectApiName:i,reason:r,count:o}of n.left)Qe.has(r)&&e.set(i,(e.get(i)??0)+o);return[...e].map(([i,r])=>({objectApiName:i,count:r}))}export{gt as a};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{a as ee}from"./chunk-TZE3Y7IQ.mjs";import{b as le}from"./chunk-CA5NAXSU.mjs";import{mb as $,vc as Y}from"./chunk-CRPLDXJU.mjs";var se=200;function j(e,s){let a=[];for(let n=0;n<e.length;n+=s)a.push(e.slice(n,n+s));return a}function ne(e){return`'${ee(e)}'`}function H(e){return`(${e.map(ne).join(", ")})`}function me(e){return`'${ee(e).replace(/[%_]/g,a=>`\\${a}`)}.%'`}function Fe(e,s){let a=new Set(s.map(n=>n.toLowerCase()));return e.replace(/[^\s@<>()[\]"',;:]+@[^\s@<>()[\]"',;:]+/g,n=>a.has(n.toLowerCase())?n:"<address>")}function Se(e){let s=e;return typeof s?.errorCode=="string"&&s.errorCode!==""?s.errorCode:typeof s?.name=="string"&&/^[A-Z][A-Z_]+$/.test(s.name)?s.name:"REQUEST_FAILED"}function we(e,s){let a={code:Se(e),message:le(e),fields:[]};return Array.from({length:s},()=>({success:!1,errors:[a]}))}function Ie(e){let s=e;if(s==null)return{success:!1,errors:[{code:"NO_ANSWER",message:"the org answered nothing for it",fields:[]}]};let a=(s.errors??[]).map(d=>({code:typeof d.statusCode=="string"?d.statusCode:typeof d.errorCode=="string"?d.errorCode:"UNKNOWN_ERROR",message:typeof d.message=="string"?d.message:"the org gave no words",fields:Array.isArray(d.fields)?d.fields.filter(c=>typeof c=="string"):[]})),n=s.success===!0;return{...typeof s.id=="string"?{id:s.id}:{},success:n,errors:n||a.length>0?a:[{code:"UNKNOWN_ERROR",message:"the org refused it",fields:[]}]}}function Re(e,s){let a=Array.isArray(e)?e:[e];return Array.from({length:s},(n,d)=>Ie(a[d]))}function Me(e){let s=0,a=async(n,d)=>{let c=[];for(let i of j(n,se)){s+=1;try{c.push(...Re(await d(i),i.length))}catch(U){c.push(...we(U,i.length))}}return c};return{identity:async()=>{s+=1;let n=await e.identity();return{userId:n.user_id,organizationId:n.organization_id,username:n.username}},query:async n=>{s+=1;let d=await e.query(n),c=[...d.records];for(;!d.done&&d.nextRecordsUrl;)s+=1,d=await e.queryMore(d.nextRecordsUrl),c.push(...d.records);return c},update:(n,d)=>a(d,c=>e.sobject(n).update(c,{allOrNone:!1,headers:Y()})),create:(n,d)=>a(d,c=>e.sobject(n).create(c,{allOrNone:!1,headers:Y()})),destroy:(n,d)=>a(d,c=>e.sobject(n).destroy(c,{allOrNone:!1})),requests:()=>s}}var ye=72,Pe=50,Ae=20,Ee=200,Ne=100,fe=".invalid";function Q(e){let s=e.length-fe.length;if(!(s<=0||e.slice(s).toLowerCase()!==fe))return e.slice(0,s)}function E(e){return e.slice(0,15)}function x(e){return typeof e=="string"&&e!==""?e:void 0}var te="Id, Username, Email, IsActive, ProfileId, Profile.Name, Profile.UserLicenseId";function oe(e){let s=e.Profile??void 0,a=x(s?.UserLicenseId);return{id:String(e.Id),username:String(e.Username),isActive:e.IsActive===!0,profileId:String(e.ProfileId),profileName:x(s?.Name)??String(e.ProfileId),...a?{licenseId:a}:{},email:x(e.Email)??""}}function pe(e){let s=e.indexOf("__");return s>0&&!e.slice(s+2).includes("__")?{namespace:e.slice(0,s),own:e.slice(s+2)}:{own:e}}function D(e,s){return s?`${s}__${e}`:e}async function Oe(e,s){let a=new Map,n=[...new Map(s.map(i=>[$(i),i])).values()];for(let i of j(n,Pe)){let U=await e.query(`SELECT ${te} FROM User WHERE Username IN ${H(i)}`);for(let l of U){let u=oe(l);a.set($(u.username),u)}}let d=n.filter(i=>!a.has($(i))),c=new Map;for(let i of j(d,Ae)){let U=i.map(u=>`Username LIKE ${me(u)}`).join(" OR "),l=(await e.query(`SELECT ${te} FROM User WHERE ${U}`)).map(oe);for(let u of i){let S=`${$(u)}.`,N=[...new Map(l.filter(w=>$(w.username).startsWith(S)).map(w=>[w.id,w])).values()];c.set($(u),N)}}return s.map(i=>{let U=a.get($(i));if(U)return{given:i,kind:"found",user:U};let l=c.get($(i))??[];return l.length===1?{given:i,kind:"found",user:l[0]}:l.length===0?{given:i,kind:"none"}:{given:i,kind:"two",usernames:l.map(u=>u.username).sort((u,S)=>u<S?-1:u>S?1:0)}})}async function K(e,s,a,n,d,c=""){let i=[];for(let U of j([...new Set(d)],Ee))i.push(...await e.query(`SELECT ${s} FROM ${a} WHERE ${n} IN ${H(U)}${c}`));return i}async function re(e,s,a,n,d,c=""){let i=[];for(let U of j([...new Set(d)],Ne))i.push(...await e.query(`SELECT ${s} FROM ${a} WHERE ${n} IN ${H(U)}${c}`));return i}async function ve(e){try{let[s]=await e.query("SELECT PermissionsManageUsers FROM UserPermissionAccess"),a=s?.PermissionsManageUsers;return typeof a=="boolean"?a:void 0}catch{return}}function ie(e,s){let a=new Set(s.map(n=>n.toLowerCase()));return e.filter(n=>!a.has(n.toLowerCase()))}async function be(e,s,a){if(s.length===0)return[];let n=new Date(a.getTime()-ye*36e5).toISOString().replace(/\.\d{3}Z$/,"Z"),d;try{d=await e.query(`SELECT Display, CreatedDate FROM SetupAuditTrail WHERE Action = ${ne("useremailchangesent")} AND CreatedDate >= ${n}`)}catch{return[]}let c=d.map(i=>(x(i.Display)??"").trim().toLowerCase());return s.filter(i=>{let U=Q(i.email)?.toLowerCase();if(U===void 0)return!1;let l=`[${E(i.id).toLowerCase()}]`;return c.some(u=>u.includes(l)&&u.endsWith(` ${U}`))}).map(i=>E(i.id))}async function ze(e,s,a){let n=e.requests(),d=await e.identity(),c=await ve(e),i=await Oe(e,s.map(o=>o.username)),U=i.flatMap(o=>o.kind==="found"?[o.user]:[]),l=new Set(U.map(o=>E(o.id))),u=a.previous?.users??[],S=u.map(o=>o.applied.userId).filter(o=>!l.has(E(o))),N=(await K(e,te,"User","Id",S)).map(oe),w=[...U,...N].map(o=>o.id),P=o=>[...new Map(s.flatMap(h=>o(h)??[]).map(h=>[h.toLowerCase(),h])).values()],_=P(o=>o.permissionSets),M=P(o=>o.permissionSetGroups),G=P(o=>o.groups),b=u.length>0,J=s.some(o=>o.frozen!==void 0)||b?(await K(e,"Id, UserId, IsFrozen","UserLogin","UserId",w)).map(o=>({id:String(o.Id),userId:String(o.UserId),isFrozen:o.IsFrozen===!0})):[],r=s.some(o=>o.profile!==void 0)||b?(await e.query("SELECT Id, Name, UserLicenseId FROM Profile")).map(o=>{let h=x(o.UserLicenseId);return{id:String(o.Id),name:String(o.Name),...h?{licenseId:h}:{}}}):void 0,f={},g=[];if(_.length>0){let o=await re(e,"Id, Name, NamespacePrefix, LicenseId","PermissionSet","Name",_.map(t=>pe(t).own)," AND IsOwnedByProfile = false");for(let t of o){let R=x(t.NamespacePrefix),I=x(t.LicenseId);g.push({id:String(t.Id),name:String(t.Name),...R?{namespace:R}:{},...I?{licenseId:I}:{}})}let h=g.map(t=>D(t.name,t.namespace));ie(_,h).length>0&&(f.permissionSets=(await e.query("SELECT Name, NamespacePrefix FROM PermissionSet WHERE IsOwnedByProfile = false")).map(t=>D(String(t.Name),x(t.NamespacePrefix))))}let m=[];if(M.length>0){let o=await re(e,"Id, DeveloperName, NamespacePrefix","PermissionSetGroup","DeveloperName",M.map(t=>pe(t).own));for(let t of o){let R=x(t.NamespacePrefix);m.push({id:String(t.Id),name:String(t.DeveloperName),...R?{namespace:R}:{}})}let h=m.map(t=>D(t.name,t.namespace));ie(M,h).length>0&&(f.permissionSetGroups=(await e.query("SELECT DeveloperName, NamespacePrefix FROM PermissionSetGroup")).map(t=>D(String(t.DeveloperName),x(t.NamespacePrefix))))}let O=[];if(G.length>0){let o=await re(e,"Id, DeveloperName, Type","Group","DeveloperName",G,` AND Type IN ${H(["Regular","Queue"])}`);for(let h of o){let t=h.Type;t!=="Regular"&&t!=="Queue"||O.push({id:String(h.Id),name:String(h.DeveloperName),type:t})}ie(G,O.map(h=>h.name)).length>0&&(f.groups=(await e.query(`SELECT DeveloperName FROM Group WHERE Type IN ${H(["Regular","Queue"])}`)).map(h=>String(h.DeveloperName)))}let q=s.some(o=>o.active===!0||o.profile!==void 0)||b||g.some(o=>o.licenseId?.startsWith("100"))?(await e.query("SELECT Id, Name, TotalLicenses, UsedLicenses FROM UserLicense")).map(o=>({id:String(o.Id),name:String(o.Name),total:Number(o.TotalLicenses??0),used:Number(o.UsedLicenses??0)})):[],p=_.length>0||M.length>0||b?(await K(e,"Id, AssigneeId, PermissionSetId, PermissionSetGroupId","PermissionSetAssignment","AssigneeId",w)).map(o=>{let h=x(o.PermissionSetId),t=x(o.PermissionSetGroupId);return{id:String(o.Id),assigneeId:String(o.AssigneeId),...h?{permissionSetId:h}:{},...t?{permissionSetGroupId:t}:{}}}):[],k=G.length>0||b?(await K(e,"Id, GroupId, UserOrGroupId","GroupMember","UserOrGroupId",w)).map(o=>({id:String(o.Id),groupId:String(o.GroupId),userId:String(o.UserOrGroupId)})):[],F=g.some(o=>o.licenseId?.startsWith("0PL"))?(await K(e,"AssigneeId, PermissionSetLicenseId","PermissionSetLicenseAssign","AssigneeId",w)).map(o=>({assigneeId:String(o.AssigneeId),permissionSetLicenseId:String(o.PermissionSetLicenseId)})):[],T=i.flatMap((o,h)=>o.kind==="found"&&s[h]?.email==="restore"&&Q(o.user.email)!==void 0?[o.user]:[]),v=await be(e,T,a.now);return{connected:d,manageUsers:c,resolutions:i,held:N,logins:J,...r?{profiles:r}:{},licenses:q,permissionSets:g,permissionSetGroups:m,groups:O,knownNames:f,assignments:p,memberships:k,licenseAssignments:F,addressesAsked:v,requests:e.requests()-n}}function ge(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function he(e){return[...new Set(e)].sort((s,a)=>s<a?-1:s>a?1:0)}function Le(e,s,a){if(Math.abs(e.length-s.length)>a)return a+1;let n=Array.from({length:s.length+1},(d,c)=>c);for(let d=1;d<=e.length;d+=1){let c=[d];for(let i=1;i<=s.length;i+=1)c[i]=Math.min(n[i]+1,c[i-1]+1,n[i-1]+(e[d-1]===s[i-1]?0:1));n=c}return n[s.length]}function Ue(e){return e.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(s=>s.length>=3)}function ae(e,s){let a=e.toLowerCase(),n=new Set(Ue(e));return he(s.filter(d=>{let c=d.toLowerCase();return c.includes(a)||a.includes(c)||Ue(d).some(i=>n.has(i))||Le(c,a,2)<=2}))}function de(e){let s=e.slice(0,20).join(", ");return e.length>20?`${s}, and ${e.length-20} more`:s}var ue={profile:"change its profile",active:"deactivate it",frozen:"freeze it"};function ke(e,s){return{code:"USERS_NO_RIGHT",message:(s===!1?`${e} cannot manage users here (Manage Users)`:`the org would not say whether ${e} may manage users (Manage Users)`)+": give it Manage Users, or connect as a user who has it"}}function A(e,s){return e!==void 0&&s!==void 0&&E(e)===E(s)}function ce(e){return e.what==="group"?{what:"group",name:e.name,type:e.type??"Regular",to:"removed"}:{what:e.what,name:e.name,to:"removed"}}function Z(){return{assign:[],unassign:[],join:[],leave:[]}}function Be(e,s,a={}){let n=[],d=e.connected;e.manageUsers!==!0&&n.push(ke(d.username,e.manageUsers));let c=a.previous?.users??[],i=r=>c.find(f=>A(f.applied.userId,r)),U=r=>e.profiles?.find(f=>A(f.id,r)),l=r=>e.logins.find(f=>A(f.userId,r)),u=r=>e.assignments.some(f=>A(f.id,r)),S=r=>e.memberships.some(f=>A(f.id,r)),N=(r,f,g,m)=>{let O={isActive:r.isActive,isFrozen:l(r.id)?.isFrozen??!1,profileId:r.profileId},q=f?.applied.before??O;m.current=O,m.before=q,r.licenseId!==void 0&&(m.licenseId=r.licenseId);let p=v=>{if(g[v]!==void 0)return g[v];if(f&&f.after[v]!==f.applied.before[v]&&O[v]===f.after[v])return q[v]},k=p("profileId");k!==void 0&&(m.target.profileId=k,A(k,O.profileId)||(m.writes.profileId=k,m.changes.push({what:"profile",from:r.profileName,to:U(k)?.name??k})));let F=p("isActive");F!==void 0&&(m.target.isActive=F,F!==O.isActive&&(m.writes.isActive=F,m.changes.push({what:"active",from:O.isActive,to:F})));let T=p("isFrozen");if(T!==void 0&&(m.target.isFrozen=T,T!==O.isFrozen)){let v=l(r.id);m.writes.isFrozen=T,v&&(m.writes.loginId=v.id),m.changes.push({what:"frozen",from:O.isFrozen,to:T})}},w=(r,f)=>{for(let g of r)g.what==="group"?S(g.id)&&f.writes.leave.push(g):u(g.id)&&f.writes.unassign.push(g)},P=[],_=new Map;s.forEach((r,f)=>{let g=e.resolutions[f];if(g===void 0||g.kind!=="found"){P.push({given:r.username,username:r.username,inFile:!0,changes:[],emailsToPeople:0,target:{},writes:Z(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]}),g?.kind==="two"?n.push({code:"USERS_TWO_USERS",username:r.username,message:`${r.username} names ${g.usernames.length} users: write the sandbox\u2019s username in full: ${g.usernames.join(" or ")}`}):n.push({code:"USERS_NO_USER",username:r.username,message:`${r.username}: no user has this username, nor this username followed by .<sandbox>: check the username, as Setup > Users gives it, or take it out of the file`});return}let m=g.user,O=_.get(E(m.id));if(O!==void 0){P.push({given:r.username,username:m.username,inFile:!0,changes:[],emailsToPeople:0,target:{},writes:Z(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]}),n.push({code:"USERS_SAME_USER",username:r.username,message:`${r.username} and ${O} name one user, ${m.username}: one entry per user`});return}_.set(E(m.id),r.username);let q=i(m.id),p={given:r.username,username:m.username,userId:m.id,inFile:!0,changes:[],emailsToPeople:0,target:{},writes:Z(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]},k;if(r.profile!==void 0){let t=(e.profiles??[]).filter(R=>R.name===r.profile);if(t.length===1)k=t[0].id;else{let R=(e.profiles??[]).map(z=>z.name),I=ae(r.profile,R);n.push({code:"USERS_PROFILE_UNKNOWN",username:r.username,message:`profile ${r.profile}: `+(t.length===0?"no profile has this name":`${t.length} profiles have this name`)+": profiles are named as Setup > Profiles names them, in the org\u2019s language: "+de(I.length>0?I:he(R))})}}N(m,q,{...k!==void 0?{profileId:k}:{},...r.active!==void 0?{isActive:r.active}:{},...r.frozen!==void 0?{isFrozen:r.frozen}:{}},p);let F=(p.target.profileId!==void 0?U(p.target.profileId)?.licenseId:void 0)??m.licenseId,T=q?.accesses??[],v=(t,R)=>T.find(I=>I.what===t&&I.name.toLowerCase()===R.toLowerCase()),o=(t,R)=>{for(let I of R??[]){let L=(t==="permissionSet"?e.permissionSets.map(y=>({...y,apiName:D(y.name,y.namespace)})):e.permissionSetGroups.map(y=>({...y,licenseId:void 0,apiName:D(y.name,y.namespace)}))).find(y=>y.apiName.toLowerCase()===I.toLowerCase());if(!L){let y=(t==="permissionSet"?e.knownNames.permissionSets:e.knownNames.permissionSetGroups)??[],B=ae(I,y);n.push({code:"USERS_PERMISSION_SET_UNKNOWN",username:r.username,message:(t==="permissionSet"?`permission set ${I}: no permission set has this API name: names are API names (Setup > Permission Sets > API Name)`:`permission set group ${I}: no permission set group has this API name: names are API names (Setup > Permission Set Groups > API Name)`)+(B.length>0?`; close: ${de(B)}`:"")});continue}let V=e.assignments.find(y=>A(y.assigneeId,m.id)&&A(t==="permissionSet"?y.permissionSetId:y.permissionSetGroupId,L.id)),X=v(t,I);if(V){X&&A(X.id,V.id)?p.carried.push(X):p.found.permissionSetAssignments.push(V.id);continue}let W=L.licenseId;if(W?.startsWith("100")&&!A(W,F)){let y=e.licenses.find(B=>A(B.id,W))?.name??W;n.push({code:"USERS_PERMISSION_SET_LICENSE",username:r.username,message:`${m.username}: permission set ${I} needs the license ${y}, which this user will not have: assign the permission set license first, in Setup, or take the set out`});continue}if(W?.startsWith("0PL")&&!e.licenseAssignments.some(y=>A(y.assigneeId,m.id)&&A(y.permissionSetLicenseId,W))){n.push({code:"USERS_PERMISSION_SET_LICENSE",username:r.username,message:`${m.username}: permission set ${I} needs a permission set license this user does not hold: assign the permission set license first, in Setup, or take the set out`});continue}p.writes.assign.push({what:t,name:I,setId:L.id})}};o("permissionSet",r.permissionSets),o("permissionSetGroup",r.permissionSetGroups);for(let t of r.groups??[]){let R=e.groups.find(L=>L.name.toLowerCase()===t.toLowerCase());if(!R){let L=ae(t,e.knownNames.groups??[]);n.push({code:"USERS_GROUP_UNKNOWN",username:r.username,message:`group ${t}: no public group or queue has this API name (DeveloperName)`+(L.length>0?`; close: ${de(L)}`:"")});continue}let I=e.memberships.find(L=>A(L.userId,m.id)&&A(L.groupId,R.id)),z=v("group",t);if(I){z&&A(z.id,I.id)?p.carried.push(z):p.found.groupMembers.push(I.id);continue}p.writes.join.push({name:t,type:R.type,groupId:R.id})}let h=t=>((t.what==="permissionSet"?r.permissionSets:t.what==="permissionSetGroup"?r.permissionSetGroups:r.groups)??[]).some(I=>I.toLowerCase()===t.name.toLowerCase());w(T.filter(t=>!h(t)),p);for(let t of p.writes.assign)p.changes.push({what:t.what,name:t.name,to:"added"});for(let t of p.writes.unassign)p.changes.push(ce(t));for(let t of p.writes.join)p.changes.push({what:"group",name:t.name,type:t.type,to:"added"});for(let t of p.writes.leave)p.changes.push(ce(t));if(r.email==="keep"&&(p.address="kept"),r.email==="restore"){let t=Q(m.email);t===void 0?p.address="restored":e.addressesAsked.includes(E(m.id))?p.address="awaiting":(p.address="invalid",p.writes.email=t,p.emailsToPeople=1,p.changes.push({what:"email",to:"awaiting"}))}P.push(p)});let M=new Set(P.flatMap(r=>r.userId?[E(r.userId)]:[]));for(let r of c){if(M.has(E(r.applied.userId)))continue;let f=e.held.find(m=>A(m.id,r.applied.userId));if(!f)continue;let g={username:f.username,userId:f.id,inFile:!1,changes:[],emailsToPeople:0,target:{},writes:Z(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]};N(f,r,{},g),w(r.accesses,g);for(let m of[...g.writes.unassign,...g.writes.leave])g.changes.push(ce(m));P.push(g)}for(let r of P)r.writes.isFrozen===void 0||r.writes.loginId!==void 0||n.push({code:"USERS_NO_LOGIN",...r.given!==void 0?{username:r.given}:{},message:`${r.username}: the org keeps no login of this user (UserLogin), which a freeze writes`+(r.inFile?`: take frozen off ${r.username}`:"")});for(let r of P){if(!A(r.userId,d.userId))continue;let f=[...r.writes.profileId!==void 0?[ue.profile]:[],...r.writes.isActive===!1?[ue.active]:[],...r.writes.isFrozen===!0?[ue.frozen]:[]];f.length!==0&&n.push({code:"USERS_SELF",...r.given!==void 0?{username:r.given}:{},message:r.inFile?`${r.username} is the user connected, and the file would ${ge(f)}: SandForge would lock itself out: take ${r.username} out of the file, or connect as another`:`${r.username} is the user connected, and putting it back as it was would ${ge(f)}: SandForge would lock itself out: connect as another`})}let G=$e(e,P,n),b=P.reduce((r,f)=>r+f.emailsToPeople,0);b>0&&a.acceptUserEmails!==!0&&n.push({code:"USERS_EMAILS_NOT_ACCEPTED",message:`Salesforce would email ${b} ${b===1?"person":"people"}: the confirmation of each address asked back, a system email, which only the line accepts: --accept-user-emails, once those people may receive them`});let J=a.deliverability==="open"||a.deliverability==="unread";return b>0&&J&&a.acceptEmails!==!0&&n.push({code:"USERS_EMAILS_OPEN",message:(a.deliverability==="unread"?"the org's deliverability could not be read, so it may deliver all email, and ":"the org delivers all email, and ")+`${b} ${b===1?"address":"addresses"} would be asked back before the masking is done: set Setup > Deliverability to System email only until the masking is done, or accept with --accept-emails that what runs there emails these people`}),{users:P,licenses:G,emailsToPeople:b,refusals:n}}function $e(e,s,a){let n=new Map,d=l=>{let u=E(l),S=n.get(u);return S||(S={takesFirst:0,freesFirst:0,takesThen:0,freesThen:0,takers:new Map},n.set(u,S)),S},c=l=>e.profiles?.find(u=>E(u.id)===E(l))?.licenseId,i=(l,u,S)=>{let N=d(l).takers;N.set(u,[...N.get(u)??[],S])};for(let l of s){let u=l.current;if(!u)continue;let S=c(u.profileId)??l.licenseId,N=l.writes.profileId??u.profileId,w=c(N)??S;if(l.writes.profileId!==void 0&&u.isActive&&w!==void 0&&(S===void 0||E(S)!==E(w))){d(w).takesFirst+=1;let P=l.changes.find(_=>_.what==="profile");i(w,`profile: ${P?.what==="profile"?P.to:N}`,l.username),S!==void 0&&(d(S).freesFirst+=1)}w!==void 0&&(l.writes.isActive===!0&&(d(w).takesThen+=1,i(w,"active: true",l.username)),l.writes.isActive===!1&&(d(w).freesThen+=1))}let U=[];for(let l of e.licenses){let u=n.get(E(l.id)),S=u?u.takesFirst+u.takesThen:0;if(!u||S===0)continue;let N=Math.max(0,S-u.freesFirst-u.freesThen),w=l.total-l.used,P=u.takesFirst>w||u.takesThen>w-u.takesFirst+u.freesFirst+u.freesThen;if(U.push({name:l.name,total:l.total,used:l.used,toUse:N}),P){let _=[...u.takers].map(([M,G])=>`${M} off ${G.join(" or ")}`);a.push({code:"USERS_LICENSE",message:`${l.name}: ${l.used} of ${l.total} used, and the file takes ${N} more: deactivate a user who no longer needs it, or take ${_.join(", or ")}`})}}return U}function C(e){return Math.ceil(e/se)}function xe(e){let s=i=>e.users.filter(i).length,a=i=>e.users.reduce((U,l)=>U+i(l),0),n=s(i=>i.writes.join.length>0),d=s(i=>i.writes.isFrozen!==void 0),c=s(i=>i.writes.profileId!==void 0||i.writes.isActive!==void 0||i.writes.isFrozen!==void 0||i.writes.email!==void 0);return C(s(i=>i.writes.profileId!==void 0))+C(s(i=>i.writes.isActive===!1))+C(s(i=>i.writes.isActive===!0))+C(d)+C(a(i=>i.writes.assign.length))+C(a(i=>i.writes.unassign.length))+C(n)+C(a(i=>i.writes.join.length))+C(a(i=>i.writes.leave.length))+C(s(i=>i.writes.email!==void 0))+C(c)+C(d)}function Qe(e,s,a){return{org:s,users:e.users.map(n=>({username:n.username,...n.given!==void 0&&$(n.given)!==$(n.username)?{given:n.given}:{},...n.userId!==void 0?{userId:n.userId}:{},...n.address!==void 0?{address:n.address}:{},changes:n.changes,...n.emailsToPeople>0?{emailsToPeople:n.emailsToPeople}:{}})),...e.licenses.length>0?{licenses:e.licenses}:{},emailsToPeople:e.emailsToPeople,apiRequests:a+xe(e),...e.refusals.length>0?{refusals:e.refusals}:{}}}export{j as a,H as b,Fe as c,Me as d,ye as e,Q as f,E as g,ve as h,ze as i,ke as j,Be as k,Qe as l};
7
+ import{a as ee}from"./chunk-TZE3Y7IQ.mjs";import{b as le}from"./chunk-CA5NAXSU.mjs";import{Cc as Y,pb as $}from"./chunk-J347SPU6.mjs";var se=200;function j(e,s){let a=[];for(let n=0;n<e.length;n+=s)a.push(e.slice(n,n+s));return a}function ne(e){return`'${ee(e)}'`}function H(e){return`(${e.map(ne).join(", ")})`}function me(e){return`'${ee(e).replace(/[%_]/g,a=>`\\${a}`)}.%'`}function Fe(e,s){let a=new Set(s.map(n=>n.toLowerCase()));return e.replace(/[^\s@<>()[\]"',;:]+@[^\s@<>()[\]"',;:]+/g,n=>a.has(n.toLowerCase())?n:"<address>")}function Se(e){let s=e;return typeof s?.errorCode=="string"&&s.errorCode!==""?s.errorCode:typeof s?.name=="string"&&/^[A-Z][A-Z_]+$/.test(s.name)?s.name:"REQUEST_FAILED"}function we(e,s){let a={code:Se(e),message:le(e),fields:[]};return Array.from({length:s},()=>({success:!1,errors:[a]}))}function Ie(e){let s=e;if(s==null)return{success:!1,errors:[{code:"NO_ANSWER",message:"the org answered nothing for it",fields:[]}]};let a=(s.errors??[]).map(d=>({code:typeof d.statusCode=="string"?d.statusCode:typeof d.errorCode=="string"?d.errorCode:"UNKNOWN_ERROR",message:typeof d.message=="string"?d.message:"the org gave no words",fields:Array.isArray(d.fields)?d.fields.filter(c=>typeof c=="string"):[]})),n=s.success===!0;return{...typeof s.id=="string"?{id:s.id}:{},success:n,errors:n||a.length>0?a:[{code:"UNKNOWN_ERROR",message:"the org refused it",fields:[]}]}}function Re(e,s){let a=Array.isArray(e)?e:[e];return Array.from({length:s},(n,d)=>Ie(a[d]))}function Me(e){let s=0,a=async(n,d)=>{let c=[];for(let i of j(n,se)){s+=1;try{c.push(...Re(await d(i),i.length))}catch(U){c.push(...we(U,i.length))}}return c};return{identity:async()=>{s+=1;let n=await e.identity();return{userId:n.user_id,organizationId:n.organization_id,username:n.username}},query:async n=>{s+=1;let d=await e.query(n),c=[...d.records];for(;!d.done&&d.nextRecordsUrl;)s+=1,d=await e.queryMore(d.nextRecordsUrl),c.push(...d.records);return c},update:(n,d)=>a(d,c=>e.sobject(n).update(c,{allOrNone:!1,headers:Y()})),create:(n,d)=>a(d,c=>e.sobject(n).create(c,{allOrNone:!1,headers:Y()})),destroy:(n,d)=>a(d,c=>e.sobject(n).destroy(c,{allOrNone:!1})),requests:()=>s}}var ye=72,Pe=50,Ae=20,Ee=200,Ne=100,fe=".invalid";function Q(e){let s=e.length-fe.length;if(!(s<=0||e.slice(s).toLowerCase()!==fe))return e.slice(0,s)}function E(e){return e.slice(0,15)}function x(e){return typeof e=="string"&&e!==""?e:void 0}var te="Id, Username, Email, IsActive, ProfileId, Profile.Name, Profile.UserLicenseId";function oe(e){let s=e.Profile??void 0,a=x(s?.UserLicenseId);return{id:String(e.Id),username:String(e.Username),isActive:e.IsActive===!0,profileId:String(e.ProfileId),profileName:x(s?.Name)??String(e.ProfileId),...a?{licenseId:a}:{},email:x(e.Email)??""}}function pe(e){let s=e.indexOf("__");return s>0&&!e.slice(s+2).includes("__")?{namespace:e.slice(0,s),own:e.slice(s+2)}:{own:e}}function D(e,s){return s?`${s}__${e}`:e}async function Oe(e,s){let a=new Map,n=[...new Map(s.map(i=>[$(i),i])).values()];for(let i of j(n,Pe)){let U=await e.query(`SELECT ${te} FROM User WHERE Username IN ${H(i)}`);for(let l of U){let u=oe(l);a.set($(u.username),u)}}let d=n.filter(i=>!a.has($(i))),c=new Map;for(let i of j(d,Ae)){let U=i.map(u=>`Username LIKE ${me(u)}`).join(" OR "),l=(await e.query(`SELECT ${te} FROM User WHERE ${U}`)).map(oe);for(let u of i){let S=`${$(u)}.`,N=[...new Map(l.filter(w=>$(w.username).startsWith(S)).map(w=>[w.id,w])).values()];c.set($(u),N)}}return s.map(i=>{let U=a.get($(i));if(U)return{given:i,kind:"found",user:U};let l=c.get($(i))??[];return l.length===1?{given:i,kind:"found",user:l[0]}:l.length===0?{given:i,kind:"none"}:{given:i,kind:"two",usernames:l.map(u=>u.username).sort((u,S)=>u<S?-1:u>S?1:0)}})}async function K(e,s,a,n,d,c=""){let i=[];for(let U of j([...new Set(d)],Ee))i.push(...await e.query(`SELECT ${s} FROM ${a} WHERE ${n} IN ${H(U)}${c}`));return i}async function re(e,s,a,n,d,c=""){let i=[];for(let U of j([...new Set(d)],Ne))i.push(...await e.query(`SELECT ${s} FROM ${a} WHERE ${n} IN ${H(U)}${c}`));return i}async function ve(e){try{let[s]=await e.query("SELECT PermissionsManageUsers FROM UserPermissionAccess"),a=s?.PermissionsManageUsers;return typeof a=="boolean"?a:void 0}catch{return}}function ie(e,s){let a=new Set(s.map(n=>n.toLowerCase()));return e.filter(n=>!a.has(n.toLowerCase()))}async function be(e,s,a){if(s.length===0)return[];let n=new Date(a.getTime()-ye*36e5).toISOString().replace(/\.\d{3}Z$/,"Z"),d;try{d=await e.query(`SELECT Display, CreatedDate FROM SetupAuditTrail WHERE Action = ${ne("useremailchangesent")} AND CreatedDate >= ${n}`)}catch{return[]}let c=d.map(i=>(x(i.Display)??"").trim().toLowerCase());return s.filter(i=>{let U=Q(i.email)?.toLowerCase();if(U===void 0)return!1;let l=`[${E(i.id).toLowerCase()}]`;return c.some(u=>u.includes(l)&&u.endsWith(` ${U}`))}).map(i=>E(i.id))}async function ze(e,s,a){let n=e.requests(),d=await e.identity(),c=await ve(e),i=await Oe(e,s.map(o=>o.username)),U=i.flatMap(o=>o.kind==="found"?[o.user]:[]),l=new Set(U.map(o=>E(o.id))),u=a.previous?.users??[],S=u.map(o=>o.applied.userId).filter(o=>!l.has(E(o))),N=(await K(e,te,"User","Id",S)).map(oe),w=[...U,...N].map(o=>o.id),P=o=>[...new Map(s.flatMap(h=>o(h)??[]).map(h=>[h.toLowerCase(),h])).values()],_=P(o=>o.permissionSets),M=P(o=>o.permissionSetGroups),G=P(o=>o.groups),b=u.length>0,J=s.some(o=>o.frozen!==void 0)||b?(await K(e,"Id, UserId, IsFrozen","UserLogin","UserId",w)).map(o=>({id:String(o.Id),userId:String(o.UserId),isFrozen:o.IsFrozen===!0})):[],r=s.some(o=>o.profile!==void 0)||b?(await e.query("SELECT Id, Name, UserLicenseId FROM Profile")).map(o=>{let h=x(o.UserLicenseId);return{id:String(o.Id),name:String(o.Name),...h?{licenseId:h}:{}}}):void 0,f={},g=[];if(_.length>0){let o=await re(e,"Id, Name, NamespacePrefix, LicenseId","PermissionSet","Name",_.map(t=>pe(t).own)," AND IsOwnedByProfile = false");for(let t of o){let R=x(t.NamespacePrefix),I=x(t.LicenseId);g.push({id:String(t.Id),name:String(t.Name),...R?{namespace:R}:{},...I?{licenseId:I}:{}})}let h=g.map(t=>D(t.name,t.namespace));ie(_,h).length>0&&(f.permissionSets=(await e.query("SELECT Name, NamespacePrefix FROM PermissionSet WHERE IsOwnedByProfile = false")).map(t=>D(String(t.Name),x(t.NamespacePrefix))))}let m=[];if(M.length>0){let o=await re(e,"Id, DeveloperName, NamespacePrefix","PermissionSetGroup","DeveloperName",M.map(t=>pe(t).own));for(let t of o){let R=x(t.NamespacePrefix);m.push({id:String(t.Id),name:String(t.DeveloperName),...R?{namespace:R}:{}})}let h=m.map(t=>D(t.name,t.namespace));ie(M,h).length>0&&(f.permissionSetGroups=(await e.query("SELECT DeveloperName, NamespacePrefix FROM PermissionSetGroup")).map(t=>D(String(t.DeveloperName),x(t.NamespacePrefix))))}let O=[];if(G.length>0){let o=await re(e,"Id, DeveloperName, Type","Group","DeveloperName",G,` AND Type IN ${H(["Regular","Queue"])}`);for(let h of o){let t=h.Type;t!=="Regular"&&t!=="Queue"||O.push({id:String(h.Id),name:String(h.DeveloperName),type:t})}ie(G,O.map(h=>h.name)).length>0&&(f.groups=(await e.query(`SELECT DeveloperName FROM Group WHERE Type IN ${H(["Regular","Queue"])}`)).map(h=>String(h.DeveloperName)))}let q=s.some(o=>o.active===!0||o.profile!==void 0)||b||g.some(o=>o.licenseId?.startsWith("100"))?(await e.query("SELECT Id, Name, TotalLicenses, UsedLicenses FROM UserLicense")).map(o=>({id:String(o.Id),name:String(o.Name),total:Number(o.TotalLicenses??0),used:Number(o.UsedLicenses??0)})):[],p=_.length>0||M.length>0||b?(await K(e,"Id, AssigneeId, PermissionSetId, PermissionSetGroupId","PermissionSetAssignment","AssigneeId",w)).map(o=>{let h=x(o.PermissionSetId),t=x(o.PermissionSetGroupId);return{id:String(o.Id),assigneeId:String(o.AssigneeId),...h?{permissionSetId:h}:{},...t?{permissionSetGroupId:t}:{}}}):[],k=G.length>0||b?(await K(e,"Id, GroupId, UserOrGroupId","GroupMember","UserOrGroupId",w)).map(o=>({id:String(o.Id),groupId:String(o.GroupId),userId:String(o.UserOrGroupId)})):[],F=g.some(o=>o.licenseId?.startsWith("0PL"))?(await K(e,"AssigneeId, PermissionSetLicenseId","PermissionSetLicenseAssign","AssigneeId",w)).map(o=>({assigneeId:String(o.AssigneeId),permissionSetLicenseId:String(o.PermissionSetLicenseId)})):[],T=i.flatMap((o,h)=>o.kind==="found"&&s[h]?.email==="restore"&&Q(o.user.email)!==void 0?[o.user]:[]),v=await be(e,T,a.now);return{connected:d,manageUsers:c,resolutions:i,held:N,logins:J,...r?{profiles:r}:{},licenses:q,permissionSets:g,permissionSetGroups:m,groups:O,knownNames:f,assignments:p,memberships:k,licenseAssignments:F,addressesAsked:v,requests:e.requests()-n}}function ge(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function he(e){return[...new Set(e)].sort((s,a)=>s<a?-1:s>a?1:0)}function Le(e,s,a){if(Math.abs(e.length-s.length)>a)return a+1;let n=Array.from({length:s.length+1},(d,c)=>c);for(let d=1;d<=e.length;d+=1){let c=[d];for(let i=1;i<=s.length;i+=1)c[i]=Math.min(n[i]+1,c[i-1]+1,n[i-1]+(e[d-1]===s[i-1]?0:1));n=c}return n[s.length]}function Ue(e){return e.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(s=>s.length>=3)}function ae(e,s){let a=e.toLowerCase(),n=new Set(Ue(e));return he(s.filter(d=>{let c=d.toLowerCase();return c.includes(a)||a.includes(c)||Ue(d).some(i=>n.has(i))||Le(c,a,2)<=2}))}function de(e){let s=e.slice(0,20).join(", ");return e.length>20?`${s}, and ${e.length-20} more`:s}var ue={profile:"change its profile",active:"deactivate it",frozen:"freeze it"};function ke(e,s){return{code:"USERS_NO_RIGHT",message:(s===!1?`${e} cannot manage users here (Manage Users)`:`the org would not say whether ${e} may manage users (Manage Users)`)+": give it Manage Users, or connect as a user who has it"}}function A(e,s){return e!==void 0&&s!==void 0&&E(e)===E(s)}function ce(e){return e.what==="group"?{what:"group",name:e.name,type:e.type??"Regular",to:"removed"}:{what:e.what,name:e.name,to:"removed"}}function Z(){return{assign:[],unassign:[],join:[],leave:[]}}function Be(e,s,a={}){let n=[],d=e.connected;e.manageUsers!==!0&&n.push(ke(d.username,e.manageUsers));let c=a.previous?.users??[],i=r=>c.find(f=>A(f.applied.userId,r)),U=r=>e.profiles?.find(f=>A(f.id,r)),l=r=>e.logins.find(f=>A(f.userId,r)),u=r=>e.assignments.some(f=>A(f.id,r)),S=r=>e.memberships.some(f=>A(f.id,r)),N=(r,f,g,m)=>{let O={isActive:r.isActive,isFrozen:l(r.id)?.isFrozen??!1,profileId:r.profileId},q=f?.applied.before??O;m.current=O,m.before=q,r.licenseId!==void 0&&(m.licenseId=r.licenseId);let p=v=>{if(g[v]!==void 0)return g[v];if(f&&f.after[v]!==f.applied.before[v]&&O[v]===f.after[v])return q[v]},k=p("profileId");k!==void 0&&(m.target.profileId=k,A(k,O.profileId)||(m.writes.profileId=k,m.changes.push({what:"profile",from:r.profileName,to:U(k)?.name??k})));let F=p("isActive");F!==void 0&&(m.target.isActive=F,F!==O.isActive&&(m.writes.isActive=F,m.changes.push({what:"active",from:O.isActive,to:F})));let T=p("isFrozen");if(T!==void 0&&(m.target.isFrozen=T,T!==O.isFrozen)){let v=l(r.id);m.writes.isFrozen=T,v&&(m.writes.loginId=v.id),m.changes.push({what:"frozen",from:O.isFrozen,to:T})}},w=(r,f)=>{for(let g of r)g.what==="group"?S(g.id)&&f.writes.leave.push(g):u(g.id)&&f.writes.unassign.push(g)},P=[],_=new Map;s.forEach((r,f)=>{let g=e.resolutions[f];if(g===void 0||g.kind!=="found"){P.push({given:r.username,username:r.username,inFile:!0,changes:[],emailsToPeople:0,target:{},writes:Z(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]}),g?.kind==="two"?n.push({code:"USERS_TWO_USERS",username:r.username,message:`${r.username} names ${g.usernames.length} users: write the sandbox\u2019s username in full: ${g.usernames.join(" or ")}`}):n.push({code:"USERS_NO_USER",username:r.username,message:`${r.username}: no user has this username, nor this username followed by .<sandbox>: check the username, as Setup > Users gives it, or take it out of the file`});return}let m=g.user,O=_.get(E(m.id));if(O!==void 0){P.push({given:r.username,username:m.username,inFile:!0,changes:[],emailsToPeople:0,target:{},writes:Z(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]}),n.push({code:"USERS_SAME_USER",username:r.username,message:`${r.username} and ${O} name one user, ${m.username}: one entry per user`});return}_.set(E(m.id),r.username);let q=i(m.id),p={given:r.username,username:m.username,userId:m.id,inFile:!0,changes:[],emailsToPeople:0,target:{},writes:Z(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]},k;if(r.profile!==void 0){let t=(e.profiles??[]).filter(R=>R.name===r.profile);if(t.length===1)k=t[0].id;else{let R=(e.profiles??[]).map(z=>z.name),I=ae(r.profile,R);n.push({code:"USERS_PROFILE_UNKNOWN",username:r.username,message:`profile ${r.profile}: `+(t.length===0?"no profile has this name":`${t.length} profiles have this name`)+": profiles are named as Setup > Profiles names them, in the org\u2019s language: "+de(I.length>0?I:he(R))})}}N(m,q,{...k!==void 0?{profileId:k}:{},...r.active!==void 0?{isActive:r.active}:{},...r.frozen!==void 0?{isFrozen:r.frozen}:{}},p);let F=(p.target.profileId!==void 0?U(p.target.profileId)?.licenseId:void 0)??m.licenseId,T=q?.accesses??[],v=(t,R)=>T.find(I=>I.what===t&&I.name.toLowerCase()===R.toLowerCase()),o=(t,R)=>{for(let I of R??[]){let L=(t==="permissionSet"?e.permissionSets.map(y=>({...y,apiName:D(y.name,y.namespace)})):e.permissionSetGroups.map(y=>({...y,licenseId:void 0,apiName:D(y.name,y.namespace)}))).find(y=>y.apiName.toLowerCase()===I.toLowerCase());if(!L){let y=(t==="permissionSet"?e.knownNames.permissionSets:e.knownNames.permissionSetGroups)??[],B=ae(I,y);n.push({code:"USERS_PERMISSION_SET_UNKNOWN",username:r.username,message:(t==="permissionSet"?`permission set ${I}: no permission set has this API name: names are API names (Setup > Permission Sets > API Name)`:`permission set group ${I}: no permission set group has this API name: names are API names (Setup > Permission Set Groups > API Name)`)+(B.length>0?`; close: ${de(B)}`:"")});continue}let V=e.assignments.find(y=>A(y.assigneeId,m.id)&&A(t==="permissionSet"?y.permissionSetId:y.permissionSetGroupId,L.id)),X=v(t,I);if(V){X&&A(X.id,V.id)?p.carried.push(X):p.found.permissionSetAssignments.push(V.id);continue}let W=L.licenseId;if(W?.startsWith("100")&&!A(W,F)){let y=e.licenses.find(B=>A(B.id,W))?.name??W;n.push({code:"USERS_PERMISSION_SET_LICENSE",username:r.username,message:`${m.username}: permission set ${I} needs the license ${y}, which this user will not have: assign the permission set license first, in Setup, or take the set out`});continue}if(W?.startsWith("0PL")&&!e.licenseAssignments.some(y=>A(y.assigneeId,m.id)&&A(y.permissionSetLicenseId,W))){n.push({code:"USERS_PERMISSION_SET_LICENSE",username:r.username,message:`${m.username}: permission set ${I} needs a permission set license this user does not hold: assign the permission set license first, in Setup, or take the set out`});continue}p.writes.assign.push({what:t,name:I,setId:L.id})}};o("permissionSet",r.permissionSets),o("permissionSetGroup",r.permissionSetGroups);for(let t of r.groups??[]){let R=e.groups.find(L=>L.name.toLowerCase()===t.toLowerCase());if(!R){let L=ae(t,e.knownNames.groups??[]);n.push({code:"USERS_GROUP_UNKNOWN",username:r.username,message:`group ${t}: no public group or queue has this API name (DeveloperName)`+(L.length>0?`; close: ${de(L)}`:"")});continue}let I=e.memberships.find(L=>A(L.userId,m.id)&&A(L.groupId,R.id)),z=v("group",t);if(I){z&&A(z.id,I.id)?p.carried.push(z):p.found.groupMembers.push(I.id);continue}p.writes.join.push({name:t,type:R.type,groupId:R.id})}let h=t=>((t.what==="permissionSet"?r.permissionSets:t.what==="permissionSetGroup"?r.permissionSetGroups:r.groups)??[]).some(I=>I.toLowerCase()===t.name.toLowerCase());w(T.filter(t=>!h(t)),p);for(let t of p.writes.assign)p.changes.push({what:t.what,name:t.name,to:"added"});for(let t of p.writes.unassign)p.changes.push(ce(t));for(let t of p.writes.join)p.changes.push({what:"group",name:t.name,type:t.type,to:"added"});for(let t of p.writes.leave)p.changes.push(ce(t));if(r.email==="keep"&&(p.address="kept"),r.email==="restore"){let t=Q(m.email);t===void 0?p.address="restored":e.addressesAsked.includes(E(m.id))?p.address="awaiting":(p.address="invalid",p.writes.email=t,p.emailsToPeople=1,p.changes.push({what:"email",to:"awaiting"}))}P.push(p)});let M=new Set(P.flatMap(r=>r.userId?[E(r.userId)]:[]));for(let r of c){if(M.has(E(r.applied.userId)))continue;let f=e.held.find(m=>A(m.id,r.applied.userId));if(!f)continue;let g={username:f.username,userId:f.id,inFile:!1,changes:[],emailsToPeople:0,target:{},writes:Z(),found:{permissionSetAssignments:[],groupMembers:[]},carried:[]};N(f,r,{},g),w(r.accesses,g);for(let m of[...g.writes.unassign,...g.writes.leave])g.changes.push(ce(m));P.push(g)}for(let r of P)r.writes.isFrozen===void 0||r.writes.loginId!==void 0||n.push({code:"USERS_NO_LOGIN",...r.given!==void 0?{username:r.given}:{},message:`${r.username}: the org keeps no login of this user (UserLogin), which a freeze writes`+(r.inFile?`: take frozen off ${r.username}`:"")});for(let r of P){if(!A(r.userId,d.userId))continue;let f=[...r.writes.profileId!==void 0?[ue.profile]:[],...r.writes.isActive===!1?[ue.active]:[],...r.writes.isFrozen===!0?[ue.frozen]:[]];f.length!==0&&n.push({code:"USERS_SELF",...r.given!==void 0?{username:r.given}:{},message:r.inFile?`${r.username} is the user connected, and the file would ${ge(f)}: SandForge would lock itself out: take ${r.username} out of the file, or connect as another`:`${r.username} is the user connected, and putting it back as it was would ${ge(f)}: SandForge would lock itself out: connect as another`})}let G=$e(e,P,n),b=P.reduce((r,f)=>r+f.emailsToPeople,0);b>0&&a.acceptUserEmails!==!0&&n.push({code:"USERS_EMAILS_NOT_ACCEPTED",message:`Salesforce would email ${b} ${b===1?"person":"people"}: the confirmation of each address asked back, a system email, which only the line accepts: --accept-user-emails, once those people may receive them`});let J=a.deliverability==="open"||a.deliverability==="unread";return b>0&&J&&a.acceptEmails!==!0&&n.push({code:"USERS_EMAILS_OPEN",message:(a.deliverability==="unread"?"the org's deliverability could not be read, so it may deliver all email, and ":"the org delivers all email, and ")+`${b} ${b===1?"address":"addresses"} would be asked back before the masking is done: set Setup > Deliverability to System email only until the masking is done, or accept with --accept-emails that what runs there emails these people`}),{users:P,licenses:G,emailsToPeople:b,refusals:n}}function $e(e,s,a){let n=new Map,d=l=>{let u=E(l),S=n.get(u);return S||(S={takesFirst:0,freesFirst:0,takesThen:0,freesThen:0,takers:new Map},n.set(u,S)),S},c=l=>e.profiles?.find(u=>E(u.id)===E(l))?.licenseId,i=(l,u,S)=>{let N=d(l).takers;N.set(u,[...N.get(u)??[],S])};for(let l of s){let u=l.current;if(!u)continue;let S=c(u.profileId)??l.licenseId,N=l.writes.profileId??u.profileId,w=c(N)??S;if(l.writes.profileId!==void 0&&u.isActive&&w!==void 0&&(S===void 0||E(S)!==E(w))){d(w).takesFirst+=1;let P=l.changes.find(_=>_.what==="profile");i(w,`profile: ${P?.what==="profile"?P.to:N}`,l.username),S!==void 0&&(d(S).freesFirst+=1)}w!==void 0&&(l.writes.isActive===!0&&(d(w).takesThen+=1,i(w,"active: true",l.username)),l.writes.isActive===!1&&(d(w).freesThen+=1))}let U=[];for(let l of e.licenses){let u=n.get(E(l.id)),S=u?u.takesFirst+u.takesThen:0;if(!u||S===0)continue;let N=Math.max(0,S-u.freesFirst-u.freesThen),w=l.total-l.used,P=u.takesFirst>w||u.takesThen>w-u.takesFirst+u.freesFirst+u.freesThen;if(U.push({name:l.name,total:l.total,used:l.used,toUse:N}),P){let _=[...u.takers].map(([M,G])=>`${M} off ${G.join(" or ")}`);a.push({code:"USERS_LICENSE",message:`${l.name}: ${l.used} of ${l.total} used, and the file takes ${N} more: deactivate a user who no longer needs it, or take ${_.join(", or ")}`})}}return U}function C(e){return Math.ceil(e/se)}function xe(e){let s=i=>e.users.filter(i).length,a=i=>e.users.reduce((U,l)=>U+i(l),0),n=s(i=>i.writes.join.length>0),d=s(i=>i.writes.isFrozen!==void 0),c=s(i=>i.writes.profileId!==void 0||i.writes.isActive!==void 0||i.writes.isFrozen!==void 0||i.writes.email!==void 0);return C(s(i=>i.writes.profileId!==void 0))+C(s(i=>i.writes.isActive===!1))+C(s(i=>i.writes.isActive===!0))+C(d)+C(a(i=>i.writes.assign.length))+C(a(i=>i.writes.unassign.length))+C(n)+C(a(i=>i.writes.join.length))+C(a(i=>i.writes.leave.length))+C(s(i=>i.writes.email!==void 0))+C(c)+C(d)}function Qe(e,s,a){return{org:s,users:e.users.map(n=>({username:n.username,...n.given!==void 0&&$(n.given)!==$(n.username)?{given:n.given}:{},...n.userId!==void 0?{userId:n.userId}:{},...n.address!==void 0?{address:n.address}:{},changes:n.changes,...n.emailsToPeople>0?{emailsToPeople:n.emailsToPeople}:{}})),...e.licenses.length>0?{licenses:e.licenses}:{},emailsToPeople:e.emailsToPeople,apiRequests:a+xe(e),...e.refusals.length>0?{refusals:e.refusals}:{}}}export{j as a,H as b,Fe as c,Me as d,ye as e,Q as f,E as g,ve as h,ze as i,ke as j,Be as k,Qe as l};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{c as je,d as Be,e as Pe,f as Fe,p as xe,q as Le,t as _e,x as ze}from"./chunk-O6FHK6NQ.mjs";import{m as We}from"./chunk-GFB2DNCB.mjs";import{f as Me}from"./chunk-JFXQZPRY.mjs";import{b as De,f as Te}from"./chunk-BBZUGKBZ.mjs";import{b as Ee}from"./chunk-BLMJ4WVI.mjs";import{i as we,j as ke,k as ye,l as be,m as Re,p as Ae,q as Oe}from"./chunk-CL75DEMQ.mjs";import{E as Ue,F as Ie,G as $e,H as ve}from"./chunk-7O6EFNQS.mjs";import{B as ge}from"./chunk-3LRFPGYZ.mjs";import{a as le,b as fe}from"./chunk-YDXMTWAT.mjs";import{i as Ce,j as Se}from"./chunk-DLSU66MY.mjs";import{b as ue,d as ce}from"./chunk-GP5J3DGS.mjs";import{c as me}from"./chunk-ZVU7MD2S.mjs";import{k as pe,q as he,vc as Ne}from"./chunk-OLCS7JCT.mjs";import{g as L,h as _,q as de}from"./chunk-DAUX63UB.mjs";import{b as x}from"./chunk-CA5NAXSU.mjs";import{ae as se,ie as F}from"./chunk-J347SPU6.mjs";var C=class extends Error{constructor(){super("The undo was stopped before it wrote anything to the org."),this.name="UndoStopped"}},z="No record was written.",Ye="accept that it runs to undo the rewind all the same";function Ge(e){return e.slice(0,15)}function Qe(e){return{query:n=>e.query(n),queryMore:n=>e.queryMore(n)}}function Xe(e,n,t){if(e.kind==="org")return;let d=e.userKey;if(n.users.some(a=>a.slice(0,15)!==d))return{code:"PERMISSIONS",message:`This rewind was made as another user than ${t}: what it deleted is that user's deletion in the recycle bin, which Salesforce brings back only for a user with View All Data and Modify All Data. Undo it as the user it was made as, or as a user with View All Data and Modify All Data. ${z}`};let r=n.objects.flatMap(a=>{let f=e.notHeld.get(a);return f===void 0?[]:[`${a}: ${f}`]});if(r.length!==0)return{code:"PERMISSIONS",message:`Undo takes back what the rewind did to objects ${t} no longer holds whole (${r.join("; ")}), and does not stop part way: an undo left part way could not be offered again. Undo it once the user has View All and Modify All on them again, or as a user with View All Data and Modify All Data. ${z}`}}function Ze(e,n){return{undone:!1,refusal:{code:e,message:n}}}function et(e,n){return{code:"RUN_WRITING",message:`${n.operation==="take"?`A checkpoint of ${e} is being taken`:n.operation==="rewind"?`A rewind is writing to ${e}`:n.operation==="undo"?`An undo is writing to ${e}`:`SandForge is deleting checkpoints of ${e}`} (process ${n.pid} on ${n.host}): undo the rewind once it has ended. No record was read or written.`}}function tt(e,n,t,d){let r=F(n,t),a=[...new Set(r.map(b=>b.objectApiName))],f=(t.setToDraft??[]).length>0?", sets an order back to Draft":"",h=r.length>0?`${Me(r)} flow(s), trigger(s) or rule(s) of ${a.join(", ")} run as the undo brings records back, gives them their values back${f} or sends them back to the recycle bin`:"what runs as the undo writes could not all be read, so automation may run";return{code:"AUTOMATION",message:`${e}: ${h}. ${ye("undo",d)}Undo refused; ${Ye}. ${z}`}}async function nt(e,n){let t=0,d=0;for await(let r of n.bringBack.pages(L)){t+=r.length;for(let a of ce(r,ue)){let f=await e.queryDeleted(`SELECT Id, ContentSize FROM ${L} WHERE Id IN (${a}) AND IsDeleted = true`);for(let h of f.records)typeof h.ContentSize=="number"&&(d+=h.ContentSize)}}return{files:t,bytes:d}}function ot(e,n){return e.status==="cancelled"||e.status==="failure"?e.status:n.some(t=>t.reason==="changedDuringRewind")?"unstable":e.status}function rt(e,n){return e.map(t=>{if(t.reason==="notBack")return{objectApiName:t.objectApiName,reason:"notBack",count:t.count,ids:[...t.ids],...t.message!==void 0?{message:t.message}:{}};let d=Object.keys(t.by).filter(a=>!n.has(Ge(a)));if(d.length===0)return{objectApiName:t.objectApiName,reason:"automation",count:t.count,ids:[...t.ids]};let r=d.length===1&&d[0]!=="unknown"?d[0]:void 0;return{objectApiName:t.objectApiName,reason:"changedDuringRewind",...r!==void 0?{by:r}:{},count:t.count,ids:[...t.ids]}})}async function St(e,n){let{checkpoint:t,folder:d,orgName:r,rewindId:a}=n,f=e.signal,h=()=>f?.aborted===!0,b=(U,k)=>e.onProgress?.({percentage:U,step:k}),c=ze(e.org,e.undelete),D,S=await Ee(Qe(c.org),{act:"undo",orgName:r,registered:n.registered,username:n.username,organizationId:t.org.organizationId,customSettings:de(t)},{userId:async()=>D=await c.org.userId()});if(!S.allowed)return{undone:!1,refusal:S.refusal};let R=e.store.lock(t.org.organizationId,"undo",t.checkpointId);if("busy"in R)return{undone:!1,refusal:et(r,R.busy)};try{let U=await e.runWriting?.(S.org.id);if(U!==void 0)return Ze("RUN_WRITING",U);let k=await Ie(c.org,r);if(h())throw new C;b(5,"Reading what the rewind did");let l=await Be(d,a,t.objects),G=Pe(l),qe=l.goesWithParent.objects,T=new Map;for(let{objectApiName:o,count:i}of[...l.bringBack.objects,...l.comesWithParent.objects])i>0&&T.set(o,(T.get(o)??0)+i);let He=l.remade.keys.size>0?"Sending back to the recycle bin what the rewind brought back, and deleting again what it made again":"Sending back to the recycle bin what the rewind brought back",I=o=>o.filter(i=>i.count>0).map(i=>i.objectApiName),M=l.links,q=o=>o>0?[_]:[],j=l.remade.objects.filter(({objectApiName:o,count:i})=>i>0&&ge([o]).length>0),m={bringBack:I(l.bringBack.objects),giveBack:[...I(l.giveBack.objects),...q(M?.share.count??0)],...j.length>0?{setToDraft:I(j)}:{},delete:[...new Set([...I(l.remove.objects),...q(M?.remove.count??0)])],...(M?.reinsert.count??0)>0?{recreate:[_]}:{}},H;try{H=await nt(c.org,l)}finally{await l.dispose()}let V=ve("undo",H,k.fileStorage?.remaining,r);if(V)return{undone:!1,refusal:V};let w=[...new Set([...m.bringBack??[],...m.giveBack??[],...m.setToDraft??[],...m.delete??[],...m.recreate??[]])],B;try{B=await De({grants:S.grants,...D!==void 0?{userId:D}:{},username:n.username,checkpoint:t,reader:Se(c.org,f)})}catch(o){throw o instanceof Ce||h()?new C:o}if(B.kind==="perObject"){let o=await je(d,a),i=Xe(B,{users:o.passes.map(g=>g.userId),objects:w},n.username);if(i)return{undone:!1,refusal:i}}let u;if(w.length>0&&e.readAutomation){try{u=await e.readAutomation(w)}catch(o){u=_e(w,x(o))}c.add(u.requests)}let $=u,y=w.length>0?await xe(e.mute,u,m):{},v="refusal"in y?y:void 0,J="refusal"in y?void 0:y.mute;y.automation&&(u=y.automation);let A=v?v.plan:J?.plan,K=n.acceptEmails===!0,p=w.length>0&&$?await Ae({act:"undo",orgName:r,automation:$,steps:m,...A?{plan:A}:{},accepted:K,mayMute:e.mute===void 0&&n.canMute===!0,read:()=>me(c.org)}):void 0,Y=we(G,[],j),Q=u?ke(Y,u):void 0,O=v?[v.refusal]:[];u&&!n.acceptAutomation&&(F(u,m).length>0||se(u.unread)||Q!==void 0)&&O.push(tt(r,u,m,Q));let X=Ue({objects:t.objects,rewound:G,along:qe,automationRequests:0}),Z=Ne(p?.ofRun),ee=$e("undo",{run:c.used()-(Z.deliverability??0)+X.apiRequests,...Z,...he(A)},k,r);w.length>0&&ee&&O.push(ee);let te=u?Re("undo",be(Y,u,k.emails),r):void 0;w.length>0&&te&&O.push(te),p?.refusal&&O.push(p.refusal);let[ne,...oe]=O;if(ne)return{undone:!1,refusal:ne,...oe.length>0?{alsoRefused:oe}:{}};if(h())throw new C;let Ve=await c.org.userId(),Je=new Set(Te(t.takenBy,Ve).map(Ge));e.onWriting?.([...T].map(([o,i])=>({objectApiName:o,records:i}))),b(20,"Bringing back what the rewind deleted and giving back what it wrote over");let P,E;try{E=await Le(J,`undo ${t.checkpointId} ${a}`,o=>{let i=o&&A&&$&&p?Oe({act:"undo",orgName:r,automation:$,steps:m,plan:A,held:o.outcome,planned:p.ofRun.senders,...p.ofRun.read?{reading:p.ofRun.read.reading}:{},accepted:K}):void 0;return i?Promise.resolve({relit:i}):Fe({folder:d,rewindId:a,lock:R.lock,objects:t.objects,org:c.org,undelete:c.undelete,splitting:le(fe(k.remaining,c.used()+X.apiRequests)),...f?{signal:f}:{},...e.onUndeletable?{onUndeletable:e.onUndeletable}:{},onProgress:(g,ae,Ke)=>b(20+Math.round(70*g/Math.max(ae,1)),`${He}: ${Ke} ${g} / ${ae}`)})},o=>{P=o})}catch(o){if(!pe(o))throw o;return{undone:!1,refusal:{code:"MUTE",message:`${o.message} No record was written.`}}}if("relit"in E)return{undone:!1,refusal:E.relit};let s=E,re=rt(s.residual,Je),N=ot(s,re),W=[...s.notes];if(N!=="cancelled"&&N!=="failure"){let o=(e.now??(()=>new Date))().toISOString();try{await e.store.update(t.checkpointId,g=>g.lastRewind?.rewindId===a?{...g,lastRewind:{...g.lastRewind,undoneAt:o}}:g)}catch(g){W.push(`The checkpoint could not be told the rewind was undone (${x(g)}): its list may still offer to undo it.`)}let i=await We({folder:d,lock:R.lock,checkpoint:t,rewindId:a,status:N,undoneAt:o});i!==void 0&&W.push(i)}let ie=c.used();return{undone:!0,result:{checkpointId:t.checkpointId,rewindId:a,status:N,deleted:s.deleted,...s.remade?{remade:s.remade}:{},...s.carriedAlone?{carriedAlone:s.carriedAlone}:{},...s.wentAlong?{wentAlong:s.wentAlong}:{},...s.cameBackAlong?{cameBackAlong:s.cameBackAlong}:{},restored:s.restored,undeleted:s.undeleted,...s.files?{files:s.files}:{},residual:re,passes:1,apiRequests:{used:ie,leftToday:Math.max(0,k.remaining-ie)},finishedAt:s.finishedAt,...P?{mutedAutomation:P}:{}},notes:W,...p?.gate.audit!==void 0?{deliverability:p.gate.audit}:{}}}finally{R.lock.release()}}export{C as a,Ye as b,St as c};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{a,b,c,d,e,f,g}from"./chunk-IAB5H7WN.mjs";import"./chunk-ALWVNR34.mjs";import"./chunk-AVY742BJ.mjs";import"./chunk-EGL3I3IX.mjs";import"./chunk-CSMGP53U.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-YDXMTWAT.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-35B73566.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-TYUYPFDJ.mjs";import"./chunk-OLCS7JCT.mjs";import"./chunk-TQ6HEJ73.mjs";import"./chunk-65AMXOQU.mjs";import"./chunk-6HHSAPIM.mjs";import"./chunk-K5PUMHZU.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-EUIALBMX.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-Q7TLC3I2.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-ATBQIE2V.mjs";import"./chunk-UCUFLFNK.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-DAUX63UB.mjs";import"./chunk-SZOJ7BEJ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-22L43JMK.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-J347SPU6.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{e as liftWords,a as planRulesReadsOver,f as planValidationRuleLines,d as planValidationRulesFor,c as planValidationRulesOf,b as readPlanValidationRules,g as refusedByRuleLine};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{a as n,b as p,h as a}from"./chunk-BWWQXU2B.mjs";import{a as o}from"./chunk-EADHKH3A.mjs";import{q as d}from"./chunk-Z354SAEF.mjs";var R=`SELECT Id FROM RecordType WHERE SobjectType = '${d}' AND IsPersonType = true`;async function S(i,t){let[y,c]=await Promise.all([o(i,n).then(({records:e})=>p(e)),o(t,n).then(({records:e})=>p(e))]),r;try{let{records:e}=await o(t,R);r=new Set(e.flatMap(s=>typeof s.Id=="string"?[s.Id.slice(0,15)]:[]))}catch{r=void 0}return{mappings:new a().buildMapping(y,c),source:y,target:c,...r?{personTypes:r}:{}}}export{S as a};
7
+ import{a as n,b as p,h as a}from"./chunk-BWWQXU2B.mjs";import{a as o}from"./chunk-EADHKH3A.mjs";import{q as d}from"./chunk-SZOJ7BEJ.mjs";var R=`SELECT Id FROM RecordType WHERE SobjectType = '${d}' AND IsPersonType = true`;async function S(i,t){let[y,c]=await Promise.all([o(i,n).then(({records:e})=>p(e)),o(t,n).then(({records:e})=>p(e))]),r;try{let{records:e}=await o(t,R);r=new Set(e.flatMap(s=>typeof s.Id=="string"?[s.Id.slice(0,15)]:[]))}catch{r=void 0}return{mappings:new a().buildMapping(y,c),source:y,target:c,...r?{personTypes:r}:{}}}export{S as a};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{a as O,f as dt,h as C}from"./chunk-TZE3Y7IQ.mjs";import{Oc as at}from"./chunk-CRPLDXJU.mjs";var It="AccountContactRelation",v="EmailMessage",J="Task",Q="TaskRelation",q="EventRelation",j=200,en={ProductSellingModel:["SellingModelType","PricingTerm","PricingTermUnit"]},rn={objectApiName:"FeedItem",field:"Type",value:"CreateRecordEvent",parent:"ParentId"},Z={FeedItem:[{field:"Type",value:"TrackedChange",noun:"tracked change"}],[Q]:[{field:"IsWhat",value:!0,noun:"what relation",from:"the task's WhatId"}],[q]:[{field:"IsWhat",value:!0,noun:"what relation",from:"the event's WhatId"}],EmailMessageRelation:[{noun:"email relation",from:"the email's addresses"}]};function Et(t,n){return Z[t]?.find(e=>e.field===void 0||e.value!==void 0&&String(n[e.field])===String(e.value))}var ut=class{constructor(n=Et){this.rowsOf=n}rowsOf;reasons=new Map;byObject=new Map;leaveOut(n,e,r,o=[]){let i=this.reasons.get(e);if(i)return i;let s=this.reasonFor(n,r,o);if(!s)return;this.reasons.set(e,s);let d=this.byObject.get(n)??new Map,u=`${s.rows.field}=${s.rows.value}|${s.through??""}`,l=d.get(u)??{why:s,ids:new Set};return l.ids.add(e),d.set(u,l),this.byObject.set(n,d),s}keep(n,e,r=[]){return e.filter(o=>!this.leaveOut(n,String(o.Id),o,r))}has(n){return this.reasons.has(n)}counts(n){return(n===void 0?[...this.byObject]:[[n,this.byObject.get(n)]]).flatMap(([r,o])=>[...o?.values()??[]].map(({why:i,ids:s})=>({objectApiName:r,why:i,count:s.size})))}reasonFor(n,e,r){let o=this.rowsOf(n,e);if(o)return{rows:o};for(let i of r){let s=e[i],d=typeof s=="string"?this.reasons.get(s):void 0;if(d)return{rows:d.rows,through:i}}}};function on(t,n){if(n.through)return`${t} left out: ${n.through} names a ${n.rows.noun}, which the platform writes itself`;let e=n.rows.from?`, from ${n.rows.from}`:"";return`${t} ${n.rows.noun}${t===1?"":"s"} left out: the platform writes them itself${e}`}function sn(t,n){let e=`${t} record${t===1?"":"s"}`;return n.through?`${n.through} \u2192 ${n.rows.noun} (${e})`:n.rows.field===void 0?`every ${n.rows.noun} (${e})`:`${n.rows.field}=${String(n.rows.value)} (${e})`}function an(t){return t.through?`Not written: ${t.through} may not be left empty, and the ${t.rows.noun} it names is one the platform writes itself, which no copy sends.`:t.rows.from?`Not written: the platform writes each ${t.rows.noun} itself, from ${t.rows.from}.`:`Not written: the platform writes each ${t.rows.noun} itself, and refuses one a copy sends.`}function ct({field:t,value:n},e){if(t===void 0)return e==="="?"Id != null":"Id = null";let r=typeof n=="boolean"?String(n):`'${O(n??"")}'`;return`${C(t)} ${e} ${r}`}function dn(t,n,e){let r=s=>s.map(d=>ct(d,"=")).join(" OR "),o=(Z[t]??[]).map(s=>ct(s,"!=")),i=n.flatMap(s=>s.referenceTo.flatMap(d=>{let u=Z[d];if(d===t||!e.has(d)||!u||u.length===0)return[];let l=e.get(d),I=l?`(${dt(l)}) AND (${r(u)})`:`(${r(u)})`;return[`${C(s.name)} NOT IN (SELECT Id FROM ${C(d)} WHERE ${I})`]}));return[...o,...i]}var $t={[Q]:new Set(["Contact","Lead"]),[q]:new Set(["Contact","Lead","User","Calendar"])};function un(t,n,e){let r=$t[t];if(!r)return n;let o=n.IsWhat;return o!==""&&o!==null&&o!==void 0||e===void 0||r.has(e)?n:{...n,IsWhat:!0}}var Ct="500";function Pt(t){return t.startsWith(Ct)?"Case":void 0}function ht(t,n=Pt){let e=t.ParentId;if(typeof e=="string"&&e!=="")return!0;let r=t.RelatedToId;return typeof r=="string"&&r!==""&&n(r)==="Case"}function cn(t,n){return t===v&&!ht(n)?["ActivityId"]:[]}function fn(t){return!t.has(v)||!t.has(J)?[]:[{sourceObject:v,targetObject:J,relationshipName:`${v}Before${J}`,type:"lookup",required:!0}]}function ln(t,n){let e=t.ActivityId;return typeof e=="string"&&e!==""&&ht(t,n)}var S=200;async function gn(t,n){let e=new Map;for(let r=0;r<n.length;r+=S){let o=n.slice(r,r+S).map(s=>`'${O(s)}'`).join(", "),i=await t(`SELECT Id, ActivityId FROM ${v} WHERE Id IN (${o})`);for(let s of i){let d=s.ActivityId;typeof s.Id=="string"&&typeof d=="string"&&d!==""&&e.set(s.Id,d)}}return e}var N="Account",B="Contact",Y="PersonContactId",mt="IsPersonAccount";function kt(t){let n=t[mt];return n===!0||n==="true"||n===1}function pn(t,n){return kt(t)?n?"personAsBusiness":"person":"business"}function yn(t,n){return t==="person"?n==="person":n!=="person"}function Rn(t,n){return!t.has(N)||!t.has(B)?[]:n.get(N)?.some(r=>r.name===Y)===!0||n.get(B)?.some(r=>r.name===mt)===!0?[{sourceObject:N,targetObject:B,relationshipName:`${N}Before${B}`,type:"lookup",required:!0}]:[]}function Mt(t){let n=t.map(e=>`'${O(e)}'`).join(", ");return`SELECT Id, ${Y} FROM ${N} WHERE Id IN (${n})`}var At=new RegExp(`^SELECT Id, ${Y} FROM ${N} WHERE Id IN \\((.*)\\)$`);function wn(t){let n=At.exec(t);if(n)return[...n[1].matchAll(/'([^']*)'/g)].map(([,e])=>e)}async function In(t,n){let e=new Map;for(let r=0;r<n.length;r+=S){let o=await t(Mt(n.slice(r,r+S)));for(let i of o){let s=i[Y];typeof i.Id=="string"&&typeof s=="string"&&s!==""&&e.set(i.Id,s)}}return e}var D="OpportunityTeamMember",M="OpportunitySplit",Lt="Opportunity",tt="OpportunitySplitType",$="SplitTypeId",nt={[D]:"UserId",[M]:"SplitOwnerId"};function hn(t){return nt[t]!==void 0}function mn(t){return t==="Task"?"their email":t==="Contact"?"their person account":t===It?"their contact":t===Q?"their task":t===q?"their event":t===Ot?"their opportunity, for its contact":"their opportunity, for its owner"}var Ot="OpportunityContactRole",G="ContactId",ft=t=>t.IsPrimary===!0||t.IsPrimary==="true";function Nt(t,n){let e=new Map;return t.forEach((r,o)=>{let i=w(r,"OpportunityId"),s=w(r,G);if(i===void 0||s===void 0)return;let d=n(i);if(d===void 0||y(d)!==y(s))return;let u=y(i),l=e.get(u);(l===void 0||!ft(t[l])&&ft(r))&&e.set(u,o)}),[...e.values()].sort((r,o)=>r-o)}var lt=["CreatedDate","CreatedById","Opportunity.CreatedDate","Opportunity.CreatedById"];function xt(t,n=[]){let e=["Id","OpportunityId",G],r=[...e,...lt];return`SELECT ${[...e,...lt,...n.filter(i=>!r.includes(i)).map(C)].join(", ")} FROM ${Ot} WHERE OpportunityId IN ${et(t)} ORDER BY CreatedDate, Id`}var bt=/^SELECT Id, OpportunityId, ContactId, CreatedDate, CreatedById, Opportunity\.CreatedDate, Opportunity\.CreatedById((?:, \w+)*) FROM OpportunityContactRole WHERE OpportunityId IN (\(.*\)) ORDER BY CreatedDate, Id$/;function On(t){let n=bt.exec(t);if(!n)return;let[,e,r]=n;return{fields:e.split(", ").filter(o=>o!==""),opportunities:rt(r)}}async function _t(t,n,e=[]){let r=[];for(let o=0;o<n.length;o+=S)r.push(...await t(xt(n.slice(o,o+S),e)));return r}var Ft=1,gt=t=>typeof t=="string"&&t!==""?Math.floor(Date.parse(t)/1e3):Number.NaN;function Wt(t){let n=t.Opportunity;if(typeof n!="object"||n===null)return!1;let e=n,r=w(t,"CreatedById"),o=w(e,"CreatedById"),i=gt(t.CreatedDate),s=gt(e.CreatedDate);return r!==void 0&&o!==void 0&&y(r)===y(o)&&!Number.isNaN(i)&&!Number.isNaN(s)&&i-s>=0&&i-s<=Ft}function vt(t,n){let e=new Map;for(let i of n){let s=w(i,"Id"),d=w(i,"OpportunityId"),u=w(i,G);if(!s||!d||!u||!Wt(i))continue;let l=`${y(d)}:${y(u)}`;e.set(l,[...e.get(l)??[],i])}let r=new Map,o=[];for(let[i,{opportunity:s,contact:d}]of t){let u=e.get(`${y(s)}:${y(d)}`)??[];u.length>1?o.push(i):u.length===1&&r.set(i,u[0])}return{found:r,alike:o}}function Tn(t,n="read"){return`${t} contact role(s) not linked to the one the platform wrote with their opportunity, so written as ${n}: the target holds more than one role of their contact under it made with it, within a second, by the same user, and nothing tells which the platform wrote. The opportunity holds the role of its contact more than once.`}var Dt="the user the run writes as";function Sn(t,n){let e={CreatedDate:n,CreatedById:Dt};return{...t,...e,Opportunity:{...e}}}async function En(t,n,e,r=[]){let o=Nt(n,e);if(o.length===0)return{found:new Map,alike:[]};let i=new Map(o.map(d=>[d,{opportunity:String(n[d].OpportunityId),contact:String(n[d][G])}])),s=await _t(t,[...new Set([...i.values()].map(({opportunity:d})=>d))],r);return vt(i,s)}function $n(t){return!t.has(D)||!t.has(M)?[]:[{sourceObject:D,targetObject:M,relationshipName:`${D}Before${M}`,type:"lookup",required:!0}]}var Ut={[D]:{TeamMemberRole:"Opportunity Owner",OpportunityAccessLevel:"All"},[M]:{}},pt=t=>!/__c$/i.test(t),qt=new Set(["SplitPercentage","SplitAmount","CurrencyIsoCode"]),U=`SELECT Id, OwnerId FROM ${Lt} WHERE Id IN `,Kt=`SELECT Id, DeveloperName, IsTotalValidated FROM ${tt} WHERE IsActive = true`,et=t=>`(${t.map(n=>`'${O(n)}'`).join(", ")})`,rt=t=>[...t.matchAll(/'([^']*)'/g)].map(([,n])=>n);function Cn(t){return`${U}${et(t)}`}function Pn(t){if(!t.startsWith(U))return;let n=t.slice(U.length);return/^\(.*\)$/.test(n)?rt(n):void 0}function Tt(t,n){let e=nt[t];return`SELECT ${["Id","OpportunityId",...t===M?[e,$]:[e],...n].join(", ")} FROM ${t} WHERE OpportunityId IN `}function kn(t,n,e){return`${Tt(t,n)}${et(e)}`}var Ht=/^SELECT Id, OpportunityId, (?:UserId|SplitOwnerId, SplitTypeId)((?:, \w+)*) FROM (OpportunityTeamMember|OpportunitySplit) WHERE OpportunityId IN (\(.*\))$/;function Mn(t){let n=Ht.exec(t);if(!n)return;let[,e,r,o]=n;return{objectApiName:r,fields:e.split(", ").filter(i=>i!==""),opportunities:rt(o)}}var y=t=>t.slice(0,15);async function W(t,n,e){let r=[];for(let o=0;o<e.length;o+=S){let i=e.slice(o,o+S).map(s=>`'${O(s)}'`).join(", ");r.push(...await t(`${n}(${i})`))}return r}function X(t,n){let e=new Map;for(let r of t){let o=r[n];typeof r.Id=="string"&&typeof o=="string"&&o!==""&&e.set(y(r.Id),o)}return e}var w=(t,n)=>{let e=t[n];return typeof e=="string"&&e!==""?e:void 0};async function An(t,n,e){let r={lookups:new Map,linked:new Map,held:new Map,defaulted:new Set},o=nt[t];if(o===void 0)return r;let i=t===M,s=n.filter(a=>{let f=w(a,"OpportunityId");return f!==void 0&&e.targetIdOf(f)!==void 0});if(s.length===0)return r;let d=[...new Set(s.map(a=>String(a.OpportunityId)))],u=X(await W(e.source,U,d),"OwnerId"),l=a=>e.targetIdOf(String(a.OpportunityId)),I=[...new Set(s.map(l))],{simulated:T}=e,x=T?void 0:X(await W(e.target,U,I),"OwnerId"),b=a=>{let f=u.get(y(String(a.OpportunityId)));return f===void 0?{}:{source:f,target:T?T.ownerOf(f):x?.get(y(l(a)))}},_=a=>{let f=w(a,o),R=b(a).source;return f!==void 0&&R!==void 0&&y(f)===y(R)},A=[...new Set(s.flatMap(a=>{let f=w(a,o);return f===void 0||_(a)||e.mappedUser(f)!==void 0?[]:[f]}))],K=A.length>0?new Set((await W(e.target,"SELECT Id FROM User WHERE IsActive = true AND Id IN ",A)).flatMap(a=>typeof a.Id=="string"?[y(a.Id)]:[])):new Set,H=i?X(await W(e.source,`SELECT Id, DeveloperName FROM ${tt} WHERE Id IN `,[...new Set(s.flatMap(a=>w(a,$)??[]))]),"DeveloperName"):new Map,F=new Map;if(i)for(let a of await e.target(Kt))typeof a.Id=="string"&&typeof a.DeveloperName=="string"&&F.set(a.DeveloperName,{id:a.Id,total:a.IsTotalValidated===!0||a.IsTotalValidated==="true"});let c=(e.written??[]).filter(a=>a!=="Id"&&a!=="OpportunityId"&&a!==o&&a!==$&&!qt.has(a)),g=(a,f)=>{let R=a[f];return!(R==null||R===""||R===!1)},p=(a,f,R=c)=>R.filter(P=>g(a,P)&&String(a[P])!==String(f[P]??"")),m=new Map,h=(a,f,R)=>[a,f,R??""].map(y).join("|");if(!T)for(let a of await W(e.target,Tt(t,c),I)){let f=w(a,"OpportunityId"),R=w(a,o);typeof a.Id!="string"||f===void 0||R===void 0||m.set(h(f,R,i?w(a,$):void 0),a)}for(let a of s){let f=w(a,o);if(f===void 0)continue;let R=_(a),P=b(a).target,L=R?P:e.mappedUser(f)??(K.has(y(f))?f:void 0),ot=!R&&L===void 0&&e.defaultUser!==void 0;if(ot&&(L=e.defaultUser),L===void 0){r.held.set(a,{field:o,parentObject:"User",why:R?`${o} names the owner of its opportunity, whose owner in the target could not be read.`:`${o} names a user the target has no counterpart of: a team member and a split go in for the opportunity's owner, which is the owner of its copy in the target, for a user an owner mapping gives, or for a user of the same id the target holds active.`});continue}let V={[o]:L},it=!1;if(i){let E=w(a,$);if(E!==void 0){let k=H.get(y(E)),z=k===void 0?void 0:F.get(k);if(z===void 0){r.held.set(a,{field:$,parentObject:tt,why:`${$} names ${k===void 0?"a split type":`the split type ${k}`}, which the target holds no active one of by that name: sent without it, the split would go in as one of the Revenue type.`});continue}V[$]=z.id,it=z.total}}let St=l(a),st=P!==void 0&&y(L)===y(P);if(T){if(st&&(!i||it)){let E=c.filter(k=>!pt(k)&&g(a,k));r.linked.set(a,{id:T.idFor(),owners:!0,notKept:p(a,Ut[t]??{},c.filter(pt)),...E.length>0?{unread:E}:{}});continue}}else{let E=m.get(h(St,L,V[$]));if(E!==void 0){r.linked.set(a,{id:String(E.Id),owners:st,notKept:p(a,E)});continue}}r.lookups.set(a,V),ot&&r.defaulted.add(a)}return r}var Bt={[Q]:"TaskId",[q]:"EventId"};async function Ln(t,n,e){let r=new Map,o=Bt[n];if(o===void 0)return r;let i=[...new Set(e.map(d=>d[o]).filter(d=>typeof d=="string"&&d!==""))];if(i.length===0)return r;let s=new Map;for(let d=0;d<i.length;d+=S){let u=i.slice(d,d+S).map(I=>`'${O(I)}'`).join(", "),l=await t(`SELECT Id, ${o}, RelationId FROM ${n} WHERE ${o} IN (${u})`);for(let I of l)typeof I.Id=="string"&&s.set(`${String(I[o])}|${String(I.RelationId)}`,I.Id)}return e.forEach((d,u)=>{let l=s.get(`${String(d[o])}|${String(d.RelationId)}`);l&&r.set(u,l)}),r}var jt={[q]:["IsInvitee"]},yt={IsInvitee:["Status","Response","RespondedDate"]},Rt="the run was cancelled before it was updated";async function Nn(t,n,e,r,o=()=>!1){return Qt(await Yt(t,n,e,r,o))}function Qt(t){if(!(t===void 0||t.size===0))return[...t].map(([n,e])=>`${e} linked without ${n}`).join(", ")}function xn(t,n){if(n.size===0)return t;let e=new Map(t??[]);for(let[r,o]of n)e.set(r,(e.get(r)??0)+o);return e}async function Yt(t,n,e,r,o=()=>!1){let i=jt[t]??[],s=new Set(i.flatMap(c=>[c,...yt[c]??[]]).filter(c=>!e(c))),d=new Map,u=(c,g)=>{let p=`${c}: ${g}`;d.set(p,(d.get(p)??0)+1)},l=[];for(let[c,g]of n){let p={},m={};for(let h of i.filter(a=>String(c[a])==="true")){if(s.has(h)){u(h,"the target does not let it be updated");continue}p[h]=!0;for(let a of yt[h]??[]){let f=c[a];f==null||f===""||(s.has(a)?u(a,"the target does not let it be updated"):m[a]=f)}}Object.keys(p).length>0&&l.push({Id:g,flagsGiven:p,answer:m})}let I=!1,T=async c=>{let g=new Map;if(c.length===0)return g;if(o()){for(let h of c)g.set(h.Id,Rt);return g}if(I)return g;let p=await r(c);I=p.length<c.length;let m=o();return c.forEach((h,a)=>{let f=p[a];f?.success||g.set(h.Id,f===void 0&&m?Rt:`the target refused the update, ${f?.errors[0]??"without saying why"}`)}),g},x=(c,g)=>{for(let p of c){let m=g.get(p.Id);if(m!==void 0)for(let h of Object.keys(p).filter(a=>a!=="Id"))u(h,m)}},b=l.map(({Id:c,flagsGiven:g,answer:p})=>({Id:c,...g,...p})),_=await T(b),A=I||o()?[]:l.filter(({Id:c,answer:g})=>_.has(c)&&Object.keys(g).length>0);x(b.filter(c=>!A.some(({Id:g})=>g===c.Id)),_);let K=A.map(({Id:c,flagsGiven:g})=>({Id:c,...g})),H=await T(K);x(K,H);let F=A.filter(({Id:c})=>!H.has(c));for(let c of new Set(F.flatMap(({answer:g})=>Object.keys(g)))){let g=F.filter(({answer:p})=>c in p).map(({Id:p,answer:m})=>({Id:p,[c]:m[c]}));x(g,await T(g))}return d}var bn={Order:"OrderStatus",Contract:"ContractStatus"},_n=new Set(["Contract"]);function Gt(t){return t==null||t===""?"null":typeof t=="number"||typeof t=="boolean"?String(t):`'${O(String(t))}'`}async function Fn(t,n){let e=new Map,r=[...new Set(n.map(i=>i.ContactId).filter(i=>typeof i=="string"&&i!==""))];if(r.length===0)return e;let o=new Map;for(let i=0;i<r.length;i+=j){let s=r.slice(i,i+j).map(u=>`'${O(u)}'`).join(", "),d=await t(`SELECT Id, AccountId, ContactId FROM ${It} WHERE IsDirect = true AND ContactId IN (${s})`);for(let u of d)typeof u.Id=="string"&&o.set(`${String(u.AccountId)}|${String(u.ContactId)}`,u.Id)}return n.forEach((i,s)=>{let d=o.get(`${String(i.AccountId)}|${String(i.ContactId)}`);d&&e.set(s,d)}),e}async function Wn(t,n){let e=new Set;for(let r=0;r<n.length;r+=j){let o=n.slice(r,r+j).map(s=>`'${O(s)}'`).join(", "),i=await t(`SELECT Id FROM PricebookEntry WHERE Id IN (${o}) AND Pricebook2.IsStandard = true`);for(let s of i)typeof s.Id=="string"&&e.add(s.Id)}return e}var wt=200;async function vn(t,n){let e=new Map,r=[...new Set(n.map(i=>i.Product2Id).filter(i=>typeof i=="string"&&i!==""))];if(r.length===0)return e;let o=new Map;for(let i=0;i<r.length;i+=wt){let s=r.slice(i,i+wt).map(u=>`'${O(u)}'`).join(", "),d=await t(`SELECT Id, Product2Id, ProductSellingModelId FROM ${at} WHERE Product2Id IN (${s})`);for(let u of d)typeof u.Id=="string"&&o.set(`${String(u.Product2Id)}|${String(u.ProductSellingModelId)}`,u.Id)}return n.forEach((i,s)=>{let d=o.get(`${String(i.Product2Id)}|${String(i.ProductSellingModelId)}`);d&&e.set(s,d)}),e}async function Dn(t,n,e,r){let o=new Map;for(let i of r){let s=JSON.stringify(e.map(l=>i[l]??null));if(o.has(s))continue;let d=e.map(l=>`${C(l)} = ${Gt(i[l])}`).join(" AND "),u=await t(`SELECT Id FROM ${C(n)} WHERE ${d} LIMIT 2`);o.set(s,u.length===1&&typeof u[0].Id=="string"?u[0].Id:void 0)}return r.map(i=>o.get(JSON.stringify(e.map(s=>i[s]??null))))}async function Un(t,n){let e;try{e=await t(`SELECT ApiName, StatusCode FROM ${C(n)}`)}catch{return}return{categoryOf:new Map(e.map(r=>[String(r.ApiName),String(r.StatusCode)])),draft:e.filter(r=>r.StatusCode==="Draft").map(r=>String(r.ApiName)).sort()[0]}}function qn(t,n){if(typeof t!="string"||t===""||!n.draft)return;let e=n.categoryOf.get(t);if(!(e===void 0||e==="Draft"))return n.draft}export{It as a,v as b,J as c,en as d,rn as e,ut as f,on as g,sn as h,an as i,dn as j,un as k,ht as l,cn as m,fn as n,ln as o,gn as p,N as q,B as r,Y as s,kt as t,pn as u,yn as v,Rn as w,Mt as x,wn as y,In as z,D as A,M as B,nt as C,hn as D,mn as E,Ot as F,G,ft as H,Nt as I,xt as J,On as K,_t as L,vt as M,Tn as N,Sn as O,En as P,$n as Q,Ut as R,Kt as S,Cn as T,Pn as U,kn as V,Mn as W,An as X,Bt as Y,Ln as Z,jt as _,Nn as $,Qt as aa,xn as ba,Yt as ca,bn as da,_n as ea,Fn as fa,Wn as ga,vn as ha,Dn as ia,Un as ja,qn as ka};
7
+ import{a as O,f as dt,h as C}from"./chunk-TZE3Y7IQ.mjs";import{Vc as at}from"./chunk-J347SPU6.mjs";var It="AccountContactRelation",v="EmailMessage",J="Task",Q="TaskRelation",q="EventRelation",j=200,en={ProductSellingModel:["SellingModelType","PricingTerm","PricingTermUnit"]},rn={objectApiName:"FeedItem",field:"Type",value:"CreateRecordEvent",parent:"ParentId"},Z={FeedItem:[{field:"Type",value:"TrackedChange",noun:"tracked change"}],[Q]:[{field:"IsWhat",value:!0,noun:"what relation",from:"the task's WhatId"}],[q]:[{field:"IsWhat",value:!0,noun:"what relation",from:"the event's WhatId"}],EmailMessageRelation:[{noun:"email relation",from:"the email's addresses"}]};function Et(t,n){return Z[t]?.find(e=>e.field===void 0||e.value!==void 0&&String(n[e.field])===String(e.value))}var ut=class{constructor(n=Et){this.rowsOf=n}rowsOf;reasons=new Map;byObject=new Map;leaveOut(n,e,r,o=[]){let i=this.reasons.get(e);if(i)return i;let s=this.reasonFor(n,r,o);if(!s)return;this.reasons.set(e,s);let d=this.byObject.get(n)??new Map,u=`${s.rows.field}=${s.rows.value}|${s.through??""}`,l=d.get(u)??{why:s,ids:new Set};return l.ids.add(e),d.set(u,l),this.byObject.set(n,d),s}keep(n,e,r=[]){return e.filter(o=>!this.leaveOut(n,String(o.Id),o,r))}has(n){return this.reasons.has(n)}counts(n){return(n===void 0?[...this.byObject]:[[n,this.byObject.get(n)]]).flatMap(([r,o])=>[...o?.values()??[]].map(({why:i,ids:s})=>({objectApiName:r,why:i,count:s.size})))}reasonFor(n,e,r){let o=this.rowsOf(n,e);if(o)return{rows:o};for(let i of r){let s=e[i],d=typeof s=="string"?this.reasons.get(s):void 0;if(d)return{rows:d.rows,through:i}}}};function on(t,n){if(n.through)return`${t} left out: ${n.through} names a ${n.rows.noun}, which the platform writes itself`;let e=n.rows.from?`, from ${n.rows.from}`:"";return`${t} ${n.rows.noun}${t===1?"":"s"} left out: the platform writes them itself${e}`}function sn(t,n){let e=`${t} record${t===1?"":"s"}`;return n.through?`${n.through} \u2192 ${n.rows.noun} (${e})`:n.rows.field===void 0?`every ${n.rows.noun} (${e})`:`${n.rows.field}=${String(n.rows.value)} (${e})`}function an(t){return t.through?`Not written: ${t.through} may not be left empty, and the ${t.rows.noun} it names is one the platform writes itself, which no copy sends.`:t.rows.from?`Not written: the platform writes each ${t.rows.noun} itself, from ${t.rows.from}.`:`Not written: the platform writes each ${t.rows.noun} itself, and refuses one a copy sends.`}function ct({field:t,value:n},e){if(t===void 0)return e==="="?"Id != null":"Id = null";let r=typeof n=="boolean"?String(n):`'${O(n??"")}'`;return`${C(t)} ${e} ${r}`}function dn(t,n,e){let r=s=>s.map(d=>ct(d,"=")).join(" OR "),o=(Z[t]??[]).map(s=>ct(s,"!=")),i=n.flatMap(s=>s.referenceTo.flatMap(d=>{let u=Z[d];if(d===t||!e.has(d)||!u||u.length===0)return[];let l=e.get(d),I=l?`(${dt(l)}) AND (${r(u)})`:`(${r(u)})`;return[`${C(s.name)} NOT IN (SELECT Id FROM ${C(d)} WHERE ${I})`]}));return[...o,...i]}var $t={[Q]:new Set(["Contact","Lead"]),[q]:new Set(["Contact","Lead","User","Calendar"])};function un(t,n,e){let r=$t[t];if(!r)return n;let o=n.IsWhat;return o!==""&&o!==null&&o!==void 0||e===void 0||r.has(e)?n:{...n,IsWhat:!0}}var Ct="500";function Pt(t){return t.startsWith(Ct)?"Case":void 0}function ht(t,n=Pt){let e=t.ParentId;if(typeof e=="string"&&e!=="")return!0;let r=t.RelatedToId;return typeof r=="string"&&r!==""&&n(r)==="Case"}function cn(t,n){return t===v&&!ht(n)?["ActivityId"]:[]}function fn(t){return!t.has(v)||!t.has(J)?[]:[{sourceObject:v,targetObject:J,relationshipName:`${v}Before${J}`,type:"lookup",required:!0}]}function ln(t,n){let e=t.ActivityId;return typeof e=="string"&&e!==""&&ht(t,n)}var S=200;async function gn(t,n){let e=new Map;for(let r=0;r<n.length;r+=S){let o=n.slice(r,r+S).map(s=>`'${O(s)}'`).join(", "),i=await t(`SELECT Id, ActivityId FROM ${v} WHERE Id IN (${o})`);for(let s of i){let d=s.ActivityId;typeof s.Id=="string"&&typeof d=="string"&&d!==""&&e.set(s.Id,d)}}return e}var N="Account",B="Contact",Y="PersonContactId",mt="IsPersonAccount";function kt(t){let n=t[mt];return n===!0||n==="true"||n===1}function pn(t,n){return kt(t)?n?"personAsBusiness":"person":"business"}function yn(t,n){return t==="person"?n==="person":n!=="person"}function Rn(t,n){return!t.has(N)||!t.has(B)?[]:n.get(N)?.some(r=>r.name===Y)===!0||n.get(B)?.some(r=>r.name===mt)===!0?[{sourceObject:N,targetObject:B,relationshipName:`${N}Before${B}`,type:"lookup",required:!0}]:[]}function Mt(t){let n=t.map(e=>`'${O(e)}'`).join(", ");return`SELECT Id, ${Y} FROM ${N} WHERE Id IN (${n})`}var At=new RegExp(`^SELECT Id, ${Y} FROM ${N} WHERE Id IN \\((.*)\\)$`);function wn(t){let n=At.exec(t);if(n)return[...n[1].matchAll(/'([^']*)'/g)].map(([,e])=>e)}async function In(t,n){let e=new Map;for(let r=0;r<n.length;r+=S){let o=await t(Mt(n.slice(r,r+S)));for(let i of o){let s=i[Y];typeof i.Id=="string"&&typeof s=="string"&&s!==""&&e.set(i.Id,s)}}return e}var D="OpportunityTeamMember",M="OpportunitySplit",Lt="Opportunity",tt="OpportunitySplitType",$="SplitTypeId",nt={[D]:"UserId",[M]:"SplitOwnerId"};function hn(t){return nt[t]!==void 0}function mn(t){return t==="Task"?"their email":t==="Contact"?"their person account":t===It?"their contact":t===Q?"their task":t===q?"their event":t===Ot?"their opportunity, for its contact":"their opportunity, for its owner"}var Ot="OpportunityContactRole",G="ContactId",ft=t=>t.IsPrimary===!0||t.IsPrimary==="true";function Nt(t,n){let e=new Map;return t.forEach((r,o)=>{let i=w(r,"OpportunityId"),s=w(r,G);if(i===void 0||s===void 0)return;let d=n(i);if(d===void 0||y(d)!==y(s))return;let u=y(i),l=e.get(u);(l===void 0||!ft(t[l])&&ft(r))&&e.set(u,o)}),[...e.values()].sort((r,o)=>r-o)}var lt=["CreatedDate","CreatedById","Opportunity.CreatedDate","Opportunity.CreatedById"];function xt(t,n=[]){let e=["Id","OpportunityId",G],r=[...e,...lt];return`SELECT ${[...e,...lt,...n.filter(i=>!r.includes(i)).map(C)].join(", ")} FROM ${Ot} WHERE OpportunityId IN ${et(t)} ORDER BY CreatedDate, Id`}var bt=/^SELECT Id, OpportunityId, ContactId, CreatedDate, CreatedById, Opportunity\.CreatedDate, Opportunity\.CreatedById((?:, \w+)*) FROM OpportunityContactRole WHERE OpportunityId IN (\(.*\)) ORDER BY CreatedDate, Id$/;function On(t){let n=bt.exec(t);if(!n)return;let[,e,r]=n;return{fields:e.split(", ").filter(o=>o!==""),opportunities:rt(r)}}async function _t(t,n,e=[]){let r=[];for(let o=0;o<n.length;o+=S)r.push(...await t(xt(n.slice(o,o+S),e)));return r}var Ft=1,gt=t=>typeof t=="string"&&t!==""?Math.floor(Date.parse(t)/1e3):Number.NaN;function Wt(t){let n=t.Opportunity;if(typeof n!="object"||n===null)return!1;let e=n,r=w(t,"CreatedById"),o=w(e,"CreatedById"),i=gt(t.CreatedDate),s=gt(e.CreatedDate);return r!==void 0&&o!==void 0&&y(r)===y(o)&&!Number.isNaN(i)&&!Number.isNaN(s)&&i-s>=0&&i-s<=Ft}function vt(t,n){let e=new Map;for(let i of n){let s=w(i,"Id"),d=w(i,"OpportunityId"),u=w(i,G);if(!s||!d||!u||!Wt(i))continue;let l=`${y(d)}:${y(u)}`;e.set(l,[...e.get(l)??[],i])}let r=new Map,o=[];for(let[i,{opportunity:s,contact:d}]of t){let u=e.get(`${y(s)}:${y(d)}`)??[];u.length>1?o.push(i):u.length===1&&r.set(i,u[0])}return{found:r,alike:o}}function Tn(t,n="read"){return`${t} contact role(s) not linked to the one the platform wrote with their opportunity, so written as ${n}: the target holds more than one role of their contact under it made with it, within a second, by the same user, and nothing tells which the platform wrote. The opportunity holds the role of its contact more than once.`}var Dt="the user the run writes as";function Sn(t,n){let e={CreatedDate:n,CreatedById:Dt};return{...t,...e,Opportunity:{...e}}}async function En(t,n,e,r=[]){let o=Nt(n,e);if(o.length===0)return{found:new Map,alike:[]};let i=new Map(o.map(d=>[d,{opportunity:String(n[d].OpportunityId),contact:String(n[d][G])}])),s=await _t(t,[...new Set([...i.values()].map(({opportunity:d})=>d))],r);return vt(i,s)}function $n(t){return!t.has(D)||!t.has(M)?[]:[{sourceObject:D,targetObject:M,relationshipName:`${D}Before${M}`,type:"lookup",required:!0}]}var Ut={[D]:{TeamMemberRole:"Opportunity Owner",OpportunityAccessLevel:"All"},[M]:{}},pt=t=>!/__c$/i.test(t),qt=new Set(["SplitPercentage","SplitAmount","CurrencyIsoCode"]),U=`SELECT Id, OwnerId FROM ${Lt} WHERE Id IN `,Kt=`SELECT Id, DeveloperName, IsTotalValidated FROM ${tt} WHERE IsActive = true`,et=t=>`(${t.map(n=>`'${O(n)}'`).join(", ")})`,rt=t=>[...t.matchAll(/'([^']*)'/g)].map(([,n])=>n);function Cn(t){return`${U}${et(t)}`}function Pn(t){if(!t.startsWith(U))return;let n=t.slice(U.length);return/^\(.*\)$/.test(n)?rt(n):void 0}function Tt(t,n){let e=nt[t];return`SELECT ${["Id","OpportunityId",...t===M?[e,$]:[e],...n].join(", ")} FROM ${t} WHERE OpportunityId IN `}function kn(t,n,e){return`${Tt(t,n)}${et(e)}`}var Ht=/^SELECT Id, OpportunityId, (?:UserId|SplitOwnerId, SplitTypeId)((?:, \w+)*) FROM (OpportunityTeamMember|OpportunitySplit) WHERE OpportunityId IN (\(.*\))$/;function Mn(t){let n=Ht.exec(t);if(!n)return;let[,e,r,o]=n;return{objectApiName:r,fields:e.split(", ").filter(i=>i!==""),opportunities:rt(o)}}var y=t=>t.slice(0,15);async function W(t,n,e){let r=[];for(let o=0;o<e.length;o+=S){let i=e.slice(o,o+S).map(s=>`'${O(s)}'`).join(", ");r.push(...await t(`${n}(${i})`))}return r}function X(t,n){let e=new Map;for(let r of t){let o=r[n];typeof r.Id=="string"&&typeof o=="string"&&o!==""&&e.set(y(r.Id),o)}return e}var w=(t,n)=>{let e=t[n];return typeof e=="string"&&e!==""?e:void 0};async function An(t,n,e){let r={lookups:new Map,linked:new Map,held:new Map,defaulted:new Set},o=nt[t];if(o===void 0)return r;let i=t===M,s=n.filter(a=>{let f=w(a,"OpportunityId");return f!==void 0&&e.targetIdOf(f)!==void 0});if(s.length===0)return r;let d=[...new Set(s.map(a=>String(a.OpportunityId)))],u=X(await W(e.source,U,d),"OwnerId"),l=a=>e.targetIdOf(String(a.OpportunityId)),I=[...new Set(s.map(l))],{simulated:T}=e,x=T?void 0:X(await W(e.target,U,I),"OwnerId"),b=a=>{let f=u.get(y(String(a.OpportunityId)));return f===void 0?{}:{source:f,target:T?T.ownerOf(f):x?.get(y(l(a)))}},_=a=>{let f=w(a,o),R=b(a).source;return f!==void 0&&R!==void 0&&y(f)===y(R)},A=[...new Set(s.flatMap(a=>{let f=w(a,o);return f===void 0||_(a)||e.mappedUser(f)!==void 0?[]:[f]}))],K=A.length>0?new Set((await W(e.target,"SELECT Id FROM User WHERE IsActive = true AND Id IN ",A)).flatMap(a=>typeof a.Id=="string"?[y(a.Id)]:[])):new Set,H=i?X(await W(e.source,`SELECT Id, DeveloperName FROM ${tt} WHERE Id IN `,[...new Set(s.flatMap(a=>w(a,$)??[]))]),"DeveloperName"):new Map,F=new Map;if(i)for(let a of await e.target(Kt))typeof a.Id=="string"&&typeof a.DeveloperName=="string"&&F.set(a.DeveloperName,{id:a.Id,total:a.IsTotalValidated===!0||a.IsTotalValidated==="true"});let c=(e.written??[]).filter(a=>a!=="Id"&&a!=="OpportunityId"&&a!==o&&a!==$&&!qt.has(a)),g=(a,f)=>{let R=a[f];return!(R==null||R===""||R===!1)},p=(a,f,R=c)=>R.filter(P=>g(a,P)&&String(a[P])!==String(f[P]??"")),m=new Map,h=(a,f,R)=>[a,f,R??""].map(y).join("|");if(!T)for(let a of await W(e.target,Tt(t,c),I)){let f=w(a,"OpportunityId"),R=w(a,o);typeof a.Id!="string"||f===void 0||R===void 0||m.set(h(f,R,i?w(a,$):void 0),a)}for(let a of s){let f=w(a,o);if(f===void 0)continue;let R=_(a),P=b(a).target,L=R?P:e.mappedUser(f)??(K.has(y(f))?f:void 0),ot=!R&&L===void 0&&e.defaultUser!==void 0;if(ot&&(L=e.defaultUser),L===void 0){r.held.set(a,{field:o,parentObject:"User",why:R?`${o} names the owner of its opportunity, whose owner in the target could not be read.`:`${o} names a user the target has no counterpart of: a team member and a split go in for the opportunity's owner, which is the owner of its copy in the target, for a user an owner mapping gives, or for a user of the same id the target holds active.`});continue}let V={[o]:L},it=!1;if(i){let E=w(a,$);if(E!==void 0){let k=H.get(y(E)),z=k===void 0?void 0:F.get(k);if(z===void 0){r.held.set(a,{field:$,parentObject:tt,why:`${$} names ${k===void 0?"a split type":`the split type ${k}`}, which the target holds no active one of by that name: sent without it, the split would go in as one of the Revenue type.`});continue}V[$]=z.id,it=z.total}}let St=l(a),st=P!==void 0&&y(L)===y(P);if(T){if(st&&(!i||it)){let E=c.filter(k=>!pt(k)&&g(a,k));r.linked.set(a,{id:T.idFor(),owners:!0,notKept:p(a,Ut[t]??{},c.filter(pt)),...E.length>0?{unread:E}:{}});continue}}else{let E=m.get(h(St,L,V[$]));if(E!==void 0){r.linked.set(a,{id:String(E.Id),owners:st,notKept:p(a,E)});continue}}r.lookups.set(a,V),ot&&r.defaulted.add(a)}return r}var Bt={[Q]:"TaskId",[q]:"EventId"};async function Ln(t,n,e){let r=new Map,o=Bt[n];if(o===void 0)return r;let i=[...new Set(e.map(d=>d[o]).filter(d=>typeof d=="string"&&d!==""))];if(i.length===0)return r;let s=new Map;for(let d=0;d<i.length;d+=S){let u=i.slice(d,d+S).map(I=>`'${O(I)}'`).join(", "),l=await t(`SELECT Id, ${o}, RelationId FROM ${n} WHERE ${o} IN (${u})`);for(let I of l)typeof I.Id=="string"&&s.set(`${String(I[o])}|${String(I.RelationId)}`,I.Id)}return e.forEach((d,u)=>{let l=s.get(`${String(d[o])}|${String(d.RelationId)}`);l&&r.set(u,l)}),r}var jt={[q]:["IsInvitee"]},yt={IsInvitee:["Status","Response","RespondedDate"]},Rt="the run was cancelled before it was updated";async function Nn(t,n,e,r,o=()=>!1){return Qt(await Yt(t,n,e,r,o))}function Qt(t){if(!(t===void 0||t.size===0))return[...t].map(([n,e])=>`${e} linked without ${n}`).join(", ")}function xn(t,n){if(n.size===0)return t;let e=new Map(t??[]);for(let[r,o]of n)e.set(r,(e.get(r)??0)+o);return e}async function Yt(t,n,e,r,o=()=>!1){let i=jt[t]??[],s=new Set(i.flatMap(c=>[c,...yt[c]??[]]).filter(c=>!e(c))),d=new Map,u=(c,g)=>{let p=`${c}: ${g}`;d.set(p,(d.get(p)??0)+1)},l=[];for(let[c,g]of n){let p={},m={};for(let h of i.filter(a=>String(c[a])==="true")){if(s.has(h)){u(h,"the target does not let it be updated");continue}p[h]=!0;for(let a of yt[h]??[]){let f=c[a];f==null||f===""||(s.has(a)?u(a,"the target does not let it be updated"):m[a]=f)}}Object.keys(p).length>0&&l.push({Id:g,flagsGiven:p,answer:m})}let I=!1,T=async c=>{let g=new Map;if(c.length===0)return g;if(o()){for(let h of c)g.set(h.Id,Rt);return g}if(I)return g;let p=await r(c);I=p.length<c.length;let m=o();return c.forEach((h,a)=>{let f=p[a];f?.success||g.set(h.Id,f===void 0&&m?Rt:`the target refused the update, ${f?.errors[0]??"without saying why"}`)}),g},x=(c,g)=>{for(let p of c){let m=g.get(p.Id);if(m!==void 0)for(let h of Object.keys(p).filter(a=>a!=="Id"))u(h,m)}},b=l.map(({Id:c,flagsGiven:g,answer:p})=>({Id:c,...g,...p})),_=await T(b),A=I||o()?[]:l.filter(({Id:c,answer:g})=>_.has(c)&&Object.keys(g).length>0);x(b.filter(c=>!A.some(({Id:g})=>g===c.Id)),_);let K=A.map(({Id:c,flagsGiven:g})=>({Id:c,...g})),H=await T(K);x(K,H);let F=A.filter(({Id:c})=>!H.has(c));for(let c of new Set(F.flatMap(({answer:g})=>Object.keys(g)))){let g=F.filter(({answer:p})=>c in p).map(({Id:p,answer:m})=>({Id:p,[c]:m[c]}));x(g,await T(g))}return d}var bn={Order:"OrderStatus",Contract:"ContractStatus"},_n=new Set(["Contract"]);function Gt(t){return t==null||t===""?"null":typeof t=="number"||typeof t=="boolean"?String(t):`'${O(String(t))}'`}async function Fn(t,n){let e=new Map,r=[...new Set(n.map(i=>i.ContactId).filter(i=>typeof i=="string"&&i!==""))];if(r.length===0)return e;let o=new Map;for(let i=0;i<r.length;i+=j){let s=r.slice(i,i+j).map(u=>`'${O(u)}'`).join(", "),d=await t(`SELECT Id, AccountId, ContactId FROM ${It} WHERE IsDirect = true AND ContactId IN (${s})`);for(let u of d)typeof u.Id=="string"&&o.set(`${String(u.AccountId)}|${String(u.ContactId)}`,u.Id)}return n.forEach((i,s)=>{let d=o.get(`${String(i.AccountId)}|${String(i.ContactId)}`);d&&e.set(s,d)}),e}async function Wn(t,n){let e=new Set;for(let r=0;r<n.length;r+=j){let o=n.slice(r,r+j).map(s=>`'${O(s)}'`).join(", "),i=await t(`SELECT Id FROM PricebookEntry WHERE Id IN (${o}) AND Pricebook2.IsStandard = true`);for(let s of i)typeof s.Id=="string"&&e.add(s.Id)}return e}var wt=200;async function vn(t,n){let e=new Map,r=[...new Set(n.map(i=>i.Product2Id).filter(i=>typeof i=="string"&&i!==""))];if(r.length===0)return e;let o=new Map;for(let i=0;i<r.length;i+=wt){let s=r.slice(i,i+wt).map(u=>`'${O(u)}'`).join(", "),d=await t(`SELECT Id, Product2Id, ProductSellingModelId FROM ${at} WHERE Product2Id IN (${s})`);for(let u of d)typeof u.Id=="string"&&o.set(`${String(u.Product2Id)}|${String(u.ProductSellingModelId)}`,u.Id)}return n.forEach((i,s)=>{let d=o.get(`${String(i.Product2Id)}|${String(i.ProductSellingModelId)}`);d&&e.set(s,d)}),e}async function Dn(t,n,e,r){let o=new Map;for(let i of r){let s=JSON.stringify(e.map(l=>i[l]??null));if(o.has(s))continue;let d=e.map(l=>`${C(l)} = ${Gt(i[l])}`).join(" AND "),u=await t(`SELECT Id FROM ${C(n)} WHERE ${d} LIMIT 2`);o.set(s,u.length===1&&typeof u[0].Id=="string"?u[0].Id:void 0)}return r.map(i=>o.get(JSON.stringify(e.map(s=>i[s]??null))))}async function Un(t,n){let e;try{e=await t(`SELECT ApiName, StatusCode FROM ${C(n)}`)}catch{return}return{categoryOf:new Map(e.map(r=>[String(r.ApiName),String(r.StatusCode)])),draft:e.filter(r=>r.StatusCode==="Draft").map(r=>String(r.ApiName)).sort()[0]}}function qn(t,n){if(typeof t!="string"||t===""||!n.draft)return;let e=n.categoryOf.get(t);if(!(e===void 0||e==="Draft"))return n.draft}export{It as a,v as b,J as c,en as d,rn as e,ut as f,on as g,sn as h,an as i,dn as j,un as k,ht as l,cn as m,fn as n,ln as o,gn as p,N as q,B as r,Y as s,kt as t,pn as u,yn as v,Rn as w,Mt as x,wn as y,In as z,D as A,M as B,nt as C,hn as D,mn as E,Ot as F,G,ft as H,Nt as I,xt as J,On as K,_t as L,vt as M,Tn as N,Sn as O,En as P,$n as Q,Ut as R,Kt as S,Cn as T,Pn as U,kn as V,Mn as W,An as X,Bt as Y,Ln as Z,jt as _,Nn as $,Qt as aa,xn as ba,Yt as ca,bn as da,_n as ea,Fn as fa,Wn as ga,vn as ha,Dn as ia,Un as ja,qn as ka};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{h as M,i as T}from"./chunk-32ZB5ICW.mjs";import{p as b}from"./chunk-ICIYL45C.mjs";import{Ec as _,Fc as h,Gc as p,Hc as R,Lc as C,Mc as S,Pc as k}from"./chunk-CRPLDXJU.mjs";async function Y(r,e){try{let[c,i]=await Promise.all([r(R),e(R)]),d=c[0]?.Id,a=i[0]?.Id;return typeof d=="string"&&typeof a=="string"?{source:d,target:a}:void 0}catch{return}}function v(r,e){return r===h||e.some(c=>typeof c[p]=="string")}var K=[p,C,S];function A(r,e,c,i,d=()=>!1){let a={...e,standsFor:new Map,standardFirst:0,standardMatched:!1,prices:[],leftIn:new Map};if(!c)return a;let o=e.records.map((t,s)=>s),m=t=>({records:t.map(s=>e.records[s]),sources:t.map(s=>e.sources[s]),sourceIds:t.map(s=>e.sourceIds[s])});if(r===h){let t=o.filter(s=>e.sourceIds[s]!==c.source);return t.length===o.length?a:{...m(t),standsFor:new Map,standardFirst:0,standardMatched:!0,prices:[],leftIn:new Map}}if(r!==_)return a;let l=o,I=new Map,P=new Map,O=[];if(i){let{target:t}=i,s=e.sources.filter(n=>!K.some(f=>{let u=n[f];return typeof u=="string"&&u!==""&&d(u)})),E=n=>t.active.has(n)?n:b(void 0,t)?.to,g=M({prices:s,standardBookId:c.source,sellingModels:s.some(n=>typeof n[S]=="string"),writtenIn:E,active:t.active},[]),B=new Set(g.standsFor.keys());l=o.filter(n=>{let f=e.sourceIds[n];return f===void 0||!B.has(f)});let D=new Map(s.map(n=>[n.Id,n[k]]));for(let[n,f]of g.standsFor){I.set(n,f);let u=D.get(n),w=typeof u=="string"?E(u):void 0;typeof u=="string"&&w!==void 0&&P.set(n,{from:u,to:w})}O=T(g.said)}let y=t=>e.sources[t][p]===c.source,F=[...l.filter(y),...l.filter(t=>!y(t))];return{...m(F),standsFor:I,standardFirst:l.filter(y).length,standardMatched:!1,prices:O,leftIn:P}}function Q(r,e){let c=r.prices.map(i=>({...i}));for(let i of e){let d=r.leftIn.get(i),a=d&&(c.find(o=>o.from===d.from&&o.to===d.to&&o.how==="replaced"&&!o.forLines)??c.find(o=>o.from===d.from&&o.to===d.to&&o.how==="replaced"));a&&a.prices--}return c.filter(i=>i.prices>0)}function q(r,e){return e===1?`1 ${r} record held back, not sent: read in a currency the target org does not hold active, it stands for the source's own price of its product and price book in the currency written, which this run did not write.`:`${e} ${r} records held back, not sent: read in a currency the target org does not hold active, they stand for the source's own prices of their product and price book in the currency written, which this run did not write.`}var H="The standard price book is matched to the target org's, never written.";function $(r,e){return e.prices.length===0&&!e.standardMatched?r:{...r,...e.prices.length>0?{pricesSettled:[...e.prices]}:{},...e.standardMatched?{standardPricebookMatched:!0}:{}}}export{Y as a,v as b,A as c,Q as d,q as e,H as f,$ as g};
7
+ import{h as M,i as T}from"./chunk-3I6FXFCN.mjs";import{p as b}from"./chunk-ICIYL45C.mjs";import{Lc as _,Mc as h,Nc as p,Oc as R,Sc as C,Tc as S,Wc as k}from"./chunk-J347SPU6.mjs";async function Y(r,e){try{let[c,i]=await Promise.all([r(R),e(R)]),d=c[0]?.Id,a=i[0]?.Id;return typeof d=="string"&&typeof a=="string"?{source:d,target:a}:void 0}catch{return}}function v(r,e){return r===h||e.some(c=>typeof c[p]=="string")}var K=[p,C,S];function A(r,e,c,i,d=()=>!1){let a={...e,standsFor:new Map,standardFirst:0,standardMatched:!1,prices:[],leftIn:new Map};if(!c)return a;let o=e.records.map((t,s)=>s),m=t=>({records:t.map(s=>e.records[s]),sources:t.map(s=>e.sources[s]),sourceIds:t.map(s=>e.sourceIds[s])});if(r===h){let t=o.filter(s=>e.sourceIds[s]!==c.source);return t.length===o.length?a:{...m(t),standsFor:new Map,standardFirst:0,standardMatched:!0,prices:[],leftIn:new Map}}if(r!==_)return a;let l=o,I=new Map,P=new Map,O=[];if(i){let{target:t}=i,s=e.sources.filter(n=>!K.some(f=>{let u=n[f];return typeof u=="string"&&u!==""&&d(u)})),E=n=>t.active.has(n)?n:b(void 0,t)?.to,g=M({prices:s,standardBookId:c.source,sellingModels:s.some(n=>typeof n[S]=="string"),writtenIn:E,active:t.active},[]),B=new Set(g.standsFor.keys());l=o.filter(n=>{let f=e.sourceIds[n];return f===void 0||!B.has(f)});let D=new Map(s.map(n=>[n.Id,n[k]]));for(let[n,f]of g.standsFor){I.set(n,f);let u=D.get(n),w=typeof u=="string"?E(u):void 0;typeof u=="string"&&w!==void 0&&P.set(n,{from:u,to:w})}O=T(g.said)}let y=t=>e.sources[t][p]===c.source,F=[...l.filter(y),...l.filter(t=>!y(t))];return{...m(F),standsFor:I,standardFirst:l.filter(y).length,standardMatched:!1,prices:O,leftIn:P}}function Q(r,e){let c=r.prices.map(i=>({...i}));for(let i of e){let d=r.leftIn.get(i),a=d&&(c.find(o=>o.from===d.from&&o.to===d.to&&o.how==="replaced"&&!o.forLines)??c.find(o=>o.from===d.from&&o.to===d.to&&o.how==="replaced"));a&&a.prices--}return c.filter(i=>i.prices>0)}function q(r,e){return e===1?`1 ${r} record held back, not sent: read in a currency the target org does not hold active, it stands for the source's own price of its product and price book in the currency written, which this run did not write.`:`${e} ${r} records held back, not sent: read in a currency the target org does not hold active, they stand for the source's own prices of their product and price book in the currency written, which this run did not write.`}var H="The standard price book is matched to the target org's, never written.";function $(r,e){return e.prices.length===0&&!e.standardMatched?r:{...r,...e.prices.length>0?{pricesSettled:[...e.prices]}:{},...e.standardMatched?{standardPricebookMatched:!0}:{}}}export{Y as a,v as b,A as c,Q as d,q as e,H as f,$ as g};