shopify 4.9.5 → 5.0.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 (499) hide show
  1. package/dist/analytics-Q6QDIDYT.js +1 -0
  2. package/dist/analytics-VKKJNJ62.js +1 -0
  3. package/dist/assets/hydrogen/starter/CHANGELOG.md +7 -0
  4. package/dist/assets/hydrogen/starter/package.json +2 -2
  5. package/dist/assets/hydrogen/vite/package.json +3 -4
  6. package/dist/assets/hydrogen/vite/vite.config.js +3 -3
  7. package/dist/bootstrap.js +1 -1
  8. package/dist/{chunk-MZL6VM3W.js → chunk-24NUJTIH.js} +1 -1
  9. package/dist/chunk-2CMEKSI7.js +1 -0
  10. package/dist/chunk-2DID73ML.js +1 -0
  11. package/dist/chunk-2ORRV7GH.js +1 -0
  12. package/dist/chunk-2VSNFOKD.js +1 -0
  13. package/dist/chunk-335BUVBP.js +1 -0
  14. package/dist/{chunk-PT3OZEBI.js → chunk-3A3DZVEJ.js} +1 -1
  15. package/dist/chunk-3C6VLJ5D.js +319 -0
  16. package/dist/{chunk-LCMDVUVO.js → chunk-3G4HJO72.js} +30 -30
  17. package/dist/chunk-3LVCG4JB.js +1 -0
  18. package/dist/chunk-43KLFFP7.js +1 -0
  19. package/dist/{chunk-QLHPTMIH.js → chunk-43R5VGKT.js} +1 -1
  20. package/dist/chunk-46MSIQ6Z.js +1 -0
  21. package/dist/chunk-4ARCB6DT.js +1 -0
  22. package/dist/chunk-4C2DAX5T.js +1 -0
  23. package/dist/chunk-4CRBTSVP.js +2 -0
  24. package/dist/chunk-4GCI2YCZ.js +8 -0
  25. package/dist/chunk-4GOJQKY5.js +1 -0
  26. package/dist/chunk-4RDFMBRG.js +9 -0
  27. package/dist/chunk-4SS6DXC7.js +5 -0
  28. package/dist/{chunk-Z4DESIR5.js → chunk-4TI7U2PN.js} +1 -1
  29. package/dist/{chunk-7BWSN3SG.js → chunk-52FDK2LC.js} +1 -1
  30. package/dist/chunk-53BG3NLH.js +3 -0
  31. package/dist/{chunk-LD6ZCTZ3.js → chunk-5B76DT7X.js} +1 -1
  32. package/dist/{chunk-YN4FSUFF.js → chunk-5NEGOQT6.js} +1 -1
  33. package/dist/{chunk-PFXDXD5O.js → chunk-5OMJFPQW.js} +1 -1
  34. package/dist/chunk-5TB52UUV.js +2 -0
  35. package/dist/chunk-5UWMXOHM.js +7 -0
  36. package/dist/chunk-6BNKBCCU.js +1 -0
  37. package/dist/chunk-6DXP7PQ7.js +1 -0
  38. package/dist/chunk-6PUU6ZNQ.js +1 -0
  39. package/dist/chunk-7GHSE7SG.js +1 -0
  40. package/dist/{chunk-5O7JTVO2.js → chunk-7IFE4UQY.js} +1 -1
  41. package/dist/chunk-7LAKWAKX.js +25 -0
  42. package/dist/chunk-7MVWDCI3.js +1 -0
  43. package/dist/chunk-7NSK77WG.js +3 -0
  44. package/dist/chunk-7QUZWCJZ.js +3 -0
  45. package/dist/chunk-7RPFJZLP.js +1 -0
  46. package/dist/{chunk-35NTERVR.js → chunk-7UOA4DI7.js} +2 -2
  47. package/dist/chunk-7WPUV7GY.js +6 -0
  48. package/dist/chunk-7Y7AZRL3.js +10 -0
  49. package/dist/{chunk-SEXH4EP5.js → chunk-ACA2BGAD.js} +1 -1
  50. package/dist/chunk-AJMDF3QC.js +1 -0
  51. package/dist/{chunk-CEQ5S3HH.js → chunk-AXC2MHHO.js} +1 -1
  52. package/dist/{chunk-5GFVMGAZ.js → chunk-AYL6KBPE.js} +1 -1
  53. package/dist/chunk-BAHIL37I.js +1 -0
  54. package/dist/{chunk-S6A7TMR4.js → chunk-BCYTZ7LM.js} +1 -1
  55. package/dist/{chunk-4VS7YD53.js → chunk-BJPDJIS4.js} +1 -1
  56. package/dist/{chunk-AJMJQA4J.js → chunk-BN7ZXAZJ.js} +1 -1
  57. package/dist/chunk-BVSKBX7T.js +16 -0
  58. package/dist/chunk-BWRNXCVN.js +4 -0
  59. package/dist/{chunk-ANG44FIF.js → chunk-C3KEDG33.js} +1 -1
  60. package/dist/{chunk-4BXQTW5G.js → chunk-C7V755IT.js} +1 -1
  61. package/dist/chunk-CCMDZX35.js +7 -0
  62. package/dist/chunk-CCQNP5YR.js +1 -0
  63. package/dist/chunk-CEIJKJOF.js +11 -0
  64. package/dist/chunk-CIK5BF7V.js +1 -0
  65. package/dist/{chunk-YIZAQABE.js → chunk-CVVQQLCF.js} +1 -1
  66. package/dist/chunk-CW2T7EOQ.js +1 -0
  67. package/dist/chunk-CZ22VZDA.js +376 -0
  68. package/dist/{chunk-VSFZEGIK.js → chunk-D7NB7YR6.js} +1 -1
  69. package/dist/{chunk-2VGPNRHH.js → chunk-DFQ4WTET.js} +2 -2
  70. package/dist/chunk-DJAZBPYA.js +3 -0
  71. package/dist/chunk-DNMXVMJM.js +47 -0
  72. package/dist/{chunk-G362JEAV.js → chunk-EGCWR5AS.js} +1 -1
  73. package/dist/{chunk-7LB6DPB6.js → chunk-EITIW5OX.js} +1 -1
  74. package/dist/chunk-EMSF57ZB.js +1 -0
  75. package/dist/{chunk-2II4W4ZF.js → chunk-EXFBZPZS.js} +1 -1
  76. package/dist/chunk-FDXHQZTO.js +26 -0
  77. package/dist/{chunk-YLCYRG2T.js → chunk-FFHH5LOR.js} +1 -1
  78. package/dist/{chunk-KOS53Z7E.js → chunk-FNLECT7B.js} +1 -1
  79. package/dist/{chunk-MTBABHUB.js → chunk-FWB3GLMW.js} +1 -1
  80. package/dist/chunk-FZCGRIOM.js +1 -0
  81. package/dist/{chunk-ND6O6KT6.js → chunk-G6ZMSWEU.js} +1 -1
  82. package/dist/chunk-GAMC2BNY.js +7 -0
  83. package/dist/chunk-GB6E3ATN.js +4 -0
  84. package/dist/chunk-GCNA3HXH.js +8 -0
  85. package/dist/{chunk-PIGERIRY.js → chunk-GFVKTWFT.js} +1 -1
  86. package/dist/chunk-GQNOVEKP.js +2 -0
  87. package/dist/{chunk-WGO2GC6I.js → chunk-GRGFA26K.js} +1 -1
  88. package/dist/chunk-GXORLBVN.js +2 -0
  89. package/dist/{chunk-HB4YI2PF.js → chunk-H4V55Y3Z.js} +118 -118
  90. package/dist/chunk-HCZG7YJ6.js +16 -0
  91. package/dist/chunk-HF4NDEX3.js +1 -0
  92. package/dist/chunk-HIRTL45Q.js +1 -0
  93. package/dist/chunk-I4OVLRQR.js +1 -0
  94. package/dist/{chunk-RUDHGUIM.js → chunk-I6FRVYGE.js} +1 -1
  95. package/dist/chunk-IEQ4UOH3.js +4 -0
  96. package/dist/{chunk-PIZDYS7T.js → chunk-IILLQOUC.js} +60 -60
  97. package/dist/{chunk-LG6DGIFX.js → chunk-IQVRP7CT.js} +1 -1
  98. package/dist/{chunk-5VRB3FBD.js → chunk-IUP7POIE.js} +1 -1
  99. package/dist/chunk-IUTZIN2T.js +10 -0
  100. package/dist/chunk-IWEKM5Y3.js +1 -0
  101. package/dist/chunk-IWTNUJGY.js +2 -0
  102. package/dist/chunk-J6TW43TG.js +1 -0
  103. package/dist/chunk-JDR6UVZA.js +8 -0
  104. package/dist/{chunk-NHE46R6C.js → chunk-JEA3C7ON.js} +1 -1
  105. package/dist/chunk-JOJV5E2K.js +1 -0
  106. package/dist/chunk-JYMDWR25.js +1 -0
  107. package/dist/{chunk-EAVD3OH2.js → chunk-KDPQXURV.js} +1 -1
  108. package/dist/{chunk-DO5YFMTJ.js → chunk-KGRIYAMA.js} +1 -1
  109. package/dist/chunk-KJQDS5HI.js +1 -0
  110. package/dist/chunk-KKPOOIE4.js +2 -0
  111. package/dist/{chunk-4IAGBAQD.js → chunk-KSDU4YOB.js} +1 -1
  112. package/dist/chunk-L7MSPGDS.js +5 -0
  113. package/dist/{chunk-JPFHPVIO.js → chunk-LDU5T3DN.js} +1 -1
  114. package/dist/chunk-LHKVXJPX.js +1 -0
  115. package/dist/{chunk-VG5ZDVDQ.js → chunk-LMQGNECW.js} +86 -200
  116. package/dist/{chunk-TQ7URMGS.js → chunk-LQ7ENG4V.js} +1 -1
  117. package/dist/chunk-LVLAOBJM.js +103 -0
  118. package/dist/chunk-LWCTKI4Z.js +18 -0
  119. package/dist/chunk-M3ACZWMR.js +1 -0
  120. package/dist/chunk-M4BVLMPH.js +31 -0
  121. package/dist/{chunk-WKVFVT3H.js → chunk-M5TGCSUK.js} +1 -1
  122. package/dist/chunk-M7LPHCP2.js +274 -0
  123. package/dist/{chunk-QBIYAMSH.js → chunk-MDRVCBDO.js} +1 -1
  124. package/dist/chunk-MR2AUT7Q.js +1 -0
  125. package/dist/chunk-MXJAH2GW.js +5 -0
  126. package/dist/{chunk-EO422KZZ.js → chunk-MYAIWSOO.js} +1 -1
  127. package/dist/{chunk-Y5VFOLNQ.js → chunk-N2RFDHRY.js} +1 -1
  128. package/dist/{chunk-7DSH4CRU.js → chunk-NB4BRW3H.js} +1 -1
  129. package/dist/chunk-NDKSG4CC.js +97 -0
  130. package/dist/chunk-NK2MGR6A.js +1 -0
  131. package/dist/chunk-NOH63WC6.js +12 -0
  132. package/dist/{chunk-3XAD2E55.js → chunk-OGWPS55W.js} +1 -1
  133. package/dist/chunk-OQ5CLM2H.js +4 -0
  134. package/dist/{chunk-MQ4WV4B6.js → chunk-OQU3HLAE.js} +1 -1
  135. package/dist/chunk-OVWUGAEU.js +11 -0
  136. package/dist/chunk-OX7UVDSU.js +6 -0
  137. package/dist/chunk-P33TONYG.js +1 -0
  138. package/dist/chunk-PEVIRAMR.js +6 -0
  139. package/dist/{chunk-LLNUIGHP.js → chunk-PGLWZMJU.js} +4 -4
  140. package/dist/chunk-PIAD3F6M.js +16 -0
  141. package/dist/chunk-PMHP57MH.js +20 -0
  142. package/dist/{chunk-XTOOTN4P.js → chunk-POKY4RWR.js} +1 -1
  143. package/dist/chunk-PSSYLJG4.js +2 -0
  144. package/dist/chunk-PYIICTLX.js +1 -0
  145. package/dist/chunk-PZUGDE7N.js +2 -0
  146. package/dist/{chunk-SUTVPAJF.js → chunk-Q2SZCZE7.js} +1 -1
  147. package/dist/{chunk-EZG5EB7D.js → chunk-Q2XRITUG.js} +1 -1
  148. package/dist/chunk-Q5MEFIMV.js +4 -0
  149. package/dist/chunk-Q66CI37F.js +7 -0
  150. package/dist/chunk-QFWWCZOI.js +1 -0
  151. package/dist/{chunk-TR4OWSEX.js → chunk-QFYLJVJW.js} +1 -1
  152. package/dist/chunk-QKVVJXWS.js +3 -0
  153. package/dist/chunk-QN3774QI.js +1 -0
  154. package/dist/chunk-R2BDABJD.js +213 -0
  155. package/dist/{chunk-RW3P3UMU.js → chunk-R7EMV77H.js} +2 -2
  156. package/dist/chunk-RFGEM5JC.js +3 -0
  157. package/dist/{chunk-HY6EXJBZ.js → chunk-RVQV6G5M.js} +1 -1
  158. package/dist/chunk-S67I4E7M.js +5 -0
  159. package/dist/chunk-SFPXYHHL.js +1 -0
  160. package/dist/{chunk-XPDHT3Z4.js → chunk-SFQEHDJY.js} +1 -1
  161. package/dist/chunk-SL3VBI62.js +3 -0
  162. package/dist/{chunk-5XTJ4OL4.js → chunk-SNNZ4U2W.js} +1 -1
  163. package/dist/chunk-T2IUXXCT.js +1 -0
  164. package/dist/chunk-TPSA4JN5.js +1 -0
  165. package/dist/chunk-TTEF7GTX.js +1 -0
  166. package/dist/{chunk-BAHM64B4.js → chunk-U25W35TX.js} +1 -1
  167. package/dist/chunk-UIQL5ZF3.js +1 -0
  168. package/dist/chunk-UK6576EO.js +1 -0
  169. package/dist/chunk-ULD7CIOY.js +4 -0
  170. package/dist/{chunk-65GNYRYR.js → chunk-UOS2XLGG.js} +2 -2
  171. package/dist/{chunk-VNG2I7NM.js → chunk-UVRKTMF7.js} +1 -1
  172. package/dist/{chunk-BD2L6YE5.js → chunk-UWMZ5CSB.js} +1 -1
  173. package/dist/chunk-UZROQRLX.js +2 -0
  174. package/dist/{chunk-5BGUKF7L.js → chunk-V75WUEFU.js} +1 -1
  175. package/dist/chunk-VB7YQMAM.js +5 -0
  176. package/dist/chunk-VHUD3CBC.js +3 -0
  177. package/dist/chunk-VMMUJN4T.js +17 -0
  178. package/dist/{chunk-T3UCIWRH.js → chunk-VW6QS7DO.js} +1 -1
  179. package/dist/chunk-VWH3VPYI.js +1 -0
  180. package/dist/{chunk-4TF7ER72.js → chunk-WBJ6ZHYH.js} +1 -1
  181. package/dist/chunk-WDFCOZAY.js +16 -0
  182. package/dist/chunk-WFWISGLS.js +1 -0
  183. package/dist/chunk-WGUOLSMG.js +1 -0
  184. package/dist/{chunk-VTOPYXHO.js → chunk-WJSUIUBW.js} +2 -2
  185. package/dist/{chunk-762IKULK.js → chunk-WMAFG2JD.js} +1 -1
  186. package/dist/chunk-X2H6I2WW.js +5 -0
  187. package/dist/{chunk-MWWULCLD.js → chunk-X7HVAVSZ.js} +1 -1
  188. package/dist/{chunk-MF7IHOM5.js → chunk-XBQDMGUN.js} +1 -1
  189. package/dist/chunk-XITZIDCL.js +18 -0
  190. package/dist/chunk-XKRJKUA7.js +1 -0
  191. package/dist/{chunk-K6FH5JSY.js → chunk-XM7YUXTF.js} +2 -2
  192. package/dist/chunk-XMODGI45.js +1 -0
  193. package/dist/{chunk-5NCWBBRW.js → chunk-XNNKLUTN.js} +1 -1
  194. package/dist/chunk-XTREQ4A2.js +1 -0
  195. package/dist/chunk-YGYEM6QO.js +1 -0
  196. package/dist/{chunk-XVFQ6CNO.js → chunk-YKS7MH3F.js} +9 -6
  197. package/dist/chunk-YTUDXZLN.js +1 -0
  198. package/dist/{chunk-I3J63RFV.js → chunk-YTUUU33R.js} +1 -1
  199. package/dist/chunk-YVVU4J5O.js +3 -0
  200. package/dist/{chunk-QUO4RD3W.js → chunk-YVY32DNA.js} +1 -1
  201. package/dist/chunk-Z5SILNH2.js +7 -0
  202. package/dist/chunk-ZAA2DXK5.js +5 -0
  203. package/dist/chunk-ZDQO6CNY.js +1 -0
  204. package/dist/chunk-ZGV3HNEV.js +1 -0
  205. package/dist/chunk-ZQDDRIBA.js +22 -0
  206. package/dist/{chunk-AODTY2BL.js → chunk-ZT5WFUKJ.js} +4 -4
  207. package/dist/chunk-ZYQ2XWC5.js +5 -0
  208. package/dist/cli/commands/app/build.js +1 -1
  209. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  210. package/dist/cli/commands/app/bulk/execute.js +1 -1
  211. package/dist/cli/commands/app/bulk/status.js +1 -1
  212. package/dist/cli/commands/app/config/link.js +1 -1
  213. package/dist/cli/commands/app/config/pull.js +1 -1
  214. package/dist/cli/commands/app/config/use.js +1 -1
  215. package/dist/cli/commands/app/config/validate.js +1 -1
  216. package/dist/cli/commands/app/demo/watcher.js +1 -1
  217. package/dist/cli/commands/app/deploy.js +1 -1
  218. package/dist/cli/commands/app/dev/clean.js +1 -1
  219. package/dist/cli/commands/app/dev.js +1 -1
  220. package/dist/cli/commands/app/env/pull.js +1 -1
  221. package/dist/cli/commands/app/env/show.js +1 -1
  222. package/dist/cli/commands/app/execute.js +1 -1
  223. package/dist/cli/commands/app/function/build.js +1 -1
  224. package/dist/cli/commands/app/function/info.js +1 -1
  225. package/dist/cli/commands/app/function/replay.js +1 -1
  226. package/dist/cli/commands/app/function/run.js +1 -1
  227. package/dist/cli/commands/app/function/schema.js +1 -1
  228. package/dist/cli/commands/app/function/typegen.js +1 -1
  229. package/dist/cli/commands/app/generate/extension.js +1 -1
  230. package/dist/cli/commands/app/graphiql.js +1 -1
  231. package/dist/cli/commands/app/import/channel-config.js +1 -1
  232. package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
  233. package/dist/cli/commands/app/import/dashboard-extensions.js +1 -1
  234. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  235. package/dist/cli/commands/app/import-extensions.js +1 -1
  236. package/dist/cli/commands/app/info.js +1 -1
  237. package/dist/cli/commands/app/init.js +1 -1
  238. package/dist/cli/commands/app/logs.js +1 -1
  239. package/dist/cli/commands/app/release.js +1 -1
  240. package/dist/cli/commands/app/security/check.js +1 -1
  241. package/dist/cli/commands/app/security/clean.js +1 -1
  242. package/dist/cli/commands/app/security/instructions.js +1 -1
  243. package/dist/cli/commands/app/security/record.js +1 -1
  244. package/dist/cli/commands/app/security/review.js +1 -1
  245. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  246. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  247. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  248. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  249. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  250. package/dist/cli/commands/app/versions/list.js +1 -1
  251. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  252. package/dist/cli/commands/auth/login.js +1 -1
  253. package/dist/cli/commands/auth/logout.js +1 -1
  254. package/dist/cli/commands/cache/clear.js +1 -1
  255. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  256. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  257. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  258. package/dist/cli/commands/debug/command-flags.js +1 -1
  259. package/dist/cli/commands/doc/fetch.d.ts +34 -1
  260. package/dist/cli/commands/doc/fetch.js +1 -1
  261. package/dist/cli/commands/doc/search.d.ts +53 -1
  262. package/dist/cli/commands/doc/search.js +1 -1
  263. package/dist/cli/commands/docs/generate.js +1 -1
  264. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  265. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  266. package/dist/cli/commands/help.d.ts +6 -6
  267. package/dist/cli/commands/help.js +1 -1
  268. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  269. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  270. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  271. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  272. package/dist/cli/commands/notifications/generate.js +1 -1
  273. package/dist/cli/commands/notifications/list.js +1 -1
  274. package/dist/cli/commands/organization/list.js +1 -1
  275. package/dist/cli/commands/search.js +1 -1
  276. package/dist/cli/commands/send-analytics.js +1 -1
  277. package/dist/cli/commands/theme/check.js +1 -1
  278. package/dist/cli/commands/theme/console.js +1 -1
  279. package/dist/cli/commands/theme/delete.js +1 -1
  280. package/dist/cli/commands/theme/dev.js +1 -1
  281. package/dist/cli/commands/theme/duplicate.js +1 -1
  282. package/dist/cli/commands/theme/info.js +1 -1
  283. package/dist/cli/commands/theme/init.js +1 -1
  284. package/dist/cli/commands/theme/language-server.js +1 -1
  285. package/dist/cli/commands/theme/list.js +1 -1
  286. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  287. package/dist/cli/commands/theme/open.js +1 -1
  288. package/dist/cli/commands/theme/package.js +1 -1
  289. package/dist/cli/commands/theme/preview.js +1 -1
  290. package/dist/cli/commands/theme/profile.js +1 -1
  291. package/dist/cli/commands/theme/publish.js +1 -1
  292. package/dist/cli/commands/theme/pull.js +1 -1
  293. package/dist/cli/commands/theme/push.js +1 -1
  294. package/dist/cli/commands/theme/rename.js +1 -1
  295. package/dist/cli/commands/theme/share.js +1 -1
  296. package/dist/cli/commands/upgrade.d.ts +64 -0
  297. package/dist/cli/commands/upgrade.js +1 -1
  298. package/dist/cli/commands/version.js +1 -1
  299. package/dist/cli/help.js +1 -1
  300. package/dist/cli/services/commands/doc/fetch-result.d.ts +2 -0
  301. package/dist/cli/services/commands/doc/fetch-result.js +22 -0
  302. package/dist/cli/services/commands/doc/fetch.d.ts +2 -1
  303. package/dist/cli/services/commands/doc/fetch.js +2 -15
  304. package/dist/cli/services/commands/doc/search-result.d.ts +2 -0
  305. package/dist/cli/services/commands/doc/search-result.js +14 -0
  306. package/dist/cli/services/commands/doc/search.d.ts +9 -1
  307. package/dist/cli/services/commands/doc/search.js +27 -2
  308. package/dist/cli/services/commands/doc/types.d.ts +107 -0
  309. package/dist/cli/services/commands/doc/types.js +47 -0
  310. package/dist/cli/services/commands/help/types.d.ts +6 -6
  311. package/dist/command-event-context-LFUZ7UCA.js +1 -0
  312. package/dist/command-json-schema-2UMKY7MY.js +1 -0
  313. package/dist/command-registry.js +1 -1
  314. package/dist/conf-store-RI3TL6I4.js +1 -0
  315. package/dist/custom-oclif-loader-IZCKN67O.js +1 -0
  316. package/dist/deprecations-IFVUXXDB.js +1 -0
  317. package/dist/dist-4H2B7BMN.js +1 -0
  318. package/dist/dist-QNWOGQN3.js +1 -0
  319. package/dist/{environment-RSUK27TA.js → environment-O7ECODHU.js} +1 -1
  320. package/dist/environments-CYMEN7NV.js +1 -0
  321. package/dist/error-IL6WQMSW.js +1 -0
  322. package/dist/error-handler-74HKA23T.js +1 -0
  323. package/dist/fs-AINFLJ2E.js +1 -0
  324. package/dist/hooks/did-you-mean.js +1 -1
  325. package/dist/hooks/hydrogen-init.js +1 -1
  326. package/dist/hooks/plugin-plugins.js +1 -1
  327. package/dist/hooks/postrun.js +1 -1
  328. package/dist/hooks/prerun.js +1 -1
  329. package/dist/hooks/public-metadata.js +1 -1
  330. package/dist/hooks/sensitive-metadata.js +1 -1
  331. package/dist/hooks/tunnel-provider.js +1 -1
  332. package/dist/hooks/tunnel-start.js +1 -1
  333. package/dist/index.js +13 -13
  334. package/dist/is-global-2VLKV46Q.js +1 -0
  335. package/dist/json-error-HZB5YIHV.js +1 -0
  336. package/dist/{lib-TYM5B75S.js → lib-PJHT4MKY.js} +1 -1
  337. package/dist/{lib-55QUD4AJ.js → lib-VKSQ65BQ.js} +1 -1
  338. package/dist/{lib-PH52G55H.js → lib-YEZOHXF3.js} +1 -1
  339. package/dist/{local-ZZGRGYUP.js → local-KOZETREJ.js} +1 -1
  340. package/dist/{metadata-YQNVKC2R.js → metadata-IBPHZB7N.js} +1 -1
  341. package/dist/{morph-BABFBRSW.js → morph-CRY35DIK.js} +1 -1
  342. package/dist/node-package-manager-DXSRNEDC.js +1 -0
  343. package/dist/notifications-system-XA3EBOGJ.js +1 -0
  344. package/dist/os-X73O7BAB.js +1 -0
  345. package/dist/out-B2GISN65.js +1 -0
  346. package/dist/output-3OYXK3Z5.js +1 -0
  347. package/dist/{path-CPAYTWQW.js → path-3L2QRACZ.js} +1 -1
  348. package/dist/system-JWYYT4PM.js +1 -0
  349. package/dist/tsconfig.tsbuildinfo +1 -1
  350. package/dist/ui-PCG5D6RZ.js +1 -0
  351. package/dist/upgrade-7U2TUNC4.js +1 -0
  352. package/dist/version-7DGU2KYH.js +1 -0
  353. package/dist/version-SXQTRBXB.js +1 -0
  354. package/dist/workerd-MQZ3NKJI.js +18 -0
  355. package/oclif.manifest.json +1664 -427
  356. package/package.json +8 -8
  357. package/dist/analytics-PBZEKUGU.js +0 -1
  358. package/dist/analytics-WVGBNFGK.js +0 -1
  359. package/dist/chunk-2EC5SUGK.js +0 -19
  360. package/dist/chunk-2QENUJVG.js +0 -1
  361. package/dist/chunk-2RONPKOD.js +0 -1
  362. package/dist/chunk-2WDJXERZ.js +0 -25
  363. package/dist/chunk-32NWVYUC.js +0 -1
  364. package/dist/chunk-32RRWGNS.js +0 -1
  365. package/dist/chunk-32VQQ6EU.js +0 -1
  366. package/dist/chunk-34RFTE5T.js +0 -4
  367. package/dist/chunk-35VQQKVX.js +0 -1
  368. package/dist/chunk-3N6NKC2U.js +0 -1
  369. package/dist/chunk-3Q5BAPQK.js +0 -7
  370. package/dist/chunk-42DMJGOW.js +0 -2
  371. package/dist/chunk-4CTTWXUX.js +0 -32
  372. package/dist/chunk-4HBKQUKY.js +0 -1
  373. package/dist/chunk-4MQXMIWQ.js +0 -7
  374. package/dist/chunk-5APLAJCB.js +0 -3
  375. package/dist/chunk-5AQNISGC.js +0 -1
  376. package/dist/chunk-5OM72O4N.js +0 -1
  377. package/dist/chunk-5SLKHURV.js +0 -1
  378. package/dist/chunk-62GA7XR3.js +0 -18
  379. package/dist/chunk-62LMVFR7.js +0 -1
  380. package/dist/chunk-6IDEDOXW.js +0 -2
  381. package/dist/chunk-72CBJYAG.js +0 -16
  382. package/dist/chunk-7E4MJCVE.js +0 -10
  383. package/dist/chunk-7HZU7CYS.js +0 -1
  384. package/dist/chunk-7Q4EKY3E.js +0 -3
  385. package/dist/chunk-7YXHILW4.js +0 -383
  386. package/dist/chunk-7Z6IX7MU.js +0 -1
  387. package/dist/chunk-A4XREDFZ.js +0 -1
  388. package/dist/chunk-AHNLGCHF.js +0 -5
  389. package/dist/chunk-ARRRFY6S.js +0 -4
  390. package/dist/chunk-BAP2CHI2.js +0 -1
  391. package/dist/chunk-BQWK222Q.js +0 -1
  392. package/dist/chunk-C3PXIZY3.js +0 -8
  393. package/dist/chunk-C6HGU77I.js +0 -1
  394. package/dist/chunk-CBFAU5AF.js +0 -5
  395. package/dist/chunk-COP2Q2YT.js +0 -1
  396. package/dist/chunk-CSWDRG3E.js +0 -1
  397. package/dist/chunk-CVBWEUWX.js +0 -1
  398. package/dist/chunk-D3NVUE65.js +0 -1
  399. package/dist/chunk-DCKRQZLE.js +0 -20
  400. package/dist/chunk-DYH3ZXJS.js +0 -15
  401. package/dist/chunk-EBX6DYDX.js +0 -2
  402. package/dist/chunk-EDRCFY3K.js +0 -16
  403. package/dist/chunk-EEAY7HFW.js +0 -317
  404. package/dist/chunk-EJMLNBZA.js +0 -275
  405. package/dist/chunk-EO3S2TFI.js +0 -2
  406. package/dist/chunk-EOIGDOUD.js +0 -7
  407. package/dist/chunk-EYKXHMEJ.js +0 -6
  408. package/dist/chunk-FHV2H3Z2.js +0 -12
  409. package/dist/chunk-FOAV642V.js +0 -1
  410. package/dist/chunk-FVTP7EO4.js +0 -46
  411. package/dist/chunk-FYIC4JHB.js +0 -26
  412. package/dist/chunk-GF36WNMH.js +0 -5
  413. package/dist/chunk-GJ3QUZO6.js +0 -1
  414. package/dist/chunk-GJZVUEMP.js +0 -11
  415. package/dist/chunk-GP6O7YRO.js +0 -20
  416. package/dist/chunk-GW424AJO.js +0 -7
  417. package/dist/chunk-GXSF6NCR.js +0 -1
  418. package/dist/chunk-GYVQIRBD.js +0 -1
  419. package/dist/chunk-H3ZPYOQV.js +0 -1
  420. package/dist/chunk-H7YSZKZ2.js +0 -1
  421. package/dist/chunk-HILYTMVA.js +0 -1
  422. package/dist/chunk-HMWQOQAQ.js +0 -2
  423. package/dist/chunk-HNSRF4SQ.js +0 -1
  424. package/dist/chunk-HTODXNY6.js +0 -3
  425. package/dist/chunk-IUYVJJKE.js +0 -9
  426. package/dist/chunk-JM2CQP64.js +0 -97
  427. package/dist/chunk-K4AF7A25.js +0 -1
  428. package/dist/chunk-KDV4WR5A.js +0 -4
  429. package/dist/chunk-KF7NL5YM.js +0 -8
  430. package/dist/chunk-KMJTO7CU.js +0 -103
  431. package/dist/chunk-KN3MUEWA.js +0 -4
  432. package/dist/chunk-KYB4JX76.js +0 -5
  433. package/dist/chunk-LJAU6YHF.js +0 -10
  434. package/dist/chunk-LMQOFVRC.js +0 -17
  435. package/dist/chunk-LQSD25YS.js +0 -3
  436. package/dist/chunk-M2HQFHNO.js +0 -1
  437. package/dist/chunk-M5WBYWSQ.js +0 -7
  438. package/dist/chunk-N47RQHEI.js +0 -2
  439. package/dist/chunk-NRG2WPSM.js +0 -1
  440. package/dist/chunk-O2CP7DQE.js +0 -1
  441. package/dist/chunk-O6FXUKI2.js +0 -2
  442. package/dist/chunk-OHJUEUSA.js +0 -1
  443. package/dist/chunk-OOKTWSGP.js +0 -4
  444. package/dist/chunk-OONMCK7X.js +0 -1
  445. package/dist/chunk-OWK2RI4O.js +0 -6
  446. package/dist/chunk-P2UEQJJ4.js +0 -5
  447. package/dist/chunk-QBJ74XPX.js +0 -18
  448. package/dist/chunk-QGFJOTOH.js +0 -4
  449. package/dist/chunk-RIO5HKD5.js +0 -1
  450. package/dist/chunk-S7EKUSO6.js +0 -3
  451. package/dist/chunk-SJ2ROSXG.js +0 -1
  452. package/dist/chunk-SNTRSP5K.js +0 -359
  453. package/dist/chunk-SYCN2GT2.js +0 -3
  454. package/dist/chunk-TBNEN73P.js +0 -1
  455. package/dist/chunk-TVI7TQ4C.js +0 -16
  456. package/dist/chunk-TYMYIUIQ.js +0 -1
  457. package/dist/chunk-UEQT7TA4.js +0 -1
  458. package/dist/chunk-UUM367NR.js +0 -5
  459. package/dist/chunk-V5FZRNXI.js +0 -1
  460. package/dist/chunk-VE35YELD.js +0 -1
  461. package/dist/chunk-WEICJ4GW.js +0 -1
  462. package/dist/chunk-WJJXJNNP.js +0 -3
  463. package/dist/chunk-XAQUXFN5.js +0 -1
  464. package/dist/chunk-XE6EUHSS.js +0 -2
  465. package/dist/chunk-XFEJS652.js +0 -16
  466. package/dist/chunk-XI4QEULN.js +0 -1
  467. package/dist/chunk-XP63T4KZ.js +0 -5
  468. package/dist/chunk-XRCAUZAZ.js +0 -8
  469. package/dist/chunk-XSRZWJIJ.js +0 -1
  470. package/dist/chunk-YFJELEVH.js +0 -1
  471. package/dist/chunk-YNJIDLI3.js +0 -7
  472. package/dist/chunk-YRX4E67D.js +0 -6
  473. package/dist/chunk-Z2NL6XQK.js +0 -6
  474. package/dist/chunk-Z6Z5DPKS.js +0 -1
  475. package/dist/chunk-ZOE6WXW6.js +0 -1
  476. package/dist/cli/commands/app/app-logs/sources.js +0 -1
  477. package/dist/command-json-schema-3RP5P43D.js +0 -1
  478. package/dist/conf-store-XORTWCKZ.js +0 -1
  479. package/dist/custom-oclif-loader-ZRYPPYIP.js +0 -1
  480. package/dist/deprecations-AZDMCRNN.js +0 -1
  481. package/dist/dist-DTBXLVHF.js +0 -1
  482. package/dist/dist-SOYIDACZ.js +0 -1
  483. package/dist/environments-L42SEHB4.js +0 -1
  484. package/dist/error-H6B5BHYC.js +0 -1
  485. package/dist/error-handler-JB752NKM.js +0 -1
  486. package/dist/fs-XHZY6MNM.js +0 -1
  487. package/dist/is-global-2NBDZWLC.js +0 -1
  488. package/dist/json-error-OHV2KQFY.js +0 -1
  489. package/dist/node-package-manager-LN2Y7FQ2.js +0 -1
  490. package/dist/notifications-system-HWJ3F44U.js +0 -1
  491. package/dist/os-MHOCCDIB.js +0 -1
  492. package/dist/out-53ABAVL7.js +0 -1
  493. package/dist/output-GILH4S6M.js +0 -1
  494. package/dist/system-6WYK24ET.js +0 -1
  495. package/dist/ui-RP6SVJUK.js +0 -1
  496. package/dist/upgrade-5G7FBJJV.js +0 -1
  497. package/dist/version-TOBC7X2C.js +0 -1
  498. package/dist/version-UIRCT6RC.js +0 -1
  499. package/dist/workerd-ARH2OCYL.js +0 -18
