shopify 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/dist/{analytics-VKKJNJ62.js → analytics-RSUIYNLC.js} +1 -1
  2. package/dist/analytics-V2SDYXQJ.js +1 -0
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-NK2MGR6A.js → chunk-2AW3KBTP.js} +1 -1
  5. package/dist/{chunk-BCYTZ7LM.js → chunk-2CJQQQW4.js} +1 -1
  6. package/dist/{chunk-EITIW5OX.js → chunk-2M4BKFYF.js} +1 -1
  7. package/dist/chunk-2M535QQJ.js +6 -0
  8. package/dist/{chunk-5TB52UUV.js → chunk-2NZ7GDDR.js} +1 -1
  9. package/dist/{chunk-YVY32DNA.js → chunk-2QQ7EBJD.js} +1 -1
  10. package/dist/chunk-2RFCYZMG.js +47 -0
  11. package/dist/{chunk-S67I4E7M.js → chunk-2S5NPJEJ.js} +1 -1
  12. package/dist/{chunk-YVVU4J5O.js → chunk-2TPLPZA2.js} +1 -1
  13. package/dist/{chunk-C3KEDG33.js → chunk-2YGPWG3I.js} +1 -1
  14. package/dist/{chunk-TTEF7GTX.js → chunk-32O27NE3.js} +1 -1
  15. package/dist/{chunk-24NUJTIH.js → chunk-364BVGRY.js} +1 -1
  16. package/dist/{chunk-BJPDJIS4.js → chunk-36TZ447N.js} +1 -1
  17. package/dist/{chunk-5UWMXOHM.js → chunk-37P5YOP2.js} +1 -1
  18. package/dist/{chunk-4CRBTSVP.js → chunk-3G2PEYPI.js} +1 -1
  19. package/dist/{chunk-EXFBZPZS.js → chunk-3JACWBUC.js} +1 -1
  20. package/dist/{chunk-53BG3NLH.js → chunk-43HKFLOU.js} +1 -1
  21. package/dist/chunk-46JYM3GH.js +1 -0
  22. package/dist/{chunk-XITZIDCL.js → chunk-4EDE3UH7.js} +1 -1
  23. package/dist/{chunk-G6ZMSWEU.js → chunk-4GQEXVDT.js} +1 -1
  24. package/dist/{chunk-SNNZ4U2W.js → chunk-4IUXLUFD.js} +1 -1
  25. package/dist/{chunk-ULD7CIOY.js → chunk-4QZ6OBXL.js} +1 -1
  26. package/dist/{chunk-YKS7MH3F.js → chunk-4SDCXKYR.js} +1 -1
  27. package/dist/{chunk-VB7YQMAM.js → chunk-56GKTWFF.js} +1 -1
  28. package/dist/{chunk-Q66CI37F.js → chunk-5AQ5JT2V.js} +1 -1
  29. package/dist/{chunk-Q2SZCZE7.js → chunk-5AWELO3D.js} +1 -1
  30. package/dist/{chunk-VHUD3CBC.js → chunk-5D4FNAAD.js} +1 -1
  31. package/dist/{chunk-46MSIQ6Z.js → chunk-5TWYJQQO.js} +1 -1
  32. package/dist/{chunk-OGWPS55W.js → chunk-5XOEMYEQ.js} +1 -1
  33. package/dist/{chunk-MR2AUT7Q.js → chunk-5YUDEPEY.js} +1 -1
  34. package/dist/{chunk-CCQNP5YR.js → chunk-5YXYYQBX.js} +1 -1
  35. package/dist/{chunk-P33TONYG.js → chunk-63UKZLPC.js} +1 -1
  36. package/dist/chunk-6JZC6UKY.js +20 -0
  37. package/dist/{chunk-7QUZWCJZ.js → chunk-6Y6A2QGK.js} +1 -1
  38. package/dist/{chunk-M7LPHCP2.js → chunk-75LAVRRL.js} +2 -2
  39. package/dist/{chunk-AJMDF3QC.js → chunk-7AWAOPLA.js} +1 -1
  40. package/dist/{chunk-AXC2MHHO.js → chunk-7NYCJG2U.js} +1 -1
  41. package/dist/{chunk-6DXP7PQ7.js → chunk-7U2MTK6I.js} +1 -1
  42. package/dist/{chunk-JEA3C7ON.js → chunk-7XAEI4XT.js} +1 -1
  43. package/dist/{chunk-TPSA4JN5.js → chunk-A7LBGXWG.js} +1 -1
  44. package/dist/{chunk-2CMEKSI7.js → chunk-ADVLRSSO.js} +1 -1
  45. package/dist/{chunk-3LVCG4JB.js → chunk-AIEVQSI3.js} +1 -1
  46. package/dist/{chunk-M4BVLMPH.js → chunk-AOBE6HN6.js} +1 -1
  47. package/dist/{chunk-PSSYLJG4.js → chunk-AQ34X5B3.js} +1 -1
  48. package/dist/{chunk-43KLFFP7.js → chunk-B2VE7WOX.js} +1 -1
  49. package/dist/{chunk-L7MSPGDS.js → chunk-B4ISKIXN.js} +1 -1
  50. package/dist/{chunk-EMSF57ZB.js → chunk-BB7GAZP6.js} +1 -1
  51. package/dist/chunk-BNTOGZLY.js +1 -0
  52. package/dist/chunk-BU3JQM3W.js +1 -0
  53. package/dist/{chunk-LHKVXJPX.js → chunk-C3LL5CZA.js} +1 -1
  54. package/dist/{chunk-GFVKTWFT.js → chunk-C4EKNOLY.js} +1 -1
  55. package/dist/{chunk-5NEGOQT6.js → chunk-CFUZ6574.js} +1 -1
  56. package/dist/{chunk-NB4BRW3H.js → chunk-CKVVJ4XO.js} +1 -1
  57. package/dist/{chunk-VWH3VPYI.js → chunk-CNPBDSDL.js} +1 -1
  58. package/dist/{chunk-U25W35TX.js → chunk-CWR3IFXD.js} +1 -1
  59. package/dist/{chunk-VW6QS7DO.js → chunk-CX3ANDPI.js} +1 -1
  60. package/dist/{chunk-GB6E3ATN.js → chunk-CXPYOLGM.js} +1 -1
  61. package/dist/{chunk-FWB3GLMW.js → chunk-D4LFWIFE.js} +1 -1
  62. package/dist/{chunk-PZUGDE7N.js → chunk-DM7BTMFP.js} +1 -1
  63. package/dist/{chunk-GRGFA26K.js → chunk-DSKAIC7O.js} +1 -1
  64. package/dist/{chunk-M5TGCSUK.js → chunk-DTRENW4Q.js} +1 -1
  65. package/dist/{chunk-EGCWR5AS.js → chunk-DVW7NDVD.js} +1 -1
  66. package/dist/{chunk-YGYEM6QO.js → chunk-E3CTHNQS.js} +1 -1
  67. package/dist/{chunk-6BNKBCCU.js → chunk-EA5XVQJT.js} +1 -1
  68. package/dist/{chunk-XM7YUXTF.js → chunk-EH22T4FI.js} +2 -2
  69. package/dist/{chunk-XNNKLUTN.js → chunk-ETXBF6Q7.js} +1 -1
  70. package/dist/{chunk-AYL6KBPE.js → chunk-EXTVC33U.js} +1 -1
  71. package/dist/{chunk-J6TW43TG.js → chunk-F3OM2YO6.js} +1 -1
  72. package/dist/{chunk-X7HVAVSZ.js → chunk-FHNJLON5.js} +1 -1
  73. package/dist/{chunk-SFPXYHHL.js → chunk-FK5OFLSJ.js} +1 -1
  74. package/dist/{chunk-NDKSG4CC.js → chunk-FNWXMCSD.js} +1 -1
  75. package/dist/{chunk-KKPOOIE4.js → chunk-FPOZMNT2.js} +1 -1
  76. package/dist/{chunk-HIRTL45Q.js → chunk-FS5PZCZ3.js} +1 -1
  77. package/dist/{chunk-Q5MEFIMV.js → chunk-FTHVOIK7.js} +1 -1
  78. package/dist/chunk-FVRI7ZKE.js +103 -0
  79. package/dist/{chunk-CIK5BF7V.js → chunk-GCKGQFV7.js} +1 -1
  80. package/dist/{chunk-PEVIRAMR.js → chunk-GGJUPL4W.js} +1 -1
  81. package/dist/{chunk-R7EMV77H.js → chunk-GHU6YEXH.js} +1 -1
  82. package/dist/{chunk-WGUOLSMG.js → chunk-GNPIKPHB.js} +1 -1
  83. package/dist/{chunk-3A3DZVEJ.js → chunk-GSGCSBRN.js} +1 -1
  84. package/dist/{chunk-PIAD3F6M.js → chunk-H57KYDEI.js} +1 -1
  85. package/dist/{chunk-GAMC2BNY.js → chunk-HNU6R7RT.js} +1 -1
  86. package/dist/{chunk-UOS2XLGG.js → chunk-HP2ZAAY7.js} +1 -1
  87. package/dist/{chunk-IEQ4UOH3.js → chunk-HPT3UXZ5.js} +1 -1
  88. package/dist/chunk-HT66BOEC.js +8 -0
  89. package/dist/{chunk-4ARCB6DT.js → chunk-HXNGLDMU.js} +1 -1
  90. package/dist/{chunk-BVSKBX7T.js → chunk-IAL6IQYW.js} +1 -1
  91. package/dist/{chunk-4RDFMBRG.js → chunk-IULZYDCI.js} +1 -1
  92. package/dist/{chunk-UIQL5ZF3.js → chunk-IWTOC6DG.js} +1 -1
  93. package/dist/{chunk-2ORRV7GH.js → chunk-IY5EI5V2.js} +1 -1
  94. package/dist/{chunk-ZT5WFUKJ.js → chunk-J3UXIC23.js} +1 -1
  95. package/dist/{chunk-Q2XRITUG.js → chunk-J5DUFSR4.js} +1 -1
  96. package/dist/{chunk-2VSNFOKD.js → chunk-J7BTC45S.js} +1 -1
  97. package/dist/{chunk-SL3VBI62.js → chunk-JMVK2BIB.js} +1 -1
  98. package/dist/{chunk-X2H6I2WW.js → chunk-JUTULEWW.js} +1 -1
  99. package/dist/{chunk-KGRIYAMA.js → chunk-K3YALQBQ.js} +1 -1
  100. package/dist/{chunk-SFQEHDJY.js → chunk-KGASGUDQ.js} +1 -1
  101. package/dist/{chunk-LDU5T3DN.js → chunk-KLYGMYXV.js} +1 -1
  102. package/dist/{chunk-7WPUV7GY.js → chunk-KNQXCU3Y.js} +1 -1
  103. package/dist/{chunk-C7V755IT.js → chunk-KOTZSPZA.js} +1 -1
  104. package/dist/{chunk-DJAZBPYA.js → chunk-KT5QQOES.js} +1 -1
  105. package/dist/{chunk-4SS6DXC7.js → chunk-KVF55INC.js} +1 -1
  106. package/dist/{chunk-MXJAH2GW.js → chunk-L6VONMA2.js} +1 -1
  107. package/dist/{chunk-GXORLBVN.js → chunk-LENSEW2F.js} +1 -1
  108. package/dist/{chunk-7UOA4DI7.js → chunk-LGXNXAQA.js} +1 -1
  109. package/dist/{chunk-ZYQ2XWC5.js → chunk-LR4J4KYJ.js} +1 -1
  110. package/dist/{chunk-QN3774QI.js → chunk-LWMKZJ4M.js} +1 -1
  111. package/dist/{chunk-I4OVLRQR.js → chunk-M2KX3PXA.js} +1 -1
  112. package/dist/{chunk-D7NB7YR6.js → chunk-M73IECPW.js} +1 -1
  113. package/dist/{chunk-4TI7U2PN.js → chunk-M7NLCGCP.js} +1 -1
  114. package/dist/chunk-MHWETFNT.js +1 -0
  115. package/dist/{chunk-CCMDZX35.js → chunk-MMUGP3WP.js} +1 -1
  116. package/dist/{chunk-LMQGNECW.js → chunk-MNWT2SQO.js} +1 -1
  117. package/dist/{chunk-R2BDABJD.js → chunk-MS7DTL4U.js} +1 -1
  118. package/dist/{chunk-OVWUGAEU.js → chunk-MU2X7NGF.js} +1 -1
  119. package/dist/{chunk-GCNA3HXH.js → chunk-MXXMIPUN.js} +1 -1
  120. package/dist/{chunk-POKY4RWR.js → chunk-MZCIRMZJ.js} +1 -1
  121. package/dist/{chunk-PGLWZMJU.js → chunk-MZWPIFAM.js} +1 -1
  122. package/dist/{chunk-H4V55Y3Z.js → chunk-NCPZVARH.js} +83 -83
  123. package/dist/{chunk-3G4HJO72.js → chunk-NJVNGEOU.js} +1 -1
  124. package/dist/{chunk-CEIJKJOF.js → chunk-NMECLRGK.js} +1 -1
  125. package/dist/{chunk-UVRKTMF7.js → chunk-NMLLRFZF.js} +1 -1
  126. package/dist/chunk-NPB753M3.js +1 -0
  127. package/dist/{chunk-ZAA2DXK5.js → chunk-NUCDRKDW.js} +1 -1
  128. package/dist/{chunk-UZROQRLX.js → chunk-OH7BQZQ7.js} +1 -1
  129. package/dist/{chunk-ZQDDRIBA.js → chunk-OLKLHVHA.js} +4 -4
  130. package/dist/{chunk-7MVWDCI3.js → chunk-OPVXPDOQ.js} +1 -1
  131. package/dist/{chunk-IWEKM5Y3.js → chunk-OQUXGAF2.js} +1 -1
  132. package/dist/{chunk-IUTZIN2T.js → chunk-OUMERKRE.js} +1 -1
  133. package/dist/{chunk-5OMJFPQW.js → chunk-OYGIQDME.js} +1 -1
  134. package/dist/{chunk-KSDU4YOB.js → chunk-P5W5RVE6.js} +1 -1
  135. package/dist/{chunk-PYIICTLX.js → chunk-PNZURX3S.js} +1 -1
  136. package/dist/{chunk-UK6576EO.js → chunk-PRKJVU4Y.js} +1 -1
  137. package/dist/{chunk-DFQ4WTET.js → chunk-PVASYKSJ.js} +1 -1
  138. package/dist/{chunk-CW2T7EOQ.js → chunk-PXFPVGWV.js} +1 -1
  139. package/dist/{chunk-7LAKWAKX.js → chunk-Q2ORJEB2.js} +1 -1
  140. package/dist/{chunk-XKRJKUA7.js → chunk-QBE6XVU3.js} +1 -1
  141. package/dist/{chunk-N2RFDHRY.js → chunk-QGWC23HQ.js} +1 -1
  142. package/dist/{chunk-GQNOVEKP.js → chunk-QVVQUJQL.js} +1 -1
  143. package/dist/{chunk-WMAFG2JD.js → chunk-QX3T6G5X.js} +1 -1
  144. package/dist/{chunk-VMMUJN4T.js → chunk-QYFU363G.js} +1 -1
  145. package/dist/{chunk-7NSK77WG.js → chunk-RDXLDCMI.js} +1 -1
  146. package/dist/{chunk-JYMDWR25.js → chunk-REDUS6EW.js} +1 -1
  147. package/dist/{chunk-FNLECT7B.js → chunk-RFZNFTVM.js} +1 -1
  148. package/dist/{chunk-LWCTKI4Z.js → chunk-RIG66DIQ.js} +3 -3
  149. package/dist/{chunk-YTUDXZLN.js → chunk-RNUEPPVN.js} +1 -1
  150. package/dist/{chunk-RFGEM5JC.js → chunk-RWTAPWLJ.js} +1 -1
  151. package/dist/{chunk-WFWISGLS.js → chunk-T5YVYVSW.js} +1 -1
  152. package/dist/{chunk-WJSUIUBW.js → chunk-TTBNFGCW.js} +1 -1
  153. package/dist/{chunk-OQ5CLM2H.js → chunk-UDPYSL3M.js} +1 -1
  154. package/dist/{chunk-KDPQXURV.js → chunk-ULMNNGGX.js} +1 -1
  155. package/dist/{chunk-T2IUXXCT.js → chunk-URCH4ITT.js} +1 -1
  156. package/dist/{chunk-NOH63WC6.js → chunk-UU2R56LN.js} +1 -1
  157. package/dist/{chunk-CVVQQLCF.js → chunk-V2FCZC7U.js} +1 -1
  158. package/dist/{chunk-CZ22VZDA.js → chunk-V654BMS7.js} +108 -108
  159. package/dist/{chunk-7IFE4UQY.js → chunk-V7H7ITCF.js} +1 -1
  160. package/dist/{chunk-MYAIWSOO.js → chunk-VG2AESTZ.js} +1 -1
  161. package/dist/{chunk-XTREQ4A2.js → chunk-VXD26GIG.js} +1 -1
  162. package/dist/{chunk-QKVVJXWS.js → chunk-VXL5FBE7.js} +1 -1
  163. package/dist/{chunk-I6FRVYGE.js → chunk-W7S6SYBM.js} +1 -1
  164. package/dist/{chunk-HCZG7YJ6.js → chunk-WAY723TL.js} +1 -1
  165. package/dist/chunk-WFOU5M4H.js +16 -0
  166. package/dist/{chunk-BWRNXCVN.js → chunk-WGOSE3RL.js} +1 -1
  167. package/dist/{chunk-KJQDS5HI.js → chunk-WQ6W725N.js} +1 -1
  168. package/dist/{chunk-52FDK2LC.js → chunk-WQOPLNDH.js} +1 -1
  169. package/dist/{chunk-4GCI2YCZ.js → chunk-X4A5D3PZ.js} +1 -1
  170. package/dist/{chunk-2DID73ML.js → chunk-X7DCL5LT.js} +1 -1
  171. package/dist/{chunk-RVQV6G5M.js → chunk-XDXHSGDL.js} +1 -1
  172. package/dist/{chunk-OX7UVDSU.js → chunk-XKKKMV46.js} +1 -1
  173. package/dist/{chunk-FDXHQZTO.js → chunk-XRVJJG6W.js} +16 -16
  174. package/dist/chunk-XV6XCOTG.js +319 -0
  175. package/dist/{chunk-M3ACZWMR.js → chunk-XYFYQWKW.js} +1 -1
  176. package/dist/{chunk-UWMZ5CSB.js → chunk-XZLM4HLO.js} +1 -1
  177. package/dist/{chunk-FFHH5LOR.js → chunk-YCUEDZDA.js} +1 -1
  178. package/dist/{chunk-XBQDMGUN.js → chunk-YFRI75U4.js} +1 -1
  179. package/dist/{chunk-XMODGI45.js → chunk-YQ63ZFYT.js} +1 -1
  180. package/dist/{chunk-4GOJQKY5.js → chunk-YXIFSIRX.js} +1 -1
  181. package/dist/{chunk-MDRVCBDO.js → chunk-ZBVHPC6W.js} +1 -1
  182. package/dist/{chunk-IQVRP7CT.js → chunk-ZHHTQRWU.js} +1 -1
  183. package/dist/{chunk-Z5SILNH2.js → chunk-ZTZGDZCE.js} +1 -1
  184. package/dist/{chunk-OQU3HLAE.js → chunk-ZVEBXHEY.js} +1 -1
  185. package/dist/cli/commands/app/build.js +1 -1
  186. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  187. package/dist/cli/commands/app/bulk/execute.js +1 -1
  188. package/dist/cli/commands/app/bulk/status.js +1 -1
  189. package/dist/cli/commands/app/config/link.js +1 -1
  190. package/dist/cli/commands/app/config/pull.js +1 -1
  191. package/dist/cli/commands/app/config/use.js +1 -1
  192. package/dist/cli/commands/app/config/validate.js +1 -1
  193. package/dist/cli/commands/app/demo/watcher.js +1 -1
  194. package/dist/cli/commands/app/deploy.js +1 -1
  195. package/dist/cli/commands/app/dev/clean.js +1 -1
  196. package/dist/cli/commands/app/dev.js +1 -1
  197. package/dist/cli/commands/app/env/pull.js +1 -1
  198. package/dist/cli/commands/app/env/show.js +1 -1
  199. package/dist/cli/commands/app/execute.js +1 -1
  200. package/dist/cli/commands/app/function/build.js +1 -1
  201. package/dist/cli/commands/app/function/info.js +1 -1
  202. package/dist/cli/commands/app/function/replay.js +1 -1
  203. package/dist/cli/commands/app/function/run.js +1 -1
  204. package/dist/cli/commands/app/function/schema.js +1 -1
  205. package/dist/cli/commands/app/function/typegen.js +1 -1
  206. package/dist/cli/commands/app/generate/extension.js +1 -1
  207. package/dist/cli/commands/app/graphiql.js +1 -1
  208. package/dist/cli/commands/app/import/channel-config.js +1 -1
  209. package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
  210. package/dist/cli/commands/app/import/dashboard-extensions.js +1 -1
  211. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  212. package/dist/cli/commands/app/import-extensions.js +1 -1
  213. package/dist/cli/commands/app/info.js +1 -1
  214. package/dist/cli/commands/app/init.js +1 -1
  215. package/dist/cli/commands/app/logs.js +1 -1
  216. package/dist/cli/commands/app/release.js +1 -1
  217. package/dist/cli/commands/app/security/check.js +1 -1
  218. package/dist/cli/commands/app/security/clean.js +1 -1
  219. package/dist/cli/commands/app/security/instructions.js +1 -1
  220. package/dist/cli/commands/app/security/record.js +1 -1
  221. package/dist/cli/commands/app/security/review.js +1 -1
  222. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  223. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  224. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  225. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  226. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  227. package/dist/cli/commands/app/versions/list.js +1 -1
  228. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  229. package/dist/cli/commands/auth/login.js +1 -1
  230. package/dist/cli/commands/auth/logout.js +1 -1
  231. package/dist/cli/commands/cache/clear.js +1 -1
  232. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  233. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  234. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  235. package/dist/cli/commands/debug/command-flags.js +1 -1
  236. package/dist/cli/commands/doc/fetch.js +1 -1
  237. package/dist/cli/commands/doc/search.js +1 -1
  238. package/dist/cli/commands/docs/generate.js +1 -1
  239. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  240. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  241. package/dist/cli/commands/help.js +1 -1
  242. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  243. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  244. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  245. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  246. package/dist/cli/commands/notifications/generate.js +1 -1
  247. package/dist/cli/commands/notifications/list.js +1 -1
  248. package/dist/cli/commands/organization/list.js +1 -1
  249. package/dist/cli/commands/search.js +1 -1
  250. package/dist/cli/commands/send-analytics.js +1 -1
  251. package/dist/cli/commands/theme/check.js +1 -1
  252. package/dist/cli/commands/theme/console.js +1 -1
  253. package/dist/cli/commands/theme/delete.js +1 -1
  254. package/dist/cli/commands/theme/dev.js +1 -1
  255. package/dist/cli/commands/theme/duplicate.js +1 -1
  256. package/dist/cli/commands/theme/info.js +1 -1
  257. package/dist/cli/commands/theme/init.js +1 -1
  258. package/dist/cli/commands/theme/language-server.js +1 -1
  259. package/dist/cli/commands/theme/list.js +1 -1
  260. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  261. package/dist/cli/commands/theme/open.js +1 -1
  262. package/dist/cli/commands/theme/package.js +1 -1
  263. package/dist/cli/commands/theme/preview.js +1 -1
  264. package/dist/cli/commands/theme/profile.js +1 -1
  265. package/dist/cli/commands/theme/publish.js +1 -1
  266. package/dist/cli/commands/theme/pull.js +1 -1
  267. package/dist/cli/commands/theme/push.js +1 -1
  268. package/dist/cli/commands/theme/rename.js +1 -1
  269. package/dist/cli/commands/theme/share.js +1 -1
  270. package/dist/cli/commands/upgrade.js +1 -1
  271. package/dist/cli/commands/version.js +1 -1
  272. package/dist/cli/help.js +1 -1
  273. package/dist/{command-json-schema-2UMKY7MY.js → command-json-schema-6EGXCM4B.js} +1 -1
  274. package/dist/command-registry.js +1 -1
  275. package/dist/{conf-store-RI3TL6I4.js → conf-store-E7ELDWBA.js} +1 -1
  276. package/dist/{custom-oclif-loader-IZCKN67O.js → custom-oclif-loader-FKFZJPHF.js} +1 -1
  277. package/dist/{deprecations-IFVUXXDB.js → deprecations-RNGBHZYB.js} +1 -1
  278. package/dist/dist-VHIZZDYK.js +1 -0
  279. package/dist/dist-WXI5YQYP.js +1 -0
  280. package/dist/{environments-CYMEN7NV.js → environments-WZJ6MRTH.js} +1 -1
  281. package/dist/{error-IL6WQMSW.js → error-IFB626JA.js} +1 -1
  282. package/dist/error-handler-OVJYVIOZ.js +1 -0
  283. package/dist/{fs-AINFLJ2E.js → fs-7UOUHJDO.js} +1 -1
  284. package/dist/hooks/did-you-mean.js +1 -1
  285. package/dist/hooks/hydrogen-init.js +1 -1
  286. package/dist/hooks/postrun.js +1 -1
  287. package/dist/hooks/prerun.js +1 -1
  288. package/dist/hooks/public-metadata.js +1 -1
  289. package/dist/hooks/sensitive-metadata.js +1 -1
  290. package/dist/hooks/tunnel-provider.js +1 -1
  291. package/dist/hooks/tunnel-start.js +1 -1
  292. package/dist/index.js +12 -12
  293. package/dist/{is-global-2VLKV46Q.js → is-global-XW3CVHLK.js} +1 -1
  294. package/dist/{json-error-HZB5YIHV.js → json-error-C2U7ZLCG.js} +1 -1
  295. package/dist/{local-KOZETREJ.js → local-KA3IWOZ6.js} +1 -1
  296. package/dist/{metadata-IBPHZB7N.js → metadata-6JI7HF5B.js} +1 -1
  297. package/dist/{node-package-manager-DXSRNEDC.js → node-package-manager-X3QIEMMX.js} +1 -1
  298. package/dist/{notifications-system-XA3EBOGJ.js → notifications-system-OXGLT2R4.js} +1 -1
  299. package/dist/{os-X73O7BAB.js → os-NORIEVMI.js} +1 -1
  300. package/dist/{output-3OYXK3Z5.js → output-K3JTLRJD.js} +1 -1
  301. package/dist/{system-JWYYT4PM.js → system-LTHR2T7L.js} +1 -1
  302. package/dist/tsconfig.tsbuildinfo +1 -1
  303. package/dist/{ui-PCG5D6RZ.js → ui-MYUBVKCK.js} +1 -1
  304. package/dist/upgrade-MFTWBXL3.js +1 -0
  305. package/dist/version-BNGPPAUU.js +1 -0
  306. package/dist/{version-7DGU2KYH.js → version-RCGFWSB4.js} +1 -1
  307. package/dist/{workerd-MQZ3NKJI.js → workerd-ISSXMKIH.js} +1 -1
  308. package/oclif.manifest.json +6 -3
  309. package/package.json +7 -7
  310. package/dist/analytics-Q6QDIDYT.js +0 -1
  311. package/dist/chunk-3C6VLJ5D.js +0 -319
  312. package/dist/chunk-43R5VGKT.js +0 -1
  313. package/dist/chunk-4C2DAX5T.js +0 -1
  314. package/dist/chunk-7RPFJZLP.js +0 -1
  315. package/dist/chunk-DNMXVMJM.js +0 -47
  316. package/dist/chunk-IUP7POIE.js +0 -6
  317. package/dist/chunk-JDR6UVZA.js +0 -8
  318. package/dist/chunk-JOJV5E2K.js +0 -1
  319. package/dist/chunk-LVLAOBJM.js +0 -103
  320. package/dist/chunk-PMHP57MH.js +0 -20
  321. package/dist/chunk-WDFCOZAY.js +0 -16
  322. package/dist/chunk-ZGV3HNEV.js +0 -1
  323. package/dist/dist-4H2B7BMN.js +0 -1
  324. package/dist/dist-QNWOGQN3.js +0 -1
  325. package/dist/error-handler-74HKA23T.js +0 -1
  326. package/dist/upgrade-7U2TUNC4.js +0 -1
  327. package/dist/version-SXQTRBXB.js +0 -1
