shopify 5.0.1 → 5.1.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 (528) hide show
  1. package/dist/analytics-QFDTQYPM.js +1 -0
  2. package/dist/analytics-XADBBHOH.js +1 -0
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/chunk-24Q6X53V.js +1 -0
  5. package/dist/{chunk-F3OM2YO6.js → chunk-25MYHE4W.js} +1 -1
  6. package/dist/{chunk-HP2ZAAY7.js → chunk-27JT4NA4.js} +1 -1
  7. package/dist/chunk-2BYW3BYX.js +1 -0
  8. package/dist/chunk-2KFYIYLI.js +1 -0
  9. package/dist/{chunk-V654BMS7.js → chunk-2KUM2RU4.js} +60 -60
  10. package/dist/chunk-2PD7TNFS.js +275 -0
  11. package/dist/{chunk-3JACWBUC.js → chunk-3C72S6LO.js} +1 -1
  12. package/dist/chunk-3FZ4LE6A.js +10 -0
  13. package/dist/{chunk-ZBVHPC6W.js → chunk-3GD5ESWN.js} +1 -1
  14. package/dist/chunk-3KGN6N7E.js +1 -0
  15. package/dist/{chunk-X4A5D3PZ.js → chunk-3MZ7ELHS.js} +2 -2
  16. package/dist/{chunk-VXL5FBE7.js → chunk-3PS52ZT4.js} +1 -1
  17. package/dist/chunk-3PYDIBTX.js +1 -0
  18. package/dist/chunk-3Z75BVGJ.js +1 -0
  19. package/dist/chunk-4FWPOGPQ.js +1 -0
  20. package/dist/chunk-4IP37MBX.js +1 -0
  21. package/dist/chunk-4NFX7YCT.js +1 -0
  22. package/dist/chunk-4TCXPHKN.js +1 -0
  23. package/dist/chunk-4WBWZIN5.js +6 -0
  24. package/dist/chunk-5534MHZW.js +97 -0
  25. package/dist/{chunk-C4EKNOLY.js → chunk-5C6CXU74.js} +1 -1
  26. package/dist/{chunk-56GKTWFF.js → chunk-5HOZDOJ7.js} +1 -1
  27. package/dist/{chunk-CX3ANDPI.js → chunk-5PSQFQL6.js} +1 -1
  28. package/dist/chunk-5T3ZT6CC.js +1 -0
  29. package/dist/chunk-62NW4EPI.js +17 -0
  30. package/dist/chunk-65NCQJYR.js +1 -0
  31. package/dist/{chunk-QGWC23HQ.js → chunk-6BYHL3DS.js} +1 -1
  32. package/dist/chunk-6I7DT7QR.js +3 -0
  33. package/dist/chunk-6IMTMS2S.js +3 -0
  34. package/dist/chunk-7A77JCED.js +11 -0
  35. package/dist/chunk-7ART2IKU.js +1 -0
  36. package/dist/{chunk-TTBNFGCW.js → chunk-7BPT5V24.js} +2 -2
  37. package/dist/{chunk-V7H7ITCF.js → chunk-7CT3NIXI.js} +1 -1
  38. package/dist/chunk-7DBKSSDK.js +1 -0
  39. package/dist/chunk-7HECBXSP.js +1 -0
  40. package/dist/chunk-7KID5BIR.js +4 -0
  41. package/dist/{chunk-63UKZLPC.js → chunk-7N7KRZOM.js} +1 -1
  42. package/dist/{chunk-NJVNGEOU.js → chunk-7NRHZG5Y.js} +102 -102
  43. package/dist/chunk-7PHDEILV.js +1 -0
  44. package/dist/chunk-A2NSORBM.js +2296 -0
  45. package/dist/chunk-A54TADAZ.js +1 -0
  46. package/dist/{chunk-YTUUU33R.js → chunk-AE3IQG7S.js} +1 -1
  47. package/dist/chunk-AGTUAQHX.js +4 -0
  48. package/dist/chunk-AHYI27QL.js +11 -0
  49. package/dist/chunk-ALINJ6J2.js +1 -0
  50. package/dist/chunk-AMVWKHNY.js +1 -0
  51. package/dist/{chunk-D4LFWIFE.js → chunk-ASKBYEO7.js} +1 -1
  52. package/dist/{chunk-LENSEW2F.js → chunk-AVJJGQOP.js} +1 -1
  53. package/dist/{chunk-QVVQUJQL.js → chunk-AY3AAV77.js} +1 -1
  54. package/dist/{chunk-DSKAIC7O.js → chunk-BFAOTQGH.js} +1 -1
  55. package/dist/{chunk-KGASGUDQ.js → chunk-BPKQA2EO.js} +1 -1
  56. package/dist/{chunk-KLYGMYXV.js → chunk-C2HJEGTS.js} +1 -1
  57. package/dist/chunk-C72QNK6O.js +4 -0
  58. package/dist/chunk-CDSDQTNB.js +16 -0
  59. package/dist/chunk-CEQGOCKX.js +1 -0
  60. package/dist/{chunk-QBE6XVU3.js → chunk-CIGWIKOW.js} +1 -1
  61. package/dist/chunk-CQAD5WML.js +1 -0
  62. package/dist/chunk-CRQQCT7F.js +1 -0
  63. package/dist/chunk-CZNUBAAG.js +3 -0
  64. package/dist/{chunk-WQOPLNDH.js → chunk-D7IMC2G4.js} +1 -1
  65. package/dist/{chunk-LGXNXAQA.js → chunk-DC7ITY6T.js} +1 -1
  66. package/dist/{chunk-7GHSE7SG.js → chunk-DDRP6QTC.js} +1 -1
  67. package/dist/{chunk-4EDE3UH7.js → chunk-DDZYIC76.js} +2 -2
  68. package/dist/chunk-DGIIUQH3.js +1 -0
  69. package/dist/{chunk-5AWELO3D.js → chunk-DMOLPSXF.js} +1 -1
  70. package/dist/{chunk-GSGCSBRN.js → chunk-DOLVBTCB.js} +1 -1
  71. package/dist/{chunk-MXXMIPUN.js → chunk-DTKGI43P.js} +2 -2
  72. package/dist/{chunk-37P5YOP2.js → chunk-DVD7I2TX.js} +2 -2
  73. package/dist/chunk-DVFVO6ZE.js +2 -0
  74. package/dist/{chunk-7U2MTK6I.js → chunk-DXEMSLI6.js} +1 -1
  75. package/dist/chunk-EDWIWZWM.js +15 -0
  76. package/dist/chunk-ELR6AZT4.js +9 -0
  77. package/dist/chunk-EVQPYZ7F.js +5 -0
  78. package/dist/chunk-F5QKMDP3.js +1 -0
  79. package/dist/{chunk-J5DUFSR4.js → chunk-F6IQWX2F.js} +1 -1
  80. package/dist/{chunk-XZLM4HLO.js → chunk-FAVPTYIR.js} +1 -1
  81. package/dist/{chunk-Q7BOSHWX.js → chunk-FDSNRKGQ.js} +1 -1
  82. package/dist/{chunk-DVW7NDVD.js → chunk-FHKK3QU7.js} +1 -1
  83. package/dist/chunk-FKKJQGYX.js +7 -0
  84. package/dist/chunk-FQLXQ7WN.js +16 -0
  85. package/dist/{chunk-6PUU6ZNQ.js → chunk-FRWQJAW2.js} +1 -1
  86. package/dist/{chunk-AIEVQSI3.js → chunk-FU7PYW7H.js} +1 -1
  87. package/dist/{chunk-5YUDEPEY.js → chunk-FYQE5E6U.js} +1 -1
  88. package/dist/chunk-G3EWGBXR.js +1 -0
  89. package/dist/chunk-G3RNO2TC.js +1 -0
  90. package/dist/{chunk-7NYCJG2U.js → chunk-GGCP2TIK.js} +1 -1
  91. package/dist/chunk-GSFWBFFH.js +1 -0
  92. package/dist/{chunk-NUCDRKDW.js → chunk-H2KGP2FM.js} +2 -2
  93. package/dist/{chunk-PVASYKSJ.js → chunk-H4K3F7PP.js} +1 -1
  94. package/dist/chunk-HGZ2HRPO.js +13 -0
  95. package/dist/chunk-HMPRWNGG.js +203 -0
  96. package/dist/chunk-HP4QYSBQ.js +1 -0
  97. package/dist/{chunk-LR4J4KYJ.js → chunk-HSTZV6H7.js} +2 -2
  98. package/dist/{chunk-ZHHTQRWU.js → chunk-HVUMVDUG.js} +1 -1
  99. package/dist/{chunk-IY5EI5V2.js → chunk-HYCNYUHW.js} +1 -1
  100. package/dist/{chunk-FHNJLON5.js → chunk-I3WRA2LH.js} +1 -1
  101. package/dist/{chunk-MS7DTL4U.js → chunk-IRLYC626.js} +2 -2
  102. package/dist/chunk-IWNFPBH2.js +33 -0
  103. package/dist/{chunk-EA5XVQJT.js → chunk-JALDNBTU.js} +1 -1
  104. package/dist/{chunk-ZTZGDZCE.js → chunk-JC37YZ4I.js} +1 -1
  105. package/dist/{chunk-DM7BTMFP.js → chunk-JG4FAT2T.js} +1 -1
  106. package/dist/chunk-JGLLABZR.js +8 -0
  107. package/dist/chunk-JIY6XWSC.js +1 -0
  108. package/dist/{chunk-VG2AESTZ.js → chunk-JIYCZXK5.js} +1 -1
  109. package/dist/chunk-JMSAHCBU.js +35 -0
  110. package/dist/{chunk-CWR3IFXD.js → chunk-JNSVKDBY.js} +1 -1
  111. package/dist/chunk-JQU2BJDH.js +3 -0
  112. package/dist/chunk-JVY6CCLE.js +3 -0
  113. package/dist/{chunk-BAHIL37I.js → chunk-K4QJEQI4.js} +1 -1
  114. package/dist/chunk-KCAWHJGF.js +1 -0
  115. package/dist/{chunk-M73IECPW.js → chunk-KFO2JNF5.js} +1 -1
  116. package/dist/chunk-KFR7HWCG.js +9 -0
  117. package/dist/{chunk-QYFU363G.js → chunk-KHZF73BL.js} +1 -1
  118. package/dist/{chunk-HT66BOEC.js → chunk-KM4LE7K4.js} +2 -2
  119. package/dist/{chunk-IILLQOUC.js → chunk-L2PUDV7Y.js} +1 -1
  120. package/dist/chunk-LFBFPK22.js +1 -0
  121. package/dist/{chunk-BN7ZXAZJ.js → chunk-LG3KEHGD.js} +2 -2
  122. package/dist/chunk-LGDWE3H3.js +1 -0
  123. package/dist/chunk-LPPEAMI6.js +1 -0
  124. package/dist/chunk-LXIWMYM4.js +1 -0
  125. package/dist/chunk-MGWCXTGD.js +1 -0
  126. package/dist/chunk-MGX7UG44.js +1 -0
  127. package/dist/chunk-MKFRKNHF.js +3 -0
  128. package/dist/chunk-MTT6EAQO.js +1 -0
  129. package/dist/{chunk-75LAVRRL.js → chunk-MU7IVBGI.js} +2 -2
  130. package/dist/{chunk-36TZ447N.js → chunk-MYMBHVC4.js} +1 -1
  131. package/dist/chunk-MZDBH4XV.js +4 -0
  132. package/dist/{chunk-3G2PEYPI.js → chunk-NUBJ2HK7.js} +1 -1
  133. package/dist/{chunk-K3YALQBQ.js → chunk-NY5N4ANL.js} +1 -1
  134. package/dist/{chunk-364BVGRY.js → chunk-NYMKGE3J.js} +1 -1
  135. package/dist/{chunk-CX5CC6P5.js → chunk-O472FAYX.js} +1 -1
  136. package/dist/chunk-O7HZ3EIP.js +1 -0
  137. package/dist/chunk-OJOF6IYG.js +9 -0
  138. package/dist/{chunk-EXTVC33U.js → chunk-ONZULPQH.js} +68 -66
  139. package/dist/chunk-ORMXPSJM.js +1 -0
  140. package/dist/chunk-ORYEDUKM.js +5 -0
  141. package/dist/{chunk-MZCIRMZJ.js → chunk-OTMYJWIP.js} +1 -1
  142. package/dist/chunk-OVJVFB5E.js +20 -0
  143. package/dist/chunk-OWQEFORZ.js +1 -0
  144. package/dist/{chunk-43HKFLOU.js → chunk-OXPEBT4I.js} +2 -2
  145. package/dist/chunk-OXZR2MB4.js +6 -0
  146. package/dist/chunk-OY5M52EF.js +6 -0
  147. package/dist/{chunk-FK5OFLSJ.js → chunk-PJZZZNWR.js} +1 -1
  148. package/dist/chunk-Q2LQJYRK.js +16 -0
  149. package/dist/chunk-QBRRFFMZ.js +1 -0
  150. package/dist/{chunk-KNQXCU3Y.js → chunk-QCLE5REL.js} +2 -2
  151. package/dist/chunk-QGQWVA7N.js +1 -0
  152. package/dist/chunk-QKPAB245.js +1 -0
  153. package/dist/chunk-QUPZOBTB.js +1 -0
  154. package/dist/chunk-R4E2E4NN.js +1 -0
  155. package/dist/{chunk-2M4BKFYF.js → chunk-R6US7F33.js} +1 -1
  156. package/dist/chunk-RKNVTEO3.js +5 -0
  157. package/dist/{chunk-2QQ7EBJD.js → chunk-RLOEI6VE.js} +1 -1
  158. package/dist/chunk-RSZAAN37.js +1 -0
  159. package/dist/{chunk-WBJ6ZHYH.js → chunk-S3RROJGG.js} +37 -37
  160. package/dist/chunk-S4KNPCW3.js +81 -0
  161. package/dist/{chunk-YFRI75U4.js → chunk-SBN3ILXO.js} +1 -1
  162. package/dist/chunk-SCDGLREP.js +1 -0
  163. package/dist/chunk-SHOMIS6Q.js +2 -0
  164. package/dist/chunk-SN3PMWUF.js +6 -0
  165. package/dist/chunk-SODCXZ5U.js +1 -0
  166. package/dist/chunk-SPJM7RTD.js +1 -0
  167. package/dist/chunk-SQL67BKI.js +5 -0
  168. package/dist/{chunk-MMUGP3WP.js → chunk-SURFUFAZ.js} +1 -1
  169. package/dist/{chunk-KOTZSPZA.js → chunk-SVQDMZJO.js} +1 -1
  170. package/dist/chunk-T4ZOTYOY.js +1 -0
  171. package/dist/chunk-T6C4WC3Z.js +2 -0
  172. package/dist/chunk-TD6JBHUS.js +1 -0
  173. package/dist/chunk-TIM4CIXZ.js +22 -0
  174. package/dist/{chunk-V2FCZC7U.js → chunk-TP7CTMMT.js} +1 -1
  175. package/dist/chunk-TSPJAMYB.js +1 -0
  176. package/dist/chunk-TSVEV2UD.js +26 -0
  177. package/dist/chunk-TTAT62N3.js +25 -0
  178. package/dist/{chunk-ZVEBXHEY.js → chunk-TUSS6PXB.js} +1 -1
  179. package/dist/chunk-TXP6KFWO.js +5 -0
  180. package/dist/chunk-TZHVCMZN.js +6 -0
  181. package/dist/chunk-UC4TOM36.js +3 -0
  182. package/dist/{chunk-2YGPWG3I.js → chunk-UFY4L5KQ.js} +1 -1
  183. package/dist/chunk-UU6UQ2QY.js +1 -0
  184. package/dist/chunk-V4FC72R6.js +1 -0
  185. package/dist/chunk-VA2S7W7H.js +10 -0
  186. package/dist/chunk-VE3IIC7H.js +1 -0
  187. package/dist/{chunk-EH22T4FI.js → chunk-VJG7VXFU.js} +2 -2
  188. package/dist/chunk-VQSRU5XL.js +4 -0
  189. package/dist/chunk-VRIFLMA3.js +70 -0
  190. package/dist/chunk-WBJFTCEJ.js +1 -0
  191. package/dist/chunk-WBPP6PO7.js +31 -0
  192. package/dist/chunk-WE5KY6T6.js +1 -0
  193. package/dist/chunk-WFPVT2IY.js +1 -0
  194. package/dist/{chunk-ETXBF6Q7.js → chunk-WLYXBQ2M.js} +1 -1
  195. package/dist/chunk-WNVOEE6T.js +7 -0
  196. package/dist/chunk-WPDJVUTY.js +47 -0
  197. package/dist/chunk-WWCYEZUU.js +1 -0
  198. package/dist/chunk-WWVDZ3GC.js +3 -0
  199. package/dist/{chunk-CXPYOLGM.js → chunk-WZBZ7FWP.js} +2 -2
  200. package/dist/chunk-XEZPN5TR.js +22 -0
  201. package/dist/{chunk-AQ34X5B3.js → chunk-XLMKHTJ5.js} +1 -1
  202. package/dist/chunk-XRNBCV2B.js +1 -0
  203. package/dist/{chunk-B4ISKIXN.js → chunk-XWLNCBAG.js} +1 -1
  204. package/dist/chunk-YF4AXKM4.js +1 -0
  205. package/dist/chunk-YKDRUAY3.js +857 -0
  206. package/dist/{chunk-FPOZMNT2.js → chunk-YNFQBYSL.js} +1 -1
  207. package/dist/{chunk-2CJQQQW4.js → chunk-YNZLLZU2.js} +1 -1
  208. package/dist/chunk-YOYPYB4H.js +1 -0
  209. package/dist/{chunk-HF4NDEX3.js → chunk-YR4J46US.js} +1 -1
  210. package/dist/chunk-YTL45RXR.js +103 -0
  211. package/dist/chunk-YVPB7OT6.js +6 -0
  212. package/dist/chunk-YYWSHRO2.js +89 -0
  213. package/dist/{chunk-5XOEMYEQ.js → chunk-Z5QEXS6F.js} +1 -1
  214. package/dist/chunk-Z5WFRYVQ.js +6 -0
  215. package/dist/{chunk-P5W5RVE6.js → chunk-Z6ZRS256.js} +1 -1
  216. package/dist/chunk-ZMOW2YZ4.js +18 -0
  217. package/dist/chunk-ZMU4EYXT.js +1 -0
  218. package/dist/{chunk-ACA2BGAD.js → chunk-ZNEPRGFY.js} +1 -1
  219. package/dist/chunk-ZXZWMXXK.js +7 -0
  220. package/dist/cli/commands/app/build.js +1 -1
  221. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  222. package/dist/cli/commands/app/bulk/execute.js +1 -1
  223. package/dist/cli/commands/app/bulk/status.js +1 -1
  224. package/dist/cli/commands/app/config/link.js +1 -1
  225. package/dist/cli/commands/app/config/pull.js +1 -1
  226. package/dist/cli/commands/app/config/use.js +1 -1
  227. package/dist/cli/commands/app/config/validate.js +1 -1
  228. package/dist/cli/commands/app/demo/watcher.js +1 -1
  229. package/dist/cli/commands/app/deploy.js +1 -1
  230. package/dist/cli/commands/app/dev/clean.js +1 -1
  231. package/dist/cli/commands/app/dev.js +1 -1
  232. package/dist/cli/commands/app/env/pull.js +1 -1
  233. package/dist/cli/commands/app/env/show.js +1 -1
  234. package/dist/cli/commands/app/execute.js +1 -1
  235. package/dist/cli/commands/app/function/build.js +1 -1
  236. package/dist/cli/commands/app/function/info.js +1 -1
  237. package/dist/cli/commands/app/function/replay.js +1 -1
  238. package/dist/cli/commands/app/function/run.js +1 -1
  239. package/dist/cli/commands/app/function/schema.js +1 -1
  240. package/dist/cli/commands/app/function/typegen.js +1 -1
  241. package/dist/cli/commands/app/generate/extension.js +1 -1
  242. package/dist/cli/commands/app/graphiql.js +1 -1
  243. package/dist/cli/commands/app/import/channel-config.js +1 -1
  244. package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
  245. package/dist/cli/commands/app/import/dashboard-extensions.js +1 -1
  246. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  247. package/dist/cli/commands/app/import-extensions.js +1 -1
  248. package/dist/cli/commands/app/info.js +1 -1
  249. package/dist/cli/commands/app/init.js +1 -1
  250. package/dist/cli/commands/app/logs-next.js +1 -0
  251. package/dist/cli/commands/app/logs.js +1 -1
  252. package/dist/cli/commands/app/release.js +1 -1
  253. package/dist/cli/commands/app/security/check.js +1 -1
  254. package/dist/cli/commands/app/security/clean.js +1 -1
  255. package/dist/cli/commands/app/security/instructions.js +1 -1
  256. package/dist/cli/commands/app/security/record.js +1 -1
  257. package/dist/cli/commands/app/security/review.js +1 -1
  258. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  259. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  260. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  261. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  262. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  263. package/dist/cli/commands/app/versions/list.js +1 -1
  264. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  265. package/dist/cli/commands/auth/login.d.ts +10 -10
  266. package/dist/cli/commands/auth/login.js +1 -1
  267. package/dist/cli/commands/auth/logout.d.ts +7 -7
  268. package/dist/cli/commands/auth/logout.js +1 -1
  269. package/dist/cli/commands/cache/clear.js +1 -1
  270. package/dist/cli/commands/config/autoupgrade/off.d.ts +7 -7
  271. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  272. package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -7
  273. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  274. package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -7
  275. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  276. package/dist/cli/commands/debug/command-flags.js +1 -1
  277. package/dist/cli/commands/doc/fetch.d.ts +21 -21
  278. package/dist/cli/commands/doc/fetch.js +1 -1
  279. package/dist/cli/commands/doc/search.d.ts +23 -23
  280. package/dist/cli/commands/doc/search.js +1 -1
  281. package/dist/cli/commands/docs/generate.js +1 -1
  282. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  283. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  284. package/dist/cli/commands/help.d.ts +90 -90
  285. package/dist/cli/commands/help.js +1 -1
  286. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  287. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  288. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  289. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  290. package/dist/cli/commands/notifications/generate.js +1 -1
  291. package/dist/cli/commands/notifications/list.js +1 -1
  292. package/dist/cli/commands/organization/list.js +1 -1
  293. package/dist/cli/commands/search.d.ts +7 -7
  294. package/dist/cli/commands/search.js +1 -1
  295. package/dist/cli/commands/send-analytics.js +1 -1
  296. package/dist/cli/commands/theme/check.js +1 -1
  297. package/dist/cli/commands/theme/console.js +1 -1
  298. package/dist/cli/commands/theme/delete.js +1 -1
  299. package/dist/cli/commands/theme/dev.js +1 -1
  300. package/dist/cli/commands/theme/duplicate.js +1 -1
  301. package/dist/cli/commands/theme/info.js +1 -1
  302. package/dist/cli/commands/theme/init.js +1 -1
  303. package/dist/cli/commands/theme/language-server.js +1 -1
  304. package/dist/cli/commands/theme/list.js +1 -1
  305. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  306. package/dist/cli/commands/theme/open.js +1 -1
  307. package/dist/cli/commands/theme/package.js +1 -1
  308. package/dist/cli/commands/theme/preview.js +1 -1
  309. package/dist/cli/commands/theme/profile.js +1 -1
  310. package/dist/cli/commands/theme/publish.js +1 -1
  311. package/dist/cli/commands/theme/pull.js +1 -1
  312. package/dist/cli/commands/theme/push.js +1 -1
  313. package/dist/cli/commands/theme/rename.js +1 -1
  314. package/dist/cli/commands/theme/share.js +1 -1
  315. package/dist/cli/commands/upgrade.d.ts +24 -24
  316. package/dist/cli/commands/upgrade.js +1 -1
  317. package/dist/cli/commands/version.d.ts +7 -7
  318. package/dist/cli/commands/version.js +1 -1
  319. package/dist/cli/help.js +1 -1
  320. package/dist/cli-version-check-V25AVSZ6.js +1 -0
  321. package/dist/{command-event-context-LFUZ7UCA.js → command-event-context-ILIANB5Q.js} +1 -1
  322. package/dist/command-json-schema-C5UZXP2W.js +1 -0
  323. package/dist/command-registry.js +1 -1
  324. package/dist/conf-store-OCGEEV4U.js +1 -0
  325. package/dist/custom-oclif-loader-ZVUKMRGH.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 +78 -36
  330. package/dist/data/section.json +1 -1
  331. package/dist/data/shopify_system_translations.json +240 -23
  332. package/dist/data/strict_settings.json +24 -0
  333. package/dist/data/tags.json +57 -24
  334. package/dist/data/theme_block.json +1 -1
  335. package/dist/deprecations-A5AXXKIK.js +1 -0
  336. package/dist/dist-NORLLIHQ.js +1 -0
  337. package/dist/dist-XBM4XZS4.js +1 -0
  338. package/dist/environment-5P7JJ3GI.js +1 -0
  339. package/dist/environments-Y5JEI3U3.js +1 -0
  340. package/dist/error-GI4DXVDU.js +1 -0
  341. package/dist/error-handler-BS2ZENQV.js +1 -0
  342. package/dist/fs-UOOLPOHJ.js +1 -0
  343. package/dist/hooks/did-you-mean.js +1 -1
  344. package/dist/hooks/hydrogen-init.js +1 -1
  345. package/dist/hooks/plugin-plugins.js +1 -1
  346. package/dist/hooks/postrun.js +1 -1
  347. package/dist/hooks/prerun.js +2 -2
  348. package/dist/hooks/public-metadata.js +1 -1
  349. package/dist/hooks/sensitive-metadata.js +1 -1
  350. package/dist/hooks/tunnel-provider.js +1 -1
  351. package/dist/hooks/tunnel-start.js +1 -1
  352. package/dist/http-2OXOS2AW.js +1 -0
  353. package/dist/http-proxy-node16-NZZ674YW.js +38 -0
  354. package/dist/index.js +12 -12
  355. package/dist/is-global-CI77T7NE.js +1 -0
  356. package/dist/json-error-6PBUR4LQ.js +1 -0
  357. package/dist/latest-version-75YEFEMK.js +9 -0
  358. package/dist/lib-4JVADMNT.js +1 -0
  359. package/dist/lib-L4STV5B2.js +1 -0
  360. package/dist/lib-LEEN55OD.js +1 -0
  361. package/dist/{local-KA3IWOZ6.js → local-5NIWPWDS.js} +1 -1
  362. package/dist/metadata-IXPNNPNJ.js +1 -0
  363. package/dist/{morph-CRY35DIK.js → morph-H7XQP55V.js} +3 -3
  364. package/dist/node-package-manager-ALFEGGD6.js +1 -0
  365. package/dist/notifications-system-FQW3GKH2.js +1 -0
  366. package/dist/{npa-A4YSCQ5Q.js → npa-LVYMN7GE.js} +1 -1
  367. package/dist/os-6TNQTEUN.js +1 -0
  368. package/dist/output-LEOB5LAM.js +1 -0
  369. package/dist/{prettier-EGVCP5CY.js → prettier-VLTY4MIE.js} +1 -1
  370. package/dist/registry-auth-token-EDH77OOW.js +1 -0
  371. package/dist/registry-url-JMNV3LLX.js +1 -0
  372. package/dist/semver-HHZRKD6Y.js +1 -0
  373. package/dist/system-J4CTESP5.js +1 -0
  374. package/dist/tsconfig.tsbuildinfo +1 -1
  375. package/dist/ui-YDUI56E3.js +1 -0
  376. package/dist/upgrade-LBCZORG2.js +1 -0
  377. package/dist/version-2YL4YEQ2.js +1 -0
  378. package/dist/version-X2CPQVWQ.js +1 -0
  379. package/dist/workerd-5UPTEWNI.js +18 -0
  380. package/oclif.manifest.json +25622 -1132
  381. package/package.json +7 -7
  382. package/dist/analytics-RSUIYNLC.js +0 -1
  383. package/dist/analytics-V2SDYXQJ.js +0 -1
  384. package/dist/chunk-2AW3KBTP.js +0 -1
  385. package/dist/chunk-2M535QQJ.js +0 -6
  386. package/dist/chunk-2NZ7GDDR.js +0 -2
  387. package/dist/chunk-2RFCYZMG.js +0 -47
  388. package/dist/chunk-2S5NPJEJ.js +0 -5
  389. package/dist/chunk-2TPLPZA2.js +0 -3
  390. package/dist/chunk-32O27NE3.js +0 -1
  391. package/dist/chunk-335BUVBP.js +0 -1
  392. package/dist/chunk-46JYM3GH.js +0 -1
  393. package/dist/chunk-4GQEXVDT.js +0 -1
  394. package/dist/chunk-4IUXLUFD.js +0 -6
  395. package/dist/chunk-4QZ6OBXL.js +0 -4
  396. package/dist/chunk-4SDCXKYR.js +0 -31
  397. package/dist/chunk-5AQ5JT2V.js +0 -7
  398. package/dist/chunk-5D4FNAAD.js +0 -3
  399. package/dist/chunk-5TWYJQQO.js +0 -1
  400. package/dist/chunk-5YXYYQBX.js +0 -1
  401. package/dist/chunk-6JZC6UKY.js +0 -20
  402. package/dist/chunk-6Y6A2QGK.js +0 -3
  403. package/dist/chunk-7AWAOPLA.js +0 -1
  404. package/dist/chunk-7XAEI4XT.js +0 -3
  405. package/dist/chunk-A7LBGXWG.js +0 -1
  406. package/dist/chunk-ADVLRSSO.js +0 -1
  407. package/dist/chunk-AOBE6HN6.js +0 -31
  408. package/dist/chunk-B2VE7WOX.js +0 -1
  409. package/dist/chunk-BB7GAZP6.js +0 -1
  410. package/dist/chunk-BNTOGZLY.js +0 -1
  411. package/dist/chunk-BOAGJ6P5.js +0 -1
  412. package/dist/chunk-BU3JQM3W.js +0 -1
  413. package/dist/chunk-C3LL5CZA.js +0 -1
  414. package/dist/chunk-CFUZ6574.js +0 -15
  415. package/dist/chunk-CKVVJ4XO.js +0 -1
  416. package/dist/chunk-CNPBDSDL.js +0 -1
  417. package/dist/chunk-DTRENW4Q.js +0 -272
  418. package/dist/chunk-E3CTHNQS.js +0 -1
  419. package/dist/chunk-FFSDGRAN.js +0 -1
  420. package/dist/chunk-FNWXMCSD.js +0 -97
  421. package/dist/chunk-FS5PZCZ3.js +0 -1
  422. package/dist/chunk-FTHVOIK7.js +0 -4
  423. package/dist/chunk-FVRI7ZKE.js +0 -103
  424. package/dist/chunk-FZCGRIOM.js +0 -1
  425. package/dist/chunk-GCKGQFV7.js +0 -1
  426. package/dist/chunk-GGJUPL4W.js +0 -6
  427. package/dist/chunk-GHU6YEXH.js +0 -15
  428. package/dist/chunk-GNPIKPHB.js +0 -1
  429. package/dist/chunk-H57KYDEI.js +0 -16
  430. package/dist/chunk-HB3MJYBK.js +0 -1
  431. package/dist/chunk-HNU6R7RT.js +0 -7
  432. package/dist/chunk-HPT3UXZ5.js +0 -4
  433. package/dist/chunk-HXNGLDMU.js +0 -1
  434. package/dist/chunk-IAL6IQYW.js +0 -16
  435. package/dist/chunk-IULZYDCI.js +0 -9
  436. package/dist/chunk-IWTOC6DG.js +0 -1
  437. package/dist/chunk-J3JPJCWP.js +0 -1
  438. package/dist/chunk-J3UXIC23.js +0 -10
  439. package/dist/chunk-J7BTC45S.js +0 -1
  440. package/dist/chunk-JMVK2BIB.js +0 -3
  441. package/dist/chunk-JUTULEWW.js +0 -5
  442. package/dist/chunk-KT5QQOES.js +0 -3
  443. package/dist/chunk-KVF55INC.js +0 -5
  444. package/dist/chunk-L6VONMA2.js +0 -5
  445. package/dist/chunk-LWMKZJ4M.js +0 -1
  446. package/dist/chunk-M2KX3PXA.js +0 -1
  447. package/dist/chunk-M7NLCGCP.js +0 -6
  448. package/dist/chunk-MHWETFNT.js +0 -1
  449. package/dist/chunk-MNWT2SQO.js +0 -2265
  450. package/dist/chunk-MU2X7NGF.js +0 -11
  451. package/dist/chunk-MZWPIFAM.js +0 -70
  452. package/dist/chunk-NCPZVARH.js +0 -836
  453. package/dist/chunk-NMECLRGK.js +0 -11
  454. package/dist/chunk-NMLLRFZF.js +0 -1
  455. package/dist/chunk-NPB753M3.js +0 -1
  456. package/dist/chunk-OH7BQZQ7.js +0 -2
  457. package/dist/chunk-OLKLHVHA.js +0 -22
  458. package/dist/chunk-OPVXPDOQ.js +0 -1
  459. package/dist/chunk-OQUXGAF2.js +0 -1
  460. package/dist/chunk-OUMERKRE.js +0 -10
  461. package/dist/chunk-OYGIQDME.js +0 -1
  462. package/dist/chunk-PNZURX3S.js +0 -1
  463. package/dist/chunk-PRKJVU4Y.js +0 -1
  464. package/dist/chunk-PXFPVGWV.js +0 -1
  465. package/dist/chunk-Q2ORJEB2.js +0 -25
  466. package/dist/chunk-QFWWCZOI.js +0 -1
  467. package/dist/chunk-QFYLJVJW.js +0 -77
  468. package/dist/chunk-QX3T6G5X.js +0 -1
  469. package/dist/chunk-RDXLDCMI.js +0 -3
  470. package/dist/chunk-REDUS6EW.js +0 -1
  471. package/dist/chunk-RFZNFTVM.js +0 -1
  472. package/dist/chunk-RIG66DIQ.js +0 -18
  473. package/dist/chunk-RNUEPPVN.js +0 -1
  474. package/dist/chunk-RWTAPWLJ.js +0 -3
  475. package/dist/chunk-T5YVYVSW.js +0 -1
  476. package/dist/chunk-UDPYSL3M.js +0 -4
  477. package/dist/chunk-ULMNNGGX.js +0 -6
  478. package/dist/chunk-URCH4ITT.js +0 -1
  479. package/dist/chunk-UU2R56LN.js +0 -12
  480. package/dist/chunk-V75WUEFU.js +0 -1
  481. package/dist/chunk-VXD26GIG.js +0 -1
  482. package/dist/chunk-W7S6SYBM.js +0 -2
  483. package/dist/chunk-WAY723TL.js +0 -16
  484. package/dist/chunk-WFOU5M4H.js +0 -16
  485. package/dist/chunk-WGOSE3RL.js +0 -4
  486. package/dist/chunk-WQ6W725N.js +0 -1
  487. package/dist/chunk-X7DCL5LT.js +0 -1
  488. package/dist/chunk-XDXHSGDL.js +0 -1
  489. package/dist/chunk-XKKKMV46.js +0 -6
  490. package/dist/chunk-XRVJJG6W.js +0 -26
  491. package/dist/chunk-XV6XCOTG.js +0 -319
  492. package/dist/chunk-XYFYQWKW.js +0 -1
  493. package/dist/chunk-YCUEDZDA.js +0 -1
  494. package/dist/chunk-YQ63ZFYT.js +0 -1
  495. package/dist/chunk-YXIFSIRX.js +0 -1
  496. package/dist/chunk-ZDQO6CNY.js +0 -1
  497. package/dist/chunk-ZGASBRSQ.js +0 -5
  498. package/dist/command-json-schema-6EGXCM4B.js +0 -1
  499. package/dist/conf-store-E7ELDWBA.js +0 -1
  500. package/dist/custom-oclif-loader-FKFZJPHF.js +0 -1
  501. package/dist/deprecations-RNGBHZYB.js +0 -1
  502. package/dist/dist-VHIZZDYK.js +0 -1
  503. package/dist/dist-WXI5YQYP.js +0 -1
  504. package/dist/environment-O7ECODHU.js +0 -1
  505. package/dist/environments-WZJ6MRTH.js +0 -1
  506. package/dist/error-IFB626JA.js +0 -1
  507. package/dist/error-handler-OVJYVIOZ.js +0 -1
  508. package/dist/fs-7UOUHJDO.js +0 -1
  509. package/dist/http-proxy-node16-D3JUYA5D.js +0 -38
  510. package/dist/is-global-XW3CVHLK.js +0 -1
  511. package/dist/json-error-C2U7ZLCG.js +0 -1
  512. package/dist/latest-version-LDWU5F7A.js +0 -49
  513. package/dist/lib-PJHT4MKY.js +0 -1
  514. package/dist/lib-VKSQ65BQ.js +0 -1
  515. package/dist/lib-YEZOHXF3.js +0 -1
  516. package/dist/metadata-6JI7HF5B.js +0 -1
  517. package/dist/node-package-manager-X3QIEMMX.js +0 -1
  518. package/dist/notifications-system-OXGLT2R4.js +0 -1
  519. package/dist/os-NORIEVMI.js +0 -1
  520. package/dist/output-K3JTLRJD.js +0 -1
  521. package/dist/system-LTHR2T7L.js +0 -1
  522. package/dist/ui-MYUBVKCK.js +0 -1
  523. package/dist/upgrade-MFTWBXL3.js +0 -1
  524. package/dist/version-BNGPPAUU.js +0 -1
  525. package/dist/version-RCGFWSB4.js +0 -1
  526. package/dist/workerd-ISSXMKIH.js +0 -18
  527. /package/dist/{chunk-YLQ3LNNY.js → chunk-2S3FHQFS.js} +0 -0
  528. /package/dist/{chunk-YRHFPXC3.js → chunk-Z2AV4BWZ.js} +0 -0