@@ -1 +1 @@
1
- import{j as m}from"./chunk-HB4YI2PF.js";import{a as k,b as G}from"./chunk-WGO2GC6I.js";import{f as H}from"./chunk-MWWULCLD.js";import{i as u}from"./chunk-4HBKQUKY.js";import{Aa as x,Cb as p,Eb as l,Nb as h,Sa as R,Ta as T,oa as g,ya as y}from"./chunk-62GA7XR3.js";import{c as $,h as b}from"./chunk-6IDEDOXW.js";import{g as w}from"./chunk-VKWPEFWQ.js";w();var d=class extends Error{constructor(t,e,o){super(`The request to GitHub API URL ${t} failed with status code ${e} and the following error message: ${o.message}`)}};async function A(i,t,e={filter:()=>!0}){h(l`Getting the latest release of GitHub repository ${i}/${t}...`);let o=`https://api.github.com/repos/${i}/${t}/releases`,r=await m(o);try{let s=await r.text(),n=JSON.parse(s);if(r.status!==200)throw new d(o,r.status,n);return n.find(e.filter)}catch(s){throw s instanceof SyntaxError?new u(`Received invalid response from GitHub API (HTTP ${r.status}).`,"The response could not be parsed as JSON. The service may be temporarily unavailable. Please try again."):s}}function B(i){let t=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(i);if(!t){let S=["github:user/repo","user/repo/subdirectory","git@github.com:user/repo","user/repo#dev","https://github.com/user/repo"];return G(new Error(`Parsing the url ${i} failed. Supported formats are ${S.join(", ")}.`))}let e=t[1]??t[2]??t[3]??"github.com",o=e==="github"?"github.com":e,r=t[4],s=t[5].replace(/\.git$/,""),n=t[6]?.slice(1),a=t[7],f=a?`#${a}`:"",c=`git@${o}:${r}/${s}`,P=`https://${o}/${r}/${s}`,v=["https:/",o,r,s,n].join("/").concat(f);return k({full:v,site:o,user:r,name:s,ref:a,subDirectory:n,ssh:c,http:P})}function I(i){let t=new URL(i),e=t.hash?t.hash.slice(1):void 0,[o,r,s,...n]=t.pathname.split("/"),a=n.length>0?n.join("/"):void 0;return{baseURL:`${t.origin}/${r}/${s}`,branch:e,filePath:a}}async function q(i,t,e,o){let r=`https://github.com/${i}/releases/download/${t}/${e}`;return H("cmd_all_timing_network_ms")(async()=>{h(l`Downloading ${p.link(e,r)}`),await g(async s=>{let n=$(s,e),a;try{if(a=await m(r,void 0,"slow-request"),!a.ok)throw new u(`Failed to download ${e}: ${a.statusText}`)}catch(c){throw new u(`Failed to download ${e}: ${c instanceof Error?c.message:"unknown error"}`)}let f=await a.arrayBuffer();await y(n,Buffer.from(f)),await T(n,493),await x(b(o)),await R(n,o)}),h(l`${p.successIcon()} Successfully downloaded ${p.path(o)}`)})}export{A as a,B as b,I as c,q as d};
1
+ import{j as m}from"./chunk-H4V55Y3Z.js";import{a as k,b as G}from"./chunk-GRGFA26K.js";import{f as H}from"./chunk-X7HVAVSZ.js";import{h as u}from"./chunk-2VSNFOKD.js";import{Bb as h,Na as R,Oa as T,ja as g,qb as p,sb as l,ta as y,va as x}from"./chunk-LWCTKI4Z.js";import{c as $,h as b}from"./chunk-IWTNUJGY.js";import{g as w}from"./chunk-VKWPEFWQ.js";w();var d=class extends Error{constructor(t,e,o){super(`The request to GitHub API URL ${t} failed with status code ${e} and the following error message: ${o.message}`)}};async function A(i,t,e={filter:()=>!0}){h(l`Getting the latest release of GitHub repository ${i}/${t}...`);let o=`https://api.github.com/repos/${i}/${t}/releases`,r=await m(o);try{let s=await r.text(),n=JSON.parse(s);if(r.status!==200)throw new d(o,r.status,n);return n.find(e.filter)}catch(s){throw s instanceof SyntaxError?new u(`Received invalid response from GitHub API (HTTP ${r.status}).`,"The response could not be parsed as JSON. The service may be temporarily unavailable. Please try again."):s}}function B(i){let t=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(i);if(!t){let S=["github:user/repo","user/repo/subdirectory","git@github.com:user/repo","user/repo#dev","https://github.com/user/repo"];return G(new Error(`Parsing the url ${i} failed. Supported formats are ${S.join(", ")}.`))}let e=t[1]??t[2]??t[3]??"github.com",o=e==="github"?"github.com":e,r=t[4],s=t[5].replace(/\.git$/,""),n=t[6]?.slice(1),a=t[7],f=a?`#${a}`:"",c=`git@${o}:${r}/${s}`,P=`https://${o}/${r}/${s}`,v=["https:/",o,r,s,n].join("/").concat(f);return k({full:v,site:o,user:r,name:s,ref:a,subDirectory:n,ssh:c,http:P})}function I(i){let t=new URL(i),e=t.hash?t.hash.slice(1):void 0,[o,r,s,...n]=t.pathname.split("/"),a=n.length>0?n.join("/"):void 0;return{baseURL:`${t.origin}/${r}/${s}`,branch:e,filePath:a}}async function q(i,t,e,o){let r=`https://github.com/${i}/releases/download/${t}/${e}`;return H("cmd_all_timing_network_ms")(async()=>{h(l`Downloading ${p.link(e,r)}`),await g(async s=>{let n=$(s,e),a;try{if(a=await m(r,void 0,"slow-request"),!a.ok)throw new u(`Failed to download ${e}: ${a.statusText}`)}catch(c){throw new u(`Failed to download ${e}: ${c instanceof Error?c.message:"unknown error"}`)}let f=await a.arrayBuffer();await y(n,Buffer.from(f)),await T(n,493),await x(b(o)),await R(n,o)}),h(l`${p.successIcon()} Successfully downloaded ${p.path(o)}`)})}export{A as a,B as b,I as c,q as d};
@@ -0,0 +1,2 @@
1
+ import{b as p,d as c,e as _,f as q}from"./chunk-7QUZWCJZ.js";import{a as T}from"./chunk-RVQV6G5M.js";import{a as F,b as B,c as E,l as w,n as C,o as y,t as D}from"./chunk-OGWPS55W.js";import{a as R}from"./chunk-ZGV3HNEV.js";import{a as x}from"./chunk-FWB3GLMW.js";import{u as m}from"./chunk-H4V55Y3Z.js";import{b as S,c as A}from"./chunk-Q2SZCZE7.js";import{A as f,B as k,C as O,z as d}from"./chunk-CZ22VZDA.js";import{h}from"./chunk-2VSNFOKD.js";import{qb as b,sb as g,wb as I}from"./chunk-LWCTKI4Z.js";import{b as N}from"./chunk-YTUUU33R.js";import{e as L,g as i}from"./chunk-VKWPEFWQ.js";i();i();async function j(o){let{storeFqdn:e,operationId:a,remoteApp:t}=o,r=await T(t,e),n=await w({adminSession:r,operationId:a});return{store:e,apiVersion:F,operation:n?.bulkOperation??null,userErrors:n?.userErrors??[]}}i();function G(o,e,a){if(a==="json"){if(o.userErrors.length||!o.operation){let r=new h("Failed to cancel bulk operation.");throw r.details={...c(o),operationGid:e,userErrors:o.userErrors},r}I(p.encode({...c(o),status:"success",operation:_(o.operation)}));return}if(o.userErrors.length){C(o.userErrors,"Failed to cancel bulk operation.");return}let t=o.operation;if(t){let r=y(t),n=t.status==="CANCELING"?[`This may take a few moments. Check the status with:
2
+ `,{command:`shopify app bulk status --id=${E(t.id)}`}]:r.body,s={headline:r.headline,...n&&{body:n},...r.customSections&&{customSections:r.customSections}};switch(r.renderType){case"success":f(s);break;case"warning":k(s);break;case"info":d(s);break}}else O({headline:"Bulk operation not found or could not be canceled.",body:g`ID: ${b.yellow(e)}`.value})}var u=L(N(),1);var l=class o extends R{static summary="Cancel a bulk operation.";static descriptionWithMarkdown="Cancels a running bulk operation by ID.";static description=this.descriptionForHelp();static flags={...S,...A,...x,id:u.Flags.string({description:"The bulk operation ID to cancel (numeric ID or full GID).",env:"SHOPIFY_FLAG_ID",required:!0}),store:u.Flags.string({char:"s",description:"The store domain. Must be an existing dev store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>m(e)})};static get jsonOutputSchema(){return p}async run(){let{flags:e}=await this.parse(o),{appContextResult:a,store:t}=await D(e),r=e.json?"json":"text",n=B(e.id);q("Canceling bulk operation.",{organization:a.organization,remoteApp:a.remoteApp,storeFqdn:t.shopDomain,operationId:n},r);let s=await j({storeFqdn:t.shopDomain,operationId:n,remoteApp:a.remoteApp});return G(s,n,r),{app:a.app}}};export{l as a};
@@ -1 +1 @@
1
- import{b as i}from"./chunk-I3J63RFV.js";import{e,g as n}from"./chunk-VKWPEFWQ.js";n();var o=e(i(),1),t=["high","medium","low","none"],s={blocking:o.Flags.custom({description:"The minimum finding severity that causes a non-zero exit code: high, medium, or low. Defaults to none, which never fails on findings.",options:t,default:"none",env:"SHOPIFY_FLAG_APP_SECURITY_BLOCKING"})()};export{s as a};
1
+ import{b as i}from"./chunk-YTUUU33R.js";import{e,g as n}from"./chunk-VKWPEFWQ.js";n();var o=e(i(),1),t=["high","medium","low","none"],s={blocking:o.Flags.custom({description:"The minimum finding severity that causes a non-zero exit code: high, medium, or low. Defaults to none, which never fails on findings.",options:t,default:"none",env:"SHOPIFY_FLAG_APP_SECURITY_BLOCKING"})()};export{s as a};
@@ -0,0 +1,5 @@
1
+ import{b as oe}from"./chunk-3LVCG4JB.js";import{a as ie,b as ne,q as re}from"./chunk-NDKSG4CC.js";import{$ as te,F as ee}from"./chunk-CZ22VZDA.js";import{a as q,d as X}from"./chunk-335BUVBP.js";import{h as A}from"./chunk-2VSNFOKD.js";import{Sa as Z,la as Y}from"./chunk-LWCTKI4Z.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();d();d();var Ce=/^gid:\/\/shopify\/Shop\/(\d+)$/,ve=/^\d+$/,se=250,De=new Set(ie),Re=new Set(ne);function le(i,e){let o=[],t=[],n=new Map;for(let s of e){let f=Be(s.shopId),l=!0;if(f){let L=n.get(f);L===void 0?n.set(f,s.sourceRow):(o.push({row:s.sourceRow,field:"shop_id",message:`Duplicate shop ID; first seen on row ${L}`}),l=!1)}else o.push({row:s.sourceRow,field:"shop_id",message:"Shop ID must be a positive numeric ID or gid://shopify/Shop/<id>"}),l=!1;if(i==="unschedule"){l&&f&&t.push({action:i,shopId:f});continue}let h=s.targetPlanHandle?.trim(),w=s.priceBehavior?.trim(),S=s.notification?.trim(),O=S?.length?S:"WHEN_REQUIRED";h||(o.push({row:s.sourceRow,field:"target_plan_handle",message:"Target plan handle is required"}),l=!1),ae(w)||(o.push({row:s.sourceRow,field:"price_behavior",message:"Price behavior must be HONOR_BILLING_PRICE or PLAN_PRICE"}),l=!1),fe(O)||(o.push({row:s.sourceRow,field:"notification",message:"Notification must be OPT_OUT or WHEN_REQUIRED"}),l=!1),l&&f&&h&&ae(w)&&fe(O)&&t.push({action:i,shopId:f,targetPlanHandle:h,priceBehavior:w,notification:O})}if(o.length>0)return{ok:!1,errors:o};let r=[...t].sort((s,f)=>s.shopId<f.shopId?-1:s.shopId>f.shopId?1:0),a=ue(i,r);return{ok:!0,plan:{action:i,rows:r,batches:Ae(i,r),canonicalInput:a,inputDigest:ce(a)}}}function Be(i){let e=i?.trim();if(!e)return;let o=ve.test(e)?e:Ce.exec(e)?.[1];if(o===void 0)return;let t=BigInt(o);return t>0?`gid://shopify/Shop/${t}`:void 0}function ae(i){return i!==void 0&&De.has(i)}function fe(i){return Re.has(i)}function ue(i,e){return JSON.stringify({version:1,action:i,rows:e})}function Ae(i,e){let o=[];for(let t=0;t<e.length;t+=se){let n=e.slice(t,t+se),r=ue(i,n);o.push({index:o.length,rows:n,canonicalPayload:r,payloadDigest:ce(r)})}return o}function ce(i){return q(i).toString("hex")}d();d();d();d();d();var c=class i extends Error{constructor(e,o,t,...n){Array.isArray(o)&&(o=o.join(" ").trim()),super(o),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,i),this.code=e;for(let r of n)for(let a in r){let s=r[a];this[a]=Buffer.isBuffer(s)?s.toString(t.encoding):s==null?s:JSON.parse(JSON.stringify(s))}}};d();var M=function(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)};var z=function(i){let e=[];for(let o=0,t=i.length;o<t;o++){let n=i[o];if(n==null||n===!1)e[o]={disabled:!0};else if(typeof n=="string"||typeof n=="number")e[o]={name:`${n}`};else if(M(n)){if(typeof n.name!="string")throw new c("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${o}`,"when column is an object literal"]);e[o]=n}else throw new c("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${o}`])}return e};d();d();var Q=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let o=this.length+e.length;if(o>=this.size&&(this.resize(),o>=this.size))throw Error("INVALID_BUFFER_STATE");let t=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),t.copy(this.buf,e.length),this.length+=e.length}else{let o=this.length++;o===this.size&&this.resize();let t=this.clone();this.buf[0]=e,t.copy(this.buf,1,0,o)}}append(e){let o=this.length++;o===this.size&&this.resize(),this.buf[o]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let o=Buffer.allocUnsafe(this.size);this.buf.copy(o,0,0,e),this.buf=o}toString(e){return e?this.buf.toString(e,0,this.length):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},H=Q;var de=function(i){let e=[32,9,10,13,12,11,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279].reduce((t,n)=>{let r=Buffer.from(String.fromCharCode(n),i.encoding);return n!==63&&r.length===1&&r[0]===63||t.push(r),t},[]),o=new Uint8Array(256);for(let t of e)o[t[0]]=1;return{bomSkipped:!1,bufBytesStart:0,castField:i.cast_function,commenting:!1,delimiterBufPrevious:void 0,delimiterDiscovered:!1,error:void 0,enabled:i.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(i.escape)&&Buffer.isBuffer(i.quote)&&Buffer.compare(i.escape,i.quote)===0,expectedRecordLength:Array.isArray(i.columns)?i.columns.length:void 0,field:new H(20),firstLineToHeaders:i.cast_first_line_to_header,needMoreDataSize:Math.max(i.comment!==null?i.comment.length:0,...i.delimiter?i.delimiter.map(t=>t.length):[],i.delimiter_auto?1:0,i.quote!==null?i.quote.length:0,...e.map(t=>t.length)),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new H(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:i.record_delimiter.length===0?0:Math.max(...i.record_delimiter.map(t=>t.length)),trimChars:[Buffer.from(" ",i.encoding)[0],Buffer.from(" ",i.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:e,timcharFirstBytes:o}};d();d();var me=function(i){return i.replace(/([A-Z])/g,function(e,o){return"_"+o.toLowerCase()})};var T=function(i){let e={};for(let t in i)e[me(t)]=i[t];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new c("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new c("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new c("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(t){let n=Date.parse(t);return isNaN(n)?t:new Date(n)};else if(typeof e.cast_date!="function")throw new c("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=void 0,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=z(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new c("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);if(e.delimiter_auto===void 0||e.delimiter_auto===null||e.delimiter_auto===!1)e.delimiter_auto=!1;else if(e.delimiter_auto===!0)e.delimiter_auto={};else if(!M(e.delimiter_auto))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","delimiter_auto must be a boolean or a configuration object,",`got ${JSON.stringify(e.delimiter_auto)}`],e);if(e.delimiter_auto){if(e.delimiter_auto.preferred===void 0)e.delimiter_auto.preferred={44:1.8,9:1.8,59:1.6,32:1.6,58:1.5,46:1.4,47:1.4};else if(!M(e.delimiter_auto.preferred))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","preferred must be an object,",`got ${JSON.stringify(e.delimiter_auto.preferred)}`],e);if(e.delimiter_auto.score===void 0)e.delimiter_auto.score=(t,n)=>(t.total-t.std)*(n.preferred[t.char_code]||1);else if(typeof e.delimiter_auto.score!="function")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","score must be a function,",`got ${JSON.stringify(e.delimiter_auto.score)}`],e);if(e.delimiter_auto.size===void 0)e.delimiter_auto.size=2048;else if(typeof e.delimiter_auto.size!="number")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","size must be a number,",`got ${JSON.stringify(e.delimiter_auto.size)}`],e)}let o=JSON.stringify(e.delimiter);if(e.delimiter_auto!==!1&&(e.delimiter=[]),Array.isArray(e.delimiter)||((e.delimiter===void 0||e.delimiter===null||e.delimiter===!1)&&(e.delimiter=Buffer.from(",",e.encoding)),e.delimiter=[e.delimiter]),e.delimiter=e.delimiter.map(function(t){if(typeof t=="string"&&(t=Buffer.from(t,e.encoding)),!Buffer.isBuffer(t)||t.length===0)throw new c("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${o}`],e);return t}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(i.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(i.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(i.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new c("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new c("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new c("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(t,n){if(typeof t!="string"&&!Buffer.isBuffer(t))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);if(t.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);return typeof t=="string"&&(t=Buffer.from(t,e.encoding)),t}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&i.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&i.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(e.to!==-1)if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(i.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(i.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(e.to_line!==-1)if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(i.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(i.to_line)}`);return e};d();var _e=function(i,e){e||({delimiter_auto:e}=T({delimiter_auto:!0})),typeof i=="string"&&(i=Buffer.from(i)),Buffer.isBuffer(i)&&(i=(n=>{let r=[],a=j({delimiter:[]}),s=h=>r.push(h),f=()=>{},l=a.parse(n,!0,s,f);if(l!==void 0)throw l;return r})(i));let o=Array(127).fill().map(()=>({lines:[]}));i.map(([n],r)=>{for(let a=0,s=n.length;a<s;a++){let f=n.charCodeAt(a);o[f].lines[r]===void 0&&(o[f].lines[r]=0),o[f].lines[r]++}}),o.map((n,r)=>{n.char_code=r,n.std=Le(n.lines),n.total=n.lines.reduce((a,s)=>a+s,0),n.preferred=!!e.preferred[r],n.score=e.score(n,e)});let t=o.reduce((n,r)=>n.score>r.score?n:r,{});return String.fromCharCode(t.char_code)},Le=function(i){let e=i.length;if(e===0)return 0;let o=i.reduce((t,n)=>t+n)/e;return Math.sqrt(i.map(t=>Math.pow(t-o,2)).reduce((t,n)=>t+n)/e)};var he=function(i){return i.every(e=>e==null||e.toString&&e.toString().trim()==="")},Te=13,$e=10,$={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},j=function(i={}){let e={bytes:0,bytes_records:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},o=T(i);return{info:e,original_options:i,options:o,state:de(o),__needMoreData:function(t,n,r){if(r)return!1;let{encoding:a,escape:s,quote:f}=this.options,{quoting:l,needMoreDataSize:h,recordDelimiterMaxLength:w}=this.state,S=n-t-1,O=Math.max(h,w===0?Buffer.from(`\r
2
+ `,a).length:w,l?(s===null?0:s.length)+f.length:0,l?f.length+w:0);return S<O},parse:function(t,n,r,a){let{bom:s,comment_no_infix:f,delimiter_auto:l,encoding:h,from_line:w,ltrim:S,max_record_size:O,raw:L,relax_quotes:I,rtrim:E,skip_empty_lines:y,to:g,to_line:p}=this.options,{comment:x,escape:C,quote:N,record_delimiter:F}=this.options,{bomSkipped:Se,delimiterDiscovered:Ne,delimiterBufPrevious:V,rawBuffer:Ee,escapeIsQuote:xe}=this.state;if(!Ne&&l){let _;if(V===void 0?_=t:V!==void 0&&t===void 0?_=V:_=Buffer.concat([V,t]),t=void 0,n||_.length>l.size)this.options.delimiter=[Buffer.from(_e(_,this.options.delimiter_auto))],this.state.previousBuf=_,this.state.delimiterBufPrevious=void 0,this.state.delimiterDiscovered=!0;else{this.state.delimiterBufPrevious=_;return}}let{previousBuf:P}=this.state,m;if(P===void 0)if(t===void 0){a();return}else m=t;else P!==void 0&&t===void 0?m=P:m=Buffer.concat([P,t]);if(Se===!1)if(s===!1)this.state.bomSkipped=!0;else if(m.length<3){if(n===!1){this.state.previousBuf=m;return}}else{for(let _ in $)if($[_].compare(m,0,$[_].length)===0){let D=$[_].length;this.state.bufBytesStart+=D,m=m.slice(D);let k=T({...this.original_options,encoding:_});for(let b in k)this.options[b]=k[b];({comment:x,escape:C,quote:N}=this.options);break}this.state.bomSkipped=!0}let U=m.length,u;for(u=0;u<U&&!this.__needMoreData(u,U,n);u++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),p!==-1&&this.info.lines>p){this.state.stop=!0,a();return}this.state.quoting===!1&&F.length===0&&this.__autoDiscoverRecordDelimiter(m,u)&&(F=this.options.record_delimiter);let _=m[u];if(L===!0&&Ee.append(_),(_===Te||_===$e)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(C!==null&&this.state.quoting===!0&&this.__isEscape(m,u,_)&&u+C.length<U)if(xe){if(this.__isQuote(m,u+C.length)){this.state.escaping=!0,u+=C.length-1;continue}}else{this.state.escaping=!0,u+=C.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(m,u))if(this.state.quoting===!0){let b=m[u+N.length],R=E&&this.__isCharTrimable(m,u+N.length),v=x!==null&&this.__compareBytes(x,m,u+N.length,b),B=this.__isDelimiter(m,u+N.length,b),J=F.length===0?this.__autoDiscoverRecordDelimiter(m,u+N.length):this.__isRecordDelimiter(b,m,u+N.length);if(C!==null&&this.__isEscape(m,u,_)&&this.__isQuote(m,u+C.length))u+=C.length-1;else if(!b||B||J||v||R){this.state.quoting=!1,this.state.wasQuoting=!0,u+=N.length-1;continue}else if(I===!1){let W=this.__error(new c("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(b)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(W!==void 0)return W}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(N),u+=N.length-1}else if(this.state.field.length!==0){if(I===!1){let b=this.__infoField(),R=Object.keys($).map(B=>$[B].equals(this.state.field.toString())?B:!1).filter(Boolean)[0],v=this.__error(new c("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(b.column)} at line ${b.lines}, value is ${JSON.stringify(this.state.field.toString(h))}`,R?`(${R} bom)`:void 0],this.options,b,{field:this.state.field}));if(v!==void 0)return v}}else{this.state.quoting=!0,u+=N.length-1;continue}if(this.state.quoting===!1){let b=this.__isRecordDelimiter(_,m,u);if(b!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=w){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),u+=b-1;continue}if(y===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,u+=b-1;continue}this.info.bytes=this.state.bufBytesStart+u;let B=this.__onField();if(B!==void 0)return B;this.info.bytes=this.state.bufBytesStart+u+b;let J=this.__onRecord(r);if(J!==void 0)return J;if(g!==-1&&this.info.records>=g){this.state.stop=!0,a();return}}this.state.commenting=!1,u+=b-1;continue}if(this.state.commenting)continue;if(x!==null&&(f===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(x,m,u,_)!==0){this.state.commenting=!0;continue}let R=this.__isDelimiter(m,u,_);if(R!==0){this.info.bytes=this.state.bufBytesStart+u;let v=this.__onField();if(v!==void 0)return v;u+=R-1;continue}}}if(this.state.commenting===!1&&O!==0&&this.state.record_length+this.state.field.length>O)return this.__error(new c("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${O}`,`at line ${this.info.lines}`],this.options,this.__infoField()));let D=S===!1||this.state.quoting===!0||this.state.field.length!==0||!this.__isCharTrimable(m,u),k=E===!1||this.state.wasQuoting===!1;if(D===!0&&k===!0)this.state.field.append(_);else{if(E===!0&&!this.__isCharTrimable(m,u))return this.__error(new c("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));D===!1&&(u+=this.__isCharTrimable(m,u)-1);continue}}if(n===!0)if(this.state.quoting===!0){let _=this.__error(new c("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(_!==void 0)return _}else if(this.state.wasQuoting===!0||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+u;let _=this.__onField();if(_!==void 0)return _;let D=this.__onRecord(r);if(D!==void 0)return D}else this.state.wasRowDelimiter===!0?this.info.empty_lines++:this.state.commenting===!0&&this.info.comment_lines++;else this.state.bufBytesStart+=u,this.state.previousBuf=m.slice(u);this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(t){let{columns:n,group_columns_by_name:r,encoding:a,info:s,from:f,relax_column_count:l,relax_column_count_less:h,relax_column_count_more:w,raw:S,skip_records_with_empty_values:O}=this.options,{enabled:L,record:I}=this.state;if(L===!1)return this.__resetRecord();let E=I.length;if(n===!0){if(O===!0&&he(I)){this.__resetRecord();return}return this.__firstLineToColumns(I)}if(n===!1&&this.info.records===0&&(this.state.expectedRecordLength=E),E!==this.state.expectedRecordLength){let y=n===!1?new c("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${E} on line ${this.info.lines}`],this.options,this.__infoField(),{record:I}):new c("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${n.length},`,`got ${E} on line ${this.info.lines}`],this.options,this.__infoField(),{record:I});if(l===!0||h===!0&&E<this.state.expectedRecordLength||w===!0&&E>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=y;else{let g=this.__error(y);if(g)return g}}if(O===!0&&he(I)){this.__resetRecord();return}if(this.state.recordHasError===!0){this.__resetRecord(),this.state.recordHasError=!1;return}if(this.info.records++,f===1||this.info.records>=f){let{objname:y}=this.options;if(n!==!1){let g={};for(let p=0,x=I.length;p<x;p++)n[p]===void 0||n[p].disabled||(r===!0&&Object.hasOwn(g,n[p].name)?Array.isArray(g[n[p].name])?g[n[p].name]=g[n[p].name].concat(I[p]):g[n[p].name]=[g[n[p].name],I[p]]:Object.defineProperty(g,n[p].name,{value:I[p],enumerable:!0,writable:!0,configurable:!0}));if(S===!0||s===!0){let p=Object.assign({record:g},S===!0?{raw:this.state.rawBuffer.toString(a)}:{},s===!0?{info:this.__infoRecord()}:{}),x=this.__push(y===void 0?p:[g[y],p],t);if(x)return x}else{let p=this.__push(y===void 0?g:[g[y],g],t);if(p)return p}}else if(S===!0||s===!0){let g=Object.assign({record:I},S===!0?{raw:this.state.rawBuffer.toString(a)}:{},s===!0?{info:this.__infoRecord()}:{}),p=this.__push(y===void 0?g:[I[y],g],t);if(p)return p}else{let g=this.__push(y===void 0?I:[I[y],I],t);if(g)return g}}this.__resetRecord()},__firstLineToColumns:function(t){let{firstLineToHeaders:n}=this.state;try{let r=n===void 0?t:n.call(null,t);if(!Array.isArray(r))return this.__error(new c("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(r)}`],this.options,this.__infoField(),{headers:r}));let a=z(r);this.state.expectedRecordLength=a.length,this.options.columns=a,this.__resetRecord();return}catch(r){return r}},__resetRecord:function(){this.options.raw===!0&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){let{cast:t,encoding:n,rtrim:r,max_record_size:a}=this.options,{enabled:s,wasQuoting:f}=this.state;if(s===!1)return this.__resetField();let l=this.state.field.toString(n);if(r===!0&&f===!1&&(l=l.trimRight()),t===!0){let[h,w]=this.__cast(l);if(h!==void 0)return h;l=w}this.state.record.push(l),a!==0&&typeof l=="string"&&(this.state.record_length+=l.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(t,n){let{on_record:r}=this.options;if(r!==void 0){let a=this.__infoRecord();try{t=r.call(null,t,a)}catch(s){return s}if(t==null)return}this.info.bytes_records+=this.info.bytes,n(t)},__cast:function(t){let{columns:n,relax_column_count:r}=this.options;if(Array.isArray(n)===!0&&r&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(this.state.castField!==null)try{let s=this.__infoField();return[void 0,this.state.castField.call(null,t,s)]}catch(s){return[s]}if(this.__isFloat(t))return[void 0,parseFloat(t)];if(this.options.cast_date!==!1){let s=this.__infoField();return[void 0,this.options.cast_date.call(null,t,s)]}return[void 0,t]},__compareBytes:function(t,n,r,a){if(t[0]!==a)return 0;let s=t.length;for(let f=1;f<s;f++)if(t[f]!==n[r+f])return 0;return s},__isCharTrimable:function(t,n){let{timchars:r,timcharFirstBytes:a}=this.state,s=t[n];if(s===void 0||a[s]===0)return 0;e:for(let f=0;f<r.length;f++){let l=r[f];for(let h=0;h<l.length;h++)if(l[h]!==t[n+h])continue e;return l.length}return 0},__isDelimiter:function(t,n,r){let{delimiter:a,ignore_last_delimiters:s}=this.options;if(s===!0&&this.state.record.length===this.options.columns.length-1)return 0;if(s!==!1&&typeof s=="number"&&this.state.record.length===s-1)return 0;e:for(let f=0;f<a.length;f++){let l=a[f];if(l[0]===r){for(let h=1;h<l.length;h++)if(l[h]!==t[n+h])continue e;return l.length}}return 0},__isEscape:function(t,n,r){let{escape:a}=this.options;if(a===null)return!1;let s=a.length;if(a[0]===r){for(let f=0;f<s;f++)if(a[f]!==t[n+f])return!1;return!0}return!1},__isFloat:function(t){return t-parseFloat(t)+1>=0},__isQuote:function(t,n){let{quote:r}=this.options;if(r===null)return!1;let a=r.length;for(let s=0;s<a;s++)if(r[s]!==t[n+s])return!1;return!0},__isRecordDelimiter:function(t,n,r){let{record_delimiter:a}=this.options,s=a.length;e:for(let f=0;f<s;f++){let l=a[f],h=l.length;if(l[0]===t){for(let w=1;w<h;w++)if(l[w]!==n[r+w])continue e;return l.length}}return 0},__autoDiscoverRecordDelimiter:function(t,n){let{encoding:r}=this.options,a=[Buffer.from(`\r
3
+ `,r),Buffer.from(`
4
+ `,r),Buffer.from("\r",r)];e:for(let s=0;s<a.length;s++){let f=a[s].length;for(let l=0;l<f;l++)if(a[s][l]!==t[n+l])continue e;return this.options.record_delimiter.push(a[s]),this.state.recordDelimiterMaxLength=a[s].length,a[s].length}return 0},__error:function(t){let{encoding:n,raw:r,skip_records_with_error:a}=this.options,s=typeof t=="string"?new Error(t):t;if(a){if(this.state.recordHasError=!0,this.options.on_skip!==void 0)try{this.options.on_skip(s,r?this.state.rawBuffer.toString(n):void 0)}catch(f){return f}return}else return s},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:t,raw:n,encoding:r}=this.options;return{...this.__infoDataSet(),bytes_records:this.info.bytes,error:this.state.error,header:t===!0,index:this.state.record.length,raw:n?this.state.rawBuffer.toString(r):void 0}},__infoField:function(){let{columns:t}=this.options,n=Array.isArray(t),r=this.info.bytes_records;return{...this.__infoRecord(),bytes_records:r,column:n===!0?t.length>this.state.record.length?t[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}};var pe=function(i,e={}){typeof i=="string"&&(i=Buffer.from(i));let o=e&&e.objname?Object.create(null):[],t=j(e),n=s=>{t.options.objname===void 0?o.push(s):o[s[0]]=s[1]},r=()=>{},a=t.parse(i,!0,n,r);if(a!==void 0)throw a;return o};var Me=["shop_id","target_plan_handle","price_behavior","notification"],Ve={schedule:["shop_id","target_plan_handle","price_behavior"],unschedule:["shop_id"]};function ge(i,e){if(i.trim()==="")return{ok:!1,errors:[{message:"The CSV is empty"}]};let o=[],t;try{t=pe(i,{bom:!0,columns:r=>(o=r,r),info:!0,skip_empty_lines:!0,trim:!0})}catch(r){if(!(r instanceof c))throw r;return{ok:!1,errors:[{message:`Invalid CSV: ${r.message}`}]}}let n=Pe(o,e);return n.length>0?{ok:!1,errors:n}:t.length===0?{ok:!1,errors:[{message:"The CSV must contain at least one data row"}]}:{ok:!0,rows:t.map(({record:r,info:a})=>ke(r,a.lines,e))}}function Pe(i,e){let o=[],t=new Set(Me),n=new Set;for(let r of i)n.has(r)?o.push({field:r,message:`Duplicate CSV header: ${r}`}):n.add(r),t.has(r)||o.push({field:r,message:`Unknown CSV header: ${r}`});for(let r of Ve[e])i.includes(r)||o.push({field:r,message:`Missing required CSV header: ${r}`});return o}function ke(i,e,o){return o==="unschedule"?{sourceRow:e,shopId:i.shop_id}:{sourceRow:e,shopId:i.shop_id,...i.target_plan_handle===void 0?{}:{targetPlanHandle:i.target_plan_handle},...i.price_behavior===void 0?{}:{priceBehavior:i.price_behavior},...i.notification===void 0?{}:{notification:i.notification}}}d();var be={fileExists:Z,readFile:Y,readStdin:te};async function G(i,e=be){let o={...be,...e};if(i!=="-"){if(!await o.fileExists(i))throw new A(`CSV file not found: ${i}`);try{return await o.readFile(i)}catch(n){if(n instanceof A)throw n;let r=n instanceof Error?n.message:String(n);throw new A(`Couldn't read CSV file ${i}: ${r}`)}}let t=await o.readStdin();if(t===void 0||t==="")throw new A("Provide --input <path> or pipe CSV data to stdin.");return t}async function we(i,e,o){let t=o?await G(e,o):await G(e),n=ge(t,i);return n.ok?le(i,n.rows):n}d();d();var Je="shopify-subscription-migration:v1";function Ie(){return X()}function ye({appIdentifier:i,action:e,invocationId:o,canonicalBatchPayload:t}){let n=JSON.stringify({namespace:Je,appIdentifier:i,action:e,invocationId:o,canonicalBatchPayload:t});return q(n).toString("hex")}var K=class extends Error{batchIndex;constructor(e){super(`Migration submission batch ${e} returned neither an operation nor user errors`),this.name="MigrationSubmissionProtocolError",this.batchIndex=e}};async function Oe({clientId:i,plan:e,invocationId:o=Ie(),createOperation:t=re}){let n={clientId:i,action:e.action,inputDigest:e.inputDigest,total:e.rows.length,operations:[]};for(let r of e.batches){let a=ye({appIdentifier:i,action:e.action,invocationId:o,canonicalBatchPayload:r.canonicalPayload}),s;try{s=await t({clientId:i,idempotencyKey:a,migrations:r.rows.map(qe)})}catch(f){if(n.operations.length===0)throw f;return{status:"failed",submission:n,failure:{type:"submission",batchIndex:r.index,userErrors:[{message:f instanceof Error?f.message:"Migration request failed.",field:null}]}}}if(s.operation&&n.operations.push({batchIndex:r.index,batchPayloadDigest:r.payloadDigest,operation:s.operation}),s.userErrors.length>0)return{status:"failed",submission:n,failure:{type:"submission",batchIndex:r.index,userErrors:s.userErrors}};if(!s.operation)throw new K(r.index)}return{status:"success",submission:n}}function qe(i){return i.action==="unschedule"?{shopId:i.shopId,action:{cancelMigration:!0}}:{shopId:i.shopId,action:{scheduleMigration:ze(i)}}}function ze({targetPlanHandle:i,priceBehavior:e,notification:o}){return{targetPlanHandle:i,priceBehavior:e,notification:o}}async function ii(i){let e=await we(i.action,i.input);if(!e.ok)throw new A(Fe(e.errors));if(!i.skipConfirmation&&!await ee({message:`${i.action==="schedule"?"Schedule":"Unschedule"} ${e.plan.rows.length} subscriptions?`}))return{status:"cancelled",changed:!1,action:i.action,reason:"Confirmation declined."};let o=await Oe({clientId:i.clientId,plan:e.plan});if(o.status==="failed"||!i.watch)return o;i.onSubmissionAccepted?.(o.submission);let t=await oe({clientId:i.clientId,operationIds:o.submission.operations.map(({operation:a})=>a.id)}),n=je(o.submission,t),r=n.operations.filter(({operation:a})=>a.status==="FAILED").map(({operation:a})=>a.id);return r.length===0?{status:"success",submission:n}:{status:"failed",submission:n,failure:{type:"operations",operationIds:r}}}function je(i,e){let o=new Map(e.map(t=>[t.id,t]));return{...i,operations:i.operations.map(t=>({...t,operation:o.get(t.operation.id)??t.operation}))}}function Fe(i){return i.map(e=>{let o=[e.row===void 0?void 0:`row ${e.row}`,e.field].filter(t=>t!==void 0).join(", ");return o?`${o}: ${e.message}`:e.message}).join(`
5
+ `)}export{ii as a};
@@ -0,0 +1,3 @@
1
+ import{c as b,i as u,n as w,p as _}from"./chunk-NDKSG4CC.js";import{a as h}from"./chunk-ZGV3HNEV.js";import{Ma as g}from"./chunk-3C6VLJ5D.js";import{c as d}from"./chunk-Q2SZCZE7.js";import{h as m}from"./chunk-2VSNFOKD.js";import{wb as s}from"./chunk-LWCTKI4Z.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();r();var j=250,c=class extends Error{constructor(){super("Migratable subscriptions were not found"),this.name="MigratableSubscriptionsNotFoundError"}},l=class extends Error{constructor(t){super(t),this.name="MigrationListProtocolError"}};async function*S({clientId:i,status:t,getPage:o=_}){let e=new Set,a;for(;;){let p=await o({clientId:i,first:j,after:a,status:t});if(p===null)throw new c;if(yield p.subscriptions,!p.pageInfo.hasNextPage)return;let{endCursor:n}=p.pageInfo;if(n===null||n.trim()==="")throw new l("Migratable subscription page has no cursor for its next page");if(e.has(n))throw new l(`Migratable subscription pagination repeated cursor: ${n}`);e.add(n),a=n}}r();var v="shop_id,status,manual_subscription_name,manual_subscription_price_amount,manual_subscription_price_currency_code,manual_subscription_interval,target_plan_handle,notification_kind,notification_opt_out_deadline,notification_sent_at,price_behavior,effective_date,last_failure_reason";function C(i){return u.encode({subscriptions:i.map(w)})}async function y({pages:i,json:t}){t?s(C(await x(i))):await E(i)}async function x(i){let t=[];for await(let o of i)t.push(...o);return t}async function E(i){let t=!1;for await(let o of i){let e=M(o);t?e.length>0&&s(e.join(`
2
+ `)):(s([v,...e].join(`
3
+ `)),t=!0)}t||s(v)}function M(i){return i.map(t=>[t.shopId,t.status,t.manualSubscriptionName,t.manualSubscriptionPrice?.amount,t.manualSubscriptionPrice?.currencyCode,t.manualSubscriptionInterval,t.targetPlanHandle,t.notification?.kind,t.notification?.optOutDeadline,t.notification?.sentAt,t.priceBehavior,t.effectiveDate,t.lastFailureReason].map(L).join(","))}function L(i){let t=i??"";return/[",\r\n]/.test(t)?`"${t.replaceAll('"','""')}"`:t}var f=class i extends h{static summary="Lists app subscriptions eligible for migration.";static descriptionWithMarkdown="Lists every app subscription eligible for migration.\n\nBy default, the command writes CSV to stdout, streaming each page of results as it arrives. If a later page fails, the rows already written remain valid CSV. Use `--json` to fetch all pages first and then write a single JSON envelope to stdout. Use shell redirection to save either format, for example `shopify app subscription-migrations list > subscriptions.csv` or `shopify app subscription-migrations list --json > subscriptions.json`.\n\nUse `--status` to filter subscriptions by migration status. Supported values are `UNSCHEDULED`, `SCHEDULED`, and `MIGRATED`.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --status SCHEDULED > scheduled-subscriptions.csv","<%= config.bin %> <%= command.id %> --json","<%= config.bin %> <%= command.id %> --json > subscriptions.json","<%= config.bin %> <%= command.id %> --client-id <client-id> > subscriptions.csv"];static flags={...b,...d};static get jsonOutputSchema(){return u}async run(){let{flags:t}=await this.parse(i),{app:o,remoteApp:e}=await g({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});try{let a=S({clientId:e.apiKey,status:t.status});await y({pages:a,json:t.json})}catch(a){throw a instanceof c?new m("App not found"):a}return{app:o}}};export{f as a};
@@ -0,0 +1,17 @@
1
+ import{a as _,j as B,n as $}from"./chunk-LVLAOBJM.js";import{e as U,f as C}from"./chunk-DNMXVMJM.js";import{e as y}from"./chunk-PSSYLJG4.js";import{l as v,m as P}from"./chunk-5TB52UUV.js";import{xa as E}from"./chunk-H4V55Y3Z.js";import{Bb as m}from"./chunk-LWCTKI4Z.js";import{g as T}from"./chunk-VKWPEFWQ.js";T();var w=20,L=1024*1024,A=2;function re(t,e,r,s,o={},l){let n=_(r),i=new Map,c=!1,u=a=>{c||=a.success,i.set(a.key,a)},g=a=>a.total===0?"[100%]":`[${Math.round(a.current/a.total*100)}%]`,h=S(t,e,n).then(a=>{a.forEach(u)}),p=Promise.all([s.ready(),h]).then(()=>I(n,s,t,e,u)),d=p.then(a=>a.promise).then(()=>x(n,s,t,e,o,u)),f=o?.deferPartialWork?h:d.then(a=>a.promise);return o?.backgroundWorkCatch&&Promise.all([h,p.then(a=>a.promise),d.then(a=>a.promise)]).catch(o.backgroundWorkCatch),{uploadResults:i,get hasChanges(){return c},workPromise:f,renderThemeSyncProgress:async()=>{if(o?.deferPartialWork)return;let{progress:a,promise:F}=await p,k=o.multiEnvironment?4e3:1e3;await y(b({promise:F,titleGetter:()=>`Uploading files to remote theme ${g(a)}`,updateInterval:k}),l?.stderr,o?.multiEnvironment);let{progress:J,promise:j}=await d;await y(b({promise:j,titleGetter:()=>`Cleaning your remote theme ${g(J)}`,updateInterval:k}),l?.stderr,o?.multiEnvironment),await y([{title:"Theme upload complete",task:async()=>{}}],l?.stderr,o?.multiEnvironment),G(i,o?.environment)}}}function b({promise:t,titleGetter:e,updateInterval:r}){let s=[],o=()=>{s.push({title:e(),task:async(l,n)=>{await Promise.race([t,new Promise(c=>setTimeout(()=>c("timeout"),r))])==="timeout"?o():n.title=e()}})};return o(),s}function x(t,e,r,s,o,l){if(o.nodelete)return{progress:{current:0,total:0},promise:Promise.resolve()};let n=R(t,e),i=D(n),c={current:0,total:i.length};if(i.length===0)return{progress:c,promise:Promise.resolve()};let u=[];for(let h=0;h<i.length;h+=w){let p=i.slice(h,h+w),d=v(r.id,p.map(f=>f.key),s).then(f=>{f.forEach(a=>{if(l(a),!a.success){let F=a.errors?.asset?.map(k=>`-${k}`).join(`
2
+ `);C(a.key,"delete")(new Error(`Failed to delete ${a.key}: ${F}`))}}),c.current+=p.length});u.push(d)}let g=Promise.all(u).then(()=>{c.current=c.total});return{progress:c,promise:g}}function R(t,e){let s=e.applyIgnoreFilters(t).filter(o=>!e.files.has(o.key));return m(`Files to be deleted:
3
+ ${s.map(o=>`-${o.key}`).join(`
4
+ `)}`),s}function D(t){let e=$(t);return[...e.contextualizedJsonFiles,...e.templateJsonFiles,...e.sectionJsonFiles,...e.otherJsonFiles,...e.sectionLiquidFiles,...e.blockLiquidFiles,...e.layoutFiles,...e.otherLiquidFiles,...e.configDataFile,...e.configStylesheetFiles,...e.documentationFiles,...e.configSchemaFile,...e.staticAssetFiles]}var q=[{key:"config/settings_schema.json",value:"[]"},{key:"layout/password.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"},{key:"layout/theme.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"}];async function S(t,e,r){let s=new Set(r.map(l=>l.key)),o=q.filter(({key:l})=>!s.has(l));return o.length>0?P(t.id,o,e):[]}function I(t,e,r,s,o){let l=z(e,t);e.unsyncedFileKeys.clear(),l.forEach(d=>e.unsyncedFileKeys.add(d.key));let{independentFiles:n,dependentFiles:i}=K(l),c={current:0,total:l.length},u=d=>d.length===0?Promise.resolve():Promise.all(N(d).map(f=>H(f,e,s,r.id,o).then(()=>{c.current+=f.length,f.forEach(a=>e.unsyncedFileKeys.delete(a.key))}))).then(()=>{}),g=i.reduce((d,f)=>d.then(()=>u(f)),Promise.resolve()),h=Promise.resolve().then(()=>u(n.flat())),p=Promise.all([g,h]).then(()=>{c.current=c.total});return{progress:c,promise:p}}function z(t,e){let r=W(t),s=t.applyIgnoreFilters(r),o=new Map(e.map(n=>[n.key,n])),l=s.filter(n=>{let i=o.get(n.key);return!i||i.checksum!==n.checksum});return m(`Files to be uploaded:
5
+ ${l.map(n=>`-${n.key}`).join(`
6
+ `)}`),l}function K(t){let e=$(t);return{independentFiles:[e.otherLiquidFiles,e.otherJsonFiles,e.staticAssetFiles,e.configStylesheetFiles,e.documentationFiles],dependentFiles:[e.configSchemaFile,e.layoutFiles,e.blockLiquidFiles,e.sectionLiquidFiles,e.sectionJsonFiles,e.templateJsonFiles,e.contextualizedJsonFiles,e.configDataFile]}}function N(t){let e=[],r=[],s=0;for(let o of t){let l=r.length>=w,n=s>=L;(l||n)&&(e.push(r),r=[],s=0),r.push(o),s+=o.size??0}return r.length>0&&e.push(r),e}function W(t){let e=[];return t.files.forEach((r,s)=>{let o=r.value?Buffer.byteLength(r.value,"utf8"):r.attachment?.length??0;e.push({key:s,checksum:r.checksum,size:o})}),e}async function H(t,e,r,s,o){let l=t.map(i=>{let c=e.files.get(i.key)?.value,u=e.files.get(i.key)?.attachment;return{key:i.key,...c&&{value:c},...u&&{attachment:u}}});m(`Uploading the following files:
7
+ ${t.map(i=>`-${i.key}`).join(`
8
+ `)}`),(await M(l,s,r)).forEach(i=>{o(i),O(i,e,s)})}function O(t,e,r){if(t.success)e.uploadErrors.delete(t.key);else{let s=t.errors?.asset??["Response was not successful."];e.uploadErrors.set(t.key,s),B(r,t.key)}}async function M(t,e,r,s=0){if(t.length===0)return[];s>0&&m(`Retry Attempt ${s}/${A} for the following files:
9
+ ${t.map(n=>`-${n.key}`).join(`
10
+ `)}`);let o=await P(e,t,r);m(`File Upload Results:
11
+ ${o.map(n=>`-${n.key}: ${n.success?"success":"failure"}`).join(`
12
+ `)}`);let l=o.filter(n=>!n.success);if(l.length>0){m(`The following files failed to upload:
13
+ ${l.map(i=>`-${i.key}`).join(`
14
+ `)}`);let n=await X(l,t,e,r,s);return o.concat(n)}return o}async function X(t,e,r,s,o){let l=new Set(t.map(i=>i.key)),n=e.filter(i=>l.has(i.key));return o===A?(E("theme-service:upload-failed-retry:max-retry"),m(`Max retry count reached for the following files:
15
+ ${n.map(i=>`-${i.key}`).join(`
16
+ `)}`),t):(E(`theme-service:upload-failed-retry:${n.length}`),M(n,r,s,o+1))}function G(t,e){for(let[r,s]of t.entries())if(!s.success){let o=s.errors?.asset?.join(`
17
+ `)??"File upload failed",l=e?`[${e}] ${r}`:r;U(l,new Error(o))}}export{re as a};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-C6HGU77I.js";import{b as e}from"./chunk-DCKRQZLE.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static description="View the UI kit components prompts";static hidden=!0;async run(){await i()}};export{t as a};
1
+ import{a as i}from"./chunk-7MVWDCI3.js";import{b as e}from"./chunk-ZQDDRIBA.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static description="View the UI kit components prompts";static hidden=!0;async run(){await i()}};export{t as a};
@@ -0,0 +1 @@
1
+ import{a as j}from"./chunk-ZGV3HNEV.js";import{a as C}from"./chunk-FWB3GLMW.js";import{Ma as O,ja as N}from"./chunk-3C6VLJ5D.js";import{b as R,c as k}from"./chunk-Q2SZCZE7.js";import{H as w}from"./chunk-CZ22VZDA.js";import{a as y}from"./chunk-BN7ZXAZJ.js";import{h as S}from"./chunk-2VSNFOKD.js";import{Hb as b,ba as v,qb as x,sb as E,wb as I,yb as f}from"./chunk-LWCTKI4Z.js";import{i as T}from"./chunk-B4OMIONW.js";import{b as o}from"./chunk-FZCGRIOM.js";import{i as L}from"./chunk-IWTNUJGY.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();r();var B=o.object({createdAt:o.string(),createdBy:o.string(),versionTag:o.string().nullable().optional(),status:o.string(),versionId:o.string(),message:o.string()}),u=y({name:"AppVersionsListResult",schema:o.array(B),definitions:{AppVersion:B}});r();async function M(i,t){let n=await i.appVersions(t);if(!n.app)throw new S(`Shopify did not return app information for API key ${t.apiKey}.`);return{appVersions:n.app.appVersions.nodes.map(e=>({createdAt:v(new Date(e.createdAt)),createdBy:e.createdBy?.displayName??"",versionTag:e.versionTag,status:e.status,versionId:e.versionId,message:e.message??""})),totalResults:n.app.appVersions.pageInfo.totalResults}}r();var $=12;async function D({app:i,appVersions:t,totalResults:n,remoteApp:e,organization:p,developerPlatformClient:m},d){if(d==="json"){I(u.encode(t));return}if(N({org:p.businessName,appName:e.title,configFile:L(i.configPath)}),t.length===0){f("No app versions found for this app");return}let g=t.map(({versionId:s,...a})=>({...a,status:a.status==="active"?T.green(`\u2605 ${a.status}`):a.status})),l=(process.stdout.columns??75)-$,c=l;g.forEach(s=>{let a=s.message.length+(s.versionTag?.length??0)+b(s.status).length+s.createdAt.length+s.createdBy.length;if(a>l){let J=a-s.message.length,A=Math.max(l-J,10);A<c&&(c=A)}}),g.forEach(s=>{s.message.length>c&&(s.message=`${s.message.slice(0,c-3)}...`)}),w({rows:g,columns:{versionTag:{header:"VERSION"},status:{header:"STATUS"},message:{header:"MESSAGE"},createdAt:{header:"DATE CREATED"},createdBy:{header:"CREATED BY"}}});let F=x.link(m.webUiName,[await m.appDeepLink(e),"versions"].join("/"));f(E`\nView all ${String(n)} app versions in the ${F}`)}var h=class i extends j{static summary="List deployed versions of your app.";static descriptionWithMarkdown="Lists the deployed app versions. An app version is a snapshot of your app extensions.";static get jsonOutputSchema(){return u}static description=this.descriptionForHelp();static flags={...R,...C,...k};async run(){let{flags:t}=await this.parse(i),{app:n,remoteApp:e,developerPlatformClient:p,organization:m}=await O({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),d=await M(p,e);return await D({app:n,remoteApp:e,organization:m,developerPlatformClient:p,...d},t.json?"json":"text"),{app:n}}};export{h as a};
@@ -1,4 +1,4 @@
1
- import{a as Cn}from"./chunk-AAK376RT.js";import{a as Du}from"./chunk-P2OI2P2M.js";import{a as Ys}from"./chunk-636CTEW7.js";import{a as Ks,c as Xs,d as Ti,g as ju,k as Di,l as Ve,m as Lu,n as Au,o as xu,p as Su,q as qu,r as Fu,s as Ru,t as Nu,u as Tu}from"./chunk-TR4OWSEX.js";import{b as Cu,c as kt}from"./chunk-ZGASBRSQ.js";import{b as Pu}from"./chunk-I5A6BPCP.js";import{a as Ou}from"./chunk-CX5CC6P5.js";import{a as Iu}from"./chunk-IGE4Y5SE.js";import{a as $,c as m,e as W,g as u}from"./chunk-VKWPEFWQ.js";var N=m(V=>{"use strict";u();Object.defineProperty(V,"__esModule",{value:!0});V.pickBy=ku;V.compact=Mu;V.uniqBy=Hu;V.last=Bu;V.sortBy=Uu;V.castArray=Wu;V.isProd=Vu;V.maxBy=Gu;V.sumBy=zu;V.capitalize=Ju;V.isTruthy=Ku;V.isNotFalsy=Xu;V.uniq=Yu;V.mapValues=Zu;V.mergeNestedObjects=ed;function ku(n,e){return Object.entries(n).reduce((t,[i,r])=>(e(r)&&(t[i]=r),t),{})}function Mu(n){return n.filter(e=>!!e)}function Hu(n,e){return n.filter((t,i)=>{let r=e(t);return!n.some((s,o)=>o>i&&e(s)===r)})}function Bu(n){if(n)return n.at(-1)}function ki(n,e){if(n=n===void 0?0:n,e=e===void 0?0:e,Array.isArray(n)&&Array.isArray(e)){if(n.length===0&&e.length===0)return 0;let t=ki(n[0],e[0]);return t!==0?t:ki(n.slice(1),e.slice(1))}return n<e?-1:n>e?1:0}function Uu(n,e){return n.sort((t,i)=>ki(e(t),e(i)))}function Wu(n){return n===void 0?[]:Array.isArray(n)?n:[n]}function Vu(){return!["development","test"].includes(process.env.NODE_ENV??"")}function Gu(n,e){if(n.length!==0)return n.reduce((t,i)=>{let r=e(i),s=e(t);return r>s?i:t})}function zu(n,e){return n.reduce((t,i)=>t+e(i),0)}function Ju(n){return n?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():""}function Ku(n){return["1","true","y","yes"].includes(n.toLowerCase())}function Xu(n){return!["0","false","n","no"].includes(n.toLowerCase())}function Yu(n){return[...new Set(n)].sort()}function Zu(n,e){return Object.entries(n).reduce((t,[i,r])=>(t[i]=e(r,i),t),{})}function Qu(n,e){return e.split(".").reduce((t,i)=>t?.[i],n)}function ed(n,e){return Object.fromEntries(n.flatMap(t=>Object.entries(Qu(t,e)??{})).reverse())}});var we=m(Ce=>{"use strict";u();Object.defineProperty(Ce,"__esModule",{value:!0});Ce.fileExists=Ce.dirExists=void 0;Ce.readJson=Zs;Ce.safeReadJson=sd;Ce.existsSync=od;var td=$("node:fs"),Bi=$("node:fs/promises"),nd=N(),id=async n=>{let e;try{e=await(0,Bi.stat)(n)}catch{throw new Error(`No directory found at ${n}`)}if(!e.isDirectory())throw new Error(`${n} exists but is not a directory`);return n};Ce.dirExists=id;var rd=async n=>{let e;try{e=await(0,Bi.stat)(n)}catch{throw new Error(`No file found at ${n}`)}if(!e.isFile())throw new Error(`${n} exists but is not a file`);return n};Ce.fileExists=rd;var Hi=class extends Map{set(e,t){return((0,nd.isProd)()??!1)&&super.set(e,t),this}},Mi=new Hi;async function Zs(n,e=!0){if(e&&Mi.has(n))return JSON.parse(Mi.get(n));let t=await(0,Bi.readFile)(n,"utf8");return Mi.set(n,t),JSON.parse(t)}async function sd(n,e=!0){try{return await Zs(n,e)}catch{}}function od(n){return(0,td.existsSync)(n)}});var eo=m(X=>{"use strict";u();Object.defineProperty(X,"__esModule",{value:!0});X.string=X.url=X.file=X.directory=X.integer=X.boolean=void 0;X.custom=Ge;var ad=$("node:url"),Qs=we(),cd=N();function Ge(n){return(e={})=>({parse:async(t,i,r)=>t,...n,...e,input:[],type:"option"})}X.boolean=Ge({parse:async n=>!!n&&(0,cd.isNotFalsy)(n)});X.integer=Ge({async parse(n,e,t){if(!/^-?\d+$/.test(n))throw new Error(`Expected an integer but received: ${n}`);let i=Number.parseInt(n,10);if(t.min!==void 0&&i<t.min)throw new Error(`Expected an integer greater than or equal to ${t.min} but received: ${n}`);if(t.max!==void 0&&i>t.max)throw new Error(`Expected an integer less than or equal to ${t.max} but received: ${n}`);return i}});X.directory=Ge({async parse(n,e,t){return t.exists?(0,Qs.dirExists)(n):n}});X.file=Ge({async parse(n,e,t){return t.exists?(0,Qs.fileExists)(n):n}});X.url=Ge({async parse(n){try{return new ad.URL(n)}catch{throw new Error(`Expected a valid url but received: ${n}`)}}});var ld=Ge({});X.string=ld});var to=m((Db,ud)=>{ud.exports={name:"@oclif/core",description:"base library for oclif CLIs",version:"4.11.14",author:"Salesforce",bugs:"https://github.com/oclif/core/issues",dependencies:{"ansi-escapes":"^4.3.2",ansis:"^3.17.0","clean-stack":"^3.0.1","cli-spinners":"^2.9.2",debug:"^4.4.3",ejs:"^3.1.10","get-package-type":"^0.1.0","indent-string":"^4.0.0","is-wsl":"^2.2.0",lilconfig:"^3.1.3",minimatch:"^10.2.5",semver:"^7.8.1","string-width":"^4.2.3","supports-color":"^8",tinyglobby:"^0.2.17","widest-line":"^3.1.0",wordwrap:"^1.0.0","wrap-ansi":"^7.0.0"},devDependencies:{"@commitlint/config-conventional":"^19","@eslint/compat":"^1.4.1","@oclif/plugin-help":"^6","@oclif/plugin-plugins":"^5","@oclif/prettier-config":"^0.2.1","@oclif/test":"^4","@types/benchmark":"^2.1.5","@types/chai":"^4.3.16","@types/chai-as-promised":"^7.1.8","@types/clean-stack":"^2.1.1","@types/debug":"^4.1.13","@types/ejs":"^3.1.5","@types/indent-string":"^4.0.1","@types/mocha":"^10.0.10","@types/node":"^18","@types/picomatch":"^4.0.3","@types/pnpapi":"^0.0.5","@types/sinon":"^17.0.3","@types/supports-color":"^8.1.3","@types/wordwrap":"^1.0.3","@types/wrap-ansi":"^3.0.0",benchmark:"^2.1.4",chai:"^4.5.0","chai-as-promised":"^7.1.2",commitlint:"^19","cross-env":"^7.0.3",eslint:"^9","eslint-config-oclif":"^6","eslint-config-prettier":"^10",husky:"^9.1.7","lint-staged":"^15",madge:"^6.1.0",mocha:"^11.7.5",nyc:"^15.1.0",prettier:"^3.8.3",shx:"^0.4.0",sinon:"^18","ts-node":"^10.9.2",tsd:"^0.33.0",typescript:"^5"},engines:{node:">=18.0.0"},files:["/lib"],homepage:"https://github.com/oclif/core",keywords:["oclif","cli","command","command line","parser","args","argv"],license:"MIT",exports:{".":"./lib/index.js","./args":"./lib/args.js","./command":"./lib/command.js","./config":"./lib/config/index.js","./errors":"./lib/errors/index.js","./execute":"./lib/execute.js","./flags":"./lib/flags.js","./flush":"./lib/flush.js","./handle":"./lib/errors/handle.js","./help":"./lib/help/index.js","./hooks":"./lib/interfaces/hooks.js","./interfaces":"./lib/interfaces/index.js","./logger":"./lib/logger.js","./package.json":"./package.json","./parser":"./lib/parser/index.js","./performance":"./lib/performance.js","./run":"./lib/main.js","./settings":"./lib/settings.js","./util/ids":"./lib/util/ids.js","./ux":"./lib/ux/index.js"},repository:"oclif/core",oclif:{bin:"oclif",devPlugins:["@oclif/plugin-help","@oclif/plugin-plugins"]},publishConfig:{access:"public"},scripts:{build:"shx rm -rf lib && tsc",compile:"tsc",format:'prettier --write "+(src|test)/**/*.+(ts|js|json)"',lint:"eslint",posttest:"yarn lint && yarn test:circular-deps",prepack:"yarn run build",prepare:"husky","test:circular-deps":"yarn build && madge lib/ -c","test:debug":'nyc mocha --debug-brk --inspect "test/**/*.test.ts"',"test:integration":'mocha --forbid-only "test/**/*.integration.ts" --parallel --timeout 1200000',"test:interoperability":"cross-env DEBUG=integration:* ts-node test/integration/interop.ts","test:perf":"ts-node test/perf/parser.perf.ts",test:'nyc mocha --forbid-only "test/**/*.test.ts" --parallel'},types:"lib/index.d.ts"}});var fe=m(Wi=>{"use strict";u();Object.defineProperty(Wi,"__esModule",{value:!0});var dd=$("node:fs"),fd=$("node:path"),Ui=class n extends Map{static instance;constructor(){super(),this.set("@oclif/core",this.getOclifCoreMeta())}static getInstance(){return n.instance||(n.instance=new n),n.instance}get(e){return super.get(e)}getOclifCoreMeta(){try{return{name:"@oclif/core",version:to().version}}catch{try{return{name:"@oclif/core",version:JSON.parse((0,dd.readFileSync)((0,fd.join)(__dirname,"..","package.json"),"utf8")).version}}catch{return{name:"@oclif/core",version:"unknown"}}}}};Wi.default=Ui});var Q=m(Ne=>{"use strict";u();var hd=Ne&&Ne.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.getLogger=no;Ne.makeDebug=md;Ne.setLogger=yd;Ne.clearLoggers=_d;var pd=hd(kt()),Gi="oclif";function jn(n=Gi){let e=(0,pd.default)(n);return{child:(t,i)=>jn(`${n}${i??":"}${t}`),debug:e,error:(t,...i)=>jn(`${n}:error`).debug(t,...i),info:e,namespace:n,trace:e,warn:e}}var je=new Map;function no(n){let e=je.get("root");if(e||Vi(jn(Gi)),e=je.get("root"),n){let t=je.get(n);if(t)return t;let i=e.child(n);return je.set(n,i),i}return e}function gd(n){return typeof n.child=="function"&&typeof n.debug=="function"&&typeof n.error=="function"&&typeof n.info=="function"&&typeof n.trace=="function"&&typeof n.warn=="function"&&typeof n.namespace=="string"}function Vi(n){je.has(n.namespace)||je.has("root")||(gd(n)?(je.set(n.namespace,n),je.set("root",n)):process.emitWarning("Logger does not match the Logger interface. Using default logger."))}function md(n){return(e,...t)=>no(n).debug(e,...t)}function yd(n){n&&typeof n!="string"&&"logger"in n&&n.logger?Vi(n.logger):Vi(jn(Gi))}function _d(){je.clear()}});var Mt=m(dt=>{"use strict";u();Object.defineProperty(dt,"__esModule",{value:!0});dt.stderr=dt.stdout=void 0;var ut=$("node:util"),wd=(n,...e)=>{!n&&e?console.log((0,ut.format)(...e)):n?console.log(typeof n=="string"?(0,ut.format)(n,...e):(0,ut.format)(...n,...e)):console.log()};dt.stdout=wd;var bd=(n,...e)=>{!n&&e?console.error((0,ut.format)(...e)):n?console.error(typeof n=="string"?(0,ut.format)(n,...e):(0,ut.format)(...n,...e)):console.error()};dt.stderr=bd});var Ie=m(In=>{"use strict";u();Object.defineProperty(In,"__esModule",{value:!0});In.settings=void 0;globalThis.oclif||(globalThis.oclif={});In.settings=globalThis.oclif});var ht=m(ft=>{"use strict";u();Object.defineProperty(ft,"__esModule",{value:!0});ft.errtermwidth=ft.stdtermwidth=void 0;var vd=Ie();function io(n){if(!n.isTTY)return 80;let e=n.getWindowSize()[0];return e<1?80:e<40?40:e}var ro=Number.parseInt(process.env.OCLIF_COLUMNS,10)||vd.settings.columns;ft.stdtermwidth=ro||io(process.stdout);ft.errtermwidth=ro||io(process.stderr)});var so=m(Ln=>{"use strict";u();Object.defineProperty(Ln,"__esModule",{value:!0});Ln.STANDARD_ANSI=void 0;Ln.STANDARD_ANSI=["white","black","blue","yellow","green","red","magenta","cyan","gray","blackBright","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgGray","bgBlackBright","bgRedBright","bgGreenBright","bgYellowBright","bgBlueBright","bgMagentaBright","bgCyanBright","bgWhiteBright","bold","underline","dim","italic","strikethrough"]});var ao=m(zi=>{"use strict";u();Object.defineProperty(zi,"__esModule",{value:!0});zi.supportsColor=Ed;var oo=Cu();function Ed(){return!!oo.stdout&&!!oo.stderr}});var oe=m(pt=>{"use strict";u();var $d=pt&&pt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(pt,"__esModule",{value:!0});pt.colorize=Cd;pt.parseTheme=lo;var Ji=$d(Ve()),Od=so(),Pd=ao();function co(n){return Od.STANDARD_ANSI.includes(n)}function Cd(n,e){if(!n||!(0,Pd.supportsColor)())return e;if(co(n))return Ji.default[n](e);if(n.startsWith("#"))return Ji.default.hex(n)(e);if(n.startsWith("rgb")){let[t,i,r]=n.slice(4,-1).split(",").map(s=>Number.parseInt(s.trim(),10));return Ji.default.rgb(t,i,r)(e)}return e}function lo(n){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,typeof t=="string"?jd(t):lo(t)]).filter(([e,t])=>t))}function jd(n){return n.startsWith("#")||n.startsWith("rgb")||co(n)?n:void 0}});var ze=m(Te=>{"use strict";u();var An=Te&&Te.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Te,"__esModule",{value:!0});Te.CLIError=void 0;Te.addOclifExitCode=fo;var Id=An(Xs()),Ki=An(Ti()),Ld=An(Di()),Ad=An(fe()),xd=ht(),Sd=Ie(),uo=oe();function fo(n,e){return"oclif"in n||(n.oclif={}),n.oclif.exit=e?.exit===void 0?Ad.default.getInstance().get("exitCodes")?.default??2:e.exit,n}var Ht=class extends Error{code;oclif={};skipOclifErrorHandling;suggestions;constructor(e,t={}){super(e instanceof Error?e.message:e),fo(this,t),this.code=t.code,this.suggestions=t.suggestions}get bang(){try{return(0,uo.colorize)("red",process.platform==="win32"?"\xBB":"\u203A")}catch{}}get stack(){return(0,Id.default)(super.stack,{pretty:!0})}render(){if(Sd.settings.debug)return this.stack;let e=`${this.name}: ${this.message}`;return e=(0,Ld.default)(e,xd.errtermwidth-6,{hard:!0,trim:!1}),e=(0,Ki.default)(e,3),e=(0,Ki.default)(e,1,{includeEmptyLines:!0,indent:this.bang}),e=(0,Ki.default)(e,1),e}};Te.CLIError=Ht;(function(n){class e extends n{constructor(i){super(i instanceof Error?i.message:i),this.name="Warning"}get bang(){try{return(0,uo.colorize)("yellow",process.platform==="win32"?"\xBB":"\u203A")}catch{}}}n.Warn=e})(Ht||(Te.CLIError=Ht={}))});var Sn=m(gt=>{"use strict";u();var po=gt&&gt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(gt,"__esModule",{value:!0});gt.applyPrettyPrintOptions=Rd;gt.default=Dd;var xn=po(Ti()),qd=po(Di()),Fd=ht(),ho=Ie();function Rd(n,e){let t=["message","code","ref","suggestions"];for(let i of t)!(i in n)&&e[i]&&(n[i]=e[i]);return n}var Nd=n=>{let e="Try this:";if(!n||n.length===0)return;if(n.length===1)return`${e} ${n[0]}`;let t=n.map(i=>`* ${i}`).join(`
1
+ import{a as Cn}from"./chunk-AAK376RT.js";import{a as Du}from"./chunk-P2OI2P2M.js";import{a as Ys}from"./chunk-636CTEW7.js";import{a as Ks,c as Xs,d as Ti,e as ju,f as Di,g as Ve,h as Lu,i as Au,j as xu,k as Su,l as qu,m as Fu,n as Ru,o as Nu,p as Tu}from"./chunk-QFYLJVJW.js";import{b as Cu,c as kt}from"./chunk-ZGASBRSQ.js";import{b as Pu}from"./chunk-I5A6BPCP.js";import{a as Ou}from"./chunk-CX5CC6P5.js";import{a as Iu}from"./chunk-IGE4Y5SE.js";import{a as $,c as m,e as W,g as u}from"./chunk-VKWPEFWQ.js";var N=m(V=>{"use strict";u();Object.defineProperty(V,"__esModule",{value:!0});V.pickBy=ku;V.compact=Mu;V.uniqBy=Hu;V.last=Bu;V.sortBy=Uu;V.castArray=Wu;V.isProd=Vu;V.maxBy=Gu;V.sumBy=zu;V.capitalize=Ju;V.isTruthy=Ku;V.isNotFalsy=Xu;V.uniq=Yu;V.mapValues=Zu;V.mergeNestedObjects=ed;function ku(n,e){return Object.entries(n).reduce((t,[i,r])=>(e(r)&&(t[i]=r),t),{})}function Mu(n){return n.filter(e=>!!e)}function Hu(n,e){return n.filter((t,i)=>{let r=e(t);return!n.some((s,o)=>o>i&&e(s)===r)})}function Bu(n){if(n)return n.at(-1)}function ki(n,e){if(n=n===void 0?0:n,e=e===void 0?0:e,Array.isArray(n)&&Array.isArray(e)){if(n.length===0&&e.length===0)return 0;let t=ki(n[0],e[0]);return t!==0?t:ki(n.slice(1),e.slice(1))}return n<e?-1:n>e?1:0}function Uu(n,e){return n.sort((t,i)=>ki(e(t),e(i)))}function Wu(n){return n===void 0?[]:Array.isArray(n)?n:[n]}function Vu(){return!["development","test"].includes(process.env.NODE_ENV??"")}function Gu(n,e){if(n.length!==0)return n.reduce((t,i)=>{let r=e(i),s=e(t);return r>s?i:t})}function zu(n,e){return n.reduce((t,i)=>t+e(i),0)}function Ju(n){return n?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():""}function Ku(n){return["1","true","y","yes"].includes(n.toLowerCase())}function Xu(n){return!["0","false","n","no"].includes(n.toLowerCase())}function Yu(n){return[...new Set(n)].sort()}function Zu(n,e){return Object.entries(n).reduce((t,[i,r])=>(t[i]=e(r,i),t),{})}function Qu(n,e){return e.split(".").reduce((t,i)=>t?.[i],n)}function ed(n,e){return Object.fromEntries(n.flatMap(t=>Object.entries(Qu(t,e)??{})).reverse())}});var we=m(Ce=>{"use strict";u();Object.defineProperty(Ce,"__esModule",{value:!0});Ce.fileExists=Ce.dirExists=void 0;Ce.readJson=Zs;Ce.safeReadJson=sd;Ce.existsSync=od;var td=$("node:fs"),Bi=$("node:fs/promises"),nd=N(),id=async n=>{let e;try{e=await(0,Bi.stat)(n)}catch{throw new Error(`No directory found at ${n}`)}if(!e.isDirectory())throw new Error(`${n} exists but is not a directory`);return n};Ce.dirExists=id;var rd=async n=>{let e;try{e=await(0,Bi.stat)(n)}catch{throw new Error(`No file found at ${n}`)}if(!e.isFile())throw new Error(`${n} exists but is not a file`);return n};Ce.fileExists=rd;var Hi=class extends Map{set(e,t){return((0,nd.isProd)()??!1)&&super.set(e,t),this}},Mi=new Hi;async function Zs(n,e=!0){if(e&&Mi.has(n))return JSON.parse(Mi.get(n));let t=await(0,Bi.readFile)(n,"utf8");return Mi.set(n,t),JSON.parse(t)}async function sd(n,e=!0){try{return await Zs(n,e)}catch{}}function od(n){return(0,td.existsSync)(n)}});var eo=m(X=>{"use strict";u();Object.defineProperty(X,"__esModule",{value:!0});X.string=X.url=X.file=X.directory=X.integer=X.boolean=void 0;X.custom=Ge;var ad=$("node:url"),Qs=we(),cd=N();function Ge(n){return(e={})=>({parse:async(t,i,r)=>t,...n,...e,input:[],type:"option"})}X.boolean=Ge({parse:async n=>!!n&&(0,cd.isNotFalsy)(n)});X.integer=Ge({async parse(n,e,t){if(!/^-?\d+$/.test(n))throw new Error(`Expected an integer but received: ${n}`);let i=Number.parseInt(n,10);if(t.min!==void 0&&i<t.min)throw new Error(`Expected an integer greater than or equal to ${t.min} but received: ${n}`);if(t.max!==void 0&&i>t.max)throw new Error(`Expected an integer less than or equal to ${t.max} but received: ${n}`);return i}});X.directory=Ge({async parse(n,e,t){return t.exists?(0,Qs.dirExists)(n):n}});X.file=Ge({async parse(n,e,t){return t.exists?(0,Qs.fileExists)(n):n}});X.url=Ge({async parse(n){try{return new ad.URL(n)}catch{throw new Error(`Expected a valid url but received: ${n}`)}}});var ld=Ge({});X.string=ld});var to=m((Db,ud)=>{ud.exports={name:"@oclif/core",description:"base library for oclif CLIs",version:"4.11.14",author:"Salesforce",bugs:"https://github.com/oclif/core/issues",dependencies:{"ansi-escapes":"^4.3.2",ansis:"^3.17.0","clean-stack":"^3.0.1","cli-spinners":"^2.9.2",debug:"^4.4.3",ejs:"^3.1.10","get-package-type":"^0.1.0","indent-string":"^4.0.0","is-wsl":"^2.2.0",lilconfig:"^3.1.3",minimatch:"^10.2.5",semver:"^7.8.1","string-width":"^4.2.3","supports-color":"^8",tinyglobby:"^0.2.17","widest-line":"^3.1.0",wordwrap:"^1.0.0","wrap-ansi":"^7.0.0"},devDependencies:{"@commitlint/config-conventional":"^19","@eslint/compat":"^1.4.1","@oclif/plugin-help":"^6","@oclif/plugin-plugins":"^5","@oclif/prettier-config":"^0.2.1","@oclif/test":"^4","@types/benchmark":"^2.1.5","@types/chai":"^4.3.16","@types/chai-as-promised":"^7.1.8","@types/clean-stack":"^2.1.1","@types/debug":"^4.1.13","@types/ejs":"^3.1.5","@types/indent-string":"^4.0.1","@types/mocha":"^10.0.10","@types/node":"^18","@types/picomatch":"^4.0.3","@types/pnpapi":"^0.0.5","@types/sinon":"^17.0.3","@types/supports-color":"^8.1.3","@types/wordwrap":"^1.0.3","@types/wrap-ansi":"^3.0.0",benchmark:"^2.1.4",chai:"^4.5.0","chai-as-promised":"^7.1.2",commitlint:"^19","cross-env":"^7.0.3",eslint:"^9","eslint-config-oclif":"^6","eslint-config-prettier":"^10",husky:"^9.1.7","lint-staged":"^15",madge:"^6.1.0",mocha:"^11.7.5",nyc:"^15.1.0",prettier:"^3.8.3",shx:"^0.4.0",sinon:"^18","ts-node":"^10.9.2",tsd:"^0.33.0",typescript:"^5"},engines:{node:">=18.0.0"},files:["/lib"],homepage:"https://github.com/oclif/core",keywords:["oclif","cli","command","command line","parser","args","argv"],license:"MIT",exports:{".":"./lib/index.js","./args":"./lib/args.js","./command":"./lib/command.js","./config":"./lib/config/index.js","./errors":"./lib/errors/index.js","./execute":"./lib/execute.js","./flags":"./lib/flags.js","./flush":"./lib/flush.js","./handle":"./lib/errors/handle.js","./help":"./lib/help/index.js","./hooks":"./lib/interfaces/hooks.js","./interfaces":"./lib/interfaces/index.js","./logger":"./lib/logger.js","./package.json":"./package.json","./parser":"./lib/parser/index.js","./performance":"./lib/performance.js","./run":"./lib/main.js","./settings":"./lib/settings.js","./util/ids":"./lib/util/ids.js","./ux":"./lib/ux/index.js"},repository:"oclif/core",oclif:{bin:"oclif",devPlugins:["@oclif/plugin-help","@oclif/plugin-plugins"]},publishConfig:{access:"public"},scripts:{build:"shx rm -rf lib && tsc",compile:"tsc",format:'prettier --write "+(src|test)/**/*.+(ts|js|json)"',lint:"eslint",posttest:"yarn lint && yarn test:circular-deps",prepack:"yarn run build",prepare:"husky","test:circular-deps":"yarn build && madge lib/ -c","test:debug":'nyc mocha --debug-brk --inspect "test/**/*.test.ts"',"test:integration":'mocha --forbid-only "test/**/*.integration.ts" --parallel --timeout 1200000',"test:interoperability":"cross-env DEBUG=integration:* ts-node test/integration/interop.ts","test:perf":"ts-node test/perf/parser.perf.ts",test:'nyc mocha --forbid-only "test/**/*.test.ts" --parallel'},types:"lib/index.d.ts"}});var fe=m(Wi=>{"use strict";u();Object.defineProperty(Wi,"__esModule",{value:!0});var dd=$("node:fs"),fd=$("node:path"),Ui=class n extends Map{static instance;constructor(){super(),this.set("@oclif/core",this.getOclifCoreMeta())}static getInstance(){return n.instance||(n.instance=new n),n.instance}get(e){return super.get(e)}getOclifCoreMeta(){try{return{name:"@oclif/core",version:to().version}}catch{try{return{name:"@oclif/core",version:JSON.parse((0,dd.readFileSync)((0,fd.join)(__dirname,"..","package.json"),"utf8")).version}}catch{return{name:"@oclif/core",version:"unknown"}}}}};Wi.default=Ui});var Q=m(Ne=>{"use strict";u();var hd=Ne&&Ne.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.getLogger=no;Ne.makeDebug=md;Ne.setLogger=yd;Ne.clearLoggers=_d;var pd=hd(kt()),Gi="oclif";function jn(n=Gi){let e=(0,pd.default)(n);return{child:(t,i)=>jn(`${n}${i??":"}${t}`),debug:e,error:(t,...i)=>jn(`${n}:error`).debug(t,...i),info:e,namespace:n,trace:e,warn:e}}var je=new Map;function no(n){let e=je.get("root");if(e||Vi(jn(Gi)),e=je.get("root"),n){let t=je.get(n);if(t)return t;let i=e.child(n);return je.set(n,i),i}return e}function gd(n){return typeof n.child=="function"&&typeof n.debug=="function"&&typeof n.error=="function"&&typeof n.info=="function"&&typeof n.trace=="function"&&typeof n.warn=="function"&&typeof n.namespace=="string"}function Vi(n){je.has(n.namespace)||je.has("root")||(gd(n)?(je.set(n.namespace,n),je.set("root",n)):process.emitWarning("Logger does not match the Logger interface. Using default logger."))}function md(n){return(e,...t)=>no(n).debug(e,...t)}function yd(n){n&&typeof n!="string"&&"logger"in n&&n.logger?Vi(n.logger):Vi(jn(Gi))}function _d(){je.clear()}});var Mt=m(dt=>{"use strict";u();Object.defineProperty(dt,"__esModule",{value:!0});dt.stderr=dt.stdout=void 0;var ut=$("node:util"),wd=(n,...e)=>{!n&&e?console.log((0,ut.format)(...e)):n?console.log(typeof n=="string"?(0,ut.format)(n,...e):(0,ut.format)(...n,...e)):console.log()};dt.stdout=wd;var bd=(n,...e)=>{!n&&e?console.error((0,ut.format)(...e)):n?console.error(typeof n=="string"?(0,ut.format)(n,...e):(0,ut.format)(...n,...e)):console.error()};dt.stderr=bd});var Ie=m(In=>{"use strict";u();Object.defineProperty(In,"__esModule",{value:!0});In.settings=void 0;globalThis.oclif||(globalThis.oclif={});In.settings=globalThis.oclif});var ht=m(ft=>{"use strict";u();Object.defineProperty(ft,"__esModule",{value:!0});ft.errtermwidth=ft.stdtermwidth=void 0;var vd=Ie();function io(n){if(!n.isTTY)return 80;let e=n.getWindowSize()[0];return e<1?80:e<40?40:e}var ro=Number.parseInt(process.env.OCLIF_COLUMNS,10)||vd.settings.columns;ft.stdtermwidth=ro||io(process.stdout);ft.errtermwidth=ro||io(process.stderr)});var so=m(Ln=>{"use strict";u();Object.defineProperty(Ln,"__esModule",{value:!0});Ln.STANDARD_ANSI=void 0;Ln.STANDARD_ANSI=["white","black","blue","yellow","green","red","magenta","cyan","gray","blackBright","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgGray","bgBlackBright","bgRedBright","bgGreenBright","bgYellowBright","bgBlueBright","bgMagentaBright","bgCyanBright","bgWhiteBright","bold","underline","dim","italic","strikethrough"]});var ao=m(zi=>{"use strict";u();Object.defineProperty(zi,"__esModule",{value:!0});zi.supportsColor=Ed;var oo=Cu();function Ed(){return!!oo.stdout&&!!oo.stderr}});var oe=m(pt=>{"use strict";u();var $d=pt&&pt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(pt,"__esModule",{value:!0});pt.colorize=Cd;pt.parseTheme=lo;var Ji=$d(Ve()),Od=so(),Pd=ao();function co(n){return Od.STANDARD_ANSI.includes(n)}function Cd(n,e){if(!n||!(0,Pd.supportsColor)())return e;if(co(n))return Ji.default[n](e);if(n.startsWith("#"))return Ji.default.hex(n)(e);if(n.startsWith("rgb")){let[t,i,r]=n.slice(4,-1).split(",").map(s=>Number.parseInt(s.trim(),10));return Ji.default.rgb(t,i,r)(e)}return e}function lo(n){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,typeof t=="string"?jd(t):lo(t)]).filter(([e,t])=>t))}function jd(n){return n.startsWith("#")||n.startsWith("rgb")||co(n)?n:void 0}});var ze=m(Te=>{"use strict";u();var An=Te&&Te.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Te,"__esModule",{value:!0});Te.CLIError=void 0;Te.addOclifExitCode=fo;var Id=An(Xs()),Ki=An(Ti()),Ld=An(Di()),Ad=An(fe()),xd=ht(),Sd=Ie(),uo=oe();function fo(n,e){return"oclif"in n||(n.oclif={}),n.oclif.exit=e?.exit===void 0?Ad.default.getInstance().get("exitCodes")?.default??2:e.exit,n}var Ht=class extends Error{code;oclif={};skipOclifErrorHandling;suggestions;constructor(e,t={}){super(e instanceof Error?e.message:e),fo(this,t),this.code=t.code,this.suggestions=t.suggestions}get bang(){try{return(0,uo.colorize)("red",process.platform==="win32"?"\xBB":"\u203A")}catch{}}get stack(){return(0,Id.default)(super.stack,{pretty:!0})}render(){if(Sd.settings.debug)return this.stack;let e=`${this.name}: ${this.message}`;return e=(0,Ld.default)(e,xd.errtermwidth-6,{hard:!0,trim:!1}),e=(0,Ki.default)(e,3),e=(0,Ki.default)(e,1,{includeEmptyLines:!0,indent:this.bang}),e=(0,Ki.default)(e,1),e}};Te.CLIError=Ht;(function(n){class e extends n{constructor(i){super(i instanceof Error?i.message:i),this.name="Warning"}get bang(){try{return(0,uo.colorize)("yellow",process.platform==="win32"?"\xBB":"\u203A")}catch{}}}n.Warn=e})(Ht||(Te.CLIError=Ht={}))});var Sn=m(gt=>{"use strict";u();var po=gt&&gt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(gt,"__esModule",{value:!0});gt.applyPrettyPrintOptions=Rd;gt.default=Dd;var xn=po(Ti()),qd=po(Di()),Fd=ht(),ho=Ie();function Rd(n,e){let t=["message","code","ref","suggestions"];for(let i of t)!(i in n)&&e[i]&&(n[i]=e[i]);return n}var Nd=n=>{let e="Try this:";if(!n||n.length===0)return;if(n.length===1)return`${e} ${n[0]}`;let t=n.map(i=>`* ${i}`).join(`
2
2
  `);return`${e}
3
3
  ${(0,xn.default)(t,2)}`};function Td(n){return!!n&&"name"in n&&"message"in n}function Dd(n){let e=[],t=n,i=!1;for(;Td(t);){if(ho.settings.debug&&t.stack)e.push(`${i?"Caused by: ":""}${t.stack}`);else{let{bang:r,code:s,message:o,name:a,ref:l,suggestions:d}=t,f=o?`${a||"Error"}: ${o}`:void 0,c=s?`Code: ${s}`:void 0,p=Nd(d),h=l?`Reference: ${l}`:void 0,y=[f,c,p,h].filter(Boolean).join(`
4
4
  `),g=`${i?"Caused by: ":""}${y}`;g=(0,qd.default)(g,Fd.errtermwidth-6,{hard:!0,trim:!1}),ho.settings.debug||(g=(0,xn.default)(g,3),g=(0,xn.default)(g,1,{includeEmptyLines:!0,indent:r||""}),g=(0,xn.default)(g,1)),e.push(g)}i=!0,t=t.cause??null}return e.join(`
@@ -0,0 +1,16 @@
1
+ import{c as Xe}from"./chunk-WMAFG2JD.js";import{G as We,H as Ke,K as ue,O as D,P as Ge,a as Me,aa as Ye,ca as U,da as Je,e as $e,ia as b,j as He,ja as Z,k as le,ma as T,na as Qe,oa as w,q as y,r as je,s as me,u as E}from"./chunk-H4V55Y3Z.js";import{b as Ze}from"./chunk-ZDF5N422.js";import{w as ce}from"./chunk-IUP7POIE.js";import{b as Be}from"./chunk-ZT5WFUKJ.js";import{a as Ce}from"./chunk-4C2DAX5T.js";import{A as en,E as nn,F as an,G as tn,J as on,K as rn,U as sn}from"./chunk-CZ22VZDA.js";import{e as Le,k as J}from"./chunk-335BUVBP.js";import{a as Ee}from"./chunk-BN7ZXAZJ.js";import{h as c,k as A}from"./chunk-2VSNFOKD.js";import{Bb as ke,N as C,Sa as qe,T as G,Va as Oe,fa as Y,la as Pe,qb as ln,sb as P,wb as mn}from"./chunk-LWCTKI4Z.js";import{i as pe}from"./chunk-B4OMIONW.js";import{b as t}from"./chunk-FZCGRIOM.js";import{g as dn}from"./chunk-3A3DZVEJ.js";import{c as Ue,i as K}from"./chunk-IWTNUJGY.js";import{e as W,g as s}from"./chunk-VKWPEFWQ.js";s();function q(e,{httpsOnly:n=!1,message:i="Invalid URL"}={}){return e.refine(a=>ve(a,n),{message:i}).refine(a=>!a.includes(`
2
+ `),{message:i})}function mt(e,{message:n="URL must be HTTPS URL or start with /"}={}){return e.refine(i=>i.startsWith("/")||ve(i,!0),{message:n})}var un=/[\r\n\t]/;function cn(e){return ve(e,!0)}function ve(e,n){try{let i=new URL(e);return n?i.protocol==="https:":["http:","https:"].includes(i.protocol)}catch{return!1}}function ut(e){return typeof e=="string"&&!e.startsWith("/")?`/${e}`:e}var Ci=30;function ct(e){return e.length<=Ci}s();s();s();function pn(e){return $e`
3
+ query OrganizationBetaFlags($organizationId: OrganizationID!) {
4
+ organization(organizationId: $organizationId) {
5
+ id
6
+ ${e.map(n=>`flag_${n}: hasFeatureFlag(handle: "${n}")`).join(`
7
+ `)}
8
+ }
9
+ }`}s();var kn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationExpFlags"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OrganizationID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"flagHandles"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},arguments:[{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"enabledFlags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"flagHandles"},value:{kind:"Variable",name:{kind:"Name",value:"flagHandles"}}}]},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var fe=class extends c{},V=class extends c{constructor(n,i){let a="unknown",o=d=>`an ${d}`;Ke(n)?(a=n.orgName,o=d=>`the ${d} organization`):We(n)&&(a=n.email,o=d=>`the ${d} user`);let r=P`${ln.yellow(a)}`.value,m=[[`Your current active session is associated with ${o(r)} account. To start a new session with a different account, run`,{command:"shopify auth login"}],["Have you",{link:{label:"created a Shopify Partners organization",url:"https://partners.shopify.com/signup"}},{char:"?"}],["Does your account include",{subdued:"Manage app"},"permissions?, please contact the owner of the organization to grant you access."],"Have you confirmed your accounts from the emails you received?",["Need to connect to a different App or organization? Run the command again with",{command:"--reset"}]];i&&m.push(["Do you have access to the right Shopify Partners organization? The CLI is loading",{link:{label:"this organization",url:`https://partner.shopify.com/${i}`}}]),super("No Organization found",void 0,m)}};async function _t(){let e=vn(),n=await e.organizations();if(n.length===0){let i=await e.session();throw new V(i.accountInfo)}return n}async function Dt(e,n){let i=await n.orgFromId(e);if(!i)throw new V((await n.session()).accountInfo,e);return i}async function At(e,n,i,a=["APP_DEVELOPMENT"]){let o=await i.storeByDomain(e.id,n,a);if(!o){let m=a.length===1&&a[0]==="APP_DEVELOPMENT"?"Ensure you have provided the correct store domain, that the store is a dev store, and that you have access to the store.":"Ensure you have provided the correct store domain and that you have access to the store.";throw new fe(`Could not find store for domain ${n} in organization ${e.businessName}.`,m)}return o}s();var O=class extends c{versionTag;constructor(n){super(`Version ${n} could not be found.`),this.versionTag=n}};s();var fn={skipEsbuildReactDedeuplication:"SHOPIFY_CLI_SKIP_ESBUILD_REACT_DEDUPLICATION",disableGraphiQLExplorer:"SHOPIFY_CLI_DISABLE_GRAPHIQL",useDynamicConfigSpecifications:"SHOPIFY_CLI_DYNAMIC_CONFIG",enableAppLogPolling:"SHOPIFY_CLI_ENABLE_APP_LOG_POLLING",templatesJsonPath:"SHOPIFY_CLI_APP_TEMPLATES_JSON_PATH",mkcertBinaryPath:"SHOPIFY_CLI_MKCERT_BINARY",disableMinificationOnDev:"SHOPIFY_CLI_DISABLE_MINIFICATION_ON_DEV"},Ei={app:"shopify.app.toml",web:"shopify.web.toml",appEnvironments:"shopify.environments.toml",lockFile:".shopify.lock",hiddenConfig:"project.json",hiddenFolder:".shopify"},Rt={production:".env"},zt={reactTypes:"17.0.30"},gn={extensions:{directoryName:"extensions",defaultRegistrationLimit:1},web:{directoryName:"web",configurationName:Ei.web}},Ct={graphiql:3457,localhost:3458},Et=/^([a-zA-Z_$])([a-zA-Z0-9_$])*$/;s();var Q;(function(e){e.Partners="Partners",e.BusinessPlatform="BusinessPlatform"})(Q||(Q={}));s();s();var Nn=50,Sn=250,Ui=t.object({namespace:t.string(),key:t.string(),owner_type:t.string().optional()}),Pi=t.object({sms_marketing:t.boolean().optional(),customer_privacy:t.boolean().optional()}),qi=t.object({sources:t.array(t.string()).optional()}),Oi=t.object({network_access:t.boolean().optional(),block_progress:t.boolean().optional(),api_access:t.boolean().optional(),collect_buyer_consent:Pi.optional(),iframe:qi.optional(),bundle_size_exception:t.boolean().optional()}),Li=t.object({runs_offline:t.boolean().optional()}),Mt=t.object({type:t.string().optional(),extensions:t.array(t.any()).optional()}),Mi=t.object({event:t.string(),blocking:t.boolean().default(!1),applies_to:t.array(t.string()).optional()}),$i=t.object({allow_direct_linking:t.boolean().optional(),intercepts:t.array(Mi).optional()}),Hi=t.object({module:t.string()}),Bi=t.object({target:t.string(),module:t.string(),should_render:Hi.optional(),tools:t.string().optional(),instructions:t.string().optional(),intents:t.array(t.object({type:t.string(),action:t.string(),schema:t.string(),name:t.string().optional(),description:t.string().optional()})).optional(),metafields:t.array(Ui).optional(),default_placement:t.string().optional(),urls:t.object({edit:t.string().optional()}).optional(),capabilities:$i.optional(),preloads:t.object({chat:t.string().optional()}).optional(),assets:t.string().optional()}),$t=t.array(Bi),hn=t.string(),ji=t.object({key:t.string().optional(),name:t.string().optional(),description:t.string().optional(),required:t.boolean().optional(),default_value:t.any().optional(),type:t.string(),validations:t.array(t.any()).optional(),marketingActivityCreateUrl:t.string().optional(),marketingActivityDeleteUrl:t.string().optional()}),yn=t.object({fields:t.array(ji).optional()}),bn=t.string().trim().nonempty("Handle can't be empty").max(Nn,`Handle can't exceed ${Nn} characters`).regex(/^[a-zA-Z0-9-]*$/,"Handle can only contain alphanumeric characters and hyphens").refine(e=>!e.startsWith("-")&&!e.endsWith("-"),"Handle can't start or end with a hyphen"),Wi=t.string().trim().nonempty("UID can't be empty").max(Sn,`UID can't exceed ${Sn} characters`).regex(/^[a-zA-Z0-9-${}.()_`]*$/,"UID can only contain alphanumeric characters and hyphens").refine(e=>!e.startsWith("-")&&!e.endsWith("-"),"UID can't start or end with a hyphen"),X=t.object({name:t.string().optional(),type:t.string().optional(),handle:bn.optional(),uid:Wi.optional(),description:t.string().optional(),api_version:hn.optional(),extension_points:t.any().optional(),capabilities:Oi.optional(),supported_features:Li.optional(),settings:yn.optional()}),Ht=X.extend({handle:bn}),F=X.omit({handle:!0}),Bt=t.object({api_version:hn.optional(),description:t.string().optional(),extensions:t.array(t.any()),settings:yn.optional()});s();s();s();s();var Ki=/^(https:\/\/)/,Gi=/^pubsub:\/\/(?<gcp_project_id>[^:]+):(?<gcp_topic>.+)$/,Yi=/^arn:aws:events:(?<aws_region>[a-z]{2}-[a-z]+-[0-9]+)::event-source\/aws\.partner\/shopify\.com(\.test)?\/(?<api_client_id>\d+)\/(?<event_source_name>.+)$/,Ji=/^kafka:\/\/(?<kafka_topic>[a-zA-Z0-9_.-]+)$/;function I(e){return typeof e=="string"&&e.endsWith("/")?e.replace(/\/+$/,""):e}var _=t.string({invalid_type_error:"Value must be string"}).refine(e=>e.startsWith("/")?!0:Ki.test(e)||Gi.test(e)||Yi.test(e)||Ji.test(e),{message:"URI format isn't correct. Valid formats include: relative path starting with a slash, HTTPS URL, pubsub://{project-id}:{topic-id}, kafka://{topic-id} or Eventbridge ARN"});function ee(e,n){return!n||!e.startsWith("/")?e:`${I(n)}${e}`}var Zi=(e,n,i,a)=>{if(i.startsWith("//"))throw new c(`${e} ${n} is invalid: a URL relative to the app URL must start with a single slash.`);if(un.test(i))throw new c(`${e} ${n} is invalid: a URL must not contain control characters such as newlines or tabs.`);let o=ee(i,a);if(o.startsWith("/"))throw new c(`${e} ${n} is a relative URL, but no application_url is configured. Set application_url in your app configuration or use an absolute HTTPS URL.`);if(!cn(o))throw new c(`${e} ${n} must resolve to an HTTPS URL. Set application_url to an HTTPS URL or use an absolute HTTPS URL.`);return o};function ge(e,n,i,a){let o=i;for(let r of n){let m=o[r];typeof m=="string"&&m.startsWith("/")&&(o[r]=Zi(e,r,m,a))}}s();import{isUtf8 as Qi}from"node:buffer";import Fn from"fs";async function _n(e,n){let i=await Oe(Ue(e,"locales/*.json"));if(!i||i.length===0)return{};let a=Xi(i);if(a.length===0)throw new c(`Missing default language in ${n} configuration`,"Make sure to have a {locale}.default.json file in your locales directory");if(a.length>1)throw new c(`Error loading ${n}`,'There must be one (and only one) locale identified as the default locale: e.g. "en.default.json"');for(let o of i)if(Fn.statSync(o).size===0)throw new c(`Error loading ${n}`,`Locale file ${o} can't be empty`);return{default_locale:a[0],translations:ea(i,n)}}function Xi(e){return e.filter(i=>K(i).endsWith(".default.json")).map(i=>K(i).split(".")[0])}function ea(e,n){let i={};for(let a of e){let o=na(K(a).split(".")[0],"Locale code is unset"),r=Fn.readFileSync(a);if(!Qi(r))throw new c(`Error loading ${n}`,`Locale file ${a} contains invalid UTF-8 byte sequences. Re-save the file using UTF-8 encoding.`);i[o]=r.toString("base64")}return i}function na(e,n){if(e===void 0)throw new A(n);return e}function ia(e){return e.experience==="configuration"}var Dn;(function(e){e.ShouldRender="should_render",e.Main="main",e.Tools="tools",e.Instructions="instructions",e.Intents="intents"})(Dn||(Dn={}));function An(e){let n=X,a={...{externalIdentifier:`${e.identifier}_external`,additionalIdentifiers:[],externalName:G(e.identifier.replace(/_/g," ")),surface:"test-surface",partnersWebIdentifier:e.identifier,schema:n,registrationLimit:gn.extensions.defaultRegistrationLimit,transform:e.transformLocalToRemote,reverseTransform:e.transformRemoteToLocal,experience:e.experience??"extension",uidStrategy:e.uidStrategy??(e.experience==="configuration"?"single":"uuid"),getDevSessionUpdateMessages:e.getDevSessionUpdateMessages,clientSteps:e.clientSteps},...e};return{...a,contributeToAppConfigurationSchema:o=>{let r=ia(a),m=a.schema._def.shape!==void 0,d=a.uidStrategy==="single";return r&&m&&d?o.merge(a.schema):o},parseConfigurationObject:o=>{let r=a.schema.safeParse(o);return r.success?{state:"ok",data:r.data,errors:void 0}:{state:"error",data:void 0,errors:r.error.errors}}}}function h(e){let n=e.appModuleFeatures??(()=>[]);return An({identifier:e.identifier,schema:e.schema,appModuleFeatures:n,transformLocalToRemote:aa(e.transformConfig),transformRemoteToLocal:ta(e.schema,e.transformConfig),experience:"configuration",uidStrategy:e.uidStrategy??"single",expandConfig:e.expandConfig,getIdentity:e.getIdentity,getTarget:e.getTarget,clientSteps:e.clientSteps,getDevSessionUpdateMessages:e.getDevSessionUpdateMessages,patchWithAppDevURLs:e.patchWithAppDevURLs})}function So(e){let n=e.appRelativeUrlFields;return An({identifier:e.identifier,schema:t.any({}),appModuleFeatures:e.appModuleFeatures,experience:e.experience,clientSteps:e.clientSteps,uidStrategy:e.uidStrategy,transformRemoteToLocal:e.transformRemoteToLocal,devSessionWatchConfig:e.devSessionWatchConfig,appRelativeUrlFields:n,patchWithAppDevURLs:n?.length?(i,a)=>{ge(G(e.identifier.replace(/_/g," ")),n,i,a.applicationUrl)}:void 0,deployConfig:async(i,a,o,r,m)=>{let d=oa(i);if(n?.length){let l=m?.appConfiguration?.application_url,p=typeof l=="string"?l:void 0;ge(G(e.identifier.replace(/_/g," ")),n,d,p)}if(e.appModuleFeatures().includes("localization")){let l=await _n(a,e.identifier);d={...d,localization:l}}return d}})}function aa(e){return Object.keys(e).includes("forward")?e.forward:n=>L(n,e)}function ta(e,n){return n?Object.keys(n).includes("reverse")?n.reverse:i=>L(i,n,!0):i=>Tn(e,i)}function L(e,n,i=!1){let a={};for(let[o,r]of Object.entries(n)){let m=i?o:r,d=i?r:o,l=U(e,m);l!==void 0&&Je(a,d,l)}return a}function Tn(e,n){return Object.keys(e._def.shape()).reduce((i,a)=>{let o=e._def.shape()[a];return o instanceof t.ZodOptional&&(o=o._def.innerType),o instanceof t.ZodObject?i[a]=Tn(o,n):(n[a]!==void 0&&(i[a]=n[a]),delete n[a]),i},{})}function oa(e){let{type:n,handle:i,uid:a,path:o,extensions:r,...m}=e;return m}var ra=F.extend({application_url:q(t.string({required_error:"Valid URL is required"})),embedded:t.boolean({required_error:"Boolean is required",invalid_type_error:"Value must be Boolean"}),app_preferences:t.object({url:q(t.string().max(255,{message:"String must be less than 255 characters"}))}).optional()}),sa={app_url:"application_url",embedded:"embedded",preferences_url:"app_preferences.url"},Ne="app_home",da=h({identifier:Ne,schema:ra,transformConfig:sa,patchWithAppDevURLs:(e,n)=>{e.application_url=n.applicationUrl},getDevSessionUpdateMessages:async e=>[`Using URL: ${e.application_url}`]}),Ao=da;s();var la=F.extend({name:t.string({required_error:"String is required"}).max(30,{message:"String must be less than 30 characters"}),handle:t.string({required_error:"String is required"}).max(256,{message:"String must be less than 256 characters long"}).refine(e=>e&&/^\w*(?!-)[_a-z0-9-]+(?<!-)$/.test(e),{message:"String can't contain special characters"}).optional()}),ma={name:"name",app_handle:"handle"},Se="branding",ua=h({identifier:Se,schema:la,transformConfig:ma}),Ro=ua;s();var ca=t.object({scopes:t.string().transform(e=>Y(e)??"").optional(),required_scopes:t.array(t.string()).optional(),optional_scopes:t.array(t.string()).optional(),use_legacy_install_flow:t.boolean().optional()}),pa=t.object({redirect_urls:t.array(q(t.string()))}),ka=F.extend({access:t.object({admin:t.object({direct_api_mode:t.union([t.literal("online"),t.literal("offline")]).optional(),embedded_app_direct_api_access:t.boolean().optional()}).optional()}).optional(),access_scopes:ca.optional(),auth:pa}),he="app_access",wn={access:"access",scopes:"access_scopes.scopes",required_scopes:"access_scopes.required_scopes",optional_scopes:"access_scopes.optional_scopes",use_legacy_install_flow:"access_scopes.use_legacy_install_flow",redirect_url_allowlist:"auth.redirect_urls"};function va(e){let{shop_scopes:n,...i}=e,a=typeof n=="string"?Y(n):void 0;if(!a)return i;let o=typeof i.scopes=="string"?i.scopes:"";return{...i,scopes:Y([o,a].join(","))}}var fa={forward:e=>L(e,wn),reverse:e=>L(va(e),wn,!0)},ga=h({identifier:he,schema:ka,transformConfig:fa,getDevSessionUpdateMessages:async e=>{let n=e.access_scopes!==void 0,i=e.access_scopes?.use_legacy_install_flow===!0,a=e.access_scopes?.scopes==null&&e.access_scopes?.required_scopes==null;if(i||n&&a)return["Using legacy install flow - access scopes are not auto-granted"];let o=e.access_scopes?.scopes?e.access_scopes.scopes.split(",").map(r=>r.trim()).join(", "):e.access_scopes?.required_scopes?.join(", ");return o?[`Access scopes auto-granted: ${o}`]:["App has been installed"]},patchWithAppDevURLs:(e,n)=>{n.redirectUrlWhitelist&&(e.auth={redirect_urls:n.redirectUrlWhitelist})}}),Lo=ga;s();var Vn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DevSessionCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"websocketUrl"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSessionCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"assetsUrl"},value:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}}},{kind:"Argument",name:{kind:"Name",value:"websocketUrl"},value:{kind:"Variable",name:{kind:"Name",value:"websocketUrl"}}},{kind:"Argument",name:{kind:"Name",value:"isUnsafe"},value:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSession"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websocketUrl"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"app"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"warnings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var In={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DevSessionUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"manifest"}},type:{kind:"NamedType",name:{kind:"Name",value:"JSON"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"inheritedModuleUids"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSessionUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"assetsUrl"},value:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}}},{kind:"Argument",name:{kind:"Name",value:"manifest"},value:{kind:"Variable",name:{kind:"Name",value:"manifest"}}},{kind:"Argument",name:{kind:"Name",value:"inheritedModuleUids"},value:{kind:"Variable",name:{kind:"Name",value:"inheritedModuleUids"}}},{kind:"Argument",name:{kind:"Name",value:"isUnsafe"},value:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSession"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websocketUrl"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"app"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"warnings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var xn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DevSessionDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSessionDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Rn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FetchStoreByDomain"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"domain"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filters"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopFilterInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"Variable",name:{kind:"Name",value:"filters"}}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"domain"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"externalId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"shortName"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"currentUser"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationPermissions"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var zn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListAppDevStores"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"ListValue",values:[{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"field"},value:{kind:"EnumValue",value:"STORE_TYPE"}},{kind:"ObjectField",name:{kind:"Name",value:"operator"},value:{kind:"EnumValue",value:"EQUALS"}},{kind:"ObjectField",name:{kind:"Name",value:"value"},value:{kind:"StringValue",value:"app_development",block:!1}}]},{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"field"},value:{kind:"EnumValue",value:"STORE_STATUS"}},{kind:"ObjectField",name:{kind:"Name",value:"operator"},value:{kind:"EnumValue",value:"EQUALS"}},{kind:"ObjectField",name:{kind:"Name",value:"value"},value:{kind:"StringValue",value:"ACTIVE",block:!1}}]}]}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"externalId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"shortName"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"currentUser"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationPermissions"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Cn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"DevStoreCapReached"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devStoreCapReached"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var En={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProvisionShopAccess"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OrganizationUserProvisionShopAccessInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationUserProvisionShopAccess"},arguments:[{kind:"Argument",name:{kind:"Name",value:"organizationUserProvisionShopAccessInput"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Un={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ActiveAppReleaseFromApiKey"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"app"},name:{kind:"Name",value:"appByKey"},arguments:[{kind:"Argument",name:{kind:"Name",value:"key"},value:{kind:"Variable",name:{kind:"Name",value:"apiKey"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"AppVersionInfo"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"AppVersionInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"App"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"organizationId"}},{kind:"Field",name:{kind:"Name",value:"activeRoot"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientCredentials"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"secrets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"grantedShopifyApprovalScopes"}}]}},{kind:"Field",name:{kind:"Name",value:"activeRelease"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}}]}}]}}]}}]}}]};s();var ye={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ReleaseVersion"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"versionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appReleaseCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"versionId"},value:{kind:"Variable",name:{kind:"Name",value:"versionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"release"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Pn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAppVersion"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"version"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AppVersionInput"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"metadata"}},type:{kind:"NamedType",name:{kind:"Name",value:"VersionMetadataInput"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appVersionCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"version"},value:{kind:"Variable",name:{kind:"Name",value:"version"}}},{kind:"Argument",name:{kind:"Name",value:"metadata"},value:{kind:"Variable",name:{kind:"Name",value:"metadata"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"versionTag"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}}]};s();var qn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAssetURL"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sourceExtension"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SourceExtension"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appRequestSourceUploadUrl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sourceExtension"},value:{kind:"Variable",name:{kind:"Name",value:"sourceExtension"}}},{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sourceUploadUrl"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var On={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppVersionById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"versionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"version"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"versionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VersionInfo"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"VersionInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Version"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}}]}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}}]}}]}}]};s();var Ln={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppVersions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"app"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"activeRelease"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"versions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"20"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"createdBy"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"versionsCount"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Mn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppInstallCount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"app"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"installCount"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var $n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateApp"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"initialVersion"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AppVersionInput"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"initialVersion"},value:{kind:"Variable",name:{kind:"Name",value:"initialVersion"}}},{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"app"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"activeRoot"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientCredentials"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"secrets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Hn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"fetchSpecifications"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"specifications"},arguments:[{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"features"}},{kind:"Field",name:{kind:"Name",value:"uidStrategy"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"appModuleLimit"}},{kind:"Field",name:{kind:"Name",value:"isClientProvided"}}]}},{kind:"Field",name:{kind:"Name",value:"validationSchema"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"jsonSchema"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Bn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"listApps"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appsConnection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"activeRelease"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var jn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"organizations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Wn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"availableTopics"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"availableTopics"},arguments:[{kind:"Argument",name:{kind:"Name",value:"apiVersion"},value:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}}}]}]}}]};s();var Kn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CliTesting"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"address"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiKey"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"deliveryMethod"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sharedSecret"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"topic"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cliTesting"},arguments:[{kind:"Argument",name:{kind:"Name",value:"address"},value:{kind:"Variable",name:{kind:"Name",value:"address"}}},{kind:"Argument",name:{kind:"Name",value:"apiKey"},value:{kind:"Variable",name:{kind:"Name",value:"apiKey"}}},{kind:"Argument",name:{kind:"Name",value:"apiVersion"},value:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}}},{kind:"Argument",name:{kind:"Name",value:"deliveryMethod"},value:{kind:"Variable",name:{kind:"Name",value:"deliveryMethod"}}},{kind:"Argument",name:{kind:"Name",value:"sharedSecret"},value:{kind:"Variable",name:{kind:"Name",value:"sharedSecret"}}},{kind:"Argument",name:{kind:"Name",value:"topic"},value:{kind:"Variable",name:{kind:"Name",value:"topic"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"headers"}},{kind:"Field",name:{kind:"Name",value:"samplePayload"}},{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"errors"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Gn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Yn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SchemaDefinitionByTarget"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"handle"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"version"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"target"},arguments:[{kind:"Argument",name:{kind:"Name",value:"handle"},value:{kind:"Variable",name:{kind:"Name",value:"handle"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"api"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"schema"},arguments:[{kind:"Argument",name:{kind:"Name",value:"version"},value:{kind:"Variable",name:{kind:"Name",value:"version"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Jn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SchemaDefinitionByApiType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"version"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"api"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"schema"},arguments:[{kind:"Argument",name:{kind:"Name",value:"version"},value:{kind:"Variable",name:{kind:"Name",value:"version"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();s();s();var M;(function(e){e.CustomersRedact="customers/redact",e.CustomersDataRequest="customers/data_request",e.ShopRedact="shop/redact"})(M||(M={}));var Zn=t.object({topics:t.array(t.string({invalid_type_error:"Values within array must be a string"}),{invalid_type_error:"Value must be string[]"}).optional(),actions:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),uri:t.preprocess(e=>I(e),_,{required_error:"Missing value at"}),include_fields:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),filter:t.string({invalid_type_error:"Value must be a string"}).optional(),payload_query:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).optional(),name:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).max(50).optional(),compliance_topics:t.array(t.enum([M.CustomersRedact,M.CustomersDataRequest,M.ShopRedact]),{invalid_type_error:"Value must be an array containing values: customers/redact, customers/data_request or shop/redact"}).optional()});s();function Qn(e,n){let i=Na(e);if(i)return n.addIssue(i),t.NEVER}function Na(e){let{subscriptions:n=[]}=e,i=new Set,a=[];if(!n.length)return;if(e.privacy_compliance&&e.subscriptions?.some(r=>r.compliance_topics))return{code:t.ZodIssueCode.custom,message:"The privacy_compliance section can't be used if there are subscriptions including compliance_topics"};let o=n.flatMap(r=>r.compliance_topics).filter(Boolean);if(C(o).length!==o.length)return{code:t.ZodIssueCode.custom,message:"You can\u2019t have multiple subscriptions with the same compliance topic",fatal:!0,path:["subscriptions"]};for(let[r,{uri:m,topics:d=[],compliance_topics:l=[],filter:p=""}]of n.entries()){let k=["subscriptions",r];if(!d.length&&!l.length)return{code:t.ZodIssueCode.custom,message:"Either topics or compliance_topics must be added to the webhook subscription",path:k};d.forEach(u=>{let v=`${u}::${m}::${p}`;if(i.has(v)){let g=p?pe.dim(`
10
+
11
+ topic: ${u}
12
+ uri: ${m}
13
+ filter: ${p}`):pe.dim(`
14
+
15
+ topic: ${u}
16
+ uri: ${m}`);a.push(g)}i.add(v)})}if(a.length>0){let r=a.join("");return{code:t.ZodIssueCode.custom,message:`Multiple subscriptions with the exact same topic, uri, and filter. To resolve, remove or edit the duplicates ${r}`,path:["subscriptions"]}}}s();function ei(e){let n=U(e,"webhooks");if(!n)return e;let{api_version:i}=n;return{api_version:i}}function ni(e){let n={},i=U(e,"api_version");return n={...i?{webhooks:{api_version:i}}:{}},n}function ii(e){if(e.length===0)return;let n=e.filter(r=>r.topics!==void 0).flatMap(({compliance_topics:r,topics:m,...d})=>ai(m)?.map(p=>({topics:[p],...d}))??[]),i=e.filter(r=>r.topics===void 0||r.compliance_topics!==void 0).map(({compliance_topics:r,topics:m,...d})=>({compliance_topics:r,...d})),a=ya(i,"compliance_topics"),o=Sa(a);return[...Xn(o),...Xn(n)]}function ai(e){return e?.sort((n,i)=>n.localeCompare(i))}function Xn(e){return e.sort((n,i)=>n.uri.localeCompare(i.uri))}function Sa(e){return e.forEach(n=>n.compliance_topics=ai(n.compliance_topics)),e}function ha(e,n){return e.find(i=>i.uri===n.uri&&Ye(i.include_fields??[],n.include_fields??[])&&i.filter===n.filter)}function ya(e,n){return e.reduce((i,a)=>{let o=ha(i,a);return o?n&&a?.[n]?.length?o[n]?.push(...a[n]):(a.topics&&(o.topics??=[],o.topics.push(...a.topics)),a.compliance_topics&&(o.compliance_topics??=[],o.compliance_topics.push(...a.compliance_topics))):i.push(a),i},[])}var ba=t.object({api_version:t.string({required_error:"String is required"}),privacy_compliance:t.object({customer_deletion_url:_.optional(),customer_data_request_url:_.optional(),shop_deletion_url:_.optional()}).optional(),subscriptions:t.array(Zn).optional().transform(e=>ii(e??[]))}),ti=F.extend({webhooks:ba.superRefine(Qn)});var be="webhooks",Fa={forward:ei,reverse:e=>ni(e)},_a=h({identifier:be,schema:ti,transformConfig:Fa}),ts=_a;s();var oi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppVersionByTag"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"versionTag"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"versionByTag"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"tag"},value:{kind:"Variable",name:{kind:"Name",value:"versionTag"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VersionInfo"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"VersionInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Version"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}}]}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}}]}}]}}]};s();var ri={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AppLogsSubscribe"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopIds"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appLogsSubscribe"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopIds"},value:{kind:"Variable",name:{kind:"Name",value:"shopIds"}}},{kind:"Argument",name:{kind:"Name",value:"apiKey"},value:{kind:"Variable",name:{kind:"Name",value:"apiKey"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"jwtToken"}},{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"errors"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Fe="webhook_subscription",Da=t.object({topic:t.string(),actions:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),api_version:t.string(),uri:t.preprocess(I,_,{required_error:"Missing value at"}),include_fields:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),filter:t.string({invalid_type_error:"Value must be a string"}).optional(),payload_query:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).optional(),name:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).max(50).optional()});function Aa(e){let{api_version:n,topic:i,...a}=e;return{webhooks:{subscriptions:[{topics:[i],...a}]}}}var Ta={forward:(e,n)=>{let i=e,a;return"application_url"in n&&(a=n?.application_url),{...i,uri:ee(i.uri,a)}},reverse:Aa},wa=h({identifier:Fe,schema:Da,transformConfig:Ta,uidStrategy:"dynamic"}),vs=wa;s();s();s();function x(e={}){return{type:"token_refresh",handler:async()=>({token:await D([],{noPrompt:e.noPrompt,allowAutomationToken:!0})})}}function Va(e){if(typeof e!="object"||e===null)return!1;let{statusCode:n,response:i}=e,a=n??i?.status;return a===401||a===403}var ne=class extends c{constructor(n){let i=n.businessName??`organization ${n.id}`,a="in the Shopify admin under Settings > Users > Security";Ge()?super(`This service account can't manage dev stores in ${i}.`,null,[`Give the service account Dev store management access ${a}.`,"Or use a token from a service account that has that access."]):J()?super(`This automation token can't manage dev stores in ${i}.`,null,[`Create a service account with Dev store management access ${a}.`,"Set its token in the SHOPIFY_SERVICE_ACCOUNT_TOKEN environment variable."]):super(`You don't have permission to manage dev stores in ${i}.`,null,["Check that you're logged in to the right account.","Or ask an organization admin for access."])}};async function ie(e,n){try{return await w({...n,organizationId:e.id})}catch(i){throw Va(i)?new ne(e):i}}s();var si={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindOrganization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OrganizationID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var di={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListOrganizations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"organizationsWithAccessToDestination"},arguments:[{kind:"Argument",name:{kind:"Name",value:"destination"},value:{kind:"EnumValue",value:"APPS_CLI"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"shopCount"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();function R(e){let n=e.match(/\/(\d+)$/);return n?n[1]:void 0}function ae(e){return R(Buffer.from(e,"base64").toString("utf8"))}function $(e){return Buffer.from(e).toString("base64")}async function H(){return(await li()).organizations}async function Ia(e){return li(e)}async function _e(e,n,i){let a=n??await D([],{allowAutomationToken:!0}),r=(await T({query:si,token:a,variables:{organizationId:xa(e)},unauthorizedHandler:i??x(),cacheOptions:{cacheTTL:{hours:6},cacheExtraKey:Le(a)}})).currentUserAccount?.organization;if(r)return{id:e,businessName:r.name}}function xa(e){let n=e.startsWith("gid://")?R(e):e;if(n===void 0||!/^\d+$/.test(n))throw new c(`Invalid organization ID: ${e}`);return $(`gid://organization/Organization/${n}`)}async function li(e){let n=e??await D([],{allowAutomationToken:!0}),i=await T({query:di,token:n,unauthorizedHandler:x()});return i.currentUserAccount?{organizations:i.currentUserAccount.organizationsWithAccessToDestination.nodes.map(o=>{let r=ae(o.id);if(r===void 0)throw new c(`Failed to decode organization ID from: ${o.id}`);return{id:r,businessName:o.name,status:o.status,shopCount:o.shopCount??null,url:o.url}}),currentUserResolved:!0}:{organizations:[],currentUserResolved:!1}}s();s();async function De(e){if(e.length===1)return e[0];let i=new Set(e.map(o=>o.businessName)).size<e.length,a=await tn({message:"Which organization do you want to use?",choices:e.map(o=>({label:i?`${o.businessName} (${o.id})`:o.businessName,value:o.id}))});return e.find(o=>o.id===a)}async function Ra(e){let n=await H();if(n.length===0)throw new c("No organizations found.","Make sure you have access to a Shopify organization.");if(e){let i=n.find(a=>a.id===e);if(!i)throw new c(`Organization with ID ${e} not found.`,`Available organizations: ${n.map(a=>`${a.businessName} (${a.id})`).join(", ")}`);return i}return De(n)}s();var za=["ACTIVE","LOCKED"];s();s();var Ae={basic:"BASIC_APP_DEVELOPMENT",grow:"PROFESSIONAL_APP_DEVELOPMENT",advanced:"UNLIMITED_APP_DEVELOPMENT",plus:"SHOPIFY_PLUS_APP_DEVELOPMENT"},z=Object.keys(Ae);s();s();var B=t.object({id:t.string(),name:t.string(),subdomain:t.string(),country:t.string().optional(),type:t.string().optional(),authScopes:t.array(t.string()).optional(),plan:t.string().optional(),organizationId:t.string(),organizationName:t.string()}),te=t.object({id:t.string(),name:t.string()});var mi=B.pick({name:!0}).extend({domain:B.shape.subdomain,adminUrl:t.string().nullish(),plan:t.enum(z),featurePreview:t.string().optional(),country:B.shape.country,demoData:t.boolean()}),Te=Ee({name:"CreateDevStoreResult",schema:t.object({store:mi,organization:te}),definitions:{CreatedDevStore:mi,StoreOrganization:te}});s();var ui={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"country"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopName"},value:{kind:"Variable",name:{kind:"Name",value:"shopName"}}},{kind:"Argument",name:{kind:"Name",value:"priceLookupKey"},value:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}}},{kind:"Argument",name:{kind:"Name",value:"prepopulateTestData"},value:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}}},{kind:"Argument",name:{kind:"Name",value:"developerPreviewHandle"},value:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}}},{kind:"Argument",name:{kind:"Name",value:"country"},value:{kind:"Variable",name:{kind:"Name",value:"country"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopAdminUrl"}},{kind:"Field",name:{kind:"Name",value:"shopDomain"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var ci={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PollStoreCreation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"storeCreation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopDomain"},value:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Ca=2,Ea=300*1e3;function Ua(e){switch(e){case"CALLING_CORE":return"Initiating store creation";case"AWAITING_CORE_STORE_READY":return"Waiting for store to be ready";case"FINALIZING":return"Finalizing store setup";case"COMPLETE":return"Store creation complete!";case"FAILED":return"Store creation failed.";case"TIMED_OUT":return"Store creation timed out.";case"USER_ERROR":return"Store creation encountered a user error.";default:return`Store creation status: ${e}`}}async function Pa(e){let{organization:n,name:i,plan:a}=e,o=await D([],{allowAutomationToken:!0}),r=x(),d=(await ie(n,{query:ui,token:o,variables:{shopName:i,priceLookupKey:Ae[a],prepopulateTestData:e.withDemoData??!1,developerPreviewHandle:e.featurePreview,country:e.country},unauthorizedHandler:r})).createAppDevelopmentStore;if(!d)throw new c("Store creation failed: unexpected empty response.");let l=d.userErrors;if(l&&l.length>0){let u=l.map(v=>v.message).join(", ");throw new c(`Failed to create dev store: ${u}`)}let{shopDomain:p,shopAdminUrl:k}=d;if(!p)throw new c("Store creation succeeded but no shop domain was returned.");if(await on({title:P`Waiting for store to be ready`,task:async u=>{let v=Date.now();for(;;){if(Date.now()-v>Ea)throw new c("Store creation timed out after 5 minutes.");let N=(await ie(n,{query:ci,token:o,variables:{shopDomain:p},unauthorizedHandler:r})).organization?.storeCreation?.status;if(!N)throw new c("Unable to determine store creation status.");if(N==="COMPLETE")return;if(N==="FAILED"||N==="TIMED_OUT"||N==="USER_ERROR")throw new c(`Store creation failed with status: ${N}`);u(P`${Ua(N)}`),await sn(Ca)}},renderOptions:{stdout:process.stderr}}),e.json)mn(Te.encode({store:{name:i,domain:p,adminUrl:k,plan:a,...e.featurePreview?{featurePreview:e.featurePreview}:{},...e.country?{country:e.country}:{},demoData:e.withDemoData??!1},organization:{id:n.id,name:n.businessName}}));else if(e.summary!==!1){let u=[];j(u,"Domain",p),u.push(["Admin",k?{link:{label:k,url:k}}:"N/A"]),j(u,"Plan",a),j(u,"Feature preview",e.featurePreview),j(u,"Country",e.country),j(u,"Demo data",e.withDemoData?"enabled":"disabled"),en({headline:`Dev store "${i}" created successfully.`,customSections:[{body:{tabularData:u,firstColumnSubdued:!0}}]})}return p}function j(e,n,i){i!=null&&i!==""&&e.push([n,i])}s();var qa={basic:"Basic",grow:"Grow",advanced:"Advanced",plus:"Plus"};function Oa(){return rn({message:"Name for the new dev store"})}function La(){return nn({message:"Which Shopify plan do you want to use?",choices:z.map(e=>({label:qa[e],value:e}))})}function Ma(){return an({message:"Populate the store with demo data?",confirmationMessage:"Yes, add demo data",cancellationMessage:"No, start with an empty store",defaultValue:!0})}s();s();var pi=(e,n,i)=>{let a=new URL(e);return n&&a.searchParams.append("cursor",n),i?.status&&a.searchParams.append("status",i.status),i?.source&&a.searchParams.append("source",i.source),a.toString()};var ki=W(Z()),$a=new ki.default({minTime:150,maxConcurrent:10});async function Ha(e){let n="App Management",a=`https://${await y()}/app_management/unstable/graphql.json`;return{token:e,api:n,url:a,responseOptions:{onResponse:Ve}}}var we=e=>Me(e),vi=async(e,n,i)=>{let o=`https://${await y()}/app_management/unstable/organizations/${e}/app_logs/poll`;return pi(o,n,i)},fi=async(e,n)=>`https://${await y()}/app_management/unstable/organizations/${encodeURIComponent(e)}/apps/${encodeURIComponent(n)}/channel_spec_export.json`;async function gi(e){let n=e.cacheOptions?.cacheExtraKey??"",i=e.cacheOptions?{...e.cacheOptions,cacheExtraKey:n}:void 0;return $a.schedule(async()=>b({...await Ha(e.token),query:e.query,variables:e.variables,cacheOptions:i,preferredBehaviour:e.requestOptions?.requestMode,unauthorizedHandler:e.unauthorizedHandler}))}function Ve(e){if(!e.extensions)return;let n=[];for(let i of e.extensions.deprecations)i.supportedUntilDate&&n.push(new Date(i.supportedUntilDate));Ze(n)}s();var Ni=W(Z()),Ba=new Ni.default({minTime:150,maxConcurrent:10});async function Si(e){let n="App Dev",i=E(e.shopFqdn),o=`https://${await je(i)}/app_dev/unstable/graphql.json`,r=Be()==="local"?{"x-forwarded-host":i}:void 0;return Ba.schedule(()=>b({query:e.query,api:n,url:o,token:e.token,addedHeaders:r,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler,preferredBehaviour:e.requestOptions?.requestMode}))}s();var hi=W(Z()),ja=new hi.default({minTime:150,maxConcurrent:10});async function Wa(e,n,i){let a="Functions",r=`https://${await y()}/functions/unstable/organizations/${e}/${i}/graphql`;return{token:n,api:a,url:r,responseOptions:{onResponse:Ve}}}async function yi(e){return await ja.schedule(async()=>b({...await Wa(e.organizationId,e.token,e.appId),query:e.query,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler}))}s();var bi=W(Z()),Ka=new bi.default({minTime:150,maxConcurrent:10});async function Fi(e){let n="Webhooks",a=`https://${await y()}/webhooks/unstable/organizations/${e.organizationId}/graphql.json`;return Ka.schedule(()=>b({query:e.query,api:n,url:a,token:e.token,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler}))}import{randomUUID as Ga}from"crypto";var _i="https://cdn.shopify.com/static/cli/extensions/templates.json",Ya=Ga(),Ja=t.object({statusCode:t.literal(200),errors:t.array(t.object({path:t.tuple([t.literal("versionByTag")]),extensions:t.object({app_errors:t.object({errors:t.array(t.object({category:t.literal("not_found")})).nonempty()})})})).nonempty()}),re=class e{static instance;static getInstance(n){return e.instance??=new e(n),e.instance}static resetInstance(){e.instance=void 0}clientName=se.AppManagement;webUiName="Developer Dashboard";organizationSource=Q.BusinessPlatform;bundleFormat="br";_session;constructor(n){this._session=n}async subscribeToAppLogs(n,i){return this.appManagementRequest({query:ri,variables:{shopIds:n.shopIds,apiKey:n.apiKey}})}async appLogs(n,i){let a=await st({organizationId:i,jwtToken:n.jwtToken,cursor:n.cursor,filters:n.filters});try{let o=await a.json();return a.ok?{app_logs:o.app_logs??[],cursor:o.cursor,status:a.status}:{errors:o.errors??[`Request failed with status ${a.status}`],status:a.status}}catch(o){return{errors:[`Failed to parse response: ${o}`],status:a.status}}}async channelSpecExport(n){let i=R(n.id)??n.id,a=await fi(n.organizationId,i),o=await le(a,{method:"GET",headers:we(await this.token())}),r;try{r=await o.json()}catch{r=void 0}let m=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:void 0;return o.ok&&m?{ok:!0,status:o.status,body:m}:{ok:!1,status:o.status,body:m}}async session(){if(!this._session){if(dn())throw new Error("AppManagementClient.session() should not be invoked dynamically in a unit test");let n=await ue(),{appManagementToken:i,businessPlatformToken:a,userId:o}=n,r=await T({query:jn,cacheOptions:{cacheTTL:{hours:6},cacheExtraKey:o},token:a,unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")});if(J()&&r.currentUserAccount){let m=r.currentUserAccount.organizations.nodes.map(d=>({name:d.name}));if(m.length>1)throw new A("Multiple organizations found for the CLI token");this._session={token:i,businessPlatformToken:a,accountInfo:{type:"ServiceAccount",orgName:m[0]?.name??"Unknown organization"},userId:o}}else r.currentUserAccount?this._session={token:i,businessPlatformToken:a,accountInfo:{type:"UserAccount",email:r.currentUserAccount.email},userId:o}:this._session={token:i,businessPlatformToken:a,accountInfo:{type:"UnknownAccount"},userId:o}}return this._session}async token(){return(await this.session()).token}async businessPlatformToken(){return(await this.session()).businessPlatformToken}async unsafeRefreshToken(){let n=await ue({noPrompt:!0,forceRefresh:!0}),i=await this.session();return i.token=n.appManagementToken,i.businessPlatformToken=n.businessPlatformToken,i.token}async accountInfo(){return(await this.session()).accountInfo}async appFromIdentifiers(n){let{app:i}=await this.activeAppVersionRawResult(n);if(!i)return;let{name:a,appModules:o}=i.activeRelease.version,r=o.find(d=>d.specification.externalIdentifier==="app_home"),m=i.activeRoot.clientCredentials.secrets.map(d=>({secret:d.key}));return{id:i.id,title:a,apiKey:i.key,apiSecretKeys:m,organizationId:String(f(i.organizationId)),grantedScopes:i.activeRoot.grantedShopifyApprovalScopes,applicationUrl:r?.config?.app_url,embedded:r?.config?.embedded,flags:[],developerPlatformClient:this}}async organizations(){return(await H()).map(i=>({...i,source:this.organizationSource}))}async orgFromId(n){let i=await _e(n,await this.businessPlatformToken(),this.createUnauthorizedHandler("businessPlatform"));if(i)return{...i,source:this.organizationSource}}async orgAndApps(n){let[i,{apps:a,hasMorePages:o}]=await Promise.all([this.orgFromId(n),this.appsForOrg(n)]);if(!i){let{accountInfo:r}=await this.session();throw new V(r,n)}return{organization:i,apps:a,hasMorePages:o}}async appsForOrg(n,i=""){let a=Bn,o={query:i.split(" ").filter(d=>d).map(d=>`title:${d}`).join(" "),organizationId:n},r=await this.appManagementRequest({query:a,variables:o});if(!r.appsConnection)throw new A("Server failed to retrieve apps");return{apps:r.appsConnection.edges.map(d=>{let l=d.node;return{id:l.id,apiKey:l.key,title:l.activeRelease.version.name,organizationId:n}}),hasMorePages:r.appsConnection.pageInfo.hasNextPage}}async specifications({organizationId:n}){let i=Hn,a={organizationId:Ie(n)};return(await this.appManagementRequest({query:i,variables:a})).specifications.map(r=>({name:r.name,externalName:r.name,identifier:r.identifier,externalIdentifier:r.externalIdentifier,gated:!1,managementExperience:"cli",registrationLimit:r.uidStrategy.appModuleLimit,uidStrategy:rt(r.uidStrategy.__typename),experience:xe(r.experience,r.identifier),validationSchema:r.validationSchema}))}async templateSpecifications({organizationId:n},i={}){let a,{templatesJsonPath:o}=fn,r=process.env[o];if(r){if(!await qe(r))throw new c("There is no file at the path specified for template specifications");let u=await Pe(r);a=JSON.parse(u)}else try{a=await(await He(_i)).json()}catch{throw new c(["Failed to fetch extension templates from",{link:{url:_i}},{char:"."},"This likely means a problem with your internet connection."])}let m=0,d=i.requestedTemplate?a.filter(u=>u.identifier===i.requestedTemplate):void 0,l=d&&d.length>0?d:a,p=(await ot(l,async u=>this.organizationBetaFlags(n,u),async u=>this.organizationExpFlags(n,u))).map(u=>({...u,sortPriority:m++})),k=[];for(let u of a)u.group&&!k.includes(u.group)&&k.push(u.group);return{templates:p,groupOrder:k}}async createApp(n,i){let o=(await this.apiVersions(n.id)).publicApiVersions.filter(u=>u!=="unstable").sort().at(-1)??"unstable",r=Xa(i,n.id,o),m=$n,d=await this.appManagementRequest({query:m,variables:r});if(!d.appCreate.app||d.appCreate.userErrors?.length>0){let u=d.appCreate.userErrors.map(v=>v.message).join(", ");throw new c(u)}let l=Ii([]),p=d.appCreate.app,k=p.activeRoot.clientCredentials.secrets.map(u=>({secret:u.key}));return{...p,title:i.name,apiKey:p.key,apiSecretKeys:k,grantedScopes:i?.scopesArray??[],organizationId:n.id,newApp:!0,flags:l,developerPlatformClient:this}}async devStoresForOrg(n,i){let a=await this.businessPlatformOrganizationsRequest({query:zn,organizationId:String(f(n)),variables:{searchTerm:i}}),o=a.organization;if(!o)throw new c("No organization found");let r=o.accessibleShops?.edges.map(d=>d.node)??[],m=Vi(o.currentUser?.organizationPermissions??[]);return{stores:Ai(r,m),hasMorePages:a.organization?.accessibleShops?.pageInfo.hasNextPage??!1}}async devStoreCapReached(n){return(await this.businessPlatformOrganizationsRequest({query:Cn,organizationId:String(f(n)),variables:{}})).organization?.devStoreCapReached??!1}async appExtensionRegistrations(n,i){let a=i??await this.activeAppVersion(n),o=[],r=[],m=[];return a.appModuleVersions.forEach(d=>{let l={id:d.registrationId,uuid:d.registrationUuid,title:d.handle,type:d.type,activeVersion:d.config?{config:JSON.stringify(d.config),...d.target&&{context:d.target}}:void 0};d.specification?.experience==="configuration"?o.push(l):d.specification?.options?.managementExperience==="dashboard"?m.push(l):r.push(l)}),{app:{dashboardManagedExtensionRegistrations:m,configurationRegistrations:o,extensionRegistrations:r}}}async appVersions({id:n,organizationId:i,title:a}){let o=Ln,r={appId:n},m=await this.appManagementRequest({query:o,variables:r});return m.app?{app:{id:m.app.id,organizationId:i,title:a,appVersions:{nodes:m.app.versions?.edges.map(d=>{let l=d.node;return{createdAt:l.createdAt,createdBy:{displayName:l.createdBy},versionTag:l.metadata.versionTag,status:l.id===m.app.activeRelease.version.id?"active":"inactive",versionId:l.id,message:l.metadata.message}})??[],pageInfo:{totalResults:m.app.versionsCount}}}}:{app:null}}async appInstallCount({id:n}){let i=Mn,a={appId:n};return(await this.appManagementRequest({query:i,variables:a})).app.installCount??0}async appVersionByTag({id:n,organizationId:i},a){let o=oi,r={appId:n,versionTag:a},d=(await this.appManagementRequest({query:o,variables:r}).catch(l=>{throw Ja.safeParse(l).success?new O(a):l})).versionByTag;if(!d)throw new O(a);return{id:parseInt(d.id,10),uuid:d.id,versionTag:d.metadata.versionTag,location:[await oe({organizationId:i,id:n}),"versions",f(d.id)].join("/"),message:d.metadata.message??"",appModuleVersions:d.appModules.map(Ti)}}async appVersionsDiff(n,{versionId:i}){let a={versionId:i},[o,r]=await Promise.all([this.activeAppVersionRawResult(n.apiKey),this.appManagementRequest({query:On,variables:a})]),m=o.app.activeRelease.version.appModules,d=r.version.appModules,{added:l,removed:p,updated:k}=tt({currentModules:m,selectedVersionModules:d});function u(v){return{uuid:v.uuid,handle:v.handle,specification:{identifier:v.specification.identifier,experience:xe(v.specification.experience,v.specification.identifier),options:{managementExperience:"cli"}}}}return{app:{versionsDiff:{added:l.map(u),updated:k.map(u),removed:p.map(u)}}}}async activeAppVersion(n){let i=await this.activeAppVersionRawResult(n.apiKey);return{appModuleVersions:i.app.activeRelease.version.appModules.map(Ti),...i.app.activeRelease}}async generateSignedUploadUrl({apiKey:n,organizationId:i}){let a={sourceExtension:"BR",organizationId:Ie(i)},o=await this.appManagementRequest({query:qn,variables:a,cacheOptions:{cacheTTL:{minutes:59},cacheExtraKey:`${n}-${Ya}`}});return{assetUrl:o.appRequestSourceUploadUrl.sourceUploadUrl,userErrors:o.appRequestSourceUploadUrl.userErrors}}async deploy({appManifest:n,appId:i,organizationId:a,versionTag:o,message:r,commitReference:m,bundleUrl:d,skipPublish:l}){let u={appId:i,version:d?{sourceUrl:d}:{source:n},metadata:{versionTag:o,message:r,sourceControlUrl:m}},v=await this.appManagementRequest({query:Pn,variables:u,requestOptions:{requestMode:"slow-request"}}),{version:g}=v.appVersionCreate,N=v.appVersionCreate.userErrors.map(wi)??[];if(!g)return{appDeploy:{userErrors:N}};let S={appDeploy:{appVersion:{uuid:g.id,id:parseInt(g.id,10),versionTag:g.metadata.versionTag,location:await at(a,i,g.id),appModuleVersions:g.appModules.map(ze=>({uuid:ze.uuid,registrationUuid:ze.uuid,validationErrors:[]})),message:g.metadata.message},userErrors:N}};if(l)return S;let zi={appId:i,versionId:g.id},de=await this.appManagementRequest({query:ye,variables:zi});return de.appReleaseCreate.userErrors&&(S.appDeploy.userErrors=(S.appDeploy.userErrors??[]).concat(de.appReleaseCreate.userErrors.map(wi))),!de.appReleaseCreate.release&&S.appDeploy.userErrors.length===0&&S.appDeploy.userErrors.push({message:"The API did not return a release for the created app version.",category:"",details:[]}),S}async release({app:{id:n,organizationId:i},version:{versionId:a}}){let o={appId:n,versionId:a},r=await this.appManagementRequest({query:ye,variables:o});if(r.appReleaseCreate.release&&!r.appReleaseCreate.userErrors?.length)return{appRelease:{appVersion:{versionTag:r.appReleaseCreate.release.version.metadata.versionTag,message:r.appReleaseCreate.release.version.metadata.message,location:[await oe({organizationId:i,id:n}),"versions",f(r.appReleaseCreate.release.version.id).toString()].join("/")}}};if(!r.appReleaseCreate.userErrors?.length)throw new c("The Developer Dashboard did not confirm the app version release.");return{appRelease:{userErrors:r.appReleaseCreate.userErrors?.map(m=>({field:m.field,message:m.message,category:m.category,details:[],on:m.on}))??[]}}}async storeByDomain(n,i,a){let r=(await Promise.all(a.map(l=>this.businessPlatformOrganizationsRequest({query:Rn,organizationId:String(f(n)),variables:{domain:i,filters:dt(l)}})))).map(l=>l.organization).filter(l=>l!=null);if(r.length===0)throw new c("No organization found");let m=r.flatMap(l=>{let p=l.accessibleShops?.edges.map(u=>u.node)??[],k=Vi(l.currentUser?.organizationPermissions??[]);return Ai(p,k)}),d=E(i);return m.find(l=>l.shopDomain===d)}async ensureUserAccessToStore(n,i){if(!i.provisionable)return;let o={input:{shopifyShopId:nt(i.shopId)}},m=(await w({query:En,token:await this.businessPlatformToken(),organizationId:String(f(n)),variables:o,unauthorizedHandler:this.createUnauthorizedHandler()})).organizationUserProvisionShopAccess;if(!m.success){let d=m.userErrors?.map(l=>l.message).join(", ")??"";throw new A(`Failed to provision user access to store: ${d}`)}}async sendSampleWebhook(n,i){let a=Kn,o={address:n.address,apiKey:n.api_key,apiVersion:n.api_version,deliveryMethod:n.delivery_method,sharedSecret:n.shared_secret,topic:n.topic},r=await this.webhooksRequest({organizationId:i,query:a,variables:o}),m={samplePayload:"{}",headers:"{}",success:!1,userErrors:[]},d=r.cliTesting;return d&&(m={samplePayload:d.samplePayload??"{}",headers:d.headers??"{}",success:d.success,userErrors:d.errors.map(l=>({message:l,fields:[]}))}),{sendSampleWebhook:m}}async apiVersions(n){return{publicApiVersions:(await this.webhooksRequest({organizationId:n,query:Gn,variables:{}})).publicApiVersions.map(a=>a.handle)}}async topics({api_version:n},i){let a=Wn,o={apiVersion:n};return{webhookTopics:(await this.webhooksRequest({organizationId:i,query:a,variables:o})).availableTopics??[]}}async updateURLs(n){return ke("\u26A0\uFE0F updateURLs is not implemented"),{appUpdate:{userErrors:[]}}}async targetSchemaDefinition(n,i,a){try{let{app:o}=await this.activeAppVersionRawResult(i),r=String(f(o.id));return(await this.functionsRequest({organizationId:a,query:Yn,appId:r,variables:{handle:n.handle,version:n.version}}))?.target?.api?.schema?.definition??null}catch(o){throw new c(`Failed to fetch schema definition: ${o}`)}}async apiSchemaDefinition(n,i,a){try{let{app:o}=await this.activeAppVersionRawResult(i),r=String(f(o.id));return(await this.functionsRequest({organizationId:a,query:Jn,appId:r,variables:n}))?.api?.schema?.definition??null}catch(o){throw new c(`Failed to fetch schema definition: ${o}`)}}toExtensionGraphQLType(n){return n.toLowerCase()}async appDeepLink({id:n,organizationId:i}){return oe({id:n,organizationId:i})}async devSessionCreate({appId:n,assetsUrl:i,shopFqdn:a,websocketUrl:o,unsafeValidation:r}){let m=String(f(n));return this.appDevRequest({query:Vn,shopFqdn:a,variables:{appId:m,assetsUrl:i??"",websocketUrl:o,unsafeValidation:r??!1},requestOptions:{requestMode:"slow-request"}})}async devSessionUpdate({appId:n,assetsUrl:i,shopFqdn:a,manifest:o,inheritedModuleUids:r,unsafeValidation:m}){let l={appId:String(f(n)),assetsUrl:i,manifest:JSON.stringify(o),inheritedModuleUids:r,unsafeValidation:m??!1};return this.appDevRequest({query:In,shopFqdn:a,variables:l})}async devSessionDelete({appId:n,shopFqdn:i}){let a=String(f(n));return this.appDevRequest({query:xn,shopFqdn:i,variables:{appId:a}})}async getCreateDevStoreLink(n){let i=`https://${await me()}/dashboard/${n.id}/stores`;return[`Looks like you don't have any dev stores associated with ${n.businessName}'s Dev Dashboard.`,{link:{url:i,label:"Create a store in Dev Dashboard"}}]}async activeAppVersionRawResult(n){return this.appManagementRequest({query:Un,variables:{apiKey:n}})}async organizationBetaFlags(n,i){let a={organizationId:Di(n)},o=await Qe({query:pn(i),token:await this.businessPlatformToken(),organizationId:n,variables:a,unauthorizedHandler:this.createUnauthorizedHandler()}),r={};return i.forEach(m=>{r[m]=!!o.organization[`flag_${m}`]}),r}async organizationExpFlags(n,i){let a={organizationId:Di(n),flagHandles:i},o=await w({query:kn,token:await this.businessPlatformToken(),organizationId:n,variables:a,unauthorizedHandler:this.createUnauthorizedHandler()}),r={},m=o.organization?.enabledFlags??[];return i.forEach((d,l)=>{r[d]=!!m[l]}),r}async appManagementRequest(n){return gi({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async appDevRequest(n){return Si({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async businessPlatformRequest(n){return T({...n,token:await this.businessPlatformToken(),unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")})}async businessPlatformOrganizationsRequest(n){return w({...n,token:await this.businessPlatformToken(),unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")})}async functionsRequest(n){return yi({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async webhooksRequest(n){return Fi({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}createUnauthorizedHandler(n="default"){return xi(this,n)}},Za="https://shopify.dev/apps/default-app-home",Qa="https://shopify.dev/apps/default-app-home/api/auth";function Xa(e,n,i){let{isLaunchable:a,scopesArray:o,name:r}=e;return{initialVersion:{source:{source:{name:r,modules:[{type:Ne,config:{app_url:a?"https://example.com":Za,embedded:!0}},{type:Se,config:{name:r}},{type:be,config:{api_version:i}},{type:he,config:{redirect_url_allowlist:[a?"https://example.com/api/auth":Qa],...o&&{scopes:o.map(p=>p.trim()).join(",")}}}]}}.source},organizationId:Ie(n)}}function et(e){let n=e.startsWith("gid://")?f(e):Number(e);if(Number.isNaN(n))throw new Error(`Invalid organization ID: ${e}`);return`gid://organization/Organization/${n}`}function Di(e){return $(et(e))}function Ie(e){return`gid://shopify/Organization/${e.startsWith("gid://")?f(e):Number(e)}`}function nt(e){return $(`gid://organization/ShopifyShop/${e}`)}function it(e){let n=ae(e);if(n===void 0)throw new Error(`Invalid encoded GID: ${e}`);return n}function f(e){if(e.startsWith("gid://")){let n=R(e);if(n===void 0)throw new Error(`Invalid GID: ${e}`);return Number(n)}return Number(e)}async function oe({id:e,organizationId:n}){let i=f(n).toString();return`https://${await me()}/dashboard/${i}/apps/${f(e)}`}async function at(e,n,i){return`${await oe({organizationId:e,id:n})}/versions/${f(i)}`}function tt({currentModules:e,selectedVersionModules:n}){let i=e.map(l=>l.userIdentifier),a=n.map(l=>l.userIdentifier),o=n.filter(l=>!i.includes(l.userIdentifier)),r=e.filter(l=>!a.includes(l.userIdentifier)),m=r.map(l=>l.userIdentifier),d=e.filter(l=>!m.includes(l.userIdentifier));return{added:o,removed:r,updated:d}}async function ot(e,n,i,a=Ce){let o=C(e.flatMap(l=>l.organizationBetaFlags??[])),r=C(e.flatMap(l=>l.organizationExpFlags??[])),[m,d]=await Promise.all([o.length>0?n(o):Promise.resolve({}),r.length>0?i(r):Promise.resolve({})]);return e.filter(l=>{let p=!l.organizationBetaFlags||l.organizationBetaFlags.every(S=>m[S]),k=!l.organizationExpFlags||l.organizationExpFlags.every(S=>d[S]),u=!l.minimumCliVersion||ce(a,`>=${l.minimumCliVersion}`),v=!l.deprecatedFromCliVersion||ce(a,`<${l.deprecatedFromCliVersion}`),g=u&&v,N=Xe(a)&&l.deprecatedFromCliVersion===void 0;return p&&k&&(g||N)})}function xe(e,n){if(n===Fe)return"configuration";switch(e){case"extension":case"configuration":case"deprecated":return e;default:return ke(`Unknown specification experience value "${e}", defaulting to "extension"`),"extension"}}function rt(e){switch(e){case"UidStrategiesDynamic":return"dynamic";case"UidStrategiesStatic":return"single";case"UidStrategiesClientProvided":return"uuid";default:return"uuid"}}function Ai(e,n){return e.map(i=>{let{externalId:a,primaryDomain:o,name:r,url:m,storeType:d}=i,l=m??o;if(!l)throw new A("The selected store does not have a valid URL");return{shopId:a?it(a):void 0,link:o,shopDomain:E(l),shopName:r,transferDisabled:!0,convertableToPartnerTest:!0,provisionable:n,storeType:d}})}function Ti(e){return{registrationId:e.userIdentifier===e.uuid?"":e.userIdentifier,registrationUuid:e.uuid,handle:e.handle,type:e.specification.externalIdentifier,config:e.config,target:e.target??"",specification:{...e.specification,identifier:e.specification.identifier,options:{managementExperience:e.specification.managementExperience},experience:xe(e.specification.experience,e.specification.externalIdentifier)}}}var st=async({organizationId:e,jwtToken:n,cursor:i,filters:a})=>{let o=await vi(e,i,a),r=we(n);return le(o,{method:"GET",headers:r})};function wi(e){let n=[],i=e.on[0]?.user_identifier;return i&&n.push({extension_id:i}),{...e,details:n}}function dt(e){return[{field:"STORE_TYPE",operator:"EQUALS",value:e.toLowerCase()},{field:"STORE_STATUS",operator:"EQUALS",value:"ACTIVE"}]}function Vi(e){return e.includes("ondemand_access_to_stores")}var se;(function(e){e.AppManagement="app-management",e.Partners="partners"})(se||(se={}));function vn(){return re.getInstance()}var Ri;Ri||(Ri={});var lt={};function Ii(e=[]){let n=[],i=e.map(a=>lt[a]);return n.filter(a=>!i.includes(a))}var Re=new WeakMap;function xi(e,n="default"){return{type:"token_refresh",handler:async()=>{let i=Re.get(e);if(i)await i;else try{i=e.unsafeRefreshToken(),Re.set(e,i),await i}finally{Re.delete(e)}let a=await e.session();return{token:n==="businessPlatform"?a.businessPlatformToken:a.token}}}}export{x as a,ie as b,R as c,ae as d,Ia as e,_e as f,De as g,Ra as h,za as i,z as j,B as k,te as l,Te as m,Pa as n,Oa as o,La as p,Ma as q,fn as r,Ei as s,Rt as t,zt as u,gn as v,Ct as w,Et as x,mt as y,un as z,ut as A,Ci as B,ct as C,Nn as D,Sn as E,Ui as F,Mt as G,$t as H,ji as I,X as J,Ht as K,F as L,Bt as M,I as N,ee as O,Zi as P,_n as Q,ia as R,Dn as S,An as T,h as U,So as V,Fe as W,vs as X,M as Y,Zn as Z,ii as _,ya as $,ti as aa,O as ba,Q as ca,Ne as da,Ao as ea,Se as fa,Ro as ga,ca as ha,pa as ia,he as ja,Lo as ka,be as la,ts as ma,et as na,se as oa,vn as pa,xi as qa,fe as ra,V as sa,_t as ta,Dt as ua,At as va};