shopify 5.0.0 → 5.0.1

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 (327) hide show
  1. package/dist/{analytics-VKKJNJ62.js → analytics-RSUIYNLC.js} +1 -1
  2. package/dist/analytics-V2SDYXQJ.js +1 -0
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-NK2MGR6A.js → chunk-2AW3KBTP.js} +1 -1
  5. package/dist/{chunk-BCYTZ7LM.js → chunk-2CJQQQW4.js} +1 -1
  6. package/dist/{chunk-EITIW5OX.js → chunk-2M4BKFYF.js} +1 -1
  7. package/dist/chunk-2M535QQJ.js +6 -0
  8. package/dist/{chunk-5TB52UUV.js → chunk-2NZ7GDDR.js} +1 -1
  9. package/dist/{chunk-YVY32DNA.js → chunk-2QQ7EBJD.js} +1 -1
  10. package/dist/chunk-2RFCYZMG.js +47 -0
  11. package/dist/{chunk-S67I4E7M.js → chunk-2S5NPJEJ.js} +1 -1
  12. package/dist/{chunk-YVVU4J5O.js → chunk-2TPLPZA2.js} +1 -1
  13. package/dist/{chunk-C3KEDG33.js → chunk-2YGPWG3I.js} +1 -1
  14. package/dist/{chunk-TTEF7GTX.js → chunk-32O27NE3.js} +1 -1
  15. package/dist/{chunk-24NUJTIH.js → chunk-364BVGRY.js} +1 -1
  16. package/dist/{chunk-BJPDJIS4.js → chunk-36TZ447N.js} +1 -1
  17. package/dist/{chunk-5UWMXOHM.js → chunk-37P5YOP2.js} +1 -1
  18. package/dist/{chunk-4CRBTSVP.js → chunk-3G2PEYPI.js} +1 -1
  19. package/dist/{chunk-EXFBZPZS.js → chunk-3JACWBUC.js} +1 -1
  20. package/dist/{chunk-53BG3NLH.js → chunk-43HKFLOU.js} +1 -1
  21. package/dist/chunk-46JYM3GH.js +1 -0
  22. package/dist/{chunk-XITZIDCL.js → chunk-4EDE3UH7.js} +1 -1
  23. package/dist/{chunk-G6ZMSWEU.js → chunk-4GQEXVDT.js} +1 -1
  24. package/dist/{chunk-SNNZ4U2W.js → chunk-4IUXLUFD.js} +1 -1
  25. package/dist/{chunk-ULD7CIOY.js → chunk-4QZ6OBXL.js} +1 -1
  26. package/dist/{chunk-YKS7MH3F.js → chunk-4SDCXKYR.js} +1 -1
  27. package/dist/{chunk-VB7YQMAM.js → chunk-56GKTWFF.js} +1 -1
  28. package/dist/{chunk-Q66CI37F.js → chunk-5AQ5JT2V.js} +1 -1
  29. package/dist/{chunk-Q2SZCZE7.js → chunk-5AWELO3D.js} +1 -1
  30. package/dist/{chunk-VHUD3CBC.js → chunk-5D4FNAAD.js} +1 -1
  31. package/dist/{chunk-46MSIQ6Z.js → chunk-5TWYJQQO.js} +1 -1
  32. package/dist/{chunk-OGWPS55W.js → chunk-5XOEMYEQ.js} +1 -1
  33. package/dist/{chunk-MR2AUT7Q.js → chunk-5YUDEPEY.js} +1 -1
  34. package/dist/{chunk-CCQNP5YR.js → chunk-5YXYYQBX.js} +1 -1
  35. package/dist/{chunk-P33TONYG.js → chunk-63UKZLPC.js} +1 -1
  36. package/dist/chunk-6JZC6UKY.js +20 -0
  37. package/dist/{chunk-7QUZWCJZ.js → chunk-6Y6A2QGK.js} +1 -1
  38. package/dist/{chunk-M7LPHCP2.js → chunk-75LAVRRL.js} +2 -2
  39. package/dist/{chunk-AJMDF3QC.js → chunk-7AWAOPLA.js} +1 -1
  40. package/dist/{chunk-AXC2MHHO.js → chunk-7NYCJG2U.js} +1 -1
  41. package/dist/{chunk-6DXP7PQ7.js → chunk-7U2MTK6I.js} +1 -1
  42. package/dist/{chunk-JEA3C7ON.js → chunk-7XAEI4XT.js} +1 -1
  43. package/dist/{chunk-TPSA4JN5.js → chunk-A7LBGXWG.js} +1 -1
  44. package/dist/{chunk-2CMEKSI7.js → chunk-ADVLRSSO.js} +1 -1
  45. package/dist/{chunk-3LVCG4JB.js → chunk-AIEVQSI3.js} +1 -1
  46. package/dist/{chunk-M4BVLMPH.js → chunk-AOBE6HN6.js} +1 -1
  47. package/dist/{chunk-PSSYLJG4.js → chunk-AQ34X5B3.js} +1 -1
  48. package/dist/{chunk-43KLFFP7.js → chunk-B2VE7WOX.js} +1 -1
  49. package/dist/{chunk-L7MSPGDS.js → chunk-B4ISKIXN.js} +1 -1
  50. package/dist/{chunk-EMSF57ZB.js → chunk-BB7GAZP6.js} +1 -1
  51. package/dist/chunk-BNTOGZLY.js +1 -0
  52. package/dist/chunk-BU3JQM3W.js +1 -0
  53. package/dist/{chunk-LHKVXJPX.js → chunk-C3LL5CZA.js} +1 -1
  54. package/dist/{chunk-GFVKTWFT.js → chunk-C4EKNOLY.js} +1 -1
  55. package/dist/{chunk-5NEGOQT6.js → chunk-CFUZ6574.js} +1 -1
  56. package/dist/{chunk-NB4BRW3H.js → chunk-CKVVJ4XO.js} +1 -1
  57. package/dist/{chunk-VWH3VPYI.js → chunk-CNPBDSDL.js} +1 -1
  58. package/dist/{chunk-U25W35TX.js → chunk-CWR3IFXD.js} +1 -1
  59. package/dist/{chunk-VW6QS7DO.js → chunk-CX3ANDPI.js} +1 -1
  60. package/dist/{chunk-GB6E3ATN.js → chunk-CXPYOLGM.js} +1 -1
  61. package/dist/{chunk-FWB3GLMW.js → chunk-D4LFWIFE.js} +1 -1
  62. package/dist/{chunk-PZUGDE7N.js → chunk-DM7BTMFP.js} +1 -1
  63. package/dist/{chunk-GRGFA26K.js → chunk-DSKAIC7O.js} +1 -1
  64. package/dist/{chunk-M5TGCSUK.js → chunk-DTRENW4Q.js} +1 -1
  65. package/dist/{chunk-EGCWR5AS.js → chunk-DVW7NDVD.js} +1 -1
  66. package/dist/{chunk-YGYEM6QO.js → chunk-E3CTHNQS.js} +1 -1
  67. package/dist/{chunk-6BNKBCCU.js → chunk-EA5XVQJT.js} +1 -1
  68. package/dist/{chunk-XM7YUXTF.js → chunk-EH22T4FI.js} +2 -2
  69. package/dist/{chunk-XNNKLUTN.js → chunk-ETXBF6Q7.js} +1 -1
  70. package/dist/{chunk-AYL6KBPE.js → chunk-EXTVC33U.js} +1 -1
  71. package/dist/{chunk-J6TW43TG.js → chunk-F3OM2YO6.js} +1 -1
  72. package/dist/{chunk-X7HVAVSZ.js → chunk-FHNJLON5.js} +1 -1
  73. package/dist/{chunk-SFPXYHHL.js → chunk-FK5OFLSJ.js} +1 -1
  74. package/dist/{chunk-NDKSG4CC.js → chunk-FNWXMCSD.js} +1 -1
  75. package/dist/{chunk-KKPOOIE4.js → chunk-FPOZMNT2.js} +1 -1
  76. package/dist/{chunk-HIRTL45Q.js → chunk-FS5PZCZ3.js} +1 -1
  77. package/dist/{chunk-Q5MEFIMV.js → chunk-FTHVOIK7.js} +1 -1
  78. package/dist/chunk-FVRI7ZKE.js +103 -0
  79. package/dist/{chunk-CIK5BF7V.js → chunk-GCKGQFV7.js} +1 -1
  80. package/dist/{chunk-PEVIRAMR.js → chunk-GGJUPL4W.js} +1 -1
  81. package/dist/{chunk-R7EMV77H.js → chunk-GHU6YEXH.js} +1 -1
  82. package/dist/{chunk-WGUOLSMG.js → chunk-GNPIKPHB.js} +1 -1
  83. package/dist/{chunk-3A3DZVEJ.js → chunk-GSGCSBRN.js} +1 -1
  84. package/dist/{chunk-PIAD3F6M.js → chunk-H57KYDEI.js} +1 -1
  85. package/dist/{chunk-GAMC2BNY.js → chunk-HNU6R7RT.js} +1 -1
  86. package/dist/{chunk-UOS2XLGG.js → chunk-HP2ZAAY7.js} +1 -1
  87. package/dist/{chunk-IEQ4UOH3.js → chunk-HPT3UXZ5.js} +1 -1
  88. package/dist/chunk-HT66BOEC.js +8 -0
  89. package/dist/{chunk-4ARCB6DT.js → chunk-HXNGLDMU.js} +1 -1
  90. package/dist/{chunk-BVSKBX7T.js → chunk-IAL6IQYW.js} +1 -1
  91. package/dist/{chunk-4RDFMBRG.js → chunk-IULZYDCI.js} +1 -1
  92. package/dist/{chunk-UIQL5ZF3.js → chunk-IWTOC6DG.js} +1 -1
  93. package/dist/{chunk-2ORRV7GH.js → chunk-IY5EI5V2.js} +1 -1
  94. package/dist/{chunk-ZT5WFUKJ.js → chunk-J3UXIC23.js} +1 -1
  95. package/dist/{chunk-Q2XRITUG.js → chunk-J5DUFSR4.js} +1 -1
  96. package/dist/{chunk-2VSNFOKD.js → chunk-J7BTC45S.js} +1 -1
  97. package/dist/{chunk-SL3VBI62.js → chunk-JMVK2BIB.js} +1 -1
  98. package/dist/{chunk-X2H6I2WW.js → chunk-JUTULEWW.js} +1 -1
  99. package/dist/{chunk-KGRIYAMA.js → chunk-K3YALQBQ.js} +1 -1
  100. package/dist/{chunk-SFQEHDJY.js → chunk-KGASGUDQ.js} +1 -1
  101. package/dist/{chunk-LDU5T3DN.js → chunk-KLYGMYXV.js} +1 -1
  102. package/dist/{chunk-7WPUV7GY.js → chunk-KNQXCU3Y.js} +1 -1
  103. package/dist/{chunk-C7V755IT.js → chunk-KOTZSPZA.js} +1 -1
  104. package/dist/{chunk-DJAZBPYA.js → chunk-KT5QQOES.js} +1 -1
  105. package/dist/{chunk-4SS6DXC7.js → chunk-KVF55INC.js} +1 -1
  106. package/dist/{chunk-MXJAH2GW.js → chunk-L6VONMA2.js} +1 -1
  107. package/dist/{chunk-GXORLBVN.js → chunk-LENSEW2F.js} +1 -1
  108. package/dist/{chunk-7UOA4DI7.js → chunk-LGXNXAQA.js} +1 -1
  109. package/dist/{chunk-ZYQ2XWC5.js → chunk-LR4J4KYJ.js} +1 -1
  110. package/dist/{chunk-QN3774QI.js → chunk-LWMKZJ4M.js} +1 -1
  111. package/dist/{chunk-I4OVLRQR.js → chunk-M2KX3PXA.js} +1 -1
  112. package/dist/{chunk-D7NB7YR6.js → chunk-M73IECPW.js} +1 -1
  113. package/dist/{chunk-4TI7U2PN.js → chunk-M7NLCGCP.js} +1 -1
  114. package/dist/chunk-MHWETFNT.js +1 -0
  115. package/dist/{chunk-CCMDZX35.js → chunk-MMUGP3WP.js} +1 -1
  116. package/dist/{chunk-LMQGNECW.js → chunk-MNWT2SQO.js} +1 -1
  117. package/dist/{chunk-R2BDABJD.js → chunk-MS7DTL4U.js} +1 -1
  118. package/dist/{chunk-OVWUGAEU.js → chunk-MU2X7NGF.js} +1 -1
  119. package/dist/{chunk-GCNA3HXH.js → chunk-MXXMIPUN.js} +1 -1
  120. package/dist/{chunk-POKY4RWR.js → chunk-MZCIRMZJ.js} +1 -1
  121. package/dist/{chunk-PGLWZMJU.js → chunk-MZWPIFAM.js} +1 -1
  122. package/dist/{chunk-H4V55Y3Z.js → chunk-NCPZVARH.js} +83 -83
  123. package/dist/{chunk-3G4HJO72.js → chunk-NJVNGEOU.js} +1 -1
  124. package/dist/{chunk-CEIJKJOF.js → chunk-NMECLRGK.js} +1 -1
  125. package/dist/{chunk-UVRKTMF7.js → chunk-NMLLRFZF.js} +1 -1
  126. package/dist/chunk-NPB753M3.js +1 -0
  127. package/dist/{chunk-ZAA2DXK5.js → chunk-NUCDRKDW.js} +1 -1
  128. package/dist/{chunk-UZROQRLX.js → chunk-OH7BQZQ7.js} +1 -1
  129. package/dist/{chunk-ZQDDRIBA.js → chunk-OLKLHVHA.js} +4 -4
  130. package/dist/{chunk-7MVWDCI3.js → chunk-OPVXPDOQ.js} +1 -1
  131. package/dist/{chunk-IWEKM5Y3.js → chunk-OQUXGAF2.js} +1 -1
  132. package/dist/{chunk-IUTZIN2T.js → chunk-OUMERKRE.js} +1 -1
  133. package/dist/{chunk-5OMJFPQW.js → chunk-OYGIQDME.js} +1 -1
  134. package/dist/{chunk-KSDU4YOB.js → chunk-P5W5RVE6.js} +1 -1
  135. package/dist/{chunk-PYIICTLX.js → chunk-PNZURX3S.js} +1 -1
  136. package/dist/{chunk-UK6576EO.js → chunk-PRKJVU4Y.js} +1 -1
  137. package/dist/{chunk-DFQ4WTET.js → chunk-PVASYKSJ.js} +1 -1
  138. package/dist/{chunk-CW2T7EOQ.js → chunk-PXFPVGWV.js} +1 -1
  139. package/dist/{chunk-7LAKWAKX.js → chunk-Q2ORJEB2.js} +1 -1
  140. package/dist/{chunk-XKRJKUA7.js → chunk-QBE6XVU3.js} +1 -1
  141. package/dist/{chunk-N2RFDHRY.js → chunk-QGWC23HQ.js} +1 -1
  142. package/dist/{chunk-GQNOVEKP.js → chunk-QVVQUJQL.js} +1 -1
  143. package/dist/{chunk-WMAFG2JD.js → chunk-QX3T6G5X.js} +1 -1
  144. package/dist/{chunk-VMMUJN4T.js → chunk-QYFU363G.js} +1 -1
  145. package/dist/{chunk-7NSK77WG.js → chunk-RDXLDCMI.js} +1 -1
  146. package/dist/{chunk-JYMDWR25.js → chunk-REDUS6EW.js} +1 -1
  147. package/dist/{chunk-FNLECT7B.js → chunk-RFZNFTVM.js} +1 -1
  148. package/dist/{chunk-LWCTKI4Z.js → chunk-RIG66DIQ.js} +3 -3
  149. package/dist/{chunk-YTUDXZLN.js → chunk-RNUEPPVN.js} +1 -1
  150. package/dist/{chunk-RFGEM5JC.js → chunk-RWTAPWLJ.js} +1 -1
  151. package/dist/{chunk-WFWISGLS.js → chunk-T5YVYVSW.js} +1 -1
  152. package/dist/{chunk-WJSUIUBW.js → chunk-TTBNFGCW.js} +1 -1
  153. package/dist/{chunk-OQ5CLM2H.js → chunk-UDPYSL3M.js} +1 -1
  154. package/dist/{chunk-KDPQXURV.js → chunk-ULMNNGGX.js} +1 -1
  155. package/dist/{chunk-T2IUXXCT.js → chunk-URCH4ITT.js} +1 -1
  156. package/dist/{chunk-NOH63WC6.js → chunk-UU2R56LN.js} +1 -1
  157. package/dist/{chunk-CVVQQLCF.js → chunk-V2FCZC7U.js} +1 -1
  158. package/dist/{chunk-CZ22VZDA.js → chunk-V654BMS7.js} +108 -108
  159. package/dist/{chunk-7IFE4UQY.js → chunk-V7H7ITCF.js} +1 -1
  160. package/dist/{chunk-MYAIWSOO.js → chunk-VG2AESTZ.js} +1 -1
  161. package/dist/{chunk-XTREQ4A2.js → chunk-VXD26GIG.js} +1 -1
  162. package/dist/{chunk-QKVVJXWS.js → chunk-VXL5FBE7.js} +1 -1
  163. package/dist/{chunk-I6FRVYGE.js → chunk-W7S6SYBM.js} +1 -1
  164. package/dist/{chunk-HCZG7YJ6.js → chunk-WAY723TL.js} +1 -1
  165. package/dist/chunk-WFOU5M4H.js +16 -0
  166. package/dist/{chunk-BWRNXCVN.js → chunk-WGOSE3RL.js} +1 -1
  167. package/dist/{chunk-KJQDS5HI.js → chunk-WQ6W725N.js} +1 -1
  168. package/dist/{chunk-52FDK2LC.js → chunk-WQOPLNDH.js} +1 -1
  169. package/dist/{chunk-4GCI2YCZ.js → chunk-X4A5D3PZ.js} +1 -1
  170. package/dist/{chunk-2DID73ML.js → chunk-X7DCL5LT.js} +1 -1
  171. package/dist/{chunk-RVQV6G5M.js → chunk-XDXHSGDL.js} +1 -1
  172. package/dist/{chunk-OX7UVDSU.js → chunk-XKKKMV46.js} +1 -1
  173. package/dist/{chunk-FDXHQZTO.js → chunk-XRVJJG6W.js} +16 -16
  174. package/dist/chunk-XV6XCOTG.js +319 -0
  175. package/dist/{chunk-M3ACZWMR.js → chunk-XYFYQWKW.js} +1 -1
  176. package/dist/{chunk-UWMZ5CSB.js → chunk-XZLM4HLO.js} +1 -1
  177. package/dist/{chunk-FFHH5LOR.js → chunk-YCUEDZDA.js} +1 -1
  178. package/dist/{chunk-XBQDMGUN.js → chunk-YFRI75U4.js} +1 -1
  179. package/dist/{chunk-XMODGI45.js → chunk-YQ63ZFYT.js} +1 -1
  180. package/dist/{chunk-4GOJQKY5.js → chunk-YXIFSIRX.js} +1 -1
  181. package/dist/{chunk-MDRVCBDO.js → chunk-ZBVHPC6W.js} +1 -1
  182. package/dist/{chunk-IQVRP7CT.js → chunk-ZHHTQRWU.js} +1 -1
  183. package/dist/{chunk-Z5SILNH2.js → chunk-ZTZGDZCE.js} +1 -1
  184. package/dist/{chunk-OQU3HLAE.js → chunk-ZVEBXHEY.js} +1 -1
  185. package/dist/cli/commands/app/build.js +1 -1
  186. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  187. package/dist/cli/commands/app/bulk/execute.js +1 -1
  188. package/dist/cli/commands/app/bulk/status.js +1 -1
  189. package/dist/cli/commands/app/config/link.js +1 -1
  190. package/dist/cli/commands/app/config/pull.js +1 -1
  191. package/dist/cli/commands/app/config/use.js +1 -1
  192. package/dist/cli/commands/app/config/validate.js +1 -1
  193. package/dist/cli/commands/app/demo/watcher.js +1 -1
  194. package/dist/cli/commands/app/deploy.js +1 -1
  195. package/dist/cli/commands/app/dev/clean.js +1 -1
  196. package/dist/cli/commands/app/dev.js +1 -1
  197. package/dist/cli/commands/app/env/pull.js +1 -1
  198. package/dist/cli/commands/app/env/show.js +1 -1
  199. package/dist/cli/commands/app/execute.js +1 -1
  200. package/dist/cli/commands/app/function/build.js +1 -1
  201. package/dist/cli/commands/app/function/info.js +1 -1
  202. package/dist/cli/commands/app/function/replay.js +1 -1
  203. package/dist/cli/commands/app/function/run.js +1 -1
  204. package/dist/cli/commands/app/function/schema.js +1 -1
  205. package/dist/cli/commands/app/function/typegen.js +1 -1
  206. package/dist/cli/commands/app/generate/extension.js +1 -1
  207. package/dist/cli/commands/app/graphiql.js +1 -1
  208. package/dist/cli/commands/app/import/channel-config.js +1 -1
  209. package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
  210. package/dist/cli/commands/app/import/dashboard-extensions.js +1 -1
  211. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  212. package/dist/cli/commands/app/import-extensions.js +1 -1
  213. package/dist/cli/commands/app/info.js +1 -1
  214. package/dist/cli/commands/app/init.js +1 -1
  215. package/dist/cli/commands/app/logs.js +1 -1
  216. package/dist/cli/commands/app/release.js +1 -1
  217. package/dist/cli/commands/app/security/check.js +1 -1
  218. package/dist/cli/commands/app/security/clean.js +1 -1
  219. package/dist/cli/commands/app/security/instructions.js +1 -1
  220. package/dist/cli/commands/app/security/record.js +1 -1
  221. package/dist/cli/commands/app/security/review.js +1 -1
  222. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  223. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  224. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  225. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  226. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  227. package/dist/cli/commands/app/versions/list.js +1 -1
  228. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  229. package/dist/cli/commands/auth/login.js +1 -1
  230. package/dist/cli/commands/auth/logout.js +1 -1
  231. package/dist/cli/commands/cache/clear.js +1 -1
  232. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  233. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  234. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  235. package/dist/cli/commands/debug/command-flags.js +1 -1
  236. package/dist/cli/commands/doc/fetch.js +1 -1
  237. package/dist/cli/commands/doc/search.js +1 -1
  238. package/dist/cli/commands/docs/generate.js +1 -1
  239. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  240. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  241. package/dist/cli/commands/help.js +1 -1
  242. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  243. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  244. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  245. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  246. package/dist/cli/commands/notifications/generate.js +1 -1
  247. package/dist/cli/commands/notifications/list.js +1 -1
  248. package/dist/cli/commands/organization/list.js +1 -1
  249. package/dist/cli/commands/search.js +1 -1
  250. package/dist/cli/commands/send-analytics.js +1 -1
  251. package/dist/cli/commands/theme/check.js +1 -1
  252. package/dist/cli/commands/theme/console.js +1 -1
  253. package/dist/cli/commands/theme/delete.js +1 -1
  254. package/dist/cli/commands/theme/dev.js +1 -1
  255. package/dist/cli/commands/theme/duplicate.js +1 -1
  256. package/dist/cli/commands/theme/info.js +1 -1
  257. package/dist/cli/commands/theme/init.js +1 -1
  258. package/dist/cli/commands/theme/language-server.js +1 -1
  259. package/dist/cli/commands/theme/list.js +1 -1
  260. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  261. package/dist/cli/commands/theme/open.js +1 -1
  262. package/dist/cli/commands/theme/package.js +1 -1
  263. package/dist/cli/commands/theme/preview.js +1 -1
  264. package/dist/cli/commands/theme/profile.js +1 -1
  265. package/dist/cli/commands/theme/publish.js +1 -1
  266. package/dist/cli/commands/theme/pull.js +1 -1
  267. package/dist/cli/commands/theme/push.js +1 -1
  268. package/dist/cli/commands/theme/rename.js +1 -1
  269. package/dist/cli/commands/theme/share.js +1 -1
  270. package/dist/cli/commands/upgrade.js +1 -1
  271. package/dist/cli/commands/version.js +1 -1
  272. package/dist/cli/help.js +1 -1
  273. package/dist/{command-json-schema-2UMKY7MY.js → command-json-schema-6EGXCM4B.js} +1 -1
  274. package/dist/command-registry.js +1 -1
  275. package/dist/{conf-store-RI3TL6I4.js → conf-store-E7ELDWBA.js} +1 -1
  276. package/dist/{custom-oclif-loader-IZCKN67O.js → custom-oclif-loader-FKFZJPHF.js} +1 -1
  277. package/dist/{deprecations-IFVUXXDB.js → deprecations-RNGBHZYB.js} +1 -1
  278. package/dist/dist-VHIZZDYK.js +1 -0
  279. package/dist/dist-WXI5YQYP.js +1 -0
  280. package/dist/{environments-CYMEN7NV.js → environments-WZJ6MRTH.js} +1 -1
  281. package/dist/{error-IL6WQMSW.js → error-IFB626JA.js} +1 -1
  282. package/dist/error-handler-OVJYVIOZ.js +1 -0
  283. package/dist/{fs-AINFLJ2E.js → fs-7UOUHJDO.js} +1 -1
  284. package/dist/hooks/did-you-mean.js +1 -1
  285. package/dist/hooks/hydrogen-init.js +1 -1
  286. package/dist/hooks/postrun.js +1 -1
  287. package/dist/hooks/prerun.js +1 -1
  288. package/dist/hooks/public-metadata.js +1 -1
  289. package/dist/hooks/sensitive-metadata.js +1 -1
  290. package/dist/hooks/tunnel-provider.js +1 -1
  291. package/dist/hooks/tunnel-start.js +1 -1
  292. package/dist/index.js +12 -12
  293. package/dist/{is-global-2VLKV46Q.js → is-global-XW3CVHLK.js} +1 -1
  294. package/dist/{json-error-HZB5YIHV.js → json-error-C2U7ZLCG.js} +1 -1
  295. package/dist/{local-KOZETREJ.js → local-KA3IWOZ6.js} +1 -1
  296. package/dist/{metadata-IBPHZB7N.js → metadata-6JI7HF5B.js} +1 -1
  297. package/dist/{node-package-manager-DXSRNEDC.js → node-package-manager-X3QIEMMX.js} +1 -1
  298. package/dist/{notifications-system-XA3EBOGJ.js → notifications-system-OXGLT2R4.js} +1 -1
  299. package/dist/{os-X73O7BAB.js → os-NORIEVMI.js} +1 -1
  300. package/dist/{output-3OYXK3Z5.js → output-K3JTLRJD.js} +1 -1
  301. package/dist/{system-JWYYT4PM.js → system-LTHR2T7L.js} +1 -1
  302. package/dist/tsconfig.tsbuildinfo +1 -1
  303. package/dist/{ui-PCG5D6RZ.js → ui-MYUBVKCK.js} +1 -1
  304. package/dist/upgrade-MFTWBXL3.js +1 -0
  305. package/dist/version-BNGPPAUU.js +1 -0
  306. package/dist/{version-7DGU2KYH.js → version-RCGFWSB4.js} +1 -1
  307. package/dist/{workerd-MQZ3NKJI.js → workerd-ISSXMKIH.js} +1 -1
  308. package/oclif.manifest.json +6 -3
  309. package/package.json +7 -7
  310. package/dist/analytics-Q6QDIDYT.js +0 -1
  311. package/dist/chunk-3C6VLJ5D.js +0 -319
  312. package/dist/chunk-43R5VGKT.js +0 -1
  313. package/dist/chunk-4C2DAX5T.js +0 -1
  314. package/dist/chunk-7RPFJZLP.js +0 -1
  315. package/dist/chunk-DNMXVMJM.js +0 -47
  316. package/dist/chunk-IUP7POIE.js +0 -6
  317. package/dist/chunk-JDR6UVZA.js +0 -8
  318. package/dist/chunk-JOJV5E2K.js +0 -1
  319. package/dist/chunk-LVLAOBJM.js +0 -103
  320. package/dist/chunk-PMHP57MH.js +0 -20
  321. package/dist/chunk-WDFCOZAY.js +0 -16
  322. package/dist/chunk-ZGV3HNEV.js +0 -1
  323. package/dist/dist-4H2B7BMN.js +0 -1
  324. package/dist/dist-QNWOGQN3.js +0 -1
  325. package/dist/error-handler-74HKA23T.js +0 -1
  326. package/dist/upgrade-7U2TUNC4.js +0 -1
  327. package/dist/version-SXQTRBXB.js +0 -1
