shopify 5.0.2 → 5.2.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 (529) hide show
  1. package/dist/analytics-23GM6KJU.js +1 -0
  2. package/dist/analytics-743FYOAE.js +1 -0
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-RPCIFYCY.js → chunk-2EQRXSF6.js} +2 -2
  5. package/dist/{chunk-NXAEBGMO.js → chunk-2IXP3IPE.js} +1 -1
  6. package/dist/{chunk-T4XJKM6B.js → chunk-2KACAQJS.js} +1 -1
  7. package/dist/chunk-2KFYIYLI.js +1 -0
  8. package/dist/chunk-2OCSYLKZ.js +1 -0
  9. package/dist/{chunk-AQKWPRZE.js → chunk-2PILNMHJ.js} +2 -2
  10. package/dist/chunk-36S6MFJQ.js +47 -0
  11. package/dist/{chunk-TFPW2VGN.js → chunk-3DB4EC62.js} +1 -1
  12. package/dist/chunk-3GL3IT4K.js +16 -0
  13. package/dist/{chunk-C3RFAKWR.js → chunk-3JRB7Q3T.js} +1 -1
  14. package/dist/chunk-3KGN6N7E.js +1 -0
  15. package/dist/chunk-3OYMK5X6.js +11 -0
  16. package/dist/chunk-3PYDIBTX.js +1 -0
  17. package/dist/chunk-422BGHXN.js +1 -0
  18. package/dist/chunk-43C32FUQ.js +1 -0
  19. package/dist/chunk-4AN7ECPE.js +9 -0
  20. package/dist/chunk-4AWVU2OV.js +1 -0
  21. package/dist/chunk-4IP37MBX.js +1 -0
  22. package/dist/chunk-4KBOLN7Q.js +8 -0
  23. package/dist/chunk-4LJERO23.js +89 -0
  24. package/dist/chunk-4M5WHOZW.js +1 -0
  25. package/dist/chunk-4RO35FFQ.js +1 -0
  26. package/dist/chunk-4ZS5354G.js +3 -0
  27. package/dist/chunk-55AWBPKU.js +7 -0
  28. package/dist/chunk-5BUYR23E.js +1 -0
  29. package/dist/chunk-5EDA7PVE.js +11 -0
  30. package/dist/{chunk-UKWIWCOH.js → chunk-5P6OELKZ.js} +1 -1
  31. package/dist/chunk-5PVXLQNX.js +1 -0
  32. package/dist/{chunk-J5ERDFIC.js → chunk-5S2P4MHJ.js} +1 -1
  33. package/dist/{chunk-26PWHH3B.js → chunk-5TJJVSCI.js} +1 -1
  34. package/dist/chunk-5TOK5OJS.js +1 -0
  35. package/dist/chunk-5ZG2SWU2.js +1 -0
  36. package/dist/{chunk-SLY27GDC.js → chunk-62F4ZMSC.js} +2 -2
  37. package/dist/chunk-652NT7OW.js +1 -0
  38. package/dist/chunk-6B5KM3A4.js +97 -0
  39. package/dist/chunk-6LCESSY3.js +1 -0
  40. package/dist/chunk-6QHDMCAA.js +1 -0
  41. package/dist/{chunk-D2KIGKBI.js → chunk-7A4ZE5IS.js} +60 -60
  42. package/dist/{chunk-CGVROSPS.js → chunk-7AQZKPJU.js} +1 -1
  43. package/dist/chunk-7FBOMPO5.js +203 -0
  44. package/dist/chunk-7HECBXSP.js +1 -0
  45. package/dist/chunk-7UK565VJ.js +1 -0
  46. package/dist/{chunk-LHXFTFFM.js → chunk-A5BSUUNQ.js} +1 -1
  47. package/dist/chunk-ADGE7MKB.js +1 -0
  48. package/dist/chunk-AEWRZ7AE.js +1 -0
  49. package/dist/chunk-ALDJTWCO.js +1 -0
  50. package/dist/chunk-ARL5WBDK.js +1 -0
  51. package/dist/chunk-AXFEIJC7.js +1 -0
  52. package/dist/{chunk-KZRLZWOU.js → chunk-AYGL6F3P.js} +1 -1
  53. package/dist/{chunk-URXM5A2K.js → chunk-AYTTE7X5.js} +1 -1
  54. package/dist/{chunk-3ODQKAEA.js → chunk-BDIZUTKC.js} +1 -1
  55. package/dist/chunk-BQKF4SRH.js +6 -0
  56. package/dist/chunk-C2AOCLEZ.js +1 -0
  57. package/dist/{chunk-WRZWHT6M.js → chunk-C2SGJ5IG.js} +1 -1
  58. package/dist/chunk-C3S3UMV3.js +1 -0
  59. package/dist/{chunk-WBJ6ZHYH.js → chunk-C5DKLOW4.js} +37 -37
  60. package/dist/chunk-C72QNK6O.js +4 -0
  61. package/dist/{chunk-6ES4KRFW.js → chunk-CA3GVT4D.js} +1 -1
  62. package/dist/chunk-CCLU5ZRK.js +9 -0
  63. package/dist/chunk-CE6XQDAG.js +10 -0
  64. package/dist/chunk-CEJ5WS4I.js +5 -0
  65. package/dist/{chunk-VEUKT5EI.js → chunk-CIBBQO2L.js} +2 -2
  66. package/dist/{chunk-IILLQOUC.js → chunk-CKJXJ6HD.js} +1 -1
  67. package/dist/{chunk-MEYVUHQH.js → chunk-COGKVNQB.js} +1 -1
  68. package/dist/chunk-CQAD5WML.js +1 -0
  69. package/dist/chunk-CQPZOXWO.js +6 -0
  70. package/dist/{chunk-62EOM3Y2.js → chunk-CZYQIWNL.js} +1 -1
  71. package/dist/chunk-DA5RQFXA.js +10 -0
  72. package/dist/{chunk-7GHSE7SG.js → chunk-DDRP6QTC.js} +1 -1
  73. package/dist/{chunk-Q5IC3IYY.js → chunk-DESZFFOK.js} +1 -1
  74. package/dist/{chunk-PLSS456F.js → chunk-DKR7562G.js} +1 -1
  75. package/dist/{chunk-LGXI7EGM.js → chunk-DNNTAMC5.js} +2 -2
  76. package/dist/chunk-DUPQUQ2Z.js +1 -0
  77. package/dist/{chunk-Q4JYAUVL.js → chunk-DUTIWCJ2.js} +1 -1
  78. package/dist/chunk-E6JEBSHZ.js +20 -0
  79. package/dist/chunk-E6KNAPIY.js +4 -0
  80. package/dist/chunk-E7XCCLQH.js +1 -0
  81. package/dist/chunk-EE72PCKT.js +1 -0
  82. package/dist/chunk-EEYXBKR7.js +4 -0
  83. package/dist/{chunk-ZRI3SSLG.js → chunk-EGLA3WLZ.js} +2 -2
  84. package/dist/chunk-EVQPYZ7F.js +5 -0
  85. package/dist/chunk-FDFE3SSG.js +35 -0
  86. package/dist/{chunk-Q7BOSHWX.js → chunk-FDSNRKGQ.js} +1 -1
  87. package/dist/chunk-FI5TQHUA.js +1 -0
  88. package/dist/chunk-FIKZQ4RA.js +1 -0
  89. package/dist/chunk-FJOVMEPN.js +3 -0
  90. package/dist/{chunk-ER6C5WS3.js → chunk-FLARCZ5F.js} +1 -1
  91. package/dist/chunk-FOMMPAWZ.js +1 -0
  92. package/dist/{chunk-6PUU6ZNQ.js → chunk-FRWQJAW2.js} +1 -1
  93. package/dist/{chunk-HXZAY5OA.js → chunk-G3DXNSA2.js} +1 -1
  94. package/dist/{chunk-XWSWXQCC.js → chunk-G7JO3W2R.js} +1 -1
  95. package/dist/{chunk-WESTVWWD.js → chunk-GABIWYY3.js} +1 -1
  96. package/dist/chunk-GFSEU7PF.js +6 -0
  97. package/dist/chunk-GFVUWVEM.js +1 -0
  98. package/dist/{chunk-ISKQQXLZ.js → chunk-GHNSXX7R.js} +1 -1
  99. package/dist/{chunk-2L6AN3QA.js → chunk-GQ3LY7BY.js} +1 -1
  100. package/dist/{chunk-2A2JSAAA.js → chunk-H45S4MGC.js} +1 -1
  101. package/dist/chunk-HEB4YYM6.js +9 -0
  102. package/dist/{chunk-CXI3RHPW.js → chunk-HI5FTI3M.js} +1 -1
  103. package/dist/chunk-HJ24NEP5.js +1 -0
  104. package/dist/chunk-HQFXVVTB.js +1 -0
  105. package/dist/{chunk-TODZ3TJR.js → chunk-HR6R7JXN.js} +1 -1
  106. package/dist/chunk-HRHJA5ZP.js +3 -0
  107. package/dist/{chunk-QEKGGTMN.js → chunk-HT5JQJMB.js} +1 -1
  108. package/dist/chunk-HT7273V7.js +1 -0
  109. package/dist/{chunk-UXVXVI6O.js → chunk-HUB4HDWN.js} +78 -76
  110. package/dist/chunk-IATNIWOC.js +13 -0
  111. package/dist/chunk-IHVWDKDV.js +2 -0
  112. package/dist/{chunk-3KM5ZOW2.js → chunk-IKXUYCK7.js} +1 -1
  113. package/dist/chunk-IVQN2RUP.js +1 -0
  114. package/dist/chunk-IWNFPBH2.js +33 -0
  115. package/dist/{chunk-ESFCYB46.js → chunk-J324ZPO6.js} +1 -1
  116. package/dist/{chunk-KNWT7JLL.js → chunk-JJQ3DJG5.js} +2 -2
  117. package/dist/{chunk-7CCTPBCT.js → chunk-JLAN6JXJ.js} +1 -1
  118. package/dist/chunk-K2GCCCCV.js +1 -0
  119. package/dist/{chunk-NVKJ7ZLP.js → chunk-K4KKSBUW.js} +1 -1
  120. package/dist/{chunk-BAHIL37I.js → chunk-K4QJEQI4.js} +1 -1
  121. package/dist/{chunk-QDCLL5OI.js → chunk-K5UVCBIP.js} +1 -1
  122. package/dist/{chunk-64G5TGFF.js → chunk-KN2JIDNO.js} +1 -1
  123. package/dist/chunk-KORVOCNN.js +1 -0
  124. package/dist/chunk-KRQCQ57O.js +1 -0
  125. package/dist/{chunk-3MYDSQHF.js → chunk-KT2AMFVW.js} +1 -1
  126. package/dist/chunk-L23Q53FM.js +70 -0
  127. package/dist/{chunk-UBP3LQFY.js → chunk-L3DTONOI.js} +2 -2
  128. package/dist/{chunk-BN7ZXAZJ.js → chunk-LG3KEHGD.js} +2 -2
  129. package/dist/chunk-LRETOC6P.js +1 -0
  130. package/dist/chunk-LXFWK3O2.js +1 -0
  131. package/dist/chunk-LZ2TN7EZ.js +1 -0
  132. package/dist/chunk-MBAPM5HA.js +15 -0
  133. package/dist/{chunk-UUAKOX7E.js → chunk-MGZK5EQW.js} +2 -2
  134. package/dist/chunk-MKUXSM33.js +1 -0
  135. package/dist/chunk-MQ55QUOJ.js +276 -0
  136. package/dist/chunk-NAQJMRPT.js +2296 -0
  137. package/dist/{chunk-DZKFP6H2.js → chunk-NMXRDF4T.js} +1 -1
  138. package/dist/chunk-NOWM3CCG.js +1 -0
  139. package/dist/chunk-NVDFXEQ5.js +5 -0
  140. package/dist/{chunk-CX5CC6P5.js → chunk-O472FAYX.js} +1 -1
  141. package/dist/{chunk-B2O3ANRZ.js → chunk-OCILF2DD.js} +1 -1
  142. package/dist/{chunk-67L7FIB6.js → chunk-OGBMFGYC.js} +1 -1
  143. package/dist/chunk-OIQ5NQ5I.js +18 -0
  144. package/dist/chunk-OKRKVVTK.js +103 -0
  145. package/dist/chunk-ONNUEQGR.js +3 -0
  146. package/dist/chunk-OSASE35V.js +6 -0
  147. package/dist/chunk-OTMTS5L4.js +3 -0
  148. package/dist/chunk-OWPAHXDF.js +3 -0
  149. package/dist/chunk-P7HZGJRU.js +6 -0
  150. package/dist/chunk-PIU3GVJ4.js +1 -0
  151. package/dist/{chunk-2WJOTJOD.js → chunk-PSNCWS3Q.js} +2 -2
  152. package/dist/chunk-PSREELSQ.js +22 -0
  153. package/dist/{chunk-AQ6EVL73.js → chunk-Q2CKRCPM.js} +1 -1
  154. package/dist/chunk-QA2D7DT2.js +1 -0
  155. package/dist/chunk-QBRRFFMZ.js +1 -0
  156. package/dist/chunk-QDMTJKQ3.js +1 -0
  157. package/dist/{chunk-3Z3MADXZ.js → chunk-QIJ7D2JS.js} +1 -1
  158. package/dist/chunk-QLN6IOOY.js +1 -0
  159. package/dist/chunk-QU3USVKT.js +1 -0
  160. package/dist/chunk-R2E6TMBE.js +22 -0
  161. package/dist/chunk-R4E2E4NN.js +1 -0
  162. package/dist/chunk-R5COVIJM.js +1 -0
  163. package/dist/chunk-RFJ2LI64.js +81 -0
  164. package/dist/chunk-RNF6T6IO.js +5 -0
  165. package/dist/chunk-RSNFNZ6F.js +2 -0
  166. package/dist/{chunk-I4CEH7AK.js → chunk-RZ3UGOV4.js} +2 -2
  167. package/dist/{chunk-35XFNKNB.js → chunk-S23ZG2RG.js} +1 -1
  168. package/dist/{chunk-PF53E2DC.js → chunk-SAK42CAY.js} +1 -1
  169. package/dist/chunk-SBX7CMHM.js +1 -0
  170. package/dist/{chunk-S5P7KWY4.js → chunk-SGQTRKYZ.js} +1 -1
  171. package/dist/chunk-SNPJVVVE.js +5 -0
  172. package/dist/chunk-SNRGS3YU.js +1 -0
  173. package/dist/chunk-SUTSCIXU.js +7 -0
  174. package/dist/chunk-SWFCT5B7.js +2 -0
  175. package/dist/{chunk-4KECSZTL.js → chunk-SZ64GAVG.js} +2 -2
  176. package/dist/{chunk-WBVS5NBV.js → chunk-TDHIOONG.js} +2 -2
  177. package/dist/{chunk-W37IFK3P.js → chunk-TLN4BKXJ.js} +102 -102
  178. package/dist/{chunk-QW52RPAU.js → chunk-TXMZPF2U.js} +1 -1
  179. package/dist/chunk-TZHVCMZN.js +6 -0
  180. package/dist/{chunk-IHXGZW42.js → chunk-TZOB52QK.js} +1 -1
  181. package/dist/{chunk-N57Y7THE.js → chunk-U5BKU3OL.js} +1 -1
  182. package/dist/{chunk-Y55T4IIQ.js → chunk-UK3BDOHR.js} +1 -1
  183. package/dist/chunk-UORSJB4A.js +857 -0
  184. package/dist/chunk-UU6UQ2QY.js +1 -0
  185. package/dist/{chunk-PWAT52M4.js → chunk-UY44O4IZ.js} +1 -1
  186. package/dist/{chunk-QF5WKTPD.js → chunk-V3H6SYK3.js} +1 -1
  187. package/dist/{chunk-YTUUU33R.js → chunk-VBPMVVLV.js} +1 -1
  188. package/dist/{chunk-SNH4XZ6E.js → chunk-VGBCG3I5.js} +1 -1
  189. package/dist/{chunk-QEVTBD33.js → chunk-VHRUPKWH.js} +1 -1
  190. package/dist/chunk-VVHJ2AUF.js +3 -0
  191. package/dist/chunk-WB5GRBHW.js +1 -0
  192. package/dist/{chunk-YSWVYPWR.js → chunk-WBKQSSWW.js} +1 -1
  193. package/dist/{chunk-SIL6HPMK.js → chunk-WDXDT7XY.js} +2 -2
  194. package/dist/{chunk-SACNUF4I.js → chunk-WHOD5I7N.js} +1 -1
  195. package/dist/{chunk-Z2WAW6MM.js → chunk-WL3M63DG.js} +1 -1
  196. package/dist/{chunk-LEHBZKK3.js → chunk-WLJDMI7E.js} +1 -1
  197. package/dist/{chunk-PTSCGSQV.js → chunk-WZ3QWPK5.js} +2 -2
  198. package/dist/{chunk-H6GNKWYM.js → chunk-X5V7AGVU.js} +1 -1
  199. package/dist/{chunk-RPVZ2JON.js → chunk-X76AYO36.js} +1 -1
  200. package/dist/chunk-XB7H2RYV.js +31 -0
  201. package/dist/chunk-XHHAVKKV.js +1 -0
  202. package/dist/chunk-XKNDU62O.js +1 -0
  203. package/dist/chunk-XVJRGOJA.js +4 -0
  204. package/dist/chunk-Y3ZAQZPH.js +16 -0
  205. package/dist/chunk-YF4AXKM4.js +1 -0
  206. package/dist/chunk-YGN65N6W.js +16 -0
  207. package/dist/{chunk-HF4NDEX3.js → chunk-YR4J46US.js} +1 -1
  208. package/dist/chunk-YTC367JI.js +3 -0
  209. package/dist/{chunk-ZBL7XMJ6.js → chunk-Z2FGYMJ6.js} +2 -2
  210. package/dist/chunk-Z3QZNLT5.js +1 -0
  211. package/dist/chunk-ZC3EDADH.js +26 -0
  212. package/dist/chunk-ZLITAXPT.js +1 -0
  213. package/dist/{chunk-ACA2BGAD.js → chunk-ZNEPRGFY.js} +1 -1
  214. package/dist/chunk-ZNEQZV5K.js +3 -0
  215. package/dist/chunk-ZOU6SOXW.js +20 -0
  216. package/dist/{chunk-YV2TP44L.js → chunk-ZQNGYJKJ.js} +1 -1
  217. package/dist/chunk-ZRM7ESSS.js +4 -0
  218. package/dist/chunk-ZX33FUW3.js +5 -0
  219. package/dist/cli/commands/app/build.js +1 -1
  220. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  221. package/dist/cli/commands/app/bulk/execute.js +1 -1
  222. package/dist/cli/commands/app/bulk/status.js +1 -1
  223. package/dist/cli/commands/app/config/link.js +1 -1
  224. package/dist/cli/commands/app/config/pull.js +1 -1
  225. package/dist/cli/commands/app/config/use.js +1 -1
  226. package/dist/cli/commands/app/config/validate.js +1 -1
  227. package/dist/cli/commands/app/demo/watcher.js +1 -1
  228. package/dist/cli/commands/app/deploy.js +1 -1
  229. package/dist/cli/commands/app/dev/clean.js +1 -1
  230. package/dist/cli/commands/app/dev.js +1 -1
  231. package/dist/cli/commands/app/env/pull.js +1 -1
  232. package/dist/cli/commands/app/env/show.js +1 -1
  233. package/dist/cli/commands/app/execute.js +1 -1
  234. package/dist/cli/commands/app/function/build.js +1 -1
  235. package/dist/cli/commands/app/function/info.js +1 -1
  236. package/dist/cli/commands/app/function/replay.js +1 -1
  237. package/dist/cli/commands/app/function/run.js +1 -1
  238. package/dist/cli/commands/app/function/schema.js +1 -1
  239. package/dist/cli/commands/app/function/typegen.js +1 -1
  240. package/dist/cli/commands/app/generate/extension.js +1 -1
  241. package/dist/cli/commands/app/graphiql.js +1 -1
  242. package/dist/cli/commands/app/import/channel-config.js +1 -1
  243. package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
  244. package/dist/cli/commands/app/import/dashboard-extensions.js +1 -1
  245. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  246. package/dist/cli/commands/app/import-extensions.js +1 -1
  247. package/dist/cli/commands/app/info.js +1 -1
  248. package/dist/cli/commands/app/init.js +1 -1
  249. package/dist/cli/commands/app/logs.js +1 -1
  250. package/dist/cli/commands/app/release.js +1 -1
  251. package/dist/cli/commands/app/security/check.js +1 -1
  252. package/dist/cli/commands/app/security/clean.js +1 -1
  253. package/dist/cli/commands/app/security/instructions.js +1 -1
  254. package/dist/cli/commands/app/security/record.js +1 -1
  255. package/dist/cli/commands/app/security/review.js +1 -1
  256. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  257. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  258. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  259. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  260. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  261. package/dist/cli/commands/app/versions/list.js +1 -1
  262. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  263. package/dist/cli/commands/auth/login.d.ts +10 -10
  264. package/dist/cli/commands/auth/login.js +1 -1
  265. package/dist/cli/commands/auth/logout.d.ts +7 -7
  266. package/dist/cli/commands/auth/logout.js +1 -1
  267. package/dist/cli/commands/cache/clear.js +1 -1
  268. package/dist/cli/commands/config/autoupgrade/off.d.ts +7 -7
  269. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  270. package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -7
  271. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  272. package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -7
  273. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  274. package/dist/cli/commands/debug/command-flags.js +1 -1
  275. package/dist/cli/commands/doc/fetch.d.ts +21 -21
  276. package/dist/cli/commands/doc/fetch.js +1 -1
  277. package/dist/cli/commands/doc/search.d.ts +23 -23
  278. package/dist/cli/commands/doc/search.js +1 -1
  279. package/dist/cli/commands/docs/generate.js +1 -1
  280. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  281. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  282. package/dist/cli/commands/help.d.ts +90 -90
  283. package/dist/cli/commands/help.js +1 -1
  284. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  285. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  286. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  287. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  288. package/dist/cli/commands/notifications/generate.js +1 -1
  289. package/dist/cli/commands/notifications/list.js +1 -1
  290. package/dist/cli/commands/organization/list.js +1 -1
  291. package/dist/cli/commands/search.d.ts +7 -7
  292. package/dist/cli/commands/search.js +1 -1
  293. package/dist/cli/commands/send-analytics.js +1 -1
  294. package/dist/cli/commands/theme/check.js +1 -1
  295. package/dist/cli/commands/theme/console.js +1 -1
  296. package/dist/cli/commands/theme/delete.js +1 -1
  297. package/dist/cli/commands/theme/dev.js +1 -1
  298. package/dist/cli/commands/theme/duplicate.js +1 -1
  299. package/dist/cli/commands/theme/info.js +1 -1
  300. package/dist/cli/commands/theme/init.js +1 -1
  301. package/dist/cli/commands/theme/language-server.js +1 -1
  302. package/dist/cli/commands/theme/list.js +1 -1
  303. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  304. package/dist/cli/commands/theme/open.js +1 -1
  305. package/dist/cli/commands/theme/package.js +1 -1
  306. package/dist/cli/commands/theme/preview.js +1 -1
  307. package/dist/cli/commands/theme/profile.js +1 -1
  308. package/dist/cli/commands/theme/publish.js +1 -1
  309. package/dist/cli/commands/theme/pull.js +1 -1
  310. package/dist/cli/commands/theme/push.js +1 -1
  311. package/dist/cli/commands/theme/rename.js +1 -1
  312. package/dist/cli/commands/theme/share.js +1 -1
  313. package/dist/cli/commands/upgrade.d.ts +24 -24
  314. package/dist/cli/commands/upgrade.js +1 -1
  315. package/dist/cli/commands/version.d.ts +7 -7
  316. package/dist/cli/commands/version.js +1 -1
  317. package/dist/cli/help.js +1 -1
  318. package/dist/cli-version-check-BW2CUMX4.js +1 -0
  319. package/dist/{command-event-context-LFUZ7UCA.js → command-event-context-ILIANB5Q.js} +1 -1
  320. package/dist/command-json-schema-LGR44Q2G.js +1 -0
  321. package/dist/command-registry.js +1 -1
  322. package/dist/conf-store-TODPQ2LC.js +1 -0
  323. package/dist/configs/all.yml +9 -0
  324. package/dist/configs/recommended.yml +9 -0
  325. package/dist/custom-oclif-loader-BPE2TH4B.js +1 -0
  326. package/dist/data/filters.json +41 -2
  327. package/dist/data/local_block_entry.json +1 -1
  328. package/dist/data/manifest_theme.json +1 -0
  329. package/dist/data/objects.json +279 -44
  330. package/dist/data/section.json +15 -1
  331. package/dist/data/setting.json +9 -5
  332. package/dist/data/shopify_system_translations.json +312 -32
  333. package/dist/data/strict_settings.json +24 -0
  334. package/dist/data/tags.json +57 -24
  335. package/dist/data/theme_block.json +1 -1
  336. package/dist/deprecations-5CSI24TV.js +1 -0
  337. package/dist/dist-LPKYTX3M.js +1 -0
  338. package/dist/dist-WT6MPTKJ.js +1 -0
  339. package/dist/environment-5P7JJ3GI.js +1 -0
  340. package/dist/environments-3HTT5CVC.js +1 -0
  341. package/dist/error-PFOKPWFX.js +1 -0
  342. package/dist/error-handler-23FASAEU.js +1 -0
  343. package/dist/fs-RA25PWSJ.js +1 -0
  344. package/dist/hooks/did-you-mean.js +1 -1
  345. package/dist/hooks/hydrogen-init.js +1 -1
  346. package/dist/hooks/plugin-plugins.js +1 -1
  347. package/dist/hooks/postrun.js +1 -1
  348. package/dist/hooks/prerun.js +2 -2
  349. package/dist/hooks/public-metadata.js +1 -1
  350. package/dist/hooks/sensitive-metadata.js +1 -1
  351. package/dist/hooks/tunnel-provider.js +1 -1
  352. package/dist/hooks/tunnel-start.js +1 -1
  353. package/dist/http-EVDTYINS.js +1 -0
  354. package/dist/http-proxy-node16-NZZ674YW.js +38 -0
  355. package/dist/index.js +12 -12
  356. package/dist/is-global-3DNAMKUU.js +1 -0
  357. package/dist/json-error-HGCRNJRF.js +1 -0
  358. package/dist/latest-version-75YEFEMK.js +9 -0
  359. package/dist/lib-4ZA53LTZ.js +1 -0
  360. package/dist/lib-F3MES3XF.js +1 -0
  361. package/dist/lib-XPJABU24.js +1 -0
  362. package/dist/{local-OKPVB4NH.js → local-LNGPIGLG.js} +1 -1
  363. package/dist/metadata-VHLSUKCW.js +1 -0
  364. package/dist/{morph-CRY35DIK.js → morph-H7XQP55V.js} +3 -3
  365. package/dist/node-package-manager-SSFNUVWB.js +1 -0
  366. package/dist/notifications-system-3NQRYYKW.js +1 -0
  367. package/dist/{npa-A4YSCQ5Q.js → npa-LVYMN7GE.js} +1 -1
  368. package/dist/os-KIKVJONE.js +1 -0
  369. package/dist/output-DUJTSURG.js +1 -0
  370. package/dist/{prettier-EGVCP5CY.js → prettier-NOE3TJJ5.js} +1 -1
  371. package/dist/registry-auth-token-EDH77OOW.js +1 -0
  372. package/dist/registry-url-JMNV3LLX.js +1 -0
  373. package/dist/semver-HHZRKD6Y.js +1 -0
  374. package/dist/system-CGOZSROX.js +1 -0
  375. package/dist/tsconfig.tsbuildinfo +1 -1
  376. package/dist/ui-YMBFS3NG.js +1 -0
  377. package/dist/upgrade-73RRPDSC.js +1 -0
  378. package/dist/version-AMUEEBIG.js +1 -0
  379. package/dist/version-S4MGCKDO.js +1 -0
  380. package/dist/workerd-DRWNY3S4.js +18 -0
  381. package/oclif.manifest.json +25618 -1167
  382. package/package.json +7 -7
  383. package/dist/analytics-NMMVOF4B.js +0 -1
  384. package/dist/analytics-UK77WNLG.js +0 -1
  385. package/dist/chunk-224UPIYS.js +0 -4
  386. package/dist/chunk-27NXPOAS.js +0 -1
  387. package/dist/chunk-2MT3LSMZ.js +0 -1
  388. package/dist/chunk-2T4HDR6R.js +0 -70
  389. package/dist/chunk-2ZBXHCQZ.js +0 -1
  390. package/dist/chunk-335BUVBP.js +0 -1
  391. package/dist/chunk-33ZE3DRQ.js +0 -16
  392. package/dist/chunk-34MOWGRL.js +0 -1
  393. package/dist/chunk-3JSKNXL7.js +0 -1
  394. package/dist/chunk-3MG4MTWQ.js +0 -1
  395. package/dist/chunk-3XRI3D44.js +0 -1
  396. package/dist/chunk-43R5VGKT.js +0 -1
  397. package/dist/chunk-4WYKPIN3.js +0 -1
  398. package/dist/chunk-5AEZJZNQ.js +0 -1
  399. package/dist/chunk-5ED7SOQZ.js +0 -20
  400. package/dist/chunk-5IDJALJH.js +0 -1
  401. package/dist/chunk-66TMIQMB.js +0 -1
  402. package/dist/chunk-74NRFUGQ.js +0 -1
  403. package/dist/chunk-7GUMJ5E4.js +0 -1
  404. package/dist/chunk-7NFTSBHQ.js +0 -10
  405. package/dist/chunk-ACZNWIRY.js +0 -1
  406. package/dist/chunk-AUE7LM32.js +0 -1
  407. package/dist/chunk-AXL2VIWA.js +0 -16
  408. package/dist/chunk-B3ZJGYZY.js +0 -3
  409. package/dist/chunk-BOAGJ6P5.js +0 -1
  410. package/dist/chunk-BWN2QG6D.js +0 -5
  411. package/dist/chunk-CCUQM4FX.js +0 -6
  412. package/dist/chunk-CLUUA3HX.js +0 -3
  413. package/dist/chunk-CYEEGTVZ.js +0 -11
  414. package/dist/chunk-DBDTE3EE.js +0 -5
  415. package/dist/chunk-DLVB3237.js +0 -31
  416. package/dist/chunk-DN6X7SHW.js +0 -2
  417. package/dist/chunk-E5COIKGY.js +0 -5
  418. package/dist/chunk-E6RONHMT.js +0 -1
  419. package/dist/chunk-EAZIQI2D.js +0 -1
  420. package/dist/chunk-EEY4FKAW.js +0 -1
  421. package/dist/chunk-EKFPTBXC.js +0 -1
  422. package/dist/chunk-F3CK3EJJ.js +0 -1
  423. package/dist/chunk-FEBOZ2XX.js +0 -31
  424. package/dist/chunk-FFSDGRAN.js +0 -1
  425. package/dist/chunk-FZCGRIOM.js +0 -1
  426. package/dist/chunk-GNCVDN7U.js +0 -1
  427. package/dist/chunk-GQLNG537.js +0 -836
  428. package/dist/chunk-GVI3DWSB.js +0 -4
  429. package/dist/chunk-GW7YIJPJ.js +0 -5
  430. package/dist/chunk-H6GYBLVQ.js +0 -2
  431. package/dist/chunk-HB3MJYBK.js +0 -1
  432. package/dist/chunk-HSKDFEXW.js +0 -1
  433. package/dist/chunk-HTRJU4R4.js +0 -1
  434. package/dist/chunk-I7PEEJVH.js +0 -1
  435. package/dist/chunk-IHMATNOR.js +0 -1
  436. package/dist/chunk-IJY3RJPJ.js +0 -47
  437. package/dist/chunk-J3JPJCWP.js +0 -1
  438. package/dist/chunk-J55GQLP4.js +0 -1
  439. package/dist/chunk-JLQRDFR5.js +0 -18
  440. package/dist/chunk-JPWRZ5SL.js +0 -16
  441. package/dist/chunk-K7ZSPQKL.js +0 -4
  442. package/dist/chunk-L5TSPCSY.js +0 -26
  443. package/dist/chunk-LUGMXSRI.js +0 -9
  444. package/dist/chunk-M2CWCOFU.js +0 -11
  445. package/dist/chunk-M5VIFG2V.js +0 -1
  446. package/dist/chunk-MADINS4Z.js +0 -1
  447. package/dist/chunk-MGHPF7HU.js +0 -6
  448. package/dist/chunk-MHR5OHT5.js +0 -10
  449. package/dist/chunk-MXEXP3HT.js +0 -15
  450. package/dist/chunk-OJULL7HT.js +0 -1
  451. package/dist/chunk-OMPQ7REW.js +0 -3
  452. package/dist/chunk-OR4IJ4BQ.js +0 -1
  453. package/dist/chunk-P2RMFHQP.js +0 -1
  454. package/dist/chunk-P4VZYOKO.js +0 -15
  455. package/dist/chunk-PDZBKVWL.js +0 -97
  456. package/dist/chunk-Q2KWXZQB.js +0 -12
  457. package/dist/chunk-QFSENE5T.js +0 -3
  458. package/dist/chunk-QFWWCZOI.js +0 -1
  459. package/dist/chunk-QFYLJVJW.js +0 -77
  460. package/dist/chunk-QQJNQNKP.js +0 -6
  461. package/dist/chunk-R4UVIYZP.js +0 -4
  462. package/dist/chunk-RLNIOJH3.js +0 -272
  463. package/dist/chunk-RW6G4ZPU.js +0 -1
  464. package/dist/chunk-S4LOWCGS.js +0 -1
  465. package/dist/chunk-SB27UOXX.js +0 -1
  466. package/dist/chunk-SHD4VV5V.js +0 -3
  467. package/dist/chunk-SK7EPN6C.js +0 -1
  468. package/dist/chunk-TAWCKJKP.js +0 -1
  469. package/dist/chunk-U2T5HPRD.js +0 -319
  470. package/dist/chunk-U6YOP562.js +0 -1
  471. package/dist/chunk-UPPO3BMT.js +0 -7
  472. package/dist/chunk-USXIXANP.js +0 -103
  473. package/dist/chunk-UV5GAGAD.js +0 -1
  474. package/dist/chunk-UY6W2EVZ.js +0 -1
  475. package/dist/chunk-UYELAINQ.js +0 -16
  476. package/dist/chunk-V75WUEFU.js +0 -1
  477. package/dist/chunk-VAVXDIUX.js +0 -6
  478. package/dist/chunk-VGSH52JM.js +0 -1
  479. package/dist/chunk-VHZ6RL67.js +0 -1
  480. package/dist/chunk-VQA3X7O3.js +0 -1
  481. package/dist/chunk-VZCMJRYV.js +0 -1
  482. package/dist/chunk-W56ZGEQQ.js +0 -2265
  483. package/dist/chunk-WCC52MR2.js +0 -1
  484. package/dist/chunk-WSDKCQH6.js +0 -6
  485. package/dist/chunk-X2PFXSU4.js +0 -1
  486. package/dist/chunk-X5NIAZA4.js +0 -1
  487. package/dist/chunk-XBMD3FEZ.js +0 -3
  488. package/dist/chunk-XDVPIGXE.js +0 -2
  489. package/dist/chunk-XLIJYJ6Q.js +0 -1
  490. package/dist/chunk-XUHGWIWW.js +0 -4
  491. package/dist/chunk-Y5CVX5LJ.js +0 -1
  492. package/dist/chunk-Y6J46XYF.js +0 -3
  493. package/dist/chunk-YKMINHYY.js +0 -3
  494. package/dist/chunk-ZDQO6CNY.js +0 -1
  495. package/dist/chunk-ZGASBRSQ.js +0 -5
  496. package/dist/chunk-ZGBTO46A.js +0 -1
  497. package/dist/chunk-ZJOX5HW4.js +0 -22
  498. package/dist/chunk-ZOOT3GBY.js +0 -5
  499. package/dist/command-json-schema-F5XF7XHL.js +0 -1
  500. package/dist/conf-store-5CBLWTOC.js +0 -1
  501. package/dist/custom-oclif-loader-UDVUFKMD.js +0 -1
  502. package/dist/deprecations-EOHPSTCS.js +0 -1
  503. package/dist/dist-RNV3GFZ7.js +0 -1
  504. package/dist/dist-ZFKWJVNB.js +0 -1
  505. package/dist/environment-O7ECODHU.js +0 -1
  506. package/dist/environments-4FLRZW4P.js +0 -1
  507. package/dist/error-JY2ADS6S.js +0 -1
  508. package/dist/error-handler-4GCXKC6I.js +0 -1
  509. package/dist/fs-XS5YF34R.js +0 -1
  510. package/dist/http-proxy-node16-D3JUYA5D.js +0 -38
  511. package/dist/is-global-27MUENOK.js +0 -1
  512. package/dist/json-error-S5XFS3UX.js +0 -1
  513. package/dist/latest-version-LDWU5F7A.js +0 -49
  514. package/dist/lib-PJHT4MKY.js +0 -1
  515. package/dist/lib-VKSQ65BQ.js +0 -1
  516. package/dist/lib-YEZOHXF3.js +0 -1
  517. package/dist/metadata-2YJBAKR7.js +0 -1
  518. package/dist/node-package-manager-B3OW3PFQ.js +0 -1
  519. package/dist/notifications-system-BWTDYBG2.js +0 -1
  520. package/dist/os-F6QKJCFW.js +0 -1
  521. package/dist/output-BRIPK7UC.js +0 -1
  522. package/dist/system-466QKFDI.js +0 -1
  523. package/dist/ui-VJTNGCS6.js +0 -1
  524. package/dist/upgrade-VHVJLXKX.js +0 -1
  525. package/dist/version-FETZRLZO.js +0 -1
  526. package/dist/version-T4XXTJMB.js +0 -1
  527. package/dist/workerd-32DMKLMN.js +0 -18
  528. /package/dist/{chunk-YLQ3LNNY.js → chunk-HVECVOIO.js} +0 -0
  529. /package/dist/{chunk-YRHFPXC3.js → chunk-Z2AV4BWZ.js} +0 -0