@@ -1,4 +1,4 @@
1
- import{f as A,g as R,h as j}from"./chunk-4GOJQKY5.js";import{a as T}from"./chunk-7RPFJZLP.js";import{a as S}from"./chunk-FWB3GLMW.js";import{Na as N,b as I,c as w}from"./chunk-3C6VLJ5D.js";import{b as y,c as x}from"./chunk-Q2SZCZE7.js";import{z as m}from"./chunk-CZ22VZDA.js";import{a as d}from"./chunk-BN7ZXAZJ.js";import{qb as b,sb as g,wb as P}from"./chunk-LWCTKI4Z.js";import{b as r}from"./chunk-FZCGRIOM.js";import{c as h}from"./chunk-IWTNUJGY.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();a();import{resolve as u}from"node:path";function v(t,{functionRunnerPath:n,schemaPath:e}){let i=t.configuration;return{function:{handle:i.handle??null,name:t.name,apiVersion:i.api_version??null,directory:u(t.directory),targets:(i.targeting??[]).filter(({target:o})=>!!o).map(o=>({target:o.target,inputQueryPath:o.input_query?u(h(t.directory,o.input_query)):null,export:o.export===""?null:o.export??null})),schemaPath:e?u(e):null,wasmPath:u(h(t.directory,i.build?.path??t.outputRelativePath)),functionRunnerPath:u(n)}}}a();var s=r.string().regex(/^(?:\/|[a-zA-Z]:[\\/]|\\\\)/).describe("An absolute native filesystem path."),C=r.object({target:r.string().min(1),inputQueryPath:s.nullable().describe("Null when no input query is configured."),export:r.string().min(1).nullable().describe("Null when no WebAssembly export is configured.")}).strict(),O=r.object({handle:r.string().nullable().describe("Null when the extension does not configure a handle."),name:r.string(),apiVersion:r.string().nullable().describe("The configured API version, or null when unavailable."),directory:s,targets:r.array(C).describe("All configured targets; empty when none are configured."),schemaPath:s.nullable().describe("Null when a GraphQL schema is unavailable."),wasmPath:s,functionRunnerPath:s}).strict(),l=d({name:"FunctionInfoResult",schema:r.object({function:O}).strict(),definitions:{FunctionInfo:O,FunctionTarget:C}});a();function B(t,n){return{title:`CONFIGURATION
1
+ import{f as A,g as R,h as j}from"./chunk-YXIFSIRX.js";import{a as T}from"./chunk-BU3JQM3W.js";import{a as S}from"./chunk-D4LFWIFE.js";import{Na as N,b as I,c as w}from"./chunk-XV6XCOTG.js";import{b as y,c as x}from"./chunk-5AWELO3D.js";import{z as m}from"./chunk-V654BMS7.js";import{a as d}from"./chunk-BN7ZXAZJ.js";import{qb as b,sb as g,wb as P}from"./chunk-RIG66DIQ.js";import{b as r}from"./chunk-FZCGRIOM.js";import{c as h}from"./chunk-IWTNUJGY.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();a();import{resolve as u}from"node:path";function v(t,{functionRunnerPath:n,schemaPath:e}){let i=t.configuration;return{function:{handle:i.handle??null,name:t.name,apiVersion:i.api_version??null,directory:u(t.directory),targets:(i.targeting??[]).filter(({target:o})=>!!o).map(o=>({target:o.target,inputQueryPath:o.input_query?u(h(t.directory,o.input_query)):null,export:o.export===""?null:o.export??null})),schemaPath:e?u(e):null,wasmPath:u(h(t.directory,i.build?.path??t.outputRelativePath)),functionRunnerPath:u(n)}}}a();var s=r.string().regex(/^(?:\/|[a-zA-Z]:[\\/]|\\\\)/).describe("An absolute native filesystem path."),C=r.object({target:r.string().min(1),inputQueryPath:s.nullable().describe("Null when no input query is configured."),export:r.string().min(1).nullable().describe("Null when no WebAssembly export is configured.")}).strict(),O=r.object({handle:r.string().nullable().describe("Null when the extension does not configure a handle."),name:r.string(),apiVersion:r.string().nullable().describe("The configured API version, or null when unavailable."),directory:s,targets:r.array(C).describe("All configured targets; empty when none are configured."),schemaPath:s.nullable().describe("Null when a GraphQL schema is unavailable."),wasmPath:s,functionRunnerPath:s}).strict(),l=d({name:"FunctionInfoResult",schema:r.object({function:O}).strict(),definitions:{FunctionInfo:O,FunctionTarget:C}});a();function B(t,n){return{title:`CONFIGURATION
2
2
  `,body:{tabularData:[["Handle",t.handle??"N/A"],["Name",n??"N/A"],["API Version",t.api_version??"N/A"]],firstColumnSubdued:!0}}}function E(t){if(Object.keys(t).length===0)return null;let n=[];return Object.entries(t).forEach(([e,i])=>{n.push([g`${b.cyan(e)}`.value,""]),i.inputQueryPath&&n.push([{subdued:" Input Query Path"},{filePath:i.inputQueryPath}]),i.export&&n.push([{subdued:" Export"},i.export])}),{title:`
3
3
  TARGETING
4
4
  `,body:{tabularData:n}}}function G(t,n){return{title:`
