palettecn 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 (460) hide show
  1. package/dist/index.mjs +10 -0
  2. package/dist/web/nitro.json +17 -0
  3. package/dist/web/public/assets/abap-BdvmRIgS.js +1 -0
  4. package/dist/web/public/assets/actionscript-3-et0rQaqm.js +1 -0
  5. package/dist/web/public/assets/ada-DPgrustg.js +1 -0
  6. package/dist/web/public/assets/andromeeda-DJl1yeV_.js +1 -0
  7. package/dist/web/public/assets/angular-html-Dm7s7tSx.js +1 -0
  8. package/dist/web/public/assets/angular-ts-B_ywTULt.js +1 -0
  9. package/dist/web/public/assets/apache-CFpsYX8S.js +1 -0
  10. package/dist/web/public/assets/apex-CN5n6pbI.js +1 -0
  11. package/dist/web/public/assets/apl-Dm11wHHc.js +1 -0
  12. package/dist/web/public/assets/applescript-JrY23hsL.js +1 -0
  13. package/dist/web/public/assets/ara-DR83hn3A.js +1 -0
  14. package/dist/web/public/assets/asciidoc-Dpu9XLB1.js +1 -0
  15. package/dist/web/public/assets/asm-BYI3A31V.js +1 -0
  16. package/dist/web/public/assets/astro-DP1naDCT.js +1 -0
  17. package/dist/web/public/assets/aurora-x-Nav5jnoQ.js +1 -0
  18. package/dist/web/public/assets/awk-BIoTx_w6.js +1 -0
  19. package/dist/web/public/assets/ayu-dark-H5QV5J7K.js +1 -0
  20. package/dist/web/public/assets/ayu-light-BrwTNGnU.js +1 -0
  21. package/dist/web/public/assets/ayu-mirage-Bg6FpF5w.js +1 -0
  22. package/dist/web/public/assets/ballerina-BFvDNd4T.js +1 -0
  23. package/dist/web/public/assets/bat-DtQkx7Ny.js +1 -0
  24. package/dist/web/public/assets/beancount-BIjKALa1.js +1 -0
  25. package/dist/web/public/assets/berry-BPkDN_EZ.js +1 -0
  26. package/dist/web/public/assets/bibtex-Dur2CNW6.js +1 -0
  27. package/dist/web/public/assets/bicep-BMz1bZ7m.js +1 -0
  28. package/dist/web/public/assets/bird2-91rdr9s7.js +1 -0
  29. package/dist/web/public/assets/blade-DD5O596X.js +1 -0
  30. package/dist/web/public/assets/bsl-FmB7U2qd.js +1 -0
  31. package/dist/web/public/assets/bundle-mjs-Bso3xn9x.js +1 -0
  32. package/dist/web/public/assets/c-DqqBLLyl.js +1 -0
  33. package/dist/web/public/assets/c3-CJTbEooS.js +1 -0
  34. package/dist/web/public/assets/cadence-C0GI7BZZ.js +1 -0
  35. package/dist/web/public/assets/cairo-B5JMmIC0.js +1 -0
  36. package/dist/web/public/assets/catppuccin-frappe-D76-cUjK.js +1 -0
  37. package/dist/web/public/assets/catppuccin-latte-DUHNJ_6_.js +1 -0
  38. package/dist/web/public/assets/catppuccin-macchiato-CFhPH2wd.js +1 -0
  39. package/dist/web/public/assets/catppuccin-mocha-BRD0cvUW.js +1 -0
  40. package/dist/web/public/assets/chunk-FRKYWMV7-DUkk3w4h.js +122 -0
  41. package/dist/web/public/assets/clarity-KgUVrNfC.js +1 -0
  42. package/dist/web/public/assets/clojure-BhQuoGIG.js +1 -0
  43. package/dist/web/public/assets/cmake-CA59gUFQ.js +1 -0
  44. package/dist/web/public/assets/cobol-CCFShgGZ.js +1 -0
  45. package/dist/web/public/assets/codeowners-CD36YqjJ.js +1 -0
  46. package/dist/web/public/assets/codeql-CrMosKUt.js +1 -0
  47. package/dist/web/public/assets/coffee-C-Mn3tBT.js +1 -0
  48. package/dist/web/public/assets/common-lisp-DYnOjAFz.js +1 -0
  49. package/dist/web/public/assets/components-DiZ1dSl3.js +77 -0
  50. package/dist/web/public/assets/coq-BaHtq3Qt.js +1 -0
  51. package/dist/web/public/assets/cpp-D8Y73ItU.js +1 -0
  52. package/dist/web/public/assets/crystal-CnXWqbxx.js +1 -0
  53. package/dist/web/public/assets/csharp-D6sghVPa.js +1 -0
  54. package/dist/web/public/assets/css-CUGjdPw_.js +1 -0
  55. package/dist/web/public/assets/csv-DuxyxUAI.js +1 -0
  56. package/dist/web/public/assets/cue-D9NRAX0_.js +1 -0
  57. package/dist/web/public/assets/cypher-HJRdtilF.js +1 -0
  58. package/dist/web/public/assets/d-B4Ont7_X.js +1 -0
  59. package/dist/web/public/assets/dark-plus-DZSBycyp.js +1 -0
  60. package/dist/web/public/assets/dart-Dp4asavE.js +1 -0
  61. package/dist/web/public/assets/dax-DBUubp6S.js +1 -0
  62. package/dist/web/public/assets/desktop-DQ0n6zIQ.js +1 -0
  63. package/dist/web/public/assets/diff-CFHlrffC.js +1 -0
  64. package/dist/web/public/assets/docker-BuefmsF5.js +1 -0
  65. package/dist/web/public/assets/dotenv-BKTsUQ_r.js +1 -0
  66. package/dist/web/public/assets/dracula-MOn9qacs.js +1 -0
  67. package/dist/web/public/assets/dracula-soft-C4r_sC_D.js +1 -0
  68. package/dist/web/public/assets/dream-maker-BNdv5lLS.js +1 -0
  69. package/dist/web/public/assets/edge-C-Mi8Oda.js +1 -0
  70. package/dist/web/public/assets/elixir-CTS5wQtX.js +1 -0
  71. package/dist/web/public/assets/elm-rM310x8D.js +1 -0
  72. package/dist/web/public/assets/emacs-lisp-D9FIGRtM.js +1 -0
  73. package/dist/web/public/assets/erb-oaGjGVGO.js +1 -0
  74. package/dist/web/public/assets/erlang-q4Mkyw3m.js +1 -0
  75. package/dist/web/public/assets/everforest-dark-CNa2QFRn.js +1 -0
  76. package/dist/web/public/assets/everforest-light-DRbUDqJT.js +1 -0
  77. package/dist/web/public/assets/fennel-DpqQTaVZ.js +1 -0
  78. package/dist/web/public/assets/field-1-Ujza0S5j.js +1 -0
  79. package/dist/web/public/assets/fish-hyk5x6Q4.js +1 -0
  80. package/dist/web/public/assets/fluent-DMll-MGX.js +1 -0
  81. package/dist/web/public/assets/fortran-fixed-form-BmdfKovV.js +1 -0
  82. package/dist/web/public/assets/fortran-free-form-MCAifii4.js +1 -0
  83. package/dist/web/public/assets/fsharp-DLlBn9Nl.js +1 -0
  84. package/dist/web/public/assets/gdresource-BzFzBRli.js +1 -0
  85. package/dist/web/public/assets/gdscript-D3R4J0Cv.js +1 -0
  86. package/dist/web/public/assets/gdshader-BAubtqqN.js +1 -0
  87. package/dist/web/public/assets/genie-BnIIX2pC.js +1 -0
  88. package/dist/web/public/assets/gherkin-CL3NUuB1.js +1 -0
  89. package/dist/web/public/assets/git-commit-BYPE8h85.js +1 -0
  90. package/dist/web/public/assets/git-rebase-Bmmgf6eN.js +1 -0
  91. package/dist/web/public/assets/github-dark-default-C6I2oE4c.js +1 -0
  92. package/dist/web/public/assets/github-dark-dimmed-DEqwxg6D.js +1 -0
  93. package/dist/web/public/assets/github-dark-high-contrast-DDt3j0cs.js +1 -0
  94. package/dist/web/public/assets/github-dark-oLN6SDKl.js +1 -0
  95. package/dist/web/public/assets/github-light-DaN-N2Gj.js +1 -0
  96. package/dist/web/public/assets/github-light-default-B3EwMbS7.js +1 -0
  97. package/dist/web/public/assets/github-light-high-contrast-Cl9D0f_e.js +1 -0
  98. package/dist/web/public/assets/gleam-Cvj8QRtQ.js +1 -0
  99. package/dist/web/public/assets/glimmer-js-CahbROb1.js +1 -0
  100. package/dist/web/public/assets/glimmer-ts-JMFYNbot.js +1 -0
  101. package/dist/web/public/assets/global-XWAvxWcA.css +2 -0
  102. package/dist/web/public/assets/glsl-BCuCNM3V.js +1 -0
  103. package/dist/web/public/assets/gn-DxCHSEMl.js +1 -0
  104. package/dist/web/public/assets/gnuplot-CkGXHK7B.js +1 -0
  105. package/dist/web/public/assets/go-B_NLCuTj.js +1 -0
  106. package/dist/web/public/assets/graphql-RXOfHGfI.js +1 -0
  107. package/dist/web/public/assets/groovy-DVge8oRs.js +1 -0
  108. package/dist/web/public/assets/gruvbox-dark-hard-BwZz1yni.js +1 -0
  109. package/dist/web/public/assets/gruvbox-dark-medium-Bqy6jkuO.js +1 -0
  110. package/dist/web/public/assets/gruvbox-dark-soft-DjUvyUfH.js +1 -0
  111. package/dist/web/public/assets/gruvbox-light-hard-BTLmfPdm.js +1 -0
  112. package/dist/web/public/assets/gruvbox-light-medium-DeWqsWs6.js +1 -0
  113. package/dist/web/public/assets/gruvbox-light-soft-BL8ld-1F.js +1 -0
  114. package/dist/web/public/assets/hack-BBQpwyf_.js +1 -0
  115. package/dist/web/public/assets/haml-mWELc9kh.js +1 -0
  116. package/dist/web/public/assets/handlebars-COrUo8cC.js +1 -0
  117. package/dist/web/public/assets/haskell-DRmM8XlQ.js +1 -0
  118. package/dist/web/public/assets/haxe-BEhq8ZEr.js +1 -0
  119. package/dist/web/public/assets/hcl-B5ZIaGS0.js +1 -0
  120. package/dist/web/public/assets/highlighted-body-TPN3WLV5-YJgGFx4e.js +1 -0
  121. package/dist/web/public/assets/hjson-B9uRLqIO.js +1 -0
  122. package/dist/web/public/assets/hlsl-Hv1kKjrS.js +1 -0
  123. package/dist/web/public/assets/horizon-ClXGBjWw.js +1 -0
  124. package/dist/web/public/assets/horizon-bright-CvUCr3ux.js +1 -0
  125. package/dist/web/public/assets/houston-NqkqG60q.js +1 -0
  126. package/dist/web/public/assets/html-cmigv1ou.js +1 -0
  127. package/dist/web/public/assets/html-derivative-B3me0pSu.js +1 -0
  128. package/dist/web/public/assets/http-BojM9cyU.js +1 -0
  129. package/dist/web/public/assets/hurl-BxEmMiGP.js +1 -0
  130. package/dist/web/public/assets/hxml-CoBuVbfs.js +1 -0
  131. package/dist/web/public/assets/hy-CeISYGGU.js +1 -0
  132. package/dist/web/public/assets/imba-xjcDFXUW.js +1 -0
  133. package/dist/web/public/assets/ini-D0ZCSj6e.js +1 -0
  134. package/dist/web/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  135. package/dist/web/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  136. package/dist/web/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  137. package/dist/web/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  138. package/dist/web/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  139. package/dist/web/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  140. package/dist/web/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  141. package/dist/web/public/assets/java-BvheClGI.js +1 -0
  142. package/dist/web/public/assets/javascript-DjlJORDg.js +1 -0
  143. package/dist/web/public/assets/jinja-Bi4sG72X.js +1 -0
  144. package/dist/web/public/assets/jison-BTz5Ik2Y.js +1 -0
  145. package/dist/web/public/assets/json-CiTd40Rg.js +1 -0
  146. package/dist/web/public/assets/json5-FR9EyF7a.js +1 -0
  147. package/dist/web/public/assets/jsonc-CHIeFfsD.js +1 -0
  148. package/dist/web/public/assets/jsonl-B4WQkwTf.js +1 -0
  149. package/dist/web/public/assets/jsonnet-vd-gzGkL.js +1 -0
  150. package/dist/web/public/assets/jssm-C_bj1LkZ.js +1 -0
  151. package/dist/web/public/assets/jsx-Bx-RZMFH.js +1 -0
  152. package/dist/web/public/assets/jsx-runtime-n8k0hwt8.js +1 -0
  153. package/dist/web/public/assets/julia-BKcIfSxk.js +1 -0
  154. package/dist/web/public/assets/just-IkZCagAs.js +1 -0
  155. package/dist/web/public/assets/kanagawa-dragon-B3Cz89vt.js +1 -0
  156. package/dist/web/public/assets/kanagawa-lotus-CRe_W5Ft.js +1 -0
  157. package/dist/web/public/assets/kanagawa-wave-BPqZ5XB7.js +1 -0
  158. package/dist/web/public/assets/kdl-BzL_Ak31.js +1 -0
  159. package/dist/web/public/assets/kotlin-BQQFk6ql.js +1 -0
  160. package/dist/web/public/assets/kusto-vWe6OLKV.js +1 -0
  161. package/dist/web/public/assets/laserwave-CwtvEUcj.js +1 -0
  162. package/dist/web/public/assets/latex-9N90_WFU.js +1 -0
  163. package/dist/web/public/assets/lean-CaqenOqv.js +1 -0
  164. package/dist/web/public/assets/less-CERnPzn6.js +1 -0
  165. package/dist/web/public/assets/light-plus-B9_M_OKq.js +1 -0
  166. package/dist/web/public/assets/liquid-CQLPDP7m.js +1 -0
  167. package/dist/web/public/assets/llvm-BylJXvm7.js +1 -0
  168. package/dist/web/public/assets/log-CBBcNcbO.js +1 -0
  169. package/dist/web/public/assets/logo-r-8Jc8Xk.js +1 -0
  170. package/dist/web/public/assets/lua-BBL6LXKd.js +1 -0
  171. package/dist/web/public/assets/luau-B2g7L-zP.js +1 -0
  172. package/dist/web/public/assets/main-0lKVDR64.css +2 -0
  173. package/dist/web/public/assets/main-CcNf0BOb.js +126 -0
  174. package/dist/web/public/assets/make-DK-HzJ2w.js +1 -0
  175. package/dist/web/public/assets/markdown-FgdsukgR.js +1 -0
  176. package/dist/web/public/assets/marko-CLZwt2N2.js +1 -0
  177. package/dist/web/public/assets/material-theme-DOJ9PS4O.js +1 -0
  178. package/dist/web/public/assets/material-theme-darker-DOurH5jT.js +1 -0
  179. package/dist/web/public/assets/material-theme-lighter-BfPWxCP6.js +1 -0
  180. package/dist/web/public/assets/material-theme-ocean-BcO5PKoq.js +1 -0
  181. package/dist/web/public/assets/material-theme-palenight-ClWQBDDd.js +1 -0
  182. package/dist/web/public/assets/matlab-DwyUVNXd.js +1 -0
  183. package/dist/web/public/assets/mdc-Bo8CRPg4.js +1 -0
  184. package/dist/web/public/assets/mdx-3EBShbsD.js +1 -0
  185. package/dist/web/public/assets/mermaid-ByG2-SLz.js +1 -0
  186. package/dist/web/public/assets/mermaid-O7DHMXV3-COAgR3aM.js +1 -0
  187. package/dist/web/public/assets/min-dark-ClJ2x5pc.js +1 -0
  188. package/dist/web/public/assets/min-light-BsOUz5iE.js +1 -0
  189. package/dist/web/public/assets/mipsasm-BKDtQCf3.js +1 -0
  190. package/dist/web/public/assets/mojo-DmEAK7iv.js +1 -0
  191. package/dist/web/public/assets/monokai-BKc3VADO.js +1 -0
  192. package/dist/web/public/assets/moonbit-Qm8v_cKN.js +1 -0
  193. package/dist/web/public/assets/move-CMectUPk.js +1 -0
  194. package/dist/web/public/assets/narrat-Bdm8NaK8.js +1 -0
  195. package/dist/web/public/assets/nextflow-BpSt05nC.js +1 -0
  196. package/dist/web/public/assets/nextflow-groovy-BZ-bqJ-u.js +1 -0
  197. package/dist/web/public/assets/nginx-ChZL5FWE.js +1 -0
  198. package/dist/web/public/assets/night-owl-CbFc5pXO.js +1 -0
  199. package/dist/web/public/assets/night-owl-light-zYbVCVuz.js +1 -0
  200. package/dist/web/public/assets/nim-5JnPAJWa.js +1 -0
  201. package/dist/web/public/assets/nix-P5P-2qHs.js +1 -0
  202. package/dist/web/public/assets/nord-C7hKGudV.js +1 -0
  203. package/dist/web/public/assets/nushell-DKPnC5RG.js +1 -0
  204. package/dist/web/public/assets/objective-c-BPwXtM0v.js +1 -0
  205. package/dist/web/public/assets/objective-cpp-CWYEdWNG.js +1 -0
  206. package/dist/web/public/assets/ocaml-CL7OJ02v.js +1 -0
  207. package/dist/web/public/assets/odin-Dtay25eA.js +1 -0
  208. package/dist/web/public/assets/one-dark-pro-CrdFNNwF.js +1 -0
  209. package/dist/web/public/assets/one-light-BUiz8X4B.js +1 -0
  210. package/dist/web/public/assets/openscad-WD4sXUUp.js +1 -0
  211. package/dist/web/public/assets/pascal-A6-MZnZ8.js +1 -0
  212. package/dist/web/public/assets/perl-Yq3AfnVV.js +1 -0
  213. package/dist/web/public/assets/php-CCj0foPx.js +1 -0
  214. package/dist/web/public/assets/pkl-cmPbg8fI.js +1 -0
  215. package/dist/web/public/assets/plastic-DtQ_LnDB.js +1 -0
  216. package/dist/web/public/assets/plsql-DwmuVd7q.js +1 -0
  217. package/dist/web/public/assets/po-CkVxkZaj.js +1 -0
  218. package/dist/web/public/assets/poimandres-Dt0xZuaa.js +1 -0
  219. package/dist/web/public/assets/polar-hStNz_W2.js +1 -0
  220. package/dist/web/public/assets/postcss-ZIk0AQ7M.js +1 -0
  221. package/dist/web/public/assets/powerquery-D0gqoHHD.js +1 -0
  222. package/dist/web/public/assets/powershell-DXB5HoVh.js +1 -0
  223. package/dist/web/public/assets/prisma-DmTrfxC0.js +1 -0
  224. package/dist/web/public/assets/prolog-CdoyriEj.js +1 -0
  225. package/dist/web/public/assets/proto-4MrN11dS.js +1 -0
  226. package/dist/web/public/assets/pug-svYJKDOQ.js +1 -0
  227. package/dist/web/public/assets/puppet-MEaLGpAP.js +1 -0
  228. package/dist/web/public/assets/purescript-CPxCorqB.js +1 -0
  229. package/dist/web/public/assets/python-f4fp5z0z.js +1 -0
  230. package/dist/web/public/assets/qml-BzEtWdqI.js +1 -0
  231. package/dist/web/public/assets/qmldir-DCjSceJ_.js +1 -0
  232. package/dist/web/public/assets/qss-BdM02NUc.js +1 -0
  233. package/dist/web/public/assets/r-luosIeJH.js +1 -0
  234. package/dist/web/public/assets/racket-D2tfa8Zc.js +1 -0
  235. package/dist/web/public/assets/raku-KeGPJVZg.js +1 -0
  236. package/dist/web/public/assets/razor-Bokxs4Qx.js +1 -0
  237. package/dist/web/public/assets/red-C0qZ-1lN.js +1 -0
  238. package/dist/web/public/assets/reg-DdnswvOj.js +1 -0
  239. package/dist/web/public/assets/regexp-CYC8h6V9.js +1 -0
  240. package/dist/web/public/assets/rel-RhzEfSRc.js +1 -0
  241. package/dist/web/public/assets/riscv-dS5TzX10.js +1 -0
  242. package/dist/web/public/assets/ron-CQjQSCVp.js +1 -0
  243. package/dist/web/public/assets/rose-pine-C89ViLdr.js +1 -0
  244. package/dist/web/public/assets/rose-pine-dawn-Dq2gf0yi.js +1 -0
  245. package/dist/web/public/assets/rose-pine-moon-CBDvXVs_.js +1 -0
  246. package/dist/web/public/assets/rosmsg-nvjuSIGu.js +1 -0
  247. package/dist/web/public/assets/routes-BXqJCOpL.js +542 -0
  248. package/dist/web/public/assets/rst-1xwvVGf7.js +1 -0
  249. package/dist/web/public/assets/ruby-Blad-eDx.js +1 -0
  250. package/dist/web/public/assets/rust-rV8q_xyI.js +1 -0
  251. package/dist/web/public/assets/sas-DUPWtptg.js +1 -0
  252. package/dist/web/public/assets/sass-CuxdoNN0.js +1 -0
  253. package/dist/web/public/assets/scala-Df4L7N3R.js +1 -0
  254. package/dist/web/public/assets/scheme-DalRmAPH.js +1 -0
  255. package/dist/web/public/assets/scss-CYQ8LEwP.js +1 -0
  256. package/dist/web/public/assets/sdbl-B_TmFnGf.js +1 -0
  257. package/dist/web/public/assets/shaderlab-DYEMDY3e.js +1 -0
  258. package/dist/web/public/assets/shellscript-DjKZ34ac.js +1 -0
  259. package/dist/web/public/assets/shellsession-C3kcnBnh.js +1 -0
  260. package/dist/web/public/assets/slack-dark-ak_jOeLl.js +1 -0
  261. package/dist/web/public/assets/slack-ochin-ByiYhLwu.js +1 -0
  262. package/dist/web/public/assets/smalltalk-DTTnjjZJ.js +1 -0
  263. package/dist/web/public/assets/snazzy-light-BBRYeY60.js +1 -0
  264. package/dist/web/public/assets/solarized-dark-BtoLnWkw.js +1 -0
  265. package/dist/web/public/assets/solarized-light-CtzUA7GI.js +1 -0
  266. package/dist/web/public/assets/solidity-CSIHEQ2t.js +1 -0
  267. package/dist/web/public/assets/soy-BN0uzUAI.js +1 -0
  268. package/dist/web/public/assets/sparql-B6k9tA6Q.js +1 -0
  269. package/dist/web/public/assets/splunk-DkRzN7V_.js +1 -0
  270. package/dist/web/public/assets/sql-Bx-WX28V.js +1 -0
  271. package/dist/web/public/assets/ssh-config-Bqp7ng33.js +1 -0
  272. package/dist/web/public/assets/stata-HAj7doU8.js +1 -0
  273. package/dist/web/public/assets/stylus-CdbCxDLX.js +1 -0
  274. package/dist/web/public/assets/surrealql-BkGf0I3k.js +1 -0
  275. package/dist/web/public/assets/svelte-DtWg6ssL.js +1 -0
  276. package/dist/web/public/assets/swift-yRu2dtgr.js +1 -0
  277. package/dist/web/public/assets/synthwave-84-2WIu6MHX.js +1 -0
  278. package/dist/web/public/assets/system-verilog-GUE_oP1V.js +1 -0
  279. package/dist/web/public/assets/systemd-FLIJAQZV.js +1 -0
  280. package/dist/web/public/assets/talonscript-DTR-8ILs.js +1 -0
  281. package/dist/web/public/assets/tasl-WHNWP-1F.js +1 -0
  282. package/dist/web/public/assets/tcl-BaBXNNp6.js +1 -0
  283. package/dist/web/public/assets/templ-Dc9vj00n.js +1 -0
  284. package/dist/web/public/assets/terraform-uJUFpr8t.js +1 -0
  285. package/dist/web/public/assets/tex-DA3dAz55.js +1 -0
  286. package/dist/web/public/assets/tokyo-night-BbogFqAr.js +1 -0
  287. package/dist/web/public/assets/toml-CyR4Gqq1.js +1 -0
  288. package/dist/web/public/assets/ts-tags-BD1j21LH.js +1 -0
  289. package/dist/web/public/assets/tsv-COLVYI6A.js +1 -0
  290. package/dist/web/public/assets/tsx-CFm2E6uK.js +1 -0
  291. package/dist/web/public/assets/turtle-PQwt4gkb.js +1 -0
  292. package/dist/web/public/assets/twig-DrUXy85s.js +1 -0
  293. package/dist/web/public/assets/typescript-Dy-5sXFx.js +1 -0
  294. package/dist/web/public/assets/typespec-Bb7qHV0g.js +1 -0
  295. package/dist/web/public/assets/typst-Bj_JElGz.js +1 -0
  296. package/dist/web/public/assets/v-BTkrtik4.js +1 -0
  297. package/dist/web/public/assets/vala-AXT1CI9v.js +1 -0
  298. package/dist/web/public/assets/vb-DzTKUgW8.js +1 -0
  299. package/dist/web/public/assets/verilog-aI3j5Xj8.js +1 -0
  300. package/dist/web/public/assets/vesper-BmnwIC_B.js +1 -0
  301. package/dist/web/public/assets/vhdl-4IgBB7vO.js +1 -0
  302. package/dist/web/public/assets/viml-D_XMKSR6.js +1 -0
  303. package/dist/web/public/assets/vitesse-black-DhmxIXiA.js +1 -0
  304. package/dist/web/public/assets/vitesse-dark-dvEH_9qt.js +1 -0
  305. package/dist/web/public/assets/vitesse-light-Ca0W2L1O.js +1 -0
  306. package/dist/web/public/assets/vue-DC_yTvy2.js +1 -0
  307. package/dist/web/public/assets/vue-html-Bp8x4gdt.js +1 -0
  308. package/dist/web/public/assets/vue-vine-ZcUkuUUp.js +1 -0
  309. package/dist/web/public/assets/vyper-Dz2f7-FK.js +1 -0
  310. package/dist/web/public/assets/wasm-CuXPCj65.js +1 -0
  311. package/dist/web/public/assets/wasm-DHkXUMsP.js +1 -0
  312. package/dist/web/public/assets/wenyan-BRAtM0Iv.js +1 -0
  313. package/dist/web/public/assets/wgsl-CMpn9jTa.js +1 -0
  314. package/dist/web/public/assets/wikitext-DRmBVmVA.js +1 -0
  315. package/dist/web/public/assets/wit-Drp_HLqJ.js +1 -0
  316. package/dist/web/public/assets/wolfram-C33umj7M.js +1 -0
  317. package/dist/web/public/assets/xml-BHoOtGbO.js +1 -0
  318. package/dist/web/public/assets/xsl-CN1PlFqm.js +1 -0
  319. package/dist/web/public/assets/yaml-DT0mpn8u.js +1 -0
  320. package/dist/web/public/assets/zenscript-BlYQ_Frf.js +1 -0
  321. package/dist/web/public/assets/zig-Buk7I0y-.js +1 -0
  322. package/dist/web/server/_chunks/ssr-renderer.mjs +15 -0
  323. package/dist/web/server/_libs/@ai-sdk/anthropic+[...].mjs +14021 -0
  324. package/dist/web/server/_libs/@ai-sdk/moonshotai+[...].mjs +898 -0
  325. package/dist/web/server/_libs/@ai-sdk/react+[...].mjs +8969 -0
  326. package/dist/web/server/_libs/@emotion/is-prop-valid+[...].mjs +34 -0
  327. package/dist/web/server/_libs/@floating-ui/core+[...].mjs +698 -0
  328. package/dist/web/server/_libs/@floating-ui/dom+[...].mjs +644 -0
  329. package/dist/web/server/_libs/@floating-ui/react-dom+[...].mjs +475 -0
  330. package/dist/web/server/_libs/@lobehub/icons+[...].mjs +3079 -0
  331. package/dist/web/server/_libs/@radix-ui/react-arrow+[...].mjs +184 -0
  332. package/dist/web/server/_libs/@radix-ui/react-collapsible+[...].mjs +374 -0
  333. package/dist/web/server/_libs/@radix-ui/react-dialog+[...].mjs +1503 -0
  334. package/dist/web/server/_libs/@radix-ui/react-menu+[...].mjs +1236 -0
  335. package/dist/web/server/_libs/@radix-ui/react-select+[...].mjs +1007 -0
  336. package/dist/web/server/_libs/@shikijs/core+[...].mjs +9017 -0
  337. package/dist/web/server/_libs/@shikijs/engine-javascript+[...].mjs +3159 -0
  338. package/dist/web/server/_libs/@streamdown/math+[...].mjs +37559 -0
  339. package/dist/web/server/_libs/@tanstack/react-router+[...].mjs +14074 -0
  340. package/dist/web/server/_libs/_.mjs +3 -0
  341. package/dist/web/server/_libs/_2.mjs +3 -0
  342. package/dist/web/server/_libs/_3.mjs +2 -0
  343. package/dist/web/server/_libs/_4.mjs +2 -0
  344. package/dist/web/server/_libs/ai-sdk__gateway+vercel__oidc.mjs +1255 -0
  345. package/dist/web/server/_libs/ai-sdk__google.mjs +1630 -0
  346. package/dist/web/server/_libs/ai-sdk__openai+zod.mjs +4951 -0
  347. package/dist/web/server/_libs/ai-sdk__provider-utils.mjs +411 -0
  348. package/dist/web/server/_libs/ai-sdk__provider.mjs +222 -0
  349. package/dist/web/server/_libs/bail.mjs +13 -0
  350. package/dist/web/server/_libs/character-entities.mjs +2135 -0
  351. package/dist/web/server/_libs/class-variance-authority+clsx.mjs +69 -0
  352. package/dist/web/server/_libs/color+[...].mjs +2185 -0
  353. package/dist/web/server/_libs/copy-text-to-clipboard.mjs +40 -0
  354. package/dist/web/server/_libs/d3-array.mjs +231 -0
  355. package/dist/web/server/_libs/d3-color.mjs +330 -0
  356. package/dist/web/server/_libs/d3-format.mjs +252 -0
  357. package/dist/web/server/_libs/d3-interpolate.mjs +207 -0
  358. package/dist/web/server/_libs/d3-path.mjs +77 -0
  359. package/dist/web/server/_libs/d3-scale+[...].mjs +1907 -0
  360. package/dist/web/server/_libs/d3-shape.mjs +818 -0
  361. package/dist/web/server/_libs/date-fns.mjs +3012 -0
  362. package/dist/web/server/_libs/date-fns__tz.mjs +249 -0
  363. package/dist/web/server/_libs/decimal.js-light.mjs +884 -0
  364. package/dist/web/server/_libs/decode-named-character-reference+[...].mjs +19 -0
  365. package/dist/web/server/_libs/dexie.mjs +3745 -0
  366. package/dist/web/server/_libs/escape-string-regexp.mjs +7 -0
  367. package/dist/web/server/_libs/estree-util-is-identifier-name.mjs +20 -0
  368. package/dist/web/server/_libs/eventemitter3.mjs +237 -0
  369. package/dist/web/server/_libs/extend.mjs +75 -0
  370. package/dist/web/server/_libs/fast-equals.mjs +423 -0
  371. package/dist/web/server/_libs/framer-motion+[...].mjs +9573 -0
  372. package/dist/web/server/_libs/fuzzysort.mjs +621 -0
  373. package/dist/web/server/_libs/h3+rou3+srvx.mjs +1158 -0
  374. package/dist/web/server/_libs/hast-util-raw+[...].mjs +800 -0
  375. package/dist/web/server/_libs/hast-util-sanitize.mjs +780 -0
  376. package/dist/web/server/_libs/hast-util-to-jsx-runtime+[...].mjs +853 -0
  377. package/dist/web/server/_libs/hookable.mjs +41 -0
  378. package/dist/web/server/_libs/html-url-attributes.mjs +44 -0
  379. package/dist/web/server/_libs/is-plain-obj.mjs +8 -0
  380. package/dist/web/server/_libs/lodash.mjs +4532 -0
  381. package/dist/web/server/_libs/lucide-react.mjs +605 -0
  382. package/dist/web/server/_libs/markdown-table.mjs +289 -0
  383. package/dist/web/server/_libs/marked.mjs +1511 -0
  384. package/dist/web/server/_libs/mdast-util-find-and-replace.mjs +198 -0
  385. package/dist/web/server/_libs/mdast-util-from-markdown+[...].mjs +8121 -0
  386. package/dist/web/server/_libs/mdast-util-gfm+[...].mjs +2060 -0
  387. package/dist/web/server/_libs/mdast-util-to-hast+[...].mjs +1770 -0
  388. package/dist/web/server/_libs/micromark-extension-gfm+[...].mjs +2235 -0
  389. package/dist/web/server/_libs/nanoid.mjs +26 -0
  390. package/dist/web/server/_libs/next-themes.mjs +124 -0
  391. package/dist/web/server/_libs/prop-types.mjs +69 -0
  392. package/dist/web/server/_libs/radix-ui__number.mjs +6 -0
  393. package/dist/web/server/_libs/radix-ui__primitive.mjs +9 -0
  394. package/dist/web/server/_libs/radix-ui__react-collection.mjs +80 -0
  395. package/dist/web/server/_libs/radix-ui__react-direction.mjs +11 -0
  396. package/dist/web/server/_libs/radix-ui__react-label.mjs +23 -0
  397. package/dist/web/server/_libs/radix-ui__react-menubar.mjs +400 -0
  398. package/dist/web/server/_libs/radix-ui__react-popover.mjs +251 -0
  399. package/dist/web/server/_libs/radix-ui__react-progress.mjs +81 -0
  400. package/dist/web/server/_libs/radix-ui__react-scroll-area.mjs +669 -0
  401. package/dist/web/server/_libs/radix-ui__react-separator.mjs +32 -0
  402. package/dist/web/server/_libs/radix-ui__react-slider.mjs +464 -0
  403. package/dist/web/server/_libs/radix-ui__react-switch.mjs +120 -0
  404. package/dist/web/server/_libs/radix-ui__react-tabs.mjs +145 -0
  405. package/dist/web/server/_libs/radix-ui__react-tooltip.mjs +494 -0
  406. package/dist/web/server/_libs/react-day-picker.mjs +3510 -0
  407. package/dist/web/server/_libs/react-is.mjs +48 -0
  408. package/dist/web/server/_libs/react-resizable-panels.mjs +1517 -0
  409. package/dist/web/server/_libs/react-smooth.mjs +1024 -0
  410. package/dist/web/server/_libs/recharts+[...].mjs +12998 -0
  411. package/dist/web/server/_libs/rehype-harden.mjs +210 -0
  412. package/dist/web/server/_libs/rehype-raw.mjs +37 -0
  413. package/dist/web/server/_libs/rehype-sanitize.mjs +27 -0
  414. package/dist/web/server/_libs/remark-gfm.mjs +34 -0
  415. package/dist/web/server/_libs/remark-parse.mjs +37 -0
  416. package/dist/web/server/_libs/remark-rehype.mjs +169 -0
  417. package/dist/web/server/_libs/remend.mjs +544 -0
  418. package/dist/web/server/_libs/scule.mjs +55 -0
  419. package/dist/web/server/_libs/shiki+streamdown__code.mjs +1748 -0
  420. package/dist/web/server/_libs/shiki.mjs +16 -0
  421. package/dist/web/server/_libs/shikijs__engine-oniguruma.mjs +387 -0
  422. package/dist/web/server/_libs/shikijs__langs.mjs +1357 -0
  423. package/dist/web/server/_libs/shikijs__themes.mjs +268 -0
  424. package/dist/web/server/_libs/sonner.mjs +909 -0
  425. package/dist/web/server/_libs/streamdown+[...].mjs +5842 -0
  426. package/dist/web/server/_libs/tanstack__history.mjs +342 -0
  427. package/dist/web/server/_libs/tanstack__query-core.mjs +2073 -0
  428. package/dist/web/server/_libs/tanstack__react-query.mjs +146 -0
  429. package/dist/web/server/_libs/tanstack__router-core.mjs +6 -0
  430. package/dist/web/server/_libs/tanstack__zod-adapter.mjs +16 -0
  431. package/dist/web/server/_libs/ufo.mjs +64 -0
  432. package/dist/web/server/_libs/ungap__structured-clone.mjs +197 -0
  433. package/dist/web/server/_libs/use-stick-to-bottom.mjs +410 -0
  434. package/dist/web/server/_libs/vercel__oidc.mjs +393 -0
  435. package/dist/web/server/_libs/zhipu-ai-provider.mjs +13483 -0
  436. package/dist/web/server/_libs/zustand.mjs +48 -0
  437. package/dist/web/server/_runtime.mjs +35 -0
  438. package/dist/web/server/_ssr/components-BzCiScpA.mjs +1452 -0
  439. package/dist/web/server/_ssr/dist-3Mu7PF0n.mjs +137 -0
  440. package/dist/web/server/_ssr/dist-BRaLXgxZ.mjs +17 -0
  441. package/dist/web/server/_ssr/field-1-agM60DBf.mjs +167 -0
  442. package/dist/web/server/_ssr/get-providers-BoYkp0Of.mjs +40 -0
  443. package/dist/web/server/_ssr/initialize-provider-B6W8V5Eg.mjs +19 -0
  444. package/dist/web/server/_ssr/model-list-CDFjdz2P.mjs +60 -0
  445. package/dist/web/server/_ssr/router-BmmOCtJZ.mjs +168 -0
  446. package/dist/web/server/_ssr/routes-CvlpZK4Q.mjs +2630 -0
  447. package/dist/web/server/_ssr/schemas-DsZ5O3zp.mjs +67 -0
  448. package/dist/web/server/_ssr/send-message-DUT1vRvx.mjs +135 -0
  449. package/dist/web/server/_ssr/ssr.mjs +5253 -0
  450. package/dist/web/server/_ssr/start-rewezkfD.mjs +4 -0
  451. package/dist/web/server/_ssr/submit-key-CcCv6-yy.mjs +62 -0
  452. package/dist/web/server/_ssr/suggestions-B0Uc3p7F.mjs +38 -0
  453. package/dist/web/server/_ssr/use-providers-Bwqg2U3N.mjs +1554 -0
  454. package/dist/web/server/_tanstack-start-manifest_v-BMIvh4y6.mjs +60 -0
  455. package/dist/web/server/index.mjs +2531 -0
  456. package/dist/web/server/node_modules/tslib/modules/index.js +70 -0
  457. package/dist/web/server/node_modules/tslib/modules/package.json +3 -0
  458. package/dist/web/server/node_modules/tslib/package.json +47 -0
  459. package/dist/web/server/node_modules/tslib/tslib.js +484 -0
  460. package/package.json +32 -0
