@shopify/cli 4.6.1 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. package/dist/analytics-6LI5GLWS.js +1 -0
  2. package/dist/analytics-UNRIIG4Y.js +1 -0
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-LURVEPYP.js → chunk-2CYVZUYT.js} +1 -1
  5. package/dist/{chunk-BDDROQGK.js → chunk-2HK4MFWP.js} +3 -3
  6. package/dist/chunk-2JDCVEFK.js +1 -0
  7. package/dist/chunk-2SZOPJYI.js +1 -0
  8. package/dist/chunk-2U4P6UFZ.js +6 -0
  9. package/dist/{chunk-EVIO6OWW.js → chunk-2WJAAJVX.js} +1 -1
  10. package/dist/chunk-37TEEITE.js +2 -0
  11. package/dist/chunk-3K6VHXC2.js +4 -0
  12. package/dist/chunk-4HV6A6UH.js +8 -0
  13. package/dist/chunk-4JY2P2A5.js +1 -0
  14. package/dist/chunk-4LRG5YBS.js +3 -0
  15. package/dist/chunk-4W3UE2ZI.js +1 -0
  16. package/dist/chunk-5CADTCJE.js +25 -0
  17. package/dist/chunk-5CR5YJTU.js +11 -0
  18. package/dist/chunk-5CYJG63I.js +1 -0
  19. package/dist/chunk-5HBIIYSK.js +1 -0
  20. package/dist/chunk-5HPBQ6U5.js +1 -0
  21. package/dist/chunk-5NO5OXYP.js +15 -0
  22. package/dist/chunk-63CIFL36.js +6 -0
  23. package/dist/chunk-6EBLULOC.js +1 -0
  24. package/dist/{chunk-5QDM4XIK.js → chunk-6ENBE43F.js} +1 -1
  25. package/dist/chunk-6OFGSZD6.js +1 -0
  26. package/dist/chunk-6PDR2IUL.js +11 -0
  27. package/dist/chunk-6VGJVXZI.js +3 -0
  28. package/dist/{chunk-YHH3JA36.js → chunk-6VRXGEIW.js} +1 -1
  29. package/dist/chunk-6WZYX5RO.js +1 -0
  30. package/dist/chunk-7AALWJAO.js +7 -0
  31. package/dist/chunk-7DOWT5JZ.js +20 -0
  32. package/dist/chunk-7JIQXGDE.js +9 -0
  33. package/dist/chunk-7MHANY34.js +1 -0
  34. package/dist/chunk-7WTNEG2F.js +3 -0
  35. package/dist/chunk-7Y7AZRL3.js +10 -0
  36. package/dist/chunk-ACTDYTAV.js +317 -0
  37. package/dist/{chunk-Y2PC2BBJ.js → chunk-AEUCDGTB.js} +4 -4
  38. package/dist/chunk-AGOEROAI.js +10 -0
  39. package/dist/{chunk-DC7TXY4K.js → chunk-AH2ZGMDM.js} +1 -1
  40. package/dist/chunk-AMLWPYNA.js +4 -0
  41. package/dist/chunk-B4OMIONW.js +5 -0
  42. package/dist/chunk-BR6DBMQA.js +5 -0
  43. package/dist/chunk-CFWHR74L.js +1 -0
  44. package/dist/chunk-CHMEDVDZ.js +15 -0
  45. package/dist/chunk-CIH6LPTG.js +6 -0
  46. package/dist/chunk-CMYQXGLO.js +1 -0
  47. package/dist/chunk-CTRXLZAJ.js +1 -0
  48. package/dist/{chunk-NVQOAHID.js → chunk-CYOFLJ3Z.js} +1 -1
  49. package/dist/{chunk-P2P2MAZQ.js → chunk-CZJZCJRX.js} +1 -1
  50. package/dist/chunk-CZPGC2E7.js +1 -0
  51. package/dist/{chunk-UTK6V2NE.js → chunk-D2K2ZBKH.js} +8 -8
  52. package/dist/chunk-DHU57LKD.js +1 -0
  53. package/dist/chunk-DKL6N3L2.js +1 -0
  54. package/dist/chunk-DMXQLI35.js +1 -0
  55. package/dist/chunk-DPNZWBT5.js +1 -0
  56. package/dist/{chunk-LDWMX3KZ.js → chunk-DQCIORGH.js} +1 -1
  57. package/dist/chunk-DQFSKPKL.js +6 -0
  58. package/dist/{chunk-RMF3YNWE.js → chunk-E2W5OYYM.js} +1 -1
  59. package/dist/chunk-E5T4YRGW.js +1 -0
  60. package/dist/chunk-EOMCXBCS.js +5 -0
  61. package/dist/{chunk-GD5IRJBE.js → chunk-EW55WWT7.js} +1 -1
  62. package/dist/{chunk-7EE7YOCR.js → chunk-F5HCSUXC.js} +5 -5
  63. package/dist/{chunk-WOYI6SDK.js → chunk-FCGKO2KY.js} +1 -1
  64. package/dist/{chunk-J3D4KQOQ.js → chunk-FULWTZS6.js} +1 -1
  65. package/dist/chunk-FWPJEL6Q.js +3 -0
  66. package/dist/chunk-GKOBFX4A.js +1 -0
  67. package/dist/chunk-GLWQMLUC.js +1 -0
  68. package/dist/chunk-GMTNOCMS.js +375 -0
  69. package/dist/chunk-GSCWZR22.js +1 -0
  70. package/dist/chunk-GZ64KWHX.js +8 -0
  71. package/dist/{chunk-EZBB2ULE.js → chunk-H5KWM27L.js} +1 -1
  72. package/dist/chunk-HHVHVGRT.js +1 -0
  73. package/dist/{chunk-LXOBW4AW.js → chunk-HLNJL4B6.js} +1 -1
  74. package/dist/{chunk-U3P5TIIR.js → chunk-HZIX3DIT.js} +1 -1
  75. package/dist/chunk-I3N6NPHF.js +2 -0
  76. package/dist/chunk-JD5P5RAJ.js +1 -0
  77. package/dist/chunk-JJJTPEMD.js +1 -0
  78. package/dist/{chunk-KRZABRYT.js → chunk-JLGA3B7P.js} +1 -1
  79. package/dist/chunk-JQ2B3VHR.js +7 -0
  80. package/dist/{chunk-STCLJWHD.js → chunk-JQISGC7D.js} +1 -1
  81. package/dist/chunk-JQVXH26X.js +6 -0
  82. package/dist/{chunk-PCTVUTV3.js → chunk-JUKAWTYY.js} +1 -1
  83. package/dist/{chunk-XZ2KUBFJ.js → chunk-JZMRBJH3.js} +2 -2
  84. package/dist/chunk-JZXA3H5K.js +1 -0
  85. package/dist/chunk-K4KTNINH.js +1 -0
  86. package/dist/chunk-KCS75ZM4.js +1 -0
  87. package/dist/{chunk-WE3VLC2S.js → chunk-KIYHEMHD.js} +7 -7
  88. package/dist/chunk-KK24VGVE.js +6 -0
  89. package/dist/{chunk-7TXWKLPY.js → chunk-KOVAFUYN.js} +1 -1
  90. package/dist/{chunk-NENUUNWB.js → chunk-KUNDCAQN.js} +1 -1
  91. package/dist/{chunk-NKBSS7YL.js → chunk-L67BU25M.js} +1 -1
  92. package/dist/{chunk-6HQMZ324.js → chunk-LDF4PQ3B.js} +18 -18
  93. package/dist/chunk-LFOBYEWG.js +1 -0
  94. package/dist/chunk-LJM2DUXN.js +1 -0
  95. package/dist/{chunk-XWPPBOGF.js → chunk-LQ7ENG4V.js} +1 -1
  96. package/dist/chunk-LQCR4TGH.js +3 -0
  97. package/dist/{chunk-QARALFHD.js → chunk-LRQYUWWB.js} +1 -1
  98. package/dist/{chunk-YR7K4NQT.js → chunk-LWJA2DQG.js} +1 -1
  99. package/dist/{chunk-NKT5U6IJ.js → chunk-LZ3GZ7NS.js} +1 -1
  100. package/dist/chunk-MB7E5GEY.js +2 -0
  101. package/dist/{chunk-7MD5MIGN.js → chunk-MLZLDL6B.js} +8 -8
  102. package/dist/chunk-MRCWOOSF.js +8 -0
  103. package/dist/chunk-N6YTJXIS.js +18 -0
  104. package/dist/chunk-NEMPLS7C.js +1 -0
  105. package/dist/chunk-OE3F7XXU.js +4 -0
  106. package/dist/chunk-OORWOTAP.js +3 -0
  107. package/dist/chunk-OUZGGWFN.js +1 -0
  108. package/dist/chunk-P5MNNBSO.js +1 -0
  109. package/dist/chunk-PAAKBWSF.js +1 -0
  110. package/dist/{chunk-M5YGJYNI.js → chunk-PANGX7SA.js} +1 -1
  111. package/dist/{chunk-7L5AIZOP.js → chunk-PIFW2R3S.js} +1 -1
  112. package/dist/chunk-PWSI275S.js +7 -0
  113. package/dist/chunk-Q5DQGV3M.js +1 -0
  114. package/dist/chunk-QBIVQXUJ.js +6 -0
  115. package/dist/chunk-QEB3HUQE.js +19 -0
  116. package/dist/{chunk-C7LFLIRT.js → chunk-QKGZWOOY.js} +1 -1
  117. package/dist/chunk-QPWMD2VR.js +1 -0
  118. package/dist/chunk-QRT4A2RV.js +3 -0
  119. package/dist/chunk-QXHENYJH.js +2 -0
  120. package/dist/{chunk-GJEG7VGX.js → chunk-QZBSCOJV.js} +1 -1
  121. package/dist/chunk-R2R6JDNH.js +1 -0
  122. package/dist/chunk-RUFQCXBX.js +16 -0
  123. package/dist/chunk-RY2SJVWM.js +12 -0
  124. package/dist/chunk-RZFBGBNA.js +1 -0
  125. package/dist/chunk-S3P5WWJD.js +1 -0
  126. package/dist/chunk-SEVSMWNX.js +1 -0
  127. package/dist/chunk-SJMTETSU.js +32 -0
  128. package/dist/chunk-SSJGWLCW.js +28 -0
  129. package/dist/chunk-SYADOUBB.js +7 -0
  130. package/dist/chunk-T5JXQ7KO.js +1 -0
  131. package/dist/chunk-TCTVI6PK.js +1 -0
  132. package/dist/chunk-TSLQZTXR.js +1 -0
  133. package/dist/chunk-TTAPXLI5.js +1 -0
  134. package/dist/{chunk-MMP3F6LO.js → chunk-TY4W7AYX.js} +1 -1
  135. package/dist/chunk-TYIGOVRQ.js +3 -0
  136. package/dist/{chunk-W2357IN2.js → chunk-U2Z5NMXV.js} +1 -1
  137. package/dist/{chunk-X5RH4ALT.js → chunk-U6HYEGAE.js} +1 -1
  138. package/dist/chunk-U7R6LYPJ.js +5 -0
  139. package/dist/chunk-UPJLZHHR.js +4 -0
  140. package/dist/chunk-UVQL7RUY.js +1 -0
  141. package/dist/chunk-V2HCVJYF.js +1 -0
  142. package/dist/chunk-V5SC2RYQ.js +2 -0
  143. package/dist/chunk-VKSR6MJG.js +2 -0
  144. package/dist/chunk-VRVP2GQL.js +5 -0
  145. package/dist/{chunk-MY2H5XPY.js → chunk-WCRZJY3P.js} +1 -1
  146. package/dist/{chunk-LJZIIURR.js → chunk-WHLGNDRE.js} +1 -1
  147. package/dist/{chunk-HVMEBH24.js → chunk-WKUGSFTB.js} +3 -3
  148. package/dist/chunk-X4XP2RQJ.js +1 -0
  149. package/dist/chunk-XAOYKECS.js +1 -0
  150. package/dist/chunk-XCBEYRQI.js +3 -0
  151. package/dist/chunk-XHZ5BWXL.js +5 -0
  152. package/dist/{chunk-H5I7BSNG.js → chunk-XLURZ6GL.js} +52 -52
  153. package/dist/chunk-XRT2W5Y2.js +10 -0
  154. package/dist/chunk-XUEMMLXK.js +1 -0
  155. package/dist/chunk-Y34LWI3S.js +19 -0
  156. package/dist/chunk-YHPBDS52.js +16 -0
  157. package/dist/{chunk-5INBKZRD.js → chunk-YIZZ5LZN.js} +1 -1
  158. package/dist/chunk-YN6A26QL.js +836 -0
  159. package/dist/chunk-YOO7DLOT.js +1 -0
  160. package/dist/chunk-YUVE2I3C.js +1 -0
  161. package/dist/chunk-YY6TFARF.js +1 -0
  162. package/dist/chunk-Z5K4J7HQ.js +1 -0
  163. package/dist/chunk-ZCNIR6YU.js +1 -0
  164. package/dist/{chunk-K4M32VKU.js → chunk-ZO74GSWC.js} +1 -1
  165. package/dist/{chunk-FBVNXRVB.js → chunk-ZRLEAF7M.js} +1 -1
  166. package/dist/chunk-ZSFAURIH.js +3 -0
  167. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  168. package/dist/cli/commands/app/build.js +1 -1
  169. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  170. package/dist/cli/commands/app/bulk/execute.js +1 -1
  171. package/dist/cli/commands/app/bulk/status.js +1 -1
  172. package/dist/cli/commands/app/config/link.js +1 -1
  173. package/dist/cli/commands/app/config/pull.js +1 -1
  174. package/dist/cli/commands/app/config/use.js +1 -1
  175. package/dist/cli/commands/app/config/validate.js +1 -1
  176. package/dist/cli/commands/app/demo/watcher.js +1 -1
  177. package/dist/cli/commands/app/deploy.js +1 -1
  178. package/dist/cli/commands/app/dev/clean.js +1 -1
  179. package/dist/cli/commands/app/dev.js +1 -1
  180. package/dist/cli/commands/app/env/pull.js +1 -1
  181. package/dist/cli/commands/app/env/show.js +1 -1
  182. package/dist/cli/commands/app/execute.js +1 -1
  183. package/dist/cli/commands/app/function/build.js +1 -1
  184. package/dist/cli/commands/app/function/info.js +1 -1
  185. package/dist/cli/commands/app/function/replay.js +1 -1
  186. package/dist/cli/commands/app/function/run.js +1 -1
  187. package/dist/cli/commands/app/function/schema.js +1 -1
  188. package/dist/cli/commands/app/function/typegen.js +1 -1
  189. package/dist/cli/commands/app/generate/extension.js +1 -1
  190. package/dist/cli/commands/app/graphiql.js +1 -1
  191. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  192. package/dist/cli/commands/app/import-extensions.js +1 -1
  193. package/dist/cli/commands/app/info.js +1 -1
  194. package/dist/cli/commands/app/init.js +1 -1
  195. package/dist/cli/commands/app/logs.js +1 -1
  196. package/dist/cli/commands/app/release.js +1 -1
  197. package/dist/cli/commands/app/versions/list.js +1 -1
  198. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  199. package/dist/cli/commands/auth/login.js +1 -1
  200. package/dist/cli/commands/auth/logout.js +1 -1
  201. package/dist/cli/commands/cache/clear.js +1 -1
  202. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  203. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  204. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  205. package/dist/cli/commands/debug/command-flags.js +1 -1
  206. package/dist/cli/commands/doc/fetch.js +1 -1
  207. package/dist/cli/commands/doc/search.js +1 -1
  208. package/dist/cli/commands/docs/generate.js +1 -1
  209. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  210. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  211. package/dist/cli/commands/help.js +1 -1
  212. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  213. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  214. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  215. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  216. package/dist/cli/commands/notifications/generate.js +1 -1
  217. package/dist/cli/commands/notifications/list.js +1 -1
  218. package/dist/cli/commands/organization/list.js +1 -1
  219. package/dist/cli/commands/search.js +1 -1
  220. package/dist/cli/commands/send-analytics.d.ts +5 -0
  221. package/dist/cli/commands/send-analytics.js +1 -0
  222. package/dist/cli/commands/theme/check.js +1 -1
  223. package/dist/cli/commands/theme/console.js +1 -1
  224. package/dist/cli/commands/theme/delete.js +1 -1
  225. package/dist/cli/commands/theme/dev.js +1 -1
  226. package/dist/cli/commands/theme/duplicate.js +1 -1
  227. package/dist/cli/commands/theme/info.js +1 -1
  228. package/dist/cli/commands/theme/init.js +1 -1
  229. package/dist/cli/commands/theme/language-server.js +1 -1
  230. package/dist/cli/commands/theme/list.js +1 -1
  231. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  232. package/dist/cli/commands/theme/open.js +1 -1
  233. package/dist/cli/commands/theme/package.js +1 -1
  234. package/dist/cli/commands/theme/preview.js +1 -1
  235. package/dist/cli/commands/theme/profile.js +1 -1
  236. package/dist/cli/commands/theme/publish.js +1 -1
  237. package/dist/cli/commands/theme/pull.js +1 -1
  238. package/dist/cli/commands/theme/push.js +1 -1
  239. package/dist/cli/commands/theme/rename.js +1 -1
  240. package/dist/cli/commands/theme/share.js +1 -1
  241. package/dist/cli/commands/upgrade.js +1 -1
  242. package/dist/cli/commands/version.js +1 -1
  243. package/dist/cli/help.js +1 -1
  244. package/dist/cli/services/doctor-release/theme/tests/init.js +4 -8
  245. package/dist/cli/services/doctor-release/theme/tests/push.js +3 -4
  246. package/dist/command-registry.js +1 -1
  247. package/dist/conf-store-OAGJBITE.js +1 -0
  248. package/dist/custom-oclif-loader-BWAMUFQ4.js +1 -0
  249. package/dist/deprecations-K3NPRKBF.js +1 -0
  250. package/dist/dist-EXJEE23W.js +1 -0
  251. package/dist/dist-S62Z6IFV.js +1 -0
  252. package/dist/environments-ALH2N36U.js +1 -0
  253. package/dist/error-YX56C43A.js +1 -0
  254. package/dist/error-handler-FDCH72NH.js +1 -0
  255. package/dist/fs-SKHQZZTQ.js +1 -0
  256. package/dist/hooks/did-you-mean.js +1 -1
  257. package/dist/hooks/hydrogen-init.js +1 -1
  258. package/dist/hooks/postrun.js +1 -1
  259. package/dist/hooks/prerun.js +2 -1
  260. package/dist/hooks/public-metadata.js +1 -1
  261. package/dist/hooks/sensitive-metadata.js +1 -1
  262. package/dist/hooks/tunnel-provider.js +1 -1
  263. package/dist/hooks/tunnel-start.js +1 -1
  264. package/dist/index.d.ts +1 -1
  265. package/dist/index.js +15 -15
  266. package/dist/is-global-V5VORI3F.js +1 -0
  267. package/dist/lib-M72BVWQ3.js +1 -0
  268. package/dist/local-GX5AN6ZS.js +1 -0
  269. package/dist/metadata-XUJUTBTB.js +1 -0
  270. package/dist/{morph-ABSWZEVT.js → morph-77RHJICZ.js} +1 -1
  271. package/dist/node-package-manager-3WIYU7Y3.js +1 -0
  272. package/dist/notifications-system-RHULO564.js +1 -0
  273. package/dist/os-M6X7KOR4.js +1 -0
  274. package/dist/output-X47P6ICP.js +1 -0
  275. package/dist/{prettier-6ZMB2MMO.js → prettier-RVUAAWC7.js} +1 -1
  276. package/dist/system-SR5G7WEW.js +1 -0
  277. package/dist/tsconfig.tsbuildinfo +1 -1
  278. package/dist/ui-VYWSLAQ6.js +1 -0
  279. package/dist/upgrade-PFQ7JMXG.js +1 -0
  280. package/dist/version-FK4ETQ22.js +1 -0
  281. package/dist/version-U4GM2LNG.js +1 -0
  282. package/dist/workerd-NAPS5TA7.js +18 -0
  283. package/oclif.manifest.json +146 -120
  284. package/package.json +7 -8
  285. package/dist/analytics-3ICKUTK2.js +0 -1
  286. package/dist/analytics-73NVZI4Z.js +0 -1
  287. package/dist/chunk-25Z36VJG.js +0 -1
  288. package/dist/chunk-2AVFG5KT.js +0 -1
  289. package/dist/chunk-2DMTEIS3.js +0 -2
  290. package/dist/chunk-2GB3EAD3.js +0 -153
  291. package/dist/chunk-2NB4P6BB.js +0 -5
  292. package/dist/chunk-2OYQHHKC.js +0 -3
  293. package/dist/chunk-2VJKXWLG.js +0 -4
  294. package/dist/chunk-3Q5ESVIY.js +0 -1
  295. package/dist/chunk-3XCIUG5P.js +0 -1
  296. package/dist/chunk-445NFHXL.js +0 -3
  297. package/dist/chunk-4BPFJDH3.js +0 -1
  298. package/dist/chunk-4E5RGEJO.js +0 -1
  299. package/dist/chunk-4IHSAT76.js +0 -2
  300. package/dist/chunk-4TANJ4JK.js +0 -1
  301. package/dist/chunk-534U3DKZ.js +0 -6
  302. package/dist/chunk-56T6YCU2.js +0 -1
  303. package/dist/chunk-5HJTCBBV.js +0 -317
  304. package/dist/chunk-5Q4WAGQL.js +0 -3
  305. package/dist/chunk-65CEF3SM.js +0 -8
  306. package/dist/chunk-6KAWCN3I.js +0 -10
  307. package/dist/chunk-6ZPHB5U2.js +0 -3
  308. package/dist/chunk-7AWKXTNS.js +0 -4
  309. package/dist/chunk-7US4TVO2.js +0 -32
  310. package/dist/chunk-A4SBXDZB.js +0 -14
  311. package/dist/chunk-A7IDVXF7.js +0 -1
  312. package/dist/chunk-AFM3UZQO.js +0 -684
  313. package/dist/chunk-AHLNB45E.js +0 -3
  314. package/dist/chunk-ARCAYYRW.js +0 -1
  315. package/dist/chunk-B3U6GDHL.js +0 -7
  316. package/dist/chunk-BCZMDFI2.js +0 -370
  317. package/dist/chunk-BKJMVAI7.js +0 -1
  318. package/dist/chunk-BPDUBZMU.js +0 -1
  319. package/dist/chunk-BQOKTPUU.js +0 -1
  320. package/dist/chunk-CELVG4AL.js +0 -6
  321. package/dist/chunk-CNI7ZUST.js +0 -3
  322. package/dist/chunk-CONJQV7M.js +0 -11
  323. package/dist/chunk-CV5ELBVU.js +0 -1
  324. package/dist/chunk-DXUISRMZ.js +0 -2
  325. package/dist/chunk-EHV7EKB3.js +0 -2
  326. package/dist/chunk-EJDWYASP.js +0 -1
  327. package/dist/chunk-EQNJ2NQD.js +0 -3
  328. package/dist/chunk-FG5QXIQH.js +0 -9
  329. package/dist/chunk-FGG6HXIZ.js +0 -1
  330. package/dist/chunk-FJCZ4F6J.js +0 -5
  331. package/dist/chunk-FKH5ZF2C.js +0 -1
  332. package/dist/chunk-GT6BJ2GK.js +0 -1
  333. package/dist/chunk-GWNV44NZ.js +0 -18
  334. package/dist/chunk-GXO2RRV2.js +0 -1
  335. package/dist/chunk-H5YC3EP6.js +0 -16
  336. package/dist/chunk-HY3INWPI.js +0 -1
  337. package/dist/chunk-I6ST5X56.js +0 -1
  338. package/dist/chunk-ID6ASBGV.js +0 -15
  339. package/dist/chunk-IDQT2UY7.js +0 -1
  340. package/dist/chunk-IIOFR25P.js +0 -3
  341. package/dist/chunk-IJEDTDSJ.js +0 -25
  342. package/dist/chunk-ILICQWUF.js +0 -1
  343. package/dist/chunk-IMWEC6NF.js +0 -16
  344. package/dist/chunk-ITNFDLZ4.js +0 -1
  345. package/dist/chunk-IU5U6KKO.js +0 -4
  346. package/dist/chunk-IXCDFXMB.js +0 -2
  347. package/dist/chunk-JRTJZAFJ.js +0 -19
  348. package/dist/chunk-JT7YTXJ7.js +0 -1
  349. package/dist/chunk-JX4HSDDG.js +0 -28
  350. package/dist/chunk-K5GJNXDK.js +0 -1
  351. package/dist/chunk-KCNOFNS5.js +0 -11
  352. package/dist/chunk-KM2R6O7V.js +0 -6
  353. package/dist/chunk-KNFDN3AP.js +0 -1
  354. package/dist/chunk-LEDVV6XK.js +0 -1
  355. package/dist/chunk-LEEVJH4B.js +0 -1
  356. package/dist/chunk-MDQHEW7V.js +0 -8
  357. package/dist/chunk-MPYCIVRA.js +0 -7
  358. package/dist/chunk-N4RYVOXT.js +0 -2
  359. package/dist/chunk-NB6HHZ36.js +0 -1
  360. package/dist/chunk-NEK2KNKR.js +0 -8
  361. package/dist/chunk-NJONAV7V.js +0 -1
  362. package/dist/chunk-OHQTOHUX.js +0 -15
  363. package/dist/chunk-PKR6HS4T.js +0 -6
  364. package/dist/chunk-PKRDBS7O.js +0 -5
  365. package/dist/chunk-PMD6S7YG.js +0 -1
  366. package/dist/chunk-PUOCHFFI.js +0 -1
  367. package/dist/chunk-Q2DPBMV4.js +0 -1
  368. package/dist/chunk-Q6XT3YKV.js +0 -3
  369. package/dist/chunk-QEL3F2NY.js +0 -5
  370. package/dist/chunk-R2W5B7YI.js +0 -3
  371. package/dist/chunk-REABQXMP.js +0 -1
  372. package/dist/chunk-RTPVI7LE.js +0 -3
  373. package/dist/chunk-SFZQFEZB.js +0 -6
  374. package/dist/chunk-STJ3LWFL.js +0 -1
  375. package/dist/chunk-STJWHL36.js +0 -7
  376. package/dist/chunk-SZJHOXS6.js +0 -6
  377. package/dist/chunk-TEPMNVJN.js +0 -1
  378. package/dist/chunk-TNSMROUR.js +0 -1
  379. package/dist/chunk-UDDJQ34Y.js +0 -1
  380. package/dist/chunk-UKQ7NE5V.js +0 -1
  381. package/dist/chunk-UOQBCBKY.js +0 -1
  382. package/dist/chunk-UQWT2PFO.js +0 -1
  383. package/dist/chunk-V26QBVCN.js +0 -1
  384. package/dist/chunk-VVEQ4IHW.js +0 -1
  385. package/dist/chunk-VXBHTSMX.js +0 -20
  386. package/dist/chunk-WDCCITSG.js +0 -1
  387. package/dist/chunk-WGMYSPR2.js +0 -10
  388. package/dist/chunk-WHT2RCAD.js +0 -11
  389. package/dist/chunk-WW7TENNA.js +0 -1
  390. package/dist/chunk-WXJGZGQS.js +0 -1
  391. package/dist/chunk-X4AZV5A2.js +0 -1
  392. package/dist/chunk-XBBP5BWC.js +0 -7
  393. package/dist/chunk-XH32NPYG.js +0 -1
  394. package/dist/chunk-Y7A7Z2V3.js +0 -1
  395. package/dist/chunk-YE7XCF44.js +0 -1
  396. package/dist/chunk-YIFT67BD.js +0 -4
  397. package/dist/chunk-Z36JS7OX.js +0 -6
  398. package/dist/chunk-ZHPPBTNE.js +0 -28
  399. package/dist/chunk-ZMSE5SQB.js +0 -1
  400. package/dist/conf-store-YW3NWYCN.js +0 -1
  401. package/dist/custom-oclif-loader-4ZAXX5MR.js +0 -1
  402. package/dist/deprecations-VW7UIMZX.js +0 -1
  403. package/dist/dist-I3VCRVOE.js +0 -1
  404. package/dist/dist-MP4AU5F4.js +0 -1
  405. package/dist/environments-5P57CTOG.js +0 -1
  406. package/dist/error-U7DOQOWG.js +0 -1
  407. package/dist/error-handler-AOEXPYI7.js +0 -1
  408. package/dist/fs-K5NT4W2Q.js +0 -1
  409. package/dist/hooks/app-init.d.ts +0 -9
  410. package/dist/hooks/app-init.js +0 -1
  411. package/dist/is-global-CFYYUAIJ.js +0 -1
  412. package/dist/is-wsl-UEMXYJPN.js +0 -1
  413. package/dist/lib-JKLF33A7.js +0 -1
  414. package/dist/local-BRRQOCGY.js +0 -1
  415. package/dist/local-storage-FVSI2IBZ.js +0 -1
  416. package/dist/metadata-HVSGVFUQ.js +0 -1
  417. package/dist/node-package-manager-6JURLQKU.js +0 -1
  418. package/dist/notifications-system-BTEFKXCS.js +0 -1
  419. package/dist/output-EXMTVS2V.js +0 -1
  420. package/dist/system-DUJDILSL.js +0 -1
  421. package/dist/ui-AX6ZMY6P.js +0 -1
  422. package/dist/upgrade-5TEVQNLY.js +0 -1
  423. package/dist/version-7LKOAVDW.js +0 -1
  424. package/dist/version-PRFBZAWQ.js +0 -1
  425. package/dist/workerd-MFV7EBVM.js +0 -18
  426. /package/dist/{chunk-VDN6MEYI.js → chunk-NJPL5BTN.js} +0 -0
