@alivault/pico 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/.output/nitro.json +17 -0
  2. package/.output/public/apple-touch-icon.png +0 -0
  3. package/.output/public/assets/abap-smLpETzL.js +1 -0
  4. package/.output/public/assets/actionscript-3-o-aRvjY5.js +1 -0
  5. package/.output/public/assets/ada-D5RRX1i4.js +1 -0
  6. package/.output/public/assets/andromeeda-N4z3YzmR.js +1 -0
  7. package/.output/public/assets/angular-html-BZNntD0J.js +1 -0
  8. package/.output/public/assets/angular-ts-SQQMYL2C.js +1 -0
  9. package/.output/public/assets/apache-DttKlSqg.js +1 -0
  10. package/.output/public/assets/apex-DL7j-a2n.js +1 -0
  11. package/.output/public/assets/apl-D5V6uPDr.js +1 -0
  12. package/.output/public/assets/applescript-DCbL_2FX.js +1 -0
  13. package/.output/public/assets/ara-DqheWJCe.js +1 -0
  14. package/.output/public/assets/asciidoc-BH2sf2K4.js +1 -0
  15. package/.output/public/assets/asm-rfjOMz3U.js +1 -0
  16. package/.output/public/assets/astro-DeXKSaFP.js +1 -0
  17. package/.output/public/assets/aurora-x-CND-FqEb.js +1 -0
  18. package/.output/public/assets/awk-CMV5n9Z7.js +1 -0
  19. package/.output/public/assets/ayu-dark-on7xzq_B.js +1 -0
  20. package/.output/public/assets/ayu-light-DnGeGGc2.js +1 -0
  21. package/.output/public/assets/ayu-mirage-DG3LlYC_.js +1 -0
  22. package/.output/public/assets/ballerina-BjMqJjlr.js +1 -0
  23. package/.output/public/assets/bat-BaVbo_qw.js +1 -0
  24. package/.output/public/assets/beancount-DBt5Mbc_.js +1 -0
  25. package/.output/public/assets/berry-Cyjuxiss.js +1 -0
  26. package/.output/public/assets/bibtex-BV_0nsPq.js +1 -0
  27. package/.output/public/assets/bicep-C2gEwu4J.js +1 -0
  28. package/.output/public/assets/bird2-BRyaEJd0.js +1 -0
  29. package/.output/public/assets/blade-Bu5re0Vg.js +1 -0
  30. package/.output/public/assets/bsl-B1qbqNES.js +1 -0
  31. package/.output/public/assets/c-Nc9zJT78.js +1 -0
  32. package/.output/public/assets/c3-DTTbp5N2.js +1 -0
  33. package/.output/public/assets/cadence-CPz83cmI.js +1 -0
  34. package/.output/public/assets/cairo-BDj8wWhy.js +1 -0
  35. package/.output/public/assets/catppuccin-frappe-Dr22sraq.js +1 -0
  36. package/.output/public/assets/catppuccin-latte-C57EeX8c.js +1 -0
  37. package/.output/public/assets/catppuccin-macchiato-CpheI4uD.js +1 -0
  38. package/.output/public/assets/catppuccin-mocha-D8Lmdks_.js +1 -0
  39. package/.output/public/assets/clarity-CFJ2Yc3q.js +1 -0
  40. package/.output/public/assets/clojure-6R01QgJC.js +1 -0
  41. package/.output/public/assets/cmake-D5rSbMir.js +1 -0
  42. package/.output/public/assets/cobol-nvZDS9LT.js +1 -0
  43. package/.output/public/assets/codeowners-_3A-ClkN.js +1 -0
  44. package/.output/public/assets/codeql-DlIhJTR7.js +1 -0
  45. package/.output/public/assets/coffee-BKLOTq4e.js +1 -0
  46. package/.output/public/assets/common-lisp-BvQzz173.js +1 -0
  47. package/.output/public/assets/coq-DTNXReIC.js +1 -0
  48. package/.output/public/assets/cpp-D6g1DVNt.js +1 -0
  49. package/.output/public/assets/crystal-DfoZI57w.js +1 -0
  50. package/.output/public/assets/csharp-BDKQY1K9.js +1 -0
  51. package/.output/public/assets/css-DRmnABqB.js +1 -0
  52. package/.output/public/assets/csv-DNUpVBxl.js +1 -0
  53. package/.output/public/assets/cue-DDdBc2s3.js +1 -0
  54. package/.output/public/assets/cypher-CguaznO2.js +1 -0
  55. package/.output/public/assets/d-CHcoyjv3.js +1 -0
  56. package/.output/public/assets/dark-plus-CqeW_0kH.js +1 -0
  57. package/.output/public/assets/dart-RM3aRphk.js +1 -0
  58. package/.output/public/assets/dax-nbnY1d79.js +1 -0
  59. package/.output/public/assets/desktop-BD76cvxT.js +1 -0
  60. package/.output/public/assets/diff-CdkWtnkL.js +1 -0
  61. package/.output/public/assets/docker-ZyPHc6zB.js +1 -0
  62. package/.output/public/assets/dotenv-BdJZEwA6.js +1 -0
  63. package/.output/public/assets/dracula-CtqCPLGa.js +1 -0
  64. package/.output/public/assets/dracula-soft-DmBpwRAy.js +1 -0
  65. package/.output/public/assets/dream-maker-BJL4qlg3.js +1 -0
  66. package/.output/public/assets/edge-DwocGnOF.js +1 -0
  67. package/.output/public/assets/elixir-Dtbfds1r.js +1 -0
  68. package/.output/public/assets/elm-CpPtm471.js +1 -0
  69. package/.output/public/assets/emacs-lisp-_LyYa2Ky.js +1 -0
  70. package/.output/public/assets/erb--z3IM9Cb.js +1 -0
  71. package/.output/public/assets/erlang-Bc4hQuqa.js +1 -0
  72. package/.output/public/assets/everforest-dark-CrbyKk4n.js +1 -0
  73. package/.output/public/assets/everforest-light-DRbSh8Tm.js +1 -0
  74. package/.output/public/assets/fennel-CC2BkRsS.js +1 -0
  75. package/.output/public/assets/fish-D2ZCzqcE.js +1 -0
  76. package/.output/public/assets/fluent-DKAm3m7q.js +1 -0
  77. package/.output/public/assets/fortran-fixed-form-B02FOYI-.js +1 -0
  78. package/.output/public/assets/fortran-free-form-BPTf0lbT.js +1 -0
  79. package/.output/public/assets/fsharp-DhdR18vN.js +1 -0
  80. package/.output/public/assets/gdresource-DgnrMPIx.js +1 -0
  81. package/.output/public/assets/gdscript-CsadCSaZ.js +1 -0
  82. package/.output/public/assets/gdshader-PfnN_8tR.js +1 -0
  83. package/.output/public/assets/genie-Bj-orPAV.js +1 -0
  84. package/.output/public/assets/gherkin-COVWpJ-Q.js +1 -0
  85. package/.output/public/assets/git-commit-DGJi7qBD.js +1 -0
  86. package/.output/public/assets/git-rebase-Ce47xoa6.js +1 -0
  87. package/.output/public/assets/github-dark-default-DX3IG_X0.js +1 -0
  88. package/.output/public/assets/github-dark-dimmed-CH6p_7ez.js +1 -0
  89. package/.output/public/assets/github-dark-high-contrast-Bg2sSao5.js +1 -0
  90. package/.output/public/assets/github-dark-ipGuFGYC.js +1 -0
  91. package/.output/public/assets/github-light-BxjqOQl0.js +1 -0
  92. package/.output/public/assets/github-light-default-DwpDd1IQ.js +1 -0
  93. package/.output/public/assets/github-light-high-contrast-C0QeixPf.js +1 -0
  94. package/.output/public/assets/gleam-BF2NigGj.js +1 -0
  95. package/.output/public/assets/glimmer-js-C0BuzxQC.js +1 -0
  96. package/.output/public/assets/glimmer-ts-irOZ-cAQ.js +1 -0
  97. package/.output/public/assets/glsl-JAhLUe0P.js +1 -0
  98. package/.output/public/assets/gn-CMIt9roj.js +1 -0
  99. package/.output/public/assets/gnuplot-DgWlRTEj.js +1 -0
  100. package/.output/public/assets/go-DLnOLj8q.js +1 -0
  101. package/.output/public/assets/graphql-D2ba3BkR.js +1 -0
  102. package/.output/public/assets/groovy-B9qLWIkE.js +1 -0
  103. package/.output/public/assets/gruvbox-dark-hard-BIMX9ePb.js +1 -0
  104. package/.output/public/assets/gruvbox-dark-medium-DxuwyVzM.js +1 -0
  105. package/.output/public/assets/gruvbox-dark-soft-ba2fjht0.js +1 -0
  106. package/.output/public/assets/gruvbox-light-hard-DAJK2PqC.js +1 -0
  107. package/.output/public/assets/gruvbox-light-medium-WRifDAJD.js +1 -0
  108. package/.output/public/assets/gruvbox-light-soft-B0dBOoVB.js +1 -0
  109. package/.output/public/assets/hack-CgzUpY8l.js +1 -0
  110. package/.output/public/assets/haml-C-oIZcDo.js +1 -0
  111. package/.output/public/assets/handlebars-CbP-Mhzf.js +1 -0
  112. package/.output/public/assets/haskell-BaGpmm_c.js +1 -0
  113. package/.output/public/assets/haxe-DfXTCEOz.js +1 -0
  114. package/.output/public/assets/hcl-CbCtpSbi.js +1 -0
  115. package/.output/public/assets/hjson-_4-w-pHU.js +1 -0
  116. package/.output/public/assets/hlsl-DpuYn7pp.js +1 -0
  117. package/.output/public/assets/horizon-C5RtD1fY.js +1 -0
  118. package/.output/public/assets/horizon-bright-pEOice34.js +1 -0
  119. package/.output/public/assets/houston-A0zg9vNP.js +1 -0
  120. package/.output/public/assets/html-ddqpqPg0.js +1 -0
  121. package/.output/public/assets/html-derivative-DWGxf_At.js +1 -0
  122. package/.output/public/assets/http-Bg1nG1nG.js +1 -0
  123. package/.output/public/assets/hurl-zm47Pi1n.js +1 -0
  124. package/.output/public/assets/hxml-adC65L_J.js +1 -0
  125. package/.output/public/assets/hy-t9zDXBje.js +1 -0
  126. package/.output/public/assets/imba-Bxu-TDfw.js +1 -0
  127. package/.output/public/assets/index-CthXqlK7.js +53 -0
  128. package/.output/public/assets/ini-D-v34c8N.js +1 -0
  129. package/.output/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  130. package/.output/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  131. package/.output/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  132. package/.output/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  133. package/.output/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  134. package/.output/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  135. package/.output/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  136. package/.output/public/assets/java-DVLnIrqC.js +1 -0
  137. package/.output/public/assets/javascript-Cop1kpy_.js +1 -0
  138. package/.output/public/assets/jinja-Bnj4awH5.js +1 -0
  139. package/.output/public/assets/jison-CuCNs9Q3.js +1 -0
  140. package/.output/public/assets/json-CTw4n7kn.js +1 -0
  141. package/.output/public/assets/json5-D0XL1D5m.js +1 -0
  142. package/.output/public/assets/jsonc-BBgf3TX3.js +1 -0
  143. package/.output/public/assets/jsonl-KrKLbtB7.js +1 -0
  144. package/.output/public/assets/jsonnet-B2ZwWMOt.js +1 -0
  145. package/.output/public/assets/jssm-ByRpI9-B.js +1 -0
  146. package/.output/public/assets/jsx-0oMUGqZj.js +1 -0
  147. package/.output/public/assets/julia-DNYHzXlE.js +1 -0
  148. package/.output/public/assets/just-BlWkkmf2.js +1 -0
  149. package/.output/public/assets/kanagawa-dragon-CtPmcCMp.js +1 -0
  150. package/.output/public/assets/kanagawa-lotus-DpOXEGCa.js +1 -0
  151. package/.output/public/assets/kanagawa-wave-CLVCyc-n.js +1 -0
  152. package/.output/public/assets/kdl-6FPPEH4H.js +1 -0
  153. package/.output/public/assets/kotlin-D4L3Nd2D.js +1 -0
  154. package/.output/public/assets/kusto-D-mmc07O.js +1 -0
  155. package/.output/public/assets/laserwave-7fEj4XGb.js +1 -0
  156. package/.output/public/assets/latex-DqPzjMIt.js +1 -0
  157. package/.output/public/assets/lean-BMVMuP2E.js +1 -0
  158. package/.output/public/assets/less-C95PyOu0.js +1 -0
  159. package/.output/public/assets/light-plus-DHI2dh3p.js +1 -0
  160. package/.output/public/assets/liquid-BURJK16h.js +1 -0
  161. package/.output/public/assets/llvm-Dy3qORTl.js +1 -0
  162. package/.output/public/assets/log-BQop7fzg.js +1 -0
  163. package/.output/public/assets/logo-DKtnYmrp.js +1 -0
  164. package/.output/public/assets/lua-31hdJClp.js +1 -0
  165. package/.output/public/assets/luau-Dha4KG0q.js +1 -0
  166. package/.output/public/assets/make-DfmS6buu.js +1 -0
  167. package/.output/public/assets/markdown-BaI9LyM4.js +1 -0
  168. package/.output/public/assets/marko-C2ZcdSLh.js +1 -0
  169. package/.output/public/assets/material-theme-Dm6ETY8i.js +1 -0
  170. package/.output/public/assets/material-theme-darker-BeyjmM5Z.js +1 -0
  171. package/.output/public/assets/material-theme-lighter-CCOYYzKL.js +1 -0
  172. package/.output/public/assets/material-theme-ocean-CUtPiiX3.js +1 -0
  173. package/.output/public/assets/material-theme-palenight-2L4zMwIM.js +1 -0
  174. package/.output/public/assets/matlab-BT79Cq_j.js +1 -0
  175. package/.output/public/assets/mdc-N1ii9pk5.js +1 -0
  176. package/.output/public/assets/mdx-CxGBwLNt.js +1 -0
  177. package/.output/public/assets/mermaid-DLf3axBN.js +1 -0
  178. package/.output/public/assets/min-dark-B8TUPGHg.js +1 -0
  179. package/.output/public/assets/min-light-BDOoBxcA.js +1 -0
  180. package/.output/public/assets/mipsasm-DXuU_0cI.js +1 -0
  181. package/.output/public/assets/mojo-1Omp2pIo.js +1 -0
  182. package/.output/public/assets/monokai-E_VBmXGZ.js +1 -0
  183. package/.output/public/assets/moonbit-DZzq699o.js +1 -0
  184. package/.output/public/assets/move-DxDAOJVd.js +1 -0
  185. package/.output/public/assets/narrat-CxDcPPb9.js +1 -0
  186. package/.output/public/assets/nextflow-JEyYUlIq.js +1 -0
  187. package/.output/public/assets/nextflow-groovy-wvmJO4hi.js +1 -0
  188. package/.output/public/assets/nginx-BuomO0W8.js +1 -0
  189. package/.output/public/assets/night-owl-DefhalNX.js +1 -0
  190. package/.output/public/assets/night-owl-light-byb3AbEn.js +1 -0
  191. package/.output/public/assets/nim-hKoEPsYL.js +1 -0
  192. package/.output/public/assets/nix-DsFTDHWT.js +1 -0
  193. package/.output/public/assets/nord-D5rQzHT-.js +1 -0
  194. package/.output/public/assets/nushell-BQ_rO0AM.js +1 -0
  195. package/.output/public/assets/objective-c-BMq6JT_m.js +1 -0
  196. package/.output/public/assets/objective-cpp-DRwojuGv.js +1 -0
  197. package/.output/public/assets/ocaml-e4_gKO6E.js +1 -0
  198. package/.output/public/assets/odin-mdTPwYOg.js +1 -0
  199. package/.output/public/assets/one-dark-pro-DxXww9jg.js +1 -0
  200. package/.output/public/assets/one-light-D9c03w7t.js +1 -0
  201. package/.output/public/assets/openscad-D2aTdNfr.js +1 -0
  202. package/.output/public/assets/pascal-D4n_G8vj.js +1 -0
  203. package/.output/public/assets/perl-CAGVW6Ra.js +1 -0
  204. package/.output/public/assets/php-BycclmzS.js +1 -0
  205. package/.output/public/assets/pierre-dark-CizZ1Z5z.js +1 -0
  206. package/.output/public/assets/pierre-light-CHMWfAMe.js +1 -0
  207. package/.output/public/assets/pkl-DcjhAp0L.js +1 -0
  208. package/.output/public/assets/plastic-uOsw7z1x.js +1 -0
  209. package/.output/public/assets/plsql-BSy3Ag0J.js +1 -0
  210. package/.output/public/assets/po-Be96RYkA.js +1 -0
  211. package/.output/public/assets/poimandres-CyO4HORD.js +1 -0
  212. package/.output/public/assets/polar-BmhMKWum.js +1 -0
  213. package/.output/public/assets/postcss-BTQso3H9.js +1 -0
  214. package/.output/public/assets/powerquery-DVyQv3M2.js +1 -0
  215. package/.output/public/assets/powershell-BmtCGJVD.js +1 -0
  216. package/.output/public/assets/prisma-CCFA9rEj.js +1 -0
  217. package/.output/public/assets/prolog-DWGEEo78.js +1 -0
  218. package/.output/public/assets/proto-C3eop1kM.js +1 -0
  219. package/.output/public/assets/pug-4maJHz9G.js +1 -0
  220. package/.output/public/assets/puppet-C0_7Nv5A.js +1 -0
  221. package/.output/public/assets/purescript-Bv-B8yRw.js +1 -0
  222. package/.output/public/assets/python-CKg5r0C3.js +1 -0
  223. package/.output/public/assets/qml-JLIQfzyb.js +1 -0
  224. package/.output/public/assets/qmldir-Cqfb4Lox.js +1 -0
  225. package/.output/public/assets/qss-Csho9BH8.js +1 -0
  226. package/.output/public/assets/r-UcxRcvcA.js +1 -0
  227. package/.output/public/assets/racket-D8-uWeQH.js +1 -0
  228. package/.output/public/assets/raku-Cj4JSa8p.js +1 -0
  229. package/.output/public/assets/razor-P8rbooCh.js +1 -0
  230. package/.output/public/assets/red-z4H4llUY.js +1 -0
  231. package/.output/public/assets/reg-DXGFiJSl.js +1 -0
  232. package/.output/public/assets/regexp-3-A0406L.js +1 -0
  233. package/.output/public/assets/rel-CunnVTBK.js +1 -0
  234. package/.output/public/assets/riscv-C8BcOCkS.js +1 -0
  235. package/.output/public/assets/rolldown-runtime-S-ySWqyJ.js +1 -0
  236. package/.output/public/assets/ron-DiDyR9oa.js +1 -0
  237. package/.output/public/assets/rose-pine-BADquuIH.js +1 -0
  238. package/.output/public/assets/rose-pine-dawn-BLcEeBoh.js +1 -0
  239. package/.output/public/assets/rose-pine-moon-BK_tLY1Y.js +1 -0
  240. package/.output/public/assets/rosmsg-CHmL1Uyj.js +1 -0
  241. package/.output/public/assets/routes-Bp0r03R8.js +2147 -0
  242. package/.output/public/assets/rst-C6GHyL-N.js +1 -0
  243. package/.output/public/assets/ruby-Cl8PVkbY.js +1 -0
  244. package/.output/public/assets/rust-DjJFInu3.js +1 -0
  245. package/.output/public/assets/sas-CXoVwlZN.js +1 -0
  246. package/.output/public/assets/sass-D3xZ5o-v.js +1 -0
  247. package/.output/public/assets/scala-B0IRml5w.js +1 -0
  248. package/.output/public/assets/scheme-BhwcV3Av.js +1 -0
  249. package/.output/public/assets/scss-DNczJ95n.js +1 -0
  250. package/.output/public/assets/sdbl-BmWYR-pI.js +1 -0
  251. package/.output/public/assets/shaderlab-DZ3Lsiak.js +1 -0
  252. package/.output/public/assets/shellscript-DaVPunOM.js +1 -0
  253. package/.output/public/assets/shellsession-COm1V40U.js +1 -0
  254. package/.output/public/assets/slack-dark-DOnVms5P.js +1 -0
  255. package/.output/public/assets/slack-ochin-DcRTft4q.js +1 -0
  256. package/.output/public/assets/smalltalk-DVQuUMII.js +1 -0
  257. package/.output/public/assets/snazzy-light-x9CLJ1W9.js +1 -0
  258. package/.output/public/assets/solarized-dark-BB1sh-pe.js +1 -0
  259. package/.output/public/assets/solarized-light-9-RPS998.js +1 -0
  260. package/.output/public/assets/solidity-gQ4WXILB.js +1 -0
  261. package/.output/public/assets/soy-DwewhJ_3.js +1 -0
  262. package/.output/public/assets/sparql-B9c85a_o.js +1 -0
  263. package/.output/public/assets/splunk-OB48_RcD.js +1 -0
  264. package/.output/public/assets/sql-CrTmZCMa.js +1 -0
  265. package/.output/public/assets/ssh-config-DA9YMRGV.js +1 -0
  266. package/.output/public/assets/stata-Bl--TAbZ.js +1 -0
  267. package/.output/public/assets/styles-DEX5mU_p.css +2 -0
  268. package/.output/public/assets/stylus-sKwvsUaC.js +1 -0
  269. package/.output/public/assets/surrealql-BW79EE-U.js +1 -0
  270. package/.output/public/assets/svelte-ziMErdPi.js +1 -0
  271. package/.output/public/assets/swift-C72NbAtg.js +1 -0
  272. package/.output/public/assets/synthwave-84-eJ9uRN_S.js +1 -0
  273. package/.output/public/assets/system-verilog-CnWMF7Nq.js +1 -0
  274. package/.output/public/assets/systemd-DMzItW5N.js +1 -0
  275. package/.output/public/assets/talonscript-DopQCWDL.js +1 -0
  276. package/.output/public/assets/tasl-C28SYKbq.js +1 -0
  277. package/.output/public/assets/tcl-DHq7zmoF.js +1 -0
  278. package/.output/public/assets/templ-C_9I6ncv.js +1 -0
  279. package/.output/public/assets/terraform-CogS1YKX.js +1 -0
  280. package/.output/public/assets/tex-D8LVuLf5.js +1 -0
  281. package/.output/public/assets/tokyo-night-B9N7LyrF.js +1 -0
  282. package/.output/public/assets/toml-BH_iPsgK.js +1 -0
  283. package/.output/public/assets/ts-tags-DKuFCGsc.js +1 -0
  284. package/.output/public/assets/tsv-BIkdBZX1.js +1 -0
  285. package/.output/public/assets/tsx-BjkCKOtw.js +1 -0
  286. package/.output/public/assets/turtle-CqNXyJWZ.js +1 -0
  287. package/.output/public/assets/twig-Bs1kcsO6.js +1 -0
  288. package/.output/public/assets/typescript-BoHeP9q1.js +1 -0
  289. package/.output/public/assets/typespec-CQ9LYD_e.js +1 -0
  290. package/.output/public/assets/typst-T-Fsk-Sv.js +1 -0
  291. package/.output/public/assets/v-BhMEOw9x.js +1 -0
  292. package/.output/public/assets/vala-DzajMnwt.js +1 -0
  293. package/.output/public/assets/vb-7Xr8dEYW.js +1 -0
  294. package/.output/public/assets/verilog-AvXtwZir.js +1 -0
  295. package/.output/public/assets/vesper-CtgQQ2sf.js +1 -0
  296. package/.output/public/assets/vhdl-BHu0zg1P.js +1 -0
  297. package/.output/public/assets/viml-Di0QpLfC.js +1 -0
  298. package/.output/public/assets/vitesse-black-jXdfyqgD.js +1 -0
  299. package/.output/public/assets/vitesse-dark-B88PxG1r.js +1 -0
  300. package/.output/public/assets/vitesse-light-BXxZh2iV.js +1 -0
  301. package/.output/public/assets/vue-Dnf0y5RU.js +1 -0
  302. package/.output/public/assets/vue-html-CRtKS76J.js +1 -0
  303. package/.output/public/assets/vue-vine-BxjPqU7T.js +1 -0
  304. package/.output/public/assets/vyper-C3R5yXgx.js +1 -0
  305. package/.output/public/assets/wasm-CEUrWlVz.js +1 -0
  306. package/.output/public/assets/wasm-Chsuwt1A.js +1 -0
  307. package/.output/public/assets/wenyan-BonVcr2i.js +1 -0
  308. package/.output/public/assets/wgsl-D59WYmNq.js +1 -0
  309. package/.output/public/assets/wikitext-ariTI2Wk.js +1 -0
  310. package/.output/public/assets/wit-EA4fa3Dt.js +1 -0
  311. package/.output/public/assets/wolfram-DDp7LhyU.js +1 -0
  312. package/.output/public/assets/xml-eU7M3iZJ.js +1 -0
  313. package/.output/public/assets/xsl-DSqe4nTO.js +1 -0
  314. package/.output/public/assets/yaml-BTD1XHJG.js +1 -0
  315. package/.output/public/assets/zenscript-4WaROUyc.js +1 -0
  316. package/.output/public/assets/zig-CJoLJGwV.js +1 -0
  317. package/.output/public/favicon.png +0 -0
  318. package/.output/public/favicon.svg +7 -0
  319. package/.output/public/manifest.json +28 -0
  320. package/.output/public/robots.txt +3 -0
  321. package/.output/public/screenshots/pico-workspace-alt.png +0 -0
  322. package/.output/public/screenshots/pico-workspace.png +0 -0
  323. package/.output/public/sounds/session-done.mp3 +0 -0
  324. package/.output/server/__23tanstack-start-plugin-adapters-y_fshQDY.mjs +5 -0
  325. package/.output/server/_chunks/ssr-renderer.mjs +15 -0
  326. package/.output/server/_libs/@base-ui/react+[...].mjs +14407 -0
  327. package/.output/server/_libs/@dnd-kit/core+[...].mjs +2748 -0
  328. package/.output/server/_libs/@pierre/diffs+[...].mjs +19074 -0
  329. package/.output/server/_libs/@pierre/trees+[...].mjs +9236 -0
  330. package/.output/server/_libs/@radix-ui/react-dialog+[...].mjs +1789 -0
  331. package/.output/server/_libs/@radix-ui/react-primitive+[...].mjs +136 -0
  332. package/.output/server/_libs/@tanstack/devtools-event-client+[...].mjs +196 -0
  333. package/.output/server/_libs/@tanstack/hotkeys+[...].mjs +1607 -0
  334. package/.output/server/_libs/@tanstack/react-router+[...].mjs +13950 -0
  335. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +90 -0
  336. package/.output/server/_libs/bail.mjs +13 -0
  337. package/.output/server/_libs/character-entities.mjs +2135 -0
  338. package/.output/server/_libs/class-variance-authority+clsx.mjs +69 -0
  339. package/.output/server/_libs/cmdk.mjs +473 -0
  340. package/.output/server/_libs/decode-named-character-reference+[...].mjs +19 -0
  341. package/.output/server/_libs/devlop.mjs +5 -0
  342. package/.output/server/_libs/diff.mjs +732 -0
  343. package/.output/server/_libs/dnd-kit__accessibility.mjs +46 -0
  344. package/.output/server/_libs/dnd-kit__sortable.mjs +400 -0
  345. package/.output/server/_libs/escape-string-regexp.mjs +7 -0
  346. package/.output/server/_libs/estree-util-is-identifier-name.mjs +20 -0
  347. package/.output/server/_libs/extend.mjs +75 -0
  348. package/.output/server/_libs/h3+rou3+srvx.mjs +1210 -0
  349. package/.output/server/_libs/hast-util-to-jsx-runtime+[...].mjs +1244 -0
  350. package/.output/server/_libs/hookable.mjs +41 -0
  351. package/.output/server/_libs/html-url-attributes.mjs +44 -0
  352. package/.output/server/_libs/is-plain-obj.mjs +8 -0
  353. package/.output/server/_libs/longest-streak.mjs +29 -0
  354. package/.output/server/_libs/lucide-react.mjs +632 -0
  355. package/.output/server/_libs/markdown-table.mjs +289 -0
  356. package/.output/server/_libs/mdast-util-find-and-replace+[...].mjs +636 -0
  357. package/.output/server/_libs/mdast-util-from-markdown+[...].mjs +8409 -0
  358. package/.output/server/_libs/mdast-util-gfm+[...].mjs +2346 -0
  359. package/.output/server/_libs/mdast-util-to-hast+[...].mjs +1772 -0
  360. package/.output/server/_libs/micromark-extension-gfm+[...].mjs +2234 -0
  361. package/.output/server/_libs/next-themes.mjs +124 -0
  362. package/.output/server/_libs/pierre__theme.mjs +10 -0
  363. package/.output/server/_libs/radix-ui__primitive.mjs +9 -0
  364. package/.output/server/_libs/radix-ui__react-compose-refs.mjs +30 -0
  365. package/.output/server/_libs/radix-ui__react-context.mjs +88 -0
  366. package/.output/server/_libs/react-markdown+[...].mjs +2316 -0
  367. package/.output/server/_libs/remark-gfm.mjs +34 -0
  368. package/.output/server/_libs/shiki.mjs +16 -0
  369. package/.output/server/_libs/shikijs__langs.mjs +1355 -0
  370. package/.output/server/_libs/shikijs__themes.mjs +262 -0
  371. package/.output/server/_libs/sonner.mjs +908 -0
  372. package/.output/server/_libs/sugar-high.mjs +1036 -0
  373. package/.output/server/_libs/tailwind-merge.mjs +1962 -0
  374. package/.output/server/_libs/tanstack__history.mjs +342 -0
  375. package/.output/server/_libs/tanstack__pacer.mjs +1111 -0
  376. package/.output/server/_libs/tanstack__query-core.mjs +2202 -0
  377. package/.output/server/_libs/tanstack__react-hotkeys.mjs +152 -0
  378. package/.output/server/_libs/tanstack__react-query.mjs +180 -0
  379. package/.output/server/_libs/tanstack__react-store.mjs +39 -0
  380. package/.output/server/_libs/tanstack__router-core.mjs +6 -0
  381. package/.output/server/_libs/tanstack__store.mjs +28 -0
  382. package/.output/server/_libs/ufo.mjs +64 -0
  383. package/.output/server/_libs/unctx.mjs +82 -0
  384. package/.output/server/_libs/ungap__structured-clone.mjs +197 -0
  385. package/.output/server/_libs/vaul.mjs +1250 -0
  386. package/.output/server/_libs/zod.mjs +3341 -0
  387. package/.output/server/_runtime.mjs +35 -0
  388. package/.output/server/_ssr/router-Bz70uQ0p.mjs +7231 -0
  389. package/.output/server/_ssr/routes-C7oV8l68.mjs +21622 -0
  390. package/.output/server/_ssr/routes-DGvt0TQ-.mjs +1275 -0
  391. package/.output/server/_ssr/ssr.mjs +5176 -0
  392. package/.output/server/_ssr/start-C9AjCGlr.mjs +4 -0
  393. package/.output/server/_tanstack-start-manifest_v-D0yEuwRY.mjs +65 -0
  394. package/.output/server/index.mjs +2563 -0
  395. package/.output/server/node_modules/tslib/modules/index.js +70 -0
  396. package/.output/server/node_modules/tslib/modules/package.json +3 -0
  397. package/.output/server/node_modules/tslib/package.json +47 -0
  398. package/.output/server/node_modules/tslib/tslib.js +484 -0
  399. package/.output/server/package.json +9 -0
  400. package/LICENSE +8 -0
  401. package/README.md +111 -0
  402. package/bin/pico.mjs +206 -0
  403. package/package.json +105 -0
  404. package/public/screenshots/pico-workspace-alt.png +0 -0
  405. package/public/screenshots/pico-workspace.png +0 -0
  406. package/scripts/patch-react-jsx-dev-runtime.mjs +93 -0