@@ -1,3 +1,3 @@
1
- import{a as Se}from"./chunk-7IFE4UQY.js";import{a as se}from"./chunk-6BNKBCCU.js";import{a as ye,b as H}from"./chunk-ZQDDRIBA.js";import{E as U,N as O,u as w,va as ce,xa as M,ya as me}from"./chunk-H4V55Y3Z.js";import{e as _}from"./chunk-ZT5WFUKJ.js";import{d as ve}from"./chunk-Q2SZCZE7.js";import{B as D,C as B,F as le,W as fe,a as ae,y as pe}from"./chunk-CZ22VZDA.js";import{c as ie}from"./chunk-J6TW43TG.js";import{b as ne,o as re}from"./chunk-335BUVBP.js";import{d as ue,e as de}from"./chunk-X7HVAVSZ.js";import{h as x,k as he}from"./chunk-2VSNFOKD.js";import{Bb as g,Ea as te,Ta as C,qb as G,sb as y,wb as ge}from"./chunk-LWCTKI4Z.js";import{h as oe,i as L,j as R}from"./chunk-FZCGRIOM.js";import{b as Le}from"./chunk-YTUUU33R.js";import{c as Z,e as $,h as ee,p as k}from"./chunk-IWTNUJGY.js";import{e as qe,g as S}from"./chunk-VKWPEFWQ.js";S();var b=qe(Le(),1);var Y={path:b.Flags.string({description:"The path where you want to run the command. Defaults to the current working directory.",env:"SHOPIFY_FLAG_PATH",parse:async n=>{let e=$(n);if(!C(e))throw new x("A path was explicitly provided but doesn't exist.",`Please check the path and try again: ${e}`);if(!te(e))throw new x("The path must be a directory, not a file.",`The provided path is not a directory: ${e}. Did you mean: ${ee(e)}`);return e},default:async()=>k(),noCacheDefault:!0}),password:b.Flags.string({description:"Password generated from the Theme Access app or an Admin API token.",env:"SHOPIFY_CLI_THEME_TOKEN"}),store:b.Flags.string({char:"s",description:"Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",env:"SHOPIFY_FLAG_STORE",parse:async n=>w(n)}),environment:b.Flags.string({char:"e",description:"The environment to apply to the current command.",env:"SHOPIFY_FLAG_ENVIRONMENT",multiple:!0})},we="Wrap the value in double quotes if you're using wildcards.",Ve=n=>({only:b.Flags.string({char:"o",multiple:!0,description:`${n.charAt(0).toUpperCase()+n.slice(1)} only the specified files (Multiple flags allowed). ${we}`,env:"SHOPIFY_FLAG_ONLY"}),ignore:b.Flags.string({char:"x",multiple:!0,description:`Skip ${n}ing the specified files (Multiple flags allowed). ${we}`,env:"SHOPIFY_FLAG_IGNORE"})});S();S();S();import{AsyncLocalStorage as Ue}from"node:async_hooks";var Fe=new Ue,Ae,Ee,xe,Te;function v(){return Ae??=new _({projectName:"shopify-cli-theme-conf"}),Ae}function z(){return Ee??=new _({projectName:"shopify-cli-development-theme-config"}),Ee}function J(){return xe??=new _({projectName:"shopify-cli-repl-theme-config"}),xe}function W(){return Te??=new _({projectName:"shopify-cli-theme-store-password"}),Te}function K(n=v()){return Fe.getStore()?.store??n.get("themeStore")}function Ie(n,e=v()){e.set("themeStore",n)}function rt(n=v()){return g(y`Getting development theme...`),z().get(F(n))}function ot(n,e=v()){g(y`Setting development theme...`),z().set(F(e),n)}function st(n=v()){g(y`Removing development theme...`),z().delete(F(n))}function it(n=v()){return g(y`Getting REPL theme...`),J().get(F(n))}function at(n,e=v()){g(y`Setting REPL theme to ${n}...`),J().set(F(e),n)}function ct(n=v()){g(y`Removing REPL theme...`),J().delete(F(n))}function mt(n=v()){let e=F(n);return g(y`Getting storefront password for shop ${e}...`),W().get(e)}function ut(n,e=v()){let t=F(e);g(y`Setting storefront password for shop ${t}...`),W().set(t,n)}function dt(n=v()){let e=F(n);g(y`Removing storefront password for ${e}...`),W().delete(e)}function F(n=v()){let e=K(n);if(!e)throw new he("Theme store is not set. This indicates an unexpected issue with the CLI. Please report this to the Shopify CLI team.",["It may be possible to recover by running",{command:"shopify theme list --store <store>"},"(setting the store flag to the store you wish to use) and then running the command again."]);return e}async function _e(n,e){return Fe.run({store:n},e)}function be(n){let e=n.store??K();if(!e)throw ce(new x("A store is required",`Specify the store passing ${y`${G.genericShellCommand(`--${Y.store.name}=example.myshopify.com`)}`.value} or set the ${y`${G.genericShellCommand(Y.store.env)}`.value} environment variable.`));return Ie(e),e}S();var Ce="shopify.theme.toml",At=new Intl.DateTimeFormat(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),Et=["**/.git","**/.vscode","**/.hg","**/.bzr","**/.svn","**/_darcs","**/CVS","**/*.sublime-(project|workspace)","**/.DS_Store","**/.sass-cache","**/Thumbs.db","**/desktop.ini","**/config.yml","**/node_modules/",".prettierrc.json","**/{blocks,layout,snippets}/**/*.liquid.tmp.*","**/{config,locales}/**/*.json.tmp.*","**/{sections,templates}/**/*.{liquid,json}.tmp.*"],xt=50;S();S();var V="7e9cb568cfd431c538f36d1ad3f2b4f6";var Oe="shopify-cli-store",Me=240*1e3,Pe;function j(){return Pe??=new _({projectName:Oe}),Pe}function P(n){return`${V}::${De(n)}`}function De(n){return n.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function p(n){return typeof n=="string"}function Be(n){if(!n||typeof n!="object")return;let e=n;if(typeof e.id=="number")return{id:e.id,...p(e.email)?{email:e.email}:{},...p(e.firstName)?{firstName:e.firstName}:{},...p(e.lastName)?{lastName:e.lastName}:{},...typeof e.accountOwner=="boolean"?{accountOwner:e.accountOwner}:{}}}function Ge(n){if(!n||typeof n!="object")return;let e=n;if(!(!p(e.shopId)||!p(e.name)||!p(e.createdAt)))return{shopId:e.shopId,name:e.name,createdAt:e.createdAt,...p(e.placeholderAccountUuid)?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...p(e.country)?{country:e.country}:{},...p(e.accessUrl)?{accessUrl:e.accessUrl}:{}}}function He(n){if(!n||typeof n!="object")return;let e=n;if(!p(e.store)||!p(e.clientId)||!p(e.userId)||!p(e.accessToken)||!Array.isArray(e.scopes)||!e.scopes.every(p)||!p(e.acquiredAt))return;let t=Be(e.associatedUser),r=e.kind==="preview"?"preview":"standard",o=r==="preview"?Ge(e.preview):void 0;if(!(r==="preview"&&!o))return{store:e.store,clientId:e.clientId,userId:e.userId,accessToken:e.accessToken,scopes:e.scopes,acquiredAt:e.acquiredAt,...p(e.refreshToken)?{refreshToken:e.refreshToken}:{},...p(e.expiresAt)?{expiresAt:e.expiresAt}:{},...p(e.refreshTokenExpiresAt)?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...t?{associatedUser:t}:{},...r==="preview"?{kind:r}:{},...o?{preview:o}:{}}}function $e(n,e,t){if(!e||typeof e!="object")return;let{sessionsByUserId:r,currentUserId:o}=e;if(!(r!==void 0||o!==void 0))return;let s=P(n);if(!r||typeof r!="object"||Array.isArray(r)||typeof o!="string"){t.delete(s);return}let i=Object.fromEntries(Object.entries(r).flatMap(([c,m])=>{let u=He(m);return u?[[c,u]]:[]}));if(Object.keys(i).length!==Object.keys(r).length)if(i[o])t.set(s,{currentUserId:o,sessionsByUserId:i});else{t.delete(s);return}return{currentUserId:o,sessionsByUserId:i}}function Q(n,e){return $e(n,e.get(P(n)),e)}function Ye(n){return n.config?.store??{}}function ke(n=j()){let e=[],t=`${V}::`;for(let[r,o]of Object.entries(Ye(n))){if(!r.startsWith(t))continue;let a=$e(r.slice(t.length),o,n),s=a?.sessionsByUserId[a.currentUserId];s&&e.push(s)}return e}function Re(n,e=j()){let t=w(n),r=Q(t,e);if(!r)return;let o=r.sessionsByUserId[r.currentUserId];if(!o){e.delete(P(t));return}return o}function kt(n,e=j()){let t=P(n.store),r=Q(n.store,e),o={currentUserId:n.userId,sessionsByUserId:{...r?.sessionsByUserId??{},[n.userId]:n}};e.set(t,o)}function Rt(n,e,t){let r=w(n),o=typeof e=="string"?e:void 0,a=(typeof e=="string"?t:e)??j(),s=P(r);if(!o){a.delete(s);return}let i=Q(r,a);if(!i)return;let{[o]:c,...m}=i.sessionsByUserId,u=Object.keys(m);if(u.length===0){a.delete(s);return}a.set(s,{currentUserId:i.currentUserId===o?u[0]:i.currentUserId,sessionsByUserId:m})}function je(n){if(!n.expiresAt)return!1;let e=new Date(n.expiresAt).getTime();return Number.isNaN(e)?!0:e-Me<Date.now()}var X=class extends H{static baseFlags={...H.baseFlags,...ve};environmentsFilename(){return this.hasExplicitEnvironment()&&this.collectsEnvironmentResults({json:re(process.env,this.argv)})?void 0:Ce}async command(e,t,r=!1,o,a){}async run(e){let t=this.constructor,r=t.multiEnvironmentsFlags,o=this.hasExplicitEnvironment(),{args:a,flags:s}=await this.parse(t);return this.runWithParsedOutput(s,async()=>{let i="password"in t.flags,c=(Array.isArray(s.environment)?s.environment:[s.environment]).filter(Boolean),m=o&&this.collectsEnvironmentResults(s),u=this.requiredFlagsForSingleEnvironment(r??[]),l=u.some(d=>Array.isArray(d)?d.includes("store"):d==="store");if(c.length<=1&&!(c.length>0&&m)){if(c[0]&&!s.store&&l)throw new x("Please provide a valid environment.");this.validateCommandFlags(s);let d=i?await this.createSession(s):void 0,N=this.constructor.name.toLowerCase();if(M(`theme-command:${N}:single-env:authenticated`),s.path&&!C(s.path))throw new x(`Path does not exist: ${s.path}`);try{await this.command(s,d,!1,a)}finally{await this.logAnalyticsData(d)}return}if(r===null&&c.length>1){if(s.json)throw new x("This command does not support multiple environments.");D({body:"This command does not support multiple environments."});return}let{flags:h}=await this.parse(ye(t),this.argv);if(c.length>1&&"path"in h){this.errorOnGlobalPath(!!s.json);return}let f=await this.loadEnvironments(c,s,h);m||=Array.from(f.values()).some(({flags:d})=>this.collectsEnvironmentResults(d));let T=async()=>{let d=await this.validateEnvironments(f,c.length===1?u:r??[],i,m);if((m?d.valid.some(({flags:I})=>this.requiresEnvironmentConfirmation(I)):this.requiresEnvironmentConfirmation(s))&&!await this.showConfirmation(this.constructor.name,r??[],d)){m&&this.renderEnvironmentResults(c.map(E=>({environment:E,result:{status:"cancelled"}})));return}let A=await this.runConcurrent(d.valid,m);if(m){let I=c.map(E=>{let q=d.invalid.find(Ne=>Ne.environment===E);return A.get(E)??{environment:E,error:{type:"abort",message:q?.reason??"The environment did not return a result."}}});this.renderEnvironmentResults(I),I.some(E=>"error"in E)&&(process.exitCode=1)}};return m&&R()!=="json"?oe({outputMode:"json",sink:ie},T):T()})}validateCommandFlags(e){}requiredFlagsForSingleEnvironment(e){return e.filter(t=>t!=="password")}collectsEnvironmentResults(e){let t=this.constructor;return!!(e.json&&t.jsonOutputSchema)}requiresEnvironmentConfirmation(e){return"force"in this.constructor.flags&&!e.force&&(!this.collectsEnvironmentResults(e)||fe())}renderEnvironmentResults(e){let t=this.constructor;ge(t.jsonOutputSchema.encode({environments:e}))}validateNonTTYFlags(e){let t=this.constructor;"multiEnvironmentsFlags"in t&&t.multiEnvironmentsFlags!==void 0&&Array.isArray(e.environment)&&(e.environment.length>1||e.environment.length===1&&this.hasExplicitEnvironment()&&this.collectsEnvironmentResults(e))||super.validateNonTTYFlags(e)}storeAuthScopes(){}hasExplicitEnvironment(){return this.argv.some(e=>e==="--environment"||e.startsWith("--environment=")||e.startsWith("-e"))||!!process.env.SHOPIFY_FLAG_ENVIRONMENT}async loadEnvironments(e,t,r){let o=new Map;for(let s of e){let i;try{i=await Se(s,"shopify.theme.toml",{from:t.path,silent:!0})}catch(c){if(!this.collectsEnvironmentResults(t))throw c;o.set(s,{flags:t,validationFlags:{},parserFlags:{},error:c instanceof Error?c.message:String(c)});continue}i?.store&&typeof i.store=="string"&&(i.store=w(i.store)),typeof i?.theme=="number"?i.theme=String(i.theme):Array.isArray(i?.theme)&&(i.theme=i.theme.map(String)),i?.path&&typeof i.path=="string"&&(i.path=$(i.path)),o.set(s,{parserFlags:{...i,...r},flags:{...t,...i,...r,environment:[s]},validationFlags:{...e.length===1?t:{},...i,...r}})}if(this.collectsEnvironmentResults(t)||Array.from(o.values()).some(s=>this.collectsEnvironmentResults(s.flags))){for(let[s,i]of o)if(!i.error){i.flags={...i.flags,json:!0};try{let c=await this.parseEnvironmentFlags({json:!0,...i.parserFlags},this.constructor,r);i.flags={...i.flags,...c,environment:[s]}}catch(c){i.error=c instanceof Error?c.message:String(c)}}}return o}async validateEnvironments(e,t,r,o=!1){let a=[],s=[],i=r?this.storeAuthSessionsForTheme(Array.from(e.values()).map(({validationFlags:m})=>m)):new Map,c=Array.from(e.entries()).map(([m,{flags:u,validationFlags:l,error:h}])=>({environmentName:m,error:h,flags:u,validationFlags:l,storeAuthSession:this.storeAuthSessionFromCache(l,i)}));for(let{environmentName:m,flags:u,validationFlags:l,storeAuthSession:h,error:f}of c){if(f){s.push({environment:m,reason:f});continue}let T=this.validConfig(l,t,m,h,o);if(T!==!0){let d=T.join(", ");s.push({environment:m,reason:`Missing flags: ${d}`});continue}try{this.validateCommandFlags(u),super.validateNonTTYFlags(u)}catch(d){if(!o)throw d;s.push({environment:m,reason:d instanceof Error?d.message:String(d)});continue}a.push({environment:m,flags:u,requiresAuth:r,storeAuthSession:h})}return{valid:a,invalid:s}}async showConfirmation(e,t,r){let s={message:[`Run ${e.toLowerCase()} in the following environments?`],confirmationMessage:"Yes, proceed",cancellationMessage:"Cancel"},i=[...r.valid.map(({environment:c,flags:m})=>{let u=t.map(l=>{let h=Array.isArray(l)?l.find(f=>m[f]):l;if(h==="password")return"password";if(h==="path"&&typeof m.path=="string"){let f=m.path.split(/[/\\]/);if(f.length===1)return`path: ${m.path}`;let T=f[0]===""?`/${f[1]}`:f[0],d=f.at(-1);return`path: ${T}/.../${d}`}return h&&`${h}: ${m[h]}`}).join(", ");return[c,{subdued:u||"No flags required"}]}),...r.invalid.map(({environment:c,reason:m})=>[c,{error:`Skipping | ${m}`}])];return s.infoTable={Environment:i},r.invalid.length>0&&(s.confirmationMessage="Proceed anyway (will skip invalid environments)"),le(s)}async runConcurrent(e,t=!1){let r=new Map,o=new ae,a=e.map(c=>c.flags.store),s=new Set(a),i=a.length===s.size?[e]:this.createSequentialGroups(e);for(let c of i){let m=c.map(({environment:u,flags:l,requiresAuth:h,storeAuthSession:f})=>({prefix:u,action:async(T,d,N)=>{try{let A=l.store,I=await _e(A,async()=>{let E=h?await this.createSession(l,f):void 0,q=this.constructor.name.toLowerCase();M(`theme-command:${q}:multi-env:authenticated`);try{return await this.command(t?{...l,json:!0}:l,E,!0,{},{stdout:T,stderr:d})}finally{await this.logAnalyticsData(E)}});r.set(u,{environment:u,result:I??{status:"cancelled"}})}catch(A){process.exitCode=1,t&&r.set(u,{environment:u,error:se(A)}),A instanceof Error&&(A.message=`Environment ${u} failed:
1
+ import{a as Se}from"./chunk-V7H7ITCF.js";import{a as se}from"./chunk-EA5XVQJT.js";import{a as ye,b as H}from"./chunk-OLKLHVHA.js";import{E as U,N as O,u as w,va as ce,xa as M,ya as me}from"./chunk-NCPZVARH.js";import{e as _}from"./chunk-J3UXIC23.js";import{d as ve}from"./chunk-5AWELO3D.js";import{B as D,C as B,F as le,W as fe,a as ae,y as pe}from"./chunk-V654BMS7.js";import{c as ie}from"./chunk-F3OM2YO6.js";import{b as ne,o as re}from"./chunk-335BUVBP.js";import{d as ue,e as de}from"./chunk-FHNJLON5.js";import{h as x,k as he}from"./chunk-J7BTC45S.js";import{Bb as g,Ea as te,Ta as C,qb as G,sb as y,wb as ge}from"./chunk-RIG66DIQ.js";import{h as oe,i as L,j as R}from"./chunk-FZCGRIOM.js";import{b as Le}from"./chunk-YTUUU33R.js";import{c as Z,e as $,h as ee,p as k}from"./chunk-IWTNUJGY.js";import{e as qe,g as S}from"./chunk-VKWPEFWQ.js";S();var b=qe(Le(),1);var Y={path:b.Flags.string({description:"The path where you want to run the command. Defaults to the current working directory.",env:"SHOPIFY_FLAG_PATH",parse:async n=>{let e=$(n);if(!C(e))throw new x("A path was explicitly provided but doesn't exist.",`Please check the path and try again: ${e}`);if(!te(e))throw new x("The path must be a directory, not a file.",`The provided path is not a directory: ${e}. Did you mean: ${ee(e)}`);return e},default:async()=>k(),noCacheDefault:!0}),password:b.Flags.string({description:"Password generated from the Theme Access app or an Admin API token.",env:"SHOPIFY_CLI_THEME_TOKEN"}),store:b.Flags.string({char:"s",description:"Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",env:"SHOPIFY_FLAG_STORE",parse:async n=>w(n)}),environment:b.Flags.string({char:"e",description:"The environment to apply to the current command.",env:"SHOPIFY_FLAG_ENVIRONMENT",multiple:!0})},we="Wrap the value in double quotes if you're using wildcards.",Ve=n=>({only:b.Flags.string({char:"o",multiple:!0,description:`${n.charAt(0).toUpperCase()+n.slice(1)} only the specified files (Multiple flags allowed). ${we}`,env:"SHOPIFY_FLAG_ONLY"}),ignore:b.Flags.string({char:"x",multiple:!0,description:`Skip ${n}ing the specified files (Multiple flags allowed). ${we}`,env:"SHOPIFY_FLAG_IGNORE"})});S();S();S();import{AsyncLocalStorage as Ue}from"node:async_hooks";var Fe=new Ue,Ae,Ee,xe,Te;function v(){return Ae??=new _({projectName:"shopify-cli-theme-conf"}),Ae}function z(){return Ee??=new _({projectName:"shopify-cli-development-theme-config"}),Ee}function J(){return xe??=new _({projectName:"shopify-cli-repl-theme-config"}),xe}function W(){return Te??=new _({projectName:"shopify-cli-theme-store-password"}),Te}function K(n=v()){return Fe.getStore()?.store??n.get("themeStore")}function Ie(n,e=v()){e.set("themeStore",n)}function rt(n=v()){return g(y`Getting development theme...`),z().get(F(n))}function ot(n,e=v()){g(y`Setting development theme...`),z().set(F(e),n)}function st(n=v()){g(y`Removing development theme...`),z().delete(F(n))}function it(n=v()){return g(y`Getting REPL theme...`),J().get(F(n))}function at(n,e=v()){g(y`Setting REPL theme to ${n}...`),J().set(F(e),n)}function ct(n=v()){g(y`Removing REPL theme...`),J().delete(F(n))}function mt(n=v()){let e=F(n);return g(y`Getting storefront password for shop ${e}...`),W().get(e)}function ut(n,e=v()){let t=F(e);g(y`Setting storefront password for shop ${t}...`),W().set(t,n)}function dt(n=v()){let e=F(n);g(y`Removing storefront password for ${e}...`),W().delete(e)}function F(n=v()){let e=K(n);if(!e)throw new he("Theme store is not set. This indicates an unexpected issue with the CLI. Please report this to the Shopify CLI team.",["It may be possible to recover by running",{command:"shopify theme list --store <store>"},"(setting the store flag to the store you wish to use) and then running the command again."]);return e}async function _e(n,e){return Fe.run({store:n},e)}function be(n){let e=n.store??K();if(!e)throw ce(new x("A store is required",`Specify the store passing ${y`${G.genericShellCommand(`--${Y.store.name}=example.myshopify.com`)}`.value} or set the ${y`${G.genericShellCommand(Y.store.env)}`.value} environment variable.`));return Ie(e),e}S();var Ce="shopify.theme.toml",At=new Intl.DateTimeFormat(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),Et=["**/.git","**/.vscode","**/.hg","**/.bzr","**/.svn","**/_darcs","**/CVS","**/*.sublime-(project|workspace)","**/.DS_Store","**/.sass-cache","**/Thumbs.db","**/desktop.ini","**/config.yml","**/node_modules/",".prettierrc.json","**/{blocks,layout,snippets}/**/*.liquid.tmp.*","**/{config,locales}/**/*.json.tmp.*","**/{sections,templates}/**/*.{liquid,json}.tmp.*"],xt=50;S();S();var V="7e9cb568cfd431c538f36d1ad3f2b4f6";var Oe="shopify-cli-store",Me=240*1e3,Pe;function j(){return Pe??=new _({projectName:Oe}),Pe}function P(n){return`${V}::${De(n)}`}function De(n){return n.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function p(n){return typeof n=="string"}function Be(n){if(!n||typeof n!="object")return;let e=n;if(typeof e.id=="number")return{id:e.id,...p(e.email)?{email:e.email}:{},...p(e.firstName)?{firstName:e.firstName}:{},...p(e.lastName)?{lastName:e.lastName}:{},...typeof e.accountOwner=="boolean"?{accountOwner:e.accountOwner}:{}}}function Ge(n){if(!n||typeof n!="object")return;let e=n;if(!(!p(e.shopId)||!p(e.name)||!p(e.createdAt)))return{shopId:e.shopId,name:e.name,createdAt:e.createdAt,...p(e.placeholderAccountUuid)?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...p(e.country)?{country:e.country}:{},...p(e.accessUrl)?{accessUrl:e.accessUrl}:{}}}function He(n){if(!n||typeof n!="object")return;let e=n;if(!p(e.store)||!p(e.clientId)||!p(e.userId)||!p(e.accessToken)||!Array.isArray(e.scopes)||!e.scopes.every(p)||!p(e.acquiredAt))return;let t=Be(e.associatedUser),r=e.kind==="preview"?"preview":"standard",o=r==="preview"?Ge(e.preview):void 0;if(!(r==="preview"&&!o))return{store:e.store,clientId:e.clientId,userId:e.userId,accessToken:e.accessToken,scopes:e.scopes,acquiredAt:e.acquiredAt,...p(e.refreshToken)?{refreshToken:e.refreshToken}:{},...p(e.expiresAt)?{expiresAt:e.expiresAt}:{},...p(e.refreshTokenExpiresAt)?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...t?{associatedUser:t}:{},...r==="preview"?{kind:r}:{},...o?{preview:o}:{}}}function $e(n,e,t){if(!e||typeof e!="object")return;let{sessionsByUserId:r,currentUserId:o}=e;if(!(r!==void 0||o!==void 0))return;let s=P(n);if(!r||typeof r!="object"||Array.isArray(r)||typeof o!="string"){t.delete(s);return}let i=Object.fromEntries(Object.entries(r).flatMap(([c,m])=>{let u=He(m);return u?[[c,u]]:[]}));if(Object.keys(i).length!==Object.keys(r).length)if(i[o])t.set(s,{currentUserId:o,sessionsByUserId:i});else{t.delete(s);return}return{currentUserId:o,sessionsByUserId:i}}function Q(n,e){return $e(n,e.get(P(n)),e)}function Ye(n){return n.config?.store??{}}function ke(n=j()){let e=[],t=`${V}::`;for(let[r,o]of Object.entries(Ye(n))){if(!r.startsWith(t))continue;let a=$e(r.slice(t.length),o,n),s=a?.sessionsByUserId[a.currentUserId];s&&e.push(s)}return e}function Re(n,e=j()){let t=w(n),r=Q(t,e);if(!r)return;let o=r.sessionsByUserId[r.currentUserId];if(!o){e.delete(P(t));return}return o}function kt(n,e=j()){let t=P(n.store),r=Q(n.store,e),o={currentUserId:n.userId,sessionsByUserId:{...r?.sessionsByUserId??{},[n.userId]:n}};e.set(t,o)}function Rt(n,e,t){let r=w(n),o=typeof e=="string"?e:void 0,a=(typeof e=="string"?t:e)??j(),s=P(r);if(!o){a.delete(s);return}let i=Q(r,a);if(!i)return;let{[o]:c,...m}=i.sessionsByUserId,u=Object.keys(m);if(u.length===0){a.delete(s);return}a.set(s,{currentUserId:i.currentUserId===o?u[0]:i.currentUserId,sessionsByUserId:m})}function je(n){if(!n.expiresAt)return!1;let e=new Date(n.expiresAt).getTime();return Number.isNaN(e)?!0:e-Me<Date.now()}var X=class extends H{static baseFlags={...H.baseFlags,...ve};environmentsFilename(){return this.hasExplicitEnvironment()&&this.collectsEnvironmentResults({json:re(process.env,this.argv)})?void 0:Ce}async command(e,t,r=!1,o,a){}async run(e){let t=this.constructor,r=t.multiEnvironmentsFlags,o=this.hasExplicitEnvironment(),{args:a,flags:s}=await this.parse(t);return this.runWithParsedOutput(s,async()=>{let i="password"in t.flags,c=(Array.isArray(s.environment)?s.environment:[s.environment]).filter(Boolean),m=o&&this.collectsEnvironmentResults(s),u=this.requiredFlagsForSingleEnvironment(r??[]),l=u.some(d=>Array.isArray(d)?d.includes("store"):d==="store");if(c.length<=1&&!(c.length>0&&m)){if(c[0]&&!s.store&&l)throw new x("Please provide a valid environment.");this.validateCommandFlags(s);let d=i?await this.createSession(s):void 0,N=this.constructor.name.toLowerCase();if(M(`theme-command:${N}:single-env:authenticated`),s.path&&!C(s.path))throw new x(`Path does not exist: ${s.path}`);try{await this.command(s,d,!1,a)}finally{await this.logAnalyticsData(d)}return}if(r===null&&c.length>1){if(s.json)throw new x("This command does not support multiple environments.");D({body:"This command does not support multiple environments."});return}let{flags:h}=await this.parse(ye(t),this.argv);if(c.length>1&&"path"in h){this.errorOnGlobalPath(!!s.json);return}let f=await this.loadEnvironments(c,s,h);m||=Array.from(f.values()).some(({flags:d})=>this.collectsEnvironmentResults(d));let T=async()=>{let d=await this.validateEnvironments(f,c.length===1?u:r??[],i,m);if((m?d.valid.some(({flags:I})=>this.requiresEnvironmentConfirmation(I)):this.requiresEnvironmentConfirmation(s))&&!await this.showConfirmation(this.constructor.name,r??[],d)){m&&this.renderEnvironmentResults(c.map(E=>({environment:E,result:{status:"cancelled"}})));return}let A=await this.runConcurrent(d.valid,m);if(m){let I=c.map(E=>{let q=d.invalid.find(Ne=>Ne.environment===E);return A.get(E)??{environment:E,error:{type:"abort",message:q?.reason??"The environment did not return a result."}}});this.renderEnvironmentResults(I),I.some(E=>"error"in E)&&(process.exitCode=1)}};return m&&R()!=="json"?oe({outputMode:"json",sink:ie},T):T()})}validateCommandFlags(e){}requiredFlagsForSingleEnvironment(e){return e.filter(t=>t!=="password")}collectsEnvironmentResults(e){let t=this.constructor;return!!(e.json&&t.jsonOutputSchema)}requiresEnvironmentConfirmation(e){return"force"in this.constructor.flags&&!e.force&&(!this.collectsEnvironmentResults(e)||fe())}renderEnvironmentResults(e){let t=this.constructor;ge(t.jsonOutputSchema.encode({environments:e}))}validateNonTTYFlags(e){let t=this.constructor;"multiEnvironmentsFlags"in t&&t.multiEnvironmentsFlags!==void 0&&Array.isArray(e.environment)&&(e.environment.length>1||e.environment.length===1&&this.hasExplicitEnvironment()&&this.collectsEnvironmentResults(e))||super.validateNonTTYFlags(e)}storeAuthScopes(){}hasExplicitEnvironment(){return this.argv.some(e=>e==="--environment"||e.startsWith("--environment=")||e.startsWith("-e"))||!!process.env.SHOPIFY_FLAG_ENVIRONMENT}async loadEnvironments(e,t,r){let o=new Map;for(let s of e){let i;try{i=await Se(s,"shopify.theme.toml",{from:t.path,silent:!0})}catch(c){if(!this.collectsEnvironmentResults(t))throw c;o.set(s,{flags:t,validationFlags:{},parserFlags:{},error:c instanceof Error?c.message:String(c)});continue}i?.store&&typeof i.store=="string"&&(i.store=w(i.store)),typeof i?.theme=="number"?i.theme=String(i.theme):Array.isArray(i?.theme)&&(i.theme=i.theme.map(String)),i?.path&&typeof i.path=="string"&&(i.path=$(i.path)),o.set(s,{parserFlags:{...i,...r},flags:{...t,...i,...r,environment:[s]},validationFlags:{...e.length===1?t:{},...i,...r}})}if(this.collectsEnvironmentResults(t)||Array.from(o.values()).some(s=>this.collectsEnvironmentResults(s.flags))){for(let[s,i]of o)if(!i.error){i.flags={...i.flags,json:!0};try{let c=await this.parseEnvironmentFlags({json:!0,...i.parserFlags},this.constructor,r);i.flags={...i.flags,...c,environment:[s]}}catch(c){i.error=c instanceof Error?c.message:String(c)}}}return o}async validateEnvironments(e,t,r,o=!1){let a=[],s=[],i=r?this.storeAuthSessionsForTheme(Array.from(e.values()).map(({validationFlags:m})=>m)):new Map,c=Array.from(e.entries()).map(([m,{flags:u,validationFlags:l,error:h}])=>({environmentName:m,error:h,flags:u,validationFlags:l,storeAuthSession:this.storeAuthSessionFromCache(l,i)}));for(let{environmentName:m,flags:u,validationFlags:l,storeAuthSession:h,error:f}of c){if(f){s.push({environment:m,reason:f});continue}let T=this.validConfig(l,t,m,h,o);if(T!==!0){let d=T.join(", ");s.push({environment:m,reason:`Missing flags: ${d}`});continue}try{this.validateCommandFlags(u),super.validateNonTTYFlags(u)}catch(d){if(!o)throw d;s.push({environment:m,reason:d instanceof Error?d.message:String(d)});continue}a.push({environment:m,flags:u,requiresAuth:r,storeAuthSession:h})}return{valid:a,invalid:s}}async showConfirmation(e,t,r){let s={message:[`Run ${e.toLowerCase()} in the following environments?`],confirmationMessage:"Yes, proceed",cancellationMessage:"Cancel"},i=[...r.valid.map(({environment:c,flags:m})=>{let u=t.map(l=>{let h=Array.isArray(l)?l.find(f=>m[f]):l;if(h==="password")return"password";if(h==="path"&&typeof m.path=="string"){let f=m.path.split(/[/\\]/);if(f.length===1)return`path: ${m.path}`;let T=f[0]===""?`/${f[1]}`:f[0],d=f.at(-1);return`path: ${T}/.../${d}`}return h&&`${h}: ${m[h]}`}).join(", ");return[c,{subdued:u||"No flags required"}]}),...r.invalid.map(({environment:c,reason:m})=>[c,{error:`Skipping | ${m}`}])];return s.infoTable={Environment:i},r.invalid.length>0&&(s.confirmationMessage="Proceed anyway (will skip invalid environments)"),le(s)}async runConcurrent(e,t=!1){let r=new Map,o=new ae,a=e.map(c=>c.flags.store),s=new Set(a),i=a.length===s.size?[e]:this.createSequentialGroups(e);for(let c of i){let m=c.map(({environment:u,flags:l,requiresAuth:h,storeAuthSession:f})=>({prefix:u,action:async(T,d,N)=>{try{let A=l.store,I=await _e(A,async()=>{let E=h?await this.createSession(l,f):void 0,q=this.constructor.name.toLowerCase();M(`theme-command:${q}:multi-env:authenticated`);try{return await this.command(t?{...l,json:!0}:l,E,!0,{},{stdout:T,stderr:d})}finally{await this.logAnalyticsData(E)}});r.set(u,{environment:u,result:I??{status:"cancelled"}})}catch(A){process.exitCode=1,t&&r.set(u,{environment:u,error:se(A)}),A instanceof Error&&(A.message=`Environment ${u} failed:
2
2
 
3
3
  ${A.message}`,t||R()==="json"?L({type:"diagnostic",level:"error",code:"theme-environment-failed",message:A.message}):B({body:[A.message]}))}}}));t?await Promise.all(m.map(({action:u})=>u(process.stdout,process.stderr,o.signal))):await pe({processes:m,abortSignal:o.signal,showTimestamps:!0,renderOptions:{stdout:process.stderr}})}return r}createSequentialGroups(e){let t=[];return e.forEach(r=>{let o=t.find(a=>!a.some(s=>s.flags.store===r.flags.store));o?o.push(r):t.push([r])}),t}async createSession(e,t){let r=be({store:e.store}),o=e.password;return o?await O(r,o):t??await this.storeAuthSessionForTheme({store:r})??await O(r,o)}async storeAuthSessionForTheme(e){let t=this.storeAuthScopes();if(!t)return;let r=typeof e.store=="string"?e.store:void 0,o=e.password;if(!r||o)return;let a=w(r),s=Re(a);if(s)return this.adminSessionFromStoreAuthSession(s,a,t)}storeAuthSessionsForTheme(e){let t=this.storeAuthScopes();if(!t)return new Map;let r=new Set(e.filter(({store:o,password:a})=>typeof o=="string"&&!a).map(({store:o})=>w(o)));return r.size===0?new Map:new Map(ke().map(o=>{let a=w(o.store);if(!r.has(a))return;let s=this.adminSessionFromStoreAuthSession(o,a,t);return s?[a,s]:void 0}).filter(o=>o!==void 0))}storeAuthSessionFromCache(e,t){let r=typeof e.store=="string"?e.store:void 0,o=e.password;if(!(!r||o))return t.get(w(r))}adminSessionFromStoreAuthSession(e,t,r){if(je(e)){g(`Ignoring stored store auth session for ${t}: it expired at ${e.expiresAt??"unknown"}.`);return}if(!this.hasRequiredStoreAuthScopes(e.scopes,r)){g(`Ignoring stored store auth session for ${t}: it is missing required scopes (has: ${e.scopes.join(", ")}; needs: ${r.join(", ")}).`);return}return g(`Using stored store auth session for ${t} (scopes: ${e.scopes.join(", ")}).`),U(e.userId),{token:e.accessToken,storeFqdn:t}}expandImpliedStoreAuthScopes(e){let t=new Set(e);for(let r of e){let o=r.match(/^(unauthenticated_)?write_(.*)$/);o&&t.add(`${o[1]??""}read_${o[2]}`)}return t}hasRequiredStoreAuthScopes(e,t){let r=this.expandImpliedStoreAuthScopes(e);return t.every(o=>r.has(o))}validConfig(e,t,r,o,a=!1){let s=t.filter(i=>Array.isArray(i)?!i.some(c=>this.hasRequiredFlag(e,c,o)):!this.hasRequiredFlag(e,i,o)).map(i=>Array.isArray(i)?i.join(" or "):i);return s.length>0?(a||R()==="json"?L({type:"diagnostic",level:"warning",code:"theme-environment-invalid",message:`Missing required flags in environment configuration for ${r}: ${s.join(", ")}`}):D({body:[`Missing required flags in environment configuration${r?` for ${r}`:""}:`,{list:{items:s}}]}),s):!0}hasRequiredFlag(e,t,r){return t==="password"&&r?!0:!!e[t]}errorOnGlobalPath(e){let t=Z(k(),"shopify.theme.toml"),r=C(t),o="Can't use `--path` flag with multiple environments.",a=r?["Configure each environment's theme path in your shopify.theme.toml file instead."]:["Run this command from the directory containing shopify.theme.toml.","No shopify.theme.toml found in current directory."];if(e)throw new x(o,a.join(" "));B({body:[o,...a]})}async logAnalyticsData(e){if(e)try{let t=me();await ue(()=>({store_fqdn_hash:ne(e.storeFqdn),store_domain:e.storeFqdn,cmd_theme_timings:JSON.stringify(t.timings),cmd_theme_errors:JSON.stringify(t.errors),cmd_theme_retries:JSON.stringify(t.retries),cmd_theme_events:JSON.stringify(t.events)})),await de(()=>({store_fqdn:e.storeFqdn}))}catch(t){g(`Unable to record theme analytics: ${t instanceof Error?t.message:String(t)}`)}}};export{V as a,ke as b,Re as c,kt as d,Rt as e,K as f,rt as g,ot as h,st as i,it as j,at as k,ct as l,mt as m,ut as n,dt as o,Y as p,Ve as q,be as r,At as s,Et as t,xt as u,X as v};
@@ -1,4 +1,4 @@
1
- import{a as re,b as oe,c as ie,d as ae}from"./chunk-2CMEKSI7.js";import{f as te,g as ne}from"./chunk-4GOJQKY5.js";import{q as v}from"./chunk-MXJAH2GW.js";import{c as Z,d as ee}from"./chunk-PEVIRAMR.js";import{a as X}from"./chunk-ZGV3HNEV.js";import{a as V}from"./chunk-FWB3GLMW.js";import{Ma as Q}from"./chunk-3C6VLJ5D.js";import{b as K,c as z,f as Y}from"./chunk-Q2SZCZE7.js";import{G,a as b,f as O,g as u,h as s,i as j,j as B,k as J,n as H,o as q,p as x,u as C}from"./chunk-CZ22VZDA.js";import{h as R}from"./chunk-2VSNFOKD.js";import{a as $}from"./chunk-GQNOVEKP.js";import{la as N}from"./chunk-LWCTKI4Z.js";import{g as U}from"./chunk-3A3DZVEJ.js";import{b as Fe}from"./chunk-YTUUU33R.js";import{c as I}from"./chunk-IWTNUJGY.js";import{e as S,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();c();c();var h=S(O(),1);import{Writable as se}from"stream";function ce({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:i}){let a={type:"functionRun",input:e.payload.input,output:e.payload.output,logs:e.payload.logs,name:e.source,size:0,memory_usage:0,instructions:e.payload.fuelConsumed},[m,p]=(0,h.useState)([]),[d,l]=(0,h.useState)([a,a]),[y,f]=(0,h.useState)(void 0),{input:w,export:W}=e.payload,[he,A]=(0,h.useState)(`Watching for changes to ${e.source}...`);return(0,h.useEffect)(()=>{let k=new b;t.signal.addEventListener("abort",()=>{k.abort()});let _=async()=>{let E=await xe(r,JSON.stringify(w),W);l(g=>[E,g[0]]),A(`Watching for changes to ${e.source}...`),p(g=>[...g,E])},ye=async()=>{A("Replaying log with local function..."),await _()},we=async()=>{i.onEvent(async g=>{let F=g.extensionEvents.find(L=>L.extension.handle===r.handle);if(!(!F||F.type!==Z.Updated)){if(F.buildResult?.status==="error"){f(`Error while reloading and building extension: ${F.buildResult?.error}`);return}f(void 0),A("Re-running with latest changes..."),await _()}});let E=new se({write(g,F,L){p(Ee=>[...Ee,{type:"systemMessage",message:g.toString()}]),L()}});await i.start({stdout:E,stderr:E,signal:k.signal},!1)};return ye().then(()=>{we()}),()=>{k.abort()}},[w,W,o,r]),C(t.signal,async()=>{setTimeout(()=>{U()||$(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:m,statusMessage:he,recentFunctionRuns:d,error:y}}async function xe(e,t,o){let r="",i=new se({write(m,p,d){r+=m,d()}});return await oe({functionExtension:e,input:t,export:o,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var n=S(O(),1);var ue=({selectedRun:e,abortController:t,app:o,extension:r})=>{let{isAborted:i}=C(t.signal),{isRawModeSupported:a}=B(),m=new ee(o),{logs:p,statusMessage:d,recentFunctionRuns:l,error:y}=ce({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:m});return J((f,w)=>{q(f,w,()=>t.abort()),f==="q"&&t.abort()},{isActive:!!a}),n.default.createElement(n.default.Fragment,null,n.default.createElement(j,{items:p},(f,w)=>n.default.createElement(u,{key:`replayOutputScrollerLog${w}`,flexDirection:"column"},n.default.createElement(Ae,{log:f}))),i?null:n.default.createElement(u,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},a?n.default.createElement(u,{flexDirection:"column"},n.default.createElement(u,{flexDirection:"row"},n.default.createElement(s,null,x.pointerSmall," ",d)),n.default.createElement(De,{recentFunctionRuns:l}),n.default.createElement(s,null,x.pointerSmall," Press ",n.default.createElement(s,{bold:!0},"q")," ",x.lineVertical," quit")):null,y?n.default.createElement(s,{color:"red"},y):null))};function D({title:e,backgroundColor:t}){let o=Math.max(Math.round((28-e.length)/2),0),r=" ".repeat(o);return n.default.createElement(s,{backgroundColor:t,color:"black"},`
1
+ import{a as re,b as oe,c as ie,d as ae}from"./chunk-ADVLRSSO.js";import{f as te,g as ne}from"./chunk-YXIFSIRX.js";import{q as v}from"./chunk-L6VONMA2.js";import{c as Z,d as ee}from"./chunk-GGJUPL4W.js";import{a as X}from"./chunk-NPB753M3.js";import{a as V}from"./chunk-D4LFWIFE.js";import{Ma as Q}from"./chunk-XV6XCOTG.js";import{b as K,c as z,f as Y}from"./chunk-5AWELO3D.js";import{G,a as b,f as O,g as u,h as s,i as j,j as B,k as J,n as H,o as q,p as x,u as C}from"./chunk-V654BMS7.js";import{h as R}from"./chunk-J7BTC45S.js";import{a as $}from"./chunk-QVVQUJQL.js";import{la as N}from"./chunk-RIG66DIQ.js";import{g as U}from"./chunk-GSGCSBRN.js";import{b as Fe}from"./chunk-YTUUU33R.js";import{c as I}from"./chunk-IWTNUJGY.js";import{e as S,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();c();c();var h=S(O(),1);import{Writable as se}from"stream";function ce({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:i}){let a={type:"functionRun",input:e.payload.input,output:e.payload.output,logs:e.payload.logs,name:e.source,size:0,memory_usage:0,instructions:e.payload.fuelConsumed},[m,p]=(0,h.useState)([]),[d,l]=(0,h.useState)([a,a]),[y,f]=(0,h.useState)(void 0),{input:w,export:W}=e.payload,[he,A]=(0,h.useState)(`Watching for changes to ${e.source}...`);return(0,h.useEffect)(()=>{let k=new b;t.signal.addEventListener("abort",()=>{k.abort()});let _=async()=>{let E=await xe(r,JSON.stringify(w),W);l(g=>[E,g[0]]),A(`Watching for changes to ${e.source}...`),p(g=>[...g,E])},ye=async()=>{A("Replaying log with local function..."),await _()},we=async()=>{i.onEvent(async g=>{let F=g.extensionEvents.find(L=>L.extension.handle===r.handle);if(!(!F||F.type!==Z.Updated)){if(F.buildResult?.status==="error"){f(`Error while reloading and building extension: ${F.buildResult?.error}`);return}f(void 0),A("Re-running with latest changes..."),await _()}});let E=new se({write(g,F,L){p(Ee=>[...Ee,{type:"systemMessage",message:g.toString()}]),L()}});await i.start({stdout:E,stderr:E,signal:k.signal},!1)};return ye().then(()=>{we()}),()=>{k.abort()}},[w,W,o,r]),C(t.signal,async()=>{setTimeout(()=>{U()||$(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:m,statusMessage:he,recentFunctionRuns:d,error:y}}async function xe(e,t,o){let r="",i=new se({write(m,p,d){r+=m,d()}});return await oe({functionExtension:e,input:t,export:o,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var n=S(O(),1);var ue=({selectedRun:e,abortController:t,app:o,extension:r})=>{let{isAborted:i}=C(t.signal),{isRawModeSupported:a}=B(),m=new ee(o),{logs:p,statusMessage:d,recentFunctionRuns:l,error:y}=ce({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:m});return J((f,w)=>{q(f,w,()=>t.abort()),f==="q"&&t.abort()},{isActive:!!a}),n.default.createElement(n.default.Fragment,null,n.default.createElement(j,{items:p},(f,w)=>n.default.createElement(u,{key:`replayOutputScrollerLog${w}`,flexDirection:"column"},n.default.createElement(Ae,{log:f}))),i?null:n.default.createElement(u,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},a?n.default.createElement(u,{flexDirection:"column"},n.default.createElement(u,{flexDirection:"row"},n.default.createElement(s,null,x.pointerSmall," ",d)),n.default.createElement(De,{recentFunctionRuns:l}),n.default.createElement(s,null,x.pointerSmall," Press ",n.default.createElement(s,{bold:!0},"q")," ",x.lineVertical," quit")):null,y?n.default.createElement(s,{color:"red"},y):null))};function D({title:e,backgroundColor:t}){let o=Math.max(Math.round((28-e.length)/2),0),r=" ".repeat(o);return n.default.createElement(s,{backgroundColor:t,color:"black"},`
2
2
 
3
3
  `,r,e,r,`
4
4
  `)}function Re({input:e}){return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(D,{title:"Input",backgroundColor:"yellow"}),n.default.createElement(s,null,v(e)))}function Se({logs:e}){return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(D,{title:"Logs",backgroundColor:"blueBright"}),n.default.createElement(s,null,e))}function be({output:e}){return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(D,{title:"Output",backgroundColor:"greenBright"}),n.default.createElement(s,null,v(e)))}function Ce({functionRun:e}){return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(D,{title:"Benchmark Results",backgroundColor:"green"}),n.default.createElement(s,null,"Name: ",e.name),n.default.createElement(s,null,"Linear Memory Usage: ",e.memory_usage,"KB"),n.default.createElement(s,null,"Instructions: ",e.instructions/1e3,"K"),n.default.createElement(s,null,"Size: ",e.size,"KB"))}function De({recentFunctionRuns:e}){let t=e[0].instructions-e[1].instructions;return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(s,null,x.pointerSmall," Instruction count change: ",t>0?"+":"",t))}function Ae({log:e}){switch(e.type){case"functionRun":return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(Re,{input:e.input}),n.default.createElement(Se,{logs:e.logs}),n.default.createElement(be,{output:e.output}),n.default.createElement(Ce,{functionRun:e}),n.default.createElement(s,null,"\xA0"));case"systemMessage":return n.default.createElement(s,null,e.message);default:return null}}var le=S(O(),1);async function me({selectedRun:e,abortController:t,app:o,extension:r}){return H(le.default.createElement(ue,{selectedRun:e,abortController:t,app:o,extension:r}),{exitOnCtrlC:!1})}c();async function pe(e){if(e.length===0)return;let t=i=>({label:`${i.logTimestamp} (${i.status}) - ${i.identifier}`,value:i}),o=e.map(t);return await G({message:"Which function run would you like to replay locally?",choices:o})}import{existsSync as ke,readdirSync as Le}from"fs";var M=100;async function fe(e){let{watch:t,extension:o,app:r}=e,i=new b;try{let a=await Ie(e),{input:m,export:p}=a.payload;if(t)await me({selectedRun:a,abortController:i,app:r,extension:o});else return await ie({functionExtension:o,json:e.json,input:JSON.stringify(m),export:p})}catch(a){throw i.abort(),a}}async function Ie(e){let t=e.app.getLogsDir();return e.log?Ne(t,e.extension.handle,e.log):ve(t,e.extension.handle)}async function Ne(e,t,o){let r=await Oe(e,t,o);if(r===void 0)throw new R(`No log found for '${o}'.
@@ -1,4 +1,4 @@
1
- import{d}from"./chunk-CZ22VZDA.js";import{h as _}from"./chunk-2VSNFOKD.js";import{Bb as u,Cb as E,Y as y,ca as O}from"./chunk-LWCTKI4Z.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();a();var f=class{export;input;inputBytes;output;outputBytes;logs;functionId;fuelConsumed;target;errorMessage;errorType;inputQueryVariablesMetafieldValue;inputQueryVariablesMetafieldNamespace;inputQueryVariablesMetafieldKey;constructor({export:t,input:r,inputBytes:s,output:n,outputBytes:o,logs:i,functionId:l,fuelConsumed:c,target:m,errorMessage:T,errorType:h,inputQueryVariablesMetafieldValue:S,inputQueryVariablesMetafieldNamespace:A,inputQueryVariablesMetafieldKey:g}){this.export=t,this.input=r,this.inputBytes=s,this.output=n,this.outputBytes=o,this.logs=i,this.functionId=l,this.fuelConsumed=c,this.target=m,this.errorMessage=T,this.errorType=h,this.inputQueryVariablesMetafieldValue=S,this.inputQueryVariablesMetafieldNamespace=A,this.inputQueryVariablesMetafieldKey=g}};a();function b(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function I(e,t){return t?.deep&&b(e)||t?.deep&&Array.isArray(e)?p(e,t):e}function p(e,t){if(Array.isArray(e))return e.map(r=>t?.deep?p(r,t):r);if(b(e)){let r={};for(let[s,n]of Object.entries(e))r[y(s)]=I(n,t);return r}return e}var R=450,x=5*1e3,N=60*1e3,K=5,F=1e6,D="function_run",$="function_network_access",j="function_network_access.response_from_cache",Y="function_network_access.request_execution_in_background",X="function_network_access.request_execution",H="no_cached_response",W="cached_response_about_to_expire",q=async e=>{let{errors:t}=e.response,r=R,s=null,n="not_attempted";if(t.length>0)if(u(`Errors: ${t.map(o=>o.message).join(", ")}`),t.some(o=>o.status===401))try{s=await e.onResubscribe(),n="succeeded"}catch(o){u(`Failed to resubscribe to app logs: ${o}`),r=N,n="failed",e.onThrottle(r)}else t.some(o=>o.status===429)?(r=N,e.onThrottle(r)):(r=x,e.onUnknownError(r));return{retryIntervalMs:r,nextJwtToken:s,resubscribeResult:n}},z=({appLog:e,appLogPayload:t,storeName:r,prettyPrint:s=!0})=>{let{cursor:n,...o}=e,i=p({...o,payload:t,localTime:O(e.log_timestamp),storeName:r});return t instanceof f&&(i.payload.logs=t.logs.split(`
1
+ import{d}from"./chunk-V654BMS7.js";import{h as _}from"./chunk-J7BTC45S.js";import{Bb as u,Cb as E,Y as y,ca as O}from"./chunk-RIG66DIQ.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();a();var f=class{export;input;inputBytes;output;outputBytes;logs;functionId;fuelConsumed;target;errorMessage;errorType;inputQueryVariablesMetafieldValue;inputQueryVariablesMetafieldNamespace;inputQueryVariablesMetafieldKey;constructor({export:t,input:r,inputBytes:s,output:n,outputBytes:o,logs:i,functionId:l,fuelConsumed:c,target:m,errorMessage:T,errorType:h,inputQueryVariablesMetafieldValue:S,inputQueryVariablesMetafieldNamespace:A,inputQueryVariablesMetafieldKey:g}){this.export=t,this.input=r,this.inputBytes=s,this.output=n,this.outputBytes=o,this.logs=i,this.functionId=l,this.fuelConsumed=c,this.target=m,this.errorMessage=T,this.errorType=h,this.inputQueryVariablesMetafieldValue=S,this.inputQueryVariablesMetafieldNamespace=A,this.inputQueryVariablesMetafieldKey=g}};a();function b(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function I(e,t){return t?.deep&&b(e)||t?.deep&&Array.isArray(e)?p(e,t):e}function p(e,t){if(Array.isArray(e))return e.map(r=>t?.deep?p(r,t):r);if(b(e)){let r={};for(let[s,n]of Object.entries(e))r[y(s)]=I(n,t);return r}return e}var R=450,x=5*1e3,N=60*1e3,K=5,F=1e6,D="function_run",$="function_network_access",j="function_network_access.response_from_cache",Y="function_network_access.request_execution_in_background",X="function_network_access.request_execution",H="no_cached_response",W="cached_response_about_to_expire",q=async e=>{let{errors:t}=e.response,r=R,s=null,n="not_attempted";if(t.length>0)if(u(`Errors: ${t.map(o=>o.message).join(", ")}`),t.some(o=>o.status===401))try{s=await e.onResubscribe(),n="succeeded"}catch(o){u(`Failed to resubscribe to app logs: ${o}`),r=N,n="failed",e.onThrottle(r)}else t.some(o=>o.status===429)?(r=N,e.onThrottle(r)):(r=x,e.onUnknownError(r));return{retryIntervalMs:r,nextJwtToken:s,resubscribeResult:n}},z=({appLog:e,appLogPayload:t,storeName:r,prettyPrint:s=!0})=>{let{cursor:n,...o}=e,i=p({...o,payload:t,localTime:O(e.log_timestamp),storeName:r});return t instanceof f&&(i.payload.logs=t.logs.split(`
2
2
  `).filter(Boolean),i.payload.inputQueryVariablesMetafieldValue&&(i.payload.inputQueryVariablesMetafieldValue=C(i.payload.inputQueryVariablesMetafieldValue))),s?JSON.stringify(i,null,2):JSON.stringify(i)},Z=async(e,t,r,s)=>{let n=await e.subscribeToAppLogs(t,r);if(!n.appLogsSubscribe)throw new _("Failed to subscribe to app logs: No response received");let{jwtToken:o,success:i,errors:l}=n.appLogsSubscribe;if(u(`Token: ${o}
3
3
  `),u(`API Key: ${t.apiKey}
4
4
  `),l&&l.length>0){let c=l.join(", ");throw await d({stripAnsi:!1},()=>{E(`Errors subscribing to app logs: ${c}`,s),E("App log streaming is not available in this session.",s)}),new _(c)}else{if(!o)throw new _("Failed to subscribe to app logs: No response received");let c=Array.isArray(t.shopIds)?t.shopIds:[t.shopIds];u(`Subscribed to App Events for shop ID(s) ${c.join(", ")}`),i!==void 0&&u(`Success: ${i}
@@ -1,2 +1,2 @@
1
- import{h as g,j as S,l as s,m as I,o as E}from"./chunk-NDKSG4CC.js";import{a as p}from"./chunk-6BNKBCCU.js";import{A as l,B as c,z as h}from"./chunk-CZ22VZDA.js";import{h as m}from"./chunk-2VSNFOKD.js";import{wb as u}from"./chunk-LWCTKI4Z.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();a();function f(e){return S.encode(E(e))}function y(e){return g.encode({status:e.outcomes.some(({status:o})=>o==="failed")?"partial":"success",operations:e.outcomes.map(o=>o.status==="success"?{status:o.status,operationGid:o.operationId,operation:s(o.operation)}:{status:o.status,operationGid:o.operationId,operation:o.operation===null?null:s(o.operation),error:"error"in o?p(o.error):{type:"abort",message:o.userErrors.map(({message:i})=>i).join("; "),details:{userErrors:I(o.userErrors)}}})})}function T(e){j(e)}function Y(e,o){if(e.status==="failed"&&e.submission.operations.length===0){let i=["Subscription migration submission failed.",...e.failure.type==="submission"?e.failure.userErrors.map(({message:n})=>n):[]].join(`
1
+ import{h as g,j as S,l as s,m as I,o as E}from"./chunk-FNWXMCSD.js";import{a as p}from"./chunk-EA5XVQJT.js";import{A as l,B as c,z as h}from"./chunk-V654BMS7.js";import{h as m}from"./chunk-J7BTC45S.js";import{wb as u}from"./chunk-RIG66DIQ.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();a();function f(e){return S.encode(E(e))}function y(e){return g.encode({status:e.outcomes.some(({status:o})=>o==="failed")?"partial":"success",operations:e.outcomes.map(o=>o.status==="success"?{status:o.status,operationGid:o.operationId,operation:s(o.operation)}:{status:o.status,operationGid:o.operationId,operation:o.operation===null?null:s(o.operation),error:"error"in o?p(o.error):{type:"abort",message:o.userErrors.map(({message:i})=>i).join("; "),details:{userErrors:I(o.userErrors)}}})})}function T(e){j(e)}function Y(e,o){if(e.status==="failed"&&e.submission.operations.length===0){let i=["Subscription migration submission failed.",...e.failure.type==="submission"?e.failure.userErrors.map(({message:n})=>n):[]].join(`
2
2
  `),r=new m(i);throw r.details=e.failure.type==="submission"?{batchIndex:e.failure.batchIndex,userErrors:e.failure.userErrors.map(({message:n,field:t})=>({message:n,fieldPath:t}))}:{operationGids:e.failure.operationIds},r}return e.status==="cancelled"?(o.json&&u(f(e)),0):(o.json?u(f(e)):e.status==="failed"?$(e):o.watch?h({headline:"Subscription migration operations.",body:e.submission.operations.map(({operation:i})=>b(i))}):j(e.submission),e.status==="failed"?1:0)}function k(e,o){let i=e.outcomes[0];if(e.outcomes.length===1&&i?.status==="failed"){if("error"in i)throw i.error;let n=new m(i.userErrors.map(({message:t})=>t).join("; "));throw n.details={operationGid:i.operationId,operation:i.operation===null?null:s(i.operation),userErrors:i.userErrors.map(({message:t,field:d})=>({message:t,fieldPath:d}))},n}let r=e.outcomes.some(({status:n})=>n==="failed");return o.json?u(y(e)):r?c({headline:"Some subscription migration operations could not be canceled.",body:M(e.outcomes)}):l({headline:"Subscription migration operations canceled.",body:M(e.outcomes)}),r?1:0}function j(e){let o=e.action==="schedule"?"scheduled":"unscheduled";l({headline:`Subscription migrations ${o}.`,body:[`Shops: ${e.total}`,"Operation IDs:",...e.operations.map(({operation:i})=>i.id),"Save every operation ID. You will need them to check or cancel this submission."]})}function $(e){if(e.failure.type==="operations"){c({headline:"Some subscription migration operations failed.",body:["Failed operation IDs:",...e.failure.operationIds,"Terminal operation outcomes:",...e.submission.operations.map(({operation:i})=>b(i)),"Save every operation ID. You will need them to inspect this submission."]});return}let o=e.submission.operations.map(({operation:i})=>i.id);c({headline:o.length===0?"Subscription migration submission failed.":"Some subscription migration operations were accepted before submission failed.",body:[...o.length===0?["Accepted operation IDs: None."]:["Accepted operation IDs:",...o],`Batch index: ${e.failure.batchIndex}`,"Errors:",...e.failure.userErrors.map(({message:i})=>i),...o.length===0?[]:["Save every accepted operation ID. You will need them to check or cancel accepted operations."]]})}function M(e){let o=e.filter(r=>r.status==="success"),i=e.filter(r=>r.status==="failed");return[...o.length===0?["Canceled operations: None."]:["Canceled operations:",...o.map(({operation:r})=>b(r))],...i.length===0?[]:["Failed operations:",...i.map(r=>{let n=r.operation?` (returned status: ${r.operation.status})`:"",t="error"in r?p(r.error).message:r.userErrors.map(({message:d})=>d).join("; ");return`${r.operationId}: ${t}${n}`})]]}function b(e){return`${e.id}: ${e.status} (${e.results.edges.length}/${e.total} settled)`}export{T as a,Y as b,k as c};
@@ -1,4 +1,4 @@
1
- import{h as E}from"./chunk-2VSNFOKD.js";import{Bb as O,Sa as V,la as N,qb as $,sb as T}from"./chunk-LWCTKI4Z.js";import{a as g,c as w,e as Y,g as m}from"./chunk-VKWPEFWQ.js";var I=w((z,R)=>{R.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var K=w((X,d)=>{m();var b=g("fs"),y=g("path"),q=g("os"),F=g("crypto"),P=I(),D=P.version,C=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function S(e){let n={},r=e.toString();r=r.replace(/\r\n?/mg,`
1
+ import{h as E}from"./chunk-J7BTC45S.js";import{Bb as O,Sa as V,la as N,qb as $,sb as T}from"./chunk-RIG66DIQ.js";import{a as g,c as w,e as Y,g as m}from"./chunk-VKWPEFWQ.js";var I=w((z,R)=>{R.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var K=w((X,d)=>{m();var b=g("fs"),y=g("path"),q=g("os"),F=g("crypto"),P=I(),D=P.version,C=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function S(e){let n={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
2
  `);let s;for(;(s=C.exec(r))!=null;){let a=s[1],t=s[2]||"";t=t.trim();let o=t[0];t=t.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(t=t.replace(/\\n/g,`
3
3
  `),t=t.replace(/\\r/g,"\r")),n[a]=t}return n}function U(e){e=e||{};let n=x(e);e.path=n;let r=l.configDotenv(e);if(!r.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${n} for an unknown reason`);throw o.code="MISSING_DATA",o}let s=A(e).split(","),a=s.length,t;for(let o=0;o<a;o++)try{let i=s[o].trim(),f=M(r,i);t=l.decrypt(f.ciphertext,f.key);break}catch(i){if(o+1>=a)throw i}return l.parse(t)}function B(e){console.log(`[dotenv@${D}][WARN] ${e}`)}function v(e){console.log(`[dotenv@${D}][DEBUG] ${e}`)}function j(e){console.log(`[dotenv@${D}] ${e}`)}function A(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function M(e,n){let r;try{r=new URL(n)}catch(i){if(i.code==="ERR_INVALID_URL"){let f=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw f.code="INVALID_DOTENV_KEY",f}throw i}let s=r.password;if(!s){let i=new Error("INVALID_DOTENV_KEY: Missing key part");throw i.code="INVALID_DOTENV_KEY",i}let a=r.searchParams.get("environment");if(!a){let i=new Error("INVALID_DOTENV_KEY: Missing environment part");throw i.code="INVALID_DOTENV_KEY",i}let t=`DOTENV_VAULT_${a.toUpperCase()}`,o=e.parsed[t];if(!o){let i=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${t} in your .env.vault file.`);throw i.code="NOT_FOUND_DOTENV_ENVIRONMENT",i}return{ciphertext:o,key:s}}function x(e){let n=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)b.existsSync(r)&&(n=r.endsWith(".vault")?r:`${r}.vault`);else n=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else n=y.resolve(process.cwd(),".env.vault");return b.existsSync(n)?n:null}function k(e){return e[0]==="~"?y.join(q.homedir(),e.slice(1)):e}function W(e){let n=!!(e&&e.debug),r=e&&"quiet"in e?e.quiet:!0;(n||!r)&&j("Loading env from encrypted .env.vault");let s=l._parseVault(e),a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),l.populate(a,s,e),{parsed:s}}function G(e){let n=y.resolve(process.cwd(),".env"),r="utf8",s=!!(e&&e.debug),a=e&&"quiet"in e?e.quiet:!0;e&&e.encoding?r=e.encoding:s&&v("No encoding is specified. UTF-8 is used by default");let t=[n];if(e&&e.path)if(!Array.isArray(e.path))t=[k(e.path)];else{t=[];for(let u of e.path)t.push(k(u))}let o,i={};for(let u of t)try{let c=l.parse(b.readFileSync(u,{encoding:r}));l.populate(i,c,e)}catch(c){s&&v(`Failed to load ${u} ${c.message}`),o=c}let f=process.env;if(e&&e.processEnv!=null&&(f=e.processEnv),l.populate(f,i,e),s||!a){let u=Object.keys(i).length,c=[];for(let p of t)try{let h=y.relative(process.cwd(),p);c.push(h)}catch(h){s&&v(`Failed to load ${p} ${h.message}`),o=h}j(`injecting env (${u}) from ${c.join(",")}`)}return o?{parsed:i,error:o}:{parsed:i}}function J(e){if(A(e).length===0)return l.configDotenv(e);let n=x(e);return n?l._configVault(e):(B(`You set DOTENV_KEY but you are missing a .env.vault file at ${n}. Did you forget to build it?`),l.configDotenv(e))}function Q(e,n){let r=Buffer.from(n.slice(-64),"hex"),s=Buffer.from(e,"base64"),a=s.subarray(0,12),t=s.subarray(-16);s=s.subarray(12,-16);try{let o=F.createDecipheriv("aes-256-gcm",r,a);return o.setAuthTag(t),`${o.update(s)}${o.final()}`}catch(o){let i=o instanceof RangeError,f=o.message==="Invalid key length",u=o.message==="Unsupported state or unable to authenticate data";if(i||f){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw o}}function H(e,n,r={}){let s=!!(r&&r.debug),a=!!(r&&r.override);if(typeof n!="object"){let t=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw t.code="OBJECT_REQUIRED",t}for(let t of Object.keys(n))Object.prototype.hasOwnProperty.call(e,t)?(a===!0&&(e[t]=n[t]),s&&v(a===!0?`"${t}" is already defined and WAS overwritten`:`"${t}" is already defined and was NOT overwritten`)):e[t]=n[t]}var l={configDotenv:G,_configVault:W,_parseVault:U,config:J,decrypt:Q,parse:S,populate:H};d.exports.configDotenv=l.configDotenv;d.exports._configVault=l._configVault;d.exports._parseVault=l._parseVault;d.exports.config=l.config;d.exports.decrypt=l.decrypt;d.exports.parse=l.parse;d.exports.populate=l.populate;d.exports=l});m();var L=Y(K());async function oe(e){if(O(T`Reading the .env file at ${$.path(e)}`),!await V(e))throw new E(`The environment file at ${e} does not exist.`);let n=await N(e);return{path:e,variables:(0,L.parse)(n)}}function se(e,n){let r=[],s=e===null?[]:e.split(`
4
4
  `),a=[],t;for(let o of s){if(t){if(o.endsWith(t.quote)){let u=_(t.key,t.value+o.slice(0,-1),t.quote),c=n[t.key];c&&(a.push(t.key),u=_(t.key,c)),r.push(u),t=void 0}else t.value+=`${o}
@@ -1,4 +1,4 @@
1
- import{a as U}from"./chunk-BCYTZ7LM.js";import{c as I,i as _,j as A,p as D}from"./chunk-DNMXVMJM.js";import{e as k}from"./chunk-PSSYLJG4.js";import{a as q}from"./chunk-P33TONYG.js";import{e as x}from"./chunk-QFWWCZOI.js";import{p as E,v as F}from"./chunk-DJAZBPYA.js";import{b as O,c as j}from"./chunk-Q2SZCZE7.js";import{O as L}from"./chunk-CZ22VZDA.js";import{h as d}from"./chunk-2VSNFOKD.js";import{Bb as p,_a as v,ka as S,ta as R,wb as w}from"./chunk-LWCTKI4Z.js";import{b as t}from"./chunk-FZCGRIOM.js";import{b as X}from"./chunk-YTUUU33R.js";import{c as h,h as $}from"./chunk-IWTNUJGY.js";import{e as z,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();var J=t.object({name:t.string(),file:t.string().optional(),line:t.number().optional(),col:t.number().optional()}).passthrough(),N=t.object({type:t.enum(["O","C"]),at:t.number(),frame:t.number()}).passthrough(),H=t.object({name:t.string(),unit:t.enum(["bytes","microseconds","milliseconds","nanoseconds","none","seconds"]),startValue:t.number(),endValue:t.number()}),B=H.extend({type:t.literal("evented"),events:t.array(N)}).passthrough(),M=H.extend({type:t.literal("sampled"),samples:t.array(t.array(t.number())),weights:t.array(t.number())}).passthrough(),C=t.object({frames:t.array(J)}).passthrough(),T=t.object({$schema:t.literal("https://www.speedscope.app/file-format-schema.json"),shared:C,profiles:t.array(t.discriminatedUnion("type",[B,M])),name:t.string().optional(),exporter:t.string().optional(),activeProfileIndex:t.number().optional()}).passthrough().describe("The native Speedscope file format, defined by its $schema URL. Original keys and extension fields are preserved."),u=x({name:"ThemeProfileResult",schema:T,project:o=>o,definitions:{ProfileFrame:J,ProfileEvent:N,ProfileShared:C,EventedProfile:B,SampledProfile:M}});var g="https://storefront.invalid",K=200;async function W(o,e,r,s,a){if(r.startsWith("//")||!URL.canParse(r,g))throw new d(`${r} isn't a valid storefront URL.`,"Pass the path of a storefront page to --url, for example /products/classic-leather-jacket.");let n=await I(o)?await U(a,o.storeFqdn):void 0;if(s)throw new d("Unable to use Admin API or Theme Access tokens with the profile command","You must authenticate manually by not passing the --password flag.");let f=await D(e,o,s,n),m=Y(r),i=await A(f,{method:"GET",path:m.pathname,query:[...m.searchParams],themeId:e,headers:{Accept:"application/vnd.speedscope+json"}});if(i.status>=300&&i.status<400)throw new d(`The page ${r} redirects (${i.status}) instead of rendering, so it can't be profiled.`,Z(m,i.headers.get("Location")));if(i.status!==200){let y=await ee(i);throw new d(`Can't profile ${r}. The storefront responded with ${i.status}.${y}`)}let c=await i.text();return{result:T.parse(JSON.parse(c)),source:c}}function Y(o){let e=new URL(o,g);return Object.keys(_).forEach(r=>e.searchParams.delete(r)),e}function G(o){return`${o.pathname}${o.search}`}function Z(o,e){if(!e||!URL.canParse(e,g))return null;let r=Y(e);if(r.pathname==="/password")return"It redirects to the storefront password page. Check the storefront password, and pass it with --store-password.";let s=G(r),a=r.origin===g,n=a?s:r.href;return s===G(o)?`It redirects to ${n}.`:a?`It redirects to ${n}. Run the command again with --url "${s}".`:`It redirects to ${n}. If that page is on your storefront, run the command again with --url "${s}".`}async function ee(o){let e=o.headers.get("x-request-id"),r=e?`
1
+ import{a as U}from"./chunk-2CJQQQW4.js";import{c as I,i as _,j as A,q as D}from"./chunk-2RFCYZMG.js";import{e as k}from"./chunk-AQ34X5B3.js";import{a as q}from"./chunk-63UKZLPC.js";import{e as x}from"./chunk-QFWWCZOI.js";import{p as E,v as F}from"./chunk-KT5QQOES.js";import{b as O,c as j}from"./chunk-5AWELO3D.js";import{O as L}from"./chunk-V654BMS7.js";import{h as d}from"./chunk-J7BTC45S.js";import{Bb as p,_a as v,ka as S,ta as R,wb as w}from"./chunk-RIG66DIQ.js";import{b as t}from"./chunk-FZCGRIOM.js";import{b as X}from"./chunk-YTUUU33R.js";import{c as h,h as $}from"./chunk-IWTNUJGY.js";import{e as z,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();var J=t.object({name:t.string(),file:t.string().optional(),line:t.number().optional(),col:t.number().optional()}).passthrough(),N=t.object({type:t.enum(["O","C"]),at:t.number(),frame:t.number()}).passthrough(),H=t.object({name:t.string(),unit:t.enum(["bytes","microseconds","milliseconds","nanoseconds","none","seconds"]),startValue:t.number(),endValue:t.number()}),B=H.extend({type:t.literal("evented"),events:t.array(N)}).passthrough(),M=H.extend({type:t.literal("sampled"),samples:t.array(t.array(t.number())),weights:t.array(t.number())}).passthrough(),C=t.object({frames:t.array(J)}).passthrough(),T=t.object({$schema:t.literal("https://www.speedscope.app/file-format-schema.json"),shared:C,profiles:t.array(t.discriminatedUnion("type",[B,M])),name:t.string().optional(),exporter:t.string().optional(),activeProfileIndex:t.number().optional()}).passthrough().describe("The native Speedscope file format, defined by its $schema URL. Original keys and extension fields are preserved."),u=x({name:"ThemeProfileResult",schema:T,project:o=>o,definitions:{ProfileFrame:J,ProfileEvent:N,ProfileShared:C,EventedProfile:B,SampledProfile:M}});var g="https://storefront.invalid",K=200;async function W(o,e,r,s,a){if(r.startsWith("//")||!URL.canParse(r,g))throw new d(`${r} isn't a valid storefront URL.`,"Pass the path of a storefront page to --url, for example /products/classic-leather-jacket.");let n=await I(o)?await U(a,o.storeFqdn):void 0;if(s)throw new d("Unable to use Admin API or Theme Access tokens with the profile command","You must authenticate manually by not passing the --password flag.");let f=await D(e,o,s,n),m=Y(r),i=await A(f,{method:"GET",path:m.pathname,query:[...m.searchParams],themeId:e,headers:{Accept:"application/vnd.speedscope+json"}});if(i.status>=300&&i.status<400)throw new d(`The page ${r} redirects (${i.status}) instead of rendering, so it can't be profiled.`,Z(m,i.headers.get("Location")));if(i.status!==200){let y=await ee(i);throw new d(`Can't profile ${r}. The storefront responded with ${i.status}.${y}`)}let c=await i.text();return{result:T.parse(JSON.parse(c)),source:c}}function Y(o){let e=new URL(o,g);return Object.keys(_).forEach(r=>e.searchParams.delete(r)),e}function G(o){return`${o.pathname}${o.search}`}function Z(o,e){if(!e||!URL.canParse(e,g))return null;let r=Y(e);if(r.pathname==="/password")return"It redirects to the storefront password page. Check the storefront password, and pass it with --store-password.";let s=G(r),a=r.origin===g,n=a?s:r.href;return s===G(o)?`It redirects to ${n}.`:a?`It redirects to ${n}. Run the command again with --url "${s}".`:`It redirects to ${n}. If that page is on your storefront, run the command again with --url "${s}".`}async function ee(o){let e=o.headers.get("x-request-id"),r=e?`
2
2
  Request ID: ${e}`:"",s=(await o.text()).trim(),a=o.headers.get("Content-Type")?.includes("application/json")??!1,f=s.length>0&&(a||s.length<=K)?`
3
3
  ${s}`:"";return`${r}${f}`}l();l();import{fileURLToPath as te}from"node:url";async function V(...o){let e=await v("package.json",{cwd:te(import.meta.url),type:"file"});if(!e)throw new Error("Failed to find CLI root path");return e.endsWith("/packages/theme/package.json")?h($(e),"assets",...o):h($(e),"dist","assets",...o)}async function Q({result:o,source:e},r){u.validate(o),r==="json"?w(e):await re(e)}async function re(o){let e=process.env.WSL_DISTRO_NAME,r=e?`//wsl$/${e}`:"",s=await V("speedscope","index.html");p(`[Theme Profile] Resolved URL to open: ${s}`);let a="liquid-profile",n=Buffer.from(o).toString("base64"),f=`speedscope.loadFileFromBase64(${JSON.stringify(a)}, ${JSON.stringify(n)})`,m=`speedscope-${Number(new Date)}-${process.pid}`,i=h(S(),`${m}.js`);p(`[Theme Profile] writing JS file to: ${i}`),await R(i,f),p(`[Theme Profile] JS file created successfully: ${i}`),s=`${r}${s}`,i=`${r}${i}`,s+=`#localProfilePath=${i}`;let c=h(S(),`${m}.html`);p(`[Theme Profile] writing HTML file to: ${c}`),await R(c,`<script>window.location=${JSON.stringify(s)}</script>`),p(`[Theme Profile] HTML file created successfully: ${c}`),c=`${r}${c}`,s=`file://${c}`,p(`[Theme Profile] Opening URL: ${s}`);let y=await L(s);p(`[Theme Profile] URL opened successfully: ${y}`)}var P=z(X(),1);var b=class extends F{static get jsonOutputSchema(){return u}static summary="Profile the Liquid rendering of a theme page.";static usage=["theme profile","theme profile --url /products/classic-leather-jacket"];static descriptionWithMarkdown=`Profile the Shopify Liquid on a given page.
4
4
 
@@ -1 +1 @@
1
- import{D as c,J as p,M as o,U as S,j as f,t as h,w as y,z as g}from"./chunk-LMQGNECW.js";import{h as a}from"./chunk-2VSNFOKD.js";import{i as d}from"./chunk-IWTNUJGY.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();async function A(t,e){let r=c(t);if(await y(t.appDirectory,r))return;let{scan:s}=p(t,e),n=new a(`No app security check results for ${r} in ${t.appDirectory}.`,`Run \`${o(s)}\`.`);throw n.code="results-directory-not-found",n}async function q(t,e){await A(t,e);let r=h(t.appDirectory,c(t)),[s,n]=await Promise.all([b(r.deterministicFindingsPath,"deterministic"),b(r.agentFindingsPath,"agent")]),i=[v(s,"deterministic"),v(n,"agent")].filter(k=>k!==void 0);i.length>0&&D(i,p(t,e));let u=w(s),l=w(n);return{sources:{deterministic:u,agent:l},checks:f({deterministic:u?.document??null,agent:l?.document??null})}}async function b(t,e){return{path:t,result:await g(t,e)}}function v(t,e){if(t.result.status==="invalid")return{source:e,path:t.path,errors:t.result.errors}}function w(t){return t.result.status!=="ok"?null:{path:t.path,document:t.result.value}}function D(t,e){let r=t.length===1?"The app security check results could not be loaded because a results file is invalid.":"The app security check results could not be loaded because both results files are invalid.",s=[...t.map(i=>R(i.source,e,`${d(i.path)}.`)),["Or run",{command:o(e.clean)},"to delete both results files and start over."]],n=new a(r,null,s,t.map($));throw n.code="results-file-invalid",n.details={files:t.map(({path:i,errors:u})=>({path:S(i),errors:u}))},n}function R(t,e,r){return t==="deterministic"?["Run",{command:o(e.scan)},`to regenerate ${r}`]:["Have your coding agent run",{command:o(e.record)},`again to regenerate ${r}`]}function $(t){return{title:t.path,body:{list:{items:t.errors}}}}export{A as a,q as b};
1
+ import{D as c,J as p,M as o,U as S,j as f,t as h,w as y,z as g}from"./chunk-MNWT2SQO.js";import{h as a}from"./chunk-J7BTC45S.js";import{i as d}from"./chunk-IWTNUJGY.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();async function A(t,e){let r=c(t);if(await y(t.appDirectory,r))return;let{scan:s}=p(t,e),n=new a(`No app security check results for ${r} in ${t.appDirectory}.`,`Run \`${o(s)}\`.`);throw n.code="results-directory-not-found",n}async function q(t,e){await A(t,e);let r=h(t.appDirectory,c(t)),[s,n]=await Promise.all([b(r.deterministicFindingsPath,"deterministic"),b(r.agentFindingsPath,"agent")]),i=[v(s,"deterministic"),v(n,"agent")].filter(k=>k!==void 0);i.length>0&&D(i,p(t,e));let u=w(s),l=w(n);return{sources:{deterministic:u,agent:l},checks:f({deterministic:u?.document??null,agent:l?.document??null})}}async function b(t,e){return{path:t,result:await g(t,e)}}function v(t,e){if(t.result.status==="invalid")return{source:e,path:t.path,errors:t.result.errors}}function w(t){return t.result.status!=="ok"?null:{path:t.path,document:t.result.value}}function D(t,e){let r=t.length===1?"The app security check results could not be loaded because a results file is invalid.":"The app security check results could not be loaded because both results files are invalid.",s=[...t.map(i=>R(i.source,e,`${d(i.path)}.`)),["Or run",{command:o(e.clean)},"to delete both results files and start over."]],n=new a(r,null,s,t.map($));throw n.code="results-file-invalid",n.details={files:t.map(({path:i,errors:u})=>({path:S(i),errors:u}))},n}function R(t,e,r){return t==="deterministic"?["Run",{command:o(e.scan)},`to regenerate ${r}`]:["Have your coding agent run",{command:o(e.record)},`again to regenerate ${r}`]}function $(t){return{title:t.path,body:{list:{items:t.errors}}}}export{A as a,q as b};
@@ -1 +1 @@
1
- import{a as $,c as M}from"./chunk-RVQV6G5M.js";import{d as N,f as Q,u as P}from"./chunk-OGWPS55W.js";import{a as C}from"./chunk-ZGV3HNEV.js";import{a as G,c as q}from"./chunk-FWB3GLMW.js";import{b as L}from"./chunk-AJMDF3QC.js";import{b as X,c as j}from"./chunk-H4V55Y3Z.js";import{b as J,c as R}from"./chunk-Q2SZCZE7.js";import{A as w,C as k,J as x}from"./chunk-CZ22VZDA.js";import{a as S}from"./chunk-BN7ZXAZJ.js";import{h as p}from"./chunk-2VSNFOKD.js";import{Sa as A,la as b,qb as m,sb as c,ta as E,wb as f}from"./chunk-LWCTKI4Z.js";import{b as a}from"./chunk-FZCGRIOM.js";import{e as y,g as O}from"./chunk-IWTNUJGY.js";import{e as K,g as i}from"./chunk-VKWPEFWQ.js";i();i();var V=K(X(),1);async function Y(o,e){if(o)try{return JSON.parse(o)}catch(r){let t=r instanceof Error?r.message:"Unknown error";throw new p(c`Invalid JSON in ${m.yellow("--variables")} flag: ${t}`,"Please provide valid JSON format.")}else if(e){if(!await A(e))throw new p(c`Variable file not found at ${m.path(e)}. Please check the path and try again.`);let r=await b(e,{encoding:"utf8"});try{return JSON.parse(r)}catch(t){let s=t instanceof Error?t.message:"Unknown error";throw new p(c`Invalid JSON in variable file ${m.path(e)}: ${s}`,"Please provide valid JSON format.")}}}async function F(o){let{remoteApp:e,store:r,query:t,variables:s,variableFile:h,version:U}=o,{adminSession:H,version:W}=await x({title:c`Authenticating`,task:async()=>{let n=await $(e,r.shopDomain),d=await Q({adminSession:n,userSpecifiedVersion:U});return{adminSession:n,version:d}},renderOptions:{stdout:process.stderr}}),B=await Y(s,h);N(t),M(t,r);try{let n;return{status:"success",result:{data:await x({title:c`Executing GraphQL operation`,task:async()=>L({query:(0,V.parse)(t),session:H,variables:B,version:W,responseOptions:{handleErrors:!1,onResponse:u=>{n=u.extensions}}}),renderOptions:{stdout:process.stderr}}),...n===void 0?{}:{extensions:n}}}}catch(n){if(n instanceof j){let{errors:d,extensions:u,data:v}=n.response;return{status:"failed",details:{...d===void 0?{}:{errors:d},...u===void 0?{}:{extensions:u},...v===void 0?{}:{data:v}}}}throw n}}i();var z=a.unknown().and(a.record(a.unknown())),I=a.object({data:z.nullable().describe("Native GraphQL query data, preserving fields and aliases."),extensions:z.optional().describe("Native GraphQL response extensions, when supplied.")}).strict(),D=a.object({path:a.string().refine(O,"Expected an absolute filesystem path."),format:a.literal("json")}).strict().describe("Receipt for a written JSON file containing the GraphQL result, including data and optional extensions."),l=S({name:"AppExecuteResult",schema:a.union([I,D]),definitions:{AppExecuteGraphQLResult:I,AppExecuteFileReceipt:D}});i();async function T(o,e,r){if(o.status==="failed"){if(e==="json"){let s=new p("GraphQL operation failed.");throw s.details=o.details,s}k({headline:"GraphQL operation failed.",body:JSON.stringify({errors:o.details.errors},null,2)});return}let t=e==="json"?l.encode(o.result):JSON.stringify(o.result.data,null,2);r?(await E(r,t),e==="json"?f(l.encode({path:y(r),format:"json"})):w({headline:"Operation succeeded.",body:`Results written to ${r}`})):e==="json"?f(t):(w({headline:"Operation succeeded."}),f(t))}var g=class o extends C{static summary="Execute GraphQL queries and mutations.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store. Mutations are only allowed on dev stores.\n\n For operations that process large amounts of data, use [`bulk execute`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) instead.";static get jsonOutputSchema(){return l}static description=this.descriptionForHelp();static flags={...J,...G,...q,...R};async run(){let{flags:e}=await this.parse(o),{query:r,appContextResult:t,store:s}=await P(e),h=await F({organization:t.organization,remoteApp:t.remoteApp,store:s,query:r,variables:e.variables,variableFile:e["variable-file"],...e.version&&{version:e.version}});return await T(h,e.json?"json":"text",e["output-file"]),{app:t.app}}};export{g as a};
1
+ import{a as $,c as M}from"./chunk-XDXHSGDL.js";import{d as N,f as Q,u as P}from"./chunk-5XOEMYEQ.js";import{a as C}from"./chunk-NPB753M3.js";import{a as G,c as q}from"./chunk-D4LFWIFE.js";import{b as L}from"./chunk-7AWAOPLA.js";import{b as X,c as j}from"./chunk-NCPZVARH.js";import{b as J,c as R}from"./chunk-5AWELO3D.js";import{A as w,C as k,J as x}from"./chunk-V654BMS7.js";import{a as S}from"./chunk-BN7ZXAZJ.js";import{h as p}from"./chunk-J7BTC45S.js";import{Sa as A,la as b,qb as m,sb as c,ta as E,wb as f}from"./chunk-RIG66DIQ.js";import{b as a}from"./chunk-FZCGRIOM.js";import{e as y,g as O}from"./chunk-IWTNUJGY.js";import{e as K,g as i}from"./chunk-VKWPEFWQ.js";i();i();var V=K(X(),1);async function Y(o,e){if(o)try{return JSON.parse(o)}catch(r){let t=r instanceof Error?r.message:"Unknown error";throw new p(c`Invalid JSON in ${m.yellow("--variables")} flag: ${t}`,"Please provide valid JSON format.")}else if(e){if(!await A(e))throw new p(c`Variable file not found at ${m.path(e)}. Please check the path and try again.`);let r=await b(e,{encoding:"utf8"});try{return JSON.parse(r)}catch(t){let s=t instanceof Error?t.message:"Unknown error";throw new p(c`Invalid JSON in variable file ${m.path(e)}: ${s}`,"Please provide valid JSON format.")}}}async function F(o){let{remoteApp:e,store:r,query:t,variables:s,variableFile:h,version:U}=o,{adminSession:H,version:W}=await x({title:c`Authenticating`,task:async()=>{let n=await $(e,r.shopDomain),d=await Q({adminSession:n,userSpecifiedVersion:U});return{adminSession:n,version:d}},renderOptions:{stdout:process.stderr}}),B=await Y(s,h);N(t),M(t,r);try{let n;return{status:"success",result:{data:await x({title:c`Executing GraphQL operation`,task:async()=>L({query:(0,V.parse)(t),session:H,variables:B,version:W,responseOptions:{handleErrors:!1,onResponse:u=>{n=u.extensions}}}),renderOptions:{stdout:process.stderr}}),...n===void 0?{}:{extensions:n}}}}catch(n){if(n instanceof j){let{errors:d,extensions:u,data:v}=n.response;return{status:"failed",details:{...d===void 0?{}:{errors:d},...u===void 0?{}:{extensions:u},...v===void 0?{}:{data:v}}}}throw n}}i();var z=a.unknown().and(a.record(a.unknown())),I=a.object({data:z.nullable().describe("Native GraphQL query data, preserving fields and aliases."),extensions:z.optional().describe("Native GraphQL response extensions, when supplied.")}).strict(),D=a.object({path:a.string().refine(O,"Expected an absolute filesystem path."),format:a.literal("json")}).strict().describe("Receipt for a written JSON file containing the GraphQL result, including data and optional extensions."),l=S({name:"AppExecuteResult",schema:a.union([I,D]),definitions:{AppExecuteGraphQLResult:I,AppExecuteFileReceipt:D}});i();async function T(o,e,r){if(o.status==="failed"){if(e==="json"){let s=new p("GraphQL operation failed.");throw s.details=o.details,s}k({headline:"GraphQL operation failed.",body:JSON.stringify({errors:o.details.errors},null,2)});return}let t=e==="json"?l.encode(o.result):JSON.stringify(o.result.data,null,2);r?(await E(r,t),e==="json"?f(l.encode({path:y(r),format:"json"})):w({headline:"Operation succeeded.",body:`Results written to ${r}`})):e==="json"?f(t):(w({headline:"Operation succeeded."}),f(t))}var g=class o extends C{static summary="Execute GraphQL queries and mutations.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store. Mutations are only allowed on dev stores.\n\n For operations that process large amounts of data, use [`bulk execute`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) instead.";static get jsonOutputSchema(){return l}static description=this.descriptionForHelp();static flags={...J,...G,...q,...R};async run(){let{flags:e}=await this.parse(o),{query:r,appContextResult:t,store:s}=await P(e),h=await F({organization:t.organization,remoteApp:t.remoteApp,store:s,query:r,variables:e.variables,variableFile:e["variable-file"],...e.version&&{version:e.version}});return await T(h,e.json?"json":"text",e["output-file"]),{app:t.app}}};export{g as a};
@@ -1,2 +1,2 @@
1
- import{Bb as n,Sa as o,qb as e,sb as r,ta as d,va as f}from"./chunk-LWCTKI4Z.js";import{c as i}from"./chunk-IWTNUJGY.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var g=".shopify";async function c(h){let t=i(h,g),a=i(t,".gitignore");return await o(t)||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await f(t)),await o(a)||(n(r`Creating .gitignore in ${e.path(t)}...`),await d(a,`# Ignore the entire ${g} directory
1
+ import{Bb as n,Sa as o,qb as e,sb as r,ta as d,va as f}from"./chunk-RIG66DIQ.js";import{c as i}from"./chunk-IWTNUJGY.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var g=".shopify";async function c(h){let t=i(h,g),a=i(t,".gitignore");return await o(t)||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await f(t)),await o(a)||(n(r`Creating .gitignore in ${e.path(t)}...`),await d(a,`# Ignore the entire ${g} directory
2
2
  *`)),t}export{c as a};
@@ -1,4 +1,4 @@
1
- import{b as i,c as r,d as p}from"./chunk-2ORRV7GH.js";import{b as o}from"./chunk-ZQDDRIBA.js";import{b as s,c as e}from"./chunk-Q2SZCZE7.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class u extends o{static summary="Disable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Disable automatic upgrades for Shopify CLI.
1
+ import{b as i,c as r,d as p}from"./chunk-IY5EI5V2.js";import{b as o}from"./chunk-OLKLHVHA.js";import{b as s,c as e}from"./chunk-5AWELO3D.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class u extends o{static summary="Disable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Disable automatic upgrades for Shopify CLI.
2
2
 
3
3
  When auto-upgrade is disabled, Shopify CLI won't automatically update. Run \`shopify upgrade\` to update manually.
4
4
 
@@ -0,0 +1 @@
1
+ import{g as I}from"./chunk-VKWPEFWQ.js";I();var o="5.0.1";export{o as a};
@@ -1,4 +1,4 @@
1
- import{a as F,b as c,c as P}from"./chunk-HF4NDEX3.js";import{a as I}from"./chunk-6PUU6ZNQ.js";import{a as S}from"./chunk-PSSYLJG4.js";import{a as w}from"./chunk-YY6TFARF.js";import{a as j}from"./chunk-P33TONYG.js";import{e as g}from"./chunk-QFWWCZOI.js";import{p as v}from"./chunk-5TB52UUV.js";import{p as T,v as y}from"./chunk-DJAZBPYA.js";import{b as d,c as b,f as n}from"./chunk-Q2SZCZE7.js";import{A as p,F as f}from"./chunk-CZ22VZDA.js";import{wb as a}from"./chunk-LWCTKI4Z.js";import{b as h}from"./chunk-FZCGRIOM.js";import{b as k}from"./chunk-YTUUU33R.js";import{e as R,g as r}from"./chunk-VKWPEFWQ.js";r();r();var x=I.extend({changed:h.boolean(),theme:F}),s=g({name:"ThemePublishResult",schema:h.object({status:h.literal("success"),changed:h.boolean(),theme:c}).strict(),definitions:{Theme:c},project(t){let e=x.parse(t);return{status:e.status,changed:e.changed,theme:P(e.theme)}}});r();function O(t,e,m){if(e==="json"){a(s.encode(t.data));return}p({headline:m?`Environment: ${m}`:void 0,body:["The theme",...S(t.originalTheme),t.data.changed?"is now live at":"is already live at",{link:{label:t.previewUrl,url:t.previewUrl}},{char:"."}]})}r();async function M(t,e,m){let o=await j(t,{header:"Select a theme to publish",filter:{development:!1,live:!1,theme:e.theme}}),i=w({...o,role:"live"},t);return o.role==="live"?{data:{status:"success",changed:!1,theme:{...o,shop:t.storeFqdn}},originalTheme:o,previewUrl:i}:!e.force&&!m&&!await f({message:`Do you want to make '${o.name}' the new live theme on ${t.storeFqdn}?`,confirmationMessage:`Yes, make '${o.name}' the new live theme`,cancellationMessage:"No, cancel publish"})?void 0:{data:{status:"success",changed:!0,theme:{...await v(o.id,t),shop:t.storeFqdn}},originalTheme:o,previewUrl:i}}var u=R(k(),1);var l=class extends y{static get jsonOutputSchema(){return s}static summary="Set a remote theme as the live theme.";static descriptionWithMarkdown=`Publishes an unpublished theme from your theme library.
1
+ import{a as F,b as c,c as P}from"./chunk-HF4NDEX3.js";import{a as I}from"./chunk-6PUU6ZNQ.js";import{a as S}from"./chunk-AQ34X5B3.js";import{a as w}from"./chunk-YY6TFARF.js";import{a as j}from"./chunk-63UKZLPC.js";import{e as g}from"./chunk-QFWWCZOI.js";import{p as v}from"./chunk-2NZ7GDDR.js";import{p as T,v as y}from"./chunk-KT5QQOES.js";import{b as d,c as b,f as n}from"./chunk-5AWELO3D.js";import{A as p,F as f}from"./chunk-V654BMS7.js";import{wb as a}from"./chunk-RIG66DIQ.js";import{b as h}from"./chunk-FZCGRIOM.js";import{b as k}from"./chunk-YTUUU33R.js";import{e as R,g as r}from"./chunk-VKWPEFWQ.js";r();r();var x=I.extend({changed:h.boolean(),theme:F}),s=g({name:"ThemePublishResult",schema:h.object({status:h.literal("success"),changed:h.boolean(),theme:c}).strict(),definitions:{Theme:c},project(t){let e=x.parse(t);return{status:e.status,changed:e.changed,theme:P(e.theme)}}});r();function O(t,e,m){if(e==="json"){a(s.encode(t.data));return}p({headline:m?`Environment: ${m}`:void 0,body:["The theme",...S(t.originalTheme),t.data.changed?"is now live at":"is already live at",{link:{label:t.previewUrl,url:t.previewUrl}},{char:"."}]})}r();async function M(t,e,m){let o=await j(t,{header:"Select a theme to publish",filter:{development:!1,live:!1,theme:e.theme}}),i=w({...o,role:"live"},t);return o.role==="live"?{data:{status:"success",changed:!1,theme:{...o,shop:t.storeFqdn}},originalTheme:o,previewUrl:i}:!e.force&&!m&&!await f({message:`Do you want to make '${o.name}' the new live theme on ${t.storeFqdn}?`,confirmationMessage:`Yes, make '${o.name}' the new live theme`,cancellationMessage:"No, cancel publish"})?void 0:{data:{status:"success",changed:!0,theme:{...await v(o.id,t),shop:t.storeFqdn}},originalTheme:o,previewUrl:i}}var u=R(k(),1);var l=class extends y{static get jsonOutputSchema(){return s}static summary="Set a remote theme as the live theme.";static descriptionWithMarkdown=`Publishes an unpublished theme from your theme library.
2
2
 
3
3
  If no theme ID is specified, then you're prompted to select the theme that you want to publish from the list of themes in your store.
4
4
 
@@ -1,4 +1,4 @@
1
- import{g as dn}from"./chunk-XM7YUXTF.js";import{a as be}from"./chunk-FWB3GLMW.js";import{A as Je,B as Ke,C as fn,D as mn,Ja as wn,Na as xn,ea as vn,ga as bn,l as we,m as Be,r as ln,s as pn,t as hn}from"./chunk-3C6VLJ5D.js";import{N as Qe,Z as un,ha as gn,ia as yn,s as Ve}from"./chunk-WDFCOZAY.js";import{a as cn}from"./chunk-D7NB7YR6.js";import{da as Qr}from"./chunk-M5TGCSUK.js";import{a as We}from"./chunk-UOS2XLGG.js";import{a as Jt}from"./chunk-4C2DAX5T.js";import{F as rn,Q as on}from"./chunk-CZ22VZDA.js";import{a as nn}from"./chunk-335BUVBP.js";import{h as A,k as sn}from"./chunk-2VSNFOKD.js";import{Bb as an,Da as ze,Fa as Xt,Ga as Zt,Sa as en,Ta as Ge,ab as tn,la as Kt,ma as Yt,na as de}from"./chunk-LWCTKI4Z.js";import{b as d}from"./chunk-FZCGRIOM.js";import{b as Br}from"./chunk-YTUUU33R.js";import{c as b,d as R,e as k,f as w,g as ve,h as T,i as S,j as O,n as P,p as L}from"./chunk-IWTNUJGY.js";import{e as Qt,g as u}from"./chunk-VKWPEFWQ.js";u();var kn=Qt(Br(),1);function Sn(e){return kn.Flags.boolean({description:"Scan --path as an app with no app configuration file. Config checks are skipped. Requires --client-id.",env:"SHOPIFY_FLAG_WITHOUT_APP_CONFIG",exclusive:["config"],...e})}var Jr={path:be.path,config:be.config,"client-id":be["client-id"],"without-app-config":Sn({dependsOn:["client-id"]})},dd={...Jr,"without-app-config":Sn({relationships:[{type:"all",flags:[{name:"client-id",when:async e=>!e.all}]}]})};u();import{lstat as Kr}from"node:fs/promises";var Yr={confirmScanWithoutAppConfig:e=>rn({message:`No app configuration found at or above ${e}. Scan it without app configuration? Config checks will be skipped.`,confirmationMessage:"Yes, scan without app configuration",cancellationMessage:"No",defaultValue:!1}),pickClientId:async e=>(await bn(wn(e))).apiKey,pickConfigFile:async e=>(await pn(e)).valueOrAbort(),lookUpApp:async e=>{await vn({apiKey:e,offerReset:!1})}};function _n(e){return e.kind==="config"?S(e.appConfigFilePath):void 0}function Tn(e){return e.kind==="no-config"?e.clientId:e.clientIdOverride??e.configClientId}function Ed(e){return e.kind==="no-config"?e.clientId:e.clientIdOverride??S(e.appConfigFilePath,".toml")}async function Ad(e){let t=await ke(e.path);if(e.withoutAppConfig)return t;try{return await de((await Je.load(e.path)).directory)}catch(n){throw n instanceof Ke?new xe(e.path):n}}async function Id(e,t=Yr){if(e.withoutAppConfig){if(!e.clientId)throw new A("--without-app-config requires --client-id.");let n=await ke(e.path);return await Ye(e,t),{kind:"no-config",appDirectory:n,clientId:e.clientId,clientIdSource:"flag"}}await ke(e.path);try{let n=e.config?void 0:await Xr(e,t),{app:i,project:r,activeConfig:s}=await xn({directory:e.path,userProvidedConfigName:e.config??n?.fileName,skipPrompts:!e.allowPrompts});await Ye(e,t);let o=await de(i.directory);return{kind:"config",appDirectory:o,appConfigFilePath:b(o,S(i.configPath)),appConfigDirectories:await es(r,s.file),configClientId:i.configuration.client_id||void 0,clientIdOverride:e.clientId,appConfigFilePicked:n?.picked}}catch(n){if(!(n instanceof Ke))throw n;return Zr(e,t)}}async function Xr(e,t){let{directory:n}=await Je.load(e.path),i=hn(n)?.configFile;if(i&&Ge(b(n,i)))return;if(Ge(b(n,Ve.app)))return i?{fileName:Ve.app,picked:!1}:void 0;let r=(await ln(n)).map(s=>S(s));return r.length===1?{fileName:r[0],picked:!1}:((!e.allowPrompts||e.clientId)&&is(n,r,e.clientId),{fileName:await t.pickConfigFile(n),picked:!0})}async function Zr(e,t){if(!e.allowPrompts)throw new xe(e.path);let n=await ke(e.path);return await Ye(e,t),await t.confirmScanWithoutAppConfig(e.path)?e.clientId?{kind:"no-config",appDirectory:n,clientId:e.clientId,clientIdSource:"flag"}:{kind:"no-config",appDirectory:n,clientId:await t.pickClientId(n),clientIdSource:"picker"}:{kind:"declined"}}async function Ye(e,t){e.validateClientIdFlag&&e.clientId!==void 0&&await t.lookUpApp(e.clientId)}async function Rd(e){let t=[];for(let n of e){let i=k(L(),n),r=await En(i);if(r===void 0)throw new A(`--include-dir ${n}: directory doesn't exist.`);if(!await ze(r))throw new A(`--include-dir ${n}: not a directory.`);t.push(r)}return t}async function es(e,t){let n=[...fn(e,t),...mn(e,t)].map(r=>T(r.path)).filter(r=>!P(e.directory,r)),i=[];for(let r of new Set(n))await ts(e.directory,r)||i.push(await de(r));return i.sort()}async function ts(e,t){let n=w(e,t).split("/"),i=b(e,...n.filter(r=>r===".."));for(let r of n.filter(s=>s!==".."))if(i=b(i,r),(await Kr(i)).isSymbolicLink())return!0;return!1}function Cd(e,t,n=[]){let i=a=>b(e,w(e,a))!==R(a),r=t.find(i);if(r)throw new A(`--include-dir ${r}: must be on the same drive as the app directory.`);let s=n.find(i);if(s)throw new A(`Extension or web directory ${s}: must be on the same drive as the app directory.`);let o=[{directory:e,origin:"app_directory"},...t.map(a=>({directory:a,origin:"include_dir"})),...n.map(a=>({directory:a,origin:"app_config_directory"}))].filter((a,c,p)=>p.findIndex(({directory:l})=>l===a.directory)===c);return{scanDirectories:o.filter(a=>!o.some(({directory:c})=>c!==a.directory&&P(c,a.directory))),requestedScanDirectories:o.map(({directory:a})=>a)}}function ns(e){return{headline:`No app configuration found at or above ${e}.`,nextStep:"Pass `--path` to your app directory, or scan without app configuration with `--without-app-config --client-id <client-id>`."}}var xe=class extends A{constructor(t){let{headline:n,nextStep:i}=ns(t);super(n,i)}};function is(e,t,n){let i=t.map(r=>we(r)??r).join(", ");throw new A(`${t.length} app configurations found in ${e}, and none is selected.`,n?`\`--client-id\` can't be combined with \`--config\`, so first select one with \`shopify app config use <config>\`: ${i}.`:`Pass \`--config\` with one of: ${i}.`)}async function ke(e){let t=await En(e);if(t===void 0||!await ze(t))throw new A(`--path ${e}: not a directory.`);return t}async function En(e){return de(e).catch(()=>{})}u();import{realpathSync as rs}from"node:fs";var ss={include_dirs:[],excludes:[],no_git_ignore:!1};function An(e){try{return rs(e)}catch{return k(e)}}function os(e){return An(e)===An(L())?[]:[{flag:"--path",value:w(L(),e)}]}function as(e){if(e.kind==="no-config")return[{flag:"--client-id",value:e.clientId},"--without-app-config"];if(e.clientIdOverride)return[{flag:"--client-id",value:e.clientIdOverride}];let t=_n(e),n=t?we(t):void 0;return n?[{flag:"--config",value:n}]:[]}function cs(e){return[...e.include_dirs.map(t=>({flag:"--include-dir",value:t})),...e.excludes.map(t=>({flag:"--exclude",value:t})),...e.no_git_ignore?["--no-git-ignore"]:[]]}function Fd(e,t,n=ss){let i="shopify",r=s=>["app","security",s,...os(t),...as(e)];return{scan:{command:i,args:[...r("check"),...cs(n)]},record:{command:i,args:r("record"),stdinPlaceholder:"<findings.json>"},review:{command:i,args:r("review")},clean:{command:i,args:r("clean")}}}function In(e=process.platform,t=process.env){return e!=="win32"||ds(t)?"posix":ls(t)}function ds(e){if(e.MSYSTEM||e.CYGWIN)return!0;let t=e.SHELL??"";return/(?:^|[\\/])(bash|zsh|sh|fish|dash)(?:\.exe)?$/i.test(t)}function ls(e){return e.PROMPT?"cmd":e.POWERSHELL_DISTRIBUTION_CHANNEL||e.PSExecutionPolicyPreference||e.PSModulePath?"powershell":"cmd"}function ps(e,t){return t==="cmd"?us(e):t==="powershell"?`'${e.replaceAll("'","''")}'`:`'${e.replaceAll("'","'\\''")}'`}function us(e){return e.split("%").map(hs).join("^%")}function hs(e){let t=e.replace(/"/g,'""'),n=/\\+$/.exec(t)?.[0]??"";return`"${t}${n}"`}function Md(e,t=In()){let n=Rn(e,t);return e.stdinPlaceholder?t==="powershell"?`Get-Content -Raw -Encoding UTF8 ${e.stdinPlaceholder} | ${n}`:`${n} < ${e.stdinPlaceholder}`:n}function $d(e,t,n=In()){let i=Rn(e,n);if(n==="posix")return`${i} <<'EOF'
1
+ import{g as dn}from"./chunk-EH22T4FI.js";import{a as be}from"./chunk-D4LFWIFE.js";import{A as Je,B as Ke,C as fn,D as mn,Ja as wn,Na as xn,ea as vn,ga as bn,l as we,m as Be,r as ln,s as pn,t as hn}from"./chunk-XV6XCOTG.js";import{O as Qe,_ as un,ia as gn,ja as yn,t as Ve}from"./chunk-WFOU5M4H.js";import{a as cn}from"./chunk-M73IECPW.js";import{da as Qr}from"./chunk-DTRENW4Q.js";import{a as We}from"./chunk-HP2ZAAY7.js";import{a as Jt}from"./chunk-MHWETFNT.js";import{F as rn,Q as on}from"./chunk-V654BMS7.js";import{a as nn}from"./chunk-335BUVBP.js";import{h as A,k as sn}from"./chunk-J7BTC45S.js";import{Bb as an,Da as ze,Fa as Xt,Ga as Zt,Sa as en,Ta as Ge,ab as tn,la as Kt,ma as Yt,na as de}from"./chunk-RIG66DIQ.js";import{b as d}from"./chunk-FZCGRIOM.js";import{b as Br}from"./chunk-YTUUU33R.js";import{c as b,d as R,e as k,f as w,g as ve,h as T,i as S,j as O,n as P,p as L}from"./chunk-IWTNUJGY.js";import{e as Qt,g as u}from"./chunk-VKWPEFWQ.js";u();var kn=Qt(Br(),1);function Sn(e){return kn.Flags.boolean({description:"Scan --path as an app with no app configuration file. Config checks are skipped. Requires --client-id.",env:"SHOPIFY_FLAG_WITHOUT_APP_CONFIG",exclusive:["config"],...e})}var Jr={path:be.path,config:be.config,"client-id":be["client-id"],"without-app-config":Sn({dependsOn:["client-id"]})},dd={...Jr,"without-app-config":Sn({relationships:[{type:"all",flags:[{name:"client-id",when:async e=>!e.all}]}]})};u();import{lstat as Kr}from"node:fs/promises";var Yr={confirmScanWithoutAppConfig:e=>rn({message:`No app configuration found at or above ${e}. Scan it without app configuration? Config checks will be skipped.`,confirmationMessage:"Yes, scan without app configuration",cancellationMessage:"No",defaultValue:!1}),pickClientId:async e=>(await bn(wn(e))).apiKey,pickConfigFile:async e=>(await pn(e)).valueOrAbort(),lookUpApp:async e=>{await vn({apiKey:e,offerReset:!1})}};function _n(e){return e.kind==="config"?S(e.appConfigFilePath):void 0}function Tn(e){return e.kind==="no-config"?e.clientId:e.clientIdOverride??e.configClientId}function Ed(e){return e.kind==="no-config"?e.clientId:e.clientIdOverride??S(e.appConfigFilePath,".toml")}async function Ad(e){let t=await ke(e.path);if(e.withoutAppConfig)return t;try{return await de((await Je.load(e.path)).directory)}catch(n){throw n instanceof Ke?new xe(e.path):n}}async function Id(e,t=Yr){if(e.withoutAppConfig){if(!e.clientId)throw new A("--without-app-config requires --client-id.");let n=await ke(e.path);return await Ye(e,t),{kind:"no-config",appDirectory:n,clientId:e.clientId,clientIdSource:"flag"}}await ke(e.path);try{let n=e.config?void 0:await Xr(e,t),{app:i,project:r,activeConfig:s}=await xn({directory:e.path,userProvidedConfigName:e.config??n?.fileName,skipPrompts:!e.allowPrompts});await Ye(e,t);let o=await de(i.directory);return{kind:"config",appDirectory:o,appConfigFilePath:b(o,S(i.configPath)),appConfigDirectories:await es(r,s.file),configClientId:i.configuration.client_id||void 0,clientIdOverride:e.clientId,appConfigFilePicked:n?.picked}}catch(n){if(!(n instanceof Ke))throw n;return Zr(e,t)}}async function Xr(e,t){let{directory:n}=await Je.load(e.path),i=hn(n)?.configFile;if(i&&Ge(b(n,i)))return;if(Ge(b(n,Ve.app)))return i?{fileName:Ve.app,picked:!1}:void 0;let r=(await ln(n)).map(s=>S(s));return r.length===1?{fileName:r[0],picked:!1}:((!e.allowPrompts||e.clientId)&&is(n,r,e.clientId),{fileName:await t.pickConfigFile(n),picked:!0})}async function Zr(e,t){if(!e.allowPrompts)throw new xe(e.path);let n=await ke(e.path);return await Ye(e,t),await t.confirmScanWithoutAppConfig(e.path)?e.clientId?{kind:"no-config",appDirectory:n,clientId:e.clientId,clientIdSource:"flag"}:{kind:"no-config",appDirectory:n,clientId:await t.pickClientId(n),clientIdSource:"picker"}:{kind:"declined"}}async function Ye(e,t){e.validateClientIdFlag&&e.clientId!==void 0&&await t.lookUpApp(e.clientId)}async function Rd(e){let t=[];for(let n of e){let i=k(L(),n),r=await En(i);if(r===void 0)throw new A(`--include-dir ${n}: directory doesn't exist.`);if(!await ze(r))throw new A(`--include-dir ${n}: not a directory.`);t.push(r)}return t}async function es(e,t){let n=[...fn(e,t),...mn(e,t)].map(r=>T(r.path)).filter(r=>!P(e.directory,r)),i=[];for(let r of new Set(n))await ts(e.directory,r)||i.push(await de(r));return i.sort()}async function ts(e,t){let n=w(e,t).split("/"),i=b(e,...n.filter(r=>r===".."));for(let r of n.filter(s=>s!==".."))if(i=b(i,r),(await Kr(i)).isSymbolicLink())return!0;return!1}function Cd(e,t,n=[]){let i=a=>b(e,w(e,a))!==R(a),r=t.find(i);if(r)throw new A(`--include-dir ${r}: must be on the same drive as the app directory.`);let s=n.find(i);if(s)throw new A(`Extension or web directory ${s}: must be on the same drive as the app directory.`);let o=[{directory:e,origin:"app_directory"},...t.map(a=>({directory:a,origin:"include_dir"})),...n.map(a=>({directory:a,origin:"app_config_directory"}))].filter((a,c,p)=>p.findIndex(({directory:l})=>l===a.directory)===c);return{scanDirectories:o.filter(a=>!o.some(({directory:c})=>c!==a.directory&&P(c,a.directory))),requestedScanDirectories:o.map(({directory:a})=>a)}}function ns(e){return{headline:`No app configuration found at or above ${e}.`,nextStep:"Pass `--path` to your app directory, or scan without app configuration with `--without-app-config --client-id <client-id>`."}}var xe=class extends A{constructor(t){let{headline:n,nextStep:i}=ns(t);super(n,i)}};function is(e,t,n){let i=t.map(r=>we(r)??r).join(", ");throw new A(`${t.length} app configurations found in ${e}, and none is selected.`,n?`\`--client-id\` can't be combined with \`--config\`, so first select one with \`shopify app config use <config>\`: ${i}.`:`Pass \`--config\` with one of: ${i}.`)}async function ke(e){let t=await En(e);if(t===void 0||!await ze(t))throw new A(`--path ${e}: not a directory.`);return t}async function En(e){return de(e).catch(()=>{})}u();import{realpathSync as rs}from"node:fs";var ss={include_dirs:[],excludes:[],no_git_ignore:!1};function An(e){try{return rs(e)}catch{return k(e)}}function os(e){return An(e)===An(L())?[]:[{flag:"--path",value:w(L(),e)}]}function as(e){if(e.kind==="no-config")return[{flag:"--client-id",value:e.clientId},"--without-app-config"];if(e.clientIdOverride)return[{flag:"--client-id",value:e.clientIdOverride}];let t=_n(e),n=t?we(t):void 0;return n?[{flag:"--config",value:n}]:[]}function cs(e){return[...e.include_dirs.map(t=>({flag:"--include-dir",value:t})),...e.excludes.map(t=>({flag:"--exclude",value:t})),...e.no_git_ignore?["--no-git-ignore"]:[]]}function Fd(e,t,n=ss){let i="shopify",r=s=>["app","security",s,...os(t),...as(e)];return{scan:{command:i,args:[...r("check"),...cs(n)]},record:{command:i,args:r("record"),stdinPlaceholder:"<findings.json>"},review:{command:i,args:r("review")},clean:{command:i,args:r("clean")}}}function In(e=process.platform,t=process.env){return e!=="win32"||ds(t)?"posix":ls(t)}function ds(e){if(e.MSYSTEM||e.CYGWIN)return!0;let t=e.SHELL??"";return/(?:^|[\\/])(bash|zsh|sh|fish|dash)(?:\.exe)?$/i.test(t)}function ls(e){return e.PROMPT?"cmd":e.POWERSHELL_DISTRIBUTION_CHANNEL||e.PSExecutionPolicyPreference||e.PSModulePath?"powershell":"cmd"}function ps(e,t){return t==="cmd"?us(e):t==="powershell"?`'${e.replaceAll("'","''")}'`:`'${e.replaceAll("'","'\\''")}'`}function us(e){return e.split("%").map(hs).join("^%")}function hs(e){let t=e.replace(/"/g,'""'),n=/\\+$/.exec(t)?.[0]??"";return`"${t}${n}"`}function Md(e,t=In()){let n=Rn(e,t);return e.stdinPlaceholder?t==="powershell"?`Get-Content -Raw -Encoding UTF8 ${e.stdinPlaceholder} | ${n}`:`${n} < ${e.stdinPlaceholder}`:n}function $d(e,t,n=In()){let i=Rn(e,n);if(n==="posix")return`${i} <<'EOF'
2
2
  ${t}
3
3
  EOF`;if(n==="powershell")return`@'
4
4
  ${t}
@@ -1,4 +1,4 @@
1
- import{a as uo,e as fo,f as po}from"./chunk-XM7YUXTF.js";import{a as ho}from"./chunk-7UOA4DI7.js";import{c as mo,i as go,o as Ur}from"./chunk-YLQ3LNNY.js";import{b as et}from"./chunk-ZQDDRIBA.js";import{Da as oo,M as Yt,O as Jt,R as Wt,ha as Bt,l as qt,la as zt,u as je}from"./chunk-H4V55Y3Z.js";import{B as eo,D as to,l as Kt,m as Xt,p as Zt,x as Ze}from"./chunk-IUP7POIE.js";import{b as lo,c as ce}from"./chunk-Q2SZCZE7.js";import{A as ie,B as Y,D as no,E as G,F as M,I as io,K as se,N as so,z as q}from"./chunk-CZ22VZDA.js";import{a as Mt,c as Vt}from"./chunk-J6TW43TG.js";import{o as Ht}from"./chunk-335BUVBP.js";import{a as re}from"./chunk-BN7ZXAZJ.js";import{h as p,k as Fe}from"./chunk-2VSNFOKD.js";import{Ba as Xe,Bb as I,Da as _e,Sa as w,T as jt,Va as Dt,W as Ft,Y as Nt,_ as Lt,_a as Ut,ib as Qt,la as R,nb as ro,oa as ne,qb as J,rb as ao,sb as ae,ta as C,va as $e,wb as co,xa as Ie,yb as F}from"./chunk-LWCTKI4Z.js";import{i as E}from"./chunk-B4OMIONW.js";import{b as S,h as Gt,j as Te}from"./chunk-FZCGRIOM.js";import{b as ke}from"./chunk-YTUUU33R.js";import{a as Tt}from"./chunk-JD5P5RAJ.js";import{c as g,e as b,f as Q,h as O,i as K,j as Oe,m as Qe,p as Ke}from"./chunk-IWTNUJGY.js";import{b as Dr}from"./chunk-JFBCE4HN.js";import{e as ye,g as l}from"./chunk-VKWPEFWQ.js";l();import{createRequire as Hr}from"node:module";import{pathToFileURL as yo}from"node:url";var wo=Hr(import.meta.url);async function So(e){let t;try{t=wo.resolve("vite",process.env.SHOPIFY_UNIT_TEST?void 0:{paths:[e]})}catch(s){throw s instanceof Error&&s.code==="MODULE_NOT_FOUND"?new p("Could not find the 'vite' package in your project.","Hydrogen uses Vite to run this command.",["Run this command from the root directory of your Hydrogen app.","Install your project dependencies (for example, by running `npm install`) and try again."]):s}let o=await eo(t),r=o.content.exports?.["."];typeof r!="string"&&(r=r?.import),typeof r!="string"&&(r=r.default);let n=g(O(o.path),r);return import(yo(n).href)}function Gr(e,t){let o=wo.resolve(e,process.env.SHOPIFY_UNIT_TEST?void 0:{paths:[t]});return import(yo(o).href)}l();l();import{isAbsolute as Mr,resolve as Vr}from"node:path";var Pi=S.string().refine(Mr,"Expected an absolute native filesystem path").transform(e=>Vr(e)),vo=S.string().datetime({precision:0}),we=S.string().regex(/^gid:\/\/shopify\/HydrogenStorefront\/\d+$/).describe("A Shopify HydrogenStorefront GID."),Ei=S.string().regex(/^gid:\/\/shopify\/HydrogenStorefrontEnvironment\/\d+$/).describe("A Shopify HydrogenStorefrontEnvironment GID."),bo=S.string().regex(/^gid:\/\/shopify\/HydrogenStorefrontDeployment\/\d+$/).describe("A Shopify HydrogenStorefrontDeployment GID."),xo=S.enum(["success","partial","skipped","cancelled"]),tt=S.string().regex(/^[a-z0-9][a-z0-9-]*\.myshopify\.com$/).nullable();function Po(e){return new Date(e).toISOString().replace(/\.\d{3}Z$/,"Z")}function Ne(e){let t=e?.toLowerCase();return t&&/^[a-z0-9][a-z0-9-]*\.myshopify\.com$/.test(t)?t:null}l();import{format as qr}from"node:util";async function Eo(e){if(!X())return e();let t={log:console.log,info:console.info,debug:console.debug},o={...t};for(let r of["log","info","debug"])o[r]=(...n)=>{X()?Mt(["--json"],()=>F(qr(...n))):t[r](...n)},console[r]=o[r];try{return await e()}finally{for(let r of["log","info","debug"])console[r]===o[r]&&(console[r]=t[r])}}function X(){return Te()==="json"||Ht()}function Le(e,t,o=X()){return o?(co(e.encode(t)),!0):!1}l();var Co=S.object({gid:bo,createdAt:vo,commitMessage:S.string().nullable()}).strict(),ot=S.object({gid:we,name:S.string(),productionUrl:S.string().url().nullable()}).strict().describe("All projected fields are present; unavailable productionUrl is null."),Ro=ot.extend({currentProductionDeployment:Co.nullable()}).strict();function rt(e){return{gid:e.id,name:e.title,productionUrl:e.productionUrl||null}}function Ni({shop:e,storefronts:t}){return{storeDomain:Ne(e),storefronts:t.map(o=>({...rt(o),currentProductionDeployment:o.currentProductionDeployment?{gid:o.currentProductionDeployment.id,createdAt:Po(o.currentProductionDeployment.createdAt),commitMessage:o.currentProductionDeployment.commitMessage??null}:null}))}}var Li=re({name:"HydrogenListResult",schema:S.object({storeDomain:tt,storefronts:S.array(Ro)}).strict().describe("The complete list of Hydrogen storefronts for the store."),definitions:{Storefront:Ro,Deployment:Co}}),nt=re({name:"HydrogenLinkResult",schema:S.object({status:xo,changed:S.boolean(),storeDomain:tt,storefront:ot.nullable()}).strict(),definitions:{Storefront:ot}}),Di=re({name:"HydrogenUnlinkResult",schema:S.object({status:S.literal("success"),changed:S.boolean(),storefront:S.object({gid:we,name:S.string()}).strict().nullable()}).strict()});var We=ye(ke(),1);l();var $o=ye(ke(),1);l();import{createRequire as Ao}from"node:module";function ko({id:e,projectPath:t}){if(!(!e||!Yr(t,e)))throw new p(`\`shopify ${e.replace(/:/g," ")}\` is not supported by this version of Hydrogen`,"The installed version of @shopify/hydrogen disables this command.",["Use your framework or package tooling instead."])}function Yr(e,t){try{let n=Ao(g(e,"package.json"))("@shopify/hydrogen/package.json")?.shopify?.cli?.disabledCommands;return Array.isArray(n)&&n.includes(t)}catch{return!1}}function Oo(e){try{let o=Ao(import.meta.url)(g(e,"package.json"));return[o?.dependencies,o?.devDependencies,o?.peerDependencies].some(r=>!!r?.["@shopify/hydrogen"])}catch{return!1}}var le=class extends et{static baseFlags={...et.baseFlags,...lo};async _run(){let t=()=>Eo(()=>super._run()),{flags:o}=await $o.Parser.parse([],{flags:ce});return o.json&&(process.env.SHOPIFY_FLAG_JSON="true"),o.json&&Te()!=="json"?Gt({outputMode:"json",sink:Vt},t):t()}async init(){if(await super.init(),!this.id?.startsWith("hydrogen:")||this.id==="hydrogen:init")return;let t=this.argv.indexOf("--"),o=t<0?this.argv:this.argv.slice(0,t);if(o.some(i=>["--help","-h","--json-schema"].includes(i))||Tt(process.env.SHOPIFY_FLAG_JSON_SCHEMA))return;let r=o.findIndex(i=>/^--path($|=)/.test(i)),n=r<0?process.env.SHOPIFY_HYDROGEN_FLAG_PATH:o[r]?.startsWith("--path=")?o[r].slice(7):o[r+1],s=n&&!n.startsWith("--")?b(Ke(),n):Ke();if(!Oo(s))throw new p("Looks like you're trying to run a Hydrogen command outside of a Hydrogen project.","Run `shopify hydrogen init` to create a new Hydrogen project or use the `--path` flag to specify an existing Hydrogen project.");ko({id:this.id,projectPath:s})}};l();var A=ye(ke(),1);l();l();l();import{fileURLToPath as Io}from"node:url";import{existsSync as Br}from"node:fs";l();import{exec as Jr}from"node:child_process";import{promisify as Wr}from"node:util";var D=Wr(Jr);function ns(){let e=process.listeners("warning")[0];e&&(process.removeAllListeners("warning"),process.prependListener("warning",t=>{t.name!="ExperimentalWarning"&&e(t)}))}var st=new URL("../../..",import.meta.url).pathname,Se=(()=>{try{let e=g(O(st),"templates","skeleton");return Br(e)}catch{return!1}})(),ms=Se?st:void 0,zr="assets/hydrogen",Qr="starter",Z="routes",it;async function Kr(){if(it??=await Ut("package.json",{cwd:Io(import.meta.url),type:"file"}),!it)throw new p("Could not find assets directory","Please report this error.");return it}async function U(e,...t){return g(O(await Kr()),process.env.SHOPIFY_UNIT_TEST?"assets":`dist/${zr}`,e??"",...t)}async function ve(e,t){t??=await at();let o=new URL(`${t}/app${e?`/${e}`:""}`,import.meta.url);return o.protocol==="file:"?Io(o):o.toString()}function at(e=!!process.env.SHOPIFY_UNIT_TEST){return e?De():U(Qr)}function De(){if(!Se)throw new p("Trying to use skeleton source dir outside of Hydrogen monorepo.","Please report this error.");return g(O(st),"templates","skeleton")}function Xr(){return g(De(),"node_modules")}async function _o(){if(Se)return Xr();let{stdout:e}=await D("npm root");return e.trim()}var ct=["tailwind","vanilla-extract","css-modules","postcss"];async function To(e,t,o,r=(n,s)=>n){let n=await U(e);return Promise.all(Object.entries(t).map(async([s,i])=>{let a=await R(g(n,s));await C(g(o,i),r(a,s))}))}async function jo(e,t,o){let r=Object.values(e).map(s=>w(g(t,s)).then(i=>i?s:null)),n=(await Promise.all(r)).filter(Boolean);return!(n.length>0&&!o&&!await M({message:`Some files already exist (${n.join(", ")}). Overwrite?`,defaultValue:!1}))}l();l();import{readdir as Zr}from"node:fs/promises";l();Ur();import*as Fo from"fs/promises";import*as No from"path";var lt={arrowParens:"always",singleQuote:!0,bracketSpacing:!1,trailingComma:"all"};async function V(e=process.cwd()){let t=(await Fo.lstat(e)).isFile()?e:No.resolve(e,"prettier.file");try{return await mo(t)||lt}catch{return lt}}async function ee(e,t=lt,o=""){let r=Oe(o);return go(e,{parser:r===".tsx"||r===".ts"?"typescript":"babel",...t})}async function ue(e,t,o){let r=await o(await R(e));if(typeof r=="string")return t&&(r=await ee(r,t,e)),C(e,r)}var en=["tsx","ts","jsx","js","mjs","cjs"];async function T(e,t,o=en){let r=await Zr(e);if(r.includes(t)){let n=b(e,t);if(!await _e(n))return{filepath:n};for(let s of["ts","js"]){let i=b(e,`${t}/index.${s}`);if(await w(b(e,i)))return{filepath:i,extension:s,astType:s}}}else for(let n of o){let s=`${t}.${n}`;if(r.includes(s)){let i=n==="mjs"||n==="cjs"?"js":n;return{filepath:b(e,s),extension:n,astType:i}}}return{}}var Lo=Object.freeze(["dependencies","devDependencies","peerDependencies"]);async function Ue(e,t,o){let r=await Ze(g(t,"package.json")),n=await Ze(g(e,"package.json")),s=new Set(["comment",...o?.ignoredKeys??[]]),i=Object.keys(n).filter(c=>!Lo.includes(c));for(let c of i){if(s.has(c))continue;let u=n[c],f=r[c],m=Array.isArray(u)&&Array.isArray(f)?[...f,...u]:typeof u=="object"&&typeof f=="object"?{...f,...u}:u;r[c]=m}let a=Object.entries(r.dependencies||{}).find(([c])=>c.startsWith("@remix-run/"))?.[1];for(let c of Lo)s.has(c)||n[c]&&(r[c]=[...new Set([...Object.keys(r[c]??{}),...Object.keys(n[c]??{})])].sort().reduce((u,f)=>{let m=n[c]?.[f]??r[c]?.[f];return f.startsWith("@remix-run/")&&a&&(m=a),u[f]=m,u},{}));await to(t,o?.onResult?.(r)??r)}l();l();async function be(e){let t=await import("@ast-grep/napi");if(!(e in t))throw new Error(`Wrong language for AST: ${e}`);return t[e]}async function Do(e,t,o){let{filepath:r,astType:n}=await T(e,"root");if(!r||!n)throw new p(`Could not find root file in ${e}`);await ue(r,t,async s=>{let i=`import ${o.isDefault?o.name:`{${o.name}}`} from '${(o.isAbsolute?"":"./")+o.path}';`;if(s.includes(i.split("from")[0]))return;let c=(await be(n)).parse(s).root(),u=c.findAll({rule:{kind:"import_statement"}}).reverse(),f=u.find(v=>v.text().includes(".css"))||u.shift(),m=c.find({rule:{kind:"jsx_element",regex:"resetStyles",has:{kind:"jsx_opening_element",has:{kind:"identifier",pattern:"link"}}}});if(!f||!m)throw new p('Could not find a "links" export in root file. Please add one and try again.');let d=f.text(),h=m.text(),x=o.isConditional?`{${o.name} && <link rel="stylesheet" href={${o.name}}></link>}`:`<link rel="stylesheet" href={${o.name}}></link>`;return s.replace(d,d+`
1
+ import{a as uo,e as fo,f as po}from"./chunk-EH22T4FI.js";import{a as ho}from"./chunk-LGXNXAQA.js";import{c as mo,i as go,o as Ur}from"./chunk-YLQ3LNNY.js";import{b as et}from"./chunk-OLKLHVHA.js";import{Da as oo,M as Yt,O as Jt,R as Wt,ha as Bt,l as qt,la as zt,u as je}from"./chunk-NCPZVARH.js";import{B as eo,D as to,l as Kt,m as Xt,p as Zt,x as Ze}from"./chunk-2M535QQJ.js";import{b as lo,c as ce}from"./chunk-5AWELO3D.js";import{A as ie,B as Y,D as no,E as G,F as M,I as io,K as se,N as so,z as q}from"./chunk-V654BMS7.js";import{a as Mt,c as Vt}from"./chunk-F3OM2YO6.js";import{o as Ht}from"./chunk-335BUVBP.js";import{a as re}from"./chunk-BN7ZXAZJ.js";import{h as p,k as Fe}from"./chunk-J7BTC45S.js";import{Ba as Xe,Bb as I,Da as _e,Sa as w,T as jt,Va as Dt,W as Ft,Y as Nt,_ as Lt,_a as Ut,ib as Qt,la as R,nb as ro,oa as ne,qb as J,rb as ao,sb as ae,ta as C,va as $e,wb as co,xa as Ie,yb as F}from"./chunk-RIG66DIQ.js";import{i as E}from"./chunk-B4OMIONW.js";import{b as S,h as Gt,j as Te}from"./chunk-FZCGRIOM.js";import{b as ke}from"./chunk-YTUUU33R.js";import{a as Tt}from"./chunk-JD5P5RAJ.js";import{c as g,e as b,f as Q,h as O,i as K,j as Oe,m as Qe,p as Ke}from"./chunk-IWTNUJGY.js";import{b as Dr}from"./chunk-JFBCE4HN.js";import{e as ye,g as l}from"./chunk-VKWPEFWQ.js";l();import{createRequire as Hr}from"node:module";import{pathToFileURL as yo}from"node:url";var wo=Hr(import.meta.url);async function So(e){let t;try{t=wo.resolve("vite",process.env.SHOPIFY_UNIT_TEST?void 0:{paths:[e]})}catch(s){throw s instanceof Error&&s.code==="MODULE_NOT_FOUND"?new p("Could not find the 'vite' package in your project.","Hydrogen uses Vite to run this command.",["Run this command from the root directory of your Hydrogen app.","Install your project dependencies (for example, by running `npm install`) and try again."]):s}let o=await eo(t),r=o.content.exports?.["."];typeof r!="string"&&(r=r?.import),typeof r!="string"&&(r=r.default);let n=g(O(o.path),r);return import(yo(n).href)}function Gr(e,t){let o=wo.resolve(e,process.env.SHOPIFY_UNIT_TEST?void 0:{paths:[t]});return import(yo(o).href)}l();l();import{isAbsolute as Mr,resolve as Vr}from"node:path";var Pi=S.string().refine(Mr,"Expected an absolute native filesystem path").transform(e=>Vr(e)),vo=S.string().datetime({precision:0}),we=S.string().regex(/^gid:\/\/shopify\/HydrogenStorefront\/\d+$/).describe("A Shopify HydrogenStorefront GID."),Ei=S.string().regex(/^gid:\/\/shopify\/HydrogenStorefrontEnvironment\/\d+$/).describe("A Shopify HydrogenStorefrontEnvironment GID."),bo=S.string().regex(/^gid:\/\/shopify\/HydrogenStorefrontDeployment\/\d+$/).describe("A Shopify HydrogenStorefrontDeployment GID."),xo=S.enum(["success","partial","skipped","cancelled"]),tt=S.string().regex(/^[a-z0-9][a-z0-9-]*\.myshopify\.com$/).nullable();function Po(e){return new Date(e).toISOString().replace(/\.\d{3}Z$/,"Z")}function Ne(e){let t=e?.toLowerCase();return t&&/^[a-z0-9][a-z0-9-]*\.myshopify\.com$/.test(t)?t:null}l();import{format as qr}from"node:util";async function Eo(e){if(!X())return e();let t={log:console.log,info:console.info,debug:console.debug},o={...t};for(let r of["log","info","debug"])o[r]=(...n)=>{X()?Mt(["--json"],()=>F(qr(...n))):t[r](...n)},console[r]=o[r];try{return await e()}finally{for(let r of["log","info","debug"])console[r]===o[r]&&(console[r]=t[r])}}function X(){return Te()==="json"||Ht()}function Le(e,t,o=X()){return o?(co(e.encode(t)),!0):!1}l();var Co=S.object({gid:bo,createdAt:vo,commitMessage:S.string().nullable()}).strict(),ot=S.object({gid:we,name:S.string(),productionUrl:S.string().url().nullable()}).strict().describe("All projected fields are present; unavailable productionUrl is null."),Ro=ot.extend({currentProductionDeployment:Co.nullable()}).strict();function rt(e){return{gid:e.id,name:e.title,productionUrl:e.productionUrl||null}}function Ni({shop:e,storefronts:t}){return{storeDomain:Ne(e),storefronts:t.map(o=>({...rt(o),currentProductionDeployment:o.currentProductionDeployment?{gid:o.currentProductionDeployment.id,createdAt:Po(o.currentProductionDeployment.createdAt),commitMessage:o.currentProductionDeployment.commitMessage??null}:null}))}}var Li=re({name:"HydrogenListResult",schema:S.object({storeDomain:tt,storefronts:S.array(Ro)}).strict().describe("The complete list of Hydrogen storefronts for the store."),definitions:{Storefront:Ro,Deployment:Co}}),nt=re({name:"HydrogenLinkResult",schema:S.object({status:xo,changed:S.boolean(),storeDomain:tt,storefront:ot.nullable()}).strict(),definitions:{Storefront:ot}}),Di=re({name:"HydrogenUnlinkResult",schema:S.object({status:S.literal("success"),changed:S.boolean(),storefront:S.object({gid:we,name:S.string()}).strict().nullable()}).strict()});var We=ye(ke(),1);l();var $o=ye(ke(),1);l();import{createRequire as Ao}from"node:module";function ko({id:e,projectPath:t}){if(!(!e||!Yr(t,e)))throw new p(`\`shopify ${e.replace(/:/g," ")}\` is not supported by this version of Hydrogen`,"The installed version of @shopify/hydrogen disables this command.",["Use your framework or package tooling instead."])}function Yr(e,t){try{let n=Ao(g(e,"package.json"))("@shopify/hydrogen/package.json")?.shopify?.cli?.disabledCommands;return Array.isArray(n)&&n.includes(t)}catch{return!1}}function Oo(e){try{let o=Ao(import.meta.url)(g(e,"package.json"));return[o?.dependencies,o?.devDependencies,o?.peerDependencies].some(r=>!!r?.["@shopify/hydrogen"])}catch{return!1}}var le=class extends et{static baseFlags={...et.baseFlags,...lo};async _run(){let t=()=>Eo(()=>super._run()),{flags:o}=await $o.Parser.parse([],{flags:ce});return o.json&&(process.env.SHOPIFY_FLAG_JSON="true"),o.json&&Te()!=="json"?Gt({outputMode:"json",sink:Vt},t):t()}async init(){if(await super.init(),!this.id?.startsWith("hydrogen:")||this.id==="hydrogen:init")return;let t=this.argv.indexOf("--"),o=t<0?this.argv:this.argv.slice(0,t);if(o.some(i=>["--help","-h","--json-schema"].includes(i))||Tt(process.env.SHOPIFY_FLAG_JSON_SCHEMA))return;let r=o.findIndex(i=>/^--path($|=)/.test(i)),n=r<0?process.env.SHOPIFY_HYDROGEN_FLAG_PATH:o[r]?.startsWith("--path=")?o[r].slice(7):o[r+1],s=n&&!n.startsWith("--")?b(Ke(),n):Ke();if(!Oo(s))throw new p("Looks like you're trying to run a Hydrogen command outside of a Hydrogen project.","Run `shopify hydrogen init` to create a new Hydrogen project or use the `--path` flag to specify an existing Hydrogen project.");ko({id:this.id,projectPath:s})}};l();var A=ye(ke(),1);l();l();l();import{fileURLToPath as Io}from"node:url";import{existsSync as Br}from"node:fs";l();import{exec as Jr}from"node:child_process";import{promisify as Wr}from"node:util";var D=Wr(Jr);function ns(){let e=process.listeners("warning")[0];e&&(process.removeAllListeners("warning"),process.prependListener("warning",t=>{t.name!="ExperimentalWarning"&&e(t)}))}var st=new URL("../../..",import.meta.url).pathname,Se=(()=>{try{let e=g(O(st),"templates","skeleton");return Br(e)}catch{return!1}})(),ms=Se?st:void 0,zr="assets/hydrogen",Qr="starter",Z="routes",it;async function Kr(){if(it??=await Ut("package.json",{cwd:Io(import.meta.url),type:"file"}),!it)throw new p("Could not find assets directory","Please report this error.");return it}async function U(e,...t){return g(O(await Kr()),process.env.SHOPIFY_UNIT_TEST?"assets":`dist/${zr}`,e??"",...t)}async function ve(e,t){t??=await at();let o=new URL(`${t}/app${e?`/${e}`:""}`,import.meta.url);return o.protocol==="file:"?Io(o):o.toString()}function at(e=!!process.env.SHOPIFY_UNIT_TEST){return e?De():U(Qr)}function De(){if(!Se)throw new p("Trying to use skeleton source dir outside of Hydrogen monorepo.","Please report this error.");return g(O(st),"templates","skeleton")}function Xr(){return g(De(),"node_modules")}async function _o(){if(Se)return Xr();let{stdout:e}=await D("npm root");return e.trim()}var ct=["tailwind","vanilla-extract","css-modules","postcss"];async function To(e,t,o,r=(n,s)=>n){let n=await U(e);return Promise.all(Object.entries(t).map(async([s,i])=>{let a=await R(g(n,s));await C(g(o,i),r(a,s))}))}async function jo(e,t,o){let r=Object.values(e).map(s=>w(g(t,s)).then(i=>i?s:null)),n=(await Promise.all(r)).filter(Boolean);return!(n.length>0&&!o&&!await M({message:`Some files already exist (${n.join(", ")}). Overwrite?`,defaultValue:!1}))}l();l();import{readdir as Zr}from"node:fs/promises";l();Ur();import*as Fo from"fs/promises";import*as No from"path";var lt={arrowParens:"always",singleQuote:!0,bracketSpacing:!1,trailingComma:"all"};async function V(e=process.cwd()){let t=(await Fo.lstat(e)).isFile()?e:No.resolve(e,"prettier.file");try{return await mo(t)||lt}catch{return lt}}async function ee(e,t=lt,o=""){let r=Oe(o);return go(e,{parser:r===".tsx"||r===".ts"?"typescript":"babel",...t})}async function ue(e,t,o){let r=await o(await R(e));if(typeof r=="string")return t&&(r=await ee(r,t,e)),C(e,r)}var en=["tsx","ts","jsx","js","mjs","cjs"];async function T(e,t,o=en){let r=await Zr(e);if(r.includes(t)){let n=b(e,t);if(!await _e(n))return{filepath:n};for(let s of["ts","js"]){let i=b(e,`${t}/index.${s}`);if(await w(b(e,i)))return{filepath:i,extension:s,astType:s}}}else for(let n of o){let s=`${t}.${n}`;if(r.includes(s)){let i=n==="mjs"||n==="cjs"?"js":n;return{filepath:b(e,s),extension:n,astType:i}}}return{}}var Lo=Object.freeze(["dependencies","devDependencies","peerDependencies"]);async function Ue(e,t,o){let r=await Ze(g(t,"package.json")),n=await Ze(g(e,"package.json")),s=new Set(["comment",...o?.ignoredKeys??[]]),i=Object.keys(n).filter(c=>!Lo.includes(c));for(let c of i){if(s.has(c))continue;let u=n[c],f=r[c],m=Array.isArray(u)&&Array.isArray(f)?[...f,...u]:typeof u=="object"&&typeof f=="object"?{...f,...u}:u;r[c]=m}let a=Object.entries(r.dependencies||{}).find(([c])=>c.startsWith("@remix-run/"))?.[1];for(let c of Lo)s.has(c)||n[c]&&(r[c]=[...new Set([...Object.keys(r[c]??{}),...Object.keys(n[c]??{})])].sort().reduce((u,f)=>{let m=n[c]?.[f]??r[c]?.[f];return f.startsWith("@remix-run/")&&a&&(m=a),u[f]=m,u},{}));await to(t,o?.onResult?.(r)??r)}l();l();async function be(e){let t=await import("@ast-grep/napi");if(!(e in t))throw new Error(`Wrong language for AST: ${e}`);return t[e]}async function Do(e,t,o){let{filepath:r,astType:n}=await T(e,"root");if(!r||!n)throw new p(`Could not find root file in ${e}`);await ue(r,t,async s=>{let i=`import ${o.isDefault?o.name:`{${o.name}}`} from '${(o.isAbsolute?"":"./")+o.path}';`;if(s.includes(i.split("from")[0]))return;let c=(await be(n)).parse(s).root(),u=c.findAll({rule:{kind:"import_statement"}}).reverse(),f=u.find(v=>v.text().includes(".css"))||u.shift(),m=c.find({rule:{kind:"jsx_element",regex:"resetStyles",has:{kind:"jsx_opening_element",has:{kind:"identifier",pattern:"link"}}}});if(!f||!m)throw new p('Could not find a "links" export in root file. Please add one and try again.');let d=f.text(),h=m.text(),x=o.isConditional?`{${o.name} && <link rel="stylesheet" href={${o.name}}></link>}`:`<link rel="stylesheet" href={${o.name}}></link>`;return s.replace(d,d+`
2
2
  `+i).replace(h,x+`
3
3
  `+h)})}async function He(e,t,o,r){let{filepath:n,astType:s}=await T(e,"vite.config");if(!n||!s)throw new p(`Could not find vite.config file in ${e}`);await ue(n,t,async i=>{let a=`import ${o.isDefault?o.name:`{${o.name}}`} from '${o.path}';`;if(new RegExp(`['"]${o.path.replace("/","\\/")}['"]`).test(i))return;let u=(await be(s)).parse(i).root(),f=u.findAll({rule:{kind:"import_statement"}}).pop(),m=u.find(tn);if(!f||!m)throw new p('Could not find a "plugins" key in Vite config file. Please add one and try again.');let d=f.text(),h=m.text(),x=`${o.name}(${r?JSON.stringify(r):""})`;return i.replace(d,d+`
4
4
  `+a).replace(h,h.replace("[",`[${x},`))})}var tn={rule:{pattern:"[$$$]",inside:{kind:"pair",stopBy:"neighbor",has:{field:"key",regex:"^plugins$",stopBy:"neighbor"},inside:{kind:"object",stopBy:"neighbor",all:[{inside:{kind:"export_statement",regex:"export default",stopBy:"end"}},{not:{inside:{kind:"object",stopBy:"end"}}}]}}}};var Uo="styles/tailwind.css";async function Ho({rootDirectory:e,appDirectory:t},o=!1){let r=Q(e,t),n={"tailwind.css":g(r,Uo)};if(!await jo(n,e,o)){F("Skipping CSS setup as some files already exist. You may use `--force` or `-f` to override it.");return}return{workPromise:Promise.all([Ue(await U("tailwind"),e),To("tailwind",n,e),V(e).then(i=>Promise.all([Do(t,i,{name:"tailwindCss",path:`${Uo}?url`,isDefault:!0}),He(e,i,{name:"tailwindcss",path:"@tailwindcss/vite",isDefault:!0})]))]),generatedAssets:Object.values(n),needsInstallDeps:!0}}l();async function Go({rootDirectory:e}){return{workPromise:Promise.all([Ue(await U("vanilla-extract"),e),V(e).then(o=>He(e,o,{path:"@vanilla-extract/vite-plugin",name:"vanillaExtractPlugin",isDefault:!1}))]),generatedAssets:[],needsInstallDeps:!0}}var ut=[...ct,"none"],ft={tailwind:"Tailwind v4","vanilla-extract":"Vanilla Extract","css-modules":"CSS Modules",postcss:"PostCSS"},ia={postcss:"https://vitejs.dev/guide/features.html#postcss","css-modules":"https://vitejs.dev/guide/features.html#css-modules","vanilla-extract":"https://vanilla-extract.style/documentation/styling/",tailwind:"https://tailwindcss.com/docs/configuration"};function Mo(e,t,o){switch(e){case"tailwind":return Ho(t,o);case"vanilla-extract":return Go(t);case"postcss":case"css-modules":return{workPromise:Promise.resolve(),generatedAssets:[],needsInstallDeps:!1};default:throw new Error("Unknown strategy")}}async function Vo(e){let t=Object.entries({...ft,...e?.extraChoices});return G({message:"Select a styling library",...e,choices:t.map(([o,r])=>({value:o,label:r})),defaultValue:"tailwind"})}l();l();l();l();async function te(e,t,o=!0){let{transpileTs:r}=await import("./morph-CRY35DIK.js");return r(e,t,o)}l();var qo={checkJs:!1,target:"ES2022",module:"ES2022",moduleResolution:"bundler",baseUrl:".",paths:{"~/*":["app/*"]}},on=new Set(["noLib","target","module","moduleResolution","checkJs","experimentalDecorators","allowSyntheticDefaultImports","baseUrl","paths",...Object.keys(qo)]);function rn(e,t=!1){let o={compilerOptions:{...qo}};if(e.include&&(o.include=e.include.filter(r=>t||!r.endsWith(".d.ts")).map(r=>r.replace(/(?<!\.d)\.ts(x?)$/,".js$1"))),e.compilerOptions)for(let r of on)e.compilerOptions[r]!==void 0&&(o.compilerOptions[r]=e.compilerOptions[r]);return o}async function pt(e,t=!0){let o=g(e,"app/routes.ts");if(await w(o)){let i=(await R(o)).replace("./layout.tsx","./layout.jsx");await C(o,i)}let r=await Dt("**/*.+(ts|tsx)",{absolute:!0,cwd:e,dot:!0,ignore:["**/node_modules/**"]}),n=await V();for(let s of r){if(s.endsWith(".d.ts")){t||await Ie(s);continue}let i=await R(s),a=await ee(await te(i,s,t),n);await Ie(s),await C(s.replace(/\.ts(x?)$/,".js$1"),a)}try{let s=g(e,"remix.config.js"),i=await R(s);i=i.replace(/\/server\.ts/gim,"/server.js"),await C(s,i)}catch(s){I(`Could not change TS extensions in remix.config.js:
@@ -1,4 +1,4 @@
1
- import{a as S}from"./chunk-FKIVKNOV.js";import{a as R}from"./chunk-T2IUXXCT.js";import{a as f}from"./chunk-7GHSE7SG.js";import{a as C}from"./chunk-ZGV3HNEV.js";import{a as j}from"./chunk-FWB3GLMW.js";import{Ma as k,O}from"./chunk-3C6VLJ5D.js";import{b as y}from"./chunk-7UOA4DI7.js";import{b as w,c as A}from"./chunk-Q2SZCZE7.js";import{a as g}from"./chunk-BN7ZXAZJ.js";import{Sa as F,la as E,qb as l,sb as c,ta as x,wb as P}from"./chunk-LWCTKI4Z.js";import{b as r}from"./chunk-FZCGRIOM.js";import{b as I}from"./chunk-YTUUU33R.js";import{e as m,g as b}from"./chunk-IWTNUJGY.js";import{e as H,g as o}from"./chunk-VKWPEFWQ.js";o();o();async function $({app:n,remoteApp:e,organization:a,envFile:i}){let{variables:s}=await R(n,e,a),t=m(i),p=await F(t)?await E(t):null,d=y(p,Object.fromEntries(s.map(({name:N,value:T})=>[N,T]))),v=d!==p;return v&&await x(t,d),{result:{path:t,status:"success",changed:v,variables:s,content:d},previousContent:p}}o();var u=g({name:"AppEnvPullResult",schema:r.object({path:r.string().refine(b,"Expected an absolute path").describe("The absolute native dotenv file path."),status:r.literal("success"),changed:r.boolean().describe("Whether the dotenv file was created or updated."),variables:r.array(f).describe("The known app variables, not unrelated local variables."),content:r.string().describe("The complete native dotenv content, preserving existing variables and comments.")}).strict(),definitions:{AppEnvironmentVariable:f}});o();import{resolve as V}from"node:path";function W({result:n,previousContent:e},a){if(a==="json")return u.encode({...n,path:V(n.path)});let{path:i,changed:s,content:t}=n;return s?e===null?c`Created ${l.path(i)}:
1
+ import{a as S}from"./chunk-FKIVKNOV.js";import{a as R}from"./chunk-URCH4ITT.js";import{a as f}from"./chunk-7GHSE7SG.js";import{a as C}from"./chunk-NPB753M3.js";import{a as j}from"./chunk-D4LFWIFE.js";import{Ma as k,O}from"./chunk-XV6XCOTG.js";import{b as y}from"./chunk-LGXNXAQA.js";import{b as w,c as A}from"./chunk-5AWELO3D.js";import{a as g}from"./chunk-BN7ZXAZJ.js";import{Sa as F,la as E,qb as l,sb as c,ta as x,wb as P}from"./chunk-RIG66DIQ.js";import{b as r}from"./chunk-FZCGRIOM.js";import{b as I}from"./chunk-YTUUU33R.js";import{e as m,g as b}from"./chunk-IWTNUJGY.js";import{e as H,g as o}from"./chunk-VKWPEFWQ.js";o();o();async function $({app:n,remoteApp:e,organization:a,envFile:i}){let{variables:s}=await R(n,e,a),t=m(i),p=await F(t)?await E(t):null,d=y(p,Object.fromEntries(s.map(({name:N,value:T})=>[N,T]))),v=d!==p;return v&&await x(t,d),{result:{path:t,status:"success",changed:v,variables:s,content:d},previousContent:p}}o();var u=g({name:"AppEnvPullResult",schema:r.object({path:r.string().refine(b,"Expected an absolute path").describe("The absolute native dotenv file path."),status:r.literal("success"),changed:r.boolean().describe("Whether the dotenv file was created or updated."),variables:r.array(f).describe("The known app variables, not unrelated local variables."),content:r.string().describe("The complete native dotenv content, preserving existing variables and comments.")}).strict(),definitions:{AppEnvironmentVariable:f}});o();import{resolve as V}from"node:path";function W({result:n,previousContent:e},a){if(a==="json")return u.encode({...n,path:V(n.path)});let{path:i,changed:s,content:t}=n;return s?e===null?c`Created ${l.path(i)}:
2
2
 
3
3
  ${t}
4
4
  `:c`Updated ${l.path(i)} to be:
@@ -1,4 +1,4 @@
1
- import{p as K,v as Y}from"./chunk-DJAZBPYA.js";import{a as B}from"./chunk-UWMZ5CSB.js";import{c as C,m as z}from"./chunk-XM7YUXTF.js";import{b as J,c as V}from"./chunk-Q2SZCZE7.js";import{B as H,C as $,E as b,I as T,K as M,W as w}from"./chunk-CZ22VZDA.js";import{a as P}from"./chunk-BN7ZXAZJ.js";import{f as D,h as E,j as W}from"./chunk-2VSNFOKD.js";import{Ba as _,Sa as G,Ua as j,ja as N,la as I,ta as A,wb as q,za as O}from"./chunk-LWCTKI4Z.js";import{b as i,i as U}from"./chunk-FZCGRIOM.js";import{b as le}from"./chunk-YTUUU33R.js";import{c as s,g as x}from"./chunk-IWTNUJGY.js";import{e as ae,g as m}from"./chunk-VKWPEFWQ.js";m();m();var u="https://github.com/Shopify/skeleton-theme.git",ce="https://github.com/Shopify/theme-liquid-docs.git",k={all:"All",github:"VS Code (GitHub Copilot)",cursor:"Cursor",claude:"Claude"};async function X(t,e){return v(t,e)}async function Z(t,e){return v(t,e,!0)}async function ee(t){let e=await B("Shopify","skeleton-theme",{filter:n=>!n.draft&&!n.prerelease});if(!e)throw new E("Couldn't find a stable Skeleton theme release");return{...await v(`${u}#${e.tag_name}`,t),repoUrl:u,latest:!0}}async function v(t,e,o){return await T([{title:`Cloning ${t} into ${e}`,task:async()=>{await C({repoUrl:t,destination:e,latestTag:o,shallow:!o}),await z(e),t.split("#")[0]===u&&(await Promise.all(Object.keys(k).map(async n=>Q(s(e,`.${n}`)))),await Q(s(e,".git")))}}]),{path:e,repoUrl:t,latest:o??!1,aiInstructions:null,instructionFiles:[]}}async function Q(t){await G(t)&&await _(t)}async function te(){return await b({message:"Which LLM instruction file would you like to include in your theme?",choices:[...Object.entries(k).map(([e,o])=>({label:o,value:e})),{label:"Skip",value:null}]})}async function oe(t,e){let o=[],n=[s(t,"AGENTS.md")];return await T([{title:`Adding AI instructions into ${t}`,task:async()=>{await N(async p=>{await C({repoUrl:ce,destination:p,shallow:!0});let h=e==="all"?Object.keys(k).filter(r=>r!=="all"):[e];try{let r=s(p,"ai","github","copilot-instructions.md"),d=await I(r),f=s(t,"AGENTS.md"),L=`# AGENTS.md
1
+ import{p as K,v as Y}from"./chunk-KT5QQOES.js";import{a as B}from"./chunk-XZLM4HLO.js";import{c as C,m as z}from"./chunk-EH22T4FI.js";import{b as J,c as V}from"./chunk-5AWELO3D.js";import{B as H,C as $,E as b,I as T,K as M,W as w}from"./chunk-V654BMS7.js";import{a as P}from"./chunk-BN7ZXAZJ.js";import{f as D,h as E,j as W}from"./chunk-J7BTC45S.js";import{Ba as _,Sa as G,Ua as j,ja as N,la as I,ta as A,wb as q,za as O}from"./chunk-RIG66DIQ.js";import{b as i,i as U}from"./chunk-FZCGRIOM.js";import{b as le}from"./chunk-YTUUU33R.js";import{c as s,g as x}from"./chunk-IWTNUJGY.js";import{e as ae,g as m}from"./chunk-VKWPEFWQ.js";m();m();var u="https://github.com/Shopify/skeleton-theme.git",ce="https://github.com/Shopify/theme-liquid-docs.git",k={all:"All",github:"VS Code (GitHub Copilot)",cursor:"Cursor",claude:"Claude"};async function X(t,e){return v(t,e)}async function Z(t,e){return v(t,e,!0)}async function ee(t){let e=await B("Shopify","skeleton-theme",{filter:n=>!n.draft&&!n.prerelease});if(!e)throw new E("Couldn't find a stable Skeleton theme release");return{...await v(`${u}#${e.tag_name}`,t),repoUrl:u,latest:!0}}async function v(t,e,o){return await T([{title:`Cloning ${t} into ${e}`,task:async()=>{await C({repoUrl:t,destination:e,latestTag:o,shallow:!o}),await z(e),t.split("#")[0]===u&&(await Promise.all(Object.keys(k).map(async n=>Q(s(e,`.${n}`)))),await Q(s(e,".git")))}}]),{path:e,repoUrl:t,latest:o??!1,aiInstructions:null,instructionFiles:[]}}async function Q(t){await G(t)&&await _(t)}async function te(){return await b({message:"Which LLM instruction file would you like to include in your theme?",choices:[...Object.entries(k).map(([e,o])=>({label:o,value:e})),{label:"Skip",value:null}]})}async function oe(t,e){let o=[],n=[s(t,"AGENTS.md")];return await T([{title:`Adding AI instructions into ${t}`,task:async()=>{await N(async p=>{await C({repoUrl:ce,destination:p,shallow:!0});let h=e==="all"?Object.keys(k).filter(r=>r!=="all"):[e];try{let r=s(p,"ai","github","copilot-instructions.md"),d=await I(r),f=s(t,"AGENTS.md"),L=`# AGENTS.md
2
2
 
3
3
  ${d}`;await A(f,L);let a=await Promise.all(h.map(l=>me(t,f,l)));n.push(...h.flatMap(l=>l==="cursor"?[]:[s(t,l==="github"?"copilot-instructions.md":"CLAUDE.md")])),a.forEach(l=>{l.copiedFile&&o.push(l.copiedFile)})}catch{throw new E("Failed to create AI instructions")}})}}]),{files:n,copiedFiles:o}}async function me(t,e,o){if(o==="cursor")return{};let p={github:"copilot-instructions.md",claude:"CLAUDE.md"}[o],h=s(t,p);try{return await O(e,h),{}}catch(r){if(r instanceof Error){let d=await I(e);return await A(h,d),{copiedFile:p}}else throw r}}m();import{resolve as ne}from"node:path";var ue=i.enum(["all","github","cursor","claude"]).nullable(),F=i.string().refine(x).describe("An absolute native filesystem path."),S=P({name:"ThemeInitResult",definitions:{AbsolutePath:F},schema:i.object({status:i.enum(["success","partial"]),changed:i.literal(!0),directory:F,repoUrl:i.string().min(1).describe("The source Git remote (including HTTPS, SSH, or SCP-style Git URLs)."),latest:i.boolean(),aiInstructions:ue,instructionFilePaths:i.array(F).nullable().describe("Created instruction files, or null when setup failed before their completion could be established."),reason:i.string().nullable().describe("The reason for incomplete setup, or null when setup completed.")}).strict()});function re(t){return{status:t.status??"success",changed:!0,directory:ne(t.path),repoUrl:t.repoUrl,latest:t.latest,aiInstructions:t.aiInstructions,instructionFilePaths:t.status==="partial"?null:t.instructionFiles.map(e=>ne(e)),reason:t.reason??null}}m();function ie(t,e){e==="json"&&q(S.encode(re(t)))}function se(t){if(t.length===0)return;let e="Files created instead of symlinks.",o=`Shopify CLI attempted to create symbolic links between AGENTS.md and ${t.join(", ")}, but your system doesn't have Developer Mode enabled or symlinks are disabled. Separate files were created instead.`;H({headline:e,body:o})}var y=ae(le(),1);var R=class extends Y{static get jsonOutputSchema(){return S}static summary="Clones a Git repository to use as a starting point for building a new theme.";static descriptionWithMarkdown=`Clones a Git repository to your local machine to use as the starting point for building a theme.
4
4
 
@@ -1,3 +1,3 @@
1
- import{a as I}from"./chunk-LFOBYEWG.js";import{j as w}from"./chunk-H4V55Y3Z.js";import{w as l}from"./chunk-IUP7POIE.js";import{m as u,n as m}from"./chunk-ZT5WFUKJ.js";import{a as h}from"./chunk-4C2DAX5T.js";import{B as y,C as N,T as S,z as g}from"./chunk-CZ22VZDA.js";import{o as d}from"./chunk-335BUVBP.js";import{j as _}from"./chunk-2VSNFOKD.js";import{Bb as a}from"./chunk-LWCTKI4Z.js";import{b as n}from"./chunk-FZCGRIOM.js";import{a as f}from"./chunk-JD5P5RAJ.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var C="https://cdn.shopify.com/static/cli/notifications.json",T="Cache is empty",O=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear","send-analytics"],$=["127.0.0.1","localhost","::1","[::1]"];function c(){let e=process.env.SHOPIFY_CLI_NOTIFICATIONS_URL;if(e)try{let t=new globalThis.URL(e);if(v(t))return e;a(`The notifications URL provided via SHOPIFY_CLI_NOTIFICATIONS_URL (${e}) must use https, or http with a loopback host. Falling back to default.`)}catch{a(`The notifications URL provided via SHOPIFY_CLI_NOTIFICATIONS_URL (${e}) is not a valid URL. Falling back to default.`)}return C}function v(e){return e.protocol==="https:"?!0:e.protocol==="http:"&&$.includes(e.hostname)}var E=n.object({id:n.string(),message:n.string(),type:n.enum(["info","warning","error"]),frequency:n.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:n.string(),cta:n.object({label:n.string(),url:n.string().url()}).optional(),title:n.string().optional(),minVersion:n.string().optional(),maxVersion:n.string().optional(),minDate:n.string().optional(),maxDate:n.string().optional(),commands:n.array(n.string()).optional(),surface:n.string().optional()}),x=n.object({notifications:n.array(E)});async function Z(e,t=process.env){try{let r=I();if(D(r,t)||d(t))return;let o=await k(),i=A(o.notifications,r,e);a(`Notifications to show: ${i.length}`),await L(i)}catch(r){if(r.message===T){a("Notifications to show: 0 (Cache is empty)");return}if(r.message==="abort")throw new _;let o=`Error showing notifications: ${r.message}`;a(o);let{sendErrorToBugsnag:i}=await import("./error-handler-74HKA23T.js");await i(o,"unexpected_error")}}function D(e,t=process.env){return f(t.CI)||f(t.SHOPIFY_UNIT_TEST)||O.includes(e)}async function L(e){e.slice(0,2).forEach(t=>{let r={headline:t.title,body:t.message.replace(/\\n/g,`
1
+ import{a as I}from"./chunk-LFOBYEWG.js";import{j as w}from"./chunk-NCPZVARH.js";import{w as l}from"./chunk-2M535QQJ.js";import{m as u,n as m}from"./chunk-J3UXIC23.js";import{a as h}from"./chunk-MHWETFNT.js";import{B as y,C as N,T as S,z as g}from"./chunk-V654BMS7.js";import{o as d}from"./chunk-335BUVBP.js";import{j as _}from"./chunk-J7BTC45S.js";import{Bb as a}from"./chunk-RIG66DIQ.js";import{b as n}from"./chunk-FZCGRIOM.js";import{a as f}from"./chunk-JD5P5RAJ.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var C="https://cdn.shopify.com/static/cli/notifications.json",T="Cache is empty",O=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear","send-analytics"],$=["127.0.0.1","localhost","::1","[::1]"];function c(){let e=process.env.SHOPIFY_CLI_NOTIFICATIONS_URL;if(e)try{let t=new globalThis.URL(e);if(v(t))return e;a(`The notifications URL provided via SHOPIFY_CLI_NOTIFICATIONS_URL (${e}) must use https, or http with a loopback host. Falling back to default.`)}catch{a(`The notifications URL provided via SHOPIFY_CLI_NOTIFICATIONS_URL (${e}) is not a valid URL. Falling back to default.`)}return C}function v(e){return e.protocol==="https:"?!0:e.protocol==="http:"&&$.includes(e.hostname)}var E=n.object({id:n.string(),message:n.string(),type:n.enum(["info","warning","error"]),frequency:n.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:n.string(),cta:n.object({label:n.string(),url:n.string().url()}).optional(),title:n.string().optional(),minVersion:n.string().optional(),maxVersion:n.string().optional(),minDate:n.string().optional(),maxDate:n.string().optional(),commands:n.array(n.string()).optional(),surface:n.string().optional()}),x=n.object({notifications:n.array(E)});async function Z(e,t=process.env){try{let r=I();if(D(r,t)||d(t))return;let o=await k(),i=A(o.notifications,r,e);a(`Notifications to show: ${i.length}`),await L(i)}catch(r){if(r.message===T){a("Notifications to show: 0 (Cache is empty)");return}if(r.message==="abort")throw new _;let o=`Error showing notifications: ${r.message}`;a(o);let{sendErrorToBugsnag:i}=await import("./error-handler-OVJYVIOZ.js");await i(o,"unexpected_error")}}function D(e,t=process.env){return f(t.CI)||f(t.SHOPIFY_UNIT_TEST)||O.includes(e)}async function L(e){e.slice(0,2).forEach(t=>{let r={headline:t.title,body:t.message.replace(/\\n/g,`
2
2
  `),link:t.cta};switch(t.type){case"info":{g(r);break}case"warning":{y(r);break}case"error":throw N(r),new Error("abort")}u(`notification-${t.id}`,new Date().getTime().toString())})}async function k(){let e=`notifications-${c()}`,t=m(e)?.value;if(!t)throw new Error(T);let r=JSON.parse(t);return x.parse(r)}async function ee(){a("Fetching notifications...");let e=await w(c(),void 0,{useNetworkLevelRetry:!1,useAbortSignal:!0,timeoutMs:3*1e3});if(e.status!==200)throw new Error(`Failed to fetch notifications: ${e.statusText}`);let t=await e.text(),r=JSON.parse(t),o=x.parse(r);return await F(t),o}async function F(e){u(`notifications-${c()}`,e),a(`Notifications from ${c()} stored in the cache`)}function te(e,t=process.argv,r=process.env){if(D(e,r)||!t[1])return;let o=process.execPath,s=[t[1],"notifications","list","--ignore-errors"];S(o,s,{background:!0,env:{...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},externalErrorHandler:async b=>{a(`Failed to fetch notifications in background: ${b.message}`)}})}function A(e,t,r,o=new Date(new Date().setUTCHours(0,0,0,0)),i=h){return e.filter(s=>V(s,i)).filter(s=>B(s,o)).filter(s=>R(s,t)).filter(s=>U(s,t,r)).filter(s=>H(s))}function V(e,t){let r=!e.minVersion||l(t,`>=${e.minVersion}`),o=!e.maxVersion||l(t,`<=${e.maxVersion}`);return r&&o}function B(e,t){let r=!e.minDate||new Date(e.minDate)<=t,o=!e.maxDate||new Date(e.maxDate)>=t;return r&&o}function R(e,t){return t===""?!0:!e.commands||e.commands.includes(t)}function U(e,t,r){let o=t.split(":")[0]??"all",i=e.surface??"all";return r?r.includes(i):i===o||i==="all"}function H(e){if(!e.frequency)return!0;let t=`notification-${e.id}`,r=m(t)?.value;if(!r)return!0;switch(e.frequency){case"always":return!0;case"once":return!1;case"once_a_day":return new Date().getTime()-Number(r)>24*3600*1e3;case"once_a_week":return new Date().getTime()-Number(r)>168*3600*1e3}}function re(e){let t=[];return e.minDate&&t.push(`from ${e.minDate}`),e.maxDate&&t.push(`to ${e.maxDate}`),e.minVersion&&t.push(`from v${e.minVersion}`),e.maxVersion&&t.push(`to v${e.maxVersion}`),e.frequency==="once"&&t.push("show only once"),e.frequency==="once_a_day"&&t.push("show once a day"),e.frequency==="once_a_week"&&t.push("show once a week"),e.surface&&t.push(`surface = ${e.surface}`),e.commands&&t.push(`commands = ${e.commands.join(", ")}`),t.join(`
3
3
  `)}export{Z as a,k as b,ee as c,te as d,A as e,re as f};