@moritzwilksch/diffle 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +140 -0
  3. package/dist/client/assets/abap-CLvhMVsD.js +1 -0
  4. package/dist/client/assets/actionscript-3-Cs6JJXT5.js +1 -0
  5. package/dist/client/assets/ada-C5qYipkI.js +1 -0
  6. package/dist/client/assets/ahk-CA9gdOdF.js +1 -0
  7. package/dist/client/assets/ahk2-_6rzW9BS.js +1 -0
  8. package/dist/client/assets/andromeeda-vGVdxbeo.js +1 -0
  9. package/dist/client/assets/angular-html-CaJwV7TV.js +1 -0
  10. package/dist/client/assets/angular-ts-CkYaPIdV.js +1 -0
  11. package/dist/client/assets/apache-U0d_L8uA.js +1 -0
  12. package/dist/client/assets/apex-KFGFyKwG.js +1 -0
  13. package/dist/client/assets/apl-CpcAFeKm.js +1 -0
  14. package/dist/client/assets/applescript-CCn79oCD.js +1 -0
  15. package/dist/client/assets/ara-4CJ0cIlV.js +1 -0
  16. package/dist/client/assets/asciidoc-SCjQUq34.js +1 -0
  17. package/dist/client/assets/asm-Cmm7eHzH.js +1 -0
  18. package/dist/client/assets/astro-CW_unGoj.js +1 -0
  19. package/dist/client/assets/aurora-x-CDeNXAV0.js +1 -0
  20. package/dist/client/assets/awk-BWXHIvNe.js +1 -0
  21. package/dist/client/assets/ayu-dark-DluEY0Gj.js +1 -0
  22. package/dist/client/assets/ayu-light-C3h-C4tm.js +1 -0
  23. package/dist/client/assets/ayu-mirage-Bqwy1Gya.js +1 -0
  24. package/dist/client/assets/ballerina-B7ZEbQpA.js +1 -0
  25. package/dist/client/assets/bat-qdxAdBWQ.js +1 -0
  26. package/dist/client/assets/beancount-D-usSTwE.js +1 -0
  27. package/dist/client/assets/berry-DKpUyyne.js +1 -0
  28. package/dist/client/assets/bibtex-Ci_nEsc7.js +1 -0
  29. package/dist/client/assets/bicep-CUHmPFLl.js +1 -0
  30. package/dist/client/assets/bird2-CYIUgYqB.js +1 -0
  31. package/dist/client/assets/blade-CoMjczKU.js +1 -0
  32. package/dist/client/assets/bsl-_VjlB9mv.js +1 -0
  33. package/dist/client/assets/c-Dl4Fx4zB.js +1 -0
  34. package/dist/client/assets/c3-D0apG41V.js +1 -0
  35. package/dist/client/assets/cadence-CQ2zXKGN.js +1 -0
  36. package/dist/client/assets/cairo-DLTphjLi.js +1 -0
  37. package/dist/client/assets/catppuccin-frappe-C9Q5zVZY.js +1 -0
  38. package/dist/client/assets/catppuccin-latte-CtsyrtPq.js +1 -0
  39. package/dist/client/assets/catppuccin-macchiato-R8nAf1vR.js +1 -0
  40. package/dist/client/assets/catppuccin-mocha-DjuaAJKi.js +1 -0
  41. package/dist/client/assets/chapel-D5ok9_yq.js +1 -0
  42. package/dist/client/assets/clarity-CtfBBspg.js +1 -0
  43. package/dist/client/assets/clojure-DqKBuwfJ.js +1 -0
  44. package/dist/client/assets/cmake-Bj61d0ZC.js +1 -0
  45. package/dist/client/assets/cobol-4i0HDNWU.js +1 -0
  46. package/dist/client/assets/codeowners-C8r90Shi.js +1 -0
  47. package/dist/client/assets/codeql-oeQT6MSM.js +1 -0
  48. package/dist/client/assets/coffee-BTpFkfue.js +1 -0
  49. package/dist/client/assets/common-lisp-Cv5bFMCO.js +1 -0
  50. package/dist/client/assets/coq-DuBRPxYg.js +1 -0
  51. package/dist/client/assets/cpp-Cfde_XNA.js +1 -0
  52. package/dist/client/assets/crystal-Bg0pobHe.js +1 -0
  53. package/dist/client/assets/csharp-oqKa8noW.js +1 -0
  54. package/dist/client/assets/css-DwVSVpMu.js +1 -0
  55. package/dist/client/assets/csv-Dx-8-gkx.js +1 -0
  56. package/dist/client/assets/cue-CE9AQfxI.js +1 -0
  57. package/dist/client/assets/cypher-ClKdZ_lG.js +1 -0
  58. package/dist/client/assets/d-qD-0Kul2.js +1 -0
  59. package/dist/client/assets/dark-plus-Cs2F2srj.js +1 -0
  60. package/dist/client/assets/dart-CnvKMtbv.js +1 -0
  61. package/dist/client/assets/dax-BkyTk9wS.js +1 -0
  62. package/dist/client/assets/desktop-Dlh5hvp9.js +1 -0
  63. package/dist/client/assets/diff-woXpYk--.js +1 -0
  64. package/dist/client/assets/docker-IyjqRm3v.js +1 -0
  65. package/dist/client/assets/dotenv-_5a1GRtc.js +1 -0
  66. package/dist/client/assets/dracula-BHWKrbxM.js +1 -0
  67. package/dist/client/assets/dracula-soft-5eyTD99u.js +1 -0
  68. package/dist/client/assets/dream-maker-DW3nJb8Q.js +1 -0
  69. package/dist/client/assets/edge-B1WmoAyP.js +1 -0
  70. package/dist/client/assets/elixir-DNd2HrCi.js +1 -0
  71. package/dist/client/assets/elm-D0koIXHj.js +1 -0
  72. package/dist/client/assets/emacs-lisp-c_oH4hRZ.js +1 -0
  73. package/dist/client/assets/erb-GqOwqr8c.js +1 -0
  74. package/dist/client/assets/erlang-Cphh6RMH.js +1 -0
  75. package/dist/client/assets/everforest-dark-sB-x3p7T.js +1 -0
  76. package/dist/client/assets/everforest-light-Df2xbC6M.js +1 -0
  77. package/dist/client/assets/fennel-DQxkIbk2.js +1 -0
  78. package/dist/client/assets/fish-BJitypiv.js +1 -0
  79. package/dist/client/assets/fluent-C03EYrpw.js +1 -0
  80. package/dist/client/assets/fortran-fixed-form-DEKoE2YW.js +1 -0
  81. package/dist/client/assets/fortran-free-form-CYNrtFtB.js +1 -0
  82. package/dist/client/assets/fsharp-D13ZGOAj.js +1 -0
  83. package/dist/client/assets/gdresource-xMC7jr7x.js +1 -0
  84. package/dist/client/assets/gdscript-DYvRD3hg.js +1 -0
  85. package/dist/client/assets/gdshader-CBce3t8t.js +1 -0
  86. package/dist/client/assets/genie-CV2tkWYe.js +1 -0
  87. package/dist/client/assets/gherkin-DExj1W_8.js +1 -0
  88. package/dist/client/assets/git-commit-BSykSTBG.js +1 -0
  89. package/dist/client/assets/git-rebase-BUtA34Bl.js +1 -0
  90. package/dist/client/assets/github-dark-C-LZuMrd.js +1 -0
  91. package/dist/client/assets/github-dark-default-DXG-b-1a.js +1 -0
  92. package/dist/client/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
  93. package/dist/client/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
  94. package/dist/client/assets/github-light-EUqPIrTm.js +1 -0
  95. package/dist/client/assets/github-light-default-BXViO-2h.js +1 -0
  96. package/dist/client/assets/github-light-high-contrast-B68TUdTA.js +1 -0
  97. package/dist/client/assets/gleam-CSRkHgEL.js +1 -0
  98. package/dist/client/assets/glimmer-js-CoUMy8hy.js +1 -0
  99. package/dist/client/assets/glimmer-ts-DsF-4AvK.js +1 -0
  100. package/dist/client/assets/glsl-AH2DoCfz.js +1 -0
  101. package/dist/client/assets/gn-ilITqXS6.js +1 -0
  102. package/dist/client/assets/gnuplot-7GGW24-e.js +1 -0
  103. package/dist/client/assets/go-rLFTqkRN.js +1 -0
  104. package/dist/client/assets/graphql-DT8jP-fK.js +1 -0
  105. package/dist/client/assets/groovy-CacY0gHj.js +1 -0
  106. package/dist/client/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
  107. package/dist/client/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
  108. package/dist/client/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
  109. package/dist/client/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
  110. package/dist/client/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
  111. package/dist/client/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
  112. package/dist/client/assets/hack-_XiyStr7.js +1 -0
  113. package/dist/client/assets/haml-hGrPpL3t.js +1 -0
  114. package/dist/client/assets/handlebars-ajgEXHEi.js +1 -0
  115. package/dist/client/assets/haskell-D8IpX4py.js +1 -0
  116. package/dist/client/assets/haxe-C8oCnwJJ.js +1 -0
  117. package/dist/client/assets/hcl-Dh228itO.js +1 -0
  118. package/dist/client/assets/hjson-CxZEssPk.js +1 -0
  119. package/dist/client/assets/hlsl-Cvrh5tZx.js +1 -0
  120. package/dist/client/assets/horizon-CE9ld1lL.js +1 -0
  121. package/dist/client/assets/horizon-bright-DSNQnXHK.js +1 -0
  122. package/dist/client/assets/houston-CsvMBhTu.js +1 -0
  123. package/dist/client/assets/html-CiMg0XLL.js +1 -0
  124. package/dist/client/assets/html-derivative-2sDnFJyw.js +1 -0
  125. package/dist/client/assets/http-8RU82qzQ.js +1 -0
  126. package/dist/client/assets/hurl-B8rylzKw.js +1 -0
  127. package/dist/client/assets/hxml-Dcm88srW.js +1 -0
  128. package/dist/client/assets/hy-CZbG8q4J.js +1 -0
  129. package/dist/client/assets/imba-DsUTQ-LC.js +1 -0
  130. package/dist/client/assets/index-D3lOJlto.css +1 -0
  131. package/dist/client/assets/index-D98vufWy.js +2896 -0
  132. package/dist/client/assets/ini-B5eOa1yu.js +1 -0
  133. package/dist/client/assets/java-DnSZzOMQ.js +1 -0
  134. package/dist/client/assets/javascript-BmM_EjC_.js +1 -0
  135. package/dist/client/assets/jinja-BWkqqyaH.js +1 -0
  136. package/dist/client/assets/jison-Ch4kKU1r.js +1 -0
  137. package/dist/client/assets/json-DQzba6hv.js +1 -0
  138. package/dist/client/assets/json5-BR5RXkoi.js +1 -0
  139. package/dist/client/assets/jsonc-CYpm1nAK.js +1 -0
  140. package/dist/client/assets/jsonl-CmCQp5Yx.js +1 -0
  141. package/dist/client/assets/jsonnet-CJTPZ8u_.js +1 -0
  142. package/dist/client/assets/jssm-DXw9l8Rf.js +1 -0
  143. package/dist/client/assets/jsx-C2RFZfSq.js +1 -0
  144. package/dist/client/assets/julia-DfG3dbpn.js +1 -0
  145. package/dist/client/assets/just-BdzcwoJ_.js +1 -0
  146. package/dist/client/assets/kanagawa-dragon-Bozd7klA.js +1 -0
  147. package/dist/client/assets/kanagawa-lotus-BmuOG9ZW.js +1 -0
  148. package/dist/client/assets/kanagawa-wave-BML5mF2J.js +1 -0
  149. package/dist/client/assets/kdl-CsD5j6eV.js +1 -0
  150. package/dist/client/assets/kotlin-DhhofPvG.js +1 -0
  151. package/dist/client/assets/kusto-C7mF5XQf.js +1 -0
  152. package/dist/client/assets/laserwave-C_8bwKvT.js +1 -0
  153. package/dist/client/assets/latex-CDOrdOrS.js +1 -0
  154. package/dist/client/assets/lean-CewbzKMR.js +1 -0
  155. package/dist/client/assets/less-DVTAwKKz.js +1 -0
  156. package/dist/client/assets/light-plus-DVQuIRkW.js +1 -0
  157. package/dist/client/assets/liquid-seYOlojK.js +1 -0
  158. package/dist/client/assets/llvm-DqHOMS-s.js +1 -0
  159. package/dist/client/assets/log-BNLmms1o.js +1 -0
  160. package/dist/client/assets/logo-Cluzi2Zq.js +1 -0
  161. package/dist/client/assets/lua-BLXud7HC.js +1 -0
  162. package/dist/client/assets/luau-C2pBCSgt.js +1 -0
  163. package/dist/client/assets/make-Dixweg8N.js +1 -0
  164. package/dist/client/assets/markdown-BYOwaDjH.js +1 -0
  165. package/dist/client/assets/marko-CDlW9Noh.js +1 -0
  166. package/dist/client/assets/material-theme-Bm3Qr25_.js +1 -0
  167. package/dist/client/assets/material-theme-darker-2IIEA8gg.js +1 -0
  168. package/dist/client/assets/material-theme-lighter-uhdI0v04.js +1 -0
  169. package/dist/client/assets/material-theme-ocean-CHQ94UKr.js +1 -0
  170. package/dist/client/assets/material-theme-palenight-B5W6OYN7.js +1 -0
  171. package/dist/client/assets/matlab-D7qyCx1q.js +1 -0
  172. package/dist/client/assets/mdc-ByNngFMV.js +1 -0
  173. package/dist/client/assets/mdx-DQZ5AkYe.js +1 -0
  174. package/dist/client/assets/mermaid-BxpfTIzt.js +1 -0
  175. package/dist/client/assets/min-dark-BSWPekZh.js +1 -0
  176. package/dist/client/assets/min-light-DDpmG2fV.js +1 -0
  177. package/dist/client/assets/mipsasm-BMqwQI7S.js +1 -0
  178. package/dist/client/assets/mojo-fg40_ntQ.js +1 -0
  179. package/dist/client/assets/monokai-B_bV9PQ9.js +1 -0
  180. package/dist/client/assets/moonbit-DgjMoLWr.js +1 -0
  181. package/dist/client/assets/move-BYnGhZoM.js +1 -0
  182. package/dist/client/assets/narrat-_X_XdTYD.js +1 -0
  183. package/dist/client/assets/nextflow-BJtWHP5T.js +1 -0
  184. package/dist/client/assets/nextflow-groovy-DJMQeKeT.js +1 -0
  185. package/dist/client/assets/nginx-UGj-HCuj.js +1 -0
  186. package/dist/client/assets/night-owl-DhmEMT88.js +1 -0
  187. package/dist/client/assets/night-owl-light-eJ-hLW7d.js +1 -0
  188. package/dist/client/assets/nim-WGnz_L4S.js +1 -0
  189. package/dist/client/assets/nix-IvuFDN5E.js +1 -0
  190. package/dist/client/assets/nord-Cb4Vim4T.js +1 -0
  191. package/dist/client/assets/nsis-CjNLYCLg.js +1 -0
  192. package/dist/client/assets/nushell-DHYfO66s.js +1 -0
  193. package/dist/client/assets/objective-c-D1A_Heim.js +1 -0
  194. package/dist/client/assets/objective-cpp-BsSzOQcm.js +1 -0
  195. package/dist/client/assets/ocaml-O90oeIOV.js +1 -0
  196. package/dist/client/assets/odin-B1RWQWA5.js +1 -0
  197. package/dist/client/assets/one-dark-pro-CLwyXe_n.js +1 -0
  198. package/dist/client/assets/one-light-D7Lr4KcI.js +1 -0
  199. package/dist/client/assets/openscad-BUDT5pXO.js +1 -0
  200. package/dist/client/assets/org--Q56RzaV.js +1 -0
  201. package/dist/client/assets/pascal-4ZHwLPI5.js +1 -0
  202. package/dist/client/assets/perl-C1sy1pky.js +1 -0
  203. package/dist/client/assets/php-XGcgOFlk.js +1 -0
  204. package/dist/client/assets/pierre-dark-CpLgRqie.js +1 -0
  205. package/dist/client/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +1 -0
  206. package/dist/client/assets/pierre-dark-soft-kZQmAZld.js +1 -0
  207. package/dist/client/assets/pierre-dark-tritanopia-CpjhbsIL.js +1 -0
  208. package/dist/client/assets/pierre-dark-vibrant-CpQYzh95.js +1 -0
  209. package/dist/client/assets/pierre-light-CoaEpmwp.js +1 -0
  210. package/dist/client/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +1 -0
  211. package/dist/client/assets/pierre-light-soft-lWLdNTOI.js +1 -0
  212. package/dist/client/assets/pierre-light-tritanopia-CEbqgOJL.js +1 -0
  213. package/dist/client/assets/pierre-light-vibrant-D80Fkn33.js +1 -0
  214. package/dist/client/assets/pkl-ot-7Btpt.js +1 -0
  215. package/dist/client/assets/plastic-DQwYfKfQ.js +1 -0
  216. package/dist/client/assets/plsql-DGHpHOYJ.js +1 -0
  217. package/dist/client/assets/po-BiJDBrnU.js +1 -0
  218. package/dist/client/assets/poimandres-DRFjx7u4.js +1 -0
  219. package/dist/client/assets/polar-C7UOKdEL.js +1 -0
  220. package/dist/client/assets/postcss-BXeXVLqQ.js +1 -0
  221. package/dist/client/assets/powerquery-DNMTfnFr.js +1 -0
  222. package/dist/client/assets/powershell-CCSX75yM.js +1 -0
  223. package/dist/client/assets/prisma-DMgNhnYS.js +1 -0
  224. package/dist/client/assets/prolog-iXnhIJG7.js +1 -0
  225. package/dist/client/assets/proto-DB4EqR-F.js +1 -0
  226. package/dist/client/assets/pug-B3wKWID3.js +1 -0
  227. package/dist/client/assets/puppet-CDv2pdJW.js +1 -0
  228. package/dist/client/assets/purescript-9MfHhQsQ.js +1 -0
  229. package/dist/client/assets/python-gzcpVVnB.js +1 -0
  230. package/dist/client/assets/qml-CxS5ImlR.js +1 -0
  231. package/dist/client/assets/qmldir-DCQb3MpD.js +1 -0
  232. package/dist/client/assets/qss-Fe1Jh2GI.js +1 -0
  233. package/dist/client/assets/r-CqHff9Km.js +1 -0
  234. package/dist/client/assets/racket-DcIDlBhZ.js +1 -0
  235. package/dist/client/assets/raku-B3gFvitq.js +1 -0
  236. package/dist/client/assets/razor-SIaUNZij.js +1 -0
  237. package/dist/client/assets/rbs-C0MpOrj4.js +1 -0
  238. package/dist/client/assets/red-DX1BQOs8.js +1 -0
  239. package/dist/client/assets/reg-CRGYupPL.js +1 -0
  240. package/dist/client/assets/regexp-UJ41rKpv.js +1 -0
  241. package/dist/client/assets/rel-BtDbiS_P.js +1 -0
  242. package/dist/client/assets/riscv-Ckw8ddFX.js +1 -0
  243. package/dist/client/assets/ron-VUp2lXgN.js +1 -0
  244. package/dist/client/assets/rose-pine-aMsaMD1D.js +1 -0
  245. package/dist/client/assets/rose-pine-dawn-8PwUyIlP.js +1 -0
  246. package/dist/client/assets/rose-pine-moon-DO-qXg-I.js +1 -0
  247. package/dist/client/assets/rosmsg-CAekHB0j.js +1 -0
  248. package/dist/client/assets/rst-QZZ7aawZ.js +1 -0
  249. package/dist/client/assets/ruby-B47xuou3.js +1 -0
  250. package/dist/client/assets/rust-Cfkwpbl8.js +1 -0
  251. package/dist/client/assets/sas-Cmj7-80_.js +1 -0
  252. package/dist/client/assets/sass-DXrisJhu.js +1 -0
  253. package/dist/client/assets/scala-BiFt_7mu.js +1 -0
  254. package/dist/client/assets/scheme-DQCgrYNe.js +1 -0
  255. package/dist/client/assets/scss-BSIEbXjd.js +1 -0
  256. package/dist/client/assets/sdbl-bTVj8UrX.js +1 -0
  257. package/dist/client/assets/shaderlab-TOUzSsQk.js +1 -0
  258. package/dist/client/assets/shellscript-Nto8YpA8.js +1 -0
  259. package/dist/client/assets/shellsession-B6ppX96l.js +1 -0
  260. package/dist/client/assets/slack-dark-DnToyrRv.js +1 -0
  261. package/dist/client/assets/slack-ochin-B2OO5cIa.js +1 -0
  262. package/dist/client/assets/smalltalk-BHpQb5nM.js +1 -0
  263. package/dist/client/assets/smithy-Dgaz7aur.js +1 -0
  264. package/dist/client/assets/snazzy-light-4G7pJPwS.js +1 -0
  265. package/dist/client/assets/solarized-dark-UdsmMDCL.js +1 -0
  266. package/dist/client/assets/solarized-light-C1IUL_tW.js +1 -0
  267. package/dist/client/assets/solidity-Bj7E1mRn.js +1 -0
  268. package/dist/client/assets/soy-DMVBQAtG.js +1 -0
  269. package/dist/client/assets/sparql-D_iOobhT.js +1 -0
  270. package/dist/client/assets/splunk-BC2Px7Mm.js +1 -0
  271. package/dist/client/assets/sql-CVjp9fSb.js +1 -0
  272. package/dist/client/assets/ssh-config-BgfXC-Er.js +1 -0
  273. package/dist/client/assets/stata-CUjSwXlo.js +1 -0
  274. package/dist/client/assets/stylus-B6D30XZt.js +1 -0
  275. package/dist/client/assets/surrealql-DF8HYwAL.js +1 -0
  276. package/dist/client/assets/svelte-PhHrTfEY.js +1 -0
  277. package/dist/client/assets/swift-CyEgAFGc.js +1 -0
  278. package/dist/client/assets/synthwave-84-nFMaYfgc.js +1 -0
  279. package/dist/client/assets/system-verilog-Dh5ihWbf.js +1 -0
  280. package/dist/client/assets/systemd-BxMlprV5.js +1 -0
  281. package/dist/client/assets/talonscript-CohzipZa.js +1 -0
  282. package/dist/client/assets/tasl-DMoTqEGO.js +1 -0
  283. package/dist/client/assets/tcl-CZd0xW_V.js +1 -0
  284. package/dist/client/assets/templ-fZg_2sYU.js +1 -0
  285. package/dist/client/assets/terraform-DswuEJGm.js +1 -0
  286. package/dist/client/assets/tex-Cz9rkka_.js +1 -0
  287. package/dist/client/assets/tokyo-night-oM2G3aXe.js +1 -0
  288. package/dist/client/assets/toml-CcmNWLt0.js +1 -0
  289. package/dist/client/assets/ts-tags-ClWx436c.js +1 -0
  290. package/dist/client/assets/tsv-sltzmVWM.js +1 -0
  291. package/dist/client/assets/tsx-BvPjtPa1.js +1 -0
  292. package/dist/client/assets/turtle-ByJddavk.js +1 -0
  293. package/dist/client/assets/twig-Bd-BKVyq.js +1 -0
  294. package/dist/client/assets/typescript-DsLRoAB6.js +1 -0
  295. package/dist/client/assets/typespec-BRdr0IET.js +1 -0
  296. package/dist/client/assets/typst-CY0jyT_P.js +1 -0
  297. package/dist/client/assets/v-DBj4K9d_.js +1 -0
  298. package/dist/client/assets/vala-zf12oZj6.js +1 -0
  299. package/dist/client/assets/vb-DOwzaHZ0.js +1 -0
  300. package/dist/client/assets/verilog-B2gwz-sJ.js +1 -0
  301. package/dist/client/assets/vesper-DdrHHSXu.js +1 -0
  302. package/dist/client/assets/vhdl-BroJfC0k.js +1 -0
  303. package/dist/client/assets/viml-DvXPmvsu.js +1 -0
  304. package/dist/client/assets/vitesse-black-fwtXNY1n.js +1 -0
  305. package/dist/client/assets/vitesse-dark-BZCL-v6S.js +1 -0
  306. package/dist/client/assets/vitesse-light-VbXTXTou.js +1 -0
  307. package/dist/client/assets/vue-BC9HKHTS.js +1 -0
  308. package/dist/client/assets/vue-html-DarBRaBw.js +1 -0
  309. package/dist/client/assets/vue-vine-BR1aGRml.js +1 -0
  310. package/dist/client/assets/vyper-CgoNMtux.js +1 -0
  311. package/dist/client/assets/wasm-BnjxR4X6.js +1 -0
  312. package/dist/client/assets/wasm-ByWQv1Qj.js +1 -0
  313. package/dist/client/assets/wasm-S0UXjx1m.js +1 -0
  314. package/dist/client/assets/wenyan-C8pVoKbM.js +1 -0
  315. package/dist/client/assets/wgsl-BsKzXJz4.js +1 -0
  316. package/dist/client/assets/wikitext-ClFFjSW2.js +1 -0
  317. package/dist/client/assets/wit-DdvCle-K.js +1 -0
  318. package/dist/client/assets/wolfram-DLL8P-h_.js +1 -0
  319. package/dist/client/assets/worker-DZo603XT.js +161 -0
  320. package/dist/client/assets/xml-CbCqHKdP.js +1 -0
  321. package/dist/client/assets/xsl-BIgBy6YO.js +1 -0
  322. package/dist/client/assets/yaml-BgwEqXNj.js +1 -0
  323. package/dist/client/assets/zenscript-BnlCZFoB.js +1 -0
  324. package/dist/client/assets/zig-CMLA9XwU.js +1 -0
  325. package/dist/client/favicon.svg +9 -0
  326. package/dist/client/index.html +15 -0
  327. package/dist/server/Watcher-C_X03LRa.js +97 -0
  328. package/dist/server/chokidar-C5aRkW15.js +1623 -0
  329. package/dist/server/main.js +13614 -0
  330. package/package.json +75 -0