@@ -0,0 +1,35 @@
1
+ import{a as U,b as F}from"./chunk-YF4AXKM4.js";import{a as at}from"./chunk-COGKVNQB.js";import{c as ct}from"./chunk-KORVOCNN.js";import{b as Xe,c as Qe,d as Ze,e as et,f as tt,h as rt,i as ot,l as nt,m as it,o as st}from"./chunk-OKRKVVTK.js";import{a as Ue}from"./chunk-3DB4EC62.js";import{d as je,f as j,p as qe,q as xe}from"./chunk-36S6MFJQ.js";import{c as Je,d as Ve,e as ze}from"./chunk-TXMZPF2U.js";import{a as Ke}from"./chunk-7AQZKPJU.js";import{a as Be}from"./chunk-GQ3LY7BY.js";import{k as Y,l as Ye,n as T}from"./chunk-RSNFNZ6F.js";import{p as We,s as X,u as M,v as Me}from"./chunk-VVHJ2AUF.js";import{a as Ne,b as Ge}from"./chunk-X5V7AGVU.js";import{p as Re,t as De,u as _e,v as $e,x as He}from"./chunk-FDSNRKGQ.js";import{a as Dt}from"./chunk-QLN6IOOY.js";import{a as lt}from"./chunk-ZQNGYJKJ.js";import{Da as ye,Ha as W}from"./chunk-UORSJB4A.js";import{b as Oe,c as Ce,e as Le}from"./chunk-IKXUYCK7.js";import{B as Pe,C as Ee,M as Ae,S as Fe,U as Ie,v as be,x as ke,y as Se,z}from"./chunk-7A4ZE5IS.js";import{c as we}from"./chunk-WLJDMI7E.js";import{b as H,d as ue}from"./chunk-QBRRFFMZ.js";import{a as le}from"./chunk-LG3KEHGD.js";import{d as ge,e as ve}from"./chunk-HI5FTI3M.js";import{j as k}from"./chunk-FJOVMEPN.js";import{Aa as fe,Ba as he,Bb as B,Eb as S,Kb as Te,gb as N,hb as G,la as ce,tb as R,va as me,vb as K,xa as J,ya as de}from"./chunk-OIQ5NQ5I.js";import{i as I}from"./chunk-B4OMIONW.js";import{b as O,d as ae,e as C,i as pe,k as V}from"./chunk-3PYDIBTX.js";import{b as Rt}from"./chunk-VBPMVVLV.js";import{c as L}from"./chunk-IWTNUJGY.js";import{e as se,g as y}from"./chunk-VKWPEFWQ.js";y();y();y();import{AsyncLocalStorage as _t}from"node:async_hooks";import{Writable as $t}from"node:stream";import{format as Ht}from"node:util";var mt=new _t;async function dt(t,e,o=!1){let r=t.tee(new $t({write:(a,m,d)=>d()}),{stringWritesAreMessages:!0}),n=console.warn,s=!0;console.warn=c;try{return await mt.run(r,()=>N({consoleWarn:l},()=>pe({outputMode:o?"json":"text",sink:(a,m)=>{s&&a.message&&(o||a.type==="progress")&&r.write(a.message),!o&&!m?.alreadyRendered&&we(a)}},e)))}finally{s=!1,i()}function i(){console.warn=n}function c(...a){if(s&&mt.getStore()===r){l(Ht(...a));return}n(...a)}function l(a){if(s&&r.write(a),s&&o)return;(console.warn===c?n:console.warn)(a)}}y();y();y();var ft={workPromise:Promise.resolve()};async function ht(t,e,o,r,n){if(n.signal?.throwIfAborted(),o.length===0)return ft;S("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:s,filesOnlyPresentOnRemote:i,filesWithConflictingChecksums:c}=Nt(o,r),l=s.length===0&&i.length===0&&c.length===0;if(W(`theme-service:theme-reconciliation:manual:${l}`),l)return S("Local and remote checksums match - no need to reconcile theme assets"),ft;let a=await Yt({filesOnlyPresentLocally:s,filesOnlyPresentOnRemote:i,filesWithConflictingChecksums:c},n);return{workPromise:Mt(t,e,r,a,n.signal)}}function Nt(t,e){let o=new Set,r=[],n=[];for(let i of t){o.add(i.key);let c=e.files.get(i.key);c?i.checksum!==c.checksum&&n.push(i):r.push(i)}let s=Array.from(e.files.values()).filter(i=>!o.has(i.key));return{filesOnlyPresentOnRemote:Q(r,e),filesOnlyPresentLocally:Q(s,e),filesWithConflictingChecksums:Q(n,e)}}function Q(t,e){return e.applyIgnoreFilters(t).filter(r=>r.key.endsWith(".json"))}async function Z(t,e,o,r){if(t.length===0)return;if(r){Gt(t,o,r);return}ke({body:{list:{title:e,items:t.map(s=>s.key)}}}),await Ee({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:ee},{label:o.local.label,value:ut}]})===ee?o.remote.callback(t):o.local.callback(t)}function Gt(t,e,o){switch(o){case"keep-remote":e.remote.callback(t);break;case"keep-local":e.local.callback(t);break;case"abort":break}}function Wt(t){let e=[{title:"The files listed below are only present locally.",files:t.filesOnlyPresentLocally},{title:"The files listed below are only present on the remote theme.",files:t.filesOnlyPresentOnRemote},{title:"The files listed below differ between the local and remote versions.",files:t.filesWithConflictingChecksums}];throw new k("Theme JSON files need reconciliation.",e.filter(o=>o.files.length>0).map(o=>`${o.title}
2
+ ${o.files.map(r=>`- ${r.key}`).join(`
3
+ `)}`).join(`
4
+
5
+ `))}async function Mt(t,e,o,r,n){n?.throwIfAborted();let{localFilesToDelete:s,filesToDownload:i,remoteFilesToDelete:c}=r,l=s.map(d=>o.delete(d.key)),a=U(i,M,async d=>{let h=await Y(t.id,d.map(w=>w.key),e);return n?.throwIfAborted(),F(h.map(async w=>{if(w)return o.write(w)}))}),m=Ye(t.id,c.map(d=>d.key),e);await F([...l,...a,m])}async function Yt(t,e){let{filesOnlyPresentLocally:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:n}=t,{reconciliationStrategy:s}=e,i=[],c=[],l=[],a={filesOnlyPresentLocally:e.noDelete?[]:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:n},m=Object.values(a).some(d=>d.length>0);return s==="abort"&&m&&Wt(a),e.noDelete||await Z(o,"The files listed below are only present locally. What would you like to do?",{remote:{label:"Delete files from the local directory",callback:d=>{i.push(...d)}},local:{label:"Upload local files to the remote theme",callback:()=>{}}},s),await Z(r,"The files listed below are only present on the remote theme. What would you like to do?",{remote:{label:"Download remote files to the local directory",callback:d=>{c.push(...d)}},local:{label:"Delete files from the remote theme",callback:d=>{l.push(...d)}}},s),await Z(n,"The files listed below differ between the local and remote versions. What would you like to do?",{remote:{label:"Keep the remote version",callback:d=>{c.push(...d)}},local:{label:"Keep the local version",callback:d=>{l.push(...d)}}},s),{localFilesToDelete:i,filesToDownload:c,remoteFilesToDelete:l}}y();import{setTimeout as jt}from"node:timers/promises";var Ut=3e3,te=class extends Error{};function wt(t,e,o,r,n,s){S("Listening for changes in the theme editor");let i=5,c=0,l="",a=o,m=async()=>{await jt(Ut,void 0,{signal:n.signal}),!n.signal?.aborted&&(a=await qt(t,e,a,r,n).then(h=>(c=0,l="",h)).catch(h=>{if(n.signal?.aborted)return a;if(c++,h.message!==l&&(l=h.message,j("Error while polling for changes.",h)),c>=i){let w=new k("Too many polling errors...","Please check the errors above and ensure you have a stable internet connection.");Pe(w),s(w)}return a}))};return(async()=>{for(;!n.signal?.aborted&&(await m(),!(c>=i)););})().catch(h=>{n.signal?.aborted||s(h)})}async function qt(t,e,o,r,n){n.signal?.throwIfAborted();let s=new Set(r.unsyncedFileKeys),i=pt(o,r,s),c=await T(t.id,e).then(m=>pt(m,r,s));n.signal?.throwIfAborted();let l=Jt(i,c),a=xt(c,i);return await Kt(r,l),n.signal?.throwIfAborted(),await Vt(t,e,r,l,n.signal),await zt(r,a,n),c}function xt(t,e){let o=new Map(t.map(n=>[n.key,n]));return e.filter(n=>o.get(n.key)===void 0)}function Jt(t,e){let o=new Map(t.map(n=>[n.key,n]));return e.filter(n=>{let s=o.get(n.key);if(!s||s.checksum!==n.checksum)return!0})}async function Vt(t,e,o,r,n){let s=r.filter(c=>o.files.get(c.key)?.checksum!==c.checksum),i=U(s,M,async c=>Y(t.id,c.map(l=>l.key),e).then(l=>(n?.throwIfAborted(),F(l.map(async a=>{a&&(await o.write(a),B(V()==="json"?`Synced download ${a.key} from remote theme`:K`• ${X.format(new Date)} Synced ${R.raw("\xBB")} ${R.gray(`download ${a.key} from remote theme`)}`))})))));await F(i)}async function zt(t,e,o){if(o.signal?.throwIfAborted(),!o.noDelete)return F(e.map(r=>t.files.get(r.key)?t.delete(r.key).then(()=>{B(V()==="json"?`Synced remove ${r.key} from local theme`:K`• ${X.format(new Date)} Synced ${R.raw("\xBB")} ${R.gray(`remove ${r.key} from local theme`)}`)}):Promise.resolve()))}async function Kt(t,e){let o=new Map(t.files);await Promise.all(e.map(r=>t.read(r.key)));for(let r of e){let n=o.get(r.key)?.checksum,s=t.files.get(r.key)?.checksum;if(n!==s)throw new te(`Detected changes to the file '${r.key}' on both local and remote sources. Aborting...`)}}function pt(t,e,o){return e.applyIgnoreFilters(t).filter(n=>n.key.endsWith(".json")).filter(n=>!o.has(n.key))}var ut="local",ee="remote";async function yt(t,e,o,r,n,s){S("Initiating theme asset reconciliation process"),await r.ready(),n.signal?.throwIfAborted();let{workPromise:i}=await ht(t,e,o,r,n),c=i.then(async()=>{n.signal?.throwIfAborted();let a=await T(t.id,e);return n.signal?.throwIfAborted(),a}),l=c.then(a=>wt(t,e,a,r,n,s));return{updatedRemoteChecksumsPromise:c,workPromise:i,pollingPromise:l}}import{createServer as Bt}from"node:http";function gt(t,e){let{promise:o,resolve:r,reject:n}=Promise.withResolvers(),s=rt(t,e),i=Xt(t,e,n),c=Promise.all([s,i.workPromise]).then(()=>e.localThemeFileSystem.startWatcher(t.id.toString(),e.session)),l=Zt(t,e,c,n);return{workPromise:c,serverStart:l.start,serverStop:async()=>{await l.close(),await i.stopPromise},dispatchEvent:l.dispatch,renderDevSetupProgress:i.renderProgress,backgroundJobPromise:o,resolveBackgroundJob:r}}function Xt(t,e,o){let r=a=>(e.signal?.aborted||j("Failed to perform the initial theme synchronization.",a),o(a),new Promise(()=>{})),s=T(t.id,e.session).then(a=>(e.signal?.throwIfAborted(),Qt(t,e,a,o))),i=s.then(async({updatedRemoteChecksumsPromise:a})=>{let m=await a;return e.signal?.throwIfAborted(),at(t,e.session,m,e.localThemeFileSystem,{nodelete:e.options.noDelete,deferPartialWork:!0,backgroundWorkCatch:r})}),c=i.then(a=>a.workPromise).catch(r),l=s.then(({workPromise:a,pollingPromise:m})=>Promise.allSettled([a,m])).catch(()=>{});return{workPromise:c,stopPromise:l,renderProgress:async()=>{if(e.options.themeEditorSync){let{workPromise:m}=await s;await ze([{title:"Performing file synchronization. This may take a while...",task:async()=>{await m}}])}let{renderThemeSyncProgress:a}=await i;await a()}}}function Qt(t,e,o,r){return e.options.themeEditorSync?yt(t,e.session,o,e.localThemeFileSystem,{noDelete:e.options.noDelete,ignore:e.options.ignore,only:e.options.only,reconciliationStrategy:e.options.reconciliationStrategy,signal:e.signal},r):Promise.resolve({updatedRemoteChecksumsPromise:Promise.resolve(o),workPromise:Promise.resolve(),pollingPromise:Promise.resolve()})}function Zt(t,e,o,r){let n=$e(),s=[`http://${e.options.host}:${e.options.port}`,`https://${e.session.storeFqdn}`,"https://online-store-web.shopifyapps.com"];n.use(et(e.options.host,e.options.port)),n.use(_e(async()=>(await o,De(l=>{l.node.req.headers.origin&&Re(l,{origin:m=>s.includes(m),credentials:!0,methods:["GET","POST","HEAD","OPTIONS"],preflight:{statusCode:204}})})))),e.options.liveReload!=="off"&&n.use(ot(t,e)),n.use(Ze(t,e)),n.use(Xe(t,e)),n.use(Qe(t,e,r));let i=Bt(He(n)),c=async()=>{i.closeAllConnections(),await new Promise(l=>i.close(()=>l()))};return{dispatch:n.handler.bind(n),close:c,start:async()=>(e.signal?.throwIfAborted(),new Promise((l,a)=>{i.once("error",a),i.listen({port:e.options.port,host:e.options.host,signal:e.signal},()=>{i.off("error",a),l({close:c})})}))}}y();y();import{createWriteStream as er}from"fs";import{Writable as tr}from"stream";import{finished as rr}from"stream/promises";import{StringDecoder as or}from"string_decoder";import{once as nr}from"events";var x=le({name:"DevInstanceLogEntry",schema:O.object({timestamp:ae,source:O.string().optional().describe("What produced the line, for example a process prefix like web or extensions, when needed."),level:O.enum(["debug","info","warning","error"]).optional(),message:O.string()}).strict()});function bt({logFile:t,logOutput:e,isActive:o,onError:r}){let n=er(t,{flags:"w",mode:384});n.on("error",r),e?.on("error",r);let s=nr(n,"open"),i=new Set,c=async l=>{if(!o())return;let a=x.validate({...l,timestamp:l.timestamp??C(new Date)}),m=`${JSON.stringify(a)}
6
+ `;try{await q(n,m),e&&await q(e,m)}catch(d){throw r(d),d}};return{opened:s,log:c,tee:(l,{source:a,stringWritesAreMessages:m=!1})=>{let d=new or("utf8"),h="",w=a,E=async p=>{let f=p.split(/\r?\n/);h=f.pop()??"",await Promise.all(f.map(async u=>{let v=Te(u).trimEnd();v.length>0&&await c({source:w,message:v})}))},P=()=>E(`${h}${d.end()}
7
+ `),b=new re({decodeStrings:!m,write(p,f,u){let v=a===void 0?void 0:G()?.outputPrefix??a,_=m&&typeof p=="string",$=v!==w||_?P():Promise.resolve();w=v,Promise.all([$,q(l,p,f),E(h+d.write(typeof p=="string"?Buffer.from(p,f):p)+(_?`
8
+ `:""))]).then(()=>u()).catch(u)},final(p){P().then(()=>p()).catch(p)}}),A=p=>b.destroy(p);return l.on("error",A),b.on("error",p=>r(p)),b.once("close",()=>{l.off("error",A)}),i.add(b),b},flush:()=>Promise.allSettled([...i].map(l=>vt(l))),close:async()=>{try{await vt(n),e&&!e.destroyed&&await q(e,"")}finally{e?.off("error",r)}}}}var re=class extends tr{contexts=[];constructor(e){super({...e,write:(o,r,n)=>{N(this.contexts.shift()??{},()=>e.write.call(this,o,r,n))}})}write(e,o,r){return this.contexts.push(G()),typeof o=="string"?super.write(e,o,r):super.write(e,o??r)}end(e,o,r){return e!=null&&typeof e!="function"&&this.contexts.push(G()),typeof e=="function"?super.end(e):typeof o=="string"?super.end(e,o,r):super.end(e,o??r)}};async function q(t,e,o="utf8"){await new Promise((r,n)=>{t.write(e,o,s=>s?n(s):r())})}async function vt(t){let e=rr(t,{cleanup:!0});t.end(),await e}var St=se(Dt());import oe,{readFileSync as ir}from"fs";import{mkdir as sr,rmdir as ar,writeFile as lr}from"fs/promises";var ne="dev_instance_already_running",cr="dev",mr=15e3;function dr(t){let e=L(t.directory,".shopify",cr),o=pr(t);return{folder:e,infoFile:L(e,`${o}.json`),lockFile:L(e,`${o}.lock`),logFile:L(e,`${o}.jsonl`)}}async function fr(t){let e=dr(t);await lt(t.directory),await me(e.folder);let o=`${e.lockFile}.acquire`;try{await sr(o,{mode:448})}catch(r){if(r.code!=="EEXIST")throw r;let n=new k(`Another \`shopify ${t.command}\` is starting, or a previous startup was interrupted.`,"Wait for other starts to finish. If none is running, remove the startup lock below and try again.",[["Startup lock",{filePath:o}]]);throw n.code=ne,n}try{return await hr(t,e)}catch(r){if(!ur(r))throw r;let n=await At(e.infoFile);throw It(t,n&&Et(n.pid)?n:void 0)}finally{await ar(o)}}async function Pt(t,e){let o=await fr(t);try{return await e(o)}finally{await o.release()}}async function hr(t,e){let o=await At(e.infoFile);if(o&&Et(o.pid))throw It(t,o);let r=ue(),n=new AbortController,s=!1,i=()=>{if(s)return!1;try{return JSON.parse(ir(e.infoFile,"utf8")).sessionId===r}catch{return!1}},c=!1,l=f=>{if(!(c&&!i()))try{oe.rmdirSync(f)}catch(u){if(u.code!=="ENOENT")throw u}},a={realpath:!1,lockfilePath:e.lockFile,stale:mr,retries:0,onCompromised:f=>{s=!0,S(`The ${t.command} instance lock was compromised: ${f.message}`),n.abort(new k(`The ${t.command} instance lost its lock.`,"Start the command again."))},fs:{...oe,rmdir:(f,u)=>{if(c&&!i())return u(null);oe.rmdir(f,u)},rmdirSync:l}};o&&await he(e.lockFile,{force:!0});let m=await St.default.lock(e.infoFile,a),d=C(new Date),h={schemaVersion:1,sessionId:r,command:t.command,...t.key?{key:t.key}:{},pid:process.pid,status:"starting",startedAt:d,updatedAt:d,directory:t.directory,logFile:e.logFile,details:{...t.details??{}}},w=Promise.resolve(),E=!1,P=bt({logFile:e.logFile,logOutput:t.logOutput,isActive:()=>!E&&!s,onError:f=>n.abort(f)}),b,A=()=>{!E&&i()&&(l(e.lockFile),fe(e.infoFile))};process.once("exit",A);let p={info:h,paths:e,abortSignal:n.signal,update:async f=>{if(b||s)return;f.status&&(h.status=f.status),f.details&&(h.details={...h.details,...f.details}),h.updatedAt=C(new Date);let u={...h,details:{...h.details}},v=w.then(async()=>{s||await kt(e.infoFile,u)});w=v.catch(()=>{}),await v},log:P.log,tee:P.tee,release:()=>(b??=(async()=>{try{let u=(await P.flush()).find(v=>v.status==="rejected");if(await w,u?.status==="rejected")throw u.reason}finally{E=!0,process.removeListener("exit",A);try{await P.close()}finally{let f=i();await m().catch(u=>S(`Failed to release the dev instance lock: ${u.message}`)),f&&await J(e.infoFile).catch(()=>{})}}})(),b)};try{return await P.opened,await kt(e.infoFile,h),c=!0,p}catch(f){throw await p.release().catch(u=>S(u.message)),await J(`${e.infoFile}.${r}.tmp`),f}}function Et(t){if(!Number.isInteger(t)||t<=0)return!1;try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}async function At(t){try{let e=JSON.parse(await ce(t));return typeof e?.pid=="number"?e:void 0}catch{return}}async function kt(t,e){let o=`${t}.${e.sessionId}.tmp`;await lr(o,`${JSON.stringify(e,null,2)}
9
+ `,{mode:384}),await Ft(o,t)}async function Ft(t,e,o=5){try{await de(t,e)}catch(r){let n=r?.code;if(process.platform!=="win32"||o===0||!["EPERM","EACCES","EBUSY"].includes(n??""))throw r;await Fe(.1),await Ft(t,e,o-1)}}function ur(t){return t?.code==="ELOCKED"}function pr({command:t,key:e}){let o=[t,e].filter(Boolean).join("-").toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,""),r=H(JSON.stringify([t,e??""])).slice(0,4);return`${o}-${r}`}function It(t,e){let o=`shopify ${t.command}`;if(!e){let i=new k(`Another \`${o}\` is starting for this project.`,"Wait a few seconds and try again, or stop the other process first.");return i.code=ne,i}let r=process.platform==="win32"?`taskkill /PID ${e.pid} /F`:`kill ${e.pid}`,n=Object.entries(e.details).filter(([,i])=>typeof i=="string"||typeof i=="number"||typeof i=="boolean").map(([i,c])=>[i,String(c)]),s=new k(`Another \`${o}\` is already running for this project.`,"Use the running instance, or stop it before starting a new one.",[["Read its output in",{filePath:e.logFile}],["Stop it with",{command:r}]],[{body:{tabularData:[["PID",String(e.pid)],["Started",e.startedAt],...n],firstColumnSubdued:!0}}]);return s.code=ne,s.details={instance:e},s}import wr from"readline";var yr="127.0.0.1",gr=9292,Tt=!1;async function Ot(t){!await st(t.directory)&&!await Je(t.force)||(t.password?.startsWith("shpat_")&&z({headline:"Admin API token missing features:",body:["Directly using an Admin API token will result in some missing features.","We recommend generating a password from the Theme Access app.","Alternatively, you can authenticate normally by not passing the --password flag.",`
10
+ `,{list:{title:"Known limitations:",items:["Hot module reloading","Password protected storefronts"]}}],link:{label:"Theme Access app",url:"https://shopify.dev/docs/storefronts/themes/tools/theme-access"}}),t.listing&&await nt(t.directory,t.listing),await Pt({command:"theme dev",directory:t.directory,key:`${t.store}:${t.theme.id}`,logOutput:t.json?process.stdout:void 0,details:{store:t.store,themeId:t.theme.id,themeName:t.theme.name,listing:t.listing}},async e=>{let o=new AbortController,r=()=>o.abort(),n=()=>o.abort(e.abortSignal.reason);process.on("shopify:signal",r),process.on("SIGINT",r),process.on("SIGTERM",r),e.abortSignal.addEventListener("abort",n,{once:!0});try{await dt(e,()=>vr(t,e,o).catch(s=>{if(!o.signal.aborted||s!==o.signal.reason)throw s}),t.json),e.abortSignal.throwIfAborted()}finally{o.abort(),process.off("shopify:signal",r),process.off("SIGINT",r),process.off("SIGTERM",r),e.abortSignal.removeEventListener("abort",n)}}),await br(t.commandConfig,t.adminSession),process.exit(0))}async function vr(t,e,o){let{signal:r}=o,[n,s]=await D(Promise.all([qe(t.adminSession),je(t.adminSession)]),r),i=s?await D(Ue(t.storePassword,t.adminSession.storeFqdn,n),r):void 0;if(r.aborted)return;let c=tt(),l=it(t.directory,{filters:t,listing:t.listing,noDelete:t.noDelete,notify:t.notify,signal:r}),a=t.host??yr,m;if(t.port){if(!await D(Ge(t.port),r))throw new k(`Port ${t.port} is not available. Try a different port or remove the --port flag to use an available port.`);m=t.port}else m=await D(Ne(gr),r);let d={local:`http://${a}:${m}`,giftCard:`http://${a}:${m}/gift_cards/[store_id]/preview`,themeEditor:`https://${t.store}/admin/themes/${t.theme.id}/editor?hr=${m}`,preview:`https://${t.store}/?preview_theme_id=${t.theme.id}`};await e.update({details:{host:a,port:m,urls:d}}),r.throwIfAborted();let h=await D(xe(t.theme.id.toString(),t.adminSession,t.password,i,n,r),r);if(r.aborted)return;let w={signal:r,session:h,localThemeFileSystem:l,localThemeExtensionFileSystem:c,directory:t.directory,type:"theme",lastRequestedPath:"",options:{themeEditorSync:t["theme-editor-sync"],reconciliationStrategy:t.reconciliationStrategy,host:a,port:m,open:t.open,liveReload:t["live-reload"],standardEventsDevBundle:!0,standardEventsInspector:t["standard-events-inspector"],noDelete:t.noDelete,ignore:t.ignore,only:t.only,errorOverlay:t["error-overlay"]}},{serverStart:E,serverStop:P,workPromise:b,renderDevSetupProgress:A,backgroundJobPromise:p}=gt(t.theme,w),f=!t.json&&Ie(),u=kr(d,w,()=>o.abort()),{promise:v,resolve:_}=Promise.withResolvers(),$=()=>_();r.addEventListener("abort",$,{once:!0});try{f&&(wr.emitKeypressEvents(process.stdin),process.stdin.on("keypress",u));let Lt=async()=>{await A(),!r.aborted&&(await E(),!r.aborted&&(f&&process.stdin.setRawMode(!0),Pr(d),t.open&&Ct(d.local,"development server"),await b,!r.aborted&&await e.update({status:"running"})))};await Promise.race([Promise.all([p,Lt()]),v])}finally{o.abort(),r.removeEventListener("abort",$),process.stdin.off("keypress",u),f&&process.stdin.setRawMode(!1),await P()}}function D(t,e){let{promise:o,reject:r}=Promise.withResolvers(),n=()=>r(e.reason);return e.addEventListener("abort",n,{once:!0}),e.aborted&&n(),Promise.race([t,o]).finally(()=>e.removeEventListener("abort",n))}async function br(t,e){if(!Tt){Tt=!0;try{await ge(()=>({store_fqdn_hash:H(e.storeFqdn)})),await ve(()=>({store_fqdn:e.storeFqdn})),await ye({config:t,exitMode:"ok"})}catch{}}}function kr(t,e,o){let r=be(Ct,100,{leading:!0,trailing:!1});return(n,s)=>{if(s.ctrl&&s.name==="c"){o();return}switch(s.name){case void 0:break;case"t":r(t.local,"localhost");break;case"p":r(t.preview,"theme preview");break;case"e":r(e.lastRequestedPath==="/"?t.themeEditor:`${t.themeEditor}&previewPath=${encodeURIComponent(e.lastRequestedPath)}`,"theme editor");break;case"g":r(t.giftCard,"gift card preview");break;default:break}}}function Ct(t,e){Ae(t).catch(Sr(e))}function Sr(t){return e=>{z({headline:`Failed to open ${t}.`,body:e.stack??e.message})}}function Pr(t){Se({body:[{list:{title:I.bold("Preview your theme ")+I.cyan("(t)"),items:[{link:{url:t.local}}]}}],nextSteps:[[{link:{label:`Share your theme preview ${I.cyan("(p)")}`,url:t.preview}},{subdued:t.preview}],[{link:{label:`Customize your theme at the theme editor ${I.cyan("(e)")}`,url:t.themeEditor}}],[{link:{label:`Preview your gift cards ${I.cyan("(g)")}`,url:t.giftCard}}]]})}var g=se(Rt(),1);var ie=class extends Me{static get requiresSyncAnalytics(){return!0}static summary="Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.";static descriptionWithMarkdown=`
11
+ Uploads the current theme as the specified theme, or a [development theme](https://shopify.dev/docs/themes/tools/cli#development-themes), to a store so you can preview it.
12
+
13
+ This command returns the following information:
14
+
15
+ - A link to your development theme at http://127.0.0.1:9292. This URL can hot reload local changes to CSS and sections, or refresh the entire page when a file changes, enabling you to preview changes in real time using the store's data.
16
+
17
+ You can specify a different network interface and port using \`--host\` and \`--port\`.
18
+
19
+ - A link to the [editor](https://shopify.dev/docs/themes/tools/online-editor) for the theme in the Shopify admin.
20
+
21
+ - A [preview link](https://help.shopify.com/manual/online-store/themes/adding-themes#share-a-theme-preview-with-others) that you can share with other developers.
22
+
23
+ If you already have a development theme for your current environment, then this command replaces the development theme with your local theme. You can override this using the \`--theme-editor-sync\` flag.
24
+
25
+ > Note: You can't preview checkout customizations using http://127.0.0.1:9292.
26
+
27
+ Development themes are deleted when you run \`shopify auth logout\`. If you need a preview link that can be used after you log out, then you should [share](https://shopify.dev/docs/api/shopify-cli/theme/theme-share) your theme or [push](https://shopify.dev/docs/api/shopify-cli/theme/theme-push) to an unpublished theme on your store.
28
+
29
+ You can run this command only in a directory that matches the [default Shopify theme folder structure](https://shopify.dev/docs/themes/tools/cli#directory-structure).`;static jsonOutputSchema=x;static description=this.descriptionForHelp();static flags={...Oe,...We,...Ce,host:g.Flags.string({description:"Set which network interface the web server listens on. The default value is 127.0.0.1.",env:"SHOPIFY_FLAG_HOST"}),"live-reload":g.Flags.string({description:`The live reload mode switches the server behavior when a file is modified:
30
+ - hot-reload Hot reloads local changes to CSS and sections (default)
31
+ - full-page Always refreshes the entire page
32
+ - off Deactivate live reload`,default:"hot-reload",options:["hot-reload","full-page","off"],env:"SHOPIFY_FLAG_LIVE_RELOAD"}),"error-overlay":g.Flags.string({description:`Controls the visibility of the error overlay when an theme asset upload fails:
33
+ - silent Prevents the error overlay from appearing.
34
+ - default Displays the error overlay.
35
+ `,options:["silent","default"],default:"default",env:"SHOPIFY_FLAG_ERROR_OVERLAY"}),"theme-editor-sync":g.Flags.boolean({description:"Synchronize Theme Editor updates in the local theme files.",env:"SHOPIFY_FLAG_THEME_EDITOR_SYNC"}),"standard-events-inspector":g.Flags.boolean({description:"Inject the standard events inspector into storefront HTML.",env:"SHOPIFY_FLAG_STANDARD_EVENTS_INSPECTOR",default:!1}),"reconciliation-strategy":g.Flags.string({description:"How to resolve JSON conflicts when --theme-editor-sync is enabled. Use keep-local to keep local files, keep-remote to keep remote files, or abort to fail instead of prompting.",options:["keep-local","keep-remote","abort"],env:"SHOPIFY_FLAG_RECONCILIATION_STRATEGY",dependsOn:["theme-editor-sync"]}),port:Le({description:"Local port to serve theme preview from.",env:"SHOPIFY_FLAG_PORT"}),theme:g.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"}),listing:g.Flags.string({description:"The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.",env:"SHOPIFY_FLAG_LISTING"}),nodelete:g.Flags.boolean({char:"n",description:"Prevents files from being deleted in the remote theme when a file has been deleted locally. This applies to files that are deleted while the command is running, and files that have been deleted locally before the command is run.",env:"SHOPIFY_FLAG_NODELETE"}),only:g.Flags.string({char:"o",multiple:!0,description:"Hot reload only files that match the specified pattern.",env:"SHOPIFY_FLAG_ONLY"}),ignore:g.Flags.string({char:"x",multiple:!0,description:"Skip hot reloading any files that match the specified pattern.",env:"SHOPIFY_FLAG_IGNORE"}),force:g.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"}),notify:g.Flags.string({description:"The file path or URL. The file path is to a file that you want updated on idle. The URL path is where you want a webhook posted to report on file changes.",env:"SHOPIFY_FLAG_NOTIFY"}),open:g.Flags.boolean({description:"Automatically launch the theme preview in your default web browser.",env:"SHOPIFY_FLAG_OPEN",default:!1}),"store-password":g.Flags.string({description:"The password for storefronts with password protection.",env:"SHOPIFY_FLAG_STORE_PASSWORD"}),"allow-live":g.Flags.boolean({description:"Allow development on a live theme.",char:"a",env:"SHOPIFY_FLAG_ALLOW_LIVE",default:!1})};static multiEnvironmentsFlags=null;async command(e,o){let{ignore:r=[],only:n=[]}=e;W("theme-command:dev:single-env:authenticated");let s,i;if(e.theme){let l={filter:{theme:e.theme}};s=await Be(o,l),i={...e,theme:s.id.toString(),store:o.storeFqdn}}else{s=await new Ke(o).findOrCreate();let l=e["theme-editor-sync"]&&s.createdAtRuntime;i={...e,theme:s.id.toString(),store:o.storeFqdn,"overwrite-json":l}}await Ve(s,"start development mode",e["allow-live"])&&(await Ot({adminSession:o,commandConfig:this.config,directory:i.path,store:i.store,password:i.password,storePassword:i["store-password"],theme:s,listing:i.listing,host:i.host,port:i.port,"live-reload":i["live-reload"],"error-overlay":i["error-overlay"],force:i.force,open:i.open,"theme-editor-sync":i["theme-editor-sync"],"standard-events-inspector":i["standard-events-inspector"],reconciliationStrategy:i["reconciliation-strategy"],noDelete:i.nodelete,ignore:r,only:n,notify:i.notify,json:i.json}),await ct({path:i.path,password:i.password,store:i.store,force:i.force,verbose:i.verbose,noColor:i["no-color"],silent:!0}))}collectsEnvironmentResults(){return!1}};export{x as a,Pt as b,ie as c};
@@ -4,4 +4,4 @@ import{g as h}from"./chunk-VKWPEFWQ.js";h();h();var kt=String.fromCharCode;var Y
4
4
  `),typeof e.retry=="number"&&Number.isInteger(e.retry)&&(t+=`retry: ${e.retry}
