sandforge 1.82.0 → 1.83.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 (200) hide show
  1. package/lib/{chunk-JLZRZL5E.mjs → chunk-262TP6UU.mjs} +1 -1
  2. package/lib/{chunk-Z42PHCVZ.mjs → chunk-27BBEGUD.mjs} +1 -1
  3. package/lib/{chunk-YGJF55VJ.mjs → chunk-2ADSD5WK.mjs} +1 -1
  4. package/lib/{chunk-KIMQQ6JQ.mjs → chunk-2GSMHGIV.mjs} +1 -1
  5. package/lib/chunk-2K5BYZQM.mjs +8 -0
  6. package/lib/{chunk-DJCGURW7.mjs → chunk-2KTGDYUH.mjs} +1 -1
  7. package/lib/{chunk-YAJQS3OL.mjs → chunk-2N73W63D.mjs} +1 -1
  8. package/lib/{chunk-LXDSRP2W.mjs → chunk-2R6GFNKF.mjs} +1 -1
  9. package/lib/{chunk-VZVICK7Q.mjs → chunk-2WMKJVD2.mjs} +1 -1
  10. package/lib/{chunk-CV47FDQW.mjs → chunk-36Y225OM.mjs} +1 -1
  11. package/lib/{chunk-3C2ZZIFN.mjs → chunk-3CM7LAPE.mjs} +1 -1
  12. package/lib/{chunk-HIHCYMSL.mjs → chunk-3OVTKRS4.mjs} +1 -1
  13. package/lib/{chunk-XFU3HRUV.mjs → chunk-3V4YH5KO.mjs} +1 -1
  14. package/lib/{chunk-XO5FBOQF.mjs → chunk-446GBKAC.mjs} +1 -1
  15. package/lib/{chunk-ZUOPC4W2.mjs → chunk-4GCYGQXD.mjs} +1 -1
  16. package/lib/{chunk-GCGHHN4K.mjs → chunk-4V3QO7HF.mjs} +1 -1
  17. package/lib/{chunk-VZT4E2OJ.mjs → chunk-4X5D3MSV.mjs} +1 -1
  18. package/lib/{chunk-P55MKIZX.mjs → chunk-5OGNK3JP.mjs} +1 -1
  19. package/lib/{chunk-3MGMNK3Q.mjs → chunk-6KOUYHEY.mjs} +1 -1
  20. package/lib/chunk-6QSHWIZI.mjs +48 -0
  21. package/lib/chunk-6VOQFISN.mjs +7 -0
  22. package/lib/{chunk-VYOYXTCU.mjs → chunk-6YC2ELCU.mjs} +1 -1
  23. package/lib/chunk-77IVKH7R.mjs +7 -0
  24. package/lib/{chunk-JKT5YAQ2.mjs → chunk-77MZRBWX.mjs} +1 -1
  25. package/lib/{chunk-PR74GYVI.mjs → chunk-7BQMBXKX.mjs} +1 -1
  26. package/lib/{chunk-SZGGFST2.mjs → chunk-7DPHZWA4.mjs} +1 -1
  27. package/lib/chunk-7V2UYZ6S.mjs +7 -0
  28. package/lib/{chunk-HKUWHVI7.mjs → chunk-7WSQ65WG.mjs} +1 -1
  29. package/lib/{chunk-LHU6CPGE.mjs → chunk-7ZBDACVG.mjs} +1 -1
  30. package/lib/{chunk-WT3SCUHS.mjs → chunk-AG24QMSY.mjs} +1 -1
  31. package/lib/{chunk-A65ADTCR.mjs → chunk-AHUGG3WU.mjs} +1 -1
  32. package/lib/{chunk-ZXFL2MSN.mjs → chunk-ALBY5SOH.mjs} +1 -1
  33. package/lib/chunk-AXFD2OH6.mjs +7 -0
  34. package/lib/{chunk-JESRFE2Z.mjs → chunk-BH76USTQ.mjs} +1 -1
  35. package/lib/{chunk-DBBPDSFN.mjs → chunk-BPHTA6KP.mjs} +1 -1
  36. package/lib/{chunk-3SKLBRPL.mjs → chunk-BT43WSOS.mjs} +1 -1
  37. package/lib/{chunk-32EUNQT6.mjs → chunk-BVZ5H3N4.mjs} +1 -1
  38. package/lib/{chunk-PWVDNN2C.mjs → chunk-C6RKM4BB.mjs} +1 -1
  39. package/lib/{chunk-27Z76O2O.mjs → chunk-CDWZGQAJ.mjs} +1 -1
  40. package/lib/chunk-CGZGL6VT.mjs +7 -0
  41. package/lib/{chunk-P63WJMXQ.mjs → chunk-CN5HGFG4.mjs} +1 -1
  42. package/lib/{chunk-Y4TDVDP2.mjs → chunk-CQAFVEKP.mjs} +1 -1
  43. package/lib/{chunk-G2JR3F63.mjs → chunk-CTPLYUXA.mjs} +1 -1
  44. package/lib/chunk-CXKZ6TYV.mjs +9 -0
  45. package/lib/{chunk-FKK5YBGZ.mjs → chunk-D6JT4PAB.mjs} +1 -1
  46. package/lib/{chunk-3CX7GPCR.mjs → chunk-D7XUNWWU.mjs} +1 -1
  47. package/lib/{chunk-PPHVWUFY.mjs → chunk-DB5RVDC5.mjs} +1 -1
  48. package/lib/{chunk-LAUOSXMN.mjs → chunk-DIGUC7S4.mjs} +1 -1
  49. package/lib/{chunk-6GQUZ4IP.mjs → chunk-DKDKCGXV.mjs} +1 -1
  50. package/lib/chunk-DMT5SCO3.mjs +7 -0
  51. package/lib/{chunk-KKOA62S4.mjs → chunk-DNQKVCUV.mjs} +4 -3
  52. package/lib/{chunk-3XG25GTF.mjs → chunk-DSR2MSBH.mjs} +1 -1
  53. package/lib/{chunk-ZHIZY3ZC.mjs → chunk-E3RQ575Y.mjs} +1 -1
  54. package/lib/{chunk-SAMWHL22.mjs → chunk-EOQON3E5.mjs} +1 -1
  55. package/lib/{chunk-2JZGCCPG.mjs → chunk-ETNQHIDI.mjs} +1 -1
  56. package/lib/chunk-F5SBGJWW.mjs +7 -0
  57. package/lib/chunk-FBXH4VRQ.mjs +7 -0
  58. package/lib/chunk-FKCIGJOI.mjs +15 -0
  59. package/lib/{chunk-NWOI25WY.mjs → chunk-FVLFO2S6.mjs} +1 -1
  60. package/lib/{chunk-MKTXJCXN.mjs → chunk-FYWNSMOZ.mjs} +1 -1
  61. package/lib/{chunk-52EXDVPN.mjs → chunk-GEEWPTV5.mjs} +1 -1
  62. package/lib/{chunk-XSKPYGMT.mjs → chunk-GLN4PI5P.mjs} +1 -1
  63. package/lib/{chunk-DWMRIWV5.mjs → chunk-GT5ZKU6V.mjs} +1 -1
  64. package/lib/chunk-GTRU5AV5.mjs +7 -0
  65. package/lib/chunk-H33DVU3D.mjs +7 -0
  66. package/lib/{chunk-YAIIRFKJ.mjs → chunk-HQZUQXDC.mjs} +1 -1
  67. package/lib/{chunk-MUEQRIK7.mjs → chunk-HVX2AFYW.mjs} +1 -1
  68. package/lib/chunk-I3ZO76LL.mjs +21 -0
  69. package/lib/{chunk-7WSLT5VX.mjs → chunk-I5C4O3VA.mjs} +1 -1
  70. package/lib/{chunk-6VSZNZHH.mjs → chunk-IHGYJZZ2.mjs} +1 -1
  71. package/lib/{chunk-DIS254AN.mjs → chunk-ISA2NYJV.mjs} +1 -1
  72. package/lib/{chunk-GGUOIDWP.mjs → chunk-ISAUCWYK.mjs} +1 -1
  73. package/lib/{chunk-ZUTUYBNW.mjs → chunk-ISOSTAJR.mjs} +1 -1
  74. package/lib/chunk-IXIY6Q4M.mjs +7 -0
  75. package/lib/{chunk-2UU42PTD.mjs → chunk-J3TIHLWG.mjs} +1 -1
  76. package/lib/{chunk-GGNUACTY.mjs → chunk-JAV6F6OA.mjs} +1 -1
  77. package/lib/chunk-JBWJ6UEZ.mjs +7 -0
  78. package/lib/{chunk-C2N2TNEU.mjs → chunk-JH4ZTVQN.mjs} +1 -1
  79. package/lib/{chunk-FOIWWK7G.mjs → chunk-JIPT5FUD.mjs} +1 -1
  80. package/lib/{chunk-7EYQYZJP.mjs → chunk-JREKJO3D.mjs} +1 -1
  81. package/lib/{chunk-VQJMP3DC.mjs → chunk-JUOQUG7U.mjs} +1 -1
  82. package/lib/chunk-JYUMD357.mjs +7 -0
  83. package/lib/{chunk-KP5G6FUC.mjs → chunk-K7G3W7XH.mjs} +1 -1
  84. package/lib/{chunk-T7WREYA5.mjs → chunk-KKS2KFBT.mjs} +1 -1
  85. package/lib/{chunk-TMA34QMA.mjs → chunk-KWAVSZ2B.mjs} +1 -1
  86. package/lib/{chunk-H4JUYUSL.mjs → chunk-KXUOHACP.mjs} +1 -1
  87. package/lib/{chunk-STRMWSIQ.mjs → chunk-L3I6DAHX.mjs} +1 -1
  88. package/lib/{chunk-TCBAE65A.mjs → chunk-L47JCNP3.mjs} +1 -1
  89. package/lib/{chunk-5K2I2DMP.mjs → chunk-L4MSL4U7.mjs} +1 -1
  90. package/lib/chunk-L4RJX7DG.mjs +7 -0
  91. package/lib/{chunk-47UHTN3Q.mjs → chunk-L6CLN664.mjs} +1 -1
  92. package/lib/chunk-LI2XNV7F.mjs +7 -0
  93. package/lib/chunk-LP2D3JJP.mjs +7 -0
  94. package/lib/{chunk-KJYEQHYP.mjs → chunk-LWES2KZE.mjs} +1 -1
  95. package/lib/{chunk-3HEMJTAP.mjs → chunk-LYOGCIYD.mjs} +2 -2
  96. package/lib/{chunk-VPDEJGPS.mjs → chunk-MJD6CPZZ.mjs} +1 -1
  97. package/lib/{chunk-SNEOKYV7.mjs → chunk-MTM4KG3T.mjs} +1 -1
  98. package/lib/{chunk-J24TIGSI.mjs → chunk-N2HYG3BL.mjs} +1 -1
  99. package/lib/chunk-N5UIE4IR.mjs +7 -0
  100. package/lib/{chunk-YMDFF657.mjs → chunk-NDFFIJL5.mjs} +1 -1
  101. package/lib/{chunk-WOOUISSO.mjs → chunk-NFEBX75O.mjs} +1 -1
  102. package/lib/{chunk-ZUBBEP75.mjs → chunk-NNV7IGM7.mjs} +1 -1
  103. package/lib/{chunk-Q3DY7TO2.mjs → chunk-NS6ONPWL.mjs} +1 -1
  104. package/lib/{chunk-IVZJSDJD.mjs → chunk-O7GCCRPW.mjs} +1 -1
  105. package/lib/{chunk-A7JJWOLT.mjs → chunk-OO24ZYYJ.mjs} +1 -1
  106. package/lib/chunk-OOIDCHBQ.mjs +9 -0
  107. package/lib/{chunk-AUS6NFLZ.mjs → chunk-OS5GE52G.mjs} +1 -1
  108. package/lib/chunk-OS6HFJ7L.mjs +7 -0
  109. package/lib/{chunk-V3R45ZWT.mjs → chunk-OTJH6AEA.mjs} +1 -1
  110. package/lib/{chunk-PBE44M2Y.mjs → chunk-OUU47Y7A.mjs} +1 -1
  111. package/lib/{chunk-BN33LVPQ.mjs → chunk-P6WRYJN3.mjs} +1 -1
  112. package/lib/{chunk-JJITOWZK.mjs → chunk-PDRXM5WN.mjs} +1 -1
  113. package/lib/{chunk-RYRMUPMY.mjs → chunk-PGRY365W.mjs} +1 -1
  114. package/lib/chunk-Q4PPI3KG.mjs +7 -0
  115. package/lib/chunk-QFTF2PGS.mjs +21 -0
  116. package/lib/chunk-QKJXIY6L.mjs +7 -0
  117. package/lib/{chunk-PYRZFUVU.mjs → chunk-QLRWU3MB.mjs} +1 -1
  118. package/lib/chunk-QO4MPHZD.mjs +7 -0
  119. package/lib/chunk-QP3JLFIO.mjs +7 -0
  120. package/lib/{chunk-NLB3RGIY.mjs → chunk-QQDZQCO2.mjs} +1 -1
  121. package/lib/{chunk-7CVDVBEE.mjs → chunk-QXB6U3ZP.mjs} +1 -1
  122. package/lib/chunk-R3OM3X4L.mjs +8 -0
  123. package/lib/chunk-R7GKMAT4.mjs +7 -0
  124. package/lib/{chunk-YT22LMF7.mjs → chunk-RVCPQVKM.mjs} +1 -1
  125. package/lib/{chunk-TWV4A5RK.mjs → chunk-RZKJQOOC.mjs} +1 -1
  126. package/lib/chunk-S4PRKKGC.mjs +8 -0
  127. package/lib/{chunk-JH27IKCO.mjs → chunk-SX6QWYCQ.mjs} +1 -1
  128. package/lib/{chunk-UHFLKP26.mjs → chunk-T36DZJPH.mjs} +1 -1
  129. package/lib/{chunk-CZLJZQCS.mjs → chunk-T7DDS4UQ.mjs} +1 -1
  130. package/lib/chunk-TCEXCHXR.mjs +7 -0
  131. package/lib/chunk-TMIESDE5.mjs +7 -0
  132. package/lib/chunk-TQJ5NPRC.mjs +7 -0
  133. package/lib/chunk-TUPZY2QJ.mjs +7 -0
  134. package/lib/{chunk-GBGHJTPC.mjs → chunk-U2CTKIPE.mjs} +1 -1
  135. package/lib/{chunk-3HROD5RE.mjs → chunk-U4YFYSF3.mjs} +1 -1
  136. package/lib/{chunk-Q6SXNKV2.mjs → chunk-UIR77ZJD.mjs} +1 -1
  137. package/lib/{chunk-FA4ZKDCU.mjs → chunk-UOHZW2L4.mjs} +1 -1
  138. package/lib/{chunk-7PY3VQP3.mjs → chunk-VXZ5PTOM.mjs} +1 -1
  139. package/lib/{chunk-7LKI7OAS.mjs → chunk-VZLJZEV2.mjs} +1 -1
  140. package/lib/{chunk-YH4DYI6D.mjs → chunk-W3BQGMTR.mjs} +1 -1
  141. package/lib/{chunk-CELEBWEZ.mjs → chunk-WABXKL4N.mjs} +1 -1
  142. package/lib/{chunk-EEFUE2ES.mjs → chunk-WAYQLQAD.mjs} +1 -1
  143. package/lib/{chunk-RCYEBY42.mjs → chunk-WBELLGNE.mjs} +1 -1
  144. package/lib/{chunk-SFGZFB4F.mjs → chunk-WJAZ5LHL.mjs} +1 -1
  145. package/lib/{chunk-JQZTMFO7.mjs → chunk-WXU6ZJIV.mjs} +1 -1
  146. package/lib/{chunk-GJ6SZVHT.mjs → chunk-WZN36ACK.mjs} +1 -1
  147. package/lib/{chunk-XU25YA46.mjs → chunk-X2XZQ434.mjs} +1 -1
  148. package/lib/{chunk-QAPVKPEC.mjs → chunk-X4HZD5U2.mjs} +1 -1
  149. package/lib/chunk-X6XNTOGO.mjs +7 -0
  150. package/lib/{chunk-XK5W7BVE.mjs → chunk-XAMMIPZ4.mjs} +1 -1
  151. package/lib/{chunk-DT3T7FRD.mjs → chunk-XAUQXYPW.mjs} +1 -1
  152. package/lib/{chunk-C3LNYAVJ.mjs → chunk-XCJUNX63.mjs} +1 -1
  153. package/lib/chunk-XJICAOAQ.mjs +7 -0
  154. package/lib/{chunk-CBL42DUU.mjs → chunk-XKFHTBAB.mjs} +1 -1
  155. package/lib/{chunk-O2PUGRNW.mjs → chunk-XMQ5R6TC.mjs} +1 -1
  156. package/lib/chunk-XPXEQKLR.mjs +7 -0
  157. package/lib/{chunk-6KP6WETK.mjs → chunk-Y7YUNRKK.mjs} +1 -1
  158. package/lib/{chunk-WSUKC2U3.mjs → chunk-YBZIDW6W.mjs} +1 -1
  159. package/lib/{chunk-RTWYLOCA.mjs → chunk-YEVB7LVK.mjs} +1 -1
  160. package/lib/{chunk-L4INJ5TZ.mjs → chunk-Z3MGN42K.mjs} +1 -1
  161. package/lib/{chunk-EOFO3PHS.mjs → chunk-ZB5E7NHU.mjs} +1 -1
  162. package/lib/chunk-ZCOSME6P.mjs +7 -0
  163. package/lib/{chunk-HFUDCNU5.mjs → chunk-ZOSESZ22.mjs} +1 -1
  164. package/lib/chunk-ZTHC42X6.mjs +7 -0
  165. package/lib/{chunk-XZISAZA6.mjs → chunk-ZXOUWHYE.mjs} +1 -1
  166. package/lib/sandforge-autopilot.mjs +1 -1
  167. package/lib/sandforge-backup.mjs +1 -1
  168. package/lib/sandforge-checkpoint.mjs +1 -1
  169. package/lib/sandforge-cleanup.mjs +1 -1
  170. package/lib/sandforge-clone.mjs +1 -1
  171. package/lib/sandforge-compare.mjs +1 -1
  172. package/lib/sandforge-dataops.mjs +1 -1
  173. package/lib/sandforge-empty.mjs +4 -4
  174. package/lib/sandforge-env.mjs +98 -99
  175. package/lib/sandforge-frozen.mjs +1 -1
  176. package/lib/sandforge-mcp.mjs +2 -2
  177. package/lib/sandforge-monitor.mjs +1 -1
  178. package/lib/sandforge-pipeline.mjs +1 -1
  179. package/lib/sandforge-seed.mjs +1 -1
  180. package/lib/sandforge-sync.mjs +1 -1
  181. package/lib/sandforge-users.mjs +21 -23
  182. package/oclif.manifest.json +1 -1
  183. package/package.json +1 -1
  184. package/lib/chunk-42BFLWHR.mjs +0 -7
  185. package/lib/chunk-466F37VD.mjs +0 -7
  186. package/lib/chunk-7SDZR6SR.mjs +0 -7
  187. package/lib/chunk-BMTNTBBM.mjs +0 -7
  188. package/lib/chunk-CCEH7L53.mjs +0 -7
  189. package/lib/chunk-DIL62SUN.mjs +0 -7
  190. package/lib/chunk-FZF23M6R.mjs +0 -7
  191. package/lib/chunk-GHPR5UVV.mjs +0 -7
  192. package/lib/chunk-HQQVANWQ.mjs +0 -20
  193. package/lib/chunk-IRZJU2PG.mjs +0 -22
  194. package/lib/chunk-ISSP2FZ5.mjs +0 -7
  195. package/lib/chunk-JFNLKHY6.mjs +0 -8
  196. package/lib/chunk-O4BROUGM.mjs +0 -7
  197. package/lib/chunk-PE435FVH.mjs +0 -15
  198. package/lib/chunk-RLWB7F26.mjs +0 -7
  199. package/lib/chunk-WEMLDUQA.mjs +0 -7
  200. package/lib/chunk-ZQO5PDX5.mjs +0 -48