@@ -0,0 +1,2073 @@
1
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/subscribable.js
2
+ var Subscribable = class {
3
+ constructor() {
4
+ this.listeners = /* @__PURE__ */ new Set();
5
+ this.subscribe = this.subscribe.bind(this);
6
+ }
7
+ subscribe(listener) {
8
+ this.listeners.add(listener);
9
+ this.onSubscribe();
10
+ return () => {
11
+ this.listeners.delete(listener);
12
+ this.onUnsubscribe();
13
+ };
14
+ }
15
+ hasListeners() {
16
+ return this.listeners.size > 0;
17
+ }
18
+ onSubscribe() {}
19
+ onUnsubscribe() {}
20
+ };
21
+ //#endregion
22
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
23
+ var defaultTimeoutProvider = {
24
+ setTimeout: (callback, delay) => setTimeout(callback, delay),
25
+ clearTimeout: (timeoutId) => clearTimeout(timeoutId),
26
+ setInterval: (callback, delay) => setInterval(callback, delay),
27
+ clearInterval: (intervalId) => clearInterval(intervalId)
28
+ };
29
+ var TimeoutManager = class {
30
+ #provider = defaultTimeoutProvider;
31
+ #providerCalled = false;
32
+ setTimeoutProvider(provider) {
33
+ this.#provider = provider;
34
+ }
35
+ setTimeout(callback, delay) {
36
+ return this.#provider.setTimeout(callback, delay);
37
+ }
38
+ clearTimeout(timeoutId) {
39
+ this.#provider.clearTimeout(timeoutId);
40
+ }
41
+ setInterval(callback, delay) {
42
+ return this.#provider.setInterval(callback, delay);
43
+ }
44
+ clearInterval(intervalId) {
45
+ this.#provider.clearInterval(intervalId);
46
+ }
47
+ };
48
+ var timeoutManager = new TimeoutManager();
49
+ function systemSetTimeoutZero(callback) {
50
+ setTimeout(callback, 0);
51
+ }
52
+ //#endregion
53
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/utils.js
54
+ var isServer = typeof window === "undefined" || "Deno" in globalThis;
55
+ function noop() {}
56
+ function functionalUpdate(updater, input) {
57
+ return typeof updater === "function" ? updater(input) : updater;
58
+ }
59
+ function isValidTimeout(value) {
60
+ return typeof value === "number" && value >= 0 && value !== Infinity;
61
+ }
62
+ function timeUntilStale(updatedAt, staleTime) {
63
+ return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
64
+ }
65
+ function resolveStaleTime(staleTime, query) {
66
+ return typeof staleTime === "function" ? staleTime(query) : staleTime;
67
+ }
68
+ function resolveEnabled(enabled, query) {
69
+ return typeof enabled === "function" ? enabled(query) : enabled;
70
+ }
71
+ function matchQuery(filters, query) {
72
+ const { type = "all", exact, fetchStatus, predicate, queryKey, stale } = filters;
73
+ if (queryKey) {
74
+ if (exact) {
75
+ if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) return false;
76
+ } else if (!partialMatchKey(query.queryKey, queryKey)) return false;
77
+ }
78
+ if (type !== "all") {
79
+ const isActive = query.isActive();
80
+ if (type === "active" && !isActive) return false;
81
+ if (type === "inactive" && isActive) return false;
82
+ }
83
+ if (typeof stale === "boolean" && query.isStale() !== stale) return false;
84
+ if (fetchStatus && fetchStatus !== query.state.fetchStatus) return false;
85
+ if (predicate && !predicate(query)) return false;
86
+ return true;
87
+ }
88
+ function matchMutation(filters, mutation) {
89
+ const { exact, status, predicate, mutationKey } = filters;
90
+ if (mutationKey) {
91
+ if (!mutation.options.mutationKey) return false;
92
+ if (exact) {
93
+ if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) return false;
94
+ } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) return false;
95
+ }
96
+ if (status && mutation.state.status !== status) return false;
97
+ if (predicate && !predicate(mutation)) return false;
98
+ return true;
99
+ }
100
+ function hashQueryKeyByOptions(queryKey, options) {
101
+ return (options?.queryKeyHashFn || hashKey)(queryKey);
102
+ }
103
+ function hashKey(queryKey) {
104
+ return JSON.stringify(queryKey, (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {
105
+ result[key] = val[key];
106
+ return result;
107
+ }, {}) : val);
108
+ }
109
+ function partialMatchKey(a, b) {
110
+ if (a === b) return true;
111
+ if (typeof a !== typeof b) return false;
112
+ if (a && b && typeof a === "object" && typeof b === "object") return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]));
113
+ return false;
114
+ }
115
+ var hasOwn = Object.prototype.hasOwnProperty;
116
+ function replaceEqualDeep(a, b, depth = 0) {
117
+ if (a === b) return a;
118
+ if (depth > 500) return b;
119
+ const array = isPlainArray(a) && isPlainArray(b);
120
+ if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;
121
+ const aSize = (array ? a : Object.keys(a)).length;
122
+ const bItems = array ? b : Object.keys(b);
123
+ const bSize = bItems.length;
124
+ const copy = array ? new Array(bSize) : {};
125
+ let equalItems = 0;
126
+ for (let i = 0; i < bSize; i++) {
127
+ const key = array ? i : bItems[i];
128
+ const aItem = a[key];
129
+ const bItem = b[key];
130
+ if (aItem === bItem) {
131
+ copy[key] = aItem;
132
+ if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;
133
+ continue;
134
+ }
135
+ if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") {
136
+ copy[key] = bItem;
137
+ continue;
138
+ }
139
+ const v = replaceEqualDeep(aItem, bItem, depth + 1);
140
+ copy[key] = v;
141
+ if (v === aItem) equalItems++;
142
+ }
143
+ return aSize === bSize && equalItems === aSize ? a : copy;
144
+ }
145
+ function shallowEqualObjects(a, b) {
146
+ if (!b || Object.keys(a).length !== Object.keys(b).length) return false;
147
+ for (const key in a) if (a[key] !== b[key]) return false;
148
+ return true;
149
+ }
150
+ function isPlainArray(value) {
151
+ return Array.isArray(value) && value.length === Object.keys(value).length;
152
+ }
153
+ function isPlainObject(o) {
154
+ if (!hasObjectPrototype(o)) return false;
155
+ const ctor = o.constructor;
156
+ if (ctor === void 0) return true;
157
+ const prot = ctor.prototype;
158
+ if (!hasObjectPrototype(prot)) return false;
159
+ if (!prot.hasOwnProperty("isPrototypeOf")) return false;
160
+ if (Object.getPrototypeOf(o) !== Object.prototype) return false;
161
+ return true;
162
+ }
163
+ function hasObjectPrototype(o) {
164
+ return Object.prototype.toString.call(o) === "[object Object]";
165
+ }
166
+ function sleep(timeout) {
167
+ return new Promise((resolve) => {
168
+ timeoutManager.setTimeout(resolve, timeout);
169
+ });
170
+ }
171
+ function replaceData(prevData, data, options) {
172
+ if (typeof options.structuralSharing === "function") return options.structuralSharing(prevData, data);
173
+ else if (options.structuralSharing !== false) return replaceEqualDeep(prevData, data);
174
+ return data;
175
+ }
176
+ function addToEnd(items, item, max = 0) {
177
+ const newItems = [...items, item];
178
+ return max && newItems.length > max ? newItems.slice(1) : newItems;
179
+ }
180
+ function addToStart(items, item, max = 0) {
181
+ const newItems = [item, ...items];
182
+ return max && newItems.length > max ? newItems.slice(0, -1) : newItems;
183
+ }
184
+ var skipToken = /* @__PURE__ */ Symbol();
185
+ function ensureQueryFn(options, fetchOptions) {
186
+ if (!options.queryFn && fetchOptions?.initialPromise) return () => fetchOptions.initialPromise;
187
+ if (!options.queryFn || options.queryFn === skipToken) return () => Promise.reject(/* @__PURE__ */ new Error(`Missing queryFn: '${options.queryHash}'`));
188
+ return options.queryFn;
189
+ }
190
+ function shouldThrowError(throwOnError, params) {
191
+ if (typeof throwOnError === "function") return throwOnError(...params);
192
+ return !!throwOnError;
193
+ }
194
+ function addConsumeAwareSignal(object, getSignal, onCancelled) {
195
+ let consumed = false;
196
+ let signal;
197
+ Object.defineProperty(object, "signal", {
198
+ enumerable: true,
199
+ get: () => {
200
+ signal ??= getSignal();
201
+ if (consumed) return signal;
202
+ consumed = true;
203
+ if (signal.aborted) onCancelled();
204
+ else signal.addEventListener("abort", onCancelled, { once: true });
205
+ return signal;
206
+ }
207
+ });
208
+ return object;
209
+ }
210
+ //#endregion
211
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/focusManager.js
212
+ var FocusManager = class extends Subscribable {
213
+ #focused;
214
+ #cleanup;
215
+ #setup;
216
+ constructor() {
217
+ super();
218
+ this.#setup = (onFocus) => {
219
+ if (!isServer && window.addEventListener) {
220
+ const listener = () => onFocus();
221
+ window.addEventListener("visibilitychange", listener, false);
222
+ return () => {
223
+ window.removeEventListener("visibilitychange", listener);
224
+ };
225
+ }
226
+ };
227
+ }
228
+ onSubscribe() {
229
+ if (!this.#cleanup) this.setEventListener(this.#setup);
230
+ }
231
+ onUnsubscribe() {
232
+ if (!this.hasListeners()) {
233
+ this.#cleanup?.();
234
+ this.#cleanup = void 0;
235
+ }
236
+ }
237
+ setEventListener(setup) {
238
+ this.#setup = setup;
239
+ this.#cleanup?.();
240
+ this.#cleanup = setup((focused) => {
241
+ if (typeof focused === "boolean") this.setFocused(focused);
242
+ else this.onFocus();
243
+ });
244
+ }
245
+ setFocused(focused) {
246
+ if (this.#focused !== focused) {
247
+ this.#focused = focused;
248
+ this.onFocus();
249
+ }
250
+ }
251
+ onFocus() {
252
+ const isFocused = this.isFocused();
253
+ this.listeners.forEach((listener) => {
254
+ listener(isFocused);
255
+ });
256
+ }
257
+ isFocused() {
258
+ if (typeof this.#focused === "boolean") return this.#focused;
259
+ return globalThis.document?.visibilityState !== "hidden";
260
+ }
261
+ };
262
+ var focusManager = new FocusManager();
263
+ //#endregion
264
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/thenable.js
265
+ function pendingThenable() {
266
+ let resolve;
267
+ let reject;
268
+ const thenable = new Promise((_resolve, _reject) => {
269
+ resolve = _resolve;
270
+ reject = _reject;
271
+ });
272
+ thenable.status = "pending";
273
+ thenable.catch(() => {});
274
+ function finalize(data) {
275
+ Object.assign(thenable, data);
276
+ delete thenable.resolve;
277
+ delete thenable.reject;
278
+ }
279
+ thenable.resolve = (value) => {
280
+ finalize({
281
+ status: "fulfilled",
282
+ value
283
+ });
284
+ resolve(value);
285
+ };
286
+ thenable.reject = (reason) => {
287
+ finalize({
288
+ status: "rejected",
289
+ reason
290
+ });
291
+ reject(reason);
292
+ };
293
+ return thenable;
294
+ }
295
+ //#endregion
296
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/notifyManager.js
297
+ var defaultScheduler = systemSetTimeoutZero;
298
+ function createNotifyManager() {
299
+ let queue = [];
300
+ let transactions = 0;
301
+ let notifyFn = (callback) => {
302
+ callback();
303
+ };
304
+ let batchNotifyFn = (callback) => {
305
+ callback();
306
+ };
307
+ let scheduleFn = defaultScheduler;
308
+ const schedule = (callback) => {
309
+ if (transactions) queue.push(callback);
310
+ else scheduleFn(() => {
311
+ notifyFn(callback);
312
+ });
313
+ };
314
+ const flush = () => {
315
+ const originalQueue = queue;
316
+ queue = [];
317
+ if (originalQueue.length) scheduleFn(() => {
318
+ batchNotifyFn(() => {
319
+ originalQueue.forEach((callback) => {
320
+ notifyFn(callback);
321
+ });
322
+ });
323
+ });
324
+ };
325
+ return {
326
+ batch: (callback) => {
327
+ let result;
328
+ transactions++;
329
+ try {
330
+ result = callback();
331
+ } finally {
332
+ transactions--;
333
+ if (!transactions) flush();
334
+ }
335
+ return result;
336
+ },
337
+ batchCalls: (callback) => {
338
+ return (...args) => {
339
+ schedule(() => {
340
+ callback(...args);
341
+ });
342
+ };
343
+ },
344
+ schedule,
345
+ setNotifyFunction: (fn) => {
346
+ notifyFn = fn;
347
+ },
348
+ setBatchNotifyFunction: (fn) => {
349
+ batchNotifyFn = fn;
350
+ },
351
+ setScheduler: (fn) => {
352
+ scheduleFn = fn;
353
+ }
354
+ };
355
+ }
356
+ var notifyManager = createNotifyManager();
357
+ //#endregion
358
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/onlineManager.js
359
+ var OnlineManager = class extends Subscribable {
360
+ #online = true;
361
+ #cleanup;
362
+ #setup;
363
+ constructor() {
364
+ super();
365
+ this.#setup = (onOnline) => {
366
+ if (!isServer && window.addEventListener) {
367
+ const onlineListener = () => onOnline(true);
368
+ const offlineListener = () => onOnline(false);
369
+ window.addEventListener("online", onlineListener, false);
370
+ window.addEventListener("offline", offlineListener, false);
371
+ return () => {
372
+ window.removeEventListener("online", onlineListener);
373
+ window.removeEventListener("offline", offlineListener);
374
+ };
375
+ }
376
+ };
377
+ }
378
+ onSubscribe() {
379
+ if (!this.#cleanup) this.setEventListener(this.#setup);
380
+ }
381
+ onUnsubscribe() {
382
+ if (!this.hasListeners()) {
383
+ this.#cleanup?.();
384
+ this.#cleanup = void 0;
385
+ }
386
+ }
387
+ setEventListener(setup) {
388
+ this.#setup = setup;
389
+ this.#cleanup?.();
390
+ this.#cleanup = setup(this.setOnline.bind(this));
391
+ }
392
+ setOnline(online) {
393
+ if (this.#online !== online) {
394
+ this.#online = online;
395
+ this.listeners.forEach((listener) => {
396
+ listener(online);
397
+ });
398
+ }
399
+ }
400
+ isOnline() {
401
+ return this.#online;
402
+ }
403
+ };
404
+ var onlineManager = new OnlineManager();
405
+ //#endregion
406
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/retryer.js
407
+ function defaultRetryDelay(failureCount) {
408
+ return Math.min(1e3 * 2 ** failureCount, 3e4);
409
+ }
410
+ function canFetch(networkMode) {
411
+ return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
412
+ }
413
+ var CancelledError = class extends Error {
414
+ constructor(options) {
415
+ super("CancelledError");
416
+ this.revert = options?.revert;
417
+ this.silent = options?.silent;
418
+ }
419
+ };
420
+ function createRetryer(config) {
421
+ let isRetryCancelled = false;
422
+ let failureCount = 0;
423
+ let continueFn;
424
+ const thenable = pendingThenable();
425
+ const isResolved = () => thenable.status !== "pending";
426
+ const cancel = (cancelOptions) => {
427
+ if (!isResolved()) {
428
+ const error = new CancelledError(cancelOptions);
429
+ reject(error);
430
+ config.onCancel?.(error);
431
+ }
432
+ };
433
+ const cancelRetry = () => {
434
+ isRetryCancelled = true;
435
+ };
436
+ const continueRetry = () => {
437
+ isRetryCancelled = false;
438
+ };
439
+ const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun();
440
+ const canStart = () => canFetch(config.networkMode) && config.canRun();
441
+ const resolve = (value) => {
442
+ if (!isResolved()) {
443
+ continueFn?.();
444
+ thenable.resolve(value);
445
+ }
446
+ };
447
+ const reject = (value) => {
448
+ if (!isResolved()) {
449
+ continueFn?.();
450
+ thenable.reject(value);
451
+ }
452
+ };
453
+ const pause = () => {
454
+ return new Promise((continueResolve) => {
455
+ continueFn = (value) => {
456
+ if (isResolved() || canContinue()) continueResolve(value);
457
+ };
458
+ config.onPause?.();
459
+ }).then(() => {
460
+ continueFn = void 0;
461
+ if (!isResolved()) config.onContinue?.();
462
+ });
463
+ };
464
+ const run = () => {
465
+ if (isResolved()) return;
466
+ let promiseOrValue;
467
+ const initialPromise = failureCount === 0 ? config.initialPromise : void 0;
468
+ try {
469
+ promiseOrValue = initialPromise ?? config.fn();
470
+ } catch (error) {
471
+ promiseOrValue = Promise.reject(error);
472
+ }
473
+ Promise.resolve(promiseOrValue).then(resolve).catch((error) => {
474
+ if (isResolved()) return;
475
+ const retry = config.retry ?? (isServer ? 0 : 3);
476
+ const retryDelay = config.retryDelay ?? defaultRetryDelay;
477
+ const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay;
478
+ const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error);
479
+ if (isRetryCancelled || !shouldRetry) {
480
+ reject(error);
481
+ return;
482
+ }
483
+ failureCount++;
484
+ config.onFail?.(failureCount, error);
485
+ sleep(delay).then(() => {
486
+ return canContinue() ? void 0 : pause();
487
+ }).then(() => {
488
+ if (isRetryCancelled) reject(error);
489
+ else run();
490
+ });
491
+ });
492
+ };
493
+ return {
494
+ promise: thenable,
495
+ status: () => thenable.status,
496
+ cancel,
497
+ continue: () => {
498
+ continueFn?.();
499
+ return thenable;
500
+ },
501
+ cancelRetry,
502
+ continueRetry,
503
+ canStart,
504
+ start: () => {
505
+ if (canStart()) run();
506
+ else pause().then(run);
507
+ return thenable;
508
+ }
509
+ };
510
+ }
511
+ //#endregion
512
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/removable.js
513
+ var Removable = class {
514
+ #gcTimeout;
515
+ destroy() {
516
+ this.clearGcTimeout();
517
+ }
518
+ scheduleGc() {
519
+ this.clearGcTimeout();
520
+ if (isValidTimeout(this.gcTime)) this.#gcTimeout = timeoutManager.setTimeout(() => {
521
+ this.optionalRemove();
522
+ }, this.gcTime);
523
+ }
524
+ updateGcTime(newGcTime) {
525
+ this.gcTime = Math.max(this.gcTime || 0, newGcTime ?? (isServer ? Infinity : 300 * 1e3));
526
+ }
527
+ clearGcTimeout() {
528
+ if (this.#gcTimeout) {
529
+ timeoutManager.clearTimeout(this.#gcTimeout);
530
+ this.#gcTimeout = void 0;
531
+ }
532
+ }
533
+ };
534
+ //#endregion
535
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/query.js
536
+ var Query = class extends Removable {
537
+ #initialState;
538
+ #revertState;
539
+ #cache;
540
+ #client;
541
+ #retryer;
542
+ #defaultOptions;
543
+ #abortSignalConsumed;
544
+ constructor(config) {
545
+ super();
546
+ this.#abortSignalConsumed = false;
547
+ this.#defaultOptions = config.defaultOptions;
548
+ this.setOptions(config.options);
549
+ this.observers = [];
550
+ this.#client = config.client;
551
+ this.#cache = this.#client.getQueryCache();
552
+ this.queryKey = config.queryKey;
553
+ this.queryHash = config.queryHash;
554
+ this.#initialState = getDefaultState$1(this.options);
555
+ this.state = config.state ?? this.#initialState;
556
+ this.scheduleGc();
557
+ }
558
+ get meta() {
559
+ return this.options.meta;
560
+ }
561
+ get promise() {
562
+ return this.#retryer?.promise;
563
+ }
564
+ setOptions(options) {
565
+ this.options = {
566
+ ...this.#defaultOptions,
567
+ ...options
568
+ };
569
+ this.updateGcTime(this.options.gcTime);
570
+ if (this.state && this.state.data === void 0) {
571
+ const defaultState = getDefaultState$1(this.options);
572
+ if (defaultState.data !== void 0) {
573
+ this.setState(successState(defaultState.data, defaultState.dataUpdatedAt));
574
+ this.#initialState = defaultState;
575
+ }
576
+ }
577
+ }
578
+ optionalRemove() {
579
+ if (!this.observers.length && this.state.fetchStatus === "idle") this.#cache.remove(this);
580
+ }
581
+ setData(newData, options) {
582
+ const data = replaceData(this.state.data, newData, this.options);
583
+ this.#dispatch({
584
+ data,
585
+ type: "success",
586
+ dataUpdatedAt: options?.updatedAt,
587
+ manual: options?.manual
588
+ });
589
+ return data;
590
+ }
591
+ setState(state, setStateOptions) {
592
+ this.#dispatch({
593
+ type: "setState",
594
+ state,
595
+ setStateOptions
596
+ });
597
+ }
598
+ cancel(options) {
599
+ const promise = this.#retryer?.promise;
600
+ this.#retryer?.cancel(options);
601
+ return promise ? promise.then(noop).catch(noop) : Promise.resolve();
602
+ }
603
+ destroy() {
604
+ super.destroy();
605
+ this.cancel({ silent: true });
606
+ }
607
+ reset() {
608
+ this.destroy();
609
+ this.setState(this.#initialState);
610
+ }
611
+ isActive() {
612
+ return this.observers.some((observer) => resolveEnabled(observer.options.enabled, this) !== false);
613
+ }
614
+ isDisabled() {
615
+ if (this.getObserversCount() > 0) return !this.isActive();
616
+ return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
617
+ }
618
+ isStatic() {
619
+ if (this.getObserversCount() > 0) return this.observers.some((observer) => resolveStaleTime(observer.options.staleTime, this) === "static");
620
+ return false;
621
+ }
622
+ isStale() {
623
+ if (this.getObserversCount() > 0) return this.observers.some((observer) => observer.getCurrentResult().isStale);
624
+ return this.state.data === void 0 || this.state.isInvalidated;
625
+ }
626
+ isStaleByTime(staleTime = 0) {
627
+ if (this.state.data === void 0) return true;
628
+ if (staleTime === "static") return false;
629
+ if (this.state.isInvalidated) return true;
630
+ return !timeUntilStale(this.state.dataUpdatedAt, staleTime);
631
+ }
632
+ onFocus() {
633
+ this.observers.find((x) => x.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false });
634
+ this.#retryer?.continue();
635
+ }
636
+ onOnline() {
637
+ this.observers.find((x) => x.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false });
638
+ this.#retryer?.continue();
639
+ }
640
+ addObserver(observer) {
641
+ if (!this.observers.includes(observer)) {
642
+ this.observers.push(observer);
643
+ this.clearGcTimeout();
644
+ this.#cache.notify({
645
+ type: "observerAdded",
646
+ query: this,
647
+ observer
648
+ });
649
+ }
650
+ }
651
+ removeObserver(observer) {
652
+ if (this.observers.includes(observer)) {
653
+ this.observers = this.observers.filter((x) => x !== observer);
654
+ if (!this.observers.length) {
655
+ if (this.#retryer) if (this.#abortSignalConsumed) this.#retryer.cancel({ revert: true });
656
+ else this.#retryer.cancelRetry();
657
+ this.scheduleGc();
658
+ }
659
+ this.#cache.notify({
660
+ type: "observerRemoved",
661
+ query: this,
662
+ observer
663
+ });
664
+ }
665
+ }
666
+ getObserversCount() {
667
+ return this.observers.length;
668
+ }
669
+ invalidate() {
670
+ if (!this.state.isInvalidated) this.#dispatch({ type: "invalidate" });
671
+ }
672
+ async fetch(options, fetchOptions) {
673
+ if (this.state.fetchStatus !== "idle" && this.#retryer?.status() !== "rejected") {
674
+ if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) this.cancel({ silent: true });
675
+ else if (this.#retryer) {
676
+ this.#retryer.continueRetry();
677
+ return this.#retryer.promise;
678
+ }
679
+ }
680
+ if (options) this.setOptions(options);
681
+ if (!this.options.queryFn) {
682
+ const observer = this.observers.find((x) => x.options.queryFn);
683
+ if (observer) this.setOptions(observer.options);
684
+ }
685
+ const abortController = new AbortController();
686
+ const addSignalProperty = (object) => {
687
+ Object.defineProperty(object, "signal", {
688
+ enumerable: true,
689
+ get: () => {
690
+ this.#abortSignalConsumed = true;
691
+ return abortController.signal;
692
+ }
693
+ });
694
+ };
695
+ const fetchFn = () => {
696
+ const queryFn = ensureQueryFn(this.options, fetchOptions);
697
+ const createQueryFnContext = () => {
698
+ const queryFnContext2 = {
699
+ client: this.#client,
700
+ queryKey: this.queryKey,
701
+ meta: this.meta
702
+ };
703
+ addSignalProperty(queryFnContext2);
704
+ return queryFnContext2;
705
+ };
706
+ const queryFnContext = createQueryFnContext();
707
+ this.#abortSignalConsumed = false;
708
+ if (this.options.persister) return this.options.persister(queryFn, queryFnContext, this);
709
+ return queryFn(queryFnContext);
710
+ };
711
+ const createFetchContext = () => {
712
+ const context2 = {
713
+ fetchOptions,
714
+ options: this.options,
715
+ queryKey: this.queryKey,
716
+ client: this.#client,
717
+ state: this.state,
718
+ fetchFn
719
+ };
720
+ addSignalProperty(context2);
721
+ return context2;
722
+ };
723
+ const context = createFetchContext();
724
+ this.options.behavior?.onFetch(context, this);
725
+ this.#revertState = this.state;
726
+ if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) this.#dispatch({
727
+ type: "fetch",
728
+ meta: context.fetchOptions?.meta
729
+ });
730
+ this.#retryer = createRetryer({
731
+ initialPromise: fetchOptions?.initialPromise,
732
+ fn: context.fetchFn,
733
+ onCancel: (error) => {
734
+ if (error instanceof CancelledError && error.revert) this.setState({
735
+ ...this.#revertState,
736
+ fetchStatus: "idle"
737
+ });
738
+ abortController.abort();
739
+ },
740
+ onFail: (failureCount, error) => {
741
+ this.#dispatch({
742
+ type: "failed",
743
+ failureCount,
744
+ error
745
+ });
746
+ },
747
+ onPause: () => {
748
+ this.#dispatch({ type: "pause" });
749
+ },
750
+ onContinue: () => {
751
+ this.#dispatch({ type: "continue" });
752
+ },
753
+ retry: context.options.retry,
754
+ retryDelay: context.options.retryDelay,
755
+ networkMode: context.options.networkMode,
756
+ canRun: () => true
757
+ });
758
+ try {
759
+ const data = await this.#retryer.start();
760
+ if (data === void 0) throw new Error(`${this.queryHash} data is undefined`);
761
+ this.setData(data);
762
+ this.#cache.config.onSuccess?.(data, this);
763
+ this.#cache.config.onSettled?.(data, this.state.error, this);
764
+ return data;
765
+ } catch (error) {
766
+ if (error instanceof CancelledError) {
767
+ if (error.silent) return this.#retryer.promise;
768
+ else if (error.revert) {
769
+ if (this.state.data === void 0) throw error;
770
+ return this.state.data;
771
+ }
772
+ }
773
+ this.#dispatch({
774
+ type: "error",
775
+ error
776
+ });
777
+ this.#cache.config.onError?.(error, this);
778
+ this.#cache.config.onSettled?.(this.state.data, error, this);
779
+ throw error;
780
+ } finally {
781
+ this.scheduleGc();
782
+ }
783
+ }
784
+ #dispatch(action) {
785
+ const reducer = (state) => {
786
+ switch (action.type) {
787
+ case "failed": return {
788
+ ...state,
789
+ fetchFailureCount: action.failureCount,
790
+ fetchFailureReason: action.error
791
+ };
792
+ case "pause": return {
793
+ ...state,
794
+ fetchStatus: "paused"
795
+ };
796
+ case "continue": return {
797
+ ...state,
798
+ fetchStatus: "fetching"
799
+ };
800
+ case "fetch": return {
801
+ ...state,
802
+ ...fetchState(state.data, this.options),
803
+ fetchMeta: action.meta ?? null
804
+ };
805
+ case "success":
806
+ const newState = {
807
+ ...state,
808
+ ...successState(action.data, action.dataUpdatedAt),
809
+ dataUpdateCount: state.dataUpdateCount + 1,
810
+ ...!action.manual && {
811
+ fetchStatus: "idle",
812
+ fetchFailureCount: 0,
813
+ fetchFailureReason: null
814
+ }
815
+ };
816
+ this.#revertState = action.manual ? newState : void 0;
817
+ return newState;
818
+ case "error":
819
+ const error = action.error;
820
+ return {
821
+ ...state,
822
+ error,
823
+ errorUpdateCount: state.errorUpdateCount + 1,
824
+ errorUpdatedAt: Date.now(),
825
+ fetchFailureCount: state.fetchFailureCount + 1,
826
+ fetchFailureReason: error,
827
+ fetchStatus: "idle",
828
+ status: "error",
829
+ isInvalidated: true
830
+ };
831
+ case "invalidate": return {
832
+ ...state,
833
+ isInvalidated: true
834
+ };
835
+ case "setState": return {
836
+ ...state,
837
+ ...action.state
838
+ };
839
+ }
840
+ };
841
+ this.state = reducer(this.state);
842
+ notifyManager.batch(() => {
843
+ this.observers.forEach((observer) => {
844
+ observer.onQueryUpdate();
845
+ });
846
+ this.#cache.notify({
847
+ query: this,
848
+ type: "updated",
849
+ action
850
+ });
851
+ });
852
+ }
853
+ };
854
+ function fetchState(data, options) {
855
+ return {
856
+ fetchFailureCount: 0,
857
+ fetchFailureReason: null,
858
+ fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
859
+ ...data === void 0 && {
860
+ error: null,
861
+ status: "pending"
862
+ }
863
+ };
864
+ }
865
+ function successState(data, dataUpdatedAt) {
866
+ return {
867
+ data,
868
+ dataUpdatedAt: dataUpdatedAt ?? Date.now(),
869
+ error: null,
870
+ isInvalidated: false,
871
+ status: "success"
872
+ };
873
+ }
874
+ function getDefaultState$1(options) {
875
+ const data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
876
+ const hasData = data !== void 0;
877
+ const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;
878
+ return {
879
+ data,
880
+ dataUpdateCount: 0,
881
+ dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,
882
+ error: null,
883
+ errorUpdateCount: 0,
884
+ errorUpdatedAt: 0,
885
+ fetchFailureCount: 0,
886
+ fetchFailureReason: null,
887
+ fetchMeta: null,
888
+ isInvalidated: false,
889
+ status: hasData ? "success" : "pending",
890
+ fetchStatus: "idle"
891
+ };
892
+ }
893
+ //#endregion
894
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryObserver.js
895
+ var QueryObserver = class extends Subscribable {
896
+ constructor(client, options) {
897
+ super();
898
+ this.options = options;
899
+ this.#client = client;
900
+ this.#selectError = null;
901
+ this.#currentThenable = pendingThenable();
902
+ this.bindMethods();
903
+ this.setOptions(options);
904
+ }
905
+ #client;
906
+ #currentQuery = void 0;
907
+ #currentQueryInitialState = void 0;
908
+ #currentResult = void 0;
909
+ #currentResultState;
910
+ #currentResultOptions;
911
+ #currentThenable;
912
+ #selectError;
913
+ #selectFn;
914
+ #selectResult;
915
+ #lastQueryWithDefinedData;
916
+ #staleTimeoutId;
917
+ #refetchIntervalId;
918
+ #currentRefetchInterval;
919
+ #trackedProps = /* @__PURE__ */ new Set();
920
+ bindMethods() {
921
+ this.refetch = this.refetch.bind(this);
922
+ }
923
+ onSubscribe() {
924
+ if (this.listeners.size === 1) {
925
+ this.#currentQuery.addObserver(this);
926
+ if (shouldFetchOnMount(this.#currentQuery, this.options)) this.#executeFetch();
927
+ else this.updateResult();
928
+ this.#updateTimers();
929
+ }
930
+ }
931
+ onUnsubscribe() {
932
+ if (!this.hasListeners()) this.destroy();
933
+ }
934
+ shouldFetchOnReconnect() {
935
+ return shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnReconnect);
936
+ }
937
+ shouldFetchOnWindowFocus() {
938
+ return shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnWindowFocus);
939
+ }
940
+ destroy() {
941
+ this.listeners = /* @__PURE__ */ new Set();
942
+ this.#clearStaleTimeout();
943
+ this.#clearRefetchInterval();
944
+ this.#currentQuery.removeObserver(this);
945
+ }
946
+ setOptions(options) {
947
+ const prevOptions = this.options;
948
+ const prevQuery = this.#currentQuery;
949
+ this.options = this.#client.defaultQueryOptions(options);
950
+ if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== "boolean") throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");
951
+ this.#updateQuery();
952
+ this.#currentQuery.setOptions(this.options);
953
+ if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) this.#client.getQueryCache().notify({
954
+ type: "observerOptionsUpdated",
955
+ query: this.#currentQuery,
956
+ observer: this
957
+ });
958
+ const mounted = this.hasListeners();
959
+ if (mounted && shouldFetchOptionally(this.#currentQuery, prevQuery, this.options, prevOptions)) this.#executeFetch();
960
+ this.updateResult();
961
+ if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) this.#updateStaleTimeout();
962
+ const nextRefetchInterval = this.#computeRefetchInterval();
963
+ if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) this.#updateRefetchInterval(nextRefetchInterval);
964
+ }
965
+ getOptimisticResult(options) {
966
+ const query = this.#client.getQueryCache().build(this.#client, options);
967
+ const result = this.createResult(query, options);
968
+ if (shouldAssignObserverCurrentProperties(this, result)) {
969
+ this.#currentResult = result;
970
+ this.#currentResultOptions = this.options;
971
+ this.#currentResultState = this.#currentQuery.state;
972
+ }
973
+ return result;
974
+ }
975
+ getCurrentResult() {
976
+ return this.#currentResult;
977
+ }
978
+ trackResult(result, onPropTracked) {
979
+ return new Proxy(result, { get: (target, key) => {
980
+ this.trackProp(key);
981
+ onPropTracked?.(key);
982
+ if (key === "promise") {
983
+ this.trackProp("data");
984
+ if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") this.#currentThenable.reject(/* @__PURE__ */ new Error("experimental_prefetchInRender feature flag is not enabled"));
985
+ }
986
+ return Reflect.get(target, key);
987
+ } });
988
+ }
989
+ trackProp(key) {
990
+ this.#trackedProps.add(key);
991
+ }
992
+ getCurrentQuery() {
993
+ return this.#currentQuery;
994
+ }
995
+ refetch({ ...options } = {}) {
996
+ return this.fetch({ ...options });
997
+ }
998
+ fetchOptimistic(options) {
999
+ const defaultedOptions = this.#client.defaultQueryOptions(options);
1000
+ const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);
1001
+ return query.fetch().then(() => this.createResult(query, defaultedOptions));
1002
+ }
1003
+ fetch(fetchOptions) {
1004
+ return this.#executeFetch({
1005
+ ...fetchOptions,
1006
+ cancelRefetch: fetchOptions.cancelRefetch ?? true
1007
+ }).then(() => {
1008
+ this.updateResult();
1009
+ return this.#currentResult;
1010
+ });
1011
+ }
1012
+ #executeFetch(fetchOptions) {
1013
+ this.#updateQuery();
1014
+ let promise = this.#currentQuery.fetch(this.options, fetchOptions);
1015
+ if (!fetchOptions?.throwOnError) promise = promise.catch(noop);
1016
+ return promise;
1017
+ }
1018
+ #updateStaleTimeout() {
1019
+ this.#clearStaleTimeout();
1020
+ const staleTime = resolveStaleTime(this.options.staleTime, this.#currentQuery);
1021
+ if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) return;
1022
+ const timeout = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) + 1;
1023
+ this.#staleTimeoutId = timeoutManager.setTimeout(() => {
1024
+ if (!this.#currentResult.isStale) this.updateResult();
1025
+ }, timeout);
1026
+ }
1027
+ #computeRefetchInterval() {
1028
+ return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;
1029
+ }
1030
+ #updateRefetchInterval(nextInterval) {
1031
+ this.#clearRefetchInterval();
1032
+ this.#currentRefetchInterval = nextInterval;
1033
+ if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) return;
1034
+ this.#refetchIntervalId = timeoutManager.setInterval(() => {
1035
+ if (this.options.refetchIntervalInBackground || focusManager.isFocused()) this.#executeFetch();
1036
+ }, this.#currentRefetchInterval);
1037
+ }
1038
+ #updateTimers() {
1039
+ this.#updateStaleTimeout();
1040
+ this.#updateRefetchInterval(this.#computeRefetchInterval());
1041
+ }
1042
+ #clearStaleTimeout() {
1043
+ if (this.#staleTimeoutId) {
1044
+ timeoutManager.clearTimeout(this.#staleTimeoutId);
1045
+ this.#staleTimeoutId = void 0;
1046
+ }
1047
+ }
1048
+ #clearRefetchInterval() {
1049
+ if (this.#refetchIntervalId) {
1050
+ timeoutManager.clearInterval(this.#refetchIntervalId);
1051
+ this.#refetchIntervalId = void 0;
1052
+ }
1053
+ }
1054
+ createResult(query, options) {
1055
+ const prevQuery = this.#currentQuery;
1056
+ const prevOptions = this.options;
1057
+ const prevResult = this.#currentResult;
1058
+ const prevResultState = this.#currentResultState;
1059
+ const prevResultOptions = this.#currentResultOptions;
1060
+ const queryInitialState = query !== prevQuery ? query.state : this.#currentQueryInitialState;
1061
+ const { state } = query;
1062
+ let newState = { ...state };
1063
+ let isPlaceholderData = false;
1064
+ let data;
1065
+ if (options._optimisticResults) {
1066
+ const mounted = this.hasListeners();
1067
+ const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
1068
+ const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
1069
+ if (fetchOnMount || fetchOptionally) newState = {
1070
+ ...newState,
1071
+ ...fetchState(state.data, query.options)
1072
+ };
1073
+ if (options._optimisticResults === "isRestoring") newState.fetchStatus = "idle";
1074
+ }
1075
+ let { error, errorUpdatedAt, status } = newState;
1076
+ data = newState.data;
1077
+ let skipSelect = false;
1078
+ if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
1079
+ let placeholderData;
1080
+ if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {
1081
+ placeholderData = prevResult.data;
1082
+ skipSelect = true;
1083
+ } else placeholderData = typeof options.placeholderData === "function" ? options.placeholderData(this.#lastQueryWithDefinedData?.state.data, this.#lastQueryWithDefinedData) : options.placeholderData;
1084
+ if (placeholderData !== void 0) {
1085
+ status = "success";
1086
+ data = replaceData(prevResult?.data, placeholderData, options);
1087
+ isPlaceholderData = true;
1088
+ }
1089
+ }
1090
+ if (options.select && data !== void 0 && !skipSelect) if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) data = this.#selectResult;
1091
+ else try {
1092
+ this.#selectFn = options.select;
1093
+ data = options.select(data);
1094
+ data = replaceData(prevResult?.data, data, options);
1095
+ this.#selectResult = data;
1096
+ this.#selectError = null;
1097
+ } catch (selectError) {
1098
+ this.#selectError = selectError;
1099
+ }
1100
+ if (this.#selectError) {
1101
+ error = this.#selectError;
1102
+ data = this.#selectResult;
1103
+ errorUpdatedAt = Date.now();
1104
+ status = "error";
1105
+ }
1106
+ const isFetching = newState.fetchStatus === "fetching";
1107
+ const isPending = status === "pending";
1108
+ const isError = status === "error";
1109
+ const isLoading = isPending && isFetching;
1110
+ const hasData = data !== void 0;
1111
+ const nextResult = {
1112
+ status,
1113
+ fetchStatus: newState.fetchStatus,
1114
+ isPending,
1115
+ isSuccess: status === "success",
1116
+ isError,
1117
+ isInitialLoading: isLoading,
1118
+ isLoading,
1119
+ data,
1120
+ dataUpdatedAt: newState.dataUpdatedAt,
1121
+ error,
1122
+ errorUpdatedAt,
1123
+ failureCount: newState.fetchFailureCount,
1124
+ failureReason: newState.fetchFailureReason,
1125
+ errorUpdateCount: newState.errorUpdateCount,
1126
+ isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,
1127
+ isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,
1128
+ isFetching,
1129
+ isRefetching: isFetching && !isPending,
1130
+ isLoadingError: isError && !hasData,
1131
+ isPaused: newState.fetchStatus === "paused",
1132
+ isPlaceholderData,
1133
+ isRefetchError: isError && hasData,
1134
+ isStale: isStale(query, options),
1135
+ refetch: this.refetch,
1136
+ promise: this.#currentThenable,
1137
+ isEnabled: resolveEnabled(options.enabled, query) !== false
1138
+ };
1139
+ if (this.options.experimental_prefetchInRender) {
1140
+ const hasResultData = nextResult.data !== void 0;
1141
+ const isErrorWithoutData = nextResult.status === "error" && !hasResultData;
1142
+ const finalizeThenableIfPossible = (thenable) => {
1143
+ if (isErrorWithoutData) thenable.reject(nextResult.error);
1144
+ else if (hasResultData) thenable.resolve(nextResult.data);
1145
+ };
1146
+ const recreateThenable = () => {
1147
+ finalizeThenableIfPossible(this.#currentThenable = nextResult.promise = pendingThenable());
1148
+ };
1149
+ const prevThenable = this.#currentThenable;
1150
+ switch (prevThenable.status) {
1151
+ case "pending":
1152
+ if (query.queryHash === prevQuery.queryHash) finalizeThenableIfPossible(prevThenable);
1153
+ break;
1154
+ case "fulfilled":
1155
+ if (isErrorWithoutData || nextResult.data !== prevThenable.value) recreateThenable();
1156
+ break;
1157
+ case "rejected":
1158
+ if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) recreateThenable();
1159
+ break;
1160
+ }
1161
+ }
1162
+ return nextResult;
1163
+ }
1164
+ updateResult() {
1165
+ const prevResult = this.#currentResult;
1166
+ const nextResult = this.createResult(this.#currentQuery, this.options);
1167
+ this.#currentResultState = this.#currentQuery.state;
1168
+ this.#currentResultOptions = this.options;
1169
+ if (this.#currentResultState.data !== void 0) this.#lastQueryWithDefinedData = this.#currentQuery;
1170
+ if (shallowEqualObjects(nextResult, prevResult)) return;
1171
+ this.#currentResult = nextResult;
1172
+ const shouldNotifyListeners = () => {
1173
+ if (!prevResult) return true;
1174
+ const { notifyOnChangeProps } = this.options;
1175
+ const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps;
1176
+ if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) return true;
1177
+ const includedProps = new Set(notifyOnChangePropsValue ?? this.#trackedProps);
1178
+ if (this.options.throwOnError) includedProps.add("error");
1179
+ return Object.keys(this.#currentResult).some((key) => {
1180
+ const typedKey = key;
1181
+ return this.#currentResult[typedKey] !== prevResult[typedKey] && includedProps.has(typedKey);
1182
+ });
1183
+ };
1184
+ this.#notify({ listeners: shouldNotifyListeners() });
1185
+ }
1186
+ #updateQuery() {
1187
+ const query = this.#client.getQueryCache().build(this.#client, this.options);
1188
+ if (query === this.#currentQuery) return;
1189
+ const prevQuery = this.#currentQuery;
1190
+ this.#currentQuery = query;
1191
+ this.#currentQueryInitialState = query.state;
1192
+ if (this.hasListeners()) {
1193
+ prevQuery?.removeObserver(this);
1194
+ query.addObserver(this);
1195
+ }
1196
+ }
1197
+ onQueryUpdate() {
1198
+ this.updateResult();
1199
+ if (this.hasListeners()) this.#updateTimers();
1200
+ }
1201
+ #notify(notifyOptions) {
1202
+ notifyManager.batch(() => {
1203
+ if (notifyOptions.listeners) this.listeners.forEach((listener) => {
1204
+ listener(this.#currentResult);
1205
+ });
1206
+ this.#client.getQueryCache().notify({
1207
+ query: this.#currentQuery,
1208
+ type: "observerResultsUpdated"
1209
+ });
1210
+ });
1211
+ }
1212
+ };
1213
+ function shouldLoadOnMount(query, options) {
1214
+ return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false);
1215
+ }
1216
+ function shouldFetchOnMount(query, options) {
1217
+ return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);
1218
+ }
1219
+ function shouldFetchOn(query, options, field) {
1220
+ if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") {
1221
+ const value = typeof field === "function" ? field(query) : field;
1222
+ return value === "always" || value !== false && isStale(query, options);
1223
+ }
1224
+ return false;
1225
+ }
1226
+ function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
1227
+ return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
1228
+ }
1229
+ function isStale(query, options) {
1230
+ return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));
1231
+ }
1232
+ function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
1233
+ if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) return true;
1234
+ return false;
1235
+ }
1236
+ //#endregion
1237
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
1238
+ function infiniteQueryBehavior(pages) {
1239
+ return { onFetch: (context, query) => {
1240
+ const options = context.options;
1241
+ const direction = context.fetchOptions?.meta?.fetchMore?.direction;
1242
+ const oldPages = context.state.data?.pages || [];
1243
+ const oldPageParams = context.state.data?.pageParams || [];
1244
+ let result = {
1245
+ pages: [],
1246
+ pageParams: []
1247
+ };
1248
+ let currentPage = 0;
1249
+ const fetchFn = async () => {
1250
+ let cancelled = false;
1251
+ const addSignalProperty = (object) => {
1252
+ addConsumeAwareSignal(object, () => context.signal, () => cancelled = true);
1253
+ };
1254
+ const queryFn = ensureQueryFn(context.options, context.fetchOptions);
1255
+ const fetchPage = async (data, param, previous) => {
1256
+ if (cancelled) return Promise.reject();
1257
+ if (param == null && data.pages.length) return Promise.resolve(data);
1258
+ const createQueryFnContext = () => {
1259
+ const queryFnContext2 = {
1260
+ client: context.client,
1261
+ queryKey: context.queryKey,
1262
+ pageParam: param,
1263
+ direction: previous ? "backward" : "forward",
1264
+ meta: context.options.meta
1265
+ };
1266
+ addSignalProperty(queryFnContext2);
1267
+ return queryFnContext2;
1268
+ };
1269
+ const page = await queryFn(createQueryFnContext());
1270
+ const { maxPages } = context.options;
1271
+ const addTo = previous ? addToStart : addToEnd;
1272
+ return {
1273
+ pages: addTo(data.pages, page, maxPages),
1274
+ pageParams: addTo(data.pageParams, param, maxPages)
1275
+ };
1276
+ };
1277
+ if (direction && oldPages.length) {
1278
+ const previous = direction === "backward";
1279
+ const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;
1280
+ const oldData = {
1281
+ pages: oldPages,
1282
+ pageParams: oldPageParams
1283
+ };
1284
+ result = await fetchPage(oldData, pageParamFn(options, oldData), previous);
1285
+ } else {
1286
+ const remainingPages = pages ?? oldPages.length;
1287
+ do {
1288
+ const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);
1289
+ if (currentPage > 0 && param == null) break;
1290
+ result = await fetchPage(result, param);
1291
+ currentPage++;
1292
+ } while (currentPage < remainingPages);
1293
+ }
1294
+ return result;
1295
+ };
1296
+ if (context.options.persister) context.fetchFn = () => {
1297
+ return context.options.persister?.(fetchFn, {
1298
+ client: context.client,
1299
+ queryKey: context.queryKey,
1300
+ meta: context.options.meta,
1301
+ signal: context.signal
1302
+ }, query);
1303
+ };
1304
+ else context.fetchFn = fetchFn;
1305
+ } };
1306
+ }
1307
+ function getNextPageParam(options, { pages, pageParams }) {
1308
+ const lastIndex = pages.length - 1;
1309
+ return pages.length > 0 ? options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams) : void 0;
1310
+ }
1311
+ function getPreviousPageParam(options, { pages, pageParams }) {
1312
+ return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;
1313
+ }
1314
+ //#endregion
1315
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutation.js
1316
+ var Mutation = class extends Removable {
1317
+ #client;
1318
+ #observers;
1319
+ #mutationCache;
1320
+ #retryer;
1321
+ constructor(config) {
1322
+ super();
1323
+ this.#client = config.client;
1324
+ this.mutationId = config.mutationId;
1325
+ this.#mutationCache = config.mutationCache;
1326
+ this.#observers = [];
1327
+ this.state = config.state || getDefaultState();
1328
+ this.setOptions(config.options);
1329
+ this.scheduleGc();
1330
+ }
1331
+ setOptions(options) {
1332
+ this.options = options;
1333
+ this.updateGcTime(this.options.gcTime);
1334
+ }
1335
+ get meta() {
1336
+ return this.options.meta;
1337
+ }
1338
+ addObserver(observer) {
1339
+ if (!this.#observers.includes(observer)) {
1340
+ this.#observers.push(observer);
1341
+ this.clearGcTimeout();
1342
+ this.#mutationCache.notify({
1343
+ type: "observerAdded",
1344
+ mutation: this,
1345
+ observer
1346
+ });
1347
+ }
1348
+ }
1349
+ removeObserver(observer) {
1350
+ this.#observers = this.#observers.filter((x) => x !== observer);
1351
+ this.scheduleGc();
1352
+ this.#mutationCache.notify({
1353
+ type: "observerRemoved",
1354
+ mutation: this,
1355
+ observer
1356
+ });
1357
+ }
1358
+ optionalRemove() {
1359
+ if (!this.#observers.length) if (this.state.status === "pending") this.scheduleGc();
1360
+ else this.#mutationCache.remove(this);
1361
+ }
1362
+ continue() {
1363
+ return this.#retryer?.continue() ?? this.execute(this.state.variables);
1364
+ }
1365
+ async execute(variables) {
1366
+ const onContinue = () => {
1367
+ this.#dispatch({ type: "continue" });
1368
+ };
1369
+ const mutationFnContext = {
1370
+ client: this.#client,
1371
+ meta: this.options.meta,
1372
+ mutationKey: this.options.mutationKey
1373
+ };
1374
+ this.#retryer = createRetryer({
1375
+ fn: () => {
1376
+ if (!this.options.mutationFn) return Promise.reject(/* @__PURE__ */ new Error("No mutationFn found"));
1377
+ return this.options.mutationFn(variables, mutationFnContext);
1378
+ },
1379
+ onFail: (failureCount, error) => {
1380
+ this.#dispatch({
1381
+ type: "failed",
1382
+ failureCount,
1383
+ error
1384
+ });
1385
+ },
1386
+ onPause: () => {
1387
+ this.#dispatch({ type: "pause" });
1388
+ },
1389
+ onContinue,
1390
+ retry: this.options.retry ?? 0,
1391
+ retryDelay: this.options.retryDelay,
1392
+ networkMode: this.options.networkMode,
1393
+ canRun: () => this.#mutationCache.canRun(this)
1394
+ });
1395
+ const restored = this.state.status === "pending";
1396
+ const isPaused = !this.#retryer.canStart();
1397
+ try {
1398
+ if (restored) onContinue();
1399
+ else {
1400
+ this.#dispatch({
1401
+ type: "pending",
1402
+ variables,
1403
+ isPaused
1404
+ });
1405
+ if (this.#mutationCache.config.onMutate) await this.#mutationCache.config.onMutate(variables, this, mutationFnContext);
1406
+ const context = await this.options.onMutate?.(variables, mutationFnContext);
1407
+ if (context !== this.state.context) this.#dispatch({
1408
+ type: "pending",
1409
+ context,
1410
+ variables,
1411
+ isPaused
1412
+ });
1413
+ }
1414
+ const data = await this.#retryer.start();
1415
+ await this.#mutationCache.config.onSuccess?.(data, variables, this.state.context, this, mutationFnContext);
1416
+ await this.options.onSuccess?.(data, variables, this.state.context, mutationFnContext);
1417
+ await this.#mutationCache.config.onSettled?.(data, null, this.state.variables, this.state.context, this, mutationFnContext);
1418
+ await this.options.onSettled?.(data, null, variables, this.state.context, mutationFnContext);
1419
+ this.#dispatch({
1420
+ type: "success",
1421
+ data
1422
+ });
1423
+ return data;
1424
+ } catch (error) {
1425
+ try {
1426
+ await this.#mutationCache.config.onError?.(error, variables, this.state.context, this, mutationFnContext);
1427
+ } catch (e) {
1428
+ Promise.reject(e);
1429
+ }
1430
+ try {
1431
+ await this.options.onError?.(error, variables, this.state.context, mutationFnContext);
1432
+ } catch (e) {
1433
+ Promise.reject(e);
1434
+ }
1435
+ try {
1436
+ await this.#mutationCache.config.onSettled?.(void 0, error, this.state.variables, this.state.context, this, mutationFnContext);
1437
+ } catch (e) {
1438
+ Promise.reject(e);
1439
+ }
1440
+ try {
1441
+ await this.options.onSettled?.(void 0, error, variables, this.state.context, mutationFnContext);
1442
+ } catch (e) {
1443
+ Promise.reject(e);
1444
+ }
1445
+ this.#dispatch({
1446
+ type: "error",
1447
+ error
1448
+ });
1449
+ throw error;
1450
+ } finally {
1451
+ this.#mutationCache.runNext(this);
1452
+ }
1453
+ }
1454
+ #dispatch(action) {
1455
+ const reducer = (state) => {
1456
+ switch (action.type) {
1457
+ case "failed": return {
1458
+ ...state,
1459
+ failureCount: action.failureCount,
1460
+ failureReason: action.error
1461
+ };
1462
+ case "pause": return {
1463
+ ...state,
1464
+ isPaused: true
1465
+ };
1466
+ case "continue": return {
1467
+ ...state,
1468
+ isPaused: false
1469
+ };
1470
+ case "pending": return {
1471
+ ...state,
1472
+ context: action.context,
1473
+ data: void 0,
1474
+ failureCount: 0,
1475
+ failureReason: null,
1476
+ error: null,
1477
+ isPaused: action.isPaused,
1478
+ status: "pending",
1479
+ variables: action.variables,
1480
+ submittedAt: Date.now()
1481
+ };
1482
+ case "success": return {
1483
+ ...state,
1484
+ data: action.data,
1485
+ failureCount: 0,
1486
+ failureReason: null,
1487
+ error: null,
1488
+ status: "success",
1489
+ isPaused: false
1490
+ };
1491
+ case "error": return {
1492
+ ...state,
1493
+ data: void 0,
1494
+ error: action.error,
1495
+ failureCount: state.failureCount + 1,
1496
+ failureReason: action.error,
1497
+ isPaused: false,
1498
+ status: "error"
1499
+ };
1500
+ }
1501
+ };
1502
+ this.state = reducer(this.state);
1503
+ notifyManager.batch(() => {
1504
+ this.#observers.forEach((observer) => {
1505
+ observer.onMutationUpdate(action);
1506
+ });
1507
+ this.#mutationCache.notify({
1508
+ mutation: this,
1509
+ type: "updated",
1510
+ action
1511
+ });
1512
+ });
1513
+ }
1514
+ };
1515
+ function getDefaultState() {
1516
+ return {
1517
+ context: void 0,
1518
+ data: void 0,
1519
+ error: null,
1520
+ failureCount: 0,
1521
+ failureReason: null,
1522
+ isPaused: false,
1523
+ status: "idle",
1524
+ variables: void 0,
1525
+ submittedAt: 0
1526
+ };
1527
+ }
1528
+ //#endregion
1529
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutationCache.js
1530
+ var MutationCache = class extends Subscribable {
1531
+ constructor(config = {}) {
1532
+ super();
1533
+ this.config = config;
1534
+ this.#mutations = /* @__PURE__ */ new Set();
1535
+ this.#scopes = /* @__PURE__ */ new Map();
1536
+ this.#mutationId = 0;
1537
+ }
1538
+ #mutations;
1539
+ #scopes;
1540
+ #mutationId;
1541
+ build(client, options, state) {
1542
+ const mutation = new Mutation({
1543
+ client,
1544
+ mutationCache: this,
1545
+ mutationId: ++this.#mutationId,
1546
+ options: client.defaultMutationOptions(options),
1547
+ state
1548
+ });
1549
+ this.add(mutation);
1550
+ return mutation;
1551
+ }
1552
+ add(mutation) {
1553
+ this.#mutations.add(mutation);
1554
+ const scope = scopeFor(mutation);
1555
+ if (typeof scope === "string") {
1556
+ const scopedMutations = this.#scopes.get(scope);
1557
+ if (scopedMutations) scopedMutations.push(mutation);
1558
+ else this.#scopes.set(scope, [mutation]);
1559
+ }
1560
+ this.notify({
1561
+ type: "added",
1562
+ mutation
1563
+ });
1564
+ }
1565
+ remove(mutation) {
1566
+ if (this.#mutations.delete(mutation)) {
1567
+ const scope = scopeFor(mutation);
1568
+ if (typeof scope === "string") {
1569
+ const scopedMutations = this.#scopes.get(scope);
1570
+ if (scopedMutations) {
1571
+ if (scopedMutations.length > 1) {
1572
+ const index = scopedMutations.indexOf(mutation);
1573
+ if (index !== -1) scopedMutations.splice(index, 1);
1574
+ } else if (scopedMutations[0] === mutation) this.#scopes.delete(scope);
1575
+ }
1576
+ }
1577
+ }
1578
+ this.notify({
1579
+ type: "removed",
1580
+ mutation
1581
+ });
1582
+ }
1583
+ canRun(mutation) {
1584
+ const scope = scopeFor(mutation);
1585
+ if (typeof scope === "string") {
1586
+ const firstPendingMutation = this.#scopes.get(scope)?.find((m) => m.state.status === "pending");
1587
+ return !firstPendingMutation || firstPendingMutation === mutation;
1588
+ } else return true;
1589
+ }
1590
+ runNext(mutation) {
1591
+ const scope = scopeFor(mutation);
1592
+ if (typeof scope === "string") return (this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused))?.continue() ?? Promise.resolve();
1593
+ else return Promise.resolve();
1594
+ }
1595
+ clear() {
1596
+ notifyManager.batch(() => {
1597
+ this.#mutations.forEach((mutation) => {
1598
+ this.notify({
1599
+ type: "removed",
1600
+ mutation
1601
+ });
1602
+ });
1603
+ this.#mutations.clear();
1604
+ this.#scopes.clear();
1605
+ });
1606
+ }
1607
+ getAll() {
1608
+ return Array.from(this.#mutations);
1609
+ }
1610
+ find(filters) {
1611
+ const defaultedFilters = {
1612
+ exact: true,
1613
+ ...filters
1614
+ };
1615
+ return this.getAll().find((mutation) => matchMutation(defaultedFilters, mutation));
1616
+ }
1617
+ findAll(filters = {}) {
1618
+ return this.getAll().filter((mutation) => matchMutation(filters, mutation));
1619
+ }
1620
+ notify(event) {
1621
+ notifyManager.batch(() => {
1622
+ this.listeners.forEach((listener) => {
1623
+ listener(event);
1624
+ });
1625
+ });
1626
+ }
1627
+ resumePausedMutations() {
1628
+ const pausedMutations = this.getAll().filter((x) => x.state.isPaused);
1629
+ return notifyManager.batch(() => Promise.all(pausedMutations.map((mutation) => mutation.continue().catch(noop))));
1630
+ }
1631
+ };
1632
+ function scopeFor(mutation) {
1633
+ return mutation.options.scope?.id;
1634
+ }
1635
+ //#endregion
1636
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
1637
+ var MutationObserver = class extends Subscribable {
1638
+ #client;
1639
+ #currentResult = void 0;
1640
+ #currentMutation;
1641
+ #mutateOptions;
1642
+ constructor(client, options) {
1643
+ super();
1644
+ this.#client = client;
1645
+ this.setOptions(options);
1646
+ this.bindMethods();
1647
+ this.#updateResult();
1648
+ }
1649
+ bindMethods() {
1650
+ this.mutate = this.mutate.bind(this);
1651
+ this.reset = this.reset.bind(this);
1652
+ }
1653
+ setOptions(options) {
1654
+ const prevOptions = this.options;
1655
+ this.options = this.#client.defaultMutationOptions(options);
1656
+ if (!shallowEqualObjects(this.options, prevOptions)) this.#client.getMutationCache().notify({
1657
+ type: "observerOptionsUpdated",
1658
+ mutation: this.#currentMutation,
1659
+ observer: this
1660
+ });
1661
+ if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) this.reset();
1662
+ else if (this.#currentMutation?.state.status === "pending") this.#currentMutation.setOptions(this.options);
1663
+ }
1664
+ onUnsubscribe() {
1665
+ if (!this.hasListeners()) this.#currentMutation?.removeObserver(this);
1666
+ }
1667
+ onMutationUpdate(action) {
1668
+ this.#updateResult();
1669
+ this.#notify(action);
1670
+ }
1671
+ getCurrentResult() {
1672
+ return this.#currentResult;
1673
+ }
1674
+ reset() {
1675
+ this.#currentMutation?.removeObserver(this);
1676
+ this.#currentMutation = void 0;
1677
+ this.#updateResult();
1678
+ this.#notify();
1679
+ }
1680
+ mutate(variables, options) {
1681
+ this.#mutateOptions = options;
1682
+ this.#currentMutation?.removeObserver(this);
1683
+ this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);
1684
+ this.#currentMutation.addObserver(this);
1685
+ return this.#currentMutation.execute(variables);
1686
+ }
1687
+ #updateResult() {
1688
+ const state = this.#currentMutation?.state ?? getDefaultState();
1689
+ this.#currentResult = {
1690
+ ...state,
1691
+ isPending: state.status === "pending",
1692
+ isSuccess: state.status === "success",
1693
+ isError: state.status === "error",
1694
+ isIdle: state.status === "idle",
1695
+ mutate: this.mutate,
1696
+ reset: this.reset
1697
+ };
1698
+ }
1699
+ #notify(action) {
1700
+ notifyManager.batch(() => {
1701
+ if (this.#mutateOptions && this.hasListeners()) {
1702
+ const variables = this.#currentResult.variables;
1703
+ const onMutateResult = this.#currentResult.context;
1704
+ const context = {
1705
+ client: this.#client,
1706
+ meta: this.options.meta,
1707
+ mutationKey: this.options.mutationKey
1708
+ };
1709
+ if (action?.type === "success") {
1710
+ try {
1711
+ this.#mutateOptions.onSuccess?.(action.data, variables, onMutateResult, context);
1712
+ } catch (e) {
1713
+ Promise.reject(e);
1714
+ }
1715
+ try {
1716
+ this.#mutateOptions.onSettled?.(action.data, null, variables, onMutateResult, context);
1717
+ } catch (e) {
1718
+ Promise.reject(e);
1719
+ }
1720
+ } else if (action?.type === "error") {
1721
+ try {
1722
+ this.#mutateOptions.onError?.(action.error, variables, onMutateResult, context);
1723
+ } catch (e) {
1724
+ Promise.reject(e);
1725
+ }
1726
+ try {
1727
+ this.#mutateOptions.onSettled?.(void 0, action.error, variables, onMutateResult, context);
1728
+ } catch (e) {
1729
+ Promise.reject(e);
1730
+ }
1731
+ }
1732
+ }
1733
+ this.listeners.forEach((listener) => {
1734
+ listener(this.#currentResult);
1735
+ });
1736
+ });
1737
+ }
1738
+ };
1739
+ //#endregion
1740
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryCache.js
1741
+ var QueryCache = class extends Subscribable {
1742
+ constructor(config = {}) {
1743
+ super();
1744
+ this.config = config;
1745
+ this.#queries = /* @__PURE__ */ new Map();
1746
+ }
1747
+ #queries;
1748
+ build(client, options, state) {
1749
+ const queryKey = options.queryKey;
1750
+ const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);
1751
+ let query = this.get(queryHash);
1752
+ if (!query) {
1753
+ query = new Query({
1754
+ client,
1755
+ queryKey,
1756
+ queryHash,
1757
+ options: client.defaultQueryOptions(options),
1758
+ state,
1759
+ defaultOptions: client.getQueryDefaults(queryKey)
1760
+ });
1761
+ this.add(query);
1762
+ }
1763
+ return query;
1764
+ }
1765
+ add(query) {
1766
+ if (!this.#queries.has(query.queryHash)) {
1767
+ this.#queries.set(query.queryHash, query);
1768
+ this.notify({
1769
+ type: "added",
1770
+ query
1771
+ });
1772
+ }
1773
+ }
1774
+ remove(query) {
1775
+ const queryInMap = this.#queries.get(query.queryHash);
1776
+ if (queryInMap) {
1777
+ query.destroy();
1778
+ if (queryInMap === query) this.#queries.delete(query.queryHash);
1779
+ this.notify({
1780
+ type: "removed",
1781
+ query
1782
+ });
1783
+ }
1784
+ }
1785
+ clear() {
1786
+ notifyManager.batch(() => {
1787
+ this.getAll().forEach((query) => {
1788
+ this.remove(query);
1789
+ });
1790
+ });
1791
+ }
1792
+ get(queryHash) {
1793
+ return this.#queries.get(queryHash);
1794
+ }
1795
+ getAll() {
1796
+ return [...this.#queries.values()];
1797
+ }
1798
+ find(filters) {
1799
+ const defaultedFilters = {
1800
+ exact: true,
1801
+ ...filters
1802
+ };
1803
+ return this.getAll().find((query) => matchQuery(defaultedFilters, query));
1804
+ }
1805
+ findAll(filters = {}) {
1806
+ const queries = this.getAll();
1807
+ return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;
1808
+ }
1809
+ notify(event) {
1810
+ notifyManager.batch(() => {
1811
+ this.listeners.forEach((listener) => {
1812
+ listener(event);
1813
+ });
1814
+ });
1815
+ }
1816
+ onFocus() {
1817
+ notifyManager.batch(() => {
1818
+ this.getAll().forEach((query) => {
1819
+ query.onFocus();
1820
+ });
1821
+ });
1822
+ }
1823
+ onOnline() {
1824
+ notifyManager.batch(() => {
1825
+ this.getAll().forEach((query) => {
1826
+ query.onOnline();
1827
+ });
1828
+ });
1829
+ }
1830
+ };
1831
+ //#endregion
1832
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryClient.js
1833
+ var QueryClient = class {
1834
+ #queryCache;
1835
+ #mutationCache;
1836
+ #defaultOptions;
1837
+ #queryDefaults;
1838
+ #mutationDefaults;
1839
+ #mountCount;
1840
+ #unsubscribeFocus;
1841
+ #unsubscribeOnline;
1842
+ constructor(config = {}) {
1843
+ this.#queryCache = config.queryCache || new QueryCache();
1844
+ this.#mutationCache = config.mutationCache || new MutationCache();
1845
+ this.#defaultOptions = config.defaultOptions || {};
1846
+ this.#queryDefaults = /* @__PURE__ */ new Map();
1847
+ this.#mutationDefaults = /* @__PURE__ */ new Map();
1848
+ this.#mountCount = 0;
1849
+ }
1850
+ mount() {
1851
+ this.#mountCount++;
1852
+ if (this.#mountCount !== 1) return;
1853
+ this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {
1854
+ if (focused) {
1855
+ await this.resumePausedMutations();
1856
+ this.#queryCache.onFocus();
1857
+ }
1858
+ });
1859
+ this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {
1860
+ if (online) {
1861
+ await this.resumePausedMutations();
1862
+ this.#queryCache.onOnline();
1863
+ }
1864
+ });
1865
+ }
1866
+ unmount() {
1867
+ this.#mountCount--;
1868
+ if (this.#mountCount !== 0) return;
1869
+ this.#unsubscribeFocus?.();
1870
+ this.#unsubscribeFocus = void 0;
1871
+ this.#unsubscribeOnline?.();
1872
+ this.#unsubscribeOnline = void 0;
1873
+ }
1874
+ isFetching(filters) {
1875
+ return this.#queryCache.findAll({
1876
+ ...filters,
1877
+ fetchStatus: "fetching"
1878
+ }).length;
1879
+ }
1880
+ isMutating(filters) {
1881
+ return this.#mutationCache.findAll({
1882
+ ...filters,
1883
+ status: "pending"
1884
+ }).length;
1885
+ }
1886
+ /**
1887
+ * Imperative (non-reactive) way to retrieve data for a QueryKey.
1888
+ * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
1889
+ *
1890
+ * Hint: Do not use this function inside a component, because it won't receive updates.
1891
+ * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
1892
+ */
1893
+ getQueryData(queryKey) {
1894
+ const options = this.defaultQueryOptions({ queryKey });
1895
+ return this.#queryCache.get(options.queryHash)?.state.data;
1896
+ }
1897
+ ensureQueryData(options) {
1898
+ const defaultedOptions = this.defaultQueryOptions(options);
1899
+ const query = this.#queryCache.build(this, defaultedOptions);
1900
+ const cachedData = query.state.data;
1901
+ if (cachedData === void 0) return this.fetchQuery(options);
1902
+ if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) this.prefetchQuery(defaultedOptions);
1903
+ return Promise.resolve(cachedData);
1904
+ }
1905
+ getQueriesData(filters) {
1906
+ return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {
1907
+ return [queryKey, state.data];
1908
+ });
1909
+ }
1910
+ setQueryData(queryKey, updater, options) {
1911
+ const defaultedOptions = this.defaultQueryOptions({ queryKey });
1912
+ const prevData = this.#queryCache.get(defaultedOptions.queryHash)?.state.data;
1913
+ const data = functionalUpdate(updater, prevData);
1914
+ if (data === void 0) return;
1915
+ return this.#queryCache.build(this, defaultedOptions).setData(data, {
1916
+ ...options,
1917
+ manual: true
1918
+ });
1919
+ }
1920
+ setQueriesData(filters, updater, options) {
1921
+ return notifyManager.batch(() => this.#queryCache.findAll(filters).map(({ queryKey }) => [queryKey, this.setQueryData(queryKey, updater, options)]));
1922
+ }
1923
+ getQueryState(queryKey) {
1924
+ const options = this.defaultQueryOptions({ queryKey });
1925
+ return this.#queryCache.get(options.queryHash)?.state;
1926
+ }
1927
+ removeQueries(filters) {
1928
+ const queryCache = this.#queryCache;
1929
+ notifyManager.batch(() => {
1930
+ queryCache.findAll(filters).forEach((query) => {
1931
+ queryCache.remove(query);
1932
+ });
1933
+ });
1934
+ }
1935
+ resetQueries(filters, options) {
1936
+ const queryCache = this.#queryCache;
1937
+ return notifyManager.batch(() => {
1938
+ queryCache.findAll(filters).forEach((query) => {
1939
+ query.reset();
1940
+ });
1941
+ return this.refetchQueries({
1942
+ type: "active",
1943
+ ...filters
1944
+ }, options);
1945
+ });
1946
+ }
1947
+ cancelQueries(filters, cancelOptions = {}) {
1948
+ const defaultedCancelOptions = {
1949
+ revert: true,
1950
+ ...cancelOptions
1951
+ };
1952
+ const promises = notifyManager.batch(() => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)));
1953
+ return Promise.all(promises).then(noop).catch(noop);
1954
+ }
1955
+ invalidateQueries(filters, options = {}) {
1956
+ return notifyManager.batch(() => {
1957
+ this.#queryCache.findAll(filters).forEach((query) => {
1958
+ query.invalidate();
1959
+ });
1960
+ if (filters?.refetchType === "none") return Promise.resolve();
1961
+ return this.refetchQueries({
1962
+ ...filters,
1963
+ type: filters?.refetchType ?? filters?.type ?? "active"
1964
+ }, options);
1965
+ });
1966
+ }
1967
+ refetchQueries(filters, options = {}) {
1968
+ const fetchOptions = {
1969
+ ...options,
1970
+ cancelRefetch: options.cancelRefetch ?? true
1971
+ };
1972
+ const promises = notifyManager.batch(() => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {
1973
+ let promise = query.fetch(void 0, fetchOptions);
1974
+ if (!fetchOptions.throwOnError) promise = promise.catch(noop);
1975
+ return query.state.fetchStatus === "paused" ? Promise.resolve() : promise;
1976
+ }));
1977
+ return Promise.all(promises).then(noop);
1978
+ }
1979
+ fetchQuery(options) {
1980
+ const defaultedOptions = this.defaultQueryOptions(options);
1981
+ if (defaultedOptions.retry === void 0) defaultedOptions.retry = false;
1982
+ const query = this.#queryCache.build(this, defaultedOptions);
1983
+ return query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query)) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);
1984
+ }
1985
+ prefetchQuery(options) {
1986
+ return this.fetchQuery(options).then(noop).catch(noop);
1987
+ }
1988
+ fetchInfiniteQuery(options) {
1989
+ options.behavior = infiniteQueryBehavior(options.pages);
1990
+ return this.fetchQuery(options);
1991
+ }
1992
+ prefetchInfiniteQuery(options) {
1993
+ return this.fetchInfiniteQuery(options).then(noop).catch(noop);
1994
+ }
1995
+ ensureInfiniteQueryData(options) {
1996
+ options.behavior = infiniteQueryBehavior(options.pages);
1997
+ return this.ensureQueryData(options);
1998
+ }
1999
+ resumePausedMutations() {
2000
+ if (onlineManager.isOnline()) return this.#mutationCache.resumePausedMutations();
2001
+ return Promise.resolve();
2002
+ }
2003
+ getQueryCache() {
2004
+ return this.#queryCache;
2005
+ }
2006
+ getMutationCache() {
2007
+ return this.#mutationCache;
2008
+ }
2009
+ getDefaultOptions() {
2010
+ return this.#defaultOptions;
2011
+ }
2012
+ setDefaultOptions(options) {
2013
+ this.#defaultOptions = options;
2014
+ }
2015
+ setQueryDefaults(queryKey, options) {
2016
+ this.#queryDefaults.set(hashKey(queryKey), {
2017
+ queryKey,
2018
+ defaultOptions: options
2019
+ });
2020
+ }
2021
+ getQueryDefaults(queryKey) {
2022
+ const defaults = [...this.#queryDefaults.values()];
2023
+ const result = {};
2024
+ defaults.forEach((queryDefault) => {
2025
+ if (partialMatchKey(queryKey, queryDefault.queryKey)) Object.assign(result, queryDefault.defaultOptions);
2026
+ });
2027
+ return result;
2028
+ }
2029
+ setMutationDefaults(mutationKey, options) {
2030
+ this.#mutationDefaults.set(hashKey(mutationKey), {
2031
+ mutationKey,
2032
+ defaultOptions: options
2033
+ });
2034
+ }
2035
+ getMutationDefaults(mutationKey) {
2036
+ const defaults = [...this.#mutationDefaults.values()];
2037
+ const result = {};
2038
+ defaults.forEach((queryDefault) => {
2039
+ if (partialMatchKey(mutationKey, queryDefault.mutationKey)) Object.assign(result, queryDefault.defaultOptions);
2040
+ });
2041
+ return result;
2042
+ }
2043
+ defaultQueryOptions(options) {
2044
+ if (options._defaulted) return options;
2045
+ const defaultedOptions = {
2046
+ ...this.#defaultOptions.queries,
2047
+ ...this.getQueryDefaults(options.queryKey),
2048
+ ...options,
2049
+ _defaulted: true
2050
+ };
2051
+ if (!defaultedOptions.queryHash) defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);
2052
+ if (defaultedOptions.refetchOnReconnect === void 0) defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
2053
+ if (defaultedOptions.throwOnError === void 0) defaultedOptions.throwOnError = !!defaultedOptions.suspense;
2054
+ if (!defaultedOptions.networkMode && defaultedOptions.persister) defaultedOptions.networkMode = "offlineFirst";
2055
+ if (defaultedOptions.queryFn === skipToken) defaultedOptions.enabled = false;
2056
+ return defaultedOptions;
2057
+ }
2058
+ defaultMutationOptions(options) {
2059
+ if (options?._defaulted) return options;
2060
+ return {
2061
+ ...this.#defaultOptions.mutations,
2062
+ ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),
2063
+ ...options,
2064
+ _defaulted: true
2065
+ };
2066
+ }
2067
+ clear() {
2068
+ this.#queryCache.clear();
2069
+ this.#mutationCache.clear();
2070
+ }
2071
+ };
2072
+ //#endregion
2073
+ export { isServer as a, notifyManager as i, MutationObserver as n, noop as o, QueryObserver as r, shouldThrowError as s, QueryClient as t };