shopify 3.94.3 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/bin/run.js +5 -1
  2. package/dist/analytics-6IHHYAV6.js +1 -0
  3. package/dist/analytics-KKVP5DT3.js +1 -0
  4. package/dist/bootstrap.d.ts +5 -0
  5. package/dist/bootstrap.js +3 -0
  6. package/dist/chunk-22PCRFG4.js +1 -0
  7. package/dist/chunk-26D72ZNV.js +1 -0
  8. package/dist/chunk-2APPXD5Z.js +2 -0
  9. package/dist/chunk-2I4PRX2I.js +1 -0
  10. package/dist/chunk-2VQJQ36C.js +103 -0
  11. package/dist/chunk-323UTVMM.js +1 -0
  12. package/dist/chunk-3DQIVE24.js +9 -0
  13. package/dist/chunk-3F6NZK7S.js +2 -0
  14. package/dist/chunk-3LVGAQB4.js +1 -0
  15. package/dist/chunk-3TNEIDOD.js +1 -0
  16. package/dist/chunk-3VZEETAV.js +1 -0
  17. package/dist/chunk-4G7J6HIV.js +1 -0
  18. package/dist/chunk-4HHXSMD7.js +10 -0
  19. package/dist/chunk-4LNCYIS3.js +1 -0
  20. package/dist/chunk-4ZGSSQC6.js +1 -0
  21. package/dist/chunk-52GC6XUT.js +1 -0
  22. package/dist/chunk-5CH3B62S.js +2 -0
  23. package/dist/chunk-5Y7GIF2W.js +1 -0
  24. package/dist/chunk-66RJ5T7A.js +102 -0
  25. package/dist/chunk-6B53BWJW.js +1 -0
  26. package/dist/chunk-6BMMB2UO.js +1 -0
  27. package/dist/chunk-6HBRBQAN.js +6 -0
  28. package/dist/chunk-6M3ZYNGO.js +451 -0
  29. package/dist/chunk-6TZAAS5H.js +1 -0
  30. package/dist/chunk-72F3YBNA.js +1 -0
  31. package/dist/chunk-74HYYXXE.js +17 -0
  32. package/dist/chunk-75VPUOC5.js +1 -0
  33. package/dist/chunk-7BGM2GAH.js +1 -0
  34. package/dist/chunk-7UYZQN4V.js +18 -0
  35. package/dist/chunk-A74GETYC.js +1 -0
  36. package/dist/chunk-AIV5RI3X.js +1 -0
  37. package/dist/chunk-ALKTLKQ6.js +5 -0
  38. package/dist/chunk-B2EHO7ZC.js +847 -0
  39. package/dist/chunk-B2IVY4V5.js +1 -0
  40. package/dist/chunk-BDVAE5MS.js +28 -0
  41. package/dist/chunk-CERXUPGC.js +14 -0
  42. package/dist/chunk-D3TSJA5S.js +1 -0
  43. package/dist/chunk-D6JARNEH.js +1 -0
  44. package/dist/chunk-DFMQWJQ3.js +3 -0
  45. package/dist/chunk-DJONKJSZ.js +1 -0
  46. package/dist/chunk-DJQVNH7P.js +567 -0
  47. package/dist/chunk-DU4WR4OP.js +1 -0
  48. package/dist/chunk-ELVFJ7BR.js +4 -0
  49. package/dist/chunk-ELYP4KFP.js +8 -0
  50. package/dist/chunk-FFQ5EWII.js +294 -0
  51. package/dist/chunk-FUOIGXI4.js +1 -0
  52. package/dist/chunk-GD7FWXJ5.js +2 -0
  53. package/dist/chunk-GFEAKSGV.js +374 -0
  54. package/dist/chunk-GFJ7UV74.js +1 -0
  55. package/dist/chunk-GNPS5SBU.js +1 -0
  56. package/dist/chunk-GOJ2QHSR.js +1 -0
  57. package/dist/chunk-HSK7YMRE.js +359 -0
  58. package/dist/chunk-HUZUORYM.js +19 -0
  59. package/dist/chunk-HZA6IAA4.js +1 -0
  60. package/dist/chunk-IASVAERO.js +1 -0
  61. package/dist/chunk-IIIVWD4R.js +1 -0
  62. package/dist/chunk-INEU4XKS.js +6 -0
  63. package/dist/chunk-IOLVEXM6.js +1 -0
  64. package/dist/chunk-IU2ZQ6TE.js +2 -0
  65. package/dist/chunk-IX5ICOBV.js +7 -0
  66. package/dist/chunk-J3KVONB3.js +6 -0
  67. package/dist/chunk-JGXWQULI.js +1 -0
  68. package/dist/chunk-JHPRFW5B.js +19 -0
  69. package/dist/chunk-JLBH7RCF.js +4 -0
  70. package/dist/chunk-JPGO36XP.js +1 -0
  71. package/dist/chunk-JUVAGMIH.js +1 -0
  72. package/dist/chunk-JVIKCGDY.js +1 -0
  73. package/dist/chunk-K2WUCOQJ.js +32 -0
  74. package/dist/chunk-K5YV6UVF.js +4 -0
  75. package/dist/chunk-KBQ4LGFB.js +1 -0
  76. package/dist/chunk-KGXQS7LS.js +1 -0
  77. package/dist/chunk-KL5Z3T6L.js +1 -0
  78. package/dist/chunk-KLMDWDT2.js +1 -0
  79. package/dist/chunk-KNVM7N3U.js +1 -0
  80. package/dist/chunk-KWJ562F2.js +12 -0
  81. package/dist/chunk-LALIKZPS.js +5 -0
  82. package/dist/chunk-LAZJ47DZ.js +6 -0
  83. package/dist/chunk-LDGAHMS7.js +159 -0
  84. package/dist/chunk-LNHLDRC5.js +1 -0
  85. package/dist/chunk-LW7U753G.js +1 -0
  86. package/dist/chunk-LX3ZOW52.js +12 -0
  87. package/dist/chunk-LXFJDCNG.js +1 -0
  88. package/dist/chunk-MBAFWQSZ.js +7 -0
  89. package/dist/chunk-MOA33ZFO.js +1 -0
  90. package/dist/chunk-MQNYGGAM.js +1 -0
  91. package/dist/chunk-N5YIPQ6J.js +1 -0
  92. package/dist/chunk-N7RBSKYT.js +1 -0
  93. package/dist/chunk-NF2ABOOU.js +1 -0
  94. package/dist/chunk-NRAFVIU3.js +1 -0
  95. package/dist/chunk-OCOY5MV2.js +1 -0
  96. package/dist/chunk-ODNGDO4H.js +50 -0
  97. package/dist/chunk-OHY4ZL3U.js +2 -0
  98. package/dist/chunk-OLZHWPZP.js +1 -0
  99. package/dist/chunk-OUOYKNMY.js +1 -0
  100. package/dist/chunk-OXPWCC7I.js +64 -0
  101. package/dist/chunk-P5VVOLGV.js +1 -0
  102. package/dist/chunk-P6XE4MH5.js +1 -0
  103. package/dist/chunk-P7R7FBY2.js +3 -0
  104. package/dist/chunk-PD5ZHJWI.js +1 -0
  105. package/dist/chunk-PIBY5DDZ.js +1 -0
  106. package/dist/chunk-Q7ING5F5.js +1 -0
  107. package/dist/chunk-QFWIDATO.js +1 -0
  108. package/dist/chunk-QRRNOVJ3.js +1 -0
  109. package/dist/chunk-QSTEVZFQ.js +1 -0
  110. package/dist/chunk-R466TU3N.js +2 -0
  111. package/dist/chunk-RF2DPBA6.js +1 -0
  112. package/dist/chunk-RFG5RMPL.js +1 -0
  113. package/dist/chunk-RM5SJJN6.js +559 -0
  114. package/dist/chunk-RVNMVBPM.js +1 -0
  115. package/dist/chunk-SBEZBZM7.js +144 -0
  116. package/dist/chunk-SGQ6D3LU.js +15 -0
  117. package/dist/chunk-SRCQVUMC.js +1 -0
  118. package/dist/chunk-TFSBQ4RY.js +5 -0
  119. package/dist/chunk-TQYMC7TH.js +1 -0
  120. package/dist/chunk-UGDBJTLP.js +6 -0
  121. package/dist/chunk-UGXYQ23Y.js +1411 -0
  122. package/dist/chunk-UWJ73J4B.js +1 -0
  123. package/dist/chunk-V2CNCPIE.js +2 -0
  124. package/dist/chunk-VBUZWRUL.js +1 -0
  125. package/dist/chunk-VS3T5YOG.js +264 -0
  126. package/dist/chunk-VWYM4OWK.js +1 -0
  127. package/dist/chunk-VY6SNDKW.js +3 -0
  128. package/dist/chunk-WDC3KIZT.js +2 -0
  129. package/dist/chunk-WFXRSKRK.js +1 -0
  130. package/dist/chunk-WXVZJJOR.js +16 -0
  131. package/dist/chunk-WZBSLU4Q.js +6 -0
  132. package/dist/chunk-XBXMPFXM.js +1 -0
  133. package/dist/chunk-XEFQQPL4.js +1 -0
  134. package/dist/chunk-XLELNRFF.js +3 -0
  135. package/dist/chunk-XNO6DZYP.js +1 -0
  136. package/dist/chunk-Y5JKV2AI.js +1 -0
  137. package/dist/chunk-YC6G4MHD.js +3 -0
  138. package/dist/chunk-YI232QLS.js +1 -0
  139. package/dist/chunk-YMWHHINU.js +1 -0
  140. package/dist/chunk-YOZNRLFC.js +1 -0
  141. package/dist/chunk-YZDDTYTU.js +11 -0
  142. package/dist/chunk-Z35BTAM6.js +2 -0
  143. package/dist/chunk-ZR76GGZ6.js +5 -0
  144. package/dist/chunk-ZTMSBSYD.js +1 -0
  145. package/dist/chunk-ZV6NCNI4.js +586 -0
  146. package/dist/chunk-ZVJVDCIM.js +1 -0
  147. package/dist/cli/commands/app/app-logs/sources.js +2 -0
  148. package/dist/cli/commands/app/build.js +1 -0
  149. package/dist/cli/commands/app/bulk/cancel.js +1 -0
  150. package/dist/cli/commands/app/bulk/execute.js +9 -0
  151. package/dist/cli/commands/app/bulk/status.js +5 -0
  152. package/dist/cli/commands/app/config/link.js +4 -0
  153. package/dist/cli/commands/app/config/pull.js +1 -0
  154. package/dist/cli/commands/app/config/use.js +1 -0
  155. package/dist/cli/commands/app/config/validate.js +3 -0
  156. package/dist/cli/commands/app/demo/watcher.js +1 -0
  157. package/dist/cli/commands/app/deploy.js +22 -0
  158. package/dist/cli/commands/app/dev/clean.js +5 -0
  159. package/dist/cli/commands/app/dev.js +320 -0
  160. package/dist/cli/commands/app/env/pull.js +11 -0
  161. package/dist/cli/commands/app/env/show.js +1 -0
  162. package/dist/cli/commands/app/execute.js +1 -0
  163. package/dist/cli/commands/app/function/build.js +1 -0
  164. package/dist/cli/commands/app/function/info.js +16 -0
  165. package/dist/cli/commands/app/function/replay.js +5 -0
  166. package/dist/cli/commands/app/function/run.js +1 -0
  167. package/dist/cli/commands/app/function/schema.js +1 -0
  168. package/dist/cli/commands/app/function/typegen.js +1 -0
  169. package/dist/cli/commands/app/generate/extension.js +5 -0
  170. package/dist/cli/commands/app/import-custom-data-definitions.js +4 -0
  171. package/dist/cli/commands/app/import-extensions.js +1 -0
  172. package/dist/cli/commands/app/info.js +11 -0
  173. package/dist/cli/commands/app/init.js +10 -0
  174. package/dist/cli/commands/app/logs.js +2 -0
  175. package/dist/cli/commands/app/release.js +4 -0
  176. package/dist/cli/commands/app/versions/list.js +1 -0
  177. package/dist/cli/commands/app/webhook/trigger.js +25 -0
  178. package/dist/cli/commands/auth/login.js +1 -20
  179. package/dist/cli/commands/auth/logout.js +1 -12
  180. package/dist/cli/commands/cache/clear.js +1 -11
  181. package/dist/cli/commands/config/autoupgrade/constants.d.ts +0 -1
  182. package/dist/cli/commands/config/autoupgrade/constants.js +1 -6
  183. package/dist/cli/commands/config/autoupgrade/off.js +1 -22
  184. package/dist/cli/commands/config/autoupgrade/on.js +1 -22
  185. package/dist/cli/commands/config/autoupgrade/status.js +1 -30
  186. package/dist/cli/commands/debug/command-flags.js +1 -79
  187. package/dist/cli/commands/docs/generate.js +1 -157
  188. package/dist/cli/commands/doctor-release/doctor-release.js +1 -25
  189. package/dist/cli/commands/doctor-release/theme/index.js +1 -56
  190. package/dist/cli/commands/help.js +1 -26
  191. package/dist/cli/commands/kitchen-sink/async.js +1 -16
  192. package/dist/cli/commands/kitchen-sink/index.js +1 -21
  193. package/dist/cli/commands/kitchen-sink/prompts.js +1 -16
  194. package/dist/cli/commands/kitchen-sink/static.js +1 -16
  195. package/dist/cli/commands/notifications/generate.js +1 -11
  196. package/dist/cli/commands/notifications/list.js +1 -33
  197. package/dist/cli/commands/organization/list.js +1 -0
  198. package/dist/cli/commands/search.js +1 -27
  199. package/dist/cli/commands/theme/check.js +1 -0
  200. package/dist/cli/commands/theme/console.js +15 -0
  201. package/dist/cli/commands/theme/delete.js +7 -0
  202. package/dist/cli/commands/theme/dev.js +26 -0
  203. package/dist/cli/commands/theme/duplicate.js +32 -0
  204. package/dist/cli/commands/theme/info.js +1 -0
  205. package/dist/cli/commands/theme/init.js +8 -0
  206. package/dist/cli/commands/theme/language-server.js +1 -0
  207. package/dist/cli/commands/theme/list.js +1 -0
  208. package/dist/cli/commands/theme/metafields/pull.js +3 -0
  209. package/dist/cli/commands/theme/open.js +8 -0
  210. package/dist/cli/commands/theme/package.js +7 -0
  211. package/dist/cli/commands/theme/preview.js +1 -0
  212. package/dist/cli/commands/theme/profile.js +3 -0
  213. package/dist/cli/commands/theme/publish.js +7 -0
  214. package/dist/cli/commands/theme/pull.js +3 -0
  215. package/dist/cli/commands/theme/push.js +28 -0
  216. package/dist/cli/commands/theme/rename.js +6 -0
  217. package/dist/cli/commands/theme/share.js +3 -0
  218. package/dist/cli/commands/upgrade.js +1 -17
  219. package/dist/cli/commands/version.js +1 -10
  220. package/dist/command-registry.d.ts +8 -0
  221. package/dist/command-registry.js +1 -0
  222. package/dist/conf-store-U5ZITKJN.js +1 -0
  223. package/dist/custom-oclif-loader-DVFFWCBV.js +1 -0
  224. package/dist/deprecations-TU5UQJVV.js +1 -0
  225. package/dist/dist-2Z5TND4U.js +1 -0
  226. package/dist/dist-GYHFDHKP.js +1 -0
  227. package/dist/environments-Z5PR7DSI.js +1 -0
  228. package/dist/error-IJGNYKZ3.js +1 -0
  229. package/dist/error-handler-WSCGNS2P.js +1 -0
  230. package/dist/fs-5BDEA2KD.js +1 -0
  231. package/dist/hooks/app-init.d.ts +9 -0
  232. package/dist/hooks/app-init.js +1 -0
  233. package/dist/hooks/did-you-mean.d.ts +1 -0
  234. package/dist/hooks/did-you-mean.js +1 -0
  235. package/dist/hooks/hydrogen-init.d.ts +7 -0
  236. package/dist/hooks/hydrogen-init.js +1 -0
  237. package/dist/hooks/plugin-plugins.d.ts +1 -0
  238. package/dist/hooks/plugin-plugins.js +1 -0
  239. package/dist/hooks/postrun.js +1 -1
  240. package/dist/hooks/prerun.js +1 -1
  241. package/dist/hooks/public-metadata.d.ts +1 -0
  242. package/dist/hooks/public-metadata.js +1 -0
  243. package/dist/hooks/sensitive-metadata.d.ts +1 -0
  244. package/dist/hooks/sensitive-metadata.js +1 -0
  245. package/dist/hooks/tunnel-provider.d.ts +1 -0
  246. package/dist/hooks/tunnel-provider.js +1 -0
  247. package/dist/hooks/tunnel-start.d.ts +1 -0
  248. package/dist/hooks/tunnel-start.js +1 -0
  249. package/dist/http-proxy-node16-Q5DZMBHC.js +38 -0
  250. package/dist/index.js +254 -3668
  251. package/dist/is-global-V4ZRHQG2.js +1 -0
  252. package/dist/latest-version-EFWBOTWM.js +49 -0
  253. package/dist/lib-5L7UKDEK.js +1 -0
  254. package/dist/lib-C3VO2BQW.js +1 -0
  255. package/dist/lib-QB6I6CTC.js +1 -0
  256. package/dist/local-6QPX4GCJ.js +1 -0
  257. package/dist/local-storage-JLXBZVWO.js +1 -0
  258. package/dist/metadata-UDMOTRS7.js +1 -0
  259. package/dist/{morph-DQREIZD2.js → morph-EMYAITFM.js} +1 -1
  260. package/dist/node-package-manager-HAFRYGUM.js +1 -0
  261. package/dist/notifications-system-MP7WDOCS.js +1 -0
  262. package/dist/npa-ICFSA3NL.js +1 -0
  263. package/dist/output-YGMHXEIS.js +1 -0
  264. package/dist/{path-HUAU3YBW.js → path-CWUNINMX.js} +1 -1
  265. package/dist/{prettier-PGDJ5B7I.js → prettier-NVRHEAFO.js} +1 -1
  266. package/dist/system-KLXD4FXF.js +1 -0
  267. package/dist/tsconfig.tsbuildinfo +1 -1
  268. package/dist/typescript-K5CWIA4V.js +1 -0
  269. package/dist/ui-GHG3UGB3.js +1 -0
  270. package/dist/upgrade-OPZGPM5J.js +1 -0
  271. package/dist/version-D5PJZIRW.js +1 -0
  272. package/dist/version-KRQBMYCH.js +1 -0
  273. package/dist/workerd-L2EJKIAQ.js +18 -0
  274. package/oclif.manifest.json +5247 -6056
  275. package/package.json +17 -41
  276. package/dist/chunk-45T5XUIM.js +0 -1
  277. package/dist/chunk-52KHWFYF.js +0 -1
  278. package/dist/chunk-66TIGB4U.js +0 -415
  279. package/dist/chunk-675GKVCB.js +0 -3
  280. package/dist/chunk-7ES6PV7M.js +0 -847
  281. package/dist/chunk-BF7JM4FH.js +0 -396
  282. package/dist/chunk-FU2Y2M3M.js +0 -5
  283. package/dist/chunk-IDQ4X47Z.js +0 -3
  284. package/dist/chunk-JBSYWYIP.js +0 -2
  285. package/dist/chunk-PBKIXB7L.js +0 -63
  286. package/dist/chunk-SVA22NZQ.js +0 -607
  287. package/dist/error-handler-LC7FITE7.js +0 -1
  288. package/dist/http-proxy-node16-TTURN6MD.js +0 -38
  289. package/dist/lib-3WHF5XD3.js +0 -1
  290. package/dist/local-TWIGLQ7X.js +0 -1
  291. package/dist/node-package-manager-3UCLJPGW.js +0 -1
  292. package/dist/npa-OKDXXRCU.js +0 -1
  293. package/dist/ui-UYE67X4Y.js +0 -1
  294. package/dist/workerd-37BZZEVW.js +0 -18
  295. /package/dist/{chunk-KADPE3PY.js → chunk-7MUKLZOL.js} +0 -0