@@ -1 +0,0 @@
1
- import{b as y,c as S,f as C,g as B}from"./chunk-YXIFSIRX.js";import{a as x}from"./chunk-BU3JQM3W.js";import{a as b}from"./chunk-D4LFWIFE.js";import{Na as w,q as g}from"./chunk-XV6XCOTG.js";import{b as h,c as F}from"./chunk-5AWELO3D.js";import{A as d,y as l}from"./chunk-V654BMS7.js";import{c as p}from"./chunk-F3OM2YO6.js";import{a}from"./chunk-BN7ZXAZJ.js";import{wb as f}from"./chunk-RIG66DIQ.js";import{b as s,h as m}from"./chunk-FZCGRIOM.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();o();var j=S.extend({wasmPath:y.nullable().describe("The built Wasm file, or null when the build produced no file.")}).strict(),e=a({name:"FunctionBuildResult",schema:s.object({status:s.literal("success"),function:j}).strict(),definitions:{FunctionBuild:j}});o();function A(n,t){t?f(e.encode(n)):d({headline:"Function built successfully."})}var r=class n extends x{static get jsonOutputSchema(){return e}static summary="Compile a function to wasm.";static descriptionWithMarkdown="Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes.";static description=this.descriptionForHelp();static flags={...h,...b,...C,...F};async run(){let{flags:t}=await this.parse(n),{app:i}=await w({directory:t.path,userProvidedConfigName:t.config}),u=await B(i,t.path),c=async(J,O)=>{let W=await g(u,{app:i,stdout:J,stderr:O,useTasks:!0,environment:"production"});A(W,t.json)};return t.json?await m({outputMode:"json",sink:p},()=>l({processes:[{prefix:u.localIdentifier,action:c}],showTimestamps:!1})):await c(process.stdout,process.stderr),{app:i}}};export{r as a};
@@ -1 +0,0 @@
1
- import{a as K}from"./chunk-BOAGJ6P5.js";import{c as J,g as E}from"./chunk-VKWPEFWQ.js";var _=J((k,D)=>{E();var B=K();D.exports=U;var L="\0SLASH"+Math.random()+"\0",S="\0OPEN"+Math.random()+"\0",j="\0CLOSE"+Math.random()+"\0",Z="\0COMMA"+Math.random()+"\0",w="\0PERIOD"+Math.random()+"\0";function y(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function Q(r){return r.split("\\\\").join(L).split("\\{").join(S).split("\\}").join(j).split("\\,").join(Z).split("\\.").join(w)}function T(r){return r.split(L).join("\\").split(S).join("{").split(j).join("}").split(Z).join(",").split(w).join(".")}function z(r){if(!r)return[""];var t=[],i=B("{","}",r);if(!i)return r.split(",");var p=i.pre,c=i.body,f=i.post,n=p.split(",");n[n.length-1]+="{"+c+"}";var h=z(f);return f.length&&(n[n.length-1]+=h.shift(),n.push.apply(n,h)),t.push.apply(t,n),t}function U(r,t){if(!r)return[];t=t||{};var i=t.max==null?1/0:t.max;return r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),v(Q(r),i,!0).map(T)}function V(r){return"{"+r+"}"}function W(r){return/^-?0\d/.test(r)}function X(r,t){return r<=t}function Y(r,t){return r>=t}function v(r,t,i){for(var p=[];;){let a=B("{","}",r);if(!a)return[r];let x=a.pre;if(/\$$/.test(a.pre)){let d=a.post.length?v(a.post,t,!1):[""];for(let g=0;g<d.length&&g<t;g++){let G=x+"{"+a.body+"}"+d[g];p.push(G)}return p}var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),n=c||f,h=a.body.indexOf(",")>=0;if(!n&&!h){if(a.post.match(/,(?!,).*\}/)){r=a.pre+"{"+a.body+j+a.post,i=!0;continue}return[r]}let b=a.post.length?v(a.post,t,!1):[""];var e;if(n)e=a.body.split(/\.\./);else if(e=z(a.body),e.length===1&&(e=v(e[0],t,!1).map(V),e.length===1))return b.map(function(d){return a.pre+e[0]+d});var s;if(n){var M=y(e[0]),C=y(e[1]),H=Math.max(e[0].length,e[1].length),O=e.length==3?Math.max(Math.abs(y(e[2])),1):1,P=X,R=C<M;R&&(O*=-1,P=Y);var F=e.some(W);s=[];for(var u=M;P(u,C)&&s.length<t;u+=O){var o;if(f)o=String.fromCharCode(u),o==="\\"&&(o="");else if(o=String(u),F){var A=H-o.length;if(A>0){var I=new Array(A+1).join("0");u<0?o="-"+I+o.slice(1):o=I+o}}s.push(o)}}else{s=[];for(var l=0;l<e.length;l++)s.push.apply(s,v(e[l],t,!1))}for(var l=0;l<s.length;l++)for(var m=0;m<b.length&&p.length<t;m++){var $=x+s[l]+b[m];(!i||n||$)&&p.push($)}return p}}});export{_ as a};
@@ -1,97 +0,0 @@
1
- import{a as I,b as M}from"./chunk-ACA2BGAD.js";import{a as A}from"./chunk-D4LFWIFE.js";import{ba as u}from"./chunk-XV6XCOTG.js";import{e as p}from"./chunk-NCPZVARH.js";import{b as O,c as y,f as E}from"./chunk-5AWELO3D.js";import{a as c}from"./chunk-BN7ZXAZJ.js";import{b as t}from"./chunk-FZCGRIOM.js";import{b as w}from"./chunk-YTUUU33R.js";import{e as H,g as n}from"./chunk-VKWPEFWQ.js";n();n();var k=["HONOR_BILLING_PRICE","PLAN_PRICE"],W=["OPT_OUT","WHEN_REQUIRED"],D=["UNSCHEDULED","SCHEDULED","MIGRATED"];var r=H(w(),1);var m={...O,...A,...y},K={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final outcome when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},B={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final state when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},et={...m,status:r.Flags.option({description:"Filter subscriptions by migration status.",env:"SHOPIFY_FLAG_STATUS",options:[...D]})()},it={...m,input:r.Flags.string({char:"i",description:"Path to the migration CSV. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),force:E(r.Flags.boolean({char:"f",description:"Skip confirmation.",env:"SHOPIFY_FLAG_FORCE",default:!1})),...K},q={...m,id:r.Flags.string({description:"The app subscription migration operation ID. Can be specified multiple times.",env:"SHOPIFY_FLAG_ID",required:!0,multiple:!0})},nt={...q,...B};n();var l=t.string().regex(/^gid:\/\/shopify\/AppSubscriptionMigrationOperation\/[^/]+$/).describe("The Shopify AppSubscriptionMigrationOperation GID."),F=t.string().regex(/^gid:\/\/shopify\/Shop\/\d+$/).describe("The Shopify Shop GID."),o=t.object({gid:l,status:t.string().min(1).describe("Upstream status: RUNNING, COMPLETED, FAILED, or CANCELED."),total:t.number().int().nonnegative(),results:t.array(t.object({shopGid:F,code:t.string().min(1).describe("The upstream per-shop migration result code.")}).strict())}).strict(),g=t.object({message:t.string(),fieldPath:t.array(t.string()).nullable()}).strict(),C=t.discriminatedUnion("status",[t.object({status:t.literal("success"),operationGid:l,operation:o}).strict(),t.object({status:t.literal("failed"),operationGid:l,operation:o.nullable(),error:t.union([I.extend({details:t.object({userErrors:t.array(g)}).strict()}),M])}).strict()]),pt=c({name:"MigrationCancellationResult",schema:t.object({status:t.enum(["success","partial"]),operations:t.array(C)}).strict(),definitions:{MigrationCancellationOutcome:C,MigrationOperation:o,MigrationUserError:g}}),b=t.string().datetime().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/),Y=t.string().date(),N=t.object({amount:t.string().regex(/^-?\d+(?:\.\d+)?$/),currencyCode:t.string().regex(/^[A-Z]{3}$/)}).strict(),R=t.object({kind:t.string().describe("Known values: NONE, OPT_OUT, WHEN_REQUIRED."),optOutDeadline:b.nullable(),sentAt:b.nullable()}).strict(),P=t.object({shopGid:F,status:t.string().describe("Known values: UNSCHEDULED, SCHEDULED, MIGRATED."),manualSubscriptionName:t.string().nullable(),manualSubscriptionPrice:N.nullable(),manualSubscriptionInterval:t.string().describe("Known values: EVERY_30_DAYS, ANNUAL."),targetPlanHandle:t.string().nullable(),notification:R.nullable(),priceBehavior:t.string().nullable().describe("Known values: HONOR_BILLING_PRICE, PLAN_PRICE."),effectiveDate:t.union([Y,b]).nullable().describe("The upstream calendar date or whole-second UTC instant; date-only values retain their format."),lastFailureReason:t.string().nullable().describe("Known values: SUPERSEDED, SCHEDULING_FAILED.")}).strict().describe("All subscription projection fields are present; unavailable values are null."),ut=c({name:"MigrationListResult",schema:t.object({subscriptions:t.array(P).describe("The complete list across every fetched page.")}).strict(),definitions:{MigratableSubscription:P,MigratableSubscriptionPrice:N,MigratableSubscriptionNotification:R}}),T=t.object({batchIndex:t.number().int().nonnegative(),batchPayloadDigest:t.string().min(1),operation:o}).strict(),v=t.discriminatedUnion("type",[t.object({type:t.literal("submission"),batchIndex:t.number().int().nonnegative(),userErrors:t.array(g)}).strict(),t.object({type:t.literal("operations"),operationGids:t.array(l)}).strict()]);function x(){return{clientId:t.string().min(1).describe("The app client ID, not a Shopify GID."),action:t.enum(["schedule","unschedule"]),inputDigest:t.string().min(1),total:t.number().int().nonnegative(),operations:t.array(T)}}var lt=c({name:"MigrationSubmissionResult",schema:t.discriminatedUnion("status",[t.object({status:t.literal("success"),changed:t.boolean(),...x()}).strict(),t.object({status:t.literal("partial"),changed:t.boolean(),...x(),failure:v}).strict(),t.object({status:t.literal("cancelled"),changed:t.literal(!1),action:t.enum(["schedule","unschedule"]),reason:t.string()}).strict()]),definitions:{SubmittedMigrationOperation:T,MigrationOperation:o,MigrationSubmissionFailure:v,MigrationUserError:g}}),gt=c({name:"MigrationStatusResult",schema:t.object({operations:t.array(o)}).strict(),definitions:{MigrationOperation:o}});n();function J(e){return{gid:e.id,status:e.status,total:e.total,results:e.results.edges.map(({node:i})=>({shopGid:i.shopId,code:i.code}))}}function Q(e){return e.map(({message:i,field:a})=>({message:i,fieldPath:a}))}function bt(e){return{shopGid:e.shopId,status:e.status,manualSubscriptionName:e.manualSubscriptionName,manualSubscriptionPrice:e.manualSubscriptionPrice===null?null:{amount:e.manualSubscriptionPrice.amount,currencyCode:e.manualSubscriptionPrice.currencyCode},manualSubscriptionInterval:e.manualSubscriptionInterval,targetPlanHandle:e.targetPlanHandle,notification:e.notification===null?null:{kind:e.notification.kind,optOutDeadline:S(e.notification.optOutDeadline),sentAt:S(e.notification.sentAt)},priceBehavior:e.priceBehavior,effectiveDate:e.effectiveDate===null||/^\d{4}-\d{2}-\d{2}$/.test(e.effectiveDate)?e.effectiveDate:S(e.effectiveDate),lastFailureReason:e.lastFailureReason}}function S(e){return e===null?null:new Date(e).toISOString().replace(/\.\d{3}Z$/,"Z")}function St(e){if(e.status==="cancelled")return e;let i={changed:e.submission.operations.length>0,clientId:e.submission.clientId,action:e.submission.action,inputDigest:e.submission.inputDigest,total:e.submission.total,operations:e.submission.operations.map(({batchIndex:a,batchPayloadDigest:s,operation:f})=>({batchIndex:a,batchPayloadDigest:s,operation:J(f)}))};return e.status==="success"?{status:"success",...i}:{status:"partial",...i,failure:e.failure.type==="submission"?{type:e.failure.type,batchIndex:e.failure.batchIndex,userErrors:Q(e.failure.userErrors)}:{type:e.failure.type,operationGids:e.failure.operationIds}}}n();n();var _=p`
2
- query MigratableAppSubscriptions(
3
- $apiKey: String!
4
- $first: Int!
5
- $after: String
6
- $status: AppSubscriptionMigrationStatus
7
- ) {
8
- migratableAppSubscriptions(apiKey: $apiKey, first: $first, after: $after, status: $status) {
9
- edges {
10
- cursor
11
- node {
12
- shopId
13
- status
14
- manualSubscriptionName
15
- manualSubscriptionPrice {
16
- amount
17
- currencyCode
18
- }
19
- manualSubscriptionInterval
20
- targetPlanHandle
21
- notification {
22
- kind
23
- optOutDeadline
24
- sentAt
25
- }
26
- priceBehavior
27
- effectiveDate
28
- lastFailureReason
29
- }
30
- }
31
- pageInfo {
32
- hasNextPage
33
- endCursor
34
- }
35
- }
36
- }
37
- `,U=p`
38
- mutation AppSubscriptionMigrationOperationCreate($input: AppSubscriptionMigrationOperationCreateInput!) {
39
- appSubscriptionMigrationOperationCreate(input: $input) {
40
- operation {
41
- id
42
- status
43
- total
44
- results(first: 250) {
45
- edges {
46
- node {
47
- shopId
48
- code
49
- }
50
- }
51
- }
52
- }
53
- userErrors {
54
- message
55
- field
56
- }
57
- }
58
- }
59
- `,G=p`
60
- query AppSubscriptionMigrationOperation($apiKey: String!, $id: ID!) {
61
- appSubscriptionMigrationOperation(apiKey: $apiKey, id: $id) {
62
- id
63
- status
64
- total
65
- results(first: 250) {
66
- edges {
67
- node {
68
- shopId
69
- code
70
- }
71
- }
72
- }
73
- }
74
- }
75
- `,L=p`
76
- mutation AppSubscriptionMigrationOperationCancel($input: AppSubscriptionMigrationOperationCancelInput!) {
77
- appSubscriptionMigrationOperationCancel(input: $input) {
78
- operation {
79
- id
80
- status
81
- total
82
- results(first: 250) {
83
- edges {
84
- node {
85
- shopId
86
- code
87
- }
88
- }
89
- }
90
- }
91
- userErrors {
92
- message
93
- field
94
- }
95
- }
96
- }
97
- `;function j(e){return e===null?null:{...e,results:{edges:e.results?.edges?.filter(i=>i!==null)??[]}}}function $(e){return{operation:j(e.operation),userErrors:e.userErrors??[]}}async function At({clientId:e,first:i,after:a,status:s}){let d=(await u.getInstance().request(_,{apiKey:e,first:i,after:a,status:s})).migratableAppSubscriptions;return d===null?null:{subscriptions:d.edges?.flatMap(h=>h===null?[]:[h.node])??[],pageInfo:d.pageInfo}}async function Dt({clientId:e,idempotencyKey:i,migrations:a}){let s=await u.getInstance().request(U,{input:{apiKey:e,idempotencyKey:i,migrations:a}});return $(s.appSubscriptionMigrationOperationCreate)}async function Ct({clientId:e,operationId:i}){let a=await u.getInstance().request(G,{apiKey:e,id:i});return j(a.appSubscriptionMigrationOperation)}async function Pt({clientId:e,operationId:i}){let a=await u.getInstance().request(L,{input:{apiKey:e,id:i}});return $(a.appSubscriptionMigrationOperationCancel)}export{k as a,W as b,et as c,it as d,q as e,nt as f,l as g,pt as h,ut as i,lt as j,gt as k,J as l,Q as m,bt as n,St as o,At as p,Dt as q,Ct as r,Pt as s};
@@ -1 +0,0 @@
1
- import{l as S,n as O,q as R}from"./chunk-2RFCYZMG.js";import{a as x}from"./chunk-63UKZLPC.js";import{e as J}from"./chunk-QFWWCZOI.js";import{p as E,v as j}from"./chunk-KT5QQOES.js";import{k as l,ua as u}from"./chunk-NCPZVARH.js";import{b as g,c as f}from"./chunk-5AWELO3D.js";import{A as b,B as I,O as _}from"./chunk-V654BMS7.js";import{h as s}from"./chunk-J7BTC45S.js";import{Ta as y,la as P,wb as w}from"./chunk-RIG66DIQ.js";import{b as p}from"./chunk-FZCGRIOM.js";import{b as N}from"./chunk-YTUUU33R.js";import{e as H,g as n}from"./chunk-VKWPEFWQ.js";n();n();n();async function $({session:r,overridesContent:e,themeId:t}){u("theme-preview:create");let d=`${O(r)}/theme_preview.json?preview_theme_id=${t}`,i=await S(r,{headers:{"Content-Type":"application/json"}}),o=await l(d,{method:"POST",body:e,headers:i});if(!o.ok)throw new s(`Theme preview request failed with status ${o.status}: ${o.statusText}`);let m=await U(o);return u("theme-preview:create"),m}async function A({session:r,overridesContent:e,themeId:t,previewIdentifier:a}){u("theme-preview:update");let i=`${O(r)}/theme_preview.json?preview_theme_id=${t}&preview_identifier=${encodeURIComponent(a)}`,o=await S(r,{headers:{"Content-Type":"application/json"}}),m=await l(i,{method:"POST",body:e,headers:o});if(!m.ok)throw new s(`Theme preview request failed with status ${m.status}: ${m.statusText}`);let v=await U(m);return u("theme-preview:update"),v}async function U(r){let e=await r.json();if(e.error)throw new s(`Theme preview failed: ${e.error}`);if(!e.url||!e.preview_identifier)throw new s("Theme preview returned an unexpected response");return{url:e.url,preview_identifier:e.preview_identifier}}async function L(r){if(!y(r.overrideJson))throw new s(`Override file not found: ${r.overrideJson}`);let e=await P(r.overrideJson),t;try{t=JSON.parse(e)}catch(i){let o=i instanceof Error?i.message:String(i);throw new s(`Failed to parse override file: ${r.overrideJson}`,o)}let a=await R(r.themeId,r.adminSession,r.password),d=JSON.stringify(t);return r.previewIdentifier?A({session:a,overridesContent:d,themeId:r.themeId,previewIdentifier:r.previewIdentifier}):$({session:a,overridesContent:d,themeId:r.themeId})}n();n();var C=p.object({id:p.string().min(1).describe("The opaque Storefront preview identifier, not a theme ID or Shopify GID."),url:p.string().url()}).strict(),h=J({name:"ThemePreviewResult",schema:p.object({status:p.literal("success"),preview:C}).strict(),definitions:{ThemePreview:C},project:r=>{let e=r;return{status:"success",preview:{id:e.preview_identifier,url:e.url}}}});function D(r,e,t){if(e==="json"){w(h.encode(r));return}b({body:[{list:{title:t?"Preview updated":"Preview is ready",items:[{link:{url:r.url}},`Preview ID: ${r.preview_identifier}`]}}]})}function T(r){let e="Failed to open theme preview.",t=r.stack??r.message;I({headline:e,body:t})}var c=H(N(),1);var F=class extends j{static get jsonOutputSchema(){return h}static summary="Applies JSON overrides to a theme and returns a preview URL.";static descriptionWithMarkdown="Applies a JSON overrides file to a theme and creates or updates a preview. This lets you quickly preview changes.\n\n The command returns a preview URL and a preview identifier. You can reuse the preview identifier with `--preview-id` to update an existing preview instead of creating a new one.";static description=this.descriptionForHelp();static flags={...g,...f,...E,theme:c.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"}),overrides:c.Flags.string({description:"Path to a JSON overrides file.",env:"SHOPIFY_FLAG_OVERRIDES"}),"preview-id":c.Flags.string({description:"An existing preview identifier to update instead of creating a new preview.",env:"SHOPIFY_FLAG_PREVIEW_ID"}),open:c.Flags.boolean({description:"Automatically launch the theme preview in your default web browser.",env:"SHOPIFY_FLAG_OPEN",default:!1}),json:c.Flags.boolean({...f.json,description:"Output the preview URL and identifier as JSON.",env:"SHOPIFY_FLAG_JSON",default:!1})};static multiEnvironmentsFlags=["store","password","theme","overrides"];async command(e,t,a=!1){let d=await x(t,{filter:{theme:e.theme}}),i=await L({adminSession:t,overrideJson:e.overrides,themeId:d.id.toString(),previewIdentifier:e["preview-id"],password:e.password}),o=e.json?"json":"text";return e.open&&await _(i.url).catch(v=>T(v))===!1&&T(new Error(`Could not open the browser. Open this URL manually: ${i.url}`)),(!a||!e.json)&&D(i,o,!!e["preview-id"]),i}renderEnvironmentResults(e){w(h.encode({environments:e}))}validateCommandFlags(e){if(!e.theme||!e.overrides)throw new s("Specify both --theme and --overrides, either as flags or in an environment.")}requiredFlagsForSingleEnvironment(e){return super.requiredFlagsForSingleEnvironment(e).filter(t=>t!=="store")}};export{F as a};
@@ -1,4 +0,0 @@
1
- import{a as m}from"./chunk-NPB753M3.js";import{a as c}from"./chunk-D4LFWIFE.js";import{Ea as p,Ga as d,Ia as l,Ma as g}from"./chunk-XV6XCOTG.js";import{b as a,c as f,f as s}from"./chunk-5AWELO3D.js";import{h as r}from"./chunk-J7BTC45S.js";import{b as I}from"./chunk-YTUUU33R.js";import{e as v,g as n}from"./chunk-VKWPEFWQ.js";n();var i=v(I(),1);var t=class h extends m{static summary="Fetch your app configuration from the Developer Dashboard.";static descriptionWithMarkdown=`Pulls app configuration from the Developer Dashboard and creates or overwrites a configuration file. You can create a new app with this command to start with a default configuration file.
2
-
3
- For more information on the format of the created TOML configuration file, refer to the [App configuration](https://shopify.dev/docs/apps/tools/cli/configuration) page.
4
- `;static get jsonOutputSchema(){return p}static description=this.descriptionForHelp();static flags={...a,...f,...c,config:i.Flags.string({hidden:!1,char:"c",description:"The name of the local app configuration to read and overwrite. Use --file-name instead when specifying --client-id.",env:"SHOPIFY_FLAG_APP_CONFIG"}),"organization-id":i.Flags.string({hidden:!0,env:"SHOPIFY_FLAG_ORGANIZATION_ID",exclusive:["client-id"]}),"client-id":s(i.Flags.string({hidden:!1,description:"The Client ID of the remote app to link. Use --file-name to specify the destination configuration file.",env:"SHOPIFY_FLAG_CLIENT_ID"})),"file-name":i.Flags.string({hidden:!1,description:"The name of the app configuration file to create or overwrite. Requires --force to overwrite an existing file.",env:"SHOPIFY_FLAG_APP_CONFIG_FILE_NAME",exclusive:["config"]}),force:i.Flags.boolean({hidden:!1,description:"Overwrite an existing configuration file without prompting.",env:"SHOPIFY_FLAG_FORCE",dependsOn:["file-name"]})};async run(){let{flags:e}=await this.parse(h);if(e.config!==void 0&&e["client-id"]!==void 0)throw new r("The --config and --client-id flags can't be used together.","Use --file-name instead of --config to choose the configuration file to create or overwrite.");let u={directory:e.path,apiKey:e["client-id"],organizationId:e["organization-id"],configName:e.config,fileName:e["file-name"],force:e.force??!1},o=await l(u),{app:F}=await g({directory:e.path,clientId:void 0,forceRelink:!1,userProvidedConfigName:o.configFileName});return d(o.result,o.packageManager,e.json?"json":"text"),{app:F}}};export{t as a};
@@ -1,103 +0,0 @@
1
- import{a as z,b as bt}from"./chunk-JLGA3B7P.js";import{a as Tt,b as Rt,f as Ae,g as le,h as N,j as de,k as Pt,m as vt,p as $t}from"./chunk-2RFCYZMG.js";import{a as J,l as St,m as Ft}from"./chunk-2NZ7GDDR.js";import{s as ce,t as B}from"./chunk-KT5QQOES.js";import{a as W,b as M,e as dt,g as ut,i as pt,j as mt,k as ft,n as ht,p as gt,q as yt,r as ae,s as I,u as Et,w as wt}from"./chunk-Q7BOSHWX.js";import{da as xt}from"./chunk-DTRENW4Q.js";import{va as j,xa as D}from"./chunk-NCPZVARH.js";import{B as L,C as re,D as ct,U as lt,z as at}from"./chunk-V654BMS7.js";import{c as it}from"./chunk-335BUVBP.js";import{h as k}from"./chunk-J7BTC45S.js";import{Bb as v,Cb as U,O as nt,Sa as b,Va as O,Z as Le,ab as Ce,la as _,na as qe,qb as C,sb as oe,ta as je,va as rt,xa as ot,yb as ie}from"./chunk-RIG66DIQ.js";import{c as x,e as et,f as A,h as tt,i as st,j as H,n as _e}from"./chunk-IWTNUJGY.js";import{e as Ke,g as m}from"./chunk-VKWPEFWQ.js";m();m();m();var fs=".shopifyignore",It=/templates\/\*(\.(json|liquid))?$/,kt=new Set;function ue(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[o=[],i=[]]=He(s),[a=[],u=[]]=He(n),[p=[],c=[]]=He(r),l=e.filter(G(o,".shopifyignore"));return l=l.filter(G(a,"--ignore")),l=l.filter(G(p,"--only",!0)),i.length>0&&(l=l.concat(e.filter(G(i,".shopifyignore",!0)))),u.length>0&&(l=l.concat(e.filter(G(u,"--ignore",!0)))),c.length>0&&(l=l.filter(G(c,"--only"))),nt(l,w=>w.key)}function G(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(i=>hs(n,i)||Es(i)&&ys(n,ws(i)));return(s?!r:r)?(v(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function _t(e){let t=x(e,fs);return await b(t)?(await _(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function He(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function hs(e,t){let s={matchBase:!0,noglobstar:!0};return Ce(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!kt.has(t)&&(kt.add(t),L({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),gs(t)?Ce(e,t.replace(It,"templates/**/*$1"),s):!1)}function gs(e){return It.test(e)}function ys(e,t){return t.test(e)}function Es(e){return e.startsWith("/")&&e.endsWith("/")}function ws(e){return new RegExp(e.slice(1,-1))}m();import Lt from"fs/promises";var pe=class{notifyPath;isValidUrl;constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&U("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{v(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){j(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),U(n)}}async notifyUrl(t){let s=await fetch(this.notifyPath,{method:"POST",body:JSON.stringify({files:[t]}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(s.statusText)}async notifyFile(t){await Lt.writeFile(this.notifyPath,t),await Lt.utimes(this.notifyPath,new Date,new Date)}validateUrl(t){try{let s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"}catch{return!1}}};m();m();m();import xs from"node:events";var qt=["assets/**/*.*","locales/**/*.json","blocks/**/*.liquid","snippets/**/*.liquid"];function jt(e){let t=new Map,s=new Set,n=new xs,r=(c,l)=>{n.emit(c,l)},o=async c=>{let l=await fe(e,c),f=me(c,l),w=typeof l=="string"?l:"",h=Buffer.isBuffer(l)?l.toString("base64"):"";return t.set(c,J({key:c,checksum:f,value:w,attachment:h})),l},i=O(qt,{cwd:e,deep:3,ignore:B}).then(c=>Promise.all(c.map(o))),a=(c,l)=>{let f=A(e,l),w=o(f).then(()=>{let h=t.get(f);return s.add(h.key),h.value??h.attachment??""});lt(5).then(()=>{s.delete(f)}).catch(()=>{}),r(c,{fileKey:f,onContent:h=>{w.then(y=>{y&&h(y)}).catch(()=>{})},onSync:h=>{}})},u=c=>{let l=A(e,c);s.delete(l),t.delete(l),r("unlink",{fileKey:l,onSync:f=>f()})},p=new Set(qt.map(c=>x(e,c.split("/").shift()??"")));return{root:e,files:t,unsyncedFileKeys:s,ready:async()=>i.then(()=>{}),delete:async c=>{t.delete(c)},write:async c=>{t.set(c.key,c)},read:o,addEventListener:(c,l)=>{n.on(c,l)},startWatcher:async()=>{let{default:c}=await import("./chokidar-5RWEYTNQ.js");c.watch([...p],{ignored:B,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}).on("add",a.bind(null,"add")).on("change",a.bind(null,"change")).on("unlink",u.bind(null))}}}m();m();var Ts="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function Ct(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function At(e){return(0,String.raw)`<!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>${e.title}</title>
5
- <link rel="stylesheet" href="${Ts}" />
6
- </head>
7
- <body>
8
- <div style="display: flex; justify-content: center; padding-top: 2rem;">
9
- <div style="width: 80%;">
10
- <div class="Polaris-Banner Polaris-Banner--withinPage" tabindex="0" role="alert" aria-live="polite">
11
- <div class="Polaris-Box" style="--pc-box-width:100%">
12
- <div
13
- class="Polaris-BlockStack"
14
- style="--pc-block-stack-align:space-between;--pc-block-stack-order:column"
15
- >
16
- <div
17
- class="Polaris-Box"
18
- style="--pc-box-color: var(--p-color-text-critical-on-bg-fill); --pc-box-background: var(--p-color-bg-fill-critical); --pc-box-padding-block-start-xs: var(--p-space-300); --pc-box-padding-block-end-xs: var(--p-space-300); --pc-box-padding-inline-start-xs: var(--p-space-300); --pc-box-padding-inline-end-xs: var(--p-space-300); --pc-box-border-start-start-radius: var(--p-border-radius-300); --pc-box-border-start-end-radius: var(--p-border-radius-300);"
19
- >
20
- <div
21
- class="Polaris-InlineStack"
22
- style="--pc-inline-stack-align:space-between;--pc-inline-stack-block-align:center;--pc-inline-stack-wrap:nowrap;--pc-inline-stack-gap-xs:var(--p-space-200);--pc-inline-stack-flex-direction-xs:row"
23
- >
24
- <div
25
- class="Polaris-InlineStack"
26
- style="--pc-inline-stack-wrap:nowrap;--pc-inline-stack-gap-xs:var(--p-space-100);--pc-inline-stack-flex-direction-xs:row"
27
- >
28
- <span class="Polaris-Banner--textCriticalOnBgFill">
29
- <span class="Polaris-Icon">
30
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
31
- <path d="M10 6a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75Z" />
32
- <path d="M11 13a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" />
33
- <path
34
- fill-rule="evenodd"
35
- d="M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Zm-1.5 0a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
36
- />
37
- </svg>
38
- </span>
39
- </span>
40
- <h2 class="Polaris-Text--root Polaris-Text--headingSm Polaris-Text--break">
41
- ${e.header}
42
- </h2>
43
- </div>
44
- </div>
45
- </div>
46
- <div
47
- class="Polaris-Box"
48
- style="--pc-box-padding-block-start-xs:var(--p-space-300);--pc-box-padding-block-end-xs:var(--p-space-300);--pc-box-padding-block-end-md:var(--p-space-400);--pc-box-padding-inline-start-xs:var(--p-space-300);--pc-box-padding-inline-start-md:var(--p-space-400);--pc-box-padding-inline-end-xs:var(--p-space-300);--pc-box-padding-inline-end-md:var(--p-space-400)"
49
- >
50
- <div
51
- class="Polaris-BlockStack"
52
- style="--pc-block-stack-order:column;--pc-block-stack-gap-xs:var(--p-space-300)"
53
- >
54
- ${e.errors.map(s=>`
55
- <div>
56
- <span class="Polaris-Text--root Polaris-Text--headingSm">${Ct(s.message)}</span>
57
- <ul class="Polaris-List">
58
- <li class="Polaris-List__Item">${Ct(s.code)}</li>
59
- </ul>
60
- </div>`).join("")}
61
- </div>
62
- </div>
63
- </div>
64
- </div>
65
- </div>
66
- </div>
67
- </div>
68
- </body>
69
- </html>`}m();m();var Rs=/<head(\s[^>]*)?>/i,Ne="https://cdn.shopify.com/storefront",Ss=`${Ne}/standard-events.js`,Fs=`${Ne}/standard-events.dev.js`,Ht=`${Ne}/standard-events-inspector.js`,Ot="shopify-cli-standard-events-inspector",Ps=new RegExp(`<script\\b[^>]*(?:\\bid=["']${Oe(Ot)}["']|\\bsrc=["']${Oe(Ht)}["'])[^>]*>`,"i"),vs=new RegExp(Oe(Ss),"g");function he(e){return Ps.test(e)?e:e.replace(Rs,t=>`${t}<script id="${Ot}" src="${Ht}" defer></script>`)}function Nt(e){return e.replace(vs,Fs)}function Oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}m();var Dt=80;function K(e,t,s){if(!$s(e)||s.type==="theme-extension")return;let n=e.path.length>Dt?`${e.path.substring(0,Dt)}...`:e.path,o=t.headers.get("server-timing")?.match(/cfRequestDuration;dur=([\d.]+)/)?.[1],i=o?`${Math.round(Number(o))}ms`:"",a=bs(t.status),u=e.method.padStart(6);ie(oe`• ${ce.format(new Date)} Request ${C.raw("\xBB")} ${u} ${a(String(t.status))} ${n} ${C.gray(i)}`)}function $s(e){let t=[V,Y,"/checkouts","/payments"],s=[".js",".css",".json",".map"];if(t.some(o=>e.path.startsWith(o)))return!1;let[n]=e.path.split("?"),r=H(n);return!s.includes(r)}function bs(e){return e<300?C.green:e<400?C.yellow:C.errorText}var Y="/cdn/",V="/ext/cdn/",De="/api/collect",ks=/^\/cart\//,Is=/^\/cart(\/|\.js|\.json|$)/,ge=/^\/checkouts\/(?!internal\/)/,Wt=/^\/account(\/login\/multipass(\/[^/]+)?|\/logout)?\/?$/,_s=new RegExp(`^${Y}`),Ls=new RegExp(`^${V}`),qs=/^\/api\/(unstable|\d{4}-\d{2})\/graphql\.json/,js=["/.well-known","/shopify/monorail","/mini-profiler-resources","/web-pixels-manager","/web-pixels@","/wpm","/services/",De,"/cdn-cgi/challenge-platform"],Mt="_shopify_essential",Cs=new RegExp(`${Mt}=([^;]*)(;|$)`);function Bt(e,t){return I(async s=>{if(js.some(n=>s.path.startsWith(n)))return null;if(As(s)){let n=s.path.split("?")[0]??"";return We(s,t).then(async r=>{if(K(s,r,t),r.ok){let o=n.split("/").at(-1)??"";if(t.localThemeFileSystem.files.has(`assets/${o}.liquid`)){let i=ee(await r.text(),t);return new Response(i,r)}}return r}).catch(async r=>{let{status:o,statusText:i,...a}=N(r,`Failed to proxy request to ${n}`);return o>=500&&!n.endsWith(".js.map")&&L(a),new Response(r.message,{status:o,statusText:i})})}})}function As(e){if(e.method!=="GET"||e.path.match(ks)||e.path.match(ge)||e.path.match(Wt)||e.path.match(_s)||e.path.match(Ls))return!0;let[t]=e.path.split("?"),s=H(t),n=e.headers.get("accept")??"*/*";return s===".html"||n.includes("text/html")?!1:!!s||n!=="*/*"}function Hs(e){let[t]=e.split("?");return!(Is.test(t)||ge.test(t)||Wt.test(t))}function ye(e){return e.session.storeFqdn.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function Os(e){return qs.test(e.path)}function ee(e,t){let s=e,n=`(data-shs-beacon-endpoint=["'])https://${ye(t)}${De}`,r=new RegExp(n,"g");s=s.replace(r,`$1${De}`);let o=new RegExp(`(https?:)?//${ye(t)}${Y}`,"g");s=s.replace(o,Y);let i=/(?:https?:)?\/\/cdn\.shopify\.com\/(.*?\/(assets\/[^?#"'`>\s]+))/g,a=c=>c.startsWith("assets/"),u=new Set([...t.localThemeFileSystem.files.keys()].filter(a)),p=new Set([...t.localThemeExtensionFileSystem.files.keys()].filter(a));return s=s.replace(i,(c,l,f)=>{let w=f&&u.has(f),h=f&&p.has(f)&&l.startsWith("extensions/");return z(f).startsWith("image/")?c:h?`${V}${l}`:w?`${Y}${l}`:c}),t.options.standardEventsDevBundle&&(s=Nt(s)),s}function Ns(e,t){let s=`http://${t.options.host}:${t.options.port}`,n=new RegExp(`data-base-url=["']((?:https?:)?//${ye(t)})[^"']*?["']`,"g");return e.replace(n,(r,o)=>r.replace(o,s))}function Ds(e,t){let s=new RegExp(`Domain=${ye(t)};\\s*`,"gi");return e.map(n=>n.replace(s,""))}async function te(e,t,s,n){let r=zt(e,t,n);if(r.status>=300&&r.status<400)return r;t.headers.get("content-type")?.includes("application/json")||r.headers.set("content-type","text/html; charset=utf-8");let a=await r.text();return a=ee(a,e),a=Ns(a,e),e.options.standardEventsInspector&&(a=he(a)),s&&(a=s(a)??a),new Response(a,r)}var Jt=["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","expect","content-security-policy","host"];function zt(e,t,s){let n=new Response(t.body,t);n.headers.delete("content-length"),n.headers.delete("content-encoding");for(let a of Jt)n.headers.delete(a);n.headers.delete("access-control-allow-origin"),n.headers.delete("access-control-allow-credentials"),n.headers.delete("access-control-allow-methods"),n.headers.delete("access-control-allow-headers"),n.headers.delete("access-control-expose-headers"),n.headers.delete("access-control-max-age");let r=n.headers.get("Link");r&&n.headers.set("Link",ee(r,e));let o=n.headers.get("Location");o&&n.headers.set("Location",Us(e,o,s));let i=n.headers.getSetCookie();if(i?.length){n.headers.set("Set-Cookie",Ds(i,e).join(","));let a=i.join(",").match(Cs)?.[1];a&&(e.session.sessionCookies[Mt]=a)}return n}function Us(e,t,s){if(!s?.keepExternalRedirects){let i=new URL(t,"https://shopify.dev");return ge.test(i.pathname)?t:Ut(i)}let n=`https://${e.session.storeFqdn}`,r=new URL(t,n),o=r.host===new URL(n).host;return o&&!ge.test(r.pathname)?Ut(r):!o&&t.startsWith("//")?r.href:t}function Ut(e){return e.searchParams.delete("_fd"),e.searchParams.delete("pb"),e.href.replace(e.origin,"")}function Ue(e){let t=dt(e);for(let n of Jt)delete t[n];delete t["upgrade-insecure-requests"];let s=ut(e);return s&&(t["X-Forwarded-For"]=s),t}function We(e,t){let s=e.path.replace(new RegExp(V,"g"),"/"),n=e.path.startsWith(V)?"cdn.shopify.com":t.session.storeFqdn,r=new URL(s,`https://${n}`);if(r.hostname!==n)return Promise.reject(new Error(`Request failed: Hostname mismatch. Expected host: ${n}. Resulting URL hostname: ${r.hostname}`));let o=pt(e),i=Ue(e);return Os(e)||(/\/assets\/[^/]+\.(css|js)$/.test(r.pathname)&&/\?\d+$/.test(r.search)&&(r.search=`?v=${Date.now()}`),r.searchParams.set("_fd","0"),r.searchParams.set("pb","0"),i=Rt({...i,...Tt(),...n===t.session.storeFqdn?t.session.crawlerSignatureHeaders:{},referer:r.origin,Cookie:vt(t.session,{headers:i}),...t.type==="theme"&&Hs(e.path)?{Authorization:`Bearer ${t.session.storefrontToken}`}:{}})),fetch(r,{method:e.method,body:o,duplex:o?"half":void 0,redirect:"manual",headers:i}).then(a=>zt(t,a)).catch(a=>{throw le(j(a),r)})}var Me=0,Ws=5;function Yt(e,t){return I(s=>{let[n="/",r=""]=s.path.split("?");return Bs(s)&&(t.lastRequestedPath=s.path),t.options.errorOverlay!=="silent"&&t.localThemeFileSystem.uploadErrors.size>0?Gt(t,{status:500,statusText:"Internal Server Error"},{title:"Failed to Upload Theme Files",header:"Upload Errors",errors:Array.from(t.localThemeFileSystem.uploadErrors.entries()).map(([i,a])=>({message:i,code:a.join(`
70
- `)}))}):de(t.session,{method:s.method,path:n,query:[...new URLSearchParams(r)],themeId:String(e.id),sectionId:"",headers:Ue(s),replaceExtensionTemplates:we(t),replaceTemplates:Be(t,n,mt(s,"localization")?.toLowerCase())}).then(async i=>{if(i.status>=400&&i.status<500&&!Ms(s)){let a=await Js(s,t,i);if(a)return K(s,a,t),a}return K(s,i,t),te(t,i,a=>(zs(i,a,String(e.id)),Me=0,Je(a,t)),{keepExternalRedirects:Pt({method:s.method,path:n})})}).catch(async i=>{if(i instanceof Ee&&(v(`Theme ID mismatch: expected ${i.getExpectedThemeId()} but got ${i.getActualThemeId()}; refreshing session...`),D("theme-service:error-page:theme-id-mismatch"),t.session.refresh)){Me++,Me>Ws&&(ct(new k(i.getMessage())),process.exit(1)),await t.session.refresh();let w=new URLSearchParams(r),h=new URLSearchParams([...w].filter(([ke])=>!ke.startsWith("__sfr"))),y=n+(h.toString()?`?${h}`:"");return new Response(null,{status:302,headers:{Location:y}})}let{status:a,statusText:u,cause:p,...c}=N(i,"Failed to render storefront"),[l,...f]=c.headline.split(`
71
- `);return re(c),Gt(t,{status:a,statusText:u},{title:l,header:l,errors:[{message:[...f,p.message].join("<br>"),code:p.stack?.replace(`${p.message}
72
- `,"")??""}]})})})}function Gt(e,t,s){let n=Je(At(s),e);return e.options.standardEventsInspector&&(n=he(n)),D("theme-service:error-page:rendered"),new Response(n,{...t,headers:t.headers??{"Content-Type":"text/html; charset=utf-8"}})}function Ms(e){let t=new URLSearchParams(e.path.split("?")[1]);return["section_id","sections","app_block_id"].some(s=>t.has(s))}function Bs(e){return e.headers.get("sec-fetch-mode")==="navigate"}async function Js(e,t,s){v(`Render failed for ${e.path} with ${s.status} (x-request-id: ${s.headers.get("x-request-id")}), trying proxy...`);let n=await We(e,t).catch(r=>new Response(null,N(r)));if(n.status<400)return v(`Proxy status: ${n.status}. Returning proxy response.`),t.options.standardEventsInspector&&(n.headers.get("content-type")??"").includes("text/html")?te(t,n):n;v(`Proxy status: ${n.status}. Returning render error.`)}function zs(e,t,s){let n=t.match(/Shopify\.theme\s*=\s*{[^}]+?"id":\s*"?(\d+)"?(}|,)/)?.[1];if(n&&n!==s)throw new Ee(s,n,e)}var Ee=class extends Error{response;expectedThemeId;actualThemeId;constructor(t,s,n){super([`Theme ID mismatch: expected ${t} but got ${s}.`,`Request ID: ${n.headers.get("x-request-id")}`,`URL: ${n.url}`,"This is likely related to an issue in upstream Shopify APIs.","Please try again in a few minutes and report this issue:","https://community.shopify.dev/c/shopify-cli-libraries/14"].join(`
73
- `)),this.response=n,this.expectedThemeId=t,this.actualThemeId=s}getMessage(){return this.message}getResponse(){return this.response}getExpectedThemeId(){return this.expectedThemeId}getActualThemeId(){return this.actualThemeId}};m();m();function xe(e,t){let s=new RegExp(`{%-?\\s*${t}\\s*-?%}`),n=new RegExp(`{%-?\\s*end${t}\\s*-?%}`),r=s.exec(e);if(!r)return;let o=r.index+r[0].length;n.lastIndex=o;let i=n.exec(e);if(!i)return;let a=i.index;return e.slice(o,a)}m();function Te(e){let{pathname:t,search:s,searchParams:n}=new URL(e.path,"http://e.c");return{pathname:t,search:s,searchParams:n}}var Gs={stylesheet:new Map,javascript:new Map};function Vt(e,t){return I(async s=>{if(s.method!=="GET")return;if(Zs(s,t))return Qs(s,t);let{file:n,fileKey:r,isUnsynced:o}=Xs(s,t);if(!r)return;let i=z(r);if(i.startsWith("image/")&&s.path.includes("&")&&!o)return;if(ht(s,"X-Local-Asset","true"),!n){o&&M(s,W({statusCode:404,statusMessage:"Not found"}));return}let a=n.value?Buffer.from(ee(n.value,t)):Buffer.from(n.attachment??"","base64");return ae(s,{getContents:()=>a,getMeta:()=>({type:i,size:a.length,mtime:n.stats?.mtime})})})}var Ys=/^(?:\/cdn\/(?!extensions\/).*?)?\/assets\/([^?]+)/,Vs=/^(?:\/(?:ext\/)?cdn\/extensions\/.*?)?\/assets\/([^?]+)/;function Xs(e,t){let s=(n,r)=>{let o=e.path.match(n)?.[1];if(o){let i=x("assets",o),a=r.files.get(i),u=r.unsyncedFileKeys.has(i);if(a||u)return{file:a,isUnsynced:u,fileKey:i}}};return s(Ys,t.localThemeFileSystem)??s(Vs,t.localThemeExtensionFileSystem)??{isUnsynced:!1,fileKey:void 0,file:void 0}}function Zs(e,t){return t.type==="theme"&&e.path.includes("/compiled_assets")}function Qs(e,t){switch(Te(e).pathname.split("/").at(-1)){case"styles.css":return Ks(t,e);case"block-scripts.js":return ze(t,e,"block");case"snippet-scripts.js":return ze(t,e,"snippet");case"scripts.js":return ze(t,e,"section");case void 0:break;default:break}}function Ks(e,t){let s=Re(e,"section"),n=Re(e,"block"),r=Re(e,"snippet"),o=[`/*** GENERATED LOCALLY ***/
74
- `];for(let[,a]of[...s,...n,...r]){let u=Xt(a,"stylesheet");u&&o.push(u)}let i=o.join(`
75
- `);return ae(t,{getContents:()=>i,getMeta:()=>({type:"text/css",size:Buffer.byteLength(i),mtime:new Date})})}function ze(e,t,s){let n=Re(e,s),r=`${s}s`,o=[`
76
- /*** GENERATED LOCALLY ***/
77
-
78
- (function () {
79
- var __${r}__ = {};
80
-
81
- (function () {
82
- var element = document.getElementById("${r}-script");
83
- var attribute = element ? element.getAttribute("data-${r}") : "";
84
- var ${r} = attribute.split(",").filter(Boolean);
85
-
86
- for (var i = 0; i < ${r}.length; i++) {
87
- __${r}__[${r}[i]] = true;
88
- }
89
- })();`];for(let[a,u]of n){let p=a.split("/").pop()?.replace(".liquid",""),c=Xt(u,"javascript")??"";p&&c&&o.push(`
90
- (function () {
91
- if (!__${r}__["${p}"] && !Shopify.designMode) return;
92
- try {
93
- ${c}
94
- } catch (e) {
95
- console.error(e);
96
- }
97
- })();`)}o.push("})();");let i=o.join(`
98
- `);return ae(t,{getContents:()=>i,getMeta:()=>({type:"text/javascript",size:Buffer.byteLength(i),mtime:new Date})})}function Re(e,t){return[...e.localThemeFileSystem.files.entries()].filter(([s])=>s.endsWith(".liquid")&&s.startsWith(`${t}s/`)).sort(([s],[n])=>s.localeCompare(n))}function Xt(e,t){let s=Gs[t],n=s.get(e.key);if(n?.checksum===e.checksum)return n.content;if(s.delete(e.key),!e.value)return;let r=[`/* ${e.key} */`],o=xe(e.value??"",t)?.trimEnd();if(o&&r.push(o),r.length>1){let i=r.join(`
99
- `);return s.set(e.key,{checksum:e.checksum,content:i}),i}}m();import*as Zt from"node:os";function en(e,t){let s=new Set,n=`:${t}`,r=e.toLowerCase().trim();if(s.add(`${r}${n}`),["localhost","127.0.0.1","::1","0.0.0.0"].includes(r)&&(s.add(`localhost${n}`),s.add(`127.0.0.1${n}`),s.add(`[::1]${n}`)),r==="0.0.0.0"||r==="::")for(let i of Object.values(Zt.networkInterfaces()))for(let a of i??[]){let u=a.address.toLowerCase().split("%")[0],c=a.family==="IPv6"?`[${u}]`:u;s.add(`${c}${n}`)}return s}function tn(e){if(e)return e.toLowerCase().replace(/\.(?=:\d|$)/,"")}function Qt(e,t){let s=en(e,t);return I(n=>{let r=n.node.req.headers.host,o=tn(r);if(!o||!s.has(o))return M(n,W({statusCode:400,statusMessage:"Bad Request",message:"Invalid Host header"}))})}m();function Kt(){return es()}function Gr(){return es()}function es(){return{root:"",files:new Map,unsyncedFileKeys:new Set,uploadErrors:new Map,ready:()=>Promise.resolve(),delete:async e=>{},read:async e=>"",write:async e=>{},stat:async e=>({mtime:new Date,size:1}),addEventListener:()=>{},startWatcher:async()=>{}}}import{createServer as sn}from"node:http";async function io(e,t){let s=await rn(e,t);return await on(e,s),nn(e,s)}function nn(e,t){let s=Et();s.use(Qt(t.options.host,t.options.port)),s.use(ts(e,t)),s.use(Vt(e,t)),s.use(Bt(e,t)),s.use(Yt(e,t));let n=sn(wt(s));return{dispatch:s.handler.bind(s),start:async()=>new Promise(r=>n.listen({port:t.options.port,host:t.options.host},()=>r({close:async()=>{await Promise.all([new Promise(o=>{n.closeAllConnections(),n.close(o)})])}})))}}async function rn(e,t){let{adminSession:s,storefrontPassword:n,themeExtensionPort:r,themeExtensionDirectory:o,crawlerSignatureHeaders:i}=t,a="127.0.0.1",u=r??9293,p=Kt(),c=jt(o);return await c.ready(),{session:await $t(e.id.toString(),s,void 0,n,i),localThemeFileSystem:p,localThemeExtensionFileSystem:c,directory:o,type:"theme-extension",lastRequestedPath:"",options:{themeEditorSync:!1,noDelete:!1,ignore:[],only:[],host:a,port:u,liveReload:"hot-reload",standardEventsDevBundle:!1,standardEventsInspector:!1,open:!1,errorOverlay:"default"}}}async function on(e,t){let s=t.localThemeExtensionFileSystem,n=({fileKey:r,onContent:o,onSync:i})=>{o(()=>{Se(e,t,i,{type:"update",key:r,payload:{isThemeExtension:!0}})})};return s.addEventListener("add",n),s.addEventListener("change",n),s.ready().then(async()=>s.startWatcher())}function we(e){let t={},s=e.localThemeExtensionFileSystem;for(let n of s.unsyncedFileKeys){let r=s.files.get(n),o=r?.value??r?.attachment;o&&(t[n]=o)}return t}var ve=Ke(xt(),1);import an from"node:events";var Ge=new Map,se=new Map;function ss(e,t){let s=(0,ve.parseJSON)(t,null,!0);if(!s)return;let n=s?.sections;n&&!e.startsWith("locales/")?se.set(e,Object.entries(n||{}).map(([r,{type:o}])=>[o,r])):se.delete(e)}function Ye(e){return!e.startsWith("assets/")&&[".liquid",".json"].includes(H(e))}function Be(e,t,s){let n={},r=/^templates\/.+\.json$/,o=t?`${x("templates",t.replace(/^\//,"").replace(/\.html$/,"")||"index")}.json`:"",i=!!t&&e.localThemeFileSystem.files.has(o),a=/^locales\/.+\.json$/,u=!!s&&(e.localThemeFileSystem.files.has(`locales/${s}.json`)||e.localThemeFileSystem.files.has(`locales/${s}.default.json`));for(let p of e.localThemeFileSystem.unsyncedFileKeys)if(Ye(p)){if(i&&r.test(p)){if(p!==o)continue}else if(a.test(p)){if(u){if(!p.startsWith(`locales/${s}.`))continue}else if(!p.includes(".default."))continue}n[p]=e.localThemeFileSystem.files.get(p)?.value??""}return n}function So(e,t){let s=({fileKey:r,onContent:o,onSync:i})=>{let a=H(r);o(u=>{!pn(r)&&Ye(r)&&a===".json"&&ss(r,u),Se(e,t,i,{type:"update",key:r,payload:dn(r,t)})})},n=({fileKey:r,onSync:o})=>{se.delete(r),Se(e,t,o,{type:"delete",key:r})};return t.localThemeFileSystem.addEventListener("add",s),t.localThemeFileSystem.addEventListener("change",s),t.localThemeFileSystem.addEventListener("unlink",n),t.localThemeFileSystem.ready().then(async()=>{let r=[...t.localThemeFileSystem.files];return Promise.allSettled(r.map(async([o,i])=>{if(o.endsWith(".json")){let a=i.value??await t.localThemeFileSystem.read(o);a&&typeof a=="string"&&ss(o,a)}else o.endsWith(".liquid")&&is(i)}))})}var cn="1",rs=new an;function Pe(e){rs.emit("hot-reload",{...e,version:cn})}function ts(e,t){return I(s=>{let n=s.headers.get("accept")==="text/event-stream",r=Te(s).searchParams;if(n){let o=yt(s);return rs.on("hot-reload",i=>{o.push(JSON.stringify(i)).catch(a=>{L({headline:"Failed to send HotReload event.",body:a.stack})})}),Pe({type:"open",pid:String(process.pid),themeId:String(e.id)}),o.send().then(()=>o.flush())}if(r.has("hr-log")){let o=(0,ve.parseJSON)(r.get("hr-log")??"",null);return o&&(o.headline=`[HotReload] ${o.headline}`,o.type==="error"?re(o):o.type==="warn"?L(o):o.type==="info"?at(o):L({headline:`Unknown HotReload log type: ${o.type}`})),null}if(s.path===os)return _($e()).then(o=>ft(s,o,"application/javascript")).catch(o=>M(s,W({cause:o})));if(r.has("section_id")||r.has("app_block_id")){let o=r.get("section_key")??"",i=r.get("section_id")??"",a=r.get("app_block_id")??"",u=s.path.split("?")[0]??"",p=new URLSearchParams(r);if(p.delete("section_key"),p.delete("section_id"),p.delete("app_block_id"),p.delete("_fd"),p.delete("pb"),i===""&&a==="")return;let c={};if(i){let l=t.localThemeFileSystem.unsyncedFileKeys;if(l.has(o)){let f=t.localThemeFileSystem.files.get(o)?.value;if(!f)return"";c[o]=f}for(let f of l)if(f.endsWith(".json")){for(let[w,h]of se.get(f)??[])if(i.endsWith(`__${h}`)){let y=t.localThemeFileSystem.files.get(f)?.value;y&&(c[f]=y);continue}}}return de(t.session,{method:s.method,path:u??"/",query:[...p.entries()],themeId:String(e.id),sectionId:i,appBlockId:a,replaceTemplates:c,headers:gt(s),replaceExtensionTemplates:we(t)}).then(async l=>{if(!l.ok)throw D("theme-service:hot-reload:section:render-failed"),le(l);return te(t,l)}).catch(async l=>{let{status:f,statusText:w,...h}=N(j(l),"Failed to render section on Hot Reload");return D("theme-service:hot-reload:section:render-error"),a||L(h),new Response(null,{status:f,statusText:w})})}})}var ne=(e,t)=>Pe({themeId:String(e),type:"full",key:t});function Se(e,t,s,n){let r=()=>ne(e.id,n.key);if(t.options.liveReload==="off")return;if(t.options.liveReload==="full-page"){s(r);return}let o=String(e.id);Pe({sync:"local",themeId:o,...n}),s(()=>Pe({sync:"remote",themeId:o,...n}),r)}function ln(e,t){let s=new Set;if(e.endsWith(".json")){let n=t.localThemeFileSystem.files.get(e)?.value;if(n){let r=(0,ve.parseJSON)(n,null,!0)?.sections;for(let o of Object.keys(r??{}))s.add(o)}}else{let n=e.match(/^sections\/(.+)\.liquid$/)?.[1];if(n)for(let[r,o]of se)for(let[i,a]of o)i===n&&s.add(a)}return[...s]}function dn(e,t){let[s]=e.split("/"),n=t.localThemeFileSystem.files.get(e);return{sectionNames:s==="sections"?ln(e,t):[],replaceTemplates:Ye(e)?Be(t):{},updatedFileParts:n&&is(n)}}var Fe="hot-reload-client",un="/cdn/shopifycloud/theme-hot-reload/theme-hot-reload.js",ns=new RegExp(`<script id="${Fe}"[^>]*>[^<]*</script>`),os="/@shopify/theme-hot-reload";function Je(e,t){return t.options.liveReload==="off"?e.replace(ns,""):process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD?e.replace(ns,"").replace(/<\/head>/,`<script id="${Fe}" src="${os}" defer></script></head>`):e.includes(`<script id="${Fe}"`)?e:e.replace(/<\/head>/,`<script id="${Fe}" src="${un}" defer></script></head>`)}function pn(e){return e.startsWith("assets/")}function is(e){if(!(["sections/","snippets/","blocks/"].some(c=>e.key.startsWith(c))&&e.key.endsWith(".liquid")))return;let n={stylesheetTag:!1,javascriptTag:!1,schemaTag:!1,liquid:!1},r={checksum:e.checksum,liquid:"",stylesheetTag:"",javascriptTag:"",schemaTag:""},o=Ge.get(e.key);if(o?.checksum===e.checksum||(Ge.delete(e.key),!e.value))return n;let i=["stylesheet","javascript","schema"],a=c=>c?.replace(/\s+/g," ").trim(),u=e.value,p=(c,l)=>{u=u.replace(l,"");let f=a(l),w=`${c}Tag`;n[w]=!o||f!==o[w],r[w]=f};for(let c of i){let l=xe(e.value??"",c);l&&p(c,l)}return u=a(u.replace(/<!--[\s\S]*?-->/g,"").replace(/{%\s*comment\s*%}[\s\S]*?{%\s*endcomment\s*%}/g,"").replace(/{%\s*doc\s*%}[\s\S]*?{%\s*enddoc\s*%}/g,"")),r.liquid=u,n.liquid=!o||u!==o.liquid,Ge.set(e.key,r),n}m();m();import{lstat as mn}from"node:fs/promises";async function Ve(e){try{return await mn(e),!0}catch(t){if(t instanceof Error&&"code"in t&&(t.code==="ENOENT"||t.code==="ENOTDIR"))return!1;throw t}}async function as(e,t){return e===t||await Ve(e)?e:as(tt(e),t)}function X(e){if(!e||e==="."||e===".."||/[\\/]/.test(e)||/^[a-z]:/i.test(e))throw new k(`Unsafe listing name: ${e}`)}async function P(e,t){let s=t.replace(/\\/g,"/");if(!t||/^[\\/]/.test(t)||/^[a-z]:/i.test(t)||s.split("/").includes(".."))throw new k(`Unsafe theme file key: ${t}`);let n=et(e),r=x(n,s);if(A(n,r)===""||!_e(n,r,{native:!0}))throw new k(`Unsafe theme file key: ${t}`);let o=await as(r,n);try{let i=await qe(n),a=await qe(o);if(!_e(i,a,{native:!0}))throw new k(`Unsafe theme file key: ${t}`)}catch{throw new k(`Unsafe theme file key: ${t}`)}return r}var cs=Ke(xt(),1);function fn(e){return(e.startsWith("templates/")||e.startsWith("sections/"))&&e.endsWith(".json")}async function ls(e,t,s){if(X(t),fn(s)){await P(e,s);let n=await P(e,x("listings",t,s));if(await b(n))return n}}async function ds(e,t){X(t);let s=await P(e,"config/settings_data.json"),n=await _(s,{encoding:"utf8"}),r=(0,cs.parseJSON)(n,null,!0);return r?(r.current=Le(t),JSON.stringify(r,null,2)):n}async function Ho(e,t){X(t);let s=x(e,"listings"),n=x(s,t);if(await Ve(e)&&(await P(e,"listings"),await P(e,x("listings",t))),await b(n))return;let o=[];await b(s)&&(o=await O("*",{cwd:s,onlyDirectories:!0,deep:1}));let i=o.length>0?`Available presets: ${o.map(a=>`"${Le(a)}"`).join(", ")}`:'No presets found under "listings/"';throw new k(`Listing preset "${t}" was not found. ${i}.`,`Add the preset to config/settings_data.json and its corresponding "listings/${t}" folder, or remove the --listing flag to use the default theme settings.`)}import hn from"node:events";import{fileURLToPath as gn}from"node:url";var yn=250,us=["AGENTS.md","DESIGN.md","assets/**/*.*","config/**/*.json","config/styles.css","layout/**/*.liquid","locales/**/*.json","sections/**/*.{liquid,json}","blocks/**/*.liquid","snippets/**/*.liquid","templates/**/*.{liquid,json}","templates/customers/**/*.{liquid,json}"],$={documentationFilesRegex:/^(AGENTS|DESIGN)\.md$/,layoutLiquidRegex:/^layout\/.+\.liquid$/,sectionLiquidRegex:/^sections\/.+\.liquid$/,blockLiquidRegex:/^blocks\/.+\.liquid$/,configSchemaRegex:/^config\/settings_schema\.json$/,configDataRegex:/^config\/settings_data\.json$/,configStylesheetRegex:/^config\/styles\.css$/,sectionJsonRegex:/^sections\/.+\.json$/,templateJsonRegex:/^templates\/.+\.json$/,jsonRegex:/^(?!config\/).*\.json$/,contextualizedJsonRegex:/\.context\.[^.]+\.json$/i,staticAssetRegex:/^assets\/(?!.*\.liquid$)/};function ni(e,t){t?.listing!==void 0&&X(t.listing);let s=new Map,n=new Map,r=new Set,o={ignoreFromFile:[],ignore:t?.filters?.ignore??[],only:t?.filters?.only??[]},i=new hn,a=(d,E)=>{i.emit(d,E)},u=t?.notify?new pe(t.notify):void 0,p=async d=>{let E=t?.listing?await wn(e,d,t.listing):await fe(e,d),g=me(d,E);return s.set(d,J({key:d,checksum:g,value:typeof E=="string"?E:"",attachment:Buffer.isBuffer(E)?E.toString("base64"):""})),E},c=O(us,{cwd:e,deep:3,ignore:B}).then(async d=>{o.ignoreFromFile.push(...await _t(e));let E=ue(d.map(g=>({key:g})),o);await Promise.all(E.map(({key:g})=>p(g)))}),l=d=>A(e,d),f=d=>ue([{key:d}],o).length===0;function w(d,E,g,T){if(process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&T===$e()){ne(E,T);return}let S=l(T);if(t?.listing&&S.startsWith(`listings/${t.listing}/`)){let R=S.replace(`listings/${t.listing}/`,"");if(R.startsWith("templates/")||R.startsWith("sections/"))S=R;else return}h(S).then(()=>{switch(d){case"add":case"change":return y(d,E,g,S);case"unlink":return ke(E,g,S,n)}}).catch(R=>{U(`Error handling file event for ${S}: ${R}`)})}function h(d){return u?.notify(d)??Promise.resolve()}let y=(d,E,g,T)=>{if(f(T))return;let S=s.get(T)?.checksum,R=p(T).then(async()=>{let F=s.get(T);if(F)return F.checksum!==S&&r.add(T),{value:F.value||void 0,attachment:F.attachment}}),q=R.then(F=>{if(F)return En(r,n,T,E,g)(F)}).catch(Ae(T,"upload"));a(d,{fileKey:T,onContent:F=>{R.then(Z=>{r.has(T)&&F(Z?.value??Z?.attachment??"")}).catch(()=>{})},onSync:(F,Z)=>{q.then(Q=>{Q?F():Z?.()}).catch(()=>{})}})},ke=(d,E,g,T)=>{if(f(g))return;T.delete(g),s.delete(g),r.add(g);let S=t?.noDelete?Promise.resolve():St(Number(d),[g],E).then(async R=>{if(!R[0]?.success)throw new Error(`Failed to delete file "${g}" from remote theme.`);return r.delete(g),ps("delete",g),!0}).catch(R=>(Ae(g,"delete")(R),!1));a("unlink",{fileKey:g,onSync:R=>{S.then(q=>{q&&R()}).catch(()=>{})}})},Ie=new Set(us.map(d=>x(e,d.split("/").shift()??"")));return t?.listing&&Ie.add(x(e,"listings",t.listing)),process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&Ie.add($e()),{root:e,files:s,unsyncedFileKeys:r,uploadErrors:n,ready:()=>c,delete:async d=>{await P(e,d),s.delete(d),await xn(e,d)},write:async d=>{await P(e,d.key);let E=(d.key.startsWith("templates/")||d.key.startsWith("sections/"))&&d.key.endsWith(".json");if(t?.listing&&E){let g=x("listings",t.listing,d.key),T=await P(e,g),S=await b(T);s.set(d.key,J({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),S?await Xe(e,{...d,key:g}):await Xe(e,d);return}s.set(d.key,J({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),await Xe(e,d)},read:p,applyIgnoreFilters:d=>ue(d,o),addEventListener:(d,E)=>{i.on(d,E)},startWatcher:async(d,E)=>{let{default:g}=await import("./chokidar-5RWEYTNQ.js"),T=g.watch([...Ie],{ignored:B,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}),S=new Map,R=(q,F)=>{let Q=`${l(F)}:${q}`,Qe=S.get(Q);Qe&&clearTimeout(Qe);let ms=setTimeout(()=>{S.delete(Q),w(q,d,E,F)},yn);S.set(Q,ms)};T.on("add",R.bind(null,"add")).on("change",R.bind(null,"change")).on("unlink",R.bind(null,"unlink")).on("error",q=>{U(`File watcher error: ${q}`),j("theme-service:file-watcher:error")})}}}function En(e,t,s,n,r){return async o=>{if(!e.has(s))return!1;let[i]=await Ft(Number(n),[{key:s,...o}],r);if(!i?.success){let a=i?.errors?.asset??["Response was not successful."];throw t.set(s,a),ne(n,s),new Error(a.join(`
100
- `))}return t.delete(s)&&ne(n,s),e.delete(s),ps("update",s),!0}}async function Xe(e,{key:t,attachment:s,value:n}){let r=await P(e,t);if(await Tn(r),s){let o=Buffer.from(s,"base64");await je(r,o,{encoding:"base64"})}else await je(r,n??"")}async function fe(e,t){let s=be(t)?{encoding:"utf8"}:{},n=await P(e,t);if(!await b(n)){v(`File ${n} can't be read because it doesn't exist...`);return}return _(n,s)}async function wn(e,t,s){if(t==="config/settings_data.json")return ds(e,s);let n=await ls(e,s,t);if(n){let r=be(t)?{encoding:"utf8"}:{};return _(n,r)}return fe(e,t)}async function xn(e,t){let s=await P(e,t);if(!await b(s)){v(`File ${s} can't be removed because it doesn't exist...`);return}await ot(s)}function ri(e){let t=[],s=[],n=[],r=[],o=[],i=[],a=[],u=[],p=[],c=[],l=[],f=[],w=[];return e.forEach(h=>{let y=h.key;$.documentationFilesRegex.test(y)?w.push(h):y.endsWith(".liquid")?$.sectionLiquidRegex.test(y)?t.push(h):$.blockLiquidRegex.test(y)?l.push(h):$.layoutLiquidRegex.test(y)?f.push(h):s.push(h):$.configSchemaRegex.test(y)?a.push(h):$.configDataRegex.test(y)?u.push(h):$.configStylesheetRegex.test(y)?p.push(h):$.jsonRegex.test(y)?$.contextualizedJsonRegex.test(y)?i.push(h):$.sectionJsonRegex.test(y)?n.push(h):$.templateJsonRegex.test(y)?r.push(h):o.push(h):$.staticAssetRegex.test(y)&&c.push(h)}),{sectionLiquidFiles:t,otherLiquidFiles:s,sectionJsonFiles:n,templateJsonFiles:r,contextualizedJsonFiles:i,otherJsonFiles:o,configSchemaFile:a,configDataFile:u,configStylesheetFiles:p,staticAssetFiles:c,blockLiquidFiles:l,layoutFiles:f,documentationFiles:w}}function be(e){return bt({liquid:"application/liquid",sass:"text/x-sass",scss:"text/x-scss"}),["application/javascript","application/json","application/liquid","text/css","text/x-sass","text/x-scss","image/svg+xml","text/markdown"].includes(z(e))}async function oi(e){let t=new Set(await O("*",{cwd:e,deep:1,onlyDirectories:!0}));return["config","layout","templates"].every(n=>t.has(n))}async function Tn(e){let t=Rn(e);await b(t)||await rt(t)}function Rn(e){let t=st(e),s=e.lastIndexOf(t);return e.substring(0,s)}function ps(e,t){ie(oe`• ${ce.format(new Date)} Synced ${C.raw("\xBB")} ${e} ${t}`)}function $e(){let e=process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD;return!e||e==="true"?x(gn(import.meta.url.split("/cli/")[0]??""),"theme-hot-reload/dist/theme-hot-reload.js"):e}function me(e,t){return t?Buffer.isBuffer(t)?Ze(t):vn(e)?Sn(t):Fn(e,t):""}function Sn(e){let t=e;return t=t.replace(/\r\n/g,`
101
- `),t=t.replace(/\/\*[\s\S]*?\*\//,""),t=Pn(t),Ze(t)}function Fn(e,t){let s=t;return be(e)&&(s=s.replace(/\r\n/g,`
102
- `)),Ze(s)}function Pn(e){let t=!1,s=!1,n="";for(let r of e)r==='"'&&!s&&(t=!t),!(!t&&(r===" "||r===`
103
- `))&&(n+=r,s=r==="\\"&&!s);return n}function Ze(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);return it(t)}function di(e){let t=new Set(e.filter(({key:s})=>s.startsWith("assets/")&&s.endsWith(".liquid")).map(({key:s})=>s));return e.filter(({key:s})=>s.startsWith("assets/")?!t.has(`${s}.liquid`):!0)}function vn(e){return e.endsWith("/settings_data.json")}export{di as a,Bt as b,Yt as c,Vt as d,Qt as e,Gr as f,io as g,So as h,ts as i,ne as j,ls as k,Ho as l,ni as m,ri as n,oi as o};
@@ -1 +0,0 @@
1
- import{d as De,g as x}from"./chunk-VKWPEFWQ.js";x();x();x();x();var k={};De(k,{BRAND:()=>ft,DIRTY:()=>U,EMPTY_PATH:()=>Be,INVALID:()=>p,NEVER:()=>Gt,OK:()=>w,ParseStatus:()=>b,Schema:()=>g,ZodAny:()=>D,ZodArray:()=>V,ZodBigInt:()=>B,ZodBoolean:()=>W,ZodBranded:()=>he,ZodCatch:()=>re,ZodDate:()=>q,ZodDefault:()=>te,ZodDiscriminatedUnion:()=>ge,ZodEffects:()=>j,ZodEnum:()=>K,ZodError:()=>T,ZodFirstPartyTypeKind:()=>m,ZodFunction:()=>ve,ZodIntersection:()=>G,ZodIssueCode:()=>c,ZodLazy:()=>Q,ZodLiteral:()=>X,ZodMap:()=>de,ZodNaN:()=>le,ZodNativeEnum:()=>ee,ZodNever:()=>E,ZodNull:()=>Y,ZodNullable:()=>I,ZodNumber:()=>F,ZodObject:()=>C,ZodOptional:()=>O,ZodParsedType:()=>u,ZodPipeline:()=>pe,ZodPromise:()=>L,ZodReadonly:()=>se,ZodRecord:()=>_e,ZodSchema:()=>g,ZodSet:()=>ue,ZodString:()=>z,ZodSymbol:()=>oe,ZodTransformer:()=>j,ZodTuple:()=>N,ZodType:()=>g,ZodUndefined:()=>J,ZodUnion:()=>H,ZodUnknown:()=>M,ZodVoid:()=>ce,addIssueToContext:()=>d,any:()=>kt,array:()=>Ct,bigint:()=>yt,boolean:()=>Ve,coerce:()=>Ht,custom:()=>Ze,date:()=>gt,datetimeRegex:()=>Ne,defaultErrorMap:()=>Z,discriminatedUnion:()=>jt,effect:()=>Lt,enum:()=>Pt,function:()=>$t,getErrorMap:()=>ne,getParsedType:()=>R,instanceof:()=>pt,intersection:()=>Et,isAborted:()=>me,isAsync:()=>ae,isDirty:()=>ye,isValid:()=>P,late:()=>ht,lazy:()=>Mt,literal:()=>Vt,makeIssue:()=>fe,map:()=>It,nan:()=>mt,nativeEnum:()=>zt,never:()=>wt,null:()=>xt,nullable:()=>Ft,number:()=>Me,object:()=>St,objectUtil:()=>ke,oboolean:()=>Yt,onumber:()=>Jt,optional:()=>Ut,ostring:()=>qt,pipeline:()=>Wt,preprocess:()=>Bt,promise:()=>Dt,quotelessJson:()=>Le,record:()=>Nt,set:()=>Zt,setErrorMap:()=>Fe,strictObject:()=>Ot,string:()=>$e,symbol:()=>_t,transformer:()=>Lt,tuple:()=>Rt,undefined:()=>vt,union:()=>At,unknown:()=>bt,util:()=>_,void:()=>Tt});x();x();x();x();x();var _;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{let a={};for(let i of n)a[i]=i;return a},r.getValidEnumValues=n=>{let a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(let o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(let i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(_||(_={}));var ke;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(ke||(ke={}));var u=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),R=r=>{switch(typeof r){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(r)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(r)?u.array:r===null?u.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?u.promise:typeof Map<"u"&&r instanceof Map?u.map:typeof Set<"u"&&r instanceof Set?u.set:typeof Date<"u"&&r instanceof Date?u.date:u.object;default:return u.unknown}};var c=_.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Le=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),T=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,f=0;for(;f<i.path.length;){let l=i.path[f];f===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(t(i))):o[l]=o[l]||{_errors:[]},o=o[l],f++}}};return n(this),s}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let n of this.issues)if(n.path.length>0){let a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};T.create=r=>new T(r);var Ue=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===u.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,_.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${_.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${_.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${_.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:_.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,_.assertNever(r)}return{message:t}},Z=Ue;var Oe=Z;function Fe(r){Oe=r}function ne(){return Oe}x();var fe=r=>{let{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="",f=s.filter(l=>!!l).slice().reverse();for(let l of f)o=l(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},Be=[];function d(r,e){let t=ne(),s=fe({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===Z?void 0:Z].filter(n=>!!n)});r.common.issues.push(s)}var b=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let n of t){if(n.status==="aborted")return p;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let n of t){let a=await n.key,i=await n.value;s.push({key:a,value:i})}return r.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let n of t){let{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return p;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}},p=Object.freeze({status:"aborted"}),U=r=>({status:"dirty",value:r}),w=r=>({status:"valid",value:r}),me=r=>r.status==="aborted",ye=r=>r.status==="dirty",P=r=>r.status==="valid",ae=r=>typeof Promise<"u"&&r instanceof Promise;x();x();var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));var A=class{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ae=(r,e)=>{if(P(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new T(r.common.issues);return this._error=t,this._error}}};function y(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{let{message:f}=r;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??s??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:n}}var g=class{get description(){return this._def.description}_getType(e){return R(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:R(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:R(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ae(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){let s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:R(e)},n=this._parseSync({data:e,path:s.path,parent:s});return Ae(s,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:R(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:t});return P(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>P(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:R(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(ae(n)?n:Promise.resolve(n));return Ae(s,a)}refine(e,t){let s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{let i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new j({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return O.create(this,this._def)}nullable(){return I.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V.create(this)}promise(){return L.create(this,this._def)}or(e){return H.create([this,e],this._def)}and(e){return G.create(this,e,this._def)}transform(e){return new j({...y(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new te({...y(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new he({typeName:m.ZodBranded,type:this,...y(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new re({...y(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return pe.create(this,e)}readonly(){return se.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},We=/^c[^\s-]{8,}$/i,qe=/^[0-9a-z]+$/,Je=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ye=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,He=/^[a-z0-9_-]{21}$/i,Ge=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ke="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",be,et=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,rt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,st=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,at=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ee="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",it=new RegExp(`^${Ee}$`);function Re(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ot(r){return new RegExp(`^${Re(r)}$`)}function Ne(r){let e=`${Ee}T${Re(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ct(r,e){return!!((e==="v4"||!e)&&et.test(r)||(e==="v6"||!e)&&rt.test(r))}function dt(r,e){if(!Ge.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function ut(r,e){return!!((e==="v4"||!e)&&tt.test(r)||(e==="v6"||!e)&&st.test(r))}var z=class r extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.string,received:a.parsedType}),p}let s=new b,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")Xe.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")be||(be=new RegExp(Ke,"u")),be.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")Ye.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")He.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")We.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")qe.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")Je.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),d(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?Ne(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?it.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?ot(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?Qe.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?ct(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?dt(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"jwt",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?ut(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cidr",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?nt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?at.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64url",code:c.invalid_string,message:a.message}),s.dirty()):_.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...h.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...h.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...h.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};z.create=r=>new z({checks:[],typeName:m.ZodString,coerce:r?.coerce??!1,...y(r)});function lt(r,e){let t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=Number.parseInt(r.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}var F=class r extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.number,received:a.parsedType}),p}let s,n=new b;for(let a of this._def.checks)a.kind==="int"?_.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?lt(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_finite,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};F.create=r=>new F({checks:[],typeName:m.ZodNumber,coerce:r?.coerce||!1,...y(r)});var B=class r extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let s,n=new b;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:u.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};B.create=r=>new B({checks:[],typeName:m.ZodBigInt,coerce:r?.coerce??!1,...y(r)});var W=class extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.boolean,received:s.parsedType}),p}return w(e.data)}};W.create=r=>new W({typeName:m.ZodBoolean,coerce:r?.coerce||!1,...y(r)});var q=class r extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.date,received:a.parsedType}),p}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_date}),p}let s=new b,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):_.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};q.create=r=>new q({checks:[],coerce:r?.coerce||!1,typeName:m.ZodDate,...y(r)});var oe=class extends g{_parse(e){if(this._getType(e)!==u.symbol){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.symbol,received:s.parsedType}),p}return w(e.data)}};oe.create=r=>new oe({typeName:m.ZodSymbol,...y(r)});var J=class extends g{_parse(e){if(this._getType(e)!==u.undefined){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.undefined,received:s.parsedType}),p}return w(e.data)}};J.create=r=>new J({typeName:m.ZodUndefined,...y(r)});var Y=class extends g{_parse(e){if(this._getType(e)!==u.null){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.null,received:s.parsedType}),p}return w(e.data)}};Y.create=r=>new Y({typeName:m.ZodNull,...y(r)});var D=class extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}};D.create=r=>new D({typeName:m.ZodAny,...y(r)});var M=class extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}};M.create=r=>new M({typeName:m.ZodUnknown,...y(r)});var E=class extends g{_parse(e){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:u.never,received:t.parsedType}),p}};E.create=r=>new E({typeName:m.ZodNever,...y(r)});var ce=class extends g{_parse(e){if(this._getType(e)!==u.undefined){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.void,received:s.parsedType}),p}return w(e.data)}};ce.create=r=>new ce({typeName:m.ZodVoid,...y(r)});var V=class r extends g{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return d(t,{code:c.invalid_type,expected:u.array,received:t.parsedType}),p;if(n.exactLength!==null){let i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(d(t,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(d(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(d(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new A(t,i,t.path,o)))).then(i=>b.mergeArray(s,i));let a=[...t.data].map((i,o)=>n.type._parseSync(new A(t,i,t.path,o)));return b.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}};V.create=(r,e)=>new V({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...y(e)});function ie(r){if(r instanceof C){let e={};for(let t in r.shape){let s=r.shape[t];e[t]=O.create(ie(s))}return new C({...r._def,shape:()=>e})}else return r instanceof V?new V({...r._def,type:ie(r.element)}):r instanceof O?O.create(ie(r.unwrap())):r instanceof I?I.create(ie(r.unwrap())):r instanceof N?N.create(r.items.map(e=>ie(e))):r}var C=class r extends g{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=_.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){let l=this._getOrReturnCtx(e);return d(l,{code:c.invalid_type,expected:u.object,received:l.parsedType}),p}let{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof E&&this._def.unknownKeys==="strip"))for(let l in n.data)i.includes(l)||o.push(l);let f=[];for(let l of i){let v=a[l],S=n.data[l];f.push({key:{status:"valid",value:l},value:v._parse(new A(n,S,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof E){let l=this._def.unknownKeys;if(l==="passthrough")for(let v of o)f.push({key:{status:"valid",value:v},value:{status:"valid",value:n.data[v]}});else if(l==="strict")o.length>0&&(d(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let v of o){let S=n.data[v];f.push({key:{status:"valid",value:v},value:l._parse(new A(n,S,n.path,v)),alwaysSet:v in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let v of f){let S=await v.key,Se=await v.value;l.push({key:S,value:Se,alwaysSet:v.alwaysSet})}return l}).then(l=>b.mergeObjectSync(s,l)):b.mergeObjectSync(s,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{let n=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};for(let s of _.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new r({...this._def,shape:()=>t})}omit(e){let t={};for(let s of _.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new r({...this._def,shape:()=>t})}deepPartial(){return ie(this)}partial(e){let t={};for(let s of _.objectKeys(this.shape)){let n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new r({...this._def,shape:()=>t})}required(e){let t={};for(let s of _.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof O;)a=a._def.innerType;t[s]=a}return new r({...this._def,shape:()=>t})}keyof(){return Ie(_.objectKeys(this.shape))}};C.create=(r,e)=>new C({shape:()=>r,unknownKeys:"strip",catchall:E.create(),typeName:m.ZodObject,...y(e)});C.strictCreate=(r,e)=>new C({shape:()=>r,unknownKeys:"strict",catchall:E.create(),typeName:m.ZodObject,...y(e)});C.lazycreate=(r,e)=>new C({shape:r,unknownKeys:"strip",catchall:E.create(),typeName:m.ZodObject,...y(e)});var H=class extends g{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new T(o.ctx.common.issues));return d(t,{code:c.invalid_union,unionErrors:i}),p}if(t.common.async)return Promise.all(s.map(async a=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a,i=[];for(let f of s){let l={...t,common:{...t.common,issues:[]},parent:null},v=f._parseSync({data:t.data,path:t.path,parent:l});if(v.status==="valid")return v;v.status==="dirty"&&!a&&(a={result:v,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(f=>new T(f));return d(t,{code:c.invalid_union,unionErrors:o}),p}}get options(){return this._def.options}};H.create=(r,e)=>new H({options:r,typeName:m.ZodUnion,...y(e)});var $=r=>r instanceof Q?$(r.schema):r instanceof j?$(r.innerType()):r instanceof X?[r.value]:r instanceof K?r.options:r instanceof ee?_.objectValues(r.enum):r instanceof te?$(r._def.innerType):r instanceof J?[void 0]:r instanceof Y?[null]:r instanceof O?[void 0,...$(r.unwrap())]:r instanceof I?[null,...$(r.unwrap())]:r instanceof he||r instanceof se?$(r.unwrap()):r instanceof re?$(r._def.innerType):[],ge=class r extends g{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return d(t,{code:c.invalid_type,expected:u.object,received:t.parsedType}),p;let s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(d(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let n=new Map;for(let a of t){let i=$(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new r({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(s)})}};function we(r,e){let t=R(r),s=R(e);if(r===e)return{valid:!0,data:r};if(t===u.object&&s===u.object){let n=_.objectKeys(e),a=_.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(let o of a){let f=we(r[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&s===u.array){if(r.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<r.length;a++){let i=r[a],o=e[a],f=we(i,o);if(!f.valid)return{valid:!1};n.push(f.data)}return{valid:!0,data:n}}else return t===u.date&&s===u.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var G=class extends g{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(me(a)||me(i))return p;let o=we(a.value,i.value);return o.valid?((ye(a)||ye(i))&&t.dirty(),{status:t.value,value:o.data}):(d(s,{code:c.invalid_intersection_types}),p)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};G.create=(r,e,t)=>new G({left:r,right:e,typeName:m.ZodIntersection,...y(t)});var N=class r extends g{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.array)return d(s,{code:c.invalid_type,expected:u.array,received:s.parsedType}),p;if(s.data.length<this._def.items.length)return d(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&s.data.length>this._def.items.length&&(d(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...s.data].map((i,o)=>{let f=this._def.items[o]||this._def.rest;return f?f._parse(new A(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>b.mergeArray(t,i)):b.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};N.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new N({items:r,typeName:m.ZodTuple,rest:null,...y(e)})};var _e=class r extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.object)return d(s,{code:c.invalid_type,expected:u.object,received:s.parsedType}),p;let n=[],a=this._def.keyType,i=this._def.valueType;for(let o in s.data)n.push({key:a._parse(new A(s,o,s.path,o)),value:i._parse(new A(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?b.mergeObjectAsync(t,n):b.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof g?new r({keyType:e,valueType:t,typeName:m.ZodRecord,...y(s)}):new r({keyType:z.create(),valueType:e,typeName:m.ZodRecord,...y(t)})}},de=class extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.map)return d(s,{code:c.invalid_type,expected:u.map,received:s.parsedType}),p;let n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,f],l)=>({key:n._parse(new A(s,o,s.path,[l,"key"])),value:a._parse(new A(s,f,s.path,[l,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let f of i){let l=await f.key,v=await f.value;if(l.status==="aborted"||v.status==="aborted")return p;(l.status==="dirty"||v.status==="dirty")&&t.dirty(),o.set(l.value,v.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let f of i){let l=f.key,v=f.value;if(l.status==="aborted"||v.status==="aborted")return p;(l.status==="dirty"||v.status==="dirty")&&t.dirty(),o.set(l.value,v.value)}return{status:t.value,value:o}}}};de.create=(r,e,t)=>new de({valueType:e,keyType:r,typeName:m.ZodMap,...y(t)});var ue=class r extends g{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.set)return d(s,{code:c.invalid_type,expected:u.set,received:s.parsedType}),p;let n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(d(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(d(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function i(f){let l=new Set;for(let v of f){if(v.status==="aborted")return p;v.status==="dirty"&&t.dirty(),l.add(v.value)}return{status:t.value,value:l}}let o=[...s.data.values()].map((f,l)=>a._parse(new A(s,f,s.path,l)));return s.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new r({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ue.create=(r,e)=>new ue({valueType:r,minSize:null,maxSize:null,typeName:m.ZodSet,...y(e)});var ve=class r extends g{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.function)return d(t,{code:c.invalid_type,expected:u.function,received:t.parsedType}),p;function s(o,f){return fe({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ne(),Z].filter(l=>!!l),issueData:{code:c.invalid_arguments,argumentsError:f}})}function n(o,f){return fe({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ne(),Z].filter(l=>!!l),issueData:{code:c.invalid_return_type,returnTypeError:f}})}let a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof L){let o=this;return w(async function(...f){let l=new T([]),v=await o._def.args.parseAsync(f,a).catch(xe=>{throw l.addIssue(s(f,xe)),l}),S=await Reflect.apply(i,this,v);return await o._def.returns._def.type.parseAsync(S,a).catch(xe=>{throw l.addIssue(n(S,xe)),l})})}else{let o=this;return w(function(...f){let l=o._def.args.safeParse(f,a);if(!l.success)throw new T([s(f,l.error)]);let v=Reflect.apply(i,this,l.data),S=o._def.returns.safeParse(v,a);if(!S.success)throw new T([n(v,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:N.create(e).rest(M.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new r({args:e||N.create([]).rest(M.create()),returns:t||M.create(),typeName:m.ZodFunction,...y(s)})}},Q=class extends g{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Q.create=(r,e)=>new Q({getter:r,typeName:m.ZodLazy,...y(e)});var X=class extends g{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}};X.create=(r,e)=>new X({value:r,typeName:m.ZodLiteral,...y(e)});function Ie(r,e){return new K({values:r,typeName:m.ZodEnum,...y(e)})}var K=class r extends g{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return d(t,{expected:_.joinValues(s),received:t.parsedType,code:c.invalid_type}),p}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return d(t,{received:t.data,code:c.invalid_enum_value,options:s}),p}return w(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}};K.create=Ie;var ee=class extends g{_parse(e){let t=_.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==u.string&&s.parsedType!==u.number){let n=_.objectValues(t);return d(s,{expected:_.joinValues(n),received:s.parsedType,code:c.invalid_type}),p}if(this._cache||(this._cache=new Set(_.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=_.objectValues(t);return d(s,{received:s.data,code:c.invalid_enum_value,options:n}),p}return w(e.data)}get enum(){return this._def.values}};ee.create=(r,e)=>new ee({values:r,typeName:m.ZodNativeEnum,...y(e)});var L=class extends g{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return d(t,{code:c.invalid_type,expected:u.promise,received:t.parsedType}),p;let s=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return w(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};L.create=(r,e)=>new L({type:r,typeName:m.ZodPromise,...y(e)});var j=class extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{d(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return p;let f=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return f.status==="aborted"?p:f.status==="dirty"?U(f.value):t.value==="dirty"?U(f.value):f});{if(t.value==="aborted")return p;let o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?p:o.status==="dirty"?U(o.value):t.value==="dirty"?U(o.value):o}}if(n.type==="refinement"){let i=o=>{let f=n.refinement(o,a);if(s.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!P(i))return p;let o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>P(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):p);_.assertNever(n)}};j.create=(r,e,t)=>new j({schema:r,typeName:m.ZodEffects,effect:e,...y(t)});j.createWithPreprocess=(r,e,t)=>new j({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,...y(t)});var O=class extends g{_parse(e){return this._getType(e)===u.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};O.create=(r,e)=>new O({innerType:r,typeName:m.ZodOptional,...y(e)});var I=class extends g{_parse(e){return this._getType(e)===u.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};I.create=(r,e)=>new I({innerType:r,typeName:m.ZodNullable,...y(e)});var te=class extends g{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===u.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};te.create=(r,e)=>new te({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});var re=class extends g{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ae(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new T(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};re.create=(r,e)=>new re({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});var le=class extends g{_parse(e){if(this._getType(e)!==u.nan){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.nan,received:s.parsedType}),p}return{status:"valid",value:e.data}}};le.create=r=>new le({typeName:m.ZodNaN,...y(r)});var ft=Symbol("zod_brand"),he=class extends g{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},pe=class r extends g{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?p:a.status==="dirty"?(t.dirty(),U(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{let n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?p:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new r({in:e,out:t,typeName:m.ZodPipeline})}},se=class extends g{_parse(e){let t=this._def.innerType._parse(e),s=n=>(P(n)&&(n.value=Object.freeze(n.value)),n);return ae(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}};se.create=(r,e)=>new se({innerType:r,typeName:m.ZodReadonly,...y(e)});function je(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function Ze(r,e={},t){return r?D.create().superRefine((s,n)=>{let a=r(s);if(a instanceof Promise)return a.then(i=>{if(!i){let o=je(e,s),f=o.fatal??t??!0;n.addIssue({code:"custom",...o,fatal:f})}});if(!a){let i=je(e,s),o=i.fatal??t??!0;n.addIssue({code:"custom",...i,fatal:o})}}):D.create()}var ht={object:C.lazycreate},m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));var pt=(r,e={message:`Input not instance of ${r.name}`})=>Ze(t=>t instanceof r,e),$e=z.create,Me=F.create,mt=le.create,yt=B.create,Ve=W.create,gt=q.create,_t=oe.create,vt=J.create,xt=Y.create,kt=D.create,bt=M.create,wt=E.create,Tt=ce.create,Ct=V.create,St=C.create,Ot=C.strictCreate,At=H.create,jt=ge.create,Et=G.create,Rt=N.create,Nt=_e.create,It=de.create,Zt=ue.create,$t=ve.create,Mt=Q.create,Vt=X.create,Pt=K.create,zt=ee.create,Dt=L.create,Lt=j.create,Ut=O.create,Ft=I.create,Bt=j.createWithPreprocess,Wt=pe.create,qt=()=>$e().optional(),Jt=()=>Me().optional(),Yt=()=>Ve().optional(),Ht={string:(r=>z.create({...r,coerce:!0})),number:(r=>F.create({...r,coerce:!0})),boolean:(r=>W.create({...r,coerce:!0})),bigint:(r=>B.create({...r,coerce:!0})),date:(r=>q.create({...r,coerce:!0}))};var Gt=p;var Te=k.string().datetime({precision:0}).regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/).describe("A UTC ISO 8601 instant with whole seconds and the Z timezone marker.");function Pe(r){return r.toISOString().replace(/\.\d{3}Z$/,"Z")}var Qt=k.object({type:k.literal("diagnostic"),timestamp:Te,level:k.enum(["debug","info","warning","error"]),message:k.string(),code:k.string().min(1).optional().describe("A stable diagnostic code, included only when known.")}).strict(),Xt=k.object({type:k.literal("progress"),timestamp:Te,status:k.enum(["started","updated","retrying","completed","failed"]),operation:k.string(),message:k.string().optional(),current:k.number().int().nonnegative().optional(),total:k.number().int().nonnegative().optional()}).strict(),Dr=k.discriminatedUnion("type",[Qt,Xt]);function ze(r={}){let e=r.sink??(()=>{}),t=r.clock??(()=>new Date);return{emit(s,n){let a=Pe(t()),i={...s,timestamp:a};n===void 0?e(i):e(i,n)}}}import{AsyncLocalStorage as Kt}from"node:async_hooks";function Wr(r,e){return Ce().run({channel:ze(r),outputMode:r.outputMode??"text"},e)}function qr(r,e){Ce().getStore()?.channel.emit(r,e)}function Jr(){return Ce().getStore()?.outputMode}function Ce(){let r=Symbol.for("command-event-storage"),e=globalThis;return e[r]??=new Kt,e[r]}export{m as a,k as b,Te as c,Pe as d,Qt as e,Xt as f,Dr as g,Wr as h,qr as i,Jr as j};
@@ -1 +0,0 @@
1
- import{a as v}from"./chunk-BU3JQM3W.js";import{a as A}from"./chunk-2QQ7EBJD.js";import{a as k}from"./chunk-D4LFWIFE.js";import{Na as j,g as I}from"./chunk-XV6XCOTG.js";import{b as x,c as S}from"./chunk-5AWELO3D.js";import{A as h,T as g,y as f}from"./chunk-V654BMS7.js";import{a as u}from"./chunk-BN7ZXAZJ.js";import{d as m}from"./chunk-FHNJLON5.js";import{h as b,j as y}from"./chunk-J7BTC45S.js";import{wb as w}from"./chunk-RIG66DIQ.js";import{b as r}from"./chunk-FZCGRIOM.js";import{b as P}from"./chunk-YTUUU33R.js";import{e as N,g as a}from"./chunk-VKWPEFWQ.js";a();a();a();async function c(e,{web:t,stdout:i,stderr:n,signal:o,env:s={}}){let d=t.configuration.commands[e];if(!d)return;let[F,...T]=d.split(" ");await g(F,T,{cwd:t.directory,stdout:i,stderr:n,signal:o,env:s}),i.write("Web successfully built.")}async function B(e){!e.skipDependenciesInstallation&&!e.project.usesWorkspaces&&await A(e.project);let t={};return e.apiKey&&(t.SHOPIFY_API_KEY=e.apiKey),await I(e.app),await f({processes:[...e.app.webs.map(i=>({prefix:["web",...i.configuration.roles].join("-"),action:async(n,o,s)=>{await c("build",{web:i,stdout:n,stderr:o,signal:s,env:t})}})),...e.app.allExtensions.map(i=>({prefix:i.localIdentifier,action:async(n,o,s)=>{await i.build({stdout:n,stderr:o,signal:s,app:e.app,environment:"production"})}}))],showTimestamps:!1}),{status:"success",appName:e.app.name}}var O=B;a();var p=u({name:"AppBuildResult",schema:r.object({status:r.literal("success")}).strict()});a();function _(e,t){t?w(p.encode({status:e.status})):h({headline:[{userInput:e.appName},"built!"]})}var E=N(P(),1);var l=class e extends v{static summary="Build the app, including extensions.";static descriptionWithMarkdown="This command executes the build script specified in the element's TOML file. You can specify a custom script in the file. To learn about configuration files in Shopify apps, refer to [App configuration](https://shopify.dev/docs/apps/tools/cli/configuration).\n\n If you're building a [theme app extension](https://shopify.dev/docs/apps/online-store/theme-app-extensions), then running the `build` command runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) against your extension to ensure that it's valid.";static get jsonOutputSchema(){return p}static description=this.descriptionForHelp();static flags={...x,...k,...S,"skip-dependencies-installation":E.Flags.boolean({hidden:!1,description:"Skips the installation of dependencies. Deprecated, use workspaces instead.",env:"SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION",default:!1})};async run(){let{flags:t}=await this.parse(e),i=t["client-id"];await m(()=>({cmd_app_dependency_installation_skipped:t["skip-dependencies-installation"]}));let{app:n,project:o}=await j({directory:t.path,userProvidedConfigName:t.config});try{let s=await O({app:n,project:o,skipDependenciesInstallation:t["skip-dependencies-installation"],apiKey:i});_(s,t.json)}catch(s){throw t.json&&s instanceof y?new b("The app build did not complete. See the build diagnostics for details."):s}return{app:n}}};export{l as a};
@@ -1,6 +0,0 @@
1
- import{a as L}from"./chunk-YFRI75U4.js";import{N as H}from"./chunk-XV6XCOTG.js";import{t as W}from"./chunk-WFOU5M4H.js";import{a as X}from"./chunk-VJEKDBGZ.js";import{a as D,d as T,x as k}from"./chunk-V654BMS7.js";import{h as S}from"./chunk-J7BTC45S.js";import{Ba as I,Bb as p,Sa as A,Ta as y,ab as w,ma as O,va as g}from"./chunk-RIG66DIQ.js";import{g as N}from"./chunk-GSGCSBRN.js";import{c as x,d as m,f as v,h as P}from"./chunk-IWTNUJGY.js";import{e as J,g as u}from"./chunk-VKWPEFWQ.js";u();function _(){return process.hrtime()}function U(r){let t=process.hrtime(r);return(t[0]*1e3+t[1]/1e6).toFixed(2)}u();u();var $=J(X(),1),q=200,K=6e4,M=200,Y=500,Q=["**/node_modules/**","**/.git/**","**/.shopify/**","**/.DS_Store","**/*.swp","**/*.swo","**/*~"],b=class{currentEvents=[];extensionPaths=[];app;options;onChangeCallback;watcher;debouncedEmit;ignored={};extensionWatchedFiles=new Map;constructor(t,e,s=q){this.app=t,this.options=e,this.debouncedEmit=k(this.emitEvents.bind(this),s,{leading:!0,trailing:!0}),this.updateApp(t)}onChange(t){this.onChangeCallback=t}async start(){let e=[...this.app.configuration.extension_directories??["extensions"]].map(a=>x(this.app.directory,a));await Promise.all(e.map(async a=>{try{await g(a.replace(/\/\*+$/,""))}catch{}}));let s=[this.app.configPath,...e],i=this.getAllWatchedFiles();s.push(...i),this.close();let{default:n}=await import("./chokidar-5RWEYTNQ.js"),o=new Map;this.watcher=n.watch(s,{ignored:[...Q,a=>{let d=m(a);return this.app.realExtensions.some(c=>{if(!c.isFunctionExtension)return!1;let h=m(x(c.directory,P(c.outputRelativePath)));return d===h||d.startsWith(`${h}/`)})||Z(d,o)}],persistent:!0,ignoreInitial:!0}),this.watcher.on("all",this.handleFileEvent),this.addAbortListener(),p(`File watcher started with ${s.length} paths`,this.options.stdout)}updateApp(t){this.app=t,this.extensionPaths=this.app.nonConfigExtensions.map(e=>m(e.directory)).filter(e=>e!==this.app.directory),this.extensionPaths.forEach(e=>{this.ignored[e]??=this.createIgnoreInstance(e)})}addAbortListener(){this.options.signal.removeEventListener("abort",this.close),this.options.signal.addEventListener("abort",this.close)}getAllWatchedFiles(){this.extensionWatchedFiles.clear();let t=this.app.realExtensions.map(s=>({extension:s,watchedFiles:s.watchedFiles()})),e=new Set;for(let{extension:s,watchedFiles:i}of t)for(let n of i){let o=m(n);e.add(o);let a=this.extensionWatchedFiles.get(o)??new Set;a.add(s.handle),this.extensionWatchedFiles.set(o,a)}return Array.from(e)}emitEvents=()=>{let t=this.currentEvents;this.currentEvents=[];let e=`\u{1F509} ${t.length} EVENTS EMITTED in files: ${t.map(s=>s.path).join(`
2
- `)}`;p(e,this.options.stdout),this.onChangeCallback?.(t)};pushEvent(t){this.shouldIgnoreEvent(t)||(t.type==="extension_folder_created"&&(this.ignored[t.path]=this.createIgnoreInstance(t.path)),!this.currentEvents.some(e=>e.path===t.path&&e.type===t.type&&e.extensionHandle===t.extensionHandle)&&this.currentEvents.push(t))}shouldIgnoreEvent(t){if(t.type==="extension_folder_deleted"||t.type==="extension_folder_created"||t.extensionHandle&&this.extensionWatchedFiles.get(m(t.path))?.has(t.extensionHandle))return!1;let s=(t.extensionHandle?this.app.realExtensions.find(n=>n.handle===t.extensionHandle):void 0)?.watchedFiles(),i=this.ignored[t.extensionPath];if(s)return!s.some(o=>w(t.path,o));if(i){let n=v(t.extensionPath,t.path);return i.ignores(n)}return!1}handleFileEvent=(t,e)=>{let s=_(),i=m(e),n=e===this.app.configPath,o=e.endsWith(".extension.toml");if(p(`\u{1F300}: ${t} ${e.replace(this.app.directory,"")}
3
- `),n)this.handleEventForExtension(t,e,this.app.directory,s,!1);else{let a=this.extensionWatchedFiles.get(i),d=a===void 0||a.size===0;if(d&&t==="add"&&!o){let l=this.discoverFileOwners(i);l.size>0&&(this.extensionWatchedFiles.set(i,l),a=l,d=!1)}if(d&&!o&&!n){p(`\u{1F300}: File ${e} is not watched by any extension`,this.options.stdout);return}for(let l of a??[]){let c=this.app.realExtensions.find(E=>E.handle===l),h=c?m(c.directory):this.app.directory;this.handleEventForExtension(t,e,h,s,!1,l)}d&&this.handleEventForExtension(t,e,this.app.directory,s,!0)}this.debouncedEmit()};discoverFileOwners(t){let e=new Set;for(let s of this.app.realExtensions){let i=m(s.directory);i!==this.app.directory&&t.startsWith(`${i}/`)&&this.pathMatchesWatchPatterns(t,s)&&e.add(s.handle)}return e}pathMatchesWatchPatterns(t,e){let{paths:s,ignore:i}=e.watchPatterns(),n=v(m(e.directory),t);return i.some(o=>w(n,o))?!1:s.some(o=>w(n,o))}handleEventForExtension(t,e,s,i,n,o){let a=e.endsWith(".extension.toml"),d=e===this.app.configPath;switch(t){case"change":if(n)break;a||d?this.pushEvent({type:"extensions_config_updated",path:e,extensionPath:s,extensionHandle:o,startTime:i}):this.pushEvent({type:"file_updated",path:e,extensionPath:s,extensionHandle:o,startTime:i});break;case"add":if(!a){this.pushEvent({type:"file_created",path:e,extensionPath:s,extensionHandle:o,startTime:i});break}let l=0,c=P(e),h=setInterval(()=>{y(x(c,W.lockFile))?(p(`Waiting for extension to complete creation: ${e}
4
- `),l+=M):(clearInterval(h),this.extensionPaths.push(c),this.pushEvent({type:"extension_folder_created",path:c,extensionPath:s,startTime:i}),this.debouncedEmit()),l>=K&&(clearInterval(h),this.options.stderr.write(`Error loading new extension at path: ${e}.
5
- Please restart the process.`))},M);break;case"unlink":if(e.endsWith(W.lockFile))break;d?this.pushEvent({type:"app_config_deleted",path:e,extensionPath:s,startTime:i}):a?(this.extensionPaths=this.extensionPaths.filter(E=>E!==s),this.pushEvent({type:"extension_folder_deleted",path:s,extensionPath:s,startTime:i})):setTimeout(()=>{this.extensionPaths.includes(s)&&(this.pushEvent({type:"file_deleted",path:e,extensionPath:s,extensionHandle:o,startTime:i}),this.extensionWatchedFiles.delete(m(e)),this.debouncedEmit())},Y);break;case"addDir":case"unlinkDir":break}}close=()=>{this.watcher&&(p("Closing file watcher",this.options.stdout),this.watcher.close().then(()=>p("File watching closed",this.options.stdout)).catch(t=>p(`File watching failed to close: ${t.message}`,this.options.stderr)))};createIgnoreInstance(t){let e=x(t,".gitignore");if(!y(e))return;let s=O(e).toString().split(`
6
- `).map(i=>i.trim()).filter(i=>i!==""&&!i.startsWith("#"));return $.default.default().add(s)}};function Z(r,t){let e=r.split("/");for(let s=e.length-1;s>0;s--){if(e[s]!=="target")continue;let i=e.slice(0,s).join("/"),n=t.get(i);if(n===void 0&&(n=y(x(i,"Cargo.toml")),t.set(i,n)),n)return!0}return!1}u();u();function j(r,t,e=!0){let s=r.realExtensions,i=s.map(c=>c.uid),n=t.realExtensions,o=n.map(c=>c.uid),a=n.filter(c=>!i.includes(c.uid)),d=s.filter(c=>!o.includes(c.uid)),l;return e&&(l=n.filter(c=>{let h=s.find(F=>F.uid===c.uid);if(!h)return!1;let E=JSON.stringify(h.configuration)!==JSON.stringify(c.configuration),R=h.configurationPath!==c.configurationPath;return E||R})),{created:a,updated:l??[],deleted:d}}async function V(r,t,e){if(r[0]===void 0)return;let s=r.some(o=>B.includes(o.type)),i=r.filter(o=>!B.includes(o.type));if(s)return it({event:r[0],app:t,options:e,extensions:[]});let n={app:t,extensionEvents:[],path:r[0].path,startTime:r[0].startTime};for(let o of i){let a=o.extensionHandle?t.realExtensions.filter(l=>l.handle===o.extensionHandle):t.realExtensions.filter(l=>l.directory===o.extensionPath),d=tt[o.type]({event:o,app:n.app,extensions:a,options:e});n.extensionEvents.push(...d.extensionEvents)}return n}var B=["extensions_config_updated","extension_folder_created"],tt={extension_folder_deleted:et,file_created:C,file_deleted:C,file_updated:C,app_config_deleted:st,extension_folder_created:z,extensions_config_updated:z};function et({event:r,app:t,extensions:e}){let s=e.map(i=>(t.removeExtension(i.uid),{type:f.Deleted,extension:i}));return{app:t,extensionEvents:s,startTime:r.startTime,path:r.path}}function C({event:r,app:t,extensions:e}){let s=e.map(i=>({type:f.Updated,extension:i}));return{app:t,extensionEvents:s,startTime:r.startTime,path:r.path}}function z(r){return{app:r.app,extensionEvents:[],startTime:r.event.startTime,path:r.event.path}}function st(r){throw new S("The active app.toml was deleted, exiting")}async function it({event:r,app:t}){let e=await nt(t),s=j(t,e,!0),i=s.created.map(d=>({type:f.Created,extension:d})),n=s.deleted.map(d=>({type:f.Deleted,extension:d})),o=s.updated.map(d=>({type:f.Updated,extension:d})),a=[...i,...n,...o];return{app:e,extensionEvents:a,startTime:r.startTime,path:r.path,appWasReloaded:!0}}async function nt(r){let t=_();try{let e=await H(r);return p(`App reloaded [${U(t)}ms]`),e}catch(e){let s=new Error(`Error reloading app: ${e.message}`);throw s.cause="validation-error",s}}u();import{formatMessagesSync as ot}from"esbuild";import rt from"events";var f;(function(r){r.Updated="changed",r.Deleted="deleted",r.Created="created"})(f||(f={}));var G=class extends rt{buildOutputPath;app;options;appURL;started=!1;ready=!1;initialEvents=[];fileWatcher;constructor(t,e,s,i){super(),this.app=t,this.appURL=e,this.buildOutputPath=s??x(t.directory,".shopify","dev-bundle"),this.options={stdout:process.stdout,stderr:process.stderr,signal:new D().signal},this.fileWatcher=i}async start(t,e=!0){this.started||(this.started=!0,this.options=t??this.options,await A(this.buildOutputPath)&&await I(this.buildOutputPath,{force:!0}),await g(this.buildOutputPath),e&&(this.initialEvents=this.app.realExtensions.map(s=>({type:f.Updated,extension:s})),await this.buildExtensions(this.initialEvents)),this.fileWatcher=this.fileWatcher??new b(this.app,this.options),this.fileWatcher.onChange(s=>{V(s,this.app,this.options).then(async i=>{if(i?.extensionEvents.length===0&&p("Change detected, but no extensions were affected"),!i)return;this.app=i.app,i.appWasReloaded&&this.fileWatcher?.updateApp(this.app),await this.rescanImports(i);let n=i.extensionEvents.filter(o=>o.type!==f.Deleted);await this.buildExtensions(n),i.appWasReloaded||await this.app.generateExtensionTypes(),await this.deleteExtensionsBuildOutput(i),this.emit("all",i)}).catch(i=>{this.emit("error",i)})}),await this.fileWatcher.start(),this.ready=!0,this.emit("ready",{app:this.app,extensionEvents:this.initialEvents}))}onEvent(t){return this.addListener("all",t),this}onStart(t){if(this.ready){let e={app:this.app,extensionEvents:this.initialEvents,startTime:[0,0],path:""};t(e)?.catch(()=>{})}else this.once("ready",t);return this}onError(t){return this.addListener("error",t),this}async deleteExtensionsBuildOutput(t){let s=t.extensionEvents.filter(i=>i.type===f.Deleted).map(i=>i.extension).map(async i=>{let n=x(this.buildOutputPath,i.getOutputFolderId());return I(n,{force:!0})});await Promise.all(s)}async buildExtensions(t){let e=L(t,n=>n.extension.uid),s=[];for(let n of Object.values(e))n.length>0&&n[0]&&s.push({extension:n[0].extension,events:n});let i=s.map(async({extension:n,events:o})=>T({outputPrefix:n.handle,stripAnsi:!1},async()=>{try{await this.buildExtension(n);let a={status:"ok",uid:n.uid};o.forEach(d=>{d.buildResult=a})}catch(a){let d=a.errors??[],l=a.message,c;if(d.length){let E=d[0];l=E?.text,c=E?.location?.file,ot(d,{kind:"error",color:!N()}).forEach(F=>{this.options.stderr.write(F)})}else this.options.stderr.write(a.message);let h={status:"error",error:l,file:c,uid:n.uid};o.forEach(E=>{E.buildResult=h})}}));return Promise.all(i)}async buildExtension(t){let e={app:this.app,stdout:this.options.stdout,stderr:this.options.stderr,useTasks:!1,environment:"development",appURL:this.appURL};await t.buildForBundle(e,this.buildOutputPath)}async rescanImports(t){if(t.path.endsWith(".toml"))return;let s=t.extensionEvents.filter(i=>i.type!==f.Deleted).map(i=>i.extension);s.length>0&&(await Promise.all(s.map(async o=>o.rescanImports()))).some(o=>o)&&await this.fileWatcher?.start()}};export{_ as a,U as b,f as c,G as d};