@@ -0,0 +1,20 @@
1
+ import{a as Mt}from"./chunk-UOHNRH6E.js";import{a as Cr}from"./chunk-7WTNEG2F.js";import{a as xr}from"./chunk-MRCWOOSF.js";import{a as Er}from"./chunk-PWSI275S.js";import{a as Rr}from"./chunk-X4XP2RQJ.js";import{a as br}from"./chunk-TYIGOVRQ.js";import{a as Sr}from"./chunk-7AALWJAO.js";import{b as Tr}from"./chunk-LQCR4TGH.js";import{a as Ar}from"./chunk-SSJGWLCW.js";import{a as _r}from"./chunk-QBIVQXUJ.js";import{a as pr}from"./chunk-JQ2B3VHR.js";import{a as dr}from"./chunk-2HK4MFWP.js";import{a as mr}from"./chunk-SJMTETSU.js";import{a as fr}from"./chunk-K4KTNINH.js";import{a as hr}from"./chunk-GZ64KWHX.js";import{a as gr}from"./chunk-XLURZ6GL.js";import{a as wr,b as yr,c as Pr,d as vr}from"./chunk-PAAKBWSF.js";import{a as Ur}from"./chunk-4LRG5YBS.js";import{g as ur}from"./chunk-MLZLDL6B.js";import{a as lo,b as po,c as uo,d as mo}from"./chunk-FULWTZS6.js";import{a as ar}from"./chunk-QEB3HUQE.js";import{a as lr}from"./chunk-5NO5OXYP.js";import{a as Xe}from"./chunk-E2W5OYYM.js";import{a as cr}from"./chunk-4W3UE2ZI.js";import{c as Je,m as Ze}from"./chunk-LZ3GZ7NS.js";import{b as ir,g as _e,j as Qe}from"./chunk-4JY2P2A5.js";import{a as nr,b as sr,c as ao,d as io,e as rt,f as co,g as fo}from"./chunk-FCGKO2KY.js";import{a as $,b as Ve}from"./chunk-JUKAWTYY.js";import{a as Xt,b as Zt,d as Te,f as er,m as Ae,n as H,s as q,u as tr,v as rr,w as or}from"./chunk-Q7BOSHWX.js";import{c as kr}from"./chunk-AH2ZGMDM.js";import{a as Jt}from"./chunk-JZMRBJH3.js";import{a as Zr,b as tt,c as ee,d as eo}from"./chunk-63CIFL36.js";import{a as ho,f as go,g as wo,h as ot,i as yo,j as Po,k as vo,l as xo,m as Eo,n as bo,o as So,p as Uo,q as Ro,v as To,x as Ao,z as nt}from"./chunk-U7R6LYPJ.js";import{a as to,b as ro,c as oo,d as no,e as so}from"./chunk-TY4W7AYX.js";import{a as Lr}from"./chunk-PANGX7SA.js";import{a as Xr}from"./chunk-H5KWM27L.js";import{a as Jr}from"./chunk-NEMPLS7C.js";import{a as Ir}from"./chunk-KUNDCAQN.js";import{B as Br,D as Kr,F as Z,M as jr,N as Yr,X as Vr,i as $r,j as W,k as Mr,m as Fr,ma as ke,na as Ie,p as et,q as Or,r as Nr,s as qr,sa as Qr,t as Wr,u as Hr,v as Gr}from"./chunk-ACTDYTAV.js";import{X as zr,e as Ce,j as ie,p as Dr}from"./chunk-F5HCSUXC.js";import{c as Vt}from"./chunk-KIYHEMHD.js";import{a as K}from"./chunk-U6HYEGAE.js";import{b as Qt,e as Re}from"./chunk-JJJTPEMD.js";import{C as ye,R as kt,a as Ke,ba as J,c as bt,da as It,e as St,g as Ut,k as Rt,o as Tt,q as At,t as _t,va as Lt,w as Ct,x as we}from"./chunk-YN6A26QL.js";import{A as se,H as be,L as Bt,N as Se,S as Ue,T as ae,U as Ye,V as Kt,X as jt,a as Et,d as Pe,e as k,f as L,h as ve,i as xe,j as Dt,k as Ft,l as Ot,m as Nt,n as qt,o as D,p as Wt,q as je,r as ze,s as Ht,t as Gt,y as Ee}from"./chunk-GMTNOCMS.js";import{a as Cn}from"./chunk-7UNQOKZW.js";import{d as $t}from"./chunk-JQISGC7D.js";import{h as T,k as X}from"./chunk-R2R6JDNH.js";import{a as _n}from"./chunk-CTNBSUVU.js";import{a as _o}from"./chunk-E5T4YRGW.js";import{$a as vt,Ab as g,Bb as C,Ea as Pt,Na as he,P as Be,Ta as F,Wa as ge,cb as xt,ma as I,qb as v,sb as b,ua as me,wa as fe,xb as B}from"./chunk-Y34LWI3S.js";import{d as zt,f as Yt}from"./chunk-XAOYKECS.js";import{a as ft}from"./chunk-JD5P5RAJ.js";import{d as S,f as Ge,g as ht,i as ue,j as gt,k as de,o as wt,p as yt}from"./chunk-773TIA5M.js";import{e as Q,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();p();p();p();var kn=300*1e3,In='The host theme could not be created to host your theme app extension. Please try again or use the "--theme" flag to use an existing theme as the host theme.';async function Co(t,e,r=Date.now()){for(;await Ln(t,e,r););}async function Ln(t,e,r){let o=await _e(t,e);if(!o||$n(o,r))throw new T(In);return await ae(3),o.processing}function $n(t,e){return t.processing&&Date.now()-e>=kn}var Mn="https://codeload.github.com/Shopify/dawn/zip/refs/tags/v15.0.0",Dn="https://cdn.shopify.com/theme-store/uhrdefhlndzaoyrgylhto59sx2i7.jpg",st=3,Le=class extends cr{context="App Ext. Host";devPreview;constructor(e,r={devPreview:!1}){super(e),this.themeId=wr(e.storeFqdn),this.devPreview=r.devPreview}async findOrCreate(){let e=await this.fetch();return e??=this.devPreview?await this.createHostTheme():await this.create(),e}setTheme(e){yr(this.adminSession.storeFqdn,e)}removeTheme(){Pr(this.adminSession.storeFqdn)}async createHostTheme(){let e={role:ir,name:this.generateThemeName(this.context),src:Mn};for(let o=0;o<st;o++){g(`Attempt ${o}/${st}: Creating theme with name "${e.name}" and role "${e.role}"`);try{let n=await Qe(e,this.adminSession);if(n)return this.setTheme(n.id.toString()),g(`Waiting for theme with id "${n.id}" to be processed`),await Co(n.id,this.adminSession),n;throw new Error}catch{g(`Failed to create theme with name "${e.name}" and role "${e.role}". Retrying...`)}}g(`Theme creation failed after ${st} retries. Creating theme using fallback theme zip`);let r=await Qe({...e,src:Dn},this.adminSession);if(!r)throw g("Theme creation failed. Exiting process."),new X(`Could not create theme with name "${e.name}" and role "${e.role}"`);return r}};p();var Fn={"theme:init":hr,"theme:check":ar,"theme:console":lr,"theme:delete":pr,"theme:dev":dr,"theme:duplicate":mr,"theme:info":fr,"theme:language-server":gr,"theme:list":vr,"theme:metafields:pull":Ur,"theme:open":xr,"theme:package":Er,"theme:profile":br,"theme:publish":Sr,"theme:preview":Rr,"theme:pull":Tr,"theme:push":Ar,"theme:rename":_r,"theme:share":Cr},ka=Fn;async function ko(t){let{remoteApp:e,localApp:r}=t,n=r.allExtensions.filter(U=>U.isThemeExtension);if(n.length===0)return;let a=n[0].directory,i=t.themeExtensionPort??9293,[c,d]=await Promise.all([kt(t.storeFqdn),qn(e)]),l=c.storeFqdn,[u,h]=await Promise.all([Ze(c),Je(c)]),w=h?await Xe(t.storePassword,l,u):void 0,m=await Nn(c,t.theme),f=m.id.toString();return Ee({headline:"The theme app extension development server is ready.",orderedNextSteps:!0,nextSteps:[[{link:{label:"Install your app in your development store",url:d}}],[{link:{label:"Setup your theme app extension in the host theme",url:`https://${l}/admin/themes/${f}/editor`}}],["Preview your theme app extension at",{link:{label:`http://127.0.0.1:${i}`,url:`http://127.0.0.1:${i}`}}]]}),{type:"theme-app-extensions",prefix:"theme-extensions",function:On,options:{theme:m,adminSession:c,storefrontPassword:w,crawlerSignatureHeaders:u,themeExtensionDirectory:a,themeExtensionPort:i}}}var On=async(t,{theme:e,adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})=>{await(await ur(e,{adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})).start()};async function Nn(t,e){let r;if(e)g(`Fetching theme with provided id ${e}`),r=await _e(parseInt(e,10),t);else{let o=new Le(t,{devPreview:!0});await be([{title:"Configuring host theme for theme app extension",task:async()=>{g("Finding or creating host theme for theme app extensions"),r=await o.findOrCreate()}}])}if(!r)throw new T("Could not find or create a host theme for theme app extensions");return r}async function qn(t){return t.developerPlatformClient?.clientName===zr.AppManagement?`https://${await we()}/?organization_id=${t.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${t.apiKey}`:`https://${await Ct()}/${t.organizationId}/apps/${t.id}/test`}p();p();p();p();p();p();async function Wn(t){let e=S(t.directory,"locales");return ge([S(e,"*.json")])}async function Io(t,e){let r=await Wn(t);if(!r.length)return{localization:void 0,status:""};let o=e.currentLocalizationPayload??{defaultLocale:"en",translations:{},lastUpdated:0},n="success";try{await Promise.all(r.map(async s=>{let[a,...i]=s.split("/").pop().split(".");if(a)return i[0]==="default"&&(o.defaultLocale=a),Hn(a,s,o,t,e)})),o.lastUpdated=Date.now(),g(`Parsed locales for extension ${t.handle} at ${t.directory}`,e.stdout)}catch{n="error"}return{localization:o,status:n}}async function Hn(t,e,r,o,n){let s;try{s=await I(e),r.translations[t]=JSON.parse(s)}catch(a){let i=`Error parsing ${t} locale for ${o.handle} at ${e}: ${a.message}`;throw C(i,n.stderr),new Error(i)}}p();function $e(t,e){switch(t){case"checkout_ui_extension":return{url:e.checkoutCartUrl};case"checkout_post_purchase":return{url:e.checkoutCartUrl};case"product_subscription":return{url:e.subscriptionProductUrl??""};default:return{url:""}}}var at=".js.map";async function te(t,e,r,o){return D({outputPrefix:t.outputPrefix},async()=>{o?.clear();let n=t.getOutputPathForDirectory(e),s=`${r.url}/extensions/${t.devUUID}`,{localization:a,status:i}=await Io(t,r),c=await Mr(t),d=t.outputRelativePath?ue(n):n,l=await Gn(t,s,d,o),u=null;return"metafields"in t.configuration&&Array.isArray(t.configuration.metafields)&&t.configuration.metafields.length>0&&(u=t.configuration.metafields),{assets:{main:ce(l)&&l[0]?.assets?.main?l[0].assets.main:{name:"main",url:`${s}/assets/${t.outputFileName}`,lastUpdated:await he(n)??0}},supportedFeatures:{runsOffline:t.configuration.supported_features?.runs_offline??!1},capabilities:{blockProgress:t.configuration.capabilities?.block_progress??!1,networkAccess:t.configuration.capabilities?.network_access??!1,apiAccess:t.configuration.capabilities?.api_access??!1,collectBuyerConsent:{smsMarketing:t.configuration.capabilities?.collect_buyer_consent?.sms_marketing??!1,customerPrivacy:t.configuration.capabilities?.collect_buyer_consent?.customer_privacy??!1},iframe:{sources:t.configuration.capabilities?.iframe?.sources??[]}},development:{...r.currentDevelopmentPayload,resource:$e(t.type,r),root:{url:s},hidden:r.currentDevelopmentPayload?.hidden??!1,localizationStatus:i,status:r.currentDevelopmentPayload?.status??"success",...r.currentDevelopmentPayload??{status:"success"}},extensionPoints:l,localization:a??null,metafields:u,type:t.type,externalType:t.externalType,uuid:t.devUUID,surface:t.surface,version:c?.version,title:t.name,handle:t.handle,name:t.name,description:t.configuration.description,apiVersion:t.configuration.api_version,approvalScopes:r.grantedScopes,settings:t.configuration.settings}})}async function Gn(t,e,r,o){let n=t.configuration,s=n.extension_points??n.targeting;if(t.type==="checkout_post_purchase"&&(s=[{target:"purchase.post.render"}]),ce(s)){let a=await Bn(r);return Promise.all(s.map(async i=>{let{target:c,resource:d}=i,l={...i,surface:Ie(c),root:{url:`${e}/${c}`},resource:d||{url:""}},u=a?.[c];if(!u)return l;let w=await Qn(u,{target:c,extensionPoint:i,url:e,extension:t,buildDirectory:r,resolver:o});return{...l,...w}}))}return s}async function Bn(t){try{let e=S(t,"manifest.json"),r=await I(e);return JSON.parse(r)}catch(e){if(e instanceof SyntaxError)throw new Error(`Invalid manifest.json in ${t}: ${e.message}`);return null}}async function Kn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s,a){let i=`${t}/${s}`,c=e[s];if(typeof c=="string"){let w=await Me(s,i,typeof a=="string"?a:c,r,o,n,typeof a=="string"?c:void 0);return{assets:{[w.name]:w}}}let l=e.build_manifest?.assets?.[s];if(l?.filepath){let u=await Me(s,i,l.filepath,r,o,n,l.module);return{assets:{[u.name]:u}}}return{}}async function jn({target:t,url:e,buildDirectory:r,resolver:o},n,s){if(s.length===0)return{};for(let i of s)o?.set(`${t}/${i}`,i);let a=await Promise.all(s.map(async i=>await he(S(r,i))??0));return{assets:{[n]:{name:n,url:`${e}/assets/${t}/`,lastUpdated:Math.max(...a)}}}}async function zn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s){return e.intents?{intents:await Promise.all(e.intents.map(async(i,c)=>{let d=i.schema,l=s[c]?.schema,u=typeof l=="string"?l:d,h=typeof l=="string"?d:void 0;return{...i,schema:await Me("schema",`${t}/intents/${c}/schema`,u,r,o,n,h)}}))}:{}}async function Yn({target:t,url:e,extension:r,resolver:o},n,s){let a=await Me(n,`${t}/${n}`,s,e,r,o);return await Vn(t,s,r,o),{assets:{[a.name]:a}}}async function Vn(t,e,r,o){if(!o)return;let n=`${e}.map`;n.endsWith(at)&&await F(S(r.directory,n))&&o.set(`${t}/${gt(n)}`,n)}async function Qn(t,e){return(await Promise.all(Object.keys(t).map(async o=>{let n=t[o];return Jn(o,n)?zn(e,n):Xn(o,n)?Yn(e,o,n):Zn(o,n)?jn(e,o,n):Kn(e,o,n)}))).reduce((o,n)=>({...o,...n,assets:{...o.assets,...n.assets}}),{})}function ce(t){return Array.isArray(t)&&t.every(e=>typeof e=="object")}async function Me(t,e,r,o,n,s,a){let i=`${e}${de(r)}`;return s?.set(i,r),{name:t,url:`${o}/assets/${i}`,lastUpdated:await he(S(n.directory,a??r))??0}}function Jn(t,e){return t==="intents"&&Array.isArray(e)}function Xn(t,e){return(t==="main"||t==="should_render")&&typeof e=="string"}function Zn(t,e){return t==="assets"&&Array.isArray(e)&&e.every(r=>typeof r=="string")}import{EventEmitter as es}from"events";var le;(function(t){t.Update="PayloadUpdatedEvent:UPDATE"})(le||(le={}));async function Lo(t,e,r){return{app:{title:t.appName,apiKey:t.apiKey,url:ao(t.storeFqdn,t.apiKey),mobileUrl:co(t.storeFqdn,t.apiKey)},appId:t.id,version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:t.websocketURL},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extensions:await Promise.all(t.extensions.filter(n=>n.isPreviewable).map(n=>te(n,e,t,r&&it(r,n.devUUID))))}}function it(t,e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}var De=class extends es{options;rawPayload;assetResolvers;constructor(e,r,o=new Map){super(),this.rawPayload=e,this.options=r,this.assetResolvers=o}getAssetResolver(e){return this.assetResolvers.get(e)}getConnectedPayload(){let e=this.getRawPayload();return{app:e.app,appId:e.appId,store:e.store,extensions:e.extensions}}getRawPayloadFilteredByExtensionIds(e){return{...this.rawPayload,extensions:this.rawPayload.extensions.filter(r=>e.includes(r.uuid))}}getRawPayload(){return this.rawPayload}updateApp(e){this.rawPayload=J(this.rawPayload,{app:e}),this.emitUpdate([])}updateExtensions(e){let r=this.rawPayload.extensions.map(o=>{let n=e.find(s=>s.uuid===o.uuid);if(n){if(ce(n.extensionPoints)&&ce(o.extensionPoints)){let s=n.extensionPoints.reduce((c,d)=>({...c,[d.target]:d}),{});o.extensionPoints=J(o.extensionPoints,n.extensionPoints,c=>c.map(d=>{let l=s[d.target];return l?J(d,l,(u,h)=>h):d}));let{extensionPoints:a,...i}=n;return J(o,i)}return J(o,n)}return o});this.rawPayload={...this.rawPayload,extensions:r},this.emitUpdate(e.map(o=>o.uuid))}async updateExtension(e,r,o,n){let s=this.rawPayload.extensions,a=s.findIndex(i=>i.uuid===e.devUUID);if(a===-1){g(b`Could not updateExtension() for extension with uuid: ${e.devUUID}`,r.stderr);return}s[a]=await te(e,o,{...this.options,currentDevelopmentPayload:n??{status:s[a]?.development.status},currentLocalizationPayload:s[a]?.localization},it(this.assetResolvers,e.devUUID)),this.rawPayload.extensions=s,this.emitUpdate([e.devUUID])}deleteExtension(e){let r=this.rawPayload.extensions.findIndex(o=>o.uuid===e.devUUID);r!==-1&&(this.rawPayload.extensions.splice(r,1),this.assetResolvers.delete(e.devUUID),this.emitUpdate([e.devUUID]))}async addExtension(e,r){this.rawPayload.extensions.push(await te(e,r,this.options,it(this.assetResolvers,e.devUUID))),this.emitUpdate([e.devUUID])}emitUpdate(e){this.emit(le.Update,e)}};p();p();var j;(function(t){t.Update="update",t.Dispatch="dispatch",t.Log="log"})(j||(j={}));function $o(t,e){return(r,o,n)=>{r.url==="/extensions"&&(g("Upgrading HTTP request to a websocket connection",e.stdout),t.handleUpgrade(r,o,n,ts(t,e)))}}function ts(t,e){return r=>{g("Websocket connection successfully established",e.stdout);let o={event:"connected",data:e.payloadStore.getConnectedPayload(),version:e.manifestVersion};g(b`Sending connected payload: ${v.json(o)}`,e.stdout),r.send(JSON.stringify(o)),r.on("message",as(t,e))}}function rs(t){try{let e=JSON.parse(t);if(!Array.isArray(e))return t;let r=e.map(o=>typeof o=="object"&&o!==null?v.json(o).output():String(o)).join(" ");return b`${r}`.value}catch(e){if(e instanceof SyntaxError)return t;throw e}}var os={debug:t=>v.gray(t),warn:t=>v.yellow(t),error:t=>v.errorText(t)};function ns({type:t,message:e}){let r=rs(e);switch(t){case"debug":case"warn":case"error":return b`${os[t](t.toUpperCase())}: ${r}`.value;case"log":case"info":return r;default:return`${t.toUpperCase()}: ${r}`}}function ss(t,e){D({outputPrefix:t.extensionName,stripAnsi:!1},()=>{e.stdout.write(ns(t))})}function as(t,e){return r=>{let o=JSON.parse(r.toString()),{event:n,data:s}=o;if(g(b`Received websocket message with event type ${n} and data:
2
+ ${v.json(s)}
3
+ `,e.stdout),n===j.Update){let a=e.payloadStore.getRawPayload().app.apiKey,i=s.app?.apiKey;if(s.app){if(a!==i)return;e.payloadStore.updateApp(s.app)}s.extensions&&e.payloadStore.updateExtensions(s.extensions)}else if(n===j.Dispatch){let a=is(o,e);Do(t,a,e)}else n===j.Log&&ss(s,e)}}function Mo(t,e){return r=>{let o={event:j.Update,version:e.manifestVersion,data:{...e.payloadStore.getRawPayloadFilteredByExtensionIds(r)}};g(b`Sending websocket update event to the websocket clients:
4
+ ${v.json(o)}
5
+ `,e.stdout),Do(t,o,e)}}function Do(t,e,r){g(b`Sending websocket with event type ${e.event} and data:
6
+ ${v.json(e.data)}
7
+ `,r.stdout);let o=JSON.stringify(e);t.clients.forEach(n=>n.send(o))}function is(t,e){let r=e.payloadStore.getRawPayload();return{...t,version:e.manifestVersion,data:{...t.data,extensions:[],store:r.store,app:r.app}}}var cs=10;function Fo(t){let e=new Mt.default({noServer:!0,clientTracking:!0}),r=ls(e);return t.httpServer.on("upgrade",$o(e,t)),t.payloadStore.on(le.Update,Mo(e,t)),{close:()=>{e.close(),clearInterval(r)}}}function ls(t){return setInterval(()=>{t.clients.forEach(e=>{e.readyState<2&&e.ping()})},cs*1e3)}p();p();p();function Oo(t,e){let{url:r}=$e(t.type,e);if(t.surface==="checkout"&&r){let o=new URL(`https://${e.storeFqdn}/`);return o.pathname=r,o.searchParams.append("dev",`${e.url}/extensions`),o.toString()}else{let o=new URL(`https://${e.storeFqdn}/`);return o.pathname="admin/extensions-dev",o.searchParams.append("url",Fe(t,e)),o.toString()}}function No(t,e,r){let o=Ie(t),n=new URL(`https://${r.storeFqdn}/`);switch(o){case"checkout":n.pathname=r.checkoutCartUrl,n.searchParams.append("dev",`${r.url}/extensions`);break;case"post_purchase":if(n.pathname=r.checkoutCartUrl,n.searchParams.set("script_url",`${r.url}/extensions/${e.devUUID}/assets/${e.localIdentifier}.js`),n.searchParams.set("post_purchase_dev_api_key",r.apiKey),e.devUUID&&r.websocketURL&&(n.searchParams.set("uuid",e.devUUID),n.searchParams.set("socket_url",r.websocketURL)),"metafields"in e.configuration){let s={config:{metafields:e.configuration.metafields}};n.searchParams.set("config",JSON.stringify(s))}break;case"admin":n.pathname="admin/extensions-dev",n.searchParams.append("url",Fe(e,r)),n.searchParams.append("target",t);break;case"customer-accounts":n=ps(e,r,t);break;default:return}return n.toString()}function ps(t,e,r=""){let o=`${e.url}/extensions`,n=e.storeId,s="shopify.com",a=new URL(`https://${s}/${n}/account/extensions-development`);return a.searchParams.append("origin",o),a.searchParams.append("extensionId",t.devUUID),a.searchParams.append("source","CUSTOMER_ACCOUNT_EXTENSION"),a.searchParams.append("appId",e.id??""),r!==""&&a.searchParams.append("target",r),a}function Fe(t,e){let r=new URL(e.url);return r.pathname=`/extensions/${t.devUUID}`,r.toString()}function O(t,e){Zt(t,Xt(e))}p();var ct=class extends X{constructor(e){super(`Couldn't find template ${e.template} for extension surface ${e.extensionSurface}`)}};async function qo(t){let e=await us(t),r=await I(e);return Jt(r,t.data)}async function us(t){let e=await ds(),r=[];t.extensionSurface&&r.push(S(e,`${t.extensionSurface}/${t.template}.html.liquid`)),r.push(S(e,`${t.template}.html.liquid`));let o=await ge(r);if(o.length===0)throw new ct(t);return o[0]}async function ds(){return await vt("templates/ui-extensions/html",{type:"directory",cwd:yt(import.meta.url)})}var Wo=q(t=>{H(t,"Access-Control-Allow-Origin","*"),H(t,"Access-Control-Allow-Methods","GET, OPTIONS"),H(t,"Access-Control-Allow-Headers","Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, ngrok-skip-browser-warning")}),Ho=q(t=>{H(t,"Cache-Control","no-cache")}),lt=q(async t=>Ae(t,"/extensions",307));async function ms(t,e){let{filePath:r}=e;if(!await F(r))return O(t,{statusCode:404,statusMessage:`Not Found: ${r}`});if(await Pt(r)&&(r+=r.endsWith("/")?"index.html":"/index.html",!await F(r)))return O(t,{statusCode:404,statusMessage:`Not Found: ${r}`});let o=await I(r,{}),n={".ico":"image/x-icon",".html":"text/html",".js":"text/javascript",".json":"application/json",".map":"application/json",".wasm":"application/wasm",".css":"text/css",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".wav":"audio/wav",".mp3":"audio/mpeg",".svg":"image/svg+xml",".pdf":"application/pdf",".doc":"application/msword"},s=de(r),a=n[s]||"text/plain";return H(t,"Content-Type",a),o}function Go({getExtensions:t,payloadStore:e}){return q(async r=>{let{extensionId:o,assetPath:n=""}=Te(r),s=t().find(h=>h.devUUID===o);if(!s)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});let i=e.getAssetResolver(s.devUUID)?.get(n),c=i??n,d=c.endsWith(at);if(d&&i===void 0)return O(r,{statusCode:404,statusMessage:"Not Found"});let l=Ge(d?s.directory:Fr(s.outputPath)),u=Ge(S(l,c));return wt(l,u)?ms(r,{filePath:u}):O(r,{statusCode:404,statusMessage:"Not Found"})})}function pt({payloadStore:t}){return q(e=>(H(e,"content-type","application/json"),t.getRawPayload()))}function Bo({devOptions:t}){return q(e=>{g(`UI extensions server received a ${e.method} request to URL ${e.path}`,t.stdout)})}function ut({devOptions:t,getExtensions:e}){return q(async r=>{let{extensionId:o}=Te(r),n=e().find(i=>i.devUUID===o);if(!n)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});if(er(r,"accept")?.startsWith("text/html")){if(n.type==="checkout_post_purchase")return qo({data:{url:Fe(n,t)},template:"index",extensionSurface:"post_purchase"});{let i=Oo(n,t);return Ae(r,i,307)}}let a=t.appWatcher.buildOutputPath;return H(r,"content-type","application/json"),{app:{apiKey:t.apiKey},version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:re(t.url)},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extension:await te(n,a,t)}})}function Ko({devOptions:t,getExtensions:e}){return q(async r=>{let{extensionId:o,extensionPointTarget:n=""}=Te(r),s=e().find(i=>i.devUUID===o);if(!s)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});if(s.configuration.type!=="checkout_post_purchase"&&!s.hasExtensionPointTarget(n))return O(r,{statusCode:404,statusMessage:`Extension with id ${o} has not configured the "${n}" extension target`});let a=No(n,s,t);return a?Ae(r,a,307):O(r,{statusCode:404,statusMessage:`Redirect url can't be constructed for extension with id ${o} and extension target "${n}"`})})}import{createServer as fs}from"http";function jo(t){let e=tr(),r=rr();e.use(Bo(t)),e.use(Wo),e.use(Ho),r.use("/extensions/dev-console",lt),r.use("/extensions/:extensionId",ut(t)),r.use("/extensions/:extensionId/",ut(t)),r.use("/extensions/:extensionId/:extensionPointTarget",Ko(t)),r.use("/extensions/:extensionId/assets/**:assetPath",Go(t)),r.use("/extensions",pt(t)),r.use("/extensions/",pt(t)),r.use("/",lt),e.use(r);let o=fs(or(e));return o.listen(t.devOptions.port,"localhost"),o}async function zo(t){let e={...t,websocketURL:re(t.url)},r=e.appWatcher.buildOutputPath,o=new Map,n=await Lo(e,r,o),s=new De(n,e,o),a=e.extensions.filter(u=>u.isPreviewable),i=()=>a;g("Setting up the UI extensions HTTP server...",e.stdout);let c=jo({devOptions:e,payloadStore:s,getExtensions:i});g("Setting up the UI extensions Websocket server...",e.stdout);let d=Fo({...e,httpServer:c,payloadStore:s});g("Setting up the UI extensions bundler and file watching...",e.stdout);let l=async({appWasReloaded:u,app:h,extensionEvents:w})=>{u&&(a=h.allExtensions.filter(m=>m.isPreviewable));for(let m of w){if(!m.extension.isPreviewable)continue;let f=m.buildResult?.status==="ok"?"success":"error",U=m.buildResult?.status==="error"?{message:m.buildResult.error,file:m.buildResult.file}:void 0;switch(m.type){case ee.Created:if(e.extensions.push(m.extension),!e.checkoutCartUrl){let E=await ke(e.extensions,e.storeFqdn);e.checkoutCartUrl=E}await s.addExtension(m.extension,r);break;case ee.Updated:await s.updateExtension(m.extension,e,r,{status:f,error:U});break;case ee.Deleted:e.extensions=e.extensions.filter(E=>E.devUUID!==m.extension.devUUID),await s.deleteExtension(m.extension);break}}};e.appWatcher.onEvent(l).onStart(l),e.signal.addEventListener("abort",()=>{g("Closing the UI extensions dev server..."),d.close(),c.close()})}function re(t){let e=new URL("/extensions",t);return e.protocol="wss:",e.toString()}var hs="3",gs=async({stderr:t,stdout:e,abortSignal:r},{apiKey:o,storeFqdn:n,storeId:s,subscriptionProductUrl:a,port:i,cartUrl:c,proxyUrl:d,appName:l,appDotEnvFile:u,appId:h,grantedScopes:w,allExtensions:m,appDirectory:f,appWatcher:U})=>{await zo({appName:l,appDotEnvFile:u,appDirectory:f,id:h,extensions:m,stdout:e,stderr:t,signal:r,url:d,port:i,storeFqdn:ye(n),storeId:s,apiKey:o,grantedScopes:w,checkoutCartUrl:c,subscriptionProductUrl:a,manifestVersion:hs,appWatcher:U})};async function Yo({allExtensions:t,storeFqdn:e,checkoutCartUrl:r,...o}){let n=t.filter(a=>a.isPreviewable),s=await ke(n,e,r);return{prefix:"extensions",type:"previewable-extension",function:gs,options:{pathPrefix:"/extensions",port:-1,storeFqdn:e,allExtensions:t,cartUrl:s,...o}}}p();p();function z(t){let e=t.find(o=>Z(o,W.Frontend)),r=t.find(o=>Z(o,W.Backend));return{frontendConfig:e,backendConfig:r}}p();async function Vo(t){let r={topic:"app/uninstalled",api_version:(await lo(t.developerPlatformClient,t.organizationId))[1],address:t.address,delivery_method:mo.LOCALHOST,shared_secret:t.sharedSecret},o=await po(t.developerPlatformClient,r,t.organizationId);t.stdout.write("Sending APP_UNINSTALLED webhook to app server"),await ae(3);let n=await ws(t,o);return t.stdout.write(n?"APP_UNINSTALLED webhook delivered":"APP_UNINSTALLED webhook delivery failed"),n}async function ws(t,e){let r=0;for(;r<3;){try{return await uo(t.address,e.samplePayload,JSON.stringify({...JSON.parse(e.headers),"X-Shopify-Shop-Domain":t.storeFqdn}))}catch(o){if(o instanceof Tt&&o.code==="ECONNREFUSED")r<3&&(t.stdout.write("App isn't responding yet, retrying in 5 seconds"),await ae(5));else throw o}r++}return t.stdout.write("App hasn't started in time, giving up"),!1}var ys=async({stdout:t},e)=>{await Vo({stdout:t,developerPlatformClient:e.developerPlatformClient,address:`http://localhost:${e.deliveryPort}${e.webhooksPath}`,sharedSecret:e.apiSecret,storeFqdn:e.storeFqdn,organizationId:e.organizationId})};function Qo({webs:t,remoteAppUpdated:e,backendPort:r,frontendPort:o,organizationId:n,...s}){let{backendConfig:a,frontendConfig:i}=z(t),c=t.map(({configuration:l})=>l.webhooks_path).find(l=>l)??"/api/webhooks";if(c&&e&&(i??a))return{type:"send-webhook",prefix:"webhooks",function:ys,options:{deliveryPort:a?r:o,webhooksPath:c,organizationId:n,...s}}}p();async function Jo(t){return{type:"graphiql",prefix:"graphiql",options:t,function:Ps}}var Ps=async({stdout:t,abortSignal:e},r)=>{let o=fo({apiKey:r.apiKey,apiSecret:r.apiSecret,storeFqdn:r.storeFqdn}),n=sr({stdout:t,port:r.port,storeFqdn:r.storeFqdn,key:r.key,tokenProvider:o,appContext:{appName:r.appName,appUrl:r.appUrl,apiSecret:r.apiSecret}});e.addEventListener("abort",()=>{n.close()})};p();async function Zo({webs:t,proxyUrl:e,frontendPort:r,backendPort:o,apiKey:n,apiSecret:s,scopes:a}){let{frontendConfig:i}=z(t),c=i?.configuration.hmr_server?await $():void 0,d=void 0,l=t.map(async u=>{let h=await vs({web:u,frontendPort:r,backendPort:o}),w=c&&u.configuration.roles.includes(W.Frontend)?{port:c,httpPaths:u.configuration.hmr_server.http_paths}:void 0;return{type:"web",prefix:u.configuration.name??["web",...u.configuration.roles].join("-"),function:xs,options:{port:h,portFromConfig:u.configuration.port,apiKey:n,apiSecret:s,hostname:e,backendPort:o,frontendServerPort:r,directory:u.directory,devCommand:u.configuration.commands.dev,preDevCommand:u.configuration.commands.predev,scopes:a,shopCustomDomain:d,hmrServerOptions:w,roles:u.configuration.roles}}});return Promise.all(l)}async function vs({web:t,frontendPort:e,backendPort:r}){return Z(t,W.Frontend)?e:Z(t,W.Backend)?r:$()}async function xs({stdout:t,stderr:e,abortSignal:r},{port:o,apiKey:n,apiSecret:s,hostname:a,backendPort:i,frontendServerPort:c,directory:d,devCommand:l,preDevCommand:u,scopes:h,shopCustomDomain:w,hmrServerOptions:m}){let f=m?.port,U={SHOPIFY_API_KEY:n,SHOPIFY_API_SECRET:s,HOST:a,SCOPES:h,NODE_ENV:"development",...w&&{SHOP_CUSTOM_DOMAIN:w},BACKEND_PORT:`${i}`,FRONTEND_PORT:`${c}`,...f&&{HMR_SERVER_PORT:`${f}`},APP_URL:a,APP_ENV:"development",REMIX_DEV_ORIGIN:a},E={signal:r,directory:d,port:o,env:U,stdout:t,stderr:e};u&&(t.write(`Running pre-dev command: "${u}"`),await Xo({...E,command:u,showOutput:zt()})),await Xo({...E,command:l,showOutput:!0})}async function Xo({command:t,signal:e,directory:r,port:o,env:n,showOutput:s,stdout:a,stderr:i}){let c=t.split("&&").map(d=>d.trim())??[];for(let d of c){let[l,...u]=d.split(" ");l?.length!==0&&await Ue(l,u,{cwd:r,stdout:s?a:void 0,stderr:i,signal:e,env:{...n,PORT:`${o}`,SERVER_PORT:`${o}`}})}}p();p();p();var Oe=class{stdout;constructor(e){this.stdout=e}async info(e){await this.log(e)}async warning(e){await this.log(b`${v.yellow(e)}`.value)}async success(e){await this.log(b`${v.green(e)}`.value)}async debug(e){g(e,this.stdout)}async error(e,r){let o=v.errorText("\u274C Error"),n=v.errorText(`\u2514 ${e}`);await this.log(b`${o}`.value,r),await this.log(b`${n}`.value,r)}async logUserErrors(e,r){if(typeof e=="string")await this.error(e);else if(e instanceof Error)await this.error(e.message);else{let o=e.map(n=>{let s=n.on?n.on[0]:void 0,a=r.find(i=>i.uid===s?.user_identifier);return{error:n.message,prefix:a?.handle??"app-preview"}});await this.logMultipleErrors(o)}}async logExtensionEvents(e){let r=e.extensionEvents.filter(n=>n.extension.isAppConfigExtension),o=e.extensionEvents.filter(n=>!n.extension.isAppConfigExtension);r.length&&await this.log("App config updated","app-config"),o.forEach(async n=>{let s=n.extension.handle,a=`Extension ${n.type}`;await this.log(a,s)})}async logExtensionUpdateMessages(e){if(!e)return;let r=e.extensionEvents??[],n=(await Promise.all(r.map(async a=>a.type===ee.Deleted?[]:(await a.extension.getDevSessionUpdateMessages())?.map(c=>({message:c,prefix:a.extension.handle}))??[]))).flat(),s=n.map((a,i)=>{let c=b`${v.gray(i===n.length-1?"\u2514 ":"\u2502 ")}${a.message}`.value;return this.log(c,a.prefix)});await Promise.all(s)}async logMultipleErrors(e){let r=v.errorText("\u274C Error");await this.log(b`${r}`.value,"app-preview");let o=e.map(n=>{let s=v.errorText(`\u2514 ${n.error}`);return this.log(b`${s}`.value,n.prefix)});await Promise.all(o)}async log(e,r){await D({outputPrefix:r??"app-preview",stripAnsi:!1},()=>{this.stdout.write(e)})}};p();var Ne=class{processBatch;queue=[];processingPromise=void 0;constructor(e){this.processBatch=e}enqueue(e){this.queue.push(e),this.processingPromise??=this.startProcessing()}async waitForCompletion(){if(this.processingPromise)return this.processingPromise}async startProcessing(){try{for(;this.queue.length>0;){let e=[...this.queue];this.queue=[],await this.processBatch(e)}}finally{this.processingPromise=void 0}}};var qe=class t{static async start(e,r){let o=new t(e,r);return await o.start(),o}statusManager;logger;options;appWatcher;bundlePath;appEventsProcessor;failedEvents=[];currentSessionState=null;constructor(e,r){this.statusManager=e.devSessionStatusManager,this.logger=new Oe(r),this.options=e,this.appWatcher=e.appWatcher,this.bundlePath=e.appWatcher.buildOutputPath,this.appEventsProcessor=new Ne(o=>this.processEvents(o))}async start(){await this.logger.info(`Preparing dev preview on ${this.options.storeFqdn}`),this.statusManager.setMessage("LOADING"),this.appWatcher.onEvent(async e=>this.onEvent(e)).onStart(async e=>this.onStart(e)).onError(async e=>this.handleDevSessionResult({status:"unknown-error",error:e}))}async onEvent(e){await this.validateAppEvent(e)&&this.appEventsProcessor.enqueue(e)}async processEvents(e){let r=[...this.failedEvents,...e],o=this.consolidateAppEvents(r);if(this.failedEvents=[],!o)return;this.statusManager.setMessage("CHANGE_DETECTED"),this.updatePreviewURL(o),await this.logger.logExtensionEvents(o);let n=Zr(),s=await this.bundleExtensionsAndUpload(o);await this.handleDevSessionResult(s,o),await this.logger.debug(`\u2705 Event handled [Network: ${tt(n)}ms - Total: ${tt(o.startTime)}ms]`)}consolidateAppEvents(e){if(e.length===0)return;if(e.length===1)return e[0];let r=e[0],o=e[e.length-1];if(!r||!o)return;let n=new Map;for(let a of e)for(let i of a.extensionEvents)n.set(i.extension.uid,i);return{app:o.app,path:o.path,extensionEvents:Array.from(n.values()),startTime:r.startTime,appWasReloaded:e.some(a=>a.appWasReloaded)}}async onStart(e){let r=this.parseBuildErrors(e);if(r.length)await this.logger.logMultipleErrors(r),await setImmediate(()=>{let o=r.map(n=>n.prefix);throw new T(`Dev preview aborted, build errors detected in extensions: ${o}`)});else{let o=await this.bundleExtensionsAndUpload(e);await this.handleDevSessionResult(o,e)}}async validateAppEvent(e){if(!this.statusManager.status.isReady)return await this.logger.warning("Change detected, but dev preview is not ready yet."),!1;let r=this.parseBuildErrors(e);return r.length?(await this.logger.logMultipleErrors(r),this.statusManager.setMessage("BUILD_ERROR"),!1):e.extensionEvents.length===0?(this.statusManager.setMessage("READY"),!1):!0}parseBuildErrors(e){return e.extensionEvents.filter(o=>o.buildResult?.status==="error").map(o=>({error:"Build error. Please review your code and try again.",prefix:o.extension.handle}))}async handleDevSessionResult(e,r){e.status==="updated"?(await this.logger.success(`\u2705 Updated dev preview on ${this.options.storeFqdn}`),await this.logger.logExtensionUpdateMessages(r),await this.setUpdatedStatusMessage()):e.status==="created"?(this.statusManager.updateStatus({isReady:!0}),await this.logger.success("\u2705 Ready, watching for changes in your app "),await this.logger.logExtensionUpdateMessages(r),this.statusManager.setMessage("READY")):e.status==="aborted"?await this.logger.debug("\u274C Dev preview update aborted (new change detected or error during update)"):(e.status==="remote-error"||e.status==="unknown-error")&&(await this.logger.logUserErrors(e.error,r?.app.allExtensions??[]),e.error instanceof Error&&e.error.cause==="validation-error"?this.statusManager.setMessage("VALIDATION_ERROR"):(r&&this.failedEvents.push(r),this.statusManager.setMessage("REMOTE_ERROR"))),!this.statusManager.status.isReady&&!Yt()&&setImmediate(()=>{throw new T("Failed to start dev preview.")})}updatePreviewURL(e){let r=e.app.nonConfigExtensions.length>0;this.statusManager.updateStatus({previewURL:this.options.appPreviewURL,appEmbedded:e.app.configuration.embedded,hasExtensions:r})}async setUpdatedStatusMessage(){this.statusManager.setMessage("UPDATED"),setTimeout(async()=>{this.statusManager.status.statusMessage?.message==="Updated"&&this.statusManager.setMessage("READY")},2e3)}async bundleExtensionsAndUpload(e){try{let{manifest:r,inheritedModuleUids:o,assets:n}=await this.createManifest(e),s=await this.uploadAssetsIfNeeded(n,!this.statusManager.status.isReady),a=re(this.options.url);if(this.statusManager.status.isReady){let i={shopFqdn:this.options.storeFqdn,appId:this.options.appId,assetsUrl:s,manifest:r,inheritedModuleUids:o};return this.devSessionUpdateWithRetry(i)}else{let i={shopFqdn:this.options.storeFqdn,appId:this.options.appId,assetsUrl:s,websocketUrl:a};return this.devSessionCreateWithRetry(i)}}catch(r){if(r.statusCode===401)throw new Error("Unauthorized");if(r instanceof Rt)throw r.response.status===401||r.response.status===403?new T("Auth session expired. Please run `shopify app dev` again."):(await this.logger.debug(JSON.stringify(r.response,null,2)),new T("Unknown error"));return r.code==="ETIMEDOUT"?{status:"unknown-error",error:new Error("Request timed out, please check your internet connection and try again.")}:{status:"unknown-error",error:r}}}async createManifest(e){let r=e.extensionEvents.filter(i=>i.type!=="deleted").map(i=>i.extension.uid);e.app.allExtensions.some(i=>i.type==="admin")&&!r.includes("admin")&&r.push("admin");let o=e.app.allExtensions.filter(i=>!r.includes(i.uid)).map(i=>i.uid),n=await e.app.manifest(void 0);await to(n,this.bundlePath),this.statusManager.status.isReady&&(n.modules=n.modules.filter(i=>r.includes(i.uid)));let s=await xt(this.bundlePath),a=n.modules.map(i=>i.assets).filter(i=>s.includes(i));return{manifest:n,inheritedModuleUids:o,assets:a}}async uploadAssetsIfNeeded(e,r){if(!e.length&&!r)return;let o=S(ue(this.bundlePath),`dev-bundle.${this.options.developerPlatformClient.bundleFormat}`),n=[...e.map(a=>`${a}/**`),...ro];r&&n.push("manifest.json"),await oo(this.bundlePath,o,n);let s=await this.getSignedURLWithRetry();return await no(s,o),s}async getSignedURLWithRetry(){return so(this.options.developerPlatformClient,{apiKey:this.options.appId,organizationId:this.options.organizationId,id:this.options.appId})}async devSessionUpdateWithRetry(e){let r=await this.options.developerPlatformClient.devSessionUpdate(e),o=r.devSessionUpdate?.userErrors??[],n=r.devSessionUpdate?.devSession;if(n&&this.currentSessionState){let s=re(this.options.url),a=this.currentSessionState?.userId;if(n.websocketUrl!==s||n.user?.id!==a){let i=n.user?.email;await this.logger.error(`Another developer ${i?`(${i}) `:""}has taken ownership of this dev preview.`);let c=`Another user${i?` (${i})`:""} has taken ownership of this dev preview. Your preview is no longer active.`,d=["You can restart by running",{command:"shopify app dev"},"again."];throw new T(c,d)}this.currentSessionState={websocketUrl:n.websocketUrl,userId:n.user?.id??null,userEmail:n.user?.email??null}}return o.length?{status:"remote-error",error:o}:{status:"updated"}}async devSessionCreateWithRetry(e){let r=await this.options.developerPlatformClient.devSessionCreate(e),o=r.devSessionCreate?.userErrors??[],n=r.devSessionCreate?.warnings??[],s=r.devSessionCreate?.devSession;return s&&(this.currentSessionState={websocketUrl:s.websocketUrl,userId:s.user?.id??null,userEmail:s.user?.email??null}),n.length>0&&await Promise.all(n.map(a=>{let i=a.code==="SESSION_TAKEOVER"?`\u26A0\uFE0F ${a.message}`:a.message;return this.logger.warning(i)})),o.length?{status:"remote-error",error:o}:{status:"created"}}};async function en({app:t,apiKey:e,developerPlatformClient:r,...o}){return{type:"dev-session",prefix:"app-preview",function:Es,options:{app:t,apiKey:e,developerPlatformClient:r,...o}}}var Es=async({stdout:t},e)=>{await qe.start(e,t)};p();p();p();var tn=async({appLog:t,appLogPayload:e,stdout:r,storeName:o,logsDir:n})=>{let s=bt().substring(0,6),i=`${bs(t.log_timestamp)}_${t.source_namespace}_${t.source}_${s}.json`,c=Ao({appLog:t,appLogPayload:e,prettyPrint:!0,storeName:o}),d=S(n,i);try{return await fe(n),await me(d,c),{fullOutputPath:d,identifier:s}}catch(l){throw r.write(`Error while writing log to file: ${l}
8
+ `),l}};function bs(t){let e=new Date(t),r=e.getUTCFullYear(),o=(e.getUTCMonth()+1).toString().padStart(2,"0"),n=e.getUTCDate().toString().padStart(2,"0"),s=e.getUTCHours().toString().padStart(2,"0"),a=e.getUTCMinutes().toString().padStart(2,"0"),i=e.getUTCSeconds().toString().padStart(2,"0"),c=e.getUTCMilliseconds().toString().padStart(3,"0");return`${r}${o}${n}_${s}${a}${i}_${c}Z`}var We=async({stdout:t,appLogsFetchInput:{jwtToken:e,cursor:r},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c,consecutiveResubscribeFailures:d=0})=>{if(!i?.aborted)try{let l=e,u=wo,h=d,w=await o.appLogs({jwtToken:e,cursor:r},a),{errors:m,status:f}=w;if(f===200){h=0;let{app_logs:E}=w;for(let R of E){let x=JSON.parse(R.payload);await D({outputPrefix:R.source,stripAnsi:!1},async()=>{R.log_type===vo?(Ss(R,x,t),x=new ho(go(x))):R.log_type.startsWith(xo)?Us(R,x,t):t.write(JSON.stringify(x));let _=await tn({appLog:R,appLogPayload:x,stdout:t,storeName:s,logsDir:c});t.write(b`${v.gray("\u2514 ")}${v.link("Open log file",`file://${_.fullOutputPath}`,`Log: ${_.fullOutputPath}`)} ${v.gray(`(${_.identifier})`)}\n`.value)})}}else{let E={errors:m.map(x=>({message:x,status:f}))},R=await To({response:E,onThrottle:x=>{C("Request throttled while polling app logs.",t),C(`Retrying in ${x/1e3} seconds.`,t)},onUnknownError:x=>{C("Error while polling app logs.",t),C(`Retrying in ${x/1e3} seconds.`,t)},onResubscribe:()=>n()});if(R.resubscribeResult==="failed"){if(h+=1,h>=yo){C("App log streaming session has expired. Please restart your dev session.",t);return}}else R.resubscribeResult==="succeeded"&&(h=0);R.nextJwtToken&&(l=R.nextJwtToken),u=R.retryIntervalMs}let{cursor:U}=w;setTimeout(()=>{We({stdout:t,appLogsFetchInput:{jwtToken:l,cursor:U??r},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c,consecutiveResubscribeFailures:h}).catch(E=>{g(`Unexpected error during polling: ${E}}
9
+ `)})},u)}catch(l){C("Error while polling app logs.",t),C(`Retrying in ${ot/1e3} seconds.`,t),g(`${l}}
10
+ `),setTimeout(()=>{We({stdout:t,appLogsFetchInput:{jwtToken:e,cursor:void 0},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c}).catch(u=>{g(`Unexpected error during polling: ${u}}
11
+ `)})},ot)}};function Ss(t,e,r){let o=(e.fuel_consumed/Po).toFixed(4);t.status==="success"?r.write(`Function export "${e.export}" executed successfully using ${o}M instructions.`):t.status==="failure"&&r.write(`\u274C Function export "${e.export}" failed to execute with error: ${e.error_type}`);let n=e.logs;n.length>0&&r.write(n.split(`
12
+ `).filter(Boolean).map(s=>b`${v.gray("\u2502 ")}${s}`.value).join(`
13
+ `))}function Us(t,e,r){t.log_type===Eo?r.write("Function network access response retrieved from cache."):t.log_type===bo?e.reason===Uo?r.write("Function network access request executing in background because there is no cached response."):e.reason===Ro&&r.write("Function network access request executing in background because the cached response is about to expire."):t.log_type===So&&(t.status==="success"?r.write("Function network access request executed successfully."):t.status==="failure"&&r.write(`\u274C Function network access request failed to execute with error: ${e.error}.`))}function Rs(t){return t.allExtensions.some(e=>e.isFunctionExtension)}async function rn({developerPlatformClient:t,subscription:{shopIds:e,apiKey:r},storeName:o,organizationId:n,appWatcher:s,localApp:a}){return{type:"app-logs-subscribe",prefix:"app-logs",function:Ts,options:{developerPlatformClient:t,appLogsSubscribeVariables:{shopIds:e,apiKey:r},storeName:o,organizationId:n,appWatcher:s,localApp:a}}}var Ts=async({stdout:t,stderr:e,abortSignal:r},{developerPlatformClient:o,appLogsSubscribeVariables:n,storeName:s,organizationId:a,appWatcher:i,localApp:c})=>{async function d(l){let u=await nt(o,n,a,t),h=c.getLogsDir();await fe(h),await We({stdout:t,appLogsFetchInput:{jwtToken:u},resubscribeCallback:()=>nt(o,n,a),developerPlatformClient:o,storeName:s,organizationId:a,abortSignal:l,logsDir:h})}try{let l=!1,u,h=async w=>{let m=Rs(w.app);if(m&&!l){g("Function extensions detected, starting logs polling"),l=!0,u=new AbortController;try{await d(u.signal)}catch(f){g(`Failed to start function logs: ${f}`,e)}}else!m&&l&&(g("No function extensions detected, stopping logs polling"),l=!1,u?.abort(),u=void 0)};i.onStart(h).onEvent(h)}catch{}};p();async function on(t){return{type:"app-watcher",prefix:"app-preview",options:t,function:As}}var As=async({stdout:t,stderr:e,abortSignal:r},o)=>{let{appWatcher:n}=o;await n.start({stdout:t,stderr:e,signal:r})};p();import{EventEmitter as _s}from"events";var Cs={BUILD_ERROR:{message:"Build error. Please review your code and try again",type:"error"},READY:{message:"Ready, watching for changes in your app",type:"success"},LOADING:{message:"Preparing dev preview",type:"loading"},UPDATED:{message:"Updated",type:"success"},VALIDATION_ERROR:{message:"Validation error in your app configuration",type:"error"},REMOTE_ERROR:{message:"Error updating dev preview",type:"error"},CHANGE_DETECTED:{message:"Change detected, updating dev preview",type:"loading"}},He=class extends _s{currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0};constructor(e){super(),e&&(this.currentStatus=e)}updateStatus(e){let r={...this.currentStatus,...e};It(this.currentStatus,r)||(this.currentStatus=r,this.emit("dev-session-update",r))}setMessage(e){this.updateStatus({statusMessage:Cs[e]})}get status(){return this.currentStatus}reset(){this.currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0}}};p();import*as nn from"http";import*as sn from"https";function an(t){return"errors"in t&&Array.isArray(t.errors)}async function cn(t,e,r,o){let s=(await import("./http-proxy-node16-A6AKKRQH.js")).default.createProxyServer(),a=Is(t,s,o),i=r?sn.createServer(r,a):nn.createServer(a);return i.on("upgrade",ks(t,s,o)),e.addEventListener("abort",()=>{g("Closing reverse HTTP proxy"),i.close()}),{server:i}}function ks(t,e,r){return function(o,n,s){let a=ln(t,o,!0);if(a)return e.ws(o,n,s,{target:a},i=>{D({outputPrefix:"proxy",stripAnsi:!1},()=>{let d=(an(i)?i.errors[i.errors.length-1]:void 0)??i;C(`Error forwarding websocket request: ${d.message}`,r),C(`\u2514 Unreachable target "${a}" for path: "${o.url}"`,r)})});n.destroy()}}function Is(t,e,r){return function(o,n){let s=ln(t,o);if(s)return o.method==="OPTIONS"?(n.writeHead(204,{"Access-Control-Allow-Origin":o.headers.origin??"*","Access-Control-Allow-Methods":o.headers["access-control-request-method"]??"GET, POST, PUT, DELETE, PATCH, OPTIONS","Access-Control-Allow-Headers":o.headers["access-control-request-headers"]??"Content-Type, Authorization","Access-Control-Max-Age":"86400"}),n.end()):e.web(o,n,{target:s},a=>{D({outputPrefix:"proxy",stripAnsi:!1},()=>{let c=(an(a)?a.errors[a.errors.length-1]:void 0)??a;C(`Error forwarding web request: ${c.message}`,r),C(`\u2514 Unreachable target "${s}" for path: "${o.url}"`,r)})});g(b`
14
+ Reverse HTTP proxy error - Invalid path: ${o.url??""}
15
+ These are the allowed paths:
16
+ ${v.json(JSON.stringify(t))}
17
+ `),n.statusCode=500,n.end(`Invalid path ${o.url}`)}}function ln(t,e,r=!1){let o=e.url??"/";for(let n in t)if(o.startsWith(n))return t[n];return r&&t.websocket?t.websocket:t.default}async function pn({localApp:t,remoteAppUpdated:e,developerPlatformClient:r,remoteApp:o,storeFqdn:n,storeId:s,commandOptions:a,network:i,graphiqlPort:c,graphiqlKey:d}){let l=o.apiKey,u=o.apiSecretKeys[0]?.secret??"",h=St(),w=!ft(h[Ce.disableGraphiQLExplorer]),m=await Kr(t),f=new eo(m,i.proxyUrl),U=await we(),E=io(n,l,U),R=E,x=nr(d,u,n),_=w?`http://localhost:${c}/graphiql?key=${encodeURIComponent(x)}`:void 0,ne=m.configuration.embedded,V=m.nonConfigExtensions.length>0,N=new He({isReady:!1,previewURL:R,graphiqlURL:_,appEmbedded:ne,hasExtensions:V}),G=[...await Zo({webs:m.webs,proxyUrl:i.proxyUrl,frontendPort:i.frontendPort,backendPort:i.backendPort,apiKey:l,apiSecret:u,scopes:$r(m.configuration)}),w?await Jo({appName:o.title,appUrl:E,port:c,apiKey:l,apiSecret:u,key:x,storeFqdn:n}):void 0,await Yo({allExtensions:m.realExtensions,storeFqdn:n,storeId:s,apiKey:l,subscriptionProductUrl:a.subscriptionProductUrl,checkoutCartUrl:a.checkoutCartUrl,proxyUrl:i.proxyUrl,appName:m.name,appDotEnvFile:m.dotenv,grantedScopes:o.grantedScopes,appId:o.id,appDirectory:m.directory,appWatcher:f}),await en({app:m,apiKey:l,developerPlatformClient:r,url:i.proxyUrl,appId:o.id,organizationId:o.organizationId,storeFqdn:n,appWatcher:f,appPreviewURL:E,devSessionStatusManager:N}),await ko({remoteApp:o,localApp:m,storeFqdn:n,theme:a.theme,themeExtensionPort:a.themeExtensionPort,storePassword:a.storePassword}),Qo({webs:m.webs,backendPort:i.backendPort,frontendPort:i.frontendPort,organizationId:o.organizationId,developerPlatformClient:r,storeFqdn:n,apiSecret:u,remoteAppUpdated:e}),await rn({developerPlatformClient:r,subscription:{shopIds:[Number(s)],apiKey:l},storeName:n,organizationId:o.organizationId,localApp:t,appWatcher:f}),await on({appWatcher:f})].filter(Ls);return{processes:await $s(G,i.proxyPort,i.reverseProxyCert),previewUrl:R,graphiqlUrl:_,devSessionStatusManager:N}}var Ls=t=>t!==void 0&&t!==!1;async function $s(t,e,r){let o=await Promise.all(t.map(async a=>{let i={};if(a.type==="web"&&a.options.roles.includes(W.Frontend)){let c=a.options.portFromConfig??a.options.port;i.default=`http://localhost:${c}`;let d=a.options.hmrServerOptions;d&&(i.websocket=`http://localhost:${d.port}`,d.httpPaths.forEach(l=>i[l]=`http://localhost:${d.port}`)),a.options.port=c}else if(a.type==="previewable-extension"){let c=await $();i[a.options.pathPrefix]=`http://localhost:${c}`,a.options.port=c}return{process:a,rules:i}})),n=o.map(({process:a})=>a),s=o.map(({rules:a})=>a).reduce((a,i)=>({...a,...i}),{});return Object.keys(s).length>0&&n.push({type:"proxy-server",prefix:"proxy",function:Ms,options:{port:e,rules:s,localhostCert:r}}),n}var Ms=async({abortSignal:t,stdout:e},{port:r,rules:o,localhostCert:n})=>{let{server:s}=await cn(o,t,n,e);B(`Proxy server started on port ${r} ${n?`with certificate ${n.certPath}`:""}`,e),await s.listen(r,"localhost")};p();p();p();var oe=Q(Pe(),1);var un=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function dn(){let[t,e]=(0,oe.useState)(0);return(0,oe.useEffect)(()=>{let r=setInterval(()=>{e(o=>(o+1)%un.length)},70);return()=>clearInterval(r)},[]),oe.default.createElement(L,null,un[t])}p();var A=Q(Pe(),1);var mn=.9,fn=({tabs:t,initialActiveTab:e})=>{let{stdout:r}=Dt(),{isRawModeSupported:o}=ve(),[n,s]=(0,A.useState)(e),[a,i]=(0,A.useState)(Math.floor(r.columns*mn)),[c,d]=(0,A.useState)(!0),l=(0,A.useRef)(null);if(!n)throw new Error("No tabs provided");xe((m,f)=>{(async()=>{if(f?.leftArrow||f?.rightArrow||f?.tab){let x=Object.entries(t).filter(([G,P])=>P.content),_=x.findIndex(([G])=>G===n);if(_===-1)return;let ne=f?.leftArrow?-1:1,V=(_+ne+x.length)%x.length,N=x[V];N&&s(N[0])}let E=t[m];if(E){E.action?await E.action():s(m);return}let R=t[n];if(R?.shortcuts){let x=R.shortcuts.find(_=>_.key===m);x&&(!x.condition||x.condition())&&await x.action()}})()},{isActive:!!o}),(0,A.useLayoutEffect)(()=>{let m=()=>{if(i(Math.floor(r.columns*mn)),!l.current)return;let f=Ft(l.current);d(f.width<r.columns)};return r.on("resize",m),()=>{r.off("resize",m)}},[r]);let u=Object.entries(t).map(([m,f])=>({...f,inputKey:m,header:` (${m}) ${f.label} `})),h=u.filter(m=>!m.action),w=u.filter(m=>m.action);return A.default.createElement(A.default.Fragment,null,A.default.createElement(k,{paddingTop:0,width:a,flexDirection:"row",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},A.default.createElement(k,{ref:l,flexDirection:"row",flexWrap:"nowrap",flexShrink:0,marginRight:3},A.default.createElement(L,{wrap:"truncate-end"},"\u2502",h.map(m=>A.default.createElement(A.default.Fragment,{key:m.inputKey},A.default.createElement(L,{bold:n===m.inputKey,inverse:n===m.inputKey,wrap:"truncate"},m.header),"\u2502")))),c&&A.default.createElement(k,{flexGrow:1,justifyContent:"flex-end"},w.map((m,f)=>A.default.createElement(L,{wrap:"truncate",key:m.inputKey},"(",m.inputKey,") ",m.label,f<w.length-1&&" \u2502 ")))),A.default.createElement(k,{flexDirection:"column",marginLeft:1,marginRight:1,marginTop:1},t[n]?.content))};var y=Q(Pe(),1);var hn=({abortController:t,processes:e,devSessionStatusManager:r,shopFqdn:o,appURL:n,appName:s,organizationName:a,configPath:i,localURL:c,onAbort:d})=>{let{isRawModeSupported:l}=ve(),[u,h]=(0,y.useState)(void 0),[w,m]=(0,y.useState)(void 0),[f,U]=(0,y.useState)(r.status),[E,R]=(0,y.useState)(!1),{isAborted:x}=Gt(t.signal,async P=>{P&&m(typeof P=="string"?P:P.message),r.status.isReady?R(!0):(h("Shutting down dev ..."),await d()),_o()}),_=(0,y.useMemo)(()=>e.map(P=>({...P,action:async(pe,Rn,Tn)=>{try{return await P.action(pe,Rn,Tn)}catch(An){t.abort(An)}}})),[e,t]);(0,y.useEffect)(()=>(r.on("dev-session-update",U),()=>{r.off("dev-session-update",U)}),[]),xe((P,pe)=>{Nt(P,pe,()=>t.abort())},{isActive:!!l});let ne=P=>{switch(P){case"loading":return y.default.createElement(dn,null);case"success":return"\u2705";case"error":return"\u274C"}},V=[{key:"p",shortcutLabel:"Open app preview",linkLabel:"Preview",url:f.previewURL,condition:()=>!!(f.isReady&&f.previewURL),action:async()=>{await K.addPublicMetadata(()=>({cmd_dev_preview_url_opened:!0})),f.previewURL&&await Se(f.previewURL)}},{key:"c",shortcutLabel:"Open Dev Console for extension previews",linkLabel:"Dev Console",url:rt(o),condition:()=>!!(f.isReady&&f.appEmbedded===!1&&f.hasExtensions),action:async()=>{await K.addPublicMetadata(()=>({cmd_dev_preview_url_opened:!0})),await Se(rt(o))}},{key:"g",shortcutLabel:"Open GraphiQL (Admin API)",linkLabel:"GraphiQL",url:f.graphiqlURL,condition:()=>!!(f.isReady&&f.graphiqlURL),action:async()=>{await K.addPublicMetadata(()=>({cmd_dev_graphiql_opened:!0})),f.graphiqlURL&&await Se(f.graphiqlURL)}}],N=V.filter(P=>P.condition?.()??!0),G={d:{label:"Dev status",shortcuts:V,content:y.default.createElement(y.default.Fragment,null,f.statusMessage&&y.default.createElement(L,null,ne(f.statusMessage.type)," ",f.statusMessage.message),l&&N.length>0&&y.default.createElement(k,{marginTop:1,flexDirection:"column"},N.map(P=>y.default.createElement(L,{key:P.key},qt.pointerSmall," ",y.default.createElement(L,{bold:!0},"(",P.key,")")," ",Ye()&&P.url?y.default.createElement(je,{url:P.url,label:P.shortcutLabel}):P.shortcutLabel))),y.default.createElement(k,{marginTop:l?1:0,flexDirection:"column"},u?y.default.createElement(L,null,u):y.default.createElement(y.default.Fragment,null,f.isReady&&!(l&&Ye())&&y.default.createElement(y.default.Fragment,null,N.filter(P=>P.url).map(P=>y.default.createElement(L,{key:P.key},P.linkLabel," URL: ",y.default.createElement(je,{url:P.url})))))))},a:{label:"App info",content:y.default.createElement(k,{flexDirection:"column"},y.default.createElement(ze,{tabularData:[["App:",s??""],["App URL:",n??""],["Local URL:",n?"":c??""],["Config:",i?.split("/").pop()??""],["Org:",a??""]].filter(([,P])=>P)}))},s:{label:"Store info",content:y.default.createElement(k,{flexDirection:"column"},y.default.createElement(ze,{tabularData:[["Dev store:",{link:{url:`https://${o}`}}],["Dev store admin:",{link:{url:`https://${o}/admin`}}],["Org:",a??""]].filter(([,P])=>P)}))},q:{label:"Quit",action:async()=>{t.abort()}}};return y.default.createElement(y.default.Fragment,null,y.default.createElement(Wt,{processes:_,prefixColumnSize:Dr,abortSignal:t.signal,keepRunningAfterProcessesResolve:!0,useAlternativeColorPalette:!0}),E&&y.default.createElement(k,{marginTop:1,flexDirection:"column"},y.default.createElement(Ht,{type:"info",headline:`A preview of your development changes is still available on ${o}.`,body:["Run",{command:"shopify app dev clean"},"to restore the latest released version of your app."],link:{label:"Learn more about dev previews",url:"https://shopify.dev/beta/developer-dashboard/shopify-app-dev"}})),x?null:y.default.createElement(k,{paddingTop:1,flexDirection:"column",flexGrow:1},l?y.default.createElement(fn,{tabs:G,initialActiveTab:"d"}):y.default.createElement(k,{marginY:1,paddingTop:0,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},G.d?.content)),w?y.default.createElement(k,{marginTop:1,flexDirection:"column"},y.default.createElement(L,{color:"red"},w)):null)};var gn=Q(Pe(),1);async function wn({processes:t,previewUrl:e,app:r,abortController:o,graphiqlUrl:n,shopFqdn:s,devSessionStatusManager:a,appURL:i,appName:c,organizationName:d,configPath:l,localURL:u}){if(Kt())return Ot(gn.default.createElement(hn,{processes:t,abortController:o,devSessionStatusManager:a,shopFqdn:s,appURL:i,appName:c,organizationName:d,configPath:l,localURL:u,onAbort:async()=>{await r.developerPlatformClient.devSessionDelete({appId:r.id,shopFqdn:s})}}),{exitOnCtrlC:!1});await Ds({processes:t,previewUrl:e,graphiqlUrl:n,abortController:o})}async function Ds({processes:t,previewUrl:e,graphiqlUrl:r,abortController:o}){return process.stdout.write(`
18
+ Preview URL: ${e}
19
+ `),r&&process.stdout.write(`GraphiQL URL (Admin API): ${r}
20
+ `),Promise.all(t.map(async n=>{await n.action(process.stdout,process.stderr,o.signal)}))}p();function yn(t){if(!t.length)return;let e=t.filter(n=>n.requested!==n.actual);if(e.length===0)return;if(e.length===1&&e[0]){let n=e[0];se({headline:[`A random port will be used for ${n.for} because ${n?.requested} is not available.`],body:["If you want to use a specific port, you can choose a different one by setting the ",{command:n?.flagToRemedy}," flag."]});return}let r=Be(e.map(n=>n.for)).join(" "),o=Be(e.map(n=>({command:n.flagToRemedy})));se({headline:[`Random ports will be used for ${r} because the requested ports are not available.`],body:["If you want to use specific ports, you can choose different ports using the",...o,"flags."]})}p();async function Pn(t,e){return e?e.includes("localhost")?"localhost":(await _t(t)).plugins.find(o=>e?.includes(o))??"custom":void 0}p();var vn=Q(Cn(),1);var Y="v1.4.4",xn="FiloSottile/mkcert",dt=v.genericShellCommand("mkcert");async function Fs(t,e,r,o){let n=e[Ce.mkcertBinaryPath];if(n)return n;let a=S(t,r==="win32"?"mkcert.exe":"mkcert");if(await F(a))return a;let i=await(0,vn.default)("mkcert",{nothrow:!0});return i?(g(b`Found ${dt} at ${v.path(i)}`),i):(await Os(a,r,o),a)}async function Os(t,e,r){let o;switch(e){case"darwin":o=r==="arm64"?`mkcert-${Y}-darwin-arm64`:`mkcert-${Y}-darwin-amd64`;break;case"linux":o=r==="arm64"?`mkcert-${Y}-linux-arm64`:`mkcert-${Y}-linux-amd64`;break;case"win32":o=`mkcert-${Y}-windows-amd64.exe`;break;default:throw new X(`Unsupported platform: ${e}`)}await kr(xn,Y,o,t),g(b`${dt} saved to ${v.path(t)}`)}async function Ns(t){let e=S(t,"mkcert-LICENSE");if(await F(e))return;let r=`https://raw.githubusercontent.com/${xn}/refs/tags/${Y}/LICENSE`,o={headline:"Failed to download mkcert license.",body:["We tried to download the license for mkcert, but the request failed. You can ",{link:{url:r,label:"view the license here"}}]},n;try{if(n=await At(r),!n.ok)return o}catch{return o}let s=await n.text();await me(e,s)}async function En({appDirectory:t,forceInstall:e,env:r=process.env,platform:o=process.platform,arch:n=process.arch}){let s=S(".shopify","localhost-key.pem"),a=S(".shopify","localhost.pem"),i=S(t,s),c=S(t,a);if(await F(i)&&await F(c))return{keyContent:await I(i),certContent:await I(c),certPath:a};if(!(e??await jr()))throw new T(`Localhost certificate and key are required at ${a} and ${s}`);let l="",u;return await be([{title:"Finding or downloading mkcert binary",task:async()=>{let w=S(t,".shopify");l=await Fs(w,r,o,n),u=await Ns(w),g(b`${dt} found at: ${v.path(l)}`)}}]),u&&Ee(u),B(b`Generating self-signed certificate for localhost. You may be prompted for your password.`),await Ue(l,["-install","-key-file",i,"-cert-file",c,"localhost"]),B(b`${v.successIcon()} Certificate generated at ${a}\n`),await jt()&&(se({headline:"It looks like you're using WSL.",body:["Additional steps are required to configure certificate trust in Windows."],link:{label:"See Shopify CLI documentation",url:"https://shopify.dev/docs/apps/build/cli-for-apps/networking-options#localhost-based-development-with-windows-subsystem-for-linux-wsl"}}),B("\u{1F449} Press any key to continue"),await Bt(),B("")),{keyContent:await I(i),certContent:await I(c),certPath:ht(t,c)}}p();function bn(){let t=["Your app has extensions which need to be assigned",{command:"uid"},"identifiers."],e=["You must first map IDs to your existing extensions by running",{command:"shopify app deploy"},"interactively, without",{command:"--allow-updates"},"or",{command:"--allow-deletes"},", to finish the migration."],r={title:"Reference",body:{list:{items:[{link:{label:"Migrating from the Partner Dashboard",url:"https://shopify.dev/docs/apps/build/dev-dashboard/migrate-from-partners"}}]}}};throw new T(t,void 0,[e],[r])}async function Sn(t){let e=await qs(t);await Ws(e);let{processes:r,graphiqlUrl:o,previewUrl:n,devSessionStatusManager:s}=await pn(e);await Gs(e),await js({processes:r,previewUrl:n,graphiqlUrl:o,config:e,devSessionStatusManager:s})}async function qs(t){let{app:e,remoteApp:r,developerPlatformClient:o,store:n,specifications:s,tunnel:a}=t,i;if(a.mode==="auto"){let E=await $();i=await Gr(t.commandConfig,E,"cloudflare")}let c=await Yr(r,o,s,r.flags);r.configuration=c,Vr({app:e,remoteApp:r,selectedStore:n,cachedInfo:et(t.directory),organization:t.organization,tunnelMode:a.mode}),e.configuration.build?.dev_store_url&&(e.configuration.build={...e.configuration.build,dev_store_url:n.shopDomain},await(await Vt.read(e.configPath)).patch({build:{dev_store_url:n.shopDomain}})),!t.skipDependenciesInstallation&&!t.project.usesWorkspaces&&await Lr(t.project);let d=t.graphiqlPort??await $(ie.graphiql),l=[{for:"GraphiQL",flagToRemedy:"--graphiql-port",requested:t.graphiqlPort??ie.graphiql,actual:d}];a.mode==="use-localhost"&&l.push({for:"localhost",flagToRemedy:"--localhost-port",requested:a.requestedPort,actual:a.actualPort}),yn(l);let{webs:u,...h}=await Ks(e.directory,e.webs,d,a,i,r.configuration,t.installMkcert);e.webs=u;let w=e.configuration.build?.automatically_update_urls_on_dev,m=et(t.directory)?.previousAppId,f=r.apiKey,U=await Bs(u,t.update,h,e,w,r,f);return{storeFqdn:n.shopDomain,storeId:n.shopId,remoteApp:r,remoteAppUpdated:r.apiKey!==m,localApp:e,developerPlatformClient:o,commandOptions:t,network:h,partnerUrlsUpdated:U,graphiqlPort:d,graphiqlKey:t.graphiqlKey}}async function Ws(t){await Hs(t)}async function Hs(t){let{developerPlatformClient:e,remoteApp:r}=t;(await e.appExtensionRegistrations(r)).app.extensionRegistrations.filter(n=>n.type.toLowerCase()!=="webhook_subscription").every(n=>n.id)||bn()}async function Gs(t){Or({directory:t.commandOptions.directory,previousAppId:t.remoteApp.apiKey}),await zs({devOptions:t.commandOptions,tunnelUrl:t.network.proxyUrl,shouldUpdateURLs:t.partnerUrlsUpdated,storeFqdn:t.storeFqdn}),await Lt({config:t.commandOptions.commandConfig,exitMode:"ok"})}async function Bs(t,e,r,o,n,s,a){let{backendConfig:i,frontendConfig:c}=z(t),d=!1;if((c??i)&&e){let l=qr(r.proxyUrl,t.map(({configuration:u})=>u.auth_callback_path).find(u=>u),o.configuration.app_proxy);d=await Hr({currentURLs:r.currentUrls,appDirectory:o.directory,cachedUpdateURLs:n,newApp:s.newApp,localApp:o,apiKey:a,newURLs:l}),d&&o.setDevApplicationURLs(l)}return d}async function Ks(t,e,r,o,n,s,a){let{backendConfig:i,frontendConfig:c}=z(e);await Ys(e,r);let d=o.mode==="use-localhost"?{noTunnelUseLocalhost:!0,port:o.actualPort}:{noTunnelUseLocalhost:!1,tunnelUrl:o.mode==="custom"?o.url:void 0,tunnelClient:n},[{frontendUrl:l,frontendPort:u,usingLocalhost:h},w,m]=await Promise.all([Nr(d),Ut()??i?.configuration.port??$(),Wr(s)]),f=h?`${l}:${u}`:l,U=c?.configuration.port;c&&(U??=c===i?w:await $(),c.configuration.port=U),U=U??await $();let E;if(o.mode==="use-localhost"){let{keyContent:R,certContent:x,certPath:_}=await En({appDirectory:t,forceInstall:a});E={key:R,cert:x,certPath:_,port:o.actualPort}}return{proxyUrl:f,proxyPort:u,frontendPort:U,backendPort:w,currentUrls:m,webs:e,reverseProxyCert:E}}async function js({processes:t,previewUrl:e,graphiqlUrl:r,config:o,devSessionStatusManager:n}){let s=new Et,a=t.map(d=>({prefix:d.prefix,action:async(u,h,w)=>{let m=d.function;return m({stdout:u,stderr:h,abortSignal:w},d.options)}})),i=o.developerPlatformClient,c={id:o.remoteApp.id,developerPlatformClient:i};return wn({processes:a,previewUrl:e,graphiqlUrl:r,app:c,abortController:s,shopFqdn:o.storeFqdn,devSessionStatusManager:n,appURL:o.localApp.devApplicationURLs?.applicationUrl,appName:o.remoteApp.title,organizationName:o.commandOptions.organization.businessName,configPath:o.localApp.configPath,localURL:o.network.proxyUrl})}async function zs(t){let e=await Pn(t.devOptions.commandConfig,t.tunnelUrl);await K.addPublicMetadata(()=>({cmd_dev_tunnel_type:e,cmd_dev_tunnel_custom_hash:e==="custom"?Ke(t.tunnelUrl):void 0,cmd_dev_urls_updated:t.shouldUpdateURLs,store_fqdn_hash:Ke(t.storeFqdn),store_domain:t.storeFqdn,cmd_app_dependency_installation_skipped:t.devOptions.skipDependenciesInstallation})),await K.addSensitiveMetadata(()=>({store_fqdn:t.storeFqdn,cmd_dev_tunnel_custom:e==="custom"?t.tunnelUrl:void 0}))}async function Ys(t,e){let r=t.map(n=>n.configuration.port).filter(n=>n),o=r.find((n,s)=>r.indexOf(n)!==s);if(o)throw new T(`Found port ${o} for multiple webs.`,"Please define a unique port for each web.");await Promise.all([...r.map(async n=>{if(!await Ve(n))throw new T(`Hard-coded port ${n} is not available, please choose a different one.`)}),(async()=>{if(!await Ve(e)){let s=`Port ${e} is not available for serving GraphiQL.`,a=["Choose a different port for the",{command:"--graphiql-port"},"flag."];throw new T(s,a)}})()])}p();async function Un({useLocalhost:t,localhostPort:e,tunnelUrl:r}){if(r)return{mode:"custom",url:r};if(!t&&!e)return{mode:"auto"};let o=e??ie.localhost,n=await $(o);if(e&&n!==o){let s=`Port ${e} is not available.`,a=["Choose a different port for the",{command:"--localhost-port"},"flag."];throw new T(s,a)}return{mode:"use-localhost",requestedPort:o,actualPort:n}}var M=Q(_n(),1);var mt=class t extends Jr{static get requiresSyncAnalytics(){return!0}static summary="Run the app.";static descriptionWithMarkdown="Builds and previews your app on a dev store, and watches for changes. [Read more about testing apps locally](https://shopify.dev/docs/apps/build/cli-for-apps/test-apps-locally).";static description=this.descriptionWithoutMarkdown();static flags={...Qt,...Ir,store:M.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>ye(e)}),"skip-dependencies-installation":M.Flags.boolean({description:"Skips the installation of dependencies. Deprecated, use workspaces instead.",env:"SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION",default:!1}),"no-update":M.Flags.boolean({description:"Uses the app URL from the toml file instead an autogenerated URL for dev.",env:"SHOPIFY_FLAG_NO_UPDATE",default:!1}),"subscription-product-url":M.Flags.string({description:'Resource URL for subscription UI extension. Format: "/products/{productId}"',env:"SHOPIFY_FLAG_SUBSCRIPTION_PRODUCT_URL"}),"checkout-cart-url":M.Flags.string({description:'Resource URL for checkout UI extension. Format: "/cart/{productVariantID}:{productQuantity}"',env:"SHOPIFY_FLAG_CHECKOUT_CART_URL"}),"tunnel-url":M.Flags.string({description:'Use a custom tunnel, it must be running before executing dev. Format: "https://my-tunnel-url:port".',env:"SHOPIFY_FLAG_TUNNEL_URL",exclusive:["tunnel"]}),"use-localhost":M.Flags.boolean({description:"Service entry point will listen to localhost. A tunnel won't be used. Will work for testing many app features, but not those that directly invoke your app (E.g: Webhooks)",env:"SHOPIFY_FLAG_USE_LOCALHOST",exclusive:["tunnel-url"]}),"install-mkcert":M.Flags.boolean({description:"Install and use mkcert to generate localhost certificates when --use-localhost is enabled without prompting.",env:"SHOPIFY_FLAG_INSTALL_MKCERT",dependsOn:["use-localhost"]}),"localhost-port":Re({description:"Port to use for localhost.",env:"SHOPIFY_FLAG_LOCALHOST_PORT"}),theme:M.Flags.string({char:"t",description:"Theme ID or name of the theme app extension host theme.",env:"SHOPIFY_FLAG_THEME"}),"theme-app-extension-port":Re({description:"Local port of the theme app extension development server.",env:"SHOPIFY_FLAG_THEME_APP_EXTENSION_PORT"}),"store-password":M.Flags.string({description:"The password for storefronts with password protection.",env:"SHOPIFY_FLAG_STORE_PASSWORD"}),notify:M.Flags.string({description:"The file path or URL. The file path is to a file that you want updated on idle. The URL path is where you want a webhook posted to report on file changes.",env:"SHOPIFY_FLAG_NOTIFY"}),"graphiql-port":Re({hidden:!0,description:"Local port of the GraphiQL development server.",env:"SHOPIFY_FLAG_GRAPHIQL_PORT"}),"graphiql-key":M.Flags.string({hidden:!0,description:"Key used to authenticate GraphiQL requests. By default, a key is automatically derived from the app secret. Use this flag to override with a custom key.",env:"SHOPIFY_FLAG_GRAPHIQL_KEY"})};static analyticsStopCommand(){return"app dev stop"}async run(){let{flags:e}=await this.parse(t),r=await Un({useLocalhost:e["use-localhost"]??!1,tunnelUrl:e["tunnel-url"],localhostPort:e["localhost-port"]});await $t(()=>({cmd_app_dependency_installation_skipped:e["skip-dependencies-installation"],cmd_app_reset_used:e.reset,cmd_dev_tunnel_type:r.mode})),await Br(e.path);let o=await Qr({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),n=await Xr({appContextResult:o,storeFqdn:e.store,forceReselectStore:e.reset}),s={...o,store:n,directory:e.path,update:!e["no-update"],skipDependenciesInstallation:e["skip-dependencies-installation"],commandConfig:this.config,subscriptionProductUrl:e["subscription-product-url"],checkoutCartUrl:e["checkout-cart-url"],theme:e.theme,themeExtensionPort:e["theme-app-extension-port"],storePassword:e["store-password"],notify:e.notify,graphiqlPort:e["graphiql-port"],graphiqlKey:e["graphiql-key"],installMkcert:e["install-mkcert"]??!1,tunnel:r};return await Sn(s),{app:o.app}}};export{ka as a,mt as b};
@@ -0,0 +1,9 @@
1
+ import{b as i}from"./chunk-JJJTPEMD.js";import{b as o}from"./chunk-RY2SJVWM.js";import{N as t}from"./chunk-GMTNOCMS.js";import{a as p}from"./chunk-CTNBSUVU.js";import{e as h,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function c(r){let e=new URLSearchParams;e.append("search",r??""),await t(`https://shopify.dev?${e.toString()}`)}var n=h(p(),1),s=class r extends o{static description="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 usage="search [query]";static examples=[`# open the search modal on Shopify.dev
2
+ shopify search
3
+
4
+ # search for a term on Shopify.dev
5
+ shopify search <query>
6
+
7
+ # search for a phrase on Shopify.dev
8
+ shopify search "<a search query separated by spaces>"
9
+ `];static args={query:n.Args.string()};static flags={...i};async run(){let{args:e}=await this.parse(r);await c(e.query)}};export{s as a};
@@ -0,0 +1 @@
1
+ import{a as s}from"./chunk-HZIX3DIT.js";import{a as e}from"./chunk-6EBLULOC.js";import{a as o}from"./chunk-WCRZJY3P.js";import{b as i}from"./chunk-RY2SJVWM.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};
@@ -0,0 +1,3 @@
1
+ import{a as h}from"./chunk-2CYVZUYT.js";import{p as m,v as a}from"./chunk-OORWOTAP.js";import{b as n}from"./chunk-JJJTPEMD.js";import{wa as t}from"./chunk-YN6A26QL.js";import{a as w}from"./chunk-CTNBSUVU.js";import{S as s}from"./chunk-Y34LWI3S.js";import{e as u,g as i}from"./chunk-VKWPEFWQ.js";i();var r=u(w(),1);var o=class extends a{static summary="Creates a shareable, unpublished, and new theme on your theme library with a randomized name.";static descriptionWithMarkdown=`Uploads your theme as a new, unpublished theme in your theme library. The theme is given a randomized name.
2
+
3
+ This command returns a [preview link](https://help.shopify.com/manual/online-store/themes/adding-themes#share-a-theme-preview-with-others) that you can share with others.`;static description=this.descriptionWithoutMarkdown();static flags={...n,...m,force:r.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"}),listing:r.Flags.string({description:"The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.",env:"SHOPIFY_FLAG_LISTING"})};static multiEnvironmentsFlags=["store","password","path"];async command(e,d,p,g,c){let l={environment:e.environment,force:e.force,noColor:e["no-color"],password:e.password,path:e.path,store:e.store,theme:s("creative"),unpublished:!0,listing:e.listing};t("theme-command:share"),await h(l,d,p,c),t("theme-command:share")}};export{o as a};
@@ -0,0 +1,10 @@
1
+ import{a as hD}from"./chunk-5HBIIYSK.js";import{b as pD,e as X,g as BD,h as M}from"./chunk-B4OMIONW.js";import{a as fD,c as g,d as dD,e as J,g as i}from"./chunk-VKWPEFWQ.js";var pu=g((It,du)=>{i();du.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var yu=g((Qt,Tu)=>{i();var GD=pD(),qD=function(){return GD.Date.now()};Tu.exports=qD});var Su=g((ur,vu)=>{i();var HD=/\s/;function VD(u){for(var D=u.length;D--&&HD.test(u.charAt(D)););return D}vu.exports=VD});var Nu=g((er,$u)=>{i();var UD=Su(),KD=/^\s+/;function zD(u){return u&&u.slice(0,UD(u)+1).replace(KD,"")}$u.exports=zD});var _u=g((rr,Lu)=>{i();var YD=Nu(),Ru=X(),JD=BD(),Wu=NaN,XD=/^[-+]0x[0-9a-f]+$/i,QD=/^0b[01]+$/i,ZD=/^0o[0-7]+$/i,ue=parseInt;function De(u){if(typeof u=="number")return u;if(JD(u))return Wu;if(Ru(u)){var D=typeof u.valueOf=="function"?u.valueOf():u;u=Ru(D)?D+"":D}if(typeof u!="string")return u===0?u:+u;u=YD(u);var e=QD.test(u);return e||ZD.test(u)?ue(u.slice(2),e?2:8):XD.test(u)?Wu:+u}Lu.exports=De});var ku=g((nr,Iu)=>{i();var ee=X(),eu=yu(),Ou=_u(),te="Expected a function",re=Math.max,Fe=Math.min;function ne(u,D,e){var t,r,F,o,n,s,C=0,b=!1,c=!1,p=!0;if(typeof u!="function")throw new TypeError(te);D=Ou(D)||0,ee(e)&&(b=!!e.leading,c="maxWait"in e,F=c?re(Ou(e.maxWait)||0,D):F,p="trailing"in e?!!e.trailing:p);function l(d){var x=t,R=r;return t=r=void 0,C=d,o=u.apply(R,x),o}function B(d){return C=d,n=setTimeout(h,D),b?l(d):o}function f(d){var x=d-s,R=d-C,Eu=D-x;return c?Fe(Eu,F-R):Eu}function m(d){var x=d-s,R=d-C;return s===void 0||x>=D||x<0||c&&R>=F}function h(){var d=eu();if(m(d))return k(d);n=setTimeout(h,f(d))}function k(d){return n=void 0,p&&t?l(d):(t=r=void 0,o)}function Cu(){n!==void 0&&clearTimeout(n),C=0,t=s=r=n=void 0}function lD(){return n===void 0?o:k(eu())}function Y(){var d=eu(),x=m(d);if(t=arguments,r=this,s=d,x){if(n===void 0)return B(s);if(c)return clearTimeout(n),n=setTimeout(h,D),l(s)}return n===void 0&&(n=setTimeout(h,D)),o}return Y.cancel=Cu,Y.flush=lD,Y}Iu.exports=ne});var Ce=g((ir,Mu)=>{i();var oe=ku(),ie=X(),se="Expected a function";function ae(u,D,e){var t=!0,r=!0;if(typeof u!="function")throw new TypeError(se);return ie(e)&&(t="leading"in e?!!e.leading:t,r="trailing"in e?!!e.trailing:r),oe(u,D,{leading:t,maxWait:D,trailing:r})}Mu.exports=ae});var Qu=g((Mr,Fu)=>{"use strict";i();var Xu=(u,D)=>{for(let e of Reflect.ownKeys(D))Object.defineProperty(u,e,Object.getOwnPropertyDescriptor(D,e));return u};Fu.exports=Xu;Fu.exports.default=Xu});var uD=g((Pr,K)=>{"use strict";i();var ze=Qu(),U=new WeakMap,Zu=(u,D={})=>{if(typeof u!="function")throw new TypeError("Expected a function");let e,t=0,r=u.displayName||u.name||"<anonymous>",F=function(...o){if(U.set(F,++t),t===1)e=u.apply(this,o),u=null;else if(D.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return e};return ze(F,u),U.set(F,t),F};K.exports=Zu;K.exports.default=Zu;K.exports.callCount=u=>{if(!U.has(u))throw new Error(`The given function \`${u.name}\` is not wrapped by the \`onetime\` package`);return U.get(u)}});var nD=g((nF,it)=>{it.exports={single:{topLeft:"\u250C",top:"\u2500",topRight:"\u2510",right:"\u2502",bottomRight:"\u2518",bottom:"\u2500",bottomLeft:"\u2514",left:"\u2502"},double:{topLeft:"\u2554",top:"\u2550",topRight:"\u2557",right:"\u2551",bottomRight:"\u255D",bottom:"\u2550",bottomLeft:"\u255A",left:"\u2551"},round:{topLeft:"\u256D",top:"\u2500",topRight:"\u256E",right:"\u2502",bottomRight:"\u256F",bottom:"\u2500",bottomLeft:"\u2570",left:"\u2502"},bold:{topLeft:"\u250F",top:"\u2501",topRight:"\u2513",right:"\u2503",bottomRight:"\u251B",bottom:"\u2501",bottomLeft:"\u2517",left:"\u2503"},singleDouble:{topLeft:"\u2553",top:"\u2500",topRight:"\u2556",right:"\u2551",bottomRight:"\u255C",bottom:"\u2500",bottomLeft:"\u2559",left:"\u2551"},doubleSingle:{topLeft:"\u2552",top:"\u2550",topRight:"\u2555",right:"\u2502",bottomRight:"\u255B",bottom:"\u2550",bottomLeft:"\u2558",left:"\u2502"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"\u2198",top:"\u2193",topRight:"\u2199",right:"\u2190",bottomRight:"\u2196",bottom:"\u2191",bottomLeft:"\u2197",left:"\u2192"}}});var st=g((oF,su)=>{"use strict";i();var oD=nD();su.exports=oD;su.exports.default=oD});var sD=g((sF,iD)=>{"use strict";i();var at=/[|\\{}()[\]^$+*?.-]/g;iD.exports=u=>{if(typeof u!="string")throw new TypeError("Expected a string");return u.replace(at,"\\$&")}});var dt=g((CF,ED)=>{"use strict";i();var Ct=sD(),Et=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",CD=[].concat(fD("module").builtinModules,"bootstrap_node","node").map(u=>new RegExp(`(?:\\((?:node:)?${u}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${u}(?:\\.js)?:\\d+:\\d+$)`));CD.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var au=class u{constructor(D){D={ignoredPackages:[],...D},"internals"in D||(D.internals=u.nodeInternals()),"cwd"in D||(D.cwd=Et),this._cwd=D.cwd.replace(/\\/g,"/"),this._internals=[].concat(D.internals,ct(D.ignoredPackages)),this._wrapCallSite=D.wrapCallSite||!1}static nodeInternals(){return[...CD]}clean(D,e=0){e=" ".repeat(e),Array.isArray(D)||(D=D.split(`
2
+ `)),!/^\s*at /.test(D[0])&&/^\s*at /.test(D[1])&&(D=D.slice(1));let t=!1,r=null,F=[];return D.forEach(o=>{if(o=o.replace(/\\/g,"/"),this._internals.some(s=>s.test(o)))return;let n=/^\s*at /.test(o);t?o=o.trimEnd().replace(/^(\s+)at /,"$1"):(o=o.trim(),n&&(o=o.slice(3))),o=o.replace(`${this._cwd}/`,""),o&&(n?(r&&(F.push(r),r=null),F.push(o)):(t=!0,r=o))}),F.map(o=>`${e}${o}
3
+ `).join("")}captureString(D,e=this.captureString){typeof D=="function"&&(e=D,D=1/0);let{stackTraceLimit:t}=Error;D&&(Error.stackTraceLimit=D);let r={};Error.captureStackTrace(r,e);let{stack:F}=r;return Error.stackTraceLimit=t,this.clean(F)}capture(D,e=this.capture){typeof D=="function"&&(e=D,D=1/0);let{prepareStackTrace:t,stackTraceLimit:r}=Error;Error.prepareStackTrace=(n,s)=>this._wrapCallSite?s.map(this._wrapCallSite):s,D&&(Error.stackTraceLimit=D);let F={};Error.captureStackTrace(F,e);let{stack:o}=F;return Object.assign(Error,{prepareStackTrace:t,stackTraceLimit:r}),o}at(D=this.at){let[e]=this.capture(1,D);if(!e)return{};let t={line:e.getLineNumber(),column:e.getColumnNumber()};aD(t,e.getFileName(),this._cwd),e.isConstructor()&&Object.defineProperty(t,"constructor",{value:!0,configurable:!0}),e.isEval()&&(t.evalOrigin=e.getEvalOrigin()),e.isNative()&&(t.native=!0);let r;try{r=e.getTypeName()}catch{}r&&r!=="Object"&&r!=="[object Object]"&&(t.type=r);let F=e.getFunctionName();F&&(t.function=F);let o=e.getMethodName();return o&&F!==o&&(t.method=o),t}parseLine(D){let e=D&&D.match(lt);if(!e)return null;let t=e[1]==="new",r=e[2],F=e[3],o=e[4],n=Number(e[5]),s=Number(e[6]),C=e[7],b=e[8],c=e[9],p=e[10]==="native",l=e[11]===")",B,f={};if(b&&(f.line=Number(b)),c&&(f.column=Number(c)),l&&C){let m=0;for(let h=C.length-1;h>0;h--)if(C.charAt(h)===")")m++;else if(C.charAt(h)==="("&&C.charAt(h-1)===" "&&(m--,m===-1&&C.charAt(h-1)===" ")){let k=C.slice(0,h-1);C=C.slice(h+1),r+=` (${k}`;break}}if(r){let m=r.match(ft);m&&(r=m[1],B=m[2])}return aD(f,C,this._cwd),t&&Object.defineProperty(f,"constructor",{value:!0,configurable:!0}),F&&(f.evalOrigin=F,f.evalLine=n,f.evalColumn=s,f.evalFile=o&&o.replace(/\\/g,"/")),p&&(f.native=!0),r&&(f.function=r),B&&r!==B&&(f.method=B),f}};function aD(u,D,e){D&&(D=D.replace(/\\/g,"/"),D.startsWith(`${e}/`)&&(D=D.slice(e.length+1)),u.file=D)}function ct(u){if(u.length===0)return[];let D=u.map(e=>Ct(e));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${D.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var lt=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),ft=/^(.*?) \[as (.*?)\]$/;ED.exports=au});i();i();i();i();var j=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],P=[12288,12288,65281,65376,65504,65510],Q=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Z=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],W=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];i();var G=(u,D)=>{let e=0,t=Math.floor(u.length/2)-1;for(;e<=t;){let r=Math.floor((e+t)/2),F=r*2;if(D<u[F])t=r-1;else if(D>u[F+1])e=r+1;else return!0}return!1};var gD=j[0],mD=j.at(-1),AD=P[0],bD=P.at(-1),Tt=Q[0],yt=Q.at(-1),vt=Z[0],St=Z.at(-1),xD=W[0],wD=W.at(-1),cu=19968,[TD,yD]=vD(W);function vD(u){let D=u[0],e=u[1];for(let t=0;t<u.length;t+=2){let r=u[t],F=u[t+1];if(cu>=r&&cu<=F)return[r,F];F-r>e-D&&(D=r,e=F)}return[D,e]}var lu=u=>u<gD||u>mD?!1:G(j,u),L=u=>u<AD||u>bD?!1:G(P,u);var _=u=>u>=TD&&u<=yD?!0:u<xD||u>wD?!1:G(W,u);function SD(u){if(!Number.isSafeInteger(u))throw new TypeError(`Expected a code point, got \`${typeof u}\`.`)}function fu(u,{ambiguousAsWide:D=!1}={}){return SD(u),L(u)||_(u)||D&&lu(u)?2:1}var Bu=J(pu(),1),$D=new Intl.Segmenter,ND=/^\p{Default_Ignorable_Code_Point}$/u;function w(u,D={}){if(typeof u!="string"||u.length===0)return 0;let{ambiguousIsNarrow:e=!0,countAnsiEscapeCodes:t=!1}=D;if(t||(u=M(u)),u.length===0)return 0;let r=0,F={ambiguousAsWide:!e};for(let{segment:o}of $D.segment(u)){let n=o.codePointAt(0);if(!(n<=31||n>=127&&n<=159)&&!(n>=8203&&n<=8207||n===65279)&&!(n>=768&&n<=879||n>=6832&&n<=6911||n>=7616&&n<=7679||n>=8400&&n<=8447||n>=65056&&n<=65071)&&!(n>=55296&&n<=57343)&&!(n>=65024&&n<=65039)&&!ND.test(o)){if((0,Bu.default)().test(o)){r+=2;continue}r+=fu(n,F)}}return r}i();i();var hu=(u=0)=>D=>`\x1B[${D+u}m`,gu=(u=0)=>D=>`\x1B[${38+u};5;${D}m`,mu=(u=0)=>(D,e,t)=>`\x1B[${38+u};2;${D};${e};${t}m`,E={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},qt=Object.keys(E.modifier),RD=Object.keys(E.color),WD=Object.keys(E.bgColor),Ht=[...RD,...WD];function LD(){let u=new Map;for(let[D,e]of Object.entries(E)){for(let[t,r]of Object.entries(e))E[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},e[t]=E[t],u.set(r[0],r[1]);Object.defineProperty(E,D,{value:e,enumerable:!1})}return Object.defineProperty(E,"codes",{value:u,enumerable:!1}),E.color.close="\x1B[39m",E.bgColor.close="\x1B[49m",E.color.ansi=hu(),E.color.ansi256=gu(),E.color.ansi16m=mu(),E.bgColor.ansi=hu(10),E.bgColor.ansi256=gu(10),E.bgColor.ansi16m=mu(10),Object.defineProperties(E,{rgbToAnsi256:{value(D,e,t){return D===e&&e===t?D<8?16:D>248?231:Math.round((D-8)/247*24)+232:16+36*Math.round(D/255*5)+6*Math.round(e/255*5)+Math.round(t/255*5)},enumerable:!1},hexToRgb:{value(D){let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));if(!e)return[0,0,0];let[t]=e;t.length===3&&(t=[...t].map(F=>F+F).join(""));let r=Number.parseInt(t,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:D=>E.rgbToAnsi256(...E.hexToRgb(D)),enumerable:!1},ansi256ToAnsi:{value(D){if(D<8)return 30+D;if(D<16)return 90+(D-8);let e,t,r;if(D>=232)e=((D-232)*10+8)/255,t=e,r=e;else{D-=16;let n=D%36;e=Math.floor(D/36)/5,t=Math.floor(n/6)/5,r=n%6/5}let F=Math.max(e,t,r)*2;if(F===0)return 30;let o=30+(Math.round(r)<<2|Math.round(t)<<1|Math.round(e));return F===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(D,e,t)=>E.ansi256ToAnsi(E.rgbToAnsi256(D,e,t)),enumerable:!1},hexToAnsi:{value:D=>E.ansi256ToAnsi(E.hexToAnsi256(D)),enumerable:!1}}),E}var _D=LD(),A=_D;var H=new Set(["\x1B","\x9B"]),OD=39,Du="\x07",xu="[",ID="]",wu="m",q=`${ID}8;;`,Au=u=>`${H.values().next().value}${xu}${u}${wu}`,bu=u=>`${H.values().next().value}${q}${u}${Du}`,kD=u=>u.split(" ").map(D=>w(D)),uu=(u,D,e)=>{let t=[...D],r=!1,F=!1,o=w(M(u.at(-1)));for(let[n,s]of t.entries()){let C=w(s);if(o+C<=e?u[u.length-1]+=s:(u.push(s),o=0),H.has(s)&&(r=!0,F=t.slice(n+1,n+1+q.length).join("")===q),r){F?s===Du&&(r=!1,F=!1):s===wu&&(r=!1);continue}o+=C,o===e&&n<t.length-1&&(u.push(""),o=0)}!o&&u.at(-1).length>0&&u.length>1&&(u[u.length-2]+=u.pop())},MD=u=>{let D=u.split(" "),e=D.length;for(;e>0&&!(w(D[e-1])>0);)e--;return e===D.length?u:D.slice(0,e).join(" ")+D.slice(e).join("")},jD=(u,D,e={})=>{if(e.trim!==!1&&u.trim()==="")return"";let t="",r,F,o=kD(u),n=[""];for(let[c,p]of u.split(" ").entries()){e.trim!==!1&&(n[n.length-1]=n.at(-1).trimStart());let l=w(n.at(-1));if(c!==0&&(l>=D&&(e.wordWrap===!1||e.trim===!1)&&(n.push(""),l=0),(l>0||e.trim===!1)&&(n[n.length-1]+=" ",l++)),e.hard&&o[c]>D){let B=D-l,f=1+Math.floor((o[c]-B-1)/D);Math.floor((o[c]-1)/D)<f&&n.push(""),uu(n,p,D);continue}if(l+o[c]>D&&l>0&&o[c]>0){if(e.wordWrap===!1&&l<D){uu(n,p,D);continue}n.push("")}if(l+o[c]>D&&e.wordWrap===!1){uu(n,p,D);continue}n[n.length-1]+=p}e.trim!==!1&&(n=n.map(c=>MD(c)));let s=n.join(`
4
+ `),C=[...s],b=0;for(let[c,p]of C.entries()){if(t+=p,H.has(p)){let{groups:B}=new RegExp(`(?:\\${xu}(?<code>\\d+)m|\\${q}(?<uri>.*)${Du})`).exec(s.slice(b))||{groups:{}};if(B.code!==void 0){let f=Number.parseFloat(B.code);r=f===OD?void 0:f}else B.uri!==void 0&&(F=B.uri.length===0?void 0:B.uri)}let l=A.codes.get(Number(r));C[c+1]===`
5
+ `?(F&&(t+=bu("")),r&&l&&(t+=Au(l))):p===`
6
+ `&&(r&&l&&(t+=Au(r)),F&&(t+=bu(F))),b+=p.length}return t};function PD(u,D,e){return String(u).normalize().replaceAll(`\r
7
+ `,`
8
+ `).split(`
9
+ `).map(t=>jD(t,D,e)).join(`
10
+ `)}var zu={};dD(zu,{ConEmu:()=>Ku,beep:()=>Pe,beginSynchronizedOutput:()=>Hu,clearScreen:()=>Le,clearTerminal:()=>Ie,clearViewport:()=>_e,cursorBackward:()=>he,cursorDown:()=>pe,cursorForward:()=>Be,cursorGetPosition:()=>Ae,cursorHide:()=>we,cursorLeft:()=>Gu,cursorMove:()=>de,cursorNextLine:()=>be,cursorPrevLine:()=>xe,cursorRestorePosition:()=>me,cursorSavePosition:()=>ge,cursorShow:()=>Te,cursorTo:()=>fe,cursorUp:()=>Pu,endSynchronizedOutput:()=>Vu,enterAlternativeScreen:()=>ke,eraseDown:()=>$e,eraseEndLine:()=>ve,eraseLine:()=>qu,eraseLines:()=>ye,eraseScreen:()=>V,eraseStartLine:()=>Se,eraseUp:()=>Ne,exitAlternativeScreen:()=>Me,iTerm:()=>Uu,image:()=>qe,link:()=>Ge,scrollDown:()=>We,scrollUp:()=>Re,setCwd:()=>He,synchronizedOutput:()=>je});i();import v from"node:process";import Ee from"node:os";i();var y=globalThis.window?.document!==void 0,ar=globalThis.process?.versions?.node!==void 0,Cr=globalThis.process?.versions?.bun!==void 0,Er=globalThis.Deno?.version?.deno!==void 0,cr=globalThis.process?.versions?.electron!==void 0,lr=globalThis.navigator?.userAgent?.includes("jsdom")===!0,fr=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,dr=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,pr=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,Br=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,O=globalThis.navigator?.userAgentData?.platform,hr=O==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",gr=O==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",mr=O==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",Ar=O==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),br=O==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var a="\x1B[",S="\x1B]",T="\x07",I=";",ju=!y&&v.env.TERM_PROGRAM==="Apple_Terminal",ce=!y&&v.platform==="win32",le=!y&&(v.env.TERM?.startsWith("screen")||v.env.TERM?.startsWith("tmux")||v.env.TMUX!==void 0),tu=y?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:v.cwd,$=u=>le?"\x1BPtmux;"+u.replaceAll("\x1B","\x1B\x1B")+"\x1B\\":u,fe=(u,D)=>{if(typeof u!="number")throw new TypeError("The `x` argument is required");return typeof D!="number"?a+(u+1)+"G":a+(D+1)+I+(u+1)+"H"},de=(u,D)=>{if(typeof u!="number")throw new TypeError("The `x` argument is required");let e="";return u<0?e+=a+-u+"D":u>0&&(e+=a+u+"C"),D<0?e+=a+-D+"A":D>0&&(e+=a+D+"B"),e},Pu=(u=1)=>a+u+"A",pe=(u=1)=>a+u+"B",Be=(u=1)=>a+u+"C",he=(u=1)=>a+u+"D",Gu=a+"G",ge=ju?"\x1B7":a+"s",me=ju?"\x1B8":a+"u",Ae=a+"6n",be=a+"E",xe=a+"F",we=a+"?25l",Te=a+"?25h",ye=u=>{let D="";for(let e=0;e<u;e++)D+=qu+(e<u-1?Pu():"");return u&&(D+=Gu),D},ve=a+"K",Se=a+"1K",qu=a+"2K",$e=a+"J",Ne=a+"1J",V=a+"2J",Re=a+"S",We=a+"T",Le="\x1Bc",_e=`${V}${a}H`,Oe=()=>{if(y||!ce)return!1;let u=Ee.release().split("."),D=Number(u[0]),e=Number(u[2]??0);return D<10||D===10&&e<10586},Ie=Oe()?`${V}${a}0f`:`${V}${a}3J${a}H`,ke=a+"?1049h",Me=a+"?1049l",Hu=a+"?2026h",Vu=a+"?2026l",je=u=>Hu+u+Vu,Pe=T,Ge=(u,D)=>{let e=$(`${S}8${I}${I}${D}${T}`),t=$(`${S}8${I}${I}${T}`);return e+u+t},qe=(u,D={})=>{let e=`${S}1337;File=inline=1`;D.width&&(e+=`;width=${D.width}`),D.height&&(e+=`;height=${D.height}`),D.preserveAspectRatio===!1&&(e+=";preserveAspectRatio=0");let t=Buffer.from(u);return $(e+`;size=${t.byteLength}:`+t.toString("base64")+T)},Uu={setCwd:(u=tu())=>$(`${S}50;CurrentDir=${u}${T}`),annotation(u,D={}){let e=`${S}1337;`,t=D.x!==void 0,r=D.y!==void 0;if((t||r)&&!(t&&r&&D.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return u=u.replaceAll("|",""),e+=D.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",D.length>0?e+=(t?[u,D.length,D.x,D.y]:[D.length,u]).join("|"):e+=u,$(e+T)}},Ku={setCwd:(u=tu())=>$(`${S}9;9;${u}${T}`)},He=(u=tu())=>Uu.setCwd(u)+Ku.setCwd(u);i();i();var Ve=u=>{let D=new Set;do for(let e of Reflect.ownKeys(u))D.add([u,e]);while((u=Reflect.getPrototypeOf(u))&&u!==Object.prototype);return D};function Ue(u,{include:D,exclude:e}={}){let t=r=>{let F=o=>typeof o=="string"?r===o:o.test(r);return D?D.some(F):e?!e.some(F):!0};for(let[r,F]of Ve(u.constructor.prototype)){if(F==="constructor"||!t(F))continue;let o=Reflect.getOwnPropertyDescriptor(r,F);o&&typeof o.value=="function"&&(u[F]=u[F].bind(u))}return u}i();import{PassThrough as Yu}from"node:stream";var Ju=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],ru={},Ke=u=>{let D=new Yu,e=new Yu;D.write=r=>{u("stdout",r)},e.write=r=>{u("stderr",r)};let t=new console.Console(D,e);for(let r of Ju)ru[r]=console[r],console[r]=t[r];return()=>{for(let r of Ju)console[r]=ru[r];ru={}}},Or=Ke;i();import rD from"node:process";i();var DD=J(uD(),1),eD=J(hD(),1);import Ye from"node:process";var Je=(0,DD.default)(()=>{(0,eD.default)(()=>{Ye.stderr.write("\x1B[?25h")},{alwaysLast:!0})}),tD=Je;var z=!1,N={};N.show=(u=rD.stderr)=>{u.isTTY&&(z=!1,u.write("\x1B[?25h"))};N.hide=(u=rD.stderr)=>{u.isTTY&&(tD(),z=!0,u.write("\x1B[?25l"))};N.toggle=(u,D)=>{u!==void 0&&(z=u),z?N.show(D):N.hide(D)};var zr=N;i();function Xe(u,D=1,e={}){let{indent:t=" ",includeEmptyLines:r=!1}=e;if(typeof u!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof u}\``);if(typeof D!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof D}\``);if(D<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${D}\``);if(typeof t!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t}\``);if(D===0)return u;let F=r?/^/gm:/^(?!\s*$)/gm;return u.replace(F,t.repeat(D))}i();function nu(u){return Number.isInteger(u)?L(u)||_(u):!1}i();var Qe=new Set([27,155]),Ze="0".codePointAt(0),ut="9".codePointAt(0),Dt=19,iu=new Set,ou=new Map;for(let[u,D]of A.codes)iu.add(A.color.ansi(D)),ou.set(A.color.ansi(u),A.color.ansi(D));function et(u){if(iu.has(u))return u;if(ou.has(u))return ou.get(u);u=u.slice(2),u.includes(";")&&(u=u[0]+"0");let D=A.codes.get(Number.parseInt(u,10));return D?A.color.ansi(D):A.reset.open}function tt(u){for(let D=0;D<u.length;D++){let e=u.codePointAt(D);if(e>=Ze&&e<=ut)return D}return-1}function rt(u,D){u=u.slice(D,D+Dt);let e=tt(u);if(e!==-1){let t=u.indexOf("m",e);return t===-1&&(t=u.length),u.slice(0,t+1)}}function Ft(u,D=Number.POSITIVE_INFINITY){let e=[],t=0,r=0;for(;t<u.length;){let F=u.codePointAt(t);if(Qe.has(F)){let s=rt(u,t);if(s){e.push({type:"ansi",code:s,endCode:et(s)}),t+=s.length;continue}}let o=nu(F),n=String.fromCodePoint(F);if(e.push({type:"character",value:n,isFullWidth:o}),t+=n.length,r+=o?2:n.length,r>=D)break}return e}function FD(u){let D=[];for(let e of u)e.code===A.reset.open?D=[]:iu.has(e.code)?D=D.filter(t=>t.endCode!==e.code):(D=D.filter(t=>t.endCode!==e.endCode),D.push(e));return D}function nt(u){return FD(u).map(({endCode:t})=>t).reverse().join("")}function ot(u,D,e){let t=Ft(u,e),r=[],F=0,o="",n=!1;for(let s of t){if(e!==void 0&&F>=e)break;s.type==="ansi"?(r.push(s),n&&(o+=s.code)):(!n&&F>=D&&(n=!0,r=FD(r),o=r.map(({code:C})=>C).join("")),n&&(o+=s.value),F+=s.isFullWidth?2:s.value.length)}return o+=nt(r),o}i();i();var pt=(u,D=2)=>u.replace(/^\t+/gm,e=>" ".repeat(e.length*D)),cD=pt;var Bt=(u,D)=>{let e=[],t=u-D,r=u+D;for(let F=t;F<=r;F++)e.push(F);return e},ht=(u,D,e={})=>{var t;if(typeof u!="string")throw new TypeError("Source code is missing.");if(!D||D<1)throw new TypeError("Line number must start from `1`.");let r=cD(u).split(/\r?\n/);if(!(D>r.length))return Bt(D,(t=e.around)!==null&&t!==void 0?t:3).filter(F=>r[F-1]!==void 0).map(F=>({line:F,value:r[F-1]}))},dF=ht;export{zu as a,Ue as b,Or as c,fu as d,w as e,A as f,PD as g,nu as h,ot as i,Xe as j,st as k,zr as l,dt as m,dF as n,ku as o,Ce as p};