@@ -0,0 +1 @@
1
+ import{B as l,C as f,D as m,E as d,J as p,y as u}from"./chunk-B2EHO7ZC.js";import{h as n}from"./chunk-GOJ2QHSR.js";import{b as g}from"./chunk-YZDDTYTU.js";import{F as S,z as h}from"./chunk-BDVAE5MS.js";import{r as C}from"./chunk-LDGAHMS7.js";import{Pb as w}from"./chunk-GFEAKSGV.js";import{e as L,g as i}from"./chunk-VPRTJUIN.js";i();i();var r="NEW_LOGIN";function N(e,t){let s=[],o=e[t];if(o)for(let[c,I]of Object.entries(o))s.push({label:I.identity.alias??c,value:c});return s}async function b(){let e=await p({},{forceNewSession:!0}),t=await f(e.userId);if(!t){let s=await S({message:"Enter an alias for this account (e.g. your email or a nickname)"});return await m(e.userId,s),s}return t}async function v(){let e=await l(),t=await u(),s=[];return e&&s.push(...N(e,t)),s.length>0&&s.push({label:"Log in with a different account",value:r}),s}async function y(e){if(e){let o=await d(e);if(o)return n(o),e}let t=await v(),s=r;return t.length>0&&(s=await h({message:"Which account would you like to use?",choices:t})),s===r?b():(n(s),t.find(o=>o.value===s)?.label??s)}var A=L(C(),1);var a=class e extends g{static{this.description="Logs you in to your Shopify account."}static{this.flags={alias:A.Flags.string({description:"Alias of the session you want to login to.",env:"SHOPIFY_FLAG_AUTH_ALIAS"})}}async run(){let{flags:t}=await this.parse(e),s=await y(t.alias);w(`Current account: ${s}.`)}};export{a};
@@ -0,0 +1 @@
1
+ import{b as n}from"./chunk-XNO6DZYP.js";import{l as i}from"./chunk-JPGO36XP.js";import{g as t}from"./chunk-VPRTJUIN.js";t();t();var o=class extends i.ExtendableError{constructor(e,p){super(p),this.type=e}},d=r=>async()=>r,f=r=>async e=>e.provider!==r.provider?n(new o("invalid-provider")):r.action(e.port);var a="cloudflare",l=d({name:a});export{o as a,f as b,a as c,l as d};
@@ -0,0 +1,17 @@
1
+ import{a as A,h as $,k as b}from"./chunk-2VQJQ36C.js";import{e as w,f as v}from"./chunk-KWJ562F2.js";import{e as y}from"./chunk-KNVM7N3U.js";import{l as E,m as C}from"./chunk-RFG5RMPL.js";import{xa as T}from"./chunk-B2EHO7ZC.js";import{Qb as p}from"./chunk-GFEAKSGV.js";import{g as S}from"./chunk-VPRTJUIN.js";S();var P=20,_=1024*1024,B=2;function oe(t,e,r,o,s={},l){let n=A(r),i=new Map,c=a=>a.total===0?"[100%]":`[${Math.round(a.current/a.total*100)}%]`,u=j(t,e,n),f=Promise.all([o.ready(),u]).then(()=>L(n,o,t,e,i)),h=f.then(a=>a.promise).then(()=>M(n,o,t,e,s,i)),k=s?.deferPartialWork?u:h.then(a=>a.promise);return s?.backgroundWorkCatch&&Promise.all([u,f.then(a=>a.promise),h.then(a=>a.promise)]).catch(s.backgroundWorkCatch),{uploadResults:i,workPromise:k,renderThemeSyncProgress:async()=>{if(s?.deferPartialWork)return;let{progress:a,promise:m}=await f,d=s.multiEnvironment?4e3:1e3;await y(U({promise:m,titleGetter:()=>`Uploading files to remote theme ${c(a)}`,updateInterval:d}),l?.stderr,s?.multiEnvironment);let{progress:g,promise:F}=await h;await y(U({promise:F,titleGetter:()=>`Cleaning your remote theme ${c(g)}`,updateInterval:d}),l?.stderr,s?.multiEnvironment),await y([{title:"Theme upload complete",task:async()=>{}}],l?.stderr,s?.multiEnvironment),N(i,s?.environment)}}}function U({promise:t,titleGetter:e,updateInterval:r}){let o=[],s=()=>{o.push({title:e(),task:async()=>{await Promise.race([t,new Promise(n=>setTimeout(()=>n("timeout"),r))])==="timeout"&&s()}})};return s(),o}function M(t,e,r,o,s,l){if(s.nodelete)return{progress:{current:0,total:0},promise:Promise.resolve()};let n=W(t,e),i=z(n),c={current:0,total:i.length};if(i.length===0)return{progress:c,promise:Promise.resolve()};let u=[];for(let h=0;h<i.length;h+=P){let k=i.slice(h,h+P),a=E(r.id,k.map(m=>m.key),o).then(m=>{m.forEach(d=>{if(l.set(d.key,d),!d.success){let g=d.errors?.asset?.map(F=>`-${F}`).join(`
2
+ `);v(d.key,"delete")(new Error(`Failed to delete ${d.key}: ${g}`))}}),c.current+=k.length});u.push(a)}let f=Promise.all(u).then(()=>{c.current=c.total});return{progress:c,promise:f}}function W(t,e){let o=e.applyIgnoreFilters(t).filter(s=>!e.files.has(s.key));return p(`Files to be deleted:
3
+ ${o.map(s=>`-${s.key}`).join(`
4
+ `)}`),o}function z(t){let e=b(t);return[...e.contextualizedJsonFiles,...e.templateJsonFiles,...e.sectionJsonFiles,...e.otherJsonFiles,...e.sectionLiquidFiles,...e.blockLiquidFiles,...e.layoutFiles,...e.otherLiquidFiles,...e.configDataFile,...e.configSchemaFile,...e.staticAssetFiles]}var J=[{key:"config/settings_schema.json",value:"[]"},{key:"layout/password.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"},{key:"layout/theme.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"}];async function j(t,e,r){let o=new Set(r.map(l=>l.key)),s=J.filter(({key:l})=>!o.has(l));s.length>0&&await C(t.id,s,e)}function L(t,e,r,o,s){let l=x(e,t);e.unsyncedFileKeys.clear(),l.forEach(a=>e.unsyncedFileKeys.add(a.key));let{independentFiles:n,dependentFiles:i}=D(l),c={current:0,total:l.length},u=a=>a.length===0?Promise.resolve():Promise.all(q(a).map(m=>O(m,e,o,r.id,s).then(()=>{c.current+=m.length,m.forEach(d=>e.unsyncedFileKeys.delete(d.key))}))).then(()=>{}),f=i.reduce((a,m)=>a.then(()=>u(m)),Promise.resolve()),h=Promise.resolve().then(()=>u(n.flat())),k=Promise.all([f,h]).then(()=>{c.current=c.total});return{progress:c,promise:k}}function x(t,e){let r=I(t),o=t.applyIgnoreFilters(r),s=new Map(e.map(n=>[n.key,n])),l=o.filter(n=>{let i=s.get(n.key);return!i||i.checksum!==n.checksum});return p(`Files to be uploaded:
5
+ ${l.map(n=>`-${n.key}`).join(`
6
+ `)}`),l}function D(t){let e=b(t);return{independentFiles:[e.otherLiquidFiles,e.otherJsonFiles,e.staticAssetFiles],dependentFiles:[e.configSchemaFile,e.layoutFiles,e.blockLiquidFiles,e.sectionLiquidFiles,e.sectionJsonFiles,e.templateJsonFiles,e.contextualizedJsonFiles,e.configDataFile]}}function q(t){let e=[],r=[],o=0;for(let s of t){let l=r.length>=P,n=o>=_;(l||n)&&(e.push(r),r=[],o=0),r.push(s),o+=s.size??0}return r.length>0&&e.push(r),e}function I(t){let e=[];return t.files.forEach((r,o)=>{let s=r.value?Buffer.byteLength(r.value,"utf8"):r.attachment?.length??0;e.push({key:o,checksum:r.checksum,size:s})}),e}async function O(t,e,r,o,s){let l=t.map(i=>{let c=e.files.get(i.key)?.value,u=e.files.get(i.key)?.attachment;return{key:i.key,...c&&{value:c},...u&&{attachment:u}}});p(`Uploading the following files:
7
+ ${t.map(i=>`-${i.key}`).join(`
8
+ `)}`),(await R(l,o,r)).forEach(i=>{s.set(i.key,i),G(i,e,o)})}function G(t,e,r){if(t.success)e.uploadErrors.delete(t.key);else{let o=t.errors?.asset??["Response was not successful."];e.uploadErrors.set(t.key,o),$(r,t.key)}}async function R(t,e,r,o=0){if(t.length===0)return[];o>0&&p(`Retry Attempt ${o}/${B} for the following files:
9
+ ${t.map(n=>`-${n.key}`).join(`
10
+ `)}`);let s=await C(e,t,r);p(`File Upload Results:
11
+ ${s.map(n=>`-${n.key}: ${n.success?"success":"failure"}`).join(`
12
+ `)}`);let l=s.filter(n=>!n.success);if(l.length>0){p(`The following files failed to upload:
13
+ ${l.map(i=>`-${i.key}`).join(`
14
+ `)}`);let n=await K(l,t,e,r,o);return s.concat(n)}return s}async function K(t,e,r,o,s){let l=new Set(t.map(i=>i.key)),n=e.filter(i=>l.has(i.key));return s===B?(T("theme-service:upload-failed-retry:max-retry"),p(`Max retry count reached for the following files:
15
+ ${n.map(i=>`-${i.key}`).join(`
16
+ `)}`),t):(T(`theme-service:upload-failed-retry:${n.length}`),R(n,r,o,s+1))}function N(t,e){for(let[r,o]of t.entries())if(!o.success){let s=o.errors?.asset?.join(`
17
+ `)??"File upload failed",l=e?`[${e}] ${r}`:r;w(l,new Error(s))}}export{oe as a};
@@ -0,0 +1 @@
1
+ import{a as u,c as h,g as c}from"./chunk-VPRTJUIN.js";var v=h((w,l)=>{"use strict";c();var{builtinModules:f}=u("module"),d=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),p=["node_modules","favicon.ico"];function g(n){var t=[],e=[];if(n===null)return e.push("name cannot be null"),r(t,e);if(n===void 0)return e.push("name cannot be undefined"),r(t,e);if(typeof n!="string")return e.push("name must be a string"),r(t,e);if(n.length||e.push("name length must be greater than zero"),n.match(/^\./)&&e.push("name cannot start with a period"),n.match(/^_/)&&e.push("name cannot start with an underscore"),n.trim()!==n&&e.push("name cannot contain leading or trailing spaces"),p.forEach(function(s){n.toLowerCase()===s&&e.push(s+" is a blacklisted name")}),f.includes(n.toLowerCase())&&t.push(n+" is a core module name"),n.length>214&&t.push("name can no longer contain more than 214 characters"),n.toLowerCase()!==n&&t.push("name can no longer contain capital letters"),/[~'!()*]/.test(n.split("/").slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(n)!==n){var a=n.match(d);if(a){var i=a[1],o=a[2];if(encodeURIComponent(i)===i&&encodeURIComponent(o)===o)return r(t,e)}e.push("name can only contain URL-friendly characters")}return r(t,e)}var r=function(n,t){var e={validForNewPackages:t.length===0&&n.length===0,validForOldPackages:t.length===0,warnings:n,errors:t};return e.warnings.length||delete e.warnings,e.errors.length||delete e.errors,e};l.exports=g});export{v as a};
@@ -0,0 +1 @@
1
+ import{g as I}from"./chunk-VPRTJUIN.js";I();var o="4.0.0";export{o as a};
@@ -0,0 +1,18 @@
1
+ import{a as Q}from"./chunk-Z35BTAM6.js";import{a as Me}from"./chunk-75VPUOC5.js";import{a as He}from"./chunk-HZA6IAA4.js";import{a as Ce}from"./chunk-PD5ZHJWI.js";import{l as ze,r as F}from"./chunk-LDGAHMS7.js";import{a as Ve,b as Ge}from"./chunk-ZR76GGZ6.js";import{a as ve,c as Z,e as b,g}from"./chunk-VPRTJUIN.js";var me=Z((Bn,je)=>{g();function Ye(i){t.debug=t,t.default=t,t.coerce=l,t.disable=c,t.enable=s,t.enabled=o,t.humanize=Ve(),t.destroy=f,Object.keys(i).forEach(a=>{t[a]=i[a]}),t.names=[],t.skips=[],t.formatters={};function e(a){let u=0;for(let d=0;d<a.length;d++)u=(u<<5)-u+a.charCodeAt(d),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(a){let u,d=null,p,m;function w(...C){if(!w.enabled)return;let I=w,P=Number(new Date),D=P-(u||P);I.diff=D,I.prev=u,I.curr=P,u=P,C[0]=t.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let K=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(de,We)=>{if(de==="%%")return"%";K++;let be=t.formatters[We];if(typeof be=="function"){let qe=C[K];de=be.call(I,qe),C.splice(K,1),K--}return de}),t.formatArgs.call(I,C),(I.log||t.log).apply(I,C)}return w.namespace=a,w.useColors=t.useColors(),w.color=t.selectColor(a),w.extend=n,w.destroy=t.destroy,Object.defineProperty(w,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(p!==t.namespaces&&(p=t.namespaces,m=t.enabled(a)),m),set:C=>{d=C}}),typeof t.init=="function"&&t.init(w),w}function n(a,u){let d=t(this.namespace+(typeof u>"u"?":":u)+a);return d.log=this.log,d}function s(a){t.save(a),t.namespaces=a,t.names=[],t.skips=[];let u=(typeof a=="string"?a:"").trim().replace(" ",",").split(",").filter(Boolean);for(let d of u)d[0]==="-"?t.skips.push(d.slice(1)):t.names.push(d)}function r(a,u){let d=0,p=0,m=-1,w=0;for(;d<a.length;)if(p<u.length&&(u[p]===a[d]||u[p]==="*"))u[p]==="*"?(m=p,w=d,p++):(d++,p++);else if(m!==-1)p=m+1,w++,d=w;else return!1;for(;p<u.length&&u[p]==="*";)p++;return p===u.length}function c(){let a=[...t.names,...t.skips.map(u=>"-"+u)].join(",");return t.enable(""),a}function o(a){for(let u of t.skips)if(r(a,u))return!1;for(let u of t.names)if(r(a,u))return!0;return!1}function l(a){return a instanceof Error?a.stack||a.message:a}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}je.exports=Ye});var Pe=Z((x,X)=>{g();x.formatArgs=Ze;x.save=Qe;x.load=Xe;x.useColors=Ke;x.storage=et();x.destroy=(()=>{let i=!1;return()=>{i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();x.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ke(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let i;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Ze(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+X.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,n=0;i[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(n=t))}),i.splice(n,0,e)}x.log=console.debug||console.log||(()=>{});function Qe(i){try{i?x.storage.setItem("debug",i):x.storage.removeItem("debug")}catch{}}function Xe(){let i;try{i=x.storage.getItem("debug")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function et(){try{return localStorage}catch{}}X.exports=me()(x);var{formatters:tt}=X.exports;tt.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var xe=Z((v,te)=>{g();var nt=ve("tty"),ee=ve("util");v.init=ct;v.log=rt;v.formatArgs=st;v.save=at;v.load=lt;v.useColors=it;v.destroy=ee.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");v.colors=[6,2,3,4,5,1];try{let i=Ge();i&&(i.stderr||i).level>=2&&(v.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}v.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,r)=>r.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),i[t]=n,i},{});function it(){return"colors"in v.inspectOpts?!!v.inspectOpts.colors:nt.isatty(process.stderr.fd)}function st(i){let{namespace:e,useColors:t}=this;if(t){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),r=` ${s};1m${e} \x1B[0m`;i[0]=r+i[0].split(`
2
+ `).join(`
3
+ `+r),i.push(s+"m+"+te.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=ot()+e+" "+i[0]}function ot(){return v.inspectOpts.hideDate?"":new Date().toISOString()+" "}function rt(...i){return process.stderr.write(ee.formatWithOptions(v.inspectOpts,...i)+`
4
+ `)}function at(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function lt(){return process.env.DEBUG}function ct(i){i.inspectOpts={};let e=Object.keys(v.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=v.inspectOpts[e[t]]}te.exports=me()(v);var{formatters:ke}=te.exports;ke.o=function(i){return this.inspectOpts.colors=this.useColors,ee.inspect(i,this.inspectOpts).split(`
5
+ `).map(e=>e.trim()).join(" ")};ke.O=function(i){return this.inspectOpts.colors=this.useColors,ee.inspect(i,this.inspectOpts)}});var T=Z((Rn,he)=>{g();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?he.exports=Pe():he.exports=xe()});g();g();var ge=b(F(),1);g();var $e=b(ze(),1);var{Ansis:St,ansi256:Bt,fg:Jt,bgAnsi256:At,bg:Ut,rgb:Rt,bgRgb:Tt,hex:_t,bgHex:Wt,reset:qt,inverse:Vt,hidden:Gt,visible:zt,bold:E,dim:k,italic:Ht,underline:Mt,strikethrough:Yt,strike:Kt,black:Zt,red:Qt,green:Xt,yellow:en,blue:tn,magenta:nn,cyan:R,white:sn,grey:on,gray:rn,blackBright:an,redBright:ln,greenBright:cn,yellowBright:un,blueBright:gn,magentaBright:fn,cyanBright:pn,whiteBright:dn,bgBlack:mn,bgRed:hn,bgGreen:yn,bgYellow:wn,bgBlue:bn,bgMagenta:vn,bgCyan:Cn,bgWhite:$n,bgGrey:jn,bgGray:Pn,bgBlackBright:kn,bgRedBright:xn,bgGreenBright:Fn,bgYellowBright:Ln,bgBlueBright:Nn,bgMagentaBright:In,bgCyanBright:On,bgWhiteBright:En}=$e.default;g();var $=b(F(),1);var Be=b(T(),1),B=b(He(),1);import{spawn as wt}from"node:child_process";import{access as bt,mkdir as vt,readFile as Ct,rename as $t,rm as Oe,writeFile as jt}from"node:fs/promises";import{basename as Pt,dirname as Ee,join as j,parse as De,resolve as we}from"node:path";import{fileURLToPath as kt}from"node:url";g();var re=b(F(),1),Le=b(T(),1);import{readFile as gt}from"node:fs/promises";import{createRequire as ft}from"node:module";import{join as pt,sep as dt}from"node:path";g();var _=b(F(),1),Fe=b(T(),1);import{spawn as ut}from"node:child_process";var ne=(0,Fe.default)("@oclif/plugin-plugins:spawn");async function ie(i,e=[],{cwd:t,logLevel:n}){return new Promise((s,r)=>{process.platform==="win32"&&i.endsWith(".js")&&(e.unshift(`"${i}"`),i="node"),ne("modulePath",i),ne("args",e);let c=ut(i,e,{cwd:t,env:{...Ce(),HUSKY:"0"},stdio:"pipe",windowsVerbatimArguments:!0,...process.platform==="win32"&&i.toLowerCase().endsWith(".cmd")&&{shell:!0}}),o=["up to date","added"],l=[],f=[],a=[],u=[],d=p=>{let m=a.length===0&&u.length===0,w=o.some(C=>p.startsWith(C));return m&&w&&n==="notice"?!1:n!=="silent"};c.stderr?.setEncoding("utf8"),c.stderr?.on("data",p=>{let m=p.toString().trim();l.push(m),d(m)?(a.push(m),_.ux.stdout(m)):ne(m)}),c.stdout?.setEncoding("utf8"),c.stdout?.on("data",p=>{let m=p.toString().trim();f.push(m),d(m)?(u.push(m),_.ux.stdout(m)):ne(m)}),c.on("error",r),c.on("exit",p=>{p===0?s({stderr:l,stdout:f}):r(new _.Errors.CLIError(`${i} ${e.join(" ")} exited with code ${p}`,{suggestions:["Run with DEBUG=@oclif/plugin-plugins* to see debug output."]}))})})}var se=(0,Le.default)("@oclif/plugin-plugins:npm"),oe=class{bin;config;logLevel;constructor({config:e,logLevel:t}){this.config=e,this.logLevel=t}async exec(e=[],t){let n=await this.findNpm();se("npm binary path",n),e.push(`--loglevel=${this.logLevel}`,"--no-fund"),this.config.npmRegistry&&e.push(`--registry=${this.config.npmRegistry}`),t.logLevel!=="notice"&&t.logLevel!=="silent"&&re.ux.stderr(`${t.cwd}: ${n} ${e.join(" ")}`),se(`${t.cwd}: ${n} ${e.join(" ")}`);try{let s=await ie(n,e,t);return se("npm done"),s}catch(s){throw se("npm error",s),s}}async install(e,t){let n=t.prod?["--omit","dev"]:[];return this.exec(["install",...e,...n,"--no-audit"],t)}async uninstall(e,t){return this.exec(["uninstall",...e],t)}async update(e,t){return this.exec(["update",...e],t)}async view(e,t){return this.exec(["view",...e],{...t,logLevel:"silent"})}async findNpm(){if(this.bin)return this.bin;try{let e=ft(import.meta.url).resolve("npm/package.json"),t=JSON.parse(await gt(e,{encoding:"utf8"})),n=e.slice(0,Math.max(0,e.lastIndexOf(dt)));this.bin=pt(n,t.bin.npm)}catch{let{default:e}=await import("./lib-WU3FEA6I.js");this.bin=await e("npm")}if(!this.bin)throw new re.Errors.CLIError("npm not found");return this.bin}};g();function ye(i,e){let t=i===void 0?0:i,n=e===void 0?0:e;if(Array.isArray(t)&&Array.isArray(n)){if(t.length===0&&n.length===0)return 0;let s=ye(t[0],n[0]);return s!==0?s:ye(t.slice(1),n.slice(1))}return t<n?-1:t>n?1:0}function A(i,e){return i.sort((t,n)=>ye(e(t),e(n)))}function Ne(i,e){return i.filter((t,n)=>!i.some((s,r)=>r>n&&e(t,s)))}g();var ce=b(F(),1),Ie=b(T(),1);import{createRequire as mt}from"node:module";import{fileURLToPath as ht}from"node:url";var yt=mt(import.meta.url),ae=(0,Ie.default)("@oclif/plugin-plugins:yarn"),le=class{bin;config;logLevel;constructor({config:e,logLevel:t}){this.config=e,this.logLevel=t}async exec(e=[],t){let n=await this.findYarn();ae("yarn binary path",n),t.logLevel==="verbose"&&e.push("--verbose"),this.config.npmRegistry&&e.push(`--registry=${this.config.npmRegistry}`),t.logLevel!=="notice"&&t.logLevel!=="silent"&&ce.ux.stderr(`${t.cwd}: ${n} ${e.join(" ")}`),ae(`${t.cwd}: ${n} ${e.join(" ")}`);try{let s=await ie(n,e,t);return ae("yarn done"),s}catch(s){throw ae("yarn error",s),s}}async install(e,t){return this.exec(["install",...e],t)}async findYarn(){if(this.bin)return this.bin;try{this.bin=yt.resolve("yarn/bin/yarn.js",{paths:[this.config.root,ht(import.meta.url)]})}catch{let{default:e}=await import("./lib-WU3FEA6I.js");this.bin=await e("yarn")}if(!this.bin)throw new ce.Errors.CLIError("yarn not found");return this.bin}};var ue={dependencies:{},oclif:{plugins:[],schema:1},private:!0};async function U(i){try{return await bt(i),!0}catch{return!1}}function Je(i){return Ne(i,(e,t)=>e.name===t.name||e.type==="link"&&t.type==="link"&&e.root===t.root)}function xt(i,e){if(i)return typeof i=="string"?i:i.url;if(e)return typeof e=="string"?e:e.url.replace("git+","").replace(".git","")}function Se(i,e){[...e.stdout,...e.stderr].some(n=>n.includes("npm WARN"))&&($.ux.stderr(E.yellow(`
6
+ These warnings can only be addressed by the owner(s) of ${i.name}.`)),(i.pjson.bugs||i.pjson.repository)&&$.ux.stderr(`We suggest that you create an issue at ${xt(i.pjson.bugs,i.pjson.repository)} and ask the plugin owners to address them.
7
+ `))}var h=class{config;npm;debug;logLevel;constructor(e){this.config=e.config,this.debug=(0,Be.default)("@oclif/plugin-plugins"),this.logLevel=e.logLevel??"notice",this.npm=new oe({config:this.config,logLevel:this.logLevel})}get pjsonPath(){return j(this.config.dataDir,"package.json")}async add(...e){let t=await this.pjson(),n=[...t.oclif.plugins||[],...e];await this.savePJSON({...t,oclif:{...t.oclif,plugins:Je(n)}})}friendlyName(e){let{pluginPrefix:t,scope:n}=this.config.pjson.oclif;return n?e.match(`@${n}/${t??"plugin"}-(.+)`)?.[1]??e:e}async hasPlugin(e){let t=await this.list(),n=this.friendlyName(e),s=this.unfriendlyName(e)??e;return t.find(r=>this.friendlyName(r.name)===n)??t.find(r=>this.unfriendlyName(r.name)===s)??t.find(r=>r.type==="link"&&we(r.root)===we(e))??!1}async install(e,{force:t=!1,tag:n="latest"}={}){await this.maybeCleanUp();try{this.debug(`installing plugin ${e}`);let s={cwd:this.config.dataDir,logLevel:this.logLevel,prod:!0};await this.ensurePJSON();let r,c=t?["--force"]:[];if(e.includes(":")){let o=e,l=await this.npm.install([...c,o],s),{dependencies:f}=await this.pjson(),{default:a}=await import("./npa-ICFSA3NL.js"),u=a(o),p=Object.entries(f??{}).find(([,P])=>{let D=a(P);return D.type==="file"&&D.raw?De(o).base===De(D.raw).base:D.hosted?.type===u.hosted?.type&&D.hosted?.user===u.hosted?.user&&D.hosted?.project===u.hosted?.project})?.[0];if(!p)throw new $.Errors.CLIError(`Could not find plugin name for ${o}`);let m=j(this.config.dataDir,"node_modules",p);r=await $.Config.load({devPlugins:!1,name:p,root:m,userPlugins:!1}),Se(r,l),this.isValidPlugin(r),await this.add({name:p,type:"user",url:o});let w=new Set(["npm-shrinkwrap.json","oclif.lock","oclif.manifest.json"]),C=(r.pjson.files??[]).map(P=>j(m,P)).filter(P=>!w.has(Pt(P)));this.debug(`checking for existence of files: ${C.join(", ")}`);let I=Object.fromEntries(await Promise.all(C?.map(async P=>[P,await U(P)])??[]));this.debug(I),Object.values(I).every(Boolean)||$.ux.warn("This plugin may not work as expected because the prepare script did not produce all the expected files.")}else{let o=(0,B.validRange)(n),l=this.unfriendlyName(e);l&&await this.npmHasPackage(l)&&(e=l),await this.npmHasPackage(e,!0);let f=await this.npm.install([...c,`${e}@${n}`],s);this.debug(`loading plugin ${e}...`),r=await $.Config.load({devPlugins:!1,name:e,root:j(this.config.dataDir,"node_modules",e),userPlugins:!1}),this.debug(`finished loading plugin ${e} at root ${r.root}`),Se(r,f),this.isValidPlugin(r),await this.add({name:e,tag:o??n,type:"user"})}return await Oe(j(this.config.dataDir,"yarn.lock"),{force:!0}),r}catch(s){throw this.debug("error installing plugin:",s),await this.uninstall(e).catch(r=>this.debug(r)),String(s).includes("EACCES")?new $.Errors.CLIError(s,{suggestions:[`Plugin failed to install because of a permissions error.
8
+ Does your current user own the directory ${this.config.dataDir}?`]}):s}}async link(e,{install:t}){let n=await $.Config.load(we(e));return this.isValidPlugin(n),t&&(await U(j(n.root,"yarn.lock"))?(this.debug("installing dependencies with yarn"),await new le({config:this.config,logLevel:this.logLevel}).install([],{cwd:n.root,logLevel:this.logLevel})):await U(j(n.root,"package-lock.json"))?(this.debug("installing dependencies with npm"),await this.npm.install([],{cwd:n.root,logLevel:this.logLevel,prod:!1})):await U(j(n.root,"pnpm-lock.yaml"))?$.ux.warn(`pnpm is not supported for installing after a link. The link succeeded, but you may need to run 'pnpm install' in ${n.root}.`):$.ux.warn(`No lockfile found in ${n.root}. The link succeeded, but you may need to install the dependencies in your project.`)),await this.add({name:n.name,root:n.root,type:"link"}),n}async list(){return(await this.pjson()).oclif.plugins}async maybeUnfriendlyName(e){await this.ensurePJSON();let t=this.unfriendlyName(e);return this.debug(`checking registry for expanded package name ${t}`),t&&await this.npmHasPackage(t)?t:(this.debug(`expanded package name ${t} not found, using given package name ${e}`),e)}async pjson(){let e=await this.readPJSON(),t=e?Ft(e.oclif.plugins):[];return{...ue,...e,oclif:{...ue.oclif,...e?.oclif,plugins:t}}}async remove(e){let t=await this.pjson();t.dependencies&&delete t.dependencies[e],await this.savePJSON({...t,oclif:{...t.oclif,plugins:t.oclif.plugins.filter(n=>n.name!==e)}})}unfriendlyName(e){if(e.includes("@"))return;let{pluginPrefix:t,scope:n}=this.config.pjson.oclif;if(n)return`@${n}/${t??"plugin"}-${e}`}async uninstall(e){try{((await this.pjson()).oclif.plugins??[]).some(n=>typeof n=="object"&&n.type==="user"&&n.name===e)&&await this.npm.uninstall([e],{cwd:this.config.dataDir,logLevel:this.logLevel})}catch(t){$.ux.warn(t)}finally{await this.remove(e)}}async update(){let e=(await this.list()).filter(o=>o.type==="user");if(e.length===0)return;await this.maybeCleanUp();let t=this.config.pjson.oclif.aliases||{};for(let[o,l]of Object.entries(t))e.find(a=>a.name===o)&&(l&&await this.install(l),await this.uninstall(o),e=e.filter(a=>a.name!==o));let n=e.filter(o=>!!o.url);n.length>0&&await this.npm.update(n.map(o=>o.name),{cwd:this.config.dataDir,logLevel:this.logLevel});let s=e.filter(o=>!o.url),r=this.config.pjson.oclif.jitPlugins??{},c=[];s.length>0&&await this.npm.install(s.map(o=>{if(!(0,B.valid)(o.tag))return`${o.name}@${o.tag}`;if(o.tag&&(0,B.valid)(o.tag)&&r[o.name]&&(0,B.gt)(o.tag,r[o.name]))return`${o.name}@${o.tag}`;let l=r[o.name]??o.tag;return c.push({...o,tag:l}),`${o.name}@${l}`}),{cwd:this.config.dataDir,logLevel:this.logLevel,prod:!0}),await this.add(...c)}async ensurePJSON(){await U(this.pjsonPath)||(this.debug(`creating ${this.pjsonPath} with pjson: ${JSON.stringify(ue,null,2)}`),await this.savePJSON(ue))}isValidPlugin(e){if(e.valid||this.config.plugins.get("@oclif/plugin-legacy")||e._base.includes("@oclif/plugin-legacy"))return!0;throw new $.Errors.CLIError("plugin is invalid",{suggestions:[`Plugin failed to install because it does not appear to be a valid CLI plugin.
9
+ If you are sure it is, contact the CLI developer noting this error.`]})}async maybeCleanUp(){if(await U(j(this.config.dataDir,"yarn.lock")))try{this.debug("Found yarn.lock! Removing yarn.lock and node_modules..."),await Promise.all([$t(j(this.config.dataDir,"node_modules"),j(this.config.dataDir,"node_modules.old")),Oe(j(this.config.dataDir,"yarn.lock"),{force:!0})]);let e=j(Ee(kt(import.meta.url)),"rm.js");this.debug(`spawning ${e} to remove node_modules.old`),wt(process.argv[0],[e,j(this.config.dataDir,"node_modules.old")],{detached:!0,stdio:"ignore",...this.config.windows?{shell:!0}:{}}).unref()}catch(e){this.debug("Error cleaning up yarn.lock and node_modules:",e)}}async npmHasPackage(e,t=!1){try{return await this.npm.view([e],{cwd:this.config.dataDir,logLevel:this.logLevel}),this.debug(`Found ${e} in the registry.`),!0}catch(n){if(this.debug(n),t)throw new $.Errors.CLIError(`${e} does not exist in the registry.`);return!1}}async readPJSON(){try{return JSON.parse(await Ct(this.pjsonPath,"utf8"))}catch(e){this.debug(e);let t=e;t.code!=="ENOENT"&&process.emitWarning(t)}}async savePJSON(e){await vt(Ee(this.pjsonPath),{recursive:!0}),await jt(this.pjsonPath,JSON.stringify({name:this.config.name,...e},null,2))}},Ft=i=>{let e=(i??[]).map(t=>typeof t=="string"?{name:t,tag:"latest",type:"user"}:t);return Je(e)};var W=class i extends ge.Command{static description="List installed plugins.";static enableJsonFlag=!0;static examples=["<%= config.bin %> <%= command.id %>"];static flags={core:ge.Flags.boolean({description:"Show core plugins."})};plugins;async run(){let{flags:e}=await this.parse(i);this.plugins=new h({config:this.config});let t=this.config.getPluginsList();A(t,o=>this.plugins.friendlyName(o.name)),e.core||(t=t.filter(o=>o.type!=="core"&&o.type!=="dev")),t.length===0&&this.log("No plugins installed.");let n=this.config.getPluginsList(),s=new Set(n.filter(o=>o.type==="user"||o.type==="link").map(o=>o.name)),r=this.config.pjson.oclif.jitPlugins??{},c=Object.entries(r).map(([o,l])=>({name:o,type:"jit",version:l})).filter(o=>!s.has(o.name));return A(c,o=>o.name),this.jsonEnabled()||(this.display(t),this.displayJitPlugins(c)),[...n.filter(o=>!o.parent).map(o=>{let{config:l,...f}=o;return f}),...c]}createTree(e){let t={};for(let n of e.children??[])t[this.formatPlugin(n)]=this.createTree(n);return t}display(e){let t=e.find(n=>n.root===this.config.root);for(let n of e.filter(s=>!s.parent))if(n.name!==t?.name&&(this.log(this.formatPlugin(n)),n.children&&n.children.length>0)){let s=this.createTree(n);this.log(Q(s))}}displayJitPlugins(e){if(e.length!==0){this.log(k(`
10
+ Uninstalled JIT Plugins:`));for(let{name:t,version:n}of e)this.log(`${this.plugins.friendlyName(t)} ${k(n)}`)}}formatPlugin(e){let t=`${this.plugins.friendlyName(e.name)} ${k(e.version)}`;return e.type!=="user"&&(t+=k(` (${e.type})`)),e.type==="link"?t+=` ${e.root}`:e.tag&&e.tag!=="latest"&&(t+=k(` (${String(e.tag)})`)),t}};g();var J=b(F(),1);import{readFile as Ae}from"node:fs/promises";import{dirname as Nt,join as fe,sep as Ue}from"node:path";g();var Lt=["silent","error","warn","notice","http","info","verbose","silly"];function O(i,e,t){if(e.verbose)return"verbose";if(e.silent)return"silent";let n=i.scopedEnvVar("NPM_LOG_LEVEL");return Lt.includes(n)?n:t}function It(i,e){let t=i.split(Ue),n=t.reduce((r,c,o)=>c===e?[...r,o]:r,[]),s=Math.max(...n);return s===-1?i:t.slice(0,s+1).join(Ue)}var q=class i extends J.Command{static args={plugin:J.Args.string({default:".",description:"Plugin to inspect.",required:!0})};static description="Displays installation properties of a plugin.";static enableJsonFlag=!0;static examples=['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> '];static flags={help:J.Flags.help({char:"h"}),verbose:J.Flags.boolean({char:"v"})};static strict=!1;static usage="plugins:inspect PLUGIN...";plugins;async findDep(e,t){let n=fe(...t.split("/")),s=fe(e.root,"node_modules"),r=[s];for(;(s.match(/node_modules/g)??[]).length>1;)s=It(Nt(s),"node_modules"),r.push(s);for(let c of r)try{let o=fe(c,n),l=fe(o,"package.json"),f=JSON.parse(await Ae(l,"utf8"));return{pkgPath:o,version:f.version}}catch{}return{pkgPath:null,version:null}}findPlugin(e){let t=this.config.getPluginsList().find(n=>n.name===e);if(t)return t;throw this.config.pjson.oclif.jitPlugins?.[e]&&this.warn(`Plugin ${e} is a JIT plugin. It will be installed the first time you run one of it's commands.`),new Error(`${e} not installed`)}async inspect(e,t=!1){let n=this.findPlugin(e),s={},r={};for(let o of A(Object.keys({...n.pjson.dependencies}),l=>l)){let{pkgPath:l,version:f}=await this.findDep(n,o);if(!f)continue;let a=n.pjson.dependencies?.[o],u=k(a?`${a} => ${f}`:f),d=t?`${o} ${u} ${l}`:`${o} ${u}`;s[d]=null,r[o]={from:a,version:f}}let c={[E.cyan(n.name)]:{[`version ${n.version}`]:null,...n.tag?{[`tag ${n.tag}`]:null}:{},...n.pjson.homepage?{[`homepage ${n.pjson.homepage}`]:null}:{},[`location ${n.root}`]:null,commands:Object.fromEntries(A(n.commandIDs,o=>o).map(o=>[o,null])),dependencies:s}};return this.log(Q(c)),{...n,deps:r}}async run(){let{argv:e,flags:t}=await this.parse(i);this.plugins=new h({config:this.config,logLevel:O(this.config,t,"silent")});let n=this.config.pjson.oclif.aliases??{},s=[];for(let r of e){r==="."&&(r=JSON.parse(await Ae("package.json","utf8")).name),n[r]===null&&this.error(`${r} is blocked`),r=n[r]??r;let c=await this.plugins.maybeUnfriendlyName(r)??r;try{s.push(await this.inspect(c,t.verbose))}catch(o){throw this.log(E.red("failed")),o}}return s}};g();var y=b(F(),1);var Re=b(Me(),1);var V=class i extends y.Command{static aliases=["plugins:add"];static args={plugin:y.Args.string({description:"Plugin to install.",required:!0})};static description=`Uses npm to install plugins.
11
+
12
+ Installation of a user-installed plugin will override a core plugin.
13
+
14
+ Use the <%= config.scopedEnvVarKey('NPM_LOG_LEVEL') %> environment variable to set the npm loglevel.
15
+ Use the <%= config.scopedEnvVarKey('NPM_REGISTRY') %> environment variable to set the npm registry.`;static enableJsonFlag=!0;static examples=[{command:'<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> ',description:"Install a plugin from npm registry."},{command:"<%= config.bin %> <%= command.id %> https://github.com/someuser/someplugin",description:"Install a plugin from a github url."},{command:"<%= config.bin %> <%= command.id %> someuser/someplugin",description:"Install a plugin from a github slug."}];static flags={force:y.Flags.boolean({char:"f",description:"Force npm to fetch remote resources even if a local copy exists on disk."}),help:y.Flags.help({char:"h"}),jit:y.Flags.boolean({hidden:!0,async parse(e,t){if(e===!1||e===void 0)return e;let n=t.argv.filter(l=>!l.startsWith("-"));if(n.length===0)return e;let s=t.config.pjson.oclif.jitPlugins??{};if(Object.keys(s).length===0)return e;let r=new h({config:t.config}),o=(await Promise.all(n.map(async l=>{let f=await r.maybeUnfriendlyName(l);return{jit:!!s[f],name:f}}))).filter(l=>!l.jit).map(l=>l.name);if(o.length>0)throw new y.Errors.CLIError(`The following plugins are not JIT plugins: ${o.join(", ")}`);return e}}),silent:y.Flags.boolean({char:"s",description:"Silences npm output.",exclusive:["verbose"]}),verbose:y.Flags.boolean({char:"v",description:"Show verbose npm output.",exclusive:["silent"]})};static strict=!1;static summary="Installs a plugin into <%= config.bin %>.";flags;async parsePlugin(e,t){if(t.startsWith("git+ssh://")||t.endsWith(".git"))return{type:"repo",url:t};let n=async c=>{let o=/(?<!^)@/,[l,f="latest"]=c.split(o),a=l.startsWith("@")?l:await e.maybeUnfriendlyName(l);if(Ot(a),this.flags.jit){let u=this.config.pjson.oclif?.jitPlugins?.[a];return u?(o.test(c)&&this.warn(`--jit flag is present along side a tag. Ignoring tag ${f} and using the version specified in package.json (${u}).`),{name:a,tag:u}):(this.warn(`--jit flag is present but ${a} is not a JIT plugin. Installing ${f} instead.`),{name:a,tag:f})}return{name:a,tag:f}};if(t.startsWith("@")&&t.includes("/")){let{name:c,tag:o}=await n(t);return{name:c,tag:o,type:"npm"}}if(t.includes("/"))return t.includes(":")?{type:"repo",url:t}:{type:"repo",url:`https://github.com/${t}`};let{name:s,tag:r}=await n(t);return{name:s,tag:r,type:"npm"}}async run(){let{argv:e,flags:t}=await this.parse(i);this.flags=t;let n=new h({config:this.config,logLevel:O(this.config,this.flags,"notice")}),s=this.config.pjson.oclif.aliases||{},r=e.length;for(let c of e){if(s[c]===null&&this.error(`${c} is blocked`),c=s[c]||c,c===this.config.name){let a=this.config.binPath&&this.config.plugins.get("@oclif/plugin-update")?` Use "${this.config.bin} update" to update ${this.config.name}.`:"",u=`Ignoring top-level CLI plugin ${this.config.name}.${a}`;r===1?this.error(u):this.warn(u);continue}let o=await this.parsePlugin(n,c),l;await this.config.runHook("plugins:preinstall",{plugin:o});try{o.type==="npm"?(y.ux.action.start(`${this.config.name}: Installing plugin ${R(n.friendlyName(o.name)+"@"+o.tag)}`),l=await n.install(o.name,{force:t.force,tag:o.tag})):(y.ux.action.start(`${this.config.name}: Installing plugin ${R(o.url)}`),l=await n.install(o.url,{force:t.force}))}catch(a){throw y.ux.action.stop(E.red("failed")),a}let f=new y.Plugin(l);await f.load(),this.config.plugins.set(f.name,f),await this.config.runHook("plugins:postinstall",{}),y.ux.action.stop(`installed v${l.version}`)}}};function Ot(i){if(!(0,Re.default)(i).validForNewPackages)throw new y.Errors.CLIError("Invalid npm package name.")}g();var L=b(F(),1);var G=class i extends L.Command{static args={path:L.Args.string({default:".",description:"path to plugin",name:"path",required:!0})};static description=`Installation of a linked plugin will override a user-installed or core plugin.
16
+
17
+ e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work.
18
+ `;static examples=['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> '];static flags={help:L.Flags.help({char:"h"}),install:L.Flags.boolean({allowNo:!0,default:!0,description:"Install dependencies after linking the plugin."}),verbose:L.Flags.boolean({char:"v"})};static summary="Links a plugin into the CLI for development.";async run(){let{args:e,flags:t}=await this.parse(i),n=new h({config:this.config,logLevel:O(this.config,t,"silent")});L.ux.action.start(`${this.config.name}: Linking plugin ${R(e.path)}`),await n.link(e.path,{install:t.install}),L.ux.action.stop()}};g();var z=b(F(),1);import{rm as Et}from"node:fs/promises";import{join as pe}from"node:path";var H=class i extends z.Command{static flags={hard:z.Flags.boolean({summary:"Delete node_modules and package manager related files in addition to uninstalling plugins."}),reinstall:z.Flags.boolean({summary:"Reinstall all plugins after uninstalling."})};static summary="Remove all user-installed and linked plugins.";async run(){let{flags:e}=await this.parse(i),t=new h({config:this.config}),n=await t.list();this.log(`Found ${n.length} plugin${n.length===0?"":"s"}:`);for(let s of n)this.log(`- ${s.name} ${k(this.config.plugins.get(s.name)?.version??"")} ${k(`(${s.type})`)}`);if(e.hard){let s=[pe(this.config.dataDir,"node_modules"),pe(this.config.dataDir,"package.json"),pe(this.config.dataDir,"yarn.lock"),pe(this.config.dataDir,"package-lock.json")];this.log("\u2705 Removed the following files:");for(let r of s)this.log(`- ${r}`);await Promise.all(s.map(r=>Et(r,{force:!0,recursive:!0})));for(let r of n)this.log(`\u2705 ${r.type==="link"?"Unlinked":"Uninstalled"} ${r.name}`)}else for(let s of n)try{await t.uninstall(s.name),this.log(`\u2705 ${s.type==="link"?"Unlinked":"Uninstalled"} ${s.name}`)}catch{this.warn(`Failed to uninstall ${s.name}`)}if(e.reinstall){this.log("Reinstall flag passed:");for(let s of n){if(s.type==="link")try{let r=await t.link(s.root,{install:!1}),c=k(`-> ${r.version}`);this.log(`\u2705 Relinked ${s.name} ${c}`)}catch{this.warn(`Failed to relink ${s.name}`)}if(s.type==="user")try{let r=s.url?await t.install(s.url):await t.install(s.name,{tag:s.tag}),c=k(`-> ${r.version}`),o=s.tag?`@${s.tag}`:s.url?` (${s.url})`:"";this.log(`\u2705 Reinstalled ${s.name}${o} ${c}`)}catch{this.warn(`Failed to reinstall ${s.name}`)}}}}};g();var N=b(F(),1);function Te(i){if(i.includes("@")){let e=i.split("@");return!e.at(-1)?.includes("/")&&e.length>1&&e.pop(),e.join("@")}return i}var M=class i extends N.Command{static aliases=["plugins:unlink","plugins:remove"];static args={plugin:N.Args.string({description:"plugin to uninstall"})};static description="Removes a plugin from the CLI.";static examples=['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %>'];static flags={help:N.Flags.help({char:"h"}),verbose:N.Flags.boolean({char:"v"})};static strict=!1;async run(){let{argv:e,flags:t}=await this.parse(i),n=new h({config:this.config,logLevel:O(this.config,t,"silent")}),s=[];e.length===0&&e.push(".");for(let r of e){let c=Te(n.friendlyName(r)),o=await n.hasPlugin(Te(r));if(!o){let l=this.config.getPluginsList().find(f=>f.name===r);return l?.parent?this.error(`${c} is installed via plugin ${l.parent.name}, uninstall ${l.parent.name} instead`):this.error(`${c} is not installed`)}try{let{name:l}=o,f=c==="."?l:c??l;N.ux.action.start(`${this.config.name}: Uninstalling ${f}`),await n.uninstall(l),s.push(l)}catch(l){throw N.ux.action.stop(E.red("failed")),l}N.ux.action.stop()}for(let r of s)this.config.plugins.delete(r);await this.config.runHook("plugins:postuninstall",{})}};g();var S=b(F(),1);var Y=class i extends S.Command{static description="Update installed plugins.";static flags={help:S.Flags.help({char:"h"}),verbose:S.Flags.boolean({char:"v"})};async run(){let{flags:e}=await this.parse(i),t=new h({config:this.config,logLevel:O(this.config,e,"silent")});S.ux.action.start(`${this.config.name}: Updating plugins`),await t.update(),S.ux.action.stop()}};g();var _e=async function(){let i=new h({config:this.config});try{await i.update()}catch(e){e instanceof Error&&this.error(e.message)}};var ps={plugins:W,"plugins:inspect":q,"plugins:install":V,"plugins:link":G,"plugins:reset":H,"plugins:uninstall":M,"plugins:update":Y},ds={update:_e};export{ps as a,ds as b};
@@ -0,0 +1 @@
1
+ import{A as e,B as r,F as o,G as s,k as n,z as h}from"./chunk-BDVAE5MS.js";import{g as i}from"./chunk-VPRTJUIN.js";i();async function y(){await h({message:"Associate your project with the org Castile Ventures?",choices:[{label:"first",value:"first",disabled:!0},{label:"second",value:"second"},{label:"third (limit reached)",value:"third",disabled:!0},{label:"fourth (limit reached)",value:"fourth",disabled:!0},{label:"fifth",value:"fifth",group:"Automations",disabled:!0},{label:"sixth",value:"sixth",group:"Automations"},{label:"seventh",value:"seventh"},{label:"eighth (limit reached)",value:"eighth",group:"Merchant Admin",disabled:!0},{label:"ninth",value:"ninth",group:"Merchant Admin"},{label:"tenth",value:"tenth"}],infoTable:[{header:"add",items:["new-ext"],bullet:"+"},{header:"remove",items:["integrated-demand-ext","order-discount"],bullet:"-"}]}),await o({message:"App project name (can be changed later)",defaultValue:"expansive commerce app",validate:t=>{if(t.includes("shopify"))return`Can't include "shopify" in the name`}});let l=[{label:"first",value:"first"},{label:"second",value:"second"},{label:"third",value:"third"},{label:"fourth",value:"fourth"},{label:"fifth",value:"fifth"},{label:"sixth",value:"sixth"},{label:"seventh",value:"seventh"},{label:"eighth",value:"eighth"},{label:"ninth",value:"ninth"},{label:"tenth",value:"tenth"},{label:"eleventh",value:"eleventh"},{label:"twelfth",value:"twelfth"},{label:"thirteenth",value:"thirteenth"},{label:"fourteenth",value:"fourteenth"},{label:"fifteenth",value:"fifteenth"},{label:"sixteenth",value:"sixteenth"},{label:"seventeenth",value:"seventeenth"},{label:"eighteenth",value:"eighteenth"},{label:"nineteenth",value:"nineteenth"},{label:"twentieth",value:"twentieth"},{label:"twenty-first",value:"twenty-first"},{label:"twenty-second",value:"twenty-second"},{label:"twenty-third",value:"twenty-third"},{label:"twenty-fourth",value:"twenty-fourth"},{label:"twenty-fifth",value:"twenty-fifth"},{label:"twenty-sixth",value:"twenty-sixth"},{label:"twenty-seventh",value:"twenty-seventh"},{label:"twenty-eighth",value:"twenty-eighth"},{label:"twenty-ninth",value:"twenty-ninth"},{label:"thirtieth",value:"thirtieth"},{label:"thirty-first",value:"thirty-first"},{label:"thirty-second",value:"thirty-second"},{label:"thirty-third",value:"thirty-third"},{label:"thirty-fourth",value:"thirty-fourth"},{label:"thirty-fifth",value:"thirty-fifth"},{label:"thirty-sixth",value:"thirty-sixth"},{label:"thirty-seventh",value:"thirty-seventh"},{label:"thirty-eighth",value:"thirty-eighth"},{label:"thirty-ninth",value:"thirty-ninth"},{label:"fortieth",value:"fortieth"},{label:"forty-first",value:"forty-first"},{label:"forty-second",value:"forty-second"},{label:"forty-third",value:"forty-third"},{label:"forty-fourth",value:"forty-fourth"},{label:"forty-fifth",value:"forty-fifth"},{label:"forty-sixth",value:"forty-sixth"},{label:"forty-seventh",value:"forty-seventh"},{label:"forty-eighth",value:"forty-eighth"},{label:"forty-ninth",value:"forty-ninth"},{label:"fiftieth",value:"fiftieth"}];await r({message:"Template",choices:l,search(t){return Promise.resolve({data:l.filter(f=>f.label.includes(t))})}});let a=[["first theme",{subdued:"(#1)"}],["second theme",{subdued:"(#2)"}]];await e({message:"Add the following themes to the store?",infoTable:{"":a},confirmationMessage:"Yes, add them",cancellationMessage:"Cancel"});let u={title:{color:"red",text:`${n.warning} This can't be undone.`},body:"The action you are executing should be confirmed to proceed."};await e({message:"Delete the following themes from the store?",infoTable:{"":a},infoMessage:u,confirmationMessage:"Yes, delete them",cancellationMessage:"Cancel",defaultValue:!1}),await e({message:["Make the following changes to your",{filePath:".env"},"file?"],defaultValue:!0,confirmationMessage:"Yes, confirm changes",cancellationMessage:"No, make changes later"}),await s({message:"Release this version of Mega App?",infoTable:[{header:"Includes",items:["My subscription extension","Order discount function","Subscription cancelled trigger","Add subscription action"],bullet:"+"},{header:"Removes",items:["product-discount-function","product-subscription-extension"],bullet:"-"}],confirmation:"Mega App"})}export{y as a};
@@ -0,0 +1 @@
1
+ import{n as a}from"./chunk-B2EHO7ZC.js";import{d as i}from"./chunk-JPGO36XP.js";import{g as s}from"./chunk-VPRTJUIN.js";s();var e={LOCALHOST:"localhost",HTTP:"http",PUBSUB:"google-pub-sub",EVENTBRIDGE:"event-bridge"},g={LOCALHOST:new RegExp("^http:","i"),HTTP:new RegExp("^https:","i"),PUBSUB:new RegExp("^pubsub:"),EVENTBRIDGE:new RegExp("^arn:aws:events:")};function p(t,n){let r=T(t);return r===e.LOCALHOST&&n===e.HTTP?!0:r===n}function f(t){return g.LOCALHOST.test(t)?new URL(t.toLowerCase()).hostname==="localhost":!1}function w(t,n){if(!p(t,n))throw new i(`Can't deliver your webhook payload to this address using '${n}'`,"Use a valid URL for address",l(n));let r=n;return f(t)&&(r=e.LOCALHOST),[t.trim(),r]}function l(t){return t===e.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:t===e.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:t===e.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function d(t,n){if(n.includes(t))return t;throw new i(`Api Version '${t}' does not exist`,`Allowed values: ${n.join(", ")}`,["Try again with a valid api-version value"])}function E(t,n,r){if(r.length===0)throw new i(`No topics found for '${n}'`);let o=c(t.trim(),r);if(o===void 0)throw new i(`Topic '${t}' does not exist for ApiVersion '${n}'`,`Allowed values: ${r.join(", ")}`,["Try again with a valid api-version - topic pair"]);return o}function c(t,n){return n.includes(t)?t:n.find(r=>r.toUpperCase().replace("/","_")===t)}function T(t){if(t){if(t.startsWith("pubsub:"))return e.PUBSUB;if(t.startsWith("arn:aws:events:"))return e.EVENTBRIDGE;if(f(t))return e.LOCALHOST;if(g.HTTP.test(t))return e.HTTP}}s();async function H(t,n,r){let o={method:"POST",body:n,headers:{"Content-Type":"application/json",...JSON.parse(r)}},u=await a(t,o);return u.status>=200&&u.status<300}export{H as a,e as b,p as c,w as d,d as e,E as f,T as g};
@@ -0,0 +1,5 @@
1
+ import{l as R}from"./chunk-BDVAE5MS.js";import{d}from"./chunk-JPGO36XP.js";import{Qb as u,Rb as b,Z as h,da as y}from"./chunk-GFEAKSGV.js";import{g as c}from"./chunk-VPRTJUIN.js";c();c();var l=class{constructor({export:e,input:r,inputBytes:n,output:o,outputBytes:s,logs:i,functionId:g,fuelConsumed:p,target:x,errorMessage:N,errorType:T,inputQueryVariablesMetafieldValue:O,inputQueryVariablesMetafieldNamespace:L,inputQueryVariablesMetafieldKey:k}){this.export=e,this.input=r,this.inputBytes=n,this.output=o,this.outputBytes=s,this.logs=i,this.functionId=g,this.fuelConsumed=p,this.target=x,this.errorMessage=N,this.errorType=T,this.inputQueryVariablesMetafieldValue=O,this.inputQueryVariablesMetafieldNamespace=L,this.inputQueryVariablesMetafieldKey=k}},f=class{constructor({cacheEntryEpochMs:e,cacheTtlMs:r,httpRequest:n,httpResponse:o}){this.cacheEntryEpochMs=e,this.cacheTtlMs=r,this.httpRequest=n,this.httpResponse=o}};var _=class{constructor({reason:e,httpRequest:r}){this.reason=e,this.httpRequest=r}},m=class{constructor({attempt:e,connectTimeMs:r,writeReadTimeMs:n,httpRequest:o,httpResponse:s,error:i}){this.attempt=e,this.connectTimeMs=r,this.writeReadTimeMs=n,this.httpRequest=o,this.httpResponse=s,this.error=i}};c();function E(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype}function M(t,e){return e?.deep&&E(t)||e?.deep&&Array.isArray(t)?a(t,e):t}function a(t,e){if(Array.isArray(t))return t.map(r=>e?.deep?a(r,e):r);if(E(t)){let r={};for(let[n,o]of Object.entries(t))r[h(n)]=M(o,e);return r}return t}var S=450,I=5*1e3,w=60*1e3,z=5,Z=1e6,P="function_run",ee="function_network_access",C="function_network_access.response_from_cache",V="function_network_access.request_execution_in_background",q="function_network_access.request_execution",te="no_cached_response",re="cached_response_about_to_expire";function se(t){let e=JSON.parse(t),r=e.input_query_variables_metafield_value&&A(e.input_query_variables_metafield_value);return new l({export:e.export,input:e.input,inputBytes:e.input_bytes,output:e.output,outputBytes:e.output_bytes,logs:e.logs,functionId:e.function_id,fuelConsumed:e.fuel_consumed,target:e.target,errorMessage:e.error_message,errorType:e.error_type,inputQueryVariablesMetafieldValue:r,inputQueryVariablesMetafieldNamespace:e.input_query_variables_metafield_namespace,inputQueryVariablesMetafieldKey:e.input_query_variables_metafield_key})}function ne(t){let e=JSON.parse(t);return new f({cacheEntryEpochMs:e.cache_entry_epoch_ms,cacheTtlMs:e.cache_ttl_ms,httpRequest:e.http_request,httpResponse:e.http_response})}var U={no_cached_response:0,cached_response_about_to_expire:1};function oe(t){let e=JSON.parse(t);return new _({reason:U[e.reason]??2,httpRequest:e.http_request})}function ie(t){let e=JSON.parse(t);return new m({attempt:e.attempt,connectTimeMs:e.connect_time_ms??null,writeReadTimeMs:e.write_read_time_ms??null,httpRequest:e.http_request,httpResponse:e.http_response??null,error:e.error??null})}var ue=async t=>{let{errors:e}=t.response,r=S,n=null,o="not_attempted";if(e.length>0)if(u(`Errors: ${e.map(s=>s.message).join(", ")}`),e.some(s=>s.status===401))try{n=await t.onResubscribe(),o="succeeded"}catch(s){u(`Failed to resubscribe to app logs: ${s}`),r=w,o="failed",t.onThrottle(r)}else e.some(s=>s.status===429)?(r=w,t.onThrottle(r)):(r=I,t.onUnknownError(r));return{retryIntervalMs:r,nextJwtToken:n,resubscribeResult:o}};function ae(t){return t.allExtensions.flatMap(e=>e.isFunctionExtension?[`extensions.${e.configuration.handle}`]:[])}var pe=({appLog:t,appLogPayload:e,storeName:r,prettyPrint:n=!0})=>{let{cursor:o,...s}=t,i=a({...s,payload:e,localTime:y(t.log_timestamp),storeName:r});return e instanceof l&&(i.payload.logs=e.logs.split(`
2
+ `).filter(Boolean),i.payload.inputQueryVariablesMetafieldValue&&(i.payload.inputQueryVariablesMetafieldValue=A(i.payload.inputQueryVariablesMetafieldValue))),n?JSON.stringify(i,null,2):JSON.stringify(i)},ce=(t,e)=>{let r=a(JSON.parse(t));return e===P?new l(r):e===C?new f(r):e===V?new _(r):e===q?new m(r):r},le=async(t,e,r,n)=>{let o=await t.subscribeToAppLogs(e,r);if(!o.appLogsSubscribe)throw new d("Failed to subscribe to app logs: No response received");let{jwtToken:s,success:i,errors:g}=o.appLogsSubscribe;if(u(`Token: ${s}
3
+ `),u(`API Key: ${e.apiKey}
4
+ `),g&&g.length>0){let p=g.join(", ");throw await R({stripAnsi:!1},()=>{b(`Errors subscribing to app logs: ${p}`,n),b("App log streaming is not available in this session.",n)}),new d(p)}else{if(!s)throw new d("Failed to subscribe to app logs: No response received");let p=Array.isArray(e.shopIds)?e.shopIds:[e.shopIds];u(`Subscribed to App Events for shop ID(s) ${p.join(", ")}`),i!==void 0&&u(`Success: ${i}
5
+ `)}return s};function ge(t){try{if(typeof t=="string"){let e=JSON.parse(t);return JSON.stringify(e,null,2)}else return typeof t=="object"&&t!==null?JSON.stringify(t,null,2):void 0}catch(e){throw new Error(`Error parsing JSON: ${e}`)}}var A=t=>{try{return JSON.parse(t)}catch{return t}};export{l as a,f as b,_ as c,m as d,a as e,S as f,I as g,z as h,Z as i,P as j,ee as k,C as l,V as m,q as n,te as o,re as p,se as q,ne as r,oe as s,ie as t,ue as u,ae as v,pe as w,ce as x,le as y,ge as z};