@@ -1,4 +1,4 @@
1
- import{a as j}from"./chunk-ZGV3HNEV.js";import{a as D}from"./chunk-FWB3GLMW.js";import{Ba as u,Ca as _,Ma as L}from"./chunk-3C6VLJ5D.js";import{b as $,c as P}from"./chunk-Q2SZCZE7.js";import{A as R,B as A}from"./chunk-CZ22VZDA.js";import{a as S}from"./chunk-BN7ZXAZJ.js";import{h as a}from"./chunk-2VSNFOKD.js";import{Sa as O,ab as v,ta as E,va as N,wb as F}from"./chunk-LWCTKI4Z.js";import{b as s}from"./chunk-FZCGRIOM.js";import{b as X}from"./chunk-YTUUU33R.js";import{c as m,e as w,f,h as T,i as C}from"./chunk-IWTNUJGY.js";import{e as z,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();async function k({remoteApp:t,developerPlatformClient:e}){let n=await e.channelSpecExport(t);if(n.status===404)throw new a("The channel spec export endpoint is not available for this app.","Check that the app and organization are correct.");if(!n.ok){let i=typeof n.body?.reason=="string"?n.body.reason:void 0;if(n.status===426)throw new a(`Failed to fetch the channel spec export: ${i??"This version of the Shopify CLI is no longer supported."}`,"Upgrade the Shopify CLI and try again.");if(n.status===422)return{success:!1,reason:i??`http_${n.status}`};throw n.status===401||n.status===403?new a(`Failed to fetch the channel spec export: authentication failed (status ${n.status}).`,"Run `shopify auth logout` and try again."):new a(`Failed to fetch the channel spec export: the server responded with status ${n.status}.`,"Try again in a moment.")}let{handle:r,filename:p,toml:o,warnings:h}=n.body;if(typeof r!="string"||typeof p!="string"||typeof o!="string")throw new a("Failed to fetch the channel spec export: the response was missing required fields.");return{success:!0,handle:r,filename:p,toml:o,warnings:B(h)}}function B(t){return Array.isArray(t)?t.flatMap(e=>e&&typeof e=="object"&&typeof e.code=="string"&&typeof e.message=="string"?[e]:[]):[]}c();var M=s.object({code:s.string(),message:s.string()}).strict(),d=S({name:"ImportChannelConfigResult",schema:s.object({status:s.literal("success"),handle:s.string().min(1),filename:s.string().min(1),path:s.string().regex(/^(?:\/|[a-zA-Z]:[\\/]|\\\\)/,"The path must be absolute.").describe("Absolute path of the written TOML file."),toml:s.string().describe("Native channel_config TOML content, unchanged from the export."),warnings:s.array(M).describe("Warnings returned with the channel spec export.")}).strict(),definitions:{ChannelSpecExportWarning:M}});var g=m("extensions","channel-config"),he=m(g,_),x="shopify.extension.toml",G=`name = "Channel config"
1
+ import{a as j}from"./chunk-NPB753M3.js";import{a as D}from"./chunk-D4LFWIFE.js";import{Ba as u,Ca as _,Ma as L}from"./chunk-XV6XCOTG.js";import{b as $,c as P}from"./chunk-5AWELO3D.js";import{A as R,B as A}from"./chunk-V654BMS7.js";import{a as S}from"./chunk-BN7ZXAZJ.js";import{h as a}from"./chunk-J7BTC45S.js";import{Sa as O,ab as v,ta as E,va as N,wb as F}from"./chunk-RIG66DIQ.js";import{b as s}from"./chunk-FZCGRIOM.js";import{b as X}from"./chunk-YTUUU33R.js";import{c as m,e as w,f,h as T,i as C}from"./chunk-IWTNUJGY.js";import{e as z,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();async function k({remoteApp:t,developerPlatformClient:e}){let n=await e.channelSpecExport(t);if(n.status===404)throw new a("The channel spec export endpoint is not available for this app.","Check that the app and organization are correct.");if(!n.ok){let i=typeof n.body?.reason=="string"?n.body.reason:void 0;if(n.status===426)throw new a(`Failed to fetch the channel spec export: ${i??"This version of the Shopify CLI is no longer supported."}`,"Upgrade the Shopify CLI and try again.");if(n.status===422)return{success:!1,reason:i??`http_${n.status}`};throw n.status===401||n.status===403?new a(`Failed to fetch the channel spec export: authentication failed (status ${n.status}).`,"Run `shopify auth logout` and try again."):new a(`Failed to fetch the channel spec export: the server responded with status ${n.status}.`,"Try again in a moment.")}let{handle:r,filename:p,toml:o,warnings:h}=n.body;if(typeof r!="string"||typeof p!="string"||typeof o!="string")throw new a("Failed to fetch the channel spec export: the response was missing required fields.");return{success:!0,handle:r,filename:p,toml:o,warnings:B(h)}}function B(t){return Array.isArray(t)?t.flatMap(e=>e&&typeof e=="object"&&typeof e.code=="string"&&typeof e.message=="string"?[e]:[]):[]}c();var M=s.object({code:s.string(),message:s.string()}).strict(),d=S({name:"ImportChannelConfigResult",schema:s.object({status:s.literal("success"),handle:s.string().min(1),filename:s.string().min(1),path:s.string().regex(/^(?:\/|[a-zA-Z]:[\\/]|\\\\)/,"The path must be absolute.").describe("Absolute path of the written TOML file."),toml:s.string().describe("Native channel_config TOML content, unchanged from the export."),warnings:s.array(M).describe("Warnings returned with the channel spec export.")}).strict(),definitions:{ChannelSpecExportWarning:M}});var g=m("extensions","channel-config"),he=m(g,_),x="shopify.extension.toml",G=`name = "Channel config"
2
2
  type = "${u}"
3
3
  handle = "channel-config"
4
4
  `,U=["extensions/*"],q={no_exportable_frozen_record:"This app doesn't have a channel spec that can be exported yet.",multiple_exportable_records:"This app has more than one channel spec, so it can't be exported automatically.",not_allowlisted:"This app isn't part of the channel spec export prototype yet.",contains_no_public_fields:"This app's channel spec has no public channel_config fields.",invalid_public_schema:"This app's channel spec doesn't match the public channel_config schema."};async function H(t){let{app:e,remoteApp:n,developerPlatformClient:r,force:p}=t,o=await k({remoteApp:n,developerPlatformClient:r});if(!o.success){let y=q[o.reason];throw y?new a(y):new a(`The channel spec for this app could not be exported (reason: ${o.reason}).`)}let{extensionDirectory:h,createExtension:i}=Z(e),l=w(h,_,C(o.filename));if(!p&&await O(l))throw new a(`A channel spec already exists at ${f(e.directory,l)}.`,"Re-run with `--force` to replace it.");let I=d.validate({status:"success",handle:o.handle,filename:C(o.filename),path:l,toml:o.toml,warnings:o.warnings.map(({code:y,message:Y})=>({code:y,message:Y}))});return await N(T(l)),i&&await E(m(h,x),G),await E(l,I.toml),{...I,extensionConfigurationPath:i?w(h,x):null}}function Z(t){let e=t.allExtensions.filter(i=>i.type===u);if(e.length>1){let i=e.map(l=>f(t.directory,l.directory)).join(", ");throw new a(`This app has more than one ${u} extension (${i}).`,"Only one is allowed. Remove the extras and try again.")}if(e.length===1)return{extensionDirectory:e[0].directory,createExtension:!1};let n=t.configuration.extension_directories,r=n&&n.length>0?n:U;if(!r.some(i=>v(`${g}/${x}`,`${i}/*.extension.toml`)))throw new a(`Your shopify.app.toml only loads extensions from ${r.join(", ")}, so a new extension at ${g} wouldn't be deployed.`,`Create a ${u} extension in one of those directories with a ${x} like:
@@ -1,4 +1,4 @@
1
- import{h as k}from"./chunk-2VSNFOKD.js";import{Sa as j,la as w,ta as R}from"./chunk-LWCTKI4Z.js";import{a as H,c as f,e as G,g as o}from"./chunk-VKWPEFWQ.js";var ee=f((Tt,X)=>{"use strict";o();var m=class e extends Error{constructor(t,s,r){super("[ParserError] "+t,s,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},E=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},A=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new E(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let s;for(;s===!1||this.nextChar();)s=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new m("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,s){s&&this.next(s),this.stack.push(this.state),this.state=new E(t)}callNow(t,s){return this.call(t,s),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new m("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new m("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new m("Must declare a parseStart method")}};A.END=1114112;A.Error=m;X.exports=A});var re=f((Rt,te)=>{"use strict";o();te.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var y=f((xt,se)=>{"use strict";o();se.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var ne=f((Ht,ie)=>{"use strict";o();var C=y(),K=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${C(2,this.getUTCMonth()+1)}-${C(2,this.getUTCDate())}`,s=`${C(2,this.getUTCHours())}:${C(2,this.getUTCMinutes())}:${C(2,this.getUTCSeconds())}.${C(3,this.getUTCMilliseconds())}`;return`${t}T${s}`}};ie.exports=e=>{let t=new K(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var oe=f((yt,ae)=>{"use strict";o();var he=y(),$e=global.Date,W=class extends $e{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${he(2,this.getUTCMonth()+1)}-${he(2,this.getUTCDate())}`}};ae.exports=e=>{let t=new W(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var ce=f((It,le)=>{"use strict";o();var N=y(),q=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${N(2,this.getUTCHours())}:${N(2,this.getUTCMinutes())}:${N(2,this.getUTCSeconds())}.${N(3,this.getUTCMilliseconds())}`}};le.exports=e=>{let t=new q(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var I=f((exports,module)=>{"use strict";o();module.exports=makeParserClass(ee());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=re(),createDateTimeFloat=ne(),createDate=oe(),createTime=ce(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
1
+ import{h as k}from"./chunk-J7BTC45S.js";import{Sa as j,la as w,ta as R}from"./chunk-RIG66DIQ.js";import{a as H,c as f,e as G,g as o}from"./chunk-VKWPEFWQ.js";var ee=f((Tt,X)=>{"use strict";o();var m=class e extends Error{constructor(t,s,r){super("[ParserError] "+t,s,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},E=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},A=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new E(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let s;for(;s===!1||this.nextChar();)s=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new m("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,s){s&&this.next(s),this.stack.push(this.state),this.state=new E(t)}callNow(t,s){return this.call(t,s),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new m("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new m("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new m("Must declare a parseStart method")}};A.END=1114112;A.Error=m;X.exports=A});var re=f((Rt,te)=>{"use strict";o();te.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var y=f((xt,se)=>{"use strict";o();se.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var ne=f((Ht,ie)=>{"use strict";o();var C=y(),K=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${C(2,this.getUTCMonth()+1)}-${C(2,this.getUTCDate())}`,s=`${C(2,this.getUTCHours())}:${C(2,this.getUTCMinutes())}:${C(2,this.getUTCSeconds())}.${C(3,this.getUTCMilliseconds())}`;return`${t}T${s}`}};ie.exports=e=>{let t=new K(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var oe=f((yt,ae)=>{"use strict";o();var he=y(),$e=global.Date,W=class extends $e{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${he(2,this.getUTCMonth()+1)}-${he(2,this.getUTCDate())}`}};ae.exports=e=>{let t=new W(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var ce=f((It,le)=>{"use strict";o();var N=y(),q=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${N(2,this.getUTCHours())}:${N(2,this.getUTCMinutes())}:${N(2,this.getUTCSeconds())}.${N(3,this.getUTCMilliseconds())}`}};le.exports=e=>{let t=new q(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var I=f((exports,module)=>{"use strict";o();module.exports=makeParserClass(ee());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=re(),createDateTimeFloat=ne(),createDate=oe(),createTime=ce(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
2
2
  `,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return hasOwnProperty.call(e,t)?!0:(t==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(t){try{this.value=global.BigInt.asIntN(64,t)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}var FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){let t=typeof e;if(t==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(r){let i=this.ctx,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(r){return this.state.resultTable?this.state.resultTable.push(r):this.state.resultTable=[r],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(r){return this.returnNow({key:this.state.resultTable,value:r})}parseComment(){do if(this.char===e.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)&&(!isTable(this.ctx[r])||this.ctx[r][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[r]=this.ctx[r]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(r){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,r)||(this.ctx[r]=List()),isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[r])){let i=Table();this.ctx[r].push(i),this.ctx=i}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,r))this.ctx=this.ctx[r]=Table();else{if(isInlineList(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[r]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[r]))this.ctx=this.ctx[r][this.ctx[r].length-1];else if(isTable(this.ctx[r]))this.ctx=this.ctx[r];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(r){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(r){return this.returnNow(r)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let r="\\u00";return this.char<16&&(r+="0"),r+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${r} instead`))}recordMultiEscapeReplacement(r){return this.state.buf+=r,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(r){try{let i=parseInt(r,16);if(i>=SURROGATE_FIRST&&i<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(i))}catch(i){throw this.error(TomlError.wrap(i))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let r=Integer(this.state.buf);if(r.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(r)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(r){if(this.state.resultArr){let i=this.state.resultArr[_contentType],h=tomlType(r);if(i!==h)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${i} and ${h}`))}else this.state.resultArr=InlineList(tomlType(r));return isFloat(r)||isInteger(r)?this.state.resultArr.push(r.valueOf()):this.state.resultArr.push(r),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(r){let i=this.state.resultTable,h=r.key.pop();for(let n of r.key){if(hasKey(i,n)&&(!isTable(i[n])||i[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[n]=i[n]||Table()}if(hasKey(i,h))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(r.value)||isFloat(r.value)?i[h]=r.value.valueOf():i[h]=r.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return t}});var L=f((Ot,ue)=>{"use strict";o();ue.exports=Ke;function Ke(e,t){if(e.pos==null||e.line==null)return e;let s=e.message;if(s+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}:
3
3
  `,t&&t.split){let r=t.split(/\n/),i=String(Math.min(r.length,e.line+3)).length,h=" ";for(;h.length<i;)h+=" ";for(let n=Math.max(0,e.line-1);n<Math.min(r.length,e.line+2);++n){let a=String(n+1);if(a.length<i&&(a=" "+a),e.line===n){s+=a+"> "+r[n]+`
4
4
  `,s+=h+" ";for(let l=0;l<e.col;++l)s+=" ";s+=`^
@@ -1,4 +1,4 @@
1
- import{a as he,b as fe,c as ge,d as _}from"./chunk-HCZG7YJ6.js";import{a as q}from"./chunk-V75WUEFU.js";import{a as pe}from"./chunk-NB4BRW3H.js";import{B as ne,C as S,D as se,F as oe,G as re,H as ce,I as ae,J as le,K as ue,L as de,M as m,O as y,P as k,Q as j,R as w,S as v,T as F,U as C,V as me,W as $,X as ye,Y as T,Z as R,_ as be,a as z,c as Q,d as D,g as X,i as Z,p as ee,t as te,u as ie}from"./chunk-LMQGNECW.js";import{b as K}from"./chunk-ZQDDRIBA.js";import{b as J,c as V}from"./chunk-Q2SZCZE7.js";import{A as M,B as p,C as Y,E as H,W as b,z as P}from"./chunk-CZ22VZDA.js";import{a as U}from"./chunk-BN7ZXAZJ.js";import{na as B,wb as g}from"./chunk-LWCTKI4Z.js";import{b as r}from"./chunk-FZCGRIOM.js";import{b as Ne}from"./chunk-YTUUU33R.js";import{f as d,p as W}from"./chunk-IWTNUJGY.js";import{e as Ge,g as a}from"./chunk-VKWPEFWQ.js";a();a();a();function Se(e,t){if(t==="none")return 0;let i=e.scan.issues.filter(n=>D[n.severity]>=D[t]);return new Set(i.map(n=>n.id)).size}async function ke({includeDirs:e,excludePatterns:t,noGitIgnore:i,...n}){let s=Date.now();return{...await Z(n,{includeDirs:e,excludePatterns:t,noGitIgnore:i}),elapsedMilliseconds:Date.now()-s}}function we({includeDirs:e,excludePatterns:t,noGitIgnore:i,...n}){return X(n,{includeDirs:e,excludePatterns:t,noGitIgnore:i})}var Oe={resolveSelection:oe,execute:ke,listFiles:we,writeArtifacts:ie,canPrompt:b,recordMetadata:pe};async function G(e,t=Oe){let i=await re(e.includeDirs),n=await t.resolveSelection({path:e.directory,config:e.configName,clientId:e.clientId,withoutAppConfig:e.withoutAppConfig,allowPrompts:!e.listFiles&&t.canPrompt(),validateClientIdFlag:!0});if(n.kind==="declined")return{kind:"cancelled"};let{appDirectory:s}=n,o={include_dirs:[...e.includeDirs],excludes:[...e.excludePatterns],no_git_ignore:e.noGitIgnore},c=le(n,e.directory,o);(n.kind==="no-config"?!e.withoutAppConfig:n.appConfigFilePicked===!0)&&e.onSelectionPrompted?.(c);let I=n.kind==="config"?n.appConfigDirectories??[]:[],{scanDirectories:x,requestedScanDirectories:Te}=ce(s,i,I),A={selection:n,resultsKey:se(n),commands:c,scope:o,scanDirectories:x},L={appDirectory:s,scanDirectories:x.map(({directory:u})=>u),requestedScanDirectories:Te,appConfigDirectories:x.filter(({origin:u})=>u==="app_config_directory").map(({directory:u})=>u),appConfigFilePath:n.kind==="config"?n.appConfigFilePath:void 0,clientId:S(n),includeDirs:e.includeDirs,excludePatterns:e.excludePatterns,noGitIgnore:e.noGitIgnore};if(e.listFiles){let u=await t.listFiles(L);return{kind:"listed",...A,...u}}let f=await t.execute(L);await t.recordMetadata({num_security_findings:f.scan.issues.length});let Re=await t.writeArtifacts(s,A.resultsKey,{deterministicFindings:f.deterministicFindings,agentChecks:f.agentChecks});return{kind:"scanned",...A,execution:f,artifacts:Re,blocking:{level:e.blocking,blockedChecks:Se(f,e.blocking)}}}a();a();var ve=r.object({status:r.literal("success"),app:k,scope:w,scanDirectories:r.array(v).describe("The directories that a scan would walk."),files:r.array(r.object({path:y().describe("The absolute path of the file.")}).strict()).describe("The files that a scan would gather, ordered by their paths relative to the app directory, as listed without --json.")}).strict().describe("With --list-files, the files that a scan would gather. Nothing is scanned or written."),h=U({name:"AppSecurityCheckResult",schema:r.union([r.object({status:r.literal("success"),valid:r.boolean().describe("Whether --blocking passed: no finding of the scan has its own severity at or above the level. blocking.blockedCheckCount counts the checks with such findings, and --blocking none always passes. Run review --json for the findings."),app:k,resultsDirectory:y().describe("The absolute path of the results directory that holds the files the scan wrote."),deterministicFindingsPath:y().describe("The absolute path of deterministic-findings.json, which the scan replaced."),agentChecksPath:y().describe("The absolute path of agent-checks.json, which the scan replaced."),scope:w,scanDirectories:r.array(v).describe("The directories that the scan walked."),agentCheckCount:r.number().int().nonnegative().describe("The number of checks in agent-checks.json for a coding agent to investigate."),blocking:F,instructions:j.optional().describe("The coding-agent instructions for this scan, with --print-instructions or when chosen at the prompt. Left out otherwise.")}).strict(),ve,r.object({status:r.literal("cancelled")}).strict().describe("Asked whether to scan without app configuration, the user declined. Nothing was scanned or written.")]).describe("The scan and the files it wrote. With --list-files, the files that a scan would gather."),definitions:{AppSecurityApp:k,AppSecurityScope:w,AppSecurityScanDirectory:v,AppSecurityBlocking:F,AppSecurityInstructions:j,AppSecurityCheckFileList:ve}});a();var Ee={high:"High",medium:"Medium",low:"Low"},N=3,O=8;function Le(e){let t=Ue(e),i=ee(e.scan.issues);return{type:t,options:{headline:We(e,i),body:Be(e),reference:[{subdued:`Engine: ${e.engine.name} ${e.engine.version}`},{subdued:`Ruleset: ${e.engine.ruleset}`},...i.some(n=>n.issues.length>1)&&!e.verbose?[{subdued:"Use --verbose for every occurrence and fix. deterministic-findings.json retains all file and line details."}]:[]],customSections:Ke(e,i)}}}function Ce(e){let{type:t,options:i}=Le(e);if(t==="success"){M(i);return}if(t==="warning"){p(i);return}Y(i)}function Ie(e){return e.scan.scan.coverage_gaps.length>0}function Ue(e){return e.scan.issues.some(t=>t.severity==="high")?"error":e.scan.issues.length>0||Ie(e)?"warning":"success"}function We(e,t){let i=e.scan.issues.length;return t.length<i?`${t.length} security issue ${t.length===1?"group":"groups"} found (${i} occurrences).`:i>0?`${i} security ${i===1?"issue":"issues"} found.`:Ie(e)?"Scan completed with coverage gaps.":"No security issues found."}function Be(e){let t=e.scan,i=[{userInput:t.app.name},{char:"."},`${t.scan.files_scanned} files scanned in ${ze(e.elapsedMilliseconds)}.`],n=t.scan.checks_executed.filter(s=>s.status==="not_applicable").length;return n>0&&i.push({info:`
1
+ import{a as he,b as fe,c as ge,d as _}from"./chunk-WAY723TL.js";import{a as q}from"./chunk-V75WUEFU.js";import{a as pe}from"./chunk-CKVVJ4XO.js";import{B as ne,C as S,D as se,F as oe,G as re,H as ce,I as ae,J as le,K as ue,L as de,M as m,O as y,P as k,Q as j,R as w,S as v,T as F,U as C,V as me,W as $,X as ye,Y as T,Z as R,_ as be,a as z,c as Q,d as D,g as X,i as Z,p as ee,t as te,u as ie}from"./chunk-MNWT2SQO.js";import{b as K}from"./chunk-OLKLHVHA.js";import{b as J,c as V}from"./chunk-5AWELO3D.js";import{A as M,B as p,C as Y,E as H,W as b,z as P}from"./chunk-V654BMS7.js";import{a as U}from"./chunk-BN7ZXAZJ.js";import{na as B,wb as g}from"./chunk-RIG66DIQ.js";import{b as r}from"./chunk-FZCGRIOM.js";import{b as Ne}from"./chunk-YTUUU33R.js";import{f as d,p as W}from"./chunk-IWTNUJGY.js";import{e as Ge,g as a}from"./chunk-VKWPEFWQ.js";a();a();a();function Se(e,t){if(t==="none")return 0;let i=e.scan.issues.filter(n=>D[n.severity]>=D[t]);return new Set(i.map(n=>n.id)).size}async function ke({includeDirs:e,excludePatterns:t,noGitIgnore:i,...n}){let s=Date.now();return{...await Z(n,{includeDirs:e,excludePatterns:t,noGitIgnore:i}),elapsedMilliseconds:Date.now()-s}}function we({includeDirs:e,excludePatterns:t,noGitIgnore:i,...n}){return X(n,{includeDirs:e,excludePatterns:t,noGitIgnore:i})}var Oe={resolveSelection:oe,execute:ke,listFiles:we,writeArtifacts:ie,canPrompt:b,recordMetadata:pe};async function G(e,t=Oe){let i=await re(e.includeDirs),n=await t.resolveSelection({path:e.directory,config:e.configName,clientId:e.clientId,withoutAppConfig:e.withoutAppConfig,allowPrompts:!e.listFiles&&t.canPrompt(),validateClientIdFlag:!0});if(n.kind==="declined")return{kind:"cancelled"};let{appDirectory:s}=n,o={include_dirs:[...e.includeDirs],excludes:[...e.excludePatterns],no_git_ignore:e.noGitIgnore},c=le(n,e.directory,o);(n.kind==="no-config"?!e.withoutAppConfig:n.appConfigFilePicked===!0)&&e.onSelectionPrompted?.(c);let I=n.kind==="config"?n.appConfigDirectories??[]:[],{scanDirectories:x,requestedScanDirectories:Te}=ce(s,i,I),A={selection:n,resultsKey:se(n),commands:c,scope:o,scanDirectories:x},L={appDirectory:s,scanDirectories:x.map(({directory:u})=>u),requestedScanDirectories:Te,appConfigDirectories:x.filter(({origin:u})=>u==="app_config_directory").map(({directory:u})=>u),appConfigFilePath:n.kind==="config"?n.appConfigFilePath:void 0,clientId:S(n),includeDirs:e.includeDirs,excludePatterns:e.excludePatterns,noGitIgnore:e.noGitIgnore};if(e.listFiles){let u=await t.listFiles(L);return{kind:"listed",...A,...u}}let f=await t.execute(L);await t.recordMetadata({num_security_findings:f.scan.issues.length});let Re=await t.writeArtifacts(s,A.resultsKey,{deterministicFindings:f.deterministicFindings,agentChecks:f.agentChecks});return{kind:"scanned",...A,execution:f,artifacts:Re,blocking:{level:e.blocking,blockedChecks:Se(f,e.blocking)}}}a();a();var ve=r.object({status:r.literal("success"),app:k,scope:w,scanDirectories:r.array(v).describe("The directories that a scan would walk."),files:r.array(r.object({path:y().describe("The absolute path of the file.")}).strict()).describe("The files that a scan would gather, ordered by their paths relative to the app directory, as listed without --json.")}).strict().describe("With --list-files, the files that a scan would gather. Nothing is scanned or written."),h=U({name:"AppSecurityCheckResult",schema:r.union([r.object({status:r.literal("success"),valid:r.boolean().describe("Whether --blocking passed: no finding of the scan has its own severity at or above the level. blocking.blockedCheckCount counts the checks with such findings, and --blocking none always passes. Run review --json for the findings."),app:k,resultsDirectory:y().describe("The absolute path of the results directory that holds the files the scan wrote."),deterministicFindingsPath:y().describe("The absolute path of deterministic-findings.json, which the scan replaced."),agentChecksPath:y().describe("The absolute path of agent-checks.json, which the scan replaced."),scope:w,scanDirectories:r.array(v).describe("The directories that the scan walked."),agentCheckCount:r.number().int().nonnegative().describe("The number of checks in agent-checks.json for a coding agent to investigate."),blocking:F,instructions:j.optional().describe("The coding-agent instructions for this scan, with --print-instructions or when chosen at the prompt. Left out otherwise.")}).strict(),ve,r.object({status:r.literal("cancelled")}).strict().describe("Asked whether to scan without app configuration, the user declined. Nothing was scanned or written.")]).describe("The scan and the files it wrote. With --list-files, the files that a scan would gather."),definitions:{AppSecurityApp:k,AppSecurityScope:w,AppSecurityScanDirectory:v,AppSecurityBlocking:F,AppSecurityInstructions:j,AppSecurityCheckFileList:ve}});a();var Ee={high:"High",medium:"Medium",low:"Low"},N=3,O=8;function Le(e){let t=Ue(e),i=ee(e.scan.issues);return{type:t,options:{headline:We(e,i),body:Be(e),reference:[{subdued:`Engine: ${e.engine.name} ${e.engine.version}`},{subdued:`Ruleset: ${e.engine.ruleset}`},...i.some(n=>n.issues.length>1)&&!e.verbose?[{subdued:"Use --verbose for every occurrence and fix. deterministic-findings.json retains all file and line details."}]:[]],customSections:Ke(e,i)}}}function Ce(e){let{type:t,options:i}=Le(e);if(t==="success"){M(i);return}if(t==="warning"){p(i);return}Y(i)}function Ie(e){return e.scan.scan.coverage_gaps.length>0}function Ue(e){return e.scan.issues.some(t=>t.severity==="high")?"error":e.scan.issues.length>0||Ie(e)?"warning":"success"}function We(e,t){let i=e.scan.issues.length;return t.length<i?`${t.length} security issue ${t.length===1?"group":"groups"} found (${i} occurrences).`:i>0?`${i} security ${i===1?"issue":"issues"} found.`:Ie(e)?"Scan completed with coverage gaps.":"No security issues found."}function Be(e){let t=e.scan,i=[{userInput:t.app.name},{char:"."},`${t.scan.files_scanned} files scanned in ${ze(e.elapsedMilliseconds)}.`],n=t.scan.checks_executed.filter(s=>s.status==="not_applicable").length;return n>0&&i.push({info:`
2
2
  ${n} check${n===1?"":"s"} not applicable.`}),i.push({info:`
3
3
  ${e.agentCheckCount} check${e.agentCheckCount===1?"":"s"} ready for your coding agent.`}),i}function Me(e){return[["Have your coding agent run the agent checks"],["Record the agent results with",{command:m(e.commands.record)}],["Review the results with",{command:m(e.commands.review)}]]}function Ye(e){let t=S(e)??"not linked";return e.kind==="config"&&e.clientIdOverride?`${t} (from --client-id)`:t}function He(e){let{selection:t}=e;return{title:"Selection",body:{tabularData:[["App directory",t.appDirectory],["Config file",ne(t)??"none"],["Client ID",Ye(t)],["Scan directories",e.scanDirectories.map(({directory:i})=>d(t.appDirectory,i)||".").join(", ")]],firstColumnSubdued:!0}}}function Ke(e,t){let i=[He(e)];for(let s of["high","medium","low"]){let o=t.filter(c=>c.severity===s);o.length!==0&&i.push({title:Ee[s],body:{list:{items:o.flatMap(c=>[Ve(c),...e.verbose?c.issues.map(Je):[]])}}})}if(e.scan.scan.coverage_gaps.length>0){let s=e.scan.scan.coverage_gaps,o=s.slice(0,O).map(c=>c.message);s.length>O&&o.push({info:`${s.length-O} more coverage gaps`}),i.push({title:"Coverage gaps",body:{list:{items:o}}})}let{appDirectory:n}=e.selection;return i.push({title:"Artifacts",body:{list:{items:[["Deterministic findings:",{filePath:d(n,e.deterministicFindingsPath)}],["Agent security check instructions:",{filePath:d(n,e.agentChecksPath)}]]}}}),i.push({title:"Next steps",body:{list:{items:Me(e),ordered:!0}}}),e.verbose&&i.push({title:"Scan details",body:{tabularData:[["Framework",e.scan.detection.framework],["Surface",e.scan.detection.surface],["Languages",e.scan.detection.languages.map(s=>`${s.name} (${s.support})`).join(", ")||"none"],["Capabilities",qe(e.scan.capabilities)],["Rules run",String(e.scan.scan.rules_run)],["Not run",String(e.scan.scan.rules_skipped)]],firstColumnSubdued:!0}}),i}function Je(e){let t=e.location.line?`${e.location.file}:${e.location.line}`:e.location.file,i=[{bold:e.title},xe(e.id),{filePath:t}];return i.push({subdued:e.message},{subdued:`Fix: ${e.fix.description}`}),e.fix.guide&&(e.fix.guide.startsWith("https://")||e.fix.guide.startsWith("http://")?i.push({link:{label:"Guide",url:e.fix.guide}}):i.push({subdued:`Guide: ${e.fix.guide}`})),e.snippet&&i.push({subdued:`Code: ${e.snippet}`}),i}function Ve(e){let t=e.issues[0],i=e.issues.length,n=e.files.length,s=e.files.slice(0,N).map(o=>{let c=e.issues.find(I=>I.location.file===o);return{filePath:c.location.line?`${o}:${c.location.line}`:o}});return[{bold:t.title},xe(t.id),`${i} ${i===1?"occurrence":"occurrences"} across ${n} ${n===1?"file":"files"}`,...s,...n>N?[{subdued:`+${n-N} more files`}]:[]]}function xe(e){let t=Q(e);return t?{link:{label:e,url:t}}:{subdued:e}}function qe(e){let t=Object.entries(e).filter(([,i])=>i).map(([i])=>i);return t.length>0?t.join(", "):"none detected"}function ze(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}var Qe={canPrompt:b,selectInstructionsDestination:e=>H(e)};function Xe(e,t){return{message:`${e} recommended agent ${e===1?"check":"checks"} available to complete your scan. How do you want to pass that prompt to your agent?`,choices:t==="json"?[{label:"Include instructions in the JSON output and copy them to the clipboard",value:"copy"},{label:"Include instructions in the JSON output",value:"print"},{label:"Nothing",value:"nothing"}]:[{label:"Copy instructions to the clipboard",value:"copy"},{label:"Print instructions to the terminal",value:"print"},{label:"Nothing",value:"nothing"}],defaultValue:"copy"}}function Pe(e){P({headline:"To skip these prompts next time, run:",body:[{command:m(e.scan)}]})}async function De(e,t,i,n=Qe){if(e.kind==="cancelled"){if(i==="json")g(h.encode({status:"cancelled"}));else{let{headline:s,nextStep:o}=ae(t.directory);P({headline:s,body:o})}return}if(e.kind==="listed"){await Ae(e),i==="json"?g(h.encode(it(e))):e.paths.length>0&&g(e.paths.join(`
4
4
  `));return}await Ae(e.execution),i==="json"?await et(e,t,n):await Ze(e,t,n),e.blocking.blockedChecks>0&&(process.exitCode=1)}async function Ze(e,t,i){Ce(nt(e,t.verbose));let n=await Fe(e,t,"text",i);if(n==="nothing")return;let s=_e(e);n==="print"?_(s,{copy:!1}):await je(s,"text")&&_(s,{copy:!0})}async function et(e,t,i){let n=await Fe(e,t,"json",i),s=n==="nothing"?void 0:_e(e),o=s!==void 0&&n==="copy"&&await je(s,"json");g(h.encode(tt(e,s===void 0?void 0:ye(s,{copy:o}))))}async function je(e,t){try{return await ge(e,{copy:!0}),!0}catch(i){if(!(i instanceof he))throw i;return p({headline:i.message,body:t==="json"?"The result still includes them.":["Run the check again with",{command:"--print-instructions"},"to print them."]}),!1}}async function Fe(e,t,i,n){return t.skipInstructions?"nothing":t.printInstructions?"print":n.canPrompt()?n.selectInstructionsDestination(Xe(e.execution.agentChecks.checks.length,i)):"nothing"}function _e(e){return fe({appDirectory:e.selection.appDirectory,resultsKey:e.resultsKey,commands:e.commands,scanScope:e.scope})}function tt(e,t){let{appDirectory:i}=e.selection,{resultsDirectory:n}=te(i,e.resultsKey);return{status:"success",valid:e.blocking.blockedChecks===0,app:$(e.selection),resultsDirectory:C(n),deterministicFindingsPath:C(e.artifacts.deterministicFindingsPath),agentChecksPath:C(e.artifacts.agentChecksPath),scope:T(e.scope),scanDirectories:e.scanDirectories.map(s=>R(i,s)),agentCheckCount:e.execution.agentChecks.checks.length,blocking:be(e.blocking),...t===void 0?{}:{instructions:t}}}function it(e){let{appDirectory:t}=e.selection;return{status:"success",app:$(e.selection),scope:T(e.scope),scanDirectories:e.scanDirectories.map(i=>R(t,i)),files:e.paths.map(i=>({path:me(t,i)}))}}function nt(e,t){let{execution:i,artifacts:n}=e;return{scan:i.scan,selection:e.selection,scanDirectories:e.scanDirectories,engine:i.engine,verbose:t,elapsedMilliseconds:i.elapsedMilliseconds,commands:e.commands,deterministicFindingsPath:n.deterministicFindingsPath,agentChecksPath:n.agentChecksPath,agentCheckCount:i.agentChecks.checks.length}}function st(e){return e.replace(/[?*()[\]{}!#\\]/g,"\\$&")}async function Ae(e){if(e.ignoredScanDirectories.length===0&&e.otherAppDirectories.length===0)return;let t=await B(W()),i=n=>d(t,n)||".";for(let n of e.ignoredScanDirectories)p({headline:`${i(n)} is ignored by Git, so only the files Git tracks in it are scanned.`,body:["Use",{command:"--no-git-ignore"},"to scan everything in it."]});for(let n of e.otherAppDirectories){let s=i(n);p({headline:`${s} holds another app's configuration, so its files are scanned as part of this app.`,body:["Use",{command:`--exclude ${de(st(s),ue())}`},"to leave it out."]})}}var l=Ge(Ne(),1);var E=class e extends K{static summary="Check an app for Shopify-specific security issues and write deterministic-findings.json and agent-checks.json.";static descriptionWithMarkdown="Runs an app security check locally and writes `deterministic-findings.json` and `agent-checks.json` to the results directory, `.shopify/app-security/<results key>/`. The results key is `--client-id` when you pass it, and otherwise the name of the app configuration file without `.toml`; the other `app security` commands take the same selection flags and find the same directory. Every run replaces both files, so it's always safe to run the check again.\n\n`deterministic-findings.json` holds the deterministic scan results. `agent-checks.json` holds the checks for your coding agent to investigate; the agent's results are recorded with `shopify app security record`. Use `--config` to select a specific app configuration when the project has multiple `shopify.app*.toml` files; the check inspects only that configuration. Use `--client-id` to replace the configuration's client ID for this run. `--client-id` is checked against your Shopify account before anything is scanned, so it needs you to be logged in. When no app configuration exists, use `--without-app-config --client-id <client-id>` to scan `--path` anyway with config checks skipped; in an interactive terminal the command offers to do this.\n\nThe check scans the app directory and each `--include-dir`. Git ignore rules apply by default: a file or directory that Git ignores is skipped, using the rules of the repository that contains it, while files that Git tracks are always scanned. Use `--no-git-ignore` to turn Git ignore rules off for every scanned directory. When the check uses Git, it requires Git 2.38.0 or later.\n\nUse `--exclude` to skip more paths. Each value is a glob that is matched against the path relative to the working directory, so a path above it starts with `../`, and a name at any depth needs `**/`, for example `--exclude '**/generated'`. Repeat the flag to add globs. An exclusion can't remove the selected app configuration file. Quote each value so your shell doesn't expand `*`. The coding-agent instructions this check offers repeat the globs. Other `app security` commands don't take `--exclude` or `--no-git-ignore`, so pass the same flags each time you run the check.\n\nUse `--list-files` to check the scope before scanning: it prints the files the check would gather, one path per line and relative to the app directory, and then stops. It writes no results and never prompts. `--client-id` is still checked, but doesn't change the list. With `--json`, the result lists the files with absolute paths.\n\nIn interactive terminals, the command offers to copy the coding-agent instructions, print them, or choose nothing; copying is the default. In CI and other non-interactive environments, instructions aren't offered unless you pass `--print-instructions`, which prints them. You can also run `shopify app security instructions` to print, copy, or write them later. With `--json`, the command offers to include the instructions in the result, with or without copying them, and `--print-instructions` includes them.\n\nWith `--json`, the result describes the scan and the files it wrote, and whether `--blocking` passed, but not the findings: run `shopify app security review --json` for those.\n\nReports the number of findings to Shopify as usage telemetry, but not finding details. See [usage reporting](https://shopify.dev/docs/api/shopify-cli#usage-reporting) for details.";static get jsonOutputSchema(){return h}static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --include-dir ../backend","<%= config.bin %> <%= command.id %> --path extensions --config production --include-dir .","<%= config.bin %> <%= command.id %> --without-app-config --client-id <client-id>",'<%= config.bin %> <%= command.id %> --path app --include-dir . --exclude marketing --exclude "**/generated"',"<%= config.bin %> <%= command.id %> --no-git-ignore --exclude local-data","<%= config.bin %> <%= command.id %> --include-dir ../backend --list-files"];static flags={...J,...z,"include-dir":l.Flags.string({description:"Also scan this directory, relative to the working directory. Repeat the flag to add directories. Use it for code that lives outside the app directory, such as a backend or a shared library.",multiple:!0}),exclude:l.Flags.string({description:"Skip paths that match this glob, relative to the working directory. Repeat the flag to add globs. The selected app configuration file can't be excluded.",multiple:!0}),"no-git-ignore":l.Flags.boolean({description:"Turn off Git ignore rules for every scanned directory, so files that Git ignores are scanned too. Files that Git tracks are always scanned.",env:"SHOPIFY_FLAG_NO_GIT_IGNORE"}),"list-files":l.Flags.boolean({description:"Print the files the check would gather, one path per line, and stop. Nothing is scanned, no results are written, and nothing is prompted for. With --json, the result lists them with absolute paths.",env:"SHOPIFY_FLAG_LIST_FILES",exclusive:["print-instructions","skip-instructions","blocking"]}),...q,"print-instructions":l.Flags.boolean({description:"Print coding-agent instructions without prompting for how to deliver them. With --json, the instructions are included in the result.",default:!1,exclusive:["skip-instructions"],env:"SHOPIFY_FLAG_APP_SECURITY_PRINT_INSTRUCTIONS"}),yes:l.Flags.boolean({description:"Print coding-agent instructions without prompting.",hidden:!0,deprecated:{to:"--print-instructions"},exclusive:["skip-instructions","list-files"],env:"SHOPIFY_FLAG_YES"}),"skip-instructions":l.Flags.boolean({description:"Don't offer the coding-agent instructions after the scan. Use it when you want only the deterministic scan results.",default:!1,exclusive:["print-instructions"],env:"SHOPIFY_FLAG_APP_SECURITY_SKIP_INSTRUCTIONS"}),...V};async run(){let{flags:t}=await this.parse(e),i=await G({directory:t.path,configName:t.config,clientId:t["client-id"],withoutAppConfig:!!t["without-app-config"],blocking:t.blocking,includeDirs:t["include-dir"]??[],excludePatterns:t.exclude??[],noGitIgnore:!!t["no-git-ignore"],listFiles:!!t["list-files"],onSelectionPrompted:Pe});await De(i,{directory:t.path,verbose:!!t.verbose,printInstructions:!!(t["print-instructions"]||t.yes),skipInstructions:t["skip-instructions"]},t.json?"json":"text")}};export{E as a};
@@ -0,0 +1,8 @@
1
+ import{c as ae}from"./chunk-EH22T4FI.js";import{b as P}from"./chunk-GHU6YEXH.js";import{a as fe}from"./chunk-YFRI75U4.js";import{a as ue}from"./chunk-NPB753M3.js";import{a as ie}from"./chunk-D4LFWIFE.js";import{a as re}from"./chunk-VXD26GIG.js";import{L as pe,Ma as me,N as de,d as ce,e as le}from"./chunk-XV6XCOTG.js";import{t as k,v as oe,w as se}from"./chunk-WFOU5M4H.js";import{a as F}from"./chunk-ZHHTQRWU.js";import{C as B,p as O,x as W,y as S}from"./chunk-2M535QQJ.js";import{b as te,c as ne,f as A}from"./chunk-5AWELO3D.js";import{A as H,B as z,E as X,G as K,I as R,K as Q}from"./chunk-V654BMS7.js";import{e as b}from"./chunk-335BUVBP.js";import{a as G}from"./chunk-BN7ZXAZJ.js";import{h as u}from"./chunk-J7BTC45S.js";import{Na as V,Sa as x,Ta as Y,Va as J,X as h,_ as q,ja as w,pa as U,rb as T,va as v,wb as ee,xa as E}from"./chunk-RIG66DIQ.js";import{b as f}from"./chunk-FZCGRIOM.js";import{f as Z}from"./chunk-GSGCSBRN.js";import{b as Re}from"./chunk-YTUUU33R.js";import{c as d,e as N,g as D,m as L,p as $}from"./chunk-IWTNUJGY.js";import{e as Se,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();async function he(e,t,r,n={}){let{templates:a,groupOrder:i}=await e.templateSpecifications(t,n);return{templates:a.filter(o=>r.includes(o.identifier)||r.includes(o.type)),groupOrder:i}}p();p();async function ye(e,t){let r=e?.path??"",n=d(t,r);if(!await x(n))throw new u(`
2
+ The extension is not available for ${e?.value}`);return n}async function xe({name:e,app:t}){let r=q(e),n=d(t.directory,se.extensions.directoryName,r);if(await x(n))throw new u(`
3
+ A directory with this name (${r}) already exists.
4
+ Choose a new name for your extension.`);return await v(n),await U(d(n,k.lockFile)),n}var ge=["vanilla-js","preact","react","typescript","typescript-react","rust","wasm","liquid","config-only"];function C(e){switch(e){case"vanilla-js":case"preact":case"react":case"typescript":case"typescript-react":return"javascript";case"rust":case"wasm":return e;case void 0:case"liquid":case"config-only":return}}async function we(e){let t=e.extensionChoices.name,r=e.extensionChoices.flavor,n=e.extensionTemplate.supportedFlavors.find(o=>o.value===r),a=await xe({app:e.app,name:t}),i=e.cloneUrl??e.extensionTemplate.url,s={directory:a,url:i,app:e.app,project:e.project,type:e.extensionTemplate.type,name:t,extensionFlavor:n,onGetTemplateRepository:e.onGetTemplateRepository??(async(o,l)=>{await ae({repoUrl:o,destination:l,shallow:!0})})};return await Ae(s),{directory:L(a),extensionTemplate:e.extensionTemplate}}async function Ae(e){try{switch(e.type){case"theme":await Me(e);break;case"function":await je(e);break;default:await Ge(e);break}let t=d(e.directory,k.lockFile);await E(t)}catch(t){throw await Ce(e.directory),e.project.packageManager==="pnpm"&&Ie(t)?new u("Your extension couldn't be generated because pnpm blocked the build scripts of some of its dependencies.",null,[["Run",{command:"pnpm approve-builds"},"in your app directory to approve the build scripts."],["Run",{command:T(e.project.packageManager,"shopify app generate extension")},"again."]]):t}}async function Ce(e){try{await E(e,{maxRetries:10,retryDelay:100})}catch{z({headline:["Couldn't remove",{filePath:e},{char:"."}],body:"Delete this directory manually before generating an extension with the same name."})}}function Ie(e){return e instanceof Error&&e.message.includes("ERR_PNPM_IGNORED_BUILDS")}async function Me({directory:e,url:t,type:r,name:n,extensionFlavor:a,onGetTemplateRepository:i}){return w(async s=>{let o=await I(t,a,s,i);await P(o,e,{name:n,type:r,uid:b(h(n))})})}async function je({directory:e,url:t,app:r,project:n,name:a,extensionFlavor:i,onGetTemplateRepository:s}){let o=C(i?.value),l=[];l.push({title:"Generating function extension",task:async()=>{if(await w(async c=>{let m=await I(t,i,c,s);await P(m,e,{name:a,handle:h(a),flavor:i?.value,uid:b(h(a))})}),o==="javascript"){let c=ve(i?.value??"rust");await Ee(e,c,"!(*.graphql)")}}}),o==="javascript"&&l.push({title:"Installing additional dependencies",task:async()=>{n.usesWorkspaces&&await O({packageManager:n.packageManager,directory:n.directory});let c=Ne(o);await S(c,{packageManager:n.packageManager,type:"prod",directory:n.usesWorkspaces?e:n.directory})}}),o==="javascript"&&l.push({title:"Building GraphQL types",task:async()=>{let c=re();try{await le({directory:e,isJavaScript:!0},{...c,app:r})}finally{c.stdout!==process.stdout&&c.stdout.end(),c.stderr!==process.stderr&&c.stderr.end()}}}),await R(l)}async function Ge({directory:e,url:t,app:r,project:n,name:a,extensionFlavor:i,onGetTemplateRepository:s}){let o=C(i?.value),l=[{title:"Generating extension",task:async()=>{let c=ve(i?.value??"vanilla-js");await w(async m=>{let y=await I(t,i,m,s);await P(y,e,{srcFileExtension:c,name:a,handle:h(a),flavor:i?.value??"",uid:b(h(a))})}),o==="javascript"&&await Ee(e,c)}},{title:"Installing dependencies",task:async()=>{let c=n.packageManager;if(n.usesWorkspaces)C(i?.value)==="javascript"&&await O({packageManager:c,directory:n.directory});else{await De(n.directory,i?.value);let m=d(e,"package.json"),y=await Le(m);await S(y,{packageManager:c,type:"prod",directory:n.directory}),await E(m)}}}];l.push({title:"Update shared type definition",task:async()=>{await de(r)}}),await R(l)}function ve(e){return{"vanilla-js":"js",preact:"jsx",react:"jsx",typescript:"ts","typescript-react":"tsx",rust:"rs",wasm:"wasm",liquid:"liquid","config-only":""}[e]??"js"}function Ne(e){let t=[];return e==="javascript"&&t.push({name:"@shopify/shopify_function",version:`~${ce}.0.0`}),t}async function Ee(e,t,r="*"){let n=await J(d(e,"src",r)),a=[];for(let i of n)a.push(V(i,`${i}.${t}`));await Promise.all(a)}async function De(e,t){t==="typescript-react"&&await B(e,{"@types/react":oe.reactTypes})}async function Le(e){if(!await x(e))return[];let t=await W(e);return Object.entries(t?.dependencies??{}).map(([r,n])=>({name:r,version:n}))}async function I(e,t,r,n){let a=d(r,"download");return await v(a),await n(e,a),ye(t,a)}p();function $e(e,t=[]){let r=[...e.map(a=>({label:a.name,value:a.identifier,group:a.group||"Other",sortPriority:a.sortPriority??Number.MAX_SAFE_INTEGER})),...t.map(a=>({label:`${a.name} (limit reached)`,value:a.identifier,group:a.group||"Other",disabled:!0,sortPriority:a.sortPriority??Number.MAX_SAFE_INTEGER}))],n=(a,i)=>a.sortPriority===i.sortPriority?a.label.localeCompare(i.label):a.sortPriority-i.sortPriority;return r.sort(n)}var qe=async e=>{let t=e.extensionTemplates,r=e.templateType,n=e.extensionFlavor;if(!r){if(n&&(t=t.filter(l=>l.supportedFlavors.map(c=>c.value).includes(n))),t.length===0)throw new u("You have reached the limit for the number of extensions you can create.");r=await K({message:"Type of extension?",choices:$e(t,e.unavailableExtensions),groupOrder:e.groupOrder})}let a=t.find(l=>l.identifier===r),i=e.name||await be(e.directory,a.defaultName),s=e.extensionFlavor??await Ue(a);return{extensionTemplate:a,extensionContent:{name:i,flavor:s}}};async function be(e,t,r=1){let n=t.includes(" ")?" ":"-",a=r<=1?t:`${t}${n}${r}`,i=d(e,h(a));return Y(i)?be(e,t,r+1):Q({message:"Name your extension:",defaultValue:a})}async function Ue(e){if(e.supportedFlavors.length!==0)return e.supportedFlavors.length===1&&e.supportedFlavors[0]?e.supportedFlavors[0].value:X({message:"What would you like to work in?",choices:e.supportedFlavors.map(t=>({label:t.name,value:t.value})),defaultValue:"react"})}var Te=qe;async function Ve(e){let{app:t,developerPlatformClient:r,remoteApp:n,specifications:a,template:i}=e,s=a.map(Oe=>Oe.identifier),{templates:o,groupOrder:l}=await he(r,n,s,{requestedTemplate:i}),c=await Ye(o,l,a,t,e),m=await Te(c);await We(m,i);let y=Be(m,t,e,r),j=await we(y);return{status:"success",extension:{directory:j.directory,extensionTemplate:j.extensionTemplate,name:m.extensionContent.name,flavor:m.extensionContent.flavor},packageManager:e.project.packageManager}}async function Ye(e,t,r,n,a){let i=await ze(a.template,n,e,r);He(i?[i]:e,a.flavor);let{validTemplates:s,templatesOverlimit:o}=Je(e,r,n);return{templateType:i?.identifier,name:a.name,extensionFlavor:a.flavor,directory:d(a.directory,"extensions"),app:n,extensionTemplates:s??[],unavailableExtensions:o??[],reset:a.reset,groupOrder:t}}function Je(e,t,r){return fe(e,a=>!Pe(r,t,a)?"validTemplates":"templatesOverlimit")}function Pe(e,t,r){let n=r.type,a=t.find(s=>s.identifier===n||s.externalIdentifier===n);return e.extensionsForType({identifier:n,externalIdentifier:n}).length>=(a?.registrationLimit??1)}async function We(e,t){let{extensionContent:r}=e;return F.addPublicMetadata(()=>({cmd_scaffold_template_flavor:r.flavor,cmd_scaffold_type:e.extensionTemplate.identifier,cmd_scaffold_used_prompts_for_type:!t}))}function Be(e,t,r,n){return{app:t,project:r.project,cloneUrl:r.cloneUrl,extensionChoices:e.extensionContent,extensionTemplate:e.extensionTemplate,developerPlatformClient:n}}function He(e,t){if(t===void 0)return;let r=[...new Set(e.flatMap(n=>n.supportedFlavors.map(a=>a.value)))];if(!r.includes(t))throw new u("Invalid extension flavor",`Expected flavor to be one of the following: ${r.join(", ")}.`)}async function ze(e,t,r,n){if(!e)return;let a=r.find(i=>i.identifier===e);if(!a){let i=await Z(),s=r.map(l=>l.identifier),o=i?"You might need to enable some flags on your Organization or App":void 0;throw new u(`Unknown extension type: ${e}.
5
+ The following extension types are supported: ${s.join(", ")}`,o)}if(Pe(t,n,a))throw new u(`Invalid extension type: ${e}`,`You have reached the limit of extension(s) of type ${a.type} per app`);return a}var ke=Ve;p();var Fe=f.object({name:f.string().min(1).describe("The name selected for the generated extension."),type:f.string().min(1).describe("The extension type, such as function, theme, or ui_extension."),template:f.string().min(1).describe("The identifier of the selected extension template."),flavor:f.string().nullable().describe("The selected template flavor, or null when the template has no flavors."),directory:f.string().refine(D,"Expected an absolute filesystem path.").describe("The absolute native filesystem path of the generated extension directory.")}).strict(),_=G({name:"AppGenerateExtensionResult",schema:f.object({status:f.literal("success"),extension:Fe}).strict(),definitions:{GeneratedExtension:Fe}});p();function _e(e,t=!1){let{extension:r,packageManager:n}=e;if(t){ee(_.encode({status:e.status,extension:{name:r.name,type:r.extensionTemplate.type,template:r.extensionTemplate.identifier,flavor:r.flavor??null,directory:N($(),r.directory)}}));return}H(Xe(r.extensionTemplate,r.directory,n))}function Xe(e,t,r){let n={headline:["Your extension was created in",{filePath:t},{char:"."}],nextSteps:[],reference:[]};return e.type!=="function"&&n.nextSteps.push(["To preview this extension along with the rest of the project, run",{command:T(r,"shopify app dev")}]),e.supportLinks[0]&&n.reference.push(["For more details, see the",{link:{label:"docs",url:e.supportLinks[0]}}]),n}var g=Se(Re(),1);var M=class e extends ue{static summary="Generate a new app Extension.";static descriptionWithMarkdown=`Generates a new [app extension](https://shopify.dev/docs/apps/build/app-extensions). For a list of app extensions that you can generate using this command, refer to [Supported extensions](https://shopify.dev/docs/apps/build/app-extensions/list-of-app-extensions).
6
+
7
+ Each new app extension is created in a folder under \`extensions/\`. To learn more about the extensions file structure, refer to [App structure](https://shopify.dev/docs/apps/build/cli-for-apps/app-structure) and the documentation for your extension.
8
+ `;static get jsonOutputSchema(){return _}static description=this.descriptionForHelp();static flags={...te,...ie,...ne,template:A(g.Flags.string({char:"t",hidden:!1,description:"Extension template",env:"SHOPIFY_FLAG_EXTENSION_TEMPLATE"})),name:A(g.Flags.string({char:"n",hidden:!1,description:"name of your Extension",env:"SHOPIFY_FLAG_NAME"})),"clone-url":g.Flags.string({hidden:!0,char:"u",description:"The Git URL to clone the function extensions templates from. Defaults to: https://github.com/Shopify/function-examples",env:"SHOPIFY_FLAG_CLONE_URL"}),flavor:g.Flags.string({hidden:!1,description:"Choose a starting template for your extension, where applicable. Supported flavors depend on the selected extension template. Required if non interactive when the selected extension template supports multiple flavors.",options:[...ge],env:"SHOPIFY_FLAG_FLAVOR"})};async run(){let{flags:t}=await this.parse(e);await F.addPublicMetadata(()=>({cmd_scaffold_required_auth:!0,cmd_scaffold_template_custom:t["clone-url"]!==void 0,cmd_scaffold_type_owner:"@shopify/app"})),await pe(t.path);let{app:r,project:n,specifications:a,remoteApp:i,developerPlatformClient:s}=await me({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o=await ke({directory:t.path,reset:t.reset,name:t.name,cloneUrl:t["clone-url"],template:t.template,flavor:t.flavor,app:r,project:n,specifications:a,remoteApp:i,developerPlatformClient:s});return _e(o,t.json),{app:r}}};export{M as a};
@@ -1 +1 @@
1
- import{a as v,c as w,d as O}from"./chunk-2CMEKSI7.js";import{f as y,g as P,h as b}from"./chunk-4GOJQKY5.js";import{a as F}from"./chunk-7RPFJZLP.js";import{a as h}from"./chunk-FWB3GLMW.js";import{Na as x}from"./chunk-3C6VLJ5D.js";import{b as m,c as d}from"./chunk-Q2SZCZE7.js";import{G as g,W as l}from"./chunk-CZ22VZDA.js";import{Bb as n}from"./chunk-LWCTKI4Z.js";import{b as N}from"./chunk-YTUUU33R.js";import{e as I,g as f}from"./chunk-VKWPEFWQ.js";f();var r=I(N(),1);var a="_start",s=class S extends F{static get jsonOutputSchema(){return v}static summary="Run a function locally for testing.";static descriptionWithMarkdown="Runs the function from your current directory for [testing purposes](https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when errors occur, refer to [Shopify Functions error handling](https://shopify.dev/docs/api/functions/errors).";static description=this.descriptionForHelp();static flags={...m,...h,...y,...d,input:r.Flags.string({char:"i",description:"The input JSON to pass to the function. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),export:r.Flags.string({char:"e",hidden:!1,description:"Name of the WebAssembly export to invoke.",env:"SHOPIFY_FLAG_EXPORT"}),profile:r.Flags.boolean({description:"Generate a WebAssembly performance profile for the function run. The profile can be viewed in Speedscope.",env:"SHOPIFY_FLAG_PROFILE"})};async run(){let{flags:t}=await this.parse(S),o=a,{app:p}=await x({directory:t.path,userProvidedConfigName:t.config}),e=await P(p,t.path);if(t.export!==void 0)n(`Using export ${t.export} from the --export flag.`),o=t.export;else if(e.configuration.targeting!==void 0&&e.configuration.targeting.length>0){let i=e.configuration.targeting;if(i.length>1&&!t["no-input"]&&l()){let E=i.map(u=>({label:u.target,value:u.export||a}));o=await g({message:"Which target would you like to execute?",choices:E})}else o=i?.[0]?.export||a,n(`Using export '${o}'. Use the --export flag or an interactive terminal to select a different export.`)}else n(`No targeting information found. Using the default export '${o}'. Use the --export flag or an interactive terminal to select a different export.`);let c=e?.configuration.targeting?.[0]?.input_query,A=c&&`${e?.directory}/${c}`,U=await b(e,t.path,t["client-id"],t.reset,t.config),_={functionExtension:e,inputPath:t.input,export:o,stdin:"inherit",schemaPath:U,queryPath:A,profile:t.profile,json:t.json},T=await w(_);return O(T),{app:p}}};export{s as a};
1
+ import{a as v,c as w,d as O}from"./chunk-ADVLRSSO.js";import{f as y,g as P,h as b}from"./chunk-YXIFSIRX.js";import{a as F}from"./chunk-BU3JQM3W.js";import{a as h}from"./chunk-D4LFWIFE.js";import{Na as x}from"./chunk-XV6XCOTG.js";import{b as m,c as d}from"./chunk-5AWELO3D.js";import{G as g,W as l}from"./chunk-V654BMS7.js";import{Bb as n}from"./chunk-RIG66DIQ.js";import{b as N}from"./chunk-YTUUU33R.js";import{e as I,g as f}from"./chunk-VKWPEFWQ.js";f();var r=I(N(),1);var a="_start",s=class S extends F{static get jsonOutputSchema(){return v}static summary="Run a function locally for testing.";static descriptionWithMarkdown="Runs the function from your current directory for [testing purposes](https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when errors occur, refer to [Shopify Functions error handling](https://shopify.dev/docs/api/functions/errors).";static description=this.descriptionForHelp();static flags={...m,...h,...y,...d,input:r.Flags.string({char:"i",description:"The input JSON to pass to the function. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),export:r.Flags.string({char:"e",hidden:!1,description:"Name of the WebAssembly export to invoke.",env:"SHOPIFY_FLAG_EXPORT"}),profile:r.Flags.boolean({description:"Generate a WebAssembly performance profile for the function run. The profile can be viewed in Speedscope.",env:"SHOPIFY_FLAG_PROFILE"})};async run(){let{flags:t}=await this.parse(S),o=a,{app:p}=await x({directory:t.path,userProvidedConfigName:t.config}),e=await P(p,t.path);if(t.export!==void 0)n(`Using export ${t.export} from the --export flag.`),o=t.export;else if(e.configuration.targeting!==void 0&&e.configuration.targeting.length>0){let i=e.configuration.targeting;if(i.length>1&&!t["no-input"]&&l()){let E=i.map(u=>({label:u.target,value:u.export||a}));o=await g({message:"Which target would you like to execute?",choices:E})}else o=i?.[0]?.export||a,n(`Using export '${o}'. Use the --export flag or an interactive terminal to select a different export.`)}else n(`No targeting information found. Using the default export '${o}'. Use the --export flag or an interactive terminal to select a different export.`);let c=e?.configuration.targeting?.[0]?.input_query,A=c&&`${e?.directory}/${c}`,U=await b(e,t.path,t["client-id"],t.reset,t.config),_={functionExtension:e,inputPath:t.input,export:o,stdin:"inherit",schemaPath:U,queryPath:A,profile:t.profile,json:t.json},T=await w(_);return O(T),{app:p}}};export{s as a};
@@ -1,4 +1,4 @@
1
- import{b as s}from"./chunk-ZQDDRIBA.js";import{e as j}from"./chunk-ZT5WFUKJ.js";import{b as m,c as u}from"./chunk-Q2SZCZE7.js";import{D as F,F as I,z as h}from"./chunk-CZ22VZDA.js";import{a as O}from"./chunk-BN7ZXAZJ.js";import{h as v}from"./chunk-2VSNFOKD.js";import{Bb as W,wb as E}from"./chunk-LWCTKI4Z.js";import{b as S}from"./chunk-FZCGRIOM.js";import{g as n}from"./chunk-VKWPEFWQ.js";n();n();n();n();function b(o=k()){return!!o.get("autocorrectEnabled")}function N(o,r=k()){r.set("autocorrectEnabled",o)}function k(){return D??=new j({projectName:"did-you-mean"}),D}var D;function J(){return{enabled:b()}}function y(o){return N(o),{enabled:o}}n();n();var i=O({name:"AutocorrectResult",schema:S.object({enabled:S.boolean()}).strict()});n();var w={on:"Autocorrect on. The system will automatically run commands even when you mistype them.",off:"Autocorrect off. You'll need to confirm corrections for mistyped commands."};function f(o,r){if(r==="json"){E(i.encode({enabled:o.enabled}));return}h({body:o.enabled?w.on:w.off})}var d=class o extends s{static summary="Enable autocorrect. Off by default.";static descriptionWithMarkdown=`Enable autocorrect. Off by default.
1
+ import{b as s}from"./chunk-OLKLHVHA.js";import{e as j}from"./chunk-J3UXIC23.js";import{b as m,c as u}from"./chunk-5AWELO3D.js";import{D as F,F as I,z as h}from"./chunk-V654BMS7.js";import{a as O}from"./chunk-BN7ZXAZJ.js";import{h as v}from"./chunk-J7BTC45S.js";import{Bb as W,wb as E}from"./chunk-RIG66DIQ.js";import{b as S}from"./chunk-FZCGRIOM.js";import{g as n}from"./chunk-VKWPEFWQ.js";n();n();n();n();function b(o=k()){return!!o.get("autocorrectEnabled")}function N(o,r=k()){r.set("autocorrectEnabled",o)}function k(){return D??=new j({projectName:"did-you-mean"}),D}var D;function J(){return{enabled:b()}}function y(o){return N(o),{enabled:o}}n();n();var i=O({name:"AutocorrectResult",schema:S.object({enabled:S.boolean()}).strict()});n();var w={on:"Autocorrect on. The system will automatically run commands even when you mistype them.",off:"Autocorrect off. You'll need to confirm corrections for mistyped commands."};function f(o,r){if(r==="json"){E(i.encode({enabled:o.enabled}));return}h({body:o.enabled?w.on:w.off})}var d=class o extends s{static summary="Enable autocorrect. Off by default.";static descriptionWithMarkdown=`Enable autocorrect. Off by default.
2
2
 
3
3
  When autocorrection is enabled, Shopify CLI automatically runs a corrected version of your command if a correction is available.
4
4
 
@@ -1,4 +1,4 @@
1
- import{b as h}from"./chunk-ZQDDRIBA.js";import{b as u,c as m}from"./chunk-Q2SZCZE7.js";import{O as i}from"./chunk-CZ22VZDA.js";import{a as n}from"./chunk-BN7ZXAZJ.js";import{wb as p}from"./chunk-LWCTKI4Z.js";import{b as s}from"./chunk-FZCGRIOM.js";import{b as g}from"./chunk-YTUUU33R.js";import{e as S,g as e}from"./chunk-VKWPEFWQ.js";e();e();async function f(t){let r=new URLSearchParams;return r.append("search",t??""),{url:`https://shopify.dev/docs?${r.toString()}`}}e();e();var o=n({name:"SearchResult",schema:s.object({url:s.string().url()})});async function l(t,r){r==="json"?p(o.encode(t)):await i(t.url)}var d=S(g(),1),a=class t extends h{static descriptionWithMarkdown="Search shopify.dev for the most relevant content matching a query. Best for discovery \u2014 surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `doc fetch`.";static description=this.descriptionForHelp();static usage="search [query]";static examples=[`# open the search modal on Shopify.dev
1
+ import{b as h}from"./chunk-OLKLHVHA.js";import{b as u,c as m}from"./chunk-5AWELO3D.js";import{O as i}from"./chunk-V654BMS7.js";import{a as n}from"./chunk-BN7ZXAZJ.js";import{wb as p}from"./chunk-RIG66DIQ.js";import{b as s}from"./chunk-FZCGRIOM.js";import{b as g}from"./chunk-YTUUU33R.js";import{e as S,g as e}from"./chunk-VKWPEFWQ.js";e();e();async function f(t){let r=new URLSearchParams;return r.append("search",t??""),{url:`https://shopify.dev/docs?${r.toString()}`}}e();e();var o=n({name:"SearchResult",schema:s.object({url:s.string().url()})});async function l(t,r){r==="json"?p(o.encode(t)):await i(t.url)}var d=S(g(),1),a=class t extends h{static descriptionWithMarkdown="Search shopify.dev for the most relevant content matching a query. Best for discovery \u2014 surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `doc fetch`.";static description=this.descriptionForHelp();static usage="search [query]";static examples=[`# open the search modal on Shopify.dev
2
2
  shopify search
3
3
 
4
4
  # search for a term on Shopify.dev
@@ -1 +1 @@
1
- import{a as l}from"./chunk-7RPFJZLP.js";import{a as n}from"./chunk-FWB3GLMW.js";import{F as s,G as c,H as f,L as m,Na as g,t as p}from"./chunk-3C6VLJ5D.js";import{b as r,c as e}from"./chunk-Q2SZCZE7.js";import{b as F}from"./chunk-YTUUU33R.js";import{e as A,g as a}from"./chunk-VKWPEFWQ.js";a();var u=A(F(),1);var{config:U,...w}=n,o=class d extends l{static summary="Activate an app configuration.";static descriptionWithMarkdown="Sets default configuration when you run app-related CLI commands. If you omit the `config-name` parameter, then you'll be prompted to choose from the configuration files in your project.";static get jsonOutputSchema(){return s}static description=this.descriptionForHelp();static usage="app config use [config] [flags]";static flags={...r,...e,...w};static args={config:u.Args.string({description:"The name of the app configuration. Can be 'shopify.app.staging.toml' or simply 'staging'."})};async run(){let{flags:t,args:i}=await this.parse(d),h=p(t.path)?.configFile??null,{app:y}=await g({directory:t.path,userProvidedConfigName:i.config});await m(t.path);let C=await f({directory:t.path,configName:i.config,reset:t.reset,previousConfigFile:h});return await c(C,t.path,t.json?"json":"text"),{app:y}}};export{o as a};
1
+ import{a as l}from"./chunk-BU3JQM3W.js";import{a as n}from"./chunk-D4LFWIFE.js";import{F as s,G as c,H as f,L as m,Na as g,t as p}from"./chunk-XV6XCOTG.js";import{b as r,c as e}from"./chunk-5AWELO3D.js";import{b as F}from"./chunk-YTUUU33R.js";import{e as A,g as a}from"./chunk-VKWPEFWQ.js";a();var u=A(F(),1);var{config:U,...w}=n,o=class d extends l{static summary="Activate an app configuration.";static descriptionWithMarkdown="Sets default configuration when you run app-related CLI commands. If you omit the `config-name` parameter, then you'll be prompted to choose from the configuration files in your project.";static get jsonOutputSchema(){return s}static description=this.descriptionForHelp();static usage="app config use [config] [flags]";static flags={...r,...e,...w};static args={config:u.Args.string({description:"The name of the app configuration. Can be 'shopify.app.staging.toml' or simply 'staging'."})};async run(){let{flags:t,args:i}=await this.parse(d),h=p(t.path)?.configFile??null,{app:y}=await g({directory:t.path,userProvidedConfigName:i.config});await m(t.path);let C=await f({directory:t.path,configName:i.config,reset:t.reset,previousConfigFile:h});return await c(C,t.path,t.json?"json":"text"),{app:y}}};export{o as a};
@@ -1 +1 @@
1
- import{s as r,t as a}from"./chunk-ZT5WFUKJ.js";import{z as p}from"./chunk-CZ22VZDA.js";import{a as u}from"./chunk-BN7ZXAZJ.js";import{wb as n}from"./chunk-LWCTKI4Z.js";import{b as o}from"./chunk-FZCGRIOM.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();function l(){return{enabled:r()}}function f(t){return a(t),{enabled:t}}e();var d=u({name:"AutoUpgradeResult",schema:o.object({enabled:o.boolean()}).strict()});e();function S(t,m){if(m==="json"){n(d.encode({enabled:t.enabled}));return}p({body:t.enabled?"Auto-upgrade on. Shopify CLI will update automatically after each command.":"Auto-upgrade off. You'll need to run `shopify upgrade` to update manually."})}export{l as a,f as b,d as c,S as d};
1
+ import{s as r,t as a}from"./chunk-J3UXIC23.js";import{z as p}from"./chunk-V654BMS7.js";import{a as u}from"./chunk-BN7ZXAZJ.js";import{wb as n}from"./chunk-RIG66DIQ.js";import{b as o}from"./chunk-FZCGRIOM.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();function l(){return{enabled:r()}}function f(t){return a(t),{enabled:t}}e();var d=u({name:"AutoUpgradeResult",schema:o.object({enabled:o.boolean()}).strict()});e();function S(t,m){if(m==="json"){n(d.encode({enabled:t.enabled}));return}p({body:t.enabled?"Auto-upgrade on. Shopify CLI will update automatically after each command.":"Auto-upgrade off. You'll need to run `shopify upgrade` to update manually."})}export{l as a,f as b,d as c,S as d};
@@ -1,4 +1,4 @@
1
- import{a as yo}from"./chunk-RJ5VF3QY.js";import{h as nn,k as _o}from"./chunk-2VSNFOKD.js";import{$a as mo,Bb as Ve,Qa as tn,Ra as ur,Ta as rn,sb as Fe}from"./chunk-LWCTKI4Z.js";import{g as go}from"./chunk-3A3DZVEJ.js";import{a as cr,b as po}from"./chunk-ZDQO6CNY.js";import{e as ar,h as en}from"./chunk-IWTNUJGY.js";import{a as Rc}from"./chunk-CX5CC6P5.js";import{c as g,e as Qr,g as u}from"./chunk-VKWPEFWQ.js";var kt=g(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.regexpCode=q.getEsmExportName=q.getProperty=q.safeStringify=q.stringify=q.strConcat=q.addCodeArg=q.str=q._=q.nil=q._Code=q.Name=q.IDENTIFIER=q._CodeOrName=void 0;var Ot=class{};q._CodeOrName=Ot;q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ge=class extends Ot{constructor(e){if(super(),!q.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};q.Name=Ge;var se=class extends Ot{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Ge&&(r[n.str]=(r[n.str]||0)+1),r),{})}};q._Code=se;q.nil=new se("");function xo(t,...e){let r=[t[0]],n=0;for(;n<e.length;)_n(r,e[n]),r.push(t[++n]);return new se(r)}q._=xo;var yn=new se("+");function zo(t,...e){let r=[Tt(t[0])],n=0;for(;n<e.length;)r.push(yn),_n(r,e[n]),r.push(yn,Tt(t[++n]));return Lc(r),new se(r)}q.str=zo;function _n(t,e){e instanceof se?t.push(...e._items):e instanceof Ge?t.push(e):t.push(Hc(e))}q.addCodeArg=_n;function Lc(t){let e=1;for(;e<t.length-1;){if(t[e]===yn){let r=Kc(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Kc(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ge||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ge))return`"${t}${e.slice(1)}`}function Gc(t,e){return e.emptyStr()?t:t.emptyStr()?e:zo`${t}${e}`}q.strConcat=Gc;function Hc(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Tt(Array.isArray(t)?t.join(","):t)}function Wc(t){return new se(Tt(t))}q.stringify=Wc;function Tt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}q.safeStringify=Tt;function Jc(t){return typeof t=="string"&&q.IDENTIFIER.test(t)?new se(`.${t}`):xo`[${t}]`}q.getProperty=Jc;function Yc(t){if(typeof t=="string"&&q.IDENTIFIER.test(t))return new se(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}q.getEsmExportName=Yc;function Bc(t){return new se(t.toString())}q.regexpCode=Bc});var vn=g(Q=>{"use strict";u();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var Z=kt(),gn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},hr;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(hr||(Q.UsedValueState=hr={}));Q.varKinds={const:new Z.Name("const"),let:new Z.Name("let"),var:new Z.Name("var")};var pr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Z.Name?e:this.name(e)}name(e){return new Z.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=pr;var mr=class extends Z.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Z._)`.${new Z.Name(r)}[${n}]`}};Q.ValueScopeName=mr;var Xc=(0,Z._)`\n`,$n=class extends pr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Xc:Z.nil}}get(){return this._scope}name(e){return new mr(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let d=a.get(i);if(d)return d}else a=this._values[o]=new Map;a.set(i,s);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,s.setValue(r,{property:o,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Z._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let o=Z.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,hr.Started);let d=r(l);if(d){let f=this.opts.es5?Q.varKinds.var:Q.varKinds.const;o=(0,Z._)`${o}${f} ${l} = ${d};${this.opts._n}`}else if(d=s?.(l))o=(0,Z._)`${o}${d}${this.opts._n}`;else throw new gn(l);c.set(l,hr.Completed)})}return o}};Q.ValueScope=$n});var b=g(P=>{"use strict";u();Object.defineProperty(P,"__esModule",{value:!0});P.or=P.and=P.not=P.CodeGen=P.operators=P.varKinds=P.ValueScopeName=P.ValueScope=P.Scope=P.Name=P.regexpCode=P.stringify=P.getProperty=P.nil=P.strConcat=P.str=P._=void 0;var O=kt(),le=vn(),ke=kt();Object.defineProperty(P,"_",{enumerable:!0,get:function(){return ke._}});Object.defineProperty(P,"str",{enumerable:!0,get:function(){return ke.str}});Object.defineProperty(P,"strConcat",{enumerable:!0,get:function(){return ke.strConcat}});Object.defineProperty(P,"nil",{enumerable:!0,get:function(){return ke.nil}});Object.defineProperty(P,"getProperty",{enumerable:!0,get:function(){return ke.getProperty}});Object.defineProperty(P,"stringify",{enumerable:!0,get:function(){return ke.stringify}});Object.defineProperty(P,"regexpCode",{enumerable:!0,get:function(){return ke.regexpCode}});Object.defineProperty(P,"Name",{enumerable:!0,get:function(){return ke.Name}});var $r=vn();Object.defineProperty(P,"Scope",{enumerable:!0,get:function(){return $r.Scope}});Object.defineProperty(P,"ValueScope",{enumerable:!0,get:function(){return $r.ValueScope}});Object.defineProperty(P,"ValueScopeName",{enumerable:!0,get:function(){return $r.ValueScopeName}});Object.defineProperty(P,"varKinds",{enumerable:!0,get:function(){return $r.varKinds}});P.operators={GT:new O._Code(">"),GTE:new O._Code(">="),LT:new O._Code("<"),LTE:new O._Code("<="),EQ:new O._Code("==="),NEQ:new O._Code("!=="),NOT:new O._Code("!"),OR:new O._Code("||"),AND:new O._Code("&&"),ADD:new O._Code("+")};var Pe=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},wn=class extends Pe{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?le.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ot(this.rhs,e,r)),this}get names(){return this.rhs instanceof O._CodeOrName?this.rhs.names:{}}},yr=class extends Pe{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof O.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ot(this.rhs,e,r),this}get names(){let e=this.lhs instanceof O.Name?{}:{...this.lhs.names};return gr(e,this.rhs)}},En=class extends yr{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Sn=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},bn=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Pn=class extends Pe{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Nn=class extends Pe{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ot(this.code,e,r),this}get names(){return this.code instanceof O._CodeOrName?this.code.names:{}}},Rt=class extends Pe{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let o=n[s];o.optimizeNames(e,r)||(Zc(e,o.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Je(e,r.names),{})}},Ne=class extends Rt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},In=class extends Rt{},st=class extends Ne{};st.kind="else";var He=class t extends Ne{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new st(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Fo(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ot(this.condition,e,r),this}get names(){let e=super.names;return gr(e,this.condition),this.else&&Je(e,this.else.names),e}};He.kind="if";var We=class extends Ne{};We.kind="for";var On=class extends We{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ot(this.iteration,e,r),this}get names(){return Je(super.names,this.iteration.names)}},Tn=class extends We{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?le.varKinds.var:this.varKind,{name:n,from:s,to:o}=this;return`for(${r} ${n}=${s}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=gr(super.names,this.from);return gr(e,this.to)}},_r=class extends We{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ot(this.iterable,e,r),this}get names(){return Je(super.names,this.iterable.names)}},jt=class extends Ne{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};jt.kind="func";var qt=class extends Rt{render(e){return"return "+super.render(e)}};qt.kind="return";var kn=class extends Ne{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Je(e,this.catch.names),this.finally&&Je(e,this.finally.names),e}},At=class extends Ne{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};At.kind="catch";var Ct=class extends Ne{render(e){return"finally"+super.render(e)}};Ct.kind="finally";var Rn=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
1
+ import{a as yo}from"./chunk-RJ5VF3QY.js";import{h as nn,k as _o}from"./chunk-J7BTC45S.js";import{$a as mo,Bb as Ve,Qa as tn,Ra as ur,Ta as rn,sb as Fe}from"./chunk-RIG66DIQ.js";import{g as go}from"./chunk-GSGCSBRN.js";import{a as cr,b as po}from"./chunk-ZDQO6CNY.js";import{e as ar,h as en}from"./chunk-IWTNUJGY.js";import{a as Rc}from"./chunk-CX5CC6P5.js";import{c as g,e as Qr,g as u}from"./chunk-VKWPEFWQ.js";var kt=g(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.regexpCode=q.getEsmExportName=q.getProperty=q.safeStringify=q.stringify=q.strConcat=q.addCodeArg=q.str=q._=q.nil=q._Code=q.Name=q.IDENTIFIER=q._CodeOrName=void 0;var Ot=class{};q._CodeOrName=Ot;q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ge=class extends Ot{constructor(e){if(super(),!q.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};q.Name=Ge;var se=class extends Ot{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Ge&&(r[n.str]=(r[n.str]||0)+1),r),{})}};q._Code=se;q.nil=new se("");function xo(t,...e){let r=[t[0]],n=0;for(;n<e.length;)_n(r,e[n]),r.push(t[++n]);return new se(r)}q._=xo;var yn=new se("+");function zo(t,...e){let r=[Tt(t[0])],n=0;for(;n<e.length;)r.push(yn),_n(r,e[n]),r.push(yn,Tt(t[++n]));return Lc(r),new se(r)}q.str=zo;function _n(t,e){e instanceof se?t.push(...e._items):e instanceof Ge?t.push(e):t.push(Hc(e))}q.addCodeArg=_n;function Lc(t){let e=1;for(;e<t.length-1;){if(t[e]===yn){let r=Kc(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Kc(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ge||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ge))return`"${t}${e.slice(1)}`}function Gc(t,e){return e.emptyStr()?t:t.emptyStr()?e:zo`${t}${e}`}q.strConcat=Gc;function Hc(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Tt(Array.isArray(t)?t.join(","):t)}function Wc(t){return new se(Tt(t))}q.stringify=Wc;function Tt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}q.safeStringify=Tt;function Jc(t){return typeof t=="string"&&q.IDENTIFIER.test(t)?new se(`.${t}`):xo`[${t}]`}q.getProperty=Jc;function Yc(t){if(typeof t=="string"&&q.IDENTIFIER.test(t))return new se(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}q.getEsmExportName=Yc;function Bc(t){return new se(t.toString())}q.regexpCode=Bc});var vn=g(Q=>{"use strict";u();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var Z=kt(),gn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},hr;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(hr||(Q.UsedValueState=hr={}));Q.varKinds={const:new Z.Name("const"),let:new Z.Name("let"),var:new Z.Name("var")};var pr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Z.Name?e:this.name(e)}name(e){return new Z.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=pr;var mr=class extends Z.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Z._)`.${new Z.Name(r)}[${n}]`}};Q.ValueScopeName=mr;var Xc=(0,Z._)`\n`,$n=class extends pr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Xc:Z.nil}}get(){return this._scope}name(e){return new mr(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let d=a.get(i);if(d)return d}else a=this._values[o]=new Map;a.set(i,s);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,s.setValue(r,{property:o,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Z._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let o=Z.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,hr.Started);let d=r(l);if(d){let f=this.opts.es5?Q.varKinds.var:Q.varKinds.const;o=(0,Z._)`${o}${f} ${l} = ${d};${this.opts._n}`}else if(d=s?.(l))o=(0,Z._)`${o}${d}${this.opts._n}`;else throw new gn(l);c.set(l,hr.Completed)})}return o}};Q.ValueScope=$n});var b=g(P=>{"use strict";u();Object.defineProperty(P,"__esModule",{value:!0});P.or=P.and=P.not=P.CodeGen=P.operators=P.varKinds=P.ValueScopeName=P.ValueScope=P.Scope=P.Name=P.regexpCode=P.stringify=P.getProperty=P.nil=P.strConcat=P.str=P._=void 0;var O=kt(),le=vn(),ke=kt();Object.defineProperty(P,"_",{enumerable:!0,get:function(){return ke._}});Object.defineProperty(P,"str",{enumerable:!0,get:function(){return ke.str}});Object.defineProperty(P,"strConcat",{enumerable:!0,get:function(){return ke.strConcat}});Object.defineProperty(P,"nil",{enumerable:!0,get:function(){return ke.nil}});Object.defineProperty(P,"getProperty",{enumerable:!0,get:function(){return ke.getProperty}});Object.defineProperty(P,"stringify",{enumerable:!0,get:function(){return ke.stringify}});Object.defineProperty(P,"regexpCode",{enumerable:!0,get:function(){return ke.regexpCode}});Object.defineProperty(P,"Name",{enumerable:!0,get:function(){return ke.Name}});var $r=vn();Object.defineProperty(P,"Scope",{enumerable:!0,get:function(){return $r.Scope}});Object.defineProperty(P,"ValueScope",{enumerable:!0,get:function(){return $r.ValueScope}});Object.defineProperty(P,"ValueScopeName",{enumerable:!0,get:function(){return $r.ValueScopeName}});Object.defineProperty(P,"varKinds",{enumerable:!0,get:function(){return $r.varKinds}});P.operators={GT:new O._Code(">"),GTE:new O._Code(">="),LT:new O._Code("<"),LTE:new O._Code("<="),EQ:new O._Code("==="),NEQ:new O._Code("!=="),NOT:new O._Code("!"),OR:new O._Code("||"),AND:new O._Code("&&"),ADD:new O._Code("+")};var Pe=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},wn=class extends Pe{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?le.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ot(this.rhs,e,r)),this}get names(){return this.rhs instanceof O._CodeOrName?this.rhs.names:{}}},yr=class extends Pe{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof O.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ot(this.rhs,e,r),this}get names(){let e=this.lhs instanceof O.Name?{}:{...this.lhs.names};return gr(e,this.rhs)}},En=class extends yr{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Sn=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},bn=class extends Pe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Pn=class extends Pe{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Nn=class extends Pe{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ot(this.code,e,r),this}get names(){return this.code instanceof O._CodeOrName?this.code.names:{}}},Rt=class extends Pe{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let o=n[s];o.optimizeNames(e,r)||(Zc(e,o.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Je(e,r.names),{})}},Ne=class extends Rt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},In=class extends Rt{},st=class extends Ne{};st.kind="else";var He=class t extends Ne{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new st(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Fo(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ot(this.condition,e,r),this}get names(){let e=super.names;return gr(e,this.condition),this.else&&Je(e,this.else.names),e}};He.kind="if";var We=class extends Ne{};We.kind="for";var On=class extends We{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ot(this.iteration,e,r),this}get names(){return Je(super.names,this.iteration.names)}},Tn=class extends We{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?le.varKinds.var:this.varKind,{name:n,from:s,to:o}=this;return`for(${r} ${n}=${s}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=gr(super.names,this.from);return gr(e,this.to)}},_r=class extends We{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ot(this.iterable,e,r),this}get names(){return Je(super.names,this.iterable.names)}},jt=class extends Ne{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};jt.kind="func";var qt=class extends Rt{render(e){return"return "+super.render(e)}};qt.kind="return";var kn=class extends Ne{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Je(e,this.catch.names),this.finally&&Je(e,this.finally.names),e}},At=class extends Ne{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};At.kind="catch";var Ct=class extends Ne{render(e){return"finally"+super.render(e)}};Ct.kind="finally";var Rn=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
2
2
  `:""},this._extScope=e,this._scope=new le.Scope({parent:e}),this._nodes=[new In]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let o=this._scope.toName(r);return n!==void 0&&s&&(this._constants[o.str]=n),this._leafNode(new wn(e,o,n)),o}const(e,r,n){return this._def(le.varKinds.const,e,r,n)}let(e,r,n){return this._def(le.varKinds.let,e,r,n)}var(e,r,n){return this._def(le.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new yr(e,r,n))}add(e,r){return this._leafNode(new En(e,P.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==O.nil&&this._leafNode(new Nn(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,O.addCodeArg)(r,s));return r.push("}"),new O._Code(r)}if(e,r,n){if(this._blockNode(new He(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new He(e))}else(){return this._elseNode(new st)}endIf(){return this._endBlockNode(He,st)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new On(e),r)}forRange(e,r,n,s,o=this.opts.es5?le.varKinds.var:le.varKinds.let){let i=this._scope.toName(e);return this._for(new Tn(o,i,r,n),()=>s(i))}forOf(e,r,n,s=le.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let i=r instanceof O.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,O._)`${i}.length`,a=>{this.var(o,(0,O._)`${i}[${a}]`),n(o)})}return this._for(new _r("of",s,o,r),()=>n(o))}forIn(e,r,n,s=this.opts.es5?le.varKinds.var:le.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,O._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new _r("in",s,o,r),()=>n(o))}endFor(){return this._endBlockNode(We)}label(e){return this._leafNode(new Sn(e))}break(e){return this._leafNode(new bn(e))}return(e){let r=new qt;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(qt)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new kn;if(this._blockNode(s),this.code(e),r){let o=this.name("e");this._currNode=s.catch=new At(o),r(o)}return n&&(this._currNode=s.finally=new Ct,this.code(n)),this._endBlockNode(At,Ct)}throw(e){return this._leafNode(new Pn(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=O.nil,n,s){return this._blockNode(new jt(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(jt)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof He))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};P.CodeGen=Rn;function Je(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function gr(t,e){return e instanceof O._CodeOrName?Je(t,e.names):t}function ot(t,e,r){if(t instanceof O.Name)return n(t);if(!s(t))return t;return new O._Code(t._items.reduce((o,i)=>(i instanceof O.Name&&(i=n(i)),i instanceof O._Code?o.push(...i._items):o.push(i),o),[]));function n(o){let i=r[o.str];return i===void 0||e[o.str]!==1?o:(delete e[o.str],i)}function s(o){return o instanceof O._Code&&o._items.some(i=>i instanceof O.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function Zc(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Fo(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,O._)`!${jn(t)}`}P.not=Fo;var Qc=Vo(P.operators.AND);function eu(...t){return t.reduce(Qc)}P.and=eu;var tu=Vo(P.operators.OR);function ru(...t){return t.reduce(tu)}P.or=ru;function Vo(t){return(e,r)=>e===O.nil?r:r===O.nil?e:(0,O._)`${jn(e)} ${t} ${jn(r)}`}function jn(t){return t instanceof O.Name?t:(0,O._)`(${t})`}});var k=g(N=>{"use strict";u();Object.defineProperty(N,"__esModule",{value:!0});N.checkStrictMode=N.getErrorPath=N.Type=N.useFunc=N.setEvaluated=N.evaluatedPropsToName=N.mergeEvaluated=N.eachItem=N.unescapeJsonPointer=N.escapeJsonPointer=N.escapeFragment=N.unescapeFragment=N.schemaRefOrVal=N.schemaHasRulesButRef=N.schemaHasRules=N.checkUnknownRules=N.alwaysValidSchema=N.toHash=void 0;var C=b(),nu=kt();function su(t){let e={};for(let r of t)e[r]=!0;return e}N.toHash=su;function ou(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Ko(t,e),!Go(e,t.self.RULES.all))}N.alwaysValidSchema=ou;function Ko(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let o in e)s[o]||Jo(t,`unknown keyword: "${o}"`)}N.checkUnknownRules=Ko;function Go(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}N.schemaHasRules=Go;function iu(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}N.schemaHasRulesButRef=iu;function au({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,C._)`${r}`}return(0,C._)`${t}${e}${(0,C.getProperty)(n)}`}N.schemaRefOrVal=au;function cu(t){return Ho(decodeURIComponent(t))}N.unescapeFragment=cu;function uu(t){return encodeURIComponent(An(t))}N.escapeFragment=uu;function An(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}N.escapeJsonPointer=An;function Ho(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}N.unescapeJsonPointer=Ho;function lu(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}N.eachItem=lu;function Uo({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof C.Name?(o instanceof C.Name?t(s,o,i):e(s,o,i),i):o instanceof C.Name?(e(s,i,o),o):r(o,i);return a===C.Name&&!(c instanceof C.Name)?n(s,c):c}}N.mergeEvaluated={props:Uo({mergeNames:(t,e,r)=>t.if((0,C._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,C._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,C._)`${r} || {}`).code((0,C._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,C._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,C._)`${r} || {}`),Cn(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Wo}),items:Uo({mergeNames:(t,e,r)=>t.if((0,C._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,C._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,C._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,C._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Wo(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,C._)`{}`);return e!==void 0&&Cn(t,r,e),r}N.evaluatedPropsToName=Wo;function Cn(t,e,r){Object.keys(r).forEach(n=>t.assign((0,C._)`${e}${(0,C.getProperty)(n)}`,!0))}N.setEvaluated=Cn;var Lo={};function du(t,e){return t.scopeValue("func",{ref:e,code:Lo[e.code]||(Lo[e.code]=new nu._Code(e.code))})}N.useFunc=du;var qn;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(qn||(N.Type=qn={}));function fu(t,e,r){if(t instanceof C.Name){let n=e===qn.Num;return r?n?(0,C._)`"[" + ${t} + "]"`:(0,C._)`"['" + ${t} + "']"`:n?(0,C._)`"/" + ${t}`:(0,C._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,C.getProperty)(t).toString():"/"+An(t)}N.getErrorPath=fu;function Jo(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}N.checkStrictMode=Jo});var Ie=g(Dn=>{"use strict";u();Object.defineProperty(Dn,"__esModule",{value:!0});var H=b(),hu={data:new H.Name("data"),valCxt:new H.Name("valCxt"),instancePath:new H.Name("instancePath"),parentData:new H.Name("parentData"),parentDataProperty:new H.Name("parentDataProperty"),rootData:new H.Name("rootData"),dynamicAnchors:new H.Name("dynamicAnchors"),vErrors:new H.Name("vErrors"),errors:new H.Name("errors"),this:new H.Name("this"),self:new H.Name("self"),scope:new H.Name("scope"),json:new H.Name("json"),jsonPos:new H.Name("jsonPos"),jsonLen:new H.Name("jsonLen"),jsonPart:new H.Name("jsonPart")};Dn.default=hu});var Dt=g(W=>{"use strict";u();Object.defineProperty(W,"__esModule",{value:!0});W.extendErrors=W.resetErrorsCount=W.reportExtraError=W.reportError=W.keyword$DataError=W.keywordError=void 0;var R=b(),vr=k(),Y=Ie();W.keywordError={message:({keyword:t})=>(0,R.str)`must pass "${t}" keyword validation`};W.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,R.str)`"${t}" keyword must be ${e} ($data)`:(0,R.str)`"${t}" keyword is invalid ($data)`};function pu(t,e=W.keywordError,r,n){let{it:s}=t,{gen:o,compositeRule:i,allErrors:a}=s,c=Xo(t,e,r);n??(i||a)?Yo(o,c):Bo(s,(0,R._)`[${c}]`)}W.reportError=pu;function mu(t,e=W.keywordError,r){let{it:n}=t,{gen:s,compositeRule:o,allErrors:i}=n,a=Xo(t,e,r);Yo(s,a),o||i||Bo(n,Y.default.vErrors)}W.reportExtraError=mu;function yu(t,e){t.assign(Y.default.errors,e),t.if((0,R._)`${Y.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,R._)`${Y.default.vErrors}.length`,e),()=>t.assign(Y.default.vErrors,null)))}W.resetErrorsCount=yu;function _u({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",s,Y.default.errors,a=>{t.const(i,(0,R._)`${Y.default.vErrors}[${a}]`),t.if((0,R._)`${i}.instancePath === undefined`,()=>t.assign((0,R._)`${i}.instancePath`,(0,R.strConcat)(Y.default.instancePath,o.errorPath))),t.assign((0,R._)`${i}.schemaPath`,(0,R.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,R._)`${i}.schema`,r),t.assign((0,R._)`${i}.data`,n))})}W.extendErrors=_u;function Yo(t,e){let r=t.const("err",e);t.if((0,R._)`${Y.default.vErrors} === null`,()=>t.assign(Y.default.vErrors,(0,R._)`[${r}]`),(0,R._)`${Y.default.vErrors}.push(${r})`),t.code((0,R._)`${Y.default.errors}++`)}function Bo(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,R._)`new ${t.ValidationError}(${e})`):(r.assign((0,R._)`${n}.errors`,e),r.return(!1))}var Ye={keyword:new R.Name("keyword"),schemaPath:new R.Name("schemaPath"),params:new R.Name("params"),propertyName:new R.Name("propertyName"),message:new R.Name("message"),schema:new R.Name("schema"),parentSchema:new R.Name("parentSchema")};function Xo(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,R._)`{}`:gu(t,e,r)}function gu(t,e,r={}){let{gen:n,it:s}=t,o=[$u(s,r),vu(t,r)];return wu(t,e,o),n.object(...o)}function $u({errorPath:t},{instancePath:e}){let r=e?(0,R.str)`${t}${(0,vr.getErrorPath)(e,vr.Type.Str)}`:t;return[Y.default.instancePath,(0,R.strConcat)(Y.default.instancePath,r)]}function vu({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,R.str)`${e}/${t}`;return r&&(s=(0,R.str)`${s}${(0,vr.getErrorPath)(r,vr.Type.Str)}`),[Ye.schemaPath,s]}function wu(t,{params:e,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=t,{opts:c,propertyName:l,topSchemaRef:d,schemaPath:f}=a;n.push([Ye.keyword,s],[Ye.params,typeof e=="function"?e(t):e||(0,R._)`{}`]),c.messages&&n.push([Ye.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Ye.schema,i],[Ye.parentSchema,(0,R._)`${d}${f}`],[Y.default.data,o]),l&&n.push([Ye.propertyName,l])}});var Qo=g(it=>{"use strict";u();Object.defineProperty(it,"__esModule",{value:!0});it.boolOrEmptySchema=it.topBoolOrEmptySchema=void 0;var Eu=Dt(),Su=b(),bu=Ie(),Pu={message:"boolean schema is false"};function Nu(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Zo(t,!1):typeof r=="object"&&r.$async===!0?e.return(bu.default.data):(e.assign((0,Su._)`${n}.errors`,null),e.return(!0))}it.topBoolOrEmptySchema=Nu;function Iu(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Zo(t)):r.var(e,!0)}it.boolOrEmptySchema=Iu;function Zo(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Eu.reportError)(s,Pu,void 0,e)}});var Mn=g(at=>{"use strict";u();Object.defineProperty(at,"__esModule",{value:!0});at.getRules=at.isJSONType=void 0;var Ou=["string","number","integer","boolean","null","object","array"],Tu=new Set(Ou);function ku(t){return typeof t=="string"&&Tu.has(t)}at.isJSONType=ku;function Ru(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}at.getRules=Ru});var xn=g(Re=>{"use strict";u();Object.defineProperty(Re,"__esModule",{value:!0});Re.shouldUseRule=Re.shouldUseGroup=Re.schemaHasRulesForType=void 0;function ju({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&ei(t,n)}Re.schemaHasRulesForType=ju;function ei(t,e){return e.rules.some(r=>ti(t,r))}Re.shouldUseGroup=ei;function ti(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Re.shouldUseRule=ti});var Mt=g(J=>{"use strict";u();Object.defineProperty(J,"__esModule",{value:!0});J.reportTypeError=J.checkDataTypes=J.checkDataType=J.coerceAndCheckDataType=J.getJSONTypes=J.getSchemaTypes=J.DataType=void 0;var qu=Mn(),Au=xn(),Cu=Dt(),S=b(),ri=k(),ct;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ct||(J.DataType=ct={}));function Du(t){let e=ni(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}J.getSchemaTypes=Du;function ni(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(qu.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}J.getJSONTypes=ni;function Mu(t,e){let{gen:r,data:n,opts:s}=t,o=xu(e,s.coerceTypes),i=e.length>0&&!(o.length===0&&e.length===1&&(0,Au.schemaHasRulesForType)(t,e[0]));if(i){let a=Fn(e,n,s.strictNumbers,ct.Wrong);r.if(a,()=>{o.length?zu(t,e,o):Vn(t)})}return i}J.coerceAndCheckDataType=Mu;var si=new Set(["string","number","integer","boolean","null"]);function xu(t,e){return e?t.filter(r=>si.has(r)||e==="array"&&r==="array"):[]}function zu(t,e,r){let{gen:n,data:s,opts:o}=t,i=n.let("dataType",(0,S._)`typeof ${s}`),a=n.let("coerced",(0,S._)`undefined`);o.coerceTypes==="array"&&n.if((0,S._)`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,S._)`${s}[0]`).assign(i,(0,S._)`typeof ${s}`).if(Fn(e,s,o.strictNumbers),()=>n.assign(a,s))),n.if((0,S._)`${a} !== undefined`);for(let l of r)(si.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);n.else(),Vn(t),n.endIf(),n.if((0,S._)`${a} !== undefined`,()=>{n.assign(s,a),Fu(t,a)});function c(l){switch(l){case"string":n.elseIf((0,S._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,S._)`"" + ${s}`).elseIf((0,S._)`${s} === null`).assign(a,(0,S._)`""`);return;case"number":n.elseIf((0,S._)`${i} == "boolean" || ${s} === null
3
3
  || (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,S._)`+${s}`);return;case"integer":n.elseIf((0,S._)`${i} === "boolean" || ${s} === null
4
4
  || (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,S._)`+${s}`);return;case"boolean":n.elseIf((0,S._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,S._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,S._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,S._)`${i} === "string" || ${i} === "number"
@@ -1 +1 @@
1
- import{b as n}from"./chunk-GRGFA26K.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();t();var o=class extends Error{type;constructor(e,p){super(p),this.type=e}},i=r=>async()=>r,s=r=>async e=>e.provider!==r.provider?n(new o("invalid-provider")):r.action(e.port);var d="cloudflare",v=i({name:d});export{o as a,s as b,d as c,v as d};
1
+ import{b as n}from"./chunk-DSKAIC7O.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();t();var o=class extends Error{type;constructor(e,p){super(p),this.type=e}},i=r=>async()=>r,s=r=>async e=>e.provider!==r.provider?n(new o("invalid-provider")):r.action(e.port);var d="cloudflare",v=i({name:d});export{o as a,s as b,d as c,v as d};
@@ -1 +1 @@
1
- import{Eb as f,db as E,pb as h,xb as g}from"./chunk-LWCTKI4Z.js";import{b as P}from"./chunk-YTUUU33R.js";import{d as m}from"./chunk-IWTNUJGY.js";import{e as O,g as i}from"./chunk-VKWPEFWQ.js";i();i();i();var R=new Set(["THROTTLED","429"]),b=new Set(["ACCESS_DENIED","access_denied"]);function I(e){return Array.isArray(e)?e.flatMap(t=>{let s=[],n=t,r=n?.extensions?.code;typeof r=="string"&&s.push(r);let o=n?.extensions?.app_errors?.errors;if(Array.isArray(o))for(let p of o){let l=p?.category;typeof l=="string"&&s.push(l)}return s}):[]}function T(e){return e!==void 0&&R.has(e)}function _(e){return e!==void 0&&b.has(e)}function S(e){return I(e).some(T)}i();var C=new Set([502,503,504]);function x(e){return e!==void 0&&C.has(e)}var A=O(P(),1),a;(function(e){e[e.Abort=0]="Abort",e[e.AbortSilent=1]="AbortSilent",e[e.Bug=2]="Bug"})(a||(a={}));var y=class extends Error{},c=class extends Error{tryMessage;type;nextSteps;formattedMessage;customSections;code;details;skipOclifErrorHandling;constructor(t,s,n=null,r,o){let p=typeof t=="string"||"value"in t;super(p?f(t):E(t)),n?n instanceof h?this.tryMessage=f(n):this.tryMessage=n:this.tryMessage=null,this.type=s,this.nextSteps=r,this.customSections=o,this.skipOclifErrorHandling=!0,p||(this.formattedMessage=t)}},d=class extends c{constructor(t,s=null,n,r){super(t,a.Abort,s,n,r)}},w=class extends c{command;args;constructor(t,s,n,r=null){super(t,a.Abort,r),this.command=s,this.args=n}},M=class extends c{constructor(){super("",a.AbortSilent)}},u=class extends c{constructor(t,s=null){super(t,a.Bug,s)}};async function z(e){let t;if(k(e))t=e;else if(typeof e=="string")t=new u(e);else if(e instanceof Error)t=new u(e.message),t.stack=e.stack;else{let o=e;t=new u(o?.message??"Unknown error"),o?.stack&&(t.stack=o?.stack)}let{jsonOutputEnabled:s}=await import("./environment-O7ECODHU.js"),{commandEventOutputMode:n}=await import("./command-event-context-LFUZ7UCA.js");if(s()||n()==="json"){let{renderFatalErrorAsJson:o}=await import("./json-error-HZB5YIHV.js");return o(t),await g(),e}let{renderFatalError:r}=await import("./ui-PCG5D6RZ.js");return r(t),Promise.resolve(e)}function J(e){if(e instanceof A.Errors.CLIError){let t=new d(e.message);return t.stack=e.stack,Promise.resolve(t)}else return Promise.resolve(e)}function k(e){try{return Object.prototype.hasOwnProperty.call(e,"type")}catch{return!1}}function Q(e){if(!k(e)){if(e instanceof Error){if(v(e))return!1;let t=e.message;return!L(t)}return!0}return e.type===a.Bug}function v(e){let t=e;if(typeof t.response!="object"||t.response===null||t.request===void 0)return!1;let s=t.response.status;return s===401||s===429||x(s)?!0:S(t.response.errors)}function W(e){return m(e).replace("file:/","/").replace(/^\/?[A-Z]:/,"")}function L(e){return["EPERM: operation not permitted, scandir","EPERM: operation not permitted, rename","EACCES: permission denied","EPERM: operation not permitted, symlink","This version of npm supports the following node versions","EBUSY: resource busy or locked","ENOTEMPTY: directory not empty","getaddrinfo ENOTFOUND","Client network socket disconnected before secure TLS connection was established","spawn EPERM","socket hang up","The user aborted a request.","write EPIPE","Unsupported platform"].some(n=>e.includes(n))}export{I as a,T as b,_ as c,x as d,a as e,y as f,c as g,d as h,w as i,M as j,u as k,z as l,J as m,Q as n,W as o};
1
+ import{Eb as f,db as E,pb as h,xb as g}from"./chunk-RIG66DIQ.js";import{b as P}from"./chunk-YTUUU33R.js";import{d as m}from"./chunk-IWTNUJGY.js";import{e as O,g as i}from"./chunk-VKWPEFWQ.js";i();i();i();var R=new Set(["THROTTLED","429"]),b=new Set(["ACCESS_DENIED","access_denied"]);function I(e){return Array.isArray(e)?e.flatMap(t=>{let s=[],n=t,r=n?.extensions?.code;typeof r=="string"&&s.push(r);let o=n?.extensions?.app_errors?.errors;if(Array.isArray(o))for(let p of o){let l=p?.category;typeof l=="string"&&s.push(l)}return s}):[]}function T(e){return e!==void 0&&R.has(e)}function _(e){return e!==void 0&&b.has(e)}function S(e){return I(e).some(T)}i();var C=new Set([502,503,504]);function x(e){return e!==void 0&&C.has(e)}var A=O(P(),1),a;(function(e){e[e.Abort=0]="Abort",e[e.AbortSilent=1]="AbortSilent",e[e.Bug=2]="Bug"})(a||(a={}));var y=class extends Error{},c=class extends Error{tryMessage;type;nextSteps;formattedMessage;customSections;code;details;skipOclifErrorHandling;constructor(t,s,n=null,r,o){let p=typeof t=="string"||"value"in t;super(p?f(t):E(t)),n?n instanceof h?this.tryMessage=f(n):this.tryMessage=n:this.tryMessage=null,this.type=s,this.nextSteps=r,this.customSections=o,this.skipOclifErrorHandling=!0,p||(this.formattedMessage=t)}},d=class extends c{constructor(t,s=null,n,r){super(t,a.Abort,s,n,r)}},w=class extends c{command;args;constructor(t,s,n,r=null){super(t,a.Abort,r),this.command=s,this.args=n}},M=class extends c{constructor(){super("",a.AbortSilent)}},u=class extends c{constructor(t,s=null){super(t,a.Bug,s)}};async function z(e){let t;if(k(e))t=e;else if(typeof e=="string")t=new u(e);else if(e instanceof Error)t=new u(e.message),t.stack=e.stack;else{let o=e;t=new u(o?.message??"Unknown error"),o?.stack&&(t.stack=o?.stack)}let{jsonOutputEnabled:s}=await import("./environment-O7ECODHU.js"),{commandEventOutputMode:n}=await import("./command-event-context-LFUZ7UCA.js");if(s()||n()==="json"){let{renderFatalErrorAsJson:o}=await import("./json-error-C2U7ZLCG.js");return o(t),await g(),e}let{renderFatalError:r}=await import("./ui-MYUBVKCK.js");return r(t),Promise.resolve(e)}function J(e){if(e instanceof A.Errors.CLIError){let t=new d(e.message);return t.stack=e.stack,Promise.resolve(t)}else return Promise.resolve(e)}function k(e){try{return Object.prototype.hasOwnProperty.call(e,"type")}catch{return!1}}function Q(e){if(!k(e)){if(e instanceof Error){if(v(e))return!1;let t=e.message;return!L(t)}return!0}return e.type===a.Bug}function v(e){let t=e;if(typeof t.response!="object"||t.response===null||t.request===void 0)return!1;let s=t.response.status;return s===401||s===429||x(s)?!0:S(t.response.errors)}function W(e){return m(e).replace("file:/","/").replace(/^\/?[A-Z]:/,"")}function L(e){return["EPERM: operation not permitted, scandir","EPERM: operation not permitted, rename","EACCES: permission denied","EPERM: operation not permitted, symlink","This version of npm supports the following node versions","EBUSY: resource busy or locked","ENOTEMPTY: directory not empty","getaddrinfo ENOTFOUND","Client network socket disconnected before secure TLS connection was established","spawn EPERM","socket hang up","The user aborted a request.","write EPIPE","Unsupported platform"].some(n=>e.includes(n))}export{I as a,T as b,_ as c,x as d,a as e,y as f,c as g,d as h,w as i,M as j,u as k,z as l,J as m,Q as n,W as o};
@@ -1,3 +1,3 @@
1
- import{a as o,b as p,d as u}from"./chunk-IWEKM5Y3.js";import{p as f,v as c}from"./chunk-DJAZBPYA.js";import{b as d,c as l}from"./chunk-Q2SZCZE7.js";import{h as a}from"./chunk-2VSNFOKD.js";import{wb as m}from"./chunk-LWCTKI4Z.js";import{i as n}from"./chunk-FZCGRIOM.js";import{b as v}from"./chunk-YTUUU33R.js";import{e as F,g as s}from"./chunk-VKWPEFWQ.js";s();var h=F(v(),1),i=class extends c{static get jsonOutputSchema(){return o}static summary="Download metafields definitions from your shop into a local file.";static descriptionWithMarkdown=`Retrieves metafields from Shopify Admin.
1
+ import{a as o,b as p,d as u}from"./chunk-OQUXGAF2.js";import{p as f,v as c}from"./chunk-KT5QQOES.js";import{b as d,c as l}from"./chunk-5AWELO3D.js";import{h as a}from"./chunk-J7BTC45S.js";import{wb as m}from"./chunk-RIG66DIQ.js";import{i as n}from"./chunk-FZCGRIOM.js";import{b as v}from"./chunk-YTUUU33R.js";import{e as F,g as s}from"./chunk-VKWPEFWQ.js";s();var h=F(v(),1),i=class extends c{static get jsonOutputSchema(){return o}static summary="Download metafields definitions from your shop into a local file.";static descriptionWithMarkdown=`Retrieves metafields from Shopify Admin.
2
2
 
3
3
  If the metafields file already exists, it will be overwritten.`;static description=this.descriptionForHelp();static flags={...d,...l,...f,force:h.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"})};static multiEnvironmentsFlags=null;async command(e,b,w=!1){let y={path:e.path,password:e.password,store:e.store,force:e.force,verbose:e.verbose,noColor:e["no-color"]},t=await u(y);if(t.status==="failed"){let r=new a("Failed to fetch metafield definitions.","Check your connection and permissions, then try again.");throw r.details={failedOwnerTypes:t.failedOwnerTypes},r}return t.status==="downloaded"&&t.failedOwnerTypes.length>0&&(process.exitCode=1,e.json&&n({type:"diagnostic",level:"error",message:`Failed to fetch metafield definitions for: ${t.failedOwnerTypes.join(", ")}.`})),(!w||!e.json)&&p(t,e.json?"json":"text"),t}renderEnvironmentResults(e){m(o.encode({environments:e}))}};export{i as a};
@@ -1,4 +1,4 @@
1
- import{a as d,d as M,e as D,f as U}from"./chunk-7QUZWCJZ.js";import{a as E,b as T,c as L,f as $,j as R,k as N,m as P,t as j}from"./chunk-OGWPS55W.js";import{a as _}from"./chunk-ZGV3HNEV.js";import{a as q}from"./chunk-FWB3GLMW.js";import{S as O,u as I}from"./chunk-H4V55Y3Z.js";import{b as x,c as C}from"./chunk-Q2SZCZE7.js";import{A,C as S,H as F,z as g}from"./chunk-CZ22VZDA.js";import{k as B}from"./chunk-2VSNFOKD.js";import{Db as y,ba as h,ga as k,qb as p,sb as u,wb as v}from"./chunk-LWCTKI4Z.js";import{i as l}from"./chunk-B4OMIONW.js";import{b as Y}from"./chunk-YTUUU33R.js";import{e as K,g as s}from"./chunk-VKWPEFWQ.js";s();s();async function V(t){let{storeFqdn:o,operationId:e,remoteApp:n}=t,{adminSession:r,version:i}=await G(o,n),a=await R({adminSession:r,operationId:e,version:i});return{store:o,apiVersion:i,operationId:e,operation:a??null}}async function z(t){let{storeFqdn:o,remoteApp:e}=t,{adminSession:n,version:r}=await G(o,e),i=await N({adminSession:n,version:r});return{store:o,apiVersion:r,operations:i}}async function G(t,o){let e=o.apiSecretKeys[0]?.secret;if(!e)throw new B("No API secret keys found for app");let n=await O(t,o.apiKey,e),r=await $({adminSession:n,minimumDefaultVersion:E});return{adminSession:n,version:r}}s();function H(t,o){if(o==="json"){v(d.encode({...M(t),..."operation"in t?{operationGid:t.operationId,operation:t.operation?D(t.operation):null}:{operations:t.operations.map(D),pageInfo:{hasNextPage:t.operations.length<100?!1:null}}}));return}if("operation"in t){t.operation?W(t.operation):S({headline:"Bulk operation not found.",body:u`ID: ${p.yellow(t.operationId)}`.value});return}let e=t.operations.map(n=>({id:L(n.id),status:X(n.status),count:Z(n.objectCount),dateCreated:h(new Date(String(n.createdAt))),dateFinished:n.completedAt?h(new Date(String(n.completedAt))):"",results:tt(n.url??n.partialDataUrl)}));y(),e.length===0?g({body:"No bulk operations found in the last 7 days."}):F({rows:e,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),y()}function W(t){let{id:o,status:e,createdAt:n,completedAt:r,url:i,partialDataUrl:a}=t,c=P(t).value,J=Q(n,r),m=u`ID: ${p.yellow(o)}\n${J}`.value;if(e==="COMPLETED"){let f=i?p.link("Download results",i):"";A({headline:c,body:u`${m}\n${f}`.value})}else if(e==="FAILED"){let f=a?p.link("Download partial results",a):"";S({headline:c,body:u`${m}\n${f}`.value})}else g({headline:c,body:m})}function Q(t,o){let e=new Date;return o?`Finished ${k(new Date(String(o)),e)}`:`Started ${k(new Date(String(t)),e)}`}function X(t){return t==="COMPLETED"?l.green(t):t==="FAILED"?l.red(t):l.dim(t)}function Z(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:String(t)}function tt(t){return t?u`${p.link("download",t)}`.value:""}var b=K(Y(),1);var w=class t extends _{static summary="Check the status of bulk operations.";static descriptionWithMarkdown=`Check the status of a specific bulk operation by ID, or list all bulk operations belonging to this app on this store in the last 7 days.
1
+ import{a as d,d as M,e as D,f as U}from"./chunk-6Y6A2QGK.js";import{a as E,b as T,c as L,f as $,j as R,k as N,m as P,t as j}from"./chunk-5XOEMYEQ.js";import{a as _}from"./chunk-NPB753M3.js";import{a as q}from"./chunk-D4LFWIFE.js";import{S as O,u as I}from"./chunk-NCPZVARH.js";import{b as x,c as C}from"./chunk-5AWELO3D.js";import{A,C as S,H as F,z as g}from"./chunk-V654BMS7.js";import{k as B}from"./chunk-J7BTC45S.js";import{Db as y,ba as h,ga as k,qb as p,sb as u,wb as v}from"./chunk-RIG66DIQ.js";import{i as l}from"./chunk-B4OMIONW.js";import{b as Y}from"./chunk-YTUUU33R.js";import{e as K,g as s}from"./chunk-VKWPEFWQ.js";s();s();async function V(t){let{storeFqdn:o,operationId:e,remoteApp:n}=t,{adminSession:r,version:i}=await G(o,n),a=await R({adminSession:r,operationId:e,version:i});return{store:o,apiVersion:i,operationId:e,operation:a??null}}async function z(t){let{storeFqdn:o,remoteApp:e}=t,{adminSession:n,version:r}=await G(o,e),i=await N({adminSession:n,version:r});return{store:o,apiVersion:r,operations:i}}async function G(t,o){let e=o.apiSecretKeys[0]?.secret;if(!e)throw new B("No API secret keys found for app");let n=await O(t,o.apiKey,e),r=await $({adminSession:n,minimumDefaultVersion:E});return{adminSession:n,version:r}}s();function H(t,o){if(o==="json"){v(d.encode({...M(t),..."operation"in t?{operationGid:t.operationId,operation:t.operation?D(t.operation):null}:{operations:t.operations.map(D),pageInfo:{hasNextPage:t.operations.length<100?!1:null}}}));return}if("operation"in t){t.operation?W(t.operation):S({headline:"Bulk operation not found.",body:u`ID: ${p.yellow(t.operationId)}`.value});return}let e=t.operations.map(n=>({id:L(n.id),status:X(n.status),count:Z(n.objectCount),dateCreated:h(new Date(String(n.createdAt))),dateFinished:n.completedAt?h(new Date(String(n.completedAt))):"",results:tt(n.url??n.partialDataUrl)}));y(),e.length===0?g({body:"No bulk operations found in the last 7 days."}):F({rows:e,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),y()}function W(t){let{id:o,status:e,createdAt:n,completedAt:r,url:i,partialDataUrl:a}=t,c=P(t).value,J=Q(n,r),m=u`ID: ${p.yellow(o)}\n${J}`.value;if(e==="COMPLETED"){let f=i?p.link("Download results",i):"";A({headline:c,body:u`${m}\n${f}`.value})}else if(e==="FAILED"){let f=a?p.link("Download partial results",a):"";S({headline:c,body:u`${m}\n${f}`.value})}else g({headline:c,body:m})}function Q(t,o){let e=new Date;return o?`Finished ${k(new Date(String(o)),e)}`:`Started ${k(new Date(String(t)),e)}`}function X(t){return t==="COMPLETED"?l.green(t):t==="FAILED"?l.red(t):l.dim(t)}function Z(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:String(t)}function tt(t){return t?u`${p.link("download",t)}`.value:""}var b=K(Y(),1);var w=class t extends _{static summary="Check the status of bulk operations.";static descriptionWithMarkdown=`Check the status of a specific bulk operation by ID, or list all bulk operations belonging to this app on this store in the last 7 days.
2
2
 
3
3
  Bulk operations allow you to process large amounts of data asynchronously. Learn more about [bulk query operations](https://shopify.dev/docs/api/usage/bulk-operations/queries) and [bulk mutation operations](https://shopify.dev/docs/api/usage/bulk-operations/imports).
4
4
 
@@ -1 +1 @@
1
- import{a as s}from"./chunk-EXFBZPZS.js";import{a as e}from"./chunk-7MVWDCI3.js";import{a as o}from"./chunk-Q66CI37F.js";import{b as i}from"./chunk-ZQDDRIBA.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class extends i{static description="View all the available UI kit components";static hiddenAliases=["kitchen-sink all"];static hidden=!0;async run(){await o(),await e(),await s()}};export{t as a};
1
+ import{a as s}from"./chunk-3JACWBUC.js";import{a as e}from"./chunk-OPVXPDOQ.js";import{a as o}from"./chunk-5AQ5JT2V.js";import{b as i}from"./chunk-OLKLHVHA.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class extends i{static description="View all the available UI kit components";static hiddenAliases=["kitchen-sink all"];static hidden=!0;async run(){await o(),await e(),await s()}};export{t as a};
@@ -1 +1 @@
1
- import{U as m}from"./chunk-CZ22VZDA.js";import{h as c}from"./chunk-2VSNFOKD.js";import{Bb as a,qb as l,sb as n}from"./chunk-LWCTKI4Z.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();import{createServer as d}from"net";var u=new Set;async function P(o,t){if(o&&await g(o))return a(n`Port ${o.toString()} is free`),o;a(n`Getting a random port...`);let r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);for(let e=0;e<(t?.maxTries??5)&&u.has(r);e++)r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);return a(n`Random port obtained: ${l.raw(`${r}`)}`),u.add(r),r}async function g(o){return new Promise(t=>{let r=d();r.unref(),r.once("error",()=>t(!1));try{r.listen(o,"localhost",()=>{r.close(()=>t(!0))})}catch(e){if(!(e instanceof RangeError))throw e;t(!1)}})}function f(){return new Promise((o,t)=>{let r=d();r.unref(),r.once("error",t),r.listen(0,"localhost",()=>{let e=r.address();if(e&&typeof e=="object"){let i=e.port;r.close(()=>o(i))}else r.close(()=>t(new Error("Unable to determine assigned port")))})})}async function w(o,t=5,r=1){let e=1;for(;;)try{return await o()}catch(i){if(e++<t)a(n`Unknown problem getting a random port: ${i.message}`),await m(r);else throw new c(i.message)}}export{P as a,g as b};
1
+ import{U as m}from"./chunk-V654BMS7.js";import{h as c}from"./chunk-J7BTC45S.js";import{Bb as a,qb as l,sb as n}from"./chunk-RIG66DIQ.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();import{createServer as d}from"net";var u=new Set;async function P(o,t){if(o&&await g(o))return a(n`Port ${o.toString()} is free`),o;a(n`Getting a random port...`);let r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);for(let e=0;e<(t?.maxTries??5)&&u.has(r);e++)r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);return a(n`Random port obtained: ${l.raw(`${r}`)}`),u.add(r),r}async function g(o){return new Promise(t=>{let r=d();r.unref(),r.once("error",()=>t(!1));try{r.listen(o,"localhost",()=>{r.close(()=>t(!0))})}catch(e){if(!(e instanceof RangeError))throw e;t(!1)}})}function f(){return new Promise((o,t)=>{let r=d();r.unref(),r.once("error",t),r.listen(0,"localhost",()=>{let e=r.address();if(e&&typeof e=="object"){let i=e.port;r.close(()=>o(i))}else r.close(()=>t(new Error("Unable to determine assigned port")))})})}async function w(o,t=5,r=1){let e=1;for(;;)try{return await o()}catch(i){if(e++<t)a(n`Unknown problem getting a random port: ${i.message}`),await m(r);else throw new c(i.message)}}export{P as a,g as b};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-XNNKLUTN.js";import{a as t}from"./chunk-OQ5CLM2H.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var a=class extends t{static hidden=!0;static flags={...t.flags};static baseFlags={...t.baseFlags};async run(){return r({from:"app import-custom-data-definitions",to:"app import custom-data-definitions"}),super.run()}};export{a};
1
+ import{a as r}from"./chunk-ETXBF6Q7.js";import{a as t}from"./chunk-UDPYSL3M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var a=class extends t{static hidden=!0;static flags={...t.flags};static baseFlags={...t.baseFlags};async run(){return r({from:"app import-custom-data-definitions",to:"app import custom-data-definitions"}),super.run()}};export{a};
@@ -1,4 +1,4 @@
1
- import{a as N,b as c,c as S}from"./chunk-HF4NDEX3.js";import{a as O}from"./chunk-6PUU6ZNQ.js";import{a as w}from"./chunk-PSSYLJG4.js";import{a as E}from"./chunk-P33TONYG.js";import{e as g}from"./chunk-QFWWCZOI.js";import{f as R,o as F}from"./chunk-5TB52UUV.js";import{p as v,v as T}from"./chunk-DJAZBPYA.js";import{b as u,c as d,f}from"./chunk-Q2SZCZE7.js";import{A as l}from"./chunk-CZ22VZDA.js";import{wb as h}from"./chunk-LWCTKI4Z.js";import{b as r}from"./chunk-FZCGRIOM.js";import{b as j}from"./chunk-YTUUU33R.js";import{e as _,g as m}from"./chunk-VKWPEFWQ.js";m();m();var x=O.extend({originalName:r.string(),theme:N}),a=g({name:"ThemeRenameResult",schema:r.object({status:r.literal("success"),changed:r.boolean(),originalName:r.string(),theme:c}).strict(),definitions:{Theme:c},project(t){let e=x.parse(t);return{status:e.status,changed:e.originalName!==e.theme.name,originalName:e.originalName,theme:S(e.theme)}}});m();function y(t,e,n){if(e==="json"){h(a.encode(t.data));return}l({body:[...n?[{subdued:`Environment: ${n}
1
+ import{a as N,b as c,c as S}from"./chunk-HF4NDEX3.js";import{a as O}from"./chunk-6PUU6ZNQ.js";import{a as w}from"./chunk-AQ34X5B3.js";import{a as E}from"./chunk-63UKZLPC.js";import{e as g}from"./chunk-QFWWCZOI.js";import{f as R,o as F}from"./chunk-2NZ7GDDR.js";import{p as v,v as T}from"./chunk-KT5QQOES.js";import{b as u,c as d,f}from"./chunk-5AWELO3D.js";import{A as l}from"./chunk-V654BMS7.js";import{wb as h}from"./chunk-RIG66DIQ.js";import{b as r}from"./chunk-FZCGRIOM.js";import{b as j}from"./chunk-YTUUU33R.js";import{e as _,g as m}from"./chunk-VKWPEFWQ.js";m();m();var x=O.extend({originalName:r.string(),theme:N}),a=g({name:"ThemeRenameResult",schema:r.object({status:r.literal("success"),changed:r.boolean(),originalName:r.string(),theme:c}).strict(),definitions:{Theme:c},project(t){let e=x.parse(t);return{status:e.status,changed:e.originalName!==e.theme.name,originalName:e.originalName,theme:S(e.theme)}}});m();function y(t,e,n){if(e==="json"){h(a.encode(t.data));return}l({body:[...n?[{subdued:`Environment: ${n}
2
2
 
3
3
  `}]:[],"The theme",...w(t.originalTheme),"was renamed to",`'${t.requestedName}'`]})}m();async function I(t,e){let n=t.name??await R("New name for the theme"),o=await E(e,{header:"Select a theme to rename",filter:{theme:t.theme,development:t.development,live:t.live}}),s=await F(o.id,{name:n},e);return{data:{status:"success",originalName:o.name,theme:{...s,processing:o.processing,shop:e.storeFqdn}},originalTheme:o,requestedName:n}}var i=_(j(),1);var p=class extends T{static get jsonOutputSchema(){return a}static summary="Renames an existing theme.";static descriptionWithMarkdown=`Renames a theme in your store.
4
4
 
@@ -1 +1 @@
1
- import{a as o}from"./chunk-Q66CI37F.js";import{b as e}from"./chunk-ZQDDRIBA.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var t=class extends e{static description="View the UI kit components that display static output";static hidden=!0;async run(){await o()}};export{t as a};
1
+ import{a as o}from"./chunk-5AQ5JT2V.js";import{b as e}from"./chunk-OLKLHVHA.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var t=class extends e{static description="View the UI kit components that display static output";static hidden=!0;async run(){await o()}};export{t as a};