@@ -1,7 +0,0 @@
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 Tt,d as _t,e as Bt,g as xt,h as Ft,i as Ut,j as $t,k as et}from"./chunk-54HYHHVL.mjs";import{a as Ce,b as q,d as H,e as vt,f as Xe,h as j}from"./chunk-VPDEJGPS.mjs";import{e as Ht,h as Jt,i as zt}from"./chunk-HFUDCNU5.mjs";import{da as me,e as te,ea as Ze,ga as pe,ja as Pe}from"./chunk-KIMQQ6JQ.mjs";import{h as N}from"./chunk-TZE3Y7IQ.mjs";import{b as P}from"./chunk-CA5NAXSU.mjs";import{Bc as Ye,Cc as Lt,dd as jt,lc as Nt,qc as Mt,rc as ee,vc as Ee,yc as ge,zc as Ge}from"./chunk-ZQO5PDX5.mjs";import{b as x,e as Ke,f as L,i as Pt,k as ae,l as X,o as Ie,s as Ct}from"./chunk-WZQEK4WT.mjs";var Ne=class{activeJobs=new Map;maxConcurrentJobs;maxCompletedJobs=50;constructor(e=5){this.maxConcurrentJobs=e}registerJob(e){this.activeJobs.set(e.id,e)}updateJobState(e,t){let n=this.activeJobs.get(e);return n?(n.state=t,(t==="JobComplete"||t==="Failed"||t==="Aborted")&&this.purgeCompletedJobs(),!0):!1}updateJobCounts(e,t,n){let o=this.activeJobs.get(e);return o?(o.numberRecordsProcessed=t,o.numberRecordsFailed=n,!0):!1}updateTotalRecords(e,t){let n=this.activeJobs.get(e);return n?(n.totalRecords=t,!0):!1}getJob(e){return this.activeJobs.get(e)}getActiveJobs(){return Array.from(this.activeJobs.values()).filter(e=>e.state==="UploadComplete"||e.state==="InProgress")}getCompletedJobs(){return Array.from(this.activeJobs.values()).filter(e=>e.state==="JobComplete"||e.state==="Failed"||e.state==="Aborted")}canStartNewJob(){return this.getActiveJobs().length<this.maxConcurrentJobs}removeJob(e){return this.activeJobs.delete(e)}get totalJobs(){return this.activeJobs.size}purgeCompletedJobs(){let e=Array.from(this.activeJobs.entries()).filter(([,t])=>["JobComplete","Failed","Aborted"].includes(t.state));if(e.length>this.maxCompletedJobs){let t=e.slice(0,e.length-this.maxCompletedJobs);for(let[n]of t)this.activeJobs.delete(n)}}clear(){this.activeJobs.clear()}};function $n(r,e){let t=et(r,e);if(t.state==="Open")throw new Error(`Bulk API job ${r||"(no id)"} is still open after its close was sent`);return{state:t.state,...t.numberRecordsProcessed!==void 0?{numberRecordsProcessed:t.numberRecordsProcessed}:{},...t.errorMessage?{errorMessage:t.errorMessage}:{}}}function Me(r){return{bulk2:{createJob:e=>{let t=r.bulk2.createJob(e);return{get id(){return t.id},open:async()=>{await t.open()},uploadData:n=>t.uploadData(n),close:()=>t.close(),abort:()=>t.abort(),check:async()=>$n(Ht(t)??"",await t.check()),getAllResults:()=>t.getAllResults()}},job:(e,{id:t})=>{let n=r.bulk2.job(e,{id:t});return{check:async()=>et(t,await n.check()),getSuccessfulResults:()=>n.getSuccessfulResults(),getAllResults:()=>n.getAllResults(),abort:()=>n.abort()}}}}}var qt=100,tt=2e3,Wt=20,Qt=20,Jn=X({name:x(),label:x(),type:x(),createable:L().optional(),updateable:L().optional(),nillable:L().optional(),defaultedOnCreate:L().optional(),aggregatable:L().optional(),groupable:L().optional(),filterable:L().optional(),nameField:L().optional(),autoNumber:L().optional(),calculated:L().optional(),referenceTo:ae(x()).optional()}).loose(),G=X({name:x(),label:x(),queryable:L().optional(),updateable:L().optional(),deletable:L().optional(),fields:ae(Jn),childRelationships:ae(X({childSObject:x(),field:x(),cascadeDelete:L().optional(),restrictedDelete:L().optional()}).loose()).optional()}).loose(),zn=Ct(x(),Pt()),qn=X({k:Ie([x(),Ke(),L()]).nullable(),n:Ke().int().nonnegative()}).loose();function Vt(r){return(r.createable===!0||r.updateable===!0)&&r.type!=="boolean"}function Wn(r){return r.groupable===!0&&(Vt(r)||r.nameField===!0)}function Qn(r,e){return e.createable===!0&&e.nillable===!1&&e.defaultedOnCreate!==!0||Nt(r,e.name)}function Le(r,e,t){let n=P(t);r.some(o=>o.check===e&&o.message===n)||r.push({check:e,message:n})}async function Vn(r,e,t,n){let o=new Map,s=[],a=[],i=(f,u)=>{s.push({fieldApiName:f.name,label:f.label,reason:u})},d=t.filter(f=>f.aggregatable===!0),l=t.filter(f=>f.aggregatable!==!0&&f.filterable===!0);for(let f of t)f.aggregatable!==!0&&f.filterable!==!0&&i(f,"not-countable");if(n===0)for(let f of[...d,...l])o.set(f.name,0);else{for(let f=0;f<d.length;f+=qt){let u=d.slice(f,f+qt);try{let g=u.map(R=>`COUNT(${N(R.name)})`).join(", "),m=await r.query(`SELECT ${g} FROM ${e}`),h=zn.parse(m.records[0]??{});u.forEach((R,b)=>{let w=h[`expr${b}`];if(typeof w!="number")throw new Error(`The org answered no count for ${e}.${R.name}.`);o.set(R.name,w)})}catch(g){Le(a,"fill",g);for(let m of u)o.delete(m.name),i(m,"refused")}}for(let[f,u]of l.entries()){if(f>=Qt){i(u,"query-budget");continue}try{let g=await r.query(`SELECT COUNT() FROM ${e} WHERE ${N(u.name)} != null`);o.set(u.name,g.totalSize)}catch(g){Le(a,"fill",g),i(u,"refused")}}}return{fields:t.filter(f=>o.has(f.name)).map(f=>({fieldApiName:f.name,label:f.label,filled:o.get(f.name)??0,required:Qn(e,f)})).sort((f,u)=>f.filled-u.filled||f.fieldApiName.localeCompare(u.fieldApiName)),unmeasured:s,errors:a}}async function Kn(r,e,t,n,o){let s=[],a=n?t.find(d=>d.name.toLowerCase()===n.toLowerCase()):t.find(d=>d.name==="Email")??t.find(d=>d.nameField===!0);if(!a)return n&&s.push({check:"duplicates",message:`${e} has no field ${n} the org can group records by.`}),{duplicates:null,errors:s};let i={keyField:a.name,keyLabel:a.label,groups:[],groupCount:0,recordCount:0,truncated:!1};if(o===0)return{duplicates:i,errors:s};try{let d=await Gn(r,e,a.name),l=d.rows.map(c=>({value:String(c.value),count:c.count}));return{duplicates:{...i,groups:l.slice(0,Wt),groupCount:l.length,recordCount:l.reduce((c,f)=>c+f.count,0),truncated:d.truncated},errors:s}}catch(d){return Le(s,"duplicates",d),{duplicates:null,errors:s}}}async function Gn(r,e,t){let n=N(t),o=await r.query(`SELECT ${n} k, COUNT(Id) n FROM ${e} WHERE ${n} != null GROUP BY ${n} HAVING COUNT(Id) > 1 ORDER BY COUNT(Id) DESC LIMIT ${tt}`),s=[];for(let a of o.records){let i=qn.safeParse(a);!i.success||i.data.k===null||s.push({value:i.data.k,count:i.data.n})}return{rows:s,truncated:o.records.length>=tt}}async function Yn(r,e,t,n,o){let s=[];if(!t.some(a=>a.name==="LastModifiedDate"&&a.filterable===!0))return{stale:null,errors:s};if(o===0)return{stale:{days:n,records:0},errors:s};try{let a=await r.query(`SELECT COUNT() FROM ${e} WHERE LastModifiedDate < LAST_N_DAYS:${n}`);return{stale:{days:n,records:a.totalSize},errors:s}}catch(a){return Le(s,"stale",a),{stale:null,errors:s}}}async function Zn(r,e,t){let n,o,s;try{if(n=G.parse(await r.describe(N(e.objectApiName))),o=N(n.name),n.queryable===!1)throw new Error(`${o} cannot be queried.`);s=(await r.query(`SELECT COUNT() FROM ${o}`)).totalSize}catch(c){return{status:"failed",objectApiName:e.objectApiName,message:P(c)}}let a=n.fields.filter(Wn).sort((c,f)=>c.label.localeCompare(f.label)),[i,d,l]=await Promise.all([Vn(r,o,n.fields.filter(Vt),s),Kn(r,o,a,e.duplicateKey,s),Yn(r,o,n.fields,t,s)]);return{status:"scanned",objectApiName:e.objectApiName,label:n.label,totalRecords:s,fields:i.fields,unmeasured:i.unmeasured,duplicates:d.duplicates,stale:l.stale,keyFields:a.map(c=>({fieldApiName:c.name,label:c.label})),errors:[...i.errors,...d.errors,...l.errors]}}async function oo(r,e,t=()=>new Date){if(!Number.isInteger(e.staleDays)||e.staleDays<1)throw new Error(`A staleness threshold is a whole number of days, not ${e.staleDays}.`);let n=t().toISOString(),o=[];for(let s of e.objects)o.push(await Zn(r,s,e.staleDays));return{orgId:e.orgId,staleDays:e.staleDays,scannedAt:n,bounds:{duplicateGroupLimit:tt,duplicateSample:Wt,singleFieldQueries:Qt},objects:o}}var nt=1e4,ve=5e4,Kt="DELETE_FAILED",rt="UNABLE_TO_LOCK_ROW",Gt=3,Xn=2e3,Yt="FEATURENOTENABLED",ot="ContentVersion",Zt="ContentDocument",st=new Set([ot,Zt]);async function he(r,e,t,n,o="delete"){let s=!1,a={},i=0,d=0,l=(g,m)=>(d+=g,m()),c={bulk2:{createJob:g=>{let m=r.bulk2.createJob(g);return{get id(){return m.id},open:()=>l(1,()=>m.open()),uploadData:h=>l(1,()=>m.uploadData(h)),close:async()=>{await l(1,()=>m.close()),s=!0},abort:()=>l(1,()=>m.abort()),check:async()=>{let h=await l(1,()=>m.check());return a={state:h.state,message:h.errorMessage},h},getAllResults:async()=>{let h=await l(zt,()=>m.getAllResults());return i=Array.isArray(h)?h.length:(h.successfulResults?.length??0)+(h.failedResults?.length??0),h}}}}},f;try{f=await new Jt().executeBulk({connection:c,bulkManager:new Ne(1),...n?{signal:n}:{}},e,o,t.map(g=>({Id:g})))}catch(g){if(!s){let m=g?.errorCode;return{kind:"untouched",reason:P(g),...typeof m=="string"&&m!==""?{code:m}:{},requests:d}}throw g}if(f.aborted)return{kind:"aborted",requests:d};if(a.state!=="JobComplete"&&i===0)return{kind:"untouched",reason:a.message||`job ${a.state??"not complete"}`,requests:d};let u=new Map(f.outcomes.map(g=>[g.recordIndex,g]));return{kind:"answered",requests:d,rows:t.map((g,m)=>{let h=u.get(m);return h?.success?{success:!0}:{success:!1,error:h?.error??"The job gave no result for it."}})}}function yo(r,e){let t=Me(r);return{...Ce(r,e),queryDeleted:async n=>({records:(await r.query(n,{scanAll:!0})).records}),bulkDestroy:(n,o,s)=>he(t,n,o,s),bulkHardDestroy:(n,o,s)=>he(t,n,o,s,"hardDelete")}}var it=X({success:L(),errors:ae(Ie([X({statusCode:x().optional(),errorCode:x().optional(),message:x().optional()}).loose(),x()])).optional()}).loose();function ne(r){return r.slice(0,15)}function je(r){return typeof r=="string"?void 0:r.statusCode??r.errorCode}function at(r){if(typeof r=="string")return r;let e=je(r),t=r.message??"";return e&&t?`${e}: ${t}`:e||t||"The org gave no reason."}function de(r){return async e=>(await r.query(e)).records.filter(n=>typeof n=="object"&&n!==null)}function er(r){return new Promise(e=>setTimeout(e,r))}function tr(r){let e=Xn*2**r;return Math.floor(e/2+Math.random()*(e/2))}async function Xt(r,e,t,n){let o=[...t];for(let s=0;s<Gt;s++){let a=o.flatMap((d,l)=>d.kind==="refused"&&d.locked===!0?[l]:[]);if(a.length===0||n.stopped?.()===!0||(await(n.wait??er)(tr(s)),n.stopped?.()===!0))break;let i=await e(a.map(d=>r[d]));if(i===void 0)break;a.forEach((d,l)=>{let c=i[l];c&&(o[d]={...c,lockResends:s+1})})}return o}async function dt(r,e,t,n={}){if(e===ot)return dr(r,t,n);let o=s=>nr(r,e,s);return Xt(t,o,await o(t),n)}async function nr(r,e,t){let n;try{n=await r.destroy(e,[...t])}catch(s){let a=P(s);return t.map(()=>({kind:"refused",reason:a,dependency:!1}))}let o=Array.isArray(n)?n:[n];return t.map((s,a)=>{let i=it.safeParse(o[a]);if(i.success&&i.data.success)return{kind:"deleted"};let d=i.success?i.data.errors??[]:[];if(d.some(c=>je(c)==="ENTITY_IS_DELETED"))return{kind:"gone"};let l=d.length>0&&d.every(c=>je(c)===rt);return{kind:"refused",reason:d.length>0?at(d[0]):"The org gave no reason.",dependency:d.some(c=>je(c)===Kt),...l?{locked:!0}:{}}})}async function rr(r,e,t,n="recycle",o={}){let s=n==="hard"?r.bulkHardDestroy?.bind(r):r.bulkDestroy?.bind(r);if(s===void 0)return n==="hard"?{hardRefused:or}:"untouched";let a=async d=>{let l;try{l=await s(e,d,o.signal)}catch(f){let u=P(f);return d.map(()=>({kind:"refused",reason:u,dependency:!1}))}if(l.kind==="aborted")return"aborted";if(l.kind==="untouched"){if(n!=="hard")return"untouched";if(l.code===Yt)return{hardRefused:sr(l.reason)};let f=`Not deleted for good: the job was not handed over \u2014 ${l.reason}`;return d.map(()=>({kind:"refused",reason:f,dependency:!1}))}let{rows:c}=l;return d.map((f,u)=>{let g=c[u];if(g?.success===!0)return{kind:"deleted"};let{code:m,message:h}=ar(g?.error??"");return m==="ENTITY_IS_DELETED"?{kind:"gone"}:{kind:"refused",reason:m&&h?`${m}: ${h}`:g?.error||m||h||"The org gave no reason.",dependency:m===Kt,...m===rt?{locked:!0}:{}}})},i=await a(t);return Array.isArray(i)?Xt(t,async d=>{let l=await a(d);return Array.isArray(l)?l:void 0},i,o):i}var or="Records cannot be deleted for good through this connection: nothing was sent.";function sr(r){return`The user SandForge connects as may not delete records for good in this org: Salesforce refused the job before it held a record (${Yt}: ${r}). Nothing was deleted for good, and nothing was sent to the recycle bin instead.`}var ir="A file is never deleted for good: that takes a Bulk API job, which no file was ever sent by. Not sent.";function ar(r){let e=/^([A-Z][A-Z0-9_]*):([\s\S]*?)(?::(?:--|[\w.,]+))?$/.exec(r.trim());return e?{code:e[1],message:e[2].trim()}:{message:r.trim()}}async function dr(r,e,t){let n;try{n=await j(r,ot,["ContentDocumentId"],e)}catch(d){let l=P(d);return e.map(()=>({kind:"refused",reason:l,dependency:!1}))}let o=new Map;for(let d of n)typeof d.Id=="string"&&typeof d.ContentDocumentId=="string"&&o.set(ne(d.Id),d.ContentDocumentId);let s=[...new Set(o.values())],a=s.length>0?await dt(r,Zt,s,t):[],i=new Map(s.map((d,l)=>[d,a[l]]));return e.map(d=>{let l=o.get(ne(d));return l===void 0?{kind:"gone"}:i.get(l)??{kind:"refused",reason:"The org gave no answer for its document.",dependency:!1}})}function en(r){let e=[];for(let t=0;t<r.length;t+=q)e.push({ids:r.slice(t,t+q),byJob:!1});return e}function tn(r,e,t,n="recycle"){return st.has(e)?!1:n==="hard"||r.bulkDestroy!==void 0&&t>=nt}async function cr(r,e,t,n="recycle"){let o=[],s=!st.has(e)&&(n==="hard"||r.bulkDestroy!==void 0),a=d=>{if(d.length===0)return;if(!s||n!=="hard"&&d.length<nt){o.push(...en(d));return}let l=Math.ceil(d.length/Math.ceil(d.length/ve));for(let c=0;c<d.length;c+=l)o.push({ids:d.slice(c,c+l),byJob:!0})};if(!Ee(e)||t.length===0)return a(t),o;let i=new Set;try{i=new Set([...await pe(de(r),t)].map(ne))}catch{}return a(t.filter(d=>!i.has(ne(d)))),a(t.filter(d=>i.has(ne(d)))),o}function nn(r){return{objectApiName:r,op:"delete"}}async function rn(r,e,t,n,o){let s={stopped:o.stopped,...o.wait?{wait:o.wait}:{}},{stopped:a}=await $t(t,{key:nn(e),sizes:n.sizes,allowance:n.allowance,beforeEachSend:()=>o.stopped()?"stop":void 0,send:async i=>({answers:await dt(r,e,i,s)}),limited:i=>i?.kind==="refused"?jt([i.reason]):void 0,settle:(i,d,l,c)=>{let f=[],u=[];i.forEach((g,m)=>{if(l.has(m))return;let h=d[m]??{kind:"refused",reason:"The org gave no answer for it.",dependency:!1},R=c.get(m);f.push(g),u.push(R!==void 0&&h.kind==="refused"?{...h,dependency:!1,limit:R}:h)}),f.length>0&&o.settle(f,u)}});return a!==void 0}function ct(r,e){let t=nn(r),n=e.sizes.report(t);if(!n)return[];let o=[];return n.rows+n.alone+n.notSplit+n.keptWhole>0&&o.push(xt(n)),n.notSplit>0&&o.push(Ft(n.notSplit,Ut(e.allowance,t),"removal")),n.keptWhole>0?o.push(Bt):n.alone>0&&o.push(_t),o}function on(r){let e=0,t=0,n=0,o=0;for(let a of r)e++,a==="deleted"?t++:a==="gone"?n++:o++;if(e===0)return[];let s=[t>0?`${t} deleted`:"",n>0?`${n} already gone`:"",o>0?`${o} still refused`:""].filter(Boolean);return[`The org could not lock ${e} record(s) (${rt}), each sent again up to ${Gt} times, a wait before each: ${s.join(", ")}.`]}async function sn(r,e,t,n){let o=n.mode??"recycle";if(o==="hard"&&st.has(e))return t.length>0&&n.settle(t,t.map(()=>({kind:"refused",reason:ir,dependency:!1}))),{stopped:!1};let s=n.wait?{wait:n.wait}:{},a=await cr(r,e,t,o);for(let i=a.shift();i!==void 0;i=a.shift()){let{ids:d,byJob:l}=i;if(n.stopped())return{stopped:!0};if(await n.prepare?.(d),!l){if(await rn(r,e,d,n.splitting,{stopped:n.stopped,settle:n.settle,...s}))return{stopped:!0};continue}let c=await rr(r,e,d,o,{stopped:n.stopped,...s,...n.signal?{signal:n.signal}:{}});if(c==="aborted")return{stopped:!0};if(c==="untouched"){a.unshift(...en(d));continue}if(!Array.isArray(c))return{stopped:!0,hardRefused:c.hardRefused};n.settle(d,c)}return{stopped:!1}}async function an(r,e){for(let t=0,n=!0;n;t++){n=!1;for(let o of r){let s=e.idsOf(o,t);if(s.length===0)continue;if(e.stopped())return!0;let a=e.deleted(o);if(await e.send(o,s,t))return!0;e.deleted(o)>a&&(n=!0)}}return!1}async function Te(r,e){let t=new Set(e.map(a=>a.objectApiName)),n=new Map;for(let{objectApiName:a}of e){let i;try{i=(G.parse(await r.describe(a)).childRelationships??[]).map(l=>l.childSObject)}catch{continue}for(let d of i){if(d===a||!t.has(d))continue;let l=n.get(d)??new Set;l.add(a),n.set(d,l)}}let o=[...e],s=[];for(;o.length>0;){let a=o.findIndex(i=>!o.some(d=>d!==i&&n.get(d.objectApiName)?.has(i.objectApiName)));s.push(...o.splice(a>=0?a:0,1))}return s}async function lt(r,e,t){if(r.length===0)return{gone:[],unchecked:[]};let n;try{n=await e(r)}catch(a){return{gone:[],unchecked:[...r],failure:P(a)}}let o=new Set(n.map(a=>ne(String(a.Id)))),s=r.filter(a=>!o.has(ne(a)));return{gone:s.filter(t),unchecked:s.filter(a=>!t(a))}}function lr(r){return r.filter(e=>me[e]!==void 0&&!Ze.has(e))}async function ut(r,e,t,n,o,s){let a=de(r),i=[];for(let{objectApiName:d}of e){let l=me[d];if(!l||Ze.has(d))continue;let c;for await(let f of t.pages(d)){let u=f.filter(w=>n(d,w));if(u.length===0)continue;if(o())return{drafted:i,cancelled:!0};c??=await Pe(a,l);let g=c,m=g?.draft;if(!g||!m)break;let h=await s(d,u),R;try{R=await j(r,d,["Status"],u)}catch{continue}let b=R.filter(w=>typeof w.Id=="string"&&!h.has(w.Id.slice(0,15))).filter(w=>{let k=g.categoryOf.get(String(w.Status));return k!==void 0&&k!=="Draft"}).map(w=>({objectApiName:d,id:String(w.Id),draft:m,status:String(w.Status)}));for(let w=0;w<b.length;w+=q){if(o())return{drafted:i,cancelled:!0};let k=b.slice(w,w+q);i.push(...k);try{await r.update(d,k.map(({id:I})=>({Id:I,Status:m})))}catch{}}}}return{drafted:i,cancelled:!1}}function Oo(r,e,t,n){if(t)return`${r} ${t.id}: ${e}`;let o=n.filter(s=>s.objectApiName===r).map(s=>`${s.id} (${s.status})`);return o.length>0?`${r}: ${e} Set to Draft, with the status each had: ${o.join(", ")}.`:`${r}: ${e}`}async function dn(r,e,t){let n=[...new Set(e.map(o=>o.objectApiName))];for(let o of n){let s=e.filter(c=>c.objectApiName===o),a=new Map(s.map(c=>[c.id.slice(0,15),c])),i=s.map(c=>c.id),d;try{d=await j(r,o,["Status"],i)}catch(c){t.note(o,`Status set to ${s[0].draft} for the delete, and not read back to be restored: ${P(c)}`,!0);continue}let l=d.flatMap(c=>{let f=typeof c.Id=="string"?a.get(c.Id.slice(0,15)):void 0;return f&&c.Status===f.draft?[f]:[]});for(let c=0;c<l.length;c+=q){let f=l.slice(c,c+q),u;try{u=await r.update(o,f.map(({id:m,status:h})=>({Id:m,Status:h})))}catch(m){u=f.map(()=>({success:!1,errors:[P(m)]}))}let g=Array.isArray(u)?u:[u];f.forEach(({draft:m,status:h},R)=>{let b=it.safeParse(g[R]);if(b.success&&b.data.success){t.note(o,`Status set to ${m} for the delete, then back to ${h}.`,!1,f[R]);return}let w=b.success?b.data.errors??[]:[],k=w.length>0?at(w[0]):"The org gave no reason.";t.note(o,`Status set to ${m} for the delete, and left there: the org refused ${h} back \u2014 ${k}`,!0,f[R])})}}}var le="DuplicateRecordSet",ur="DuplicateRecordItem",_e=2e3,fr=999,gr=/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/;function T(r){return r.slice(0,15)}function cn(r){return new Date(r).toISOString().replace(/\.\d{3}Z$/,"Z")}function ft(r){return typeof r=="string"?Date.parse(r):Number.NaN}async function ln(r,e){return(await mr(r,e)).map(t=>({id:t.id,modified:pr(t,e)}))}async function mr(r,e){if(!Number.isFinite(e.start)||!Number.isFinite(e.end)||!gr.test(e.user))return[];let t;try{let l=await r.query(`SELECT Id, CreatedDate, LastModifiedDate, LastModifiedById FROM ${le} WHERE CreatedDate >= ${cn(e.start-2e3)} AND CreatedDate <= ${cn(e.end+6e4)} LIMIT ${_e}`);if(l.records.length>=_e)return[];t=l.records.filter(c=>typeof c=="object"&&c!==null)}catch{return[]}let n=t.flatMap(l=>typeof l.Id=="string"?[l.Id]:[]);if(n.length===0)return[];let o=new Map,s=new Map,a=new Map;try{for(let l of H(n)){let c=await r.query(`SELECT Id, RecordId, DuplicateRecordSetId, CreatedDate FROM ${ur} WHERE DuplicateRecordSetId IN (${l}) LIMIT ${_e}`);if(c.records.length>=_e)return[];for(let f of c.records){let u=f??{},g=u.DuplicateRecordSetId,m=u.RecordId;if(typeof g!="string")continue;let h=ft(u.CreatedDate);if(Number.isFinite(h)&&!(h<=(a.get(T(g))??Number.NaN))&&a.set(T(g),h),typeof m!="string"||!e.has(T(m))){let R=o.get(T(g))??new Set;R.add(typeof m=="string"?T(m):`item ${String(u.Id)}`),o.set(T(g),R)}else s.set(T(g),[...s.get(T(g))??[],T(m)])}}}catch{return[]}let i=T(e.user),d=(l,c)=>{let f=o.get(l)?.size??0;return s.has(l)?f<=1:f===0&&typeof c=="string"&&T(c)===i};return t.flatMap(l=>typeof l.Id=="string"&&d(T(l.Id),l.LastModifiedById)?[{id:l.Id,created:ft(l.CreatedDate),modified:ft(l.LastModifiedDate),...typeof l.LastModifiedById=="string"?{modifiedBy:l.LastModifiedById}:{},names:s.get(T(l.Id))??[],...a.has(T(l.Id))?{itemsMade:a.get(T(l.Id))}:{}}]:[])}function pr(r,e){if((r.modifiedBy!==void 0?T(r.modifiedBy):"")===T(e.user)&&r.modified<=e.end+6e4)return Math.min(r.modified,e.end);let n=e.end+6e4;return r.names.length>0&&r.created<=n&&r.modified<=n&&(r.modified===r.created||r.modified<=(r.itemsMade??Number.NaN)+fr)?Math.min(r.modified,e.end):r.modified}async function un(r,e,t,n="recycle"){let o=N(e),s=new Set;try{for(let a of H(t)){let i=await r.queryDeleted(`SELECT Id FROM ${o} WHERE Id IN (${a}) AND IsDeleted = true`);for(let d of i.records){let l=d?.Id;typeof l=="string"&&s.add(l.slice(0,15))}}}catch(a){return{error:P(a)}}return{deleted:s,inBin:n!=="hard"}}var hr=/__kav$/i;function ye(r){return hr.test(r)}function gn(r){return r.replace(/v$/i,"")}var gt="Kept: its article holds a version the run did not write \u2014 a draft begun on it, or a version published since \u2014 which deleting the article would take with it. A removal that takes what changed since the run takes it too.",yr={statusCode:"ENTITY_IS_DELETED",message:"The version is no longer in the org: it went with its article."},fn=" AND IsLatestVersion = false AND PublishStatus = 'Archived'",br="An article version is deleted through its article, over REST.",Rr={success:!1,errors:[{message:"The org gave no reason."}]};function J(r){return r.slice(0,15)}function mn(r,e){let t=r.bulkDestroy?.bind(r);return{query:n=>r.query(n),queryDeleted:n=>r.queryDeleted(n),update:(n,o)=>r.update(n,o),serverTime:()=>r.serverTime(),userId:()=>r.userId(),describeGlobal:()=>r.describeGlobal(),describe:n=>ye(n)?wr(r,n):r.describe(n),destroy:(n,o)=>ye(n)?Sr(r,n,o,e):r.destroy(n,o),...t?{bulkDestroy:(n,o,s)=>ye(n)?Promise.resolve({kind:"untouched",reason:br,requests:0}):t(n,o,s)}:{}}}async function wr(r,e){let t=await r.describe(e);if(typeof t!="object"||t===null)return t;let n;try{n=(await r.describe(gn(e)))?.deletable}catch{n=void 0}let o={...t};return delete o.deletable,typeof n=="boolean"?{...o,deletable:n}:o}async function pn(r,e,t){let n=N(e),o=new Map,s=new Map,a=(d,l)=>{for(let c of d){let f=c;if(typeof f?.Id!="string"||typeof f.KnowledgeArticleId!="string")continue;l?.set(J(f.Id),f.KnowledgeArticleId);let u=J(f.KnowledgeArticleId),g=s.get(u)??new Set;g.add(J(f.Id)),s.set(u,g)}};for(let d of["",fn])for(let l of H(t)){let c=await r.query(`SELECT Id, KnowledgeArticleId FROM ${n} WHERE Id IN (${l})${d}`);a(c.records,o)}let i=[...new Set(o.values())];for(let d of["",fn])for(let l of H(i)){let c=await r.query(`SELECT Id, KnowledgeArticleId FROM ${n} WHERE KnowledgeArticleId IN (${l})${d}`);a(c.records)}return{articleOf:o,versions:s}}function hn({articleOf:r,versions:e},t,n){if(n.includeChanged)return new Set;let o=new Set(t.map(J)),s=a=>[...e.get(a)??[]].some(i=>!o.has(i));return new Set([...r.values()].map(J).filter(s))}async function yn(r,e,t,n){let o=await pn(r,e,t),s=hn(o,t,n);return new Set(t.map(J).filter(a=>{let i=o.articleOf.get(a);return i!==void 0&&s.has(J(i))}))}async function Sr(r,e,t,n){let o=await pn(r,e,t),{articleOf:s}=o,a=[...new Set(s.values())],i=hn(o,t,n),d=a.filter(c=>!i.has(J(c))),l=new Map;if(d.length>0){let c;try{c=await r.destroy(gn(e),d)}catch(u){let g=P(u);c=d.map(()=>({success:!1,errors:[{message:g}]}))}let f=Array.isArray(c)?c:[c];d.forEach((u,g)=>l.set(J(u),f[g]))}return t.map(c=>{let f=s.get(J(c));return f===void 0?{success:!1,errors:[yr]}:i.has(J(f))?{success:!1,errors:[{message:gt}]}:l.get(J(f))??Rr})}var xe="Quote",Re="QuoteLineItem",be="Opportunity",we="OpportunityLineItem",bn=2e3;function kr(r){return r.slice(0,15)}function Rn(r){return typeof r=="string"?Date.parse(r):Number.NaN}function F(r,e){let t=r[e];return typeof t=="string"&&t!==""?kr(t):void 0}function pt(r,e){return r.has(e)||r.otherParts?.has(e)===!0}function Or(r,e){let t=new Set,n=new Set;for(let g of r.syncing){let m=F(g,"Id"),h=F(g,"SyncedQuoteId");!m||!h||!pt(e,m)||!e.has(h)||(t.add(h),n.add(m))}if(t.size===0)return[];let o=r.quoteLines.filter(g=>{let m=F(g,"QuoteId");return m!==void 0&&t.has(m)&&F(g,"Id")!==void 0}),s=r.opportunityLines.filter(g=>{let m=F(g,"OpportunityId");return m!==void 0&&n.has(m)&&F(g,"Id")!==void 0}),a=g=>F(g,"CreatedById"),i=(g,m)=>{let h=F(g,"Id");if(!h||pt(e,h)||!m)return!1;let R=e.user??a(m),b=Rn(g.CreatedDate);return R!==void 0&&a(g)===R&&b>=e.start&&b<=e.end},d=g=>({id:String(g.Id),modified:Rn(g.LastModifiedDate)}),l=new Map(s.flatMap(g=>{let m=F(g,"Id");return m&&e.has(m)?[[m,g]]:[]})),c=new Map;for(let g of o){let m=F(g,"Id"),h=F(g,"OpportunityLineItemId");m&&h&&e.has(m)&&!c.has(h)&&c.set(h,g)}let f=o.filter(g=>{let m=F(g,"OpportunityLineItemId");return i(g,m?l.get(m):void 0)}).map(d),u=s.filter(g=>{let m=F(g,"Id");return i(g,m?c.get(m):void 0)}).map(d);return[...f.length>0?[{objectApiName:Re,copies:f}]:[],...u.length>0?[{objectApiName:we,copies:u}]:[]]}function wn(r,e=[]){let t=new Set(r),n=t.has(be)||new Set(e).has(be);if(!t.has(xe)||!n)return[];let o=t.has(Re),s=t.has(we);return o===s?[]:[o?we:Re]}async function mt(r,e,t,n,o){let s=t.map(N).join(", "),a=[];for(let i of H(o)){let d=await r.query(`SELECT ${s} FROM ${N(e)} WHERE ${N(n)} IN (${i}) LIMIT ${bn}`);if(d.records.length>=bn)throw new Error(`More ${e} records than one read takes.`);for(let l of d.records)typeof l=="object"&&l!==null&&a.push(l)}return a}async function Sn(r,e,t,n){let o=n.has(Re)||n.has(we),s=n.has(be)||e.otherParts?.objects.has(be)===!0;if(t.length===0||!s||!o)return[];try{let i=(await mt(r,be,["Id","SyncedQuoteId"],"SyncedQuoteId",t)).filter(c=>{let f=F(c,"Id");return f!==void 0&&pt(e,f)});if(i.length===0)return[];let d=await mt(r,Re,["Id","QuoteId","OpportunityLineItemId","CreatedById","CreatedDate","LastModifiedDate"],"QuoteId",[...new Set(i.map(c=>String(c.SyncedQuoteId)))]),l=await mt(r,we,["Id","OpportunityId","CreatedById","CreatedDate","LastModifiedDate"],"OpportunityId",i.map(c=>String(c.Id)));return Or({syncing:i,quoteLines:d,opportunityLines:l},e)}catch{return[]}}var Ar=5,Se=4,Fe=2e3,Dr=4,He=[["CreatedDate","LastModifiedDate","CreatedById","LastModifiedById"],["CreatedDate","LastModifiedDate","CreatedById"],["SystemModstamp"],[]],yt=1e4,Ir="005",kn="ContentDocumentLink",Er="ContentDocument",Pr="ContentVersion",Cr=5;function Je(r){let e=new Set(r.flatMap(n=>n.ids.map(y))),t=new Map;for(let{objectApiName:n,ids:o}of r)t.set(n,[...t.get(n)??[],...o]);return{objects:[...t].map(([n,o])=>({objectApiName:n,count:o.length})),pages:async function*(n){let o=t.get(n);o&&o.length>0&&(yield o)},has:n=>e.has(n)}}function re(r){return!Array.isArray(r)}function es(r){return re(r)?r.objects.reduce((e,t)=>e+t.count,0):r.reduce((e,t)=>e+t.ids.length,0)}function ts(r){return(re(r)?r.objects:r).map(e=>e.objectApiName)}var ze=class{bits=new Uint8Array(0);add(e){let t=e>>3;if(t>=this.bits.length){let n=new Uint8Array(Math.max(t+1,this.bits.length*2,64));n.set(this.bits),this.bits=n}this.bits[t]|=1<<(e&7)}has(e){let t=e>>3;return t<this.bits.length&&(this.bits[t]&1<<(e&7))!==0}},bt=class{dates=new Float64Array(0);set(e,t){if(e>=this.dates.length){let n=new Float64Array(Math.max(e+1,this.dates.length*2,64)).fill(Number.NaN);n.set(this.dates),this.dates=n}this.dates[e]=t}at(e){return e<this.dates.length?this.dates[e]:Number.NaN}latestWithin(e,t){let n=Number.NaN;for(let o of this.dates)o>=e&&o<=t&&!(o<=n)&&(n=o);return n}};function ue(r,e){return typeof r=="string"&&e.has(y(r))}var On=[{created:"CreatedDate",modified:"LastModifiedDate"},{modified:"SystemModstamp"}],ht={ContentDocumentLink:{ends:["ContentDocumentId","LinkedEntityId"],cameWithRun:(r,e)=>{let t=r.LinkedEntityId;return ue(r.ContentDocumentId,e)&&(ue(t,e)||typeof t=="string"&&t.startsWith(Ir))}},DuplicateRecordItem:{ends:["RecordId"],cameWithRun:(r,e)=>ue(r.RecordId,e)},ContentVersion:{ends:["ContentDocumentId"],cameWithRun:(r,e)=>ue(r.ContentDocumentId,e)},[te.objectApiName]:{ends:[te.parent,te.field],cameWithRun:(r,e)=>r[te.field]===te.value&&ue(r[te.parent],e)}};function ns(r,e){return{...Ce(r,e),serverTime:async()=>(await r.soap.getServerTimestamp()).timestamp,userId:async()=>(await r.soap.getUserInfo()).userId,queryDeleted:async t=>({records:(await r.query(t,{scanAll:!0})).records}),bulkDestroy:(t,n,o)=>he(Me(r),t,n,o)}}function Rt(r,e,t){let n=new Map;for(let o of r??[]){let s=kt(o.span,[],t);if(Number.isFinite(s.end))for(let a of o[e]??[]){let i=y(a);s.end<=(n.get(i)?.end??Number.NEGATIVE_INFINITY)||n.set(i,s)}}return n}function Nr(r=[],e=[]){if(r.length===0&&e.length===0)return;let t=[...r.map(({plan:n})=>re(n)?n:Je(n)),Je(e)];return{has:n=>t.some(o=>o.has(n))}}function Mr(r=[],e=[]){return new Set([...r.map(({plan:t})=>re(t)?t.objects:t),e].flat().map(t=>t.objectApiName))}function Pn(r,e){return new Map([...Rt(r,"wrote",e)].map(([t,{end:n}])=>[t,n]))}function Cn(r,e){return`The user SandForge connects as may not delete ${r} records in this org: the ${e} record(s) of the run stay, and were not sent.`}function wt(r,e){return`Not visible: ${r} record(s) found neither in the org nor in its recycle bin, as the user the removal runs as sees them \u2014 out of that user's sight, or deleted for good \u2014 are not counted as removed`+(e?` (the recycle bin could not be read: ${e})`:".")}function An(r,e,t){for(let o of r){let s=o.deleted+o.alreadyGone+o.keptChanged+o.keptDependents+o.refused+(o.notVisible??0);o.planned>s&&(o.notReached=o.planned-s)}let n=new Set(r.map(o=>o.objectApiName));for(let{objectApiName:o,count:s}of e)s===0||n.has(o)||(n.add(o),r.push({...new ke(o,s,t(o)).result,notReached:s}));return r}var rs={objects:[],cancelled:!1,gone:[],stamps:{},left:async function*(){}};function y(r){return r.slice(0,15)}function Lr(r){return r?.errorCode==="INVALID_FIELD"||/no such column/i.test(P(r))}function jr(r,e){let t=/no such column '(\w+)'/i.exec(P(r))?.[1],n=He.findIndex((o,s)=>s>e&&(t===void 0||!o.includes(t)));return n===-1?He.length:n}function M(r){return typeof r=="string"?Date.parse(r):Number.NaN}function Nn(){return{modified:new bt,missing:new Set,firstCreated:Number.NaN,lastCreated:Number.NaN,binned:new Set}}var ke=class{result;notes=[];refused=new Map;unread;held=[];goneAt=new ze;goneLater=new Set;deletedLater=new Set;notVisible=0;notVisibleNote;secondTry=new Set;filesLeft=new Map;automationHeld=new Map;automationHeldAfter=new Set;automationHeldAlong=new Set;tookAlong=new Map;cameAlong=new Map;limitNotes=[];lockResent=new Map;constructor(e,t,n=0){this.result={objectApiName:e,planned:t,deleted:0,alreadyGone:0,keptChanged:0,keptDependents:0,refused:0,heldBy:[],...n>0?{platformCopies:n}:{},unchecked:[],reasons:[]}}note(e){this.notes.includes(e)||this.notes.push(e)}isGone(e,t){return this.goneAt.has(t)||this.goneLater.has(y(e))}waiting(){return[...[...this.refused].filter(([,e])=>e.dependency).map(([e])=>e),...this.held]}refusedSent(){return[...this.refused].filter(([,e])=>e.sent).map(([e])=>e)}refusedToSendAgain(){return[...this.refused].filter(([,e])=>e.sent&&e.limit!==!0).map(([e])=>e)}secondTryNote(){if(this.secondTry.size===0)return[];let e=0,t=0,n=0,o=0;for(let a of this.secondTry){let i=y(a);this.deletedLater.has(i)?e++:this.goneLater.has(i)?t++:this.refused.has(a)?o++:n++}return[`Refused at first, sent again once the rest had gone: ${[e>0?`${e} deleted`:"",t>0?`${t} already gone`:"",n>0?`${n} kept for records that stay`:"",o>0?`${o} refused again`:""].filter(Boolean).join(", ")}.`]}settle(){this.result.keptDependents=this.held.length,this.result.refused=this.refused.size+(this.unread?.count??0),this.notVisible>0&&(this.result.notVisible=this.notVisible),this.held.length===0&&(this.result.heldBy=[]);let e=this.held.flatMap(s=>{let a=this.automationHeld.get(y(s));return a?[a]:[]}),t=this.held.filter(s=>{let a=y(s);return this.automationHeld.has(a)&&this.automationHeldAfter.has(a)}).length,n=this.held.filter(s=>{let a=y(s);return this.automationHeld.has(a)&&this.automationHeldAlong.has(a)}).length;e.length>0?(this.result.heldByAutomation=e.length,t>0?this.result.heldByAutomationAfterRun=t:delete this.result.heldByAutomationAfterRun,n>0?this.result.heldByAutomationAlong=n:delete this.result.heldByAutomationAlong,this.result.automationHolders=[...new Set(e.flatMap(s=>[...s]))]):(delete this.result.heldByAutomation,delete this.result.heldByAutomationAfterRun,delete this.result.heldByAutomationAlong,delete this.result.automationHolders);let o=[...this.notVisibleNote?[this.notVisibleNote]:[],...this.notes,...this.limitNotes,...on(this.lockResent.values()),...this.secondTryNote(),...this.unread?[this.unread.reason]:[],...[...this.refused.values()].map(s=>s.reason)];return this.result.reasons=[...new Set(o)].slice(0,Ar),this.filesLeft.size>0&&(this.result.filesLeft={count:this.filesLeft.size,names:[...this.filesLeft.values()].slice(0,Cr)}),this.tookAlong.size>0&&(this.result.tookAlong={count:this.tookAlong.size,objects:[...new Set(this.tookAlong.values())]}),this.cameAlong.size>0&&(this.result.cameAlong={count:this.cameAlong.size,objects:[...new Set(this.cameAlong.values())]}),this.result}};async function os(r,e,t){let n=re(e)?e:Je(e),o=n,s=o.objects.reduce((p,S)=>p+S.count,0),a=new Map,i=p=>a.get(p)??0,d=()=>t.signal?.aborted===!0,l=t.splitting??Tt(),c=()=>({objects:An([],o.objects,i),cancelled:!0,gone:[],stamps:{},left:()=>En(n)}),f=new Map,u=new Map;for(let{objectApiName:p}of o.objects){let S=Nn();f.set(p,S);let O=0;for await(let A of o.pages(p)){if(d())return c();let v=A[0];v!==void 0&&!u.has(v.slice(0,3))&&u.set(v.slice(0,3),p);let E=O;if(O+=A.length,S.error!==void 0)continue;let D=await Ur(r,p,A,E,S);if(S.error!==void 0||D.length===0)continue;if(d())return c();let B=await un(r,p,D);if("error"in B)S.binError=B.error;else for(let z of B.deleted)S.binned.add(z)}}let g=new Map,m=!1,h=r.bulkDestroy?.bind(r),R={query:p=>r.query(p),destroy:(p,S)=>(m=!0,r.destroy(p,S)),...h?{bulkDestroy:(p,S)=>(m=!0,h(p,S,t.signal))}:{},update:(p,S)=>(m=!0,r.update(p,S)),serverTime:()=>r.serverTime(),userId:()=>r.userId(),queryDeleted:p=>r.queryDeleted(p),describeGlobal:()=>r.describeGlobal(),describe:p=>{let S=g.get(p);return S||(S=r.describe(p),g.set(p,S)),S}},b=mn(R,{includeChanged:t.includeChanged}),w=await Te(b,o.objects),k=await xr(b,w,(p,S)=>S-(f.get(p)?.missing.size??0)),I=new Set(k.map(p=>p.objectApiName));if(k.length>0&&t.onUndeletable&&t.previewOnly!==!0){if(d())return c();if(!await t.onUndeletable(k))return{...c(),objects:[],undeletable:k,stoppedForUndeletable:!0}}let[C,_]=await Promise.all([Jr(b),t.previewOnly===!0?void 0:zr(b)]),{start:Y,end:V}=kt(t,f.values(),C.aheadMs);if(d())return c();let oe=Nr(t.otherParts,t.otherPartRecords),qe=Mr(t.otherParts,t.otherPartRecords),Ae=await $r(b,o,{start:Y,end:V,...t.runUserId?{user:y(t.runUserId)}:{},...oe?{otherParts:{has:p=>oe.has(p),objects:qe}}:{},undeletable:I,snapshots:f}),We=[];if(t.runUserId&&t.alongAccepted!==!0){let p=await ln(b,{has:S=>o.has(S),start:Y,end:V,user:t.runUserId});if(p.length>0&&!o.objects.some(S=>S.objectApiName===le)&&await Mn(b,le)){Ae.push({objectApiName:le,copies:p});for(let S of p)We.push(S.id)}}if(Ae.length>0){o=await Hr(o,Ae,f,u);for(let{objectApiName:p,copies:S}of Ae)a.set(p,S.length);s=o.objects.reduce((p,S)=>p+S.count,0),w=await Te(b,o.objects)}let Tn=new Map(Object.entries(t.removalStamps??{}).map(([p,S])=>[y(p),M(S)])),_n=Pn(t.laterParts,C.aheadMs),se=new Set;for(let{objectApiName:p}of o.objects){let S=f.get(p);if(!S||S.error!==void 0)continue;let O=0;for await(let A of o.pages(p))for(let v of A){let E=S.modified.at(O++),D=y(v);if(S.missing.has(D))continue;E<=V||E<=(Tn.get(D)??Number.NaN)||E<=(_n.get(D)??Number.NaN)||se.add(D)}}if(t.previewOnly===!0){if(d())return c();let p=new Set,S=await Tr(b,o,w,{snapshots:f,changed:se,undeletable:I,includeChanged:t.includeChanged,stopped:d,copiesOf:i,...t.previewHeld===!0?{held:{notSent:p,check:new Oe(b,{runRecords:o,reached:{has:()=>!1},stays:O=>p.has(O),runStart:Y,runEnd:V,removalStart:C.start,removalUser:void 0,earlierRemovals:(t.removalSpans??[]).map(O=>({start:M(O.first),end:M(O.last),user:y(O.userId)})),includeChanged:t.includeChanged,previewing:!0,...t.goesWithParent?{goesWithParent:t.goesWithParent}:{},...t.goesWithParentReadBelow?{goesWithParentReadBelow:!0}:{},...t.alongAccepted?{alongAccepted:t.alongAccepted}:{},...t.runUserId?{runUser:y(t.runUserId)}:{},...t.laterParts?{linkedLater:Rt(t.laterParts,"linked",C.aheadMs)}:{},...oe?{otherPartRecords:oe,otherPartObjects:qe}:{}})}}:{}});return S?{...k.length>0?{undeletable:k}:{},objects:[],cancelled:!1,gone:[],stamps:{},left:()=>En(n),preview:S}:c()}let Ot=await Fr(b,t.otherParts??[],C.aheadMs,d);if(!Ot)return c();let At=new Set,Bn={has:p=>o.has(p)&&At.has(u.get(p.slice(0,3))??"")},Qe=new Oe(b,{runRecords:o,reached:Bn,stays:p=>se.has(p)&&!t.includeChanged,runStart:Y,runEnd:V,removalStart:C.start,removalUser:_,earlierRemovals:(t.removalSpans??[]).map(p=>({start:M(p.first),end:M(p.last),user:y(p.userId)})),includeChanged:t.includeChanged,...t.goesWithParent?{goesWithParent:t.goesWithParent}:{},...t.goesWithParentReadBelow?{goesWithParentReadBelow:!0}:{},...t.alongAccepted?{alongAccepted:t.alongAccepted}:{},...t.alongToDraft?{alongToDraft:t.alongToDraft}:{},...t.runUserId?{runUser:y(t.runUserId)}:{},...t.automationMade?{automationMade:vn(t.automationMade)}:{},...t.laterParts?{linkedLater:Rt(t.laterParts,"linked",C.aheadMs)}:{},...oe?{otherPartRecords:oe,otherPartObjects:qe}:{}});if(d())return c();await t.beforeFirstWrite?.(),t.sweep&&await t.sweep(l)&&(m=!0);let Z=[],Dt=p=>Z.find(S=>S.result.objectApiName===p);async function*Ve(p,S,O){for(let{objectApiName:A}of S){let v=Dt(A),E=0;for await(let D of p.pages(A)){let B=D.filter(z=>O(A,z,v?.isGone(z,E++)===!0));B.length>0&&(yield{objectApiName:A,ids:B})}}}let xn=()=>Ve(o,w,(p,S,O)=>{let A=f.get(p),v=y(S);return A?.modifiedColumn==="LastModifiedDate"&&!A.missing.has(v)&&!se.has(v)&&!O}),De=[],$=async p=>{await dn(b,De,{note:(D,B,z)=>{let U=Dt(D);if(!U){if(!z)return;let W=o.objects.find(Q=>Q.objectApiName===D);U=new ke(D,W?.count??0,i(D)),Z.push(U)}U.note(B)}});let S=m?await Dn(b,xn(),{start:C.start,user:_}):{},O=[];if(m)for(let D of Ot)O.push(await Dn(b,D.unchanged(),{start:C.start,user:_}));let A=m?qr(C,_):void 0,v=[];if(!re(e))for await(let{ids:D}of Ve(n,w,(B,z,U)=>U))for(let B of D)v.push(B);for(let D of Z)D.limitNotes=ct(D.result.objectApiName,l);let E=Z.map(D=>D.settle());return{...k.length>0?{undeletable:k}:{},objects:p?An(E,w,i):E,cancelled:p,gone:v,left:()=>Ve(n,n.objects,(D,B,z)=>!z),stamps:S,...A?{span:A}:{},...O.length>0?{otherPartStamps:O}:{},...We.length>0?{duplicateSets:We}:{}}};if(d())return m?$(!0):c();let It=async(p,S)=>(await Qe.heldAmong(p,S)).held,Et=await ut(b,w,o,(p,S)=>{let O=y(S),A=f.get(p);return A!==void 0&&A.error===void 0&&!I.has(p)&&!A.missing.has(O)&&!(se.has(O)&&!t.includeChanged)},d,It);if(De=Et.drafted,Et.cancelled)return $(!0);if(t.alongToDraft){let p=await ut(b,t.alongToDraft.objects,t.alongToDraft,()=>!0,d,It);if(De=[...De,...p.drafted],p.cancelled)return $(!0)}let K=0;for(let{objectApiName:p,count:S}of w){if(d())return $(!0);let O=new ke(p,S,i(p));Z.push(O),At.add(p);let A=f.get(p);if(!A||A.error!==void 0){O.unread={reason:A?.error??"The org gave no reason.",count:S},K+=S,t.onProgress?.(K,s,p);continue}if(I.has(p)){let U=0,W=0;for await(let Q of o.pages(p))for(let ie of Q){let fe=y(ie),Un=U++;A.missing.has(fe)?A.binned.has(fe)?(O.result.alreadyGone++,O.goneAt.add(Un)):O.notVisible++:W++}O.notVisible>0&&(O.notVisibleNote=wt(O.notVisible,A.binError)),W>0&&(O.unread={reason:Cn(p,W),count:W}),K+=S,t.onProgress?.(K,s,p);continue}let v=tn(b,p,S),E=[],D=new Map,B=async()=>{let U=E,W=D;return E=[],D=new Map,In(b,Qe,O,U,{stopped:d,splitting:l,placeOf:W,onDeleted:Q=>{K+=Q,t.onProgress?.(K,s,p)},onHeld:Q=>{K+=Q,t.onProgress?.(K,s,p)}})},z=0;for await(let U of o.pages(p)){if(d())return $(!0);let W=E.length;for(let Q of U){let ie=y(Q),fe=z++;A.missing.has(ie)?A.binned.has(ie)?(O.result.alreadyGone++,O.goneAt.add(fe)):O.notVisible++:se.has(ie)&&!t.includeChanged?O.result.keptChanged++:(E.push(Q),D.set(ie,fe))}if(O.notVisible>0&&(O.notVisibleNote=wt(O.notVisible,A.binError)),K+=U.length-(E.length-W),!(v&&E.length<ve)&&await B())return $(!0)}if(v&&E.length>0&&(d()||await B()))return $(!0)}let Fn=Z.some(p=>p.result.deleted>0);if(await an(Z,{stopped:d,idsOf:(p,S)=>{if(S>0)return p.waiting();let O=p.refusedToSendAgain();return O.length>0||Fn?[...O,...p.held]:[]},send:async(p,S,O)=>{let A=new Set(O===0?p.refusedToSendAgain():[]),v=await In(b,Qe,p,S,{stopped:d,splitting:l,onSent:E=>{for(let D of E)A.has(D)&&p.secondTry.add(D)}});for(let E of p.held)A.has(E)&&p.secondTry.add(E);return v},deleted:p=>p.result.deleted}))return $(!0);if(t.afterRemoval){if(d())return $(!0);await t.afterRemoval(l)&&(m=!0)}for(let p of Z){if(d())return $(!0);await Br(b,p,f.get(p.result.objectApiName))}return $(!1)}async function vr(r,e,t,n,o){let{changed:s,includeChanged:a}=o,i=[];for await(let d of e.pages(t))for(let l of d){let c=y(l);!n.has(c)&&(a||!s.has(c))&&i.push(l)}try{return{kept:await yn(r,t,i,{includeChanged:a})}}catch(d){return{kept:new Set,unread:P(d)}}}async function Tr(r,e,t,n){let o=[],s=new Set,a=new Set;for(let{objectApiName:i,count:d}of t){let l=n.copiesOf(i),c={objectApiName:i,planned:d,toDelete:0,alreadyGone:0,changedSince:0,keptChanged:0,changedBy:{},undeletable:0,notVisible:0,unread:0,...l>0?{platformCopies:l}:{},reasons:[]};o.push(c);let f=n.snapshots.get(i);if(!f||f.error!==void 0){if(c.unread=d,c.reasons.push(f?.error??"The org gave no reason."),n.held)for await(let R of e.pages(i))for(let b of R)n.held.notSent.add(y(b));continue}let u=ye(i)&&!n.undeletable.has(i)?await vr(r,e,i,f.missing,n):void 0,g=[],m=[],h=R=>{n.held?.notSent.add(R)};for await(let R of e.pages(i))for(let b of R){let w=y(b);f.missing.has(w)?f.binned.has(w)?c.alreadyGone++:c.notVisible++:n.undeletable.has(i)?(c.undeletable++,h(w)):u?.unread!==void 0?(c.unread++,h(w)):n.changed.has(w)?(c.changedSince++,g.push(b),n.includeChanged?(c.toDelete++,m.push(b)):(c.keptChanged++,h(w))):u?.kept.has(w)?(c.changedSince++,c.keptChanged++,h(w)):(c.toDelete++,m.push(b))}if(n.held&&m.length>0){if(n.stopped())return;let R=await n.held.check.heldAmong(i,m),b=m.filter(k=>R.held.has(y(k)));if(b.length>0){c.toDelete-=b.length,c.keptDependents=b.length,c.heldBy=[...R.holders];for(let I of b)n.held.notSent.add(y(I));let k=b.filter(I=>R.byAutomation.has(y(I)));k.length>0&&(c.heldByAutomation=k.length)}let w=new Map;for(let k of m)if(!R.held.has(y(k)))for(let[I,C]of R.cameAlong.get(y(k))??[])a.has(I)||(a.add(I),w.set(I,C));w.size>0&&(c.cameAlong={count:w.size,objects:[...new Set(w.values())]}),R.reason!==void 0&&c.reasons.push(R.reason),R.unchecked.size>0&&c.reasons.push(`Not checked: what hangs from them through ${[...R.unchecked].join(", ")}, which the org deletes along but does not let be read by the record it hangs from.`)}if(u?.unread!==void 0?c.reasons.push(`Its articles could not be read: ${u.unread}`):u!==void 0&&u.kept.size>0&&c.reasons.push(gt),c.notVisible>0&&c.reasons.push(wt(c.notVisible,f.binError)),c.undeletable>0&&c.reasons.push(Cn(i,c.undeletable)),!(g.length===0||f.modifiedColumn!=="LastModifiedDate")){if(n.stopped())return;try{let R=await j(r,i,["LastModifiedById"],g,Se);for(let b of R){let w=b.LastModifiedById;typeof w!="string"||w===""||(c.changedBy[w]=(c.changedBy[w]??0)+1,s.add(w))}}catch(R){c.reasons.push(`Who changed them since the run could not be read: ${P(R)}`)}}}if(!n.stopped())return{objects:o,userNames:await _r(r,[...s])}}async function _r(r,e){let t={};if(e.length===0)return t;try{for(let n of await j(r,"User",["Name"],[...e].sort()))typeof n.Id=="string"&&typeof n.Name=="string"&&(t[n.Id]=n.Name)}catch{}return t}async function Br(r,e,t){let{gone:n,unchecked:o,failure:s}=await lt(e.refusedSent(),a=>j(r,e.result.objectApiName,[],a),a=>t!==void 0&&t.error===void 0&&!t.missing.has(y(a)));for(let a of n)e.refused.delete(a),e.goneLater.add(y(a)),e.result.alreadyGone++;o.length>0&&e.note(`Not checked: ${o.length} refused record(s) could not be read back once the rest had gone, to tell whether a parent deleted after them took them along`+(s?` \u2014 ${s}`:"."))}function ss(r,e=[],t={}){return[...new Set([...r,...wn(r,e),...t.userKept===!0&&r.length>0?[le]:[]])]}async function xr(r,e,t){let n=[];for(let{objectApiName:o,count:s}of e){if(o===Pr||s===0)continue;let a=t(o,s);if(a!==0)try{let i=G.safeParse(await r.describe(o));i.success&&i.data.deletable===!1&&n.push({objectApiName:o,records:a})}catch{}}return n}async function Dn(r,e,t){let n={},{start:o,user:s}=t;if(s===void 0||!Number.isFinite(o))return n;for await(let{objectApiName:a,ids:i}of e){let d;try{d=await j(r,a,["LastModifiedDate","LastModifiedById"],i)}catch{continue}for(let l of d)typeof l.Id=="string"&&typeof l.LastModifiedDate=="string"&&typeof l.LastModifiedById=="string"&&y(l.LastModifiedById)===s&&M(l.LastModifiedDate)>=o&&(n[l.Id]=l.LastModifiedDate)}return n}async function Fr(r,e,t,n){let o=[];for(let s of e){let a=re(s.plan)?s.plan:Je(s.plan),{end:i}=kt(s.span,[],t),d=new Map(Object.entries(s.removalStamps??{}).map(([f,u])=>[y(f),M(u)])),l=Pn(s.laterParts,t),c=new Map;if(Number.isFinite(i))for(let{objectApiName:f}of a.objects){let u=new ze,g=0,m=!1;for await(let h of a.pages(f)){if(n())return;let R=g;if(g+=h.length,m)continue;let b;try{b=await j(r,f,["LastModifiedDate"],h,Se)}catch{m=!0;continue}let w=new Map;for(let k of b)typeof k.Id=="string"&&w.set(y(k.Id),M(k.LastModifiedDate));h.forEach((k,I)=>{let C=y(k),_=w.get(C);_!==void 0&&(_<=i||_<=(d.get(C)??Number.NaN)||_<=(l.get(C)??Number.NaN))&&u.add(R+I)})}m||c.set(f,u)}o.push({unchanged:async function*(){for(let{objectApiName:f}of a.objects){let u=c.get(f);if(!u)continue;let g=0;for await(let m of a.pages(f)){let h=m.filter(()=>u.has(g++));h.length>0&&(yield{objectApiName:f,ids:h})}}}})}return o}async function In(r,e,t,n,o){let{objectApiName:s}=t.result,a=await e.heldAmong(s,n);a.reason!==void 0&&t.note(a.reason);for(let u of a.unchecked)t.result.unchecked.includes(u)||t.result.unchecked.push(u);let i=n.filter(u=>a.held.has(y(u)));if(o.placeOf){for(let u of i)t.held.push(u);t.result.heldBy=[...new Set([...t.result.heldBy,...a.holders])]}else t.held=i,t.result.heldBy=[...a.holders];for(let u of i)t.refused.delete(u);for(let u of n){let g=y(u),m=a.byAutomation.get(g);m?t.automationHeld.set(g,m):t.automationHeld.delete(g),m&&a.automationAfter.has(g)?t.automationHeldAfter.add(g):t.automationHeldAfter.delete(g),m&&a.automationAlong.has(g)?t.automationHeldAlong.add(g):t.automationHeldAlong.delete(g)}o.onHeld?.(i.length);let d=n.filter(u=>!a.held.has(y(u))),l=new Map,c=(u,g)=>{u.forEach((m,h)=>{let R=g[h],b=y(m);if((R.lockResends!==void 0||t.lockResent.has(b))&&t.lockResent.set(b,R.kind),R.kind==="refused"){t.refused.set(m,{reason:R.reason,dependency:R.dependency,sent:!0,...R.limit?{limit:!0}:{}});return}t.refused.delete(m);let w=o.placeOf?.get(b);if(w!==void 0?t.goneAt.add(w):t.goneLater.add(b),R.kind==="deleted"){t.result.deleted++,w===void 0&&t.deletedLater.add(b);for(let k of l.get(b)??[])t.filesLeft.set(k.key,k.name);for(let[k,I]of a.along.get(b)??[])t.tookAlong.set(k,I);for(let[k,I]of a.cameAlong.get(b)??[])t.cameAlong.set(k,I)}else t.result.alreadyGone++}),o.onSent?.(u),o.onDeleted?.(u.length)},{stopped:f}=await sn(r,s,d,{stopped:o.stopped,splitting:o.splitting,prepare:async u=>{l=await e.filesOn(u)},settle:c});return f}async function Ur(r,e,t,n,o){let s,a=o.modifiedColumn?On.filter(({modified:i})=>i===o.modifiedColumn):On;for(let{created:i,modified:d}of a)try{let c=await j(r,e,i?[i,d]:[d],t,Se),f=new Map;for(let g of c)typeof g.Id=="string"&&f.set(y(g.Id),M(g[d])),i&&(o.firstCreated=Ln(o.firstCreated,M(g[i])),o.lastCreated=St(o.lastCreated,M(g[i])));o.modifiedColumn=d;let u=[];return t.forEach((g,m)=>{let h=y(g),R=f.get(h);R===void 0&&(o.missing.add(h),u.push(g)),o.modified.set(n+m,R??Number.NaN)}),u}catch(l){s??=P(l)}return o.error=s,o.modifiedColumn=void 0,[]}async function*En(r){for(let{objectApiName:e}of r.objects)for await(let t of r.pages(e))t.length>0&&(yield{objectApiName:e,ids:[...t]})}async function $r(r,e,t){let n=new Set(e.objects.filter(i=>i.count>0).map(i=>i.objectApiName));if(!n.has(xe))return[];let o=[];for await(let i of e.pages(xe))o.push(...i);let s=await Sn(r,{has:i=>e.has(i),start:t.start,end:t.end,...t.user!==void 0?{user:t.user}:{},...t.otherParts?{otherParts:t.otherParts}:{}},o,n),a=[];for(let i of s){let{objectApiName:d}=i;if(t.undeletable.has(d))continue;let l=t.snapshots.get(d);if(l){if(l.error!==void 0||l.modifiedColumn!=="LastModifiedDate")continue}else if(!await Mn(r,d))continue;a.push(i)}return a}async function Mn(r,e){try{let t=G.safeParse(await r.describe(e));return t.success&&t.data.deletable!==!1}catch{return!1}}async function Hr(r,e,t,n){let o=new Map(e.map(({objectApiName:i,copies:d})=>[i,d])),s=new Set(e.flatMap(({copies:i})=>i.map(d=>y(d.id)))),a=r.objects.map(i=>{let d=o.get(i.objectApiName);return d?{objectApiName:i.objectApiName,count:i.count+d.length}:i});for(let[i,d]of o){r.objects.some(u=>u.objectApiName===i)||a.push({objectApiName:i,count:d.length});let l=t.get(i);l||(l={...Nn(),modifiedColumn:"LastModifiedDate"},t.set(i,l));let c=0;for await(let u of r.pages(i))c+=u.length;for(let u of d)l.modified.set(c++,u.modified);let f=d[0]?.id.slice(0,3);f!==void 0&&!n.has(f)&&n.set(f,i)}return{objects:a,pages:async function*(i){yield*r.pages(i);let d=o.get(i);d&&d.length>0&&(yield d.map(l=>l.id))},has:i=>r.has(i)||s.has(i)}}async function Jr(r){let e=Date.now(),t=Number.NaN;try{t=M(await r.serverTime())}catch{}return Number.isFinite(t)?{start:Math.floor(t/1e3)*1e3,aheadMs:t-(e+Date.now())/2}:{start:Number.POSITIVE_INFINITY,aheadMs:Number.NaN}}async function zr(r){try{let e=await r.userId();return typeof e=="string"&&e!==""?y(e):void 0}catch{return}}function qr(r,e){if(!(e===void 0||!Number.isFinite(r.start)))return{first:new Date(r.start).toISOString(),last:new Date(Date.now()+r.aheadMs+yt).toISOString(),userId:e}}function Ln(r,e){return Number.isNaN(r)||e<r?e:r}function St(r,e){return Number.isNaN(r)||e>r?e:r}var jn=999;function Wr(r,e,t){let n=Number.NaN;for(let o of r)o.lastCreated>=e&&o.lastCreated<=t&&(n=St(n,o.lastCreated)),n=St(n,o.modified.latestWithin(e,t));return n}function kt(r,e,t){let n=Qr(r,e,t),o=(r.writtenUntil?.getTime()??Number.NaN)+jn;return Number.isFinite(n.end)&&o>n.end?{...n,end:o}:n}function Qr(r,e,t){let n=[...e],o=Number.NaN;for(let l of n)o=Ln(o,l.firstCreated);let s=r.runDurationMs??0,a=(r.runRecordedAt?.getTime()??Number.NaN)+t;if(r.runEndedAt===void 0&&Number.isFinite(a)){let l=a-s-yt,c=a+yt,f=r.endedByItsWrites===!0?Wr(n,l,c):Number.NaN;return{start:r.runStartedAt?.getTime()??(o>l?o:l),end:Number.isFinite(f)?Math.min(f+jn,c):c}}let i=r.runStartedAt?.getTime()??o,d=r.runEndedAt?.getTime()??i+s;return{start:i,end:d}}function vn(r){let e=new Set,t=-1;return{has:n=>(r.size!==t&&(e=new Set([...r].map(y)),t=r.size),e.has(n))}}function is(r,e){let t=new Oe(r,{runRecords:e.runRecords,reached:{has:()=>!1},stays:()=>!1,runStart:e.runStart,runEnd:e.runEnd,removalStart:Number.POSITIVE_INFINITY,removalUser:void 0,earlierRemovals:(e.removalSpans??[]).map(n=>({start:M(n.first),end:M(n.last),user:y(n.userId)})),includeChanged:e.includeChanged,automationMade:vn(e.taken),...e.runUserId?{runUser:y(e.runUserId)}:{}});return async(n,o)=>{let s=await t.heldAmong(n,o,1);return{held:s.held,holders:[...s.holders],...s.reason!==void 0?{reason:s.reason}:{}}}}var Ue="IsPersonAccount";function Vr(r,e){return{holding:new Set([...r.holding,...e.holding]),automation:[...r.automation,...e.automation],along:[...r.along,...e.along],goes:[...r.goes,...e.goes],unchecked:r.unchecked||e.unchecked}}var Kr=50;function $e(r,e){return JSON.stringify(e.map(t=>r[t]??null))}var Oe=class{constructor(e,t){this.org=e;this.context=t}org;context;worked;statuses=new Map;lockedUnder=new Map;files=new Map;datesKept=new Map;cascadeEnds=new Map;async heldAmong(e,t,n=0){let o={held:new Set,holders:new Set,otherwise:new Set,mayBeAutomation:[],byAutomation:new Map,automationAfter:new Set,automationAlong:new Set,along:new Map,cameAlong:new Map,unchecked:new Set};if(t.length===0)return o;let s;try{let u=G.parse(await this.org.describe(e)),g=await this.workedObjects(),m=e==="Account"&&u.fields.some(h=>h.name===Ue);s=(u.childRelationships??[]).filter(h=>(h.cascadeDelete===!0||h.restrictedDelete===!0)&&g.has(h.childSObject)).map(h=>({childSObject:h.childSObject,field:h.field,restricted:h.cascadeDelete!==!0,...m&&h.childSObject==="Contact"&&h.field==="AccountId"?{personContacts:!0}:{}}))}catch(u){return o.reason=P(u),t.forEach(g=>this.hold(o,y(g))),o}let a=[];for(let u=0;u<t.length;u+=q)a.push(t.slice(u,u+q));let i=a.length>1?await Xe(s.map(u=>()=>this.anyPointing(u)),Se):s.map(()=>!0),d=s.filter((u,g)=>i[g]).flatMap(u=>a.map(g=>async()=>({relationship:u,...await this.holdingIn(u,g)}))),l=o.mayBeAutomation,c=new Map;for(let{relationship:u,holding:g,unchecked:m,automation:h,along:R,goes:b}of await Xe(d,Se)){m&&o.unchecked.add(u.childSObject),(g.size>0||h.length>0)&&o.holders.add(u.childSObject),g.forEach(w=>this.hold(o,w));for(let w of h)o.held.add(y(w.parent));l.push(...h);for(let{parent:w,key:k}of R){let I=o.along.get(w)??new Map;I.set(k,u.childSObject),o.along.set(w,I)}b.length>0&&c.set(u.childSObject,[...c.get(u.childSObject)??[],...b])}if(await this.heldBelow(c,o,n),n>0)return o;this.context.previewing!==!0&&await this.lockedPastDraft(e,t,o),Ee(e)&&await this.standardPricesHeld(t,o),e===Ye&&await this.sellingModelOptionsHeld(t,o),this.context.alongAccepted!==!0&&await this.automationHeldBelow(l,o);let f=await this.byAutomationOnly(e,l,o.otherwise);return o.byAutomation=f.objects,o.automationAfter=f.after,o.automationAlong=f.along,o}hold(e,t){e.held.add(t),e.otherwise.add(t)}async heldBelow(e,t,n){let o=(s,a,i,d)=>{let l=s.get(a)??new Map;l.set(i,d),s.set(a,l)};for(let[s,a]of e){let i=[...new Set(a.map(l=>l.id))],d=n+1<Dr?await this.heldAmong(s,i,n+1):void 0;for(let{parent:l,id:c,came:f}of a){let u=y(c);if(!d||d.held.has(u)){this.hold(t,l),t.holders.add(s),d?.holders.forEach(g=>t.holders.add(g));continue}f&&o(t.cameAlong,l,u,s);for(let[g,m]of d.along.get(u)??[])o(t.along,l,g,m);for(let[g,m]of d.cameAlong.get(u)??[])o(t.cameAlong,l,g,m)}d?.unchecked.forEach(l=>t.unchecked.add(l))}}async automationHeldBelow(e,t){let n=new Map;for(let o of e)t.otherwise.has(y(o.parent))||n.set(o.object,[...n.get(o.object)??[],o]);for(let[o,s]of n){let a=await this.heldAmong(o,[...new Set(s.map(i=>i.id))],1);for(let i of s){let d=y(i.id),l=a.mayBeAutomation.some(c=>y(c.parent)===d&&c.creator!==i.creator);!a.otherwise.has(d)&&!l||(this.hold(t,y(i.parent)),a.holders.forEach(c=>t.holders.add(c)))}a.unchecked.forEach(i=>t.unchecked.add(i))}}async byAutomationOnly(e,t,n){let o=new Map,s=new Set,a=t.filter(f=>!n.has(y(f.parent)));if(a.length===0)return{objects:o,after:s,along:new Set};let i;try{let f=await j(this.org,e,["CreatedDate","CreatedById"],[...new Set(a.map(u=>u.parent))]);i=new Map(f.flatMap(u=>typeof u.Id=="string"?[[y(u.Id),u]]:[]))}catch{return{objects:o,after:s,along:new Set}}let d=new Set,l=new Set;for(let f of a){let u=y(f.parent),g=i.get(u),m=M(g?.CreatedDate),h=g?.CreatedById,R=this.context.runUser??(typeof h=="string"?y(h):void 0),b=f.created-m;if(!(R!==void 0&&f.creator===R&&b>=-2e3&&b<=6e4)){d.add(u);continue}let k=o.get(u)??new Set;k.add(f.object),o.set(u,k),f.created>this.context.runEnd&&s.add(u),f.along||l.add(u)}for(let f of d)o.delete(f),s.delete(f);let c=new Set([...o.keys()].filter(f=>!l.has(f)));return{objects:o,after:s,along:c}}async holdingIn(e,t){let n=N(e.childSObject),o=N(e.field),[s]=H(t,t.length),a=new Set(["Id",o,...ht[n]?.ends??[],...e.personContacts?[Ue]:[]]),i=this.datesKept.get(n)??0;for(;i<He.length;){let d=He[i],l;try{l=await this.org.query(`SELECT ${[...a,...d].join(", ")} FROM ${n} WHERE ${o} IN (${s}) LIMIT ${Fe}`)}catch(R){Lr(R)?(i=jr(R,i),this.datesKept.set(n,i)):i++;continue}if(l.records.length>=Fe){if(t.length>1){let R=Math.ceil(t.length/2);return Vr(await this.holdingIn(e,t.slice(0,R)),await this.holdingIn(e,t.slice(R)))}return{holding:new Set(t.map(y)),automation:[],along:[],goes:[],unchecked:!1}}let c=new Set,f=[],u=[],g=[],m=new Map;for(let R of l.records){if(typeof R!="object"||R===null)continue;let b=R,w=b[e.field];if(typeof w!="string"||typeof b.Id!="string"||(n===kn&&o==="LinkedEntityId"&&this.noteFile(b),this.lockedUnder.get(y(b.Id))===y(w)))continue;let k={onlyIncluded:!1};if(!this.stays(b,n,e.restricted,e.personContacts,k)){if(k.onlyIncluded&&u.push({parent:y(w),key:y(b.Id)}),n!==kn&&this.goesAlongUnread(b)){let _=!(ht[n]?.cameWithRun(b,this.context.runRecords)===!0||e.personContacts===!0&&b[Ue]===!0)&&!k.onlyIncluded&&k.byRemoval!==!0&&this.context.goesWithParent?.(b,this.context.runEnd)!==!0;g.push({parent:y(w),id:b.Id,came:_})}continue}let I=this.mayBeAutomation(b);if(I){let C={parent:w,id:b.Id,object:n,along:!e.restricted,...I};f.push(C),e.restricted&&m.set(b.Id,C)}else c.add(y(w))}let h=await this.ofOtherParts(n,[...m.keys()]);for(let[R,b]of m)h.has(y(R))&&(f.splice(f.indexOf(b),1),c.add(y(b.parent)));return{holding:c,automation:f,along:u,goes:g,unchecked:!1}}return{holding:new Set,automation:[],along:[],goes:[],unchecked:!e.restricted}}goesAlongUnread(e){let t=y(e.Id),{runRecords:n,otherPartRecords:o,automationMade:s,goesWithParent:a,runEnd:i}=this.context;return this.context.alongAccepted!==!0&&!n.has(t)&&o?.has(t)!==!0&&s?.has(t)!==!0&&(this.context.goesWithParentReadBelow===!0||a?.(e,i)!==!0)}async ofOtherParts(e,t){let n=new Set,{otherPartRecords:o,otherPartObjects:s,runRecords:a}=this.context;if(t.length===0||!o||!s)return n;let i=this.cascadeEnds.get(e);i||(i=(async()=>{let c=new Set;for(let f of s)try{let u=G.parse(await this.org.describe(f));for(let g of u.childRelationships??[])g.childSObject===e&&g.cascadeDelete===!0&&c.add(g.field)}catch{}return[...c]})(),this.cascadeEnds.set(e,i));let d=await i;if(d.length===0)return n;let l;try{l=await j(this.org,e,d,t)}catch{return n}for(let c of l){if(typeof c.Id!="string")continue;let f=d.flatMap(u=>{let g=c[u];return typeof g=="string"?[y(g)]:[]});f.some(u=>a.has(u))||f.some(u=>o.has(u))&&n.add(y(c.Id))}return n}mayBeAutomation(e){let{runRecords:t,runStart:n,runEnd:o,runUser:s,otherPartRecords:a}=this.context;if(typeof e.Id!="string"||t.has(y(e.Id))||a?.has(y(e.Id))===!0||typeof e.CreatedById!="string")return;let i=y(e.CreatedById);if(s!==void 0&&i!==s)return;let d=M(e.CreatedDate);if(!(d>=n-2e3&&d<=o+6e4))return;let l=M(e.LastModifiedDate),c=typeof e.LastModifiedById=="string"?y(e.LastModifiedById):void 0;if(!(l>o&&c!==void 0&&c!==i))return{created:d,creator:i}}async anyPointing(e){try{let t=N(e.childSObject),n=N(e.field);return(await this.org.query(`SELECT Id FROM ${t} WHERE ${n} != null LIMIT 1`)).records.length>0}catch{return!0}}noteFile(e){let t=e.LinkedEntityId,n=e.ContentDocumentId;if(typeof t!="string"||typeof n!="string"||ue(n,this.context.runRecords))return;let o=this.files.get(y(t))??new Set;o.add(n),this.files.set(y(t),o)}async filesOn(e){let t=new Map;for(let s of e){let a=this.files.get(y(s));a&&a.size>0&&t.set(y(s),[...a])}let n=[...new Set([...t.values()].flat())];if(n.length===0)return new Map;let o=new Map;try{for(let s of await j(this.org,Er,["Title"],n))typeof s.Id=="string"&&typeof s.Title=="string"&&s.Title!==""&&o.set(y(s.Id),s.Title)}catch{}return new Map([...t].map(([s,a])=>[s,a.map(i=>({key:y(i),name:o.get(y(i))??i}))]))}async lockedPastDraft(e,t,n){for(let[o,s]of Object.entries(Mt)){let a=s.find(u=>u.object===e)?.lookup,i=me[o];if(!a||!i)continue;let d=await this.statusCategoriesOf(i);if(!d)continue;let l,c;try{l=await j(this.org,e,[a],t);let u=[...new Set(l.map(g=>g[a]).filter(g=>typeof g=="string"))];c=u.length>0?await j(this.org,o,["Status"],u):[]}catch{continue}let f=new Set(c.filter(u=>{let g=d.categoryOf.get(String(u.Status));return g!==void 0&&g!=="Draft"}).map(u=>y(String(u.Id))));for(let u of l){let g=u[a];typeof u.Id!="string"||typeof g!="string"||f.has(y(g))&&(this.hold(n,y(u.Id)),n.holders.add(o),this.lockedUnder.set(y(u.Id),y(g)))}}}statusCategoriesOf(e){let t=this.statuses.get(e);return t||(t=Pe(de(this.org),e),this.statuses.set(e,t)),t}async standardPricesHeld(e,t){try{let n=de(this.org),o=[...await pe(n,e)];if(o.length===0)return;let s=await this.priceKeyFields(),a=await j(this.org,ee,s,o),i=await this.pricesOfProducts(a,s),d=i.flatMap(u=>typeof u.Id=="string"?[u.Id]:[]),l=new Set([...await pe(n,d)].map(y)),c=new Set(e.map(y)),f=new Set;for(let u of i){if(typeof u.Id!="string")continue;let g=y(u.Id);if(l.has(g))continue;(c.has(g)?t.held.has(g):this.stays(u,ee,!0))&&f.add($e(u,s))}for(let u of a)typeof u.Id!="string"||!f.has($e(u,s))||(this.hold(t,y(u.Id)),t.holders.add(ee))}catch{}}async sellingModelOptionsHeld(e,t){let n=[ge,Ge];try{let o=await j(this.org,Ye,n,e),s=await this.pricesOfProducts(o,[...n,"IsActive"]),a=new Set(s.filter(i=>typeof i.Id=="string"&&i.IsActive===!0&&this.stays(i,ee,!0)).map(i=>$e(i,n)));for(let i of o)typeof i.Id!="string"||!a.has($e(i,n))||(this.hold(t,y(i.Id)),t.holders.add(ee))}catch{}}async priceKeyFields(){let e=G.parse(await this.org.describe(ee)),t=new Set(e.fields.map(n=>n.name));return[ge,...[Ge,Lt].filter(n=>t.has(n))]}async pricesOfProducts(e,t){let n=[...new Set(e.map(a=>a[ge]).filter(a=>typeof a=="string"))],o=[...new Set(["Id",...t])].map(N).join(", "),s=[];for(let a of H(n,Kr)){let i=await this.org.query(`SELECT ${o} FROM ${ee} WHERE ${ge} IN (${a}) LIMIT ${Fe}`);if(i.records.length>=Fe)throw new Error("More prices than one read takes.");for(let d of i.records)typeof d=="object"&&d!==null&&s.push(d)}return s}stays(e,t,n=!1,o=!1,s){let a=y(e.Id),{runRecords:i,reached:d,runStart:l,runEnd:c,removalStart:f,removalUser:u,earlierRemovals:g,includeChanged:m}=this.context;if(i.has(a))return d.has(a)||this.context.stays(a);if(n)return!0;if(this.context.automationMade?.has(a)===!0||this.context.goesWithParent?.(e,c)===!0||this.context.alongToDraft?.has(a)===!0||ht[t]?.cameWithRun(e,i))return!1;if(o&&e[Ue]===!0)return!(M(e.LastModifiedDate??e.SystemModstamp)<=c)&&!m;let h="CreatedDate"in e?"CreatedDate":"SystemModstamp"in e?"SystemModstamp":void 0;if(!h)return!0;let R=M(e[h]),b=M(h==="CreatedDate"?e.LastModifiedDate:e.SystemModstamp);if(!(R>=l))return!0;let w=this.context.linkedLater?.get(a);if(w&&(R<=c||R>=w.start)&&b<=w.end)return!1;let k=typeof e.CreatedById=="string"?y(e.CreatedById):void 0,I=(_,Y)=>_!==void 0&&(_===u&&Y>=f||g.some(V=>_===V.user&&Y>=V.start&&Y<=V.end));if(I(k,R))return s&&(s.byRemoval=!0),!1;if(b<=c)return!1;let C=typeof e.LastModifiedById=="string"?y(e.LastModifiedById):void 0;return R<=c&&I(C,b)?!1:(m&&s&&(s.onlyIncluded=!0),!m)}workedObjects(){return this.worked??=vt(this.org),this.worked}};export{Ne as a,tt as b,Wt as c,Qt as d,G as e,Vt as f,Wn as g,Vn as h,Kn as i,Gn as j,Yn as k,oo as l,Me as m,nt as n,ve as o,he as p,yo as q,dt as r,or as s,ir as t,tn as u,rn as v,ct as w,on as x,sn as y,an as z,Te as A,lt as B,lr as C,ut as D,Oo as E,dn as F,Sn as G,le as H,mr as I,yt as J,re as K,es as L,ts as M,ns as N,rs as O,os as P,ss as Q,is as R};
@@ -1,7 +0,0 @@
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-VZT4E2OJ.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-JQZTMFO7.mjs";import"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{p as actDeliverability,o as actEmailsGate,n as actSendersOf,q as afterLeaseEmailsRefusal,l as checkpointEmails,j as checkpointEmailsUncounted,c as draftedByDiff,d as draftedByPlan,a as emailsOfLimit,m as emailsRefusal,k as emailsUncountedWords,r as pageEmailsRefusal,e as statusBackByDiff,f as statusBackByPlan,b as updatedByDiff,g as writtenByDiff,h as writtenByPlan,i as writtenByUndo};
@@ -1,7 +0,0 @@
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 q,$b as qa,Ab as R,Ac as Ra,Bb as S,Bc as Sa,Cb as T,Cc as Ta,Db as U,Dc as Ua,Eb as V,Ec as Va,Fb as W,Fc as Wa,Gb as X,Gc as Xa,Hb as Y,Hc as Ya,Ib as Z,Ic as Za,Jb as _,Jc as _a,Kb as $,La as a,Lb as aa,Ma as b,Mb as ba,Na as c,Nb as ca,Oa as d,Ob as da,Pa as e,Pb as ea,Qa as f,Qb as fa,Ra as g,Rb as ga,Sa as h,Sb as ha,Ta as i,Tb as ia,Ua as j,Ub as ja,Va as k,Vb as ka,Wa as l,Wb as la,Xa as m,Xb as ma,Ya as n,Yb as na,Za as o,Zb as oa,_a as p,_b as pa,ab as r,ac as ra,bb as s,bc as sa,cb as t,cc as ta,db as u,dc as ua,eb as v,ec as va,fb as w,fc as wa,gb as x,gc as xa,hb as y,hc as ya,ib as z,ic as za,jb as A,jc as Aa,kb as B,kc as Ba,lb as C,lc as Ca,mb as D,mc as Da,nb as E,nc as Ea,ob as F,oc as Fa,pb as G,pc as Ga,qb as H,qc as Ha,rb as I,rc as Ia,sb as J,sc as Ja,tb as K,tc as Ka,ub as L,uc as La,vb as M,vc as Ma,wb as N,wc as Na,xb as O,xc as Oa,yb as P,yc as Pa,zb as Q,zc as Qa}from"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{v as API_BUDGET_EXCEEDED,r as API_BUDGET_NEAR_SHARE,o as API_REQUESTS_NOT_TOLD,I as BULK_BATCHES_NOT_TOLD,y as CHECKPOINT_REFUSED,B as CHECKPOINT_STOPPED_WORDS,a as DEFAULT_CONFIRM_ABOVE_RECORDS,b as DEFAULT_MAX_TOTAL,W as DELIVERABILITY_READ_MOST,fa as DEVELOPER_EDITION_SINGLE_EMAILS,ta as EMAILS_NOT_ACCEPTED,Oa as ForgeRunGateError,j as LastSimulations,Ma as OWNER_MAP_INACTIVE,Na as OWNER_MAP_UNKNOWN,c as READ_CEILING_PER_OBJECT,Z as SAMPLE_CANNOT_FIT,aa as SAMPLE_PLAN_GONE,$ as SAMPLE_PLAN_MISMATCH,Y as SAMPLE_STORAGE_UNREAD,_ as SAMPLE_TOO_LARGE,e as STORAGE_NEAR_SHARE,F as WHOLE_ORG_SOURCE_READS_PER_OBJECT,E as WHOLE_ORG_TARGET_READS_PER_OBJECT,ga as alertsCountAsSingle,u as apiBudgetCheckOf,w as apiBudgetRefusal,R as automationBytesOf,va as automationReadRequests,Wa as automationRefusal,La as automationUnreadOf,J as bulkBatchesRefusal,Va as bypassAssistantSentences,Ka as bypassesToAssign,z as checkpointPartOf,A as checkpointScopeStop,x as confirmationApiOf,l as confirmationSimulatedOf,Ca as confirmationStorageOf,ka as countedEmailChecksOf,g as countedStorageBytes,la as countedTargetEmails,Ba as deliverabilityAfterLeaseStop,ya as deliverabilityGate,xa as deliverabilityLineOf,wa as deliverabilityPartOf,sa as emailCheckLines,ja as emailChecksOf,ra as emailRefusal,ia as emailsCountedPerRecord,qa as emailsOfLimit,na as emailsUncountedOf,k as farPastTheSimulation,L as fileStorageRefusal,Qa as filesRefusalStop,Fa as firedOnInsertOf,Ga as firedOnUpdateOf,G as forgeRequestPartsOf,i as forgeVolumeCaseKey,P as forgeWriteBudgetOf,D as forgeWritesOf,Da as formatMB,Ea as formatMBPast,ma as insertsOf,Pa as isForgeRunGateError,Ta as leftOutLines,d as objectsAboveReadCeiling,Ha as objectsUpdatedAfterInsert,oa as overEmailOf,U as personalFieldsAsIsOf,m as pricesForLinesOf,q as readApiBudget,M as readBoundRefusal,N as readBoundStopOf,p as readDataStorage,ea as readEmailLimits,Ya as removalAutomationLines,Xa as removalAutomationRefusal,Ua as removalRiskLines,Za as removalStepsAutomationLines,_a as removalStepsAutomationRefusal,n as rolesMayBeOf,f as rowStorageBytes,Ja as runBypassesOf,s as runRequestsEstimate,t as runRequestsTotal,da as sampleGateErrorOf,ca as sampleGateStopOf,ba as sampleStorageUnreadStopOf,za as sendersOfNothingWritten,Aa as sendersOfNothingWrittenLine,ua as sendersUnreadOf,ha as singleCountAsWorkflow,K as sourceApiBudgetRefusal,Q as storageCheckOf,Ra as storageRefusal,S as storageTakesWords,C as takeCheckpointFirst,pa as unreadEmailOf,Ia as updateStepsOf,H as wholeOrgCostOf,X as wholeOrgDryRunOf,O as wholeOrgFilesOf,V as wholeOrgLeftOutOf,T as wholeOrgWritePlanOf,Sa as writePlanLines,h as writePlanOf};
@@ -1,7 +0,0 @@
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{$ as g,Aa as H,Ba as I,Ca as J,Da as K,Ea as L,Fa as M,Ga as N,Ha as O,Ia as P,Ja as Q,Ka as R,V as a,W as b,X as c,Y as d,Z as e,_ as f,aa as h,ba as i,ca as j,da as k,ea as l,fa as m,ga as n,ha as o,ia as p,ja as q,ka as r,la as s,ma as t,na as u,oa as v,pa as w,qa as x,ra as y,sa as z,ta as A,ua as B,va as C,wa as D,xa as E,ya as F,za as G}from"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{m as ASSIGNMENT_RULES_SOQL,h as AUTOMATION_READ_MOST,b as CONDITIONS_BOUND,f as CONDITION_REQUESTS_BOUND,c as DEFINITIONS_BOUND,g as DEFINITION_REQUESTS_BOUND,n as DUPLICATE_RULES_SOQL,i as FLOWS_SOQL,k as PROCESSES_SOQL,d as TOOLING_QUERIES_PER_REQUEST,e as TOOLING_RETRIEVES_PER_REQUEST,j as TRIGGERS_SOQL,N as TargetAutomationReader,o as USER_PERMISSIONS_SOQL,l as WORKFLOW_RULES_SOQL,a as answerOf,R as automationLines,p as conditionSoql,z as customObjectIdsSoql,Q as customPermissionsByIdSoql,A as customPermissionsSoql,G as decisionChecks,F as fieldsRequiredFilled,L as inFlight,H as messagesOf,M as objectsTheRunWrites,I as pathsOf,J as permissionKey,C as permissionSetSizesSoql,B as permissionSetsHoldingSoql,D as permissionsNamed,y as processObjectsSoql,O as readBypassGrants,w as readInComposites,x as ruleDefinitionSoql,P as setCustomPermissionsSoql,E as switchesNamed,v as targetAutomationQueries,s as toolingAnswersOf,q as toolingCompositeBody,t as toolingRecordsOf,r as toolingRetrieveBody,u as toolingRetrievesOver,K as unreadPartOf};
@@ -1,7 +0,0 @@
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}from"./chunk-AUS6NFLZ.mjs";import"./chunk-DBBPDSFN.mjs";import"./chunk-GBGHJTPC.mjs";import"./chunk-YMDFF657.mjs";import"./chunk-7WSLT5VX.mjs";import"./chunk-YT22LMF7.mjs";import"./chunk-PE435FVH.mjs";import"./chunk-PWVDNN2C.mjs";import"./chunk-6VSZNZHH.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-WB2RIVO3.mjs";import"./chunk-ISSP2FZ5.mjs";import"./chunk-XU25YA46.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-IVZJSDJD.mjs";import"./chunk-VZT4E2OJ.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-O2PUGRNW.mjs";import"./chunk-7SDZR6SR.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-3SKLBRPL.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-SAMWHL22.mjs";import"./chunk-6KP6WETK.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-HKUWHVI7.mjs";import"./chunk-VPDEJGPS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-PBE44M2Y.mjs";import"./chunk-ZUOPC4W2.mjs";import"./chunk-JQZTMFO7.mjs";import"./chunk-JFNLKHY6.mjs";import"./chunk-VZVICK7Q.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-7PY3VQP3.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-XZISAZA6.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-PR74GYVI.mjs";import"./chunk-TMA34QMA.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{d as CheckpointTakeStopped,a as DEFAULT_MAX_TOTAL,b as OBJECT_ROWS_MAX,f as holdingLimit,e as pastTheLimit,g as scopeCheckpoint,h as takeCheckpoint,c as takeOrgOf};
@@ -1,7 +0,0 @@
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{f as a,g as b,h as c,i as d,j as e,k as f,l as g}from"./chunk-MKTXJCXN.mjs";import"./chunk-GBGHJTPC.mjs";import"./chunk-YMDFF657.mjs";import"./chunk-YT22LMF7.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-XU25YA46.mjs";import"./chunk-7SDZR6SR.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-SAMWHL22.mjs";import"./chunk-6KP6WETK.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-J24TIGSI.mjs";import"./chunk-VPDEJGPS.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-HFUDCNU5.mjs";import"./chunk-XZISAZA6.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-L4INJ5TZ.mjs";import"./chunk-KIMQQ6JQ.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-ZUTUYBNW.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-PR74GYVI.mjs";import"./chunk-TMA34QMA.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-ZQO5PDX5.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{d as diffOfPicked,b as heldInPlaceReason,g as planSelection,c as rewindPlan,a as rewindWriters,f as selectionPlanOf,e as snapshotRowsOf};