@shopify/cli 4.5.1 → 4.5.2

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 (277) hide show
  1. package/dist/{analytics-CIKTYXZ6.js → analytics-M7ZU437S.js} +1 -1
  2. package/dist/{analytics-DM7CBV2M.js → analytics-ZRM4FEOE.js} +1 -1
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-QMSYJIAU.js → chunk-23LZNWB5.js} +1 -1
  5. package/dist/{chunk-DE3WCNP6.js → chunk-2ACN7JIZ.js} +1 -1
  6. package/dist/{chunk-OCYPWE2O.js → chunk-2TJ6LOCC.js} +1 -1
  7. package/dist/{chunk-MQXSMZQZ.js → chunk-34SINZ7L.js} +1 -1
  8. package/dist/{chunk-ALQKJAHP.js → chunk-35FS2NTM.js} +1 -1
  9. package/dist/{chunk-GAYQKMOM.js → chunk-3EJGRQTH.js} +1 -1
  10. package/dist/{chunk-6Y3QXASG.js → chunk-3IFZECSI.js} +1 -1
  11. package/dist/{chunk-DQE7XRCK.js → chunk-3OCR7P3S.js} +1 -1
  12. package/dist/{chunk-XWQ72WTQ.js → chunk-42RVM4EZ.js} +1 -1
  13. package/dist/{chunk-UZ7U322K.js → chunk-4MLEL3VK.js} +1 -1
  14. package/dist/{chunk-PTIJDS6I.js → chunk-4P54DKG4.js} +1 -1
  15. package/dist/chunk-4ROX2TCK.js +1 -0
  16. package/dist/{chunk-P6S5YLOP.js → chunk-4UJNCOE6.js} +1 -1
  17. package/dist/{chunk-COTYR5RC.js → chunk-4VJ5VBSR.js} +1 -1
  18. package/dist/{chunk-5UXPTCSD.js → chunk-523SJVNT.js} +1 -1
  19. package/dist/{chunk-M2AS5BWX.js → chunk-5CV7GFWZ.js} +1 -1
  20. package/dist/{chunk-MKCXLBQ4.js → chunk-5GVE4ILZ.js} +1 -1
  21. package/dist/{chunk-U7ZRDNZU.js → chunk-5N7H4PJJ.js} +1 -1
  22. package/dist/{chunk-YJCJDCVP.js → chunk-5VC4XXYH.js} +1 -1
  23. package/dist/{chunk-ASOT7VNB.js → chunk-5VRU3BT5.js} +1 -1
  24. package/dist/{chunk-OVLTFTZW.js → chunk-6AWRW3GS.js} +1 -1
  25. package/dist/{chunk-CGULQAB5.js → chunk-6K4DVV37.js} +1 -1
  26. package/dist/{chunk-QDYDB7DY.js → chunk-6VR22Z5R.js} +1 -1
  27. package/dist/{chunk-7ZLKT2TB.js → chunk-6ZWMXMNM.js} +1 -1
  28. package/dist/{chunk-VSZS3FAJ.js → chunk-75DBVSVI.js} +1 -1
  29. package/dist/{chunk-3QVXHF6I.js → chunk-7AY6HLQG.js} +1 -1
  30. package/dist/{chunk-H7DDRARV.js → chunk-7AYYQUJG.js} +1 -1
  31. package/dist/{chunk-ZHPXJRHR.js → chunk-7KWBVZPI.js} +1 -1
  32. package/dist/{chunk-5JCREGSD.js → chunk-7PVNAILK.js} +1 -1
  33. package/dist/{chunk-3SJHCEQR.js → chunk-7RJPTSL6.js} +1 -1
  34. package/dist/{chunk-72K36DID.js → chunk-7TQ6HVHN.js} +1 -1
  35. package/dist/{chunk-MOCD7GFI.js → chunk-AAK3WGD7.js} +1 -1
  36. package/dist/{chunk-XU6CCL4P.js → chunk-AATUQ2AY.js} +2 -2
  37. package/dist/{chunk-VHAZBDFE.js → chunk-ADKFAPED.js} +1 -1
  38. package/dist/{chunk-IIHPONSQ.js → chunk-ANH2V6DJ.js} +1 -1
  39. package/dist/{chunk-ZVQBSXE4.js → chunk-AUAUAK6P.js} +1 -1
  40. package/dist/chunk-B5MFFERE.js +1 -0
  41. package/dist/{chunk-AH2ZJ73H.js → chunk-BLSWUNOK.js} +1 -1
  42. package/dist/{chunk-E7OLCSAL.js → chunk-BQARKSGG.js} +1 -1
  43. package/dist/{chunk-BVFIJSD7.js → chunk-BUVP2UUA.js} +1 -1
  44. package/dist/{chunk-RIRSTGFU.js → chunk-BVWQZKNK.js} +1 -1
  45. package/dist/{chunk-NGPJXONG.js → chunk-CEBDKIVH.js} +1 -1
  46. package/dist/{chunk-UHJ65YFN.js → chunk-CX44CQFL.js} +1 -1
  47. package/dist/{chunk-UB5BVO76.js → chunk-DELISRUH.js} +1 -1
  48. package/dist/{chunk-6XLVKD6Q.js → chunk-DI5ZPWNA.js} +1 -1
  49. package/dist/{chunk-JO4ZHVOD.js → chunk-DIPTSBQM.js} +1 -1
  50. package/dist/{chunk-5NY4HKJF.js → chunk-DN3BB4IO.js} +2 -2
  51. package/dist/{chunk-RFDT525K.js → chunk-DZMXYETH.js} +1 -1
  52. package/dist/{chunk-DKKBJ4H5.js → chunk-EAOT5CK5.js} +1 -1
  53. package/dist/{chunk-E24W34C4.js → chunk-EEEKSYWV.js} +1 -1
  54. package/dist/{chunk-GXUZ3V7S.js → chunk-EOJNSPIH.js} +1 -1
  55. package/dist/{chunk-GQG6WELZ.js → chunk-FSVSM57K.js} +1 -1
  56. package/dist/{chunk-HXYWEKMS.js → chunk-G6BFXMOV.js} +1 -1
  57. package/dist/{chunk-DA4LHFJQ.js → chunk-GMAZ2BQY.js} +1 -1
  58. package/dist/{chunk-DDVT2K7E.js → chunk-HOAVZLEG.js} +1 -1
  59. package/dist/{chunk-EDSKA6UB.js → chunk-HQE5B2CF.js} +1 -1
  60. package/dist/{chunk-KOB6T6NK.js → chunk-HSVZU7MP.js} +1 -1
  61. package/dist/{chunk-5PLLJPEW.js → chunk-HYF3VJYS.js} +1 -1
  62. package/dist/{chunk-5T3OVTF5.js → chunk-I5X3IP6T.js} +1 -1
  63. package/dist/{chunk-5U6MXSNY.js → chunk-ICRQZAXP.js} +1 -1
  64. package/dist/{chunk-ELIH6GCC.js → chunk-IIFRDOYG.js} +1 -1
  65. package/dist/{chunk-GKQ6CSJZ.js → chunk-JADXT2DY.js} +1 -1
  66. package/dist/{chunk-KC2TN7AR.js → chunk-JOKLZMTP.js} +1 -1
  67. package/dist/{chunk-BEXQB4RT.js → chunk-K4APB7O3.js} +1 -1
  68. package/dist/{chunk-SKM44SK5.js → chunk-KB6H5LQJ.js} +1 -1
  69. package/dist/{chunk-SRAHMYWJ.js → chunk-KFUOVO3X.js} +1 -1
  70. package/dist/{chunk-Q2X7IXPQ.js → chunk-KIAMA3L2.js} +1 -1
  71. package/dist/{chunk-KOUKBXOZ.js → chunk-KMQE7WFZ.js} +1 -1
  72. package/dist/{chunk-WO5YOBQ7.js → chunk-KPNNGJAW.js} +1 -1
  73. package/dist/{chunk-2WDKXDFM.js → chunk-KQTVJMV6.js} +1 -1
  74. package/dist/{chunk-QPJQ67GU.js → chunk-L42FYXFW.js} +144 -144
  75. package/dist/{chunk-PGKP7W5T.js → chunk-LGFOE4XL.js} +1 -1
  76. package/dist/{chunk-BZAZMLII.js → chunk-LSCDB36D.js} +1 -1
  77. package/dist/{chunk-ZNWFTUFV.js → chunk-LVLDPYH5.js} +1 -1
  78. package/dist/{chunk-O2PI2PYG.js → chunk-LXOBFJZO.js} +1 -1
  79. package/dist/{chunk-PGN5EZTI.js → chunk-MC466GSO.js} +2 -2
  80. package/dist/{chunk-TXJEP4FB.js → chunk-ML6SILEL.js} +1 -1
  81. package/dist/{chunk-EAXEV45I.js → chunk-MYQTAM77.js} +1 -1
  82. package/dist/{chunk-YBFCDINU.js → chunk-N6IFIMC6.js} +1 -1
  83. package/dist/{chunk-Q6LCSRIW.js → chunk-NGCPVRDM.js} +1 -1
  84. package/dist/{chunk-YYHCPLBX.js → chunk-NIVGP4LB.js} +1 -1
  85. package/dist/{chunk-IHUCBI6L.js → chunk-NSADN5S2.js} +1 -1
  86. package/dist/{chunk-FO6FNY6P.js → chunk-NVA2354A.js} +1 -1
  87. package/dist/{chunk-AI756VJI.js → chunk-NWH3TAHK.js} +1 -1
  88. package/dist/{chunk-MMKBIMMC.js → chunk-NYG2VQFQ.js} +1 -1
  89. package/dist/{chunk-JNEGEJH6.js → chunk-OC5PD4ID.js} +1 -1
  90. package/dist/{chunk-G7QLHXVA.js → chunk-OCBGHOH2.js} +1 -1
  91. package/dist/{chunk-3YCTWCHH.js → chunk-ODSMT2ZC.js} +1 -1
  92. package/dist/{chunk-T5DF2GGD.js → chunk-OJZT3NA2.js} +1 -1
  93. package/dist/{chunk-DCUAVLTM.js → chunk-OMXKQY2L.js} +1 -1
  94. package/dist/{chunk-O7MONSF7.js → chunk-P2SBE77Z.js} +1 -1
  95. package/dist/{chunk-APYASWBA.js → chunk-P6LVSNTT.js} +1 -1
  96. package/dist/{chunk-CNOL26GA.js → chunk-P7OSUECN.js} +1 -1
  97. package/dist/chunk-P7U6BWKN.js +1 -0
  98. package/dist/{chunk-3GMW7IEC.js → chunk-PEYYIWP6.js} +2 -2
  99. package/dist/{chunk-MCATVWHC.js → chunk-Q7DSLGTN.js} +1 -1
  100. package/dist/{chunk-4TC4M4RC.js → chunk-QEVGRNUE.js} +1 -1
  101. package/dist/{chunk-HHSUBF73.js → chunk-QFXJNFMI.js} +1 -1
  102. package/dist/{chunk-IBBFRL3Y.js → chunk-R6A754UW.js} +1 -1
  103. package/dist/{chunk-IRH6IGFT.js → chunk-R7QYSC6T.js} +1 -1
  104. package/dist/{chunk-JOYM7AEQ.js → chunk-RE652L3G.js} +1 -1
  105. package/dist/{chunk-6ZMNEURG.js → chunk-RFOALCVH.js} +1 -1
  106. package/dist/{chunk-5K4DONQJ.js → chunk-RLB5QHWG.js} +1 -1
  107. package/dist/{chunk-UYNCJGMC.js → chunk-RTINXD5Z.js} +1 -1
  108. package/dist/{chunk-XH5FCMS5.js → chunk-SG5TRPJ7.js} +1 -1
  109. package/dist/{chunk-NV5IDANV.js → chunk-SH6Q5CLM.js} +1 -1
  110. package/dist/{chunk-VRRDIXFQ.js → chunk-SSDEWKDZ.js} +1 -1
  111. package/dist/{chunk-JCNRQYRP.js → chunk-SZM6ANMN.js} +1 -1
  112. package/dist/{chunk-Q2UHGP2Z.js → chunk-T35C6NC7.js} +1 -1
  113. package/dist/{chunk-EYDNSYYE.js → chunk-TB7HFPBB.js} +2 -2
  114. package/dist/{chunk-SFMXFH33.js → chunk-TH6CLNGO.js} +1 -1
  115. package/dist/{chunk-2HZMOK4U.js → chunk-TIU7MMRT.js} +2 -2
  116. package/dist/{chunk-OASPW2P2.js → chunk-TM44Z7U7.js} +1 -1
  117. package/dist/{chunk-ICFFBMFB.js → chunk-TNUY66EE.js} +1 -1
  118. package/dist/{chunk-2GDACKZF.js → chunk-TPGREOWO.js} +1 -1
  119. package/dist/{chunk-2MNOWKMI.js → chunk-TSEPNC3O.js} +1 -1
  120. package/dist/{chunk-IRTCLR3F.js → chunk-TTEY5PLR.js} +1 -1
  121. package/dist/{chunk-EXQXGSGY.js → chunk-U3MSTPZP.js} +1 -1
  122. package/dist/{chunk-N5HGT3TE.js → chunk-U4HLIXRH.js} +1 -1
  123. package/dist/{chunk-IDKUJQIG.js → chunk-UAYIFFYJ.js} +3 -3
  124. package/dist/chunk-UHIP5CFI.js +1 -0
  125. package/dist/{chunk-MYQQOOGA.js → chunk-UHMRDG6J.js} +1 -1
  126. package/dist/{chunk-TDCY3BRI.js → chunk-UMB4BWCK.js} +1 -1
  127. package/dist/{chunk-2FIDORHT.js → chunk-UMFVRG33.js} +1 -1
  128. package/dist/{chunk-FPCPFECH.js → chunk-UVIGXZMV.js} +1 -1
  129. package/dist/{chunk-QPY6WJTT.js → chunk-UW6YEKST.js} +1 -1
  130. package/dist/{chunk-U2LQBJJL.js → chunk-V6QZF5YS.js} +1 -1
  131. package/dist/{chunk-TDSR2X7X.js → chunk-VCWESQBC.js} +1 -1
  132. package/dist/{chunk-QVYZZNAS.js → chunk-VGSH33QU.js} +1 -1
  133. package/dist/{chunk-7XQDZF73.js → chunk-VJQJ5PTQ.js} +1 -1
  134. package/dist/{chunk-AVMNXIXF.js → chunk-WDSBR7KX.js} +1 -1
  135. package/dist/{chunk-H7PNMMDO.js → chunk-WN5VTUWJ.js} +1 -1
  136. package/dist/{chunk-7USHLXEN.js → chunk-WTRKTFVE.js} +1 -1
  137. package/dist/{chunk-OHASEW7T.js → chunk-X3VG75LO.js} +1 -1
  138. package/dist/{chunk-YZY4M6IH.js → chunk-XCGV3IJ5.js} +1 -1
  139. package/dist/{chunk-XDEAZP2I.js → chunk-XDV4PRFT.js} +1 -1
  140. package/dist/{chunk-KHXDP3SF.js → chunk-XHTICMA7.js} +1 -1
  141. package/dist/{chunk-WIXW233Y.js → chunk-XS7WK4YK.js} +1 -1
  142. package/dist/{chunk-ZDQNCYRH.js → chunk-XSUZPWYV.js} +1 -1
  143. package/dist/{chunk-T3AJL2M5.js → chunk-XUAAQI5N.js} +1 -1
  144. package/dist/{chunk-ODH2U44N.js → chunk-XXLGM6OZ.js} +1 -1
  145. package/dist/{chunk-TVU4YD2H.js → chunk-YKNMNGV7.js} +1 -1
  146. package/dist/{chunk-FOPGI6GO.js → chunk-YNX4DT2O.js} +1 -1
  147. package/dist/{chunk-WMDYHUPS.js → chunk-YWQPSMRZ.js} +1 -1
  148. package/dist/{chunk-C5U4NLNU.js → chunk-YXNKDX56.js} +1 -1
  149. package/dist/{chunk-4E354M4H.js → chunk-Z33MWGCG.js} +1 -1
  150. package/dist/{chunk-JVMYTC3J.js → chunk-Z6VNPAY7.js} +1 -1
  151. package/dist/{chunk-IQYZAALJ.js → chunk-ZAN7AZTX.js} +1 -1
  152. package/dist/{chunk-IOU6EKTT.js → chunk-ZIM2G3EP.js} +1 -1
  153. package/dist/{chunk-H3QZN45D.js → chunk-ZSYMRT3S.js} +1 -1
  154. package/dist/{chunk-LUG2BZJP.js → chunk-ZT4PUH7L.js} +1 -1
  155. package/dist/{chunk-DU5LZYQX.js → chunk-ZUWEGJA7.js} +1 -1
  156. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  157. package/dist/cli/commands/app/build.js +1 -1
  158. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  159. package/dist/cli/commands/app/bulk/execute.js +1 -1
  160. package/dist/cli/commands/app/bulk/status.js +1 -1
  161. package/dist/cli/commands/app/config/link.js +1 -1
  162. package/dist/cli/commands/app/config/pull.js +1 -1
  163. package/dist/cli/commands/app/config/use.js +1 -1
  164. package/dist/cli/commands/app/config/validate.js +1 -1
  165. package/dist/cli/commands/app/demo/watcher.js +1 -1
  166. package/dist/cli/commands/app/deploy.js +1 -1
  167. package/dist/cli/commands/app/dev/clean.js +1 -1
  168. package/dist/cli/commands/app/dev.js +1 -1
  169. package/dist/cli/commands/app/env/pull.js +1 -1
  170. package/dist/cli/commands/app/env/show.js +1 -1
  171. package/dist/cli/commands/app/execute.js +1 -1
  172. package/dist/cli/commands/app/function/build.js +1 -1
  173. package/dist/cli/commands/app/function/info.js +1 -1
  174. package/dist/cli/commands/app/function/replay.js +1 -1
  175. package/dist/cli/commands/app/function/run.js +1 -1
  176. package/dist/cli/commands/app/function/schema.js +1 -1
  177. package/dist/cli/commands/app/function/typegen.js +1 -1
  178. package/dist/cli/commands/app/generate/extension.js +1 -1
  179. package/dist/cli/commands/app/graphiql.js +1 -1
  180. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  181. package/dist/cli/commands/app/import-extensions.js +1 -1
  182. package/dist/cli/commands/app/info.js +1 -1
  183. package/dist/cli/commands/app/init.js +1 -1
  184. package/dist/cli/commands/app/logs.js +1 -1
  185. package/dist/cli/commands/app/release.js +1 -1
  186. package/dist/cli/commands/app/versions/list.js +1 -1
  187. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  188. package/dist/cli/commands/auth/login.js +1 -1
  189. package/dist/cli/commands/auth/logout.js +1 -1
  190. package/dist/cli/commands/cache/clear.js +1 -1
  191. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  192. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  193. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  194. package/dist/cli/commands/debug/command-flags.js +1 -1
  195. package/dist/cli/commands/doc/fetch.js +1 -1
  196. package/dist/cli/commands/doc/search.js +1 -1
  197. package/dist/cli/commands/docs/generate.js +1 -1
  198. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  199. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  200. package/dist/cli/commands/help.js +1 -1
  201. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  202. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  203. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  204. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  205. package/dist/cli/commands/notifications/generate.js +1 -1
  206. package/dist/cli/commands/notifications/list.js +1 -1
  207. package/dist/cli/commands/organization/list.js +1 -1
  208. package/dist/cli/commands/search.js +1 -1
  209. package/dist/cli/commands/theme/check.js +1 -1
  210. package/dist/cli/commands/theme/console.js +1 -1
  211. package/dist/cli/commands/theme/delete.js +1 -1
  212. package/dist/cli/commands/theme/dev.js +1 -1
  213. package/dist/cli/commands/theme/duplicate.js +1 -1
  214. package/dist/cli/commands/theme/info.js +1 -1
  215. package/dist/cli/commands/theme/init.js +1 -1
  216. package/dist/cli/commands/theme/language-server.js +1 -1
  217. package/dist/cli/commands/theme/list.js +1 -1
  218. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  219. package/dist/cli/commands/theme/open.js +1 -1
  220. package/dist/cli/commands/theme/package.js +1 -1
  221. package/dist/cli/commands/theme/preview.js +1 -1
  222. package/dist/cli/commands/theme/profile.js +1 -1
  223. package/dist/cli/commands/theme/publish.js +1 -1
  224. package/dist/cli/commands/theme/pull.js +1 -1
  225. package/dist/cli/commands/theme/push.js +1 -1
  226. package/dist/cli/commands/theme/rename.js +1 -1
  227. package/dist/cli/commands/theme/share.js +1 -1
  228. package/dist/cli/commands/upgrade.js +1 -1
  229. package/dist/cli/commands/version.js +1 -1
  230. package/dist/command-registry.js +1 -1
  231. package/dist/{conf-store-OC4XCP45.js → conf-store-HOA62HKK.js} +1 -1
  232. package/dist/configs/all.yml +3 -0
  233. package/dist/configs/recommended.yml +3 -0
  234. package/dist/data/filters.json +1 -1
  235. package/dist/data/objects.json +30 -3
  236. package/dist/data/shopify_system_translations.json +48 -4
  237. package/dist/{deprecations-M5JGGK47.js → deprecations-2FTB7JEW.js} +1 -1
  238. package/dist/{dist-Z4H2OM7V.js → dist-63JMGNUL.js} +1 -1
  239. package/dist/dist-6TY6L7OW.js +1 -0
  240. package/dist/{environments-ZLSO534C.js → environments-XVYTKHRZ.js} +1 -1
  241. package/dist/{error-ZBG2MA5U.js → error-SDU6RPQQ.js} +1 -1
  242. package/dist/{error-handler-MCUV4RZV.js → error-handler-4YEBBCUH.js} +1 -1
  243. package/dist/{fs-7LCRIUF3.js → fs-B4UJTUCD.js} +1 -1
  244. package/dist/hooks/app-init.js +1 -1
  245. package/dist/hooks/did-you-mean.js +1 -1
  246. package/dist/hooks/hydrogen-init.js +1 -1
  247. package/dist/hooks/postrun.js +1 -1
  248. package/dist/hooks/prerun.js +1 -1
  249. package/dist/hooks/public-metadata.js +1 -1
  250. package/dist/hooks/sensitive-metadata.js +1 -1
  251. package/dist/hooks/tunnel-provider.js +1 -1
  252. package/dist/hooks/tunnel-start.js +1 -1
  253. package/dist/index.js +1 -1
  254. package/dist/{is-global-RURDJZDU.js → is-global-5LFZDDNH.js} +1 -1
  255. package/dist/{local-5AKD7T5X.js → local-VTYGIJVD.js} +1 -1
  256. package/dist/{local-storage-TJU77VRQ.js → local-storage-A6NBLBB2.js} +1 -1
  257. package/dist/{metadata-D5GLZOLV.js → metadata-FREAI3KR.js} +1 -1
  258. package/dist/{node-package-manager-FA3Y6DPG.js → node-package-manager-N5SUT2WN.js} +1 -1
  259. package/dist/notifications-system-P3SUTD25.js +1 -0
  260. package/dist/{output-FYS764MJ.js → output-VUR2QZPW.js} +1 -1
  261. package/dist/{system-KDM2BB7R.js → system-OXF2P5CT.js} +1 -1
  262. package/dist/tsconfig.tsbuildinfo +1 -1
  263. package/dist/{ui-QIHGXICT.js → ui-N2C5FC3G.js} +1 -1
  264. package/dist/upgrade-AJ36IT7H.js +1 -0
  265. package/dist/{version-LULWCT5R.js → version-DSFP332V.js} +1 -1
  266. package/dist/version-HUOO3XOE.js +1 -0
  267. package/dist/{workerd-N25GY5MX.js → workerd-KPQTFQD4.js} +1 -1
  268. package/oclif.manifest.json +1 -1
  269. package/package.json +7 -7
  270. package/dist/chunk-6ZRHK4ON.js +0 -1
  271. package/dist/chunk-J3KRY2SD.js +0 -1
  272. package/dist/chunk-PGODIZ64.js +0 -1
  273. package/dist/chunk-YB3SGPFF.js +0 -1
  274. package/dist/dist-3SP7TISC.js +0 -1
  275. package/dist/notifications-system-76GJJAJP.js +0 -1
  276. package/dist/upgrade-DY4L43H4.js +0 -1
  277. package/dist/version-WIERCO5R.js +0 -1