@@ -0,0 +1,1111 @@
1
+ import { n as Store } from "./@tanstack/hotkeys+[...].mjs";
2
+ import { t as EventClient } from "./@tanstack/devtools-event-client+[...].mjs";
3
+ //#region node_modules/.pnpm/@tanstack+pacer@0.21.0/node_modules/@tanstack/pacer/dist/utils.js
4
+ function isFunction(value) {
5
+ return typeof value === "function";
6
+ }
7
+ function parseFunctionOrValue(value, ...args) {
8
+ return isFunction(value) ? value(...args) : value;
9
+ }
10
+ //#endregion
11
+ //#region node_modules/.pnpm/@tanstack+pacer@0.21.0/node_modules/@tanstack/pacer/dist/event-client.js
12
+ var pacerDevtoolsInstancesByKey = /* @__PURE__ */ new Map();
13
+ function registerPacerDevtoolsInstance(key, instance) {
14
+ pacerDevtoolsInstancesByKey.set(key, instance);
15
+ }
16
+ function cloneJsonSafe(value) {
17
+ if (value === void 0) return;
18
+ try {
19
+ return JSON.parse(JSON.stringify(value));
20
+ } catch {
21
+ return null;
22
+ }
23
+ }
24
+ function readStoreSnapshot(store) {
25
+ if (typeof store.get === "function") return store.get();
26
+ return store.state;
27
+ }
28
+ function toPacerDevtoolsWirePayload(instance) {
29
+ return {
30
+ key: instance.key,
31
+ store: { state: cloneJsonSafe(readStoreSnapshot(instance.store)) },
32
+ options: cloneJsonSafe(instance.options)
33
+ };
34
+ }
35
+ var PacerEventClient = class extends EventClient {
36
+ constructor(props) {
37
+ super({
38
+ pluginId: "pacer",
39
+ debug: props?.debug,
40
+ reconnectEveryMs: 1e3
41
+ });
42
+ }
43
+ };
44
+ var emitChange = (event, instance) => {
45
+ const key = instance.key;
46
+ if (!key) return;
47
+ registerPacerDevtoolsInstance(key, instance);
48
+ pacerEventClient.emit(event, toPacerDevtoolsWirePayload({
49
+ ...instance,
50
+ key
51
+ }));
52
+ };
53
+ var pacerEventClient = new PacerEventClient();
54
+ //#endregion
55
+ //#region node_modules/.pnpm/@tanstack+pacer@0.21.0/node_modules/@tanstack/pacer/dist/async-retryer.js
56
+ /**
57
+ * Creates the default initial state for an AsyncRetryer instance
58
+ * @returns The default state with all values reset to initial values
59
+ */
60
+ function getDefaultAsyncRetryerState() {
61
+ return {
62
+ currentAttempt: 0,
63
+ executionCount: 0,
64
+ isExecuting: false,
65
+ lastError: void 0,
66
+ lastExecutionTime: 0,
67
+ lastResult: void 0,
68
+ status: "idle",
69
+ totalExecutionTime: 0
70
+ };
71
+ }
72
+ var defaultOptions$4 = {
73
+ backoff: "exponential",
74
+ baseWait: 1e3,
75
+ maxWait: Infinity,
76
+ enabled: true,
77
+ jitter: 0,
78
+ maxAttempts: 3,
79
+ maxExecutionTime: Infinity,
80
+ maxTotalExecutionTime: Infinity,
81
+ throwOnError: "last"
82
+ };
83
+ /**
84
+ * Provides robust retry functionality for asynchronous functions, supporting configurable backoff strategies,
85
+ * attempt limits, timeout controls, and detailed state management. The AsyncRetryer class is designed to help you reliably
86
+ * execute async operations that may fail intermittently, such as network requests or database operations,
87
+ * by automatically retrying them according to your chosen policy.
88
+ *
89
+ * ## Retrying Concepts
90
+ *
91
+ * - **Retrying**: Automatically re-executes a failed async function up to a specified number of attempts.
92
+ * Useful for handling transient errors (e.g., network flakiness, rate limits, temporary server issues).
93
+ * - **Backoff Strategies**: Controls the delay between retry attempts (default: `'exponential'`):
94
+ * - `'exponential'`: Wait time doubles with each attempt (1s, 2s, 4s, ...) - **DEFAULT**
95
+ * - `'linear'`: Wait time increases linearly (1s, 2s, 3s, ...)
96
+ * - `'fixed'`: Waits a constant amount of time (`baseWait`) between each attempt
97
+ * - **Jitter**: Adds randomness to retry delays to prevent thundering herd problems (default: `0`).
98
+ * Set to a value between 0-1 to apply that percentage of random variation to each delay.
99
+ * - **Max Wait**: Caps the maximum wait time between retries (default: `Infinity`).
100
+ * Useful for preventing exponential backoff from growing too large (e.g., cap at 30s even if exponential would be 64s).
101
+ * - **Timeout Controls**: Set limits on execution time to prevent hanging operations:
102
+ * - `maxExecutionTime`: Maximum time for a single function call (default: `Infinity`)
103
+ * - `maxTotalExecutionTime`: Maximum time for the entire retry operation (default: `Infinity`)
104
+ * - **Abort & Cancellation**: Supports cancellation via an internal `AbortController`. Call `abort()` to stop retries.
105
+ * Use `getAbortSignal()` to make your async function actually cancellable (e.g., with fetch requests).
106
+ *
107
+ * ## State Management
108
+ *
109
+ * Uses TanStack Store for fine-grained reactivity. State can be accessed via the `store.state` property.
110
+ *
111
+ * Available state properties:
112
+ * - `currentAttempt`: The current retry attempt number (0 when not executing)
113
+ * - `executionCount`: Total number of completed executions (successful or failed)
114
+ * - `isExecuting`: Whether the retryer is currently executing the function
115
+ * - `lastError`: The most recent error encountered during execution
116
+ * - `lastExecutionTime`: Timestamp of the last execution completion in milliseconds
117
+ * - `lastResult`: The result from the most recent successful execution
118
+ * - `status`: Current execution status ('disabled' | 'idle' | 'executing' | 'retrying')
119
+ * - `totalExecutionTime`: Total time spent executing (including retries) in milliseconds
120
+ *
121
+ * ## Error Handling
122
+ *
123
+ * The `throwOnError` option controls when errors are thrown (default: `'last'`):
124
+ * - `'last'`: Only throws the final error after all retries are exhausted - **DEFAULT**
125
+ * - `true`: Throws every error immediately (disables retrying)
126
+ * - `false`: Never throws errors, returns `undefined` instead
127
+ *
128
+ * Callbacks for lifecycle management:
129
+ * - `onAbort`: Called when execution is aborted (manually or due to timeouts)
130
+ * - `onError`: Called for every error (including during retries)
131
+ * - `onLastError`: Called only for the final error after all retries fail
132
+ * - `onRetry`: Called before each retry attempt
133
+ * - `onSettled`: Called after execution completes (success or failure) of each attempt
134
+ * - `onSuccess`: Called when execution succeeds
135
+ * - `onExecutionTimeout`: Called when a single execution attempt times out
136
+ * - `onTotalExecutionTimeout`: Called when the total execution time times out
137
+ *
138
+ * ## Usage
139
+ *
140
+ * - Use for async operations that may fail transiently and benefit from retrying.
141
+ * - Configure `maxAttempts`, `backoff`, `baseWait`, `maxWait`, and `jitter` to control retry behavior.
142
+ * - Set `maxExecutionTime` and `maxTotalExecutionTime` to prevent hanging operations.
143
+ * - Use `onAbort`, `onError`, `onLastError`, `onRetry`, `onSettled`, `onSuccess`, `onExecutionTimeout`, and `onTotalExecutionTimeout` for custom side effects.
144
+ * - Call `abort()` to cancel ongoing execution and pending retries.
145
+ * - Call `reset()` to reset state and cancel execution.
146
+ * - Use `getAbortSignal()` to make your async function cancellable.
147
+ * - Use dynamic options (functions) for `maxAttempts`, `baseWait`, and `enabled` based on retryer state.
148
+ *
149
+ * **Important:** This class is designed for single-use execution. Calling `execute()` multiple times
150
+ * on the same instance will abort previous executions. For multiple calls, create a new instance
151
+ * each time.
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * // Retry a fetch operation up to 5 times with exponential backoff, jitter, and timeouts
156
+ * const retryer = new AsyncRetryer(async (url: string) => {
157
+ * const signal = retryer.getAbortSignal()
158
+ * return await fetch(url, { signal })
159
+ * }, {
160
+ * maxAttempts: 5,
161
+ * backoff: 'exponential',
162
+ * baseWait: 1000,
163
+ * jitter: 0.1, // Add 10% random variation to prevent thundering herd
164
+ * maxExecutionTime: 5000, // Abort individual calls after 5 seconds
165
+ * maxTotalExecutionTime: 30000, // Abort entire operation after 30 seconds
166
+ * onRetry: (attempt, error) => console.log(`Retry attempt ${attempt} after error:`, error),
167
+ * onSuccess: (result) => console.log('Success:', result),
168
+ * onError: (error) => console.error('Error:', error),
169
+ * onLastError: (error) => console.error('All retries failed:', error),
170
+ * })
171
+ *
172
+ * const result = await retryer.execute('/api/data')
173
+ * ```
174
+ *
175
+ * @template TFn The async function type to be retried.
176
+ */
177
+ var AsyncRetryer = class {
178
+ #abortController;
179
+ /**
180
+ * Creates a new AsyncRetryer instance
181
+ * @param fn The async function to retry
182
+ * @param initialOptions Configuration options for the retryer
183
+ */
184
+ constructor(fn, initialOptions = {}) {
185
+ this.fn = fn;
186
+ this.store = new Store(getDefaultAsyncRetryerState());
187
+ this.#abortController = null;
188
+ this.setOptions = (newOptions) => {
189
+ this.options = {
190
+ ...this.options,
191
+ ...newOptions
192
+ };
193
+ };
194
+ this.#setState = (newState) => {
195
+ this.store.setState((state) => {
196
+ const combinedState = {
197
+ ...state,
198
+ ...newState
199
+ };
200
+ const { isExecuting, currentAttempt } = combinedState;
201
+ return {
202
+ ...combinedState,
203
+ status: !this.#getEnabled() ? "disabled" : isExecuting && currentAttempt === 1 ? "executing" : isExecuting && currentAttempt > 1 ? "retrying" : "idle"
204
+ };
205
+ });
206
+ emitChange("AsyncRetryer", this);
207
+ };
208
+ this.#getEnabled = () => {
209
+ return !!parseFunctionOrValue(this.options.enabled, this);
210
+ };
211
+ this.#getMaxAttempts = () => {
212
+ return parseFunctionOrValue(this.options.maxAttempts, this);
213
+ };
214
+ this.#getBaseWait = () => {
215
+ return parseFunctionOrValue(this.options.baseWait, this);
216
+ };
217
+ this.#getMaxWait = () => {
218
+ return parseFunctionOrValue(this.options.maxWait, this);
219
+ };
220
+ this.#calculateJitter = (waitTime) => {
221
+ const jitterAmount = this.options.jitter;
222
+ if (jitterAmount <= 0) return 0;
223
+ try {
224
+ const crypto = typeof globalThis !== "undefined" ? globalThis.crypto : void 0;
225
+ if (crypto?.getRandomValues) {
226
+ const array = new Uint32Array(1);
227
+ crypto.getRandomValues(array);
228
+ const randomFactor = array[0] / 4294967295 * 2 - 1;
229
+ return Math.floor(waitTime * jitterAmount * randomFactor);
230
+ }
231
+ } catch {}
232
+ return 0;
233
+ };
234
+ this.#calculateWait = (attempt) => {
235
+ const baseWait = this.#getBaseWait();
236
+ let waitTime;
237
+ switch (this.options.backoff) {
238
+ case "linear":
239
+ waitTime = baseWait * attempt;
240
+ break;
241
+ case "exponential":
242
+ waitTime = baseWait * Math.pow(2, attempt - 1);
243
+ break;
244
+ default:
245
+ waitTime = baseWait;
246
+ break;
247
+ }
248
+ waitTime = Math.min(waitTime, this.#getMaxWait());
249
+ const jitter = this.#calculateJitter(waitTime);
250
+ return Math.max(0, waitTime + jitter);
251
+ };
252
+ this.execute = async (...args) => {
253
+ if (!this.#getEnabled()) return;
254
+ this.abort("new-execution");
255
+ const startTime = Date.now();
256
+ let lastError;
257
+ let result;
258
+ this.#abortController = new AbortController();
259
+ const signal = this.#abortController.signal;
260
+ this.#setState({
261
+ isExecuting: true,
262
+ currentAttempt: 0,
263
+ lastError: void 0
264
+ });
265
+ let totalTimeoutId;
266
+ if (this.options.maxTotalExecutionTime !== Infinity) totalTimeoutId = setTimeout(() => {
267
+ this.options.onTotalExecutionTimeout?.(this);
268
+ this.abort("total-timeout");
269
+ }, this.options.maxTotalExecutionTime);
270
+ let isLastAttempt = false;
271
+ for (let attempt = 1; attempt <= this.#getMaxAttempts(); attempt++) {
272
+ isLastAttempt = attempt === this.#getMaxAttempts();
273
+ this.#setState({ currentAttempt: attempt });
274
+ try {
275
+ if (signal.aborted) return;
276
+ const currentTotalTime = Date.now() - startTime;
277
+ if (this.options.maxTotalExecutionTime !== Infinity && currentTotalTime >= this.options.maxTotalExecutionTime) {
278
+ this.options.onTotalExecutionTimeout?.(this);
279
+ this.abort("total-timeout");
280
+ return;
281
+ }
282
+ if (this.options.maxExecutionTime === Infinity) result = await this.fn(...args);
283
+ else result = await Promise.race([this.fn(...args), new Promise((_, reject) => {
284
+ const timeout = setTimeout(() => {
285
+ this.options.onExecutionTimeout?.(this);
286
+ this.abort("execution-timeout");
287
+ reject(/* @__PURE__ */ new Error(`Execution timeout: ${this.options.maxExecutionTime}ms exceeded`));
288
+ }, this.options.maxExecutionTime);
289
+ signal.addEventListener("abort", () => {
290
+ clearTimeout(timeout);
291
+ reject(/* @__PURE__ */ new Error("Aborted"));
292
+ }, { once: true });
293
+ })]);
294
+ if (signal.aborted) return;
295
+ const totalTime = Date.now() - startTime;
296
+ this.#setState({
297
+ executionCount: this.store.state.executionCount + 1,
298
+ isExecuting: false,
299
+ lastExecutionTime: Date.now(),
300
+ totalExecutionTime: totalTime,
301
+ currentAttempt: 0,
302
+ lastResult: result
303
+ });
304
+ this.options.onSuccess?.(result, args, this);
305
+ return result;
306
+ } catch (error) {
307
+ if (error && typeof error === "object" && "name" in error && error.name === "AbortError") return;
308
+ lastError = error instanceof Error ? error : new Error(String(error));
309
+ this.#setState({ lastError });
310
+ this.options.onError?.(lastError, args, this);
311
+ if (attempt < this.#getMaxAttempts()) {
312
+ this.options.onRetry?.(attempt, lastError, this);
313
+ const wait = this.#calculateWait(attempt);
314
+ if (wait > 0) {
315
+ this.#setState({
316
+ isExecuting: true,
317
+ currentAttempt: attempt + 1
318
+ });
319
+ await new Promise((resolve) => {
320
+ const timeout = setTimeout(() => {
321
+ signal.removeEventListener("abort", onAbort);
322
+ resolve();
323
+ }, wait);
324
+ const onAbort = () => {
325
+ clearTimeout(timeout);
326
+ signal.removeEventListener("abort", onAbort);
327
+ resolve();
328
+ };
329
+ signal.addEventListener("abort", onAbort);
330
+ });
331
+ if (signal.aborted) return;
332
+ }
333
+ }
334
+ } finally {
335
+ this.options.onSettled?.(args, this);
336
+ }
337
+ }
338
+ if (totalTimeoutId) clearTimeout(totalTimeoutId);
339
+ this.#setState({ isExecuting: false });
340
+ this.options.onLastError?.(lastError, this);
341
+ this.options.onSettled?.(args, this);
342
+ if (this.options.throwOnError === "last" && isLastAttempt || this.options.throwOnError === true) throw lastError;
343
+ };
344
+ this.getAbortSignal = () => {
345
+ return this.#abortController?.signal ?? null;
346
+ };
347
+ this.abort = (reason = "manual") => {
348
+ if (this.#abortController) {
349
+ this.#abortController.abort();
350
+ this.#abortController = null;
351
+ this.#setState({ isExecuting: false });
352
+ this.options.onAbort?.(reason, this);
353
+ }
354
+ };
355
+ this.reset = () => {
356
+ this.#setState(getDefaultAsyncRetryerState());
357
+ };
358
+ this.key = initialOptions.key;
359
+ this.options = {
360
+ ...defaultOptions$4,
361
+ ...initialOptions,
362
+ throwOnError: initialOptions.throwOnError ?? (initialOptions.onError ? false : defaultOptions$4.throwOnError)
363
+ };
364
+ this.#setState(this.options.initialState ?? {});
365
+ if (this.key) pacerEventClient.on("d-AsyncRetryer", (event) => {
366
+ if (event.payload.key !== this.key) return;
367
+ this.#setState(event.payload.store.state);
368
+ this.setOptions(event.payload.options);
369
+ });
370
+ }
371
+ #setState;
372
+ #getEnabled;
373
+ #getMaxAttempts;
374
+ #getBaseWait;
375
+ #getMaxWait;
376
+ #calculateJitter;
377
+ #calculateWait;
378
+ };
379
+ //#endregion
380
+ //#region node_modules/.pnpm/@tanstack+pacer@0.21.0/node_modules/@tanstack/pacer/dist/async-debouncer.js
381
+ function getDefaultAsyncDebouncerState() {
382
+ return {
383
+ canLeadingExecute: true,
384
+ errorCount: 0,
385
+ isExecuting: false,
386
+ isPending: false,
387
+ lastArgs: void 0,
388
+ lastResult: void 0,
389
+ maybeExecuteCount: 0,
390
+ settleCount: 0,
391
+ status: "idle",
392
+ successCount: 0
393
+ };
394
+ }
395
+ var defaultOptions$3 = {
396
+ asyncRetryerOptions: { maxAttempts: 1 },
397
+ enabled: true,
398
+ leading: false,
399
+ trailing: true,
400
+ wait: 0
401
+ };
402
+ /**
403
+ * A class that creates an async debounced function.
404
+ *
405
+ * Async vs Sync Versions:
406
+ * The async version provides advanced features over the sync Debouncer:
407
+ * - Returns promises that can be awaited for debounced function results
408
+ * - Built-in retry support via AsyncRetryer integration
409
+ * - Abort support to cancel in-flight executions
410
+ * - Cancel support to prevent pending executions from starting
411
+ * - Comprehensive error handling with onError callbacks and throwOnError control
412
+ * - Detailed execution tracking (success/error/settle counts)
413
+ *
414
+ * The sync Debouncer is lighter weight and simpler when you don't need async features,
415
+ * return values, or execution control.
416
+ *
417
+ * What is Debouncing?
418
+ * Debouncing ensures that a function is only executed after a specified delay has passed since its last invocation.
419
+ * Each new invocation resets the delay timer. This is useful for handling frequent events like window resizing
420
+ * or input changes where you only want to execute the handler after the events have stopped occurring.
421
+ *
422
+ * Unlike throttling which allows execution at regular intervals, debouncing prevents any execution until
423
+ * the function stops being called for the specified delay period.
424
+ *
425
+ * Error Handling:
426
+ * - If an `onError` handler is provided, it will be called with the error and debouncer instance
427
+ * - If `throwOnError` is true (default when no onError handler is provided), the error will be thrown
428
+ * - If `throwOnError` is false (default when onError handler is provided), the error will be swallowed
429
+ * - Both onError and throwOnError can be used together - the handler will be called before any error is thrown
430
+ * - The error state can be checked using the underlying store
431
+ *
432
+ * State Management:
433
+ * - The debouncer uses a reactive store for state management
434
+ * - Use `initialState` to provide initial state values when creating the async debouncer
435
+ * - The state includes canLeadingExecute, error count, execution status, and success/settle counts
436
+ * - State can be accessed via the `store` property and its `state` getter
437
+ * - The store is reactive and will notify subscribers of state changes
438
+ *
439
+ * @example
440
+ * ```ts
441
+ * const asyncDebouncer = new AsyncDebouncer(async (value: string) => {
442
+ * const results = await searchAPI(value);
443
+ * return results; // Return value is preserved
444
+ * }, {
445
+ * wait: 500,
446
+ * onError: (error) => {
447
+ * console.error('Search failed:', error);
448
+ * }
449
+ * });
450
+ *
451
+ * // Called on each keystroke but only executes after 500ms of no typing
452
+ * // Returns the API response directly
453
+ * const results = await asyncDebouncer.maybeExecute(inputElement.value);
454
+ * ```
455
+ */
456
+ var AsyncDebouncer = class {
457
+ #timeoutId;
458
+ #resolvePreviousPromise;
459
+ constructor(fn, initialOptions) {
460
+ this.fn = fn;
461
+ this.store = new Store(getDefaultAsyncDebouncerState());
462
+ this.asyncRetryers = /* @__PURE__ */ new Map();
463
+ this.#timeoutId = null;
464
+ this.#resolvePreviousPromise = null;
465
+ this.setOptions = (newOptions) => {
466
+ this.options = {
467
+ ...this.options,
468
+ ...newOptions
469
+ };
470
+ if (!this.#getEnabled()) this.cancel();
471
+ };
472
+ this.#setState = (newState) => {
473
+ this.store.setState((state) => {
474
+ const combinedState = {
475
+ ...state,
476
+ ...newState
477
+ };
478
+ const { isPending, isExecuting, settleCount } = combinedState;
479
+ return {
480
+ ...combinedState,
481
+ status: !this.#getEnabled() ? "disabled" : isPending ? "pending" : isExecuting ? "executing" : settleCount > 0 ? "settled" : "idle"
482
+ };
483
+ });
484
+ emitChange("AsyncDebouncer", this);
485
+ };
486
+ this.#getEnabled = () => {
487
+ return !!parseFunctionOrValue(this.options.enabled, this);
488
+ };
489
+ this.#getWait = () => {
490
+ return parseFunctionOrValue(this.options.wait, this);
491
+ };
492
+ this.maybeExecute = async (...args) => {
493
+ if (!this.#getEnabled()) return void 0;
494
+ this.#cancelPendingExecution();
495
+ this.#setState({
496
+ lastArgs: args,
497
+ maybeExecuteCount: this.store.state.maybeExecuteCount + 1
498
+ });
499
+ if (this.options.leading && this.store.state.canLeadingExecute) {
500
+ this.#setState({ canLeadingExecute: false });
501
+ await this.#execute(...args);
502
+ return this.store.state.lastResult;
503
+ }
504
+ if (this.options.trailing && this.#getEnabled()) this.#setState({ isPending: true });
505
+ return new Promise((resolve, reject) => {
506
+ this.#resolvePreviousPromise = resolve;
507
+ this.#timeoutId = setTimeout(async () => {
508
+ if (this.options.trailing && this.store.state.lastArgs) try {
509
+ await this.#execute(...this.store.state.lastArgs);
510
+ } catch (error) {
511
+ reject(error);
512
+ }
513
+ this.#setState({ canLeadingExecute: true });
514
+ this.#resolvePreviousPromise = null;
515
+ resolve(this.store.state.lastResult);
516
+ }, this.#getWait());
517
+ });
518
+ };
519
+ this.#execute = async (...args) => {
520
+ if (!this.#getEnabled()) return void 0;
521
+ const currentMaybeExecuteCount = this.store.state.maybeExecuteCount + 1;
522
+ try {
523
+ this.#setState({ isExecuting: true });
524
+ const currentAsyncRetryer = new AsyncRetryer(this.fn, {
525
+ ...this.options.asyncRetryerOptions,
526
+ key: `${this.key}-retryer-${currentMaybeExecuteCount}`
527
+ });
528
+ this.asyncRetryers.set(currentMaybeExecuteCount, currentAsyncRetryer);
529
+ const result = await currentAsyncRetryer.execute(...args);
530
+ this.#setState({
531
+ lastResult: result,
532
+ successCount: this.store.state.successCount + 1
533
+ });
534
+ this.options.onSuccess?.(result, args, this);
535
+ } catch (error) {
536
+ this.#setState({ errorCount: this.store.state.errorCount + 1 });
537
+ this.options.onError?.(error, args, this);
538
+ if (this.options.throwOnError) throw error;
539
+ } finally {
540
+ this.asyncRetryers.delete(currentMaybeExecuteCount);
541
+ this.#setState({
542
+ isExecuting: false,
543
+ isPending: false,
544
+ lastArgs: void 0,
545
+ settleCount: this.store.state.settleCount + 1
546
+ });
547
+ this.options.onSettled?.(args, this);
548
+ }
549
+ return this.store.state.lastResult;
550
+ };
551
+ this.flush = async () => {
552
+ if (this.store.state.isPending && this.store.state.lastArgs) {
553
+ const { lastArgs } = this.store.state;
554
+ this.#cancelPendingExecution();
555
+ return await this.#execute(...lastArgs);
556
+ }
557
+ };
558
+ this.#resolvePreviousPromiseInternal = () => {
559
+ if (this.#resolvePreviousPromise) {
560
+ this.#resolvePreviousPromise(this.store.state.lastResult);
561
+ this.#resolvePreviousPromise = null;
562
+ }
563
+ };
564
+ this.#clearTimeout = () => {
565
+ if (this.#timeoutId) {
566
+ clearTimeout(this.#timeoutId);
567
+ this.#timeoutId = null;
568
+ }
569
+ };
570
+ this.#cancelPendingExecution = () => {
571
+ this.#clearTimeout();
572
+ this.#resolvePreviousPromiseInternal();
573
+ this.#setState({
574
+ isPending: false,
575
+ lastArgs: void 0
576
+ });
577
+ };
578
+ this.getAbortSignal = (maybeExecuteCount) => {
579
+ const count = maybeExecuteCount ?? this.store.state.maybeExecuteCount;
580
+ return this.asyncRetryers.get(count)?.getAbortSignal() ?? null;
581
+ };
582
+ this.abort = () => {
583
+ this.asyncRetryers.forEach((retryer) => retryer.abort());
584
+ this.asyncRetryers.clear();
585
+ this.#setState({ isExecuting: false });
586
+ };
587
+ this.cancel = () => {
588
+ this.#cancelPendingExecution();
589
+ this.#setState({ canLeadingExecute: true });
590
+ };
591
+ this.reset = () => {
592
+ this.#setState(getDefaultAsyncDebouncerState());
593
+ this.asyncRetryers.forEach((retryer) => retryer.reset());
594
+ };
595
+ this.key = initialOptions.key;
596
+ this.options = {
597
+ ...defaultOptions$3,
598
+ ...initialOptions,
599
+ throwOnError: initialOptions.throwOnError ?? !initialOptions.onError
600
+ };
601
+ this.#setState(this.options.initialState ?? {});
602
+ if (this.key) pacerEventClient.on("d-AsyncDebouncer", (event) => {
603
+ if (event.payload.key !== this.key) return;
604
+ this.#setState(event.payload.store.state);
605
+ this.setOptions(event.payload.options);
606
+ });
607
+ }
608
+ #setState;
609
+ /**
610
+ * Returns the current debouncer enabled state
611
+ */
612
+ #getEnabled;
613
+ /**
614
+ * Returns the current debouncer wait state
615
+ */
616
+ #getWait;
617
+ #execute;
618
+ #resolvePreviousPromiseInternal;
619
+ #clearTimeout;
620
+ /**
621
+ * Internal cancel without resetting the leading execute state
622
+ */
623
+ #cancelPendingExecution;
624
+ };
625
+ //#endregion
626
+ //#region node_modules/.pnpm/@tanstack+pacer@0.21.0/node_modules/@tanstack/pacer/dist/batcher.js
627
+ function getDefaultBatcherState() {
628
+ return {
629
+ executionCount: 0,
630
+ isEmpty: true,
631
+ isPending: false,
632
+ totalItemsProcessed: 0,
633
+ items: [],
634
+ size: 0,
635
+ status: "idle"
636
+ };
637
+ }
638
+ var defaultOptions$2 = {
639
+ getShouldExecute: () => false,
640
+ maxSize: Infinity,
641
+ started: true,
642
+ wait: Infinity
643
+ };
644
+ /**
645
+ * A class that collects items and processes them in batches.
646
+ *
647
+ * Batching is a technique for grouping multiple operations together to be processed as a single unit.
648
+ * This synchronous version is lighter weight and often all you need - upgrade to AsyncBatcher when you need promises, retry support, abort/cancel capabilities, or advanced error handling.
649
+ *
650
+ * The Batcher provides a flexible way to implement batching with configurable:
651
+ * - Maximum batch size (number of items per batch)
652
+ * - Time-based batching (process after X milliseconds)
653
+ * - Custom batch processing logic via getShouldExecute
654
+ * - Event callbacks for monitoring batch operations
655
+ *
656
+ * State Management:
657
+ * - Uses TanStack Store for reactive state management
658
+ * - Use `initialState` to provide initial state values when creating the batcher
659
+ * - Use `onExecute` callback to react to batch execution and implement custom logic
660
+ * - Use `onItemsChange` callback to react to items being added or removed from the batcher
661
+ * - The state includes batch execution count, total items processed, items, and running status
662
+ * - State can be accessed via `batcher.store.state` when using the class directly
663
+ * - When using framework adapters (React/Solid), state is accessed from `batcher.state`
664
+ *
665
+ * @example
666
+ * ```ts
667
+ * const batcher = new Batcher<number>(
668
+ * (items) => console.log('Processing batch:', items),
669
+ * {
670
+ * maxSize: 5,
671
+ * wait: 2000,
672
+ * onExecute: (batch, batcher) => console.log('Batch executed:', batch)
673
+ * }
674
+ * );
675
+ *
676
+ * batcher.addItem(1);
677
+ * batcher.addItem(2);
678
+ * // After 2 seconds or when 5 items are added, whichever comes first,
679
+ * // the batch will be processed
680
+ * // batcher.flush() // manually trigger a batch
681
+ * ```
682
+ */
683
+ var Batcher = class {
684
+ #timeoutId;
685
+ constructor(fn, initialOptions) {
686
+ this.fn = fn;
687
+ this.store = new Store(getDefaultBatcherState());
688
+ this.#timeoutId = null;
689
+ this.setOptions = (newOptions) => {
690
+ this.options = {
691
+ ...this.options,
692
+ ...newOptions
693
+ };
694
+ };
695
+ this.#setState = (newState) => {
696
+ this.store.setState((state) => {
697
+ const combinedState = {
698
+ ...state,
699
+ ...newState
700
+ };
701
+ const { isPending, items } = combinedState;
702
+ const size = items.length;
703
+ const isEmpty = size === 0;
704
+ return {
705
+ ...combinedState,
706
+ isEmpty,
707
+ size,
708
+ status: isPending ? "pending" : "idle"
709
+ };
710
+ });
711
+ emitChange("Batcher", this);
712
+ };
713
+ this.#getWait = () => {
714
+ return parseFunctionOrValue(this.options.wait, this);
715
+ };
716
+ this.addItem = (item) => {
717
+ this.#setState({
718
+ items: [...this.store.state.items, item],
719
+ isPending: this.options.wait !== Infinity
720
+ });
721
+ this.options.onItemsChange?.(this);
722
+ if (this.store.state.items.length >= this.options.maxSize || this.options.getShouldExecute(this.store.state.items, this)) this.#execute();
723
+ else if (this.options.wait !== Infinity) {
724
+ this.#clearTimeout();
725
+ this.#timeoutId = setTimeout(() => this.#execute(), this.#getWait());
726
+ }
727
+ };
728
+ this.#execute = () => {
729
+ if (this.store.state.items.length === 0) return;
730
+ const batch = this.peekAllItems();
731
+ this.clear();
732
+ this.options.onItemsChange?.(this);
733
+ this.fn(batch);
734
+ this.#setState({
735
+ executionCount: this.store.state.executionCount + 1,
736
+ totalItemsProcessed: this.store.state.totalItemsProcessed + batch.length
737
+ });
738
+ this.options.onExecute?.(batch, this);
739
+ };
740
+ this.flush = () => {
741
+ this.#clearTimeout();
742
+ this.#execute();
743
+ };
744
+ this.peekAllItems = () => {
745
+ return [...this.store.state.items];
746
+ };
747
+ this.#clearTimeout = () => {
748
+ if (this.#timeoutId) {
749
+ clearTimeout(this.#timeoutId);
750
+ this.#timeoutId = null;
751
+ }
752
+ };
753
+ this.clear = () => {
754
+ this.#setState({
755
+ items: [],
756
+ isPending: false
757
+ });
758
+ };
759
+ this.cancel = () => {
760
+ this.#clearTimeout();
761
+ this.#setState({ isPending: false });
762
+ };
763
+ this.reset = () => {
764
+ this.#setState(getDefaultBatcherState());
765
+ this.options.onItemsChange?.(this);
766
+ };
767
+ this.key = initialOptions.key;
768
+ this.options = {
769
+ ...defaultOptions$2,
770
+ ...initialOptions
771
+ };
772
+ this.#setState(this.options.initialState ?? {});
773
+ if (this.key) pacerEventClient.on("d-Batcher", (event) => {
774
+ if (event.payload.key !== this.key) return;
775
+ this.#setState(event.payload.store.state);
776
+ this.setOptions(event.payload.options);
777
+ });
778
+ }
779
+ #setState;
780
+ #getWait;
781
+ /**
782
+ * Processes the current batch of items.
783
+ * This method will automatically be triggered if the batcher is running and any of these conditions are met:
784
+ * - The number of items reaches batchSize
785
+ * - The wait duration has elapsed
786
+ * - The getShouldExecute function returns true upon adding an item
787
+ *
788
+ * You can also call this method manually to process the current batch at any time.
789
+ */
790
+ #execute;
791
+ #clearTimeout;
792
+ };
793
+ //#endregion
794
+ //#region node_modules/.pnpm/@tanstack+pacer@0.21.0/node_modules/@tanstack/pacer/dist/debouncer.js
795
+ function getDefaultDebouncerState() {
796
+ return {
797
+ canLeadingExecute: true,
798
+ executionCount: 0,
799
+ isPending: false,
800
+ lastArgs: void 0,
801
+ status: "idle",
802
+ maybeExecuteCount: 0
803
+ };
804
+ }
805
+ var defaultOptions$1 = {
806
+ enabled: true,
807
+ leading: false,
808
+ trailing: true,
809
+ wait: 0
810
+ };
811
+ /**
812
+ * A class that creates a debounced function.
813
+ *
814
+ * Debouncing ensures that a function is only executed after a certain amount of time has passed
815
+ * since its last invocation. This is useful for handling frequent events like window resizing,
816
+ * scroll events, or input changes where you want to limit the rate of execution.
817
+ * This synchronous version is lighter weight and often all you need - upgrade to AsyncDebouncer when you need promises, retry support, abort/cancel capabilities, or advanced error handling.
818
+ *
819
+ * The debounced function can be configured to execute either at the start of the delay period
820
+ * (leading edge) or at the end (trailing edge, default). Each new call during the wait period
821
+ * will reset the timer.
822
+ *
823
+ * State Management:
824
+ * - Uses TanStack Store for reactive state management
825
+ * - Use `initialState` to provide initial state values when creating the debouncer
826
+ * - Use `onExecute` callback to react to function execution and implement custom logic
827
+ * - The state includes canLeadingExecute, execution count, and isPending status
828
+ * - State can be accessed via `debouncer.store.state` when using the class directly
829
+ * - When using framework adapters (React/Solid), state is accessed from `debouncer.state`
830
+ *
831
+ * @example
832
+ * ```ts
833
+ * const debouncer = new Debouncer((value: string) => {
834
+ * saveToDatabase(value);
835
+ * }, { wait: 500 });
836
+ *
837
+ * // Will only save after 500ms of no new input
838
+ * inputElement.addEventListener('input', () => {
839
+ * debouncer.maybeExecute(inputElement.value);
840
+ * });
841
+ * ```
842
+ */
843
+ var Debouncer = class {
844
+ #timeoutId;
845
+ constructor(fn, initialOptions) {
846
+ this.fn = fn;
847
+ this.store = new Store(getDefaultDebouncerState());
848
+ this.setOptions = (newOptions) => {
849
+ this.options = {
850
+ ...this.options,
851
+ ...newOptions
852
+ };
853
+ if (!this.#getEnabled()) this.cancel();
854
+ };
855
+ this.#setState = (newState) => {
856
+ this.store.setState((state) => {
857
+ const combinedState = {
858
+ ...state,
859
+ ...newState
860
+ };
861
+ const { isPending } = combinedState;
862
+ return {
863
+ ...combinedState,
864
+ status: !this.#getEnabled() ? "disabled" : isPending ? "pending" : "idle"
865
+ };
866
+ });
867
+ emitChange("Debouncer", this);
868
+ };
869
+ this.#getEnabled = () => {
870
+ return !!parseFunctionOrValue(this.options.enabled, this);
871
+ };
872
+ this.#getWait = () => {
873
+ return parseFunctionOrValue(this.options.wait, this);
874
+ };
875
+ this.maybeExecute = (...args) => {
876
+ if (!this.#getEnabled()) return void 0;
877
+ this.#setState({ maybeExecuteCount: this.store.state.maybeExecuteCount + 1 });
878
+ let _didLeadingExecute = false;
879
+ if (this.options.leading && this.store.state.canLeadingExecute) {
880
+ this.#setState({ canLeadingExecute: false });
881
+ _didLeadingExecute = true;
882
+ this.#execute(...args);
883
+ }
884
+ if (this.options.trailing) this.#setState({
885
+ isPending: true,
886
+ lastArgs: args
887
+ });
888
+ if (this.#timeoutId) clearTimeout(this.#timeoutId);
889
+ this.#timeoutId = setTimeout(() => {
890
+ this.#setState({ canLeadingExecute: true });
891
+ if (this.options.trailing && !_didLeadingExecute) this.#execute(...args);
892
+ }, this.#getWait());
893
+ };
894
+ this.#execute = (...args) => {
895
+ if (!this.#getEnabled()) return void 0;
896
+ this.fn(...args);
897
+ this.#setState({
898
+ executionCount: this.store.state.executionCount + 1,
899
+ isPending: false,
900
+ lastArgs: void 0
901
+ });
902
+ this.options.onExecute?.(args, this);
903
+ };
904
+ this.flush = () => {
905
+ if (this.store.state.isPending && this.store.state.lastArgs) {
906
+ this.#clearTimeout();
907
+ this.#execute(...this.store.state.lastArgs);
908
+ }
909
+ };
910
+ this.#clearTimeout = () => {
911
+ if (this.#timeoutId) {
912
+ clearTimeout(this.#timeoutId);
913
+ this.#timeoutId = void 0;
914
+ }
915
+ };
916
+ this.cancel = () => {
917
+ this.#clearTimeout();
918
+ this.#setState({
919
+ canLeadingExecute: true,
920
+ isPending: false
921
+ });
922
+ };
923
+ this.reset = () => {
924
+ this.#setState(getDefaultDebouncerState());
925
+ };
926
+ this.key = initialOptions.key;
927
+ this.options = {
928
+ ...defaultOptions$1,
929
+ ...initialOptions
930
+ };
931
+ this.#setState(this.options.initialState ?? {});
932
+ if (this.key) pacerEventClient.on("d-Debouncer", (event) => {
933
+ if (event.payload.key !== this.key) return;
934
+ this.#setState(event.payload.store.state);
935
+ this.setOptions(event.payload.options);
936
+ });
937
+ }
938
+ #setState;
939
+ /**
940
+ * Returns the current enabled state of the debouncer
941
+ */
942
+ #getEnabled;
943
+ /**
944
+ * Returns the current wait time in milliseconds
945
+ */
946
+ #getWait;
947
+ #execute;
948
+ #clearTimeout;
949
+ };
950
+ //#endregion
951
+ //#region node_modules/.pnpm/@tanstack+pacer@0.21.0/node_modules/@tanstack/pacer/dist/throttler.js
952
+ function getDefaultThrottlerState() {
953
+ return {
954
+ executionCount: 0,
955
+ isPending: false,
956
+ lastArgs: void 0,
957
+ lastExecutionTime: 0,
958
+ nextExecutionTime: 0,
959
+ status: "idle",
960
+ maybeExecuteCount: 0
961
+ };
962
+ }
963
+ var defaultOptions = {
964
+ enabled: true,
965
+ leading: true,
966
+ trailing: true,
967
+ wait: 0
968
+ };
969
+ /**
970
+ * A class that creates a throttled function.
971
+ *
972
+ * Throttling ensures a function is called at most once within a specified time window.
973
+ * Unlike debouncing which waits for a pause in calls, throttling guarantees consistent
974
+ * execution timing regardless of call frequency.
975
+ * This synchronous version is lighter weight and often all you need - upgrade to AsyncThrottler when you need promises, retry support, abort/cancel capabilities, or advanced error handling.
976
+ *
977
+ * Supports both leading and trailing edge execution:
978
+ * - Leading: Execute immediately on first call (default: true)
979
+ * - Trailing: Execute after wait period if called during throttle (default: true)
980
+ *
981
+ * For collapsing rapid-fire events where you only care about the last call, consider using Debouncer.
982
+ *
983
+ * State Management:
984
+ * - Uses TanStack Store for reactive state management
985
+ * - Use `initialState` to provide initial state values when creating the throttler
986
+ * - Use `onExecute` callback to react to function execution and implement custom logic
987
+ * - The state includes execution count, last execution time, pending status, and more
988
+ * - State can be accessed via `throttler.store.state` when using the class directly
989
+ * - When using framework adapters (React/Solid), state is accessed from `throttler.state`
990
+ *
991
+ * @example
992
+ * ```ts
993
+ * const throttler = new Throttler(
994
+ * (id: string) => api.getData(id),
995
+ * { wait: 1000 } // Execute at most once per second
996
+ * );
997
+ *
998
+ * // First call executes immediately
999
+ * throttler.maybeExecute('123');
1000
+ *
1001
+ * // Subsequent calls within 1000ms are throttled
1002
+ * throttler.maybeExecute('123'); // Throttled
1003
+ * ```
1004
+ */
1005
+ var Throttler = class {
1006
+ #timeoutId;
1007
+ constructor(fn, initialOptions) {
1008
+ this.fn = fn;
1009
+ this.store = new Store(getDefaultThrottlerState());
1010
+ this.setOptions = (newOptions) => {
1011
+ this.options = {
1012
+ ...this.options,
1013
+ ...newOptions
1014
+ };
1015
+ if (!this.#getEnabled()) this.cancel();
1016
+ };
1017
+ this.#setState = (newState) => {
1018
+ this.store.setState((state) => {
1019
+ const combinedState = {
1020
+ ...state,
1021
+ ...newState
1022
+ };
1023
+ const { isPending } = combinedState;
1024
+ return {
1025
+ ...combinedState,
1026
+ status: !this.#getEnabled() ? "disabled" : isPending ? "pending" : "idle"
1027
+ };
1028
+ });
1029
+ emitChange("Throttler", this);
1030
+ };
1031
+ this.#getEnabled = () => {
1032
+ return !!parseFunctionOrValue(this.options.enabled, this);
1033
+ };
1034
+ this.#getWait = () => {
1035
+ return parseFunctionOrValue(this.options.wait, this);
1036
+ };
1037
+ this.maybeExecute = (...args) => {
1038
+ this.#setState({ maybeExecuteCount: this.store.state.maybeExecuteCount + 1 });
1039
+ const now = Date.now();
1040
+ const timeSinceLastExecution = now - this.store.state.lastExecutionTime;
1041
+ const wait = this.#getWait();
1042
+ if (this.options.leading && timeSinceLastExecution >= wait) this.#execute(...args);
1043
+ else {
1044
+ this.#setState({ lastArgs: args });
1045
+ if (!this.#timeoutId && this.options.trailing) {
1046
+ const timeoutDuration = wait - (this.store.state.lastExecutionTime ? now - this.store.state.lastExecutionTime : 0);
1047
+ this.#setState({ isPending: true });
1048
+ this.#timeoutId = setTimeout(() => {
1049
+ const { lastArgs } = this.store.state;
1050
+ if (lastArgs !== void 0) this.#execute(...lastArgs);
1051
+ }, timeoutDuration);
1052
+ }
1053
+ }
1054
+ };
1055
+ this.#execute = (...args) => {
1056
+ if (!this.#getEnabled()) return;
1057
+ this.fn(...args);
1058
+ const lastExecutionTime = Date.now();
1059
+ const nextExecutionTime = lastExecutionTime + this.#getWait();
1060
+ this.#clearTimeout();
1061
+ this.#setState({
1062
+ executionCount: this.store.state.executionCount + 1,
1063
+ lastExecutionTime,
1064
+ nextExecutionTime,
1065
+ isPending: false,
1066
+ lastArgs: void 0
1067
+ });
1068
+ this.options.onExecute?.(args, this);
1069
+ setTimeout(() => {
1070
+ if (!this.store.state.isPending) this.#setState({ nextExecutionTime: void 0 });
1071
+ }, this.#getWait());
1072
+ };
1073
+ this.flush = () => {
1074
+ if (this.store.state.isPending && this.store.state.lastArgs) this.#execute(...this.store.state.lastArgs);
1075
+ };
1076
+ this.#clearTimeout = () => {
1077
+ if (this.#timeoutId) {
1078
+ clearTimeout(this.#timeoutId);
1079
+ this.#timeoutId = void 0;
1080
+ }
1081
+ };
1082
+ this.cancel = () => {
1083
+ this.#clearTimeout();
1084
+ this.#setState({
1085
+ lastArgs: void 0,
1086
+ isPending: false
1087
+ });
1088
+ };
1089
+ this.reset = () => {
1090
+ this.#setState(getDefaultThrottlerState());
1091
+ };
1092
+ this.key = initialOptions.key;
1093
+ this.options = {
1094
+ ...defaultOptions,
1095
+ ...initialOptions
1096
+ };
1097
+ this.#setState(this.options.initialState ?? {});
1098
+ if (this.key) pacerEventClient.on("d-Throttler", (event) => {
1099
+ if (event.payload.key !== this.key) return;
1100
+ this.#setState(event.payload.store.state);
1101
+ this.setOptions(event.payload.options);
1102
+ });
1103
+ }
1104
+ #setState;
1105
+ #getEnabled;
1106
+ #getWait;
1107
+ #execute;
1108
+ #clearTimeout;
1109
+ };
1110
+ //#endregion
1111
+ export { AsyncDebouncer as i, Debouncer as n, Batcher as r, Throttler as t };