5
5
  `);let r=typeof e.data=="string"?e.data:"";for(let n of r.split(/\r\n|\r|\n/))t+=`data: ${n}
6
6
  `;return t+=`
7
- `,t}function de(e){return e.replace(/[\n\r]/g,"")}function yt(e){let t="";for(let r of e)t+=P(r);return t}function gt(e){let t={"Content-Type":"text/event-stream","Cache-Control":"private, no-cache, no-store, no-transform, must-revalidate, max-age=0","X-Accel-Buffering":"no"};wt(e)||(t.Connection="keep-alive"),ot(e,t)}function wt(e){return ue(e,":path")!==void 0&&ue(e,":method")!==void 0}var W=class{_h3Event;_transformStream=new TransformStream;_writer;_encoder=new TextEncoder;_writerIsClosed=!1;_paused=!1;_unsentData;_disposed=!1;_handled=!1;constructor(t,r={}){this._h3Event=t,this._writer=this._transformStream.writable.getWriter(),this._writer.closed.then(()=>{this._writerIsClosed=!0}),r.autoclose!==!1&&this._h3Event.node.req.on("close",()=>this.close())}async push(t){if(typeof t=="string"){await this._sendEvent({data:t});return}if(Array.isArray(t)){if(t.length===0)return;if(typeof t[0]=="string"){let r=[];for(let n of t)r.push({data:n});await this._sendEvents(r);return}await this._sendEvents(t);return}await this._sendEvent(t)}async _sendEvent(t){if(!this._writerIsClosed){if(this._paused&&!this._unsentData){this._unsentData=P(t);return}if(this._paused){this._unsentData+=P(t);return}await this._writer.write(this._encoder.encode(P(t))).catch()}}async _sendEvents(t){if(this._writerIsClosed)return;let r=yt(t);if(this._paused&&!this._unsentData){this._unsentData=r;return}if(this._paused){this._unsentData+=r;return}await this._writer.write(this._encoder.encode(r)).catch()}pause(){this._paused=!0}get isPaused(){return this._paused}async resume(){this._paused=!1,await this.flush()}async flush(){this._writerIsClosed||this._unsentData?.length&&(await this._writer.write(this._encoder.encode(this._unsentData)),this._unsentData=void 0)}async close(){if(!this._disposed){if(!this._writerIsClosed)try{await this._writer.close()}catch{}this._h3Event._handled&&this._handled&&!this._h3Event.node.res.closed&&this._h3Event.node.res.end(),this._disposed=!0}}onClosed(t){this._writer.closed.then(t)}async send(){gt(this._h3Event),x(this._h3Event,200),this._h3Event._handled=!0,this._handled=!0,await T(this._h3Event,this._transformStream.readable)}};function dr(e,t){return new W(e,t)}async function lr(e,t){if(e.method!=="GET"&&e.method!=="HEAD"){if(!t.fallthrough)throw p({statusMessage:"Method Not Allowed",statusCode:405});return!1}let r=I(k(C(e.path).pathname));if(/(^|[\\/])(\.\.|%2e%2e|%2e\.|\.%2e)($|[\\/])/i.test(r)){if(!t.fallthrough)throw p({statusCode:404});return!1}let n=_t(g(e,"accept-encoding"),t.encodings);n.length>1&&R(e,"vary","accept-encoding");let o=r,s,a=Rt(r,n,t.indexNames||["/index.html"]);for(let c of a){let f=await t.getMeta(c);if(f){s=f,o=c;break}}if(!s){if(!t.fallthrough)throw p({statusCode:404});return!1}if(s.etag&&!A(e,"etag")&&R(e,"etag",s.etag),s.etag&&g(e,"if-none-match")===s.etag)return x(e,304,"Not Modified"),m(e,"");if(s.mtime){let c=new Date(s.mtime),f=g(e,"if-modified-since");if(f&&new Date(f)>=c)return x(e,304,"Not Modified"),m(e,null);A(e,"last-modified")||R(e,"last-modified",c.toUTCString())}if(s.type&&!A(e,"content-type")&&R(e,"content-type",s.type),s.encoding&&!A(e,"content-encoding")&&R(e,"content-encoding",s.encoding),s.size!==void 0&&s.size>0&&!A(e,"content-length")&&R(e,"content-length",s.size),e.method==="HEAD")return m(e,null);let i=await t.getContents(o);return we(i)?T(e,i):m(e,i)}function _t(e,t){return!t||!e?[]:String(e||"").split(",").map(r=>t[r.trim()]).filter(Boolean)}function Rt(e,t,r){let n=[];for(let o of["",...r])for(let s of[...t,""])n.push(`${e}${o}${s}`);return n}var z=class{__is_event__=!0;node;web;context={};_method;_path;_headers;_requestBody;_handled=!1;_onBeforeResponseCalled;_onAfterResponseCalled;constructor(t,r){this.node={req:t,res:r}}get method(){return this._method||(this._method=(this.node.req.method||"GET").toUpperCase()),this._method}get path(){return this._path||this.node.req.url||"/"}get headers(){return this._headers||(this._headers=Et(this.node.req.headers)),this._headers}get handled(){return this._handled||this.node.res.writableEnded||this.node.res.headersSent}respondWith(t){return Promise.resolve(t).then(r=>_e(this,r))}toString(){return`[${this.method}] ${this.path}`}toJSON(){return this.toString()}get req(){return this.node.req}get res(){return this.node.res}};function bt(e,t){return new z(e,t)}function Et(e){let t=new Headers;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let o of n)t.append(r,o);else n&&t.set(r,n);return t}function Ct(e){if(typeof e=="function")return e.__is_handler__=!0,e;let t={onRequest:le(e.onRequest),onBeforeResponse:le(e.onBeforeResponse)},r=n=>At(n,e.handler,t);return r.__is_handler__=!0,r.__resolve__=e.handler.__resolve__,r.__websocket__=e.websocket,r}function le(e){return e?Array.isArray(e)?e:[e]:void 0}async function At(e,t,r){if(r.onRequest){for(let s of r.onRequest)if(await s(e),e.handled)return}let o={body:await t(e)};if(r.onBeforeResponse)for(let s of r.onBeforeResponse)await s(e,o);return o.body}var V=Ct;function St(e){return b(e,"__is_handler__")}function G(e,t,r){return e}function xt(e){let t,r,n=()=>r?Promise.resolve(r):(t||(t=Promise.resolve(e()).then(s=>{let a=s.default||s;if(typeof a!="function")throw new TypeError("Invalid lazy handler result. It should be a function:",a);return r={handler:G(s.default||s)},r})),t),o=V(s=>r?r.handler(s):n().then(a=>a.handler(s)));return o.__resolve__=n,o}var Ht=xt,hr=globalThis.Headers,pr=globalThis.Response;function mr(e={}){let t=[],r=Pt(t,e),n=Nt(t);r.__resolve__=n;let o=Tt(()=>qt(n,e)),s={use:(a,u,i)=>J(s,a,u,i),resolve:n,handler:r,stack:t,options:e,get websocket(){return o()}};return s}function J(e,t,r,n){if(Array.isArray(t))for(let o of t)J(e,o,r,n);else if(Array.isArray(r))for(let o of r)J(e,t,o,n);else typeof t=="string"?e.stack.push(F({...n,route:t,handler:r})):typeof t=="function"?e.stack.push(F({...r,handler:t})):e.stack.push(F({...t}));return e}function Pt(e,t){let r=t.debug?2:void 0;return V(async n=>{n.node.req.originalUrl=n.node.req.originalUrl||n.node.req.url||"/";let o=n.node.req.url||"/",s=Mt(n._path||o);n._path=s;let a=s!==o,u;t.onRequest&&await t.onRequest(n);for(let i of e){if(i.route.length>1){if(!s.startsWith(i.route))continue;u=s.slice(i.route.length)||"/"}else u=s;if(i.match&&!i.match(u,n))continue;n._path=u,n.node.req.url=a?i.route.length>1?o.slice(i.route.length)||"/":o:u;let c=await i.handler(n),f=c===void 0?void 0:await c;if(f!==void 0){let d={body:f};t.onBeforeResponse&&(n._onBeforeResponseCalled=!0,await t.onBeforeResponse(n,d)),await Ot(n,d.body,r),t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,d));return}if(n.handled){t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,void 0));return}}if(!n.handled)throw p({statusCode:404,statusMessage:`Cannot find any path matching ${n.path||"/"}.`});t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,void 0))})}function Nt(e){return async t=>{let r;for(let n of e){if(n.route==="/"&&!n.handler.__resolve__||!t.startsWith(n.route)||(r=t.slice(n.route.length)||"/",n.match&&!n.match(r,void 0)))continue;let o={route:n.route,handler:n.handler};if(o.handler.__resolve__){let s=await o.handler.__resolve__(r);if(!s)continue;o={...o,...s,route:Z(o.route||"/",s.route||"/")}}return o}}}function F(e){let t=e.handler;return t.handler&&(t=t.handler),e.lazy?t=Ht(t):St(t)||(t=G(t,void 0,e.route)),{route:k(e.route),match:e.match,handler:t}}function Ot(e,t,r){if(t===null)return ge(e);if(t){if(it(t))return _e(e,t);if(we(t))return T(e,t);if(t.buffer)return m(e,t);if(t.arrayBuffer&&typeof t.arrayBuffer=="function")return t.arrayBuffer().then(o=>m(e,Buffer.from(o),t.type));if(t instanceof Error)throw p(t);if(typeof t.end=="function")return!0}let n=typeof t;if(n==="string")return m(e,t,S.html);if(n==="object"||n==="boolean"||n==="number")return m(e,JSON.stringify(t,void 0,r),S.json);if(n==="bigint")return m(e,t.toString(),S.json);throw p({statusCode:500,statusMessage:`[h3] Cannot send ${n} as response.`})}function Tt(e){let t;return()=>(t||(t=e()),t)}function Mt(e){let t=e.indexOf("?"),r=t===-1?e:e.slice(0,t),n=t===-1?"":e.slice(t);return(r.includes("%25")?L(r.replace(/%25/g,"%2525")):L(r))+n}function qt(e,t){return{...t.websocket,async resolve(r){let n=r.request?.url||r.url||"/",{pathname:o}=typeof n=="string"?C(n):n;return(await e(o))?.handler?.__websocket__||{}}}}var Lt=["connect","delete","get","head","options","post","put","trace","patch"];function yr(e={}){let t=re({}),r={},n,o={},s=(i,c,f)=>{let d=r[i];if(d||(r[i]=d={path:i,handlers:{}},t.insert(i,d)),Array.isArray(f))for(let l of f)s(i,c,l);else d.handlers[f]=G(c);return o};o.use=o.add=(i,c,f)=>s(i,c,f||"all");for(let i of Lt)o[i]=(c,f)=>o.add(c,f,i);let a=(i="/",c="get")=>{let f=i.indexOf("?");f!==-1&&(i=i.slice(0,Math.max(0,f)));let d=t.lookup(i);if(!d||!d.handlers)return{error:p({statusCode:404,name:"Not Found",statusMessage:`Cannot find any route matching ${i||"/"}.`})};let l=d.handlers[c]||d.handlers.all;if(!l){n||(n=oe(t));let M=n.matchAll(i).reverse();for(let H of M){if(H.handlers[c]){l=H.handlers[c],d.handlers[c]=d.handlers[c]||l;break}if(H.handlers.all){l=H.handlers.all,d.handlers.all=d.handlers.all||l;break}}}return l?{matched:d,handler:l}:{error:p({statusCode:405,name:"Method Not Allowed",statusMessage:`Method ${c} is not allowed on this route.`})}},u=e.preemptive||e.preemtive;return o.handler=V(i=>{let c=a(i.path,i.method.toLowerCase());if("error"in c){if(u)throw c.error;return}i.context.matchedRoute=c.matched;let f=c.matched.params||{};return i.context.params=f,Promise.resolve(c.handler(i)).then(d=>d===void 0&&u?null:d)}),o.handler.__resolve__=async i=>{i=I(i);let c=a(i);if("error"in c)return;let f={route:c.matched.path,handler:c.handler};if(c.handler.__resolve__){let d=await c.handler.__resolve__(i);if(!d)return;f={...f,...d}}return f},o}function gr(e){return async function(r,n){let o=bt(r,n);try{await e.handler(o)}catch(s){let a=p(s);if(Q(s)||(a.unhandled=!0),x(o,a.statusCode,a.statusMessage),e.options.onError&&await e.options.onError(a,o),o.handled)return;(a.unhandled||a.fatal)&&console.error("[h3]",a.fatal?"[fatal]":"[unhandled]",a),e.options.onBeforeResponse&&!o._onBeforeResponseCalled&&await e.options.onBeforeResponse(o,{body:a}),await Ye(o,a,!!e.options.debug),e.options.onAfterResponse&&!o._onAfterResponseCalled&&await e.options.onAfterResponse(o,{body:a})}}}export{p as a,Ye as b,rr as c,nr as d,he as e,g as f,or as g,sr as h,ar as i,ir as j,m as k,x as l,cr as m,R as n,ur as o,fr as p,dr as q,lr as r,Ct as s,xt as t,mr as u,yr as v,gr as w};
7
+ `,t}function de(e){return e.replace(/[\n\r]/g,"")}function yt(e){let t="";for(let r of e)t+=P(r);return t}function gt(e){let t={"Content-Type":"text/event-stream","Cache-Control":"private, no-cache, no-store, no-transform, must-revalidate, max-age=0","X-Accel-Buffering":"no"};wt(e)||(t.Connection="keep-alive"),ot(e,t)}function wt(e){return ue(e,":path")!==void 0&&ue(e,":method")!==void 0}var W=class{_h3Event;_transformStream=new TransformStream;_writer;_encoder=new TextEncoder;_writerIsClosed=!1;_paused=!1;_unsentData;_disposed=!1;_handled=!1;constructor(t,r={}){this._h3Event=t,this._writer=this._transformStream.writable.getWriter(),this._writer.closed.then(()=>{this._writerIsClosed=!0}),r.autoclose!==!1&&this._h3Event.node.req.on("close",()=>this.close())}async push(t){if(typeof t=="string"){await this._sendEvent({data:t});return}if(Array.isArray(t)){if(t.length===0)return;if(typeof t[0]=="string"){let r=[];for(let n of t)r.push({data:n});await this._sendEvents(r);return}await this._sendEvents(t);return}await this._sendEvent(t)}async _sendEvent(t){if(!this._writerIsClosed){if(this._paused&&!this._unsentData){this._unsentData=P(t);return}if(this._paused){this._unsentData+=P(t);return}await this._writer.write(this._encoder.encode(P(t))).catch()}}async _sendEvents(t){if(this._writerIsClosed)return;let r=yt(t);if(this._paused&&!this._unsentData){this._unsentData=r;return}if(this._paused){this._unsentData+=r;return}await this._writer.write(this._encoder.encode(r)).catch()}pause(){this._paused=!0}get isPaused(){return this._paused}async resume(){this._paused=!1,await this.flush()}async flush(){this._writerIsClosed||this._unsentData?.length&&(await this._writer.write(this._encoder.encode(this._unsentData)),this._unsentData=void 0)}async close(){if(!this._disposed){if(!this._writerIsClosed)try{await this._writer.close()}catch{}this._h3Event._handled&&this._handled&&!this._h3Event.node.res.closed&&this._h3Event.node.res.end(),this._disposed=!0}}onClosed(t){this._writer.closed.then(t)}async send(){gt(this._h3Event),x(this._h3Event,200),this._h3Event._handled=!0,this._handled=!0,await T(this._h3Event,this._transformStream.readable)}};function dr(e,t){return new W(e,t)}async function lr(e,t){if(e.method!=="GET"&&e.method!=="HEAD"){if(!t.fallthrough)throw p({statusMessage:"Method Not Allowed",statusCode:405});return!1}let r=I(k(C(e.path).pathname));if(/(^|[\\/])(\.\.|%2e%2e|%2e\.|\.%2e)($|[\\/])/i.test(r)){if(!t.fallthrough)throw p({statusCode:404});return!1}let n=_t(g(e,"accept-encoding"),t.encodings);n.length>1&&R(e,"vary","accept-encoding");let o=r,s,a=Rt(r,n,t.indexNames||["/index.html"]);for(let c of a){let f=await t.getMeta(c);if(f){s=f,o=c;break}}if(!s){if(!t.fallthrough)throw p({statusCode:404});return!1}if(s.etag&&!A(e,"etag")&&R(e,"etag",s.etag),s.etag&&g(e,"if-none-match")===s.etag)return x(e,304,"Not Modified"),m(e,"");if(s.mtime){let c=new Date(s.mtime),f=g(e,"if-modified-since");if(f&&new Date(f)>=c)return x(e,304,"Not Modified"),m(e,null);A(e,"last-modified")||R(e,"last-modified",c.toUTCString())}if(s.type&&!A(e,"content-type")&&R(e,"content-type",s.type),s.encoding&&!A(e,"content-encoding")&&R(e,"content-encoding",s.encoding),s.size!==void 0&&s.size>0&&!A(e,"content-length")&&R(e,"content-length",s.size),e.method==="HEAD")return m(e,null);let i=await t.getContents(o);return we(i)?T(e,i):m(e,i)}function _t(e,t){return!t||!e?[]:String(e||"").split(",").map(r=>t[r.trim()]).filter(Boolean)}function Rt(e,t,r){let n=[];for(let o of["",...r])for(let s of[...t,""])n.push(`${e}${o}${s}`);return n}var z=class{__is_event__=!0;node;web;context={};_method;_path;_headers;_requestBody;_handled=!1;_onBeforeResponseCalled;_onAfterResponseCalled;constructor(t,r){this.node={req:t,res:r}}get method(){return this._method||(this._method=(this.node.req.method||"GET").toUpperCase()),this._method}get path(){return this._path||this.node.req.url||"/"}get headers(){return this._headers||(this._headers=Et(this.node.req.headers)),this._headers}get handled(){return this._handled||this.node.res.writableEnded||this.node.res.headersSent}respondWith(t){return Promise.resolve(t).then(r=>_e(this,r))}toString(){return`[${this.method}] ${this.path}`}toJSON(){return this.toString()}get req(){return this.node.req}get res(){return this.node.res}};function bt(e,t){return new z(e,t)}function Et(e){let t=new Headers;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let o of n)t.append(r,o);else n&&t.set(r,n);return t}function Ct(e){if(typeof e=="function")return e.__is_handler__=!0,e;let t={onRequest:le(e.onRequest),onBeforeResponse:le(e.onBeforeResponse)},r=n=>At(n,e.handler,t);return r.__is_handler__=!0,r.__resolve__=e.handler.__resolve__,r.__websocket__=e.websocket,r}function le(e){return e?Array.isArray(e)?e:[e]:void 0}async function At(e,t,r){if(r.onRequest){for(let s of r.onRequest)if(await s(e),e.handled)return}let o={body:await t(e)};if(r.onBeforeResponse)for(let s of r.onBeforeResponse)await s(e,o);return o.body}var V=Ct;function St(e){return b(e,"__is_handler__")}function G(e,t,r){return e}function xt(e){let t,r,n=()=>r?Promise.resolve(r):(t||(t=Promise.resolve(e()).then(s=>{let a=s.default||s;if(typeof a!="function")throw new TypeError("Invalid lazy handler result. It should be a function:",a);return r={handler:G(s.default||s)},r})),t),o=V(s=>r?r.handler(s):n().then(a=>a.handler(s)));return o.__resolve__=n,o}var Ht=xt,hr=globalThis.Headers,pr=globalThis.Response;function mr(e={}){let t=[],r=Pt(t,e),n=Nt(t);r.__resolve__=n;let o=Tt(()=>qt(n,e)),s={use:(a,u,i)=>J(s,a,u,i),resolve:n,handler:r,stack:t,options:e,get websocket(){return o()}};return s}function J(e,t,r,n){if(Array.isArray(t))for(let o of t)J(e,o,r,n);else if(Array.isArray(r))for(let o of r)J(e,t,o,n);else typeof t=="string"?e.stack.push(F({...n,route:t,handler:r})):typeof t=="function"?e.stack.push(F({...r,handler:t})):e.stack.push(F({...t}));return e}function Pt(e,t){let r=t.debug?2:void 0;return V(async n=>{n.node.req.originalUrl=n.node.req.originalUrl||n.node.req.url||"/";let o=n.node.req.url||"/",s=Mt(n._path||o);n._path=s;let a=s!==o,u;t.onRequest&&await t.onRequest(n);for(let i of e){if(i.route.length>1){if(!s.startsWith(i.route))continue;u=s.slice(i.route.length)||"/"}else u=s;if(i.match&&!i.match(u,n))continue;n._path=u,n.node.req.url=a?i.route.length>1?o.slice(i.route.length)||"/":o:u;let c=await i.handler(n),f=c===void 0?void 0:await c;if(f!==void 0){let d={body:f};t.onBeforeResponse&&(n._onBeforeResponseCalled=!0,await t.onBeforeResponse(n,d)),await Ot(n,d.body,r),t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,d));return}if(n.handled){t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,void 0));return}}if(!n.handled)throw p({statusCode:404,statusMessage:`Cannot find any path matching ${n.path||"/"}.`});t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,void 0))})}function Nt(e){return async t=>{let r;for(let n of e){if(n.route==="/"&&!n.handler.__resolve__||!t.startsWith(n.route)||(r=t.slice(n.route.length)||"/",n.match&&!n.match(r,void 0)))continue;let o={route:n.route,handler:n.handler};if(o.handler.__resolve__){let s=await o.handler.__resolve__(r);if(!s)continue;o={...o,...s,route:Z(o.route||"/",s.route||"/")}}return o}}}function F(e){let t=e.handler;return t.handler&&(t=t.handler),e.lazy?t=Ht(t):St(t)||(t=G(t,void 0,e.route)),{route:k(e.route),match:e.match,handler:t}}function Ot(e,t,r){if(t===null)return ge(e);if(t){if(it(t))return _e(e,t);if(we(t))return T(e,t);if(t.buffer)return m(e,t);if(t.arrayBuffer&&typeof t.arrayBuffer=="function")return t.arrayBuffer().then(o=>m(e,Buffer.from(o),t.type));if(t instanceof Error)throw p(t);if(typeof t.end=="function")return!0}let n=typeof t;if(n==="string")return m(e,t,S.html);if(n==="object"||n==="boolean"||n==="number")return m(e,JSON.stringify(t,void 0,r),S.json);if(n==="bigint")return m(e,t.toString(),S.json);throw p({statusCode:500,statusMessage:`[h3] Cannot send ${n} as response.`})}function Tt(e){let t;return()=>(t||(t=e()),t)}function Mt(e){let t=e.indexOf("?"),r=t===-1?e:e.slice(0,t),n=t===-1?"":e.slice(t);return(r.includes("%25")?L(r.replace(/%25/g,"%2525")):L(r))+n}function qt(e,t){return{...t.websocket,async resolve(r){let n=r.request?.url||r.url||"/",{pathname:o}=typeof n=="string"?C(n):n;return(await e(o))?.handler?.__websocket__||{}}}}var Lt=["connect","delete","get","head","options","post","put","trace","patch"];function yr(e={}){let t=re({}),r={},n,o={},s=(i,c,f)=>{let d=r[i];if(d||(r[i]=d={path:i,handlers:{}},t.insert(i,d)),Array.isArray(f))for(let l of f)s(i,c,l);else d.handlers[f]=G(c);return o};o.use=o.add=(i,c,f)=>s(i,c,f||"all");for(let i of Lt)o[i]=(c,f)=>o.add(c,f,i);let a=(i="/",c="get")=>{let f=i.indexOf("?");f!==-1&&(i=i.slice(0,Math.max(0,f)));let d=t.lookup(i);if(!d||!d.handlers)return{error:p({statusCode:404,name:"Not Found",statusMessage:`Cannot find any route matching ${i||"/"}.`})};let l=d.handlers[c]||d.handlers.all;if(!l){n||(n=oe(t));let M=n.matchAll(i).reverse();for(let H of M){if(H.handlers[c]){l=H.handlers[c],d.handlers[c]=d.handlers[c]||l;break}if(H.handlers.all){l=H.handlers.all,d.handlers.all=d.handlers.all||l;break}}}return l?{matched:d,handler:l}:{error:p({statusCode:405,name:"Method Not Allowed",statusMessage:`Method ${c} is not allowed on this route.`})}},u=e.preemptive||e.preemtive;return o.handler=V(i=>{let c=a(i.path,i.method.toLowerCase());if("error"in c){if(u)throw c.error;return}i.context.matchedRoute=c.matched;let f=c.matched.params||{};return i.context.params=f,Promise.resolve(c.handler(i)).then(d=>d===void 0&&u?null:d)}),o.handler.__resolve__=async i=>{i=I(i);let c=a(i);if("error"in c)return;let f={route:c.matched.path,handler:c.handler};if(c.handler.__resolve__){let d=await c.handler.__resolve__(i);if(!d)return;f={...f,...d}}return f},o}function gr(e){return async function(r,n){let o=bt(r,n);try{await e.handler(o)}catch(s){let a=p(s);if(Q(s)||(a.unhandled=!0),x(o,a.statusCode,a.statusMessage),e.options.onError&&await e.options.onError(a,o),o.handled)return;(a.unhandled||a.fatal)&&console.error("[h3]",a.fatal?"[fatal]":"[unhandled]",a),e.options.onBeforeResponse&&!o._onBeforeResponseCalled&&await e.options.onBeforeResponse(o,{body:a}),await Ye(o,a,!!e.options.debug),e.options.onAfterResponse&&!o._onAfterResponseCalled&&await e.options.onAfterResponse(o,{body:a})}}}export{p as a,Ye as b,Q as c,rr as d,nr as e,he as f,g,or as h,sr as i,ar as j,ir as k,m as l,x as m,cr as n,R as o,ur as p,fr as q,dr as r,lr as s,Ct as t,xt as u,mr as v,yr as w,gr as x};
@@ -0,0 +1 @@
1
+ import{a as d}from"./chunk-HT5JQJMB.js";import{a as p,b as m}from"./chunk-CZYQIWNL.js";import{d as r,j as c}from"./chunk-6B5KM3A4.js";import{a as s}from"./chunk-R5COVIJM.js";import{P as a}from"./chunk-7FBOMPO5.js";import{c as n}from"./chunk-IKXUYCK7.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class u extends s{static summary="Schedules manual-billing subscriptions to migrate to Shopify-managed app pricing.";static descriptionWithMarkdown="Schedules manual-billing subscriptions to migrate to Shopify-managed app pricing.\n\nWhen `--input` is omitted, the command reads CSV data from stdin. Use `--input <path>` to read from a file. `--input -` is also supported as an explicit stdin path.\n\n- Required CSV columns: `shop_id`, `target_plan_handle`, and `price_behavior`.\n- Optional CSV column: `notification`.\n- Example header: `shop_id,target_plan_handle,price_behavior,notification`.\n- Example row: `123456789,pro,HONOR_BILLING_PRICE,WHEN_REQUIRED`.\n\n`price_behavior` must be `HONOR_BILLING_PRICE` or `PLAN_PRICE`. `notification` can be `OPT_OUT` or `WHEN_REQUIRED` and defaults to `WHEN_REQUIRED` when omitted or blank.\n\nValidation is atomic: the command submits no operations unless the entire CSV is valid. Valid rows are submitted in batches of 250 shops. Preserve every operation GID printed by the command so you can check or cancel the submitted operations.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.\n\nUse `--force` to skip confirmation and immediately submit every valid row. With `--watch`, human-readable output shows accepted identifiers before polling begins, then displays operation progress and the final outcome. With `--json --watch`, the command outputs one structured JSON document after every operation reaches a terminal status.";static jsonOutputSchema=c;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --input migrations.csv --force","cat migrations.csv | <%= config.bin %> <%= command.id %> --force","<%= config.bin %> <%= command.id %> --input migrations.csv --path ../my-app --config staging --force --json","<%= config.bin %> <%= command.id %> --input migrations.csv --client-id <client-id> --force","<%= config.bin %> <%= command.id %> --input - --force --watch"];static flags={...r,...n};async run(){let{flags:i}=await this.parse(u),{app:l,remoteApp:h}=await a({directory:i.path,clientId:i["client-id"],forceRelink:i.reset,userProvidedConfigName:i.config}),f=await d({action:"schedule",input:i.input??"-",clientId:h.apiKey,skipConfirmation:i.force,watch:i.watch,...i.watch&&!i.json?{onSubmissionAccepted:p}:{}}),e=m(f,{json:i.json,watch:i.watch});return e!==0&&(process.exitCode=e),{app:l}}};export{t as a};
@@ -0,0 +1 @@
1
+ import{a as d}from"./chunk-HT5JQJMB.js";import{a as p,b as m}from"./chunk-CZYQIWNL.js";import{d as r,j as c}from"./chunk-6B5KM3A4.js";import{a as s}from"./chunk-R5COVIJM.js";import{P as a}from"./chunk-7FBOMPO5.js";import{c as n}from"./chunk-IKXUYCK7.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class u extends s{static summary="Reverses app subscription migrations that are still scheduled.";static descriptionWithMarkdown="Reverses scheduled app subscription migrations that have not migrated yet.\n\nWhen `--input` is omitted, the command reads CSV data from stdin. Use `--input <path>` to read from a file. `--input -` is also supported as an explicit stdin path.\n\n- Required CSV header: `shop_id`.\n- Example row: `123456789`.\n\nThe CSV can contain only the `shop_id` header, or it can reuse the complete CSV supplied to `schedule`; schedule-only columns are ignored.\n\nUnscheduling is not a rollback after a subscription has migrated. The command validates the entire CSV before sending any mutation. Use `--force` to skip confirmation and immediately submit every valid row.\n\nOperations are submitted in batches of 250 shops. Preserve every operation GID printed by the command so you can check or cancel the submitted operations. With `--watch`, human-readable output shows accepted identifiers before polling begins, then displays operation progress and the final outcome. With `--json --watch`, the command outputs one structured JSON document after every operation reaches a terminal status.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static jsonOutputSchema=c;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --input migrations.csv --force","cat migrations.csv | <%= config.bin %> <%= command.id %> --force","<%= config.bin %> <%= command.id %> --input migrations.csv --path ../my-app --config staging --force --json","<%= config.bin %> <%= command.id %> --input migrations.csv --client-id <client-id> --force","<%= config.bin %> <%= command.id %> --input - --force --watch"];static flags={...r,...n};async run(){let{flags:t}=await this.parse(u),{app:h,remoteApp:l}=await a({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),f=await d({action:"unschedule",input:t.input??"-",clientId:l.apiKey,skipConfirmation:t.force,watch:t.watch,...t.watch&&!t.json?{onSubmissionAccepted:p}:{}}),i=m(f,{json:t.json,watch:t.watch});return i!==0&&(process.exitCode=i),{app:h}}};export{e as a};
@@ -0,0 +1,3 @@
1
+ import{Ab as S,Hb as d,db as E,sb as h}from"./chunk-OIQ5NQ5I.js";import{b as _}from"./chunk-VBPMVVLV.js";import{d as m}from"./chunk-IWTNUJGY.js";import{e as I,g as i}from"./chunk-VKWPEFWQ.js";i();i();i();var L=new Set(["THROTTLED","429"]),C=new Set(["ACCESS_DENIED","access_denied"]),P=new Set(["INTERNAL_SERVER_ERROR"]);function g(e){return Array.isArray(e)?e.flatMap(t=>{let s=[],n=t,o=n?.extensions?.code;typeof o=="string"&&s.push(o);let r=n?.extensions?.app_errors?.errors;if(Array.isArray(r))for(let p of r){let l=p?.category;typeof l=="string"&&s.push(l)}return s}):[]}function b(e){return e!==void 0&&L.has(e)}function B(e){return e!==void 0&&C.has(e)}function v(e){return e!==void 0&&P.has(e)}function y(e){return g(e).some(b)}function j(e){return g(e).some(v)}i();var N=new Set([502,503,504,520,521,522,523,524]);function x(e){return e!==void 0&&N.has(e)}i();var w="Log in with a different account";var O=I(_(),1),a;(function(e){e[e.Abort=0]="Abort",e[e.AbortSilent=1]="AbortSilent",e[e.Bug=2]="Bug"})(a||(a={}));var R=class extends Error{},c=class extends Error{tryMessage;type;nextSteps;formattedMessage;customSections;code;details;skipOclifErrorHandling;constructor(t,s,n=null,o,r){let p=typeof t=="string"||"value"in t;super(p?d(t):E(t)),n?n instanceof h?this.tryMessage=d(n):this.tryMessage=n:this.tryMessage=null,this.type=s,this.nextSteps=o,this.customSections=r,this.skipOclifErrorHandling=!0,p||(this.formattedMessage=t)}},f=class extends c{constructor(t,s=null,n,o){super(t,a.Abort,s,n,o)}},A=class extends f{constructor(t){let s="This action requires you to log in with a secure method, like a passkey or two-step authentication.";super(t?`${s}
2
+
3
+ Request ID: ${t}`:s,`Set up a passkey or two-step authentication for your Shopify account if you haven't already, sign out of Shopify in your browser, then run \`shopify auth login\` and select '${w}'.`),this.code="MFA_REQUIRED"}},k=class extends c{command;args;constructor(t,s,n,o=null){super(t,a.Abort,o),this.command=s,this.args=n}},M=class extends c{constructor(){super("",a.AbortSilent)}},u=class extends c{constructor(t,s=null){super(t,a.Bug,s)}};async function K(e){let t;if(T(e))t=e;else if(typeof e=="string")t=new u(e);else if(e instanceof Error)t=new u(e.message),t.stack=e.stack;else{let r=e;t=new u(r?.message??"Unknown error"),r?.stack&&(t.stack=r?.stack)}let{jsonOutputEnabled:s}=await import("./environment-5P7JJ3GI.js"),{commandEventOutputMode:n}=await import("./command-event-context-ILIANB5Q.js");if((n()??(s()?"json":"text"))==="json"){let{renderFatalErrorAsJson:r}=await import("./json-error-HGCRNJRF.js");return r(t),await S(),e}let{renderFatalError:o}=await import("./ui-YMBFS3NG.js");return o(t),Promise.resolve(e)}function X(e){if(e instanceof O.Errors.CLIError){let t=new f(e.message);return t.stack=e.stack,Promise.resolve(t)}else return Promise.resolve(e)}function T(e){try{return Object.prototype.hasOwnProperty.call(e,"type")}catch{return!1}}function ee(e){if(!T(e)){if(e instanceof Error){if(D(e))return!1;let t=e.message;return!U(t)}return!0}return e.type===a.Bug}function D(e){let t=e;if(typeof t.response!="object"||t.response===null||t.request===void 0)return!1;let s=t.response.status;return s===401||s===429||x(s)?!0:y(t.response.errors)}function te(e){return m(e).replace("file:/","/").replace(/^\/?[A-Z]:/,"")}function U(e){return["EPERM: operation not permitted, scandir","EPERM: operation not permitted, rename","EACCES: permission denied","EPERM: operation not permitted, symlink","This version of npm supports the following node versions","EBUSY: resource busy or locked","ENOTEMPTY: directory not empty","getaddrinfo ENOTFOUND","Client network socket disconnected before secure TLS connection was established","spawn EPERM","socket hang up","The user aborted a request.","write EPIPE","Unsupported platform"].some(n=>e.includes(n))}export{g as a,b,B as c,j as d,x as e,w as f,a as g,R as h,c as i,f as j,A as k,k as l,M as m,u as n,K as o,X as p,ee as q,te as r};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-TAWCKJKP.js";import{b as e}from"./chunk-ZJOX5HW4.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static description="View the UI kit components prompts";static hidden=!0;async run(){await i()}};export{t as a};
1
+ import{a as i}from"./chunk-MKUXSM33.js";import{b as e}from"./chunk-PSREELSQ.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static description="View the UI kit components prompts";static hidden=!0;async run(){await i()}};export{t as a};
@@ -0,0 +1 @@
1
+ import{R as u}from"./chunk-7A4ZE5IS.js";import{Bb as s}from"./chunk-OIQ5NQ5I.js";import{k as i}from"./chunk-3PYDIBTX.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();import{Writable as m}from"node:stream";import{StringDecoder as f}from"node:string_decoder";function p(){return i()!=="json"?{stdout:process.stdout,stderr:process.stderr}:{stdout:c(),stderr:c()}}function c(){let o=new f("utf8");return new m({write(r,e,t){let n=o.write(r);n&&s(n),t()},final(r){let e=o.end();e&&s(e),r()}})}async function y(o,r,e={}){let t=p();try{await u(o,r,{...e,...t.stdout===process.stdout?{stdio:"inherit"}:{stdin:"inherit",...t}})}finally{t.stdout!==process.stdout&&t.stdout.end(),t.stderr!==process.stderr&&t.stderr.end()}}export{p as a,y as b};
@@ -1 +1 @@
1
- import{b as t}from"./chunk-FZCGRIOM.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var c=t.object({status:t.literal("success")});export{c as a};
1
+ import{b as t}from"./chunk-3PYDIBTX.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var c=t.object({status:t.literal("success")});export{c as a};
@@ -1 +1 @@
1
- import{a as h,b as w}from"./chunk-2T4HDR6R.js";import{j as f}from"./chunk-GQLNG537.js";import{U as d}from"./chunk-D2KIGKBI.js";import{h as i}from"./chunk-M5VIFG2V.js";import{Fa as m,ma as p}from"./chunk-JLQRDFR5.js";import{c as u}from"./chunk-IWTNUJGY.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();import{writeFile as g}from"fs/promises";var S=1024*1024,y=100,U=y*S,E=3,_=new Set([408,429,500,502,503,504]);async function j(o,e){let t=u(e,"manifest.json");await g(t,JSON.stringify(o,null,2))}var A=["!**/*.js.map","!**/*.metafile.json"];async function k(o,e,t){let n=t??["**/*",...A];e.endsWith(".br")?await w({inputDirectory:o,outputPath:e,matchFilePattern:n}):await h({inputDirectory:o,outputZipPath:e,matchFilePattern:n})}async function C(o,e){let t=await m(e);if(t>U){let s=`${(Math.ceil(t/S*100)/100).toFixed(2)} MB`;throw new i(`Your app bundle exceeds the ${y} MB upload limit (it is ${s}).`,"Check the asset paths in your extension configuration \u2014 a misconfigured source can pull in much more than intended. Exclude large files or directories from your bundle, then try again.")}let n=p(e),r;for(let s=1;s<=E;s++){if(r=await f(o,{method:"put",body:n},"slow-request"),r.ok)return;let T=s===E;if(_.has(r.status)&&!T){await r.text().catch(()=>{}),await d(2**s*.1);continue}break}let a=r?.status,c=(await r?.text().catch(()=>""))?.trim();throw new i(`Failed to upload your app bundle to storage${a?` (HTTP ${a})`:""}.`,"This is usually transient. Please try again, and check your network connection if it persists.",c?[`Storage responded with: ${c.slice(0,300)}`]:void 0)}async function D(o,e){let t=await o.generateSignedUploadUrl(e);if(!t.assetUrl||t.userErrors?.length>0){let n=t.userErrors.map(r=>r.message).join(", ");throw new i(n)}return t.assetUrl}export{j as a,A as b,k as c,C as d,D as e};
1
+ import{a as h,b as w}from"./chunk-L23Q53FM.js";import{p as f}from"./chunk-UORSJB4A.js";import{S as d}from"./chunk-7A4ZE5IS.js";import{j as i}from"./chunk-FJOVMEPN.js";import{Fa as m,ma as p}from"./chunk-OIQ5NQ5I.js";import{c as u}from"./chunk-IWTNUJGY.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();import{writeFile as g}from"fs/promises";var S=1024*1024,y=100,U=y*S,E=3,_=new Set([408,429,500,502,503,504]);async function j(o,e){let t=u(e,"manifest.json");await g(t,JSON.stringify(o,null,2))}var A=["!**/*.js.map","!**/*.metafile.json"];async function k(o,e,t){let n=t??["**/*",...A];e.endsWith(".br")?await w({inputDirectory:o,outputPath:e,matchFilePattern:n}):await h({inputDirectory:o,outputZipPath:e,matchFilePattern:n})}async function C(o,e){let t=await m(e);if(t>U){let s=`${(Math.ceil(t/S*100)/100).toFixed(2)} MB`;throw new i(`Your app bundle exceeds the ${y} MB upload limit (it is ${s}).`,"Check the asset paths in your extension configuration \u2014 a misconfigured source can pull in much more than intended. Exclude large files or directories from your bundle, then try again.")}let n=p(e),r;for(let s=1;s<=E;s++){if(r=await f(o,{method:"put",body:n},"slow-request"),r.ok)return;let T=s===E;if(_.has(r.status)&&!T){await r.text().catch(()=>{}),await d(2**s*.1);continue}break}let a=r?.status,c=(await r?.text().catch(()=>""))?.trim();throw new i(`Failed to upload your app bundle to storage${a?` (HTTP ${a})`:""}.`,"This is usually transient. Please try again, and check your network connection if it persists.",c?[`Storage responded with: ${c.slice(0,300)}`]:void 0)}async function D(o,e){let t=await o.generateSignedUploadUrl(e);if(!t.assetUrl||t.userErrors?.length>0){let n=t.userErrors.map(r=>r.message).join(", ");throw new i(n)}return t.assetUrl}export{j as a,A as b,k as c,C as d,D as e};
@@ -1 +1 @@
1
- import{s as r,t as a}from"./chunk-MHR5OHT5.js";import{z as p}from"./chunk-D2KIGKBI.js";import{a as u}from"./chunk-BN7ZXAZJ.js";import{wb as n}from"./chunk-JLQRDFR5.js";import{b as o}from"./chunk-FZCGRIOM.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();function l(){return{enabled:r()}}function f(t){return a(t),{enabled:t}}e();var d=u({name:"AutoUpgradeResult",schema:o.object({enabled:o.boolean()}).strict()});e();function S(t,m){if(m==="json"){n(d.encode({enabled:t.enabled}));return}p({body:t.enabled?"Auto-upgrade on. Shopify CLI will update automatically after each command.":"Auto-upgrade off. You'll need to run `shopify upgrade` to update manually."})}export{l as a,f as b,d as c,S as d};
1
+ import{s as r,t as a}from"./chunk-CE6XQDAG.js";import{x as p}from"./chunk-7A4ZE5IS.js";import{a as u}from"./chunk-LG3KEHGD.js";import{zb as n}from"./chunk-OIQ5NQ5I.js";import{b as o}from"./chunk-3PYDIBTX.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();function l(){return{enabled:r()}}function f(t){return a(t),{enabled:t}}e();var d=u({name:"AutoUpgradeResult",schema:o.object({enabled:o.boolean()}).strict()});e();function S(t,m){if(m==="json"){n(d.encode({enabled:t.enabled}));return}p({body:t.enabled?"Auto-upgrade on. Shopify CLI will update automatically after each command.":"Auto-upgrade off. You'll need to run `shopify upgrade` to update manually."})}export{l as a,f as b,d as c,S as d};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-PLSS456F.js";import{a as t}from"./chunk-XUHGWIWW.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var a=class extends t{static hidden=!0;static flags={...t.flags};static baseFlags={...t.baseFlags};async run(){return r({from:"app import-custom-data-definitions",to:"app import custom-data-definitions"}),super.run()}};export{a};
1
+ import{a as r}from"./chunk-DKR7562G.js";import{a as t}from"./chunk-EEYXBKR7.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var a=class extends t{static hidden=!0;static flags={...t.flags};static baseFlags={...t.baseFlags};async run(){return r({from:"app import-custom-data-definitions",to:"app import custom-data-definitions"}),super.run()}};export{a};
@@ -0,0 +1,6 @@
1
+ import{b as e,c as r,d as p}from"./chunk-G7JO3W2R.js";import{b as o}from"./chunk-PSREELSQ.js";import{b as s,c as i}from"./chunk-IKXUYCK7.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
+
3
+ When auto-upgrade is disabled, Shopify CLI won't automatically update. Run \`shopify upgrade\` to update manually.
4
+
5
+ To enable auto-upgrade, run \`shopify config autoupgrade on\`.
6
+ `;static jsonOutputSchema=r;static description=this.descriptionForHelp();static flags={...s,...i};async run(){let{flags:n}=await this.parse(u),m=e(!1);p(m,n.json?"json":"text")}};export{t as a};
@@ -0,0 +1 @@
1
+ import{a as f,b as h}from"./chunk-5S2P4MHJ.js";import{f as d,k as u,r as l}from"./chunk-6B5KM3A4.js";import{a as m}from"./chunk-R5COVIJM.js";import{P as c}from"./chunk-7FBOMPO5.js";import{c as p}from"./chunk-IKXUYCK7.js";import{j as s}from"./chunk-FJOVMEPN.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();e();async function g({clientId:a,operationIds:t,getOperation:n=l}){return Promise.all(t.map(async i=>{let o=await n({clientId:a,operationId:i});if(!o)throw new s(`Migration operation not found: ${i}`);return o}))}var r=class a extends m{static summary="Checks the status of app subscription migration operations.";static descriptionWithMarkdown="Checks app subscription migration operation status.\n\nRepeat `--id` for every operation GID returned by a multi-batch submission. With `--watch`, the command displays the current state while polling and outputs the final state after all requested operations reach a terminal status.\n\n`RUNNING` means an operation is still processing. `COMPLETED` means processing finished, but you must inspect the per-shop results to confirm each outcome. `FAILED` means the operation failed, and `CANCELED` means cancellation stopped further processing.\n\nUse `--json` to output every operation and its per-shop results as structured JSON.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static jsonOutputSchema=u;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --id <operation-id>","<%= config.bin %> <%= command.id %> --path ../my-app --config staging --id <operation-id-1> --id <operation-id-2> --watch","<%= config.bin %> <%= command.id %> --client-id <client-id> --id <operation-id> --json"];static flags={...d,...p};async run(){let{flags:t}=await this.parse(a),{app:n,remoteApp:i}=await c({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o=t.watch?await h({clientId:i.apiKey,operationIds:t.id}):await g({clientId:i.apiKey,operationIds:t.id});return f(o,t.json),{app:n}}};export{r as a};
@@ -1 +1 @@
1
- import{a as e}from"./chunk-PLSS456F.js";import{a}from"./chunk-3MG4MTWQ.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var r=class extends a{static hidden=!0;static flags={...a.flags};static baseFlags={...a.baseFlags};async run(){return e({from:"app import-extensions",to:"app import dashboard-extensions"}),super.run()}};export{r as a};
1
+ import{a as e}from"./chunk-DKR7562G.js";import{a}from"./chunk-HQFXVVTB.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var r=class extends a{static hidden=!0;static flags={...a.flags};static baseFlags={...a.baseFlags};async run(){return e({from:"app import-extensions",to:"app import dashboard-extensions"}),super.run()}};export{r as a};
@@ -1 +1 @@
1
- import{c as m,d as f,e as u}from"./chunk-3JSKNXL7.js";import{d as c,f as w,j as T}from"./chunk-H6GYBLVQ.js";import{g as d}from"./chunk-YKMINHYY.js";import{G as s}from"./chunk-D2KIGKBI.js";import{h as l}from"./chunk-M5VIFG2V.js";import{T as i}from"./chunk-JLQRDFR5.js";import{g as h}from"./chunk-VKWPEFWQ.js";h();async function q(e,r){let n=await m(e),t=new u(r.filter),a=e.storeFqdn;if(t.any())return f(a,n,t)[0];let y=r.header??"",p=n.map(o=>{let S=o.id.toString()===d()?" [current]":"";return{value:async()=>o,label:`${o.name}${S}`,group:i(o.role)}});return r.create&&p.unshift(g(e)),(await s({message:y,choices:p}))()}async function B(e,r){return(await m(e)).find(t=>t.id.toString()===r)}async function C(e,r){let n=await m(e),t=new u(r),a=e.storeFqdn;return t.any()?f(a,n,t):[]}function g(e){return{value:async()=>{let r=c,n=await w("Name of the new theme"),t=await T({name:n,role:r},e);if(!t)throw new l("The theme could not be created.");return{...t,createdAtRuntime:!0}},label:"[Create a new theme]",group:i(c)}}export{q as a,B as b,C as c};
1
+ import{c as m,d as f,e as u}from"./chunk-ZLITAXPT.js";import{d as c,f as w,j as T}from"./chunk-RSNFNZ6F.js";import{g as d}from"./chunk-VVHJ2AUF.js";import{E as s}from"./chunk-7A4ZE5IS.js";import{j as l}from"./chunk-FJOVMEPN.js";import{T as i}from"./chunk-OIQ5NQ5I.js";import{g as h}from"./chunk-VKWPEFWQ.js";h();async function q(e,r){let n=await m(e),t=new u(r.filter),a=e.storeFqdn;if(t.any())return f(a,n,t)[0];let y=r.header??"",p=n.map(o=>{let S=o.id.toString()===d()?" [current]":"";return{value:async()=>o,label:`${o.name}${S}`,group:i(o.role)}});return r.create&&p.unshift(g(e)),(await s({message:y,choices:p}))()}async function B(e,r){return(await m(e)).find(t=>t.id.toString()===r)}async function C(e,r){let n=await m(e),t=new u(r),a=e.storeFqdn;return t.any()?f(a,n,t):[]}function g(e){return{value:async()=>{let r=c,n=await w("Name of the new theme"),t=await T({name:n,role:r},e);if(!t)throw new l("The theme could not be created.");return{...t,createdAtRuntime:!0}},label:"[Create a new theme]",group:i(c)}}export{q as a,B as b,C as c};
@@ -1 +1 @@
1
- import{a as N}from"./chunk-CGVROSPS.js";import{a as J,b as L}from"./chunk-YY6TFARF.js";import{a as V}from"./chunk-2L6AN3QA.js";import{a as O,b as F,d,e as x,f as C,g as a,h as R}from"./chunk-QFWWCZOI.js";import{f as j,g as E,p as w,v as D}from"./chunk-YKMINHYY.js";import{ua as h,xa as g}from"./chunk-GQLNG537.js";import{b as S,c as b}from"./chunk-3KM5ZOW2.js";import{z as u}from"./chunk-D2KIGKBI.js";import{c as _}from"./chunk-GW7YIJPJ.js";import{h as I}from"./chunk-M5VIFG2V.js";import{wb as c}from"./chunk-JLQRDFR5.js";import{b as o}from"./chunk-FZCGRIOM.js";import{b as U}from"./chunk-YTUUU33R.js";import{e as P,g as i}from"./chunk-VKWPEFWQ.js";i();i();function G(t,e){return{theme:{id:t.id,name:t.name,role:t.role,shop:e.storeFqdn,preview_url:J(t,e),editor_url:L(t,e)}}}function $(t){let{platform:e,arch:n}=_(),r=j(),m=r?E():void 0,s=Number(m)||null;return{result:{store:r??"Not configured",development_theme_id:s,cli_version:t.cliVersion,os:`${e}-${n}`,shell:process.env.SHELL??"unknown",node_version:process.version},developmentTheme:m}}async function y(t,e){let n;if(e.development)n=await new N(t).findOrCreate();else{let r={filter:{theme:e.theme}};n=await V(t,r)}return n?G(n,t):void 0}i();i();var Y=o.object({id:o.number(),name:o.string(),role:o.string(),shop:o.string(),preview_url:o.string(),editor_url:o.string()}),q=o.object({theme:Y}),z=o.object({store:o.string(),development_theme_id:o.number().nullable(),cli_version:o.string(),os:o.string(),shell:o.string(),node_version:o.string()}),K=o.union([q,z]),A=o.object({storeDomain:F,developmentThemeId:O.nullable(),cliVersion:o.string(),os:o.string(),shell:o.string().nullable(),nodeVersion:o.string()}).strict(),l=x({name:"ThemeInfoResult",schema:o.union([o.object({theme:d}).strict(),A]),definitions:{Theme:d,ThemeEnvironmentInfo:A},project(t){let e=K.parse(t);return"theme"in e?{theme:{...R(e.theme),storeDomain:a(e.theme.shop),previewUrl:e.theme.preview_url,editorUrl:e.theme.editor_url}}:{storeDomain:a(e.store),developmentThemeId:e.development_theme_id===null?null:C(e.development_theme_id),cliVersion:e.cli_version,os:e.os,shell:e.shell==="unknown"?null:e.shell,nodeVersion:e.node_version}}});function p(t,e,n={}){if(e==="json"){c(l.encode(t));return}"theme"in t?u(W(t,n)):u({customSections:B(t,n)})}function W(t,e){let n=Object.entries(t.theme).map(([r,m])=>{if(r==="editor_url"||r==="preview_url"){let s=String(m),H=r==="editor_url"?"Open in Theme Editor":"Preview Theme";return[f(r),{link:{url:s,label:H}}]}return r==="id"?[f(r),`#${m}`]:[f(r),`${m}`]});return{customSections:[...e.environment?[{title:"Theme information",body:[{subdued:`Environment name: ${e.environment}`}]}]:[],{title:"Theme Details",body:{tabularData:n,firstColumnSubdued:!0}}]}}function B(t,e){let n=Object.hasOwn(e,"developmentTheme")?e.developmentTheme:t.development_theme_id;return g(`theme-command:info:dev-theme-loaded:${n}`),[M("Theme Configuration",[["Store",t.store],["Development Theme ID",n?`#${n}`:{subdued:"Not set"}]]),M("Tooling and System",[["Shopify CLI",t.cli_version],["OS",t.os],["Shell",t.shell],["Node version",t.node_version]])]}function M(t,e){return{title:t,body:{tabularData:e,firstColumnSubdued:!0}}}function f(t){return t.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var v=P(U(),1);var T=class extends D{static get jsonOutputSchema(){return l}static descriptionWithMarkdown="Displays information about your theme environment, including your current store. Can also retrieve information about a specific theme.";static description=this.descriptionForHelp();static flags={...S,...b,...w,development:v.Flags.boolean({char:"d",description:"Retrieve info from your development theme.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),theme:v.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"})};static multiEnvironmentsFlags=["store","password"];async command(e,n,r=!1){if(h("theme-command:info"),e.theme||e.development){let m=await y(n,e);if(!m)throw new I("Theme not found!");if(e.json&&r)return h("theme-command:info"),m;p(m,e.json?"json":"text",e)}else{let{result:m,developmentTheme:s}=$({cliVersion:this.config.version});if(e.json&&r)return h("theme-command:info"),m;p(m,e.json?"json":"text",{developmentTheme:s})}h("theme-command:info")}renderEnvironmentResults(e){c(l.encode({environments:e}))}};export{T as a};
1
+ import{a as N}from"./chunk-7AQZKPJU.js";import{a as J,b as L}from"./chunk-YY6TFARF.js";import{a as V}from"./chunk-GQ3LY7BY.js";import{a as O,b as F,d as u,e as x,f as C,g as a,h as R}from"./chunk-7HECBXSP.js";import{f as j,g as E,p as w,v as D}from"./chunk-VVHJ2AUF.js";import{Ea as h,Ha as I}from"./chunk-UORSJB4A.js";import{b,c as g}from"./chunk-IKXUYCK7.js";import{x as d}from"./chunk-7A4ZE5IS.js";import{c as _}from"./chunk-RNF6T6IO.js";import{j as S}from"./chunk-FJOVMEPN.js";import{zb as c}from"./chunk-OIQ5NQ5I.js";import{b as o}from"./chunk-3PYDIBTX.js";import{b as U}from"./chunk-VBPMVVLV.js";import{e as P,g as i}from"./chunk-VKWPEFWQ.js";i();i();function G(t,e){return{theme:{id:t.id,name:t.name,role:t.role,shop:e.storeFqdn,preview_url:J(t,e),editor_url:L(t,e)}}}function $(t){let{platform:e,arch:n}=_(),r=j(),m=r?E():void 0,s=Number(m)||null;return{result:{store:r??"Not configured",development_theme_id:s,cli_version:t.cliVersion,os:`${e}-${n}`,shell:process.env.SHELL??"unknown",node_version:process.version},developmentTheme:m}}async function y(t,e){let n;if(e.development)n=await new N(t).findOrCreate();else{let r={filter:{theme:e.theme}};n=await V(t,r)}return n?G(n,t):void 0}i();i();var Y=o.object({id:o.number(),name:o.string(),role:o.string(),shop:o.string(),preview_url:o.string(),editor_url:o.string()}),q=o.object({theme:Y}),z=o.object({store:o.string(),development_theme_id:o.number().nullable(),cli_version:o.string(),os:o.string(),shell:o.string(),node_version:o.string()}),K=o.union([q,z]),A=o.object({storeDomain:F,developmentThemeId:O.nullable(),cliVersion:o.string(),os:o.string(),shell:o.string().nullable(),nodeVersion:o.string()}).strict(),l=x({name:"ThemeInfoResult",schema:o.union([o.object({theme:u}).strict(),A]),definitions:{Theme:u,ThemeEnvironmentInfo:A},project(t){let e=K.parse(t);return"theme"in e?{theme:{...R(e.theme),storeDomain:a(e.theme.shop),previewUrl:e.theme.preview_url,editorUrl:e.theme.editor_url}}:{storeDomain:a(e.store),developmentThemeId:e.development_theme_id===null?null:C(e.development_theme_id),cliVersion:e.cli_version,os:e.os,shell:e.shell==="unknown"?null:e.shell,nodeVersion:e.node_version}}});function p(t,e,n={}){if(e==="json"){c(l.encode(t));return}"theme"in t?d(W(t,n)):d({customSections:B(t,n)})}function W(t,e){let n=Object.entries(t.theme).map(([r,m])=>{if(r==="editor_url"||r==="preview_url"){let s=String(m),H=r==="editor_url"?"Open in Theme Editor":"Preview Theme";return[f(r),{link:{url:s,label:H}}]}return r==="id"?[f(r),`#${m}`]:[f(r),`${m}`]});return{customSections:[...e.environment?[{title:"Theme information",body:[{subdued:`Environment name: ${e.environment}`}]}]:[],{title:"Theme Details",body:{tabularData:n,firstColumnSubdued:!0}}]}}function B(t,e){let n=Object.hasOwn(e,"developmentTheme")?e.developmentTheme:t.development_theme_id;return I(`theme-command:info:dev-theme-loaded:${n}`),[M("Theme Configuration",[["Store",t.store],["Development Theme ID",n?`#${n}`:{subdued:"Not set"}]]),M("Tooling and System",[["Shopify CLI",t.cli_version],["OS",t.os],["Shell",t.shell],["Node version",t.node_version]])]}function M(t,e){return{title:t,body:{tabularData:e,firstColumnSubdued:!0}}}function f(t){return t.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var v=P(U(),1);var T=class extends D{static jsonOutputSchema=l;static descriptionWithMarkdown="Displays information about your theme environment, including your current store. Can also retrieve information about a specific theme.";static description=this.descriptionForHelp();static flags={...b,...g,...w,development:v.Flags.boolean({char:"d",description:"Retrieve info from your development theme.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),theme:v.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"})};static multiEnvironmentsFlags=["store","password"];async command(e,n,r=!1){if(h("theme-command:info"),e.theme||e.development){let m=await y(n,e);if(!m)throw new S("Theme not found!");if(e.json&&r)return h("theme-command:info"),m;p(m,e.json?"json":"text",e)}else{let{result:m,developmentTheme:s}=$({cliVersion:this.config.version});if(e.json&&r)return h("theme-command:info"),m;p(m,e.json?"json":"text",{developmentTheme:s})}h("theme-command:info")}renderEnvironmentResults(e){c(l.encode({environments:e}))}};export{T as a};
@@ -0,0 +1,9 @@
1
+ import{V as g,W as X,a as J,ha as Q,ja as y,ka as ee,sa as te,ta as qe,wa as I,x as P,ya as oe}from"./chunk-UORSJB4A.js";import{b as ne}from"./chunk-ZDF5N422.js";import{C as ae,D as re,E as se,H as ce,I as le,S as pe,y as ie}from"./chunk-7A4ZE5IS.js";import{f as Z}from"./chunk-2KFYIYLI.js";import{e as K}from"./chunk-QBRRFFMZ.js";import{a as q}from"./chunk-LG3KEHGD.js";import{j as c,n as ue}from"./chunk-FJOVMEPN.js";import{N as G,T,Va as Y,vb as z,zb as de}from"./chunk-OIQ5NQ5I.js";import{i as U}from"./chunk-B4OMIONW.js";import{b as t}from"./chunk-3PYDIBTX.js";import{c as B,i as D}from"./chunk-IWTNUJGY.js";import{e as je,g as r}from"./chunk-VKWPEFWQ.js";r();function Bt(e,{httpsOnly:n=!1,message:o="Invalid URL"}={}){return e.refine(i=>F(i,n),{message:o}).refine(i=>!i.includes(`
2
+ `),{message:o})}function Gt(e,{message:n="URL must be HTTPS URL or start with /"}={}){return e.refine(o=>o.startsWith("/")||F(o,!0),{message:n})}var me=/[\r\n\t]/;function fe(e){return F(e,!0)}function F(e,n){try{let o=new URL(e);return n?o.protocol==="https:":["http:","https:"].includes(o.protocol)}catch{return!1}}function Yt(e){return typeof e=="string"&&!e.startsWith("/")?`/${e}`:e}var Be=30;function Kt(e){return e.length<=Be}r();function $(e){let n=e.match(/\/(\d+)$/);return n?n[1]:void 0}function he(e){return $(Buffer.from(e,"base64").toString("utf8"))}function ge(e){return Buffer.from(e).toString("base64")}r();async function V(e){if(e.length===1)return e[0];let o=new Set(e.map(a=>a.businessName)).size<e.length,i=await se({message:"Which organization do you want to use?",choices:e.map(a=>({label:o?`${a.businessName} (${a.id})`:a.businessName,value:a.id}))});return e.find(a=>a.id===i)}r();var Ge=["ACTIVE","LOCKED"];r();r();r();var W={basic:"BASIC_APP_DEVELOPMENT",grow:"PROFESSIONAL_APP_DEVELOPMENT",advanced:"UNLIMITED_APP_DEVELOPMENT",plus:"SHOPIFY_PLUS_APP_DEVELOPMENT"},v=Object.keys(W);r();r();var N=t.object({id:t.string(),name:t.string(),subdomain:t.string(),country:t.string().optional(),type:t.string().optional(),authScopes:t.array(t.string()).optional(),plan:t.string().optional(),organizationId:t.string(),organizationName:t.string()}),C=t.object({id:t.string(),name:t.string()});var Se=N.pick({name:!0}).extend({domain:N.shape.subdomain,adminUrl:t.string().nullish(),plan:t.enum(v),featurePreview:t.string().optional(),country:N.shape.country,demoData:t.boolean()}),H=q({name:"CreateDevStoreResult",schema:t.object({store:Se,organization:C}),definitions:{CreatedDevStore:Se,StoreOrganization:C}});r();var ke={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"country"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopName"},value:{kind:"Variable",name:{kind:"Name",value:"shopName"}}},{kind:"Argument",name:{kind:"Name",value:"priceLookupKey"},value:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}}},{kind:"Argument",name:{kind:"Name",value:"prepopulateTestData"},value:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}}},{kind:"Argument",name:{kind:"Name",value:"developerPreviewHandle"},value:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}}},{kind:"Argument",name:{kind:"Name",value:"country"},value:{kind:"Variable",name:{kind:"Name",value:"country"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopAdminUrl"}},{kind:"Field",name:{kind:"Name",value:"shopDomain"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};r();var ve={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PollStoreCreation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"storeCreation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopDomain"},value:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};r();function b(e={}){return{type:"token_refresh",handler:async()=>({token:await g([],{noPrompt:e.noPrompt,allowAutomationToken:!0})})}}function Ye(e){if(typeof e!="object"||e===null)return!1;let{statusCode:n,response:o}=e,i=n??o?.status;return i===401||i===403}var R=class extends c{constructor(n){let o=n.businessName??`organization ${n.id}`,i="in your organization's settings in the Shopify admin";X()?super(`This service account can't manage dev stores in ${o}.`,null,[`Give the service account Dev store management access ${i}.`,"Or use a token from a service account that has that access."]):Z()?super(`This automation token can't manage dev stores in ${o}.`,null,[`Create a service account with Dev store management access ${i}.`,"Set its token in the SHOPIFY_SERVICE_ACCOUNT_TOKEN environment variable."]):super(`You don't have permission to manage dev stores in ${o}.`,null,["Check that you're logged in to the right account.","Or ask an organization admin for access."])}};async function E(e,n){try{return await oe({...n,organizationId:e.id})}catch(o){throw Ye(o)?new R(e):o}}var Ke=2,Ze=300*1e3;function Je(e){switch(e){case"CALLING_CORE":return"Initiating store creation";case"AWAITING_CORE_STORE_READY":return"Waiting for store to be ready";case"FINALIZING":return"Finalizing store setup";case"COMPLETE":return"Store creation complete!";case"FAILED":return"Store creation failed.";case"TIMED_OUT":return"Store creation timed out.";case"USER_ERROR":return"Store creation encountered a user error.";default:return`Store creation status: ${e}`}}async function Xe(e){let{organization:n,name:o,plan:i}=e,a=await g([],{allowAutomationToken:!0}),s=b(),u=(await E(n,{query:ke,token:a,variables:{shopName:o,priceLookupKey:W[i],prepopulateTestData:e.withDemoData??!1,developerPreviewHandle:e.featurePreview,country:e.country},unauthorizedHandler:s})).createAppDevelopmentStore;if(!u)throw new c("Store creation failed: unexpected empty response.");let d=u.userErrors;if(d&&d.length>0){let p=d.map(k=>k.message).join(", ");throw new c(`Failed to create dev store: ${p}`)}let{shopDomain:m,shopAdminUrl:S}=u;if(!m)throw new c("Store creation succeeded but no shop domain was returned.");if(await ce({title:z`Waiting for store to be ready`,task:async p=>{let k=Date.now(),A=!1;for(;;){if(Date.now()-k>Ze)throw A?new c("Store creation timed out after 5 minutes."):new c("Store creation timed out after 5 minutes without reporting a status.",null,[`Check whether ${m} was created with \`shopify store list\` before trying again.`]);let f=(await E(n,{query:ve,token:a,variables:{shopDomain:m},unauthorizedHandler:s})).organization?.storeCreation?.status;if(f){if(A=!0,f==="COMPLETE")return;if(f==="FAILED"||f==="TIMED_OUT"||f==="USER_ERROR")throw new c(`Store creation failed with status: ${f}`)}p(z`${f?Je(f):"Waiting for store creation to start"}`),await pe(Ke)}},renderOptions:{stdout:process.stderr}}),e.json)de(H.encode({store:{name:o,domain:m,adminUrl:S,plan:i,...e.featurePreview?{featurePreview:e.featurePreview}:{},...e.country?{country:e.country}:{},demoData:e.withDemoData??!1},organization:{id:n.id,name:n.businessName}}));else if(e.summary!==!1){let p=[];x(p,"Domain",m),p.push(["Admin",S?{link:{label:S,url:S}}:"N/A"]),x(p,"Plan",i),x(p,"Feature preview",e.featurePreview),x(p,"Country",e.country),x(p,"Demo data",e.withDemoData?"enabled":"disabled"),ie({headline:`Dev store "${o}" created successfully.`,customSections:[{body:{tabularData:p,firstColumnSubdued:!0}}]})}return m}function x(e,n,o){o!=null&&o!==""&&e.push([n,o])}var Qe={basic:"Basic",grow:"Grow",advanced:"Advanced",plus:"Plus"};function et(){return le({message:"Name for the new dev store"})}function tt(){return ae({message:"Which Shopify plan do you want to use?",choices:v.map(e=>({label:Qe[e],value:e}))})}function nt(){return re({message:"Populate the store with demo data?",confirmationMessage:"Yes, add demo data",cancellationMessage:"No, start with an empty store",defaultValue:!0})}r();r();r();var be={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindOrganization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OrganizationID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};r();var _e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListOrganizations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"organizationsWithAccessToDestination"},arguments:[{kind:"Argument",name:{kind:"Name",value:"destination"},value:{kind:"EnumValue",value:"APPS_CLI"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"shopCount"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};async function M(){return(await ye()).organizations}async function ot(e){return ye(e)}async function it(e,n,o){let i=n??await g([],{allowAutomationToken:!0}),s=(await I({query:be,token:i,variables:{organizationId:at(e)},unauthorizedHandler:o??b(),cacheOptions:{cacheTTL:{hours:6},cacheExtraKey:K(i)}})).currentUserAccount?.organization;if(s)return{id:e,businessName:s.name}}function at(e){let n=e.startsWith("gid://")?$(e):e;if(n===void 0||!/^\d+$/.test(n))throw new c(`Invalid organization ID: ${e}`);return ge(`gid://organization/Organization/${n}`)}async function ye(e){let n=e??await g([],{allowAutomationToken:!0}),o=await I({query:_e,token:n,unauthorizedHandler:b()});return o.currentUserAccount?{organizations:o.currentUserAccount.organizationsWithAccessToDestination.nodes.map(a=>{let s=he(a.id);if(s===void 0)throw new c(`Failed to decode organization ID from: ${a.id}`);return{id:s,businessName:a.name,status:a.status,shopCount:a.shopCount??null,url:a.url}}),currentUserResolved:!0}:{organizations:[],currentUserResolved:!1}}r();async function rt(e){let n=await M();if(n.length===0)throw new c("No organizations found.","Make sure you have access to a Shopify organization.");if(e){let o=n.find(i=>i.id===e);if(!o)throw new c(`Organization with ID ${e} not found.`,`Available organizations: ${n.map(i=>`${i.businessName} (${i.id})`).join(", ")}`);return o}return V(n)}r();var _o={skipEsbuildReactDedeuplication:"SHOPIFY_CLI_SKIP_ESBUILD_REACT_DEDUPLICATION",disableGraphiQLExplorer:"SHOPIFY_CLI_DISABLE_GRAPHIQL",useDynamicConfigSpecifications:"SHOPIFY_CLI_DYNAMIC_CONFIG",enableAppLogPolling:"SHOPIFY_CLI_ENABLE_APP_LOG_POLLING",templatesJsonPath:"SHOPIFY_CLI_APP_TEMPLATES_JSON_PATH",mkcertBinaryPath:"SHOPIFY_CLI_MKCERT_BINARY",disableMinificationOnDev:"SHOPIFY_CLI_DISABLE_MINIFICATION_ON_DEV",appClientSecret:"SHOPIFY_CLI_APP_CLIENT_SECRET"},st={app:"shopify.app.toml",web:"shopify.web.toml",appEnvironments:"shopify.environments.toml",lockFile:".shopify.lock",hiddenConfig:"project.json",hiddenFolder:".shopify"},yo={production:".env"},No={reactTypes:"17.0.30"},Ne={extensions:{directoryName:"extensions",defaultRegistrationLimit:1},web:{directoryName:"web",configurationName:st.web}},xo={graphiql:3457,localhost:3458},wo=/^([a-zA-Z_$])([a-zA-Z0-9_$])*$/;r();var xe=50,we=250,ct=t.object({namespace:t.string(),key:t.string(),owner_type:t.string().optional()}),lt=t.object({sms_marketing:t.boolean().optional(),customer_privacy:t.boolean().optional()}),ut=t.object({sources:t.array(t.string()).optional()}),pt=t.object({network_access:t.boolean().optional(),block_progress:t.boolean().optional(),api_access:t.boolean().optional(),collect_buyer_consent:lt.optional(),iframe:ut.optional(),bundle_size_exception:t.boolean().optional()}),dt=t.object({runs_offline:t.boolean().optional()}),Po=t.object({type:t.string().optional(),extensions:t.array(t.any()).optional()}),mt=t.object({event:t.string(),blocking:t.boolean().default(!1),applies_to:t.array(t.string()).optional()}),ft=t.object({allow_direct_linking:t.boolean().optional(),intercepts:t.array(mt).optional()}),ht=t.object({module:t.string()}),gt=t.object({target:t.string(),module:t.string(),should_render:ht.optional(),tools:t.string().optional(),instructions:t.string().optional(),intents:t.array(t.object({type:t.string(),action:t.string(),schema:t.string(),name:t.string().optional(),description:t.string().optional()})).optional(),metafields:t.array(ct).optional(),default_placement:t.string().optional(),urls:t.object({edit:t.string().optional()}).optional(),capabilities:ft.optional(),preloads:t.object({chat:t.string().optional()}).optional(),assets:t.string().optional()}),Co=t.array(gt),Ae=t.string(),St=t.object({key:t.string().optional(),name:t.string().optional(),description:t.string().optional(),required:t.boolean().optional(),default_value:t.any().optional(),type:t.string(),validations:t.array(t.any()).optional(),marketingActivityCreateUrl:t.string().optional(),marketingActivityDeleteUrl:t.string().optional()}),De=t.object({fields:t.array(St).optional()}),Te=t.string().trim().nonempty("Handle can't be empty").max(xe,`Handle can't exceed ${xe} characters`).regex(/^[a-zA-Z0-9-]*$/,"Handle can only contain alphanumeric characters and hyphens").refine(e=>!e.startsWith("-")&&!e.endsWith("-"),"Handle can't start or end with a hyphen"),kt=t.string().trim().nonempty("UID can't be empty").max(we,`UID can't exceed ${we} characters`).regex(/^[a-zA-Z0-9-${}.()_`]*$/,"UID can only contain alphanumeric characters and hyphens").refine(e=>!e.startsWith("-")&&!e.endsWith("-"),"UID can't start or end with a hyphen"),O=t.object({name:t.string().optional(),type:t.string().optional(),handle:Te.optional(),uid:kt.optional(),description:t.string().optional(),api_version:Ae.optional(),extension_points:t.any().optional(),capabilities:pt.optional(),supported_features:dt.optional(),settings:De.optional()}),Ro=O.extend({handle:Te}),Pe=O.omit({handle:!0}),Eo=t.object({api_version:Ae.optional(),description:t.string().optional(),extensions:t.array(t.any()),settings:De.optional()});r();r();r();r();var vt=/^(https:\/\/)/,bt=/^pubsub:\/\/(?<gcp_project_id>[^:]+):(?<gcp_topic>.+)$/,_t=/^arn:aws:events:(?<aws_region>[a-z]{2}-[a-z]+-[0-9]+)::event-source\/aws\.partner\/shopify\.com(\.test)?\/(?<api_client_id>\d+)\/(?<event_source_name>.+)$/,yt=/^kafka:\/\/(?<kafka_topic>[a-zA-Z0-9_.-]+)$/;function _(e){return typeof e=="string"&&e.endsWith("/")?e.replace(/\/+$/,""):e}var h=t.string({invalid_type_error:"Value must be string"}).refine(e=>e.startsWith("/")?!0:vt.test(e)||bt.test(e)||_t.test(e)||yt.test(e),{message:"URI format isn't correct. Valid formats include: relative path starting with a slash, HTTPS URL, pubsub://{project-id}:{topic-id}, kafka://{topic-id} or Eventbridge ARN"});function L(e,n){return!n||!e.startsWith("/")?e:`${_(n)}${e}`}var Nt=(e,n,o,i)=>{if(o.startsWith("//"))throw new c(`${e} ${n} is invalid: a URL relative to the app URL must start with a single slash.`);if(me.test(o))throw new c(`${e} ${n} is invalid: a URL must not contain control characters such as newlines or tabs.`);let a=L(o,i);if(a.startsWith("/"))throw new c(`${e} ${n} is a relative URL, but no application_url is configured. Set application_url in your app configuration or use an absolute HTTPS URL.`);if(!fe(a))throw new c(`${e} ${n} must resolve to an HTTPS URL. Set application_url to an HTTPS URL or use an absolute HTTPS URL.`);return a};function j(e,n,o,i){let a=o;for(let s of n){let l=a[s];typeof l=="string"&&l.startsWith("/")&&(a[s]=Nt(e,s,l,i))}}r();import{isUtf8 as xt}from"node:buffer";import Ce from"fs";async function Re(e,n){let o=await Y(B(e,"locales/*.json"));if(!o||o.length===0)return{};let i=wt(o);if(i.length===0)throw new c(`Missing default language in ${n} configuration`,"Make sure to have a {locale}.default.json file in your locales directory");if(i.length>1)throw new c(`Error loading ${n}`,'There must be one (and only one) locale identified as the default locale: e.g. "en.default.json"');for(let a of o)if(Ce.statSync(a).size===0)throw new c(`Error loading ${n}`,`Locale file ${a} can't be empty`);return{default_locale:i[0],translations:At(o,n)}}function wt(e){return e.filter(o=>D(o).endsWith(".default.json")).map(o=>D(o).split(".")[0])}function At(e,n){let o={};for(let i of e){let a=Dt(D(i).split(".")[0],"Locale code is unset"),s=Ce.readFileSync(i);if(!xt(s))throw new c(`Error loading ${n}`,`Locale file ${i} contains invalid UTF-8 byte sequences. Re-save the file using UTF-8 encoding.`);o[a]=s.toString("base64")}return o}function Dt(e,n){if(e===void 0)throw new ue(n);return e}function Tt(e){return e.experience==="configuration"}var Ee;(function(e){e.ShouldRender="should_render",e.Main="main",e.Tools="tools",e.Instructions="instructions",e.Intents="intents"})(Ee||(Ee={}));function Oe(e){let o={...{externalIdentifier:`${e.identifier}_external`,additionalIdentifiers:[],externalName:T(e.identifier.replace(/_/g," ")),surface:"test-surface",partnersWebIdentifier:e.identifier,schema:O,registrationLimit:Ne.extensions.defaultRegistrationLimit,transform:e.transformLocalToRemote,reverseTransform:e.transformRemoteToLocal,experience:e.experience??"extension",uidStrategy:e.uidStrategy??(e.experience==="configuration"?"single":"uuid"),getDevSessionUpdateMessages:e.getDevSessionUpdateMessages,clientSteps:e.clientSteps},...e};return{...o,contributeToAppConfigurationSchema:i=>{let a=Tt(o),s=o.schema._def.shape!==void 0,l=o.uidStrategy==="single";return a&&s&&l?i.merge(o.schema):i},parseConfigurationObject:i=>{let a=o.schema.safeParse(i);return a.success?{state:"ok",data:a.data,errors:void 0}:{state:"error",data:void 0,errors:a.error.errors}}}}function Le(e){let n=e.appModuleFeatures??(()=>[]);return Oe({identifier:e.identifier,schema:e.schema,appModuleFeatures:n,transformLocalToRemote:Pt(e.transformConfig),transformRemoteToLocal:Ct(e.schema,e.transformConfig),experience:"configuration",uidStrategy:e.uidStrategy??"single",expandConfig:e.expandConfig,getIdentity:e.getIdentity,getTarget:e.getTarget,clientSteps:e.clientSteps,getDevSessionUpdateMessages:e.getDevSessionUpdateMessages,patchWithAppDevURLs:e.patchWithAppDevURLs})}function ri(e){let n=e.appRelativeUrlFields;return Oe({identifier:e.identifier,schema:t.any({}),appModuleFeatures:e.appModuleFeatures,experience:e.experience,clientSteps:e.clientSteps,uidStrategy:e.uidStrategy,transformRemoteToLocal:e.transformRemoteToLocal,devSessionWatchConfig:e.devSessionWatchConfig,appRelativeUrlFields:n,patchWithAppDevURLs:n?.length?(o,i)=>{j(T(e.identifier.replace(/_/g," ")),n,o,i.applicationUrl)}:void 0,deployConfig:async(o,i,a,s,l)=>{let u=Rt(o);if(n?.length){let d=l?.appConfiguration?.application_url,m=typeof d=="string"?d:void 0;j(T(e.identifier.replace(/_/g," ")),n,u,m)}if(e.appModuleFeatures().includes("localization")){let d=await Re(i,e.identifier);u={...u,localization:d}}return u}})}function Pt(e){return Object.keys(e).includes("forward")?e.forward:n=>Ie(n,e)}function Ct(e,n){return n?Object.keys(n).includes("reverse")?n.reverse:o=>Ie(o,n,!0):o=>Ue(e,o)}function Ie(e,n,o=!1){let i={};for(let[a,s]of Object.entries(n)){let l=o?a:s,u=o?s:a,d=y(e,l);d!==void 0&&ee(i,u,d)}return i}function Ue(e,n){return Object.keys(e._def.shape()).reduce((o,i)=>{let a=e._def.shape()[i];return a instanceof t.ZodOptional&&(a=a._def.innerType),a instanceof t.ZodObject?o[i]=Ue(a,n):(n[i]!==void 0&&(o[i]=n[i]),delete n[i]),o},{})}function Rt(e){let{type:n,handle:o,uid:i,path:a,extensions:s,...l}=e;return l}r();var Et="webhook_subscription",Ot=t.object({topic:t.string(),actions:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),api_version:t.string(),uri:t.preprocess(_,h,{required_error:"Missing value at"}),include_fields:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),filter:t.string({invalid_type_error:"Value must be a string"}).optional(),payload_query:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).optional(),name:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).max(50).optional()});function Lt(e){let{api_version:n,topic:o,...i}=e;return{webhooks:{subscriptions:[{topics:[o],...i}]}}}var It={forward:(e,n)=>{let o=e,i;return"application_url"in n&&(i=n?.application_url),{...o,uri:L(o.uri,i)}},reverse:Lt},Ut=Le({identifier:Et,schema:Ot,transformConfig:It,uidStrategy:"dynamic"}),mi=Ut;r();r();var w;(function(e){e.CustomersRedact="customers/redact",e.CustomersDataRequest="customers/data_request",e.ShopRedact="shop/redact"})(w||(w={}));var ze=t.object({topics:t.array(t.string({invalid_type_error:"Values within array must be a string"}),{invalid_type_error:"Value must be string[]"}).optional(),actions:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),uri:t.preprocess(e=>_(e),h,{required_error:"Missing value at"}),include_fields:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),filter:t.string({invalid_type_error:"Value must be a string"}).optional(),payload_query:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).optional(),name:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).max(50).optional(),compliance_topics:t.array(t.enum([w.CustomersRedact,w.CustomersDataRequest,w.ShopRedact]),{invalid_type_error:"Value must be an array containing values: customers/redact, customers/data_request or shop/redact"}).optional()});r();function Fe(e,n){let o=zt(e);if(o)return n.addIssue(o),t.NEVER}function zt(e){let{subscriptions:n=[]}=e,o=new Set,i=[];if(!n.length)return;if(e.privacy_compliance&&e.subscriptions?.some(s=>s.compliance_topics))return{code:t.ZodIssueCode.custom,message:"The privacy_compliance section can't be used if there are subscriptions including compliance_topics"};let a=n.flatMap(s=>s.compliance_topics).filter(Boolean);if(G(a).length!==a.length)return{code:t.ZodIssueCode.custom,message:"You can\u2019t have multiple subscriptions with the same compliance topic",fatal:!0,path:["subscriptions"]};for(let[s,{uri:l,topics:u=[],compliance_topics:d=[],filter:m=""}]of n.entries()){let S=["subscriptions",s];if(!u.length&&!d.length)return{code:t.ZodIssueCode.custom,message:"Either topics or compliance_topics must be added to the webhook subscription",path:S};u.forEach(p=>{let k=`${p}::${l}::${m}`;if(o.has(k)){let A=m?U.dim(`
3
+
4
+ topic: ${p}
5
+ uri: ${l}
6
+ filter: ${m}`):U.dim(`
7
+
8
+ topic: ${p}
9
+ uri: ${l}`);i.push(A)}o.add(k)})}if(i.length>0){let s=i.join("");return{code:t.ZodIssueCode.custom,message:`Multiple subscriptions with the exact same topic, uri, and filter. To resolve, remove or edit the duplicates ${s}`,path:["subscriptions"]}}}r();function Ai(e){let n=y(e,"webhooks");if(!n)return e;let{api_version:o}=n;return{api_version:o}}function Di(e){let n={},o=y(e,"api_version");return n={...o?{webhooks:{api_version:o}}:{}},n}function Ve(e){if(e.length===0)return;let n=e.filter(s=>s.topics!==void 0).flatMap(({compliance_topics:s,topics:l,...u})=>We(l)?.map(m=>({topics:[m],...u}))??[]),o=e.filter(s=>s.topics===void 0||s.compliance_topics!==void 0).map(({compliance_topics:s,topics:l,...u})=>({compliance_topics:s,...u})),i=Vt(o,"compliance_topics"),a=Ft(i);return[...$e(a),...$e(n)]}function We(e){return e?.sort((n,o)=>n.localeCompare(o))}function $e(e){return e.sort((n,o)=>n.uri.localeCompare(o.uri))}function Ft(e){return e.forEach(n=>n.compliance_topics=We(n.compliance_topics)),e}function $t(e,n){return e.find(o=>o.uri===n.uri&&Q(o.include_fields??[],n.include_fields??[])&&o.filter===n.filter)}function Vt(e,n){return e.reduce((o,i)=>{let a=$t(o,i);return a?n&&i?.[n]?.length?a[n]?.push(...i[n]):(i.topics&&(a.topics??=[],a.topics.push(...i.topics)),i.compliance_topics&&(a.compliance_topics??=[],a.compliance_topics.push(...i.compliance_topics))):o.push(i),o},[])}var Wt=t.object({api_version:t.string({required_error:"String is required"}),privacy_compliance:t.object({customer_deletion_url:h.optional(),customer_data_request_url:h.optional(),shop_deletion_url:h.optional()}).optional(),subscriptions:t.array(ze).optional().transform(e=>Ve(e??[]))}),Ui=Pe.extend({webhooks:Wt.superRefine(Fe)});r();r();var He=(e,n,o)=>{let i=new URL(e);return n&&i.searchParams.append("cursor",n),o?.status&&i.searchParams.append("status",o.status),o?.source&&i.searchParams.append("source",o.source),i.toString()};var Me=je(qe()),Ht=new Me.default({minTime:150,maxConcurrent:10});async function Mt(e){let n="App Management",i=`https://${await P()}/app_management/unstable/graphql.json`;return{token:e,api:n,url:i,responseOptions:{onResponse:jt}}}var Bi=e=>J(e),Gi=async(e,n,o)=>{let a=`https://${await P()}/app_management/unstable/organizations/${e}/app_logs/poll`;return He(a,n,o)},Yi=async(e,n)=>`https://${await P()}/app_management/unstable/organizations/${encodeURIComponent(e)}/apps/${encodeURIComponent(n)}/channel_spec_export.json`;async function Ki(e){let n=e.cacheOptions?.cacheExtraKey??"",o=e.cacheOptions?{...e.cacheOptions,cacheExtraKey:n}:void 0;return Ht.schedule(async()=>te({...await Mt(e.token),query:e.query,variables:e.variables,cacheOptions:o,preferredBehaviour:e.requestOptions?.requestMode,unauthorizedHandler:e.unauthorizedHandler}))}function jt(e){if(!e.extensions)return;let n=[];for(let o of e.extensions.deprecations)o.supportedUntilDate&&n.push(new Date(o.supportedUntilDate));ne(n)}export{b as a,E as b,$ as c,he as d,ge as e,M as f,ot as g,it as h,V as i,rt as j,Ge as k,v as l,N as m,C as n,H as o,Xe as p,et as q,tt as r,nt as s,_o as t,st as u,yo as v,No as w,Ne as x,xo as y,wo as z,Bt as A,Gt as B,me as C,Yt as D,Be as E,Kt as F,_ as G,L as H,xe as I,ct as J,Po as K,Co as L,St as M,O as N,Ro as O,Pe as P,Eo as Q,Nt as R,Re as S,Tt as T,Ee as U,Oe as V,Le as W,ri as X,Ie as Y,Et as Z,mi as _,w as $,ze as aa,Ai as ba,Di as ca,Ve as da,Vt as ea,Ui as fa,Bi as ga,Gi as ha,Yi as ia,Ki as ja,jt as ka};
@@ -1 +1 @@
1
- import{g as b}from"./chunk-LHXFTFFM.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();import{performance as u}from"node:perf_hooks";function w(){return b()?"bubble":"mute-and-report"}function h(g={}){let i={sensitive:{},public:{...g}},p=t=>{Object.assign(i.public,t)},M=t=>{Object.assign(i.sensitive,t)},l=async(t,e,n)=>{let r=n==="auto"?w():n,s=async()=>{let c=await e();t(c)};if(r==="bubble")await s();else try{await s()}catch(c){let{sendErrorToBugsnag:o}=await import("./error-handler-4GCXKC6I.js");await o(c,"unexpected_error")}},a=[];return{getAllPublicMetadata:()=>({...i.public}),getAllSensitiveMetadata:()=>({...i.sensitive}),addPublicMetadata:async(t,e="auto")=>l(p,t,e),addSensitiveMetadata:async(t,e="auto")=>l(M,t,e),runWithTimer:t=>async e=>{a.push(0);let n=u.now();try{return await e()}finally{let r=u.now();r=Math.max(n,r);let s=Math.max(r-n,0),c=a.pop(),o=Math.max(s-c,0);a.length>0&&(a[a.length-1]=(a[a.length-1]??0)+s),u.measure(`${t}#measurable`,{start:n,duration:o}),u.measure(`${t}#wall`,{start:n,end:r});let d=i.public[t]||0;d+=o,i.public[t]=d}}}}var y=h({cmd_all_timing_network_ms:0,cmd_all_timing_prompts_ms:0}),{getAllPublicMetadata:S,getAllSensitiveMetadata:f,addPublicMetadata:x,addSensitiveMetadata:A,runWithTimer:P}=y;export{h as a,S as b,f as c,x as d,A as e,P as f};
1
+ import{g as b}from"./chunk-A5BSUUNQ.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();import{performance as u}from"node:perf_hooks";function w(){return b()?"bubble":"mute-and-report"}function h(g={}){let i={sensitive:{},public:{...g}},p=t=>{Object.assign(i.public,t)},M=t=>{Object.assign(i.sensitive,t)},l=async(t,e,n)=>{let r=n==="auto"?w():n,s=async()=>{let c=await e();t(c)};if(r==="bubble")await s();else try{await s()}catch(c){let{sendErrorToBugsnag:o}=await import("./error-handler-23FASAEU.js");await o(c,"unexpected_error")}},a=[];return{getAllPublicMetadata:()=>({...i.public}),getAllSensitiveMetadata:()=>({...i.sensitive}),addPublicMetadata:async(t,e="auto")=>l(p,t,e),addSensitiveMetadata:async(t,e="auto")=>l(M,t,e),runWithTimer:t=>async e=>{a.push(0);let n=u.now();try{return await e()}finally{let r=u.now();r=Math.max(n,r);let s=Math.max(r-n,0),c=a.pop(),o=Math.max(s-c,0);a.length>0&&(a[a.length-1]=(a[a.length-1]??0)+s),u.measure(`${t}#measurable`,{start:n,duration:o}),u.measure(`${t}#wall`,{start:n,end:r});let d=i.public[t]||0;d+=o,i.public[t]=d}}}}var y=h({cmd_all_timing_network_ms:0,cmd_all_timing_prompts_ms:0}),{getAllPublicMetadata:S,getAllSensitiveMetadata:f,addPublicMetadata:x,addSensitiveMetadata:A,runWithTimer:P}=y;export{h as a,S as b,f as c,x as d,A as e,P as f};
@@ -0,0 +1 @@
1
+ import{a as f}from"./chunk-2IXP3IPE.js";import{g as w}from"./chunk-VKWPEFWQ.js";w();var _=!1;function h(){return _}function P(){let a=0,r=!1,o=setInterval(()=>{if(!r){if(h()||a>=12e4){r=!0,clearInterval(o),f(process.pid,"SIGINT",!1,()=>{process.exit(0)});return}a+=100}},100)}var x=async({config:e,Command:t})=>{await A(t);let a=await import("./metadata-VHLSUKCW.js"),{commandStartOptions:r}=a.getAllSensitiveMetadata();r&&await a.addSensitiveMetadata(()=>({commandStartOptions:{...r,endTime:new Date().getTime()}}));let{postrun:o}=await import("./deprecations-5CSI24TV.js");o(t);let{outputDebug:p}=await import("./output-DUJTSURG.js"),s=t.id.replace(/:/g," ");p(`Completed command ${s}`),!s.includes("notifications")&&!s.includes("upgrade")&&!s.includes("send-analytics")&&await k();let{reportAnalyticsEvent:u}=await import("./analytics-23GM6KJU.js");await u({config:e,exitMode:"ok"}),_=!0};async function k(){let{versionToAutoUpgrade:e,warnIfUpgradeAvailable:t}=await import("./upgrade-73RRPDSC.js");await t();let a=e();if(!a)return;if(process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1")await g(a);else{let{runAtMinimumInterval:o}=await import("./conf-store-TODPQ2LC.js");await o("auto-upgrade",{days:1},async()=>{await g(a)})}}async function g(e){let[{CLI_KIT_VERSION:t},{isMajorVersionChange:a,availableHomebrewCLIVersion:r},{outputWarn:o,outputDebug:p,outputContent:s,outputToken:u},{getOutputUpdateCLIReminder:c,runCLIUpgrade:v,hasBlockingAutoUpgradeNotification:b},i,{inferPackageManagerForGlobalCLI:m,getHomebrewCLIFormula:I},{lt:M,SemVer:S}]=await Promise.all([import("./version-AMUEEBIG.js"),import("./version-S4MGCKDO.js"),import("./output-DUJTSURG.js"),import("./upgrade-73RRPDSC.js"),import("./metadata-VHLSUKCW.js"),import("./is-global-3DNAMKUU.js"),import("./semver-HHZRKD6Y.js")]);if(a(t,e)){o(c(e,!0)),await i.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"major_version"}));return}let l=e;if(m()==="homebrew"){let n=await r();if(!n){p("Auto-upgrade: Could not read the available Homebrew version."),await i.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"homebrew_version_unavailable"}));return}if(a(t,n)){if(I()==="shopify-cli"){let d=new S(t).major;o(s`To keep receiving Shopify CLI ${String(d)}.x updates with Homebrew, run ${u.genericShellCommand(`brew install shopify-cli@${d}`)} and use ${u.genericShellCommand(`shopify${d}`)}.`)}else o(c(n,!0));await i.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"major_version"}));return}if(!M(t,n)){p("Auto-upgrade: No newer Homebrew version available."),await i.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"homebrew_already_up_to_date"}));return}l=n}if(await b()){await i.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"blocked_by_notification"}));return}try{await v({autoupgrade:!0,version:l}),await i.addPublicMetadata(()=>({env_auto_upgrade_success:!0}))}catch(n){let d=`Auto-upgrade failed: ${n}`;p(d),o(c(l)),await i.addPublicMetadata(()=>({env_auto_upgrade_success:!1}));let{sendErrorToBugsnag:y}=await import("./error-handler-23FASAEU.js"),C=Object.assign(new Error(d),{packageManager:m(),platform:process.platform,cliVersion:t});await y(C,"expected_error")}}async function A(e){let t=new Date().getTime();if(e&&"analyticsStopCommand"in e&&typeof e.analyticsStopCommand=="function"){let a=e.analyticsStopCommand();if(a){let r=await import("./metadata-VHLSUKCW.js"),{commandStartOptions:o}=r.getAllSensitiveMetadata();if(!o)return;await r.addSensitiveMetadata(()=>({commandStartOptions:{...o,startTime:t,startCommand:a}}))}}}export{P as a,x as b};
@@ -0,0 +1 @@
1
+ import{a as K,b as _,c as z,d as N,e as f,f as d,g as W,h as G,j as H}from"./chunk-V3H6SYK3.js";import{a as x}from"./chunk-3JRB7Q3T.js";import{b as S,c as j}from"./chunk-ZNEPRGFY.js";import{a as R}from"./chunk-R5COVIJM.js";import{a as P}from"./chunk-K4KKSBUW.js";import{P as J,g as L}from"./chunk-7FBOMPO5.js";import{Da as U,Oa as A}from"./chunk-UORSJB4A.js";import{b as D,c as v}from"./chunk-IKXUYCK7.js";import{y as F}from"./chunk-7A4ZE5IS.js";import{a as C}from"./chunk-LG3KEHGD.js";import{m as O,p as k,q as M}from"./chunk-FJOVMEPN.js";import{Ab as g,zb as s}from"./chunk-OIQ5NQ5I.js";import{b as t}from"./chunk-3PYDIBTX.js";import{b as $}from"./chunk-VBPMVVLV.js";import{g as T}from"./chunk-IWTNUJGY.js";import{e as Z,g as m}from"./chunk-VKWPEFWQ.js";m();m();var B=t.string().refine(T,"Expected an absolute native filesystem path"),Y=t.object({id:t.string().uuid().describe("The dashboard extension registration UUID, not a Shopify GID."),name:t.string(),type:t.string().min(1).describe("The upstream dashboard extension type."),directory:B.describe("The absolute local extension directory."),configurationPath:B.nullable().describe("The absolute local TOML path, or null when no TOML file exists in a kept directory."),changed:t.boolean().describe("Whether this import wrote the local extension TOML.")}).strict(),q=t.object({extensionId:t.string().uuid().nullable().describe("The registration UUID, or null for identifier persistence."),error:S}).strict(),n=C({name:"ImportDashboardExtensionsResult",schema:t.object({status:t.enum(["success","partial","skipped","cancelled"]),reason:t.enum(["no-extensions","directory-selection-cancelled"]).nullable(),extensions:t.array(Y).describe("Completed extension imports and kept local directories, in selection order."),errors:t.array(q).describe("Failed selected imports or identifier persistence."),identifiersUpdated:t.boolean().describe("Whether the extension identifier persistence step completed.")}).strict(),definitions:{ImportedDashboardExtension:Y,ExtensionImportFailure:q,...j.definitions}});var Q=Z($(),1);var E=class u extends R{static descriptionWithMarkdown="Import dashboard-managed extensions into your app.";static jsonOutputSchema=n;static description=this.descriptionForHelp();static flags={...D,...P,...v,"client-id":Q.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]})};async run(){let{flags:o}=await this.parse(u),r=await J({directory:o.path,clientId:o["client-id"],forceRelink:o.reset,userProvidedConfigName:o.config}),a=await H({developerPlatformClient:r.developerPlatformClient,apiKey:r.remoteApp.apiKey,organizationId:r.remoteApp.organizationId,extensionTypes:N}),l=_(o.json?G(r.app,a):a);if(l.length===0)o.json?s(n.encode({status:"skipped",reason:"no-extensions",extensions:[],errors:[],identifiersUpdated:!1})):F({headline:["No extensions to migrate."]});else{let y=await z(l),i;try{if(i=await W({...r,extensions:a,extensionTypes:y.extensionTypes,buildExtensionConfig:y.buildExtensionConfig}),o.json&&i.status==="skipped")return s(n.encode({status:i.status,reason:i.reason,extensions:[],errors:[],identifiersUpdated:!1})),{app:r.app};o.json||K(i),await L({app:r.app,appApiKey:r.remoteApp.apiKey,extensionUuids:i.extensionUuids,command:"import-extensions"})}catch(e){if(!o.json)throw e instanceof d?e.originalError:e;let I=e instanceof d?e.originalError:e;if(e instanceof f||e instanceof d){let p=await e.completedImports();if(e instanceof d&&p.extensions.length===0)throw e.originalError;let h=e instanceof f&&p.failures.length===0;if(s(n.encode({status:h?"cancelled":"partial",reason:h?"directory-selection-cancelled":null,extensions:b(p.extensions),errors:p.failures.map(({extension:V,error:X})=>({extensionId:V.uuid,error:x(X)})),identifiersUpdated:!1})),h)throw await g(),e;e instanceof f&&(I=p.failures[0].error)}else if(i)s(n.encode({status:"partial",reason:null,extensions:b(i.extensions),errors:[{extensionId:null,error:x(e)}],identifiersUpdated:!1}));else throw e;let c=await k(I),w=M(c)?"unexpected_error":"expected_error";throw await U({config:this.config,errorMessage:c instanceof Error?c.message:void 0,exitMode:w}),await A(c,w),await g(),new O}o.json&&s(n.encode({status:"success",reason:null,extensions:b(i.extensions),errors:[],identifiersUpdated:!0}))}return{app:r.app}}};function b(u){return u.map(({extension:o,directory:r,configurationPath:a,changed:l})=>({id:o.uuid,name:o.title,type:o.type,directory:r,configurationPath:a,changed:l}))}export{E as a};
@@ -1,4 +1,4 @@
1
- import{h as k}from"./chunk-M5VIFG2V.js";import{Sa as j,la as w,ta as R}from"./chunk-JLQRDFR5.js";import{a as H,c as f,e as G,g as o}from"./chunk-VKWPEFWQ.js";var ee=f((Tt,X)=>{"use strict";o();var m=class e extends Error{constructor(t,s,r){super("[ParserError] "+t,s,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},E=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},A=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new E(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let s;for(;s===!1||this.nextChar();)s=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new m("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,s){s&&this.next(s),this.stack.push(this.state),this.state=new E(t)}callNow(t,s){return this.call(t,s),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new m("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new m("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new m("Must declare a parseStart method")}};A.END=1114112;A.Error=m;X.exports=A});var re=f((Rt,te)=>{"use strict";o();te.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var y=f((xt,se)=>{"use strict";o();se.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var ne=f((Ht,ie)=>{"use strict";o();var C=y(),K=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${C(2,this.getUTCMonth()+1)}-${C(2,this.getUTCDate())}`,s=`${C(2,this.getUTCHours())}:${C(2,this.getUTCMinutes())}:${C(2,this.getUTCSeconds())}.${C(3,this.getUTCMilliseconds())}`;return`${t}T${s}`}};ie.exports=e=>{let t=new K(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var oe=f((yt,ae)=>{"use strict";o();var he=y(),$e=global.Date,W=class extends $e{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${he(2,this.getUTCMonth()+1)}-${he(2,this.getUTCDate())}`}};ae.exports=e=>{let t=new W(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var ce=f((It,le)=>{"use strict";o();var N=y(),q=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${N(2,this.getUTCHours())}:${N(2,this.getUTCMinutes())}:${N(2,this.getUTCSeconds())}.${N(3,this.getUTCMilliseconds())}`}};le.exports=e=>{let t=new q(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var I=f((exports,module)=>{"use strict";o();module.exports=makeParserClass(ee());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=re(),createDateTimeFloat=ne(),createDate=oe(),createTime=ce(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
1
+ import{j as k}from"./chunk-FJOVMEPN.js";import{Sa as j,la as w,ta as R}from"./chunk-OIQ5NQ5I.js";import{a as H,c as f,e as G,g as o}from"./chunk-VKWPEFWQ.js";var ee=f((Tt,X)=>{"use strict";o();var m=class e extends Error{constructor(t,s,r){super("[ParserError] "+t,s,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},E=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},A=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new E(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let s;for(;s===!1||this.nextChar();)s=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new m("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,s){s&&this.next(s),this.stack.push(this.state),this.state=new E(t)}callNow(t,s){return this.call(t,s),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new m("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new m("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new m("Must declare a parseStart method")}};A.END=1114112;A.Error=m;X.exports=A});var re=f((Rt,te)=>{"use strict";o();te.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var y=f((xt,se)=>{"use strict";o();se.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var ne=f((Ht,ie)=>{"use strict";o();var C=y(),K=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${C(2,this.getUTCMonth()+1)}-${C(2,this.getUTCDate())}`,s=`${C(2,this.getUTCHours())}:${C(2,this.getUTCMinutes())}:${C(2,this.getUTCSeconds())}.${C(3,this.getUTCMilliseconds())}`;return`${t}T${s}`}};ie.exports=e=>{let t=new K(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var oe=f((yt,ae)=>{"use strict";o();var he=y(),$e=global.Date,W=class extends $e{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${he(2,this.getUTCMonth()+1)}-${he(2,this.getUTCDate())}`}};ae.exports=e=>{let t=new W(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var ce=f((It,le)=>{"use strict";o();var N=y(),q=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${N(2,this.getUTCHours())}:${N(2,this.getUTCMinutes())}:${N(2,this.getUTCSeconds())}.${N(3,this.getUTCMilliseconds())}`}};le.exports=e=>{let t=new q(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var I=f((exports,module)=>{"use strict";o();module.exports=makeParserClass(ee());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=re(),createDateTimeFloat=ne(),createDate=oe(),createTime=ce(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
2
2
  `,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return hasOwnProperty.call(e,t)?!0:(t==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(t){try{this.value=global.BigInt.asIntN(64,t)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}var FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){let t=typeof e;if(t==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(r){let i=this.ctx,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(r){return this.state.resultTable?this.state.resultTable.push(r):this.state.resultTable=[r],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(r){return this.returnNow({key:this.state.resultTable,value:r})}parseComment(){do if(this.char===e.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)&&(!isTable(this.ctx[r])||this.ctx[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[r]=this.ctx[r]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)||(this.ctx[r]=List()),isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[r])){let i=Table();this.ctx[r].push(i),this.ctx=i}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else{if(isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(r){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(r){return this.returnNow(r)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let r="\\u00";return this.char<16&&(r+="0"),r+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${r} instead`))}recordMultiEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(r){try{let i=parseInt(r,16);if(i>=SURROGATE_FIRST&&i<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(i))}catch(i){throw this.error(TomlError.wrap(i))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(r){if(this.state.resultArr){let i=this.state.resultArr[_contentType],h=tomlType(r);if(i!==h)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${i} and ${h}`))}else this.state.resultArr=InlineList(tomlType(r));return isFloat(r)||isInteger(r)?this.state.resultArr.push(r.valueOf()):this.state.resultArr.push(r),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(r){let i=this.state.resultTable,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return t}});var L=f((Ot,ue)=>{"use strict";o();ue.exports=Ke;function Ke(e,t){if(e.pos==null||e.line==null)return e;let s=e.message;if(s+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}:
3
3
  `,t&&t.split){let r=t.split(/\n/),i=String(Math.min(r.length,e.line+3)).length,h=" ";for(;h.length<i;)h+=" ";for(let n=Math.max(0,e.line-1);n<Math.min(r.length,e.line+2);++n){let a=String(n+1);if(a.length<i&&(a=" "+a),e.line===n){s+=a+"> "+r[n]+`
4
4
  `,s+=h+" ";for(let l=0;l<e.col;++l)s+=" ";s+=`^
@@ -0,0 +1,3 @@
1
+ import{a as P}from"./chunk-FRWQJAW2.js";import{a as N}from"./chunk-UY44O4IZ.js";import{a as l}from"./chunk-TXMZPF2U.js";import{a as U}from"./chunk-YY6TFARF.js";import{a as J,b as _}from"./chunk-GQ3LY7BY.js";import{r as O}from"./chunk-RSNFNZ6F.js";import{b as E,c as h,e as R,g as C,h as T}from"./chunk-7HECBXSP.js";import{p as c,v as x}from"./chunk-VVHJ2AUF.js";import{b as S,c as j,f as F}from"./chunk-IKXUYCK7.js";import{A as u,D,V as a,y}from"./chunk-7A4ZE5IS.js";import{j as v}from"./chunk-FJOVMEPN.js";import{zb as q}from"./chunk-OIQ5NQ5I.js";import{b as t}from"./chunk-3PYDIBTX.js";import{b as k}from"./chunk-VBPMVVLV.js";import{e as L,g as i}from"./chunk-VKWPEFWQ.js";i();i();var d=t.object({id:t.number(),name:t.string(),role:t.string()}),G=d.extend({shop:t.string(),preview_url:t.string().optional()}),B=t.object({status:t.literal("failed"),message:t.string(),errors:t.array(t.string()),requestId:t.string().optional()}),z=t.discriminatedUnion("status",[P.extend({originalTheme:d,theme:G}),B]),p=R({name:"ThemeDuplicateResult",schema:t.object({status:t.literal("success"),changed:t.boolean(),originalTheme:h,theme:h.extend({storeDomain:E,previewUrl:t.string().url().nullable()}).strict()}).strict(),definitions:{Theme:h},project(e){let r=z.parse(e);if(r.status==="failed")throw new TypeError("Failed duplications use the shared fatal error document.");return{status:r.status,changed:!0,originalTheme:T(r.originalTheme),theme:{...T(r.theme),storeDomain:C(r.theme.shop),previewUrl:r.theme.preview_url??null}}}}),A=t.discriminatedUnion("status",[t.object({status:t.literal("missing-theme-id")}),t.object({status:t.literal("not-found"),themeId:t.string()}),t.object({status:t.literal("development-theme")}),t.object({status:t.literal("cancelled")}),t.object({status:t.literal("completed"),originalTheme:d.extend({createdAtRuntime:t.boolean().default(!1),processing:t.boolean().default(!1)}),shop:t.string(),previewUrl:t.string().optional(),theme:d.optional(),userErrors:t.array(t.object({field:t.array(t.string()).nullish(),message:t.string()})),requestId:t.string().optional()})]);i();function w(e){if(e.status==="cancelled")return{status:"cancelled"};let r=M(e);if(r.status==="failed"){let o=new v(r.message.trim());throw o.details={errors:r.errors,...r.requestId?{requestId:r.requestId}:{}},o}return r}function Y(e,r){if(r==="json"){q(p.encode(w(e)));return}if(e.status==="cancelled")return;let o=M(e);o.status==="failed"&&(process.exitCode=1),e.status==="completed"?V(e):"message"in o&&u({body:[o.message]})}function M(e){switch(e.status){case"missing-theme-id":return{status:"failed",message:"A theme ID is required to duplicate a theme, specify one with the --theme flag",errors:[]};case"not-found":return{status:"failed",message:`No theme with ID ${e.themeId} could be found. Use shopify theme list to find a theme ID.`,errors:[]};case"development-theme":return{status:"failed",message:"Development themes can't be duplicated. Use shopify theme push to upload it to the store first.",errors:[]};case"completed":{if(e.userErrors.length>0)return{status:"failed",message:`The theme '${e.originalTheme.name}' could not be duplicated due to errors`,errors:e.userErrors.map(r=>r.message),requestId:e.requestId};if(e.theme){let{id:r,name:o,role:s}=e.theme;return{status:"success",originalTheme:e.originalTheme,theme:{id:r,name:o,role:s,shop:e.shop,preview_url:e.previewUrl}}}return{status:"failed",message:`The theme '${e.originalTheme.name}' unexpectedly could not be duplicated `,errors:[],requestId:e.requestId}}}}function V(e){let r=e.originalTheme;if(e.userErrors&&e.userErrors.length>0){let o=e.userErrors.map(s=>s.message).join(", ");u({body:["The theme",...l(r),"could not be duplicated due to errors: ",{subdued:o},{char:"."},...e.requestId?[`
2
+ Request ID: `,{subdued:e.requestId}]:[]]})}else e.theme?y({body:["The theme",...l(r),"has been duplicated",{char:"."}],nextSteps:[[{link:{label:"View the duplicated theme",url:e.previewUrl}}]]}):u({body:["The theme",...l(r),"unexpectedly could not be duplicated",{char:"."},...e.requestId?[`
3
+ Request ID: `,{subdued:e.requestId}]:[]]})}i();async function $(e,r,o,s=!1){let{name:m,force:H}=o,I=a()||!!H||s;if(I&&!r)return{status:"missing-theme-id"};let n=r?await _(e,r):await J(e,{header:"Select a theme to duplicate",filter:{theme:r}});if(!n)return{status:"not-found",themeId:r};if(n?.role==="development")return{status:"development-theme"};if(!I&&!await D({message:`Do you want to duplicate '${n.name}' on ${e.storeFqdn}?`,confirmationMessage:`Yes, duplicate '${n.name}'`,cancellationMessage:"No, cancel duplicate"}))return{status:"cancelled"};let g=await O(n.id,m,e);return A.parse({status:"completed",originalTheme:n,shop:e.storeFqdn,previewUrl:g.theme?U(g.theme,e):void 0,...g})}var f=L(k(),1);var b=class extends x{static jsonOutputSchema=p;static summary="Duplicates a theme from your theme library.";static usage=["theme duplicate","theme duplicate --theme 10 --name 'New Theme'"];static descriptionWithMarkdown="If you want to duplicate your local theme, you need to run `shopify theme push` first.\n\nIf no theme ID is specified, you're prompted to select the theme that you want to duplicate from the list of themes in your store. You're asked to confirm that you want to duplicate the specified theme.\n\nPrompts and confirmations are not shown when duplicate is run in a CI environment or the `--force` flag is used, therefore you must specify a theme ID using the `--theme` flag.\n\nYou can optionally name the duplicated theme using the `--name` flag.\n\nIf you use the `--json` flag, then theme information is returned in JSON format, which can be used as a machine-readable input for scripts or continuous integration.\n\nSuccessful JSON results include `status`, `changed`, and explicit `originalTheme` and `theme` resources with decimal string IDs. Failures use the shared `{error}` document.";static description=this.descriptionForHelp();static flags={...S,...j,password:c.password,theme:F(f.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"})),name:f.Flags.string({char:"n",description:"Name of the newly duplicated theme.",env:"SHOPIFY_FLAG_NAME"}),store:c.store,environment:c.environment,force:f.Flags.boolean({char:"f",description:"Force the duplicate operation to run without prompts or confirmations. Required if non interactive outside CI.",env:"SHOPIFY_FLAG_FORCE"})};static multiEnvironmentsFlags=["store","password","theme"];static nonTTYFlagRequirements(){return[{flags:["force"],when:()=>!a()}]}async command(r,o,s=!1){N(r);let m=await $(o,r.theme,r,s);if(r.json&&s)return w(m);Y(m,r.json?"json":"text")}requiresEnvironmentConfirmation(r){return!a()&&super.requiresEnvironmentConfirmation(r)}};export{b as a};