@@ -1,2 +1,2 @@
1
- import{Fb as e,Hb as r,Pb as n,Ta as o,ua as g,wa as d}from"./chunk-EYDNSYYE.js";import{d as i}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var f=".shopify";async function E(p){let t=i(p,f),a=i(t,".gitignore"),[h,u]=await Promise.all([o(t),o(a)]);return h||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await d(t)),u||(n(r`Creating .gitignore in ${e.path(t)}...`),await g(a,`# Ignore the entire ${f} directory
1
+ import{Fb as e,Hb as r,Pb as n,Ta as o,ua as g,wa as d}from"./chunk-TB7HFPBB.js";import{d as i}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var f=".shopify";async function E(p){let t=i(p,f),a=i(t,".gitignore"),[h,u]=await Promise.all([o(t),o(a)]);return h||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await d(t)),u||(n(r`Creating .gitignore in ${e.path(t)}...`),await g(a,`# Ignore the entire ${f} directory
2
2
  *`)),t}export{E as a};
@@ -1,2 +1,2 @@
1
- import{b as x,c as D,f as M}from"./chunk-ZNWFTUFV.js";import{a as o}from"./chunk-J3KRY2SD.js";import{c as w}from"./chunk-5C7HDTHJ.js";import{C as h,F as e,v as y,z as s}from"./chunk-E24W34C4.js";import{Mb as _,ua as u}from"./chunk-EYDNSYYE.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();async function $(){let a=new Date,n=`${a.getFullYear()}-${(a.getMonth()+1).toString().padStart(2,"0")}-${a.getDate().toString().padStart(2,"0")}`,i=w(),t=await s({message:"Type of message?",choices:[{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}]}),b=await e({message:"Title"}),E=await e({message:"Message"}),S=await s({message:"Frequency",choices:[{label:"Only once",value:"once"},{label:"Once a week",value:"once_a_week"},{label:"Once a day",value:"once_a_day"},{label:"Always",value:"always"}]}),r=await e({message:"Minimum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),l=await e({message:"Maximum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),m=await e({message:"Minimum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),c=await e({message:"Maximum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),f=await e({message:"Surface. E.g.: app, theme, hydrogen, theme_app_extension... (optional)",allowEmpty:!0}),g=await e({message:"Comma separated list of commands. E.g.: app:generate:extension (optional)",allowEmpty:!0}),T=await e({message:"Slack channel of the team who will own this notification"}),d=await x(),v={id:i,type:t,title:b,frequency:S,message:E,minVersion:r.length===0?void 0:r,maxVersion:l.length===0?void 0:l,minDate:m.length===0?void 0:m,maxDate:c.length===0?void 0:c,surface:f.length===0?void 0:f,commands:g.length===0?void 0:g.split(",").map(N=>N.trim()),ownerChannel:T};d.notifications.push(v),await u("./notifications.json",JSON.stringify(d)),y({headline:"notifications.json file updated successfully."})}async function j(){let a=await D(),n={type:{header:"Type",color:"dim"},title:{header:"Title",color:"dim"},message:{header:"Message",color:"dim"},filters:{header:"Filters",color:"dim"}},i=a.notifications.map(t=>({type:t.type,title:t.title??"",message:t.message,filters:M(t)}));h({rows:i,columns:n}),_(`
1
+ import{b as x,c as D,f as M}from"./chunk-LVLDPYH5.js";import{a as o}from"./chunk-B5MFFERE.js";import{c as w}from"./chunk-5C7HDTHJ.js";import{C as h,F as e,v as y,z as s}from"./chunk-EEEKSYWV.js";import{Mb as _,ua as u}from"./chunk-TB7HFPBB.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();async function $(){let a=new Date,n=`${a.getFullYear()}-${(a.getMonth()+1).toString().padStart(2,"0")}-${a.getDate().toString().padStart(2,"0")}`,i=w(),t=await s({message:"Type of message?",choices:[{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}]}),b=await e({message:"Title"}),E=await e({message:"Message"}),S=await s({message:"Frequency",choices:[{label:"Only once",value:"once"},{label:"Once a week",value:"once_a_week"},{label:"Once a day",value:"once_a_day"},{label:"Always",value:"always"}]}),r=await e({message:"Minimum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),l=await e({message:"Maximum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),m=await e({message:"Minimum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),c=await e({message:"Maximum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),f=await e({message:"Surface. E.g.: app, theme, hydrogen, theme_app_extension... (optional)",allowEmpty:!0}),g=await e({message:"Comma separated list of commands. E.g.: app:generate:extension (optional)",allowEmpty:!0}),T=await e({message:"Slack channel of the team who will own this notification"}),d=await x(),v={id:i,type:t,title:b,frequency:S,message:E,minVersion:r.length===0?void 0:r,maxVersion:l.length===0?void 0:l,minDate:m.length===0?void 0:m,maxDate:c.length===0?void 0:c,surface:f.length===0?void 0:f,commands:g.length===0?void 0:g.split(",").map(N=>N.trim()),ownerChannel:T};d.notifications.push(v),await u("./notifications.json",JSON.stringify(d)),y({headline:"notifications.json file updated successfully."})}async function j(){let a=await D(),n={type:{header:"Type",color:"dim"},title:{header:"Title",color:"dim"},message:{header:"Message",color:"dim"},filters:{header:"Filters",color:"dim"}},i=a.notifications.map(t=>({type:t.type,title:t.title??"",message:t.message,filters:M(t)}));h({rows:i,columns:n}),_(`
2
2
  `)}export{$ as a,j as b};
@@ -1,3 +1,3 @@
1
- import{d as w,n as y,r as n}from"./chunk-2HZMOK4U.js";import{w as l}from"./chunk-VRRDIXFQ.js";import{k as u,l as m}from"./chunk-LUG2BZJP.js";import{a as h}from"./chunk-J3KRY2SD.js";import{a as x}from"./chunk-WW7TENNA.js";import{O as S,u as d,w as g,x as N}from"./chunk-E24W34C4.js";import{f as _}from"./chunk-ELIH6GCC.js";import{Pb as a}from"./chunk-EYDNSYYE.js";import{a as f}from"./chunk-NNOSZ447.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var $="https://cdn.shopify.com/static/cli/notifications.json",D="Cache is empty",C=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear"];function c(){return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL??$}var E=n.object({id:n.string(),message:n.string(),type:n.enum(["info","warning","error"]),frequency:n.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:n.string(),cta:n.object({label:n.string(),url:n.string().url()}).optional(),title:n.string().optional(),minVersion:n.string().optional(),maxVersion:n.string().optional(),minDate:n.string().optional(),maxDate:n.string().optional(),commands:n.array(n.string()).optional(),surface:n.string().optional()}),I=n.object({notifications:n.array(E)});async function Q(e,t=process.env){try{let r=x();if(b(r,t)||w(t))return;let o=await k(),s=v(o.notifications,r,e);a(`Notifications to show: ${s.length}`),await V(s)}catch(r){if(r.message===D){a("Notifications to show: 0 (Cache is empty)");return}if(r.message==="abort")throw new _;let o=`Error showing notifications: ${r.message}`;a(o);let{sendErrorToBugsnag:s}=await import("./error-handler-MCUV4RZV.js");await s(o,"unexpected_error")}}function b(e,t=process.env){return f(t.CI)||f(t.SHOPIFY_UNIT_TEST)||C.includes(e)}async function V(e){e.slice(0,2).forEach(t=>{let r={headline:t.title,body:t.message.replace(/\\n/g,`
1
+ import{d as w,n as y,r as n}from"./chunk-TIU7MMRT.js";import{w as l}from"./chunk-SSDEWKDZ.js";import{k as u,l as m}from"./chunk-ZT4PUH7L.js";import{a as h}from"./chunk-B5MFFERE.js";import{a as x}from"./chunk-WW7TENNA.js";import{O as S,u as d,w as g,x as N}from"./chunk-EEEKSYWV.js";import{f as _}from"./chunk-IIFRDOYG.js";import{Pb as a}from"./chunk-TB7HFPBB.js";import{a as f}from"./chunk-NNOSZ447.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var $="https://cdn.shopify.com/static/cli/notifications.json",D="Cache is empty",C=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear"];function c(){return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL??$}var E=n.object({id:n.string(),message:n.string(),type:n.enum(["info","warning","error"]),frequency:n.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:n.string(),cta:n.object({label:n.string(),url:n.string().url()}).optional(),title:n.string().optional(),minVersion:n.string().optional(),maxVersion:n.string().optional(),minDate:n.string().optional(),maxDate:n.string().optional(),commands:n.array(n.string()).optional(),surface:n.string().optional()}),I=n.object({notifications:n.array(E)});async function Q(e,t=process.env){try{let r=x();if(b(r,t)||w(t))return;let o=await k(),s=v(o.notifications,r,e);a(`Notifications to show: ${s.length}`),await V(s)}catch(r){if(r.message===D){a("Notifications to show: 0 (Cache is empty)");return}if(r.message==="abort")throw new _;let o=`Error showing notifications: ${r.message}`;a(o);let{sendErrorToBugsnag:s}=await import("./error-handler-4YEBBCUH.js");await s(o,"unexpected_error")}}function b(e,t=process.env){return f(t.CI)||f(t.SHOPIFY_UNIT_TEST)||C.includes(e)}async function V(e){e.slice(0,2).forEach(t=>{let r={headline:t.title,body:t.message.replace(/\\n/g,`
2
2
  `),link:t.cta};switch(t.type){case"info":{d(r);break}case"warning":{g(r);break}case"error":throw N(r),new Error("abort")}u(`notification-${t.id}`,new Date().getTime().toString())})}async function k(){let e=`notifications-${c()}`,t=m(e)?.value;if(!t)throw new Error(D);let r=JSON.parse(t);return I.parse(r)}async function X(){a("Fetching notifications...");let e=await y(c(),void 0,{useNetworkLevelRetry:!1,useAbortSignal:!0,timeoutMs:3*1e3});if(e.status!==200)throw new Error(`Failed to fetch notifications: ${e.statusText}`);let t=await e.text(),r=JSON.parse(t),o=I.parse(r);return await O(t),o}async function O(e){u(`notifications-${c()}`,e),a(`Notifications from ${c()} stored in the cache`)}function Z(e,t=process.argv,r=process.env){if(b(e,r)||!t[0]||!t[1])return;let o=t[0],i=[t[1],"notifications","list","--ignore-errors"];S(o,i,{background:!0,env:{...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},externalErrorHandler:async T=>{a(`Failed to fetch notifications in background: ${T.message}`)}})}function v(e,t,r,o=new Date(new Date().setUTCHours(0,0,0,0)),s=h){return e.filter(i=>B(i,s)).filter(i=>F(i,o)).filter(i=>A(i,t)).filter(i=>j(i,t,r)).filter(i=>q(i))}function B(e,t){let r=!e.minVersion||l(t,`>=${e.minVersion}`),o=!e.maxVersion||l(t,`<=${e.maxVersion}`);return r&&o}function F(e,t){let r=!e.minDate||new Date(e.minDate)<=t,o=!e.maxDate||new Date(e.maxDate)>=t;return r&&o}function A(e,t){return t===""?!0:!e.commands||e.commands.includes(t)}function j(e,t,r){let o=t.split(":")[0]??"all",s=e.surface??"all";return r?r.includes(s):s===o||s==="all"}function q(e){if(!e.frequency)return!0;let t=`notification-${e.id}`,r=m(t)?.value;if(!r)return!0;switch(e.frequency){case"always":return!0;case"once":return!1;case"once_a_day":return new Date().getTime()-Number(r)>24*3600*1e3;case"once_a_week":return new Date().getTime()-Number(r)>168*3600*1e3}}function ee(e){let t=[];return e.minDate&&t.push(`from ${e.minDate}`),e.maxDate&&t.push(`to ${e.maxDate}`),e.minVersion&&t.push(`from v${e.minVersion}`),e.maxVersion&&t.push(`to v${e.maxVersion}`),e.frequency==="once"&&t.push("show only once"),e.frequency==="once_a_day"&&t.push("show once a day"),e.frequency==="once_a_week"&&t.push("show once a week"),e.surface&&t.push(`surface = ${e.surface}`),e.commands&&t.push(`commands = ${e.commands.join(", ")}`),t.join(`
3
3
  `)}export{Q as a,k as b,X as c,Z as d,v as e,ee as f};
@@ -1 +1 @@
1
- import{c as u}from"./chunk-ASOT7VNB.js";import{w as c}from"./chunk-E24W34C4.js";import{e as s}from"./chunk-3QVXHF6I.js";import{$a as d}from"./chunk-EYDNSYYE.js";import{q as m}from"./chunk-773TIA5M.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();function o(e,n){n||c(e)}async function P(e,n,t){let r=await l(n,t);if(!r){o({body:"Environment file not found."},t?.silent);return}let a=(await u.read(r)).content.environments;if(!a){o({body:["No environments found in",{command:r},{char:"."}]},t?.silent);return}let i=a[e];if(!i){o({body:["Environment",{command:e},"not found."]},t?.silent);return}return await s(()=>({environmentFlags:JSON.stringify(i)})),i}async function l(e,n){let t=n?.from&&n.from!=="."?n.from:m();return d(e,{cwd:t,type:"file"})}export{P as a,l as b};
1
+ import{c as u}from"./chunk-5VRU3BT5.js";import{w as c}from"./chunk-EEEKSYWV.js";import{e as s}from"./chunk-7AY6HLQG.js";import{$a as d}from"./chunk-TB7HFPBB.js";import{q as m}from"./chunk-773TIA5M.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();function o(e,n){n||c(e)}async function P(e,n,t){let r=await l(n,t);if(!r){o({body:"Environment file not found."},t?.silent);return}let a=(await u.read(r)).content.environments;if(!a){o({body:["No environments found in",{command:r},{char:"."}]},t?.silent);return}let i=a[e];if(!i){o({body:["Environment",{command:e},"not found."]},t?.silent);return}return await s(()=>({environmentFlags:JSON.stringify(i)})),i}async function l(e,n){let t=n?.from&&n.from!=="."?n.from:m();return d(e,{cwd:t,type:"file"})}export{P as a,l as b};
@@ -1,4 +1,4 @@
1
- import{v as Yv}from"./chunk-PTIJDS6I.js";import{A as hy,B as ii,C as uy,D as Fn,E as py,F as my,G as za,H as fy,I as Oa,J as gy,K as rs,L as kT,M as by,N as Aa,O as is,P as os,Q as Pn,R as vy,S as sn,T as La,U as qa,V,W as CT,X as _T,a as ee,aa as Eu,b as Fa,c as Zv,d as Dn,e as ke,f as Pa,g as ey,h as ty,i as ny,j as ry,k as iy,l as ns,m as oy,n as Ma,o as K,p as Ia,q as sy,r as Na,s as Vt,t as ay,u as B,v as lt,w as kr,x as ly,y as cy,z as dy}from"./chunk-QPJQ67GU.js";import{b as Qv}from"./chunk-Q6LCSRIW.js";import{a as jt,b as Z,c as w,d as Xv,e as $t,f as Bt,g as d}from"./chunk-VKWPEFWQ.js";var Ai=w(ct=>{"use strict";d();Object.defineProperty(ct,"__esModule",{value:!0});ct.stringArray=ct.array=ct.func=ct.error=ct.number=ct.string=ct.boolean=void 0;function TT(n){return n===!0||n===!1}ct.boolean=TT;function yy(n){return typeof n=="string"||n instanceof String}ct.string=yy;function RT(n){return typeof n=="number"||n instanceof Number}ct.number=RT;function ET(n){return n instanceof Error}ct.error=ET;function DT(n){return typeof n=="function"}ct.func=DT;function wy(n){return Array.isArray(n)}ct.array=wy;function FT(n){return wy(n)&&n.every(e=>yy(e))}ct.stringArray=FT});var Yu=w(j=>{"use strict";d();Object.defineProperty(j,"__esModule",{value:!0});j.Message=j.NotificationType9=j.NotificationType8=j.NotificationType7=j.NotificationType6=j.NotificationType5=j.NotificationType4=j.NotificationType3=j.NotificationType2=j.NotificationType1=j.NotificationType0=j.NotificationType=j.RequestType9=j.RequestType8=j.RequestType7=j.RequestType6=j.RequestType5=j.RequestType4=j.RequestType3=j.RequestType2=j.RequestType1=j.RequestType=j.RequestType0=j.AbstractMessageSignature=j.ParameterStructures=j.ResponseError=j.ErrorCodes=void 0;var oi=Ai(),Sy;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(Sy=j.ErrorCodes||(j.ErrorCodes={}));var Du=class n extends Error{constructor(e,t,r){super(t),this.code=oi.number(e)?e:Sy.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};j.ResponseError=Du;var Tt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};j.ParameterStructures=Tt;Tt.auto=new Tt("auto");Tt.byPosition=new Tt("byPosition");Tt.byName=new Tt("byName");var Ce=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Tt.auto}};j.AbstractMessageSignature=Ce;var Fu=class extends Ce{constructor(e){super(e,0)}};j.RequestType0=Fu;var Pu=class extends Ce{constructor(e,t=Tt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};j.RequestType=Pu;var Mu=class extends Ce{constructor(e,t=Tt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};j.RequestType1=Mu;var Iu=class extends Ce{constructor(e){super(e,2)}};j.RequestType2=Iu;var Nu=class extends Ce{constructor(e){super(e,3)}};j.RequestType3=Nu;var zu=class extends Ce{constructor(e){super(e,4)}};j.RequestType4=zu;var Ou=class extends Ce{constructor(e){super(e,5)}};j.RequestType5=Ou;var Au=class extends Ce{constructor(e){super(e,6)}};j.RequestType6=Au;var Lu=class extends Ce{constructor(e){super(e,7)}};j.RequestType7=Lu;var qu=class extends Ce{constructor(e){super(e,8)}};j.RequestType8=qu;var Wu=class extends Ce{constructor(e){super(e,9)}};j.RequestType9=Wu;var Hu=class extends Ce{constructor(e,t=Tt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};j.NotificationType=Hu;var Uu=class extends Ce{constructor(e){super(e,0)}};j.NotificationType0=Uu;var ju=class extends Ce{constructor(e,t=Tt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};j.NotificationType1=ju;var $u=class extends Ce{constructor(e){super(e,2)}};j.NotificationType2=$u;var Bu=class extends Ce{constructor(e){super(e,3)}};j.NotificationType3=Bu;var Vu=class extends Ce{constructor(e){super(e,4)}};j.NotificationType4=Vu;var Gu=class extends Ce{constructor(e){super(e,5)}};j.NotificationType5=Gu;var Ku=class extends Ce{constructor(e){super(e,6)}};j.NotificationType6=Ku;var Ju=class extends Ce{constructor(e){super(e,7)}};j.NotificationType7=Ju;var Xu=class extends Ce{constructor(e){super(e,8)}};j.NotificationType8=Xu;var Qu=class extends Ce{constructor(e){super(e,9)}};j.NotificationType9=Qu;var PT;(function(n){function e(i){let o=i;return o&&oi.string(o.method)&&(oi.string(o.id)||oi.number(o.id))}n.isRequest=e;function t(i){let o=i;return o&&oi.string(o.method)&&i.id===void 0}n.isNotification=t;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(oi.string(o.id)||oi.number(o.id)||o.id===null)}n.isResponse=r})(PT=j.Message||(j.Message={}))});var ep=w(Kn=>{"use strict";d();var xy;Object.defineProperty(Kn,"__esModule",{value:!0});Kn.LRUCache=Kn.LinkedMap=Kn.Touch=void 0;var ft;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(ft=Kn.Touch||(Kn.Touch={}));var Wa=class{constructor(){this[xy]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=ft.None){let r=this._map.get(e);if(r)return t!==ft.None&&this.touch(r,t),r.value}set(e,t,r=ft.None){let i=this._map.get(e);if(i)i.value=t,r!==ft.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case ft.None:this.addItemLast(i);break;case ft.First:this.addItemFirst(i);break;case ft.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let r=this._state,i=this._head;for(;i;){if(t?e.bind(t)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:t.key,done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:t.value,done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:[t.key,t.value],done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}[(xy=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,r=this.size;for(;t&&r>e;)this._map.delete(t.key),t=t.next,r--;this._head=t,this._size=r,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,r=e.previous;if(!t||!r)throw new Error("Invalid list");t.previous=r,r.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==ft.First&&t!==ft.Last)){if(t===ft.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===ft.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,r)=>{e.push([r,t])}),e}fromJSON(e){this.clear();for(let[t,r]of e)this.set(t,r)}};Kn.LinkedMap=Wa;var Zu=class extends Wa{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=ft.AsNew){return super.get(e,t)}peek(e){return super.get(e,ft.None)}set(e,t){return super.set(e,t,ft.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Kn.LRUCache=Zu});var ky=w(ss=>{"use strict";d();Object.defineProperty(ss,"__esModule",{value:!0});ss.Disposable=void 0;var MT;(function(n){function e(t){return{dispose:t}}n.create=e})(MT=ss.Disposable||(ss.Disposable={}))});var Cr=w(rp=>{"use strict";d();Object.defineProperty(rp,"__esModule",{value:!0});var tp;function np(){if(tp===void 0)throw new Error("No runtime abstraction layer installed");return tp}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");tp=t}n.install=e})(np||(np={}));rp.default=np});var Li=w(si=>{"use strict";d();Object.defineProperty(si,"__esModule",{value:!0});si.Emitter=si.Event=void 0;var IT=Cr(),NT;(function(n){let e={dispose(){}};n.None=function(){return e}})(NT=si.Event||(si.Event={}));var ip=class{add(e,t=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===t){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{t.push(r[o].apply(i[o],e))}catch(a){(0,IT.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Ha=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,r)=>{this._callbacks||(this._callbacks=new ip),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),i.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};si.Emitter=Ha;Ha._noop=function(){}});var ja=w(ai=>{"use strict";d();Object.defineProperty(ai,"__esModule",{value:!0});ai.CancellationTokenSource=ai.CancellationToken=void 0;var zT=Cr(),OT=Ai(),op=Li(),sp;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:op.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:op.Event.None});function e(t){let r=t;return r&&(r===n.None||r===n.Cancelled||OT.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}n.is=e})(sp=ai.CancellationToken||(ai.CancellationToken={}));var AT=Object.freeze(function(n,e){let t=(0,zT.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),Ua=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?AT:(this._emitter||(this._emitter=new op.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},ap=class{get token(){return this._token||(this._token=new Ua),this._token}cancel(){this._token?this._token.cancel():this._token=sp.Cancelled}dispose(){this._token?this._token instanceof Ua&&this._token.dispose():this._token=sp.None}};ai.CancellationTokenSource=ap});var Cy=w(qi=>{"use strict";d();Object.defineProperty(qi,"__esModule",{value:!0});qi.SharedArrayReceiverStrategy=qi.SharedArraySenderStrategy=void 0;var LT=ja(),as;(function(n){n.Continue=0,n.Cancelled=1})(as||(as={}));var lp=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=as.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,as.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};qi.SharedArraySenderStrategy=lp;var cp=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===as.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},dp=class{constructor(e){this.token=new cp(e)}cancel(){}dispose(){}},hp=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new LT.CancellationTokenSource:new dp(t)}};qi.SharedArrayReceiverStrategy=hp});var pp=w($a=>{"use strict";d();Object.defineProperty($a,"__esModule",{value:!0});$a.Semaphore=void 0;var qT=Cr(),up=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,r)=>{this._waiting.push({thunk:e,resolve:t,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,qT.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};$a.Semaphore=up});var _y=w(Jn=>{"use strict";d();Object.defineProperty(Jn,"__esModule",{value:!0});Jn.ReadableStreamMessageReader=Jn.AbstractMessageReader=Jn.MessageReader=void 0;var fp=Cr(),Wi=Ai(),mp=Li(),WT=pp(),HT;(function(n){function e(t){let r=t;return r&&Wi.func(r.listen)&&Wi.func(r.dispose)&&Wi.func(r.onError)&&Wi.func(r.onClose)&&Wi.func(r.onPartialMessage)}n.is=e})(HT=Jn.MessageReader||(Jn.MessageReader={}));var Ba=class{constructor(){this.errorEmitter=new mp.Emitter,this.closeEmitter=new mp.Emitter,this.partialMessageEmitter=new mp.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Wi.string(e.message)?e.message:"unknown"}`)}};Jn.AbstractMessageReader=Ba;var gp;(function(n){function e(t){let r,i,o,s=new Map,a,l=new Map;if(t===void 0||typeof t=="string")r=t??"utf-8";else{if(r=t.charset??"utf-8",t.contentDecoder!==void 0&&(o=t.contentDecoder,s.set(o.name,o)),t.contentDecoders!==void 0)for(let c of t.contentDecoders)s.set(c.name,c);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,l.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let c of t.contentTypeDecoders)l.set(c.name,c)}return a===void 0&&(a=(0,fp.default)().applicationJson.decoder,l.set(a.name,a)),{charset:r,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:l}}n.fromOptions=e})(gp||(gp={}));var bp=class extends Ba{constructor(e,t){super(),this.readable=e,this.options=gp.fromOptions(t),this.buffer=(0,fp.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new WT.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),t}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error("Header must provide a Content-Length property."));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error("Content-Length value must be a number."));return}this.nextMessageLength=o}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,fp.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Jn.ReadableStreamMessageReader=bp});var Dy=w(Xn=>{"use strict";d();Object.defineProperty(Xn,"__esModule",{value:!0});Xn.WriteableStreamMessageWriter=Xn.AbstractMessageWriter=Xn.MessageWriter=void 0;var Ty=Cr(),ls=Ai(),UT=pp(),Ry=Li(),jT="Content-Length: ",Ey=`\r
1
+ import{v as Yv}from"./chunk-4P54DKG4.js";import{A as hy,B as ii,C as uy,D as Fn,E as py,F as my,G as za,H as fy,I as Oa,J as gy,K as rs,L as kT,M as by,N as Aa,O as is,P as os,Q as Pn,R as vy,S as sn,T as La,U as qa,V,W as CT,X as _T,a as ee,aa as Eu,b as Fa,c as Zv,d as Dn,e as ke,f as Pa,g as ey,h as ty,i as ny,j as ry,k as iy,l as ns,m as oy,n as Ma,o as K,p as Ia,q as sy,r as Na,s as Vt,t as ay,u as B,v as lt,w as kr,x as ly,y as cy,z as dy}from"./chunk-L42FYXFW.js";import{b as Qv}from"./chunk-NGCPVRDM.js";import{a as jt,b as Z,c as w,d as Xv,e as $t,f as Bt,g as d}from"./chunk-VKWPEFWQ.js";var Ai=w(ct=>{"use strict";d();Object.defineProperty(ct,"__esModule",{value:!0});ct.stringArray=ct.array=ct.func=ct.error=ct.number=ct.string=ct.boolean=void 0;function TT(n){return n===!0||n===!1}ct.boolean=TT;function yy(n){return typeof n=="string"||n instanceof String}ct.string=yy;function RT(n){return typeof n=="number"||n instanceof Number}ct.number=RT;function ET(n){return n instanceof Error}ct.error=ET;function DT(n){return typeof n=="function"}ct.func=DT;function wy(n){return Array.isArray(n)}ct.array=wy;function FT(n){return wy(n)&&n.every(e=>yy(e))}ct.stringArray=FT});var Yu=w(j=>{"use strict";d();Object.defineProperty(j,"__esModule",{value:!0});j.Message=j.NotificationType9=j.NotificationType8=j.NotificationType7=j.NotificationType6=j.NotificationType5=j.NotificationType4=j.NotificationType3=j.NotificationType2=j.NotificationType1=j.NotificationType0=j.NotificationType=j.RequestType9=j.RequestType8=j.RequestType7=j.RequestType6=j.RequestType5=j.RequestType4=j.RequestType3=j.RequestType2=j.RequestType1=j.RequestType=j.RequestType0=j.AbstractMessageSignature=j.ParameterStructures=j.ResponseError=j.ErrorCodes=void 0;var oi=Ai(),Sy;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(Sy=j.ErrorCodes||(j.ErrorCodes={}));var Du=class n extends Error{constructor(e,t,r){super(t),this.code=oi.number(e)?e:Sy.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};j.ResponseError=Du;var Tt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};j.ParameterStructures=Tt;Tt.auto=new Tt("auto");Tt.byPosition=new Tt("byPosition");Tt.byName=new Tt("byName");var Ce=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Tt.auto}};j.AbstractMessageSignature=Ce;var Fu=class extends Ce{constructor(e){super(e,0)}};j.RequestType0=Fu;var Pu=class extends Ce{constructor(e,t=Tt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};j.RequestType=Pu;var Mu=class extends Ce{constructor(e,t=Tt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};j.RequestType1=Mu;var Iu=class extends Ce{constructor(e){super(e,2)}};j.RequestType2=Iu;var Nu=class extends Ce{constructor(e){super(e,3)}};j.RequestType3=Nu;var zu=class extends Ce{constructor(e){super(e,4)}};j.RequestType4=zu;var Ou=class extends Ce{constructor(e){super(e,5)}};j.RequestType5=Ou;var Au=class extends Ce{constructor(e){super(e,6)}};j.RequestType6=Au;var Lu=class extends Ce{constructor(e){super(e,7)}};j.RequestType7=Lu;var qu=class extends Ce{constructor(e){super(e,8)}};j.RequestType8=qu;var Wu=class extends Ce{constructor(e){super(e,9)}};j.RequestType9=Wu;var Hu=class extends Ce{constructor(e,t=Tt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};j.NotificationType=Hu;var Uu=class extends Ce{constructor(e){super(e,0)}};j.NotificationType0=Uu;var ju=class extends Ce{constructor(e,t=Tt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};j.NotificationType1=ju;var $u=class extends Ce{constructor(e){super(e,2)}};j.NotificationType2=$u;var Bu=class extends Ce{constructor(e){super(e,3)}};j.NotificationType3=Bu;var Vu=class extends Ce{constructor(e){super(e,4)}};j.NotificationType4=Vu;var Gu=class extends Ce{constructor(e){super(e,5)}};j.NotificationType5=Gu;var Ku=class extends Ce{constructor(e){super(e,6)}};j.NotificationType6=Ku;var Ju=class extends Ce{constructor(e){super(e,7)}};j.NotificationType7=Ju;var Xu=class extends Ce{constructor(e){super(e,8)}};j.NotificationType8=Xu;var Qu=class extends Ce{constructor(e){super(e,9)}};j.NotificationType9=Qu;var PT;(function(n){function e(i){let o=i;return o&&oi.string(o.method)&&(oi.string(o.id)||oi.number(o.id))}n.isRequest=e;function t(i){let o=i;return o&&oi.string(o.method)&&i.id===void 0}n.isNotification=t;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(oi.string(o.id)||oi.number(o.id)||o.id===null)}n.isResponse=r})(PT=j.Message||(j.Message={}))});var ep=w(Kn=>{"use strict";d();var xy;Object.defineProperty(Kn,"__esModule",{value:!0});Kn.LRUCache=Kn.LinkedMap=Kn.Touch=void 0;var ft;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(ft=Kn.Touch||(Kn.Touch={}));var Wa=class{constructor(){this[xy]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=ft.None){let r=this._map.get(e);if(r)return t!==ft.None&&this.touch(r,t),r.value}set(e,t,r=ft.None){let i=this._map.get(e);if(i)i.value=t,r!==ft.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case ft.None:this.addItemLast(i);break;case ft.First:this.addItemFirst(i);break;case ft.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let r=this._state,i=this._head;for(;i;){if(t?e.bind(t)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:t.key,done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:t.value,done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:[t.key,t.value],done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}[(xy=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,r=this.size;for(;t&&r>e;)this._map.delete(t.key),t=t.next,r--;this._head=t,this._size=r,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,r=e.previous;if(!t||!r)throw new Error("Invalid list");t.previous=r,r.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==ft.First&&t!==ft.Last)){if(t===ft.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===ft.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,r)=>{e.push([r,t])}),e}fromJSON(e){this.clear();for(let[t,r]of e)this.set(t,r)}};Kn.LinkedMap=Wa;var Zu=class extends Wa{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=ft.AsNew){return super.get(e,t)}peek(e){return super.get(e,ft.None)}set(e,t){return super.set(e,t,ft.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Kn.LRUCache=Zu});var ky=w(ss=>{"use strict";d();Object.defineProperty(ss,"__esModule",{value:!0});ss.Disposable=void 0;var MT;(function(n){function e(t){return{dispose:t}}n.create=e})(MT=ss.Disposable||(ss.Disposable={}))});var Cr=w(rp=>{"use strict";d();Object.defineProperty(rp,"__esModule",{value:!0});var tp;function np(){if(tp===void 0)throw new Error("No runtime abstraction layer installed");return tp}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");tp=t}n.install=e})(np||(np={}));rp.default=np});var Li=w(si=>{"use strict";d();Object.defineProperty(si,"__esModule",{value:!0});si.Emitter=si.Event=void 0;var IT=Cr(),NT;(function(n){let e={dispose(){}};n.None=function(){return e}})(NT=si.Event||(si.Event={}));var ip=class{add(e,t=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===t){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{t.push(r[o].apply(i[o],e))}catch(a){(0,IT.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Ha=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,r)=>{this._callbacks||(this._callbacks=new ip),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),i.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};si.Emitter=Ha;Ha._noop=function(){}});var ja=w(ai=>{"use strict";d();Object.defineProperty(ai,"__esModule",{value:!0});ai.CancellationTokenSource=ai.CancellationToken=void 0;var zT=Cr(),OT=Ai(),op=Li(),sp;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:op.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:op.Event.None});function e(t){let r=t;return r&&(r===n.None||r===n.Cancelled||OT.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}n.is=e})(sp=ai.CancellationToken||(ai.CancellationToken={}));var AT=Object.freeze(function(n,e){let t=(0,zT.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),Ua=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?AT:(this._emitter||(this._emitter=new op.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},ap=class{get token(){return this._token||(this._token=new Ua),this._token}cancel(){this._token?this._token.cancel():this._token=sp.Cancelled}dispose(){this._token?this._token instanceof Ua&&this._token.dispose():this._token=sp.None}};ai.CancellationTokenSource=ap});var Cy=w(qi=>{"use strict";d();Object.defineProperty(qi,"__esModule",{value:!0});qi.SharedArrayReceiverStrategy=qi.SharedArraySenderStrategy=void 0;var LT=ja(),as;(function(n){n.Continue=0,n.Cancelled=1})(as||(as={}));var lp=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=as.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,as.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};qi.SharedArraySenderStrategy=lp;var cp=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===as.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},dp=class{constructor(e){this.token=new cp(e)}cancel(){}dispose(){}},hp=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new LT.CancellationTokenSource:new dp(t)}};qi.SharedArrayReceiverStrategy=hp});var pp=w($a=>{"use strict";d();Object.defineProperty($a,"__esModule",{value:!0});$a.Semaphore=void 0;var qT=Cr(),up=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,r)=>{this._waiting.push({thunk:e,resolve:t,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,qT.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};$a.Semaphore=up});var _y=w(Jn=>{"use strict";d();Object.defineProperty(Jn,"__esModule",{value:!0});Jn.ReadableStreamMessageReader=Jn.AbstractMessageReader=Jn.MessageReader=void 0;var fp=Cr(),Wi=Ai(),mp=Li(),WT=pp(),HT;(function(n){function e(t){let r=t;return r&&Wi.func(r.listen)&&Wi.func(r.dispose)&&Wi.func(r.onError)&&Wi.func(r.onClose)&&Wi.func(r.onPartialMessage)}n.is=e})(HT=Jn.MessageReader||(Jn.MessageReader={}));var Ba=class{constructor(){this.errorEmitter=new mp.Emitter,this.closeEmitter=new mp.Emitter,this.partialMessageEmitter=new mp.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Wi.string(e.message)?e.message:"unknown"}`)}};Jn.AbstractMessageReader=Ba;var gp;(function(n){function e(t){let r,i,o,s=new Map,a,l=new Map;if(t===void 0||typeof t=="string")r=t??"utf-8";else{if(r=t.charset??"utf-8",t.contentDecoder!==void 0&&(o=t.contentDecoder,s.set(o.name,o)),t.contentDecoders!==void 0)for(let c of t.contentDecoders)s.set(c.name,c);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,l.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let c of t.contentTypeDecoders)l.set(c.name,c)}return a===void 0&&(a=(0,fp.default)().applicationJson.decoder,l.set(a.name,a)),{charset:r,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:l}}n.fromOptions=e})(gp||(gp={}));var bp=class extends Ba{constructor(e,t){super(),this.readable=e,this.options=gp.fromOptions(t),this.buffer=(0,fp.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new WT.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),t}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error("Header must provide a Content-Length property."));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error("Content-Length value must be a number."));return}this.nextMessageLength=o}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,fp.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Jn.ReadableStreamMessageReader=bp});var Dy=w(Xn=>{"use strict";d();Object.defineProperty(Xn,"__esModule",{value:!0});Xn.WriteableStreamMessageWriter=Xn.AbstractMessageWriter=Xn.MessageWriter=void 0;var Ty=Cr(),ls=Ai(),UT=pp(),Ry=Li(),jT="Content-Length: ",Ey=`\r
2
2
  `,$T;(function(n){function e(t){let r=t;return r&&ls.func(r.dispose)&&ls.func(r.onClose)&&ls.func(r.onError)&&ls.func(r.write)}n.is=e})($T=Xn.MessageWriter||(Xn.MessageWriter={}));var Va=class{constructor(){this.errorEmitter=new Ry.Emitter,this.closeEmitter=new Ry.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,r){this.errorEmitter.fire([this.asError(e),t,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${ls.string(e.message)?e.message:"unknown"}`)}};Xn.AbstractMessageWriter=Va;var vp;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,Ty.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,Ty.default)().applicationJson.encoder}}n.fromOptions=e})(vp||(vp={}));var yp=class extends Va{constructor(e,t){super(),this.writable=e,this.options=vp.fromOptions(t),this.errorCount=0,this.writeSemaphore=new UT.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(jT,r.byteLength.toString(),Ey),i.push(Ey),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,t,r){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};Xn.WriteableStreamMessageWriter=yp});var Fy=w(Ga=>{"use strict";d();Object.defineProperty(Ga,"__esModule",{value:!0});Ga.AbstractMessageBuffer=void 0;var BT=13,VT=10,GT=`\r
3
3
  `,wp=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,r=0,i=0,o=0;e:for(;r<this._chunks.length;){let c=this._chunks[r];for(i=0;i<c.length;){switch(c[i]){case BT:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case VT:switch(t){case 1:t=2;break;case 3:t=4,i++;break e;default:t=0}break;default:t=0}i++}o+=c.byteLength,r++}if(t!==4)return;let s=this._read(o+i),a=new Map,l=this.toString(s,"ascii").split(GT);if(l.length<2)return a;for(let c=0;c<l.length-2;c++){let h=l[c],p=h.indexOf(":");if(p===-1)throw new Error("Message header must separate key and value using :");let f=h.substr(0,p),b=h.substr(p+1).trim();a.set(e?f.toLowerCase():f,b)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let t=this.allocNative(e),r=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let s=o.slice(0,e);t.set(s,r),r+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else t.set(o,r),r+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return t}};Ga.AbstractMessageBuffer=wp});var Ay=w(U=>{"use strict";d();Object.defineProperty(U,"__esModule",{value:!0});U.createMessageConnection=U.ConnectionOptions=U.MessageStrategy=U.CancellationStrategy=U.CancellationSenderStrategy=U.CancellationReceiverStrategy=U.RequestCancellationReceiverStrategy=U.IdCancellationReceiverStrategy=U.ConnectionStrategy=U.ConnectionError=U.ConnectionErrors=U.LogTraceNotification=U.SetTraceNotification=U.TraceFormat=U.TraceValues=U.Trace=U.NullLogger=U.ProgressType=U.ProgressToken=void 0;var Py=Cr(),Pe=Ai(),J=Yu(),My=ep(),cs=Li(),Sp=ja(),hs;(function(n){n.type=new J.NotificationType("$/cancelRequest")})(hs||(hs={}));var Iy;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(Iy=U.ProgressToken||(U.ProgressToken={}));var ds;(function(n){n.type=new J.NotificationType("$/progress")})(ds||(ds={}));var xp=class{constructor(){}};U.ProgressType=xp;var kp;(function(n){function e(t){return Pe.func(t)}n.is=e})(kp||(kp={}));U.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var fe;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(fe=U.Trace||(U.Trace={}));var KT;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(KT=U.TraceValues||(U.TraceValues={}));(function(n){function e(r){if(!Pe.string(r))return n.Off;switch(r=r.toLowerCase(),r){case"off":return n.Off;case"messages":return n.Messages;case"compact":return n.Compact;case"verbose":return n.Verbose;default:return n.Off}}n.fromString=e;function t(r){switch(r){case n.Off:return"off";case n.Messages:return"messages";case n.Compact:return"compact";case n.Verbose:return"verbose";default:return"off"}}n.toString=t})(fe=U.Trace||(U.Trace={}));var an;(function(n){n.Text="text",n.JSON="json"})(an=U.TraceFormat||(U.TraceFormat={}));(function(n){function e(t){return Pe.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(an=U.TraceFormat||(U.TraceFormat={}));var Ny;(function(n){n.type=new J.NotificationType("$/setTrace")})(Ny=U.SetTraceNotification||(U.SetTraceNotification={}));var Cp;(function(n){n.type=new J.NotificationType("$/logTrace")})(Cp=U.LogTraceNotification||(U.LogTraceNotification={}));var Ka;(function(n){n[n.Closed=1]="Closed",n[n.Disposed=2]="Disposed",n[n.AlreadyListening=3]="AlreadyListening"})(Ka=U.ConnectionErrors||(U.ConnectionErrors={}));var Hi=class n extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,n.prototype)}};U.ConnectionError=Hi;var zy;(function(n){function e(t){let r=t;return r&&Pe.func(r.cancelUndispatched)}n.is=e})(zy=U.ConnectionStrategy||(U.ConnectionStrategy={}));var Rp;(function(n){function e(t){let r=t;return r&&(r.kind===void 0||r.kind==="id")&&Pe.func(r.createCancellationTokenSource)&&(r.dispose===void 0||Pe.func(r.dispose))}n.is=e})(Rp=U.IdCancellationReceiverStrategy||(U.IdCancellationReceiverStrategy={}));var Oy;(function(n){function e(t){let r=t;return r&&r.kind==="request"&&Pe.func(r.createCancellationTokenSource)&&(r.dispose===void 0||Pe.func(r.dispose))}n.is=e})(Oy=U.RequestCancellationReceiverStrategy||(U.RequestCancellationReceiverStrategy={}));var _p;(function(n){n.Message=Object.freeze({createCancellationTokenSource(t){return new Sp.CancellationTokenSource}});function e(t){return Rp.is(t)||Oy.is(t)}n.is=e})(_p=U.CancellationReceiverStrategy||(U.CancellationReceiverStrategy={}));var Tp;(function(n){n.Message=Object.freeze({sendCancellation(t,r){return t.sendNotification(hs.type,{id:r})},cleanup(t){}});function e(t){let r=t;return r&&Pe.func(r.sendCancellation)&&Pe.func(r.cleanup)}n.is=e})(Tp=U.CancellationSenderStrategy||(U.CancellationSenderStrategy={}));var Ep;(function(n){n.Message=Object.freeze({receiver:_p.Message,sender:Tp.Message});function e(t){let r=t;return r&&_p.is(r.receiver)&&Tp.is(r.sender)}n.is=e})(Ep=U.CancellationStrategy||(U.CancellationStrategy={}));var Dp;(function(n){function e(t){let r=t;return r&&Pe.func(r.handleMessage)}n.is=e})(Dp=U.MessageStrategy||(U.MessageStrategy={}));var JT;(function(n){function e(t){let r=t;return r&&(Ep.is(r.cancellationStrategy)||zy.is(r.connectionStrategy)||Dp.is(r.messageStrategy))}n.is=e})(JT=U.ConnectionOptions||(U.ConnectionOptions={}));var ln;(function(n){n[n.New=1]="New",n[n.Listening=2]="Listening",n[n.Closed=3]="Closed",n[n.Disposed=4]="Disposed"})(ln||(ln={}));function XT(n,e,t,r){let i=t!==void 0?t:U.NullLogger,o=0,s=0,a=0,l="2.0",c,h=new Map,p,f=new Map,b=new Map,C,D=new My.LinkedMap,P=new Map,A=new Set,S=new Map,y=fe.Off,R=an.Text,N,q=ln.New,Se=new cs.Emitter,De=new cs.Emitter,Wt=new cs.Emitter,Dt=new cs.Emitter,kt=new cs.Emitter,Ct=r&&r.cancellationStrategy?r.cancellationStrategy:Ep.Message;function wr(v){if(v===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+v.toString()}function ni(v){return v===null?"res-unknown-"+(++a).toString():"res-"+v.toString()}function Ht(){return"not-"+(++s).toString()}function Ft(v,E){J.Message.isRequest(E)?v.set(wr(E.id),E):J.Message.isResponse(E)?v.set(ni(E.id),E):v.set(Ht(),E)}function Sr(v){}function Ut(){return q===ln.Listening}function Rn(){return q===ln.Closed}function pt(){return q===ln.Disposed}function xr(){(q===ln.New||q===ln.Listening)&&(q=ln.Closed,De.fire(void 0))}function Zo(v){Se.fire([v,void 0,void 0])}function Mi(v){Se.fire(v)}n.onClose(xr),n.onError(Zo),e.onClose(xr),e.onError(Mi);function Ii(){C||D.size===0||(C=(0,Py.default)().timer.setImmediate(()=>{C=void 0,ku()}))}function Ni(v){J.Message.isRequest(v)?Cu(v):J.Message.isNotification(v)?Tu(v):J.Message.isResponse(v)?_u(v):Da(v)}function ku(){if(D.size===0)return;let v=D.shift();try{let E=r?.messageStrategy;Dp.is(E)?E.handleMessage(v,Ni):Ni(v)}finally{Ii()}}let ri=v=>{try{if(J.Message.isNotification(v)&&v.method===hs.type.method){let E=v.params.id,I=wr(E),H=D.get(I);if(J.Message.isRequest(H)){let ge=r?.connectionStrategy,Ne=ge&&ge.cancelUndispatched?ge.cancelUndispatched(H,Sr):void 0;if(Ne&&(Ne.error!==void 0||Ne.result!==void 0)){D.delete(I),S.delete(E),Ne.id=H.id,G(Ne,v.method,Date.now()),e.write(Ne).catch(()=>i.error("Sending response for canceled message failed."));return}}let xe=S.get(E);if(xe!==void 0){xe.cancel(),_t(v);return}else A.add(E)}Ft(D,v)}finally{Ii()}};function Cu(v){if(pt())return;function E(ce,Fe,me){let Be={jsonrpc:l,id:v.id};ce instanceof J.ResponseError?Be.error=ce.toJson():Be.result=ce===void 0?null:ce,G(Be,Fe,me),e.write(Be).catch(()=>i.error("Sending response failed."))}function I(ce,Fe,me){let Be={jsonrpc:l,id:v.id,error:ce.toJson()};G(Be,Fe,me),e.write(Be).catch(()=>i.error("Sending response failed."))}function H(ce,Fe,me){ce===void 0&&(ce=null);let Be={jsonrpc:l,id:v.id,result:ce};G(Be,Fe,me),e.write(Be).catch(()=>i.error("Sending response failed."))}Re(v);let xe=h.get(v.method),ge,Ne;xe&&(ge=xe.type,Ne=xe.handler);let Oe=Date.now();if(Ne||c){let ce=v.id??String(Date.now()),Fe=Rp.is(Ct.receiver)?Ct.receiver.createCancellationTokenSource(ce):Ct.receiver.createCancellationTokenSource(v);v.id!==null&&A.has(v.id)&&Fe.cancel(),v.id!==null&&S.set(ce,Fe);try{let me;if(Ne)if(v.params===void 0){if(ge!==void 0&&ge.numberOfParams!==0){I(new J.ResponseError(J.ErrorCodes.InvalidParams,`Request ${v.method} defines ${ge.numberOfParams} params but received none.`),v.method,Oe);return}me=Ne(Fe.token)}else if(Array.isArray(v.params)){if(ge!==void 0&&ge.parameterStructures===J.ParameterStructures.byName){I(new J.ResponseError(J.ErrorCodes.InvalidParams,`Request ${v.method} defines parameters by name but received parameters by position`),v.method,Oe);return}me=Ne(...v.params,Fe.token)}else{if(ge!==void 0&&ge.parameterStructures===J.ParameterStructures.byPosition){I(new J.ResponseError(J.ErrorCodes.InvalidParams,`Request ${v.method} defines parameters by position but received parameters by name`),v.method,Oe);return}me=Ne(v.params,Fe.token)}else c&&(me=c(v.method,v.params,Fe.token));let Be=me;me?Be.then?Be.then(mt=>{S.delete(ce),E(mt,v.method,Oe)},mt=>{S.delete(ce),mt instanceof J.ResponseError?I(mt,v.method,Oe):mt&&Pe.string(mt.message)?I(new J.ResponseError(J.ErrorCodes.InternalError,`Request ${v.method} failed with message: ${mt.message}`),v.method,Oe):I(new J.ResponseError(J.ErrorCodes.InternalError,`Request ${v.method} failed unexpectedly without providing any details.`),v.method,Oe)}):(S.delete(ce),E(me,v.method,Oe)):(S.delete(ce),H(me,v.method,Oe))}catch(me){S.delete(ce),me instanceof J.ResponseError?E(me,v.method,Oe):me&&Pe.string(me.message)?I(new J.ResponseError(J.ErrorCodes.InternalError,`Request ${v.method} failed with message: ${me.message}`),v.method,Oe):I(new J.ResponseError(J.ErrorCodes.InternalError,`Request ${v.method} failed unexpectedly without providing any details.`),v.method,Oe)}}else I(new J.ResponseError(J.ErrorCodes.MethodNotFound,`Unhandled method ${v.method}`),v.method,Oe)}function _u(v){if(!pt())if(v.id===null)v.error?i.error(`Received response message without id: Error is:
4
4
  ${JSON.stringify(v.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let E=v.id,I=P.get(E);if(yT(v,I),I!==void 0){P.delete(E);try{if(v.error){let H=v.error;I.reject(new J.ResponseError(H.code,H.message,H.data))}else if(v.result!==void 0)I.resolve(v.result);else throw new Error("Should never happen.")}catch(H){H.message?i.error(`Response handler '${I.method}' failed with message: ${H.message}`):i.error(`Response handler '${I.method}' failed unexpectedly.`)}}}}function Tu(v){if(pt())return;let E,I;if(v.method===hs.type.method){let H=v.params.id;A.delete(H),_t(v);return}else{let H=f.get(v.method);H&&(I=H.handler,E=H.type)}if(I||p)try{if(_t(v),I)if(v.params===void 0)E!==void 0&&E.numberOfParams!==0&&E.parameterStructures!==J.ParameterStructures.byName&&i.error(`Notification ${v.method} defines ${E.numberOfParams} params but received none.`),I();else if(Array.isArray(v.params)){let H=v.params;v.method===ds.type.method&&H.length===2&&Iy.is(H[0])?I({token:H[0],value:H[1]}):(E!==void 0&&(E.parameterStructures===J.ParameterStructures.byName&&i.error(`Notification ${v.method} defines parameters by name but received parameters by position`),E.numberOfParams!==v.params.length&&i.error(`Notification ${v.method} defines ${E.numberOfParams} params but received ${H.length} arguments`)),I(...H))}else E!==void 0&&E.parameterStructures===J.ParameterStructures.byPosition&&i.error(`Notification ${v.method} defines parameters by position but received parameters by name`),I(v.params);else p&&p(v.method,v.params)}catch(H){H.message?i.error(`Notification handler '${v.method}' failed with message: ${H.message}`):i.error(`Notification handler '${v.method}' failed unexpectedly.`)}else Wt.fire(v)}function Da(v){if(!v){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
@@ -554,6 +554,6 @@ This is used to produce an effect that is known as tate-ch\u016B-yoko (\u7E26\u4
554
554
 
555
555
  In order to let ::-webkit-progress-value take effect, -webkit-appearance needs to be set to none on the <progress> element.`},{name:"::grammar-error",status:"experimental",browsers:["E121","S17.4","C121","O107"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::grammar-error"}],description:"The ::grammar-error CSS pseudo-element represents a text segment which the user agent has flagged as grammatically incorrect."},{name:"::marker",browsers:["E86","FF68","S11.1","C86","O72"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::marker"}],description:"The ::marker CSS pseudo-element selects the marker box of a list item, which typically contains a bullet or number. It works on any element or pseudo-element set to display: list-item, such as the <li> and <summary> elements."},{name:"::part",status:"experimental",browsers:["E79","FF72","S13.1","C73","O60"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::part"}],description:"The ::part CSS pseudo-element represents any element within a shadow tree that has a matching part attribute."},{name:"::placeholder",browsers:["E79","FF51","S10.1","C57","O44"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::placeholder"}],description:"The ::placeholder CSS pseudo-element represents the placeholder text of a form element."},{name:"::slotted",browsers:["E79","FF63","S10","C50","O37"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::slotted"}],description:"The :slotted() CSS pseudo-element represents any element that has been placed into a slot inside an HTML template."},{name:"::spelling-error",status:"experimental",browsers:["E121","S17.4","C121","O107"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::spelling-error"}],description:"The ::spelling-error CSS pseudo-element represents a text segment which the user agent has flagged as incorrectly spelled."},{name:"::view-transition",status:"experimental",browsers:["E109","S18","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::view-transition"}],description:"The ::view-transition CSS pseudo-element represents the root of the view transitions overlay, which contains all view transitions and sits over the top of all other page content."},{name:"::view-transition-group",status:"experimental",browsers:["E109","S18","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::view-transition-group"}],description:"The ::view-transition-group CSS pseudo-element represents a single view transition group."},{name:"::view-transition-image-pair",status:"experimental",browsers:["E109","S18","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::view-transition-image-pair"}],description:`The ::view-transition-image-pair CSS pseudo-element represents a container for a view transition's "old" and "new" view states \u2014 before and after the transition.`},{name:"::view-transition-new",status:"experimental",browsers:["E109","S18","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::view-transition-new"}],description:'The ::view-transition-new CSS pseudo-element represents the "new" view state of a view transition \u2014 a live representation of the new view, after the transition.'},{name:"::view-transition-old",status:"experimental",browsers:["E109","S18","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::view-transition-old"}],description:'The ::view-transition-old CSS pseudo-element represents the "old" view state of a view transition \u2014 a static screenshot of the old view, before the transition.'}]}});function WN(n){return typeof n.name=="string"}function HN(n){return typeof n.name=="string"}function UN(n){return typeof n.name=="string"}function jN(n){return typeof n.name=="string"}var qo,ab=Z(()=>{"use strict";d();qo=class{constructor(e){this._properties=[],this._atDirectives=[],this._pseudoClasses=[],this._pseudoElements=[],this.addData(e)}provideProperties(){return this._properties}provideAtDirectives(){return this._atDirectives}providePseudoClasses(){return this._pseudoClasses}providePseudoElements(){return this._pseudoElements}addData(e){if(Array.isArray(e.properties))for(let t of e.properties)WN(t)&&this._properties.push(t);if(Array.isArray(e.atDirectives))for(let t of e.atDirectives)HN(t)&&this._atDirectives.push(t);if(Array.isArray(e.pseudoClasses))for(let t of e.pseudoClasses)UN(t)&&this._pseudoClasses.push(t);if(Array.isArray(e.pseudoElements))for(let t of e.pseudoElements)jN(t)&&this._pseudoElements.push(t)}}});var Wo,TC=Z(()=>{"use strict";d();sa();sb();ab();Wo=class{constructor(e){this.dataProviders=[],this._propertySet={},this._atDirectiveSet={},this._pseudoClassSet={},this._pseudoElementSet={},this._properties=[],this._atDirectives=[],this._pseudoClasses=[],this._pseudoElements=[],this.setDataProviders(e?.useDefaultDataProvider!==!1,e?.customDataProviders||[])}setDataProviders(e,t){this.dataProviders=[],e&&this.dataProviders.push(new qo(Jd)),this.dataProviders.push(...t),this.collectData()}collectData(){this._propertySet={},this._atDirectiveSet={},this._pseudoClassSet={},this._pseudoElementSet={},this.dataProviders.forEach(e=>{e.provideProperties().forEach(t=>{this._propertySet[t.name]||(this._propertySet[t.name]=t)}),e.provideAtDirectives().forEach(t=>{this._atDirectiveSet[t.name]||(this._atDirectiveSet[t.name]=t)}),e.providePseudoClasses().forEach(t=>{this._pseudoClassSet[t.name]||(this._pseudoClassSet[t.name]=t)}),e.providePseudoElements().forEach(t=>{this._pseudoElementSet[t.name]||(this._pseudoElementSet[t.name]=t)})}),this._properties=oa(this._propertySet),this._atDirectives=oa(this._atDirectiveSet),this._pseudoClasses=oa(this._pseudoClassSet),this._pseudoElements=oa(this._pseudoElementSet)}getProperty(e){return this._propertySet[e]}getAtDirective(e){return this._atDirectiveSet[e]}getPseudoClass(e){return this._pseudoClassSet[e]}getPseudoElement(e){return this._pseudoElementSet[e]}getProperties(){return this._properties}getAtDirectives(){return this._atDirectives}getPseudoClasses(){return this._pseudoClasses}getPseudoElements(){return this._pseudoElements}isKnownProperty(e){return e.toLowerCase()in this._propertySet}isStandardProperty(e){return this.isKnownProperty(e)&&(!this._propertySet[e.toLowerCase()].status||this._propertySet[e.toLowerCase()].status==="standard")}}});function RC(n,e,t){function r(o){let s=i(o),a;for(let l=s.length-1;l>=0;l--)a=rs.create(ke.create(n.positionAt(s[l][0]),n.positionAt(s[l][1])),a);return a||(a=rs.create(ke.create(o,o))),a}return e.map(r);function i(o){let s=n.offsetAt(o),a=t.findChildAtOffset(s,!0);if(!a)return[];let l=[];for(;a;){if(a.parent&&a.offset===a.parent.offset&&a.end===a.parent.end){a=a.parent;continue}a.type===g.Declarations&&s>a.offset&&s<a.end&&l.push([a.offset+1,a.end-1]),l.push([a.offset,a.end]),a=a.parent}return l}}var EC=Z(()=>{"use strict";d();Lt();it()});function $N(n){if(n.endsWith(".css"))return[n];if(n.endsWith("/"))return[n+"index.scss",n+"_index.scss"];let e=os.parse(n.replace(/\.scss$/,"")),t=Pn.basename(e),r=Pn.dirname(e);return t.startsWith("_")?[Pn.joinPath(r,t+".scss").toString(!0)]:[Pn.joinPath(r,t+".scss").toString(!0),Pn.joinPath(r,"_"+t+".scss").toString(!0),n+"/index.scss",n+"/_index.scss",Pn.joinPath(r,t+".css").toString(!0)]}var Xd,DC=Z(()=>{"use strict";d();Kg();it();vy();or();Dd();Xd=class extends Ri{constructor(e){super(e,!0)}isRawStringDocumentLinkNode(e){return super.isRawStringDocumentLinkNode(e)||e.type===g.Use||e.type===g.Forward}async mapReference(e,t){if(this.fileSystemProvider&&e&&t){let r=$N(e);for(let i of r)if(await this.fileExists(i))return i}return e}async resolveReference(e,t,r,i=!1){if(!_e(e,"sass:"))return e.startsWith("pkg:")?this.resolvePkgModulePath(e,t,r):super.resolveReference(e,t,r,i)}async resolvePkgModulePath(e,t,r){let i=e.replace("pkg:",""),o=i.includes("/")?Gg(i):i,s=r.resolveReference("/",t),a=Do(t),l=await this.resolvePathToModule(o,a,s);if(!l)return;let c=await this.getContent(Et(l,"package.json"));if(!c)return;let h;try{h=JSON.parse(c)}catch{return}let p=i.substring(o.length+1);if(h.exports)if(p){let f=p.endsWith(".scss")?`./${p.replace(".scss","")}`:`./${p}`,b=p.endsWith(".scss")?`./${p}`:`./${p}.scss`,C=h.exports[b]||h.exports[f];if(C){let D=C.sass||C.styles||C.default;if(D&&D.endsWith(".scss"))return Et(l,D)}else for(let[D,P]of Object.entries(h.exports)){if(!D.includes("*"))continue;let S=new RegExp(wk(D.replace(".scss","")).replace(/\.\*/g,"(.*)")).exec(f);if(S){let y=P.sass||P.styles||P.default;if(y&&y.endsWith(".scss")){let R=y.replace("*",S[1]);return Et(l,R)}}}}else{let f=h.exports["."]||h.exports,b=f&&(f.sass||f.style||f.default);if(b&&b.endsWith(".scss"))return Et(l,b)}else if(!p&&(h.sass||h.style)){let f=h.sass||h.style;if(f)return Et(l,f)}}}});var PC={};Xv(PC,{ClientCapabilities:()=>Tg,CodeAction:()=>Oa,CodeActionContext:()=>fy,CodeActionKind:()=>za,Color:()=>ey,ColorInformation:()=>ty,ColorPresentation:()=>ny,Command:()=>Ma,CompletionItem:()=>ly,CompletionItemKind:()=>B,CompletionItemTag:()=>kr,CompletionList:()=>cy,Diagnostic:()=>oy,DiagnosticSeverity:()=>ns,DocumentHighlight:()=>uy,DocumentHighlightKind:()=>ii,DocumentLink:()=>gy,DocumentSymbol:()=>my,DocumentUri:()=>Zv,FileType:()=>Gr,FoldingRange:()=>iy,FoldingRangeKind:()=>ry,Hover:()=>hy,InsertTextFormat:()=>lt,Location:()=>Pa,MarkedString:()=>dy,MarkupContent:()=>ay,MarkupKind:()=>Vt,Position:()=>Dn,Range:()=>ke,SelectionRange:()=>rs,SymbolInformation:()=>py,SymbolKind:()=>Fn,TextDocument:()=>by,TextDocumentEdit:()=>Ia,TextEdit:()=>K,VersionedTextDocumentIdentifier:()=>Na,WorkspaceEdit:()=>sy,getCSSLanguageService:()=>VN,getDefaultCSSDataProvider:()=>BN,getLESSLanguageService:()=>KN,getSCSSLanguageService:()=>GN,newCSSDataProvider:()=>FC});function BN(){return FC(Jd)}function FC(n){return new qo(n)}function lb(n,e,t,r,i,o,s){return{configure:a=>{o.configure(a),e.configure(a?.completion),t.configure(a?.hover),r.configure(a?.importAliases)},setDataProviders:s.setDataProviders.bind(s),doValidation:o.doValidation.bind(o),parseStylesheet:n.parseStylesheet.bind(n),doComplete:e.doComplete.bind(e),doComplete2:e.doComplete2.bind(e),setCompletionParticipants:e.setCompletionParticipants.bind(e),doHover:t.doHover.bind(t),format:CC,findDefinition:r.findDefinition.bind(r),findReferences:r.findReferences.bind(r),findDocumentHighlights:r.findDocumentHighlights.bind(r),findDocumentLinks:r.findDocumentLinks.bind(r),findDocumentLinks2:r.findDocumentLinks2.bind(r),findDocumentSymbols:r.findSymbolInformations.bind(r),findDocumentSymbols2:r.findDocumentSymbols.bind(r),doCodeActions:i.doCodeActions.bind(i),doCodeActions2:i.doCodeActions2.bind(i),findDocumentColors:r.findDocumentColors.bind(r),getColorPresentations:r.getColorPresentations.bind(r),prepareRename:r.prepareRename.bind(r),doRename:r.doRename.bind(r),getFoldingRanges:gC,getSelectionRanges:RC}}function VN(n=cb){let e=new Wo(n);return lb(new jn,new Jr(null,n,e),new Po(n&&n.clientCapabilities,e),new Ri(n&&n.fileSystemProvider,!1),new Io(e),new No(e),e)}function GN(n=cb){let e=new Wo(n);return lb(new Vd,new wn(n,e),new Po(n&&n.clientCapabilities,e),new Xd(n&&n.fileSystemProvider),new Io(e),new No(e),e)}function KN(n=cb){let e=new Wo(n);return lb(new Kd,new Lo(n,e),new Po(n&&n.clientCapabilities,e),new Ri(n&&n.fileSystemProvider,!0),new Io(e),new No(e),e)}var cb,MC=Z(()=>{"use strict";d();aa();Id();Kk();Kg();nC();sC();cC();hC();pC();mC();bC();_C();TC();ab();EC();DC();sb();Lt();cb={}});var NC=w(Qd=>{"use strict";d();Object.defineProperty(Qd,"__esModule",{value:!0});Qd.CSSLanguageService=void 0;var IC=ee(),db=V(),JN=(MC(),Bt(PC)),XN=(is(),Bt(Aa)),hb=class{documentManager;service=null;constructor(e){this.documentManager=e}async setup(e){this.service=(0,JN.getCSSLanguageService)({clientCapabilities:e})}async completions(e){let t=this.service;if(!t)return null;let r=this.getDocuments(e,t);if(!r)return null;let[i,o]=r;return t.doComplete(i,e.position,o)}async diagnostics(e){let t=this.service;if(!t)return[];let r=this.getDocuments(e,t);if(!r)return[];let[i,o]=r;return t.doValidation(i,o)}async hover(e){let t=this.service;if(!t)return null;let r=this.getDocuments(e,t);if(!r)return null;let[i,o]=r;return t.doHover(i,e.position,o)}getDocuments(e,t){let r=this.documentManager.get(e.textDocument.uri);if(!r)return null;switch(r.type){case db.SourceCodeType.JSON:return null;case db.SourceCodeType.LiquidHtml:{if(r.ast instanceof Error)return null;let i=r.textDocument,o=0,s=!1;"position"in e&&e.position.line!==0&&e.position.character!==0?o=i.offsetAt(e.position):(o=r.source.indexOf("{% stylesheet %}"),s=!0);let[a,l]=(0,db.findCurrentNode)(r.ast,o),c=[...l].find(C=>C.type===IC.NodeTypes.LiquidRawTag&&C.name==="stylesheet");if(s&&"children"in a&&a.children&&(c=a.children.find(C=>C.type===IC.NodeTypes.LiquidRawTag&&C.name==="stylesheet")),!c)return null;let h=i.positionAt(c.blockStartPosition.end).line,p=Array(h).fill(`
556
556
  `).join("")+c.source.slice(c.blockStartPosition.end,c.blockEndPosition.start).replace(/\n$/,""),f=XN.TextDocument.create(i.uri,"json",i.version,p),b=t.parseStylesheet(f);return[f,b]}}}};Qd.CSSLanguageService=hb});var OC=w(Zd=>{"use strict";d();Object.defineProperty(Zd,"__esModule",{value:!0});Zd.SchemaTranslationStringDefinitionProvider=void 0;var zC=ee(),Yd=V(),ub=he(),pb=class{documentManager;getDefaultSchemaLocaleSourceCode;constructor(e,t){this.documentManager=e,this.getDefaultSchemaLocaleSourceCode=t}async definitions(e,t,r){let i=this.documentManager.get(e.textDocument.uri);if(!i||i.type!==Yd.SourceCodeType.LiquidHtml)return[];if(t.type!==zC.NodeTypes.TextNode)return[];if(!r.find(QN))return[];let s=await i.getSchema();if(!s||s.ast instanceof Error)return[];let a=await this.getDefaultSchemaLocaleSourceCode(e.textDocument.uri);if(!a||a.type!==Yd.SourceCodeType.JSON||a.ast instanceof Error)return[];let c=i.textDocument.offsetAt(e.position)-s.offset,[h,p]=(0,Yd.findJSONNode)(s.ast,c);if(h.type!=="Literal")return[];if(typeof h.value!="string"||!h.value.startsWith("t:"))return[];let f=h.value.slice(2).trim(),b=(0,Yd.nodeAtPath)(a.ast,f.split("."));if(!b)return[];let C=ub.Range.create(a.textDocument.positionAt(b.loc.start.offset),a.textDocument.positionAt(b.loc.end.offset)),D=ub.Range.create(i.textDocument.positionAt(s.offset+h.loc.start.offset),i.textDocument.positionAt(s.offset+h.loc.end.offset));return[ub.LocationLink.create(a.textDocument.uri,C,C,D)]}};Zd.SchemaTranslationStringDefinitionProvider=pb;function QN(n){return n.type===zC.NodeTypes.LiquidRawTag&&n.name==="schema"}});var qC=w(eh=>{"use strict";d();Object.defineProperty(eh,"__esModule",{value:!0});eh.TranslationStringDefinitionProvider=void 0;var AC=ee(),LC=V(),mb=he(),fb=class{documentManager;getDefaultLocaleSourceCode;constructor(e,t){this.documentManager=e,this.getDefaultLocaleSourceCode=t}async definitions(e,t,r){let i=this.documentManager.get(e.textDocument.uri)?.textDocument;if(!i)return[];if(t.type!==AC.NodeTypes.String)return[];let o=r.at(-1);if(!o||o.type!==AC.NodeTypes.LiquidVariable)return[];if(o.expression!==t)return[];if(o.filters.length===0||!["t","translate"].includes(o.filters[0].name))return[];let s=await this.getDefaultLocaleSourceCode(e.textDocument.uri);if(!s||s.type!==LC.SourceCodeType.JSON||s.ast instanceof Error)return[];let a=t.value,l=(0,LC.nodeAtPath)(s.ast,a.split("."));if(!l)return[];let c=mb.Range.create(s.textDocument.positionAt(l.loc.start.offset),s.textDocument.positionAt(l.loc.end.offset)),h=mb.Range.create(i.positionAt(t.position.start),i.positionAt(t.position.end));return[mb.LocationLink.create(s.textDocument.uri,c,c,h)]}};eh.TranslationStringDefinitionProvider=fb});var HC=w(th=>{"use strict";d();Object.defineProperty(th,"__esModule",{value:!0});th.DefinitionProvider=void 0;var WC=V(),YN=OC(),ZN=qC(),gb=class{documentManager;providers;constructor(e,t,r){this.documentManager=e,this.providers=[new ZN.TranslationStringDefinitionProvider(e,t),new YN.SchemaTranslationStringDefinitionProvider(e,r)]}async definitions(e){let t=this.documentManager.get(e.textDocument.uri);if(!t||t.type!==WC.SourceCodeType.LiquidHtml||t.ast instanceof Error)return null;let{textDocument:r}=t,[i,o]=(0,WC.findCurrentNode)(t.ast,r.offsetAt(e.position)),s=await Promise.all(this.providers.map(a=>a.definitions(e,i,o))).then(a=>a.flat());return s.length>0?s:null}};th.DefinitionProvider=gb});var bb=w(nh=>{"use strict";d();Object.defineProperty(nh,"__esModule",{value:!0});nh.offenseToDiagnostic=tz;nh.offenseSeverity=iz;var Qr=re(),fr=V(),ez=fr.allChecks.reduce((n,e)=>{let t=e.meta.docs.url,r=e.meta.code;return t!==void 0&&(n[r]=t),n},{});function tz(n){let e=Qr.Diagnostic.create(nz(n),n.message,rz(n),n.check,"theme-check"),t=ez[n.check];return t&&(e.codeDescription={href:t}),e}function nz({start:n,end:e}){return{start:{line:n.line,character:n.character},end:{line:e.line,character:e.character}}}function rz(n){switch(n.severity){case fr.Severity.INFO:return Qr.DiagnosticSeverity.Information;case fr.Severity.WARNING:return Qr.DiagnosticSeverity.Warning;case fr.Severity.ERROR:return Qr.DiagnosticSeverity.Error;default:return(0,fr.assertNever)(n.severity)}}function iz(n){switch(n.severity){case Qr.DiagnosticSeverity.Hint:case Qr.DiagnosticSeverity.Information:return fr.Severity.INFO;case Qr.DiagnosticSeverity.Warning:return fr.Severity.WARNING;case Qr.DiagnosticSeverity.Error:return fr.Severity.ERROR;default:return fr.Severity.INFO}}});var UC=w(rh=>{"use strict";d();Object.defineProperty(rh,"__esModule",{value:!0});rh.DiagnosticsManager=void 0;var oz=bb(),vb=class{connection;diagnostics=new Map;constructor(e){this.connection=e}get(e){return this.diagnostics.get(e)}set(e,t,r){let i=r.map((o,s)=>({offense:o,diagnostic:(0,oz.offenseToDiagnostic)(o),id:s}));this.diagnostics.set(e,{uri:e,version:t,anomalies:i}),this.connection.sendDiagnostics({uri:e,version:t,diagnostics:i.map(o=>o.diagnostic)})}clear(e){this.diagnostics.delete(e),this.connection.sendDiagnostics({uri:e,version:void 0,diagnostics:[]})}};rh.DiagnosticsManager=vb});var jC=w(yb=>{"use strict";d();Object.defineProperty(yb,"__esModule",{value:!0});yb.makeRunChecks=az;var xt=V(),sz=bb();function az(n,e,{fs:t,loadConfig:r,themeDocset:i,jsonValidationSet:o,getMetafieldDefinitions:s,cssLanguageService:a,themeGraphManager:l}){return async function(h){let p=(0,xt.makeFileExists)(t),f=await Promise.all(h.map(D=>(0,xt.findRoot)(D,p))),b=new Set(f.filter(D=>!!D));await Promise.all([...b].map(C));return;async function C(D){let P=await r(D,t),A=n.theme(P.rootUri),S=a?await Promise.all(A.map(N=>lz(a,N))).then(N=>N.flat()):[],R=[...await(0,xt.check)(A,P,{fs:t,themeDocset:i,jsonValidationSet:o,getMetafieldDefinitions:s,async getReferences(N){return l?l.getReferences(N):[]},async getDependencies(N){return l?l.getDependencies(N):[]},getCSSClassesForURI(N){let q=n.get(N);return q?.type===xt.SourceCodeType.LiquidHtml?q.getCSSClasses():N.endsWith(".css")?(0,xt.extractCSSClassesFromAssetUri)(N,t):(0,xt.extractCSSClassesFromLiquidUri)(N,t)},async getBlockSchema(N){let q=xt.path.join(P.rootUri,"blocks",`${N}.liquid`),Se=n.get(q);return Se?.type!==xt.SourceCodeType.LiquidHtml?void 0:await Se.getSchema()},async getSectionSchema(N){let q=xt.path.join(P.rootUri,"sections",`${N}.liquid`),Se=n.get(q);return Se?.type!==xt.SourceCodeType.LiquidHtml?void 0:await Se.getSchema()},async getDocDefinition(N){let q=xt.path.join(P.rootUri,N),Se=n.get(q);if(Se?.type===xt.SourceCodeType.LiquidHtml)return Se.getLiquidDoc()}}),...S];for(let N of A){let q=R.filter(Se=>Se.uri===N.uri);e.set(N.uri,N.version,q)}}}}async function lz(n,e){return e.type!==xt.SourceCodeType.LiquidHtml?[]:(await n.diagnostics({textDocument:{uri:e.uri}})).map(r=>({check:"css",message:r.message,end:{index:e.textDocument.offsetAt(r.range.end),line:r.range.end.line,character:r.range.end.character},start:{index:e.textDocument.offsetAt(r.range.start),line:r.range.start.line,character:r.range.start.character},severity:(0,sz.offenseSeverity)(r),uri:e.uri,type:xt.SourceCodeType.LiquidHtml})).filter(r=>r.severity!==xt.Severity.INFO)}});var $C=w(Ho=>{"use strict";d();Object.defineProperty(Ho,"__esModule",{value:!0});Ho.makeRunChecks=Ho.DiagnosticsManager=void 0;var cz=UC();Object.defineProperty(Ho,"DiagnosticsManager",{enumerable:!0,get:function(){return cz.DiagnosticsManager}});var dz=jC();Object.defineProperty(Ho,"makeRunChecks",{enumerable:!0,get:function(){return dz.makeRunChecks}})});var oh=w(ih=>{"use strict";d();Object.defineProperty(ih,"__esModule",{value:!0});ih.getHtmlElementNameRanges=hz;ih.isDanglingOpenHtmlElement=GC;var wb=ee(),BC=re(),VC=$p();function hz(n,e,t,r){let i=null,o=e.at(-1);if(o&&o.type===wb.NodeTypes.HtmlElement&&o.name.length>0&&(0,VC.isCovered)(r.offsetAt(t.position),{start:o.name[0].position.start,end:o.name.at(-1).position.end})&&(i=o),n.type===wb.NodeTypes.HtmlElement&&n.name.length>0&&(0,VC.isCovered)(r.offsetAt(t.position),n.blockEndPosition)&&(i=n),!i||GC(i))return null;let s=i.name,a=s.at(0),l=s.at(-1),c=BC.Range.create(r.positionAt(a.position.start),r.positionAt(l.position.end)),h=BC.Range.create(r.positionAt(i.blockEndPosition.start+2),r.positionAt(i.blockEndPosition.end-1));return[c,h]}function GC(n){return n.type===wb.NodeTypes.HtmlElement&&n.blockEndPosition.start===n.blockEndPosition.end}});var KC=w(sh=>{"use strict";d();Object.defineProperty(sh,"__esModule",{value:!0});sh.HtmlTagNameDocumentHighlightsProvider=void 0;var uz=oh(),Sb=class{documentManager;constructor(e){this.documentManager=e}async documentHighlights(e,t,r){let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i)return null;let o=(0,uz.getHtmlElementNameRanges)(e,t,r,i);return o?o.map(s=>({range:s})):null}};sh.HtmlTagNameDocumentHighlightsProvider=Sb});var XC=w(lh=>{"use strict";d();Object.defineProperty(lh,"__esModule",{value:!0});lh.LiquidBlockTagDocumentHighlightsProvider=void 0;var ah=ee(),xb=re(),kb=class{documentManager;constructor(e){this.documentManager=e}async documentHighlights(e,t,r){let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i||(JC(e)&&(e=t.at(-1)),!pz(e)||!e.blockEndPosition))return null;let o=e.source.indexOf(e.name,e.blockStartPosition.start),s=e.source.indexOf("end"+e.name,e.blockEndPosition.start),a=[xb.Range.create(i.positionAt(o),i.positionAt(o+e.name.length)),xb.Range.create(i.positionAt(s),i.positionAt(s+3+e.name.length))];if(mz(e)&&e.children&&e.children.every(JC))for(let l of e.children.filter(c=>c.name!==null)){let c=e.source.indexOf(l.name,l.blockStartPosition.start);a.push(xb.Range.create(i.positionAt(c),i.positionAt(c+l.name.length)))}return a.map(l=>({range:l}))}};lh.LiquidBlockTagDocumentHighlightsProvider=kb;function JC(n){return n.type===ah.NodeTypes.LiquidBranch}function pz(n){return n.type===ah.NodeTypes.LiquidTag||n.type===ah.NodeTypes.LiquidRawTag}function mz(n){return n.type===ah.NodeTypes.LiquidTag}});var QC=w(Uo=>{"use strict";d();Object.defineProperty(Uo,"__esModule",{value:!0});Uo.LiquidBlockTagDocumentHighlightsProvider=Uo.HtmlTagNameDocumentHighlightsProvider=void 0;var fz=KC();Object.defineProperty(Uo,"HtmlTagNameDocumentHighlightsProvider",{enumerable:!0,get:function(){return fz.HtmlTagNameDocumentHighlightsProvider}});var gz=XC();Object.defineProperty(Uo,"LiquidBlockTagDocumentHighlightsProvider",{enumerable:!0,get:function(){return gz.LiquidBlockTagDocumentHighlightsProvider}})});var ZC=w(Yr=>{"use strict";d();Object.defineProperty(Yr,"__esModule",{value:!0});Yr.DocumentHighlightsProvider=Yr.PREVENT_DEFAULT=void 0;var bz=V(),vz=V(),YC=QC();Yr.PREVENT_DEFAULT=[];var Cb=class{documentManager;providers;constructor(e){this.documentManager=e,this.providers=[new YC.HtmlTagNameDocumentHighlightsProvider(e),new YC.LiquidBlockTagDocumentHighlightsProvider(e)]}async documentHighlights(e){let t=this.documentManager.get(e.textDocument.uri);if(!t||t.type!==bz.SourceCodeType.LiquidHtml||t.ast instanceof Error)return Yr.PREVENT_DEFAULT;let[r,i]=(0,vz.findCurrentNode)(t.ast,t.textDocument.offsetAt(e.position)),o=this.providers.map(a=>a.documentHighlights(r,i,e).catch(()=>null));return(await Promise.all(o)).find(Boolean)??Yr.PREVENT_DEFAULT}};Yr.DocumentHighlightsProvider=Cb});var t1=w(dh=>{"use strict";d();Object.defineProperty(dh,"__esModule",{value:!0});dh.DocumentLinksProvider=void 0;var e1=ee(),yz=V(),Sa=re(),xa=Fa(),wz=V(),Tb=class{documentManager;findThemeRootURI;constructor(e,t){this.documentManager=e,this.findThemeRootURI=t}async documentLinks(e){let t=this.documentManager.get(e);if(!t||t.type!==yz.SourceCodeType.LiquidHtml||t.ast instanceof Error)return[];let r=await this.findThemeRootURI(e);if(!r)return[];let i=Sz(t.textDocument,xa.URI.parse(r));return(0,wz.visit)(t.ast,i)}};dh.DocumentLinksProvider=Tb;function Sz(n,e){return{LiquidTag(t){if((t.name==="render"||t.name==="include")&&typeof t.markup!="string"&&_b(t.markup.snippet)){let r=t.markup.snippet;return Sa.DocumentLink.create(ch(n,r),xa.Utils.resolvePath(e,"snippets",r.value+".liquid").toString())}if(t.name==="section"&&typeof t.markup!="string"&&_b(t.markup)){let r=t.markup;return Sa.DocumentLink.create(ch(n,r),xa.Utils.resolvePath(e,"sections",r.value+".liquid").toString())}if(t.name===e1.NamedTags.content_for&&typeof t.markup!="string"){let r=t.markup.args.find(i=>i.name==="type");if(r&&r.value.type==="String")return Sa.DocumentLink.create(ch(n,r.value),xa.Utils.resolvePath(e,"blocks",r.value.value+".liquid").toString())}},LiquidVariable(t){if(t.filters.length===0||t.filters[0].name!=="asset_url"||!_b(t.expression))return;let r=t.expression;return Sa.DocumentLink.create(ch(n,t.expression),xa.Utils.resolvePath(e,"assets",r.value).toString())}}}function ch(n,e){let t=n.positionAt(e.position.start+1),r=n.positionAt(e.position.end-1);return Sa.Range.create(t,r)}function _b(n){return n.type===e1.NodeTypes.String}});var n1=w(hh=>{"use strict";d();Object.defineProperty(hh,"__esModule",{value:!0});hh.DocumentLinksProvider=void 0;var xz=t1();Object.defineProperty(hh,"DocumentLinksProvider",{enumerable:!0,get:function(){return xz.DocumentLinksProvider}})});var r1=w(ka=>{"use strict";d();Object.defineProperty(ka,"__esModule",{value:!0});ka.Progress=void 0;ka.percent=kz;var uh=he(),Rb=class n{connection;progressToken;constructor(e,t){this.connection=e,this.progressToken=t}static create(e,t,r){return!e||!t||!t.hasProgressSupport?{start:async()=>{},report:async()=>{},end:async()=>{}}:new n(e,r)}async start(e){await this.connection.sendRequest(uh.WorkDoneProgressCreateRequest.type,{token:this.progressToken}),await this.connection.sendProgress(uh.WorkDoneProgress.type,this.progressToken,{kind:"begin",title:e})}async report(e,t){await this.connection.sendProgress(uh.WorkDoneProgress.type,this.progressToken,{kind:"report",message:t,percentage:e})}async end(e){await this.connection.sendProgress(uh.WorkDoneProgress.type,this.progressToken,{kind:"end",message:e})}};ka.Progress=Rb;function kz(n,e,t=0){return Math.round(t+n/e*(100-t))}});var o1=w(ph=>{"use strict";d();Object.defineProperty(ph,"__esModule",{value:!0});ph.DocumentManager=void 0;var st=V(),Cz=(is(),Bt(Aa)),i1=r1(),_z=V(),Tz=n=>new Promise(e=>setTimeout(e,n)),Eb=class{fs;connection;clientCapabilities;getModeForUri;isValidSchema;sourceCodes;recentlyRenamed;constructor(e,t,r,i,o){this.fs=e,this.connection=t,this.clientCapabilities=r,this.getModeForUri=i,this.isValidSchema=o,this.sourceCodes=new Map,this.recentlyRenamed=new Set}open(e,t,r){return this.set(e,t,r)}change(e,t,r){return this.set(e,t,r)}async changeFromDisk(e){if(!this.fs)throw new Error("Cannot call changeFromDisk without a FileSystem");this.change(e,await this.fs.readFile(e),void 0)}close(e){let t=this.sourceCodes.get(e);if(t)return this.set(e,t.source,void 0)}delete(e){return this.sourceCodes.delete(e)}rename(e,t){this.trackRename(e,t);let r=this.sourceCodes.get(e);r&&(this.sourceCodes.delete(e),this.set(t,r.source,r.version))}theme(e,t=!1){return[...this.sourceCodes.values()].filter(r=>r.uri.startsWith(e)).filter(r=>t||r.version!==void 0)}get openDocuments(){return[...this.sourceCodes.values()].filter(e=>e.version!==void 0)}get(e){return this.sourceCodes.get(st.path.normalize(e))}has(e){return this.sourceCodes.has(st.path.normalize(e))}hasRecentRename(e){return this.recentlyRenamed.has(e)}clearRecentRename(e){this.recentlyRenamed.delete(e)}set(e,t,r){e=st.path.normalize(e),!(!/\.(json|liquid)$/.test(e)||/\.(s?css|js).liquid$/.test(e))&&this.sourceCodes.set(e,this.augmentedSourceCode(e,t,r))}preload=(0,st.memoize)(async e=>{if(!this.fs)throw new Error("Cannot call preload without a FileSystem");let{fs:t,connection:r,clientCapabilities:i}=this,o=i1.Progress.create(r,i,`preload#${e}`);o.start("Initializing Liquid LSP"),e.endsWith("/")||(e+="/");let s=(await Promise.all(["assets","blocks","config","layout","locales","sections","snippets","templates"].map(c=>(0,st.recursiveReadDirectory)(t,st.path.join(e,c),([h])=>/\.(liquid|json)$/.test(h)&&!this.sourceCodes.has(h)).catch(()=>[])))).flat();o.report(10,"Preloading files");let[a,l]=[0,s.length];await Promise.all(s.map(async c=>{try{this.set(c,await t.readFile(c),void 0)}catch(h){console.error("Failed to preload",c,h)}if(++a%10===0){let h=`Preloading files [${a}/${l}]`;o.report((0,i1.percent)(a,l,10),h)}})),o.end("Completed")},e=>e);augmentedSourceCode(e,t,r){let i=(0,st.toSourceCode)(e,t,r),o=Cz.TextDocument.create(e,i.type,i.version??0,i.source);switch(i.type){case st.SourceCodeType.JSON:return{...i,textDocument:o};case st.SourceCodeType.LiquidHtml:return{...i,textDocument:o,getSchema:(0,st.memo)(async()=>{if(!this.getModeForUri||!this.isValidSchema)return;let s=await this.getModeForUri(e);return(0,st.toSchema)(s,e,i,this.isValidSchema,!1)}),getLiquidDoc:(0,st.memo)(async()=>{let s=i.ast;if(!(0,st.isError)(s))return(0,_z.extractDocDefinition)(e,s)}),getCSSClasses:(0,st.memo)(async()=>{let s=i.ast;return(0,st.isError)(s)?new Set:(0,st.extractCSSClassesFromLiquidAST)(s)})};default:return(0,st.assertNever)(i)}}trackRename(e,t){this.recentlyRenamed.add(e),this.recentlyRenamed.add(t),Tz(2e3).then(()=>{this.clearRecentRename(e),this.clearRecentRename(t)})}};ph.DocumentManager=Eb});var a1=w(jo=>{"use strict";d();Object.defineProperty(jo,"__esModule",{value:!0});jo.isJsonSourceCode=jo.isLiquidSourceCode=void 0;var s1=V(),Rz=n=>n.type===s1.SourceCodeType.LiquidHtml;jo.isLiquidSourceCode=Rz;var Ez=n=>n.type===s1.SourceCodeType.JSON;jo.isJsonSourceCode=Ez});var Ei=w(gr=>{"use strict";d();var Dz=gr&&gr.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Fz=gr&&gr.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Dz(e,n,t)};Object.defineProperty(gr,"__esModule",{value:!0});gr.DocumentManager=void 0;var Pz=o1();Object.defineProperty(gr,"DocumentManager",{enumerable:!0,get:function(){return Pz.DocumentManager}});Fz(a1(),gr)});var l1=w(mh=>{"use strict";d();Object.defineProperty(mh,"__esModule",{value:!0});mh.BracketsAutoclosingOnTypeFormattingProvider=void 0;var Sn=he(),Db=class{onTypeFormatting(e,t){let r=e.textDocument,i=t.ch,{line:o,character:s}=t.position;if(i===" "&&s<=2||s<=1)return null;let a=Sn.Range.create(Sn.Position.create(o,0),Sn.Position.create(o+1,0)),l=r.getText(a),c=i===" "?s-2:s-1;switch(l.at(c)){case"{":case"%":{let p=l.slice(c-1,c+4);if(p==="{{ }}"||p==="{% %}")return[Sn.TextEdit.insert(Sn.Position.create(o,c+1)," ")]}case"-":{if(c<3)return null;let p=l.slice(c-3,c+4);if(p==="{{ - }}"||p==="{% - %}")return[Sn.TextEdit.replace(Sn.Range.create(Sn.Position.create(o,c-1),Sn.Position.create(o,c+1)),"- "),Sn.TextEdit.insert(Sn.Position.create(o,c+2),"-")]}}return null}};mh.BracketsAutoclosingOnTypeFormattingProvider=Db});var h1=w(fh=>{"use strict";d();Object.defineProperty(fh,"__esModule",{value:!0});fh.HtmlElementAutoclosingOnTypeFormattingProvider=void 0;var xn=ee(),$o=he(),d1=V(),c1=n=>setTimeout(n,10),Fb=class{setCursorPosition;constructor(e){this.setCursorPosition=e}onTypeFormatting(e,t){let r=e.textDocument,i=t.ch,{line:o,character:s}=t.position;switch(i){case">":{let a=e.ast;if(a instanceof xn.LiquidHTMLASTParsingError&&a.unclosed&&a.unclosed.type===xn.NodeTypes.HtmlElement&&(a.unclosed.blockStartPosition.end===r.offsetAt(t.position)||Iz(a.unclosed,Mz(r,t.position))))return c1(()=>this.setCursorPosition(r,t.position)),[$o.TextEdit.insert($o.Position.create(o,s),`</${a.unclosed.name}>`)];if(!(a instanceof Error)){let[l]=(0,d1.findCurrentNode)(a,r.offsetAt(t.position));if(Nz(l))return c1(()=>this.setCursorPosition(r,t.position)),[$o.TextEdit.insert($o.Position.create(o,s),`</${(0,xn.getName)(l)}>`)]}}}return null}};fh.HtmlElementAutoclosingOnTypeFormattingProvider=Fb;function Mz(n,e){let t=n.getText($o.Range.create($o.Position.create(0,0),e));try{let r=(0,xn.toLiquidHtmlAST)(t,{allowUnclosedDocumentNode:!0,mode:"tolerant"}),[i,o]=(0,d1.findCurrentNode)(r,n.offsetAt(e));return o.at(-1)?.type===xn.NodeTypes.HtmlElement||i.type===xn.NodeTypes.LiquidBranch?o.at(-1):i}catch{return null}}function Iz(n,e){return e===null||!("blockStartPosition"in e)?!1:[xn.NodeTypes.HtmlElement,xn.NodeTypes.LiquidTag,xn.NodeTypes.HtmlRawNode].includes(n.type)&&(0,xn.getName)(e)===n.name}function Nz(n){return n!==null&&n.type===xn.NodeTypes.HtmlElement&&n.blockEndPosition.start===n.blockEndPosition.end}});var u1=w(gh=>{"use strict";d();Object.defineProperty(gh,"__esModule",{value:!0});gh.OnTypeFormattingProvider=void 0;var zz=l1(),Oz=h1(),Pb=class{documentManager;setCursorPosition;providers;constructor(e,t=async()=>{}){this.documentManager=e,this.setCursorPosition=t,this.providers=[new zz.BracketsAutoclosingOnTypeFormattingProvider,new Oz.HtmlElementAutoclosingOnTypeFormattingProvider(t)]}async onTypeFormatting(e){let t=this.documentManager.get(e.textDocument.uri);return t?this.providers.map(i=>i.onTypeFormatting(t,e)).find(i=>i!==null)??null:null}};gh.OnTypeFormattingProvider=Pb});var p1=w(bh=>{"use strict";d();Object.defineProperty(bh,"__esModule",{value:!0});bh.OnTypeFormattingProvider=void 0;var Az=u1();Object.defineProperty(bh,"OnTypeFormattingProvider",{enumerable:!0,get:function(){return Az.OnTypeFormattingProvider}})});var m1=w(vh=>{"use strict";d();Object.defineProperty(vh,"__esModule",{value:!0});vh.LiquidTagHoverProvider=void 0;var Mb=ee(),Lz=zt(),Ib=class{themeDocset;constructor(e){this.themeDocset=e}async hover(e){if(e.type!==Mb.NodeTypes.LiquidTag&&e.type!==Mb.NodeTypes.LiquidRawTag&&e.type!==Mb.NodeTypes.LiquidBranch)return null;let t=e.name,i=(await this.themeDocset.tags()).find(o=>o.name===t);return i?{contents:{kind:"markdown",value:(0,Lz.render)(i,void 0,"tag")}}:null}};vh.LiquidTagHoverProvider=Ib});var f1=w(yh=>{"use strict";d();Object.defineProperty(yh,"__esModule",{value:!0});yh.LiquidFilterHoverProvider=void 0;var qz=ee(),Wz=zt(),Nb=class{themeDocset;constructor(e){this.themeDocset=e}async hover(e){if(e.type!==qz.NodeTypes.LiquidFilter)return null;let t=e.name,i=(await this.themeDocset.filters()).find(o=>o.name===t);return i?{contents:{kind:"markdown",value:(0,Wz.render)(i,void 0,"filter")}}:null}};yh.LiquidFilterHoverProvider=Nb});var b1=w(wh=>{"use strict";d();Object.defineProperty(wh,"__esModule",{value:!0});wh.LiquidFilterArgumentHoverProvider=void 0;var g1=ee(),Hz=zt(),zb=class{themeDocset;constructor(e){this.themeDocset=e}async hover(e,t){let r=t.at(-1);if(!r||r.type!==g1.NodeTypes.LiquidFilter||e.type!==g1.NodeTypes.NamedArgument)return null;let i=r.name,s=(await this.themeDocset.filters()).find(l=>l.name===i);if(!s)return null;let a=s.parameters?.find(l=>l.name===e.name);return a?{contents:{kind:"markdown",value:(0,Hz.render)(a,void 0,"filter")}}:null}};wh.LiquidFilterArgumentHoverProvider=zb});var w1=w(Sh=>{"use strict";d();Object.defineProperty(Sh,"__esModule",{value:!0});Sh.LiquidObjectHoverProvider=void 0;var Ob=ee(),v1=Or(),y1=zt(),Ab=class{typeSystem;constructor(e){this.typeSystem=e}async hover(e,t,r){if(e.type!==Ob.NodeTypes.VariableLookup&&e.type!==Ob.NodeTypes.AssignMarkup||!e.name)return null;let i=e;i.type===Ob.NodeTypes.VariableLookup&&(i={...e,lookups:[]});let o=await this.typeSystem.inferType(i,t[0],r.textDocument.uri),s=await this.typeSystem.objectMap(r.textDocument.uri,t[0]),a=s[(0,v1.isArrayType)(o)?o.valueType:o];if(o===v1.Unknown)return null;if(!a){let l=s[e.name]??{};return{contents:{kind:"markdown",value:(0,y1.render)({...l,name:e.name},o,"object")}}}return{contents:{kind:"markdown",value:(0,y1.render)({...a,name:e.name},o,"object")}}}};Sh.LiquidObjectHoverProvider=Ab});var k1=w(kh=>{"use strict";d();Object.defineProperty(kh,"__esModule",{value:!0});kh.LiquidObjectAttributeHoverProvider=void 0;var S1=ee(),xh=Or(),x1=zt(),Lb=class{typeSystem;constructor(e){this.typeSystem=e}async hover(e,t,r){let i=t.at(-1),o=r.textDocument.uri;if(e.type!==S1.NodeTypes.String||!i||i.type!==S1.NodeTypes.VariableLookup||!i.lookups.includes(e))return null;let s=i.lookups.findIndex(b=>b===e),a={...i,lookups:i.lookups.slice(0,s)},l=await this.typeSystem.objectMap(o,t[0]),c=await this.typeSystem.inferType(a,t[0],o);if((0,xh.isArrayType)(c)||c==="string"||c===xh.Untyped){let b=await this.typeSystem.inferType({...i,lookups:i.lookups.slice(0,s+1)},t[0],o);if((0,xh.isArrayType)(b)||b===xh.Unknown)return null;let C={...l[b]??{},name:e.value};return{contents:{kind:"markdown",value:(0,x1.render)(C,b)}}}if(!l[c])return null;let f=(l[c]?.properties||[]).find(b=>b.name===e.value);return f?{contents:{kind:"markdown",value:(0,x1.render)(f)}}:null}};kh.LiquidObjectAttributeHoverProvider=Lb});var _1=w(Ch=>{"use strict";d();Object.defineProperty(Ch,"__esModule",{value:!0});Ch.HtmlTagHoverProvider=void 0;var C1=zt(),qb=It(),Wb=class{async hover(e,t){let r,i=t.at(-1);if((0,qb.isNamedHtmlElementNode)(e)&&typeof e.name=="string"?r=e.name:(0,qb.isTextNode)(e)&&i&&(0,qb.isNamedHtmlElementNode)(i)&&typeof i.name!="string"&&i.name.includes(e)&&i.name.length===1&&(r=e.value),!r)return null;let o=C1.HtmlData.tags.find(s=>s.name===r);return o?{contents:{kind:"markdown",value:(0,C1.renderHtmlEntry)(o)}}:null}};Ch.HtmlTagHoverProvider=Wb});var T1=w(_h=>{"use strict";d();Object.defineProperty(_h,"__esModule",{value:!0});_h.HtmlAttributeHoverProvider=void 0;var Hb=zt(),Bo=It(),Ub=class{async hover(e,t){let r=t.at(-1),i=(0,Bo.findLast)(t,Bo.isNamedHtmlElementNode);if(!r||!i||!(0,Bo.isTextNode)(e)||!(0,Bo.isHtmlAttribute)(r)||!r.name.includes(e)||r.name.length>1||!(0,Bo.isNamedHtmlElementNode)(i))return null;let o=e.value,s=(0,Bo.getCompoundName)(i),a=Hb.HtmlData.tags.find(h=>h.name===s),l=a?.attributes||[],c=Hb.HtmlData.globalAttributes.find(h=>h.name===o)??l.find(h=>h.name===o);return c?{contents:{kind:"markdown",value:(0,Hb.renderHtmlEntry)(c,"references"in c?void 0:a)}}:null}};_h.HtmlAttributeHoverProvider=Ub});var $b=w(Rh=>{"use strict";d();Object.defineProperty(Rh,"__esModule",{value:!0});Rh.HtmlAttributeValueHoverProvider=void 0;var Uz=ee(),Th=zt(),br=It(),jb=class{async hover(e,t){let r=(0,br.findLast)(t,br.isHtmlAttribute),i=(0,br.findLast)(t,br.isNamedHtmlElementNode);if(!(0,br.isTextNode)(e)||!r||!i||!(0,br.isHtmlAttribute)(r)||!(0,br.isNamedHtmlElementNode)(i)||r.type===Uz.NodeTypes.AttrEmpty||r.value.length!==1||!r.value.includes(e))return null;let o=e.value,s=(0,br.getCompoundName)(r),a=(0,br.getCompoundName)(i),l=Th.HtmlData.tags.find(b=>b.name===a),c=Th.HtmlData.globalAttributes.find(b=>b.name===s)??l?.attributes.find(b=>b.name===s),h=c?.valueSet,f=Th.HtmlData.valueSets.find(b=>b.name===h)?.values.find(b=>b.name===o);return f?{contents:{kind:"markdown",value:(0,Th.renderHtmlEntry)(f,c?.references?c:l)}}:null}};Rh.HtmlAttributeValueHoverProvider=jb});var D1=w(Eh=>{"use strict";d();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.TranslationHoverProvider=void 0;var R1=ee(),E1=ir(),Bb=class{getTranslationsForUri;documentManager;constructor(e,t){this.getTranslationsForUri=e,this.documentManager=t}async hover(e,t,r){let i=t.at(-1);if(e.type!==R1.NodeTypes.String||!i||i.type!==R1.NodeTypes.LiquidVariable||!i.filters[0]||!["t","translate"].includes(i.filters[0].name))return null;let o=await this.getTranslationsForUri(r.textDocument.uri),s=(0,E1.translationValue)(e.value,o),a=this.documentManager.get(r.textDocument.uri)?.textDocument;return!s||!a?null:{contents:{kind:"markdown",value:(0,E1.renderTranslation)(s)},range:{start:a.positionAt(e.position.start),end:a.positionAt(e.position.end)}}}};Eh.TranslationHoverProvider=Bb});var P1=w(Dh=>{"use strict";d();Object.defineProperty(Dh,"__esModule",{value:!0});Dh.RenderSnippetHoverProvider=void 0;var F1=ee(),jz=tr(),Vb=class{getDocDefinitionForURI;constructor(e){this.getDocDefinitionForURI=e}async hover(e,t,r){let i=t.at(-1);if(e.type!==F1.NodeTypes.String||!i||i.type!==F1.NodeTypes.RenderMarkup)return null;let o=e.value,s=await this.getDocDefinitionForURI(r.textDocument.uri,"snippets",o);return{contents:{kind:"markdown",value:(0,jz.formatLiquidDocContentMarkdown)(o,s)}}}};Dh.RenderSnippetHoverProvider=Vb});var M1=w(Fh=>{"use strict";d();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.RenderSnippetParameterHoverProvider=void 0;var Gb=ee(),$z=tr(),Kb=class{getDocDefinitionForURI;constructor(e){this.getDocDefinitionForURI=e}async hover(e,t,r){let i=t.at(-1);if(e.type!==Gb.NodeTypes.NamedArgument||!i||i.type!==Gb.NodeTypes.RenderMarkup||i.snippet.type!==Gb.NodeTypes.String)return null;let o=await this.getDocDefinitionForURI(r.textDocument.uri,"snippets",i.snippet.value),s=e.name,a=o?.liquidDoc?.parameters?.find(l=>l.name===s);return a?{contents:{kind:"markdown",value:(0,$z.formatLiquidDocParameter)(a,!0)}}:null}};Fh.RenderSnippetParameterHoverProvider=Kb});var I1=w(Ee=>{"use strict";d();Object.defineProperty(Ee,"__esModule",{value:!0});Ee.RenderSnippetParameterHoverProvider=Ee.RenderSnippetHoverProvider=Ee.TranslationHoverProvider=Ee.HtmlAttributeValueHoverProvider=Ee.HtmlAttributeHoverProvider=Ee.HtmlTagHoverProvider=Ee.LiquidObjectAttributeHoverProvider=Ee.LiquidObjectHoverProvider=Ee.LiquidFilterArgumentHoverProvider=Ee.LiquidFilterHoverProvider=Ee.LiquidTagHoverProvider=void 0;var Bz=m1();Object.defineProperty(Ee,"LiquidTagHoverProvider",{enumerable:!0,get:function(){return Bz.LiquidTagHoverProvider}});var Vz=f1();Object.defineProperty(Ee,"LiquidFilterHoverProvider",{enumerable:!0,get:function(){return Vz.LiquidFilterHoverProvider}});var Gz=b1();Object.defineProperty(Ee,"LiquidFilterArgumentHoverProvider",{enumerable:!0,get:function(){return Gz.LiquidFilterArgumentHoverProvider}});var Kz=w1();Object.defineProperty(Ee,"LiquidObjectHoverProvider",{enumerable:!0,get:function(){return Kz.LiquidObjectHoverProvider}});var Jz=k1();Object.defineProperty(Ee,"LiquidObjectAttributeHoverProvider",{enumerable:!0,get:function(){return Jz.LiquidObjectAttributeHoverProvider}});var Xz=_1();Object.defineProperty(Ee,"HtmlTagHoverProvider",{enumerable:!0,get:function(){return Xz.HtmlTagHoverProvider}});var Qz=T1();Object.defineProperty(Ee,"HtmlAttributeHoverProvider",{enumerable:!0,get:function(){return Qz.HtmlAttributeHoverProvider}});var Yz=$b();Object.defineProperty(Ee,"HtmlAttributeValueHoverProvider",{enumerable:!0,get:function(){return Yz.HtmlAttributeValueHoverProvider}});var Zz=D1();Object.defineProperty(Ee,"TranslationHoverProvider",{enumerable:!0,get:function(){return Zz.TranslationHoverProvider}});var eO=P1();Object.defineProperty(Ee,"RenderSnippetHoverProvider",{enumerable:!0,get:function(){return eO.RenderSnippetHoverProvider}});var tO=M1();Object.defineProperty(Ee,"RenderSnippetParameterHoverProvider",{enumerable:!0,get:function(){return tO.RenderSnippetParameterHoverProvider}})});var z1=w(Ph=>{"use strict";d();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.LiquidDocTagHoverProvider=void 0;var Jb=ee(),nO=re(),N1=tr(),Xb=class{documentManager;constructor(e){this.documentManager=e}async hover(e,t,r){let i=t.at(-1);if(e.type!==Jb.NodeTypes.LiquidDocParamNode&&e.type!==Jb.NodeTypes.LiquidDocDescriptionNode&&e.type!==Jb.NodeTypes.LiquidDocExampleNode)return null;let o=this.documentManager.get(r.textDocument.uri)?.textDocument;if(o&&o.offsetAt(r.position)>e.position.start+e.name.length)return null;let s=N1.SUPPORTED_LIQUID_DOC_TAG_HANDLES[e.name];return s?{contents:{kind:nO.MarkupKind.Markdown,value:(0,N1.formatLiquidDocTagHandle)(e.name,s.description,s.example)}}:null}};Ph.LiquidDocTagHoverProvider=Xb});var O1=w(Mh=>{"use strict";d();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.ContentForArgumentHoverProvider=void 0;var Qb=ee(),rO=V(),iO=tr(),Yb=class{getDocDefinitionForURI;constructor(e){this.getDocDefinitionForURI=e}async hover(e,t,r){let i=t.at(-1);if(e.type!==Qb.NodeTypes.NamedArgument||!i||i.type!==Qb.NodeTypes.ContentForMarkup||i.contentForType.type!==Qb.NodeTypes.String)return null;let o=(0,rO.getBlockName)(i);if(!o)return null;let a=(await this.getDocDefinitionForURI(r.textDocument.uri,"blocks",o))?.liquidDoc?.parameters?.find(l=>l.name===e.name);return a?{contents:{kind:"markdown",value:(0,iO.formatLiquidDocParameter)(a,!0)}}:null}};Mh.ContentForArgumentHoverProvider=Yb});var A1=w(Ih=>{"use strict";d();Object.defineProperty(Ih,"__esModule",{value:!0});Ih.ContentForTypeHoverProvider=void 0;var Zb=ee(),oO=tr(),ev=class{getDocDefinitionForURI;constructor(e){this.getDocDefinitionForURI=e}async hover(e,t,r){let i=t.at(-1),o=t.at(-2);if(e.type!==Zb.NodeTypes.String||!i||!o||i.type!==Zb.NodeTypes.NamedArgument||i.name!=="type"||o.type!==Zb.NodeTypes.ContentForMarkup)return null;let s=e.value,a=await this.getDocDefinitionForURI(r.textDocument.uri,"blocks",s);return{contents:{kind:"markdown",value:(0,oO.formatLiquidDocContentMarkdown)(s,a)}}}};Ih.ContentForTypeHoverProvider=ev});var L1=w(Nh=>{"use strict";d();Object.defineProperty(Nh,"__esModule",{value:!0});Nh.HoverProvider=void 0;var sO=V(),aO=Or(),Vn=I1(),lO=$b(),cO=V(),dO=z1(),hO=O1(),uO=A1(),tv=class{documentManager;themeDocset;getMetafieldDefinitions;getTranslationsForURI;getSettingsSchemaForURI;getDocDefinitionForURI;getModeForURI;providers=[];constructor(e,t,r,i=async()=>({}),o=async()=>[],s=async()=>{},a=async()=>"theme"){this.documentManager=e,this.themeDocset=t,this.getMetafieldDefinitions=r,this.getTranslationsForURI=i,this.getSettingsSchemaForURI=o,this.getDocDefinitionForURI=s,this.getModeForURI=a;let l=new aO.TypeSystem(t,o,r,a);this.providers=[new hO.ContentForArgumentHoverProvider(s),new uO.ContentForTypeHoverProvider(s),new Vn.LiquidTagHoverProvider(t),new Vn.LiquidFilterArgumentHoverProvider(t),new Vn.LiquidFilterHoverProvider(t),new Vn.LiquidObjectHoverProvider(l),new Vn.LiquidObjectAttributeHoverProvider(l),new Vn.HtmlTagHoverProvider,new Vn.HtmlAttributeHoverProvider,new lO.HtmlAttributeValueHoverProvider,new Vn.TranslationHoverProvider(i,e),new Vn.RenderSnippetHoverProvider(s),new Vn.RenderSnippetParameterHoverProvider(s),new dO.LiquidDocTagHoverProvider(e)]}async hover(e){let t=e.textDocument.uri,r=this.documentManager.get(t);if(r?.type!==sO.SourceCodeType.LiquidHtml||r.ast instanceof Error)return null;let[i,o]=(0,cO.findCurrentNode)(r.ast,r.textDocument.offsetAt(e.position)),s=this.providers.map(l=>l.hover(i,o,e));return(await Promise.all(s)).find(Boolean)??null}};Nh.HoverProvider=tv});var q1=w(zh=>{"use strict";d();Object.defineProperty(zh,"__esModule",{value:!0});zh.HoverProvider=void 0;var pO=L1();Object.defineProperty(zh,"HoverProvider",{enumerable:!0,get:function(){return pO.HoverProvider}})});var Zr=w(Oh=>{"use strict";d();Object.defineProperty(Oh,"__esModule",{value:!0});Oh.isLiquidRequestContext=mO;Oh.isJSONRequestContext=fO;var Ca=V();function mO(n){let{doc:e,schema:t,parsed:r}=n;return e.type===Ca.SourceCodeType.LiquidHtml&&!!t&&!(0,Ca.isError)(e.ast)&&!(0,Ca.isError)(r)}function fO(n){let{doc:e}=n;return e.type===Ca.SourceCodeType.JSON&&!(0,Ca.isError)(e.ast)}});var kn=w(Di=>{"use strict";d();Object.defineProperty(Di,"__esModule",{value:!0});Di.fileMatch=bO;Di.isSectionFile=W1;Di.isBlockFile=H1;Di.isSectionOrBlockFile=vO;Di.findSchemaNode=yO;var gO=V();function bO(n,e){return e.some(t=>t.test(n))}function W1(n){return/\/sections\/[^/]*\.liquid$/.test(n)}function H1(n){return/\/blocks\/[^/]*\.liquid$/.test(n)}function vO(n){return W1(n)||H1(n)}function yO(n){return(0,gO.visit)(n,{LiquidRawTag(t){if(t.name==="schema")return t}})[0]}});var Fi=w(Cn=>{"use strict";d();Object.defineProperty(Cn,"__esModule",{value:!0});Cn.BlockTypeCompletionProvider=void 0;Cn.createBlockNameCompletionItems=U1;Cn.isBlockDefinitionPath=j1;Cn.isPresetBlockPath=kO;Cn.isBlockTypePath=CO;Cn.hasLocalBlockDefinitions=$1;Cn.isLocalBlockDefinition=_O;Cn.isSectionOrBlockSchema=B1;var ei=V(),wO=he(),SO=Zr(),xO=kn(),nv=class{getThemeBlockNames;constructor(e){this.getThemeBlockNames=e}async completeValue(e,t){if(!(0,xO.isSectionOrBlockFile)(e.doc.uri)||!(0,SO.isLiquidRequestContext)(e)||!j1(t))return[];let{doc:r}=e,i=await r.getSchema();if(!i||(0,ei.isError)(i.parsed)||!B1(i))return[];if($1(i))return[];let o=await this.getThemeBlockNames(r.uri,!0);return U1(o)}};Cn.BlockTypeCompletionProvider=nv;function U1(n){return n.map(e=>({kind:wO.CompletionItemKind.Value,label:`"${e}"`,insertText:`"${e}"`}))}function j1(n){return n.at(0)==="blocks"}function kO(n){return n.at(0)==="presets"}function CO(n){let e=n.at(0);if(e!=="blocks"&&e!=="presets"||n.length<4)return!1;let[t,r,i]=n.slice(-3);return t==="blocks"&&i==="type"}function $1(n){if(n.type!==ei.ThemeSchemaType.Section||(0,ei.isError)(n.parsed))return!1;let e=(0,ei.deepGet)(n.parsed,["blocks"]);return!e||!Array.isArray(e)?!1:e.some(t=>t&&t.name!==void 0)}function _O(n,e){if(n.type!==ei.ThemeSchemaType.Section)return!1;let t=[...e.slice(0,-1),"name"];return(0,ei.deepGet)(n.parsed,t)!==void 0}var TO=[ei.ThemeSchemaType.Section,ei.ThemeSchemaType.Block];function B1(n){return TO.includes(n.type)}});var V1=w(Ah=>{"use strict";d();Object.defineProperty(Ah,"__esModule",{value:!0});Ah.ReferencedBlockTypeCompletionProvider=void 0;var iv=V(),RO=Zr(),EO=kn(),rv=Fi(),ov=class{getThemeBlockNames;getThemeBlockSchema;constructor(e,t){this.getThemeBlockNames=e,this.getThemeBlockSchema=t}async completeValue(e,t){if(!(0,EO.isSectionOrBlockFile)(e.doc.uri)||!(0,RO.isLiquidRequestContext)(e)||!DO(t))return[];let{doc:r}=e,i=await r.getSchema();if(!i||(0,iv.isError)(i.parsed)||!(0,rv.isSectionOrBlockSchema)(i))return[];let o=i.parsed;if(FO(t)){let c=PO(i.parsed,t);if(!c)return[];let h=await this.getThemeBlockSchema(r.uri,c);if(!h||(0,iv.isError)(h.parsed)||!(0,rv.isSectionOrBlockSchema)(h))return[];o=h.parsed}let s=o.blocks||[],a={themeBlocks:!1,specificBlockNames:[]};s.forEach(c=>{c.type==="@theme"?a.themeBlocks=!0:c.type.startsWith("@")||a.specificBlockNames.push(c.type)});let l=a.specificBlockNames;return a.themeBlocks&&l.push(...await this.getThemeBlockNames(r.uri,!1)),(0,rv.createBlockNameCompletionItems)(l)}};Ah.ReferencedBlockTypeCompletionProvider=ov;function DO(n){return(n.at(0)==="presets"||n.at(0)==="default")&&n.at(-3)==="blocks"&&n.at(-1)==="type"}function FO(n){return n.at(-5)==="blocks"&&n.at(-3)==="blocks"&&n.at(-1)==="type"}function PO(n,e){return(0,iv.deepGet)(n,[...e.slice(0,-3),"type"])}});var K1=w(Lh=>{"use strict";d();Object.defineProperty(Lh,"__esModule",{value:!0});Lh.SchemaTranslationsCompletionProvider=void 0;var MO=V(),IO=(qa(),Bt(La)),G1=ir(),NO=Zr(),zO=kn(),sv=class{getDefaultSchemaTranslations;constructor(e){this.getDefaultSchemaTranslations=e}async completeValue(e,t){if(!(0,zO.isSectionOrBlockFile)(e.doc.uri)||!(0,NO.isLiquidRequestContext)(e))return[];let{doc:r,parsed:i}=e,o=(0,MO.deepGet)(i,t);if(!o||typeof o!="string"||!o.startsWith("t:"))return[];if(/^t:(.*)/.exec(o)?.[1]===void 0)return[];let a=await this.getDefaultSchemaTranslations(r.uri);return(0,G1.translationOptions)(a).map(c=>{let h=`t:${c.path.join(".")}`;return{label:h,kind:IO.CompletionItemKind.Value,filterText:`"${h}"`,insertText:`"${h}"`,insertTextFormat:1,documentation:{kind:"markdown",value:(0,G1.renderTranslation)(c.translation)}}})}};Lh.SchemaTranslationsCompletionProvider=sv});var Q1=w(qh=>{"use strict";d();Object.defineProperty(qh,"__esModule",{value:!0});qh.SchemaTranslationHoverProvider=void 0;var J1=V(),X1=ir(),OO=Zr(),AO=kn(),av=class{getDefaultSchemaTranslations;constructor(e){this.getDefaultSchemaTranslations=e}canHover(e,t){let r=(0,J1.deepGet)(e.parsed,t);return(0,AO.isSectionOrBlockFile)(e.doc.uri)&&(0,OO.isLiquidRequestContext)(e)&&t.length!==0&&r&&typeof r=="string"&&r.startsWith("t:")}async hover(e,t){if(!this.canHover(e,t))return[];let r=(0,J1.deepGet)(e.parsed,t);return this.getDefaultSchemaTranslations(e.doc.uri).then(i=>{let o=r.slice(2),s=(0,X1.translationValue)(o,i);if(s)return[(0,X1.renderTranslation)(s)]})}};qh.SchemaTranslationHoverProvider=av});var e_=w(_a=>{"use strict";d();Object.defineProperty(_a,"__esModule",{value:!0});_a.TranslationPathHoverProvider=void 0;_a.contextualizedLabel=Wh;var LO=V(),Y1=ir(),qO=Zr(),WO=kn(),lv=class{filePatterns=[/^.*\/locales\/[^\/]*\.json$/];canHover(e,t){return(0,WO.fileMatch)(e.doc.uri,this.filePatterns)&&t.length>0&&(0,qO.isJSONRequestContext)(e)}async hover(e,t){if(!this.canHover(e,t))return[];let{doc:r}=e,i=r.ast,o=(0,LO.nodeAtPath)(i,t);switch(!0){case["zero","one","two","few","many","other"].includes(t.at(-1)):return!o||o.type!=="Literal"||typeof o.value!="string"?["Pluralized translations should have a string value"]:[Wh(r.uri,t.slice(0,-1),o.value)];case t.at(-1).toString().endsWith("_html"):return!o||o.type!=="Literal"||typeof o.value!="string"?["Translations ending in '_html' should have a string value"]:[Wh(r.uri,t,o.value),"The '_html' suffix prevents the HTML content from being escaped."];default:return!o||o.type!=="Literal"||typeof o.value!="string"?[`Translation group: ${t.join(".")}`]:[Wh(r.uri,t,o.value)]}}};_a.TranslationPathHoverProvider=lv;function Wh(n,e,t){if(n.includes(".schema"))return Z1(`"t:${e.join(".")}"`,"json");{let r=(0,Y1.extractParams)(t);return Z1(`{{ '${e.join(".")}' | t${(0,Y1.paramsString)(r)} }}`,"liquid")}}function Z1(n,e="liquid"){return{language:e,value:n}}});var Uh=w(Hh=>{"use strict";d();Object.defineProperty(Hh,"__esModule",{value:!0});Hh.schemaSettingsPropertyCompletionItems=HO;Hh.getSectionBlockByName=UO;var t_=(qa(),Bt(La)),n_=ir();function HO(n,e){return n.filter(t=>t.id).map(t=>{let r="";if(t.label)if(t.label.startsWith("t:")){let o=(0,n_.translationValue)(t.label.substring(2),e);o&&(r=(0,n_.renderTranslation)(o))}else r=t.label;let i=t.id?`"${t.id}"`:"";return{kind:t_.CompletionItemKind.Property,label:i,insertText:i,documentation:{kind:t_.MarkupKind.Markdown,value:r}}})}function UO(n={},e){return n.blocks?.filter(t=>"name"in t)?.find(t=>t.type===e)}});var s_=w(jh=>{"use strict";d();Object.defineProperty(jh,"__esModule",{value:!0});jh.SettingsPropertyCompletionProvider=void 0;var r_=V(),i_=kn(),jO=Fi(),$O=Uh(),cv=class{getDefaultSchemaTranslations;constructor(e){this.getDefaultSchemaTranslations=e}async completeProperty(e,t){let{doc:r}=e;if(r.type!==r_.SourceCodeType.LiquidHtml)return[];if(!((0,i_.isSectionFile)(r.uri)&&(o_(t)||BO(t)))&&!((0,i_.isBlockFile)(r.uri)&&o_(t)))return[];let i=await r.getSchema();if(!i||!(0,jO.isSectionOrBlockSchema)(i)||(0,r_.isError)(i.parsed))return[];let o=i.parsed;if(!o?.settings||!Array.isArray(o.settings))return[];let s=await this.getDefaultSchemaTranslations(r.textDocument.uri);return(0,$O.schemaSettingsPropertyCompletionItems)(o.settings,s)}};jh.SettingsPropertyCompletionProvider=cv;function o_(n){return n.length===3&&n.at(0)==="presets"&&n.at(2)==="settings"}function BO(n){return n.length===2&&n.at(0)==="default"&&n.at(1)==="settings"}});var l_=w($h=>{"use strict";d();Object.defineProperty($h,"__esModule",{value:!0});$h.SettingsHoverProvider=void 0;var VO=V(),a_=ir(),GO=Zr(),KO=kn(),JO=Fi(),dv=class{getDefaultSchemaTranslations;constructor(e){this.getDefaultSchemaTranslations=e}canHover(e,t){return(0,KO.isSectionOrBlockFile)(e.doc.uri)&&(0,GO.isLiquidRequestContext)(e)&&t.length!==0&&(XO(t)||QO(t))}async hover(e,t){if(!this.canHover(e,t))return[];let{doc:r}=e,i=await YO(r,t.at(-1));return i?i.startsWith("t:")?this.getDefaultSchemaTranslations(r.uri).then(o=>{let s=i.substring(2),a=(0,a_.translationValue)(s,o);if(a)return[(0,a_.renderTranslation)(a)]}):[i]:[]}};$h.SettingsHoverProvider=dv;function XO(n){return n.at(0)==="presets"&&n.at(2)==="settings"&&n.at(3)!==void 0&&typeof n.at(3)=="string"}function QO(n){return n.at(0)==="default"&&n.at(1)==="settings"&&n.at(2)!==void 0&&typeof n.at(2)=="string"}async function YO(n,e){let t=await n.getSchema();if(!(!t||!(0,JO.isSectionOrBlockSchema)(t)||(0,VO.isError)(t.parsed)||t.parsed.settings===void 0||!Array.isArray(t.parsed.settings)))return t.parsed.settings.find(r=>r?.id===e)?.label}});var u_=w(Vh=>{"use strict";d();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.BlockSettingsPropertyCompletionProvider=void 0;var c_=kn(),Bh=V(),d_=Fi(),hv=Uh(),uv=class{getDefaultSchemaTranslations;getThemeBlockSchema;constructor(e,t){this.getDefaultSchemaTranslations=e,this.getThemeBlockSchema=t}async completeProperty(e,t){let{doc:r}=e;if(r.type!==Bh.SourceCodeType.LiquidHtml)return[];if(!((0,c_.isSectionFile)(r.uri)&&(h_(t)||ZO(t)))&&!((0,c_.isBlockFile)(r.uri)&&h_(t)))return[];let i=await r.getSchema();if(!i||!(0,d_.isSectionOrBlockSchema)(i)||(0,Bh.isError)(i.parsed))return[];let o=(0,Bh.deepGet)(i.parsed,[...t.slice(0,-1),"type"]);if(!o)return[];let s=await this.getDefaultSchemaTranslations(r.textDocument.uri),a=(0,hv.getSectionBlockByName)(i.parsed,o);if(a){if(a.settings)return(0,hv.schemaSettingsPropertyCompletionItems)(a.settings,s)}else{let l=await this.getThemeBlockSchema(r.uri,o);return!l||(0,Bh.isError)(l.parsed)||!(0,d_.isSectionOrBlockSchema)(l)?[]:!l.parsed?.settings||!Array.isArray(l.parsed?.settings)?[]:(0,hv.schemaSettingsPropertyCompletionItems)(l.parsed.settings,s)}return[]}};Vh.BlockSettingsPropertyCompletionProvider=uv;function h_(n){return n.at(0)==="presets"&&n.at(-3)==="blocks"&&n.at(-1)==="settings"}function ZO(n){return n.at(0)==="default"&&n.at(1)==="blocks"&&n.at(3)==="settings"}});var v_=w(Gh=>{"use strict";d();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.BlockSettingsHoverProvider=void 0;var b_=V(),p_=ir(),eA=Zr(),tA=kn(),nA=Fi(),rA=Uh(),pv=class{getDefaultSchemaTranslations;getThemeBlockSchema;constructor(e,t){this.getDefaultSchemaTranslations=e,this.getThemeBlockSchema=t}canHover(e,t){return(0,tA.isSectionOrBlockFile)(e.doc.uri)&&(0,eA.isLiquidRequestContext)(e)&&t.length!==0&&iA(t)}async hover(e,t){if(!this.canHover(e,t))return[];let{doc:r}=e,i=await r.getSchema();if(!m_(i))return[];let o=(0,b_.deepGet)(i.parsed,[...t.slice(0,-2),"type"]);if(!o)return[];let s=(0,rA.getSectionBlockByName)(i.parsed,o),a;if(s){if(!f_(s.settings))return[];a=g_(s.settings,t.at(-1))}else{let h=await this.getThemeBlockSchema(r.uri,o);if(!m_(h))return[];if(!f_(h.parsed.settings))return[];a=g_(h.parsed.settings,t.at(-1))}if(!a)return[];if(!a.startsWith("t:"))return[a];let l=await this.getDefaultSchemaTranslations(r.uri),c=(0,p_.translationValue)(a.substring(2),l);return c?[(0,p_.renderTranslation)(c)]:[]}};Gh.BlockSettingsHoverProvider=pv;function iA(n){return(n.at(0)==="presets"||n.at(0)==="default")&&n.at(-4)==="blocks"&&n.at(-2)==="settings"&&n.at(-1)!==void 0&&typeof n.at(-1)=="string"}function m_(n){return!!n&&!(0,b_.isError)(n.parsed)&&(0,nA.isSectionOrBlockSchema)(n)}function f_(n){return n!==void 0&&Array.isArray(n)}function g_(n,e){return n.find(t=>t.id===e)?.label}});var w_=w(Kh=>{"use strict";d();Object.defineProperty(Kh,"__esModule",{value:!0});Kh.JSONContributions=void 0;var y_=V(),oA=Fi(),sA=V1(),aA=K1(),lA=Q1(),cA=e_(),dA=kn(),hA=s_(),uA=l_(),pA=u_(),mA=v_(),mv=void 0,fv=class{documentManager;hoverProviders;completionProviders;constructor(e,t,r,i){this.documentManager=e,this.hoverProviders=[new cA.TranslationPathHoverProvider,new lA.SchemaTranslationHoverProvider(t),new uA.SettingsHoverProvider(t),new mA.BlockSettingsHoverProvider(t,i)],this.completionProviders=[new aA.SchemaTranslationsCompletionProvider(t),new oA.BlockTypeCompletionProvider(r),new sA.ReferencedBlockTypeCompletionProvider(r,i),new pA.BlockSettingsPropertyCompletionProvider(t,i),new hA.SettingsPropertyCompletionProvider(t)]}getInfoContribution(e,t){let r=this.documentManager.get(e);if(!r)return mv;let i=this.getContext(r),o=this.hoverProviders.find(s=>s.canHover(i,t));return o?o.hover(i,t):mv}async collectPropertyCompletions(e,t,r,i,o,s){let a=this.documentManager.get(e);if(!a||a.ast instanceof Error)return;let l=await Promise.all(this.completionProviders.filter(c=>c.completeProperty).map(c=>c.completeProperty(this.getContext(a),t)));for(let c of l.flat())s.add(c)}async collectValueCompletions(e,t,r,i){let o=this.documentManager.get(e);if(!o||o.ast instanceof Error)return;let s=await Promise.all(this.completionProviders.filter(a=>a.completeValue).map(a=>a.completeValue(this.getContext(o),t.concat(r))));for(let a of s.flat())i.add(a)}async collectDefaultCompletions(e,t){}getContext(e){let t={doc:e};if(e.type===y_.SourceCodeType.LiquidHtml&&!(e.ast instanceof Error)){let r=(0,dA.findSchemaNode)(e.ast);if(!r)return mv;let i=r?.source.slice(r.blockStartPosition.end,r.blockEndPosition.start);t.schema=r,t.parsed=(0,y_.parseJSON)(i)}return t}};Kh.JSONContributions=fv});var x_=w(gv=>{"use strict";d();Object.defineProperty(gv,"__esModule",{value:!0});gv.createJSONDocumentLinksVisitor=gA;var S_=re(),fA=Fa();function gA(n,e,t=0){return{Property(i,o){let s=vA(o);if(s&&i.key.value==="type"&&i.value.type==="Literal"&&typeof i.value.value=="string"&&!(s==="blocks"&&["@app","@theme"].includes(i.value.value)))return S_.DocumentLink.create(bA(n,i.value,t),fA.Utils.resolvePath(e,s,i.value.value+".liquid").toString())}}}function bA(n,e,t){let r=n.positionAt(t+e.loc.start.offset+1),i=n.positionAt(t+e.loc.end.offset-1);return S_.Range.create(r,i)}function vA(n){for(let e=n.length-1;e>=0;e--){let t=n[e];if(t.type==="Property"){if(t.key.value==="blocks")return"blocks";if(t.key.value==="sections")return"sections"}}}});var __=w(Jh=>{"use strict";d();Object.defineProperty(Jh,"__esModule",{value:!0});Jh.JSONLanguageService=void 0;var yA=ee(),Gn=V(),wA=(qa(),Bt(La)),SA=(is(),Bt(Aa)),xA=w_(),k_=x_(),C_=Fa(),bv=class{documentManager;jsonValidationSet;getDefaultSchemaTranslations;getModeForURI;getThemeBlockNames;getThemeBlockSchema;findThemeRootURI;services;schemas;initialized;initialize=()=>{};constructor(e,t,r,i,o,s,a){this.documentManager=e,this.jsonValidationSet=t,this.getDefaultSchemaTranslations=r,this.getModeForURI=i,this.getThemeBlockNames=o,this.getThemeBlockSchema=s,this.findThemeRootURI=a,this.services=Object.fromEntries(Gn.Modes.map(l=>[l,null])),this.schemas={},this.initialized=new Promise(l=>{this.initialize=l})}async setup(e){let t=Gn.Modes.map(async r=>{let i=await this.jsonValidationSet.schemas(r);for(let s of i)this.schemas[s.uri]=s;if(!i.length)return;let o=(0,wA.getLanguageService)({clientCapabilities:e,schemaRequestService:this.getSchemaForURI.bind(this),workspaceContext:{resolveRelativePath:(s,a)=>new URL(s,a).toString()},contributions:[new xA.JSONContributions(this.documentManager,this.getDefaultSchemaTranslations,this.getThemeBlockNames,this.getThemeBlockSchema)]});o.configure({schemas:i.map(s=>({uri:s.uri,fileMatch:s.fileMatch}))}),this.services[r]=o});await Promise.all(t),this.initialize()}async completions(e){await this.initialized;let t=await this.getModeForURI(e.textDocument.uri),r=this.services[t];if(!r)return null;let i=this.getDocuments(e,r);if(!i)return null;let[o,s]=i;return r.doComplete(o,e.position,s)}async hover(e){await this.initialized;let t=await this.getModeForURI(e.textDocument.uri),r=this.services[t];if(!r)return null;let i=this.getDocuments(e,r);if(!i)return null;let[o,s]=i;return r.doHover(o,e.position,s)}async documentLinks(e){await this.initialized;let t=await this.findThemeRootURI(e.textDocument.uri);if(!t)return[];let r=this.documentManager.get(e.textDocument.uri);if(!r)return[];switch(r.type){case Gn.SourceCodeType.JSON:{if(r.ast instanceof Error)return[];let i=(0,k_.createJSONDocumentLinksVisitor)(r.textDocument,C_.URI.parse(t));return(0,Gn.visit)(r.ast,i)}case Gn.SourceCodeType.LiquidHtml:{if(r.ast instanceof Error)return[];let i=r.textDocument,o=[],s=await r.getSchema();if(s&&!(s.ast instanceof Error)){let a=(0,k_.createJSONDocumentLinksVisitor)(i,C_.URI.parse(t),s.offset),l=(0,Gn.visit)(s.ast,a);o.push(...l)}return o}default:return[]}}isValidSchema=async(e,t)=>{await this.initialized;let r=await this.getModeForURI(e),i=this.services[r];return i?(0,Gn.isValid)(i,e,t):!1};getDocuments(e,t){let r=this.documentManager.get(e.textDocument.uri);if(!r)return null;switch(r.type){case Gn.SourceCodeType.JSON:{let i=r.textDocument,o=t.parseJSONDocument(i);return[i,o]}case Gn.SourceCodeType.LiquidHtml:{if(r.ast instanceof Error)return null;let i=r.textDocument,o=i.offsetAt(e.position),[s,a]=(0,Gn.findCurrentNode)(r.ast,o),l=a.find(b=>b.type===yA.NodeTypes.LiquidRawTag&&b.name==="schema");if(!l)return null;let c=i.positionAt(l.blockStartPosition.end).line,h=Array(c).fill(`
557
- `).join("")+l.source.slice(l.blockStartPosition.end,l.blockEndPosition.start),p=SA.TextDocument.create(i.uri,"json",i.version,h),f=t.parseJSONDocument(p);return[p,f]}}}async getSchemaForURI(e){let t=this.schemas[e]?.schema;return t||`Could not get schema for '${e}'`}};Jh.JSONLanguageService=bv});var vv=w(Xh=>{"use strict";d();Object.defineProperty(Xh,"__esModule",{value:!0});Xh.htmlElementNameWordPattern=void 0;var kA="[a-zA-Z]",CA="[a-zA-Z0-9-]";Xh.htmlElementNameWordPattern=`${kA}${CA}*`});var T_=w(Qh=>{"use strict";d();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.EmptyHtmlTagLinkedRangesProvider=void 0;var Ta=re(),_A=vv(),yv=class{documentManager;constructor(e){this.documentManager=e}async linkedEditingRanges(e,t,{textDocument:{uri:r},position:i}){if(e!==null||t!==null)return null;let o=this.documentManager.get(r),s=o?.textDocument;if(!o||!s)return null;let a=Ta.Range.create(Ta.Position.create(i.line,i.character-1),Ta.Position.create(i.line,i.character+1));if(!["<>","< "].includes(s.getText(a)))return null;let l=o.source.indexOf("</>",s.offsetAt(i));if(l===-1)return null;let c=l+2,h=s.positionAt(c);return{ranges:[Ta.Range.create(i,i),Ta.Range.create(h,h)],wordPattern:_A.htmlElementNameWordPattern}}};Qh.EmptyHtmlTagLinkedRangesProvider=yv});var R_=w(Yh=>{"use strict";d();Object.defineProperty(Yh,"__esModule",{value:!0});Yh.HtmlTagNameLinkedRangesProvider=void 0;var TA=oh(),RA=vv(),wv=class{documentManager;constructor(e){this.documentManager=e}async linkedEditingRanges(e,t,r){if(!e||!t)return null;let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i)return null;let o=(0,TA.getHtmlElementNameRanges)(e,t,r,i);return o?{ranges:o,wordPattern:RA.htmlElementNameWordPattern}:null}};Yh.HtmlTagNameLinkedRangesProvider=wv});var E_=w(Vo=>{"use strict";d();Object.defineProperty(Vo,"__esModule",{value:!0});Vo.HtmlTagNameLinkedRangesProvider=Vo.EmptyHtmlTagLinkedRangesProvider=void 0;var EA=T_();Object.defineProperty(Vo,"EmptyHtmlTagLinkedRangesProvider",{enumerable:!0,get:function(){return EA.EmptyHtmlTagLinkedRangesProvider}});var DA=R_();Object.defineProperty(Vo,"HtmlTagNameLinkedRangesProvider",{enumerable:!0,get:function(){return DA.HtmlTagNameLinkedRangesProvider}})});var F_=w(Zh=>{"use strict";d();Object.defineProperty(Zh,"__esModule",{value:!0});Zh.LinkedEditingRangesProvider=void 0;var FA=V(),PA=V(),D_=E_(),Sv=class{documentManager;providers;constructor(e){this.documentManager=e,this.providers=[new D_.HtmlTagNameLinkedRangesProvider(e),new D_.EmptyHtmlTagLinkedRangesProvider(e)]}async linkedEditingRanges(e){let t=this.documentManager.get(e.textDocument.uri);if(!t||t.type!==FA.SourceCodeType.LiquidHtml)return null;let r=null,i=null;t.ast instanceof Error||([r,i]=(0,PA.findCurrentNode)(t.ast,t.textDocument.offsetAt(e.position)));let o=this.providers.map(a=>a.linkedEditingRanges(r,i,e).catch(()=>null));return(await Promise.all(o)).find(Boolean)??null}};Zh.LinkedEditingRangesProvider=Sv});var I_=w(eu=>{"use strict";d();Object.defineProperty(eu,"__esModule",{value:!0});eu.HtmlTagNameRenameProvider=void 0;var M_=he(),P_=oh(),xv=class{documentManager;constructor(e){this.documentManager=e}async prepare(e,t,r){let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i||!e||!t)return null;let o=(0,P_.getHtmlElementNameRanges)(e,t,r,i);return!o||!o[0]?null:{range:o[0],placeholder:i.getText(o[0])}}async rename(e,t,r){let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i||!e||!t)return null;let o=(0,P_.getHtmlElementNameRanges)(e,t,r,i);return o?{documentChanges:[M_.TextDocumentEdit.create({uri:i.uri,version:i.version},MA(o,r.newName))]}:null}};eu.HtmlTagNameRenameProvider=xv;function MA(n,e){return n.map(t=>M_.TextEdit.replace(t,e))}});var Pi=w(we=>{"use strict";d();Object.defineProperty(we,"__esModule",{value:!0});we.isTemplate=we.templateName=we.isSectionGroup=we.sectionGroupName=we.isSection=we.sectionName=we.isBlock=we.blockName=we.isAsset=we.assetName=we.isSnippet=we.snippetName=void 0;var Go=V(),IA=n=>Go.path.basename(n,".liquid");we.snippetName=IA;var NA=n=>/\bsnippets(\\|\/)[^\\\/]*\.liquid/.test(n);we.isSnippet=NA;var zA=n=>Go.path.basename(n,".liquid");we.assetName=zA;var OA=n=>/\bassets(\\|\/)[^\\\/]/.test(n);we.isAsset=OA;var AA=n=>Go.path.basename(n,".liquid");we.blockName=AA;var LA=n=>/\bblocks(\\|\/)[^\\\/]/.test(n);we.isBlock=LA;var qA=n=>Go.path.basename(n,".liquid");we.sectionName=qA;var WA=n=>/\bsections(\\|\/)[^\\\/]/.test(n)&&/.liquid$/.test(n);we.isSection=WA;var HA=n=>Go.path.basename(n,".json");we.sectionGroupName=HA;var UA=n=>/\bsections(\\|\/)[^\\\/]/.test(n)&&/.json$/.test(n);we.isSectionGroup=UA;var jA=n=>Go.path.basename(n,".json");we.templateName=jA;var $A=n=>/\btemplates(\\|\/)[^\\\/]/.test(n);we.isTemplate=$A});var A_=w(nu=>{"use strict";d();Object.defineProperty(nu,"__esModule",{value:!0});nu.LiquidVariableRenameProvider=void 0;var Ge=ee(),z_=V(),tu=re(),kv=he(),BA=Ei(),VA=Pi(),Cv=class{connection;clientCapabilities;documentManager;findThemeRootURI;constructor(e,t,r,i){this.connection=e,this.clientCapabilities=t,this.documentManager=r,this.findThemeRootURI=i}async prepare(e,t,r){let o=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!o||!e||!t||!N_(e,t))return null;let s=e.type===Ge.NodeTypes.LiquidDocParamNode?e.paramName:e,a=_v(e),l=o.offsetAt(r.position),c=s.position.start+a.length;return l<s.position.start||l>c?null:{range:tu.Range.create(o.positionAt(s.position.start),o.positionAt(c)),placeholder:a}}async rename(e,t,r){let i=this.documentManager.get(r.textDocument.uri),o=await this.findThemeRootURI(r.textDocument.uri),s=i?.textDocument;if(!o||!s||!e||!t||i.ast instanceof Error||!N_(e,t))return null;if(e.type===Ge.NodeTypes.LiquidDocParamNode){let b=s.offsetAt(r.position),C=e.paramName.position.start+e.paramName.value.length;if(b<e.paramName.position.start||b>C)return null}let a=_v(e),l=O_(a,t),c=JA(a,s,l),h=!1,p=(0,z_.visit)(i.ast,{VariableLookup:c,AssignMarkup:c,ForMarkup:c,TextNode:(b,C)=>{let D=C.at(-1);if(!(D?.type!==Ge.NodeTypes.LiquidDocParamNode||D?.paramName!==b))return h=!0,c(b,C)}});if(this.clientCapabilities.hasApplyEditSupport&&h){let C=this.documentManager.theme(o,!0).filter(BA.isLiquidSourceCode),D=(0,VA.snippetName)(r.textDocument.uri);XA(this.connection,C,D,a,r.newName)}return{documentChanges:[kv.TextDocumentEdit.create({uri:s.uri,version:s.version},p.map(b=>kv.TextEdit.replace(b,r.newName)))]}}};nu.LiquidVariableRenameProvider=Cv;function N_(n,e){return n.type===Ge.NodeTypes.AssignMarkup||n.type===Ge.NodeTypes.VariableLookup||n.type===Ge.NodeTypes.ForMarkup||GA(n,e)||KA(n)}function GA(n,e){let t=e.at(-1);return!!t&&t.type===Ge.NodeTypes.LiquidDocParamNode&&t.paramName===n&&n.type===Ge.NodeTypes.TextNode}function KA(n){return n.type===Ge.NodeTypes.LiquidDocParamNode&&n.paramName?.type===Ge.NodeTypes.TextNode}function _v(n){switch(n.type){case Ge.NodeTypes.VariableLookup:case Ge.NodeTypes.AssignMarkup:return n.name??"";case Ge.NodeTypes.ForMarkup:return n.variableName??"";case Ge.NodeTypes.TextNode:return n.value;case Ge.NodeTypes.LiquidDocParamNode:return n.paramName.value;default:return""}}function O_(n,e){let t;for(let r=e.length-1;r>=0;r--){let i=e[r];if(i.type===Ge.NodeTypes.LiquidTag&&(i.name===Ge.NamedTags.tablerow||i.name===Ge.NamedTags.for)&&typeof i.markup!="string"&&i.markup.variableName===n){t=i;break}}if(!(!t||!t.blockEndPosition))return{start:t.blockStartPosition.start,end:t.blockEndPosition.end}}function JA(n,e,t){return(r,i)=>{if(_v(r)!==n)return;let o=O_(n,i);if(!(o?.start!==t?.start||o?.end!==t?.end))return tu.Range.create(e.positionAt(r.position.start),e.positionAt(r.position.start+n.length))}}async function XA(n,e,t,r,i){let o=`Rename snippet parameter '${r}' to '${i}'`,s="renameSnippetParameter",a={documentChanges:[],changeAnnotations:{[s]:{label:o,needsConfirmation:!1}}};for(let l of e){if(l.ast instanceof Error)continue;let c=l.textDocument,h=(0,z_.visit)(l.ast,{RenderMarkup(p){if(p.snippet.type!==Ge.NodeTypes.String||p.snippet.value!==t)return;let f=p.args.find(b=>b.name===r);if(f)return{newText:`${i}: `,range:tu.Range.create(c.positionAt(f.position.start),c.positionAt(f.value.position.start))};if(p.alias?.value===r&&p.variable){let C=/as\s+([^\s,]+)/g.exec(p.source.slice(p.position.start,p.position.end));return C?{newText:`as ${i}`,range:tu.Range.create(c.positionAt(p.position.start+C.index),c.positionAt(p.position.start+C.index+C[0].length))}:void 0}}});h.length!==0&&a.documentChanges.push({textDocument:{uri:c.uri,version:l.version??null},annotationId:s,edits:h})}if(a.documentChanges.length===0){console.error("Nothing to do!");return}await n.sendRequest(kv.ApplyWorkspaceEditRequest.type,{label:o,edit:a})}});var L_=w(ru=>{"use strict";d();Object.defineProperty(ru,"__esModule",{value:!0});ru.RenameProvider=void 0;var QA=V(),YA=V(),ZA=I_(),eL=A_(),Tv=class{documentManager;providers;constructor(e,t,r,i){this.documentManager=r,this.providers=[new ZA.HtmlTagNameRenameProvider(r),new eL.LiquidVariableRenameProvider(e,t,r,i)]}async prepare(e){let[t,r]=this.nodes(e);if(t===null||r===null)return null;let i=this.providers.map(s=>s.prepare(t,r,e).catch(()=>null));return(await Promise.all(i)).find(Boolean)??null}async rename(e){let[t,r]=this.nodes(e);if(t===null||r===null)return null;let i=this.providers.map(s=>s.rename(t,r,e).catch(()=>null));return(await Promise.all(i)).find(Boolean)??null}nodes(e){let t=this.documentManager.get(e.textDocument.uri);return!t||t.type!==QA.SourceCodeType.LiquidHtml?[null,null]:t.ast instanceof Error?[null,null]:(0,YA.findCurrentNode)(t.ast,t.textDocument.offsetAt(e.position))}};ru.RenameProvider=Tv});var H_=w(ou=>{"use strict";d();Object.defineProperty(ou,"__esModule",{value:!0});ou.AssetRenameHandler=void 0;var tL=ee(),q_=V(),W_=he(),nL=Ei(),iu=Pi(),Rv=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(f=>(0,iu.isAsset)(f.oldUri)&&(0,iu.isAsset)(f.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(q_.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let s=this.documentManager.theme(i,!0).filter(nL.isLiquidSourceCode),a=(0,iu.assetName)(r.oldUri),l=(0,iu.assetName)(r.newUri),c=`Rename asset '${a}' to '${l}'`,h="renameAsset",p={documentChanges:[],changeAnnotations:{[h]:{label:c,needsConfirmation:!1}}};for(let f of s){if(f.ast instanceof Error)continue;let b=f.textDocument,C=(0,q_.visit)(f.ast,{LiquidVariable(D){if(!(D.filters.length===0||D.expression.type!==tL.NodeTypes.String||D.filters[0].name!=="asset_url"||D.expression.value!==a))return{newText:l,range:W_.Range.create(b.positionAt(D.expression.position.start+1),b.positionAt(D.expression.position.end-1))}}});C.length!==0&&p.documentChanges.push({textDocument:{uri:b.uri,version:f.version??null},annotationId:h,edits:C})}if(p.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(W_.ApplyWorkspaceEditRequest.type,{label:c,edit:p})}};ou.AssetRenameHandler=Rv});var Ev=w(su=>{"use strict";d();Object.defineProperty(su,"__esModule",{value:!0});su.isValidTemplate=rL;su.isValidSectionGroup=iL;function rL(n){return typeof n=="object"&&n!==null&&"sections"in n&&"order"in n&&Array.isArray(n.order)}function iL(n){return typeof n=="object"&&n!==null&&"sections"in n&&"order"in n&&Array.isArray(n.order)}});var $_=w(lu=>{"use strict";d();Object.defineProperty(lu,"__esModule",{value:!0});lu.BlockRenameHandler=void 0;var oL=ee(),Xe=V(),Ko=he(),Dv=Ei(),ti=Pi(),U_=Ev(),Jo="renameBlock",Fv=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(y=>(0,ti.isBlock)(y.oldUri)&&(0,ti.isBlock)(y.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(Xe.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let o=this.documentManager.theme(i,!0),s=o.filter(Dv.isLiquidSourceCode),a=s.filter(y=>(0,ti.isBlock)(y.uri)||(0,ti.isSection)(y.uri)),l=o.filter(Dv.isJsonSourceCode).filter(y=>(0,ti.isTemplate)(y.uri)),c=o.filter(Dv.isJsonSourceCode).filter(y=>(0,ti.isSectionGroup)(y.uri)),h=(0,ti.blockName)(r.oldUri),p=(0,ti.blockName)(r.newUri),f=`Rename block '${h}' to '${p}'`,b={documentChanges:[],changeAnnotations:{[Jo]:{label:f,needsConfirmation:!1}}},C=new Set,D=await Promise.all(a.map(this.getSchemaChanges(C,h,p))),[P,A,S]=await Promise.all([Promise.all(l.map(this.getTemplateChanges(h,p,C))),Promise.all(c.map(this.getSectionGroupChanges(h,p,C))),Promise.all(s.map(this.getContentForChanges(h,p)))]);for(let y of[...D,...P,...A])y!==null&&b.documentChanges.push(y);for(let y of S)if(y!==null){let R=b.documentChanges.find(N=>N.textDocument.uri===y?.textDocument.uri);R?R.edits.push(...y.edits):b.documentChanges.push(y)}if(b.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(Ko.ApplyWorkspaceEditRequest.type,{label:f,edit:b})}getSchemaChanges(e,t,r){return async i=>{if(i.ast instanceof Error)return null;let o=i.textDocument,s=await i.getSchema();if(!(0,Xe.isBlockSchema)(s)&&!(0,Xe.isSectionSchema)(s)||(0,Xe.isError)(s.validSchema)||(0,Xe.isError)(s.ast))return null;let{validSchema:a,ast:l,offset:c}=s,h=[];if(a.blocks)for(let f=0;f<a.blocks.length;f++){let b=a.blocks[f];if(sL(b))return(0,Xe.isSectionSchema)(s)&&e.add(s.name),null;if(b.type!==t)continue;let C=(0,Xe.nodeAtPath)(l,["blocks",f,"type"]);h.push({annotationId:Jo,newText:r,range:Ko.Range.create(o.positionAt(c+C.loc.start.offset+1),o.positionAt(c+C.loc.end.offset-1))})}let p=(f,b)=>!f||!("blocks"in f)?[]:Array.isArray(f.blocks)?f.blocks.flatMap((C,D)=>{let P=p(C,[...b,"blocks",D]);if(C.type===t){let A=(0,Xe.nodeAtPath)(l,[...b,"blocks",D,"type"]);P.push({annotationId:Jo,newText:r,range:Ko.Range.create(o.positionAt(c+A.loc.start.offset+1),o.positionAt(c+A.loc.end.offset-1))})}return P}):typeof f.blocks=="object"?Object.entries(f.blocks).flatMap(([C,D])=>{let P=p(D,[...b,"blocks",C]);if(D.type===t){let A=(0,Xe.nodeAtPath)(l,[...b,"blocks",C,"type"]);P.push({annotationId:Jo,newText:r,range:Ko.Range.create(o.positionAt(c+A.loc.start.offset+1),o.positionAt(c+A.loc.end.offset-1))})}return P}):[];return a.presets&&h.push(...a.presets.flatMap((f,b)=>p(f,["presets",b]))),h.length===0?null:au(i,h)}}getTemplateChanges(e,t,r){return async i=>{let{textDocument:o,ast:s,source:a}=i,l=(0,Xe.parseJSON)(a);if(!l||(0,Xe.isError)(l)||(0,Xe.isError)(s))return null;let c=j_(e,t,o,s),h=(0,U_.isValidTemplate)(l)?Object.entries(l.sections).flatMap(([p,f])=>"blocks"in f&&f.blocks&&!r.has(f.type)?c(f.blocks,["sections",p,"blocks"]):[]):[];return h.length===0?null:au(i,h)}}getSectionGroupChanges(e,t,r){return async i=>{let{textDocument:o,ast:s,source:a}=i,l=(0,Xe.parseJSON)(a);if(!l||(0,Xe.isError)(l)||(0,Xe.isError)(s))return null;let c=j_(e,t,o,s),h=(0,U_.isValidSectionGroup)(l)?Object.entries(l.sections).flatMap(([p,f])=>"blocks"in f&&f.blocks&&!r.has(f.type)?c(f.blocks,["sections",p,"blocks"]):[]):[];return h.length===0?null:au(i,h)}}getContentForChanges(e,t){return async r=>{let{textDocument:i,ast:o}=r;if((0,Xe.isError)(o))return null;let s=(0,Xe.visit)(o,{LiquidTag(a){if(a.name!=="content_for"||typeof a.markup=="string"||a.markup.contentForType.value!=="block")return;let l=a.markup.args.find(c=>c.name==="type");if(!(!l||l.value.type!==oL.NodeTypes.String||l.value.value!==e))return{annotationId:Jo,newText:t,range:Ko.Range.create(i.positionAt(l.value.position.start+1),i.positionAt(l.value.position.end-1))}}});return s.length===0?null:au(r,s)}}};lu.BlockRenameHandler=Fv;function sL(n){return"name"in n&&typeof n.name=="string"}function j_(n,e,t,r){return function i(o,s){return o?Object.entries(o).flatMap(([a,l])=>{let c=i(l.blocks,[...s,a,"blocks"]);if(l.type===n){let h=(0,Xe.nodeAtPath)(r,[...s,a,"type"]);c.push({annotationId:Jo,newText:e,range:Ko.Range.create(t.positionAt(h.loc.start.offset+1),t.positionAt(h.loc.end.offset-1))})}return c}):[]}}function au(n,e){return{textDocument:{uri:n.uri,version:n.version??null},edits:e}}});var V_=w(hu=>{"use strict";d();Object.defineProperty(hu,"__esModule",{value:!0});hu.SectionRenameHandler=void 0;var _n=V(),cu=he(),Pv=Ei(),Xo=Pi(),B_=Ev(),du="renameSection",Iv=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(P=>(0,Xo.isSection)(P.oldUri)&&(0,Xo.isSection)(P.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(_n.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let o=this.documentManager.theme(i,!0),s=o.filter(Pv.isLiquidSourceCode),a=o.filter(Pv.isJsonSourceCode).filter(P=>(0,Xo.isTemplate)(P.uri)),l=o.filter(Pv.isJsonSourceCode).filter(P=>(0,Xo.isSectionGroup)(P.uri)),c=(0,Xo.sectionName)(r.oldUri),h=(0,Xo.sectionName)(r.newUri),p=`Rename section '${c}' to '${h}'`,f={documentChanges:[],changeAnnotations:{[du]:{label:p,needsConfirmation:!1}}},[b,C,D]=await Promise.all([Promise.all(a.map(this.getTemplateChanges(c,h))),Promise.all(l.map(this.getSectionGroupChanges(c,h))),Promise.all(s.map(this.getSectionTagChanges(c,h)))]);for(let P of[...b,...C])P!==null&&f.documentChanges.push(P);for(let P of D)if(P!==null){let A=f.documentChanges.find(S=>S.textDocument.uri===P?.textDocument.uri);A?A.edits.push(...P.edits):f.documentChanges.push(P)}if(f.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(cu.ApplyWorkspaceEditRequest.type,{label:p,edit:f})}getTemplateChanges(e,t){return async r=>{let{textDocument:i,ast:o,source:s}=r,a=(0,_n.parseJSON)(s);if(!a||(0,_n.isError)(a)||(0,_n.isError)(o))return null;let l=(0,B_.isValidTemplate)(a)?Object.entries(a.sections).filter(([c,h])=>h.type===e).map(([c])=>{let h=(0,_n.nodeAtPath)(o,["sections",c,"type"]);return{annotationId:du,newText:t,range:cu.Range.create(i.positionAt(h.loc.start.offset+1),i.positionAt(h.loc.end.offset-1))}}):[];return l.length===0?null:Mv(r,l)}}getSectionGroupChanges(e,t){return async r=>{let{textDocument:i,ast:o,source:s}=r,a=(0,_n.parseJSON)(s);if(!a||(0,_n.isError)(a)||(0,_n.isError)(o))return null;let l=(0,B_.isValidSectionGroup)(a)?Object.entries(a.sections).filter(([c,h])=>h.type===e).map(([c])=>{let h=(0,_n.nodeAtPath)(o,["sections",c,"type"]);return{annotationId:du,newText:t,range:cu.Range.create(i.positionAt(h.loc.start.offset+1),i.positionAt(h.loc.end.offset-1))}}):[];return l.length===0?null:Mv(r,l)}}getSectionTagChanges(e,t){return async r=>{let{textDocument:i,ast:o}=r;if((0,_n.isError)(o))return null;let s=(0,_n.visit)(o,{LiquidTag(a){if(a.name!=="section"||typeof a.markup=="string")return;let l=a.markup;if(l.value===e)return{annotationId:du,newText:t,range:cu.Range.create(i.positionAt(l.position.start+1),i.positionAt(l.position.end-1))}}});return s.length===0?null:Mv(r,s)}}};hu.SectionRenameHandler=Iv;function Mv(n,e){return{textDocument:{uri:n.uri,version:n.version??null},edits:e}}});var J_=w(pu=>{"use strict";d();Object.defineProperty(pu,"__esModule",{value:!0});pu.SnippetRenameHandler=void 0;var Nv=ee(),G_=V(),K_=he(),aL=Ei(),uu=Pi(),zv=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(f=>(0,uu.isSnippet)(f.oldUri)&&(0,uu.isSnippet)(f.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(G_.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let s=this.documentManager.theme(i,!0).filter(aL.isLiquidSourceCode),a=(0,uu.snippetName)(r.oldUri),l=(0,uu.snippetName)(r.newUri),c=`Rename snippet '${a}' to '${l}'`,h="renameSnippet",p={documentChanges:[],changeAnnotations:{[h]:{label:c,needsConfirmation:!1}}};for(let f of s){if(f.ast instanceof Error)continue;let b=f.textDocument,C=(0,G_.visit)(f.ast,{LiquidTag(D){if(D.name!==Nv.NamedTags.render&&D.name!==Nv.NamedTags.include||typeof D.markup=="string")return;let P=D.markup.snippet;if(P.type===Nv.NodeTypes.String&&P.value===a)return{newText:`${l}`,range:K_.Range.create(b.positionAt(P.position.start+1),b.positionAt(P.position.end-1))}}});C.length!==0&&p.documentChanges.push({textDocument:{uri:b.uri,version:f.version??null},annotationId:h,edits:C})}if(p.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(K_.ApplyWorkspaceEditRequest.type,{label:c,edit:p})}};pu.SnippetRenameHandler=zv});var X_=w(mu=>{"use strict";d();Object.defineProperty(mu,"__esModule",{value:!0});mu.RenameHandler=void 0;var lL=H_(),cL=$_(),dL=V_(),hL=J_(),Ov=class{handlers;constructor(e,t,r,i){this.handlers=[new hL.SnippetRenameHandler(r,e,t,i),new lL.AssetRenameHandler(r,e,t,i),new cL.BlockRenameHandler(r,e,t,i),new dL.SectionRenameHandler(r,e,t,i)]}async onDidRenameFiles(e){try{let t=this.handlers.map(r=>r.onDidRenameFiles(e));await Promise.all(t)}catch(t){console.error(t);return}}};mu.RenameHandler=Ov});var Q_=w((C7,uL)=>{uL.exports={name:"@shopify/theme-language-server-common",version:"2.21.3",main:"dist/index.js",types:"dist/index.d.ts",author:"CP Clermont <cp.clermont@shopify.com>",homepage:"https://github.com/Shopify/theme-tools/tree/main/packages/theme-language-server-common#readme",repository:{type:"git",url:"git+https://github.com/Shopify/theme-tools.git",directory:"packages/theme-language-server-common"},bugs:{url:"https://github.com/Shopify/theme-tools/issues"},license:"MIT",publishConfig:{access:"public","@shopify:registry":"https://registry.npmjs.org"},dependencies:{"@shopify/liquid-html-parser":"^2.9.2","@shopify/theme-check-common":"3.26.1","@shopify/theme-graph":"^0.2.7","@vscode/web-custom-data":"^0.4.6","vscode-css-languageservice":"6.3.2","vscode-json-languageservice":"^5.3.10","vscode-jsonrpc":"^8.1.0","vscode-languageserver":"^8.0.2","vscode-languageserver-textdocument":"^1.0.8","vscode-uri":"^3.0.7"},devDependencies:{"@types/node":"^22.18.8","@vitest/expect":"4.1.0"},scripts:{build:"pnpm build:ts","build:ci":"pnpm build","build:ts":"tsc -b src/tsconfig.build.json",dev:"tsc -b src --watch",test:"vitest","type-check":"tsc --noEmit -p src/tsconfig.json"}}});var Y_=w(Qo=>{"use strict";d();var pL=Qo&&Qo.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.VERSION=void 0;var mL=pL(Q_());Qo.VERSION=mL.default.version});var Z_=w(fu=>{"use strict";d();Object.defineProperty(fu,"__esModule",{value:!0});fu.CachedFileSystem=void 0;var Lv=class{readFile;readDirectory;stat;constructor(e){this.readFile=Av(e.readFile.bind(e)),this.readDirectory=Av(e.readDirectory.bind(e)),this.stat=Av(e.stat.bind(e))}};fu.CachedFileSystem=Lv;function Av(n){let e=new Map;function t(r){return e.has(r)||e.set(r,n(r)),e.get(r)}return t.invalidate=r=>{e.delete(r)},t}});var nT=w(te=>{"use strict";d();Object.defineProperty(te,"__esModule",{value:!0});te.Configuration=te.ConfigurationKeys=te.PRELOAD_ON_BOOT=te.CHECK_ON_CHANGE=te.CHECK_ON_SAVE=te.CHECK_ON_OPEN=void 0;var eT=V(),tT=re();te.CHECK_ON_OPEN="themeCheck.checkOnOpen";te.CHECK_ON_SAVE="themeCheck.checkOnSave";te.CHECK_ON_CHANGE="themeCheck.checkOnChange";te.PRELOAD_ON_BOOT="themeCheck.preloadOnBoot";te.ConfigurationKeys=[te.CHECK_ON_OPEN,te.CHECK_ON_SAVE,te.CHECK_ON_CHANGE,te.PRELOAD_ON_BOOT];var qv=class{connection;capabilities;[te.CHECK_ON_OPEN]=!0;[te.CHECK_ON_SAVE]=!0;[te.CHECK_ON_CHANGE]=!0;[te.PRELOAD_ON_BOOT]=!0;constructor(e,t){this.connection=e,this.capabilities=t,this.connection=e,this.capabilities=t}setup(){this[te.CHECK_ON_OPEN]=this.capabilities.initializationOption(te.CHECK_ON_OPEN,!0),this[te.CHECK_ON_SAVE]=this.capabilities.initializationOption(te.CHECK_ON_SAVE,!0),this[te.CHECK_ON_CHANGE]=this.capabilities.initializationOption(te.CHECK_ON_CHANGE,!0),this[te.PRELOAD_ON_BOOT]=this.capabilities.initializationOption(te.PRELOAD_ON_BOOT,!0)}async shouldCheckOnOpen(){return await this.fetchConfiguration(),this[te.CHECK_ON_OPEN]}async shouldCheckOnSave(){return await this.fetchConfiguration(),this[te.CHECK_ON_SAVE]}async shouldCheckOnChange(){return await this.fetchConfiguration(),this[te.CHECK_ON_CHANGE]}async shouldPreloadOnBoot(){return await this.fetchConfiguration(),this[te.PRELOAD_ON_BOOT]}clearCache(){this.fetchConfiguration.clearCache()}fetchConfiguration=(0,eT.memo)(async()=>{if(!this.capabilities.hasWorkspaceConfigurationSupport)return;let e=await this.connection.workspace.getConfiguration(te.ConfigurationKeys.map(t=>({section:t})));for(let t=0;t<te.ConfigurationKeys.length;t++){let r=te.ConfigurationKeys[t];e[t]!==null&&(this[r]=e[t])}});registerDidChangeCapability=(0,eT.memo)(async()=>{if(this.capabilities.hasDidChangeConfigurationDynamicRegistrationSupport)return this.connection.client.register(tT.DidChangeConfigurationNotification.type)});registerDidChangeWatchedFilesNotification=async e=>{if(this.capabilities.hasDidChangeWatchedFilesDynamicRegistrationSupport)return this.connection.client.register(tT.DidChangeWatchedFilesNotification.type,e)}};te.Configuration=qv});var rT=w(gu=>{"use strict";d();Object.defineProperty(gu,"__esModule",{value:!0});gu.safe=void 0;var fL=(n,e)=>async function(...r){try{return await n(...r)}catch{return e}};gu.safe=fL});var iT=w(bu=>{"use strict";d();Object.defineProperty(bu,"__esModule",{value:!0});bu.ThemeGraphManager=void 0;var Yo=V(),Wv=CT(),gL=(qa(),Bt(La)),bL=(is(),Bt(Aa)),vL=el(),yL=It(),Hv=class{connection;documentManager;fs;findThemeRootURI;getModeForURI;graphs=new Map;constructor(e,t,r,i,o=async()=>"theme"){this.connection=e,this.documentManager=t,this.fs=r,this.findThemeRootURI=i,this.getModeForURI=o}async getThemeGraphForURI(e){let t=await this.findThemeRootURI(e);if(t)return this.graphs.has(t)||this.graphs.set(t,this.buildThemeGraph(t)),this.graphs.get(t)}async getReferences(e,t,{includeIndirect:r=!0,includePreset:i=!0}={}){let o=await this.getThemeGraphForURI(e);if(!o)return[];let s=o.modules[e];if(!s)return[];let a=["direct",r?"indirect":void 0,i?"preset":void 0],l=s.references.filter(c=>a.includes(c.type));return Promise.all(l.map(async c=>{let[h,p]=await Promise.all([this.augmentedLocation(c.source),this.augmentedLocation(c.target)]);return{...c,source:h,target:p}}))}async getDependencies(e,t,{includeIndirect:r=!0,includePreset:i=!0}={}){let o=await this.getThemeGraphForURI(e);if(!o)return[];let s=o.modules[e];if(s||(s=(await this.buildThemeGraph(o.rootUri,[e])).modules[e]),!s)return[];let a=["direct",r?"indirect":void 0,i?"preset":void 0],l=s.dependencies.filter(c=>a.includes(c.type))??[];return Promise.all(l.map(async c=>{let[h,p]=await Promise.all([this.augmentedLocation(c.source),this.augmentedLocation(c.target)]);return{...c,source:h,target:p}}))}async augmentedLocation(e){let t=await this.getSourceCode(e.uri).catch(()=>{}),{uri:r,range:i}=e;if(!t||!i)return{exists:!!t,...e};let o=this.documentManager.get(e.uri)?.textDocument;return o||(o=bL.TextDocument.create(t.uri,t.type,0,t.source)),{uri:r,range:i,excerpt:t.source.slice(i[0],i[1]),position:gL.Range.create(o.positionAt(i[0]),o.positionAt(i[0])),exists:!0}}async deadCode(e){let t=await this.getThemeGraphForURI(e);if(!t)return[];let r=await(0,Yo.recursiveReadDirectory)(this.fs,e,([o])=>["assets","blocks","layout","sections","snippets","templates"].some(s=>o.startsWith(Yo.path.join(e,s)))&&(o.endsWith(".liquid")||o.endsWith(".json")||o.endsWith(".js")||o.endsWith(".css"))),i=new Set;for(let o of r)t.modules[o]||i.add(o);return Array.from(i).sort()}operationQueue=[];async rename(e,t){this.operationQueue.push(e),this.operationQueue.push(t),this.processQueue()}async change(e){this.operationQueue.push(e),this.processQueue()}async create(e){this.operationQueue.push(e),this.processQueue()}async delete(e){this.operationQueue.push(e),this.processQueue()}processQueue=(0,yL.debounce)(async()=>{let e=[...new Set(this.operationQueue.splice(0,this.operationQueue.length))];if(e.length===0)return;let t=e[0],r=await this.findThemeRootURI(t);!r||!await this.graphs.get(r)||(this.graphs.delete(r),await this.getThemeGraphForURI(r),this.connection.sendNotification(vL.ThemeGraphDidUpdateNotification.type,{uri:r}))},500);buildThemeGraph=async(e,t)=>{let{documentManager:r}=this;await r.preload(e);let i=await this.graphDependencies(e);return(0,Wv.buildThemeGraph)(e,i,t)};getSourceCode=async e=>{let t=this.documentManager.get(e);if(t)return t;let r=await this.fs.readFile(e);return(0,Wv.toSourceCode)(e,r)};getWebComponentMap(e){let{fs:t,getSourceCode:r}=this;return(0,Wv.getWebComponentMap)(e,{fs:t,getSourceCode:r})}async graphDependencies(e){let{documentManager:t,fs:r,getSourceCode:i}=this,[o,s]=await Promise.all([this.getWebComponentMap(e),this.getModeForURI(e)]);return{fs:r,getSourceCode:i,mode:s,async getBlockSchema(a){let l=Yo.path.join(e,"blocks",`${a}.liquid`),c=t.get(l);if(!(!c||c.type!==Yo.SourceCodeType.LiquidHtml))return await c.getSchema()},async getSectionSchema(a){let l=Yo.path.join(e,"sections",`${a}.liquid`),c=t.get(l);if(!(!c||c.type!==Yo.SourceCodeType.LiquidHtml))return await c.getSchema()},getWebComponentDefinitionReference(a){return o.get(a)}}}};bu.ThemeGraphManager=Hv});var lT=w(jv=>{"use strict";d();Object.defineProperty(jv,"__esModule",{value:!0});jv.startServer=WL;var be=V(),Ra=re(),wL=zS(),oT=ZS(),sT=tc(),SL=ok(),xL=NC(),kL=HC(),aT=$C(),CL=ZC(),_L=n1(),TL=Ei(),RL=p1(),EL=q1(),DL=__(),FL=F_(),PL=L_(),ML=X_(),vu=el(),IL=It(),NL=Pi(),zL=Y_(),OL=Z_(),AL=nT(),Uv=rT(),LL=iT(),qL=()=>{},at=n=>"textDocument"in n&&"uri"in n.textDocument&&typeof n.textDocument.uri=="string"&&(n.textDocument.uri.startsWith("jj:")||n.textDocument.uri.startsWith("git:")||n.textDocument.uri.startsWith("output:"));function WL(n,{fs:e,loadConfig:t,log:r=qL,jsonValidationSet:i,themeDocset:o,fetchMetafieldDefinitionsForURI:s}){let a=new OL.CachedFileSystem(e),l=(0,be.makeFileExists)(a),c=(0,be.memoize)(t,_=>_),h=new wL.ClientCapabilities,p=new AL.Configuration(n,h),f=new TL.DocumentManager(a,n,h,Ut,xr),b=new LL.ThemeGraphManager(n,f,a,q,Ut),C=new aT.DiagnosticsManager(n),D=new _L.DocumentLinksProvider(f,q),P=new oT.CodeActionsProvider(f,C),A=new RL.OnTypeFormattingProvider(f,async function(L,W){h.hasShowDocumentSupport&&n.sendRequest(Ra.ShowDocumentRequest.type,{uri:L.uri,takeFocus:!0,selection:{start:W,end:W}})}),S=new FL.LinkedEditingRangesProvider(f),y=new CL.DocumentHighlightsProvider(f),R=new PL.RenameProvider(n,h,f,q),N=new ML.RenameHandler(n,h,f,q);async function q(_){let L=await(0,be.findRoot)(_,l);return L?(await c(L,a)).rootUri:null}let Se=(0,be.memoize)((0,be.makeGetMetafieldDefinitions)(a),_=>_),De=async _=>{let L=await q(_);return L?Se(L):{}},Wt=new be.AugmentedThemeDocset(o),Dt=new xL.CSSLanguageService(f),kt=(0,IL.debounce)((0,aT.makeRunChecks)(f,C,{fs:a,loadConfig:c,themeDocset:Wt,jsonValidationSet:i,getMetafieldDefinitions:De,cssLanguageService:Dt,themeGraphManager:b}),100),Ct=async _=>{let L=await q(_);if(!L)return{};let W=f.theme(L),G=(0,be.makeGetDefaultTranslations)(a,W,L),[Re,_t]=await Promise.all([G(),Wt.systemTranslations()]);return{..._t,...Re}},wr=async _=>{let L=await q(_);if(!L)return{};let W=f.theme(L);return(0,be.makeGetDefaultSchemaTranslations)(a,W,L)()},ni=async(_,L,W)=>{let G=await q(_);if(!G)return;let Re=be.path.join(G,L,`${W}.liquid`),_t=f.get(Re);if(!(!_t||_t.type!==be.SourceCodeType.LiquidHtml||(0,be.isError)(_t.ast)))return _t.getLiquidDoc()},Ht=([_])=>/\.liquid$/.test(_)&&/snippets/.test(_),Ft=(0,Uv.safe)(async _=>{let L=await q(_);return L?(await(0,be.recursiveReadDirectory)(a,L,Ht)).map(NL.snippetName):[]},[]),Sr=(0,Uv.safe)(async _=>{let L=await q(_);if(!L)return[];let W=be.path.join(L,"config","settings_schema.json"),G=await a.readFile(W),Re=(0,be.parseJSON)(G);if((0,be.isError)(Re)||!Array.isArray(Re))throw new Error("Settings JSON file not in correct format");return Re},[]);async function Ut(_){let L=await(0,be.findRoot)(_,l);return L?(await c(L,a)).context:"theme"}let Rn=(0,Uv.safe)(async(_,L)=>{let W=await q(_);if(!W)return[];let Re=(await a.readDirectory(be.path.join(W,"blocks"))).map(([_t])=>be.path.basename(_t,".liquid"));return L?Re:Re.filter(_t=>!_t.startsWith("_"))},[]);async function pt(_,L){let W=await q(_);if(!W)return;let G=be.path.join(W,"blocks",`${L}.liquid`),Re=f.get(G);if(!(!Re||Re.type!==be.SourceCodeType.LiquidHtml))return Re.getSchema()}async function xr(_,L){return ri.isValidSchema(_,L)}let Zo=(0,be.makeGetDefaultLocaleFileUri)(a);async function Mi(_){let L=await q(_);if(!L)return null;let W=await Zo(L);return W?f.get(W)??null:null}let Ii=(0,be.makeGetDefaultSchemaLocaleFileUri)(a);async function Ni(_){let L=await q(_);if(!L)return null;let W=await Ii(L);return W?f.get(W)??null:null}let ku=new kL.DefinitionProvider(f,Mi,Ni),ri=new DL.JSONLanguageService(f,i,wr,Ut,Rn,pt,q),Cu=new SL.CompletionsProvider({documentManager:f,themeDocset:Wt,getTranslationsForURI:Ct,getSnippetNamesForURI:Ft,getThemeSettingsSchemaForURI:Sr,log:r,getThemeBlockNames:Rn,getMetafieldDefinitions:De,getDocDefinitionForURI:ni,getModeForURI:Ut}),_u=new EL.HoverProvider(f,Wt,De,Ct,Sr,ni,Ut),Tu=new sT.ExecuteCommandProvider(f,C,h,kt,n),Da=async _=>{if(s)for(let L of _)await Ut(L.uri)==="theme"&&s(L.uri)};n.onInitialize(_=>{h.setup(_.capabilities,_.initializationOptions),Dt.setup(_.capabilities),ri.setup(_.capabilities),p.setup();let L={filters:[{pattern:{glob:"**/*.{liquid,json}"}},{pattern:{glob:"**/assets/*"}}]};return{capabilities:{textDocumentSync:{change:Ra.TextDocumentSyncKind.Full,save:!0,openClose:!0},codeActionProvider:{codeActionKinds:[...oT.CodeActionKinds]},completionProvider:{triggerCharacters:[".","{{ ","{% ","<","/","[",'"',"'",":","@"]},definitionProvider:!0,documentOnTypeFormattingProvider:{firstTriggerCharacter:" ",moreTriggerCharacter:["{","%","-",">"]},documentLinkProvider:{resolveProvider:!1,workDoneProgress:!1},documentHighlightProvider:!0,linkedEditingRangeProvider:!0,renameProvider:{prepareProvider:!0},executeCommandProvider:{commands:[...sT.Commands]},hoverProvider:{workDoneProgress:!1},workspace:{workspaceFolders:{supported:!0,changeNotifications:!0},fileOperations:{didRename:L}}},serverInfo:{name:"theme-language-server",version:zL.VERSION}}}),n.onInitialized(()=>{r("[SERVER] Let's roll!"),p.fetchConfiguration(),p.registerDidChangeCapability(),p.registerDidChangeWatchedFilesNotification({watchers:[{globPattern:"**/.theme-check.yml"},{globPattern:"**/.shopify/*"},{globPattern:"**/*.liquid"},{globPattern:"**/assets/*.css"},{globPattern:"**/{locales,sections,templates,customers}/*.json"},{globPattern:"**/config/settings_{data,schema}.json"}]}),h.hasWorkspaceFoldersSupport&&(n.workspace.getWorkspaceFolders().then(async _=>{_&&Da(_)}),n.workspace.onDidChangeWorkspaceFolders(async _=>{Da(_.added)}))}),n.onDidChangeConfiguration(_=>{p.clearCache()}),n.onDidOpenTextDocument(async _=>{if(at(_))return;let{uri:L,text:W,version:G}=_.textDocument;if(f.open(L,W,G),await p.shouldCheckOnOpen()&&kt([L]),await p.shouldPreloadOnBoot()){let Re=await q(L);Re&&f.preload(Re)}}),n.onDidChangeTextDocument(async _=>{if(at(_))return;let{uri:L,version:W}=_.textDocument;f.change(L,_.contentChanges[0].text,W),await p.shouldCheckOnChange()?kt([L]):C.clear(_.textDocument.uri)}),n.onDidSaveTextDocument(async _=>{if(at(_))return;let{uri:L}=_.textDocument;await p.shouldCheckOnSave()&&kt([L])}),n.onDidCloseTextDocument(_=>{if(at(_))return;let{uri:L}=_.textDocument;f.close(L),C.clear(L)}),n.onDocumentLinks(async _=>{if(at(_))return[];let[L,W]=await Promise.all([D.documentLinks(_.textDocument.uri),ri.documentLinks(_)]);return[...L,...W]}),n.onDefinition(async _=>at(_)?[]:ku.definitions(_)),n.onCodeAction(async _=>P.codeActions(_)),n.onExecuteCommand(async _=>{await Tu.execute(_)}),n.onCompletion(async _=>at(_)?[]:await Dt.completions(_)??await ri.completions(_)??await Cu.completions(_)),n.onHover(async _=>at(_)?null:await Dt.hover(_)??await ri.hover(_)??await _u.hover(_)),n.onDocumentOnTypeFormatting(async _=>at(_)?null:A.onTypeFormatting(_)),n.onDocumentHighlight(async _=>at(_)?[]:y.documentHighlights(_)),n.onPrepareRename(async _=>at(_)?null:R.prepare(_)),n.onRenameRequest(async _=>at(_)?null:R.rename(_)),n.languages.onLinkedEditingRange(async _=>at(_)?null:S.linkedEditingRanges(_)),n.workspace.onDidRenameFiles(async _=>{let L=_.files.map(W=>W.newUri);for(let{oldUri:W,newUri:G}of _.files)f.rename(W,G),a.readDirectory.invalidate(be.path.dirname(W)),a.readDirectory.invalidate(be.path.dirname(G)),a.readFile.invalidate(W),a.readFile.invalidate(G),a.stat.invalidate(W),a.stat.invalidate(G),b.rename(W,G);await N.onDidRenameFiles(_),kt.force(L)}),n.onDidChangeWatchedFiles(async _=>{if(_.changes.length===0)return;let L=_.changes.map(G=>G.uri),W=[];for(let G of _.changes){if(G.uri.endsWith(".theme-check.yml")){c.clearCache();continue}if(f.hasRecentRename(G.uri)){f.clearRecentRename(G.uri);continue}switch(G.type){case Ra.FileChangeType.Created:a.readDirectory.invalidate(be.path.dirname(G.uri)),a.readFile.invalidate(G.uri),a.stat.invalidate(G.uri),b.create(G.uri),W.push(f.changeFromDisk(G.uri));break;case Ra.FileChangeType.Changed:a.readFile.invalidate(G.uri),a.stat.invalidate(G.uri),b.change(G.uri),f.get(G.uri)?.version===void 0&&W.push(f.changeFromDisk(G.uri));break;case Ra.FileChangeType.Deleted:a.readDirectory.invalidate(be.path.dirname(G.uri)),a.readFile.invalidate(G.uri),a.stat.invalidate(G.uri),b.delete(G.uri),f.delete(G.uri);break}G.uri.endsWith("metafields.json")&&W.push(q(G.uri).then(Re=>{Re&&Se.invalidate(Re)}))}await Promise.all(W),kt.force(L)}),n.onRequest(vu.ThemeGraphReferenceRequest.type,async _=>{if(at(_))return[];let{uri:L,offset:W,includeIndirect:G}=_;return b.getReferences(L,W,{includeIndirect:G}).catch(Re=>[])}),n.onRequest(vu.ThemeGraphDependenciesRequest.type,async _=>{if(at(_))return[];let{uri:L,offset:W,includeIndirect:G}=_;return b.getDependencies(L,W,{includeIndirect:G}).catch(Re=>[])}),n.onRequest(vu.ThemeGraphRootRequest.type,async _=>{if(at(_))return"";let{uri:L}=_,W=await q(L).catch(G=>{});return(!W||be.path.dirname(W)===W)&&console.error(L),W}),n.onRequest(vu.ThemeGraphDeadCodeRequest.type,async _=>{if(at(_))return[];let{uri:L}=_,W=await q(L);return W?await b.deadCode(W):[]}),n.listen()}});var cT=w(yu=>{"use strict";d();Object.defineProperty(yu,"__esModule",{value:!0});yu.startServer=void 0;var HL=lT();Object.defineProperty(yu,"startServer",{enumerable:!0,get:function(){return HL.startServer}})});var Su=w(Te=>{"use strict";d();var UL=Te&&Te.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),jL=Te&&Te.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&UL(e,n,t)};Object.defineProperty(Te,"__esModule",{value:!0});Te.SourceCodeType=Te.FileType=Te.allChecks=Te.recommendedChecks=Te.startServer=Te.parseJSON=Te.memo=Te.debounce=Te.visit=void 0;var wu=V();Object.defineProperty(Te,"allChecks",{enumerable:!0,get:function(){return wu.allChecks}});Object.defineProperty(Te,"recommendedChecks",{enumerable:!0,get:function(){return wu.recommended}});Object.defineProperty(Te,"FileType",{enumerable:!0,get:function(){return wu.FileType}});Object.defineProperty(Te,"SourceCodeType",{enumerable:!0,get:function(){return wu.SourceCodeType}});jL(el(),Te);var $L=V();Object.defineProperty(Te,"visit",{enumerable:!0,get:function(){return $L.visit}});var $v=It();Object.defineProperty(Te,"debounce",{enumerable:!0,get:function(){return $v.debounce}});Object.defineProperty(Te,"memo",{enumerable:!0,get:function(){return $v.memo}});Object.defineProperty(Te,"parseJSON",{enumerable:!0,get:function(){return $v.parseJSON}});var BL=cT();Object.defineProperty(Te,"startServer",{enumerable:!0,get:function(){return BL.startServer}})});var hT=w((H7,dT)=>{"use strict";d();dT.exports=re()});var pT=w(xu=>{"use strict";d();Object.defineProperty(xu,"__esModule",{value:!0});xu.loadConfig=void 0;var Tn=Eu(),VL=Su(),Ea=Fa();function uT(n){return Ea.URI.isUri(n)?n.fsPath:/^file:/i.test(n)?Ea.URI.parse(n).fsPath:Ea.URI.file(n).fsPath}var GL=async(n,e)=>(await(0,Tn.recursiveReadDirectory)(e,n,([r])=>r.endsWith(".extension.toml"))).length>0,KL=async function(e,t){let r=Tn.path.normalize(e),i=(0,Tn.makeFileExists)(t),o=await(0,Tn.findRoot)(r,i);if(!o)throw new Error(`Could not find theme root for ${r}`);let s=Ea.URI.parse(o),a=s.scheme,l=Ea.Utils.joinPath(s,".theme-check.yml"),[c,h]=await Promise.all([i(Tn.path.normalize(l)),GL(Tn.path.normalize(s),t)]);if(a==="file"){let p=uT(l),f=uT(s);return c?(0,Tn.loadConfig)(p,f).then(Bv):h?(0,Tn.loadConfig)("theme-check:theme-app-extension",f).then(Bv):(0,Tn.loadConfig)(void 0,f).then(Bv)}else return{checks:VL.recommendedChecks,settings:{},context:h?"app":"theme",rootUri:Tn.path.normalize(s)}};xu.loadConfig=KL;function Bv(n){return n.rootUri=Tn.path.normalize(n.rootUri),n}});var mT=w(vr=>{"use strict";d();var JL=vr&&vr.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),XL=vr&&vr.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),QL=vr&&vr.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&JL(t,e,r[i]);return XL(t,e),t}})();Object.defineProperty(vr,"__esModule",{value:!0});vr.fetchMetafieldDefinitionsForURI=nq;var YL=QL(jt("child_process")),ZL=jt("node:util"),Vv=(0,ZL.promisify)(YL.exec),eq=process.platform==="win32",tq=rq();async function nq(n){try{let e=await tq;if(!e)return;await Vv(`${e} theme metafields pull`,{cwd:new URL(n),timeout:1e4,env:{...process.env,SHOPIFY_LANGUAGE_SERVER:"1"}})}catch{}}async function rq(){if(process.env.NODE_ENV!=="test")try{if(eq){let{stdout:n}=await Vv("where.exe shopify"),e=n.replace(/\r/g,"").split(`
557
+ `).join("")+l.source.slice(l.blockStartPosition.end,l.blockEndPosition.start),p=SA.TextDocument.create(i.uri,"json",i.version,h),f=t.parseJSONDocument(p);return[p,f]}}}async getSchemaForURI(e){let t=this.schemas[e]?.schema;return t||`Could not get schema for '${e}'`}};Jh.JSONLanguageService=bv});var vv=w(Xh=>{"use strict";d();Object.defineProperty(Xh,"__esModule",{value:!0});Xh.htmlElementNameWordPattern=void 0;var kA="[a-zA-Z]",CA="[a-zA-Z0-9-]";Xh.htmlElementNameWordPattern=`${kA}${CA}*`});var T_=w(Qh=>{"use strict";d();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.EmptyHtmlTagLinkedRangesProvider=void 0;var Ta=re(),_A=vv(),yv=class{documentManager;constructor(e){this.documentManager=e}async linkedEditingRanges(e,t,{textDocument:{uri:r},position:i}){if(e!==null||t!==null)return null;let o=this.documentManager.get(r),s=o?.textDocument;if(!o||!s)return null;let a=Ta.Range.create(Ta.Position.create(i.line,i.character-1),Ta.Position.create(i.line,i.character+1));if(!["<>","< "].includes(s.getText(a)))return null;let l=o.source.indexOf("</>",s.offsetAt(i));if(l===-1)return null;let c=l+2,h=s.positionAt(c);return{ranges:[Ta.Range.create(i,i),Ta.Range.create(h,h)],wordPattern:_A.htmlElementNameWordPattern}}};Qh.EmptyHtmlTagLinkedRangesProvider=yv});var R_=w(Yh=>{"use strict";d();Object.defineProperty(Yh,"__esModule",{value:!0});Yh.HtmlTagNameLinkedRangesProvider=void 0;var TA=oh(),RA=vv(),wv=class{documentManager;constructor(e){this.documentManager=e}async linkedEditingRanges(e,t,r){if(!e||!t)return null;let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i)return null;let o=(0,TA.getHtmlElementNameRanges)(e,t,r,i);return o?{ranges:o,wordPattern:RA.htmlElementNameWordPattern}:null}};Yh.HtmlTagNameLinkedRangesProvider=wv});var E_=w(Vo=>{"use strict";d();Object.defineProperty(Vo,"__esModule",{value:!0});Vo.HtmlTagNameLinkedRangesProvider=Vo.EmptyHtmlTagLinkedRangesProvider=void 0;var EA=T_();Object.defineProperty(Vo,"EmptyHtmlTagLinkedRangesProvider",{enumerable:!0,get:function(){return EA.EmptyHtmlTagLinkedRangesProvider}});var DA=R_();Object.defineProperty(Vo,"HtmlTagNameLinkedRangesProvider",{enumerable:!0,get:function(){return DA.HtmlTagNameLinkedRangesProvider}})});var F_=w(Zh=>{"use strict";d();Object.defineProperty(Zh,"__esModule",{value:!0});Zh.LinkedEditingRangesProvider=void 0;var FA=V(),PA=V(),D_=E_(),Sv=class{documentManager;providers;constructor(e){this.documentManager=e,this.providers=[new D_.HtmlTagNameLinkedRangesProvider(e),new D_.EmptyHtmlTagLinkedRangesProvider(e)]}async linkedEditingRanges(e){let t=this.documentManager.get(e.textDocument.uri);if(!t||t.type!==FA.SourceCodeType.LiquidHtml)return null;let r=null,i=null;t.ast instanceof Error||([r,i]=(0,PA.findCurrentNode)(t.ast,t.textDocument.offsetAt(e.position)));let o=this.providers.map(a=>a.linkedEditingRanges(r,i,e).catch(()=>null));return(await Promise.all(o)).find(Boolean)??null}};Zh.LinkedEditingRangesProvider=Sv});var I_=w(eu=>{"use strict";d();Object.defineProperty(eu,"__esModule",{value:!0});eu.HtmlTagNameRenameProvider=void 0;var M_=he(),P_=oh(),xv=class{documentManager;constructor(e){this.documentManager=e}async prepare(e,t,r){let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i||!e||!t)return null;let o=(0,P_.getHtmlElementNameRanges)(e,t,r,i);return!o||!o[0]?null:{range:o[0],placeholder:i.getText(o[0])}}async rename(e,t,r){let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i||!e||!t)return null;let o=(0,P_.getHtmlElementNameRanges)(e,t,r,i);return o?{documentChanges:[M_.TextDocumentEdit.create({uri:i.uri,version:i.version},MA(o,r.newName))]}:null}};eu.HtmlTagNameRenameProvider=xv;function MA(n,e){return n.map(t=>M_.TextEdit.replace(t,e))}});var Pi=w(we=>{"use strict";d();Object.defineProperty(we,"__esModule",{value:!0});we.isTemplate=we.templateName=we.isSectionGroup=we.sectionGroupName=we.isSection=we.sectionName=we.isBlock=we.blockName=we.isAsset=we.assetName=we.isSnippet=we.snippetName=void 0;var Go=V(),IA=n=>Go.path.basename(n,".liquid");we.snippetName=IA;var NA=n=>/\bsnippets(\\|\/)[^\\\/]*\.liquid/.test(n);we.isSnippet=NA;var zA=n=>Go.path.basename(n,".liquid");we.assetName=zA;var OA=n=>/\bassets(\\|\/)[^\\\/]/.test(n);we.isAsset=OA;var AA=n=>Go.path.basename(n,".liquid");we.blockName=AA;var LA=n=>/\bblocks(\\|\/)[^\\\/]/.test(n);we.isBlock=LA;var qA=n=>Go.path.basename(n,".liquid");we.sectionName=qA;var WA=n=>/\bsections(\\|\/)[^\\\/]/.test(n)&&/.liquid$/.test(n);we.isSection=WA;var HA=n=>Go.path.basename(n,".json");we.sectionGroupName=HA;var UA=n=>/\bsections(\\|\/)[^\\\/]/.test(n)&&/.json$/.test(n);we.isSectionGroup=UA;var jA=n=>Go.path.basename(n,".json");we.templateName=jA;var $A=n=>/\btemplates(\\|\/)[^\\\/]/.test(n);we.isTemplate=$A});var A_=w(nu=>{"use strict";d();Object.defineProperty(nu,"__esModule",{value:!0});nu.LiquidVariableRenameProvider=void 0;var Ge=ee(),z_=V(),tu=re(),kv=he(),BA=Ei(),VA=Pi(),Cv=class{connection;clientCapabilities;documentManager;findThemeRootURI;constructor(e,t,r,i){this.connection=e,this.clientCapabilities=t,this.documentManager=r,this.findThemeRootURI=i}async prepare(e,t,r){let o=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!o||!e||!t||!N_(e,t))return null;let s=e.type===Ge.NodeTypes.LiquidDocParamNode?e.paramName:e,a=_v(e),l=o.offsetAt(r.position),c=s.position.start+a.length;return l<s.position.start||l>c?null:{range:tu.Range.create(o.positionAt(s.position.start),o.positionAt(c)),placeholder:a}}async rename(e,t,r){let i=this.documentManager.get(r.textDocument.uri),o=await this.findThemeRootURI(r.textDocument.uri),s=i?.textDocument;if(!o||!s||!e||!t||i.ast instanceof Error||!N_(e,t))return null;if(e.type===Ge.NodeTypes.LiquidDocParamNode){let b=s.offsetAt(r.position),C=e.paramName.position.start+e.paramName.value.length;if(b<e.paramName.position.start||b>C)return null}let a=_v(e),l=O_(a,t),c=JA(a,s,l),h=!1,p=(0,z_.visit)(i.ast,{VariableLookup:c,AssignMarkup:c,ForMarkup:c,TextNode:(b,C)=>{let D=C.at(-1);if(!(D?.type!==Ge.NodeTypes.LiquidDocParamNode||D?.paramName!==b))return h=!0,c(b,C)}});if(this.clientCapabilities.hasApplyEditSupport&&h){let C=this.documentManager.theme(o,!0).filter(BA.isLiquidSourceCode),D=(0,VA.snippetName)(r.textDocument.uri);XA(this.connection,C,D,a,r.newName)}return{documentChanges:[kv.TextDocumentEdit.create({uri:s.uri,version:s.version},p.map(b=>kv.TextEdit.replace(b,r.newName)))]}}};nu.LiquidVariableRenameProvider=Cv;function N_(n,e){return n.type===Ge.NodeTypes.AssignMarkup||n.type===Ge.NodeTypes.VariableLookup||n.type===Ge.NodeTypes.ForMarkup||GA(n,e)||KA(n)}function GA(n,e){let t=e.at(-1);return!!t&&t.type===Ge.NodeTypes.LiquidDocParamNode&&t.paramName===n&&n.type===Ge.NodeTypes.TextNode}function KA(n){return n.type===Ge.NodeTypes.LiquidDocParamNode&&n.paramName?.type===Ge.NodeTypes.TextNode}function _v(n){switch(n.type){case Ge.NodeTypes.VariableLookup:case Ge.NodeTypes.AssignMarkup:return n.name??"";case Ge.NodeTypes.ForMarkup:return n.variableName??"";case Ge.NodeTypes.TextNode:return n.value;case Ge.NodeTypes.LiquidDocParamNode:return n.paramName.value;default:return""}}function O_(n,e){let t;for(let r=e.length-1;r>=0;r--){let i=e[r];if(i.type===Ge.NodeTypes.LiquidTag&&(i.name===Ge.NamedTags.tablerow||i.name===Ge.NamedTags.for)&&typeof i.markup!="string"&&i.markup.variableName===n){t=i;break}}if(!(!t||!t.blockEndPosition))return{start:t.blockStartPosition.start,end:t.blockEndPosition.end}}function JA(n,e,t){return(r,i)=>{if(_v(r)!==n)return;let o=O_(n,i);if(!(o?.start!==t?.start||o?.end!==t?.end))return tu.Range.create(e.positionAt(r.position.start),e.positionAt(r.position.start+n.length))}}async function XA(n,e,t,r,i){let o=`Rename snippet parameter '${r}' to '${i}'`,s="renameSnippetParameter",a={documentChanges:[],changeAnnotations:{[s]:{label:o,needsConfirmation:!1}}};for(let l of e){if(l.ast instanceof Error)continue;let c=l.textDocument,h=(0,z_.visit)(l.ast,{RenderMarkup(p){if(p.snippet.type!==Ge.NodeTypes.String||p.snippet.value!==t)return;let f=p.args.find(b=>b.name===r);if(f)return{newText:`${i}: `,range:tu.Range.create(c.positionAt(f.position.start),c.positionAt(f.value.position.start))};if(p.alias?.value===r&&p.variable){let C=/as\s+([^\s,]+)/g.exec(p.source.slice(p.position.start,p.position.end));return C?{newText:`as ${i}`,range:tu.Range.create(c.positionAt(p.position.start+C.index),c.positionAt(p.position.start+C.index+C[0].length))}:void 0}}});h.length!==0&&a.documentChanges.push({textDocument:{uri:c.uri,version:l.version??null},annotationId:s,edits:h})}if(a.documentChanges.length===0){console.error("Nothing to do!");return}await n.sendRequest(kv.ApplyWorkspaceEditRequest.type,{label:o,edit:a})}});var L_=w(ru=>{"use strict";d();Object.defineProperty(ru,"__esModule",{value:!0});ru.RenameProvider=void 0;var QA=V(),YA=V(),ZA=I_(),eL=A_(),Tv=class{documentManager;providers;constructor(e,t,r,i){this.documentManager=r,this.providers=[new ZA.HtmlTagNameRenameProvider(r),new eL.LiquidVariableRenameProvider(e,t,r,i)]}async prepare(e){let[t,r]=this.nodes(e);if(t===null||r===null)return null;let i=this.providers.map(s=>s.prepare(t,r,e).catch(()=>null));return(await Promise.all(i)).find(Boolean)??null}async rename(e){let[t,r]=this.nodes(e);if(t===null||r===null)return null;let i=this.providers.map(s=>s.rename(t,r,e).catch(()=>null));return(await Promise.all(i)).find(Boolean)??null}nodes(e){let t=this.documentManager.get(e.textDocument.uri);return!t||t.type!==QA.SourceCodeType.LiquidHtml?[null,null]:t.ast instanceof Error?[null,null]:(0,YA.findCurrentNode)(t.ast,t.textDocument.offsetAt(e.position))}};ru.RenameProvider=Tv});var H_=w(ou=>{"use strict";d();Object.defineProperty(ou,"__esModule",{value:!0});ou.AssetRenameHandler=void 0;var tL=ee(),q_=V(),W_=he(),nL=Ei(),iu=Pi(),Rv=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(f=>(0,iu.isAsset)(f.oldUri)&&(0,iu.isAsset)(f.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(q_.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let s=this.documentManager.theme(i,!0).filter(nL.isLiquidSourceCode),a=(0,iu.assetName)(r.oldUri),l=(0,iu.assetName)(r.newUri),c=`Rename asset '${a}' to '${l}'`,h="renameAsset",p={documentChanges:[],changeAnnotations:{[h]:{label:c,needsConfirmation:!1}}};for(let f of s){if(f.ast instanceof Error)continue;let b=f.textDocument,C=(0,q_.visit)(f.ast,{LiquidVariable(D){if(!(D.filters.length===0||D.expression.type!==tL.NodeTypes.String||D.filters[0].name!=="asset_url"||D.expression.value!==a))return{newText:l,range:W_.Range.create(b.positionAt(D.expression.position.start+1),b.positionAt(D.expression.position.end-1))}}});C.length!==0&&p.documentChanges.push({textDocument:{uri:b.uri,version:f.version??null},annotationId:h,edits:C})}if(p.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(W_.ApplyWorkspaceEditRequest.type,{label:c,edit:p})}};ou.AssetRenameHandler=Rv});var Ev=w(su=>{"use strict";d();Object.defineProperty(su,"__esModule",{value:!0});su.isValidTemplate=rL;su.isValidSectionGroup=iL;function rL(n){return typeof n=="object"&&n!==null&&"sections"in n&&"order"in n&&Array.isArray(n.order)}function iL(n){return typeof n=="object"&&n!==null&&"sections"in n&&"order"in n&&Array.isArray(n.order)}});var $_=w(lu=>{"use strict";d();Object.defineProperty(lu,"__esModule",{value:!0});lu.BlockRenameHandler=void 0;var oL=ee(),Xe=V(),Ko=he(),Dv=Ei(),ti=Pi(),U_=Ev(),Jo="renameBlock",Fv=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(y=>(0,ti.isBlock)(y.oldUri)&&(0,ti.isBlock)(y.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(Xe.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let o=this.documentManager.theme(i,!0),s=o.filter(Dv.isLiquidSourceCode),a=s.filter(y=>(0,ti.isBlock)(y.uri)||(0,ti.isSection)(y.uri)),l=o.filter(Dv.isJsonSourceCode).filter(y=>(0,ti.isTemplate)(y.uri)),c=o.filter(Dv.isJsonSourceCode).filter(y=>(0,ti.isSectionGroup)(y.uri)),h=(0,ti.blockName)(r.oldUri),p=(0,ti.blockName)(r.newUri),f=`Rename block '${h}' to '${p}'`,b={documentChanges:[],changeAnnotations:{[Jo]:{label:f,needsConfirmation:!1}}},C=new Set,D=await Promise.all(a.map(this.getSchemaChanges(C,h,p))),[P,A,S]=await Promise.all([Promise.all(l.map(this.getTemplateChanges(h,p,C))),Promise.all(c.map(this.getSectionGroupChanges(h,p,C))),Promise.all(s.map(this.getContentForChanges(h,p)))]);for(let y of[...D,...P,...A])y!==null&&b.documentChanges.push(y);for(let y of S)if(y!==null){let R=b.documentChanges.find(N=>N.textDocument.uri===y?.textDocument.uri);R?R.edits.push(...y.edits):b.documentChanges.push(y)}if(b.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(Ko.ApplyWorkspaceEditRequest.type,{label:f,edit:b})}getSchemaChanges(e,t,r){return async i=>{if(i.ast instanceof Error)return null;let o=i.textDocument,s=await i.getSchema();if(!(0,Xe.isBlockSchema)(s)&&!(0,Xe.isSectionSchema)(s)||(0,Xe.isError)(s.validSchema)||(0,Xe.isError)(s.ast))return null;let{validSchema:a,ast:l,offset:c}=s,h=[];if(a.blocks)for(let f=0;f<a.blocks.length;f++){let b=a.blocks[f];if(sL(b))return(0,Xe.isSectionSchema)(s)&&e.add(s.name),null;if(b.type!==t)continue;let C=(0,Xe.nodeAtPath)(l,["blocks",f,"type"]);h.push({annotationId:Jo,newText:r,range:Ko.Range.create(o.positionAt(c+C.loc.start.offset+1),o.positionAt(c+C.loc.end.offset-1))})}let p=(f,b)=>!f||!("blocks"in f)?[]:Array.isArray(f.blocks)?f.blocks.flatMap((C,D)=>{let P=p(C,[...b,"blocks",D]);if(C.type===t){let A=(0,Xe.nodeAtPath)(l,[...b,"blocks",D,"type"]);P.push({annotationId:Jo,newText:r,range:Ko.Range.create(o.positionAt(c+A.loc.start.offset+1),o.positionAt(c+A.loc.end.offset-1))})}return P}):typeof f.blocks=="object"?Object.entries(f.blocks).flatMap(([C,D])=>{let P=p(D,[...b,"blocks",C]);if(D.type===t){let A=(0,Xe.nodeAtPath)(l,[...b,"blocks",C,"type"]);P.push({annotationId:Jo,newText:r,range:Ko.Range.create(o.positionAt(c+A.loc.start.offset+1),o.positionAt(c+A.loc.end.offset-1))})}return P}):[];return a.presets&&h.push(...a.presets.flatMap((f,b)=>p(f,["presets",b]))),h.length===0?null:au(i,h)}}getTemplateChanges(e,t,r){return async i=>{let{textDocument:o,ast:s,source:a}=i,l=(0,Xe.parseJSON)(a);if(!l||(0,Xe.isError)(l)||(0,Xe.isError)(s))return null;let c=j_(e,t,o,s),h=(0,U_.isValidTemplate)(l)?Object.entries(l.sections).flatMap(([p,f])=>"blocks"in f&&f.blocks&&!r.has(f.type)?c(f.blocks,["sections",p,"blocks"]):[]):[];return h.length===0?null:au(i,h)}}getSectionGroupChanges(e,t,r){return async i=>{let{textDocument:o,ast:s,source:a}=i,l=(0,Xe.parseJSON)(a);if(!l||(0,Xe.isError)(l)||(0,Xe.isError)(s))return null;let c=j_(e,t,o,s),h=(0,U_.isValidSectionGroup)(l)?Object.entries(l.sections).flatMap(([p,f])=>"blocks"in f&&f.blocks&&!r.has(f.type)?c(f.blocks,["sections",p,"blocks"]):[]):[];return h.length===0?null:au(i,h)}}getContentForChanges(e,t){return async r=>{let{textDocument:i,ast:o}=r;if((0,Xe.isError)(o))return null;let s=(0,Xe.visit)(o,{LiquidTag(a){if(a.name!=="content_for"||typeof a.markup=="string"||a.markup.contentForType.value!=="block")return;let l=a.markup.args.find(c=>c.name==="type");if(!(!l||l.value.type!==oL.NodeTypes.String||l.value.value!==e))return{annotationId:Jo,newText:t,range:Ko.Range.create(i.positionAt(l.value.position.start+1),i.positionAt(l.value.position.end-1))}}});return s.length===0?null:au(r,s)}}};lu.BlockRenameHandler=Fv;function sL(n){return"name"in n&&typeof n.name=="string"}function j_(n,e,t,r){return function i(o,s){return o?Object.entries(o).flatMap(([a,l])=>{let c=i(l.blocks,[...s,a,"blocks"]);if(l.type===n){let h=(0,Xe.nodeAtPath)(r,[...s,a,"type"]);c.push({annotationId:Jo,newText:e,range:Ko.Range.create(t.positionAt(h.loc.start.offset+1),t.positionAt(h.loc.end.offset-1))})}return c}):[]}}function au(n,e){return{textDocument:{uri:n.uri,version:n.version??null},edits:e}}});var V_=w(hu=>{"use strict";d();Object.defineProperty(hu,"__esModule",{value:!0});hu.SectionRenameHandler=void 0;var _n=V(),cu=he(),Pv=Ei(),Xo=Pi(),B_=Ev(),du="renameSection",Iv=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(P=>(0,Xo.isSection)(P.oldUri)&&(0,Xo.isSection)(P.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(_n.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let o=this.documentManager.theme(i,!0),s=o.filter(Pv.isLiquidSourceCode),a=o.filter(Pv.isJsonSourceCode).filter(P=>(0,Xo.isTemplate)(P.uri)),l=o.filter(Pv.isJsonSourceCode).filter(P=>(0,Xo.isSectionGroup)(P.uri)),c=(0,Xo.sectionName)(r.oldUri),h=(0,Xo.sectionName)(r.newUri),p=`Rename section '${c}' to '${h}'`,f={documentChanges:[],changeAnnotations:{[du]:{label:p,needsConfirmation:!1}}},[b,C,D]=await Promise.all([Promise.all(a.map(this.getTemplateChanges(c,h))),Promise.all(l.map(this.getSectionGroupChanges(c,h))),Promise.all(s.map(this.getSectionTagChanges(c,h)))]);for(let P of[...b,...C])P!==null&&f.documentChanges.push(P);for(let P of D)if(P!==null){let A=f.documentChanges.find(S=>S.textDocument.uri===P?.textDocument.uri);A?A.edits.push(...P.edits):f.documentChanges.push(P)}if(f.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(cu.ApplyWorkspaceEditRequest.type,{label:p,edit:f})}getTemplateChanges(e,t){return async r=>{let{textDocument:i,ast:o,source:s}=r,a=(0,_n.parseJSON)(s);if(!a||(0,_n.isError)(a)||(0,_n.isError)(o))return null;let l=(0,B_.isValidTemplate)(a)?Object.entries(a.sections).filter(([c,h])=>h.type===e).map(([c])=>{let h=(0,_n.nodeAtPath)(o,["sections",c,"type"]);return{annotationId:du,newText:t,range:cu.Range.create(i.positionAt(h.loc.start.offset+1),i.positionAt(h.loc.end.offset-1))}}):[];return l.length===0?null:Mv(r,l)}}getSectionGroupChanges(e,t){return async r=>{let{textDocument:i,ast:o,source:s}=r,a=(0,_n.parseJSON)(s);if(!a||(0,_n.isError)(a)||(0,_n.isError)(o))return null;let l=(0,B_.isValidSectionGroup)(a)?Object.entries(a.sections).filter(([c,h])=>h.type===e).map(([c])=>{let h=(0,_n.nodeAtPath)(o,["sections",c,"type"]);return{annotationId:du,newText:t,range:cu.Range.create(i.positionAt(h.loc.start.offset+1),i.positionAt(h.loc.end.offset-1))}}):[];return l.length===0?null:Mv(r,l)}}getSectionTagChanges(e,t){return async r=>{let{textDocument:i,ast:o}=r;if((0,_n.isError)(o))return null;let s=(0,_n.visit)(o,{LiquidTag(a){if(a.name!=="section"||typeof a.markup=="string")return;let l=a.markup;if(l.value===e)return{annotationId:du,newText:t,range:cu.Range.create(i.positionAt(l.position.start+1),i.positionAt(l.position.end-1))}}});return s.length===0?null:Mv(r,s)}}};hu.SectionRenameHandler=Iv;function Mv(n,e){return{textDocument:{uri:n.uri,version:n.version??null},edits:e}}});var J_=w(pu=>{"use strict";d();Object.defineProperty(pu,"__esModule",{value:!0});pu.SnippetRenameHandler=void 0;var Nv=ee(),G_=V(),K_=he(),aL=Ei(),uu=Pi(),zv=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(f=>(0,uu.isSnippet)(f.oldUri)&&(0,uu.isSnippet)(f.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(G_.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let s=this.documentManager.theme(i,!0).filter(aL.isLiquidSourceCode),a=(0,uu.snippetName)(r.oldUri),l=(0,uu.snippetName)(r.newUri),c=`Rename snippet '${a}' to '${l}'`,h="renameSnippet",p={documentChanges:[],changeAnnotations:{[h]:{label:c,needsConfirmation:!1}}};for(let f of s){if(f.ast instanceof Error)continue;let b=f.textDocument,C=(0,G_.visit)(f.ast,{LiquidTag(D){if(D.name!==Nv.NamedTags.render&&D.name!==Nv.NamedTags.include||typeof D.markup=="string")return;let P=D.markup.snippet;if(P.type===Nv.NodeTypes.String&&P.value===a)return{newText:`${l}`,range:K_.Range.create(b.positionAt(P.position.start+1),b.positionAt(P.position.end-1))}}});C.length!==0&&p.documentChanges.push({textDocument:{uri:b.uri,version:f.version??null},annotationId:h,edits:C})}if(p.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(K_.ApplyWorkspaceEditRequest.type,{label:c,edit:p})}};pu.SnippetRenameHandler=zv});var X_=w(mu=>{"use strict";d();Object.defineProperty(mu,"__esModule",{value:!0});mu.RenameHandler=void 0;var lL=H_(),cL=$_(),dL=V_(),hL=J_(),Ov=class{handlers;constructor(e,t,r,i){this.handlers=[new hL.SnippetRenameHandler(r,e,t,i),new lL.AssetRenameHandler(r,e,t,i),new cL.BlockRenameHandler(r,e,t,i),new dL.SectionRenameHandler(r,e,t,i)]}async onDidRenameFiles(e){try{let t=this.handlers.map(r=>r.onDidRenameFiles(e));await Promise.all(t)}catch(t){console.error(t);return}}};mu.RenameHandler=Ov});var Q_=w((C7,uL)=>{uL.exports={name:"@shopify/theme-language-server-common",version:"2.21.4",main:"dist/index.js",types:"dist/index.d.ts",author:"CP Clermont <cp.clermont@shopify.com>",homepage:"https://github.com/Shopify/theme-tools/tree/main/packages/theme-language-server-common#readme",repository:{type:"git",url:"git+https://github.com/Shopify/theme-tools.git",directory:"packages/theme-language-server-common"},bugs:{url:"https://github.com/Shopify/theme-tools/issues"},license:"MIT",publishConfig:{access:"public","@shopify:registry":"https://registry.npmjs.org"},dependencies:{"@shopify/liquid-html-parser":"^2.9.2","@shopify/theme-check-common":"3.27.0","@shopify/theme-graph":"^0.2.8","@vscode/web-custom-data":"^0.4.6","vscode-css-languageservice":"6.3.2","vscode-json-languageservice":"^5.3.10","vscode-jsonrpc":"^8.1.0","vscode-languageserver":"^8.0.2","vscode-languageserver-textdocument":"^1.0.8","vscode-uri":"^3.0.7"},devDependencies:{"@types/node":"^22.18.8","@vitest/expect":"4.1.0"},scripts:{build:"pnpm build:ts","build:ci":"pnpm build","build:ts":"tsc -b src/tsconfig.build.json",dev:"tsc -b src --watch",test:"vitest","type-check":"tsc --noEmit -p src/tsconfig.json"}}});var Y_=w(Qo=>{"use strict";d();var pL=Qo&&Qo.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.VERSION=void 0;var mL=pL(Q_());Qo.VERSION=mL.default.version});var Z_=w(fu=>{"use strict";d();Object.defineProperty(fu,"__esModule",{value:!0});fu.CachedFileSystem=void 0;var Lv=class{readFile;readDirectory;stat;constructor(e){this.readFile=Av(e.readFile.bind(e)),this.readDirectory=Av(e.readDirectory.bind(e)),this.stat=Av(e.stat.bind(e))}};fu.CachedFileSystem=Lv;function Av(n){let e=new Map;function t(r){return e.has(r)||e.set(r,n(r)),e.get(r)}return t.invalidate=r=>{e.delete(r)},t}});var nT=w(te=>{"use strict";d();Object.defineProperty(te,"__esModule",{value:!0});te.Configuration=te.ConfigurationKeys=te.PRELOAD_ON_BOOT=te.CHECK_ON_CHANGE=te.CHECK_ON_SAVE=te.CHECK_ON_OPEN=void 0;var eT=V(),tT=re();te.CHECK_ON_OPEN="themeCheck.checkOnOpen";te.CHECK_ON_SAVE="themeCheck.checkOnSave";te.CHECK_ON_CHANGE="themeCheck.checkOnChange";te.PRELOAD_ON_BOOT="themeCheck.preloadOnBoot";te.ConfigurationKeys=[te.CHECK_ON_OPEN,te.CHECK_ON_SAVE,te.CHECK_ON_CHANGE,te.PRELOAD_ON_BOOT];var qv=class{connection;capabilities;[te.CHECK_ON_OPEN]=!0;[te.CHECK_ON_SAVE]=!0;[te.CHECK_ON_CHANGE]=!0;[te.PRELOAD_ON_BOOT]=!0;constructor(e,t){this.connection=e,this.capabilities=t,this.connection=e,this.capabilities=t}setup(){this[te.CHECK_ON_OPEN]=this.capabilities.initializationOption(te.CHECK_ON_OPEN,!0),this[te.CHECK_ON_SAVE]=this.capabilities.initializationOption(te.CHECK_ON_SAVE,!0),this[te.CHECK_ON_CHANGE]=this.capabilities.initializationOption(te.CHECK_ON_CHANGE,!0),this[te.PRELOAD_ON_BOOT]=this.capabilities.initializationOption(te.PRELOAD_ON_BOOT,!0)}async shouldCheckOnOpen(){return await this.fetchConfiguration(),this[te.CHECK_ON_OPEN]}async shouldCheckOnSave(){return await this.fetchConfiguration(),this[te.CHECK_ON_SAVE]}async shouldCheckOnChange(){return await this.fetchConfiguration(),this[te.CHECK_ON_CHANGE]}async shouldPreloadOnBoot(){return await this.fetchConfiguration(),this[te.PRELOAD_ON_BOOT]}clearCache(){this.fetchConfiguration.clearCache()}fetchConfiguration=(0,eT.memo)(async()=>{if(!this.capabilities.hasWorkspaceConfigurationSupport)return;let e=await this.connection.workspace.getConfiguration(te.ConfigurationKeys.map(t=>({section:t})));for(let t=0;t<te.ConfigurationKeys.length;t++){let r=te.ConfigurationKeys[t];e[t]!==null&&(this[r]=e[t])}});registerDidChangeCapability=(0,eT.memo)(async()=>{if(this.capabilities.hasDidChangeConfigurationDynamicRegistrationSupport)return this.connection.client.register(tT.DidChangeConfigurationNotification.type)});registerDidChangeWatchedFilesNotification=async e=>{if(this.capabilities.hasDidChangeWatchedFilesDynamicRegistrationSupport)return this.connection.client.register(tT.DidChangeWatchedFilesNotification.type,e)}};te.Configuration=qv});var rT=w(gu=>{"use strict";d();Object.defineProperty(gu,"__esModule",{value:!0});gu.safe=void 0;var fL=(n,e)=>async function(...r){try{return await n(...r)}catch{return e}};gu.safe=fL});var iT=w(bu=>{"use strict";d();Object.defineProperty(bu,"__esModule",{value:!0});bu.ThemeGraphManager=void 0;var Yo=V(),Wv=CT(),gL=(qa(),Bt(La)),bL=(is(),Bt(Aa)),vL=el(),yL=It(),Hv=class{connection;documentManager;fs;findThemeRootURI;getModeForURI;graphs=new Map;constructor(e,t,r,i,o=async()=>"theme"){this.connection=e,this.documentManager=t,this.fs=r,this.findThemeRootURI=i,this.getModeForURI=o}async getThemeGraphForURI(e){let t=await this.findThemeRootURI(e);if(t)return this.graphs.has(t)||this.graphs.set(t,this.buildThemeGraph(t)),this.graphs.get(t)}async getReferences(e,t,{includeIndirect:r=!0,includePreset:i=!0}={}){let o=await this.getThemeGraphForURI(e);if(!o)return[];let s=o.modules[e];if(!s)return[];let a=["direct",r?"indirect":void 0,i?"preset":void 0],l=s.references.filter(c=>a.includes(c.type));return Promise.all(l.map(async c=>{let[h,p]=await Promise.all([this.augmentedLocation(c.source),this.augmentedLocation(c.target)]);return{...c,source:h,target:p}}))}async getDependencies(e,t,{includeIndirect:r=!0,includePreset:i=!0}={}){let o=await this.getThemeGraphForURI(e);if(!o)return[];let s=o.modules[e];if(s||(s=(await this.buildThemeGraph(o.rootUri,[e])).modules[e]),!s)return[];let a=["direct",r?"indirect":void 0,i?"preset":void 0],l=s.dependencies.filter(c=>a.includes(c.type))??[];return Promise.all(l.map(async c=>{let[h,p]=await Promise.all([this.augmentedLocation(c.source),this.augmentedLocation(c.target)]);return{...c,source:h,target:p}}))}async augmentedLocation(e){let t=await this.getSourceCode(e.uri).catch(()=>{}),{uri:r,range:i}=e;if(!t||!i)return{exists:!!t,...e};let o=this.documentManager.get(e.uri)?.textDocument;return o||(o=bL.TextDocument.create(t.uri,t.type,0,t.source)),{uri:r,range:i,excerpt:t.source.slice(i[0],i[1]),position:gL.Range.create(o.positionAt(i[0]),o.positionAt(i[0])),exists:!0}}async deadCode(e){let t=await this.getThemeGraphForURI(e);if(!t)return[];let r=await(0,Yo.recursiveReadDirectory)(this.fs,e,([o])=>["assets","blocks","layout","sections","snippets","templates"].some(s=>o.startsWith(Yo.path.join(e,s)))&&(o.endsWith(".liquid")||o.endsWith(".json")||o.endsWith(".js")||o.endsWith(".css"))),i=new Set;for(let o of r)t.modules[o]||i.add(o);return Array.from(i).sort()}operationQueue=[];async rename(e,t){this.operationQueue.push(e),this.operationQueue.push(t),this.processQueue()}async change(e){this.operationQueue.push(e),this.processQueue()}async create(e){this.operationQueue.push(e),this.processQueue()}async delete(e){this.operationQueue.push(e),this.processQueue()}processQueue=(0,yL.debounce)(async()=>{let e=[...new Set(this.operationQueue.splice(0,this.operationQueue.length))];if(e.length===0)return;let t=e[0],r=await this.findThemeRootURI(t);!r||!await this.graphs.get(r)||(this.graphs.delete(r),await this.getThemeGraphForURI(r),this.connection.sendNotification(vL.ThemeGraphDidUpdateNotification.type,{uri:r}))},500);buildThemeGraph=async(e,t)=>{let{documentManager:r}=this;await r.preload(e);let i=await this.graphDependencies(e);return(0,Wv.buildThemeGraph)(e,i,t)};getSourceCode=async e=>{let t=this.documentManager.get(e);if(t)return t;let r=await this.fs.readFile(e);return(0,Wv.toSourceCode)(e,r)};getWebComponentMap(e){let{fs:t,getSourceCode:r}=this;return(0,Wv.getWebComponentMap)(e,{fs:t,getSourceCode:r})}async graphDependencies(e){let{documentManager:t,fs:r,getSourceCode:i}=this,[o,s]=await Promise.all([this.getWebComponentMap(e),this.getModeForURI(e)]);return{fs:r,getSourceCode:i,mode:s,async getBlockSchema(a){let l=Yo.path.join(e,"blocks",`${a}.liquid`),c=t.get(l);if(!(!c||c.type!==Yo.SourceCodeType.LiquidHtml))return await c.getSchema()},async getSectionSchema(a){let l=Yo.path.join(e,"sections",`${a}.liquid`),c=t.get(l);if(!(!c||c.type!==Yo.SourceCodeType.LiquidHtml))return await c.getSchema()},getWebComponentDefinitionReference(a){return o.get(a)}}}};bu.ThemeGraphManager=Hv});var lT=w(jv=>{"use strict";d();Object.defineProperty(jv,"__esModule",{value:!0});jv.startServer=WL;var be=V(),Ra=re(),wL=zS(),oT=ZS(),sT=tc(),SL=ok(),xL=NC(),kL=HC(),aT=$C(),CL=ZC(),_L=n1(),TL=Ei(),RL=p1(),EL=q1(),DL=__(),FL=F_(),PL=L_(),ML=X_(),vu=el(),IL=It(),NL=Pi(),zL=Y_(),OL=Z_(),AL=nT(),Uv=rT(),LL=iT(),qL=()=>{},at=n=>"textDocument"in n&&"uri"in n.textDocument&&typeof n.textDocument.uri=="string"&&(n.textDocument.uri.startsWith("jj:")||n.textDocument.uri.startsWith("git:")||n.textDocument.uri.startsWith("output:"));function WL(n,{fs:e,loadConfig:t,log:r=qL,jsonValidationSet:i,themeDocset:o,fetchMetafieldDefinitionsForURI:s}){let a=new OL.CachedFileSystem(e),l=(0,be.makeFileExists)(a),c=(0,be.memoize)(t,_=>_),h=new wL.ClientCapabilities,p=new AL.Configuration(n,h),f=new TL.DocumentManager(a,n,h,Ut,xr),b=new LL.ThemeGraphManager(n,f,a,q,Ut),C=new aT.DiagnosticsManager(n),D=new _L.DocumentLinksProvider(f,q),P=new oT.CodeActionsProvider(f,C),A=new RL.OnTypeFormattingProvider(f,async function(L,W){h.hasShowDocumentSupport&&n.sendRequest(Ra.ShowDocumentRequest.type,{uri:L.uri,takeFocus:!0,selection:{start:W,end:W}})}),S=new FL.LinkedEditingRangesProvider(f),y=new CL.DocumentHighlightsProvider(f),R=new PL.RenameProvider(n,h,f,q),N=new ML.RenameHandler(n,h,f,q);async function q(_){let L=await(0,be.findRoot)(_,l);return L?(await c(L,a)).rootUri:null}let Se=(0,be.memoize)((0,be.makeGetMetafieldDefinitions)(a),_=>_),De=async _=>{let L=await q(_);return L?Se(L):{}},Wt=new be.AugmentedThemeDocset(o),Dt=new xL.CSSLanguageService(f),kt=(0,IL.debounce)((0,aT.makeRunChecks)(f,C,{fs:a,loadConfig:c,themeDocset:Wt,jsonValidationSet:i,getMetafieldDefinitions:De,cssLanguageService:Dt,themeGraphManager:b}),100),Ct=async _=>{let L=await q(_);if(!L)return{};let W=f.theme(L),G=(0,be.makeGetDefaultTranslations)(a,W,L),[Re,_t]=await Promise.all([G(),Wt.systemTranslations()]);return{..._t,...Re}},wr=async _=>{let L=await q(_);if(!L)return{};let W=f.theme(L);return(0,be.makeGetDefaultSchemaTranslations)(a,W,L)()},ni=async(_,L,W)=>{let G=await q(_);if(!G)return;let Re=be.path.join(G,L,`${W}.liquid`),_t=f.get(Re);if(!(!_t||_t.type!==be.SourceCodeType.LiquidHtml||(0,be.isError)(_t.ast)))return _t.getLiquidDoc()},Ht=([_])=>/\.liquid$/.test(_)&&/snippets/.test(_),Ft=(0,Uv.safe)(async _=>{let L=await q(_);return L?(await(0,be.recursiveReadDirectory)(a,L,Ht)).map(NL.snippetName):[]},[]),Sr=(0,Uv.safe)(async _=>{let L=await q(_);if(!L)return[];let W=be.path.join(L,"config","settings_schema.json"),G=await a.readFile(W),Re=(0,be.parseJSON)(G);if((0,be.isError)(Re)||!Array.isArray(Re))throw new Error("Settings JSON file not in correct format");return Re},[]);async function Ut(_){let L=await(0,be.findRoot)(_,l);return L?(await c(L,a)).context:"theme"}let Rn=(0,Uv.safe)(async(_,L)=>{let W=await q(_);if(!W)return[];let Re=(await a.readDirectory(be.path.join(W,"blocks"))).map(([_t])=>be.path.basename(_t,".liquid"));return L?Re:Re.filter(_t=>!_t.startsWith("_"))},[]);async function pt(_,L){let W=await q(_);if(!W)return;let G=be.path.join(W,"blocks",`${L}.liquid`),Re=f.get(G);if(!(!Re||Re.type!==be.SourceCodeType.LiquidHtml))return Re.getSchema()}async function xr(_,L){return ri.isValidSchema(_,L)}let Zo=(0,be.makeGetDefaultLocaleFileUri)(a);async function Mi(_){let L=await q(_);if(!L)return null;let W=await Zo(L);return W?f.get(W)??null:null}let Ii=(0,be.makeGetDefaultSchemaLocaleFileUri)(a);async function Ni(_){let L=await q(_);if(!L)return null;let W=await Ii(L);return W?f.get(W)??null:null}let ku=new kL.DefinitionProvider(f,Mi,Ni),ri=new DL.JSONLanguageService(f,i,wr,Ut,Rn,pt,q),Cu=new SL.CompletionsProvider({documentManager:f,themeDocset:Wt,getTranslationsForURI:Ct,getSnippetNamesForURI:Ft,getThemeSettingsSchemaForURI:Sr,log:r,getThemeBlockNames:Rn,getMetafieldDefinitions:De,getDocDefinitionForURI:ni,getModeForURI:Ut}),_u=new EL.HoverProvider(f,Wt,De,Ct,Sr,ni,Ut),Tu=new sT.ExecuteCommandProvider(f,C,h,kt,n),Da=async _=>{if(s)for(let L of _)await Ut(L.uri)==="theme"&&s(L.uri)};n.onInitialize(_=>{h.setup(_.capabilities,_.initializationOptions),Dt.setup(_.capabilities),ri.setup(_.capabilities),p.setup();let L={filters:[{pattern:{glob:"**/*.{liquid,json}"}},{pattern:{glob:"**/assets/*"}}]};return{capabilities:{textDocumentSync:{change:Ra.TextDocumentSyncKind.Full,save:!0,openClose:!0},codeActionProvider:{codeActionKinds:[...oT.CodeActionKinds]},completionProvider:{triggerCharacters:[".","{{ ","{% ","<","/","[",'"',"'",":","@"]},definitionProvider:!0,documentOnTypeFormattingProvider:{firstTriggerCharacter:" ",moreTriggerCharacter:["{","%","-",">"]},documentLinkProvider:{resolveProvider:!1,workDoneProgress:!1},documentHighlightProvider:!0,linkedEditingRangeProvider:!0,renameProvider:{prepareProvider:!0},executeCommandProvider:{commands:[...sT.Commands]},hoverProvider:{workDoneProgress:!1},workspace:{workspaceFolders:{supported:!0,changeNotifications:!0},fileOperations:{didRename:L}}},serverInfo:{name:"theme-language-server",version:zL.VERSION}}}),n.onInitialized(()=>{r("[SERVER] Let's roll!"),p.fetchConfiguration(),p.registerDidChangeCapability(),p.registerDidChangeWatchedFilesNotification({watchers:[{globPattern:"**/.theme-check.yml"},{globPattern:"**/.shopify/*"},{globPattern:"**/*.liquid"},{globPattern:"**/assets/*.css"},{globPattern:"**/{locales,sections,templates,customers}/*.json"},{globPattern:"**/config/settings_{data,schema}.json"}]}),h.hasWorkspaceFoldersSupport&&(n.workspace.getWorkspaceFolders().then(async _=>{_&&Da(_)}),n.workspace.onDidChangeWorkspaceFolders(async _=>{Da(_.added)}))}),n.onDidChangeConfiguration(_=>{p.clearCache()}),n.onDidOpenTextDocument(async _=>{if(at(_))return;let{uri:L,text:W,version:G}=_.textDocument;if(f.open(L,W,G),await p.shouldCheckOnOpen()&&kt([L]),await p.shouldPreloadOnBoot()){let Re=await q(L);Re&&f.preload(Re)}}),n.onDidChangeTextDocument(async _=>{if(at(_))return;let{uri:L,version:W}=_.textDocument;f.change(L,_.contentChanges[0].text,W),await p.shouldCheckOnChange()?kt([L]):C.clear(_.textDocument.uri)}),n.onDidSaveTextDocument(async _=>{if(at(_))return;let{uri:L}=_.textDocument;await p.shouldCheckOnSave()&&kt([L])}),n.onDidCloseTextDocument(_=>{if(at(_))return;let{uri:L}=_.textDocument;f.close(L),C.clear(L)}),n.onDocumentLinks(async _=>{if(at(_))return[];let[L,W]=await Promise.all([D.documentLinks(_.textDocument.uri),ri.documentLinks(_)]);return[...L,...W]}),n.onDefinition(async _=>at(_)?[]:ku.definitions(_)),n.onCodeAction(async _=>P.codeActions(_)),n.onExecuteCommand(async _=>{await Tu.execute(_)}),n.onCompletion(async _=>at(_)?[]:await Dt.completions(_)??await ri.completions(_)??await Cu.completions(_)),n.onHover(async _=>at(_)?null:await Dt.hover(_)??await ri.hover(_)??await _u.hover(_)),n.onDocumentOnTypeFormatting(async _=>at(_)?null:A.onTypeFormatting(_)),n.onDocumentHighlight(async _=>at(_)?[]:y.documentHighlights(_)),n.onPrepareRename(async _=>at(_)?null:R.prepare(_)),n.onRenameRequest(async _=>at(_)?null:R.rename(_)),n.languages.onLinkedEditingRange(async _=>at(_)?null:S.linkedEditingRanges(_)),n.workspace.onDidRenameFiles(async _=>{let L=_.files.map(W=>W.newUri);for(let{oldUri:W,newUri:G}of _.files)f.rename(W,G),a.readDirectory.invalidate(be.path.dirname(W)),a.readDirectory.invalidate(be.path.dirname(G)),a.readFile.invalidate(W),a.readFile.invalidate(G),a.stat.invalidate(W),a.stat.invalidate(G),b.rename(W,G);await N.onDidRenameFiles(_),kt.force(L)}),n.onDidChangeWatchedFiles(async _=>{if(_.changes.length===0)return;let L=_.changes.map(G=>G.uri),W=[];for(let G of _.changes){if(G.uri.endsWith(".theme-check.yml")){c.clearCache();continue}if(f.hasRecentRename(G.uri)){f.clearRecentRename(G.uri);continue}switch(G.type){case Ra.FileChangeType.Created:a.readDirectory.invalidate(be.path.dirname(G.uri)),a.readFile.invalidate(G.uri),a.stat.invalidate(G.uri),b.create(G.uri),W.push(f.changeFromDisk(G.uri));break;case Ra.FileChangeType.Changed:a.readFile.invalidate(G.uri),a.stat.invalidate(G.uri),b.change(G.uri),f.get(G.uri)?.version===void 0&&W.push(f.changeFromDisk(G.uri));break;case Ra.FileChangeType.Deleted:a.readDirectory.invalidate(be.path.dirname(G.uri)),a.readFile.invalidate(G.uri),a.stat.invalidate(G.uri),b.delete(G.uri),f.delete(G.uri);break}G.uri.endsWith("metafields.json")&&W.push(q(G.uri).then(Re=>{Re&&Se.invalidate(Re)}))}await Promise.all(W),kt.force(L)}),n.onRequest(vu.ThemeGraphReferenceRequest.type,async _=>{if(at(_))return[];let{uri:L,offset:W,includeIndirect:G}=_;return b.getReferences(L,W,{includeIndirect:G}).catch(Re=>[])}),n.onRequest(vu.ThemeGraphDependenciesRequest.type,async _=>{if(at(_))return[];let{uri:L,offset:W,includeIndirect:G}=_;return b.getDependencies(L,W,{includeIndirect:G}).catch(Re=>[])}),n.onRequest(vu.ThemeGraphRootRequest.type,async _=>{if(at(_))return"";let{uri:L}=_,W=await q(L).catch(G=>{});return(!W||be.path.dirname(W)===W)&&console.error(L),W}),n.onRequest(vu.ThemeGraphDeadCodeRequest.type,async _=>{if(at(_))return[];let{uri:L}=_,W=await q(L);return W?await b.deadCode(W):[]}),n.listen()}});var cT=w(yu=>{"use strict";d();Object.defineProperty(yu,"__esModule",{value:!0});yu.startServer=void 0;var HL=lT();Object.defineProperty(yu,"startServer",{enumerable:!0,get:function(){return HL.startServer}})});var Su=w(Te=>{"use strict";d();var UL=Te&&Te.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),jL=Te&&Te.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&UL(e,n,t)};Object.defineProperty(Te,"__esModule",{value:!0});Te.SourceCodeType=Te.FileType=Te.allChecks=Te.recommendedChecks=Te.startServer=Te.parseJSON=Te.memo=Te.debounce=Te.visit=void 0;var wu=V();Object.defineProperty(Te,"allChecks",{enumerable:!0,get:function(){return wu.allChecks}});Object.defineProperty(Te,"recommendedChecks",{enumerable:!0,get:function(){return wu.recommended}});Object.defineProperty(Te,"FileType",{enumerable:!0,get:function(){return wu.FileType}});Object.defineProperty(Te,"SourceCodeType",{enumerable:!0,get:function(){return wu.SourceCodeType}});jL(el(),Te);var $L=V();Object.defineProperty(Te,"visit",{enumerable:!0,get:function(){return $L.visit}});var $v=It();Object.defineProperty(Te,"debounce",{enumerable:!0,get:function(){return $v.debounce}});Object.defineProperty(Te,"memo",{enumerable:!0,get:function(){return $v.memo}});Object.defineProperty(Te,"parseJSON",{enumerable:!0,get:function(){return $v.parseJSON}});var BL=cT();Object.defineProperty(Te,"startServer",{enumerable:!0,get:function(){return BL.startServer}})});var hT=w((H7,dT)=>{"use strict";d();dT.exports=re()});var pT=w(xu=>{"use strict";d();Object.defineProperty(xu,"__esModule",{value:!0});xu.loadConfig=void 0;var Tn=Eu(),VL=Su(),Ea=Fa();function uT(n){return Ea.URI.isUri(n)?n.fsPath:/^file:/i.test(n)?Ea.URI.parse(n).fsPath:Ea.URI.file(n).fsPath}var GL=async(n,e)=>(await(0,Tn.recursiveReadDirectory)(e,n,([r])=>r.endsWith(".extension.toml"))).length>0,KL=async function(e,t){let r=Tn.path.normalize(e),i=(0,Tn.makeFileExists)(t),o=await(0,Tn.findRoot)(r,i);if(!o)throw new Error(`Could not find theme root for ${r}`);let s=Ea.URI.parse(o),a=s.scheme,l=Ea.Utils.joinPath(s,".theme-check.yml"),[c,h]=await Promise.all([i(Tn.path.normalize(l)),GL(Tn.path.normalize(s),t)]);if(a==="file"){let p=uT(l),f=uT(s);return c?(0,Tn.loadConfig)(p,f).then(Bv):h?(0,Tn.loadConfig)("theme-check:theme-app-extension",f).then(Bv):(0,Tn.loadConfig)(void 0,f).then(Bv)}else return{checks:VL.recommendedChecks,settings:{},context:h?"app":"theme",rootUri:Tn.path.normalize(s)}};xu.loadConfig=KL;function Bv(n){return n.rootUri=Tn.path.normalize(n.rootUri),n}});var mT=w(vr=>{"use strict";d();var JL=vr&&vr.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),XL=vr&&vr.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),QL=vr&&vr.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&JL(t,e,r[i]);return XL(t,e),t}})();Object.defineProperty(vr,"__esModule",{value:!0});vr.fetchMetafieldDefinitionsForURI=nq;var YL=QL(jt("child_process")),ZL=jt("node:util"),Vv=(0,ZL.promisify)(YL.exec),eq=process.platform==="win32",tq=rq();async function nq(n){try{let e=await tq;if(!e)return;await Vv(`${e} theme metafields pull`,{cwd:new URL(n),timeout:1e4,env:{...process.env,SHOPIFY_LANGUAGE_SERVER:"1"}})}catch{}}async function rq(){if(process.env.NODE_ENV!=="test")try{if(eq){let{stdout:n}=await Vv("where.exe shopify"),e=n.replace(/\r/g,"").split(`
558
558
  `).filter(t=>t.endsWith("bat"));return e.length>0?e[0]:""}else{let{stdout:n}=await Vv("which shopify");return n.split(`
559
559
  `)[0].replace("\r","")}}catch{return}}});var gT=w(qt=>{"use strict";d();var iq=qt&&qt.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),oq=qt&&qt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&iq(e,n,t)};Object.defineProperty(qt,"__esModule",{value:!0});qt.getConnection=qt.NodeFileSystem=void 0;qt.startServer=mq;var sq=_T(),aq=Eu(),lq=Su(),fT=jt("node:process"),cq=hT(),dq=pT(),hq=mT(),uq=Eu();Object.defineProperty(qt,"NodeFileSystem",{enumerable:!0,get:function(){return uq.NodeFileSystem}});oq(Su(),qt);var pq=()=>(0,cq.createConnection)(fT.stdin,fT.stdout);qt.getConnection=pq;function mq(n=(0,qt.getConnection)(),e=aq.NodeFileSystem){let t=i=>console.error(i),r=new sq.ThemeLiquidDocsManager(t);(0,lq.startServer)(n,{fs:e,log:t,loadConfig:dq.loadConfig,themeDocset:r,jsonValidationSet:r,fetchMetafieldDefinitionsForURI:hq.fetchMetafieldDefinitionsForURI})}});d();var vT=$t(gT(),1),bT,yr=class extends Yv{async command(){(0,vT.startServer)()}};bT=yr;yr.summary="Start a Language Server Protocol server.";yr.descriptionWithMarkdown="Starts the [Language Server](https://shopify.dev/docs/themes/tools/cli/language-server).";yr.description=bT.descriptionWithoutMarkdown();yr.flags={...Qv};yr.multiEnvironmentsFlags=null;var Q7=yr;export{Q7 as a};
@@ -1 +1 @@
1
- import{a as c,b as f,c as g,d as x,g as C}from"./chunk-DKKBJ4H5.js";import{a as d}from"./chunk-6ZRHK4ON.js";import{a as l}from"./chunk-7XQDZF73.js";import{Fa as m}from"./chunk-UZ7U322K.js";import{b as p}from"./chunk-Q6LCSRIW.js";import{v as s}from"./chunk-E24W34C4.js";import{r as I}from"./chunk-T6CC5WUU.js";import{e as y,g as a}from"./chunk-VKWPEFWQ.js";a();var h=y(I(),1);var i=class u extends d{async run(){let{flags:o}=await this.parse(u),e=await m({directory:o.path,clientId:o["client-id"],forceRelink:o.reset,userProvidedConfigName:o.config}),t=await C({developerPlatformClient:e.developerPlatformClient,apiKey:e.remoteApp.apiKey,organizationId:e.remoteApp.organizationId,extensionTypes:g}),n=c(t);if(n.length===0)s({headline:["No extensions to migrate."]});else{let r=await f(n);await x({...e,extensions:t,extensionTypes:r.extensionTypes,buildExtensionConfig:r.buildExtensionConfig})}return{app:e.app}}};i.description="Import dashboard-managed extensions into your app.";i.flags={...p,...l,"client-id":h.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]})};var k=i;export{k as a};
1
+ import{a as c,b as f,c as g,d as x,g as C}from"./chunk-EAOT5CK5.js";import{a as d}from"./chunk-UHIP5CFI.js";import{a as l}from"./chunk-VJQJ5PTQ.js";import{Fa as m}from"./chunk-4MLEL3VK.js";import{b as p}from"./chunk-NGCPVRDM.js";import{v as s}from"./chunk-EEEKSYWV.js";import{r as I}from"./chunk-T6CC5WUU.js";import{e as y,g as a}from"./chunk-VKWPEFWQ.js";a();var h=y(I(),1);var i=class u extends d{async run(){let{flags:o}=await this.parse(u),e=await m({directory:o.path,clientId:o["client-id"],forceRelink:o.reset,userProvidedConfigName:o.config}),t=await C({developerPlatformClient:e.developerPlatformClient,apiKey:e.remoteApp.apiKey,organizationId:e.remoteApp.organizationId,extensionTypes:g}),n=c(t);if(n.length===0)s({headline:["No extensions to migrate."]});else{let r=await f(n);await x({...e,extensions:t,extensionTypes:r.extensionTypes,buildExtensionConfig:r.buildExtensionConfig})}return{app:e.app}}};i.description="Import dashboard-managed extensions into your app.";i.flags={...p,...l,"client-id":h.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]})};var k=i;export{k as a};