@@ -0,0 +1,1623 @@
1
+ import { EventEmitter } from "node:events";
2
+ import * as sp from "node:path";
3
+ import { join, resolve, sep } from "node:path";
4
+ import { stat, unwatchFile, watch as watch$1, watchFile } from "node:fs";
5
+ import { lstat, open, readdir, realpath, stat as stat$1 } from "node:fs/promises";
6
+ import { type } from "node:os";
7
+ import { Readable } from "node:stream";
8
+ //#region node_modules/readdirp/index.js
9
+ const EntryTypes = {
10
+ FILE_TYPE: "files",
11
+ DIR_TYPE: "directories",
12
+ FILE_DIR_TYPE: "files_directories",
13
+ EVERYTHING_TYPE: "all"
14
+ };
15
+ const defaultOptions = {
16
+ root: ".",
17
+ fileFilter: (_entryInfo) => true,
18
+ directoryFilter: (_entryInfo) => true,
19
+ type: EntryTypes.FILE_TYPE,
20
+ lstat: false,
21
+ depth: 2147483648,
22
+ alwaysStat: false,
23
+ highWaterMark: 256
24
+ };
25
+ Object.freeze(defaultOptions);
26
+ const RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
27
+ const NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set([
28
+ "ENOENT",
29
+ "EPERM",
30
+ "EACCES",
31
+ "ELOOP",
32
+ RECURSIVE_ERROR_CODE
33
+ ]);
34
+ const ALL_TYPES = [
35
+ EntryTypes.DIR_TYPE,
36
+ EntryTypes.EVERYTHING_TYPE,
37
+ EntryTypes.FILE_DIR_TYPE,
38
+ EntryTypes.FILE_TYPE
39
+ ];
40
+ const DIR_TYPES = /* @__PURE__ */ new Set([
41
+ EntryTypes.DIR_TYPE,
42
+ EntryTypes.EVERYTHING_TYPE,
43
+ EntryTypes.FILE_DIR_TYPE
44
+ ]);
45
+ const FILE_TYPES = /* @__PURE__ */ new Set([
46
+ EntryTypes.EVERYTHING_TYPE,
47
+ EntryTypes.FILE_DIR_TYPE,
48
+ EntryTypes.FILE_TYPE
49
+ ]);
50
+ const isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
51
+ const wantBigintFsStats = process.platform === "win32";
52
+ const emptyFn = (_entryInfo) => true;
53
+ const normalizeFilter = (filter) => {
54
+ if (filter === void 0) return emptyFn;
55
+ if (typeof filter === "function") return filter;
56
+ if (typeof filter === "string") {
57
+ const fl = filter.trim();
58
+ return (entry) => entry.basename === fl;
59
+ }
60
+ if (Array.isArray(filter)) {
61
+ const trItems = filter.map((item) => item.trim());
62
+ return (entry) => trItems.some((f) => entry.basename === f);
63
+ }
64
+ return emptyFn;
65
+ };
66
+ var ReaddirpStream = class extends Readable {
67
+ /**
68
+ * Directories discovered but not yet emitted from. Listings are read
69
+ * lazily (on pop, plus one prefetch) instead of eagerly on discovery:
70
+ * keeping whole listings for every queued dir balloons RAM on wide trees.
71
+ */
72
+ parents;
73
+ reading;
74
+ parent;
75
+ _stat;
76
+ _maxDepth;
77
+ _wantsDir;
78
+ _wantsFile;
79
+ _wantsEverything;
80
+ _root;
81
+ _isDirent;
82
+ _statsProp;
83
+ _rdOptions;
84
+ _fileFilter;
85
+ _directoryFilter;
86
+ _relStart;
87
+ constructor(options = {}) {
88
+ super({
89
+ objectMode: true,
90
+ autoDestroy: true,
91
+ highWaterMark: options.highWaterMark ?? defaultOptions.highWaterMark
92
+ });
93
+ const opts = {
94
+ ...defaultOptions,
95
+ ...options
96
+ };
97
+ const root = opts.root ?? defaultOptions.root;
98
+ const type = opts.type ?? defaultOptions.type;
99
+ this._fileFilter = normalizeFilter(opts.fileFilter);
100
+ this._directoryFilter = normalizeFilter(opts.directoryFilter);
101
+ const statMethod = opts.lstat ? lstat : stat$1;
102
+ if (wantBigintFsStats) this._stat = (path) => statMethod(path, { bigint: true });
103
+ else this._stat = statMethod;
104
+ this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
105
+ this._wantsDir = DIR_TYPES.has(type);
106
+ this._wantsFile = FILE_TYPES.has(type);
107
+ this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
108
+ this._root = resolve(root);
109
+ this._relStart = this._root.endsWith(sep) ? this._root.length : this._root.length + 1;
110
+ this._isDirent = !opts.alwaysStat;
111
+ this._statsProp = this._isDirent ? "dirent" : "stats";
112
+ this._rdOptions = {
113
+ encoding: "utf8",
114
+ withFileTypes: this._isDirent
115
+ };
116
+ const rootDir = {
117
+ path: this._root,
118
+ depth: 1
119
+ };
120
+ rootDir.pending = this._exploreDir(this._root, 1);
121
+ this.parents = [rootDir];
122
+ this.reading = false;
123
+ this.parent = void 0;
124
+ }
125
+ async _read(batch) {
126
+ if (this.reading) return;
127
+ this.reading = true;
128
+ try {
129
+ while (!this.destroyed && batch > 0) {
130
+ const par = this.parent;
131
+ const fil = par && par.files;
132
+ if (fil && fil.length > 0) {
133
+ const { path, depth } = par;
134
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));
135
+ const awaited = this._isDirent ? slice : await Promise.all(slice);
136
+ for (const entry of awaited) {
137
+ if (!entry) continue;
138
+ if (this.destroyed) return;
139
+ let entryType = this._getEntryType(entry);
140
+ if (typeof entryType !== "string") entryType = await entryType;
141
+ if (entryType === "directory" && this._directoryFilter(entry)) {
142
+ if (depth <= this._maxDepth) this.parents.push({
143
+ path: entry.fullPath,
144
+ depth: depth + 1
145
+ });
146
+ if (this._wantsDir) {
147
+ this.push(entry);
148
+ batch--;
149
+ }
150
+ } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
151
+ if (this._wantsFile) {
152
+ this.push(entry);
153
+ batch--;
154
+ }
155
+ }
156
+ }
157
+ } else {
158
+ const parent = this.parents.pop();
159
+ if (!parent) {
160
+ this.push(null);
161
+ break;
162
+ }
163
+ const dir = parent.pending ?? this._exploreDir(parent.path, parent.depth);
164
+ const next = this.parents[this.parents.length - 1];
165
+ if (next && !next.pending) next.pending = this._exploreDir(next.path, next.depth);
166
+ this.parent = await dir;
167
+ if (this.destroyed) return;
168
+ }
169
+ }
170
+ } catch (error) {
171
+ this.destroy(error);
172
+ } finally {
173
+ this.reading = false;
174
+ }
175
+ }
176
+ async _exploreDir(path, depth) {
177
+ let files;
178
+ try {
179
+ files = await readdir(path, this._rdOptions);
180
+ } catch (error) {
181
+ this._onError(error);
182
+ }
183
+ return {
184
+ files,
185
+ depth,
186
+ path
187
+ };
188
+ }
189
+ _formatEntry(dirent, path) {
190
+ const basename = this._isDirent ? dirent.name : dirent;
191
+ const fullPath = join(path, basename);
192
+ const entry = {
193
+ path: fullPath.slice(this._relStart),
194
+ fullPath,
195
+ basename
196
+ };
197
+ if (this._isDirent) {
198
+ entry.dirent = dirent;
199
+ return entry;
200
+ }
201
+ return this._stat(fullPath).then((stats) => {
202
+ entry.stats = stats;
203
+ return entry;
204
+ }, (err) => {
205
+ this._onError(err);
206
+ });
207
+ }
208
+ _onError(err) {
209
+ if (isNormalFlowError(err) && !this.destroyed) this.emit("warn", err);
210
+ else this.destroy(err);
211
+ }
212
+ _getEntryType(entry) {
213
+ if (!entry || !(this._statsProp in entry)) return "";
214
+ const stats = entry[this._statsProp];
215
+ if (stats.isFile()) return "file";
216
+ if (stats.isDirectory()) return "directory";
217
+ if (stats.isSymbolicLink()) return this._getSymlinkEntryType(entry);
218
+ return "";
219
+ }
220
+ async _getSymlinkEntryType(entry) {
221
+ const full = entry.fullPath;
222
+ try {
223
+ const entryRealPath = await realpath(full);
224
+ const entryRealPathStats = await lstat(entryRealPath);
225
+ if (entryRealPathStats.isFile()) return "file";
226
+ if (entryRealPathStats.isDirectory()) {
227
+ const len = entryRealPath.length;
228
+ if (full.startsWith(entryRealPath) && full[len] === sep) {
229
+ const recursiveError = /* @__PURE__ */ new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
230
+ recursiveError.code = RECURSIVE_ERROR_CODE;
231
+ this._onError(recursiveError);
232
+ return "";
233
+ }
234
+ return "directory";
235
+ }
236
+ } catch (error) {
237
+ this._onError(error);
238
+ }
239
+ return "";
240
+ }
241
+ _includeAsFile(entry) {
242
+ const stats = entry && entry[this._statsProp];
243
+ return stats && this._wantsEverything && !stats.isDirectory();
244
+ }
245
+ };
246
+ /**
247
+ * Streaming version: Reads all files and directories in given root recursively.
248
+ * Consumes ~constant small amount of RAM.
249
+ * @param root Root directory
250
+ * @param options Options to specify root (start directory), filters and recursion depth
251
+ */
252
+ function readdirp(root, options = {}) {
253
+ let type = options.entryType || options.type;
254
+ if (type === "both") type = EntryTypes.FILE_DIR_TYPE;
255
+ if (!root) throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
256
+ else if (typeof root !== "string") throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
257
+ else if (type && !ALL_TYPES.includes(type)) throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
258
+ const opts = {
259
+ ...options,
260
+ root
261
+ };
262
+ if (type) opts.type = type;
263
+ return new ReaddirpStream(opts);
264
+ }
265
+ //#endregion
266
+ //#region node_modules/chokidar/handler.js
267
+ const STR_DATA = "data";
268
+ const STR_CLOSE = "close";
269
+ const EMPTY_FN = () => {};
270
+ const pl = process.platform;
271
+ const isWindows = pl === "win32";
272
+ const isMacos = pl === "darwin";
273
+ const isLinux = pl === "linux";
274
+ const isFreeBSD = pl === "freebsd";
275
+ const isIBMi = type() === "OS400";
276
+ const EVENTS = {
277
+ ALL: "all",
278
+ READY: "ready",
279
+ ADD: "add",
280
+ CHANGE: "change",
281
+ ADD_DIR: "addDir",
282
+ UNLINK: "unlink",
283
+ UNLINK_DIR: "unlinkDir",
284
+ RAW: "raw",
285
+ ERROR: "error"
286
+ };
287
+ const EV = EVENTS;
288
+ const THROTTLE_MODE_WATCH = "watch";
289
+ const statMethods = {
290
+ lstat,
291
+ stat: stat$1
292
+ };
293
+ const KEY_LISTENERS = "listeners";
294
+ const KEY_ERR = "errHandlers";
295
+ const KEY_RAW = "rawEmitters";
296
+ const HANDLER_KEYS = [
297
+ KEY_LISTENERS,
298
+ KEY_ERR,
299
+ KEY_RAW
300
+ ];
301
+ const binaryExtensions = /* @__PURE__ */ new Set([
302
+ "3dm",
303
+ "3ds",
304
+ "3g2",
305
+ "3gp",
306
+ "7z",
307
+ "a",
308
+ "aac",
309
+ "adp",
310
+ "afdesign",
311
+ "afphoto",
312
+ "afpub",
313
+ "ai",
314
+ "aif",
315
+ "aiff",
316
+ "alz",
317
+ "ape",
318
+ "apk",
319
+ "appimage",
320
+ "ar",
321
+ "arj",
322
+ "asf",
323
+ "au",
324
+ "avi",
325
+ "bak",
326
+ "baml",
327
+ "bh",
328
+ "bin",
329
+ "bk",
330
+ "bmp",
331
+ "btif",
332
+ "bz2",
333
+ "bzip2",
334
+ "cab",
335
+ "caf",
336
+ "cgm",
337
+ "class",
338
+ "cmx",
339
+ "cpio",
340
+ "cr2",
341
+ "cur",
342
+ "dat",
343
+ "dcm",
344
+ "deb",
345
+ "dex",
346
+ "djvu",
347
+ "dll",
348
+ "dmg",
349
+ "dng",
350
+ "doc",
351
+ "docm",
352
+ "docx",
353
+ "dot",
354
+ "dotm",
355
+ "dra",
356
+ "DS_Store",
357
+ "dsk",
358
+ "dts",
359
+ "dtshd",
360
+ "dvb",
361
+ "dwg",
362
+ "dxf",
363
+ "ecelp4800",
364
+ "ecelp7470",
365
+ "ecelp9600",
366
+ "egg",
367
+ "eol",
368
+ "eot",
369
+ "epub",
370
+ "exe",
371
+ "f4v",
372
+ "fbs",
373
+ "fh",
374
+ "fla",
375
+ "flac",
376
+ "flatpak",
377
+ "fli",
378
+ "flv",
379
+ "fpx",
380
+ "fst",
381
+ "fvt",
382
+ "g3",
383
+ "gh",
384
+ "gif",
385
+ "graffle",
386
+ "gz",
387
+ "gzip",
388
+ "h261",
389
+ "h263",
390
+ "h264",
391
+ "icns",
392
+ "ico",
393
+ "ief",
394
+ "img",
395
+ "ipa",
396
+ "iso",
397
+ "jar",
398
+ "jpeg",
399
+ "jpg",
400
+ "jpgv",
401
+ "jpm",
402
+ "jxr",
403
+ "key",
404
+ "ktx",
405
+ "lha",
406
+ "lib",
407
+ "lvp",
408
+ "lz",
409
+ "lzh",
410
+ "lzma",
411
+ "lzo",
412
+ "m3u",
413
+ "m4a",
414
+ "m4v",
415
+ "mar",
416
+ "mdi",
417
+ "mht",
418
+ "mid",
419
+ "midi",
420
+ "mj2",
421
+ "mka",
422
+ "mkv",
423
+ "mmr",
424
+ "mng",
425
+ "mobi",
426
+ "mov",
427
+ "movie",
428
+ "mp3",
429
+ "mp4",
430
+ "mp4a",
431
+ "mpeg",
432
+ "mpg",
433
+ "mpga",
434
+ "mxu",
435
+ "nef",
436
+ "npx",
437
+ "numbers",
438
+ "nupkg",
439
+ "o",
440
+ "odp",
441
+ "ods",
442
+ "odt",
443
+ "oga",
444
+ "ogg",
445
+ "ogv",
446
+ "otf",
447
+ "ott",
448
+ "pages",
449
+ "pbm",
450
+ "pcx",
451
+ "pdb",
452
+ "pdf",
453
+ "pea",
454
+ "pgm",
455
+ "pic",
456
+ "png",
457
+ "pnm",
458
+ "pot",
459
+ "potm",
460
+ "potx",
461
+ "ppa",
462
+ "ppam",
463
+ "ppm",
464
+ "pps",
465
+ "ppsm",
466
+ "ppsx",
467
+ "ppt",
468
+ "pptm",
469
+ "pptx",
470
+ "psd",
471
+ "pya",
472
+ "pyc",
473
+ "pyo",
474
+ "pyv",
475
+ "qt",
476
+ "rar",
477
+ "ras",
478
+ "raw",
479
+ "resources",
480
+ "rgb",
481
+ "rip",
482
+ "rlc",
483
+ "rmf",
484
+ "rmvb",
485
+ "rpm",
486
+ "rtf",
487
+ "rz",
488
+ "s3m",
489
+ "s7z",
490
+ "scpt",
491
+ "sgi",
492
+ "shar",
493
+ "snap",
494
+ "sil",
495
+ "sketch",
496
+ "slk",
497
+ "smv",
498
+ "snk",
499
+ "so",
500
+ "stl",
501
+ "suo",
502
+ "sub",
503
+ "swf",
504
+ "tar",
505
+ "tbz",
506
+ "tbz2",
507
+ "tga",
508
+ "tgz",
509
+ "thmx",
510
+ "tif",
511
+ "tiff",
512
+ "tlz",
513
+ "ttc",
514
+ "ttf",
515
+ "txz",
516
+ "udf",
517
+ "uvh",
518
+ "uvi",
519
+ "uvm",
520
+ "uvp",
521
+ "uvs",
522
+ "uvu",
523
+ "viv",
524
+ "vob",
525
+ "war",
526
+ "wav",
527
+ "wax",
528
+ "wbmp",
529
+ "wdp",
530
+ "weba",
531
+ "webm",
532
+ "webp",
533
+ "whl",
534
+ "wim",
535
+ "wm",
536
+ "wma",
537
+ "wmv",
538
+ "wmx",
539
+ "woff",
540
+ "woff2",
541
+ "wrm",
542
+ "wvx",
543
+ "xbm",
544
+ "xif",
545
+ "xla",
546
+ "xlam",
547
+ "xls",
548
+ "xlsb",
549
+ "xlsm",
550
+ "xlsx",
551
+ "xlt",
552
+ "xltm",
553
+ "xltx",
554
+ "xm",
555
+ "xmind",
556
+ "xpi",
557
+ "xpm",
558
+ "xwd",
559
+ "xz",
560
+ "z",
561
+ "zip",
562
+ "zipx"
563
+ ]);
564
+ const isBinaryPath = (filePath) => binaryExtensions.has(sp.extname(filePath).slice(1).toLowerCase());
565
+ const foreach = (val, fn) => {
566
+ if (val instanceof Set) val.forEach(fn);
567
+ else fn(val);
568
+ };
569
+ const addAndConvert = (main, prop, item) => {
570
+ let container = main[prop];
571
+ if (!(container instanceof Set)) main[prop] = container = /* @__PURE__ */ new Set([container]);
572
+ container.add(item);
573
+ };
574
+ const clearItem = (cont) => (key) => {
575
+ const set = cont[key];
576
+ if (set instanceof Set) set.clear();
577
+ else delete cont[key];
578
+ };
579
+ const delFromSet = (main, prop, item) => {
580
+ const container = main[prop];
581
+ if (container instanceof Set) container.delete(item);
582
+ else if (container === item) delete main[prop];
583
+ };
584
+ const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
585
+ const FsWatchInstances = /* @__PURE__ */ new Map();
586
+ /**
587
+ * Instantiates the fs_watch interface
588
+ * @param path to be watched
589
+ * @param options to be passed to fs_watch
590
+ * @param listener main event handler
591
+ * @param errHandler emits info about errors
592
+ * @param emitRaw emits raw event data
593
+ * @returns {NativeFsWatcher}
594
+ */
595
+ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
596
+ const handleEvent = (rawEvent, evPath) => {
597
+ listener(path);
598
+ emitRaw(rawEvent, evPath, { watchedPath: path });
599
+ if (evPath && path !== evPath) fsWatchBroadcast(sp.resolve(path, evPath), KEY_LISTENERS, sp.join(path, evPath));
600
+ };
601
+ try {
602
+ return watch$1(path, { persistent: options.persistent }, handleEvent);
603
+ } catch (error) {
604
+ errHandler(error);
605
+ return;
606
+ }
607
+ }
608
+ /**
609
+ * Helper for passing fs_watch event data to a collection of listeners
610
+ * @param fullPath absolute path bound to fs_watch instance
611
+ */
612
+ const fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
613
+ const cont = FsWatchInstances.get(fullPath);
614
+ if (!cont) return;
615
+ foreach(cont[listenerType], (listener) => {
616
+ listener(val1, val2, val3);
617
+ });
618
+ };
619
+ /**
620
+ * Instantiates the fs_watch interface or binds listeners
621
+ * to an existing one covering the same file system entry
622
+ * @param path
623
+ * @param fullPath absolute path
624
+ * @param options to be passed to fs_watch
625
+ * @param handlers container for event listener functions
626
+ */
627
+ const setFsWatchListener = (path, fullPath, options, handlers) => {
628
+ const { listener, errHandler, rawEmitter } = handlers;
629
+ let cont = FsWatchInstances.get(fullPath);
630
+ let watcher;
631
+ if (!options.persistent) {
632
+ watcher = createFsWatchInstance(path, options, listener, errHandler, rawEmitter);
633
+ if (!watcher) return;
634
+ return watcher.close.bind(watcher);
635
+ }
636
+ if (cont) {
637
+ addAndConvert(cont, KEY_LISTENERS, listener);
638
+ addAndConvert(cont, KEY_ERR, errHandler);
639
+ addAndConvert(cont, KEY_RAW, rawEmitter);
640
+ } else {
641
+ watcher = createFsWatchInstance(path, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
642
+ if (!watcher) return;
643
+ watcher.on(EV.ERROR, async (error) => {
644
+ const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
645
+ if (cont) cont.watcherUnusable = true;
646
+ if (isWindows && error.code === "EPERM") try {
647
+ await (await open(path, "r")).close();
648
+ broadcastErr(error);
649
+ } catch (err) {}
650
+ else broadcastErr(error);
651
+ });
652
+ cont = {
653
+ listeners: listener,
654
+ errHandlers: errHandler,
655
+ rawEmitters: rawEmitter,
656
+ watcher
657
+ };
658
+ FsWatchInstances.set(fullPath, cont);
659
+ }
660
+ return () => {
661
+ delFromSet(cont, KEY_LISTENERS, listener);
662
+ delFromSet(cont, KEY_ERR, errHandler);
663
+ delFromSet(cont, KEY_RAW, rawEmitter);
664
+ if (isEmptySet(cont.listeners)) {
665
+ cont.watcher.close();
666
+ FsWatchInstances.delete(fullPath);
667
+ HANDLER_KEYS.forEach(clearItem(cont));
668
+ cont.watcher = void 0;
669
+ Object.freeze(cont);
670
+ }
671
+ };
672
+ };
673
+ const FsWatchFileInstances = /* @__PURE__ */ new Map();
674
+ /**
675
+ * Instantiates the fs_watchFile interface or binds listeners
676
+ * to an existing one covering the same file system entry
677
+ * @param path to be watched
678
+ * @param fullPath absolute path
679
+ * @param options options to be passed to fs_watchFile
680
+ * @param handlers container for event listener functions
681
+ * @returns closer
682
+ */
683
+ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
684
+ const { listener, rawEmitter } = handlers;
685
+ let cont = FsWatchFileInstances.get(fullPath);
686
+ const copts = cont && cont.options;
687
+ if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
688
+ unwatchFile(fullPath);
689
+ cont = void 0;
690
+ }
691
+ if (cont) {
692
+ addAndConvert(cont, KEY_LISTENERS, listener);
693
+ addAndConvert(cont, KEY_RAW, rawEmitter);
694
+ } else {
695
+ cont = {
696
+ listeners: listener,
697
+ rawEmitters: rawEmitter,
698
+ options,
699
+ watcher: watchFile(fullPath, options, (curr, prev) => {
700
+ foreach(cont.rawEmitters, (rawEmitter) => {
701
+ rawEmitter(EV.CHANGE, fullPath, {
702
+ curr,
703
+ prev
704
+ });
705
+ });
706
+ const currmtime = curr.mtimeMs;
707
+ if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) foreach(cont.listeners, (listener) => listener(path, curr));
708
+ })
709
+ };
710
+ FsWatchFileInstances.set(fullPath, cont);
711
+ }
712
+ return () => {
713
+ delFromSet(cont, KEY_LISTENERS, listener);
714
+ delFromSet(cont, KEY_RAW, rawEmitter);
715
+ if (isEmptySet(cont.listeners)) {
716
+ FsWatchFileInstances.delete(fullPath);
717
+ unwatchFile(fullPath);
718
+ cont.options = cont.watcher = void 0;
719
+ Object.freeze(cont);
720
+ }
721
+ };
722
+ };
723
+ /**
724
+ * @mixin
725
+ */
726
+ var NodeFsHandler = class {
727
+ fsw;
728
+ _boundHandleError;
729
+ constructor(fsW) {
730
+ this.fsw = fsW;
731
+ this._boundHandleError = (error) => fsW._handleError(error);
732
+ }
733
+ /**
734
+ * Watch file for changes with fs_watchFile or fs_watch.
735
+ * @param path to file or dir
736
+ * @param listener on fs change
737
+ * @returns closer for the watcher instance
738
+ */
739
+ _watchWithNodeFs(path, listener) {
740
+ const opts = this.fsw.options;
741
+ const directory = sp.dirname(path);
742
+ const basename = sp.basename(path);
743
+ this.fsw._getWatchedDir(directory).add(basename);
744
+ const absolutePath = sp.resolve(path);
745
+ const options = { persistent: opts.persistent };
746
+ if (!listener) listener = EMPTY_FN;
747
+ let closer;
748
+ if (opts.usePolling) {
749
+ options.interval = opts.interval !== opts.binaryInterval && isBinaryPath(basename) ? opts.binaryInterval : opts.interval;
750
+ closer = setFsWatchFileListener(path, absolutePath, options, {
751
+ listener,
752
+ rawEmitter: this.fsw._emitRaw
753
+ });
754
+ } else closer = setFsWatchListener(path, absolutePath, options, {
755
+ listener,
756
+ errHandler: this._boundHandleError,
757
+ rawEmitter: this.fsw._emitRaw
758
+ });
759
+ return closer;
760
+ }
761
+ /**
762
+ * Watch a file and emit add event if warranted.
763
+ * @returns closer for the watcher instance
764
+ */
765
+ _handleFile(file, stats, initialAdd) {
766
+ if (this.fsw.closed) return;
767
+ const dirname = sp.dirname(file);
768
+ const basename = sp.basename(file);
769
+ const parent = this.fsw._getWatchedDir(dirname);
770
+ let prevStats = stats;
771
+ if (parent.has(basename)) return;
772
+ const listener = async (path, newStats) => {
773
+ if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
774
+ if (!newStats || newStats.mtimeMs === 0) try {
775
+ const newStats = await stat$1(file);
776
+ if (this.fsw.closed) return;
777
+ const at = newStats.atimeMs;
778
+ const mt = newStats.mtimeMs;
779
+ if (!at || at <= mt || mt !== prevStats.mtimeMs) this.fsw._emit(EV.CHANGE, file, newStats);
780
+ if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats.ino) {
781
+ this.fsw._closeFile(path);
782
+ prevStats = newStats;
783
+ const closer = this._watchWithNodeFs(file, listener);
784
+ if (closer) this.fsw._addPathCloser(path, closer);
785
+ } else prevStats = newStats;
786
+ } catch (error) {
787
+ this.fsw._remove(dirname, basename);
788
+ }
789
+ else if (parent.has(basename)) {
790
+ const at = newStats.atimeMs;
791
+ const mt = newStats.mtimeMs;
792
+ if (!at || at <= mt || mt !== prevStats.mtimeMs) this.fsw._emit(EV.CHANGE, file, newStats);
793
+ prevStats = newStats;
794
+ }
795
+ };
796
+ const closer = this._watchWithNodeFs(file, listener);
797
+ if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
798
+ if (!this.fsw._throttle(EV.ADD, file, 0)) return;
799
+ this.fsw._emit(EV.ADD, file, stats);
800
+ }
801
+ return closer;
802
+ }
803
+ /**
804
+ * Handle symlinks encountered while reading a dir.
805
+ * @param entry returned by readdirp
806
+ * @param directory path of dir being read
807
+ * @param path of this item
808
+ * @param item basename of this item
809
+ * @returns true if no more processing is needed for this entry.
810
+ */
811
+ async _handleSymlink(entry, directory, path, item) {
812
+ if (this.fsw.closed) return;
813
+ const full = entry.fullPath;
814
+ const dir = this.fsw._getWatchedDir(directory);
815
+ if (!this.fsw.options.followSymlinks) {
816
+ this.fsw._incrReadyCount();
817
+ let linkPath;
818
+ try {
819
+ linkPath = await realpath(path);
820
+ } catch (e) {
821
+ this.fsw._emitReady();
822
+ return true;
823
+ }
824
+ if (this.fsw.closed) return;
825
+ if (dir.has(item)) {
826
+ if (this.fsw._symlinkPaths.get(full) !== linkPath) {
827
+ this.fsw._symlinkPaths.set(full, linkPath);
828
+ this.fsw._emit(EV.CHANGE, path, entry.stats);
829
+ }
830
+ } else {
831
+ dir.add(item);
832
+ this.fsw._symlinkPaths.set(full, linkPath);
833
+ this.fsw._emit(EV.ADD, path, entry.stats);
834
+ }
835
+ this.fsw._emitReady();
836
+ return true;
837
+ }
838
+ if (this.fsw._symlinkPaths.has(full)) return true;
839
+ this.fsw._symlinkPaths.set(full, true);
840
+ }
841
+ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
842
+ directory = sp.join(directory, "");
843
+ const throttleKey = target ? `${directory}:${target}` : directory;
844
+ throttler = this.fsw._throttle("readdir", throttleKey, 1e3);
845
+ if (!throttler) return;
846
+ const previous = this.fsw._getWatchedDir(wh.path);
847
+ const current = /* @__PURE__ */ new Set();
848
+ let stream = this.fsw._readdirp(directory, {
849
+ fileFilter: (entry) => wh.filterPath(entry),
850
+ directoryFilter: (entry) => wh.filterDir(entry)
851
+ });
852
+ if (!stream) return;
853
+ stream.on(STR_DATA, async (entry) => {
854
+ if (this.fsw.closed) {
855
+ stream = void 0;
856
+ return;
857
+ }
858
+ const item = entry.path;
859
+ let path = sp.join(directory, item);
860
+ current.add(item);
861
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) return;
862
+ if (this.fsw.closed) {
863
+ stream = void 0;
864
+ return;
865
+ }
866
+ if (item === target || !target && !previous.has(item)) {
867
+ this.fsw._incrReadyCount();
868
+ path = sp.join(dir, sp.relative(dir, path));
869
+ this._addToNodeFs(path, initialAdd, wh, depth + 1);
870
+ }
871
+ }).on(EV.ERROR, this._boundHandleError);
872
+ return new Promise((resolve, reject) => {
873
+ if (!stream) return reject();
874
+ stream.once("end", () => {
875
+ if (this.fsw.closed) {
876
+ stream = void 0;
877
+ return;
878
+ }
879
+ const wasThrottled = throttler ? throttler.clear() : false;
880
+ resolve(void 0);
881
+ previous.getChildren().filter((item) => {
882
+ return item !== directory && !current.has(item);
883
+ }).forEach((item) => {
884
+ this.fsw._remove(directory, item);
885
+ });
886
+ stream = void 0;
887
+ if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler);
888
+ });
889
+ });
890
+ }
891
+ /**
892
+ * Read directory to add / remove files from `@watched` list and re-read it on change.
893
+ * @param dir fs path
894
+ * @param stats
895
+ * @param initialAdd
896
+ * @param depth relative to user-supplied path
897
+ * @param target child path targeted for watch
898
+ * @param wh Common watch helpers for this path
899
+ * @param realpath
900
+ * @returns closer for the watcher instance.
901
+ */
902
+ async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
903
+ const parentDir = this.fsw._getWatchedDir(sp.dirname(dir));
904
+ const tracked = parentDir.has(sp.basename(dir));
905
+ if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) this.fsw._emit(EV.ADD_DIR, dir, stats);
906
+ parentDir.add(sp.basename(dir));
907
+ this.fsw._getWatchedDir(dir);
908
+ let throttler;
909
+ let closer;
910
+ const oDepth = this.fsw.options.depth;
911
+ if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
912
+ if (!target) {
913
+ await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
914
+ if (this.fsw.closed) return;
915
+ }
916
+ closer = this._watchWithNodeFs(dir, (dirPath, stats) => {
917
+ if (stats && stats.mtimeMs === 0) return;
918
+ this._handleRead(dirPath, false, wh, target, dir, depth, throttler);
919
+ });
920
+ }
921
+ return closer;
922
+ }
923
+ /**
924
+ * Handle added file, directory, or glob pattern.
925
+ * Delegates call to _handleFile / _handleDir after checks.
926
+ * @param path to file or ir
927
+ * @param initialAdd was the file added at watch instantiation?
928
+ * @param priorWh depth relative to user-supplied path
929
+ * @param depth Child path actually targeted for watch
930
+ * @param target Child path actually targeted for watch
931
+ */
932
+ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
933
+ const ready = this.fsw._emitReady;
934
+ if (this.fsw._isIgnored(path) || this.fsw.closed) {
935
+ ready();
936
+ return false;
937
+ }
938
+ const wh = this.fsw._getWatchHelpers(path);
939
+ if (priorWh) {
940
+ wh.filterPath = (entry) => priorWh.filterPath(entry);
941
+ wh.filterDir = (entry) => priorWh.filterDir(entry);
942
+ }
943
+ try {
944
+ const stats = await statMethods[wh.statMethod](wh.watchPath);
945
+ if (this.fsw.closed) return;
946
+ if (this.fsw._isIgnored(wh.watchPath, stats)) {
947
+ ready();
948
+ return false;
949
+ }
950
+ const follow = this.fsw.options.followSymlinks;
951
+ let closer;
952
+ if (stats.isDirectory()) {
953
+ const absPath = sp.resolve(path);
954
+ const targetPath = follow ? await realpath(path) : path;
955
+ if (this.fsw.closed) return;
956
+ closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
957
+ if (this.fsw.closed) return;
958
+ if (absPath !== targetPath && targetPath !== void 0) this.fsw._symlinkPaths.set(absPath, targetPath);
959
+ } else if (stats.isSymbolicLink()) {
960
+ const targetPath = follow ? await realpath(path) : path;
961
+ if (this.fsw.closed) return;
962
+ const parent = sp.dirname(wh.watchPath);
963
+ this.fsw._getWatchedDir(parent).add(wh.watchPath);
964
+ this.fsw._emit(EV.ADD, wh.watchPath, stats);
965
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
966
+ if (this.fsw.closed) return;
967
+ if (targetPath !== void 0) this.fsw._symlinkPaths.set(sp.resolve(path), targetPath);
968
+ } else closer = this._handleFile(wh.watchPath, stats, initialAdd);
969
+ ready();
970
+ if (closer) this.fsw._addPathCloser(path, closer);
971
+ return false;
972
+ } catch (error) {
973
+ if (this.fsw._handleError(error)) {
974
+ ready();
975
+ return path;
976
+ }
977
+ }
978
+ }
979
+ };
980
+ //#endregion
981
+ //#region node_modules/chokidar/index.js
982
+ /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
983
+ const SLASH = "/";
984
+ const SLASH_SLASH = "//";
985
+ const ONE_DOT = ".";
986
+ const TWO_DOTS = "..";
987
+ const STRING_TYPE = "string";
988
+ const BACK_SLASH_RE = /\\/g;
989
+ const DOUBLE_SLASH_RE = /\/\//g;
990
+ const DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
991
+ const REPLACER_RE = /^\.[/\\]/;
992
+ function arrify(item) {
993
+ return Array.isArray(item) ? item : [item];
994
+ }
995
+ const isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
996
+ function createPattern(matcher) {
997
+ if (typeof matcher === "function") return matcher;
998
+ if (typeof matcher === "string") return (string) => matcher === string;
999
+ if (matcher instanceof RegExp) return (string) => matcher.test(string);
1000
+ if (typeof matcher === "object" && matcher !== null) return (string) => {
1001
+ if (matcher.path === string) return true;
1002
+ if (matcher.recursive) {
1003
+ const relative = sp.relative(matcher.path, string);
1004
+ if (!relative) return false;
1005
+ return !relative.startsWith("..") && !sp.isAbsolute(relative);
1006
+ }
1007
+ return false;
1008
+ };
1009
+ return () => false;
1010
+ }
1011
+ function normalizePath(path) {
1012
+ if (typeof path !== "string") throw new Error("string expected");
1013
+ path = sp.normalize(path);
1014
+ path = path.replace(/\\/g, "/");
1015
+ let prepend = false;
1016
+ if (path.startsWith("//")) prepend = true;
1017
+ path = path.replace(DOUBLE_SLASH_RE, "/");
1018
+ if (prepend) path = "/" + path;
1019
+ return path;
1020
+ }
1021
+ function matchPatterns(patterns, testString, stats) {
1022
+ const path = normalizePath(testString);
1023
+ for (let index = 0; index < patterns.length; index++) {
1024
+ const pattern = patterns[index];
1025
+ if (pattern(path, stats)) return true;
1026
+ }
1027
+ return false;
1028
+ }
1029
+ function anymatch(matchers, testString) {
1030
+ if (matchers == null) throw new TypeError("anymatch: specify first argument");
1031
+ const patterns = arrify(matchers).map((matcher) => createPattern(matcher));
1032
+ if (testString == null) return (testString, stats) => {
1033
+ return matchPatterns(patterns, testString, stats);
1034
+ };
1035
+ return matchPatterns(patterns, testString);
1036
+ }
1037
+ const unifyPaths = (paths_) => {
1038
+ const paths = arrify(paths_).flat();
1039
+ if (!paths.every((p) => typeof p === STRING_TYPE)) throw new TypeError(`Non-string provided as watch path: ${paths}`);
1040
+ return paths.map(normalizePathToUnix);
1041
+ };
1042
+ const toUnix = (string) => {
1043
+ let str = string.replace(BACK_SLASH_RE, SLASH);
1044
+ let prepend = false;
1045
+ if (str.startsWith(SLASH_SLASH)) prepend = true;
1046
+ str = str.replace(DOUBLE_SLASH_RE, SLASH);
1047
+ if (prepend) str = SLASH + str;
1048
+ return str;
1049
+ };
1050
+ const normalizePathToUnix = (path) => toUnix(sp.normalize(toUnix(path)));
1051
+ const normalizeIgnored = (cwd = "") => (path) => {
1052
+ if (typeof path === "string") return normalizePathToUnix(sp.isAbsolute(path) ? path : sp.join(cwd, path));
1053
+ else return path;
1054
+ };
1055
+ const getAbsolutePath = (path, cwd) => {
1056
+ if (sp.isAbsolute(path)) return path;
1057
+ return sp.join(cwd, path);
1058
+ };
1059
+ const EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
1060
+ /**
1061
+ * Directory entry.
1062
+ */
1063
+ var DirEntry = class {
1064
+ path;
1065
+ _removeWatcher;
1066
+ items;
1067
+ constructor(dir, removeWatcher) {
1068
+ this.path = dir;
1069
+ this._removeWatcher = removeWatcher;
1070
+ this.items = /* @__PURE__ */ new Set();
1071
+ }
1072
+ add(item) {
1073
+ const { items } = this;
1074
+ if (!items) return;
1075
+ if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item);
1076
+ }
1077
+ async remove(item) {
1078
+ const { items } = this;
1079
+ if (!items) return;
1080
+ items.delete(item);
1081
+ if (items.size > 0) return;
1082
+ const dir = this.path;
1083
+ try {
1084
+ await readdir(dir);
1085
+ } catch (err) {
1086
+ if (this._removeWatcher) this._removeWatcher(sp.dirname(dir), sp.basename(dir));
1087
+ }
1088
+ }
1089
+ has(item) {
1090
+ const { items } = this;
1091
+ if (!items) return;
1092
+ return items.has(item);
1093
+ }
1094
+ getChildren() {
1095
+ const { items } = this;
1096
+ if (!items) return [];
1097
+ return [...items.values()];
1098
+ }
1099
+ dispose() {
1100
+ this.items.clear();
1101
+ this.path = "";
1102
+ this._removeWatcher = EMPTY_FN;
1103
+ this.items = EMPTY_SET;
1104
+ Object.freeze(this);
1105
+ }
1106
+ };
1107
+ const STAT_METHOD_F = "stat";
1108
+ const STAT_METHOD_L = "lstat";
1109
+ var WatchHelper = class {
1110
+ fsw;
1111
+ path;
1112
+ watchPath;
1113
+ fullWatchPath;
1114
+ dirParts;
1115
+ followSymlinks;
1116
+ statMethod;
1117
+ constructor(path, follow, fsw) {
1118
+ this.fsw = fsw;
1119
+ const watchPath = path;
1120
+ this.path = path = path.replace(REPLACER_RE, "");
1121
+ this.watchPath = watchPath;
1122
+ this.fullWatchPath = sp.resolve(watchPath);
1123
+ this.dirParts = [];
1124
+ this.dirParts.forEach((parts) => {
1125
+ if (parts.length > 1) parts.pop();
1126
+ });
1127
+ this.followSymlinks = follow;
1128
+ this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
1129
+ }
1130
+ entryPath(entry) {
1131
+ return sp.join(this.watchPath, sp.relative(this.watchPath, entry.fullPath));
1132
+ }
1133
+ filterPath(entry) {
1134
+ const { stats } = entry;
1135
+ if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
1136
+ const resolvedPath = this.entryPath(entry);
1137
+ return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
1138
+ }
1139
+ filterDir(entry) {
1140
+ return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
1141
+ }
1142
+ };
1143
+ /**
1144
+ * Watches files & directories for changes. Emitted events:
1145
+ * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`
1146
+ *
1147
+ * new FSWatcher()
1148
+ * .add(directories)
1149
+ * .on('add', path => log('File', path, 'was added'))
1150
+ */
1151
+ var FSWatcher = class extends EventEmitter {
1152
+ closed;
1153
+ options;
1154
+ _closers;
1155
+ _ignoredPaths;
1156
+ _throttled;
1157
+ _streams;
1158
+ _symlinkPaths;
1159
+ _watched;
1160
+ _pendingWrites;
1161
+ _pendingUnlinks;
1162
+ _readyCount;
1163
+ _emitReady;
1164
+ _closePromise;
1165
+ _userIgnored;
1166
+ _readyEmitted;
1167
+ _emitRaw;
1168
+ _boundRemove;
1169
+ _nodeFsHandler;
1170
+ constructor(_opts = {}) {
1171
+ super();
1172
+ this.closed = false;
1173
+ this._closers = /* @__PURE__ */ new Map();
1174
+ this._ignoredPaths = /* @__PURE__ */ new Set();
1175
+ this._throttled = /* @__PURE__ */ new Map();
1176
+ this._streams = /* @__PURE__ */ new Set();
1177
+ this._symlinkPaths = /* @__PURE__ */ new Map();
1178
+ this._watched = /* @__PURE__ */ new Map();
1179
+ this._pendingWrites = /* @__PURE__ */ new Map();
1180
+ this._pendingUnlinks = /* @__PURE__ */ new Map();
1181
+ this._readyCount = 0;
1182
+ this._readyEmitted = false;
1183
+ const awf = _opts.awaitWriteFinish;
1184
+ const DEF_AWF = {
1185
+ stabilityThreshold: 2e3,
1186
+ pollInterval: 100
1187
+ };
1188
+ const opts = {
1189
+ persistent: true,
1190
+ ignoreInitial: false,
1191
+ ignorePermissionErrors: false,
1192
+ interval: 100,
1193
+ binaryInterval: 300,
1194
+ followSymlinks: true,
1195
+ usePolling: false,
1196
+ atomic: true,
1197
+ ..._opts,
1198
+ ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
1199
+ awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? {
1200
+ ...DEF_AWF,
1201
+ ...awf
1202
+ } : false
1203
+ };
1204
+ if (isIBMi) opts.usePolling = true;
1205
+ if (opts.atomic === void 0) opts.atomic = !opts.usePolling;
1206
+ const envPoll = process.env.CHOKIDAR_USEPOLLING;
1207
+ if (envPoll !== void 0) {
1208
+ const envLower = envPoll.toLowerCase();
1209
+ if (envLower === "false" || envLower === "0") opts.usePolling = false;
1210
+ else if (envLower === "true" || envLower === "1") opts.usePolling = true;
1211
+ else opts.usePolling = !!envLower;
1212
+ }
1213
+ const envInterval = process.env.CHOKIDAR_INTERVAL;
1214
+ if (envInterval) opts.interval = Number.parseInt(envInterval, 10);
1215
+ let readyCalls = 0;
1216
+ this._emitReady = () => {
1217
+ readyCalls++;
1218
+ if (readyCalls >= this._readyCount) {
1219
+ this._emitReady = EMPTY_FN;
1220
+ this._readyEmitted = true;
1221
+ process.nextTick(() => this.emit(EVENTS.READY));
1222
+ }
1223
+ };
1224
+ this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
1225
+ this._boundRemove = this._remove.bind(this);
1226
+ this.options = opts;
1227
+ this._nodeFsHandler = new NodeFsHandler(this);
1228
+ Object.freeze(opts);
1229
+ }
1230
+ _addIgnoredPath(matcher) {
1231
+ if (isMatcherObject(matcher)) {
1232
+ for (const ignored of this._ignoredPaths) if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) return;
1233
+ }
1234
+ this._ignoredPaths.add(matcher);
1235
+ }
1236
+ _removeIgnoredPath(matcher) {
1237
+ this._ignoredPaths.delete(matcher);
1238
+ if (typeof matcher === "string") {
1239
+ for (const ignored of this._ignoredPaths) if (isMatcherObject(ignored) && ignored.path === matcher) this._ignoredPaths.delete(ignored);
1240
+ }
1241
+ }
1242
+ /**
1243
+ * Adds paths to be watched on an existing FSWatcher instance.
1244
+ * @param paths_ file or file list. Other arguments are unused
1245
+ */
1246
+ add(paths_, _origAdd, _internal) {
1247
+ const { cwd } = this.options;
1248
+ this.closed = false;
1249
+ this._closePromise = void 0;
1250
+ let paths = unifyPaths(paths_);
1251
+ if (cwd) paths = paths.map((path) => {
1252
+ return getAbsolutePath(path, cwd);
1253
+ });
1254
+ paths.forEach((path) => {
1255
+ this._removeIgnoredPath(path);
1256
+ });
1257
+ this._userIgnored = void 0;
1258
+ if (!this._readyCount) this._readyCount = 0;
1259
+ this._readyCount += paths.length;
1260
+ Promise.all(paths.map(async (path) => {
1261
+ const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, void 0, 0, _origAdd);
1262
+ if (res) this._emitReady();
1263
+ return res;
1264
+ })).then((results) => {
1265
+ if (this.closed) return;
1266
+ results.forEach((item) => {
1267
+ if (item) this.add(sp.dirname(item), sp.basename(_origAdd || item));
1268
+ });
1269
+ });
1270
+ return this;
1271
+ }
1272
+ /**
1273
+ * Close watchers or start ignoring events from specified paths.
1274
+ */
1275
+ unwatch(paths_) {
1276
+ if (this.closed) return this;
1277
+ const paths = unifyPaths(paths_);
1278
+ const { cwd } = this.options;
1279
+ paths.forEach((path) => {
1280
+ if (!sp.isAbsolute(path) && !this._closers.has(path)) {
1281
+ if (cwd) path = sp.join(cwd, path);
1282
+ path = sp.resolve(path);
1283
+ }
1284
+ this._closePath(path);
1285
+ this._addIgnoredPath(path);
1286
+ if (this._watched.has(path)) this._addIgnoredPath({
1287
+ path,
1288
+ recursive: true
1289
+ });
1290
+ this._userIgnored = void 0;
1291
+ });
1292
+ return this;
1293
+ }
1294
+ /**
1295
+ * Close watchers and remove all listeners from watched paths.
1296
+ */
1297
+ close() {
1298
+ if (this._closePromise) return this._closePromise;
1299
+ this.closed = true;
1300
+ this.removeAllListeners();
1301
+ const closers = [];
1302
+ this._closers.forEach((closerList) => closerList.forEach((closer) => {
1303
+ const promise = closer();
1304
+ if (promise instanceof Promise) closers.push(promise);
1305
+ }));
1306
+ this._streams.forEach((stream) => stream.destroy());
1307
+ this._userIgnored = void 0;
1308
+ this._readyCount = 0;
1309
+ this._readyEmitted = false;
1310
+ this._watched.forEach((dirent) => dirent.dispose());
1311
+ this._closers.clear();
1312
+ this._watched.clear();
1313
+ this._streams.clear();
1314
+ this._symlinkPaths.clear();
1315
+ this._throttled.clear();
1316
+ this._closePromise = closers.length ? Promise.all(closers).then(() => void 0) : Promise.resolve();
1317
+ return this._closePromise;
1318
+ }
1319
+ /**
1320
+ * Expose list of watched paths
1321
+ * @returns for chaining
1322
+ */
1323
+ getWatched() {
1324
+ const watchList = {};
1325
+ this._watched.forEach((entry, dir) => {
1326
+ const index = (this.options.cwd ? sp.relative(this.options.cwd, dir) : dir) || ONE_DOT;
1327
+ watchList[index] = entry.getChildren().sort();
1328
+ });
1329
+ return watchList;
1330
+ }
1331
+ emitWithAll(event, args) {
1332
+ this.emit(event, ...args);
1333
+ if (event !== EVENTS.ERROR) this.emit(EVENTS.ALL, event, ...args);
1334
+ }
1335
+ /**
1336
+ * Normalize and emit events.
1337
+ * Calling _emit DOES NOT MEAN emit() would be called!
1338
+ * @param event Type of event
1339
+ * @param path File or directory path
1340
+ * @param stats arguments to be passed with event
1341
+ * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
1342
+ */
1343
+ async _emit(event, path, stats) {
1344
+ if (this.closed) return;
1345
+ const opts = this.options;
1346
+ if (isWindows) path = sp.normalize(path);
1347
+ if (opts.cwd) path = sp.relative(opts.cwd, path);
1348
+ const args = [path];
1349
+ if (stats != null) args.push(stats);
1350
+ const awf = opts.awaitWriteFinish;
1351
+ let pw;
1352
+ if (awf && (pw = this._pendingWrites.get(path))) {
1353
+ pw.lastChange = /* @__PURE__ */ new Date();
1354
+ return this;
1355
+ }
1356
+ if (opts.atomic) {
1357
+ if (event === EVENTS.UNLINK) {
1358
+ this._pendingUnlinks.set(path, [event, ...args]);
1359
+ setTimeout(() => {
1360
+ this._pendingUnlinks.forEach((entry, path) => {
1361
+ this.emit(...entry);
1362
+ this.emit(EVENTS.ALL, ...entry);
1363
+ this._pendingUnlinks.delete(path);
1364
+ });
1365
+ }, typeof opts.atomic === "number" ? opts.atomic : 100);
1366
+ return this;
1367
+ }
1368
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path)) {
1369
+ event = EVENTS.CHANGE;
1370
+ this._pendingUnlinks.delete(path);
1371
+ }
1372
+ }
1373
+ if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
1374
+ const awfEmit = (err, stats) => {
1375
+ if (err) {
1376
+ event = EVENTS.ERROR;
1377
+ args[0] = err;
1378
+ this.emitWithAll(event, args);
1379
+ } else if (stats) {
1380
+ if (args.length > 1) args[1] = stats;
1381
+ else args.push(stats);
1382
+ this.emitWithAll(event, args);
1383
+ }
1384
+ };
1385
+ this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);
1386
+ return this;
1387
+ }
1388
+ if (event === EVENTS.CHANGE) {
1389
+ if (!this._throttle(EVENTS.CHANGE, path, 50)) return this;
1390
+ }
1391
+ if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
1392
+ const fullPath = opts.cwd ? sp.join(opts.cwd, path) : path;
1393
+ let stats;
1394
+ try {
1395
+ stats = await stat$1(fullPath);
1396
+ } catch (err) {}
1397
+ if (!stats || this.closed) return;
1398
+ args.push(stats);
1399
+ }
1400
+ this.emitWithAll(event, args);
1401
+ return this;
1402
+ }
1403
+ /**
1404
+ * Common handler for errors
1405
+ * @returns The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
1406
+ */
1407
+ _handleError(error) {
1408
+ const code = error && error.code;
1409
+ if (error && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) this.emit(EVENTS.ERROR, error);
1410
+ return error || this.closed;
1411
+ }
1412
+ /**
1413
+ * Helper utility for throttling
1414
+ * @param actionType type being throttled
1415
+ * @param path being acted upon
1416
+ * @param timeout duration of time to suppress duplicate actions
1417
+ * @returns tracking object or false if action should be suppressed
1418
+ */
1419
+ _throttle(actionType, path, timeout) {
1420
+ if (!this._throttled.has(actionType)) this._throttled.set(actionType, /* @__PURE__ */ new Map());
1421
+ const action = this._throttled.get(actionType);
1422
+ if (!action) throw new Error("invalid throttle");
1423
+ const actionPath = action.get(path);
1424
+ if (actionPath) {
1425
+ actionPath.count++;
1426
+ return false;
1427
+ }
1428
+ let timeoutObject;
1429
+ const clear = () => {
1430
+ const item = action.get(path);
1431
+ const count = item ? item.count : 0;
1432
+ action.delete(path);
1433
+ clearTimeout(timeoutObject);
1434
+ if (item) clearTimeout(item.timeoutObject);
1435
+ return count;
1436
+ };
1437
+ timeoutObject = setTimeout(clear, timeout);
1438
+ const thr = {
1439
+ timeoutObject,
1440
+ clear,
1441
+ count: 0
1442
+ };
1443
+ action.set(path, thr);
1444
+ return thr;
1445
+ }
1446
+ _incrReadyCount() {
1447
+ return this._readyCount++;
1448
+ }
1449
+ /**
1450
+ * Awaits write operation to finish.
1451
+ * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
1452
+ * @param path being acted upon
1453
+ * @param threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
1454
+ * @param event
1455
+ * @param awfEmit Callback to be called when ready for event to be emitted.
1456
+ */
1457
+ _awaitWriteFinish(path, threshold, event, awfEmit) {
1458
+ const awf = this.options.awaitWriteFinish;
1459
+ if (typeof awf !== "object") return;
1460
+ const pollInterval = awf.pollInterval;
1461
+ let timeoutHandler;
1462
+ let fullPath = path;
1463
+ if (this.options.cwd && !sp.isAbsolute(path)) fullPath = sp.join(this.options.cwd, path);
1464
+ const now = /* @__PURE__ */ new Date();
1465
+ const writes = this._pendingWrites;
1466
+ function awaitWriteFinishFn(prevStat) {
1467
+ stat(fullPath, (err, curStat) => {
1468
+ if (err || !writes.has(path)) {
1469
+ if (err && err.code !== "ENOENT") awfEmit(err);
1470
+ return;
1471
+ }
1472
+ const now = Number(/* @__PURE__ */ new Date());
1473
+ if (prevStat && curStat.size !== prevStat.size) writes.get(path).lastChange = now;
1474
+ if (now - writes.get(path).lastChange >= threshold) {
1475
+ writes.delete(path);
1476
+ awfEmit(void 0, curStat);
1477
+ } else timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
1478
+ });
1479
+ }
1480
+ if (!writes.has(path)) {
1481
+ writes.set(path, {
1482
+ lastChange: now,
1483
+ cancelWait: () => {
1484
+ writes.delete(path);
1485
+ clearTimeout(timeoutHandler);
1486
+ return event;
1487
+ }
1488
+ });
1489
+ timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
1490
+ }
1491
+ }
1492
+ /**
1493
+ * Determines whether user has asked to ignore this path.
1494
+ */
1495
+ _isIgnored(path, stats) {
1496
+ if (this.options.atomic && DOT_RE.test(path)) return true;
1497
+ if (!this._userIgnored) {
1498
+ const { cwd } = this.options;
1499
+ const ignored = (this.options.ignored || []).map(normalizeIgnored(cwd));
1500
+ const list = [...[...this._ignoredPaths].map(normalizeIgnored(cwd)), ...ignored];
1501
+ this._userIgnored = anymatch(list, void 0);
1502
+ }
1503
+ return this._userIgnored(path, stats);
1504
+ }
1505
+ _isntIgnored(path, stat) {
1506
+ return !this._isIgnored(path, stat);
1507
+ }
1508
+ /**
1509
+ * Provides a set of common helpers and properties relating to symlink handling.
1510
+ * @param path file or directory pattern being watched
1511
+ */
1512
+ _getWatchHelpers(path) {
1513
+ return new WatchHelper(path, this.options.followSymlinks, this);
1514
+ }
1515
+ /**
1516
+ * Provides directory tracking objects
1517
+ * @param directory path of the directory
1518
+ */
1519
+ _getWatchedDir(directory) {
1520
+ const dir = sp.resolve(directory);
1521
+ if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
1522
+ return this._watched.get(dir);
1523
+ }
1524
+ /**
1525
+ * Check for read permissions: https://stackoverflow.com/a/11781404/1358405
1526
+ */
1527
+ _hasReadPermissions(stats) {
1528
+ if (this.options.ignorePermissionErrors) return true;
1529
+ return Boolean(Number(stats.mode) & 256);
1530
+ }
1531
+ /**
1532
+ * Handles emitting unlink events for
1533
+ * files and directories, and via recursion, for
1534
+ * files and directories within directories that are unlinked
1535
+ * @param directory within which the following item is located
1536
+ * @param item base path of item/directory
1537
+ */
1538
+ _remove(directory, item, isDirectory) {
1539
+ const path = sp.join(directory, item);
1540
+ const fullPath = sp.resolve(path);
1541
+ isDirectory = isDirectory != null ? isDirectory : this._watched.has(path) || this._watched.has(fullPath);
1542
+ if (!this._throttle("remove", path, 100)) return;
1543
+ if (!isDirectory && this._watched.size === 1) this.add(directory, item, true);
1544
+ this._getWatchedDir(path).getChildren().forEach((nested) => this._remove(path, nested));
1545
+ const parent = this._getWatchedDir(directory);
1546
+ const wasTracked = parent.has(item);
1547
+ parent.remove(item);
1548
+ if (this._symlinkPaths.has(fullPath)) this._symlinkPaths.delete(fullPath);
1549
+ let relPath = path;
1550
+ if (this.options.cwd) relPath = sp.relative(this.options.cwd, path);
1551
+ if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
1552
+ if (this._pendingWrites.get(relPath).cancelWait() === EVENTS.ADD) return;
1553
+ }
1554
+ this._watched.delete(path);
1555
+ this._watched.delete(fullPath);
1556
+ const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
1557
+ if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
1558
+ this._closePath(path);
1559
+ }
1560
+ /**
1561
+ * Closes all watchers for a path
1562
+ */
1563
+ _closePath(path) {
1564
+ this._closeFile(path);
1565
+ const dir = sp.dirname(path);
1566
+ this._getWatchedDir(dir).remove(sp.basename(path));
1567
+ }
1568
+ /**
1569
+ * Closes only file-specific watchers
1570
+ */
1571
+ _closeFile(path) {
1572
+ const closers = this._closers.get(path);
1573
+ if (!closers) return;
1574
+ closers.forEach((closer) => closer());
1575
+ this._closers.delete(path);
1576
+ }
1577
+ _addPathCloser(path, closer) {
1578
+ if (!closer) return;
1579
+ let list = this._closers.get(path);
1580
+ if (!list) {
1581
+ list = [];
1582
+ this._closers.set(path, list);
1583
+ }
1584
+ list.push(closer);
1585
+ }
1586
+ _readdirp(root, opts) {
1587
+ if (this.closed) return;
1588
+ let stream = readdirp(root, {
1589
+ type: EVENTS.ALL,
1590
+ alwaysStat: true,
1591
+ lstat: true,
1592
+ ...opts,
1593
+ depth: 0
1594
+ });
1595
+ this._streams.add(stream);
1596
+ stream.once(STR_CLOSE, () => {
1597
+ stream = void 0;
1598
+ });
1599
+ stream.once("end", () => {
1600
+ if (stream) {
1601
+ this._streams.delete(stream);
1602
+ stream = void 0;
1603
+ }
1604
+ });
1605
+ return stream;
1606
+ }
1607
+ };
1608
+ /**
1609
+ * Instantiates watcher with paths to be tracked.
1610
+ * @param paths file / directory paths
1611
+ * @param options opts, such as `atomic`, `awaitWriteFinish`, `ignored`, and others
1612
+ * @returns an instance of FSWatcher for chaining.
1613
+ * @example
1614
+ * const watcher = watch('.').on('all', (event, path) => { console.log(event, path); });
1615
+ * watch('.', { atomic: true, awaitWriteFinish: true, ignored: (f, stats) => stats?.isFile() && !f.endsWith('.js') })
1616
+ */
1617
+ function watch(paths, options = {}) {
1618
+ const watcher = new FSWatcher(options);
1619
+ watcher.add(paths);
1620
+ return watcher;
1621
+ }
1622
+ //#endregion
1623
+ export { watch };